Can zero / x0 store data?
No. Reads of x0 always return 0 and writes are ignored.
zero is the first RISC-V register worth memorizing: reading x0 always returns 0, and writes to x0 are ignored. You will see it in comparisons against zero, writing a result to x0, NOP, and several assembler pseudoinstruction patterns.
The psABI names x0 as zero, the immutable zero-value register. Reads always produce 0 and writes do not preserve a result.
zero / x0 is the RISC-V hardwired zero register. Reads always produce 0 and writes are ignored, so it is used for constant zero, zero comparisons, and discarded writebacks.
zero is not an ABI preservation subject: x0 is hardwired to zero by the hardware.
Regardless of which instruction executes, reading zero yields 0 and writes have no effect.
addi a0, zero, 0 # a0 = 0
add zero, a0, a1 # result is discarded
beq a0, zero, doneNo. Reads of x0 always return 0 and writes are ignored.
x0 can act as the constant zero or as a destination that discards the writeback result.