hello.hex2 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ## Copyright (C) 2017 Jeremiah Orians
  2. ## This file is part of stage0.
  3. ##
  4. ## stage0 is free software: you can redistribute it and/or modify
  5. ## it under the terms of the GNU General Public License as published by
  6. ## the Free Software Foundation, either version 3 of the License, or
  7. ## (at your option) any later version.
  8. ##
  9. ## stage0 is distributed in the hope that it will be useful,
  10. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ## GNU General Public License for more details.
  13. ##
  14. ## You should have received a copy of the GNU General Public License
  15. ## along with stage0. If not, see <http://www.gnu.org/licenses/>.
  16. ## stage0's hex2 format for x86
  17. ## !<label> 1 byte relative
  18. ## $<label> 2 byte address
  19. ## @<label> 2 byte relative
  20. ## %<label> 4 byte relative
  21. ## &<label> 4 byte address
  22. ## label_<label> function-local
  23. ## string_<count> string
  24. ##
  25. #.text
  26. :main
  27. 55 89 e5 83 ec 40
  28. # eputs("Hello, Mescc!\n");
  29. 68 &string_0
  30. e8 %eputs 83 c4 04
  31. 85 c0
  32. b8 2a 00 00 00
  33. c9 c3
  34. #.data
  35. :g_environment
  36. 00 00 00 00
  37. :g_stdin
  38. 00 00 00 00
  39. :g_stdout
  40. 00 00 00 00
  41. :string_0
  42. 48 65 6c 6c 6f 2c 20 4d 65 73 63 63 21 0a 00
  43. :ELF_end