i should to move the biggest value to the last index in the array then to print the array.
when i print it i get things like letters, smiles...
what is the wrong in the code?
.model small
.stack 100h
.data
array db 3,8,5,3
n equ 4
b db dup 6 ('$')
.code
mov ax,@data
mov ds,ax
mov cl,0
mov si ,offset array
mov di ,offset b
mov ax,[si]
myloop:
cmp cl,n-1
je theend
cmp ax,[si+1]
jb next
cmp ax,[si+1]
jae continue
next:
mov di ,ax
add di ,48
jmp my
continue:
mov di,[si+1]
add di,48
jmp my
my:
inc si
inc di
inc cl
theend:
mov ah,9
mov dx,di
int 21h
.exit
end