Excalibur electronic A-MNL-NIOSPROG-01.1 用户手册
46
Altera Corporation
32-Bit Instruction Set
CMPI
Compare Immediate
Operation:
∅ ← RA – (0x00.00 : K : IMM5)
Assembler Syntax:
CMPI & %rA,IMM5
Example:
Not preceded by PFX:
CMPI %i3,24 ; compare %i3 to 24
Preceded by PFX:
Preceded by PFX:
PFX %hi(1000)
CMPI %i4,%lo(1000)
Description:
Not preceded by PFX:
Subtract a 5-bit immediate value given by IMM5 from RA, and discard the result.
Subtract a 5-bit immediate value given by IMM5 from RA, and discard the result.
Set the condition codes according to the subtraction. RA is not altered.
Preceded by PFX:
The Immediate operand is extended from 5 to 16 bits by concatenating the
contents of the K-register (11 bits) with IMM5 (5 bits). The 16-bit immediate value
Preceded by PFX:
The Immediate operand is extended from 5 to 16 bits by concatenating the
contents of the K-register (11 bits) with IMM5 (5 bits). The 16-bit immediate value
(K : IMM5) is zero-extended to 32 bits and subtracted from RA. Condition codes
are set and the result is discarded. RA is not altered.
are set and the result is discarded. RA is not altered.
Condition Codes:
Flags:
N: Result bit 31
V: Signed-arithmetic overflow
Z: Set if result is zero; cleared otherwise
Z: Set if result is zero; cleared otherwise
C: Set if there was a borrow from the subtraction; cleared otherwise
Instruction Format:
Ri5
Instruction Fields:
A = Register index of RA operand
IMM5 = 5-bit immediate value
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0
0
0
1
0
1
IMM5
A
N
V
Z
C
∆
∆
∆
∆