Hello, Pascal gurus.
I am trying to compile some legacy Pascal code with the GNU compiler,
gpc in Windows which is obviously 32-bit. The original code was used on
a Motorola 68000 processor (16-bit).
I note that in (MinGW) gpc a 'set' is internally a multiple of 4 bytes
long. I would like to cast a 16-bit unsigned integer (i.e. size of 2
bytes) onto a 16-element set. This should be possible, if the set was
allowed to be 2 bytes long also. Unfortunately gpc sets it to four
bytes. So I get the message "warning: cast to type of different size"
on compilation. I can resize an integer to 4 bytes using the
'attribute' command I realise. However, can I be sure that the
integer's bits map to the correct set elements?
Furthermore, the intention of my code was to cast this 7 by 2 byte set
array (then 14 bytes) onto a 112 element set (which occupied 14 bytes
also). Unfortunately compiling the code with gpc these now occupy 28
bytes and 14 bytes respectively. So on compilation I get a second
warning followed by a rather unceremonious crash when I try to execute.
Presumably gpc has these limitations on set size because of the 32-bit
architecture. Is there any way around it?
Thanks
Frank