0 Members and 1 Guest are viewing this topic.
;(saferam1 = saveSScreen)name_str = saferam1size = saferam1+2code_start = saferam1+4start: bcall(_RclAns) ;set pointer into OP1 cp 4 ret nz ld hl,$55 ;ASCII for 'U' ld (name_str),hl ;save zero terminated string name ld (OP1+1),hl ld hl,code_start ex de,hl ;de = code_start, hl = ans ptr? ld c,(hl) ;i assume bc = size of Ans inc hl ld b,(hl) inc hl ld (size),bc ldir ;copy code in Ans into saferam bcall(_ChkFindSym) jr c,not_found bcall(_DelVarArc) ;del prgmU if it existednot_found: ld a,5 ;5 = non-protected program ld hl,saferam1 bcall(_ExecuteNewPrgm) ;a = var type, hl = pointer to structure (zero terminated string, size (word), program data) ret
Though that's a really roundabout way of doing it, why don't you use the _CreateRList bcall? Also, how will you write to/read from the list later?
Hmm... I cant imagine what makes the program stop (in fact I only found out that removing the ret/C9... guess what... Doesn't crash, it still completely stops the program!)... Is there any other way to do that?What I need is just a text editor which stores the documents in lists... And the lists' names are the document names.Wait, doesn't it mean it just fails executing and stops before that?
#include "includes/ti83plus.inc" .db t2ByteTok,tasmCmp ;the AsmPrgm token .org $9D95 ;progstart, all asm programs are loaded to this address in RAM saferam1 =$86EC ;saveSScreen=768 name_str = saferam1size = saferam1+7code_start = saferam1+9start: bcall(_RclAns) ;de = start of data, first two bytes are size bytes cp 4 ;if ans is a string, a = 4 ret nz ex de,hl ld e,(hl) inc hl ld d,(hl) ;de = size of Ans inc hl ld a,(hl) ;a = action # (1 or 2) inc hl ;hl = start of string name dec de ;the first byte is the action number dec de dec de dec de dec de dec de ;-5 for the string name ld (size),de dec hl ld (hl),AppVarObj ld de,name_str ;copy name in Ans to name_str ld bc,6 ldir ld (code_start),hl ex de,hl ld (hl),0 ld hl,name_str rst 20h ;_Mov9ToOP1, copy 9 bytes from (hl) to OP1 (copies our AppVar name) sub '1' ;$31 jr z,write_appvar dec a ret nzread_appvar: bcall(_ChkFindSym) ret c ex de,hl ld c,(hl) ;first two bytes are the size bytes inc hl ld b,(hl) ;bc = size of Ans inc hl ld (size),bc ld de,code_start ldir ;copy the whole string to code_start bcall(_AnsName) bcall(_ChkFindSym) bcall(_DelVar) bcall(_AnsName) bcall(_ChkFindSym) ld a,StrngObj ld hl,(size) bcall(_CreateVar) ld bc,(size) inc bc inc bc ;rewrite the size bytes ld hl,size ldir retwrite_appvar: ld hl,(size) bcall(_EnoughMem) ;check if we've got enough space to create the AppVar ret c ex de,hl push hl push hl bcall(_ChkFindSym) ;OP1 = name of variable to find jr c,$+5 bcall(_DelVarArc) ;delete AppVar if it already exists pop hl bcall(_CreateAppVar) ;OP1 = name, hl = size pop bc inc de inc de ;skip size word ld hl,(code_start) ldir ;copy Ans into AppVar ret
EFD74A FE04 C0 EB 5E 23 56 23 7E 23 1B 1B 1B 1B 1B 1B ED53F386 2B 3615 11EC86 010600 EDB0 22F586 EB 3600 21EC86 E7 D631 2837 3D C0 EFF142 D8 EB 4E 23 46 23 ED43F386 11F586 EDB0 EF524B EFF142 EF5143 EF524B EFF142 3E04 2AF386 EF704E ED4BF386 03 03 21F386 EDB0 C9 2AF386 EFFD42 D8 EB E5 E5 EFF142 3803 EFC64F E1 EF6A4E C1 13 13 2AF586 EDB0 C9
RclVarSym will recall the contents of the variable to OP1 if it is real, to OP1 and OP2 if the variable is complex and otherwise leaves the name as is in OP1 and returns HL as the symbol table pointer and DE as the data pointer as in ChkFindSym.