[fpc-devel] System 370: Episode 3. Addressing and it's limits Part One!
Mark Morgan Lloyd
markMLl.fpc-devel at telemetry.co.uk
Tue Feb 7 12:29:07 CET 2012
Hans-Peter Diettrich wrote:
> steve smithers schrieb:
>
>> Base / Displacement consists of a 16 bit value, the first 4 bits
>> enumerate a
>> register, and the other 12 bits hold a displacement from 0 to 4095.
>> The actual
>> or Effective address for each storage operand is calculated as the
>> unsigned
>> addition of the value held in the base register to the displacement
>> from the
>> instruction itself.
>
> This reminds me of 8086 "real" mode, and 16 bit mode with (far)
> addresses splitted into segment:offset. Using an 16 bit compiler and
> syntax (near/far pointers and seg:off notation) would be easier to
> support a segmented-memory architecture. I also don't see right now how
> data structures > 4KB could be addressed, without subroutines to map
> virtual into physical (here seg:off) addresses.
>
> When I had a first look at the 8086 CPU, decades ago, I didn't
> understand how to handle such a memory architecture in an compiler. Only
> when I came across the Microsoft compilers and their memory models, I
> saw how "hints" in the source code would allow an compiler to create
> efficient machine code. But all these syntax externsions have been
> stripped from nowadays compilers and languages, so that it will be very
> hard to support such a dinosaur architecture in an 32/64 bit compiler.
The best hint I had was in an OS/2 v1 programming manual, where it
described in detail what conventions the MS/IBM code generators used to
support arrays > 64K.
The zSeries Linux is, of course, 32-bit flat. However it has definite
limitations on what platform it will run on (an actual zSeries system
rather than an S/390 if I recall correctly), although it is rather more
relaxed about the platform that application software is coded for (an
S/390 G5 IIRC).
I still think that the place to start is with Linux on account of the
familiar character set and ready availability of systems, but I'm
putting some time in trying to read around the various older operating
systems available. Hopefully Paul, Steve, or anybody else quietly
lurking will correct me on this, but my understanding is that there is a
number of older IBM operating systems which are now considered to be
/res/ /nullius/, but these are all limited to 24-bit addressing. However
there is an interesting project http://mvs380.sourceforge.net/ which is
not only gathering and bundling the available code, but is slowly moving
forwards with patches that allow application software with memory
demands >16Mb to run on these operating systems, hosted on a patched
variant of Hercules. If they continue having success, this could provide
an interesting set of platforms in the future.
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
More information about the fpc-devel
mailing list