3 ms·
C makes lots of things undefined behavior which are perfectly fine in assembler — read a stack without first writing to it, doing overflow signed internet arith
by CJefferson 3y ago
C makes lots of things undefined behavior which are perfectly fine in assembler — read a stack without first writing to it, doing overflow signed internet arithmetic, treating the same memory location as different types.
Also there is quite a lot in modern assembler that you can’t really get to from C, like prefetch and cache flushing instructions.
- danielvaughn 3y agoThat last bit is really interesting. Do newer languages make use of those features? Sorry I’m fairly ignorant of this level of the stack.
- trealira 3y agoNewer languages don't make use of any of those features, to my knowledge. They're only available in assembly, and only on modern processors. Because C was made on and designed for hardware that was crappy even in the 1970s, which didn't have a cache or do out of order execution, C doesn't fully reflect the capabilities of modern processors. That's what they're implying with the last sentence, I'm pretty sure.