Setting code size boundaries


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107

    Default Setting code size boundaries

    Is there a way - in PBP that I can set the upper limit for code? I use Mecanique's MCLoader as a bootloader. That loader occupies high memory
    (starting at 1FD00 in an 8722). My code compiles, but when I try to load the chip - just at the end of the programming cycle (which takes quite a while with the '8722), I get a message that my code is attempting to overwrite the bootloader.

    Is there a way that I can set limits on PBP, so it will give me a message at compile-time and tell me either the maximum memory location it is using, or else give me an error message of some kind?

    I realize I could look at the hex file and find this information, but I'm looking for a more automated way.
    Charles Linquist

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I think this should work ...

    Code:
    @  __MAXROM  0x1FFFF
    @  __BADROM  0x1FD00 - 0x1FFFF
    MPASM should then give a warning if the program goes above 1FD00.

    Note: 2 underscores before both commands.

    HTH,
    DT

  3. #3
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Darrel,

    When I put

    @_MAXROM 0x1FFFF
    @_BADROM 0x1C000-0x1FFFF

    At the top of my program, I get the following errors when I compile:

    Error[108] .... ;Illegal character(0)
    Error[108] .... ;Illegal character(0)
    Charles Linquist

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Space between the @ and the underscores.
    And 2 underscores.
    <br>
    DT

  5. #5
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Closer -

    Now I get

    Error[126]...;Argument out of range (must be greater than or equal to 2097151)
    Error[126]...;Argument out of range (__MAXROM must be used first)
    Charles Linquist

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Charles Linquis View Post
    Error[126]...;Argument out of range (__MAXROM must be used first)
    And, is __MAXROM first?
    <br>
    DT

  7. #7
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Of course!
    Charles Linquist

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Oh Great.

    Another Mind bender.

    It seems to work on every chip except 18F8xxx

    Hmm, now what's up with that.
    <br>
    DT

  9. #9
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Thanks for trying!
    Charles Linquist

  10. #10
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    You give up too easy Charles.

    Found it. Actually a documented MPASM error.

    Here's the fix. Just have to use a larger number for MAXROM.
    Code:
    @  __MAXROM  0x1FFFFF
    @  __BADROM  0x1FD00 - 0x1FFFFF
    DT

  11. #11
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I don't usually give up so easily - I just have a TON of code to write!

    Thanks!
    Charles Linquist

Similar Threads

  1. 16f887 44 pin demo board code problem?
    By jessey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th December 2008, 14:17
  2. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  3. code size
    By jmbanales21485 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th October 2007, 23:06
  4. Basic to Hex file Code size ratio
    By barkerben in forum General
    Replies: 0
    Last Post: - 5th January 2006, 15:37
  5. code size using On Interrupt PBP instruction
    By eduardojx in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st December 2005, 09:57

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts