Question

Wikipedia says :

Auxiliary flag is set(AF=1) if there is a carry from low nibble to high nibble or a borrow from a high nibble to low nibble of the low order 8-bit of a 16-bit number.(for example, in BCD addition or subtraction.)

Does this mean that when I do : MOV AL, 25F

since 25F is 00100101 and the lower nibble wasn't sufficient, AF gets set?

Or is it only during addition/subtraction?

Was it helpful?

Solution

mov does not affect any flags.

add and sub do set AF, but so do many other instructions too, for example adc, cmp, cmpxchg, dec, inc, sbb, neg.

Many other instructions leave AF in an undefined state, for example mul, imul, div, idiv, test, and, or, xor, shr.

OTHER TIPS

You could easily try it in the debugger instead of guessing. Or you could check the reference, which clearly says:

Flags Affected: None.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top