#63 access the saved regs from an int handler

closed
nobody
None
5
2008-02-16
2007-06-15
Stas Sergeev
No

Hi.

I need to access the saved SFR registers from
an interrupt handler (mcs51) - how can I do that?
I also need to access the return address, and
modify it, if need be.
Some compilers I used, allowed to do this by
defining the function arguments for the interrupt
handler, but sdcc explicitly prohibits that.
So what to do? The quick look into the doc
didn't reveal anything sensible...

Discussion

  • Maarten Brock
    Maarten Brock
    2008-02-16

    Logged In: YES
    user_id=888171
    Originator: NO

    This is already an older support request, but here's an answer anyway.

    SDCC does not support what you ask. The only way to do this is by writing the ISR in assembly.

    I close this request now because I think its useless to keep it pending for another few weeks.

     
  • Maarten Brock
    Maarten Brock
    2008-02-16

    • status: open --> closed
     
  • Stas Sergeev
    Stas Sergeev
    2008-02-16

    Logged In: YES
    user_id=501371
    Originator: YES

    Well you could as well promote that to an RFE
    of course. But I won't care much as the
    workaround I use is to mark the inthandler
    as "using 1" and then modify the regs by
    hands.