Subb – Texas Instruments TMS320C2XX User Manual

Page 332

Advertising
background image

Subtract From Accumulator With Borrow

SUBB

7-179

Assembly Language Instructions

Cycles for a Repeat (RPT) Execution of an SUBB Instruction

Program

Operand

ROM

DARAM

SARAM

External

DARAM

n

n

n

n+p

SARAM

n

n

n, n+1

n+p

External

n+nd

n+nd

n+nd

n+1+p+nd

† If the operand and the code are in the same SARAM block

Example 1

SUBB

DAT5

;(DP = 8: addresses 0400h–047Fh)

Before Instruction

After Instruction

Data Memory

Data Memory

405h

06h

405h

06h

ACC

0

06h

ACC

0

0FFFFFFFFh

C

C

Example 2

SUBB

*

Before Instruction

After Instruction

ARP

6

ARP

6

AR6

301h

AR6

301h

Data Memory

Data Memory

301h

02h

301h

02h

ACC

1

04h

ACC

1

02h

C

C

In the first example, C is originally zeroed, presumably from the result of a pre-
vious subtract instruction that performed a borrow. The effective operation per-
formed was 6 – 6 – (0–) = –1, generating another borrow (resetting carry) in
the process. In the second example, no borrow was previously generated (C
= 1), and the result from the subtract instruction does not generate a borrow.

Advertising