summaryrefslogtreecommitdiff
path: root/z180/msgfifo.180
diff options
context:
space:
mode:
authorLeo C2015-05-10 12:54:12 +0200
committerLeo C2015-05-10 12:54:12 +0200
commite4c4b148ced1347935dff6200380e90cb3bfcde3 (patch)
tree9ec51f8058aebc22d1b3ff415f4b15ab01ceedb6 /z180/msgfifo.180
parent1a2460dcd3bed50d5f2b7ba53e6e21a12935639b (diff)
downloadz180-stamp-e4c4b148ced1347935dff6200380e90cb3bfcde3.zip
Add unique id to fifos
Diffstat (limited to 'z180/msgfifo.180')
-rw-r--r--z180/msgfifo.18027
1 files changed, 13 insertions, 14 deletions
diff --git a/z180/msgfifo.180 b/z180/msgfifo.180
index 582c219..cf1ae2a 100644
--- a/z180/msgfifo.180
+++ b/z180/msgfifo.180
@@ -1,11 +1,11 @@
page 255
.z80
-
+
global msg_rx_fifo,msg_tx_fifo
global msginit,msgi.st,msg.in,msgo.st,msg.out
global msg.sout,msg.co
-
+
extrn buf.init
include config.inc
@@ -15,8 +15,8 @@
dseg
- mkbuf msg_rx_fifo,msg_rx_fifo_len
- mkbuf msg_tx_fifo,msg_tx_fifo_len
+ mkbuf mtx.fifo_id, msg_tx_fifo, msg_tx_fifo_len
+ mkbuf mrx.fifo_id, msg_rx_fifo, msg_rx_fifo_len
@@ -27,7 +27,7 @@
;
; Init buffer
;
-
+
msginit:
ld ix,msg_rx_fifo
ld a,msg_rx_fifo.mask
@@ -49,7 +49,7 @@ buf.empty:
ret z
or 0ffh
ret
-
+
;--------------------------------------------------------------
msg.in:
@@ -71,12 +71,12 @@ bg.wait:
inc h
bg.nc:
ld l,(hl)
-
+
ld a,(ix+o.out_idx) ;
inc a
and (ix+o.mask)
ld (ix+o.out_idx),a
-
+
ld a,l
pop hl
pop ix
@@ -122,7 +122,7 @@ bp.wait:
jr z,bp.wait
ld (hl),b
ld (ix+o.in_idx),a
-
+
ld a,b
out0 (AVRINT5),a
pop bc
@@ -152,7 +152,7 @@ bp.wait:
ld a,b
out (PMSG),a
ld (ix+o.in_idx),c
-
+
pop bc
pop ix
ret
@@ -171,7 +171,7 @@ msg.sout:
ld b,(hl) ;
inc hl
ex de,hl
-
+
ms.ol:
push ix
pop hl
@@ -242,8 +242,8 @@ msg.co:
pop hl
pop af
ret
-
-
+
+
buf:
db buf_end - $ - 1 ;output string length
db 081h ; message start token
@@ -257,4 +257,3 @@ buf_end:
;----------------------------------------------------------------------
end
-