crt1.M1 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ### GNU Mes --- Maxwell Equations of Software
  2. ### Copyright © 2017,2018,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. :_start
  19. push___%ebp
  20. mov____%esp,%ebp
  21. sub____$i32,%esp %0x1054
  22. mov____$i8,%eax !0
  23. mov____%eax,0x32 &GLOBAL___stdin
  24. mov____$i8,%eax !1
  25. mov____%eax,0x32 &GLOBAL___stdout
  26. mov____$i8,%eax !2
  27. mov____%eax,0x32 &GLOBAL___stderr
  28. mov____%ebp,%eax
  29. add____$i8,%eax !4
  30. movzbl_(%eax),%eax
  31. add____$i8,%eax !3
  32. shl____$i8,%eax !0x02
  33. add____%ebp,%eax
  34. mov____%eax,0x32 &GLOBAL_environ
  35. mov____%esp,%edi ; M2-Planet calling convention pushes forward
  36. mov____%ebp,%eax ; argc
  37. add____$i8,%eax !4
  38. movzbl_(%eax),%eax
  39. push___%eax
  40. mov____%ebp,%eax ; argv
  41. add____$i8,%eax !8
  42. push___%eax
  43. mov____0x32,%eax &GLOBAL_environ
  44. push___%eax
  45. mov____%edi,%ebp ; M2-Planet calling convention
  46. call32 %FUNCTION_main
  47. add____$i8,%esp !0x0
  48. test___%eax,%eax
  49. mov____%eax,%ebx
  50. mov____$i32,%eax %1
  51. int____$0x80
  52. hlt
  53. leave
  54. ret