Keil Logo

System Variables

System variables allow accessing specific functions and can be used anywhere program variables or expressions can be used. The system variables are listed in the table below.

System Variable Type Description
$ unsigned long Represents the program counter. Use the $-sign to display and change the program counter. For example, $ = 0x4000 sets the program counter to the address 0x4000.
_break_ unsigned int Halts program execution when set to a non-zero value. Use this variable in debug functions to halt program execution.
_traps_ unsigned int Displays messages for the 166 hardware traps when set to a non-zero value. 166-Hardware traps: Undefined Opcode, Protected Instruction Fault, Illegal Word Operand Access, Illegal Instruction Access, Stack Underflow and Stack Overflow.
states unsigned long Displays the CPU instruction state counter value (32 bit). It starts counting from 0 and increments with each executed instruction.
states64 unsigned long long Displays the CPU instruction state counter value (64 bit). It starts counting from 0 and increments with each executed instruction.
seconds double Displays execution time in seconds. This variable is available for some devices.
radix unsigned int Displays and sets the output base for numeric values. radix can be 10 or 16. The default setting is 16 for HEX output. Change the output base by entering radix=10 in the Command window.
  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.