Z80: Difference between revisions

Jump to navigation Jump to search
1 byte added ,  28 April 2015
m
→‎OUT (C),0 / OUT (C),255 instruction: subtle renaming of section heading for readability
m (→‎Notable uses: Add links)
m (→‎OUT (C),0 / OUT (C),255 instruction: subtle renaming of section heading for readability)
Line 33: Line 33:
The NMOS Z80s suffer a problem whereby LD A,I and LD A,R record the state of IFF2 after it has been reset if an interrupt is delivered during that instruction.  This behaviour, along with workarounds for this for use in interrupt handlers are documented in the [http://z80.info/zip/ZilogProductSpecsDatabook129-143.pdf Z80 Family Questions and Answers] section of the Zilog Product Specifications Databook, and is useful for detecting the model of Z80 in use, so as to determine whether the CPU (assuming it is a genuine NMOS or CMOS Z80) provides an 'OUT (C),0' instruction (NMOS), or 'OUT (C),255' instead (CMOS).
The NMOS Z80s suffer a problem whereby LD A,I and LD A,R record the state of IFF2 after it has been reset if an interrupt is delivered during that instruction.  This behaviour, along with workarounds for this for use in interrupt handlers are documented in the [http://z80.info/zip/ZilogProductSpecsDatabook129-143.pdf Z80 Family Questions and Answers] section of the Zilog Product Specifications Databook, and is useful for detecting the model of Z80 in use, so as to determine whether the CPU (assuming it is a genuine NMOS or CMOS Z80) provides an 'OUT (C),0' instruction (NMOS), or 'OUT (C),255' instead (CMOS).


=== OUT (C),0 / OUT (C),255 instruction ===
=== OUT (C),0 or OUT (C),255 instruction ===
In 1996, Simon Cooke noted in a [https://groups.google.com/d/msg/comp.os.cpm/HfSTFpaIkuU/KotvMWu3bZoJ Usenet posting] that the undocumented instruction usually referred to as 'OUT (C),0' behaves instead as 'OUT (C),255' on CMOS Z80s.
In 1996, Simon Cooke noted in a [https://groups.google.com/d/msg/comp.os.cpm/HfSTFpaIkuU/KotvMWu3bZoJ Usenet posting] that the undocumented instruction usually referred to as 'OUT (C),0' behaves instead as 'OUT (C),255' on CMOS Z80s.


Navigation menu