CMPR 0/1/2/3
CMPR 0/1/2/3
SYNTAX OPTIONS
CMPR 0
CMPR 1
CMPR 2
CMPR 3
Operands
Description
Flags and
ARP
Modes
TC
Repeat
Example
TableA: .word 0x1111
.word 0x2222
FuncA:
MOVL XAR1,#VarA
MOVZ AR0,*XAR1++
MOVZ AR1,*XAR1
CMPR 0
B
CMPR 2
B
.
.
6-82
None
Compare AR0 to the 16-bit auxiliary register pointed to by ARP. The
comparison type is determined by the instruction.
CMPR 0: if(AR0 = AR[ARP]) TC = 1, else TC = 0
CMPR 1: if(AR0 > AR[ARP]) TC = 1, else TC = 0
CMPR 2: if(AR0 < AR[ARP]) TC = 1, else TC = 0
CMPR 3: if(AR0 != AR[ARP]) TC = 1, else TC = 0
The 3-bit ARP points to the current valid Auxiliary Register, XAR0 to XAR7.
This pointer determines which Auxiliary register is compared to AR0.
If the test is true, TC is set, else TC is cleared.
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
Equal,TC
Less,TC
OPCODE
0101 0110 0001 1101
0101 0110 0001 1001
0101 0110 0001 1000
0101 0110 0001 1100
; Initialize XAR1 Pointer
; Load AR0 with 0x1111, clear AR0H,
; ARP = 1
; Load AR1 with 0x2222, clear AR1H
; AR0 = AR1? No, clear TC
; Don't branch
; AR1 > AR2? Yes, set TC
; Branch to "Less"
Compare Auxiliary Registers
OBJMODE
RPT
1
−
1
−
1
−
1
−
CYC
1
1
1
1
Need help?
Do you have a question about the TMS320C28x and is the answer not in the manual?