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
Tomasz Grysztar

Joined: 16 Jun 2003
Posts: 7926
Location: Kraków, Poland
Tomasz Grysztar
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.
03 Jan 2006, 10:41
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 18182
revolution
Today I tried 1.65.4 but still cannot get a successful compile.
Code:
```use32
macro lea [stuff] {
common
virtual
b1=0
b2=0
lea stuff
if (\$-\$\$)=2
else if (\$-\$\$)=3
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
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)
else
lea stuff
end if
}
lea eax,[eax] ;this line okay
lea eax,[esp] ;<-- error: extra characters on line.    ```
04 Jan 2006, 02:26
Tomasz Grysztar

Joined: 16 Jun 2003
Posts: 7926
Location: Kraków, Poland
Tomasz Grysztar
I just keep being blind. Try it now.
04 Jan 2006, 07:57
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 18182
revolution
Still having problems with 1.65.5. Going back to the LEA example:
Code:
```macro lea [stuff] {
common
virtual
b1=0
b2=0
lea stuff
if (\$-\$\$)=2
else if (\$-\$\$)=3
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
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)
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.
04 Jan 2006, 11:13
Tomasz Grysztar

Joined: 16 Jun 2003
Posts: 7926
Location: Kraków, Poland
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.
04 Jan 2006, 12:02
Borsuc

Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
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.
04 Jan 2006, 12:26
Tomasz Grysztar

Joined: 16 Jun 2003
Posts: 7926
Location: Kraków, Poland
Tomasz Grysztar
The bug with in operator was aleady reported by halyalvin (see previous posts), and it's fixed.
04 Jan 2006, 13:08
Borsuc

Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
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
04 Jan 2006, 13:16
Borsuc

Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
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.
04 Jan 2006, 14:12
Tomasz Grysztar

Joined: 16 Jun 2003
Posts: 7926
Location: Kraków, Poland
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 \} }    ```
04 Jan 2006, 15:05
Tomasz Grysztar

Joined: 16 Jun 2003
Posts: 7926
Location: Kraków, Poland
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.
04 Jan 2006, 17:14
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 18182
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
05 Jan 2006, 04:12
Tomasz Grysztar

Joined: 16 Jun 2003
Posts: 7926
Location: Kraków, Poland
Tomasz Grysztar
I haven't yet made any reliable speed tests - perhaps Fresh timing and making some statistics would help here.
05 Jan 2006, 07:21
decard

Joined: 11 Sep 2003
Posts: 1092
Location: Poland
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.
05 Jan 2006, 10:55
RedGhost

Joined: 18 May 2005
Posts: 443
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
05 Jan 2006, 15:08
vid
Verbosity in development

Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
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.
06 Jan 2006, 00:28
Tomasz Grysztar

Joined: 16 Jun 2003
Posts: 7926
Location: Kraków, Poland
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.
06 Jan 2006, 08:13

Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
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 how odd is that? We're still in milliseconds

P.S. Its about 1.3seconds here with 2.6Gig Celeron
06 Jan 2006, 12:36
okasvi

Joined: 18 Aug 2005
Posts: 382
Location: Finland
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 |:
12 Jan 2006, 03:14
RedGhost

Joined: 18 May 2005
Posts: 443
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:

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

_________________
redghost.ca
12 Jan 2006, 03:51
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainTutorials and ExamplesDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsOS ConstructionIDE DevelopmentProjects and IdeasNon-x86 architecturesHigh Level LanguagesProgramming Language DesignCompiler Internals Other----------------FeedbackHeapTest Area
Goto page Previous  1, 2, 3, 4  Next

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum