EasyManuals Logo

Texas Instruments TMS320C28x User Manual

Texas Instruments TMS320C28x
695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #239 background imageLoading...
Page #239 background image
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”

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320C28x and is the answer not in the manual?

Texas Instruments TMS320C28x Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320C28x
CategoryProcessor
LanguageEnglish

Related product manuals