¡¾×ª¡¿c´úÂëÓÅ»¯
1¡¢Ñ¡ÔñºÏÊʵÄËã·¨ºÍÊý¾Ý½á¹¹
Ñ¡ÔñÒ»ÖÖºÏÊʵÄÊý¾Ý½á¹¹ºÜÖØÒª£¬Èç¹ûÔÚÒ»¶ÑËæ»ú´æ·ÅµÄÊýÖÐʹÓÃÁË´óÁ¿µÄ²åÈëºÍɾ³ýÖ¸ÁÄÇʹÓÃÁ´±íÒª¿ìµÃ¶à¡£Êý×éÓëÖ¸ÕëÓï¾ä¾ßÓÐÊ®·ÖÃÜÇеĹØϵ£¬Ò»°ãÀ´Ëµ£¬Ö¸Õë±È½ÏÁé»î¼ò½à£¬¶øÊý×éÔò±È½ÏÖ±¹Û£¬ÈÝÒ×Àí½â¡£¶ÔÓڴ󲿷ֵıàÒëÆ÷£¬Ê¹ÓÃÖ¸Õë±ÈʹÓÃÊý×éÉú³ÉµÄ´úÂë¸ü¶Ì£¬Ö´ÐÐЧÂʸü¸ß¡£
ÔÚÐí¶àÖÖÇé¿öÏ£¬¿ÉÒÔÓÃÖ¸ÕëÔËËã´úÌæÊý×éË÷Òý£¬ÕâÑù×ö³£³£ÄܲúÉúÓÖ¿ìÓ̵ֶĴúÂë¡£ÓëÊý×éË÷ÒýÏà±È£¬Ö¸ÕëÒ»°ãÄÜʹ´úÂëËٶȸü¿ì£¬Õ¼Óÿռä¸üÉÙ¡£Ê¹ÓöàάÊý×éʱ²îÒì¸üÃ÷ÏÔ¡£ÏÂÃæµÄ´úÂë×÷ÓÃÊÇÏàͬµÄ£¬µ«ÊÇЧÂʲ»Ò»Ñù¡£
Êý×éË÷Òý Ö¸ÕëÔËËã
For(;;){ p=array;
A=array[t++]; for(;;){
a=*(p++);
...... ......
} }
Ö¸Õë·½·¨µÄÓŵãÊÇ£¬ array µÄµØַÿ´Î×°ÈëµØÖ· p ºó£¬ÔÚÿ´ÎÑ»·ÖÐÖ»Ðè¶Ô p ÔöÁ¿²Ù×÷¡£ÔÚÊý×éË÷Òý·½·¨ÖУ¬Ã¿´ÎÑ»·Öж¼±ØÐë¸ù¾Ý t ÖµÇóÊý×éϱêµÄ¸´ÔÓÔËËã¡£
2¡¢Ê¹Óþ¡Á¿Ð¡µÄÊý¾ÝÀàÐÍ
Äܹ»Ê¹ÓÃ×Ö·ûÐÍ (char) ¶¨ÒåµÄ±äÁ¿£¬¾Í²»ÒªÊ¹ÓÃÕûÐÍ (int) ±äÁ¿À´¶¨Ò壻Äܹ»Ê¹ÓÃÕûÐͱäÁ¿¶¨ÒåµÄ±äÁ¿¾Í²»ÒªÓó¤ÕûÐÍ (long int) £¬Äܲ»Ê¹Óø¡µãÐÍ (float) ±äÁ¿¾Í²»ÒªÊ¹Óø¡µãÐͱäÁ¿¡£µ±È»£¬ÔÚ¶¨Òå±äÁ¿ºó²»Òª³¬¹ý±äÁ¿µÄ×÷Ó÷¶Î§£¬Èç¹û³¬¹ý±äÁ¿µÄ·¶Î§¸³Öµ£¬ C ±àÒëÆ÷²¢²»±¨´í£¬µ«³ÌÐòÔËÐнá¹ûÈ´´íÁË£¬¶øÇÒÕâÑùµÄ´íÎóºÜÄÑ·¢ÏÖ¡£
ÔÚ ICCAVR ÖУ¬¿ÉÒÔÔÚ Options ÖÐÉ趨ʹÓà printf ²ÎÊý£¬¾¡Á¿Ê¹Óûù±¾ÐͲÎÊý (%c ¡¢ %d ¡¢ %x ¡¢ %X ¡¢ %u ºÍ %s ¸ñʽ˵Ã÷·û ) £¬ÉÙÓó¤ÕûÐͲÎÊý (%ld ¡¢ %lu ¡¢ %lx ºÍ %lX ¸ñʽ˵Ã÷·û ) £¬ÖÁÓÚ¸¡µãÐ͵IJÎÊý (%f) Ôò¾¡Á¿²»ÒªÊ¹Óã¬ÆäËü C ±àÒëÆ÷Ò²Ò»Ñù¡£ÔÚÆäËüÌõ¼þ²»±äµÄÇé¿öÏ£¬Ê¹Óà %f ²ÎÊý£¬»áʹÉú³ÉµÄ´úÂëµÄÊýÁ¿Ôö¼ÓºÜ¶à£¬Ö´ÐÐËٶȽµµÍ¡£
3¡¢¼õÉÙÔËËãµÄÇ¿¶È
£¨1£©²é±í(ÓÎÏ·³ÌÐòÔ±±ØÐÞ¿Î)
Ò»¸ö´ÏÃ÷µÄÓÎÏ·´óϺ£¬»ù±¾Éϲ»»áÔÚ×Ô¼ºµÄÖ÷Ñ»·Àï¸ãʲôÔËË㹤×÷£¬¾ø¶ÔÊÇÏȼÆËãºÃÁË£¬ÔÙµ½Ñ»·Àï²é±í¡£¿´ÏÂÃæµÄÀý×Ó£º
¾É´úÂ룺
long factorial(int i)
{
if (i == 0)
return 1;
else
return i * factorial(i - 1);
}
дúÂ룺
static long factorial_table[] =
{1 £¬ 1 £¬ 2 £¬ 6 £¬ 24 £¬ 120 £¬ 720 /* etc */ };
long factorial(int i)
{
return factori
Ïà¹ØÎĵµ£º
ÄÚºËÆô¶¯µÄÏÖÔÚÒѾÊÇ¿ªÊ¼Ö´Ðк¯Êýstart_kernelº¯ÊýÁË¡£start_kernelº¯ÊýÔÚinit/main.cÖж¨Òå¡£start_kernelº¯ÊýÖ»ÊÇÍê³É
ÏàÓ¦µÄ½á¹¹µÄ³õʼ»¯ÈÎÎñ¡£
printk(KERN_NOTICE);
printk(linux_banner);
setup_arch(&command_line);
ÔÚubootµÄÒ»Ö±¹ý³ÌÖУ¬uboo ......
Ò» £¬ÔõÑùѧϰCÓïÑÔ
ºÜ¶àÈ˶ÔѧϰCÓïÑԸе½ÎÞ´ÓÏÂÊÖ£¬¾³£ÎÊÎÒͬһ¸öÎÊÌ⣺¾¿¾¹ÔõÑùѧϰCÓïÑÔ£¿ÎÒÊÇÒ»¸ö½Ìʦ£¬ÒѾ¿ª·¢Á˺ܶàÄêµÄ³ÌÐò£¬ºÍºÜ¶à¸Õ¸ÕÆð²½µÄÈËÒ»Ñù£¬Ñ§Ï°µÄµÚÒ»¸ö¼ÆËã»úÓïÑÔ¾ÍÊÇCÓïÑÔ¡£¾¹ýÕâЩÄêµÄ¿ª·¢£¬ÎÒÉîÉîµÄÌå»áµ½CÓïÑÔ¶ÔÓÚÒ»¸ö³ÌÐòÉè¼ÆÈËÔ±¶àôµÄÖØÒª£¬Èç¹û²»¶®CÓ ......
λ¼ÆÊý¾ÍÊǶÔÒ»¸öÊýÖоßÓÐijЩÌØÕ÷µÄλ½øÐмÆÊý¡£¿´ÏÂÃæʵÏÖ£º
/* bitscount.c£ºÎ»¼ÆÊý */
/* ¼ÆËãxÖÐ1λµÄÊýÄ¿£º·½°¸1£¬²ÉÓ÷ÖÖβßÂÔ */
inline int pop(unsigned x){
/* ¶Ôÿ¸ö2λ×ֶΣ¬ÏÈÎö³öÆäÓҶ˵Ä1룬ÔÙÎö³öÆä×ó¶ËµÄ1λ£¬È»ºóÈÃÕâÁ½¸öλÏà¼Ó */
x=(x & 0x55555555)+((x>>1) & 0x555555 ......
×¢ÒâÖ»Äܵ½2049Ä꣡
#define uchar unsigned char
#define uint unsigned int
#include <intrins.h>
/*
¹«ÀúÄê¶ÔÓ¦µÄÅ©ÀúÊý¾Ý,ÿÄêÈý×Ö½Ú,
¸ñʽµÚÒ»×Ö½ÚBIT7-4 λ±íʾÈòÔÂÔ·Ý,ֵΪ0 ΪÎÞÈòÔÂ,BIT3-0 ¶ÔӦũÀúµÚ1-4 ÔµĴóС
µÚ¶þ×Ö½ÚBIT7-0 ¶ÔӦũÀúµÚ5-12 Ô´óС,µÚÈý×Ö½ÚBIT7 ±íʾũÀúµÚ13 ¸öÔ´óÐ ......