Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question.model small .stack 200h .data msg db 10,13,"saisir une phrase : $" msg1 db 10,13,"la chaine saisie est : $" msg2 db 10,13,"la taille de la chaine saisie est : $" chaine db 1024 dup("$") compteur dw 0 fincompteur LABEL BYTE .code start: mov ax,@data mov ds, ax mov ah,9 mov dx,offset msg int 21h lea si,chaine comparaison: mov ah,1 int 21h cmp al,"0" jz yess inc [compteur] mov [si],al inc si jmp comparaison yess: mov ah,9 mov dx,offset msg1 int 21h mov ah,9 lea dx,chaine int 21h xor ax,ax mov ax,[Compteur] mov bx,OFFSET fincompteur-1 mov cx,5 call ConvertBinEnChaine mov bx,offset msg2 call affichage mov ah,4ch int 21h affichage PROC push ax push dx mov ah,9 mov dx,bx int 21h pop dx pop ax ret affichage ENDP ConvertBinEnChaine PROC mov si,10 ConvertLoop: sub dx,dx div si add dl,'0' mov [bx],dl dec bx loop ConvertLoop ret ConvertBinEnChaine ENDP end start