Une essai de programmation
marawash
Messages postés
8
Date d'inscription
Statut
Membre
Dernière intervention
-
marawash Messages postés 8 Date d'inscription Statut Membre Dernière intervention -
marawash Messages postés 8 Date d'inscription Statut Membre Dernière intervention -
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
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
A voir également:
- Une essai de programmation
- Telecharger idm gratuit 30 jours essai - Télécharger - Téléchargement & Transfert
- Youtube premium essai gratuit - Accueil - TV & Vidéo
- Application de programmation - Guide
- Ccleaner pro essai gratuit - Télécharger - Optimisation
- Programmer une carte bancaire vierge ✓ - Forum Matériel & Système
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!!!