9.6 Unaligned typecasts

A special typecast is the Unaligned typecast of a variable or expression. This is not a real typecast, but is rather a hint for the compiler that the expression may be misaligned (i.e. not on an aligned memory address). Some processors do not allow direct access to misaligned data structures, and therefor must access the data byte per byte.

Typecasting an expression with the unaligned keyword signals the compiler that it should access the data byte per byte.


program me;  
  A : packed Array[1..20] of Byte;  
  I : LongInt;  
  For I:=1 to 20 do