Keil™, An ARM® Company

C166 User's Guide

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

funcnameis the name of the function.
interruptindicates that the function is an interrupt function.
vectoris the interrupt vector name or trap number.
usingspecifies which register bank the function uses.
fastbankspecifies 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 */
}