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

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

RE: [avr-gcc-list] AvrX and pgm_read_byte_near()


From: E. Weddington
Subject: RE: [avr-gcc-list] AvrX and pgm_read_byte_near()
Date: Wed, 26 Nov 2003 10:19:31 -0700

On 25 Nov 2003 at 23:33, Christian Ludlam wrote:

> On 25 Nov E. Weddington wrote:
> 
> > On 25 Nov 2003 at 8:28, Brian Cuthie wrote:
> 
> > > In looking at the gcc docs it appears that it's not possible to specify
> > > registers in a clobber list that are bound to some input parameter.
> > > Could that be what's going on here?
> 
> > Hmm. Yeah, I'm seeing that in the docs too. So perhaps the __LPM macros
> > are not in error, but perhaps the __ELPM macros are? (for listing Z reg in
> > clobber list) Interestingly, I've never had any problems with compiling
> > with the __ELPM macros and I haven't heard of any similar problems...
> 
> > Anybody else have thoughts on this?
> 
> I'm no expert, but look closely at the macros. The __LPM macros declare Z as
> an input, and don't change it (LPM by itself has no effect on the Z
> register), so Z is not clobbered.
> 
> The __ELPM macros move the input parameter into the Z register without
> declaring it as an input - they have to do this since they need to load
> RAMPZ and Z isn't big enough to hold the address by itself. Thus Z is
> clobbered.
> 
> I don't personally think there's a problem with either of these macros.

Thanks for taking a look at this.
Eric


reply via email to

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