avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] SREG save?


From: Larry Barello
Subject: RE: [avr-gcc-list] SREG save?
Date: Tue, 14 Dec 2004 06:11:29 -0800

The SIGNAL() and INTERRUPT() macro's will save/restore SREG for you.  It is
unnecessary to do it a second time.

-----Original Message-----
From: Gergely Szentesi

Hi!

I`m working on a small project with an atmega128 proc.
About the gcc i have a following question:
Should i save the SREG ( system register ) to a register when the program
enters to a signal or interrup routine or after a cli() ( disable global
interrupt )?

SIGNAL(...)
{
    char csreg;
    csreg = SREG;        //is it important or not?
    ...code....
    SREG = csreg;
}

Thanx: )



reply via email to

[Prev in Thread] Current Thread [Next in Thread]