NAME MODULENAME .... .... EXTRN CODE (function1) .... .... mov dptr,#0x9000 mov a,@dptr cjne a,#0x02,label1 lcall my_isr_function label: NOP .... .... Is this the correct way to call a C function from assembly?Do I need to save the program status before calling the my_isr_function?
http://www.keil.com/support/man/docs/c51/c51_le_interruptfuncs.htm In particular, look at the bullet points at the bottom of that page: "The compiler recognizes direct calls to interrupt functions and rejects them. It is pointless to call interrupt procedures directly, because exiting the procedure causes execution of the RETI instruction which affects the hardware interrupt system of the 8051 chip. Because no interrupt request on the part of the hardware existed, the effect of this instruction is indeterminate and usually fatal..." (my emphasis)