Friday, 4 November 2011

sorting + sum


mov bl,[3000h]
dec bl  
mov dl,00h
l3:mov cl,bl
mov si,2000h
l1:mov al,[si]
inc si
cmp al,[si]
jb l2
xchg [si],al
mov [si-1],al
l2:loop l1
add dl,[si]
dec bl
jnz l3
add dl,[2000h]
mov [4000h],dl
hlt

No comments:

Post a Comment