±àÒë³öÀ´µÄc/c++³ÌʽµÄ²ÎÊýѹջ˳ÐòÖ»ºÍ±àÒëÆ÷Ïà¹Ø!
ÏÂÃæÁоÙÁËһЩ³£¼ûµÄ±àÒëÆ÷µÄµ÷ÓÃÔ¼¶¨
VC6:
µ÷ÓÃÔ¼¶¨ ¶ÑÕ»Çå³ý ²ÎÊý´«µÝ
__cdecl µ÷ÓÃÕß ´ÓÓÒµ½×ó,ͨ¹ý¶ÑÕ»´«µÝ
__stdcall º¯ÊýÌå ´ÓÓÒµ½×ó,ͨ¹ý¶ÑÕ»´«µÝ
__fastcall º¯ÊýÌå ´ÓÓÒµ½×ó,ÓÅÏÈʹÓüĴæÆ÷(ECX,EDX),È»ºóʹÓöÑÕ»
thiscall º¯ÊýÌå thisÖ¸ÕëĬÈÏͨ¹ýECX´«µÝ,ÆäËû²ÎÊý´ÓÓÒµ½×óÈëÕ»
__cdeclÊÇC£ÜC++µÄĬÈϵ÷ÓÃÔ¼¶¨; VCµÄµ÷ÓÃÔ¼¶¨Öв¢Ã»ÓÐthiscallÕâ¸ö¹Ø¼ü×Ö,ËûÊÇÀà³ÉÔ±º¯ÊýĬÈϵ÷ÓÃÔ¼¶¨;
C£ÜC++ÖеÄmain(»òwmain)º¯ÊýµÄµ÷ÓÃÔ¼¶¨±ØÐëÊÇ__cdecl,²»ÔÊÐí¸ü¸Ä;
ĬÈϵ÷ÓÃÔ¼¶¨Ò»°ãÄܹ»Í¨¹ý±àÒëÆ÷ÅäÖýøÐиü¸Ä,¼ÙÈçÄúµÄ´úÂëÒÀÀµÓÚµ÷ÓÃÔ¼¶¨,ÇëÃ÷È·Ö¸³öÐèҪʹÓõĵ÷ÓÃÔ¼¶¨;
C++Builder6:
µ÷ÓÃÔ¼¶¨ ¶ÑÕ»Çå³ý ²ÎÊý´«µÝ
__fastcall º¯ÊýÌå ´Ó×óµ½ÓÒ,ÓÅÏÈʹÓüĴæÆ÷(EAX,EDX,ECX),È»ºóʹÓöÑÕ» (¼æÈÝDelphiµÄregister)
(registerºÍ__fastcallµÈͬ)
__pascal º¯ÊýÌå ´Ó×óµ½ÓÒ,ͨ¹ý¶ÑÕ»´«µÝ
__cdecl µ÷ÓÃÕß ´ÓÓÒµ½×ó,ͨ¹ý¶ÑÕ»´«µÝ(ºÍC£ÜC++ĬÈϵ÷ÓÃÔ¼¶¨¼æÈÝ)
__stdcall º¯ÊýÌå ´ÓÓÒµ½×ó,ͨ¹ý¶ÑÕ»´«µÝ(ºÍVCÖеÄ__stdcall¼æÈÝ)
__msfastcall º¯ÊýÌå ´ÓÓÒµ½×ó,ÓÅÏÈʹÓüĴæÆ÷(ECX,EDX
Ïà¹ØÎĵµ£º
VB
If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
MSComm1.CommPort = i1
MSComm1.PortOpen = True
MSComm1.InputMode = comInputModeBinary
MSComm1.InBufferCount = 0
& ......
ÀîÈôÀÏʦÔø¾Ëµ£ºÊÀ½çÉϵijÌÐòÔ±·ÖÈýÖÖ£¬Ò»ÖÖÊÇÓÃEmacs£¬Ò»ÖÖÊÇÓÃVimµÄ£¬ÆäËüµÄ¹éΪµÚÈýÖÖ¡£ÆäÒâÊÇ˵Èç¹ûÒ»¸ö³ÌÐòÔ±Á½Õ߶¼²»ÓõĻ°£¬ÄÇ´óµÖÊDz»ÄÜ
¹éΪÈëÁ÷ÕßÐÐÁеġ£¶ÔʹÓÃC/C++µÄÈËÀ´Ëµ£¬ºÜ¶àÈËϲ»¶Emacs£¬¾Ý˵Óë¶ÔStallmanµÄ³ç°ÝÓë°®Îݼ°ÎÚÓйØ;-)¡¡µ±È»£¬EmacsÓëVimËä
È»ÔÚÎı¾±à¼·½ÃæµÄÐÔÄÜÊǵȼ۵ģ¬µ«Ê¹ÓÃÆðÀ´Á½Õ ......
C/C++µÄ¶ÑÕ»£¬ÄÚ´æ·ÖÅä
2008Äê12ÔÂ02ÈÕ ÐÇÆÚ¶þ 11:51
Ò»¡¢Ò»¸ö¾¹ý±àÒëµÄC/C++µÄ³ÌÐòÕ¼ÓõÄÄÚ´æ·Ö³ÉÒÔϼ¸¸ö²¿·Ö£º
1¡¢Õ»Çø£¨stack£©£ºÓɱàÒëÆ÷×Ô¶¯·ÖÅäºÍÊÍ·Å £¬´æ·Åº¯ÊýµÄ²ÎÊýÖµ¡¢¾Ö²¿±äÁ¿µÄÖµµÈ£¬ÉõÖÁº¯ÊýµÄµ÷Óùý³Ì¶¼ÊÇÓÃÕ»À´Íê³É¡£Æä²Ù×÷·½Ê½ÀàËÆÓÚÊý¾Ý½á¹¹ÖеÄÕ»¡£
2¡¢¶ÑÇø£¨heap£© £ºÒ»°ãÓɳÌÐòÔ±ÊÖ¶¯ÉêÇëÒÔ¼°ÊÍ ......