trivial.S 902 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. .text
  2. .align 4
  3. .globl _start
  4. _start:
  5. #if 0
  6. pushl %ebp
  7. movl %esp,%ebp
  8. pushl %ebx # save ebx
  9. movl 12(%ebp),%eax # eax <- systab
  10. movl 24(%eax),%ebx # ebx <- systab->FirmwareVendor
  11. pushl %ebx
  12. movl 44(%eax),%ebx # ebx <- systab->ConOut
  13. pushl %ebx
  14. movl 4(%ebx),%eax # eax <- conout->OutputString
  15. call *%eax
  16. movl -4(%ebp),%ebx # restore ebx
  17. leave
  18. ret
  19. #else
  20. pushl %ebp
  21. movl %esp,%ebp
  22. pushl %ebx
  23. call 0f
  24. 0: popl %eax
  25. addl $hello-0b,%eax
  26. pushl %eax
  27. movl 12(%ebp),%eax # eax <- systab
  28. movl 44(%eax),%ebx # ebx <- systab->ConOut
  29. pushl %ebx
  30. movl 4(%ebx),%eax # eax <- conout->OutputString
  31. call *%eax
  32. movl -4(%ebp),%ebx
  33. leave
  34. ret
  35. .section .rodata
  36. .align 2
  37. hello: .byte 'h',0,'e',0,'l',0,'l',0,'o',0,'\n',0,'\r',0,0,0
  38. #endif