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...
--
Tero
_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list