lint, pointers, 0 (what else?)
darryl at haddock.UUCP
darryl at haddock.UUCP
Sat Feb 9 14:49:28 AEST 1985
>The Motorola 68000 speaks with forked tongue here. 16 bits is suggested
>by the 16-bit data paths used for non-address arithmetic (2 extra clocks
>for a 32-bit "add", f'rinstance), by the lack of 32-bit multiply or
>divide instructions, and by the 16-bit external bus. 32 bits is suggested
>by the large address space. There is, thus, a good reason for having
>sizeof(int) == 2 and sizeof(char *) == 4 - speed of execution. There is
>also a good reason for having them both == 4 - it would be nice to have
>an "int" hold the size of an object larger than 65535 bytes. There's
>a tradeoff here; depending on your application, either one could be the
>correct choice.
>
> Guy Harris
> {seismo,ihnp4,allegra}!rlgvax!guy
I agree with your points, Guy, but I just want to add one more here: K&R
does say that the difference of two pointers is an INT. If you want arrays
bigger than 32k-1 elements in your large address space, best to go with 32
bit ints on the 68000. The draft standard removes this problem by making
the size of the result of a pointer subtractiion implementation-defined.
--Darryl Richman
...!cca!ima!ism780!darryl
More information about the Comp.lang.c
mailing list