home *** CD-ROM | disk | FTP | other *** search
- 'Sun Apr 23, 1989 2:20:12 pm
- '*****************************************************************************
- 'This routine checks to see if printer (assumes LPT1:) is turned on. If the
- 'returned value is 0 then the printer is OFF LINE, if 1 the printer is ON lINE
- '*****************************************************************************
-
- TYPE RegType
- ax AS INTEGER
- bx AS INTEGER
- cx AS INTEGER
- dx AS INTEGER
- bp AS INTEGER
- si AS INTEGER
- di AS INTEGER
- flags AS INTEGER
- END TYPE
- DIM SHARED inregs AS RegType, outregs AS RegType
- DECLARE FUNCTION printer ()
-
- PRINT printer
-
- FUNCTION printer
- inregs.ax = 2 * 256: inregs.dx = 0
- CALL interrupt(&H17, inregs, outregs)
- ah = FIX(outregs.ax / 256)
- bit7 = FIX(ah / 128)
- bit6 = FIX((ah - (bit7 * 128)) / 64)
- bit5 = FIX((ah - (bit7 * 128) - (bit6 * 64)) / 32)
- bit4 = FIX((ah - (bit7 * 128) - (bit6 * 64) - (bit5 * 32)) / 16)
- bit3 = FIX((ah - (bit7 * 128) - (bit6 * 64) - (bit5 * 32) - (bit4 * 16)) / 8)
- bit2 = FIX((ah - (bit7 * 128) - (bit6 * 64) - (bit5 * 32) - (bit4 * 16) - (bit3 * 8)) / 4)
- bit1 = FIX((ah - (bit7 * 128) - (bit6 * 64) - (bit5 * 32) - (bit4 * 16) - (bit3 * 8) - (bit2 * 4)) / 2)
- bit0 = FIX((ah - (bit7 * 128) - (bit6 * 64) - (bit5 * 32) - (bit4 * 16) - (bit3 * 8) - (bit2 * 4) - (bit1 * 2)))
- PRINT bit0; bit1; bit2; bit3; bit4; bit5; bit6; bit7
- printer = ABS(bit6)
- END FUNCTION
-
-