CX51 用户手册----RET_XSTK伪指令
来源:互联网 发布:李聪明 知乎 编辑:程序博客网 时间:2024/06/04 19:53
声明:
1、本翻译仅供个人学习使用,本人没有提供技术支持的义务,也不承担由此引发的任何后果。
2、请勿用于商业用途。
3、英文来自:http://www.keil.com/support/man/docs/c51/。
4、欢迎大家共同与我交流探讨(290207203@qq.com)。
RET_XSTK Compiler Directive
AbbreviationRX
ArgumentsNone.
DefaultNone.
µVisionOptions — C51 — Misc controls.
DescriptionThe RET_XSTK directive instructs the compiler to use the xdata (Large Model) reentrant stack for return addresses. Normally, return addresses are stored on the 8051's hardware stack. When this directive is specified, the compiler generates code that pops the return address from the hardware stack and stores it on the reentrant stack. For example:
1 #pragma RET_XSTK 2 extern void func2 (void); 3 4 void func (void) { 5 1 func2 (); 6 1 }ASSEMBLY LISTING OF GENERATED OBJECT CODE ; FUNCTION func (BEGIN)0000 120000 E LCALL ?C?CALL_XBP ; SOURCE LINE # 50003 120000 E LCALL func2 ; SOURCE LINE # 60006 020000 E LJMP ?C?RET_XBP ; FUNCTION func (END)
Note
- You may use this directive to unload return addresses from the on-chip or hardware stack. It may be selectively used on modules that contain the deepest stack nesting.
- If you use this directive you must initialize the reentrant stack pointer defined in the startup code. Refer to STARTUP.A51 for more information on how to initialize the reentrant stacks.
RET_PSTK
ExampleC51 SAMPLE.C RET_XSTK
RET_XSTK 编译器伪指令
缩写RX
参数None.
缺省None.
µVisionOptions — C51 — Misc controls.
描述RET_XSTK 伪指令告诉编译器对返回地址使用 xdata (Large 模型) 重入栈。一般情况下,返回地址保存在 8051硬件栈中。当指定这个伪指令时,编译器生成的代码从硬件栈中弹出返回地址,并保存到重入栈中。例如:
1 #pragma RET_XSTK 2 extern void func2 (void); 3 4 void func (void) { 5 1 func2 (); 6 1 }ASSEMBLY LISTING OF GENERATED OBJECT CODE ; FUNCTION func (BEGIN)0000 120000 E LCALL ?C?CALL_XBP ; SOURCE LINE # 50003 120000 E LCALL func2 ; SOURCE LINE # 60006 020000 E LJMP ?C?RET_XBP ; FUNCTION func (END)
注意
- 用户可以使用这个伪指令从片上或硬件栈中卸载返回地址。对包含深入嵌套栈的模块可以有选择地使用。
- 如果用户使用这个伪指令,必须初始化定义在启动代码中的重入栈指针。如何初始化重入栈的更多信息,参考 STARTUP.A51 。
RET_PSTK
示例C51 SAMPLE.C RET_XSTK
- CX51 用户手册----RET_XSTK伪指令
- Cx51 用户手册----FIXXC800 伪指令
- CX51 用户手册----FLOATFUZZY 伪指令
- CX51 用户手册----INCDIR 伪指令
- CX51 用户手册----INTERVAL 伪指令
- CX51 用户手册----INTPROMOTE 伪指令
- CX51 用户手册----INTVECTOR 伪指令
- CX51 用户手册----LARGE伪指令
- CX51 用户手册----LISTINCLUDE伪指令
- CX51 用户手册----MAXARGS 伪指令
- CX51 用户手册----MDU_F120伪指令
- CX51 用户手册----MDU_R515 伪指令
- CX51 用户手册----MOD517 伪指令
- CX51 用户手册----MODA2伪指令
- CX51 用户手册----MODAB2 伪指令
- CX51 用户手册----MODC2伪指令
- CX51 用户手册----MODDA伪指令
- CX51 用户手册----MODDP2伪指令
- Activity中的setDefaultKeyMode()
- 2011-12-01 15:03 JSP和J2EE基础
- 修改版本名称及手机型号
- 说谎者
- Android中数据文件解析(Json解析)
- CX51 用户手册----RET_XSTK伪指令
- 婚姻是什么
- js 倒计时
- subversion配置及权限管理
- 韩国成为全球首个高速网络覆盖率达100%的国家
- android数据存储之--------- SharedPreferences
- ASP.NET MVC 教程 - 理解行为过滤器
- 什么是幽默
- 让PHP更快的提供文件下载