background image
© 2005 Ubicom, Inc. All rights reserved.
- 36 -
www.ubicom.com
SX20AC/SX28AC
CLRB fr.bit
Clear Bit in fr (fr.bit = 0)
1
1
0100 bbbf ffff
none
SB fr.bit
Test Bit in fr and Skip if Set (test fr.bit and skip
next instruction if bit is 1)
1 or
2 (skip)
1 or
2 (skip) 0111 bbbf ffff
none
SETB fr.bit
Set Bit in fr (fr.bit = 1)
1
1
0101 bbbf ffff
none
SNB fr.bit
Test Bit in fr and Skip if Clear (test fr.bit and skip
next instruction if bit is 0)
1 or
2 (skip)
1 or
2 (skip) 0110 bbbf ffff
none
Data Movement Instructions
MOV fr,W
Move W to fr (fr = W)
1
1
0000 001f ffff
none
MOV W,fr
Move fr to W (W = fr)
1
1
0010 000f ffff
Z
MOV W,fr-W
Move (fr-W) to W (W = fr - W); complement of
carry bit is subtracted if CF bit in FUSEX register
is cleared to 0
1
1
0000 100f ffff
C, DC, Z
MOV W,#lit
Move Literal to W (W = lit)
1
1
1100 kkkk kkkk
none
MOV W,/fr
Move Complement of fr to W (W = fr ^ FFh)
1
1
0010 010f ffff
Z
MOV W,--fr
Move (fr-1) to W (W = fr - 1)
1
1
0000 110f ffff
Z
MOV W,++fr
Move (fr+1) to W (W = fr + 1)
1
1
0010 100f ffff
Z
MOV W,<<fr
Rotate fr Left through Carry and Move to W
(W = << fr) fr will be unchanged
1
1
0011 010f ffff
C
MOV W,>>fr
Rotate fr Right through Carry and Move to W
(W = >> fr) fr will be unchanged
1
1
0011 000f ffff
C
MOV W,<>fr
Swap High/Low Nibbles of fr and move to W
(W = <> fr) fr will be unchanged
1
1
0011 100f ffff
none
MOV W,M
Move MODE Register to W (W = MODE), high
nibble is cleared
1
1
0000 0100 0010
none
MOVSZ W,--fr
Move (fr-1) to W and Skip if Zero (W = fr -1 and
skip next instruction if result is zero)
1 or
2 (skip)
1
2 (skip)
0010 110f ffff
none
MOVSZ W,++fr
Move (fr+1) to W and Skip if Zero (W = fr + 1 and
skip next instruction if result is zero)
1 or
2 (skip)
1
2 (skip)
0011 110f ffff
none
MOV M,W
Move W to MODE Register (MODE = W)
1
1
0000 0100 0011
none
MOV M,#lit
Move Literal to MODE Register (MODE = lit)
1
1
0000 0101 kkkk
none
MOV !rx,W
Move W to Port Rx Direction Register: !rx <=> W
(exchange W and WKPND_B or CMP_B) or !rx
= W (move W to !rx for all other port direction
registers)
The only valid opcodes for mov !rx, W are:
005h (for !ra)
006h (for !rb)
007h (for !rc)
1
1
0000 0000 0101
through
0000 0000 0111
none
MOV !OPTION, W Move W to OPTION Register (OPTION = W)
1
1
0000 0000 0010
none
TEST fr
Test fr for Zero (fr = fr to set or clear Z bit)
1
1
0010 001f ffff
Z
Program Control instruction
Table 16-1. The SX Instruction Set (Continued)
Mnemonic,
Operands
Description
Cycles
(Compatible)
Cycles
(Turbo)
Opcode
Bits
Affected