2

My main operating system Windows. I installed Ubuntu as windows subsystem. I am using nasm.

Assembly Code:


section .text
      global _start

_start:
      move eax,1
      move ebx,0
      int 0x80

I compiled it like this

----> nasm -f elf FILENAME.asm
----> ls

FILENAME.asm    FILENAME.o

---> ld -m elf_i386 FILENAME.o -o OUTFILE
---> ls

FILENAME.asm   FILENAME.o   OUTFILE

When I run OUTFILE, I get an error like this:

-bash: ./OUTFILE: cannot execute binary file: Exec format error

Can you help me?

  • WSL cannot execute 32 bit programs. either use real Ubuntu or switch to amd64 assembly. – fuz May 25 '21 at 16:23

0 Answers0