TITLE Integer Summation Program (Sum_main.asm)
INCLUDE Irvine32.inc
INCLUDELIB Irvine32.lib
INCLUDELIB user32.lib
INCLUDELIB kernel32.lib
include Macros.inc
Str_length PROTO,pString:PTR BYTE
Str_copy PROTO,source:PTR BYTE,target:PTR BYTE
.data
source1 byte "123456"
target1 BYTE 100 DUP(?)
.code
main proc
invoke str_copy,addr source1,addr target1
exit
main endp
str_copy proc uses eax ecx esi edi,
source:ptr byte,target:ptr byte
invoke str_length,addr source1
mov ecx,eax
inc ecx
mov esi,source
mov edi,target
cld
rep movsb
ret
str_copy endp
str_length proc uses edi,
pstring:ptr byte
mov edi,pstring
mov eax,0
L1:cmp byte ptr [edi],0
je L2
inc edi
inc eax
jmp L1
L2:ret
str_length endp
end main
错误提示如下

编译好长时间没弄出来,问题出在哪呢?
------解决方案--------------------
str_copy proc uses eax ecx esi edi,
source:ptr byte,target:ptr byte
这两行内容其实是一个语句,但中间个空白行导致汇编程序认为第一行语句已经结束了,所以出错。将两行间的空白行删除了成下面的样子就可以了;或者,干脆写到一行里。
str_copy proc uses eax ecx esi edi,[/code]
source:ptr byte,target:ptr byte