Keil Logo

C51: Programs That Use One Registerbank


Information in this article applies to:

  • C51 Version 6.01 and Later

QUESTION

What does the ONEREGBANK directive do?

ANSWER

The ONEREGBANK directive offers enhanced support for programs that use a single register bank. By default, the C51 Compiler ensures that registerbank 0 is selected by interrupt service routines (ISRs) that are declared without a using directive. This is done by adding the instruction:

 MOV PSW,#0

to the interrupt service routine entry code. This is necessary when the using directive is omitted on high-priority ISRs that may interrupt other low-priority ISRs (that have a register bank specified with the using directive). This also applies to RTX-51 and RTX-51 Tiny applications.

You may use the ONEREGBANK directive to specify that only registerbank 0 is used in your application. Then, C51 will not generate the additional MOV PSW,#0 instruction for ISRs.

SEE ALSO


Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  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.