To invoke High Level Assembler from a running program, use the
CDLOAD and CALL macro instructions.
You
can supply assembler options in the CALL macro instruction as shown
in Figure 1Figure 1. Sample program to call the assembler
dynamically
DYNAMICV CSECT
DYNAMICV RMODE 24
DYNAMICV AMODE ANY
BEGIN SAVE (14,12)
USING BEGIN,15
ST 13,SAVEAREA+4
LA 13,SAVEAREA
CDLOAD ASMA90 1
LR 15,0
CALL (15),(OPTIONS) 2 3
CDDELETE ASMA90
L 13,SAVEAREA+4
RETURN (14,12)
SAVEAREA DS 18F
OPTIONS DC Y(OPTIONSL)
OPTS DC C'XREF(SHORT)'
OPTIONSL EQU *-OPTS
END
ASMA90 is the symbolic name of the assembler. The entry point
address is returned by CDLOAD in register 0.
2
(15) specifies that the entry point address is in register 15.
3
(OPTIONS) specifies the address of a variable-length list containing
the options. The address of an option list must be provided, even
if no options are required.
The option list must begin on a halfword
boundary. The first two bytes contain a count of the number of bytes
in the remainder of the list. If no options are specified, the count
must be zero. The option list is free form, with each field separated
from the next by a comma. No spaces should appear in the list, except
within the string specified for the EXIT or SYSPARM options providing
the string is enclosed within apostrophes.