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

Could not pass argument in register

Hello to everyone
I have problem with passing argument in register
I have 3 functions, The first and the second is ok and they use only R7, A ,B in function body and argument is passed in register R7
The third one invokes first and second, but instead of using R7 to pass argument, stores arg in xdata or in data depending on model large or small
If i declare function1() in the same file everything is ok and argument is in R7, but the declaration is in other file
How can i resolve this

//Uses only R7, A ,B, argument pass in register R7
unsigned char function1(unsigned char arg) {
}

//Uses only R7, A ,B argument pass in register R7
unsigned char function2(unsigned char arg) {
}

unsigned char function(unsigned char arg) { if (function1(arg)) { variable = function2(arg); }
}

0