Shop OBEX P1 Docs P2 Docs Learn Events
Out of Memory! — Parallax Forums

Out of Memory!

Pat AlonziPat Alonzi Posts: 27
edited 2007-04-15 22:02 in BASIC Stamp
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

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-14 20:50
    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 AlonziPat Alonzi Posts: 27
    edited 2007-04-14 21:06
    Here is an update version of the code from about a minute ago.
    as well as the error message.
  • Pat AlonziPat Alonzi Posts: 27
    edited 2007-04-14 21:07
    Nevermind I think i might not have refreshed the EEPROM viewer
  • Pat AlonziPat Alonzi Posts: 27
    edited 2007-04-14 21:08
    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 GreenMike Green Posts: 23,101
    edited 2007-04-14 21:46
    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.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-04-15 16:50
    You have lots of SEROUT statements in succession (in circleloophelp, mainhelptext, updateChannels) which could be eliminated with the text, etc. combined into one line [noparse][[/noparse]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
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-04-15 22:02
    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.)
Sign In or Register to comment.