Compare Auxiliary Register With AR0
CMPR
7-65
Assembly Language Instructions
Syntax
CMPR
CM
Operands
CM:
Value from 0 to 3
Opcode
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
CM
1
0
0
0
1
0
1
1
1
1
1
1
0
1
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