Reputation: 79
I want to know if the Auxiliary Flag is set or not ? How I can do it in Assembly. Any help will be appreciated.
Upvotes: 2
Views: 2723
Reputation: 3311
Use lahf
(load AH from flags) followed by test
(to check the value):
lahf
test ah, 10h
jnz .aux_nonzero
Upvotes: 7
Reputation: 34592
Have a look at this site which details comprehensive assembly instruction sets for the x86 architecture.
dang gregh you beat me to it... oh well....
It's the fourth bit that represents the Auxiliary Flag (AF)... as shown here
Upvotes: 1
Reputation: 993095
One way to do this is to push the flags register onto the stack (pushf
), then pop it off into a general purpose register (pop ax
for example), and inspect the bits in ax
.
Upvotes: 2