Quick start manual

Inline assembly code
13-1
Chapter
13
Chapter13
Inline assembly code
The built-in assembler allows you to write assembly code within Delphi programs. It
has the following features:
Allows for inline assembly
Supports all instructions found in the Intel Pentium III, Intel MMX extensions,
Streaming SIMD Extensions (SSE), and the AMD Athlon (including 3D Now!)
Provides no macro support, but allows for pure assembly function procedures
Permits the use of Delphi identifiers, such as constants, types, and variables in
assembly statements
As an alternative to the built-in assembler, you can link to object files that contain
external procedures and functions. See “Linking to object files” on page 6-7 for more
information.
Note
If you have external assembly code that you want to use in your applications, you
should consider rewriting it in the Delphi language or minimally reimplement it
using the inline assembler.
The asm statement
The built-in assembler is accessed through asm statements, which have the form
asm statementList end
where statementList is a sequence of assembly statements separated by semicolons,
end-of-line characters, or Delphi comments.
Comments in an asm statement must be in Delphi style. A semicolon does not
indicate that the rest of the line is a comment.
The reserved word inline and the directive assembler are maintained for backward
compatibility only. They have no effect on the compiler.