DOSSEG .MODEL Small .STACK 100h .DATA message1 db 'caractere a decoder: $' message2 db 0dh,0ah,'Apres decodage $' .CODE DEBUT: mov AX,@DATA mov DS,AX mov dx,offset message1 mov ah,9 int 21h mov ax,0100110001000001b mov cl,al mov al,ah push ax call EN_BINAIRE mov al,cl push ax call EN_BINAIRE mov ax,0100110001000001b call decodage push ax mov dx,offset message2 mov ah,9 int 21h pop ax push ax call EN_BINAIRE FIN: mov AH,04Ch int 21h decodage proc mov cl,4 shl al,cl shr ax,cl ret decodage endp EN_BINAIRE proc pop dx pop ax push dx mov si,1 dpour: cmp SI,8 ;test de la boucle jg fpour ;idem mov ah,0 shl AX,1 ;decalage de AL ds AH add AH,30h ;conversion en ASCII mov DL,AH ;preparation de l'affichage de AH en le mettant ds DL push AX ;sauvegarde de AX mov AH,02 ;Affichage int 21h ;idem pop ax inc si jmp dpour ;saut de boucle pour fpour: ret EN_BINAIRE endp END DEBUT