Last update: August 8th 2016

L99 - Linker 99

The L99 linker for the PC is part of the development environment of the TI994W emulator and can be found in the utility (TI994W/UTL/) directory.

L99 is a tagged object file linker for creating program files for the TI99 and Geneve home computer. L99 can be run on a PC and is based on the LingkingLoader (LL) program. With L99 it is possible to create TI99 or Geneve program files in binary format or V9T9 format.

Commands can be entered on the commandline or read from a linkerfile. Error messages are send to the console and to an errorfile if provided on the commandline.

Usage: L99 -Llinkerfile [-Eerrorfile] [-Mmapfile]


Example: L99 -Lmy_program.l99 -Emy_errors.err -Mmy_mapfile.map

L99 Commands

The following commands are recognized by the Linking Loader:


          .A   -Add name.

          Add defined name to DEF table at current loader address.

          Example:

              .A SLAST

          The name SLAST is added to the REF/DEF table and assigned the value of
          the current loader address.


.D -Delete name. The Delete command is useful to delete an existing name from the REF/DEF table to replace an internal routine for another one. The name must be erased in the REF/DEF table to avoid duplicate definition errors. Example: .D GPLLNK .L C:\TI99\TILIB\GPLLNK Delete GPLLNK from the REF/DEF table and load your own GPLLNK routine.
.L -Load object file. With the Load command it is possible to load an object file into the computers memory. Example: .L C:\TI99\TILIB\FILEIO
.P -Load program file. With the Load program command it is possible to load an program file with or without a V9T9 header into the computers memory. Example: .P C:\TI99\TILIB\EA-DEF.PGM .P- C:\TI99\TILIB\EA-DEF.PGM .P+ C:\TI99\PROGRAMS\SAMPLE The first two examples loads a program file EA-DEF.PGM that does not have a V9T9 header. The last example loads a program file SAMPLE that does have a V9T9 header. The V9T9 header is not loaded. The program file loaded MUST contain the default six byte program file header (flag, start address, size). All segments of a program file are loaded.
.N -Load defined names. With the load defined names command it is possible to only load the names of the modules REF/DEF table into the current REF/DEF table. This command can be used when creating paged programs (like the IDE DSR) and the memory locations of defined names (labels) of some module are needed . Example: .N .\OBJ\IDE-P01H.X Load the REF/DEF table of module IDE-P01H.X into the current REF/DEF table.
.H -Program file header on/off. With the Program file header command it is possible to toggle the generation of the six bytes TI99 program file header on or off (default is on). This command can be used to create a program file without a six byte (flag, start address, size) program file header. Example: .H- .H+
.T -TI file on. The TI file on command is used to let the linker create a TI99 file which is V9T9 compatible. Default a file without V9T9 header is created. Example: .T
.G -Geneve program file header. The Geneve program file header must be used when creating a program file for the Geneve (>0047 and >5047). Example: .G
.O -Origin addres. The Origin address command is used to define the origin (or start address) for the linker to load object code into the computers memory. This command can be used to switch between low (>2000) and high (>A000) memory for a TI99 program. The default origin address is >A000 for the TI99 and >0400 for Geneve. Example: .O >2000 .L C:\TI99\OBJ\LO_CODE .O >A000 .L C:\TI99\OBJ\HI_CODE
.V -Verbose on. The Verbose on command let the linker print information in the command window while excuting its task. Example: .V
.R -Display REF/DEF table. The Display REF/DEF table command let the linker print the REF/DEF table in the command window when the link task is finished. Example: .R
.S -Save as program file. The Save as program file command is used to create a program image file of all the modules currently loaded. To create a runable program a file name must be defined and label pair(s) must be defined with start and end location of the memory image to save. If the length of a memory image of a file is more than 8kb or the memory image defined by the other label pairs is saved the file name will be incremented by one. Example: .S C:\TI99\DSK1\PGM SFIRST SLAST LABEL1 LABEL2 .S C:\TI99\DSK1\PGM SFIRST SLAST >2020 >2700 A program image file is created out of all the loaded modules between the labels SFIRST and SLAST and LABEL1 to LABEL2 (example 1) or >2020 to >2700 (example 2). The file is named PGM. If a section of the program to be saved is more than 8kb long, the last character of the filename wil be incremented by one. If a label starts with the > character than the label will be considerd as a direct address.
.M -Save as module file. The Save as module file command is used when creating a module (or binary) file for the for the 8/16/32/64K cart, ubergrom or FlashRom99 card. To be able to creater a module file a program table must be defined and made accessable in the REF/DEF table. A program table consists of a bankid, program start address and a maximum of 4 entries consisting of a size and destination address. A prom program must have been loaded with the .L command and a programfile with the .P[+] command. The program table will be filled by the linker according to the loaded program file and a binary file will be saved containing all the data ready for a PROM to be used with a ROM/PROM/EPROM module cartridge. M and M- will create an inverted PROM image, while M+ will created a normal PROM image. The program table will be filled by the linker according to the loaded program file and a binary file will be saved containing all the data ready for a PROM to be used with a ROM/PROM/EPROM module cartridge. Example: .L .\..\obj\modheader.obj .P+ D:\Ti994w\develop\Dm2k_V25\DM2K .M .\DM2K.bin PRG2PG BLOB A module file DM2K.bin is created out of object file modheader.obj and program file DM2K. The program table name is PRG2PG and the start of the module is at memory location BLOB.
A ';' or a '*' character starts a line with comments.


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\CSUPTI_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
    .O >0400
    .L .\OBJ\DM2K0.x
    .L .\..\MYLIB\CSUP
    .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 .\..\MYLIB\MALLOC
    .L .\..\TILIB\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




[EOF]