flat assembler
Message board for the users of flat assembler.

Index > Main > Syntax problem?

Author
Thread Post new topic Reply to topic
moriman



Joined: 01 Apr 2006
Posts: 55
Location: Northern Ireland
moriman
Am trying to set up a proc but stumbling at first hurdle Sad

Code:
invoke  Get2Numbers, [edi], eax


proc Get2Numbers, myStart, myLength
;                .
;                .
;                .
;                .
        ret
endp
    


This generates an error: operand size not specified. during compilation. Have tried adding :DWORD to variables in proc and also dword [edi] in the invoke but still same error.
Post 13 May 2006, 17:48
View user's profile Send private message Reply with quote
dead_body



Joined: 21 Sep 2005
Posts: 187
Location: Ukraine,Kharkov
dead_body
invoke Get2Numbers, dword [edi], eax
Post 13 May 2006, 18:25
View user's profile Send private message Reply with quote
UCM



Joined: 25 Feb 2005
Posts: 285
Location: Canada
UCM
its not invoke, its stdcall since invoke is for Win32 api functions.
stdcall has the same syntax, just replace invoke with stdcall.
Post 13 May 2006, 19:16
View user's profile Send private message Reply with quote
moriman



Joined: 01 Apr 2006
Posts: 55
Location: Northern Ireland
moriman
Thx UCM Wink

dead_body) It is more helpful if you read the OP Wink
Quote:

moriman...
"Have tried ...and also dword [edi] in the invoke..."

dead_body...
"invoke Get2Numbers, dword [edi], eax"
Post 13 May 2006, 19:31
View user's profile Send private message Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi
UCM wrote:
its not invoke, its stdcall since invoke is for Win32 api functions.
stdcall has the same syntax, just replace invoke with stdcall.



nope, try
Code:
_Get2Numbers rd 1
push dword Get2Numbers
pop dword [_Get2Numbers]
invoke _Get2Numbers,param,param    
Razz

'invoke function' does 'call [function]' while 'stdcall function' does 'call function'
Wink

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 13 May 2006, 22:46
View user's profile Send private message MSN Messenger Reply with quote
moriman



Joined: 01 Apr 2006
Posts: 55
Location: Northern Ireland
moriman
I changed my call from invoke to stdcall as suggested by UCM and everything is working fine for me┬┐
Post 14 May 2006, 00:19
View user's profile Send private message Reply with quote
UCM



Joined: 25 Feb 2005
Posts: 285
Location: Canada
UCM
okasvi: yes, i know that. but it's less efficient (and pointless.)
you could just do this:
Code:
_Get2Numbers dd 90909090h ;so that it can be executed Razz
mov [_Get2Numbers],Get2Numbers
invoke _Get2Numbers, blah, blah
    
Post 15 May 2006, 21:22
View user's profile Send private message 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. Also on YouTube, Twitter.

Website powered by rwasa.