User`s guide
BDOS FUNCTION 59: LOAD OVERLAY
Entry Parameters:
Registers C: 3BH
DE: FCB Address
Returned Value:
Registers A: Error Code
H: Physical Error
Only transient programs with an RSX header can use the Load Overlay function
because BDOS Function 59 is supported by the LOADER module. The calling pro-
gram must have a header to force the LOADER to remain resident after the program
is loaded (see Section 1.3).
Function 59 loads either an absolute or relocatable module. Relocatable modules
are identified by a filetype of PRL. Function 59 does not call the loaded module.
The referenced FCB must be successfully opened before Function 59 is called. The
load address is specified in the first two random record bytes of the FCB, rO and rl.
The LOADER returns an error if the load address is less than 100H, or if performing
the requested load operation would overlay the LOADER, or any other Resident
System Extensions that have been previously loaded.
When loading relocatable files, the LOADER requires enough room at the load ad-
dress for the complete PRL file including the header and bit map (see Appendix B).
Otherwise an error is returned. Function 59 also returns an error on PRL file load
requests if the specified load address is not on a page boundary.
Upon return, Function 59 sets register A to zero if the load operation is successful.
If the LOADER RSX is not resident in memory because the calling program did not
have a RSX header, the BDOS returns with register A set to OFFH and register H set
to zero. If the LOADER detects an invalid load address, or if insufficient memory is
available to load the overlay, Function 59 returns with register A set to OFEH. All
other error returns are consistent with the error codes returned by BDOS Function
20, Read Sequential.
3-73
BDOS Function Calls CP/M 3 Programmers Guide