GECALL 18 - load/call a system program or overlay.

Usage:

mme     gecall
bci     1,PROGRAM
zero    LOCATION,ERR_RET
zero    ADDRESS

Where:

PROGRAM
is 1-6 BCD characters giving the name of the program you want to call.
LOCATION
is the address where the program should be loaded. If this is zero, the values written into the DCW by MME GESAVE will be used instead.
ERR_RET
is the address of a routine that should be invoked if MME GECALL encounters an error (e.g. PROGRAM was not the name of a valid program). If this field is zero, the program will be aborted if an error occurs. A call to MME GECALL automatically zeroes this field to avoid looping; therefore, if you want to use this same instruction sequence to call MME GECALL again, you must rewrite this part of the GECALL sequence.
ADDRESS
is the address to which MME GECALL should return. If this is non-zero, control will be returned to the specified address, otherwise control will be transferred to the entry point of the loaded program.

On entry

Q register
A $PRIVITY program can load a system module by specifying the special name `000000` for PROGRAM, and putting the module number in bits 0-17 of the Q register.

Description:

MME GECALL loadss a program or overlay into the current program's address space. MME GECALL first looks for a GECALL qstar file with file code **; if the named module is found there it is loaded. Otherwise, loads the system edited program. Normally, "loading" just involves finding and reading the module. However, if the module was built "relocatable", relocation will be applied. Patches will also be applied if there is an Extension-Editor patch file (file code E*) present, and either switch bit 1 or switch 16 is set.

By specifying the appropriate load LOCATION, the new program may overlay some or all of the current program's space.

Since the new program may overlay much of the old program's space, MME GECALL does not return in the normal way. It returns to ADDRESS if one is specified; if not, it just invokes the new program.

Typically, the new program will not return to the old program; in many cases, the old program will have been overwritten anyway.

If MME GECALL returns to ADDRESS, the following values will be set.

A register
The loading origin (LOCATION) will be in bits 0-17. The number of words loaded will be in bits 18-35.
Q register
The ADDRESS will be in bits 0-17. Bits 18-35 are not used.

If an error occurs, MME GECALL will return to the address specified by ERR_RET. Bits 18-35 of the Q register will contain an integer value giving the cause of the error. Below we list the possible values and the associated causes.

52   I/O limits error
53   I/O error
54   No PAT for call file
55   Bad device call
56   Non-random GECALL file
60   Call checksum
63   Call name missing
64   Call out of file span
65   Improper call

Notes:

GCOS8 starts a starts a single segment activity by building a MME GECALL sequence in the prefix at .XMME1 (032) and transferring control.

MME GECALL should not be used during a courtesy call.

If the CHKSUM option is present on the start-up $INFO statement, GECALL will verify checksums when loading a program. Otherwise, checksums are not verified.

See Also:

expl mme gerstr
to read a module from a specified file code.
expl mme gesave
expl drl drlsav
for the usual method of writing a loadable module.

Copyright © 2000, Thinkage Ltd.