We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

Program Counter: Difference between revisions

From SnesLab
Jump to: navigation, search
(16-bit on '816 too; rearranged)
(→‎See Also: RTS, RTL)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
The '''Program Counter''' (PC) keeps track of which instruction is currently executing.  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.
The '''Program Counter''' (PC) keeps track of which instruction is currently executing.  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.


If incremented past FFFFh, it wraps around to zero.
If incremented past FFFFh, it wraps around to zero.<sup>[E&L, page 34]</sup>


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.
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.
Line 11: Line 11:
* [[BRA]]
* [[BRA]]
* [[JMP]]
* [[JMP]]
* [[RTS]]
* [[RTL]]


=== References ===
=== References ===

Latest revision as of 20:42, 10 August 2024

The Program Counter (PC) keeps track of which instruction is currently executing. 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.

If incremented past FFFFh, it wraps around to zero.[E&L, page 34]

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.

See Also

References