Examples
Below you will find some examples for link source files for creating different
kind of programs or modules. The extension for link source files is by default
.L99.
Example 1
Creating a program file for the TI99 like DM2K or DU2K. The program file can
consists of a few segments in high memory (>A000) and one (ore more)
segment(s) in low memory (>2000).
In the example below the program file EA-DEF.PGM contains all the default TI99
functions in low memory like VSBW, VMBW, VSBR, VMBW, DSRLNK etc. The object file
EA-DEF.OBJ only contains the names of all these default functions and their
(fixed) addresses in low memory.
Next, all object files are loaded and undefined references are solved by the
linker L99. References to files to load can be relative (.\..\DIR\FILE) or fixed
(C:\DIR\DIR\HERE\FILE)
The TI file on (.T) command tells the linker that I want V9T9 compatible files.
Finally the save command (.S) creates the program file (here DM2K). The last
character of the file name is incremented automatically by the linker if a
segment size is larger than 8Kb or lays in another memory segment. When using
labels for the save command these must have been solved by the linker.
|
.P .\..\TILIB\EA-DEF.PGM
.L .\..\TILIB\EA-DEF.OBJ
.L .\OBJ\DM2K0.x
.L .\OBJ\CSUPMYTI_V7.x
.L .\..\TILIB\SPRINTF
.L .\..\DU2K\OBJ\L2FIO.x
.L .\..\DU2K\OBJ\FNCARG.x
.L .\OBJ\DM2K1.x
.L .\OBJ\DM2K2.x
.L .\OBJ\DM2K7.x
.L .\OBJ\DM2K3.x
.L .\..\TILIB\MISC
.L .\..\TILIB\L3FIO
.L .\OBJ\DM2K5.x
.L .\OBJ\DM2K6.x
.L .\OBJ\DM2K4.x
.T
.S .\DM2K DM2K SLAST >2000 FILESL
|
Example 2
Creating a program file for the Geneve that runs in MDOS like GDM2K. The program
file can consists of a few segments starting at >0400.
In the example below the linker is first switched to Geneve mode with the .G
command and the origin is set at >0400 with the .O command. Next, all
necessary object files and library files are loaded that make up the
program.
The TI file on (.T) command tells the linker that I want V9T9 compatible files.
Finally the save command (.S) creates the program file (here GDM2K). The last
character of the file name is incremented automatically by the linker if a
segment size is larger than 8Kb. A Geneve program file is completely in the same
memory segment (as far as I know) and in this example lays between the labels
DM2K (@ >0400) and SLAST.
|
.G
.Z >3F00
.O >0400
.L .\OBJ\DM2K0.x
.L .\..\MYLIB\CSUPMY_V6.x
.L .\..\TILIB\CGLOB
.L .\..\TILIB\SPRINTF
.L .\OBJ\L3FIOG.x
.L .\..\DU2K\OBJ\FNCARG.x
.L .\OBJ\DM2K1.x
.L .\OBJ\DM2K2.x
.L .\OBJ\DM2K3.x
.L .\..\TILIB\MISC
.L .\OBJ\DM2K4.x
.L .\OBJ\DM2K5.x
.L .\OBJ\DM2K6.x
.L .\OBJ\DM2K7.x
.L .\..\MYLIB\MALLOC
.A SLAST
.T
.S .\GDM2K DM2K SLAST
|
Example 3
Creating a binary file for an (E)PROM for some module like Editor/Assembler II.
In the example below four linker files are given for a module with four pages.
First the object file is loaded which is assembled with an absolute origin of
>6000. The maximum size of a page for a module is 8Kb or >2000 and resides
between the addresses >6000 and >8000. The default program file header is
switched of with the .H- command because a binary file for an (E)PROM does
absolutely not need a program file header.
Bank three, which is actually the first bank, also loads and solves all names
of the REF/DEF table of all the other pages.
Finally the save command (.S) creates the binary file (here EAPROM_B1.BIN -
EAPROM_B3.BIN) which lays between the label BANK0 (or BANK1, BANK2, BANK3) and
the address >8000.
|
.L .\OBJ\EAPROM_B0.x
.H-
.S .\EAPROM_B0.BIN BANK0 >8000
.L .\OBJ\EAPROM_B1.x
.H-
.S .\EAPROM_B1.BIN BANK1 >8000
.L .\OBJ\EAPROM_B2.x
.H-
.S .\EAPROM_B2.BIN BANK2 >8000
.N .\OBJ\EAPROM_B0.X
.N .\OBJ\EAPROM_B1.X
.N .\OBJ\EAPROM_B2.X
.L .\OBJ\EAPROM_B3.x
.H-
.S .\EAPROM_B3.BIN BANK3 >8000
|
Example 4
Creating a page file for a DSR like the IDE DSR.
The IDE DSR consists of a ROOT module between >4000 and >5000 containing
all kind of general functions for reading and writing sectors etc. and a few
pages between >5000 and >6000 with all the file handling functions.
In the example below the link file is given voor the ROOT module.
The ROOT module of the DSR is dependant of the clock chip used. It also need
to know all the entry addresses of the file IO functions in the other pages.
The are loaded and solved by the linker with the .N command.
The TI file on (.T) command tells the linker that I want V9T9 compatible files.
Finally the save command (.S) creates the program file (here IDE-P00L) which code
appearently resides between the labels SP00L (Start Page 00 Low) and EP00L (End
Page 00 Low). Because it is a paged DSR the file must be smaller than 4Kb
(>1000) which is checked by the loader program IDELOAD in tis case. The file
also contains the default TI99 program file header because this is also needed
by the loader program IDELOAD to determine the start address end the length of
this segment.
|
;* Link file for page 0 low
;* ------------------------
.L .\OBJ\IDE-P00L-BQ4847.X
.N .\OBJ\IDE-P00H.X
.N .\OBJ\IDE-P01H.X
.N .\OBJ\IDE-P02H.X
.N .\OBJ\IDE-P03H.X
.N .\OBJ\IDE-P04H.X
.N .\OBJ\IDE-P05H.X
.T
.S .\IDE-P00L SP00L EP00L
|