babbiverus
Messages postés1Date d'inscriptionvendredi 14 novembre 2008StatutMembreDernière intervention14 novembre 2008
-
14 nov. 2008 à 16:58
cs_phlyper
Messages postés8Date d'inscriptionmercredi 30 janvier 2008StatutMembreDernière intervention21 janvier 2016
-
25 nov. 2010 à 12:58
main proc
mov ax,@Data
mov ds, ax
mov si,offset tab
mov cx, 16
mov bx,0
saisie:
mov dx,offset commande;afficher "saisir un nombre"
mov ah,9
int 21h
mov ah, 1;saisie d'un élément
int 21h
mov BYTE PTR[si], al
cmp al,35;comparaison avec le caractère"#"
JE affiche;jump si égalisation
add si,type word ;incrémeter 'indice'
inc bx
loop saisie
Jmp affiche;appeller l'étiquette 'affiche'
affiche:mov dx,offset msg
mov ah,9
int 21h
mov ax,bx ;instructions de l'étiquette 'affiche'
mov dl, al
Add dl, 48;instructions utilisés pour faire l'affichage de l'indice
mov ah, 2;
int 21h;l'affichage de la taille
etap1: mov si,offset tab
mov cx,bx
parcours:mov ax,word PTR [si]
cmp ax,48
je Nul
shr ax,1
Ja paire
Jb impaire
Nul: mov al,BYTE PTR [ax]
mov dl,al ;affichage de l'indice de l'élément null
Add dl, 48
mov ah, 2
int 21h
mov dx,offset nb_nul
mov ah,9
int 21h
mov ax,bx
sub ax,cx
mov dl,al
mov ah,2
int 21h
add si,2
loop parcours
jmp Fin
paire: mov s,ax
mov dx,offset pair
mov ah,9
int 21h
mov ax,s
shl ax,1
mul word PTR[si]
mov dl,al
Add dl, 48
mov ah, 2
int 21h
add si,2
inc nb_pair
loop parcours
jmp Fin