6 ; global msg.ist,msg.in,msg.ost,msg.out
18 mkbuf 0,mtx.fifo,mtx.fifo_len
19 mkbuf 1,mrx.fifo,mrx.fifo_len
21 ;txfifo_addr equ fifolst + (0*2)
22 ;rxfifo_addr equ fifolst + (1*2)
27 ;--------------------------------------------------------------
38 ;TODO: physical to logical address translation
50 ;TODO: value should be 0
70 ;--------------------------------------------------------------
85 ;--------------------------------------------------------------
107 ld a,(ix+o.out_idx) ;
118 ;----------------------------------------------------------------------
121 ; hl: pointer to receive buffer
122 ; b: receive buffer size
124 ; data in buffer, buffer[0] has len
128 ; TODO: return number of stored chars
139 call msg.in ; get message length
146 jr z,mr_exit ; while chars in input buffer
147 call msg.in ; get next
151 or a ; if room in output buffer
153 ld (hl),e ; store char
163 ;--------------------------------------------------------------
167 ld ix,(fifolst+itx) ;
179 ;--------------------------------------------------------------
185 ld ix,(fifolst+itx) ;
214 ;--------------------------------------------------------------
220 ld ix,(fifolst+itx) ;
245 ;--------------------------------------------------------------
248 ; Works only, if buffer size < (128 - 3)
249 ; --> mask must be 03fh or less
253 ld ix,(fifolst+itx) ;
257 ld a,(ix+o.in_idx) ;14
275 ;--------------------------------------------------------------
283 ld ix,(fifolst+itx) ;12
290 TODO: ld a,low mtx.fifo ; 6 does not work with DR LINK-80
292 add a,(ix+o.in_idx) ;14
294 ld a,high mtx.fifo ; 6 does not work with DR LINK-80
299 ld a,(ix+o.in_idx) ;14
303 cp (ix+o.out_idx) ;14
307 ld (ix+o.in_idx),a ;15
308 jp pe,ms.ol ; 6/9 -- 126
318 ;--------------------------------------------------------------
326 ld ix,(fifolst+itx) ;12
335 ld c,(ix+o.in_idx) ;14
346 cp (ix+o.out_idx) ;14
352 ld (ix+o.in_idx),c ;15
353 djnz ms.ol ; 7/9 -- 130
364 ;----------------------------------------------------------------------
370 ; hl: pointer to message (netto)
386 ;----------------------------------------------------------------------
388 ; Put char in message buffer:
389 ; ix: buffer to put into
395 ld a,(ix+o.in_idx) ;19
404 and (ix+o.mask) ;19 =121
406 cp (ix+o.out_idx) ;19
408 ld (ix+o.in_idx),a ;19
415 ;----------------------------------------------------------------------
416 ; Send message MEMORY
418 ; hl: pointer to message (netto)
437 ;----------------------------------------------------------------------
438 ; Send message INLINE
464 ;--------------------------------------------------------------
479 db buf_end - $ - 1 ;output string length
480 db 0AEh ; message start token
481 db buf_end - $ - 1 ; message length
490 ;--------------------------------------------------------------