Texas Instruments TMS320C2XX Calculator User Manual


 
Compare Auxiliary Register With AR0
CMPR
7-65
Assembly Language Instructions
Syntax CMPR
CM
Operands CM: Value from 0 to 3
Opcode
0123456789101112131415
CM10001011111101
Execution Increment PC, then ...
Compare (current AR) to (AR0) and place the result in the TC bit of status
register ST1.
Status Bits
Affects
TC
This instruction is not affected by SXM. It does not affect SXM.
Description The CMPR instruction performs a comparison specified by the value of CM:
If CM = 00, test whether (current AR) = (AR0)
If CM = 01, test whether (current AR) < (AR0)
If CM = 10, test whether (current AR) > (AR0)
If CM = 11, test whether (current AR) (AR0)
If the condition is true, the TC bit is set to 1. If the condition is false, the TC bit
is cleared to 0.
Note that the auxiliary register values are treated as unsigned integers in the
comparisons.
Words 1
Cycles for a Single CMPR Instruction
ROM
DARAM SARAM External
1 1 1 1+p
Cycles for a Repeat (RPT) Execution of an CMPR Instruction
ROM
DARAM SARAM External
n n n n+p
Example CMPR 2 ;(current AR) > (AR0)?
Before Instruction After Instruction
ARP 4 ARP 4
AR0 0FFFFh AR0 0FFFFh
AR4 7FFFh AR4 7FFFh
TC 1 TC 0
Cycles