← All reports

XOR'ing a register with itself is a common idiom for zeroing it out in programming.

ProgrammingScienceApr 22, 2026score 0.172 posts · 0 replies across 1 instances
The thread discusses the programming practice of using XOR to zero out a register, questioning why the SUB instruction isn't used instead. It references a Microsoft blog post and Hacker News discussion.

Claims

XOR'ing a register with itself is a common idiom for zeroing it out in programming.
Parent: ProgrammingEntity: Register zeroing techniquesImpact: neutralDate: Apr 22, 2026Target: XOR'ing a register with itself is the idiom for zeroing it out.

Source posts

@[email protected]
XOR'ing a register with itself is the idiom for zeroing it out. Why not sub? https://devblogs.microsoft.com/oldnewthing/20260421-00/?p=112247 #HackerNews #XOR #zeroing #sub #register #programming #coding
0 boosts · 0 favs · 0 replies · Apr 22, 2026
#hackernews#xor#zeroing#sub#register#programming
@[email protected]
XOR'ing a register with itself is the idiom for zeroing it out. Why not sub? ---- - 41 minutes ago | 4 points | 0 comments - URL: https://devblogs.microsoft.com/oldnewthing/20260421-00/?p=112247 - Discussions: https://news.ycombinator.com/item?id=47859861
0 boosts · 0 favs · 0 replies · Apr 22, 2026
@[email protected]
XOR'ing a register with itself is the idiom for zeroing it out. Why not sub? L: https://devblogs.microsoft.com/oldnewthing/20260421-00/?p=112247 C: https://news.ycombinator.com/item?id=47859861 posted on 2026.04.22 at 02:38:05 (c=0, p=4)
0 boosts · 0 favs · 0 replies · Apr 22, 2026
@[email protected]
XOR'ing a register with itself is the idiom for zeroing it out. Why not sub? https://devblogs.microsoft.com/oldnewthing/20260421-00/?p=112247 #microsoft
0 boosts · 0 favs · 0 replies · Apr 22, 2026
#microsoft
@[email protected]
XOR'ing a register with itself is the idiom for zeroing it out. Why not sub? https://lemmy.bestiver.se/post/1063150
1 boosts · 0 favs · 0 replies · Apr 22, 2026
#hackernews
@[email protected]
XOR'ing a register with itself is the idiom for zeroing it out. Why not sub? Link: https://devblogs.microsoft.com/oldnewthing/20260421-00/?p=112247 Comments: https://news.ycombinator.com/item?id=47859861
0 boosts · 0 favs · 0 replies · Apr 22, 2026