;确定自变量中为1的最低位数
.model small
.stack
.data
wordx dw 56
bytey db ?
.code
.startup
mov ax,wordx
mov cx,16
mov dl,-1
again:
inc dl
test ax,1
ror ax,1
loope again ;CX不=0且ZF=1(测试为为0),则继续循环
je notfound
mov bytey,dl
jmp done
notfound:
mov bytey,-1
done:
.exit 0
end
参考资料:钱晓捷《汇编语言程序设计》第4章例4.6