Text Mode
To display text of 80 x 25 or 2,000 characters takes two bytes
per character. Obviously, the one byte is holds the ASCII code. It
is followed by an attribute byte. The format for the
attribute byte is:
- Bl is foreground blink
- rgb is the red, green, and blue of the background color
- I is intensity
- rgb is the red, green, and blue of the foreground color
The colors are coded as:
000 | Black (Intense be dark grey) |
001 | Blue |
010 | Green |
011 | Cyan |
100 | Red |
101 | Magenta |
110 | Brown (Intense is yellow) |
111 | Light Gray (Intense is white) |
INT 10h BIOS calls for Text Mode
The most commonly used for our purposes are text mode 3 and graphics
mode 12h (VGA 640 x 480 pixels, 16 colors)
Set Video Mode
Input is:
ah = 00h
al = desired video mode
Set Display Page
Input is:
ah = 05h
al = display page number
Get Video Mode and Display Page at once
Input is:
ah = 0Fh
Output is:
al = current video mode
ah = chars per line
bh = display page
Display of Characters
Display Character and Attribute, NO cursor change
Input is:
ah = 09h
al = ASCII character
bl = attribute
bh = display page (0 - 3, usually 0)
cx = number of copies to display (1, probably)
Display Character using Present Attribute and Advance Cursor
Input is:
ah = 0Eh
al = ASCII character
bh = display page (0 - 3, usually 0)
Get Get Character and attribute at Cursor Position
Input is:
ah = 08h
bh = display page
Output is:
al = ASCII character
ah = attribute
Cursor Manipulations
Set Cursor Position
Input is:
ah = 02h
dh = row ( - 24)
dl = column (0 - 79)
bh = display page ( 0 3; 0 probably works)
Get Cursor Position
Input is:
ah = 0eh
bh = display page
Output is:
dh = row
dl = column
Scrolling
Scroll Window
Input is:
ah = 06h (scroll up)
or
ah = 07h (scroll down)
al = number of lines to scroll (0 to clear window)
ch = row number of upper left-hand corner ( 0 - 24 )
cl = column number of upper-left hand corner ( 0 - 79 )
dh = row number of lower right-hand corner ( 0 - 24 )
dl = column number of lower right-and corner ( 0 - 79 )
bh = attribute for cleared lines
Hardware I/O
Hardware I/O is vry simple. the 80X86 recognizes 216
or 65,536 I/O ports. The instructions are:
in | ax or al, port | ; Read a word or byte from port |
out | port, ax or al | ; Write a word or byte to port |
NOTE: There is no relationship between ports and interrupt numbers!
A device can use several ports, data ports, status ports,
and control ports
CSEE |
211 |
Current |
lectures |
news |
help