binary file execution error (Assembly - linux)

Viewed 16

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?

0 Answers
Related