386 model flat stdcall includelib kernel32 lib ExitProcess PROTO DWORD

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.386
.model flat, stdcall
includelib kernel32.lib
ExitProcess PROTO ,:DWORD
.data
N=4
a dd 1,-2,-3,4
.code
Main:
mov eax,a
xor eax,eax
xor ecx,ecx
mov ecx,N
mov edi,0
m:
mov eax,a[edi]
cmp eax,0
js k
mov a[edi], -1
mov ebx, 4*edi
mov edi, ebx
loop m
k:
mov a[edi], 1
mov ebx, 4*edi
mov edi, ebx
loop m
END Main
push 0
call ExitProcess
Winmain endp
end Winmain