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