Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Z80 DAA flags affected

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

like image 279
kofhearts Avatar asked Jul 16 '26 03:07

kofhearts


1 Answers

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.

like image 104
Tommy Avatar answered Jul 20 '26 23:07

Tommy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!