Undefined behaviour
Undefined behaviour
Posted Sep 10, 2018 18:14 UTC (Mon) by Wol (subscriber, #4433)In reply to: Undefined behaviour by jem
Parent article: C considered dangerous
As I heard it, it was undocumented BECAUSE it didn't work.
You mention SRA and SRL. Therefore you should have a matching SLA and SLL. The story as I heard it was that some programmers used that exact logic, worked out what the opcode for SLL should be, and discovered what I called "shift left and increment".
In other words, a perusal of the documentation led to people deducing a "missing" opcode, and when they tried it, it ALMOST did what was expected.
Cheers,
Wol