5 ; FIFO channels for communication with avr
7 global ff.init,ff.in,ff.ist,ff.out,ff.ost
17 mkbuf ci.fifo_id, ci.fifo, ci.fifo_len
18 mkbuf co.fifo_id, co.fifo, co.fifo_len
20 ici equ ci.fifo_id * 2
21 ico equ co.fifo_id * 2
24 ;--------------------------------------------------------------
26 ; Init Serial I/O for console input and output
39 ;--------------------------------------------------------------
41 ; buffer is empty, if output index and input index are the same
57 ;--------------------------------------------------------------
59 ; buffer is full, if output index is one behind input index
84 ;--------------------------------------------------------------
86 ; buffer is full, if output index is one behind input index
103 ;--------------------------------------------------------------
104 ; put character in c in buffer
106 ; returns output char in a
110 ld ix,(fifolst+ico) ;
113 pop hl ; get buffer start address
116 ld c,(ix+o.in_idx) ; add input index
119 ld (hl),a ; one place is allways free
122 ld a,c ; bump input index
127 jr z,bp.wait ; while new input idx == ouput idx
130 out (AVRINT6),a ; tell monitor