flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Passing TWO paramiters to a MACRO |
Author |
|
revolution 25 Sep 2010, 23:35
Code: somevariable dw ? macro getresult onenumber,secondnumber,totalanswer { ;... do computations mov [totalanswer],ax } getresult 3,4,somevariable |
|||
25 Sep 2010, 23:35 |
|
janequorzar 25 Sep 2010, 23:47
revolution wrote:
Sadly, I have tried that ( your code as well ) and it still doesn't pass the parameters. total answer is what i'm trying to obtain, but it needs onenumber and secondnumber to bring the numbers in. It wont for some reason. not sure what the problem is. |
|||
25 Sep 2010, 23:47 |
|
revolution 25 Sep 2010, 23:56
Macros replace parameters by text substitution. So looking at your code now I see that you have used mov bx,[onenumber] which is replaced by the macro to mov bx,[3]. If you want to pass numeric values and not variable addresses then use mov bx,onenumber without the square brackets.
|
|||
25 Sep 2010, 23:56 |
|
janequorzar 26 Sep 2010, 00:03
revolution wrote: Macros replace parameters by text substitution. So looking at your code now I see that you have used mov bx,[onenumber] which is replaced by the macro to mov bx,[3]. If you want to pass numeric values and not variable addresses then use mov bx,onenumber without the square brackets. That worked PERFECTLY !!! Thank you.. I got rid of the somevariable.. didn't need it. Now I can just use getresult 1,6 or whatever numbers I want and it does what I need it to do.. awesome man.. thank you.. |
|||
26 Sep 2010, 00:03 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.