Invoking the assembler dynamically
You can invoke High Level Assembler from a running program using the CALL, LINK, XCTL, or ATTACH system macro instructions.
- The assembler options.
- The ddnames of the data sets to be used during processing.
- ASMA90
- The load module name and entry point to invoke the assembler. ASMA90 must be invoked in 31-bit addressing mode.
- EP
- Specifies the symbolic name of the assembler load module and entry point.
- PARAM
- Specifies, as a sublist, address parameters to be passed from
the program to the assembler. The first word in the address parameter
list (optionlist) contains the address of
the option list. The second word (ddnamelist)
contains the address of the ddname list.
- optionlist
- 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 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.
- ddnamelist
- Specifies
the address of a variable-length list containing alternative ddnames
for the data sets used during assembler processing. If standard ddnames
are used, this operand can be omitted. The ddname list must begin on a halfword boundary. The first two bytes contain the number of bytes in the remainder of the list. Each name of less than eight bytes must be left-aligned and padded to eight bytes with spaces. If an alternative ddname is omitted, the standard name is assumed. If the name is omitted within the list, the eight-byte entry must contain binary zeros. Names can be omitted from the end merely by shortening the list. The sequence of the eight-byte entries in the ddname list is as follows:
- Entry
- Alternative
- 1
- SYSLIN
- 2
- Not applicable
- 3
- Not applicable
- 4
- SYSLIB
- 5
- SYSIN
- 6
- SYSPRINT
- 7
- SYSPUNCH
- 8
- SYSUT1
- 9
- Not applicable
- 10
- Not applicable
- 11
- Not applicable
- 12
- SYSTERM
- 13
- Not applicable
- 14
- Not applicable
- 15
- Not applicable
- 16
- SYSADATA
- 17
- Not applicable
- 18
- Not applicable
- 19
- Not applicable
- 20
- ASMAOPT
Overriding ddname: Any overriding ddname specified when High Level Assembler was installed, occupies the corresponding position in the above list. The overriding ddname can also be overridden during invocation. For example, if SYSWORK1 replaced SYSUT1, it occupies position 8 in the above list. However, SYSWORK1 can be overridden by another name during invocation.
- VL
- specifies that the sign bit is to be set to 1 in the last word
of the parameter address list.
VL
must be specified for the CALL macro andVL=1
for the LINK or ATTACH macros.
DYNAMICM CSECT
DYNAMICM RMODE 24
DYNAMICM AMODE ANY
BEGIN SAVE (14,12)
USING BEGIN,15
ST 13,SAVEAREA+4
LA 13,SAVEAREA
CALL ASMA90,(OPTIONS),VL
L 13,SAVEAREA+4
RETURN (14,12)
SAVEAREA DS 18F
OPTIONS DC Y(OPTIONSL)
OPTS DC C'XREF(SHORT)'
OPTIONSL EQU *-OPTS
END