声明:
1、本翻译仅供个人学习使用,本人没有提供技术支持的义务,也不承担由此引发的任何后果。
2、请勿用于商业用途。
3、英文来自:http://www.keil.com/support/man/docs/c51/。
4、欢迎大家共同与我交流探讨(290207203@qq.com)。
RET_PSTK Compiler Directive
Abbreviation | RP |
Arguments | None. |
Default | None. |
µVision | Options — C51 — Misc controls. |
Description | The RET_PSTK directive instructs the compiler to use the pdata (Compact 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_PSTK 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_PBP ; SOURCE LINE # 5 0003 120000 E LCALL func2 ; SOURCE LINE # 6 0006 020000 E LJMP ?C?RET_PBP ; FUNCTION func (END) Note
|
See Also | |
Example | C51 SAMPLE.C RET_PSTK |
RET_PSTK 编译器伪指令
缩写 | RP |
参数 | 无。 |
缺省 | 无。 |
µVision | Options — C51 — Misc controls. |
描述 | RET_PSTK 伪指令告诉编译器对返回地址使用 pdata (Compact模型) 重入栈。 一般情况下,返回地址保存在 8051的硬件栈中。当使用这个伪指令时,编译器生成的代码从硬件栈中弹出返回地址,并保存到重入栈中。例如: 1 #pragma RET_PSTK 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_PBP ; SOURCE LINE # 5 0003 120000 E LCALL func2 ; SOURCE LINE # 6 0006 020000 E LJMP ?C?RET_PBP ; FUNCTION func (END) 注意
|
参考 | |
示例 | C51 SAMPLE.C RET_PSTK |