LRUN(TP)

Files in a library may be extracted by (NU)LU or similar programs, e.g. LBREXT or DELBR. If those files are .COM files, they may be extracted by a special tool to load into TPA and execute them. Gary P. Novosielski wrote such a tool called LRUN.
Comparable with some CP/M debuggers, the executable file will be stored into memory where LRUN is currently loaded. Therefore LRUN consists of two modules:
  1. The main part. It checks for the requested files and fixes the remaining command line
  2. The loader part. It loads the executable into the TPA and invokes it
Invoke the tool by:
	LRUN [-<lbrname>] <command> [<parameters>]
LRUN opens the LBR file and searches for the COM command file. Then the remaining characters will be moved to the CP/M command line (at address 0080H) and the loader will be invoked. After loading the file into address 0100H successfully the loader jumps to it.
Find the source of LRUN here. It uses macros to build a bit map due to the relocatability of the loader.
The program was written for CP/M 2.x. Because CP/M 3.x supports RSX, I modified the original code. It is separated now into the main part and loader. Both parts access the definition file.

TURBO Pascal is a special case. It generates .COM files including the entire run time library (RTL) with a size of about 8kbytes. On the Joyce machine with a disk capacity of about 173kbytes this takes a lot of space. TURBO Pascal allows generating a .COM file as well as a .CHN file, where only program code will be stored without the RTL.
A modified version of LRUN allows the combination of the the RTL with a .CHN file. Every library (LBR) must contain the RTL1. As described above the modified version also consists of two parts. The procedure is more complexe because two files must be extracted and combined: the RTL must be loaded first followed by the CHN commad file (The name of the RTL must always be TURBORTL.COM). The sources include the main part as well as the loader.
1. Generating the RTL may be performed using a debugger (here for TURBO Pascal version 3.00A and SID)