[汇编]将寄存器al中二进制数输出
;将寄存器al中二进制数输出
data segment
n db ?
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov al,0ffh
mov n,al
mov cx,8
again:
shl n,1 ;逻辑左移
jnc disp_0
jc disp_1
disp_1:
mov dl,31h
mov ah,2
int 21h ;al将获得显示字符的ASCII码
dec cx
cmp cx,0
jz done
jnz again
disp_0:
mov dl,30h
mov ah,2
int 21h
dec cx
cmp cx,0
jz done
jnz again
done:
mov ah,4ch
int 21h
code ends
end start
微信赞赏
支付宝赞赏
本文出自 纳百川,转载时请注明出处及相应链接。
本文永久链接: https://www.bicner.com/176.html