Hello ! I have an interrupt like this : void int_timer_0 (void) interrupt 1 { ... instructions ... if ( condition ) { // power down } ... instructions ... } In the interrupt, i want to execute an C function 'power_down' (this function power down the product with an infinite loop ). But the interrupt (timer 0) must be call on the next timer overflows because it is used to transmit the power down information. So, i want to put in the stack the address of the function to call and make a return from interrupt. I want to insert a code like this : #pragma asm push ??? ; power_down address (high) push ??? ; power_down address (low) reti #pragma endasm but i don't know the syntax for the address of 'C' fucntion. Thanks Benoit.
This all hinges on the C51 naming conventions. Although it is (of course) all in the manual, the following procedure might help significantly: Put a regular C call to the function in your C file (the one with in-line assembler). Build the project and then look at the .src file that was generated. Somewhere, the compiler will have generated an LCALL to the label you need. Copy the label and return to editing the C file. Paste the label into the in-line assembler where you need it and delete the regular C function call.