flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Preprocessor fun with arithmetic |
Author |
|
wht36 24 Dec 2008, 14:38
Brilliant!! Exactly what I needed! Many thanks!
The ability to do maths with the preprocessor makes macros very powerful indeed! |
|||
24 Dec 2008, 14:38 |
|
Tomasz Grysztar 30 Mar 2009, 16:51
The inability of fasm's preprocessor to do integer arithmetics natively is quite a serious flaw, and since my plans for fasm 2.0 (which was supposed to have no separate preprocessor, so that macros would use assembly-time features, including expression calculating and forward-referencing) are now not likely to be realised in any near future, I'm considering adding a "precalc" directive in 1.69 development line. This would be something like:
Code: define a 3 define b 4 precalc c a*b rept c ; making symbolic constant to be allowed as REPT counter is another good feature to add { ; repeated 12 times } And adapting fasm's expression parser and calculator to be used outside of parser/assembler scope would also make possible to implement a calculator feature in FASMD, so I'd get two nice things implemented at once this way. Yeah, it's definitely on my TODO list for 1.69.x line. |
|||
30 Mar 2009, 16:51 |
|
revolution 30 Mar 2009, 16:58
So what operations will you support? */+- I think we can expect of course, but what about shl, xor and/or FP versions of */+-? Brackets?
|
|||
30 Mar 2009, 16:58 |
|
Tomasz Grysztar 30 Mar 2009, 17:03
This would be the very same expression calculator, that is called by the assembler, thus all its operations would be allowed - well, except for the ones that do not work with pure integer values, like RVA or PLT.
As as I wrote above, I just plan to adapt this routine so that it will be possible to use it outside of parser/assembler modules. |
|||
30 Mar 2009, 17:03 |
|
buzzkill 30 Mar 2009, 17:09
Tomasz Grysztar wrote: ... since my plans for fasm 2.0 are now not likely to be realised in any near future... Just curious, but why are these plans on hold? Also, by implementing a temporary solution now, wouldn't you either force yourself to keep supporting that, or force users of this solution to modify their programs when 2.0 comes around? I think, in general, it may be better to wait a little longer, and then get a complete, integrated solution, than to add a temporary workaround right now. (Unless of course you already know that your ideal solution can't be done anytime in the forseeable future). |
|||
30 Mar 2009, 17:09 |
|
Tomasz Grysztar 30 Mar 2009, 17:27
buzzkill wrote: Also, by implementing a temporary solution now, wouldn't you either force yourself to keep supporting that, or force users of this solution to modify their programs when 2.0 comes around? Well, it's the opposite. By implementing such solution now I would allow new possibilities while still remaining compatible with the existing. The fasm 2 project by its very design would be very incompatible syntax-wise with fasm 1.x - the design of fasm 1.x, with separate preprocessor and assembler stages, is simply not adaptable for the things I wanted to have in fasm 2. So I guess that for people, who already use fasm 1.x and are happy with it, it may still be better to have a new features in this line, than to have a brand new assembler for which they'd have to rewrite their macros from scratch. |
|||
30 Mar 2009, 17:27 |
|
buzzkill 30 Mar 2009, 18:12
Ah OK, I didn't know that fasm2 is going to be incompatible with the current fasm. In that case you're right, of course, just add this feature
Is there any documentation about fasm2? Your plans, design ideas, maybe a roadmap of sorts? |
|||
30 Mar 2009, 18:12 |
|
Tomasz Grysztar 02 Apr 2009, 09:58
I've been thinking for those few days about giving here some short summary of my fasm 2 ideas... But then I got a new one: I think it would be a nice topic to cover in the official part of the fasmcon this year. I'm going to prepare such talk for this event.
|
|||
02 Apr 2009, 09:58 |
|
MazeGen 02 Apr 2009, 10:54
Great, Tomasz is gonna give a talk!
|
|||
02 Apr 2009, 10:54 |
|
buzzkill 02 Apr 2009, 15:12
Tomasz Grysztar wrote: I've been thinking for those few days about giving here some short summary of my fasm 2 ideas... But then I got a new one: I think it would be a nice topic to cover in the official part of the fasmcon this year. I'm going to prepare such talk for this event. It would be nice if you could also post a transcription of this after fasmcon for those of us that can't attend, so we also know what you're up to |
|||
02 Apr 2009, 15:12 |
|
Tomasz Grysztar 02 Apr 2009, 15:34
I hope we manage to set up the online conference, as on the previous events.
|
|||
02 Apr 2009, 15:34 |
|
buzzkill 02 Apr 2009, 17:14
OK that's fine too, it's just that I prefer reading to watching video, that's why I asked for a transcription.
|
|||
02 Apr 2009, 17:14 |
|
revolution 02 Apr 2009, 17:26
buzzkill: Unless you have some really smart piece of software that can auto-transcribe then I think you have just volunteered to be the official fasmcon transcriber. Thanks for the willingness to help.
|
|||
02 Apr 2009, 17:26 |
|
buzzkill 02 Apr 2009, 17:34
|
|||
02 Apr 2009, 17:34 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.