home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 15
/
CD_ASCQ_15_070894.iso
/
vrac
/
dnalib7a.zip
/
PRINTER.BAS
< prev
next >
Wrap
BASIC Source File
|
1994-05-14
|
659b
|
18 lines
FUNCTION Printer%(Port%)PUBLIC
$CODE SEG "DNASEG2"
LOCAL Status%
REG 1, &H0200 ' set AH to 2
REG 4, Port% ' set DX to the parallel port number
CALL INTERRUPT &H17 ' call BIOS interrupt 17h
Status% = REG(1) \ 256 ' Status% is a byte read from AH
IF (Status% AND &B00000001) THEN Printer% = 1 ' printer has timed out
IF (Status% AND &B00001000) THEN Printer% = 2 ' printer has had an I/O error
IF (Status% AND &B00100000) THEN Printer% = 3 ' printer is out of paper
IF (Status% AND &B10000000) = 0 THEN Printer% = 4 ' printer is OK
END FUNCTION