summaryrefslogtreecommitdiff
path: root/z180/asci1-i.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/asci1-i.180
parent1a2460dcd3bed50d5f2b7ba53e6e21a12935639b (diff)
downloadz180-stamp-e4c4b148ced1347935dff6200380e90cb3bfcde3.zip
Add unique id to fifos
Diffstat (limited to 'z180/asci1-i.180')
-rw-r--r--z180/asci1-i.18042
1 files changed, 20 insertions, 22 deletions
diff --git a/z180/asci1-i.180 b/z180/asci1-i.180
index 2410e38..15e121a 100644
--- a/z180/asci1-i.180
+++ b/z180/asci1-i.180
@@ -4,12 +4,12 @@
extrn buf.init
extrn isv_sw
-
+
global ser.init
global ser.ist,ser.in
global ser.ost,ser.out
-;TODO: define a trampoline area somewhere in top ram.
+;TODO: define a trampoline area somewhere in top ram.
rtxisvjmp equ 0FF60h ;momentan frei...
include config.inc
@@ -19,10 +19,10 @@ rtxisvjmp equ 0FF60h ;momentan frei...
;-----------------------------------------------------
dseg
-
+
buf_start:
- mkbuf ser1.inbuf,s1.rx_len
- mkbuf ser1.outbuf,s1.tx_len
+ mkbuf s1.rx_id, ser1.inbuf, s1.rx_len
+ mkbuf s1.tx_id, ser1.outbuf, s1.tx_len
buf_end:
@@ -33,7 +33,7 @@ buf_end:
;
; Init Serial I/O for console input and output (ASCI1)
;
-
+
ser.init:
; ld a,i
@@ -42,10 +42,10 @@ ser.init:
xor a ;
out0 (stat1),a ;Disable rx/tx interrupts
-
+
ld hl,rxtx_src ;move rx and tx isv to common ram
ld de,rxtx_dst ;
- ld bc,rxtx_src_e-rxtx_src ;
+ ld bc,rxtx_src_e-rxtx_src ;
ldir ;
ld hl,rtxisvjmp ;rx/tx int vector
@@ -59,7 +59,7 @@ ser.init:
; ASCI1: 8N1, highest baudrate (56700), CTS disabled
- ld a,M_MPBT
+ ld a,M_MPBT
out0 (cntlb1),a
ld a,M_RE + M_TE + M_MOD2
out0 (cntla1),a
@@ -89,21 +89,21 @@ buf.empty:
ret z
or 0ffh
ret
-
+
ser.in:
- push hl ;11
+ push hl ;11
push de ;11
- ld hl,ser1.inbuf-1 ; 9 hl = &rx.out_idx
+ ld hl,ser1.inbuf-1 ; 9 hl = &rx.out_idx
ld a,(hl) ; 6 a = rx.out_idx
dec hl ; 4 hl = &rx.in_idx
jr bg.w1
bg.wait:
halt
bg.w1:
- cp (hl) ; 6 while (out_idx==in_idx)
+ cp (hl) ; 6 while (out_idx==in_idx)
jr z,bg.wait ; 6 (/8) ;
- ld e,a ; 4
+ ld e,a ; 4
ld d,0 ; 6
inc de
inc de
@@ -111,20 +111,20 @@ bg.w1:
ex de,hl ; 3
add hl,de ;10
ld l,(hl) ; 6
- ex de,hl ; 3
+ ex de,hl ; 3
inc a ; 4
dec hl ; 4
- and (hl) ; 6
+ and (hl) ; 6
inc hl ; 4
inc hl ; 4
ld (hl),a ; 7
-
+
ld a,e ; 4
pop de ; 9
pop hl ; 9
ret ; 9
- ; 153
+ ; 153
ser.ost:
push ix
@@ -191,7 +191,7 @@ rxtxisv:
in0 d,(rdr1) ;todo: break detection
bit FE,a ;framing error?
jr nz,??ri_1
-
+
push ix
ld ix,ser1.inbuf ;
ld hl,ser1.inbuf ;
@@ -233,7 +233,7 @@ txisv:
??ti_1:
ld l,(hl)
out0 (tdr1),l ;071b
-
+
ld a,(ix+o.out_idx) ;
inc a
and (ix+o.mask)
@@ -254,5 +254,3 @@ rxtx_src_e:
end
-
-