|
|
|
|
|
by PhantomGremlin
1584 days ago
|
|
the MIPS R3000 processor ... raises an exception for signed integer overflow, unlike many other processors which silently wrap to negative values. Too bad programmer laziness won and most current hardware doesn't support this. As a teenager I remember getting hit by this all the time in assembly language programming for the IBM S/360. (FORTRAN turned it off). S0C8 Fixed-point overflow exception
When you're a kid you just do things quickly. This was the machine's way of slapping you upside your head and saying: "are you sure about that?" |
|
There were discussions around this a few years back when Regher brought up the subject, and one of the issues commonly brought up is if you want to handle (or force handling of) overflow, traps are pretty shit, because it means you have to update the trap handler before each instruction which can overflow, because a global interrupt handler won't help you as it will just be a slower overflow flag (at which point you might as well just use an overflow flag). Traps are fine if you can set up a single trap handler then go through the entire program, but that's not how high-level languages deal with these issues.
32b x86 had INTO, and compilers didn't bother using it.