懂汇编的大佬帮忙做一下
发布网友
发布时间:2024-09-27 05:52
我来回答
共1个回答
热心网友
时间:2024-10-25 18:21
CODE SEGMENT
ASSUME CS:CODE
ORG 100H
START: PUSH CS
POP DS
PUSH CS
POP ES
@0: MOV AH,7
INT 21H
CMP AL,13
JE @EXIT
CMP AL,'0'
JB @0
CMP AL,'9'
JA @0
MOV DL,AL
MOV AH,2
INT 21H
CALL DISP16
JMP @0
@EXIT:
MOV AH,4CH
INT 21H
DISP16 PROC NEAR
PUSH DI
PUSH AX
PUSH AX
LEA DI,CARR
MOV AH,2
MOV DL,32
INT 21H
POP AX
MOV CL,4
SHR AL,CL
MOV AH,0
MOV BX,AX
MOV AH,2
MOV DL,[DI+BX]
INT 21H
POP AX
AND AL,0FH
MOV AH,0
MOV BX,AX
MOV AH,2
MOV DL,[DI+BX]
INT 21H
MOV DL,'H'
INT 21H
MOV DL,13
INT 21H
MOV DL,10
INT 21H
POP DI
RET
CARR DB '0123456789ABCDEF'
DISP16 ENDP
CODE ENDS
END START