flat assembler
Message board for the users of flat assembler.

Index > Windows > Procedures

Author
Thread Post new topic Reply to topic
saltmakrell



Joined: 10 Feb 2004
Posts: 6
Location: Norway
saltmakrell
Can anyone tell me how I write:
<<
proc WindowProc, hwnd,wmsg,wparam,lparam
>>

if I don't have the proc-macro?
I can't find out this by myself because I can't figure out how the macro works.
I am just doing this for understanding more of how it really works, so I will appreciate some help!

Thank you
Post 07 Mar 2004, 11:20
View user's profile Send private message MSN Messenger Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy
Something like (if I'm not wrong):
Code:
WindowProc:
  hwnd   equ ebp+8
  wmsg   equ ebp+12
  wparam equ ebp+16
  lparam equ ebp+20
push ebp 
mov  ebp,esp
; code goes here...
mov  esp,ebp 
pop  ebp
ret  4*4    
BTW: are you from Norway?? ("salt" and "makrell" are Norwegian words...so...)

Best regards,
Tommy


Last edited by Tommy on 07 Mar 2004, 14:25; edited 2 times in total
Post 07 Mar 2004, 13:21
View user's profile Send private message Visit poster's website Reply with quote
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv
If you are using the package downloaded from flatassembler.net, look into stdcall.inc It should answer your question....
Post 07 Mar 2004, 13:31
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
instead of 'enter x,0' use rather
push ebp
mov ebp,esp
sub esp,x ;x is size of local variables

instead of 'leave'
mov esp,ebp
pop ebp

this wy you see better how it works

and never forget to remove parameters at rtuening (like 'retn 16', not 'retn'). It causes bug on ME/SE/95/98 but doesn't at XP. Smile
Post 07 Mar 2004, 14:05
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
saltmakrell



Joined: 10 Feb 2004
Posts: 6
Location: Norway
saltmakrell
It worked very well with your code Tommy, if I just added DWORD before som variables in the code. After studying your code, and the stdcall.inc-macro, I found out more about how the macro actually processes it. I think it is something like this if I'm right:

<<

WindowProc:
virtual at ebp+8
_hwnd dd ?
_wmsg dd ?
_wparam dd ?
_lparam dd ?
end virtual
hwnd equ _hwnd
wmsg equ _wmsg
wparam equ _wparam
lparam equ _lparam

>>
When using this I don't need to pass the DWORD-word before the variables in the code.

Thank you alot. I have learned quite much from this.

Ruben


PS: Du har rett Tommy, med det at jeg er fra Norge!
Post 07 Mar 2004, 22:21
View user's profile Send private message MSN Messenger Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy
You're welcome! Wink
Post 08 Mar 2004, 10:57
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:  


< 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.