System Debug Reference Manual (32650-90888)

Chapter 6 205
System Debug Command Specifications M-X
MAC[RO]
(MACVER), a help string (MACHELP), and a keyword string (MACKEY). See the MACLIST
command.
Reference counts are maintained for macros. Each time a macro is invoked, the reference
count for the macro is incremental. (Refer to the MACREF and MACLIST commands.)
Two special commands are provided to assist with the debugging and support of macros.
See the MACECHO and MACTRACE commands.
The entire set of currently defined macros can be saved into a binary file for later
restoration. (Refer to the STORE and RESTORE commands.)
Parameters
name
The name of the macro that is being defined. Names must begin with an
alphabetic character and are restricted to thirty-two (32) characters, that
must be alphanumeric, or "_", or " ' ", or "$". Longer names are truncated
(with a warning). Names are case insensitive.
All macros are functions that can be used as operands within expressions
to return a single value of a specified type.
A default macro return value can optionally be specified directly following
the macro name. The
return_type
must be preceded by a colon. The
default
return_value
must be preceded by an equal sign, and can be
entered as an expression. Below is a syntax of a macro call, followed by
examples:
macro
name
[:
return_type
] [=
return_value
]
For example:
macro getnextptr:s16 = -1 {body}
macro tblname = "UNDEF" {body}
macro tblsize:u32 = max * entrylen {body}
macro fmtstring:str {body}
If the default macro
return_value
is not specified, one is assigned
automatically, based on the type of the macro. The following table lists the
default
return_values
that are based on the macro's
return_type
:
Macro Return Type Default Return Value
BOOL FALSE
U16, S16, U32, S32, SPTR 0
LPTR 0.0
CPTR class 0.0 (based on type)
STR ' ' (null string)
By default, a macro is assigned the return value of 0 as a signed 32-bit
number.
(
parameters
) Macros can optionally have a maximum of five declared parameters.
Parameter definitions are declared within parentheses, separated by
blanks or commas.