Keil Logo

Fast Register Banks

Fast register bank switching may be used by interrupt service routines that must execute quickly. When enabled, register banks are switched using the PSW or BNKSELx SFR. Use the using keyword to specify fast register bank switching. For example:

void funcname (void) interrupt vector <[>using fastbank<]>

Where

funcname is the name of the function.
interrupt indicates that the function is an interrupt function.
vector is the interrupt vector name or trap number.
using specifies which register bank the function uses.
fastbank specifies the type of fast bank switching using the following options:
  • _FAST_BANK1_: PSW.BANK is used to select fast bank 1.
  • _FAST_BANK2_: PSW.BANK is used to select fast bank 2.
  • _FAST_ABANK1_: BNKSELx is used to select fast bank 1.
  • _FAST_ABANK2_: BNKSELx is used to select fast bank 2.

For example:

void my_isr (void) interrupt my_interrupt using _FAST_ABANK1_  {
  /* interrupt code goes here */
}
  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.