OUTI affecting Carry against Z80 documentation

Door hope-hunter

Rookie (22)

afbeelding van hope-hunter

12-02-2022, 23:58

I see that OUTI instruction is affecting Carry flag on BlueMSX. A friend check it on OpenMSX and saw that also other flags is affecting too. But Z80 documentations says that OUTI must affect only Z flag (according B register that is decremented). What can be done? Shocked!

On Blue MSX, for example:
HL=8000H => C
HL=80FxH => NC

Aangemeld of registreer om reacties te plaatsen

Van Manuel

Ascended (18777)

afbeelding van Manuel

13-02-2022, 00:18

Van hope-hunter

Rookie (22)

afbeelding van hope-hunter

13-02-2022, 00:25

Oh, very good this document! Thank you Manuel! Smile

The answer (page 24):
"• The INI/INIR/IND/INDR/OUTI/OUTD/OTIR/OTDR instructions do affect
the CF flag (some official documentation says they leave it unaffected, important!)
and the NF flag isn’t always set but may also be reset (see 4.3 for exact operation)."

Van Grauw

Ascended (10577)

afbeelding van Grauw

06-03-2022, 01:53

Note that unlike the Z80, on the R800 the flags do behave as the Z80 manual describes. So only the zero and add/subtract flags are affected, and carry etc are unchanged. See here.

Thanks to Japanese Twitter user @mdpc___ for discovering. He’s posted some other nice stuff too btw, worth checking out his channel and following.

Van hope-hunter

Rookie (22)

afbeelding van hope-hunter

31-03-2022, 06:58

Very interesting. Thank you Grauw!