System BIOS For IBM PC - XT - AT Computers and Compatibles
System BIOS For IBM PC - XT - AT Computers and Compatibles
....
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in this book and Addison-Wesley
was aware of a trademark claim, the designations have been printed in initial capital letters.
Limitation of Liability
While every reasonable precaution has been taken in the preparation of this book, the
author and the publishers assume nO responsibility for errors or omissions, or for the uses
made of the material contained herein or the decisions based on such use. No warranties
are made, express or implied, with regard to the contents of this work, Its
merchantability, or fitness for a particular purpose. Neither the author nor the publish
ers shall be liable for direct, special, incidental, or consequential damages arising out of the
use or inability to use the contents of this book.
ISBN 0-201-51806-6 :
All rights reserved. No part of this publication may be reproduced, stored in a retrieval
recording, or otherwise, without the prior written permission of the publisher. Printed in the
ISBN: 0-201-51806-6
EFGHIJ-AL-93210
Fifth Printing, August 1990
Trademarks
AT, IBM, Personal Systems/2, PS/2, and PC/AT are registered trademarks of the Interna
tional Business Machines Corporation. PC-DOS, PC/XT, VGA, CGA, MCA, MDA, EGA,
OS/2, and Micro Channel are trademarks of the International Business Machines Corpora
tion.
Development Corp.
MS, MS-DOS, XENIX, and Microsoft are registered trademarks of Microsoft Corporation.
Dedication
To the IBM engineers and programmers who designed and coded the IBM
PC, XT, and AT BlOSs.
Table of Contents
Overview .......................................................... 1
Overview .......................................................... 27
continued
Overview ......................................................... 49
Overview ......................................................... 57
Overview ......................................................... 71
continued
INT 09h: System Reset «Ctrl> <A It> <Del» ............................ 132
INT 09h: Break «Ctrl> <Break> or <Ctrl> <Scroll Lock» .................. 133
INT 16h: AH = 03h Set Typematic Rate and Delay ....................... 143
INT 16h: AH = 12h Return Extended Shift Flags Status .................... 147
continued
continued
continued
Function: AH = 10h Test for Drive Ready ............... " .............. 349
continued
continued
continued
Once the market had been formed, though, the computer establishment
realized there was gold in those silicon hills and valleys and rushed to enter.
It was actually just what the fledgling industry needed: someone with the
marketing clout to establish a standard platform. One cannot advance tech
nology without a platform to serve as a basis for expansion and evolution
into higher forms.
Thus, the IBM PC was born, and with it the era of DOS.
BIOS: The Missing Link
I founded Phoenix in 1979 as a supplier of programmers' tools to support the
DOS standard. We were successful, but not a phenomenon until we broke
through with the PC ROM BIOS in May 1984. It proved to be the missing link
for manufacturers to build systems that were 100 percent compatible with
the IBM PC and, just as important, 100 percent legal.
Our "clean room" methodology was responsible. "Contaminated" engineers
studied the BIOS' functionality and passed on those functions to "virgin"
engineers, who had never seen the BIOS and who then wrote the code that
would accomplish specific tasks. I am proud to say the Phoenix ROM BIOS
was one of the keys that unlocked the PC market and enabled it to grow to
its present proportions.
Phoenix was your archetypal start-up. The first bus architecture that Phoenix
supported was the VW platform as it was driven from one programmer's
garage to another's basement, picking up products and orders for our initial
line of programmers' tools. Our corporate meeting room was in a basement.
I would lead visiting computer executives down a narrow stairwell to a dark
basement, where they would share an old sofa with a bunch of cats, shed
ding hairs all over their pinstriped suits. That was three office buildings ago,
and we're still growing.
Over 300 companies have licensed our ROM BIOS. Today, there are more
installed Phoenix BlOSs than IBM's, with over 14 million systems booting up
with the Phoenix name as the first item to appear on screen.
Just as the BIOS sits at the heart of the PC, where software meets hard
ware, and interfaces communications between the operating system, CPU,
and a computer's peripheral devices (monitor, printer, disk drives, etc.), so
Phoenix is positioned at the center of the PC universe, working closely with
semiconductor, hardware, and peripheral manufacturers; operating system
and independent software developers; and system integrators, ensuring
compatible designs among them all, peace of mind for purchasers and end
users, and a stable and open platform for programmers.
System BIOS for IBM PC/XT IAT Computers and Compatibles xix
PC Compatibility: The Only Game in Town
The PC standard is now entirely software-driven. It is not dependent on
IBM's hardware architecture. The goal of a standard is not IBM hardware
emulation, but a hardware-independent compatibility based on the ability to
run PC applications. It was as much to achieve compatibility with each other
as with IBM that caused most of the industry's largest manufacturers (some
of whom once shunned PC compatibility) to jump on the bandwagon.
The value of compatibility with the PC standard from the end user's view
point is that it offers investment protection, portability, and access to the
world's largest library of applications software packages. These consider
ations have made 100 percent compatibility the main customer-driven
demand in the personal computer marketplace.
In the past few years, the PC industry has seen phenomenal growth. Now
that the standard has been established, the platform is in place to launch an
even more impressive and expansive future. The goal for software develop
ers is to break away from hardware-imposed stagnation and push the PC
environment to new heights. Phoenix's biggest challenge as a company will
be to help manufacturers and software developers integrate compatibility into
new products with smart, innovative engineering.
Open Sesame
Standards advance technology. The establishment of a common platform
enables hardware and software developers to evolve more advanced tech
nologies, since they now have a target and a customer base to make it
worthwhile. The adoption of standards frees engineering resources to con
centrate on differentiating products with expanded capabilities.
Phoenix's goal has always been to support standards in the micro environ
ment. Open standards enable an industry to reap the rewards of advanced
technology by attracting the widest possible customer base and applications.
Phoenix provides a cost-effective engineering resource to solve the integra
tion challenges the PC industry faces.
We are offer.ing this series of BIOS technical references in the same spirit of
.. openness" that has characterized our research and development, from the
days of our programmers' tools through the introduction of our PC BIOS and
creation of the compatibles market.
Open systems need open communications. For personal computing to suc
ceed in society, information must be readily available to allow individuals to
exploit its capabilities. These manuals provide a complete and clear picture
of the design of the PC standard. They describe the parameters of compati
bility and how best to design a system based on the standard.
Chairman
The volumes of this series are a natural companion for anyone who owns
and programs an IBM PC, XT, AT, or PS/2, or any compatible system.
This diversity makes it difficult to precisely identify terms such as PC-, XT-,
or AT-compatible. BIOS functions that appear only in IBM AT systems can be
found in the Phoenix XT BIOS. And there are many different combinations of
BIOS functions in various XT or AT clones. Whenever possible, we provide
directions on how to find out if a particular function is supported.
Acknowledgments
First and foremost. we would like to acknowledge the vision and technical
skill of Neil Colvin. founder. Chairman of the Board and Chief Technical
Officer of Phoenix Technologies Ltd. We also acknowledge the expert guid
ance of Lance Hansche. President and CEO of Phoenix Technologies Ltd.
We especially want to acknowledge the contributions made by Jeff Bobzin.
Dave Hirschman. and Bob Vandette - the Phoenix engineers who initially
brought the BIOS to life. as well as the continuing efforts of Eric Enge. Paula
Bishop. Jeff Kleiman. Debbie Schultz. Stan Lyness. Greg Honsa. Bruce
Cairns. Ruth Brent. Jeff Wheeler. and the rest of the Phoenix staff. who keep
the BIOS alive and compatible with the widest range of PC hardware.
This volume could not have been produced without the tireless efforts of
Rich Levandov. Vice President of Marketing. and Henry Suwinsky. Project
Manager.
We would like to thank Kathy Schiff. Manager of Technical Communications.
who provided editorial guidance and direction in the production of this book
and Jeff Evangelista. who contributed two well-written chapters. And last but
not least. our special thanks goes to Sandie Zierak. Chief Production Coordi
nator. for her invaluable contributions in document design. graphics, and
production.
The Authors
Mike Boston
Paul Narushoff
Norwood, MA
May. 1989
continued
continued
continued
Overview
What is a BIOS?
A basic input output system (BIOS) is the lowest level software component
of a computer's operating system. In personal computer systems, the BIOS
usually consists of a routine designed to test system hardware and bootstrap
load the operating system and a group of device drivers that service system
liD components, such as the keyboard, the display, fixed disk drive, diskette
drives, real time clock, parallel ports, serial ports, and other components.
continued
PC ROM BIOS
The original IBM PC, a system based on the the 8/16-bit Intel 8088 micro
processor, was introduced in 1981. The IBM PC/XT, a fixed disk capable
version of the PC, was introduced in 1983. The IBM PC/AT, a 16-bit system
based on the Intel 80286 microprocessor, was introduced in 1984. Clone
manufacturers have added Intel 80386-based AT-compatible systems. The
BlOSs for all these systems are compatible, in the sense that the later AT
BlOSs support all PC and XT BIOS functions in some way.
The BIOS in all models and versions of the IBM PC/XT / AT family of personal
computers is programmed into ROM contained on the motherboard. The
video BlOSs supporting the EGA and VGA PC video adapters are an excep
tion to this rule. The EGA and VGA BlOSs are programmed into ROM con
tained on EGA and VGA adapter cards.
continued
Reference: For more information on the ABIOS. see ABIOS for IBM PS/2
Computers and Compatibles in this series.
Because of their sheer number. keeping track of PC clone model names can
be confusing. In this book, "PC" refers to the IBM Personal Computer and
compatible systems; "PC/XT" refers to the IBM Personal Computer/XT and
compatibles. and "PC/AT" refers to the IBM Personal Computer/AT and
compatibles. The terms PC BIOS. XT BIOS. and AT BIOS correspond to the
ROM BIOS contained in each of those systems and their compatibles.
Background
All IBM PC/XT/AT and compatible computer systems are based on the Intel
80x86 or compatible microprocessors. To understand the BIOS architecture,
one must consider the interrupt-driven nature of the Intel 80x86 architecture.
BIOS services that are driven by software interrupt are referred to as ROM
BIOS device service routines (DSR) , or more commonly by the name of the
device involved. The ROM BIOS Video DSR, for example, is commonly re
ferred to as the ROM BIOS Video Service. BIOS hardware driven services are
referred to as hardware interrupt service routines (ISR).
Understanding the ROM BIOS is largely a matter of understanding how the
BIOS device services fit into the Intel 80x86 scheme of interrupts.
continued
In a process called the power-on self test (POST), the portion of the ROM
BIOS responsible for testing system components and booting the operating
system writes the interrupt vector table to low memory and initializes the
vector address of all those interrupts concerned with the BIOS. When the
operating system is booted, it, in turn, initializes all those interrupt vectors
concerned with DOS. Users calling the BIOS from applications programs
must take care to initialize the vectors concerned with their own interrupts.
continued
Type Description
Software
· INTs OBh-OFh and 70h-77h are reserved by the BIOS.
Software interrupts are invoked via the assembly language "INT"
mnemonic. Most software interrupts are vectored to device
service routines (OSR) located In the ROM BIOS or in ~OS.
There are three exceptions to this rule. however.
· BIOS software INTs 1Dh, 1Eh, and 46h do not service a par
ticular device, but act instead to return various ROM-resident
hardware parameter tables.
·
INTs 20h-3Fh are reserved for ~OS.
• INTs OSh, 10h-1Ah. 1Dh-1Fh. 40h, 41h, 43h, and 46h are
reserved for the BIOS.
User User Interrupts are a special class of software interrupt. They
are invoked In the same way as software interrupts are. That is.
through the INT mnemonic.
· INTs 60h-67h and INTs F1 h-FFh are reserved for user inter
rupt routines.
continued
Most of the BIOS DSRs are capable of executing more than one device re
lated routine, or function. Individual functions within a device service are
identified by a hex number and are selected by specifying that number in the
AH register when the service is invoked. (Some ROM BIOS DSRs also contain
subfunctions. Subfunctions are usually selected via the AL or BL registers.)
In addition to function numbers, all other parameters are passed to and from
BIOS functions via the microprocessor registers. All BIOS device services
save the program counter registers, the flag register, and all other registers
except the AX register and those registers that return a value to the caller.
Reference: A complete list of the ROM BIOS DSRs, their associated inter
rupts, and functions is found under the heading Summary: The
BIOS Services in this chapter.
Example program
The assembly language program below uses INT 10h Video Service function
AH = 02h Set Cursor Position to move the cursor on video page 0 to row 3,
column 14.
Description
Aside from the interrupt vector table, a BIOS device service makes use of
other information stored in System RAM, CMOS RAM, and the BIOS itself.
The illustration below outlines the location and use of BIOS ROM, System
RAM ,and CMOS RAM. XT systems usually do not have any CMOS RAM,
however, XT systems use ROM BIOS and System RAM data.
Description
The table below identifies each interrupt by function and type. Where appli
cable, it lists the interrupt vector address initialized by the BIOS at POST.
System software may revector an interrupt at or shortly after the boot pro
cess is completed, so these values may not be the same in every system
on every occasion.
Note: The column labeled Ref. Chapter indicates the chapter to turn to for
more information on a particular interrupt.
Ref.
INT Function Type Vector Chap.
continued
continued
O,scription
The BIOS initializes unused interrupt vectors to the BIOS unexpected interrupt
handler routine. The unexpected interrupt handler processes all interrupts
that are either special user processes (INT 1Ch or INT 4Ah), or not meaning
ful to the BIOS, such as INT 72h, 73h, or 74h, which are all reserved in PC,
XT, and AT BlOSs.
continued
INT Description
Introduction
Throughout this manual, each ROM BIOS function description includes an
explanation of what the function does, the function's required inputs and
outputs, and any special programming considerations or hardware
.. gotcha' s.. associated the the function.
Legend Description
continued
Description
This function resets both the diskette controller and the specified
diskette drive (the R/W arm is moved to track 0). The diskette drive
number (either OOh or 01 h) is specified in DL.
Function failure
Call this function when a problem occurs in attempting to access the
diskette subsystem with any other function, then retry the function that
failed. The diskette subsystem will not react immediately. Instead, a
reset flag forces the BIOS to recalibrate the diskette drive's read/write
heads the next time they are used. The heads are relocated track 0 in
order to start the next I/O operation from a known state.
Input/Output
Input: AH OOh
DL = Drive number
Bit 7 = 0 for a diskette
1 for a fixed disk
Output: AH OOh No error
xxh Error (See Error codes earlier in this chapter)
= Diskette Status (40:41 h)
CF = 0 No error
= 1 Error
Introduction
Since the introduction of the IBM PC in 1981, four video adapter types have
emerged: MDA, CGA, EGA, and VGA. MDA and CGA adapters rely exclu
sively on the Video Service contained in the system board ROM BIOS of all
PC/XT/AT and compatible computers. EGA and VGA adapters contain a
dedicated ROM BIOS installed on the adapter hardware itself.
The number and sophistication of the functions supported by the video BlOSs
associated with each adapter varies. As a general rule, the more recent the
adapter, the greater the number of functions its BIOS supports.
Note: The Hercules display adapter allows for the display of 720x350 mono
chrome graphics on standard TTL monochrome monitors. However,
neither the system ROM BIOS nor the Hercules adapter itself contain a
BIOS. Applications programs that support Hercules graphics must
contain an application-specific device driver.
Legend Description
continued
Description
The Set Cursor Position function sets the cursor position (in terms of
row-by-column coordinates) for the display page indicated in BL. It
saves the position as a two-byte row-by-column table entry in the
cursor coordinates byte at 40:S0h. Rowand column coordinates are
indicated in registers DH and DL respectively.
The Set Cursor Position function applies to both text and graphics video
modes. In text modes, if the display page selected in BH is the active
display page, the on-screen cursor will move to the coordinates
indicated in registers DH and DL. In graphics modes, the cursor is invis
ible, but it is used to define a position on the screen.
Input/Output
Input: AH = 02h
Output: AX = OOh
Each BIOS service executes at least one function. When a BIOS service is
capable of executing more than one function, functions are selected by
placing the proper function number in the AH register. Subfunctions are
selected via either the AL register or the BL register.
The tables below briefly define each BIOS service and list each BIOS function
and subfunction.
Print Screen The BIOS Print Screen Service prints the contents
continued
Parameter Subfunctlon
AL = OOh Set single palette
AL = 01h Set overscan register
AL = 02h Set all palette registers and overscan
AL = 03h Toggle intensify/blinking bit
AL = 04h-06h Reserved
AL = 07h Read individual palette register
AL = 08h Read overscan register (border color)
AL = 09h Read all palette registers and
overscan register (border color)
AL = 11h Reserved
AL = 14h Reserved
AL = 16h Reserved
AL = 18h-19h Reserved
continued
continued
Parameter Subfunctlon
AL = OOh Cursor not moved
AH = 14h-19h Reserved
AH = lAh Read/Write Display Combination Code:
Parameter Subfunction
AH = lDh-FFh Reserved
continued
Memory Size
The BIOS Memory Size Service returns the amount
of available base memory (in Kilobytes). as deter
Service
mined by the POST routine.
continued
Fixed Disk
The BIOS Fixed Disk Service performs BIOS level
read, write, format, initialization, and diagnostic
Service
functions for up to two fixed disk drives.
continued
Serial
The BIOS Serial Communication Service performs
Communication
RS-232-C character 110 for IBM-compatible serial
Service
port adapters.
System
The BIOS System Services is composed of several
miscellaneous system-level subservices, all of
Services
which are invoked via the INT 15h mnemonic.
continued
Keyboard
The BIOS Keyboard Service interfaces the
operating system and application programs with
Service
the keyboard.
continued
Parallel Printer The BIOS Printer Service provides 1/0 support for
Service parallel printer ports.
Overview
Introduction
The BIOS makes use of information stored in system RAM. The table below
characterizes each of these areas.
In this chapter
This chapter presents the following information:
• Interrupt Vectors
• BIOS Data Area
• Power-On Self Test Definitions
• Data Definitions
Ref.
INT Function Type Vector Chap.
continued
Ref.
INT Function Type Vector Chap.
continued
Ref.
INT Funqtlon Type Vector Chap.
30
.
Introduction
The BIOS uses system RAM for storage of data definitions specific to the
BIOS. This data area is almost exactly the same for the PC, XT, and AT
architectures. Differences are noted.
BIOS
continued
BIOS
Location Service Description
17h INT 16h Keyboard shift flags. where:
Bit 7 = 1 Insert active
Bit 6 = 1 Caps Lock active
Bit 5 = 1 Num Lock active
Bit 4 = 1 Scroll Lock active
Bit 3 = 1 Alt pressed
Bit 2 = 1 Ctrl pressed
Bit 1 = 1 Left Shift pressed
Bit 0 = 1 Right Shift pressed
18h INT 16h Extended keyboard shift flags. where:
Bit 7 = 1 Insert pressed
Bit 6 = 1 Caps Lock pressed
Bit 5 = 1 Num Lock pressed
Bit 4 = 1 Scroll Lock pressed
Bit 3 = 1 Ctrl-Num Lock state active
Bit 2 = 1 Sys Req pressed
Bit 1 = 1 Left Alt pressed
Bit 0 = 1 Left Ctrl pressed
19h INT 16h Work area for Alt key and numeric keypad input
1Ah INT 16h Pointer to next character In keyboard buffer
1Ch INT 16h Pointer to first available spot In keyboard buffer
1Eh INT 16h Keyboard buffer of 16 word entries
3Eh INT 13h Diskette drive recallbrate status. where:
Bit 7 = 1 Diskette hardware Interrupt has
occurred
Bits 6-4 = Not used
Bits 3-2 = Reserved
Bit 1 = 1 Recallbrate drive 1
Bit 0 = 1 Recallbrate drive 0
3Fh INT 13h Diskette drive motor status. where:
Bit 7 = 1 Current operation Is a write or format
= 0 Current operation Is a read or verify
Bit 6 = Reserved
Bits 5-4 = Drive select states where:
00 = Drive 0 selected
01 = Drive 1 selected
10 = Reserved
11 = Reserved
Bit 1 = 1 Drive 1 motor Is on
Bit 0 = 1 Drive 0 motor Is on
40h INT 13h Diskette motor time-out count
continued
BIOS
Location Service Description
41h INT 13h Diskette status return code, where:
Bit 7 =1 Drive not ready
Bit 6 =1 Seek error occurred
Bit 5 =1 Diskette controller failed
Bits 4-0 =Error codes, where:
=OOh No error
=01 h Illegal function was requested
=02h Address mark not found
=03h Write protect error
=04h Sector not found
=06h Drive door was opened
=OSh DMA overrun error
=09h DMA boundary error
=OCh Media type unknown
=10h CRC failed on disk read
42h-48h INT 13h Diskette controller status bytes and command bytes
for fixed disk controller
49h INT 10h Video mode setting
4Ah INT 10h Number of columns on screen
4Ch INT 10h Current page size (video)
4Eh INT 10h Current page address (video)
50h INT 10h Cursor position on each page. Two bytes/page.
First byte of each pair is column; second byte is
row. 0,0 is upper left corner of screen.
60h INT 10h Cursor type defined as 6845 video chip-compatible
starting and ending scan lines. High byte is starting
scan line; low Is ending scan line.
62h INT 10h Current page number (video)
63h INT 10h 6845-compatlble I/O port number for current mode
(Port 03D4h or 03B4h) (video)
65h INT 10h Current mode select register
66h INT 10h Current palette value
67h-6Ah POST Pointer to reset code upon system reset for real
mode re-entry
6Bh POST Last unexpected Interrupt that occurred
6Ch INT 1Ah Timer count - number of ticks since midnight (four
bytes)
70h INT 1Ah 24 hour roll over flag
continued
BIOS
Location Service Description
71h INT 16h Ctrl-Break flag (bit 7 = 1 <CtrI><Break> pressed)
72h POST System Reset Flag (AT only). where:
1234h = Bypass memory test (also warm boot)
4321 h = Preserve memory
64h = Burn In mode
74h INT 13h Status from last fixed disk operation. where:
OOh = No error
01h = Invalid function request
02h = Address mark not found
03h = Write protect error
04h = Sector not found
OSh = Reset failed
07h = Drive parameter activity failed
OBh = DMA overrun on operation
09h = Data boundary error
OAh = Bad sector flag detected
OBh = Bad track detected
ODh = Invalid number of sectors on format
OEh = Control data address mark detected
OFh = DMA arbitration level out of range
10h = Uncorrectable ECC or CRC error
11 h = ECC corrected data error
20h = General controller failure
40h = Seek operation failed
BOh = Time-out
-
AAh = Drive not ready
BBh = Undefined error occurred
CCh =Write fault on selected drive
EOh =Status error/error register is 0
FFh =Sense operation failed
7Sh iNT 13h Number of fixed disks
76h INT 13h Fixed disk control byte
77h INT 17h Fixed disk port offset
78h INT 14h Printer time-out table (ports 0-3)
7Ch INT 16h Serial time-out table (ports 0-3)
80h INT 16h Offset to start of keyboard buffer (from
segment 40h)
82h INT 10h Offset to end of keyboard buffer (from
segment 40h)
84h INT 10h Number of rows on screen (24/2S) (VGA only)
85h INT 10h Character height (bytes/character) (VGA only)
continued
BIOS
Location Service Oescrl.ptlon
87h INT 10h Video control bits (VGA only). where:
Bit 7 = Clear RAM
Bit 6-5 = M emory on adapter as follows:
OOb = 64K
01b = 128K
10b = 192K
11b = 256K
Bit 4 = Not used
Bit 3 = 0 EGAIVGA-compatible adapter active
Bit 2 =Walt for display enable
Bit 1 = 0 Color or ECD monitor Is attached to
EGAIVGA-compatible adapter
= 1 Monochrome monitor is attached to
EGAIVGA-compatible adapter
Bit 0 = 0 Translate cursor video modes 0-3
when using ECD monitor In 350 line
mode
= 1 Inhibit cursor translation
88h INT 10h EGAIVGA switch data (VGA only). where:
Bits 7-4 = Feature connector bits 3-0. respectively
Bits 3-0= Option switches 3-0, respectively
89h INT 10h EGAIVGA control bits (VGA only), where:
Bit 7 =200 lines
Bits 6-5 = Reserved
Bit 4 =400 lines
Bit 3 =No palette load
Bit 2 =Mono Monitor
Bit 1 =Gray Scalling
Bit 0 =Reserved
8Ah INT 13h Index Into DeC table (VGA only)
8Sh INT 13h Diskette data rate Information
Bits 7-6 = L ast data rate set by controller. where:
OOb = 500 Kllobits/second (Kbs)
01b = 300 Kbs
10b = 250 Kbs
Bits 5-4 =Last diskette drive step rate selected
Bits 3-2 = D ata transfer rate at operation start.
where:
OOb = 500 Kbs
01b = 300 Kbs
10b = 250 Kbs
Bits 1-0 =Reserved
BCh INT 13h Fixed disk status register (AT only)
BDh INT 13h Fixed disk error register (AT only)
BEh INT 13h Fixed disk interrupt flag (AT only)
continued
BIOS
Location Service Description
8Fh INT 13h Diskette controller Information. where:
Bit 7 =Reserved
Bit 3 =Reserved
40:91h)
Bits 7-6 = D ata Transfer Rate. where:
OOb = 500 Kbs
01b = 300 Kbs
10b = 250 Kbs
Bit 5 =1 Double stepping required
(360K media/1.2 MB drive)
Bit 4 =1 Known media In drive
Bit 3 = Reserved
Bits 2-0 = Definitions on return to user:
111b = 720K media In 720K or 1.44 MB
drive; or 1.44 MB media in
1.44 MB drive
101b = Known 1.2 MB media In 1.2 MB
drive
100b = Known 360K media in 1.2 MB
drive
011 b = Known 360K media In 360K drive
010b = Trying 1.2 MB media in 1.2 MB
drive
001b = Trying 360K media in 1.2 MB
drive
OOOb =Trying 360K media in 360K drive
92h INT 13h Diskette device service work area. Each entry Is
first diskette device service value tried. One byte
per drive. Drive 0 at 92h. Drive 1 at 93h.
94h INT 13h Current track number for both drives. One byte
per drive. Drive 0 at 94h. drive 1 at 95h.
96h INT 16h Keyboard status byte:
Bit 7 = 1 Read 10 In progress
Bit 6 = 1 Last code was first 10
Bit 5 = 1 Forced Num Lock
Bit 4 = 1 101/102 keyboard used
Bit 3 = 1 Right Alt active
Bit 2 = 1 Right Ctrl active
Bit 1 = 1 Last code was EOh
Bit 0 = 1 Last code was E1h
continued
BIOS
Location Service
Description
97h INT 16h Keyboard LED status byte:
Bit 7 = Error flag for keyboard command
Bit 6 = LED update In progress
Bit 5 = RESEND received from keyboard
Bit 4 = ACK received from keyboard
Bit 3 = Reserved
Bit 2 = Current status of Caps Lock LED
Bit 1 = Current status of Num Lock LED
Bit 0 = Current status of Scroll Lock LED
98h INT 15h User walt flag offset address (AT only)
9Ah INT 15h User wait flag segment address (AT only)
9Ch INT 15h Least significant byte of walt count (AT only)
9Eh INT 15h Most significant byte of wait count (AT only)
AOh INT 15h Walt active flag, (AT only) where:
Bit 7 = 1 Wait time elapsed
Bits 6-1 = Reserved
Bit 0 = 1 INT 15h, AH = 86h occurred
A8h INT 10h Pointer to video parameters and overrides (In
segment:offset format) (VGA only)
BOh-B5h Reserved
B6h-B8h POST Reserved for POST (AT only)
OCOh-OCDh Reserved
CEh INT 1Ah Count of days since 1-1-80
CFh-FFh Reserved
100h INT 05h Print screen status byte
continued
OOb = 64K
01b = 128K
10b = 192K
11b = 256K
segment:offset format).
continued
40:91h)
Bits 7-6 =Data transfer rate, where:
OOb = 500 Kbs
continued
The data definitions used by INT 17h Parallel Printer Service are stored in
system RAM in segment 40h and are presented below in offset order.
Overview
Introduction
The AT BIOS uses nonvolatile CMOS RAM to store real time clock, system
configuration, system diagnostic, and other information. In general, only AT
and AT-compatible systems have CMOS RAM.
1/0 Port
Data Area Access Size Description
CMOS RAM 070h & 071h 64 bytes Located on the Motorola MC146818A Real
Data Area Time Clock CMOS chip (or its equivalent).
All implementations of the BIOS make use
of this area to store real time clock, POST,
and system configuration data.
continued
In this chapter
This chapter defines the contents of the CMOS RAM data areas. The follow
ing topics are presented:
• CMOS RAM 1/0 Ports
• Accessing CMOS RAM
• CMOS RAM Data
The BIOS accesses the CMOS RAM data areas through the following 1/0
ports.
Read/Write
Values can be written to CMOS RAM locations OOh - 09h much more quickly
using INT 1Ah functions 02h - 07h.
Values can be read from CMOS RAM locations OOh - 09h much more quickly
using INT 1Ah functions 02h - 07h.
Introduction
The BIOS uses 64 bytes of CMOS RAM located jn the Motorola MC 14681 8A
Real Time Clock CMOS chip to store real time Clock and configuration data.
The tables below present the following CMOS RAM data definitions:
• Real time clock
• Real time clock status registers
• Configuration
continued
continued
continued
Overview
Introduction
In addition to the code for the various BIOS services, the BIOS also contains
tapular data that is used to initialize devices. This data, particularly for fixed
disk and diskette parameter tables, may be different for PC, XT, and AT
systems. The differences are described in this chapter.
In this chapter
This chapter defines the contents of the ROM BIOS data areas. The following
topics arE;! presented:
• ROM A~dress Compatibility Table
• SystE;lm Configuration Data Table
• Diskette Parameter Table
• AT Fixed Disk Parameter Table
• XT Fixed Disk Parameter Table
• Bau9 Rate Initialization
Description
The BIOS maintains compatibility between PC, XT, and AT versions by pro
viding a list of jump instructions that insure that both table information and
calls to specific BIOS services are located at fixed entry points.
Address Description
continued
Address Description
FFFF5h ASCII Date ROM was built - 8 characters xx/xx/xx. (for example:
05/31/88)
FFFFEh System Model ID. where:
FCh = AT
FEh = XT
FFh = PC
Description
The System Configuration Table is located at FOOO:E6F5h. This table can be
called into RAM via INT 15h Function AH = COh Return System Configuration
Parameters.
Offset Initial
PC =OOh
PC XT =OOh
PCjr =OOh
AT =OOh
AT =01h
XT-286 =02h
PC Convertible =OOh
Unknown system board =FFh
04h 04h 1 Byte BIOS revision level (first release = OOb)
OSh OSh 1 Byte Feature Information byte, where:
Bit 7 =1 Fixed disk BIOS uses DMA channel 3
Bit 6 = 1 Second Interrupt chip present
Bit S = 1 Real time clock present
Bit 4 = 1 Keyboard intercept (INT 15h, Function
AH = 4Fh) called by keyboard Interrupt
service (INT 09h)
Bit 3 = 1 Wait for external event supported
Bit 2 = Reserved
Bit 1 =0 PC-type I/O channel implemented
Bit 0 =0 Reserved
06h 06h 1 Byte Feature Information byte 2 (reserved. zeros)
07h 07h 1 Byte Feature Information byte 3 (reserved, zeros)
08h 08h 1 Byte Feature information byte 4 (reserved, zeros)
09h 09h 1 Byte Feature information byte 5 (reserved, zeros)
Description
The diskette device service routine in PC/XT / AT systems contains a table of
parameters used to manipulate diskette drives. For many AT systems, val
ues have been modified so the table is more suited to the default 3.5-inch
1.44 MB diskette drives. The default 11-byte table is located in ROM at
FOOO:EFC7h and is pointed to by the interrupt 1Eh vector. This arrangement
allows operating systems or application programs to change the INT 1Eh
vector to point to a different set of diskette parameters.
Offset Description
continued
Offset Description
03h Bytes per sector. This field Is encoded In the following way to
match the encoding used by the diskette controller:
OOh = 128 bytes per sector
01h = 256 bytes per sector
02h = 512 bytes per sector (default value)
03h = 1024 bytes per sector
04h The number of sectors per track. For a 1.44 MB diskette In the
1.44 MB drive. this field Is 18 sectors per track. The range of
values Is:
08h = 8 sectors per track (320K drive)
09h = 9 sectors per track (360K/720K 5.25-lnch drive)
15h = 15 sectors per track (5.25-lnch 1.2 MB drive)
18h = 18 sectors per track (3. 5-inch drives)
05h Gap length. The length of the gap between sectors. 1Bh for a
3.5-inch diskette drive and 2Ah for a 5.25-inch diskette drive.
06h Data length. Since the bytes per sector field is nonzero, this field
is meaningless and Is set to FFh.
07h Gap length for format. The length of the gap between sectors to
maintain when formatting. The format gap length is 6Ch for a
3.5-inch drive and 50h for a 5.25-inch drive.
08h Fill byte for format. The default Is F6h.
09h Head settle time. The amount of time in milliseconds the diskette
DSR must wait for the heads to settle after doing a seek opera
tion. For a 3. 5-inch diskette drive, this field is OFh. 1.2MB
drives require 15 milliseconds and 360K drives. 20 - 25
milliseconds.
OAh Motor start time. The amount of time in eighths of a second that
the diskette DSR must walt for the motor to come up to speed
before doing an I/O operation. Most drives have a motor start
time of one second so the default value is 08h for most opera
tions. except Read and Verify. where the default value Is either
04h or 05h.
Description
The AT fixed disk parameter table defines the types of fixed disk drives that
can be used. As part of system configuration, the INT 41 h vector is set up
to point to the fixed disk parameters entry associated with drive O. If fixed
disk drive 1 is installed, INT 46h is initialized to point to its corresponding
entry in the AT fixed disk parameter table. To maintain compatibility, the
fixed disk parameter table is based at FOOO:E401 h.
continued
• The OEM may have to disable drive connector J1 pin 2 when used on the AT .
•• Remove jumper W3 .
••• Values for Write Precomp of -1. 0, or the last track are assumed to be equivalent.
continued
Write Landing
# Drive Type Cylinders Heads Precomp Zone Sectors
11 IBM 5.25" 35 MB 855 5 -1 855 17
Priam IDEO 40, 45. 45H
Priam ID45T-S, ID45T-Q"
12 IBM 5.25" 49 MB 855 7 -1 855 17
13 IBM 5.25" 20 MB 306 8 128 319 17
14 IBM 5.25" 42 MB 733 7 -1 733 17
15 Reserved
16 IBM 5.25" 20 MI3 612 4 0 663 17
17 IBM 5.25" 40 MB 977 5 300 977 17
18 IBM 5.25" 56 MB 977 7 -1 977 17
Priam 10 60, 62"
19 IBM 5.25" 59MB 1024 7 512 1023 17
20 IBM 5.25" 30 MB 733 5 300 732 17
21 IBM 5.25" 42 MB 733 7 300 732 17
22 IBM 5.25" 30 MB 733 5 300 733 17
23 IBM 5.25" 10 MB 306 4 0 336 17
24 Priam IDEO 62 1024 7 -1 1024 17
25 NEC 5126 20 MB 615 4 0 615 17
26 Micropolls 1323 """ 1024 4 -1 1024 17
BO.dime 5040
27 Micropolls 1323A """ 1024 5 -1 1024 17
Si;!agate ST -4077R
Miniscrlbe 3053/6053
Priam IDEO 45, 45H""
28 Micropolls 1325 """ 1024 8 -1 1024 17
Miniscribe 6085
Maxtor XT-1085 """
29 512 8 256 512 17
" The OEM may have to disable drive connector J1 pin 2 when used on the AT.
"" Remove jumper W3.
""" Values for Write Precomp of -1, 0, or the I~.st track are assumed to be equivalent.
continued
32 1020 15 -1 1024 17
33 Reserved
34 Reserved
35 Seagate ST -4096 1024 9 1024 1024 17
Seagate ST -4144
Seagate ST -4144R 26
36 Minlscrlbe MS 6053 1024 5 512 1024 17
Microscience HHl050
37 830 10 -1 830 17
38 NEC 67 MB 823 10 256 824 17
39 NEC D5126H 20 MB 615 4 128 664 17
40 IBM 5.25" 40 MB 615 8 128 664 17
NEC D5146H
41 IBM 5.25" 114 MB 917 15 -1 918 17
42 IBM 5.25" 127 MB 1023 15 -1 1024 17
Priam IDEO 130"
43 NEC 823 10 512 823 17
44 Seagate ST -251 40 MB 820 6 -1 820 17
45 Reserved
46 CDC Wren II (1) 925 9 -1 925 17
9415-5-86
47 699 7 256 700 17
48 Configurable by end user
49 Configurable by end user
• The OEM may have to disable drive connector J1 pin 2 when used on the AT .
•• Remove jumper W3 .
••• Values for Write Precomp of -1, 0, or the last track are assumed to be equivalent .
continued
Description
The XT fixed disk parameter table defines the types of fixed disk drives that
can be used in an XT system. As part of system configuration, the INT 41 h
vector is set up to point to the fixed disk parameter entry associated with
drive O. To maintain compatibility, the fixed disk parameter table is based at
FOOO:E401 h.
continued
110 0417h
150 0300h
300 0180h
600 OOCOh
1200 0060h
2400 0030h
4800 0018h
9600 OOOCh
Overview
1/0 Ports
In the PC, XT, and AT architecture, the bus can address either system
memory or 1/0. Four bytes are used for the address formation, so I/O port
addresses can range from OOOOh to FFFFh for a total of 64K locations. The
microprocessor can address as many I/O locations as it can address mem
ory locations in any given memory segment. In an AT system, addresses
OOOOh to OOFFh are reserved for the system board and addresses 0100h
03FFh are reserved for the I/O channel.
This I/O addressing capability gives the ISA architecture considerable power
in that a system is able to access I/O devices through a broad range of
addresses.
Standard I/O port protocols have been established for many common input
devices. These standard I/O port address definitions are presented in the
following pages. Where possible, we have provided exact bit definitions for
I/O ports. Note that some IBM-compatible systems use nonstandard I/O
devices or nonstandard I/O port definitions. For instance, the location of the
third and fourth serial ports, given here as 3220h and 3228h, may vary from
system to system.
Read/Wrlte
1/0 Address
Status Description
OOOOh
R/W DMA channel 0, memory address register
0001h
R/W DMA channel 0, transfer count register
0002h
R/W DMA channel 1, memory address register
0003h
R/W DMA channel 1, transfer count register
0004h
R/W DMA channel 2, memory address register
0005h
R/W DMA channel 2, transfer count register
0006h
R/W DMA channel 3, memory address register
0007h
R/W DMA channel 3, transfer count register
OOOBh
R DMA channel 0-3, status register, where:
Bit 7 =1 Channel 3 request
Bit 6 =1 Channel 2 request
Bit 5 =1 Channel 1 request
Bit 4 =1 Channel 0 request
Bit 3 =1 Terminal count on channel 3
Bit 2 =1 Terminal count on channel 2
Bit 1 =1 Terminal count on channel 1
Bit 0 =1 Terminal count on channel 0
OOOAh R/W DMA channel 0-3, mask register, where:
Bits 7-3 =0 Reserved
Bit 2 =0 Clear mask Bit
=1 Set mask Bit
Bits 1-0 =OOb Select channel 0
=01b Select channel 1
=1Ob Select channel 2
= 11 b Select channel 3
OOOBh W DMA channel 0-3, mode register, where:
Bits 7-6 =OOb Demand mode
=01b Signal mode
=10b Block mode
= 11 b Cascade mode
Bits 5-4 =0 Reserved
Bits 3-2 =OOb Verify operation
=01 b Write operation
=10b Read operation
=11 b Reserved
Bits 1-0 =OOb Select channel 0
=01 b Select channel 1
=1Ob Select channel 2
= 11 b Select channel 3
continued
Read/Write
I/O Address
Status
Description
OOOCh
W
DMA Clear Byte Pointer
OOODh
W
DMA Master Clear Byte
OOOEh
W
DMA Channel 0-3 Clear Mask Register
OOOFh
W
DMA channel 0-3. write mask register. where:
Bits 7-4 =0 Reserved
Bit 3 = 0 Unmask channel 3 mask bit
= 1 Set channel 3 mask bit
Bit 2 =0 Unmask channel 2 mask bit
= 1 Set channel 2 mask bit
Bit 1 =0 Unmask channel 1 mask bit
= 1 Set channel 1 mask bit
Bit 0 =0 Unmask channel 0 mask bit
= 1 Set channel 0 mask bit
0019h
R/W
DMA scratch register
0020h
R
Programmable Interrupt Controller (PIC). Inter
rupt requestlln-service registers programmed
by Operation Command Word 3 (OCW3):
Interrupt request register. where:
Bits 7-0 =0 No active request for the
corresponding interrupt line
= 1 Active request for the
corresponding interrupt line
Interrupt In-service register. where:
Bits 7-0 =0 The corresponding interrupt line is
not currently being serviced
= 1 The corresponding interrupt line is
currently being serviced
0020h
W
PIC. Initialization Command Word 1 (ICW1) (Bit
4 is one). where:
Bits 7-5 =0 Only used in 80/85 mode
Bit 4 = 1 Reserved
Bit 3 =0 Reserved
Bit 2 =0 Successive interrupt vectors are
separated by eight bytes
= 1 Successive interrupt vectors are
separated by four bytes
Bit 1 =0 Cascade mode
=1 Single mode - no ICW3 needed
Bit 0 =0 No ICW4 needed
= 1 ICW4 needed
continued
Read/Write
I/O Address Status Description
0021h W PIC, ICW2, ICW3, or ICW4 In sequential order
. after ICW1 written to Port 0020h
ICW2, where:
Bits 7-3 =Address lines AO-A3 of base vector
address for Interrupt controller
Bits 2-0 =0 Reserved
ICW3, where:
Bits 7-0 =0 Slave controller not attached to
corresponding Interrupt pin
=0 Slave controller attached to
corresponding Interrupt pin
ICW4, where:
Bits 7-5 =0 Reserved
Bit 4 =0 No special fully-nested mode
=1 Special fully-nested mode
Bits 3-2 =OOb Non-buffered mode
=01b Non-buffered mode
= lOb Buffered mode/slave
= 11 b Buffered mode/master
Bit 1 =0 Normal EOI
= 1 Auto EOI
Bit 0 =0 80/85 mode
= 1 8086/8088 mode
0021h R/W PIC, Interrupt mask register (OCW1), where:
Bit 7 =0 Enable parallel printer interrupt
Bit 6 =0 Enable diskette Interrupt
Bit 5 =0 Enable fixed disk interrupt
Bit 4 =0 Enable serial port 1 interrupt
Bit 3 =0 Enable serial port 2 Interrupt
Bit 2 =0 Enable video Interrupt
Bit 1 = 0 Enable keyboard interrupt
Bit 0 =0 Enable timer interrupt
continued
ReadlWrite
1/0 Address Status Description
continued
Read/Write
I/O Address
Status Description
0043h
W Programmable Interrupt Timer. control word
register for counters 0 and 2. where:
Bits 7-6 = OOb Select counter 0
= 01b Reserved
= lOb Select counter 2
Bits 5-4 = OOb Counter latch command
= 01b Read/write counter bits 0-7
only
= lOb Read/write counter bits 8-15
only
= 11 b Read/write counter bits 0-7
first. then bits 8-15
Bits 3-0 = OOOb Mode 0 select
= 001 b Mode 1 select
= Xl0b Mode 2 select
= Xllb Mode 3 select
= 100b Mode 4 select
= 101 b Mode 5 select
Bit 0 = 0 Binary counter 16 bits
= 1. Binary coded decimal counter
0044h
W Programmable Interrupt Timer. miscellaneous
register (AT only)
0047h
W Programmable Interrupt Timer. control word
register for counter 0 (AT only). where:
Bits 7-6 = OOb Select counter 0
= 01b Reserved
= lOb Reserved
= 11 b Reserved
Bits 5-4 = OOb Counter latch command
select counter 0
= 01b Read/write counter bits 0-7
only
= lOb Reserved
= 11 b Reserved
0048h-005Fh
R/W Used by Programmable Interrupt Timer
0060h
W Keyboard data Input buffer (AT only)
0060h
R Keyboard data output buffer (AT only)
0061h
8042 control register (AT only), where:
R/W
Bit 7 = 1 Parity check
Bit 6 = 1 Channel check
Bit 5 = 1 Timer 2 output
Bit 4 = 1 Toggle with each refresh request
Bit 3 = 0 Channel check enabled
Bit 2 = 0 Parity check enabled
Bit 1 = 1 Speaker data enabled
Bit 0 = 1 Timer 2 gate to speaker enabled
continued
Read/Write
continued
Read/Write
I/O Address
Status
Description
0064h
W
8042 keyboard Input buffer (AT only)
0064h
R
8042 Status (AT only), where:
Bit 7 = 1 Parity error
Bit 6 = 1 General time out
Bit 5 = 1 Auxiliary output buffer full
Bit 4 = 1 Inhibit switch
Bit 3 = 1 Command/data
Bit 2 =System flag
Bit 1 = 1 Input buffer full
Bit 0 = 1 Output buffer full
0065h-006Fh
Reserved for use by 8255 (XT) or 8042 (AT)
0070h
W
CMOS RAM address register port (AT only) ,
where:
Bit 7 = 1 NMI disable
Bits 6-0 = 0 CMOS RAM address
0071h
R/W
CMOS RAM data register port (AT only)
0080h
R
Manufacturing test port (AT only)
0081h
R/W
DMA channel 2. page table address register
0082h
R/W
DMA channel 3. page table address register
0083h
R/W
DMA channel 1. page table address register
0087h
R/W
DMA channel O. page table address register
0089h
R/W
DMA channel 6, page table address register
008Ah
R/W
DMA channel 7. page table address register
008Bh
R/W
DMA channel 5, page table address register
008Fh
R/W
DMA channel 4. cascade to Channels 5-7
0093h-009Fh
Reserved for DMA Controller
OOAOh
R/W NMI mask register (XT)
OOAOh
R/W Programmable Interrupt Controller 2
00A1h
R/W Programmable Interrupt Controller 2 mask
(AT only) , where:
Bit 7 = 0 Reserved
Bit 6 =0 Enable fixed disk Interrupt
Bit 5 =0 Enable coprocessor exception
interrupt
Bit 4 = 0 Enable mouse interrupt
Bit 3 =0 Reserved
Bit 2 = 0 Reserved
Bit 1 = 0 Enable redirect cascade
Bit 0 = 0 Enable real time clock interrupt
continued
Read/Write
I/O Address Status Description
OOCOh R/W DMA channel 0 (AT only). memory address
register
00C2h R/W DMA channel 0 (AT only). transfer count
register
00C4h R/W DMA channell .(AT only). memory address
register
OOC6h R/W DMA channell (AT only). transfer count
register
00C8h R/W DMA channel 2 (AT only). memory address
register
OOCAh R/W DMA channel 2 (AT only). transfer count
register
OOCCh R/W DMA channel 3 (AT only). memory address
register
OOCEh R/W DMA channel 3 (AT only). transfer address
register
OODOh R DMA status register (AT only). where:
Bit 7 =1 Channel 7 request
Bit 6 =1 Channel 6 request
Bit 5 = 1 Channel 5 request
Bit 4 = 1 Channel 4 request
Bit 3 =1 Terminal count on channel 7
Bit 2 =1 Terminal count on channel 6
Bit 1 =1 Terminal count on channel 5
Bit 0 = 1 Terminal count on channel 4
00D2h W
DMA Write request register (AT only)
00D4h R/W
DMA mask register (AT only). where:
Bits 7-3 = 0 Reserved
Bit 2 =0 Clear mask bit
= 1 Set mask bit
Bits 1-0 = OOb Select channel 4
=01 b Select channel 5
= lOb Select channel 6
= 11 b Select channel 7
continued
Read/Write
I/O Address Status
Description
00D6h R/W
DMA Mode Register (AT only). where:
Bits 7-6 =OOb Demand mode
=01b Single mode
= lOb Block mode
=11 b Cascade mode
Bit 5 =0 Reserved
Bit 4 =0 Reserved
Bits 3-2 =OOb Verify operation
=01b Write operation
= lOb Read operation
=11 b Reserved
Bits 1-0 =OOb Select channel 4
=01 b Select channel 5
= lOb Select channel 6
=11 b Select channel 7
00D8h W DMA Clear Byte Pointer (AT only)
OODAh W DMA Master Clear (AT only)
OODCh W DMA Clear Mask Register (AT only)
OODEh W DMA Write Mask Register (AT only). where:
Bits 7-4 =0 Reserved
Bit 3 =0 Unmask channel 7 mask bit
= 1 Set channel 7 mask bit
Bit 2 =0 Unmask channel 6 mask bit
= 1 Set channel 6 mask bit
Bit 1 =0 Unmask channel 5 mask bit
=1 Set channel.5 mask bit
Bit 0 =0 Unmask channel 4 mask bit
=1 Set channel 4 mask bit
OODF-OOEFh
Reserved
OOFO-OOFFh
R/W Math Coprocessor
0100-0l6Fh
Reserved
0170h
R/W Fixed disk 1 data register (AT only)
017lh
R/W Fixed disk 1 error register (AT only)
0172h
R/W Fixed disk 1 sector count (AT only)
0173h
R/W Fixed disk 1 sector number (AT only)
0174h
R/W Fixed disk 1 cylinder low (AT only)
0175h
R/W Fixed disk 1 cylinder high (AT only)
0176h
R/W Fixed disk 1 drive/head register (AT only)
0177h
R/W Fixed disk 1 status register (AT only)
continued
Read/Write
I/O Address
Status Description
01FOh
R/W Fixed disk 0 data register (AT only)
01F1h
R/W Fixed disk 0 error register (AT only)
01F2h
R/W Fixed disk 0 sector count (AT only)
01F3h
R/W Fixed disk 0 sector number (AT only)
01F4h
R/W Fixed disk 0 cylinder low (AT only)
01F5h
R/W Fixed disk 0 cylinder high (AT only)
01F6h
R/W Fixed disk 0 drive/head register (AT only)
01F7h
R/W Fixed disk 0 status register (AT only)
01F9-01FFh
R/W Reserved
0200-020Fh
Game control port
0201h
R/W Game port I/O data
0210-0217h
R/W Expansion Unit (PC and XT only)
0278h
R/W Parallel 3, data port (AT only)
0279h
R/W Parallel 3, status port, (AT only), where:
Bit 7 = 0 Busy
Bit 6 = 0 Acknowledge
Bit 5 = lOut of paper
Bit 4 = 1 Printer Is selected
Bit 3 = 0 Error
Bit 2 = 0 IRQ has occurred
Bits 1-0 = Reserved
027Ah
R/W Parallel 3, control port (AT only), where:
Bits 7-5 = Reserved
Bit 4 = 1 Enable IRQ
Bit 3 = 1 Select printer
Bit 2 = 0 Initialize printer
Bit 1 = 1 Automatic line feed
Bit 0 = 1 Strobe
02BO-02DFh
Reserved
02EOh
EGAIVGA (alternate)
02E1h
GPIB (Adapter 0)
02E2h
Data Acquisition (Adapter 0)
02E3h
Data Acquisition (Adapter 0)
02E4-02F7h
Reserved
continued
Read/Write
I/O Address Status
Description
02F8h W
Serial 2. transmitter holding register. which
contains the character to be sent. Bit O. the
least significant bit. is sent first.
Bits 7-0 = Contains data bits 7-0.
respectively. when Divisor Latch
Access Bit (DLAB) = 0
02F8h R
Serial 2. receiver buffer register. which
contains the received character. Bit O. the
least significant bit. Is sent first.
Bits 7-0 = Contains data bits 7-0. respectively.
when DLAB = 0
02F8h R/W
Serial 2. divisor latch. low byte. where:
02F9h R/W
Serial 2. divisor latch. high byte. where:
02F9h R/W
Serial 2. Interrupt enable register. Allows the
enable
Bit 1 =1 Transmitter holding register
empty interrupt enable
Bit 0 =1 Received data available interrupt
enable when DLAB = 0
02FAh R
Serial 2 InterruptlD register. Information about
a pending interrupt is stored here. When ID
register is addressed. the highest priority
interrupt is held and no other interrupts are
acknowledged until the CPU services that
interrupt.
Bits 7-3 =0 Reserved
Bits 2-1 = These bits identify the pending
interrupt with the highest priority:
11 b Receiver Line Status Interrupt;
priority = highest.
10b Received Data Available; priority
= second
01 b Transmitter holding register;
priority = third.
OOb Modem status interrupt; priority
=fourth.
Bit 0 =0 Interrupt pending. and contents of
register can be used as a pointer
to the appropriate interrupt service
routine.
=1 No interrupt pending.
continued
Read/Write
I/O Address Status Description
02FBh R/W Serial 2, Line Control Register, where:
Bit 7 =0 Receiver Buffer, Transmitter
Holding, or Interrupt Enable
Registers Access
= 1 Divisor Latch Access
Bit 6 =1 Set Break Enabled. Serial output
Is forced to spacing state and
remains there.
Bit 5 =Stick Parity
Bit 4 = Even Parity Select
Bit 3 = Parity Enable
= 1 Even number of ones are sent and
checked in the data word bits and
parity bit.
=0 Odd number of ones are sent and
checked.
Bit 2 =Number of stop bits per character:
=01 Stop bit
= 1 0 Stop bits
Bits 1-0 = S pecify the number of bits per
character:
DDb 5 bit word length
01 b 6 bit word length
1Db 7 bit word length
11 b 8 bit word length
02FCh R/W Serial 2, Modem Control Register. where:
Bits 7-5 = 0 Reserved
Bit 4 = 1 Loopback Mode for diagnostic
testing of serial port. Output of
Transmitter Shift register Is
looped back to Receiver Shift
register Input. When in this
mode, transmitted data is
received immediately so that the
CPU can verify the transmit data/
receive data serial port paths.
Bit 3 = 1 Enable OUT2 Interrupt
Bit 2 =1 Force OUT1 Active
Bit 1 = 1 Force Request To Send Active
Bit 0 =1 Force Data Terminal Ready
Active
continued
Read/Write
I/O Address Status
Description
02FDh R
Serial 2, line status register, where:
Bit 7 = 0 Reserved
Bit 6 = 1 Transmitter Shift and Holding
Registers Empty
Bit 5 = 1 Transmitter Holding Register Emp
ty. The controller is ready to ac
cept a new character to send.
Bit 4 = 1 Break Interrupt. The received data
Input Is held in the zero bit state
longer than the time of start bit +
data bits + parity bit + stop bits.
Bit 3 = 1 Framing Error. The stop bit that
follows the last parity or data bit is
a zero bit.
Bit 2 = 1 Parity error. Character has wrong
even or odd parity.
Bit 1 = 1 Overrun Error. A character was
sent to the receiver buffer before
the previous character in the buffer
could be read. This destroys the
previous character.
Bit 0 = 1 Data Ready. A complete Incoming
character has been received and
sent to the receiver buffer register.
02FEh R Serial 2, modem status register, where:
Bit 7 = 1 Data carrier detect
Bit 6 = 1 Ring indicator
Bit 5 = 1 Data set ready
Bit 4 = 1 Clear to send
Bit 3 = 1 Delta to carrier detect
Bit 2 = 1 Trailing edge ring indicator
Bit 1 = 1 Delta data set ready
Bit 0 = 1 Delta clear to send
02FFh R/W Serial 2, Reserved
0300-031Fh R/W
Prototype card
0320h R/W
Fixed Disk Adapter Register (8 or 16 bit)
0322h W Fixed Disk Adapter Control Register, where:
Bit 7 = 1 Reset
= 0 8-bit mode
Bits 4-3 = 0 Reserved
Bit 2 = 1 16-bit mode (must match bit 5)
= 0 8-bit mode
Bit 1 = 1 Enable interrupt through
(hardware Interrupt)
= 0 PIO mode
continued
Read/Write
I/O Address Status
Description
0322h R
Fixed Disk Adapter Status Register, where:
Bits 7-6 =0 Reserved
Bit 5 =1 16-blt mode
=0 8-blt mode
Bit 4 =1 Data transfer requested by adapter
Bit 3 =1 Direction Is adapter to system
= 0 Direction Is system to adapter
Bit 2 = 1 Busy
Bit 1 = 1 Interrupt request (notification)
Bit 0 = 1 Transfer In progress
0324h W Fixed Disk Adapter Attention Register, where:
Bit 7 = 1 Command Control Block
Bit 6 = 1 Command Specify Block
Bit 5 = 1 Sense Summary Block
Bit 4 = 1 Data transfer requested by system
Bit 3 =0 Reserved
Bit 2 =0 Drive 0 select
= 1 drive 1 select
Bit 1 =0 Reserved
Bit 0 =1 Abort current command
0324h R Fixed Disk Adapter Interrupt Status Register
where:
Bit 7 =1 Termination error, bits 0-6
indicate what the error is
Bit 6 = 1 Invalid command
Bit 5 = 1 Command reject
Bits 4-3 = 0 Reserved
Bit 2 = 0 Drive 0 selected
= 1 Drive 1 selected
Bit 1 = 1 Error recovery procedure invoked
Bit 0 = 1 Equipment check
0325h-0347h Reserved
0348h-0357h DCA 3278
0360h-36Fh W PC Network (PC and XT only)
0372h R Diskette controller digital output register, where:
Bits 7-6 =0 Reserved
Bit 5 =1 Enable drive motor 1
Bit 4 =1 Enable drive motor 0
Bit 3 =0 Allow Interrupts
Bit 2 =0 Controller reset
Bit 1 =0 Reserved
Bit 0 = 0 Select drive 0
= 1 Select drive 1
continued
Read/Write
I/O Address Status
Description
0374h R
Diskette controller status register, where:
continued
Read/Write
I/O Address Status
Description
03BAh* R
VGA input status register 1
03BAh* W
EGA. VGA feature controi register
03BCh R/W
Parallel 1. data port
03BDh R/W
Parallel 1. status port. where:
Bit 7 = 0 Busy
Bit 6 = 0 Acknowledge
Bit 5 = 1 Out of paper
Bit 4 = 1 Printer is selected
Bit 3 = 0 Error
Bit 2 = 0 IRQ has occurred
Bits 1-0 = Reserved
03BEh R/W
Parallel 1. control port. where:
Bits 7...,5 = Reserved
Bit 4 = 1 Enable IRQ
Bit 3 = 1 Select printer
Bit 2 = 0 Initialize printer
Bit 1 = 1 Automatic line feed
Bit 0 = 1 Strobe
03BFh* R/W
Hercules configuration switch register. where:
Bits 7-2 = Unused
Bit 1 = 0 Disables upper 32K of graphics
mode buffer
= 1 Enables upper 32K of graphics
mode buffer at B800: OOOOh
Bit 0 = 0 Prevents graphics mode
= 1 Allows graphics mode
03COh* R/W
VGA attribute controller index register
03COh* W
Other video attribute controller registers
03C1h* R/W
Other video attribute controller registers
03C2h* W
EGA. VGA. CGA miscellaneous output register
03C2h* R
EGA. VGA. CGA input status register 0
03C3h* R/W
Video subsystem enable
03C4h* R/W
CGA. EGA. VGA sequencer index register
03C5h* R/W
Other CGA. EGA, VGA sequencer registers
03C6h* R
VGA video DAC state register
03C6h* R/W
VGA video DAC PEL mask
03C7h* R
VGA video DAC state register
03C8h* W
VGA video DAC PEL address, read mode
* For more information on video i/O ports, refer to the Video 1/0 Port List at the
end of this chapter.
continued
Read/Write
110 Address Status Description
continued
ReadlWrlte
continued
Read/Write
I/O Address Status Description
continued
ReadlWrite
1/0 Address Status Description
= 0 1 Stop bit
= 1 0 Stop bits
continued
Read/Write
I/O Address Status Description
continued
Read/Write
Introduction
The following pages contain tables that describe ail the video I/O ports for
each video adapter: MDA, CGA, EGA, and VGA. Because of the complexity
of the way the video I/O ports are mapped, they are listed separately from
the rest of the hardware I/O ports.
1/0
Address Read/Wrlte Index Description
continued
continued
GENERAL REGISTERS
03C2h
W - Miscellaneous Output
03C2h
R - Input Status 0
3?2h*
R - Input Status 1
03?Ah/3?Ah*
W - Feature Control
SEQUENCER REGISTERS
03C4h R/W - Sequencer Index Register
03C5h W OOh Reset
03C5h W 01h Clocking Mode
03C5h W 02h Map Mask
03C5h W 03h Character Map Select
03CCh W 04h Memory Mode
CRT CONTROLLER REGISTERS
3?4h/3?4h* R/W - CRTC Index Register
3?5h/3?5h* W 01h Horizontal Total
3?5h/3?5h* W 02h Horizontal Display Enable End
3?5h/3?5h* W 03h Start Horizontal Blanking
3?5h/3?5h* W 04h End Horizontal Blanking
• The value of ? depends on the value of bit 0 In the Miscellaneous Output Register
? = B in Monochrome Emulation Modes
? = D in Color Emulation Modes
continued
* The value of ? depends on the value of bit 0 in the Miscellaneous Output Register
continued
continued
GENERAL REGISTERS
03CCh R - Miscellaneous Output
03C2h W - Miscellaneous Output
03C2h R - Input Status 0
3?Ah* R - Input Status 1
03CAh R - Feature Control
03?Ah/3?Ah* W - Feature Control
03C3h R/W - VGA Enable
03C7h R - DAC State
SEQUENCER REGISTERS
03C4h R/W - Sequencer Index Register
03C5h R/W OOh Reset
03C5h R/W 01h Clocking Mode
03C5h R/W 02h Map Mask
03C5h R/W 03h Character Map Select
03C5h R/W 04h Memory Mode
• The value of ? depends on the value of bit 0 in the Miscellaneous Output Register
? = 03BAh in Monochrome Emulation Modes
? = 03DAh in Color Emulation Modes
continued
continued
continued
• Applications should not write to this register. Unpredictable results will occur.
Overview
Introduction
Before a computer system can be used, all system components must be
tested and initialized, and the operating system must be bootstrapped into
memory. The process of system test and initialization is generally under the
control of the ROM BIOS. It is commonly referred to by the acronym POST,
for power-on self test and initialization procedure.
continued
Apply power to system Jump to entry point indicated by the processor reset vector
(I. e. turn system on.) (F:OOOOh). All POST tests and initializations are executed.
POST invokes BIOS INT 19h, Bootstrap Loader.
Reset system via Jump to entry point Indicated by the processor reset vec
optional hardware reset tor. All POST tests and initializations are executed. POST
button. invokes BIOS INT 19h, Operating System Bootstrap Loader.
Press <Ctri> <Alt> <Del> INT 09h keyboard hardware Interrupt service routine trans
(warm boot) fers control to BIOS POST. The POST test and Initialization
of memory above 64K Is not executed. All other POST
tests and initiallzatlons are executed. POST Invokes BIOS
INT 19h, Bootstrap Loader.
In this chapter
This chapter presents the following information:
• POST Procedures
• Rules for Positioning liD Expansion ROM
• Re-Entering Real Mode (80286-based systems only)
• INT 19h, INT 18h, and System Boot
• POST Error Handling in AT Systems
• POST Error Handling in XT Systems
Introduction
The initialization and self test functions of the POST process are tightly inter
woven. The functions can be generally thought of, however, as falling into
two categories:
• Functions related to the central system hardware
• Functions related to configuration and nonsystem board hardware
continued
POST tests and initializes the following configuration and nonsystem board
components in the order listed below:
• CMOS RAM configuration data,
• the CRT controllers,
• RAM memory above 64K,
• the keyboard,
• diskette drive A availability,
• the serial interface circuitry,
• the diskette controller,
• the fixed disk controller , and
• any additional hardware.
If an error occurs
A failure in the nonsystem hardware POST test generally results in a screen
message. Both IBM and Phoenix AT BIOS messages are listed in Appendix A.
XT BIOS messages are listed in Appendix B.
Introduction
An 110 expansion ROM is an optional extension of the BIOS which is inserted
into the machine environment as part of an added 1/0 subsystem. 1/0 ROMs
often replace part of the BIOS for a certain function (e.g .• ESDI fixed disk
BIOS. VGA video adapter).
1/0 expansion ROMs are detected by POST and are given an opportunity to
initialize themselves and their hardware environment.
continued
I 0 55h
1 AAh
2 ROM length In 512-byte blocks
3 Entry point for ROM Initialization (via FAR CALL)
Note: POST calculates the checksum of the area indicated by 1/0 ROM Byte
2. If the checksum is zero, POST will call the expansion ROM initializa
tion code. which must begin at Byte 3.
CMOS RAM
Introduction
Once the POST test and initialization procedures have been completed, POST
boots the system by issuing an INT 19h.
a diskette drive is a bootable diskette Is In . INT 19h reads the diskette boot
configured place sector and places Its contents at
address 0000: 7COOh
a fixed disk Is there Is no bootable dlsk- INT 19h reads the fixed disk boot
configured ette In the diskette drive sector and places Its contents at
address 000O,:7COOh
no boot sector Is found no boot sector Is found on INT 19h Issues INT 18h. INT 18h
on the diskette the fixed disk displays the message: • NO
BOOT DEVICE AVAILABLE"
The PC BIOS initializes INT 18h to point to ROM Resident BASIC. However, in
an XT BIOS, INT 18 points to a routine that displays a message indicating
that there is no boot device available, and that the boot process has failed.
By default. the AT BIOS initializes INT 18h to point to a routine that displays
the message NO BOOT DEVICE AVAILABLE, and transfers control to INT 18h
if the INT 19h process fails.
Introduction
For AT and AT-compatible systems. POST reports test or initialization failures
in one of the following ways:
• Beep codes (only Phoenix BIOS products)
• System failure messages
• Boot failure messages
• Informational messages
Reference
See Appendix A for a list of messages that can be generated by an AT
BIOS. Separate lists are provided of Phoenix and IBM AT BIOS messages.
See Appendix B for a list of messages that can be generated by an XT
BIOS. Separate lists are provided of Phoenix and IBM XT BIOS messages.
Introduction
For XT and XT-compatible systems. POST reports test or initialization failures
in one of the following ways:
• Beep code
• System failure messages
• Boot failure messages
• Informational messages
Reference
See Appendix B for a more complete list of all messages that can be gener
ated by a BIOS in an XT or XT-compatible system.
Overview
Description
When the system hardware activates the Nonmaskable Interrupt (NMI) pin on
the microprocessor, the BIOS INT 02h Nonmaskable Interrupt Service ISR is
invoked. A nonmaskable interrupt is a hardware interrupt that cannot be
masked. An NMI indicates a serious condition that usually cannot be shut off
or diSabled by any process. The microprocessor does not generate an inter
rupt acknowledge cycle when it receives an NMI (as it usually does when it
receives an interrupt), since the NMI is handled by a software ISR.
If an NMI is received while a previous NMI is being serviced, the second NMI
is not serviced until the first has completed.
Disabling NMls
In AT systems, NMls can be disabled by setting bit 7 of the CMOS RAM
address register port, 0070h. This practice is not recommended.
continued
In this chapter
This chapter describes the various NMI sources and tells how the BIOS
Nonmaskable Interrupt ISR handles them.
The following topics are presented:
• XT NMI Handling
• 8087 Coprocessor Exceptions
• AT NMI Handling
• 80x87 Coprocessor Exceptions in AT Systems
Legend Description
The XT BIOS Nonmaskable Interrupt Service determines the reason for the
NMI and takes appropriate action. In general, this involves:
• displaying a run-time error message (shown below), and
• halting the processor.
NMls can only be cleared by a system reboot. The BIOS supports NMI clear
ing by warm (Ctrl-Alt-Del) reboot or cold reboot (system reset button or
power switch).
8087 NMI at address. An NMI occurred on access Type (S)hut off NMI.
Type (S)hut off NMI, to the math coprocessor. Temporarily continues pro
(R)eboot, other keys to cessing, but the coprocessor
continue must be replaced.
Memory parity NMI at A memory chip(s) has Type (S)hut off NMI.
address. Type (S)hut off failed. Temporarily continues pro-
NMI, (R)eboot, other cessing. The bad memory
keys to continue chip(s) must be replaced.
liD card NMI at address. An NMI occurred on access Turn the machine off and
Type (S)hut off NMI, to an adapter card. then on again. If that doesn't
(R) eboot, other keys to work, replace the adapter
continue card.
Description
Systems based on the Intel 8086 and 8088 that incorporate the 8087 math
coprocessor indicate math coprocessor exceptions by generating an NMI
(i.e.,INT02h).
A user coprocessor exception routine should be written to handle 8087
coprocessor exceptions by intercepting INT 02h.
The coprocessor exception routine should determine if the NMI was gener
ated by the 8087. If the NMI was not coprocessor related, the routine should
transfer control to the BIOS NMI ISR. The graphic below illustrates the pro
cess that the caller's 8087 NMI handling routine must follow.
User
8087 Yes Coprocessor
Exception Exception
Handler
No
BIOS
8087 NMI
ISR
NMls can only be cleared by a system reboot. The AT BIOS supports NMI
clearing by warm (Ctrl-Alt-Del) reboot or cold reboot (system reset button
or power switch).
continued
Memory Parity Error at Memory failed. If the BIOS Type (S)hut off NMI to
xxxxx (R) NMI handler can determine temporarily continue pro
the address of the failing cesslng. Test the system
memory. It will be displayed board and all Installed de
In place of xxxxx. If the failing vices for proper operation.
memory Is not found. the Replace If necessary.
message will read "Memory
Parity Error ????".
I/O Card Parity Error at A peripheral card failed. If Type (S)hut off NMI to
XXX)((R) the BIOS NMI handler can de temporarily continue pro
termine the address of the cesslng. Test the system
failed card. It will be displayed board and all Installed de
in place of xxxxx. If the failed vices for proper operation.
card is not found. then the Replace if necessary.
message will read "I/O Card
Parity Error ???? H •
DMA Bus Time-out A device has driven the Test the system board
-BURST signal line for more and all Installed devices
than 7.8 microseconds. for proper operation. Re
causing the DMA Controller place if necessary.
to generate a bus time-out.
Applications
80x87 Software
Exception Exception
Handler
No
8087
Exception
AT BIOS
NMI
ISR
continued
XT compatibility
An AT-compatible system revectors any expansion bus hardware interrupt
that generates an INT 02h in 8088-based systems to INT 71 h.
Services
Overview
Introduction
The ROM BIOS contains two keyboard-related services, a Keyboard ISR and
a Keyboard DSR:
• Keyboard ISR
The BIOS Keyboard Interrupt Service routine (lSR) is invoked via hardware
INT 09h each time a key is pressed. The BIOS Keyboard ISR processes
keyboard data and converts it into information that is useful to the sys
tem. In most cases, this conversion results in the Keyboard ISR placing a
two byte character code into a keystroke buffer located at 40: 1Eh in low
memory.
• Keyboard DSR
The BIOS Keyboard Device Service routine (DSR) is invoked via software
INT 16h. The BIOS Keyboard DSR provides an interface through which the
operating system or application software can interface with the keystroke
buffer. The Keyboard DSR contains functions that read the BIOS keyboard
buffer, write to the buffer, return the status of the buffer, and so on.
continued
Vector values
Each time the system is booted, the ROM BIOS vectors INT 09h to
FOOO:E987h, the Keyboard ISR entry point. In addition, it vectors INT 16h
to FOOO:E82Eh, the Keyboard DSR entry point.
In this chapter
Becaus~ they are closely related, this chapter presents information on both
INT 09h and INT 16h Keyboard Services. The following topics are dis~ussed:
• Theory of Operation
• Keyboard I/O Ports
• System RAM Data
• INT 09h: Internal Function Requests
• INT 16h: Keyboard DSR
• How to Read Character Code Tables
• Character Codes: AH = OOh/01 h
• Character Codes: AH = 10h/11h
Legend Description
Introduction
IBM PC/XT, PCI AT, and compatible keyboards add flexibility to IBM compat
ible PCs by tying the interpretation of keystrokes to system software, rather
than directly to keyboard hardware.
The keyboard generates a key's make code each time that key is pressed,
and it generates the key's break code each time the key is released. The
byte associated with a key's break code is identical the one associated with
its make code except that bit 7 is set. That is, the numeric value its break
code is 80h higher than the key's make code.
Keyboard codes are converted from meaningless numbers into ASCII charac
ters or other meaningful data through a series of transformations controlled
by system software. The number of transformations involved depends direct
lyon the kind of PC in use.
continued
Like its PC/XT counterpart, the 8042 chip generates IRQ1 which invokes the
ROM BIOS INT 09h Keyboard Interrupt Service Routine. Because of hardware
differences between PC and PC/AT keyboards, however, firmware resident in
the 8042 controller must perform the additional step of converting AT key
codes into System Scan Codes, values that are backwards compatible with
those generated by PC/XT keyboards.
continued
When a key is held down continuously, the keyboard hardware delays for a
brief period then sends repeat values of the key's make code to the key
board controller chip. Upon receipt of each make code, the controller chip
does its processing and generates an IRQ1 which invokes INT 09h, the
keyboard ISR.
continued
. __ ....
: '
Step I. -
8042
Keyboard
Controller
Shift I
Toggle
State
Flags
Step 11.
INT 16h
Step 111.
DOS
or
Applications
Software
Step I.
The 8042 Keyboard Controller converts keyboard make or break codes from
serial to parallel form, then it translates them into System Scan Codes, val
ues that are backwards compatible with PC/XT keyboard hardware. In PC/ A T
and compatible systems, 8042 System Scan Codes are the only codes the
INT 09h Keyboard ISR can Interpret. In PC/XT systems, conversion of key
codes Into System Scan Codes is unnecessary; keyboard make or break
codes are passed directly through to the INT 09h Keyboard ISR.
Step II.
INT 09h accepts the System Scan Codes placed at Port 60h by the 8042
Keyboard Controller and processes each code as follows:
1. System Scan Codes that correspond to the keyboard shift or toggle keys
(Shift, Alt, Ctrl, Caps Lock, Num Lock or, Scroll Lock) cause
INT 09h to update the Shift/Toggle data variables located In segment 40h
of system RAM.
Step III.
When Invoked by the operating system or by a software application, INT 16h
reads the Character Code from the keyboard buffer. If desired, 101/102-key
keyboard character codes can be filtered for compatibility with application
software that accepts only those character codes generated by 83- and
84-key keyboards.
INT 09h and 16h Keyboard Services reference the following 1/0 ports:
Read/Write
continued
Read/Write
I/O Address Status Description
Introduction
Throughout the course of operation, the BIOS Keyboard Services monitor and
maintain several status and buffer-control data definitions.
Introduction
The BIOS INT 09h ISR is programmed to interpret certain predefined key
combinations as requests for internal functions.
The key or key combinations which the INT 09h ISR interprets as internal
function calls are listed below:
• <Ctrl> <Alt> <Del>: SYSTEM RESET
• <Ctrl> <Break> «Ctrl> <Scroll Lock»: BREAK
• <Ctrl> <Num Lock>: PAUSE
• <Shift> <Print Screen>: PRINT SCREEN
• <SysReq>: SYSTEM REQUEST
Input: AH = 4Fh
Reference: See Chapter 13 for more information on INT 15h functions 4Fh
and COho
Description
The BIOS INT 09h ISR recogflizes the <Ctrl> <Alt> <Del> key combination as
an internal request for the system RESET routine.
The INT 09h ISR invokes the RESET operation with a direct call to the ROM
BIOS code location where the system RESET routine resides.
Input/Output
Input: Keyboard Shift Flags byte (40: 17h)
Bit 3 = 1 (Alt pressed)
Bit 2 = 1 (Ctrl pressed)
XT Make Code or
AT System Scan Code = 53h (Del pressed)
Output: Reset Flag word (40:72h)
(1 Word) = 1234h
INT 09h initiates system RESET routine
Description
The BIOS INT 09h ISR recognizes the <Ctrl> <Break> key combination as an
internal function request for INT 1Bh. <Break> and <Scroll Lock> are equiva
lent keys on many keyboards.
Input/Output
Input: Keyboard Shift Flags byte (40: 17h):
Bit 2 = 1 (Ctrl pressed)
XT Make Code or
AT System Scan Code = 46h (Break pressed)
Output: INT 09h invokes INT 1Bh, a vector address which points to a break
routine, if any.
Description
The BIOS INT 09h ISR recognizes the <Ctrl> <Num Lock> key combination as
an internal function request for the INT 09h controlled PAUSE state. On a
101-key keyboard. the <PAUSE> key causes the INT 09h ISR to initiate the
Pause State.
When the INT 09h ISR puts the computer system into the Pause State. the
INT 09h ISR Pause-State routine loops until a valid key or key combination is
received from the keyboard.
Input/Output
Input: Keyboard Shift Flags byte (40: 17h)
Bit 2 = 1 (Ctrl pressed)
Keyboard Shift Flags byte 2 (40: 18h)
Bit 5 = 1 (Num Lock pressed)
Bit 3 = 1 (Ctrl/Num Lock in active state: suspend toggles)
XT Make Code or
AT System Scan Code = 45h (Num Lock pressed)
Output: INT 09h loops PAUSE routine until a valid key or key combination
is received from 8042 controller.
The INT 09h ISR resets Bit 3 of Keyboard Shift Flags byte 2 to zero as soon
as it receives either
• the make System Scan Code for any non-shift key except the SYS REO
key. or
• any valid shift/toggle key combination.
continued
Shift Keys
None
Shift (L or R)
2. 3.
Alt
Alt/Shift
Ctrl
Ctrl/Shlft 4.
Alt/Ctrl 5.
Alt/CtrllShift
LEGEND
1. PAUSE STATE IS ENDED (Bit 3 of Keyboard Shift Flags Byte 2 is reset).
The scan codes normally associated with these keys do not have their
usual effect on the shift and toggle flags. They are interpreted instead as
a request to reset Bit 3 of Keyboard Shift Flags Byte 2 to zero, thus
ending the Pause State.
2. PAUSE STATE IS NOT ENDED. The keyboard controller chip places the
System Scan Code for (Ins) or (Shift Ins) into its internal buffer. The INT
09h ISR will act on these codes once Pause State is ended.
4. PAUSE STATE IS NOT ENDED. The keys which initiate the Pause State can
not be used to end Pause State. When in Pause State, these keys are
ignored.
5. PAUSE STATE IS NOT ENDED. When in Pause State, these keys are
ignored.
Description
The BIOS INT 09h ISR invokes INT OSh (the BIOS Print Screen service) when
ever it receives the combination of System Make Scan Codes corresponding
to the left or the right Shift key and the Print Screen key.
The System Make Scan Codes necessary to cause INT 09h to invoke INT OSh
can be generated by pressing
• the Print Screen key alone. or
• either of the Shift keys and the Print Screen key.
Input/Output
Input Case #1: <PrtSc> key only
Input Case #2: <Shift> <PrtSc> keys
System Scan Codes = EOh. 2Ah. EOh. 37h
(Left Shift and Print Screen both depressed)
or
Description
On AT-compatible systems. the BIOS INT 09h ISR interprets the System Re
quest key in either of two ways:
• When the System Request key is depressed. INT 09h interprets the result
ing System Scan Code as an internal function request for INT 15h: func
tion AH = 85h. subfunction AL OOh - Process System Request.
• When the System Request key is released. INT 09h interprets the resulting
System Scan Code as an internal request for INT 15h. function AH = 85h.
subfunction AL = 01 h - Terminate System Request.
No.e: The Sys Req is not available on 83-key PC/XT and compatible
keyboards.
Introduction
The BIOS Keyboard DSR is invoked via software interrupt INT 16h. Individual
function codes are selected via the AH register.
* Functions OSh and 10h - 12h are not supported on all XT BlOSs.
Description
If a character code is available in the keyboard buffer, the Read Keyboard
Input function reads the character code, removes it from the keyboard buf
fer, and returns its value in AX. The way this function processes when no
character code is available depends on the kind of PC in place.
PC/XT processing
In PC/XT and compatible systems, if the keyboard buffer is empty, this func
tion suspends program operation until a character code is inserted into the
buffer. Users who wish to avoid suspending the system are advised to use
function AH = 01 h Return Keyboard Status to test for the presence of a
character code.
AT processing
In PC/AT and compatible systems, if the keyboard buffer is empty, this
function invokes INT 15h function AH = 90h (Device Busy) with AL = 02h
Keyboard. This allows the operating system to perform another task while
the keyboard loop is occurring.
Once the INT 09h Keyboard ISR places a character code in the keyboard
buffer, it invokes INT 15h function AH = 91 h (Interrupt Complete) with
AL = 02h Keyboard. The Read Keyboard Input function then reads the char
acter code, removes it from the buffer, and returns to the caller with the
character code in AX. In addition, if the keyboard LEOs do not match the
current flag settings, function AH = ~Oh also updates the keyboard LEOs.
Input/Output
Input: AH OOh
Output: AH Scan code or character 10 for special character
AL = ASCII code or other translation of character.
Reference: The data table labeled" Character Codes: AH = 00h/01 h" lists
the codes returned in AX when using INT 16h AH = OOh and
AH=01h.
continued
Description
This function is useful for allowing programs to check for keyboard input
while continuing to run if there is none. It executes as follows:
• Checks to see if a two-byte character code is available in the keyboard
buffer.
• If a key is waiting, a copy of the key is returned. The buffer is not incre
mented to the next key.
• If the keyboard buffer contains at least one key, the Zero Flag is cleared.
• If the keyboard buffer does not contain a key, the Zero Flag is set.
• In PCI AT systems, if the keyboard LEOs do not match the current flag
settings, this function updates the LEOs.
Input/Output
Input: AH = 01h
ZF 0 Character is ready
1 No character is available
Reference: The data table labeled" Character Codes: AH = 00h/01 h" lists
the codes returned when using INT 16h AH = OOh and AH = 01 h.
continued
Description
The Return Shift Flag Status function returns the current shift status from the
Keyboard Shift Flags byte (40: 17h).
Note: In PC/AT and compatible systems. the LED status is not updated.
Input/Output
Input: AH 02h
Output: AL Current shift status, where:
Bit 7 :: 1 Insert active
Bit 6 = 1 Caps Lock active
Bit 5 :: 1 Num Lock active
Bit 4 = 1 Scroll Lock active
Bit 3 = 1 Alt pressed
Bit 2 :: 1 Ctrl pressed
Bit 1 = 1 Left Shift pressed
Bit 0 = 1 Right Shift pressed
Description
The Set Typematic Rate and Delay function changes the typematic rate
(make code per second) and the delay (milliseconds before beginning
typematic) .
Input/Output
If the parameters are valid. the function transmits a Set Rate command
(F3h) to the keyboard controller.
Input: AH = 03h
AL = 05h
BH = Delay value (in milliseconds)
OOh = 250 03h = 1000
01 h = 500 04h to FFh - Reserved
02h = 750
BL = Typematic rate (in characters per second)
OOh = 30.0 OBh = 10.9 16h = 4.3
01h = 26.7 OCh = 10.0 17h = 4.0
02h = 24.0 ODh = 9.2 18h = 3.7
03h = 21.8 OEh = 8.6 19h = 3.3
04h = 20.0 OFh = 8.0 1Ah = 3.0
05h = 18.5 10h = 7.5 1Bh = 2.7
06h = 17.1 11h = 6.7 '1Ch = 2.5
07h = 16.0 12h = 6.0 1Dh = 2.3
08h = 15.0 13h = 5.5 1Eh = 2.1
09h = 13.3 14h = 5.0 1Fh = 2.0
OAh = 12.0 15h = 4.6 20h to FFh - Reserved
Output: None
Description
The Store Key Data function stores program-generated data into the key
board buffer just as if a key were pressed. The buffer pointer (40: 1Ch) is
adjusted to point to the next available location in the keyboard buffer.
Input/Output
Input: AH = OSh
CH = Scan code
CL = ASCII character
Output: AL OOh No error
= 01 h Keyboard buffer full
Description
The Read Extended Keyboard Input function reads the next two-byte charac
ter code in the keyboard buffer and returns the value in AX. It is designed
for use with the 101/102-key keyboard. Unlike function AH = OOh, this func
tion does not modify character codes for 84-key keyboard compatibility.
InputlOutput
Input: AH ::;: 10h
Output: AH ::;: Scan code or character ID for special character
AL ::;: ASCII code or other translation of character
Reference: The character codes returned by this function are found in the
table "Character Codes: AH = 10h/11h" in this chapter.
Description
This function is similar to function AH = 01 h, except that it returns unique
scan codes for all keys on the 101 11 02-key keyboard. It executes as follows:
• Checks to see if a character code is available in the keyboard buffer.
• If a key is waiting, a copy of the character code is returned in AX. The
buffer is not incremented to the next key.
• If the keyboard buffer contains at least one key, the Zero Flag is cleared.
• If the keyboard buffer does not contain a key, the Zero Flag is set.
• If the keyboard LEOs do not match the current flag settings, this function
updates the LEOs.
Input/Output
Input: AH 11 h
Output: AH = Scan code or character 10 for special character
(if ZF is set)
AL = ASCII code or other translation of character 10 (ZF is set)
ZF = 0 No key in buffer
= 1 Key waiting
Reference: The character codes returned by this function are found in the
table "Character Codes: AH = 10h/11h" in this chapter.
continued
INT 16h: AH = 12h Return Extended Shift Flags Status [XT] [AT]
Description
This function is similar to function AH = 02h. except that it returns informa
tion on the shift keys provided on the 101/1 02-key keyboard. It also returns
an additional byte of flags in the AH register.
The Return Extended Shift Flags Status function returns the shift flag status
from Keyboard Shift Flags Byte (40: 17) in the AL register. and returns the
shift flag status from Keyboard Shift Flags Byte 2 (40: 18) and 101-key
Keyboard Status Byte (40:96) in the AH register.
continued
Input/Output
Input: AH = 12h
Output: AH = More keyboard shift flags, where:
Bit 7 = 1 Sys Req pressed (40: 18h Bit 2)
Introduction
The tables on the following pages present data related to the IBM PC/XT / AT
and compatible keyboards.
• The columns labeled II Scan Codes" list the codes offered to the INT 09h
ISR by the keyboard controller chip. In PC/AT compatible systems these
codes are generated by the 8042 controller chip and are more commonly
referred to as System Scan Codes. Only Make Code values are listed.
Break codes are found by adding a value of 80h to the make code in
question. Scan Codes in EO-xxh form correspond to the 101l102-key
keyboard extended keys. These keys are not present on 83- and 84-key
keyboards.
• Caps Lock plus any typewriter key yields the same character code as
Shift plus any typewriter key.
• Num Lock plus any numeric keypad key yields the same character code
as Shift plus any numeric keypad key.
• Alt plus the decimal value for an ASCII character input from the numeric
keypad yields the ASCII character. Allowable values are 0 to 255. These
instances are noted with II • • " in the Alt column.
continued
83-Key Keyboard
59 60 69 70
61 62 27 71 72 73 74
~ __"~JL~~~~~..JL~~.-~~..JL~~~~~-t 28
63 64 41 75 76 77
65 66 42 54 55 79 80 81 78
67 68 82 83
84-Key Keyboard
70 65 90 95 100 lOS
71 66 ., •• 101 106
72 67 92 97 102 107
73 68 93 98 103
108
74 69 99 104
75 80 86 90 95 100 lOS
76 81 8. 91 96 101
106
92 97 102
~ 93 98 103
108
c:EEl 99 104
Introduction
The read keyboard input function acts as an 84-key keyboard filter, selec
tively editing the buffer contents for 84-key keyboard compatibility.
Table: AH = OOh/01 h
The table below lists the character codes returned by functions AH = OOh
and AH = 01h.
1 41 1 , 29 29/60 29/7E
2 2 2 1! 02 02/31 02/21 78/00
3 3 3 2@ 03 03/32 03/40 03/00 79/00
4 4 4 3# 04 04/33 04/23 7A/00
5 5 5 4$ 05 05/34 05/24 7B/00
6 6 6 5% 06 06/35 06/25 7C/00
7 7 7 6 A
07 07/36 07/5E 07/1 E 70/00
8 8 8 7& 08 08/37 08/26 7E/00
9 9 9 8" 09 09/38 09/2A 7F/00
10 10 10 9( OA OA/39 OA/28 80/00
11 11 11 o) OB OB/30 OB/29 81/00
12 12 12 -- OC OC/20 OC/5F OCllF 82/00
13 13 13 =+ 00 00/30 OOI2B 83/00
15 14 15 Backspace OE OE/08 OE/08 OE/7F
16 15 16 Tab OF OF/09 OFIOO
continued
only)
continued
55 53 55 I ? 35 35/2F 35/3F
57 54 57 R Shift 36
58 29 30 L Ctrl 1D
60 56 58 L Alt 38
61 57 61 Space 39 39/20 39/20 39/20 39/20
62 R Alt EO-38
64 R Ctrl EO-1D
75 Insert EO-52 52/00 52/00
continued
90 69 95 Num Lock 45
91 71 91 7 Home 47 47/00 47/37 77/00 ••
••
92
93
75
79
92
93
4 Left
1 End
4B
4F
4B/00
4F/00
4B/34
4F/31
73/00
75/00 ..
95 / EO-35 35/2F 35/2F
96 72 96 8 UP 48 48/00 48/38 ••
97 76 97 5 4C 4C/00 4C/35 ••
98 80 98 2 Down 50 50100 50/32 ••
99 82 99 o Ins 52 52/00 52/30
continued
EO-37
Introduction
INT 09h places the value FOh in the low byte character code position for
some Altlcharacter key combinations. The Return Extended Keyboard Input
function strips FOh from the keyboard buffer image before returning to the
caller. Keys with FOh are returned to AX with their low-order byte set to OOh.
Table:. AH = 1Oh/11 h
The table below lists the character codes returned by functions AH = 10h
and AH = 11 h.
continued
continued
44 L Shift 2A
45 (102-Key 56 56/5C 56/7C
only)
46 Z 2C 2C/7A 2C/5A 2C/1A 2C/00
continued
102
103
6 Right
3 PgDn
4D
51
4D/00
51100
4D/36
51/33
74/00
76/00 ..••
104 . Del 53 53/00 53/2E 93/00
105 - 4A 4A/2D 4A/2D 8E/00 4A/00
106 + 4E 4E/28 4E/28 90/00 4E/00
108 Enter EO-1C EO/OD EO/OD EO/OA A6/00
110 Esc 01 01/18 01/18 01/18 01/00
112 F1 38 38/00 54/00 5E/00 68/00
113 F2 3C 3C/00 55/00 5F/00 69/00
114 F3 3D 3D/00 56/00 60/00 6A/00
115 F4 3E 3E/00 57/00 61/00 68/00
116 F5 3F 3F/00 58/00 62/00 6C/00
117 F6 40 40/00 59/00 63/00 6D/00
118 F7 41 41/00 5A/00 64/00 6E/00
119 F8 42 42/00 58/00 65/00 6F/00
•• Altplus the decimal value for an ASCII character Input from the numeric keypad
yields the ASCII character. Allowable values are 0 to 255.
continued
Overview
Description
In general, all IBM PC/XT/AT and compatible video BlOSs contain a group of
functions that allow the user to select video display mode, cursor address
ing, text display, scrolling, and writing pixels. However, the physical location
and number of functions supported by a PC/XT/AT or compatible video BIOS
depends on the kind of adapter in place.
MDA and CGA adapters rely exclusively on the Video Service contained in
the system board ROM BIOS of all PC/XT/AT and compatible computers.
EGA and VGA adapters contain a dedicated ROM BIOS installed on the
adapter hardware itself.
continued
Legend Description
Note: The Hercules display adapter allows for the display of 720x350 mono
chrome graphics on standard TTL monochrome monitors. However,
neither the system ROM BIOS nor the Hercules adapter itself contain a
BIOS. Applications programs that support Hercules graphics must
contain an application-specific device driver.
continued
In this chapter
This chapter defines the features and functions of all PC-compatible video
and ROM BlOSs. The following topics are presented:
• Theory of Operation
• MDA Hardware Environment
• CGA Hardware Environment
• EGA Hardware Environment
• VGA Hardware Environment
• Video Modes
• System RAM Data
• Summary of INT 10h Functions
• How Functions Are Called
• Error Handling
• Video BIOS Function Descriptions
Introduction
A computer monitor is a specialized device designed to display digital data
written into a video buffer by the computer's microprocessor. The signals
driving the monitor originate in the computer's video subsystem. Computer
monitors in themselves are not programmable, but the video subsystems
controlling them are. The BIOS Video Service offers operating systems and
applications programs a set of functions that eliminate the need to directly
program video subsystem hardware.
The computer's video subsystem generates signals that cause the CRT's
electron beam to sweep across the screen in a left to right, top to bottom
pattern of horizontal lines called a raster. The information written by the
microprocessor to the video buffer is represented on the CRT screen as a
pattern of illuminated dots, called pixels (picture elements). As the beam
sweeps across the screen, the video subsystem turns the electron beam on
and off, thus .. painting" the buffer information onto the screen.
continued
Display resolution
A monitor's horizontal scan frequency determines the maximum number of
lines the monitor is capable of painting per second. Its vertical scan frequen
cy determines the frames per second the monitor is capable of refreshing .
• Vertical resolution
A display's vertical resolution - the maximum number of scan lines it can
display on the screen - is calculated by dividing horizontal scan frequen
cy by vertical scan frequency.
continued
Monitor types
Computer monitors come in two varieties: color and monochrome.
• Colo'r monitors
Color computer monitors contain three electron guns: one red, one blue,
and one green. The special phosphors coating the CRT surface glow ac
cordingly: when struck by a red beam they glow red; when struck by a
blue beam, they glow blue, and so on. Although each gun illuminates a
separate dot, the dots are so tightly focused that they appear to the eye
as one color.
• Monochrome monitors
Monochrome monitors have only one electron gun. The color of the
screen is a function of the phosphor used. In monochrome computer
displays, common phosphor colors are amber. green. or white.
Signal types
Computer monitors are further distinguished from each other by the kind of
input signal they are designed to accept:
• Composite
Composite monitors accept a composite. analog signal - like the signal
used to drive a television set. In a composite color signal, the red, green,
and blue (and other control signals) are combined by the video subsys
tem and separated by the monitor. Composite monochrome signals are
the same except that they contain only one "color" signal. Composite
signals can be sent over a single line, but the difficulty involved in accu
rately separating colors limits the resolution achieved on composite
monitors.
continued
continued
Adapter types
IBM PC/XTs, ATs, and compatible systems are not manufactured with the
video subsystem integrated in the motherboard; video hardware, instead,
must be configured into the system bus on a video adapter board.
The table below describes monitors and resolutions supported by the major
PC video adapters.
continued
• Alphanumeric format
When writing alphanumeric data to the video buffer, the microprocessor
writes each symbol (e.g., letter, number, punctuation mark, etc.) as a
series of two bytes. The first byte contains the ASCII code for the symbol,
and the second byte contains the color attributes to be applied to the
symbol.
• Graphic format
When writing graphical data to the video buffer, the microprocessor writes
the individual color value of each pixel to be. painted on the CRT. In order
to do this, the microprocessor must address the display buffer as a
memory map made up of a series of bits. When displaying data in any of
16 colors, for example, the microprocessor writes four bits per pixel (i.e.,
24 =16). The video subsystem's control circuitry reads each pixel location
from the buffer and generates the color and control signals necessary to
write the dot to the correct screen location.
continued
continued
continued
• Attribute Decoder
An adapter's attribute decoder component uses data from the video
buffer to control the color and brightness of the signals produced by the
video Signal generator.
continued
Operating System
or
called.
Dot Stream
to Monitor
ASCII Attribute
... Video BIOS ..-----. Microprocessor
43h 07h
I I ~ Decoder Intensity
I I
I I
Video
I I
Signal
I I
Generator
I
IL _____ 07h
IL _ _ _ _ _ _ t - - Alphanumeric
Dot
43h ~
Character Pattern
Generator
Video
TI Horizontal & Vertical Timing j Buffer
Address
Buffer
CRT Controller Mode Control
Introduction
The MDA BIOS resides in system ROM and not on the MDA adapter card.
The MDA BIOS assumes the following hardware environment:
• Motorola 6845 (or compatible) CRTC
• Monochrome digital signal monitor
• 4K of video RAM
continued
I/O
Introduction
The CGA BIOS resides in system ROM and not on the CGA adapter card.
The CGA BIOS assumes the following hardware environment:
• Motorola 6845 (or compatible) CRTC
• Composite or Digital RGB monitor
• 16K of video RAM
continued
I/O
Address Read/Write Index Description
Introduction
The EGA BIOS resides in EGA adapter cards, completely superseding the
system ROM video BIOS. The EGA BIOS assumes the following hardware
environment:
• IBM EGA or compatible chip
• 64K of video RAM
• Digital RGB or digital monochrome monitor
continued
I/O Address
Read/Write Index Description
GENERAL REGISTERS
03C2h
W - Miscellaneous Output
03C2h
R - Input Status 0
3?2h*
R - Input Status 1
03? Ah/3? Ah*
W - Feature Control
SEQUENCER REGISTERS
03C4h R/W - Sequencer index Register
03C5h W OOh Reset
03C5h W 01h Clocking Mode
03C5h W 02h Map Mask
03C5h W 03h Character Map Select
03CCh W 04h Memory Mode
CRT CONTROLLER REGISTERS
3?4h/3?4h* R/W - CRTC Index Register
3?5h/3?5h* W 01h Horizontal Total
3?5h/3?5h* W 02h Horizontal Display Enable End
3?5h/3?5h* W 03h Start Horizontal Blanking
3?5h/3?5h* W 04h End Horizontal Blanking
* The value of ? depends on the value of bit 0 In the Miscellaneous Output Register
? = B In Monochrome Emulation Modes
? = D In Color Emulation Modes
continued
* The value of ? depends on the value of bit 0 in the Miscellaneous Output Register
? = B In Monochrome Emulation Modes
? = 0 in Color Emulation Modes
continued
Introduction
The VGA BIOS resides in ROM on VGA adapter cards. The VGA BIOS as
sumes the following hardware environment:
• IBM VGA-compatible VLSI chip or chip set
• INMOS G171 or compatible digital-to-analog converter (DAC) chip
• 256K of dynamic read/write .video RAM configured as four 64K maps
• Monochrome or color direct drive analog monitor
• Multisynchronous style monitor, such as the NEC MultiSync
Each DAC color register contains one 18-bit RGB analog value. Six bits of
each register are allocated to each primary color. Thus, the color repre
sented in each DAC color register may be any of 256K possible colors
(i.e., 23 *6 = 256K).
continued
Video RAM
The BIOS Video Service requires 256K of read/write video RAM formatted
into four banks (or maps) of 64K.
Monitor support
To display all modes, the Video Service requires either a monochrome or a
color direct drive analog monitor with a 31.5 KHz horizontal scan frequency.
The display's vertical gain is adjusted automatically by the VGA-compatible
circuitry. Thus, video modes with 350, 400, and 480 horizontal scan lines
can be displayed without requiring manual adjustment. MultiSync-style moni
tors are also supported.
continued
GENERAL REGISTERS
03CCh R - Miscellaneous Output
* The value of ? depends on the value of bit 0 In the Miscellaneous Output Register
? = 03BAh In Monochrome Emulation Modes
? = 03DAh In Color Emulation Modes
continued
.-
3?5h/3?5h* R/W 10h Vertical Retrace Start
3?5h/3?5h* R/W 11h Vertical Retrace End
3?5h/3?5h* R/W 12h Vertical Display Enable End
3?5h/3?5h* R/W 13h Offset
3?5h/3?5h* R/W 14h Underline Location
3?5h/3?5h* R/W 15h Start Vertical Blank
3?5h/3?5h* R/W 16h End Vertical Blank
3?5h/3?5h* R/W 17h CRTC Mode Control
3?5h/3?5h* R/W 18h Line Compare
* The value of ? depends on the value of bit 0 In the Miscellaneous Output Register
? = 03BAh in Monochrome Emulation Modes
? = 03DAh in Color Emulation Modes
continued
continued
•• •• •• ••
• • • •
03C9h R/W FFh Red value color FFh
03C9h R/W FFh Green value color FFh
03C9h R/W FFh Blue value color FFh
03C1h R/W 14h Color select register
• Applications should not write to this register. Unpredictable results will occur.
continued
The table below lists the sixteen video modes supported by the EGA BIOS.
continued
The table below lists the modes supported by the VGA BIOS.
"* " In~icates that scan lines must be specified before mode set. (See AH =
12h BL = 30h Select scan lines for text modes for details.)
"+" Indicates default mode
continued
Fact Description
.
To activate a 200 or 350 scan line mode:
Execute Function AH = 12h, BL = 30h Select scan
lines for text mode with AL = OOh or 01h. (i.e.,
200 or 350 scan lines).
• Execute Function AH = OOh Set Video Mode .
Note: Unless otherwise Indicated, the BIOS defaults
to 400 scan lines for all text modes.
System RAM
continued
System RAM
AH = OOh Set Video Mode refers to the INT 10h Video Service pointer tables
(and to the information pointed to by the tables) on every mode set.
Note: Users who wish to override the BIOS default locations may supply
their own values for 40:A8h and entry 5 of Table #1. See below.
continued
Size Description
continued
Size Description
continued
Size Description
Byte Number of entries in the DCC table
Byte DCC Table Version Number
Byte Maximum display type code
Byte Reserved
continued
Size Description
continued
Size Description
Pointer 5 Reserved
Pointer 7 Reserved
The table below lists the Video Service functions and subfunctions. The col
umn labeled Adapter Type defines each function's level of support for each
video adapter type.
continued
continued
Description
Individual Video Service functions are selected via the AH register. Subfunc
tions are selected via the AL register or the BL register. The following gen
eral rules apply to these functions:
• The character or pixel value that is to be written is normally passed in
register AL.
• BX, ex, DX and segment registers are preserved through all function
calls. Assume that all other register contents, particularly SI and DI, may
be destroyed.
• . The x coordinate (column number) is passed in ex (graphics functions) or
DL (text functions).
• Any display page value is passed in BH. Display pages are zero-based
(i.e., page 0 = first page, page 1 = second page, etc.).
Description
The Set Video Mode Function sets the video mode registers for operation in
any supported mode. It selects the active video mode if more than one is
installed, clears the screen, positions the cursor at 0,0 and resets the color
palette to default color values. (See the Video Modes heading in this chapter
for a description of each mode.)
Input/Output
Input: AH = OOh
AL = Video mode, where:
OSh-OCh - Reserved
Additional information
• Resetting the same video mode can be used to clear the screen.
• To avoid resetting the palette when working with colors, use INT 10h
Function 06h rather than Function OOh to clear the screen.
• The cursor is not displayed in graphics modes.
• On EGA and VGA adapters, modes 0, 2, and 5 are identical to modes 1,
3, and 4.
• The power-on default mode with a color analog monitor attached is 3.
• The power-on default mode with a monochrome analog monitor attached
is 7.
• During mode set on VGA adapters, if bit 7 of AL is set, the video buffer is
not cleared.
• Refer to AH = 12h BL = 30h to select the number of scan lines for text
modes (200, 350, or 400).
• For all modes except mode 13, the first 64 color registers are initialized
and the values in the remaining 192 color registers are undefined.
Description
This function sets the size of the cursor that appears in text modes. Cursor
size and location within the character box is determined by the starting and
ending scan lines indicated in bits 4 - 0 of registers CH and CL respectively.
This function stores cursor size parameters in the cursor type byte at
40:60h.
Input/Output
Input: AH = 01h
CH = Top scan line, where:
Bits 7-6 = OOh (must be OOh, otherwise cursor blinking
becomes erratic)
Bit 5 = To shut cursor off
Bits 4-0 = Top scan line
CL = Bottom scan line, where:
Bit 7 = Undefined
Output: None
continued
Additional information
• Only one cursor type is available for all video pages.
• The default text mode cursor occupies the bottom two scan lines of the
character box associated with the given text mode.
• Setting register bit 5 of the CH register causes the text mode cursor to
disappear completely. The cursor can also be eliminated by positioning it
to a nondisplay address, e.g. (x,y) = (0,25)
• In graphics mode, bit 5 is set automatically, which prevents the cursor
from being displayed. To simulate the cursor, use the solid block charac
ter DFh, or the change background attributes.
• CGA modes can display a cursor on eight lines, numbered 0 to 7, top
to bottom.
• MDA and EGA modes can display a cursor on 14 lines, numbered 0 to 13,
top to bottom.
• VGA modes can display a cursor on 16 lines, the default character size of
this mode.
CGA CH = 6, CL = 7
MDA. EGA CH = 11, CL = 12
MCGA. VGA CH = 13, CL = 14
Description
The Set Cursor Position function sets the cursor position (in terms of row
by-column coordinates) for the display page indicated in BL. It saves the
position as a two-byte row-by-column table entry in the cursor coordinates
byte at 40:50h. Rowand column coordinates are indicated in registers DH
and DL respectively.
The Set Cursor Position function applies to both text and graphics video
modes. In text modes, if the display page selected in BH is the active dis
play page, the screen cursor will move to the coordinates indicated in regis
ters DH and DL. In graphics modes, the cursor is invisible but is used to
define a position on the screen.
Input/Output
Input: AH = 02h
BH Display page number (see Function AH = 05h)
DH = Row (0 is top row of screen)
DL = Column (0 is leftmost column)
Output: AX = OOh
Cursor Positioning
Positioning the cursor to coordinates (0,0) places it in the upper left corner
of the screen in the 80x25 text mode. Selecting coordinates (79,24) in the
80x25 text mode will allow placement of the cursor in the lower right corner
of the screen. The cursor can also be placed in the lower right corner of the
screen using coordinates (39,24) in the 40x25 text mode.
Additional information
• The display page number must be set to 0 in CGA graphics mode.
• Multiple display pages in 16-color graphics as well as text modes are
supported by both EGA and VGA.
Description
The Read Current Cursor Position function reads the cursor position for the
given video page from the cursor coordinates byte at 40:50h. It reads the
cursor type from 40:60h and returns the current cursor position in text
coordinates. This function is useful for determining the exact cursor type
before it is changed.
Input/Output
Input: AH = 03h
Output: AX = OOh
DH = Row number
DL = Column number
A different cursor is maintained for each display page. Each of these cursors
can be examined independently with this function, no matter which page is
currently active. The number of available display pages is defined by the
display mode selected.
Description
This function reads the light pen's status and position. Light pen input de
vices are not supported on VGA adapters. Light pens are not effective on
monochrome monitors with long image-retention phosphor, and the light pen
position is not accurate enough for use with high resolution devices.
Input/Output
Input: AH = 04h
Description
The Select New Video Page function sets the active page for the video mode
selected. Refer to the table under the Video Modes heading for a list of the
maximum number of pages allowed for each video mode.
Input/Output
Input: AH = OSh
AL = New page number (zero-based)
Output: None
Additional information
• All page numbers are zero-based (i.e., page numbers begin at page 0).
• In text modes, page numbers range from 0-7.
• Page 0, located at the beginning of display memory, is used by default in
all video modes.
• Switching between pages does not alter their contents. Also, no matter
which page is active (currently displayed), text can be written to any video
page using INT 10h, Functions 02h, 09h and 10h.
• In the eGA modes, no video paging is possible.
• In EGA and VGA modes, video pages are available up to the limits of
video RAM in both alphanumeric and graphics modes.
• The current cursor position is maintained by the BIOS for as many as
eight video pages.
• An instantaneous screen change can be created by building a screen on
an undisplayed page, then using this function to display it.
Description
The Scroll Current Page Up/Down functions employ the CH, DH, CL, and DL
registers to define a screen window and allow the contents of the window to
be scrolled either up or down by the number of character rows specified in
register AL. If AL = OOh, the window is blanked instead of scrolled.
Information appearing on the screen but lying outside the parameters of the
defined window remains on the screen. Only one window can be defined at
any given time.
Input/Output
Input: AH = 06h Scroll current page up
07h Scroll current page down
AL = Scroll distance in character rows
(0 blanks entire scroll area)
BH = Attribute to use on blanked lines
CH = Top row of scroll window
CL = Left column of scroll window
DH Bottom row of scroll window
DL = Right column of scroll window
Output: None
Use the cursor positioning and character writing functions to fill the blank line
with text.
Initializing a window
Setting AL = OOh initializes a window on the display screen. Setting the AL
register to zero blanks out the region specified by the CX and DX general
purpose registers and fills the window with the attribute in the BH register.
Description
The Read Character/Attribute from Screen function reads the character at
the current cursor location. For text modes, the attribute is also returned. In
graphics modes, the character matrix at the cursor position is compared to
the bit patterns in the current graphics character definition table to determine
the character's ASCII value. Characters other than standard ASCII characters
are returned as AL = OOh.
Input/Output
Input: AH = 08h
BH = Display page (refer to the Video Modes heading for the
maximum pages per mode)
Output: AH = Attribute (text modes only)
AL = Character read
Additional Information
• To read a character from any valid display page (other than the active
one), specify the display page number.
• Information about the screen is in screen memory and need not be stored
in a program.
• This function can be used to read the screen for TSR spelling and thesau
rus utilities.
Description
The Write Characterl Attribute function writes the character to the screen
starting at the current cursor location for as many times as indicated in the
CX register. The cursor is not moved even if more than one character is
written. unless the same character is repeated.
INT 10h Functions AH = 09h and AH = OAh are similar. AH = 09h should be
used for all graphics modes and in all text modes where character by char
acter control of foreground and background attributes is desired.
Input/Output
Input: AH 09h
AL = ASCII character to write
BH = Display page (refer to the Video Modes heading for the
maximum pages per mode)
= Background color (graphics mode 13h only)
BL = Character attribute (text modes)
= Foreground color (graphics modes) (Le. color of
character)
CX = Repeat count
Output: None
continued
Additional information
• In text modes, the number of repeats placed into CX may exceed the
number of columns remaining in a given row. Characters will wrap around
from row to row. In graphics modes, the number of repeats placed into
CX cannot exceed the number of columns remaining in a given row.
Characters will not wrap around from row to row.
• In VGA graphics mode 13h, the color specified in BH determines the
screen background color.
• In CGA graphics modes, the bit map used for ASCII characters 80-FFh is
stored in a table that starts at O:7Ch. This value is stored in the vector for
INT 1Fh. By resetting the vector, the bit map table location can be
changed to point to a different bit map.
• For EGA and VGA graphics modes, use the table whose pointer is stored
in the vector for INT 43h. For further information, refer to the INT 10h,
Function AH = 11 h, AL = 20h and AL = 21 h headings in this chapter.
• Any value of AL will produce a display; this includes all control characters
(e.g. bell, backspace, CR, LF). These control characters are not inter
preted as special characters and do not change the cursor position.
• After a character has been written, the cursor has to be explicitly moved
to the next position using INT 10h, Function 02h.
• To write a character without changing the attribute at the current cursor
position, use INT 10h, Function OAh.
• When this function is used to write characters in graphics mode, and bit 7
of BL is set to 1, the character is XORed with the contents of the current
display. This feature can be used to write characters and then erase
them.
Description
The Write Character Only to Screen function operates identically to the Write
CharacterI Attribute function, except that for text modes the attribute bytes
corresponding to the characters remain unchanged. This function is often
used to write a character to the screen in text modes.
Note: Use AH = 09h in graphics modes.
Input/Output
Input: AH = OAh
CX = Repeat count
Output: None
Additional Information
• Any value of AL will produce a display; this includes all control characters
(e.g. bell, backspace, CR, LF). These control characters are not inter
preted as special characters and do not change the cursor position.
• After a character has been written, the cursor has to be explicitly moved
to the next position using INT 10h, Function 02h.
• To write a character without changing the attribute at the current cursor
position, use INT 10h, Function OAh.
• When this function is used to write characters in graphics mode, and bit 7
of BL is set to 1, the character is XORed with the contents of the current
display. This feature can be used to write characters and then erase
them.
Description
This function selects colors for medium resolution graphics modes. Depend
ing on the value placed in BH, the Set Color Palette function will perform any
of four operations.
Input/Output
Input: AH = OBh
BH = OOh
= Mode = 4, 5, set background color to value in BL
= Mode = 0, 1, 2, 3, set border color to value in BL
= Mode = 6, set foreground color (640x200 graphics)
to value in BL
BL = (0-31), when colors (16-31 are high intensity
background set)
or
BH = 01 h Select palette for modes 4, 5 (320x200 graphics)
BL = OOh Palette = Green (1). Red (2), Brown (3)
= 01 h Palette = Cyan (1), Magenta (2), White (3)
Output: None
Additional information
• In CGA graphics modes, bit 4 of BL selects between normal and high
intensity. EGA and VGA graphics modes emulate this by selecting a
palette of high intensity colors when bit 4 of BL is set.
• A flashing display can be set by rapidly changing the palette.
• The background color of text is determined by the high order four bits of
the attribute byte of each character.
Description
The Write Pixel function writes to video memory the pixel specified by row
and column number in DX and CX. When a video mode allows more than
one page. the (O-based) page number must be indicated in BH.
For all graphics modes except mode 13h, bit 7 of AL acts as an inverter
flag. If bit 7 of AH is set, then the color value in AL is exclusively ORed
(XOR) with the current pixel. That pixel can be erased by writing it a
second time.
Refer to the Video Modes heading for video modes, resolutions, and maxi
mum pages/mode.
Input/Output
Input: AH = OCh
AL Color (Bit 7 is exclusive OR flag)
BH = Page number (modes allowing more than one page)
CX = Pixel column number
DX = Pixel row number
Output: None
Pixel values
• In four-color graphics modes (modes 04h and OSh), pixel values range
from 0-3.
• In two-color graphics modes (mode 06h), pixel values range from 0-1.
Description
The Read Pixel function returns the value of an addressed pixel to the low
order bits of the AL register. This function can be used for collision detection
in video games. It can also be used by advanced graphics programs to
detect bpundaries when moving a graphics object on the screen.
Refer to the Video Modes heading for a listing of video modes, resolutions,
and maximum pages/mode.
Input/Output
Input: AH = ODh
BH = Page number (modes allowing more than one page)
CX = Column number
DX = Row number
Output: AL = Color value of pixel read
Pixel values
Display modes 04h, 05h and aSh have valid pixel values in the ranges of
0-3, 0-3 and 0-1 respectively.
Description
This function makes the display appear as a serial terminal. The character
in AL is written to video memory to be placed in the active page at the cur
rent cursor position and the cursor is moved to the next character location
(scrolling is necessary). Screen width is a function of the video mode cur
rently in effect.
Input/Output
Input: AH = OEh
AL = Character to write
BH = Active page
Output: None
Special characters
The four ASCII characters listed below are not displayed but are interpreted
instead as control characters. All other characters (including other control
characters) are interpreted as display characters.
continued
Additional information
• When working in the active page, this function allows a character to be
printed at the current cursor position. After printing the character, it
moves the cursor to the right one space. It then wraps the cursor to the
next line. Scrolling the screen up one line requires that the cursor be
moved past the lower right corner of the screen.
• In CGA text mode, characters can be written to any legal display page, no
matter which page is active.
• Compare this function with INT 10h, Function 13h.
• This is the best function to use for simple output.
DOS uses
DOS uses this function in the console driver for writing operating system text
and messages to the screen.
This function does not, however, allow the attribute of a text character to be
selected. To define an attribute for a character written to the screen:
1. write the ASCII blank character (20h) having the desired attribute to the
current position using Function 09h, and
2. write the desired character using Function OEh.
With this method, the user does not have to provide for line wrapping and
screen scrolling, but can allow the BIOS to control line wrap and screen
scroll.
Description
The Return Video Status function returns current display mode information. It
gives the mode. screen width in characters. and the display page number.
Refer to the Video Modes heading in this chapter for maximum pages per
mode.
Input/Output
Input: AH = OFh
Output: AH = Number of columns on screen from the screen width byte
(40:4Ah)
AL = Current mode from the video mode setting byte (40:49h)
BH = Active display page number from the display page byte
(40:62h)
Examples of use
Some ways to use this function are:
• To determine the screen width in the current screen mode before clearing
the screen.
• To determine the settings of the display system at program initialization so
that they can be returned to when the program terminates.
• To write TSR utilities that pop up on the screen while another application is
running. The background application may be running in a different mode
than the TSR.
Description
This function has fourteen subfunctions that control operations on the color
palette registers in EGAIVGA video controllers. The subfunctions control
color, blinking and the video DAC for VGA controllers. There are two groups:
• Subfunctions that service the Attribute Controller's Internal Palette
• Subfunctions that service the DAC Color Registers.
Subfunctions
continued
This subfunction sets a single color value in the Attribute Controller's 16
value internal palette. For VGA mode 13h (i.e, 2S6-color graphics), this
subfunction exits without processing.
Input: AH = 10h
BL = Palette register
Output: None
This subfunction sets the overscan color (screen border) for the current
video modes.
Input: AH = 10h
AL = 01h
Output: None
continued
Subfunction: AL = 02h
Set all palette registers and overscan (border color) [EGA] [VGA]
Input: AH = 10h
AL = 02h
AL = 03h
continued
Input: AH = 10h
AL = 07h
Input: AH = 10h
AL 08h
Subfunction: AL = 09h
Read all palette registers and overscan register (border color) [VGAl
This subfunction reads the contents of the current palette register and the
overscan register and outputs the contents to a table pointed to by ES:DX.
The table pointed to by ES:DX must be 17 bytes long.
Input: AH = 10h
AL = 09h
continued
AL = 10h
Subfunction: AL = 11 h
This subfunction is reserved.
continued
Input: AH = 10h
At = 12h
BX = First color register to set
CX = Number of color registers to set
ES:DX = Pointer to table of color values. Table format is red,
green, blue, red, green, blue
Output: None
With gray scale summing selected, the weighted sum gray shade value
is calculated and saved to each of the three RGB parts of the color regis
ter. See INT 10h, Function 10h, subfunction 1Bh for a description of this
calculation.
continued
Input: AH = 10h
AL = 13h
continued
Subfunction: AL = 14h
This subfunction is reserved.
AL = 15H
CL = Blue value
DH = Red value
Subfunction: AL = 16h
This subfunction is reserved.
AL = 17h
continued
This subfunction returns the current color paging mode as well as the current
color page within this mode. See INT 1Oh, Function 1Oh, subfunction 13h,
Select color paging mode.
Input: AH = 10h
AL 1Ah
Output: BH = Current page
BL = Current paging mode
= OOh (4 pages of 64 registers)
01 h (16 pages of 16 registers)
This subfunction reads the red, green, and blue values stored in the speci
fied color registers and performs the following weighted sum:
Input: AH = 10h
AL 1Bh
BX = Color register to start with
CX = Count of how many to sum
Output: None
Description
The Load Character Generator function consists of fifteen subfunctions, all
of which, in one way or another, permit the loading and/or enabling of text
mode and graphics mode character generators (fonts).
continued
continued
Subfunction: AL = 01h Load ROM 8x14 text mode font [EGA] [VGA]
This subfunction loads the ROM-resident 8x14 font into the memory map 2
block indicated in BL. Use this subfunction to override the BIOS default char
acter block location for 8x14 character video modes. For fonts in graphics
mode, see INT 1Oh, Function 11 h, subfunctions 20h-24h.
Input: AH = 11h
AL = 01h
Output: None
Subfunction: AL = 02h Load 8x8 double dot text mode font [EGA] [VGA]
This subfunction loads the ROM-resident 8x8 font into the character block
indicated in BL. Use this subfunction to override the BIOS default character
block location for 8x8 character video modes. For fonts in graphics mode,
see INT 1Oh, Function 11 h, subfunctions 20h-24h.
Input: AH = 11h
AL = 02h
Output: None
continued
Subfunction: AL = 03h Set block specifier (text modes only) [EGA] [VGA]
EGA- and VGA-compatible hardware allows the user to display up to 512
text mode characters at a time. However, in text modes, all character font
bit patterns are ~tored in 8K blocks in video memory map 2. Each 8K block
can store up to 256 characters. In order to display 512 text mode characters
special steps need to be taken to allow end user software to select between
either of two possible 8K character blocks.
This supfunctionsets up the video hardware so that bit 3 of each text mode
attribute byte can select between either of two memory map 2 character
blocks, thus allowing up to 512 characters to be displayed in any text mode.
Characters are selected according to the rules below:
• The value of bits 4, 1, and 0 of BL set by this subfunction indicates the
first character block; the value of bits 5, 3, and 2 in BL indicates the
second character block.
• The value of bit 3 of each character attribute byte determines from which
character block a given ASCII character will be selected.
• When bit 3 = 0, the character is selected from the block defined by bits
a
4, 1, and input into BL.
• When bit 3 = 1, the character is selected from the block defined by bits
5,3, and 2 of BL.
~ If bits 4, 1, and 0 = bits 5, 3, and 2, then bit 3 of the character attribute
byte toggles foreground intensity on or off. When two character blocks are
selected, Function AX = 1000h BX = 0712h will ensure that eight consis
tent color planes are set.
Note: To make a loaded character block active, this subfunction must be
run after any load character block subfunction.
Input: AH = 11 h
AL = 03h
Output: None
continued
This subfunction loads the ROM-resident 8x16 font into the character block
indicated in BL. Use this subfunction to override the BIOS default character
block for 8x16 character block modes. For fonts in graphics mode, see INT
1Oh, Function 11 h, subfunctions 20h-24h.
Input: AH = 11h
AL = 04h
Output: None
continued
Subfunction: AL =
10h
Load user text mode font (after mode set) [EGA] [VGA]
This subfunction loads the user character set defined in the table pointed to
by ES: BP to the character block indicated BL.
Input: AH = 11 h
AL = 10h
Output: None
Subfunction: AL =
11 h
Load ROM 8x14 text mode font (after mode set) [EGA] [VGA]
This subfunction loads the ROM 8x14 font into the character block indicated
in BL. Bytes/characters (point size), number of display rows, cursor and
underline parameter, and display buffer length are recalculated. Use this
subfunction to override the BIOS-defined font for the text mode in question.
Input: AH = 11 h
AL = 11 h
Output: None
continued
Subfunction: AL 12h =
Load ROM 8x8 double dot text mode font [EGA] [VGA]
This subfunction loads the ROM 8x8 font into the character block indicated in
BL. Bytes/character (point size), number of display rows, cursor and under
line parameters, and display buffer length are recalculated. Use this subfunc
tion to override the BIOS-defined font for the text mode in question.
Input: AH = 11 h
AL 12h
BL = Block to load
Output: None
This subfunction loads the ROM 8x16 font into the character block indicated
in BL. Bytes/character (point size), number of display rows, cursor and
underline parameters, and display buffer length are recalculated. Use this
subfunction to override the BIOS-defined font for the text mode in question.
Input: AH 11 h
AL 14h
BL = Block to load
Output: None
The 8x16 text mode font is not available in EGA adapters. As such, the
registers programmed by subfunction 14h are a subset of all VGA CRTC
registers. Because of this, the font downloaded by this subfunction must be
relatively close in size to the default font associated with the current video
mode. To prevent unpredictable results, these subfunctions should only be
called after a mode set call (I.e., INT 1Oh, AH = OOh Set Video Mode).
continued
Subfunction: AL = 20h
Set user graphics font pointer at INT 1Fh (8x8 font) [EGA] [VGA]
This subfunction sets the graphics font pointer to the vector contained in INT
1Fh. The INT 1Fh vector is specified in ES:BP. The font table pointed to is
used by applications programs running on EGA or VGA adapters that are set
to modes 04h - 06h, the CGA graphic modes. The graphics character set
loaded can contain bit patterns for ASCII characters 80h-FFh.
Input: AH = 11h
AL = 20h
• The character generators for all graphics modes are contained within the
video BIOS. The ROM BIOS-based character generators for graphics VGA
modes ODh to 13h contain all 256 ASCII characters.
• The character generators for graphics modes 04h, 05h, and 06h, (CGA
compatible graphics modes), contain only the first 128 ASCII characters.
The remaining 128 ASCII characters (extended ASCII characters 80h-FFh)
may be supplied by the user. All user-supplied character sets must be
vectored to a memory location pointed to by INT 1Fh. In general, these
user-supplied character sets are built into an 8x8 character box.
• The DOS command GRAFTABL loads a graphic table which allows modes
04h, 05h, and 06h to display extended ASCII characters. Vectoring INT
1Fh to point to the DOS GRAFTABL graphics table is the usual method of
providing user-supplied extended ASCII characters.
continued
Subfunction: AL = 21 h
This. subfunction sets the graphics font pointer to the vector contained in INT
43h. To avoid unpredictable results, this function should be called only after
a mode set (INT 10h, AH = OOh Set Video Mode) .The INT 43h vector is spe
cified in ES:BP.
Input: AH = 11h
AL = 21h
= ~Oh if user-supplied
01 h = 14 (OEh) rows
02h = 25 (19h) rows
03h = 43 (2Bh) rows
CX = Points (bytes/character)
Output: None
Subfunction: AL = 22h Use ROM 8x14 font for graphics [EGA] [VGA]
This subfunction specifies the use of the ROM-based 8x14 font in EGA and
VGA graphics modes. Use it to display the 8x14 font in non-8x14 font graph
ics modes. To avoid unpredictable results, this function should be called only
after a mode set (INT 10h, AH = OOh Set Video Mode). This subfunction
should be used in conjunction with subfunction AH = 11 h, AL = 21 h, Set user
graphics font pointer at INT 43h.
Input: AH = 11 h
AL 22h
BL Row specifier
= OOh if user-supplied
01 h = 14 (OEh) rows
02h = 25 (19h) rows
03h = 43 (2Bh) rows
DL = Rows per screen (if BL = OOh):
Output: None
continued
Subfunction: AL = 23h
Use ROM 8x8 double dot font for graphics [EGA] [VGA]
This subfunction specifies the use of the ROM-based 8x8 font in EGA and
VGA graphics modes. Use it to display the 8x8 font in non-8x8 font graphics
modes. To avoid unpredictable results, this function should be called only
after a mode set (INT 1Oh, AH = ~Oh Set Video Mode). This subfunction
should be used in conjunction with subfunction AH = 11h, AL = 21h, Set user
graphics font pointer at INT 43h.
Input: AH = 11 h
AL = 23h
BL = Row specifier
= OOh if user-supplied
01 h = 14 (OEh) rows
02h = 25 (19h) rows
03h = 43 (2Bh) rows
DL = Rows per screen (if BL = OOh)
Output: None
AL = 24h
BL = Row specifier
= OOh if user-supplied
01 h = 14 (OEh) rows
02h = 25 (19h) rows
03h = 43 (2Bh) rows
DL = Rows per screen (if BL = OOh)
Output: None
continued
Input: AH = 11 h
AL = 30h
BH = Font pointer, where:
= ~Oh
Return current INT 1Fh pointer
= 01 h Return current INT 43h pointer
= 02h Return ROM font 8x14 pointer
= 03h Return current ROM 8x8 font pointer
= 04h Return current ROM 8x8 font pointer (top)
= OSh Return current ROM 9x14 font alternate
= 06h Return current ROM 8x16 font pointer
= 07h Return current ROM 9x16 font alternate
= >07h Returns all registers (including AX) preserved
Output: CX = Bytes per character
Description
The Alternate Select function contains several subfunctions. Each subfunction
allows the user to enable or disable certain operations that are standard
video mode defaults. For example, on VGA adapters the video BIOS auto
matically programs the DAC color registers each time the video mode is set.
Alternate Select subfunction AL = 31 h allows the user to selectively enable or
disable DAC programming on mode set.
continued
BL = 10h
01 h = 128K available
CH = Adapter bits
CL = Switch settings
continued
0 0 5
1 0 6
2 1 5
3 1 6
4-7 Reserved
On VGA adapters, the bits of the switch settings byte give the settings of the
EGA's configuration DIP switch (where 1 = off, 0 = on). Color = 09h and
monochrome = OBh.
0 Configuration switch 1
1 Configuration switch 2
2 Configuration switch 3
3 Configuration switch 4
4-7 Reserved
continued
Subfunction: BL =30h Select scan lines for text modes [EGA] [VGA]
BL = 30h
Output: AL = 12h Function is supported
• The number of scan lines indicated in AL will take effect upon the next
mode set.
• The VGA BIOS loads the font associated with the mode/scan line combina
tion upon the next mode set.
• 200-line scan modes are double-scanned. Each video line is painted
twice before the next new line is begun.
Subfunction: BL = 31 h
Enable/disable default palette loading during set mode [VGAl
If AL = 01 h is selected, no updates are made to the overscan color register,
the attribute color registers or the DAC color registers when a video mode is
set.
Input: AH = 12h
AH = OOh
continued
Input: AH = 12h
= 01 h Disable video
BL = 32h
Input: AH = 12h
= 01 h Disable summing
BL = 33h
BL = 34h
continued
Input: AH = 12h
AL = OOh Turn off initial video adapter. The user must establish
a 128-byte save area pointed to by ES:DX
= 01 h Turn on initial system board video
= 02h Disable active video. The user must have a save
buffer pointer in ES:DX
= 03h Enable inactive video. The user must have a pointer
in ES:DX to a previously filled save buffer
BL =
35h
ES: DX = Pointer to a 128-byte save buffer area
Output: AL = 12h Function is supported
When there is no conflict between the system video and an adapter video
board, both video devices are active and use of this subfunction is not
necessary.
Input: AH = 12h
AL = 01 h Screen off
= OOh Screen on
BL = 36h
Description
The Write String function operates similarly to Write Teletype to Active Page
Function (AH = OEh), except that an entire string is handled with each call.
The AL register contains two single-bit fields differentiated as follows:
Input/Output
Input: AH = 13h
ES:BP = Pointer to start of string
BH = Page number (for text modes)
BL = Attribute for characters (graphics modes)
CX = Length of string (attributes don't count)
DX = Starting cursor position (DH = row, DL = column)
AL = OOh Cursor not moved.
= 01h Cursor is moved.
= 02h Cursor not moved (text mode only)
= 03h Cursor is moved (text mode only)
Output: None
Description
The Read/Write Display Combination Code function has two subfunctions,
one devoted to reading the display codes (AL = OOh) and one devoted to
writing the display combination codes (AL = 01 h). In either case, the display
code for the active monitor is specified in BL. The display code for the in
active monitor (if any) is specified in BH.
Code Description
continued
Input: AH 1Ah
AL = 01 h
Description
This function outputs a table describing the current state of the video hard
ware to a 40h-byte buffer location pointed to by ES:DI.
Input/Output
Input: AH = 1Bh
Error conditions
The BIOS will accept only one implementation type: BX = OOOOh. If a value
other than OOOOh is input into BX, this function returns the following values:
• AH = 1Bh
• AL = OOh
• All other registers are preserved.
continued
continued
continued
Introduction
At any time. the savable portion of the current video state consists of three
discrete parts:
Hardware State The contents of the CRT. Attribute. and Graphics Control
ler registers.
Video BIOS State Those areas In the BIOS Data Area In system RAM contain-
Ing video Information.
Digital/ Analog Converter The contents of the DAC control and color registers.
(DAC) State
Description
The Save/Restore Video State function consists of three subfunctions that
enable the user to save (and subsequently restore) any or all of the three
states making up the current video state.
continued
Error handling
Upon entry into the Save/Restore Video State function, the BIOS checks the
parameter passed in the AL register. If it is out of range (i.e., greater than
02h), then the function returns with AL = OOh and AH preserved.
Offset Description
AL = OOh
continued
Input: AH = 1Ch
AL = 01h
Warning
Saving a video state alters the original contents of the registers or data
areas involved. To maintain the current video state, execute the
Restore current video state subfunction immediately after saving the
video state.
Input: AH = 1Ch
AL = 02h
continued
I/O
Offset Address Index Description
continued
continued
1/0
Offset Address Index Description
continued
continued
System RAM
Offset (hex) Size Description
continued
I/O
Offset Address Index Description
Overview
Description
The BIOS Diskette Service performs read, write, format, diagnostic, initializa
tion and other operations for up to two internal diskette drives.
The BIOS Diskette Service has eleven functions. Individual functions are
selected via the AH register.
continued
For a discussion of the BIOS Fixed Disk Service, refer to Chapter 11.
In this chapter
This chapter focuses on the BIOS Diskette Service INT 13h. The following
topics are discussed:
• Summary of Functions
• Theory of Operations
• Hardware Environment
• System RAM Data
• CMOS RAM Data
• ROM BIOS Data
• Diskette Service 1/0 Ports
• Error Handling
• Diskette Service Functions
• INT OEh Diskette Hardware Interrupt
Function
Description Platforms
OOh
Reset Diskette System [XT] [AT]
01h
Read Diskette Status [XT] [AT]
02h
Read Diskette Sectors [XT] [AT]
03h
Write Diskette Sectors [XT] [AT)
04h
Verify Diskette Sectors [XT] [AT]
OSh
Format Diskette Track [XT] [AT]
OSh-07h
Reserved Reserved
Cah
Read Drive Parameters [AT]
09h-14h
Reserved Reserved
1Sh
Read Drive Type [AT]
16h
Detect Media Change [AT]
17h
Set Diskette Type [AT]
1ah
Set Media Type for Format [AT]
Legend Description
Introduction
Diskettes remain the fundamental media for transfer of information in _the
microcomputing world. New software is shipped on diskettes. and despite
the proliferation of networks. software in the workplace is still primarily
transferred by diskette.
This chapter contains general information about diskette drives and specific
information on how the BIOS manipulates the diskette drives.
Ordinarily. programmers will (and should) use the DOS INT 21 h diskette
functions. INT 21 h itself calls the BIOS Diskette Service functions. However,
for certain types of applications (games programming, copy protection
schemes), a programmer may want to use the BIOS Diskette Service
directly, or may even want to bypass the BIOS and write directly to the
diskette hardware.
Diskette sizes
The diskette drives commonly supported by pes come in two sizes - 5.25
inch and 3.5 inch. The 5.25-inch diskette drive supports standard formats of
360K, 720K, or 1.2 MB. The 720K format is not as widely supported as the
360K and 1.2MB standards.
3.5-inch diskette drives have been available for several years. Many IBM
compatibles support both 720K and 1.44 MB variants of the 3.5-inchdiskette
drive.
continued
Diskette terms
The reader should be familiar with the following diskettes terms:
• Head
The head contains an electromagnet, positioned on a movable assembly
just above the surface of the diskette. By pulsing the electromagnet, the
head reads or writes data to or from the diskette.
• Track
While the head is positioned over a point on the diskette, ready to read or
write, the diskette surface spins underneath it, tracing a full circle. This
circle is a track. There may be 40 to 80 tracks per diskette surface, or
side.
• Sector
Diskette systems divide each track into short arcs (usually 9, 15, or 18
per track) called sectors. Each sector usually holds 512 bytes of data.
• Sector size
Using Diskette Service function 03h, the caller can change the diskette
sector size, but then must carefully control diskette use while the different
sector size is used. The caller must also make sure that the sector size is
set to 512 bytes for the use of other applications when his routine com
pletes its functions.
• Change line
Some diskette drives support a disk change line signal that is set if the
drive door is opened. The BIOS checks the change line signal before each
diskette I/O operation.
continued
Head
Moves
In and Out
Tracks Side 0
Sectors
continued
After the diskette controller has performed the command and transferred
data, an interrupt is generated by the diskette controller. INT OEh, the dis
kette ISR, handles the interrupt, setting bit 7 of location 40:3Eh. INT 40, the
diskette DSR, monitors location 40:3Eh for up to one second, waiting for the
interrupt.
The interrupt indicates that one or more (a maximum of 7) result bytes may
be waiting for INT 40h to read. If there is no interrupt, the time-out bit in
40:41h is set by INT 40h.
Hardware assumed
The NEG 765 diskette controller chip (or its equivalent) and some additional
logic is used to control the diskette drives.
The diskette status information at location 40:3Eh contains a bit for each
diskette drive that indicates if a drive should be recalibrated. The BIOS
automatically instructs the diskette controller to recalibrate a drive, if
necessary.
continued
Many European models support 720K 5.25-inch diskette drives, but support
for these types of drives is rare in the US (the Phoenix BIOS supports them).
Newer AT systems support both 3.5-inch and !5.25-inch diskette drives, but
older AT systems may only support 5.25-inch drives.
The Phoenix BIOS Diskette Service supports six types of diskette drives. Not
all BlOSs support all diskette drive types on all XT and AT systems.
continued
360K 360K drive 360K drives 1.2 MB drives 360K drives only
1.2 MB 1.2 MB drive 1.2 MB drives 1.2 MB drives
continued
10b= Reserved
11 b= Reserved
continued
continued
continued
40:92h 2 Bytes Diskette Service work area. Each entry is the first
media type value tried. One byte per drive. Drive 0
at 92h, Drive 1 at 93h.
40:94h 2 Bytes Current track number for both drives. One byte
per drive. Drive 0 at 94h, drive 1 at 95h.
40:AOh 2 Bytes Wait active flag, where:
Bit 7 = 1 Wait time elapsed
Bits 6-1 = Reserved
Bit 0 = 1 INT 15h, AH = a6h occurred
Introduction
The Diskette Service routine makes use of control information located in
CMOS RAM data areas OEh through 10h. The table below provides detailed
information about the areas used.
CMOS RAM
Description
The diskette device service routine in PC/XT / AT systems contains a table of
parameters used to manipulate diskette drives. For many newer systems,
values have been modified so the table is more suitable for use with 3.5
inch diskette drives. Both 3.5-inch and 5.25-inch values are provided below.
The default 11-byte table is located in ROM at FOOO: EFC7h and is pointed to
by the interrupt 1Eh vector. This arrangement allows operating systems or
application programs to change the INT 1Eh vector to point to a different set
of diskette parameters.
Offset Description
continued
Offset Description
OSh Bytes per sector. This field is encoded in the following way to
match the encoding used by the diskette controller:
OOh = 128 bytes per sector
01h =2S6 bytes per sector
02h =S12 bytes per sector (default value)
03h =1024 bytes per sector
04h The number of sectors per track. For a 1.44 MB diskette in the
1.44 MB drive, this field is 18 sectors per track. The range of
values Is:
08h =8 sectors per track (320K drive)
09h =9 sectors per track (360K/720K S.2S-lnch drive)
1Sh =15 sectors per track (S.2S-lnch 1.2 MB drive)
18h =18 sectors per track (S.S-Inch drives)
OSh Gap length. The length of the gap between sectors. 1Bh for a
S.5-inch diskette drive and 2Ah for a 5. 25-lnch diskette drive.
06h Data length. Since the bytes per sector field Is nonzero, this field
is meaningless and Is set to FFh.
07h Gap length for format. The length of the gap between sectors to
maintain when formatting. The format gap length is 6Ch for a
3.S-inch drive and 50h for a S.25-inch drive.
08h Fill byte for format. The default Is F6h.
09h Head settle time. The amount of time In milliseconds the diskette
DSR must walt for the heads to settle after doing a seek opera
tion. For a 3. 5-inch diskette drive, this field is OFh. 1.2 M B
drives require 15 milliseconds and 360K drives, 20 - 25
milliseconds.
OAh Motor start time. The amount of time In eighths of a second that
the diskette DSR must wait for the motor to come up to speed
before doing an I/O operation. Most drives have a motor start
time of one second so the default value Is 08h for most opera
tions, except Read and Verify, where the default value is either
04h or OSh.
Read/Write
I/O Address Status Description
Read/Write
1/0 Address Status Description
continued
Read/Write
I/O Address Status Description
Introduction
The BIOS Diskette Service returns the completion status of each function via
the AH register. the Carry Flag. and the Diskette Status data definition.
located at 40:41h.
Result bytes
The BIOS stores all result bytes returned by the diskette controller in the
seven-byte location starting at 40:42h. Usually there are four to seven result
bytes.
Successful functions
Successful functions return as follows:
• AH = OOh (No error)
• Diskette Status (40:41 h) = AH
• Carry Flag = 0 (cleared)
Unsuccessful functions
Unsuccessful functions return as follows:
• AH = xxh (an error code - see the following page)
• Diskette Status (40:41 h) = Error code
• Carry Flag = 1 (set)
continued
OOh No error
01h Invalid function request
02h Address mark not found
03h Write attempted on write-protected disk
04h Sector not found
06h Diskette change line active
OBh DMA overrun
09h DMA boundary error
OCh Media type not available
10h Bad CRC
20h Diskette controller failed
40h Seek failed
BOh Time-out
Description
This function resets both the diskette controller and the specified diskette
drive (the R/W arm is moved to track 0). The diskette drive number (either
OOh or 01 h) is specified in DL.
Function failure
Call this function when a problem occurs in attempting to access the diskette
subsystem with any other function, then retry the function that failed. The
diskette subsystem will not react immediately. Instead, a reset flag forces
the BIOS to recalibrate the diskette drive's read/write heads the next time
they are used. The heads are relocated to track 0 in order to start the next
110 operation from a known state.
Input/Output
Input: AH = OOh
DL = Drive number
Bit 7 = o for a diskette
1 for a fixed disk
Output: AH = OOh No error
xxh Error (See error code table earlier in this chapter)
= Diskette Status (40:41 h)
CF = o No error
= 1 Error
Description
The BIOS Diskette Service stores the error code associated with the last
requested function in Diskette Status (40:41 h). If the last function executed
successfully, the Diskette Status and AH are set to OOh. If the last function
was not successful, AH and the Diskette Status are set to the appropriate
nonzero error code.
This function reads the value contained in Diskette Status and returns it in
the AH register. CF is not set by this function.
Input/Output
Input: AH = 01h
Description
This function reads data from the number of sectors specified in AL from the
drive specified in DL to the buffer specified in ES:BX.
The diskette drive head number is specified in DH. Starting track and sector
numbers are specified in CH and CL.
This function is useful for block move operations that require reading many
individual sectors or a whole trackful of sectors. For example, the DOS
DISKCOPY command uses this function.
Input/Output
Input: AH = 02h
AL = Number of sectors (1-18, depending on drive media
type)
CH = Track number (0-79, depending on drive media type)
CL = Sector number (1-18, depending on drive media type)
DH = Head number (0-1)
DL Drive number
ES:BX = Pointer to buffer
Output: AL Number of sectors read/written
AH = DOh No error
xxh Error (See error code table earlier in this chapter)
= Diskette Status (40:41 h)
CF = 0 No error
= 1 Error
Description
This function writes data to the number of sectors specified in AL on the
drive specified in DL from the buffer specified in ES:BX.
The diskette drive head number is specified in DH. Starting track and sector
numbers are specified in CH and CL. Diskette sectors must be formatted
before they can be written to.
Input/Output
Input: AH = 03h
AL = Number of sectors (1-18, depending on drive media
type)
CH = Track number (0-79, depending on drive media type)
CL = Sector number (1-18, depending on drive media type)
DH = Head number (0-1)
DL Drive number
ES:BX = Pointer to buffer
Output: AL = Number of sectors read/written
AH = OOh No error
xxh Error (See error code table earlier in this chapter)
= Diskette Status (40:41 h)
CF = 0 No error
= 1 Error
Description
This function verifies the address fields of the number of sectors specified in
AL from the drive specified in DL to the buffer specified in ES:BX.
The diskette drive head number is specified in DH. Starting track and sector
numbers are specified in CH and CL. No data is transferred from the dis
kette in this operation. Diskette data is not compared to data in memory.
First invoke function OOh. then invoke function 04h. If no diskette is present,
AH will contain a nonzero value and the Carry Flag will be set. Retry three
times to make sure that no other error condition is occurring.
InputlOutput
Input: AH = 04h
AL = Number of sectors (1-18. depending on drive media
type)
CH = Track number (0-79. depending on drive media type)
CL = Sector number (1-18. depending on drive media type)
DH Head number (0-1)
DL = Drive number
ES:BX = Buffer with address field data
Output: AL = Number of sectors actually transferred
AH = OOh No error
= nnh Error (See error code table earlier in this chapter)
Diskette Status (40:41h)
CF = 0 No error
= 1 Error
Description
This function formats a single diskette track on the drive specified in DL. The
format operation consists of writing the diskette sector and track address
field data on the specified track. The number of sectors is specified in AL,
the head number in DH, and the track number in CH. Each call to 'function
05h of the Diskette Service, can be verified by following it with a call to
function 04h.
ES: BX points to a table defining the address fields for the track being
formatted.
If the diskette drive in question supports more than one diskette format, the
caller must invoke either Diskette Service Function AH = 17h Set Diskette
Type or AH = 18h Set Media Type for Format before calling this function.
Input/Output
Input: AH = 05h
AL = Number of sectors to be formatted (starts at one)
DH = Head number
DL = Drive number
CH = Track number (starts at 0)
ES: BX = Address field buffer
Output: AH = OOh No error
= 80h Specified diskette drive does not exist
= xxh Error (See error code table earlier in this chapter)
Diskette Status (40:41 h)
CF = 0 No error
= 1 Error
continued
Byte Description
0 Track number
1 Head number - zero based
2 Sector number
3 Sector Size indicator, where:
OOh = 128 bytes/sector
01h = 256 bytes/sector
02h = 512 bytes/sector
03h = 1024 bytes/sector
Copy protection
Function 05h can be used for copy protection by:
• squeezing more sectors onto a track.
• rearranging the order of the sectors.
• leaving out a sector number.
• specifying 1 or more sectors to be an unconventional size.
• adding a sector with an unconventional address mask.
Description
This function returns the diskette parameters for the drive specified in Dl. If
successful, the Carry Flag is cleared and Diskette Status (40:41 h) is not
modified.
The drive type stored in CMOS RAM determines the parameters returned. If
the drive type is not stored in CMOS RAM, all registers return a value of
zero, except Dl, which contains the number of diskette drives installed.
continued
Input/Output
Input: AH = 08h
DL = Drive number
Output: AX = OOOOh
BH = OOh
BL Bits 4-7 = 0
Bits 0-3 = Valid drive type value from CMOS RAM
01h = 5.25", 360K, 40 track
02h = 5.25", 1.2 MB, 80 track
03h = 3.5", 720K, 80 track
04h = 3.5", 1.44 MB, 80 track
CF = 0 No error
= 1 Invalid parameter
CH Maximum usable track number
CL Maximum usable sector number
DH = Maximum usable head number
(always 1 if CMOS RAM value valid)
DL Number of diskette drives installed (OOh, 01 h, or 02h)
ES:DI = Pointer to diskette drive parameter table for
the maximum media type supported on the
specified drive
Description
This function returns information about the drive specified in DL.
Unlike most other BIOS Diskette Service functions, the value returned in the
AH register by this function is not an error code. Instead, the value returned
in AH corresponds to one of the four indicators described in the table below.
AH Value Meaning
Input/Output
Input: AH = 15h
DL = Drive number
Description
This function determines if the drive door has been opened since the last
time the change line was cleared. The change line signal is generally asso
ciated with 3.5-inch diskette drives.
If the drive number is not valid, the Carry Flag is set, AH is set to 01h, and
control is returned to the caller.
If the specified diskette drive is not configured, AH and Diskette Status are
set to 80h (time-out), CF is set, and control is returned to the caller.
If the change line is not supported. AH and Diskette Status are set to 06h
(media change), CF is cleared, and control is returned to the caller.
Input/Output
Input: AH 16h
DL = Drive number
Output: AH = OOh Diskette change line signal not active
01 h Invalid drive number
= 06h Either change line not supported or
diskette change line signal is active
80h Diskette drive not ready or no drive present
Diskette Status (40:41 h)
CF = 0 No error
= 1 Error
Description
This function sets the transfer rate for the specified drives using the diskette
types passed in AL. This function is provided for use with DOS 3.0 or 3.1.
Function 1Bh replaces this function for DOS versions 3.2 and above.
The media transfer rate is set according to the drive type specified. For
diskette types 02h, 03h, and 04h, the change line determines if there is a
piskette in the drive. If there is no diskette in the drive, AH and Diskette
Status are set to BOh (time-out), OF is set, and control is returned to the
caller. If a diskette is present, Diskette Status is set to OOh and the following
values are set according to the diskette type in AL.
Input/Output
Input: AH = 17h
AL ~Oh Unused
01 h 360K diskette in 360K drive
= 02h 360K diskette in 1.2MB drive
03h 1.2 MB diskette in 1.2 MB drive
= 04h 720K diskette in 720K drive
DL = OOh or 01 h Drive number
Output: AH = OOh No error
xxh Error (See error code table earlier in this chapter)
= Diskette Status (40:41 h)
OF a
No error
1 Error
Description
This function sets the media type in preparation for a format command.
If the drive number is invalid, the Carry Flag (CF) is set and control is re
turned to the caller with both AH and Diskette Status (40:41h) = 01h. If the
drive type can't be determined, AH and Diskette Status are set to OCh
(unknown media), CF is set, and control is returned to the caller.
If there are no problems with the values returned by this function, the BIOS
selects a diskette parameter table based on the data input to this function.
ES:DI pOints to the chosen diskette parameter table, AH and Diskette Status
are set to DOh, CF is cleared, and control is returned to the caller.
continued
Input/Output
Input: AH = 18h
DL Drive number
CF = o No error
1 Error
Introduction
The BIOS Diskette Interrupt Service Routine (ISR) services interrupts from the
diskette controller.
The INT OEh entry point is located at address FOOO:EF57h. INT OEh resides at
address 38h in the interrupt vector table.
Calling INT 15h allows other tasks in the system to process while diskette 1/0
is in progress. However, this multitasking must be implemented by user
supplied programs executing in the microprocessor's real address mode.
INT OEh sets bit 7 of the diskette drive recalibrate status byte (40:3Eh,) and
calls INT 15h with AH = 91 hand AL = 01 h Interrupt Complete. It then sets bit
7 of (40:3Eh) to signal the completion of the command.
continued
ReadlWrite
1/0 Address Status Description
Overview
Description
The BIOS Fixed Disk Service performs read, write, format, diagnostic, initiali
zation and other operations for up to two fixed disk drives.
continued
In this chapter
This chapter focuses on the BIOS Fixed Disk Service. The following topics
are presented:
• Fixed Disk Service Function Summary
• Theory of Operations
• Hardware Environment
• System RAM Data
• CMOS RAM Data
• ROM BIOS Data
• Fixed Disk Service I/O Ports
• Error Handling
• Fixed Disk Service Functions
Legend Description
History
Fixed disks were not supported in the original IBM PC. The IBM XT, intro
duced later, contained the first fixed disk controller, supporting only one
fixed disk drive. XT -type fixed disk controllers are still in use today, even in
some AT-compatible systems. Today, most XT-type fixed disk controllers
support two or more fixed disk drives.
The mechanical part of a fixed disk drive includes a spindle (a shaft that
connects directly to the disk drive motor), and disk platters (upon which
data is actually written). The motor spins the disk platter at a precisely con
trolled speed. The only other mechanical part is the arm, upon which the
read/write heads are mounted. The arm allows the heads to move freely just
above the disk surface so that the heads can be placed anywhere between
the inner and outermost part of the surface. Fixed disks usually have many
read/write heads and both sides of the disk platters are used. There is one
read/write heads positioned just above the surface of each side of the disk
platter. The graphic on the following page describes these terms.
continued
continued
Moves
Head
In and Out
.;~~t±~~~~~ZZt:::3 n) • • • •••
Tracks are further subdivided into sectors. Sectors usually store 512 bytes. but the
sector size can also be changed with INT 13h. AH = 05h. The bytes in a sector must
be organized in a prescribed manner. There can be 17. 26. 34 or more sectors per
track.
Tracks Side 0
Sectors
continued
The BIOS uses the DMA controller to move data directly to and from system
memory without the intervention of the microprocessor.
The fixed disk controller communicates directly between the fixed disk drive,
the processor, and system memory. It uses DMA channel 2 to access
memory.
The following graphic depicts the relationship between the processor, system
memory, the DMA channel, the fixed disk controller, and the fixed disk drive.
System
Memory <: DMA Channe'
Fixed Disk
Controller
f'J ...
Read &'
commanf Write oat,!
,
.
~Re.u,to
01
Step
01 Control
Processor .... Fixed Disk
Drive
r'
...
Motor'
COmmand? Control
Selectio'!..
~
continued
There are several methods of data encoding used by ST506 fixed disk con
trollers. The most frequently used methods are:
• MFM - modified frequency modulation,
• RLL - run length limited, and
• ARLL - advanced run length limited
continued
The end user can also use a BIOS utility program, such as the Phoenix
SETUP utility, to change the fixed disk drive type table to ensure that the
fixed disk drive is supported.
In AT systems, a SETUP utility must be used. The user needs to know sev
eral facts about the fixed disk drive, including the:
• cylinder write precompensation value,
• number of heads,
• number of cylinders,
• number of sectors per track,
• landing zone value, and
• capacity.
The user can look up the fixed disk drive type table stored in the system
BIOS (usually the SETUP help facility provides this information) and find the
drive type that matches the characteristics of his fixed disk drive.
Some BlOSs provide editable drive types. Phoenix BlOSs provide types 48
and 49, which the user can modify by entering the parameter values of the
fixed disk drive with the SETUP utility. The data is automatically stored in
CMOS RAM.
Older XT-type fixed disk controllers may support only one fixed disk drive.
These controllers may be found in both AT and XT systems.
Note: The fixed disk drive values BOh or B1 h are required DL register
inputs for many of the INT 13h fixed disk services.
Introduction
The BIOS data area (address 400h - 500h) contains data definitions that are
referred to by the BIOS Fixed Disk Service.
continued
continued
The Phoenix default drive type table is shown below. We have included the
names of many popular fixed disk drive types for easy identification.
Write Landing
# Drive Type Cylinders Heads Precomp Zone Sectors
.....•
The OEM may have to disable drive connector J1 pin 2 when used on the AT .
Remove jumper W3 .
Values for Write Precomp of -1, 0, or the last track are assumed to be equivalent.
continued
-_. The OEM may have to disable drive connector J1 pin 2 when used on the AT.
Remove jumper W3.
••• Values for Write Precomp of -1, 0, or the last track are assumed to be equivalent.
continued
Write Landing
# Drive Type Cylinders Heads Precomp Zone Sectors
28 Micropolis 1325 ••• 1024 8 -1 1024 17
Mlniscribe 6085
Maxtor XT-1085 •••
29 512 8 256 512 17
30 Syquest SQ312RD .. 615 2 615 615 17
Minlscribe MS 8212 •••
31 CDC Wren II 9420-5-51 •• 989 5 0 989 17
32 1020 15 -1 1024 17
33 Reserved
34 Reserved
35 Seagate ST -4096 1024 9 1024 1024 17
Seagate ST -4144
Seagate ST -4144R 26
36 Mlnlscrlbe MS 6053 1024 5 512 1024 17
Microscience HH1050
37 830 10 -1 830 17
38 NEC 67 MB 823 10 256 824 17
39 NEC D5126H 20 MB 615 4 128 664 17
40 IBM 5.25" 40 MB 615 8 128 664 17
NEC D5146H
41 IBM 5.25" 114 MB 917 15 -1 918 17
42 IBM 5.25" 127 MB 1023 15 -1 1024 17
Priam IDED 130··
43 NEC 823 10 512 823 17
44 Seagate ST -251 40 MB 820 6 -1 820 17
45 Reserved
46 CDC Wren II (1) 925 9 -1 925 17
9415-5-86
• The OEM may have to disable drive connector J 1 pin 2 when used on the AT .
•• Remove jumper W3 .
••• Values for Write Precomp of -1. O. or the last track are assumed to be equivalent .
continued
Write Landing
# Drive Type Cylinders Heads Precomp Zone Sectors
47 699 7 256 700 17
Values for Write Precomp of -1, 0, or the last track are assumed to be equivalent .
If a table entry contains -1 as the entry for the beginning write precompen
sation cylinder, then there is no write precompensation for this fixed disk
drive type. If the write precompensation is zero, then there is write pre
compensation for all cylinders.
continued
The INT 13h Fixed Disk Service references the following I/O ports:
Read/Write
I/O Address status Description
Read/Write
110 Address Status Description
continued
Read/Write
I/O Address Status
Description
0020h W
OCW3 (Bit 4 Is zero, Bit 3 is one), where:
Bit 7 =0 Reserved
Bits 6-5 =00 No operation
=01 No operation
=10 Reset special mask
= 11 Set special mask
Bit 4 =0 Reserved
Bit 3 =1 Reserved
Bit 2 =0 No poll command
=1 Poll command
Bits 1-0 =00 No operation
= 01 No operation
=10 Read Interrupt request register on
next read at Port 0020h
=11 Read Interrupt in-service register on
next read at Port 0020h
0070h W
CMOS RAM address register port, where:
Bit 7 =1 NMI disable
=0 NMI enabled
Bits 6-0 =0 CMOS address
0071h R/W
CMOS RAM data register port
OOAOh R/W
Programmable Interrupt Controller 2
00A1h W
Programmable Interrupt Controller 2 mask, where:
Bit 7 =0 Reserved
Bit 6 = 0 Enable fixed disk interrupt
Bit 5 = 0 Enable 80387 exception interrupt
Bit 4 =0 Enable mouse interrupt
Bit 3 =0 Reserved
Bit 2 =0 Reserved
Bit 1 =0 Enable redirect cascade
Bit 0 =0 Enable real time clock interrupt
0170h R/W Fixed disk 1 data register (AT only)
0171h R/W Fixed disk 1 error register (AT only)
0172h R/W Fixed disk 1 sector count (AT only)
0173h R/W Fixed disk 1 sector number (AT only)
0174h R/W Fixed disk 1 cylinder low (AT only)
0175h R/W Fixed disk 1 cylinder high (AT only)
0176h R/W Fixed disk 1 drive/head register (AT only)
0177h R/W Fixed disk 1 status register (AT only)
01FOh R/W Fixed disk 0 data register (AT only)
01F1h R/W Fixed disk 0 error register (AT only)
continued
Read/Write
I/O Address Status Description
Error Handling
Introduction
Upon return from each function, the Fixed Disk Service indicates the result of
the operation with a numeric error code. This error code is returned in AH
and is stored in The Fixed Disk Status byte (40:74h).
Error codes
Successful functions return with
• AH and Fixed Disk Status (40:74h) set to ~Oh (i.e. Error Code = OOh,
no error)
• Carry Flag (CF) cleared
• AH and Fixed Disk Status (40:74h) set to one of 23 possible error codes
• Carry Flag set
continued
OOh No error
01h Invalid function passed in AH or invalid parameter
02h Address mark not found
04h Sector not found
OSh Reset failed
07h Drive parameter activity failed
OBh DMA overrun on operation
09h Data boundary error
OAh Bad sector flag detected
OBh Bad cylinder detected
ODh Invalid number of sectors on format
OEh Control data address mark detected
OFh DMA arbitration level out of range
10h Uncorrectable ECC or CRC error
11 h ECC corrected data error
20h Controller failure
40h Seek failed
BOh Time-out
AAh Drive not ready or not selected
BBh Undefined error
CCh Write fault on selected drive
EOh Status error/error register is 0
FFh Sense operation failed
Description
This function resets both the diskette and the fixed disk controllers. It places
both the diskette and the fixed disk systems in a known state by reinitializing
the fixed disk and diskette drive parameters and by recalibrating the read/
write heads positions of both devices to cylinder O.
The fixed disk drive number (either 80h or 81 h) is specified in DL. If suc
cessful, this function returns with AH set to OOh and the Carry Flag cleared.
Note: The diskette system is reset regardless of the drive number specified
in DL. To reset the fixed disk controller only, use Function AH = ODh.
Input/Output
Input: AH OOh
Output: AH = OOh No error
xxh Error (See error codes earlier in this chapter)
= Fixed Disk Status (40:74h)
CF = o
No error
= 1 Error
Description
This function returns Fixed Disk Status. the error code from the last opera
tion. in the AL register. Before returning to the caller this function sets Fixed
Disk Status and AH to OOh and clears the Carry Flag.
Error code 11 h. ECC Data Error. indicates that a recoverable error was de
tected during a preceding call to Function 02h Read Sectors. See the head
ing Error Handling earlier in this chapter for a complete list of all codes that
may be returned in AL.
Input/Output
Input: AH = 01 h
DL = Drive number
80h Fixed disk 1
81 h Fixed disk 2
Output: AH OOh No error
xxh Error (See error codes earlier in this chapter)
Fixed Disk Status (40:74h)
AL = Error code for last operation
Description
This function reads the number of sectors specified in AL from the drive
specified in DL to a buffer area defined by ES:BX. This function also reads
the two words of Error Correction Code (ECG) associated with that sector
and automatically corrects ECC errors. Multisector transfers are terminated
after any sector that has a read error. Cylinder number, sector number, and
head number are specified in CH, CL, and DH, respectively (see Input!
Output below).
If successful, this function returns with the Carry Flag cleared and AH = OOh.
The number of sectors specified in AL must not be zero or greater than 128.
Numbers greater than 128 cause a transfer of greater than 64K and thus
force a DMA boundary error.
Input/Output
Input: AH 02h
AL Number of sectors to read
CH = Cylinder num.ber (low 8 bits, zero-based1 \ 0 bAs
CL = Cylinder/sector number, where:
Bits 7-6 = cylinder numb~r (high 2 bits) =' \02'+ L"fL
continued
\024 x 64 x 2~b
:::- 1£ 1777 I 2 1 6
INT 13h Fixed Disk Service - ~.,+ G a 329
Function: AH = 02h Read Sectors, Continued [XT] [AT]
Error conditions
If it is unsuccessful, this function returns with the Carry Flag (CF) set and
the appropriate Fixed Disk Service error code in both AH and Fixed Disk
Status (40:74h).
The caller should retry this function at least three times, issuing the Reset
Function (AH = OOh) between retries, when an error condition occurs to
ensure that the error is not just a hardware timing problem.
Description
This function writes the number of sectors specified in AL to the drive speci
fied in DL from a buffer area defined by ES:BX. The fixed disk head number
is indicated in DH. Starting cylinder and sector number are indicated in CH
and CL as shown under the Input/Output heading below.
This function does not require a prior call to the Seek Function (AH = OCh).
The number of sectors specified in AL must not be zero or greater than 128.
Numbers greater than 128 cause a transfer of greater than 64K, and thus
force a DMA boundary error.
If successful, this function returns with the Carry Flag cleared and AH = OOh.
Input/Output
Input: AH = 03h
DL = Drive number
81 h fixed disk 2
continued
Error conditions
If unsuccessful, this function returns with the Carry Flag (CF) set and the
appropriate Fixed Disk Service error code in both AH and Fixed Disk Status
(40:74h) .
See the Error Handling heading earlier in this chapter for a list of possible
errors.
Description
This function verifies the number of sectors specified in AL on the cylinder,
head, and drive specified in CH, CL, and DH respectively. (See Input/Output
below.)
This function does not compare data on disk with data in memory. It merely
verifies that the specified sectors can be read and that the cyclical redun
dancy check (CRC) is correct. This function does not cause any data to be
transferred from memory to fixed disk or vice versa.
If successful, this function returns with the Carry Flag cleared and AH and
Fixed Disk Status (40:74h) set to OOh.
Input/Output
Input: AH = 04h
AL = Number of sectors to verify
CH = Cylinder number (low 8 bits, zero-based)
CL = Cylinder/sector number, where:
Bits 7-6 = cylinder number (high 2 bits)
Bits 5-0 = sector number
DH = Head number (zero-based)
DL Drive number
80h fixed disk 1
81 h fixed disk 2
Output: AH = OOh No error
= xxh Error (See error codes earlier in this chapter)
= Fixed Disk Status (40:74h)
AL = Number of sectors verified
CF o No error
1 Error
Error conditions
If unsuccessful, this function returns with the Carry Flag (CF) set and the
appropriate Fixed Disk Service error code in both AH and Fixed Disk Status
(40:74h) .
Refer to the Error Handling heading in this chapter for a table of error codes.
Description
This function formats the cylinder specified in CH and CL using the head
specified in DL.
If the system uses an XT -type fixed disk controller, INT 13h, AH = OFh
should be called before invoking this function.
Input/Output
Input: AH = 05h
AL Interleave factor (XT-type fixed disk controllers only)
CH Cylinder number (low 8 bits)
CL Cylinder/sector number, where:
Bits 7-6 = cylinder number (high 2 bits, zero-based)
Bits 5-0 = sector number
DH Head number (zero-based)
DL Drive number
80h fixed disk 1
81 h fixed disk 2
ES: BX = Pointer to table of 2-byte address field entries
Output: AH = OOh No error
= xxh Error (See error codes earlier in this chapter)
= Fixed Disk Status (40:74h)
CF a No error
= 1 Error
continued
80h is bad
Error conditions
If unsuccessful, this function returns with the Carry Flag (CF) set and the
appropriate Fixed Disk Service error code in both AH and Fixed Disk Status
(40:74h). For example, if a time-out error occurs during the execution of
this function, error code 80h is returned in both AH and Fixed Disk Status.
Refer to the Error Handling heading in this chapter for a table of error codes.
Description
This function initializes a track. writing fixed disk address fields and data
sectors and setting bad sector flags. It is designed for use with an XT -type
fixed disk controller.
For drive 80h. this function references the fixed disk parameter table pointed
to by the Interrupt 41 h vector. If successful. this function returns with AH
and 40: 74h set to zero.
Input/Output
Input: AH = 06h
AL Interleave factor
CH = Cylinder number
DH = Head number
DL = Drive number
80h fixed disk 1
81 h fixed disk 2
Output: AH 07h Drive number in DL is invalid
01 h Invalid function request
= ~Oh If operation is successful
xxh Error (See error codes earlier in this chapter)
Fixed Disk Status (40:74h)
CF = 0 No error
= 1 Error
Error conditions
If an error occurs when this function is invoked. issue a Function OOh to
reset the fixed disk controller. and retry this function at least three times.
If the drive number specified in DL is not valid. this function returns with AH
and location 40:74h set to 07h to indicate that the drive parameter activity
failed. AL. CX. and DX are cleared. the Carry Flag is set. and control is
returned to the caller.
Description
This function formats the entire fixed disk drive, writing disk address fields
and data sectors, starting at the specified cylinder. This function works only
with XT -type fixed disk controllers.
If successful, this function returns with AL and location 40: 74h set to OOh.
Input/Output
Input: AH
AL
=~
=
01
Interleave factor
CH Cylinder
DL Drive number
80h fixed disk 1
81 h fixed disk 2
Output: AH = 07h If drive number in DL is invalid
OOh No error
xxh Error (See error codes earlier in this chapter)
Fixed Disk Status (40:74h)
CF 0 No error
= 1 Error
Error conditions
If an error occurs when this function is invoked, issue a Function OOh to
reset the fixed disk controller, and retry this function at least three times.
If the drive number specified in DL is not valid, this function returns with AH
and location 40:74h set to 07h to indicate that the drive parameter activity
failed. AL, CX, and OX are cleared, the Carry Flag is set, and control is
returned to the caller.
Description
This function returns parameters associated with the fixed disk drive (either
80h or 81h) specified in DL.
For drive 80h. this function references the fixed disk parameter table pointed
to by the INT 41h vector. For drive 81h. the function references the INT 46h
vector. See the ROM BIOS Data heading in this chapter for the structure and
contents of the fixed disk parameter table.
If successful. this function returns with AL and Fixed Disk Status set to OOh.
The maximum usable cylinder number is returned in CH/CL. maximum usable
sector number in CL. maximum usable head number in DH. the number of
fixed disk drives contained in the system is returned in DL. and the address
of the fixed disk parameter table is returned in ES:DI.
Input/Output
Input: AH = 08h
DL Drive number
80h fixed disk 1
81 h fixed disk 2
Output: AH 07h If drive number in DL is invalid
= OOh If operation is successful
xxh Error (See error codes earlier in this chapter)
= Fixed Disk Status (40:74h)
AL = OOh
CF o No error
1 Error
CH Maximum usable cylinder number (low 8 bits.
zero-based)
(OOh if AH = 07h)
CL Cylinder/sector number. where:
Bits 7-0 = OOh if AH = 07h
Bits 7-6 = Maximum usable cylinder number (high 2 bits)
Bits 5-0 = Maximum usable sector number
DH Maximum usable head number
DL = Number of drives (zero-based. OOh if AH = 07h)
ES:DI Address of fixed disk parameter table
continued
Error conditions
If the drive number specified in DL is not valid. this function returns with AH
and Fixed Disk Status (40:74h) set to 07h to indicate that the drive parame
ter activity failed. AL. CX. and DX are cleared. the Carry Flag is set. and
control is returned to the caller.
Description
This function initializes the controller associated with the fixed disk drive
(either 80h or 81 h) specified in DL.
For drive 80h, this function references the fixed disk parameter table pointed
to by the Interrupt 41 h vector. For drive 81 h, the function uses the interrupt
46h vector. See the ROM BIOS Data heading in this chapter for the structure
and contents of the fixed disk parameter table.
If successful, thiS function returns with AH and Fixed Disk Status (40:74h) set
and the Carry Flag cleared.
Input/Output
Input: AH = 09h
DL = Drive number
81 h fixed disk 2
CF = 0 No error
= 1 Error
Error conditions
If unsuccessful, the Initialize Drive Parameters function returns with AH and
Fixed Disk Status (40:74h) equal to 07h. This indicates that drive parameter
activity has failed.
Note: The Initialize Drive Parameters function generates only two valid
return codes:
AH = Fixed Disk Status = OOh = Function successful
AH Fixed Disk Status = 07h = Function unsuccessful,
drive parameter activity has failed.
Description
This function reads one or more sectors from the fixed disk specified in Dl.
This function also reads the four to seven bytes of Error Correction Code
(ECC) associated with that sector, but does not automatically correct ECC
errors (Function 02h automatically corrects ECC errors). Multisector transfers
are terminated after any sector that has a read error. Cylinder number,
sector number, and head number are specified in CH, Cl, and DH, respec
tively.
This function does not require a prior call to the Seek Function (AH = OCh).
This function is normally reserved for diagnostics and should not be used for
normal reads from the fixed disk.
If successful, this function returns with the Carry Flag cleared and AH and
Fixed Disk Status (40:74h) equal to zero.
Input/Output
Input: AH OAh
Dl Drive number
81 h fixed disk 2
CF = 0 No error
= 1 Error
continued
Error conditions
If unsuccessful, this function returns with the Carry Flag (CF) set and the
appropriate Fixed Disk Service error code in both AH and in Fixed Disk
Status (40:74h).
Refer to the Error Handling heading in this chapter for a table of error codes.
Description
This function writes one or more sectors to the location on the fixed disk
specified in Dl from the buffer pointed to by ES:BX. This function also writes
four to seven bytes of Error Correction Code (ECC) associated with the
specified sectors.
Cylinder number, sector number, and head number are specified in CH, Cl,
and DH, respectively (see Input/Output below).
This function does not require a prior call to Function OCh, Seek to Cylinder.
Along with Function AH = OAh, this function is normally reserved for diagnos
tics and should not be used for normal write to fixed disk operations.
If successful, this function returns with the Carry Flag cleared and AH and
Fixed Disk Status (40:74h) equal to zero.
Input/Output
Input: AH = OBh
Al = Number of sectors to write (usually one)
CH = Cylinder number (low 8 bits, zero-based)
Cl = Cylinder/sector number, where:
=
Bits 7-6 cylinder number (high 2 bits)
Bits 5-0 = sector number
DH = Head number (zero-based)
Dl = Drive number
80h fixed disk 1
81 h fixed disk 2
ES:BX = Disk transfer address
Output: AH = OOh No error
= xxh Error (See error codes earlier in this chapter)
= Fixed Disk Status (40:74h)
CF = 0 No error
= 1 Error
continued
Error conditions
If unsuccessful, this function returns to the caller with the Carry Flag (CF)
set and the appropriate Fixed Disk Service error code in both AH and in
Fixed Disk Status (40:74h).
Refer to the Error Handling heading in this chapter for a table of error codes.
Description
This function positions the disk read/write head over the cylinder specified in
CH and CL (see Input/Output below). The fixed disk drive number must be
specified in DL.
If successful, this function returns with the Carry Flag cleared and AH and
Fixed Disk Status (40:74h) equal to zero.
The Read Disk Sectors (AH = 02h), Write Disk Sectors (AH = 03h), Read
Long Sectors (AH = OAh) , and Write Long Sectors (AH = OBh) functions
have a seek operation implicitly built into them and do not require a prior call
to this function.
Input/Output
Input: AH = OCh
CH Cylinder number (low 8 bits, zero-based)
CL Cylinder/sector number, where:
Bits 7-6 = cylinder number (high 2 bits)
Bits 5-0 = sector number
DH = Head number (zero-based)
DL = Drive number
80h fixed disk 1
81 h fixed disk 2
Output: AH = OOh No error
= xxh Error (See error codes earlier in this chapter)
= Fixed Disk Status (40:74h)
CF 0 No error
= 1 Error
Error conditions
If unsuccessful, this function returns to the caller with the Carry Flag (CF)
set and the appropriate Fixed Disk Service error code in both AH and in
Fixed Disk Status (40: 74h) .
Refer to the Error Handling heading in this chapter for a table of error codes.
Description
This function is identical to INT 13h AH = OOh Reset Diskette (s) and Fixed
Disk except that the diskette system is not reset.
The caller must specify the fixed disk drive to reset in DL. This function
reinitializes the fixed disk controller and places the specified fixed disk drive
in a known state by resetting the fixed disk parameters and by recalibrating
the read/write head positions. This process resets the read/writer head to
track O.
If successful, this function returns with the Carry Flag cleared and AH and
Fixed Disk Status (40:74h) equal to zero.
Input/Output
Input: AH ODh
DL Drive number
80h fixed disk 1
81 h fixed disk 2
Output: AH = OOh No error
= xxh Error (See error codes earlier in this chapter)
Fixed Disk Status (40:74h)
CF = 0 No error
1 Error
Error conditions
If not successful, this function returns to the caller with the Carry Flag (CF)
set and the appropriate Fixed Disk Service error code in both AH and in
Fixed Disk Status (40:74h).
Refer to the Error Handling heading in this chapter for a table of error codes.
Description
This function reads a test buffer from the fixed disk controller into the diag
nostics buffer specified in ES:BX. Data is not read from the actual physical
disk drive.
If successful, this function returns with the Carry Flag (CF) cleared and AH
and Fixed Disk Status (40:74h) set to zero.
Input/Output
Input: AH = OEh Diagnostics 1, read test buffer
DL = Drive number
80h fixed disk 1
81 h fixed disk 2
ES:BX = Pointer to diagnostic buffer
Output:· AH OOh No error
= xxh Error (See error codes earlier in this chapter)
Fixed Disk Status (40:74h)
CF 0 No error
= 1 Error
Error conditions
If not successful, this function returns to the caller with the Carry Flag (CF)
set and the appropriate Fixed Disk Service error code in both AH and in
Fixed Disk Status (40: 74h) .
Refer to the Error Handling heading in this chapter for a table of error codes.
Description
This function writes a test buffer to the controller from the diagnostics buffer
specified in ES:BX. Data is not written to the actual physical disk drive.
This function should be called to initialize the sector buffer contents before
formatting an XT -type fixed disk drive using INT 13h AH = 05h.
If successful. this function returns with the Carry Flag (CF) cleared and AH
and Fixed Disk Status (40:74h) set to zero.
Input/Output
Input: AH = OFh Diagnostics 2. write test buffer
DL = Drive number
80h fixed disk 1
81 h fixed disk 2
ES:BX = Pointer to diagnostic buffer
Output: AH = OOh No error
xxh Error (See error codes earlier in this chapter)
Fixed Disk Status (40:74h)
CF = 0 No error
= 1 Error
Error conditions
If not successful. this function returns to the caller with the Carry Flag (CF)
set and the appropriate Fixed Disk Service error code in both AH and in
Fixed Disk Status (40:74h).
Refer to the Error Handling heading in this chapter for a table of error codes.
Description
This function determines if the fixed disk drive specified in DL is ready and
can process a command.
If successful, this function returns to the caller with the Carry Flag (CF)
cleared and AH and Fixed Disk Status (40:74h) set to zero.
Input/Output
Input: AH 10h
DL Drive number
80h fixed disk 1
81 h fixed disk 2
Output: AH = OOh No error
xxh Error (See error codes earlier in this chapter)
Fixed Disk Status (40:74h)
CF = 0 No error
= 1 Error
Error conditions
If not successful, this function returns to the caller with the Carry Flag (CF)
set and the appropriate Fixed Disk Service error code in both AH and in
Fixed Disk Status (40:74h).
Refer to the Error Handling heading in this chapter for a table of error codes.
Description
This function repositions head 0 over cylinder 0 of the fixed disk drive speci
fied in DL.
If successful, this function returns with the Carry Flag (CF) cleared and AH
and Fixed Disk Status (40:74h) set to zero.
Input/Output
Input: AH = 11 h
DL Drive number
81 h fixed disk 2
CF = 0 No error
= 1 Error
Error conditions
If not successful, this function returns to the caller with the Carry Flag (CF)
set and the appropriate Fixed Disk Service error code in both AH and in
Fixed Disk Status (40:74h).
Refer to the Error Handling heading in this chapter for a table of error codes.
Description
This function causes the fixed disk controller to carry out a built-in diagnostic
test on its internal sector buffer, indicating whether the test was passed by a
status indicator in AH.
Input/Output
Input: AH = 12h
AL = Number of sectors
CH = Cylinder
CL Sector
DH = Head
DL Drive number
80h fixed disk 1
81 h fixed disk 2
Output: AL = OOh
AH = OOh No error
xxh Error (See error codes earlier in this chapter)
= Fixed Disk Status (40:74h)
CF = o
No error
= 1 Invalid parameter
Error conditions
If not successful, this function returns with the appropriate Fixed Disk Service
error code in both AH and location 40:74h and the Carry Flag (CF) set.
Refer to the Error Handling heading in this chapter for a table of error codes.
Description
This function causes the fixed disk controller to run internal diagnostic tests
of the attached fixed disk drive. The value in AH indicates whether the test
was passed, and, if not, gives an appropriate error code in AH. If there is
an error the Carry Flag is set.
Input/Output
Input: AH = 13h
AL = Number of sectors
CH = Cylinder
CL = Sector
DH = Head
DL = Drive number
80h fixed disk 1
81 h fixed disk 2
Output: AL = OOh
AH = OOh No error
= xxh Error (See error codes earlier in this chapter)
Fixed Disk Status (40:74h)
CF = o No error
= 1 Error
Error conditions
If not successful, this function returns with the appropriate Fixed Disk Service
error code in both AH and location 40:74h and the Carry Flag (CF) set.
Refer to the Error Handling heading in this chapter for a table of error codes.
Description
This function causes the fixed disk controller to carry out a built-in diagnostic
self-test, indicating whether the test was passed by a status code in AH.
If an illegal parameter is passed in one of the input registers, the Carry Flag
is set and control is returned to the caller with registers preserved.
Input/Output
Input: AH 14h
AL = Number of sectors
CH = Cylinder
CL = Sector
DH Head
DL = Drive number
80h fixed disk 1
81 h fixed disk 2
Output: AL = OOh
AH OOh No error
= xxh Error (See error codes earlier in this chapter)
= Fixed Disk Status (40:74h)
CF = o No error
= 1 Invalid parameter
Error conditions
If not successful, this function returns with the appropriate Fixed Disk Service
error code in both AH and location 40:74h and the Carry Flag (CF) set.
Refer to the Error Handling heading in this chapter for a table of error codes.
Description
This function returns a status code in AH which indicates the type of diskette
or fixed disk drive for the drive specified in DL. This function also returns the
number of 512-byte blocks on the fixed disk if the drive specified in DL is
valid. (Valid values are 80h and 81 h.)
If successful, the high word of the number of 512-byte sectors on the fixed
disk is returned in CX, and the low word of the number of 512-byte sectors
is returned in OX. The Fixed Disk Status (40:74h) and AH are set to OOh, the
Carry Flag is cleared, and control is returned to the caller.
Input/Output
Input: AH = 15h
DL Drive number
81 h fixed disk 2
CF = 0 No error
= 1 Error
CX = Number of 512-byte sectors on the fixed disk
(valid only of AH = 03h)
continued
Unlike most other Fixed Disk Service functions, in this function the value
stored in AH is not equal to the value stored in Fixed Disk Status (40: 74h).
Instead, AH reports whether or not the drive number input in DL is valid (AH
will equal OOh if there is no drive for this drive number), or the fixed disk/
diskette status of the drive specified in DL.
Error conditions
If the drive number specified in DL is not valid, this function clears AH, AL,
CX, OX, and the Fixed Disk Status (40:74h), clears the Carry Flag, and
returns control to the caller.
Service
Overview
Description
The BIOS Serial Communications Service performs RS-232C character I/O on
IBM-compatible serial port adapters.
The INT 14h vector resides at address OO:50h in the interrupt vector table.
The BIOS initializes the INT 14h vector to address FOOO:E739h.
continued
In this chapter
This chapter focuses on the BIOS Serial Communications Service. The follow
ing topics are discussed:
• Theory of Operation
• System RAM Data
• ROM BIOS Data
• Serial Communications I/O Ports
• Error Conditions
• Serial Communications Functions
Legend Description
Introduction
The asynchronous serial port on an IBM PC, PC/XT, and PC/AT converts
data from parallel form to serial form for communication between the com
puter and an external device, usually a serial printer or an external modem.
The physical connection consists of an RS-232C-standard cable linking the
two devices. The ROM BIOS Serial Communications Service. which is invoked
via INT 14h, performs various operations that make serial transmission and
reception possible.
continued
NS 16450 IC Controller
The Serial Communications Service assumes a National Semiconductor NS
16450 IC serial communications controller (or compatible) is in place. The
controller contains a programmable baud rate generator that supports baud
rates from 50 baud to 9600 baud. The controller also supports 5-, 6-, 7-,
and a-bit characters with 1-, 1.5-, or 2-stop bits operating in even, odd,
and no parity modes.
continued
The cable that links the computer's serial port to the external device must
conform to EIA RS-232C (or equivalent) standards.
Reference: A complete list of the serial 1/0 ports can be found under the
heading Serial Communications 1/0 Ports in this chapter.
continued
1/0 signals
The controller communicates with the external device through input/output
signals. The input signals are generated by the external device, and moni
tored by the modem status register. The output signals are generated by the
controller, and controlled by bits 3-0 in the modem control register.
Input/Output
Signal Name Status Description
Clear to send I 1 = The external device Is ready for the serial port
to transmit data.
Data set ready I 1 = The external device Is ready to establish the
communications link and transfer data with the
controller.
Ring Indicator I 1 =The external device detected a telephone ring-
Ing signal.
Data carrier I 1.= The external device detected a data carrier.
detect
Data terminal I 1 =The controller Is ready to communicate.
ready
Request to send 0 1 = The controller is ready to send data,
Output 1 0 1 =User-designated output. This is a spare signal
that can be used.
Output 2 0 1 = User~deslgnated output, Spare sig'nal that con
trols Interrupts to the system,
continued
continued
Calling
Program
Port Specified In DX
External
Device
I- - - One Frame - - --I
Introduction
The Serial Communications Service makes use of control information located
in the BIOS data area of system RAM (address 40:00h through 40:100h).
The table below describes those areas.
110 0417h
150 0300h
300 0180h
600 OOCOh
1200 0060h
2400 0030h
4800 0018h
9600 OOOCh
1,843,200 115200
= = Divisor
16 Baud Rate
For example, a baud rate of 2400 has a divisor of 115200/2400, which
equals 48 decimal, 30 hex.
INT 14h references the following 1/0 ports. These registers are used to
monitor the controller's operations, and to transmit and receive data.
Read/Write
continued
Read/Write
I/O Address Status Description
continued
Read/Write
I/O Address Status Description
03FCh R/W Serial 1, modem control register, where:
Bits 7-5 = 0 Reserved
Bit 4 = 1 Loopback Mode for diagnostic
testing of serial port, Output of
transmitter shift register is looped
back to receiver shift register
Input. When in this mode, trans
mitted data is immediately re
ceived so that the CPU can verify
the transmit data/receive data
serial port paths.
Bit 3 = 1 Enable OUT21nterrupt
Bit 2 = 1 Force OUT1 Active
Bit 1 = 1 Force Request-To-Send Active
Bit 0 = 1 Force Data-Terminal-Ready Active
03FDh R Serial 1, line status register, where:
Bit 7 = 0 Reserved
Bit 6 = 1 Transmitter shift and holding
registers empty
Bit 5 = 1 Transmitter holding register empty.
The controller is ready to accept
a new character to send.
Bit 4 = 1 Breaklnterrupt. The received data
input Is held In the zero bit state
longer than the time of start bit +
data bits + parity bit + stop bits.
Bit 3 = 1 Framing error. The stop bit that
follows the last parity or data bit is
a zero bit.
Bit 2 = 1 Parity error. Character has wrong
even or odd parity.
Bit 1 = 1 Overrun error. A character was
sent to the receiver buffer before
the previous character In the buffer
could be read. This destroys the
previous character.
Bit 0 = 1 Data ready. A complete incoming
character has been received and
sent to the receiver buffer register.
03FEh R Serial 1, modem status register, where:
Bit 7 = 1 Data Carrier Detect
Bit 6 = 1 Ring Indicator
Bit 5 = 1 Data Set Ready
Bit 4 = 1 Clear To Send
Bit 3 = 1 Delta Data Carrier Detect
Bit 2 = 1 Trailing Edge Ring Indicator
Bit 1 = 1 Delta Data Set Ready
Bit 0 = 1 Delta Clear To Send
continued
ReadlWrite
1/0 Address Status Description
Read/Write
I/O Address Status Description
= 1 0 Stop Bits
ReadlWrite
1/0 Address Status Description
. registers empty .
Introduction
The Serial Communications Service detects two kinds of errors:
• Parameter-related errors
• Time-out errors
Parameter-related errors
The following parameter-related conditions are checked upon entry into each
Serial Communications Service function.
• The function number specified in AH must fall within the range 0-3.
• The serial port specified in OX must fall within the range of 0-3.
• The serial port specified in OX must exist in hardware.
If any of the conditions above are not true, the Serial Communications
Service does not perform the requested function and returns with all regis
ters preserved.
Time-out errors
A time-out error occurs when either a read or a write of a specified commu
nications line was unable to occur.
The Serial Communications Service Read and Write functions test the line
status register and the modem status register. When a time-out error oc
curs, the contents of the status register being tested are returned with bit 7
.. time-out error" set.
Description
This function initializes the selected adapter card from the baud rate, parity,
stop bit, and word length parameters specified in the AL register. The func
tion returns with the modem status register and the line status register in AL
and AH, respectively. All other registers are preserved.
Input/Output
Input: AH = OOh
continued
Input/Output, cont' d
Description
The Send Character function transmits the character supplied in AL over the
communication line specified in OX.
If successful, this function returns with the contents of the line status register
in AH, Bit 7 = O. If unsuccessful, AH, Bit 7 = 1.
Input/Output
Input: AH = 01h
AL Character
OX - Serial port number (valid values are 0, 1, 2, 3, where
o = COM1, 1 = COM2, etc.)
Output: AH Line Status Register, where:
Bit 7 = 0 No time-out error has occurred
Bit 6 = 1 Transmitter shift and holding register empty
Bit 5 = 1 Transmitter holding register empty
Bit 4 = 1 Break interrupt
Bit 3 = 1 Framing error
Bit 2 = 1 Parity error
Bit 1 = 1 Overrun error
Bit 0 = 1 Data ready
Error conditions
When a time-out error occurs during the execution of the Send Character
function, the value returned in AH can reflect the state of either the modem
status register or the line status register. However, since bit 7 of AH is used
to report that an error has occurred, it is not available to report a time-out
error. For this reason, if this function or INT 14h function 02h reports an
error, it is preferable to use INT 14h function 03h, which gives a complete
status report, rather than the less-complete status bits returned with the
error bit in functions 01 hand 02h.
Description
The Receive ·Character function receives one character from the serial port
specified in the OX register.
If successful. this function returns with the character received in the AL re
gister. The contents of the line status register is returned in the AH register.
Input/Output
Input: AH = 02h
Error conditions
If a time-out error occurs during the execution of the Receive Character
function. the value returned in AH can reflect the state of either the modem
status register or the line status register. However. since bit 7 of AH is used
to report that an error has occurred. it is not available to report a time-out
error. For this reason. if this function or INT 14h function 01 h reports an
error. it is preferable to use INT 14h function 03h. which gives a complete
status report. rather than the less-complete status bits returned with the
error bit in functions 01 hand 02h.
Description
The Read Serial Port Status function returns the current modem status in the
AL register and the current line status in the AH register. All other registers
are preserved.
Input/Output
Input: AH = 03h
DX = Serial port number (valid values are 0, 1 2, 3, where
j
Overview
Introduction
INT 15h. System Services. provides several services:
• Multitasking hooks
The BIOS provides six hooks for use by multitasking operating systems. In
a DOS environment (which is not a multitasking operating system) these
six functions do nothing except return to the caller. A multitasking operat
ing system would normally intercept these function calls by replacing the
INT 15h vector and processing these function calls itself.
• Joystick support
Function 84h supports up to two joysticks. Function 84h has two subfunc
tions: read current switch settings and read resistive inputs.
• Wait routines
INT 15h provides two wait functions: Function 83h. Set Event Wait Interval.
and Function 86h. Wait. Function 86h does not return control to the caller
until a specified interval is completed. Function 83h returns control to the
caller immediately but sets a bit when a predetermined interval is over.
continued
Introduction, cont'd
• Protected mode support
The BIOS System Services provides limited protected mode support
through two functions: Function 87h, Move Block, and Function 89h,
Switch Processor to Protected Mode.
• System information
Function COh, Return System Configuration Parameters, and Function 88h,
Read Extended Memory Size, provide information about the system.
Individual INT 15h System Services functions are selected via the AH regis
ter. Subfunctions are selected via the AL, OX, or BH registers.
In this chapter
The following topics are discussed in the rest of the INT 15h System
Services chapter:
• Summary of Functions
• Hardware Environment
• System RAM Data
• CMOS RAM Data
• ROM BIOS Data
• System Services lID Ports
• System Services Functions
Functions AH = 80h. 81 h. 82h. 85h. 90h. and 91 h (i. e .• those marked with
an asterisk in the table below) are multitasking hooks. A multitasking operat
ing system would normally intercept these function calls by replacing the INT
15h vector and processing these function calls itself. In DOS (which is not a
multitasking operating system) these six functions do nothing except return
immediately to the caller with the Carry Flag cleared.
• Multitasking hooks
Initial
Read/Write
I/O Address Status Description
Read/Write
I/O Address Status Description
counter 0
counter 2
continued
Read/Write
110 Address Status Description
continued
ReadlWrlte
Legend Description
Description
Older PC BlOSs support the Turn Cassette Motor On function. On an older
PC, this function turns on the tape cassette motor if a cassette drive is at
tached to the system. The cassette connector is generally located near the
keyboard connector on the back of the PC.
XT and AT BlOSs support this function to the extent that the BIOS does not
generate an error and returns with registers preserved if this function is
invoked.
Functions OOh, 01 h, 02h, and 03h may be useful to those who need to
attach a low-voltage analog device to a PC or to generate a signal to a
signalling device. These functions control the operation of a relay within the
PC. This relay is useful for controlling low-voltage and low-current devices.
Input/Output
Input: AH = OOh
Output: AH = OOh No error
= Status
CF o
No error
= 1 Error
Description
The Turn Cassette Motor Off function is supported in older PC BlOSs. In an
older PC it turns the tape cassette motor off.
This function is supported by XT and AT BlOSs only to the extent that the
BIOS does not generate an error and returns with registers preserved.
Functions OOh, 01h, 02h, and 03h may be useful to those who need to at
tach a low-voltage analog device to a PC or to generate a signal to a sig
nalling device. These functions control the operation of a relay within the PC.
This relay is useful for controlling low-voltage and low-current devices.
Input/Output
Input: AH = 01 h
= Status
CF = a
No error
= 1 Error
Description
The Read Cassette function is supported in older PCs. Invoking this function
causes the system to read data from the cassette.
Input/Output
Input: AH 02h
Description
The Write to Cassette function is supported in older PCs. Invoking this func
tion causes the system to write data from the system to the cassette.
InputfOutput
Input: AH = 03h
CX = Number of bytes to read
ES:BX = Segment:Offset of buffer
Output: AH = OOh No error
BOh Invalid command
86h Cassette not present
Status
CF 0 No error
= 1 Error
CX OOH
EX:BX = Segment:Offset + 1 of last byte written
Description
The INT 09h ISR calls this function, each time a key is pressed.
Input/Output
Input: AH 4Fh
AL = Scan code input by INT 09h ISR
Output: AL Scan code
CF o Keystroke unchanged (original scan code in AL)
= 1 Keystroke changed (new scan code in AL)
Description
This function is used by multitasking operating systems. A multitasking
operating system would intercept this function and process the request as
necessary. Normally. the BIOS simply returns with AH set to OOh and the
Carry Flag clear. The caller must clear the Carry Flag before invoking this
function.
Input/Output
Input: AH = aOh
BX = Device ID
CF = 0
CX = Process ID
Output: AX OOaOh
Description
This function is used by multitasking operating systems. A multitasking
operating system would intercept this function and process the request as
necessary. Normally, the BIOS simply returns with AH set to OOh and the
Carry Flag clear. The caller must clear the Carry Flag before invoking this
function.
Input/Output
Input: AH = 81h
BX = Device ID
CF = 0
CX = Process ID
Output: AX = 0081h
Description
This function is used by multitasking operating systems. A multitasking
operating system would intercept this function and process the request as
necessary. Normally, the BIOS simply returns with AH set to OOh and the
Carry Flag clear. The caller must clear the Carry Flag before invoking this
function.
Input/Output
Input: AH = 82h
BX = Device 10
CF = 0
Output: AX = 0082h
Description
INT 15h provides two wait functions: Function 83h Set Event Wait Interval and
Function 86h Wait. The difference between these two functions is that pro
cessing continues when INT 15h Function 83h is invoked, but processing
stops for the calling program when INT15h Function 86h is invoked.
Function 83h, subfunction AL = OOh causes the BIOS to set a signal in a
user-defined memory location after a specified interval passes. Function
83h, subfunction AL = 01 h cancels the wait.
This function accesses INT 70h, the Real Time Clock ISR. INT 70h has two
components: an alarm interrupt service, and a periodic interrupt service. INT
15h, Function 83h sets and cancels the periodic interrupt service of INT 70h,
as does INT 15h, Function 86h.
With this function, the caller must specify a location in ES:BX where the
BIOS will set the high-order bit when the time period specified in CX and OX
expires. The caller is responsible for clearing this bit after the time interval
expires and before invoking this function again.
The input and output register settings are shown on the following page.
Additional Information
• An event wait's duration is an integral multiple of 976 microseconds, since
the MC146818 RTC chip is usually programmed to tick 1024 times per
second, or once every 976 microseconds.
• This function provides hardware-independent wait periods of finer granu
larity than provided with the DOS Get Time Function (INT 21h, Function
2Ch), or the INT 08h System Timer ISR, which ticks only 18.2 times per
second. MS-DOS INT 21 h, Function 2Ch returns time only in hundredths of
a second.
continued
Input/Output
Input: AH == 83h
AL OOh
CX == Microseconds until posting (high byte)
ox == Microseconds until posting (low byte)
ES:BX == Pointer to byte in caller's memory that will have bit 7 set
when the interval expires
Output: AH 83h
AL == Bit 6 of CMOS RAM location OBh is set, if successful
== OOh Function busy
CF == 0 No error
== 1 Error, function busy
continued
Input/Output
Input: AH = 83h
AL = 01h
Output: AX = 8300h
CF = 0 No error
1 Error
Error conditions
No action is taken and the registers are preserved if CX and DX contain zero
values. If a wait is already in progress, CF is set and control is returned to
the caller.
Reference
Refer to Chapter 15, INT 1Ah Time-ot-Day Service, tor more information
about INT 15h, Functions 83h and 86h.
Description
This function controls a joystick connected to the game control adapter. It
has two subfunctions: read current joystick switch settings and read resistive
inputs. which are described below.
Input/Output
Input: AH = 84h
OX OOh
Output: AH = OH on entry to this function
AL Switch settings in bits 7-4. bits 3-0 = OOOOb
CF = o No error
1 Incorrect value in OX
continued
Input/Output
Input: AH 84h
OX = 01h
Output: AX = Joystick A X-coordinate value
BX = Joystick A Y-coordinate value
CF = o No error
1 Incorrect value in OX
CX = Joystick B X-coordinate value
OX Joystick BY-coordinate value
Description
The keyboard interrupt function is called by INT 09h when the Sys Req key is
pressed. When called, this function returns to the caller with the scan code
in AL (unchanged) and the Carry Flag clear.
Input/Output
Input: AH = 85h
= 01 h Key break
CF
= a
Output: AX = 0085h
CF a
= No error
= 1 Invalid number in AL
Description
This function causes the BIOS to immediately suspend activity for the calling
program for the amount of time specified in CX and DX. It then sets bit 7 of
location 40:AOh when the specified interval is completed.
INT 15h provides two wait functions: Function a3h Set Event Wait Interval and
Function a6h Wait. The difference between these two functions is that pro
cessing continues when INT a3h is invoked, but processing stops for the
calling programs when INT a6h is invoked.
No action is taken and the registers are preserved if CX and DX contain zero
values. If a wait is already in progress, CF is set and control is returned to
the caller.
Input/Output
Input: AH = a6h
CX = High byte of wait interval (in microseconds)
DX = Low byte of wait interval (in microseconds)
Output: AH = a6h
AL = Mask written to interrupt controller 2 (if successful)
= Unmodified if function busy
CF = o
No error
= 1 Function busy, wait not performed
Description
This function copies a block of memory for a program that operates in real
address mode from anywhere in the system address space to anywhere else
in the system's address space.
Types of memory
Conventional memory is located at addresses below 640K. Only this area
can be accessed by DOS and DOS application programs. Extended memory
is located at addresses above 1 MB, and has to be accessed by an 80286,
80386SX, or 80386 microprocessor operating in the protected address
mode.
continued
Input/Output
Input: AH = 87h
CX = Number of 16-bit words to move (O-BOOOh words)
ES:SI = Pointer to a 30h-byte table allocated by the caller
Output: AH = OOh Successful move
= 01 h RAM parity error occurred
= 02h Other exception interrupt error
CF = o No error
= 1 Error
ZF = o Unsuccessful move
1 Successful move
continued
24-bit address
The 24-bit address provided by the caller is a physical base address that is
the beginning address of the memory segment specified by the descriptor.
This is the beginning address of the segment of code or data to be moved.
80286 descriptors
Although the caller is not concerned with this part of the table format, each
8 bytes of the table (except the first eight bytes, which must be zero) is a
descriptor that references a memory segment.
Intel 80286 code forms protected mode addresses to access addresses up
to 16 MB differently, using a descriptor format. The segment: offset address
form is modified so that the segment address is a 24-bit address located at
the descriptor starting address + 2 and the offset is a 16-bit value located at
the descriptor starting address + O. The 80286 data segment descriptor
format is shown in the following table. The 80386 data segment descriptor
format is slightly different, but is not shown here. See the Intel 80386 Pro
grammer's Reference for details about the 80386 protected mode instruction
format.
.
90h or 91h = Read only data segment
If an 80286-based system, 9Bh, 93h, or 91h will
continued
Interrupts disabled
Interrupts are disabled while the block move is performed. For this reason,
using this function may interfere with software such as communications
programs and network drivers that depend on prompt servicing of hardware
interrupts.
Processor-specific information
On 80386-based systems, 32-bit moves are performed. The BIOS uses the
keyboard controller to reset the processor on 80286-based systems.
Error conditions
If an exception interrupt occurs during the block move, AH is set to 02h. CF
is set, ZF is cleared, and control is returned to the caller.
Description
The Read Extended Memory Size function reads the size of the extended
memory (memory beginning at address 100000h) from CMOS locations 30h
and 31 h and stores the combined contents as a word in the AX register.
Input/Output
Input: AH = 88h
Output: AX = Number of contiguous 1K blocks of extended memory
starting at address 1024K (100000h)
Description
The Switch Processor to Protected Mode function sets the processor into
protected mode and passes control to the code segment pointed to in the
GOT (global descriptor table) provided by the caller.
Input/Output
Input: AH 89h
::z::
continued
BIOS interrupt vectors do not operate in protected mode. For this reason, a
program that enters protected mode must construct its own lOT which does
not overlap the BIOS real mode table, and which handles all interrupts while
the program is in protected mode.
Description
This function is used by multitasking operating systems. A multitasking oper
ating system would intercept this function and process the request as neces
sary. Normally, the BIOS simply returns with AH set to OOh and the Carry
Flag clear. The caller must clear the Carry Flag before invoking this function.
Input/Output
Input: AH SOh
AL Device Type, where:
OOh Fixed disk time-out
= 01 h Diskette time-out
= 02h Keyboard
03h Pointing device time-out
21 h Waiting for keyboard input
BOh Network.
FCh Fixed disk reset time-out
FDh Diskette drive motor start
= FEh Printer time-out
CF = 0
ES:BX = Points to a network control block (if AL = BOh or any
address above BOh)
Output: AH OOh Wait time not satisfied
CF 0 Wait time not satisfied (the service must use its own
wait routine)
1 Minimum wait time satisfied (wait performed)
Device types
Serially reusable devices must be given device types 'from OOh - 7Fh;
reentrant devices must have types BOh - BFh; and wait only calls, which
have no corresponding function in BIOS POST, must have device types COh
- FFh.
Description
This function is used by multitasking operating systems. A multitasking oper
ating system would intercept this function and process the request as neces
sary. Normally, the BIOS simply returns with AH set to OOh and the Carry
Flag clear. The caller must clear the Carry Flag before invoking this function.
The multitasking operating system printer service would not invoke this func
tion, since printer output is not interrupt-driven.
Input/Output
Input: AH = 91h
AL = Type code, where:
= OOh Disk time-out
= 01 h Diskette time-out
02h Keyboard
= 03h Pointing device time-out
BOh Network
= FCh Fixed disk reset time-out
= FDh Diskette drive motor start
CF = 0
ES:BX = Points to a network control block (if AL = BOh)
Output: None
Description
This function returns a pointer in ES:BX to the system configuration parame
ter table, located in ROM at FOOO:E6F5h, which gives information about the
system.
Input/Output
Input: AH = COh
Output: AH = OOh Successful
= 86h System model could not be determined
CF = 0 No error (AH = OOh)
= 1 System model could not be determined (AH = 86h)
ES:BX = Address of system configuration table
continued
Overview
Description
The Parallel Printer Service provides BIOS-level support for up to three
parallel printer ports. This service provides three printer-related functions.
continued
In 'this chapter
This chapter focuses on the INT 17h Parallel Printer Service. The following
topics are discussed:
• Theory of Operation
• System RAM Data
• Parallel Printer I/O Ports
• Error Handling
• Parallel Printer Functions
Legend Description
Introduction
The parallel printer port on an IBM PC, PC/XT, and PC/AT is an 8-bit-wide
device that can be used to drive various IBM PC and compatible printers.
The BIOS Parallel Printer Service provides support for up to three parallel
printer ports.
The 25-pin parallel connector at the rear of the adapter is the interface to
an attached printer. The parallel port provides various input/output signals for
communication with the printer. In particular, it uses the strobe signal to
write data to the printer. The parallel port I/O signals are described on the
next page.
continued
110 signals
The parallel port makes available two types of signals: control output signals
which are stored in the printer control port, and status input signals which
are stored in the printer status port. These signals can be read by the
microprocessor to determine the success or failure of an operation. The
following table describes these signals.
Input/Output
continued
For example, when the caller wants to send a print request to the micropro
cessor, INT 17h Function OOh Print Character is invoked. This writes a char
acter to the printer specified in OX.
The INT 17h functions reference three parallel printer 1/0 ports: the data
port, the printer control port, and the printer status port.
Reference: A description of the parallel printer 110 ports can be found under
the heading Parallel Printer 1/0 Ports in this chapter.
continued
Printing a character
The graphic below illustrates how the INT 17h Print Character function (OOh)
writes data to an attached parallel printer.
Calling
Program
INT 17h
AL-Data
AH-OOh
BIOS
Port specified in DX
Strobe Signal
Cable
Read/Write
I/O Address Status Description
Read/Write
I/O Address Status Description
Bit 7 = 0 Busy
Bit 6 = 0 Acknowledge
Bit 5 = 1 Out of paper
Bit 4 = 1 Printer is selected
Bit 3 = 0 Error
Bit 2 = 0 IRQ has occurred
Bits 1-0 = Reserved
03BEh R/W Parallel 1, control port, where:
Bits 7-5 = Reserved
Bit 4 = 1 Enable IRQ
Bit 3 = 1 Select printer
Bit 2 = 0 Initialize printer
Bit 1 = 1 Automatic line feed
Bit 0 = 1 Strobe
Error Handling
Before entering any functions, the Parallel Printer Service ensures that the
index in OX is not out of range, that the function number is not out of range,
and that the printer is at the specified index.
If any of the above conditions are not met, the service returns to the caller
with all registers restored except AH. When OX is out of range or the printer
does not exist, AX is not modified. When the function number is out of
range, AH is returned, and is decremented by 2.
Description
The Print Character function prints the character in the AL register to the
printer specified in the DX register. The printer status is returned in the AH
register.
Input/Output
Input: AH = OOh
AL Character to print
DX Printer number (0 = LPT1, 1 = LPT2, or 2 = LPT3) used as
an index to the printer base port address table at 40:08h.
Output: AH Printer status, where:
Bit 7 1 Printer not busy
Bit 6 Acknowledgment
Bit 5 = Out of paper
Bit 4 = Printer selected
Bit 3 1/0 error
Bit 2 = Reserved
Bit 1 = Reserved
Bit 0 = 1 Time-out
Description
The Initialize Printer function initializes the printer selected in the OX register.
The printer status is returned in register AH.
Input/Output
Input: AH = 01 h
DX = Printer number (0 = LPT1, 1 = LPT2, or 2 = LPT3) used as
an index to the printer base port address table at 40:08h.
Output: AH Printer status, where:
Bit 7 1 Printer not busy
Bit 6 = Acknowledgment from printer
Bit 5 = Out of paper
Bit 4 = Printer selected
Bit 3 = 1/0 error
Bit 2 Reserved
Bit 1 = Reserved
Bit 0 1 Time-out error
Description
The Read Printer Status function reads and returns the status of the printer
selected by the ox register.
Input/Output
Input: AH 02h
OX = Printer number (0 = LPT1, 1 = LPT2, or 2 = LPT3) used as
an index to the printer base port address table at 40: 08h.
Output: AH Printer status, where:
Bit 2 = Reserved
Bit 1 = Reserved
Overview
continued
The INT 1Ah vector resides at address 00: 68h in the interrupt vector table.
The 810S initializes the INT 1Ah vector to address FOOO:FE6Eh.
Legend Description
continued
In this chapter
This chapter discusses each of the BIOS timer-related services. The follow
ing topics are presented:
• Theory of Operations
• System RAM Data
• CMOS RAM Data
• Time-of-Day Service lID Ports
• Error Handling
• Time-of-Day Service Functions
• INT 08h System Timer ISR
• INT 70h Real Time Clock ISR
• INT 1Ch Timer Tick ISR
• INT 4Ah Alarm ISR
continued
The following graphic describes how the Intel 8254, the INT 08h ISR, the INT
1Ah ISR. the INT 1Ch ISR, and the user interface are related.
INT OSh
continued
There are three functions that determine how the BIOS real time clock
hardware ISR will handle interrupts from the real time clock chip.
INT 15h: AH = a3h Event Wait Interval Clock ISR's periodic interrupt component.
INT 15h: AH = a6h Wait For INT 15h AH = a3h Event Wait, the caller
must provide a designated location where the
BIOS will set a bit when the time for the Event
Interval period is expired.
For INT 15h AH = a6h Wait, the BIOS sets bit 7
of location 40:AOh after the Wait is completed.
Alarm function This function activates the BIOS Real Time
continued
The following graphic shows how the MC146818A, the BIOS interrupts, and
the user interface are related.
"'71'1'1', ~I'1'1'1'1'1'1'I'
\
AH = OSh
Read Real Time Clock
Date
Set Real Time Clock
Date
\ INT 70h
Alarm Function
INT 1Ah
W
AH = 06h Set Real Time Clock Alarm Periodic Function
AH = 07h Reset Real Time Clock INT 1Sh
Alarm
AH = 83h Event Wait Interval - set
INT 4Ah signal when interval
completed.
Vector to caller-supplied routine that
executes as programmed by the caller. Subfunctlon:
Provides access to high granularity tim AL = OOh Set Interval
er (1024 times per second) . = 01h Cancel Interval
AH = 86h Wait - stop processing
until specified interval is
completed.
Description
The following table lists all system RAM data areas, beginning at segment
40h, used by the Time-of-Day Service.
Description
The Time-of-Day Service accesses the first 12 bytes of the RTC CMOS RAM
data. Time data is stored in these locations. It also accesses location 32h,
Century in BCD. Location 32h is updated by software access, and not inter
nally by the chip.
The CMOS RAM configuration data definitions begin at address OEh. See
Chapter 3 for a detailed description of the contents of CMOS RAM.
continued
Read/Write
I/O Address Status Description
Description
All functions of the BIOS Time-of-Day Service set the Carry Flag if an invalid
function is requested. The function number remains in AH if there is an
invalid function request.
Each function handles all other errors uniquely. Refer to the description for
each function for specific information about error codes.
Description
This function reads and returns the system tick count from the system RAM
location 40:6Eh (high word) and 40:6Ch (low word). The value returned is
the cumulative number of Intel 8254 clock ticks since midnight. This opera
tion sets the timer tick count maintained by INT 08h.
The values stored in these locations are defined by the frequency of the INT
08h System Timer interrupt, which is usually programmed to interrupt
approximately 18.2 ticks per second. The contents of 40:70h, the Timer
Overflow Flag, are returned in AL. This value will be 0 if the timer has not
exceeded 24 hours.
Interrupts are disabled while reading RAM data memory locations because a
timer tick update may occur.
Input/Output
Input: AH OOh
Output: AH = ~Oh
AL = Timer overflow value, where:
= 0 Timer count is less than 24 hours since the last
power-on or system reset.
Any value greater than O. The timer count is more than
24 hours since the last power-on, system reset, last
system-timer time counter read, or the last time the
system-timer time counter was set.
CF = 0 No error
1 Error
CX = High word of tick count
DX = Low word of tick count
Description
This function stores values from CX and DX to RAM data areas 40:6Eh (high
word) and 40:6Ch (low word). This operation sets the INT 08h timer tick
count.
Input/Output
Input: AH = 01h
CX = High word of tick count
DX = Low word of tick count
Output: AH OOh
CF = o No error
1 Error
Description
This function first finds out if the RTC is currently updating its clock value. If
so, the Carry Flag is set, the function is not performed, and control is re
turned to the caller.
If an update is not in progress, the appropriate values are read from the
RTC CMOS RAM and returned to the caller in AL, CX, and DX, as specified
below, with the Carry Flag cleared and AH = OOh.
Input/Output
Input: AH = 02h
Output: AH = OOh
AL = Hours in BCD
CF = 0 Clock operating
CH = Hours in BCD
CL = Minutes in BCD
DH = Seconds in BCD
Description
This function first finds out if the RTC is currently updating its clock value. If
an update is in progress, the real time clock is initialized, the Carry Flag is
set, the function is not performed, and control is returned to the caller.
The values placed by the caller in CX and DX are stored in their respective
CMOS RAM storage locations. Hours are stored in CMOS RAM location 04h,
minutes in location 02h, and seconds in location OOh.
Input/Output
Input: AH 03h
CH Hours in BCD
CL Minutes in BCD
DH Seconds in BCD
DL OOh No Daylight Savings Time option
01 h Daylight Savings Time option
Output: AH OOh
AL Value written to CMOS OBh register
CF o No error
1 Error
Description
This function first finds out if the RTC is currently updating its clock value. If
it is, the Carry Flag is set, this function is not performed, and control is
returned to the caller.
If no time-out occurs, the century, year, month, and day are extracted from
CMOS RAM and are returned to the caller as described below. Upon return,
the Carry Flag is cleared and AH = OOh.
Input/Output
Input: AH 04h
Output: AH = OOh
CF = 0 No error
= 1 Clock update in progress
CH = Century in BCD (either 19 or 20)
CL = Year in BCD
DH = Month in BCD
DL - Day in BCD
Description
This function first finds out if the RTC is currently updating its clock value. If
it is, the Carry Flag is set, this function is not performed, and control is re
turned to the caller.
The values placed in CX and OX, as defined below, are stored in their re
spective CMOS RAM storage locations. Century is stored in location 32h,
year in 09h, month in location OSh, and day in location 06h. This function
then returns to the caller with the Carry Flag cleared and AH = OOh.
Input/Output
Input: AH = OSh
CH = Century in BCD (either 19 or 20)
CL = Year in BCD
DH = Month in BCD
DL = Day in BCD
Output: AH - OOh
AL Value written to CMOS OBh register
CF = o
No error
= 1 Error
Description
This function sets the alarm function of INT 70h. The BIOS first tests if an
alarm is in progress. If an alarm is in progress, control is returned to the
caller with the Carry Flag set and AH cleared.
If an alarm is currently not enabled, the BIOS determines if the RTC is updat
ing its clock value. If a time-out occurs, which indicates that an update is in
progress, the clock is initialized. This function then sets the alarm with the
values from registers CH, CL and DH.
The alarm interrupt will take place at the hour, minute, and second specified
in registers CH, CL, and DH, respectively. Only one alarm function can be in
an active state at anyone time. The alarm interrupt, once set, will be acti
vated every 24 hours until reset. The caller must place the address of an
interrupt handling routine for the alarm in the vector for INT 4Ah. The entry
for INT 4Ah in the interrupt vector table is 128h.
The values defined below are stored in their respective CMOS RAM storage
locations. Unlike all other functions in this service, this function clears both
AH and AL.
Input/Output
Input: AH = a6h
CH Hours in BCD
CL = Minutes in BCD
DH = Seconds in BCD
Output: AH OOh
AL OOh
CF = a No error
= 1 Alarm already set
Description
This function stops the real time clock alarm interrupt, canceling any pending
alarm request stored in the date/time location in CMOS RAM. This function
does not disable the IRQ 8 generated by the real time clock, but it does
reset the alarm function of INT 70h.
Input/Output
Input: AH = 07h
Output: AH = DOh
CF = 0 No error
= 1 Error
Description
The Set Sound Source function is used only by the PCjr to set the tones for
the Audio Out or RF modulator on the PCjr. This function is not supported in
any other PC, XT, or AT environment. If invoked, it will be treated as an
invalid function (the Carry Flag is set and the registers are preserved).
Input/Output
Input: AH = 80h
AL = Sound source (PCjr only), where:
= DOh 8253 Programmable Timer, channel 2
= 01 h Cassette input
= 02h Audio In line on 110 channel
= 03h Sound generator chip
Output: None
Description
The Intel S254 timer/counter chip, or its equivalent, "ticks" roughly 1S.2
times per second. Each tick generates hardware INT OSh. PC, XT, and AT
BlOSs support this interrupt.
The BIOS System Timer ISR increments the double word, system time count.
The system time count is stored in the BIOS system RAM data area at loca
tions 40:6Ch (low word) and 40:6Eh (high word).
If the count in these location exceeds 24 hours, then the Timer Overflow
Flag at location 40:70h is set and the date is incremented. When 40:70h is
set, the system time count (40:6Ch and 40:6Eh) is cleared.
If not revectored, INT 1 Ch returns immediately to the caller with all registers
preserved.
The INT OSh vector resides at address OO:20h in the interrupt vector table.
The BIOS initializes the INT OSh vector to FOOO:FEA5h.
continued
continued
Read/Write
Introduction
The Motorola MC146818A real time clock chip, or its equivalent, can be
programmed to generate the real time clock hardware interrupt (INT 70h)
approximately 1024 times per second. The BIOS Real Time Clock I$R is
invoked on each real time clock interrupt. Only AT BlOSs support the Real
Time Clock ISR.
The INT 70h vector resides at address 00: 1Ch in the interrupt vector table.
The BIOS initializes the INT 70h vector to address FOOO:5124h.
continued
continued
Read/Write
Once INT OSh has serviced the clock, it issues a software INT 1Ch. BIOS
users may revector INT 1Ch to their own routines.
If not revectored, INT 1Ch returns immediately to the caller with all registers
preserved.
When the alarm function is activated, this interrupt will occur at the time
specified when INT 1Ah Function 06h was last invoked. When the alarm time
occurs, an INT 4Ah is generated. The caller must vector INT 4Ah to an alarm
processing routine before invoking INT 1Ah AH = 06h Real Time Clock Alarm.
Overview
Introduction
Most of the BIOS device services contain a group of functions intended to
service a given device. For example, in the BIOS Parallel Printer service,
invoking INT 17h with AH = OOh causes the service to execute its print char
acter function. On the other hand, invoking INT 17h with AH = 01 h causes
the service to execute its Initialize Printer Port function.
continued
In this chapter
Because each single function service can be described on one or two
pages, they are grouped into this one chapter.
Legend Description
Description
The Print Screen Service:
• prints the contents of the entire current video screen to printer number 0
(LPT1) ,
• moves the cursor across the screen as the lines on the screen are
printed,
• repositions the cursor position to its original position, and
• returns all registers to their original values.
Since the Print Screen Service takes a considerable amount of time to exe
cute, interrupts are enabled throughout the routine.
The original PC BIOS did not support INT 05h, however, many PC-compatible
BlOSs do. Nearly all XT and AT BlOSs support INT 05h. As a rule, if the
system has a keyboard with a PrintScreen key, the system BIOS will support
INT 05h.
The INT 05h vector resides at the interrupt vector table address 00: 14h. The
BIOS initializes the INT 05h Print Screen Service vector to FOOO:FF54h.
INT 05h is usually invoked by the keyboard interrupt handler (INT 09h) when
the PrtSc key is pressed. However, BIOS users may invoke INT 05h indepen
dently. For more information on INT 09h, refer to Chapter 8.
continued
Input/Output
Input: None
Output: None (registers are preserved)
Error conditions
The Print Screen Service recognizes three kinds of error conditions. The
table below summarizes the Print Screen Service error handling procedures.
···
the printer is busy sets location 40: 1OOh = FFh
repositions cursor to original position
preserves all registers
Description
The Equipment List Service returns the contents of system RAM location
40:10h in AX. This memory location contains the system equipment list as
determined by the BIOS POST routine.
The INT 11 h vector resides at the interrupt vector table address 0:44h.
The BIOS initializes the INT 11 h Equipment List Service vector to address
FOOO:F84Dh.
Input/Output
Input: None
Output: Equipment List
AX Contents of system RAM location 40: 1Oh, where:
Bits 15-14 = Number of printer adapters
Bits 13-12 = Reserved
Bits 11-9 = Number of RS-232-C asynchronous adapters
Bit 8 Reserved
Bits 7-4 Number of diskette drives, (if Bit 0 = 1),
where:
OOb = 1 diskette drive
01 b = 2 diskette drives
Bit 5-4 = Initial video mode, where:
OOb = VGA/EGA/PGA
01 b = 40x25 color
10b = 80x25 color
11 b = 80x25 black and white
Bit 3 = Reserved
Bit 2 1 If pointing device installed
Bit 1 If math coprocessor installed
Bit 0 = If diskette available for boot
Description
The Memory Size Service returns the contents of system RAM location
40: 13h in AX. This location contains the amount of available base memory in
kilobytes as it is determined by the BIOS POST routine. The value returned
reflects the amount of conventional memory in the system and does not
report extended memory.
The INT 12h vector resides at the interrupt vector table address O:48h.
The BIOS initializes the INT 12h memory size service vector to address
FOOO:F841 h.
Input/Output
Input: None
Output: Available Base Memory
AX = Contents of location 40: 13h in binary form
458 System BIOS for IBM PC/XT IAT Computers and Compatibles
INT 19h Bootstrap Loader Service [XT] [AT]
Description
The Bootstrap Loader Service attempts to load the 512-byte boot sector
code from either diskette (usually drive A: only) or fixed disk to address
0: 7COOh , transferring control to the code segment at that address. The boot
code is usually used to initialize the operating system.
The boot code is located in the first sector of the diskette (track O. head
0, sector 1) or in the first sector of the fixed disk (cylinder O. head O.
sector 1).
Input/Output
Input: None
Output: None (registers are preserved)
The BIOS initializes the INT 19h Bootstrap Loader Service vector to address
FOOO:E6F2h.
INT 19h is usually invoked by the POST routine at the end of all POST pro
cessing. BIOS users are free to invoke INT 19h independently of POST. Users
should be aware. however. that invoking INT 19h does not reset or reinitialize
the system but simply causes the system to reboot. For more information on
continued
Bootstrap processing
Once INT 19h has been invoked, the Bootstrap Loader Service executes as
described below:
Step Description
1 . Locate and load The boot code is located in the first sector of the diskette
boot code (track a, head a, sector 1) or hi the first sector of the fixed
disk (cylinder a, head a, sector 1). The Bootstrap Loader at
tempts to locate the boot sector and load it into memory at
address a: 7caah.
2. Check for power- On those systems that have password protection, the Boot-
on password strap Loader Service tests for the presence of a system
power-on password before it attempts to transfer control to
the boot code. End users enable or disable the power-on
password via the system's password control program. Power-
on passwords are not supported in most XTs and A Ts.
3. If power-on pass- If there is password support and the power-on password is
word e nabled enabled, It allows three opportunities to enter the password
correctly. After three attempts the system halts and must be
turned off, then turned on again before INT 19h may be in
voked again. The Bootstrap Loader recalculates the CRC if the
power-on password has been changed. This step is ignored in
most PC, XT, and AT systems.
4. Process boot The Bootstrap Loader Service transfers control to the boot
code, if found code if it has been located.
5. If no boot code If INT 19h does not find the boot sector code, it invokes INT
found, invoke INT 18h. By default, INT 18h displays the message "No boot de
18h. vice available, press F1 to continue." (See INT 18h DSR han
dier below.)
By default, the BIOS initializes INT 18h to point to a routine that displays a
message such as .. No boot device available, press F1 to continue."
In a PC BIOS, INT 18h loads the ROM-based BASIC interpreter, if one exists.
continued
continued
Read/Write
Introduction
This appendix lists, separately, the error messages generated by the IBM AT
BIOS and the Phoenix AT-compatible BIOS.
In this appendix
The tables on the following pages present all Phoenix BIOS error messages,
their causes and corrective actions. The following types of messages are
documented:
• IBM BIOS POST and Boot Messages
• Phoenix BIOS POST and Boot Messages
• Phoenix BIOS Run-Time Messages
• Phoenix BIOS Beep Codes
• SETUP Messages
Error
Number Message Possible Cause
102
System Board Error System timer failed.
SETUP)
201 Memory Error RAM failed test.
Is bad.
is bad.
601
Diskette Error
Diskette drive or controller bad.
602
Diskette Boot Record Error No boot sector on diskette.
continued
Error
Number Message Possible Cause
keyboard.
FDD A Is not Installed Can not find diskette con Either Install or replace the
troller for diskette drive A controller card.
continued
FDD B Is not Installed Can not find diskette con Either Install or replace the
troller for diskette drive B controller card.
configured Incorrectly.
· Wrong number of
diskette drives.
Keyboard clock line failure Either the keyboard or the Make sure the keyboard
keyboard cable connection cable and keyboard are con
Keyboard data line failure Is defective. nected properly.
Keyboard controller The keyboard controller
-
Check the keyboard
failure firmware has failed. controller.
Keyboard stuck key A key(s) is jammed. Try pressing the key (s)
failure again.
Memory address line fall Circuitry associated with the Check the circuitry.
ure at hex-value, read memory chips has failed.
hex-value, expecting
hex-value
Memory data line failure One of the memory chips or Replace the memory chips.
at hex-value. read associated circuitry has
hex-value, expecting failed.
hex-value
Memory high address line Circuitry associated with the Check the circuitry.
failure at hex-value, read memory chips has failed.
hex-value. expecting
hex-value
Memory double word Memory chip circuitry Replace the memory chip.
logic failure at hex-value, failed.
read hex-value, expect-
Ing hex-valu.e
Memory odd/even logic Circuitry associated with the Check the circuitry.
failure at hex-value, read memory chips has failed.
hex-value, expecting
hex-value
Memory parity failure at One of the parity memory Try replacing the memory
hex-value, read chips has failed. chips.
hex-value, expecting
hex-value
continued
Memory write/read failure One of the memory chips Try replacing the memory
at hex-value, read has failed. chips.
hex-value, expecting
hex-value
No boot device available Either diskette drive A:, the Retry boot. If that doesn't
- strike F1 to retry boot hard disk, or the diskette it work, replace the diskette or
self Is defective. the hard disk.
No boot sector on hard The C: drive Is not format Format the C: drive, make it
disk - strike F1 to retry ted or is not bootable . bootable.
boot
Not a boot diskette The diskette in drive A: is Replace the diskette with a
strike F1 to retry boot not formatted as a bootable bootable diskette and retry
diskette. boot.
No timer tick Interrupt The timer chip has failed. Check the timer chip on the
system board.
Hex-value optional The peripheral card Replace the peripheral card.
ROM bad checksum = contains a defective ROM.
hex-value
Shutdown failure The keyboard controlier or Check the keyboard
its associated logic has controlier.
failed.
Time-of-day clock The CMOS real time clock Run the SETUP utility.
stopped chip has failed.
Time-of-day not set Clock not set. Run the SETUP utility.
please run SETUP
program
Timer chip counter 2 Chip failed. Check the timer chip system
failed board.
Timer or Interrupt con Either the timer chip or the Check the timer chip or the
trolier bad interrupt controlier is interrupt controller on the
defective. system board.
Unexpected interrupt in The nonmaskable interrupt Check the system board,
protected mode (NMI) port can't be particularly the logic associ
disabled. ated with the non-maskable
interrupt.
Last boot Incomplete Incorrect configuration of Reconfigure Intel 82335.
Intel 82335 chip set.
continued
Informational messages
Message Meaning
Strike the F1 key to continue This message Indicates that an error was
found during POST. Pressing the F1 key
allows the system to attempt to boot.
Base Memory size = 64K Used in reporting base memory for
Extended Features.
Extended Memory size = OOOOOK Used In reporting extended memory size for
Extended Features.
Run-time messages
Run-time messages are displayed if an error occurs after the boot proce
dure is complete.
110 card parity interrupt The peripheral card has Type (S)hut off NMI.
at address. Type (S)hut failed. Note: This will only tempo
off NMI, (R)eboot, other rarily allow the user to
keys to continue continue. The user
must replace the
peripheral card.
Memory parity interrupt A memory chip(s) has Type (S)hut off NMI.
at address. Type (S)hut fa.iled.
off NMI, (R)eboot, other Note: This will,only tempo
keys to continue rarily allow the user to
continue. The user
must replace the
memory chip(s).
Unexpected HW Interrupt This could be any Check the hardware.
Interrupt at address. hardware-related problem.
Type (R)eboot, other
Note: Not displayed if the
keys to continue extended interrupt
handler is not
enabled.
Unexpected SW interrupt There is an error ( s) in the Try turning the machine off
Interrupt at address. software program. and then on again. If that
Type (R)eboot, other doesn't work, check the
keys to continue Note: Not displayed If the
extended interrupt program.
handler is not
enabled.
Unexpected type 02 In There is an error(s) in the Try turning the machine off
terrupt at address. Type software program. and then on again. If that
(S)hut off NMI, (R)eboot, doesn't work, check the
other keys to continue Note: Not displayed if the
program.
extended interrupt
handler is not
enabled.
Description
Sometimes POST errors cannot be reported on the screen. When an error
occurs before the screen is initialized or when the system is set to loop on
the system board tests, then the screen cannot display the error message.
Systems with a Phoenix AT-compatible BIOS will then generate beep codes,
which may be used to identify a POST error that occurs when the screen is
not available.
Example
A 2-1-4 beep code (a burst of 2 beeps, a single beep, and a burst of
4 beeps) indicates a failure of bit 3 in the first 64K of RAM.
continued
Diagram
The diagram below shows the process performed by the system if an error
occurs and the screen is unavailable.
System checks
FAILBEEP option
System sounds
beep code
continued
Looping on sys- Beep and halt Beep and halt Not applicable
tem board tests
(MAN LOOP set
to True)
Normal power Beep and halt Screen message and Screen message and
on (MANLOOP prompt to 'Press F1 prompt to 'Press F1
set to False) to continue' to continue'
continued
Beep Contents
continued
Beep Contents
3-1-1
20h Slave DMA register failure
3-1-2 21h Master DMA register failure
3-1-3 22h Master interrupt mask register failure
3-1-4 23h Slave interrupt mask register failure
continued
Beep code~ 4-2-1 through 4-4-3 are only reported through the speaker and
sent to the diagnostic port if the manufacturing loop option switch MAN LOOP
is set to TRUE and the manufacturing jumper indicator is on in POST. Other
wise, these errors are reported via the screen.
The following table describes the beep codes and error codes that are
written to Port BOh for non-fatal system board errors.
Beep Contents
Code Port 680h Description
Configuration messages
All error messages that can be displayed by the SETUP utility are listed
below. Each error message is followed by a description of the problem and
a suggested action you can take to correct the problem.
Clock chip lost power The clock chip is not Replace battery. Run SETUP;
(hit any key to continue) working. check all configuration
settings.
CMOS checksum invalid There is a configuration Run SETUP; check all con
(hit any key to continue) error. figuration settings.
Incorrect configuration Configuration data entered Run SETUP. Verify all settings
data in CMOS (hit any in SETUP is not the same are correct. If error persists.
key to continue) as the actual system com call the manufacturer's Tech
ponents. nical Support
Department.
Memory size in CMOS in Wrong base memory set. Run SETUP; correct error in
valid (hit any key to Base Memory field.
continue)
Disk C: failed initialization Incorrect fixed disk type. Run SETUP; correct the fixed
(hit any key to continue) disk setting.
Time or date in CMOS is The system clock time/date Run SETUP; correct the date
Invalid (hit any key to Is not the same as that or time field.
continue) entered in the SETUP
program.
Note: SETUP may not generate an error message if the incorrect diskette
drive information is supplied.
Introduction
This appendix describes the power-on self test and boot messages that may
be generated by both the IBM and the Phoenix XT BIOS.
Both the IBM and the Phoenix BIOS may generate a beep code under the
following conditions. If a power-on self test message occurs before the
video monitor testing is completed, there is no way for the BIOS to write an
error message to the screen. Therefore, the BIOS will sound one long beep
and then one short beep to indicate a POST error, and will stop all testing at
the point of the error.
The following tables list these messages and describe their possible causes
and suggested corrective actions.
continued
Stuck key scancode = Key stuck on keyboard. Loosen stuck key. Check
hex-value scan code table to identify
key.
Timer or Interrupt Interrupt controller or timer Replace system board.
Controller Bad chip inoperative.
Timer chip counter 2 Timer bad. Replace'system board or
failed timer chip.
128K not OK. parity First 128K of RAM failed Reboot. If message repeats.
disabled parity test. replace bad RAM chip($).
Keyboard bad Keyboard failed POST Retry. If message persists.
tests. replace keyboard.
Error. Press F1 key to A recoverable error Press F1 to continue (there
Non-System disk or disk No boot diskette or disk Use a system disk to boot
continue.
Disk boot error. Replace Boot data not readable Use a boot diskette/disk to
RAM bad Memory failed POST tests. Replace bad RAM chips.
continued
8087 NMI at address. An NMI occurred on access Type (Slhut off NMI.
Type (Slhut off NMI. to the math coprocessor. Note: This will only tempo
(Rleboot, other keys to rarify allow you to
continue. continue. You must
replace the peripheral
card.
Memory parity NMI at A memory chlp(sl has Type (Slhut off NMI.
address. Type (Slhut off failed. Note: This will only tempo
NMI, (Rleboot, other rarily allow you to
keys to continue. continue. You must
replace the memory
chip(sl.
Unexpected HW interrupt This could be any hardware- Check the hardware devices
interrupt at address. related problem. for loose cables, malfunc
Type (Rleboot, other Note: Not displayed if the tions, and other problems.
keys to continue. extended interrupt
handler is not
enabled.
Unexpected SW Interrupt There Is an error(sl in the Turn the machine off and
interrupt at address. software program. then on again. If that doesn't
Type (Rleboot, other Note: Not displayed if the work, check the program.
keys to continue.
extended interrupt
handler Is not
enabled.
1/0 card NMI at address. An NMI occurred on access Turn the machine off and
Type (Slhut off NMI, to an adapter card. then on again. If that doesn't
(Rleboot, other keys to work, replace the adapter
continue. card.
Adapter Card
A circuit board that can be installed into one of the expansion slots inside
a PC, XT, AT, or IBM-compatible computer in order to expand the capabili
ties of the computer.
Adapter ROM
The read-only memory on the adapter, which contains code to control the
adapter device. An adapter is a peripheral card that extends the operation
of the system. For example, a fixed disk drive controller is an adapter that
may have an adapter ROM.
Address Bus
One or more lines (conductors) that carry address codes from the micro
processor to all parts of the system.
Analog
Data transmitted in a continuously varying physical quality.
Arbitration
Arbitration is a process through which devices compete for possession of
the channel on a prioritized basis.
continued
Glossary 485
Glossary, Continued
Arbitration Level
Arbitration levels are the levels of priority assigned to devices that compete
for possession of the channel.
AT-Compatible Computer
Any computer that can run software programs written for an IBM AT
computer.
BIOS Service
A software routine that services a given peripheral device, and provides an
interface between the operating system and the hardware. These services
are single task, call/return functions.
Buffer
An area of storage temporarily reserved for I/O operations.
Burst Mode
Burst mode is a method of DMA transfer that allows a device to remain in
active for long periods and then send large amounts of data in a short time.
Bus
One or more lines (conductors) that carry signals or power.
Bus High Enable (BHE)
A line on the 80286 processor that produces a signal, used in conjunction
with the address 0 signal, to specify if data is transferred in words or bytes.
continued
Byte
Eight contiguous bits; a bit is the smallest item of information that a com
puter can process.
Cache
Method of using a fast device to speed up access to a slow device.
Channel
A path constructed specifically for moving data.
Configuration
The process of setting up all the parts of the computer so they run
effectively.
Conventional memory
Memory located between addresses 0 and 1 MB. The memory that can be
addressed by DOS.
Cylinder
Tracks on a diskette or fixed disk that can be accessed without moving the
read/write heads.
Default
A value, setting. or option that is assigned by the program or system.
continued
Glossary 487
Glossary, Continued
DMA Controller
A DMA controller is a device which gives addresses and control signals to
the device that has won the bus through arbitration. The controller does not
enter into the arbitration itself.
DMA Device
A DMA device enters into arbitration for the channel. If it wins, it receives
addresses and control signals from the DMA controller so it can read or
write data.
Expanded Memory
For AT-compatible systems, up to 32 MB of additional "paged" memory
above the DOS 640K limit. Application programs written according to LIM
EMS or AST EEMS specifications can use this type of memory. Examples of
such programs are Lotus 1-2-3, Symphony and Framework.
continued
Extended Memory
The memory above 1 MB. XENIX and IBM's VDISK can use this memory, but
DOS and almost all application programs cannot, since use of the protected
mode of the Intel 80286, 80386SX, or 80386 microprocessor is required.
Hardware
The physical equipment and components in the computer system.
Head
The read/write head on a diskette or fixed disk drive. The device that pro
vides access to the data on the media.
Interrupt
The suspending of microprocessor program execution by a demand for
attention coming from a peripheral device. After the interrupt has been ser
viced, the suspended microprocessor task can be resumed where it was
broken off by the interrupt.
Kilobytes (K)
1024 bytes.
Known State
When a device is initialized or reset, and then set to a particular pre
established condition, it is said to be in a known state.
continued
Glossary 489
Glossary, Continued
Main Memory
The memory between 0 and 1 MS. Another term for conventional memory.
Megabyte (MB)
One million, or 1024 x 1024 bytes.
Memory
A device that can store data recorded in it and from which the data can be
retrieved.
Microprocessor
Central processing unit, or "brain" of the computer.
Multitasking
Multitasking programs execute multiple program modules simultaneously.
Information input into one module does not need to be processed completely
before information can be .input into another module.
Offset
A method of addressing that defines an address as relative to the beginning
of a memory segment.
Operating System
Generic systems software which controls the execution of applications
software.
Parameter
Value, option, or setting that can be set in two or more ways.
continued
Program
A set of instructions defining the operations of a computer in order to
achieve the desired results.
Selector
A value contained in a segment register (such as the CS, OS, SS, or ES
segment registers) when in protected mode. This value determines what
segment is currently being used; e.g., with CS, what segment is being used
for executing code.
Single-Tasking
Single-tasking operating systems can only execute one program module or
routine at a time. Information input into a module or routine mustbe pro
cessed completely before information can be input into another module.
Software
A comprehensive term used to identify all of the non hardware components
of a computer. Software includes computer programs and data.
continued
Glossary 491
Glossary, Continued
System Board
A large circuit board that holds most of the main electronic parts of the
computer.
Task
In an 80386, a task is the execution of a single process or set of instructions
to perform a particular function. It is not the same as an operating system
task.
Time-Out
When the interval of time expected for a certain process (an interrupt) to
occur is exceeded.
Track
A segment of a diskette or fixed disk that is parallel to the edge of the
media and that can be accessed by the drive read/write head without the
head moving.
Write Precompensation
A procedure where the timing of the head current on a diskette or fixed disk
drive is varied depending on the head's position (anywhere from outer tracks
to the inner tracks) in order to keep the Write signal constant. Often given
as a cylinder number, as in the cylinder number where the write proecom
pensation procedure is to begin.
The following books provide additional material related to the PC, XT, and AT
BlOSs:
Corporation, 1988.
Duncan, Ray. IBM® ROM BIOS. Redmond, WA: Microsoft Press, 1988.
Corporation, 1982.
Corporation, 1985.
continued
Norton, Peter. Inside the IBM® PC. New York, NY: Brady Books, a division of
Simon and Schuster, 1986.
Norton, Peter and Wilton, Richard. The New Peter Norton Programmer's
Guide to the IBM® PC and PSI2®. Redmond, WA: Microsoft Press, 1988.
494 System BIOS for IBM PC/XT IAT Computers and Compatibles
tndex
A
Abbreviations, xxvii-xxx resetting of, 445
Acronyms, xxvii-xxx
Alt key, 127, 149
Adapters
Alternate Fixed Disk Reset, Fixed Disk
241-246
video, 2, 162
171-172
474
421
Index 495
A. cont'd
117-120
186, 259
adapter. 85
Blink bit, toggling of, 223
memory, 404-407
197
Booting. 110
421
326
sectors for. 464
326
Boundary error, DMA, 285, 326
336
28
259
test. 347-348
data
pointer to, 32, 46, 130
257
subfunction, 399
printing of, 419-420, 424
142, 148
in CMOS RAM, 55
389-392
for expansion ROM, 108
257-258
Clear to send serial controller signal,
317,319
Clocking mode register. 96. 99. 179.
184, 257
105
Clocks, dot, 165. 168
Index 497
C, cont'd
11, 30
477
Colors
available, 250
accessing of, 51
262
54-55
paging status for, 229
53, 435
See also Palettes
Codes
Command mode register, Intel 8255,
character
Compatibility, xx
shutdown, 109
Composite video signals, :~7-168
186, 259
186, 259
Hercules switch register for, 87
Control bytes
315-316,321
333
151-160
Ctrl key
Contml registers
in pause state table, 135
142, 148
mode, 172
flag for, 34
for PIT, 76
for, 326
Ctrl-Scroll Lock, 124, 131, 133
Service, 352
192, 260
Service, 351
coprocessors
Current value of 8x8 and 8x9 register,
for, 292
Cursor
Copying of blocks
position of, 33, 39, 192, 258, 260
diskette, 288
array of, 250
memory, 404-407
CGA, 177
Counters
EGA, 97, 180
324-325
VGA, 100, 185
Index 499
C, cont'd
Cyclic redundancy check
Data segment descriptor format, 406
362
333
Data terminal ready serial controller
signal, 36
Data ports
Service, 296
282-283
186, 259
274, 421
Diagnostics
controller for
351-352
information for, 36, 44, 276
281-283, 448
283
182-183
254-255
301
vector, 11, 30
Diskette Service
464
Detect Media Change, 296
code, 285
Format Diskette Track, 291-292
300-301
Read Diskette Status, 287
Index 501
D. cont'd
Display combination code
registers for. 72-73. 78-80. 281.
active, 250
474
Display screen
vector, 9, 28
Service
from. 211
code, 326
456
212-214
E
28
ECC. See Error correction code
Divisor latch for serial port. 82. 90.
Edit keys. 124
367, 370
error codes and message for. 118. Enable/disable register for video. 98.
285. 326. 481
101. 181. 186, 259
474
shades. Video Service
subfunction, 245
for Parallel Printer Service, 418,
423
185, 258
Extended keyboard
Equipment installed data in CMOS shift flags for, 32, 46, 130
316,321
Extra memory, message for, 469
480
Feature control register, 87-88, 96,
324-326
414
Index 503
F. cont'd
Filters. keyboard. 127. 140-141. 145. Format Cylinder. 334-335
147. 393
Format Drive. 337
control byte for. 34. 63. 68-69. Read Fixed Disk Type. 354-355
controller for
Read Sectors. 329-330
327
disk
29-30.63-69.311.315-316
information. 55
print. 40
324-325
reset. 38. 46. 48
sector. 326
147-148
functions.
Fonts
347
Format Bad Track. Fixed Disk
348
Format Cylinder. Fixed Disk Service.
Service, 291-292
mode character generator, pointer
to, 195
Formats
diskette, 271-272
to, 229, 245
video, 169-1 70
H
Function keys, 124
249-253
Hardware
300-301
for, 107
settle time of, 62, 280
317-320
General registers
maximum number of, 63, 68-69,
409-410
168
Graphics
94-96, 100, 175, 179-180, 185,
Index 505
H, cont'd
Horizontal display enable end, video,
command word for, 73-74,
258
error message for, 466
table, 365
165
Initialize Printer, Parallel Printer
258
Serial Communications Service,
444
Input control register for VGA, 88
I
Ins keys in pause state table, 135
129-130,142,148
INT mnemonic, 6
127
Index register
control register for, 76, 128, 462
Information flag, 55
274, 421
chip, 123
Initialization
Intel 8259 programmable interrupt
of baud rate, 70
controller, 75, 382
412
message, 470
436
for Bootstrap Loader Service, 462
alarm, 452
for keyboard, 128-1 29
Interrupts, 4-6
31, 367-372
last, 33, 38
388, 475
ISA. See Interrupt service routines
status register for, 85
unexpected, 12-13
J
parameter error code, 326
Joystick support, 379, 382
285
System Services for, 400-401
K
Invalid op code, interrupt vector for,
9, 28
KEYB command (MS-DOS) for foreign
keyboards, 125
vector, 9, 28
Keyboard
Index 507
K, cont'd
full, 144
393
message, 464
L
data service definitions for, 45-46
Landing zone
481-482
fixed disk drive, 64-66, 317-320
28-29
Keyboard Service
145
180, 185, 258
146-147
Line feed character. 218
Status, 147-148
84, 92, 369. 372. 375
143
236
142, 147-148
Load Character Generator, Video
29
controller, 451
Masks
error code for, 285
Memory
for PIC, 78
480,484
code, 475
Index 509
M, cont'd
size of, 41
DMA, 72, 80, 281
RAM data
184, 257
emulation of, 190-191
483
support for, 16, 170
317-319
Monochrome monitors, 166, 475
440-441, 444
442-443
Miscellaneous registers
Motorola 6845 CRTC
257
compatible lID port numbers for,
for PIT, 76
33, 39, 192, 260
253, 259
Motorola MC146818A real time clock,
49,51,382,397,427,432-433
Model byte, 60, 384, 414
Motors
389-390
Modes
diskette
registers
time-out count for, 32, 42, 274,
control, 172
446-447
185, 258
fixed disk, 306
46, 130
and portability, 3
o
support for, 300
OCW register for PIC, 74-75,
323-324
Offset
260
controller, 360
to keyboard buffer, 34, 46, 130
318-319
Operating system
Networks, 1/0 port for, 85
interrupts for, 5
110, 468
Overflow
326
119-120
259
113-120
142, 148
Page table address register, 78
Index 511
P. cont'd
Pages. video. 188-190. 250
video. 10. 29. 37. 40. 58.
Parity errors
Palettes
PC computer. 2-3
186. 259
model byte for. 59-60. 384. 414
476
PE signal. 418
Parallel printers
number of. 31
279-280
mask for. 102. 187. 262
311. 31 5-31 6
writing of. 216
186, 259
entry point for, 58
259
error message for, 464
251
and Video Service pointer tables,
193
Pointers
Preset row scan, 94-95, 97, 100,
317-318
generator, 19
Service, 424
237-238
195
Printers. See Parallel printers
Pointing devices, 31, 39, 41, 47,
Process boot failure interrupt vector,
274, 421
10, 29
Portability, 3, 171
Processor
476
reset vector for, 104
communications
198
98, 181
Services, 396
107-108
382
Index 513
P, cont'd
OCW for, 75, 323-324
Read block of color registers, Video
385-386, 436
Read Cassette, System Services. 391
Protected mode
Read current switch settings, System
Service. 293-294
Service. 338-339
295
RAM
Services, 408
subfunction, 224
Service, 208
Service, 341-342
397, 427, 432-433
Service, 426
Receive Character, Serial
subfunction, 401
329-330
Re-entering real mode, 109
448
clock
Resolution, display screen, 165, 168,
Index 515
R. cont'd
Retrace. video. 94-95. 97. 100. 175. error message for. 465. 480-481
242-243
60
subfunction, 255
XT fixed disk parameter table.
68-69
Service, 142
Row scan. preset. 94-95. 97. 100.
175. 177. 180. 185. 258
413-414
220
communications
s
Save area. dynamiC. pointer to. 194
362
Save current video state. Video
450
63-67
date built. 59
available. 252
Service, 210
Seek to Cylinder, Fixed Disk Service,
345
Service, 210
Segment Not Present interrupt vector,
10, 29
142, 148
Select New Video Page, Video
port for, 86
Select register, color, 102, 187, 262
317-319
Video Service subfunction, 244
generator, 197
SELECT IN signal, 418
440-441, 444
Sense operation failed error code,
326
Sequencer registers, 87-88, 96, 99,
Sectors
317-320
data definitions for, 45
long, 341-344
time-out table for, 34, 45
Index 517
S, cont'd
Port, 374-375
Time-of-,Day Service, 443
subfunction, 222
218
Set Sound Source, Time-of-Day
Service, 445
44, 277
Set System Timer Time Counter,
Service, 204-205
subfunction, 233
Set user graphics font pointer at INT
206
43h, Video Service subfunction,
297
Set Video Mode, Video Service, 203
Services, 397-399
subfunction, 398
character codes with, 1. 51-160
Set Media Type for Format, Diskette in pause state table, 135
Service, ·298-299
Shutdown
subfunction, 222-223
for Parallel Printer Service, 418
Service, 221-229
Single function BIOS services,
Size
Starting reduced write current
of diskettes, 266
Starting write precompensation
475
State register, DAC, 99, 102, 184,
address, 250
characters, 21 8
for fixed disks, 34, 43, 275, 313,
328
of printer, 426
vector, 10, 29
282-283
321
85, 313, 324-325
input, 87-88
185, 258
Video Service subfunction, 229
Index 519
S, cont'd
261
Turn Cassette Motor On, 389
Wait, 403
subfunction, 246
Write to Cassette, 392
400
returning of, 413-414
routine, 243
for, 107
148, 402
for, 59
System
464
447
Parameters, 413-414
148
Mode, 409-410
for MDA, 174
message, 464
interrupt vector for, 10, 29
438
389-392
Reset Real Time Clock Alarm, 445
347-348
Set Sound Source, 445
Service, 349
439
Testing
System Timer ISR, 446-448
of PIC, 105
Time-out and time-out tables
of PIT, 105
check drive, 68-69, 316. 321
447
194, 197
format drive, 68-69. 316, 321
Time
beep code for. 476
delays, 403
count of. 33. 48. 279. 386. 434.
Time-of-day clock
error messages for, 468. 482
Index 521
T, cont'd u
registers for, 386
Uncorrectable ECC or CRC error
484
Tracks
handler for, 12-13
subfunction, 239
Services, 390
Services, 389
User text mode fonts, 231, 235
279
29
450
Type
of media, 298-299
258
165
pointer table for. 195
258 '
Read Current Cursor Position, 207
Video
Return Functionality/State
186, 259
Set Color Palette, 215
modes for
Write Character/Attribute to Screen,
212-213
214
274, 421
Write Pixel, 21 6
read/write, 262
218-219
supported, 252
subsystem for, 87
enable for, 99, 184
199-201
Index 523
w
450
285
Service. 218-219
Work area
XT computers, 2-3
Service, 289
fixed disk parameter table for,
68-69, 316
functions for, 14
code, 326
nonmaskable interrupts for.
Service. 343-344
POST error handling in, 111
73.80