The following article appeared in the July 1985 MICROpendium and was written By DAVID R. ROMER
You can alter assembly language software so that it may be run out of your RAM chip enhanced Editor/Assembler cartridge (SUPERCART) as a powerup menu selection.
Using information in this article, in essence you will be able to create your own cartridge, containing your own programs, runnable at the press of a single key.
The basic steps to convert software for Supercart use are:
1. Move DEFinition statements to the beginning of the program.
2. Absolute ORGin the program at >6000
3. Substitute stand-alone routines for external REFerences to cartridge utilities.
4. Add the CARTRIDGE HEADER to the source code so the powerup routine will place your program on the menu screen.
To take a closer look at these steps let's examine the following example program called TEST. If you enter, assemble and load program TEST into your SUPER CART, selection 3 on the menu screen should say 'MENU TEST'. When 3's pressed, the screen will clear and the text "MENU TEST PROGRAM" will be displayed briefly, followed by a return to the color bar screen.

Line 1 is the usual DEF statement setting the entry point or points to the program. DEF statements do not have to be at the beginning of a program as long as they precede the first reference to the DEF label. However, since the first reference to the entry point in our SUPER CART software will be in the CARTRIDGE HEADER, line 13 in TEST, it will be necessary to place the DEF statement first in the program.
Any external REFerences to utility routines must be removed from the program. Since there is no CALL INIT sequence prior to executing the cartridge program, utilities such as VMBW, KSCAN, DSRLNK, etc., are not available to your SUPER CART program. In a third article I will describe a routine that will make the cartridge utilities available to your SUPER CART program. Likewise, a program originally written to run from Mini-Memory will reference those utilities through EQU statements. Those EQUates must be removed from the source code. Since we are not In the Mini-Memory environment these routines do not exist at the EQU addresses. If the utilities are required in your SUPER CART program then stand-alone routines must be added to the source code. In our example program lines 30 to 39 are a stand-alone Multiple Byte Write routine used to display the text line 16 on the screen.
The 8K RAM chip you added to your E/A cartridge uses memory addresses >6000 to >7FFF. While a cartridge program could be located anywhere within those addresses, the CARTRIDGE HEADER must start at
>6000. Since we are adding the HEADER to existing source code, an AORG >6000 statement, as in line 2 in TEST, will cause the LOADER program to place your program at that address so that it may be executed from the menu screen. All other AORG statements should be removed from the source code. Do not assume that DEF, REF, EQU and AORG statements occur only at the beginning of source code. You Can Save yourself some assembly time if you use the FIND function in the EDITOR to search all of the source code for occurrences of those statements.
Lines 3 to 13. in program TEST, make up the CARTRIDGE HEADER code that enables the powerup routine to include and execute your program from the menu screen. Lines 3 to 13 MUST load starting at >6000. The only source code statements that can precede the CARTRIDGE HEADER are DEF, AORG or EQU statements. In line 3 the value >AA will load at >6000 and tells the powerup routine that a valid cartridge is in the cartridge slot. The value >01 indicates that the cartridge contains executable machine code. Lines 4 and 5 set the next two memory words to 0. Line 6 can be any valid label and is a pointer to the first entry in the menu table.
Line 9 is the menu table entry pointed to by line 6. In program TEST it is set to 0 as there is only one entry point into TEST. If there were additional entry points or multiple programs, line 9 would point to the next menu item (e.g. MNULNK( DATA NXTLNK). The menu screen would appear to have room for seven or eight selections. Line 10 is a pointer to the start of the program. Line 11 is a byte value that is the length of the text to be displayed on the menu screen. Line 12 is the text to be displayed. Finally, line 13 is the Branch to the start of the program.
Once you have made these changes to your source code, assemble it, then load it Into your SUPER CART with Opt. 3 LOAD and RUN on the Editor/Assembler menu.
You may also load your SUPER CART from TI-BASIC with CALL INIT then CALL LOAD("DSK1.YOURPROG"). Press Function Quit to return to the color bar screen, press any key and your program should appear as selection 3 on the menu. For those of you who maybe using the Cor-Comp disk controller and SUPER CART with a program having multiple entry points, you will find that the Cor-Comp screen will display only the first entry in the menu table. However, pressing the space bar twice will display the TI screen that will show all of the menu selections you have added to your SUPER CART. The best part of it is that your program will still be there ready to go until either the battery quits or you change the program.
Those are the basic steps required to after software to run out of your SUPER CART. Some programs may require only the addition of the CARTRIDGE HEADER and others may
require extensive revision to substitute stand-alone utility routines. The possibilities are limited only to one's imagination, and 8K of memory. By the way, this article was written with a SUPER CART containing the TK-Writer loader for TI-Writer. The menu screen has five selections:
1. TI-BASIC
2. Editor/Assembler
3. 1K-Editor
4. TK-Fonnat
5. TIC-Utility
TX-Writer is a very easy conversion. You only have to add AORG >6000 and the CARTRIDGE HEADER.
|