I am writing a simple game in ez80 assembly, and every single time I run the program, my calculator's free RAM goes down a lot.
I can run the game maybe 4-5 times before it runs out and a memory error occurs.

Is my program simply not deallocated from memory, if so, how do I get it to?
You're responsible for deallocating anything you allocate. Without seeing your program, I can't say what the exact problem is for you.
I know, but what exactly counts as an allocation in this case?

All I'm doing is reserving some space in the program with a ton of .db's, but that's indistinguishable from code, so I don't think that counts as an allocation.

Here's a link if it helps: https://gitlab.com/midn/sjq/tree/master/src
Some kind of memory corruption is occurring because you're clobbering IY in SJQ_gameplay. Many OS calls expect IY to be equal to flags ($D00080).

Easiest fix is to just wrap the body of SJQ_gameplay in push iy \ ... \ pop iy.
Such a tiny gotcha, a.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement