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 ;--------------------------------------------------------------
59 ;--------------------------------------------------------------
75 ;--------------------------------------------------------------
108 ;----------------------------------------------------------------------
111 ; hl: pointer to receive buffer
112 ; b: receive buffer size
114 ; data in buffer, buffer[0] has len
118 ; TODO: return number of stored chars
129 call msg.in ; get message length
136 jr z,mr_exit ; while chars in input buffer
137 call msg.in ; get next
141 or a ; if room in output buffer
143 ld (hl),e ; store char
153 ;--------------------------------------------------------------
157 ld ix,(fifolst+itx) ;
169 ;--------------------------------------------------------------
175 ld ix,(fifolst+itx) ;
204 ;--------------------------------------------------------------
210 ld ix,(fifolst+itx) ;
235 ;--------------------------------------------------------------
238 ; Works only, if buffer size < (128 - 3)
239 ; --> mask must be 03fh or less
243 ld ix,(fifolst+itx) ;
247 ld a,(ix+o.in_idx) ;14
265 ;--------------------------------------------------------------
273 ld ix,(fifolst+itx) ;12
280 TODO: ld a,low mtx.fifo ; 6 does not work with DR LINK-80
282 add a,(ix+o.in_idx) ;14
284 ld a,high mtx.fifo ; 6 does not work with DR LINK-80
289 ld a,(ix+o.in_idx) ;14
293 cp (ix+o.out_idx) ;14
297 ld (ix+o.in_idx),a ;15
298 jp pe,ms.ol ; 6/9 -- 126
308 ;--------------------------------------------------------------
316 ld ix,(fifolst+itx) ;12
325 ld c,(ix+o.in_idx) ;14
336 cp (ix+o.out_idx) ;14
342 ld (ix+o.in_idx),c ;15
343 djnz ms.ol ; 7/9 -- 130
354 ;----------------------------------------------------------------------
360 ; hl: pointer to message (netto)
376 ;----------------------------------------------------------------------
378 ; Put char in message buffer:
379 ; ix: buffer to put into
385 ld a,(ix+o.in_idx) ;19
394 and (ix+o.mask) ;19 =121
396 cp (ix+o.out_idx) ;19
398 ld (ix+o.in_idx),a ;19
405 ;----------------------------------------------------------------------
406 ; Send message MEMORY
408 ; hl: pointer to message (netto)
427 ;----------------------------------------------------------------------
428 ; Send message INLINE
454 ;--------------------------------------------------------------
469 db buf_end - $ - 1 ;output string length
470 db 0AEh ; message start token
471 db buf_end - $ - 1 ; message length
480 ;--------------------------------------------------------------