From: Leo C Date: Fri, 3 May 2019 06:03:48 +0000 (+0200) Subject: ff_put/ff_puth: preserve hl, don't return output char X-Git-Tag: hexrel-6.9~3 X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp-cpm3.git/commitdiff_plain/830b73bf0153777e6ae76ca44d64718a53b0b1b5 ff_put/ff_puth: preserve hl, don't return output char --- 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 ; ;--------------------------------------------------------------