Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Out of Memory error
#9
boriel Wrote:The problem is, there is no stack zone. Stack is SP register. It's set automatically by the BASIC loader with the CLEAR statement (just below the ORG of your program). SP always grows downwards with each PUSH. When SP reaches 236XXX, for example, it's entering the ROM Variables area which are written very often (e.g. the FRAMES updates 50 times/sec), crashing your program.

A check could be comparing SP with a stack bottom mark (e.g. BASIC area Zone), or so, and raise an ERROR if SP gets into such area.
Exactly.
I know, knowing the lowest possible adress that can be used, the actual stack pointer and original stack pointer (stored by clear in system variables) or display current Stack pointer can help to determine how much can still be used, and if I play my game and watch how the stack pointer is going down, I know, oops, there may be something wrong with gosub.
We must also not forget that some interface like Opus or interface one add more system variables and so raises the address of BASIC too.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)