32 ms·
But when C was invented, CPUs were primarily designed to run hand-coded assembly. So why didn’t they trap by default? …Well, I don’t know. Probably because it’s
by Animats 3y ago
But when C was invented, CPUs were primarily designed to run hand-coded assembly. So why didn’t they trap by default? …Well, I don’t know. Probably because it’s simpler that way. But someone better acquainted with the history might have a better answer.
VAXen had a trap on overflow capability. I once rebuilt the C compiler to set that bit in the function header mask, and recompiled many of the UNIX utilities. About half of them broke. It was too late for a retrofit by 1980.
Burroughs machines had 48-bit numbers, which were signed-magnitude floats using a 32-bit mantissa with the binary point at the low end. So integers were floats with a zero mantissa. Integer overflow caused promotion to a float.
So, the hardware people did try.