X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp-cpm3.git/blobdiff_plain/ea5293bb6ce484bf1ec9ab70befe10c3a36a70c2..04d6fc24a26ac00992b73417c3367414c34df70d:/cbios/chario.180 diff --git a/cbios/chario.180 b/cbios/chario.180 index 3b02c8d..c4c5be6 100644 --- a/cbios/chario.180 +++ b/cbios/chario.180 @@ -11,7 +11,7 @@ extrn ff.init,ff.ist,ff.in,ff.ost,ff.out extrn as0init,as0ista,as0inp,as0osta,as0out extrn as1init,as1ista,as1inp,as1osta,as1out - + extrn _b0call include config.inc include z180reg.inc @@ -20,13 +20,18 @@ max$devices equ 3 - cseg ;-------------------------------------------------------------- ; Init character device ; c: device + cseg ?cinit: ; init devices + b0call _cinit + ret + + dseg +_cinit: ld b,c call vector$io dw ff.init @@ -34,13 +39,20 @@ max$devices equ 3 dw as1init dw rret + ;-------------------------------------------------------------- ; Character input ; b: device ; return: ; a: input char + cseg ?ci: ; character input + b0call _ci + ret + + dseg +_ci: call vector$io dw ff.in dw as0inp @@ -53,7 +65,13 @@ max$devices equ 3 ; 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 @@ -67,7 +85,13 @@ max$devices equ 3 ; 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 @@ -82,7 +106,13 @@ max$devices equ 3 ; 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 @@ -91,21 +121,24 @@ max$devices equ 3 ;-------------------------------------------------------------- + dseg vector$io: - ld a,max$devices - ld e,b -vector: pop hl - ld d,0 - cp e + push de + ld de,max$devices ; default if + ld a,b ; + cp e ; b > max$devices jr nc,exist - ld e,a ; use null device if a >= max$devices -exist: add hl,de + ld e,a +exist: + add hl,de add hl,de - ld a,(hl) + + ld e,(hl) inc hl - ld h,(hl) - ld l,a + ld d,(hl) + ex de,hl + pop de jp (hl) @@ -123,27 +156,21 @@ null$status: ;-------------------------------------------------------------- + cseg @ctbl: - db 'AVRCON' ; device 0 + db 'USB0 ' ; device 0 db mb$in$out db baud$none - db 'ASCI0 ' ; device 1 + db 'ASCI0 ' ; device 1 db mb$in$out+mb$serial+mb$soft$baud -ser0$baud: db baud$19200 - db 'ASCI1 ' ; device 2 + db 'ASCI1 ' ; device 2 db mb$in$out+mb$serial+mb$soft$baud -ser1$baud: db baud$19200 - db 0 ; table terminator - -;-------------------------------------------------------------- - - - + db 0 ; table terminator end