
Thumb Instruction Reference
ARM DUI 0068B
Copyright © 2000, 2001 ARM Limited. All rights reserved.
5-19
5.2.3
ADD and SUB, sp
Increment or decrement sp by an immediate constant.
Syntax
ADD sp, #
expr
SUB sp, #
expr
where:
expr
is an expression that evaluates (at assembly time) to a multiple of 4 in the
range –508 to +508.
Usage
This instruction adds the value of
expr
to the value from
Rp
, and places the result in
Rd
.
Note
An
ADD
instruction with a negative value for
expr
assembles to the corresponding
SUB
instruction with a positive constant. A
SUB
instruction with a negative value for
expr
assembles to the corresponding
ADD
instruction with a positive constant.
Be aware of this when looking at disassembly listings.
Condition flags
This instruction does not affect the flags.
Architectures
This instruction is available in all T variants of the ARM architecture.
Examples
ADD sp,#312
SUB sp,#96
SUB sp,#abc+8 ; abc + 8 must evaluate at assembly time to
; a multiple of 4 in the range –508 to +508
Содержание Developer Suite
Страница 10: ...Preface x Copyright 2000 2001 ARM Limited All rights reserved ARM DUI 0068B ...
Страница 110: ...Assembler Reference 3 32 Copyright 2000 2001 ARM Limited All rights reserved ARM DUI 0068B ...
Страница 185: ...ARM Instruction Reference ARM DUI 0068B Copyright 2000 2001 ARM Limited All rights reserved 4 75 Example MSR CPSR_f r5 ...
Страница 238: ...Thumb Instruction Reference 5 44 Copyright 2000 2001 ARM Limited All rights reserved ARM DUI 0068B ...
Страница 282: ...Vector Floating point Programming 6 44 Copyright 2000 2001 ARM Limited All rights reserved ARM DUI 0068B ...
Страница 360: ...Index Index 6 Copyright 2000 2001 ARM Limited All rights reserved ARM DUI 0068B ...