|
本源程序是每一個MCS-51系列單片機C語言程序的必備內(nèi)容,包括程序開始處的說明信息、頭文件、SFR定義、子函數(shù)、主函數(shù)和C語言常用的
5大語句(if,while,do while,for,switch)模板?蓪⑵淠0逑螺d到本地硬盤,在編寫新程序的時候復(fù)制、粘貼到工程當(dāng)中,然后根據(jù)情況
寫入具體內(nèi)容。
注意:使用本模板必須熟悉單片機C語言編程
[單片機SFR定義的頭文件]
#include <REG51.h> //通用89C51頭文件
#include <REG52.h> //通用89C52頭文件
#include <STC11Fxx.H> //STC11Fxx或STC11Lxx系列單片機頭文件
#include <STC12C2052AD.H> //STC12Cx052或STC12Cx052AD系列單片機頭文件
#include <STC12C5A60S2.H> //STC12C5A60S2系列單片機頭文件
[更多庫函數(shù)頭定義]
#include <assert.h> //設(shè)定插入點
#include <ctype.h> //字符處理
#include <errno.h> //定義錯誤碼
#include <float.h> //浮點數(shù)處理
#include <fstream.h> //文件輸入/輸出
#include <iomanip.h> //參數(shù)化輸入/輸出
#include <iostream.h> //數(shù)據(jù)流輸入/輸出
#include <limits.h> //定義各種數(shù)據(jù)類型最值常量
#include <locale.h> //定義本地化函數(shù)
#include <math.h> //定義數(shù)學(xué)函數(shù)
#include <stdio.h> //定義輸入/輸出函數(shù)
#include <stdlib.h> //定義雜項函數(shù)及內(nèi)存分配函數(shù)
#include <string.h> //字符串處理
#include <strstrea.h> //基于數(shù)組的輸入/輸出
#include <time.h> //定義關(guān)于時間的函數(shù)
#include <wchar.h> //寬字符處理及輸入/輸出
#include <wctype.h> //寬字符分類
#include <intrins.h> //51基本運算(包括_nop_空函數(shù))
[常用定義聲明]
。
。
。
。
。
。
|
|