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ə266/294
tarix02.01.2022
ölçüsü0,84 Mb.
#41395
1   ...   262   263   264   265   266   267   268   269   ...   294
DelphiLanguageGuide

Handling Function Results
The following conventions are used for returning function result values.
Ordinal results are returned, when possible, in a CPU register. Bytes are returned in AL, words are returned in
AX, and double-words are returned in EAX.
Real results are returned in the floating-point coprocessor's top-of-stack register (ST(0)). For function results of
type Currency, the value in ST(0) is scaled by 10000. For example, the Currency value 1.234 is returned in ST
(0) as 12340.
For a string, dynamic array, method pointer, or variant result, the effects are the same as if the function result
were declared as an additional var parameter following the declared parameters. In other words, the caller
passes an additional 32-bit pointer that points to a variable in which to return the function result.
Int64 is returned in EDX:EAX.
Pointer, class, class-reference, and procedure-pointer results are returned in EAX.
For static-array, record, and set results, if the value occupies one byte it is returned in AL; if the value occupies
two bytes it is returned in AX; and if the value occupies four bytes it is returned in EAX. Otherwise, the result is
returned in an additional var parameter that is passed to the function after the declared parameters.
222



Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   262   263   264   265   266   267   268   269   ...   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