Assembly Help
Hello,everybody:
I was practicing assembly (i am a beginner), and i would like to know how to pass a variable in the DAT section to the PUB section. I know you can modify par's in the PUB, but how do you pass it up from the DAT? I am confused on how to use the par register; it is confusing to know what get's passed to which method, and so far and so forth.
Please help me understand this passing of parameters, and thank you.
I was practicing assembly (i am a beginner), and i would like to know how to pass a variable in the DAT section to the PUB section. I know you can modify par's in the PUB, but how do you pass it up from the DAT? I am confused on how to use the par register; it is confusing to know what get's passed to which method, and so far and so forth.
Please help me understand this passing of parameters, and thank you.
Comments
If you have Par, that is your zero positioning point. The next spin long that you have is par+1long, after that is par+2longs.
When you pass par as an address in the PASM initialization, you can then define a ptr to the long par+1, par+2 etc etc and move the address par+1 to a ptr variable defined at the bottom, so you can then write the ptr variable name, and it in turn writes to the address that is associated with it. Does that make sense? I threw together some generalized code, but if you post your project I'll insert applicable code into it.
Generalized code would look like