将 ASCII 码表示的十进制数转换为二进制数



SSTACK     SEGMENT STACK
           DW 64 DUP(?)
SSTACK     ENDS
DATA       SEGMENT
SADD       DB 30H,31H,32H,33H,34H ;十进制数:01234
DATA       ENDS
CODE       SEGMENT
           ASSUME CS:CODE, DS:DATA
START:     MOV AX, DATA
MOV        DS, AX
MOV        AX, OFFSET SADD
MOV        SI, AX
MOV        BX, 000AH
MOV        CX, 0004H
MOV        AH, 00H
MOV        AL, [SI]
           SUB AL, 30H
A1:        IMUL BX
           MOV    DX, [SI+01]
           AND DX, 00FFH
           ADC AX, DX
           SBB AX, 31H
           INC SI
           LOOP A1
A2:         JMP A2
CODE     ENDS
              END START
 
 

你可能感兴趣的:(ASCII)