XOR'ing a register with itself is the idiom for zeroing it out. Why not sub?

This technical article explains how a low-level CPU instruction idiom (XOR) became the industry standard for register zeroing despite functionally equivalent alternatives, illustrating how incremental advantages and social proof create technology standards. For IT leaders, this demonstrates how early architectural decisions and compiler choices cascade across entire ecosystems, making standardization lock-in difficult to reverse even when technically superior alternatives emerge. Organizations should recognize that such de facto standards—whether in code practices, infrastructure choices, or vendor preferences—become self-reinforcing and require significant coordination to change.

Hacker News3 min read
Read full article
XOR'ing a register with itself is the idiom for zeroing it out. Why not sub?
This technical article explains how a low-level CPU instruction idiom (XOR) became the industry standard for register zeroing despite functionally equivalent alternatives, illustrating how incremental advantages and social proof create technology standards. For IT leaders, this demonstrates how early architectural decisions and compiler choices cascade across entire ecosystems, making standardization lock-in difficult to reverse even when technically superior alternatives emerge. Organizations should recognize that such de facto standards—whether in code practices, infrastructure choices, or vendor preferences—become self-reinforcing and require significant coordination to change.