
166 THE x86 MICROPROCESSORS
RPT: MOV AL, ASCDAT[DI] ;bring fi rst ASCII data to AL
AND AX, 000FH ;mask AX
MOV BX, WORD PTR[SI] ;get the multiplicand to BX
MUL BX ;multiply AX by BX
ADD BINAR,AX ;add to binary value
DEC DI ;decrement byte pointer
INC SI ;increment word pointer
INC SI ;two increments required
LOOP RPT ;repeat until CX = 0
.EXIT
END
e above program is a direct application of the algorithm mentioned. We get the con-
verted binary value in the word location BINAR. We can extend this for more number of
digits too.
4.6.2 | Converting Binary Numbers to ASCII Form
e method for this is repetitive division. is has ...