From 2a413c0df536bc1808a60598edc981152c4ec5f7 Mon Sep 17 00:00:00 2001 From: Leo C Date: Fri, 5 Jun 2015 18:31:37 +0200 Subject: [PATCH] put char-i/o in banked memory --- cbios/ascip.180 | 2 +- cbios/bioskrnl.180 | 80 +++++++++++++++++++++++----------------------- cbios/chario.180 | 35 +++++++++++++++++--- cbios/conbuf.180 | 4 +-- cbios/msgbuf.180 | 8 ++--- 5 files changed, 75 insertions(+), 54 deletions(-) diff --git a/cbios/ascip.180 b/cbios/ascip.180 index 4bb2f09..470c07e 100644 --- a/cbios/ascip.180 +++ b/cbios/ascip.180 @@ -123,7 +123,7 @@ initab1: ;-------------------------------------------------------------- - cseg + dseg as0ista: in0 a,(stat0) diff --git a/cbios/bioskrnl.180 b/cbios/bioskrnl.180 index 04f4159..79dac2c 100644 --- a/cbios/bioskrnl.180 +++ b/cbios/bioskrnl.180 @@ -226,13 +226,12 @@ getdrv: - ; CONOUT - ; Console Output. Send character in - ; to all selected devices - -conout: + ; LIST + ; List Output. Send character in + ; to all selected devices. - ld hl,(@covec) ; fetch console output bit vector +list: + ld hl,(@lovec) ; fetch list output bit vector jr out$scan @@ -245,12 +244,13 @@ auxout: jr out$scan - ; LIST - ; List Output. Send character in - ; to all selected devices. + ; CONOUT + ; Console Output. Send character in + ; to all selected devices -list: - ld hl,(@lovec) ; fetch list output bit vector +conout: + + ld hl,(@covec) ; fetch console output bit vector out$scan: ld b,0 ; start with device 0 @@ -276,13 +276,13 @@ not$out$device: ret - ; CONOST - ; Console Output Status. Return true if - ; all selected console output devices + ; LISTST + ; List Output Status. Return true if + ; all selected list output devices ; are ready. -conost: - ld hl,(@covec) ; get console output bit vector +listst: + ld hl,(@lovec) ; get list output bit vector jr ost$scan @@ -296,13 +296,13 @@ auxost: jr ost$scan - ; LISTST - ; List Output Status. Return true if - ; all selected list output devices + ; CONOST + ; Console Output Status. Return true if + ; all selected console output devices ; are ready. -listst: - ld hl,(@lovec) ; get list output bit vector +conost: + ld hl,(@covec) ; get console output bit vector ost$scan: ld b,0 ; start with device 0 @@ -383,16 +383,6 @@ ci1: ; get input, saving & ret - ; CONST - ; Console Input Status. Return true if - ; any selected console input device - ; has an available character. - -const: - ld hl,(@civec) ; get console input bit vector - jr ist$scan - - ; AUXIST ; Auxiliary Input Status. Return true if ; any selected auxiliary input device @@ -400,6 +390,16 @@ const: auxist: ld hl,(@aivec) ; get aux input bit vector + jr ist$scan + + + ; CONST + ; Console Input Status. Return true if + ; any selected console input device + ; has an available character. + +const: + ld hl,(@civec) ; get console input bit vector ist$scan: ld b,0 ; start with device 0 @@ -417,21 +417,21 @@ cis$next: ret - ; CONIN - ; Console Input. Return character from first - ; ready console input device. - -conin: - ld hl,(@civec) - jr in$scan - - ; AUXIN ; Auxiliary Input. Return character from first ; ready auxiliary input device. auxin: ld hl,(@aivec) + jr in$scan + + + ; CONIN + ; Console Input. Return character from first + ; ready console input device. + +conin: + ld hl,(@civec) in$scan: push hl ; save bit vector diff --git a/cbios/chario.180 b/cbios/chario.180 index 9a14305..428fafb 100644 --- a/cbios/chario.180 +++ b/cbios/chario.180 @@ -20,12 +20,12 @@ max$devices equ 3 - cseg ;-------------------------------------------------------------- ; Init character device ; c: device + cseg ?cinit: ; init devices b0call _cinit ret @@ -39,7 +39,6 @@ _cinit: dw as1init dw rret - cseg ;-------------------------------------------------------------- ; Character input @@ -47,7 +46,13 @@ _cinit: ; return: ; a: input char + cseg ?ci: ; character input + b0call _ci + ret + + dseg +_ci: call vector$io dw ff.in dw as0inp @@ -60,7 +65,13 @@ _cinit: ; return: ; a: 0ffh if char available, else 0 -?cist: ; character input status + cseg +?cist: ; character input + b0call _cist + ret + + dseg +_cist: ; character input status call vector$io dw ff.ist dw as0ista @@ -74,7 +85,13 @@ _cinit: ; return: ; a: output char -?co: ; character output + cseg +?co: ; character input + b0call _co + ret + + dseg +_co: ; character output call vector$io dw ff.out dw as0out @@ -89,7 +106,13 @@ _cinit: ; a: 0ffh if device ready for next output char, else 0 -?cost: ; character output status + cseg +?cost: ; character input + b0call _cost + ret + + dseg +_cost: ; character output status call vector$io dw ff.ost dw as0osta @@ -98,6 +121,7 @@ _cinit: ;-------------------------------------------------------------- + dseg vector$io: pop hl push de @@ -132,6 +156,7 @@ null$status: ;-------------------------------------------------------------- + cseg @ctbl: db 'AVRCON' ; device 0 db mb$in$out diff --git a/cbios/conbuf.180 b/cbios/conbuf.180 index 64d42dc..75741e0 100644 --- a/cbios/conbuf.180 +++ b/cbios/conbuf.180 @@ -13,7 +13,7 @@ include z180reg.inc endif - + dseg mkbuf ci.fifo_id, ci.fifo, ci.fifo_len mkbuf co.fifo_id, co.fifo, co.fifo_len @@ -40,7 +40,7 @@ ff.init: ; Input status ; buffer is empty, if output index and input index are the same - cseg + dseg ff.ist: push ix ld ix,(fifolst+ici) ; diff --git a/cbios/msgbuf.180 b/cbios/msgbuf.180 index 12d4861..27c82d4 100644 --- a/cbios/msgbuf.180 +++ b/cbios/msgbuf.180 @@ -14,9 +14,7 @@ include z180reg.inc - cseg - - + dseg mkbuf 0,mtx.fifo,mtx.fifo_len mkbuf 1,mrx.fifo,mrx.fifo_len @@ -31,7 +29,6 @@ irx equ 1*2 ; Init message fifos ; dseg - msginit: ld a,(INIDONE) cp INIDONEVAL @@ -72,8 +69,7 @@ wait: ;-------------------------------------------------------------- - cseg - + dseg msgi.st: push ix ld ix,(fifolst+irx) ; -- 2.39.2