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

Re: Issue compiling BASIC code



> It does.  Don't want to speak too soon, but bumping the value up to
> 35000 seems to have resolved it.  Will keep you posted.


25000 should have been enough as it is higher than the Hires 2 screen.

I don't know how the compilers keep track of variable space usage, but next time you crash, you can check  $69 to $6e, to see if variable space or array space has encroached on your hires screen, in which when you draw on the screen, it will destroy variable space.

$6D.$6e is the end of array storage and should not be higher than $4000

or PRINT PEEK(110)*256 + PEEK(109) should not be greater than 16384


Some ways to lower the variable space usage, are to reuse variables that do not return a value from a subroutine.  These are basically throw-aways and can be used in another subroutine.  Especially in FOR-NEXT routines that are not nested.

Also using DIM can help lower array space usage.  If you do not use DIM but use an array such as X = A(0,0) in your program, this will automatically create an array that uses 614 bytes of variable space which is the same as using DIM A(9,9).

You can use DIM to lower the space used by setting the dimension to the lowest element you use in your program.  i.e DIM A(2,2) only uses 54 bytes

These techniques might help you from having to run your program above hi-res or having to change the LOMEM: setting.

Rob