'=========================================================================== ' Subject: INTERRUPT 10H REFERENCE Date: Unknown Date (00:00:00) ' Author: The ABC Programmer Code: None ' Origin: INTERRUPT,10H,REFERENCE Packet: INTERRPT.ABC '=========================================================================== ****************************************************** *** The Interrupt 10H Reference with ASM Examples *** ****************************************************** INT 10H Service 0 Set Screen Mode Input AH=0 AL=Mode ASM Example: Mov Ah,0 ; Interrupt Service 0 Mov Al,3 ; 80x25 Color Text Int 10h ; Call DOS Interrupt 10H BIOS Display Number Adapter Cards Maximum Pages Mode(AL) Lines of Colors Allowed -------------------------------------------------------------- 0 40x25 B&W text CGA, EGA, VGA 8 1 40x25 Color text CGA, EGA, VGA 8 2 80x25 B&W text CGA, EGA, VGA 4(CGA),8(EGA,VGA) 3 80x25 Color text CGA, EGA, VGA 4(CGA),8(EGA,VGA) 4 320x200 4 CGA, EGA, VGA 1 5 320x200 B&W CGA, EGA, VGA 1 6 640x200 2(on/off) CGA, EGA, VGA 1 7 80x25 Mono MGA, EGA, VGA 1(MDA),8(EGA/VGA) 8 160x200 16 PCjr 1 9 320x200 16 PCjr 1 AH 640x200 1 PCjr 1 BH Reserved for future use CH Reserved for future use DH 320x200 16 EGA,VGA 8 EH 640x200 16 EGA,VGA 4 FH 640x350 Mono EGA,VGA 2 10H 640x350 16 EGA,VGA 2 11H 640x480 2 VGA 1 12H 640x480 16 VGA 1 13H 320x200 256 VGA 1 -------------------------------------------------------------- INT 10H Service 1 Set Cursor Type Input AH=1 CH=Cursor Start Line CL=Cursor End Line OutPut New Cursor ASM Example: Mov Ah,1 ; Interrupt Service 1 Mov CH,3 ; This creates a flashing block cursor Mov CL,1 ; Like the one you see when you press the INSERT key Int 10H ; Call DOS Interrupt 10H INT 10H Service 2 Set Cursor Position Input DH,DL = Row, Column BH = Page Number AH = 2 OutPut Cursor position changed ASM Example: Mov Ah,2 ; Interrupt Service 2 Mov DH,0 ; Row = 0 Mov DL,0 ; Column = 0 Int 10H ; Call DOS Interrupt 10H INT 10H Service 3 Find Cursor Position Input BH = Page Number AH = 3 OutPut DH,DL = Row,Column of Cursor CH,CL = Cursor Mode currently Set. INT 10H Service 4 Read Light Pen Position Input AH = 4 OutPut AH = 0 Light Pen Switch Not Down AL = 1 DH,Dl = Row, Column of Light Pen Position CH Raster Line (Vertical) 0-199 BX Pixel Column (Horizontal) 0-319,639 INT 10H Service 5 Set Active Display Page Input AL = 0-7 (Screen modes 0,1) 0-3 (Screen modes 2,3) AH = 5 OutPut Active Page Changed INT 10H Service 6 Scroll Active Page Up Input AL = #lines blacnked at bottom (0=Blank whole area) CH,CL = Upper Left Row, Column of area to scroll. DH,DL = Lower Right Row, Column of area to scroll. BH = Attribute used on blank line. AH = 6 INT 10H Service 7 Scroll Active Page Down Input AL = #lines blacnked at bottom (0=Blank whole area) CH,CL = Upper Left Row, Column of area to scroll. DH,DL = Lower Right Row, Column of area to scroll. BH = Attribute used on blank line. AH = 7 INT 10H Service 8 Read Attribute and Character at Cursor Position Input BH = Page Number AH = 8 OutPut AL = Character read (ASCII) BH = Attribute of character (Alphanumerics only). INT 10H Service 9 Write Attribute and Character at Cursor Position Input BH = Page Number BL -> Alpha Modes = Attribute; Graphics Mode = Color CX = Count of characters to write AL = IBM ASCII code AH = 9 OutPut Character written on screen at Cursor Position INT 10H Service A Write Character ONLY at Cursor Position Input BH = Page Number CX = Count of characters to write AL = IBM ASCII code AH = 0AH OutPut Character written on screen at Cursor Position INT 10H Service B Set Color Palette Input BH = Palette Color ID BL BH = 0 -> BL = Background Color BH = 1 -> BL = Palette Number; (0=Green/Red/Yellow); (1=Cyan/Magenta/White) AH = 11 INT 10H Service C Write Dot Input DX = Row Number(0-199) [0,0] is upper left. CX = Column Number(0-319,639) AL = Color Value (0-3) AH = 12 NOTE: If bit 7 of AL is 1, the color value is XORed with the current value of the dot. INT 10H Service D Read Dor Input DX = Row Number(0-199) CX = Column Number(0-319,639) AH = 13 OutPut AL = Color Value (0-3) INT 10H Service E Teletype Write to Active Page Input AL = IBM ASCII Code BL = Foreground Color (Graphics Mode) AH = 14 INT 10H Service FH Return Video State Input AH = 15 OutPut AH = Number of alphanumeric columns on screen AL = Current mode BH = Active display page INT 10H Service 10H Set Palette Registers Default Palette Colors (0-15) on EGA 0 = Black 1 = Blue : 14 = Yellow 15 = Intense White INT 10H Service 10H Function 0 Set Individual Palette Register Input AH = 10H AL = 0 BL = Palette register to set (0-15) BH = Value to set (0-63) INT 10H Service 10H Function 1 - Set Overscan (Border) Register Input AH = 10H BH = Value to set (0-63) INT 10H Servie 10H Function 2 - Set All Palette Registers Input AH = 10H AL = 2 ES:BX = Address of a 17-byte table holding color selections (0-63) Byes 0-15 hold color selections of rpalette registers 0-15 Byte 16 holds the new overscan (border) color INT 10H Service 10H Function 7 - Read Individual Palette Register Input AH = 10H AL = 7 BL = Register to read (color value) OutPut BH = Register setting. INT 10H Service 10H Function 8 - Read Overscan (Border) Register Input AH = 10H AL = 8 OutPut BH = overscan setting. INT 10H Service 10H Function 10H - Set DAC Register Input AH = 10H AL = 10H BX = Register to set (0-255) CH = Green Intensity CL = Blue Intensity DH = Read Intensity INT 10H Service 10H Function 12H - Set DAC Registers Input AH = 10H AL = 12H BX = First register to set (0-255) CX = Number of registers to set (1-256) ES:DX = Address of a table of color intensities. Three bytes are used for each DAC Register (use only lower 6 bits of each byte). Table is set up: red, green, blue, red, green, blue... INT 10H Service 10H Function 13H - Select Color Page Mode Input AH = 10H Al = 13H BL = 0 Select Color Paging Mode BH = 0 Selects 4 DAC register pages of 64 registers each BH = 1 Selects 16 DAC register pages of 16 registers each BL = 1 Select Active Color Page For use with 4 page mode: BH = 0 Selects the first block of 64 DAC registers BH = 1 Selects the second block of 64 DAC registers BH = 2 Selects the third block of 64 DAC registers BH = 3 Selects the fourth block of 64 DAC registers For use with 16 page setting: BH = 0 Selects the first block of 16 DAC registers BH = 1 Selects the second block of 16 DAC registers : : BH = 15 Selects the 15th block of 16 DAC registers BH = 16 Selects the 16th block of 16 DAC registers INT 10H Service 11H - Character Generator INT 10H Service 12H - Alternate Select Input AH = 12H BL = 30H AL = 0 -> 200 Screen scan lines = 1 350 Screen scan lines = 2 400 Screen scan lines