x86.M1 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. ### Mes --- Maxwell Equations of Software
  2. ### Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
  3. ###
  4. ### This file is part of Mes.
  5. ###
  6. ### 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. ### 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 Mes. If not, see <http://www.gnu.org/licenses/>.
  18. DEFINE add____$i32,%eax 05
  19. DEFINE add____$i32,%ecx 81c1
  20. DEFINE add____$i32,%edx 81c2
  21. DEFINE add____$i32,(%eax) 8100
  22. DEFINE add____$i32,0x32(%eax) 8180
  23. DEFINE add____$i32,0x32(%ebp) 8185
  24. DEFINE add____$i8,%eax 83c0
  25. DEFINE add____$i8,%edx 83c2
  26. DEFINE add____$i8,%esp 83c4
  27. DEFINE add____$i8,(%eax) 8300
  28. DEFINE add____$i8,0x32 8305
  29. DEFINE add____$i8,0x32(%eax) 8380
  30. DEFINE add____$i8,0x32(%ebp) 8385
  31. DEFINE add____$i8,0x8(%eax) 8340
  32. DEFINE add____$i8,0x8(%ebp) 8345
  33. DEFINE add____%eax,%eax 01c0
  34. DEFINE add____%ebp,%eax 01e8
  35. DEFINE add____%edx,%eax 01d0
  36. DEFINE and____%edx,%eax 21d0
  37. DEFINE call32 e8
  38. DEFINE call___*%eax ffd0
  39. DEFINE cmp____$0x32,%eax 3d
  40. DEFINE cmp____$i32,%eax 3d
  41. DEFINE cmp____$i32,0x32(%ebp) 81bd
  42. DEFINE cmp____$i32,0x8(%ebp) 817d
  43. DEFINE cmp____$i8,%eax 83f8
  44. DEFINE cmp____$i8,0x32(%ebp) 83bd
  45. DEFINE cmp____$i8,0x8(%ebp) 837d
  46. DEFINE cmp____%al,%dl 38c2
  47. DEFINE cmp____%edx,%eax 39d0
  48. DEFINE hlt f4
  49. DEFINE idiv___%ebx f7fb
  50. DEFINE int cd
  51. DEFINE int____$0x80 cd80
  52. DEFINE je32 0f84
  53. DEFINE je8 74
  54. DEFINE jg32 0f8f
  55. DEFINE jge32 0f8d
  56. DEFINE jl32 0f8c
  57. DEFINE jle32 0f8e
  58. DEFINE jmp32 e9
  59. DEFINE jmp____*%ebx ffe3
  60. DEFINE jne32 0f85
  61. DEFINE lahf 9f
  62. DEFINE lea____0x32(%ebp),%eax 8d85
  63. DEFINE lea____0x32(%ebp),%edx 8d95
  64. DEFINE lea____0x8(%ebp),%eax 8d45
  65. DEFINE lea____0x8(%ebp),%edx 8d55
  66. DEFINE leave c9
  67. DEFINE mov____$i32,%eax b8
  68. DEFINE mov____$i32,%ebx bb
  69. DEFINE mov____$i32,%ecx b9
  70. DEFINE mov____$i32,%edx ba
  71. DEFINE mov____$i32,(%eax) c700
  72. DEFINE mov____$i32,0x32 c705
  73. DEFINE mov____$i32,0x8(%eax) c740
  74. DEFINE mov____$i32,0x8(%ebp) c745
  75. DEFINE mov____%al,(%edx) 8802
  76. DEFINE mov____%al,0x32(%ebp) 8885
  77. DEFINE mov____%al,0x8(%ebp) 8845
  78. DEFINE mov____%al,0x8(%edx) 8842
  79. DEFINE mov____%ax,(%edx) 668902
  80. DEFINE mov____%ax,0x32(%ebp) 668985
  81. DEFINE mov____%ax,0x32(%edx) 668982
  82. DEFINE mov____%ax,0x8(%ebp) 668945
  83. DEFINE mov____%ax,0x8(%edx) 668942
  84. DEFINE mov____%dl,(%eax) 8810
  85. DEFINE mov____%dl,0x8(%eax) 8850
  86. DEFINE mov____%eax,%ebx 89c3
  87. DEFINE mov____%eax,%edx 89c2
  88. DEFINE mov____%eax,(%ecx) 8901
  89. DEFINE mov____%eax,(%edx) 8902
  90. DEFINE mov____%eax,0x32 a3
  91. DEFINE mov____%eax,0x32(%ebp) 8985
  92. DEFINE mov____%eax,0x32(%edx) 8982
  93. DEFINE mov____%eax,0x8(%ebp) 8945
  94. DEFINE mov____%eax,0x8(%edx) 8942
  95. DEFINE mov____%ebp,%eax 89e8
  96. DEFINE mov____%ebp,%ecx 89e9
  97. DEFINE mov____%ebp,%edx 89ea
  98. DEFINE mov____%ebx,0x32 891d
  99. DEFINE mov____%ebx,0x32(%ebp) 899d
  100. DEFINE mov____%ebx,0x8(%ebp) 895d
  101. DEFINE mov____%ebx,0x8(%edx) 895a
  102. DEFINE mov____%ecx,(%eax) 8908
  103. DEFINE mov____%ecx,(%edx) 890a
  104. DEFINE mov____%ecx,0x32(%ebp) 898d
  105. DEFINE mov____%ecx,0x8(%ebp) 894d
  106. DEFINE mov____%edx,%eax 89d0
  107. DEFINE mov____%edx,%ebx 89d3
  108. DEFINE mov____%edx,%ecx 89d1
  109. DEFINE mov____%edx,(%eax) 8910
  110. DEFINE mov____%edx,0x32(%ebp) 8995
  111. DEFINE mov____%edx,0x8(%ebp) 8955
  112. DEFINE mov____%esp,%ebp 89e5
  113. DEFINE mov____(%eax),%eax 8b00
  114. DEFINE mov____(%eax),%ecx 8b08
  115. DEFINE mov____(%edx),%ecx 8b0a
  116. DEFINE mov____(%edx),%edx 8b12
  117. DEFINE mov____0x32(%eax),%eax 8b80
  118. DEFINE mov____0x32(%eax),%ebx 8b98
  119. DEFINE mov____0x32(%eax),%ecx 8b88
  120. DEFINE mov____0x32(%ebp),%eax 8b85
  121. DEFINE mov____0x32(%ebp),%ebx 8b9d
  122. DEFINE mov____0x32(%ebp),%ecx 8b8d
  123. DEFINE mov____0x32(%ebp),%edx 8b95
  124. DEFINE mov____0x32,%eax a1
  125. DEFINE mov____0x32,%edx 8b15
  126. DEFINE mov____0x8(%eax),%eax 8b40
  127. DEFINE mov____0x8(%eax),%ebx 8b58
  128. DEFINE mov____0x8(%eax),%ecx 8b48
  129. DEFINE mov____0x8(%ebp),%eax 8b45
  130. DEFINE mov____0x8(%ebp),%ebp 8b6d
  131. DEFINE mov____0x8(%ebp),%ebx 8b5d
  132. DEFINE mov____0x8(%ebp),%ecx 8b4d
  133. DEFINE mov____0x8(%ebp),%edx 8b55
  134. DEFINE mov____0x8(%ebp),%esp 8b65
  135. DEFINE movzbl_%al,%eax 0fb6c0
  136. DEFINE movzbl_%dl,%edx 0fb6d2
  137. DEFINE movzbl_(%eax),%eax 0fb600
  138. DEFINE movzbl_(%eax),%edx 0fb610
  139. DEFINE movzbl_(%edx),%edx 0fb612
  140. DEFINE movzbl_0x32(%eax),%eax 0fb680
  141. DEFINE movzbl_0x32(%ebp),%eax 0fb685
  142. DEFINE movzbl_0x8(%eax),%eax 0fb640
  143. DEFINE movzbl_0x8(%ebp),%eax 0fb645
  144. DEFINE movzbl_0x8(%ebp),%edx 0fb655
  145. DEFINE movzwl_(%eax),%eax 0fb700
  146. DEFINE movzwl_0x32(%eax),%eax 0fb780
  147. DEFINE movzwl_0x8(%eax),%eax 0fb740
  148. DEFINE mul____%edx f7e2
  149. DEFINE nop 90
  150. DEFINE not____%eax f7d0
  151. DEFINE or_____%edx,%eax 09d0
  152. DEFINE pop____%eax 58
  153. DEFINE pop____%edx 5a
  154. DEFINE push___$i32 68
  155. DEFINE push___%eax 50
  156. DEFINE push___%ebp 55
  157. DEFINE push___%edx 52
  158. DEFINE push___(%eax) ff30
  159. DEFINE push___0x32(%ebp) ffb5
  160. DEFINE push___0x8(%ebp) ff75
  161. DEFINE ret c3
  162. DEFINE sahf 9e
  163. DEFINE sete___%al 0f94c0
  164. DEFINE setg___%al 0f9fc0
  165. DEFINE setge__%al 0f9dc0
  166. DEFINE setl___%al 0f9cc0
  167. DEFINE setle__%al 0f9ec0
  168. DEFINE setne__%al 0f95c0
  169. DEFINE shl____$i8,%eax c1e0
  170. DEFINE shl____%cl,%eax d3e0
  171. DEFINE shr____%cl,%eax d3e8
  172. DEFINE sub____%al,%dl 28d0
  173. DEFINE sub____%dl,%al 28c2
  174. DEFINE sub____%eax,%edx 29c2
  175. DEFINE sub____%edx,%eax 29d0
  176. DEFINE sub____%esp,$i32 81ec
  177. DEFINE sub____%esp,$i8 83ec
  178. DEFINE test___%al,%al 84c0
  179. DEFINE test___%eax,%eax 85c0
  180. DEFINE xchg___%eax,(%esp) 870424
  181. DEFINE xor____$i32,%eax 35
  182. DEFINE xor____$i8,%ah 80f4
  183. DEFINE xor____%eax,%eax 31c0
  184. DEFINE xor____%ebx,%ebx 31db
  185. DEFINE xor____%ecx,%ecx 31c9
  186. DEFINE xor____%edx,%eax 31d0
  187. DEFINE xor____%edx,%edx 31d2
  188. DEFINE SYS_exit 01000000
  189. DEFINE SYS_read 03000000
  190. DEFINE SYS_write 04000000
  191. DEFINE SYS_open 05000000
  192. DEFINE SYS_close 06000000
  193. DEFINE SYS_unlink 0a000000
  194. DEFINE SYS_chmod 0f000000
  195. DEFINE SYS_lseek 13000000
  196. DEFINE SYS_access 21000000
  197. DEFINE SYS_brk 2d000000
  198. DEFINE SYS_fsync 76000000
  199. DEFINE SYS_getcwd b7000000