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