帮帮忙,用汇编语言编个程序

来源:百度知道 编辑:UC知道 时间:2024/05/10 02:23:59
W中含1的个数,并在屏幕上显示出来

W是8位
dseg segment
w db 0AFH
dseg ends
cseg segment
assume cs:cseg,ds:dseg
begin: mov ax,dseg
mov ds,ax
mov al,w
xor dl,dl
mov cx,16
next: shl al,1
jnc skip
inc dl
skip: loop next
xor dl,30H
mov ah,2
int 21h
mov ah,4ch
int 21h
cseg ends
end begin

9494...而且W是不是数啊