We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS
JSL: Difference between revisions
From SnesLab
(began writing the execution sequence) |
(flow JSR into body) |
||
(13 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
|[[Absolute Long Addressing|Absolute Long]] | |[[Absolute Long Addressing|Absolute Long]] | ||
|22 | |22 | ||
|4 | |4 bytes | ||
|8 cycles | |8 cycles | ||
|} | |} | ||
Line 36: | Line 36: | ||
'''JSL''' (Jump to Subroutine Long) is a [[65c816]] instruction that transfers control to a subroutine, possibly one in a different [[bank]]. | '''JSL''' (Jump to Subroutine Long) is a [[65c816]] instruction that transfers control to a subroutine, possibly one in a different [[bank]]. | ||
No flags are affected. | |||
==== Syntax ==== | |||
<pre> | |||
JSL long | |||
</pre> | |||
JSL works even in [[emulation mode]], but it is intended primarily for native mode. | |||
==== Execution Sequence ==== | ==== Execution Sequence ==== | ||
* the current program counter bank is pushed onto the stack | * the current [[program counter bank register]] pushed onto the [[stack]] | ||
* the [[return address]] (JSL's opcode location plus 3) is pushed onto the stack | |||
* control is transferred to the target location | |||
[[JSR]] is a smaller/faster alternative if you know the subroutine is in the same bank as the call. | |||
=== See Also === | === See Also === | ||
* [[RTS]] | * [[RTS]] | ||
* [[RTL]] | |||
=== External Links === | === External Links === | ||
* [[Eyes & Lichty]] | * [[Eyes & Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/460 page 460] on JSL | ||
* [[Labiak]] | * [[Labiak]], [https://archive.org/details/Programming_the_65816/page/n157 page 147] on JSL | ||
* Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#6.2.2.1 | |||
[[Category:ASM]] | [[Category:ASM]] |
Latest revision as of 02:14, 11 August 2024
Basic Info | |||||||
---|---|---|---|---|---|---|---|
Addressing Mode | Opcode | Length | Speed | ||||
Absolute Long | 22 | 4 bytes | 8 cycles |
Flags Affected | ||||||||
---|---|---|---|---|---|---|---|---|
N | V | M | X | D | I | Z | C | |
. | . | . | . | . | . | . | . |
JSL (Jump to Subroutine Long) is a 65c816 instruction that transfers control to a subroutine, possibly one in a different bank.
No flags are affected.
Syntax
JSL long
JSL works even in emulation mode, but it is intended primarily for native mode.
Execution Sequence
- the current program counter bank register pushed onto the stack
- the return address (JSL's opcode location plus 3) is pushed onto the stack
- control is transferred to the target location
JSR is a smaller/faster alternative if you know the subroutine is in the same bank as the call.
See Also
External Links
- Eyes & Lichty, page 460 on JSL
- Labiak, page 147 on JSL
- Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#6.2.2.1