Electrical – 8085 programming the ani instruction

8085

Why is the AC flag set while using the ANI instruction in 8085:

MVI A, A3H
ANI 97H
HLT

The sign flag is set which is understandable but the AC flag is also set which makes no sense because, there's no carry from the D3 bit to D4 bit. How is this happening?

Best Answer

ANI unconditionally sets AC. That's how it's defined.

ANI [...] [...] AC is set.