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

Status
Not open for further replies.

lpinkai

New Member
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
 
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
 
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.
 
Paste what you have here and someone will drop it in and test it (or see the problem).
 
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.
 
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
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…