Packer record
Posted: 03 Mar 2024 12:06
Hello everybody!
Does anyone know secret: how to create a packed record without 32-bit fields alignment in mikroPascal for ARM?
I'm creating:
Of course, I get incorrect data - unnecessary to me CFGModbusArray[2] word because the compiler inserted a hole between the fields f1 and f2 to align the field f2 by 32 bits.
There is a reserved word packed and it is used in Pascal, but this compiler does not want to accept it.
Does anyone know secret: how to create a packed record without 32-bit fields alignment in mikroPascal for ARM?
I'm creating:
Code: Select all
type
tCFG = record
f1: word;
f2: dword;
end;
tCFGModbusArray = array[1..SizeOf(tCFG) div 2] of word;
var
CFG: tCFG;
CFGModbusArray: tCFGModbusArray at CFG;
There is a reserved word packed and it is used in Pascal, but this compiler does not want to accept it.