Affichage décroissant et alphabétique de 2 listes(Nom_Prénom et Note)

m_didi9 Messages postés 3 Date d'inscription vendredi 17 décembre 2004 Statut Membre Dernière intervention 17 novembre 2009 - 17 nov. 2009 à 23:15
cs_patatalo Messages postés 1466 Date d'inscription vendredi 2 janvier 2004 Statut Modérateur Dernière intervention 14 février 2014 - 24 nov. 2009 à 14:31
Data SEGMENT

Mess1 DB 10,13, 'Entrez la liste des Noms :'
DB 10, 13, '$'
Mess2   DB 'Entrez la liste des Notes  :'
DB 10, 13, '$'

Mess3   DB'       Affichage de liste1                            Affichage de liste2'
DB 10, 13, '$'

Mess4   DB 'Par ordre Alphabetique  de  Noms               Par ordre Decroissante  de  Notes'
DB 10, 13, '$'

Bourd12 db 10, 13,'            ///////////////////////////////////////////////////////\','$'
Bourd13 db 10, 13,'            \#######    ####          #        ######    #       # /','$'
Bourd14 db 10, 13,'            /   #      #    #        # #      #          # #   # # \','$'
Bourd15 db 10, 13,'            \   #      #    #       #   #     #          #  # #  # /','$'
Bourd16 db 10, 13,'            /   #      #####  //\\ #######     ######    #   #   # \','$'
Bourd17 db 10, 13,'            \   #      #      \\// #     #           #   #       # /','$'
Bourd18 db 10, 13,'            /   #      #           #     #    #######    #       # \','$'
Bourd19 db 10, 13,'            \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/','$'







Bourd1 db 10, 13,'                    #######################################','$'
Bourd2 db 10, 13,'                    #      //AFFICHAGE-DECROISSANTE\\     #','$'
Bourd3 db 10, 13,'                    #        \\ ET ALPHABETIQUE //        #','$'
Bourd4 db 10, 13,'                    #        //  REALISE  PAR   \\        #','$'
Bourd5 db 10, 13,'                    #        \\ SEBBAGH MOHAMED //        #','$'
Bourd6 db 10, 13,'                    #        /////////G02\\\\\\\\\        #','$'
Bourd7 db 10, 13,'                    #\\ UNIVERSITE DE CONSTANTINE--2009 //#','$'
Bourd8 db 10, 13,'                    #######################################','$'

Bourd9 db 10, 13, ' #--------------------#------#                   #--------------------#------#','$'
Bourd10 db 10, 13,' |   Nom & Prenom     | Note |                   |   Nom & Prenom     | Note |','$'
Bourd11 db 10, 13,' #--------------------#------#                   #--------------------#------#','$'



;Declaration de Noms
espace  db  '|$'

Nom1  Dw   40 DUP ('$'),'$'
Nom2  Dw   40 DUP ('$'),'$'
Nom3  Dw   40 DUP ('$'),'$'
Nom4  Dw   40 DUP ('$'),'$'
Nom5  Dw   40 DUP ('$'),'$'

tempM1    Dw 5 dup ('$'),'$'
tempM2    Dw 5 dup ('$'),'$'
tempM3    Dw 5 dup ('$'),'$'
tempM4    Dw 5 dup ('$'),'$'
tempM5    Dw 5 dup ('$'),'$'

tempMc1   Dw 5 dup ('$'),'$'
tempMc2   Dw 5 dup ('$'),'$'
resM1     Dw 5 dup ('$'),'$'
resM2     Dw 5 dup ('$'),'$'
resM3     Dw 5 dup ('$'),'$'
resM4     Dw 5 dup ('$'),'$'
resM5     Dw 5 dup ('$'),'$'


; declaration des Notes

Note1    Dw 5 DUP ('$')
Note2    Dw 5 DUP ('$')
Note3    Dw 5 DUP ('$')
Note4    Dw 5 DUP ('$')
Note5    Dw 5 DUP ('$')

temp1    Dw     ?  ,'$'
temp2    Dw     ?  ,'$'
temp3    Dw     ?  ,'$'
temp4    Dw     ?  ,'$'
temp5    Dw     ?  ,'$'

tempc1   Dw     ?  ,'$'
tempc2   Dw     ?  ,'$'
tempC  Dw   1 DUP ('$'),'$'
res1     Dw     ?  ,'$'
res2     Dw     ?  ,'$'

resN1     Dw     ?  ,'$'
resN2    Dw     ?  ,'$'
resN3    Dw     ?  ,'$'
resN4    Dw     ?  ,'$'
resN5    Dw     ?  ,'$'

code1  Dw   1 DUP ('$'),'$'
code2  Dw   1 DUP ('$'),'$'
fort         DB ?
faible        DB ?


Data ENDS

Code SEGMENT PUBLIC
.286
.model tiny

MOV AH,08h ; Pause pourvoir le dessin
INT 21h

Assume CS : Code, DS : Data , ss:stack_s
Debut :
MOV AX, Data
MOV DS, AX

mov  ax,3
int  10h

    
        

MOV DX, OFFSET Bourd12
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd13
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd14
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd15
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd16
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd17
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd18
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd19
MOV AH, 9
INT 21h

MOV DX, OFFSET Bourd1
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd2
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd3
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd4
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd5
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd6
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd7
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd8
MOV AH, 9
INT 21h

call sout_line

MOV DX, OFFSET Mess1
MOV AH, 9
INT 21h



LEA DX, Nom1
MOV AH, 10
INT 21h

mov BX , offset Nom1 + 2
mov tempM1 , BX
mov Nom1 , BX

call sout_line

LEA DX, Nom2
MOV AH, 10
INT 21h

mov BX , offset Nom2 + 2
mov tempM2 , BX
mov Nom2 , BX

call sout_line

LEA DX, Nom3
MOV AH, 10
INT 21h

mov BX , offset Nom3 + 2
mov tempM3 , BX
mov Nom3 , BX

call sout_line

LEA DX, Nom4
MOV AH, 10
INT 21h

mov BX , offset Nom4 + 2
mov tempM4 , BX
mov Nom4 , BX

call sout_line

LEA DX, Nom5
MOV AH, 10
INT 21h

mov BX , offset Nom5 + 2
mov tempM5 , BX
mov Nom5 , BX



call sout_line
call sout_line

MOV DX, OFFSET Mess2
MOV AH, 9
INT 21h

LEA DX, Note1
MOV AH, 10
INT 21h
mov Bx , Note1 + 2
mov temp1 , Bx
mov resN1 , BX


call sout_line

LEA DX, Note2
MOV AH, 10
INT 21h
mov Bx , Note2 + 2
mov temp2 , Bx
mov resN2 , BX

call sout_line

LEA DX, Note3
MOV AH, 10
INT 21h
mov Bx , Note3 + 2
mov temp3 , Bx
mov resN3 , BX

call sout_line

LEA DX, Note4
MOV AH, 10
INT 21h
mov Bx , Note4 + 2
mov temp4 , Bx
mov resN4 , BX

call sout_line

LEA DX, Note5
MOV AH, 10
INT 21h
mov Bx , Note5 + 2
mov temp5 , Bx
mov resN5 , BX

call sout_line



      ;// Note1 Et Note2 //

mov ax , temp1
mov bx , temp2
mov res1 , ax
mov res2 , bx

mov ax , tempM1
mov bx , tempM2
mov resM1 , ax
mov resM2 , bx

call Affictation

mov ax , res1
mov bx , res2
mov temp1 , ax
mov temp2 , bx

mov ax , resM1
mov bx , resM2
mov tempM1 , ax
mov tempM2 , bx


  ;// Note1 et Note3  //

mov ax , temp1
mov bx , temp3
mov res1 , ax
mov res2 , bx

mov ax , tempM1
mov bx , tempM3
mov resM1 , ax
mov resM2 , bx

call Affictation

mov ax , res1
mov bx , res2
mov temp1 , ax
mov temp3 , bx

mov ax , resM1
mov bx , resM2
mov tempM1 , ax
mov tempM3 , bx

;// Note1 et Note4 //

mov ax , temp1
mov bx , temp4
mov res1 , ax
mov res2 , bx

mov ax , tempM1
mov bx , tempM4
mov resM1 , ax
mov resM2 , bx

call Affictation

mov ax , res1
mov bx , res2
mov temp1 , ax
mov temp4 , bx

mov ax , resM1
mov bx , resM2
mov tempM1 , ax
mov tempM4 , bx

; // Note1 et Note5 //

mov ax , temp1
mov bx , temp5
mov res1 , ax
mov res2 , bx

mov ax , tempM1
mov bx , tempM5
mov resM1 , ax
mov resM2 , bx

call Affictation

mov ax , res1
mov bx , res2
mov temp1 , ax
mov temp5 , bx

mov ax , resM1
mov bx , resM2
mov tempM1 , ax
mov tempM5 , bx



; // Note2 et Note3 //
mov ax , temp2
mov bx , temp3
mov res1 , ax
mov res2 , bx

mov ax , tempM2
mov bx , tempM3
mov resM1 , ax
mov resM2 , bx

call Affictation

mov ax , res1
mov bx , res2
mov temp2 , ax
mov temp3 , bx

mov ax , resM1
mov bx , resM2
mov tempM2 , ax
mov tempM3 , bx

; // Note2 et Note 4 //
mov ax , temp2
mov bx , temp4
mov res1 , ax
mov res2 , bx

mov ax , tempM2
mov bx , tempM4
mov resM1 , ax
mov resM2 , bx

call Affictation

mov ax , res1
mov bx , res2
mov temp2 , ax
mov temp4 , bx

mov ax , resM1
mov bx , resM2
mov tempM2 , ax
mov tempM4 , bx

;// Note2 et Note5 //
mov ax , temp2
mov bx , temp5
mov res1 , ax
mov res2 , bx

mov ax , tempM2
mov bx , tempM5
mov resM1 , ax
mov resM2 , bx

call Affictation

mov ax , res1
mov bx , res2
mov temp2 , ax
mov temp5 , bx

mov ax , resM1
mov bx , resM2
mov tempM2 , ax
mov tempM5 , bx



;// Note3 et Note4 //
mov ax , temp3
mov bx , temp4
mov res1 , ax
mov res2 , bx

mov ax , tempM3
mov bx , tempM4
mov resM1 , ax
mov resM2 , bx

call Affictation

mov ax , res1
mov bx , res2
mov temp3 , ax
mov temp4 , bx

mov ax , resM1
mov bx , resM2
mov tempM3 , ax
mov tempM4 , bx

;// Note3 et Note5 //
mov ax , temp3
mov bx , temp5
mov res1 , ax
mov res2 , bx

mov ax , tempM3
mov bx , tempM5
mov resM1 , ax
mov resM2 , bx

call Affictation

mov ax , res1
mov bx , res2
mov temp3 , ax
mov temp5 , bx

mov ax , resM1
mov bx , resM2
mov tempM3 , ax
mov tempM5 , bx



;// Note4 et Note5 //
mov ax , temp4
mov bx , temp5
mov res1 , ax
mov res2 , bx

mov ax , tempM4
mov bx , tempM5
mov resM1 , ax
mov resM2 , bx

call Affictation

mov ax , res1
mov bx , res2
mov temp4 , ax
mov temp5 , bx

mov ax , resM1
mov bx , resM2
mov tempM4 , ax
mov tempM5 , bx





   ;Afichage 1
a2 :
     call sout_line
     call sout_line

      mov  ax,3
      int  10h


MOV DX, OFFSET Bourd1
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd2
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd3
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd4
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd5
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd6
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd7
MOV AH, 9
INT 21h
MOV DX, OFFSET Bourd8
MOV AH, 9
INT 21h

call sout_line





      call sout_line

mov dx, offset Mess3
mov ah , 09h
int  21h
mov dx, offset Mess4
mov ah , 09h
int  21h

        mov  dl,2  ; Horizontale(ligne)
        mov  dh,13   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , offset Bourd9
mov ah , 09h
int 21h

        mov  dl,2  ; Horizontale(ligne)
        mov  dh,14   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , offset Bourd10
mov ah , 09h
int 21h

        mov  dl,2  ; Horizontale(ligne)
        mov  dh,15   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , offset Bourd11
mov ah , 09h
int 21h

        mov  dl,49  ; Horizontale(ligne)
        mov  dh,17   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h
        mov  dl,51  ; Horizontale(ligne)
        mov  dh,17   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

MOV DX, tempM1
mov ah , 9
int 21h
        mov  dl,70  ; Horizontale
        mov  dh,17   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h
        mov  dl,73  ; Horizontale
        mov  dh,17   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h

mov DX, offset temp1
MOV AH, 09h
INT 21h

        mov  dl,77  ; Horizontale
        mov  dh,17   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h

call sout_line

        mov  dl,49  ; Horizontale(ligne)
        mov  dh,18   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h

        mov  dl,51  ; Horizontale(ligne)
        mov  dh,18   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

MOV DX, tempM2
MOV AH, 09h
INT 21h

        mov  dl,70  ; Horizontale
        mov  dh,18   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h
        mov  dl,73  ; Horizontale
        mov  dh,18   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h



MOV DX, offset temp2
MOV AH, 09h
INT 21h
        mov  dl,77  ; Horizontale
        mov  dh,18   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h

call sout_line

        mov  dl,49  ; Horizontale(ligne)
        mov  dh,19   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h

        mov  dl,51  ; Horizontale(ligne)
        mov  dh,19   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h


MOV DX, tempM3
MOV AH, 09h
INT 21h

        mov  dl,70  ; Horizontale
        mov  dh,19   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h
        mov  dl,73  ; Horizontale
        mov  dh,19   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h

MOV DX, offset temp3
MOV AH, 09h
INT 21h

        mov  dl,77  ; Horizontale
        mov  dh,19   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h

call sout_line

        mov  dl,49  ; Horizontale(ligne)
        mov  dh,20   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h

        mov  dl,51  ; Horizontale(ligne)
        mov  dh,20   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

MOV DX, tempM4
MOV AH, 09h
INT 21h

        mov  dl,70  ; Horizontale
        mov  dh,20   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h
        mov  dl,73  ; Horizontale
        mov  dh,20   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h



MOV DX, offset temp4
MOV AH, 09h
INT 21h

        mov  dl,77  ; Horizontale
        mov  dh,20   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , offset espace
mov ah , 09h
int 21h

call sout_line

        mov  dl,49  ; Horizontale(ligne)
        mov  dh,21   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h

        mov  dl,51  ; Horizontale(ligne)
        mov  dh,21   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h


MOV DX, tempM5
MOV AH, 09h
INT 21h

        mov  dl,70  ; Horizontale
        mov  dh,21   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h
        mov  dl,73  ; Horizontale
        mov  dh,21   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h



MOV DX, offset temp5
MOV AH, 09h
INT 21h
        mov  dl,77  ; Horizontale
        mov  dh,21   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h





mov dx , offset Bourd11
mov ah , 09h
int 21h





call sout_line
call sout_line


; Filtration des Noms

; // Nom1 et Nom2

mov ax , Nom1
mov bx , Nom2
mov tempMc1 , ax
mov tempMc2 , bx
mov ax , resN1
mov bx , resN2
mov tempc1 , ax
mov tempc2 , bx
call trie
mov ax , tempMc1
mov bx , tempMc2
mov Nom1 , ax
mov Nom2 , bx
mov ax , tempc1
mov bx , tempc2
mov resN1 , ax
mov resN2 , bx


; // Nom1 et Nom3

mov ax , Nom1
mov bx , Nom3
mov tempMc1 , ax
mov tempMc2 , bx
mov ax , resN1
mov bx , resN3
mov tempc1 , ax
mov tempc2 , bx
call trie
mov ax , tempMc1
mov bx , tempMc2
mov Nom1 , ax
mov Nom3 , bx
mov ax , tempc1
mov bx , tempc2
mov resN1 , ax
mov resN3 , bx

; // Nom1 et Nom4

mov ax , Nom1
mov bx , Nom4
mov tempMc1 , ax
mov tempMc2 , bx
mov ax , resN1
mov bx , resN4
mov tempc1 , ax
mov tempc2 , bx
call trie
mov ax , tempMc1
mov bx , tempMc2
mov Nom1 , ax
mov Nom4 , bx
mov ax , tempc1
mov bx , tempc2
mov resN1 , ax
mov resN4 , bx

; // Nom1 et Nom5

mov ax , Nom1
mov bx , Nom5
mov tempMc1 , ax
mov tempMc2 , bx
mov ax , resN1
mov bx , resN5
mov tempc1 , ax
mov tempc2 , bx
call trie
mov ax , tempMc1
mov bx , tempMc2
mov Nom1 , ax
mov Nom5 , bx
mov ax , tempc1
mov bx , tempc2
mov resN1 , ax
mov resN5 , bx

; // Nom2 et Nom3

mov ax , Nom2
mov bx , Nom3
mov tempMc1 , ax
mov tempMc2 , bx
mov ax , resN2
mov bx , resN3
mov tempc1 , ax
mov tempc2 , bx
call trie
mov ax , tempMc1
mov bx , tempMc2
mov Nom2 , ax
mov Nom3 , bx
mov ax , tempc1
mov bx , tempc2
mov resN2 , ax
mov resN3 , bx

; // Nom2 et Nom4

mov ax , Nom2
mov bx , Nom4
mov tempMc1 , ax
mov tempMc2 , bx
mov ax , resN2
mov bx , resN4
mov tempc1 , ax
mov tempc2 , bx
call trie
mov ax , tempMc1
mov bx , tempMc2
mov Nom2 , ax
mov Nom4 , bx
mov ax , tempc1
mov bx , tempc2
mov resN2 , ax
mov resN4 , bx

; // Nom2 et Nom5

mov ax , Nom2
mov bx , Nom5
mov tempMc1 , ax
mov tempMc2 , bx
mov ax , resN2
mov bx , resN5
mov tempc1 , ax
mov tempc2 , bx
call trie
mov ax , tempMc1
mov bx , tempMc2
mov Nom2 , ax
mov Nom5 , bx
mov ax , tempc1
mov bx , tempc2
mov resN2 , ax
mov resN5 , bx

; // Nom3 et Nom4

mov ax , Nom3
mov bx , Nom4
mov tempMc1 , ax
mov tempMc2 , bx
mov ax , resN3
mov bx , resN4
mov tempc1 , ax
mov tempc2 , bx
call trie
mov ax , tempMc1
mov bx , tempMc2
mov Nom3 , ax
mov Nom4 , bx
mov ax , tempc1
mov bx , tempc2
mov resN3 , ax
mov resN4 , bx

; // Nom3 et Nom5

mov ax , Nom3
mov bx , Nom5
mov tempMc1 , ax
mov tempMc2 , bx
mov ax , resN3
mov bx , resN5
mov tempc1 , ax
mov tempc2 , bx
call trie
mov ax , tempMc1
mov bx , tempMc2
mov Nom3 , ax
mov Nom5 , bx
mov ax , tempc1
mov bx , tempc2
mov resN3 , ax
mov resN5 , bx

; // Nom4 et Nom5

mov ax , Nom4
mov bx , Nom5
mov tempMc1 , ax
mov tempMc2 , bx
mov ax , resN4
mov bx , resN5
mov tempc1 , ax
mov tempc2 , bx
call trie
mov ax , tempMc1
mov bx , tempMc2
mov Nom4 , ax
mov Nom5 , bx
mov ax , tempc1
mov bx , tempc2
mov resN4 , ax
mov resN5 , bx




        mov  dl,1  ; Horizontale(ligne)
        mov  dh,17   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , offset espace
mov ah , 09h
int 21h

        mov  dl,3  ; Horizontale(ligne)
        mov  dh,17   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , Nom1
mov ah , 09h
int 21h

        mov  dl,22  ; Horizontale
        mov  dh,17   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h
        mov  dl,25  ; Horizontale
        mov  dh,17   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h

MOV DX, offset resN1
MOV AH, 09h
INT 21h

        mov  dl,29  ; Horizontale
        mov  dh,17   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h

call sout_line

        mov  dl,1  ; Horizontale(ligne)
        mov  dh,18   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , offset espace
mov ah , 09h
int 21h

        mov  dl,3  ; Horizontale(ligne)
        mov  dh,18   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , Nom2
mov ah , 09h
int 21h

        mov  dl,22  ; Horizontale
        mov  dh,18   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h
        mov  dl,25  ; Horizontale
        mov  dh,18   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h

MOV DX, offset resN2
MOV AH, 09h
INT 21h

        mov  dl,29  ; Horizontale
        mov  dh,18   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h

call sout_line

        mov  dl,1  ; Horizontale(ligne)
        mov  dh,19   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , offset espace
mov ah , 09h
int 21h

        mov  dl,3  ; Horizontale(ligne)
        mov  dh,19   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , Nom3
mov ah , 09h
int 21h

        mov  dl,22  ; Horizontale
        mov  dh,19   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h
        mov  dl,25  ; Horizontale
        mov  dh,19   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h

MOV DX, offset resN3
MOV AH, 09h
INT 21h

        mov  dl,29  ; Horizontale
        mov  dh,19   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , offset espace
mov ah , 09h
int 21h


call sout_line

        mov  dl,1  ; Horizontale(ligne)
        mov  dh,20   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , offset espace
mov ah , 09h
int 21h

        mov  dl,3  ; Horizontale(ligne)
        mov  dh,20   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , Nom4
mov ah , 09h
int 21h

        mov  dl,22  ; Horizontale
        mov  dh,20   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h
        mov  dl,25  ; Horizontale
        mov  dh,20   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h

MOV DX, offset resN4
MOV AH, 09h
INT 21h

        mov  dl,29  ; Horizontale
        mov  dh,20   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h

call sout_line

        mov  dl,1  ; Horizontale(ligne)
        mov  dh,21   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , offset espace
mov ah , 09h
int 21h

        mov  dl,3  ; Horizontale(ligne)
        mov  dh,21   ; verticale(colone)
        mov  ah,2
        xor  bh,bh
        int  10h

mov dx , Nom5
mov ah , 09h
int 21h

        mov  dl,22  ; Horizontale
        mov  dh,21   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h
        mov  dl,25  ; Horizontale
        mov  dh,21   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h

MOV DX, offset resN5
MOV AH, 09h
INT 21h

        mov  dl,29  ; Horizontale
        mov  dh,21   ; verticale
        mov  ah,2
        xor  bh,bh
        int  10h
mov dx , offset espace
mov ah , 09h
int 21h



call sout_line
call sout_line


MOV AH, 4Ch
INT 21h


sout_line proc near

    mov dl,10       ;retour … la ligne
    mov ah,6
    int 21h
    mov dl,13           ; debut de la ligne
    mov ah,6
    int 21h
ret
endp



Affictation proc near
mov ax , res1
mov bx , res2

cmp ax , bx
JLE  a0
a1 :mov res1 , ax
    mov res2 , bx
    mov ax , resM2
    mov bx , resM1
    mov resM1 , bx
    mov resM2 , ax

ret

a0 :mov res1 , bx
    mov res2 , ax
    mov ax , resM1
    mov bx , resM2
    mov resM1 , bx
    mov resM2 , ax
ret
endp

trie proc near

mov si, tempMc1
mov di, tempMc2

ITQ1 : mov al , [si]
       call get_ascii
       mov dx , tempC
       mov code1 , dx
       mov al , [di]
       call get_ascii
       mov dx , tempC
       mov code2 , dx
       mov ax , code1
       mov bx , code2
       cmp ax ,bx
       cmp ax ,bx
       Jg permutation
       jmp suite
permutation:
mov ax , tempMc1
mov bx , tempMc2
mov tempMc1 , bx
mov tempMc2 , ax
mov ax , tempc1
mov bx , tempc2
mov tempc2 , ax
mov tempc1 , bx
jmp fin
suite :
mov ax , tempMc1
mov bx , tempMc2
mov tempMc1 , ax
mov tempMc2 , bx
mov ax , tempc1
mov bx , tempc2
mov tempc2 , bx
mov tempc1 , ax
fin :
ret
endp



get_ascii proc near

        MOV AH,AL
        MOV CX,4
   for:        SHR AH,1
        loop for

         CMP AH,09h
        JLE lab1
        ADD AH,07h
 lab1:        ADD AH,30h

        AND AL,0Fh

        CMP AL,09h
        JLE lab2
        ADD AL,07h
 lab2:        ADD AL,30h



        MOV fort,AH
        MOV faible,AL


        mov dh , fort
        mov dl , faible

        mov tempC, dx
ret
endp

stack_s segment stack
    db 100h dup (?)         ;déclare une pile de 256 octets
stack_s ends



Code ENDS
END Debut

2 réponses

edfed Messages postés 69 Date d'inscription mercredi 12 décembre 2007 Statut Membre Dernière intervention 22 mars 2010 1
18 nov. 2009 à 14:39
ça, c'est ce qu'on appelle du code caca dans le jargon asm.

pourquoi ne pas faire une toute petite lib et des boucles au lieu de faire du repetitif lineaire?


me:
nop
ret
0
cs_patatalo Messages postés 1466 Date d'inscription vendredi 2 janvier 2004 Statut Modérateur Dernière intervention 14 février 2014 2
24 nov. 2009 à 14:31
salut,


Il faut qu'on devinne la question nous-mêmes ?

Hep m'dam soleil, par ici siouplai. ;-)

@++
0
Rejoignez-nous