Page 1 of 1

Want to know?

Posted: Fri May 05, 2006 12:15 am
by Devlin
Ok I have 16k Ram Expansion.
I made a program that only has 6777 bytes free.
So I did this
10 CLR:LOAD"ENGINE",8:RUN

Then second program works? So My question is this.
What is going on in my Vic-20.
Is it just loading a new program and writing it over the old program in memory?
Is this a safe thing to do.?

Re: Want to know?

Posted: Fri May 05, 2006 1:08 am
by Mike
Both 'CLR' and 'RUN' are redundant, as a CLR is performed as you enter RUN to start this loader. Furthermore a RUN is executed on your behalf, as soon as the LOAD commands exits.

But the big problem is, that the pointer to the start of the variables (aka 'end of BASIC program'), 45/46, will not be adjusted! So, when the second program is started, and is longer than the first, the variables will scribble happily over your program.

...

No problem without solution ;)

Code: Select all

10 Q$=CHR$(34):PRINT"{CLR}LOAD"Q$"ENGINE"Q$",8"
20 POKE631,19:POKE632,131:POKE198,2
Greetings,

Michael