mov ah, 00h ; display function here?
不是,单字符显示功能在AH=2 / int 21h http://spike.scu.edu.au/~barry/interrupts.html#ah02
由于您的 BL 寄存器仅包含一个很小的值 (9),因此它所需要的就是:
mov ah, 02h
mov dl, bl
add dl, "0" ; Integer to single-digit ASCII character
int 21h
如果值变得更大但不超过 99,您可以通过以下方式解决:
mov al, bl ; [0,99]
aam ; divide by 10: quotient in ah, remainder in al (opposite of DIV)
add ax, "00"
xchg al, ah
mov dx, ax
mov ah, 02h
int 21h
mov dl, dh
int 21h
不使用的解决方案AAM
操作说明:
mov al, bl ; [0,99]
cbw ; Same result as 'mov ah, 0' in this case
mov dl, 10
div dl ; Divides AX by 10: quotient in al, remainder in ah
add ax, "00"
mov dx, ax
mov ah, 02h
int 21h
mov dl, dh
int 21h