This page provides instructions on how to configure and use Dev-C++, a programmer's IDE, to develop mixed C-Assembly programs using MASM32. Both Dev-C++ and MASM32 can be obtain free of charge from
From the first site you can download a Dev-C++ distribution that contains a full distribution of Mingw/GCC. The following instructions are based on version Dev-C++ 5.0 beta 9.2 (18.104.22.168) of such distribution. Version 9 of MASM32 was used.
DISCLAIMER: Although I have made my best effort to provide accurate information, the following information and code are provided without any warranty, implicit or explicit. You can use it free of charge at your own risk.
1) Download the zip file containing the sample code from here, and decompress it in an appropriate folder. You will provide you with files main.c, asmcode.asm and masm.mak, which you can use as templates for your program.
a) masm.mak to reflect the path to the masm32 libraries in your system;
b) asmcode.asm to reflect the location of the masm32 include files.
3) Create a new Dev-Cpp Console C-project and store it in the folder used to decompress the sample code in step 1. Close the default "main.c" without saving it.
4) Add to your project the files main.c and asmcode.asm:
5) From "Project/Project Options"
6) Go to "Tools/Compiler Options/Compiler", check the "Add these commands to the linker command line" option on, and enter
in the corresponding bottom text box. Then press OK.
8) Invoke "Execute/Compile". The following compiler messages
resolving _i_avg by linking to _i_avg@8
will appear in the compiler message area, indicating compilation without error. More details about the compilation/assembly process can be observed on the "Compile log"
9) Now you can single step through you program using this nice interface. To start,
10) Notice that
11) Once you are happy with your program, you can re-compile a "distribution" version by re-building without the debugging option and with optimization to increase performance. Striping the executable will usually reduce its size significantly.
12) Finally, although the above steps use C and MASM32, it may be relatively straightforward to adapt this process to use other languages.
Some Useful Links: