+ Reply to Thread
Results 1 to 7 of 7

Thread: Trouble w/ "org" commands and MPLAB...

  1. #1
    lpinkai Newbie
    Join Date
    Jan 2007
    Location
    Texas
    Posts
    8

    Default Trouble w/ "org" commands and MPLAB...

    This seems obvious, so I'm hoping someone can just mention what I'm doing wrong....

    If I enter source code into MPLab w/ "org", it doesn't seem to like it. Ex:
    list p=16F628A
    include <p16F628A.inc>
    __CONFIG 0x3F34
    org 0

    Fails:
    Error - section '.org_0' can not fit the absolute section. Section '.org_0' start=0x00000000, length=0x00000016


    I've cut and pasted code by William and Nigel exactly, and I always get this error. If I replace "org 0" with "MAIN", it compiles correctly. Is this something strange w/ MPLAB or am I just setting it up wrong?

    -LP


  2. #2
    trexter711 Newbie
    Join Date
    Jun 2006
    Posts
    18

    Default

    u have to put the lines
    include....
    config...

    before the list...
    org 0

  3. #3
    lpinkai Newbie
    Join Date
    Jan 2007
    Location
    Texas
    Posts
    8

    Default Hmm... Not sure about that...

    So you're suggesting doing "list" after "include" and "__CONFIG", as follows:

    include <p16F628A.inc>
    __CONFIG 0x3F34
    list p=16F628A
    org 0

    Tried that and same error occurs:

    Error - section '.org_0' can not fit the absolute section. Section '.org_0' start=0x00000000, length=0x00000016
    Errors : 1

    Are you using MPLab, and using this "org 0" command?

    -LP

  4. #4
    Blueteeth Good Blueteeth Good Blueteeth Good
    Join Date
    Oct 2003
    Location
    Hertfordshire, UK
    Posts
    691

    Default

    Hi,

    I believe its, 'list', '#include', 'config', then 'org 0x000'. At least thats whats in the templates in MPLAB. In C:\Program Files\MPLAB IDE\MCHIP_Tools\TEMPLATE\Code

    I've never used 'org 0' because it doesn't compile.

    Blueteeth.
    Inconsistency is the key to flexibility!

  5. #5
    mramos1 Excellent mramos1 Excellent mramos1 Excellent mramos1 Excellent
    Join Date
    Sep 2005
    Location
    Boynton Beach, Florida USA
    Posts
    2,254

    Default

    Paste what you have here and someone will drop it in and test it (or see the problem).

  6. #6
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,774

    Default

    You are using a linker file and trying to write absolute code. Delete all files from the project except the .asm file and it will compile OK.

    Mike.

  7. #7
    lpinkai Newbie
    Join Date
    Jan 2007
    Location
    Texas
    Posts
    8

    Default Linker was my problem...

    Pommie was correct (and I knew I was overlooking something obvious). I had the linker file associated with my project. Once deleted, I could do absolute code, including using the org command. Thanks!!!

    -LP

+ Reply to Thread

Tags for this Thread