Une essai de programmation

Fermé
marawash Messages postés 5 Date d'inscription mercredi 17 mars 2010 Statut Membre Dernière intervention 11 mai 2011 - 17 mars 2010 à 09:08
marawash Messages postés 5 Date d'inscription mercredi 17 mars 2010 Statut Membre Dernière intervention 11 mai 2011 - 17 mars 2010 à 09:30
Bonjour,
j'ai écrit un programme assaembleur alor svp je veux de l'aide de savoir si ce pgme est just et merci d'avance:
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

1 réponse

blux Messages postés 24877 Date d'inscription dimanche 26 août 2001 Statut Modérateur Dernière intervention 24 mars 2023 3 311
17 mars 2010 à 09:24
Salut,

quel assembleur ?
Qu'est supposé faire ce programme ?
0
marawash Messages postés 5 Date d'inscription mercredi 17 mars 2010 Statut Membre Dernière intervention 11 mai 2011
17 mars 2010 à 09:30
merci tt d'abor 2 m'avoir répondu
primo c'est un pgme sur emu8086
secondo il réalise le tri d'un tableau a N valeurs
tercio mon pgme ne sort pas de la boucle :
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

alor a l'aide svp!!!
0