flat assembler
Message board for the users of flat assembler.

Index > Main > flat assembler 1.65

Goto page Previous  1, 2, 3, 4  Next
Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 03 Jan 2006, 10:41
mike.dld: no, it was still that bug with brackets :/ fixed it once more, hope this time finally - get the updated 1.65.3. And note this code can be written simpler as just:
Code:
macro __mov reg,a,b {
if ~a eq&~b eq
  mpack reg,a,b
else if ~a eq&b eq
  mov reg,a
end if
}    
and it worked correctly even without the fix.

halyalvin: this one is fixed now, too.
Post 03 Jan 2006, 10:41
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: 20537
Location: In your JS exploiting you and your system
revolution 04 Jan 2006, 02:26
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.    
Post 04 Jan 2006, 02:26
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 04 Jan 2006, 07:57
I just keep being blind. Laughing Try it now.
Post 04 Jan 2006, 07:57
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: 20537
Location: In your JS exploiting you and your system
revolution 04 Jan 2006, 11:13
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    
Only the last line has an error.
Post 04 Jan 2006, 11:13
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 04 Jan 2006, 12:02
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.
Post 04 Jan 2006, 12:02
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
Borsuc 04 Jan 2006, 12:26
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.
Post 04 Jan 2006, 12:26
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 04 Jan 2006, 13:08
The bug with in operator was aleady reported by halyalvin (see previous posts), and it's fixed.
Post 04 Jan 2006, 13:08
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
Borsuc 04 Jan 2006, 13:16
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 Cool
Post 04 Jan 2006, 13:16
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
Borsuc 04 Jan 2006, 14:12
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. Very Happy
Post 04 Jan 2006, 14:12
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 04 Jan 2006, 15:05
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 \} }    
Post 04 Jan 2006, 15:05
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 04 Jan 2006, 17:14
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. Wink
Post 04 Jan 2006, 17:14
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: 20537
Location: In your JS exploiting you and your system
revolution 05 Jan 2006, 04:12
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 Smile
Post 05 Jan 2006, 04:12
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 05 Jan 2006, 07:21
I haven't yet made any reliable speed tests - perhaps Fresh timing and making some statistics would help here.
Post 05 Jan 2006, 07:21
View user's profile Send private message Visit poster's website Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 05 Jan 2006, 10:55
Smile

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.
Post 05 Jan 2006, 10:55
View user's profile Send private message Visit poster's website Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost 05 Jan 2006, 15:08
yikes so many updates the last few days, hard to keep up Very Happy
even though fasm is only a small bit faster, i love it that much more Smile

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
Post 05 Jan 2006, 15:08
View user's profile Send private message AIM Address MSN Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 06 Jan 2006, 00:28
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.
Post 06 Jan 2006, 00:28
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 06 Jan 2006, 08:13
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.
Post 06 Jan 2006, 08:13
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 06 Jan 2006, 12:36
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 Neutral how odd is that? We're still in milliseconds Very Happy

P.S. Its about 1.3seconds here with 2.6Gig Celeron Wink
Post 06 Jan 2006, 12:36
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi 12 Jan 2006, 03:14
there is 1.65.6 but seems like Tomasz forgot to mention about it here...

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 12 Jan 2006, 03:14
View user's profile Send private message MSN Messenger Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost 12 Jan 2006, 03:51
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:

version 1.65.6 (Jan 12, 2006)

[-] Fixed a bug in the IRPS directive that caused it to fail on quoted string symbols


its only jan 11th here, i am using the fasm of the future Laughing

_________________
redghost.ca
Post 12 Jan 2006, 03:51
View user's profile Send private message AIM Address MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4  Next

< 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.