DATA SEGMENT
BIN1 DB 35H
BIN2 DW 0AB48H
NUM DB 8,16
ASCBUF DB 20H DUP(0)
TABLE DW 3 DUP(0)
DATA ENDS
.....
COSEG SEGMENT
...
MOV TABLE,OFFSET BIN1
MOV TABLE+2,OFFSET NUM
MOV TABLE+4,OFFSET ASCBUF
MOV BX,OFFSET TABLE
CALL BINASC8
...
MOV TABLE,OFFSET BIN2
MOV TABLE+2,OFFSET NUM+1
MOV TABLE+4,OFFSET ASCBUF+10H
MOV BX,OFFSET TABLE
CALL BINASC16
--------------------------------------------------------------
--------------------------------------------------------------
子程序如下:
BINASC PROC
BINASC8: MOV DI,[BX]
MOV DH,[DI]
JMP TRAN
BINASC16: MOV DI,[BX]
MOV DX,[DI]
TRAN: MOV DI,[BX+2]
MOV CL,[DI]
XOR CH,CH
MOV DI,[BX+4]
LOP: ROL DX,1
MOV AL,DL
AND AL,01H
ADD AL,30H
MOV [DI],AL
INC DI
LOOP LOP
RET
BINASC ENDP
◆◆
评论读取中....
请登录后再发表评论!
◆◆
修改失败,请稍后尝试