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

声明:

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

2、请勿用于商业用途。

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

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

REGISTERBANK Compiler Directive

Abbreviation

RB

Arguments

A number in range 0-3 enclosed in parentheses.

Default

REGISTERBANK (0)

µVision

Options — C51 — Misc controls.

Description

The REGISTERBANK directive selects which register bank to use for subsequent functions declared in the source file. Resulting code may use the absolute form of register access when the absolute register number can be computed. The using function attribute supersedes the effects of the REGISTERBANK directive.

 Note

  • Unlike the using function attribute, the REGISTERBANK control does not switch the register bank.
  • Functions that return a value to the caller must always use the same register bank as the caller. If the register banks are not the same, return values may be returned in registers of the wrong register bank.
  • The REGISTERBANK directive may appear more than once in a source program. However, it may be specified only outside a function definition (since it affects the code generated for the entire function). The directive is ignored if used within a function declaration.
See Also

AREGSNOAREGS

Example
C51 SAMPLE.C REGISTERBANK(1)

#pragma rb(3)


REGISTERBANK 编译器伪指令

缩写

RB

参数

0-3之间的整数,用括号括起来。

缺省

REGISTERBANK (0)

µVision

Options — C51 — Misc controls.

描述

REGISTERBANK 伪指令选择源文件中的子函数使用的寄存器组。当使用绝对寄存器号时,生成的代码使用绝对寄存器寻址。using 函数属性取代REGISTERBANK 伪指令。

 注意

  • 使用 using 函数属性, REGISTERBANK 伪指令不切换寄存器组。
  • 返回一个值给被调用者的函数必须和被调用者的寄存器组相同。如果不相同,返回值可能在不同的寄存器组。
  • REGISTERBANK 伪指令可以在源文件中出现多次。但是,只能在函数定义外指定(因为它影响整个函数的生成代码)。如果在函数声明内使用,该伪指令忽略。
参考

AREGSNOAREGS

示例
C51 SAMPLE.C REGISTERBANK(1)

#pragma rb(3)



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值