Code: Select all
.nolist
#include "ti83plus.inc"
#define ProgStart $9D95
.list
.org ProgStart - 2
.db t2ByteTok, tAsmCmp
bcall(_RclAns) ; recall Ans
ld hl,1 ; 1st element in Real List
bcall(_GetLtoOp1) ; get element
bcall(_ConvOp1) ; returns a as LSByte (and de as the total 16bit value)
CP 0
JP Z,create_var
CP 1
JP Z,del_var
CP 2
JP Z,put_int
JP return
create_var:
bcall(_RclAns) ;rcl ans because its lost
ld hl, 2 ;2nd list element (size)
bcall(_GetLtoOp1) ;put it in op1
bcall(_ConvOp1) ;make it a number and put it in de
push de ;push de because it gets destructed
ld hl,3 ;3rd list element (name)
bcall(_GetLtoOp1) ;put it in op1
bcall(_ConvOp1) ;make it a number and put it in de (somehow this has to make a name)
;name generation based on de (3rd element of list) (later)
ld hl, var_name ;testingfase namegeneration
bcall(_Mov9ToOP1) ;put the name in hl
bcall(_ChkFindSym) ;see if it needs to be deleted
JR C, create_var_2 ;jump if it doesnt exist
bcall(_DelVarArc) ;delete if so
create_var_2:
pop hl ;pop size (was de) in hl, name is still in OP1
bcall(_CreateAppVar) ;duhh..
JR return
del_var:
bcall(_RclAns)
ld hl, 2 ;for deleting the name should be in the 2nd element
bcall(_GetLtoOp1) ;2nd element to op1
bcall(_ConvOp1) ;store the number in de
;name generation based on de.. (need help on that)
ld hl, var_name ;name in hl
bcall(_Mov9ToOP1) ;name in op1
bcall(_ChkFindSym) ;check if it exists, cant delete non-existant things
JR C, not_found ;if not found, dont delete
bcall(_DelVar) ;else delete
ld a, 1 ;1 in a
bcall(_SetxxOP1) ;1 in op1
bcall(_StoX) ;op1 in x (tell user that the appvar has (probebly) succesfully been
deleted
JR return
put_int:
JR return
var_name:
.db AppVarObj, "testvar "
not_found:
ld a, 0 ;if the appvar has not been found, 0 to a
bcall(_SetxxOp1) ;a to op1
bcall(_StoX) ;op1 to x
JR return
return:
ret
.end
END
but why does it error? i mean: i put the size in a 16big reg and push it, aught to work