Windows Development with FASM
12 Sep 2015In this post, I’ll walk through the steps required to bootstrap your development experience against the Win32 API using the Flat Assembler.
Prerequisites
Everything is provided for you when you download the fasmw package, including libraries, include files. fasmw even includes a linker pre-geared for windows as your target.
Test program
Here’s the code to present a message box.
Everything is provided to you through win32ax.inc
. This can be swapped out easily enough with a 64 bit counterpart if you’re targeting different architectures.
Assembling and linking
Now that you’ve got your source file, hello.asm
you can produce an object file with the following:
That’s all there is to it. You’ll now have an exe available to you to run. The only gotcha is giving fasm
a hint as to where your include files are, and you do this through the INCLUDE
environment variable: