将ASCII码表示的十进制数转换成二进制
DATA SEGMENT
MSR DB "00012"
LEN EQU $-MSR
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE, DS:DATA
START: MOV AX, DATA
MOV DS,AX
MOV SI, OFFSET MSR
MOV CX,LEN-1
MOV AL, DS:[SI]
MOV AH,0
SUB AX,30H
NEXT1: MOV BX,0AH
MUL BX
INC SI
MOV DL,DS:[SI]
MOV DH,0
SUB DX,30H
ADD AX,DX
DEC CX
JNZ NEXT1
MOV CL,16
MOV BX,AX
NEXT2: ROL BX,1
MOV DL,BL
AND DL,01H
ADD DL,30H
MOV AH,2H
INT 21H
DEC CL
JNZ NEXT2
MOV AX,4C00H
INT 21H
CODE ENDS
END START