4 ms·
> You do multiplication or addition and you get well-defined 2s-complement wrap-around. You get that, if that's what your CPU implements. Of course that's wha
by T-hawk 8y ago
> You do multiplication or addition and you get well-defined 2s-complement wrap-around.
You get that, if that's what your CPU implements. Of course that's what all commonly used processors nowadays like x86 do. But C was meant to run on weirder ISAs as well. The specs of C allow so much undefined behavior in order to let C just emit the instructions for the multiply or memory access, and C deliberately says "not my problem" for whatever this architecture happens to do with edge-cases like overflow.
Using assembly instead of C cuts past the abstraction of the architecture, for both good and bad. You get defined behavior but lose portability. Practically speaking, yes, x86 assembly probably is a better way to learn without getting distracted by forty-year-old hardware oddities.