HOME

TheInfoList



OR:

INT is an
assembly language In computer programming, assembly language (or 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 b ...
instruction for x86
processors A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, a ...
that generates a
software 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, ...
. 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 uni ...
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 In mathematics and computing, the hexadecimal (also base-16 or simply hex) numeral system is a positional numeral system that represents numbers using a radix (base) of 16. Unlike the decimal system representing numbers using 10 symbols, he ...
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 the number 19 -- nineteen -- written in hexadecimal notation, and the count starts with 0), causing the function pointed to by the 20th vector in the interrupt table to be executed.


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 ...
(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, multiuser 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, ...
systems and derivatives do not use ''software interrupts'', with the exception of interrupt 0x80, used to make
system call In computing, a system call (commonly abbreviated to 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, acc ...
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 or debugging tool is a computer program used to test and debug other programs (the "target" program). The main use of a debugger is to run the target program under controlled conditions that permit the programmer to track its executi ...
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 program, put in place for debugging purposes. It is also sometimes simply referred to as a pause. More generally, a breakpoint is a means of acquiring know ...
. 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 The DOS API is an API which originated with 86-DOS and is used in MS-DOS/ PC DOS and other DOS-compatible operating systems. Most calls to the DOS API are invoked using software interrupt 21h ( INT 21h). By calling INT 21h with a subfunctio ...
*
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 * Ralf Brown's Interrupt List


References

{{reflist X86 instructions Interrupts