[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: WDC's 32-bit W65T32
geoff wrote:
> I am pretty sure everybody always allocate 32-bits for (int *) when writing
> in assembly (the high byte is ignored). When would you actually _need_ to
> use just 24-bits? I don't see why a IIgs C compiler can't handle 32-bit
> (int *). I looked at this a couple of years ago and did not see any gotchas.
Certainly a C compiler could use four bytes to store pointers on the 65816,
with one byte going to waste. But it also could use only three bytes, and
still be fully conformant to the C standard, since the standard does not
require the size of a pointer to be identical to the size of any numeric
type.
As has been observed, this might break a lot of supposedly portable C
code.
If the hypothetical compiler were to offer support for three-byte pointers,
it might be a good idea for it to make that a selectable option at compile
time. It would also be a good idea to mark object files with which setting
was used, so that trying to link modules with different pointer sizes would
give an error rather than resulting in an executable that crashes.
Eric