11.2.3


. , .

p586

IDEAL

MODEL fLat

extrn ExitProcess:proc

DATASEG

x dd 1

y dd 2

z dd 3

u dd 4

res dd ?

CODESEG

begin:

push [u] [z] [y] [x] 4; ebp 0

call max; eip 4

add esp, 5*4; 4 8 ;

mov [res], eax; [x] 12

call ExitProcess; [y] 16;

proc max; [z] 20

push ebp; [u] 24

mov ebp, esp;

push ebx ecx edx

mov eax, [ebp+12]; x

mov ecx, [ebp+8]; n

dec ecx

jecxz @@m2

lea ebx, [ebp+16]; &

@@for1:

mov edx, [ebx]

cmp eax, edx

jge short @@m1

mov eax, edx

@@m1:

add ebx, 4

loop @@for1

@@m2:

pop edx ecx ebx ebp

ret

endp

end begin

:

1.     ;

2.     , ;

3.     , , .. , ;