Thumb Instruction Reference
5-20
Copyright © 2000, 2001 ARM Limited. All rights reserved.
ARM DUI 0068B
5.2.4
ADD, pc or sp relative
Add an immediate constant to the value from sp or pc, and place the result into a low
register.
Syntax
ADD
Rd
,
Rp
, #
expr
where:
Rd
is the destination register.
Rd
must be in the range
r0
-
r7
.
Rp
is either
sp
or
pc
.
expr
is an expression that evaluates (at assembly time) to a multiple of 4 in the
range 0-1020.
Usage
This instruction adds the value of
expr
to the value from
Rp
, and places the result in
Rd
.
Note
If
Rp
is the pc, the value used is:
(the address of the current instr 4) AND
&FFFFFFFC
.
Condition flags
This instruction does not affect the flags.
Architectures
This instruction is available in all T variants of the ARM architecture.
Examples
ADD r6,sp,#64
ADD r2,pc,#980
ADD r0,pc,#lit-{PC} ; lit - {PC} must evaluate, at assembly
; time, to a multiple of 4 in the range
; 0 to 1020
Содержание 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 ...