资源详细信息
对单片机C语言教材中一段程序的分析 - 资源详细说明
C语言是一种结构化的高级语言,具有代码紧凑、可移植性强、符合人的日常思维方式等特点.由于不需要深入了解单片机的指令系统和硬件结构、上手容易等特点,单片机的C语言学习和应用变得很普及.一些单片机开发者由于不了解单片机C语言和通用计算机C语言之间的区别,当涉及单片机内部硬件及端口操作,特别是在单片机的应用中经常使用的位操作等,编程时经常出现一些不易发现的错误.本文通过对一段程序的分析,从语法错误、循环变量使用、移位操作、拼写错误和算法错误等几个方面归纳了产生错误的原因并给出了解决的方法.还进一步指出了用C语言进行单片机开发需要注意的一些其它事项.上述问题在多次再版的教材中也存在,可见这类错误的普遍性和代表性,应引起单片机的C语言学习者的重视.
C language is a kind of structured high-level language,which has the characteristics of compact code,strong portability and conforming to people’s daily thinking mode.It becomes very popular to study and use C language of MCU because of not needing to know the instruction system and hardware structure of MCU and its ease of use.Because of not understanding the difference between single chip microcomputer C language and general computer C language,some MCU developers often make some programming mistakes which are not easy to find,when it comes to the internal hardware and port operation of the single chip computer,especially the bit operation which is often used in the application of the single chip computer.Through the analysis of a program,this paper sums up the causes of errors from grammatical errors,the use of cyclic variables,shift operations,spelling errors and algorithm errors,and provides some solutions.In addition,some other matters needing attention in developing C single chip microcomputer are discussed.These problems also exist in many textbooks.It can be seen that attention needs to be paid to the universality and representativeness of these errors by C language learners of MCU.
立即下载 对单片机C语言教材中一段程序的分析
下载说明与使用指南
下载说明
- 本资源需消耗 2积分
- 24小时内重复下载不扣分
- 支持断点续传功能
- 资源永久有效可用
使用说明
- 下载后使用解压软件解压
- 推荐使用 WinRAR 或 7-Zip
- 如有密码请查看资源说明
- 解压后即可正常使用
积分获取方式
- 上传优质资源获得积分
- 每日签到免费领取积分
- 邀请好友注册获得奖励
- 查看详情 →