6 ; global msg.ist,msg.in,msg.ost,msg.out
10 extrn bufinit,hwl2phy,phy2log
18 mkbuf 0,mtx.fifo,mtx.fifo_len
19 mkbuf 1,mrx.fifo,mrx.fifo_len
24 ;--------------------------------------------------------------
50 ;TODO: value should be 0
71 ;--------------------------------------------------------------
86 ;--------------------------------------------------------------
108 ld a,(ix+o.out_idx) ;
119 ;----------------------------------------------------------------------
122 ; hl: pointer to receive buffer
123 ; b: receive buffer size
125 ; data in buffer, buffer[0] has len
129 ; TODO: return number of stored chars
140 call msg.in ; get message length
147 jr z,mr_exit ; while chars in input buffer
148 call msg.in ; get next
152 or a ; if room in output buffer
154 ld (hl),e ; store char
164 ;--------------------------------------------------------------
168 ld ix,(fifolst+itx) ;
180 ;--------------------------------------------------------------
186 ld ix,(fifolst+itx) ;
215 ;--------------------------------------------------------------
221 ld ix,(fifolst+itx) ;
246 ;--------------------------------------------------------------
249 ; Works only, if buffer size < (128 - 3)
250 ; --> mask must be 03fh or less
254 ld ix,(fifolst+itx) ;
258 ld a,(ix+o.in_idx) ;14
276 ;--------------------------------------------------------------
284 ld ix,(fifolst+itx) ;12
291 TODO: ld a,low mtx.fifo ; 6 does not work with DR LINK-80
293 add a,(ix+o.in_idx) ;14
295 ld a,high mtx.fifo ; 6 does not work with DR LINK-80
300 ld a,(ix+o.in_idx) ;14
304 cp (ix+o.out_idx) ;14
308 ld (ix+o.in_idx),a ;15
309 jp pe,ms.ol ; 6/9 -- 126
319 ;--------------------------------------------------------------
327 ld ix,(fifolst+itx) ;12
336 ld c,(ix+o.in_idx) ;14
347 cp (ix+o.out_idx) ;14
353 ld (ix+o.in_idx),c ;15
354 djnz ms.ol ; 7/9 -- 130
365 ;----------------------------------------------------------------------
371 ; hl: pointer to message (netto)
387 ;----------------------------------------------------------------------
389 ; Put char in message buffer:
390 ; ix: buffer to put into
396 ld a,(ix+o.in_idx) ;19
405 and (ix+o.mask) ;19 =121
407 cp (ix+o.out_idx) ;19
409 ld (ix+o.in_idx),a ;19
416 ;----------------------------------------------------------------------
417 ; Send message MEMORY
419 ; hl: pointer to message (netto)
438 ;----------------------------------------------------------------------
439 ; Send message INLINE
465 ;--------------------------------------------------------------
480 db buf_end - $ - 1 ;output string length
481 db 0AEh ; message start token
482 db buf_end - $ - 1 ; message length
491 ;--------------------------------------------------------------