• Please review our updated Terms and Rules here

8080 instruction flag question

vbriel

Experienced Member
Joined
Aug 3, 2003
Messages
332
Location
SoCal
Ok, I'm writing an emulator for a microcontroller and I'm stuck on SBB commands.

If A=0 and B=1 and Carry flag is set. If I do a SBB B the result in a is FE which is correct. The problem is, the half carry flag is setting. Is this correct? Reading the Intel manual it looks like this is correct, but I'm checking my work with Altair32 and it is not setting the HC flag on this.

Thanks,

Vince
 
Can somebody tell me if the aux carry (half carry) flag is only used for the DAA opcode?

Thanks,

Vince
 
In the Intel 8080 and Z80, that is the case. In the original NEC 8080 ISTR that its setting was a bit different. It's probably safe to say that if your DAA emulation operates correctly, then you don't have to worry about the H flag.

There is a possibility that it could be used to tell CPU variants apart by some diagnostic programs, but I don't know that any such programs exist.
 
Back
Top