Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
97 views

and Install NASM and Write and Test Assembly Program in Visual Studio

The document provides steps to install NASM and write and test assembly programs in Windows using Visual Studio Code. It details installing the Windows Subsystem for Linux, installing NASM in Ubuntu, and using Visual Studio Code to write a Hello World assembly program and run it.

Uploaded by

Prasad Chavan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views

and Install NASM and Write and Test Assembly Program in Visual Studio

The document provides steps to install NASM and write and test assembly programs in Windows using Visual Studio Code. It details installing the Windows Subsystem for Linux, installing NASM in Ubuntu, and using Visual Studio Code to write a Hello World assembly program and run it.

Uploaded by

Prasad Chavan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Download and Install NASM and Write and Test Assembly

Program in Windows by using Visual Studio IDE


1. Linux On Windows Sub System Steps:
Step1- Open Control Panel

Step 2- Click on Category -> Large Icons


Step 3- Click on Programs and Features

Step 4- Click on Turn Windows Features on or off


Step 5 - Tick on Hyper-V and Windows Subsystem for Linux

3
Step 6 - Windows ask for restart allow it and wait for update

Step 7 – Open PowerShell as Administrator (Start menu > PowerShell > right-click > Run as Administrator) and enter
this command:

Wsl 1 : dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Wsal 2 : dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

2
Step 8 – Restart Windows
Step 9 – Download the Linux kernel update package
Download the latest package:

Link - https://learn.microsoft.com/en-us/windows/wsl/install-manual

Step 10 – Open wsl_update_x64 and Install at default settings.


Step 11 – Open Microsoft Store and Download ‘Ubuntu’ and Open.

Step 12 – It’s Take a Time for sign in


Enter the UNIX username and Password

*Note Password is Invisible


1
2

Windows Subsystem Installation Is Done

2. Install NASM in Ubuntu Terminal:


Step 1 – Open a Linux Terminal:
1. Type where is nasm and press ENTER.
If it is already installed, then a line like, nasm: /usr/bin/nasm appears.
Otherwise, you will see just nasm: , then you need to install NASM.

Step 2 – Command for install NASM on Ubuntu Terminal:


Step 1: Update system:

sudo apt-get update

Step 2: Install: nasm

Ater updaing the OS run following command to install the packae:

sudo apt-get install nasm


1
1

NASM Installation Is Down


3. Write and Test Assembly Program in Windows by using Visual
Studio IDE:
Step 1 – Open a Visual Studio Code:

Step 2 –Click on Extensions


Step 3 – Install give Extensions:

1. NASM Language Support

2. Shellcode Studio

3. GNU Assembler Language Support


4. Code Runner
Step 4 –
1. Click on Manage -> Extensions Settings.

2
2. Click on Code-runner: Executor Map By File Extension
Edit in settings.json

3. Past the give Command:

"nasm":"cd $dir && bash",


4. Press Ctrl + S For Saved the settings of settings.json file :
Closed Visual Studio Code and Open once again.

5. Creat a New Text File and Saved the file with .asm Extension:

6. Copy the give code and Paste in Test.asm test file and Save ( Ctrl+ S ) :

global _start

section .text

_start:
mov rax, 1 ; write(
mov rdi, 1 ; STDOUT_FILENO,
mov rsi, msg ; "Hello, world!\n",
mov rdx, msglen ; sizeof("Hello, world!\n")
syscall ; );

mov rax, 60 ; exit(


mov rdi, 0 ; EXIT_SUCCESS
syscall ; );

section .rodata
msg: db "Hello, world!", 10
msglen: equ $ - msg
7. For Right Click and click on Run code Wait for some time Ubuntu Terminal is Open:
8. Paste The given Command :

nasm -f win64 Test.asm -o Test.o

ld Test.o -o Test

./Test

1
2
OutPut 3

If Any Problem Send me E-mail: 335ishwar@gmail.com

Linkedin: https://www.linkedin.com/in/ishwar-sonawane-298025260

You might also like