5 adc, sbc, and mul – ARM VERSION 1.2 User Manual

Page 215

Advertising
background image

Thumb Instruction Reference

ARM DUI 0068B

Copyright © 2000, 2001 ARM Limited. All rights reserved.

5-21

5.2.5

ADC, SBC, and MUL

Add with carry, Subtract with carry, and Multiply.

Syntax

op Rd, Rm

where:

op

is one of

ADC

,

SBC

, or

MUL

.

Rd

is the destination register. It also contains the first operand.

Rm

is a register containing the second operand.

Usage

ADC

adds the values in

Rd

and

Rm

, together with the carry flag, and places the result in

Rd

.

Use this to synthesize multiword addition.

SBC

subtracts the value in

Rm

from the value in

Rd

, taking account of the carry flag, and

places the result in

Rd

. Use this to synthesize multiword subtraction.

MUL

multiplies the values in

Rd

and

Rm

, and places the result in

Rd

.

Restrictions

Rd

, and

Rm

, must be low registers (that is, in the range r0 to r7).

Condition flags

ADC

and

SBC

update the N, Z, C, and V flags.

MUL

updates the N and Z flags.

In ARM architecture version 4 and earlier,

MUL

corrupts the C and V flags. In ARM

architecture version 5 and later,

MUL

has no effect on the C and V flags.

Architectures

These instructions are available in all T variants of the ARM architecture.

Example

ADC r2,r4

Advertising