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
.386
.model flat, stdcall
includelib kernel32.lib
ExitProcess PROTO ,:DWORD
.data
N=4
a dd 1,-2,-3,4
.code
Main:
mov ax,@data
mov ds,eax
xor eax,eax
xor ecx,ecx
mov ecx,N
mov di,0
m:
mov eax,a[di]
cmp eax,0
js k
mov a[di], 1
mov di, di*4
loop m
k:
mov a[di], -1
mov di,di*4
loop m
END Main
push 0
call ExitProcess
Winmain endp
end Winmain