i am a student and i need help with the code in assembly 8086
the program below have to get the numbers in array A and sort the numbers from the less to the biggest in array C... its not working, what the problem in the code?
thank you for looking :)
data segment
A dw 100 dup(1,7,0bh,1,4,8,4,2)
B dw 100 dup(?)
c dw 100 dup(?)
N db 8
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
mov si,0
xor di,di
xor ax,ax
xor bx,bx
mov cl,N
xor ch,ch
again: mov ax,A[di]
inc di
mov bx,A[di]
mov bl,bh
xor bh,bh
cmp ax,bx
jl new
cmp al,0
jz sof
loop again
new: mov c[si],ax
inc si
inc di
xor ax,ax
loop again
sof: mov ah,4ch
int 21h
code ends
end start
Edited by WingedPanther, 10 January 2010 - 12:31 PM.
add code tags (the # button)


Sign In
Create Account

Back to top









