flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > need some help. |
Author |
|
LocoDelAssembly 22 Feb 2006, 02:21
In assembly time with "if macroArgument eqtype eax" is enought to check if the argument is a register, and if you need to check if it is an inmediate with "if macroArgument eqtype 1" you get it.
I don't know how to do the same in preprocesing time, maybe you should post more code in order to help you more. Quote: has code: |
|||
22 Feb 2006, 02:21 |
|
dead_body 22 Feb 2006, 07:53
locodelassembly
I learn how to write macros,and some time ago I have done the macros to mul two registers. Yesterday I try to make macros to multiply registers and immediate values. In macros I match the argument, like I post ago. But I don't know how to get type of src,src2,src3. And also question: if I write: "ebx = bl*10*bl*10" then when I will match I will have four arguments or three? Code: match =0 ==src*src2*src3,status param \\{ \\} Code: match =0 ==src*src2*src3*src4,status param \\{ \\} Quote: I don't know how to do the same in preprocesing time, maybe you should post more code in order to help you more. I will post macros at night if the problem will not be solved. |
|||
22 Feb 2006, 07:53 |
|
LocoDelAssembly 22 Feb 2006, 13:13
Code: macro displayType param{ if param eqtype eax display "(register)" else if param eqtype 1 display "(inmediate)" else display "(unsupported type)" end if display 13, 10 } macro macroName status, param{ match =0 dest==src*src2*src3*src4, status param \{ display "destination = ", \`dest if ~dest eqtype eax display "(WARNING: destination is not a register!!)" end if display 13, 10, "-------------", 13, 10 display "source = ", \`src displayType src display "source2 = ", \`src2 displayType src2 display "source3 = ", \`src3 displayType src3 display "source4 = ", \`src4 displayType src4 \} } macroName 0, ebx = 5 * eax * .label * edx .label: ; Note that labels will be treated as inmediates too but normally that will not be a problem for you The code above answers your question? About "ecx = bl*bl*100" note that if you put only that in a line you will get an error but if that expression is a macro argument (like the code above) then there is no error. |
|||
22 Feb 2006, 13:13 |
|
dead_body 22 Feb 2006, 13:38
Great Thanks! It is work! Thank you all. Good bye.
|
|||
22 Feb 2006, 13:38 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.