avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] store program address into a variable


From: johan.olin
Subject: Re: [avr-gcc-list] store program address into a variable
Date: Mon, 15 Oct 2001 12:11:48 -0000



Instead of using a label and a pointer to it,
try using a function / func-pointer.

At least to me, that sounds more "correct" ....

If You give the function a 'naked' attribute, 
and use a pointer to the function, the pointer
should point to the first instruction of the function ....


BR : Johan

PS. I haven't tried this 'pointer to naked function' stuff,
I'm just guessing .....

Pietro Nizzola <address@hidden> wrote:

> Hi,
> I would like to get the program address of a given instruction and store
> this address into a variable.
> How can I achieve this?
> My idea ist something like this, but it doesn't work:
> 
> void (*address)(void);
> 
> void Job1(void)
> {
>    ....
> }
> 
> int main(void)
> {
>   address = label;
>    ...
>    Job1();
> label:
>    ...
>    return;
> }
> 
> Grazie
> Pietro
> 
> 
> 
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list
> 



-- 




________________________________________________________________
Ilmainen Internet @ http://www.nic.fi/




reply via email to

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