The LOAD macro brings the load module containing the specified entry name into virtual storage, if a usable copy is not available in virtual storage. Control is not passed to the load module; instead, the load module's entry point address is returned in GPR 0. Load services places the load module in storage above or below 16 megabytes depending on the RMODE of the module. The responsibility count for the load module is increased by one.
The load module remains in virtual storage until the responsibility count is reduced to 0 through task terminations or until the effects of all outstanding LOAD requests for the module have been canceled (using the DELETE macro described in z/OS MVS Programming: Assembler Services Reference ABE-HSP), and there is no other requirement for the module.
The requirements for the caller are:
Environmental factor | Requirement |
---|---|
Minimum authorization: | Problem state or supervisor state, and any PSW key. The GLOBAL, EOM, ADDR, ADDR64, ADRNAPF and ADRNAPF64 parameters are restricted to authorized users (APF authorized, PSW key 0-7, or supervisor state). |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN=HASN=SASN |
AMODE: | 24- or 31- or 64-bit |
ASC mode: | Primary |
Interrupt status: | Enabled for I/O and external interrupts |
Locks: | No locks held |
Control parameters: | Must be in the primary address space |
If you code any of the parameters LSEARCH, ADDR, ADRNAPF, GLOBAL, EOM, or LOADPT, you will obtain a macro-generated parameter list. Therefore, except for the error routine address, all addresses must be specified as A-type addresses or registers (2) - (12).
After the caller issues the macro, the system might use some registers as work registers or might change the contents of some registers. When the system returns control to the caller, the contents of these registers are not the same as they were before the macro was issued. Therefore, if the caller depends on these registers containing the same value before and after issuing the macro, the caller must save these registers before issuing the macro and restore them after the system returns control.
If the module's length value in doublewords is less than 16M (2**24) and the module does not have the RMODE(SPLIT) attribute, then the low-order three bytes contain the module length in doublewords.
If the module's length value in doublewords is greater than or equal to 16M (2**24), the low-order three bytes contain zeros. To obtain the module length, issue the CSVQUERY macro with the OUTLENGTH parameter.
If the module is a program object with the RMODE(SPLIT) attribute, the low-order three bytes contain zeros. To obtain the length and load point information for each segment, issue the CSVQUERY macro with the OUTXTLST parameter.
When the module is a program object, bound with FETCHOPT=NOPACK option, multiplying by eight the returned length value (to get the total number of bytes) always results in a multiple of one page (4096 bytes) (this is the full size of the area obtained with GETMAIN to hold the program object). If the program object is bound with FETCHOPT=PACK, the length value returned is the virtual storage size indicated in the directory entry. See z/OS MVS Program Management: User's Guide and Reference for further information.
When control returns to the caller or the ERRET exit receives control, the access registers (ARs) are unchanged.
None.
The LOAD macro is written as follows:
Syntax | Description |
---|---|
name | name: Symbol. Begin name in column 1. |
␢ | One or more blanks must precede LOAD. |
LOAD | |
␢ | One or more blanks must follow LOAD. |
EP=entry name | entry name: Symbol. |
EPLOC=entry name addr | entry name addr: RX-type address or register (0), (2) - (12); A-type |
DE=list entry addr | list entry address: If ADDR, ADRNAPF, EOM,EXTINFO, GLOBAL, LOADPT, or LSEARCH is specified, A-type address or register (2) - (12); otherwise, RX-type address, or register (2) - (12). |
,DCB=dcb addr | dcb address: If ADDR, ADRNAPF, EOM,EXTINFO, GLOBAL, LOADPT, or LSEARCH is specified, A-type address or register (2) - (12); otherwise, RX-type address, or register (1) or (2) - (12). |
,ERRET=err rtn addr | err rtn addr: RX-type address, or register (2) - (12). |
,LSEARCH=NO | Default: LSEARCH=NO |
,LSEARCH=YES | |
,ADDR=load addr | load addr: A-type address or register (2) - (12). |
,ADRNAPF=load addr | |
,ADDR64=load addr64 | load addr64: AD-type address or 64-bit register (2) - (12). |
,ADRNAPF64=load addr64 | |
,GLOBAL=YES | Default: GLOBAL=NO |
,GLOBAL=(YES,P) | If GLOBAL=YES is specified, the default is GLOBAL=(YES,P). |
,GLOBAL=(YES,F) | |
,GLOBAL=NO | |
,EOM=NO | Default: EOM=NO |
,EOM=YES | Note: GLOBAL must be specified with EOM=YES.
|
,LOADPT=addr | addr: A-type address or register (2) - (12). |
Note: ADDR(or ADDR64) and ADRNAPF(or
ADRNAPF64) cannot be specified with LOADPT or GLOBAL or EXTINFO.
|
|
,EXTINFO=addr | addr: A-type address or register (2) - (12). |
,RELATED=value | |
,PLISTVER=IMPLIED_VERSION | Default: PLISTVER=IMPLIED_VERSION |
,PLISTVER=MAX | |
,PLISTVER=1 | |
,PLISTVER=0 | |
The parameters are explained below:
If the DCB parameter is omitted or if DCB=0 is specified when the LOAD macro is issued by the job step task, the data sets referred to by either the STEPLIB or JOBLIB DD statement are first searched for the entry name. If the entry name is not found, the link library is searched.
If the DCB parameter is omitted or if DCB=0 is specified when the LOAD macro is issued by a subtask, the data sets associated with one or more data control blocks referred to by the TASKLIB operand of previous ATTACH macros in the subtask chain are first searched for the entry name. If the entry name is not found, the search is continued as if the LOAD had been issued by the job step task.
To code: Specify the RS-type address, or address in register (2)-(12), of a 4–byte field.
To code: Specify the AD-type address, or address in 64-bit register (2)-(12), of an 8-byte field.
For GLOBAL=(YES,F), the module must not be marked as requiring alignment on a page boundary. If you code the GLOBAL parameter, you cannot code the ADDR or ADRNAPF parameter.
If the requested module resides in the link pack area, the LOAD request performs as though the GLOBAL parameter was omitted. The LOAD request locates the module in the link pack area and allows access to it, but the request does not load a copy of the desired module into the common service area.
By using the EXTINFO keyword you can avoid the need to call CSVQUERY after doing the LOAD to obtain information that would not otherwise be returned by LOAD. For example, if a program object length were greater than 128 megabytes or had been bound with RMODE=SPLIT, LOAD would not otherwise return the length information.
If you can tolerate the size change, IBM recommends that you always specify PLISTVER=MAX on the list form of the macro. Specifying MAX ensures that the list-form parameter list is always long enough to hold all the parameters you might specify on the execute form, when both forms are assembled with the same level of the system. In this way, MAX ensures that the parameter list does not overwrite nearby storage.
When the LOAD macro returns control to the caller, GPR 15 is set to zero if the load request was successful.
If the load request was not successful and a caller-provided error routine (specified using the ERRET keyword) receives control, GPR 1 contains the system completion code for the ABEND that would have been issued had the caller not provided an ERRET exit. GPR 15 contains the reason code associated with the system completion code in GPR 1.
LOAD EP=PGMLKRUS
LDPGM LOAD EP=PGMEOM,EOM=YES,LOADPT=PGMLPT,GLOBAL=(YES,P)
.
.
.
PGMLPT DS A LOAD ADDRESS RETURNED HERE