📄 bcd_aaa.asm
字号:
; This example shows the use
; of AAA instruction (ASCII
; Adjust after Addition).
; It is used to add huge
; BCD numbers.
#make_COM#
ORG 100h
; first number '9':
MOV AH, 09h
; second number '5':
MOV AL, 05h
; AL = AL + AH =
; = 09h + 05h = 0Eh
ADD AL, AH
; clear tens byte of BCD
; result:
XOR AH, AH
; adjust result to BCD form,
; AH = 1, AL = 4 -> '14'
AAA
; print the result:
; store contents of
; AX register:
MOV DX, AX
; print first digit:
MOV AH, 0Eh
; convert to ascii:
OR DH, 30h
MOV AL, DH
INT 10h
; print second digit:
; convert to ascii:
OR DL, 30h
MOV AL, DL
INT 10h
RET
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -