Intel XScale(R) technology topicImmediate Pre-indexed (AM 2)

Syntax

[basereg, #+/-value]!

where:

 basereg

Specifies a register containing the base address.

 value

Specifies the 12-bit immediate offset used with the value of basereg to form the address.

 !

Sets the W bit, which updates the base register.

Description

The addressing mode "immediate pre-indexed" performs the following operation (pseudo-code description):

if U == 1 then
  addr = basereg + value
else/* if U == 0 */
  addr = basereg - value
If ConditionPassed (condition) then
  basereg = addr

The value of the immediate offset is added to or subtracted from the value of the base register basereg . It is written back to the base register basereg if the condition specified in the instruction matches the condition code status.

This addressing mode is useful for pointer access to arrays with automatic update of the pointer value.

Encoding

31

 

 

28

27

26

25

24

23

22

21

20

19

 

 

16

 condition

 0

 1

 0

 1

 U

 B

 1

 L

 basereg

15

 

 

12

11

 

 

 

 

 

 

 

 

 

 

0

 dest

 value

The B bit indicates an unsigned byte ( B == 1 ) or a word access ( B == 0 ).

The L bit indicates a Load ( L == 1 ) or a Store ( L == 0 ) instruction.

Note

The syntax [basereg] must not be treated as an abbreviation for [basereg, #0]! .

Caution

If R15 is specified as register basereg , the results are unpredictable.

Example

LDR    R6, [R4, #-17]!

Further Information

See Addressing Mode 2: Load and Store Word or Unsigned Byte
See Assembler Instructions