, , , . .

. , , .

. :

Min ;

Max ;

MinMax - , ;

ideal

p686

model flat

extrn ExitProcess:proc

dataseg

x dd 5

y dd 3

z1 dd ?; min

z2 dd ?; max

array dd Min, Max

codeseg

begin:

push [x] [y]

mov eax, [array]; min

push eax

call MinMax

mov [z1], eax

push [x] [y]

mov eax, [array+4]; min

push eax

call MinMax

mov [z2], eax

call ExitProcess; ebp 0

proc Min; eip 4

push ebp; y 8

mov ebp, esp; x 12

mov eax, [ebp+12]

cmp eax, [ebp+8]

jl short @@m1

mov eax, [ebp+8]

@@m1:

pop ebp

ret 8

endp

; ebp 0

proc Max; eip 4

push ebp; y 8

mov ebp, esp; x 12

mov eax, [ebp+12]

cmp eax, [ebp+8]

jg short @@m1

mov eax, [ebp+8]

@@m1:

pop ebp

ret 8

endp

; ebp 0

proc MinMax; eip 4

push ebp; &fun 8

mov ebp, esp;

; y 12

push [dword ebp+16] [dword ebp+12]; x 16

mov eax, [ebp+8]

call eax

pop ebp

ret 12

endp

end begin