flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tyler 04 Apr 2010, 23:14
Never mind, stupid mistake, I forgot the "\"s in front of the nested brackets. It works now. I hope someone else can get some use out of this too
![]() 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_unmet local cond_met j#cond cond_met jmp cond_unmet cond_met: mov dst,src cond_unmet: if ~(else_src eq ) display `else_src mov dst,else_src end if end if \} if defined `mov#`cond display `mov#`cond end if } |
|||
![]() |
|
Tyler 05 Apr 2010, 01:19
Fixes for some mistakes I didn't notice.
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 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 \} } |
|||
![]() |
|
baldr 09 Apr 2010, 20:02
Tyler,
Some remarks: 1. «if cond eq» will always take «else» branch. 2. Do you really need extra unconditional jump in case else_src is empty? 3. Labels .cond_met & .cond_unmet are not macro-local. 4. While cmovcc instructions are restricted to "r/m -> reg" kind of mov, they support full range of condition code mnemonics. |
|||
![]() |
|
Tyler 09 Apr 2010, 21:37
An updated version with local labels and a conditional call macro. http://board.flatassembler.net/topic.php?t=11375&start=2
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.