Packer record

General discussion on mikroPascal PRO for ARM.
Post Reply
Author
Message
faeton
Posts: 4
Joined: 01 May 2018 22:09

Packer record

#1 Post by faeton » 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:

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;
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.

Post Reply

Return to “mikroPascal PRO for ARM General”