DAA Half Transfer / Half Capture Flag

I apologize for making this my second question ZAQ DAA - now I have almost completely completed this instruction, but there is one thing that I'm not sure about is the flag H set by this instruction in general? The Z80 manual says “see the Instruction”, but it only mentions the flag before the DAA, and not after its execution.

I set the flags as follows:

S is set if the result is negative (0x80 and the result is 0x80) Z is set if the result is zero H (this question is not certain from here) P / V is set to the parity of the result (1 if it is even, 0 if it is odd) N remains at rest C is set if the higher size of the original battery value is changed

Other than that, the command seems to execute, as I expect it :-) I hope someone can fix this for me, thank you very much.

+5
source share
2 answers

That's a good question. Yes, the behavior of the flag H is clearly not documented, because the behavior is non-standard with DAA.

If the lower nibble (least significant four bits) A is a non-base-10 number (more than 9, for example A, B, C, D, E or F), the flag is set or H, 6 is added to the register. This means that even if the lower nibble is in the range 0-9, you can force 6 to register A by setting the flag H.

, H , , , " ", , H . , H DAA , , .

+2

, half-carry/loan DAA.

, AF ( ) DAA DAS x86. , - i8080/i8085/Z80 i8086 DAA/DAS.

x86 DAA/DAS AF 1, 4 6. , AF 0.

DAA DAS Intel ( AMD) x86.

+2

All Articles