0% found this document useful (0 votes)
5 views

T3 NASM Installation Guide Windows

This document provides a step-by-step guide for installing NASM on Windows using the Windows Subsystem for Linux (WSL). It covers enabling WSL, installing a Linux distribution, updating the system, installing NASM, and compiling and running assembly code. The guide includes specific commands and instructions for each step to ensure a successful installation and usage of NASM.

Uploaded by

poudeltilak999
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

T3 NASM Installation Guide Windows

This document provides a step-by-step guide for installing NASM on Windows using the Windows Subsystem for Linux (WSL). It covers enabling WSL, installing a Linux distribution, updating the system, installing NASM, and compiling and running assembly code. The guide includes specific commands and instructions for each step to ensure a successful installation and usage of NASM.

Uploaded by

poudeltilak999
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Step-by-Step Guide to Installing NASM

on Windows
Step 1: Enable WSL on Windows
1. Open PowerShell as Administrator:
- To start, right-click on the Start button on your desktop.
- From the context menu that appears, choose 'Windows PowerShell (Admin)' or
'Command Prompt (Admin)'.
- This will open a PowerShell window with administrative privileges.

2. Enable WSL:
- In the PowerShell window, type the following command to enable the Windows
Subsystem for Linux (WSL) feature:
```bash
wsl --install

OR
wsl --install -d kali

OR

wsl --install -d ubuntu

OR

wsl --install -d Debian

```
- This command installs WSL and sets up the default Linux distribution on your machine.
- WSL allows you to run Linux distributions natively on your Windows machine without
needing a virtual machine.

3. Restart Your Computer:


- After the WSL installation completes, you'll be prompted to restart your computer.
- Save any open work and click on 'Restart Now'. This ensures that the WSL installation is
fully integrated into your system.

Step 2: Install a Linux Distribution


1. Choose a Linux Distribution:
- After your computer restarts, WSL will automatically install a default Linux distribution,
usually Ubuntu.
- If you prefer a different distribution, you can choose one from the Microsoft Store.
Popular alternatives include Debian, Kali Linux, and Fedora.

2. Download a Linux Distribution:


- Open the Microsoft Store from the Start menu.
- In the search bar, type 'Linux' and press Enter.
- A list of available Linux distributions will appear. Select the one you want to install and
click 'Install'.
- Wait for the installation to complete. This may take a few minutes depending on your
internet speed.

3. Launch the Linux Distribution:


- Once the installation is complete, launch the Linux distribution from the Start menu.
- On first launch, you will be prompted to set up a new user account and password for
your Linux environment.
- Follow the on-screen instructions to complete the setup.

Step 3: Update the Linux Distribution


1. Update Package Lists:
- Keeping your system updated is crucial for stability and security. Start by updating the
package lists on your Linux system.
- Open your Linux terminal and type the following command:
```bash
sudo apt update
```
- This command fetches the latest package lists from the repositories, ensuring you have
the latest information on available packages.

2. Upgrade Installed Packages:


- Next, upgrade the installed packages to their latest versions by running the following
command:
```bash
sudo apt upgrade -y
```
- This command updates all the installed packages to their newest versions. The `-y` flag
automatically confirms the upgrade, so you don't have to manually approve each update.

Step 4: Install NASM on WSL-Based Linux


1. Install NASM:
- Now that your Linux environment is set up and updated, you can install NASM, the
Netwide Assembler, which is used to assemble and link assembly code.
- In your Linux terminal, type the following command:
```bash
sudo apt install nasm -y
```
- This command downloads and installs NASM on your system. The `-y` flag confirms the
installation automatically.

2. Verify NASM Installation:


- After the installation is complete, it's a good idea to verify that NASM is installed
correctly.
- Check the version of NASM by typing:
```bash
nasm -v
```
- You should see output indicating the installed NASM version, confirming that the
installation was successful.

After this move to the NANO file and Linux file.

Step 5: Start Using NASM


1. Create an Assembly File:
- You can now start writing assembly programs using NASM. Begin by creating a new
assembly file.
- In your Linux terminal, type the following command to open the `nano` text editor and
create a file named `hello.asm`:
```bash
nano hello.asm
```
- In the `nano` editor, you can write your assembly code. After writing, save the file and
exit the editor.

2. Compile the Assembly Code:


- Once you have written your assembly code, you need to compile it using NASM.
- In your terminal, type the following command to compile the code into an object file:
```bash
nasm -f elf64 -o hello.o hello.asm
```
- This command tells NASM to create a 64-bit object file (`elf64`) from the assembly source
file (`hello.asm`).

3. Link the Object File:


- After compiling, you need to link the object file to create an executable.
- In your terminal, type the following command to link the object file:
```bash
ld -o hello hello.o
```
- This command links the object file (`hello.o`) and creates an executable named `hello`.

4. Run the Executable:


- Finally, you can run the compiled program by typing the following command:
```bash
./hello
```
- If your assembly code was correct, the program will execute, and you'll see the output of
your code (e.g., 'Hello, World!' on the terminal).

You might also like