Yodalee’s Note

My lifes, My notes

Compiling NASM Assembly Language on a 64-bit OS

Recently, the author has been studying nasm, an assembly implementation, since operating systems have upgraded to 64 bits. Compiling asm code requires some additional handling steps. Here are the steps I’ve recorded, using ArchLinux, though I imagine other operating systems shouldn’t differ much.

Firstly, the author provides asm_io.asm, which needs to be compiled first. Install the nasm assembler from the author:

sudo pacman -S nasm

Assembly:

nasm -f elf -d ELF_TYPE asm_io.asm
nasm -f elf first.asm

Here, “first” is the asm code we wrote ourselves.

...