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
136 ;--------------------------------------------------------------
137 ; Get an input character
146 ;--------------------------------------------------------------
156 ;--------------------------------------------------------------
166 ;--------------------------------------------------------------
167 ; put character in c in buffer
169 ; returns output char in a
183 ;--------------------------------------------------------------
184 ; put character in c in buffer
186 ; returns output char in a
201 ;------------------------------------------
202 ; ASCI 1 Transmit/Receive interupt routines
206 in0 e,(stat0) ;receive flag set? 5
209 in0 a,(rdr0) ;todo: break detection 9
212 bit FE,e ;framing error?
228 jr z,$+5 ;skip if buffer is full
235 set RTS0,d ;RTS inactive
247 ld a,(ix+o.out_idx) ;
248 cp (ix+o.in_idx) ;if index.in == index.out
249 jr z,?0ti_2 ; buffer empty
263 res TIE,e ;disable tx-int
269 ;------------------------------------------
270 ; ASCI 1 Transmit/Receive interupt routines
274 in0 e,(stat1) ;receive flag set? 5
277 in0 d,(rdr1) ;todo: break detection 9
278 bit FE,e ;framing error?
293 jr z,$+5 ;skip if buffer is full
306 ld a,(ix+o.out_idx) ;
307 cp (ix+o.in_idx) ;if index.in == index.out
308 jr z,??ti_2 ; buffer empty
322 res TIE,e ;disable tx-int