flat assembler
Message board for the users of flat assembler.

Index > Windows > [SOLVED] Why c:DWORD does not compile?

Author
Thread Post new topic Reply to topic
Picnic



Joined: 05 May 2007
Posts: 1389
Location: Piraeus, Greece
Picnic 06 Nov 2010, 12:52
Hi all,

Why c:DWORD does not compile?
Code:
        format PE CONSOLE
        include "win32axp.inc"

.code
main:
        ret


proc SomeProc c:DWORD
                        
        ret
endp

.end main
    


Last edited by Picnic on 06 Nov 2010, 13:55; edited 2 times in total
Post 06 Nov 2010, 12:52
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 06 Nov 2010, 13:08
Picnic,

Are you afraid of "New thread" button? Wink

proc is a macroinstruction. By default, its arguments are separated by commas (yes, function name is argument too). Macro can parse arguments further, as defined by specification. This is the cause of your problem: «SomeProc c:DWORD» argument is split into «SomeProc» (name for function), «c» (calling conventions tag) and «:DWORD» (as a somewhat weird function parameter's name).
Post 06 Nov 2010, 13:08
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1389
Location: Piraeus, Greece
Picnic 06 Nov 2010, 13:23
Ok but why c:DWORD cause trouble but a:DWORD compiles fine?

Quote:
Are you afraid of "New thread" button?

Not at all, i have no means to damage primer topic Smile
Post 06 Nov 2010, 13:23
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20300
Location: In your JS exploiting you and your system
revolution 06 Nov 2010, 13:27
proc abc stdcall vars,...
proc abc c vars,...
proc abc vars,...
Code:
proc SomeProc stdcall:DWORD    
Post 06 Nov 2010, 13:27
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 06 Nov 2010, 13:40
revolution,

Perhaps Tomasz should change calling conventions' tag to «cdecl» to avoid name clash. Wink
Post 06 Nov 2010, 13:40
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20300
Location: In your JS exploiting you and your system
revolution 06 Nov 2010, 13:43
Or «ccall» and «stdcall» to match the macro names. With maybe aliases «cinvoke» and «invoke» also.
Post 06 Nov 2010, 13:43
View user's profile Send private message Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1389
Location: Piraeus, Greece
Picnic 06 Nov 2010, 13:54
Oh i understand, thanks baldr & revolution. shame on c Razz
Post 06 Nov 2010, 13:54
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.