Information updated on 9/24/98.
Here is detailed information about the TI-92 Plus and TI-89 built-in assembly support:
ASM (.9XZ) program format
The following is the format of the TI-Graph Link ASM program variables used by the TI-92 Plus and TI-89.
Offset Size Description 0x0 0x8 "**TI92P*" or "**TI89**" signature 0x8 0x2 01 00 0xA 0x8 Folder name 0x12 0x28 File description text (Must be all zeros? See below) 0x3A 0x6 01 00 52 00 00 00 0x40 0x8 File name 0x48 0x4 File type (0x21) 0x4C 0x4 File size (entire file) 0x50 0x6 A5 5A 00 00 00 00 0x56 0x2 ASM program size (from 0x58 on not including checksum) 0x58 n ASM program ? 0x1 Signature byte -- MUST BE 0xF3 ? 0x2 Checksum from 0x56 on
Some files do not appear to send properly in TI-Graph Link when a file description exists. Fill the description area with zero bytes to avoid this problem.
At the end of the ASM program, just before the 0xF3 signature, there is a relocation table. It is stored in this format:
Low address: Terminating marker (0x0000 word) Destination offset #n (word) Referencing offset #n (word) Destination offset #n-1 (word) Referencing offset #n-1 (word) ... Destination offset #2 (word) Referencing offset #2 (word) Destination offset #1 (word) High address: Referencing offset #1 (word)
(Thanks to David Ellsworth for the relocation info)
The referencing offset points to the longword which needs to be relocated. The destination offset is the offset the longword is supposed to point at. All offsets are relative to the beginning of the ASM program code.
Execution starts at the first word of the program variable (address 0x58 in the .9XZ/.89Z file).
ROM calls
TI uses a table of ROM addresses to allow ASM programs to run on all versions. This table is pointed to by RAM address $C8. The following macro will call a ROM function using the number listed below:
ROM_CALL macro move.l ($C8),a5 add.l #\1*4,a5 move.l (a5),a5 jsr (a5) endm
To call sprintf, for example, you could write:
ROM_CALL $53
Here is the current list: (a * by the number means that this call is untested)
ST_eraseHelp 0E3 ST_showHelp 0E6 HeapFree 097 HeapAlloc 090 ER_catch 154 ER_success 155 reset_link 24C flush_link 24D tx_free 252* transmit 250 receive 24F* HeapFreeIndir 098 ST_busy 0E2 ER_throwVar 153 HeapRealloc 09D sprintf 053 DrawStrXY 1A9 FontSetSys 18F DrawTo 19C* MoveTo 19D* PortSet 1A2* PortRestore 1A3* WinActivate 001* WinClose 00B* WinOpen 01E* WinStrXY 026* MenuPopup 03B* MenuBegin 036* MenuOn 03A* HeapAllocThrow 093 strcmp 271 FontGetSys 18E strlen 27E strncmp 272* strncpy 26D strcat 26E strchr 274* ERD_dialog 151 memset 27C* memcmp 270* memcpy 26A* memmove 26B* _du32u32 2AA* _ds32s32 2A8* _du16u16 2A6* _ds16u16 2A4* _ru32u32 2AB* _rs32s32 2A9* _ru16u16 2A7* _rs16u16 2A5* DerefSym 079
The DrawCharXY function, at least the one that Fargo used, is not in the ROM table. A replacement is in UTIL.H.
Handle Table
On the TI-92 Plus, the handle table is at $88FC and a pointer to the table is at $7592.
On the TI-89, the handle table is at $7BFC and a pointer to the table is at $758E.
To dereference a handle, use this macro:
DEREF macro lsl.w #2,\1 move.l tios::Heap,\2 move.l 0(\2,\1.w),\2 endm
Handles and Folders (Thanks to Marc Padellini for this info)
The names and handles of all folders is stored in handle number 8. The format of this and the format of the folders themselves is as follows:
Offset Size Description 0x0 0x2 Max # of files/folders before handle has to be resized 0x2 0x2 Number of files/folders in table (N) 0x4 0xE*N List of files/folders (each entry is 0xE bytes) +0x0 0x8 File/folder name (null padded) +0x8 0x2 Null padding for name +0xA 0x2 File/folder flags Bit 3 - Locked Bit 7 - Folder Bit 9 - Archived +0xC 0x2 Handle of file/folder
Auto Power Down and Timers (Thanks to Joshua Stephanoff for this info)
The timer table is as follows:
Timer N initial value (long): $5B08+8*N Timer N value (long): $5B0C+8*N Timer N flag (word): $5B40+2*N
Timer 1 is the Auto Power Down timer and has a default initial value of $1770, which, at 20 Hz, is equivilent of five minutes.
Other Information
The LCD memory starts at $4C00
The following is a table of the locations of the keyboard variables:
Fargo name 92+ addr 89 addr Description tios::kb_globals+$1c $75BC $75BA Key pressed flag tios::kb_globals+$1e $75BE $75BC getKey code of last key pressed tios::kb_globals+$c $75A2 tios::kb_globals-$6 $75BE
Questions? Comments? E-mail me at river@gte.net
This page is maintained by Rusty Wagner