代码如下:
STACK SEGMENT STACK
DB 200 DUP(0)
STACK ENDS
DATA SEGMENT
TAB DB '0123456789ABCDEF'
OUT1 DB 0DH,0AH,'THE ASCII CODE OF$'
OUT2 DB 'IS',0,0,'H$'
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,SS:STACK
BEGIN:MOV AX,DATA
MOV DS,AX
LEA BX,TAB
LOPA:LEA DX,OUT1
MOV AH,9
INT 21H
MOV AH,1
INT 21H
CMP AL,0DH
JE EXIT
MOV DH,AL
MOV AL,0FH
XLAT
MOV OUT2+5,AL
MOV AL,DH
MOV CL,4
SHR AL,CL
XLAT
MOV OUT2+14H,AL
LEA DX,OUT2
MOV AH,9
INT 21H
JMP LOPA
EXIT: MOV AH,4CH
INT 21H
CODE ENDS
END BEGIN
哪里出错了,求解等待ING
------解决方案--------------------------------------------------------
debug 单步走下不就知道了?
- Assembly code
MOV AL,0FH ; 这里应该是 and al, 0fh 吧 XLAT MOV OUT2+5,AL ; 应该是 mov OUT2+3, AL 吧 MOV AL,DH MOV CL,4 SHR AL,CL XLAT MOV OUT2+14H,AL ; 14H? 什么道理? 应该是 2 吧 ; 不过这样最后的版面上有些难看, IS 前后最好有空格, 这样就会让上面两个值有变化