A couple of problems:
- You've got a hardcoded comparison count, so even if the strings are equal you'll compare data beyond the end of the strings unless they're both 100 bytes long (which they won't be, since you've declared them to hold 81 bytes each).
mov cx, 100
You should compare at most length_of_the_shortest_string
bytes. If the strings aren't the same length they're not equal and there's no need to compare their contents at all.
2.
rep cmpsb
Not necessarily a problem, since the assembler probably takes care of this for you, but the correct prefix to use here would be repe
.
I also noticed a lot of poorly named labels. For example, you've named the "strings are equal"
string msgne
which implies that it's a message that should be shown when the strings are not equal. Then there are labels like mes0
that says nothing about their purpose. Things like that makes code unnecessarily hard to read/debug.