Operations:

Format

Syntax:

Operation:

Operands:

Architecture revision

Opcode

1

rsub Rd, Rs

Rd = Rs - Rd;
{d, s} ∈ {0, 1, …, 15}

Rev1+

000

Rs

00010

Rd

3

4

5

4

2

rsub Rd, Rs, imm

Rd = SE(imm8) - Rs;
{d, s} ∈ {0, 1, …, 15}
imm ∈ {-128, -127, ..., 127}

Rev1+

111

Rs

00000

Rd

00010001

imm8

3

4

5

4

8

8

Description

Performs a subtraction and stores the result in destination register. Similar to sub, but the minu- end and subtrahend are interchanged.

Status Flags:

Format I: OP1 = Rs, OP2 = Rd

Format II: OP1 = SE(imm8), OP2 = Rs

Q:

Not affected

V:

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

N:

N = RES[31]

Z:

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

C:

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