Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
cpc Rd, Rs |
Rd - Rs - C; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||
2 |
cpc Rd |
Rd - C; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Performs a compare between the two registers specified. The operation is executed by doing a subtraction with carry (as borrow) without writeback of the difference. The operation sets the sta- tus flags according to the result of the subtraction, but does not affect the operand registers. Note that the zero flag status before the operation is included in the calculation of the new zero flag. This instruction allows large compares (64, 128 or more bits).
In format II, Rs referred to below equals zero. |
|
Q: |
Not affected |
V: |
V = (Rd[31] AND ~Rs[31] AND ~RES[31]) OR (~Rd[31] AND Rs[31] AND RES[31]) |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) AND Z |
C: |
C = ~Rd[31] AND Rs[31] OR Rs[31] AND RES[31] OR ~Rd[31] AND RES[31] |