Download and install assembler and setup assembly environment

Prahlad Godara ------ From DOOSEEP

To learn assembly language and know how it works, first of all there is a need to set up the environment. Just like you need to have a device to do programming - a laptop, or any equivalent compatible device, and a Linux or Windows operating system, you will need an assembler software.


Set up Assembly Environment

We need a good assembler to write assembly code, convert it to machine language and track the run time of the code, etc. There are many good assembler programs, such as - NASM Assembler, Microsoft Assembler (MASM), Borland Turbo Assembler (TASM) ), GNU Assembler (GAS), EMU8086, etc.


We will be using NASM assembler to learn assembly language as you can download it for free from various web sources. Well documented and you'll find a lot of info on the net. It can be used on both Linux and Windows to write 16-bit, 32-bit and 64-bit programs.


Installing NASM

If you're a Linux user, NASM may come pre-installed on your operating system and you don't need to download and install it separately. To check if you already have NASM installed, follow these steps -

  1. Open a Linux terminal.
  2. Type whereis nasm and press ENTER.

If it's already installed, a line like nasm: /usr/bin/nasm appears. Otherwise you'll just see nasm: , then you'll need to install NASM.

How to Install NASM on Linux

To install NASM on Linux, follow these steps −

  1. See the Netwide Assembler (NASM) website for the latest version.
  2. Download the Linux source archive nasm-X.XX.ta.gz , where X.XX is the NASM version number in the archive.
  3. Unpack the archive into a directory which creates a subdirectory nasm-X. XX.
  4. cd to nasm-X.XX and type ./configure. This shell script will find the best C compiler to use and set up Makefiles accordingly.
  5. Type make to build the nasm and ndisasm binaries.
  6. Type make install to install nasm and ndisasm in /usr/local/bin and to install the man pages.

This should install NASM on your system. Alternatively, you can use an RPM distribution for the Fedora Linux. This version is simpler to install, just double-click the RPM file.

How to Install NASM on Windows.

If you want to edit and execute assembly language programs with nasm on Windows, you need to install NASM on Windows using DOSBox.

Follow these steps to install NASM on Windows

  1. download NASM and DOSBOX
  2. Install DOXSBOX
  3. Extract NASM in a Folder
  4. Run DoxBox
  5. Mount NASM folder to a Drive using “ mount [driveletter] [NASM Path]

For example we have extracted NASM on F:\Assebmly then here is command to mount it to X Drive

---> mount X f:\assembly 
Type x:
x:\>

Tags- best assembler, How to install NASM in windows, Is NASM only for Linux? Installing NASM under MS-DOS or Windows , nasm windows tutorial, Set up your NASM Environment, Assembly - Environment Setup,How do you install the assembly language, How to use Nasm assembler on Windows