6 ; global msg.ist,msg.in,msg.ost,msg.out
20 mkbuf 0,mtx.fifo,mtx.fifo_len
21 mkbuf 1,mrx.fifo,mrx.fifo_len
23 ;txfifo_addr equ fifolst + (0*3)
24 ;rxfifo_addr equ fifolst + (1*3)
29 ;--------------------------------------------------------------
57 ;--------------------------------------------------------------
73 ;--------------------------------------------------------------
106 ;----------------------------------------------------------------------
109 ; hl: pointer to receive buffer
110 ; b: receive buffer size
112 ; data in buffer, buffer[0] has len
116 ; TODO: return number of stored chars
127 call msg.in ; get message length
134 jr z,mr_exit ; while chars in input buffer
135 call msg.in ; get next
139 or a ; if room in output buffer
141 ld (hl),e ; store char
151 ;--------------------------------------------------------------
155 ld ix,(fifolst+itx) ;
167 ;--------------------------------------------------------------
173 ld ix,(fifolst+itx) ;
202 ;--------------------------------------------------------------
208 ld ix,(fifolst+itx) ;
233 ;--------------------------------------------------------------
236 ; Works only, if buffer size < (128 - 3)
237 ; --> mask must be 03fh or less
241 ld ix,(fifolst+itx) ;
245 ld a,(ix+o.in_idx) ;14
263 ;--------------------------------------------------------------
271 ld ix,(fifolst+itx) ;12
278 TODO: ld a,low mtx.fifo ; 6 does not work with DR LINK-80
280 add a,(ix+o.in_idx) ;14
282 ld a,high mtx.fifo ; 6 does not work with DR LINK-80
287 ld a,(ix+o.in_idx) ;14
291 cp (ix+o.out_idx) ;14
295 ld (ix+o.in_idx),a ;15
296 jp pe,ms.ol ; 6/9 -- 126
306 ;--------------------------------------------------------------
314 ld ix,(fifolst+itx) ;12
323 ld c,(ix+o.in_idx) ;14
334 cp (ix+o.out_idx) ;14
340 ld (ix+o.in_idx),c ;15
341 djnz ms.ol ; 7/9 -- 130
352 ;----------------------------------------------------------------------
358 ; hl: pointer to message (netto)
374 ;----------------------------------------------------------------------
376 ; Put char in message buffer:
377 ; ix: buffer to put into
383 ld a,(ix+o.in_idx) ;19
392 and (ix+o.mask) ;19 =121
394 cp (ix+o.out_idx) ;19
396 ld (ix+o.in_idx),a ;19
403 ;----------------------------------------------------------------------
404 ; Send message MEMORY
406 ; hl: pointer to message (netto)
425 ;----------------------------------------------------------------------
426 ; Send message INLINE
452 ;--------------------------------------------------------------
467 db buf_end - $ - 1 ;output string length
468 db 0AEh ; message start token
469 db buf_end - $ - 1 ; message length
478 ;--------------------------------------------------------------