3. Instructions
Related Auxiliary Area Words and Bits
Name
Macro area input words
Macro area output words
Function
MCRO(099) calls the subroutine with the specified subroutine number just like SBS(091). Unlike
SBS(091), MCRO(099) operands S and D can be used to change bit and word addresses in the
subroutine, although the structure of the subroutine is constant.
When MCRO(099) is executed, the contents of S through S+3 are copied to A600 through A603 (macro
area inputs) and the specified subroutine is executed. When the subroutine is completed, the contents
of A604 through A607 (macro area outputs) are copied to D through D+3 and program execution
continues with the next instruction after MCRO(099).
Hint
When MCRO(099) is executed, the specified input and output data is transferred to the specified
subroutine.
MCRO(099) can be used to consolidate two or more subroutines with the same structure but different
input and output addresses into a single subroutine program.
However, only subroutines that differ by address but are otherwise exactly the same can be
consolidated by a MCRO (macro) instruction.
Precautions
• The four words of input data (words or bits) in A600 to A603 and the four words of output data (words
or bits) in A604 to A607 must be used in the subroutine called by MCRO(099). It is not possible to
pass more than four words of data.
• It is possible to nest MCRO(099) instructions, but the data in the macro area input and output words
(A600 to A607) must be saved before calling another subroutine because all MCRO(099) instructions
use the same 8 words.
• When a MCRO instruction is used in an interrupt task, there is a possibility that the input words (A600
to A603C) and output words (A604 to A607CH) will be overwritten. For this reason, programming to
save the data is necessary.
692
Address
A600 to A603
When MCRO(099) is executed the four words from S to S+3 are copied to A600 to A603. These input
words are passed to the subroutine.
A604 to A607
After the subroutine specified in MCRO(099) has been executed, the output data in these output words
are copied to D to D+3.
MCRO(099)
Execution of
subrou-tine between
SBN(092) and
RET(093).
MCRO(099)
Operation
The subroutine uses A600 to
A603 as inputs and A604 to
A607 as outputs.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Need help?
Do you have a question about the CJ - REFERENCE MANUAL 02-2010 and is the answer not in the manual?