Individual Instruction Descriptions

4.14.81 SUBB

 

Subtract Byte

 

 

 

 

Syntax

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[label]

 

name

 

dest, src

Clock, clk

Word, w

With RPT, clk

Class

 

 

 

 

 

 

 

 

 

 

 

 

 

SUBB

 

An, imm8

1

1

N/R

2a

 

 

 

 

 

 

 

 

 

 

 

 

 

SUBB

 

Rx, imm8

1

1

N/R

4b

Execution

dest dest imm8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PC PC + 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Flags Affected

dest is An:

 

 

 

OF, SF, ZF, CF are set accordingly

 

 

 

 

 

dest is Rx:

 

 

 

RCF, RZF are set accordingly

 

 

 

 

 

Opcode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instructions

 

16

 

15

14

13

12

11

10

9

 

8

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUBB An imm8

 

1

 

0

1

0

0

1

0

An

 

 

 

 

imm8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUBB Rx, imm8

 

1

 

0

1

1

0

1

k4

k3

k2

k7

k6

k5

 

Rx

 

k1

k0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Description

Subtract value of src byte from value of dest byte and store result in dest. Note

 

that subtraction is performed in 2’s complement and therefore the CF (carry

 

flag) may get set even when subtracting a smaller value from a larger value.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Syntax

 

 

Description

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUBB An, imm8

 

 

Subtract immediate byte from An

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUBB Rx, imm8

 

 

Subtract immediate byte from Rx

 

 

 

 

 

 

 

 

 

Example 4.14.81.1

SUBB A2, 0x45

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Subtract 0x45 from accumulator A2 byte.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Example 4.14.81.2

SUBB R3, 0xF2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Subtract 0xF2 from register R3 byte.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4-178

Page 264
Image 264
Texas Instruments MSP50C6xx Subb Subtract Byte, Subtract 0x45 from accumulator A2 byte, Syntax Description Subb a n, imm8