Shop OBEX P1 Docs P2 Docs Learn Events
Errors 30 and 43 — Parallax Forums

Errors 30 and 43

UghaUgha Posts: 543
edited 2009-02-15 17:00 in General Discussion
I was working on my code and got these errors:
Error 30, Pass 2: Overwriting same program counter location
Error 43, Pass 2: Address exceeds memory limit

I'm assuming that means that my code is too large... not that I have too many variables.

Can someone confirm that I'm right on my understanding? Is there a work-around?

If there's a work-around... is there one in only SX/B? I haven't learned assembly yet.

Comments

  • BeanBean Posts: 8,129
    edited 2009-02-15 15:17
    Yep, you have exceeded the code space.
    The solution is to put often used commands that generate alot of code into subroutines.
    If you post your code we could make some more specific recommendations.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There is a fine line between arrogance and confidence. Make sure you don't cross it...

    ·
  • JonnyMacJonnyMac Posts: 9,214
    edited 2009-02-15 17:00
    It's hard to give you specific guidance without seeing your code, but the usual culprit is using "big" SX/B instructions/functions inline instead of wrappring them in a SUBroutine or FUNCtion shell. For example. If you use PAUSE many places in your program each place gets the (generated Assembly) code for PAUSE which is a redundant use of code space. By wrapping PAUSE in subroutine (I always use DELAY_MS) the core code for PAUSE is only compiled once. Instructions like SERIN and SEROUT generate a lot of code as well which can eat through your program space.

    Post Edited (JonnyMac) : 2/15/2009 6:01:13 PM GMT
Sign In or Register to comment.