How much Hub RAM remains?
mmowen
Posts: 38
in Propeller 1
It appears that the Hub RAM memory is zero above some point corresponding to the last cell of memory used by the code. If we start initially by prefilling the empty cells with a known value then allow the code to run we can at any time determine the extent of free memory by examining it from its highest address backwards until we encounter a non "known value" occurance. The rub lies in the choice of value, any arbitrary value can be valid data and if it should happen to be the at the end of the active memory area we would erroneously consider it free space. The pseudo random series used by the Stack Length object does not eliminate this possibility either, it just minimizes the probability that a valid data value equal to the pseudo random number would happen to exist in a particular memory location. Which is to say that Stack Length's output can be wrong, but I digress.
The two attached spin files are a first attempt at a solution to determining how much Hub RAM is unused at any given time, based upon the above concept and using Stack Length's approach to the problem. My tests with it have been successful thus far and I hope to get some feedback on the idea and possible alternatives from folks here. My reading of the forums has indicated that questions regarding memory available and stack lengths are an ongoing issue. Also there are apparently numerous reserved registers in Hub RAM that could shed some light on the problem if a concise compilation of these could be located (eg: WORD[10] being initial stack frame).
Thanks in advance
The two attached spin files are a first attempt at a solution to determining how much Hub RAM is unused at any given time, based upon the above concept and using Stack Length's approach to the problem. My tests with it have been successful thus far and I hope to get some feedback on the idea and possible alternatives from folks here. My reading of the forums has indicated that questions regarding memory available and stack lengths are an ongoing issue. Also there are apparently numerous reserved registers in Hub RAM that could shed some light on the problem if a concise compilation of these could be located (eg: WORD[10] being initial stack frame).
Thanks in advance
Comments
Thanks! Where did that document originate from? Was it all by one person or have people been adding to it over time? It's still missing a lot. Can I upload it to github (as a plain text file) so people can collaborate on it?
It's a document from Hippy, he has these all discovered alone, at a time we had no source code of the interpreter and loader.
The original was a plain textfle.