Programmering - Assembler - INT - INT 10 : BIOS Video services Word.gif (905 bytes) INT10.DOC
AH =
 0: set video mode
 1: set cursor shape
 2: set cursor location
 3: report cursor location, shape
 4: light pen service
 5: select active page
 6: scroll up (clear screen)
 7: scroll down
 8: read char&attrib at cursor
 9: write char&attrib
 A: write char
 B: set palette
 C: write pixel
 D: read pixel
 E: write char teletype
 F: read video mode
10: EGA/VGA BIOS
11: Character Generator
12: Alternate select
13: write text string
1A: Video combination code
1B: Get BIOS Functionality Info
1C: VGA State
4F: VESA

 
INT 10, 0 : set video mode (clear screen)
AH = 0
AL = 00: text 40*25 16 color (mono)
     01: text 40*25 16 color
     02: text 80*25 16 color (mono)
     03: text 80*25 16 color
     04: CGA 320*200 4 color
     05: CGA 320*200 4 color (m)
     06: CGA 640*200 2 color
     07: MDA monochrome text 80*25
     08: PCjr
     09: PCjr
     0A: PCjr
     0B: reserved
     0C: reserved
     0D: EGA 320*200 16 color
     0E: EGA 640*200 16 color
     0F: EGA 640*350 mono
     10: EGA 640*350 16 color
     11: VGA 640*480 16 color
     12: VGA 640*480 16 color
     13: VGA 320*200 256 color
NB: add 80h to mode to prevent screen clr
 
INT 10, 1 : set cursor shape
AH = 1
CH,CL = starting, ending scan line
      =  6, 7: default CGA cursor
      = 11,12: default EGA cursor
      = 13,14: default VGA cursor
CH = 32(20h): no cursor
 
INT 10, 2: set cursor location
AH = 2
BH = display page (normal=0)
DH,DL = row,col (0..24,0..39/79)
40:50 is updated
 
INT 10, 3: report cursor location, shape
AH = 3
BH = display page (normal = 0)
CH, CL = starting, ending scan line
DH, DL = row, column
 
INT 10, 4: light pen service
AH = 4
 
INT 10, 5: select active page
AH = 5
AL = page 0..
 
INT 10, 6: scroll up (clear screen)
AH = 6
AL = lines (=0: clear screen)
BH = attribute (=7: white on black)
CH = upper line (=0: top)
CL = left col (=0: far left)
DH = lower line (=18(24): bottom)
DL = right col (=4F(79): far right)
DX = 184F(6223)
 
INT 10, 7: scroll down
AH = 7
other registers as in 6: scroll up
 
INT 10, 8: read 'char'&attrib at cursor
AH = 8
BH = display page (0)
text & graphic! modes:
AH,AL = attr,char
 
INT 10, 9: write 'char'&attrib
AH = 9
AL = char
BH = display page (0)
BL = attribute
CX = no. of repetitions
   = 2000(7D0h) to fill 80*25 screen
cursor not moved
 
INT 10, A: write 'char'
AH = A
AL = char
BH = display page (0)
   = background pixel attrib (mode 13h)
BL = foreground pixel attrib (graphics)
CX = no. of repetitions
 
INT 10, B: set palette
AH = B
BH,BL = 0,color (0-15):
  text: screen border color
  CGA : border & background color
  (if EGA/VGA: use INT 10,10)
BH,BL = 1,palette (0-1):
  CGA 320*200: palette
  ,0: green,red,brown
  ,1: cyan,magenta,white
40:66 is updated
 
INT 10, C: write pixel
AH = C
AL = color 0..3 - bit 7 set: XOR
CX = column 0..319/639
DX = row 0..199
 
INT 10, D: read pixel
AH = D
CX = column 0..319/639
DX = row 0..199
AL = pixel color 0..3
 
INT 10, E: write 'char' teletype
AH = E
AL = char (7,8,10,13: special action)
BH = page(0)
BL = foreground color (graphic)
moves cursor
;Write command line:
      mov si,82h  ;parameters in PSP 
mess: mov al,[si] ;each char
      cmp al,0Dh  ;until CR
      jz quit
      mov bh,0    ;page 0
      mov ah,0Eh
      int 10h
      inc si      ;next char
      jmp mess
quit:
>INT 21.02: Display Character
 
INT 10, F: read video mode
AH = F AH = no.of display text columns
AL = video mode
   = 01:text 40*25 color
   = 03:text 80*25 color (standard DOS)
   = 04:CGA 320*200 4-color
   = 06:CGA 640*200 2-color
   = 10:EGA 640*350 16 color
   = 12:VGA 640*480 16 color
BH = current video page (0)

 

AH = 10: EGA/VGA BIOS  
AL = 0: Set Palette Register
BL = Palette register 0..15
BH = Palette register value 0..63 : rgbRGB
   = 0 00 000000 black
   = 1 01 000001 blue
   = 2 02 000010 green
   = 3 03 000011 cyan
   = 4 04 000100 red
   = 5 05 000101 magenta
   =14 20 010100 brown
   = 7 07 000111 white
   =56 38 111000 dark gray
   =57 39 111001 light blue
   =58 3A 111010 light green
   =59 3B 111011 light cyan
   =60 3C 111100 light red
   =61 3D 111101 light magenta
   =62 3E 111110 yellow
   =63 3F 111111 bright white
 
AL = 1: Set Border Register
BH = border color 0..63
 
AL = 2: Set Palette and Border Registers
ES:DX -> 17 byte table of values:
   0-15: values (0..63) for registers
   16  : value (0..63) for border
 
AL = 3: Select Blink or Background
BL = 0: no blink, 16 background colors
   = 1: blink, 8 background colors
 
AL = 7: Read Palette Register
BL = palette register no. 0..15
BH = palette register value 0..63
AL = 8: Read Border Register BH = border color 0..63
AL = 9: Read Palette and Border Registers ES:DX -> 17 byte table of values
AL = 10h: Set DAC register color
BX = register 0..255
DH = 6 bit red value
CH = 6 bit green value
CL = 6 bit blue value
 
AL = 12: Set Multiple DAC colors
BX = first register 0..255
CX = no. of registers 1..256
ES:DX -> table of RGB values (6 bit)
   3 bytes for each register: r,g,b,
 
AL = 13: Set DAC Page Mode
BL,BH = 0,0: 4 pages, 64 registers
      = 0,1: 16 pages, 16 registers
      = 1,page (0..3/0..15)
 
AL = 15: Read DAC Color
BX = register
DH = 6 bit red value
CH = 6 bit green value
CL = 6 bit blue value
AL = 17: Read Multiple DAC colors
BX = initial register
CX = no. of registers
ES:DX -> table for values
ES:DX table filled with values
AL = 1A: Get DAC Page Configuration BH = current page
BL = current mode
   = 0: 4 pages, 64 registers
   = 1: 16 pages, 16 registers
AL = 1B: Convert DAC colors to greys
BX = initial register
CX = no. of registers
 

 

AH=11: Character generator:  
AL = 0: Load Custom Text Character set
BH = bytes/character
BL = table (0..7)
CX = no. of chars
DX = ASCII code of initial char
ES:BP -> table of bit patterns
 
AL = 1: Load 8*14 Text Character Set
BL = table
 
AL = 2: Load 8*8 Text Character Set
BL = table
 
AL = 3: Select Loaded Text Character Set
BL = table
 
AL = 4: Load 8*16 Text Character Set
BL = table
 
AL = 10: Load Custom Text Character Set
and adjust Height

BH = bytes/character
BL = table (0..7)
CX = no. of chars
DX = ASCII code of initial char
ES:BP -> table of bit patterns
 
AL = 11: Load 8*14 Text Character Set
and adjust Height

BL = table
 
AL = 12: Load 8*8 Text Character Set
and adjust Height

BL = table
 
AL =14: Load 8*16 Text Character Set
and adjust Height

BL = table
 
AL = 20: Load 8*8 Graphic Character Set
ES:BP -> table of bit patterns (hi-bit only)
 
AL = 21: Load Custom Graphic Character Set
CX = bytes/character
BL = 0: DL = no. of rows
   = 1: 14 rows
   = 2: 25 rows
   = 3: 43 rows
ES:BP -> table of bit patterns
 
AL = 22: Load 8*14 Graphic Character Set
BL = 0: DL = no. of rows
   = 1: 14 rows
   = 2: 25 rows
   = 3: 43 rows
 
AL = 23: Load 8*8 Graphic Character Set
BL = 0: DL = no. of rows
   = 1: 14 rows
   = 2: 25 rows
   = 3: 43 rows
 
AL = 24: Load 8*16 Graphic Character Set
BL = 0: DL = no. of rows
   = 1: 14 rows
   = 2: 25 rows
   = 3: 43 rows
 
AL = 30: Get Character Set Information
BH = 0: 8*8 CGA hi-bit characters (128-255)
        = INT 1F (in BIOS: C000:460A)
   = 1: Current graphics characters
        = INT 43 (in BIOS: C000:420A)
              or (in HMA : FFFF:BF32)
   = 2: 8*14 characters (in HMA)
   = 3: 8*8 characters (in HMA)
   = 4: 8*8 hi-bit characters (in BIOS)
   = 5: 9*14 characters
   = 6: 8*16 characters
   = 7: 9*16 characters
ES:BP -> table of bit patterns
CX = bytes/character (8,14,16)
DL = character rows on screen

 

AH = 12: ALTERNATE SELECT  
BL = 10: return EGA information BH = 0,1: color,mono
BL = 0,1,2,3: 64,128,192,256k EGA RAM
CH = EGA feature connector input status
CL = EGA switch settings
BL = 20: Alternate Print Screen - for rows > 25
BL = 30: Select Text Scan Line No.
AL = 0: 200 lines (CGA emulation)
   = 1: 350 lines (EGA emulation)
   = 2: 400 lines (VGA default)
 
BL = 31: Palette Loading on Mode Change
AL = 0: enable default palette loading
   = 1: disable palette loading
        - keep current values
 
BL = 32: Buffer/Port Adressing
AL = 0: enable adressing
   = 1: disable adressing
used with BL = 35: Switch Display
BL = 33: Grey Scale
AL = 0: enable grey scale
   = 1: disable grey scale
 
BL = 34: Cursor Emulation
AL = 0: enable CGA-type cursor
   = 1: disable cursor
 
BL = 35: Switch Display
AL = 0: initial adaptor off
   = 1: initial adaptor on
   = 2: turn active video off
   = 3: turn active video on
ES:DX -> 128 byte buffer
used with BL = 32: Buffer/Port Adressing
enables switching between PS/2 video adaptors
BL = 36: Refresh
AL = 0: enable refresh
   = 1: disable refresh (faster screen)
 

 

AH = 13: Write text string
AL = 0: without moving cursor
   = 1: moving cursor
   = 2: without moving cursor - c/a string
   = 3: moving cursor - c/a string
BH = page (0)
BL = attrib (AL=0,1)
CX = string length
DH,DL = row,column for cursor start
ES:BP -> string buffer
 
 
 
- c/a string: string of c/a words char,attrib,char,attrib,...
- c/a word:
hi: attrib
lo: char
AH = 1A: Video Combination Code
AL = 0: Get
BL = active display code
BH = inactive display code
   = 0: no display
     1: MDA (monochrome)
     2: CGA
     4: EGA color
     5: EGA mono
     6: PGC
     7: VGA mono
     8: VGA color
     B: MCGA mono
     C: MCGA color
     FF:unknown
AL = 1: Set
BL = active display code
BH = inactive display code
     - codes as for Get above
 
AH = 1B: Get BIOS Functionality Info
BX = 0
ES:DI -> 64 byte buffer
video mode and configuration table at ES:DI
AH = 1C: VGA State
AL = 0: get buffer size
CX = state
   = 0,1,2: DAC,BIOS,registers
BX = no. of 64-byte buffer blocks required
AL = 1: store
CX = state (as above)
ES:BX -> buffer
- use after AL = 0: get buffer size
AL = 2: restore
CX = state (as above)
ES:BX -> buffer
- use after AL = 1: store

VESA calls: Somerson, DOS5PT.729

AH = 4F: VESA  
AL = 0: Return Super VGA Information
ES:DI -> 256 byte buffer
AX = 004F if VESA-compatibel
ES:DI data at offset:
  00: "VESA"
  04: version number
  06: address of vendor ID
  0E: address of mode list
  12: amount of memory on VGA
AL = 1: Return Mode Information
CX = Super VGA mode
ES:DI -> 256 byte buffer
ES:DI data at offset:
  00: mode attributes
  02: window A attrib (readable/writeable)
  03: window B attrib
  04: window granularity
      (offset of each bank in Kb)
  06: window size
      (bank size in granularity units)
  08: address of window A
  0A: address of window B
  0C: address of window function
  10: length of one scan line in bytes
      - optional info -:
  12: horizontal resolution
  14: vertical resolution
  16: character width in pixels
  17: character height in pixels
  18: number of bit planes
  19: bits per pixel (includes planes)
  1A: banks (interleaved memory segments)
  1B: memory model
  1C: bank size (memory segment size)
  1D: number of available pages
  1E: reserved
AL = 2: Set Super VGA Mode  
AL = 3: Return Super VGA Mode  
AL = 4: Save/Restore Super VGA State  
AL = 5: Bank Switching  
AL = 6: Set/Get Logical Scan Line Length  
AL = 7: Set/Get Start of Display Memory