Keil Logo

STAV Instruction

The STAV instruction stores the contents of a specified register into a local variable or function argument.

STAV Rd, Rn, var

Where

Rd Is the register that contains the value to store in var.
Rn Is 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.
var Is the name of the variable.

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

  • When var is located in a register (Rv), the following code is generated for STAV:
    MOV Rv,Rd
    
  • 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 STAV:
    STR 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 STAV:
    LDR Rn,#(displacement of var)
    ADD Rn,R13
    STR Rd,[Rn]
    

Note

  • The STAV instruction is not an ARM or Thumb instruction. It is only supported by the inline assembler in the CARM Compiler.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.