设计一多分支程序,要求从键盘输入数字‘0’~‘9’,以决定转向哪一分支。
①CODE1 SEGMENT
ASSUME CS:CODE2
START:MOV AH,1
INT 21H
CMP AL,30H
JE PROC 0
CMP AL,31H
JE PROC 1
CMP AL,32H
JE PROC 2
.
.
.
PROC0:……
.
.
.
PROC1:……
.
.
.
PROC2:……
.
.
.
MOV AH,4CH
INT 21H
CODE1 ENDS
END START
②CODE2 SEGMENT
ASSUME CS:CODE2
START:MOV AH,1
INT 21H
CMP AL,30H
JB START
CMP AL,39H
JA START
SUB AL,30H
MOV AH,0
LEA BX,TAB
ADD BX,AX
JMP BX
.
.
.
TAB: JMP SHORT PROC0
JMP SHORT PROC1
JMP SHORT PROC2
.
.
.
MOV AH,4CH
INT 21H
CODE2 ENDS
END START