MS-QBasic version of FindLPT

REM FINDLPT - detecting available LPT ports on an IBM-PC
REM MS-DOS QBasic v1.0

DEF SEG = 0
FOR i% = 1 TO 3
    lpt% = PEEK(&H408 + (i% - 1) * 2) + PEEK(&H408 + (i% - 1) * 2 + 1) * 256
    PRINT "LPT"; HEX$(i%);
    IF lpt% = 0 THEN PRINT " not found" ELSE PRINT " found at &H"; HEX$(lpt%)
NEXT i%
END

What's all this DEF SEG = 0 stuff ? - see A note on 8086/88 Memory Segmentation


[ Back to Finding out ... ]


last updated: 18-Mar-97 Ian Harries <ih@doc.ic.ac.uk>