View previous topic :: View next topic |
Author |
Message |
ktallevi
Joined: 17 Dec 2005 Posts: 58
|
please explain this issue when compiling code... |
Posted: Tue Jul 25, 2006 8:34 pm |
|
|
When compiling code in CCS/MPLAB, the first line always appears like this...
EF52 F004 FFFF FFFF 6AF7 0F1C 6EF6 0E08 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jul 25, 2006 8:39 pm |
|
|
Look at the .LST file for an explanation. You can find it in your project
folder. |
|
|
ktallevi
Joined: 17 Dec 2005 Posts: 58
|
list file |
Posted: Tue Jul 25, 2006 9:03 pm |
|
|
well according to the list file of one of my projects...
00000: GOTO 058C |
|
|
ktallevi
Joined: 17 Dec 2005 Posts: 58
|
posting |
Posted: Tue Jul 25, 2006 9:06 pm |
|
|
seems only a portion of my posts are actually getting posted, ok so that jump still doesnt explain WHY its there |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jul 25, 2006 9:12 pm |
|
|
The PIC starts executing code at address 0000 upon reset.
The compiler puts an instruction there to jump to the start of the program.
Scroll down in the .LST file until you get to address 0x058C.
What does the compiler show is there ? (In C source code) |
|
|
ktallevi
Joined: 17 Dec 2005 Posts: 58
|
list file |
Posted: Tue Jul 25, 2006 9:36 pm |
|
|
.................... void main(void)
.................... {
*
0058C: CLRF FF8
0058E: BCF FD0.7 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jul 25, 2006 9:40 pm |
|
|
That answers your question. The code you see at the start of main()
is the compiler's start-up code. It does a small amount of initialization
of ports and registers, and then begins executing your code. |
|
|
ktallevi
Joined: 17 Dec 2005 Posts: 58
|
bootloader |
Posted: Tue Jul 25, 2006 9:42 pm |
|
|
thanks for your help, this all started when i was converting loader.c to work with pic18f8722 (which writes 64bytes at a time), i was reading the packet and realized there was data missing. Ill finish the bootloader and post it. |
|
|
|