Advertisement
Guest User

Untitled

a guest
Oct 20th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. TITLE
  2.  
  3.  
  4. INCLUDE Irvine32.inc
  5.  
  6. .data
  7.  
  8. prompt BYTE "Enter String: ", 0
  9. response BYTE 50 DUP(0)
  10. message BYTE " Message entered. ",0
  11.  
  12. .code
  13.  
  14. STRQRY PROC
  15. push ebp
  16. mov ebp, esp
  17. push edx
  18. push ecx
  19.  
  20. mov edx, [ebp+8]
  21. call writestring
  22.  
  23. mov ecx, SIZEOF response
  24. mov edx, OFFSET response
  25. call readstring
  26.  
  27.  
  28.  
  29. pop ecx
  30. pop edx
  31. pop ebp
  32. ret 4
  33.  
  34. STRQRY ENDP
  35.  
  36. STRLEN PROC
  37. push ebp
  38. mov ebp, esp
  39. push ebx
  40. push ecx
  41.  
  42. mov edx,[ebp+16]
  43.  
  44. mov eax, 0
  45.  
  46.  
  47. counter:
  48. mov cl,[edx+eax]
  49.  
  50. cmp cl, 0
  51.  
  52. JE done
  53.  
  54. inc eax
  55.  
  56. jmp counter
  57.  
  58. done:
  59. pop ecx
  60. pop ebx
  61. pop ebp
  62. ret 4
  63.  
  64. STRLEN ENDP
  65.  
  66. main PROC
  67.  
  68. push OFFSET prompt
  69. call STRQRY
  70.  
  71.  
  72.  
  73. push eax
  74. call STRLEN
  75. call writedec
  76.  
  77. mov edx,OFFSET message
  78. call WriteString
  79.  
  80. mov edx, OFFSET response
  81. call WriteString
  82.  
  83. exit
  84. main ENDP
  85. END main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement