The document discusses various BIOS functions for screen display and video operations using INT 21h and INT 10h. Some key functions covered include displaying characters and strings with INT 21h functions 02h and 09h, clearing the screen and scrolling with INT 10h function 06h, and setting the cursor position with INT 10h function 02h. Details are provided on parameters and examples for many of the functions.
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
INT 21H & INT 10H VIDEO FUNCTIONS
1. INT 21H FOR SCREEN DISPLAY
&&
INT 10H OPERATIONS
2. Video Screen Operations
• Screen Display with INT 21h
– functions 02h to display a character
– function 09h to display a string
• Setting the cursor position on the screen
– INT 10h ;with function 02h
• Clearing the screening and Scrolling
– INT 10h ;with function 06h
3. Displaying a Character
Load 02h in AH
Load the character to be displayed in DL
Call INT 21h
Example:
CHAR DB ‘X’
MOV AH,02h ; Step 1
MOV DL,CHAR ; Step 2
INT 21h ; Step 3
4. Displaying a String of Characters
String DB ‘Hello world’, 13, 10
...
LEA DI,STRING1
MOV AH,02h
MOV CX,13
LP1: MOV DL,[DI]
INT 21h
INC DI
LOOP LP1
...
5. Displaying a String of Character
• Use INT 21h with function 09h:
• Define a string in the data area
– String must be ended with a ‘$’
• Load 09h in register AH
• Load the offset address of the string in
DX
• Call INT 21h
6. Example
String DB ‘Hello There’,13,10,‘$’ ;Step 1
...
MOV AH,09H ;Step 2
LEA DX,String ;Step 3
INT 21h ;Step 4
...
7. Screen Clearing
INT 10h with function 06h
Load 06h in AH
Load 00h in AL (for clearing the full screen)
Load attribute value in BH (color, blinking)
Load starting position to scroll in CX
(row:column)
row # in CH and column # in CL
Load ending position in DX (row:column)
row # in DH and column # in DL
8. Example
Clear screen with white background and
red foreground
MOV AX,0600h ;AH=06h & AL=00h
MOV BH,74h ;White background (7)
red foreground(4)
MOV CX,0000h ;row 0 col 0
MOV DX,184Fh ;row 24 col 79(inHex)
INT 10h
9. Screed Display with File Handles
• A file handle is a number that refers to a
specific device such as keyboard, screen,
printer or a disk file
• File handles are useful in case the output
from a program is be redirected to a
device other than the screen ( e.g. a disk
file) or if the input is to redirected from a
device other than the keyboard
10. File Handles
• File handles are useful when reading
from or writing to a disk file
• The file handles for standard devices
such as the keyboard and the screen are
preset.
The file handle for keyboard = 00
The file handle for the screen = 01
11. Screed Display with File Handles
To display a string of character on the
screen with file handles use INT 21h
function 40h
– Set up string to be displayed as with function
09h
– Load AH with 40h
– Load DX with address of data to be displayed
– Load BX with 01 ; file handle for screen
– Load CX with number of characters to display
– Call INT 21h
12. Example
STRING1 DB ‘Hello There’,0Dh ,0Ah ;Step 1
...
MOV AH,40h ;Step 2
LEA DX,STRING1 ;Step 3
MOV BH,01 ;Step 4
MOV CX,13 ;Step 5
INT 21h ;Step 6
13. BIOS INT 10H OPERATIONS
INT 10H Function 00H: Set Video Mode
Sets the video mode and also clears the screen (this can
be overridden).
AH contains 00H and AL contains the color
INT 10H Function 01H: Set Cursor Size
Sets the cursor size on the Video Controller.
set AH = 01H
set CH (bits 4-0) = top of cursor (start scan line)
set CL (bits 4-0) = bottom of cursor (end scan line)
14. INT 10H Function 02H: Set Cursor Position
Set the cursor anywhere on the screen whether in
graphics or text mode.
set AH = 02H
set BH = page number (0 is the default)
set DH = row and DL = column
INT 10H Function 03H: Return Cursor Status
set AH = 03H
set BH = page number
AX and BX are unchanged and returns these values:
CH = Starting scan line DH = Row
CL = Ending scan line DL = Column
15. INT 10H Function 05H: Select Active Page
set AH = 05H
set AL = page number
INT 10H Function 06H: Scroll Up Screen
set AH = 06H
set AL = number of rows (00H for full screen)
BH = attribute or pixel value
CX = starting row:coloumn
DX = ending row:coloumn
16. The operation returns no values: Here's a
standard approach for scrolling up on line:
1. Initialize ROW variable to 0
2. Display a line and advance the cursor to the
next line.
3. Text whether ROW is near the bottom of the
screen (CMP ROW,22)
4. If yes, scroll one line, use ROW to set the
cursor, and clear ROW to 00H.
5. If no, increment ROW (INC ROW).
17. INT 10H Function 07H: Scroll Down Screen
set AH = 07H
set AL = Number of rows (00H for full screen)
set BH = Attribute or pixel value
set CX = Starting row:coloumn
set DX = Ending row:coloumn
INT 10H Function 08H: Read Character and Attribute at
Cursor
set AH = 08H
set BH = page number
In text mode, AL contains the character and AH its
attribute.
In graphics mode, 00H for a non-ASCII character.
18. INT 10H Function 09H: Display Character and Attribute at
Cursor
set AH = 09H
set AL = ASCII character
set BH = Page number
set BL = Attribute or pixel value
set CX = count (how many times to repeat character in AL)
This operation does not advance the cursor or respond to
the Bell, Carriage Return, Line Feed, or Tab Characters:
instead, it attempts to display them as ASCII characters. In
text mode, when the display exceeds the rightmost column,
the operation automatically continues the display on the
next row at column 0. For graphics mode, use BL for defining
the foreground colour. If bit 7 is 0, the defined colour
replaces present pixel colour: if bit 7 is 1, the defined colour
is combined (XORed) with them.
19. INT 10H Function 0AH: Display Character at Cursor
Same as 09H, except instead of setting the attribute it
uses the current value.
INT 10H Function 0BH: Set Colour Palette
set AH = 0BH
set BH = 00H : Select the background colour, where BL
contains the colour value in bits 0-3
(any of 16 colours)
set BH = 01H: Select the palette for graphics, where BL
contains the palettel (0 or 1)
20. INT 10H Function 0CH: Write Pixel Dot
set AH = 0CH
AL = colour of pixel
BH = page number
CX = column
DX = row
Maximum row or column size depends upon the graphics
resolution.
INT 10H Function 0DH: Read Pixel Dot
set AH = 0DH
set BH = page number
set CX = column
set DX = row
AL contains the returned pixel colour
21. INT 10H Function 0EH: Display in Teletype Mode
INT 10H Function 0FH: Get Current Video Mode
set AH = 0FH
AL = current video mode
BH = active video page
INT 10H Function 10H: Access Palette Registers
and Video DAC
set AH = 10H
Subfunction 00H:
Update Palette Register (changes the colour
displayed by any of 16
Palette registers)
Set BH = colour value
set BL = 00 - 0FH (palette register
number)
22. Subfunction 01H:
Update Border Color
set BH = new border color
Subfunction 03H:
Select Background Intensity (enable or disable
blinking attribute)
set BL = 00H (disable) or 01H (enable)
Subfunction 07H:
Read Palette Register ( returns the color code
stored in any of the 16
Palette registers)
BH = returned color code
23. Subfunction 08H:
Read Overscan Register (returns the colour code
currently in the
Overscan (border) register)
BH = returned colour code
Subfunction 09H:
Read Table of Palette Register Values
Subfunction 10H: Update DAC Colour Register
Subfunction 12H: Update Block of DAC register
Subfunction 15H: Read Video DAC Colour Register
Subfunction 17H: Read Block of DAC Registers
Subfunction 1BH: Perform gRay Scaling on DAC
Registers
24. INT 10H Function 11H: Access Character Generator
INT 10H Function 12H: Select Alternative Video
Routine
INT 10H Function 13H: Display Character String
INT 10H Function 1AH: Video Display Combination
INT 10H Function 1BH: Return Video BIOS
Information
INT 10H Function 1CH: Save or Restore Video State