TITLE Pointers
INCLUDE Irvine32.inc
INCLUDELIB Irvine32.lib
INCLUDELIB user32.lib
INCLUDELIB kernel32.lib
.CODE
main proc
mov eax,0
mov edx,0
call str_compare
exit
main endp
str_compare proc uses eax,edx,esi,edi
string1:ptr byte,
string2:ptr byte
mov esi,string1
mov edi,string2
L1:mov al,[esi]
mov dl,[edi]
cmp al,0
jne L2
cmp dl,0
jne L2
JMP L3
L2:INC ESI
INC EDI
cmp al,dl
je L1
L3:ret
str_compare endp
end main
错误提示是下面的,麻烦帮改一下,错误出在哪?补充下原来的程序没有main,只有str_compare过程,main是我自己后填的结果还是无法编译。
------解决方案--------------------
str_compare 已经在 irvine32.inc 里定义过了吧,所以不能再用这个名字了;proc 语句应该写成:
str_compare2 proc uses eax edx esi edi,
string1:ptr byte,
string2:ptr byte