flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Two bugs in FASM

Author
Thread Post new topic Reply to topic
orionius



Joined: 04 Aug 2006
Posts: 1
orionius
Hi
1. In files Fasm.asm and FasmW about dialog please fix year. In this files 2005 years but now 2006.

2.
push 2
push 3
short form this pushs is - push 2 3

push double 2.0
push double 3.0
error is - push double 2.0 double 3.0
and also error is push double 2.0 dq double 3.0
How i must compile this short form.
Sorry my bad english i am russian speak
Post 04 Aug 2006, 10:31
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17278
Location: In your JS exploiting you and your system
revolution
double is an 8 byte value. You must use two PUSH's to push the lower and upper halves separately.
Post 04 Aug 2006, 10:59
View user's profile Send private message Visit poster's website Reply with quote
GR-K



Joined: 11 Aug 2006
Posts: 13
Location: Novosibirsk, Russia
GR-K
The IA-32 processors are not have command for adding of two values in stack at the same time. If you are using the "push 2 3" directive it's become to macroinstruction and FASM generates "push 2/push 3".

Oh, yeah! And IA-64 CPUs too! I am lost that we are in 21st century :)
Post 12 Aug 2006, 16:17
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
"push double 2.0" this can be only macroinstruction call, maybe you meant "pushd double 2.0", where "pushd" is common win32 include macro used with stdcall and invoke.

"push 2 3" is not macro, it's unsyntactical allowed exception, because many people (well... tomasz) are used to it
Post 12 Aug 2006, 20:37
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
Yeah that's one of the TASM legacies in fasm.
Post 12 Aug 2006, 20:44
View user's profile Send private message Visit poster's website Reply with quote
GR-K



Joined: 11 Aug 2006
Posts: 13
Location: Novosibirsk, Russia
GR-K
OK, it's work as macroinstruction. Two commands will be genarated anyway Smile. Am I right? Rolling Eyes
Post 13 Aug 2006, 07:46
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
yes, see FASMLIB adaptation of pushd macro:
Code:
macro __libcall_pushd value*
{
  ...
  ;if value is "double [something]" or "double ptr something" use 2 pushes
  match ifend =double [var],ifend value
  \{
    push dword [var+4]
    push dword [var]
  \}
  match ifend =double =ptr var,ifend value
  \{
     push dword [var+4]
     push dword [var]
  \}
  ;if value is "double something" use 2 pushes (more tricky, needs to be loaded)
  match ifend =double num,ifend value
  \{
     \local ..high,..low
     virtual at 0
        dq num
        load ..low dword from 0
        load ..high dword from 4
     end virtual
     push dword ..high
     push dword ..low
  \}
  ...
}    
Post 13 Aug 2006, 11:09
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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-2020, Tomasz Grysztar.

Powered by rwasa.