set variable

This command evaluates an expression and assigns the result to a variable, register or memory.

Show/hideSyntax

set [variable] expression

Where:

expression

Specifies an expression and assigns the result to a variable, register or memory address.

Note

For formatted registers such as the CPSR you can set bit values symbolically using one or more flags in a string. For example:

set variable $CPSR="nzC"

Each flag modifies the corresponding bit in the register and leaves all the other bits unchanged. Flags are case sensitive:

  • A lowercase flag clears the corresponding bit

  • An uppercase flag sets the corresponding bit.

Show/hideExample

Example 110. set variable

set variable myVar=10                     # Assign 10 to variable myVar
set variable $PC=0x8000                   # Assign address 0x8000 to PC register
set variable $CPSR="nzC"                  # Clear N and Z bits, Set C bit
set variable $CPSR="SVC"                  # Change CPSR register to SVC mode
set variable (*(int*)0x8000)=1            # Assign 1 to address 0x8000
set variable *0x8000=1                    # Assign 1 to address 0x8000
set variable ((char*)0x8000)="My String"  # Assign string to address 0x8000
set variable ((int*)0x8000)={10,20,30,40} # Assign array to address 0x8000

Show/hideSee also

Copyright © 2010, 2011 ARM. All rights reserved.ARM DUI 0452D
Non-ConfidentialID011411