50 Chapter 2: TI-83 Plus Specific Information
TI-83 Plus Developer Guide Third Release May 28, 2002
• Decreasing the data size
DelMem Decreases the size of an existing variable by removing data at a given
address.
For example, delete 10 bytes at the beginning of an existing AppVar. If the AppVar
does not exist or if it is archived, CA = 1 is returned.
Delete_10:
LD HL,AppVarName
B_CALL Mov9ToOP1 ; OP1 = name of AppVar
B_CALL ChkFindSym ; DE = pointer to data if exists
RET C ; ret if not found
;
LD A,B ; archived status
ADD 0FFh ; if archived then CA = 1
RET C ; ret if archived
;
PUSH DE ; save pointer to size bytes of
; data
INC DE
INC DE ; move DE past size bytes
;
LD HL,10 ; number bytes to insert
EX DE,HL ; HL = pointer to start of delete,
; DE = number bytes
B_CALL DelMem ; delete the memory
POP HL ; HL = pointer to size bytes
PUSH HL ; save
;
B_CALL ldHLind ; HL = old size of AppVar,
; number bytes
LD BC,10
OR A
SBC HL,BC ; decrease by 10, amount deleted
EX DE,HL ; DE = new size
POP HL ; pointer to size bytes location
LD (HL),E
INC HL
LD (HL),D ; write new size.
OR A ; CA = 0
RET
AppVarName:
DB AppVarObj,'AVAR',0
See the System Routine Documentation for details on DelMem.