flat assembler
Message board for the users of flat assembler.
Index
> Windows > invokeif macro... |
Author |
|
vid 29 Jun 2005, 20:58
I can't see any error there, are you sure it doesn't work?
But: 1. use macro-local labels instead of @@. Also sart all their names with "..". 2. I believe you don't need to define jnbe and jnae. 3. Seems you forgot about signed local jumps - jl, jng... PS: why not "c0d3b453", if you want to look hacky? |
|||
29 Jun 2005, 20:58 |
|
cod3b453 30 Jun 2005, 17:18
1. When you say "local label instead of @@", do you mean:
Code: macro invokeif v1,cond,v2,proc,[args] { local _jmp ; <<< common cmp v1,v2 jn#cond _jmp ; <<< if ~ args eq stdcall proc,args else call [proc] end if _jmp: ; <<< } 2. Your probably right but it's there just in case 3. I never use jl jng etc (what do they do that the others don't anyway? lol) PS: Because the "0" on most fonts looks rubbish so i stick with "o" - if I really thought the number of non alpha numeric characters on my tag were related to my computer ability I would have had : ©ØÐ3ß@$€ |
|||
30 Jun 2005, 17:18 |
|
cod3b453 30 Jun 2005, 17:44
OK i just realised something - it's not the jump, but the call: when I use invoke it disassembles to:
call dword ptr [????????] whereas invokeif disassembles to: call ???????? so I have now got: Code: macro invokeif v1,cond,v2,proc,[args] { common cmp v1,v2 jn#cond @f if ~ args eq reverse pushd args common call dword ptr proc else call dword ptr proc end if @@: } |
|||
30 Jun 2005, 17:44 |
|
vid 30 Jun 2005, 20:13
of course, but it should be
Code: macro invokeif v1,cond,v2,proc,[args] { local ..jmp ; <<< note two dots common cmp v1,v2 jn#cond ..jmp ; <<< if ~ args eq stdcall [proc],args ;<- this was the problem else call [proc] end if ..jmp: ; <<< } otherwise code like Code: MyProcedure: ... invokeif ... .a: will define "_jmp.a" instead of "MyProcedure.a". But label with two dots doesn't change namespace. PS: "call ptr a" is same as "call [a]", and "call dword ptr a" is same as "call dword [a]" |
|||
30 Jun 2005, 20:13 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.