期刊文献+

深入剖析51单片机软件函数的可重入性问题

In-depth Analysis of 51 Microcontroller Software Function Reentrant Problem
下载PDF
导出
摘要 介绍了MCS-51单片机的内存分布、C51变量存储方式和函数参数传递方式,由此引发了对C51函数可重入性问题的思考和分析。与其他处理器C语言编译器不同的是,除了在函数体中显式访问全局资源会破坏函数的可重入性之外,C51函数参数传递和局部变量存储分配空间时,可能存在隐式的全局资源访问冲突,同样会导致函数不可重入。通过对各种情况下的全局资源访问冲突分析,提出了相应的解决方案以避免不可重入函数被多任务调用引起软件运行异常。 In the paper,the memory distribution of MCS-51 microcontroller,the storage mode of C51 variable and the transfer mode of function parameter are introduced,which causes the thinking and analysis of the reentrant problem of C51 function.Unlike other processor C compilers,in addition to the fact that explicit access to global resources in the body of a function breaks function reentrant,C51 function parameter passing and local variable store allocation may also result in implicit global resource access conflicts that cause function non-reentrant.Based on the analysis of global resource access conflicts in various cases,the corresponding solutions are put forward to avoid software running exceptions caused by non-reentrant function being called by multi-task.
作者 朱剑辉 刘胜阳 郑渊 洪小骏 苏思友 Zhu Jianhui;Liu Shengyang;Zheng Yuan;Hong Xiaojun;Su Siyou(Shanghai Aerospace Electronic Technology Institute,Shanghai 201108,China;Shanghai Academy of Spaceflight Technology)
出处 《单片机与嵌入式系统应用》 2023年第8期4-7,共4页 Microcontrollers & Embedded Systems
关键词 MCS-51 内存分布 变量存储 参数传递 访问冲突 MCS-51 memory distribution storage mode parameter passing access conflict
  • 相关文献

参考文献7

二级参考文献11

  • 1吴光文,周航慈.51单片机操作系统开发中的问题与技巧[J].单片机与嵌入式系统应用,2004(11):75-76. 被引量:6
  • 2肖培林.用C语言开发51系列单片机高效代码[J].电子技术应用,1996,22(3):13-15. 被引量:7
  • 3雷电.96系列单片机C语言函数的重入与非重入性[J].微计算机信息,1996,12(1):45-47. 被引量:2
  • 4马忠梅,籍顺心,张凯,等.单片机的C语言应用程序设计[M].北京:北京航空航天大学出版社,2004.
  • 5Keil Software.The Final World On The 8051.Germany:Keil Elektronik Gmbh and Keil software,1997,88~104
  • 6马忠梅,刘宾,戚军,等.单片机C语言Windows环境编程宝典[M].北京:北京航空航天大学出版社,2004.
  • 7Kernighan Brian W, Rithie Dennis M. The C ProgrammingLanguage 2nd Ed[M].北京:机械工业出版社,2004.
  • 8Keil Software Inc, C51, pdf,2001,
  • 9徐爱钧,彭秀华.单片机高级语言C51windows环境编程与应用[M].电子工业出版社,2001:227-228.
  • 10Cx51 User' s Guide. http://www.keil.com/support/man/ docs/c51/ c51 _le_reentrantfuncs.htm.

共引文献13

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部