• Aucun résultat trouvé

Video I/O Interrupt (Int 10h)

Dans le document Reference Manual (Page 88-95)

r 5 BIOS Interrupts

5.3 Video I/O Interrupt (Int 10h)

"

'{

Interrupt 10h provides a modified subset of 18M's Video I/O utilities. Principal

differences are due to the fixed size (480 x 200) of the liquid crystal display and custom 5 LCD controller hardware.

Alpha characters can be written and read in graphics mode. The characters are formed from the first 128 characters of the base character set. Graphics characters in the range 128 to 255 come from a user-supplied lK-byte font table pointed to by the vector for interrupt 1Fh. This vector is initially 0000:0000. Each character of the table consists of eight bytes, representing the pixel patterns of the first (top) through last (bottom) dot-rows in an 8-by- 8 character matrix. (Only the first six bits of each byte should be used.) For graphics applications that directly read and write display RAM, display RAM starts at 8000:0000, with successive dot-rows beginning at 64-byte intervals. (Note that while 64 bytes per line times 8 pixels per byte equals 512 pixels per line, the LCD can show only 480 pixels per line; the last four bytes of each line are not used.)

For alpha applications that directly read and write display RAM, alpha page zero starts at 8000:0200 and alpha page one starts at 8000:1800 (or, if you prefer, 8020:0000 and

8020: 1900.) The high byte of the display RAM offset increments with successive character rows (8000:0200 starts page 0 row 0, 8000:0300 starts page 0 row 1, etc.), while the low byte of the offset addresses the columns within each line. Each character requires one word of display RAM: the character code is in the low byte and its

attributes are in the high byte. (Note that this addressing scheme permits access to 128

5

When an Interrupt 10h function requests or returns attribute bytes, their format is not the same as the format in display RAM. Attribute mapping is necessary to provide some degree of IBM compatibility. The format of the Interrupt 10h attribute byte is shown in figure 5-1.

Figure 5-1. Interrupt 10h Attribute Byte

I

b7 b6 b5 b4 b3 b2 bl bO

I

1 ' Loo:

1 =

= UnderlineHalfbright (light font) t t t

=

Inverse

t c Blink

The Video I/O Interrupt functions for this computer are described in table 5-2.

Specify the desired function code in AH, with additional parameters passed in other registers as indicated. All segment registers plus BX,

ex,

and DX are preserved unless otherwise noted; other registers may be destroyed.

Table 5-2. Video I/O Interrupt 10h Functions Function

AH=O Set Mode (OOh)

Description

AH=l (Olh)

AH=2 (02h)

Initializes the specified display mode.

Specify:

AL=O 80 x 25 Alpha.(IBM: 40x 25b&w)

1 80 x 25 Alpha.(IBM: 40x 25color)

2 80 x 25 Alpha.(IBM: 80x 25b&w)

3 80 x 25 Alpha.(IBM: 80x 25color)

4 480 x 200 Graphics.(IBM: 320 x 200 color)

5 480 x~OO Graphics.(IBM: 320 x 200 b&w)

6 480 x 200 Graphics.(IBM: 640 x 200 b&w)

>6 80 x 25 Alpha.

Set Cursor Type

Determines the type of alpha cursor to be displayed.

Specify:

CL IfCL<CH, turn cursor off.

CH~3 Box cursor.

>3 Underscore cursor.

Set Cursor Position

Position the cursor for a specified page (each alpha page has its own unique cursor).

Specify:

BH = Page number (0-1, must be

a

for graphics).

DH :: Row number (0 is top of screen, 24 is bottom).

DL = Column number (0 is left margin, 79 is right).

5

Table 5-2. Video I/O Interrupt 10h Functions (Continued)

5

AHa3 (03h)

AH=4 (04h)

AH=5 (OSh)

AH=6 (06h)

Read Cursor Position

Returns the cursor position for a specified page.

Specify:

BH :: Page number (0-1, must be 0 for graphics).

Returns:

CH :: Current cursor type (as set by function AH=l).

DH :: Row number (0 is top of screen, 24 is bottom).

DL :: Column number (0 is left margin, 79 is right).

Read Light Pen Position

Because there is no light Pen, this function always returns AH=O.

Returns:

AH=O Light pen switch not activated.

Select Active Display Page

This function is valid only in alpha mode.

Specify:

AL :: New page number (0-1).

Scroll Active Page Up

Scrolls the display upwards. (No response in Graphics mode.)

Specify:

AL :: Number of lines to scroll (0 means blank entire window).

BH :: Attribute for scrolled -in blank lines.

CH :: Row number, top of scroll region (0-24).

CL :: Column number, left side of scroll region (0-79).

DH II Row number, bottom of scroll region (0-24).

DL :: Column number, right side of scroll region (0-79).

"

..: " " .

\

Table 5-2. Video 1/0 Interrupt 10h Functions (Continued) Scroll Active Page Down

Scrolls the display downwards. (No response in Graphics mode.)

Specify:

AL :: Number of lines to scroll (0 means blank entire window).

BH :" Attribute for scrolled-in blank lines.

CH c Row number, top of scroll region (0-24).

CL :: Column number, left side of scroll region (0-79).

DH I: Row number, bottom of scroll region (0-24).

DL :: Column number, right side of scroll region (0-79).

Read Attribute/Character at Current Cursor Position

Returns the character and attribute bytes at the current cursor position for a specified page. The cursor does not move.

Specify:

BH :: Display page (ignored in graphics mode).

Returns:

AL :: Character read.

AH :: Attribute of character (zero in graphics mode).

5

AH=9 (09h)

Write Attribule/Character at Current Cursor Position Displays a new character and attribute at the current cursor position for a specified page. The cursor does not move.

Specify:

AL :: Character to write.

BL = Attribute of character (in alpha mode).

Color of character (in graphics mode; see function 12).

BH = Display page (ignored in graphics mode).

CX = Count of characters to write.

Table 5-2. Video I/O Interrupt 10h Functions (Continued)

5

AH·l0

(OAh)

AHa ll

(OBh)

AHz:12 (OCh)

AH=13 (ODh)

Write Character Only at Current Cursor Position

Displays a new character at the current cursor position for a specified page. The attribute byte at that position is left unchanged.

The cursor does not move.

Specify:

AL ;: Character to write.

BH :: Display page (ignored in graphics mode).

ex ::

Count of characters to write.

Set Color Palette This function is ignored.

Write Dot

Places a graphics dot at the specified position.

Specify:

AL ;: New pixel color (Oawhite, 1=black). If bit 7 is set, the new value is exclusive-ORed with the current pixel value.

ex =

Pixel column number (0-479).

ox

= Pixel row number (0-199).

Read Dot

Reads the graphics dot at the specified position.

Specify:

ex

II Pixel column number (0-479).

ox

= Pixel row number (0-199).

Returns:

AL

=

Current pixel value (O=white, l=black).

Table 5-2. Video I/O Interrupt 10h Functions (Continued)

~, . ' ,

("

"-\

~~

AH-14

(OEh)

AH=15

(OFh)

Write Teletype to Active Display Page

This function provides a teletype-like interface to the display. The character in AL is displayed at the current cursor position, and the cursor advances (right) to the next position. Ifthe cursor moves past the end of the line, a carriage return and line feed are performed.

Backspace, carriage return, line feed, and bell are handled as commands rather than displayable characters.

Specify:

AL = Character to output.

BL =Character color if in graphics mode (see function 12).

Current Video State Returns display information.

Returns:

AL c Current mode (as set by function 0).

AH = Number of character columns on the screen(80).

BH = Currently active display page (0-1).

5

Dans le document Reference Manual (Page 88-95)