HOME

TheInfoList



OR:

INT is an
assembly language In computing, assembly language (alternatively assembler language or symbolic machine code), often referred to simply as assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence bet ...
instruction for
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel, based on the 8086 microprocessor and its 8-bit-external-bus variant, the 8088. Th ...
processors that generates a software interrupt. It takes the interrupt number formatted as a
byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable un ...
value. When written in assembly language, the instruction is written like this: :INT ''X'' where ''X'' is the ''software interrupt'' that should be generated (0-255). As is customary with machine binary arithmetic, interrupt numbers are often written in
hexadecimal Hexadecimal (also known as base-16 or simply hex) is a Numeral system#Positional systems in detail, positional numeral system that represents numbers using a radix (base) of sixteen. Unlike the decimal system representing numbers using ten symbo ...
form, which can be indicated with a prefix ''0x'' or with the suffix ''h''. For example, INT 13H will generate the 20th ''software interrupt'' (0x13 is nineteen (19) in hexadecimal notation, and the count starts at 0), causing the function pointed to by the 20th vector in the interrupt table to be executed. INT is widely used in
real mode Real mode, also called real address mode, is an operating mode of all x86-compatible CPUs. The mode gets its name from the fact that addresses in real mode always correspond to real locations in memory. Real mode is characterized by a 20- bit s ...
. In
protected mode In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units (CPUs). It allows system software to use features such as Memory_segmentation, segmentation, virtual mem ...
, INT is a privileged instruction.


Real mode

When generating a ''software interrupt'', the processor calls one of the 256 functions pointed to by the interrupt address table, which is located in the first 1024 bytes of memory while in
real mode Real mode, also called real address mode, is an operating mode of all x86-compatible CPUs. The mode gets its name from the fact that addresses in real mode always correspond to real locations in memory. Real mode is characterized by a 20- bit s ...
(see
interrupt vector An interrupt vector table (IVT) is a data structure that associates a list of interrupt handlers with a list of interrupt requests in a table of interrupt vectors. Each entry of the interrupt vector table, called an interrupt vector, is the addre ...
). It is therefore entirely possible to use a far-call instruction to start the interrupt-function manually after pushing the flag register. An example of a useful DOS ''software interrupt'' was interrupt 0x21. By calling it with different parameters in the registers (mostly ah and al) you could access various IO operations, string output and more.Definition of: int 21
/ref> Most
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
systems and derivatives do not use ''software interrupts'', with the exception of interrupt 0x80, used to make
system call In computing, a system call (syscall) is the programmatic way in which a computer program requests a service from the operating system on which it is executed. This may include hardware-related services (for example, accessing a hard disk drive ...
s. This is accomplished by entering a 32-bit value corresponding to a kernel function into the EAX register of the processor and then executing INT 0x80.


INT3

The INT3 instruction is a one-byte-instruction defined for use by
debugger A debugger is a computer program used to test and debug other programs (the "target" programs). Common features of debuggers include the ability to run or halt the target program using breakpoints, step through code line by line, and display ...
s to temporarily replace an instruction in a running program in order to set a code
breakpoint In software development, a breakpoint is an intentional stopping or pausing place in a computer program, program, put in place for debugging purposes. It is also sometimes simply referred to as a pause. More generally, a breakpoint is a means o ...
. The more general INT XXh instructions are encoded using two bytes. This makes them unsuitable for use in patching instructions (which can be one byte long); see SIGTRAP. The opcode for INT3 is 0xCC, as opposed to the opcode for INT immediate8, which is 0xCD immediate8. Since the dedicated 0xCC opcode has some desired special properties for debugging, which are not shared by the normal two-byte opcode for an INT3, assemblers do not normally generate the generic 0xCD 0x03 opcode from mnemonics.


INTO

The INTO instruction is another one-byte-instruction. It is a conditional ''interrupt'' which is triggered when the overflow flag is set at the time of executing this opcode. This implicitly indicates interrupt #4. The opcode for INTO is 0xCE, however it is unavailable in x86-64 mode.


See also

* INT 10H * INT 13H * DOS API *
Interrupt In digital computers, an interrupt (sometimes referred to as a trap) is a request for the processor to ''interrupt'' currently executing code (when permitted), so that the event can be processed in a timely manner. If the request is accepted ...
*
BIOS interrupt call BIOS implementations provide interrupts that can be invoked by operating systems and application programs to use the facilities of the firmware on IBM PC compatible computers. Traditionally, BIOS calls are mainly used by DOS programs and some ot ...
* Ralf Brown's Interrupt List


References

{{reflist X86 instructions Interrupts