NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: shaynox on March 01, 2015, 10:41:14 PM

Title: Tutorial for build nasm on Visual Studio 2013
Post by: shaynox on March 01, 2015, 10:41:14 PM
                                                              !!!!!!!!!! TUTO FOR BUILD NASM ON WINDOWS WITH VISUAL STUDIO 2013 !!!!!!!!!!

Create a new project: Win32 Console (empty project)

Download nasm source from http://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D
Then put all content of zip file in subfolder {name_program} of your project (vs)

Come back to the IDE and add all *.c of nasm from root folder in Source FIles and *.h from root to Header Files, except: ndisasm.c

Create lib and output sub-folder in Source Files, then put *.c and *.h respectively in those folder
Create rdoff sub-folder too, then put *.h and not *.c in this file.

Compile, then you will see a lot of error: error C1083: Cannot open include file: 'compiler.h': No such file or directory, ect

After get this error, just adjust path of those missing headers, by modify with put it: "../{blabla}.h", and modifiy path like "output/outlib.h" by "outlib.h"
Be patient, you will get a lot of error like this.

Finish ! i hope for you too :p

Now you can optimize NASM by put compiler option, go to property pages, configuration manager, active solution platefrom.new.x64 then ok
After all depend of your compiler, if you keep the MS compiler, i don't know how to optimize with it, but if you have icl, continue to read.
So for optimize with icl:

Code: [Select]
   - C/C++:
   - General       = Multi-processor ...        Yes
   
   - Optimization  = Optimization               /O2
                     Favor Size or Speed        /Ot
                     Enable Fiber ...           /GT

   - Code Generati = Enable String ...        /GF
                     Enable C++ ...            No
                     Runtime library          /MT
                     Security Check           /GS-
                     Enable Enchanced ...     (High ISA available)
                     Floating Point ...       /fp

   - Optimization [intel C++] = Interprocedural ...        /Qipo
                                Optimize For ...           /GA
                                Parallelization             Yes
                                Use Intel opti ...          Yes

   - Diagnostics [intel C++]  = Vectorizer Diagnostics Level           /Qvec-report1
                                Optimization Diagnostics Level         Level 1
                        
                        
Enjoy it !
Title: Re: Tutorial for build nasm on Visual Studio 2013
Post by: agguro on February 19, 2016, 08:37:17 AM
that's a nice beginning. I succeed to port it to visual studio 2015 in one solution for nasm and ndisasm.  It gave problems with the two main procedures/functions but it is solved.
The entire solution is put on Github https://github.com/agguro/Nasm-project-vs
Title: Re: Tutorial for build nasm on Visual Studio 2013
Post by: shaynox on February 19, 2016, 08:49:44 AM
Thanks ^^

That's great and thanks for mentioning me in your GitHub ^^

And sorry, but I stopped programming since 8 months, but it's not definitive (I hope).