Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 22nd, 2010  |  syntax: ASM (NASM)  |  size: 5.36 KB  |  views: 126  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ; This code has been generated by the 7Basic
  2. ; compiler <http://launchpad.net/7basic>
  3.  
  4. extern printf
  5. extern scanf
  6. extern read
  7. extern strlen
  8. extern strcat
  9. extern strcpy
  10. extern strcmp
  11. extern malloc
  12. extern free
  13.  
  14. ; Initialized data
  15.  
  16.       SECTION .data
  17. f_0 dq 4.500000000
  18. f_1 dq 78.999000549
  19. f_2 dq 12.344400406
  20. f_3 dq 4.500000000
  21. f_4 dq 78.999000549
  22. f_5 dq 12.344400406
  23. f_6 dq 4.500000000
  24. f_7 dq 78.999000549
  25. f_8 dq 12.344400406
  26. s_9 db "All done!",0
  27. printf_i: db "%d",10,0
  28. printf_s: db "%s",10,0
  29. printf_f: db "%f",10,0
  30. scanf_i: db "%d",0
  31. scanf_f: db "%lf",0
  32. ; Uninitialized data
  33.  
  34.       SECTION .bss
  35. v_0 resb 4
  36. v_4 resb 4
  37. v_8 resb 8
  38. tstr resb 4
  39. tfl  resb 8
  40.  
  41.       SECTION .text
  42.  
  43. ; Code
  44.  
  45. global main
  46.   main:
  47. finit
  48. push ebp
  49. mov ebp,esp
  50. push 0
  51. pop eax
  52. mov [v_0], eax
  53. push 0
  54. pop eax
  55. mov [v_4], eax
  56.     l_0:
  57. mov eax, [v_0]
  58. push eax
  59. push 5000000
  60. pop ebx
  61. pop eax
  62. cmp eax,ebx
  63. jl l_2
  64. push 0
  65. jmp l_3
  66.     l_2:
  67. push 1
  68. jmp l_3
  69.     l_3:
  70. pop eax
  71. cmp eax,0
  72. jne l_4
  73. jmp l_1
  74.     l_4:
  75. mov eax, [v_4]
  76. push eax
  77. push 100000
  78. pop ebx
  79. pop eax
  80. cmp eax,ebx
  81. je l_5
  82. push 0
  83. jmp l_6
  84.     l_5:
  85. push 1
  86. jmp l_6
  87.     l_6:
  88. pop eax
  89. cmp eax,0
  90. jne l_8
  91. jmp l_7
  92.     l_8:
  93. mov eax, [v_0]
  94. push eax
  95. push printf_i
  96. call printf
  97. add esp,8
  98. push 0
  99. pop eax
  100. mov [v_4], eax
  101.     l_7:
  102. push 3
  103. push dword [f_0+4]
  104. push dword [f_0]
  105. pop ebx
  106. pop ecx
  107. pop dword [tfl]
  108. fild dword [tfl]
  109. fstp qword [tfl]
  110. push dword [tfl+4]
  111. push dword [tfl]
  112. push ecx
  113. push ebx
  114. pop dword [tfl]
  115. pop dword [tfl+4]
  116. fld qword [tfl]
  117. pop dword [tfl]
  118. pop dword [tfl+4]
  119. fld qword [tfl]
  120. fmulp ST1,ST0
  121. fstp qword [tfl]
  122. push dword [tfl+4]
  123. push dword [tfl]
  124. push 12
  125. pop dword [tfl]
  126. fild dword [tfl]
  127. fstp qword [tfl]
  128. push dword [tfl+4]
  129. push dword [tfl]
  130. pop dword [tfl]
  131. pop dword [tfl+4]
  132. fld qword [tfl]
  133. pop dword [tfl]
  134. pop dword [tfl+4]
  135. fld qword [tfl]
  136. fdivrp ST1,ST0
  137. fstp qword [tfl]
  138. push dword [tfl+4]
  139. push dword [tfl]
  140. push 34
  141. push dword [f_1+4]
  142. push dword [f_1]
  143. pop ebx
  144. pop ecx
  145. pop dword [tfl]
  146. fild dword [tfl]
  147. fstp qword [tfl]
  148. push dword [tfl+4]
  149. push dword [tfl]
  150. push ecx
  151. push ebx
  152. pop dword [tfl]
  153. pop dword [tfl+4]
  154. fld qword [tfl]
  155. pop dword [tfl]
  156. pop dword [tfl+4]
  157. fld qword [tfl]
  158. fmulp ST1,ST0
  159. fstp qword [tfl]
  160. push dword [tfl+4]
  161. push dword [tfl]
  162. push dword [f_2+4]
  163. push dword [f_2]
  164. pop dword [tfl]
  165. pop dword [tfl+4]
  166. fld qword [tfl]
  167. pop dword [tfl]
  168. pop dword [tfl+4]
  169. fld qword [tfl]
  170. fdivrp ST1,ST0
  171. fstp qword [tfl]
  172. push dword [tfl+4]
  173. push dword [tfl]
  174. pop dword [tfl]
  175. pop dword [tfl+4]
  176. fld qword [tfl]
  177. pop dword [tfl]
  178. pop dword [tfl+4]
  179. fld qword [tfl]
  180. faddp ST1,ST0
  181. fstp qword [tfl]
  182. push dword [tfl+4]
  183. push dword [tfl]
  184. pop dword [v_8]
  185. pop dword [v_8+4]
  186. push 3
  187. push dword [f_3+4]
  188. push dword [f_3]
  189. pop ebx
  190. pop ecx
  191. pop dword [tfl]
  192. fild dword [tfl]
  193. fstp qword [tfl]
  194. push dword [tfl+4]
  195. push dword [tfl]
  196. push ecx
  197. push ebx
  198. pop dword [tfl]
  199. pop dword [tfl+4]
  200. fld qword [tfl]
  201. pop dword [tfl]
  202. pop dword [tfl+4]
  203. fld qword [tfl]
  204. fmulp ST1,ST0
  205. fstp qword [tfl]
  206. push dword [tfl+4]
  207. push dword [tfl]
  208. push 12
  209. pop dword [tfl]
  210. fild dword [tfl]
  211. fstp qword [tfl]
  212. push dword [tfl+4]
  213. push dword [tfl]
  214. pop dword [tfl]
  215. pop dword [tfl+4]
  216. fld qword [tfl]
  217. pop dword [tfl]
  218. pop dword [tfl+4]
  219. fld qword [tfl]
  220. fdivrp ST1,ST0
  221. fstp qword [tfl]
  222. push dword [tfl+4]
  223. push dword [tfl]
  224. push 34
  225. push dword [f_4+4]
  226. push dword [f_4]
  227. pop ebx
  228. pop ecx
  229. pop dword [tfl]
  230. fild dword [tfl]
  231. fstp qword [tfl]
  232. push dword [tfl+4]
  233. push dword [tfl]
  234. push ecx
  235. push ebx
  236. pop dword [tfl]
  237. pop dword [tfl+4]
  238. fld qword [tfl]
  239. pop dword [tfl]
  240. pop dword [tfl+4]
  241. fld qword [tfl]
  242. fmulp ST1,ST0
  243. fstp qword [tfl]
  244. push dword [tfl+4]
  245. push dword [tfl]
  246. push dword [f_5+4]
  247. push dword [f_5]
  248. pop dword [tfl]
  249. pop dword [tfl+4]
  250. fld qword [tfl]
  251. pop dword [tfl]
  252. pop dword [tfl+4]
  253. fld qword [tfl]
  254. fdivrp ST1,ST0
  255. fstp qword [tfl]
  256. push dword [tfl+4]
  257. push dword [tfl]
  258. pop dword [tfl]
  259. pop dword [tfl+4]
  260. fld qword [tfl]
  261. pop dword [tfl]
  262. pop dword [tfl+4]
  263. fld qword [tfl]
  264. faddp ST1,ST0
  265. fstp qword [tfl]
  266. push dword [tfl+4]
  267. push dword [tfl]
  268. pop dword [v_8]
  269. pop dword [v_8+4]
  270. push 3
  271. push dword [f_6+4]
  272. push dword [f_6]
  273. pop ebx
  274. pop ecx
  275. pop dword [tfl]
  276. fild dword [tfl]
  277. fstp qword [tfl]
  278. push dword [tfl+4]
  279. push dword [tfl]
  280. push ecx
  281. push ebx
  282. pop dword [tfl]
  283. pop dword [tfl+4]
  284. fld qword [tfl]
  285. pop dword [tfl]
  286. pop dword [tfl+4]
  287. fld qword [tfl]
  288. fmulp ST1,ST0
  289. fstp qword [tfl]
  290. push dword [tfl+4]
  291. push dword [tfl]
  292. push 12
  293. pop dword [tfl]
  294. fild dword [tfl]
  295. fstp qword [tfl]
  296. push dword [tfl+4]
  297. push dword [tfl]
  298. pop dword [tfl]
  299. pop dword [tfl+4]
  300. fld qword [tfl]
  301. pop dword [tfl]
  302. pop dword [tfl+4]
  303. fld qword [tfl]
  304. fdivrp ST1,ST0
  305. fstp qword [tfl]
  306. push dword [tfl+4]
  307. push dword [tfl]
  308. push 34
  309. push dword [f_7+4]
  310. push dword [f_7]
  311. pop ebx
  312. pop ecx
  313. pop dword [tfl]
  314. fild dword [tfl]
  315. fstp qword [tfl]
  316. push dword [tfl+4]
  317. push dword [tfl]
  318. push ecx
  319. push ebx
  320. pop dword [tfl]
  321. pop dword [tfl+4]
  322. fld qword [tfl]
  323. pop dword [tfl]
  324. pop dword [tfl+4]
  325. fld qword [tfl]
  326. fmulp ST1,ST0
  327. fstp qword [tfl]
  328. push dword [tfl+4]
  329. push dword [tfl]
  330. push dword [f_8+4]
  331. push dword [f_8]
  332. pop dword [tfl]
  333. pop dword [tfl+4]
  334. fld qword [tfl]
  335. pop dword [tfl]
  336. pop dword [tfl+4]
  337. fld qword [tfl]
  338. fdivrp ST1,ST0
  339. fstp qword [tfl]
  340. push dword [tfl+4]
  341. push dword [tfl]
  342. pop dword [tfl]
  343. pop dword [tfl+4]
  344. fld qword [tfl]
  345. pop dword [tfl]
  346. pop dword [tfl+4]
  347. fld qword [tfl]
  348. faddp ST1,ST0
  349. fstp qword [tfl]
  350. push dword [tfl+4]
  351. push dword [tfl]
  352. pop dword [v_8]
  353. pop dword [v_8+4]
  354. mov eax, [v_0]
  355. push eax
  356. push 1
  357. pop ebx
  358. pop eax
  359. add eax,ebx
  360. push eax
  361. pop eax
  362. mov [v_0], eax
  363. mov eax, [v_4]
  364. push eax
  365. push 1
  366. pop ebx
  367. pop eax
  368. add eax,ebx
  369. push eax
  370. pop eax
  371. mov [v_4], eax
  372. jmp l_0
  373.     l_1:
  374. push s_9
  375. push printf_s
  376. call printf
  377. add esp,8
  378. mov esp,ebp
  379. pop ebp
  380. mov eax,0
  381. ret
clone this paste RAW Paste Data