·ÒëÒ»°ëµÄDelphi»ã±à°ïÖú
The built-in assembler allows you to write assembly code within Delphi programs. It has the following features:
ÄÚǶµÄ»ã±àÆ÷ÔÊÐíÔÚdelphi³ÌÐòÖÐÊéд»ã±à´úÂ룬ËûÓÐÈçÏÂÌØÐÔ£º
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!)
Ö§³ÖËùÓÐÖ¸ÁÈçÓ¢Ìضû±¼Èý´¦ÀíÆ÷£¬Ó¢ÌضûMMXÀ©Õ¹£¬Streaming SIMDÀ©Õ¹£¨SSE£©£¬ÒÔ¼°AMD Athlon´¦ÀíÆ÷£¨°üÀ¨3D£©
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
ÔÊÐíʹÓÃdelphi±êʶ·û£¬ÖîÈçÔÚ»ã±à¶ÎÄڵij£Á¿£¬ÀàÐͺͱäÁ¿
As an alternative to the built-in assembler, you can link to object files that contain external procedures and functions. See External declarations for more information.
µ±Ìæ´úÄÚÖûã±àµÄʱºò£¬Äã¿ÉÒÔÁ´½Óµ½Ò»¸ö°üº¬ÓÐÍⲿ¹ý³ÌºÍº¯ÊýµÄÄ¿±êÎļþ¡£¸ü¶àµÄÐÅÏ¢²é¿´ÍⲿÉùÃ÷¡£
Note
×¢Ò⣬Èç¹ûÄãÓÐÍⲿ»ã±à´úÂ룬ÄãÏë°ÑËüÃÇÓÃÔÚÄãµÄÓ¦ÓóÌÐòÖУ¬ÄãÒª¿¼ÂÇÔÚDelphiÖÐÖØдËû£¬»òÕß×îµ×Ï޶ȵÄʹÓÃÄÚǶ»ã±àÀ´ÊµÏÖ¡£
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 built-in assembler is accessed through asm statements, which have the form
ÄÚǶ»ã±àͨ¹ýasm±êʶ·ûÀ´´æ´¢£¬Ê¹ÓÃend¶ÎÀ´½áÊø¡£
asm statementList end
where statementList is a sequence of assembly statements separated by semicolons, end-of-line characters, or Delphi comments.
»ã±à¶ÎʹÓ÷ֺÅÀ´·Ö¸î»ã±à´úÂë¶Î£¬×Ö·ûµÄĩβ¿ÉÒÔʹÓÃdelphi×¢ÊÍ¡£
Comments in an asm statement must be in Delphi style. A semicolon does not indicate that the rest of the line is a comment.
ÄÚǶ»ã±àµÄ×¢ÊͱØÐëÊÇdelphiµÄ·ç¸ñ£¬·ÖºÅ²¢²»Äܱíʾµ±Ç°ÐÐÊ£Óಿ·Ö¾ÍÊÇ×¢ÊÍ¡£
The reserved word inline and the directive assembler are
Ïà¹ØÎĵµ£º
Ò»¡¢ÔÚDelphi7ÖÐÁ¬½ÓMS SQL Server 2000µÄ·½·¨¡£
¸Õ¿ªÊ¼Ê±½çÃæÈçÏ£ºÌí¼Ó4¸ö¿Ø¼þ¡£
ÉèÖÿؼþÊôÐÔ¹ý³Ì£º
1¡¢ADOConnection1ÉèÖÃ
1£©Ë«»÷ADOConnection1£¬½øÐÐÉèÖÃÁ¬½Ó×Ö·û´®£¨×÷ÓÃÊÇ£ºÑ¡È¡Á¬½ÓÇý¶¯·½Ê½ºÍÁ¬½ÓµÄÊý¾Ý¿âÉèÖã©¡£¹ý³ÌÈçÏÂͼËùʾ£º
2¡¢ADOQuery1ÉèÖãº
1£©ADOQuery1.connectionÊôÐÔΪADOConnection1; ......
ÓÉÓÚÏîÄ¿ÐèÒª£¬¿ªÊ¼Ñ§Ï°DELPHI£¬²¢×Ô¼º±àд´úÂëÀ´²âÊÔÓÃVCдµÄDLL£¬¾õµÃ×Ô¼ºÓÖ¶àÕÆÎÕÁËһЩ£¬²»¶ÔµÄµØ·½Ï£ÍûÖ¸Õý£¬ÎÒ»áºÃºÃѧϰ
1¡¢ÏìÓ¦¼üÅÌʼþ£º
ÒòΪKeyPreviewĬÈÏÊÇ False;ÎÒÃÇÕâÀïÐèÒªÏìÓ¦¼üÅÌʼþµÄ»°£¬ÐèÒª½«ÆäÐÞ¸ÄΪTrue£»
ËùÒÔKeyPreview:=True; Õâ¶ÔһЩ¿ì½Ý¼ü»áÓÐÓá£
ÔÚFormCreateÕâ¸öº¯ÊýÀïÐÞ¸ÄKeyPrevie ......
DelphiµÄÔ´Â붨λ·½·¨ÍøÉÏËÑË÷µ½ºÃÏñ²»Ì«¶à¡£
ÕâÀï·ÖÏíÎÒ×Ô¼ºµÄÁ½¸ö·½·¨¡£
ÒýÓÃÒ»¶Î»°
ÒýÓÃÄÚÈÝ
ʲôÊÇ MAP Îļþ£¿
MAP ÎļþÊdzÌÐòµÄÈ«¾Ö·ûºÅ¡¢Ô´ÎļþºÍ´úÂëÐкÅÐÅÏ¢µÄΨһµÄÎı¾±íʾ·½·¨£¬Ëü¿ÉÒÔÔÚÈκεط½¡¢ÈκÎʱºòʹÓ㬲»ÐèÒªÓжîÍâµÄ³ÌÐò½øÐÐÖ§³Ö¡£¶øÇÒ£¬ÕâÊÇΨһÄÜÕÒ³ö³ÌÐò±ÀÀ£µÄµØ·½µÄ¾ÈÐÇ¡£
DEL ......
ʲôÊÇÁ÷£¿Á÷,¼òµ¥À´Ëµ¾ÍÊǽ¨Á¢ÔÚÃæÏò¶ÔÏó»ù´¡ÉϵÄÒ»ÖÖ³éÏóµÄ´¦ÀíÊý¾Ý
µÄ¹¤¾ß¡£ÔÚÁ÷ÖУ¬¶¨ÒåÁËһЩ´¦ÀíÊý¾ÝµÄ»ù±¾²Ù×÷£¬Èç¶ÁÈ¡Êý¾Ý£¬Ð´ÈëÊý¾ÝµÈ£¬
³ÌÐòÔ±ÊǶÔÁ÷½øÐÐËùÓвÙ×÷µÄ£¬¶ø²»ÓùØÐÄÁ÷µÄÁíһͷÊý¾ÝµÄÕæÕýÁ÷Ïò¡£Á÷²»
µ«¿ÉÒÔ´¦ÀíÎļþ£¬»¹¿ÉÒÔ´¦Àí¶¯Ì¬ÄÚ´æ¡¢ÍøÂçÊý¾ÝµÈ¶àÖÖÊý¾ÝÐÎʽ¡£Èç¹ûÄã¶Ô
Á÷µÄ²Ù×÷·Ç³£ÊìÁ·£¬ÔÚ³ ......
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.Checked then
SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE)
else
SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE);
end;//ʹÓÃSelf.FormStyle := fsStayOnTop;»áʹ½ç ......