test.M1 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686
  1. # Core program
  2. # Defining function exit
  3. :FUNCTION_exit
  4. POP_ebx
  5. POP_ebx
  6. LOAD_IMMEDIATE_eax %1
  7. INT_80
  8. RETURN
  9. # Defining function fgetc
  10. :FUNCTION_fgetc
  11. LOAD_IMMEDIATE_eax %3
  12. LOAD_EFFECTIVE_ADDRESS_ebx %4
  13. LOAD_INTEGER_ebx
  14. PUSH_ebx
  15. COPY_esp_to_ecx
  16. LOAD_IMMEDIATE_edx %1
  17. INT_80
  18. TEST
  19. POP_eax
  20. JUMP_NE8 !FUNCTION_fgetc_Done
  21. LOAD_IMMEDIATE_eax %-1
  22. :FUNCTION_fgetc_Done
  23. RETURN
  24. # Defining function fputc
  25. :FUNCTION_fputc
  26. LOAD_IMMEDIATE_eax %4
  27. LOAD_EFFECTIVE_ADDRESS_ebx %4
  28. LOAD_INTEGER_ebx
  29. LOAD_EFFECTIVE_ADDRESS_ecx %8
  30. LOAD_IMMEDIATE_edx %1
  31. INT_80
  32. RETURN
  33. # Defining function open
  34. :FUNCTION_open
  35. LOAD_EFFECTIVE_ADDRESS_ebx %12
  36. LOAD_INTEGER_ebx
  37. LOAD_EFFECTIVE_ADDRESS_ecx %8
  38. LOAD_INTEGER_ecx
  39. LOAD_EFFECTIVE_ADDRESS_edx %4
  40. LOAD_INTEGER_edx
  41. LOAD_IMMEDIATE_eax %5
  42. INT_80
  43. RETURN
  44. # Defining function fopen
  45. :FUNCTION_fopen
  46. # Defining local f
  47. PUSH_eax #f
  48. # IF_0
  49. LOAD_IMMEDIATE_eax %119
  50. PUSH_eax #_common_recursion
  51. LOAD_EFFECTIVE_ADDRESS %12
  52. LOAD_INTEGER
  53. PUSH_eax #_common_recursion
  54. LOAD_IMMEDIATE_eax %0
  55. POP_ebx # _common_recursion
  56. ADD_ebx_to_eax
  57. LOAD_BYTE
  58. POP_ebx # _common_recursion
  59. CMP
  60. SETE
  61. MOVEZBL
  62. TEST
  63. JUMP_EQ %ELSE_0
  64. LOAD_EFFECTIVE_ADDRESS %0
  65. PUSH_eax #_common_recursion
  66. LOAD_EFFECTIVE_ADDRESS %16
  67. LOAD_INTEGER
  68. PUSH_eax #_process_expression1
  69. LOAD_IMMEDIATE_eax %577
  70. PUSH_eax #_process_expression2
  71. LOAD_IMMEDIATE_eax %384
  72. PUSH_eax #_process_expression2
  73. CALL_IMMEDIATE %FUNCTION_open
  74. POP_ebx # _process_expression_locals
  75. POP_ebx # _process_expression_locals
  76. POP_ebx # _process_expression_locals
  77. POP_ebx # _common_recursion
  78. STORE_INTEGER
  79. JUMP %_END_IF_0
  80. :ELSE_0
  81. LOAD_EFFECTIVE_ADDRESS %0
  82. PUSH_eax #_common_recursion
  83. LOAD_EFFECTIVE_ADDRESS %16
  84. LOAD_INTEGER
  85. PUSH_eax #_process_expression1
  86. LOAD_IMMEDIATE_eax %0
  87. PUSH_eax #_process_expression2
  88. LOAD_IMMEDIATE_eax %0
  89. PUSH_eax #_process_expression2
  90. CALL_IMMEDIATE %FUNCTION_open
  91. POP_ebx # _process_expression_locals
  92. POP_ebx # _process_expression_locals
  93. POP_ebx # _process_expression_locals
  94. POP_ebx # _common_recursion
  95. STORE_INTEGER
  96. :_END_IF_0
  97. # IF_1
  98. LOAD_IMMEDIATE_eax %0
  99. PUSH_eax #_common_recursion
  100. LOAD_EFFECTIVE_ADDRESS %4
  101. LOAD_INTEGER
  102. POP_ebx # _common_recursion
  103. CMP
  104. SETG
  105. MOVEZBL
  106. TEST
  107. JUMP_EQ %ELSE_1
  108. LOAD_IMMEDIATE_eax %0
  109. POP_ebx # _return_result_locals
  110. RETURN
  111. JUMP %_END_IF_1
  112. :ELSE_1
  113. :_END_IF_1
  114. LOAD_EFFECTIVE_ADDRESS %0
  115. LOAD_INTEGER
  116. POP_ebx # _return_result_locals
  117. RETURN
  118. # Defining function close
  119. :FUNCTION_close
  120. LOAD_EFFECTIVE_ADDRESS_ebx %4
  121. LOAD_IMMEDIATE_eax %6
  122. INT_80
  123. RETURN
  124. # Defining function fclose
  125. :FUNCTION_fclose
  126. # Defining local error
  127. LOAD_EFFECTIVE_ADDRESS %4
  128. LOAD_INTEGER
  129. PUSH_eax #_process_expression1
  130. CALL_IMMEDIATE %FUNCTION_close
  131. POP_ebx # _process_expression_locals
  132. PUSH_eax #error
  133. LOAD_EFFECTIVE_ADDRESS %0
  134. LOAD_INTEGER
  135. POP_ebx # _return_result_locals
  136. RETURN
  137. # Defining function file_print
  138. :FUNCTION_file_print
  139. :WHILE_0
  140. LOAD_IMMEDIATE_eax %0
  141. PUSH_eax #_common_recursion
  142. LOAD_EFFECTIVE_ADDRESS %12
  143. LOAD_INTEGER
  144. PUSH_eax #_common_recursion
  145. LOAD_IMMEDIATE_eax %0
  146. POP_ebx # _common_recursion
  147. ADD_ebx_to_eax
  148. LOAD_BYTE
  149. POP_ebx # _common_recursion
  150. CMP
  151. SETNE
  152. MOVEZBL
  153. TEST
  154. JUMP_EQ %END_WHILE_0
  155. # THEN_while_0
  156. LOAD_EFFECTIVE_ADDRESS %8
  157. LOAD_INTEGER
  158. PUSH_eax #_common_recursion
  159. LOAD_IMMEDIATE_eax %0
  160. POP_ebx # _common_recursion
  161. ADD_ebx_to_eax
  162. LOAD_BYTE
  163. PUSH_eax #_process_expression1
  164. LOAD_EFFECTIVE_ADDRESS %8
  165. LOAD_INTEGER
  166. PUSH_eax #_process_expression2
  167. CALL_IMMEDIATE %FUNCTION_fputc
  168. POP_ebx # _process_expression_locals
  169. POP_ebx # _process_expression_locals
  170. LOAD_EFFECTIVE_ADDRESS %8
  171. PUSH_eax #_common_recursion
  172. LOAD_EFFECTIVE_ADDRESS %12
  173. LOAD_INTEGER
  174. PUSH_eax #_common_recursion
  175. LOAD_IMMEDIATE_eax %1
  176. POP_ebx # _common_recursion
  177. ADD_ebx_to_eax
  178. POP_ebx # _common_recursion
  179. STORE_INTEGER
  180. JUMP %WHILE_0
  181. :END_WHILE_0
  182. RETURN
  183. # Defining function malloc
  184. :FUNCTION_malloc
  185. LOAD_ESP_IMMEDIATE_into_eax %4
  186. PUSH_eax
  187. LOAD_IMMEDIATE_eax %45
  188. LOAD_IMMEDIATE_ebx %0
  189. INT_80
  190. POP_ebx
  191. ADD_eax_to_ebx
  192. PUSH_eax
  193. PUSH_ebx
  194. LOAD_IMMEDIATE_eax %45
  195. INT_80
  196. POP_ebx
  197. CMP
  198. POP_eax
  199. JUMP_EQ8 !FUNCTION_malloc_Done
  200. LOAD_IMMEDIATE_eax %-1
  201. :FUNCTION_malloc_Done
  202. RETURN
  203. # Defining function memset
  204. :FUNCTION_memset
  205. # Defining local s
  206. PUSH_eax #s
  207. # FOR_initialization_0
  208. LOAD_EFFECTIVE_ADDRESS %0
  209. PUSH_eax #_common_recursion
  210. LOAD_EFFECTIVE_ADDRESS %20
  211. LOAD_INTEGER
  212. POP_ebx # _common_recursion
  213. STORE_INTEGER
  214. :FOR_0
  215. LOAD_IMMEDIATE_eax %0
  216. PUSH_eax #_common_recursion
  217. LOAD_EFFECTIVE_ADDRESS %12
  218. LOAD_INTEGER
  219. POP_ebx # _common_recursion
  220. CMP
  221. SETL
  222. MOVEZBL
  223. TEST
  224. JUMP_EQ %FOR_END_0
  225. JUMP %FOR_THEN_0
  226. :FOR_ITER_0
  227. LOAD_EFFECTIVE_ADDRESS %8
  228. PUSH_eax #_common_recursion
  229. LOAD_EFFECTIVE_ADDRESS %12
  230. LOAD_INTEGER
  231. PUSH_eax #_common_recursion
  232. LOAD_IMMEDIATE_eax %1
  233. POP_ebx # _common_recursion
  234. SUBTRACT_eax_from_ebx_into_ebx
  235. MOVE_ebx_to_eax
  236. POP_ebx # _common_recursion
  237. STORE_INTEGER
  238. JUMP %FOR_0
  239. :FOR_THEN_0
  240. LOAD_EFFECTIVE_ADDRESS %0
  241. LOAD_INTEGER
  242. PUSH_eax #_common_recursion
  243. LOAD_IMMEDIATE_eax %0
  244. POP_ebx # _common_recursion
  245. ADD_ebx_to_eax
  246. PUSH_eax #_common_recursion
  247. LOAD_EFFECTIVE_ADDRESS %16
  248. LOAD_INTEGER
  249. POP_ebx # _common_recursion
  250. STORE_CHAR
  251. LOAD_EFFECTIVE_ADDRESS %0
  252. PUSH_eax #_common_recursion
  253. LOAD_EFFECTIVE_ADDRESS %4
  254. LOAD_INTEGER
  255. PUSH_eax #_common_recursion
  256. LOAD_IMMEDIATE_eax %1
  257. POP_ebx # _common_recursion
  258. ADD_ebx_to_eax
  259. POP_ebx # _common_recursion
  260. STORE_INTEGER
  261. JUMP %FOR_ITER_0
  262. :FOR_END_0
  263. POP_ebx # _recursive_statement_locals
  264. RETURN
  265. # Defining function calloc
  266. :FUNCTION_calloc
  267. # Defining local ret
  268. LOAD_EFFECTIVE_ADDRESS %8
  269. LOAD_INTEGER
  270. PUSH_eax #_common_recursion
  271. LOAD_EFFECTIVE_ADDRESS %8
  272. LOAD_INTEGER
  273. POP_ebx # _common_recursion
  274. MULTIPLY_eax_by_ebx_into_eax
  275. PUSH_eax #_process_expression1
  276. CALL_IMMEDIATE %FUNCTION_malloc
  277. POP_ebx # _process_expression_locals
  278. PUSH_eax #ret
  279. LOAD_EFFECTIVE_ADDRESS %0
  280. LOAD_INTEGER
  281. PUSH_eax #_process_expression1
  282. LOAD_IMMEDIATE_eax %0
  283. PUSH_eax #_process_expression2
  284. LOAD_EFFECTIVE_ADDRESS %20
  285. LOAD_INTEGER
  286. PUSH_eax #_common_recursion
  287. LOAD_EFFECTIVE_ADDRESS %20
  288. LOAD_INTEGER
  289. POP_ebx # _common_recursion
  290. MULTIPLY_eax_by_ebx_into_eax
  291. PUSH_eax #_process_expression2
  292. CALL_IMMEDIATE %FUNCTION_memset
  293. POP_ebx # _process_expression_locals
  294. POP_ebx # _process_expression_locals
  295. POP_ebx # _process_expression_locals
  296. LOAD_EFFECTIVE_ADDRESS %0
  297. LOAD_INTEGER
  298. POP_ebx # _return_result_locals
  299. RETURN
  300. # Defining function free
  301. :FUNCTION_free
  302. RETURN
  303. # Defining function match
  304. :FUNCTION_match
  305. # Defining local i
  306. LOAD_IMMEDIATE_eax %0
  307. PUSH_eax #_common_recursion
  308. LOAD_IMMEDIATE_eax %1
  309. POP_ebx # _common_recursion
  310. SUBTRACT_eax_from_ebx_into_ebx
  311. MOVE_ebx_to_eax
  312. PUSH_eax #i
  313. :DO_0
  314. LOAD_EFFECTIVE_ADDRESS %0
  315. PUSH_eax #_common_recursion
  316. LOAD_EFFECTIVE_ADDRESS %4
  317. LOAD_INTEGER
  318. PUSH_eax #_common_recursion
  319. LOAD_IMMEDIATE_eax %1
  320. POP_ebx # _common_recursion
  321. ADD_ebx_to_eax
  322. POP_ebx # _common_recursion
  323. STORE_INTEGER
  324. # IF_2
  325. LOAD_EFFECTIVE_ADDRESS %12
  326. LOAD_INTEGER
  327. PUSH_eax #_common_recursion
  328. LOAD_EFFECTIVE_ADDRESS %4
  329. LOAD_INTEGER
  330. POP_ebx # _common_recursion
  331. ADD_ebx_to_eax
  332. LOAD_BYTE
  333. PUSH_eax #_common_recursion
  334. LOAD_EFFECTIVE_ADDRESS %12
  335. LOAD_INTEGER
  336. PUSH_eax #_common_recursion
  337. LOAD_EFFECTIVE_ADDRESS %8
  338. LOAD_INTEGER
  339. POP_ebx # _common_recursion
  340. ADD_ebx_to_eax
  341. LOAD_BYTE
  342. POP_ebx # _common_recursion
  343. CMP
  344. SETNE
  345. MOVEZBL
  346. TEST
  347. JUMP_EQ %ELSE_2
  348. LOAD_IMMEDIATE_eax %0
  349. POP_ebx # _return_result_locals
  350. RETURN
  351. JUMP %_END_IF_2
  352. :ELSE_2
  353. :_END_IF_2
  354. LOAD_IMMEDIATE_eax %0
  355. PUSH_eax #_common_recursion
  356. LOAD_EFFECTIVE_ADDRESS %16
  357. LOAD_INTEGER
  358. PUSH_eax #_common_recursion
  359. LOAD_EFFECTIVE_ADDRESS %8
  360. LOAD_INTEGER
  361. POP_ebx # _common_recursion
  362. ADD_ebx_to_eax
  363. LOAD_BYTE
  364. POP_ebx # _common_recursion
  365. CMP
  366. SETNE
  367. MOVEZBL
  368. PUSH_eax #_common_recursion
  369. LOAD_IMMEDIATE_eax %0
  370. PUSH_eax #_common_recursion
  371. LOAD_EFFECTIVE_ADDRESS %16
  372. LOAD_INTEGER
  373. PUSH_eax #_common_recursion
  374. LOAD_EFFECTIVE_ADDRESS %12
  375. LOAD_INTEGER
  376. POP_ebx # _common_recursion
  377. ADD_ebx_to_eax
  378. LOAD_BYTE
  379. POP_ebx # _common_recursion
  380. CMP
  381. SETNE
  382. MOVEZBL
  383. POP_ebx # _common_recursion
  384. AND_eax_ebx
  385. TEST
  386. JUMP_NE %DO_0
  387. :DO_END_0
  388. LOAD_IMMEDIATE_eax %1
  389. POP_ebx # _return_result_locals
  390. RETURN
  391. # Defining function consume_token
  392. :FUNCTION_consume_token
  393. # Defining local i
  394. LOAD_IMMEDIATE_eax %0
  395. PUSH_eax #i
  396. # Defining local c
  397. LOAD_EFFECTIVE_ADDRESS %12
  398. LOAD_INTEGER
  399. PUSH_eax #_process_expression1
  400. CALL_IMMEDIATE %FUNCTION_fgetc
  401. POP_ebx # _process_expression_locals
  402. PUSH_eax #c
  403. :DO_1
  404. LOAD_EFFECTIVE_ADDRESS %12
  405. LOAD_INTEGER
  406. PUSH_eax #_common_recursion
  407. LOAD_EFFECTIVE_ADDRESS %8
  408. LOAD_INTEGER
  409. POP_ebx # _common_recursion
  410. ADD_ebx_to_eax
  411. PUSH_eax #_common_recursion
  412. LOAD_EFFECTIVE_ADDRESS %4
  413. LOAD_INTEGER
  414. POP_ebx # _common_recursion
  415. STORE_CHAR
  416. LOAD_EFFECTIVE_ADDRESS %4
  417. PUSH_eax #_common_recursion
  418. LOAD_EFFECTIVE_ADDRESS %8
  419. LOAD_INTEGER
  420. PUSH_eax #_common_recursion
  421. LOAD_IMMEDIATE_eax %1
  422. POP_ebx # _common_recursion
  423. ADD_ebx_to_eax
  424. POP_ebx # _common_recursion
  425. STORE_INTEGER
  426. LOAD_EFFECTIVE_ADDRESS %0
  427. PUSH_eax #_common_recursion
  428. LOAD_EFFECTIVE_ADDRESS %20
  429. LOAD_INTEGER
  430. PUSH_eax #_process_expression1
  431. CALL_IMMEDIATE %FUNCTION_fgetc
  432. POP_ebx # _process_expression_locals
  433. POP_ebx # _common_recursion
  434. STORE_INTEGER
  435. LOAD_IMMEDIATE_eax %32
  436. PUSH_eax #_common_recursion
  437. LOAD_EFFECTIVE_ADDRESS %4
  438. LOAD_INTEGER
  439. POP_ebx # _common_recursion
  440. CMP
  441. SETNE
  442. MOVEZBL
  443. PUSH_eax #_common_recursion
  444. LOAD_IMMEDIATE_eax %9
  445. PUSH_eax #_common_recursion
  446. LOAD_EFFECTIVE_ADDRESS %8
  447. LOAD_INTEGER
  448. POP_ebx # _common_recursion
  449. CMP
  450. SETNE
  451. MOVEZBL
  452. POP_ebx # _common_recursion
  453. AND_eax_ebx
  454. PUSH_eax #_common_recursion
  455. LOAD_IMMEDIATE_eax %10
  456. PUSH_eax #_common_recursion
  457. LOAD_EFFECTIVE_ADDRESS %8
  458. LOAD_INTEGER
  459. POP_ebx # _common_recursion
  460. CMP
  461. SETNE
  462. MOVEZBL
  463. POP_ebx # _common_recursion
  464. AND_eax_ebx
  465. PUSH_eax #_common_recursion
  466. LOAD_IMMEDIATE_eax %62
  467. PUSH_eax #_common_recursion
  468. LOAD_EFFECTIVE_ADDRESS %8
  469. LOAD_INTEGER
  470. POP_ebx # _common_recursion
  471. CMP
  472. SETNE
  473. MOVEZBL
  474. POP_ebx # _common_recursion
  475. AND_eax_ebx
  476. TEST
  477. JUMP_NE %DO_1
  478. :DO_END_1
  479. POP_ebx # _recursive_statement_locals
  480. POP_ebx # _recursive_statement_locals
  481. RETURN
  482. # Defining function storeLabel
  483. :FUNCTION_storeLabel
  484. # Defining local entry
  485. LOAD_IMMEDIATE_eax %1
  486. PUSH_eax #_process_expression1
  487. LOAD_IMMEDIATE_eax %8
  488. PUSH_eax #_process_expression2
  489. CALL_IMMEDIATE %FUNCTION_calloc
  490. POP_ebx # _process_expression_locals
  491. POP_ebx # _process_expression_locals
  492. PUSH_eax #entry
  493. LOAD_EFFECTIVE_ADDRESS %0
  494. LOAD_INTEGER
  495. # looking up offset
  496. PUSH_eax #_common_recursion
  497. LOAD_IMMEDIATE_eax &GLOBAL_jump_table
  498. LOAD_INTEGER
  499. POP_ebx # _common_recursion
  500. STORE_INTEGER
  501. LOAD_IMMEDIATE_eax &GLOBAL_jump_table
  502. PUSH_eax #_common_recursion
  503. LOAD_EFFECTIVE_ADDRESS %4
  504. LOAD_INTEGER
  505. POP_ebx # _common_recursion
  506. STORE_INTEGER
  507. LOAD_EFFECTIVE_ADDRESS %0
  508. LOAD_INTEGER
  509. # looking up offset
  510. # -> offset calculation
  511. LOAD_IMMEDIATE_ebx %4
  512. ADD_ebx_to_eax
  513. PUSH_eax #_common_recursion
  514. LOAD_IMMEDIATE_eax %4096
  515. PUSH_eax #_common_recursion
  516. LOAD_IMMEDIATE_eax %1
  517. POP_ebx # _common_recursion
  518. ADD_ebx_to_eax
  519. PUSH_eax #_process_expression1
  520. LOAD_IMMEDIATE_eax %1
  521. PUSH_eax #_process_expression2
  522. CALL_IMMEDIATE %FUNCTION_calloc
  523. POP_ebx # _process_expression_locals
  524. POP_ebx # _process_expression_locals
  525. POP_ebx # _common_recursion
  526. STORE_INTEGER
  527. LOAD_EFFECTIVE_ADDRESS %8
  528. LOAD_INTEGER
  529. PUSH_eax #_process_expression1
  530. LOAD_EFFECTIVE_ADDRESS %4
  531. LOAD_INTEGER
  532. # looking up offset
  533. # -> offset calculation
  534. LOAD_IMMEDIATE_ebx %4
  535. ADD_ebx_to_eax
  536. LOAD_INTEGER
  537. PUSH_eax #_process_expression2
  538. CALL_IMMEDIATE %FUNCTION_consume_token
  539. POP_ebx # _process_expression_locals
  540. POP_ebx # _process_expression_locals
  541. # IF_3
  542. LOAD_IMMEDIATE_eax %95
  543. PUSH_eax #_common_recursion
  544. LOAD_EFFECTIVE_ADDRESS %4
  545. LOAD_INTEGER
  546. # looking up offset
  547. # -> offset calculation
  548. LOAD_IMMEDIATE_ebx %4
  549. ADD_ebx_to_eax
  550. LOAD_INTEGER
  551. PUSH_eax #_common_recursion
  552. LOAD_IMMEDIATE_eax %0
  553. POP_ebx # _common_recursion
  554. ADD_ebx_to_eax
  555. LOAD_BYTE
  556. POP_ebx # _common_recursion
  557. CMP
  558. SETE
  559. MOVEZBL
  560. TEST
  561. JUMP_EQ %ELSE_3
  562. LOAD_IMMEDIATE_eax &GLOBAL_jump_table
  563. PUSH_eax #_common_recursion
  564. LOAD_IMMEDIATE_eax &GLOBAL_jump_table
  565. LOAD_INTEGER
  566. # looking up offset
  567. LOAD_INTEGER
  568. POP_ebx # _common_recursion
  569. STORE_INTEGER
  570. JUMP %_END_IF_3
  571. :ELSE_3
  572. :_END_IF_3
  573. POP_ebx # _recursive_statement_locals
  574. RETURN
  575. # Defining function line_Comment
  576. :FUNCTION_line_Comment
  577. # Defining local c
  578. LOAD_EFFECTIVE_ADDRESS %4
  579. LOAD_INTEGER
  580. PUSH_eax #_process_expression1
  581. CALL_IMMEDIATE %FUNCTION_fgetc
  582. POP_ebx # _process_expression_locals
  583. PUSH_eax #c
  584. :WHILE_1
  585. LOAD_IMMEDIATE_eax %10
  586. PUSH_eax #_common_recursion
  587. LOAD_EFFECTIVE_ADDRESS %4
  588. LOAD_INTEGER
  589. POP_ebx # _common_recursion
  590. CMP
  591. SETNE
  592. MOVEZBL
  593. PUSH_eax #_common_recursion
  594. LOAD_IMMEDIATE_eax %13
  595. PUSH_eax #_common_recursion
  596. LOAD_EFFECTIVE_ADDRESS %8
  597. LOAD_INTEGER
  598. POP_ebx # _common_recursion
  599. CMP
  600. SETNE
  601. MOVEZBL
  602. POP_ebx # _common_recursion
  603. AND_eax_ebx
  604. TEST
  605. JUMP_EQ %END_WHILE_1
  606. # THEN_while_1
  607. LOAD_EFFECTIVE_ADDRESS %0
  608. PUSH_eax #_common_recursion
  609. LOAD_EFFECTIVE_ADDRESS %12
  610. LOAD_INTEGER
  611. PUSH_eax #_process_expression1
  612. CALL_IMMEDIATE %FUNCTION_fgetc
  613. POP_ebx # _process_expression_locals
  614. POP_ebx # _common_recursion
  615. STORE_INTEGER
  616. JUMP %WHILE_1
  617. :END_WHILE_1
  618. POP_ebx # _recursive_statement_locals
  619. RETURN
  620. # Defining function purge_string
  621. :FUNCTION_purge_string
  622. # Defining local c
  623. LOAD_EFFECTIVE_ADDRESS %4
  624. LOAD_INTEGER
  625. PUSH_eax #_process_expression1
  626. CALL_IMMEDIATE %FUNCTION_fgetc
  627. POP_ebx # _process_expression_locals
  628. PUSH_eax #c
  629. :WHILE_2
  630. LOAD_IMMEDIATE_eax %0xFFFFFFFF
  631. PUSH_eax #_common_recursion
  632. LOAD_EFFECTIVE_ADDRESS %4
  633. LOAD_INTEGER
  634. POP_ebx # _common_recursion
  635. CMP
  636. SETNE
  637. MOVEZBL
  638. PUSH_eax #_common_recursion
  639. LOAD_IMMEDIATE_eax %34
  640. PUSH_eax #_common_recursion
  641. LOAD_EFFECTIVE_ADDRESS %8
  642. LOAD_INTEGER
  643. POP_ebx # _common_recursion
  644. CMP
  645. SETNE
  646. MOVEZBL
  647. POP_ebx # _common_recursion
  648. AND_eax_ebx
  649. TEST
  650. JUMP_EQ %END_WHILE_2
  651. # THEN_while_2
  652. LOAD_EFFECTIVE_ADDRESS %0
  653. PUSH_eax #_common_recursion
  654. LOAD_EFFECTIVE_ADDRESS %12
  655. LOAD_INTEGER
  656. PUSH_eax #_process_expression1
  657. CALL_IMMEDIATE %FUNCTION_fgetc
  658. POP_ebx # _process_expression_locals
  659. POP_ebx # _common_recursion
  660. STORE_INTEGER
  661. JUMP %WHILE_2
  662. :END_WHILE_2
  663. POP_ebx # _recursive_statement_locals
  664. RETURN
  665. # Defining function first_pass
  666. :FUNCTION_first_pass
  667. # IF_4
  668. LOAD_IMMEDIATE_eax %0
  669. PUSH_eax #_common_recursion
  670. LOAD_EFFECTIVE_ADDRESS %8
  671. LOAD_INTEGER
  672. POP_ebx # _common_recursion
  673. CMP
  674. SETE
  675. MOVEZBL
  676. TEST
  677. JUMP_EQ %ELSE_4
  678. RETURN
  679. JUMP %_END_IF_4
  680. :ELSE_4
  681. :_END_IF_4
  682. LOAD_EFFECTIVE_ADDRESS %4
  683. LOAD_INTEGER
  684. # looking up offset
  685. LOAD_INTEGER
  686. PUSH_eax #_process_expression1
  687. CALL_IMMEDIATE %FUNCTION_first_pass
  688. POP_ebx # _process_expression_locals
  689. # Defining local source_file
  690. LOAD_EFFECTIVE_ADDRESS %4
  691. LOAD_INTEGER
  692. # looking up offset
  693. # -> offset calculation
  694. LOAD_IMMEDIATE_ebx %4
  695. ADD_ebx_to_eax
  696. LOAD_INTEGER
  697. PUSH_eax #_process_expression1
  698. LOAD_IMMEDIATE_eax &STRING_0
  699. PUSH_eax #_process_expression2
  700. CALL_IMMEDIATE %FUNCTION_fopen
  701. POP_ebx # _process_expression_locals
  702. POP_ebx # _process_expression_locals
  703. PUSH_eax #source_file
  704. # IF_5
  705. LOAD_IMMEDIATE_eax %0
  706. PUSH_eax #_common_recursion
  707. LOAD_EFFECTIVE_ADDRESS %4
  708. LOAD_INTEGER
  709. POP_ebx # _common_recursion
  710. CMP
  711. SETE
  712. MOVEZBL
  713. TEST
  714. JUMP_EQ %ELSE_5
  715. LOAD_IMMEDIATE_eax &STRING_1
  716. PUSH_eax #_process_expression1
  717. LOAD_IMMEDIATE_eax %2
  718. PUSH_eax #_process_expression2
  719. CALL_IMMEDIATE %FUNCTION_file_print
  720. POP_ebx # _process_expression_locals
  721. POP_ebx # _process_expression_locals
  722. LOAD_EFFECTIVE_ADDRESS %8
  723. LOAD_INTEGER
  724. # looking up offset
  725. # -> offset calculation
  726. LOAD_IMMEDIATE_ebx %4
  727. ADD_ebx_to_eax
  728. LOAD_INTEGER
  729. PUSH_eax #_process_expression1
  730. LOAD_IMMEDIATE_eax %2
  731. PUSH_eax #_process_expression2
  732. CALL_IMMEDIATE %FUNCTION_file_print
  733. POP_ebx # _process_expression_locals
  734. POP_ebx # _process_expression_locals
  735. LOAD_IMMEDIATE_eax &STRING_2
  736. PUSH_eax #_process_expression1
  737. LOAD_IMMEDIATE_eax %2
  738. PUSH_eax #_process_expression2
  739. CALL_IMMEDIATE %FUNCTION_file_print
  740. POP_ebx # _process_expression_locals
  741. POP_ebx # _process_expression_locals
  742. LOAD_IMMEDIATE_eax %1
  743. PUSH_eax #_process_expression1
  744. CALL_IMMEDIATE %FUNCTION_exit
  745. POP_ebx # _process_expression_locals
  746. JUMP %_END_IF_5
  747. :ELSE_5
  748. :_END_IF_5
  749. # Defining local c
  750. PUSH_eax #c
  751. # FOR_initialization_1
  752. LOAD_EFFECTIVE_ADDRESS %0
  753. PUSH_eax #_common_recursion
  754. LOAD_EFFECTIVE_ADDRESS %8
  755. LOAD_INTEGER
  756. PUSH_eax #_process_expression1
  757. CALL_IMMEDIATE %FUNCTION_fgetc
  758. POP_ebx # _process_expression_locals
  759. POP_ebx # _common_recursion
  760. STORE_INTEGER
  761. :FOR_1
  762. LOAD_IMMEDIATE_eax %0xFFFFFFFF
  763. PUSH_eax #_common_recursion
  764. LOAD_EFFECTIVE_ADDRESS %4
  765. LOAD_INTEGER
  766. POP_ebx # _common_recursion
  767. CMP
  768. SETNE
  769. MOVEZBL
  770. TEST
  771. JUMP_EQ %FOR_END_1
  772. JUMP %FOR_THEN_1
  773. :FOR_ITER_1
  774. LOAD_EFFECTIVE_ADDRESS %0
  775. PUSH_eax #_common_recursion
  776. LOAD_EFFECTIVE_ADDRESS %8
  777. LOAD_INTEGER
  778. PUSH_eax #_process_expression1
  779. CALL_IMMEDIATE %FUNCTION_fgetc
  780. POP_ebx # _process_expression_locals
  781. POP_ebx # _common_recursion
  782. STORE_INTEGER
  783. JUMP %FOR_1
  784. :FOR_THEN_1
  785. # IF_6
  786. LOAD_IMMEDIATE_eax %58
  787. PUSH_eax #_common_recursion
  788. LOAD_EFFECTIVE_ADDRESS %4
  789. LOAD_INTEGER
  790. POP_ebx # _common_recursion
  791. CMP
  792. SETE
  793. MOVEZBL
  794. TEST
  795. JUMP_EQ %ELSE_6
  796. LOAD_EFFECTIVE_ADDRESS %4
  797. LOAD_INTEGER
  798. PUSH_eax #_process_expression1
  799. CALL_IMMEDIATE %FUNCTION_storeLabel
  800. POP_ebx # _process_expression_locals
  801. JUMP %_END_IF_6
  802. :ELSE_6
  803. # IF_7
  804. LOAD_EFFECTIVE_ADDRESS %0
  805. LOAD_INTEGER
  806. PUSH_eax #_common_recursion
  807. LOAD_IMMEDIATE_eax %35
  808. POP_ebx # _common_recursion
  809. CMP
  810. SETE
  811. MOVEZBL
  812. PUSH_eax #_common_recursion
  813. LOAD_EFFECTIVE_ADDRESS %4
  814. LOAD_INTEGER
  815. PUSH_eax #_common_recursion
  816. LOAD_IMMEDIATE_eax %59
  817. POP_ebx # _common_recursion
  818. CMP
  819. SETE
  820. MOVEZBL
  821. POP_ebx # _common_recursion
  822. OR_eax_ebx
  823. TEST
  824. JUMP_EQ %ELSE_7
  825. LOAD_EFFECTIVE_ADDRESS %4
  826. LOAD_INTEGER
  827. PUSH_eax #_process_expression1
  828. CALL_IMMEDIATE %FUNCTION_line_Comment
  829. POP_ebx # _process_expression_locals
  830. JUMP %_END_IF_7
  831. :ELSE_7
  832. # IF_8
  833. LOAD_IMMEDIATE_eax %34
  834. PUSH_eax #_common_recursion
  835. LOAD_EFFECTIVE_ADDRESS %4
  836. LOAD_INTEGER
  837. POP_ebx # _common_recursion
  838. CMP
  839. SETE
  840. MOVEZBL
  841. TEST
  842. JUMP_EQ %ELSE_8
  843. LOAD_EFFECTIVE_ADDRESS %4
  844. LOAD_INTEGER
  845. PUSH_eax #_process_expression1
  846. CALL_IMMEDIATE %FUNCTION_purge_string
  847. POP_ebx # _process_expression_locals
  848. JUMP %_END_IF_8
  849. :ELSE_8
  850. :_END_IF_8
  851. :_END_IF_7
  852. :_END_IF_6
  853. JUMP %FOR_ITER_1
  854. :FOR_END_1
  855. LOAD_EFFECTIVE_ADDRESS %4
  856. LOAD_INTEGER
  857. PUSH_eax #_process_expression1
  858. CALL_IMMEDIATE %FUNCTION_fclose
  859. POP_ebx # _process_expression_locals
  860. POP_ebx # _recursive_statement_locals
  861. POP_ebx # _recursive_statement_locals
  862. RETURN
  863. # Defining function output_debug
  864. :FUNCTION_output_debug
  865. # Defining local i
  866. PUSH_eax #i
  867. # FOR_initialization_2
  868. LOAD_EFFECTIVE_ADDRESS %0
  869. PUSH_eax #_common_recursion
  870. LOAD_EFFECTIVE_ADDRESS %16
  871. LOAD_INTEGER
  872. POP_ebx # _common_recursion
  873. STORE_INTEGER
  874. :FOR_2
  875. LOAD_IMMEDIATE_eax %0
  876. PUSH_eax #_common_recursion
  877. LOAD_EFFECTIVE_ADDRESS %4
  878. LOAD_INTEGER
  879. POP_ebx # _common_recursion
  880. CMP
  881. SETNE
  882. MOVEZBL
  883. TEST
  884. JUMP_EQ %FOR_END_2
  885. JUMP %FOR_THEN_2
  886. :FOR_ITER_2
  887. LOAD_EFFECTIVE_ADDRESS %0
  888. PUSH_eax #_common_recursion
  889. LOAD_EFFECTIVE_ADDRESS %4
  890. LOAD_INTEGER
  891. # looking up offset
  892. LOAD_INTEGER
  893. POP_ebx # _common_recursion
  894. STORE_INTEGER
  895. JUMP %FOR_2
  896. :FOR_THEN_2
  897. # IF_9
  898. LOAD_EFFECTIVE_ADDRESS %8
  899. LOAD_INTEGER
  900. TEST
  901. JUMP_EQ %ELSE_9
  902. LOAD_IMMEDIATE_eax &STRING_3
  903. PUSH_eax #_process_expression1
  904. LOAD_IMMEDIATE_eax &GLOBAL_output
  905. LOAD_INTEGER
  906. PUSH_eax #_process_expression2
  907. CALL_IMMEDIATE %FUNCTION_file_print
  908. POP_ebx # _process_expression_locals
  909. POP_ebx # _process_expression_locals
  910. LOAD_EFFECTIVE_ADDRESS %0
  911. LOAD_INTEGER
  912. # looking up offset
  913. # -> offset calculation
  914. LOAD_IMMEDIATE_ebx %4
  915. ADD_ebx_to_eax
  916. LOAD_INTEGER
  917. PUSH_eax #_process_expression1
  918. LOAD_IMMEDIATE_eax &GLOBAL_output
  919. LOAD_INTEGER
  920. PUSH_eax #_process_expression2
  921. CALL_IMMEDIATE %FUNCTION_file_print
  922. POP_ebx # _process_expression_locals
  923. POP_ebx # _process_expression_locals
  924. LOAD_IMMEDIATE_eax &STRING_4
  925. PUSH_eax #_process_expression1
  926. LOAD_IMMEDIATE_eax &GLOBAL_output
  927. LOAD_INTEGER
  928. PUSH_eax #_process_expression2
  929. CALL_IMMEDIATE %FUNCTION_file_print
  930. POP_ebx # _process_expression_locals
  931. POP_ebx # _process_expression_locals
  932. LOAD_EFFECTIVE_ADDRESS %0
  933. LOAD_INTEGER
  934. # looking up offset
  935. # -> offset calculation
  936. LOAD_IMMEDIATE_ebx %4
  937. ADD_ebx_to_eax
  938. LOAD_INTEGER
  939. PUSH_eax #_process_expression1
  940. LOAD_IMMEDIATE_eax &GLOBAL_output
  941. LOAD_INTEGER
  942. PUSH_eax #_process_expression2
  943. CALL_IMMEDIATE %FUNCTION_file_print
  944. POP_ebx # _process_expression_locals
  945. POP_ebx # _process_expression_locals
  946. LOAD_IMMEDIATE_eax &STRING_5
  947. PUSH_eax #_process_expression1
  948. LOAD_IMMEDIATE_eax &GLOBAL_output
  949. LOAD_INTEGER
  950. PUSH_eax #_process_expression2
  951. CALL_IMMEDIATE %FUNCTION_file_print
  952. POP_ebx # _process_expression_locals
  953. POP_ebx # _process_expression_locals
  954. JUMP %_END_IF_9
  955. :ELSE_9
  956. LOAD_IMMEDIATE_eax &STRING_6
  957. PUSH_eax #_process_expression1
  958. LOAD_IMMEDIATE_eax &GLOBAL_output
  959. LOAD_INTEGER
  960. PUSH_eax #_process_expression2
  961. CALL_IMMEDIATE %FUNCTION_file_print
  962. POP_ebx # _process_expression_locals
  963. POP_ebx # _process_expression_locals
  964. LOAD_EFFECTIVE_ADDRESS %0
  965. LOAD_INTEGER
  966. # looking up offset
  967. # -> offset calculation
  968. LOAD_IMMEDIATE_ebx %4
  969. ADD_ebx_to_eax
  970. LOAD_INTEGER
  971. PUSH_eax #_process_expression1
  972. LOAD_IMMEDIATE_eax &GLOBAL_output
  973. LOAD_INTEGER
  974. PUSH_eax #_process_expression2
  975. CALL_IMMEDIATE %FUNCTION_file_print
  976. POP_ebx # _process_expression_locals
  977. POP_ebx # _process_expression_locals
  978. LOAD_IMMEDIATE_eax &STRING_7
  979. PUSH_eax #_process_expression1
  980. LOAD_IMMEDIATE_eax &GLOBAL_output
  981. LOAD_INTEGER
  982. PUSH_eax #_process_expression2
  983. CALL_IMMEDIATE %FUNCTION_file_print
  984. POP_ebx # _process_expression_locals
  985. POP_ebx # _process_expression_locals
  986. LOAD_EFFECTIVE_ADDRESS %0
  987. LOAD_INTEGER
  988. # looking up offset
  989. # -> offset calculation
  990. LOAD_IMMEDIATE_ebx %4
  991. ADD_ebx_to_eax
  992. LOAD_INTEGER
  993. PUSH_eax #_process_expression1
  994. LOAD_IMMEDIATE_eax &GLOBAL_output
  995. LOAD_INTEGER
  996. PUSH_eax #_process_expression2
  997. CALL_IMMEDIATE %FUNCTION_file_print
  998. POP_ebx # _process_expression_locals
  999. POP_ebx # _process_expression_locals
  1000. LOAD_IMMEDIATE_eax &STRING_8
  1001. PUSH_eax #_process_expression1
  1002. LOAD_IMMEDIATE_eax &GLOBAL_output
  1003. LOAD_INTEGER
  1004. PUSH_eax #_process_expression2
  1005. CALL_IMMEDIATE %FUNCTION_file_print
  1006. POP_ebx # _process_expression_locals
  1007. POP_ebx # _process_expression_locals
  1008. :_END_IF_9
  1009. JUMP %FOR_ITER_2
  1010. :FOR_END_2
  1011. POP_ebx # _recursive_statement_locals
  1012. RETURN
  1013. # Defining function reverse_list
  1014. :FUNCTION_reverse_list
  1015. # Defining local root
  1016. LOAD_IMMEDIATE_eax %0
  1017. PUSH_eax #root
  1018. # Defining local next
  1019. PUSH_eax #next
  1020. :WHILE_3
  1021. LOAD_IMMEDIATE_eax %0
  1022. PUSH_eax #_common_recursion
  1023. LOAD_EFFECTIVE_ADDRESS %16
  1024. LOAD_INTEGER
  1025. POP_ebx # _common_recursion
  1026. CMP
  1027. SETNE
  1028. MOVEZBL
  1029. TEST
  1030. JUMP_EQ %END_WHILE_3
  1031. # THEN_while_3
  1032. LOAD_EFFECTIVE_ADDRESS %0
  1033. PUSH_eax #_common_recursion
  1034. LOAD_EFFECTIVE_ADDRESS %16
  1035. LOAD_INTEGER
  1036. # looking up offset
  1037. LOAD_INTEGER
  1038. POP_ebx # _common_recursion
  1039. STORE_INTEGER
  1040. LOAD_EFFECTIVE_ADDRESS %12
  1041. LOAD_INTEGER
  1042. # looking up offset
  1043. PUSH_eax #_common_recursion
  1044. LOAD_EFFECTIVE_ADDRESS %8
  1045. LOAD_INTEGER
  1046. POP_ebx # _common_recursion
  1047. STORE_INTEGER
  1048. LOAD_EFFECTIVE_ADDRESS %4
  1049. PUSH_eax #_common_recursion
  1050. LOAD_EFFECTIVE_ADDRESS %16
  1051. LOAD_INTEGER
  1052. POP_ebx # _common_recursion
  1053. STORE_INTEGER
  1054. LOAD_EFFECTIVE_ADDRESS %12
  1055. PUSH_eax #_common_recursion
  1056. LOAD_EFFECTIVE_ADDRESS %4
  1057. LOAD_INTEGER
  1058. POP_ebx # _common_recursion
  1059. STORE_INTEGER
  1060. JUMP %WHILE_3
  1061. :END_WHILE_3
  1062. LOAD_EFFECTIVE_ADDRESS %4
  1063. LOAD_INTEGER
  1064. POP_ebx # _return_result_locals
  1065. POP_ebx # _return_result_locals
  1066. RETURN
  1067. # Defining function main
  1068. :FUNCTION_main
  1069. LOAD_IMMEDIATE_eax &GLOBAL_jump_table
  1070. PUSH_eax #_common_recursion
  1071. LOAD_IMMEDIATE_eax %0
  1072. POP_ebx # _common_recursion
  1073. STORE_INTEGER
  1074. # Defining local input
  1075. LOAD_IMMEDIATE_eax %0
  1076. PUSH_eax #input
  1077. LOAD_IMMEDIATE_eax &GLOBAL_output
  1078. PUSH_eax #_common_recursion
  1079. LOAD_IMMEDIATE_eax %1
  1080. POP_ebx # _common_recursion
  1081. STORE_INTEGER
  1082. # Defining local output_file
  1083. LOAD_IMMEDIATE_eax &STRING_9
  1084. PUSH_eax #output_file
  1085. # Defining local option_index
  1086. LOAD_IMMEDIATE_eax %1
  1087. PUSH_eax #option_index
  1088. :WHILE_4
  1089. LOAD_EFFECTIVE_ADDRESS %0
  1090. LOAD_INTEGER
  1091. PUSH_eax #_common_recursion
  1092. LOAD_EFFECTIVE_ADDRESS %20
  1093. LOAD_INTEGER
  1094. POP_ebx # _common_recursion
  1095. CMP
  1096. SETLE
  1097. MOVEZBL
  1098. TEST
  1099. JUMP_EQ %END_WHILE_4
  1100. # THEN_while_4
  1101. # IF_10
  1102. LOAD_IMMEDIATE_eax %0
  1103. PUSH_eax #_common_recursion
  1104. LOAD_EFFECTIVE_ADDRESS %24
  1105. PUSH_eax #_common_recursion
  1106. LOAD_EFFECTIVE_ADDRESS %8
  1107. LOAD_INTEGER
  1108. POP_ebx # _common_recursion
  1109. SAL_eax_Immediate8 !2
  1110. ADD_ebx_to_eax
  1111. LOAD_INTEGER
  1112. POP_ebx # _common_recursion
  1113. CMP
  1114. SETE
  1115. MOVEZBL
  1116. TEST
  1117. JUMP_EQ %ELSE_10
  1118. LOAD_EFFECTIVE_ADDRESS %0
  1119. PUSH_eax #_common_recursion
  1120. LOAD_EFFECTIVE_ADDRESS %4
  1121. LOAD_INTEGER
  1122. PUSH_eax #_common_recursion
  1123. LOAD_IMMEDIATE_eax %1
  1124. POP_ebx # _common_recursion
  1125. ADD_ebx_to_eax
  1126. POP_ebx # _common_recursion
  1127. STORE_INTEGER
  1128. JUMP %_END_IF_10
  1129. :ELSE_10
  1130. # IF_11
  1131. LOAD_EFFECTIVE_ADDRESS %20
  1132. PUSH_eax #_common_recursion
  1133. LOAD_EFFECTIVE_ADDRESS %4
  1134. LOAD_INTEGER
  1135. POP_ebx # _common_recursion
  1136. SAL_eax_Immediate8 !2
  1137. ADD_ebx_to_eax
  1138. LOAD_INTEGER
  1139. PUSH_eax #_process_expression1
  1140. LOAD_IMMEDIATE_eax &STRING_10
  1141. PUSH_eax #_process_expression2
  1142. CALL_IMMEDIATE %FUNCTION_match
  1143. POP_ebx # _process_expression_locals
  1144. POP_ebx # _process_expression_locals
  1145. PUSH_eax #_common_recursion
  1146. LOAD_EFFECTIVE_ADDRESS %24
  1147. PUSH_eax #_common_recursion
  1148. LOAD_EFFECTIVE_ADDRESS %8
  1149. LOAD_INTEGER
  1150. POP_ebx # _common_recursion
  1151. SAL_eax_Immediate8 !2
  1152. ADD_ebx_to_eax
  1153. LOAD_INTEGER
  1154. PUSH_eax #_process_expression1
  1155. LOAD_IMMEDIATE_eax &STRING_11
  1156. PUSH_eax #_process_expression2
  1157. CALL_IMMEDIATE %FUNCTION_match
  1158. POP_ebx # _process_expression_locals
  1159. POP_ebx # _process_expression_locals
  1160. POP_ebx # _common_recursion
  1161. OR_eax_ebx
  1162. TEST
  1163. JUMP_EQ %ELSE_11
  1164. LOAD_IMMEDIATE_eax &STRING_12
  1165. PUSH_eax #_process_expression1
  1166. LOAD_IMMEDIATE_eax %2
  1167. PUSH_eax #_process_expression2
  1168. CALL_IMMEDIATE %FUNCTION_file_print
  1169. POP_ebx # _process_expression_locals
  1170. POP_ebx # _process_expression_locals
  1171. LOAD_EFFECTIVE_ADDRESS %20
  1172. PUSH_eax #_common_recursion
  1173. LOAD_IMMEDIATE_eax %0
  1174. POP_ebx # _common_recursion
  1175. SAL_eax_Immediate8 !2
  1176. ADD_ebx_to_eax
  1177. LOAD_INTEGER
  1178. PUSH_eax #_process_expression1
  1179. LOAD_IMMEDIATE_eax %2
  1180. PUSH_eax #_process_expression2
  1181. CALL_IMMEDIATE %FUNCTION_file_print
  1182. POP_ebx # _process_expression_locals
  1183. POP_ebx # _process_expression_locals
  1184. LOAD_IMMEDIATE_eax &STRING_13
  1185. PUSH_eax #_process_expression1
  1186. LOAD_IMMEDIATE_eax %2
  1187. PUSH_eax #_process_expression2
  1188. CALL_IMMEDIATE %FUNCTION_file_print
  1189. POP_ebx # _process_expression_locals
  1190. POP_ebx # _process_expression_locals
  1191. LOAD_IMMEDIATE_eax %0
  1192. PUSH_eax #_process_expression1
  1193. CALL_IMMEDIATE %FUNCTION_exit
  1194. POP_ebx # _process_expression_locals
  1195. JUMP %_END_IF_11
  1196. :ELSE_11
  1197. # IF_12
  1198. LOAD_EFFECTIVE_ADDRESS %20
  1199. PUSH_eax #_common_recursion
  1200. LOAD_EFFECTIVE_ADDRESS %4
  1201. LOAD_INTEGER
  1202. POP_ebx # _common_recursion
  1203. SAL_eax_Immediate8 !2
  1204. ADD_ebx_to_eax
  1205. LOAD_INTEGER
  1206. PUSH_eax #_process_expression1
  1207. LOAD_IMMEDIATE_eax &STRING_14
  1208. PUSH_eax #_process_expression2
  1209. CALL_IMMEDIATE %FUNCTION_match
  1210. POP_ebx # _process_expression_locals
  1211. POP_ebx # _process_expression_locals
  1212. PUSH_eax #_common_recursion
  1213. LOAD_EFFECTIVE_ADDRESS %24
  1214. PUSH_eax #_common_recursion
  1215. LOAD_EFFECTIVE_ADDRESS %8
  1216. LOAD_INTEGER
  1217. POP_ebx # _common_recursion
  1218. SAL_eax_Immediate8 !2
  1219. ADD_ebx_to_eax
  1220. LOAD_INTEGER
  1221. PUSH_eax #_process_expression1
  1222. LOAD_IMMEDIATE_eax &STRING_15
  1223. PUSH_eax #_process_expression2
  1224. CALL_IMMEDIATE %FUNCTION_match
  1225. POP_ebx # _process_expression_locals
  1226. POP_ebx # _process_expression_locals
  1227. POP_ebx # _common_recursion
  1228. OR_eax_ebx
  1229. TEST
  1230. JUMP_EQ %ELSE_12
  1231. # Defining local temp
  1232. LOAD_IMMEDIATE_eax %1
  1233. PUSH_eax #_process_expression1
  1234. LOAD_IMMEDIATE_eax %8
  1235. PUSH_eax #_process_expression2
  1236. CALL_IMMEDIATE %FUNCTION_calloc
  1237. POP_ebx # _process_expression_locals
  1238. POP_ebx # _process_expression_locals
  1239. PUSH_eax #temp
  1240. LOAD_EFFECTIVE_ADDRESS %0
  1241. LOAD_INTEGER
  1242. # looking up offset
  1243. # -> offset calculation
  1244. LOAD_IMMEDIATE_ebx %4
  1245. ADD_ebx_to_eax
  1246. PUSH_eax #_common_recursion
  1247. LOAD_EFFECTIVE_ADDRESS %28
  1248. PUSH_eax #_common_recursion
  1249. LOAD_EFFECTIVE_ADDRESS %12
  1250. LOAD_INTEGER
  1251. PUSH_eax #_common_recursion
  1252. LOAD_IMMEDIATE_eax %1
  1253. POP_ebx # _common_recursion
  1254. ADD_ebx_to_eax
  1255. POP_ebx # _common_recursion
  1256. SAL_eax_Immediate8 !2
  1257. ADD_ebx_to_eax
  1258. LOAD_INTEGER
  1259. POP_ebx # _common_recursion
  1260. STORE_INTEGER
  1261. LOAD_EFFECTIVE_ADDRESS %0
  1262. LOAD_INTEGER
  1263. # looking up offset
  1264. PUSH_eax #_common_recursion
  1265. LOAD_EFFECTIVE_ADDRESS %16
  1266. LOAD_INTEGER
  1267. POP_ebx # _common_recursion
  1268. STORE_INTEGER
  1269. LOAD_EFFECTIVE_ADDRESS %12
  1270. PUSH_eax #_common_recursion
  1271. LOAD_EFFECTIVE_ADDRESS %4
  1272. LOAD_INTEGER
  1273. POP_ebx # _common_recursion
  1274. STORE_INTEGER
  1275. LOAD_EFFECTIVE_ADDRESS %4
  1276. PUSH_eax #_common_recursion
  1277. LOAD_EFFECTIVE_ADDRESS %8
  1278. LOAD_INTEGER
  1279. PUSH_eax #_common_recursion
  1280. LOAD_IMMEDIATE_eax %2
  1281. POP_ebx # _common_recursion
  1282. ADD_ebx_to_eax
  1283. POP_ebx # _common_recursion
  1284. STORE_INTEGER
  1285. POP_ebx # _recursive_statement_locals
  1286. JUMP %_END_IF_12
  1287. :ELSE_12
  1288. # IF_13
  1289. LOAD_EFFECTIVE_ADDRESS %20
  1290. PUSH_eax #_common_recursion
  1291. LOAD_EFFECTIVE_ADDRESS %4
  1292. LOAD_INTEGER
  1293. POP_ebx # _common_recursion
  1294. SAL_eax_Immediate8 !2
  1295. ADD_ebx_to_eax
  1296. LOAD_INTEGER
  1297. PUSH_eax #_process_expression1
  1298. LOAD_IMMEDIATE_eax &STRING_16
  1299. PUSH_eax #_process_expression2
  1300. CALL_IMMEDIATE %FUNCTION_match
  1301. POP_ebx # _process_expression_locals
  1302. POP_ebx # _process_expression_locals
  1303. PUSH_eax #_common_recursion
  1304. LOAD_EFFECTIVE_ADDRESS %24
  1305. PUSH_eax #_common_recursion
  1306. LOAD_EFFECTIVE_ADDRESS %8
  1307. LOAD_INTEGER
  1308. POP_ebx # _common_recursion
  1309. SAL_eax_Immediate8 !2
  1310. ADD_ebx_to_eax
  1311. LOAD_INTEGER
  1312. PUSH_eax #_process_expression1
  1313. LOAD_IMMEDIATE_eax &STRING_17
  1314. PUSH_eax #_process_expression2
  1315. CALL_IMMEDIATE %FUNCTION_match
  1316. POP_ebx # _process_expression_locals
  1317. POP_ebx # _process_expression_locals
  1318. POP_ebx # _common_recursion
  1319. OR_eax_ebx
  1320. TEST
  1321. JUMP_EQ %ELSE_13
  1322. LOAD_EFFECTIVE_ADDRESS %4
  1323. PUSH_eax #_common_recursion
  1324. LOAD_EFFECTIVE_ADDRESS %24
  1325. PUSH_eax #_common_recursion
  1326. LOAD_EFFECTIVE_ADDRESS %8
  1327. LOAD_INTEGER
  1328. PUSH_eax #_common_recursion
  1329. LOAD_IMMEDIATE_eax %1
  1330. POP_ebx # _common_recursion
  1331. ADD_ebx_to_eax
  1332. POP_ebx # _common_recursion
  1333. SAL_eax_Immediate8 !2
  1334. ADD_ebx_to_eax
  1335. LOAD_INTEGER
  1336. POP_ebx # _common_recursion
  1337. STORE_INTEGER
  1338. LOAD_IMMEDIATE_eax &GLOBAL_output
  1339. PUSH_eax #_common_recursion
  1340. LOAD_EFFECTIVE_ADDRESS %8
  1341. LOAD_INTEGER
  1342. PUSH_eax #_process_expression1
  1343. LOAD_IMMEDIATE_eax &STRING_18
  1344. PUSH_eax #_process_expression2
  1345. CALL_IMMEDIATE %FUNCTION_fopen
  1346. POP_ebx # _process_expression_locals
  1347. POP_ebx # _process_expression_locals
  1348. POP_ebx # _common_recursion
  1349. STORE_INTEGER
  1350. # IF_14
  1351. LOAD_IMMEDIATE_eax %0
  1352. PUSH_eax #_common_recursion
  1353. LOAD_IMMEDIATE_eax &GLOBAL_output
  1354. LOAD_INTEGER
  1355. POP_ebx # _common_recursion
  1356. CMP
  1357. SETE
  1358. MOVEZBL
  1359. TEST
  1360. JUMP_EQ %ELSE_14
  1361. LOAD_IMMEDIATE_eax &STRING_19
  1362. PUSH_eax #_process_expression1
  1363. LOAD_IMMEDIATE_eax %2
  1364. PUSH_eax #_process_expression2
  1365. CALL_IMMEDIATE %FUNCTION_file_print
  1366. POP_ebx # _process_expression_locals
  1367. POP_ebx # _process_expression_locals
  1368. LOAD_EFFECTIVE_ADDRESS %8
  1369. LOAD_INTEGER
  1370. # looking up offset
  1371. # -> offset calculation
  1372. LOAD_IMMEDIATE_ebx %4
  1373. ADD_ebx_to_eax
  1374. LOAD_INTEGER
  1375. PUSH_eax #_process_expression1
  1376. LOAD_IMMEDIATE_eax %2
  1377. PUSH_eax #_process_expression2
  1378. CALL_IMMEDIATE %FUNCTION_file_print
  1379. POP_ebx # _process_expression_locals
  1380. POP_ebx # _process_expression_locals
  1381. LOAD_IMMEDIATE_eax &STRING_20
  1382. PUSH_eax #_process_expression1
  1383. LOAD_IMMEDIATE_eax %2
  1384. PUSH_eax #_process_expression2
  1385. CALL_IMMEDIATE %FUNCTION_file_print
  1386. POP_ebx # _process_expression_locals
  1387. POP_ebx # _process_expression_locals
  1388. LOAD_IMMEDIATE_eax %1
  1389. PUSH_eax #_process_expression1
  1390. CALL_IMMEDIATE %FUNCTION_exit
  1391. POP_ebx # _process_expression_locals
  1392. JUMP %_END_IF_14
  1393. :ELSE_14
  1394. :_END_IF_14
  1395. LOAD_EFFECTIVE_ADDRESS %0
  1396. PUSH_eax #_common_recursion
  1397. LOAD_EFFECTIVE_ADDRESS %4
  1398. LOAD_INTEGER
  1399. PUSH_eax #_common_recursion
  1400. LOAD_IMMEDIATE_eax %2
  1401. POP_ebx # _common_recursion
  1402. ADD_ebx_to_eax
  1403. POP_ebx # _common_recursion
  1404. STORE_INTEGER
  1405. JUMP %_END_IF_13
  1406. :ELSE_13
  1407. # IF_15
  1408. LOAD_EFFECTIVE_ADDRESS %20
  1409. PUSH_eax #_common_recursion
  1410. LOAD_EFFECTIVE_ADDRESS %4
  1411. LOAD_INTEGER
  1412. POP_ebx # _common_recursion
  1413. SAL_eax_Immediate8 !2
  1414. ADD_ebx_to_eax
  1415. LOAD_INTEGER
  1416. PUSH_eax #_process_expression1
  1417. LOAD_IMMEDIATE_eax &STRING_21
  1418. PUSH_eax #_process_expression2
  1419. CALL_IMMEDIATE %FUNCTION_match
  1420. POP_ebx # _process_expression_locals
  1421. POP_ebx # _process_expression_locals
  1422. PUSH_eax #_common_recursion
  1423. LOAD_EFFECTIVE_ADDRESS %24
  1424. PUSH_eax #_common_recursion
  1425. LOAD_EFFECTIVE_ADDRESS %8
  1426. LOAD_INTEGER
  1427. POP_ebx # _common_recursion
  1428. SAL_eax_Immediate8 !2
  1429. ADD_ebx_to_eax
  1430. LOAD_INTEGER
  1431. PUSH_eax #_process_expression1
  1432. LOAD_IMMEDIATE_eax &STRING_22
  1433. PUSH_eax #_process_expression2
  1434. CALL_IMMEDIATE %FUNCTION_match
  1435. POP_ebx # _process_expression_locals
  1436. POP_ebx # _process_expression_locals
  1437. POP_ebx # _common_recursion
  1438. OR_eax_ebx
  1439. TEST
  1440. JUMP_EQ %ELSE_15
  1441. LOAD_IMMEDIATE_eax &STRING_23
  1442. PUSH_eax #_process_expression1
  1443. LOAD_IMMEDIATE_eax %1
  1444. PUSH_eax #_process_expression2
  1445. CALL_IMMEDIATE %FUNCTION_file_print
  1446. POP_ebx # _process_expression_locals
  1447. POP_ebx # _process_expression_locals
  1448. LOAD_IMMEDIATE_eax %0
  1449. PUSH_eax #_process_expression1
  1450. CALL_IMMEDIATE %FUNCTION_exit
  1451. POP_ebx # _process_expression_locals
  1452. JUMP %_END_IF_15
  1453. :ELSE_15
  1454. LOAD_IMMEDIATE_eax &STRING_24
  1455. PUSH_eax #_process_expression1
  1456. LOAD_IMMEDIATE_eax %2
  1457. PUSH_eax #_process_expression2
  1458. CALL_IMMEDIATE %FUNCTION_file_print
  1459. POP_ebx # _process_expression_locals
  1460. POP_ebx # _process_expression_locals
  1461. LOAD_IMMEDIATE_eax %1
  1462. PUSH_eax #_process_expression1
  1463. CALL_IMMEDIATE %FUNCTION_exit
  1464. POP_ebx # _process_expression_locals
  1465. :_END_IF_15
  1466. :_END_IF_13
  1467. :_END_IF_12
  1468. :_END_IF_11
  1469. :_END_IF_10
  1470. JUMP %WHILE_4
  1471. :END_WHILE_4
  1472. # IF_16
  1473. LOAD_IMMEDIATE_eax %0
  1474. PUSH_eax #_common_recursion
  1475. LOAD_EFFECTIVE_ADDRESS %12
  1476. LOAD_INTEGER
  1477. POP_ebx # _common_recursion
  1478. CMP
  1479. SETE
  1480. MOVEZBL
  1481. TEST
  1482. JUMP_EQ %ELSE_16
  1483. LOAD_IMMEDIATE_eax %1
  1484. POP_ebx # _return_result_locals
  1485. POP_ebx # _return_result_locals
  1486. POP_ebx # _return_result_locals
  1487. RETURN
  1488. JUMP %_END_IF_16
  1489. :ELSE_16
  1490. :_END_IF_16
  1491. LOAD_EFFECTIVE_ADDRESS %8
  1492. LOAD_INTEGER
  1493. PUSH_eax #_process_expression1
  1494. CALL_IMMEDIATE %FUNCTION_first_pass
  1495. POP_ebx # _process_expression_locals
  1496. LOAD_IMMEDIATE_eax &GLOBAL_jump_table
  1497. PUSH_eax #_common_recursion
  1498. LOAD_IMMEDIATE_eax &GLOBAL_jump_table
  1499. LOAD_INTEGER
  1500. PUSH_eax #_process_expression1
  1501. CALL_IMMEDIATE %FUNCTION_reverse_list
  1502. POP_ebx # _process_expression_locals
  1503. POP_ebx # _common_recursion
  1504. STORE_INTEGER
  1505. LOAD_IMMEDIATE_eax &STRING_25
  1506. PUSH_eax #_process_expression1
  1507. LOAD_IMMEDIATE_eax &GLOBAL_output
  1508. LOAD_INTEGER
  1509. PUSH_eax #_process_expression2
  1510. CALL_IMMEDIATE %FUNCTION_file_print
  1511. POP_ebx # _process_expression_locals
  1512. POP_ebx # _process_expression_locals
  1513. LOAD_IMMEDIATE_eax &GLOBAL_jump_table
  1514. LOAD_INTEGER
  1515. PUSH_eax #_process_expression1
  1516. LOAD_IMMEDIATE_eax %1
  1517. PUSH_eax #_process_expression2
  1518. CALL_IMMEDIATE %FUNCTION_output_debug
  1519. POP_ebx # _process_expression_locals
  1520. POP_ebx # _process_expression_locals
  1521. LOAD_IMMEDIATE_eax &STRING_26
  1522. PUSH_eax #_process_expression1
  1523. LOAD_IMMEDIATE_eax &GLOBAL_output
  1524. LOAD_INTEGER
  1525. PUSH_eax #_process_expression2
  1526. CALL_IMMEDIATE %FUNCTION_file_print
  1527. POP_ebx # _process_expression_locals
  1528. POP_ebx # _process_expression_locals
  1529. LOAD_IMMEDIATE_eax &GLOBAL_jump_table
  1530. LOAD_INTEGER
  1531. PUSH_eax #_process_expression1
  1532. LOAD_IMMEDIATE_eax %0
  1533. PUSH_eax #_process_expression2
  1534. CALL_IMMEDIATE %FUNCTION_output_debug
  1535. POP_ebx # _process_expression_locals
  1536. POP_ebx # _process_expression_locals
  1537. LOAD_IMMEDIATE_eax &STRING_27
  1538. PUSH_eax #_process_expression1
  1539. LOAD_IMMEDIATE_eax &GLOBAL_output
  1540. LOAD_INTEGER
  1541. PUSH_eax #_process_expression2
  1542. CALL_IMMEDIATE %FUNCTION_file_print
  1543. POP_ebx # _process_expression_locals
  1544. POP_ebx # _process_expression_locals
  1545. LOAD_IMMEDIATE_eax %0
  1546. POP_ebx # _return_result_locals
  1547. POP_ebx # _return_result_locals
  1548. POP_ebx # _return_result_locals
  1549. RETURN
  1550. # Program global variables
  1551. :GLOBAL_output
  1552. NULL
  1553. :GLOBAL_jump_table
  1554. NULL
  1555. # Program strings
  1556. :STRING_0
  1557. "r"
  1558. :STRING_1
  1559. "The file: "
  1560. :STRING_2
  1561. " can not be opened!
  1562. "
  1563. :STRING_3
  1564. ' 3A 45 4C 46 5F 73 74 72 5F 00'
  1565. :STRING_4
  1566. ' 0A 22 00'
  1567. :STRING_5
  1568. ' 22 0A 00'
  1569. :STRING_6
  1570. "%ELF_str_"
  1571. :STRING_7
  1572. ">ELF_str
  1573. &"
  1574. :STRING_8
  1575. "
  1576. %10000
  1577. !2
  1578. !0
  1579. @1
  1580. "
  1581. :STRING_9
  1582. ""
  1583. :STRING_10
  1584. "-h"
  1585. :STRING_11
  1586. "--help"
  1587. :STRING_12
  1588. "Usage: "
  1589. :STRING_13
  1590. " -f FILENAME1 {-f FILENAME2}
  1591. "
  1592. :STRING_14
  1593. "-f"
  1594. :STRING_15
  1595. "--file"
  1596. :STRING_16
  1597. "-o"
  1598. :STRING_17
  1599. "--output"
  1600. :STRING_18
  1601. "w"
  1602. :STRING_19
  1603. "The file: "
  1604. :STRING_20
  1605. " can not be opened!
  1606. "
  1607. :STRING_21
  1608. "-V"
  1609. :STRING_22
  1610. "--version"
  1611. :STRING_23
  1612. "blood-elf 0.1
  1613. (Basically Launches Odd Object Dump ExecutabLe Files
  1614. "
  1615. :STRING_24
  1616. "Unknown option
  1617. "
  1618. :STRING_25
  1619. ' 3A 45 4C 46 5F 73 74 72 0A 21 30 0A 00'
  1620. :STRING_26
  1621. ' 25 30 0A 3A 45 4C 46 5F 73 79 6D 0A 25 30 0A 25 30 0A 25 30 0A 21 30 0A 21 30 0A 40 31 0A 00'
  1622. :STRING_27
  1623. ' 0A 3A 45 4C 46 5F 65 6E 64 0A 00'
  1624. :ELF_end