INT 10
Encyclopedia
INT 10H or INT 16 is shorthand for BIOS interrupt call
BIOS interrupt call
BIOS interrupt calls are a facility that DOS programs and some other software, such as boot loaders, use to invoke the facilities of the Basic Input/Output System...

 10hex
Hexadecimal
In mathematics and computer science, hexadecimal is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen...

, the 17th interrupt vector
Interrupt vector
An interrupt vector is the memory address of an interrupt handler, or an index into an array called an interrupt vector table that contains the memory addresses of interrupt handlers...

 in an x86-based computer system. The BIOS
BIOS
In IBM PC compatible computers, the basic input/output system , also known as the System BIOS or ROM BIOS , is a de facto standard defining a firmware interface....

 typically sets up a real mode
Real mode
Real mode, also called real address mode, is an operating mode of 80286 and later x86-compatible CPUs. Real mode is characterized by a 20 bit segmented memory address space and unlimited direct software access to all memory, I/O addresses and peripheral hardware...

 interrupt handler
Interrupt handler
An interrupt handler, also known as an interrupt service routine , is a callback subroutine in microcontroller firmware, operating system or device driver whose execution is triggered by the reception of an interrupt...

 at this vector that provides video services. Such services include setting the video mode, character and string output, and graphics primitives (reading and writing pixels in graphics mode).

To use this call, load AH with the number of the desired subfunction, load other required parameters in other registers, and make the call. INT
INT (x86 instruction)
INT is an assembly language instruction for x86 processors that generates a software interrupt. It takes the interrupt number formatted as a byte value.When written in assembly language, the instruction is written like this:...

 10h is fairly slow, so many programs bypass this BIOS routine and access the display hardware directly. Setting the video mode, which is done infrequently, can be accomplished by using the BIOS, while drawing graphics on the screen in a game needs to be done quickly, so direct access to video RAM is more appropriate than making a BIOS call for every pixel.

List of supported functions

Function Function code Parameters Return
Set video mode AH=00h AL = video mode AL = video mode flag / CRT controller mode byte
Set text-mode cursor shape AH=01h CH = Scan Row Start, CL = Scan Row End

Normally a character cell has 8 scan lines, 0-7. So, CX=0607h is a normal underline cursor, CX=0007h is a full-block cursor. If bit 5 of CH is set, that often means "Hide cursor". So CX=2607h is an invisible cursor.

Some video cards have 16 scan lines, 00h-0Fh.

Some video cards don't use bit 5 of CH. With these, make Start>End (e.g. CX=0706h)
Set cursor position AH=02h BH = Page Number, DH = Row, DL = Column
Get cursor position and size AH=03h BH = Page Number AX = 0, CH = Start scan line, CL = End scan line, DH = Row, DL = Column
Read light pen
Light pen
A light pen is a computer input device in the form of a light-sensitive wand used in conjunction with a computer's CRT TV set or monitor. It allows the user to point to displayed objects, or draw on the screen, in a similar way to a touch screen but with greater positional accuracy...

 position (Does not work on VGA systems)
AH=04h AH = Status (0=not triggered, 1=triggered), BX = Pixel X, CH = Pixel Y, CX = Pixel line number for modes 0Fh-10h, DH = Character Y, DL = Character X
Select active display page AH=05h AL = Page Number
Scroll up window AH=06h AL = lines to scroll (0 = clear, CH, CL, DH, DL are used), BH = Background Color BL = Foreground Color
CH = Upper row number, CL = Left column number, DH = Lower row number, DL = Right column number
Scroll down window AH=07h like above
Read character and attribute at cursor position AH=08h BH = Page Number AH = Color
BIOS color attributes
BIOS Color Attribute is a 8 bit value where the low 4 bits represent the character color and the high 4 bits represent the background color. For example to print a white character 'A' with black background, we should set the "BIOS Color Attribute" in the hexadecimal value 0x0F.-List of BIOS color...

, AL = Character
Write character and attribute at cursor position AH=09h AL = Character, BH = Page Number, BL = Color
BIOS color attributes
BIOS Color Attribute is a 8 bit value where the low 4 bits represent the character color and the high 4 bits represent the background color. For example to print a white character 'A' with black background, we should set the "BIOS Color Attribute" in the hexadecimal value 0x0F.-List of BIOS color...

, CX = Number of times to print character
Write character only at cursor position AH=0Ah AL = Character, BH = Page Number, CX = Number of times to print character
Set background/border color AH=0Bh, BH = 00h BL = Background/Border color (border only in text modes)
Set palette AH=0Bh, BH = 01h BL = Palette ID (was only valid in CGA
Color Graphics Adapter
The Color Graphics Adapter , originally also called the Color/Graphics Adapter or IBM Color/Graphics Monitor Adapter, introduced in 1981, was IBM's first color graphics card, and the first color computer display standard for the IBM PC....

, but newer cards support it in many or all graphics modes)
Write graphics pixel AH=0Ch AL = Color
BIOS color attributes
BIOS Color Attribute is a 8 bit value where the low 4 bits represent the character color and the high 4 bits represent the background color. For example to print a white character 'A' with black background, we should set the "BIOS Color Attribute" in the hexadecimal value 0x0F.-List of BIOS color...

, BH = Page Number, CX = x, DX = y
Read graphics pixel AH=0Dh BH = Page Number, CX = x, DX = y AL = Color
Teletype output AH=0Eh AL = Character, BH = Page Number, BL = Color
BIOS color attributes
BIOS Color Attribute is a 8 bit value where the low 4 bits represent the character color and the high 4 bits represent the background color. For example to print a white character 'A' with black background, we should set the "BIOS Color Attribute" in the hexadecimal value 0x0F.-List of BIOS color...

 (only in graphic mode)
Get current video mode AH=0Fh AL = Video Mode
Write string (EGA+, meaning PC AT minimum) AH=13h AL = Write mode, BH = Page Number, BL = Color
BIOS color attributes
BIOS Color Attribute is a 8 bit value where the low 4 bits represent the character color and the high 4 bits represent the background color. For example to print a white character 'A' with black background, we should set the "BIOS Color Attribute" in the hexadecimal value 0x0F.-List of BIOS color...

, CX = String length, DH = Row, DL = Column, ES:BP = Offset of string
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK