sysv_intel.masm 12 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961
  1. .686P
  2. .MODEL FLAT
  3. EXTRN @ffi_closure_inner@8:PROC
  4. _TEXT SEGMENT
  5. ALIGN 16
  6. PUBLIC @ffi_call_i386@8
  7. @ffi_call_i386@8 PROC
  8. LUW0:
  9. mov eax, [esp]
  10. mov [ecx], ebp
  11. mov [ecx+4], eax
  12. mov ebp, ecx
  13. LUW1:
  14. mov esp, edx
  15. mov eax, [20+0*4+ebp]
  16. mov edx, [20+1*4+ebp]
  17. mov ecx, [20+2*4+ebp]
  18. call dword ptr [ebp+8]
  19. mov ecx, [12+ebp]
  20. mov [ebp+8], ebx
  21. LUW2:
  22. and ecx, 15
  23. lea ebx, [Lstore_table + ecx * 8]
  24. mov ecx, [ebp+16]
  25. jmp ebx
  26. ALIGN 8
  27. Lstore_table:
  28. ALIGN 8; ORG Lstore_table + 0 * 8
  29. fstp DWORD PTR [ecx]
  30. jmp Le1
  31. ALIGN 8; ORG Lstore_table + 1 * 8
  32. fstp QWORD PTR [ecx]
  33. jmp Le1
  34. ALIGN 8; ORG Lstore_table + 2 * 8
  35. fstp QWORD PTR [ecx]
  36. jmp Le1
  37. ALIGN 8; ORG Lstore_table + 3 * 8
  38. movsx eax, al
  39. mov [ecx], eax
  40. jmp Le1
  41. ALIGN 8; ORG Lstore_table + 4 * 8
  42. movsx eax, ax
  43. mov [ecx], eax
  44. jmp Le1
  45. ALIGN 8; ORG Lstore_table + 5 * 8
  46. movzx eax, al
  47. mov [ecx], eax
  48. jmp Le1
  49. ALIGN 8; ORG Lstore_table + 6 * 8
  50. movzx eax, ax
  51. mov [ecx], eax
  52. jmp Le1
  53. ALIGN 8; ORG Lstore_table + 7 * 8
  54. mov [ecx+4], edx
  55. ALIGN 8; ORG Lstore_table + X86_RET_int 32 * 8
  56. mov [ecx], eax
  57. ALIGN 8; ORG Lstore_table + 9 * 8
  58. Le1:
  59. mov ebx, [ebp+8]
  60. mov esp, ebp
  61. pop ebp
  62. LUW3:
  63. ret
  64. LUW4:
  65. ALIGN 8; ORG Lstore_table + 10 * 8
  66. jmp Le1
  67. ALIGN 8; ORG Lstore_table + 11 * 8
  68. jmp Le1
  69. ALIGN 8; ORG Lstore_table + 12 * 8
  70. mov [ecx], al
  71. jmp Le1
  72. ALIGN 8; ORG Lstore_table + 13 * 8
  73. mov [ecx], ax
  74. jmp Le1
  75. ALIGN 8; ORG Lstore_table + 14 * 8
  76. int 3
  77. ALIGN 8; ORG Lstore_table + 15 * 8
  78. int 3
  79. LUW5:
  80. @ffi_call_i386@8 ENDP
  81. FFI_CLOSURE_SAVE_REGS MACRO
  82. mov [esp + 0+16+0*4], eax
  83. mov [esp + 0+16+1*4], edx
  84. mov [esp + 0+16+2*4], ecx
  85. ENDM
  86. FFI_CLOSURE_COPY_TRAMP_DATA MACRO
  87. mov edx, [eax+12]
  88. mov ecx, [eax+12+4]
  89. mov eax, [eax+12+8];
  90. mov [esp+0+28], edx
  91. mov [esp+0+32], ecx
  92. mov [esp+0+36], eax
  93. ENDM
  94. FFI_CLOSURE_PREP_CALL MACRO
  95. mov ecx, esp
  96. lea edx, [esp+(40 + 4)+4]
  97. ENDM
  98. FFI_CLOSURE_CALL_INNER MACRO UWN
  99. call @ffi_closure_inner@8
  100. ENDM
  101. FFI_CLOSURE_MASK_AND_JUMP MACRO LABEL
  102. and eax, 15
  103. lea edx, [LABEL+eax*8]
  104. mov eax, [esp+0]
  105. jmp edx
  106. ENDM
  107. ALIGN 16
  108. PUBLIC ffi_go_closure_EAX
  109. ffi_go_closure_EAX PROC C
  110. LUW6:
  111. sub esp, (40 + 4)
  112. LUW7:
  113. FFI_CLOSURE_SAVE_REGS
  114. mov edx, [eax+4]
  115. mov ecx, [eax +8]
  116. mov [esp+0+28], edx
  117. mov [esp+0+32], ecx
  118. mov [esp+0+36], eax
  119. jmp Ldo_closure_i386
  120. LUW8:
  121. ffi_go_closure_EAX ENDP
  122. ALIGN 16
  123. PUBLIC ffi_go_closure_ECX
  124. ffi_go_closure_ECX PROC C
  125. LUW9:
  126. sub esp, (40 + 4)
  127. LUW10:
  128. FFI_CLOSURE_SAVE_REGS
  129. mov edx, [ecx+4]
  130. mov eax, [ecx+8]
  131. mov [esp+0+28], edx
  132. mov [esp+0+32], eax
  133. mov [esp+0+36], ecx
  134. jmp Ldo_closure_i386
  135. LUW11:
  136. ffi_go_closure_ECX ENDP
  137. ALIGN 16
  138. PUBLIC ffi_closure_i386
  139. ffi_closure_i386 PROC C
  140. LUW12:
  141. sub esp, (40 + 4)
  142. LUW13:
  143. FFI_CLOSURE_SAVE_REGS
  144. FFI_CLOSURE_COPY_TRAMP_DATA
  145. Ldo_closure_i386::
  146. FFI_CLOSURE_PREP_CALL
  147. FFI_CLOSURE_CALL_INNER(14)
  148. FFI_CLOSURE_MASK_AND_JUMP Lload_table2
  149. ALIGN 8
  150. Lload_table2:
  151. ALIGN 8; ORG Lload_table2 + 0 * 8
  152. fld dword ptr [esp+0]
  153. jmp Le2
  154. ALIGN 8; ORG Lload_table2 + 1 * 8
  155. fld qword ptr [esp+0]
  156. jmp Le2
  157. ALIGN 8; ORG Lload_table2 + 2 * 8
  158. fld qword ptr [esp+0]
  159. jmp Le2
  160. ALIGN 8; ORG Lload_table2 + 3 * 8
  161. movsx eax, al
  162. jmp Le2
  163. ALIGN 8; ORG Lload_table2 + 4 * 8
  164. movsx eax, ax
  165. jmp Le2
  166. ALIGN 8; ORG Lload_table2 + 5 * 8
  167. movzx eax, al
  168. jmp Le2
  169. ALIGN 8; ORG Lload_table2 + 6 * 8
  170. movzx eax, ax
  171. jmp Le2
  172. ALIGN 8; ORG Lload_table2 + 7 * 8
  173. mov edx, [esp+0+4]
  174. jmp Le2
  175. ALIGN 8; ORG Lload_table2 + 8 * 8
  176. nop
  177. ALIGN 8; ORG Lload_table2 + 9 * 8
  178. Le2:
  179. add esp, (40 + 4)
  180. LUW16:
  181. ret
  182. LUW17:
  183. ALIGN 8; ORG Lload_table2 + 10 * 8
  184. add esp, (40 + 4)
  185. LUW18:
  186. ret 4
  187. LUW19:
  188. ALIGN 8; ORG Lload_table2 + 11 * 8
  189. jmp Le2
  190. ALIGN 8; ORG Lload_table2 + 12 * 8
  191. movzx eax, al
  192. jmp Le2
  193. ALIGN 8; ORG Lload_table2 + 13 * 8
  194. movzx eax, ax
  195. jmp Le2
  196. ALIGN 8; ORG Lload_table2 + 14 * 8
  197. int 3
  198. ALIGN 8; ORG Lload_table2 + 15 * 8
  199. int 3
  200. LUW20:
  201. ffi_closure_i386 ENDP
  202. ALIGN 16
  203. PUBLIC ffi_go_closure_STDCALL
  204. ffi_go_closure_STDCALL PROC C
  205. LUW21:
  206. sub esp, (40 + 4)
  207. LUW22:
  208. FFI_CLOSURE_SAVE_REGS
  209. mov edx, [ecx+4]
  210. mov eax, [ecx+8]
  211. mov [esp+0+28], edx
  212. mov [esp+0+32], eax
  213. mov [esp+0+36], ecx
  214. jmp Ldo_closure_STDCALL
  215. LUW23:
  216. ffi_go_closure_STDCALL ENDP
  217. ALIGN 16
  218. PUBLIC ffi_closure_REGISTER
  219. ffi_closure_REGISTER PROC C
  220. LUW24:
  221. sub esp, (40 + 4)-4
  222. LUW25:
  223. FFI_CLOSURE_SAVE_REGS
  224. mov ecx, [esp+(40 + 4)-4]
  225. mov eax, [esp+(40 + 4)]
  226. mov [esp+(40 + 4)], ecx
  227. jmp Ldo_closure_REGISTER
  228. LUW26:
  229. ffi_closure_REGISTER ENDP
  230. ALIGN 16
  231. PUBLIC ffi_closure_STDCALL
  232. ffi_closure_STDCALL PROC C
  233. LUW27:
  234. sub esp, (40 + 4)
  235. LUW28:
  236. FFI_CLOSURE_SAVE_REGS
  237. Ldo_closure_REGISTER::
  238. FFI_CLOSURE_COPY_TRAMP_DATA
  239. Ldo_closure_STDCALL::
  240. FFI_CLOSURE_PREP_CALL
  241. FFI_CLOSURE_CALL_INNER(29)
  242. mov ecx, eax
  243. shr ecx, 4
  244. lea ecx, [esp+(40 + 4)+ecx]
  245. mov edx, [esp+(40 + 4)]
  246. mov [ecx], edx
  247. FFI_CLOSURE_MASK_AND_JUMP Lload_table3
  248. ALIGN 8
  249. Lload_table3:
  250. ALIGN 8; ORG Lload_table3 + 0 * 8
  251. fld DWORD PTR [esp+0]
  252. mov esp, ecx
  253. ret
  254. ALIGN 8; ORG Lload_table3 + 1 * 8
  255. fld QWORD PTR [esp+0]
  256. mov esp, ecx
  257. ret
  258. ALIGN 8; ORG Lload_table3 + 2 * 8
  259. fld QWORD PTR [esp+0]
  260. mov esp, ecx
  261. ret
  262. ALIGN 8; ORG Lload_table3 + 3 * 8
  263. movsx eax, al
  264. mov esp, ecx
  265. ret
  266. ALIGN 8; ORG Lload_table3 + 4 * 8
  267. movsx eax, ax
  268. mov esp, ecx
  269. ret
  270. ALIGN 8; ORG Lload_table3 + 5 * 8
  271. movzx eax, al
  272. mov esp, ecx
  273. ret
  274. ALIGN 8; ORG Lload_table3 + 6 * 8
  275. movzx eax, ax
  276. mov esp, ecx
  277. ret
  278. ALIGN 8; ORG Lload_table3 + 7 * 8
  279. mov edx, [esp+0+4]
  280. mov esp, ecx
  281. ret
  282. ALIGN 8; ORG Lload_table3 + X86_RET_int 32 * 8
  283. mov esp, ecx
  284. ret
  285. ALIGN 8; ORG Lload_table3 + 9 * 8
  286. mov esp, ecx
  287. ret
  288. ALIGN 8; ORG Lload_table3 + 10 * 8
  289. mov esp, ecx
  290. ret
  291. ALIGN 8; ORG Lload_table3 + 11 * 8
  292. mov esp, ecx
  293. ret
  294. ALIGN 8; ORG Lload_table3 + 12 * 8
  295. movzx eax, al
  296. mov esp, ecx
  297. ret
  298. ALIGN 8; ORG Lload_table3 + 13 * 8
  299. movzx eax, ax
  300. mov esp, ecx
  301. ret
  302. ALIGN 8; ORG Lload_table3 + 14 * 8
  303. int 3
  304. ALIGN 8; ORG Lload_table3 + 15 * 8
  305. int 3
  306. LUW31:
  307. ffi_closure_STDCALL ENDP
  308. ALIGN 16
  309. PUBLIC ffi_closure_raw_SYSV
  310. ffi_closure_raw_SYSV PROC C
  311. LUW32:
  312. sub esp, (16+16+12)
  313. LUW33:
  314. mov [esp+(16+16+12)-4], ebx
  315. LUW34:
  316. mov edx, [eax+12+8]
  317. mov [esp+12], edx
  318. lea edx, [esp+(16+16+12)+4]
  319. mov [esp+8], edx
  320. lea edx, [esp+16]
  321. mov [esp+4], edx
  322. mov ebx, [eax+12]
  323. mov [esp], ebx
  324. call DWORD PTR [eax+12+4]
  325. mov eax, [ebx+20]
  326. and eax, 15
  327. lea ecx, [Lload_table4+eax+8]
  328. mov ebx, [esp+(16+16+12)-4]
  329. LUW35:
  330. mov eax, [esp+16]
  331. jmp dword ptr [ecx]
  332. ALIGN 8
  333. Lload_table4:
  334. ALIGN 8; ORG Lload_table4 + 0 * 8
  335. fld DWORD PTR [esp +16]
  336. jmp Le4
  337. ALIGN 8; ORG Lload_table4 + 1 * 8
  338. fld QWORD PTR [esp +16]
  339. jmp Le4
  340. ALIGN 8; ORG Lload_table4 + 2 * 8
  341. fld QWORD PTR [esp +16]
  342. jmp Le4
  343. ALIGN 8; ORG Lload_table4 + 3 * 8
  344. movsx eax, al
  345. jmp Le4
  346. ALIGN 8; ORG Lload_table4 + 4 * 8
  347. movsx eax, ax
  348. jmp Le4
  349. ALIGN 8; ORG Lload_table4 + 5 * 8
  350. movzx eax, al
  351. jmp Le4
  352. ALIGN 8; ORG Lload_table4 + 6 * 8
  353. movzx eax, ax
  354. jmp Le4
  355. ALIGN 8; ORG Lload_table4 + 7 * 8
  356. mov edx, [esp+16+4]
  357. jmp Le4
  358. ALIGN 8; ORG Lload_table4 + X86_RET_int 32 * 8
  359. nop
  360. ALIGN 8; ORG Lload_table4 + 9 * 8
  361. Le4:
  362. add esp, (16+16+12)
  363. LUW36:
  364. ret
  365. LUW37:
  366. ALIGN 8; ORG Lload_table4 + 10 * 8
  367. add esp, (16+16+12)
  368. LUW38:
  369. ret 4
  370. LUW39:
  371. ALIGN 8; ORG Lload_table4 + 11 * 8
  372. jmp Le4
  373. ALIGN 8; ORG Lload_table4 + 12 * 8
  374. movzx eax, al
  375. jmp Le4
  376. ALIGN 8; ORG Lload_table4 + 13 * 8
  377. movzx eax, ax
  378. jmp Le4
  379. ALIGN 8; ORG Lload_table4 + 14 * 8
  380. int 3
  381. ALIGN 8; ORG Lload_table4 + 15 * 8
  382. int 3
  383. LUW40:
  384. ffi_closure_raw_SYSV ENDP
  385. ALIGN 16
  386. PUBLIC ffi_closure_raw_THISCALL
  387. ffi_closure_raw_THISCALL PROC C
  388. LUW41:
  389. pop edx
  390. LUW42:
  391. push ecx
  392. LUW43:
  393. push edx
  394. LUW44:
  395. sub esp, (16+16+8)
  396. LUW45:
  397. mov [esp+(16+16+8)-4], ebx
  398. LUW46:
  399. mov edx, [eax+12+8]
  400. mov [esp+12], edx
  401. lea edx, [esp+(16+16+8)+4]
  402. mov [esp+8], edx
  403. lea edx, [esp+16]
  404. mov [esp+4], edx
  405. mov ebx, [eax+12]
  406. mov [esp], ebx
  407. call DWORD PTR [eax+12+4]
  408. mov eax, [ebx+20]
  409. and eax, 15
  410. lea ecx, [Lload_table5+eax*8]
  411. mov ebx, [esp+(16+16+8)-4]
  412. LUW47:
  413. mov eax, [esp+16]
  414. jmp DWORD PTR [ecx]
  415. AlIGN 4
  416. Lload_table5:
  417. ALIGN 8; ORG Lload_table5 + 0 * 8
  418. fld DWORD PTR [esp +16]
  419. jmp Le5
  420. ALIGN 8; ORG Lload_table5 + 1 * 8
  421. fld QWORD PTR [esp +16]
  422. jmp Le5
  423. ALIGN 8; ORG Lload_table5 + 2 * 8
  424. fld QWORD PTR [esp+16]
  425. jmp Le5
  426. ALIGN 8; ORG Lload_table5 + 3 * 8
  427. movsx eax, al
  428. jmp Le5
  429. ALIGN 8; ORG Lload_table5 + 4 * 8
  430. movsx eax, ax
  431. jmp Le5
  432. ALIGN 8; ORG Lload_table5 + 5 * 8
  433. movzx eax, al
  434. jmp Le5
  435. ALIGN 8; ORG Lload_table5 + 6 * 8
  436. movzx eax, ax
  437. jmp Le5
  438. ALIGN 8; ORG Lload_table5 + 7 * 8
  439. mov edx, [esp+16+4]
  440. jmp Le5
  441. ALIGN 8; ORG Lload_table5 + X86_RET_int 32 * 8
  442. nop
  443. ALIGN 8; ORG Lload_table5 + 9 * 8
  444. Le5:
  445. add esp, (16+16+8)
  446. LUW48:
  447. ret 4
  448. LUW49:
  449. ALIGN 8; ORG Lload_table5 + 10 * 8
  450. add esp, (16+16+8)
  451. LUW50:
  452. ret 8
  453. LUW51:
  454. ALIGN 8; ORG Lload_table5 + 11 * 8
  455. jmp Le5
  456. ALIGN 8; ORG Lload_table5 + 12 * 8
  457. movzx eax, al
  458. jmp Le5
  459. ALIGN 8; ORG Lload_table5 + 13 * 8
  460. movzx eax, ax
  461. jmp Le5
  462. ALIGN 8; ORG Lload_table5 + 14 * 8
  463. int 3
  464. ALIGN 8; ORG Lload_table5 + 15 * 8
  465. int 3
  466. LUW52:
  467. ffi_closure_raw_THISCALL ENDP
  468. END