BBS: Inland Empire Archive Date: 03-10-92 (23:11) Number: 170 From: DONN BLY Refer#: NONE To: MIKE LININGER Recvd: NO Subj: Re: LPTx: Conf: (11) Quik_Bas
> Is there a way to peek at some memory locations to > determine which printer ports LPT1:, LPT2:, LPT3: are > available on any given system. I know you do it with on > errors and try to open the device for output, but I > would like stay away from on errors statements that > balloon the size of the code. The addresses of LPT ports 1 through three are stored in memory in the following address ranges: 0040:0008 - 0040:0009 Address of LPT1: 0040:000A - 0040:000B Address of LPT2: 0040:000C - 0040:000D Address of LPT3: In other words, to get the address of LPT1: you can do this: DEF SEG=&H40 BaseAddr% = PEEK(8) + PEEK(9)*256 DEF SEG The equipment flag is stored at 0040:0010-0040:0011, and part of that (bits 14 & 15) will tell you the number of LPT ports installed. DEF SEG=&H40 NumPorts% = (PEEK(17) AND &HC0) \ &H40 DEF SEG This information is also available from int 0x11 --- OPMED 3.00 * Origin: The Loft *HST/DS/V42bis* [NC, SDS] (1:236/7)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET