Creating 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
- load
hl
with the desired size of the variable data area.
_CreatREAL
,
_CreateCPLX
, etc.) so you don't have to load hl
with the desired size. These such routines have a '*' after their
names.
The only other special inputs needed for these variables are that
_CreateRMAT
and _CreateCMAT
need the number
of rows in h
and the number of columns in l
;
_CreateRVECT
and _CreateCVECT
need the
number of elements in l
.
Call | Type Created |
_CreateREAL* | Real Number |
_CreateCPLX* | Complex Number |
_CreateRCONST* | Real Constant |
_CreateCCONST* | Complex Constant |
_CreateRVECT | Real Vector |
_CreateCVECT | Complex Vector |
_CreateRLIST | Real List |
_CreateCLIST | Complex List |
_CreateRMAT | Real Matrix |
_CreateCMAT | Complex Matrix |
_CreateSTRNG | String |
_CreateEQU | Equation |
_CreatePICT* | Picture |
_CreatePROG | Program |
The output of these calls:
bde
will be an absolute pointer to the data area for the variable created- OP4 will hold the name of the variable
hl
will point to where in the Variable Allocation Table (VAT) this variable is- RAM page 7 will be loaded (meaning
hl
is 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