avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] pointer width..


From: Jeff Epler
Subject: Re: [avr-chat] pointer width..
Date: Fri, 25 Mar 2005 12:51:39 -0600
User-agent: Mutt/1.4.1i

On Fri, Mar 25, 2005 at 11:26:39AM -0600, Hugo González Monteverde wrote:
> register uint8_t *ndx asm("r4");
...
> 
> Isn't a pointer to data RAM 16 bits wide? I mean, it should be able to 
> address 64KB of data..
> 
> Can one declare a pointer to an int and store it in a 8 bit register? 
> I'd guess not...

I believe that this statement makes the pointer reside in r4:r5.  The
disassembly in another message in this thread shows 'movw' (which moves
register pairs) moving the pointer from r4 to one of the indexing
registers for the pointer dereference and increment.

Whether avr-gcc gets the rest of the details right (not ever allocating
r5, for instance), I don't know.

Jeff

Attachment: pgpmLDakxbkUL.pgp
Description: PGP signature


reply via email to

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