X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Wed, 23 Feb 2005 11:47:34 +0100 From: Gisle Vanem Subject: Re: Differences in LPT1 base address in protected/real mode? To: djgpp AT delorie DOT com Message-id: <0b4a01c51995$14f74ca0$0600000a@broadpark.no> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Outlook Express 6.00.2900.2180 Content-type: text/plain; format=flowed; charset=iso-8859-1; reply-type=original Content-transfer-encoding: 7BIT X-Priority: 3 X-MSMail-priority: Normal References: Reply-To: djgpp AT delorie DOT com "Karl-Heinz Pischke" wrote: > if I try to get the LPT1 base address at 0x408 with inportw I get > FFFFh back instead of the expected 7803h ... as I googled around just > now I found out that there is a significant difference in the > addressing of memory between real and protected mode ... I guess this > is the crux of the 'phenomenon' ... unfortunately I didn't found any > document so far that could help me with finding the correct address of > 0040h:0008h in the protected mode ... is anyone here in the know how > to get the LPT1 base adress from bios in protected mode? DOS memory (range 0-1MB physical) must be refered to using the _dos_ds selector. For example: #include #include unsigned short base = _farpeekw (_dos_ds, 0x408); --gv