English
Language : 

45111 Datasheet, PDF (123/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
13 Appendix C: SX Instruction Set
ADD dest, src
Add src into dest
Command
1) ADD fr, W
2) ADD fr, #literal
3) ADD
4) ADD
fr1, fr2
W, fr
Words
1
2
2
1
Cycles
1 (4)
2 (8)
2 (8)
1 (8)
Affects
fr, C, DC, Z
fr, W, C, DC, Z
fr, W, C, DC, Z
W, C, DC, Z
Coding
0001 111f ffff ADD fr, W
1100 kkkk kkkk MOV W, #lit
0001 111f ffff ADD fr, W
0010 000f ffff MOV W, fr2
0001 111f ffff ADD fr1, W
0001 110f ffff ADD W, fr
Operation: src is added into dest. C will be set if an overflow occurs; otherwise, C will be cleared. DC will be set if
an overflow occurs in the lower nibble; otherwise, DC will be cleared. Z will be set if the result is 0;
otherwise, Z will be cleared. W is left holding the source value in command #2 and #3. If CARRYX is
specified, C is added to result. Insert a CLC before the first Add on a register to avoid strange results.
ADDB dest, src_bit
Add src_bit into dest
Command
1) ADDB fr, op.bit
2) ADDB fr, /op.bit
Words
2
2
Cycles
2 (8)
2 (8)
Affects
fr, Z
fr, Z
Coding
0110 bbbf ffff SNB op.bit
0010 101f ffff INC fr
0111 bbbf ffff SB op.bit
0010 101f ffff INC fr
Operation: src_bit is added into dest. If fr is incremented, Z will be set if the result is 0; otherwise, Z will be cleared.
This instruction is useful for adding the carry into the upper byte of a double-byte sum after the lower
byte has been computed.
AND dest, src
AND src into dest
Command
1) AND fr, W
2) AND fr, #literal
3) AND
4) AND
5) AND
fr1, fr2
W, fr
W, #literal
Words
1
2
2
1
1
Cycles
1 (4)
2 (8)
2 (8)
1 (4)
1 (4)
Affects
fr, Z
fr, W, Z
fr1, W, Z
W, Z
W, Z
Coding
0001 011f ffff AND fr, W
1100 kkkk kkkk MOV W, #lit
0001 011f ffff AND fr, W
0010 000f ffff MOV W, fr2
0001 011f ffff AND fr1, W
0001 010f ffff AND W, fr
1110 kkkk kkkk AND W, #lit
Operation: src is ANDed into dest. Z will be set if the result is 0; otherwise, Z will be cleared. W is left holding the
source value in command #2 and #3.
SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc. • Page 123