pGC-hotmail-5A4

Name:Mr. Patrick Garcia Carreon
Web Site:

David A Cary Says:


"error 118 with the message - overwriting previous contents at 004."

This usually doesn't happen when I use the "relocatable code" programming style (using the "code" directive).

This happens all the time when I use the "absolute code" programming style.
By default, the MPLAB assembler takes your code and starts assembling it starting at location 000.
Later, when my source file tells MPLAB to assemble an interrupt routine (which must start at address 004), those locations have already been used up by other instructions.

The source code file needs to make address 000 contain a "goto start" instruction.
Then the source code file should start the interrupt routine at address 004. Then the main program (beginning with "start:") is placed *after* the interrupt routine in the source code file.

Placing the interrupt routine after the main program in the source code file never works for me.

I hope that helps.
--
David Cary