286
In the following example, the contents of DM 0010 through DM 0013 are copied
to SR 290 through SR 293, the contents of DM 0020 through DM 0023 are co-
pied to SR 294 through SR 297, and subroutine 010 is called and executed.
When the subroutine is completed, the contents of SR 294 through SR 297 are
copied back to DM 0020 to DM 0023.
MCRO(99) 010
DM 0010
DM 0020
SBN(92) 010
RET(93)
END(01)
Main program
Subroutine
Main program
Note 1. Subroutines for macros are programmed just like other subroutines, except
that SR 290 to SR 297 contents are transferred in from the designated input
and output words.
2. Not only external I/O words, but internal I/O words can be used for I1 and O1.
3. SR 290 to SR 297 can be used as work bits when not used for macro pro-
grams.
4. MCRO(99) instructions can be nested, but be sure to preserve I/O data
since the instructions use the same 8 I/O words (SR 290 to SR 297).
Precautions MCRO(99) can be used only for program sections that can be written using four
or fewer consecutive input words and/or four or fewer consecutive output words.
It is thus generally necessary to consider system and program design together
to take full advantage of macro programming.
Be careful that the input and output words properly correspond to the macro in-
put and output words.
Flags ER: A subroutine does not exist for the specified subroutine number.
An operand has exceeded a data area boundary.
Indirectly addressed DM word is non-existent. (Content of DM word is
not BCD, or the DM area boundary has been exceeded.)
A subroutine has called itself.
An active subroutine has been called.
Subroutines and Interrupt Control Section 5-23