I have some asm code that I just want to compile. I have looked at some examples on stack and they always produce errors.
My code:
.data
hello:
.string "Hello World!\n"
.text
.globl main
main:
movl $4, %eax
movl $1, %ebx
movl $hello, %ecx
movl $13, %edx
int $0x80
movl $1, %eax
movl $0, %ebx
int $0x80
What I tried:
nasm -f elf hello.asm
Error produced:
hello.asm:1: warning: label alone on a line without a colon might be in error [-w+label-orphan]
hello.asm:3: error: parser: instruction expected
hello.asm:5: warning: label alone on a line without a colon might be in error [-w+label-orphan]
hello.asm:6: error: parser: instruction expected
hello.asm:8: error: parser: instruction expected
hello.asm:9: error: parser: instruction expected
hello.asm:10: error: parser: instruction expected
hello.asm:11: error: parser: instruction expected
hello.asm:12: error: expression syntax error
hello.asm:14: error: parser: instruction expected
hello.asm:15: error: parser: instruction expected
hello.asm:16: error: expression syntax error