[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] jump_to_null question
From: |
Rolf Magnus |
Subject: |
Re: [avr-gcc-list] jump_to_null question |
Date: |
Sat, 26 May 2007 22:21:18 +0200 |
User-agent: |
KMail/1.9.6 |
On Donnerstag, 24. Mai 2007, Dr. Jan Menzel wrote:
> Hi all!
> I'm currently working on a bootloader for Mega8 and 88 and found a
> problem I do not yet understand. At the end of the bootloader the code
> has to jump to the main reset vector at address 0x0000. If I do the
> usual way
> void (*jump_to_null)(void) = 0x0000;
> gcc 3.4.6 complies:
> LDI R30, 0x0102
> LDI R31, 0x0103
> ICALL
> and everything works fine, as expected.
> But if I try to be more specific and define
> void (* const jump_to_main)(void) = 0x0000;
> gcc 3.4.6 complies
> RCALL PC-0x0009
> which unfortunately does not what I intended.
> Could anyone please point me to my error in reasoning or lack of
> understanding? Many thanks!
If you want to jump to address 0, you can also do:
goto *0x0000;
Re: [avr-gcc-list] jump_to_null question,
Rolf Magnus <=