agon-bbc-basic-adl icon indicating copy to clipboard operation
agon-bbc-basic-adl copied to clipboard

DIM space at line ...

Open tonedef71 opened this issue 2 years ago • 2 comments

Having 438781 bytes of memory available for a BASIC program is a wonderful thing, but I'm now wondering if there are any other known limitations in Agon BBC BASIC ADL that a BASIC program can run afoul of.

I'm experiencing the error message DIM space at line ... when I run my current program in BBC BASIC ADL. It would seem that BASIC is unable to allocate memory for arrays after a certain point.

The largest value I have seen returned from the command PRINT HIMEM - LOMEM which still causes this error to occur is 397979. If I then free up another 4 bytes of memory, such that HIMEM - LOMEM evaluates to 397983, then I am able to run the program without experiencing that error. I'm not sure if these numbers (~40 KB) are significant in any way.

Has my BASIC program used up the maximum bytes of space for tokens/symbols, or overrun the boundary to the dynamic heap?

Are there any tools which can provide useful statistics about a BCC BASIC program (e.g., amount of heap space consumed; number of global variables; number of functions; number of procedures; deepest runtime usage of the stack; etc.)?

STRIPPED.zip

tonedef71 avatar Jan 05 '24 07:01 tonedef71

I'll check and confirm any limits on arrays and fix where possible.

breakintoprogram avatar Jan 09 '24 20:01 breakintoprogram

I have a strong suspicion that the issue has something to do with the fact that the DIM statements exist inside of a PROC.

tonedef71 avatar May 20 '24 03:05 tonedef71