开发者

How to fetch a bit in IA32 assembly language?

How can I check if a bit in some position of a word is 1 with the IA32 assemb开发者_如何学Pythonly language?


Test, something like:

value = 000100h

mov eax, your_word
test eax, value
jnz was_set


NASM:

bt ax, <POS> ; test if bit at position is set: 1 means carry will be set 0 means carry will be unset
adc eax, 0   ; add 0 + carry to eax

You could also use jc (jump carry set) jnc (jump carry not set)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜