Shop OBEX P1 Docs P2 Docs Learn Events
question about parameter and variable order in methods — Parallax Forums

question about parameter and variable order in methods

jstjohnzjstjohnz Posts: 91
edited 2011-04-29 06:52 in Propeller 1
If I have a method such as
PUB    mymethod (param1,param2,param3) | localtemp1,localtemp2

If I pass @param1 in PAR to my asm code, then I am passing the address of param1, and I know that I can add 4 to that to access the subsequent parameters. My question is, after the end of the parameters, if I add 4 again will I get a pointer to localtemp1, then localtemp2?

And can I directly access RESULT by the same scheme, either between params and temps or after temps?

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2011-04-28 22:20
    jstjohnz wrote: »
    And can I directly access RESULT by the same scheme, either between params and temps or after temps?
    Order in memory is result followed by function parameters followed by local variables. Note that those values are only valid until the method returns. After that point accessing them from PASM will give undefined results.
  • jstjohnzjstjohnz Posts: 91
    edited 2011-04-29 06:52
    kuroneko wrote: »
    Order in memory is result followed by function parameters followed by local variables. Note that those values are only valid until the method returns. After that point accessing them from PASM will give undefined results.

    Thanks, that is exactly what I needed to know.
Sign In or Register to comment.