Yahoo Groups archive

AVR-Chat

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

Message

Re: [AVR-Chat] Re: Some questions about the stack in an AVR ATmega168A

2011-11-25 by fireweaver

I'm new to the AVR, but it does seem to be a bit odd.  I was trying to 
keep ZH:ZL in sync with PCH:PCL and this is what seems to work.

fireweaver

On 11/24/2011 11:02 AM, Don Kinzer wrote:
> --- In AVR-Chat@yahoogroups.com, fireweaver<firewevr@...>  wrote:
>> On calls and interrupts, push low PC first, then high PC.
> That is correct.  Note, too, that on devices with more than 128K of flash (e.g. mega2560 or xmega128A1) the third, most significant, byte of the PC is pushed last.
>
> I've always thought that this order was odd for the AVR since the return address ends up in big-endian form in RAM.
>
> Don Kinzer
> ZBasic Microcontrollers
> http://www.zbasic.net
>
>
>

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.