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

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

RE: [avr-gcc-list] port access with avr-gdb


From: Dave Hylands
Subject: RE: [avr-gcc-list] port access with avr-gdb
Date: Fri, 18 Jun 2004 06:37:52 -0700

Hi Larry,

I'd say that the only real portability you could hope for is between
compiler vendors for the same chip.

The C Language doesn't specify what order to assign bits in, how much
space a bitfield occupies, and a few other details. This is what causes
the non-portability.

So, for example, if a compiler chose to make pack bitfields into a 16
bit data type, then you might have some trouble. If they pack them into
8 bit data types, then you could just have a slightly different header
to accommodate other differences between the compilers.

I see that we're really discussing two things here. One is putting the
registers into a big structure. The second is providing a further
subdivision of the registers into bit fields.

I'm not sure that portability is a big concern, and for those who it is,
they tend to abstract things appropriately to deal with the issues.

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/ 


> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden On Behalf Of Larry Barello
> Sent: Friday, June 18, 2004 6:17 AM
> To: AVR GCC List
> Subject: RE: [avr-gcc-list] port access with avr-gdb
> 
> 
> We are talking I/O and registers: just how portable can those be???
> 
> Or are you talking about porting code between compiler 
> vendors for the same chip?  Do makers of  C compilers 
> randomly choose between low to high and high to low for bit 
> field assignments? Or does it more have to do with the
> architecture: big vs little endien and/or any data space 
> access requirements peculiar to that hardware?
> 
> -----Original Message-----
> From: Joerg Wunsch
> 
> "David Brown" <address@hidden> wrote:
> 
> > What sort of portability are you looking for?  Being able to take a 
> > program for an AVR and run it unaltered on an MSP430?  
> Being able to 
> > take a program for gcc-avr and being able to compile it 
> unaltered on 
> > iar-avr?
> 
> The way the macros are currently arranged matches the way 
> Atmel uses in their datasheets (which has most certainly been 
> influenced by the way IAR does it).  There are still enough 
> further compatibility issues between IAR and GCC, sure 
> (notably GCC's missing ability to handle memory sections 
> automagically), but the direct assignment of IO registers 
> helps quite a bit (together with using the exact register 
> names as described in Atmel's datasheets).
> 
> 
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden 
> http://www.avr1.org/mailman/listinfo/avr-gcc-list
> 
> 



reply via email to

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