Operations:

Format

Syntax:

Operation:

Operands:

Architecture revision

Opcode

1

cp.h Rd, Rs

Rd[15:0] - Rs[15:0];
{d, s} ∈ {0, 1, …, 15}

Rev1+

111

Rs

00000

Rd

0001100100000000

3

4

5

4

16

Description

Performs a compare between the lowermost halfwords in the two operands specified. The oper- ation is implemented by doing a subtraction without writeback of the difference. The operation sets the status flags according to the result of the subtraction, but does not affect the operand registers.

Status Flags:

Format I: OP1 = Rd, OP2 = Rs

Q:

Not affected

V:

V = (OP1[15] AND ~OP2[15] AND ~RES[15]) OR (~OP1[15] AND OP2[15] AND RES[15])

N:

N = RES[15]

Z:

Z = (RES[15:0] == 0)

C:

C = ~OP1[15] AND OP2[15] OR OP2[15] AND RES[15] OR ~OP1[15] AND RES[15]