and then stored 768 bytes to Overwriting, would it flood over into DontOverwrite? And how could I make it so I can do so without disturbing contents in DontOverwrite?
I was trying to think how to store a large undetermined amount of values to a buffer space that would expand with it. Would moving the label with the buffer space to the very last line work?
You'd need to somehow allocate that space in the first place, and keep another variable as a pointer to the current position you're writing to.
It's a pretty mucky thing to be doing. I, personally, would use the TIOS variable functions to create a large program file on the calculator, and read and write data to and from it. If you look in the manual, there are documented ROM calls to create a program, open it for editing (which allocates all of the free memory to it, IIRC) then closing it so it snaps back down to only take as much room as required.
I cannot help you more explicitely, as I have not done something like this myself.
If the maximum amount of data you wish to write is relatively small (<768 bytes, for example), you could get away with using one of the safe RAM areas to write to.
Yep, I also thought of the option of writing all that to a fully protected program file. Although isn't that option a bit slower than writing and reading directly from the program's local variables?
Also, is it possible to define or create your own tokens that could function similarly to the existing tokens for the TI-OS?
It's just RAM, so no, it would be just as fast. The slowness would come from having to update the TIOS pointers as well as your own pointers so it knows how much space the edited program takes up when it closes it after editing, but you could only update those at the end.
I've heard of a clever trick where you can insert all the free RAM into the end of the currently running program, but I've never attempted it myself.
I'm attempting to make a better asm on-calc assembler, and for the compiler, it reads off the editor's saved instructions and converts them into the appropriate binary opcodes (not the tokens that would represent the program in hex, such as "tAsmProgm,tE,tF,tC", etc. The thing is right now I have barely a clue how to go about doing this, although I'm always willing to learn.
King Harold tried this recently, and made some progress on an on-calc assembler. If you need help getting started on it, I'm sure he'd be happy to help you.
And don't forget to store the adres of every label, and handle defines and includes, and in the second pass you must check whether relative jumps exceed their jump-limit and give an error if one does, and ZIX instructions have the variable byte at a weird place..
All in all its a real pain, but it can be done.. (mine's still crashing, but im working on it)
I want to make the assembler/editor have tokens, which would increase ease of programming (instead of typing on the awkward "keyboard" on the calc). It would be similar to TI-BASIC tokens, but I don't know how to "define" tokens.