avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] volatile in pgmspace.h ?


From: Marek Michalkiewicz
Subject: Re: [avr-libc-dev] volatile in pgmspace.h ?
Date: Tue, 17 Jun 2003 00:03:40 +0200
User-agent: Mutt/1.4i

On Mon, Jun 16, 2003 at 08:53:50PM +0000, E. Weddington wrote:
> > __LPM_enhanced__ should use "lpm %0,Z" (not Z+).
> 
> This was added because of a request to add other macros to 
> allow further contiguous reads of flash without having to 
> provide the address. I knew that this was only going to be 
> available for the enhanced cores. I wrote an RFC to this 
> list, with little response: 
> <http://mail.nongnu.org/archive/html/avr-libc-dev/2003-
> 06/msg00002.html>

IMHO, the "without having to provide the address" part is
problematic - you really have to pass the pointer variable to
the "asm" code and back (as an input and output operand), as
shown in my previous mail.  There is no guarantee that any
registers are preserved between one "asm" and the next one.

I think pgm_read_{byte,word}_next(address) shold be implemented
so that the post-incremented address is passed back to the caller
(for use in subsequent reads).  Then you can use the same macro
for all reads, including the first one.

Marek





reply via email to

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