On Fri, Jan 25, 2002 at 06:50:53PM -0800, Joe wrote:
> 
> I wrote:
> > >The processors currently used by Palm OS devices do not allow
> > >addressing of odd-numbered bytes,
> 
> --- Keith Rollin wrote:
> > Sure they do!  How else would it access name[1]?
> 
> Of course, Keith is right.  What I meant is that variables must be
> aligned on an even boundry.  Naturally, you can access every byte after
> that, but variables must be word-aligned.  The compiler will,
> therefore, "waste space" by padding structures to ensure that each
> variable starts at an even address.  Hopefully that was clear to anyone
> who read my entire post.  I'll just have to choose my words more
> carefully next time!

The processor doesn't have any clue about variables. Variables are a
concept inherent to programming languages. In this case the processor
can access bytes at any location in memory, while it has constraints
for words and double words (which must be aligned).
AFAIK the compiler can decide to align every variable (for simplicity
of implementation, to guarantee proper alignment to every data type),
but it could also avoid the alignment when unnecessary.
But the programmer is not supposed to fiddle with these issues (which
are implementation details).

Marco

-- 
========================================================================
Marco Pantaleoni                                  [EMAIL PROTECTED]
Padova, Italy                                              [EMAIL PROTECTED]
elastiC language developer                   http://www.elasticworld.org

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to