Deleting Temps And Setting (Ptempcnt) - Texas Instruments TI-83 Plus Manual

Third release
Hide thumbs Also See for TI-83 Plus:
Table of Contents

Advertisement

112
Every time a temporary variable is needed, a check if made for available RAM. If there
is not enough free RAM, the temporary variables that are marked dirty are deleted one
at a time until enough RAM has been freed. If enough RAM were free at the start of
parsing, then in most cases, none of these deletions would take place.
A temporary variable is marked dirty by setting bit seven of the temporary variable's sign
byte located in its Symbol Table entry. For example, if OP1 equals the name of a
temporary variable to mark dirty:
MarkTemp:
;
; HL = pointer to Symbol Table entry
;

Deleting Temps and Setting (pTempCnt)

There are five different ways that temporary variables are deleted.
Quitting the application and returning to the home screen — This will delete all
temporary variables and reset (pTempCnt) equal to 0000h
System error context is started — This will delete all temporary variables and reset
(pTempCnt) equal to 0000h
System routine EnoughMem — This routine is used to check if a certain amount of
RAM is free. If the requested amount is not free, this routine will delete dirty
temporary variables until either no more dirty temps exist, or the requested amount
of RAM is available due to temporary variable deletions. (pTempCnt) is not affected.
System Routine FixTempCnt — This routine is used to delete all temporary
variables with a name that contains a counter value equal to DE.
The parser uses this routine in its handling of temporary variables when parsing a
program or the home screen entry.
Before each line of the program is parsed, the current value of (pTempCnt) is saved.
This value is used to create the next temporary variable needed.
After parsing each line of the program, the resulting value, if one, is stored into the
Ans variable. Once the result is stored into Ans, there can be no other temporary
variable that may have been created during the parsing of the line that are still
needed.
Calling FixTempCnt with DE equal to save pTempCnt, will delete all temporary
variables created by the last line parsed. The value (pTempCnt ) is reset back to the
value saved before the line was parser, DE.
System Routine CleanAll — This routine is used when the error context is started,
or control is returned to the home screen. This will delete all temporary variables and
reset (pTempCnt) equal to 0000h.
TI-83 Plus Developer Guide
B_CALL
ChkFindSym
SET
7,(HL)
RET
Chapter 2: TI-83 Plus Specific Information
; look up temp
; mark dirty
Third Release May 28, 2002

Advertisement

Table of Contents
loading

Table of Contents