Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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...


1 Answers

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.

like image 51
Nathan Fellman Avatar answered May 11 '26 14:05

Nathan Fellman