Qt and NASM assembler

After getting the NASM assembler working with Eclipse it didn’t take that long to finally get around to getting it working with Qt.

The main credit goes to this answer on stackoverflow, NASM .pro file in Qt.

So to quote the stackoverflow answer, to add NASM assembler (.asm files), add these lines to your .pro file in your Qt project:

And then to get your own sources to compile and be linked along with your project add them to the .pro file as simply as this:

More sources can be added using the ‘NASM_SOURCES +=’. That simple.

Because Qt is almost certainly 99.9% a C++ project, your assembler functions will have to be added by externalising them as C functions like:

An example of a .pro file for Qt 5.9 is:

Have fun with using assembler with Qt. Next up will be passing function parameters to assembler functions.