RAD Studio (Common)
ContentsIndex
PreviousUpNext
E2091: Segment/Offset pairs not supported in 32-bit Object Pascal (Delphi)

32-bit code no longer uses the segment/offset addressing scheme that 16-bit code used. 

In 16-bit versions of Object Pascal, segment/offset pairs were used to declare absolute variables, and as arguments to the Ptr standard function. 

Note that absolute addresses should not be used in 32-bit protected mode programs. Instead appropriate Win32 API functions should be called.

program Produce;

var
  VideoMode : Integer absolute $0040:$0049;

begin
  Writeln( Byte(Ptr($0040,$0049)^) );
end.
    program Solve;
(*This version will compile, but will not run; absolute addresses are to be carefully avoided*)
var
  VideoMode : Integer absolute $0040*16+$0049;

begin
  Writeln( Byte(Ptr($0040*16+$0049)^) );
end.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!