[Top][All Lists]

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

Re: [avr-gcc-list] Calling function with hard coded address

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Calling function with hard coded address
Date: Fri, 3 Nov 2006 22:04:50 +0100 (MET)

Claude Sylvain <address@hidden> wrote:

> I am new to the AVR MCU, and I was thinking that Z register is a
> byte pointer, instead of a word pointer.

To add to the confusion: partially, it is.  The AVR isn't sure about
itself whether it wants to address the ROM in 16-bit words or in 8-bit
words: for all instruction fetch cycles, addressing is in 16-bit
words, but when accessing the ROM for data fetch cycles (LPM/ELPM),
addressing is performed in 8-bit words.  Thus, devices with more than
64 KiB of ROM need ELPM + RAMPZ to be able to read data from the
entire ROM, but only devices with more than 128 KiB of ROM need EIND
for instruction reading.

That's the major reason why porting AVR-GCC to the ATmega256x
architecture has been such a comparatively difficult job.

cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

reply via email to

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