elf32-body-exit-42.hex2 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ### GNU Mes --- Maxwell Equations of Software
  2. ### Copyright © 2017,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  3. ###
  4. ### This file is part of GNU Mes.
  5. ###
  6. ### GNU Mes is free software; you can redistribute it and/or modify it
  7. ### under the terms of the GNU General Public License as published by
  8. ### the Free Software Foundation; either version 3 of the License, or (at
  9. ### your option) any later version.
  10. ###
  11. ### GNU Mes is distributed in the hope that it will be useful, but
  12. ### WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ### GNU General Public License for more details.
  15. ###
  16. ### You should have received a copy of the GNU General Public License
  17. ### along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
  18. ### Commentary:
  19. # elf32-body-exit-42.hex2: `exit 42' for i686-linux written in hex2
  20. # assembly, for usage with generic elf32-header.hex2 and
  21. # elf32-footer-single-main.hex.
  22. # This ELF binary contains a symbol table, which means that objdump and
  23. # gdb can be used to inspect and debug.
  24. ### Code:
  25. # @200
  26. :ELF_text
  27. :_start
  28. e8 %main # call +11 <main>
  29. 00 00 00
  30. 00 00 00 00
  31. 00 00 00 00
  32. # @210
  33. :main
  34. bb 2a 00 00 00 # mov $42,%ebx
  35. b8 01 00 00 00 # mov $0x1,%eax
  36. cd 80 # int $0x80
  37. f4 # hlt
  38. 00 00 00 # align
  39. # @220
  40. :ELF_data
  41. 65 78 69 74 34 32 20 64 61 74 61 20 68 65 72 65 # exit42 data here"
  42. 00