ALP to count negative (-ve) numbers from a given list of 10 numbers

title ALP to count negative (-ve) numbers from a given list
of 10 numbers
dosseg
.model small
.stack 100
.code
main proc
mov ax, @data
mov ds, ax
mov cx, 0ah ;counter of 10
mov si, offset list ;array accessing
mov bl, 00h ;counts -ve numbers
mov al, 07Fh ;largest possible +ve number
BACK: cmp al, si ;compares al and si contents
jnc ahead ;if nc=0, jump ahead
inc bl
AHEAD: inc si ;pointer increment
loop back
mov result, bl
mov ax, 4c00h
INT 21h
main endp
.data
list db 0AFH, 03H, 087H……
result db ?
end main

Ekendra Lamsal: An Engineer, Technocrat, ICT4D Advocate & Web analyst. Blogging since 2001 (on this site from 2004) in various weblogs. Also, in love with Clouds, Internet of Things, Knowledge Management, Web Inclusion & BI.