System Debug Reference Manual (32650-90888)

28 Chapter2
User Interface
Literals
Literals
Literals represent specific values of one of the data types supported by System Debug. This
section explains how to construct and interpret literals.
Numeric Literals
Numeric literals are a sequence of digits that are valid in the indicated radix. If the digits
are not preceded by one of the base prefix characters, %, #, or $, the current input base is
assumed.
Examples of valid numeric literals are the following:
#2048
$fff
%1762
26
The type of a numeric literal is determined by the smallest amount of storage required to
store the value and by whether or not the literal is treated as being signed. The presence of
a preceding minus sign, which must always precede the base prefix character, does not
affect the sign of the literal. Such minus signs are treated as unary operators and are not
considered to be parts of literals.
Octal and hex literals are considered to be signed if the representation of the unsigned
digits fits into the natural word size of the current mode of System Debug (16 bits for CM,
32 bits for NM), and the high-order bit of the word is 1. Decimal literals are always
unsigned.
Examples:
$nmdebug > env outbase '#' /* set output base to decimal
#nmdebug > wl $ffffffff /* S32 - sign bit 1, NM word size
#-1
#nmdebug > wl $ffff /* U16 - sign bit 1, but not NM word size
#65535
#nmdebug > cm /* switch to CM
#cmdebug > wl $ffff /* S16 - sign bit 1, CM word size
#-1
#cmdebug > wl $ffffffff /* U32 - sign bit 1, but not CM word size
#4294967295
#cmdebug >
Pointer Literals
Short pointer literals are represented by numeric literals. Essentially, this means that
wherever a short pointer is required, a numeric literal that fits in 32 bits is accepted and is
silently converted to the type SPTR.