SWCU194 March 2023 CC1314R10 , CC1354P10 , CC1354R10 , CC2674P10 , CC2674R10
Syntax | Description | Operation | Status Flags | Encoding [15:0] | Prefix | |||
---|---|---|---|---|---|---|---|---|
Z | N | C | V | |||||
ld Rd, [#addr] | Load direct | Rd = mem[addr] | — | — | — | — |
| addr |
ld Rd, [Rs] | Load indirect | Rd = mem[Rs] | — | — | — | — |
| |
ld Rd, [Rs++] | Load indirect, post-increment | Rd = mem[Rs], Rs++ | — | — | — | — |
| |
ld Rd, [Rs+R0] | Load indexed | Rd = mem[Rs+R0] | — | — | — | — |
| |
st Rd, [#addr] | Store direct | mem[addr] = Rd | — | — | — | — |
| addr |
st Rd, [Rs] | Store indirect | mem[Rs] = Rd | — | — | — | — |
| |
st Rd, [Rs++] | Store indirect, post-increment | mem[Rs] = Rd, Rs++ | — | — | — | — |
| |
st Rd, [Rs+R0] | Store indexed | mem[Rs+R0] = Rd | — | — | — | — |
|
Syntax | Description | Operation | Status Flags | Encoding [15:0] | Prefix | |||
---|---|---|---|---|---|---|---|---|
Z | N | C | V | |||||
in Rd, [#addr] | Input direct | Rd = reg[addr] | — | — | — | — |
| addr |
in Rd, [Rs] | Input indirect | Rd = reg[Rs] | — | — | — | — |
| |
out Rd, [#addr] | Output direct | reg[addr] = Rd | — | — | — | — |
| addr |
out Rd, [Rs] | Output indirect | reg[Rs] = Rd | — | — | — | — |
|
Syntax | Description | Operation | Status Flags | Encoding [15:0] | Prefix | |||
---|---|---|---|---|---|---|---|---|
Z | N | C | V | |||||
iobclr #imm, [#addr] | I/O bit clear direct | reg[addr] &= ~2^imm | — | — | — | — |
| addr |
iobset #imm, [#addr] | I/O bit set direct | reg[addr] |= 2^imm | — | — | — | — |
| addr |
iobtst #imm, [#addr] | I/O bit test direct | reg[addr] & 2^imm | — | — | √ | — |
| addr |
Syntax | Description | Operation | Status Flags | Encoding [15:0] | Prefix | |||
---|---|---|---|---|---|---|---|---|
Z | N | C | V | |||||
ld Rd, #simm | Load immediate | Rd = simm | — | — | — | — |
| simm |
ld Rd, Rs | Load register | Rd = Rs | — | — | — | — |
|
Syntax | Description | Operation | Status Flags | Encoding [15:0] | Prefix | |||
---|---|---|---|---|---|---|---|---|
Z | N | C | V | |||||
and Rd, #imm | AND immediate | Rd &= imm | x | x | 0 | 0 |
| imm |
or Rd, #imm | OR immediate | Rd |= imm | x | x | 0 | 0 |
| imm |
xor Rd, #imm | XOR immediate | Rd ^= imm | x | x | 0 | 0 |
| imm |
tst Rd, #imm | Test immediate | Rd & imm | x | x | 0 | 0 |
| imm |
and Rd, Rs | AND register | Rd &= Rs | x | x | 0 | 0 |
| |
or Rd, Rs | OR register | Rd |= Rs | x | x | 0 | 0 |
| |
xor Rd, Rs | XOR register | Rd ^= Rs | x | x | 0 | 0 |
| |
tst Rd, Rs | Test register | Rd & Rs | x | x | 0 | 0 |
| |
inv Rd | Invert register | Rd = ~Rd | x | x | 0 | 0 |
|
Syntax | Description | Operation | Status Flags | Encoding [15:0] | Prefix | |||
---|---|---|---|---|---|---|---|---|
Z | N | C | V | |||||
add Rd, #simm | Add immediate | Rd += simm | x | x | x | x |
| simm |
cmp Rd, #simm | Compare immediate | Rd - simm | x | x | x | x |
| simm |
sub Rd, Rs | Subtract register | Rd -= Rs | x | x | x | x |
| |
add Rd, Rs | Add register | Rd += Rs | x | x | x | x |
| |
cmp Rd, Rs | Compare register | Rd - Rs | x | x | x | x |
| |
subr Rd, Rs | Subtract reverse register | Rd = Rs - Rd | x | x | x | x |
| |
abs Rd | Absolute register | Rd = (Rd >= 0) ? Rd : -Rd | x | x | x | x |
| |
neg Rd | Negate register | Rd = -Rd | x | x | x | x |
|
Syntax | Description | Operation | Status Flags | Encoding [15:0] | Prefix | |||
---|---|---|---|---|---|---|---|---|
Z | N | C | V | |||||
lsl Rd, Rs | Logical shift left register | Rd <<= Rs | x | x | x | 0 |
| |
lsr Rd, Rs | Logical shift right register | Rd >>= Rs | x | x | x | 0 |
| |
asr Rd, Rs | Arithmetic shift right register | Rd >>= Rs, preserve sign | x | x | x | 0 |
| |
lsl Rd, #imm | Logical shift left immediate(1) | Rd <<= imm | x | x | x | 0 |
| |
lsr Rd, #imm | Logical shift right immediate(1) | Rd >>= imm | x | x | x | 0 |
| |
asr Rd, #imm | Arithmetic shift right immediate(1) | Rd >>= imm, preserve sign | x | x | x | 0 |
|
Syntax | Description | Operation | Status Flags | Encoding [15:0] | Prefix | |||
---|---|---|---|---|---|---|---|---|
Z | N | C | V | |||||
jmp addr | Jump direct | pc = addr | — | — | — | — |
| addr |
jsr addr | Jump subroutine direct | push(stack, pc + 1), pc = addr | — | — | — | — |
| addr |
jmp R0 | Jump indirect | pc = R0 | — | — | — | — |
| |
jsr R0 | Jump subroutine indirect | push(stack, pc + 1), pc = R0 | — | — | — | — |
| |
rts | Return subroutine | pc = pop(stack) | — | — | — | — |
| |
bra rel | Branch relative | pc = pc + 1 + rel | — | — | — | — |
| |
b<cc> rel | Branch relative if condition is met | if (cc) pc = pc + 1 + rel | — | — | — | — |
| |
bev0 #ev, rel | Branch if event 0 | if (!events[ev]) pc = pc + 1 + rel | — | — | — | — |
| |
bev01#ev, rel | Branch if event 1 | if (events[ev]) pc = pc + 1 + rel | — | — | — | — |
|
For all other instructions and also when not taking a conditional branch, the program counter is incremented by 1: pc = pc + 1. See Table 20-12 for the conditional operations.
Syntax <cc> | Description | Condition | Encoding [3:0] |
---|---|---|---|
gtu | Greater than, unsigned | !C & !Z |
|
geu / iob0 | Greater than or equal to, unsigned / Tested I/O bit = 0 | !C |
|
eq / z | Equal / Zero | Z |
|
novf | Not overflow | !V |
|
pos | Positive | !N |
|
ges | Greater or equal to, signed | (N & V) | (!N & !V) |
|
gts | Greater than, signed | ((N & V) | (!N & !V)) & !Z |
|
leu | Less than or equal to, unsigned | C | Z |
|
ltu / iob1 | Less than, unsigned / Tested I/O bit = 1 | C |
|
neq / nz | Not equal / Non-zero | !Z |
|
ovf | Overflow | V |
|
neg | Negative | N |
|
lts | Less than, signed | (N & !V) | (!N & V) |
|
les | Less than or equal to, signed | (N & !V) | (!N & V) | Z |
|
Syntax | Description | Operation | Status Flags | Encoding [15:0] | Prefix | |||
---|---|---|---|---|---|---|---|---|
Z | N | C | V | |||||
loop R1, rel | Loop register, n = 1..255(1) | lc = LSB(R1), ls = pc + 1, le = pc + rel | x | x | x | x |
| |
loop #n, rel | Loop immediate, n = 2x, (x = 1..7)(1) | lc = n, ls = pc + 1, le = pc + rel | x | x | x | x |
|
Syntax | Description | Operation | Status Flags | Encoding [15:0] | Prefix | |||
---|---|---|---|---|---|---|---|---|
Z | N | C | V | |||||
wev0 #ev | Wait for event 0 | Stop until events[ev] == 0 | x | x | x | x |
| |
wev1 #ev | Wait for event 1 | Stop until events[ev] == 1 | x | x | x | x |
| |
sleep | Sleep | Stop until wakeup, then pc = 2 * vector | x | x | x | x |
|
Syntax | Description | Operation | Status Flags | Encoding [15:0] | Prefix | |||
---|---|---|---|---|---|---|---|---|
Z | N | C | V | |||||
nop | No operation | R7 = R7 (no effect) | x | x | x | x |
| |
pfix #imm | Prefix(1) | Use prefix on next instruction | x | x | x | x |
| |
dw #imm | Data word | Inserts 16-bit immediate data value | x | x | x | x |
|
pfix
) instruction is inserted automatically by the assembler where needed. Do not insert this instruction manually.