INTO is a one-byte instruction (CEh) that looks at OF. With OF = 0 it does nothing and execution goes on. With OF = 1 it acts exactly like INT 4: push FLAGS, clear IF and TF, push CS, push IP, and continue at the address stored in vector 4 (0000:0010). The saved IP points to the instruction after the INTO, so a handler that only reports the error can return with IRET and the program continues.
The idea is to put INTO after each signed operation and handle every overflow in one place instead of writing a JO everywhere:
ADD AX, BXINTO ; INT 4 if the signed sum overflowedIMUL CXINTO ; and if the product needs DX
It only helps once a program has installed its own INT 4 handler (with DOS function 25h, restoring the old vector before exit). What the vector points to otherwise depends on the system, so the runnable example makes the same test with JO, without an interrupt:
MOV AL, 120ADD AL, 10 ; 130 does not fit a signed byte: OF = 1MOV DX, OFFSET OKMSG1JNO SHOW1 ; the test INTO makesMOV DX, OFFSET OVMSG1SHOW1:MOV AH, 09hINT 21hOKMSG1 DB "no overflow", 13, 10, "$"OVMSG1 DB "signed overflow", 13, 10, "$"
Later CPUs
INTO works the same on later x86 processors in 16- and 32-bit code; 64-bit mode dropped it.