NASM-X

Next Chapter | Contents | Index

Chapter 1: Introduction

1.1 What Is NASM-X?

NASM-X is a set of macros for the Netwide Assembler, NASM, designed for portability, modularity, ease of use, and speed of development. Portability means that the complete macro-set can be used for both 32 and 64 bit assembly with no change in syntax. Modularity implies NASM-X fully supports projects having multiple source files along with external linkage. Ease of use and speed of development are featured benefits of using NASM-X as the macros correctly handle all supported calling conventions, ensure proper stack alignment, and ensure proper structure layout and memory alignment.

NASM-X currently supports both 32 and 64-bit development on the following operating systems:

1.2 License Conditions

Please see the file LICENSE, supplied as part of any NASM-X distribution archive, for the license conditions under which you may use NASM-X. NASM-X is now under the so-called 2-clause BSD license, also known as the simplified BSD license.

Copyright 2005-2014 the NASM-X Authors - All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

1.3 Contact Information

The current version of NASM-X is maintained by a team of developers, accessible through the nasmx-devel mailing list (see below for the link).

NASM-X forums are currently located at http://www.nasm.us/. If it's not there, google for us!

New releases, release candidates, and daily development snapshots of NASM-X are available from http://www.sourceforge.net/.

1.4 Installation

1.4.1 Installing NASM-X under Windows

Once you've obtained the appropriate archive for NASM-X, nasmx-X.X.zip (where X.X denotes the version number of NASM-X contained in the archive), unpack it into its own directory (for example c:\nasmx).

The archive will contain a set of executable files: the NASM executable file nasm.exe, the NDISASM executable file ndisasm.exe, and additional utilities.

The files NASM-X needs to run are located in the nasm-X.X/bin directory. You may either copy these programs to a directory on your PATH, or alternatively, edit autoexec.bat to add the nasmx/bin directory to your PATH (to do that under Windows XP, go to Start > Control Panel > System > Advanced > Environment Variables; these instructions may work under other versions of Windows as well.)

You must also set the NASMENV environment variable to point to the install include directory, eg: NASMENV=-IC:\nasmx\nasmx-X.X\inc\

That's it - NASM-X is installed.

1.4.2 Installing NASM-X under Unix

Once you've obtained the Unix source archive for NASM-X, nasmx-X.X.tar.gz (where X.X denotes the version number of NASM-X contained in the archive), unpack it into a directory such as /usr/local/src. The archive, when unpacked, will create its own subdirectory nasmx-X.X.

NASM-X is not an auto-configuring package: once you've unpacked it, cd to the directory it's been unpacked into and type ./setpaths.sh. This shell script will set up your environment so that you can use NASM-X. So that you don't have to source this file each time you open a new terminal you can simply add the NASMENV environment variable to your login profile. For example, when using the bash shell, add the line export NASMENV=-I/usr/local/src/nasmx-X.X/inc/ to your .bashrc file located in your home directory.

The NASM-X package for Linux does not come with any binaries. The demo programs require that the following programs already exist on your computer: nasm, gcc, make.

Next Chapter | Contents | Index