Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: wilsonl AT sfu DOT ca (Wilson Wang Shun Leung) Date: Mon, 23 Jun 1997 17:09:57 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: "far" pointer question CC: djgpp AT delorie DOT com Precedence: bulk wilsonl AT sfu DOT ca (Wilson Wang Shun Leung) wrote: > But now my question is how I can convert the information > I have to a pointer which I can actually use for > read/write data. What I now have is a selector (the > content that goes to segment register) and a offset of > zero. Look in the sys/farptr.h file, you'll find the macros to use these values. > Can I just use the real mode calculation like > this one: > int *port; > port = ((DWORD)selector) * 16 + offset No way!. > where DWORD is 32 bit wide and selector is 16 bit. > > My specific questions are > Is the pointer I defined (port) 32 bit wide? > What if my offset is 32 bit wide? Then the above > calculation should be all wrong. All wrong, the value is a SELECTOR not a SEGMENT, you must put the selector in one of the segment (read selector ;-) registers and use the 32 pointer. > Am I missing something? Yes, look the macros. SET ------------------------------------ 0 -------------------------------- Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013