flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Slai
is there any way to use a macro for replasing the mov register, value with register=value ?
|
|||
![]() |
|
Tomasz Grysztar
Look here for some hints: http://board.flatassembler.net/topic.php?t=4638
Or check out this ready solution: Code: macro addxsyntax [reg] { macro reg param \{ define status 0 match =0 ++ , status param \\{ inc reg define status 1 \\} match =0 -- , status param \\{ dec reg define status 1 \\} match =0 +==src , status param \\{ add reg,src define status 1 \\} match =0 -==src , status param \\{ sub reg,src define status 1 \\} match =0 ==src , status param \\{ mov reg,src define status 1 \\} match =0 any , status param \\{ unknown syntax \\} \} } Code: addxsyntax ax,bx,cx,dx ax = 2 bx += 7 cx-- dx++ |
|||
![]() |
|
RedGhost
Tomasz Grysztar wrote: Look here for some hints: http://board.flatassembler.net/topic.php?t=4638 just fasm macro's code make a pretty damn powerful script language i think ![]() _________________ redghost.ca |
|||
![]() |
|
Slai
Great !
![]() |
|||
![]() |
|
llaurrentt
One of these days we'll end up having a set of macro that enable preprocessing of C or C++ code with FASM to produce assembly !!!
Just kidding ![]() ![]() |
|||
![]() |
|
scientica
Quote: One of these days we'll end up having a set of macro that enable preprocessing of C or C++ code with FASM to produce assembly !!! Just wait, sooner or later someone will do it... ![]() (and it will do optimizations too ![]() |
|||
![]() |
|
tantrikwizard
Tomasz Grysztar wrote: Look here for some hints: http://board.flatassembler.net/topic.php?t=4638 Thomasz, Thank you for this post, I like the HLA type syntax at times. I must be having a major brain fart because I cannot figure out the syntax of some of these more complex macros. I'm well familiar with the macro syntax of other assemblers (TASM, MASM, etc) but cannot, for the life of me, get my head around the FASM syntax. I've scoured through the documentation, examples, posts and tutorials but cannot figure out how these macros work. Would someone be so kind to detail in a step-by-step manner how these macros expand and are interpreted at assemble/process/preprocess time? Please no links! I've read them all and while many posts are very helpful, these are confusing to me. Thanks in advance. |
|||
![]() |
|
chris
there is a fasm preprocessor which expands macros and dump the results to file. I often find it useful in understanding marcos. check it out here http://board.flatassembler.net/topic.php?t=4490
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.