,

( ). , .

1 . .

ideal

p686

model flat

extrn ExitProcess:proc

dataseg

matr dd 1, 1, 1, 1

dd 2, 2, 2, 2

dd 3, 3, 3, 3

value dd 4

col dd 1

n dd 4;

m dd 3; ꠠ

codeseg

begin:

push offset matr [n] [m] [value] [col]; ebp 0

call mc_mul; eip 4

call ExitProcess; col 8

proc mc_mul; value 12

push ebp; m 16

mov ebp, esp; n 20

; matr 24

;for(i=0; i<m; i++)

; matr[i][col]*=value;

push eax ebx ecx esi

mov ecx, [ebp+16]

mov esi, [ebp+24]

mov ebx, [ebp+8]; col

lea esi, [esi+ebx*4]; &

mov ebx, [ebp+20]

shl ebx, 2;

mov edi, [ebp+12]

for1:

mov eax, [esi]

mul edi

mov [esi], eax

add esi, ebx

loop for1

pop esi ecx ebx eax ebp

Ret 5*4

Endp

end begin

2.

ideal

p686

model flat

extrn ExitProcess:proc

dataseg

s1 db 'a', 0

s2 db 'bb', 0

s3 db 'ccc', 0

s4 db 'dddd', 0

array dd s1, s2, s3, s4

n dd (n-array)/4