breakintoprogram / agon-bbc-basic-adl

Official AGON QUARK Firmware: BASIC Interpreter (ADL version)
zlib License
15 stars 0 forks source link

DIM space at line ... #14

Open tonedef71 opened 8 months ago

tonedef71 commented 8 months ago

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

breakintoprogram commented 8 months ago

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

tonedef71 commented 4 months ago

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