hello_x86_32.s 408 B

123456789101112131415161718192021222324
  1. .equ NR_write, 0x01
  2. .equ NR_exit, 0x3C
  3. .equ stdout, 1
  4. .globl _start
  5. /* Without those 0x40000000, it's not a true x86_32.
  6. It works nonetheless, despite being linked against
  7. ELF32 header. */
  8. _start:
  9. xor %eax, %eax
  10. mov $NR_write, %eax
  11. /*orl $0x40000000, %eax*/
  12. mov $stdout, %edi
  13. lea hello, %esi
  14. mov $length, %edx
  15. syscall
  16. xor %edi, %edi
  17. mov $NR_exit, %eax
  18. /*orl $0x40000000, %eax*/
  19. syscall