Re: calling windows syscalls from gnu assembler



On Aug 30, 7:46 am, shikamuk <shika...@xxxxxxxxx> wrote:

How to call windows syscalls? I suppose, it is quite different from
Linux way and instead of moving params to regs, and doing int0x80 it
is necessary to call some windows dll functions?
And anyway, how to do it from gnu asm?
I intent to use mingw gnu binutils on windows to produce .exe files
from generated assembly, thank you

If you'd use Cygwin, you wouldn't have to change anything -- the
Cygwin layer would translate those int80h calls for you.

The later-half of this page shows how to call functions from the
'kernel', 'user', and 'gdi' DLLs using (g)as.
http://en.wikibooks.org/wiki/X86_Assembly/GAS_Syntax

In addition, you will need to tell 'ld' to link against those
libraries:
http://sourceware.org/binutils/docs-2.16/ld/WIN32.html#WIN32

Nathan.
.