Delphi Error – E2109 Constant expected

Delphi Compiler Error

E2109 Constant expected

Reason for the Error & Solution

The inline assembler was expecting to find a constant but did not find one.

program Produce;

  procedure Assembly(x : Integer);
  asm
    mov   ax, x MOD 10
  end;

begin
end.

The inline assembler is not capable of performing a MOD operation on a Delphi variable, thus the above code will cause an error.

Many of the inline assembler expressions require constants to assemble correctly. Change the offending statement to have a assemble-time constant.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Delphi Compiler Error E2313 Attribute – Known attribute cannot specify properties Reason for the Error & Solution No further information...
Delphi Compiler Error E2379 Virtual methods not allowed in record types Reason for the Error & Solution No further information...
Rodrigo , one of the long time Delphi Developer has been working on one of his personal project “Delphi IDE...