Macro Invocation - Texas Instruments TI-89 Software Manual

Sierra c assembler
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

272
The header consists of the macro name label , the MACRO directive, and an
optional comment field. The terminator is the ENDM directive. The body is a
sequence of statements that are assembled each time the macro is invoked.
These statements can reference the formal parameters of the macro (see section
3.8.1.3 Parameters).
A macro can be referenced from within another macro definition prior to being
defined itself. Macros cannot be redefined, nor can they use the names of
instructions or directives.
3.8.1.2.

Macro Invocation

Following is the syntax for macro invocations:
Syntax
[ label ] macro [. qualifier ] [ parameter [, parameter ] . . .]
Description
label
macro
qualifier
parameter
When a macro is invoked, it generates assembler statements according to its
definition and actual parameters. These statements are treated as are any other
source statements. Any nested macros will be expanded when they are
encountered.
Once a macro is recognized, the specified actual parameters are saved. The first
specified parameter corresponds to formal parameter \1, the second corresponds
to \2, etc. Parameters are passed by name, not by value. Since the
parameter-passing mechanism is simply textual substitution, values of symbols
can be modified by the macro.
TI-89 / TI-92 Plus Sierra C Assembler Reference Manual
Specifies an optional label.
Specifies the name of the macro. It must have been previously
defined with the MACRO directive.
Specifies a size qualifier that is passed to the macro as parameter
\0.
Specifies symbols, constants, expressions, or any other text. The
maximum number of parameters allowed is 35. They are passed
to the macro as parameters \1, \2, \3, etc.
Not for Distribution
Section 3: Assembler
Beta Version February 2, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-89 plusTi-92 plus

Table of Contents