- data segment
- buff dw 2345,3456,678,-123,23,-1,0,234
- a db $-buff
- zz db ?
- data ends
- code segment
- assume cs:code,ds:data
- start:
- mov ax,data
- mov ds,ax
- mov cl,a
- mov dl,0
- xor dh,dh
- mov si,offset buff
- hh:
- dec cl
- inc si
- inc si
- mov bx,buff[si]
- cmp bx,0
- jg addzz
- cmp cl,0
- jnz hh
- jmp bb
- addzz: add dl,1
- cmp cl,0
- jnz hh
- bb:mov zz,dl
- add dl,30h
- mov ah,02h
- int 21h
- mov ax,4c00h
- int 21h
- code ends
- end start