hardware interrupt on arithmetic overflow?
Those of us who know the Carry and Overflow flag (lets not forget about sign and zero开发者_运维百科) love them.
My question is, is there a CPU that will interrupt if a carry or overflow flag is set? when it ask it to?
Its way better then having a branch after every arithmetic instruction...
On IA-32 CPUs you have the INTO
instruction (that's the letter O
, not the number 0
) that will go to interrupt handler 4 (#OF) if the overflow flag is set.
There is no equivalent instruction for the carry flag.
Note that this instruction is invalid in 64-bit mode.
The MIPS cpu triggers an exception on overflow.
精彩评论