3 ; Interrupt drivers for ASCI0 and ASCI1
13 extrn ff_empty,ff_get,ff_full,ff_put,ff_cnt
24 ;-----------------------------------------------------
28 mkbuf s0.rx_id, s0.inbuf, s0.rx_len
29 mkbuf s0.tx_id, s0.outbuf,s0.tx_len
30 mkbuf s1.rx_id, s1.inbuf, s1.rx_len
31 mkbuf s1.tx_id, s1.outbuf, s1.tx_len
37 ;--------------------------------------------------------------
38 ; Init Serial I/O for input and output (ASCI 0/1)
56 out0 (stat0),a ;Disable rx/tx interrupts
57 ld c,0 ;asci channel number
59 ld hl,rtxisvjmp0 ;rx/tx int vector
60 ld (ivtab + IV$ASCI0),hl ;
67 out0 (stat0),a ;Enable rx interrupts
72 out0 (stat1),a ;Disable rx/tx interrupts
73 ld c,1 ;asci channel number
76 ld hl,rtxisvjmp1 ;rx/tx int vector
77 ld (ivtab + IV$ASCI1),hl ;
86 out0 (stat1),a ;Enable rx interrupts
98 ;--------------------------------------------------------------
108 ;--------------------------------------------------------------
117 ;--------------------------------------------------------------
118 ; Get an input character
137 ;--------------------------------------------------------------
138 ; Get an input character
147 ;--------------------------------------------------------------
157 ;--------------------------------------------------------------
167 ;--------------------------------------------------------------
168 ; put character in c in buffer
170 ; returns output char in a
184 ;--------------------------------------------------------------
185 ; put character in c in buffer
187 ; returns output char in a
202 ;------------------------------------------
203 ; ASCI 1 Transmit/Receive interupt routines
207 in0 e,(stat0) ;receive flag set? 5
210 in0 a,(rdr0) ;todo: break detection 9
213 bit FE,e ;framing error?
229 jr z,$+5 ;skip if buffer is full
236 set RTS0,d ;RTS inactive
248 ld a,(ix+o.out_idx) ;
249 cp (ix+o.in_idx) ;if index.in == index.out
250 jr z,?0ti_2 ; buffer empty
264 res TIE,e ;disable tx-int
270 ;------------------------------------------
271 ; ASCI 1 Transmit/Receive interupt routines
275 in0 e,(stat1) ;receive flag set? 5
278 in0 d,(rdr1) ;todo: break detection 9
279 bit FE,e ;framing error?
294 jr z,$+5 ;skip if buffer is full
307 ld a,(ix+o.out_idx) ;
308 cp (ix+o.in_idx) ;if index.in == index.out
309 jr z,??ti_2 ; buffer empty
323 res TIE,e ;disable tx-int