Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. %include "io.inc"
  2. extern printf
  3.  
  4. section .data
  5. before_format db "before %s", 13, 10, 0
  6. after_format db "after %s", 13, 10, 0
  7. mystring db "abcdefghij", 0
  8.  
  9. section .text
  10. global CMAIN
  11.  
  12. toupper:
  13. push ebp
  14. mov ebp, esp
  15.  
  16. ; TODO
  17.  
  18. mov eax, dword [ebp + 8]
  19. xor ecx, ecx
  20. test_one_byte:
  21. mov bl, byte [eax]
  22. test bl, bl
  23. je out
  24. sub bl, 0x20
  25. mov byte [eax], bl
  26. inc eax
  27. jmp test_one_byte
  28.  
  29. out:
  30.  
  31. leave
  32. ret
  33.  
  34. CMAIN:
  35. push ebp
  36. mov ebp, esp
  37.  
  38. push mystring
  39. push before_format
  40. call printf
  41. add esp, 8
  42.  
  43. push mystring
  44. call toupper
  45. add esp, 4
  46.  
  47. push mystring
  48. push after_format
  49. call printf
  50. add esp, 8
  51.  
  52. leave
  53. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement