On 17 Sep 2003 at 11:22, Ken Pergola wrote: > Alan Cave wrote: > > >> Hex 378 is the usual address for a modern computer's LPT1 > > Hi Alan > > It is always best to get the address of LPT1, LPT2, or LPT2 > *programatically* -- you really cannot rely on this assumption. > > This can be done easily with the 'peek' command at the BIOS addresses > listed in my post. (Just remember little-endian byte ordering.) > I agree that it would be ideal to determine address of LPT1, LPT2 etc from QBASIC. But although I had an initial success some years ago (perhaps using a 286) I can't seem to make it work any more. Your method using debug works for me and if I was writing code to be used on my own machine I would simply use the debug method and customise my BASIC code for my own machine. 286's used different addressing than later CPU's but if anyone knows how to get LPT addresses using QBASIC on any computer running DOS or non-NT windows I would be very interested in the exact code to do that. I note that the bytes for LPT1 are always at 0040:08 (LSB) and 0040:09(MSB) and LPT2 always at 40:0A (LSB) and 40:0B (MSB) ie if you do (from DOS prompt) debug d 40:0 0040:0000 F8 03 F8 02 E8 03 E8 02-(BC 03) 78 03 78 02 00 00 Brackets inserted by me Gives LPT1 as 3BC as data was stored in little endian format I have just discovered than when I boot into win2k I get Hex 3BC as lpt1 and with win95 I get Hex 378 as lpt1 -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body