Login
Back to forumSee the full topicGo to last reply

Posted By

SVS
on 2004-04-25
10:56:22
 Re: Got the font working now, but...

After a loading operation performed in rrun mode (that is inside a program), the BASIC automatically execs a RUN 0, then the first line of the just loaded program is executed (it could be different than line number 0).
Differently than GOTO, execution of RUN will CLeaR every variable in memory, looking at pointers at $2F... in zeropage.
The real problem (common to all the CBM BASIC versions) is that these pointers are set on the base of ending point of program in memory. Both starting and ending addresses of a program just loaded are set, ONLY if the program was loaded in direct mode. Thus if a loader program loads another program, the second is yes executed, but the pointers at $2B.... are not updated. The execution of the automatic RUN will clear the variables (and other functions) using the old addresses in zero page. This could result in a mess IF the second program is longer than the first one.
The solution is to manually calculate the addresses of second program and POKE their values onto $2B... by a Basic line before that one with the LOAD. In this way when the second program is loaded, it will find the rights pointers and its automatically clearing will not cause domage.
Hope this could help happy



Back to top


Copyright © Plus/4 World Team, 2001-2024