
4-28
x86 MICROPROCESSORS
MOV AL, ’6’ ;AL = 36H
AND AL, 0FH ;AL = 06H
MOV BL, ’9’ ;BL = 39H
AND BL, 0FH ;BL = 09H
MUL BL ;AX = 0036H;decimal value is 54
AAM ;AX = 0504H, the unpacked BCD of 54
OR AX, 3030H ;AX = 3534H, the ASCII value of 54
MOV CX, AX ;copy AX to CX
MOV DL, CH ;DL = CH to display the MSD
DISP ;call macro for display
MOV DL, CL ;DL = CL to display the LSD
DISP ;call macro for display
.EXIT
END
AAD – ASCII adjust AX before division.
Usage: AAD
This instruction works by converting the unpacked BCD in AX to binary (hex) before
division. It multiplies AH by 10, adds the product to AL and clears AH. This is the hex
representation ...