Bastiaan Veelo wrote:
I would have expected to be able to set the thirtysecond bit of an integer type, but I cannot. Does anybody know why?
"Integer" is a signed type, so a set 32nd bit indicates a negative number (two's complement) on virtually every modern architecture. The numbers you want are thus a negative numbers, which can be given as
-2#10000000000000000000000000000000
and
-2#00000000000000000000000000000001
(or simply -1 in the latter case).
If you want unsigned numbers >= 2^31, you need an unsigned type, called "Cardinal" in GPC (or, of course, a type larger than 32 bytes, such as "LongInt"). With either of those types your test program works.
Please note that in Pascal, unlike C, integers represent numbers, not bit-patterns, so storing a 32-bit-pattern (with the topmost bit set) in a signed integer type, which is common practice in C, is not allowed in Pascal, as it would alter the numeric value.
Frank