[fpc-devel] Re. z370 Cross Compilation, Pass 2 of ....

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Sun Sep 1 21:42:54 CEST 2013

Hans-Peter Diettrich wrote:
> Mark Morgan Lloyd schrieb:
>> So at the very least, we have to consistently simulate a stack- apart 
>> from anything else, that's mandated by Pascal's use of recursion. But 
>> we don't necessarily have to use the same calling convention for Linux 
>> and for "classic" OSes (i.e. including those which are 
>> freely-available, running on Hercules etc.).
> See my note on the OS specific/supplied debugger.
>> Question (to save me digging into the manuals right now): where a 
>> recent machine uses the dedicated stack instructions, is the stack 
>> pointer one of the standard registers? In other words, can push/pop 
>> operations be trivially and exactly simulated for older hardware?
> You mean thread safety?

No, I meant that Bernd suggested R1 earlier as a simulated stack 
pointer. Does IBM use R1 for this on variants of the architecture that 
have push/pop opcodes, or some other general-purpose register, or a 
dedicated register?

> As long as only one thread is running, the push/pop instructions must 
> not be atomic.

I hate to correct language usage, but "/need/ not be atomic" would be 

> Multiple threads introduce many more problems, because their return 
> stacks must never get mixed. Furthermore each thread must have its own 
> stack, again no conflicts.

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