calling windows syscalls from gnu assembler



Hello.
I have been written an intel codegenerator for one compiler during
last months.
It produce assembly source, which later can be compiled with gnu
assembly, and linked with gnu linker under linux.
Generator implemented in a way, when it is necessary to change only
two functions in order to port it to the new os
(if we do not talk about library)
First function makes generated mmap() call to allocate memory for NEW
and second function generates exit()

Now I know how to port it to FreeBSD, Solaris, and other unix systems,
but I do not have windows bavkground.

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
.



Relevant Pages