DOSSEG .MODEL Small .STACK 100h .DATA message1 db 'Attente du caractere sur COM2 $' recu db 0dh,0ah,'Caractere recu sur COM2 $' nrecu db 0dh,0ah,'Caractere non recu sur COM2 avant TA $' ACKARR EQU 1 NACKARR EQU 0 statut db 0 ta dw 0ffffh com2 EQU 2f8h .CODE DEBUT: mov AX,@DATA mov DS,AX mov dx,OFFSET message1 mov ah,9 int 21h tourn: mov ah,6 mov dl,0ffh int 21h cmp al,1bh ;test de la touche echap je fin call recoitchar mov dl,al mov ah,2 int 21h cmp statut,ACKARR ;caractere bien recu ? je ppp ;mov dx,OFFSET nrecu ;affichage du message non recu ;mov ah,9 ;int 21h jmp eee ppp: ;mov dx,OFFSET recu ;affichage du message recu ;mov ah,9 ;int 21h eee: jmp tourn FIN: mov AH,04Ch int 21h recoitchar proc mov statut,NACKARR boucle: dec ta cmp ta,0 je endsprog mov dx,com2+5 ;adresse du port etat de la ligne in al,dx ;reception de l'octet de l'etat de la ligne and al,00000001b ; masque cmp al,00000001b je il mov statut,NACKARR jmp boucle il: mov ta,0ffffh mov dx,com2 in al,dx mov statut,ACKARR endsprog: ret recoitchar endp END DEBUT