Delphi Language Guide Delphi for Microsoft Win32 Delphi for the Microsoft. Net framework


Understanding Assembler Syntax (Win32 Only)



Yüklə 0,84 Mb.
Pdf görüntüsü
səhifə271/294
tarix02.01.2022
ölçüsü0,84 Mb.
#41395
1   ...   267   268   269   270   271   272   273   274   ...   294
DelphiLanguageGuide

Understanding Assembler Syntax (Win32 Only)
The inline assembler is available only on the Win32 Delphi compiler. The following material describes the elements
of the assembler syntax necessary for proper use.
Assembler Statement Syntax
Labels
Instruction Opcodes
Assembly Directives
Operands
Assembler Statement Syntax
This syntax of an assembly statement is
Label: Prefix Opcode Operand1, Operand2
where Label is a label, Prefix is an assembly prefix opcode (operation code), Opcode is an assembly instruction
opcode or directive, and Operand is an assembly expression. Label and Prefix are optional. Some opcodes take
only one operand, and some take none.
Comments are allowed between assembly statements, but not within them. For example,
     MOV AX,1 {Initial value}             { OK }
     MOV CX,100 {Count}                                                         { OK }
     
                    MOV {Initial value} AX,1;                                { Error! }
     MOV CX, {Count} 100                                                     { Error! }
Labels
Labels are used in built-in assembly statements as they are in the Delphi languageby writing the label and a colon
before a statement. There is no limit to a label's length. As in Delphi, labels must be declared in a label declaration
part in the block containing the asm statement. The one exception to this rule is local labels.
Local labels are labels that start with an at-sign (@). They consist of an at-sign followed by one or more letters, digits,
underscores, or at-signs. Use of local labels is restricted to asm statements, and the scope of a local label extends
from the asm reserved word to the end of the asm statement that contains it. A local label doesn't have to be declared.

Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   267   268   269   270   271   272   273   274   ...   294




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin