Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

RE: [AVR-Chat] Re: Mixing C and assembly with special requirements.

2012-03-29 by Tim Mitchell

----Original Message----
From: AVR-Chat@yahoogroups.com
[mailto:AVR-Chat@yahoogroups.com] On Behalf Of Don Kinzer
Sent: 29 March 2012 16:05 To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] Re: Mixing C and assembly with special
requirements. 

> --- In AVR-Chat@yahoogroups.com, "Tim Mitchell" <tim@...>
> wrote: 
> > Obviously for asm interrupt routines you have to save
> > and restore everything.
> To be more precise, you need only save/restore the
> registers modified in the ISR (and any functions it
> calls).  
> 

Indeed, I was a bit unclear there, I meant that you can't even modify the "clobberable" registers.

Need to watch out for stuff like R0/R1 being modified when you use the mul instruction. Got bitten by that once. And remember to save SREG in interrupt routines.


-- 
Tim Mitchell

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.