<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://sneslab.net/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Xetheria</id>
	<title>SnesLab - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://sneslab.net/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Xetheria"/>
	<link rel="alternate" type="text/html" href="https://sneslab.net/wiki/Special:Contributions/Xetheria"/>
	<updated>2026-10-15T15:37:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21293</id>
		<title>List of 65c816 Addressing Modes</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21293"/>
		<updated>2026-10-06T05:01:49Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: linkify&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[65c816]] has the following 24 [[addressing mode]]s:&lt;br /&gt;
&lt;br /&gt;
* [[Absolute Addressing|Absolute]]&lt;br /&gt;
* [[Absolute Indexed Indirect Addressing|Absolute Indexed Indirect (Jump)]]&lt;br /&gt;
* [[Absolute Indirect Addressing|Absolute Indirect (Jump)]]&lt;br /&gt;
* [[Absolute Long Addressing|Absolute Long]]&lt;br /&gt;
* [[Absolute Long Indexed, X Addressing|Absolute Long, X]]&lt;br /&gt;
* [[Absolute Indexed, X Addressing|Absolute, X]]&lt;br /&gt;
* [[Absolute Indexed, Y Addressing|Absolute, Y]]&lt;br /&gt;
* [[Accumulator Addressing|Accumulator]]&lt;br /&gt;
* [[Block Move Addressing|Block Move (xyc)]]&lt;br /&gt;
* [[Direct Page Addressing|Direct]]&lt;br /&gt;
* [[Direct Page Indexed Indirect, X Addressing|Direct Indexed Indirect (d,x)]]&lt;br /&gt;
* [[Direct Page Indirect Addressing|Direct Indirect]]&lt;br /&gt;
* [[Direct Page Indirect Indexed, Y Addressing|Direct Indirect Indexed (d),y]]&lt;br /&gt;
* [[Direct Page Indirect Long Indexed, Y Addressing|Direct Indirect Indexed Long [d],y]]&lt;br /&gt;
* [[Direct Page Indirect Long Addressing|Direct Indirect Long]]&lt;br /&gt;
* [[Direct Page Indexed, X Addressing|Direct, X]]&lt;br /&gt;
* [[Direct Page Indexed, Y Addressing|Direct, Y]]&lt;br /&gt;
* [[Immediate Addressing|Immediate]]&lt;br /&gt;
* [[Implied Addressing|Implied]]&lt;br /&gt;
* [[Program Counter Relative Addressing|Relative]]&lt;br /&gt;
* [[Program Counter Relative Long Addressing|Relative Long]]&lt;br /&gt;
* [[Stack Addressing|Stack]]&lt;br /&gt;
* [[Stack Relative Addressing|Stack Relative]]&lt;br /&gt;
* [[Stack Relative Indirect Indexed, Y Addressing|Stack Relative Indirect Indexed]]&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* Table 3-1 Addressing Mode Summary of 65c816 datasheet&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:65c816]]&lt;br /&gt;
[[Category:Addressing Modes]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21292</id>
		<title>List of 65c816 Addressing Modes</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21292"/>
		<updated>2026-10-06T04:57:02Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: linkify&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[65c816]] has the following 24 [[addressing mode]]s:&lt;br /&gt;
&lt;br /&gt;
* [[Absolute Addressing|Absolute]]&lt;br /&gt;
* [[Absolute Indexed Indirect Addressing|Absolute Indexed Indirect (Jump)]]&lt;br /&gt;
* [[Absolute Indirect Addressing|Absolute Indirect (Jump)]]&lt;br /&gt;
* [[Absolute Long Addressing|Absolute Long]]&lt;br /&gt;
* [[Absolute Long Indexed, X Addressing|Absolute Long, X]]&lt;br /&gt;
* [[Absolute Indexed, X Addressing|Absolute, X]]&lt;br /&gt;
* [[Absolute Indexed, Y Addressing|Absolute, Y]]&lt;br /&gt;
* [[Accumulator Addressing|Accumulator]]&lt;br /&gt;
* [[Block Move Addressing|Block Move (xyc)]]&lt;br /&gt;
* [[Direct Page Addressing|Direct]]&lt;br /&gt;
* Direct Indexed Indirect (d,x)&lt;br /&gt;
* [[Direct Page Indirect Addressing|Direct Indirect]]&lt;br /&gt;
* [[Direct Page Indirect Indexed, Y Addressing|Direct Indirect Indexed (d),y]]&lt;br /&gt;
* [[Direct Page Indirect Long Indexed, Y Addressing|Direct Indirect Indexed Long [d],y]]&lt;br /&gt;
* [[Direct Page Indirect Long Addressing|Direct Indirect Long]]&lt;br /&gt;
* [[Direct Page Indexed, X Addressing|Direct, X]]&lt;br /&gt;
* [[Direct Page Indexed, Y Addressing|Direct, Y]]&lt;br /&gt;
* [[Immediate Addressing|Immediate]]&lt;br /&gt;
* [[Implied Addressing|Implied]]&lt;br /&gt;
* [[Program Counter Relative Addressing|Relative]]&lt;br /&gt;
* [[Program Counter Relative Long Addressing|Relative Long]]&lt;br /&gt;
* [[Stack Addressing|Stack]]&lt;br /&gt;
* [[Stack Relative Addressing|Stack Relative]]&lt;br /&gt;
* [[Stack Relative Indirect Indexed, Y Addressing|Stack Relative Indirect Indexed]]&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* Table 3-1 Addressing Mode Summary of 65c816 datasheet&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:65c816]]&lt;br /&gt;
[[Category:Addressing Modes]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21291</id>
		<title>List of 65c816 Addressing Modes</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21291"/>
		<updated>2026-10-06T04:54:49Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: even more linkify&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[65c816]] has the following 24 [[addressing mode]]s:&lt;br /&gt;
&lt;br /&gt;
* [[Absolute Addressing|Absolute]]&lt;br /&gt;
* [[Absolute Indexed Indirect Addressing|Absolute Indexed Indirect (Jump)]]&lt;br /&gt;
* [[Absolute Indirect Addressing|Absolute Indirect (Jump)]]&lt;br /&gt;
* [[Absolute Long Addressing|Absolute Long]]&lt;br /&gt;
* [[Absolute Long Indexed, X Addressing|Absolute Long, X]]&lt;br /&gt;
* [[Absolute Indexed, X Addressing|Absolute, X]]&lt;br /&gt;
* [[Absolute Indexed, Y Addressing|Absolute, Y]]&lt;br /&gt;
* [[Accumulator Addressing|Accumulator]]&lt;br /&gt;
* [[Block Move Addressing|Block Move (xyc)]]&lt;br /&gt;
* [[Direct Page Addressing|Direct]]&lt;br /&gt;
* Direct Indexed Indirect (d,x)&lt;br /&gt;
* [[Direct Page Indirect Addressing|Direct Indirect]]&lt;br /&gt;
* Direct Indirect Indexed (d),y&lt;br /&gt;
* [[Direct Page Indirect Long Indexed, Y Addressing|Direct Indirect Indexed Long [d],y]]&lt;br /&gt;
* [[Direct Page Indirect Long Addressing|Direct Indirect Long]]&lt;br /&gt;
* [[Direct Page Indexed, X Addressing|Direct, X]]&lt;br /&gt;
* [[Direct Page Indexed, Y Addressing|Direct, Y]]&lt;br /&gt;
* [[Immediate Addressing|Immediate]]&lt;br /&gt;
* [[Implied Addressing|Implied]]&lt;br /&gt;
* [[Program Counter Relative Addressing|Relative]]&lt;br /&gt;
* [[Program Counter Relative Long Addressing|Relative Long]]&lt;br /&gt;
* [[Stack Addressing|Stack]]&lt;br /&gt;
* [[Stack Relative Addressing|Stack Relative]]&lt;br /&gt;
* [[Stack Relative Indirect Indexed, Y Addressing|Stack Relative Indirect Indexed]]&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* Table 3-1 Addressing Mode Summary of 65c816 datasheet&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:65c816]]&lt;br /&gt;
[[Category:Addressing Modes]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21290</id>
		<title>List of 65c816 Addressing Modes</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21290"/>
		<updated>2026-10-06T04:10:43Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: yet more linkify&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[65c816]] has the following 24 [[addressing mode]]s:&lt;br /&gt;
&lt;br /&gt;
* [[Absolute Addressing|Absolute]]&lt;br /&gt;
* [[Absolute Indexed Indirect Addressing|Absolute Indexed Indirect (Jump)]]&lt;br /&gt;
* [[Absolute Indirect Addressing|Absolute Indirect (Jump)]]&lt;br /&gt;
* [[Absolute Long Addressing|Absolute Long]]&lt;br /&gt;
* [[Absolute Long Indexed, X Addressing|Absolute Long, X]]&lt;br /&gt;
* [[Absolute Indexed, X Addressing|Absolute, X]]&lt;br /&gt;
* [[Absolute Indexed, Y Addressing|Absolute, Y]]&lt;br /&gt;
* [[Accumulator Addressing|Accumulator]]&lt;br /&gt;
* [[Block Move Addressing|Block Move (xyc)]]&lt;br /&gt;
* [[Direct Page Addressing|Direct]]&lt;br /&gt;
* Direct Indexed Indirect (d,x)&lt;br /&gt;
* [[Direct Page Indirect Addressing|Direct Indirect]]&lt;br /&gt;
* Direct Indirect Indexed (d),y&lt;br /&gt;
* Direct Indirect Indexed Long [d],y&lt;br /&gt;
* [[Direct Page Indirect Long Addressing|Direct Indirect Long]]&lt;br /&gt;
* [[Direct Page Indexed, X Addressing|Direct, X]]&lt;br /&gt;
* [[Direct Page Indexed, Y Addressing|Direct, Y]]&lt;br /&gt;
* [[Immediate Addressing|Immediate]]&lt;br /&gt;
* [[Implied Addressing|Implied]]&lt;br /&gt;
* [[Program Counter Relative Addressing|Relative]]&lt;br /&gt;
* [[Program Counter Relative Long Addressing|Relative Long]]&lt;br /&gt;
* [[Stack Addressing|Stack]]&lt;br /&gt;
* [[Stack Relative Addressing|Stack Relative]]&lt;br /&gt;
* [[Stack Relative Indirect Indexed, Y Addressing|Stack Relative Indirect Indexed]]&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* Table 3-1 Addressing Mode Summary of 65c816 datasheet&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:65c816]]&lt;br /&gt;
[[Category:Addressing Modes]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21289</id>
		<title>List of 65c816 Addressing Modes</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21289"/>
		<updated>2026-10-06T04:03:40Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: even more linkify&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[65c816]] has the following 24 [[addressing mode]]s:&lt;br /&gt;
&lt;br /&gt;
* [[Absolute Addressing|Absolute]]&lt;br /&gt;
* Absolute Indexed Indirect (Jump)&lt;br /&gt;
* Absolute Indirect (Jump)&lt;br /&gt;
* [[Absolute Long Addressing|Absolute Long]]&lt;br /&gt;
* [[Absolute Long Indexed, X Addressing|Absolute Long, X]]&lt;br /&gt;
* [[Absolute Indexed, X Addressing|Absolute, X]]&lt;br /&gt;
* [[Absolute Indexed, Y Addressing|Absolute, Y]]&lt;br /&gt;
* [[Accumulator Addressing|Accumulator]]&lt;br /&gt;
* [[Block Move Addressing|Block Move (xyc)]]&lt;br /&gt;
* [[Direct Page Addressing|Direct]]&lt;br /&gt;
* Direct Indexed Indirect (d,x)&lt;br /&gt;
* [[Direct Page Indirect Addressing|Direct Indirect]]&lt;br /&gt;
* Direct Indirect Indexed (d),y&lt;br /&gt;
* Direct Indirect Indexed Long [d],y&lt;br /&gt;
* [[Direct Page Indirect Long Addressing|Direct Indirect Long]]&lt;br /&gt;
* [[Direct Page Indexed, X Addressing|Direct, X]]&lt;br /&gt;
* [[Direct Page Indexed, Y Addressing|Direct, Y]]&lt;br /&gt;
* [[Immediate Addressing|Immediate]]&lt;br /&gt;
* [[Implied Addressing|Implied]]&lt;br /&gt;
* [[Program Counter Relative Addressing|Relative]]&lt;br /&gt;
* [[Program Counter Relative Long Addressing|Relative Long]]&lt;br /&gt;
* [[Stack Addressing|Stack]]&lt;br /&gt;
* [[Stack Relative Addressing|Stack Relative]]&lt;br /&gt;
* [[Stack Relative Indirect Indexed, Y Addressing|Stack Relative Indirect Indexed]]&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* Table 3-1 Addressing Mode Summary of 65c816 datasheet&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:65c816]]&lt;br /&gt;
[[Category:Addressing Modes]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21288</id>
		<title>List of 65c816 Addressing Modes</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21288"/>
		<updated>2026-10-06T04:02:05Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: more linkify&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[65c816]] has the following 24 [[addressing mode]]s:&lt;br /&gt;
&lt;br /&gt;
* [[Absolute Addressing|Absolute]]&lt;br /&gt;
* Absolute Indexed Indirect (Jump)&lt;br /&gt;
* Absolute Indirect (Jump)&lt;br /&gt;
* [[Absolute Long Addressing|Absolute Long]]&lt;br /&gt;
* [[Absolute Long Indexed, X Addressing|Absolute Long, X]]&lt;br /&gt;
* [[Absolute Indexed, X Addressing|Absolute, X]]&lt;br /&gt;
* [[Absolute Indexed, Y Addressing|Absolute, Y]]&lt;br /&gt;
* [[Accumulator Addressing|Accumulator]]&lt;br /&gt;
* [[Block Move Addressing|Block Move (xyc)]]&lt;br /&gt;
* Direct&lt;br /&gt;
* Direct Indexed Indirect (d,x)&lt;br /&gt;
* Direct Indirect&lt;br /&gt;
* Direct Indirect Indexed (d),y&lt;br /&gt;
* Direct Indirect Indexed Long [d],y&lt;br /&gt;
* Direct Indirect Long&lt;br /&gt;
* Direct, X&lt;br /&gt;
* Direct, Y&lt;br /&gt;
* [[Immediate Addressing|Immediate]]&lt;br /&gt;
* [[Implied Addressing|Implied]]&lt;br /&gt;
* [[Program Counter Relative Addressing|Relative]]&lt;br /&gt;
* [[Program Counter Relative Long Addressing|Relative Long]]&lt;br /&gt;
* [[Stack Addressing|Stack]]&lt;br /&gt;
* [[Stack Relative Addressing|Stack Relative]]&lt;br /&gt;
* [[Stack Relative Indirect Indexed, Y Addressing|Stack Relative Indirect Indexed]]&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* Table 3-1 Addressing Mode Summary of 65c816 datasheet&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:65c816]]&lt;br /&gt;
[[Category:Addressing Modes]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21287</id>
		<title>List of 65c816 Addressing Modes</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21287"/>
		<updated>2026-10-06T03:58:52Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: linkify&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[65c816]] has the following 24 [[addressing mode]]s:&lt;br /&gt;
&lt;br /&gt;
* [[Absolute Addressing|Absolute]]&lt;br /&gt;
* Absolute Indexed Indirect (Jump)&lt;br /&gt;
* Absolute Indirect (Jump)&lt;br /&gt;
* Absolute Long&lt;br /&gt;
* Absolute Long, X&lt;br /&gt;
* Absolute, X&lt;br /&gt;
* Absolute, Y&lt;br /&gt;
* [[Accumulator Addressing|Accumulator]]&lt;br /&gt;
* [[Block Move Addressing|Block Move (xyc)]]&lt;br /&gt;
* Direct&lt;br /&gt;
* Direct Indexed Indirect (d,x)&lt;br /&gt;
* Direct Indirect&lt;br /&gt;
* Direct Indirect Indexed (d),y&lt;br /&gt;
* Direct Indirect Indexed Long [d],y&lt;br /&gt;
* Direct Indirect Long&lt;br /&gt;
* Direct, X&lt;br /&gt;
* Direct, Y&lt;br /&gt;
* [[Immediate Addressing|Immediate]]&lt;br /&gt;
* [[Implied Addressing|Implied]]&lt;br /&gt;
* Relative&lt;br /&gt;
* Relative Long&lt;br /&gt;
* Stack&lt;br /&gt;
* Stack Relative&lt;br /&gt;
* Stack Relative Indirect Indexed&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* Table 3-1 Addressing Mode Summary of 65c816 datasheet&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:65c816]]&lt;br /&gt;
[[Category:Addressing Modes]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21286</id>
		<title>List of 65c816 Addressing Modes</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=List_of_65c816_Addressing_Modes&amp;diff=21286"/>
		<updated>2026-10-06T03:56:49Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: created page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[65c816]] has the following 24 [[addressing mode]]s:&lt;br /&gt;
&lt;br /&gt;
* Absolute&lt;br /&gt;
* Absolute Indexed Indirect (Jump)&lt;br /&gt;
* Absolute Indirect (Jump)&lt;br /&gt;
* Absolute Long&lt;br /&gt;
* Absolute Long, X&lt;br /&gt;
* Absolute, X&lt;br /&gt;
* Absolute, Y&lt;br /&gt;
* Accumulator&lt;br /&gt;
* Block Move (xyc)&lt;br /&gt;
* Direct&lt;br /&gt;
* Direct Indexed Indirect (d,x)&lt;br /&gt;
* Direct Indirect&lt;br /&gt;
* Direct Indirect Indexed (d),y&lt;br /&gt;
* Direct Indirect Indexed Long [d],y&lt;br /&gt;
* Direct Indirect Long&lt;br /&gt;
* Direct, X&lt;br /&gt;
* Direct, Y&lt;br /&gt;
* Immediate&lt;br /&gt;
* Implied&lt;br /&gt;
* Relative&lt;br /&gt;
* Relative Long&lt;br /&gt;
* Stack&lt;br /&gt;
* Stack Relative&lt;br /&gt;
* Stack Relative Indirect Indexed&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* Table 3-1 Addressing Mode Summary of 65c816 datasheet&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:65c816]]&lt;br /&gt;
[[Category:Addressing Modes]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Direct_Page_Indirect_Long_Indexed,_Y_Addressing&amp;diff=21285</id>
		<title>Direct Page Indirect Long Indexed, Y Addressing</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Direct_Page_Indirect_Long_Indexed,_Y_Addressing&amp;diff=21285"/>
		<updated>2026-10-04T22:38:12Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* See Also */ Indirect X addr&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Direct Page Indirect Long Indexed, Y Addressing&#039;&#039;&#039; is supported by eight instructions:&lt;br /&gt;
&lt;br /&gt;
* [[ADC]] (opcode 77)&lt;br /&gt;
* [[AND]] (opcode 37)&lt;br /&gt;
* [[CMP]] (opcode D7)&lt;br /&gt;
* [[EOR]] (opcode 57)&lt;br /&gt;
* [[LDA]] (opcode B7)&lt;br /&gt;
* [[ORA]] (opcode 17)&lt;br /&gt;
* [[SBC]] (opcode F7)&lt;br /&gt;
* [[STA]] (opcode 97)&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LDA (dp), Y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effective address is the sum of the indirect address and the [[Y index register]].&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[Direct Page Indirect Indexed, Y Addressing]]&lt;br /&gt;
* [[Indirect X Addressing]]&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/396 page 396]&lt;br /&gt;
* section 3.5.14 of 65c816 datasheet, https://westerndesigncenter.com/wdc/documentation/w65c816s.pdf&lt;br /&gt;
&lt;br /&gt;
[[Category:Addressing Modes]]&lt;br /&gt;
[[Category:Complex Admodes]]&lt;br /&gt;
[[Category:65c816 additions]]&lt;br /&gt;
[[Category:ASM]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Direct_Page_Indirect_Indexed,_Y_Addressing&amp;diff=21284</id>
		<title>Direct Page Indirect Indexed, Y Addressing</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Direct_Page_Indirect_Indexed,_Y_Addressing&amp;diff=21284"/>
		<updated>2026-10-04T22:36:12Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* See Also */ Indirect x addr&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Direct Page Indirect Indexed, Y Addressing&#039;&#039;&#039; is supported by eight instructions:&lt;br /&gt;
&lt;br /&gt;
* [[ADC]] (opcode 71)&lt;br /&gt;
* [[AND]] (opcode 31)&lt;br /&gt;
* [[CMP]] (opcode D1)&lt;br /&gt;
* [[EOR]] (opcode 51)&lt;br /&gt;
* [[LDA]] (opcode B1)&lt;br /&gt;
* [[ORA]] (opcode 11)&lt;br /&gt;
* [[SBC]] (opcode F1)&lt;br /&gt;
* [[STA]] (opcode 91)&lt;br /&gt;
&lt;br /&gt;
It is also referred to as &#039;&#039;&#039;Indirect Y Addressing&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LDA (dp), Y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[data bank register]] is utilized in the effective address calculation.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[Direct Page Indirect Long Indexed, Y Addressing]]&lt;br /&gt;
* [[Direct Page Addressing]]&lt;br /&gt;
* [[Indirect X Addressing]]&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/395 page 395]&lt;br /&gt;
* section 3.5.13 of 65c816 datasheet, https://westerndesigncenter.com/wdc/documentation/w65c816s.pdf&lt;br /&gt;
&lt;br /&gt;
[[Category:Addressing Modes]]&lt;br /&gt;
[[Category:Complex Admodes]]&lt;br /&gt;
[[Category:65c816 additions]]&lt;br /&gt;
[[Category:ASM]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Direct_Page_Indexed_Indirect,_X_Addressing&amp;diff=21283</id>
		<title>Direct Page Indexed Indirect, X Addressing</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Direct_Page_Indexed_Indirect,_X_Addressing&amp;diff=21283"/>
		<updated>2026-10-04T22:35:36Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* See Also */ Indirect y addr&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Direct Page Indexed Indirect, X Addressing&#039;&#039;&#039; is supported by eight instructions:&lt;br /&gt;
&lt;br /&gt;
* [[ADC]] (opcode 61)&lt;br /&gt;
* [[AND]] (opcode 21)&lt;br /&gt;
* [[CMP]] (opcode C1)&lt;br /&gt;
* [[EOR]] (opcode 41)&lt;br /&gt;
* [[LDA]] (opcode A1)&lt;br /&gt;
* [[ORA]] (opcode 01)&lt;br /&gt;
* [[SBC]] (opcode E1)&lt;br /&gt;
* [[STA]] (opcode 81)&lt;br /&gt;
&lt;br /&gt;
It is also referred to as &#039;&#039;&#039;Indirect X Addressing&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LDA (dp, X)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bank of the effective address is supplied by the [[data bank register]].&lt;br /&gt;
&lt;br /&gt;
==== See Also ====&lt;br /&gt;
* [[Direct Page Indirect Addressing]]&lt;br /&gt;
* [[Indirect Y Addressing]]&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/392 page 392]&lt;br /&gt;
* section 3.5.10 of 65c816 datasheet, https://westerndesigncenter.com/wdc/documentation/w65c816s.pdf&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:65c816 additions]]&lt;br /&gt;
[[Category:Complex Admodes]]&lt;br /&gt;
[[Category:Addressing Modes]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Direct_Page_Indexed_Indirect,_X_Addressing&amp;diff=21282</id>
		<title>Direct Page Indexed Indirect, X Addressing</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Direct_Page_Indexed_Indirect,_X_Addressing&amp;diff=21282"/>
		<updated>2026-10-04T07:19:22Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: Indirect X addressing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Direct Page Indexed Indirect, X Addressing&#039;&#039;&#039; is supported by eight instructions:&lt;br /&gt;
&lt;br /&gt;
* [[ADC]] (opcode 61)&lt;br /&gt;
* [[AND]] (opcode 21)&lt;br /&gt;
* [[CMP]] (opcode C1)&lt;br /&gt;
* [[EOR]] (opcode 41)&lt;br /&gt;
* [[LDA]] (opcode A1)&lt;br /&gt;
* [[ORA]] (opcode 01)&lt;br /&gt;
* [[SBC]] (opcode E1)&lt;br /&gt;
* [[STA]] (opcode 81)&lt;br /&gt;
&lt;br /&gt;
It is also referred to as &#039;&#039;&#039;Indirect X Addressing&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LDA (dp, X)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bank of the effective address is supplied by the [[data bank register]].&lt;br /&gt;
&lt;br /&gt;
==== See Also ====&lt;br /&gt;
* [[Direct Page Indirect Addressing]]&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/392 page 392]&lt;br /&gt;
* section 3.5.10 of 65c816 datasheet, https://westerndesigncenter.com/wdc/documentation/w65c816s.pdf&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:65c816 additions]]&lt;br /&gt;
[[Category:Complex Admodes]]&lt;br /&gt;
[[Category:Addressing Modes]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Direct_Page_Indirect_Indexed,_Y_Addressing&amp;diff=21281</id>
		<title>Direct Page Indirect Indexed, Y Addressing</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Direct_Page_Indirect_Indexed,_Y_Addressing&amp;diff=21281"/>
		<updated>2026-10-04T07:05:18Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: aka&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Direct Page Indirect Indexed, Y Addressing&#039;&#039;&#039; is supported by eight instructions:&lt;br /&gt;
&lt;br /&gt;
* [[ADC]] (opcode 71)&lt;br /&gt;
* [[AND]] (opcode 31)&lt;br /&gt;
* [[CMP]] (opcode D1)&lt;br /&gt;
* [[EOR]] (opcode 51)&lt;br /&gt;
* [[LDA]] (opcode B1)&lt;br /&gt;
* [[ORA]] (opcode 11)&lt;br /&gt;
* [[SBC]] (opcode F1)&lt;br /&gt;
* [[STA]] (opcode 91)&lt;br /&gt;
&lt;br /&gt;
It is also referred to as &#039;&#039;&#039;Indirect Y Addressing&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LDA (dp), Y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[data bank register]] is utilized in the effective address calculation.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[Direct Page Indirect Long Indexed, Y Addressing]]&lt;br /&gt;
* [[Direct Page Addressing]]&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/395 page 395]&lt;br /&gt;
* section 3.5.13 of 65c816 datasheet, https://westerndesigncenter.com/wdc/documentation/w65c816s.pdf&lt;br /&gt;
&lt;br /&gt;
[[Category:Addressing Modes]]&lt;br /&gt;
[[Category:Complex Admodes]]&lt;br /&gt;
[[Category:65c816 additions]]&lt;br /&gt;
[[Category:ASM]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=TCALL_(SPC700)&amp;diff=21264</id>
		<title>TCALL (SPC700)</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=TCALL_(SPC700)&amp;diff=21264"/>
		<updated>2026-06-06T12:10:04Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: capitalize other L&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:50%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Basic Info&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Addressing Mode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Opcode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Length&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Speed&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Vector Address&#039;&#039;&#039;&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|01&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFDE&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|11&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFDC&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|21&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFDA&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|31&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFD8&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|41&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFD6&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|51&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFD4&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|61&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFD2&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|71&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFD0&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|81&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFCE&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|91&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFCC&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|A1&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFCA&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|B1&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFC8&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|C1&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFC6&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|D1&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFC4&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|E1&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFC2&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 3)&lt;br /&gt;
|F1&lt;br /&gt;
|1 byte&lt;br /&gt;
|8 cycles&lt;br /&gt;
|$FFC0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:30%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Flags Affected&lt;br /&gt;
|+&lt;br /&gt;
|[[Negative Flag|N]]&lt;br /&gt;
|[[Overflow Flag|V]]&lt;br /&gt;
|[[Direct Page Flag|P]]&lt;br /&gt;
|[[Break Flag|B]]&lt;br /&gt;
|[[Half-Carry Flag|H]]&lt;br /&gt;
|[[Interrupt Enable Flag|I]]&lt;br /&gt;
|[[Zero Flag|Z]]&lt;br /&gt;
|[[Carry Flag|C]]&lt;br /&gt;
|+&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TCALL&#039;&#039;&#039; (Table CALL) is an [[SPC700]] instruction that calls a subroutine whose 16-bit address is stored in the [[uppermost page]].  The low byte of the address of the vector (pointer to subroutine) is a function of the high nybble of the opcode, equal to $DE - n*2.  The high byte of the vector address is always $FF.&lt;br /&gt;
&lt;br /&gt;
No flags are affected.&lt;br /&gt;
&lt;br /&gt;
=== Syntax ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TCALL n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where n is the &#039;&#039;&#039;vector call number&#039;&#039;&#039;, a decimal integer from 0 to 15, which becomes the high nybble of the opcode.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[CALL]]&lt;br /&gt;
* [[PCALL]]&lt;br /&gt;
* [[RET]]&lt;br /&gt;
* [[SPC700/IPL ROM]]&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
* Official Nintendo documentation on TCALL: Table C-16 [https://archive.org/details/SNESDevManual/book1/page/n234 Appendix C-9]&lt;br /&gt;
* [https://www.romhacking.net/documents/197 anomie&#039;s SPC700 doc]&lt;br /&gt;
* https://forums.nesdev.org/viewtopic.php?t=13313&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:SPC700]]&lt;br /&gt;
[[Category:Subroutine Call Return Commands]]&lt;br /&gt;
[[Category:One-byte Instructions]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Stack&amp;diff=21261</id>
		<title>Stack</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Stack&amp;diff=21261"/>
		<updated>2026-05-21T21:36:13Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: no stack base pointer&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Stack&#039;&#039;&#039; is a LIFO (last-in, first-out) buffer which remembers the state of subroutines that are currently executing.&lt;br /&gt;
&lt;br /&gt;
On the [[65c816]], the stack is always in [[bank]] zero.&amp;lt;sup&amp;gt;[3]&amp;lt;/sup&amp;gt;  It can be thousands of bytes deep.&amp;lt;sup&amp;gt;[1]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In [[emulation mode]] it wraps within page one.&amp;lt;sup&amp;gt;[2]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The stack grows towards zero, but the most recently pushed byte is nontheless called the top of the stack.&amp;lt;sup&amp;gt;[4]&amp;lt;/sup&amp;gt;  These instructions push things to the stack:&lt;br /&gt;
&lt;br /&gt;
* [[PEA]]&lt;br /&gt;
* [[PEI]]&lt;br /&gt;
* [[PER]]&lt;br /&gt;
* [[PHA]]&lt;br /&gt;
* [[PHB]]&lt;br /&gt;
* [[PHD]]&lt;br /&gt;
* [[PHK]]&lt;br /&gt;
* [[PHP]]&lt;br /&gt;
* [[PHX]]&lt;br /&gt;
* [[PHY]]&lt;br /&gt;
* [[JSR]]&lt;br /&gt;
* [[JSL]]&lt;br /&gt;
* [[COP]]&lt;br /&gt;
* [[BRK]]&lt;br /&gt;
&lt;br /&gt;
PL* instructions take one cycle more than their PH* counterparts because they have to increment the stack pointer to point to the top element before it can be pulled, whereas push instructions pipeline the decrement of SP so that it overlaps the opcode fetch of the next instruction.  These instructions pull things from the stack:&lt;br /&gt;
&lt;br /&gt;
* [[PLA]]&lt;br /&gt;
* [[PLB]]&lt;br /&gt;
* [[PLD]]&lt;br /&gt;
* [[PLP]]&lt;br /&gt;
* [[PLX]]&lt;br /&gt;
* [[PLY]]&lt;br /&gt;
* [[RTS]]&lt;br /&gt;
* [[RTL]]&lt;br /&gt;
* [[RTI]]&lt;br /&gt;
&lt;br /&gt;
Note the lack of [[PLK]].  PHS and PLS similarly do not exist, nor do any instructions performing the inverse of PEA, PEI, or PER.  Unlike x86, there is also no stack base pointer.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[Stack Pointer]]&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
# Wilson, Garth. https://wilsonminesco.com/816myths&lt;br /&gt;
# Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#5.1.1&lt;br /&gt;
# section 2.11 of 65c816 datasheet: https://www.westerndesigncenter.com/wdc/documentation/w65c816s.pdf&lt;br /&gt;
# [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/33 page 33]&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Inherited from 6502]]&lt;br /&gt;
[[Category:Buffers]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=COP&amp;diff=21260</id>
		<title>COP</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=COP&amp;diff=21260"/>
		<updated>2026-05-21T06:53:17Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: Undo revision 21257 by Xetheria (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:40%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Basic Info&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Addressing Mode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Opcode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Length&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Speed&#039;&#039;&#039;&lt;br /&gt;
|+&lt;br /&gt;
|[[Stack Addressing|Stack]] (Interrupt)&lt;br /&gt;
|02&lt;br /&gt;
|2 bytes&lt;br /&gt;
|8 cycles*&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:30%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;9&amp;quot;|Flags Affected&lt;br /&gt;
|+&lt;br /&gt;
|[[N Flag|N]]&lt;br /&gt;
|[[V Flag|V]]&lt;br /&gt;
|[[M Flag|M]]&lt;br /&gt;
|[[X Flag|X]]&lt;br /&gt;
|[[D Flag|D]]&lt;br /&gt;
|[[I Flag|I]]&lt;br /&gt;
|[[Z Flag|Z]]&lt;br /&gt;
|[[C Flag|C]]&lt;br /&gt;
|+&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;COP&#039;&#039;&#039; (Co-Processor) is a [[65c816]] instruction designed to run a co-processor command.  COP triggers a software interrupt and control is routed to the COP handler, whose address is stored in the COP vector at $00:FFE4 (in [[native mode]] anyway, in emulation mode $FFF4 is used instead).  The byte following the opcode is called the [[signature byte]] and is required by assemblers:&lt;br /&gt;
* Signature bytes of 00h to 7Fh can be programmer-defined&lt;br /&gt;
* Signature bytes of 80h to FFh are reserved for future microprocessors by the [https://www.westerndesigncenter.com/ Western Design Center]&amp;lt;sup&amp;gt;[3]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state of the [[interrupt disable flag]] has no effect on the behavior of COP although it will be set after COP runs.&lt;br /&gt;
&lt;br /&gt;
Some examples of the kinds of microprocessors COP could be used to communicate with include:&lt;br /&gt;
* floating point&lt;br /&gt;
* graphics&lt;br /&gt;
&lt;br /&gt;
The [[PBR]] is cleared, but in native mode its previous value is pushed to the [[stack]].&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
COP sig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Cycle Skipped ====&lt;br /&gt;
* COP takes one fewer cycle in [[emulation mode]] as it doesn&#039;t need to push the [[program counter bank register]] to the [[stack]].&lt;br /&gt;
&lt;br /&gt;
[[File:cop.png]]&lt;br /&gt;
&lt;br /&gt;
COP is not really used for anything on the SNES.&amp;lt;sup&amp;gt;[7]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[BRK]]&lt;br /&gt;
* [[RTI]]&lt;br /&gt;
* [[WDM]]&lt;br /&gt;
* [[Enhancement Chips]]&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
# [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/447 page 447] on COP&lt;br /&gt;
# [[Labiak]], [https://archive.org/details/Programming_the_65816/page/n145 page 135] on COP&lt;br /&gt;
# section 7.15 of 65c816 datasheet&lt;br /&gt;
# snes9x implementation of COP: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L2738&lt;br /&gt;
# https://ersanio.gitbook.io/assembly-for-the-snes/deep-dives/misc&lt;br /&gt;
# https://undisbeliever.net/snesdev/65816-opcodes.html#software-interrupts&lt;br /&gt;
# https://forums.nesdev.org/viewtopic.php?p=176406#p176406&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:65c816 additions]]&lt;br /&gt;
[[Category:Two-byte Instructions]]&lt;br /&gt;
[[Category:Single Admode Mnemonics]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=BRK&amp;diff=21259</id>
		<title>BRK</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=BRK&amp;diff=21259"/>
		<updated>2026-05-21T06:51:14Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: Undo revision 21258 by Xetheria (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:40%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Basic Info&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Addressing Mode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Opcode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Length&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Speed&#039;&#039;&#039;&lt;br /&gt;
|+&lt;br /&gt;
|[[Stack Addressing|Stack]] (Interrupt)&lt;br /&gt;
|00&lt;br /&gt;
|2 bytes&lt;br /&gt;
|8 cycles*&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:40%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;9&amp;quot;|Flags Affected&lt;br /&gt;
|+&lt;br /&gt;
|&lt;br /&gt;
|[[Negative Flag|N]]&lt;br /&gt;
|[[Overflow Flag|V]]&lt;br /&gt;
|[[M Flag|M]]&lt;br /&gt;
|[[X Flag|X]] / [[Break Flag|B]]&lt;br /&gt;
|[[D Flag|D]]&lt;br /&gt;
|[[I Flag|I]]&lt;br /&gt;
|[[Zero Flag|Z]]&lt;br /&gt;
|[[Carry Flag|C]]&lt;br /&gt;
|+&lt;br /&gt;
|[[65c816 native mode]]&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|+&lt;br /&gt;
|[[6502 emulation mode]]&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|1&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BRK&#039;&#039;&#039; (Break) is a 65x instruction that triggers a non-maskable software interrupt ([[Non-Maskable Interrupt|NMI]]).  The byte following the opcode is called the [[signature byte]].  The state of the [[interrupt disable flag]] has no effect on the behavior of BRK although it will be set after BRK runs.&lt;br /&gt;
&lt;br /&gt;
In [[native mode]] the [[program bank register]] is pushed to the [[stack]].  Then the [[program counter]] is incremented by two and then pushed to the stack.  Then the [[status register]] (with the [[break flag]] set, if in emulation mode) is pushed to the stack.  Then the interrupt disable flag is set.  In native mode, the program bank register is then cleared.&lt;br /&gt;
&lt;br /&gt;
Control is routed to the BRK handler, whose address is stored at the BRK vector:&lt;br /&gt;
* In native mode, this vector is at $00:FFE6.&lt;br /&gt;
* In emulation mode, this vector is at $FFFE.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRK&lt;br /&gt;
BRK sig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the signature byte was omitted from the assembler source, then it ends up serving double duty as the opcode of the next instruction.  In this case the [[interrupt handler]] must decrement the [[return address]] on the [[stack]] so that the eventual [[RTI]] does not cause [[derailment]].&lt;br /&gt;
&lt;br /&gt;
[[File:brk.png]]&lt;br /&gt;
&lt;br /&gt;
BRK used to be considered a one-byte instruction in an early datasheet.  On the NMOS 6502, BRK does not affect the decimal flag, but this likely only affects porting code from systems other than the NES because the NES does not have decimal mode anyway.&lt;br /&gt;
&lt;br /&gt;
==== Cycle Skipped ====&lt;br /&gt;
* BRK takes one fewer cycle in [[emulation mode]] as it doesn&#039;t need to push the [[program counter bank register]] to the [[stack]].&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[RTI]]&lt;br /&gt;
* [[BRK (SPC700)]]&lt;br /&gt;
* [[NMI]]&lt;br /&gt;
* [[IRQ]]&lt;br /&gt;
* [[COP]]&lt;br /&gt;
* [[WDM]]&lt;br /&gt;
* [[CLD]]&lt;br /&gt;
* [[SEI]]&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/436 page 436] on BRK&lt;br /&gt;
* Figure 13.3, Break Signature Byte Illustration, lbid, [https://archive.org/details/0893037893ProgrammingThe65816/page/n282 page 256]&lt;br /&gt;
* [[Labiak]], [https://archive.org/details/Programming_the_65816/page/n136 page 126] on BRK&lt;br /&gt;
* 9.11 on [[MCS6500 Manual]], [https://archive.org/details/mos_microcomputers_programming_manual/page/n164 page 144] on BRK&lt;br /&gt;
* [[Carr]], [https://archive.org/details/6502UsersManual/page/n265 page 252] on BRK&lt;br /&gt;
* [[Leventhal]], [https://archive.org/details/6502-assembly-language-programming/page/n98 page 3-49] on BRK&lt;br /&gt;
* snes9x implementation of BRK: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L2547&lt;br /&gt;
* Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#BRK&lt;br /&gt;
* Clark, Bruce. http://www.6502.org/tutorials/65c02opcodes.html#6&lt;br /&gt;
* https://undisbeliever.net/snesdev/65816-opcodes.html#software-interrupts&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Inherited from 6502]]&lt;br /&gt;
[[Category:Two-byte Instructions]]&lt;br /&gt;
[[Category:Single Admode Mnemonics]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=BRK&amp;diff=21258</id>
		<title>BRK</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=BRK&amp;diff=21258"/>
		<updated>2026-05-21T06:39:59Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* External Links */ de n&amp;#039;d page number&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:40%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Basic Info&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Addressing Mode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Opcode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Length&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Speed&#039;&#039;&#039;&lt;br /&gt;
|+&lt;br /&gt;
|[[Stack Addressing|Stack]] (Interrupt)&lt;br /&gt;
|00&lt;br /&gt;
|2 bytes&lt;br /&gt;
|8 cycles*&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:40%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;9&amp;quot;|Flags Affected&lt;br /&gt;
|+&lt;br /&gt;
|&lt;br /&gt;
|[[Negative Flag|N]]&lt;br /&gt;
|[[Overflow Flag|V]]&lt;br /&gt;
|[[M Flag|M]]&lt;br /&gt;
|[[X Flag|X]] / [[Break Flag|B]]&lt;br /&gt;
|[[D Flag|D]]&lt;br /&gt;
|[[I Flag|I]]&lt;br /&gt;
|[[Zero Flag|Z]]&lt;br /&gt;
|[[Carry Flag|C]]&lt;br /&gt;
|+&lt;br /&gt;
|[[65c816 native mode]]&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|+&lt;br /&gt;
|[[6502 emulation mode]]&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|1&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BRK&#039;&#039;&#039; (Break) is a 65x instruction that triggers a non-maskable software interrupt ([[Non-Maskable Interrupt|NMI]]).  The byte following the opcode is called the [[signature byte]].  The state of the [[interrupt disable flag]] has no effect on the behavior of BRK although it will be set after BRK runs.&lt;br /&gt;
&lt;br /&gt;
In [[native mode]] the [[program bank register]] is pushed to the [[stack]].  Then the [[program counter]] is incremented by two and then pushed to the stack.  Then the [[status register]] (with the [[break flag]] set, if in emulation mode) is pushed to the stack.  Then the interrupt disable flag is set.  In native mode, the program bank register is then cleared.&lt;br /&gt;
&lt;br /&gt;
Control is routed to the BRK handler, whose address is stored at the BRK vector:&lt;br /&gt;
* In native mode, this vector is at $00:FFE6.&lt;br /&gt;
* In emulation mode, this vector is at $FFFE.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRK&lt;br /&gt;
BRK sig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the signature byte was omitted from the assembler source, then it ends up serving double duty as the opcode of the next instruction.  In this case the [[interrupt handler]] must decrement the [[return address]] on the [[stack]] so that the eventual [[RTI]] does not cause [[derailment]].&lt;br /&gt;
&lt;br /&gt;
[[File:brk.png]]&lt;br /&gt;
&lt;br /&gt;
BRK used to be considered a one-byte instruction in an early datasheet.  On the NMOS 6502, BRK does not affect the decimal flag, but this likely only affects porting code from systems other than the NES because the NES does not have decimal mode anyway.&lt;br /&gt;
&lt;br /&gt;
==== Cycle Skipped ====&lt;br /&gt;
* BRK takes one fewer cycle in [[emulation mode]] as it doesn&#039;t need to push the [[program counter bank register]] to the [[stack]].&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[RTI]]&lt;br /&gt;
* [[BRK (SPC700)]]&lt;br /&gt;
* [[NMI]]&lt;br /&gt;
* [[IRQ]]&lt;br /&gt;
* [[COP]]&lt;br /&gt;
* [[WDM]]&lt;br /&gt;
* [[CLD]]&lt;br /&gt;
* [[SEI]]&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/436 page 436] on BRK&lt;br /&gt;
* Figure 13.3, Break Signature Byte Illustration, lbid, [https://archive.org/details/0893037893ProgrammingThe65816/page/n282 page 256]&lt;br /&gt;
* [[Labiak]], [https://archive.org/details/Programming_the_65816/page/126 page 126] on BRK&lt;br /&gt;
* 9.11 on [[MCS6500 Manual]], [https://archive.org/details/mos_microcomputers_programming_manual/page/n164 page 144] on BRK&lt;br /&gt;
* [[Carr]], [https://archive.org/details/6502UsersManual/page/n265 page 252] on BRK&lt;br /&gt;
* [[Leventhal]], [https://archive.org/details/6502-assembly-language-programming/page/n98 page 3-49] on BRK&lt;br /&gt;
* snes9x implementation of BRK: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L2547&lt;br /&gt;
* Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#BRK&lt;br /&gt;
* Clark, Bruce. http://www.6502.org/tutorials/65c02opcodes.html#6&lt;br /&gt;
* https://undisbeliever.net/snesdev/65816-opcodes.html#software-interrupts&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Inherited from 6502]]&lt;br /&gt;
[[Category:Two-byte Instructions]]&lt;br /&gt;
[[Category:Single Admode Mnemonics]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=COP&amp;diff=21257</id>
		<title>COP</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=COP&amp;diff=21257"/>
		<updated>2026-05-21T06:37:55Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* External Links */ de n&amp;#039;d page number&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:40%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Basic Info&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Addressing Mode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Opcode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Length&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Speed&#039;&#039;&#039;&lt;br /&gt;
|+&lt;br /&gt;
|[[Stack Addressing|Stack]] (Interrupt)&lt;br /&gt;
|02&lt;br /&gt;
|2 bytes&lt;br /&gt;
|8 cycles*&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:30%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;9&amp;quot;|Flags Affected&lt;br /&gt;
|+&lt;br /&gt;
|[[N Flag|N]]&lt;br /&gt;
|[[V Flag|V]]&lt;br /&gt;
|[[M Flag|M]]&lt;br /&gt;
|[[X Flag|X]]&lt;br /&gt;
|[[D Flag|D]]&lt;br /&gt;
|[[I Flag|I]]&lt;br /&gt;
|[[Z Flag|Z]]&lt;br /&gt;
|[[C Flag|C]]&lt;br /&gt;
|+&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;COP&#039;&#039;&#039; (Co-Processor) is a [[65c816]] instruction designed to run a co-processor command.  COP triggers a software interrupt and control is routed to the COP handler, whose address is stored in the COP vector at $00:FFE4 (in [[native mode]] anyway, in emulation mode $FFF4 is used instead).  The byte following the opcode is called the [[signature byte]] and is required by assemblers:&lt;br /&gt;
* Signature bytes of 00h to 7Fh can be programmer-defined&lt;br /&gt;
* Signature bytes of 80h to FFh are reserved for future microprocessors by the [https://www.westerndesigncenter.com/ Western Design Center]&amp;lt;sup&amp;gt;[3]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The state of the [[interrupt disable flag]] has no effect on the behavior of COP although it will be set after COP runs.&lt;br /&gt;
&lt;br /&gt;
Some examples of the kinds of microprocessors COP could be used to communicate with include:&lt;br /&gt;
* floating point&lt;br /&gt;
* graphics&lt;br /&gt;
&lt;br /&gt;
The [[PBR]] is cleared, but in native mode its previous value is pushed to the [[stack]].&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
COP sig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Cycle Skipped ====&lt;br /&gt;
* COP takes one fewer cycle in [[emulation mode]] as it doesn&#039;t need to push the [[program counter bank register]] to the [[stack]].&lt;br /&gt;
&lt;br /&gt;
[[File:cop.png]]&lt;br /&gt;
&lt;br /&gt;
COP is not really used for anything on the SNES.&amp;lt;sup&amp;gt;[7]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[BRK]]&lt;br /&gt;
* [[RTI]]&lt;br /&gt;
* [[WDM]]&lt;br /&gt;
* [[Enhancement Chips]]&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
# [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/447 page 447] on COP&lt;br /&gt;
# [[Labiak]], [https://archive.org/details/Programming_the_65816/page/135 page 135] on COP&lt;br /&gt;
# section 7.15 of 65c816 datasheet&lt;br /&gt;
# snes9x implementation of COP: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L2738&lt;br /&gt;
# https://ersanio.gitbook.io/assembly-for-the-snes/deep-dives/misc&lt;br /&gt;
# https://undisbeliever.net/snesdev/65816-opcodes.html#software-interrupts&lt;br /&gt;
# https://forums.nesdev.org/viewtopic.php?p=176406#p176406&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:65c816 additions]]&lt;br /&gt;
[[Category:Two-byte Instructions]]&lt;br /&gt;
[[Category:Single Admode Mnemonics]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Pixel_Processing_Unit&amp;diff=21200</id>
		<title>Pixel Processing Unit</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Pixel_Processing_Unit&amp;diff=21200"/>
		<updated>2026-05-15T08:10:51Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: created page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#redirect [[Picture Processing Unit]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=BIT&amp;diff=21199</id>
		<title>BIT</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=BIT&amp;diff=21199"/>
		<updated>2026-05-15T08:01:49Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: make effective address plus one super clear&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:40%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Basic Info&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Addressing Mode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Opcode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Length&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Speed&#039;&#039;&#039;&lt;br /&gt;
|+&lt;br /&gt;
|[[Immediate]]&lt;br /&gt;
|89&lt;br /&gt;
|2/3 bytes&lt;br /&gt;
|2 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute]]&lt;br /&gt;
|2C&lt;br /&gt;
|3 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Addressing|Direct Page]]&lt;br /&gt;
|24&lt;br /&gt;
|2 bytes&lt;br /&gt;
|3 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute Indexed by X]]&lt;br /&gt;
|3C&lt;br /&gt;
|3 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indexed by X]]&lt;br /&gt;
|34&lt;br /&gt;
|2 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:30%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;9&amp;quot;|Flags Affected&lt;br /&gt;
|+&lt;br /&gt;
|Addressing Mode&lt;br /&gt;
|[[Negative Flag|N]]&lt;br /&gt;
|[[Overflow Flag|V]]&lt;br /&gt;
|[[M Flag|M]]&lt;br /&gt;
|[[X Flag|X]]&lt;br /&gt;
|[[Decimal Flag|D]]&lt;br /&gt;
|[[I Flag|I]]&lt;br /&gt;
|[[Zero Flag|Z]]&lt;br /&gt;
|[[Carry Flag|C]]&lt;br /&gt;
|+&lt;br /&gt;
|[[Immediate]]&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|Z&lt;br /&gt;
|.&lt;br /&gt;
|+&lt;br /&gt;
|other&lt;br /&gt;
|N&lt;br /&gt;
|V&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|Z&lt;br /&gt;
|.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BIT&#039;&#039;&#039; is a 65x instruction that performs a logical AND operation between the [[accumulator]] and memory without storing the conjunction.  If the conjunction is zero, the [[zero flag]] is set, otherwise it is cleared.&lt;br /&gt;
&lt;br /&gt;
The size of the accumulator determines whether this is an 8 or 16 bit operation. If 16-bit and not using [[immediate addressing]], the low-order byte is located at the effective address and the high-order byte at the effective address plus one.&lt;br /&gt;
&lt;br /&gt;
Except in [[immediate addressing]], the most significant bit of the data located at the effective address (or effective address plus one) is moved into the [[negative flag]], and the second most significant bit of that data is moved into the [[overflow flag]].  BIT is often used right before a conditional branch instruction like [[BVC]] or [[BVS]].&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BIT #const&lt;br /&gt;
BIT addr&lt;br /&gt;
BIT dp&lt;br /&gt;
BIT addr, X&lt;br /&gt;
BIT dp, X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Cycle Penalties ====&lt;br /&gt;
* BIT takes an extra cycle when the accumulator is 16 bits wide, in all [[addressing modes]]&lt;br /&gt;
* In [[direct page addressing]] modes (opcodes 24 and 34), BIT takes an extra cycle when the low byte of the [[direct page register]] is nonzero&lt;br /&gt;
* In [[Absolute Indexed, X Addressing]] only, BIT takes an extra cycle when adding the index crosses a [[page]] boundary&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[AND]]&lt;br /&gt;
* [[BPL]]&lt;br /&gt;
* [[BNE]]&lt;br /&gt;
* [[BCC]]&lt;br /&gt;
* [[BCS]]&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/431 page 431] on BIT&lt;br /&gt;
* [[Labiak]], [https://archive.org/details/Programming_the_65816/page/n131 page 121] on BIT&lt;br /&gt;
* 4.2.2.1 on [[MCS6500 Manual]], [https://archive.org/details/mos_microcomputers_programming_manual/page/n62 page 47] on BIT&lt;br /&gt;
* [[Carr]], [https://archive.org/details/6502UsersManual/page/n262 page 249] on BIT&lt;br /&gt;
* [[Leventhal]], [https://archive.org/details/6502-assembly-language-programming/page/n94 page 3-45] on BIT&lt;br /&gt;
* snes9x implementation of BIT: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L265&lt;br /&gt;
* undisbeliever on BIT: https://undisbeliever.net/snesdev/65816-opcodes.html#bit-test-memory-bits-against-accumulator&lt;br /&gt;
* Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#BIT&lt;br /&gt;
* Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#6.1.2.2&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Group Three Instructions]]&lt;br /&gt;
[[Category:Inherited from 6502]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=SBC&amp;diff=21198</id>
		<title>SBC</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=SBC&amp;diff=21198"/>
		<updated>2026-05-15T02:53:35Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* Cycle Penalties */ page 533 does not have this superscript&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:50%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Basic Info&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Addressing Mode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Opcode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Length&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Speed&#039;&#039;&#039;&lt;br /&gt;
|+&lt;br /&gt;
|[[Immediate]]&lt;br /&gt;
|E9&lt;br /&gt;
|2/3 bytes&lt;br /&gt;
|2 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute]]&lt;br /&gt;
|ED&lt;br /&gt;
|3 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute Long Addressing|Absolute Long]]&lt;br /&gt;
|EF&lt;br /&gt;
|4 bytes&lt;br /&gt;
|5 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page|Direct Page]]&lt;br /&gt;
|E5&lt;br /&gt;
|2 bytes&lt;br /&gt;
|3 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indirect Addressing|Direct Page Indirect]]&lt;br /&gt;
|F2&lt;br /&gt;
|2 bytes&lt;br /&gt;
|5 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indirect Long]]&lt;br /&gt;
|E7&lt;br /&gt;
|2 bytes&lt;br /&gt;
|6 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute Indexed by X]]&lt;br /&gt;
|FD&lt;br /&gt;
|3 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute Long Indexed by X]]&lt;br /&gt;
|FF&lt;br /&gt;
|4 bytes&lt;br /&gt;
|5 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute Indexed by Y]]&lt;br /&gt;
|F9&lt;br /&gt;
|3 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indexed by X]]&lt;br /&gt;
|F5&lt;br /&gt;
|2 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indexed Indirect by X]]&lt;br /&gt;
|E1&lt;br /&gt;
|2 bytes&lt;br /&gt;
|6 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indirect Indexed by Y]]&lt;br /&gt;
|F1&lt;br /&gt;
|2 bytes&lt;br /&gt;
|5 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indirect Long Indexed by Y]]&lt;br /&gt;
|F7&lt;br /&gt;
|2 bytes&lt;br /&gt;
|6 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Stack Relative]]&lt;br /&gt;
|E3&lt;br /&gt;
|2 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Stack Relative Indirect Indexed by Y]]&lt;br /&gt;
|F3&lt;br /&gt;
|2 bytes&lt;br /&gt;
|7 cycles*&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:30%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;9&amp;quot;|Flags Affected&lt;br /&gt;
|+&lt;br /&gt;
|[[N Flag|N]]&lt;br /&gt;
|[[V Flag|V]]&lt;br /&gt;
|[[M Flag|M]]&lt;br /&gt;
|[[X Flag|X]]&lt;br /&gt;
|[[D Flag|D]]&lt;br /&gt;
|[[I Flag|I]]&lt;br /&gt;
|[[Z Flag|Z]]&lt;br /&gt;
|[[C Flag|C]]&lt;br /&gt;
|+&lt;br /&gt;
|N&lt;br /&gt;
|V&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|Z&lt;br /&gt;
|C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SBC&#039;&#039;&#039; (Subtract with Carry/Borrow) is the main 65x subtraction instruction.  The [[accumulator]] serves as both the minuend and where the difference is stored.  The operand serves as the subtrahend.  For example, SBC #6 does &amp;quot;a minus 6&amp;quot; but there is this caveat about the carry flag:&lt;br /&gt;
&lt;br /&gt;
If the [[carry flag]] (aka borrow flag) is clear, one more is subtracted.  As there is no subtract-without-carry instruction, [[SEC]] should be run beforehand or the carry flag should otherwise be ensured to be set, otherwise the difference may be one greater than expected.&lt;br /&gt;
&lt;br /&gt;
The size of the accumulator determines whether this is an 8 or 16 bit operation. If 16-bit and not using [[immediate addressing]], the low-order byte is located at the effective address and the high-order byte at the effective address plus one. &lt;br /&gt;
&lt;br /&gt;
If the difference is negative, the carry flag will be cleared, otherwise it will be set.  If the [[decimal flag]] is set, then [[binary coded decimal]] subtraction is performed, otherwise binary subtraction.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SBC #const&lt;br /&gt;
SBC addr&lt;br /&gt;
SBC long&lt;br /&gt;
SBC dp&lt;br /&gt;
SBC (dp)&lt;br /&gt;
SBC [dp]&lt;br /&gt;
SBC addr, X&lt;br /&gt;
SBC long, X&lt;br /&gt;
SBC addr, Y&lt;br /&gt;
SBC dp, X&lt;br /&gt;
SBC (dp, X)&lt;br /&gt;
SBC (dp), Y&lt;br /&gt;
SBC [dp], Y&lt;br /&gt;
SBC sr, S&lt;br /&gt;
SBC (sr, S), Y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you only need to subtract one, consider [[DEC]] instead.&lt;br /&gt;
&lt;br /&gt;
==== Cycle Penalties ====&lt;br /&gt;
SBC takes an extra cycle for each of the following:&lt;br /&gt;
* if the accumulator is 16 bits wide, in all addressing modes&lt;br /&gt;
* when utilizing the [[direct register]] (opcodes E5, F2, E7, F5, E1, F1, and F7), if the low byte of the direct register is nonzero&lt;br /&gt;
* In both [[Absolute Indexed]] and [[Direct Page Indirect Indexed by Y]] addressing modes if adding an index crosses a [[page]] boundary&lt;br /&gt;
&lt;br /&gt;
Unlike the 65c02, the 65c816 does not have a cycle penalty when subtracting in decimal mode.&lt;br /&gt;
&lt;br /&gt;
In [[Eyes &amp;amp; Lichty]] on page 498, opcode F5 has a &amp;quot;0&amp;quot; superscript typo on the # of cycles column.  On page 533 opcode F5 does not have this superscript.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[ADC]]&lt;br /&gt;
* [[SBC (SPC700)]]&lt;br /&gt;
* [[SUB (Super FX)]]&lt;br /&gt;
* [[DEX]]&lt;br /&gt;
* [[DEY]]&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/497 page 497] on SBC&lt;br /&gt;
* [[Labiak]], [https://archive.org/details/Programming_the_65816/page/n189 page 179] on SBC&lt;br /&gt;
* 2.2.2 on [[MCS6500 Manual]], [https://archive.org/details/mos_microcomputers_programming_manual/page/n29 page 14] on SBC&lt;br /&gt;
* [[Carr]], [https://archive.org/details/6502UsersManual/page/n284 page 271] on SBC&lt;br /&gt;
* [[Leventhal]], [https://archive.org/details/6502-assembly-language-programming/page/n140 page 3-91] on SBC&lt;br /&gt;
* snes9x implementation of SBC: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L1133&lt;br /&gt;
* undisbeliever on SBC: https://undisbeliever.net/snesdev/65816-opcodes.html#sbc-subtract-with-borrow-from-accumulator&lt;br /&gt;
* Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#SBC&lt;br /&gt;
* Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#6.1.1.1&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Group One Instructions]]&lt;br /&gt;
[[Category:Inherited from 6502]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=AND&amp;diff=21197</id>
		<title>AND</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=AND&amp;diff=21197"/>
		<updated>2026-05-15T02:50:57Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* Cycle Penalties */ page 528 does not have this superscript&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:50%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Basic Info&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Addressing Mode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Opcode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Length&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Speed&#039;&#039;&#039;&lt;br /&gt;
|+&lt;br /&gt;
|[[Immediate]]&lt;br /&gt;
|29&lt;br /&gt;
|2/3 bytes&lt;br /&gt;
|2 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute]]&lt;br /&gt;
|2D&lt;br /&gt;
|3 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute Long]]&lt;br /&gt;
|2F&lt;br /&gt;
|4 bytes&lt;br /&gt;
|5 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Addressing|Direct Page]]&lt;br /&gt;
|25&lt;br /&gt;
|2 bytes&lt;br /&gt;
|3 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indirect]]&lt;br /&gt;
|32&lt;br /&gt;
|2 bytes&lt;br /&gt;
|5 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indirect Long]]&lt;br /&gt;
|27&lt;br /&gt;
|2 bytes&lt;br /&gt;
|6 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute Indexed by X]]&lt;br /&gt;
|3D&lt;br /&gt;
|3 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute Long Indexed by X]]&lt;br /&gt;
|3F&lt;br /&gt;
|4 bytes&lt;br /&gt;
|5 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute Indexed by Y]]&lt;br /&gt;
|39&lt;br /&gt;
|3 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indexed by X]]&lt;br /&gt;
|35&lt;br /&gt;
|2 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indexed Indirect by X]]&lt;br /&gt;
|21&lt;br /&gt;
|2 bytes&lt;br /&gt;
|6 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indirect Indexed by Y]]&lt;br /&gt;
|31&lt;br /&gt;
|2 bytes&lt;br /&gt;
|5 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indirect Long Indexed by Y]]&lt;br /&gt;
|37&lt;br /&gt;
|2 bytes&lt;br /&gt;
|6 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Stack Relative]]&lt;br /&gt;
|23&lt;br /&gt;
|2 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Stack Relative Indirect Indexed by Y]]&lt;br /&gt;
|33&lt;br /&gt;
|2 bytes&lt;br /&gt;
|7 cycles*&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:30%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Flags Affected&lt;br /&gt;
|+&lt;br /&gt;
|[[Negative Flag|N]]&lt;br /&gt;
|[[Overflow Flag|V]]&lt;br /&gt;
|[[M Flag|M]]&lt;br /&gt;
|[[X Flag|X]]&lt;br /&gt;
|[[Decimal Flag|D]]&lt;br /&gt;
|[[I Flag|I]]&lt;br /&gt;
|[[Zero Flag|Z]]&lt;br /&gt;
|[[Carry Flag|C]]&lt;br /&gt;
|+&lt;br /&gt;
|N&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|Z&lt;br /&gt;
|.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;AND&#039;&#039;&#039; is a 65x instruction that performs a logical AND.  The conjunction is stored in the [[accumulator]].  The size of the accumulator determines how much data is ANDed: if 16-bit and not using [[immediate addressing]], the low-order byte is located at the effective address and the high-order byte at the effective address plus one.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AND #const&lt;br /&gt;
AND addr&lt;br /&gt;
AND long&lt;br /&gt;
AND dp&lt;br /&gt;
AND (dp)&lt;br /&gt;
AND [dp]&lt;br /&gt;
AND addr, X&lt;br /&gt;
AND long, X&lt;br /&gt;
AND addr, Y&lt;br /&gt;
AND dp, X&lt;br /&gt;
AND (dp, X)&lt;br /&gt;
AND (dp), Y&lt;br /&gt;
AND [dp], Y&lt;br /&gt;
AND sr, S&lt;br /&gt;
AND (sr, S), Y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Cycle Penalties ====&lt;br /&gt;
* In all [[addressing modes]], AND takes one extra cycle when the accumulator is 16 bits wide.&lt;br /&gt;
* In [[direct page addressing]] modes only (opcodes 25, 32, 27, 35, 21, 31, 37), AND takes an extra cycle if the low byte of the [[direct page register]] is nonzero.&lt;br /&gt;
* In both [[Absolute Indexed]] addressing modes and [[Direct Page Indirect Indexed by Y]] admodes, AND takes an extra cycle if adding the index crosses a page boundary.&lt;br /&gt;
&lt;br /&gt;
[[Eyes &amp;amp; Lichty]] has a typo on page 426, referring to cycle penalty #0 in a superscript for opcode 37.  On page 528 opcode 37 does not have this superscript.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[ORA]]&lt;br /&gt;
* [[EOR]]&lt;br /&gt;
* [[BIT]]&lt;br /&gt;
* [[AND (SPC700)]]&lt;br /&gt;
* [[AND (Super FX)]]&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/425 page 425] on AND&lt;br /&gt;
* [[Labiak]], [https://archive.org/details/Programming_the_65816/page/n126 page 116] on AND&lt;br /&gt;
* 2.2.4.1 on [[MCS6500 Manual]], [https://archive.org/details/mos_microcomputers_programming_manual/page/n35 page 20] on AND&lt;br /&gt;
* [https://archive.org/details/mos_microcomputers_programming_manual/page/n204 B-3], lbid.&lt;br /&gt;
* [[Carr]], [https://archive.org/details/6502UsersManual/page/n259 page 246] on AND&lt;br /&gt;
* [[Leventhal]], [https://archive.org/details/6502-assembly-language-programming/page/n89 page 3-40] on AND&lt;br /&gt;
* undisbeliever on AND: https://undisbeliever.net/snesdev/65816-opcodes.html#and-and-accumulator-with-memory&lt;br /&gt;
* Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#AND&lt;br /&gt;
* Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#6.1.2.1&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Group One Instructions]]&lt;br /&gt;
[[Category:Inherited from 6502]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=MERGE_(Super_FX)&amp;diff=21196</id>
		<title>MERGE (Super FX)</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=MERGE_(Super_FX)&amp;diff=21196"/>
		<updated>2026-05-14T21:40:45Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: added how flags are affected&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:50%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Basic Info&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Addressing Mode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Opcode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Length&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;ROM Speed&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;RAM Speed&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Cache Speed&#039;&#039;&#039;&lt;br /&gt;
|+&lt;br /&gt;
|[[Implied]] (type 1)&lt;br /&gt;
|70&lt;br /&gt;
|1 byte&lt;br /&gt;
|3 cycles&lt;br /&gt;
|3 cycles&lt;br /&gt;
|1 cycle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:30%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;9&amp;quot;|Flags Affected&lt;br /&gt;
|+&lt;br /&gt;
|[[B Flag|B]]&lt;br /&gt;
|[[ALT1]]&lt;br /&gt;
|[[ALT2]]&lt;br /&gt;
|[[O/V]]&lt;br /&gt;
|[[Sign Flag|S]]&lt;br /&gt;
|[[CY]]&lt;br /&gt;
|[[Zero Flag|Z]]&lt;br /&gt;
|+&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|0&lt;br /&gt;
|O/V&lt;br /&gt;
|S&lt;br /&gt;
|CY&lt;br /&gt;
|Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MERGE&#039;&#039;&#039; is a [[Super FX]] instruction that merges the high bytes of two specific general registers into the [[destination register]].&lt;br /&gt;
&lt;br /&gt;
The high byte of D&amp;lt;sub&amp;gt;reg&amp;lt;/sub&amp;gt; comes from R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;.&lt;br /&gt;
The low byte of D&amp;lt;sub&amp;gt;reg&amp;lt;/sub&amp;gt; comes from R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The official documentation has several bits labeled &amp;quot;B&amp;quot; not &#039;D&amp;quot; below the &amp;quot;Flags affected&amp;quot; table.&amp;lt;sup&amp;gt;[1]&amp;lt;/sup&amp;gt;  The O/V  flag is set if the result of (D6, D7, D14, or D15) is 1 and cleared if 0.  The sign flag is set if the result of (D7 or D15) is 1 and cleared if 0.  The C/Y  flag is set if the result of (D5, D6, D7, D13, D14, or D15) is 1 and cleared if 0.  The zero flag is set if the result of (D4, D5, D6, D7, D12, D13, D14, or D15) is 1 and cleared if 0.&lt;br /&gt;
&lt;br /&gt;
The [[ALT0]] state is restored.&lt;br /&gt;
&lt;br /&gt;
The destination register should be specified in advance using [[WITH]] or [[TO]].  Otherwise, R&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; serves as the default.  The [[source register]] is ignored.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MERGE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
Let:&lt;br /&gt;
 D&amp;lt;sub&amp;gt;reg&amp;lt;/sub&amp;gt; : R&amp;lt;sub&amp;gt;9&amp;lt;/sub&amp;gt;&lt;br /&gt;
 R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 05aah&lt;br /&gt;
 R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = fc33h&lt;br /&gt;
After executing MERGE:&lt;br /&gt;
 R&amp;lt;sub&amp;gt;9&amp;lt;/sub&amp;gt; = 05fch&lt;br /&gt;
and the sign, overflow, carry, and zero flags are set&lt;br /&gt;
&lt;br /&gt;
[[File:gsu_merge.png]]&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[HIB]]&lt;br /&gt;
* [[LOB]]&lt;br /&gt;
* [[SEX]]&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
* Official Nintendo documentation on MERGE: paragraph 9.56 on [https://archive.org/details/SNESDevManual/book2/page/n235 page 2-9-79 of Book II]&lt;br /&gt;
* example: [https://archive.org/details/SNESDevManual/book2/page/n236 page 2-9-80 of Book II], lbid.&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Super FX]]&lt;br /&gt;
[[Category:Byte Transfer Instructions]]&lt;br /&gt;
[[Category:One-byte Instructions]]&lt;br /&gt;
[[Category:Expects Sreg/Dreg Prearranged]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Background_Mode&amp;diff=21195</id>
		<title>Background Mode</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Background_Mode&amp;diff=21195"/>
		<updated>2026-05-14T09:13:30Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: pluralize bits&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On the SNES hardware, the BG modes are used to specify the number of layers, the color depth of the graphics and some effect avaliable.  There are 8 different BG modes. The BG mode is stored in bits 0,1 and 2 of $2105&lt;br /&gt;
&lt;br /&gt;
* [[Mode 0]]: 4 layers, all using 2bpp graphic.&lt;br /&gt;
* [[Mode 1]]: 3 layers, two using 4bpp graphic and one using 2bpp graphic. This is one of the most commonly used video modes.&lt;br /&gt;
* [[Mode 2]]: 2 layers, both using 4bpp graphic. Each tile can be individually scrolled.&lt;br /&gt;
* [[Mode 3]]: 2 layers, one using 8bpp graphic and one using 4bpp graphic. The 8bpp layer can also directly specify colors from an 11-bit (RGB443) colorspace.&lt;br /&gt;
* [[Mode 4]]: 2 layers, one using the 8bpp graphic and one using 2bpp graphic. The 8bpp layer can directly specify colors as with Mode 3, and each tile can be individually scrolled as in Mode 2.&lt;br /&gt;
* [[Mode 5]]: 2 layers, one using 4bpp graphic and one using 2bpp graphic. In this mode, output is always 512 pixels horizontally with altered tile decoding to facilitate use of the 512-width and interlaced modes.&lt;br /&gt;
* [[Mode 6]]: 1 layer, using 4bpp graphic. Output is as in Mode 5, and individual tiles are scrolled as in Mode 2.&lt;br /&gt;
* [[Mode 7]]: 1 layer of 128x128 tiles from a set of 256, which can be interpreted as 8bpp or 7bpp (using the higher bit as a pixel priority bit) depending of bit 7 of $2133 . The layer may be rotated and scaled using matrix transformations. HDMA is often used to change the matrix parameters for each scanline to generate perspective effects, giving a pseudo-3d effect.&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* [https://archive.org/details/SNESDevManual/book1/page/n62 page 2-3-1 of Book I] of the official Super Nintendo development manual&lt;br /&gt;
&lt;br /&gt;
[[Category:SNES Hardware]]&lt;br /&gt;
[[Category:Video]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=fullsnes&amp;diff=21194</id>
		<title>fullsnes</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=fullsnes&amp;diff=21194"/>
		<updated>2026-05-14T08:37:07Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* Errata */ BRK&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Fullsnes&#039;&#039;&#039; is a large hardware reference for the SNES created by [[nocash]] with several ascii art illustrations.&lt;br /&gt;
&lt;br /&gt;
=== Errata ===&lt;br /&gt;
* It may be more correct to say that the [[SPC700]] has no *hardware* interrupt sources rather than no interrupt sources whatsoever due to the existence of the [[BRK (SPC700)]] instruction.&lt;br /&gt;
* With regards to the [[break flag]], this sentence is dubious: &amp;quot;PHP opcodes always write &amp;quot;1&amp;quot; into the bit&amp;quot;&lt;br /&gt;
* The [[Color Math]] register at 2130h is missing an &amp;quot;S&amp;quot; - the full name is CGSWSEL not CGWSEL.&lt;br /&gt;
* In https://problemkaputt.de/fullsnes.htm#snesapumaincpucommunicationport, fullsnes only mentions storing the entrypoint to 2142h and does not mention whether the entrypoint is a word or byte (the other places in this section where the bracket notation omits &amp;quot;Byte&amp;quot; or &amp;quot;Word&amp;quot; it is a single byte being stored).  The Official Super Nintendo development manual is clear that the program start address for the uploaded SPC700 driver is stored to both PORT 2 and 3 (as part of step 11 on page D-2).&lt;br /&gt;
* In https://problemkaputt.de/fullsnes.htm#snescartridgecicnotes, the formula for the [[Polynomial Counter]] is missing an inversion in the second term.&lt;br /&gt;
* In https://problemkaputt.de/fullsnes.htm#snespputimersandstatus, the [[Interlace Odd/Even Flag]] should use the term &amp;quot;field&amp;quot; instead of &amp;quot;frame&amp;quot; as an interlaced field is half of a frame&lt;br /&gt;
* In https://problemkaputt.de/fullsnes.htm#snesapuspc700ioports, it could be clearer that bits 0-3 of TnOUT are reset to 0 automatically by hardware after reading - it is not the programmer&#039;s responsibility to zero them after reading. &amp;lt;sup&amp;gt;[1]&amp;lt;/sup&amp;gt;&lt;br /&gt;
* In https://problemkaputt.de/fullsnes.htm#snesapudspvolumeregisters, MVOL should stand for &amp;quot;main volume,&amp;quot; not &amp;quot;master volume&amp;quot; because MVOL does not control the echo volume, and &amp;quot;Main Volume&amp;quot; is how the official docs expand &amp;quot;MVOL.&amp;quot; &amp;lt;sup&amp;gt;[2]&amp;lt;/sup&amp;gt;&lt;br /&gt;
* In https://problemkaputt.de/fullsnes.htm#snesapublockdiagram, the word &amp;quot;Reverb&amp;quot; is used (the only place this word is used in fullsnes) but should probably say &amp;quot;Echo&amp;quot; instead like the rest of the times this feature is mentioned, as they have slightly different musical meanings.&lt;br /&gt;
* In https://problemkaputt.de/fullsnes.htm#snesapudspechoregisters, &amp;quot;bit&amp;quot; should be plural in several places when describing the ESA buffer entry bytes&lt;br /&gt;
* In https://problemkaputt.de/fullsnes.htm#snescartridgeromimageinterleave, the worst case scenario can much worse than triple-interleaved or double-mis-de-interleaved - in fact ten interleavings of a normal 320Kbyte file is the identity operation, so in this particular case the worst is quintuple-interleaved.&lt;br /&gt;
* &amp;quot;Game Boy&amp;quot; is spelled several times as one word&lt;br /&gt;
* In the https://problemkaputt.de/fullsnes.htm#snesapumaincpucommunicationport notes there is a typo: &amp;quot;injumping&amp;quot;&lt;br /&gt;
* In https://problemkaputt.de/fullsnes.htm#snesapuspc700ioports under &amp;quot;SPC700 Waitstates on Internal Cycles&amp;quot; the note at the bottom has typo: &amp;quot;cylces&amp;quot;&lt;br /&gt;
* In the IPL Boot ROM Disassembly, both the zerofill and transfer loops have a typo where &amp;quot;loop&amp;quot; is spelled with one &amp;quot;o&amp;quot;&lt;br /&gt;
* The four communication ports between the [[APU]] and the [[5A22]] are prefixed CPUIO (cpu input/output) on the 5A22 side but APUI0 (apu eye zero) on the APU side&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
&lt;br /&gt;
* https://problemkaputt.de/fullsnes.htm&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
# [https://archive.org/details/SNESDevManual/book1/page/n164 Page 3-5-2 of Book I] of the official Super Nintendo development manual: &amp;quot;When CN is read, the 4-bit up counter alone is cleared through IC internal timing&amp;quot;&lt;br /&gt;
# [https://archive.org/details/SNESDevManual/book1/page/n175 page 3-7-9 of Book I] lbid&lt;br /&gt;
&lt;br /&gt;
[[Category:SNES Hardware]]&lt;br /&gt;
[[Category:Documents]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Interrupt_Handler&amp;diff=21193</id>
		<title>Interrupt Handler</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Interrupt_Handler&amp;diff=21193"/>
		<updated>2026-05-14T07:05:00Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: numbered order&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An &#039;&#039;&#039;Interrupt Handler&#039;&#039;&#039; is a subroutine which the CPU automatically runs when an interrupt occurs.&lt;br /&gt;
&lt;br /&gt;
ISR stands for &amp;quot;interrupt service routine.&amp;quot;  Interrupts are never serviced when an instruction is only partially finished running (except if you count [[MVP]]/[[MVN]] which can be interrupted once every 7 cycles), but only after the instruction completes.&lt;br /&gt;
&lt;br /&gt;
Use [[BRK]] to force a software interrupt.&lt;br /&gt;
&lt;br /&gt;
When an interrupt occurs, the following are pushed to the [[stack]] in this exact order:&lt;br /&gt;
# [[program bank register]]&lt;br /&gt;
# [[program counter]] high byte&lt;br /&gt;
# program counter low byte&lt;br /&gt;
# [[status register]]&lt;br /&gt;
&lt;br /&gt;
Return control back with [[RTI]] when on the [[65c816]] or [[RETI]] when on the [[SPC700]].&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[NMI]]&lt;br /&gt;
* [[IRQ]]&lt;br /&gt;
* [[WAI]]&lt;br /&gt;
* [[Interrupt Request]]&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Program_Counter&amp;diff=21192</id>
		<title>Program Counter</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Program_Counter&amp;diff=21192"/>
		<updated>2026-05-14T06:36:43Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: linkify abs addressing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Program Counter&#039;&#039;&#039; (PC) points to the next instruction byte to fetch.  On both the [[65c816]] and [[S-SMP]] it is 16 bits wide.  The low byte is called PCL and the high byte is called PCH.&lt;br /&gt;
&lt;br /&gt;
If incremented past FFFFh, it wraps around to zero.&amp;lt;sup&amp;gt;[E&amp;amp;L, page 34]&amp;lt;/sup&amp;gt;  It is incremented after opcode fetch.&lt;br /&gt;
&lt;br /&gt;
The 6502 had 16-bit [[absolute addressing]] but only an 8-bit adder, so in [[emulation mode]] branches that cross a page boundary incur a one cycle penalty.  65c816 native mode has no such penalty because the full 16-bit adder is used.&lt;br /&gt;
&lt;br /&gt;
Interrupts cause the program counter to be pushed to the stack (high byte first).&lt;br /&gt;
&lt;br /&gt;
The program counter alone is not enough to uniquely identify the current instruction - the [[program bank register]] holds the high byte of the full 24-bit address.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[Stack Pointer]]&lt;br /&gt;
* [[Super_FX#Program_Counter_(R15)]]&lt;br /&gt;
* [[BRA]]&lt;br /&gt;
* [[JMP]]&lt;br /&gt;
* [[RTS]]&lt;br /&gt;
* [[RTL]]&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/33 page 33]&lt;br /&gt;
* subparagraph 8.1.4 on [https://archive.org/details/SNESDevManual/book1/page/n182 page 3-8-4 of Book I] of the official Super Nintendo development manual&lt;br /&gt;
* Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#PC&lt;br /&gt;
* Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#6.2.1.1&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Registers]]&lt;br /&gt;
[[Category:Inherited from 6502]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Program_Counter&amp;diff=21191</id>
		<title>Program Counter</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Program_Counter&amp;diff=21191"/>
		<updated>2026-05-14T06:26:22Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: explain pbr&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Program Counter&#039;&#039;&#039; (PC) points to the next instruction byte to fetch.  On both the [[65c816]] and [[S-SMP]] it is 16 bits wide.  The low byte is called PCL and the high byte is called PCH.&lt;br /&gt;
&lt;br /&gt;
If incremented past FFFFh, it wraps around to zero.&amp;lt;sup&amp;gt;[E&amp;amp;L, page 34]&amp;lt;/sup&amp;gt;  It is incremented after opcode fetch.&lt;br /&gt;
&lt;br /&gt;
The 6502 had 16-bit absolute addressing but only an 8-bit adder, so in [[emulation mode]] branches that cross a page boundary incur a one cycle penalty.  65c816 native mode has no such penalty because the full 16-bit adder is used.&lt;br /&gt;
&lt;br /&gt;
Interrupts cause the program counter to be pushed to the stack (high byte first).&lt;br /&gt;
&lt;br /&gt;
The program counter alone is not enough to uniquely identify the current instruction - the [[program bank register]] holds the high byte of the full 24-bit address.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[Stack Pointer]]&lt;br /&gt;
* [[Super_FX#Program_Counter_(R15)]]&lt;br /&gt;
* [[BRA]]&lt;br /&gt;
* [[JMP]]&lt;br /&gt;
* [[RTS]]&lt;br /&gt;
* [[RTL]]&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/33 page 33]&lt;br /&gt;
* subparagraph 8.1.4 on [https://archive.org/details/SNESDevManual/book1/page/n182 page 3-8-4 of Book I] of the official Super Nintendo development manual&lt;br /&gt;
* Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#PC&lt;br /&gt;
* Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#6.2.1.1&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Registers]]&lt;br /&gt;
[[Category:Inherited from 6502]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Program_Counter&amp;diff=21190</id>
		<title>Program Counter</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Program_Counter&amp;diff=21190"/>
		<updated>2026-05-14T05:07:56Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: when incremented&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Program Counter&#039;&#039;&#039; (PC) points to the next instruction byte to fetch.  On both the [[65c816]] and [[S-SMP]] it is 16 bits wide.  The low byte is called PCL and the high byte is called PCH.&lt;br /&gt;
&lt;br /&gt;
If incremented past FFFFh, it wraps around to zero.&amp;lt;sup&amp;gt;[E&amp;amp;L, page 34]&amp;lt;/sup&amp;gt;  It is incremented after opcode fetch.&lt;br /&gt;
&lt;br /&gt;
The 6502 had 16-bit absolute addressing but only an 8-bit adder, so in [[emulation mode]] branches that cross a page boundary incur a one cycle penalty.  65c816 native mode has no such penalty because the full 16-bit adder is used.&lt;br /&gt;
&lt;br /&gt;
Interrupts cause the program counter to be pushed to the stack (high byte first).&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[Program Bank Register]]&lt;br /&gt;
* [[Stack Pointer]]&lt;br /&gt;
* [[Super_FX#Program_Counter_(R15)]]&lt;br /&gt;
* [[BRA]]&lt;br /&gt;
* [[JMP]]&lt;br /&gt;
* [[RTS]]&lt;br /&gt;
* [[RTL]]&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/33 page 33]&lt;br /&gt;
* subparagraph 8.1.4 on [https://archive.org/details/SNESDevManual/book1/page/n182 page 3-8-4 of Book I] of the official Super Nintendo development manual&lt;br /&gt;
* Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#PC&lt;br /&gt;
* Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#6.2.1.1&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Registers]]&lt;br /&gt;
[[Category:Inherited from 6502]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Pipeline&amp;diff=21189</id>
		<title>Pipeline</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Pipeline&amp;diff=21189"/>
		<updated>2026-05-14T05:05:09Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: Xetheria moved page Pipeline to Pipelining&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Pipelining]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Pipelining&amp;diff=21188</id>
		<title>Pipelining</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Pipelining&amp;diff=21188"/>
		<updated>2026-05-14T05:05:09Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: Xetheria moved page Pipeline to Pipelining&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Pipelining&#039;&#039;&#039; is a feature of 65x processors to increase throughput.&lt;br /&gt;
&lt;br /&gt;
When finishing up an [[ADC]] instruction for example, these two things are happening simultaneously:&lt;br /&gt;
* opcode fetch for the next instruction&lt;br /&gt;
* the [[internal cycle]] of putting the sum into the accumulator.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[Super_FX#Pipeline_Processing]]&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/40 page 40]&lt;br /&gt;
&lt;br /&gt;
[[Category:SNES Hardware]]&lt;br /&gt;
[[Category:ASM]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Index_Register_Select&amp;diff=21187</id>
		<title>Index Register Select</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Index_Register_Select&amp;diff=21187"/>
		<updated>2026-05-14T03:55:28Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: RTI pops it off the stack&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Index Register Select&#039;&#039;&#039; (X) is a flag in the [[processor status register]] (bit 4) of the [[65c816]].  It indicates how wide the [[index register]]s are:&lt;br /&gt;
&lt;br /&gt;
* When clear, both index registers are 16 bits wide.  It can only be clear in [[native mode]].&lt;br /&gt;
* When set or in [[emulation mode]], both index registers are 8 bits wide and the high bytes are forced to zero.&lt;br /&gt;
&lt;br /&gt;
It is not possible to control the width of the two index registers individually.&lt;br /&gt;
&lt;br /&gt;
It can be affected by:&lt;br /&gt;
&lt;br /&gt;
* [[REP]] (clears it if bit 4 of operand is set)&lt;br /&gt;
* [[SEP]] (sets it if bit 4 of operand is set)&lt;br /&gt;
* [[PLP]] (pops it off the [[stack]])&lt;br /&gt;
* [[RTI]] (pops it off the stack)&lt;br /&gt;
&lt;br /&gt;
It affects the behavior of (possibly incomplete list):&lt;br /&gt;
* [[LDX]]&lt;br /&gt;
* [[LDY]]&lt;br /&gt;
* [[STX]]&lt;br /&gt;
* [[STY]]&lt;br /&gt;
* [[CPX]]&lt;br /&gt;
* [[CPY]]&lt;br /&gt;
* [[PHX]]&lt;br /&gt;
* [[PHY]]&lt;br /&gt;
* [[PLX]]&lt;br /&gt;
* [[PLY]]&lt;br /&gt;
* [[INX]]&lt;br /&gt;
* [[INY]]&lt;br /&gt;
* [[DEX]]&lt;br /&gt;
* [[DEY]]&lt;br /&gt;
* [[TXY]]&lt;br /&gt;
* [[TYX]]&lt;br /&gt;
* [[TXS]]&lt;br /&gt;
* [[TSX]]&lt;br /&gt;
&lt;br /&gt;
In [[emulation mode]], the x flag becomes the [[break flag]].&lt;br /&gt;
&lt;br /&gt;
There are no BXS or BXC instructions that examine this flag.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[Memory/Accumulator Select]]&lt;br /&gt;
* [[X Index Register]]&lt;br /&gt;
* [[Y Index Register]]&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/422 page 422], Table 18.2. 65x Flags.&lt;br /&gt;
* 65c816 datasheet paragraph 2.7 &amp;quot;Index (X and Y)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Flags]]&lt;br /&gt;
[[Category:65c816 additions]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Index_Register_Select&amp;diff=21186</id>
		<title>Index Register Select</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Index_Register_Select&amp;diff=21186"/>
		<updated>2026-05-14T03:02:07Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* References */ paragraph name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Index Register Select&#039;&#039;&#039; (X) is a flag in the [[processor status register]] (bit 4) of the [[65c816]].  It indicates how wide the [[index register]]s are:&lt;br /&gt;
&lt;br /&gt;
* When clear, both index registers are 16 bits wide.  It can only be clear in [[native mode]].&lt;br /&gt;
* When set or in [[emulation mode]], both index registers are 8 bits wide and the high bytes are forced to zero.&lt;br /&gt;
&lt;br /&gt;
It is not possible to control the width of the two index registers individually.&lt;br /&gt;
&lt;br /&gt;
It can be affected by:&lt;br /&gt;
&lt;br /&gt;
* [[REP]] (clears it if bit 4 of operand is set)&lt;br /&gt;
* [[SEP]] (sets it if bit 4 of operand is set)&lt;br /&gt;
* [[PLP]] (pops it off the [[stack]])&lt;br /&gt;
* [[RTI]]&lt;br /&gt;
&lt;br /&gt;
It affects the behavior of (possibly incomplete list):&lt;br /&gt;
* [[LDX]]&lt;br /&gt;
* [[LDY]]&lt;br /&gt;
* [[STX]]&lt;br /&gt;
* [[STY]]&lt;br /&gt;
* [[CPX]]&lt;br /&gt;
* [[CPY]]&lt;br /&gt;
* [[PHX]]&lt;br /&gt;
* [[PHY]]&lt;br /&gt;
* [[PLX]]&lt;br /&gt;
* [[PLY]]&lt;br /&gt;
* [[INX]]&lt;br /&gt;
* [[INY]]&lt;br /&gt;
* [[DEX]]&lt;br /&gt;
* [[DEY]]&lt;br /&gt;
* [[TXY]]&lt;br /&gt;
* [[TYX]]&lt;br /&gt;
* [[TXS]]&lt;br /&gt;
* [[TSX]]&lt;br /&gt;
&lt;br /&gt;
In [[emulation mode]], the x flag becomes the [[break flag]].&lt;br /&gt;
&lt;br /&gt;
There are no BXS or BXC instructions that examine this flag.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[Memory/Accumulator Select]]&lt;br /&gt;
* [[X Index Register]]&lt;br /&gt;
* [[Y Index Register]]&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/422 page 422], Table 18.2. 65x Flags.&lt;br /&gt;
* 65c816 datasheet paragraph 2.7 &amp;quot;Index (X and Y)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Flags]]&lt;br /&gt;
[[Category:65c816 additions]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=BRA_(Super_FX)&amp;diff=21185</id>
		<title>BRA (Super FX)</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=BRA_(Super_FX)&amp;diff=21185"/>
		<updated>2026-05-13T21:53:43Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: all flags ignored&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:50%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Basic Info&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Addressing Mode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Opcode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Length&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;ROM Speed&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;RAM Speed&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Cache Speed&#039;&#039;&#039;&lt;br /&gt;
|+&lt;br /&gt;
|[[Program Counter Relative]]&lt;br /&gt;
|05??&lt;br /&gt;
|2 bytes&lt;br /&gt;
|6 cycles&lt;br /&gt;
|6 cycles&lt;br /&gt;
|2 cycles&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:30%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;9&amp;quot;|Flags Affected&lt;br /&gt;
|+&lt;br /&gt;
|[[B Flag|B]]&lt;br /&gt;
|[[ALT1]]&lt;br /&gt;
|[[ALT2]]&lt;br /&gt;
|[[O/V]]&lt;br /&gt;
|[[Sign Flag|S]]&lt;br /&gt;
|[[CY]]&lt;br /&gt;
|[[Zero Flag|Z]]&lt;br /&gt;
|+&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BRA&#039;&#039;&#039; (Branch) is a [[Super FX]] instruction that performs an unconditional jump.  A relative offset of -128 to 127 bytes from the address following the BRA instruction is added into R&amp;lt;sub&amp;gt;15&amp;lt;/sub&amp;gt; (the program counter).&lt;br /&gt;
&lt;br /&gt;
No flags are affected.  All flags are ignored.&lt;br /&gt;
&lt;br /&gt;
The instruction after BRA is already in the pipeline and will be run before the instruction at the branch destination.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRA e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
This instruction jumps the program backward in an infinite loop:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 BRA $0h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[JMP (Super FX)]]&lt;br /&gt;
* [[LJMP (Super FX)]]&lt;br /&gt;
* [[BRA]]&lt;br /&gt;
* [[BRA (SPC700)]]&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
* Official Nintendo documentation on BRA: 9.24 on [https://archive.org/details/SNESDevManual/book2/page/n188 page 2-9-32 of Book II]&lt;br /&gt;
* example: [https://archive.org/details/SNESDevManual/book2/page/n189 page 2-9-33 of Book II], lbid.&lt;br /&gt;
&lt;br /&gt;
[[Category:Super FX]]&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Two-byte Instructions]]&lt;br /&gt;
[[Category:Instructions with Delay Slots]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=BRA_(Super_FX)&amp;diff=21184</id>
		<title>BRA (Super FX)</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=BRA_(Super_FX)&amp;diff=21184"/>
		<updated>2026-05-13T21:11:39Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* See Also */ (BRA spc700)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:50%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Basic Info&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Addressing Mode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Opcode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Length&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;ROM Speed&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;RAM Speed&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Cache Speed&#039;&#039;&#039;&lt;br /&gt;
|+&lt;br /&gt;
|[[Program Counter Relative]]&lt;br /&gt;
|05??&lt;br /&gt;
|2 bytes&lt;br /&gt;
|6 cycles&lt;br /&gt;
|6 cycles&lt;br /&gt;
|2 cycles&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:30%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;9&amp;quot;|Flags Affected&lt;br /&gt;
|+&lt;br /&gt;
|[[B Flag|B]]&lt;br /&gt;
|[[ALT1]]&lt;br /&gt;
|[[ALT2]]&lt;br /&gt;
|[[O/V]]&lt;br /&gt;
|[[Sign Flag|S]]&lt;br /&gt;
|[[CY]]&lt;br /&gt;
|[[Zero Flag|Z]]&lt;br /&gt;
|+&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BRA&#039;&#039;&#039; (Branch) is a [[Super FX]] instruction that performs an unconditional jump.  A relative offset of -128 to 127 bytes from the address following the BRA instruction is added into R&amp;lt;sub&amp;gt;15&amp;lt;/sub&amp;gt; (the program counter).&lt;br /&gt;
&lt;br /&gt;
No flags are affected.&lt;br /&gt;
&lt;br /&gt;
The instruction after BRA is already in the pipeline and will be run before the instruction at the branch destination.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRA e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
This instruction jumps the program backward in an infinite loop:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 BRA $0h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[JMP (Super FX)]]&lt;br /&gt;
* [[LJMP (Super FX)]]&lt;br /&gt;
* [[BRA]]&lt;br /&gt;
* [[BRA (SPC700)]]&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
* Official Nintendo documentation on BRA: 9.24 on [https://archive.org/details/SNESDevManual/book2/page/n188 page 2-9-32 of Book II]&lt;br /&gt;
* example: [https://archive.org/details/SNESDevManual/book2/page/n189 page 2-9-33 of Book II], lbid.&lt;br /&gt;
&lt;br /&gt;
[[Category:Super FX]]&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Two-byte Instructions]]&lt;br /&gt;
[[Category:Instructions with Delay Slots]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Timing_Control_Unit&amp;diff=21183</id>
		<title>Timing Control Unit</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Timing_Control_Unit&amp;diff=21183"/>
		<updated>2026-05-13T21:10:30Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* List of instructions without cycle penalties: */ BRA+JMP&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Timing Control Unit&#039;&#039;&#039; (TCU) is part of the [[65c816]].  It contains a counter that is reset at each instruction fetch and advances during each [[machine cycle]].  Together with the [[instruction register]], it helps the processor perform register transfers.&lt;br /&gt;
&lt;br /&gt;
==== List of instructions with cycle penalties: ====&lt;br /&gt;
&lt;br /&gt;
* [[ADC]]&lt;br /&gt;
* [[AND]]&lt;br /&gt;
* [[ASL]]&lt;br /&gt;
* [[BCC]]&lt;br /&gt;
* [[BCS]]&lt;br /&gt;
* [[BEQ]]&lt;br /&gt;
* [[BIT]]&lt;br /&gt;
* [[BMI]]&lt;br /&gt;
* [[BNE]]&lt;br /&gt;
* [[BPL]]&lt;br /&gt;
* [[BRA]]&lt;br /&gt;
* [[BRK]]&lt;br /&gt;
* [[BVC]]&lt;br /&gt;
* [[BVS]]&lt;br /&gt;
* [[CMP]]&lt;br /&gt;
* [[COP]]&lt;br /&gt;
* [[CPX]]&lt;br /&gt;
* [[CPY]]&lt;br /&gt;
* [[DEC]]&lt;br /&gt;
* [[EOR]]&lt;br /&gt;
* [[INC]]&lt;br /&gt;
* [[LDA]]&lt;br /&gt;
* [[LDX]]&lt;br /&gt;
* [[LDY]]&lt;br /&gt;
* [[LSR]]&lt;br /&gt;
* [[ORA]]&lt;br /&gt;
* [[PEI]]&lt;br /&gt;
* [[PHA]]&lt;br /&gt;
* [[PHX]]&lt;br /&gt;
* [[PHY]]&lt;br /&gt;
* [[PLA]]&lt;br /&gt;
* [[PLX]]&lt;br /&gt;
* [[PLY]]&lt;br /&gt;
* [[ROL]]&lt;br /&gt;
* [[ROR]]&lt;br /&gt;
* [[RTI]]&lt;br /&gt;
* [[SBC]]&lt;br /&gt;
* [[STA]]&lt;br /&gt;
* [[STX]]&lt;br /&gt;
* [[STY]]&lt;br /&gt;
* [[STZ]]&lt;br /&gt;
* [[TRB]]&lt;br /&gt;
* [[TSB]]&lt;br /&gt;
* and most [[SPC700]] branching commands&lt;br /&gt;
&lt;br /&gt;
==== List of instructions without cycle penalties: ====&lt;br /&gt;
&lt;br /&gt;
* [[BRL]]&lt;br /&gt;
* [[CLC]]&lt;br /&gt;
* [[CLD]]&lt;br /&gt;
* [[CLI]]&lt;br /&gt;
* [[CLV]]&lt;br /&gt;
* [[DEX]]&lt;br /&gt;
* [[DEY]]&lt;br /&gt;
* [[INX]]&lt;br /&gt;
* [[INY]]&lt;br /&gt;
* [[JMP]] / JML&lt;br /&gt;
* [[JSL]]&lt;br /&gt;
* [[JSR]]&lt;br /&gt;
* [[MVN]]&lt;br /&gt;
* [[MVP]]&lt;br /&gt;
* [[NOP]]&lt;br /&gt;
* [[PEA]]&lt;br /&gt;
* [[PER]]&lt;br /&gt;
* [[PHB]]&lt;br /&gt;
* [[PHD]]&lt;br /&gt;
* [[PHK]]&lt;br /&gt;
* [[PHP]]&lt;br /&gt;
* [[PLB]]&lt;br /&gt;
* [[PLD]]&lt;br /&gt;
* [[PLP]]&lt;br /&gt;
* [[REP]]&lt;br /&gt;
* [[RTL]]&lt;br /&gt;
* [[RTS]]&lt;br /&gt;
* [[SEC]]&lt;br /&gt;
* [[SED]]&lt;br /&gt;
* [[SEI]]&lt;br /&gt;
* [[SEP]]&lt;br /&gt;
* [[STP]]&lt;br /&gt;
* [[TAX]]&lt;br /&gt;
* [[TAY]]&lt;br /&gt;
* [[TCD]]&lt;br /&gt;
* [[TCS]]&lt;br /&gt;
* [[TDC]]&lt;br /&gt;
* [[TSC]]&lt;br /&gt;
* [[TSX]]&lt;br /&gt;
* [[TXA]]&lt;br /&gt;
* [[TXS]]&lt;br /&gt;
* [[TXY]]&lt;br /&gt;
* [[TYA]]&lt;br /&gt;
* [[TYX]]&lt;br /&gt;
* [[WAI]]&lt;br /&gt;
* [[WDM]]&lt;br /&gt;
* [[XBA]]&lt;br /&gt;
* [[XCE]]&lt;br /&gt;
* All non-branching [[SPC700]] instructions&lt;br /&gt;
* [[BRA (SPC700)]]&lt;br /&gt;
* [[JMP (SPC700)]]&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* section 2.2 of 65c816 datasheet: https://www.westerndesigncenter.com/wdc/documentation/w65c816s.pdf&lt;br /&gt;
&lt;br /&gt;
[[Category:SNES Hardware]]&lt;br /&gt;
[[Category:Inherited from 6502]]&lt;br /&gt;
[[Category:Timing]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=BRA&amp;diff=21182</id>
		<title>BRA</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=BRA&amp;diff=21182"/>
		<updated>2026-05-13T21:08:52Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* See Also */ spc700&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:40%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Basic Info&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Addressing Mode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Opcode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Length&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Speed&#039;&#039;&#039;&lt;br /&gt;
|+&lt;br /&gt;
|[[Program Counter Relative]]&lt;br /&gt;
|80&lt;br /&gt;
|2 bytes&lt;br /&gt;
|3 cycles*&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:30%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;9&amp;quot;|Flags Affected&lt;br /&gt;
|+&lt;br /&gt;
|[[Negative Flag|N]]&lt;br /&gt;
|[[Overflow Flag|V]]&lt;br /&gt;
|[[M Flag|M]]&lt;br /&gt;
|[[X Flag|X]]&lt;br /&gt;
|[[Decimal Flag|D]]&lt;br /&gt;
|[[I Flag|I]]&lt;br /&gt;
|[[Zero Flag|Z]]&lt;br /&gt;
|[[Carry Flag|C]]&lt;br /&gt;
|+&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BRA&#039;&#039;&#039; (BRanch Always) is a [[65c816]] instruction that performs an unconditional jump.  The signed displacement ranges from -128 to 127.  The displacement is sign-extended to 16 bits and added to the [[program counter]].  The displacement is measured from the instruction following BRA.&lt;br /&gt;
&lt;br /&gt;
BRA is relocatable.  No flags are affected.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRA nearlabel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BRA has the same timing as other branches, it just has no &amp;quot;branch not taken&amp;quot; case.&lt;br /&gt;
&lt;br /&gt;
===== Cycle Penalty =====&lt;br /&gt;
* BRA takes one additional cycle if the branch crosses a page boundary in [[emulation mode]].&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[JMP]]&lt;br /&gt;
* [[BRA (Super FX)]]&lt;br /&gt;
* [[BRA (SPC700)]]&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/435 page 435] on BRA&lt;br /&gt;
* [[Labiak]], [https://archive.org/details/Programming_the_65816/page/n135 page 125] on BRA&lt;br /&gt;
* snes9x implementation of BRA: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L1390&lt;br /&gt;
* Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#6.2.1.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:65c02 additions]]&lt;br /&gt;
[[Category:Unconditional Branches]]&lt;br /&gt;
[[Category:Two-byte Instructions]]&lt;br /&gt;
[[Category:Relocatable Instructions]]&lt;br /&gt;
[[Category:Single Admode Mnemonics]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Timing_Control_Unit&amp;diff=21181</id>
		<title>Timing Control Unit</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Timing_Control_Unit&amp;diff=21181"/>
		<updated>2026-05-13T16:34:46Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* List of instructions without cycle penalties: */ spc700&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Timing Control Unit&#039;&#039;&#039; (TCU) is part of the [[65c816]].  It contains a counter that is reset at each instruction fetch and advances during each [[machine cycle]].  Together with the [[instruction register]], it helps the processor perform register transfers.&lt;br /&gt;
&lt;br /&gt;
==== List of instructions with cycle penalties: ====&lt;br /&gt;
&lt;br /&gt;
* [[ADC]]&lt;br /&gt;
* [[AND]]&lt;br /&gt;
* [[ASL]]&lt;br /&gt;
* [[BCC]]&lt;br /&gt;
* [[BCS]]&lt;br /&gt;
* [[BEQ]]&lt;br /&gt;
* [[BIT]]&lt;br /&gt;
* [[BMI]]&lt;br /&gt;
* [[BNE]]&lt;br /&gt;
* [[BPL]]&lt;br /&gt;
* [[BRA]]&lt;br /&gt;
* [[BRK]]&lt;br /&gt;
* [[BVC]]&lt;br /&gt;
* [[BVS]]&lt;br /&gt;
* [[CMP]]&lt;br /&gt;
* [[COP]]&lt;br /&gt;
* [[CPX]]&lt;br /&gt;
* [[CPY]]&lt;br /&gt;
* [[DEC]]&lt;br /&gt;
* [[EOR]]&lt;br /&gt;
* [[INC]]&lt;br /&gt;
* [[LDA]]&lt;br /&gt;
* [[LDX]]&lt;br /&gt;
* [[LDY]]&lt;br /&gt;
* [[LSR]]&lt;br /&gt;
* [[ORA]]&lt;br /&gt;
* [[PEI]]&lt;br /&gt;
* [[PHA]]&lt;br /&gt;
* [[PHX]]&lt;br /&gt;
* [[PHY]]&lt;br /&gt;
* [[PLA]]&lt;br /&gt;
* [[PLX]]&lt;br /&gt;
* [[PLY]]&lt;br /&gt;
* [[ROL]]&lt;br /&gt;
* [[ROR]]&lt;br /&gt;
* [[RTI]]&lt;br /&gt;
* [[SBC]]&lt;br /&gt;
* [[STA]]&lt;br /&gt;
* [[STX]]&lt;br /&gt;
* [[STY]]&lt;br /&gt;
* [[STZ]]&lt;br /&gt;
* [[TRB]]&lt;br /&gt;
* [[TSB]]&lt;br /&gt;
* and most [[SPC700]] branching commands&lt;br /&gt;
&lt;br /&gt;
==== List of instructions without cycle penalties: ====&lt;br /&gt;
&lt;br /&gt;
* [[BRL]]&lt;br /&gt;
* [[CLC]]&lt;br /&gt;
* [[CLD]]&lt;br /&gt;
* [[CLI]]&lt;br /&gt;
* [[CLV]]&lt;br /&gt;
* [[DEX]]&lt;br /&gt;
* [[DEY]]&lt;br /&gt;
* [[INX]]&lt;br /&gt;
* [[INY]]&lt;br /&gt;
* [[JMP]] / JML&lt;br /&gt;
* [[JSL]]&lt;br /&gt;
* [[JSR]]&lt;br /&gt;
* [[MVN]]&lt;br /&gt;
* [[MVP]]&lt;br /&gt;
* [[NOP]]&lt;br /&gt;
* [[PEA]]&lt;br /&gt;
* [[PER]]&lt;br /&gt;
* [[PHB]]&lt;br /&gt;
* [[PHD]]&lt;br /&gt;
* [[PHK]]&lt;br /&gt;
* [[PHP]]&lt;br /&gt;
* [[PLB]]&lt;br /&gt;
* [[PLD]]&lt;br /&gt;
* [[PLP]]&lt;br /&gt;
* [[REP]]&lt;br /&gt;
* [[RTL]]&lt;br /&gt;
* [[RTS]]&lt;br /&gt;
* [[SEC]]&lt;br /&gt;
* [[SED]]&lt;br /&gt;
* [[SEI]]&lt;br /&gt;
* [[SEP]]&lt;br /&gt;
* [[STP]]&lt;br /&gt;
* [[TAX]]&lt;br /&gt;
* [[TAY]]&lt;br /&gt;
* [[TCD]]&lt;br /&gt;
* [[TCS]]&lt;br /&gt;
* [[TDC]]&lt;br /&gt;
* [[TSC]]&lt;br /&gt;
* [[TSX]]&lt;br /&gt;
* [[TXA]]&lt;br /&gt;
* [[TXS]]&lt;br /&gt;
* [[TXY]]&lt;br /&gt;
* [[TYA]]&lt;br /&gt;
* [[TYX]]&lt;br /&gt;
* [[WAI]]&lt;br /&gt;
* [[WDM]]&lt;br /&gt;
* [[XBA]]&lt;br /&gt;
* [[XCE]]&lt;br /&gt;
* All non-branching [[SPC700]] instructions&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* section 2.2 of 65c816 datasheet: https://www.westerndesigncenter.com/wdc/documentation/w65c816s.pdf&lt;br /&gt;
&lt;br /&gt;
[[Category:SNES Hardware]]&lt;br /&gt;
[[Category:Inherited from 6502]]&lt;br /&gt;
[[Category:Timing]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Timing_Control_Unit&amp;diff=21180</id>
		<title>Timing Control Unit</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Timing_Control_Unit&amp;diff=21180"/>
		<updated>2026-05-13T08:01:34Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* List of instructions with cycle penalties: */ spc700&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Timing Control Unit&#039;&#039;&#039; (TCU) is part of the [[65c816]].  It contains a counter that is reset at each instruction fetch and advances during each [[machine cycle]].  Together with the [[instruction register]], it helps the processor perform register transfers.&lt;br /&gt;
&lt;br /&gt;
==== List of instructions with cycle penalties: ====&lt;br /&gt;
&lt;br /&gt;
* [[ADC]]&lt;br /&gt;
* [[AND]]&lt;br /&gt;
* [[ASL]]&lt;br /&gt;
* [[BCC]]&lt;br /&gt;
* [[BCS]]&lt;br /&gt;
* [[BEQ]]&lt;br /&gt;
* [[BIT]]&lt;br /&gt;
* [[BMI]]&lt;br /&gt;
* [[BNE]]&lt;br /&gt;
* [[BPL]]&lt;br /&gt;
* [[BRA]]&lt;br /&gt;
* [[BRK]]&lt;br /&gt;
* [[BVC]]&lt;br /&gt;
* [[BVS]]&lt;br /&gt;
* [[CMP]]&lt;br /&gt;
* [[COP]]&lt;br /&gt;
* [[CPX]]&lt;br /&gt;
* [[CPY]]&lt;br /&gt;
* [[DEC]]&lt;br /&gt;
* [[EOR]]&lt;br /&gt;
* [[INC]]&lt;br /&gt;
* [[LDA]]&lt;br /&gt;
* [[LDX]]&lt;br /&gt;
* [[LDY]]&lt;br /&gt;
* [[LSR]]&lt;br /&gt;
* [[ORA]]&lt;br /&gt;
* [[PEI]]&lt;br /&gt;
* [[PHA]]&lt;br /&gt;
* [[PHX]]&lt;br /&gt;
* [[PHY]]&lt;br /&gt;
* [[PLA]]&lt;br /&gt;
* [[PLX]]&lt;br /&gt;
* [[PLY]]&lt;br /&gt;
* [[ROL]]&lt;br /&gt;
* [[ROR]]&lt;br /&gt;
* [[RTI]]&lt;br /&gt;
* [[SBC]]&lt;br /&gt;
* [[STA]]&lt;br /&gt;
* [[STX]]&lt;br /&gt;
* [[STY]]&lt;br /&gt;
* [[STZ]]&lt;br /&gt;
* [[TRB]]&lt;br /&gt;
* [[TSB]]&lt;br /&gt;
* and most [[SPC700]] branching commands&lt;br /&gt;
&lt;br /&gt;
==== List of instructions without cycle penalties: ====&lt;br /&gt;
&lt;br /&gt;
* [[BRL]]&lt;br /&gt;
* [[CLC]]&lt;br /&gt;
* [[CLD]]&lt;br /&gt;
* [[CLI]]&lt;br /&gt;
* [[CLV]]&lt;br /&gt;
* [[DEX]]&lt;br /&gt;
* [[DEY]]&lt;br /&gt;
* [[INX]]&lt;br /&gt;
* [[INY]]&lt;br /&gt;
* [[JMP]] / JML&lt;br /&gt;
* [[JSL]]&lt;br /&gt;
* [[JSR]]&lt;br /&gt;
* [[MVN]]&lt;br /&gt;
* [[MVP]]&lt;br /&gt;
* [[NOP]]&lt;br /&gt;
* [[PEA]]&lt;br /&gt;
* [[PER]]&lt;br /&gt;
* [[PHB]]&lt;br /&gt;
* [[PHD]]&lt;br /&gt;
* [[PHK]]&lt;br /&gt;
* [[PHP]]&lt;br /&gt;
* [[PLB]]&lt;br /&gt;
* [[PLD]]&lt;br /&gt;
* [[PLP]]&lt;br /&gt;
* [[REP]]&lt;br /&gt;
* [[RTL]]&lt;br /&gt;
* [[RTS]]&lt;br /&gt;
* [[SEC]]&lt;br /&gt;
* [[SED]]&lt;br /&gt;
* [[SEI]]&lt;br /&gt;
* [[SEP]]&lt;br /&gt;
* [[STP]]&lt;br /&gt;
* [[TAX]]&lt;br /&gt;
* [[TAY]]&lt;br /&gt;
* [[TCD]]&lt;br /&gt;
* [[TCS]]&lt;br /&gt;
* [[TDC]]&lt;br /&gt;
* [[TSC]]&lt;br /&gt;
* [[TSX]]&lt;br /&gt;
* [[TXA]]&lt;br /&gt;
* [[TXS]]&lt;br /&gt;
* [[TXY]]&lt;br /&gt;
* [[TYA]]&lt;br /&gt;
* [[TYX]]&lt;br /&gt;
* [[WAI]]&lt;br /&gt;
* [[WDM]]&lt;br /&gt;
* [[XBA]]&lt;br /&gt;
* [[XCE]]&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* section 2.2 of 65c816 datasheet: https://www.westerndesigncenter.com/wdc/documentation/w65c816s.pdf&lt;br /&gt;
&lt;br /&gt;
[[Category:SNES Hardware]]&lt;br /&gt;
[[Category:Inherited from 6502]]&lt;br /&gt;
[[Category:Timing]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Two-Phase_Access&amp;diff=21179</id>
		<title>Two-Phase Access</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Two-Phase_Access&amp;diff=21179"/>
		<updated>2026-05-13T07:57:48Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: SA-1 category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Two-Phase Access&#039;&#039;&#039; is when both the [[SA-1]] and [[5A22]] access the ROM.&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* Figure 2.2.1.3 on [https://archive.org/details/SNESDevManual/book2/page/n14 page 1-2-3 of Book II] of the official Super Nintendo development manual&lt;br /&gt;
&lt;br /&gt;
[[Category:Official Jargon]]&lt;br /&gt;
[[Category:SA-1]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Two-Phase_Access&amp;diff=21178</id>
		<title>Two-Phase Access</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Two-Phase_Access&amp;diff=21178"/>
		<updated>2026-05-13T07:56:44Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: better description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Two-Phase Access&#039;&#039;&#039; is when both the [[SA-1]] and [[5A22]] access the ROM.&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
* Figure 2.2.1.3 on [https://archive.org/details/SNESDevManual/book2/page/n14 page 1-2-3 of Book II] of the official Super Nintendo development manual&lt;br /&gt;
&lt;br /&gt;
[[Category:Official Jargon]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Direct_Page_Register&amp;diff=21177</id>
		<title>Direct Page Register</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Direct_Page_Register&amp;diff=21177"/>
		<updated>2026-05-13T05:32:30Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: or simply Direct Register&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Direct Page Register&#039;&#039;&#039; (or simply the &#039;&#039;&#039;Direct Register&#039;&#039;&#039;) exists on the [[65c816]] and is 16 bits wide.&amp;lt;sup&amp;gt;[1]&amp;lt;/sup&amp;gt;  It holds current the location of the [[direct page]].  The low byte is called DL and the high byte DH.&lt;br /&gt;
&lt;br /&gt;
The direct page register is cleared to point to the [[zero page]] on reset.&amp;lt;sup&amp;gt;[2]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:dp.png]]&lt;br /&gt;
&lt;br /&gt;
Its value can be pushed to the [[stack]] with [[PHD]] and pulled off the stack with [[PLD]].&lt;br /&gt;
&lt;br /&gt;
Its value can be transferred to and from the full 16 bit [[accumulator]] with [[TCD]] and [[TDC]].&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
# page 5 of the official 65c816 datasheet: https://www.westerndesigncenter.com/wdc/documentation/w65c816s.pdf&lt;br /&gt;
# section 2.6 on page 7, lbid.&lt;br /&gt;
# [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/53 page 53]&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Registers]]&lt;br /&gt;
[[Category:65c816 additions]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=List_of_Anomie%27s_Docs&amp;diff=21176</id>
		<title>List of Anomie&#039;s Docs</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=List_of_Anomie%27s_Docs&amp;diff=21176"/>
		<updated>2026-05-13T04:10:14Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* Errata */ added at any point in the opcode&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are nine documents by anomie available on [[RHDN]]:&lt;br /&gt;
&lt;br /&gt;
* [https://www.romhacking.net/documents/193 SNES Memory Mapping]&lt;br /&gt;
* [https://www.romhacking.net/documents/196 Register]&lt;br /&gt;
* [https://www.romhacking.net/documents/199 SNES Timing]&lt;br /&gt;
* [https://www.romhacking.net/documents/197 SPC700 with boot rom disassembly]&lt;br /&gt;
* [https://www.romhacking.net/documents/198 SPC700 Cycles]&lt;br /&gt;
* [https://www.romhacking.net/documents/191 S-DSP]&lt;br /&gt;
* [https://www.romhacking.net/documents/194 SNES OpenBus and Wrapping]&lt;br /&gt;
* [https://www.romhacking.net/documents/195 SNES Port]&lt;br /&gt;
* [https://www.romhacking.net/documents/192 C4 chip]&lt;br /&gt;
&lt;br /&gt;
=== Errata ===&lt;br /&gt;
* In &#039;&#039;&#039;regs.txt&#039;&#039;&#039; under &amp;quot;BG Modes&amp;quot; we have &amp;quot;The SNES has 7 [[background modes]],&amp;quot; it should say 8.&lt;br /&gt;
* In the S-DSP doc, we have &amp;quot;Certain games do seem to depend on these exact formulas, trying to &#039;&#039;&#039;simplify&#039;&#039;&#039; will break some sound effects.&amp;quot;  But &amp;quot;approximate&amp;quot; would probably be clearer than &amp;quot;simplify,&amp;quot; as in mathematics simplifying a formula only reduces the number of symbols used to express it, which may be easier to read but otherwise leaves it equivalent.&lt;br /&gt;
* In &#039;&#039;&#039;ob-wrap.txt&#039;&#039;&#039;, the first result is that [[Program Counter]] Increment &amp;quot;Always wraps within the [[bank]], at any point in the opcode.&amp;quot;  But as opcodes are merely the first byte of an instruction, this result would probably be clearer if the last word were &amp;quot;instruction.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[List of Y0shi&#039;s Docs]]&lt;br /&gt;
&lt;br /&gt;
[[Category:SNES Hardware]]&lt;br /&gt;
[[Category:Documents]]&lt;br /&gt;
[[Category:Lists]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=S-SMP&amp;diff=21175</id>
		<title>S-SMP</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=S-SMP&amp;diff=21175"/>
		<updated>2026-05-12T23:29:51Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: linkify zp&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;S-SMP&#039;&#039;&#039; is a Sony SPC700 series 8-bit 65x-based MPU which serves as the SNES&#039; sound chip.  It talks to the [[Ricoh 5A22]] over four ports via the [[SNES Bus]] and [[CPU Data Bus]].  It is clocked by [[CPUK]].  The minimum command execution time is 1.953 microseconds.&amp;lt;sup&amp;gt;[2]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following registers are 8-bit:&lt;br /&gt;
* [[Accumulator]]&lt;br /&gt;
* [[X Index Register]]&lt;br /&gt;
* [[Y Index Register]]&lt;br /&gt;
* [[Program Status Word]]&lt;br /&gt;
* [[Stack Pointer]]&lt;br /&gt;
&lt;br /&gt;
The following registers are 16-bit:&lt;br /&gt;
* [[Program Counter]]&lt;br /&gt;
* [[YA]] (which is virtually just the Y index reg concatenated to A)&lt;br /&gt;
&lt;br /&gt;
Instructions that try to access memory straddling past the end of [[ARAM]] (the last byte of which is at $FFFF) will wrap around and end up accessing the [[zeropage]] (which is at $0000).  Accesses that use [[direct page addressing]] will wrap within the [[direct page]].&lt;br /&gt;
&lt;br /&gt;
The stack is always located in page one (at $0100).  Memory accesses that straddle the end of the stack will wrap to the beginning of the stack.&lt;br /&gt;
&lt;br /&gt;
Operands that use [[absolute addressing]] are prefixed with an exclamation point (!).&lt;br /&gt;
&lt;br /&gt;
The S-SMP has no hardware interrupt sources, but it does have [[BRK (SPC700)|BRK]].&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[SPC700 Opcode Matrix]]&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
# [https://www.romhacking.net/documents/197 anomie&#039;s SPC700 doc]&lt;br /&gt;
# SNES Sound Source Outline on [https://archive.org/details/SNESDevManual/book1/page/n152 page 3-1-1 of Book I] of the official Super Nintendo development manual&lt;br /&gt;
# subparagraph 22.5.1 on [https://archive.org/details/SNESDevManual/book1/page/n97 page 2-22-1 of Book I], lbid.&lt;br /&gt;
&lt;br /&gt;
[[Category:SNES Hardware]]&lt;br /&gt;
[[Category:ICs with unconnected pins]]&lt;br /&gt;
[[Category:Integrated Circuits]]&lt;br /&gt;
[[Category:Audio]]&lt;br /&gt;
[[Category:SPC700]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Direct_Page_Register&amp;diff=21174</id>
		<title>Direct Page Register</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Direct_Page_Register&amp;diff=21174"/>
		<updated>2026-05-12T02:12:27Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: It -&amp;gt; its value&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Direct Page Register&#039;&#039;&#039; exists on the [[65c816]] and is 16 bits wide.&amp;lt;sup&amp;gt;[1]&amp;lt;/sup&amp;gt;  It holds current the location of the [[direct page]].  The low byte is called DL and the high byte DH.&lt;br /&gt;
&lt;br /&gt;
The direct page register is cleared to point to the [[zero page]] on reset.&amp;lt;sup&amp;gt;[2]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:dp.png]]&lt;br /&gt;
&lt;br /&gt;
Its value can be pushed to the [[stack]] with [[PHD]] and pulled off the stack with [[PLD]].&lt;br /&gt;
&lt;br /&gt;
Its value can be transferred to and from the full 16 bit [[accumulator]] with [[TCD]] and [[TDC]].&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
# page 5 of the official 65c816 datasheet: https://www.westerndesigncenter.com/wdc/documentation/w65c816s.pdf&lt;br /&gt;
# section 2.6 on page 7, lbid.&lt;br /&gt;
# [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/53 page 53]&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Registers]]&lt;br /&gt;
[[Category:65c816 additions]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=Direct_Page_Register&amp;diff=21173</id>
		<title>Direct Page Register</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=Direct_Page_Register&amp;diff=21173"/>
		<updated>2026-05-11T23:09:08Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: DL and DH&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Direct Page Register&#039;&#039;&#039; exists on the [[65c816]] and is 16 bits wide.&amp;lt;sup&amp;gt;[1]&amp;lt;/sup&amp;gt;  It holds current the location of the [[direct page]].  The low byte is called DL and the high byte DH.&lt;br /&gt;
&lt;br /&gt;
The direct page register is cleared to point to the [[zero page]] on reset.&amp;lt;sup&amp;gt;[2]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:dp.png]]&lt;br /&gt;
&lt;br /&gt;
Its value can be pushed to the [[stack]] with [[PHD]] and pulled off the stack with [[PLD]].&lt;br /&gt;
&lt;br /&gt;
It can be transferred to and from the full 16 bit [[accumulator]] with [[TCD]] and [[TDC]].&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
# page 5 of the official 65c816 datasheet: https://www.westerndesigncenter.com/wdc/documentation/w65c816s.pdf&lt;br /&gt;
# section 2.6 on page 7, lbid.&lt;br /&gt;
# [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/53 page 53]&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Registers]]&lt;br /&gt;
[[Category:65c816 additions]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=DL&amp;diff=21172</id>
		<title>DL</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=DL&amp;diff=21172"/>
		<updated>2026-05-11T23:07:30Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: consolidate redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#redirect [[Direct Page Register]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=DH&amp;diff=21171</id>
		<title>DH</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=DH&amp;diff=21171"/>
		<updated>2026-05-11T23:06:59Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: consolidate redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#redirect [[Direct Page Register]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
	<entry>
		<id>https://sneslab.net/mw/index.php?title=SBC&amp;diff=21170</id>
		<title>SBC</title>
		<link rel="alternate" type="text/html" href="https://sneslab.net/mw/index.php?title=SBC&amp;diff=21170"/>
		<updated>2026-05-11T15:13:42Z</updated>

		<summary type="html">&lt;p&gt;Xetheria: /* Cycle Penalties */ opcodes for dp admodes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:50%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|Basic Info&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Addressing Mode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Opcode&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Length&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Speed&#039;&#039;&#039;&lt;br /&gt;
|+&lt;br /&gt;
|[[Immediate]]&lt;br /&gt;
|E9&lt;br /&gt;
|2/3 bytes&lt;br /&gt;
|2 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute]]&lt;br /&gt;
|ED&lt;br /&gt;
|3 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute Long Addressing|Absolute Long]]&lt;br /&gt;
|EF&lt;br /&gt;
|4 bytes&lt;br /&gt;
|5 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page|Direct Page]]&lt;br /&gt;
|E5&lt;br /&gt;
|2 bytes&lt;br /&gt;
|3 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indirect Addressing|Direct Page Indirect]]&lt;br /&gt;
|F2&lt;br /&gt;
|2 bytes&lt;br /&gt;
|5 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indirect Long]]&lt;br /&gt;
|E7&lt;br /&gt;
|2 bytes&lt;br /&gt;
|6 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute Indexed by X]]&lt;br /&gt;
|FD&lt;br /&gt;
|3 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute Long Indexed by X]]&lt;br /&gt;
|FF&lt;br /&gt;
|4 bytes&lt;br /&gt;
|5 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Absolute Indexed by Y]]&lt;br /&gt;
|F9&lt;br /&gt;
|3 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indexed by X]]&lt;br /&gt;
|F5&lt;br /&gt;
|2 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indexed Indirect by X]]&lt;br /&gt;
|E1&lt;br /&gt;
|2 bytes&lt;br /&gt;
|6 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indirect Indexed by Y]]&lt;br /&gt;
|F1&lt;br /&gt;
|2 bytes&lt;br /&gt;
|5 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Direct Page Indirect Long Indexed by Y]]&lt;br /&gt;
|F7&lt;br /&gt;
|2 bytes&lt;br /&gt;
|6 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Stack Relative]]&lt;br /&gt;
|E3&lt;br /&gt;
|2 bytes&lt;br /&gt;
|4 cycles*&lt;br /&gt;
|+&lt;br /&gt;
|[[Stack Relative Indirect Indexed by Y]]&lt;br /&gt;
|F3&lt;br /&gt;
|2 bytes&lt;br /&gt;
|7 cycles*&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right;clear:right;width:30%&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;9&amp;quot;|Flags Affected&lt;br /&gt;
|+&lt;br /&gt;
|[[N Flag|N]]&lt;br /&gt;
|[[V Flag|V]]&lt;br /&gt;
|[[M Flag|M]]&lt;br /&gt;
|[[X Flag|X]]&lt;br /&gt;
|[[D Flag|D]]&lt;br /&gt;
|[[I Flag|I]]&lt;br /&gt;
|[[Z Flag|Z]]&lt;br /&gt;
|[[C Flag|C]]&lt;br /&gt;
|+&lt;br /&gt;
|N&lt;br /&gt;
|V&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|.&lt;br /&gt;
|Z&lt;br /&gt;
|C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SBC&#039;&#039;&#039; (Subtract with Carry/Borrow) is the main 65x subtraction instruction.  The [[accumulator]] serves as both the minuend and where the difference is stored.  The operand serves as the subtrahend.  For example, SBC #6 does &amp;quot;a minus 6&amp;quot; but there is this caveat about the carry flag:&lt;br /&gt;
&lt;br /&gt;
If the [[carry flag]] (aka borrow flag) is clear, one more is subtracted.  As there is no subtract-without-carry instruction, [[SEC]] should be run beforehand or the carry flag should otherwise be ensured to be set, otherwise the difference may be one greater than expected.&lt;br /&gt;
&lt;br /&gt;
The size of the accumulator determines whether this is an 8 or 16 bit operation. If 16-bit and not using [[immediate addressing]], the low-order byte is located at the effective address and the high-order byte at the effective address plus one. &lt;br /&gt;
&lt;br /&gt;
If the difference is negative, the carry flag will be cleared, otherwise it will be set.  If the [[decimal flag]] is set, then [[binary coded decimal]] subtraction is performed, otherwise binary subtraction.&lt;br /&gt;
&lt;br /&gt;
==== Syntax ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SBC #const&lt;br /&gt;
SBC addr&lt;br /&gt;
SBC long&lt;br /&gt;
SBC dp&lt;br /&gt;
SBC (dp)&lt;br /&gt;
SBC [dp]&lt;br /&gt;
SBC addr, X&lt;br /&gt;
SBC long, X&lt;br /&gt;
SBC addr, Y&lt;br /&gt;
SBC dp, X&lt;br /&gt;
SBC (dp, X)&lt;br /&gt;
SBC (dp), Y&lt;br /&gt;
SBC [dp], Y&lt;br /&gt;
SBC sr, S&lt;br /&gt;
SBC (sr, S), Y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you only need to subtract one, consider [[DEC]] instead.&lt;br /&gt;
&lt;br /&gt;
==== Cycle Penalties ====&lt;br /&gt;
SBC takes an extra cycle for each of the following:&lt;br /&gt;
* if the accumulator is 16 bits wide, in all addressing modes&lt;br /&gt;
* when utilizing the [[direct register]] (opcodes E5, F2, E7, F5, E1, F1, and F7), if the low byte of the direct register is nonzero&lt;br /&gt;
* In both [[Absolute Indexed]] and [[Direct Page Indirect Indexed by Y]] addressing modes if adding an index crosses a [[page]] boundary&lt;br /&gt;
&lt;br /&gt;
Unlike the 65c02, the 65c816 does not have a cycle penalty when subtracting in decimal mode.&lt;br /&gt;
&lt;br /&gt;
In [[Eyes &amp;amp; Lichty]] on page 498, opcode F5 has a &amp;quot;0&amp;quot; superscript typo on the # of cycles column.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[ADC]]&lt;br /&gt;
* [[SBC (SPC700)]]&lt;br /&gt;
* [[SUB (Super FX)]]&lt;br /&gt;
* [[DEX]]&lt;br /&gt;
* [[DEY]]&lt;br /&gt;
&lt;br /&gt;
=== External Links ===&lt;br /&gt;
* [[Eyes &amp;amp; Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/497 page 497] on SBC&lt;br /&gt;
* [[Labiak]], [https://archive.org/details/Programming_the_65816/page/n189 page 179] on SBC&lt;br /&gt;
* 2.2.2 on [[MCS6500 Manual]], [https://archive.org/details/mos_microcomputers_programming_manual/page/n29 page 14] on SBC&lt;br /&gt;
* [[Carr]], [https://archive.org/details/6502UsersManual/page/n284 page 271] on SBC&lt;br /&gt;
* [[Leventhal]], [https://archive.org/details/6502-assembly-language-programming/page/n140 page 3-91] on SBC&lt;br /&gt;
* snes9x implementation of SBC: https://github.com/snes9xgit/snes9x/blob/master/cpuops.cpp#L1133&lt;br /&gt;
* undisbeliever on SBC: https://undisbeliever.net/snesdev/65816-opcodes.html#sbc-subtract-with-borrow-from-accumulator&lt;br /&gt;
* Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#SBC&lt;br /&gt;
* Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#6.1.1.1&lt;br /&gt;
&lt;br /&gt;
[[Category:ASM]]&lt;br /&gt;
[[Category:Group One Instructions]]&lt;br /&gt;
[[Category:Inherited from 6502]]&lt;/div&gt;</summary>
		<author><name>Xetheria</name></author>
	</entry>
</feed>