一、项目的开发过程
方案设计
设计软硬件仕样书
编码
调试
二、C语言基础
C语言的一个基本结构
#define TRUE 1
#define FALSE 0
#define SIZE 200
/*
#define xxx xxx Preprocessor directive
*/
void printf ( char* , int ) ;
void putchar ( char ) ;
/*xxx xxxx ( xxx , xxx ) Function prototype declarator (7) */
char mark [ SIZE + 1 ] ;
/* char xxx Type declarator (1) */
/* External definition (5) */
main ( )
{
int i , prime , k , count ; int xxx /* Type declarator (1) */
count = 0 ; xx = xx /* Operator (2) */
for ( i = 0 ; i <= SIZE ; i ++ ) /* for ( xx ; xx ; xx ) xxx ; Control structure (3) */
mark [ i ] = TRUE ;
for ( i = 0 ; i <= SIZE ; i ++ ) {
if ( mark [ i ] ) {
prime = i + i + 3 ; /*xxx = xxx + xxx + xxx Operator (2) */
printf ( " %6d " , prime ) ; /*xxx ( xxx ) ; Operator (2) */
count ++ ;
if ( ( count%8 ) == 0 ) putchar ( ' \n ' ) ; /*if ( xxx ) xxx ; Control structure (3) */
for ( k = i + prime ; k <= SIZE ; k += prime )
mark [ k ] = FALSE ;
}
}
printf ( " \n%d primes found. " , count ) ; /* xxx ( xxx ) ; Operator (2) */
}
void printf ( char *s , int i )
{
int j ;
char *ss ;
j = i ;
ss = s ;
}
void putchar ( char c )
{
char d ;
d = c ;
}
C语言的优缺点
便于移植
加快开发速度
代码效率不高
C语言的关键字
1)标准C关键字
auto break case char const continue default
do double else enum extern for float
goto if int long register return short
signed sizeof static struct switch typedef union
unsigned void volatile while
2)NEC C语言扩展关键字
_ _callt/callt ................................. Declaration of callt function
_ _callf/callf ................................. Declaration of callf function
_ _sreg/sreg...................................... Declaration of sreg variable
noauto .................................................. Declaration of noauto function
函数不通过堆栈传递参数,它通过寄存器或者fee4-fee7传递参数,临时变量也放在这个区域
_ _leaf/norec ................................... Declaration of norec function
自身不调用其他函数,它不通过堆栈传参数,它通过寄存器或者fee8-feef传递参数
临时变量放入fef0-fef7
bit........................................................