RAD Studio (Common)
ContentsIndex
PreviousUpNext
E2107: Operand size mismatch (Delphi)

The size required by the instruction operand does not match the size given.

program Produce;

  var
    v : Integer;

  procedure Assembly;
  asm
    db offset v
  end;

begin
end.

In the sample above, the compiler will complain because the 'offset' operator produces a 'dword', but the operator is expecting a 'byte'.

program Solve;

  var
    v : Integer;

  procedure Assembly;
  asm
    dd offset v
  end;

begin
end.

The solution, for this example, is to change the operator to receive a 'dword'. In the general case, you will need to closely examine your code and ensure that the operator and operand sizes match.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!