把bx中的16进制以16进制的形式输出出来
DATAS SEGMENT;此处输入数据段代码
DATAS ENDS
STACKS SEGMENT
;此处输入堆栈段代码
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
MOV BX,23ABH
MOV DX,BX
AND DX,0F000H
ROR DL,1
ROR DL,1
ROR DL,1
CMP DL,9
JA JIA3
ADD DL,30H
JMP JIAA3
JIA3:ADD DL,37H
JIAA3:MOV AH,2
INT 21H
MOV DX,BX
AND DX,0f00H
ROR DL,1
ROR DL,1
CMP DL,9
JA JIA2
ADD DL,30H
JMP JIAA2
JIA2:ADD DL,37H
JIAA2:MOV AH,2
INT 21H
MOV DX,BX
AND DX,00F0H
ROR DL,1
CMP DL,9
JA JIA1
ADD DL,30H
JMP JIAA1
JIA1:ADD DL,37H
JIAA1:MOV AH,2
INT 21H
MOV DX,BX
AND DX,000FH
CMP DL,9
JA JIA
ADD DL,30H
JMP JIAA
JIA:ADD DL,37H
JIAA:MOV AH,2
INT 21H
;此处输入代码段代码
MOV AH,4CH
INT 21H
CODES ENDS
END START
比较麻烦,因为寄存器不够用没用循环,思路就是分别把各位16进制移到最后,判断在a之前还是之后,转换成ascii然后输出,结果输出的结果是四只乱码。。。求前辈们帮改下。