<br />
<b>Notice</b>:  Trying to access array offset on value of type bool in <b>/mnt/cpcwiki-httpdocs/includes/libs/IPSet.php</b> on line <b>243</b><br />
<br />
<b>Notice</b>:  Trying to access array offset on value of type bool in <b>/mnt/cpcwiki-httpdocs/includes/libs/IPSet.php</b> on line <b>246</b><br />
<br />
<b>Notice</b>:  Trying to access array offset on value of type bool in <b>/mnt/cpcwiki-httpdocs/includes/libs/IPSet.php</b> on line <b>243</b><br />
<br />
<b>Notice</b>:  Trying to access array offset on value of type bool in <b>/mnt/cpcwiki-httpdocs/includes/libs/IPSet.php</b> on line <b>246</b><br />
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://oldwiki.cpcwiki.eu/index.php?action=history&amp;feed=atom&amp;title=Some_features_of_the_Z80</id>
		<title>Some features of the Z80 - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://oldwiki.cpcwiki.eu/index.php?action=history&amp;feed=atom&amp;title=Some_features_of_the_Z80"/>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Some_features_of_the_Z80&amp;action=history"/>
		<updated>2026-08-29T23:24:58Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Some_features_of_the_Z80&amp;diff=102573&amp;oldid=prev</id>
		<title>DavidL: /* IFF0 and IFF1 */ --&gt; IFF1 and IFF2 are official names found in all Zilog Z80 datasheets</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Some_features_of_the_Z80&amp;diff=102573&amp;oldid=prev"/>
				<updated>2018-12-29T21:45:41Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;IFF0 and IFF1: &lt;/span&gt; --&amp;gt; IFF1 and IFF2 are official names found in all Zilog Z80 datasheets&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 21:45, 29 December 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L223&quot; &gt;Line 223:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 223:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* If the LDIR/LDDR opcode is overwritten by itself then command execution will stop. Effectively, the LDIR opcode is repeatidly fetched and decoded for each byte fetched from memory. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* If the LDIR/LDDR opcode is overwritten by itself then command execution will stop. Effectively, the LDIR opcode is repeatidly fetched and decoded for each byte fetched from memory. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IFF0 and &lt;/del&gt;IFF1 ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== IFF1 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and IFF2 &lt;/ins&gt;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IFF0 &lt;/del&gt;reflects the state of the maskable interrupt. The maskable interrupt can be enabled using the Z80 instruction &amp;quot;EI&amp;quot; and disabled using the Z80 instruction &amp;quot;DI&amp;quot;. When &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IFF0 &lt;/del&gt;is &amp;quot;1&amp;quot; masked interrupts are enabled, when a interrupt request is received by the Z80 it will be acknowledged and the interrupt handler executed. When &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IFF0 &lt;/del&gt;is &amp;quot;0&amp;quot; masked interrupts are disabled, any interrupt requests are ignored. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;IFF1 &lt;/ins&gt;reflects the state of the maskable interrupt. The maskable interrupt can be enabled using the Z80 instruction &amp;quot;EI&amp;quot; and disabled using the Z80 instruction &amp;quot;DI&amp;quot;. When &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;IFF1 &lt;/ins&gt;is &amp;quot;1&amp;quot; masked interrupts are enabled, when a interrupt request is received by the Z80 it will be acknowledged and the interrupt handler executed. When &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;IFF1 &lt;/ins&gt;is &amp;quot;0&amp;quot; masked interrupts are disabled, any interrupt requests are ignored. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When a non-maskable interrupt (NMI) is executed by the Z80, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IFF1 &lt;/del&gt;is set to the value of &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IFF0&lt;/del&gt;. Then &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IFF0 &lt;/del&gt;is set to &amp;quot;0&amp;quot; to disable maskable interrupts. The NMI handler will be executed.When a &amp;quot;RETN&amp;quot; instruction is executed by the Z80, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IFF0 &lt;/del&gt;is set to the value in &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IFF1&lt;/del&gt;, therefore the maskable interrupt state is restored. The state of &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;IFF0 &lt;/del&gt;can be set at any time using the &amp;quot;DI&amp;quot; and &amp;quot;EI&amp;quot; instructions. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When a non-maskable interrupt (NMI) is executed by the Z80, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;IFF2 &lt;/ins&gt;is set to the value of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;IFF1&lt;/ins&gt;. Then &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;IFF1 &lt;/ins&gt;is set to &amp;quot;0&amp;quot; to disable maskable interrupts. The NMI handler will be executed. When a &amp;quot;RETN&amp;quot; instruction is executed by the Z80, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;IFF1 &lt;/ins&gt;is set to the value in &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;IFF2&lt;/ins&gt;, therefore the maskable interrupt state is restored. The state of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;IFF1 &lt;/ins&gt;can be set at any time using the &amp;quot;DI&amp;quot; and &amp;quot;EI&amp;quot; instructions.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== IM 0, IM 1, IM 2 ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== IM 0, IM 1, IM 2 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:102572:newid:102573 --&gt;
&lt;/table&gt;</summary>
		<author><name>DavidL</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Some_features_of_the_Z80&amp;diff=102572&amp;oldid=prev</id>
		<title>DavidL: /* Flags/Status Register (F and F') */</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Some_features_of_the_Z80&amp;diff=102572&amp;oldid=prev"/>
				<updated>2018-12-29T20:29:43Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Flags/Status Register (F and F&amp;#039;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 20:29, 29 December 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L43&quot; &gt;Line 43:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note: &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note: &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are two bits in the flags register which are documented by Zilog as being unused. But in fact these bits do change: these bits are updated according to an undocumented register of the Z80 named either WZ or MEMPTR. This undocumented register is used to store temporary results such as 16-bits arithmetic results, and address (for example, loading I and the vector byte for interruption mode 2 to compute the value to load in PC).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are two bits in the flags register which are documented by Zilog as being unused. But in fact these bits do change: these bits are updated according to an undocumented register of the Z80 named either WZ or MEMPTR. This undocumented register is used to store temporary results such as 16-bits arithmetic results, and address (for example, loading I &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;register &lt;/ins&gt;and the vector byte for interruption mode 2 to compute the value to load in PC &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;register&lt;/ins&gt;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Sign flag ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Sign flag ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:102571:newid:102572 --&gt;
&lt;/table&gt;</summary>
		<author><name>DavidL</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Some_features_of_the_Z80&amp;diff=102571&amp;oldid=prev</id>
		<title>DavidL: /* Flags/Status Register (F and F') */ Completing information about undocumented flags bits 5 &amp; 3</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Some_features_of_the_Z80&amp;diff=102571&amp;oldid=prev"/>
				<updated>2018-12-29T20:28:48Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Flags/Status Register (F and F&amp;#039;): &lt;/span&gt; Completing information about undocumented flags bits 5 &amp;amp; 3&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 20:28, 29 December 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L43&quot; &gt;Line 43:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note: &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note: &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are two bits in the flags register which are documented by Zilog as being unused. But in fact these bits do change: &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are two bits in the flags register which are documented by Zilog as being unused. But in fact these bits do change: &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;these bits are updated according to an undocumented register of the Z80 named either WZ or MEMPTR. This undocumented register is used to store temporary results such as 16-bits arithmetic results, and address (for example, loading I and the vector byte for interruption mode 2 to compute the value to load in PC).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Sign flag ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Sign flag ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:32964:newid:102571 --&gt;
&lt;/table&gt;</summary>
		<author><name>DavidL</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Some_features_of_the_Z80&amp;diff=32964&amp;oldid=prev</id>
		<title>MacDeath at 19:29, 8 October 2009</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Some_features_of_the_Z80&amp;diff=32964&amp;oldid=prev"/>
				<updated>2009-10-08T19:29:45Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 19:29, 8 October 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L230&quot; &gt;Line 230:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 230:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== IM 0, IM 1, IM 2 ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== IM 0, IM 1, IM 2 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The instructions &amp;quot;IM 0 &amp;quot;,&amp;quot;IM 1&amp;quot; and &amp;quot;IM 2&amp;quot; set the Z80 interrupt mode which defines the actions taken to execute the maskable interrupt handler.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The instructions &amp;quot;IM 0 &amp;quot;,&amp;quot;IM 1&amp;quot; and &amp;quot;IM 2&amp;quot; set the Z80 interrupt mode which defines the actions taken to execute the maskable interrupt handler.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Programming]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:29262:newid:32964 --&gt;
&lt;/table&gt;</summary>
		<author><name>MacDeath</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Some_features_of_the_Z80&amp;diff=29262&amp;oldid=prev</id>
		<title>Octoate: added credits and table border</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Some_features_of_the_Z80&amp;diff=29262&amp;oldid=prev"/>
				<updated>2009-01-21T17:42:02Z</updated>
		
		<summary type="html">&lt;p&gt;added credits and table border&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 17:42, 21 January 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;br /&gt;
&lt;b&gt;Deprecated&lt;/b&gt;:  The each() function is deprecated. This message will be suppressed on further calls in &lt;b&gt;/mnt/cpcwiki-httpdocs/includes/diff/DairikiDiff.php&lt;/b&gt; on line &lt;b&gt;434&lt;/b&gt;&lt;br /&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Flags/Status Register (F and F')&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;div style=&amp;quot;border: 1px solid rgb(228, 222, 222); margin: 0px 0px 5px; padding: 0.5em 1em; background-color: rgb(249, 249, 249);&amp;quot;&amp;gt;&amp;lt;center&amp;gt;&lt;/ins&gt;'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''This article originally came from Kevin Thackers' archive at [http://www.cpctech.org.uk http://www.cpctech.org.uk].'''''&amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/ins&gt;Flags/Status Register (F and F')&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This register contains the condition flags. When a command is executed the flags are used to show information about the result. (e.g. the flags may be used to check if the result was positive, negative or zero). &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This register contains the condition flags. When a command is executed the flags are used to show information about the result. (e.g. the flags may be used to check if the result was positive, negative or zero). &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L6&quot; &gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;class&lt;/del&gt;=&amp;quot;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;prettytable&lt;/del&gt;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;border&lt;/ins&gt;=&amp;quot;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;1&lt;/ins&gt;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Bit 7&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Bit 7&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Sign flag&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Sign flag&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:29261:newid:29262 --&gt;
&lt;/table&gt;</summary>
		<author><name>Octoate</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Some_features_of_the_Z80&amp;diff=29261&amp;oldid=prev</id>
		<title>Octoate: Upload with OpenOffice</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Some_features_of_the_Z80&amp;diff=29261&amp;oldid=prev"/>
				<updated>2009-01-21T17:39:47Z</updated>
		
		<summary type="html">&lt;p&gt;Upload with OpenOffice&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Flags/Status Register (F and F')'''&lt;br /&gt;
&lt;br /&gt;
This register contains the condition flags. When a command is executed the flags are used to show information about the result. (e.g. the flags may be used to check if the result was positive, negative or zero). &lt;br /&gt;
&lt;br /&gt;
The flags register has this form: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| Bit 7&lt;br /&gt;
| Sign flag&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Bit 6&lt;br /&gt;
| Zero flag&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Bit 5&lt;br /&gt;
| (note 1)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Bit 4&lt;br /&gt;
| Half-carry flag&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Bit 3&lt;br /&gt;
| (note 1)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Bit 2&lt;br /&gt;
| Parity/Overflow flag&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Bit 1&lt;br /&gt;
| Subtract flag&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Bit 0&lt;br /&gt;
| Carry flag&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
Note: &lt;br /&gt;
&lt;br /&gt;
There are two bits in the flags register which are documented by Zilog as being unused. But in fact these bits do change: &lt;br /&gt;
&lt;br /&gt;
== Sign flag ==&lt;br /&gt;
This flag indicates if the result is positive or negative. If a result is negative, this flag is set to 1, if the result is positive, this flag is set to 0. &lt;br /&gt;
&lt;br /&gt;
== Zero flag ==&lt;br /&gt;
This flag indicates if the result is zero or non-zero. If the result was zero, this flag would be set to 1, if the result was non-zero (i.e. a number other than zero), this flag would be set to 0. &lt;br /&gt;
&lt;br /&gt;
== Parity/Overflow ==&lt;br /&gt;
This bit has two functions. In some commands it is used to show parity and other commands it is used to show overflow. &lt;br /&gt;
&lt;br /&gt;
Parity: &lt;br /&gt;
&lt;br /&gt;
If a byte has an even number of 1 digits then it has &amp;quot;even parity&amp;quot;, and if the byte has an odd number of 1 digits then it has &amp;quot;odd parity&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The Parity Overflow is set to 1 when the byte has even parity, and set to 0 if the byte has odd parity. &lt;br /&gt;
&lt;br /&gt;
Overflow: &lt;br /&gt;
&lt;br /&gt;
This bit will hold the overflow after a arithmetic command. &lt;br /&gt;
&lt;br /&gt;
== Subtract ==&lt;br /&gt;
This flag is set to 1 if the command used subtraction, it is set to 0 if the command used addition. This flag is used in the execution of the DAA instruction to calculate the correct BCD representation of the contents of A. &lt;br /&gt;
&lt;br /&gt;
== Half-Carry flag ==&lt;br /&gt;
This flag holds the carry from bit 3 to bit 4. It is used by the DAA instruction to convert the contents of the A register to BCD form. &lt;br /&gt;
&lt;br /&gt;
== Carry flag ==&lt;br /&gt;
This flag holds the carry. &lt;br /&gt;
&lt;br /&gt;
'''Refresh Register (R)'''&lt;br /&gt;
&lt;br /&gt;
This register is special and it cannot be used to store data. Some people consider it to be random, but it is not, and you can easily predict it's value. However, by the way it works, it could be used as a simple but crude random number generator. &lt;br /&gt;
&lt;br /&gt;
This register is used mainly in protections, because when an instruction is added or removed the value of R will be different to the intended value and the data will not be deprotected correctly. &lt;br /&gt;
&lt;br /&gt;
Bit 7 remains unchanged, and it's value is only defined when a LD R,A instruction is executed. The lower 7 bits hold a count which is incremented after each z80 instruction executed. &lt;br /&gt;
&lt;br /&gt;
Generally, all commands which have a &amp;amp;CB, &amp;amp;ED, &amp;amp;DD or &amp;amp;FD prefix, increment R by 2, and all other commands increment R by 1. The execeptions to this rule are commands which repeat. &lt;br /&gt;
&lt;br /&gt;
'''Interrupt Modes'''&lt;br /&gt;
&lt;br /&gt;
The interrupt mode can be defined using the &amp;quot;IM&amp;quot; instruction. There are 3 interrupt modes: mode 0, mode 1 and mode 2. &lt;br /&gt;
&lt;br /&gt;
The descriptions below assume: &lt;br /&gt;
&lt;br /&gt;
* Interrupt requests are accepted by Z80, &lt;br /&gt;
* An interrupt request has been issued &lt;br /&gt;
&lt;br /&gt;
== Mode 0 ==&lt;br /&gt;
In this mode, the interrupting device will generate an interrupt and put a single-byte instruction onto the CPU bus. The Z80 will execute this instruction, and then continue with program execution. Since we can only put a single byte onto the bus, the RST instructions provide an excellent way of handling different interrupts. &lt;br /&gt;
&lt;br /&gt;
On a standard CPC the byte on the cpu data bus is normally &amp;amp;FF (but this is not guaranteed). &amp;amp;FF corresponds to the &amp;quot;RST 38H&amp;quot; instruction, and therefore on the CPC interrupt mode 0 is the same as interrupt mode 1. &lt;br /&gt;
&lt;br /&gt;
On the Plus, the ASIC will generate a byte to put onto the processor data bus, see the documentation on the ASIC for a description of this byte. &lt;br /&gt;
&lt;br /&gt;
== Mode 1 ==&lt;br /&gt;
In this mode the following will be done when a interrupt is &amp;quot;executed&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
* The current program counter (PC) is pushed onto the stack. (SP) &lt;br /&gt;
* The program counter address is set to &amp;amp;0038. &lt;br /&gt;
&lt;br /&gt;
== Mode 2 ==&lt;br /&gt;
In this mode the following will be done when a interrupt is &amp;quot;executed&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
* The current program counter (PC) is pushed onto the stack (SP), &lt;br /&gt;
* A address is formed using the I register and the data on the bus. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| Bit 15..8&lt;br /&gt;
| from I register&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Bit 7..0&lt;br /&gt;
| Byte put onto processor bus by interrupting device&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
* The Z80 will read the interrupt handler address from the location pointed to by the interrupt handler pointer, and then jump to that address. interrupt handler pointer: &lt;br /&gt;
&lt;br /&gt;
On a standard CPC, the byte put onto the processor bus is always &amp;amp;FF. So, on a standard CPC the following will be done: &lt;br /&gt;
&lt;br /&gt;
* The current Program Counter is pushed onto the stack &lt;br /&gt;
* The z80 fetches an address from &amp;amp;xxFF and jumps to that address. (where xx is the value from the I register) &lt;br /&gt;
&lt;br /&gt;
On a Plus, the ASIC can generate a different byte to put on the processor bus. So the lower 8 bits may be different. This is part of the extended interrupt handling features to cope with DMA Sound interrupts, scan line interrupts etc.. &lt;br /&gt;
&lt;br /&gt;
'''The Interrupt Vector Register (I)'''&lt;br /&gt;
&lt;br /&gt;
The I register is used in Z80 Interrupt Mode 2 to form When it is used in this way, it forms the upper 8-bits of an address which points to the interrupt handler. The lower 8-bits are put onto the CPU bus by an interrupting device. If you program uses Mode 0 or Mode 1 interrupts, then this register can be used to store data. &lt;br /&gt;
&lt;br /&gt;
'''DAA (Decimal Adjust accumulator)'''&lt;br /&gt;
&lt;br /&gt;
This Z80 command will convert the contents of the A register to BCD (Binary-Coded-Decimal) representation. (e.g. the BCD representation of 15 is &amp;amp;15). DAA uses the carry flag, subtract flag, half-carry flag and the A register to calculate a value to add to the A register to change it into a BCD number. I believe that the original value in the A register must be in BCD for this conversion to work. It is provided so that any non-BCD value can be added to a BCD value and then the result can be adjusted to BCD again. I tried to convert from a non-BCD number to BCD using DAA and it didnt work. In the following tables, x corresponds to the upper nibble of register A (before the command has executed), and y corresponds to the lower nibble. These tables show the value that is added to the A register to convert it to BCD representation depending on the flags. These values are the ones used by my emulator (A-CPC). I have found information about other tables, but these did not produce the correct values. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Flags set                          Byte&lt;br /&gt;
                                 (0..9)(0..9)&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;--------------------------------------------&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 (None)                          + &amp;amp;00&lt;br /&gt;
 Carry:                          + &amp;amp;60&lt;br /&gt;
 Subtract:                       + &amp;amp;00&lt;br /&gt;
 Subtract+Carry:                 + &amp;amp;A0&lt;br /&gt;
 Half-carry:                     + &amp;amp;06&lt;br /&gt;
 Half-carry+Carry:               + &amp;amp;66&lt;br /&gt;
 Half-carry+Subtract:            + &amp;amp;FA&lt;br /&gt;
 Half-carry+Subtract+Carry:      + &amp;amp;9A&lt;br /&gt;
&lt;br /&gt;
 Flags set                          Byte&lt;br /&gt;
                                 (0..9)(A..F)&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;--------------------------------------------&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 (None)                          + &amp;amp;06&lt;br /&gt;
 Carry:                          + &amp;amp;66&lt;br /&gt;
 Subtract:                       + &amp;amp;00&lt;br /&gt;
 Subtract+Carry:                 + &amp;amp;a0&lt;br /&gt;
 Half-carry:                     + &amp;amp;06&lt;br /&gt;
 Half-carry+Carry:               + &amp;amp;66&lt;br /&gt;
 Half-carry+Subtract:            + &amp;amp;fa&lt;br /&gt;
 Half-carry+Subtract+Carry:      + &amp;amp;9A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Flags set                          Byte&lt;br /&gt;
                                 (A..F)(0..9)&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;--------------------------------------------&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 (None)                          + &amp;amp;60&lt;br /&gt;
 Carry:                          + &amp;amp;60&lt;br /&gt;
 Subtract:                       + &amp;amp;00&lt;br /&gt;
 Subtract+Carry:                 + &amp;amp;A0&lt;br /&gt;
 Half-carry:                     + &amp;amp;66&lt;br /&gt;
 Half-carry+Carry:               + &amp;amp;66&lt;br /&gt;
 Half-carry+Subtract:            + &amp;amp;fa&lt;br /&gt;
 Half-carry+Subtract+Carry:      + &amp;amp;9A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Flags set                          Byte&lt;br /&gt;
                                 (A..F)(A..F)&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;--------------------------------------------&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 (None)                          + &amp;amp;66&lt;br /&gt;
 Carry:                          + &amp;amp;66&lt;br /&gt;
 Subtract:                       + &amp;amp;00&lt;br /&gt;
 Subtract+Carry:                 + &amp;amp;a0&lt;br /&gt;
 Half-carry:                     + &amp;amp;66&lt;br /&gt;
 Half-carry+Carry:               + &amp;amp;66&lt;br /&gt;
 Half-carry+Subtract:            + &amp;amp;fa&lt;br /&gt;
 Half-carry+Subtract+Carry:      + &amp;amp;9A&lt;br /&gt;
&lt;br /&gt;
'''LDIR and LDDR'''&lt;br /&gt;
&lt;br /&gt;
This is a block copying function, it is used to transfer data from one part of memory to another fast. &lt;br /&gt;
&lt;br /&gt;
* HL must be pre-loaded with the start address &lt;br /&gt;
* DE must be pre-loaded with the destination address &lt;br /&gt;
* BC must be pre-loaded with the length of data &lt;br /&gt;
&lt;br /&gt;
== LDIR ==&lt;br /&gt;
LDIR operation: &lt;br /&gt;
&lt;br /&gt;
* read byte from memory address pointed to by HL and write it to the memory address pointed to by DE &lt;br /&gt;
* Increment HL by 1 &lt;br /&gt;
* Increment DE by 1 &lt;br /&gt;
* If BC=0 then increment PC by 2 (otherwise dont increment it) &lt;br /&gt;
&lt;br /&gt;
== LDDR ==&lt;br /&gt;
LDDR operation: &lt;br /&gt;
&lt;br /&gt;
* read byte from memory address pointed to by HL and write it to the memory address pointed to by DE &lt;br /&gt;
* Decrement HL by 1 &lt;br /&gt;
* Decrement DE by 1 &lt;br /&gt;
* Increment Program counter by 2 &lt;br /&gt;
* If BC=0 then increment PC by 2 (otherwise dont increment it) &lt;br /&gt;
&lt;br /&gt;
== NOTES ==&lt;br /&gt;
* an interrupt can occur while a LDIR/LDDR is being executed. &lt;br /&gt;
&lt;br /&gt;
* If the LDIR/LDDR opcode is overwritten by itself then command execution will stop. Effectively, the LDIR opcode is repeatidly fetched and decoded for each byte fetched from memory. &lt;br /&gt;
&lt;br /&gt;
== IFF0 and IFF1 ==&lt;br /&gt;
IFF0 reflects the state of the maskable interrupt. The maskable interrupt can be enabled using the Z80 instruction &amp;quot;EI&amp;quot; and disabled using the Z80 instruction &amp;quot;DI&amp;quot;. When IFF0 is &amp;quot;1&amp;quot; masked interrupts are enabled, when a interrupt request is received by the Z80 it will be acknowledged and the interrupt handler executed. When IFF0 is &amp;quot;0&amp;quot; masked interrupts are disabled, any interrupt requests are ignored. &lt;br /&gt;
&lt;br /&gt;
When a non-maskable interrupt (NMI) is executed by the Z80, IFF1 is set to the value of IFF0. Then IFF0 is set to &amp;quot;0&amp;quot; to disable maskable interrupts. The NMI handler will be executed.When a &amp;quot;RETN&amp;quot; instruction is executed by the Z80, IFF0 is set to the value in IFF1, therefore the maskable interrupt state is restored. The state of IFF0 can be set at any time using the &amp;quot;DI&amp;quot; and &amp;quot;EI&amp;quot; instructions. &lt;br /&gt;
&lt;br /&gt;
== IM 0, IM 1, IM 2 ==&lt;br /&gt;
* The instructions &amp;quot;IM 0 &amp;quot;,&amp;quot;IM 1&amp;quot; and &amp;quot;IM 2&amp;quot; set the Z80 interrupt mode which defines the actions taken to execute the maskable interrupt handler.&lt;/div&gt;</summary>
		<author><name>Octoate</name></author>	</entry>

	</feed>