CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

relocating code from 0x00 to 0x100 for PIC18F877A bootloader

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Dave MacCallum
Guest







relocating code from 0x00 to 0x100 for PIC18F877A bootloader
PostPosted: Wed Mar 12, 2003 12:05 pm     Reply with quote

Hi,
I am using PCM compiler version 3.145 , with PIC16F877A and bootloader AN851b from the microchip website.

I need to relocate my application code to outwith the boot region ( 0x00 – 0xff ) which I wish to protect.

I am having problems using
#org 0x0000,0x0ff
void bootloader() {
#asm
nop
#endasm
} // Reserve space for the bootloader
The compiler will not let me do this, giving error 126 : Invalid ORG range.

I found the following code on the web for a PIC18F bootloader
#build(reset=0x100)
#build(interrupt=0x104)
#org 0x0000,0x0ff
void bootloader() {
#asm
nop
#endasm
} // Reserve space for the bootloader
This code allows me to reserve 0x00 to 0xff but gives me:
0x100: nop
0x101: MOVLW 00 --------- if this was MOVLW 08 it would work,
0x102: MOWVF 0A
0x103: GOTO MAIN ( or equivalent address )
Questions:
1) any ideas for relocating code, any workarounds that I can use to relocate my code , which will give me the long jump as required
2) any info on this #build directive
Best Regards,
David
___________________________
This message was ported from CCS's old forum
Original Post ID: 12574
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: relocating code from 0x00 to 0x100 for PIC18F877A bootlo
PostPosted: Wed Mar 12, 2003 12:59 pm     Reply with quote

:=Hi,
:= I am using PCM compiler version 3.145 , with PIC16F877A and bootloader AN851b from the microchip website.
:=
:= I need to relocate my application code to outwith the boot region ( 0x00 – 0xff ) which I wish to protect.
:=
:= I am having problems using
:=#org 0x0000,0x0ff
:=void bootloader() {
:=#asm
:=nop
:=#endasm
:=} // Reserve space for the bootloader
------------------------------------------------------------
This topic comes up at least once a month. Do a search
on this board for the last 300 or 600 days for "bootloader".
Also, tell it to search inside messages.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12578
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group