{***********************************************************************}
{									}
{ __StatPrt   Return the printer status via the BIOS			}
{									}
{ procedure __StatPrt(PortNo : byte; var Status : byte);		}
{									}
{	      PortNo	The printer port number. 0 = lpt1, 1 = lpt2 and }
{			2 = lpt3 are the only valid values.  The status }
{			parameter is not altered if a value out of	}
{			range is specified.				}
{	      Status	The returned status.  The value may be a com-	}
{			bination of the following:			}
{									}
{			($01) _TIMEOUT_PRT				}
{			($08) _IOERROR_PRT				}
{			($10) _ONLINE_PRT				}
{			($20) _NOPAPER_PRT				}
{			($40) _ACK_PRT					}
{			($80) _NOTBUSY_PRT				}
{									}
{			The values are added together to specify more	}
{			than one event. 				}
{									}
{ Description This procedure calls the BIOS printer service ($17),	}
{	      subfunction 2 to return the printer status.		}
{									}
{	      If an invalid port number is specified (only 0 through 2	}
{	      are allowed), or if there is no physical printer port	}
{	      associated, no action is taken.  In the former case,	}
{	      Status byte is not altered.				}
{									}
{ Version     4.00 (C)Copyright Blaise Computing Inc.  1987		}
{_______________________________________________________________________}

procedure __StatPrt(PortNo : byte; var Status : byte);

  var
    Reg : registers;

  begin {__StatPrt}

    if (PortNo > 2) then
       Exit;			       { Invalid port number		}

    with Reg do
      begin
	AH := 2;
	DX := PortNo;
	Intr($17,Reg);
	Status := AH
      end

  end;	{__StatPrt}
