HomeDelphiDelphi Error – E2109 Constant expected

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

You May Also Like

Delphi Compiler Error X2421 Imported identifier ‘%s’ conflicts with ‘%s’ in ‘%s’ Reason for the Error & Solution This occurs...
Delphi Compiler Error X2367 Case of property accessor method %s.%s should be %s.%s Reason for the Error & Solution No...
Delphi Compiler Error X2269 Overriding virtual method ‘%s.%s’ has lower visibility (%s) than base class ‘%s’ (%s) Reason for the...