English
Language : 

45111 Datasheet, PDF (125/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
13 Appendix C: SX Instruction Set
CJAE op1, op2, addr9
Compare op1 to op2 and jump if above or equal
Command
1) CJAE fr, #literal, addr9
Words
4
Cycles
4 or 6 (jump)
(16 or 20)
2) CJAE fr1, fr2, addr9
4
4 or 6 (jump)
(16 or 20)
Affects
W, C, DC, Z
W, C, DC, Z
Coding
1100 kkkk kkkk MOV W, #lit
0000 100f ffff MOV W, fr-W
0110 0000 0011 SNC
101k kkkk kkkk JMP addr9
0010 000f ffff MOV W, fr2
0000 100f ffff MOV W, fr1-W
0110 0000 0011 SNC
101k kkkk kkkk JMP addr9
Operation: op1 is compared to op2. If op1 is greater than or equal to op2, a jump to addr9 is executed. W is left
holding the result of op2 - op1. If CARRYX is specified, c affects the result. Insert an STC before command to
avoid strange results.
CJB op1, op2, addr9
Compare op1 to op2 and jump if below
Command
1) CJB fr, #literal, addr9
Words
4
Cycles
4 or 6 (jump)
(16 or 20)
2) CJB fr1, fr2, addr9
4
4 or 6 (jump)
(16 or 20)
Affects
W, C, DC, Z
W, C, DC, Z
Coding
1100 kkkk kkkk MOV W, #lit
0000 100f ffff MOV W, fr-W
0111 0000 0011 SC
101k kkkk kkkk JMP addr9
0010 000f ffff MOV W, fr2
0000 100f ffff MOV W, fr1-W
0111 0000 0011 SC
101k kkkk kkkk JMP addr9
Operation: op1 is compared to op2. If op1 is less than op2, a jump to addr9 is executed. W is left holding the result
of op2 - op1. If CARRYX is specified, c affects the result. Insert an STC before command to avoid strange results.
CJBE op1, op2, addr9
Compare op1 to op2 and jump if below or equal
Command
1) CJBE fr, #literal, addr9
Words
4
Cycles
4 or 6 (jump)
(16 or 20)
2) CJBE fr1, fr2, addr9
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
0111 0000 0011 SC
101k kkkk kkkk JMP addr9
0011 000f ffff MOV W, fr1
0000 100f ffff MOV W, fr2-W
0110 0000 0011 SNC
101k kkkk kkkk JMP addr9
Operation: op1 is compared to op2. If op1 is less than or equal to op2, a jump to addr9 is executed. W is left holding
the result of ~op2 + op1 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.
SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc. • Page 125