[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] address lables for > 128k flash

From: Tero Sinervo
Subject: Re: [avr-gcc-list] address lables for > 128k flash
Date: Fri, 08 May 2009 12:22:49 +0300
User-agent: Thunderbird (Windows/20090302)

Sean D'Epagnier wrote:
Any more thoughts on this?   Unfortunately address labels go in a void
* which seems like it should remain at 2 bytes.. so it's going to be
difficult.  Maybe instead of storing the absolute address, a relative
address could be stored from the beginning of the function.

Look into http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html

There's an interesting example:
     static const int array[] = { &&foo - &&foo, &&bar - &&foo,
                                  &&hack - &&foo };
     goto *(&&foo + array[i]);

That looks like a way to get relative addresses. So perhaps you could hack lc-addrlabels.h so that the local continuation object contains the function's absolute start address (set in LC_INIT()) and a relative address to the current location (set in LC_SET()). Then you'd have to use inline assembly to do an explicit RJMP in LC_RESUME() instead of a goto.

This might still introduce problems if the function resides on the 64kword boundary.

The switch implementation somehow doesn't seem so bad any more...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]