[Coco] Basic09 Level 3
John W. Linville
linville at tuxdriver.com
Wed Aug 14 11:47:17 EDT 2013
On Tue, Aug 13, 2013 at 07:10:05PM -0700, Wayne Campbell wrote:
> That would be awesome too! On the subject, there is a difference between
> what defines a short, an int and a long between 6x09 and 680x0 processors,
> for those who may not know.
>
> 6x09: short: 2 bytes; int: 2 bytes; long: 4 bytes
> 680x0: short: 2 bytes; int: 4 bytes; long: 8 bytes
Not sure which compiler you are using, but I recall the 680x0 using
4 bytes for a long (i.e. same as int). This is consistent with the
"move.l" and similar mnemonics in the 68000 assembly language.
http://en.wikipedia.org/wiki/Motorola_68000
FWIW, I think the Alpha compilers used 8 bytes for long (but maybe
4 bytes for int), while most other arches went to "long long"
for 8 byte types. Various other CPUs and compilers have different
conventions as well.
All this confusion about size of integral types is what led to the
creation of the stdint.h header file in the C99 spec...
http://en.wikibooks.org/wiki/C_Programming/C_Reference/stdint.h
Hth!
John
--
John W. Linville Someday the world will need a hero, and you
linville at tuxdriver.com might be all we have. Be ready.
More information about the Coco
mailing list