0

I tried it so many time, but while executing the assembly language code on terminal through nasm to make an executable file, then I stuck here, any one can help me to get out of this problem..

i tried these command line to execute it.

nasm -f elf helloworld.asm

to make run the file then i want to make an object file to execute it so I used this command

id -s -o helloworld helloworld.o

but the second command is not running because there are no command options such as -s or -o.

Please help me and follow the image thanks

enter image description here

zx485
  • 28,498
  • 28
  • 50
  • 59
  • 5
    The linker is `ld` (lower case L), not `id`. – Peter Cordes Sep 16 '16 at 20:57
  • See also [this answer](http://stackoverflow.com/questions/36861903/assembling-32-bit-binaries-on-a-64-bit-system-gnu-toolchain/36901649#36901649) for more info about building 32 or 64-bit binaries that define `_start` or `main`, with / without the standard library. Also http://stackoverflow.com/tags/x86/info – Peter Cordes Sep 16 '16 at 21:00
  • 1
    Also, your question title is wrong. You haven't executed any code you wrote in asm yet. You're running into trouble while *building* it. The difference between compiler / assembler errors and run-time errors is important if you're going to ask future questions. – Peter Cordes Sep 16 '16 at 21:05
  • stiil I am getting this error ld: i386 architecture of input file 'helloworld.o' is incompatible with i386.x86-64boutput – Ravi Shankar Ladhar Sep 19 '16 at 16:21
  • Your 64-bit Linux tools default to building 64-bit binaries, but you told NASM to assemble a 32-bit object file. See http://stackoverflow.com/questions/36861903/assembling-32-bit-binaries-on-a-64-bit-system-gnu-toolchain/36901649#36901649. That's from [the x86 tag wiki's FAQ section](http://stackoverflow.com/tags/x86/info) – Peter Cordes Sep 19 '16 at 16:31

0 Answers0