flat assembler
Message board for the users of flat assembler.
Index
> Windows > Function definition |
Author |
|
revolution 09 Dec 2012, 13:17
You can also use the simpler:
Code: invoke ExitProcess,0 Edit: Perhaps I misunderstood what you want. You would usually use stdcall or ccall instead of invoke for internal function calls. |
|||
09 Dec 2012, 13:17 |
|
Lucy Berie 09 Dec 2012, 13:50
Thanks.
My question is : How to define a function? Could you give me a function template example, which has an integer returning value (Like the simple C function example I mentioned above...) |
|||
09 Dec 2012, 13:50 |
|
ManOfSteel 09 Dec 2012, 15:14
C functions are nothing more than subroutines being called with their parameters pushed on the stack.
The proc macroinstruction provides a method to define procedures, e.g.: Code: mov eax,1234 ; call "TestProc" procedure with a parameter of "1234" stdcall TestProc,eax [...] [some more code] [...] ; define "TestProc" procedure proc TestProc Parameter ; define a local variable called "LOCAL_VAR" local LOCAL_VAR:DWORD ; read the local variable lea ebx,[LOCAL_VAR] ; write to the local variable mov [LOCAL_VAR],0xABCD ; invoke a system API that uses the contents of "Parameter", i.e. "1234" in decimal invoke SomeSystemAPI,[Parameter],ecx,0xDEADBEEF ret endp Check the Windows programming headers for more information. |
|||
09 Dec 2012, 15:14 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.