Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .386
- .model flat, stdcall
- option casemap :none
- include \masm32\include\masm32rt.inc
- .data
- prompt db "Insert string:",0
- same_msg db "Both string are the same.",0
- diff_msg db "The strings are different.",0
- string db 50 dup(?)
- string2 db 50 dup(?)
- .code
- main:
- ; There are prototypes for all the libraries MASM32 supports
- ; so we can use invoke to handle all the parameter passing
- ; and stack cleanup for us (where necessary)
- invoke StdOut, offset prompt
- invoke StdIn, offset string, 50
- invoke StdOut, offset prompt
- invoke StdIn, offset string2, 50
- invoke crt__stricmp, offset string, offset string2
- cmp eax, 0 ; You can also use: test eax, eax
- jne diff
- same:
- invoke StdOut, offset same_msg
- jmp fin ; We want to exit, not to fall into "diff" code
- diff:
- invoke StdOut, offset diff_msg
- fin:
- ret ; Return to exit or do: invoke ExitProcess, 0
- end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement