【发布时间】:2012-06-12 15:58:00
【问题描述】:
这是复制 2 个字符串的代码
TITLE Copying a String (CopyStr.asm)
INCLUDE Irvine32.inc
.data
source BYTE "This is the source string",0
target BYTE SIZEOF source DUP(0)
.code
main PROC
mov esi,0 ; index register
mov ecx,SIZEOF source ; loop counter
L1:
mov al,source[esi] ; get a character from source
mov target[esi],al ; store it in the target
inc esi ; move to next character
loop L1 ; repeat for entire string
exit
main ENDP
END main
mov esi,0 ;索引寄存器
为什么它假定索引将从 0 开始它是如何知道 SOURCE 的索引是 0 我觉得应该是
mov esi , offset Source
???
【问题讨论】:
-
代码完全转储,应该使用
rep movsb...
标签: string assembly copy masm irvine32