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

I see the ASCII for 3 is indeed a heart. http://ascii-table.com/codepage.php?863

So nothing wrong with your code at all. It does what you told it to do. Now I would be guessing you wanted to print a number but that's not what you asked in your code or your post. Think carefully about your questions and specifications here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.