System Debug Reference Manual (32650-90888)

Chapter 10 461
System Debug Standard Functions
func symaddr
NOTE
The C
n
directive is ignored by the ASC function but is honored by the W, WL
and WP commands.
Examples
$nmdat > var save = strwrite('1 2 3 "-->" 4:"z w4 r z" 5')
$nmdat > wl save
$1$2$3-->0004$5
The string variable save is used to store the function return value. STRWRITE is equivalent
to the W(WRITE) command, but the formatted output is returned in a string.
Note the single quotes which surround the value list. These turn the value list into a
string. Double quotes are then used to form individual string values and format
specifications.
STRWRITE is similar to the ASC function. The major difference is that ASC accepts a single
expression with an optional format specification:
wl ASC(1+2, "w4")
while STRWRITE accepts a list of expressions, each with optional formatting:
var title = strwrite('"Current Pin:" pin:"w4", " PC:", pc')
Limitations, Restrictions
none
func symaddr
Returns the bit- or byte-relative offset of a component specified through the path
specification, relative to the outer structure.
Syntax
symaddr (
pathspec
[
units
])
Formal Declaration
symaddr:u32 (
pathspec
:str [
units
:u16=8])
Parameters
pathspec
A path specification, as described in chapter 5, "Symbolic
Formatting/Symbolic Access."
units
Specifies the units (that is, bit width) in which the result is given. 1 means