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

JSR: Difference between revisions

From SnesLab
Jump to: navigation, search
(added Leventhal page)
(→‎External Links: added name to ref)
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''JSR''' (Jump to Subroutine) is a 65x instruction that transfers control to a subroutine.
{| class="wikitable" style="float:right;clear:right;width:40%"
 
{| class="wikitable" style="width:30%"
!colspan="8"|Basic Info
!colspan="8"|Basic Info
|+
|+
Line 9: Line 7:
|'''Speed'''
|'''Speed'''
|+
|+
|absolute
|[[Absolute Addressing | Absolute]]
|20
|20
|3 bytes
|3 bytes
|6 cycles
|6 cycles
|+
|+
|absolute indexed indirect
|[[Absolute Indexed Indirect]]
|FC
|FC
|3 bytes
|3 bytes
|8 cycles
|8 cycles
|+
|+
|absolute long
|[[Absolute Long Addressing | Absolute Long]]
|22
|22
|4 bytes
|4 bytes
Line 26: Line 24:


{| class="wikitable" style="float:right;clear:right;width:30%"
{| class="wikitable" style="float:right;clear:right;width:30%"
!colspan="9"|Flags Clobbered
!colspan="9"|Flags Affected
|+
|+
|N
|[[Negative Flag|N]]
|V
|[[Overflow Flag|V]]
|M
|[[M Flag|M]]
|X
|[[X Flag|X]]
|D
|[[Decimal Flag|D]]
|I
|[[I Flag|I]]
|Z
|[[Zero Flag|Z]]
|C
|[[Carry Flag|C]]
|+
|+
|.
|.
Line 46: Line 44:
|.
|.
|}
|}
'''JSR''' (Jump to Subroutine) is a 65x instruction that transfers control to a subroutine.
No flags are affected.
==== Syntax ====
<pre>
JSR addr
JSR (addr, X)
JSR long
</pre>
==== Execution Sequence ====
* The [[return address]] is pushed onto the stack
* Control is transferred to the target location


=== See Also ===
=== See Also ===
* [[JSL]]
* [[JSL]]
* [[RTS]]
* [[RTL]]


=== External Links ===
=== External Links ===
* [[Eyes & Lichty]] page on JSR: https://archive.org/details/0893037893ProgrammingThe65816/page/n487
* [[Eyes & Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/461 page 461] on JSR
* [[Labiak]] page on JSR: https://archive.org/details/Programming_the_65816/page/n158
* [[Labiak]], [https://archive.org/details/Programming_the_65816/page/n158 page 148] on JSR
* [[MCS6500 Manual]] page on JSR: https://archive.org/details/mos_microcomputers_programming_manual/page/n125
* 8.1 on [[MCS6500 Manual]], [https://archive.org/details/mos_microcomputers_programming_manual/page/n125 page 106] on JSR
* [[Carr]] page on JSR: https://archive.org/details/6502UsersManual/page/n275
* [[Carr]], [https://archive.org/details/6502UsersManual/page/n275 page 262] on JSR
* [[Leventhal]] page on JSR: https://archive.org/details/6502-assembly-language-programming/page/n119
* [[Leventhal]], [https://archive.org/details/6502-assembly-language-programming/page/n119 page 3-70] on JSR
* Pickens, John. http://www.6502.org/tutorials/6502opcodes.html#JSR


[[Category:ASM]]
[[Category:ASM]]
[[Category:Inherited from 6502]]
[[Category:Inherited from 6502]]
[[Category:Unconditional Branches]]

Latest revision as of 00:55, 10 August 2024

Basic Info
Addressing Mode Opcode Length Speed
Absolute 20 3 bytes 6 cycles
Absolute Indexed Indirect FC 3 bytes 8 cycles
Absolute Long 22 4 bytes 8 cycles
Flags Affected
N V M X D I Z C
. . . . . . . .

JSR (Jump to Subroutine) is a 65x instruction that transfers control to a subroutine.

No flags are affected.

Syntax

JSR addr
JSR (addr, X)
JSR long

Execution Sequence

  • The return address is pushed onto the stack
  • Control is transferred to the target location

See Also

External Links