🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #2925

Re: On TopSpeed's data const_in_code pragma

#2925
From: Bengt-Inge Dalenback
Date: Mon, 23 Oct 1995 16:11
62 lines
2769 bytes
Hi Mark,

In article <DGwMoC.4su@cix.compulink.co.uk> Mark Morgan Lloyd,
mark_tbu@cix.compulink.co.uk writes:
>> However, when I apply the pragma at project level. The app won't
>> even start! If I apply it to one module at a time, it works until
>> suddenly for one module the app won't start again.
>
>I know that this is a silly question, but what is happening to the sizes 
>of segments and groups?
>

Do you mean like that the data would disappear?

One example : the read-out after compilation of a module (picked at
random) with (*# data(const_in_code=>off) *) (and with shared_const off
too since
it is hard to calc sizes otherwise):

   Sizes = Code: 16885, Const: 3859, Data: 2627

which amounts to 23371 bytes.

With data(const_in_code=>on)

   Sizes = Code: 22849, Const:   11, Data: 2627

which amounts to 25487 bytes.

In this case, for some odd reason, not all the Const data goes away;
it normally gets to be 0. The total Size is also bigger which, I presume,
is because the data cannot be stored exactly the same way inside the code
segment (maybe on even 2 or 4-byte addresses, who knows). But a bigger
code segment won't hurt at all. The Data size is not affected.

This sample module contains an unusually big amount of data since it was
an old version from before I started to change things around for the
Windows one.

A look in the map file, after a full recompile/link of the real code,
revealed that a lot of space was freed in the DGROUP (but to no avail
since
Windows would not load the app).

Wait now! I may, with your help, have stumbled on something. From what I
can remember from the real code, I always get Const: 0 using the pragma.
Maybe (just maybe) if it does not get to be 0 there is a problem (shot in
the dark).

I will have to check tonight since the code is written on a computer not
placed at the department.

Bye

--------------------------------
Bengt-Inge Dalenback, CATT
also at: 
Department of Applied Acoustics
Chalmers University of Technology
Gothenburg, SWEDEN
e-mail: bid@ta.chalmers.se
fax : +46 31 145154
Technical Details
Message-ID: <46geri$mk4@nyheter.chalmers.se>
Path: arc1-ca.pugleaf.net!g0-mac7.ta.chalmers.se!bid
References: <46fp57$jjs@nyheter.chalmers.se>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!g0-mac7.ta.chalmers.se!bid
From: Bengt-Inge Dalenback <bid@ta.chalmers.se>
Newsgroups: comp.lang.modula2
Subject: Re: On TopSpeed's data const_in_code pragma
Date: 23 Oct 1995 16:11:30 GMT
Organization: CATT & Dep. of Applied Acoustics, Chalmers
Distribution: world
Message-ID: <46geri$mk4@nyheter.chalmers.se>
References: <46fp57$jjs@nyheter.chalmers.se>
NNTP-Posting-Host: g0-mac7.ta.chalmers.se
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: Nuntius 2.0.1_68K
X-XXMessage-ID: <ACB17D507201B84A@g0-mac7.ta.chalmers.se>
X-XXDate: Mon, 23 Oct 1995 16:11:44 GMT