This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compiler error "Indirect call: parameters do not fit into registers"

Hi all,

I am new to using KEIL compiler. I am trying to compile a code and got this error. Can anyone explain what this error statement means? Anything to do with code banking?

Thanks alot!

Parents
  • Go back to the original error message, and read it again literally:

    "parameters do not fit into registers"

    What is that telling you?

    Now look at what you just wrote:

    "the first parameter, A1 is passed in registers R4 to R7 while second parameter, B1 is passed in registers R4 & R5."

    How many times have you just said that R4 & R5 are being used?

    Can this possibly work?

    Again, function pointers in C51 need a thorough understanding of the issues - you don't seem to have mastered this yet, so they are probably best avoided for now.

    Or, take Erik's approach: Just avoid them. Period.

Reply
  • Go back to the original error message, and read it again literally:

    "parameters do not fit into registers"

    What is that telling you?

    Now look at what you just wrote:

    "the first parameter, A1 is passed in registers R4 to R7 while second parameter, B1 is passed in registers R4 & R5."

    How many times have you just said that R4 & R5 are being used?

    Can this possibly work?

    Again, function pointers in C51 need a thorough understanding of the issues - you don't seem to have mastered this yet, so they are probably best avoided for now.

    Or, take Erik's approach: Just avoid them. Period.

Children
No data