CARM User's Guide

Discontinued

LDAV Instruction

The LDAV instruction loads the value of a local variable or function argument into the specified register.

LDAV Rd, Rn, var

Where

RdIs the register that is loaded with the contents of var.
RnIs a temporary register that is used as a base pointer for stack-based variable addressing. Rd and Rn must be distinct. They may not be the same register.
varIs the name of the variable.

The LDAV instruction generates different code depending on the location of var.

  • When var is located in a register (Rv), the following code is generated for LDAV:
    MOV Rd,Rv
    
  • When var is located on the stack and its displacement is within the range of ARM or Thumb instructions, the following code is generated for LDAV:
    LDR Rd,[R13,#(displacement of var)]
    
  • When var is located on the stack but its displacement is outside the range of ARM or Thumb instructions, the following code is generated for LDAV:
    LDR Rn,#(displacement of var)
    ADD Rn,R13
    LDR Rd,[Rn]
    

Note

  • The LDAV instruction is not an ARM or Thumb instruction. It is only supported by the inline assembler in the CARM Compiler.