Windows Development with MASM
12 Sep 2015In this post, I’ll walk through the steps required to bootstrap your development experience against the Win32 API using the Microsoft’s Macro Assember.
Prerequisites
Downloading the package from the masm32.com site will be everything that you need to produce applications using assembly language. It not only includes the assember ml
, but also includes all of the library, include files and linker for you.
Test program
Here’s the code to present a message box.
invoke
goes a long way to cleaning up how any assembly program that is sub-routine heavy looks. The include files already do the externing of library symbols so that your code doesn’t need to explicitly declare that you’re using a particular function.
Assembling and linking
Now that you’ve got your source file, hello.asm
you can produce an object file and executable with the following:
You can see that not only assembler switches are passed, but also linker switches which means you’re assembling and linking all in one step.
Conclusion
The bundle for masm32 that this article refers to is great in the amount of code that it offers you, but the provided assembler is well-dated. Microsoft have been keeping masm updated from their website with 64 bit versions available with their development tools.