深入剖析51单片机软件函数的可重入性问题  被引量:1

In-depth Analysis of 51 Microcontroller Software Function Reentrant Problem

在线阅读下载全文

作  者:朱剑辉 刘胜阳 郑渊[2] 洪小骏 苏思友 Zhu Jianhui;Liu Shengyang;Zheng Yuan;Hong Xiaojun;Su Siyou(Shanghai Aerospace Electronic Technology Institute,Shanghai 201108,China;Shanghai Academy of Spaceflight Technology)

机构地区:[1]上海航天电子技术研究所,上海201108 [2]上海航天技术研究院

出  处:《单片机与嵌入式系统应用》2023年第8期4-7,共4页Microcontrollers & Embedded Systems

摘  要:介绍了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.

关 键 词:MCS-51 内存分布 变量存储 参数传递 访问冲突 

分 类 号:TP31[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象