Re: LZ: Variables


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

Re: LZ: Variables



Sherry L. Koch wrote:
> 
> I have another question.  My friend and I are starting to work on simple
> programs for math and some games.  The games that have high score
> feature, how do they keep the score when the program is executed.  I am
> tring to make a program that after running it X times it will delete
> itself or give itself a badchecksum when exited.  The only problem is
> that if I store it in regular variables, it gets changed when exited.  I
> also tried disasembling the high score of another program and I couldn't
> figure it out!  All I need is a constant variable or something like 80DF
> which is not constant.  You know what I mean.  If you don't thanks
> anyway!


What you want to do is to sstore the number of times the program as been
started some where in ram where it wont get changed, rigth.


If you make a db in you code you will have a place to store the number.
Do something like this at the end of your code.


Counter:
  .DB 0000h


When you exit the program tell zshell to make a new checksum. This can
be done by setting a bit in the memory. I can not remember which one it
is, but look at the documents which came with zshell and the ti85.h
file.


When you want to get a bed checksum just write a new value to the 
counter and tell zshell not to update the checksum.
<pre>
-- 
_______________________________________


Dines Justesen
Email: dines@post1.com or
       c958362@student.dtu.dk
WWW  : http://www.gbar.dtu.dk/~c958362/
_______________________________________
</pre>


References: