|
本源程序是每一个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_空函数)
[常用定义声明]
。
。
。
。
。
。
|
|