PDA

View Full Version : Out of Memory!



Pat Alonzi
04-15-2007, 03:23 AM
Hey everyone,

Just my luck that the program I wrote on Friday the 13th doesn't work.

I have managed to fill the bs2's memory, but when i look at the EEPROM, the first 20% is empty. Is this space reserved or can i force it open inorder to get the rest of my program to fit?

Thanks,

Pat

Mike Green
04-15-2007, 03:50 AM
The PBasic does not reserve EEPROM memory for anything but your program, so the 20% empty piece doesn't make sense. You don't seem to have much duplication either in code or in messages. What kind of message are you getting?

Pat Alonzi
04-15-2007, 04:06 AM
Here is an update version of the code from about a minute ago.
as well as the error message.

Pat Alonzi
04-15-2007, 04:07 AM
Nevermind I think i might not have refreshed the EEPROM viewer

Pat Alonzi
04-15-2007, 04:08 AM
wow what a day. I am 99%utilization of the EEPROM so that means i guess i can write maybe a line or 2 before its completely full

Mike Green
04-15-2007, 04:46 AM
Probably the only way out of this (for now) is to shorten some of your messages. It doesn't take a lot of text to fill up 2K bytes!
You may need to either switch to some other Stamp model with more memory (like the BS2pe) or switch to another processor
like the Propeller. If you stay with the Stamps, keep in mind that the extra memory appears as "slots". These are effectively
overlay areas. You actually put a mostly independent program which you can execute from the beginning only. You can have
some shared variables which you can use for passing information. This actually works very well for programs with a complicated
user interface since you can often put the whole menu thing into one or two slots. You either have a separate slot for each of
the menu selected operations or combine them all into the main slot.

PJ Allen
04-15-2007, 11:50 PM
You have lots of SEROUT statements in succession (in circleloophelp, mainhelptext, updateChannels) which could be eliminated with the text, etc. combined into one line [condensed].· I took them out in the attached program and saved 40 bytes.
Like Mike wrote, you could/should consider·some re-wording to cut down on text.
(I modified the version of your program that immediately precedes this Reply... it'd help if you added a "Rev#" to your mods.)

Update -- Looks like you could do some tightening up in channelSelector.

Post Edited (PJ Allen) : 4/15/2007 5:04:38 PM GMT

PJ Allen
04-16-2007, 05:02 AM
I've been looking at your program more.· There were a couple of repeats of "LOOKUP inkey..." and "LOOKUP c...".· I made those into subroutines (inkey_Lookup and c_Lookup) and now the program doesn't start till "03C", 60 bytes free.

As I was looking closer, I can see that you haven't been able to RUN this and there are some places where you're going to get stuck (a couple of DO...LOOPs should be DO...LOOP...UNTIL, some other stumbling blocks will evince.)