新手求个流程图。。
DATA SEGMENTMSGTITLE0 DB ' *-------------------------------------*',10,13,'$'
MSGTITLE1 DB ' | Now let"S paly a game,guess a word |',10,13,'$'
MSGTITLE2 DB ' | The word must be A(a)-----Z(z)! |',10,13,'$'
MSGTITLE3 DB ' | You have only 9 chance!! |',10,13,'$'
MSGTITLE4 DB ' *_____________________________________*',10,13,'$'
MSGINPUT DB 10,13,'input word:',10,13,'$'
MSGERROR DB 10,13,'wrong word!input again [A(a)--Z(z)]:',10,13,'$'
MSGRESCUE DB 10,13,'Rescue game:',10,13,'$'
MSGLARGE DB 10,13,'too large!!',10,13,'$'
MSGSMALL DB 10,13,'too small!!',10,13,'$'
MSGRIGHT1 DB 10,13,'Bingo!! you only used ','$'
MSGRIGHT2 DB ' times',10,13,'$'
MSGRECORD DB 'Congruatulation!!You break the record!','$'
MSGFAIL DB 'Game failed! You have use all chance!',10,13,'$'
MSGAGAIN DB 10,13,'Want try again?<y/n><Y/N>','$'
MSGQUIT DB 10,13,'Are you sure want to quit?<y/n><Y/N>','$'
AI DB ?
BTIME DB ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
;------------------------------------------------------------------
MAIN PROC FAR
START:
MOV AX,DATA
MOV DS,AX
LEA DX,MSGTITLE0
MOV AH,09H
INT 21H
LEA DX,MSGTITLE1
MOV AH,09H
INT 21H
LEA DX,MSGTITLE2
MOV AH,09H
INT 21H
LEA DX,MSGTITLE3
MOV AH,09H
INT 21H
LEA DX,MSGTITLE4
MOV AH,09H
INT 21H
MOV BTIME,'9'
CALL GETTIME
MOV AI,DH ;取当前秒为初始算子
BEGIN:
LEA DX,MSGINPUT
MOV AH,09H
INT 21H ;输入input number
MOV AL,AI
CALL GETTIME ;再次取当前秒
ADD AL,DH
MOV BL,DL ;bl加上当前1/100秒,
MUL BL ;之和再乘以当前秒。只为结果尽可能的随机
MOV BL,1AH ;范围是从A到Z共26个字母
DIV BL
MOV AI,AH
ADD AI,41H ;最小必须是A
; MOV DL,AI ;测试语句1
; MOV AH,02H ;测试语句2
; INT 21H ;测试语句3
; JMP AGAIN ;测试语句4
CALL COMPARE
AGAIN:
LEA DX,MSGAGAIN
MOV AH,09H
INT 21H
MOV AH,01H
INT 21H
CMP AL,'n' ;输入n表示退出
JE EXIT
CMP AL,'N' ;输入N也表示退出
JE EXIT
CMP AL,'y'
JE CONTINUE
CMP AL,'Y'
JE CONTINUE
JMP AGAIN ;如果既没有输入n、N,也没有输入y、Y,将会要求重输
CONTINUE:
JMP BEGIN
EXIT:
MOV AX,4C00H
INT 21H
MAIN ENDP
;--------------------------------------------------------------------
TIME PROC NEAR
GETTIME:
MOV AH,2CH ;2C系统功能调用,取系统时间
INT 21H
RET
TIME ENDP
;--------------------------------------------------------------------
COMPARE PROC NEAR
MOV CL,0
INPUT:
CMP CL,9H ;如果输入次数等于9,跳转游戏失败
JE FAILGAME
MOV AH,01H
INT 21H ;输入字符进行比较
MOV BL,AL
CMP BL,1BH
JE QUITGAME
INC CL
CMP BL,7AH
JA CONTIN
CMP BL,60H
JB CONTIN
SUB BL,20H
CONTIN:
CMP BL,'A' ;判断是否超出范围
JB ERROR
CMP BL,'Z'
JNBE ERROR
CMP BL,AI ;比较大小
JE WIN
CMP BL,AI
JB SMALLER
CMP BL,AI
JNBE LARGER
RESCUE:
LEA DX,MSGRESCUE
MOV AH,09H
INT 21H
JMP INPUT
SMALLER:
LEA DX,MSGSMALL
MOV AH,09H
INT 21H ;输出太小的提示信息,重新输入
JMP INPUT
LARGER:
LEA DX,MSGLARGE
MOV AH,09H ;输出太大的提示信息,重新输入
INT 21H
JMP INPUT
FAILGAME:
LEA DX,MSGFAIL
MOV AH,09H ;输出游戏失败
INT 21H
RET
WIN:
INC CL
LEA DX,MSGRIGHT1
MOV AH,09H ;相等,游戏结束,跳转到选择是否再玩一次
INT 21H
ADD CL,2FH ;CL为比较次数,输出
MOV DL,CL
MOV AH,02H ;输出比较的次数
INT 21H
LEA DX,MSGRIGHT2
MOV AH,09H
INT 21H
MOV BL,BTIME ;比较是否小于最好成绩
CMP CL,BL
JC NEWRECORD
RET
QUITGAME:
LEA DX,MSGQUIT
MOV AH,09H ;提示是否退出游戏
INT 21H
MOV AH,01H
INT 21H
CMP AL,'Y' ;输入n表示退出
JE EXIT1
CMP AL,'y' ;输入N也表示退出
JE EXIT1
CMP AL,'N'
JE RESCUE
CMP AL,'n'
JE RESCUE
JMP ERROR
ERROR:
LEA DX,MSGERROR
MOV AH,09H ;输入错误,重新输入
INT 21H
JMP INPUT
NEWRECORD:
LEA DX,MSGRECORD
MOV AH,09H ;输出新的最佳成绩
INT 21H
MOV BTIME,CL
RET
EXIT1:
MOV AX,4C00H
INT 21H
COMPARE ENDP
;-------------------------------------------------
CODE ENDS
END START
额,这个程序老师让我们写个流程图,明天就要了。。希望你们能帮下。。感激不尽!!