Article View: comp.lang.modula2
Article #2727Re: TopSpeed and assembler
From: Peter Moylan
Date: Thu, 24 Aug 1995 01:35
Date: Thu, 24 Aug 1995 01:35
48 lines
2654 bytes
2654 bytes
[Background: we're talking here about the problem of including
CPU-specific code in TopSpeed assembler. The problem is: is there
any mechanism in the TopSpeed project system that will let us use
assembler conditionals that check which processor model the project
is being compiled for; that is, is there any way to read back the
current setting of the "optimize" pragma?]
Martin Tom Brown (Martin@nezumi.demon.co.uk) wrote:
>I think I know how to do what you want, but it isn't pretty, and opens
>up the potential black hole of code compiled for a higher CPU model,
>but with the same library names as the original standard models.
>Try this at your own risk and backup the original files first!
>I have only tried it quickly on TS v3.02 for OS/2 - seems OK.
>But I haven't tested it beyond a quick look see...
>Edit TSPRJ.TXT
> add somewhere near the #pragma optimise(cpu=>86)
>
> #pragma define (_mycpu486=>on)
> (nested so that it is set appropriately)
[Further details given in the original posting]
My first reaction was to think that this would work, but after
looking at TSPRJ.TXT I'd say that it probably won't. The
#pragma optimise referred to above is embedded inside some
conditional tests, and it all boils down to saying something
like "if the environment is OS/2 or Windows or DOS Extender,
then assume that we have a fancier model of the processor".
Note in any case that TSPRJ.TXT is merely setting up defaults
for the pragma settings. If there's a #pragma optimise in the
user's project file - and there often is - then that will
override the settings made by TSPRJ.TXT.
The end result will be that _mycpu486 will depend on the
operating system, not on the processor.
I'm still convinced that there's something in the project system
which allows the current value of "cpu" to be interrogated.
I've tried some of the more obvious possibilities, but with no
luck so far.
--
Peter Moylan peter@ee.newcastle.edu.au
file://ee.newcastle.edu.au/pub/www/Moylan.html
Technical Details
Message-ID:
<41gl19$j8p@seagoon.newcastle.edu.au>Path:
arc1-ca.pugleaf.net!fourier.newcastle.edu.au!peterReferences:
<40bk8l$qgs@seagoon.newcastle.edu.au> <DD90oA.ABu@cix.compulink.co.uk> <40tvub$in9@seagoon.newcastle.edu.au> <808763542snz@nezumi.demon.co.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!fourier.newcastle.edu.au!peter From: peter@fourier.newcastle.edu.au (Peter Moylan) Newsgroups: comp.lang.modula2 Subject: Re: TopSpeed and assembler Date: 24 Aug 1995 01:35:37 GMT Organization: The University of Newcastle Message-ID: <41gl19$j8p@seagoon.newcastle.edu.au> References: <40bk8l$qgs@seagoon.newcastle.edu.au> <DD90oA.ABu@cix.compulink.co.uk> <40tvub$in9@seagoon.newcastle.edu.au> <808763542snz@nezumi.demon.co.uk> Reply-To: peter@tesla.newcastle.edu.au NNTP-Posting-Host: fourier.newcastle.edu.au X-Newsreader: TIN [version 1.2 PL2]