[Coco] Basic09 memory usage

Wayne Campbell asa.rand at gmail.com
Fri Nov 1 12:10:11 EDT 2013


Everything I learned about Basic09, and how it and RunB deal with memory,
has been based on the understanding that the procedures we write are not
the program that the system allocates memory to. Basic09 is the program
when you are writing and debugging code in it. RunB is the program when you
launch your program from the shell. If you look at your workspace in
Basic09, you can see that the memory is all there, whether it is the
default 8k or the max 40k, it is all there.

When RunB loads and runs your procedure, it is loading it into
pre-allocated memory. That memory is divided between procedure and data by
RunB. RunB decides how much goes to procedure and how much goes to data.

Yes, the minimum system allocation is 8k, and on the command line you can
extend that to about 36k before RunB starts having problems with space
management. I believe that this is due to the overhead that it must
maintain to keep track of everything.

That is why I presented the numbers the way I did. That is how Basicx09
sees the memory usage. DCom was written using this model, and while I do
understand the problems it had, I also know I was able to watch it work on
itself without error. If anyone is interested, I will put up a program flow
chart for it like I did with decode and unpack.

Wayne

-- 
The Structure of I-Code
http://www.cocopedia.com/wiki/index.php/The_Structure_of_I-Code

decode
http://cococoding.com/wayne/



More information about the Coco mailing list