Category : Pascal Source Code
Archive   : USNGTP.ZIP
Filename : LST07-04.PAS

 
Output of file : LST07-04.PAS contained in archive : USNGTP.ZIP
program Test_System_Calls; { CP/M version }

const RESET_DISK = 13; { Define BDOS disk reset function. }
SELECT_DISK = 14; { Define BDOS select disk function. }
GET_DRIVE_ID = 25; { Define BDOS return current drive # function. }

var logged_drive, { Global variables }
inchr : Char;

procedure Get_Logged_Drive;
var log_drv : Integer;

{ Use Bdos function 25 to obtain current logged drive id.
Store the character representation in logged_drive. }

begin
log_drv := Bdos(GET_DRIVE_ID);
logged_drive := Chr(log_drv + 65);
end { Get_Logged_Drive };

procedure Select_Drive(drive: Char);
var log_drv, dest_drv : Integer;

{ Set current logged drive to the drive indicated by the
drive parameter if that is not already the case. Reset
drives prior to change to eliminate system BDOS error.
Uses Bdos functions 13 and 14. }

begin
dest_drv := ord(drive) - 65;
log_drv := Bdos(GET_DRIVE_ID);
if log_drv <> dest_drv then
begin
Bdos(RESET_DISK);
Bdos(SELECT_DISK,dest_drv);
end;
end; { Select_Drive }

{$I LST07-06.PAS Include code for test program. }

Listing. 7-4 Subprograms illustrating the use of
CP/M-80 system function calls.




  3 Responses to “Category : Pascal Source Code
Archive   : USNGTP.ZIP
Filename : LST07-04.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/