GDI + is a function library of Windows, from Windows\system32\gdiplus.dll, which contains 610 functions.
Use in Delphi need to download and install GDI + for Delphi First (this is used for 2006, 2007 Win32 version).
Provide a new download:
The following three function functions are the same, but the efficiency is different
{Fun1 需要读取常数 0, 最慢} function Fun1: Integer; asm mov eax, 0 end;
{FUN2 and FUN3 only operate CPU registers, faster than FUN1}
function Fun2: Integer; asm sub
In addition to Byte, Word, Cardinal, and Integer, the integer type of Delphi is also:
Longint, Longword, Shortint, Smallint, Int64
Wherein Longint is equivalent to an Integer; Longword is equivalent to Cardinal. There are three other types of this:
Delphi functionfunction DelphiFun(x: Integer): Integer; begin Result := x * 2; end;
assembly function, which is the same function as the above functionfunction AsmFun(x: Integer): Integer; asm add eax, eax {eax 可以获取第一个参数, 同时又是函数的返回值, 所以可以如此 简洁!}
return type
Hosting location
Char, Byte
AL Registers
SmallInt, Word
AX Registers
Integer, Longword, ansistring, pointer, Class
EAX Registers
Real48
EAX registers are pointers to
Access to Delphi variables in the assembly can be accessed using the & operator
procedure Proc(str1,str2: string); var s1,s2: string; begin asm mov ecx, &str1 {} mov edx, &str2 mov &s1, ecx {} mov &s2, edx end; ShowMessage(s1 + s2);
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service