Discovery Zone: Keeping Knowledge Free!
Search:
Keywords:
In Association with Amazon.com
Another great reference
cover
Assembly Language Programs and Organizations of the IBM PC

ASSEMBLY PROGRAMMING AND OS DESIGN


1. Useful Trivia
1.1 The Compiler
1.2 History

<HOME>

 

 

Another great reference
cover 80X86 IBM PC and Compatible Computers: Assembly Language, Design and Interfacing Vol. I and II

 

CH1.1 The Compiler

<HOME><TOC><PREV><UP><NEXT>

The compiler you will be using for this text is known as the Network-wide Assembler or NASM.  There are two reasons this compiler will be used.  #1 It's free, just like this site.  #2 It doesn't depend on odd extensions to the format of an assembly program to get it to compile.  Don't get me wrong.  MASM (Microsoft Assembler) and TASM (Borland's Turbo Assembler) are both good compilers, but their varying code structures and proprietary representations of addressing modes is just too confusing for a beginning programmer.  NASM uses the good old plain format that has been in use for decades which not only makes it consistent, but easy to read.

The first step to getting NASM up and running is to download it from their homepage.  All the links and instructions presented here are for the windows version of the compiler.  If there is a sufficient demand, I will place instructions for other Operating Systems.  But by and large, if you're running something other than windows, you probably already know how to download and install software on it.

NASM Home Page

Download Win32 NASM

Location Size Link
Discovery Zone 164,052 nasm-0.98-win32.zip
US Kernel.org 164,052 nasm-0.98-win32.zip

Click on the nasm-0.98-win32.zip link and select the save this file to disk option.  When the dialog pops up, click on the drop down box next to 'save in' and select the C: drive.  Next click on the button that looks like a folder with a spark on it's upper left corner.  This will create a new directory.  Name the directory dev.  Now double click on dev and it should appear as the current directory in the drop down box.  Repeat the directory creation process and name the next directory nasm.  Double click on nasm and then click the Save button.

Now that you actually have nasm, let's get it installed.  Double click on the My Computer icon on your desktop, then on C: then on devel and finally on nasm.  You should now see the nasm-0.98-win32.zip file.  Double click on it and when WinZip is open, click on the extract button.  Make sure the extract path is set to c:\devel\nasm and click ok.  Now, close all the folder windows you just opened.  Click on the start button and select Run.  In the dialog, type 'edit c:\autoexec.bat' with no quotes and press enter.  When the window pops up, go to the last line of your autoexec.bat and add the following line.

path c:\devel\nasm;%path%

Now press Alt-F and select Exit and answer Yes to the prompt about saving the file.

You now have NASM installed and ready to work on your machine.  NASM is a command line based program.  This means that it must be run from the DOS prompt.  You should be able to find DOS Prompt in your start menu.  I recommend creating a projects directory in the devel directory, but at this point, your programs will compile regardless of where you put them.

To compile an assembly file using NASM simply type:

nasmw -o outputfileneame asmfile.asm

<HOME><TOC><PREV><UP><NEXT>
 

www.cynergysoft.com

Email any questions to the author, Nathan Daniels.

Copyright © 2001 - 2004