[Icc-430] Interrupt handler wrapper preserves R8,9 - repost

bailey at peak.org bailey at peak.org
Tue Jan 23 14:18:17 PST 2007


Kris et al,
    This makes sense to me.  I was surprised by the save/restore overhead
when I was debugging some really light-weight routines, but I never dug
into the details.  Unless there is a problem with this that Richard knows
about, I would strongly support making this change.

    Kirk Bailey
    bailey at peak.org

> Hi,
>
> I'm reposting this from 2006-11-30 because
> no one replied then. I've confirmed the issue
> still exists with V7.05 beta0.
>
> The compiler-generated interrupt handler wrapper
> code preserves R8 and R9 as well as R10~15.
> I don't think it should.
>
>>From "Assembly Interface and Calling
> Conventions" in the online help:
> ----------------------------------------
> Preserved Registers R4~9
> These registers are called preserved registers,
> since their contents are unchanged by a function
> call. Local variables are assigned to these registers
> by the compiler.
>
> Volatile Registers R10~15
> Can be used in a function without being saved or
> restored. These registers are called volatile registers,
> since their contents may be changed by a function
> call.
>
> Interrupt Handlers
> If you write a handler in assembly and if it calls
> normal C functions, then the assembly handler
> must save and restore the volatile registers,
> since normal C functions do not preserve them.
> ----------------------------------------
>
> I think the descriptions in the help are right and
> up-to-date, and I think the interrupt handler
> wrapper is out-of-date. I wrote my own wrapper
> in assembler, which does not preserve R8 and
> R9, and everything seemed to work OK.
>
> Am I missing something here?
>
> Kris
> --
> Kris Heidenstrom         Embedded systems designer / programmer
> kris at abbey.co.nz         Abbey Systems Ltd - Telemetry Specialists
> Wellington NEW ZEALAND   Voice +64-4-385-6611  Fax +64-4-385-6848
>
> _______________________________________________
> Icc-430 mailing list
> Icc-430 at imagecraft.com
> http://dragonsgate.net/mailman/listinfo/icc-430
>




More information about the Icc-430 mailing list