z80 » Variables
The TI86 has several routines that can set up space for variables. For all these routines you must:
- Put the name in Variable Name Format into OP1 and
hlwith the desired size of the variable data area.
_CreateCPLX, etc.) so you don't have to load
with the desired size. These such routines have a '*' after their
The only other special inputs needed for these variables are that
_CreateCMAT need the number
of rows in
h and the number of columns in
_CreateCVECT need the
number of elements in
The output of these calls:
bdewill be an absolute pointer to the data area for the variable created
- OP4 will hold the name of the variable
hlwill point to where in the Variable Allocation Table (VAT) this variable is
- RAM page 7 will be loaded (meaning
hlis a valid pointer to the VAT entry).
ld hl,name-1 ;load name address in to hl ;we can put a trash byte in ; for the type byte because ; it doesn't matter so we ; include the byte before the ; name rst 20h ;same as 'call _Mov10ToOP1' jp _CreateSTRNG ;create the string and return
For variables that have varying sizes (programs, strings, equations), the first two bytes in the variable's data will be the Length Word. This is a word (2 bytes) that tells the length of the variable. This means that we can't have a variable with a length of over 65535 ($ffff) bytes.
More examples on this can be found in the Messing With Variable Data section.
More from z80 » Variables
Absolute Addressing // Binary Coded Decimal // Creating Variables // External Levels // _FindSym // Messing with Variable Data // OP Math // TI-OS Variable Manipulation // Variable Name Format // VAT Searches