;--------------------------------------------------------------\r
; put character in c in buffer\r
; destroys hl, bc\r
-; returns output char in a\r
\r
asci0_out:\r
push ix ;\r
call ff_puth\r
pop ix ;\r
di ;\r
- in0 c,(stat0) ;\r
- set TIE,c ;\r
- out0 (stat0),c ;\r
+ in0 a,(stat0) ;\r
+ or M_TIE ;\r
+ out0 (stat0),a ;\r
ei ;\r
ret\r
\r
;--------------------------------------------------------------\r
; put character in c in buffer\r
; destroys hl, bc\r
-; returns output char in a\r
\r
asci1_out:\r
push ix ;\r
call ff_puth\r
pop ix ;\r
di ;\r
- in0 c,(stat1) ;\r
- set TIE,c ;\r
- out0 (stat1),c ;\r
+ in0 a,(stat1) ;\r
+ or M_TIE ;\r
+ out0 (stat1),a ;\r
ei ;\r
ret\r
\r
\r
;--------------------------------------------------------------\r
; put character in c in buffer\r
-; destroys hl, bc\r
-; returns output char in a\r
+; destroys bc\r
\r
ff_put:\r
push ix ;\r
- pop hl ; get buffer start address\r
+ ex (sp),hl ; get buffer start address\r
\r
ld a,c ;\r
ld c,(ix+o.in_idx) ; add input index\r
ld b,0 ;\r
add hl,bc ;\r
ld (hl),a ; one place is allways free\r
- ld b,a ;\r
+ pop hl ; restore hl\r
\r
ld a,c ; bump input index\r
inc a ;\r
cp (ix+o.out_idx) ;\r
jr z,bp.wait ; while new input idx == ouput idx\r
ld (ix+o.in_idx),a ;\r
- ld a,b ;\r
ret ;\r
\r
;--------------------------------------------------------------\r
; put character in c in buffer\r
; halt cpu, while buffer is is full\r
-; destroys hl, bc\r
-; returns output char in a\r
+; destroys bc\r
\r
ff_puth:\r
push ix ;\r
- pop hl ; get buffer start address\r
+ ex (sp),hl ; get buffer start address\r
\r
ld a,c ;\r
ld c,(ix+o.in_idx) ; add input index\r
ld b,0 ;\r
add hl,bc ;\r
ld (hl),a ; one place is allways free\r
- ld b,a ;\r
+ pop hl ; restore hl\r
\r
ld a,c ; bump input index\r
inc a ;\r
cp (ix+o.out_idx) ;\r
jr z,bph.wait ; while new input idx == ouput idx\r
ld (ix+o.in_idx),a ;\r
- ld a,b ;\r
ret ;\r
\r
;--------------------------------------------------------------\r