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

CALL (SPC700): Difference between revisions

From SnesLab
Jump to: navigation, search
m (Jeffythedragonslayer moved page CALL to CALL (SPC700): SPC700 in title)
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''CALL''' is an [[SPC700]] instruction that performs a subroutine call.
{| class="wikitable" style="float:right;clear:right;width:40%"
 
{| class="wikitable" style="float:right;clear:right;width:30%"
!colspan="8"|Basic Info
!colspan="8"|Basic Info
|+
|+
Line 9: Line 7:
|'''Speed'''
|'''Speed'''
|+
|+
|implied
|[[Absolute Addressing | Absolute]]
|3F
|3F
|3 bytes
|3 bytes
Line 16: Line 14:


{| class="wikitable" style="float:right;clear:right;width:30%"
{| class="wikitable" style="float:right;clear:right;width:30%"
!colspan="8"|Flags Clobbered
!colspan="8"|Flags Affected
|+
|+
|N
|[[Negative Flag|N]]
|V
|[[Overflow Flag|V]]
|P
|[[Direct Page Flag|P]]
|B
|[[Break Flag|B]]
|H
|[[Half-Carry Flag|H]]
|I
|[[Interrupt Enable Flag|I]]
|Z
|[[Zero Flag|Z]]
|C
|[[Carry Flag|C]]
|+
|+
|.
|.
Line 36: Line 34:
|.
|.
|}
|}
'''CALL''' is an [[SPC700]] instruction that calls a subroutine.  The current [[program counter]] is pushed to the stack (high byte first, then low byte).  Then the address following the opcode becomes the new value of the program counter.<sup>[2]</sup>
No flags are affected.
==== Syntax ====
<pre>
CALL !abs
</pre>


=== See Also ===
=== See Also ===
* [[TCALL]]
* [[TCALL]]
* [[PCALL]]
* [[PCALL]]
* [[RET]]
* [[JSR]]
=== External Links ===
# Official Nintendo documentation on CALL: Table C-16 in [https://archive.org/details/SNESDevManual/book1/page/n234 Appendix C-9 of Book I]
# [https://www.romhacking.net/documents/197 anomie's spc700 doc]


[[Category:ASM]]
[[Category:ASM]]
[[Category:SPC700]]
[[Category:SPC700]]
[[Category:Subroutine Call Return Commands]]
[[Category:Three-byte Instructions]]

Latest revision as of 17:36, 8 August 2024

Basic Info
Addressing Mode Opcode Length Speed
Absolute 3F 3 bytes 8 cycles
Flags Affected
N V P B H I Z C
. . . . . . . .

CALL is an SPC700 instruction that calls a subroutine. The current program counter is pushed to the stack (high byte first, then low byte). Then the address following the opcode becomes the new value of the program counter.[2]

No flags are affected.

Syntax

CALL !abs

See Also

External Links

  1. Official Nintendo documentation on CALL: Table C-16 in Appendix C-9 of Book I
  2. anomie's spc700 doc