Keil™, An ARM® Company

Cx51 User's Guide

ONEREGBANK Compiler Directive

Abbreviation OB
Arguments None.
Default None.
µVision Options — C51 — Misc controls.
Description 

The C51 Compiler selects registerbank 0 on entry to interrupts that do not specify the using attribute. This is done at the beginning of the interrupt service routine with the MOV PSW,#0 instruction. This ensures that high-priority interrupts that do not use the using attribute can interrupt lower priority interrupts that use a different registerbank.

If your application uses only one registerbank for interrupts, you may use the ONEREGBANK directive. This elimitates the MOV PSW,#0 instruction.

Example 
C51 SAMPLE.C ONEREGBANK

#pragma OB