8
LatticeMico
8
Microcontroller
Lattice Semiconductor
User’s Guide
CMP Rd, Rb
Subtract Rb from Rd and update the flags. The result of the subtraction is not written back.
The carry flag is set to 1 if the result is negative. The zero flag is set to 1 if all the bits of the result are 0.
CMPI Rd, C
Subtract Constant from Rd and update the flags. The result of the subtraction is not written back.
The carry flag is set to 1 if the result is negative. The zero flag is set to 1 if all the bits of the result are 0.
TEST Rd, Rb
Perform a bitwise AND between Rd and Rb, update the zero flag. The result of the AND operation is not written
back.
The zero flag is set to 1 if all the bits of the result are 0.
TESTI Rd, CC
Perform a bitwise AND between Rd and Constant, update the zero flag. The result of the AND operation is not writ-
ten back.
The zero flag is set to 1 if all the bits of the result are 0.
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
1
0
0
0
0
Rd
Rd
Rd
Rd
Rd
Rb
Rb
Rb
Rb
Rb
0
0
0
CY Flag Updated
Zero Flag Updated
Yes
Yes
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
1
0
0
0
1
Rd
Rd
Rd
Rd
Rd
C
C
C
C
C
C
C
C
CY Flag Updated
Zero Flag Updated
Yes
Yes
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
1
0
0
1
0
Rd
Rd
Rd
Rd
Rd
Rb
Rb
Rb
Rb
Rb
0
0
0
CY Flag Updated
Zero Flag Updated
No
Yes
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
1
0
0
1
1
Rd
Rd
Rd
Rd
Rd
C
C
C
C
C
C
C
C
CY Flag Updated
Zero Flag Updated
No
Yes