English
Language : 

45111 Datasheet, PDF (138/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
13 Appendix C: SX Instruction Set
RETI
Return from interrupt routine
Command
1) RETI
Words
1
Cycles
3 (8)
Affects
Coding
C, DC, Z, PAx, PC, W, FSR 0000 0000 1110 RETI
Operation: W, STATUS (except TO & PD), FSR and PC are popped off the shadow registers and execution proceeds
with the instruction following the jump to interrupt.
RETIW
Return from interrupt routine, adjust RTCC
Command
1) RETIW
Words
1
Cycles
3 (8)
Affects
Coding
C, DC, Z, PAx, PC, W, FSR,
RTCC
0000 0000 1111 RETIW
Operation: The value in W is added to RTCC, then W, STATUS (except TO & PD), FSR and PC are popped off the
shadow registers and execution proceeds with the instruction following the jump to interrupt. This is
useful to create jitter-free, timed interrupts when using the interrupt-on-timer-rollover feature.
RETP
Return from subroutine across a page boundary
Command
1) RETP
Words
1
Cycles
3 (8)
Affects
PAx, PC
Coding
0000 0000 1101 RETP
Operation: The top stack value is moved into the program counter, upper return address bits are written to the
page select bits (bit 10:9 to status register 6:5 on SX20/28, or bits 11:9 to status register bits 7:5 on
SX48/52), and execution proceeds with the instruction following the most recent call instruction. This
instruction allows returning from a subroutine across page boundaries.
RETW value
Assemble RETWs which load W with literal data upon return
Command
Words
Cycles
1) RETW
#literal {, #literal…}
1 per
literal
3 (8) per literal
Affects
PC, W
Coding
1000 kkkk kkkk RETW #lit
{1000 kkkk kkkk RETW #lit…}
Operation: A list of RETWs is assembled each with one literal. This list can be accessed by JMP PC+W or JMP W
instructions. This is useful for lookup tables.
Page 138 • SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc.