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

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

RE: [avr-gcc-list] 24 bit Integer


From: Stu Bell
Subject: RE: [avr-gcc-list] 24 bit Integer
Date: Thu, 31 Jul 2008 09:31:21 -0600

HAH!  Hey, how about a Univac SolidState-80 (circa 1959)?  5000 bi-quint words!  Can we code for that?
 
Stu ( :-P )


From: address@hidden [mailto:address@hidden On Behalf Of Steven Michalske
Sent: Wednesday, July 30, 2008 8:38 PM
To: avr-gcc List
Subject: Re: [avr-gcc-list] 24 bit Integer

what about a PDP 8 or PDP 15,  could we not code for it?   being 12 and 18 bit machines?

Steve

On Jul 30, 2008, at 8:36 AM, Dave Hansen wrote:



From: address@hidden

> 2008/7/14 Weddington, Eric <address@hidden>:
> > A 24-bit integer is not supported by the C language. In theory, support
> > could be added to GCC, but then it would be considered an extension to
> > the C language. And it would also be difficult and/or time-consuming to
> > add to GCC.
> 
> The C standard doesn't dictate the size of any integer type, except that char
> must be large enough to hold the environments standard character set and
> the size of any larger types is ordered as you'd expect.
> char <= short <= int <= long
 
Also that short and int must be able to represent at least -32767 to +32767, and long must be able to represent +/-2,147,483,647.  So int24_t would have to be a special type outside the standard types.
 
And I think (though I'm not certain) that it would have to be promoted to long before any operator could be applied.  Some of that would be mitigated by the as-if rule, of course...

> int is typically the natural word size for the architecture, but often on 8 bit
> micros it will be larger (since char typically provides an 8 bit int anyway.)

It's larger because an 8 bits can't represent the required range of values.
 
Regards,
 
   -=Dave
 


Time for vacation? WIN what you need. Enter Now! _______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


reply via email to

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