Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

project with emu8086

hi i'm familiar with emu8086 programmation and i have a problem in executing a program which classify an array filled with integers in crescent order
[code]data segment
tab db 1 dup (1,9,2,6,3,5)
data ends
code segment
tri proc far
mov ax,data
mov ds,ax

lea si,tab
mov cx,5
mov bp,0
boucl:

mov al,[si]

boucl2:
cmp bp,cx

jz recul

rcul:
inc bp
mov bl,[si+bp]
cmp bl,al
js rcul
xchg bl,al;tri selon l'ordre croissant
mov [si],al
mov [si+BP],bl
jmp boucl2

recul : jmp sh
sh:
inc si
mov bp,1
dec cx
cmp cx,5
jz affich
jmp boucl

mov cx,5
lea si,tab
affich:
mov al,[si]
mov dl,al
add dl,48
mov ah,02h
int 21h

inc si
cmp cx,5
jnz affich
tri endp
int 20h
code ends
end tri[/code]
and it won't work because it won't get off the following instruction:
[code]cmp bp,cx

jz recul

rcul:
inc bp
mov bl,[si+bp]
cmp bl,al
js rcul
xchg bl,al;tri selon l'ordre croissant
mov [si],al
mov [si+BP],bl
jmp boucl2[/code]
a little help pliiiiiiiiiiiiiiiiiiiiiiz!
Sign In or Register to comment.