List of important DOS INT 21H services PDF

Title List of important DOS INT 21H services
Author Shamesh Krishna
Course Assembly Programming
Institution Visvesvaraya Technological University
Pages 11
File Size 127.3 KB
File Type PDF
Total Downloads 33
Total Views 123

Summary

List of important DOS INT 21H services...


Description

i.

List of important DOS INT 21H services DOS system calls use the 21H vector. Some of the important INT 21H services are listed here. Function No. AH = 01 AH = 02 AH = 05 AH = 08 AH = 09

Action

Returns/Expects

Read character from standard input device with echo Write character to standard output device Write character to printer Read character input from standard input device, without echo Display string

Returns: AL = ASCII of the input key

AH = 0AH Buffered string output AH = 25H Set interrupt vector

Expects: DL = ASCII code of output data Expects: DL = ASCII of the output Returns: AL = ASCII of the input key Expects: DS:DX = segment: offset of string, terminated by '$' Expects: DS:DX = segment: offset of buffer Expects: AL = machine interrupt number

AH = 2AH Get DOS system date

DS:DX = segment offset of interrupt service routine Returns: DL = Day (1 to 31) AL = Day (0 = Sunday, 1 = Monday etc.) DH = Month (1 to 12),

AH = 2BH Set DOS system date

CX = Year (1980 to 2099) Expects: DL = Day (1 to 31) DH = Month (1 to 12),

AH = 2CH Get DOS system time

CX = Year (1980 to 2099) Returns:

Function No.

Action

Returns/Expects

CH = Hour (0 to 23) CL = Minutes (0 to 59) DH = seconds (0 to 59)

AH = 2DH Set DOS system time

DL = 100th of seconds (0 to 99) Expects: CH = Hour (0 to 23) CL = Minutes (0 to 59) DH = seconds (0 to 59)

AH = 30H Get DOS version number

DL = 100th of seconds (0 to 99) Returns: AL = Major version number (DOS 6.2 = 6 etc) AH = Minor version number

(DOS 6.2 = 2 etc) AH = 31H Terminate and stay resident (TSR) Expects: AL = return code

AH = 35H Get interrupt vector

DX = number of paragraphs to make resident in memory Expects: AH = 35H AL = interrupt type number Returns:

AH = 4CH Terminate with return code

ES:BX of interrupt service routine Expects: AL = return code

ii.

BIOS 10H functions for video 1. INT 10H, Function 00: Set Video Mode Expects: AH = 00 AL = display mode Returns: None Description: The function 00 is used to set the video mode. This function clears the screen, sets the BIOS variables, and initializes the video mode. 2.

INT 10H, Function 01: Set Cursor Shape Expects: AH = 01 CH bits 0–4 = starting line for cursor (20H = no cursor) CL bits 0–4 = ending line for cursor Returns: None Description: The function 01 is used to set the shape of the cursor. This is performed by selecting the starting and ending lines for the blinking hardware cursor (works in text mode only).

3.

INT 10H, Function 02: Set Cursor Position Expects: AH = 02 BH = video page (must be zero in graphics mode) DH = row (y coordinate) DL = column (x coordinate) Returns: None Description: The function 02 is used to set the position of a cursor on the display device (monitor) using text coordinates (row and column).

4.

INT 10H, Function 03 : Read Cursor Position Expects: AH = 03

BH = video page Returns: DH = current row (y coordinate) DL = current column (x coordinate) CH = starting line for cursor CL = ending line for cursor Description: The function 03 is used to read the current position of the cursor on the display in text coordinates. 5.

INT 10H, Function 04 : Read Light Pen Position Expects: AH = 04 Returns: AH = 0 if light pen not down or not triggered 1 if light pen down or triggered CH = pixel row (y coordinate in graphics mode 04-06) CX = pixel row (y coordinate in graphics mode 0DH-13H) BX = pixel column (x coordinate in graphics mode) DH = character row(y coordinate 0-24 in text mode) DL = character column (x coordinate 0-79 or 0-39 in text mode) Description: The function 04 is used to read the current status and position of the light pen.

6.

INT 10H, Function 05 : Set Active Video Page Expects: AH = 05 AL = page number Returns: None for standard PC Description: The function 05 is used to select the active display page for the video display.

7.

INT 10H, Function 06 : Scroll (Initialize) Rectangle Window Up

Expects: AH = 06 AL = Number of lines to scroll up (if AL = Zero, entire window is cleared or blanked) BH = blanked area attributes CH = y coordinate, upper left corner of window CL = x coordinate, upper left corner of window DH = y coordinate, lower right corner of window DL = x coordinate, lower right corner of window Returns: None Description: The function 06 is used to initialize a specified rectangular window of the display to ASCII characters with a given attribute, or scrolls the contents of a window up by a specified number of lines. 8.

INT 10H, Function 07 : Scroll (Initialize) Rectangle Window Down Expects: AH = 07 AL = Number of lines to scroll down (if AL = Zero, entire window is cleared or blanked) BH = blanked area attributes CH = y coordinate, upper left corner of window CL = x coordinate, upper left corner of window DH = y coordinate, lower right corner of window DL = x coordinate, lower right corner of window Returns: None Description: The function 07 is used to initialize a specified rectangular window of the display to ASCII character with a given attribute, or scrolls the contents of a window down by a specified number of lines.

9.

INT 10H, Function 08 : Read Character and Attribute at Cursor

Expects: AH = 08 BH = video page (on CGA, must be 0 in graphics mode) Returns: AH = attribute byte AL = ASCII character code Description: The function 08 used to read the ASCII character and its attribute at the current cursor position for the specified video page. 10.

INT 10H, Function 09 : Write Character and Attribute at Cursor Expects: AH = 09 AL = ASCII character code BH = video page BL = attribute (in text mode) or color (in graphics mode) CX = count of character to write (replication factor) Returns: None Description: The function 09 is used to write a specified ASCII character and its attribute to the video display at the current cursor position.

11.

INT 10H, Function 0AH : Write Character Only at Cursor Expects: AH = 0AH AL = ASCII character code BH = video page BL = color (graphics mode) CX = count of characters to write (replication factor) Returns: None Description: The function 0AH is used to write an ASCII character to the video display at the current cursor position. The character uses the attribute of the previous character displayed at the same position.

12.

INT 10H, Function 0BH : Set Color Palette Expects: AH = 0BH In text mode BH = 00 selects border color BL = border color (0-1FH: 10H to 1FH for high intensity) In graphics mode BH = 01 select palette combination BL = 0 to select Red Green Blue combination BL = 1 to select Cyan Magenta White combination Returns: None Description: The function 0BH is used to set the contents of a color palette.

13.

INT 10H, Function 0CH : Set Pixel Expects: AH = 0CH AL = pixel color value BH = video page CX = column number (x coordinate in graphics mode) DX = row number (y coordinate in graphics mode) Returns: None Description: The function 0CH is used to set the pixel point on the video display at the specified graphics coordinates. The range of possible valid (x, y) coordinate depends on the current video mode.

14.

INT 10H, Function 0DH : Get Pixel Expects: AH = 0DH BH = video page

CX = column number (x coordinate) DX = row number (y coordinate) Returns: AL = pixel value (pixel attribute-color) Description: The function 0DH is used to read the attributes of pixel point on the video at the specified graphics coordinates. The range of possible valid (x, y) coordinate depends on the current video mode. 15.

INT 10H, Function 0EH : Write Text in Teletype Mode Expects: AH = 0EH AL = ASCII character code BH = video page (in text mode) BL = foreground color (in graphics mode) Returns: None Description: The function 0EH is used to write an ASCII character to the video display at the current cursor position, using the specified color both in text and graphics mode.

16.

INT 10H, Function 0FH : Get Video Mode Expects: AH = 0FH Returns: AH = number of character columns on screen AL = display mode BH = active video page Description: The function 0FH is used to read the current video mode of the active video controller.

17.

INT 10H, Function 10H : Set Color Palette Registers Expects: AH = 10H AL = 00 for setting palette register 01 for setting border color register

02 for setting all palette register and border register 03 for toggling blink or intensity bit (only on EGA) BH = color value BL = palette register to set (00 to 02) if AL = 00 blink/intensity bit AL = 03 0 enable intensity 1 enable blinking ES:DX = segment:offset of color list (if AL = 02) Returns: None Description: The function 10H is used to set palette register to the new color combination. 18.

INT 10H, Function 13H : Display String Expects: AH = 13H AL = write mode 0 use attribute in BL cursor position is not updated after write 1 use attribute in BL cursor position is updated after write 2 string format: char, attr, …, char, attr cursor position is not updated after write 3 string format: char, attr, …, char, attr cursor position is updated after write BH = video page BL = attribute (write modes 0 and 1) CX = length of string DH, DL = row, column to start display of string ES:BP = segment:offset of source string Returns: None

Description: The function 13H is used to transfer a string to video buffer for current active display. 19.

INT 10H, Function 0FEH : Get Video Buffer Pointer Expects: AH = 0FEH ES:DI = segment:offset of assumed video buffer B000:000H for monochrome adapter B800:0000 for standard or color graphic adapter Returns: ES:DI segment:offet of actual video buffer for current process Description: The function 0FEH is used to obtain the memory pointer of the video buffer for the currently executing task under top view.

20.

INT 10H, Function 0FFH : Update Video Buffer Expects: AH = 0FFH CX = number of sequential characters that have been modified DI = offset of first character that has been modified within shadow video buffer ES = segment of shadow video buffer Returns: None Description: The function 0FFH is used to copy the contents of the application–s shadow video buffer to the true video refresh buffer under Top View.

iii.

BIOS 16H functions for keyboard control Here is presented a few BIOS interrupts for keyboard control. Some of the early BIOS functions catered to the old 83-key keyboard only. Later, some more BIOS functions were added for the enhanced keyboard. 1.

AH = 0 or AH = 10H. The first function number is for the older keyboard. The second one is the equivalent one for the enhanced keyboard. This function checks for a character in the keyboard buffer. If available, the scan code is returned in AH, and ASCII value in AL. For function keys (F0 to F12) which have no ASCII values, AL = 0.

If no character is available in the keyboard buffer, the function waits for a key press. 2.

3.

AH = 01 or AH = 11H. The first function number is for the older keyboard. The second one is the equivalent one for the enhanced keyboard. This function is similar to the previous one, except that if no character is available in the keyboard buffer, it does not wait for a key press. It simply sets ZF (ZF = 1) and returns. AH = 02 or AH = 12H. The first function number is for the older keyboard. The second one is the equivalent one for the enhanced keyboard. This function returns the first keyboard status byte in the AL register. This status byte is also available in the BIOS data area 0040 : 0017....


Similar Free PDFs