cancel
Showing results for 
Search instead for 
Did you mean: 

Make a jump to a function from an interrupt with gcc inline assembly

ziz
Associate II
Posted on May 30, 2016 at 21:08


 Hi,
 how can i do to jump (with gcc inline assembly on cortex M3/M4) to main after an interrupt. I don't want to use flag in my case.

 void
my_interrupt(
void
)
{
__asm__ __volatile__ (
''instruction1 to jump to main''
''instruction2 to go to main''
)
}
int
main(
void
)
{
my_code();
 ...
 ... 
}

 Thanks. 

2 REPLIES 2
Radosław
Senior II
Posted on May 30, 2016 at 21:14

jump to main from interrupt = STUPIDITY.

nevermind why assembly for only 1 jump??

ziz
Associate II
Posted on May 30, 2016 at 23:32

Hi, the ''main function'' were an example ( i can do a reset). In fact, I'm more interested by a jump to another function. And as I try to learn assembler, it's also interesting for me.

Otherwise, my problem is i have a function with many long delay.

And i would like to stop it after an interrupt. (long delay are nedded by the app ).

Is jump after interupt to another function is stupid ?

If yes, what is the usual way to this problem ?

( I also try exit(to_function()); but that not works.)

Thanks