10 global ser.ost,ser.out
12 ;TODO: define a trampoline area somewhere in top ram.
13 rtxisvjmp equ 0FF60h ;momentan frei...
19 ;-----------------------------------------------------
24 mkbuf s1.rx_id, ser1.inbuf, s1.rx_len
25 mkbuf s1.tx_id, ser1.outbuf, s1.tx_len
30 ;-----------------------------------------------------
34 ; Init Serial I/O for console input and output (ASCI1)
44 out0 (stat1),a ;Disable rx/tx interrupts
46 ld hl,rxtx_src ;move rx and tx isv to common ram
48 ld bc,rxtx_src_e-rxtx_src ;
51 ld hl,rtxisvjmp ;rx/tx int vector
52 ld (ivtab + IV$ASCI1),hl;
56 ld (rtxisvjmp + 1),hl ;
58 ld (rtxisvjmp + 3),hl ;
60 ; ASCI1: 8N1, highest baudrate (56700), CTS disabled
64 ld a,M_RE + M_TE + M_MOD2
67 out0 (stat1),a ;Enable rx interrupts
96 ld hl,ser1.inbuf-1 ; 9 hl = &rx.out_idx
97 ld a,(hl) ; 6 a = rx.out_idx
98 dec hl ; 4 hl = &rx.in_idx
103 cp (hl) ; 6 while (out_idx==in_idx)
104 jr z,bg.wait ; 6 (/8) ;
178 ;------------------------------------------
179 ; ASCI 1 Transmit/Receive interupt routines
180 ; moved to common ram
184 rxtx_dst: ; (0c097h) old
188 in0 a,(stat1) ;receive flag set?
191 in0 d,(rdr1) ;todo: break detection
192 bit FE,a ;framing error?
212 in0 a,(cntla1) ;0705 c0c0
214 out0 (cntla1),a ;070a
224 ld a,(ix+o.out_idx) ;
237 ld a,(ix+o.out_idx) ;
243 in0 a,(stat1) ;0730 disable tx-int