Table of Contents        Previous topic       Next topic       

C COMPILER->Pragmas->#pragma_bank

#pragma bank("functions",<number>,<type>,<address>,<value>,<mask>)

Specifies that the following functions should be placed in code bank <number>.

<number> may be from 0 to 255.

<type> indicates the type of write operation that is required to switch in the memory bank and can be port, sfr or xdata.

<address> is the address written to in order to switch the memory bank.

<value> is the value written to address in order to enable the memory bank.

<mask> is the mask used during the write operation.  Note that if <type> is xdata, <mask> must be 0XFF.

For example:

#pragma bank("functions", 1, "port", 0X90, 0X02, 0X0F)

#pragma bank("functions", -1)

Disables the effect of the previous bank pragma and specifies that the following functions should not be placed in a switchable code bank.

See the section on Code Bank Switching for more details of the use of the bank pragma.