DECIHEX SEGMENT
ASSSUME CS:DECIHEX
;*****************************************************************
MAIN PROC FAR
REPEAT: CALL DECIBIN
CALL CRLF
CALL BINIHEX
CALL CRLF
JMP REPEAT
MAIN ENDP
;*******************************************************************
DECIBIN PROC NEAR
MOV BX,0
NEWCHAR: MOV AH,01H
INT 21H
SUB AL,30H
JL EXIT
CMP AL,39H
JG EXIT
CBW
XCHG AX,BX
MOV CX,10
MUL CX
XCHG AX,BX
ADD BX,AX
JMP NEWCHAR
EXIT: RET
DECIBIN ENDP
;********************************************************************
BINIHEX PROC NEAR
MOV CH,4
ROTATE:MOV CL,4
ROL BX,CL
MOV AL,BL
ADN AL,0FH
ADD AL,30H
CMP AL,3AH
JL PRINTIT
ADD AL,7H
PRINTIT:MOV DL,AL
MOV AH,02H
INT 21H
DEC CH
JNZ ROTATE
RET
BINIHEX ENDP
;*****************************************************************
CRLF PROC NEAR
MOV DL,0DH
MOV AH,02H
INT 21H
MOV DL,0AH
MOV AH,02H
INT 21H
RET
CRLF ENDP
;******************************************************************
DECIHEX ENDS
END MAIN
请各位大侠帮忙看看上面的程序,错在哪里?
还有,里面的DECIBIN子程序块我不是很理解