Link
Links to a memory module that has the specified name, language, and type
OS9 F$Link 103F 00
Entry Conditions
A
type/language byte
X
address of the module name (See the following example)
Exit Conditions
A
type/language code
B
attributes / revision level (if no error)
X
address of the last byte of the module name + 1 (See the following example)
Y
absolute address of the module’s execution entry point
U
module header absolute address
Error Output
CC
carry set on error
B
error code (if any)
Additional Information
- The module’s link count increases by one whenever Link references its name. Incrementing in this manner keeps track of how many processes are using the module.
- If the module requested is not shareable (not re-entrant), only one process can link to it at a time.
- Before the Link call:
T
E
S
T
$0D
^
T
E
S
T
$0D
^
- This is the order in which the Link call operates:
- NitrOS-9 searches the module directory for a module that has the specified name, language, and type.
- If NitrOS-9 finds the module, the address of the module’s header is returned in Register U and the absolute address of the module’s execution entry point is returned in Register Y. (This, and other information, is contained in the module header.)
- If NitrOS-9 does not find the module or if the type/language codes in the entry and exit conditions do not math, NitrOS-9 returns one of the following errors:
- Module not found
- Module busy (not shareable and in use)
- Incorrect or defective module header
krn