]> cloudbase.mooo.com Git - z180-stamp-cpm3.git/blob - cbios/conbuf.180
Update IXON flag from character device table (@ctbl)
[z180-stamp-cpm3.git] / cbios / conbuf.180
1 page 255
2 .z80
3
4 ;
5 ; FIFO channels for communication with avr
6 ;
7 global ff_dev
8
9 extrn ff_empty,ff_get,ff_full,ff_put
10 extrn bufinit,fifolst
11
12 include config.inc
13 if CPU_Z180
14 maclib z180reg.inc
15 endif
16
17 dseg
18 mkbuf ci.fifo_id, ci.fifo, ci.fifo_len
19 mkbuf co.fifo_id, co.fifo, co.fifo_len
20
21 ici equ ci.fifo_id * 2
22 ico equ co.fifo_id * 2
23
24 ;--------------------------------------------------------------
25
26 dseg
27
28 dw ff.out
29 dw ff.ost
30 dw ff.in
31 dw ff.ist
32 dw ff.init
33 ff_dev:
34
35 ;--------------------------------------------------------------
36
37 ; Init Serial I/O for console input and output
38 ;
39 dseg
40 ff.init:
41 ld a,(INIDONE)
42 cp INIDONEVAL
43 ret z
44
45 ld ix,ci.fifo
46 call bufinit
47 ld ix,co.fifo
48 jp bufinit
49
50 ;--------------------------------------------------------------
51 ; Input status
52
53 dseg
54 ff.ist:
55 push ix
56 ld ix,(fifolst+ici) ;
57 call ff_empty
58 pop ix
59 ret
60
61 ;--------------------------------------------------------------
62 ; Get an input character
63
64 ff.in:
65 push ix
66 ld ix,(fifolst+ici) ;
67 call ff_get
68 pop ix
69 ret
70
71 ;--------------------------------------------------------------
72 ; Output status
73
74 ff.ost:
75 push ix
76 ld ix,(fifolst+ico) ;
77 call ff_full
78 pop ix
79 ret
80
81
82 ;--------------------------------------------------------------
83 ; put character in c in buffer
84 ; destroys hl, bc
85 ; returns output char in a
86
87 ff.out:
88 push ix ;
89 ld ix,(fifolst+ico) ;
90 call ff_put
91 out (AVRINT6),a ; tell monitor
92 pop ix ;
93 ret
94
95 end