44
www.ubicom.com
IP2022 Data Sheet
Table 4-2 Logical Instructions
Assembler
Syntax
Pseudocode
Definition
Description
Cycles
Opcode
Flags
Affected
and fr,w
fr = fr & W
AND fr,W into fr
1
0001 011f ffff ffff
Z
and w,fr
fr = W & fr
AND W,fr into W
1
0001 010f ffff ffff
Z
and w,#lit8
W = W & lit8
AND W,literal into W
1
0111 1110 kkkk kkkk
Z
not fr
fr = fr
Complement fr into fr
1
0010 011f ffff ffff
Z
not w,fr
W = fr
Complement fr into W
1
0010 010f ffff ffff
Z
or fr,w
fr = fr | W
OR fr,W into fr
1
0001 001f ffff ffff
Z
or w,fr
W = W | fr
OR W,fr into W
1
0001 000f ffff ffff
Z
or w,#lit8
W = W | lit8
OR W,literal into W
1
0111 1101 kkkk kkkk
Z
xor fr,w
fr = fr ^ W
XOR fr,W into fr
1
0001 101f ffff ffff
Z
xor w,fr
W = W ^ fr
XOR W,fr into W
1
0001 100f ffff ffff
Z
xor w,#lit8
W = W ^ lit8
XOR W,literal into W
1
0111 1111 kkkk kkkk
Z
Table 4-3 Arithmetic and Shift Instructions
Assembler
Syntax
Pseudocode
Definition
Description
Cycles
Opcode
Flags
Affected
add fr,w
fr = fr + W
Add fr,W into fr
1
0001 111f ffff ffff C, DC, Z
add w,fr
W = W + fr
Add W,fr into W
1
0001 110f ffff ffff C, DC, Z
add w,#lit8
W = W + lit8
Add W,literal into W
1
0111 1011 kkkk kkkk C, DC, Z
addc fr,w
fr = C + fr + W
Add carry,fr,W into fr
1
0101 111f ffff ffff C, DC, Z
addc w,fr
W = C + W + fr
Add carry,W,fr into W
1
0101 110f ffff ffff C, DC, Z
clr fr
fr = 0
Clear fr
1
0000 011f ffff ffff
Z
cmp w,fr
fr - W
Compare W,fr
then update STATUS
1
0000 010f ffff ffff C, DC, Z
cmp w,#lit8
lit8 - W
Compare W,literal
then update STATUS
1
0111 1001 kkkk kkkk C, DC, Z
cse w,fr
if (fr - W) = 0
then skip
Compare W,fr then skip if equal
1 or
2 (skip)
0100 001f ffff ffff
None
cse w,#lit8
if (lit8 - W) = 0
then skip
Compare W,literal then skip if
equal
1 or
2 (skip)
0111 0111 kkkk kkkk
None
csne w,fr
if (fr - W) != 0
then skip
Compare W,fr then skip if not
equal
1 or
2 (skip)
0100 000f ffff ffff
None
csne w,#lit8 if (lit8 - W) != 0
then skip
Compare W,literal then skip if not
equal
1 or
2 (skip)
0111 0110 kkkk kkkk
None
cwdt
WDT = 0
Clear Watchdog Timer
1
0000 0000 0000 0100
None
dec fr
fr = fr - 1
Decrement fr into fr
1
0000 111f ffff ffff
Z