Quick start manual

13-8
Delphi Language Guide
Expressions
Reserved words always take precedence over user-defined identifiers. For example,
var
Ch: Char;
ƒ
asm
MOV CH, 1
end;
loads 1 into the CH register, not into the Ch variable. To access a user-defined symbol
with the same name as a reserved word, you must use the ampersand (&) override
operator:
MOV &Ch, 1
It is best to avoid user-defined identifiers with the same names as built-in assembler
reserved words.
Expressions
The built-in assembler evaluates all expressions as 32-bit integer values. It doesn’t
support floating-point and string values, except string constants.
Expressions are built from expression elements and operators, and each expression has
an associated expression class and expression type.
Differences between Delphi and assembler expressions
The most important difference between Delphi expressions and built-in assembler
expressions is that assembler expressions must resolve to a constant value- that is a
value that can be computed at compile time. For example, given the declarations
const
X = 10;
Y = 20;
var
Z: Integer;
the following is a valid statement.
asm
MOV Z,X+Y
end;
Because both X and Y are constants, the expression X + Y is a convenient way of
writing the constant 30, and the resulting instruction simply moves of the value 30
into the variable Z. But if X and Y are variables—
var
X, Y: Integer;