Re: A86: Self Modifying Assembly Programs


[Prev][Next][Index][Thread]

Re: A86: Self Modifying Assembly Programs



Mark L wrote:
> 
> >Mark L wrote:
> >>
> >> When you need to save a high score or other information on the calc
> >> between uses, what is necessary to store the information within the
> >> program itself?
> >
> >no you can store it in outside variables (most common is a string or
> >program)
> >
> >> Can you just leave some room with .db's and then write it to that area
> >> when you want to, or does that violate some checksum or something?
> >
> >yeah that would be a syntax error because what you are trying to do is
> >make a place for data after the program that is 0 bytes long
> >===================
> Perhaps I wasn't clear enough. This is what I had in mind:
> 
> Stuff:
> .db o,o,o,o
> .db o,o,o,o
> 
> All I would do is store perhaps 12 to (Stuff), 8 to (Stuff+1), etc. The
> space would be put aside when the program was written. Nothing would be
> tacked on the end during execution. The original string would then be
> modified when I exited the program. Is this ok?
> 
> Mark L.

If you want the program to run under AShell v1.1, what you did is fine.
That's because AShell saves whatever modifications are made at
_asm_exec_ram back to the program variable. However, ASE and Rascall do
not save the program (yet), so if you want your program to save data
under the current versions of those shells, you'll have to write the
data yourself, which is a little more complicated.


References: