[fpc-devel] Re. z370 Cross Compilation, Pass 2 of ....
Sven Barth
pascaldragon at googlemail.com
Tue Sep 3 07:50:46 CEST 2013
Am 03.09.2013 00:15 schrieb "Bernd Oppolzer" <bernd.oppolzer at t-online.de>:
> With "classical" 360 machines, you had the problem that the offsets in
the machine
> instructions only were 12 bits long, so you could only address 4 k from
the position
> of a base register directly. That is, if your automatic data (of one
procedure) was
> larger than 4 k, you were in trouble. Data after the 4 k barrier had to
be addressed
> using two steps; first compute the address and the fetch the data - for
example.
>
> With new z-Arch instructions, this is no problem any more.
FPC already supports some CPUs which have such restrictions as well. It's
no real problem to split up single instruction branches/moves to do a
calculation of an address before branching/moving. I'm doing this for
example for the Coldfire m68k variant.
> A language like Pascal, which allows the nesting of procedures and the
access
> of auto variables that are defined outside the local procedure (that is:
in procedures
> above the local procedure), you need to retrieve the stack frame of that
procedure
> first. This is done by walking up the chain of the save areas and load
the base address
> of the stack frame of the interesting procedure into another base
register, different
> from R13 (for example). This is a problem, that a C compiler doesn't have
- but it's
> well known to PL/1, too.
In FPC we AFAIK pass the parent frame to a nested function as an additional
parameter.
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20130903/0c3c571b/attachment.html>
More information about the fpc-devel
mailing list