Author Topic: New to Win32 NASM  (Read 2371 times)


  • Guest
New to Win32 NASM
« on: July 21, 2008, 01:50:14 AM »

I am learning PC Assembly and a tutorial I was reading recommended NASM assembler and DJGPP C/C++ compiler.
However, I do not know what to do with the NASM files I downloaded off this site (where to place them).

All help is appreciated. Sorry for being newbie :)


  • Guest
Re: New to Win32 NASM
« Reply #1 on: July 21, 2008, 07:43:02 AM »
Sorry? Learning stuff is "fun" (if some institution doesn't suck all the joy out of it)! You've got a ton of fun ahead of you!

So... where are you at now? Got djgpp up and running? If so, you've figured out how to set environment variables - "PATH" and "djgpp". If not, you'll need to figure out how to do it for your OS. Last Windows I ran was '98, and you'd just edit "autoexec.bat". For XP... involves right clicking on the icon for your command prompt, right clicking again on the "shortcut"(???), "properties", "advanced", "environment". ??? Something like that...

Unzip the file you got here... "" I suppose. That'll unzip into "nasm-2.03.01\" (or "nasm-2~1\" as a short name). You'll see an "rdoff\" subdirectory under that, "COPYING", "README", cwsdpmi.doc and .exe (this is the dos extender that allows 32-bit Nasm to run under dos. If you put the .exe on the "PATH", you probably don't need to read the .doc), nasm.exe, and ndisasm.exe - these need to go on your "PATH"! - and nasmdoc.txt. Easiest thing is to just add ";C:\nasm-2.03.01" to you "PATH" environment variable. (or "C:\FOO\BAR\nasm-2.03.01" if that's where you unzipped it, obviously)

[Windows likes to put everything in "Program Files". File/directory names with a space in 'em are "valid"  these days, but they can be a PITA. Sooner or later you'll see an error message "Can't open 'Program'". Referring to the short name "Progra~1" may help. Best to avoid spaces in filenames, if you're going to be using command line tools, IMO!]

While you remember how to set environment variables, you might want to set the "NASMENV" variable. "set NASMENV=-dCOFF_TYPE", perhaps (if I'm guessing the tutorial you've got) - save typing it on the command line every time. Can be handy to set an "-I" search path for include files, too...

If you want that "rdoff" stuff, put that directory on the "PATH", too. A fairly "exotic" output format - you probably don't need it. All Nasm *needs* is to be on the "PATH".

If it *is* Dr. Carter's tut you're using, you'll need to build "asm_io.o", first thing. Command line for Nasm is in "asm_io.asm". Then you should be ready for "first.asm" - again, instructions are in the file.

If it *doesn't* work, what *does* happen? Read the error messages (if any) carefully. Sometimes the presence/absence of an '_', for example, can give you a clue what's gone wrong. If not, post 'em here. :)