This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Assembly program

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?

Parents
  • "Before calling I am checking particular bit of the register related to that ISR, if it is set then only I am calling that ISR."

    But Why? That is entirely pointless!

    This is exactly what the interrupt hardware does - there is no point in doing it software!

    If you just want to poll the bit, and call a non-interrupt function, that's fine; but don't call it an ISR - because it is not an ISR!

Reply
  • "Before calling I am checking particular bit of the register related to that ISR, if it is set then only I am calling that ISR."

    But Why? That is entirely pointless!

    This is exactly what the interrupt hardware does - there is no point in doing it software!

    If you just want to poll the bit, and call a non-interrupt function, that's fine; but don't call it an ISR - because it is not an ISR!

Children