I'll post the code if needed, but for now I'll see if I'm breaking some general rule here.
I'm porting some floating point routines from Microchip's application notes (that use 16C and 17C) over to the 18F. Long story short, it's compiling without errors, but instead of following the "ORG 0 then GOTO START" and actually going to START, it is jumping directly into a subroutine at the top of one of my include files. If I run the simulator I get a stack underflow error whenever it finally reaches the "retlw."
I'm using multiple include files because the app notes had several of them and I've just fixed what I needed to fix.
Looking at the map file it shows the subroutine label in the include file that it keeps going to as address 00000. I'm not sure why, or how to work around this.
I should add that nomatter where I put that include file in the code, the simulator always pulls it up first. There is NOT an ORG directive within the include file. MPLAB is completely skipping over the "ORG 0" I've got in the code.
I'm porting some floating point routines from Microchip's application notes (that use 16C and 17C) over to the 18F. Long story short, it's compiling without errors, but instead of following the "ORG 0 then GOTO START" and actually going to START, it is jumping directly into a subroutine at the top of one of my include files. If I run the simulator I get a stack underflow error whenever it finally reaches the "retlw."
I'm using multiple include files because the app notes had several of them and I've just fixed what I needed to fix.
Looking at the map file it shows the subroutine label in the include file that it keeps going to as address 00000. I'm not sure why, or how to work around this.
I should add that nomatter where I put that include file in the code, the simulator always pulls it up first. There is NOT an ORG directive within the include file. MPLAB is completely skipping over the "ORG 0" I've got in the code.
Last edited: