|
|||||||||||
Technical Support On-Line Manuals Cx51 User's Guide ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Register Bank AccessThe Cx51 Compiler defines the default register bank in a function. The REGISTERBANK directive specifies the default register bank to use for all functions in a source file. This directive, however, does not generate code to switch the register bank. On reset, the 8051 loads the PSW with 00h which selects register bank 0. By default, all non-interrupt functions use register bank 0. To change this, you must:
By default, the Cx51 Compiler generates code that accesses the registers R0-R7 using absolute addresses. This is done for maximum performance. Absolute register accesses are controlled by the AREGS and NOAREGS directives. Functions which employ absolute register accesses must not be called from another function that uses a different register bank. Doing so causes unpredictable results because the called function assumes that a different register bank is selected. To make a function insensitive to the current register bank, the function must be compiled using the NOAREGS directive. This is useful for functions that are called from the main program and also from an interrupt function that uses a different register bank. Note
| ||||||||||
|
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.