4 ms·
On a 16 bit cpu I worked on char, short, and int were all 16 bit words, long and long long were 32 and 64 bits, but doing math with 32 bit words required the C
by timeinput 5y ago
On a 16 bit cpu I worked on char, short, and int were all 16 bit words, long and long long were 32 and 64 bits, but doing math with 32 bit words required the C compiler to emmit instructions to manage the 32-bit operations.
Also sizeof(long) was 2 and sizeof(long long) was 4.
- CyberRabbi 5y agoI was mistaken. I think long must be a minimum of 32 bits according to the standard
- ant6n 5y ago> Also sizeof(long) was 2 and sizeof(long long) was 4 Wait what? Doesnt that mean a byte somehow has 16 bits?
- CyberRabbi 5y agosizeof() is measured in number of chars, I.e. sizeof(char) is always 1. As he said, char was also 16-bit.
- anyfoo 5y agoWhile you got an answer already, there was also a time where 8 bit wasn't standard yet, and computers existed in all kinds of word sizes. 18 bit, 36 bit, and even "variable size" (i.e. IBM 1401). The further back you go, the more it shatters what we consider "normal" and "essentially fixed" in today's computer world.