LOAD Macro



Sometimes the CSECT, which needs to be located in memory, is not only independent, but also not executable. It may be that a program relies on a data only look-up table which is assembled separately for ease of maintenance. To fetch such modules into an address space the LOAD macro is provided, although it can also be used in conjunction with CALL, LINK and XCTL.

A module's Entry Point and Load Point may not be the same; the former being the address of the first instruction to be executed, and the latter the location of its first byte in memory.

Dynamic Linkage using the LOAD Macro.



When this macro is executed the Entry Point address is returned in General Purpose Register 0.

LOAD syntax



EP=

This provides the member name of the sub-routine by which it is stored in the Load Library.
(There is an EPLOC alternative but that is not discussed here.)

LOADPT=

This is optional and identifies, either by register name or an address constant name, where the Load Point address is to be stored.


The IBM manual includes descriptions of the LIST (MF=L) and EXECUTE (MF=E) formats which are useful for constructing re-entrant code.

Copyright © Legac-e Education 2004-