English
Language : 

45111 Datasheet, PDF (124/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
13 Appendix C: SX Instruction Set
BANK dest
Set bank select bits
Command
BANK
fr
Words
1
Cycles
1 (4)
Affects
FSR
Coding
0000 0001 1fff BANK fr
Operation: Writes file registers bits 7 through 5 (on the SX20/28) or 6 through 4 (on the SX48/52) to the same bits in
the file select register (FSR) in preparation for a RAM access across a bank boundary. The full 8-bit file
register address must be used as the destination. On the SX48/52, bit 7 in the FSR is used to select between
upper and lower block of banks. This bit is not affected by the BANK instruction, and must be set or cleared with a
separate SETB FSR.7 or CLRB FSR.7 following the BANK instruction.
CALL addr8
Call subroutine with 8-bit address
Command
1) CALL addr8
Words
1
Cycles
3 (8)
Affects
PC
Coding
1001 kkkk kkkk CALL addr8
Operation: The next instruction address is pushed onto the stack and addr8 is moved to the program counter. The
ninth bit of the program counter will be cleared to 0. Therefore, calls are only allowed to the first half of
any 512-word page, although the CALL instruction can be anywhere.
CJA op1, op2, addr9
Compare op1 to op2 and jump if above
Command
1) CJA fr, #literal, addr
2) CJA fr1, fr2, addr
Words
4
Cycles
4 or 6 (jump)
(16 or 20)
4
4 or 6 (jump)
(16 or 20)
Affects
W, C, DC, Z
W, C, DC, Z
Coding
1100 kkkk kkkk MOV W, #lit^$FF
0001 110f ffff ADD W, fr
0110 0000 0011 SNC
101k kkkk kkkk JMP addr9
0010 000f ffff MOV W, fr1
0000 100f ffff MOV W, fr2-W
0111 0000 0011 SC
101k kkkk kkkk JMP addr9
Operation: op1 is compared to op2. If op1 is greater than op2, a jump to addr9 is executed. W is left holding the
result of op1 + ~op2 in command #1 and op2 - op1 in command #2. If CARRYX is specified, c affects the
result. Insert a CLC before command #1 and an STC before command #2 to avoid strange results.
Page 124 • SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc.