flat assembler
Message board for the users of flat assembler.
Index
> Main > flat assembler 1.61 Goto page Previous 1, 2, 3 |
Author |
|
revolution 08 Jun 2005, 08:52
Quote:
|
|||
08 Jun 2005, 08:52 |
|
Tomasz Grysztar 08 Jun 2005, 12:28
revolution: no, the matches would loose its macro-like sense (where the parameters obtained from "match" would be applied?) - it is designed to be something different that just something like "if".
|
|||
08 Jun 2005, 12:28 |
|
Tomasz Grysztar 08 Jun 2005, 14:45
I've also got an idea that standard symbolic constants (defined with EQU) would be replaced in the matched symbols (the symbols after comma), so you could just use "DONE equ NO" etc. in the sample above (and reduce the need for FIX directive at all), and also "match =name,name" to check for not defined symbolic constant.
This would reduce need for the FIX directive only to the preprocessor symbol redefinition, since the other current applications could be substituted by use of "match" solely to replace the symbolic constants: Code: match replaced, arg { some_macro replaced } And then I could even try to redefine FIX directive (but break backward compatibility!!!) to get rid of the "double fixing" problems it causes. |
|||
08 Jun 2005, 14:45 |
|
decard 08 Jun 2005, 20:07
I don't get everything about new "match" directive. Why this code doesn't work?
Code: macro .if [val] { common local __endif match a ==== b,val \{ cmp a,b jne __endif \} match a !== b,val \{ cmp a,b je __endif \} macro .endif \{ __endif: \} } mov eax,1 .if eax == 1 nop .endif It is attmpt to make more complex .if macro, that allows == and != operators for comparing... but when I compile this, the second match directive also inserts the code. |
|||
08 Jun 2005, 20:07 |
|
Tomasz Grysztar 08 Jun 2005, 21:00
The problem here is that for fasm ! is not special character so it is considered normal name. I can add it into table of special characters for that purpose, but this will disallow using ! inside the name. Hmmm, is anyone using names with "!" inside? And what about "?"?
|
|||
08 Jun 2005, 21:00 |
|
crc 08 Jun 2005, 22:35
I use "?" in some of my names
|
|||
08 Jun 2005, 22:35 |
|
IronFelix 09 Jun 2005, 07:19
Decard, try this code:
Code: macro .if val { common PROCESSED equ NO local __endif match a ==== b,val \{ cmp a,b jne __endif PROCESSED equ YES \} match =NO a !== b,PROCESSED val \{ cmp a,b je __endif \} macro .endif \{ __endif: \} } It works in 1.61.11 release. Regards. _________________ Flat Assembler is the best! |
|||
09 Jun 2005, 07:19 |
|
MazeGen 09 Jun 2005, 07:32
Quote: Hmmm, is anyone using names with "!" inside? And what about "?"? I always wondered why fasm enables using such special characters in identifiers. Now, when we want to disable it (I think C-like if/endif would be very useful), we break backward compatibility |
|||
09 Jun 2005, 07:32 |
|
Madis731 09 Jun 2005, 08:08
I can deal with breakage in backward compatibility - there has always been and there will always be somewhat bigger changes in the transform from 1.x => 1.(x+1) like between 1.4*-1.5* or 1.5*-1.6*
That is logical and I think we can cope with these changes to get a better FASM - that is more optimized for performance/size than optimized for compatibility. |
|||
09 Jun 2005, 08:08 |
|
MazeGen 09 Jun 2005, 09:25
Well, I'm porting my project to AMD64 architecture soon and I'm thinking of porting it from MASM to FASM. I can't imagine rewriting that large project every time new major version of FASM is released
This is one of the advantages of MASM - it's syntax and rules are quite stable and there is almost 100% backward compatibility with previous versions. |
|||
09 Jun 2005, 09:25 |
|
Tomasz Grysztar 09 Jun 2005, 09:50
Such things is advantage but might be a weak point at the same time - keeping the backward compatibility at any price can sometimes lead to terrible and almost unpredicatable syntax. And even MASM had some of its solutions gone obsolete after the better ones were implemented.
I tried to be very careful to avoid such things, when something not considered initially causes me to change mind about some design, but it seems I failed in case of FIX directive - but this syntax change actually won't actually visibly change the most of source, it only affects some of the macro constructions. As for the ! character - I ask whether anyone's using it in names, because it's possible that such change wouldn't affect any of the things people have written. But as long as I'm not sure, I will keep the previous meaning of this character (anyway: decard, you can still check for ! if it's not special character by writing =!, it only has to be spaced correctly to not become attached to the preceding name). I don't think any of this changes is anyway larger than the changes that were happening to MASM between some versions - do not worry, I wouldn't consider any changes that would affect really significantly the sources written for previous versions - they would affect all my code in the first place. Believe me: keeping backward compatibility was always my priority when designing any new features and if I break it, it means there are some really good reason for this. |
|||
09 Jun 2005, 09:50 |
|
MazeGen 09 Jun 2005, 10:37
Yea, I'm watching this board some time and therefore I know you are careful when you are implementing new features
You're right, MASM contains some obsolete, useless and underdocumented features, but he is the patriarch, so we know what we can expect from him. By contrast, FASM is still a youngster and we don't know rather what we can expect from him (I read Design Principles, very interesting, thanks for that) Privalov, can you say how "mature" is FASM today? I mean, are there any sigificant features not yet implemented? For instance, the new MATCH directive significantly improves and simplifies the syntax, as I can see it from new macros. |
|||
09 Jun 2005, 10:37 |
|
comrade 09 Jun 2005, 13:20
Privalov wrote: The problem here is that for fasm ! is not special character so it is considered normal name. I can add it into table of special characters for that purpose, but this will disallow using ! inside the name. Hmmm, is anyone using names with "!" inside? And what about "?"? i use ! |
|||
09 Jun 2005, 13:20 |
|
Tomasz Grysztar 09 Jun 2005, 13:28
OK, I will leave it unaffected.
(So if one needs C-like syntax, it just has to be "eax != 0" instead of "eax!=0".) |
|||
09 Jun 2005, 13:28 |
|
decard 09 Jun 2005, 14:03
Privalov wrote: anyway: decard, you can still check for ! if it's not special character by writing =!, it only has to be spaced correctly to not become attached to the preceding name Quote: (So if one needs C-like syntax, it just has to be "eax != 0" instead of "eax!=0".) Thanks for an explanation. Actually, I didn't want to use any HLL macros, I was just trying new directive BTW, Privalov, if you are about to add new features and change someting in FASM, I'm asking (again ) for some directive that will stop compilation. |
|||
09 Jun 2005, 14:03 |
|
Tomasz Grysztar 09 Jun 2005, 14:34
My proposal: In the very similar way to the Intel that defined UD2 opcode to always generate interrupt 6 (as it always did anyway, since earlier it was just undefined instruction) I would guarantee that HALT will never be recognized by fasm as a valid instruction and therefore can used to stop compilation
You can even follow it with your own message, since fasm displays the line that causes the error, you will see the message: Code: halt: wrong parameters |
|||
09 Jun 2005, 14:34 |
|
decard 09 Jun 2005, 15:22
I know about this solution of course.
Special directive for stopping compilation would be more elegant, but proably I won't convience you (at lest this time ). |
|||
09 Jun 2005, 15:22 |
|
Goto page Previous 1, 2, 3 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.