Z80: Difference between revisions

Jump to navigation Jump to search
4 bytes added ,  28 April 2015
m
→‎SCF/CCF: Rename section heading slightly for readability
m (→‎OUT (C),0 / OUT (C),255 instruction: subtle renaming of section heading for readability)
m (→‎SCF/CCF: Rename section heading slightly for readability)
Line 21: Line 21:
Woody has confirmed that bits 3 and 5 of the flags are copied on all BIT instructions on both a Zilog Z80 and an NEC clone (stated on the link above as being "unverified").
Woody has confirmed that bits 3 and 5 of the flags are copied on all BIT instructions on both a Zilog Z80 and an NEC clone (stated on the link above as being "unverified").


=== SCF/CCF ===
=== SCF and CCF ===


Stuart Brady discovered that how bits 3 and 5 of the flags are set after the SCF and CCF instructions actually depends on the variant of Z80 in use. On a Zilog Z80, bits 3 and 5 of the flags were set by ORing their previous values with that of A. On an NEC clone, bit 3 was unaffected, while bit 5 appears to be set by ANDing the previous value with something unknown. Previously, Ian Greenway tested this and found that bits 3 and 5 seemed simply to be copied from A, although it is not known which CPU these tests were run on. For more details, see [http://sourceforge.net/mailarchive/forum.php?thread_name=20040217082529.GH17981%40philos.lan.philosys.de&forum_name=fuse-emulator-devel here], [http://sourceforge.net/mailarchive/forum.php?thread_name=20070522223156.GA12009%40miranda.arrow&forum_name=fuse-emulator-devel here] and a more recent investigation [http://groups.google.co.uk/group/comp.sys.sinclair/msg/56dd1fd4ccb5fb3b here].
Stuart Brady discovered that how bits 3 and 5 of the flags are set after the SCF and CCF instructions actually depends on the variant of Z80 in use. On a Zilog Z80, bits 3 and 5 of the flags were set by ORing their previous values with that of A. On an NEC clone, bit 3 was unaffected, while bit 5 appears to be set by ANDing the previous value with something unknown. Previously, Ian Greenway tested this and found that bits 3 and 5 seemed simply to be copied from A, although it is not known which CPU these tests were run on. For more details, see [http://sourceforge.net/mailarchive/forum.php?thread_name=20040217082529.GH17981%40philos.lan.philosys.de&forum_name=fuse-emulator-devel here], [http://sourceforge.net/mailarchive/forum.php?thread_name=20070522223156.GA12009%40miranda.arrow&forum_name=fuse-emulator-devel here] and a more recent investigation [http://groups.google.co.uk/group/comp.sys.sinclair/msg/56dd1fd4ccb5fb3b here].

Navigation menu