🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.asm.x86
9 messages
9 total messages Started by assassin17 Fri, 14 May 1999 00:00
DOSSEG and TLINK
#88
Author: assassin17
Date: Fri, 14 May 1999 00:00
108 lines
3945 bytes

i'm a little confused about how linkers (mainly TLINK) handle the DOSSEG
directive.  several documents state that DOSSEG causes the segments
to be ordered this way:

1. All segments with a class name ending in CODE
2. Far data segments (segments outside DGROUP)
3. Near data (DGROUP) segments, in the following order:
      a. Segments of class BEGDATA (reserved for Microsoft use)
      b. Any segments not of class BEGDATA, BSS, or STACK
      c. Segments of class BSS
      d. Segments of class STACK

however, TLINK seems to always put segments with class 'STACK' at the
end, even if they're _not_ in DGROUP.  MASM's LINK behaves according to
the above list.  is there any standard to how other linkers handle
DOSSEG, or can they arrange the different classed segments however they
want?

the next question is a little longer..  i was experimenting with this
file:
----------
DOSSEG

DGROUP GROUP OERP,AAAA,xaaa,LOPE,FBSS,DARK

xaaa SEGMENT 'CODE'
xaaa ENDS

CBF SEGMENT
CBF ENDS

FBSS SEGMENT 'DATA'
FBSS ENDS

LOSER SEGMENT 'STACK'
LOSER ENDS

ztr SEGMENT 'DATA'
ztr ENDS

aab SEGMENT 'BSS'
aab ENDS

OERP SEGMENT 'BEGDATA'
OERP ENDS

AAAA SEGMENT 'ARPA'
AAAA ENDS

LOPE SEGMENT 'STACK'
LOPE ENDS

ZZZU SEGMENT 'ARPA'
ZZZU ENDS

DARK SEGMENT 'CODE'
DARK ENDS

END
-----

strangely, TLINK outputted the segments in this order:

 00000H 00000H 00000H XAAA               CODE
 00000H 00000H 00000H DARK               CODE
 00000H 00000H 00000H CBF
 00000H 00000H 00000H ZTR                DATA
 00000H 00000H 00000H AAB                BSS
 00000H 00000H 00000H AAAA               ARPA
 00000H 00000H 00000H ZZZU               ARPA
 00000H 00000H 00000H OERP               BEGDATA
 00000H 00000H 00000H FBSS               DATA
 00000H 00000H 00000H LOSER              STACK
 00000H 00000H 00000H LOPE               STACK

segment AAAA is a member of DGROUP, and *should* be after OERP based on
the aforementioned DOSSEG list.  even stranger, the segments will be
outputted in the expected order if segment AAB is moved to the end of
the source file:

 00000H 00000H 00000H XAAA               CODE
 00000H 00000H 00000H DARK               CODE
 00000H 00000H 00000H CBF
 00000H 00000H 00000H ZTR                DATA
 00000H 00000H 00000H ZZZU               ARPA
 00000H 00000H 00000H AAB                BSS
 00000H 00000H 00000H OERP               BEGDATA
 00000H 00000H 00000H FBSS               DATA
 00000H 00000H 00000H AAAA               ARPA
 00000H 00000H 00000H LOSER              STACK
 00000H 00000H 00000H LOPE               STACK

any idea what steps TLINK is going through when ordering these segments?
 sometimes its behavior matches the documentation on DOSSEG; other times
not.  very confusing..

thanks

p.s. i apologize for the length of this post. :)

--
=-=  assassin17@rocketmail.com  =-=


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
Re: DOSSEG and TLINK
#89
Author: Bob Smith
Date: Sat, 15 May 1999 00:00
123 lines
4644 bytes
assassin17@rocketmail.com wrote:
> 
> i'm a little confused about how linkers (mainly TLINK) handle the DOSSEG
> directive.  several documents state that DOSSEG causes the segments
> to be ordered this way:
> 
> 1. All segments with a class name ending in CODE
> 2. Far data segments (segments outside DGROUP)
> 3. Near data (DGROUP) segments, in the following order:
>       a. Segments of class BEGDATA (reserved for Microsoft use)
>       b. Any segments not of class BEGDATA, BSS, or STACK
>       c. Segments of class BSS
>       d. Segments of class STACK
> 
> however, TLINK seems to always put segments with class 'STACK' at the
> end, even if they're _not_ in DGROUP.  MASM's LINK behaves according to
> the above list.  is there any standard to how other linkers handle
> DOSSEG, or can they arrange the different classed segments however they
> want?

The standard is the set of rules you mentioned above.  TLINK just
doesn't observe them.

> the next question is a little longer..  i was experimenting with this
> file:
> ----------
> DOSSEG
> 
> DGROUP GROUP OERP,AAAA,xaaa,LOPE,FBSS,DARK
> 
> xaaa SEGMENT 'CODE'
> xaaa ENDS
> 
> CBF SEGMENT
> CBF ENDS
> 
> FBSS SEGMENT 'DATA'
> FBSS ENDS
> 
> LOSER SEGMENT 'STACK'
> LOSER ENDS
> 
> ztr SEGMENT 'DATA'
> ztr ENDS
> 
> aab SEGMENT 'BSS'
> aab ENDS
> 
> OERP SEGMENT 'BEGDATA'
> OERP ENDS
> 
> AAAA SEGMENT 'ARPA'
> AAAA ENDS
> 
> LOPE SEGMENT 'STACK'
> LOPE ENDS
> 
> ZZZU SEGMENT 'ARPA'
> ZZZU ENDS
> 
> DARK SEGMENT 'CODE'
> DARK ENDS
> 
> END
> -----
> 
> strangely, TLINK outputted the segments in this order:
> 
>  00000H 00000H 00000H XAAA               CODE
>  00000H 00000H 00000H DARK               CODE
>  00000H 00000H 00000H CBF
>  00000H 00000H 00000H ZTR                DATA
>  00000H 00000H 00000H AAB                BSS
>  00000H 00000H 00000H AAAA               ARPA
>  00000H 00000H 00000H ZZZU               ARPA
>  00000H 00000H 00000H OERP               BEGDATA
>  00000H 00000H 00000H FBSS               DATA
>  00000H 00000H 00000H LOSER              STACK
>  00000H 00000H 00000H LOPE               STACK
> 
> segment AAAA is a member of DGROUP, and *should* be after OERP based on
> the aforementioned DOSSEG list.  even stranger, the segments will be
> outputted in the expected order if segment AAB is moved to the end of
> the source file:
> 
>  00000H 00000H 00000H XAAA               CODE
>  00000H 00000H 00000H DARK               CODE
>  00000H 00000H 00000H CBF
>  00000H 00000H 00000H ZTR                DATA
>  00000H 00000H 00000H ZZZU               ARPA
>  00000H 00000H 00000H AAB                BSS
>  00000H 00000H 00000H OERP               BEGDATA
>  00000H 00000H 00000H FBSS               DATA
>  00000H 00000H 00000H AAAA               ARPA
>  00000H 00000H 00000H LOSER              STACK
>  00000H 00000H 00000H LOPE               STACK
> 
> any idea what steps TLINK is going through when ordering these segments?
>  sometimes its behavior matches the documentation on DOSSEG; other times
> not.  very confusing..

According to the rules, the correct order (for the original segments) is
as follows:

Name	Class	Rule
--------------------
xaaa	CODE	1
DARK	CODE	1
CBF		2
ztr	DATA	2
LOSER	STACK	2
aab	BSS	2
ZZZU	ARPA	2
OERP	BEGDATA	3a
FBSS	DATA	3b
AAAA	ARPA	3b
LOPE	STACK	3d
_________________________________________
Bob Smith -- bsmith@sudleyplacedespam.com
a.k.a.       bsmith@qualitasdespam.com

I've been getting a lot of junk e-mail lately,
so to reply to me directly, delete "despam".
Re: DOSSEG and TLINK
#90
Author: assassin17
Date: Sun, 16 May 1999 00:00
102 lines
3430 bytes
  bsmith@sudleyplacedespam.com wrote:
> assassin17@rocketmail.com wrote:
[snip]
> > 1. All segments with a class name ending in CODE
> > 2. Far data segments (segments outside DGROUP)
> > 3. Near data (DGROUP) segments, in the following order:
> >       a. Segments of class BEGDATA (reserved for Microsoft use)
> >       b. Any segments not of class BEGDATA, BSS, or STACK
> >       c. Segments of class BSS
> >       d. Segments of class STACK
> >
> > however, TLINK seems to always put segments with class 'STACK' at
the
> > end, even if they're _not_ in DGROUP.  MASM's LINK behaves according
to
> > the above list.  is there any standard to how other linkers handle
> > DOSSEG, or can they arrange the different classed segments however
they
> > want?
>
> The standard is the set of rules you mentioned above.  TLINK just
> doesn't observe them.

thanks for the reply.  heh, i guess this explains why TLINK 7.1.30.1
just ignores DOSSEG..

> > ----------
> > DOSSEG
> >
> > DGROUP GROUP OERP,AAAA,xaaa,LOPE,FBSS,DARK
> >
> > xaaa SEGMENT 'CODE'
> > xaaa ENDS
> >
> > CBF SEGMENT
> > CBF ENDS
> >
> > FBSS SEGMENT 'DATA'
> > FBSS ENDS
> >
> > LOSER SEGMENT 'STACK'
> > LOSER ENDS
> >
> > ztr SEGMENT 'DATA'
> > ztr ENDS
> >
> > aab SEGMENT 'BSS'
> > aab ENDS
> >
> > OERP SEGMENT 'BEGDATA'
> > OERP ENDS
> >
> > AAAA SEGMENT 'ARPA'
> > AAAA ENDS
> >
> > LOPE SEGMENT 'STACK'
> > LOPE ENDS
> >
> > ZZZU SEGMENT 'ARPA'
> > ZZZU ENDS
> >
> > DARK SEGMENT 'CODE'
> > DARK ENDS
> >
> > END
> > -----
[snipped a lot]
> According to the rules, the correct order (for the original segments)
is
> as follows:
>
> Name	Class	Rule
> --------------------
> xaaa	CODE	1
> DARK	CODE	1
> CBF		2
> ztr	DATA	2
> LOSER	STACK	2
> aab	BSS	2
> ZZZU	ARPA	2
> OERP	BEGDATA	3a
> FBSS	DATA	3b
> AAAA	ARPA	3b
> LOPE	STACK	3d
> _________________________________________

ok, QLINK and M$ LINK both do it right then.  hmm.. why does ztr end up
before LOSER, even thought it's after it in the source file?  is it
because FBSS is in the same class as ztr, and it's before LOSER in the
code?

thanks

p.s. sorry for re-posting/sending this.. but it never showed up on deja
after i posted yesterday.

--
=-=  assassin17@rocketmail.com  =-=


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
Re: DOSSEG and TLINK
#91
Author: Bob Smith
Date: Sun, 16 May 1999 00:00
103 lines
3885 bytes
Good question!  I traced through my linker (QLINK) to see why the
segment order isn't what you think it should be and found an easily
fixed bug which is also in MS Link (possibly for a different reason). 
Thanks for pointing it out.

assassin17@rocketmail.com wrote:
> 
>   bsmith@sudleyplacedespam.com wrote:
> > assassin17@rocketmail.com wrote:
> [snip]
> > > 1. All segments with a class name ending in CODE
> > > 2. Far data segments (segments outside DGROUP)
> > > 3. Near data (DGROUP) segments, in the following order:
> > >       a. Segments of class BEGDATA (reserved for Microsoft use)
> > >       b. Any segments not of class BEGDATA, BSS, or STACK
> > >       c. Segments of class BSS
> > >       d. Segments of class STACK
> > >
> > > however, TLINK seems to always put segments with class 'STACK' at
> the
> > > end, even if they're _not_ in DGROUP.  MASM's LINK behaves according
> to
> > > the above list.  is there any standard to how other linkers handle
> > > DOSSEG, or can they arrange the different classed segments however
> they
> > > want?
> >
> > The standard is the set of rules you mentioned above.  TLINK just
> > doesn't observe them.
> 
> thanks for the reply.  heh, i guess this explains why TLINK 7.1.30.1
> just ignores DOSSEG..
> 
> > > ----------
> > > DOSSEG
> > >
> > > DGROUP GROUP OERP,AAAA,xaaa,LOPE,FBSS,DARK
> > >
> > > xaaa SEGMENT 'CODE'
> > > xaaa ENDS
> > >
> > > CBF SEGMENT
> > > CBF ENDS
> > >
> > > FBSS SEGMENT 'DATA'
> > > FBSS ENDS
> > >
> > > LOSER SEGMENT 'STACK'
> > > LOSER ENDS
> > >
> > > ztr SEGMENT 'DATA'
> > > ztr ENDS
> > >
> > > aab SEGMENT 'BSS'
> > > aab ENDS
> > >
> > > OERP SEGMENT 'BEGDATA'
> > > OERP ENDS
> > >
> > > AAAA SEGMENT 'ARPA'
> > > AAAA ENDS
> > >
> > > LOPE SEGMENT 'STACK'
> > > LOPE ENDS
> > >
> > > ZZZU SEGMENT 'ARPA'
> > > ZZZU ENDS
> > >
> > > DARK SEGMENT 'CODE'
> > > DARK ENDS
> > >
> > > END
> > > -----
> [snipped a lot]
> > According to the rules, the correct order (for the original segments)
> is
> > as follows:
> >
> > Name  Class   Rule
> > --------------------
> > xaaa  CODE    1
> > DARK  CODE    1
> > CBF           2
> > ztr   DATA    2
> > LOSER STACK   2
> > aab   BSS     2
> > ZZZU  ARPA    2
> > OERP  BEGDATA 3a
> > FBSS  DATA    3b
> > AAAA  ARPA    3b
> > LOPE  STACK   3d
> > _________________________________________
> 
> ok, QLINK and M$ LINK both do it right then.  hmm.. why does ztr end up
> before LOSER, even thought it's after it in the source file?  is it
> because FBSS is in the same class as ztr, and it's before LOSER in the
> code?
_________________________________________
Bob Smith -- bsmith@sudleyplacedespam.com
a.k.a.       bsmith@qualitasdespam.com

I've been getting a lot of junk e-mail lately,
so to reply to me directly, delete "despam".
Re: DOSSEG and TLINK
#92
Author: assassin17
Date: Mon, 17 May 1999 00:00
39 lines
2279 bytes

you're welcome.  i'm curious.. why does the bug cause the position of
DGROUPed segments to affect the order of non-DGROUP segments, but not
the other way around?  and it's good to see someone who actually
maintains their linker. :)

also, how do you get /MAP option to generate FILENAME.MAP?  it acts as
if it's going to by outputting:

Map File [FILENAME.MAP]:

but then it just saves it to NULOBJEC.MAP, unless you type in the MAP
name.

thanks

assassin17@rocketmail.com

=-= Join us in the fight against violence! =-=

  bsmith@sudleyplacedespam.com wrote:
> Good question!  I traced through my linker (QLINK) to see why the
> segment order isn't what you think it should be and found an easily
> fixed bug which is also in MS Link (possibly for a different reason).
> Thanks for pointing it out.
>
> assassin17@rocketmail.com wrote:
> >
> > ok, QLINK and M$ LINK both do it right then.  hmm.. why does ztr end
up
> > before LOSER, even thought it's after it in the source file?  is it
> > because FBSS is in the same class as ztr, and it's before LOSER in
the
> > code?


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
Re: DOSSEG and TLINK
#84
Author: assassin17
Date: Wed, 19 May 1999 00:00
39 lines
2378 bytes

you're welcome.  i'm curious.. why does the bug cause the position of
DGROUPed segments to affect the order of non-DGROUP segments, but not
the other way around?  and it's good to see someone who actually
maintains their linker. :)

also, how do you get /MAP option to generate FILENAME.MAP?  it acts as
if it's going to by outputting:

Map File [FILENAME.MAP]:

but then it just saves it to NULOBJEC.MAP, unless you type in the MAP
name.

thanks

p.s. cursed deja - must i post everything twice?!

assassin17@rocketmail.com

  bsmith@sudleyplacedespam.com wrote:
> Good question!  I traced through my linker (QLINK) to see why the
> segment order isn't what you think it should be and found an easily
> fixed bug which is also in MS Link (possibly for a different reason).
> Thanks for pointing it out.
>
> assassin17@rocketmail.com wrote:
> >
> > ok, QLINK and M$ LINK both do it right then.  hmm.. why does ztr end
up
> > before LOSER, even thought it's after it in the source file?  is it
> > because FBSS is in the same class as ztr, and it's before LOSER in
the
> > code?


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
Re: DOSSEG and TLINK
#85
Author: assassin17
Date: Fri, 21 May 1999 00:00
104 lines
3488 bytes
  bsmith@sudleyplacedespam.com wrote:
> assassin17@rocketmail.com wrote:
[snip]
> > 1. All segments with a class name ending in CODE
> > 2. Far data segments (segments outside DGROUP)
> > 3. Near data (DGROUP) segments, in the following order:
> >       a. Segments of class BEGDATA (reserved for Microsoft use)
> >       b. Any segments not of class BEGDATA, BSS, or STACK
> >       c. Segments of class BSS
> >       d. Segments of class STACK
> >
> > however, TLINK seems to always put segments with class 'STACK' at
the
> > end, even if they're _not_ in DGROUP.  MASM's LINK behaves according
to
> > the above list.  is there any standard to how other linkers handle
> > DOSSEG, or can they arrange the different classed segments however
they
> > want?
>
> The standard is the set of rules you mentioned above.  TLINK just
> doesn't observe them.

thanks for the reply.  heh, TLINK is wacky..

> > ----------
> > DOSSEG
> >
> > DGROUP GROUP OERP,AAAA,xaaa,LOPE,FBSS,DARK
> >
> > xaaa SEGMENT 'CODE'
> > xaaa ENDS
> >
> > CBF SEGMENT
> > CBF ENDS
> >
> > FBSS SEGMENT 'DATA'
> > FBSS ENDS
> >
> > LOSER SEGMENT 'STACK'
> > LOSER ENDS
> >
> > ztr SEGMENT 'DATA'
> > ztr ENDS
> >
> > aab SEGMENT 'BSS'
> > aab ENDS
> >
> > OERP SEGMENT 'BEGDATA'
> > OERP ENDS
> >
> > AAAA SEGMENT 'ARPA'
> > AAAA ENDS
> >
> > LOPE SEGMENT 'STACK'
> > LOPE ENDS
> >
> > ZZZU SEGMENT 'ARPA'
> > ZZZU ENDS
> >
> > DARK SEGMENT 'CODE'
> > DARK ENDS
> >
> > END
> > -----
[SNIP lots of my crap]
> > any idea what steps TLINK is going through when ordering these
segments?
> >  sometimes its behavior matches the documentation on DOSSEG; other
times
> > not.  very confusing..
>
> According to the rules, the correct order (for the original segments)
is
> as follows:
>
> Name	Class	Rule
> --------------------
> xaaa	CODE	1
> DARK	CODE	1
> CBF		2
> ztr	DATA	2
> LOSER	STACK	2
> aab	BSS	2
> ZZZU	ARPA	2
> OERP	BEGDATA	3a
> FBSS	DATA	3b
> AAAA	ARPA	3b
> LOPE	STACK	3d
> _________________________________________

ok, M$ LINK does it right then.  hmm.. why is ztr before LOSER, even
though it's after it in the source file?  is it because FBSS is the same
class as ztr, and _it's_ before LOSER?

thanks

--
=-=  assassin17@rocketmail.com  =-=
=-= Join us in the fight against violence! =-=


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
Re: DOSSEG and TLINK
#86
Author: Anthony Williams
Date: Fri, 21 May 1999 00:00
136 lines
5050 bytes
I am just adding DOSSEG support to ALINK, and I am a bit concerned
about the use of Rule 1 to place XAAA and DARK at the beginning of the
file, even though they are part of DGROUP. If someone has placed their
code segment into DGROUP, presumably it's for a reason, e.g. so that
all the code and data can be accessed with the same segment register,
which is then messed up if it is placed outside DGROUP because it is a
code segment.

I am inclined to treat XAAA and DARK under rule 3b.

Any comments?

Anthony

In article <7hnfm3$i3u$1@autumn.news.rcn.net>,
  bsmith@sudleyplacedespam.com wrote:
> Good question!  I traced through my linker (QLINK) to see why the
> segment order isn't what you think it should be and found an easily
> fixed bug which is also in MS Link (possibly for a different reason).
> Thanks for pointing it out.
>
> assassin17@rocketmail.com wrote:
> >
> >   bsmith@sudleyplacedespam.com wrote:
> > > assassin17@rocketmail.com wrote:
> > [snip]
> > > > 1. All segments with a class name ending in CODE
> > > > 2. Far data segments (segments outside DGROUP)
> > > > 3. Near data (DGROUP) segments, in the following order:
> > > >       a. Segments of class BEGDATA (reserved for Microsoft use)
> > > >       b. Any segments not of class BEGDATA, BSS, or STACK
> > > >       c. Segments of class BSS
> > > >       d. Segments of class STACK
> > > >
> > > > however, TLINK seems to always put segments with class 'STACK'
at
> > the
> > > > end, even if they're _not_ in DGROUP.  MASM's LINK behaves
according
> > to
> > > > the above list.  is there any standard to how other linkers
handle
> > > > DOSSEG, or can they arrange the different classed segments
however
> > they
> > > > want?
> > >
> > > The standard is the set of rules you mentioned above.  TLINK just
> > > doesn't observe them.
> >
> > thanks for the reply.  heh, i guess this explains why TLINK 7.1.30.1
> > just ignores DOSSEG..
> >
> > > > ----------
> > > > DOSSEG
> > > >
> > > > DGROUP GROUP OERP,AAAA,xaaa,LOPE,FBSS,DARK
> > > >
> > > > xaaa SEGMENT 'CODE'
> > > > xaaa ENDS
> > > >
> > > > CBF SEGMENT
> > > > CBF ENDS
> > > >
> > > > FBSS SEGMENT 'DATA'
> > > > FBSS ENDS
> > > >
> > > > LOSER SEGMENT 'STACK'
> > > > LOSER ENDS
> > > >
> > > > ztr SEGMENT 'DATA'
> > > > ztr ENDS
> > > >
> > > > aab SEGMENT 'BSS'
> > > > aab ENDS
> > > >
> > > > OERP SEGMENT 'BEGDATA'
> > > > OERP ENDS
> > > >
> > > > AAAA SEGMENT 'ARPA'
> > > > AAAA ENDS
> > > >
> > > > LOPE SEGMENT 'STACK'
> > > > LOPE ENDS
> > > >
> > > > ZZZU SEGMENT 'ARPA'
> > > > ZZZU ENDS
> > > >
> > > > DARK SEGMENT 'CODE'
> > > > DARK ENDS
> > > >
> > > > END
> > > > -----
> > [snipped a lot]
> > > According to the rules, the correct order (for the original
segments)
> > is
> > > as follows:
> > >
> > > Name  Class   Rule
> > > --------------------
> > > xaaa  CODE    1
> > > DARK  CODE    1
> > > CBF           2
> > > ztr   DATA    2
> > > LOSER STACK   2
> > > aab   BSS     2
> > > ZZZU  ARPA    2
> > > OERP  BEGDATA 3a
> > > FBSS  DATA    3b
> > > AAAA  ARPA    3b
> > > LOPE  STACK   3d
> > > _________________________________________
> >
> > ok, QLINK and M$ LINK both do it right then.  hmm.. why does ztr
end up
> > before LOSER, even thought it's after it in the source file?  is it
> > because FBSS is in the same class as ztr, and it's before LOSER in
the
> > code?
> _________________________________________
> Bob Smith -- bsmith@sudleyplacedespam.com
> a.k.a.       bsmith@qualitasdespam.com
>
> I've been getting a lot of junk e-mail lately,
> so to reply to me directly, delete "despam".
>

--
anthony_w@geocities.com
http://surf.to/anthony_w
http://www.geocities.com/SiliconValley/Network/4311/index.html


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
Re: DOSSEG and TLINK
#87
Author: assassin17
Date: Sat, 22 May 1999 00:00
52 lines
3288 bytes
  Anthony Williams <anthony_w@geocities.com> wrote:
> I am just adding DOSSEG support to ALINK, and I am a bit concerned
> about the use of Rule 1 to place XAAA and DARK at the beginning of the
> file, even though they are part of DGROUP. If someone has placed their
> code segment into DGROUP, presumably it's for a reason, e.g. so that
> all the code and data can be accessed with the same segment register,
> which is then messed up if it is placed outside DGROUP because it is a
> code segment.
>
> I am inclined to treat XAAA and DARK under rule 3b.
>
> Any comments?

i tend to agree with your thoughts because they give the programmer more
control as to where the segments go.  however, bob smith mentioned
earlier in the thread that the order below is the standard.  plus, it is
how MS Link does things -- and i think M$ invented DOSSEG in the first
place.  but it looks like there could be some freedom.  here's a chunk
from the Watcom Linker documentation:

-----
When the DOSSEG option is specified, segments are ordered in the
following way:

1.all segments not belonging to group DGROUP with class CODE
2.all other segments not belonging to group DGROUP
3.all segments belonging to group DGROUP with class BEGDATA
4.all segments belonging to group DGROUP not with class BEGDATA, BSS or
STACK
5.all segments belonging to group DGROUP with class BSS
6.all segments belonging to group DGROUP with class STACK
-----

so watcom appears to handle it the way you're leaning towards.  but i
can't verify this because i can't find the linker..  damn, i don't even
know where watcom's *website* is. :P

-assassin17@rocketmail.com

=-= Join us in the fight against violence! =-=

> 1. All segments with a class name ending in CODE
> 2. Far data segments (segments outside DGROUP)
> 3. Near data (DGROUP) segments, in the following order:
 >       a. Segments of class BEGDATA (reserved for Microsoft use)
 >       b. Any segments not of class BEGDATA, BSS, or STACK
 >       c. Segments of class BSS
 >       d. Segments of class STACK


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads