Author Topic: Tutorial for build nasm on Visual Studio 2013  (Read 14220 times)

Offline shaynox

  • Full Member
  • **
  • Posts: 118
  • Country: gr
Tutorial for build nasm on Visual Studio 2013
« 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 !
« Last Edit: March 02, 2015, 03:06:03 AM by shaynox »

Offline agguro

  • Jr. Member
  • *
  • Posts: 4
Re: Tutorial for build nasm on Visual Studio 2013
« Reply #1 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

Offline shaynox

  • Full Member
  • **
  • Posts: 118
  • Country: gr
Re: Tutorial for build nasm on Visual Studio 2013
« Reply #2 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).
« Last Edit: February 19, 2016, 08:59:02 AM by shaynox »