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

Kris Heidenstrom kris at abbey.co.nz
Thu Jan 25 18:22:29 PST 2007


Kirk Bailey wrote:

> As I commented earlier, I strongly agree with Kris on this.
> I understand your point of view well (I spent a decade
> doing compiler support myself!), but if you follow your
> logic further you would decide that you really should
> preserve ALL the registers with the wrapper, "just in
> case"!

Exactly... If you really think that the called code could
destroy _everything_, the compiler should preserve R4~7
as well. There's nothing special about R8 and R9 that
makes them more likely to be clobbered by code that
doesn't comply with your conventions. I think you have
to assume that it will follow the standard register
allocation and calling conventions as stated in the help.

> This is a real issue for folks and you already have a
> calling convention that you have defined and is well
> documented. Better that folks that follow the rules
> get good results than people who don't follow the
> rules have bad code with a slightly higher chance of
> working by accident.

Well put :-)

--
Kris Heidenstrom Embedded systems designer / programmer
kris at abbey.co.nz <mailto: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