flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > How can I reorder arguments of macroses? |
Author |
|
revolution 09 Aug 2005, 06:15
I think this may do what you want (but not tested)
Code: macro pascall name,[args] { common local arg_list arg_list equ reverse arg_list equ arg_list,args common invoke name,arg_list } |
|||
09 Aug 2005, 06:15 |
|
LocoDelAssembly 09 Aug 2005, 12:21
revolution, I already tried something like that but it throws the error "Error: invalid count of parameters for MessageBox." and with your code too:
Code: macro pascall name,[args] { common local arg_list arg_list equ reverse arg_list equ arg_list,args common invoke name,arg_list } pascall MessageBox,0,0,0,0 Apparently the invoke macro treates "arg_list" as one argument instead of for I think |
|||
09 Aug 2005, 12:21 |
|
LocoDelAssembly 09 Aug 2005, 13:24
Well, I did a macro to test how invoke recieves the params and it appear to treat the equate as one argument:
Code: macro docall name, [args] { forward display args, 13, 10 common display args, 13, 10 ; invoke name, args } macro pascall name,[args] { common local arg_list, first first equ 1 reverse match =0, first\{arg_list equ arg_list,args\} match =1, first\{ arg_list equ args first equ 0 \} common docall name,arg_list, "test" } pascall MessageBox, "H","E","L","O" Displays: OLEH test OLEHtest So how can I do this in other way? I'm using FASMW 1.64 |
|||
09 Aug 2005, 13:24 |
|
revolution 09 Aug 2005, 15:37
Sorry, you are right. Here is one possible solution (I tested it this time):
Code: macro invoke name,[args] { common display `name forward display ',',args+'0' common display 13,10 } macro pascall name,[args] { common arg_list equ reverse arg_list equ arg_list,args common match =,arg,arg_list \{invoke name,arg\} } pascall MessageBox,1,1,1,1 pascall MessageBox,2,2,2,2 pascall MessageBox,1,2,3,4 |
|||
09 Aug 2005, 15:37 |
|
LocoDelAssembly 09 Aug 2005, 16:21
Yeah it's works now, thanks a lot revolution
|
|||
09 Aug 2005, 16:21 |
|
MCD 10 Aug 2005, 08:11
Shouldn't this thread be moved to "Macroinstructions" section?
|
|||
10 Aug 2005, 08:11 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.