Share on Facebook Share on Twitter Email
Answers.com

INT

 
 

A programming statement that specifies an interrupt or that declares an integer variable. See interrupt and integer.

Download Computer Desktop Encyclopedia to your iPhone/iTouch

Search unanswered questions...
Enter a word or phrase...
All Community Q&A Reference topics
Wikipedia: INT (x86 instruction)
 

INT is an assembly language instruction for x86 processors for generating a software interrupt. It takes the interrupt number formatted as a byte value.[1] Depending on the context, compiler or assembler, a software interrupt number is often given as a hexadecimal value, sometimes with a prefix 0x or the suffix h (e.g. interrupt 0x21, int 21, or interrupt 21h).

When done in assembly language code, the instruction is written like this:

INT X

Where X is the software interrupt that should be generated. For example:

INT 40

Will generate a software interrupt 0x40, causing the function pointed to by the 0x40th vector in the interrupt table to be executed.

Contents

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 (See Interrupt vector). It is therefore entirely possible to use an x86-call instruction to call the interrupt-function manually.

One of the most useful DOS software interrupts 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.[2]

Most Unix systems and derivatives do not use software interrupts, with the exception of interrupt 0x80, used to make system calls. 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.

INT 3

The INT 3 instruction is defined for use by debuggers to temporarily replace an instruction in a running program, in order to set a breakpoint. Other INT instructions are encoded using two bytes. This makes them unsuitable for use in patching instructions (which can be one byte long).

The opcode for INT 3 is 0xCC, as opposite from the opcode for INT immediate', which is 0xCD imm8. According to Intel documentation: "Intel and Microsoft assemblers will not generate the CD03 opcode from any mnemonic" and 0xCC has some special features, which are not shared by "the normal 2-byte opcode for INT 3 (CD03)" [IA-32 Arch. Software Developer’s Manual. Vol. 2A]

See also

References


 
Shopping: INT
Top
 
 

 

Copyrights:

Computer Desktop Encyclopedia. THIS COPYRIGHTED DEFINITION IS FOR PERSONAL USE ONLY.
All other reproduction is strictly prohibited without permission from the publisher.
© 1981-2009 Computer Language Company Inc.  All rights reserved.  Read more
Wikipedia. This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "INT (x86 instruction)" Read more