🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #53568

Re: pointer to segment:offset values for djgpp port of gcc

#53568
From: DJ Delorie
Date: Tue, 29 Oct 1991 21:32
20 lines
1679 bytes
In article <1991Oct29.153510.1041@colorado.edu>, gordon@news.colorado.edu (GORDON ALLEN R) writes:
> Some compilers, like turbo C allow conversion of a pointer to be converted
> to the segment:offset notation used by '386 machines.  EG., TC has a function
> FP_SEG(farpointer) to return the segment value of the pointer.  Is there a 
> similar function in '386/MSDOS port of gcc?  Also, for the offset value? 

go32 maps physical memory to 0xe0000000 in the virtual space.  You
have to do the usual "segment * 16 + offset" math, then add
0xe0000000.  I don't recall if libpc.a <pc.h> gives an array that
refers to the physical memory; it does for the video memory.

Note that gcc for i386 doesn't understand the concept of a pointer at
all, and go32 always fixes up the pointer values (given in the offset
register) properly for you.  There should be little need for this
conversion unless you really need to peek into the physical memory
map, in which case you would have already known about the 0xe0000000.

DJ
dj@ctron.com
Life is a banana.
Technical Details
Message-ID: <2499@balrog.ctron.com>
Path: arc1-ca.pugleaf.net!gmdzi!zeus.ieee.org!sdd.hp.com!cs.utexas.edu!samsung!balrog!ctron.com
References: <1991Oct29.153510.1041@colorado.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,d18439b93997c163
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1991-10-29 14:18:25 PST
Path: arc1-ca.pugleaf.net!gmdzi!zeus.ieee.org!sdd.hp.com!cs.utexas.edu!samsung!balrog!ctron.com
From: dj@ctron.com (DJ Delorie)
Newsgroups: gnu.gcc.help
Subject: Re: pointer to segment:offset values for djgpp port of gcc
Message-ID: <2499@balrog.ctron.com>
Date: 29 Oct 91 21:32:43 GMT
References: <1991Oct29.153510.1041@colorado.edu>
Sender: news@balrog.ctron.com
Reply-To: dj@ctron.com
Organization: None whatsoever
Lines: 20
Nntp-Posting-Host: bragi