\r
extrn ?ci,?co,?cist,?cost ; each take device in <B>\r
extrn ?cinit ; (re)initialize device in <C>\r
+ extrn ioctl\r
extrn @ctbl ; physical character device table\r
\r
; disk communication data items\r
\r
extrn ?time ; signal time operation\r
\r
- include modebaud.inc ; define mode bits\r
+ extrn stampf\r
+ extrn ijphl ; vectored call\r
+\r
+ maclib modebaud.inc ; define mode bits\r
\r
\r
; External names for BIOS entry points\r
?stbnk: jp setbnk ; select different bank for disk I/O DMA operations\r
?xmov: jp ?xmove ; set source and destination banks for one operation\r
\r
+ jp stampf ; stamp system specific functions\r
+ ; reserved for system implementor\r
jp 0 ; reserved for future expansion\r
jp 0 ; reserved for future expansion\r
- jp 0 ; reserved for future expansion\r
+?ioctl jp ioctl ;\r
\r
\r
; BOOT\r
ld (@ADRV),bc ; save absolute and relative drive code\r
ld l,(ix-4)\r
ld h,(ix-3) ; get init pointer\r
- call ipchl ; call init routine\r
+ call ijphl ; call init routine\r
pop hl ; recover @drv pointer\r
d$init$next:\r
pop bc ; recover counter and drive #\r
conin:\r
ld hl,(@civec)\r
\r
+ ;check if only one device assigned\r
+\r
+ push hl ; save bit vector\r
+ ld b,0\r
+insc_0:\r
+ or a ; clear carry\r
+ adc hl,hl ; shift out next bit\r
+ jr nc,insc_1 ;\r
+ jr z,ci$rdy ; single device\r
+ jr ci$check ;\r
+\r
+insc_1:\r
+ inc b ; else, next device\r
+ ld a,h\r
+ or l ; see if any more devices\r
+ jr nz,insc_0 ; no,\r
+ pop hl\r
+\r
in$scan:\r
push hl ; save bit vector\r
ld b,0\r
ci$next:\r
xor a ; assume next device not ready\r
add hl,hl ; shift out next bit\r
+ci$check:\r
call c,cist1 ; see if the device has a character\r
jr nz,ci$rdy ; this device has a character\r
inc b ; else, next device\r
;-------------------------------------------------------------------------------\r
; Utility Subroutines\r
\r
-\r
-ipchl: ; vectored CALL point\r
- jp (hl)\r
-\r
-\r
-\r
; BNKSEL\r
; Bank Select. Select CPU bank for further execution.\r
\r
inc hl\r
ld h,(hl)\r
ld l,a\r
- call ipchl ; call LOGIN\r
-notfirst:\r
+ call ijphl ; call LOGIN\r
ld hl,(@xdph) ; recover DPH pointer\r
ret\r
\r