Appendix - C - Gram Kracker Memory Map NOTE: TI Groms are only 6K in size but they reside on 8K boundaries. The data in the last 2K of each Gram is only garbage and it may be written over with your own code. +------------Console Grom/Grams-------------+ Gram 0 g0000 | TI Operating System to g17FF 6K | | | g1FFF | g1800-1FFF - not used 2K | +-------------------------------------------+ Gram 1 g2000 | TI Basic to 937FF (Loader Off) 6K | | Loader On - Internal GK Software | | (g2000-3FFF 8K) | g3FFF | g3800-3FFF - not used 2K | +-------------------------------------------+ Gram 2 g4000 | TI Basic to g57FF 6K | | | g5FFF | g5800-5FFF - not used 2K | +-------------------------------------------+ +-----------Cartridge Grom/Gram------------+ Gram 3 g6000 | 6K | | | g7FFF | g7800-7FFF - not used 2K | +-------------------------------------------+ Gram 4 g8000 | 6K | | | g9FFF | g9800-9FFF - not used 2K | +-------------------------------------------+ Gram 5 gA000 | 6K | | | gBFFF | gB800-BFFF - not used 2K | +-------------------------------------------+ Gram 6 gC000 | 6K | | | gDFFF | gD800-DFFF - not used 2K | +-------------------------------------------+ Gram 7 gE000 | 6K | | | gFFFF | gF800-FFFF - not used 2K | +-------------------------------------------+ Appendix - C - Gram gracker Ke'ory Map Continued +----------Cartridge Rom/Ram----------------+ Bank 1 c6000 | Switch in Bank 1 position 8K | | | c7FFF +-------------------------------------------+ +-------------------------------------------+ Bank 2 c6000 | Switch in Bank 2 position 8K | | | c7FFF | | +-------------------------------------------+ NOTE: The Cartridge Rom/Ram space in the Gram Kracker resides in CPU Memory and it is actually two different 8K chips that reside in the same address space at different times. With the Write Protect ON a piece of software can write to: c6000, c6004, c6008 etc. to select Bank 1 c6002, c6006, c600A etc. to select Bank 2 This is how Extended Basic bank swaps the upper 4K (c7000-7FFF) to get 12K out of an 8K space. This is also how the Atari modules do bank swapping to get 16K out of an 8K space. To see this work, load Extended Basic into the Gram Kracker. Next select 5 Memory Editor from the Gram Kracker menu. Type in c6FF0 for the Memory address and press FCTN = for Hex. Press FCTN 9 to put the cursor in the Memory Window, make sure Write Protection is ON and press and hold down the 1 key. As the cursor moves across the screen you will see the address space from c7000 to c7FFF swap banks. In reality the entire 8K block is switching banks but the first 4K (e6000 c6FFF) is the same in both banks. This gives the appearance that the last 4K is bank switching and simulates the 12K of Rom in the Extended Basic module. If you load a 16K Atari module, such as Pole Position, you will notice that the entire 8K swaps banks, except for the Atari header. Appendix - D - Standard Grom/Gram, Cartridge Rom/Ram and Peripheral DSR Header Grom/Gram Base Addresses = g0000, g2000, g4000, g6000 g8000, gA000, gC000, gE000 For the proper address below replace x with 0, 2, 4, 6, 8, A, C or E depending the Grom/Gram, Rom/Ram referenced (i.e. g6000, g6001 etc.) 8x000 - >AA Valid Grom/Gram Header Identification Code. Without >AA as the first byte in the Grom/Gram Base address, the header WILL NOT be recognized by the Operating System. 8x001 - >00 - >FF Version Number - NOTE: Negative version numbers (greater than >7F) designate foreign language version and/or Auto Start. Foreign Language Auto Start starts execution at g6013. Also, some of the Gram Kracker utilities reserve version numbers >55 thru >65 for their own use. gx002 - >00 Number of Application Programs - not used gx003 - >00 Reserved by TI - not used gx004 - >0000 Address of Power Up Header gx006 - >0000 Address of Application Program Header gx008 - >0000 Address of Cartridge DSR Routine Header gx00A - >0000 Address of Subprogram Header NOTE: Subprograms are CALL-able from either TI Basic or Extended Basic. gx00C - >0000 Address of Interrupt Header - none in Grom/Gram or Cartridge Rom/Ram - this is here to keep a uniform header type between Cartridges and DSRs. gx00E - >0000 Reserved by TI - not used Example: These are the header(s) from the Terminal Emulator II module. NOTE: there are approximately 3 different versions of the TE II module. Your version may not exactly match the version listed below. g6000 - >AA Validation Byte g6001 - >01 Version Number g6002 - >00 Number of Application Prgs (there are 2) g6003 - >00 Reserved g6004 - g6020 Address of Power Up header g6006 - g6053 Application Program Header g6008 - g6024 DSR Header g600A - g0000 No Subprogram Headers g600C - g0000 No Interrupt Routine Header g600E - g0000 Reserved Power Up Header g6020 - g0000 Pointer to next Power Up Header - no more g6022 - g606C Start address of this Power Up Routine DSR Header 86024 - g602F Pointer to next DSR Header 86026 - g609A Start address of this DSR Routine 86028 - >06 Length of this DSRs Name 86029 - text SPEECH g602F - 80000 Pointer to next DSR Header - no more 86031 - g60BD Start address of this DSR Routine 86033 - >06 Length of this DSRs Name 86034 - text ALPHON Application Program Header (for menu screen) g6053 - g603A Pointer to next Application Program Header g6055 - 86267 Start address for this menu selection g6057 - >14 Menu name length (20 chars) g6058 text DEFAULT OPTION TE II g603A - 80000 Pointer to next Application Prg - no more g603C - 86292 Start address for this menu selection g603E - >14 Menu name length (20 chars) g603F text TERMINAL EMULATOR II Appendix - E - Adding A Header to Auto Execute Modules The example listed below is from the Plato Interpreter module. However, it also applies to many of the other Auto Start modules. 1. Load the module into the Gram Kracker and then select 5 Edit Memory from the Gram Kracker menu. 2. Press FCTN 1 for Gram and FCTN = for Hex. Then Press FCTN 9 to put the cursor in the memory window. Turn off Write Protection (enable Bank 1). 3. Change the byte at g6001 from FF or 81 to 01. Move the cursor over to g6006 and type in 7801. NOTE: The Corcomp card will not recognize 7800 for an Application Program Header. It sees the 00 in the least significant byte as meaning there are no Application Programs here, it does not check the most significant byte. 4. Press FCTN 9 and change the address to g7801 and then press FCTN 9 again. Now type in 00 00 60 13. (g6013 is the default start address for Auto Execute modules that start up on the Foreign Language check.) 5. Next determine the length of the name that you want to put to the menu and type it in (in Hex). After the length is typed in press FCTN = for ASCII and type in the name. Example: for "PLATO" your entry at g7801 should be, 00 00 60 13 05 50 4C 41 54 4F (in Hex) . . ' . . P L A T 0 (in ASCII) 6. Turn on Write Protection, and press CTRL = to leave the editor. Press RESET and check the menu to make sure the name is right. If everything is OK go back into the Gram Kracker and resave your modified module. If it's not go back into the editor and check the areas that were edited (g6001, g6006 and g7801). Appendix - F - Difference between Basic and XB Subprogram Headers Examples: TI Basic Subprogram Header for CALL CLEAR g4D24 - g4D2E Pointer to next Subprogram Header g4D26 - g351C Start address of this routine g4D28 - >05 Length of this name g4D29 - text CLEAR Extended Basic Subprogram Header for CALL CLEAR gA030 - gA03A Pointer to next Subprogram Header gA032 - >05 Length of this name gA033 text CLEAR gA038 - gA9F8 Start address of this routine The location of the Start Address word in these these two header types is what keeps TI basic from accessing Extended Basic subprograms when the XB cartridge is plugged in and you are in TI Basic. This will also keep Extended Basic from accessing other modules CALLS that have been set up ONLY for Basic. TI made the Extended Basic an independent module. When you are in the Command or Edit mode of Extended Basic and you type in CALL FILES, which has a TI Basic type header, it goes thru a console Grom 0 routine at >10 called LINK to go out to the Disk Controller which allows it to recognize a Basic type header. When you are in RUN mode Extended Basic DOES NOT go through the Grom 0 >10 routine, this is why CALL FILES can not be accessed from a running XB program but can be accessed from a running TI Basic program. Appendix - G - Loader/Saver Order and Header bytes When a cartridge is saved to disk or cassette the areas of memory are saved in the following order according to what is in the module or Gram Kracker: Bank 2 of the Cartridge Rom/Ram c6000-7FFF Bank 1 of the Cartridge Rom/Ram c6000-7FFF Grom/Gram 7 gE000 Grom/Gram 6 gC000 Grom/Gram 5 gA000 Grom/Gram 4 g8000 Grom/Gram 3 g6000 Description of the first 6 bytes in the first data sector of each of the disk files generated by the Save Module routine. Byte Description 00 More to load flag FF = More to load 80 = Load UTIL Option next 00 = Last file to load 01 What Gram Chip or Ram Bank 01 = Grom/Gram 0 g0000 02 = Grom/Gram 1 g2000 03 = Grom/Gram 2 g4000 04 = Grom/Gram 3 g6000 05 = Grom/Gram 4 g8000 06 = Grom/Gram 5 gA000 07 = Grom/Gram 6 gC000 08 = Grom/Gram 7 gE000 09 = Rom/Ram Bank 1 g6000 0A = Rom/Ram Bank 2 g6000 00 or FF = Program Image - load to Memory Expansion 02 0000 = Number of bytes to load 04 0000 = Address to start loading at Example: First 6 bytes in each of the files generated by the Save Module routine for Extended Basic saved as XB. XB FF0A 2000 6000 saved data... Bank 2 cart Ram XB1 FF09 2000 6000 saved data... Bank 1 cart Ram XB2 FF07 2000 C000 saved data... Gram 6 XB3 FF06 2000 A000 saved data... Gram 5 XB4 FF05 2000 8000 saved data... Gram 4 XB5 0004 2000 6000 saved data... Gram 3 Editor Note: TI default maximum: 8 (8K) groms per bank 2 (8K) roms per bank 80K x 16 banks = 1.28 MEGABYTES. - 03.04.2001 - d.h.e.