# Setting Up NASM and Linking on Linux

Assembly programming on Linux requires two key tools:

* **NASM (Netwide Assembler)** for compiling `.asm` source files.
    
* A **linker** (usually `ld` from `binutils` or `gcc` for simplicity) to produce executables.
    

Here’s how to set them up across various Linux distributions:

---

## 🐧 Ubuntu / Debian-based Systems

```apache
sudo apt update
sudo apt install binutils  # For installing the ld linker (Recommended)
sudo apt install nasm gcc  # gcc is also a linker
```

✔️ `nasm`: the assembler  
✔️ `gcc`: used as linker (you can use `ld` too: `sudo apt install binutils`)

## 🐧 Fedora

```apache
sudo dnf install nasm gcc
```

✔️ Fedora handles packages cleanly. `nasm` and `gcc` are available in the default repos.

## 🐧 Arch Linux / Manjaro

```apache
sudo pacman -S nasm gcc
```

✔️ Pacman keeps it lean and fast. Everything you need is in the official repositories.

## 🐧 openSUSE

```apache
sudo zypper install nasm gcc
```

✔️ Zypper delivers both NASM and the GNU toolchain out of the box.

## ✅ Verifying the Installation

Run:

```apache
nasm -v
gcc --version 
ld -v         # Recommended
```

You should see version info confirming successful installs.

## ✅ Recommended Editors

When writing NASM x64 code, choose a text editor that gets out of your way and lets you focus on the bytes:

1. **Nano (Recommended)** : Simple, no-nonsense, and pre-installed on most Linux systems. Great for beginners.
    
2. **Vim:** Comes pre-installed in all Linux distributions. Powerful, efficient, and universally available. Steep learning curve, but worth it if you’re serious.
    
3. **Micro:** A modern terminal-based editor that lies between Nano and Vim. One can use the following command in Ubuntu: *sudo apt install micro*
    
4. **Sasm:** A GUI based lightweight editor which is not pre-installed.
    

Writing your first “[Hello World](https://baremetal-bytes.hashnode.dev/hello-world-in-nasm-x64-explained-line-by-line)” in Nasm x64
