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

TCALL (SPC700): Difference between revisions

From SnesLab
Jump to: navigation, search
(made basic info table shorter)
(address size)
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
{| class="wikitable" style="float:right;clear:right;width:40%"
{| class="wikitable" style="float:right;clear:right;width:50%"
!colspan="8"|Basic Info
!colspan="8"|Basic Info
|+
|+
Line 6: Line 6:
|'''Length'''
|'''Length'''
|'''Speed'''
|'''Speed'''
|'''Vector Address'''
|+
|+
|implied
|[[Implied]] (type 3)
|n1
|01
|1 byte
|1 byte
|8 cycles
|8 cycles
|$FFDE
|+
|[[Implied]] (type 3)
|11
|1 byte
|8 cycles
|$FFDC
|+
|[[Implied]] (type 3)
|21
|1 byte
|8 cycles
|$FFDA
|+
|[[Implied]] (type 3)
|31
|1 byte
|8 cycles
|$FFD8
|+
|[[Implied]] (type 3)
|41
|1 byte
|8 cycles
|$FFD6
|+
|[[Implied]] (type 3)
|51
|1 byte
|8 cycles
|$FFD4
|+
|[[Implied]] (type 3)
|61
|1 byte
|8 cycles
|$FFD2
|+
|[[Implied]] (type 3)
|71
|1 byte
|8 cycles
|$FFD0
|+
|[[Implied]] (type 3)
|81
|1 byte
|8 cycles
|$FFCE
|+
|[[Implied]] (type 3)
|91
|1 byte
|8 cycles
|$FFCC
|+
|[[Implied]] (type 3)
|A1
|1 byte
|8 cycles
|$FFCA
|+
|[[Implied]] (type 3)
|B1
|1 byte
|8 cycles
|$FFC8
|+
|[[Implied]] (type 3)
|C1
|1 byte
|8 cycles
|$FFC6
|+
|[[Implied]] (type 3)
|D1
|1 byte
|8 cycles
|$FFC4
|+
|[[Implied]] (type 3)
|E1
|1 byte
|8 cycles
|$FFC2
|+
|[[Implied]] (type 3)
|F1
|1 byte
|8 cycles
|$FFC0
|}
|}


{| 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 35: Line 127:
|}
|}


'''TCALL''' (Table CALl) is an [[SPC700]] instruction.
'''TCALL''' (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.
 
No flags are affected.
 
=== Syntax ===
 
<pre>
TCALL n
</pre>
 
where n is the '''vector call number''', a decimal integer from 0 to 15, which becomes the high nybble of the opcode.


=== See Also ===
=== See Also ===
* [[CALL]]
* [[CALL]]
* [[PCALL]]
* [[PCALL]]
* [[RET]]
* [[SPC700/IPL ROM]]


=== External Links ===
=== External Links ===
* Official Nintendo documentation on TCALL: [https://archive.org/details/SNESDevManual/book1/page/n234 Appendix C-9]
* Official Nintendo documentation on TCALL: Table C-16 [https://archive.org/details/SNESDevManual/book1/page/n234 Appendix C-9]
* [https://www.romhacking.net/documents/197 anomie's SPC700 doc]
* https://forums.nesdev.org/viewtopic.php?t=13313


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

Latest revision as of 11:40, 20 September 2024

Basic Info
Addressing Mode Opcode Length Speed Vector Address
Implied (type 3) 01 1 byte 8 cycles $FFDE
Implied (type 3) 11 1 byte 8 cycles $FFDC
Implied (type 3) 21 1 byte 8 cycles $FFDA
Implied (type 3) 31 1 byte 8 cycles $FFD8
Implied (type 3) 41 1 byte 8 cycles $FFD6
Implied (type 3) 51 1 byte 8 cycles $FFD4
Implied (type 3) 61 1 byte 8 cycles $FFD2
Implied (type 3) 71 1 byte 8 cycles $FFD0
Implied (type 3) 81 1 byte 8 cycles $FFCE
Implied (type 3) 91 1 byte 8 cycles $FFCC
Implied (type 3) A1 1 byte 8 cycles $FFCA
Implied (type 3) B1 1 byte 8 cycles $FFC8
Implied (type 3) C1 1 byte 8 cycles $FFC6
Implied (type 3) D1 1 byte 8 cycles $FFC4
Implied (type 3) E1 1 byte 8 cycles $FFC2
Implied (type 3) F1 1 byte 8 cycles $FFC0
Flags Affected
N V P B H I Z C
. . . . . . . .

TCALL (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.

No flags are affected.

Syntax

TCALL n

where n is the vector call number, a decimal integer from 0 to 15, which becomes the high nybble of the opcode.

See Also

External Links