flat assembler
Message board for the users of flat assembler.
Index
> Main > flat assembler 1.61 Goto page Previous 1, 2, 3 Next |
Author |
|
Madis731 31 May 2005, 16:52
No I didn't misunderstand you it was the other way round
I stated that you can't tell Windows what to do 'cuz its M$ and 'cuz its closed source. You can give Privalov suggestions though because if people love these suggestions it helps FASM develop and get more popular. So if I can understand correctly you also would like the name of YOUR program in the beginning and FASM programs description at the end if any... May I suggest that Taskbar reveals the maximum possible letters from a string like "FileName.asm - flat assembler 1.61" so the first that will be eaten off is the version, then the name of the assembler, after that the extension of you asm program (which is logical) and finally the name of the assembly file. Wouldn't you agree Privalov? |
|||
31 May 2005, 16:52 |
|
Tomasz Grysztar 02 Jun 2005, 18:23
Version 1.61.9 brings a small suprise: I have implemented the DUP operator - one more thing to make conversion from TASM/MASM easier (and also in some cases DUP is much more handy than NASM-style TIMES):
Code: db 3 dup ('abcd',0), ?, 7 dup '-' Works with any data definition directive (again except for the FILE, which has the different syntax). |
|||
02 Jun 2005, 18:23 |
|
Nikolay Petrov 03 Jun 2005, 18:24
Madis731 wrote: So if I can understand correctly you also would like the name of YOUR program in the beginning and FASM programs description at the end if any... By the way Code: times 3 db 'abcd',0 db ? times 7 db '-' Is it a differently from: Code: db 3 dup ('abcd',0), ?, 7 dup '-' |
|||
03 Jun 2005, 18:24 |
|
Madis731 03 Jun 2005, 18:28
So what DO you want then - I'm sorry I wasn't joking - what did you mean then?
Describe here what did you expect from FASM! |
|||
03 Jun 2005, 18:28 |
|
Tomasz Grysztar 03 Jun 2005, 18:38
Nickolay: well, this:
Code: label alpha byte times 3 db 'abcd',0 db ? times 7 db '-' in terms of result is the same as: Code: alpha db 3 dup ('abcd',0), ?, 7 dup '-' but the latter is more convenient, isn't it? And at least for people that are used to TASM/MASM this should be actual easement. |
|||
03 Jun 2005, 18:38 |
|
Madis731 03 Jun 2005, 18:47
Hi Privalov
What do you think about Nickolay's idea of putting assembly file's name to the taskbar? And BTW what does the 'dup' acronym mean? www.acronymfinder.com gave me "Data User Part" but that is only somewhat logical |
|||
03 Jun 2005, 18:47 |
|
Nikolay Petrov 03 Jun 2005, 18:58
Wow people you are a very fast
Midas731 - sorry, may be my sense of humor is a strangely. Privalov I agree. I use a primary fasm compiler for my prog and I have more problem with: proc bla, var1:byte,var2:float,var3:dword,... than "dup" |
|||
03 Jun 2005, 18:58 |
|
Nikolay Petrov 03 Jun 2005, 19:20
Madis731 I "want" when I have a too many fasm windows opened, I to know what is the asm script. "tab" window is a good but this is information not put in the taskbar.
For me it doesn't matter if in taskbar write: flat assembler 1....[bla.asm] or bla.asm - flat assembler 1... Last edited by Nikolay Petrov on 03 Jun 2005, 19:29; edited 2 times in total |
|||
03 Jun 2005, 19:20 |
|
shaolin007 03 Jun 2005, 19:26
Madis731 wrote: Hi Privalov dup=duplicate |
|||
03 Jun 2005, 19:26 |
|
Tomasz Grysztar 03 Jun 2005, 20:49
Quote:
You might try such "proc" macro variant: Code: macro proc name,[arg] { common if used name name: virtual at ebp+8 if ~ arg eq forward label arg dd ? common end if ..ret = $ - (ebp+8) end virtual local ..data,..size if defined ..size virtual at ebp - ..size else if ..ret push ebp mov ebp,esp end if end if ..data: macro enter size,level \{ if size eq & level eq rb (4 - ($-..data) and 11b) and 11b if defined ..size ..size = $ - ..data end virtual else ..size = $ - ..data end if if ..ret | defined ..size push ebp mov ebp,esp if ..size sub esp,..size end if end if else enter size,level end if \} macro return \{ if ..ret | defined ..size leave end if if ..ret retn ..ret else retn end if \} } macro endp { purge return purge enter end if } It allows syntax like: Code: proc foo, arg1:byte, arg2:dword mov al,[arg1] mov ebx,[arg2] return endp But its weak point compared to standard fasm's "proc" macro is that the arguments are defined as global labels. BTW, I have also once tried to reorganize fasm's macros to use "ret" keyword instead of "return" in procedures, just like it should be with procedures (also for kind of compatibility with TASM), but there was too strong opposition, because (probably because of NASM style) people expect RET keyword to generate the near return opcode - while it is RETN and RETF that are the actual mnemonics for near and far return, and RET should be able to generate any of the two depending on the context. I still think using this original meaning of RET would be better. |
|||
03 Jun 2005, 20:49 |
|
crc 03 Jun 2005, 23:05
Quote: Version 1.61.9 brings a small suprise: I have implemented the DUP operator - one more thing to make conversion from TASM/MASM easier (and also in some cases DUP is much more handy than NASM-style TIMES): Hmm, I use a macro named dup in my code. Will my macro still be useable without renaming it? (I'll try to test tomorrow, just to see). |
|||
03 Jun 2005, 23:05 |
|
Tomasz Grysztar 03 Jun 2005, 23:12
Of course, there shouldn't be any problems. Macros and symbolic constants can override any keyword.
|
|||
03 Jun 2005, 23:12 |
|
crc 04 Jun 2005, 00:57
Quote: Of course, there shouldn't be any problems. Macros and symbolic constants can override any keyword. Excellent! I just tested it, and sure enough it worked. Thanks for clarifying this for me. |
|||
04 Jun 2005, 00:57 |
|
Tomasz Grysztar 07 Jun 2005, 14:20
The 1.61.10 release comes with one important fix and one new feature. The fix applies to ELF64 object output - I have misinterpreted the ELF64 specification according to the RELA relocations type and this caused previous versions to generate wrong code - now everything should be OK with ELF64 objects.
The new feature is the experimental "match" - the long awaited conditional preprocessing directive. However, as I wanted to base it on the macro handler in the similar way to "rept", I have designed it to allow even more interesting things. The simplest description is: "match" checks whether the given chain of symbols matches the given pattern. Pattern comes first, the comma and potentially matching symbols next: Code: match +,+ { ; this will be preprocessed } match +,- { ; there's no match, this won't be preprocessed } The special characters and quoted strings in pattern have to be matched exactly, like in the sample above, however if you put any name symbol in pattern, it will match any chain of symbols. If you need some symbol to be matched exactly as is, precede it with = character. Code: match alpha, 1+1 { } ; match match =alpha, 1+1 { } ; mismatch match =alpha, alpha { } ; match So the = is interpreted specialy in pattern and symbol following is treated as pattern element to be compared exactly, so it also allows to check for the comma in the pattern by preceding comma with =, and to check for = character with the == sequence. And what makes "match" something more than just simple conditional preprocessing is that the names which match any chain of symbols are then replaced inside the "match" block with those chains of symbols - just like macro parameters. For example: Code: match alpha+beta*gamma,1+2*3 { db alpha,beta,gamma } ; becomes db 1,2,3 Any name must match at least one symbol, it cannot match empty value: Code: match any, { } ; mismatch But each consecutive name is matched with as few symbols as possible: Code: match any other, 1+2*3 { db any ; db 1 db other ; db +2*3 } It should be obvious that this directive significantly extends the abilities of processing any macro parameters, se also the sample below. I haven't managed to design any good solution for something like "else match", however "fix" directive can help again (at least until something better is invented): Code: macro freeform [arg] { common DONE fix NO match src->dst, arg \{ mov dst,src \DONE fix YES \} match =NO dst<-src, DONE arg \{ mov dst,src \DONE fix YES \} match =NO, DONE \{ unrecognized syntax \} } freeform eax -> ebx ; mov ebx,eax freeform al <- [esi+1] ; mov al,[esi+1] Note that DONE constant is escaped inside "match" - this is required, because "match" (just like "rept") is processed similarly to macro, and therefore is actually processed twice - first it gets defined (and during the definition prioritized constants get replaced with their values) and only after the definition is completed preprocessor actually checks for the match and applies the macro when the match occurs. So if we wrote "DONE fix YES" inside the "match" block after the "DONE fix 0" definition, it would become "0 fix YES" before actuall processing of the macro (when the FIX directive would be interpreted) - thus the escaping was needed. This is a small flaw in my design, but I really think this is the best way how could I implement it. |
|||
07 Jun 2005, 14:20 |
|
pelaillo 07 Jun 2005, 17:47
Quote:
How does the "any[blank]other" works here? Which are the symbols that work? |
|||
07 Jun 2005, 17:47 |
|
Tomasz Grysztar 07 Jun 2005, 17:51
Both "any" and "other" match any chain of symbols, but both will take as few symbols as possible - and so "any" matches only one symbol leaving rest for the "other", and "other" has to take all the rest of symbols since there is nothing more in pattern.
|
|||
07 Jun 2005, 17:51 |
|
Tomasz Grysztar 07 Jun 2005, 19:24
I've decided to disable replacing prioritized constant during the definition of in-place macro like "rept" or "match" - this will make it behave more like one would expect (at the cost of making impossible to "fix" any control operators for those structures).
|
|||
07 Jun 2005, 19:24 |
|
revolution 08 Jun 2005, 08:45
Can it be made similar to IF so that the ~ will mean not matched?
Code: macro if_def name { match =defined,name \{ } macro if_ndef name { match ~ =defined,name \{ } |
|||
08 Jun 2005, 08:45 |
|
vid 08 Jun 2005, 08:46
wow, preprocessor is becoming really messy... but at least we have lot of power with it.
I just like to know - is it possible to match "," character, since "<",">"s doesn't play any special role now...? |
|||
08 Jun 2005, 08:46 |
|
Goto page Previous 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.