next up previous
Next: New mechanism for Up: MIT REVERSIBLE COMPUTING PROJECT Previous: Expanding instructions do

Eliminate BAL and BAL_r.

The subroutine-calling mechanism in the old PISA was ugly: it required both BAL and BAL_r instructions in the caller, with a no-op between at the address to be returned to. Actually, even this didn't really work because the sequence of instructions executed when executing a call in the forwards direction wasn't exactly the reverse of the sequence executed in the reverse direction: going forwards, you execute BAL, then JR_r; going backwards, you do JR_r, then the NO-OP, then BAL. There would likely have been some irreversible operations happening in here, or a lot of hardware complexity to avoid it.

In the new scheme, subroutine calling is performed via a single branch instruction in the caller, which is exactly the same instruction as that used for ordinary (non-subroutine-call) branches. All the intelligence in in the callee (which makes sense since a subroutine is in general called from many places, so more instructions are saved by having as many instructions as possible be in the caller).

We will describe the new subroutine calling mechanism in more detail later. For now, suffice it to say that it allows us to eliminate both BAL and BAL_r from the language.



Michael Frank
Wed Jul 23 13:48:27 EDT 1997