/l/linux-x86.nasm

http://github.com/AdamHarte/hello-world · Unknown · 18 lines · 15 code · 3 blank · 0 comment · 0 complexity · 44a96f6963b4b28b66a48f83082a6ca6 MD5 · raw file

  1. # nasm linux-x86.nasm -o linux-x86.o -f elf && ld linux-x86.o -m elf_i386 -o linux-x86
  2. section .data
  3. msg db "Hello World", 0xa
  4. len equ $ - msg
  5. section .text
  6. global _start
  7. _start:
  8. mov eax, 4
  9. mov ebx, 1
  10. mov ecx, msg
  11. mov edx, len
  12. int 0x80
  13. mov eax, 1
  14. mov ebx, 0
  15. int 0x80