Keil Logo

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

AREGS, NOAREGS

Example
C51 SAMPLE.C REGISTERBANK(1)

#pragma rb(3)
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.