summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2019-05-03 08:03:48 +0200
committerLeo C2019-05-03 21:20:39 +0200
commit830b73bf0153777e6ae76ca44d64718a53b0b1b5 (patch)
treebef6f7de10d425c816f657c48b477f132e4266f3
parent99394318861405f5417a0ef46410e24adec9f57d (diff)
downloadz180-stamp-cpm3-830b73bf0153777e6ae76ca44d64718a53b0b1b5.zip
ff_put/ff_puth: preserve hl, don't return output char
-rw-r--r--cbios/ascii.18014
-rw-r--r--cbios/fifo.18016
2 files changed, 12 insertions, 18 deletions
diff --git a/cbios/ascii.180 b/cbios/ascii.180
index 2353ae0..9054549 100644
--- a/cbios/ascii.180
+++ b/cbios/ascii.180
@@ -622,7 +622,6 @@ asci1_osta:
;--------------------------------------------------------------
; put character in c in buffer
; destroys hl, bc
-; returns output char in a
asci0_out:
push ix ;
@@ -630,16 +629,15 @@ asci0_out:
call ff_puth
pop ix ;
di ;
- in0 c,(stat0) ;
- set TIE,c ;
- out0 (stat0),c ;
+ in0 a,(stat0) ;
+ or M_TIE ;
+ out0 (stat0),a ;
ei ;
ret
;--------------------------------------------------------------
; put character in c in buffer
; destroys hl, bc
-; returns output char in a
asci1_out:
push ix ;
@@ -647,9 +645,9 @@ asci1_out:
call ff_puth
pop ix ;
di ;
- in0 c,(stat1) ;
- set TIE,c ;
- out0 (stat1),c ;
+ in0 a,(stat1) ;
+ or M_TIE ;
+ out0 (stat1),a ;
ei ;
ret
diff --git a/cbios/fifo.180 b/cbios/fifo.180
index e818c5a..e1bda54 100644
--- a/cbios/fifo.180
+++ b/cbios/fifo.180
@@ -159,19 +159,18 @@ ff_full:
;--------------------------------------------------------------
; put character in c in buffer
-; destroys hl, bc
-; returns output char in a
+; destroys bc
ff_put:
push ix ;
- pop hl ; get buffer start address
+ ex (sp),hl ; get buffer start address
ld a,c ;
ld c,(ix+o.in_idx) ; add input index
ld b,0 ;
add hl,bc ;
ld (hl),a ; one place is allways free
- ld b,a ;
+ pop hl ; restore hl
ld a,c ; bump input index
inc a ;
@@ -180,25 +179,23 @@ bp.wait: ; do
cp (ix+o.out_idx) ;
jr z,bp.wait ; while new input idx == ouput idx
ld (ix+o.in_idx),a ;
- ld a,b ;
ret ;
;--------------------------------------------------------------
; put character in c in buffer
; halt cpu, while buffer is is full
-; destroys hl, bc
-; returns output char in a
+; destroys bc
ff_puth:
push ix ;
- pop hl ; get buffer start address
+ ex (sp),hl ; get buffer start address
ld a,c ;
ld c,(ix+o.in_idx) ; add input index
ld b,0 ;
add hl,bc ;
ld (hl),a ; one place is allways free
- ld b,a ;
+ pop hl ; restore hl
ld a,c ; bump input index
inc a ;
@@ -209,7 +206,6 @@ bph.wait: ; do
cp (ix+o.out_idx) ;
jr z,bph.wait ; while new input idx == ouput idx
ld (ix+o.in_idx),a ;
- ld a,b ;
ret ;
;--------------------------------------------------------------