Close

Register #0 = 0

A project log for PDP - Processor Design Principles

Distilling my experience and wisdom about the architecture, organisation and design choices of my CPUs

yann-guidon-ygdesYann Guidon / YGDES 02/10/2018 at 01:480 Comments

There is an old tradition with the RISC canon : the very first register reads as zero.

Either it's a convention and it's set by software, or the register set is hardwired to 0. In both cases the register is meant to simplify some computations and save some opcodes.

This was known to the CDC6600 developers back in the 60s/70s, you would start a program by setting B0 to 0. See Wikipedia. I also had private conversations a log time ago with a CDC user about this... I'm not sure about the POWER architecture but this convention persisted in the MIPS architecture, got adopted by the Alpha AXP architecture (though it's R31) and is still vigorous in RISC-V.

Famously, many other architectures didn't follow this convention and this is typical when your register set is small (16 or fewer registers) like ARM.

My opinion about this is : I used to follow it (in F-CPU FC0 in y2k) but now I don't.

My approach today is

.

TODO : list all the use cases of the RAZ/WI (Read As Zero/Write Ignored) gimmick.

Discussions