need for ORG_RESET ORG_PROGRAM usage help

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
tass
Posts: 19
Joined: Sat Jan 19, 2008 8:37 am
Location: France

need for ORG_RESET ORG_PROGRAM usage help

Post by tass » Sat Jun 28, 2008 9:27 am

hi all
it ill be very helpfull if any one can post a sample code using ORG_RESET ORG_PROGRAM
VECTOR_ISR_LO and VECTOR_ISR_HI
thanks

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Sat Jun 28, 2008 9:52 am

what is it you are trying to achieve...

tass
Posts: 19
Joined: Sat Jan 19, 2008 8:37 am
Location: France

Post by tass » Sat Jun 28, 2008 1:39 pm

i want do do a CAN bootloader

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Sat Jun 28, 2008 7:50 pm

The first thing you need to do is decide if your loader is to reside in lower or upper ROM. If your loader is to use lower ROM, then you only need to consider using vector_isr_low and vector_isr_hi to remap the interrupt vectors for the user program. For example, if user code is to start at $400 then:

Code: Select all

#option vector_isr_hi = $408
#option vector_isr_lo = $418
will remap the high and low vectors to $408 and $418 respectively. After your loader has finished, you would typically issue a 'goto $400' to execute the user program. The user code would then need to use:

Code: Select all

#option org_reset = $400
to ensure their program starts at the correct address.

If your loader is to use upper ROM, then you need to use:

Code: Select all

#option org_program = address
where address is the start of your loader code. This ensures that a 'goto address' is inserted at the reset vector that will jump to your loader in upper ROM. You do not need to remap the interrupt vectors if your loader resides in upper ROM.

tass
Posts: 19
Joined: Sat Jan 19, 2008 8:37 am
Location: France

Post by tass » Sun Jun 29, 2008 11:02 am

thank you david for your reply
i will use the first solution because i have to store some data at the end of the ROM but i think that it is better to remap the interrupts the invert order because the hi ISR is critical in time so mapping it at $418 dont need another jump

Post Reply