Quantcast
Viewing all articles
Browse latest Browse all 2810

Can I install nasm and run .asm codes on Windows Subsystem Linux(WSL) for Ubuntu terminal on windows?

I've been avoiding to dual boot my new Laptop to use Ubuntu yet, and I've got some assembly codes to be run in the nasm. I recently stumbled upon this Ubuntu terminal for Windows, so my question is: can I install the nasm package and run .asm codes in this terminal?

Edit: The .asm code is being compiled (I wrote the "Hello World" code as a test) with the following steps:

  1. nasm -f elf64 filename.asm
  2. ld -o filename filename.o
  3. ./filename

There is no output on the terminal, as it should display Hello World.

Here's the code for reference:

section .data

msg db "Hello World"
msglen equ $-msg

section .text
global _start
_start:

 mov rax,1
 mov rdi,1
 mov rsi,msg
 mov rdx,msglen

mov rax,60
mov rdx,0
syscall

Viewing all articles
Browse latest Browse all 2810

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>