1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
| PILE SEGMENT Stack
db 150H dup(?)
PILE ENDS
DATA SEGMENT
adrcom1 equ 3f8h
RBR EQU ADRCOM1
THR EQU ADRCOM1
DLL EQU ADRCOM1
DLM EQU ADRCOM1+1
IER EQU ADRCOM1+1
LCR EQU ADRCOM1+3
LSR EQU ADRCoM1+5
msg0 db 'Test de liaison en cours ...',10,13,'$'
nonc db 'Pas de laison !!',10,13,'$'
lais db 'Il y a de laison ',10,13,'$'
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
INIT PROC
MOV DX,LCR ;DLAB=1
MOV AL,80h
OUT DX,AL
;fixer le nombre de bit par seconde 2400
mov dx,dll
mov al,30h
out dx,al
mov dx,dlm
mov al,00h
out dx,al
; initialiser les interruptions
mov al,03h
mov dx,lcr
out dx,al
; IEr=0 pour desactiver les appels d'interruptions
mov al,0
mov dx,IEr
out dx,al
ret
init endp
DEB: MOV AX,DATA
MOV DS,AX
call init
tolsr: mov dx,lsr
in al,dx
test al,1
jz sec
mov dl,'>'
mov ah,02
int 21h
mov dx,rbr
in al,dx
mov [si],al
inc si
cmp al,0dh
jmp tolsr
sec: lea dx,msg0
mov ah,09h
int 21h
mov dx,thr
mov al,11000011b
out dx,al
mov ah,2ch
int 21h
mov bl,dh
add bl,10
cmp bl,60
jb et
sub bl,60
et: mov ah,2ch
int 21h
cmp bl,dh
jb ok
mov dx,lsr
in al,dx
test al,1
jz et
mov dx,rbr
in al,dx
cmp al,00111100b
jnz et
;;Afficher msg .. il y a de liason
lea dx,lais
mov ah,09
int 21h
jmp vers
ou: ;mov al,11000011b
;mov dx,thr
;out dx,al
jmp et
;;Afficher msg .. pas de liason
ok: lea dx,nonc
mov ah,09h
int 21h
jmp fin
vers: mov ax, 0b800h
mov es, ax
mov si,0
etq01: mov dx,thr
mov al,es:[si]
out dx,al
mov bx,1000
etq0: dec bx
cmp bx,0
jnz etq0
inc si
cmp si,4000
jb etq01
fin: mov ah,4ch :retour au DOS
int 21h
code ends
end deb |
Partager