请问这个改成XLAT指令后怎么就出错了呢,高手帮忙
就是输入数字,显示其缩写英文DATA SEGMENT
D1 DB 20
DB ?
DB 2 DUP(?)
EMON DB 'JAN' ,'FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC'
CHAR DB 3 DUP(?),0DH,0AH,'$'
D2 DB 'INPUT MONTH',0DH,0AH,'$'
D3 DB ?
ERRMSG db 'INPUT ERROR!',0DH,0AH,'$'
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,ES:DATA
MAIN PROC FAR
START:
MOV AX,DATA
MOV DS,AX
MOV ES,AX
CALL INPUT
CALL LOCATE
CALL DISPLAY
;JMP START
EXIT:MOV AH,4CH
INT 21H
RET
MAIN ENDP
INPUT PROC NEAR
LEA DX,D2
MOV AH,9
INT 21H
LEA DX,D1
MOV AH,0AH
INT 21H
MOV AL,D1+2
SUB AL,'0'
CMP AL,9
JA IPEXIT
CMP AL,0
JB IPEXIT
MOV AL,D1+1
CMP AL,2
JA ERR
JB SINGLE1
MOV AL,D1+2
SUB AL,'0'
CMP AL,1
JA ERR
JB SINGLE2
MOV BL,10
MUL BL
MOV AH,D1+3
SUB AH,'0'
CMP AH,2
JA ERR
ADD AL,AH
MOV D3,AL
RET
SINGLE1: MOV AL,D1+2
SUB AL,'0'
MOV D3,AL
RET
SINGLE2:
MOV AH,D1+3
SUB AH,'0'
ADD AL,AH
MOV D3,AL
RET
ERR:
LEA DX,ERRMSG
MOV AH,9
INT 21H
IPEXIT:MOV AH ,4CH
INT 21H
INPUT ENDP
LOCATE PROC NEAR
MOV AL,D3
DEC AL
MOV BL,3
MUL BL
MOV SI,0
MOV BX,OFFSET EMON
MOV AH,0
ADD BX,AX
MOV cx,3
mov al,0
mov si,0
lop:
xlat
mov char[si],al
inc al
inc si
loop lop
RET
LOCATE ENDP
DISPLAY PROC NEAR
LEA DX,char
MOV AH,9
INT 21H
RET
DISPLAY ENDP
CODE ENDS
END START