Keil Logo

System Variables

System variables allow access to specific functions and may be used anywhere a program variable or other expression is used. The following table lists the available system variables, the data types, and their uses.

Variable Type Description
$ unsigned long represents the program counter. You may use $ to display and change the program counter. For example, $ = 0x4000sets the program counter to address 0x4000.
_break_ unsigned int lets you stop executing the target program. When you set _break_ to a non-zero value, µVision3 halts target program execution. You may use this variable in user and signal functions to halt program execution.
_traps_ unsigned int when you set _traps_ to a non-zero value, µVision3 display messages for the 166 hardware traps: Undefined Opcode, Protected Instruction Fault, Illegal Word Operand Access, Illegal Instruction Access, Stack Underflow and Stack Overflow.
states unsigned long current value of the CPU instruction state counter; starts counting from 0 when your target program begins execution and increases for each instruction that is executed.

Note:

  • states is a read-only variable.
seconds double execution time in seconds.

Note:

  • seconds is a read-only variable and is available only for some devices.
itrace unsigned int indicates whether or not trace recording is performed during target program execution. When itrace is 0, no trace recording is performed. When itrace has a non-zero value, trace information is recorded. Refer to Trace Recording for more information.
radix unsigned int determines the base used for numeric values displayed. radix may be 10 or 16. The default setting is 16 for HEX output.
  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.