Changes

Jump to: navigation, search

Z80

162 bytes removed, 5 February
/* Internal state */
On Zilog NMOS Z80, when the instruction doesn't compute new flags, this register is cleared instead. But not on NEC NMOS Z80. And CMOS Z80 behave in a different way too.
Normally, you never see the content of this register. But it leaks through F5 and F3 in the SCF/CCF instructions. [https://worldofspectrum.org/forums/discussion/41704 Source]
Emulating Q is Also note that while POP AF and EX AF,AF' modify F, they do not strictly necessary. A 1-bit compute new flag, indicating whether the previous instruction computed flags, is enough to emulate the behaviour of SCF/CCFvalues. [https://github.com/hoglet67/Z80Decoder/wiki/Undocumented-Flags#scfccf Source] Also note that while POP AF and EX AF,AF' modify F, they do not compute new flag values.
The explanation above is just an approximation. In fact, '''SCF/CCF instructions are unstable'''. [https://github.com/hoglet67/Z80Decoder/wiki/Unstable-CCF-SCF-Behaviour Source]
13,173
edits