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



Yüklə 0,84 Mb.
Pdf görüntüsü
səhifə279/294
tarix02.01.2022
ölçüsü0,84 Mb.
#41395
1   ...   275   276   277   278   279   280   281   282   ...   294
DelphiLanguageGuide

String examples and their values
String Value
'a'
00000061H
'ba'
00006261H
'cba'
00636261H
'dcba' 64636261H
'a '
00006120H
' a'
20202061H
'a' * 2 000000E2H
'a'-'A' 00000020H
not 'a' FFFFFF9EH
Registers
The following reserved symbols denote CPU registers in the inline assembler:
CPU registers
32-bit general purpose EAX EBX ECX EDX 32-bit pointer or index
ESP EBP ESI EDI
16-bit general purpose AX BX CX DX
16-bit pointer or index
SP BP SI DI
8-bit low registers
AL BL CL DL
16-bit segment registers
CS DS SS ES
32-bit segment registers
FS GS
8-bit high registers
AH BH CH DH
Coprocessor register stack ST
When an operand consists solely of a register name, it is called a register operand. All registers can be used as
register operands, and some registers can be used in other contexts.
The base registers (BX and BP) and the index registers (SI and DI) can be written within square brackets to indicate
indexing. Valid base/index register combinations are [BX], [BP], [SI], [DI], [BX+SI], [BX+DI], [BP+SI], and [BP+DI].
You can also index with all the 32-bit registersfor example, [EAX+ECX], [ESP], and [ESP+EAX+5].
The segment registers (ES, CS, SS, DS, FS, and GS) are supported, but segments are normally not useful in 32-
bit applications.
The symbol ST denotes the topmost register on the 8087 floating-point register stack. Each of the eight floating-
point registers can be referred to using ST(X), where X is a constant between 0 and 7 indicating the distance from
the top of the register stack.
Symbols
The built-in assembler allows you to access almost all Delphi identifiers in assembly language expressions, including
constants, types, variables, procedures, and functions. In addition, the built-in assembler implements the special
symbol @Result, which corresponds to the Result variable within the body of a function. For example, the function
235


function Sum(X, Y: Integer): Integer;
begin 
        Result := X + Y; 
end; 
could be written in assembly language as
function Sum(X, Y: Integer): Integer; stdcall; 
begin
 asm
         MOV        EAX,X 
            ADD        EAX,Y
            MOV        @Result,EAX
 end; 
end; 
The following symbols cannot be used in asm statements:
Standard procedures and functions (for example, WriteLn and Chr).
String, floating-point, and set constants (except when loading registers).
Labels that aren't declared in the current block.
The @Result symbol outside of functions.
The following table summarizes the kinds of symbol that can be used in asm statements.

Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   275   276   277   278   279   280   281   282   ...   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