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

Parameter Passing in Registers

Hi

I am unclear as to how I can pass 2 generic pointer arguments into a function.

As stated in the user guide, the generic ptr will be stored in R1-R3. But however, what happens when there is more than 1 argument?

Please advice. Any explaination is appreciated. Thank you in advance.

Regards
Wtwh

Parents
  • The easy way to code that is to make a skeleton routine in C and use the very well documented assembly code generated as a template.

    Like you said,I have tried what you suggested. Unfortunately, I still have difficulty making sense of the assembly output.

    For example, to access a parameter it uses

    MOV DPTR,#ptos

    which I tried but generated an error in my assembly function.

    Kindly advice. Thank you very much.

Reply
  • The easy way to code that is to make a skeleton routine in C and use the very well documented assembly code generated as a template.

    Like you said,I have tried what you suggested. Unfortunately, I still have difficulty making sense of the assembly output.

    For example, to access a parameter it uses

    MOV DPTR,#ptos

    which I tried but generated an error in my assembly function.

    Kindly advice. Thank you very much.

Children
No data