Keil™, An ARM® Company

µVision® User's Guide

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.

VariableTypeDescription
$unsigned longrepresents the program counter. You may use $ to display and change the program counter. For example, $ = 0x4000sets the program counter to address 0x4000.
_break_unsigned intlets 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 intwhen 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.
statesunsigned longcurrent 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.
secondsdoubleexecution time in seconds.

Note:

  • seconds is a read-only variable and is available only for some devices.
itraceunsigned intindicates 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.
radixunsigned intdetermines the base used for numeric values displayed. radix may be 10 or 16. The default setting is 16 for HEX output.