Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I configure the compiler to allow calling functions using a different register bank?

0
Posted

How can I configure the compiler to allow calling functions using a different register bank?

0

This is not possible without disregarding the advantage of register bank switching: The 8051 instruction set lacks a MOV Rdst,Rsrc instruction. In order to move data between registers, a temporay static area or a direct address replacement for either of the two operands must be used. The latter one is preferred because it doesn’t require additional MOV instructions to store/retrieve the data in the static areas. Following type of instructions are used: (1) MOV Rdst,ARsrc (2) MOV ARdst,Rsrc ARsrc and ARdst are assembler labels that refer to the corresponding register in the current registerbank. The assembler will replace those labels with the appropriate direct address based on the register bank the module was compiled for. When passing parameters from one function to another there may be circumstances when the compiler will have to use MOV instructions with this addressing mode. Therefore, these two functions must have the same using, so that the registerbank used by the caller functi

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123