; SHOWIOP.Z80 iopack: call banner call gxymsg defb 3,29 defb highon defb ' Input/Output Package ',highoff,0 call getiop ; Check for existence of IOP ld a,h or l jr nz,iopack0 ; Branch if package is installed call gxymsg defb 8,22 defb 'Input/Output Packages Not Available',0 jp getcmd iopack0: call status ; Check for drivers jr nz,iopack1 ; Branch if drivers are loaded call gxymsg defb 8,21,'Input/Output Redirection Not Available',0 jp getcmd iopack1: call dispcon ; Display information for each logical device call disprdr call gxymsg defb 23,10,'Strike Any Key For Next Screen - ',0 call capine call banner ; Second screen call gxymsg defb 3,29 defb highon,' Input/Output Package ',highoff,0 call disppun call displst jp getcmd ;---------------------------------------- dispcon: call vprint defb cr,lf,lf defb highon,' Console',0 ld a,0 ; Select CON: call disp jr curr ;---------------------------------------- displst: call vprint defb cr,lf,lf defb highon,' Printer',0 ld a,3 ; Select LST: call disp jr curr ;---------------------------------------- disprdr: call vprint defb cr,lf,lf defb highon,' Reader ',0 ld a,1 ; Select RDR: call disp jr curr ;---------------------------------------- disppun: call vprint defb cr,lf,lf defb highon,' Punch ',0 ld a,2 ; Select PUN: call disp ;---------------------------------------- ; Print Name of Current Device curr: push hl ld b,a ; Save number in B push bc call vprint defb cr,lf,highon,' Assignment is ',highoff,0 push bc call status ; Get status pop bc inc b ; Add 1 for offset dec hl ; Back up curr1: inc hl ; Point to next inc hl dec b ; Count down jr nz,curr1 pop bc ; Get logical number in B ld c,(hl) ; Get physical number in C call pname0 ; Print first part of name only pop hl ret ;---------------------------------------- ; Print Names of All Physical Devices for a Logical Device disp: push hl ; Save pointer into IOP push af ; Save logical device number call vprint defb ' Devices -- ',highoff,' ',0 ld b,a ; Logical device in B push bc ; Save for later push bc ; Save it again call status ; Get status report pop bc ; Get logical device number inc b ; Add 1 for offset dec hl ; Predecrement dec hl disp1: inc hl ; Point to next device name inc hl djnz disp1 ; Count down to desired logical device pop bc ; Get B back ld c,(hl) ; Get count of physical devices ld a,c ; Check for none or a jr z,disp3 ; If so, branch disp2: push bc dec c ; Point to next name (working backwards) call print defb cr,lf,' ',0 call pnamer ; Print name (B=logical, C=physical) pop bc ; Get count dec c ; Count down jr nz,disp2 disp3: pop af pop hl ret ;---------------------------------------- ; Routine to Print Name of Selected Device ; B=logical number, C=physical number pnamer: push bc call pname0 ; Print first part of name call vprint ; Print separator defb highon,' - ',highoff,0 call pstr ; Print rest as string pop bc ret ;---------------------------------------- ; Print first part of selected device name pname0: call namer ; Get pointer to string ld b,8 ; At most 8 chars pname1: ld a,(hl) ; Get character inc hl ; Point to next char cp ' ' ; End of name? jr z,pname2 call cout ; Print character djnz pname1 ret pname2: ld a,' ' ; Pad out with spaces call cout djnz pname2 ret ;---------------------------------------- ; Basic Interface Routines status: ld de,0 ; Offset 0 runit: call getiop ; Device driver base add hl,de jp (hl) select: ld de,3 ; Offset 3 jr runit namer: ld de,6 ; Offset 6 jr runit ; End SHOWIOP.Z80