#Generating PURE code?
21-Jan-89 23:13:41
Sb: #31450-#Generating PURE code?
Fm: Bob Rakosky 75156,336
To: George Brickner 70040,104
Actually, up until very recently, the Amiga compilers were incapable of
generating reentrant code. The Amiga BCPL-based CLI environment was not
designed to share code segments of loaded programs between tasks, so
consequently, reentrancy was not a real issue for 'application' programs.
It has always been an issue for things like run-time shared libraries and
device drivers, and there were ways to generate these _MOSTLY_ in C, but a
bit of assembler coding was required.
One "limitation" that the 68000 has over the Intel processors is that
the 68K is not forced to reference memory via a register-displacement type
of addressing. This allows programs to contain direct memory references to
data areas, which must be fixed once the program is loaded. Consequently,
one in-memory copy of a program such as this cannot reference two areas of
memory simultaneously (one for each concurrent task). This makes
re-entrant use of global variables difficult.
Of course, the 68K also allows references to memory via
relative-register addressing, so there are ways around this problem – we
just have to 'pretend' that we're working with a segmented architecture
<grin>. Anyway, this is getting pretty rambling. Think I'll just end it
here before I get totally confused 🙂