code segment
assume cs:code
d_buf db 1,4,7,-3,6,-8,-9,0,6,87,-45
count equ $-d_buf
p_dat db count dup(-1)
n_dat db count dup(1)
start:push cs
pop ds
push cs
pop es
lea si,d_buf
lea di,p_dat
lea bx,n_dat
cld
mov cx,count
@1:
lodsb
cmp al,0
jl @2
stosb
jmp @3
@2:
mov [bx],al
inc bx
@3:
loop @1
mov ah,4ch
int 21h
code ends
end start