C³ÌÐòÓë»ã±à³ÌÐò»ìºÏ±à³Ì
C³ÌÐòÓë»ã±à³ÌÐòÏ໥µ÷ÓùæÔò
ΪÁËʹµ¥¶À±àÒëµÄCÓïÑÔ³ÌÐòºÍ»ã±à³ÌÐòÖ®¼äÄܹ»Ï໥µ÷Ó㬱ØÐëΪ×Ó³ÌÐò¼äµÄµ÷Óùæ
¶¨Ò»¶¨µÄ¹æÔò¡£ATPCS£¬¼´ARM£¬ Thumb¹ý³Ìµ÷Óñê×¼(ARM/Thumb Procedure Call
Standard)£¬ÊÇARM³ÌÐòºÍThumb³ÌÐòÖÐ×Ó³ÌÐòµ÷ÓõĻù±¾¹æÔò£¬Ëü¹æ¶¨ÁËһЩ×Ó³ÌÐò¼äµ÷ÓÃ
µÄ»ù±¾¹æÔò£¬Èç×Ó³ÌÐòµ÷Óùý³ÌÖеļĴæÆ÷µÄʹÓùæÔò£¬¶ÑÕ»µÄʹÓùæÔò£¬²ÎÊýµÄ´«µÝ¹æÔò
µÈ¡£
ÏÂÃæ½áºÏʵ¼Ê½éÉܼ¸ÖÖATPCS¹æÔò£¬Èç¹û¶ÁÕßÏëÁ˽â¸ü¶àµÄ¹æÔò£¬¿ÉÒԲ鿴Ïà¹ØµÄÊé
¼®¡£
1£® »ù±¾ATPCS
»ù±¾ATPCS¹æ¶¨ÁËÔÚ×Ó³ÌÐòµ÷ÓÃʱµÄһЩ»ù±¾¹æÔò£¬°üÀ¨ÏÂÃæ3·½ÃæµÄÄÚÈÝ£º
(1)¸÷¼Ä´æÆ÷µÄʹÓùæÔò¼°ÆäÏàÓ¦µÄÃû³Æ¡£
(2)Êý¾ÝÕ»µÄʹÓùæÔò¡£
(3)²ÎÊý´«µÝµÄ¹æÔò¡£
Ïà¶ÔÓÚÆäËüÀàÐ͵ÄATPCS£¬Âú×ã»ù±¾ATPCSµÄ³ÌÐòµÄÖ´ÐÐËٶȸü¿ì£¬ËùÕ¼ÓõÄÄÚ´æ¸üÉÙ¡£
µ«ÊÇËü²»ÄÜÌṩÒÔϵÄÖ§³Ö£º ARM³ÌÐòºÍThumb³ÌÐòÏ໥µ÷Ó㬠Êý¾ÝÒÔ¼°´úÂëµÄλÖÃÎÞ¹Ø
µÄÖ§³Ö£¬×Ó³ÌÐòµÄ¿ÉÖØÈëÐÔ£¬Êý¾ÝÕ»¼ì²éµÄÖ§³Ö¡£
¶øÅÉÉúµÄÆäËû¼¸ÖÖÌض¨µÄATPCS¾ÍÊÇÔÚ»ù±¾ATPCSµÄ»ù´¡ÉÏÔÙÌí¼ÓÆäËûµÄ¹æÔò¶øÐγÉ
µÄ¡£ÆäÄ¿µÄ¾ÍÊÇÌṩÉÏÊöµÄ¹¦ÄÜ¡£
2£® ¼Ä´æÆ÷µÄʹÓùæÔò
¼Ä´æÆ÷µÄʹÓñØÐëÂú×ãÏÂÃæµÄ¹æÔò£º
(1) ×Ó³ÌÐò¼äͨ¹ý¼Ä´æÆ÷R0¡«R3À´´«µÝ²ÎÊý¡£Õâʱ£¬¼Ä´æÆ÷R0¡«R3¿ÉÒÔ¼Ç×÷A0¡«A3¡£
±»µ÷ÓõÄ×Ó³ÌÐòÔÚ·µ»ØÇ°ÎÞÐè»Ö¸´¼Ä´æÆ÷R0¡«R3µÄÄÚÈÝ¡£
(2) ÔÚ×Ó³ÌÐòÖУ¬Ê¹ÓüĴæÆ÷R4¡«RllÀ´±£´æ¾Ö²¿±äÁ¿¡£Õâʱ£¬¼Ä´æÆ÷R4¡«R11¿ÉÒÔ
¼Ç×÷V1¡«V8¡£Èç¹ûÔÚ×Ó³ÌÐòÖÐʹÓõ½Á˼ĴæÆ÷V1¡«V8ÖеÄijЩ¼Ä´æÆ÷£¬×Ó³ÌÐò½øÈëʱ±ØÐë
±£´æÕâЩ¼Ä´æÆ÷µÄÖµ£¬ÔÚ·µ»ØÇ°±ØÐë»Ö¸´ÕâЩ¼Ä´æÆ÷µÄÖµ£»¶ÔÓÚ×Ó³ÌÐòÖÐûÓÐÓõ½µÄ¼Ä´æÆ÷
Ôò²»±Ø½øÐÐÕâЩ²Ù×÷¡£ÔÚThumb³ÌÐòÖУ¬Í¨³£Ö»ÄÜʹÓüĴæÆ÷R4¡«R7À´±£´æ¾Ö²¿±äÁ¿¡£
(3) ¼Ä´æÆ÷R12ÓÃ×÷×Ó³ÌÐò¼äscratch¼Ä´æÆ÷£¬¼Ç×÷IP¡£ÔÚ×Ó³ÌÐò¼äµÄÁ¬½Ó´úÂë¶ÎÖÐ
³£ÓÐÕâÖÖʹÓùæÔò¡£
(4) ¼Ä´æÆ÷R13ÓÃ×÷Êý¾ÝÕ»Ö¸Õ룬¼Ç×÷SP¡£ÔÚ×Ó³ÌÐòÖмĴæÆ÷R13²»ÄÜÓÃ×÷ÆäËûÓÃ;¡£
¼Ä´æÆ÷SPÔÚ½øÈë×Ó³ÌÐòʱµÄÖµºÍÍ˳ö×Ó³ÌÐòʱµÄÖµ±ØÐëÏàµÈ¡£
(5) ¼Ä´æÆ÷R14³ÆΪÁ¬½Ó¼Ä´æÆ÷£¬¼Ç×÷LR¡£ËüÓÃÓÚ±£´æ×Ó³ÌÐòµÄ·µ»ØµØÖ·¡£Èç¹ûÔÚ
×Ó³ÌÐòÖб£´æÁË·µ»ØµØÖ·£¬¼Ä´æÆ÷R14Ôò¿ÉÒÔÓÃ×÷ÆäËûÓÃ;¡£
(6) ¼Ä´æÆ÷R15ÊdzÌÐò¼ÆÊýÆ÷£¬¼Ç×÷PC¡£Ëü²»ÄÜÓÃ×÷ÆäËûÓÃ;¡£
3.²ÎÊý´«µÝ¹æÔò
¸ù¾Ý²ÎÊý¸öÊýÊÇ·ñ¹Ì¶¨¿ÉÒÔ½«×Ó³ÌÐò·ÖΪ²ÎÊý¸öÊý¹Ì¶¨µÄ(nonvariadic)×Ó³ÌÐòºÍ²ÎÊý
¸öÊý¿É±äµÄ(variadic)×Ó³ÌÐò¡£
Ïà¹ØÎĵµ£º
1¡¢http://snippets.dzone.com/tag/c/ --ÊýÒÔǧ¼ÆµÄÓÐÓõÄCÓïÑÔÔ´´úÂëƬ¶Î
2¡¢http://www.hotscripts.com/category/c-cpp/scripts-programs/ Hotscripts --ÌṩÊýÒ԰ټƵÄCºÍC++½Å±¾ºÍ³ÌÐò¡£ËùÓгÌÐò¶¼·ÖΪ²»Í¬µÄÀà±ð¡£
3¡¢http://www.planetsourcecode.com/vb/default.asp?lngWId=3 --³¬¹ýÍòÐÐCºÍC++Ãâ·ÑµÄÔ´´úÂë
4¡ ......
1) goto
goto Ö»ÄÜÔÚÒ»¸öº¯ÊýÄÚÌøת¡£½¨ÒéÉÙÓã¬Ê¹µÃ³ÌÐòά»¤ÆðÀ´ÈÝÒ׳ö´í£»µ«ÊÇ£¬ÔÚÓжà¸öÑ»·Çé¿öÏÂÌøת£¬ÓÐʱÓÃgoto¿ÉÒÔʹµÃÎÊÌâ±äµÃ¼òµ¥¡£
class A
{
public:
A(){}
~A(){}
};
&nbs ......
C/C++
Í·ÎļþÒ»ÀÀ
//////////////////////////////////////////////////////////////////////////
C
Í·Îļþ
(C89,C95)
(C++98,C++03Ò²°üº¬)
include <assert.h>¡¡¡¡¡¡¡¡//Õï¶Ï¿â
include <ctype.h>¡¡¡¡¡¡¡¡ //×Ö·û´¦Àíº¯Êý¿â
include <errno.h>¡¡¡¡¡¡¡¡ //´íÎó¶¨Òå
include <float.h& ......
linux³£ÓÃÍ·ÎļþÈçÏ£º
POSIX±ê×¼¶¨ÒåµÄÍ·Îļþ
<dirent.h>
Ŀ¼Ïî
<fcntl.h> Îļþ¿ØÖÆ
<fnmatch.h> ÎļþÃûÆ¥ÅäÀàÐÍ
<glob.h>
·¾¶ÃûģʽƥÅäÀàÐÍ
< ......
̽Ë÷еÄC + +ºÍMFCÔÚVisual Studio 2010¹¦ÄÜ
Sumit Kumar
2010ÄêÁгöµÄVisual Studio C + +¿ª·¢µÄ¾Þ´óºÃ´¦¡£´Ó¹ÍÓÃÄÜÁ¦ÌṩÓÉWindows 7´óÁ¿´úÂëµÄ»ù´¡¹¤×÷£¬ÒÔÔöÇ¿Éú²úÁ¦ÌØÕ÷µÄÐÂÌص㣬ÓÐһЩеĶ«Î÷£¬Ìá¸ßÁ˼¸ºõËùÓеÄC + +¿ª·¢ÈËÔ±¡£
ÔÚÕâƪÎÄÕÂÖУ¬ÎÒ½«½âÊÍ΢ÈíÒѾ½â¾öÁËÈçºÎÓÃC + +¿ª·¢ÈËÔ±ËùÃæÁٵĹ㷺µÄһЩÎÊÌ ......