3

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! :)

kofhearts
  • 3,607
  • 8
  • 46
  • 79

1 Answers1

4

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.

Tommy
  • 99,986
  • 12
  • 185
  • 204