CX51 用户手册----NOREGPARMS伪指令

声明:

1、本翻译仅供个人学习使用,本人没有提供技术支持的义务,也不承担由此引发的任何后果。

2、请勿用于商业用途。

3、英文来自:http://www.keil.com/support/man/docs/c51/。

4、欢迎大家共同与我交流探讨(290207203@qq.com)。


NOREGPARMS Compiler Directive

Abbreviation

None.

Arguments

None.

Default

REGPARMS

µVision

Options — C51 — Misc controls.

Description

The NOREGPARMS directive forces the compiler to pass all function arguments in fixed memory locations. This directive generates parameter passing code which is compatible with Version 1 and Version 2 of the Keil C51 Compiler.

 Note

  • You may specify both the REGPARMS and NOREGPARMS directive several times within a source file to compile some functions using register parameters and other functions using the old style of parameter passing. For example:
    #pragma NOREGPARMS      /* Parm passing-old style */
    extern int old_func (int, char);
    
    #pragma REGPARMS        /* Parm passing-in registers */
    extern int new_func (int, char);
    
    main  ()  {
            char a;
            int  x1, x2;
            x1 = old_func (x2, a);
            x1 = new_func (x2, a);
    }
    
  • You may use the NOREGPARMS directive when accessing assembly functions or libraries that were built with older tools.
See Also

REGPARMS

Example
C51 SAMPLE.C NOREGPARMS


NOREGPARMS 编译器伪指令

缩写

无。

参数

无。

缺省

REGPARMS

µVision

Options — C51 — Misc controls.

描述

NOREGPARMS 伪指令强制编译器传递所有的函数参数到固定的存储器位置。在 Keil C51 编译器的版本1和版本2中,这个伪指令生成的参数传递代码兼容。

 注意

  • 用户可以在源文件中多次指定 REGPARMS 和 NOREGPARMS 伪指令,来编译使用寄存器参数的函数和使用老风格参数传递的函数。例如:
    #pragma NOREGPARMS      /* 参数传递-老风格 */
    extern int old_func (int, char);
    
    #pragma REGPARMS        /* 参数传递-寄存器 */
    extern int new_func (int, char);
    
    main  ()  {
            char a;
            int  x1, x2;
            x1 = old_func (x2, a);
            x1 = new_func (x2, a);
    }
    
  • 当访问用老工具构建的汇编函数或库函数时,用户可以使用 NOREGPARMS 伪指令。
参考

REGPARMS

示例
C51 SAMPLE.C NOREGPARMS




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值