A83: Re: Re: permenant mem


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

A83: Re: Re: permenant mem




Yes.  On the 82/83/85 programs are run from their location in memory, so any
self modifying they do is automatically "written-back" by the shell.  So all
you have to do is just change the data, and it will already be saved for
you:

; I assume that you have variables score and initials in TextShadow or
something


ld hl,(score)        ; score is 16-bits
ld (HighScore),hl    ; self-modify program, save highscore
ld hl,initials       ; point to user entered initials
                     ; this is an example, but it would be better
                     ; to save them as they enter them, instead of copying
ld bc,3              ; 3 initials, 3 bytes...
ld de,HighName       ; save them to the program's memory
ldir                 ; now copy them

HighScore:
 .dw 0
HighName:
 .db "JOE",0

-----Original Message-----
From: Miles Raymond <m_rayman@bigfoot.com>
To: assembly-83@lists.ticalc.org <assembly-83@lists.ticalc.org>
Date: Sunday, November 15, 1998 11:50 AM
Subject: A83: Re: permenant mem


>
>Assembly programs modify themselves to include the highscore.  Take a look
>at some code to score-saving games such as Tetris.  I assume that you are
>talking about assembly programs, since this is an assembly list...
>
>-Miles Raymond
>
>-----Original Message-----
>From: The Man in the Moon <mecad@scv.net>
>To: assembly digest <assembly-83-digest@lists.ticalc.org>
>Date: Sunday, November 15, 1998 6:50 AM
>Subject: A83: permenant mem
>
>
>>Where do progs store info to be used later on that can't be deleted by the
>>user (I mean not storing in user var X). Something like high scores, etc.
>>
>>From: Chris
>>(Man in the Moon)
>>mecad@scv.net


Follow-Ups: