I had tried to make a compare strings function in real mode assembly, but it didn't work, so I tried it another way and it did. It seems to me that both functions I wrote do the same thing yet one doesn't work. Can someone tell me why, the two functions are below.
This one works:
CmpString:
mov bh, [di]
cmp bh, [si]
jne StringRet
cmp bh, 0
je StringEnd
add di, 1
add si, 1
jmp CmpString
StringEnd:
stc
ret
StringRet:
clc
ret
And this one did not:
CmpString:
mov bh, [di]
cmp bh, [si]
jne StringRet
cmp bh, 0
add di, 1
add si, 1
jne CmpString
stc
ret
StringRet:
clc
ret