![]() |
#2
诸葛修勤2011-03-15 22:58
|

;#Mode=CON
.386
.model flat, stdcall
option casemap :none
include Irvine32.inc
include windows.inc
include user32.inc
include kernel32.inc
include masm32.inc
includelib user32.lib
includelib kernel32.lib
includelib masm32.lib
include macro.asm
MultArray proto, x:ptr DWORD, y:ptr DWORD, z:DWORD
.data
var1 DWORD 12, 14, 15
var2 DWORD 13, 16, 17
.code
main proc
mov esi, offset var2
mov ecx, lengthof var2
mov ebx, type DWORD
call DumpMem
invoke MultArray, addr var1, addr var2, 3
call DumpMem
call WaitMsg
invoke ExitProcess, 0
main endp
MultArray proc uses esi ecx,
x:ptr DWORD,
y:ptr DWORD,
z:DWORD
mov esi, 0
mov ecx, z
L:
mov eax, [esi*type DWORD + x]
add [esi*type DWORD + y], eax
inc esi
loop L
ret
MultArray endp
end main
.386
.model flat, stdcall
option casemap :none
include Irvine32.inc
include windows.inc
include user32.inc
include kernel32.inc
include masm32.inc
includelib user32.lib
includelib kernel32.lib
includelib masm32.lib
include macro.asm
MultArray proto, x:ptr DWORD, y:ptr DWORD, z:DWORD
.data
var1 DWORD 12, 14, 15
var2 DWORD 13, 16, 17
.code
main proc
mov esi, offset var2
mov ecx, lengthof var2
mov ebx, type DWORD
call DumpMem
invoke MultArray, addr var1, addr var2, 3
call DumpMem
call WaitMsg
invoke ExitProcess, 0
main endp
MultArray proc uses esi ecx,
x:ptr DWORD,
y:ptr DWORD,
z:DWORD
mov esi, 0
mov ecx, z
L:
mov eax, [esi*type DWORD + x]
add [esi*type DWORD + y], eax
inc esi
loop L
ret
MultArray endp
end main