flat assembler
Message board for the users of flat assembler.

Index > Main > invoke (???)

Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 15 Jun 2011, 17:18

this below does compile Shocked
Code:
 invoke  EndDialog,[hwnd_dlg],1 2 ; not ,1,2 ... but ,1 2 <-- !!!    

Result
Code:
        push 1
      push 2
      push [hwnd_dlg]
     call EndDialog    


_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 15 Jun 2011, 17:18
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 15 Jun 2011, 17:21
push 1 2 =
push 1
push 2
Post 15 Jun 2011, 17:21
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 15 Jun 2011, 17:29

the comma is not essential with "invoke"?

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 15 Jun 2011, 17:29
View user's profile Send private message Send e-mail Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 15 Jun 2011, 17:32
the comma is not essential with "push".
Post 15 Jun 2011, 17:32
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 15 Jun 2011, 18:00
i see a space and therefore i can say you are pushing too many argument.s
Post 15 Jun 2011, 18:00
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 15 Jun 2011, 18:22

sorry, i don't understand
"invoke" is not "push"
and push doesn't work with a comma.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 15 Jun 2011, 18:22
View user's profile Send private message Send e-mail Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 15 Jun 2011, 18:40
ouadji, but invoke internally uses push and passes the entire argument ("1 2"), so invoke gives this to the assembler:
Code:
push 1 2
push [hwnd_dlg]
call [EndDialog]    
And then the assembler gives you_
Code:
push 1
push 2
push [hwnd_dlg]
call [EndDialog]    


I really hope this PUSH/POP multi-operands support not be present in fasm 2, it helps so little and can do so much harm in situations like this or even when using mathematical expressions...
Post 15 Jun 2011, 18:40
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 15 Jun 2011, 19:11

ok, understood, tkank you Loco

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 15 Jun 2011, 19:11
View user's profile Send private message Send e-mail Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 15 Jun 2011, 20:44
Loco: I agree in same cases this can cause ambiguity (eg. push 10 20 -1 5), but on other side, cases where you need to push multiple things are SO much more common. Practically every procedure has to do so.
Post 15 Jun 2011, 20:44
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20421
Location: In your JS exploiting you and your system
revolution 15 Jun 2011, 23:03
The only reason push allows spaces in operands is to support uses in procs. MS were too lazy to write a proper parser syntax so just allowed spaces instead. And now we get this type of problem. The law of unintended consequences. Sad
Post 15 Jun 2011, 23:03
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 16 Jun 2011, 00:13
Are you sure this is the real reason? I quite doubt that.
Post 16 Jun 2011, 00:13
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.