flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Nesting macros containing locals in an irps causes an error |
Author |
|
revolution 05 Apr 2010, 04:46
You have to escape local also.
Code: irps cond, a b { macro movstr \{ \local move move: lodsb stosb test al,al jnz move \} } |
|||
05 Apr 2010, 04:46 |
|
Tyler 05 Apr 2010, 05:15
Dude, you're freakin' kidding me!!! I spent SSOOO long pondering that one problem, I haven't finished anything today. The funny thing is, I also didn't escape the {}s the first few times, but I'd seen that done so many times, I eventually noticed it. Thanks, I'm using it for a conditional mov and call(not together), here's the code after I added \s
Code: irps cond, a b e z na nb ne nz { macro mov#cond dst*,src*,else_src \{ if cond eq mov dst,src else \local .cond_met \local .cond_unmet j#cond .cond_met if ~(else_src eq ) mov dst,else_src end if jmp .cond_unmet .cond_met: mov dst,src .cond_unmet: end if \} macro call#cond location ; Wasn't sure if I could use label \{ \local true \local false j#cond true jmp false true: call location false: \} } The actual jumps are really bad style, but it'll simplify my code 100 fold. |
|||
05 Apr 2010, 05:15 |
|
revolution 05 Apr 2010, 06:34
I use this little cmov macro for when I need to support older CPUs
Code: irp cc,a,ae,b,be,c,e,g,ge,l,le,na,nae,nb,nbe,nc,ne,ng,nge,nl,nle,no,np,ns,nz,o,p,pe,po,s,z { local i macro cmov#cc [args] \{ \common \local .x j#cc .x load i from $-2 store (i xor 1) at $-2 mov args .x: \} } |
|||
05 Apr 2010, 06:34 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.