Question

In the following link,

http://www.z80.info/z80syntx.htm#DAA

I got confused over the condition for setting H flag. The description says to look at the table but unlike C where there is the column C after DAA, for H there is only H before DAA...

So, how should H be updated after DAA? Thanks for the help!! Appreciate it! :)

Was it helpful?

Solution

Sean Young's document (PDF; Page 18) provides the exact circumstances. In short, if you added then H is set exactly when you end up with a result greater than 9 in the low nibble. If you subtracted then H is set exactly when it was set prior to the operation and the result in the low nibble is less than 6.

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