flat assembler
Message board for the users of flat assembler.

Index > Main > flat assembler 1.67

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



Joined: 16 Jun 2003
Posts: 8266
Location: Kraków, Poland
Tomasz Grysztar 30 Jun 2006, 11:58
The new development line has started with the 1.67.0 release, with the main trigger being this thread: http://board.flatassembler.net/topic.php?t=5458
Look there also for more information on the changes made in the new release.

The fact that PE files are now generated with non-relocatable addresses unless you put fixups directory somewhere allows now to do all the sophisticated things with the addresses that are not allowed in case of relocatable ones, like:
Code:
mov eax,-$    

or:
Code:
mov eax,MessageBox xor 12345678h    
Post 30 Jun 2006, 11:58
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8266
Location: Kraków, Poland
Tomasz Grysztar 30 Jun 2006, 20:14
1.67.1: added the few new instructions of the so-called AMD Pacifica.
Post 30 Jun 2006, 20:14
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 30 Jun 2006, 21:07
Nice, time to contact Joanna Rutkowska to tell her of the new addition Wink
Post 30 Jun 2006, 21:07
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1140
Location: Russian Federation
comrade 30 Jun 2006, 23:52
Thanks Privalov.

That xor thing is actually quite useful, and I used to even hack it in on a compiled executable (back when i was using masm) to do something like this:
Code:
if (font code = bold)
xor [fontPointer], (boldFont XOR regularFont)
end if
    
Post 30 Jun 2006, 23:52
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Adam Kachwalla



Joined: 01 Apr 2006
Posts: 150
Adam Kachwalla 02 Jul 2006, 10:48
What files you need to modify if you want to add extra prefixes such as 0b (binary numbers)?

locodelassembly wrote:
Nice, time to contact Joanna Rutkowska to tell her of the new addition

Who is Joanna Rutkowska?
Post 02 Jul 2006, 10:48
View user's profile Send private message Reply with quote
HyperVista



Joined: 18 Apr 2005
Posts: 691
Location: Virginia, USA
HyperVista 02 Jul 2006, 13:58
@Adam Kachwalla - re: "who is Joanna Rutkowska"

http://board.flatassembler.net/topic.php?t=5473
Post 02 Jul 2006, 13:58
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 02 Jul 2006, 16:15
Shouldn't be xchg al/eax/rax, al/eax/rax be assembled as NOP in all cases? Since the assembler encodes optimizing for size it should always use 90h, no?

Regards,
LocoDelAssembly
Post 02 Jul 2006, 16:15
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 02 Jul 2006, 16:30
loco: how about xor [something], 0 then. should it be assembled to nop too? or should it be assembled at all? how far do we want to go?
Post 02 Jul 2006, 16:30
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 02 Jul 2006, 17:11
Vid, there is a big difference:
Software Optimization Guide for AMD64 Processors wrote:
XCHG AX/EAX/RAX, AX/EAX/RAX/(R8 ) 90h DirectPath ~0 5
(NOP)

5. These instructions have an effective latency as shown. They map to internal NOPs that can be issued at a rate of
three per cycle but do not occupy execution resources.


But the problem is that if you write xchg ax, ax under use32 it will assemble the prefix for operand size override and the same with xchg eax, eax under use16. About AL sorry, I was wrong Razz

Regards
Post 02 Jul 2006, 17:11
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 02 Jul 2006, 17:48
alright then, but then it is not question of size optimizing, but question of beheaving due to manuals
Post 02 Jul 2006, 17:48
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 02 Jul 2006, 18:04
Why is not a question of size optimizing?

Current version do this:
Code:
use32
xchg ax, ax ; 66 90
xchg eax, eax ; 90
nop ; 90

use16
xchg ax, ax ; 90
xchg eax, eax ; 66 90
nop ; 90    


But I think it should be:
Code:
use32
xchg ax, ax ; 90
xchg eax, eax ; 90
nop ; 90

use16
xchg ax, ax ; 90
xchg eax, eax ; 90
nop ; 90    


Unless that there is a reason to keep the actual behavior (possibly there is one but I don't know).
Post 02 Jul 2006, 18:04
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8266
Location: Kraków, Poland
Tomasz Grysztar 02 Jul 2006, 20:30
Note that in long mode "xchg eax,eax" is not the same and NOP.
As for prefixes it's just a matter of consistency. I prefer to be able to generate 16-bit variant just for the sake of completness - it's actually a way of following the principles. And the agressive optimization is currently not fasm's principle - see also http://board.flatassembler.net/topic.php?t=1238 etc.
Post 02 Jul 2006, 20:30
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 02 Jul 2006, 21:27
OK, however it's a little strange since the architecture considers 90H as NOP, so are you defining a 16-bit variant of NOP under use32 and viceversa? I posted this because I think it's not some kind of aggressive optimization like the suggested in the link you posted.

Regards,
Hernán

PS: Yes, I know I can use macros to produce my proposed behavior Razz
Post 02 Jul 2006, 21:27
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8266
Location: Kraków, Poland
Tomasz Grysztar 02 Jul 2006, 21:49
Well, perhaps I should encode "xor ax,ax" as 66-33-C0 in 32-bit mode... Wink
Post 02 Jul 2006, 21:49
View user's profile Send private message Visit poster's website Reply with quote
Adam Kachwalla



Joined: 01 Apr 2006
Posts: 150
Adam Kachwalla 03 Jul 2006, 03:36
In EXPRESSI.INC, in the number_begin label:

Code:
        mov     ebx,esi
        add     esi,ecx
        push    esi
        dec     esi
        mov     dword [edi],0
        mov     dword [edi+4],0
        cmp     byte [ebx],'$'
        je      pascal_hex_number
        cmp     word [ebx],'0x'
        je      get_hex_number    


I have added this after the last line of the code above:

Code:
        cmp     word [ebx],'0b'
        je      get_bin_number    


and it still isn't working. What do I have to do to make it work?
Post 03 Jul 2006, 03:36
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8266
Location: Kraków, Poland
Tomasz Grysztar 03 Jul 2006, 08:44
Look at the checks for 'x' and '$' after the "get_hex_number" label. Do analogously.
Post 03 Jul 2006, 08:44
View user's profile Send private message Visit poster's website Reply with quote
Adam Kachwalla



Joined: 01 Apr 2006
Posts: 150
Adam Kachwalla 03 Jul 2006, 08:50
All I have to modify is the EXPRESSI.INC file, right?
Post 03 Jul 2006, 08:50
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8266
Location: Kraków, Poland
Tomasz Grysztar 03 Jul 2006, 09:21
Yes, only the "get_number" routine.
Post 03 Jul 2006, 09:21
View user's profile Send private message Visit poster's website Reply with quote
Garthower



Joined: 21 Apr 2006
Posts: 158
Location: Ukraine
Garthower 03 Jul 2006, 10:36
2Tomasz Grysztar: Where I can download last build of FASM 1.67? On http: // flatassembler.net/download.php version 1.66 is laid out only...
Post 03 Jul 2006, 10:36
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8266
Location: Kraków, Poland
Tomasz Grysztar 03 Jul 2006, 10:53
Don't you have it cached somehow?
Post 03 Jul 2006, 10:53
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  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-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.