帮忙改一下错误啊,为什么运行结果总是不对呢?
6) 从键盘上接收一位十进制数X,计算Y值,并以十六进制形式显示出来,Y按下列公式计算。X²+X(X=3)
Y = X²-2X(X=4)
X²(X=5)
X²/2(X=6)
DATA SEGMENT
X DB ?
TABLE DW L0, L1, L2, L3, L4,L5, L6, L7
DATA ENDS
STACK1 SEGMENT PARA STACK
DW 20H DUP(0)
STACK1 ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:MOV AX,DATA
MOV DS,AX
MOV AH,01H
INT 21H
CMP AL,33H
JB L0
CMP AL,36H
JA L0
AND AL,0FH
MOV X,AL
SUB AL,3
SHL AL,1
XOR AH,AH
LEA BX,TABLE
ADD BX,AX
JMP [BX]
L1:MOV AL,X
MUL AL
ADD AL,X
JMP L5
L2:MOV AL,X
MUL AL
SUB AL,X
SUB AL,X
JMP L5
L3:MOV AL,X
MUL AL
JMP L5
L4:MOV AL,X
MUL AL
MOV CL,1
SHR AL,CL
JMP L5
L5:MOV BL,AL
MOV CL,4
SHR AL,CL
CMP AL,9
JBE L6
ADD AL,7
L6:ADD AL,30H
MOV AH,2
MOV DL,AL
INT 21H
AND BL,0FH
CMP BL, 9
JBE L7
ADD BL, 7
L7:ADD BL,36H
MOV DL,BL
INT 21H
L0: MOV AH,4CH
INT 21H
CODE ENDS
END START