Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. %include "io.inc"
  2.  
  3. section .rodata
  4. specscanf db "%u", 0
  5. specprintf db `0x%08X\n`, 0
  6.  
  7. section .bss
  8. n resd 1
  9.  
  10. section .text
  11. CEXTERN scanf
  12. CEXTERN printf
  13. global CMAIN
  14. CMAIN:
  15. push ebp
  16. mov ebp, esp
  17. and esp, -16
  18. sub esp, 16
  19. .lp:
  20. mov ebx, specscanf
  21. mov dword[esp], ebx
  22. lea ebx, [n]
  23. mov dword[esp + 4], ebx
  24. call scanf
  25. cmp eax, 0
  26. jl .end
  27. mov ebx, dword[n]
  28. mov dword[esp + 4], ebx
  29. mov ebx, specprintf
  30. mov dword[esp], ebx
  31. call printf
  32. jmp .lp
  33. .end:
  34. add esp, 16
  35. mov esp, ebp
  36. pop ebp
  37. xor eax, eax
  38. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement