6 ms·
It is straightforward to convert stack instructions to 3-address instructions, by keeping a counter -- a stack pointer -- that points into the register file. A
by tailrecursion 14y ago
It is straightforward to convert stack instructions to 3-address instructions, by keeping a counter -- a stack pointer -- that points into the register file. As instructions are decoded the stack pointer is read and the current reading is delivered on down the pipeline with the instruction itself.
From there on, the cpu is executing an instruction that calls out explicit register numbers. The stack counter is kept with the decoder at the very start of the pipeline. This "register number decoder" needs to run sequentially, and it needs to run a faster cycle time than the rest of the cpu.