Better HN
topnewbestaskshowjobs
Log inSign up

streganil

1 karma · joined Oct 11, 2026 (1mo ago) · 1 submissions

Submissions

comment 1mo ago · link · parent

I feel this comment misses some important context; in assembler, you might return a boolean value from a function in a register, but you also might just set a flag (which is much more similar to the "one bit value"). A flag register is very much a set of booleans, not an integer.

> single bits are rarely used for booleans because it requires more CPU power to extract a single bit

I don't believe this to be true; (on x86) `cmp X, 0` is exactly the same amount of operations as `test X, pow2`. One of them is a `sub` and one of them is an `and`. I believe this is how it works on all important CPU architectures of today back to the early microcomputers (although I don't know how the minicomputers handle this, so it's possible that booleans being integers makes more sense on a PDP-11 or a honeywell).