Shop OBEX P1 Docs P2 Docs Learn Events
Error 44 , how to prevent it — Parallax Forums

Error 44 , how to prevent it

inakiinaki Posts: 262
edited 2005-12-07 12:21 in General Discussion
I am writing a simple program in SX/B and I get frequently the error #44: Address xxx is not within lower half of memory page, when calling subroutines.

I understand this·occurs because I am trying to·perform a call too far ? But how can I prevent this·problem? I understant this must be·pretty common isn't it ?

By the way, how much is too far for a subroutine call ?
·

Comments

  • Mike CookMike Cook Posts: 829
    edited 2005-12-06 21:19
    Make sure you are using the current version of SX/B, 1.42.01, it can be found here:

    http://forums.parallax.com/showthread.php?p=517621

    Take a look at the help file, you will need to define your subroutines, look at the gosub command:

    "Declared subroutines simplify SX/B programming by removing the necessity of the GOSUB keyword (which, in effect, allows the programmer to extend the language by creating new commands), it allows the compiler to validate the number of parameters being passed, and -- most valuable to the programmer -- it allows subroutine code to be placed anywhere in memory without concern of code page boundaries (now handled automatically)."

    Mike

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "OEM NMEA GPS Module" Now available on ebay for only $19.99, FREE shipping until 2006!

    Product web site: http://www.allsurplus.net/Axiom/
  • inakiinaki Posts: 262
    edited 2005-12-06 23:35
    Actually I am using the SUB technique and I get the same error.
  • Mike CookMike Cook Posts: 829
    edited 2005-12-06 23:40
    Can you post the code that you are having problems with? Maybe this will help locating the problem, or maybe someone else might have some other ideas.

    Mike

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "OEM NMEA GPS Module" Now available on ebay for only $19.99, FREE shipping until 2006!

    Product web site: http://www.allsurplus.net/Axiom/
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-12-06 23:40
    Please post you code (always recommended when you're having a problem) -- I'll run it and figure out what you've done wrong <grin>. Do it quickly, though, tomorrow morning I start out on vacation and may not have much access to the forums.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • BeanBean Posts: 8,129
    edited 2005-12-07 00:55
    You must declare the SUBs before any code (except the interrupt handler).
    In other word the SUB declaration must be in the 1st half of the code page.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    Those that would give up freedom for security will have neither.
    ·
  • inakiinaki Posts: 262
    edited 2005-12-07 12:21
    Thanks, I have placed all my SUBs in top of the code·and the definition of functions in the bottom. This solves the problem. :-)
Sign In or Register to comment.