EasyManuals Logo
Home>Texas Instruments>Calculator>TI-89

Texas Instruments TI-89 Software Guide

Texas Instruments TI-89
334 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #287 background imageLoading...
Page #287 background image
Section 3: Assembler
275
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
The
MEXIT
directive is typically used in conjunction with conditional assembly
directives to provide a conditional macro termination (see
IFcc
directive).
3.8.1.7. Macro Examples
The remainder of this section provides a series of examples that illustrate the
various features of the macro facility. Each example includes a macro definition
and one or more invocations of that macro. The
OPT MEX
directive is required to
show the macro expansion in the listing file.
The first example presents a macro that can be used to repeat an arbitrary
statement a specified number of times. It can be easily modified to accept any
number of statements, including invocations of other macros. Following the
macro definition is an example invocation and the assembler statements it
generates.
REP MACRO
IFEQ \2
MEXIT
ENDC
REP <\1>,?(\2-1)
\1
ENDM
OPT MEX
REP <MOVE.B (A0)+,(A1)+>,8
MOVE.B (A0)+,(A1)+
MOVE.B (A0)+,(A1)+
MOVE.B (A0)+,(A1)+
MOVE.B (A0)+,(A1)+
MOVE.B (A0)+,(A1)+
MOVE.B (A0)+,(A1)+
MOVE.B (A0)+,(A1)+
MOVE.B (A0)+,(A1)+
If the parameter evaluation operator ( ? ) is omitted from the above example, the
macro will produce the identical code; however, evaluation of the second
parameter will involve redundant computations (e.g., the second parameter
would be 8-1-1-1-1-1-1-1-1

instead of 0

on the final invocation).
The second example presents a macro that can be used to define sequences of
equate symbols; the value of each symbol is a function of its position in the
specified sequence. The definition of this macro is followed by a pair of example
invocations and their associated expansions.

Table of Contents

Other manuals for Texas Instruments TI-89

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-89 and is the answer not in the manual?

Texas Instruments TI-89 Specifications

General IconGeneral
Display size (HxV)100 x 160 mm
Memory type639K FLASH ROM, 188K bytes RAM
Compatible operating systemsOperating System 2.09
Battery typeAAA

Related product manuals