flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3, 4 Next |
Author |
|
revolution
Today I tried 1.65.4 but still cannot get a successful compile.
Code: use32 macro lea [stuff] { common local b1,b2,b3,address address equ match reg=,[addr],stuff\{address equ addr\} match reg=,size[addr],stuff\{address equ addr\} match reg=,size =ptr addr,stuff\{address equ addr\} virtual b1=0 b2=0 lea stuff if ($-$$)=2 load b1 byte from $$ load b2 byte from $$+1 else if ($-$$)=3 load b1 byte from $$ load b2 byte from $$+1 load b3 byte from $$+2 if ~(b1=8dh & (b2 and 307o)=004o & b3=24h) & \ ;lea reg,[esp] ~(b1=8dh & (b2 and 307o)=105o & b3=00h) ;lea reg,[ebp] b1=0 end if else if ($-$$)=6 & ~address eq load b1 byte from $$ load b2 byte from $$+1 if b1=8dh & (b2 and 307o)=005o ;lea reg,[immediate] b1=100h else b1=0 end if end if end virtual if b1=08dh if ~((b2 and 7o)=((b2 and 70o) shr 3)) db 08bh,b2 or 300o else ;do nothing end if else if b1=100h db 0b8h or ((b2 and 70o) shr 3) dd address else lea stuff end if } lea eax,[eax] ;this line okay lea eax,[esp] ;<-- error: extra characters on line. |
|||
![]() |
|
Tomasz Grysztar
I just keep being blind.
![]() |
|||
![]() |
|
revolution
Still having problems with 1.65.5. Going back to the LEA example:
Code: macro lea [stuff] { common local b1,b2,b3,address address equ match reg=,[addr],stuff\{address equ addr\} match reg=,size[addr],stuff\{address equ addr\} match reg=,size =ptr addr,stuff\{address equ addr\} virtual b1=0 b2=0 lea stuff if ($-$$)=2 load b1 byte from $$ load b2 byte from $$+1 else if ($-$$)=3 load b1 byte from $$ load b2 byte from $$+1 load b3 byte from $$+2 if ~(b1=8dh & (b2 and 307o)=004o & b3=24h) & \ ;lea reg,[esp] ~(b1=8dh & (b2 and 307o)=105o & b3=00h) ;lea reg,[ebp] b1=0 end if else if ($-$$)=6 & ~address eq load b1 byte from $$ load b2 byte from $$+1 if b1=8dh & (b2 and 307o)=005o ;lea reg,[immediate] b1=100h else b1=0 end if end if end virtual if b1=08dh if ~((b2 and 7o)=((b2 and 70o) shr 3)) db 08bh,b2 or 300o else ;do nothing end if else if b1=100h db 0b8h or ((b2 and 70o) shr 3) dd address else lea stuff end if } lea esi,[8] lea esi,[eax] lea esi,[eax*8] lea esi,[eax+p] lea esi,[p] lea esi,[eax*8+p] ;<-- error: missing end directive |
|||
![]() |
|
Tomasz Grysztar
I reduced the problem to this source:
Code: if 0 dd eax*8+p end if Unfortunately I have no time now to fix it, I will look into it later. |
|||
![]() |
|
Borsuc
Dunno if this was fixed though, didn't try latest version (I was quite busy), but here's the "invalid expression", contains no brackets:
Code: macro push reg { if reg in <ip,eip> ; do something else push reg } It gives me an error if I use push with a numeric value (which is not in ip or eip), like a label. push _end, for example, where _end is a macro local label. If I try this: Code: macro push reg { if reg eq ip pushw $ else if reg eq eip pushd $ else push reg } It works OK. dunno why it doesn't work with in directive. Hope it gets (maybe is, sorry, didn't try latest version) fixed. |
|||
![]() |
|
Tomasz Grysztar
The bug with in operator was aleady reported by halyalvin (see previous posts), and it's fixed.
|
|||
![]() |
|
Borsuc
sorry, didn't observe it that well in his post.. I though the bug came because he didn't use <> angle brackets in in operator. great if it's fixed
![]() |
|||
![]() |
|
Borsuc
just a silly suggestion. how about some directives (!equ !define, something like that), that replace the last symbolic constant with the new one.
Thus: Code: x equ match ... { restore x define x ... } ; somewhere at the end of the macro restore x could be written as Code: x equ match ... { !define x ... } ; somewhere at the end of the macro restore x dunno, just some ideas (it could be useful, like in my posted macro with the 'false' constant, etc..). It's not that hard to read, it's pretty the same as equ or define. at least, I tried making a !define macro, and I couldn't make it work correctly like the define. when I tried !equ macro i couldn't put empty constant (i.e x !equ ) sure, you can do it manually, so it's not so important. ![]() |
|||
![]() |
|
Tomasz Grysztar
The variant of (posted above) "equ2" macro working also with empty values, too would look like:
Code: struc equ2 value { match ,value \{ restore . define . \} match processed,value \{ restore . define . processed \} } |
|||
![]() |
|
Tomasz Grysztar
revolution: hunting down that bug (well, this time it was somewhere else than in the logical expression parser, actually) allowed me to also to re-optimize some of the parts of expression parser - check out the updated 1.65.5, hope it doesn't cause too much mess.
![]() |
|||
![]() |
|
revolution
Today I achieved my first successful compile with 1.65.5.new. And it compiles a teeny bit faster than 1.64.
This is a good thing ![]() |
|||
![]() |
|
Tomasz Grysztar
I haven't yet made any reliable speed tests - perhaps Fresh timing and making some statistics would help here.
|
|||
![]() |
|
decard
![]() OK so I compiled Fresh. I did it a few times to get better results. I did tests on my Athlon XP 64 3000+ (2.1 GHz). FASM v1.64 - 0.7 s FASM v1.65.5 - 0.6 s So there's a only little difference. Perhaps it would be greater on slower machines, but I can't don't have any available it right now. In the evening I will try it on PIII 600. |
|||
![]() |
|
RedGhost
yikes so many updates the last few days, hard to keep up
![]() even though fasm is only a small bit faster, i love it that much more ![]() i would have to say fasm currently has the best preprocessor/macroinstructions of any other language that i can think of (not only asm syntax) _________________ redghost.ca |
|||
![]() |
|
vid
decard: (1/7)*100 percent speedup is only a little difference? Problem is that FASM is so fast already that we can't try it on existing machines :]
Wasn't here for some time, nice improvements, but please slow down with new directives... I think we already can achieve everything we need with what we have. |
|||
![]() |
|
Tomasz Grysztar
The one I added was exactly because I was unable to achieve this particular thing - I was thinking about such directive since the time Revolution reported about problem with "x equ dqword" before the "struc POINT" definition. And The_Grey_Beast gave me the final stimulus to implement it.
|
|||
![]() |
|
Madis731
14.28% improvement is indeed much - at least in this stadium. And when you think about these seconds (0.6s) then its miraculously fast. This is a large project and we can't even talk about seconds
![]() ![]() P.S. Its about 1.3seconds here with 2.6Gig Celeron ![]() |
|||
![]() |
|
okasvi
there is 1.65.6 but seems like Tomasz forgot to mention about it here...
_________________ When We Ride On Our Enemies support reverse smileys |: |
|||
![]() |
|
RedGhost
okasvi wrote: there is 1.65.6 but seems like Tomasz forgot to mention about it here... ah you were right it says 1.65.6 in the downloads, thanks for the update info! Quote:
its only jan 11th here, i am using the fasm of the future ![]() _________________ redghost.ca |
|||
![]() |
|
Goto page Previous 1, 2, 3, 4 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.