83Plus:OS:System Table

From WikiTI
Jump to: navigation, search

System Table (VAT)

The system table, or the VAT (Variable Allocation Table,) is the location where the entry for each variable is cataloged in memory.

Structure

The structure of the system table is comparable to that of the stack. In fact, the system table exists in memory between the operator stack and the hardware stack. When a variable is added to the table the stack grows down, and the variables entry is added to one of two partitions inside of the system table's allocated space.

There are three pointers in the system table, which maps out three partitions. Real, Cplx, Mat, Pict, GDB, and EQU variables (which I shall call, collectively, the "A" group for our purposes) are stored in a separate space from programs, lists, appvars, groups (which I shall call the "B" group.) "A" group variables are stored beginning at the pointer symTable, and ends at the address progPtr+1. "B" Group variables are stored beginning at the address progPtr, and end at the address pTemp+1. pTemp begins the third partition where only temporary variables are stored; this partition ends at OPBase+1


Entries

Each entry, which may extend up to 14 bytes long, is loaded from high to low memory in one of several different ways depending on what variable is stored. Most of the information that follows has been more or less copied from TI's SDK:

Program, AppVar, Group:

(HIGH MEMORY) | T | T2 | Ver | DAL | DAH | Page | NL | Variable Name (8 Characters Max) | (LOW MEMORY)

Lists:

(HIGH MEMORY) | T | T2 | Ver | DAL | DAH | Page | NL | tVarLst ($5D) | Variable Name (5 Characters Max) | F | (LOW MEMORY) 

Real, Cplx, Mat, EQU, GDB, Pict:

(HIGH MEMORY) | T | T2 | Ver | DAL | DAH | Page | First token of name | Second token of name | ($00) | (LOW MEMORY)

Entry Parts

  • T = Object type where:
bit | flag
-----------------------------
0-4 | Object Type
 5  | Graph Equation selected
 6  | Variable used during graphing
 7  | Link Transfer flag

Where Object Type:

 Object Type Value  |    Object Type     | Object Type Equate
--------------------------------------------------------------
       $00          |       Real         |   RealObj 
       $01          |       List         |   ListObj
       $02          |      Matrix        |   MatObj
       $03          |     Equation       |   EquObj
       $04          |      String        |   StrngObj
       $05          |     Program        |   ProgObj
       $06          | Protected Program  |   ProtProgObj
       $07          |     Picture        |   PictObj
       $08          |   Graph Database   |   GDBObj
       $0B          |    New EQU Obj     |   NewEquObj
       $0C          |    Complex Obj     |   CplxObj
       $0D          |  Complex List Obj  |   ClistObj
       $14          |  Application Obj   |   AppObj
       $15          |    AppVar Obj      |   AppVarObj
       $17          |     Group Obj      |   GroupObj
  • T2 = Reserved for future use
  • Ver = Version number
- Determines the scope of a variables compatibility with future and past versions of the TI-OS or Hardware.
- Made for when/if "A future TI-83 Plus release may create a new data type that the earlier releases do not know how to handle."
- A variable with a version number higher than the Calculator's will be rejected.
  • DAL = Data structure pointer's low (LSB) byte
  • DAH = Data structure pointer's high (MSB) byte
  • PAGE = Rom page the data structure resides on.
Only if archived.
If it resides in RAM, this byte is zero ($00).
  • NL = Name length of the variable
Include the byte tVarLst ($5D) for a list
  • F = Formula number attached to a list
- If this value is 0, the list is unattached to any formula
- Allows lists to have a formula attached to them that is executed every time the list is accessed. The result of the execution is stored into the list's data structure.
- Used to generate a unique name for the formula attached to the list.