Category : Pascal Source Code
Archive   : GTDOSERR.ZIP
Filename : GTDOSERR.PAS

 
Output of file : GTDOSERR.PAS contained in archive : GTDOSERR.ZIP

{Support Author: Questor Project (703) 525-4066 Language Conference}
{ Randall S. Burks - Co-Sysop }
{ Date: August 12, 1987 }
{ Language: Turbo Pascal 3.01A }
{ Use: Example of procedure Get_DOS_Func_Error on IBM }
{ compatible microsystems. }
{ }
{$I REGPACK.INC}
{$I GTDOSVER.INC}
{$I GTDOSERR.INC}

CONST {MAIN}

Msg_Shown = 1;
Msg_Not_Shown = 0;

VAR {MAIN}

Maj_DOS_Ver : byte;
Min_DOS_Ver : byte;
Err_Set : boolean;
Err_Code : integer;
Err_Class : byte;
Err_Action : byte;
Err_Locus : byte;

BEGIN {MAIN}

Get_DOS_Version(Maj_DOS_Ver,Min_DOS_Ver);

{Example: Getting a bogus file's date and time to produce an error}

Regs.AH := $57; {DOS function number}
Regs.AL := $00; {get file's date and time}
Regs.BX := $FFFF; {point to bogus file handle}
Intr($21,Regs); {trip interrupt}

Get_DOS_Func_Error($57,
Msg_Shown,
Maj_DOS_Ver,
Min_DOS_Ver,
Err_Set,
Err_Code,
Err_Class,
Err_Action,
Err_Locus);

{Example: Getting a bogus printer setup to producce an error}

Regs.AH := $5E; {DOS function number}
Regs.AL := $03; {Get Printer Setup}
Regs.BX := $FF; {bogus redirection list index}
Regs.ES := $FF; {bogus pointer to printer setup buffer}
Regs.DI := $FF; {bogus pointer to printer setup buffer}
Intr($21,Regs); {trip interrupt}

Get_DOS_Func_Error($5E,
Msg_Shown,
Maj_DOS_Ver,
Min_DOS_Ver,
Err_Set,
Err_Code,
Err_Class,
Err_Action,
Err_Locus);

{Example: Set bogus date}

Regs.AH := $2B;
Regs.CX := 3987;
Regs.DH := 8;
Regs.DL := 12;
Intr($21,Regs);

Get_DOS_Func_Error($2B,
Msg_Shown,
Maj_DOS_Ver,
Min_DOS_Ver,
Err_Set,
Err_Code,
Err_Class,
Err_Action,
Err_Locus);

{Example: Sequential read of bogus file}

Regs.AH := $14;
Regs.DS := $FFFF;
Regs.DX := $FFFF;
Intr($21,Regs);

Get_DOS_Func_Error($14,
Msg_Shown,
Maj_DOS_Ver,
Min_DOS_Ver,
Err_Set,
Err_Code,
Err_Class,
Err_Action,
Err_Locus);

END. {MAIN}