Welcome to TSDN.
Actually, the size of Integer dose not depend on OS.
It depends on the environment the Language uses.
Means if the Runtime Environment uses X bit then the length of Integer will be X bit.
A system having X bit means the CPU Register length is X bit.
Look at some example,
Windows now uses 32 bit,DOS uses 16 bit and UNIX uses 32 bit also.
Kind regards,
Dmjpro.
PL/1 can use any integer bitsize it wants. C has bit fields as well. It's hardware
that has a 'favourite' bitsize depending on the width of the databus. Most computers
use 32 bits or 64 bits wide databuses. Some of them even impose a bus boundary,
e.g. if the 'favourite' bus width is X bits, those X bits can only be read/written
on X bit address boundaries (b*n%X == 0 is a valid address, where b is the number
of bits in a byte (the smallest addressable unit)).
Languages however can define whatever they want; funny bitwidths need more
support than the 'favourite' bit width. Most of the time the general CPU registers
have the same width as the databus but even that is not always true; e.g. the
old 8088 had 16 bit wide registers but just an 8 bit wide data bus.
kind regards,
Jos