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

Kris Heidenstrom kris at abbey.co.nz
Tue Jan 23 12:27:14 PST 2007


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



More information about the Icc-430 mailing list