]> cloudbase.mooo.com Git - z180-stamp-cpm3.git/blame - cbios/conbuf.180
ascii.180 interrupt driver for ASCI 0/1
[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
7 global ff.init,ff.in,ff.ist,ff.out,ff.ost\r
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
14 include z180reg.inc\r
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
L
23\r
24\r
25;--------------------------------------------------------------\r
26\r
27; Init Serial I/O for console input and output\r
28;\r
50f3b8f0 29 dseg\r
ea5293bb
L
30ff.init:\r
31 ld a,(INIDONE)\r
32 cp INIDONEVAL\r
33 ret z\r
34\r
35 ld ix,ci.fifo\r
ea5293bb
L
36 call bufinit\r
37 ld ix,co.fifo\r
ea5293bb
L
38 jp bufinit\r
39\r
40;--------------------------------------------------------------\r
40df51ae 41; Input status\r
ea5293bb 42\r
2a413c0d 43 dseg\r
ea5293bb
L
44ff.ist:\r
45 push ix\r
46 ld ix,(fifolst+ici) ;\r
d6829fd3 47 call ff_empty\r
ea5293bb 48 pop ix\r
ea5293bb
L
49 ret\r
50\r
40df51ae 51;--------------------------------------------------------------\r
d6829fd3 52; Get an input character \r
40df51ae 53\r
ea5293bb
L
54ff.in:\r
55 push ix\r
56 ld ix,(fifolst+ici) ;\r
d6829fd3 57 call ff_get\r
ea5293bb
L
58 pop ix\r
59 ret\r
60\r
61;--------------------------------------------------------------\r
40df51ae 62; Output status\r
ea5293bb
L
63\r
64ff.ost:\r
65 push ix\r
40df51ae 66 ld ix,(fifolst+ico) ;\r
d6829fd3 67 call ff_full\r
ea5293bb 68 pop ix\r
ea5293bb
L
69 ret\r
70\r
71\r
40df51ae
L
72;--------------------------------------------------------------\r
73; put character in c in buffer\r
74; destroys hl, bc\r
75; returns output char in a\r
ea5293bb
L
76\r
77ff.out:\r
40df51ae
L
78 push ix ;\r
79 ld ix,(fifolst+ico) ;\r
d6829fd3 80 call ff_put\r
40df51ae 81 out (AVRINT6),a ; tell monitor\r
40df51ae 82 pop ix ;\r
d6829fd3 83 ret\r
ea5293bb
L
84\r
85 end\r
d6829fd3 86\r