Int 10 h function Introduction

Source: Internet
Author: User
Tags silver light

Int 10 H is a service provided by the BIOS to the screen and display.ProgramLater, the company provided many service programs for the Chinese language, these service programs are also attached to the int 10 h. When you use int 10 h to interrupt the service program, first specify the ah register as one of the following table numbers, which indicates the function to be called, and the details of other registers, refer to the post-Table text, call int 10 h after everything is set. Below are their descriptions:

Ah function call parameter return parameter/comment
1 set the cursor type (CH) 0-3 = start line of the cursor
(CL) 0-3 = cursor end line
2 set the cursor position bH = page number
DH = row
DL = Column
3 read cursor position bH = page number CH = cursor start line
CL = cursor end line
DH = row
DL = Column
4 sets display page Al = display page number
5. Screen initialization or roll-on
6. Screen initialization or upper-volume Al = number of upper-volume rows
Al = 0 full screen Blank
BH = get involved in row attributes
Ch = row number in the upper left corner
CL = column number in the upper left corner
DH = bottom right row number
DL = column number in the lower right corner
7. Screen initialization or volume below Al = number of volume rows
Al = 0 full screen Blank
BH = get involved in row attributes
Ch = row number in the upper left corner
CL = column number in the upper left corner
DH = bottom right row number
DL = column number in the lower right corner
8. Read the attribute and character BH of the cursor position = display page Ah = attribute
Al = character
9. display characters and their attributes at the cursor position on the BH = display page
Al = character
BL = attribute
Cx = repeated characters
A Only displays characters bH = display page at the cursor position
Al = character
Cx = repeated characters
E display character (move cursor) Al = character
BL = foreground color cursor follows character Movement
13 show string ES: BP = string address
Cx = String Length
DH, DL = starting Column
BH = page number
Al = 0, BL = attribute
String: Char, Char ,......, Char
Al = 1, BL = attribute
String: Char, Char ,......, Char
Al = 2
String: Char, ATTR ,......, Char, ATTR
Al = 3
String: Char, ATTR ,......, Char, ATTR

 

Cursor returns start position

Move the cursor

Cursor returns start position

Move the cursor following the string
 

--------------------------------------------------------------------------------

Ah = 00 h
Ah = 00/INT 10 H is a service program used to set the display mode. The Al Register indicates the mode to be set:

Al text/graphic resolution color
00 text 40*25 2
01 text 40*25 16
02 text 80*25 2
03 text 80*25 16
04 graphic 320*200 2
05 image 320*200 4
06 graphics 640*200 2

Ah = 01 H
You can think of the cursor as a small rectangle, which is usually flat at the bottom of a word, but this function can change its size and position. The starting position and ending position of the cursor are represented by 0 to 4 bits of CL and CH respectively. See:

The 7th bits of CH must be 0, and the 5th and 6 bits indicate the cursor attribute:

6-digit, 5-digit property
0 0 normal
0 1 invisible
1 0
1 1 blinking slowly Ah = 02 h
the function is to set the cursor position, the positions are represented by DH and DL. DH indicates the column number and DL indicates the row number. From left to right, it is called "column". The first column on the top of the screen is the zero column, and the next column next to the zero column is called the first column ......; The top and bottom lines are called "rows", the leftmost line of the screen is called The 0th line, and the row next to the right of the 0th line is the first line. Therefore, the leftmost, top position is DH = 0 and DL = 0; the leftmost second column, DH = 1, DL = 0. In text mode, BH is the display page for changing the cursor position, and in graphic mode, BH is set to 0.

The meaning of DH and DL is illustrated by rows and columns. little puppets are often confused and explained by coordinates. In text mode, the character position is similar to the coordinate of the mathematical coordinate system, but the Y axis is in the opposite direction, and the Y axis is zero at the top of the screen. The larger the value is, until 24, stored in DH. The X axis and the X axis coordinate system are the same. The larger the right side is, the larger the value is stored in the DL. The maximum value varies depending on the display mode.

Ah = 03 h
Ah = 03 h/INT 10 h when the interrupted service program returns, there will be a row and column position of the indicator in dx, and the size of the indicator in CX, the values of DX and CX indicate the same meaning as Ah = 02 h/INT 10 h and Ah = 01 H/INT 10 h.

Ah = 04 H
This function is used to detect the position of the optical pen. It seems that only the CGA card has a optical pen ??

Ah = 05 h
This function displays the specified display page on the screen, and the display page to be displayed is specified in the Al register. This function can only take effect in text mode.

Ah = 06 h/07 h
The function of this service program is to move the text in a set rectangle area up or down. First, move up, that is, call Ah = 06 h/INT 10 h. When this service program works, the text in the rectangle area is moved up, and the bottom of the rectangle area is moved into the space column. The number of columns to be moved up is stored in Al (if Al is zero, all columns in the rectangular area are moved up), and the attributes to move to the space column at the bottom are stored in BH, the rectangle area uses CX and dx to set the coordinates between the upper left corner and the upper right corner. the rows and columns in the upper left corner are respectively set by Cl and CH, And the rows and columns in the lower right corner are set by DL and DH.

Ah = 07 h/INT 10 h is similar to Ah = 06 h/INT 10 h, but the volume is different.

Ah = 08 h
This service program is used to obtain the characters and attributes of the cursor position. Before calling, BH indicates the display page to be read. When returned, Al is the ASCII character of the position, ah is its property. For more information about attributes, see note 1.

Ah = 09 h
This function displays characters at the cursor position. The ASCII code of the characters to be displayed is stored in the Al register, the number of character repetitions is stored in the Cx register, the display page is stored in the BH register, and the attribute is stored in the BL register, its attribute is the same as Ah = 08/INT 10 h.

Ah = 0ah
This function is the same as Ah = 09 h/INT 10 h. The difference is that ah = 0ah can only write one character, and the character attribute cannot be changed.

Ah = 0bh
This service program selects a color palette. The display mode 5 is a 320*200 graphic mode. Up to four colors can be displayed. These four colors mean that a background color and three foreground colors can be displayed at most simultaneously, there are two ways to select the three foreground views. Therefore, in fact, there are two color palette options in display mode 5. It is as if you want to buy 12 colors of Watercolor, but you can match many colors in any proportion on the color palette.

Color Palette 0 three colors are green, red, yellow; color palette 1 three colors are green, purple, white. There are 16 kinds of background colors available, which are the 16 colors of one note. When calling this interrupt, you must first decide whether to set the background color or color palette,

To set the background color, set BH to 0, and then set the BL value to 0 to 0fh, which indicates one of the 16 colors.
To set the color palette, set BH to 1. Set BL to zero or one to select the color palette.
The background color is displayed only when the foreground color is 0.

Ah = 0ch
Ah = 0ch/INT 10 h is to show a point in drawing mode (that is, write graphics pixel ), ah = 0dh/INT 10 h is the read graphics pixel ).

When writing data, the X coordinate must be written to the Cx register, the Y coordinate to the DX register, and the color to the Al register. Similar to the text mode, the Y coordinate on the fluorescent screen is zero in the top column. The larger the column is, the greater the column is. The X coordinate is the same as the mathematical definition. The range of Cx, dx, and Al values is related to the display mode:

Display Mode X coordinate Y coordinate color
4 0 ~ 319 0 ~ 199 0, 1
5 0 ~ 319 0 ~ 199 0 ~ 3
6 0 ~ 639 0 ~ 199 0, 1

Ah = 0dh/INT 10 h is to read the point image of a certain position, you must specify CX, dx, and INT 10 h will return the color of the point image of this position.

Ah = 0eh
This subroutine enables the display to display characters like typewriter, if Ah = 09 h/INT 10 h and Ah = 0ah/INT 10 h are used before, the characters can be displayed on the fluorescent screen, but after the two characters are displayed, the cursor position does not move, and ah = 0eh/INT 10 h will move the cursor position. For each character displayed, the cursor will move one cell to the right, if it has reached the rightmost, the cursor moves to the leftmost column and to the next column. If you have moved to the rightmost column, the screen will scroll up.

Characters to be displayed in the Al register. bh is the current display page. If it is in graphic mode, BH must be set to 0. If it is in graphic mode, you can also set BL to indicate the color of the text. Bl in text mode is not functional.

Ah = 0fh
This service program is used to obtain the current display mode. You only need to set Ah to 0fh before calling. When the result is returned by INT 10 h, the display mode is stored in the Al register (see the display mode table of Ah = 00 h/INT 10 h). The current display page is stored in the BH register, and the total number of characters is stored in the ah register.

--------------------------------------------------------------------------------

NOTE 1: The attribute refers to the Character Color, background color, flashing, bottom line, and other properties. In the text mode of the Color Display Card (CGA/EGA/VGA), the color is represented by four digits, so 16 colors can be displayed, as shown in the following table:

Binary color example binary color example
0000 black 1000 gray
Blue 0001 blue 1001 light blue
0010 Green 1010 light green
0011 blue cyan 1000 light blue light cyan
0100 red 1100 light red
0101 purple magenta 1101 light purple red light magenta
0110 BROWN 1110 yellow
0111 silver light gray 1111 white

In color displays, such as CGA, TTS, and VGA, a single byte (eight digits) is often used to represent the text color and background color, usually 0th ~ Three digits indicate the color of the text; 4th ~ 6-digit indicates the background color. The background color is only 8 in the left column of the preceding table. 7th-digit indicates whether to flash. 0 indicates not to flash, and 1 indicates whether to flash.

However, in a monochrome display, such as the MDA and Hercules cards, these color tables are meaningless, so the attribute interpretation method is different. See the following table:

Numeric attribute
00 H space, no data is displayed
77 H show white squares
07 h normal black and white characters
70 h white back black
01 H + bottom line

Read the full text

Category:View comments by default

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.