字符串比较 简单问题
.386
.model flat,stdcall
option casemap:none
includelib msvcrt.lib
printf proto c :dword, :vararg
.data
szStr1 byte 'How do you do!',0
szStr2 byte 'How do you do!',0
szEqu byte 'the two string are Equal',0ah,0
szNeq byte 'the two string are not equal',0ah,0
.code
start:
LEA ESI,szStr1
LEA EDI,szStr2
MOV ECX,15
CLD
REPZ CMPSB
JZ G1 ; ZF=0,跳转,输出不相等
invoke printf,offset szEqu
ret
JZ G2
G1:
invoke printf,offset szNeq
ret
G2:
end start
结果刚好相反,是不是jz这里判断出问题了?
zf=0,应该不相等才对?