5 ms·
So the basic principle is that stack machines have smaller instructions, but require extra instructions to shuffle values around on the stack. This is why regis
by jasonwatkinspdx 3y ago
So the basic principle is that stack machines have smaller instructions, but require extra instructions to shuffle values around on the stack. This is why register machines won out with hardware, and stack machines are popular for virtual machine intermediate representations (that get compiled or JIT down to register code in the end on basically all machines today).
If you wanna learn about how register renaming works, look into Tomasulo's algorithm. State of the art chips are a lot more complex, but that's a good historic introduction to the fundamental ideas.