flat assembler
Message board for the users of flat assembler.

Index > Programming Language Design > basic macro compiler

Author
Thread Post new topic Reply to topic
fasmFUN



Joined: 25 May 2019
Posts: 2
fasmFUN
hey all.
i super newb in macro assembler
and i would like your help
if it is possible to write macros for complicated expressions in HLA/FASM
for example, macro that can convert the following to HLA/FASM:
a = mid(a,1+sin(a+b*2),10)


(note: mid and sin are predefined functions)

i ask that because i saw some compilers that use this concept
(purebasic, masmBasic for example),
but i don't know how and if macros can handle complicated expressions.


thanks in advanced.
Post 15 Oct 2019, 16:27
View user's profile Send private message Reply with quote
fasmFUN



Joined: 25 May 2019
Posts: 2
fasmFUN
someone ?
Post 17 Oct 2019, 18:48
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4215
Location: 2018
edfed
i think the short answer is no.
but it is very possible to create an expression evaluator.

maybe you can look in the fasm source code to see how it's implemented by TG.
Post 18 Oct 2019, 08:09
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16840
Location: In your JS exploiting you and your system
revolution
I think the longer answer is that you probably can. But it would be a lot of work.

fasm isn't really meant to be an HLL compiler, so such things like arbitrary expression evaluation aren't very easy to implement. It kind of goes against the basic nature of what assemblers do.
Post 22 Oct 2019, 12:41
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.