CMPR 0/1/2/3
6-82
CMPR 0/1/2/3
Compare Auxiliary Registers
SYNTAX OPTIONS
OPCODE
OBJMODE
RPT
CYC
CMPR 0
0101 0110 0001 1101
1
−
1
CMPR 1
0101 0110 0001 1001
1
−
1
CMPR 2
0101 0110 0001 1000
1
−
1
CMPR 3
0101 0110 0001 1100
1
−
1
Operands
None
Description
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
Flags and
Modes
ARP
The 3-bit ARP points to the current valid Auxiliary Register, XAR0 to XAR7.
This pointer determines which Auxiliary register is compared to AR0.
TC
If the test is true, TC is set, else TC is cleared.
Repeat
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
Example
TableA: .word 0x1111
.word 0x2222
FuncA:
MOVL XAR1,#VarA
MOVZ AR0,*XAR1++
MOVZ AR1,*XAR1
CMPR 0
B Equal,TC
CMPR 2
B Less,TC
.
.
; 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”
Содержание TMS320C28x
Страница 30: ...1 12...
Страница 80: ...This page intentionally left blank 2 50 This page intentionally left blank...
Страница 269: ...IN loc16 PA 6 112 MOV AL 0 AL 0 UOUT IORegC AL IOspace IORegC AL 10...
Страница 308: ...MAXCUL P loc32 6 151 Saturate MOVL Var64 2 ACC Store result into Var64 MOVL Var64 P...
Страница 509: ...SUBL ACC P PM 6 352 SUBL ACC P PM ACC S B 11 M X 4 MOVH Y ACC 5 Store Q15 result into Y...
Страница 585: ...This page intentionally left blank 7 32 This page intentionally left blank...