For some context to this question see Raffzahn's excellent question and answer How were Zuse Z22 Instructions Encoded?.
The Z22 treats the first few locations of its address space in a particular way:
- the instruction encoding gives preferential treatment to the encoding of addresses in this range, a little like a register file
- it is not backed by the (slow) memory drum, but some of it is backed by fast core memory.
- Some of the locations have special meanings, such as having a constant value when reading, or having the ability to test some of the bits for conditional execution, or I/O ports.
The Z22 instruction word has a bit you can set (it's called F
), to copy the already-incremented program counter to Location 5. And any instruction can do this as a side effect, but I imagine it's most often combined with a E
, which is the jump instruction, so that FE
would be a subroutine call, having the return address in Location 5. So I guess to return from a subroutine you'd do EG 5
or something.
It's a bit like subroutine call/return on ARM, where you can call a subroutine with bl somewhere
and return with bx lr
, except that the return address is stored in a fixed location in memory instead of a register, and that any instruction can store the program counter to Location 5, not just branches.
Now we know that Location 5 is written to by the F
operation. Another funky location in this portion of the address space in Location 16, which is a read-only shadow of Location 5. And this question asks what purpose that serves.
I suppose we can rule out the possibility of incomplete address decoding, since the binary values for 5 and 16 don't share any common 1s. Also none of the other locations have this kind of shadowing so far as I know. So it was deliberately put in, along with write-protection. So what is it for?
C
which used on SS5 would change the return address. Used on SS16 will produce no effect on storage. It's handy to havea parameter list right after the jump, so the address in SS5 is essentially a pointer to a parameter record, which can be addressed using SS16 with any addressing mode without side effect on is content. While the return would use R16 plus parameter length as return jump. Would need to spend some time reading the doc to check.C
is "Constante", isn't it?). But mind to make it an answer so I can vote and/or accept?