(* Collection of code snippets by Arne Vajhøj *)
(* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) *)
program overlay_dn;

{$APPTYPE CONSOLE}

uses
  System.Runtime.InteropServices;

type
  [StructLayout(LayoutKind.Explicit)]
  TWB = record
          [FieldOffset(0)]
          w : word;
          [FieldOffset(0)]
          b1 : byte;
          [FieldOffset(1)]
          b2 : byte;
        end;

var
  tmp : TWB;

begin
  tmp.w := 257;
  writeln(tmp.b1,' ',tmp.b2);
  readln;
end.
