copying a string
- Include Irvine32.inc
- .data
- total byte "Hi, copy array ", 0dh, 0ah, 0
- result byte sizeof total dup(0)
- .code
- main proc
- mov esi, 0 ; ESI = first index of array
- mov ecx, sizeof total ; length of total
- L1:
- mov al, total[esi] ; mov index in total into al every time
- mov result[esi], al ; store it into result
- inc esi ; mov to next index
- Loop L1 ; repeat until ecx == 0
- mov edx, offset result ; display result (after copying)
- call writestring
- exit
- main endp
- end main
留言
張貼留言