English
Language : 

45111 Datasheet, PDF (130/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
13 Appendix C: SX Instruction Set
CSNE op1, op2
Compare op1 to op2 and skip if not equal
Command
1) CSNE fr, #literal
2) CSNE fr1, fr2
Words
3
3
Cycles
3 or 4 (skip)
(12 or 16)
3 or 4 (skip)
(12 or 16)
Affects
W, C, DC, Z
W, C, DC, Z
Coding
1100 kkkk kkkk MOV W, #lit
0000 100f ffff MOV W, fr-W
0110 0100 0011 SNZ
0010 000f ffff MOV W, fr2
0000 100f ffff MOV W, fr1-W
0110 0100 0011 SNZ
Operation: op1 is compared to op2. If op1 is not equal to op2, the following instruction word is skipped. W is left
holding the result of op1 - op2. If CARRYX is specified, c affects the result. Insert an STC before command to
avoid strange results.
Note:
Only one word is skipped by this instruction. To avoid strange results, make sure that any instruction
following CSNE is a single-word instruction.
DEC dest
Decrement dest
Command
1) DEC fr
Words
1
Cycles
1 (4)
Affects
fr, Z
Coding
0000 111f ffff DEC fr
Operation: dest is decremented. Z will be set to 1 if the result was 0; otherwise, Z will be cleared to 0. The MOV W, -
-fr command is similar to DEC fr, except the result is moved to W, and fr keeps its original contents.
DECSZ dest
Decrement dest and skip if zero
Command
1) DECSZ fr
Words
1
Cycles
1 or 2 (skip)
(4 or 8)
Affects
fr
Coding
0010 111f ffff DECSZ fr
Operation: dest is decremented. If result is 0, the next instruction word will be skipped.
Note:
Only one word is skipped by this instruction. To avoid strange results, make sure that any instruction
following DECSZ is a single-word instruction.
Page 130 • SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc.