Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TITLE
- INCLUDE Irvine32.inc
- .data
- prompt BYTE "Enter String: ", 0
- response BYTE 50 DUP(0)
- message BYTE " Message entered. ",0
- .code
- STRQRY PROC
- push ebp
- mov ebp, esp
- push edx
- push ecx
- mov edx, [ebp+8]
- call writestring
- mov ecx, SIZEOF response
- mov edx, OFFSET response
- call readstring
- pop ecx
- pop edx
- pop ebp
- ret 4
- STRQRY ENDP
- STRLEN PROC
- push ebp
- mov ebp, esp
- push ebx
- push ecx
- mov edx,[ebp+16]
- mov eax, 0
- counter:
- mov cl,[edx+eax]
- cmp cl, 0
- JE done
- inc eax
- jmp counter
- done:
- pop ecx
- pop ebx
- pop ebp
- ret 4
- STRLEN ENDP
- main PROC
- push OFFSET prompt
- call STRQRY
- push eax
- call STRLEN
- call writedec
- mov edx,OFFSET message
- call WriteString
- mov edx, OFFSET response
- call WriteString
- exit
- main ENDP
- END main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement