Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

delphiÖÐregister, pascal, cdecl, stdcall, safecall

×¢£º ʹÓôíÎ󣬻òÕßÔڸüӵĵط½Ã»Óмӣ¬¿ÉÄÜ»á³öÏÖ"privileged instruction"´íÎ󣬻òÕßµØÖ··ÃÎÊ´íÎó¡£
³£¼ûµÄµ÷ÓùßÀýÓÐregister, pascal, cdecl, stdcall, safecall¡£º¯ÊýµÄµ÷ÓùÜÀí¾ö¶¨Á˲ÎÊýÈçºÎ´«µÝ¸ø×Ó¹ý³Ì£¬²¢´Ó¶ÑÕ»ÖÐÍ˳ö£¬ÒÔ¼°¼Ä´æÆ÷ÔÚ²ÎÊý´«µÝÖеÄʹÓ㬴íÎóºÍÒì³£µÄ´¦Àí¡£DelphiÖÐĬÈϵĵ÷ÓùßÀýÊÇregister¡£
1) registerºÍpascal£º²ÎÊý´Ó×óÏòÓÒ´«µÝ£¬Ò²¾ÍÊÇ˵×î×ó±ßµÄ²ÎÊý×îÏÈÇóÖµ²¢´«È룬×îÓұߵIJÎÊý×îºóÇóÖµºÍ´«Èë¡£cdecl£¬stdcallºÍsafecallÔò°´´ÓÓÒÏò×ó·½Ïò¡£
2) ¶ÔÓÚ³ýcdeclÖ®ÍâµÄËùÓе÷ÓùßÀý£¬º¯Êý/¹ý³ÌÔÚ·µ»ØµÄʱºòÒª°Ñ¶ÑÕ»ÖеIJÎÊýÍËÕ»¡£¶Ôcdecl¹ßÀý£¬µ÷ÓÃÕßÔÚ±»µ÷ÓõĹý³Ì·µ»ØºóÖ´ÐвÎÊýÍËÕ»²Ù×÷
3) registerµ÷ÓùßÀý×î¶àÄÜÓÃ3¸öCPU¼Ä´æÆ÷À´´«µÝ²ÎÊý£¬¶øÆäËüµ÷ÓùßÀýÖ»ÄÜͨ¹ý¶ÑÕ»À´´«µÝ²ÎÊý
4) safecallµ÷ÓùßÀýʵÏÖÁËÒì³£µÄ·À»ðǽ¡£ÔÚWindowsÉÏʵÏÖÁË¿ç½ø³ÌµÄCOM´íÎó֪ͨ»úÖÆ¡£
5) registerµ÷ÓÃЧÂÊ×î¸ß£¬ÒòΪËü±ÜÃâÁ˶ÑÕ»µÄ´´½¨¡£DelphiÖÐpublishedÊôÐÔ±ØÐëÊÇregister¡£
6) cdecl³£ÓÃÓÚµ÷ÓÃC/C++±àдµÄ¹²Ïí¿âÖеĺ¯Êý£»µ«ÊÇ£¬Èç¹ûÒªµ÷ÓÃÍⲿ´úÂ룬ÄÇôһ°ãÒªÓÃstdcallºÍsafecall
7) ÔÚWindowsÉÏ£¬ÏµÍ³µÄAPI¶¼ÊÇstdcallºÍsafecall£»ÔÚÆäËü²Ù×÷ϵͳÉÏͨ³£ÓÃcdecl£¨×¢Ò⣺stdcall±ÈcdeclЧÂÊÒª¸ß£©
8) ÔÚdual-interface£¨Ë«½Ó¿Ú£©·½·¨ÖбØÐëÓÃsafecall¹ßÀý¡£
9) pascal¹ßÀýÊÇΪÁËÏòºó¼æÈÝ£»near/far/exportÓÃÓÚ16λWindow±à³ÌÖеĺ¯Êýµ÷Óã¬ÔÚ32λµÄÓ¦ÓóÌÐòÖв»·¢»Ó×÷Ó㬽ö½öÊÇΪÁËÏòºó¼æÈÝ¡£
ϱí½øÐÐÁË×ܽ᣺
Calling conventions Parameter order Clean-up Passes parameters in registers£¿
register Left-to-right Routine Yes
pascal Left-to-right Routine No
cdecl Right-to-left Caller No
stdcall Right-to-left Routine No
safecall Right-to-left Routine No
http://blog.sina.com.cn/s/blog_552c78120100hsr9.html


Ïà¹ØÎĵµ£º

delphi±à³ÌÀïµÄbool¸úbooleanÀàÐÍÓÐʲôÇø±ð

boolÊÇLongBoolÀàÐÍ¡£
DelphiÖж¨ÒåÁËËÄÖÖ²¼¶ûÀàÐÍ£ºBoolean£¬ByteBool£¬WordBoolºÍLongBool¡£ºóÃæÈýÖÖ²¼¶ûÀàÐÍÊÇΪÁËÓëÆäËûÓïÑÔ¼æÈݶøÒýÈëµÄ£¬Ò»°ãÇé¿öϽ¨ÒéʹÓÃBooleanÀàÐÍ¡£
ÕâËÄÖÖÀàÐ͵IJ¼¶ûÖµÕ¼ÓÃÄÚ´æµÄÊýÁ¿ÈçÏ£º
Boolean 1 Byte
ByteBool 1 Byte
WordBool 2 Bytes£¨1 Word£©
LongBool 4 Bytes£¨2 Words£©
¶Ô ......

Delphi¶àÏß³Ìѧϰ£º¶àÏß³ÌÊý¾Ý¿â²éѯ£¨ADO£©

ADO¶àÏß³ÌÊý¾Ý¿â²éѯͨ³£»á³öÏÖ3¸öÎÊÌ⣺
1¡¢CoInitialize ûÓе÷ÓÃ
£¨CoInitialize was not
called£©£»ËùÒÔ£¬ÔÚʹÓÃÈκÎdbGo¶ÔÏóÇ°£¬±ØÐëÊÖ
µ÷ÓÃCoInitializeºÍCoUninitialize¡£µ÷ÓÃCoInitializeʧ°Ü»á²úÉú"CoInitialize was not
called"ÀýÍâ¡£
2¡¢»­²¼²»ÔÊÐí»æ»­
£¨Canvas does not allow
drawing£ ......

CSDN Ñ°ÕÒ×îºóÒ»¸öDelphiϬÀû¸ç

°Ù¶ÈÖªµÀÕæÀ¬»ø£¬ÄÇô´óµÄÒ»¸öÆóÒµ£¬¾Í¸øÄÇôµã¿Õ¼ä£¬Ìá¸öÎÊ1500×ÖÏÞÖÆÁË¡£ÏëÏëÀ´csdn£¬¹ÒÁËÒ»¸öÐÇÆÚ¶¼Ã»ÈËÀí£¬²»ÖªµÀÊÇÎÒ·ÖÌ«ÉÙ£¬»¹ÊÇÕæµÄ¸ßÊÖ¶¼²»À´ÕâÀ£¿£¿ÆÚ´ýÒ»¸öÓ¢Ð۵ĵ½À´£¬²ËÄñÎÒÔÚÕâÀï°ÝлÁË£¡£¡ÆäʵÕâ¸ù±¾²»ÊÇÉúÃüÄÑÌ⣬ÎҲŸոÕѧ£¬Îʲ»³öÉúÃü¸ßÉîµÄÌâÄ¿À´£º
rT;
delphi7 ,DB:oracle
ÎÊÌâÔËÐй¤³ÌÎļþexe²» ......

delphiÖÐmoveº¯ÊýµÄÓ÷¨

ÎÒÃÇÄÜ¿´µ½ÒÔÏ´úÂë
var pSource,pDest:PChar;
     len: integer;
.......................//һЩ´úÂë
Move(pSource,pDest,len); //´íÎó
Move(pSource^,pDest^,len); //ÕýÈ·
¿´ÆðÀ´È·ÊµºÃÏñÊÇ´«Öµ£¬¶ø²»ÊÇ´«µØÖ·£¬µ«ÊǸ÷λ±ðÍüÁË£¬Õâ²»ÊÇC£¬C++£¬¶øÊÇDelphi
Object Pascal,ËùÒÔ£¬¾ø²»ÄÜ´Óº¯Êýµ ......

ÔÚDelphiÓ¦ÓóÌÐòÖÐʹÓÃDLL

ÔÚDelphiÓ¦ÓóÌÐòÖÐʹÓÃDLL
¡¡¡¡Delphi²»½ö¿Éµ÷ÓÃC£«£«²úÉúµÄDLLÄ£¿é£¬Í¬ÑùC£«£«³ÌÐòÒ²¿Éµ÷ÓÃDelphiËù²úÉúµÄDLL²¿¼þ¡£ÕâÑù½»»¥µ÷Óã¬ÎÞÐëÖظ´¿ª·¢£¬´ó´óËõ¶ÌÁËÉú²úÖÜÆÚ¡£ 
¡¡¡¡DelphiÓëVisualBasic¡¢VisualFoxProµÈÈí¼þÒ»Ñù£¬ÊôÓÚRAD¹¤¾ß£¨¿ìËÙÓ¦Óÿª·¢¹¤¾ß£©¡£ÊʺϿª·¢32λ»ò16λ£¯32λ»ìºÏÓ¦ÓóÌÐò¡£DelphiËùÊ¹Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ