On: raising the semantic level of a program

Chuck Guzis cclist at sydex.com
Sun Jun 28 18:50:32 CDT 2020


On 6/28/20 4:20 PM, Peter Corlett via cctalk wrote:
> On Sun, Jun 28, 2020 at 01:32:02PM -0700, Chuck Guzis via cctalk wrote:
> [...]
>> Why is byte-granularity in addressing a necessity?
> 
> Because C's strings are broken by design and require one to be able to form a
> pointer to individual characters.

That's not a barrier, as IIRC, the C standard doesn't call out a
specific format for pointers, other than that of NULL.

I know that there was a C for the CDC Cyber series, but I don't recall
the implementation details.

It's noteworthy that on the Univac 1100 series, a "byte" could be 6, 9
or 12 bits, but not 8. (36 bit words).  The PDP-10 had similar issues,
such as the "packed" string format of 5 7-bit characters per word, with
one bit unused.

 > One wheeze is to just declare that bytes are the same size as a
machine word. C
> doesn't require char to be exactly 8 bits, but merely at least 8 bits. However,
> a lot of C code will break if char, short, int and long aren't exactly the same
> size as they are on x86. Mind you, a lot of it is still broken even if they
> are...

Who cares about x86?  I suspect that there's a lot of x86 code out there
that assumes little-endian quantities as well.

If you want to run code written for the x86 platform, get an x86 system.

--Chuck




More information about the cctech mailing list