[Top][All Lists]

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

Re: [avr-gcc-list] function prologues

From: Dmitry K.
Subject: Re: [avr-gcc-list] function prologues
Date: Sun, 8 Jun 2003 12:54:02 +1100
User-agent: KMail/1.5

4 Jun 2003 11:25 Theodore A. Roth wrote:
> Hi All,
> I'm in the middle of a major overhaul of the avr port for gdb. Turns
> out the prologue scanner was pretty badly broken. After studying the
> asm generated by gcc-3.3, I've come up with this:
> A signal or interrupt handler prologue looks like this:
>      sei     ; interrupt only, not in signal function.
>      push    __zero_reg__
>      push    __tmp_reg__
>      in      __tmp_reg__, __SREG__
>      push    __tmp_reg__
>      clr     __zero_reg__
>      push    rXX             ; save registers except for r29/r28
>      ...
>      push    r28             ; save frame pointer
>      push    r29
>      in      r28, __SP_L__
>      in      r29, __SP_H__
>      sbiw    r28, <LOCALS_SIZE>
>      out     __SP_H__, r29
>      out     __SP_L__, r28
> I would appreciate if some kind souls could review this and send me
> corrections.

"Signal" - yes, but "Interrupt" handler use cli/sei pair:
        out __SP_H__,r29
        out __SP_L__,r28

Best wishes.

reply via email to

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