flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > AX=2 instead of mov AX,2 ? |
Author |
|
Slai 29 Jan 2006, 06:05
is there any way to use a macro for replasing the mov register, value with register=value ?
|
|||
29 Jan 2006, 06:05 |
|
Tomasz Grysztar 29 Jan 2006, 09:39
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++ |
|||
29 Jan 2006, 09:39 |
|
RedGhost 29 Jan 2006, 09:45
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 |
|||
29 Jan 2006, 09:45 |
|
Slai 29 Jan 2006, 23:18
Great ! Thanks
|
|||
29 Jan 2006, 23:18 |
|
llaurrentt 04 Nov 2006, 10:00
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 but I really wonder why are these people trying to make assembly code like basic! Anyway it shows the power of FASM preprocessor |
|||
04 Nov 2006, 10:00 |
|
scientica 06 Nov 2006, 11:21
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 ) |
|||
06 Nov 2006, 11:21 |
|
tantrikwizard 22 Jan 2008, 00:59
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. |
|||
22 Jan 2008, 00:59 |
|
chris 22 Jan 2008, 07:16
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
|
|||
22 Jan 2008, 07:16 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.