Texas Instruments TI89 Developer Guide - Page 93
Shared-Code Library
![]() |
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 93 highlights
Chapter 7: Flash Application Layout 51 7.3.3. 7.3.3.1. The Access_AMS_Global_Variables macro is required in every subroutine which needs to fetch or change AMS global variables. top_estack is a global variable in the computer algebra system. Shared-Code Library An application can make a library of its data structures and functions available as attribute slots in its object frame. The app library interface should use attribute slots 0x10000 (OO_FIRST_APP_ATTR) and up. Attribute slots 0x0000 - 0xFFFF are reserved for the OS. Creating the Library Interface Say, for example, your library implements the following functions and data structures: int fileTableCount; FILE fileTable[FILE_TABLE_SIZE]; int fileOpen(AppID self, char const *filename); int fileRead(AppID self, int handle, char *buff, int size); int fileWrite(AppID self, int handle, char const *buff, int size); void fileClose(AppID self, int handle); Note: The first parameter of each exported function must be an AppID variable even though it will always be the ID of your library. You can use Frame Description Language, FDL, to define an interface to these data and functions. fileio.fdl . . . appvar 0x10000 PlayerFileTableCount: int *; appvar PlayerFileTable: FILE *; appfunc PlayerFileOpen(AppID, char const *): int; appfunc PlayerFileRead(AppID, int, char *, int): int; appfunc PlayerFileWrite(AppID, int, char const *, int): int; appfunc PlayerFileClose(AppID, int): void; Some things to note in the above example: • The first variable, PlayerFileTableCount, is numbered 0x10000, the first attribute number available for applications. Subsequent attribute numbers are automatically incremented unless a new value is supplied. • The variable type or function result is placed after the colon (:) much in the style of Pascal. • Function parameters list only the order and type of arguments. Do not include parameter names. TI-89 / TI-92 Plus Developer Guide Not for Distribution Beta Version January 26, 2001
![](/manual_guide/products/texas-instruments-ti89-developer-guide-95b636f/93.png)