11.2.2.6


1. .

p686

IDEAL

MODEL flat

extrn ExitProcess:proc

DATASEG

struc complex

real dd ?

im dd ?

ends

n1 complex <1, 1>

n2 complex <2, 2>

n3 complex ?

CODESEG

begin:

push [n1.im]

push [n1.real]

push [n2.im]

push [n2.real]

push offset n3

call csum

call ExitProcess

proc csum

push ebp

mov ebp, esp

push eax ebx

mov eax, [(complex ebp+20).real]

add eax, [(complex ebp+12).real]

mov ebx, [ebp+8]

mov [(complex ebx).real], eax

mov eax, [(complex ebp+20).im]

add eax, [(complex ebp+12).im]

mov [(complex ebx).im], eax

pop ebx eax ebp

ret 20

endp csum

end begin

. , .

.