Operations:

Format

Syntax:

Operation:

Operands:

Architecture revision

Opcode

1

cp.b Rd, Rs

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

Rev1+

111

Rs

00000

Rd

0001100000000000

3

4

5

4

16

Description

Performs a compare between the lowermost bytes in the two operands specified. The operation 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:

Q:

Not affected

V:

V = (Rd[7] AND ~Rs[7] AND ~RES[7]) OR (~Rd[7] AND Rs[7] AND RES[7])

N:

N = RES[7]

Z:

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

C:

C = ~Rd[7] AND Rs[7] OR Rs[7] AND RES[7] OR ~Rd[7] AND RES[7]