|
|||||||||||
|
Technical Support Support Resources
Product Information |
C51: Using Only One RegisterbankInformation in this article applies to:
QUESTIONWhat does the ONEREGBANK compiler directive do? ANSWERWhen the C51 compiler generates code for an interrupt function that is declared without a USING directive, register bank 0 is selected by default. For example:
generates the following interrupt entry code:
Setting the PSW is necessary when you use both high-priority interrupts and low-priority interrupts. If a high-priority interrupt is declared without a using directive, the compiler assumes you want to use registerbank 0. This is required when interrupting low-priority interrupts that HAVE specified a registerbank (with the using directive). By default, the C51 compiler uses this technique to ensure that high-priority interrupts that do not specify a registerbank with the using attribute can interrupt lower priority interrupts that use a different registerbank. If you only use one registerbank in your program, you can use the ONEREGBANK directive to tell the compiler to avoid selecting registerbank 0 in interrupts that don't specify the using directive. SEE ALSOLast Reviewed: Thursday, February 25, 2021 | ||||||||||
|
|||||||||||
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.