6139362_PC_AT_Technical_Reference_Sep85 6139362 PC AT Technical Reference Sep85

6139362_PC_AT_Technical_Reference_Sep85 6139362_PC_AT_Technical_Reference_Sep85

User Manual: 6139362_PC_AT_Technical_Reference_Sep85

Open the PDF directly: View PDF PDF.
Page Count: 507

Download6139362_PC_AT_Technical_Reference_Sep85 6139362 PC AT Technical Reference Sep85
Open PDF In BrowserView PDF
------ - ----------- --- _--.-

Personal Computer
Hardware Reference
Library

Technical
Reference

First Edition (September, 1985)
The following paragraph does not apply to the United Kingdom or any country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES
CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR
FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of
express or implied warranties in certain transactions, therefore, this statement may not
apply to you.
This publication could include technical inaccuracies or typographical errors. Changes are
periodically made to the information herein; these changes will be incorporated in new
editions of the publication. IBM may make improvements and/or changes in the
product(s) and/or the program(s) described in this publication at any time.
It is possible that this publication may contain reference to, or information about, IBM

products (machines and programs), programming, or services that are not announced in
your country. Such references or information must not be construed to mean that IBM
intends to announce such IBM products, programming, or services in your country.
Products are not stocked at the address below. Requests for copies of this publication and
for technical information about IBM Personal Computer products should be made to your
authorized IBM Personal Computer dealer, IBM Product Center, or your IBM Marketing
Representative.
The following paragraph applies only to the United States and Puerto Rico: A Reader's
Comment Form is provided at the back of this publication. If the form has been removed,
address comments to: IBM Corporation, Personal Computer, P.O. Box 1328-C, Boca
Raton, Florida 33432. IBM may use or distribute any of the information you supply in
any way it believes appropriate without incurring any obligations whatever.

© Copyright International Business Machines Corporation 1985

Federal Communications Commission
Radio Frequency Interference Statement
Warning: The equipment described herein has been
certified to comply with the limits for a Class B computing
device, pursuant to Subpart J of Part 15 of the FCC rules.
Only peripherals (computer input/output devices, terminals,
printers, etc.) certified to comply with the Class B limits may
be attached to the computer. Operation with non-certified
peripherals is likely to result in interference to radio and TV
reception. If peripherals not offered by mM are used with
the equipment, it is suggested to use shielded grounded cables
with in-line filters if necessary.
CAUTION

This product described herein is equipped with a grounded
plug for the user's safety. It is to be used in conjunction with
a properly grounded receptacle to avoid electrical shock.

iii

Notes:

iv

Preface

This manual describes the various units of the IBM Personal
Computer AT and how they interact. It also has information
about the basic input/output system (BIOS) and about
programming support.
The information in this publication is for reference, and is
intended for hardware and program designers, programmers,
engineers, and anyone else who needs to understand the design
and operation of the IDM Personal Computer AT.
This manual consists of nine sections:
•
•
•
•
•
•
•

The first three sections describe the hardware aspects of the
IBM Personal Computer AT including signal charts and
register information.
.
Section 4 describes keyboard operation, the commands to
and from the system, and the various keyboard layouts.
Section 5 contains information about the usage of BIOS and
system BIOS listing.
. . .
Section 6 contains instruction sets for the 80286
microprocessor arid the 80287 math coprocessor.
Section 7 provides information about characters, keystrokes,
and colors.
. .
.
Section 8 has general communications information.
Section 9 contains information about the compatibility of the
IDM Personal Computer AT and the r~st of the IDM
Personal Computer family ..

a

A glossary of terms and a bibliography of related publications are
included.

v

Prerequisite Publications
Guide to Operations for the IBM Personal Computer AT
Suggested Reading
•

BASIC for the IBM Personal Computer

•

Disk Operating System (DOS)

•

MACRO Assembler for the IBM Personal Computer

vi

Contents

SECTION 1. SYSTEM BOARD ..................... 1-1
Memory .................................... 1-4
Microprocessor ............................... 1-4
System Performance ........................... 1-7
Direct Memory Access ......................... 1-9
System Interrupts ............................ 1-12
Hardware Interrupt Listing ................. 1-13
Interrupt Sharing .... . . . . . . . . . . . . . . . . . . . .. 1-14
System Timers .............................. 1-22
System Clock ............................... 1-23
ROM Subsystem ............................. 1-23
RAM Subsystem ............................. 1-24
I/O Channel ................................ 1-24
Connectors ............................. 1-25
I/O Channel Signal Description ............. 1-31
NMI and Coprocessor Controls ............. 1-38
Other Circuits ............................... 1-40
Speaker ................................ 1-40
RAM Jumpers ........................... 1-40
Display Switch .......................... 1-41
Variable Capacitor ....................... 1-41
Keyboard Controller ...................... 1-42
Real-Time Clock/CMOS RAM Information ... 1-56
Specifications ............................... 1-69
System Unit ............................ 1-69
Connectors ............................. 1-71
Logic Diagrams - Type 1 .................. 1-76
Logic Diagrams - Type 2 .................. 1-98
SECTION 2. COPROCESSOR ......................
Description ..................................
Programming Interface .........................
Hardware Interface ............................

2-1
2-3
2-3
2-4

SECTION 3. POWER SUPPLY ...................... 3-1
Inputs ...................................... 3-3

vii

Outputs .....................................
DC Output Protection .........................
Output Voltage Sequencing .....................
No-Load Operation ...........................
Power-Good Signal ............................
Connectors ..................................

3-4
3-4
3-4
3-5
3-5
3 -7

SECTION 4. KEYBOARD .......................... 4-1
Description .................................. 4-3
Power-On Routine ............................ 4-4
Commands from the System ..................... 4-5
Commands to the System ....................... 4-9
Keyboard Scan-Code Outputs .................. 4-11
Clock and Data Signals ........................ 4-12
Keyboard Layouts ........................... 4-15
Specifications ............................... 4-22
Logic Diagram .............................. 4-23
SECTION 5. SYSTEM BIOS ........................ 5-1
System BIOS Usage ........................... 5-3
Keyboard Encoding and Usage .................. 5-13
Quick Reference ......................... ,... 5-24
SECTION 6. INSTRUCTION SET ................... 6-1
80286 Instruction Set .......................... 6-3
Data Transfer ............................ 6-3
Arithmetic ............................... 6-6
Logic ................................... 6-9
String Manipulation ...................... 6-11
Control Transfer ......................... 6-13
Processor Control ........................ 6-17
Protection Control ....................... 6-18
80287 Coprocessor Instruction Set ............... 6-22
DataTransfer ........................... 6-22
Comparison ............................ 6-23
Constants .............................. 6-24
Arithmetic .............................. 6-25
Transcendental .......................... 6-26
SECTION 7. CHARACTERS, KEYSTROKES, AND
COLORS .........................••........... 7-1
Character Codes .............................. 7-3
Quick Reference ............................. 7-14

viii

SECTION 8. COMMUNICATIONS .................. 8-1

Hardware ................................... 8-3
Establishing a Communications Link .............. 8-5
SECTION 9. IBM PERSONAL COMPUTER
COMPATIBILITY ............................... 9-1

Hardware Considerations ....................... 9-3
System Board ............................ 9-3
Fixed Disk Drive .......................... 9-5
Diskette Drive Compatibility ................ 9-5
Copy Protection .......................... 9-5
Application Guidelines ......................... 9-7
High-Level Language Considerations .......... 9-7
Assembler Language Programming Considerations 9-8
Multitasking Provisions .................... 9-16
Machine-Sensitive Code ................... 9-19
Glossary

................................... Glossary-1

Bibliography .............................. Bibliography-1
Index ........................................ Index-1

ix

Notes:

x

INDEX TAB LISTING
Section 1: System Board ............................... .

Section 2: Coprocessor ................................ .

Section 3: Power Supply ............................... .

Section 4: Keyboard .................................. .

Section 5: System BIOS ............................... .

Section 6: Instruction Set .............................. .

xi

Notes:

xii

Section 7: Characters, Keystrokes, and Colors .............. .

Section 8: Communications ............................ .

Section 9: Compatibility ............................... .

Glossary .................................. ; ........ .

Bibliography ........................................ .

Index .............................................. .

System Block Diagram
System Unit
System Board
80286
Microprocessor

80287
Coprocessor

Oscillator

Power Supply

16 Interrupt
Levels

ROM

Speaker
Connector

Speaker

7 Channel
DMA

RAM

Keyboard
Controller

Keyboard

CMOS

Real-Time
Clock

Battery
Connector

Battery

1/0

Channel

115/230

00000000
DDDDD D
I

xiv

•I

Adapters

I

Fixed
Disk
Drives

Diskette
Dr i ves

I

I

Fixed Disk and
Diskette Adapter

SECTION 1. SYSTEM BOARD

Contents
Memory ........................•................ 1-4
Microprocessor ................................... 1-4
Real Address Mode .......................... 1-4
Protected (Virtual Address) Mode .............. 1-5
System Performance ............................... 1-7
Direct Memory Access

............................. 1-9

System Interrupts ................................
Hardware Interrupt Listing ......................
Interrupt Sharing ..............................
Design Overview ...........................
Program Support ...........................
Precautions ...............................
Examples .................................

1-12
1-13
1-14
1-14
1-15
1-17
1-18

System Timers ..........................•........ 1-22
System Clock ................................•... 1-23
ROM Subsystem

1-23

RAM Subsystem

1-24

110 Channel

1-24
1-25
1-31
1-38

....................................
Connectors ..................................
I/O Channel Signal Description ..................
NMI and Coprocessor Controls ..................

Other Circuits .............................•.•... 1-40
Speaker ..................................... 1-40
RAM Jumpers ................................ 1-40

System Board

1-1

I

Display Switch ............ ;...................
Variable Capacitor ............................
Keyboard Controller .. ,........................
Keyboard Controller Initialization ..............
Receiving Data from the Keyboard .............
Scan Code Translation .......................
Sending Data to the Keyboard .................
Inhibit ...................................
Keyboard Controller System Interface ..........
Status Register .............................
Status-Register Bit Definition .................
Output Buffer .............................
Input Buffer ...............................
Commands (I/O Address Hex 64) .............
I/O Ports .................................
Real-Time Clock/CMOS RAM Information ........
Real-Time Clock Information .................
CMOS RAM Configuration Information .........
I/O Operations .............................
Specifications

................................... 1-69

System Unit ..................................
Size .....................................
Weight ...................................
Power Cables ..............................
Environment ..............................
Heat Output ...............................
Noise Level ...............................
Electrical .................................
Connectors ..................................
Logic Diagrams - Type 1 ........................
Logic Diagrams - Type 2 ........................

1-2

1-41
1-41
1-42
1-42
1-43
1-43
1-48
1-48
1-48
1-49
1-49
1-50
1-51
1-51
1-54
1-56
1-57
1-59
1-68

System Board

1-69
1-69
1-69
1-69
1-69
1-70
1-70
1-70
1-71
1-76
1-98

The type 1 system board is approximately 30.5 by 35 centimeters
(12 by 13.8 inches). The type 2 system board is approximately
23.8 by 35 centimeters (9.3 by 13.8 inches). Both types of
system boards use very large scale integration (VLSI) technology
and have the following components:
•

Intel 80286 Microprocessor

•

System support function:
Seven-Channel Direct Memory Access (DMA)
Sixteen-level interrupt
Three programmable timers
System clock

•

64K read-only memory (ROM) subsystem, expandable to
128K

•

A 512K random-access memory (RAM) Subsystem

•

Eight input/output (I/O) slots:
Six with a 36-pin and a 62-pin card-edge socket
Two with only the 62-pin card-edge socket

•

Speaker attachment

•

Keyboard attachment

•

Complementary metal oxide semiconductor (CMOS)
memory RAM to maintain system configuration

•

Real-Time Clock

•

Battery backup for CMOS configuration table and
Real-Time Clock

System Board

1-3

Memory
The type 1 system board has four banks of memory sockets, each
supporting 9 128K-by-1-bit modules for a total memory size of
512K, with parity checking.
The type 2 system board has two banks of memory sockets, each
supporting 9 256K-by-1-bit modules for a total memory size of
512K, with parity checking.

Microprocessor
The Intel 80286 microprocessor has a 24-bit address, 16-bit
memory interface 1 , an extensive instruction set, DMA and
interrupt support capabilities, a hardware fixed-point multiply and
divide, integrated memory management, four-level memory
protection, 1G (1,073,741,824 bytes) of virtual address space for
each task, and two operating modes: the 8086-compatible real
address mode and the protected or virtual address mode. More
detailed descriptions of the microprocessor may be found in the
publications listed in the Bibliography of this manual.

Real Address Mode
In the real address mode, the microprocessor's physical memory is
a contiguous array of up to one megabyte. The microprocessor
addresses memory by generating 20-bit physical addresses.
The selector portion of the pointer is interpreted as the upper 16
bits of a 20-bit segment address. The lower 4 bits of the 20-bit
segment address are always zero. Therefore, segment addresses
begin on multiples of 16 bytes.

In this manual, the term interface refers to a device that carries signals between
functional units.

1-4

System Board

All segments in the real address mode are 64 K in size and may be
read, written, or executed. An exception or interrupt can occur if
data operands or instructions attempt to wrap around the end of a
segment. For example, a word with its low-order byte at offset
FFFF and its high-order byte at 0000. If, in the real address
mode, the information contained in the segment does not use the
full 64K, the unused end of the segment may be overlayed by
another segment to reduce physical memory requirements.

Protected (Virtual Address) Mode
The protected mode offers extended physical and virtual memory
address space, memory protection mechanisms, and new
operations to support operating systems and virtual memory.
Note: See "BIOS Programming Hints" in Section 5 for
special cautions while operating in the protected mode.

The protected mode provides a 1G virtual address space for each
task mapped into a 16M physical address space. The virtual
address space may be larger than the physical address space,
because any use of an address that does not map to a physical
memory location will cause a restartable exception.
As in the real address mode, the protected mode uses 32-bit
pointers, consisting of 16-bit selector and offset components.
The selector, however, specifies an index into a memory resident
table rather than the upper 16 bits of a real memory address. The
24-bit base address of the desired segment is obtained from the
tables in memory. The 16-bitoffset is added to the segment base
address to form the physical address. The microprocessor
automatically refers to the tables whenever a segment register is
loaded with a selector. All instructions that load a segment
register will refer to the memory-based tables without additional
program support. The memory-based tables contain 8-byte
values called descriptors.

System Board

1-5

Following is a block diagram of the system board.

1-6

System Board

System Performance
The 80286 microprocessor operates at 6 MHz, resulting in a clock
cycle time of 167 nanoseconds.
A bus cycle requires 3 clock cycles (which includes 1 wait state)
so that a 500-nanosecond, 16-bit, microprocessor cycle time is
achieved. Eight-bit bus operations to 8-bit devices take 6 clock
cycles (which include 4 wait states), resulting in a
WOO-nanosecond microprocessor cycle. Sixteen-bit bus
operations to 8-bit devices take 12 clock cycles (which include 10
wait states) resulting in a 2-microsecond microprocessor cycle.
The refresh controller steps one refresh address every 15
microseconds. Each refresh cycle requires 5 clock cycles to
refresh all of the system's dynamic memory; 256 refresh cycles
are required every 4 milliseconds. The following formula
determines the percentage of bandwidth used for refresh.

% Bandwidth used

5 cycles X 256

for Refresh

-------------4 ms/167 ns

1280
24000

= 5.3%

The DMA controller operates at 3 MHz, which results in a clock
cycle time of 333 nanoseconds. All DMA data-transfer bus
cycles are 5 clock cycles or 1.66 microseconds. Cycles spent in
the transfer of bus control are not included.
DMA channels 0, 1,2, and 3 are used for 8-bit data transfers, and
channels 5, 6, and 7 process 16-bit transfers. Channel 4 is used
to cascade channels 0 through 3 to the microprocessor.

System Board

1-7

The following figure is a system memory map.
Address

Name

Functi on

000000 to
07FFFF

512K system
board

System board memory

080000 to
09FFFF

128K

I/O channel memory - IBM Personal
Computer AT 128K Memory Expansion
Option

OAOOOO to
OBFFFF

128K video
RAM

Reserved for graphics display buffer

OCOOOO to
ODFFFF

128K I/O
expansion ROM

Reserved for ROM on I/O adapters

OEOOOO to
OEFFFF

64K reserved
on system board

Duplicated code assignment at
address FEOOOO

OFOOOO to
OFFFFF

64K ROM on the
system board

Duplicated code assignment at
address FFOOOO

100000 to
FDFFFF

Maximum
memory 15M

I/O channel memory - 512K to 15M
installed on memory expansion options

FEOOOO to
FEFFFF

64K reserved
on system board

Duplicated code assignment at
address OEOOOO

FFOOOO to
FFFFFF

64K ROM on the
system board

Duplicated code assignment at
address OFOOOO

System Memory Map

1-8

System Board

Direct Memory Access
The system supports seven direct memory access (DMA)
chartnels. Two Intel 8237A-5 DMA Controller chips are used,
with four channels for each chip. The DMA channels are
assigned as follows:
Controller 1
Ch 0 - Reserved
Ch 1 - SDLC
Ch 2 - Diskette ( IBM
Personai Computer)
Ch 3 - Reserved

Controller 2
Ch 4 - Cascade for Ctlr 1
Ch 5 - Reserved
Ch 6 - Reserved
Ch 7 - Reserved

DMA Channels

DMA controller 1 contains channels 0 through 3. These channels
support 8-bit data transfers between 8-bit I/O adapters and 8- or
16-bit system memory. Each channel can transfer data
throughout the 16M system-address space in 64K blocks.
The following figures show address generation for the DMA
channels.
Source

DMA Page Registers

Controller

Address

A23<---------->A16

A15<---------->AO

Address Generation for DMA Channels 0 through 3

Note: The addressing signal, byte high enable (BHE), is
generated by inverting address line AO.
I

I

System Board

1-9

DMA controller 2 contains channels 4 through 7. Channel 4 is
used to cascade channels 0 through 3 to the microprocessor.
Channels 5, 6, and 7 support 16-bit data transfers between 16-bit
I/O adapters and 16-bit system memory. These DMA channels
can transfer data throughout the 16M system-address space in
128K blocks. Channels 5, 6, and 7 cannot transfer data on
odd-byte boundaries.
Source

DMA Page Registers

Controller

Address

A23<---------->AI7

AI6<---------->Al

Address Generation for DMA Channels 5 through 7

Note: The addressing signals, BHE and AO, are forced to a
logicalO.
The following figure shows the addresses for the page register.
Page Register
DMA Channel
DMA Channel
DMA Channel
DMA Channel
DMA Channel
DMA Channel
DMA Channel
Refresh

0
1
2
3
5
6
7

1/0 Hex Address

0087
0083
0081
0082
008s
0089
008A
008F

Page Register Addresses

Addresses for all DMA channels do not increase or decrease
through page boundaries (64K for channels 0 through 3, and
128K for channels 5 through 7).
DMA channels 5 through 7 perform 16-bit data transfers. Access
can be gained only to 16-bit devices (I/O or memory) during the
DMA cycles of channels 5 through 7. Access to the DMA
controller, which controls these channels, is through I/O
addresses hex OCO through ODP.

1-10

System Board

The DMA controller command code addresses follow.
Hex
Address
OCO
OC2

Register Function

OC6
OC8
DCA
OCC
OCE

CHO
CHO
CHl
CHl
CH2
CH2
CH3
CH3

000
002
004
006
008
OOA
DOC
ODE

Read Status Register/Write Command Register
Write Request Register
Write Single Mask Register Bit
Write Mode Register
Clear Byte Pointer Flip-Flop
Read Temporary Register/Write Master Clear
Clear Mask Register
Write All Mask Register Bits

oc4

base
base
base
base
base
base
base
base

and
and
and
and
and
and
and
and

current
current
current
current
current
current
current
current

address
word count
address
word count
address
word count
address
word count

DMA Controller

All DMA memory transfers made with channels 5 through 7 must
occur on even-byte boundaries. When the base address for these
channels is programmed, the real address divided by 2 is the data
written to the base address register. Also, when the base word
count for channels 5 through 7 is programmed, the count is the
number of 16-bit words to be transferred. Therefore, DMA
channels 5 through 7 can transfer 65,536 words, or 128Kb
maximum, for any selected page of memory. These DMA
channels divide the 16M memory space into 128K pages. When
the DMA page registers for channels 5 through 7 are
programmed, data bits D7 through Dl contain the high-order
seven address bits (A23 through A17) of the desired memory
space. Data bit DO of the page registers for channels 5 through 7
is not used in the generation of the DMA memory address.
At power-on time, all internal locations, especially the mode
registers, should be loaded with some valid value. This is done
even if some channels are unused.

System Board

1-11

System Interrupts
The 80286 microprocessor's non-maskable interrupt (NMI) and
two 8259A Controller chips provide 16 levels of system
interrupts.
Note: Any or all interrupts may be masked (including the
microprocessor's NMI).

1-12

System Board

Hardware Interrupt Listing
The following shows the interrupt-level assignments in decreasing
priority.
Level

Function

Microprocessor NMI

Parity or I/O Channel Check

Interrupt Controllers
CTRL I
CTRL 2
IRQ. 0
IRQ 1
IRQ 2 +-

Timer OutlJut 0
Keyboard (Output Suffer Full)
Interrupt from CTRL 2
IRQ 8
IRQ 9

-

IRQ 3

IRQ 4

IRQ 5
IRQ 6
IRQ 7

IRQ.
IRQ.
IRQ
IRQ
IRQ
IRQ

10
11
12

13
14
15

Realtime Clock Interrupt
Software Redirected to INT OAH
PC Network *
PC Network(Alt.) *
Reserved
Reserved
Reserved
Coprclcessor
Fixed Disk Controller
Reserved
Serial Port 2
BSC
BSC (Alt.)
Cluster (Primary)
PC Network *
PC Network (Alt.) *
SDLC
Serial Port 1
BSC
BSC (Alt.)
SDLC
Parallel Port 2
Diskette Controller
Fixed Disk and Diskette Drive
Parallel POrt 1
Data Aguisition and Control ***
GPIB *11
Cluster (Secondary)

* The
** The

***

PC Network is jumper selectable.
GPIB Adapter can be set to interrupts 2 through 7.
The Data Acquisition Adapter can be set to interrupts
3 through 7. The default interrupt is 7.

Hardware Interrupt Listing

System Board

1-13

Interrupt Sharing
A definition for standardized hardware design has been
established that enables multiple adapters to share an interrupt
level. This section describes this design and discusses the
programming support required.
Note: Since interrupt routines do not exist in ROM for
protected mode operations, this design is intended to run
only in the microprocessor's real address mode.

Design Overview
Most interrupt-supporting adapters hold the I interrupt request I
line (IRQ) at a low level and then drive the line high to cause an
interrupt. In contrast, the shared-interrupt hardware design
allows IRQ to float high through pull-up resistors on each
adapter. Each adapter on the line may cause an interrupt by
pulsing the line to a low level. The leading edge of the pulse arms
the 8259A Interrupt Controller; the trailing edge signals the
interrupt controller to cause the interrupt. The duration of this
pulse must be between 125 and 1,000 nanoseconds.
The adapters must have an I interrupt I status bit (INT) and a
I interrupt enable I bit (ENA) that can be controlled and
monitored by its software.
Each adapter sharing an interrupt level must monitor the IRQ
line. When any adapter drives the line low, all other adapters on
that line must be prevented from issuing an interrupt request until
they are rearmed.
If an adapter's INT status bit is at a high level when the interrupt

sharing logic is rearmed, the adapter must reissue the interrupt.
This prevents lost interrupts if two adapters issue an interrupt at
the same time and an interrupt handler issues a Global Rearm
after servicing one of the adapters.

1-14

System Board

The following diagram is an example of the shared interrupt
hardware logic.
Q I-------i

INT
ENA

+5

Q

-Q

>CLK

2.2K Ohms

-CLR

System
Clock-~---+-------I

">4---+- IRQ
+5
Q
'------j>CLK
-Q
-CLR
-Global

Rearm----+--------'

Shared Interrupt Logic Diagram

Program Support
During multitasking, tasks are constantly being activated and
deactivated in no particular order. The interrupt-sharing program
support described in this section provides for an orderly means to:
•

Link a task's interrupt handler to a chain of interrupt
handlers

•

Share the interrupt level while the task is active

•

Unlink the interrupt handler from the chain when the task is
deactivated.

Linking to a Chain
Each newly activated task replaces the interrupt vector in low
memory with a pointer to its own interrupt handler. The old
interrupt vector is used as a forward pointer (FPTR) and is stored
at a fixed offset from the new task's interrupt handler.

System Board

1-15

Sharing the Interrupt Level
When the new task's handler gains control as a result of an
interrupt, the handler reads the contents of the adapter's interrupt
status register to determine if its adapter caused the interrupt. If
it did, the handler services the interrupt, disables the interrupts
(eLI), issues a non-specific End of Interrupt (EOI), and then, to
rearm the interrupt hardware, writes to address 02FX, where X
corresponds to interrupt levels 3 through 7, and 9 (IRQ9 is
02F2). A write to address 06FX, where X may be 2 through 7, is
required for interrupt levels 10 through 15, respectively. Each
adapter in the chain decodes the address which results in a Global
Rearm. An adapter is required to decode the least significant 11
bits for this Global Rearm command. The handler then issues a
Return From Interrupt (IRET).
If its adapter did not cause the interrupt, the handler passes

control to the next interrupt handler in the chain.

Unlinking from the Chain
To unlink from the chain, a task must first locate its handler's
position within the chain. By starting at the interrupt vector in
low memory, and using the offset of each handler's FPTR to find
the entry point of each handler, the chain can be methodically
searched until the task finds its own handler. The FPTR of the
previous handler in the chain is replaced by the task's FPTR, thus
removing the handler from the chain.

Error Recovery
Should the unlinking routine discover that the interrupt chain has
been corrupted (an interrupt handler is linked but does not have a
valid SIGNATURE), an unlinking error-recovery procedure must
be in place. Each application can incorporate its own unlinking
error procedure into the unlinking routine. One application may
choose to display an error message requiring the operator to
either correct the situation or power down the system. Another
application may choose an error recovery procedure that restores
the original interrupt vector in low memory, and bypasses the
corrupt portion of the interrupt chain. This error recovery

1-16

System Board

procedure may not be suitable when adapters that are being
serviced by the corrupt handler are actively generating interrupts,
since unserviced interrupts lock up that interrupt level.

ROS Considerations
Adapters with their handlers residing in ROS may choose to
implement chaining by storing the 4 byte FPTR (plus the FIRST
flag if it is sharing interrupt 7 or 15) in on-adapter latches or
ports. Adapter ROS without this feature must first test to see
that it is the first in the chain. If it is the first in the chain, the
adapter can complete the link; if not, the adapter must exit its
routine without linking.

Precautions
The following precautions must be taken when designing
hardware or programs using shared interrupts:
•

Hardware designers should ensure the adapters:
Do not power up with the ENA line active or an
interrupt pending.
Do not generate interrupts that are not serviced by a
handler. Generating interrupts when a handler is not
active to service the adapter causes the interrupt level to
lock up. The design relies on the handler to clear its
adapter's interrupt and issue the Global Rearm.
Can be disabled so that they do not remain active after
their application has terminated.

•

Programmers should:
Ensure that their programs have a short routine that can
be executed with the AUTOEXEC.BAT to disable their
adapter's interrupts. This precaution ensures that the
adapters are deactivated if the user reboots the system.

System Board

1-17

Treat words as words, not bytes. Remember that data is
stored in memory using the Intel format (word 424B is
stored as 4B42).

Interrupt Chaining Structure
ENTRY:

JKP
FPTR
SIGNATURE

SHORT PAST
DO
0
OW
424BH

FLAGS
FIRST
JKP
RES BYTES

DB
EQU
SHORT
DB

-

PAST:

BOH
RESET
DUP 7 (0 )

, Jump

around structure

, Porward Pointer
, Used when unlinking to identify
, compatible interrupt handlers
, Flags
, Flag for being first in chain
, Future

, Actual

expansion

start of code

The interrupt chaining structure is a 16-byte format containing
FPTR, SIGNATURE, and RES BYTES. It begins at the third
byte from the interrupt handler'sentry point. The first
instruction of every handler is a short jump around the structure
to the start of the routine. Since the position of each interrupt
handler's chaining structure is known (except for the handlers on
adapter ROS), the FPTRs can be updated when unlinking.
The FIRST flag is used to determine the handler's position in the
chain when unlinking when sharing interrupts 7 and 15. The
RESET routine, an entry point for the operating system, must
disable the adapter's interrupt and RETURN FAR to the
operating system.

Note: All handlers designed for interrupt sharing must use
424B as the signature to avoid corrupting the chain.

Examples
In the following examples, notice that interrupts are disabled
before control is passed to the next handler on the chain. The
next handler receives control as if a hardware interrupt had
caused it to receive control. Also, notice that the interrupts are
disabled before the non-specific EOI is issued, and not reenabled
in the interrupt handler. This ensures that the IRET is executed
(at which point the flags are restored and the interrupts

1-18

System Board

reenabled) before another interrupt is serviced, protecting the
stack from excessive build up.
Example of an Interrupt Handler
xxxx

Location of your card's interrupt
control/status register
Interrupt bit in your card's interrupt
control status register

ISB

EQU

REARM

EQU

2F7H

Global Rearm location for interrupt
level 7

EQU

67H

Specific EOI for 8259'5 interrupt
level 7

EOI
OCR

EQU
EQU

20H
20H

Non-specific EOI
Location of 8259 operational control

IMR

EQU

21H

register
Location of 8259 interrupt mask
register

MVCSEG

ENTRY

SEGMENT

PARA

ASSUME
PROC
JMP
DO

CS:MYCSEG,DS:DSEG
FAR
SHORT PAST

FPTR
SIGNATURE OW

FLAGS
FIRST

JMP

DB
EQU
SHORT

RES_BYTES· DB

PAST:

o
424BH

PUSH

TEST

JNZ
TEST

JNZ
POP
CLI
JMP

Forward POinter
Used when unlinking to identify
compatible interrupt handlers
Flags

80H
RESET
DUP 7 (0)

STI

MOV
IN

Entry point of handler

DX,YOUR_CARD
AL,DX
AL,ISB
SERVICE
CS:FLAGS,FIRST

EXIT

Future expansion
Actual start of handler code
Save needed registers
Select your status register
Read the status register
Your card caused the interrupt?
yes. branch to service logic
Are we the first ones in?
If yes, branch for EOI and Rearm
Restore registers
Disable interrupts

DWORD PTR CS:FPTR

SERVICE:

Pass control to next guy on chain
Service the interrupt

EXIT:
CLI
MOV
OUT
MOV
OUT
POP
IRET

Disable the interrupts

AL,EOI
aeR,AL
DX,REARM
DX,AL

Restore registers

RESET:

Disable your card
Return FAR to operating system

RET
ENTRY

Issue non-specific EOI to 8259
Rearm the cards

ENOP

MYCSEG
END

ENDS
ENTRY

System Board

1-19

Linking Code Example
PUSH

ES

eLI

~

Disable interrupts

Set forward pointer to value of interrupt vector in low memory
ASSUME
CS:CODESEG,DS:CODESEG
PUSH
ES
MOV
AX,350FH
DOS get interrupt vector
INT
21H
MOV
SI,OFFSET CS:FPTR
Get offset of your forward pointer
in an indexable register

MOV
MOV
CMP
JNZ
MOV
SETVECTR: POP
PUSH

cs:

151] ,EX

CS: ISI+2) ,ES
ES:BYTE PTR{BX],CFH

store the old interrupt vector
in your forward pointer for chaining
Test for IRET

SETVECTR
CS:FLAGS,FIRST

Set up first in chain flag

ES
DS

; Make interrupt vector in low memory pOint to your handler
MOV
DX,OFFSET ENTRY
Make interrupt vector point to your handler
If DS not = CS, get it
OS, AX
and put it in DS
AX,2S0FH
DOS set interrupt vector
INT
21H
POP
DS
Unmask (enable) interrupts for your level
IN
AL, IMR
Read interrupt mask register
$+2
JMP
10 delay
AND
AL,07FH
Unmask interrupt level 7
OUT
IMR,AL
write new interrupt mask
MOV
AL,SPC_EOI
Issue specific EOI for level 7
$+Z
JMP
to allow pending level 7 interrupts
(if any) to be serviced
OUT
OeR,AL
STI
Enable interrupts
POP
ES
MOV

AX, SEG ENTRY

MOV
MOV

1-20

System Board

Unlinking Code Example
PUSH
PUSH
eLI
MOV
INT
MOV

DS
ES
AX,350FH

21H
CX,ES

Are we the first handler in the chain?
MOV
AX,eS
CMP
BX,OFFSET ENTRY

JNE
CMP

UNCHAIN_A
AX,CX

Disable interrupts
DOS qet interrupt vector
BS:BX points to first of chain
Pickup segment part of interrupt vector
Get code seq into comparable register
Interrupt vector in low memory

pointing to your handler's offset?
No, branch
vector pointing to your
handler's segment?

No, branch

JNE

Set interrupt vector in low memory to point to the handler
pointed to by your pOinter

PUSH
MOV
MOV
MOV
INT
POP
JMP
UNCHAIN_A:
CMP

DS
DX,WORD PTR CS:FPTR
DS,WORD PTR CS FPTR[2[
AX,2S0FH
~ DOS set interrupt vector
21H
DS
UNCHAIN_X
BX = FPTR offset, ES
FPTR segment, ex = CS
ES:[BX+6),4B42H
Is handler using the appropriate

JNE
LDS
CMP

exception

JNE
MOV
CMP

UNCHAIN_B
CX,DS
AX,CX

SI,ES: [BX+2)
51,OFFSET ENTRY

JNE

conventions (is SIGNATURE present in
the interrupt chaining structure)?
No, invo~e error exception handler
Get FPTR's segment and offset
Is this forward pointer pointing to
your hand~er's offset?
~o, branch
Kove to compare
Is this forward pointer pointing to
your handler's segment?
NO, branch

Located your handler in the chain
MOV
AX,WORD PTR CS:FPTR

MOV
MOV
MOV
MOV
AND
OR
JMP
UNCHAIN_B: MOV
PUSH

PUSH
JMP
UNCHAIN_X: STI
POP
POP

Get your FPTR's offset
Replace offset of FPTR of handler
that points to you
AX,WORD PTR CS:FPTR[2] J Get your FPTR's segment
ES: [BX+4 J , AX
Replace segment of FPTR of handler
that points to you
AL,CS:FLAGS
Get your flags
AL,FIRST
Isolate fIRST flag
ES: [BX + 6),AL
Set your first flag into prior routine

ES:[BX+2[,AX

UNCHAIN_X
BX,SI

DS
ES
UNCHAIN_A

Kove new offset to BX

Examine next handler in chain
Enable interrupts

ES
DS

System Board

1-21

System Timers
The system has three programmable timer/counters, Channels 0
through 2. They are controlled by an Intel 8254-2
Timer/Counter chip, and are defined as follows:
Channel 0

System Timer

GATE 0
CLKINO
CLKOUTO

Tied on
1.190 MHz OSC
8259AIRQ 0

Channell

Refresh Request Generator

GATE 1
CLKIN 1
CLKOUT 1

Tied on
1.190 MHz OSC
Request refresh cycle

Note: Channel 1 is programmed as a rate generator to
produce a 15-microsecond period signal.
Channel 2

Tone Generation for Speaker

GATE 2
CLKIN2
CLKOUT2

Controlled by bit 0 of port hex 61, PPI bit
1.190 MHz OSC
Used to drive the speaker

The 8254-2 Timer/Counter is a programmable interval
timer/counter that system programs treat as an arrangement of
four external I/O ports. Three ports are treated as counters; the
fourth is a control register for mode programming. The following
is a system-timer block diagram.

1-22

System Board

+5 Vdc
-Refresh

Refres h Reques t
Q
Clock
Clear

D

LSystem B u s _
Gate 0

+5 Vdc
I/O Add ress
Hex 006 1 Port Bi t 0

Clock In 0
Gate I

>--

Clock In I

~

Gate 2

0---

Clock In 2
IRQ 0
Clock Out 0
Clock Out 1

-

Clock Out 2
I/O Add ress
Hex 006 1
Port Bi t 1
PC LK

(2 .38MHz)

I Driver I

I I
AND

Divide
by 2

Low
Pass
F i Iter

r---+

To Speaker

II

System-Timer Block Diagram

System Clock
The 82284 System Clock Generator is driven by a 12-MHz
crystal. Its output I clock I signal (CLK) is the input to the system
microprocessor, the coprocessor, and I/O channel.

ROM Subsystem
The system board's ROM subsystem consists of two 32K by 8-bit
ROM/EPROM modules in a 32K-by-16-bit arrangement. The
code for odd and even addresses resides in separate modules.
ROM is assigned at the top of the first and last 1M address space
(OFOOOO and FFOOOO). ROM is not parity-checked. Its access
time is 150 nanoseconds and its cycle time is 230 nanoseconds.

System Board

1-23

RAM Subsystem
The system board's RAM subsystem starts at address 000000 of
the 16M address space. It is 512K of 128K-by-1-bit RAM
modules (type 1 system board) or 512K of 256K-by-1-bit RAM
modules (type 2 system board). Memory access time is 150
nanoseconds and the cycle time is 275 nanoseconds.
Memory refresh requests one memory cycle every 15
microseconds through the timer/counter (channell). The RAM
initialization program performs the following functions:
•

Initializes channell of the timer/counter to the rate
generation mode, with a period of 15 microseconds.

•

Performs a memory write operation to any memory location.
Note: The memory must be accessed or refreshed eight
times before it can be used.

I/O Channel
The I/O channel supports:
•

I/O address space hex 100 to hex 3FF

•

24-bit memory addresses (16M)

•

Selection of data accesses (either 8- or 16-bit)

•

Interrupts

•

DMA channels

•

I/O wait-state generation

1-24

System Board

•

Open-bus structure (allowing mUltiple microprocessors to
share the system's resources, including memory)

•

Refresh of system memory from channel microprocessors.

Connectors
The following figure shows the location and the numbering of the
I/O channel connectors. These connectors consist of six 36-pin
and eight 62-pin edge connector sockets.
Note: The 36-pin connector is not present in two positions
on the I/O channel. These positions can support only 62-pin
I/O bus adapters.
I/O CHANNEL
CONNECTORS

r ----------~~,--------~
REAR PANEL

o

"""""

r

I/O Channel Connector Location

System Board

1-25

The following figure shows the pin numbering for I/O channel
connectors 11 through J8.
Rear Panel
B1

Al

Bl0

Al0

B20

A20

B31

A31

Component Side

I/O Channel Pin Numbering (J1-J8)

1-26

System Board

The following figure shows the pin numbering for I/O channel
connectors J1 0 through J14 and J16.
Rear Panel
01

C1

010

C10

018

c18
Component Side

I/O Channel Pin Numbering (J10-J14 and J16)

System Board

1-27

The following figures summarize pin assignments for the I/O
channel connectors.
I/O Pin

Signal Name

I/O

Al
A2
A3
A4
A5
A6
A7
A8
A9
AIO
All
Al2
Al3
Al4
Al5
Al6
Al7
Al8
Al9
A20
A21
A22
A23
A24
A25
A26
A27
A28
A29
A30
A31

-I/O CH CK
S07
S06
S05
So4
S03
S02
SOl
SOO
-I/O CH ROY
AEN
SAl9
SAl8
SAl7
SAl6
SAl5
SAl4
SAl3
SAl2
SAIl
SAIO
SA9
SA8
SA7
SA6
SA5
SA4
SA3
SA2
SAl
SAO

I
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I
0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0

I/O Channel (A-Side, J1 through J8)

1-28

System Board

I/O Pin

Signal Name

I/O

B1
B2
B3
B4
B5
B6
B7
B8
B9
Bl0
B11
B12
B13
B14
B15
B16
B17
B18
B19
B20
B21
B22
B23
B24
B25
B26
B27
B28
B29
B30
B31

GND
RESET DRV
+5 Vdc
IRQ 9
-5 Vdc
DRQ2
-12 Vdc
OWS
+12 Vdc
GND
-SMEMW
-SMEMR
-lOW
-lOR
-DACK3
DRQ3
-DACKI
DRQl
-REFRESH
ClK
IRQ7
IRQ6
IRQ5
IRQ4
IRQ3
-DACK2
T/C
BALE
+5Vdc
OSC
GND

Ground
0
Power
I
Power
I
Power
I
Power
Ground
0
0
I/O
I/O
0
I
0
I
I/O
0
I
I
I
I
I
0
0
0
Power
0
Ground

I/O Channel (B-Side, J1 through J8)

System Board

1-29

I/O Pin

Signa1 Name

I/O

C1
C2
C3
C4
C5
C6
C7
c8
C9
Cl0
C11
C12
C13
C14
C15
C16
C17
C18

SBHE
LA23
LA22
LA21
LA20
LA19
LA18
LA17
-MEMR
-MEMW
SD08
SD09
SD10
SDll
SD12
SD 13
SD14
SD15

/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0
/0

I/O Channel (C-Side, J10 through J14 and 16)
I/O Pin

Signa1 Name

I/O

D1
D2
D3
D4
D5
D6
D7
D8
D9
Dl0
D11
D12
D13
D14
D15
D16
D17
D18

-MEM CS16
-I/O CS16
IRQ10
IRQll
IRQ12
IRQ15
IRQ14
-DACKO
DRQO
-DACK5
DRQ5
-DACK6
DRQ6
-DACK7
DRQ7
+5 Vdc
-MASTER
GND

I
I
I
I
I
I
I
0
I
0
I
0
I
0
I
POWER
I
GROUND

I/O Channel (D-Side, J10 through J14 and 16)

1-30

System Board

110 Channel Signal Description
The following is a description of the system board's I/O channel
signals. All signal lines are TTL compatible. I/O adapters should
be designed with a maximum of two low-power Shottky (LS)
loads per line.

SAO through SA19 (I/O)
Address signals 0 through 19 are used to address memory and
I/O devices within the system. These 20 address lines, in
addition to LA17 through LA23 , allow access of up to 16M of
memory. SAO through SA19 are gated on the system bus when
I buffered address latch enable I signal (BALE) is high and are
latched on the falling edge of BALE. These signals are generated
by the microprocessor or DMA Controller. They also may be
driven by other microprocessors or DMA controllers that reside
on the I/O channel.

LA17 through LA23 (I/O)
These signals (unlatched) are used to address memory and I/O
devices within the system. They give the system up to 16M of
address ability. These signals are valid when BALE is high. LA17
through LA23 are not latched during microprocessor cycles and
therefore do not stay valid for the whole cycle. Their purpose is
to generate memory decodes for 16-bit, 1 wait-state, memory
cycles. These decodes should be latched by I/O adapters on the
falling edge of BALE.
These signals also may be driven by other microprocessors or
DMA controllers that reside on the I/O channel.
eLK (0)

This is the 6-MHz system clock signal. It is a synchronous
microprocessor cycle clock with a cycle time of 167 nanoseconds.
The clock has a 50% duty cycle. This signal should be used only
I

I

System Board

1-31

for synchronization. It is not intended for uses requiring a fixed
frequency.

RESET DRV (0)
The 'reset drive' signal is used to reset or initialize system logic
at power-up time or during a low voltage condition. This signal is
active high.

SDO through SD15 (I/O)
These signals provide bus bits 0 through 15 for the
microprocessor, memory, and I/O devices. DO is the
least-significant bit and DIS is the most-significant bit. A1l8-bit
devices on the I/O channel should use DO through D7 for
communications to the microprocessor. The 16-bit devices will
use DO through DIS. To support 8-bit devices, the data on D8
through D15 will be gated to DO through D7 during 8-bit
transfers to these devices; 16-bit microprocessor transfers to 8-bit
devices will be converted to two 8-bit transfers.

BALE (0) (buffered)
The 'buffered address latch enable' signal is provided by the
82288 Bus Controller and is used on the system board to latch
valid addresses and memory decodes from the microprocessor. It
is available to the I/O channel as an indicator of a valid
microprocessor or DMA address (when used with 'address
enable' signal, AEN). Microprocessor addresses SAO through
SA19 are latched with the falling edge of BALE. BALE is forced
high (active) during PMA cycles.

-I/O

cn CK (I)

The '-I/O channel check' signal provides the system board with
parity (error) information about memory or devices on the I/O
channel. When this signal is active (low), it indicates a
non-correctable system error.

1-32

System Board

I/O

cn RDY (I)

The '1/0 channel ready signal is pulled low (not ready) by a
memory or I/O device to lengthen I/O or memory cycles. Any
slow device using this line should drive it low immediately upon
detecting its valid address and a Read or Write command.
Machine cycles are extended by an integral number of clock
cycles (167 nanoseconds). This signal should be held low for no
more than 2.5 microseconds.
I

IRQ3-IRQ7, IRQ9-IRQ12, IRQ14, and IRQ15 (I)
Interrupt requests 3 through 7, 9 through 12, 14, and 15 are used
to signal the microprocessor that an I/O device needs attention.
The interrupt requests are prioritized, with IRQ9 through IRQI2,
IRQI4, and IRQ15 having the highest priority (IRQ9 is the
highest), and IRQ3 through IRQ7 having the lowest priority
(IRQ7 is the lowest). An interrupt request is generated when an
IRQ line is raised from low to high. The line is high until the
microprocessor acknowledges the interrupt request (Interrupt
Service routine).
Note: Interrupt 13 is used on the system board and is not
available on the I/O channel. IRQ 8 is used for the real-time
clock.

-lOR (I/O)
The I -I/O read I signal instructs an I/O device to drive its data
onto the data bus. This signal may be driven by the system
microprocessor or DMA controller, or by a microprocessor or
DMA controller resident on the I/O channel. This signal is active
low.

-lOW (I/O)
The I -I/O write I signal instructs an I/O device to read the data
off the data bus. It may be driven by any microprocessor or
DMA controller in the system. This signal is active low.

System Board

1-33

-SMEMR (0) -MEMR (I/O)
These signals instruct the memory devices to drive data onto the
data bus. -SMEMR is active only when the memory decode is
within the low 1M of memory space. -MEMR is active on all
memory read cycles. -MEMR may be driven by any
microprocessor or DMA controller in the system. -SMEMR is
derived from -MEMR and the decode of the low 1M of memory.
When a microprocessor on the I/O channel wishes to drive
-MEMR, it must have the address lines valid on the bus for one
clock cycle before driving -MEMR active. Both signals are active
low.

-SMEMW (0) -MEMW (I/O)
These signals instruct the memory devices to store the data
present on the data bus. -SMEMW is active only when the
memory decode is within the low 1M of the memory space.
-MEMW is active on all memory write cycles. -MEMW may be
driven by any microprocessor or DMA controller in the system.
-SMEMW is derived from -MEMW and the decode of the low
1M of memory. When a microprocessor on the I/O channel
wishes to drive -MEMW, it must have the address lines valid on
the bus for one clock cycle before driving -MEMW active. Both
signals are active low.

DRQO-DRQ3 and DRQ5-DRQ7 (I)
The I DMA request I signals 0 through 3 and 5 through 7 are
asynchronous channel requests used by peripheral devices and a
microprocessor to gain DMA service (or control of the system).
They are prioritized, with DRQO having the highest priority and
DRQ7 the lowest. A request is generated by bringing a DRQ line
to an active (high) level. A DRQ line is held high until the
corresponding I DMA acknowledge I (DACK) line goes active.
DRQO through DRQ3 perform 8-bit DMA transfers; DRQ5
through DRQ7 perform 16-bit transfers. DRQ4 is used on the
system board and is not available on the 110 channel.

1-34

System Board

-DACKO to -DACK3 and -DACKS to -DACK7 (0)
-DMA acknowledge 0 through 3 and 5 through 7 are used to
acknowledge DMA requests. These signals are active low.

AEN (0)
The I address enable I signal is used to degate the microprocessor
and other devices from the I/O channel to allow DMA transfers
to take place. When this line is active, the DMA controller has
control of the address bus, the data-bus Read command lines
(memory and I/O), and the Write command lines (memory and
I/O). This signal is active high.

-REFRESH (I/O)
This signal is used to indicate a refresh cycle and can be driven by
a microprocessor on the I/O channel. This signal is active low.
T/C (0)
The I terminal count I signal provides a high pulse when the
terminal count for any DMA channel is reached.

SBHE (I/O)
The I system bus high enable I signal indicates a transfer of data
on the upper byte of the data bus, SD8 through SD15.
Sixteen-bit devices use SBHE to condition data bus buffers tied to
SD8 through SD15. This signal is active high.

-MASTER (I)
This signal is used with a DRQ line to gain control of the system.
A processor or DMA controller on the I/O channel may issue a
DRQ to a DMA channel in cascade mode and receive a -DACK.
Upon receiving the -DACK, a microprocessor may pull

System Board

1-35

-MASTER active (low), which will allow it to control the system
address, data, and control lines (a condition known as tri-state).
After -MASTER is low, the microprocessor must wait one clock
cycle before driving the address and data lines, and two clock
cycles before issuing a Read or Write command. If this signal is
held low for more than 15 microseconds, the system memory may
be lost because of a lack of refresh.

-MEM CS16 (I)
The I-memory 16-bit chip select I signal indicates to the system
that the present data transfer is a 1 wait-state, 16-bit, memory
cycle. It must be derived from the decode of LA17 through
LA23. -MEM CS16 is active low and should be driven with an
open collector or tri-state driver capable of sinking 20 mAo

-I/O CS16 (I)
The I-I/O 16-bit chip select I signal indicates to the system that
the present data transfer is a 16-bit, 1 wait-state, I/O cycle. It is
derived from an address decode. -I/O CS16 is active low and
should be driven with an open collector or tri-state driver capable
of sinking 20 rnA.

OSC (0)
The Ioscillator I signal is a high-speed clock with a
70-nanosecond period (14.31818 MHz). This signal is not
synchronous with the system clock. It has a 50% duty cycle.

OWS (I)
The Izero wait state I signal tells the microprocessor that it can
complete the present bus cycle without inserting any additional
wait cycles. In order to run a memory cycle to a 16-bit device
without wait cycles, OWS is derived from an address decode gated
with a Read or Write command. In order to run a memory cycle
to an 8-bit device with a minimum of two wait states, OWS should

1-36

System Board

be driven active one clock cycle after the Read or Write command
is active, and gated with the address decode for the device.
Memory Read and Write commands to an 8-bit device are active
on the falling edge of eLK. OWS is active low and should be
driven with an open collector or tri-state driver capable of sinking
20 rnA.
The following figure is an I/O address map.
Hex Range
DOO-OIF
OZO-03F
040-05F
06o-06F
070-07F
080-09F
OAO-OBF
OCO-ODF
OFO
OFI
OF8-0FF

Device
DMA controller 1, 8237A-5
Interru~t controller 1,8259A, Master
Timer
254-2
8042 (Keyboard)
Real-time clock, NMI (non-maskable interrupt) mask
DMA page register , 74LS612
Interrupt Controller 2, 8259A
DMA controller 2, 8237A-5
Clear Math Coprocessor Busy
Reset Math Coprocessor
Math Coprocessor

Note: I/O Addresses, hex 000 to OFF, are reserved for the
system board I/O. Hex 100 to 3FF are available on the I/O
channel.

I/O Address Map (Part 1 of 2)

System Board

1-37

Hex Range
1FO-1F8
200-207
20C-20D
21F
278-27F
2BO-2DF
2E1
2E2 & 2E3
2F8-2FF
300-31F
360-363
364-367
368-36B
36C-36F
378-37F
380-38F
390-393
3AO-3AF
3BO-3BF
3CO-3CF
3DO-3DF
3FO-3F7
3F8-3FF
6E2 & 6E3
790-793
AE2 & AE3
B90-B93
EE2 & EE3
1390-1393
22E1
2390-2393
42E1
62E1
82E1
A2E1
C2E1
E2E1

Device
Fixed Disk
Game I/O
Reserved
Reserved
Parallel printer port 2
Alternate Enhanced Graphics Adapter
GPIB (Adapter 0)
Data Acquisition (Adapter 0)
Serial port 2
Prototype card
PC Network (low address)
Reserved
PC Network (high address)
Reserved
Parallel printer port 1
SDLC, bisynchronous 2
Cluster
Bisynchronous 1
Monochrome Display and Printer Adapter
Enhanced Graphics Adapter
Color/Graphics Monitor Adapter
Diskette controller
Serial port 1
Data Acquisition (Adapter 1)
Cluster (Adapter 1)
Data Acquisition (Adapter 2)
Cluster (Adapter 2)
Data Acquisition (Adapter 3)
Cluster (Adapter 3)
GP I B (Adapter 1)
Cluster (Adapter 4)
GPIB (Adapter 2)
GPIB (Adapter 3)
GPIB (Adapter 4)
GPIB (Adapter 5)
GPIB (Adapter 6)
GPIB (Adapter 7)

Note: I/O Addresses, hex 000 to OFF, are reserved for the
system board I/O. Hex 100 to 3FF are available on the I/O
channe I.

I/O Address Map (Part 2 of 2)

NMI and Coprocessor Controls
At power-on time, the non-maskable interrupt (NMI) into the
80286 is masked off. The mask bit can be set and reset with
system programs as follows:

1-38

System Board

Mask On

Write to I/O address hex 070, with data bit 7
equal to a logic O.

Mask Off

Write to I/O address hex 070, with data bit 7
equal to a logic 1.

Note: At the end of POST, the system sets the NMI mask
on (NMI enabled).
The following is a description of the Math Coprocessor controls.
OFO

An 8-bit Out command to port FO will clear the latched
Math Coprocessor -busy signal. The -busy signal will
be latched if the coprocessor asserts its I -error I signal
while it is busy. The data output should be zero.
I

OF1

I

I

I

An 8-bit Out command to port Fl will reset the Math
Coprocessor. The data output should be zero.

I/O address hex 080 is used as a diagnostic-checkpoint port or
register. This port corresponds to a read/write register in the
DMA page register (74LS612).
The I -I/O channel check I signal (-I/O CH CK) is used to report
non-correctable errors on RAM adapters on the I/O channel.
This check will create an NMI if the NMI is enabled. At
power-on time, the NMI is masked off and -I/O CH CK is
disabled. Follow these steps when enabling -I/O CH CK and the
NMI.
1.

Write data in all I/O RAM-adapter memory locations; this
will establish good parity at all locations.

2.

Enable -I/O CH CK.

3.

Enable the NMI.
Note:

All three of these functions are performed by POST.

When a check occurs, an interrupt (NMI) will result. Read the
status bits to determine the source of the NMI (see the figure,
"1/ a Address Map", on page 1-37). To determine the location
of the failing adapter, write to any memory location within a given

System Board

1-39

adapter. If the parity check was from that adapter, -I/O CH CK
will be reset to inactive.

Other Circuits

Speaker
The system unit has a 2-1/4 inch permanent-magnet speaker,
which can be driven from:
•
•
•

The I/O-port output bit
The timer/counter's CLK OUT 2
Both of the above

RAM Jumpers
The system board has a 3-pin, Berg-strip connector (J18).
Starting at the front of the system, the pins are numbered 1
through 3. Jumper placement across these pins determines how
much system board RAM is enabled. Pin assignments follow.
Pin

Assignments

1
2

No Connection
- RAM SEL
Ground

3

RAM Jumper Connector (J18)

1-40

System Board

The following shows how the jumpers affect RAM.
Jumper Positions
1 and 2
2 and 3

Function
Enable 2nd 256K of system board RAM
Disable 2nd 256K of system board RAM

RAM Jumper

Note: The normal mode is the enable mode. The other
mode permits the additional RAM to reside on adapters
plugged into the I/O bus.

Display Switch
Set the slide switch on the system board to select the primary
display adapter. Its positions are assigned as follows:

On (toward the front of the system unit): The primary display
is attached to the Color/Graphics Monitor Adapter or
Professional Graphics Controller.
Off (toward the rear of the system unit): The primary display
is attached to the Monochrome Display and Printer Adapter.
The switch may be set to either position if the primary display is
attached to an Enhanced Graphics Adapter.
Note: The primary display is activated when the system is
powered on.

Variable Capacitor
The system board has a variable capacitor. Its purpose is to
adjust the 14.31818 MHz oscillator signal (OSC), used to obtain
the color-burst signal required for color televisions.

System Board

1-41

Keyboard Controller
The keyboard controller is a single-chip microcomputer (Intel
8042) that is programmed to support the keyboard serial
interface. The keyboard controller receives serial data from the
keyboard, checks the parity of the data, translates scan codes, and
presents the data to the system as a byte of data in its output
buffer. The controller can interrupt the system when data is
placed in its output buffer, or wait for the system to poll its status
register to determine when data is available.
Data is sent the keyboard by first polling the controller's status
register to determine when the input buffer is ready to accept data
and then writing to the input buffer. Each byte of data is sent to
the keyboard serially with an odd parity bit automatically
inserted. The keyboard is required to acknowledge all data
transmissions, another byte of data should not be sent to the
keyboard until acknowledgement is received for the previous byte
sent. The output-buffer-full interrupt may be used for both send
and receive routines.

Keyboard Controller Initialization
At power on, the keyboard controller set the system flag bit to O.
After a power-on reset or the execution of the Self Test
command, the keyboard controller disables the keyboard interface
by forcing the 'keyboard clock' line low. The keyboard
interface parameters are specified at this time by writing to
locations within the 8042 RAM. The keyboard-inhibit function is
then disabled by setting the inhibit-override bit in the command
byte. A hex 55 is then placed in the output buffer if no errors are
detected during the self test. Any value other than hex 55
indicates that the 8042 is defective. The keyboard interface is
now enabled by lifting the 'keyboard data' and 'keyboard clock'
signal lines, and the system flag is set to 1. The keyboard
controller is then ready to accept commands from the system unit
microprocessor or receive keyboard data.

1-42

System Board

Receiving Data from the Keyboard
The keyboard sends data in a serial format using an 11-bit frame.
The first bit is a start bit, and is followed by eight data bits, an
odd parity bit, and a stop bit. Data sent is synchronized by a
clock supplied by the keyboard. At the end of a transmission, the
keyboard controller disables the interface until the system accepts
the byte. If the byte of data is received with a parity error, a
Resend command is automatically sent to the keyboard. If the
keyboard controller is unable to receive the data correctly after a
set number of retries, a hex FF is placed in its output buffer, and
the parity bit in the status register is set to 1, indicating a receive
parity error. The keyboard controller will also time a byte of data
from the keyboard. If a keyboard transmission does not end
within two milliseconds, a hex FF is placed in the keyboard
controller's output buffer, and the receive time-out bit in the
status register is set. No retries will be attempted on a receive
time-out error.
Note: When a receive error occurs in the default mode (bits
5,6, and 7 of the command byte set to 0), hex 00 is placed in
the output buffer instead of hex FF. See "Commands (I/O
Address Hex 64)" on page 1-51 for a detailed description of
the command byte.

Scan Code Translation
Scan codes received from the keyboard are converted by the
keyboard controller before being placed into the controller's
output buffer. The following figure shows the keyboard layout.
Each key position is numbered for reference.

System Board

1-43

Keyboard

1-44

System Board

The following figure is the scan-code translation table.
System
Scan Code

Keyboard
Scan Code

01
02
03
04
05
06
07
08
09
OA
OB
OC
00
OE
OF
10
11
12
13
14
15
16
17
18
19
1A
1B
1C
10
1E
1F
20
21
22
23
24
25
26
27
28
29
2A
2B
2C
20
2E
2F

76
16
1E
26
25
2E
36
30
3E
46
45
4E
55
66
00
15
10
24
20
2C
35
3C
43
44
40
54
5B
5A
14
1C
1B
23
2B
34
33
3B
42
4B
4c
52
OE
12
50
1A
22
21
2A

Key
90
2
3
4
5
6
7
8
9
10
11
12
13
15
16
17
18
19
20
21
22
23
24
25
26
27
28
43
30
31
32
33
34
35
36
37
38
39
40
41
1
44
14
46
47
48
49

Scan-Code Translation Table (Part 1 of 2)

System Board

1-45

System
Scan Code

Keyboard
Scan Code

Key

30
31
32
33
34
35
36
38
39
3A
3B
3C
30
3E
3F
40
41
42
43
44
45
46
47
48
49
4A
4B
4c
40
4E
4F
50
51
52
53
54

32
31
3A
41
49
4A
59
11
29
58
05
06
04
OC
03
OB
02 or 83
OA
01
09

50
51
52
53
54
55
57
58
61
64
70
65
71
66

77

7E
6C
75
70
7B
6B
73
74
79
69
72

7A
70
71
7F or 84

Scan-Code Translation Table (Part 2 of 2)

1-46

System Board

72

67
73
68
74
69
95
100
91
96
101
107
92
97
102
108
93
98
103
99
104
105

The following scan codes are reserved.
Key
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved

System
Scan Code

Keyboard
Scan Code

55
56
57
58
59
5A
5B
5C
50
5E
5F
60
61
62
63
64
65
66
67
68
69
6A
6B
6C
60
6E
6F
70
71

60
61
78
07
OF
17
1F
27
2F
37
3F
47
4F
56
5E
08
10
18
20
28
30
38
40
48
50
57
6F
13
19
39
51
53
5C
5F
62
63
64
65
67
68
6A
60
6E

72

73
74
75
76
77
78
79
7A
7B
7C
70
7E
7F

Reserved Scan-Code Translation Table

System Board

1-47

Sending Data to the Keyboard
The keyboard sends data in the same serial format used to receive
data from the keyboard. A parity bit is automatically inserted by
the keyboard controller. If the keyboard does not start clocking
the data from the keyboard controller within 15 milliseconds, or
complete that clocking within 2 milliseconds, a hex FE is placed
in the keyboard controller's output buffer, and the transmit
time-out error bit is set in the status register.
The keyboard is required to respond to all transmissions. The
keyboard responds to any valid command and parameter, other
than Echo and Resend, with an Acknowledge (ACK) response,
hex FA. If the response contains a parity error, the keyboard
controller places a hex FE in its output buffer, and the transmit
time-out and parity error bits are set in the status register. The
keyboard controller is programmed to set a 25-millisecond time
limit for the keyboard to respond. If this time limit is exceeded,
the keyboard controller places a hex FE in its output buffer and
sets the transmit time-out and receive time-out error bits in the
status register. No retries are attempted by the keyboard
controller for any transmission error.

Inhibit
The keyboard interface may be inhibited by setting input port bit
7 (keyboard inhibit switch) to O. All transmissions to the
keyboard will be allowed regardless of the state of this bit. The
keyboard controller tests data received from the keyboard to
determine if the byte received is a command response or a scan
code. If the byte is a com.mand response, it is placed in the
keyboard controller's output buffer. If the byte is a scan code, it
is ignored.

Keyboard Controller System Interface
The keyboard controller communicates with the system through a
status register, an output buffer, and an input buffer. The
following figure is a block diagram of the keyboard interface.

1-48

System Board

.--- RAM on the system board
N .--- Manufacturing mode
p .--- Display type

Input
Buffer

r

.
System
Data
Bus

~
U

T .--- Keyboard Inhibited

~ == ~~~~e~2~eset
IRQ

1---+ u -

+-jr-,-=======
Output
Buffer

1

T -

Keyboard Clock--r-+

TPu

Keyboard Data

-

-~2_K_R~_~_8~r+-_~ITTI+-_ _ _ _ _ _~
Keyboard Controller Interface Block Diagram

Status Register
The status register is an 8-bit read-only register at I/O address
hex 64. It has information about the state of the keyboard
controller (8042) and interface. It may be read at any time.

Status-Register Bit Definition
Bit 7

Parity Error-A 0 indicates the last byte of data received
from the keyboard had odd parity. A 1 indicates the last
byte had even parity. The keyboard should send data
with odd parity.

Bit 6

Receive Time-Out-A 1 indicates that a transmission was
started by the keyboard but did not finish within the
programmed receive time-out delay.

Bit S

Transmit Time-Out-A 1 indicates that a transmission
started by the keyboard controller was not properly
completed. If the transmit byte was not clocked out
within the specified time limit, this will be the only error.

System Board

1-49

If the transmit byte was clocked out but a response was

not received within the programmed time limit, the
transmit time-out and receive time-out error bits are set
to 1. If the transmit byte was clocked out but the
response was received with a parity error, the transmit
time-out and parity error bits are set to 1.
Bit 4

Inhibit Switch-This bit is updated whenever data is
placed in the keyboard controller's output buffer. It
reflects the state of the keyboard-inhibit switch. A 0
indicates the keyboard is inhibited.

Bit 3

Command/Data-The keyboard controller's input buffer
may be addressed as either I/O address hex 60 or 64.
Address hex 60 is defined as the data port, and address
hex 64 is defined as the command port. Writing to
address hex 64 sets this bit to 1; writing to address hex 60
sets this bit to O. The controller uses this bit to determine
if the byte in its input buffer should be interpreted as a
command byte or a data byte.

Bit 2

System Flag-This bit is monitored by the system during
the reset routine. If it is a 0, the reset was caused by a
power on. The controller sets this bit to 0 at power on
and it is set to 1 after a successful self test. This bit can
be changed by writing to the system flag bit in the
command byte (hex 64).

Bit 1

Input Buffer Full-A 0 indicates that the keyboard
controller's input buffer (I/O address hex 60 or 64) is
empty. A 1 indicates that data has been written into the
buffer but the controller has not read the data. When the
controller reads the input buffer, this bit will return to O.

Bit 0

Output Buffer Full-A 0 indicates that the keyboard
controller's output buffer has no data. A 1 indicates that
the controller has placed data into its output buffer but
the system has not yet read the data. When the system
reads the output buffer (I/O address hex 60), this bit will
return to a O.

1-50

System Board

Output Buffer
The output buffer is an 8-bit read-only register at I/O address
hex 60. The keyboard controller uses the output buffer to send
scan codes received from the keyboard, and data bytes requested
by command, to the system. The output buffer should be read
only when the output-buffer-full bit in the status register is 1.

Input Buffer
The input buffer is an 8-bit write-only register at I/O address hex
60 or 64. Writing to address hex 60 sets a flag, which indicates a
data write; writing to address hex 64 sets a flag, indicating a
command write. Data written to I/O address hex 60 is sent to the
keyboard, unless the keyboard controller is expecting a data byte
following a controller command. Data should be written to the
controller's input buffer only if the input buffer's full bit in the
status register is O. The following are valid keyboard controller
commands.

Commands (I/O Address Hex 64)
20

Read Keyboard Controller's Command Byte-The
controller sends its current command byte to its output
buffer.

60

Write Keyboard Controller's Command Byte-The next
byte of data written to I/O address hex 60 is placed in
the controller's command byte. Bit definitions of the
command byte are as follows:
Bit 7

Reserved-Should be written as a O.

Bit 6

IBM Personal Computer Compatibility
Mode-Writing a 1 to this bit causes the
controller to convert the scan codes received
from the keyboard to those used by the IBM
Personal Computer. This includes converting a
2-byte break sequence to the 1-byte IBM
Personal Computer format.

System Board

1-51

Bit 5

IBM Personal Computer Mode-Writing a 1 to
this bit programs the keyboard to support the
IBM Personal Computer keyboard interface. In
this mode the controller does not check parity or
convert scan codes.

Bit 4

Disable Keyboard-Writing a 1 to this bit
disables the keyboard interface by driving the
I clock I line low. Data is not sent or received.

Bit 3

Inhibit Override-Writing a 1 to this bit disables
the keyboard inhibit function.

Bit 2

System Flag-The value written to this bit is
placed in the system flag bit of the controller's
status register.

Bit 1

Reserved-Should be written as a O.

Bit 0

Enable Output-Buffer-Full Interrupt-Writing a
1 to this bit causes the controller to generate an
interrupt when it places data into its output
buffer.

AA

Self-Test-This commands the controller to perform
internal diagnostic tests. A hex 55 is placed in the output
buffer if no errors are detected.

AB

Interface Test-This commands the controller to test the
I keyboard clock I and I keyboard data I lines.
The test
result is placed in the output buffer as follows:
00
01
02
03
04

1-52

No error detected.
The I keyboard clock I line is stuck low.
The keyboard clock line is stuck high.
The keyboard data line is stuck low.
The I keyboard data I line is stuck high.
I

I

System Board

I

I

AC

Diagnostic Dump-Sends 16 bytes of the controller's
RAM, the current state of the input port, the current
state of the output port, and the controller's program
status word to the system. All items are sent in scan-code
format.

AD

Disable Keyboard Feature-This command sets bit 4 of
the controller's command byte. This disables the
keyboard interface by driving the clock line low. Data
will not be sent or received.

AE

Enable Keyboard Interface-This command clears bit 4
of the command byte, which releases the keyboard
interface.

CO

Read Input Port-This commands the controller to read
its input port and place the data in its output buffer. This
command should be used only if the output buffer is
empty.

DO

Read Output Port-This command causes the controller
to read its output port and place the data in its output
buffer. This command should be issued only if the output
buffer is empty.

D1

Write Output Port-The next byte of data written to I/O
address hex 60 is placed in the controller's output port.
Note: Bit 0 of the controller's output port is
connected to System Reset. This bit should not be
written low as it will reset the microprocessor.

EO

Read Test Inputs-This command causes the controller
to read its TO and T 1 inputs. This data is placed in the
output buffer. Data bit 0 represents TO, and data bit 1
represents T1.

System Board

1-53

FO-FF Pulse Output Port-Bits 0 through 3 of the controller's

output port may be pulsed low for approximately 6
microseconds. Bits 0 through 3 of this command indicate
which bits are to be pulsed. A 0 indicates that the bit
should be pulsed, and a 1 indicates the bit should not be
modified.
Note: Bit 0 of the controller's output port is
connected to System Reset. Pulsing this bit resets
the microprocessor.

I/O Ports
The keyboard controller has two I/O ports, one assigned for
input and the other for output. Two test inputs are used by the
controller to read the state of the keyboard's clock (TO) and
data (Tl) lines.
I

I

I

I

The following figures show bit definitions for the input and output
ports, and the test-inputs.

1-54

System Board

Bit 7
Bit 6
Bit 5
Bit 4
Bit
Bit
Bit
Bit

3
2
1
0

Keyboard inhibit switch
o = Keyboard inhibited
1 = Keyboard not inhibited
Display switch - Primary display attached to:
o = Color/Graphics adapter
1 = Monochrome adapter
Manufacturing Jumper
o = Manufacturing jumper installed
1 = Jumper not installed
RAM on the system board
o = Enable 512K of system board RAM
1 = Enable 256K of system board RAM
Reserved
Reserved
Reserved
Reserved

Input-Port Bit Definitions
Bit
Bit
Bit
Bit
Bit
Bit
Bit
Bit

7
6
5

4

3
2
1
0

Keyboard data (output)
Keyboard clock (output)
Input buffer empty
Output buffer full
Reserved
Reserved
Gate A20
System reset

Output-Port Bit Definitions
Keyboard data (input)
Keyboard clock (input)

Test-Input Bit Definitions

System Board

1-55

Real-Time Clock/CMOS RAM Information
The RT/CMOS RAM chip (Motorola MC146818) contains the
real-time clock and 64 bytes of CMOS RAM. The internal clock
circuitry uses 14 bytes of this RAM, and the rest is allocated to
configuration information. The following figure shows the CMOS
RAM addresses.
Addresses
00 - 00
DE
OF
10
11
12

13
14

15
16
17
18
19
lA
lB - 20
2E - 2F
30

31
32
33

34 - 3F

Description

*
*

Real-time clock information
Diagnostic status byte
* Shutdown status byte
Diskette drive type byte - drives A and B
Reserved
Fixed disk type byte - types 1-14
Reserved
Equipment byte
Low base memory byte
High base memory byte
Low expansion memory byte
High expansion memory byte
Disk C extended byte
Disk 0 extended byte
Reserved
2-byte CMOS checksum
* Low expansion memory byte
* High expansion memory byte
* Date century byte
* Information flags (set during power on)
Reserved

CMOS RAM Address Map

* These bytes are not included in the checksum calculation and
are not part of the configuration record.

1-56

System Board

Real-Time Clock Information
The following figure describes real-time clock bytes and specifies
their addresses.
Byte

Function

Address

0
1
2
3
4
5
6
7
8
9
10
11
12
13

Seconds
Second Alarm
Minutes
Minute Alarm
Hours
Hour Alarm
Day of Week
Date of Month
Month
Year
Status Register
Status Register
Status Register
Status Register

00
01
02
03
04
05
06
07
08
09
OA
OB
OC
OD

A
B
C
D

Real-Time Clock Information (Addresses 00 - 00)

Note: The setup program initializes registers A, B, C, and
D when the time and date are set. Also Interrupt 1A is the
BIOS interface to read/set the time and date. It initializes
the status bytes the same as the Setup program.

Status Register A
Bit 7

Update in Progress (UIP)-A 1 indicates the
time update cycle is in progress. A 0 indicates
the current date and time are available to read.

Bit 6-Bit 4

22-Stage Divider (DV2 through DVO)-These
three divider-selection bits identify which
time-base frequency is being used. The system
initializes the stage divider to 010, which selects a
32.768-kHz time base.

System Board

1-57

Bit 3-Bit 0

Rate Selection Bits (RS3 through RSO)-These
bits allow the selection of a divider output
frequency. The system initializes the rate
selection bits to 0110, which selects a 1.024-kHz
square wave output frequency and a
976.562-microsecond periodic interrupt rate.

Status Register B
Bit 7

Set-A 0 updates the cycle normally by
advancing the counts at one-per-second. A 1
aborts any update cycle in progress and the
program can initialize the 14 time-bytes without
any further updates occurring until a 0 is written
to this bit.

Bit 6

Periodic Interrupt Enable (PIE)-This bit is a
read/write bit that allows an interrupt to occur at
a rate specified by the rate and divider bits in
register A. A 1 enables an interrupt, and a 0
disables it. The system initializes this bit to O.

Bit 5

Alarm Interrupt Enable (AIE)-A 1 enables the
alarm interrupt, and a 0 disables it. The system
initializes this bit to O.

Bit 4

Update-Ended Interrupt Enabled (UIE)-A 1
enables the update-ended interrupt, and a 0
disables it. The system initializes this bit to O.

Bit 3

Square Wave Enabled (SQWE)-A 1 enables the
the square-wave frequency as set by the rate
selection bits in register A, and a 0 disables the
square wave. The system initializes this bit to O.

Bit 2

Date Mode (DM)-This bit indicates whether
the time and date calendar updates are to use
binary or binary coded decimal (BCD) formats.
A 1 indicates binary, and a 0 indicates BCD. The
system initializes this bit to O.

1-58

System Board

Bit 1

24/ 12-This bit indicates whether the hours byte
is in the 24-hour or 12-hour mode. A 1 indicates
the 24-hour mode and a 0 indicates the 12-hour
mode. The system initializes this bit to 1.

Bit 0

Daylight Savings Enabled (DSE)-A 1 enables
daylight savings and a 0 disables daylight savings
(standard time). The system initializes this bit
to O.

Status Register C
Bit 7-Bit 4

IRQF, PF, AF, UP-These flag bits are
read-only and are affected when the AlE, PIE,
and VIE bits in register B are set to 1.

Bit 3-Bit 0

Reserved-Should be written as a O.

Status Register D
Bit 7

Valid RAM Bit (VRB)-This bit is read-only and
indicates the status of the power-sense pin
(battery level). A 1 indicates battery power to
the real-time clock is good. A 0 indicates the
battery is dead, so RAM is not valid.

Bits 6-Bit 0

Reserved-Should be written as a O.

CMOS RAM Configuration Information
The following lists show bit definitions for the CMOS
configuration bytes (addresses hex OE - 3F).

Diagnostic Status Byte (Hex OE)
Bit 7

Power status of the real-time clock chip-A 0
indicates that the chip has not lost power, and a 1
indicates that the chip lost power.

System Board

1-59

Bit 6

Configuration Record (Checksum Status
Indicator)-A 0 indicates that checksum is good,
and a 1 indicates it is bad.

Bit 5

Incorrect Configuration Information-This is a
check, at power-on time, of the equipment byte
of the configuration record. A 0 indicates that
the configuration information is valid, and a 1
indicates it is invalid. Power-on checks require:
•

At least one diskette drive to be installed (bit
o of the equipment byte set to 1).

•

The primary display adapter setting in
configuration matches the system board's
display switch setting and the actual display
adapter hardware in the system.

Bit 4

Memory Size Comparison-A 0 indicates that
the power-on check determined the same memory
size as in the configuration record, and a 1
indicates the memory size is different.

Bit 3

Fixed Disk Adapter/Drive C Initialization
Status-A 0 indicates that the adapter and drive
are functioning properly and the system can
attempt "boot up." A 1 indicates that the
adapter and/or drive C failed initialization, which
prevents the system from attempting to "boot
up."

Bit 2

Time Status Indicator (POST validity check)- A
o indicates that the time is valid, and a 1 indicates
that it is invalid.

Bit 1-Bit 0

Reserved

1-60

System Board

Shutdown Status Byte (Hex OF)
The bits in this byte are defined by the power on diagnostics. For
more information about this byte, see "BIOS Listing. "

Diskette Drive Type Byte (Hex 10)
Bit 7-Bit 4

Type of first diskette drive installed:
0000
0001
0010

No drive is present.
Double Sided Diskette Drive (48 TPI).
High Capacity Diskette Drive (96 TPI).

Note:
Bit 3-Bit 0

0011 through 1111 are reserved.

Type of second diskette drive installed:
0000
0001
0010

No drive is present.
Double Sided Diskette Drive (48 TPI).
High Capacity Diskette Drive (96 TPI).

Note:

0011 through 1111 are reserved.

Hex address 11 contains a reserved byte.

System Board

1-61

Fixed Disk Type Byte (Hex 12)
Bit 7-Bit 4

Bit 3-Bit 0

1-62

Defines the type of first fixed disk drive installed
(drive C):
0000

No fixed disk drive is present.

0001
to
1110

Define type 1 through type 14 as shown
in the following table (also see BIOS
listing at label FD_TBL)

1111

Type 16 through 255. See "Drive C
Extended Byte (Hex 19)" on page 1-65 .

Defines the type of second fixed disk drive
installed (drive D):
0000

No fixed disk drive is present.

0001
to
1110

Define type 1 through type 14 as shown
in the following table (also see BIOS
listing at label FD_TBL)

1111

Type 16 through 255. See "Drive D
Extended Byte (Hex 1A)" on page 1-65 .

System Board

The following figure shows the BIOS fixed disk parameters.
Type

Cylinders

Heads

Wr i te
Pre-Comp

Landing
Zone

1
2
3
4
5
6
7
8
9
10
11
12
13
14

306
615
615
940
940
615
462
733
900
820
855
855
306
733

4
4
6
8
6
4
8
5
15
3
5
7
8
7

128
300
300
512
512
None
256
None
None
None
None
None
128
None

305
615
615
940
940
615
511
733
901
820
855
855
319
733

15

Extended Parameters (hex 19 and 1A)

BIOS Fixed Disk Parameters

Hex address 13 contains a reserved byte.
Equipment Byte (Hex 14)
Bit 7-Bit 6

Indicates the number of diskette drives installed:
00
01
10
11

Bit 5-Bit 4

1 drive
2 drives
Reserved
Reserved

Primary display
00

Primary display is attached to an adapter
that has its own BIOS, such as one of the
following:
•
•

the Enhanced Graphics Adapter
the Professional Graphics Controller.

System Board

1-63

01

Primary display is in the 40-column mode
and attached to the Color/Graphics
Monitor Adapter.

10

Primary display is in the 80-column mode
and attached to the Color/Graphics
Monitor Adapter.

11

Primary display is attached to the
Monochrome Display and Printer Adapter.

Bit 3-Bit 2

Not used.

Bit 1

Math Coprocessor presence bit:

o
1

Math Coprocessor not installed
Math Coprocessor installed

Diskette drive presence bit:

Bit 0

o
1

Diskette drive not installed
Diskette drive installed

Note: The equipment byte defines basic equipment in the
system for power-on diagnostics.

Low and High Base Memory Bytes (Hex 15 and 16)
Bit 7-Bit 0

Address hex 1S-Low-byte base size

Bit 7-Bit 0

Address hex 16-High-byte base size
Valid Sizes:
0100H
0200H
0280H

1-64

System Board

256K-system board RAM
512K-system board RAM
640K-512K system board RAM
and the IBM Personal Computer
AT 128KB Memory Expansion
Option

Low and High Expansion Memory Bytes (Hex 17 and 18)
Bit 7-Bit 0

Address hex 17-Low-byte expansion size

Bit 7-Bit 0

Address hex 18-High-byte expansion size
Valid Sizes:
512K-1/0 adapter
1024K-1/0 adapter (2 adapters)
1536K-1/0 adapter (3 adapters)
through
3COOH 15360K I/O adapter (15M
maximum).

0200H
0400H
0600H

Drive C Extended Byte (Hex 19)
Bit 7-Bit 0

Defines the type of first fixed disk drive installed
(drive C):
00000000 through 00001111 are reserved.
00010000 to 11111111 define type 16
through 255 as shown in the following table
(see BIOS listing at label FD_TBL).

Drive D Extended Byte (Hex lA)
Bit 7-Bit 0

Defines the type of second fixed disk drive
installed (drive D):
00000000 through 00001111 are reserved.
00010000 to 11111111 define type 16
through 255 as shown in the following table
(see BIOS listing at label FD_TBL).

System Board

1-65

The following figure shows the BIOS fixed disk parameters for
fixed disk drive types 16 through 22.
Note:

Types 23 through 255 are reserved.

Type

Cylinders

Heads

16
17
18
19
20
21
22

612
977
977
1024
733
733
733

4
5
7
7
5
7
7

Wr ite
Pre-Comp
All Cyl

300

None

512
300
300
300

23

Reserved

255

Reserved

Landing
Zone

663
977
977
1023
732
732
733

BIOS Fixed Disk Parameters (Extended)

Hex addresses IB through 2D are reserved.

Checksum (Hex 2E and 2F)
Bit 7-Bit 0

Address hex 2E-High byte of checksum

Bit 7-Bit 0

Address hex 2F-Low byte of checksum

Note:

1-66

Checksum is calculated on addresses hex 1O-2D.

System Board

Low and High Expansion Memory Bytes (Hex 30 and 31)
Bit 7-Bit 0

Address hex 30-Low-byte expansion size

Bit 7-Bit 0

Address hex 31-High-byte expansion size
Valid Sizes:
02000
0400H
0600H

512K-1/0 adapter
1024K-I/0 adapter
1536K-I/0 adapter
through
3COOH 15360K I/O adapter (15M
maximum).
Note: This word reflects the total expansion memory above
the 1M address space as determined at power-on time. This
expansion memory size can be determined through system
interrupt 15 (see the BIOS listing). The base memory at
power-on time is determined through the system
memory-size-determine interrupt (hex 12).

Date Century Byte (Hex 32)
Bit 7-Bit 0

BCD value for the century (BIOS interface to
read and set).

Information Flag (Hex 33)
Bit 7

When set, this bit indicates that the top 128K of
base memory is installed.

Bit 6

This bit is set to instruct the Setup utility to put
out a first user message after initial setup.

Bit 5-Bit 0

Reserved

Hex addresses 34 through 3F are reserved.

System Board

1-67

110 Operations
Writing to CMOS RAM involves two steps:
1.

OUT to port hex 70 with the CMOS address that will be
written to.

2.

OUT to port hex 71 with the data to be written.

Reading CMOS RAM also requires two steps:
1.

OUT to port hex 70 with the CMOS address that is to be
read from.

2.

IN from port hex 71, and the data read is returned in the AL
register.

1-68

System Board

Specifications

System Unit
Size
•

Length: 540 millimeters (21.3 inches)

•

Depth: 439 millimeters (17.3 inches)

•

Height: 162 millimeters (6.8 inches)

Weight
•

20.0 kilograms (44 pounds)

Power Cables
•

Length: 1.8 meters (6 feet)

Environment
•

Air Temperature
System On: 15.6 to 32.2 degrees C (60 to 90 degre@s F)
System Off: 10 to 43 degrees C (50 to 110 degrees F)

•

Wet Bulb Temperature
System On: 22.8 degrees C (73 degrees F)
System Off: 26.7 degrees C (80 degrees F)

System Board

1-69

•

Humidity
System On: 8% to 80%
System Off: 20% to 80%

•

Altitude
Maximum altitude: 2133.6 meters (7000 feet)

Heat Output
•

1229 British Thermal Units (BTU) per hour

Noise Level
•

Meets Class 3; 59 decibels average-noise rating (without
printer)

Electrical
•

Power: 450 VA

•

Range 1
Nominal: 115 Vac
Minimum: 100 Vac
Maximum: 125 Vac

•

Range 2
Nominal: 230 Vac
Minimum: 200 Vac
Maximum: 240 Vac

1-70

System Board

Connectors
The system board has the following additional connectors:
•

Two power-supply connectors (PS8 and PS9)

•

Speaker connector (119)

•

Power LED and key lock connector (J20)

•

Battery connector (J21)

•

Keyboard connector (J22)

The pin assignments for the power-supply connectors, PS8 and
PS9, are as follows. The pins are numbered 1 through 6 from the
rear of the system.
Connector

ps8

PS9

Pin

Assignments

1
2
3
4
5
6

Power Good
+5 Vdc
+12 Vdc
-12 Vdc
Ground
Ground

1
2
3
4
5
6

Ground
Ground
-5 Vdc
+5 Vdc
+5 Vdc
+5 Vdc

Power Supply Connectors (PS8, PS9)

System Board

1-71

The speaker connector, 119, is a 4-pin, keyed, Berg strip. The
piris are numbered 1 through 4 from the front of the system. The
pin assignments are as follows:
Pin

Function

1

Data out
Key
Ground
+5 Vdc

2

3

4

Speaker Connector (J19)

The power LED and key lock connector, J20, is a 5-pin Berg
strip. The pins are numbered 1 through 5 from the front of the
system. The pin assignments are as follows:
Pin

ASSignments

1
2

LED Power
Key
Ground
Keyboard Inhibit
Ground

3

4
5

Power LED and Key Lock Connector (J20)

The battery connector, J21, is a 4-pin, keyed, Berg strip. The
pins are numbered 1 through 4 from the right of the system. The
pin assignments are as follows:
Pin
1
2

3
4

Assignments
Ground
Not Used
Key
6 Vdc

Battery Connector (J21)

1-72

System Board

The keyboard connector, 122, is a 5-pin, 90-degree Printed
Circuit Board (PCB) mounting, DIN connector. For pin
numbering, see the "Keyboard" Section. The pin assignments are
as follows:
Pin
1

2

3
4
5

Assignments
Keyboard Clock
Keyboard Data
Reserved
Ground
+5 Vdc

Keyboard Connector (J22)

System Board

1-73

The following figure shows the layout of the system board.

Keyboard
Connector

Rear Panel

Battery

~~ Connector

~~=I=' (J21)

Power
Supply
Connectors

I/O
Channel
Connectors

Variable
Capacitor

- - - - - -,

rnrnrnrnrnrnrnrnrn

I
I

rn~rnrnrnrnrnrnrn :

@]

1-74

System Board

Note: The memory module
layout and system board
dimensions may vary.

Notes:

System Board

1-75

Logic Diagrams - Type 1

~e;

go2l:;g~;%~g~~65~~

~~

-

-

C\I
C\I

0

....
....

G)
G)

••

.c

..

8C~Sg~gb~g~5~5~~§

~
IV
C
IV

a:
,--

1

m
~

C\I

.-

Il)

.-

:r -I'

G)

c.

li~I~~ jl*ego~~",~g:;~g~o~:::g~~"
8

~~

1-7 6

System Board

~~~~

§"§'

",iS~'~i~
11'1
It!
, ""

::.:~gi:"'''''i
...
"'II'I~!.

iil~~

SA'
so.

1

(SH.4)
(SH.6)

7
,
5

,,

SAS
SA6

m

SA'

-OM' "EN
RNI+-1

'5

10.

,

ALS02

~IO.

Isr
(SH.4)

r

,
,,
,

SAil

"0
5.,
s..,

,
5

r

.
:
A
A

A

19

.
..

,"
,"
'"
,,""

,,"
"
B"

glR

7

'"

SAID

".5"

:

A

(81'1.1,11,14,15,16)
(SH.l,1',14,15,17)
(SH.3,1',14,15)

us
'"
'"

(SH.l,1',14,18)
(SH.l',13,14)
(SH.11,13,14)
(SH.11,l3,14)
(SH.l1,_13,14)

GRZ

(SH.e,lS)

'"

(SH.l1,l3,14)

'"
'"

'"

A

2 .. 0;

A

,"

,,8""\2

A

A
•

B
, "I'
: 1&

DlR
G

'"
'"

(SH.3)

""

Type 1 512KB Planar (Sheet 5 of 22)

XAIO
XAII
XAI2

ISH,C4(

XAIl
~AI"

XAI'i·
XAIE.

(SH.l1,14)
(SH.ll,14,lS)

(SH.2)

I

(SH.2)

,

SDO
SOl
SDl

S",
SD6
SD,

Il

I

(8H.2)

SOli
5012
SDI~

Il

5010:;

l

....

(SH.5)
(SH.5)
(SH.4)

-RAM 0 CA8
-RAM 1 CAS
-LCS ROM

(SH.15)

+0
-XMEMR

(8H.5)
(SH.22)

'"

""

(SH.8,9,10.11)

""
""

(SH.8.9,IO.ll)

MOlD
Hall
MOl2
Hon
HOI..
HalO:;

" ,'
I' WI!

SDI"

1

"Db

'.
~
," ,,
"" ''

soe
SD'

(51·1.15)

f=

,

~'

st>m

(SH.8,9.10,11)

"DZ

~'""", ,,

SO,

(5H.1S)

(8H.2)

",>0

""
""
""
""

~:

SO,

'

I

(SH.6,9,10,11)

IIr~-

II~j
'"

~----------~~:l'-'------J

~
'~-----------j

BM/IO

(SH.2)

ALSO"

(SH.2)

(SH.2)
{SH.71
(SH.2)
(8H.2)
(8H.12)
(SH.19)

ALE

-MEMW
+RAS
-lOR
+AIQW
01
-10 CS 16

!~~:~;l ~~~~

~~:~) ~:~~~8

I

HUll

10

!~ i"~H'I-I ,-I
UO

PAllt>l'

~ III1~~~~~~n

~'~'~~~~~~~~~~~~~~~~~~~~ gfJ~.fsONV i~~: ~~;
GATE 245
-OMAAEN
-END eyc

(SH.13)
(8H.5.1S)
(8H.12)

__________________ __________

20

-i

~

I

....
QO

Type 1 512KB Planar (Sheet 6 of 22)
l N0I1:J3S

...

f=

.,

·'f:

I

10K

QO
N

~
(SH.5)

-LMEGCS

(SH.2)

-I'1EHR
-HEHW

(SH.2)

ALS""

~:~

~T-P~'

1.2

l

9

"K

AI,

y~1

'12

"n

',on
"

16

"
I

Y2 12

U'I9

FOD

l;Ju90 8

l

'"

+ RAS

1,J

DEL"Y
U61
PEllZ n

ItO 110
If

[20

160

200

10

6

'I
1

(SH.5)

-RAM 0 CAS

(SH.5)
(SH.5)

+RAM 0 RAS
+RAM 2RAS

(SH.5)

-IW'II CAS

I

U81

ALSO If

(SH.5)
(SH.5)

1 uel

,
,

I
Z u,,)q

~

+RM'IIRAS

U,)II

II)

6

I

2

UC;II

II)

FlO

I

10

(SH.2)

XAO

-XllH'

'i

U81

6

12

-RAS 0

7 100 ,0

(SH.a)

(SH.e)

1 100 1'4

(SH.a)

Fro

,

II U,)7"'\. 8
2

FlO

13

u'n

11

FlO

~

U'51

II

FlO

OJ U'il
10

II

If 1011 11

FlO

t~

AlSO"
(SH.15)

,.,

FlO

~ u·n\..6

,

II

(SH.6)

(SH.a)

If U,)1\'6

12 Foe
11 U'>9

+RAMl AtS

FO'
1

.RAS

+(A5

~

ALSOIf

(SH.20)
(SH.20)

l

TINE

III

-SHEHR
-SMEMW

FtO

~ use

Type 1 512KB Planar (Sheet 7 of 22)

12

12

•
,

tI 101'1 11

2 1OO

;

DINI DOUT

,,lit

-""
SA'
S"
SAO
SAID
SAl'
SAIl
"""'SEL

_n

rm

Hf)II;

ISH. 21) _ REFRESH

--

I:

I

110"

I DIN U..l
1.11f DlN/OOUT

I Iii
1.'1t

'I
'I

VI

1

~I

-...

-RAS'

,

,,on

, ,"

I

ItA,
H. .

q HAl

"AO
HAl

-""

U. .

-•
1-

....""
"""
HO'
MO"

""'
1101'
_HI

-,

lRASi
AO

.
.

A'

12

~

,

Al

,
' .,
"

~ ~o
m
I ,It DIN/Dour

,.

-,

r ., I •
TO ClIO

9-.10/ol;J

I .,

'"

DIN/OOOT
,~

i'

HAO
HAl

(SH.9)

"A'

,

I~TAGE

HMo

MAO

8H

""
ItA'
H'"

I 2-IOIIF

,
9-.'Oj.\~

(

10pF: Cl,2,52,53

.10,.F: C7,1',16,20,28,

32,38.42,47
ca,12,17,21.29.

2-,o"rl

33,39,43,48

...w,

'"

"'""'"

'"
'"I,llt
1,IIt

U. .
U. .

,

DIN/OOUT

""

DIN/DOUT
(9) 128KX!

U'tlt'lf

rIFOUTl

(SH. 9,10)

~

I

~
~

Type 1 51 2KB Planar (Sheet 8 of 22)
L NOl133S

....

~

I

MOO
MOl

CID
olio.

MOl

MO'

IZl

M"

~

~

~

!!!!!

Ii!

=

l

10 lit

""'
.!!!!

DIN IDOUT Ul')

1.11f
1.11f

DIN / DOUT lI2'i
DIN IOOUT U~

1.11f

tIN /OOUT

TA.

1&
(SH.e)

r

TA,

m

MOO

..

m-

I1DII

.=.!&..l

"01
"0'

~

-....

"'",

OO
=1!ll

"

-

-CAS IL

MO"
"00
.o,

~ Ie

"Al

!!

1 """A'"A'

11

"AI

ItA,

(SH.a)

.... 1

(SH.7)

-to. . ,

t

(SH.7)

-RAS.

-CASIL
-rutH

-+--

•

FZIt'
AN'

It'L2
u••

TAO
TAl

t

.

--'
L..J1
, ,.n

TA'

TA'
TA

TA.
TA7

HOPIN I

HOPINO

(SH.1O)

HOPINI

(SH.8)
(SH.a)

(SH.22)

"'fOUT.

......url
-TVE

I,DIN

MIlII
MD.

1.11f

hi ..

HOlD

1,'1f

HDII

MOl2

I,

'If

Ulfe.

.

DIN/DOur Uif

~UIO

BAN"

OJN lOOUT UII
DrN / DOUT U22

HOll
MaIO

liT

m
TAl

'm"

m
TA,

~fAS ,
::;w-!!AS •
-CAS I H

OECOUPUNG CAP:
YOLTAGE I
lANK
TO GND

+ '5

~
TAO

{SH.l0)

I OPTIONAL

HDPOUT I

I.

(SH.S)

l(

PQ)pour 0

-.

.-"'"'.....+.

(SH.e)

lANk 2

=l.!tL

" "1

~
I~
7

+.

...,
AI

"'2

A•
A'

••

A7

~wr
I·.~
(,,)

128 K IC I

~

OPTIONAL

Type 1 512KB Planar (Sheet 9 of 22)

19-.IQuF

I

"-./OuF

2-101.11'"

I

Z-IOuF

lOpF:

C3,4,54,55

.1Op.F:

ca,l3,18,22.30.
34,40,44,49
Cl0,14,19,23,31,
35,41,45.50

~

~

~

@

~

~

~

f
~

0;

""

"'"

.,..

~

@

"

~

"~ ""
'"

"~

"~ ~"

"

~

i="iil N

~

!2.~

I:l

:i:r I

I:l

:J:

System Board

1-85

i4~~~~~!;;;~S:~i~!ii~'lf:8c21~gl!';8::;~ ~:
=

~~~~

~~

~~

~

~--~-~

N

....
........
CD
CD

.c

-..
U)

as
c
as

a::

III
~

C'\I
....

It)

1-86

System Board

r---------------

I

I

1

1

I

I

,

'8
-

01

(SH.B,tS)
(SH.t)

-ARDY

- on

(SH.S)

L--f---------':========i-----------------------JIJI-

RES/i!I'oIS

~Jl----::-=----------------------AROyEN

(SH.S)

(SH.1)

(SH.S)

.ATA CONY

FI1'l
'"

+CONYA'

l_-.__~~~___________~~::--------~~~~~DZ
DI

(SH.4)

.,

i

==

D'
CLftUIOO

-RESET

(SH.3)

-~5

r;lE>'

III

l

..

+CONVAlE

(SH.4)

~-CNTLOFF

(8H.2)

11
I~.

I

QC

......

Type 1 512KB Planar (Sheet 12 of 22)
l
I

NOll::J~S

.

""""
I

Of)
Of)

(SH.6)

(SH.21

t

OIR'Zlfl)

fI}

{SH.21

~

(SH.6)

GATEl't'i

-e

~

==

0

a.

+

(SH.21

I

so;

SO
SO,
SO'
SO,
SO

00

•••
o •
,, ••
•

I 'DO

500

SO

,•

,

500
507

2

ALSZIf"i

5
SO,

"""

••
"

••

~ ~IR

."
•

I

SDt~

"

: 17

•

SOIl)

UI02

508
SO,
5010

1

(SH.21

SOil

SO"
501'

SI'"

500

••

,

o•

5"'

.. ,

00
507
11 ALS08

(SH.31

·..' . .'"'""
'.
•

SDllf

HLDA

(SH.19) -MASTER

12

U"~

II

I

AlS04
q

us.

•

Al 52

Lt')

B

:"i

• I

:• 17
18

"•
,---l

OIR

2 AlS27

(SH.2)

-lNTA

, UI21

(SH.5)
(SH.5)
(SH.5)

,u

I

2 •

'I

KA7

.,

'2 .13

.

•

~
.q

'D'
'D7

(SH.14,15,16,17,18)
(SH. 3,14,15,16,17,18)

+ACK
-ACK

(SH.3)
(SH.4,15)

Uill

I~

ALSOIf

'D'
'0'

-A(K

JIM
XA8
-XIOR
-NPCS

V2

(SH.14('.'''''8)

KO'

~

(SH.S)
(SH.5)
(SH. 15)
(SH.3)

UBit

'00
'01
'02

U62

8

10

USIH
,

L---'.:

TO

•

C

G2'
G2B
GI

to;
tit

n

12

~

10

YO

•

T7

7

UI 2 1

Type 1 51 2KB Planar (Sheet 13 of 22)

-OMAt (S
-INTRICS
-TIC (s

(SH.14)
(SH.lS)
(SH.1S)

-PPI (S

ISH. 18)

-PG REG (S (SH. 15)
-ItHR 2CS (SH.l{;1
-OMA2(S (SH.14)

- CS 287

(SH.3)

.

.

~

"-

55

fij

~2~~

~

wfii

~

§"§~~

"-

~

~~

IIII

!!H'?.~~

1
t:1~1~'~1

W·· ..····

:1tr~1~1~

f····
..· I~J
~
<>-"'r-->I!",:t''''N

I

~ noon:ooool~

0000:000'"

J~~l~c~

:lJ:r :l:r =-Lre:oaH~~

8-2l~g~~3

><

ex

><><><><

g~

,

ltlf

of

~~

#

I~

c-

?=

"

~

~~~ ~

~~

<>-"'r-- .o",%",N

.

f:'1f:'1f:'1~

z.

~~~~

I------

fijfij

~

.J
r
im

•,

~~

. .;; ~ ~.~.,g o~~ ~1;g

~

.

~

J~~
o

~
~

nn~I~I~I~'~~d~ ~

Nr

•~

I~

-

~

o

~

,...

...

.d [".,

. .

•

~

5

6

I

~i

.

~

~n

~

~~~~

5

~ .;;, •• ~., 8o~ ~g ~ g8~n~1i1~~I~'"~d ~

~""."~~'"-~'"N'. ___ N_'=·-Il

~~~~~~~~~~~~~~~N

-

-- -

,

Q)
Q)

~

--...

(/)

IU
C
IU

c:

ID
~

t- if--

('II
,...
It)
,...

I

Q)

Q.

~
~-~5x'~'oo~-~~.~~-

l

~
~
=
•"~

-

'ld~
'"~!

~,

f

I~~j~j~j ~

~ ~8~~ ~S~e~~H~ee

.I! Igl~I~I~I;I~I~~I~I!

I

;M~
:il:I
!:2.f:'1~

System Board

1-89

!

g'"

~.:;....

~ 5 'i~!-'
~~

C\I
C\I

-...
o

It)

....Q)
Q)

s:

-.
tJ)

-

aI

C

aI

is::

m
~

D ~ ~~

...
...
C\I

·-='·~·IT~j

It)

# -

'.

1tH~==I=+:j::j:=j:+=+==t1t1l

....
~

~I
L~

-<
mo

. ...

~.c«'

IOKtAN'i-!I

..""

5"t'NC\-!L--NC

ICEYBOARDCONIt.
('iPINOIN)

~::::=l::l:j:t===~ ~

:: ~k:A

r-:-;::::=ti:It===3:j; ~

::~ ~~O

,

'TESTO

ruTl

.§..M!!

klIOCLK

0

""

l:,:·::r
IOTTOI't
(PlNSIOE")

,SH.l0)
l:~: ~I
(SH.21)

PCK~~~~~~~~~~~~~~~~~'III

10 ~~g
REFDET

Type 1 512KB Planar (Sheet 17 of 22)

.1 I •

"f~'i.

FUl

(SH.22)
(SH.t!
(SH.51
(SH.tB)

-....
C\I
C\I

o

.....
CO

:;:~

~

a:

:JL-.,

Q)
Q)

.c
tn

-...
«I

c:

«I

D:

ID

. ~~ ~
e§

[~ ~

E

~

zz

N

I~ ~

~

....

~

...
...

,r

C\I

10

~

,N

~~

>

5

M
MN
~-;;;
1!21!2

1!2

~iO§'~~

~~~~~

System Board

1-93

...
I

'=
~
00
'<

'"....
~

e

t:C

Q

~

=-

~ ~~n ~;;Og

r-'~~~-J~,;rr

'T

SDe

so,

SOlO

SOli
SOl2
SOt1

so,"

(SH.2)

s~s

(SH.4)

LAn
LAZ2
LA21
LA2D

!

(SH.4)
(SH.2,21)
(Sh.2l

SBI£

-M[I1R
-I'1EI'1W

CII

liD

m
'"
ill

CONNECTOR
06 PIN}

ill

DI7
1001

002

ill:

I

(SH.14)

-DACKO
-OA(I<';
-OAO

B11

u

All

DOInCDI

D1SUC!8

Type 1 512KB Planar (Sheet 19 of 22)

(SH.14)
(SH.14)
(SH.14)
(SH.14)
(SH.16)

t

(SH.IS)

(SH.2)

SDO
SOl

S02

1

(SH.2)
(SH.4)

SOl
S,"
S",
SD6
S07

SAD
SAl
SAl
SAl
S'"
SA>

SA'
SA7
SAO
SAO
5,1,'0
SAil
SAI2

SA"
5,1",+
(SH.4)

00
'<
~

S,I,I'j
SAlt.
SAI7
SAle
SAt9

A"
A08
A 7
A ,

AOJ

J8

A27
A22

,ALE
OWS

".

(SH.3)
(SH.12,15,21)

IRQ 9
IRQ ~
IRQ '+
IRQ'i
IRQ 6
IRQ 7

(SH.16)

822

.IB

."
."

AI2

(SH.3)
(SH.22)

-liD (H (I(
J/O (H ROY

'"
.21

BI'

.".26.17
."

".'"

Am

'04

A"

-REFRESH
-0,1,(1( t
-0,1,(1( 2
-0,1,(1( ~

.,

.",

A

."
AlB
AI7
AI
AI;
A"

(SH.21)
(SH.14)
(SH.14)
(SH.14)

Os(

,+,1K

J7

Al'
A27
m
Al'
A

SYS(LI(

7 Ie
AEN

.29

J6
A7I

(SH.3)
(SH.l0)
(SH.14)
(SH.3)
(SH.3)

RESET DRY

.,

",
JS

A02

-lOR
-S MEMR
-5 MEMW

'"

AOS
A04

(SH.2)
(SH.2)
(SH.7)
(SH.7)

-lOW

JI

"

I
811

L

!

(SH.16)

ORQ I
ORQ2

(SH.14)
(SH.14)
(SH.14)

PWR GOOD

(SH.1,1S)

TPI2
PS.
PCYoIER

820

J
827
All
.02

'0'
807

+12
-12
G

."

1D"~1,"7"F

.01
BID

82.

0(26)

",
'D7

I

~

+,

(X2'I)

I I

ONN.

iID':l

S'"
~

-'i

~

PS'

GNO I
GNO

~-o;YI
+, y
'j

6

GOOO

e
c
e

c

+0; ~ DC
+'i \ DC

('I)

a

=
Q

..,

~

=-

....
I

\C

fA

Type 1 51 2KB Planar (Sheet 20 of 22)
L NOI133S

N
N

-....
o

N

....

Q)
Q)

.c

-...
en
CU

C
CU

D:
1%1

::.::

N

....
It')

!i
"~

1-96

~
~

,
~

~

"~

§,.,.
xi

~~

System Board

"~

Ii
~

~

.•

~
~

•
'"
~

iii

~

'"

. .
w

,

12

~

, Ii
~

~
~a:

.1

.d

fp!-o~

8
5

e

v
~

:

Q

~

-..

~

C'I

o

L--'--

C'I
C'I

~

~

0

10

d

CD
CD

~

.c

-.'"..

~

U)

C

a::'"

III

:.:::

...
...
C'I

it)

!:l!!

=

S
5

~

~

L

i

i

~

~

_0_
.~~

---

iii
!'J.!'J.a.

~
3j
~

~
~< ~

::

~iOJi9

~

~~~

~
IS
~

~

i

i"
System Board

1-97

Logic Diagrams - Type 2

~-.-----"
~
'~
g

~~ ~~c~:~~~~~~~~~~~~~~~~~~~$
~L

~

t-

-........
('oj

+-

0

.......

Q)
Q)

.c

-...

en

IV

c:

IV

c::
r:D

~

('oj

....
10
('oj

l~P~1
~~

re

i!iH~~

~_

~~

- _ ..

~~

~=:=

i?'!

1-98

~~

System Board

@@@~

~~

L-.

=

... "'.......

Q)
Q.
Ir--"l'",

~

:;;

~

;
"~

"a
~.
~
~i?
:i:i

@.@.

"-

~,
-.=-c;
n

1a.!1.

~~~!i'~

9~
~~

~

=

ey

--

e;::-;::;::";=-;::xIII:':I :.;:i
!!2-12!!2-!2!!H.2 [{d.!Q.

~

<

"

~

<

"

:~
~~

gc2:l52)~i!:S

ra.ra. ~--

iI

<

"

!:g~~~~~!S

~ -~

System Board

1-99

......
=
I

=
00-

'<
[I}

(SH.t)

(SH.2)

(SH.l)

....

11

""

+ RESET 281

"
19

-XIOW

(SH.4)

(SH.t)
(SH.l)

HALlbL8A

p,

(SH.5)
(SH.14)
(SH.14)
(SH.12)

R[SE'l

-fInn

,,

,"/!l>

-(52IH

"

,,

-IHTA
~ OUSY
-ERROft

+RESET

.,

(SH.l,2,11,12)
(SH.t)
(SH.l5)

""19

10
lO

(SH.4,9,11,14,20,21)

UI30

~

a

t:=

(SH.t)

-MP(S
-BUSY 286

rRG n

OI1AClI(

(SH.13,14)

-OMACLK

(SH.20)

(SH.t)

0

e;

EHAS

(SH.l7)

All

Co

"
"

SVSCLK

(SH.19,20,21)

-SYSCLI(

{SH.ll}

Al'
(SH. 1)

-16t'1HZ

PROCCLK

"

"
"lO

PROCell(

+PClK
(SH. 16)

+ n"

10 (If

(SH.2,1t)

(SH.l6)
(SH.16)

.,
(SH.t6)

(SH.19)

-JOCKO

(SH.9l

-PCk

(SH.12)

X07

(SH. 17)

-""I C5

(SH.l)
(SH.12)
(SH.5)

(SH.l)

U(I(

G~~~

'PU"'-'"

,HI

~LL'
Y,~'~~~~ ""
:~

.'

.---..!L

:

Y. 7

;:

C U1'i

Type 2 512KB Planar (Sheet 3 of 21)

(SH.l)

fllDA

(SH. 1,5,12,20)

BALE

(SH.t9)
(SH.19)
(SH.t9)

RESET ORV

":;}'"

-~~
n

!QIQ

~

at

6l

~

~-~!Q
!Q

-,'"..

o

'It

....GI
GI

.c

-...
en
CO

c:

~!

~

"0(<0; '"

"'c..: ..

~'"

t

~
:iii!

g

CO

Nr

00000 0

Go.

c::

k.:>1'S

IX!

~

'"
'"
,..

It)

GI

Q,

~

~

:;
~

C~;~~~:o::~

~i~~~~~!

~~N~!:!!!:

. . . . . C .... C

~~

~

Y

~-~~
12!!?.

!!?.

-~
""

~-~

;:-;:-;0

~~~

~

I
§.

"~ §"

System Board

1-101

......

(SH.4)

I

=

N

if
....
(I.l

(SH.l)

!

(SH.l)

(SH.20)

..
,"

...'"
'A20
21

."
"'

,

~P,J
"K

51

=

e;

Q.

'2

-

HLOA

ALE

(SH.4)

(SH.6)

l~'

,

RCASI

-

(

r------rl- ~
,ii.

"72

~
, U6~
;

, '"
If

UIIO

,AI

.

SA<

-OM.....EN

..
,."
,. ,
,

5,1,10

..0

SAH

...

,
,,
,
,
7

'"
,""
'"
'"

5AII

(SH,7)

o

12

~

19

0"

-RAN 0 (AS
-RAM I CAS
-LMEG (s

(SH.6,7)
(SH.5)
(SH.7)

+FSYS 16

(SH.6)

"b'

ALS02

t : "" "

6

6

SA2

RH'f-l

(SH.4i

lit

.,

JUP1.PER

" "K

'ST

I

"~~

0'18
0Ht::
g~

0
0
0
0

-ReA.SO

-HEM CS.6

(SH.3)

I

g~

'0

DZ ,

,"

, 0
, 0

RAS

,""
Iq 47

ALS,)H

,+RRAsa
,-+

-RAM SEL

{SH."}

(SH.4)

Dt

RN't-IO

')6/o;IZK

R. t
{SH.16}
(SH.1S)

00'

2"

AI7

.REF"ESH

~

0

285 .. 2

r

2

.
..

··.""
. ·
"

.Ob""
e"

•

.OB

7

•

A

:

""
"

Ib

OIR

r'

XAI
XA2
XA4
XAS
XA6
XA7
XA8

(SH.l,10,13,14,15)
(SH.l,10,13,14,16)
(SH.3,10,13,14)
(SH.l,10,13,17)
(SH,lO,12,13)
(SH.l0,12,13)
(SH.l0,12,13)
(SH.l0,12.13)

GRZ

(SH.8,14)

XIIIO

(SHf"

XA~

B :~

,
,
19

(SH.3)

""

..,, .. . " ··"
,.
'"
2

GATE ALE

AL5Z't.,

:

glR

(SH.6)

"'"

Type 2 512KB Planar (Sheet 5 of 21)

(SH.l0,12.13)

JAil
XAI2
XAI'l

XAI~
~A'b

(SH.l0,13)
(SH.l0,13,14)

.....

...
C'I

r; ..
0
CD

Q

~I

Q)
Q)

.c

-...
en

........................ c:w

as
s:::::
as

........................ 01..:0

c::

m

~
C'I

.....

It)

C'I
Q)

C.

>-

-I

I

.,'"

~I
~

1

1

I

I

I

1

1
1
1
1
1
1

1

I
I

1
1

,

L

_ _ _ _ _ _ _ ...J

=2

~~~

~~~~~m

.

~~~~~~~~ e

HtJ,

N

~

N

~

LfiLfi.,

~-~ "-

iii
121212

N

i-i
12
12

"-

~

N

I-

,---:;; ----,

, - - ..1-

"

!:l! '!'-

I:;:'~

,I
,I
L~.

I

'"

~,

~~

~

1il~

.
"-

~~

r::-NNN;:~!25;1il;

~

~~~~~~~~~~~

System Board

1-103

....

I••

~

<=

""

en.

..

··f~."

I

(SH.5)
fSH.2)

-LMEG CS
-!'lEMA

(SH.2)

-"E""

G~!

:TF~'

A2

'<

.u..""

,

"III

."
,.n

I.

yzl1

1

Rlif'

U"9

~~

EI

i=-=

9

FOD

,;JU't6

8

+RAS

1

TItlE

II

DELAY

U.'

PE21211
"0 80

I2L '

120160

I• •
I

200
8

-SMEttR
-SMEI1W

....

I

I USI

2

I
2 U"i"
~

(SH. 5)

+RAH 0 RAS

ALSI"

(SH.14)

lAO

,

USI

F.8
1

~

"i

FlO

~

UIj'l

ISH. 8)

II

FlO

•

-HAS 0

(SH.SI

-CASOl

(SH.S)

-CASOH

{SH.81

.N2
.. lOOn

I

•
,9 U"il
II

'N2

8

- XBHE

r1DD,:l

I

FlO

I'll U"iB

(SH. 2)

AODR SEL
+CAS

U"iB

(SH.5) '-RApt 0(A5

ISH.S)

I

!
~

ALSO"

(SH-19)
(51:1.19)

8

!

1 10'11&1

L

_..1

-UD

+ RAM SEL

Type 2 512-KB Planar (Sheet 7 of 21)

(SH.9)
(SH. 9)

,..

-...
N

o

co

Q)
Q)

or:

-...
tJ)

co
c
co

c::

m
~

N
,..
It)

-

N

I

Q)

Q.

~

~~::~~~~'!'~I"
LI':!'"

~

..0_"-0;;>

!C

~R

xi-xi
~

~!!!

System Board

1-105

"""I

,

=
="

,~.

oscl rz

171tl

esc

(SH.191

1.19 MHZ

(SH. 15)

"""

00

~
....
~

CLKi-!- Ne

{SH.l}

flC

(SH.3)

PULL Uf'

51
t=

=

+-__~'.~"'~'~

'~LKCL'

'00

(SH.S)

FleD

1<;

.. A

~

d-

PClf(' l

(SH.S)

HDO
HOI

H.,

H.'
H••

HO'

(SH.S)

H••
H.,

H.'
H
••
"'"
HO"

HO"
MOil
(SH.S)

(SH.7)
(SH.7)
(SH.2)

HO"

H.,

-lAO

+R""'SEl

-.....

10K

~::~J
""r------'~""E
,,
'
I

~

+-__-":I":=::h~6

(SH.B)

(SH.S)

~ ,.

RN"-'i

+';

~

U~
FlBD

~"

----If~
~'"
~~

,'
I

~-

(SH.B)

"]"r----------t-'

"E

UI2

~~==~~~~~~h--"I
II

I

us">

8

11

;,~
mQP'~-,,_ __
(l~86 :r"I.!.._-+T___

12 0
II

(LR

"

(SH.14)

(SH,1S)

I

(SH.S)

'i~O:b

Type 2 512KB Planar (Sheet 9 of 21)

(SH.3)
(SH.1S)

i;;;:S!!:;:ii~ttii:lt~i~~;:,!!;;8i5~S~~;!l~ ~:
go-

...

II'

lC~-

-_

~_:f!!::

~

-....
~

'0
o
....

i

.c

-.
en
cu
cu

c

a::

m

~
~

....
II)

111

~

CD

Do

~

•"
"

" "~

~

, ~"

System Board

1-107

~

(SH.3)

-PROCCll(

(SH.3)

...,..,..

I

~

=
QC

ISH. 20)

\1.1
'<

;-

e

=
a.
=>

(SH.l)
(SH.19)

-5YS(LK

PUU UP

(SH.4)

AU ALE

(SH.l)

+RESET

(SH.S)

-ENDm

(SH.S)

ARDY

(SH.l)

QLf

(SH.S)

+IOCMRDY'

(SH.3)

(SH.21)

(SH.s,17)

- ....T

oW>

RES/flWS

(SH.6)

AROVEN

(SH.1)

CONVAO

ISH. 4)

CONVALE

(SH.4)

(NTlOFF

(SH.2)

DATA (ON'

-RESET

(SH.3)

-fFCS

Type 2 512KB Planar (Sheet 11 of 21)

(SH.6)

O1R 2"1j:

(SH.. 2)

5DO
5D'
5DZ
5D'

====
-

(SH.2)

SDO
SD7

(SH.6)

GATE 2'l1j

----i

...

-===:::

5D'I

(SH.2)

1

(SH.2)

SDO

SDIO
SDIl
SD~

51>'
SD"

.,..

'DO

~

1 ...

ALS2ltlj:

,

===:

•

,

•••

,
,

1

~

~

A
A
A
A
A
A
A

•
R'•

===

,

=
i
"""
"""
=
\C

-"PCS

-INT'"

ISH. 5)
(SH.5)
(SH.5)

,
....
,.,

-'lOR

.

u,o.

,"

AlS21t'i

5.0

~UIlc0--11

..

I

ALSO ..

• UB'

~

•

U8't

12

4·'
121

""
"IZ

8

,.
~
9

: :'i

'

'
••

'.0

(813., ..

...

(SH.13,l4,15,16,17)
(SH.3,13,14,lS,l6.1n

'0'
,.z
,.,
'0'
,.,

B:tt

,A

:'""

'01

,5., ••171

riglR Uill

-ACK

2 ALS2l

f---!kJ

·•...•
• A

1,,"LS08

(SH.·2)

SDn
SOltt
SLlI'i

: lit

SI!.J

••

......

"
:'"'

===:::

507

ISH. 5)
(SH.5)
(SH.14)
(SH.3)



ROO

'"
29
"27

00
DI
D2
01

" "'

Z2
I

17

"'''
RI ..

-DHA"""
-XMEHW

-Dt1A2CS
H
1

"

I

~oUy.,
EOP

...

Dr;

g~

OREG2

11

OREal

~

!ET

I~ ~
, 'l'
"CO,

~g

...18'
AEN'I

"., ~
'"



"" ""
""
I1fI'

~

I~S08
Z

LstlZ

1)110

,

00

.

.

"'"
,,.,

~g~
~g~

D7

:=::ii :::.
f.-----l.l "

i-------'"

.,

(SH.12)

'"
""
'"

~
,

f:'...

-"

(SH.13)- DHA HEttI:
(SH.3)
PULL"
(SH.3)
0I1A (LI

."
OS,
,"
I

.

,

'i

'ir. l51Z'i
'iUJq to

r

1'1
l'i
Ito
17

R5Z

Zl

l:"

"'"

~

:J:~:;:

I

~

I

-RESET

=
a.

(SH.5)
(SH,2)

e

......

I~

'"'
g
L==:I 0 UII'I

HRQI

do

(SHt)
(8H.4)
(8H.4)

'"'

-lOW
-lOR

-lIE'"
-",""

SA'

(SH.19) +IOCHRO't

~
%"

.
A

:

US'I

I

"
~F=T

XBIE

,

,

~

Q

Q!';

f:' T'," J~

~
-IJoIAAEN

~3if.
-to;

00

U'J'I

to

(SH.2.6l
(SH.2.3.6,7.13,15.17)

LHRQ I (SH.20)

SDCLk (SH.2t)

UIZI

9 1

:18

'I

1

(SH.l)

I

"

1 A
8 n
'i~I'j

(SH.l)

1M

I

~'es,,,

00

l
a

.,

RN'i-Io;

If
(SH.t)
(SH.13)

(SH.5)

.,

:~:09E

r

.Alto

'"
'"""
'"
'"
'"

1'1

U.'

leo RSO

(SH.5)
(SH.5)
(SH.5)

h

HOO
HOI
HOZ
HOl

,"
"
"", """
""

.,

IOCLRQ'J
UIO'J

IJCLI~8

~

~
'U"'i
'i ALSOZ
;:) IJCII ~

-XICW (SH.l,3,13.15,16.17)
-11M (SH.l,12.13.15,18,17)
-xt£HW (SH.13,21)
-XI'EHR(SH.6,9.10)

+DI'IA ROV (SH. 13)

b

I

Type 2 512KB Planar (Sheet 14 of 21)
L NOIl~HS

I"'"

(SH.1S)

S.. dDATA-----------------------~

I

I"'"
I"'"

W

~
~

m

=

e

~.

Q.

el'j9A
(SH.1!!)
(SH.tS)

(SH.t9)

f

(SH.tS)
(SH.t:!!)

(SH.t2)

I

(SH.t2)

(SH.14)
(SH.14J

(SH.14)
(SH.:!)

ISH.51

(SH.17)

(SH.t9)
(SH.tS)
(SH.t8)
. (SH.tS)

(SH.S)
(SH.tS)
(SH.ts)
(SH.t2)

OPT aUF

18'IRO

=.~ --------uii1

...,,.,,
,-

U...

~IRI

-

INTI-ll

~::~

'"
'"
ll:J ::;

Il107

-MltleS

.::!1M

xx.,••
x.,
xXOl
m,...

.,

~

~
ill

RN'j-l

SP/EN II>

"'t!-".,

AO

"INTA
DO

iOl

GN°h

.,
.,.,."

91 01

..

XI"
XII7

-1I0R

-"""
".

CASO~
CASt 11

.7

-INTI.

(SH.20)

(HASTER)C"52

""

,
':il(

IRIIIO
IRQII

....,,
....

(SH.9)

m

GNO'"

.,

,

~
~ ~
0

,

'"

"

...
-lNnrzcs

r'
t::::::::tt"~"IIO
2:~~ ~ g~H. n ==tljt=====
= _

Tiff 2~TE·5PI(

J

1.19tfHZ

I

I
~:1

.

.

I

(SLA'"

---r-- IIr
.

I~:;
XDI

. r.·",~.

t====If

-T/ces

eLK 0

II

Dl

If

If

g~

X[)6

2

'n
Db
I

(SH.tll)

T!F

Uo;Z

!{C

-

'co

lY~

Ilun

........

~

(SH.tB)

(SH.t)

,

..'"

----.--Jes:

..=!.l.Ql!.

IN'

21

-

1

01

"

Type 2 512KB Planar (Sheet 15 of 21)

-:-

(SH.t5)

(SH.te)

W)~;::§'

~~~~

~

;~e. '::~I:I-

I
I

r::::.-

~ ~

r-

-....

-

~H'
f------<,;:-"

C'I

o

E~

CD

....
....CD

~

CD

.s::

-..
en

~L
JJJJ
~;;:::i'~

ftI
C
ftI

.
~

a:

~

3

m

_N

.d

I----

JJ ~li

"~~~~

i:~£~

~

~

~~

~

~

J
~

~
C'I

....

~a
~

It)

C'I

CD
C.

3

i

~~I~~~~
~;e"'lC

~

. .

1~1~t:l5l

852!l::\
~!!'

g~8S

----

~

.I~ .e .~

~"

~~~:

aiieHHii

~~~W)

!' ~;

ii:I:i

@.f!1.~i8.

i

~

'"
~

~

~

~

'~"

Oii?§'~

'~"

iiii
!2!2!!He

System Board

1-113

~

"'"

""'"

~~~
III

@..@..@..

.
e

l
-,..

N

o

~

.....
,..

....

5 ~~

~H'

G)
G)

.c

~

...IV

c:
IV
ii:
r:D

~

N
,..

It)

N
G)

C.

~

~i3'~~~

~~~~~

1-114

System Board

+s

Jf6
*JR

0+1j

~on ~ ~~n

,)11

:n

D+'i

t ~~n

Jill
(SH.2)

I

(SH.2l

(SH.4)

I

(SH.4)
(SH.2)
(SH.2)

SOl

se'
SOl!

SOl
SOl<

501"

SOl'
SIH'

LAlI
LAlO

SO""

-I1EMR
-MEMW

-DAekO

I

-OACK'5
-DACK6

(SH.13)

-""""

JIO

.•~~~~~~~~~~~~~~::~~;;~~~(I!'r-"fIli.O;;::;"'
(I.'"

lA21
tAU

(SH.13)

(O,"EOO'

(12

en

0& PIN)

I""'

002

m

-HEM

CS 16

(SH. 4.12.' 3)
(SH.5)

-

cs

(SH.6)

10

Ib

m

CIS

009
011

(02

"((j"j

DRQO
DRG c;
ORO 6
ORG 1

(SH.13)
(SH.13)
(SH.13)
(SH.13)

DOlt
00')
006

JAQID
IRQ II

(SH.15)

007

IRGIe;

DI~

(oif
~

Ole;

CIO

ill
coo

001

IRQI2
IRQI4

t

(SH.15)

D08

rna
QL.

0,"

~+s

(SH.4)
(SH.4)
(SH.4)

fa

=

l

......
...u.

LAt9

~

( 06

n

1

m

110 (ONNE(TOR FROM
SOARD TOP SlOE:

I

801~.

AOI

JI (8 CONN. TOTALl

*FOR FUTURE USE

81t •• All

OOln(OI
DlSUCI8

I

Type 2 51 2KB Planar (Sheet 18 of 21)
l NOll::J3S

....
....
....
I

~

(SH.2)

I

(SH.2)

!f

;.

(SH.4)

500
501
S02
SO,
SO,
SO,
506
507
SAO
SAl
SAl

SA'
5,"

e

5. .
SA.
SA7
SAO
SA.
SA'O
SAil
SAIZ

=:I

a
Q

SAH
SAIIt

5AI5
5... 16
SAI1
(SH:4)
(SH.2)
(SH.2)
(SH.7)
(SH.7)
(SH.3)
(SH.9)
(SH.13)
(SH.3)
(SH.3)

SAI8
SAIQ

-lOR
-lOW

AO'
AOO
A 7
A
AO'
AO'
AO'
A02

AEN

(SH.20)
(SH.13)
(SH.13)
(SH.13)

-REFRESH
-DA(I( I
-DACK 2

(SH.3)
(SH.21)

OAlE
0"

-DAtI( '3

J'

A..

J.

+,
A"

't.7K

IKD

J'f-

J8 Aoci

A

Al7
A •
A2S
A
A"
All

'0'

."
."
."
."

AI.
A 10
AI7

AIS
AI4
AI>
AI>

.,.
BlO
'0.

• 14

m

+12
12

."

Bl6
.06

10"J
(X22)
6O.

I

60'

~

I

1)

(SH.1S)

IRQIf
IRQ ')
IRQ6
IRQ 7

(SH.1S)

+,

1,o41"'

c••

CIOO

l'lOPF

I'SOPF

(X'32)

I

I

Type 2 512KB Planar (Sheet 19 of 21)

U

ClOI

(SH.13)
(SH.13)
(SH.13)

+PWRGOOD

(SH.l,17)

2

POWER
~N.
POWER GOOD

1

+S voe

I<)()PF

~,~ ~~~

l.~
~
I r='

_, 4ro
Rf-
PSO

~

G

BOI
81O

."

IRQ

ORQ2

BO'
'0'

81'

(SH.3)
(SH.l1,14,20)

DRQ I

r

.,..,.

-I/O CH (I(
JIO CH ROY

IRQ 1

821

AI.

SYS( l K

osc

~,

A

BlO
B'
B27
All
B02

RESET DRY

+,

J'

,

BI
BII

, Ie

J2

A1I

-s MEHR

-s HEMW

JI

~

~

~

~

~

[

•
~

-.,..

-..
C'i

o

oC'i

CD
CD

-...
.i:

en
ca
c
ca

a::

In
~

C'i
.,..
It)

C'i

CD

c.

r:

~

"
~

~

~

u
u

~

"~

~

"~

~O>
~'!1

"~

~

System Board

~

1-117

~

-I
~

~~~

5

v

v
~

.
'--~

-I,.

~

C\I

o

,..

~

5

u

,..

a

C\I

....CD
CD

.c

-...
en
IV

c::

IV

a::

m
~

C\I
,..
It)

C\I

CD

Q.

~
~

.

,
~

~

•
"

~
~

«

•
"

1-118

.

~.

.0 •

~~

---

:iii
!1!£.!a-

."
:e

System Board

~~ ~
~M'"

ii:i
@.!Q.!1

!~

~

."" ."
~

SECTION 2. COPROCESSOR

Contents
Description ...................................... 2-3
Programming Interface

............................• 2-3

Hardware Interface ................................ 2-4

Coprocessor

2-1

Notes:

2-2

Coprocessor

Description
The IBM Personal Computer AT Math Coprocessor enables the
IBM Personal Computer AT to perform high-speed arithmetic,
logarithmic functions, and trigonometric operations.
The coprocessor works in parallel with the microprocessor. The
parallel operation decreases operating time by allowing the
coprocessor to do mathematical calculations while the
microprocessor continues to do other functions.
The coprocessor works with seven numeric data types, which are
divided into the following three classes:
•

Binary integers (3 types)

•

Decimal integers (1 type)

•

Real numbers (3 types)

Programming Interface
The coprocessor offers extended data types, registers, and
instructions to the microprocessor.
The coprocessor has eight 80-bit registers, which provides the
equivalent capacity of forty 16-bit registers. This register space
allows constants and temporary results to be held in registers
during calculations, thus reducing memory access and improving
speed as well as bus availability. The register space can be used as
a stack or as a fixed register set. When used as a stack, only the
top two stack elements are operated on.

Coprocessor

2-3

The following figure shows representations of large and small
numbers in each data type.
Significant
Digits
Bits (Decimal) Approximate Range (Decimal)

Data Type
Word Integer

16

4

Short Integer

32

9

Long Integer

64

19

Packed Decimal

80

18

32

6-7

64
80

Short Real
Long Real

*
*

Temporary Real

-32,768 :5 x :5 +32,767
-2x10 9
-9x10 18

:5 x :5 +2x 10 9
:5 x:5 +9x1018

-9 .. 99 :5 x :5 +9 .. 99 (18 digits)
8. 43x 10- 37

:5 x :5 3. 37x 10 38

15-16

4. 19x 10- 307

:5 x :5 1.67xl0 308

19

3. 4x 10-4932

:5 x :5 1. 2x 10 4932

Data Types

* The Short Real and Long Real data types correspond to the
single and double precision data types.

Hardware Interface
The coprocessor uses the same clock generator as the
microprocessor. It works at one-third the frequency of the system
microprocessor (2.66 MHz). The coprocessor is wired so that it
functions as an I/O device through I/O port addresses hex OOF8,
OOFA, and OOFC. The microprocessor sends OP codes and
operands through these I/O ports. The microprocessor also
receives and stores results through the same I/O ports. The
coprocessor's I busy I signal informs the microprocessor that it is
executing; the microprocessor's Wait instruction forces the
microprocessor to wait until the coprocessor is finished executing.
The coprocessor detects six different exception conditions that
can occur during instruction execution. If the appropriate
exception mask within the coprocessor is not set, the coprocessor
sets its error signal. This error signal generates a hardware
interrupt (interrupt 13) and causes the I busy I signal to the
coprocessor to be held in the busy state. The I busy I signal may

2-4

Coprocessor

be cleared by an 8-bit I/O Write command to address hex FO
with DO through D7 equal to O.
The power-on self-test code in the system ROM enables IRQ 13
and sets up its vector to point to a routine in ROM. The ROM
routine clears the I busy I signal's latch and then transfers control
to the address pointed to by the NMI interrupt vector. This
allows code written for any IBM Personal Computer to work on
an IBM Personal Computer AT. The NMI interrupt handler
should read the coprocessor's status to determine if the NMI was
caused by the coprocessor. If the interrupt was not generated by
the coprocessor, control should be passed to the original NMI
interrupt handler.
The coprocessor has two operating modes similar to the two
modes of the microprocessor. When reset by a power-on reset,
system reset, or an I/O write operation to port hex OOF 1, the
coprocessor is in the real address mode. This mode is compatible
with the 8087 Math Coprocessor used in other IBM Personal
Computers. The coprocessor can be placed in the protected mode
by executing the SETPM ESC instruction. It can be placed back
in the real mode by an I/O write operation to port hex 00F1, with
D7 through DO equal to O.
The coprocessor instruction extensions to the microprocessor can
be found in Section 6 of this manual.
Detailed information for the internal functions of the Intel 80287
Coprocessor can be found in books listed in the bibliography.

Coprocessor

2-5

Notes:

2-6

Coprocessor

SECTION 3. POWER SUPPLY

Contents
Inputs .......................................... 3-3
Outputs ......................................... 3-4

DC Output Protection ...........•...•.............. 3-4
Output Voltage Sequencing .....•.........•.......... 3-4
No-Load Operation .......•...•.................... 3-5
Power-Good Signal .......................•........ 3-5
Load Resistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 3-5
Connectors ...................................... 3-7

Power Supply

3-1

Notes:

3-2

Power Supply

The system power supply is contained inside of the system unit
and provides power for the system board, the adapters, the
diskette drives, the fixed disk drives, the keyboard, and the IBM
Monochrome Display.

Inputs
The power supply can operate at a frequency of either 60 ±3 Hz
or 50 ±3 Hz and it can operate at 110 Vac, 5 A or 220/240 Vac,
2.5 A. The voltage is selected with the switch above the
power-cord plug at the rear of the power supply. The following
figure shows the input requirements.
Range

Voltage (Vac)

Current (Amperes)

Minimum 100
115 Vac

Maximum 5
Maximum 125

230 Vac

Minimum 200

Maximum 3.0

Maximum 240

Input Requirements

Note:

The maximum in-rush current is 100 A.

Power Supply

3-3

Outputs
The power supply provides +5, -5, + 12, and -12 Vdc. The
following figQ.re shows the load current and regulation tolerance
for these voltages. The power supply also supplies either 115 Vac
or 230 Vac for the IBM Monochrome Display.
Nominal
OU,tput

Load Current (A)
Min
Max

Regulation
Tolerance

+5
-5
+12
-12

7.0
0.0
2.5
0.0

+5% to -4%
+10% to -8%
+5% to -4%
+10% to -9%

Vdc
Vdc
Vdc
Vdc

19.8
0.3
7.3
Q.3

DC Load Requirements

DC Output Protection
If any output becomes overloaded, the power supply will switch
btf within 20 milliseconds. An overcurrent condition will not

damage the power supply.

Output Voltage Sequencing
Under normal conditions, the output voltage levels track within
300 milliseconds of ~ach other when power is applied to, or
remowd from the power supply, provided at least minimqrn.
loading is present.
.

3-4

Power Supply

No-Load Operation
No damage or hazardous conditions occur when primary power is
applied with no load on any output level. In such cases, the
power supply may switch off, and a power-on reset will be
required. The power supply requires a minimum load for proper
operation.

Power-Good Signal
The power supply provides a I power-good I signal to indicate
proper operation of the power supply.
When the supply is switched off for a minimum of one second and
then switched on, the I power-good I signal is generated, assuming
there are no problems. This signal is a logical AND of the dc
output-voltage sense signal and the ac input-voltage sense signal.
The I power-good I signal is also a TTL-compatible high level for
normal operation, or a low level for fault conditions. The ac fail
signal causes I power-good I to go to a low level at least one
millisecond before any output voltage falls below the regulation
limits. The operating point used as a reference for measuring the
one millisecond is normal operation at minimum line voltage and
maximum load.

Load Resistor
If no fixed disk drive is connected to the power supply, the load

resistor must be connected to PI O. The load resistor is a 5 ohm,
50 watt resistor.

Power Supply

3-5

The dc output-voltage sense signal holds the power-good signal
at a low level when power is switched on until all output voltages
have reached their minimum sense levels. The power-good
signal has a turn-on delay of at least 100 milliseconds but not
longer than 500 milliseconds and can drive six standard TTL
loads.
I

I

I

The following figure shows the minimum sense levels for the
output voltages.
Level

(Vdc)

Minimum (Vdc)

+5
-5
+12
-12
Sense Level

3-6

Power Supply

+4.5
-3.75
+10.8
-10.4

I

Connectors
The following figure shows the pin assignments for the
power-supply output connectors.
Load Point

Voltage (Vdc)

PSB-l
PSB-2
PSB-3
PSB-4
PSB-5
psB-6

Power Good
+5
+12
-12
Ground
Ground

Max.
Current (A)
See Note

3.B

0.7
0.3
0.0
0.0

PS9-1
PS9-2
PS9-3
PS9-4
PS9-5
PS9-6

Ground
Ground
-5
+5
+5
+5

0.0
0.0
0.3

Pl0-l
Pl0-2
Pl0-3
Pl0-4

+12
Ground
Ground
+5

0.0
0.0

P11-1
P11-2
PII-3
PII-4

+12
Ground
Ground
+5

0.0
0.0

P12-1
P12-2
P12-3
P12-4

+12
Ground
Ground
+5

1.0
0.0
0.0
0.6

3.B
3.B
3.B
2.B
I.B

2.B
I.B

DC Load Distribution

Note:

For more details, see "Power-Good Signal".

Power Supply

3-7

Notes:

3-8

Power Supply

SECTION 4. KEYBOARD

Contents
Description ...................................
Cabling ...................................
Sequencing Key Code Scanning .................
Keyboard Buffer ............................
Keys ..................... " ...............

4-3
4-3
4-3
4-3
4-4

Power-On Routine ......•......................... 4-4
Power-On Reset ............................ 4-4
Basic Assurance Test ......................... 4-4
Commands from the System ..........................
Reset (Hex FF) .... ; ........................
Resend (Hex FE) ............................
No-Operation (NaP) (Hex FD through F7) .......
Set Default (Hex F6) .........................
Default Disable (Hex F5) .....................
Enable (Hex F4) ............................
Set Typematic Rate/Delay (Hex F3) ............
No-Operation (NaP) (Hex F2 through EF) .......
Echo (Hex EE) ........... ;.................
Set/Reset Mode Indicators (Hex ED) ............

4-5
4-5
4-6
4-6
4-6
4-6
4-6
4-7
4-8
4-8
4-8

Commands to the System ............................ 4-9
Resend (Hex FE) ............................ 4-9
ACK (Hex FA) ........ ; .................... 4-9
Overrun (Hex 00) .......................... 4-10
Diagnostic Failure (Hex FD) .................. 4-10
Break Code Prefix (Hex FO) .................. 4-10
BAT Completion Code (Hex AA) .............. 4-10
ECHO Response (Hex EE) ................... 4-10
Keyboard Scan-Code Outputs ....................... 4-11

Keyboard

4-1

Clock and Data Signals ...................•........ 4-12
Keyboard Data Output ...................... 4-13
Keyboard Data Input ........................ 4-13
Keyboard Layouts .............•..................
FrenchKeyboard ...........................
German Keyboard ..........................
Italian Keyboard ...........................
Spanish Keyboard ..........................
u.K. English Keyboard ......................
U.S. English Keyboard .......................

4-15
4-16
4-17
4-18
4-19
4-20
4-21

Specifications ................................... 4-22
Size ..................................... 4-22
Weight ................................... 4-22
Logic Diagram

4-2

Keyboard

4-23

Description
The keyboard is a low-profile, 84-key, detachable unit. A
bidirectional serial interface in the keyboard is used to carry
signals between the keyboard and system unit.

Cabling
The keyboard cable connects to the system board through a 5-pin
DIN connector. The following figure lists the connector pins and
their signals.
DIN Connector Pins

Signal Name

1

+KBD ClK
+KBD DATA
Reserved
Ground
+5.0 Vdc

2

3

4
5

Sequencing Key Code Scanning
The keyboard is able to detect all keys that are pressed, and their
scan codes will be sent to the interface in correct sequence,
regardless of the number of keys held down. Keystrokes entered
while the interface is inhibited (when the key lock is on) will be
lost. Keystrokes are stored only when the keyboard is not
serviced by the system.

Keyboard Buffer
The keyboard has a 16-character first-in-first-out (FIFO) buffer
where data is stored until the interface is ready to receive it.
A buffer-overrun condition will occur if more than sixteen codes
are placed in the buffer before the first keyed data is sent. The
seventeenth code will be replaced with the overrun code, hex 00.
(The 17th position is reserved for overrun codes). If more keys
are pressed before the system allows a keyboard output, the data
will be lost. When the keyboard is allowed to send data, the

Keyboard

4-3

characters iIi the buffer will be sent as in normal operation, and
new data entered will be detected and sent.

Keys
All keys are classified as make/break, which means when a key is
pressed, the keyboard sends a make code for that key to the
keyboard controller.. When the key is released, its break code is
sent (the break code for a key is its make code preceded by hex
FO).

All keys are typematic. When a key is pressed and held down, the
keyboard continues to send the make code for that key until the
key is released. The rate at which the make code is sent is known
as the typematic rate (The typematic rate is described under "Set
Typematic Rate/Delay"). When two or more keys are held
down, only the last key pressed repeats at the typematic rate.
Typematic operation stops when the last key pressed is released,
even if other keys are still held down. When a key is pressed and
held down while the interface is inhibited, only the first make
code is stored in the buffer. This prevents buffer overflow as a
result of typematic action.

Power-On Routine
Power-On Reset
The keyboard logic generates a POR when power is applied to the
keyboard. The POR lasts a minimum of 300 milliseconds and a
maxImum of 9 secorids.
Note: The keyboard may issue a false return during the first
200 milliseconds after the +5 Vdc is established at the 90%
level. Therefore, the keyboard interface is disabled for this
period.

4-4

Keyboard

Basic Assurance Test
Immediately following the POR, the keyboard executes a basic
assurance test (BAT). This test consists of a checksum of all
read-only memory (ROM), and a stuck-bit and addressing test of
all random-access memory (RAM) in the keyboard's
microprocessor. The mode indicators-three light emitting diodes
(LEDs) on the upper right-hand corner of the keyboard-are
turned on then off, and must be observed to ensure they are
operational.
Execution of the BAT will take from 600 to 900 milliseconds.
(This is in addition to the time required for the POR.)
The BAT can also be started by a Reset command.
After the BAT, and when the interface is enabled ( I clock I and
data lines are set high), the keyboard sends a completion code
to the interface-either hex AA for satisfactory completion or
hex FC (or any other code) for a failure. If the system issues a
Resend command, the keyboard sends the BAT completion code
again. Otherwise, the keyboard sets the keys to typematic and
make/break.
I

I

Commands from the System
The commands described below may be sent to the keyboard at
any time. The keyboard will respond within 20 milliseconds.
Note: The following commands are those sent by the
system. They have a different meaning when issued by the
keyboard.

Reset (Hex FF)
The system issues a Reset command to start a program reset and a
keyboard internal self-test. The keyboard acknowledges the
command with an I acknowledge I signal (ACK) and ensures the

Keyboard

4-5

system accepts the ACK before executing the command. The
system signals acceptance of the ACK by raising the clock and
data for a minimum of 500 microseconds. The keyboard is
disabled from the time it receives the Reset command until the
ACK is accepted or until another command overrides the previous
one. Following acceptance of the ACK, the keyboard begins the
reset operation, which is similar to a power-on reset. The
keyboard clears the output buffer and sets up default values for
typematic and delay rates.

Resend (Hex FE)
The system can send this command when it detects an error in
any transmission from the keyboard. It can be sent only after a
keyboard transmission and before the system enables the
interface to allow the next keyboard output. Upon receipt of
Resend, the keyboard sends the previous output again unless the
previous output was Resend. In this case, the keyboard will
resend the last byte before the Resend command.

No-Operation (NOP) (Hex FD through F7)
These commands are reserved and are effectively no-operation or
NOP. The system does not use these codes. If sent, the keyboard
will acknowledge the command and continue in its prior scanning
state. No other operation will occur.

Set Default (Hex F6)
The Set Default command resets all conditions to the power-on
default state. The keyboard responds with ACK, clears its output
buffer, sets default conditions, and continues scanning (only if the
keyboard was previously enabled).

Default Disable (Hex F5)
This command is similar to Set Default, except the keyboard stops
scanning and awaits further instructions.

4-6

Keyboard

Enable (Hex F4)
Upon receipt of this command, the keyboard responds with ACK,
clears its output buffer, and starts scanning.

Set Typematic Rate/Delay (Hex F3)
The system issues this command, followed by a parameter, to
change the typematic rate and delay. The typematic rate and
delay parameters are determined by the value of the byte
following the command. Bits 6 and 5 serve as the delay
parameter and bits 4,3,2, 1, and 0 (the least-significant bit) are
the rate parameter. Bit 7, the most-significant bit, is always O.
The delay is equal to 1 plus the binary value of bits 6 and 5
multiplied by 250 milliseconds ±20%. The period (interval from
one typematic output to the next) is determined by the following
equation:
Period = (8 + A) X (2B ) X 0.00417 seconds, where A = binary
value of bits 2, 1, and 0 and B = binary value of bits 4 and 3.
The typematic rate (make code per second) is l/period. The
period is determined by the first equation above. The following
table results.
Bit 4 - 0

Typematic
Rate ± 20%

Bit 4 - 0

Typematic
Rate ± 20%

00000
00001
00010
00011
00100
00101
00110
00111
01000
01001
01010
01011
01100
01101
01110
01111

30.0
26.7
24.0
21.8
20.0
18.5
17.1
16.0
15.0
13.3
12.0
10.9
10.0
9.2
8.0
8.0

10000
10001
10010
10011
10100
10101
10110
10111
11000
11001
11010
11011
11100
11101
11110
11111

7.5
6.7
6.0
5.5
5.0
4.6
4.3
4.0
3.7
3.3
3.0
2.7
2.5
2.3
2.1
2.0

Keyboard

4-7

The keyboard responds to the Set Typematic Rate Delay
command with an ACK, stops scanning, and waits for the rate
parameter. The keyboard responds to the rate parameter with
another ACK, sets the rate and delay, and continues scanning (if
the keyboard was previously enabled). If a command is received
instead of the rate parameter, the set-typematic-rate function
ends with no change to the existing rate, and the new command is
processed. However, the keyboard will not resume scanning
unless instructed to do so by an Enable command.
The default rate for the system keyboard is as follows:
The typematic rate = 10 characters per second ± 20% and the
delay = 500 ms ±20%.

No-Operation (NOP) (Hex F2 through EF)
These commands are reserved and are effectively no-operation
(NOP). The system does not use these codes. If sent, the
keyboard acknowledges the command and continues in its prior
scanning state. No other operation will occur.

Echo (Hex EE)
Echo is a diagnostic aide. When the keyboard receives this
command, it issues a hex EE response and continues scanning if
the keyboard was previously enabled.

Set/Reset Mode Indicators (Hex ED)
Three mode indicators on the keyboard are accessible to the
system. The keyboard activates or deactivates these indicators
when it receives a valid command from the system. They can be
activated or deactivated in any combination.
The system remembers the previous state of an indicator so that
its setting does not change when a command sequence is issued to
change the state of another indicator.

4-8

Keyboard

A Set/Reset Mode Indicators command consists of two bytes.
The first is the command byte and has the following bit setup:
11101101 - hex ED
The second byte is an option byte. It has a list of the indicators to
be acted upon. The bit assignments for this option byte are as
follows:
Bit
0
I

2

3-7

Indicator
Scroll Lock Indicator
Num Lock Indicator
Caps Lock Indicator
Reserved (must be O's)

Note: Bit 7 is the most-significant bit; bit 0 is the
least-significant.
The keyboard will respond to the Set/Reset Mode Indicators
command with an ACK, discontinue scanning, and wait for the
option byte. The keyboard will respond to the option byte with
an ACK, set the indicators, and continue scanning if the keyboard
was previously enabled. If another command is received iIi place
of the option byte, execution of the function of the Set/Reset
Mode Indicators command is stopped with no change to the
indicator states, and the new command is processed. Then
scanning is resumed.

Commands to the System
The commands described here are those sent by the keyboard.
They have a different meaning when issued by the system.

Resend (Hex FE)
The keyboard issues a Resend command following receipt of an
invalid input, or any input with incorrect parity. If the system
sends nothing to the keyboard, no response is required.

Keyboard

4-9

ACK(HexFA)
The keyboard issues an ACK response to any valid input other
than an Echo or Resend command. If the keyboard is interrupted
while sending ACK, it will discard ACK and accept and respond
to the new command.

Overrun (Hex 00)
An overrun character is placed in position 17 of the keyboard
buffer, overlaying the last code if the buffer becomes full. The
code is sent to the system as an overrun when it reaches the top of
the buffer.

Diagnostic Failure (Hex FD)
The keyboard periodically tests the sense amplifier and sends a
diagnostic failure code if it detects any problems. If a failure
occurs during BAT, the keyboard stops scanning and waits for a
system command or power-down to restart. If a failure is
reported after scanning is enabled, scanning continues.

Break Code Prefix (Hex FO)
This code is sent as the first byte of a 2-byte sequence to indicate
the release of a key.

BAT Completion Code (Hex AA)
Following satisfactory completion of the BAT, the keyboard
sends hex AA. Hex FC (or any other code) means the keyboard
microprocessor check failed.

ECHO Response (Hex EE)
This is sent in response to an Echo command from the system.

4-10

Keyboard

Keyboard Scan-Code Outputs
Each key is assigned a unique 8-bit, make scan code, which is sent
when the key is pressed. Each key also sends a break code when
the key is released. The break code consists of two bytes, the
first of which is the break code prefix, hex FO; the second byte is
the same as the make scan code for that key.
The typematic scan code for a key is the same as the key's make
code. Refer to "Keyboard Layouts" beginning on page 4-15 to
determine the character associated with each key number.
The following figure lists the positions of the keys and their make
scan codes.
Key
Number

Make Code

Key
Number

Make Code

Key
Number

Make Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
30

OE
16
lE
26
25
2E
36
30
3E
46
45
4E
55
50
66
00
15
10
24
20
2C
35
3C
43
44
40
54
5B
14

31
32
33
34
35
36
37
38
39
40
41
43
44
46
47
48
49
50
51
52
53
54
55
57
58
61
64
65
66

1C
lB
23
2B
34
33
3B
42
4B
4c
52
5A
12
lA
22
21
2A
32
31
3A
3C
49
4A
59
11
29
58
06
OC

67
68
69
70
71

OB
OA
09
05
04
03
83
01
76
6C
6B
69

72

73
74
90
91
92
93
95
96
97
98
99
100
101
102
103
104
105
106
107
108

77

75
73

72

70
7E
70
74
7A
71
84
7C
7B
79

Note: Break codes consists of two bytes; the first is hex FO,
the second is the make scan code for that key.

Keyboard

4-11

Clock and Data Signals
The keyboard and system communicate over the clock and
I data I lines. The source of each of these lines is an
open-collector device on the keyboard that allows either the
keyboard or the system to force a line to a negative level. When
no communication is occurring, both the clock and data lines
are at a positive level.
I

I

I

I

I

I

Data transmissions to and from the keyboard consist of 11-bit
data streams that are sent serially over the data line. The
following figure shows the structure of the data stream.
I

Bit

I

Function
Start bit (always 1)
Data bit 0 (least-significant)
Data bit 1
Data bit 2
Data bit 3
Data bit 4
Data bit 5
Data bit 6
Data bit 7 (most-significant)
Parity bit (always odd)
Stop bit (always 1)

1
2
3

4
5
6
7

8
9

10
11

The parity bit is either 1 or 0, and the eight data bits plus the
parity bit always equals an odd number.
When the system sends data to the keyboard, it forces the data
line to a negative level and allows the clock line to go to a
positive level.
I

I

I

I

When the keyboard sends data to~ or receives data from the
system, it generates the clock signal to time the data. The
system can prevent the keyboard from sending data by forcing the
clock line to a negative level; the data line may go high or low
during this time.
I

I

I

I

I

During the BAT, the keyboard allows the
lines to go to a positive level.

4-12

Keyboard

I

I

clock and data
I

I

I

Keyboard Data Output
When the keyboard is ready to send data, it first checks for a
keyboard-inhibit or system request-to-send status on the I clock I
and data lines. If the clock line is low (inhibit status), data is
stored in the keyboard buffer. If the I clock I line is high and
data is low (request-to-send), data is stored in the keyboard
buffer, and the keyboard receives system data.
I

I

I

I

I

I

If I clock I and I data I are both high, the keyboard sends the 0

start bit, 8 data bits, the parity bit and the stop bit. Data will be
valid after the rising edge and before the falling edge of the
I clock I line.
During transmission, the keyboard checks the
clock line for a positive level at least every 60 milliseconds. If
the system lowers the I clock I line from a positive level after the
keyboard starts sending data, a condition known as line contention
occurs, and the keyboard stops sending data. If line contention
occurs before the rising edge of the tenth clock (parity bit), the
keyboard buffer returns the data and clock lines to a positive
level. If contention does not occur by the tenth clock, the
keyboard completes the transmission.
I

I

I

I

I

I

Following a transmission, the system can inhibit the keyboard
until the system processes the input or until it requests that a
response be sent.

Keyboard Data Input
When the system is ready to send data to the keyboard, it first
checks if the keyboard is sending data. If the keyboard is sending
but has not reached the tenth clock, the system can override the
keyboard output by forcing the I clock I line to a negative level.
If the keyboard transmission is beyond the tenth clock, the system
must receive the transmission.
If the keyboard is not sending, or if the system elects to override

the keyboard's output, the system forces the clock line to a
negative level for more than 60 microseconds while preparing to
send. When the system is ready to send the start bit ( I data I line
will be low), it allows the I clock I line to go to a positive level.
I

I

Keyboard

4-13

The keyboard checks the state of the clock line at intervals of
no less than 60 milliseconds. If a request-to-send is detected, the
keyboard counts 11 bits. After the tenth bit, the keyboard forces
the data line low and counts one more (the stop bit). This
action signals the system that the keyboard has received its data.
Upon receipt of this signal, the system returns to a ready state, in
which it can accept'keyboard output, or goes to the inhibited state
until it is ready.
I

I

I

I

Each system command or data transmission to the keyboard
requires a response from the keyboard before the system can send
its next output. The keyboard will respond within 20 milliseconds
unless the system prevents keyboard output. If the keyboard
response is invalid or has a parity error, the system sends the
command or data again. A Resend command should not be sent
in this case.

4-14

Keyboard

Keyboard Layouts
The keyboard has six different layouts:

•

French

•

German

•

Italian

•

Spanish

•

u.K. English

•

U.S. English

The following pages show the six keyboard layouts.

Keyboard

4-15

...
".
I

~

ia.

i

I

f

f
f
....""''-l
I

11 NOI13:1S

oI:lo.

....
QC
I

~

~

~

£
~r

f

rJ1

"C

....~
~

i

l

ia
.......
I

\C

t NOIl:J3S

"'"
I

=
N

~
~

~
~

e;Q.

.~
.
~

~
as.
••
~

~

~

i

a

~

\fl

i...
\Ij

=-

i
I
~

I

~
~

t> N0I1:J3S

Specifications
Size
•

Length: 540 millimeters (21.6 inches)

•

Depth: 100 millimeters (4 inches)

•

Height: 225 millimeters (9 inches)

Weight
•

2.8 kilograms (6.2 pounds)

4-22

Keyboard

~

_.
_.

o
(J'Q

0
00

)

o

A3

PARTIAL VIEW A-A

~

[I]

~
~
(J'Q
+5
PI

GND
+5 81

~N/C

• GND

r

+5

~

CI

-

UI

~-

r- A
'

iL-A

J
PI

oUI

P11

rn

1 81

I"

51)-- ,
UI

r-.. .

~ r'l

r'l

l)RI
LED I
10

PO~~~ ~~)±---!
,....!406.

"'"l

.,

l,lR1

r'l R3
l,l

LED 1
0

LED 3
01

L ____________

,~ "

O"~;W','I
__

0

0

'0

7
LARGE HOLE

f

PARTIAL VIEW 8-8

Enhancement Logic Card Assembly

oIao.
I

N

~

17 N0I1:ns

a
8

j

~ LED HOLDER

LED~

R1

LED 3

~

1

;!

Notes:

4-24

Keyboard

SECTION 5. SYSTEM BIOS

Contents
System BIOS Usage ............................... 5-3
Parameter Passing ........................... 5-4
Vectors with Special Meanings ................. 5-6
Other Read/Write Memory Usage .............. 5-8
BIOS Programming Hints .................... 5-10
Adapters with System-Accessible ROM Modules .. 5-12
Additional System Board ROM Modules ......... 5-13
Keyboard Encoding and Usage ....••..•..•...........
Character Codes ...........................
Extended Functions .........................
Shift States ................................
Special Handling ...........................

5-13
5-14
5-18
5-19
5-21

Quick Reference ...••....•........•.............. 5-24

System BIOS

5-1

Notes:

5-2

System BIOS

The basic input/output system (BIOS) resides in ROM on the
system board and provides level control for the major I/O devices
in the system and provides system services, such as time-of-day
and memory size determination. Additional ROM modules may
be placed on option adapters to provide device-level control for
that option adapter. BIOS routines enable the assembly language
programmer to perform block (disk or diskette) or character-level
I/O operations without concern for device address and
characteristics.
If the sockets labeled V17 and V37 on the system board are

empty, additional ROM modules may be installed in these
sockets. During POST, a test is made for valid code at this
location, starting at address hex EOOOO and ending at hex EFFFF.
More information about these sockets may be found under
"Additional System Board ROM Modules" on page 5-13 .
The goal of the BIOS is to provide an operational interface to the
system and relieve the programmer of concern about the
characteristics of hardware devices. The BIOS interface isolates
the user from the hardware, allowing new devices to be added to
the system, yet retaining the BIOS level interface to the device.
In this manner, hardware modifications and enhancements are not
apparent to user programs.
The IBM Personal Computer MA CR 0 Assembler manual and the
IBM Personal Computer Disk Operating System (DOS) manual
provide useful programming information related to this section.
A complete listing of the BIOS is given later in this section.

System BIOS Usage
Access to the BIOS is through program interrupts of the
microprocessor in the real mode. Each BIOS entry point is
available through its own interrupt. For example, to determine
the amount of base RAM available in the system with the
microprocessor in the real mode, INT 12H invokes the BIOS
routine for determining the memory size and returns the value to
the caller.

System BIOS

5-3

Parameter Passing
All parameters passed to and from the BIOS routines go through
the 80286 registers. The prolog of each BIOS function indicates
the registers used on the call and return. For the memory size
example, no parameters are passed. The memory size, in lK
increments, is returned in the AX register.
If a BIOS function has several possible operations, the AH

register is used at input to indicate the desired operation. For
example, to set the time of day, the following code is required:
HOV

AH,1

HOV
HOV

eX,RIGH_COUNT

INT

1AR

; function is to set time-of-day
; establish the current time

DX.LOW_COU~T

; set the time

To read the time of day:
MOV
INT

AR,O
1AR

; function is to read time-of-day
; read the timer

The BIOS routines save all registers except for AX and the flags.
Other registers are modified on return only if they are returning a
value to the caller. The exact register usage can be seen in the
prolog of each BIOS function.

~-4

System BIOS

The following figure shows the interrupts with their addresses and
functions.
Int

o

Address

Name

0-3
4-7
8-B
C-F
10-13
14-17
18-1B
lC-1F
20-23
24-27
28-2B
2C-2F
30-33
34-37
38-3B
3C-3F
40-43
44-47
48-4B

Divide by Zero
Single Step
Nonmaskable
Breakpoint
Overf low
Print Screen
Reserved
Reserved
Time of Day
Keyboard
Reserved
Communications
Communications
Alternate Printer
Diskette
Printer
Video
Equipment Check
Memory

13
14
15

4c-4F

Di skette/D i sk
Communications
Cassette

16
17
18

58-5B
5C-5F

1
2

3

4
5
6

7

8
9

A

B
C

D
E
F

10
11

12

19

lA
lB
lC
lD
IE

1F

50-53
54-57

60-63
64-67
68-6B
6C-6F
70-73
74-77
78-7B
7C-7F

Keyboard
Printer
Resident Basic
Bootstrap
Time of Day
Keyboard Break
Timer Tick
Video Initialization
Diskette Parameters
Video Graphics Chars

BIOS Entry
D11
D11
NMI I NT
D11
D11

PRINT SCREEN
D11
D11

TIMER INT
KB INT

Dn
D11

D 11

D11

DISK INT
D11
VIDEO 10
EQUIPMENT
MEMORY SIZE
DETERMINEDISKETTE 10
RS232 10CASSETTE
10/System
Extensions
KEYBOARD 10
PR I NTER To
F600:0000
BOOTSTRAP
TIME OF DAY
DUMMY RETURN
DUMMY-RETURN
VIDEO-PARMS
DISK BASE

o

80286-2 Program Interrupt Listing (Real Mode Only)

Note: For BIOS index, see the BIOS Quick Reference
on page 5-24 .

System BIOS

5-5

The following figure shows hardware, BASIC, and DOS reserved
interrupts.
Interrupt

Address

Function

20
21
22
23
24
25
26
27
28-3F
40-5F
60-67
68-6F
70

80-83
84-87
88-8B
8C-8F
90-93
94-97
98-9B
9C-9F
AO-FF
100-17F
180-19F
lAO-1BF
lCO-1C3

71
73
74
75

lc4-1C7
lC8-1CB
lCC-1CF
100-103
104-107

76
77
78-7F
80-85
86-FO

108-10B
10C-l0F
lEO-IFF
200-217
218-3C3

Fl-FF

3C4-3FF

DOS program terminate
DOS function call
DOS terminate address
DOS Ctrl Break exit address
DOS fatal error vector
DOS absolute disk read
DOS absolute disk write
DOS terminate, fix in storage
Reserved for DOS
Reserved for BIOS
Reserved for user program interrupts
Not used
IRQ 8 Realtime clock INT (BIOS entry
RTC I NT)
IRQ 9 \BIOS entry RE DIRECT)
IRQ 10 (BIOS entry 011)
IRQ 11 (BIOS entry 011)
IRQ 12 (BIOS entry 011)
IRQ 13 BIOS Redirect to NMI interrupt
(BIOS entry INT 287)
IRQ 14 (BIOS entry-Oil)
IRQ 15 (BIOS entry 011)
Not used
Reserved for BASIC
Used by BASIC interpreter while
BASIC is running
Not used

72

Hardware, Basic, and DOS Interrupts

Vectors with Special Meanings
Interrupt I5-Cassette I/O: This vector points to the
following functions:

•

Device open

•

Device closed

•

Program termination

•

Event wait

•

Joystick support

5-6

System BIOS

•

System Request key pressed

•

Wait

•

Move block

•

Extended memory size determination

•

Processor to protected mode

Additional information about these functions may be found in the
BIOS listing.

Interrupt tB-Keyboard Break Address: This vector points to
the code that is executed when the Ctrl and Break keys are
pressed. The vector is invoked while responding to a keyboard
interrupt, and control should be returned through an IRET
instruction. The power-on routines initialize this vector to point
to an IRET instruction so that nothing will occur when the Ctrl
and Break keys are pressed unless the application program sets a
different value.
This routine may retain control with the following considerations:
•

The Break may have occurred during interrupt processing, so
that one or more End of Interrupt commands must be sent to
the 8259 controller.

•

All 110 devices should be reset in case an operation was
underway at the same time.

Interrupt t C-Timer Tick: This vector points to the code that
will be executed at every system-clock tick. This vector is
invoked while responding to the timer interrupt, and control
should be returned through an IRET instruction. The power-on
routines initialize this vector to point to an IRET instruction, so
that nothing will occur unless the application modifies the pointer.
The application must save and restore all registers that will be
modified.

Interrupt tD-Video Parameters: This vector points to a data
region containing the parameters required for the initialization of
the 6845 on the video adapter. Notice that there are four

System BIOS

5-7

separate tables, and all four must be reproduced if all modes of
operation are to be supported. The power-on routines initialize
this vector to point to the parameters contained in the ROM video
routines.
Interrupt IE-Diskette Parameters: This vector points to a
data region containing the parameters required for the diskette
drive. The power-on routines initialize this vector to point to the
parameters contained in the ROM diskette routine. These default
parameters represent the specified values for any IBM drives
attached to the system. Changing this parameter block may be
necessary to reflect the specifications of other drives attached.
Interrupt IF-Graphics Character Extensions: When
operating in graphics modes 320 x 200 or 640 x 200, the
read/write character interface will form a character from the
ASCII code point, using a set of dot patterns. ROM contains the
dot patterns for the first 128 code points. For access to the
second 128 code points, this vector must be established to point
at a table of up to 1K, where each code point is represented by 8
bytes of graphic information. At power-on time, this vector is
initialized to 000:0, and the user must change this vector if the
additional code points are required.
Interrupt 40-Reserved: When a Fixed Disk and Diskette Drive
Adapter is installed, the BIOS routines use interrupt 40 to
revector the diskette pointer.
Interrupt 41 and 46-Fixed Disk Parameters: These vectors
point to the parameters for the fixed disk drives, 41 for the first
drive and 46 for the second. The power-on routines initialize the
vectors to point to the appropriate parameters in the ROM disk
routine if CMOS is valid. The drive type codes in CMOS are
used to select which parameter set the vector points to. Changing
this parameter hook may be necessary to reflect the specifications
of other fixed drives attached.

Other Read/Write Memory Usage
The IBM BIOS routines use 256 bytes of memory from absolute
hex 400 to hex 4FF. Locations hex 400 to 407 contain the base

5-8

System BIOS

addresses of any RS-232C adapters installed in the system.
Locations hex 408 to 40F contain the base addresses of any
printer adapters.
Memory locations hex 300 to hex 3FF are used as a stack area
during the power-on initialization and bootstrap, when control is
passed to it from power-on. If the user desires the stack to be in a
different area, that area must be set by the application.
The following figure shows the reserved memory locations.
Address

Mode

400-4A1
4A2-4EF
4FO-4FF

ROM BIOS

500-5FF
500

DOS

504
510-511
512-515
516-519

DOS
BASIC
BASIC
BASIC

51A-51D

BASIC

Function
See BIOS listing
Reserved
Reserved as intra-application
communication area for any app I i cat i on
Reserved for DOS and BASIC
Print screen status flag store
O=Print screen not active or successful
print screen operation
1=Print screen in progress
255=Error encountered during print
screen operation
Single drive mode status byte
BASIC's segment address store
C)dck interrupt vector segment:offset store
Break key interrupt vector segment:offset
store
Disk error interrupt vector segment:offset
store

Reserved Memory Locations

The following is the BASIC workspace for DEF SEG (default
workspace) .
Offset

Length

2E
347
30
358

2
2
2
2

6A

1

4E

1

Line number of current line being executed
Line number of last error
Offset into segment of start of program text
Offset into segment of start of variables
(end of program text 1-1)
Keyboard buffer contents
O=No characters in buffer
1=Characters in buffer
Character color in graphics mode*

Basic Workspace Variables

*Set to 1,2, or 3 to get text in colors 1-3. Do not set to O. The
default is 3.

System BIOS

5-9

Example
100 PRINT PEEK (&H2E) + 256 x PEEK (&H2F)
H

Hex 00

The following is a BIOS memory map.
Starting Address
00000
OOIEO
00400
00500
EOOOO
FOOOO

BIOS interrupt vectors
Avai lab Ie interrupt vectors
BIOS data area
User read/write memory
Read only memory
BIOS program area

BIOS Memory Map

BIOS Programming Hints
The BIOS code is invoked through program interrupts. The
programmer should not "hard code" BIOS addresses into
applications. The internal workings and absolute addresses within
BIOS are subject to change without notice.
If an error is reported by the disk or diskette code, reset the drive

adapter and retry the operation. A specified number of retries
should be required for diskette reads to ensure the problem is not
due to motor startup.
When altering I/O-port bit values, the programmer should change
only those bits necessary to the current task. Upon completion,
the original environment should be restored. Failure to adhere to
this practice may cause incompatibility with present and future
applications.
Additional information for BIOS programming can be found in
Section 9 of this manual.

5-10

System BIOS

Move Block BIOS
The Move Block BIOS was designed to make use of the memory
above the 1M address boundary while operating with IBM DOS.
The Block Move is done with the Intel 80286 Microprocessor
operating in the protected mode.
Because the interrupts are disabled in the protected mode, Move
Block BIOS may demonstrate a data overrun or lost interrupt
situation in certain environments.
Communication devices, while receiving data, are sensitive to
these interrupt routines; therefore, the timing of communication
and the Block Move should be considered. The following table
shows the interrupt servicing requirements for communication
devices.
Baud Rate
300
1200
2400
4800
9600

11 Bit (ms)
33.33
8.33
4.16
2.08
1. 04

9 bit (ms)
30.00
7.50
7.50
1.87
0.93

Times are approximate

Communication Interrupt Intervals

The following table shows the time required to complete a Block
Move.
Block Size
Normal
512 Byte

Maximum
64K

Buffer
Addresses
Both even
Even and odd
Both odd
Both Even
Even and odd
Both odd

Time in ms
0.98
1. 04
1. 13
37.0
55.0
72.0

Time is approximate

Move Block BIOS Timing

System BIOS

5-11

Following are some ways to avoid data overrun errors and loss of
interrupts:
•

Do not use the Block Move while communicating, or

•

Restrict the block size to 512 bytes or less while
communicating, or

•

Use even address buffers for both the source and the
destination to keep the time for a Block Move to a
minumum.

Adapters with System-Accessible ROM Modules
The ROM BIOS provides a way to integrate adapters with
on-board ROM code into the system. During POST, interrupt
vectors are established for the BIOS calls. After the default
vectors are in place, a scan for additional ROM modules occurs.
At this point, a ROM routine on an adapter may gain control and
establish or intercept interrupt vectors to hook themselves into
the system.
The absolute addresses hex C8000 through EOOOO are scanned in
2K blocks in search of a valid adapter ROM. A valid ROM is
defined as follows:

Byte 0

Hex 55

Bytel

HexAA

Byte 2

A length indicator representing the number of 512-byte
blocks in the ROM

Byte 3

Entry by a CALL FAR

A checksum is also done to test the integrity of the ROM module.
Each byte in the defined ROM module is summed modulo hex
100. This sum must be 0 for the module to be valid.
When the POST identifies a valid ROM, it does a CALL FAR to
byte 3 of the ROM, which should be executable code. The
adapter can now perform its power-on initialization tasks. The

5-12

System BIOS

adapter's ROM should then return control to the BIOS routines
by executing a RETURN FAR.

Additional System Board ROM Modules
The POST provides a way to integrate the code for additional
ROM modules into the system. These modules are placed in the
sockets marked U17 and U3 7. A test for additional ROM
modules on the system board occurs. At this point, the additional
ROM, if valid, will gain controL
The absolute addresses, EOOOO through EFFFF, are scanned in
64K blocks for a valid checksum. Valid ROM is defined as
follows:
Byte 0

Hex 55

Byte 1

HexAA

Byte 2

Not used

Byte 3

Entry by a CALL FAR

A checksum is done to test the integrity of the ROM modules.
Each byte in the ROM modules is summed modulo hex 100. This
sum must be 0 for the modules to be valid. This checksum is
located at address EFFFF.
When the POST identifies a valid ROM at this segment, it does a
CALL FAR to byte 3 of the ROM, which should be executable
code.

Keyboard Encoding and Usage
The keyboard routine, provided by IBM in the ROM BIOS, is
responsible for converting the keyboard scan codes into what will
be termed Extended ASCII. The extended ASCII codes returned
by the ROM routine are mapped to the U.S. English keyboard

System BIOS

5-13

layout. Some operating systems may make provisions for
alternate keyboard layouts by providing an interrupt replacer,
which resides in the read/write memory. This section discusses
only the ROM routine.
Extended ASCII encompasses 1-byte character codes, with
possible values of 0 to 255, an extended code for certain extended
keyboard functions, and functions handled within the keyboard
routine or through interrupts.

Character Codes
The character codes described later are passed through the BIOS
keyboard routine to the system or application program. A" -1 "
means the combination is suppressed in the keyboard routine.
The codes are returned in the AL register. See "Characters,
Keystrokes, and Color" later in this manual for the exact codes.

5-14

System BIOS

The following figure shows the keyboard layout and key
positions.

System BIOS

5-15

Key

Base Case

Uppercase

I

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

~

1
2
3
4
5
6
7
8
9
0

!
@

#
$
%
A

&

*
(
)

-

+

=

\

16
17
18
19
20
21
22
23
24
25
26
27
28
30 Ctrl
31
32
33
34
35
36
37
38
39
40
41
43
44 Shift
(Left )
46
47
48

Backs)ace
(008
--+1 (009)
q

1

Backspace
(008)
I+- (*)
Q

w

w

e
r
t
y
u
i

E
R
T
Y

U
I

0

0

p

p

{
}

[

1
-1
a
s
d
f

-1
A
S
D
F
G
H

9

h
j

J

k
1
j

K
L
:

I

"

CR
-1

CR
-1

z

Z

x
c

X
C

Ctrl
-1
-1
Nul(OOO) (*)
-1
.-1
-1
RS(030)
-1
-1
-1
-1
US(03])
-1
FS(028)
Del(12])

-1
(*)
(*)
(*)
(*)
(*)
(*)
(*)
(*)
(*)
(*)
(*)
(*)
-1
-1

-1
DCl(Ol])
ETB(023)
ENQ(005)
DC2(018)
Dc4(020)
EM(025)
NAK(02])
HT(009)
SI(015)
DLE(016)
Esc(02])
GS(029)
-1
SOH(OOl)
DC3(019)
EOT(004)
ACK(006)
BEL (00])
BS(008)
LF(010)
VT( 0 11 )
FF(012)
-1
-1
LF(OlO)
-1

-1
(*)
(*)
(*)
(*)
(*)
(* )
(*)
(* )
(*)
(*)
(*)
-1
-1
(*)
(*)
(*)
(* )
(*)
(*)
(* )
(*)
(* )
-1
-1
-1
-1

SUB(026)
CAN(024)
ETX(003)

( )
( )
( )

Notes:
i*) Refer to "Extended Functions" in this section.
('*) Refer to "Special Hand 1i ng " in this section.

Character Codes (Part 1 of 2)

5-16

System BIOS

Alt

Key
49
50
51
52
53
54
55
57 Shift
(Right)
58 Alt
61
64 Caps
Lock
90
95 Num
Lock
100 Scroll
Lock
107
108
112
113
114
115
116
117
118

Base Case

Uppercase

Ctrl

Alt
(*)
(*)
(*)
(*)
-1
-1
-1
-1

-1

-1

SYN(022)
STX(002)
SO(014)
CR(013)
-1
-1
-1
-1

-1
Space
-1

-1
Space
-1

-1
Space
-1

Esc
-1

Esc
-1 (*)

Esc
Pause (**)

-1
-1

-1

-1

Break (**)

-1

Enter
Null (* )
Nu 11 (*)
Null (* )
Null (*)
Null (*)
Null (*)
Null (*)

Enter
Null (*)
Null (*)
Null (*)
Null (*)
Null (*)
Nu 11 (*)
Nu 11 (*)

v

V

b

B
N

n
m

M

,

/

<
>

?

-

(*)
-1
Null (*)
Null (*)
Null (*)
Nu 11 (*)
Null (*)
Nu 11 (*)
Null (*)

-1
Space
-1

(*)
-1
Null (*)
Null (*)
Null (*)
Null (*)
Nill ](*)
Null (*)
Null(*)

Notes:

i*) Refer to "Extended Functions" in this section.
(,,*) Refer to "Special Handling " in this section.

Character Codes (Part 2 of 2)

System BIOS

5-17

The following figure lists keys that have meaning only in Num
Lock, Shift, or Ctrl states. The Shift key temporarily reverses the
current Num Lock state.
Key

Num
Lock

91
92

7
4

Home (*)
... (*)

-1
-1

Clear Screen
Reverse Word

93

1

End (*)

-1

Erase to EOL

96
97
98
99
101

8
5
2
0
9

t (*)
Ins
Page Up (*)

-1
-1
-1
-1
-1

102

6

... (*)

-1

-1
-1
-1
-1
Top of Text
and Home
Advance Word

103

3

Pa£!e Down

-1

Erase to EOS

-

Delete (*,**)
Sys Request

104
105
106

+

Base Case

-1

t (*)

Al t

(" )

+ (*)

(** )

-1
-1

Ctrl

(*)
(*)

(*)

r)

( , *)
-1
-1

Notes:
(* ) Refer to "Extended Functions " in this section.
(**) Refer to "Special Hand 1 i ng " in this section.

Special Character Codes

Extended Functions
For certain functions that cannot be represented by a standard
ASCII code, an extended code is used. A character code of 000
(null) is returned in AL. This indicates that the system or
application program should examine a second code, which will
indicate the actual function. Usually, but not always, this second
code is the scan code of the primary key that was pressed. This
code is returned in AH.

5-18

System BIOS

The following is a list of the extended codes and their functions.
Second
Code

3
15
16-25
30-38
44-50
59-68
71
72

73
75
77

79
80
81
82
83
84-93
94-103
104-113
114
115
116
117
118
119
120-131
132

Function
Nul Character
I+- (Back-tab)
Alt Q, W, E, R, T, Y, U, 1,0, P
Alt A, S, D, F, G, H, J, K, l
Alt Z, X, C, V, B, N, M
F1 to FlO Function Keys (Base Case)
Home
t (Cursor Up)
Page Up and Home Cursor
... (Cursor left)
~ (Cursor Right)
End
t (Cursor Down)
Page Down and Home Cursor
Ins (Insert)
Del (Delete)
F11 to F20 (Shift-F1 through Shift-FlO)
F21 to F30 (Ctrl-F1 through Ctrl-F10)
F31 to F40 (Alt-F1 through Alt-F10)
Ctrl PrtSc (Start/Stop Echo to Printer)
Ctrl ... (Reverse Word)
Ctrl ~ (Advance Word)
Ctrl End (Erase to End of line-EOl)
Ctrl PgDn (Erase to End of Screen-EOS)
Ctrl Home (Clear Screen and Home)
Alt 1,2, 3, 4, 5,6,7,8,9,0, -, = keys 2-13
Ctrl PgUp (Top 25 lines of Text and Cursor Home)

Keyboard Extended Functions

Shift States
Most shift states are handled within the keyboard routine, and are
not apparent to the system or application program. In any case,
the current status of active shift states is available by calling an
entry point in the BIOS keyboard routine. The following keys
result in altered shift states:
Shift: This key temporarily shifts keys 1 through 13, 15 through
29,31 through 41, and 46 through 55, to uppercase (base case if
in Caps Lock state). Also, the Shift temporarily reverses the
Num Lock or non-Num Lock state of keys 91 through 93, 96, 98,
99, and 101 through 104.

System BIOS

5-19

CtrI: This key temporarily shifts keys 3, 7, 12, 15, 17 through 29,
31 through 39, 43, 46 through 52, 91 through 93, and 101
through 103 to the Ctrl state. The Ctrl key is also used with the
Alt and Del keys to cause the system-reset function; with the
Scroll Lock key to cause the break function; and with the Num
Lock key to cause the pause function. The system-reset, break,
and pause functions are described under "Special Handling" later
in this section.
AIt: This key temporarily shifts keys 1 through 13, 17 through
26, 31 through 39, and 46 through 52 to the Alt state. The Alt
key is also used with the Ctrl and Del keys to cause a system
reset.
The Alt key also allows the user to enter any character code from
1 to 255.
Note: Character codes 97-122 will display uppercase
with Caps Lock activated.
The user holds down the Alt key and types the decimal value of
the characters desired on the numeric keypad (keys 91 through
93,96 through 99, and 101 through 103). The Alt key is then
released. If the number is greater than 255, a modulo;..256 value
is used. This value is interpreted as a character code and is sent
through the keyboard routine to the system or application
program. Alt is handled internal to the keyboard routine.

Caps Lock: This key shifts keys 17 through 26,31 through 39,
and 46 through 52 to uppercase. When Caps Lock is pressed
again, it reverses the action. Caps Lock is handled internal to the
keyboard routine. When Caps Lock is pressed, it changes the
Caps Lock Mode indicator. If the indicator was on, it will go off;
and if it was off, it will go on.
Scroll Lock: When interpreted by appropriate application
programs, this key indicates that the cursor-control keys will
cause windowing over the text rather than moving the cursor.
When the Scroll Lock key is pressed again, it reverses the action.
The keyboard routine simply records the current shift state of the
Scroll Lock key. It is the responsibility of the application
program to perform the function. When Scroll Lock is pressed, it

5-20

System BIOS

changes the Scroll Lock Mode indicator. If the indicator was on,
it will go off; and if it was off, it will go OIl.

Nom Lock: This key shifts keys 91 through 93, 96 through 99,
and 101 through 104 to uppercase. When Num Lock is pressed
again, it reverses the action. Num Lock is handled internal to the
keyboard routine. When Num Lock is pressed, it changes the
Num Lock Mode indicator. If the indicator was on, it will go off;
if it was off, it will go on.
If the keyboard Num Lock Mode indicator and the system get out

of synchronization, pressing the key combination of Shift and
Num Lock will synchronize them. This key combination changes
the Num Lock bit in the keyboard memory, but sends only the
scan code for the Shift key to the system.

Shift Key Priorities and Combinations: If combinations of the
Alt, Ctrl, and Shift keys are pressed and only one is valid, the
priority is as follows: the Alt key is first, the Ctrl key is second,
and the Shift key is third. The only valid combination is Alt and
Ctrl, which is used in the system-reset function.

Special Handling
System Reset
The combination of the Alt, Ctrl, and Del keys results in the
keyboard routine that starts a system reset or restart. System
reset is handled by BIOS.

Break
The combination of the Ctrl and Break keys results in the
keyboard routine signaling interrupt hex tB. The extended
characters AL=hex 00, and AH=hex 00 are also returned.

System BIOS

5-21

Pause
The Pause key (Ctrl and Num Lock) causes the keyboard
interrupt routine to loop, waiting for any key except Num Lock to
be pressed. This provides a method of temporarily suspending an
operation, such as listing or printing, and then resuming the
operation. The method is not apparent to either the system or the
application program. The key stroke used to resume operation is
discarded. Pause is handled internal to the keyboard routine.

Print Screen
The PrtSc key results in an interrupt invoking the print-screen
routine. This routine works in the alphanumeric or graphics
mode, with unrecognizable characters printing as blanks.

System Request
When the System Request (Sys) key is pressed, a hex 8500 is
placed in AX, and an interrupt hex 15 is executed. When the Sys
key is released, a hex 8501 is placed in AX, and another interrupt
hex 15 is executed. If an application is to use System Request,
the following rules must be observed:
Save the previous address.
Overlay interrupt vector hex 15.
Check AH for a value of hex 85:
If yes, process may begin.
If no, go to previous address.

The application program must preserve the value in all registers,
except AX, upon return. System Request is handled internal to
the keyboard routine.

5-22

System BIOS

Other Characteristics

The keyboard routine does its own buffering, and the keyboard
buffer is large enough to support entries by a fast typist.
However, if a key is pressed when the buffer is full, the key will
be ignored and the "alarm" will sound.
The keyboard routine also suppresses the typematic action of the
following keys: Ctrl, Shift, Alt, Num Lock, Scroll Lock, Caps
Lock, and Ins.
During each interrupt 09H from the keyboard, an interrupt 1SH,
function (AH)=4FH is generated by the BIOS after the scan
code is read from the keyboard adapter. The scan code is passed
in the (AL) register with the carry flag set. This is to allow an
operating system to intercept each scan code prior to its being
handled by the interrupt 09H routine, and have a chance to
change or act on the scan code. If the carry flag is changed to 0
on return from interrupt 1SH, the scan code will be ignored by
the interrupt handler.

System BIOS

5-23

Quick Reference
Testl ..........................................
Data Area Description . . . . . . . . . . . . . . . . . . . . . . . . ..
Common POST and BIOS Equates ................
Test .01 Through Test .16 .......................
POST and Manufacturing Test Routines ............

5-28
5-30
5-32
5-36
5-57

Test2 .......................................... 5-58
Test .17 Through Test .23 ....................... 5-58

Test3. POST Exception Interrupt Tests ................ 5-75
Test4. POST and BIOS Utility Routines ...............
CMOS READ ..............................
CMOS--VVRITE .............................
E MSG P MSG...........................
ERR BEEP--................................
BEEP ......................................
VVAITF .....................................
CONFIG BAD..............................
PRT SEG ..................................
KBD- RESET ...............................
D11 - Dummy Interrupt Handler .................
Hardware Interrupt 9 Handler (Type 71) ...........

5-81
5-81
5-81
5-82
5-82
5-83
5-83
5-83
5-84
5-85
5-87
5-87

Test5. Exception Interrupt Tests .....................
SYSINIT1 - Build Protected Mode Descriptors .......
GDT BLD - Build the GDT for POST ............
SIDT--BLD - Build the IDT for POST ............

5-88
5-89
5-89
5-91

Test6 ..........................................
STGTST CNT ..............................
ROM ERR .................................
XMIT-- 8042 ................................
BOOT-- STRAP ..............................

5-93
5-93
5-95
5-95
5-95

Diskette BIOS

.................................. 5-97

Fixed Disk (Hard File) BIOS ....................... 5-116

5-24

System BIOS

Keyboard BIOS .................................. 5-129
Printer BIOS

5-138

RS232 BIOS

5-140

Video BIOS .................•.................. 5-143
BIOS .......................••...............
Memory Size Determine .......................
Equipment Determine .........................
NMI ......................................

5-161
5-161
5-161
5-162

BIOS1. . ..............................•.......
Event Wait .................................
Joystick Support .............................
Wait ......................................
Block Move ................................
Extended Memory Size Determine ...............
Processor to Virtual Mode .....................

5-163
5-164
5-165
5-166
5-167
5-172
5-174

BIOS2 ......................•................
Time of Day ................................
Alarm Interrupt Handler .......................
Print Screen .................................
Timer 1 Interrupt Handler ......................

5-176
5-176
5-179
5-180
5-181

ORGS - PC Compatibility and Tables ................ 5-182
POST Error Messages .. , ...................... 5-182

System BIOS

5-25

Address
FOOO:E129
FOOO:3A23
FOOO: 6000
FOOO:19FO
FOOO: IBIA
FOOO:2022
FOOO:OC96
FOO~ :0396
FOOO;4135
FOOO:1941
FOOO: 195B
FOOO: 1 A45
FOOO:E6F5
FOOO :FA6E
FOOO:E020
FOOO:IBCA
FOOO:E030
FOOO:E040
FOOO: 1915
FOOO:20E3
FOOO:EFC1
FOOO:2AI1
FOOO:2C2B
FOOO:2A82
FOOO:2A2E
FOOO:FF53
FOOO; ICI8
FOOO:E05E
FOOO:EOl1
FOOO:E090
FOOO IEOA9
FOOO :EOC2
FOOO :EODB
FOOO :EOF4
FOOO lEI 00
FOOO:EI26
FOOO:EI3F
FOOO:EI68
FOOO:EI91
FOOO:EIB1
FOOO:EIDB
FOOO:E1EE
FOOO:E209
FOOD ;E224
FOOO:E239
FOOO:E2C6
FOO~ :E2EA
FOOD ;E30E
FOOO:E31E
FOOD ;E32E
FOOD :E343
FOOD :40A8
FOOD: 19B2
FOOD: 1910
FOOD :E364
FOOD IE319
FOOD :E38E
FOOD :E3AC
FOOOIE3BF
FOOD IE302
FOOO:E25D
FOOD ;E3DF
FOOO:E401
FOO~ :4888
FOOO:FF5E
FOOO:4501
FOOO:314F
FOOD :FF5A
FOOO: IC22
FOOO:E8EI
FOOO:E9IB
FOOO :E955
FOOO:E95F
FOOO IE969
FOOO:E916
FOOO:3261
FOOO:E81E
FOOO: 0008
FOOO:E886
FOOO:E88E
FOOO;E8C8
FOOO: IAEF
FOOO:3IFE
FOOO: 3112
FOOO:OOIO
FOOO :FOE4
FOOO:FOEC
FOOO:FOF4
FOOO:409E
FOOO :E2C3
FOOO;40B2
FOOO I 03A2
FOOO: 0000
FOOO: OC96
FOOO; 1611
FOOOl1941
FOOD: I C38
FOOD: IEB5

5-26

Pub I i 05 by Name

Aba

Abs

Address

AI
ACT DISP PAGE
BASTc
BEEP
BLINK INT
BOOT STRAP 1
C21 C8042
CASSETTE 10 1
CMOS READ CMOS-WRITE
CQNFTG BAD
CONF TeL
CRT CHAR GEN
01 011
02
D2A
DDS
DISKETTE 10 I
DISK BASE 01 SK-'NT 1
DISK-IO DISK-SETUP
DSKETTE SETUP
DUMMY RETURN
DUMMY-RETURN ,
EIOI EI02
EI03
EI04
EI05
EI06
EIOl
EI08
EI09
EI61
EI62
EI63
EI64
E201
E202
E203
E30 I
E302
E303
E304
E401
E501
E601
E602
EQUIPMENT I
ERR BEEP E MSG
FT180
FI781
FI782
FI790
FI191
F3A
F3D
F3DI
FD TBL
FILL
FLOPPY
GATE A20
HD INT
HRo
INT 281
KIOKII
KI2
KI3
KI4

FOOD
FOOD
FOOD
FOOD
FOOD
FOOD
FOOD
FOOD

Kt5

FOOD
FOOD
FOOD
FOOD
FOOD
FOOO

K16
Kb
K6L

K'
K8

K9
KBO RESET
K8 TNT I
KEYBOARD 10
M4

.,

FOO~

FOOD
FOOO
FOOD
FOOD
FOOD
FOO~

FOOD
FOOD
FOOD
FOOD
FOOD
FOOD
FOOO
FOOD
FOO~

FOOD
FOOO
FOOO
FOO~

FOOD
FOOO
FOOD
FOO~

FOOD
FOOD
FOOD
FOOO
FOOD
FOO~

FOOO
FOOO
FOOO
FOOO
FOOO
FOOO
FOOD
FOO~

FOOO
FOOD
FOOD
FOOO
FOOO
FOO~

FOOO
FOOO
FOOO
FOO~

FOOO
FOOO
FOO~

FOOD
FOOD
FOO~

FOO~

I

"5
M.

MEMORY SIZE DET I
NMI INT
NMI-INT I
OBF-42 POST 1
PDST2
POS13
POST4
POSTS
POST6

MAP

FOO~

FOOD
FOOO
FOOD
FOOD
FOOD
FOOD
FOOD
FOOO
FOOD
FOOO
FOOD

FOOO
FOOD
FOOD
FOOD
FOOD
FOOD
FOOD
FOOD
FOOD
FOOO
FOOO
FOOO
FOOD
FOOO
FOOD
FOOD
FOO~

0000
0008
0010
0050
0396
03A2
OC96
OC96
r 052
IOB6
IOB9
10DA
1613
1671
1941
1941
195B
1915
1970
19A4
19B2
19FO
I A36
IM5
1 A59
I A69
IA70
I A85
IABI
I ABO
I AEF
IBIA
1828
I BCA
ICI8
ICI9
I C22
IC31
I C38
ID2A
IEB5
I EB5
IFB5
IFEI
2022
20E3
28C I
2All
2A2E
2A82
2C2B
314F
3112
31FE
3261
366C
3116
31AO
38BO
38EF
39BF
39E4
3AOC
3A23
3A41
3A6D
3A90
3B2F
3B8 r
38DB
3COD
3CeO
3CCE
3F12
3FF9
409E
40A8
40B2
4135
43BF
450 I
45BO
413F
47A9
483F
4888
bOOO
E020
E030
E040
E05E
E071
E090
EOA9
EOC2
EOOS
EOF4
EIOD

Publios by Value

Aba
Abs

POSTI
KbL

"4
START

I
C8042OSF 42
1"051'2
C21
SHUT3
SHUT2
SHUn
SHUT6
SHUT4
POST3
CMOS READ
POST4
CMOS WR I TE
DOS E MSG
P-MSG
ERR SEEP
BEEP
WAITF
CONFIG BAD
XPC BYTE
PRT-HEX
PRT-SEG
PROT PRT HEX
ROM CHECKSUM
ROM-CHECK
KBD-RESET
BLINK INT
SET TOO
011DUMMY RETURN 1
RE DIRECT
INT 287
PROC SHUTDOWN
POST5
SYSINITI
POST6
STGTST CNT
ROM ERR
XMIT 8042
BOOT-STRAP 1
DISKETTE 10 I
SEEK
-DISK tNT I
DSKETTE SETUP
01 SK SETUP
DISK-IO
HD INT
KEYSOARD 10 1
KB INT 1- KI6
SND DATA
PRINTER 10 r
RS232 10 1VIDEO-IO-I
SET MODESET-CTYPE
SET-CPOS
READ CURSOR
ACT
sp PAGE
SET-COLOR
VIDEO STATE
SCROLL UP
SCROLL-DOWN
READ AC CURRENT
WR I TE AC CURRENT
WR I TE-C CURRENT
READ DOT
WRITE DOT
WR 1TE-TTY
READ LpEN
MEMORY SIZE oET I
EQUIPMENT 1NMI INT 1CASSETTE 10 I
SHUT9
-GATE A20
TIME-OF DAY I
RTC TmpR I NT SCREEN I
TIMER-'NT 1 FILL BASIC
01
02
D2A
EIOI
EI02
EI03
EI04
EI05
EI06
EI07
EI08

or

FOOO
FOOO
FOOO
FOOO
FOOO
FOOO
FOOO
FOOO
FOOO
FOOD
FOOO
FOOD
FOOO
FOOO
FOOD
FOOD
FOOD
FOOO
FOOD
FOOO
FOOD
FOOD
FOOD
FOOO
FOOD
FOOD
FOOO
FOOD
FOOO
FOOO
FOOO
FOOO
FOOO
FOOO
FOOO
FOOO
FOOO
FOOO
FOOO
FOOD
FOOO
FOOO
FOOO
FOOO
FOOO
FOOO
FOOD
FOOO
FOOD
FOOD
FOOO
FOOD
FOOO

3116
FF54
41A9
lC31
1 A85
1 A69
lA10
19A4
FFFO
3B81
3AOC
3CBD
3FF9
lC19
I ABO
1ABI
1FB5
31M
413F
382F
3A90
28Cl
FF62
3A41
39E4
39BF
38EF
1828
IOB6
1052
1613
100A
10B9
43BF
FF23
366C
0050
1E85
ID2A
483F
45BO
FF66
FEF3
38BO
FOA4
3A6D
I A36
3BDB
3COD
3CCE
3F12
lFE\
1 A59

PRINTER [0 1
PR 1NT SCREEN
PR [NT- SCREEN t
PROC SHUTDOWN
PROT-PRT HEX
PRT 'HEX PRT-SEG
P MSG
P-O R
READ AC CURRENT
READ-CURSOR
READ-DDT
READ-LPEN
RE OTRECT
ROM CHECK
ROM-CHECKSUM
ROM-ERR
RS232 [0 \
RTC INT SCROLL DOWN
SCROLL-UP
SEEK
SEEKS t
SET COLOR
SET-CPOS
SET-CTYPE
SET-MODE
SET-TOO
SHUT2
SHUT3
SHUT4
SHUT6
SHUn
SHUT9
SLAVE VECTOR TABLE
SND DATA
START I
STGTST CNT
SYSINITI
TIMER INT I
TIME OF DAY I
TUTOR VECTOR TABLE
VIDEO To 1
V IOEO-PARMS
V [OED-STATE
WA ITFWR I TE AC CURRENT
WR I TE-C CURRENT
WR I TE-DOT
WR 1TE-TTY
XMIT 8042
XPC_BYTE

FOOD
FOOO
FOOD
FOOD
FOOD
FOOO
FOOD
FOOD
FOOO
FOOD
FOOD
FOOO
FOOD
FOOD
FOOO
FOOD
FOOD
FOOD
FOOD
FOOO
FOOO
FOOO
FOOD
FOOD
FOOD
FOOD
FOOD
FOOO
FOOO
FOOD
FOOD
FOOO
FOOD
FOOO
FOOO
FOOD
FOOO
FOOD
FOOD
FOOD
FOOO
FOOO
FOOO
FOOO
FOOO
FOOD
FOOO
FOOD
FOOO
FOOO
FOOO
FOOO
FOOD

EI26
EI3F
EI68
E19\
EI81
EIOB
EIEE
E209
E224
E239
E250
E2C3
E2C6
E2EA
E30E
E3\E
E32E
E343
E364
E319
E38E
E3AC
E38F
E3D2
E3DF
E40 I
E6F5
E129
E81E
E886
E88E
E8C8
E8EI
E91B
E955
E95F
E969
E916
EFC1
FOM
FOE4
FOEC
FOF4
FA6E
FEF3
FF23
FF53
FF54
FF5A
FF5E
FF62
FF66
FFFO

El09
EI61
EI62
E163
EI64
E201
E202
E203
E301
E302
F3D
NMI INT
E303
E304
E401
E501
E601
E602
FI180
F1181
FI182
FI190
F119\

F3A
F30\
FO TBL
CONF TBL

AI

-

K.
K1
K8
K9

KIO
Kl1
K 12
K13
K 14

K 15
DISK BASE
V IDEO PARMS

.5

.,••

-

CRT CHAR GEN
VECTOR TABLE
SLAVE VECTOR TA8LE
OUMMY-RETURNPR [NT-SCREEN
HRO FLOPPY
SEEKS I
TUTORP _O_R

THE
8105
ROUTINES
ARE
MEANT
TO
BE
ACCESSED
THROUGH
SOFTWARE
INTERRUPTS
ONLY.
ANY
ADDRESSES
PRESENT
1N
THESE
LIST I NGS
ARE
INCLUDED
ONL Y
FOR
COMPLETENESS,
NOT
FOR
REFERENCE.
APPL I CAT [ONS
WH I CH
REFERENCE
ANY
ABSOLUTE
ADDRESSES
WITH I N
THE
CODE
SEGMENTS
OF
810S
VIOLATE
THE
STRUCTURE
AND
DESIGN
OF
8105.
ADDRESSES
WITH I N
THE
810S
CODE
SEGMENT
ARE
SUBJECT
TO
CHANGE
AND
ROUT I NES
SHOULD
BE
ACCESSED
THROUGH
PO I NTERS
IN
THE
I NTERRUPT
VECTORS
OR
WHEN
NECESSARY
THROUGH
THE
POINTERS
[N
THE
8105
~OATA"
SEGMENT.

MAP

5-27

IBM Personal Computer MACRO Assembler
TESTI ---- 06/10/85
POWER ON SELF TEST
1
2
3

Version 2.00
(POST)

PAGE 118,121
TITLE TESTI ---- 06/I0/8S
.286C

•

1-1
06-10-8S

POWER ON SELF TEST

(POST)

5
6

1

8105

•

9
10

I/O INTERFACE
THESE LISTINGS PROVIDE INTERFACE INFORMATION FOR ACCESSING
THE BIOS ROUTINES.
THE POWER ON SELF TEST rs INCLUDED.

11
12
13

THE
BIOS
ROUTINES
ARE
MEANT
TO
BE
ACCESSED
THROUGH
INTERRUPTS
ONLY.
ANY
ADDRESSES
PRESENT
IN
SOFTWARE
THESE
LISTINGS
ARE
INCLUDED
ONLY
FOR
COMPLETENESS,
NOT FOR
REFERENCE.
APPL I CAT IONS
WH I CH
REF~RENCE
ANY
ABSOLUTE
ADDRESSES
WITH I N THE
CODE
SEGMENTS
OF
B I OS
VIOLATE
THE
STRUCTURE
AND
DESIGN
OF
BIOS.

I.
15
"
16

11

19

20
21

22

23

2.

MODULE REFERENCE

25
26

TEST! .ASM
DSEG.INC
POS TEQU. INC
SYSDATA. INC

21

2.

29
30
31

-->
-->

TEST2.ASM

32
33

lEST3. ASM
TEST4.ASM

3.

-->
-->

35
36

31
3B
39

.0

"'2
43

4.
'5

'6

".B
49
50
51

52
53

5.
55
56
51

5B

TESTS.ASM

59
60

61

62

TEST6.ASM

63

6.
65

66
61
6B
69
10

DSKETTE. ASM

11
12

,.

DISK.ASM

16
11

KYBD.ASM

-->

13

18
PRT .ASM
RS232.ASM
VIDEOI.ASM
BIOS.ASM

B.

B5

B6
B1

810S1.ASM

BB
B9
90
91

92
93

9.
95
96
91
9B

99
100
101
102
103
10.
105
106
101
lOB
109
110

BIOS2.ASM

ORGS.ASM

LIST

TESTl

OISKETTE 8105
DISKETTE 10 I
DISK INT-l OSKETTE SETUP
FIXED DISK BIOS
DISK SETUP
DISK-IO

KE~~0!~6 8105

15

19
BO
B1
B2
B3

POST AND MANUFACTURING TEST ROUTINES
DATA SEGMENTS LOCATIONS
COMMON EQUATES FOR POST AND 8105
POWER ON SELF TEST EQUATES FOR PROTECTED MODE
POST TEST. 0 1 THROUGH TEST. 16
POST TEST AND INITIALIZATION ROUTINES
POST TEST. 1 7 THROUGH TEST. 22
POST EXCEPT I ON I NTERRUPT TESTS
POST AND BIOS UTILITY ROUTINES
CMOS READ
- READ CMOS LOCATI ON ROUT INE
CMOS-WRITE
- WRITE CMOS LOCATION ROUTiNE
DDS - LOAD (OS:) WITH DATA SEGMENT
E MSG
- POST ERROR MESSAGE HANDLER
MFG HAL T
- MANUF ACTUR I NG ERROR TRAP
- POST STRING DISPLAY ROUTiNE
P MSG
ERR 8EEP
- POST ERROR BEEP PROCEDURE
BEEP
- SPEAKER BEEP CONTROL ROUT I NE
WAITF
- FIXED TIME WAIT ROUTINE
CONFIG BAD
- SET BAD CONFIG IN CMOS DIAG
XPC BYTE
- D I SPLA Y-HEX BYTE AS 00-- FF
PRT-HEX
- DISPLAY CHARACTER
PRT-SEG
- 01 SPLAY SEGMENT FORMAT ADDRESS
PROT PRT HEX
- POST PROTECTED MODE DISPLAY
ROM CHECKSUM
- CHECK ROM MODULES FOR CHECKSUM
RON-CHECK
- ROM SCAN AND I NIT I AL f ZE
KBD-RESET
- POST KEYBOARD RESET ROUT I NE
BLINK INT
- MANUFACTURING TOGGLE BIT ROUTINE
SET TOO
- SET TI MER FROM CMOS RTC
- DUMMY I NTERRUPT HANDLER
-> I NT 7?H
D 1 1RE 0 I RECT
- HARDWARE I NT
9 RED I RECl (L 2)
INT 287
- HARDWARE INT 13 REDIRECT (281)
PROC SHUTDOWN - 80286 RESET ROUT I NE
EXCEPTToN I NTERRUPT TEST HANDLERS FOR POST TESTS
SYSINITI
- BUILD PROTECTED MODE POINTERS
GOT BlD
- BUILD THE GOT FOR POST
SlOT BLO
- BUILD THE lOT FOR POST
POST TESTS AND SYSTEM BOOT STRAP
STGTST CNT
- SEGMENT STORAGE TEST
ROM ERR
- ROM ERROR 0 I SPlA Y ROUT I NE
XMIT 8042
- KEYBOARD DIAGNOSTiC OUTPUT
BOOT:::STRAP
- BOOT STRAP LOADER
-INT 19H

-->
-->

-

INT 13H BIOS ENTRY (40H)
-INT 13H
HAROWARE INTERRUPT HANDLER -INT OEH
POST SETUP DR I VE TYPES

-

SETUP 0 I SK VECTORS AND TEST
INT 13H BIOS ENTRY
-INT 13H

- HARDWARE INTERRUPT HANDLER -INT 16H

KEYBOARD 10 I - INT 16H BIOS ENTRY
-INT 16H
KB I NT 1- - HARDWARE I NTERRUPT
-I NT 09H
SNO DATA
- KEYBOARD TRANSMISSION
PRINTER 'ADAPTER BIOS
-INT l1H
COMMUNICATIONS BIOS FOR RS232
-INT 14H
VIDEO BIOS
-INT IOH
BIOS ROUTINES
MEMORY 5 I ZE DET 1 - REAL MODE SIZE
12H
EQU I PM~NT 1- -EQU I PMENT DETERM I NAT I ON
-INT llH
NMI INT ,- NMI HANDLER
-INT 02H
I NTERRUPT- j 5H B I OS ROUT I NES
-INT 15H
DEV OPEN
- NULL DEV I CE OPEN HANDLER
DEV-CLOSE
- NULL DEV I CE CLOSE HANDLER
PROG TERM
- NULL PROGRAM TERM I NAT I ON
EVENT WA I T
- RTC EVENT WA I T IT I MEOUT ROUTI NE
JOY STICK
- -JOYSTICK PORT HANDLER
SYS-REQ
- NULL SYSTEM REQUEST KEY
WAIT
- RTC TIMED WAIT ROUTiNE
BLOCKMOVE
- EXTENDED MEMORY MOVE INTERFACE
GATE A20
- ADDRESS 81T 20 CONTROL
EXT MEMORY
- EXTENDED MEMORY SIZE DETERM I NE
SET-VMODE
- SW I TCH PROCESSOR TO V I RTUAL MODE
DEVTcE BUSY
- NULL DEVICE 8USY HANDLER
I NT COMPLETE
- NULL I NTERRUPT COMPLETE HANDLER
B I OS TNTERRUPT ROUT I NES
TIME OF DAY' - TIME OF DAY ROUTINES
-INT IAH
RTC TNT- I RQ LEVEL 8 ALARM HANDLER
- I NT 10H
PR I NT SCREEN' - PR I NT SCREEN ROUT I NE
-I NT OSH
TlMER-'NT 1
- TIMERI INTERRUPT HANDLER
->INT lCH
COMPATIBILITY MODULE
POST ERROR MESSAGES
DISKETTE - DISK - ,VIDEO DATA TABLES

IBM
TESTI

Computer MACRO A55embler
Ver5ion 2.00
---- Ob/l0/65
POWER ON SELF TEST (POST)
DSEG.INC - DATA SEGMENTS

Per~onal

111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
12b
127
128
129

C

e

0006
0008

????????

0014
0014 ???777??
0020
0020

????????

0040
0040

?????7??

004C
004C ????7???
0060
0060

?????7??

139
140
141
142
143
144

0014
0014 ???"?"
0018
0018

154
155
156

163
I b4
1 b5
166
161
168
169
170
111
112
173
114

NON-MASK ABLE

INTERRUPT VECTOR

IPINT5_PTR

ORG
4·005H
DO?

PRINT SCREEN

INTERRUPT VECTOR

III I NT_PTR

ORG
4·008H
DO?

HARDWARE

IIIVIDEO_INT

ORG
4·010H
DO?

VIDEO

1II0RG_VECTOR

ORG
4·013H
DO?

DISKETTE/DI SK

IIIBASIC_PTR

ORG
DD

POINTER TO CASSETTE BASIC

IIIPARM_PTR

ORG
4·01DH
DO?

POINTER TO VIDEO PARAMETERS

IPDISK_POINTER

ORG
4·01EH
DO?

POINTER TO DISKETTE PARAMETER TABLE

IlIEXT _PTR

ORG
4·01FH
DO?

PO I NTER TO GRAPH I C CHARACTERS

IIIDISK_VECTOR

ORG
4·040H
DO?

POINTER TO DISKETTE

IlIHF_TBL_VEC

ORG
4·041H
DO?

POINTER TO FIRST DISK PARAMETER TABLE

IIIHF1_TBL_VEC

ORG
4·046H
DO?

POINTER TO SECOND DISK PARAMETER TABLE

iIISLAVE_INT_PTR

DRG
4·070H
DO?

POINTER TO SLAVE

@HDISK_INT

ORG
DO

POINTER TO FIXED DISK

IPTOS

ORG
0400H
OW?

C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C

c

????????

C
C

INTERRUPT VECTOR TABLE

INTERRUPT POINTER

0104
0104 ????????

e
e

aI

e

4·018H
")

I/O

(8-F)

INTERRUPT VECTOR

INTERRUPT VECTOR

128-255

C
INTERRUPT CODE

C

C

18
011817117???

C

01CO
OICO

????????

C
C

0108
0108

????????

C
C

C

160
161
162

START OF

ORG
4·002H
DO?

001C
001C ????17??

157
158
159

DB

PNMI_PTR

0100
0100

????1717

151
152
153

IPSTG_LOCO

C

C
C
C
C
C

145
146
141
148
149
150

C
C
C

C

136
131
138

; ------------ ----------------------------

C
0000

133
134
135

PAGE
INCLUDE DSEG. INC

C;
80286 INTERRUPT LOCAT IONS
C;
REFERENCED BY POST & B I OS
; -- ---------- ---------------------------C
C
C
SEGMENT AT 0
ADDRESS= 0000;0000

130
131
132

1-2
06-10-65

INTERRUPT HANDLER

C
4·016H
")

INTERRUPT CODE

C

0400
0400 ????

C
C

0500
0500

C
C
C

C

1COO
1COO
7eOO

(ioMFG_TEST_RTN
C
C
C
IlIBOOT_LOCN
C
CASSO

~G

STACK -- USED DURING POST ONLY
USE WILL OVERLAY INTERRUPTS VECTORS

LABEL

0500H
FAR

LOAD LOCATION FOR MANUFACTURING TESTS

ORG
LABEL

1COOH
FAR

BOOT STRAP CODE LOAD LOCATION

ENDS

TESTl

5-29

1-3

IBM Pereonal Computer MACRO Aseembler
Version 2.00
TESTI ---- Ob/10/85
POWER ON SELF TEST (POST)
OSEG.INC - DATA SEGMENTS

"5
".

C
C

117

"B
"9
IBO

IBI
IB2
IB3
lB.
IB5
lB.
IB7
IBB
IB9
190
191
192
193
19'
195
19.
197
19B
199
200
201
202
203
20.
205
20.
207
20B
209
210
211
212
213
21'
215
21.

2.7
2'B
2'9
250
251
252
253
25.
255
25.
257
25B
2.9
2.0

2.,

2.2
2.3
2 ••
2 ••
2 ••
2.7
2.B
2.9
270

DATA

C
C
C

C

C
C

ttEQUIP FLAG
ttMFG TST
PMEMORY SIZE
PMFG_ERR_FLAG

C

;

C
C

;--

;

C
C

C
C
C
C

C

SEGMENT AT 40H

ADDRESS= 0040: 0000

DW
DW
DW
DW
DW
DW
DW
DW
DW
DB
DW
DB
DB

BASE ADDRESSES OF RS232 ADAPTERS
SECOND LOGICAL RS232 ADAPTER
RESERVED
RESERVED
BASE ADDRESSES OF PRINTER ADAPTERS
SECOND LOGICAL PRINTER ADAPTER
THIRD LOGICAL PRINTER ADAPTER
RESERVED
INSTALLED HARDWARE FLAGS
INITIALIZATION FLAGS
BASE MEMORY SIZE IN K BYTES
(X 1024)
SCRATCHPAD FOR MANUFACTUR I NG
ERROR CODES

- -- - - -- -- - - - - -- - - - - ---- - - - ---- -- - --- - - -DATA AREAS
1
-----KEY80ARD
- ----- - - ----- - - ---- - -- --- - - - - - - --

C
C

DB
DB
DB

ttKB FLAG
ttKB-FLAG 1
PAL"f INPUT
tt8UFFER HEAD
PBUFFER:TAIL

; ------

KEYBOARD SHIFT STATE AND STATUS FLAGS
• SECOND 8YTE OF KEYBOARD STATUS
; STORAGE FOR ALTERNATE KEY PAD ENTRY
I PO [NTER TO HEAD OF KEYBOARD 8UFFER
; PO I NTER TO TAl L OF KEY80ARD 8UFFER

DW
DW
HEAD

C
C

= TAIL
DW

INDICATES THAT THE BUFFER IS EMPTY
16 DUP!?}

ROOM FOR 15 SCAN CODE ENTR I ES

C
C
C

C
C
C

;I

----- - DISKETTE
----- -- - --- - -- --- -- - - ---- - - - ---DATA AREAS
:

C
C

DB

DRIVE RECALI8RATION STATUS
BIT 3-0 = DRIVE 3-0 RECALIBRATION
BEFORE NEXT SEEK IF BIT IS =
MOTOR STATUS
BIT 3-0 '" DRIvE 3-0 CURRENTLY RUNNING
BIT 1 = CURRENT OPERATION IS A WRITE
T I ME OUT COUNTER FOR MOTOR ( S) TURN OFF
RETURN CODE STATUS 8YTE

C
C
C
C
C
C

C
C

a

DB
IPMOTOR COUNT
DB
IPDSKETTE_STATUS DB

DB

C
C

1 DUP(?)

II

~~~T~~O~~TE~ N F~6~C~ I ~~~T~~ S~p~~~~~6~ON

C
C

C

0049
004A
004C
004E
0050

??
1111
111?
1111
OB

???1
OObO
0062
0063
0065
0066

11??
1?
1?1?
11
1?

;--

C
C

I

C
C
C
C
C
C

OCRT MODE
II'ICRT-COLS
IPCRT-LEN
PCRT-START
ttCURSOR_POSN

DB
OW
OW
OW

C
C
C
C

II.'ICURSOR MODE
II'IACT I VE-PAGE
OADDR 6845
II'ICRT MODE SET
OCRT:PALETTE

OW
DB
OW
DB
DB

;

ow

CURRENT 01 SPLAY MODE I TYPE)
NUMBER OF COLUMNS ON SCREEN
LENGTH OF REGEN BUFFER I N BYTES
STARTING ADDRESS IN REGEN BUFFER
CURSOR FOR EACH OF UP TO 8 PAGES

?
?
8 DUPIn

c
c

I

;
0061
0069
006B

------------ --- --- ----- - - - ----- -----VIDEO DISPLAY DATA AREA
:
-- -- ------ ------ -- --------- --- ----- ----

C

c

2.,

2 ••

--- ------------------------ - ---- - -- ---ROM 8105 DATA AREAS
:
-- --- ----- ----- - - ----- -- ---- - -- ----- - --

C
C

22'
225

2.3
2 ••
2.5

;

;

C
C

219
220
221
222
223

2.2

;

C
C
C

C
C

2"
21B

22.
227
22B
229
230
231
232
233
23.
235
23.
237
23B
239
2.0

PAGE

C

C
C

06-10-85

11?1
11?1
11

POST AND BIOS WORK DATA AREA

- --- - -- - -- -- - - ---- - ---- - - - - - -- - - - ---- ---

010 ROM INIT
OIO-ROM-SEG
11'1 I NTR_FLAG

;
;
C

CURRENT CURSOR MODE SETT I NG
CURRENT PAGE BEING DISPLAYED
BASE ADDRESS FOR ACTIVE DISPLAY CARD
CURRENT SETT I NG OF THE 3X8 REG I STER
CURRENT PALETTE SETTI NG - COLOR CARO

STACK SAVE, etc.
POINTER TO ROM INITIALIZATION ROUTINE
PO I NTER TO I / a ROM SEGMENT
FLAG INDICATING AN INTERRUPT HAPPENED

DW
DW
DB

- ---- -- - - - --- - --- - - - - -- - - - - --- - - - - - -- --TIMER DATA AREA

; ----------------------------------------

C
006C
006E
0010

0011
0012

1111
1??1

"

C

C

C
C
C
C

11
1???

IPBIOS BREAK
ttRESET]LAG

C

C
C
C
C
C

C
C

DW
DW
DB

;
;
;

LOW WORD OF T I MER COUNT
HIGH WORD OF T I MER COUNT
TIMER HAS ROLLED OVER SINCE LAST READ

-- -- ------ -----DATA
- - ------------- -------------- -- -SYSTEM
---- ------- AREA
- - - - - - - - - - - - - - - - -- - --

C
C

C

TESTl

;

;

272
273
27.
275
27.
217
27B
279

5-30

;

C
C

271

0014
0015
0016
0011

OTIMER LOW
ttT I MER-H I GH
IPTI MER:OFL

DB

DW

I
;

BIT 7=1 IF BREAK KEY HAS BEEN PRESSED
WORD= 1 234H I F KEYBOARD RESET UNDERWAY

I - - - - - --- - - -- ---- - - - - - - - - - - - - - -- - - -- - ---;
FIXED DISK DATA AREAS
~
ODISK STATUS!
ttHF NUM
OCONTROL BYTE
OPORT_OFF

DB
DB
DB
DB

FIXED DISK STATUS
COUNT OF FIXED DISK DRIVES
HEAD CONTROL 8YTE
RESERVED ~ PORT OFFSET)

IBM Personal Computer MACRO Assembler
Version 2.00
TESTI ---- 06/10/65
POWER ON SELF TEST (POST)
OSEG.INC - DATA SEGMENTS

280
281
282
283
28.
285
0076 11
286
0079 ??
281
001A 11
288
001B ??
289
007C
290
0010
291
001E ??
292
007F 11
293
29.
295
296
291
298
299
0080 11??
300
0082 ????
301
302
303
3D.
305
306
0084 11
301
0065 ????
308
0067 ??
309
0088 11
310
0089 11
311
008A ??
312
313
31'
315
316
311
008B 11
318
OGBC ??
319
0080 ??
320
008E 11
321
OOBF 11
0090 11
322
323
0091 ??
32.
0092 11
325
0093 ??
326
0094 ??
321 • 0095 11
328
329
330
331
332
0096 ??
333
33.
0097 11
335
336
331
338
339
3.0
0098 ??
3.,
009A 11
009C ??
3'2
343
009E ??
3 ••
OOAO ??
3.5
3'6
3"
3.8
3.9
350
OOAI
01 [
351
11
352
353
35.
355
356
351
358
00A8 1111??1?
359
360
361
362
363
36.
365
0100
366
361
0100 ??
368
369
310
0101
311
312

1-'

06-10-85

PAGE

;- - -------------------------------------;
TIME-OUT VARIABLES
:
;
------ --

---- ----

--- --- --- ----- --- --

G!lPRINT_TIM_OUT

n

ORS232_ TIM_OUT

;
;

;

- -- -- - - - - -- - - - - - - - - - -- - - - - -- - - - -- -- - ---KEYBOARD DATA AREA
----- - - ADDITIONAL
---- - ---- - -------- - - ---- - - - -- - --

G!lBUFFER START
G!lBUFFER:END

;

T I ME OUT COUNTERS FOR PR [NTER RESPONSE
SECOND LOG I CAL PR [NTER ADAPTER
TH I RD LOG I CAL PR I NTER ADAPTER
RESERVED
T I ME OUT COUNTERS FOR RS232 RESPONSE
SECOND LOG I CAL RS232 ADAPTER
RESERVED
RESERVED

DB
DB
DB
DB
DB
DB
DB
DB

; BUFFER LOCATION WITHIN SEGMENT 40H
; OFFSET OF KEYBOARD BUFFER START
; OFFSET OF END OF BUFFER

ow
ow

- - --- - - - - - - - - - -- - - - ---- - - -- - - - - - - - - - - - --

;
EGA/PGA DISPLAY WORK AREA
1--- ---- - - - - - - - - - - - - - - - - - - - - - - - - - - --- - --OROWS
OPOINTS
OINFO
OINFO_3

;
;

;

OW
DB
DB
DB
DB

I)

- - - - -- - - - -- - - - - -- - -- ---- - --- -- - --- - - ---ADDITIONAL MEDIA DATA
----- - --- - - ---- - - - -- - - --- - - - --- - - - -- - --

G!lLASTRATE
IPHF STATUS
IPHF-ERROR
OHF-I NT FLAG
IlIHF-CNTRL
IPOSK_STATE
C

e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
C
e
e
e
e
e
e
e
e
e
e
e
e

ROWS ON THE ACT I VE SCREEN (LESS
BYTES PER CHARACTER
MODE OPT IONS
FEATURE BIT SWITCHES
RESERVED FOR 0 I SPLAY ADAPTERS
RESERVED FOR 0 I SPLA Y ADAPTERS

DB

OOSK_TRK

; --;

DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB

LAST DISKETTE DATA RATE SELECTED
STATUS REGI STER
ERROR REG I STER
F I XED 0 I SK I NTERRUPT FLAG
COMBO FIXED DISK/DISKETTE CARD BIT 0=1
DRIVE
MEDIA STATE
DRIVE 1 MEDIA STATE
DRIVE 0 OPERATION START STATE
DRIVE 1 OPERATION START STATE
DRIVE 0 FRESENT CYLINDER
DR I VE 1 PRESENT CYL I NDER

a

-----ADDITIONAL
- ----- - --------------- ------ ---KEYBOARD FLAGS

; ---------------------------- -----------OKB FLAG 3
OKB:FLAG:2

;
I

DB
DB

KEYBOARD MODE STATE AND TYPE FLAGS
KEYBOARD LED FLAGS

--- - - - -- - - ---- - - --- -- - - -- - - ---REAL T I ME CLOCK DATA AREA

; ------ - - ;

OUSER FLAG
OUSER-FLAG SEG
OoRTC COW G!lRTC-H I GH
OoRTC:WA IT_FLAG

ow
OW
DW

ow

DB

- - -- ---- - ---- - - -- -- ----- - ---- - ------ ---;
AREA FOR NETWORK ADAPTER
,--------- - ------ ---- -- ----------- - - - ---

OFFSET ADDRESS OF USERS WA I T FLAG
SEGMENT ADDRESS OF USER WA I T FLAG
LOW WORD OF USER WA I T FLAG
HIGH WORD OF USER WAIT FLAG
WAIT ACTIVE FLAG {OI=BUSY. 60=POSTED}
(OO=POST ACKNOWLEDGED}

;

ONET

;
;

;

DB

RESERVED FOR NETWORK ADAPTERS

1 OUP!?)

- - -- - --- - --- - - - -- - - -- - - - - -- -- - --- - - - ---EGA/PGA PALETTE POINTER
--------- ---------- - ---------- - -------DO

;

PO I NTER TO EGA PARAMETER CONTROL BLOCK

,

RESERVED

;

ADORESS= 0040:

- - - - - - --- - - - - - - - - - - - --- - - ---- - ----- - ---OATA AREA - PRINT SCREEN
I
; ---------- - ------ --- - -- ---------- ---- --;
;

DRG

DATA

100H

a 100

(REF 0050: 0000)

DB

; PRINT SCREEN STATUS BYTE
OO=READY 10K,
01 =BUSY,
FF=ERROR

ENOS

I

END OF BIOS DATA SEGMENT

.LlST

TEST1

5-31

IBM Personal Computer MACRO Assembler
Version 2.00
TESTI ---- 06/10/65
POWER ON SELF TEST (POST)
POSTEQU.INC - COMMON EQUATES

373
374
375
376
377
378
37.
380
381
382
383
384
385
386
387
388
38.
3'0
3.,
3'2
3.3
3.4
3'5
396
3.7
3'8
3"
400
401
402
403
404
405
406
407
408
40.
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
42.
430
431
432
433
434
435
436
437
438
43.
440
441
442
443
444
445
446
447
448
44.
450
451
452
453
454
455
456
457
458
45.
460
461
462
463
464
465
466
467
468
46.
470
471
472
473
474
475
476
477
478
47.
480
481
482
483
484
485

C

PAGE
INCLUDE POSTEQU. INC

C

;

C
C

•

C
0
0
0
0
0

0
0
0
0

0
0
0
0

0

0
0
0
0
0
0
0
0
0

0
0
0

0

OOFC
0000
000 I
F6A7
F9FD

C
C

C
C
C
C
C
C
C
C
C
C

0060
0061
00F3
OOOC
OOCO
000 I
0002
00 I 0
0020
0040
0060
0064
0001
0002
0004
0008
0010
0020
0040
0080

C
C
C
C
C

C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C

0008
0010
0020
0040
0080

C
C
C
C
C
C
C
C
C
C

0060
OOAA
00A8
00.1.0
OOAE
OOCO
0000
DOoF
OOEO
OOFE
0001

C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C

ODED
00F2
00F4
OOAA
OOFA
OOFE
DOFF
0001
0002
0004
0008
00 I 0
0020
0040
0080

C
C
C
C
C
C

;

1-5
06-10-85

- - - ---- - - - - - --- - --- --- - --- - - ------ - - -- -EQUATES USED BY POST AND B I OS
- ---- - - ---- - - - - - - - - - - - - - - - - - - - - - ---- - ---

MODEL BYTE
SUB MODEL BYTE
BIOS LEVEL
RATE-UPPER
RATE::::LOWER

EOU
EOU
EOU
EOU
EOU

1--------- 8042
PORT A
PORT-B
RAM PAR ON
RAM-PAR-OFF
PARTTY ERR
GATE2 SPK2
REFRESH BIT
OUT2
10 CHECK
PARITY CHECK
STATUS-PORT
OUT 8UF FULL
I NPT BUF FULL
SYS FLAGCMD-DATA
KYBD INH
TRANS TMOUT
RCV TM"OUT
PARTTY_EVEN

KEYBOARD INTERFACE AND DIAGNOSTIC CONTROL REGISTERS -----------EQU
060H
8042 KEYBOARD SCAN CODE/CONTROL PORT
EQU
061H
PORT B READ/WRITE DIAGNOSTIC REGISTER
EQU
111100/18
AND MASK FOR PARITY CHECKING ENABLE ON
EQU
OOOOIIOOB
OR MASK FOR PARITY CHECKING ENABLE OFF
EQU
I 1000000B
R/W MEMORY - I/O CHANNEL PAR I TY ERROR
EQU
0000000IB
TIMER 2 INPUT GATE CLOCK BIT
EQU
00000010B
SPEAKER OUTPUT DATA ENA8LE BIT
EQU
000100008
REFRESH TEST BIT
EQU
00100000B
SPEAKER TIMER OUT2 INPUT BIT
EQU
01000000B
I/O (MEMORY) CHECK OCCURRED BIT MASK
EQU
100000008
MEMORY PARITY CHECK OCCURRED BIT MASK
EQU
064H
8042 STATUS PORT
EQU
000000018
0 = +OUTPUT BUFFER FULL
EQU
000000 108
I
+ I NPUT BUFFER FULL
EQU
000001008
2 = -SYSTEM FLAG -POST/-SELF TEST
EQU
0000 I 0008
3 = -COMMAND/ +DATA
EQU
000100008
4
+KEYBOARD INHIBITED
EQU
001000008
5
+TRANSMIT TIMEOUT
EQU
010000008
6 = +RECEIVE TIME OUT
EQU
100000008
7
+PARITY IS EVEN

8042
BASE MEM8
BASE-MEM
MFG LOOP
DSP-..JMP
KEY::::BD_INHI8

INPUT PORT BIT DEFINITION
EQU
000010008
EQU
OOOIOOOOB
•
EQU
00100000B
;
EQU
OIOOOOOOB
;
EQU
10000000B
;

; --------- 8042
WRITE 8042 LOC
SELF TEST INTR-FACE CK
DIS 'K8D
ENA-K80
READ 8042 INPUT
DISABLE BTT20
ENABLE BIT20
KYBD CLK DATA
SHUT-CMDKYBD::::CLK

COMMANDS ------------------------------------------------------EQU
060H
WRITE 8042 COMMAND 8YTE
EQU
OAAH
8042 SELF TEST
EQU
OABH
CHECK 8042 INTERFACE COMMAND
EQU
OADH
DISABLE KEYBOARD COMMAND
EQU
OAEH
ENABLE KEYBOARD COMMAND
EQU
OCOH
READ 8042 I NPUT PORT
EQU
ODDH
DISABLE ADDRESS LINE BIT 20
EQU
ODFH
ENABLE ADDRESS LINE BIT 20
EQU
OEOH
GET KEYBOARD CLOCK AND DATA COMMAND
EQU
OFEH
CAUSE A SHUTDOWN COMMAND
OOIH
KEYBOARD CLOCK BIT 0
EQU

OFCH
OOOH
OOIH
OF8A7H
OF9FoH

SYSTEM MODEL BYTE
• SYSTEM SUB-MODEL TYPE
; BIOS REVISION LEVEL
OF952H + 1 OX
; OF952H -lOX

I

=
=
=
=

;---------- KEYBOARD/LED COMMANDS
LED CMD
EQU
OEDH
KB READ 10
EQU
OF2H
K8:ENABLE
EQU
OF4H

;
;
;

SAVED IN !lIMFG TST -------------------BASE PLANAR R/W MEMORY EXTENSION 640/X
BASE PLANAR R/W MEMORY SIZE 256/512
LOOP POST ..JUMPER BtT FOR MANUFACTURING
DISPLAY TYPE SWITCH ..JUMPER BIT
KEY80ARD INHIBIT SWITCH BIT

LED WR I TE COMMAND
READ KEY80ARD 10 COMMAND
KEY80ARD ENABLE

; -- -------- 8042 KEYBOARD RESPONSE ------------ ----- ---------------------------KB OK
EQU
OAAH
; RESPONSE FROM SELF 0 I AGNOST I C
K8-ACK
EQU
OFAH
; ACKNOWLEDGE FROM TRANSMISSION
KB-RESENo
EQU
OFEH
; RESEND REQUEST
K8:0VER_RUN
EQU
OFFH
; OVER RUN SCAN CODE
;---------- FLAG EQUATES WITHIN
OKB FLAG -------------------------------------RIGHT SHIFT
EQU
OOOOOOOIB
RIGHT SHIFT KEY DEPRESSED
LEFT SHIFT
EQU
000000108
LEFT SHIFT KEY DEPRESSED
CTL SHIFT
EQU
000001008
CONTROL SHIFT KEY DEPRESSED
ALT-SHIFT
EQU
000010008
ALTERNATE SHIFT KEY DEPRESSED
SCROLL STATE
EQU
0001 OOOOB
SCROLL LOCK STATE HAS BEEN TOGGLED
NUt.! STATE
EQU
001000008
NUM LOCK STATE HAS BEEN TOGGLED
CAPS STATE
EQU
OIOOOOOOB
CAPS LOCK STATE HAS BEEN TOGGLED
INS_STATE
EQU
100000008
INSERT STATE IS ACTIVE

C
C
C
C
C

0004
0008
0010
0020
0040
0080

C
C
C
C
C
C

0007

C
0010
0020
0040
0080

C
C

C
C
C
C
C
C
C
C
C

0001
0002
0004
0020
0040
0080

C

C

;---------- FLAG EQUATES WITHIN
!lIKB FLAG 1 -----------------------------------SYS SHIFT
EQU
000001008
-SYSTEM KEY DEPRESSED AND HELD
HOLD STATE
EQU
00001000B
SUSPEND KEY HAS BEEN TOGGLED

~B~O~~T~~IFT

~~~

~~~ 6~~~~~

; ~~:O~~C~O~~Y K~~

CAPS SH I FT
INS_SHIFT

EQU
EQU

01 OOOOOOB
10000000B

;
;

b~p~~~~~6SED

CAPS LOCK KEY I S DEPRESSED
INSERT KEY IS DEPRESSED

;---------- FLAGS EQUATES WITHIN
!lIKB FLAG 2 ----------------------------------K8 LEOS
EQU
00000111B
'KEYBOARD LEO STATE 81TS

~B

-FA
K8-FE
KB-PR LED
KS:ERR

~~~

EQU
EQU
EQU

~~~~ 6~~~~

001 OOOOOB
010000008
100000008

; ~~~~~~~~o~~~~i ~~c~~~~b
;
;
;

RESEND RECE I VED FLAG
MODE INDICATOR UPDATE
KEYBOARD TRANSMIT ERROR FLAG

;---------- FLAGS EQUATES WITHIN
!lIK8 FLAG 3 ----------------------------------K8X
EQU
OOOOOOOIB
- ; RBX INSTALLED
LC HC
EQU
000000108
LAST SCAN CODED WAS A HIDDEN CODE
GRAPH ON
EQU
00000100B
ALL GRAPHICS KEY DOWN (W.T. ONLY)

N~M

;ET
LC A8
RO:ID

LK
-

~~~

~~~6~~~g~

EQU
EQU

010000008
10000000B

~~~~~V~BM (~g~~ ~~ ~~~g) 10

AND K8X
LAST CHARACTER WAS FIRST ID CHARACTER
DOING A READ 10 IMUST BE BITO)

C
0

0
0
0
0
0
0
0
0
0
0

C
C
C
C
C
C

00A8
0041
0038
0010
003A
0053
0052
002A
0045
0036
0046
0054

5-32

C
C
C

C

TESTl

; ---------- KEYBOARD SCAN CODES
10 I
EQU
OABH
10-2
EQU
041H
AL T KEY
EQU
56
CTL -KEY
EQU
29
CAPS KEY
EQU
58
DEL 'KEY
EQU
83
INS-KEY
EQU
82
LEFT KEY
EQU
42
NUM 'KEY
EQU
69
RIGHT KEY
EQU
54
SCROLL KEY
EQU
70
SYS_KEY
EQU
84

I ST 10 CHARACTER FOR KBX
2ND 10 CHARACTER FOR K8X
SCAN CODE FOR
ALTERNATE SHIFT KEY
SCAN CODE FOR
CONTROL KEY
SCAN CODE FOR
SH I FT LOCK KEY
SCAN CODE FOR
DELETE KEY
SCAN CODE FOR
I NSERT KEY
SCAN CODE FOR
LEFT SH I FT
SCAN CODE FOR
NUMBER LOCK KEY
SCAN CODE FOR
RIGHT SH I FT
SCAN CODE FOR
SCROLL LOCK KEY
SCAN CODE FOR
SYSTEM KEY

IBM Peri50nal Computer MACRO Assembler
Version 2.00
TESTI ---- 06/10/85
POWER ON SELF TEST (POST}
POSTEQU.INC - COMMON EQUATES

46.
461
466
469
490
491
492
493
494
495
49.
491
496
499
500
501
502
503
504
505
50.
501
506
509
510
511
512
513
514
515
516
511
516
519
520
521
522
523
524
525
526
521
52'
529
530
531
532
533
534
535
536
531
536
539
540
541
542
543
544
545
54.
541
546
549
550
551
552
553
554
555
55.
551
556
559
560
561
562
563
564
565
56.
561
56'
569
510
511
512
513
514
515
516
511
518
519
560
SOl
562
563
564
565
56.
561
566
569
590
591
592
593

1-'

06-10-85

PAGE
I - - - ---- --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - -;
CMOS EQUATES FOR THI S SYSTEM
:
0070
0071
0080

0000
000 I
0002
0003
000 ...
0005
0006
0007
0008
0009
OOOA
OOOB
OOOC
0000
OOOE
OOOF
0010
0012

-

~~~~ ;~~~

-------~~~ -----~ ;~~--- ---------~ -~ I ~- ~~~~~~~ -~; -~~~~ -~~~~~~~- ;~~~- -----

CMOS-DATA
NMi -

EQU
EQU

011 H
100000008

;
;
;

I/O ADDRESS OF CMOS DATA PORT
DISABLE NMI INTERRUPTS MASK HIGH BIT OF CMOS LOCATION ADDRESS

; ---------- CMOS TABLE LOCAT I ON ADDRESS'S ## ----------------------------------CMOS SECONDS
EQU
OOOH
SECONDS
CMOS-SEC ALARM
EQU
OOIH
SECONDS ALARM
## NOTE:
ALL LOCATIONS

g~g;:~: ~O!E~RM ~~~

gg~~

~: ~~i~;

II !~ET7~M C~~~ ~~E~

CMOS-HOURS
CMOS-HR ALARM
CMOS-DAY WEEK

EQU
EQU
EQU

OO ... H
005H
006H

ALARM
HOURS
HOURS ALARM
DAY OF THE WEEK

A
CMOS-REG-B
CMOS-REG-C
CMOS-REG-D
CMOS-DIAG
CMOS-SHUT DOWN
CMOS-D I SKETTE

EQU
EQU
EQU
EQU
EQU
EQU

OOBH
OOCH
OODH
OOEH
OOFH
0 I OH

STATUS REGISTER B
ALARM
STATUS REGISTER C FLAGS
STATUS REGISTER 0
BATTERY
POST DIAGNOSTIC STATUS RESULTS BYTE
SHUTDOWN STATUS COMMAND BYTE
DISKETTE DR I VE TYPE BYTE
•

EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU

013H
OI"'H
0 ISH
016H
017H
018H
019H
OIAH
0 I BH

TYPE BYTE
- RESERVED
EQUIPMENT WORD LOW BYTE
BASE MEMORY SI ZE - LOW BYTE (X I 024)
BASE MEMORY SIZE - HIGH BYTE
EXPANSION MEMORY SIZE - LOW BYTE
EXPANSION MEMORY SIZE - HIGH BYTE
F I XED 0 I SK TYPE - DR I VE C EXTENS I ON
FIXED DISK TYPE - DRIVE 0 EXTENSION
- I BH THROUGH 2DH - RESERVED

:E
;C
;K
:S
;U
;M
:E
:0
;

~~~

g~~~

g~g; g~~g~~~~

;:

EQU
EQU
EQU
EQU
EQU

030H
031 H
032H
033H
03 ...H

USABLE MEMORY ABOVE I MEG - LOW BYTE
USABLE MEMORY ABOVE I MEG - HIGH BYTE
DATE CENTURY BYTE (BCD)
128KB INFORMATION STATUS FLAG BYTE
- 3"'H THROUGH 3FH - RESERVED

g~g;:~~~;~ONTH ~~~
g~gF~~~R
~~~

~MOS-DISK

~~~

gg~~
gg:~

g:~~

~~~T~F THE MONTH
~~~~U~T~~G~ ~~~~S~

I
I

AND
SUB.JECT
TO
CHANGE. ONLY THE
POST & BIOS CODE

~~g~~~ Lg~~~~6~~
'-~~_~~~:_:~~~~~:.:

1

;1~~~E~y~~

l~

001'"
00 IS
0016
OOf 7
0018
0019
OOIA

;
CMOS EQUIP
CMOS-B M S LO
CMOS-B-M-S-HI
CMOS-E-M-S-LO
CMOS-E-M-S-HI
CMOS-DTsK T
CMOS:DISK:2

002E
002F
0030
0031
0032
0033

CKSUM HI
CMOS-CKSUM-LO
CMOS-U M S-LO
CMOS-U-M-S-H I
CMOS-CENTURY
CMOS:I NFO 1'28

000 ...
0008
00 I 0
0020
00 ... 0
0080

;---------- CMOS DIAGNOSTIC STATUS ERROR FLAGS WITHIN CMOS_DIAG ---------------CMOS CLK FAIL
EQU
000001008
CMOS CLOCK NOT UPDATING OR NOT VALID
HF FAIL EQU
OOOOIOOOB
FIXED DISK FAILURE ON INITIALIZATION
W MEM SIZE
EQU
OOOIOOOOB
MEMORY SIZE NOT EQUAL TO CONFIGURATION
BAD CDNFIG
EQU
OOIOOOOOB
MINIMUM CONFIG USED INSTEAD OF CMOS
BAD-CKSUM
EQU
0 I OOOOOOB
CHECKSUM ERROR
BAD:BAT
EQU
10000000B
DEAD BATTERY - CMOS LOST POWER

0080

~MOS

= ~~~HB~i~E

; ---------- CMOS I NFORMA T10N FLAGS --------------------------------------------M6"'OK
EQU
10000000B
; 512K -> 640K OPTION INSTALLED
(128K)
EQU
OIOOOOOOB
; FLAG USED BY CMOS SETUP UTILITY

000 I
0080
0080
00 I 0
00 I 0
000'"
0030
OOOA
0002
OOOF
00 I ...
0025

; ---------- 0 I SKETTE EQUATES --------------------------------------------------DUAL
EQU
OOOOOOOIB
MASK FOR COMBO/DSP ADAPTER
INT FLAG
EQU
10000000B
INTERRUPT OCCURRENCE FLAG
DSK-CHG
EQU
10000000B
DISKETTE CHANGE FLAG MASK BIT
DETERMINED
EQU
OOOIOOOOB
SET STATE DETERMINED IN STATE BITS
HOME
EQU
000 I OOOOB
TRACK 0 MASK
00000100B
SENSE DRIVE STATUS COMMAND
SEN'SE DRV ST
EQU
TRK SLAP EQU
030H
CRASH STOP ( ... 8 TP I DR I VES)
QU I ET SEEK
EQU
OOAH
SEEK TO TRACK 10
MAX DRV
EQU
2
MAX NUMBER OF DR I VES
HD 12 SETTLE
EQU
I5
1 .2 M HEAD SETTLE T I ME
H03io SETTLE
EQU
20
320 K HEAD SETTLE TIME
MOTOR:WAIT
EQU
37
2 SECONDS OF COUNTS FOR MOTOR TURN OFF

··
·

0080
00 ... 0
0020
00 I 0
0009
0008
0006
000 ...
0003
0002
000 I

;---------- DISKETTE ERRORS
TI ME OUT
EQU
080H
BAD SEEK
EQU
040H
BAD-NEC
EQU
020H
BAD-CRC
EQU
0 I OH
DMA-BOUNDARY
EQU
009H
BAO-OMA
EQU
008H
MEDTA CHANGE
EQU
006H
RECORD NOT FND
EQU
OO ...H
WR I TE PROTECT
EQU
003H
BAD ADDR MARK
EQU
002H
BAO:CMO EQU
001 H

·

000 I
0002

;---------- DISK CHANGE LINE EQUATES ------------------------------------------NOCHGLN
EQU
OOIH
; NO DISK CHANGE LINE AVAILABLE
CHGLN
EQU
002H
; DISK CHANGE LINE AVAILABLE

0001
0002
000 ...
00 I 0
0020
OOCO
0000
00 ... 0
0080
OOOC
OOCO

; ---------- MED I A/DR I VE STATE I NO I CATORS --------------------------------------TRK CAPA
EQU
0000000IB
80 TRACK CAPABILITY
FMT-CAPA
EQU
OOOOOOIOB
MULTIPLE FORMAT CAPABILITY (1.2M)
DRV-DET
EQU
OOOOOIOOB
DRIVE DETERMINED
MED-DET
EQU
OOOIOOOOB
MEDIA DETERMINED BIT
DBL-STEP
EQU
OOIOOOOOB
DOUBLE STEF BIT
RATE MSK
EQU
IIOOOOOOB
MASK FOR CLEARING ALL BUT RATE
RATE-500
EQU
OOOOOOOOB
500 KBS DATA RATE
RATE-300
EQU
0 I OOOOOOB
300 KBS DATA RATE
RATE-250
EQU
10000000B
250 KBS DATA RATE
STRT-MSK
EQU
00001100B
OPERATION START RATE MASK
SEND=MSK
EQU
11000000B
MASK FOR SEND RATE BITS

0000
0001
0002
0007

;---------- MEDIA/DRIVE STATE INDICATORS COMPATIBILITY ------------------------M3D3U
EQU
OOOOOOOOB
360 MED I AlOR I VE NOT ESTAeLi SHED
M3D1U
EQU
OOOOOOOIB
360 MEDIA,I.2DRIVE NOT ESTABLISHED
MIOIU
EQU
OOOOOOIOB
1.2 MEDIA/DRIVE NOT ESTABLISHED
MED_UNK
EQU
00000 t I IB
NONE OF THE ABOVE

··
···
·
··

ATTACHMENT FAILED TO RESPOND
SEEK OPERATION FAILED
DISKETTE CONTROLLER HAS FAILED
BAD CRC ON 0 I SKETTE READ
ATTEMPT TO DMA ACROSS 6 ... K BOUNDARY
DMA OVERRUN ON OPERATION
MEO I A REMOVED ON DUAL ATT ACH CARD
REQUESTED SECTOR NOT FOUND
WRITE ATTEMPTED ON WRITE PROTECT DISK
ADDRESS MARK NOT FOUND
BAD COMMAND PASSED TO DISKETTE 110

TEST1

5-33

IBM Personal Computer MACRO Assembler
Version 2.00
TEST I ---- 06/ to/85
POWER ON SELF TEST (POST)
POSTEQU. INC - COMMON EQUATES

594
595
596
597
59.
599
600
601
602
603
604
605
606
607
60.
609
610
611
612
613
614
615
616
617
61.
619
620
621
622
623
624
625
626
627
62.
629
630
631
632
633
63.
635
636
637
63.
639
640
641
642
643
644

C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C

0020
0020
0021
OOAO
OOA I
0070
0010
0008
0000
0000
OOCO
0040
0080

0001
0002
0004
0008
00 I a
0020
0040
0080

c

C
C
C
C
C
C

0081
DDaF

PAGE

~~7-------- I NTE~~~PT EQ~~6~S ------------~~~- ~~-7~~~~~~~~-~~~~~~;-~~-~~~~-----I NT AOO
I NT AD I
INT800
INT801
INT TYPE
INT:=VIOEO
6~~ ~~

020H
021 H
OAOH
OAIH
070H
010H

8259 PORT
8259 PORT
2ND 8259
;

START OF 8259
VIDEO VECTOR

OOOH
ODOH
OCOH

;
;
;

DMA CH.O ADDRESS REGISTER PORT ADDRESS
2ND DMA STATUS PORT ADDRESS
2ND DMA CH. 0 ADDRESS REG I STER ADDRESS

INTERRUPT TABLE LOCATION

-----------~~~ -----~~~~ ------------~ -~~; -;~ ~ ~~; -~~; ~;;~~ -;;~~ -~~~~~;; ------

DMA
DMAI8
DMA 1

i

EQU
EQU
EQU
EQU
EQU
EQU

~ ~~~

---------

EQU
EQU
EQU

--~~C-

----~~~~ ------------~ -~ ~~~ -~ ~ ~~~ -=- ~~;~ - ~~~~~;; ------ -------

; --------- MANUFACTUR I NG PORT ------------------------------------- ------------MFG PORT
EQU
80H
; MANUFACTURING AND POST CHECKPOINT PORT
;
DMA CHANNEL 0 PAGE REG [STER ADDRESS
;--------- MANUFACTURING BIT DEFINITION FOR IiIIMFG ERR FLAG+l -------------------MEM FAIL
EQU
000000018
STORAGE TEST FAILED
(ERROR 20X)
PRO-FAIL
EQU
000000106
VIRTUAL MODE TEST FAILED
(ERROR 104)
LMCS FAIL
EQU
OOOOOIOOB
LOW MEG CHIP SELECT FAILED (ERROR 109)
KYCLK FAIL
EQU
OOOOIOOOB
KEYBOARD CLOCK TEST FAILED (ERROR 304)
KY SYS FAIL
EQU
000 I OOOOB
KEYBOARD OR SYSTEM FAILED
(ERROR 3031
KYBo FAIL
EQU
OOIOOOOOB
KEYBOARD FAILED
(ERROR 301)
OSK FAIL
EQU
OIOOOOOOB
DISKETTE TEST FAILED
(ERROR 601)
KEY:=FAIL
EQU
10000000B
KEYBOARD LOCKED
(ERROR 302)

c
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C

OOFO
0000
8000
0000
OOOA
0008
0001
o t 00
0101

5-34

1-7
06-10-85

EQU

POST=SP
~~

EQU

08000H

- - - - - - - - --- - - - ~~~ - -- - - ~ ~ ~;~ - - - - - - - - - --

LF
RVRT
RHRZ
H
X
.LIST

TEST 1

OFOH

;

MATH COPROCESSOR CONTROL PORT

~;;~-;;---------~~c-----~~~~~~----------~-~~;~-;;~~;-;~~~~~~--------------------

EQU
EQU
EQU
EQU
EQU

OOOAH
00001 OOOB
000000018
256
H+ 1

;

POST STACK POINTER
CARR I AGE RETURN CHARACTER
LINE FEED CHARACTER
V IDEO VERT I CAL RETRACE BIT
VIDEO HORIZONTAL RETRACE BIT
HIGH BYTE FACTOR (X 100H)
HIGH AND LOW BYTE FACTOR (X 101H)

IBM Per50nill Computer MACRO A5sembler
Version 2.00
1-8
TESTI ---- 06/10/85
POWER ON SELF TEST jPDST)
06-10-85
SYSOATA.INC - DESCRIPTOR EQUATES

645
646
641
648
649
650
651
652
653
654
655
656
651
658
659
660
661
662
663
664
665
666
661
668
669
610
611
612
613
614
615
616
6TT
618
619
680
681
682
683
684
685
686
681
688
689
690
691
692
693
694
695
696
691
698
699
100
101
102
103
104
105
106
101
108
109
110
111
112
113
114
115
116
111
118
119
120
121
122
123
124
125
126
121
128
129
130
131
132
133
134
135
136
131
138
139
140
141
142

PAGE
INCLUDE SYSDATA.INC
; - - -- - - - - - - - - - - - --- - -- - - - -- - - - - - - - - - - --- -- -- - - - - - - - - - - - - - - - - -- - - - - -- - - - - - - - - --;
PROTECTED MODE EQUATES FOR POST TESTS AND BIOS ROUTINES

-

;

- - - - - - -- - - - - --- - - - - - ---- - - - --- -- -- --- - - - -- - - - - - -- - - - - - - - - - --- -- - -- - --- - - - --- --LENGTH EQUATES FOR PROTECTED MODE TESTS

0
0
0
0

0
0
0
0

0300
0800
0088
0008
1000
4000
FFFF
FFFF
0000

SDA LEN
SYS-IOT LEN
GDT-LENDESC LEN
MCRT-S I ZE
CCRT-S I ZE
ECCRT SIZE
MAX SEG LEN
NULL_ SEG_LEN

EOU
EOU
EOU
EOU
EOU
EOU
EOU
EOU
EOU

00300H
256-B
TYPE GOT OEF
TYPE DATA DESC
4-1024
16-1024
OFFFFH
OFFFFH
OOOOOH

SYSTEM DATA AREA LENGTH
256 SYSTEM lOT ENTRIES, 8 BYTES EACH
GOT STRUCTURE LENGTH
LENGTH OF A DESCR I PTOR
MONOCHROME CRT SIZE
COMPATIBLE COLOR CRT SIZE
SIZE OF EACH PORT I ON OF THE ENHANCED
MAX I MUM SEGMENT LENGTH
b4K
NULL SEGMENT LENGTH = 0

=

LOCATION EQUATES FOR PROTECTED MODE TESTS
0
0
0
0
0
0
0
0
0
0
0
0

DOAO
0400
D8AO
0000
OOOB
BOOO
OOOB
0000
OOOA
0000
OOOB
0000
OOOF
0000
0000

SYS lOT LOC
SDA-LOCGOT-LaC
MCRTO LO
MCRTO-HI
CCRTO-LO
CCRTO-H I
ECCRTQ) La LO
ECCRTO-LO-H I
ECCRTO-HI-LO
ECCRTO-HI-HI
CSEGOlI [0 CSEG.-HI
NSEGP-LO
NSEGP=HI
;-----

EOU
EOU
EOU
EOU
EOU
EOU
EOU
EOU
EOU
EOU
EOU
EOU
EOU
EOU
EOU

; THE SYSTEM lOT IS AT THE BOTTOM
ODOAOH
00400H
; SAME AS REAL
(SYS lOT LaC + SYS lOT LEN)
OOOOH
MONOCHROME CRT ADDRESS
(OBOOOOH)
OBH
BOOOH
COMPATIBLE COLOR CRT ADDRESS
(OB8000H)
OBH
OOOOH
(OAOOOOH)
OAH
OOOOH
(OBOOOOH)
OBH
CODE SEGMENT POST I B I OS
OOOOH
; (OFQOOOH) FOR TESTS
OFH
OOOOH
; ABSO

OOH

DEFINITIONS FOR ACCESS RIGHTS BYTES

00F3

CPL3 DATA ACCESS

EOU

11110011B

0

0093
009B
00E2
OOB I
0086
0081

CPLO DATA ACCESS
CPLO-CODE- ACCESS
LOT OESC FREE TSS
I NT GATE
TRAP_GATE

EOU
EOU
EOU
EOU
EOU
EOU

10010011B
1001101lB
11100010B
10000001B
10000110B
10000111B

0

000 I

VIRTUAL_ENABLE

EOU

000000000000000 I B

0
0
0
0
0

-

;-----

;-----

'?

0000
0002
0004
0005
0006
OOOB

?'
??

??

??

?'

DO
DO
DO
DO
DO
DO
DO
DO
DO
DO
DO
DO
DO
DO
DO
DO
DO

UNUSED ENTRY
THIS ENTRY POINTS TO THIS TABLE
POST INTERRUPT DESCRIPTOR TABLE
THE REAL SYSTEM DATA AREA FOR POST
CaMPA TI BLE BW CRT FOR POST
COMPATIBLE COLOR CRT FOR POST
ENHANCED COLOR GRAPH I CS CRT (1 b BYTES)
CS - POST lOT, ROM RESIDENT
DYNAMIC POINTER FOR ES
DYNAMIC POINTER FOR CS
DYNAMIC POINTER FOR SS
DYNAMIC POINTER FOR os
TR VALUE FOR THIS MACHINE'S TSS
LOTR VALUE FOR TH I S MACH I NE • SLOT

ENDS

SEGMENT DESCRIPTOR TABLE ENTRY STRUCTURE

DATA DESC
SEG LIMIT
BASE LO WORD
BASE-HI-BYTE
OATA-ACC RI(;HTS
DATA-RESERVED
DATA=DESC
;-----

PROTECTED MODE ENABLE

STRUC

GOT PTR
SYS-IOT PTR
RSDA PTR
C BWCRT PTR
C-CCRT PTR
E-CCRT-PTR
E-CCRT-PTR2
SYS ROM CS
ES TEMPCS-TEMP
SS-TEMP
OS-TEMP
POST TR
POST-TSS PTR
POST-LOTR
POST-LOT PTR
GDT_DEF -

0000
0002
0004
0005
0006
OOOB

;

THE GLOBAL DESCRIPTOR TABLE DEFINITION FOR POWER ON SELF TESTS

GDT_OEF
0000
OOOB
00 I 0
0018
0020
002B
0030
0038
0040
004B
0050
0058
0060
0068
0010
001B
OOBO
OOBB

PRESENT
DPL
3
CODE/DATA SEGMENT
NOT EXECUTABLE
GROW-UP (OFFSET <0 LIMIT)
WRITABLE
ACCESSED
DPL
0
ePL 0 - NON-CONFORM I NG

STRUC
OW
OW
DB
DB
OW
ENDS

SEGMENT LI MIT (I - b5535 BYTES)
24 BIT SE(;MENT PHYS I CAL
ADDRESS {O - (16M- 1 ) )
ACCESS RIGHTS BYTE
RESERVED - MUST BE 0000 FOR THE 802B6

GATE DESCRIPTOR TABLE ENTRY STRUCTURE

(;ATE DESC
ENTRY POINT
CS_SELECTOR
WORD COUNT
GATE-ACC RIGHTS
GATE-RESERVED
GATE=DESC

STRUC
OW
OW
DB
DB
OW
ENOS

DESTINATION ROUTINE ENTRY POINT
SELECTOR FOR DESTINATION SEGMENT
NUMBER OF WOROS TO COPY FROM STACK
ACCESS RIGHTS BYTE
RESERVED - MUST BE 0000 FOR THE B02B6

,LIST

TESTl

5-35

113M Perso"al Computer M~CRQ Assembler
TESTI ---- 06'10/8~
POWER ON SELF TEST

743
744
745
746
7.7
7'8
749
750
751
752
753
75.
755
756
757
758
759
760
761
762
763
76'
765
766
767
768
769
770
771
772
773
77.
775
776
777

118
719

780
78 r
782
763
764
785
766
767
788
789
790
791
792
793
194
795
796
797
198
799
800
801
802
803
80.
805
806
807
808
809
810
811
812
813
81.
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
83.
835
836
837
836
639
840
64,1
842
843
844
645
8.6
847
848
849
850
851
852
853
654
855
856

PAGE
CODE

0000

0000

=

0000
0000 36
30
20
4F
39
36

34
43
49
52
36
35

38
4F
42
50
31
20

0022 36
30
30
4F
2E
42
31
35
004E 20

36
30
31
4F
2E
42
31
35
20

34 34 38 38
30 30 39 39
20 20 43 43
50 50 52 52
20 20 49 49
40 40 20 20
39393838

30
50
40
2E
2C
20

30
52
20
20
31

1-'

VerSio" 2.00
(POST)

06-10-85

SEGMENT WORD PUBL I C
PUBLIC
PUBLIC
PUBLIC
PUBLIC

C8042
OBF" 42
POST 1
START_I

EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN

CMOS READ I NEAR
CMQS-WR I TE :NEAR
eONFT G BAD: NEAR
Dr! ;NEAR
ODS;NEAR
DUMMY RETURN: NEAR
ERR BEEP: NEAR
GATE A20:NEAR
KBO RESET I NEAR
NM'-'NT:Ni::AR
POST2:NEAR
PR I NT SCREEN: NEAR
PRoe SHUTDOWN: NEAR
ROM CHECK: NEAR
SHUT21NEAR
SHUT3 :NEAR
SHUT4:NEAR
SHUT6:NEAR
SHUTT :NEAR
SHUT9;NEAR
SLAVE VECTOR TABLE:NEAR
STGTST CNT: NEAR
SYSINITI :NEAR
VECTOR TABLE:NEAR
VIOEOJS'ARMSIB'fTE

ASSUME

CS: CODE, OS: NOTH I NG, ES: NOTH I NG, SS: NOTH I NG

POST I

PROC

NEAR

BEGIN

EQU
DB

•

39
2E
43
31
39

'6480090COPR.

I BM CORP.

1981, 1985

'

;COPYRIGHT NOTICE

EVEN

;

6B

;

;
;
I
I

;

76
7A
9F
02
72
DO
70
74

- ------- - - - -- - - - -- - - - -- - - - - - - - ---- - - - - -TEST.OI
80286 PROCESSOR TEST (REAL MODE)
DESCR I PTI ON
VER I FY FLAGS, REG I STERS
AND CONDITIONAL .JUMPS.

:
:

- - - --- - - --- ------------------- - - - -- -- ---

0580
10

DS:DATA

SHL
00
OZ

AH,CL
ERR02
AH,l
ERR02
C7A

o I SABLE INTERRUPTS
FLAG MASK IN (AH) AND NMI MASK IN (ALl
01 SA8LE NM I INTERRUPTS
SET "SF" ~ZF" "AF" "PF" "CF" FLAGS ON
GO TO ERROR ROUTINE IF "CF" NOT SET
GO TO ERROR ROUTINE IF "ZF" NOT SET
GO TO ERROR ROUTINE IF "PF" NOT SET
GO TO ERROR ROUTINE IF "SF" NOT SET
LOAD FLAG IMAGE TO (AH)
LOAD COUNT REG I STER WITH SH I FT COUNT
SH I FT "AF" I NTO CARRY 81 T PQS I TI ON
GO TO ERROR ROUTINE IF "AF" NOT SET
SET THE "OF" FLAG ON
SETUP FOR TES T I NG
GO TO ERROR ROUT I NE IF" OF" NOT SET
SET (AH) = 0
CLEAR "SF". "CF", "ZF", AND "PF"
GO TO ERROR ROUTINE IF "CF" ON
GO TO ERROR ROUTINE IF "ZF" ON
GO TO ERROR ROUTINE IF "SF" ON
GO TO ERROR ROUTINE IF "PF" ON
LOAD FLAG IMAGE TO (AH)
SH I FT .. AF" I NTO CARRY BIT pas I TI ON
GO TO ERROR ROUT I NE I F ON
CHECK THA T ~ OF" I S CLEAR
GO TO ERROR ROUT I NE I F ON
CONT I NUE CONF IDENCE TESTS IF" ZF" SET

HLT
JMP

ERR02

ERROR HALT
ERROR LOOP TRAP

MOV
MOV

AX,OATA
DS,AX

SET DATA SEGMENT
1NTO THE (OS) SEGMENT REG I STER

MOV

DUT
SAHF
oNC
oNZ
oNP
oNS
LAHF

27
25
23
21

as

AX.OD500H+CMOS REG O+NM I
CMOS_PORT, AL
ERR02
ERR02
ERR02
ERR02

XDR

CL,5
AH,CL
ERR02
AL.40H
AL,I
ERR02
AH,AH

OF

SAHF
JBE

ERR02

00
08

OP

MDV

EC
rA
40
EO
14
E4

SHR
JNC
MDV

SHL
oND

oS

ERR02
ERR02

LAHF
EC
06
E4
02
03

SHR
OC

ERRP2:
F4
EB FO
C7A:

;-----

5-36

; EVEN BOUNDARY
; EVEN MODULE
;000 MODULE
;COPYRIGHT NOTICE

(POST!)

CLI

0083
0083 88 ---- R
0086 8E 08

0088
008A
008C
0?8E

! 9 8 5
! 9 8 5
11998855'

;PAD

INITIAL RELIABILITY TESTS --

START_I:
FA
88
E6
9E
73
75
78
79
9F
BI
02
73
BO
DO
71
32
9E
76

IBM
IBM
IIBBMM

- - - -- -- - - --- - ---- - ---- - ----- - ------ -- - ---- - -----

ASSUME

0071
0073
0075
0076
0078
007A
007C
007E
0080
0060
0081

COP R •
COP R •
CCOOPPRR ••

DB

;

0050
0050
0051
0054
0056
0057
0059
0058
0050
005F
0060
0062
0064
0066
0068
006A
006C
006E
006F

6480090
6480091
'66448800009901

E4
A8
15
E9

64
04
03
0123 R

TESTl

CHECK FOR PROCESSOR SHUTDOWN

IN
TEST
oNZ
oMP

AL,STATUS PORT
AL,SYS FLAG
C78
SHUTO

READ CURRENT KEYBOARD PROCESSOR STATUS
CHECK FOR SHUTDOWN I N PROCESS FLAG
GO IF YES
ELSE CONT I NUE NORMAL POWER ON CODE

IBM Personal Computer MACRO Assembler
TEST I ---- 06/10/85
POWER ON SELF TEST

851
858
859
8bO
861
862
863
864
865
866
861
868
86'
870
871

1-10
06-10-85

Version 2.00
(POST)

PAGE
0091
0091
0093
0095
0097
0099
009B
0090

6~~~-BO
Eb
EB
E4
3C
86
74

8F
70
00
71
09
C4
41

CHECK FOR SHUTDOWN 09
AL.CMOS SHUT OOWN+NMI
CMOS PORT. AL1+2 AL.CMOS DATA
AL,09H AL.AH

"OV
OUT

J"P
IN
C"P
XCHG
JE
; -----

C1C

CMOS ADDRESS FOR SHUTDOWN BYTE
I/O DELAY
GET REQUEST NUMBER
WAS IT SHUTDOWN REQUEST 97
SAVE THE SHUTDOWN REQUEST
BYPASS INITIALIZING INTERRUPT CHIPS

CHECK FOR SHUTDOWN OA

009F 80 FC OA
00A2 74 3C

C"P
JE

AH,OAH
C1C

WAS I T SHUTDOWN REQUEST A?
BYPASS INITIALIZING INTERRUPT CHIPS

00A4 2A CO
00A6 E6 FI

SUB
OUT

AL.AL
X287+ I. AL

INSURE MATH PROCESSOR RESET

812
873
874

815
816
811
818
879
880
881
882
883
884
885
88b
887
888
889
890
691
892
8.3
8 ••
8'5
896
897
898
899
900
90 I
902
903
904
905
906
907
908
909

.10

RE-INITIALIZE THE 6259

;
00A8
OOAA
OOAC
OOAE
OOBO
00B2
00B4
00B6
00B8
OOBA
OOBC
OOBE
OOCO
00C2

BO
E6
EB
BO
E6
EB
BO
Eb
EB
BO
Eb
EB
BO
Eb

II
20
00
08
21
00
04
21
00
0I
21
00
FF
21

00C4
00C6
OOC8
OOCA
OOCC
OOCE
0000
0002
0004
0006
0008
OODA
OODC
OODE

BO
E6
ES
SO
E6
BO
E8
E6
E8
80
E6
E8
BO
E6

I I
AO
00
70
AI
02
00
AI
00
0I
AI
00
FF
AI

OUT

"2

J"P
"OV

'.2

OUT

'.2
'.2

J"P
"OV

-- - - - --- - - --- -- - -- - - - - -- - - - - - - - - - - - - - - - - --- - - -- - - - - - - ---RE-INITIALIZE THE 8259
OUT

'.2
'.2
'.2
'.2

J"P
"OV

AL,INT TYPE
INTBOI-;-AL
AL,02H

OUT

"OV
J"P

AL,OIH
INT80l,AL

OUT

J"P
"OV

-

EDGE,

:

SLAVE

ICW4

WAIT STATE FOR 110
SETUP [CW2 - INTERRUPT TYPE 70
SETUP I CW3 -

SLAVE LEVEL 2

1/0 DELAY
SETUP ICW4 -

8086 MODE,

(l0-7F1

AL.OFFH
INTBOI,AL

OUT

SLAVE

WAIT STATE FOR I/O
MASK ALL I NTERRUPTS OFF

SHUTDOWN - RESTART
RETURN CONTROL AFTER A SHUTDOWN COMMAND I S ISSUED
DESCR I PT I ON
A TEST IS MADE FOR THE SYSTEM FLAG BEING SET.
IF THE SYSTEM FLAG IS
SET, THE SHUTDOWN BYTE I N CMOS I S USED TO DETERM I NE WHERE CONTROL IS
RETURNED •
CMOS
CMOS
CMOS
CMOS
CMOS
CMOS
CMOS
CMOS
CMOS
CMOS
CMOS

.2..22

.23

'25
.26
'21
.28

92.

=0

=
=

1
2

=
=

4
5

=
=

8
9

SOFT RESET OR UNEXPECTED SHUTDOWN
SHUT DOWN AFTER MEMORY SIZE
SHUT DOWN AFTER MEMORY TEST
SHUT DOWN WITH MEMORY ERROR
SHUT DOWN WITH BOOT LOADER REQUEST
JMP DWORD REQUEST - (INTERRUPT CHIPS & 287 ARE INITIALIZED)
PROTECTED MODE TEST3 PASSED
PROTECTED MODE TEST3 FAILED
PROTECTED MODE TEST! FAILED
BLOCK MOVE SHUTDOWN REQUEST
JMP DWORD REQUEST - (W/O INTERRUPT CHIPS INITIALIZED)

=3

=6
=7
=A

NOTES:

• 30
.31
.32
'33

.3.
935

960
961
962
963
964
965
966
967
968
969
970

ICWI

INT80l,AL

OUT

J"P
"OV

'"

.5.

INTERRUPT #2 CONTROLLER CHIP

AL,IIH
INT800,AL

"OV

912
913
91.
915
916
• 11
918
91'
.20
.21

• 36
.31
.38
939
940
941
942
943
944
945
946
947
948
949
950
951
.52
.53
95.
955
956
957
958

(8-F)

WAIT STATE FOR 1/0
MASK ALL INTERRUPTS OFF
(V IDEO ROUT I NE ENABLES INTERRUPTS)

AL,OFFH
INTAOI,AL

OUT

I CW4

I/O WAIT STATE
SETUP I CW4 - MASTER, 8086 MODE

AL,OIH
INTAO\ ,AL

OUT

EDGE, MASTER,

WAIT STATE FOR I/O
SETUP I CW3 - MASTER LEVEL 2

AL.04H
INTAOI,AL

J"P
"OV

-

WAIT STATE FOR I/O
SETUP I CW2 - I NTERRUPT TYPE 8H

AL.08H
INTAO\ ,AL

OUT

J"P
"OV

;

CONTROLLER CHIP;
I CW I

AL,IIH
INTAOO,AL

"OV

;

INTERRUPT "

-- -- - - - - - - - - - -- - - - --- - - --- -- ---- - -- - --- -- - -- - - ---- - - - - --

RETURNS ARE MADE WITH I NTERRUPTS AND NM I DISABLED •
USER MUST RESTORE SS;SP (POST DEFAULT SET
0000:0400),
ENABLE NON-MASK ABLE INTERRUPTS (NM I) WITH AN OUT TO
PORT 70H WITH HIGH ORDER BIT OFF, AND THEN ISSUE A
ST I TO ENABLE INTERRUPTS.
FOR SHUTDOWN (5) THE USER
MUST ALSO RESTORE THE INTERRUPT MASK REGISTERS •

=

CHECK FROM WHERE
ODED
ODED
00E2
OOE4
ODES
00E7
OOE9
OOEB
OOED
OOEF
OOF2
00F4
00F6

80 8F
Eb 70
90
2A CO
E6 71
86 EO
3C OA
77 34
BE 0103 R
03 FO
03 FO
2E: 8B IC

"OV

AL, CMOS SHUT DOWN+NM I
CMOS_PORT, AL-

C"P
JA
"OV

AL,AL
CMOS OATA,AL
AH,AL
AL,OAH
SHUTO
S I ,OFFSET BRANCH
SI,AX
SI,AX
BX,CS: [SI]

OUT
Nap
SUB
OUT
XCHG

AOO
AOO

"OV

CLEAR CMOS BYTE
I/O DELAY
SET 8YTE TO a
COMPARE WITH MAX I MUM TABLE ENTR [ES
SKIP TO POST IF GREATER THAN MAXIMUM
POINT TO THE START OF THE BRANCH TABLE
POINT TO BRANCH ADDRESS
MOVE BRANCH TO ADDRESS TO BX REGISTER

SET TEMPORARY STACK FOR POST
00F9
OOFC
OOFE
0101

B8
8E
BC
FF

---- R
00
0400 R
E3

0103
a I 05
0107
0 I 09
OIOB
0100
a I OF
alii
0113
0 I IS
0117

0123
0990
0000
0000
0000
0119
0000
0000
0793
0000
OIIF

R
R
E
E
E
R
E
E
R
E
R

BRANCH:

"OV
"OV
"OV
J"P

AX, ABSO
SS,AX
SP, OFFSET <><><><><><><> <> <><><>
<><> CHECKPO I NT 0 I <><>

AL,OIH
MFG_PORT. AL

READ/WRITE/TEST THE 80286 REGISTERS WITH ONE'S AND ZERO'S

"OV
51C
JNC

AX ,OFFFFH

SETUP ONE'S PATTERN IN
SET CARRY FLAG
GO IF NO CARRY

ERROl

(AX)

C8:

C9:

"OV
MOV
"OV
"OV
"OV
"OV
"OV
"OV
"OV
"OV
JNC
XOR
JNZ
CLC
J"P

DS,AX
BX,DS
ES,BX
CX,ES
SS,CX
DX,SS
SP,DX
BP,SP
SI,BP
01,51

OR
JZ

AX,DI
CIOA

WRITE PATTERN TO ALL REGISTERS

C9
AX,DI
ERROl

PATTERN MAKE IT THROUGH ALL REGISTERS
NO - GO TO ERROR ROUT I NE
CLEAR CARRY FLAG

c.

TSTIA
ZERO PATTERN MAKE IT THROUGH?
YES - GO TO NEXT TEST

ERROl:

HLT

HALT SYSTEM

INSURE THAT CMOS CLOCK

"OV
OUT
Nap
IN
AND
XCHG

;-----

,
:
;

;

~

AL,CMOS DATA
AL,OOOOOI11B
AL,AH

XCHG

~~~!RPORT • AL
CMOS_DATA.AL

"OV
Nap
OUT
Nap
IN

CMOS_PORT .AL

AL ,CMOS_REG_C+NMI

AL,CMOS_oATA

ADDRESS TO BOTH (AH) AND (AL)
ADDRESS CMOS ALARM BYTE WITH NM I =OFF
I/O DELAY
GET THE CURRENT CONTROL RECiISTER
CLEAR SET,PIE,AIE, AND SQWE BITS
SAVE IT

ADDRESS CMOS FLAGS BYTE WITH NM I =OFF
I/O DELAY
I/O DELAY
READ STATUS TO CLEAR PENDING INTERRUPT

RESET VIDEO

"OV
"OV
OUT
INC
"OV
OUT
"OV
IN
"OV
IN
"OY
"OV
OUT
"OV
OUT
;

AX,X· (CMOS REG B+NMI
CMOS_PORT ,AL
-

OUT

OUT

INTERRUPTS ARE DISABLED

AL,O
OX.03D8H
DX,AL

AL
DL,088H
DX,AL
DL,OBAH
AL.DX
DL,ODAH
AL,DX
AL,O
DL,OCOH
DX,AL
AL,111I11008
PORT_B,AL

CLEAR OAT A BYTE TO 0 I SABLE V IDEO
GET COLOR MODE CONTROL PORT ADDRESS
o I SABLE COLOR V IDEO
MONOCHROME MODE RESET MASK
GET ADDRESS OF MONOCHROME MODE CONTROL
DISABLE B/W VIDEO, ENABLE HIGH RES
ADDRESS OF MONOCHROME STATUS REGISTER
READ STATUS TO DISABLE ECiA VIDEO
ADDRESS OF COLOR MODE STATUS REGISTER
READ STATUS TO DISABLE EGA VIDEO
SELECT ATTR I BUTE PALETTE REG I STER 0
WR I TE 0 TO ATTR I BUTE ADDRESS REG I STER
TO DI SABLE EGA VIDEO
o I SABLE PAR I TY CHECKERS

- - --- - - ---- ------- ------------------- - -TEST. 02
ROM CHECKSUM TEST I
DESCRIPTION
A CHECKSUM 1 S DONE FOR THE :32K
READ ONLY MEMORY MODULES (TWO)
:
CONTAINING POST, BASIC AND BIOS.I

--- - ---- ---- ---- - ---- --- ---- - - - - - - - -- - --

:-----

CI I;

CHECKPOINT 02

"OV
OUT

AL.02H
MFG_PORT, AL

ASSUME

SS:CODE
AX,CS
SS,AX
oS,AX
SI,SI
BX.BX
CH,080H

"OV
MOV
"OV
XOR
XOR
"OV
LODSW

ADD
ADD

BL,AH
BL,AL

LOOP

CII

JNC

CIIE

JZ

CIIA

<> <> <> <><><><><><><><><>
<><> CHECKPOINT 02 <><>
SETUP SS SEGMENT REG I STER
SET UP DATA SEGMENT TO POINT TO
ROM ADDRESS START
CLEAR CHECK REG I STER
COUNT FOR 32K WORDS
MOVE TWO BYTES INTO AX -- 51=51+2
ADO ODD BYTE AT DS:SI+I TO CHECKSUM
ADD EVEN BYTE AT OS: S I TO CHECKSUM
LOOP COUNT FOR 65K BYTES (32K WORDS)
EXIT IF ~LOOP~ RESET THE CARRY FLAG
(NOTE: MODEL BYTE MUST NOT = ZERO)
CONTINUE IF CHECKSUM VALID (ZERO)

CI1E:

HLT
TEST.03
VER I FY CMOS SHUTDOWN 8YTE

ELSE HALT IF CHECKSUM PROBLEM

IBM Personal Computer MACRO Assembler
TEST! ---- 06/ I 0/85
POWER ON SELF TEST

1085
108b
1087
1088
1089
1090
1091 019F
1092 019F 80
1093 0 I A I E6
1094
1095 0 I A3 89
1096 OIAb 84
1097 0lA6
1098 0lA8 80
1099 OIAA E6
1100 OIAC 8A
1101 OIAE E6
I 102 0180 80
1103 0182 90
1 104 0183 Eb
I 105 0185 90
1106 018b E4
11010188 3A
1105 018A 15
1109 018C 00
I I 10 018E E2
1111
I I 12
1113
I I 14
IllS
I I 16
1117
I 118
1119
1120 OICO 88
\ 121 0lC3 8E
I \ 22 01 C5 80
1123 0lC1 E6
1124
1 125
1126
I 121 01 C9 E6
1128 01Ca Eb
1129
1\30
1131
1132 OICO 88
1133 0101 80
1134 0103 E6
1135 0105 EB
1136 0101 8A
1137 0109 E6
1138 olDe 81
1139 0100
1140 0100 eo
1141 01DF Ee
1142 OIEI E6
1143 0lE3 50
1144 01E6 14
1145 0lE6 E4
1146 OlEA OA
1141 DIEC E2
1148 OIEE FE
1\49 OIFO 15
11500lF2F4
1151
1152
1153
1154
1155
1156
1151
1158
1159
1160
1161
l1b2 01F'3 80
1163 01F'5 E6
1164
IIb5 OIFT 6A
IIb6 0lF9 28
1161 OIFB E6
1168 OIF'D 81
IIb9 01FF
1110 01FF BO
1 11\ 0201 E6
1112 0203 E8
11130205 E8
11740201 E4
1115 0209 22
111b 0208 14
I 111 0200 E2
1118 020F FE
1179021175
1180 0213 F4
118[
1182
1183
1184
1185
118b
1187
1188
1189
1190
119(
1192
1193
1194
[19502[4
1196 0214 88
11970211 8E
1198 0219 80

1-12
06-\ 0-85

Version 2.00
(POST)

; DESCRIPTION
ROLLING BIT WRITTEN AND
VERIFIED AT SHUTDOWN ADDRESS.
VER I FY AND CLEAR SHUTDOWN FLAG
03
80
0009
01

<><> <> <> <><><><><><> <><>
<><> CHECKPO I NT 03 <><>

"OV
OUT

"L,03H
MFG_PORT ,AL

"OV
"OV

CX,09H
AH,I

"OV
OUT
"OV
OUT
"OV
Nap
OUT
Nap
IN
CMP
JNZ
RCL
LOOP

AL, CMOS_SHUT _DOWN+NM I
CMOS _PORT ,AL
AL,AH
CMOS_DATA,AL
AL, CMOS_SHUT _OOWN+NM I

LOOP COUNT
START WITH BIT 0

C\ lB:
8F
70
C4
71
8F
70
71
C4
92
04
E8

;
;
;
;

;

I

CMOS_PORT ,AL
110 DELAY
AL,CMOS_DATA
AL,AH
ERROl
AH,I
CllB

MUST BE THE SAME
ERROR IF NOT
ROLL A a IT THROUGH SHUTDOWN BYTE
LOOP TILL DONE

-- -- - --- - - - - -------- - - - - -- -- -- - -- - - -- - -TEST. 04
8254 CHECK TIMER
DESCRIPTION
SET T I MER COUNT
CHECK THAT TIMER

1 ALL BITS ON

:
:
:

81TS ON
:
-- -- --- - - - - - - -- -- --- - -- - -1 - -ALL
- - - - -- -- - - - -ASSUME
MOV
MOV
MOV
OUT

---- R
08
04
80
:-----

DS:DATA
AX,DATA
DS,AX
AL.,04H
MFG _PORT, AL

SET DATA SEGMENT

<><><><><><><><><><><><>
<><> CHECKPOINT 04 <><>

DISABLE DMA CONTROL.LER

08
DO

OUT
OUT

lb 0012 R
54
43
00
Cl
41
05

MOV
"OV
OUT
JMP
"OV
OUT
MOV

(AU ALREADY = 04H
01 SA8L.E OMA CONTROLL.ER I
o I SABLE OMA CONTROL.LER 2

DMA05,AL
DMAI8,AL

VERIFY THAT TIMER

I

ox ,IltRESET

FUNCTIONS OK
SAVE RESET FLAG WHILE REFRESH
SEL.ECT TIMER I,LSB,MODE 2

FL.AG

AL.,54H
TIMER+3,AL

"OV
JMP
OUT
CMP
JE
IN
OR
L.OOP
OEC
JNZ
HLT

$'2
AL.,CL.
T1MER+I,AL
BH,05H

LOOP COUNT
TIMERI BITS ON
L.ATCH TIMER-I COUNT
110 DELAY

AL.,40H

$'2
TIMER+3,AL.
8L,OFFH
CI3
AL,T1MER+I
8L.,AL.
CO2
BH
CO2

YES - SEE IF ALL 81TS GO OFF
TIMER I BITS OFF
READ TIMER T COUNT
ALL BITS ON IN TIMER
TIMERI_8ITS_ON

- - --- - - -- -- ---- - -- - - - --- - ----------:
; TEST .05

: - ----

;
05
80

8254 CHECK TIMER
DESCR I PTI ON
SET TIMER COUNT
CHECK THAT TIMER

-----

C13:

C3
C9
41
05

I

ALL. 8IT OFF

I

:
AL.L. BITS OFF:

TRY AGAIN
TIMER I fAILURE,
T I MER 1_81 TS_OFF

HAL.T SYSTEM

:

CHECKPO I NT 05
MOV
OUT

AL,05H
MFG_PORT, AL

"OV
SUB
OUT
MOV

AL.8L.
CX,CX
TlMER+ I,AL.
BH,05H

MOV
OUT
JMP
JMP
IN
ANa
JZ
LOOP
OEC
JNZ
HLT

AL,40H
TIMER+3,AL

<><><><><><><><><><><> <>
<><> CHECKPO I NT 05 <><>
SET T [MER

I COUNT

SET TRY AGA I N COUNT
TIMER LOOP
LATCH-T I MER I COUNT

C14:
40
43
00
00
41
08
01
FO
CF
EC

IS OFF

110 DELAY
SET I N I TI AL TI MER COUNT TO 0

C12:
40
00
43
FB FF
08
41
08
EF
CF
E8

I
;

OUTPUT ROLLING 81T
READ CMOS
I/O DELAY

DEL.A Y FOR T I MER
ADDED DELAY FOR T I MER
READ TIMER I COUNT

$'2
$'2
AL,TIMER+I
BL,AL
CIS
CI.
BH
CI.

GO TO WRAP DMA REGISTER TESTS
TIMER_LOOP
HALT SYSTEM

;---------------------- ----------------TEST.Ob
8231 oMA 0 INITIALIZATION
CHANNEL REG I STER TEST
~SCR[~I~

:
THE 8237 OMA CONTROL.LER.:
WRITE/READ THE CURRENT ADDRESS
:
AND WORD COUNT REG I STERS FOR
ALL CHANNEL.S.

o I SABLE

;

; ----;-----

-- --- - -- - - - - - - ---- - - - --- - ---------CHECKPOINT 06

C15:
---- R
08
06

MOV
"OV
MOV

AX,OATA
DS,AX
AL,ObH

;

SET DATA SEGMENT

TESTl

5-39

IBM Personal Comp .... ter MACRO Assembler
TEST 1 ---- 06/10/85
POWER ON SELF TEST
1199 0218 E6 80
1200021089 16 0072 R
120 I 0221 E6 00
1202
1203
1204
1205 0223 80 FF
1206 0225 8A 08
f 207 0227 8A F8
1208 0229 89 0008
1209 022C 8A 0000
1210 022F EE
12110230E800
1212 0232 EE
1213 0233 BO 01
1214 0235 EB 00
1215 0237 EC
1216 0238 EB 00
1217 023A 8A EO
1218 023C EC
1219 0230 38 08
1220 023F 74 01
1221 0241 F4
1222 0242
1223 0242 42
1224 0243 E2 EA
1225 0245 FE CO
1226 0247 74 DC
1227
1228
1229
1230 0249 80 F8 55
1231 024C 74 09
1232 024E 80 F8 AA
f 233 0251 74 08
1234 0253 80 55
1235 0255 E8 CE
1236
f 237
1238
1239 0257 80 AA
1240 0259 E8 CA
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255 0258 80 07
1256 0250 E6 80
1257 025F E6 DA
1258
1259
1260
1261 0261 BO FF
1262 0263 8A 08
1263 0265 8A F8
1264 0267 B9 0008
1265 026A BA OOCO
1266 0260 EE
1267 026E E8 00
1268 0270 EE
12690271 80 01
1270 0273 E8 00
1271 0275 EC
1272 0276 E8 00
1273 0278 8A EO
1274 027A EC
1275 0278 38 08
1276 0270 74 01
1277 027F F4
1278 0280
1279 0280 83 C2 02
1280 0283 E2 E8
1281 0285 FE CO
1282 0287 74 DA
1283
1284
1285
1286 0289 80 F8 55
1287 028C 74 09
1288 028E 80 F8 AA
12890291 7408
1290 0293 80 55
1291 0295 E8 CC
1292
1293
1294
1295 0297 80 AA
1296 0299 Ea C8
1297
1298
1299
1300 0298
1301 029888 IE 0072 R
1302 029F A3 0010 R
1303 02A2 BO 12
1304 02A4 E6 41
1305
1306
1307
1308 02A6 2A CO
'309 02A8 E6 08

310
1311
1312 02AA E6 00

5-40

TESTl

Version 2.00
(POST)

1-13
06- 10-85

;

OUT
MDY
DUT

;----C161

C17:

;
;

<><> CHECKPO I NT 06 <><>
RESTORE SOFT RESET FLAG
SEND MASTER CLEAR TO DMA

WRAP DMA 0 CHANNEL ADDRESS AND COUNT REGISTERS
MDY
MDY
MDY
MDY
MDY
DUT
"MP
DUT
MOY
"MP
IN
"MP
MOY
IN
CMP

"E
HLT

Al,OFFH
al,Al
8H,Al
CX,8
OX IDMA
OX,Al

WRITE PATTERN "FF" TO All REGISTERS
SAVE PATTERN FOR COMPARE
SETUP lOOP COUNT
SETUP I/O PORT ADDRESS OF REG I STER
WRITE PATTERN TO REGISTER, lSB
I/O DELAY
MSB OF 16 BIT REG[STER
Al TO ANOTHER FA TTERN BEFORE READ
I/O DELAY
READ 16-81T DNA CH REG, lS8
2ST DNA
I/O DELAY
SAVE lSB OF 16-81T REGISTER
READ MS8 OF DNA CHANNEL REGISTER
PATTERN READ AS WRITTEN?
YES - CHECK NEXT REG I STER
NO - HALT THE SYSTEM
NXT DNA CH
SET-I/O-PORT TO NEXT CHANNEL REGISTER
WRITE PATTERN TO NEXT REGISTER
SET PATTERN TO 0
YES CONT I NUE

,'2

DX,Al
Al,OIH

"2
"2

Al,DX

AH,Al
Al,DX
aX,AX
CI8

C18:
INC
lOOP
INC

"Z

OX

CI1
AL
CI6

WR[TE DMA WITH 55 PATTERN
CMP

"Z
CMP
"Z

MOY
"MP

Bl,055H
C19
Bl,OAAH
C20
Al,055H
C16

CHECK
GO IF
CHECK
GO [F

;-----

WRITE DMA WITH AA PATTERN

C19:

MOY
"MP

;
;
;

;

IF "55" PATTERN DONE
YES
IF "AA" PATTERN DONE
YES

Al,OAAH
C16

--- ------------------- -----------------TEST.07
8237 DMA I INITIALIZATION
CHANNEL REGI STER TEST
DESCR I PT I ON
DISABLE 8237 DMA CONTROllER 1.
WR[TE/READ THE CURRENT DMA I
ADDRESS AND WORD COUNT
REG I STERS FOR All CHANNELS.

---- ------------------ -----------------CHECKPO I NT 07 -

C20:

MOY
OUT
OUT

WRAP DNA
CI6A:

CI7A:

MOY
MOY
MDY
MOY
MOY
OUT
"MP
OUT
MDY
"MP
IN
"MP
MOY
IN
CMP

"E

DMA

1

Al,07H
MFG PORT ,Al
DMA1+0DH-2,Al

1 CHANNEL ADDRESS AND COUNT REGISTERS
AL,OFFH
Bl,Al
8H,AL
CX,8
OX ,DMA 1
DX,Al
"2
DX,AL
Al,OIH
"2
AL,DX
'.2
AH,Al
AL,DX
BX,AX
CI8A

HLT

cr8Al
ADO
LOOP
INC

"Z
;-----

<><><> <> <><> <><> <><><> <>
<><> CHECKPOINT 07 <><>
SEND MASTER CLEAR TO 2ND DMA

DX,2
CI7A
AL
CI6A

WRITE PATTERN FF TO All REGISTERS
SAVE PATTERN FOR COMPARE
SETUP LOOP COUNT
SETUP I/O PORT ADDRESS OF REG I STER
WRITE PATTERN TO REGISTER, LSB
I/O DELAY
MS8 OF 16 8[T REGISTER
Al TO ANOTHER PAT 8EFORE RD
I {a OElAY
READ 16-BIT DMA CH REG, lS8
2ST DMA
I/O DELAY
SAVE LSB OF 16-BIT REGISTER
READ MS8 OF DMA CH REG I STER
PATTERN READ AS WR ITTEN?
YES - CHECK NEXT REG I STER
NO - HALT THE SYSTEM
NXT DMA CH
SET-I/O-PORT TO NEXT CHANNEL REGI STER
WRITE PATTERN TO NEXT REGISTER
SET PATTERN TO 0
YES CONTI NUE

WRITE DMA WITH 55 PATTERN
CMP

"Z
CMP

"Z

MOY
"MP

Bl,55H
C20A
8l,OAAH
C21
Al,55H
CI6A

CHECK
GO IF
CHECK
GO IF

IF 55 PATTERN DONE
YES
IF AA PATTERN DONE
YES

WRITE OMA W[TH AA PATTERN
C20A:

MOV
"MP

;-----

INITIALIZE AND START MEMORY REFRESH

C21 :
MOY
MOY
"OY
DUT

; -----

Al,OAAH
CI6A

ex, ~RESET FLAG
PEQUIP FlAG,AX
AL, 18 TIMER+! ,AL

GET THE RESET FLAG
DO A DUMMY MEMORY WR ITE 8EFORE REFRESH
START REFRESH TIMER

SET DMA COMMAND
SUB
OUT

Al,Al
OMA+8,Al

OUT

DMAI8,Al

OACK SENSE lOW,DREQ SENSE HIGH
lATE WRITE, FIXED PR[ORITY, NORMAL
TIM I NG, CONTROLLER ENABLE, CHO ADDRESS
HOLD 0 I SA8LE. MEMORY TO MEMORY 0 I SABLE
SAME TO SECOND CONTROLLER

IBM Personal Computer MACRO Assembler
TEST 1 ---- 06/10/65
POWER ON SELF TEST
1313
1314
1315
1316 02AC 80 40
1317 02AE E6 08
1316028080 CO
1319 0282 E6 06
1320 0284 E8 00
1321 0286 BO 41
1322 0286 E6 08
1323 028A E6 06
1324 02BC E8 00
1325 02BE BO 42
1326 02CO E6 OB
1327 02C2 E6 06
1326 02C4 EB 00
1329 02Cb BO 43
1330 02C8 E6 OB
1331 02CA E6 Db
1332
1333
1334
1335 02CC 89 IE 0072 R
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346 0200 80 08
1341 0202 E6 80
1348 0204 2A CO
1349 0206 BA 0081
1350 0209 B9 DOFF
1351 02DC EE
1352 0200 42
1353 02DE FE CO
1354 02EO 81 FA 008F
1355 02E4 75 Fb
1356 02E6 86 EO
1357 02E8 FE CC
1358 02E,4, 4,4,
1359 02E8 2A CO
13bO 02ED EC
1361 02EE 3A C4
1362 02FO 75 30
1363 02F2 FE CC
1364 02F4 4A
1365 02F5 81 FA 0080
13b6 02F9 15 FO
1367 02FB FE C4
1368 02FD 8A C4
1369 02FF E2 DB
1370
1311
1312
1373 0301 130 CC
1314 0303 8A 008F
1375 0306 8A EO
1376 0308 EE
1371
1318
1379
1380 0309 2A CO
1381 030B EC
1382 030C 3A C4
1383 030E 75 12
1384031080 FC CC
1385 0313 15 04
13860315 BO 33
13870311 E8 EA
1388 0319
1389031980 FC 00
1390 031C 14 05
1391 031E 2,4, CO
1392 0320 E8 EI
1393
1394
1395 0322
1396 0322 F4
! 391
1398
1399
1400
1401
1402
1403
1404
1405
1406 0323
1407 0323 80 09
1408 03~5 E6 80
1409 0327 28 C9
1410 0329
14110329E461
1412 032B A8 10
1413 0320 El FA
1414 032F E3 Fl
1415 0331
1416 0331 E4 61
1417 0333 A8 10
1418 0335 EO FA
1419 0331 E3 E9
1420
1421
1422
1423
1424
1425
1426

; -----

Version 2.00
(POST)

MODE SET ALL DMA CHANNELS
MOV
OUT
MOV
OUT

110 DELAY
SET MODE FOR CHANNEL 1

'.2

SET MODE FOR CHANNEL 5
I/O DELAY
SET MODE FOR CHANNEL 2

,'2

SET MODE FOR CHANNEL 6
I/O DELAY
SET MODE FOR CHANNEL 3

AL,42H
DMA+OBH,AL
DMAI8+06H,AL
AL,43H
DMA+OBH, AL
DMAI8+06H,AL

SET MODE FOR CHANNEL 1

RESTORE RESET FLAG
MOV

;-

~~~~: ~ ~--

I

SET CASCADE MODE ON CHANNEL 4

"2

AL,41H
OMA+OBH,AL
DMAI8+06H,AL

OUT
OUT
"MP
MOV
OUT
OUT
"MP
MOV
OUT
OUT

;

SET MODE FOR CHANNEL 0

AL,40H
DMA+08H,AL
AL,OCOH
DMAI8+06H,AL

""P
MOV

; -----

1-14
06-10-85

ORESET_FLAG,BX

-- ---- ---------- - --- ------- ---

DMA PAGE REG I STER TEST
DESCRIPTION

ALL PAGE REGISTERS
.; - - --- - - WRITE/READ
- - - - - - - - - - - - - - - - - - -- - - -- - - - - - - - -CHECKPOINT 08

C22A:

C228:

MOV
OUT
SUB
"OV
MOV
OUT
INC
INC
CMP
"NZ
XCHG
DEC
DEC
SUB
IN
CMP
"NZ
DEC
DEC
CNP
"NZ
INC
"DV
LOOP

"DV
NOV
"DV
OUT

DO ALL DATA PATTERNS

AL
DX,8FH
C22A
AH,AL

TEST OMA PAGES 81

THROUGH 8EH

AH

SAVE CURRENT DATA PATTERN
CHECK LAST WR I TTEN

OX
AL.AL
AL.DX
AL,AH
C2.

DATA AS WRITTEN?
GO ERROR HALT IF NOT

CHANGE DATA 8EFORE READ

AH
OX
DX,MFG_PORT
C228

CONTINUE TILL PORT 80

AH

NEXT PATTERN TO RIPPLE

AL,AH
C22A

TEST LAST DMA PAGE REGISTER
C22:

<><><><><><><> <><><><><>
<><> CHECKPOINT 08 <><>

AL,08H
MFG_PORT ,AL
AL,AL
DX,DMA PAGE
CX,OFFH
OX,AL
OX

(USED FOR ADDRESS LINES DURING REFRESH)

AL,OCCH
OX ,LAST _DMA_PAGE
AH,AL
DX,AL

WR J TE AN CC TO PAGE REG I STERS
SAVE THE DATA PATTERN
OUTPUT PAGE REG I STER

VERIFY PAGE REGISTER 8F
SUB
IN
CMP
"NZ
CMP
"NZ
NOV
"MP

AL,AL
AL,DX
AL,AH
C2.
AH,OCCH
C25
AL,033H
C22

CHANGE DATA PATTERN BEFORE READ
GET THE DATA FROM PAGE REGISTER

GO IF ERROR
SET UP DATA PATTERN OF 33
DO DATA 33

COP
"Z
SUB
"MP

AH,O
C21
AL,AL
C22

CHECK DONE
GO IF YES
SET UP FOR DATA PATTERN 00
DO DATA 0

GO

IF ERROR

C25:

1----C26:

ERROR HALT

HLT

i-

~~ ~~ :~~-

;
;
;

;

HALT SYSTEM

-------------------------------

STORAGE REFRESH TEST
DESCRIPTION
I FY REFRESH I S OCCURR I NG
---- --- VER
-- --- - -- - --- - - - - -------- - - - - -- - -CHECKPOINT 09 -

TEST MEMORY REFRESH

<><><><><><><><><><><><>
<><> CHECKPO I NT 09 <><>

MOV
OUT
SUB

AL,09H
MFG _PORT, AL
CX,CX

IN
TEST
LOOPZ
JCXZ

AL,PORT B
AL '. REFRESH _ BIT
C28
C2.

I NSURE REFRESH I S OFF
ERROR HALT IF TIMEOUT

IN
TEST
LOOPNZ
JCXZ

AL,PORT_8
AL,REFRESH_BIT
C29
C26

ERROR HALT I F NO REFRESH 8 I T

C28:
INSURE REFRESH BIT IS TOGGLING

C29:
I NSURE REFRESH J S ON

TEST. 10
8042 INTERFACE TEST
READ CONFIGURATION JUMPERS
DESCRIPTION
I SSUE A SELF TEST TO THE 8042.

TEST 1 5-41

IBM Personal Computer MACRO Assembler
TEST 1 ---- 06/10/85
POWER ON SELF TEST
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
14:37
1438
1439
1440
1441
1442
144:3
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1414
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
151 1
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540

Version 2.00
(POST)

1-15
06-10-85

INSURE A 55H IS RECEIVED.
READ MANUFACTURING AND DISPLAY

;

;----0339 BO OA
033B E6 80

CHECKPOINT OA
MOV
OUT

AL,OAH
MFG_PORT ,AL

SOFT RESET
0:330
0:33F
0341
0:343
0346
0348
0:34A
0340
034F

2B
E4
8A
F6
14
E4
F6
EO
74

0351

F4

C9
64
EO
C4 01
02
60
C4 02
FO
01

:
I

AND SAVE IN MFG_TEST.
--- --- - ,JUMPERS
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- --

SUB

TST! :

IN
MOV

TEST

"Z
IN
TST2:

TEST
LOOPNZ

"Z
ERROl

<><><><><><><><><><> <> <>
<><> CHECKPOINT
OA <><>

(HANDLE ALL POSS ISLE CONO I T IONS)

CX,CX
AL, ST ATUS PORT
AH,AL
AH, OUT aUF FULL
TST2
AL ,PORT A
AH, 1NFT-8UF FULL
TST I
TST4

HLT

100 MILL I SECONDS FOR TH I SLOOP
CHECK FOR I NPUT BUFFER FULL
CO IF NOT
FLUSH
I S THE OUTPUT BUFFER ALSO FULL?
TRY AGAIN
CaNT I NUE I F OK
HALT SYSTEM IF BUFFER FULL

I SSUE A RESET TO THE 8042
0:352 BO OB
0:354 E6 80
0:356
0:358
035B
0350
035F
0:361
0363
0366
0368
036A

BO
BC
EB
A8
74
E4
BC
EB
E4
3C

AA
03EE R
39
01
02
60
03FO R
3A
60
55

TST4:

MOV
OUT
MOV
MOV

TST4_B:

"MP
TEST
R

IN
TST4_A:
TST4_C:

MOV
"MP
IN
CMP

AL ,OBH
MFG_PORT ,AL
AL,SELF TEST
SP,OFFSET C8042A
SHORT C8042
AL ,OUT BUF FULL
TST4 AAL ,PORT A
SP, OFFSET OBF 42A
SHORT OBF 42 AL,PORT AAL,55H -

036C BO OC
036E E6 80

MOV
OUT

AL.OCH
MFC_PORT, AL

0370 75 OF

"NZ

ERRO

0372
0374
0377
0379
031C
037E
0380

MOV
MOV

<> <><><><><><><> <> <> <> <>
<><> CHECKPOINT 08 <><>
SELF TEST COMMAND
SET RETURN ADDRESS
I S THE OUTPUT BUFFER FULL?
GO IF NOT
FLUSH
SET RETURN ADDRESS
GO WA I T FOR BUFFER
GET THE END I NC RESPONSE

<> <><><><><> <> <> <> <> <> <>
<><> CHECKPOINT OC <><>
GO IF NOT OK

GET THE SW ITCH SETT I NGS
BO
BC
EB
BC
EB
E4
E6

CO
03F4 R
10
03F6 R
24
60
82

E30B:

"MP
MOV
"MP

E30C:

IN
OUT

AL, READ 8042 INPUT
SP ,OFFSET C8042C
SHORT C8042
SP, OFFSET OBF 42B
SHORT OBF 42 AL,PORT ADMA_PAGE+ I ,AL

READ I NPUT COMMAND
SET RETURN ADDRESS
I SSUE COMMAND
SET RETURN ADDRESS
GO WA I T FOR RESPONSE
eET THE SW ITCH
SAVE TEMPORARY

WR ITE BYTE 0 OF 8042 MEMORY
0382
0384
0387
0389

BO
BC
EB
74

60
03F2 R
00
05

038B
0380
038F
0390
0390
0392
0394

BO 00
E6 80
F4
BO 50
E6 60
EB 10

MOV
MOV

TST4_D:

MOV
OUT
HLT

TST4 01:
MOV
OUT

"MP

; ----0396 FA
0397 E6
0399
039B
0390
039F
03Al

2B
E4
A8
EO
C3

C8042:
C9
64
02
FA

C42

2B
8:3
E4
A8
75
E2
FE
75
C3

- I,

IN
TEST
LOOPNZ
RET

C9
06
64
01
06
F8
CB
F4

-----

OBF _ 42:

SUB
MOV

IN
TEST
"NZ
LOOP
OEC

"NZ
C42_31

;

AL,ODH
MFG_PORT ,AL
AL, SOH
PORT A, AL
SHORT E30A

WR I TE BYTE COMMAND
SET RETURN ADDRESS
I S SUE THE COMMAND
CaNT I NUE I F COMMAND ACCEPTED

<><><><><><> <> <> <><><><>
<><> CHECK PO I NT 00 <><>
ENABLE OUTPUT BUFFER FULL INTERRUPT,
DISABLE KEYBOARD, SET SYSTEM FLAe,
PC I COMPATIBILITY, INHIBIT OVERRIDE

STATUS_PORT ,AL
CX,CX
AL,STATUS PORT
AL, I NPT_BOF _FULL
C42 I

NO I NTERRUPTS ALLOWED
SEND COMMAND IN AL REG J STER
LOOP COUNT
WA I T FOR THE COMMAND ACCEPTED

-

WAIT FOR 8042 RESPONSE

C42 2,

-

AL, WR I TE 8042 LaC
SP,OFFSET C8042B
SHORT C8042
TST4_DI

I SSUE THE COMMAND TO THE 8042
CLI
OUT
SUB

;
03A2
03A4
03A6
03A8
03AA
03AC
03AE
03BO
03S2

"MP
,JZ

RET

CX,CX
BL,6
AL, STATUS PORT
AL. OUT _BUF_FULL

200MS/PER LOOp· 6
CHECK FOR RESPONSE

--

GO I F RESPONSE
TRY AGAIN
DECREMENT LOOF COUNT

-

RETURN TO CALLER

C42 3
C42 2
BL
C42 2

=1200 MS +

- ---------------------------------- -----

; TEST. I 1
;
BASE 64K READ/WRITE MEMORY TEST
; OESCR I PTI ON
:
:
WRITE/READ/VERIFY DATA PATTERNS I
;
AA,55,FF,OI, AND 00 TO 1ST 64K :
;
OF STORAGE. VER I FY STORAGE
ADDRESSABILITY.
;
; - - -- - - - -- - ---- -- - - - - - - - -- ---

- - -- -- --- -

0383 80 OE
03B5 E6 80
03B7
038A
03BC
03CO
03C 1
03C4

5-42

88
8E
88
FC
B9
28

---- R
08
IE 0072 R
8000
FF

TESTl

;-----

FILL MEMORY WITH DATA

E30A:

MOV
OUT
MOV
MOV
MOV
CLO
MOV
SUB

AL,OEH
MFG_PORT ,AL
AX,DATA
DS,AX
BX • 'PRESET_FLAG
CX,2000H*4
OJ ,01

<><><><><><><><><> <><> <>
<><> CHECKPO I NT
OE <><>
GET THE SYSTEM SEGMENT
OF· DATA
SAVE 'PRESET FLAC IN BX
SET 0 I RECT ION FLAG TO INCREMENT
SET FOR 32K WORDS
FIRST 16K

IBM Personal Computer MACRO Assembler
TESTI ---- Ob/l0/85
POWER ON SELF TEST

1541 03Cb 2B Fb
1542 03C8 2B CO
1543 03CA 8E 08
1544 03CC 8E CO
1545 03CE 81 FB 1234
154b 0302 15 03
1541 0304 E9 0582 R
1548
1549
1550
1551 0301 BO OF
1552 0309 Eb 80
1553
1554 03DB 80 80
1555 0300 Eb 81
1556 03DF BC 03EC R
1551 03E2 E9 0000 E
1558 03E5 8B 08
1559 03E1 15 OF
1560 03E9 E9 0580 R
15bl
1562
1563
15b4 03EC 03E5 R
r 5b5 03EE 0350 R
156b 03FO 03b8 R
1561 03F2 0389 R
r 5b8 03F4 0319 R
15b9 03Fb 037E R
1510
1511
1512
1513
1514
1515
151b
1511
1518
1519
1580
1581
1582 03F8
1583 03F8 8A C1
1584 03FA Eb 81
1585 03FC 8A C3
158b 03FE Eb 82
1581
1588
1589
1590 0400 B9 COOO
1591 0403 8E 09
1592 0405 2B DB
1593 0407 8B 07
1594 0409 E8 00
1595 040B 3D AA55
1596 040E bA 00
1597 0410 14 OC
1598 0412 81 Cl 0080
1599 041b 81 F9 C800
1600 041A 7C E7
lbOl 041C 23 C9
lb02 041E
lb03 041E 75 03
1b04 0420 E9 050F R
lb05
lb06
1607
1608
1 b09
1610
1611
1612
1613
1614
1615 0423 BA 0308
1616 0426 2A CO
1617 0428 EE
1618
1619 0429 BA 0388
1620 042C BO 01
1621 042E EE
1622 042F 83 EA 04
1623
1624 = 0010
1625
1626 0432 BB 0030 E
1627
16280435 B9 0010
1629
1630
1631
1632 0438 32 E4
1633
1634
1635
1636 043A 8A C4
1637 043C EE
1638 0430 42
1639 043E FE C4
1640 0440 2E: SA 07
1641 0443 EE
1642 0444 43
1643 0445 4A
1644 0446 E2 F2
1645 0448 8A E2
1646 044A 80 E4 FO
1641 044D 80 FC DO
1648 0450 74 08
1649 0452 BB 0000 E
1650 0455 BA 0304
1651 0458 EB DB
1652
1653
1654

1-16
06-10-85

Version 2.00
(POST)

SUB
SUB
MOV
MOV
CMP
JNZ
JMP

S I, S I
AX,AX
DS,AX
ES,AX
BX,1234H
E30A 0
CLR_STG

;
;

;-----

GET THE

INPUT BUFFER

E30A

MOV
OUT

AL,OFH
MFG_PORT, AL

MOV
OUT
MOV
JMP
MOV
JNZ
JMP

AL,PARITY_CHECK
DMA_PAGE+6.AL
SP,OFFSET C2
STGTST_CNT
BX,AX
C31
C33

-

"

C30:

WARM START?
GO IF NOT

(SWITCH SETTINGSI

<><><><><><><> <><><><><>
<><> CHECKPO I NT OF <><>
SET BASE MEMORY PAR I TY
USE AS TEMPORARY SAVE
SET RETURN ADDRESS
SAVE FAILING BIT PATTERN
STORAGE OK. CaNT I NUE

TEMPORARY STACK FOR POST ROUTINES
C2
C8042A
OBF 42A
C8042a
C8042C
OBF _ 42B

OW
OW
OW
OW
OW
OW

C30
TST4 B
TST4-C
TST4-0
E30BE30C

.-- - - - - - - - - - - - --- - - - - --- - - - - - - - - - - - - - - - - -;

BASE 64K STORAGE FAILURE
0 I SPLAY THE CHECKPO I NT (MFG CHECKPO I NT I
AND XOR EXPECTED WITH READ IN MFG PORT
DISPLAY CHECKPOINT IN MFG PORT+3
DISPLAY XOR'D DATA HIGH BYTE MFG PDRT+I
LOW BYTE IN MFG PDRT+2
A READ/WRITE SCOPE LOOP OF THE FIRST
WORD FOR POSSIBLE ADDRESS LINE FAILURES

;
;
;
;
;
;
;

C31:
MOV
OUT
MOV
OUT

SAVE HIGH BYTE

AL,BH
MFG PORT+ 1, AL
AL,BL
MFG_PORT+2,AL

SAVE LOW BYTE

CHECK FOR V IDEO ROM
MI:

MOV
MOV
SUB
MOV
JMP
CMP
POP
JZ
AOO
CMP
JL
ANa

CX,OCOOOH
DS,CX
BX,BX
AX, [BX}
S·2
AX ,OAA55H

START OF I/O ROM
POINT TO SEGMENT
GET THE FIRST 2 LOCATIONS

Z5
CX,080H
CX,oe800H
MI
CX,CX

GO IF YES
PO I NT TO NEXT 2K 8LOCK
TOP OF VIDEO ROM AREA YET?
TRY AGAIN
SET NON ZERO FLAG

JNZ
JMP

C32
C31 0

GO IF NOT

BUS SETTLE
I S THE V IDEO ROM PRESENT?

Z5:
BYPASS ERROR DISPLAY
- ;~~ - ~ ~ ~~~ - ~~~~ - ~~ - ~ ~ ;~~~ ~ - ~~~~~~ - ~~~~~ --- -- - - - ---- - - --

IF VIDEO ROM

;

THIS ROUTINE INITIALIZES THE ATTACHMENT TO
,
TO 0 I SPLAY FIRST 64K STORAGE ERRORS.
; BOTH COLOR AND MONOCHROME ATTACHMENTS ARE INITIALIZED.

;

- -- - ---- - - - - ---- - - - - -- -- - - - --- - - - - -- - - - --- - --- --- - - - ---

;-----

I NIT I AL I ZE COLOR / MONOCHROME

C32:

MOV
SUB
OUT

OX ,3D8H
AL,AL
DX,AL

CONTROL REGISTER ADDRESS OF COLOR CARD
MODE SET

MOV
MOV
OUT
SUB

DX,03B8H
AL, I
DX,AL
DX,4

CONTROL REGISTER ADDRESS OF
MODE SET FOR CARD
RESET V IDEO
BACK TO BASE REG I STER

10H

MOV
ASSUME
MOV

eX,OFFSET VIDEO PARMS+M4-3
; POINT TO VIDEO PARAMETERS
DS:CODE
CX,M4
; COUNT OF MONOCHROME V IDEO PARAMETERS

XOR

MOV
OUT
INC
INC
MOV
OUT
INC
OEC
LOOP
MOV
ANa
CMP
JZ
MOV
MOV
JMP

INITIALIZATION TABLE

AH,AH

LOOP THROUGH TABLE,

; -----

CARD

EOU

BX POINTS TO CORRECT ROW OF

Ml 0:

a/w

I AH

J S REG I STER NUMBER OUR I NG LOOP

OUTPUTTING REGISTER ADDRESS,

THEN VALUE FROM TABLE

AL,AH
DX,AL

GET b845 REG I STER NUMBER

OX

POINT TO DATA PORT
NEXT REGISTER VALUE
GET T ABLE VALUE
OUT TO CHIP
NEXT IN TABLE
BACK TO POINTER REGI STER
DO THE WHOLE TABLE
CHECK I F COLOR CARD DONE
STRIP UNWANTED BITS
I SIT THE COLOR CARD?
CaNT J NUE I F COLOR
POINT TO VIDEO PARAMETERS
COLOR BASE
CONTINUE

AH
AL,CS: [BX}
DX,AL
BX

ox

MIO
AH,DL
AH,OFOH
AH,ODOH
Z 3
BX,OFFSET VIDEO PARMS
DX,3D4H
Z_2

FILL REGEN AREA WITH BLANK

TESTt

5-43

IBM Personal Computer MACRO Assembler
TESTI ---- 06/10/85
POWER ON SELF' TEST
1655
1656
1657
1658
1659
1660
1661
16&2
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1 &80
1681
1682
1683
1684
1685
1686
1&87
1666
1689
1690
1691
169Z
1693
1694
1695
1696
1697
1698
1699
1700
1701
170Z
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1711
1718
1119
17Z0
17Z1
1722
1723
17Z4
1725
1126
1727
1728
1729
1730
1731
1132
1733
1734
1135
1736
1737
1138
1739
1740
1741
174Z
1743
1744
1745
1746
1747
1748
1749
1750
1151
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768

045A 33 F'F'
045C 88 8000
045F' 8E CO

Z_31

Version 2.00
(POST)

1-17
06-' 0-85

XOR
MOV
MOV

01,01
AX,OBOOOH
ES,AX

SET UP PO I NTER FOR REGEN
SET UP ES TO VIDEO REGEN

0461 89 0800
0464 88 0720
0467 F'3/ A8

MOV
MOV
REP

CX, Z048
AX, • '+7·H
STOSW

NUMBER OF WORDS I N MONOCHROME CARD
FILL CHARACTER FOR ALPHA + ATTRIBUTE
FILL THE REGEN BUFFER WITH BLANKS

0469
0468
046E
0470
0473

XOR
MOV
MOV
MOV
REP

01,01
BX,OB800H
ES,BX
CX,S192
STOSW

CLEAR COLOR V IDEO BUFFER MEMORY
SET UP ES TO COLOR VIDEO MEMORY

33 F'F'
88 8800
8E C3
89 2000
F'3/ A8

;

-----

0475 8A 0388
0478 BO 29
047A EE

MOV
MOV
OUT

;

-----

0478 42
047C BO 30
047E EE

;

-----

OX,3BSH
AL,29H
OX,AL

SET V IDEO ENABLE PORT

SET UP OVERSCAN REG I STER
INC
MOV
OUT

047F' BA 0308
0482 BO 28
0484 EE

FILL WITH BLANKS

ENABLE V IDEO AND CORRECT PORT SETT I NG

OX

AL,30H
OX,AL

SET OVERSCAN PORT TO A DEFAULT
VALUE 30H FOR ALL MODES EXCEPT 640X200
OUTPUT THE CORRECT VALUE TO 309 PORT

ENABLE COLOR V IDEO AND CORRECT PORT SETTI NG
MOV
MOV
OUT

OX,30SH
AL,28H
OX,AL

SET V IDEO ENABLE PORT

SET UP OVERSCAN REGI STER
0465 42
0466 BO 30
0488 EE

INC
MOV
OUT

; -----

OX

AL ,30H
OX,AL

DISPLAY FAILING CHECKPOINT AND

0489 8C C8
048B 8E DO

MOV
MOV

AX,CS
SS ,AX

0480 8B BOOO
0490 8E 08

MOV
MOV

BX ,OBOOOH
OS,BX

0492
0494
0497
0499
049B
049C
0490

30
0006
FF
05

MOV
MOV
SUB
MOV
INC
INC

AL, '0'
CX,6
01,01
[01] ,AL
01
01

FA

BO
89
28
88
47
47
EZ

SET OVERSCAN PORT TO A DEFAULT
VALUE 30H FOR ALL, MODES EXCEPT 640X200
OUTPUT THE CORRECT VALUE TO 309 PORT

SET STACK SEGMENT TO CODE SEGMENT

SET OS TO B/W DISPLAY BUFFER
DISPLAY BANK 000000
START AT 0
WR I TE TO 0 I SPLA '( REGEN BUFFER
POINT TO NEXT POSITION

LOOP

Z

049F 80 FF 88
04AZ 74 OC
04A4 ZB FF

CMP
JZ
SUB

BH,OB8H

oT.ol

POINT TO START OF BUFFER

04A6
04A8
04AA
04AC
04AE

MOV
MOV
MOV
MOV
JMP

BH,OBOH
ES,BX
BH,OBSH
OS,BX

ES = MONOCHROME
SET SEGMENT TO COLOR
OS
COLOR

87
8E
B7
8E
E8

80
C3
B8
DB
E2

;----048080 ZO
04B2 88 05
0484 26: 88 05
04B7 47
04B8 47
0489 E4 81
04B8 81 04
0480 02 E8
048F BC 057A R
04C2 EB 18
04C4
04C6
04C8
04C8
04CO
04CF
0401
0403
0406
0408
040A
040C

E4
24
BC
E8
E4
Bl

DZ
BC
EB
E4
24
BC

81
OF
057C R
12
82
04
E8
057E R
01
82
OF
0580 R

ZI:

Z2:

Z3,

;----04DF
04El
04E2
04E4

04 90
27
1440
27

04E5
04E7
04EA
04EB
04EC

88 05
26: 88 05
47
47
C3

04ED
04EF
04F'
04F4
04F5
0-4F6
04F8
04FA
04Fo

BO ZO
88 05
Z6: 88 05
47
47
BO 32
88 05
Z6: 88 05
47

PR:

Z

5-44

TEST 1

=

Z_O

PRINT FAILING BIT PATTERN
MOV
MOV
MOV
INC
INC
IN
MOV
SHR
MOV
JMP

(01] ,AL
ES: (01] ,AL
01
01
AL,MFG_PORT+ 1
CL.4
AL,CL
SP "OFFSET Z 1_0
SHORT PR

IN
ANa
MOV
JMP
IN
MOV
SHR
MOV
JMP
IN
ANa
MOV

AL,MFG_PORT+ 1
AL,OFH
SP, OFFSET Z2 0
SHORT PR
AL, MFG_PORT +2
CL,4
AL,CL
SP,OFFSET Z3_0
SHORT PR
AL,MFG_PORT+2
AL,OFH
SP,OFFSET Z4_0

AL,

01 SPLAY A BLANK
WR I TE TO COLOR BUFFER
WR I TE TO MONOCHROME REGEN BUFFER
PO I NT TO NEXT POS I Ti ON
GET THE HIGH BYTE OF FAILING PATTERN
SHIFT COUNT
NIBBLE SWAP

ISOLATE TO LOW NIBBLE
GET THE HIGH BYTE OF FAILING PATTERN
SHIFT COUNT
NIBBLE SWAP

ISOLATE TO LOW NIB8LE
RETURN TO Z4:

CONVERT AND PR I NT
AOO
OAA
AOC
OAA

AL,090H

MOV
MOV
INC
INC
RET

[01] .AL
ES:[OIJ,AL
01
01

AL,040H

01 SPLA Y 20 I
Z4;

CHECK THAT COLOR BUFFER WR I TTEN

I

MOV
MOV
MOV
INC
INC
MOV
MOV
MOV
INC

CONVERT OO-OF TO ASCI I CHARACTER
ADD FIRST CONVERSION FACTOR
ADJUST FOR NUMERIC AND AL:.PHA RANGE
ADD CONVERS I ON AND ADJUST LOW N 18BLE
ADJUST HIGH NIBBLE TO ASCII RANGE
WR I TE TO COLOR BUFFER
WR I TE TO MONOCHROME BUFFER
POINT TO NEXT POSITION

ERROR

AL,' •
[01 J ,AL
ES:[OI],AL
01
01
AL, '2'
(OIJ.AL
ES: (01] ,AL
01

DISPLAY A BLANK
WRITE TO DISPLAY REGEN BUFFER
WR I TE TO MONOCHROME BUFFER
PO I NT TO NEXT POS I TI ON
D I SPLAY 20 I ERROR
WR I TE TO D I SPLA Y REGEN BUFFER
WR I TE TO MONOCHROME BUFFER
POINT TO NEXT POSITION

IBM Perso.,:!l Computer MACRO Assembler
TESTI ---- 06/10/85
POWER ON SELF TEST

1769 04FE 47
1710 04FF 80 30
1771 0501 88 05
1712 0503 26: 88 05
1773 0506 47
1774 0507 47
17750508 BO 31
1776 050,.1, 88 05
1777 050C 26: 8805
1778
1779
1780
1781 050F BO DD
1782 051 I E6 80
17830513 E6 83
17840515 2B C9
17850517
1786
1787 0517 2B CO
17880519 8E 08
1789 051B 88 ,.1,,.1,55
1790 051E 28 FF
1791 0520 89 05
1792 0522 88 05
1793 0524 E2 F I
1794 0526
1795 0526 89 05
1796 0528 88 05
1797 052,.1, E2 FA
1798 052C
1799 052C 89 05
1800 052E 88 05
1801 0530 E2 FA
1802 0532
1803 0532 89 05
1804 0534 88 05
1805 0536 E2 FA
1806 0538
1807 0538 89 05
1808 053A 88 05
1809 053C E2 FA
1810
1811
1812
1813 053E E4 81
1814 0540 E6 80
1815 0542
1816 0542 B8 AA55
1817 0545 89 05
1818 0547 88 05
1819 0549 E2 F7
1820 0548
1821 054B 89 05
1822 054D 88 05
1823 054F E2 FA
1824 0551
1825 0551 89 05
1826 0553 8B 05
1827 0555 E2 FA
1828
1829
1830
1831 0557 E4 82
1832 0559 E6 80
1833 055B B8 AA55
1834 055E 2B FF
1835 0560 89 05
1836 0562 8B 05
1837 0564 E2 F8
1838 0566
1839 0566 89 05
1840 0568 8B 05
1841 056A E2 FA
1842 056C
1843 056C 89 05
1844 056E 88 05
1845 0570 E2 FA
1846 0572
1847 0572 89 05
1848 0574 88 05
1849 0576 E2 FA
1850 0578 E8 95
1851
1852 057,.1, 04C4 R
1853 057C 04CO R
1854 057E 04D8 R
1855 0580 04EO R
1856
1857
1858
1859
1860
1861 0582
1862
18(:,3 0582 F3/ AB
1864 0584 88 ---- R
1865 0587 8E 08
1866 0589 89 IE 0072 R
1867
1868
1869
1870 058D
1871 058D 88 ---- R
1872 0590 8E D8
1873 0592 BC 0000
1874 0595 8E D4
1875 0597 8C 8000
1876
1811
1878
1879 059A C6 06 0084 R
1880
1881059FBOIl
1882 05Al E6 80

INC
MOV
MOV
MOV

INC
INC
MOV
MOV
MOV

01
AL, '0'
[Oll,AL
ES:[Dll,AL
01
01
AL, '1'
(01] ,AL
ES:[Dl),AL

ROLL ERROR CODE
C31

C31

- 0,

AL,OOaH
MFG_PORT, AL
MFG PORT +3, AL

SUB
MOV
MOV
SUB
MOV
MOV

AX,AX
DS,AX
AX,OAA55H
DI,DI
[DI] ,AX
AX, [01]
C31 A

- B,

MOV
MOV

-C,

MOV
MOV

LOOP
C31

- 0,

MOV
MOV

LOOP
MOV
MOV

LOOP
j-----

IN

-G,

MOV
MOV
MOV

LOOP
C31

- H,

C31

- I,

MOV
MOV

LOOP
MOV
MOV

LOOP
;-----

- K,

OUT
MOV
SUB
MOV
MOV

LOOP

- L,

MOV
MOV

LOOP
C31

- M,

MOV
MOV

LOOP
C31

- N,

MOV
MOV

LOOP
JMP

ZI
Z2
Z3
Z'

FIRST THE CHECKPOINT

<><><><><> <> <><> <><><><>
<><> CHECK PO I NT aD <><>
ALSO DISPLAY CHECK POINT IN PORT 83

- 00
-- 00

; -----

OW
OW

ow
ow

READ THE FIRST WORD

0] SPLAY CHECKPO I NT LONGER

AX, [0] 1
C31 B

-

[Oll,AX
AX, [011
C31 C

-

[OI],AX
AX, [DI]
C31 0

-

[DI],AX
AX, [D11
C31 E

-

IN MFG_PORT --> NEXT THE HIGH BYTE

AL,MFG_PORT+ I
MFG _PORT, AL

XOR OF FAILING BIT PATTERN
HIGH BYTE

AX,OAA55H
(Dll,AX
AX, [01]
C31 G

WR I TE AN AA55
READ THE FIRST WORD

-

[OI],AX
AX, [DI]
C31 H

-

[OI],AX
AX, [D]]
C31 I

-

]N MFG_PORT

AL,MFG_PORT+2
MFG_PORT ,AL
AX ,OAA55H
OI,D]
{Ol] ,AX
AX. [01]
C31 K

-->

THEN THE LOW BYTE
LOW BYTE
WR I TE AN AA55

;

READ THE FIRST WORD

-

[011.AX
AX,[OI]
C31 L

-

[01] ,AX
AX, (01]
C31 M

-

[0]] ,AX
AX, (01]
C31 N
C31 0

-

ZI
'2
Z3

Z4

DO AGAIN
TEMPORARY
TEMPORARY
TEMPORARY
TEMPORARY

STACK
STACK
STACK
STACK

CLEAR STORAGE ENTRY

CLR STG:
ASSUME
REP
MOV
MOV
MOV
j-----

SETUP SEGMENT
WR I TE AN AA55

-

ROLL ERROR CODE
IN

C31

-->

[0]] ,AX

ROLL ERROR CODE

OUT

C31

WRITE TO DISPLAY RECiEN BUFFER
WR I TE TO MONOCHROME BUFFER

cX,Ex

C31 _E:

C31

WRITE TO DISPLAY REGEN BUFFER
WR I TE TO MONOCHROME BUFFER
PO I NT TO NEXT POS I TI ON

-A,

LOOP
C31

IN MFG_PORT

MOV
OUT
OUT
SUB

LOOP
C31

1-18
06-( 0-85

Versio., 2.00
(POST)

OS:OATA
STOSW
AX,OATA
OS,AX
(IRE SET _FLAG, BX

STORE 32K ¥lORDS OF 0000
RESTORE DATA SEGMENT
RESTORE RESET FLAG

SETUP STACK SEGMENT AND SP

C33:
MOV
MOV
MOV
MOV
MOV

AX,OATA
OS,AX
SP,POST SS
SS, SP
SP,POST_SP

SET DATA SEGMENT
GET STACK VALUE
SET THE STACK UP
ST ACK I S READY TO GO

] N I TI ALI ZE 0] SPLA Y ROW COUNT
18

MOV

oltROWS,25-1

MOV
OUT

AL,IIH
MFG_PORT ,AL

SET ROWS FOR PRINT SCREEN DEFAULT

<><><><><><><> <><><><><>
<> <> CHECKPO I NT
1 1 <> <>

TESTl

5-45

IBM Personal Computer MACRO Assembler
TESTI ---- 06/10/85
POWER ON SELF TEST
1883
1684
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1696
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
191 I
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1936
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
,958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1966
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996

Version 2.00
(POST)

1-19
06- I 0-85

VERIFY SPEED/REFRESH CLOCK RATES
05A3
05A5
05A7
05A8
05A6
05AA
05AC
05AE
05AE
05BO
0582

32 08
33 C9
90

(ERROR

=

1 LONG AND

1 SHORT BEEP)

8L,BL
CX,CX

; CLEAR REFRESH CYCLE REPEAT COUNT
; INITIALIZE SPEED RATE REGISTER
; PLACE ON EVEN WORD BOUNDARY

IN
TEST
LOOPZ

AL.PORT 8
AL,REFRESH BIT
C34
-

;
;

IN

AL,PORT B
AL,REFRESH 81T
C35
-

READ REFRESH BIT REG I STER
MASK FOR BIT
DECREMENT LOOP COUNTER TILL OFF
DECREMENT REFRESH CYCLE REPEAT COUNT
REPEAT TILL CYCLE COUNT DONE

XOR
XOR

EVEN
C34:

E4 61
A8 10
El FA

READ REFRESH BIT REGISTER
MASK FOR 81T
DECREMENT LOOP COUNTER TILL ON

C35:
E4 61
A8 10
EO FA

TEST
LOOPNZ

0584 FE CB
05B6 75 FO

OEC
JNZ

BL

05B8
05BC
05BE
058E
05C 1
05C4
05C5
05C5
05C9

CMP
JAE

CX ,RATE UPPER
C36
-

CHECK FOR RATE BELOW UPPER LIMIT
SKIP ERROR 8EEP IF BELOW MAXIMUM

MOV

DX,0101H
ERR_BEEP

GET BEEP COUNTS FOR REFRESH ERROR
CALL TO POST ERROR BEEP ROUT I NES
HALT SYSTEM - BAD REFRESH RATE

osce
OSCO
05CF
0502
0504

81 F9 F8A7
73 07

C3.

C36E:
8A 0101
E8 0000 E
F4

CALL

HLT
C36;

81

F9 F9FO
77 F3

E4
24
A2
2A
E6

82
F8
0012 R
CO
82

CMP
JA

CX .RATE LOWER
C36E
-

GET THE

INPUT BUFFER

CHECK FOR RATE ABOVE LOWER LIMIT
GO TO ERROR BEEP IF 8ELOW M J N I MUM
(SWITCH SETTINGS)

IN
ANa
MOV

STRIP SITS

SUB

OUT

;
;
;

;
I

;

---- --- - - - -- -- -- - - -- ------ - -- - --- -----TEST.llA
VERIFY 286 LGOT/SGOT LlOT/SIDT
I NSTRUCTI ONS
DESCRIPTION
LOAD GOT AND lOT REGISTERS WITH
AA,55,OO AND VERIFY CORRECT.

-------- - --- -- - -- - - - - - - - - - - - ---- --- --- --:

;----0506 OF 01 EO
0509 A9 OOOF
050C 75 34

VERIFY STATUS

INDICATE COMPATIBILITY

{REAL~

MODE

SMSW

AX

GET THE CURRENT STATUS WORD

OB

OOFH,OOIH,OEOH
AX,OFH
ERR_PROT

PE/MP/EM/TS BITS SHOULD BE ZERO
GO IF STATUS NOT REAL MODE

TEST
JNZ

TEST PROTECTED MODE REG I STERS
050E BO 12
05EO E6 80

MOV
OUT

05E2
05E3
05E4
05E7
05EA
05EO
05FO
05F3
05F6
05F8

IE
07
SF
89
B8
E8
88
E8
28
E8

PUSH

05F8
05FC
05FO
05FE
0601
0603
0606
0608
0609
060A
0608
060E

FO
9C
56
A9
75
A9
74
FC
9C
58
A9
75

POP
MOV
MOV
MOV

OOAO
0003
AAAA
0615 R
5555
0615 R
CO
0615 R

CALL
MOV

CALL
SUB
CALL
I -----

; USE TH I S AREA TO BU I LO TEST PATTERN
FIRST PATTERN
WRITE NEXT PATTERN
WRITE 0

TEST 286 CONTROL FLAGS
;
;

PDP

AX

TEST

AX,0200H
ERR PROT
AX,0400H
ERR_PROT

JNZ

TEST
JZ
CLO
POP

AX

TEST
JNZ

AX,0400H
ERR_PROT

JMP

SHORT C37A

MOV

OB

OF
+ 110001

+
+ 110002

[BP]
OOFH
BYTE
BX,WORD PTR [BP]
BYTE
OFFSET CS: 110001
001H
OFFSET CS; 110002
BP,SYS lOT LOC
ES
026H
[BP]
OOFH
BYTE
OX,WORD PTR [81"]
BYTE
OFFSET CS: 110004
OOIH
OFFSET csn10005

LABEL
MOV
LABEL
ORG

OB
ORG
MOV

SEGOV

DB
LGOT

TESTl

OB
110004

LABEL
MOV

110005

LABEL
ORG

OB
ORG

;

STORE 6 BYTES OF PATTERN

;

LOAD THE

;

REGI STER FROM THI S AREA

;

LOAD THE GOT

;

FROM THE SAME AREA

lOT

026H

OB

01

0625 26

CX,3
STOSW
~~,SYS_IOT_LOC

LIDT

BD DOAO

0626 OF
0627
0627 8B 56 00
062A
0627
0627 01
062A

TEST OK CONTINUE

WRITE TO 286 REGISTERS

WRT PAT;MOV
REP

0610 26

GO IF NOT

PROTECTED MODE REGISTER FAILURE
I NSURE NO BREAKOUT OF HALT

JMP

SEGOV

88 5E 00

I

ERR PROT I
HLT

1-----

SET 0 I RECT I ON FLAG FOR DECREMENT
GET THE FLAGS
I NTERRUPT FLAG SHOULD 8E OFF
GO IF NOT
CHECK DIRECTION FLAG
GO IF NOT SET
CLEAR 0 I RECT I ON FLAG
INSURE DIRECTION FLAG IS RESET

PUSHF
0400
02

0615 89 0003
0618 F3/ A8
061A BO DOAO

5-46

SET ES TO SAME SEGMENT AS OS

ES

STO

0610 E8 3D
0612
0612 F4
0613 EB FO

061E
061F
061F
0622
061F
061F
0622
0622

as

DI,SYS IOT_LOC
CX,3
AX,OAAAAH
WRT PAT
AX,05555H
WRT PAT
AX.AX
WRT _PAT

PUSHF
0200
OF
0400
OA

<><><><><><><><> <><><><>
<><> CHECKPOINT 12 <><>

AL,12H
MFG_PORT, AL

IBM Perllonal Computer MACRO AlIlIembler
TESTI ---- 06/10/65
POWER ON SELF TEST
1997
1996
1999
2000 062A
2001
2002 0620
2003
2004 062E
2005 062F
2006 062F
2007 0632
2008 062F
2009 062F
2010 0632
201 I 0632
2012
2013 0635
2014
2015 0636
2016 0631
20170637
2018 063A
2019 0637
2020 0637
2021 063A
2022 063A
2023 0630
2024 063F
2025 0642
2026 0645
2027 0648
2028 064A
2029 0648
2030 064C
2031 064E
2032
2033
2034
2035
2036
2037 064F
2038 064F
2039 0651
2040 0653
2041 0655
2042 0651
2043 0659
2044 0658
2045 0650
2046
2047 065F
2048 0661
2049 0663
2050 0665
2051 0667
2052 0669
2053 066B
2054 0660
2055
2056
2051
2058
2059
2060 066F
2061 0671
2062
2063 0673
2064 0675
2065 0677
2066 0679
2067 067B
2068 0670
2069 067F
2070 0681
2071 0683
2012 0685
2013 0687
2014 0669
2075 068B
2016 0680
2017
2078
2019
2080 068F
2081 0691
2082
2083 0693
2084 0696
2085 0696
2086 069A
2081 069D
2088 069E
2089 06AO
2090 06A I
2091
2092
2093
2094 06A3
2095 06A5
2096
2097
2098 06A 7
2099 06AA
2100 06AB
2101 06AC
2102 06AE
2103 06Bl
2104
2105 06B4
2106 0685
2107 06B6
2108 0687
2109
2110

;----BO 08AO
26
OF
n0007
88 4E 00
110006
0 I
BD D6A5
26
OF
nOOOA
034600
11000B
0I
BF DOAO
8B 05
89 0005
BE D8AO
26: 38 04
75 C8
46
46
E2 F7
C3

C37B:

;

1-20
06-10-a5

VerlllOn 2.00
(POST)

READ AND VERIFY 286 REGISTERS
MOV
SEGOV
DB
SlOT
DB
LA8EL
MOV
LABEL
ORG
DB
ORG
MOV
SEGOV
DB
SGOT
DB
LABEL
ADD
LABEL
DRG
DB
ORG
MDV
MDV
MOV
MOV
CMP
JNZ

BP,GDT LOC
E5
026H
[BP]
OOFH
8YTE
CX, [8P)

INC
INC

51 51

LOOP
RET

C37B

;

STORE THE REG I STERS HERE

; GET THE

IDT REGI STERS

BYTE
OFFSET CS: 110007
OOIH
OFFSET CS: 710008
BP,GDT LOC+5
E5
026H
[BP)
OOFH
BYTE
AX, [BP]

GET THE GOT REG I STERS

BYTE

OFFSET CS: ?1000A
OOIH
OFFSET CS: 11000B
ol,SYS lOT LOC
AX, [OIT
CX,5
S I ,GOT LOC
AX.ES:Tsl}
ERR PROT

GET THE PATTERN WR I TTEN
CHECK ALL REG I STERS
POINT TO THE BEGINNING
HALT I F ERROR
PO I NT TO NEXT WORD
CONT I NUE TILL DONE

- - - - - - - ----- -- - -- - - --- - - - - - -- --- - - - -- - - - ---- - - ----- - - ---

;

INITIALIZE THE 8259

INTERRUPT #1

CONTROLLER CHIP:

~;;~;----------------------------------------------------

2A
E6
BO
E6
E8
80
E6
EB

CO
Fl
I I
20
00
08
21
00

SUB
OUT
MOV
OUT
JMP
MOV
OUT
JMP

BO
E6
EB
BO
E6
EB
BO
E6

04
21
00
01
21
00
FF
21

MOV
OUT
JMP
MOV
OUT
JMP
MOV
OUT

;
;

;

AL,AL
X287+I,AL
AL,IIH
INTAOO.AL

'.2
'.2
'.2
'.2

ICWI

EDGE. MASTER,

SETUP ICW2 -

AL,a
INTAOI.AL

ICW4

I NTERRUPT TYPE a

(8-F)

110 DELAY

AL,04H
INTAOI,AL

I

AL,OIH
INTAOI,AL

SETUP I CW3 -

MASTER LEVEL 2

110 DELAY
SETUP ICW4 -

MASTER,8066 MODE

110 DELAY
MASK ALL I NTERRUPTS OFF
(V IDEO ROUT I NE ENA8LES INTERRUPTS)

AL,OFFH
INTAOI,AL

- - -- --- ------- - ------- ------ - - ---------- - -- ---- - - - ------THE 6259 INTERRUPT #2 CONTROLLER CHIP
:
-- - - - - - --INITIALIZE
------ --- - --- -- - - - - ----- - - - - -- - - - -- - - - - --- - - - - -MOV
OUT

AL,I3H
MFG_PORT ,AL

BO
E6
EB
BO
E6
BO
EB
E6
E8
BO
E6
EB
BO
E6

MOV
OUT
JMP
MOV
OUT
MOV
JMP
OUT
JMP
MOV
OUT
JMP
MOV
OUT

AL,IIH
INTBOO,AL

II

AD
00
70
AI
02
00
AI
00
01
AI
00
FF
AI
;-----

AL,OFFH
INTBOI,AL

SET UP THE

CX,76H

SLAVE ICW4
INTERRUPT TYPE 70

SETUP ICW3 -

SLAVE LEVEL 2

I/O DELAY
SETUP JCW4 -

6066 MODE,

( 70-7F)

SLAVE

I NTERRUPTS OFF

MASK ALL

INTERRUPT

<><> <><><><><><><><><><>
<><> CHECKPOINT
14 <><>
FILL ALL INTERRUPT LOCAT IONS
FIRST INTERRUPT LOCATION
SET (ES) ALSO
GET ADDRESS OF I NTERRUPT OFFSET
PLACE I N I NTERRUPT VECTOR LOCAT I ON
GET THE CURRENT CODE SEGMENT
PLACE CODE SEGMENT I N VECTOR LOCAT I ON

01,01
ES,DI
AX,OFFSET OIl
AX,CS

03

ESTABLISH BIOS SUBROUTiNE CALL

INTERRUPT VECTORS

BO 15
E6 80

MOV
OUT

AL.15H
MFG_PORT ,AL

BF 0040 R
OE
IF
8C D8
8E 0010 E
B90010

MOV
PUSH
POP
MOV
MOV
MOV

01 ,OFFSET ~VIDEO INT
CS
OS
AX,DS
•
SI,OFFSET VECTOR TABLE+16
CX,I6
-

MOVSW
INC
INC
LOOP

DI
01
D3A

03A:

EDGE,

INTERRUPT VECTORS TO TEMPORARY

AL,14H
MFG_PORT, AL

;-----

-

110 DELAY

MOV
OUT

C8

ICWI

110 DELAY
SETUP JCW2 -

INTBO' ,AL

AL,OIH
INTBOI,AL

MDV
SUB
MOV
MOV
STOSW
MOV
STOSW
LOOP

Fl

I

'.2
'.2
'.2
'.2

B9
2B
8E
B8
AB
6C
AB
E2

03:

<><><><><><><> <> <><><><>
<><> CHECKPO I NT
13 <><>

AL,INT TYPE
INTBO'-;-AL
AL.02H

BO 14
E6 80

AS
47
47
E2 FB

-

110 DELAY

BO 13
E6 80

0078
FF
C7
0000 E

; RESET MATH PROCESSOR

<><><><><><><><><><><><>
<><> CHECKPO I NT
15 <><>
SET VIDEO

INTERRUPT AREA

SET UP ADDRESS OF VECTOR TA8LE
SET AX=SEGMENT
;START WITH VIDEO ENTRY
MOVE VECTOR TABLE TO LOW MEMORY
SK I P SEGMENT PO INTER

TESTl 5-47

IBM Peraonal Computer MACRO Aaaembler
TESTI ---- 06/10/85
POWER ON SELF TEST
2111
2112
2113
2114
2115
2116
2117
2118 0689
2119
2120 06BC
2121 06BE
2122
2123
2124
2125 06CO
2126 06C2
2127 06C5
2128 06C7
2129
2130 06C9
2131 06CB
2132 06CE
21330600
2134
2135 0602
2136
2137
2138
2139 0604
2140 0606
2141
2142 0608
2143 0608
2144 06DE
2145 06EO
2146 06E2
2147 06E5
2148
2149
2150
2151 06El
2152 06EA
2153 06EO
2154 06F3
2155
2156 06F5
2151 06Fl
215806F9
2159 06F9
2160 06FB
2161 06FB
2162 06FO
2163
2164 0100
2165 0102
2166 0104
2167 0106
2168
2169 0108
2110 010A
2111 0100
2112 010F
21130111
21140113
21150115
21160111
2117 0719
2118 011B
2119 OliO
2180 0120
2181 0122
2182 0124
2163 0121
2184 0129
2185
2186
2161
2188 012B
2189 012E
2190 0131
2191 0733
2192 0135
2193
2194
2195
2196 0138
2191 0138
2198 073B
2199 013E
2200 0740
2201
2202 0142
2203 0744
2204 0746
2205 0149
2206 0149
2201 014B
2208
2209
2210
2211 0740
2212 014F
2213 0151
2214
2215
2216
22110153
2218 0155
2219
2220 0157
2221 015A
2222
2223 0150
2224 0160

5-48

Version 2.00
(POSn

1-21
06-10-85

TEST.12
VERIFY CMOS CHECKSUM/BATTERY OK
OESCR I PT I ON
OETERM I NE IF CONF I G RECORD
CAN BE USED FOR INITIALIZATiON.

:
:
:
:

: ---- ------------------ -----------------E8 0000 E

ASSUME
CALL

OS:OATA
DDS

BO 16
E6 80

MOV
OUT

AL,16H
MFG_PORT ,AL

:-----

SET THE DATA SEGMENT

'<>'<> '<>'<> '<>'<>'<>'<>'<> '<> '<> '<>
'<>'<> CHECKPO I NT
16

IS THE BATTERY LOW THIS POWER UP?

BO
E8
A8
74

80
0000 E
80
DB

MOV
CALL
TEST
JZ

AL, CMOS REG O+NM I
CMOS REAO
AL,10000000B
CMOS 1 A

80
E8
A8
74

8E
0000 E
80
15

MOV
CALL
TEST
JZ

AL, CMOS 0 I ACi+NM I
CMOS READ
AL,BAD BAT
CMOS I -

GET THE OLD STATUS
FROM DIAGNOSTIC STATUS BYTE
HAS CUSTOMER SETUP BEEN EXECUTED?
GO CHECK CHECKSUM IF YES

JMP

SHORT CMOS4

CONT I NUE WITHOUT CONF I GURAT I ON

E8 64

;
;

CHECK BATTERY CONDiTiON
READ THE BATTERY STATUS
IS THE BATTERY LOW?
ERROR IF YES

SET DEFECTIVE BATTERY FLACi
80 17
E6 80
88
E8
OC
86
E6
EB

8E8E
0000 E
80
C4
0000 E
51

88
E6
61
15

8E6E
0000 E
3E 0012 R 1234
04

24 10
EB 02

CMOSIA:

MOV
OUT

AL,11H
MFG_PORT ,AL

MOV
CALL

AX,X·{CMOS DIAG+NMI!
CMOS READ AL,BAO BAT
AL,AH CMOS WR ITE
SHORT
CMOS4

OR
XCHCi
CALL
JMP
;-----

VERIFY CHECKSUM

CMOS I:

MOV
CALL
CMP
JNZ

ANa
JMP
A:
SUB
CMOS 1 B:
XCHG
CALL

'<>'<>'<> '<> '<> '<>'<>'<>'<> '<>'<>'<>
17 '<>'<>
'<>'<> CHECKPOINT
CMOS DIAGNOSTIC STATUS BYTE
GET THE CURRENT STATUS
SET THE DEAD BATTERY FLAG
SAVE
OUTPUT THE STATUS
GO TO MINIMUM CONFIGURATION

AX,X·(CMOS DIAG+NMI)
CMOS READ IIIRESET FLAG, 1234H
CMOS I_A

CLEAR OLD STATUS
GET THE CURRENT STATUS
IS THIS A SOFT RESET
GO IF NOT

AL,W MEM SIZE
SHORT CMOS I_B

CLEAR ALL BUT THE CMOS/POR MEMORY SIZE

AL,AL

CLEAR STATUS

CMOSI
2A CO
86 C4
E8 0000 E
2B
2B
BI
B5

DB
C9
90
AE

8A
E8
2A
03
FE
3A
15
DB

CMOS2:

BO
E8
8A
BO
E8
3B
74

CI
0000 E
E4
08
CI
E9
FI
DB
10
AE
0000 E
EO
AF
0000 E
C3
00

;-----

SET CMOS CHECKSUM ERROR

B8
E8
DC
86
E8

8E8E
0000 E
40
C4
0000 E

CMOS3:

MOV
CALL

14

SUB
SUB
MOV
MOV

BX,BX
CX,CX
CL,CMOS 01 SKETTE+NM I
CH,CMOS=CKSUM_HI +NM I

MOV
CALL
SUB
AOO
INC
CMP
JNZ

AL,CL
CMOS READ
AH,AH
BX,AX

OR
JZ
MOV
CALL
MOV
MOV
CALL
CMP
JZ

OR
XCHG
CALL

IF POWER ON RESET

SAVE THE CURRENT STATUS

SET START OF CMOS CHECKSUMEO AREA
SET END OF CMOS CHECKSUMED AREA + 1
(FIRST BYTE OF CHECKSUM!
ADDRESS THE BEGINNING
INSURE AH=O
ADD TO CURRENT VALUE
PO I NT TO NEXT BYTE ADDRESS I N CMOS
FINISHED?
(AT CHECKSUM BYTE HIGH)
GO IF NOT
BX MUST NOT BE 0
CMOS BAD IF CHECKSUM=O
GET THE CHECK SUM HIGH BYTE
FIRST BYTE OF CHECKSUM
SAVE IT
SECOND BYTE OF CHECKSUM

CL
CH,CL
CMOS2
BX,BX
CMOS3
AL,CMOS CKSUM HI+NMI
CMOS READ
AH,AL
AL,CMOS CKSUM LO+NMI
CMOS READ
AX,BX
CMOS4

I S THE CHECKSUM OK
GO IF YES

AX,X·{CMOS DIAG+NMI)
CMOS READ AL ,BAD CKSUM
AL,AH CMOS_WRITE

ADDRESS DIAGNOSTIC STATUS
GET THE CURRENT STATUS
SET BAD CHECKSUM FLAG
SAVE IT
SET FLAG

I NSURE CMOS 0 I V I DERS SET
CMOS4:
B8
E8
24
75

8A8A
0000 E
OF
01

BO 26
86 C4
E8 0000 E

MOV
CALL
ANa
JNZ

AX,X·{CMOS REG A+NMI!
CMOS READ AL,OOFH
CMOS9

ADDRESS CMOS REGISTER A
GET CURRENT 0 I V I SOR S
LOOK AT PERIODIC RATE BITS
EX I T I F SET TO SOMETH I NG USEFUL

MOV
XCHG
CALL

AL ,26H
AL,AH
CMOS_WR ITE

ELSE SET THE STANDARD DEFAULT USED BY
BIOS FOR THE 916.56 US RATE
FOR THE PER I 00 I C CLOCK

MOV
OUT

AL,18H
MFG_PORT, AL

CMOS9:
BO 18
E6 80
;-----

'<>'<> '<>'<>'<> '<>'<>'<>'<>'<>'<>'<>
18 '<>'<>
'<>'<> CHECKPO I NT

ENABLE PROTECTED MODE

E4 61
DC OC
E6 61

OUT

BO 19
E6 80

MO'
OUT

AL,19H
MFG_PORT ,AL

B8 018F
E8 0000 E

MOV
CALL

AX, I ·H+ (CMOS SHUT DOWN+NM I !
: SET THE RETURN ADDRESS FOR
CMOS_WRITE
I THE FIRST SHUTDOWN RETURN ADDRESS

BC 0000
8E 04

MO'
MO'

SP,POST SS
SS, SP
-

IN

OR

AL,PORT B
AL, RAM PAR OFF
PORT_B:AL -

SET RETURN ADDRESS BYTE

TESTl

DISABLE MEMORY AND

I/O PARITY CHECKS

IN CMOS

'<>'<>'<>'<>'<>'<>'<>'<>'<>'<>'<> '<>
'<>'<> CHECKPO I NT
19 '<>'<>

;

SET STACK FOR SYSINITI

IBM Personal Computer MACRO Assembler
TESTI ---- 06/10/85
POWER ON SELF TEST

2225 0162
2226 0165
2221
2228
2229 0166
2230 016.1.
2231
2232
2233
2234 016C
2235 016E
2236 016F
2231 0115
2238 011.1.
2239 0170
2240 011F
2241
2242
2243
2244
2245
2246
2241
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259 0182
2260 0185
2261 0168
2262
2263 016.1.
2264 0180
2265 0190
2266
2261
2266
2269 0193
2270 0194
2211
2212
2273
2214 0196
2215
2276
2217
2216 019C
2219
2280
2261
2282 01AI
2283 01.1.6
2284
2285 01AC
2286 01AE
2281
2288 01BO
2289
2290
2291
2292 0183
2293 01B3
2294 0185
2295 01B6
2296 01B9
2291 018B
2298
2299 018E
2300 018E
2301
2302
2303
2304 01C 1
2305
2306
2301
2308 01C5
2309 01CA
2310 01CC
2311 01eF
2312
2313
2314
23150702
2316 0702
2311 0104
2318 0701
2319 0709
2320 070C
2321 070E
2322 OlE 1
2323 01E4
2324 01E6
2325
2326 01E8
2321 01E9
2328 01EB
2329
2330
2331
2332 01EC
2333 01F2
2334 01F3
2335
2336
2331
2338 07F5

1-22
06-10-85

Version 2.00
(POST)

BC 8000
E8 0000 E

"OV

BO I A
E6 80

"OV

; CALL THE DESCRIPTOR TABLE BUILDER
AND REAL-TO-PROTECTED MODE SWITCHER

CALL

OUT

<><><><><><><><><><><><>
<><> CHECKPOINT lA <><>

AL,IAH
MFG _PORT, AL

SET TEMPORARY STACK
6A
IF
Cl
C6
BE
8E
BC

06

PUSH
POP

06 005.1. 0000
06 005C 00
0056
06
FFFD

"OV

,

SET

(OS II

SELECTOR TO GOT SEGMENT

"OV

"OV
"OV
MOV

;
;
;

----- -- - -- - - - ---- - - - - -- - - --- -- - - - ----- --- - - - - ---- - ----- - - ---- -- - -- --- ---- -- --TEST. 13
PROTECTED MODE TEST AND MEMORY SIZE DETERMINE

--> 640K I

(0

;
; DESCR I PT I ON:
;

;
;
;
;

;

THIS ROUTINE RUNS IN PROTECTED MODE IN ORDER TO.ADDRESS ALL OF STORAGE.
IT CHECKS THE MACHINE STATUS WORD (MSW} FOR PROTECTED MODE AND THE BASE
MEMORY SIZE IS DETERMINED AND SAVED.
BIT 4 OF THE CMOS DIAGNOSTIC
STATUS BYTE IS SET IF 512K --> 640K MEMORY IS INSTALLED.
OUR I NG A POWER UP SEQUENCE THE MEMORY SIZE DETERM I NE 1 S DONE WITH
PLANAR AND I/O PARITY CHECKS DISABLED.
DURING A SOFT RESET THE MEMORY
SIZE DETERMINE WILL CHECK FOR PARITY ERRORS.

;-----

F4
EB FD

GET THE MACHINE STATUS WORD

AX

SHUT_S:

MOV
CALL

AX, S-H+ (CMOS SHUT DOWN+NM I).
; SET THE RETURN ADDRESS
CMOS WR I TE
; AND SET SHUTDOWN 6
PROC:SHUTODWN
; CAUSE A SHUTDOWN

; -----

V I RTUAL MODE ERROR HALT

SHUTS:

HLT

OF 0 I EO
A9 000 I
75 OC
B8 086F
E6 0000 E
E9 0000 E

INSURE PROTECTED MODE
SMSW
OB
TEST
JNZ

J"P

J"P
;-----

OOFH. 00 I H. OEOH

~~I(~~TUAL_ENABLE

ARE WE

SHUT8

;

I N PROTECTED MODE

ERROR HALT

64K SEGMENT LIMIT

Cl 06 0046 FFFF
;-----

CPLO. DATA ACCESS RIGHTS
MOV

C6 06 0040 93
;-----

BYTE PTR OS: (ES_TEMP.DATA_ACC_RIGHTS) ,CPLO_DATA_ACCESS

START WITH SEGMENT ADDRESS 01-0000

(SECOND MK)

C6 06 004C 01
Cl 06 004A 0000

MOV
MOV

BYTE PTR OS: (ES TEMP.BASE HI BYTE) .OtH
DS:ES_TEMP.BASE:LD_WORD,OH-

BO IB
E6 80

MOV
OUT

AL, tBH
MFG_PORT • AL

88 0040

"OV
;-----

6A
01
E8
14
E9

48
0102 R
03
0810 R

83 C3 40

<><> <><><;>0<><><><><><><>
<><> CHECKPO I NT 1B <><>
SET THE FIRST 64K DONE

START STORAGE SIZE/CLEAR

NOT DONE:
PUSH
POP
CALL
JZ

J"P

ES

-

NOT FIN:
.1.00

FE 06 004C

INC

(OXOOOO)

BLOCK

BYTE PTR OS: (ES_TEMP.BASE_HI_BYTE\

CHECK FOR ENO OF FIRST 640K
CMP
..JNZ
CALL
..JMP

3E 004C OA
El
0840 R
0810 R
;-----

28 FF
88 AA55
8B C8
26: 89 05
80 OF
26: 88 05
26: 89 05
33 C 1
15 65
1E
6A 16
IF

POINT ES TO DATA
PO I NT TO SEGMENT TO TEST
DO THE FIRST 64K
CHECK IF TOP OF MEMORY

8UMP MEMORY COUNT BY 64K

DO NEXT 64K

80
15
E8
E9

:
;
I
1

BYTE PTR ES TEMP
HOW BIG
NOT-FIN
DONE

(END OF BASE MEMORY)

BYTE PTR OS: IES TEMP. BASE HI 8YTE) ,OAH
NOT DONE
;-GO-IF NOT
HOW-BIG END
; GO SET MEMORY SIZE
DONE-

FILL/CHECK LOOP

HOW BIG:
SUB
"OV
MOV

JNZ

01.01
AX,OAA55H
CX,AX
ES; [01] ,AX
AL.OFH
AX.ES:[DI]
ES; [01] ,AX
AX,CX
HOW_BIG_END

PUSH
PUSH

BYTE PTR RSDA PTR

"OV
"OV

MOV
"OV
XOR

POP

;
I
I
;
;
;
;
;

as
os

TEST PATTERN
SAVE PATTERN
WRITE PATTERN TO MEMORY
PUT SOMETH I NG IN AL
GET PATTERN
INSURE NO PARITY I/O CHECK
COMPARE PATTERNS
GO END I F NO COMPARE
POINT TO SYSTEM DATA AREA
GET (OS;)

-

IS THIS A SOFT RESET

e"p

81 3E 0012 R 1234
IF
15 36

POP
JNZ

26: Cl 05 0101

MOV

PRESET FLAG, 1234H

as

SOFT RESET
RESTORE OS
GO I F NOT SOFT RESET

-

HOW_8I G_2

INSURE NO PARITY WITH PARITY BITS OFF
WORD PTR ES:[DI].010IH

;

TURN OFF BOTH PARITY 8ITS

TEST1

5-49

IBM Personal Computer MACRO A55embler
TESTI ---- 06/10/85
POWER ON SELF TEST

2339
2340 01FA E4 61
2341 01FC DC OC
2342 01FE E6 61
2343 0800 24 F3
2344 0802 E6 61
2345 0804 6A FF
2346 0806 58
2341 0801 26: 88 05
2348
2349 080A E4 61
2350 080C 24 CO
2351 080E 26: 89 05
23520811 75 3A
2353
2354
2355
2356 0813 26: C7 05 FFFF
2357 DB 18 26: 89 05
2358081950
2359 081C E4 61
2360 081E 24 CO
2361 0820 26: 89 05
2362 0823 58
2363 0824 75 21
2364 0826 3D FFFF
2365 0829 75 22
2366
2367
2368
2369 0828
2370 0828 28 CO
2311 0820 89 8000
2312 0830 F3/ AS
2313
2314 0832 IE
2375 0833 06
2316 0834 06
2317 0835 IF
2378 0836 89 BOOO
2319 0839 28 F6
2380 0838 F3/ AD
2381 0830 28 FF
2382 083F E4 61
2383 0841 24 CO
2384 0843 26: C1 05 0000
2385 0848 07
2386 0849 IF
2387 084A 15 01
2388
2389 084C C3
2390
2391 0840
2392 0840 9C
2393 084E 60 1C
2394 0850 E6 80
2395
2396
2397
2398 0852 88 8383
2399 0855 E8 0000 E
2400 0858 OC 80
2401 085A 81 F8 0200
2402 085E 77 02
2403 0860 24 7F
2404 0862
2405 0862 86 C4
2406 0864 E8 0000 E
2407
2408 0867 6A 18
2409 0869 1F
2410 086A 89 IE 0013 R
2411 OB6E 90
2412 086F C3
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426 0870
2427 0870 6A 08
2428 0872 IF
2429
2430
2431
2432 0873 C6 06 004C 10
2433 087B C7 06 004A 0000
2434
2435 087E 80 10
2436 0880 E6 80
2437
2438 0882 28 08
2439
2440
2441
2442 0884
2443 0884 6A 48
2444 0886 07
2445 0887 E8 08A3 R
2446 088A 74 03
2447
2448 088C £9 092A R
2449
2450 088F 83 C3 40
2451
2452

5-50

TESTl

Ver5ion 2.00
(POST)

1-23
06-10-85

PUSH

AL,PORT B
AL, RAM PAR OFF
PORT B~AL AL,RAM PAR ON
PORT B~AL BYTE-PTR OFFH

POP
MOV

AX
AX,ES: [01]

[N

OR

OUT

ANa
OUT

[N

AND
MOV

JNZ

TOGGLE PAR[TY CHECK ENABLES

PLACE OFFFFH IN STACK (BUS B[TS ON)
DELAY - CAUSING BUS BITS ON
CHECK PAR I TY
CHECK FOR PLANAR OR

AL,PORT B
AL ,PAR (TY ERR
ES:[O[],AX
HOW_8I G_END

I/O PARITY CHECK

CLEAR pass IBLE PAR I TY ERROR
GO [F PLANAR OR I/O PARITY CHECK

CHECK ALL 81 TS WR [TE OK
MOV
MOV

WORD PTR ES:[DI],OFFFFH
AX,ES:[D[]

PUSH

AX
AL,PDRT B
AL.PAR[Ty ERR
ES:[D[] ,AX
AX
HOW BIG END
AX,OFFFFH
HOW_BIG_END

[N

AND
MOV
POP

JNZ
eMP

JNZ

TURN ON ALL 8 I TS
CHECK FOR FFFFH
SAVE RESULTS
CHECK FOR PLANAR OR

[10 PAR I TY CHECK

CLEAR POSSIBLE PARITY ERROR
GET RESULTS
GO I F PAR I TY CHECK

CHECK 64K BLOCK FOR PAR [TY CHECK
HOW BIG 2:
-SU8
MOV

REP
PUSH
PUSH
PUSH
POP
MOV
SUB

REP
SUB

[N
AND
MOV
POP
POP

JNZ

AX,AX
CX,2000H·4
STOSW

WR [TE ZEROS
SET COUNT FOR 32K WORDS
FILL 32K WORDS

OS
ES
ES
OS
CX.2000H·4
S [, S I
LODSW
01,01
AL,PORT B
AL,PARITY ERR
WORD PTR ES: [DI].O
ES

CLEAR POSSIBLE PARITY ERROR
RESTORE SEGMENTS

HOW_8IG_END

GO IF PLANAR OR

GET ES TO OS
SET COUNT FOR 32K WORDS
SET TO BEG I NN I NG OF BLOCK
CHECK FOR PLANAR OR 110 PAR[TY CHECK

as

[10 PAR[TY CHECK

RET
HOW BIG END:
-PUSHF
MDV
OUT
;-----

I

SAVE THE CURRENT FLAGS

<> <> <><> <> <> <> <> <> <> <> <>
<><> CHECK PO I NT
I C <><>

AL, tCH
MFG_PORT ,AL

SET OR RESET 512 TO 640

[NSTALLED FLAG

MOV
CALL
OR
CMP
JA
AND

AX, X· (CMOS I NFO I 28+NM I )
CMOS READ AL,M640K
BX, 512
K640
AL, NOT M640K

SET IRESET 640K STATUS FLAG
GET THE D[AGNOSTIC STATUS

XCHG

AL,AH
CMOS_WR I TE

SAVE THE STATUS
RESTORE THE STATUS

8YTE PTR RSDA PTR
OS
@MEMORY_SIZE,BX

RESTORE THE DATA SEGMENT

CHECK MEMORY SIZE
SET FLAG FOR 512 -> 640

[NSTALLEO

K640 :
CALL
PUSH
PDP
MOV

SAVE MEMORY SIZE
RESTORE THE FLAG REG I STER

POPF
RET

; --- -- --------------------- -----I

----------------- -- - ------------- - ----

TEST. 13A
PROTECTED MODE TEST AND MEMORY SIZE DETERM I NE

(ABOVE

1024K )

;
;

;
;
;
;
;

DESCRIPTION:
THIS ROUTINE RUNS IN PROTECTED MODE IN ORDER TO ADDRESS ABOVE I MEG.
THE MEMORY SIZE IS DETERMINED AND SAVED IN CMOS.
OUR I NG A POWER UP SEQUENCE THE MEMORY SIZE DETERM I NE J S DONE WITH
PLANAR AND I/O PARITY CHECKS DISABLED.
DURING A SOFT RESET THE MEMORY
SIZE DETERMINE W[LL CHECK FOR PARITY ERRORS.

DONE:
PUSH
PDP

BYTE PTR GOT PTR
OS
-

START WITH SEGMENT ADDRESS
MOV
MOV

;
10-0000

PO I NT OS TO THE DESCR I PTOR TABLE
(ONE MEG AND ABOVE)

BYTE PTR OS: (ES TEMP .BASE H I BYTE), I OH
DS:ES_TEMP.BASE:::\O_WORO,OH-

MOV
OUT

AL, tDH
MFG_PORT, AL

SUB

BX,BX

<> <> <><><><><><><> <> <> <>
<><> CHECKPO[NT
10 <><>
START WITH COUNT 0

ST ART STORAGE S I ZEI CLEAR
NOT DONE I:
PUSH

DONEA:

BYTE PTR ES TEMP

ES

CALL
JZ

HOW BIGI
DONEA

JMP

DONE!

GO

ADD

BX,16·4

BUMP MEMORY COUNT BY 64K

DO NEXT 64K

-

POINT ES TO DATA
POINT TO SEGMENT TO TEST
DO THE FIRST 64K
CHECK I F TOP

POP

(XXOOOO)

BLOCK

IF TOP

IBM Personal ComPlJter MACRO Assembler
TEST! ---- 06/10/85
POWER ON SELF TEST
2453
2454 0892 FE 06 004C
2455
2456
2457
2458 0896 80 3E 004C FE
2459 0898 75 E7
2460 0890 E8 0917 R
2461 08AO E9 092A R
2462
2463
2464
2465 08A3
2466 08A3 28 FF
2467 D8A5 88 AA55
2468 D8A8 88 C8
2469 D8AA 26: 89 05
2470 08AD 80 OF
2471 08AF 26: 8805
2472 0862 26: 89 05
2473 0885 33 CI
2474 08B7 75 5E
2475
2476
2477
2478 0889 IE
2479 088A 6A 18
2480 088C IF
2481 088081 3E 0072 R 1234
2482 08C3 IF
2483 08C4 75 2F
2484
2485
2486
2487 08C6 26: C7 05 0101
2488 08C8 6A FF
2489 08CO 58
2490 08CE 26: 8B 05
2491
2492 080 I E4 61
2493 0803 24 CO
2494 OelO5 26: 89 05
2495 0808 75 3D
2496
2497
2498
2499 08DA 26: C7 05 FFFF
2500 080F 6A 00
250 I 08E 1 58
2502 08E2 26: 88 05
2503 08E5 50
2504 08E6 E4 61
2505 08E8 24 CO
2506 08EA 26: 89 05
2507 08EO 58
2508 08EE 75 27
2509 08FO 3D FFFF
2510 08F3 75 22
251 I
2512
2513
2514 08F5
2515 08F5 2B CO
2516 08F7 B9 8000
2517 08FA F3/ AB
2518
2519
2520
2521 08FC IE
2522 08FD 06
2523 08FE 06
2524 08FF 1F
2525 0900 B9 8000
2526 09113 2B F6
2527 0905 F3/ AD
2528 0907 2B FF
2529 0909 E4 61
2530 090B 24 CO
2531 0900 26: C7 05 0000
2532 0912 07
2533 0913 IF
2534 0914 75 01
2535
2536 0916 C3
2537
25380917
2539 0917 BO IE
25400919 E6 80
2541
2542
2543
2544 091B BO BO
2545 0910 8A E3
2546 091 F E8 0000 E
2547 0922 BO BI
2548 0924 8A E7
2549 0926 E8 0000 E
2550 0929 C3
2551
2552
2553
2554 092A BO IF
2555 092C E6 80
2556 092E C6 06 004C 00
2557 0933 2B FF
2558 0935 BA FFFF
2559 0938 E8 0967 R
2560 0938 28 02
2561
2562 0930 C6 06 004C 08
2563 0942 E8 0967 R
2564 0945 C6 06 004C 10
2565 094A E8 0967 R
2566 0940 C6 06 004C 20

INC
;-----

BYTE PTR OS: (ES_TEMP.BASE_HI_BYTEI

CHECK FOR TOP OF MEMORY
eMP
JNZ
CALL
JMP

;-----

1-24
06-10-85

Version 2.00
(POST)

(FEOOOO)

BYTE PTR OS: (ES TEMP.BASE HI BYTEI,OFEH
NOT DONEI
HOW-BIG ENOl
DONE I
-

LAST OF MEMORY?
GO IF NOT
GO SET MEMORY SIZE

FILL/CHECK LOOP

HOW BIGI:
SUB
MaY
MaY
MaY
MaY
MaY
MaY

XOR
JNZ

OI,DJ
AX,OAA55H
CX,AX
ES:[OI),AX
AL,OFH
AX,ES: [01 1
ES:[ol),AX
AX,CX
HOW_BIG_ENoI

TEST PATTERN
SAVE PATTERN
SEND PATTERN TO MEMORY
PUT SOMETH I NG IN AL
GET PATTERN
INSURE NO PAR ITY I fO CHECK
COMPARE PATTERNS
GO END I F NO COMPARE

IS THI S A SOFT RESET
PUSH
PUSH
pop
eMP
pop
JNZ

as
as
as

BYTE PTR RSOA PTR

POINT TO SYSTEM DATA AREA

ilIRESET FLAG,I234H

SOFT RESET
RESTORE OS
GO I F NOT SOFT RESET

-

-

HOW_BIG_2A

CHECK PARITY WITH PARITY BITS OFF
MaY
PUSH
pop
MaY

WORD PTR ES:[Dlj,OIOIH
BYTE PTR OFFH
AX
AX,ES:[DI1

TURN OFF BOTH PAR I TY 8 I TS
PLACE OFFFFH IN STACK (BUS BITS ON I
DELAY - CAUSIN(; BUS BITS ON
CHECK PAR I TY

IN

AL,PORT B
AL, PAR !'TY ERR
ES:[OI),AX
HOW_BIG_ENOl

CHECK FOR PLANAR OR

ANa
MaY
JNZ

liD PARITY CHECK

CLEAR POSSIBLE PARITY ERROR
GO IF PLANAR OR I/O PARITY CHECK

CHECK ALL BITS
MaY
PUSH
pop
MaY
PUSH

IN
ANa
MaY
pop
JNZ
eMP
JNZ

WORD PTR ES: [011 ,OFFFFH
BYTE PTR 0
;
AX
AX,ESI (011
;
AX
AL,PORT B
AL,PARITY ERR
ES: [Oll,AX
AX
HOW BIG ENOl
AX,OFFFFH
HOW_B I G_ENO I

TURN ON ALL BITS
PLACE OOOOOH IN STACK (BUS BITS OFF)
DELAY - CAUSING BUS BITS OFF
CHECK FOR FFFFH
SAVE RESULTS
CHECK FOR PLANAR OR 110 PARITY CHECK
CLEAR POSSIBLE PARITY ERROR
GET RESULTS
IF PLANAR OR I/O PARITY CHECK

(;0

CLEAR 64K BLOCK OF MEMORY
HOW BIG 2A:
-SUB
MaY

REP

AX,AX
CX,2000H·4
STOSW

; WR I TE ZEROS
; SET COUNT FOR 32K WORDS
; FILL 32K WORDS

CHECK 64K BLOCK FOR PARITY CHECK
PUSH
PUSH
PUSH
pop
MaY
SUB

REP
SUB

IN
ANa
MaY
pop
pop
JNZ

(VALID TEST

~URING

SOFT RESET ONLY)

as
ES
ES

GET ES TO OS

CX,2000H·4

SET COUNT FOR 32K WORDS

as

S I, S I
LOOSW
01,01
AL ,PORT 8
AL,PARITY ERR
WORD PTR ES:[Olj,o

SET TO BEG I NN I NG OF BLOCK
CHECK FOR PLANAR OR I/O PAR I TY CHECK

ES

CLEAR POSS I BLE PAR I TY ERROR
RESTORE SEGMENT

HOW_BI G_ENDI

GO

as

IF PLANAR OR

110 PARITY CHECK

RET
HOW BIG ENOl:
-MOV
OUT
;-----

AL,IEH
MFG_PORT, AL

<><><> <><><> <><><><><><>
<><> CHECKPO I NT
! E <><>

SET EXPANSION MEMORY SIZE DETERMINED IN CMOS
MaY
MaY
CALL
MaY
MaY
CALL.

AL,CMOS U M S LO+NMI
AH,BL
- - - CMOS WR I TE
AL,CMOS U M S HI+NMI
AH,BH
- - - CMOS_WR I TE

ADDRESS LOW BYTE
GET LOW MEMORY SIZE
SET LOW 8YTE
ADDRESS H I BYTE
GET THE HIGH MEMORY SIZE
PLACE I N CMOS

RET
;----DONE!:

TEST ADDRESS LINES 19 MOV

OUT
MaY
SUB
MaY
CALL
SUB

MOV
CALL
MOV
CALL
MOV

23

AL,IFH
<><><><><><><><><><><><>
MFG PORT, AL
, < > < > CHECKPO I NT
1F <><>
BYTE PTR OS: (ES TEMP.BASE HI BYTE! ,OOH
01,01
I-SET LOCATION POINTER TO ZERO
OX,OFFFFH
; WRITE FFFF AT ADDRESS 0

500
OX,OX

;

WRITE 0

BYTE PTR OS: (ES TEMP.BASE HI BYTE) ,08H
SOO
BYTE PTR OS: (ES TEMP. BASE H I BYTE), IOH
SOO
BYTE PTR OS: (ES_TEMP.BASE_HI_BYTE! ,20H

TEST1

5-51

~ersion

IBM Personal <;:omputer MACRO Assembler
TESTI ---- 06/10/85
POWER ON SELF TEST
2561
2568
2569
2510
2511
2572
2573
2514
2575
2516
2511
2578
2579
2580
2581
2582
2583
2584
2585
2586
2581
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
26 I 3
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2621
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2615
2616
2677
2678
2679
2680

0952
0955
095A
0950
0962

E8
C6
E8
C6
E8

0965 E8

0961 R
06 004C 40
0967 R
06 004C 80
0961 R

CALL
MOV
CAL..L
MOV
CALL

18

0967
0961 6A 48
0969 01
096A 26: 89

1-25
06-10-85

2.00

(POSn

SOD
BYTE PTR OS: (ES TEMP.BASE HI BYTE) ,40H
SOD
BYTE PTR OS: (ES TEMP.BASE HI 8YTE) ,80H
SDO
SHORT SD2

TEST PASSED CONT I NUE

BYTE PTR ES TEMP
E5
ES: [OI],DX

POINT ES TO DATA
PO I NT TO SEGMENT TO TEST
WRITE THE PATTERN

BYTE PTR ES TEMP
E5
WORD PTR ES:[DI],OFFFFH

POINT ES TO DATA
POINT TO SEGMENT TO TEST
DID LOCATiON 0 CHANGE?
CONT I NUE I F NOT
GO HALT IF YES

SDO:
PUSH
POP
MOV

15

0960 C6 06 004C 00
0912
0974
0915
0919
0978
091E
091E

6A 48
01
26: 83 3D FF
74 03
E9 OHIA R

091F
0981
0963
0985
0987
0989
0988
0980

BO
E6
E4
OC
E6
24
E6
E9

PUSH
POP
eMP

JZ
JMP

501
SHUT_8

SOl;
C3

RET

CAUSE A SHUTDOWN
20
80
61
OC
61
F3
61
0000 E

MOV
OUT

SD2:

IN
OR
OUT
AND
OUT
JMP

AL,20H
MFG PORT, AL
AL..,PORT B
AL",RAM' PAR OFF
PORT B~AL AL,RAM PAR ON
PORT B~AL PROC=SHUTDOWN

<> <><> <><><> <> <><> <><> <>
<><> CHECKPOINT 20 <><>
TOGGLE PAR I TY CHECK ENABLES

CAUSE A SHUTOOWN

(RETURN V I A JUMP)

- - --------- ------------;
0990
0992
0994
0991
0999

BO
E6
BC
8E
BC

21
80

099C
099E
09AO
09A3

2B FF
8E C7
B8 0000 E
A8

RETURN

SHUT1:

1 _ FROM SHUTDOWN
MOV
OUT
MOV
MOV
MOV

-~-~ R
04
0400 R

AL,21H
MFG PORT ,AL
SP, ABSO
SS, SP
SP, OFFSET @TOS

<> <> <><> <> <> <><> <><> <> <>
21 <><>

<><> CHECKPOINT
SET REAL MODE STACK

SET 0 I V I DE 0 VECTOR OFFSET
SUB
"OV
MOV

01,01
ES,DI
AX.oFFSET DII

POINT TO FIRST INTERRUPT LOCATION
SET ES TO ABSO SEGMENT
GET ADDRESS. OF INTERRUPT OFFSET
PLACE OFFSET IF NUL..L HANDLER I N VECTOR

ODS

SET UP THE REAL DATA AREA

STOSW

09A4 E8 0000 E

CALL

GET THE CONFIGURATION FROM CMOS
09;\7
09AA
09AO
09AF
09B 1
0984
0984
0986
0988

88
E8
A8
14
E9

8E8E
0000 E
CO
03
OA3A R

MOV

CALL
TEST
JZ
JMP

24 OF
86 C4
E8 0000 E

AND

XCHG
CALL
;-----

80
E8
24
3C
75

CLEAR THE MINIMUM CONFIG BIT
SAVE THE STATUS BYTE
BACK I NTO CMOS
IN MODE
CHECK FOR SOFT RESET
BYPASS I F SOFT RESET

JNE

AL,CMOS B M S HI-tNMI
CMOS REAO- - AL,OCOH
AL.OCOH
M_OK_64

MASK FOR MANUFACTUR I NG, TEST BI TS
CHECK FOR MANUFACTURING TEST MODE SET
SKIP IF NOT MANUFACTURING LINE TEST

MOV

BYTE PTR @RESET_FLAG,64H; ELSE SET THE MFG TEST FLAG

CALL
AND
eMP

09CE C6 06 0012 R 64

AL..,ODFH
AL,AH
CMOS_WRITE

@RESET FLAG, 1234H
M_OK_64
MOV

9C
0000 E
CO
CO
05

CHECK CMOS GOOD
GET THE STATUS
VALID CMOS?
GO IF YES
GO IF NOT

CHECK FOR CMOS RUN

0988 81 3E 0012 R 1234
09CI 74 10
09C3
09C5
09C8
09CA
09CC

AX,X·(CMOS OIAG+NMI)
CMOS READ AL,8AD BAT+BAD CKSUM
M OK
BAD_MOS

GET THE BASE MEMORY SIZE HIGH BYTE

1NSURE CONF I GURAT I ON HAS CORRECT V IDEO TYPE
0903
0903
0905
09D8
09DA
090C
09DE
09El

M OK 64:
80
E8
8A
A8
7q
E8
74

94
0000 E
EO

-

-

31
09EC R
4C

09EA E8 4E
;-----

TEST
JZ

@MFG TST ,MFG LOOP
NORMAL.. _ CONF I G

EXCEPT IF MFG JUMPER
GO IF INSTALLED

JMP

SHORT BAD_MOS

GO DEFAULT

SAVE VIDEO TYPE
ANY VIDEO?
CONTINUE
I NSURE V IDED ROM PRESENT
CONT INUE
IS

INSTALLED

ROUTINE CHECK FOR VIDEO FEATURE ROM PRESENT

CHK_VIOEO:
89 COOO
50
IE
57
8E
BF
28
8B
3B
5F
IF
58
14

OA02 81
OA06 81

5-52

AL, CMOS EQU I P-tNM I
CMOS READ
AH,A[
AL,030H
MOS OK I
CHK-VIOEO
MOS=OK

GET THE EQU I PMENT BYTE

TEST
JNZ
CALL
JZ

MOV

30

09E3 F6 06 0012 R 20
09E8 74 6F

09EC
09EC
09EF
09EF
09FO
09Fl
09F2
09F4
09F1
09F9
09FB
09FD
09FE
09FF
OAOO

MOV
CALL

MOV

CHK VIDE01:
PUSH
PUSH
PUSH

eX,oeOOOH

START OF FEATURE 1/0 ROM

AX

OC

J.

01
OS
AX
CHK_VIDE02

SAVE THE CONFIGURATION
SAVE THE DATA SEGMENT
SAVE' COMPARE REG I STER
GET ROM SEGMENT
GET THE PRESENCE SIGNATURE
CLEAR I NOEX PO INTER
GET THE FIRST 2 LOCATIONS
IS THE VIDEO FEATURE ROM PRESENT?
RESTORE WORK REG I STER
RESTORE DATA SEGMENT
GET THE CONF 1GURATI ON
GO IF VIDEO ROM INSTALLEO

Cl 0080
F9 C80a

AOO
eMP

CX.080H
CX ,OC800H

PO I NT TO NEXT 2K BLOCK
TOP OF V IDEO ROM AREA YET?

09
AA55
08
07
C7

TESTl

MOV
MOV

SUB
MOV
eMP
POP
POP
POP

DS
01
DS,CX
DI,OAA55H
BX,8X
AX, [BX]
AX,OI

IBM Personal Computer MACRO Assembler
TESTI ---- 06/10/85
POWER ON SELF TEST
2681
2682
2683
2684
2685
2686
2681
2688
2689
2690
2691
2692
2693
2694
2695
2696
2691
2698
2699
2100
210 I
2102
2103
2104
2105
2106
2101
2108
2109
2110
2111
2112
2113
2114
2115
2116
2111
2118
2119
2120
2121
2122
2723
2124
2725
2726
2127
2128
2129
2730
2131
2132
2733
2134
2735
2736
2731
2738
2739
2140
2741
2742
2143
2144
2745
2746
2741
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2160
2761
2762
2763
2764
2165
2766
2167
2168
2769
2770
2111
2112
2113
2774
2175
2116
2177
2178
2119
2780
2781
2182
2183
2784
2785
2786
2787
2788
2189
2190
2191
2192
2193
2194

OAOA 1C E3
OAOC 23 C9
OAOE
OAOE C3

CHK V[DE02:
RET

OAOF
OAOF E8 09EC R
OAI2 14 26

MOS OK I:
- CALL
JZ

JL
AND

i-----

CHK VIDEO I
cX,Ex

24
3C
15
8A
EB

30
30
11
C4
08

AND

eMP
JNZ
MDV
JMP

TRY AGAIN
SET NON ZERO FLAG

ICHECK FOR PRIMARY DISPLAY AND NO VIDEO ROMI

CHK VIDEO
8AD~)'OS

[S THE VIDEO ROM INSTALLED?
WRONG CONFIGURATION IN CONFIG BYTE

AL,AH
PMFG TST ,DSP .JMP
MOS_OK_2
-

RESTORE CONFIGURATION
CHECK FOR 0 I SPLA Y .JUMPER
GO 1F COLOR CARD 1 S PR I MARY 0 I SPLA Y

MONOCHROME CARD
OAIO
OAIF
OA21
OA23
OA25

f

I

; RETURN TO CALLER

CMOS VIDEO BITS NON ZERO

MDV
TEST
JZ

OAI4 8A C4
OAI6 F6 06 0012 R 40
OAtB 14 OA

1-26
06-10-85

Version 2.00
IPOSn

[S PR 1MARY 0 I SPLA Y

(NO .JUMPER

INSTALLEDI

I NSURE MONOCHROME [5 PR [MARY
CONFIGURATION OK?
GO IF NOT
RESTORE CONFIGURATION
USE THE CONFIGURATION BYTE FOR DISPLAY

AL,30H
AL,30H
BAD MOS
AL,AH
SHORT MOS_OK

COLOR CARD
OA21
OA21 24 30
OA29 3C 30
OA2B 8A C4
OA20 74 OB

MOS_OK_2:

;-----

CONFIGURATION MUST HAVE AT LEAST ONE DISKETTE

OA2F
OA31
OA33
OA38

MOS_OK:

TEST
JNZ
TEST
JZ

A8 01
1526
F6 06 0012 R 20
14 IF

AND

eMP
MDV
JZ

AL,30H
AL,30H
AL,AH
BAD_MOS

STRIP UNWANTED BITS
MUST NOT BE MONO W[TH JUMPER
RESTORE CONFIGURATION
GO IF YES

;
;
i
;

INSTALLED

MUST HAVE AT LEAST ONE DISKETTE
GO SET CONFIGURATION [F OK
EXCEPT IF MFG .JUMPER IS INSTALLED
GO IF INSTALLED

MINIMUM CONFIGURATION WITH BAD CMOS OR NON VALID VIDEO
OA3A
OA3A
OA30
OA40
OMZ
OA44
OM1
OA47
OA4A
OA4C

008E
0000 E
CO
03

BAD MOS:
MOV
CALL
TEST
JNZ

E8 0000 E

CALL

E8 09EC R
BO 0 I
14 OB

BAD MOS 1 :
CALL
Mav
JZ

B8
E8
A8
15

AX,CMOS DIAG+NMI
CMOS READ
AL,BAD BAT+BAD CKSUM
BAD 1'11051
-

GET THE DIAGNOST[C STATUS
WAS BATTERY DEFECT I VE OR BAD CHECKSUM
GO [F YES

CONFI G_BAD

SET THE MINIMUM CONFIGURATION FLAG

CHK V IDEO
AL,OIH
NORMAL_CONF I G

CHECK FOR V [OED ROM
DISKETTE ONLY
GO I F V IDEO ROM PRESENT

OA4E F6 06 0012 R 40
OA53 80 I I
OA55 14 02

TEST
Mav
JZ

~MFG TST ,DSP .JMP
AL,ITH
NORMAL _ CONF I G

CHECK FOR 0 I SPLA Y .JUMPER
DEF AUL T TO 40X25 COLOR
GO IF .JUMPER [S INSTALLED

OA57 BO 31

Mav

AL,31H

DISKETTE! B!W DISPLAY 80X25

CONF I GURAT I ON AND MFG MODE
OA59
OA59 F6 06 0012 R 20
OA5E 75 02
OA60 24 3E

NORMAL CONF I G:
- TEST
JNZ

OA62
OA64
OA61
OA60

NORM 1 :

2A
A3
81
14

E4
0010 R
3E 0012 R 1234
2C

AND

IPMFG TST ,MFG LOOP
NORMT
AL,03EH

IS THE MANUFACTURING JUMPER
GO IF NOT
STRIP DISKETTE FOR MFG TEST

SUB
Mav
eMP
JZ

AH,AH
I1IEQU I P _FLAG, A~
I1IRESET FLAG, 1234H
E6
-

SAVE SWITCH INFORMATiON
BYPASS IF SOFT RESET

INSTALLED

GET THE F[RST SELF TEST RESULTS FROM KEYBOARD

MDV
CALL
Mav

AL, WR I TE_B042_LOC
C8042
AL,4DH

OA76 E6 60

OUT

PORT _A,AL

OA78 2B C9
OA1A E8 039B R

SUB

CX,CX
e42 I

WA 1T FOR COMMAND ACCEPTED

CALL

OA70 B9 7FFF

Mav

CX,01FFFH

IN
TEST
LOOPZ

AL,STATUS_PORT
AL, OUT _BUF _FULL
TST6

SET LOOP COUNT FOR APPROX[MATELY
TO RESPOND
WA 1T FOR OUTPUT BUFFER FULL

OA6F BO 60
OA71 E8 0396 R
OA74 BO 40

OA80 E4 64
OA82 A8 0 I
OA84 EI FA
OAB6
OA87
OA89
OA8C
OA80

9C
80 AD
E8 0396 R
90
74 OC

OA8F E4 60
OA91 A2 0072 R

TST6:

ENABLE KEYBOARD
ISSUE WRITE BYTE COMMAND
ENABLE OUTPUT BUFFER FULL INTERRUPT,
SET SYSTEM FLAG, PC I COMPATIBILITY,
I NH I BI T OVERR I DE, ENABLE KEYBOARD

-

TRY AGAIN

IF NOT

PUSHF
Mav
CALL
POPF
JZ

E6

SAVE FLAGS
D I SABLE KEYBOARD
I S SUE THE COMMAND
RESTORE FLAGS
CONT I NUE WITHOUT RESULTS

IN
"av

AL,PORT_A
BYTE PTR 'lIRESET _FLAG, AL

GET I NPUT FROM KEYBOARD
TEMPORARY SAVE FOR AA RECEIVED

AL,DIS_KBD
C8042

lOOMS

CHECK FOR MFG REQUEST
OA94 3C 65
OA96 15 03
OA98 E9 OC27 R

eMP
JNE
JMP

AL,065H
E6
MFG_BOOT

LOAD MANUFACTUR 1NG TEST REQUEST?
CONT I NUE I F NOT
ELSE GO TO MANUF ACTUR 1NG BOOTSTRAP

TEST.\4
INITIALIZE AND START CRT CONTROLLER (6845)
TEST VIDEO READ/WRITE STORAGE.
DESCR 1PT I ON
RESET THE V IDEO ENABLE SIGNAL.
SELECT ALPHANUMERIC MODE, 40 • 25, B & W.
READ/WRITE DATA PATTERNS TO MEMORY. CHECK
STORAGE ADDRESSABILlT'l'.
ERROR = 1 LONG AND 2 SHORT BEEPS

TESTl

5-53

IBM Personal Computer MACRO Assembler
TESTI ---- 06/10/85
POWER ON SELF TEST
2795
2796
2797 OA98
2798 OA98 AI 0010 R
2799 OA9E 50
2800 OA9F BO 30
280 I OAA 1 A3 0010 R
2802 OAA4 28 CO
2803 OAA6 CD 10
2804 OAA8 80 20
2805 OAAA A3 00 lOR
2806 OAAD 88 0003
2807 OA80 CO 10
2808 OAB2 98 000 I
2809 OAB5 CD 10
2810 OAB7 58
.2811 OAB8 A3 0010 R
2812 OA8S 24 30
28130AB07511
2814 OABF IE
2815 OACO 50
2816 OAC 1 2B CO
2817 OAC3 8E 08
2818 OAC5 BF 0040 R
2819 OAC8 C7 05 0000 E
2820 OACC 58
2821 OACD IF
2822 OACE EB 7F
2823 OADO
2824 OADO 3C 30
2825 OAD2 74 08
2826 OAD4 FE C4
2827 OA06 3C 20
2B2B DADa 75 02
2829 OADA B4 03
2830 OADC
2831 OADC 86 EO
2832 DADE 50
2833 OADF 2A E4
2834 OAEI CD 10
2835 OAE3 58
2836 OAE4 50
2837 OAE5 88 BOOO
2838 OAE8 BA 03B8
2839 OAE8 89 0800
2840 OAEE 80 FC 30
2841 OAFI 74 07
2842 OAF3 87 B8
2843 OAF5 BA 0308
2844 OAF8 85 20
2845 OAFA
2846 OAFA AO 0065 R
2847 OAFD 24 37
2848 OAFF EE
2849 OBOO 8E C3
2850 OB02 8E DB
2851 OB04 01 C9
2852 OB06 f8 0000 E
2853 0809 75 70
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864 OB08 BO 22
2865 OBOD E6 80
2866
2867 OBOF 58
2868 OBIO 50
2869 0811 84 00
28700813 CD 10
2871 081588 7020
287.2 OB18 2B FF
2873 OBIA B9 0028
2874 0810 F3/ AB
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885 OB1F 58
2886 0820 50
2887 0921 80 FC 30
2888 OB24 BA 03BA
2889 OB27 74 03
2890 0829 BA 03DA
2891 OB2C
2892 OB2C 84 08
2893 OB2E
2894 OB2E 2B C9
2895 OB30
2896 0830 EC
2897 0831 22 C4
2898 0833 75 04
2899 0835 E2 F9
2900 0837 E8 42
2901 0839
2902 0839 2B C9
2903 OB38
2904 OB38 EC
2905 OB3C 22 C4
2906 OB3E 74 04
2907 OB40 E2 F9
2908 0842 EB 37

5-54

TESTl

1-21

Version 2.00
(POST)

06-10-85

E6:
MOV

AX,Q!lEQUIP FLAG

PUSH

AX

"OV
"OV

AL .30H

SUB
INT
"OV
MOV
MOV

INT
MOV

INT
POP
"OV

:~~~~P _FLAG,AX
INT VIDEO
AL,20H
Q!lEQUIP FLAG,AX
AX.0003H
INT VIDEO
AX,OOOIH
INT VIDEO
AX -

AND

PEQU I P FLAG, AX
AL,30H-

"NZ
PUSH
PUSH

OS
AX

SUB
"OV
MOV
"OV
POP
POP

E7 :

-

""P
CMP

"E

E7

AX,AX
SET DATA SEGMENT TO 0
DS,AX
01 • OFFSET @VIOEO I NT
; SET INTERRUPT 10H TO DUMMY
WORD PTR (0 I] ,OFFSET DUMMY RETURN
; RETURN I F NO V IDEO CARD
AX
RESTORE REGISTERS
OS
BYPASS VIDEO TEST
SHORT E18_1
AL,30H
E8

INC

AH

CMP
"OV

AL,20H
E8
AH.3

XCHG
PUSH

AX

SUB
INT

AH,AH
INT VIDEO

POP

AX -

"NE

GET SENSE INFORMATION
SAVE [T
FORCE MONOCHROME TYPE
INTO EQUIPMENT FLAG
MODE SET COMMAND FOR DEFAULT MODE
SEND INITIALIZATION TO B/W CARD
FORCE COLOR AT 80 BY 25
INTO EQUIPMENT FLAG TO CLEAR BUFFERS
AND INITIALIZATION COLOR CARD 80X25
MODE SET 80 X 25
SET COLOR 40 X 25 MODE
SET DEF AUL T COLOR MODE
RECOVER REAL SW I TCH I NFORMAT I ON
RESTORE IT
ISOLATE VIDEO SWITCHES
VIDEO SWITCHES SET TO O?
SAVE THE DATA SEGMENT

B/W CARD ATTACHED?
YES - SET MODE FOR B / W CARD
SET COLOR MODE FOR COLOR CARD
80X25 MODE SELECTED?
NO - SET MODE FOR 40X25
SET MODE FOR 80X25

E8:
AH,AL

PUSH

AX

MOV
MOV
MOV
CMP

BX,OBOOOH
DX,388H
CX,2048
AH,30H

MOV
MOV

BH,OB8H
DX,3D8H
CH,20H

SAVE VIDEO MODE ON STACK
INITIALIZE TO ALPHANUMERIC MD
CALL VIDEO 10
RESTORE V IDEO SENSE SW I TCHES IN AH
SAVE VALUE
STARTING VIDEO MEMORY ADDRESS B/W CARD
MODE REG I STER FOR B/W
MEMORY WORD COUNT FOR B/W CARD
B/W VIDEO CARD ATTACHED?
YES - GO TEST V IDEO STORAGE
STARTiNG MEMORY ADDRESS FOR COLOR CARD
MODE REG I STER FOR COLOR CARD
MEMORY WORD COUNT FOR COLOR CARD

AL, Q!lCRT MODE SET
AL,037HDX,AL
ES,BX
DS,BX
CX,I
STGTST CNT
E17
-

GET CURRENT MODE SET VALUE
SET VIDEO BIT OFF
D I SABLE V IDEO FOR COLOR CARD
POINT ES TO VIDEO MEMORY
POINT OS TO VIDEO MEMORY
DIVIDE BY 2 FOR WORD COUNT
GO TEST VIDEO READ/WRITE STORAGE
R/W MEMORY FAILURE - BEEP SPEAKER

"E
MOV

E'

E9:
MOV

AND
OUT
MOV
MOV

ROR
CALL

"NE
;

- - - -- -- - --- - -- ---- --- - -- --- - --- - -- - - - - - - - - --- ---

; TEST. 15
;
SETUP VIDEO DATA ON SCREEN FOR VIDEO
;
LINE TEST.
; DESCRIPTION
;
ENABLE V IDED SIGNAL AND SET MODE.
;
DISPLAY A HORIZONTAL BAR ON SCREEN.

;

:

- - - - -- - --- - -- - - -- - - - - -- - -- -- - - - -- - --- - -- - - -- - --MOV

OUT
POP

PUSH
MOV

INT
MOV

SUB
"OV

REP

AL.22H
MFG_PORT ,AL
AX
AX

AH,O
INT VIDEO
AX, 'f020H

01,01
CX,40
STOSW

<> <><> <><><> <> <> <> <> <> <>
<><> CHECKPOINT 22 <><>
GET V IDEO SENSE SW ITCHES (AH)
SAVE IT
ENABLE V IDEO AND SET MODE
VIDEO
WR I TE BLANKS I N REVERSE V IDEO
SETUP STARTING LOCATION
NUMBER OF BLANKS TO 0 I SPLA Y
WR I TE V IDEO STORAGE

------

;
------------ -- ------------ ------; TEST.! 6
;
CRT INTERFACE LINES TEST
; DESCRIPTION
;
SENSE ON/OFF TRANSITION OF THE
;
VIDEO ENABLE AND HORIZONTAL
;
SYNC LINES.

POP
PUSH

AX
AX

CMP
MOV

"E
MOV

AH,30H
DX,038AH
EI I
OX,03DAH

SUB

CX,CX

IN
AND
"MP

AI.. ,OX
AL,AH
EI'
EI3
SHORT EI7

SUB

CX,CX

IN
AND

AL,DX
AL,AH
Elb

LOOP

E'5
SHORT EI7

GET V IDEO SENSE SW I TCH I NFORMAT I ON
SAVE IT
B / W CARD A TT ACHED?
SETUP ADDRESS OF B/W STATUS PORT
YES - GO TEST LINES
COLOR CARD IS ATTACHED

Ell:
AH,8
E12:
E13:

"NZ
LOOP

READ CRT STATUS PORT
CHECK VIDEO/HORIZONTAL LINE
ITS ON - CHECK IF IT GOES OFF
LOOF UNT I L ON OR TIMEOUT
GO PR I NT ERROR MESSAGE

E14:
E15:

"Z

"MP

READ CRT STATUS PORT
CHECK VIDEO/HORIZONTAL LINE
I TS ON - CHECK NEXT LINE
LOOP IF ON UNTIL IT GOES OFF
GO ERROR BEEP

IBM Personal Computer MACRO Assembler
TESTI ---- 06/10/85
POWER ON SELF TEST
2909
2910
2911
2912 0844
2913 OB46
2914 0848
2915 084A
2916 OB4A
29170848
2918 0840
2919
2920
2921
2922 OB4F
2923 OB52
2924 OB52
2925 0854
2926 OB56
2927 OB58
2928 0859
2929 OS5C
2930 OB5E
2931 OB60
2932 0862
2933 OB63
2934
2935 0865
2936 OB68
2937 OB6A
2938 OB6A
2939 OB6E
2940 OB6E
2941 OB72
2942
2943 OB74
2944 OB76
2945
2946 0878
2947
2948
2949
2950
2951 OB79
2952
2953
2954
2955 OB7E
2956 OB83
2957 OB88
2958 OB8A
2959 OB8F
2960 OB91
2961 OB94
2962 OB97
2963 OB97
2964 OB98
2965 OB98
2966 0890
2967 089F
2968
2969
2910
2971 OBAI
2912
2913 OBA6
2974 OBA9
2975 08A8
2976 OBAC
2917 OBAF
2978 OBB 1
2979 OB84
2980 0886
2981 OB88
2962 OBBA
2983 OBBC
2984 OBBF
2985 OBCO
2986 OBC2
2987 OBC8
2988 08ce
2989 OBCD
2990 OBCF
2991
2992
2993
2994 OBDI
2995 0801
2996 OBD3
2997 OBD5
2998 OB07
2999 080A
3000 OBOC
3001 OBOO
3002 OBEO
3003 OBE2
3004 OBE5
3005 OBE7
3006 OBE9
3007 OBEB
3008 OBED
3009 oeFO
3010 OBF 1
3011 OBF3
3012 OBF9
3013 08FF
30 14 OCO 1
3015 OC03
3016 OC05
3017 OC05
3018 OC06
3019 OC09
3020 OCOB
3021 OCOD
3022 OCOF

B I 03
02 EC
75 E4

Version 2.00
(POSTI

;-----

CHECK HORIZONTAL LINE

E16:

MOV
SHR

1-28
06-10-85

CL,3
AH,CL
EI2

GET NEXT BIT TO CHECK

JNZ
POP
MOV
INT

AX
AH,O
lNT_VIDEO

GET V IDEO SENSE SW ITCHES (AH I
SET MODE AND 01 SPLAY CURSOR
CALL VIDEO I/O PROCE~URE

CONT I NUE

E18:
58
B4 00
CD 10

BA COOO
BO
E6
8E
57
SF
28
88
38
5F
75

;-----

CHECK FOR THE ADVANCED VIDEO CARD

E 18 I:
EI8A:

MOV

DX,OCOOOH

SET THE LOW SEGMENT VALUE

MOV
OUT
MOV

AL,23H
MFG_PORT, AL
DS,OX
01
Ol,OAA55H
BX,BX
AX, [BX]
AX,OI
01
EI8B

SAVE WORK REGISTER
PRESENCE SIGNATURE
CLEAR PO INTER
GET FIRST 2 LOCATIONS
PRESENT?
RECOVER REG I STER
NO? GO LOOK FOR OTHER MODULES

23
80
OA

PUSH
AA55
08
07
C7

MDV
SUB
MDV
eMP
PDP

JNZ

05

E8 0000 E
EB 04

CALL

<> <> <> <> <> <> <> <> <> <> <> <>
<><> CHECKPOINT 23 <><>

ROM CHECK
SHORT E 1BC

GO SCAN MODULE

JMP
ADD

DX.OOBOH

PO r NT TO NEXT 2K BLOCK

81 FA C800
7C DE

eMP
JL

DX,OCBOOH
EI BA

TOP OF V IDEO ROM AREA YET?
GO SCAN FOR ANOTHER MODULE

BO 24
E6 80

MDV
OUT

AL ,24H
MFG_PORT ,AL

JMP

POST2

EI8B:
81

C2 0080
EI8C:

E9 0000 E

<> <><><><><><><><><><><>
<><> CHECKPOINT 24 <><>
GO TO NEXT TEST

CRT ERROR SET MFG CHECKPO I NT AND ERROR BEEP
E8 0000 E

E17:

CALL

C6
80
74
F6
74
BA
EB

06 00 15 R DC
3E 0072 R 64
00
06 0012 R 20
06
0102
0000 E

;

DDS

CHECKPOINT OC

POINT TO DATA

= MONOCHROME FAILED

MOV
CMP
JZ
TEST
JZ
MOV
CALL

'PMFG ERR FLAG, OCH
;
BYTE-PTR-.RESET FLAG,064H
EI9
PMFG TST ,MFG LOOP
E 19 DX,102H
ERR_BEEP

PUSH

OS

MDV
AND
CMP

AX ,IIIEQU I P FLAG
AL,30H
AL,30H
TRY_COLOR

<><> CRT ERROR CHECKPO I NT OC <><>
; IS THIS A MFG REQUEST?
BY PASS ERROR BEEP IF YES
I S THE MFG LOOP JUMPER INSTALLED?
BY PASS ERROR BEEP J F YES
GO BEEP SPEAKER

E19:
1E
AI 0010 R
24 30
3C 30
74 30

JZ
;-----

COLOR FAILED TRY MONOCHROME -

GET THE CURRENT V IDEO
STRIP OTHER BITS
I SIT MONOCHROME ?
GO 1F YES
CHECKPOINT 00

= COLOR

FAILED

C6 06 0015 R 00

MDV

OMFG _ERR _FLAG, ODH

<><> CRT ERROR CHECKPOINT

BA 03B8
90 01
EE
BB BODO
8E DB
B8 AA55
28 DB
69 07
EB 00
88 07
3D AA55
1F
75 55
81 DE 0010 R 0030
AI 0010 R
2A E4
CD 10
EB 34

MDV
MDV
OUT
MDV
MDV
MDV
SUB
MDV
JMP
MDV
CMP
PDP

DX,3B8H
AL,I
OX,AL
BX,OBOOOH
OS,BX
AX, OAA55H
BX,BX
[BX] .AX

DISABLE B/w

JNZ

EI7 3
IilIEQOIP FLAG,30H
AX,OEQUIP FLAG
AH,AH
INT VIDEO
SHORT E11_1

DR
MDV
SUB
INT
JMP

'.2

AX, [BX]
AX, OAA55H
OS

00 <><>

OUTPUT THE D I SABLE
CHECK FOR MONOCHROME V IDEO MEMORY
WR I TE AN AA55
TO THE FIRST LOCATION
ALLOW BUS TO SETTLE
READ THE FIRST LOCATION
I S THE MONOCHROME V IDEO CARD THERE?
RESTORE THE DATA SEGMENT
GO IF NOT
TURN ON MONOCHROME 8 I TS IN EQU I P FLAG
ENABLE V IDEO

CONTINUE

MONOCHROME FAIl.ED TRY COLOR
BO
2A
CD
BA
BO
EE
BB
8E
B8
2B
89
EB
88
3D
1F
75
81
81
BO
2A
CO
58
Al
24
3C
2A
74

01
E4
10
0308
00
B800
DB
AA55
DB
07
00
07
AA55
24
26 0010 R FFCF
OE 0010 R 0010
01
E4
10
0010 R
30
30
CO
02

TRY COLOR:
MOV
SUB
INT
MDV
MDV
OUT
MDV
MOV
MDV
SUB
MDV
JMP
MDV
eMP
PDP

JNZ
AND
DR
MDV
SUB
INT
PDP
MDV
AND
eMP
SUB

JZ

AL,OIH
AH,AH
INT VIDEO
DX,3D8H
AL,O
DX,AL
8X,OB800H
OS,BX
AX ,OAA55H
BX,BX
[BX] ,AX

'.2

AX. [BX]
AX ,OAA55H

OS

E17 3
IIIEQU 1P FLAG, OFFCFH
IIIEQU I P-FLAG, I OH
AL,OIHAH,AH
INT_VIDEO
AX
AX, olOEQU I P FLAG
AL,30H
AL ,30H
AL.AL
Ell_2

SET MODE COLOR 40X25

o I SABLE

COLOR

OUTPUT THE 0 I SABLE
CHECK FOR COLOR V IDEO MEMORY
WR I TE AN AA55
TO THE FIRST LOCATION
ALLOW 8US TO SETTLE
READ THE FIRST LOCATION
IS THE COLOR VIDEO CARD THERE?
RESTORE THE DATA SEGMENT
GO IF NOT
TURN OFF VIDEO 8ITS
SET COLOR 40X24

SET NEW V IDEO TYPE ON STACK
IS

IT THE B/W?

GO IF YES

TESTl

5-55

IBM Personal Computer MACRO Assembler
TEST I ---- 06/10/85
POWER ON SELF TEST
3023
3024
3025
30260
302,
3028
3029
3030
3031
3032
3033
3034
3035
3036
3031
3038

OCI I FE CO
OCI3
OCI3 50
OCI4
OCI4 E9 OB4A R

INC

; ----OC 11
OCI1
OC 18
OCIA
OC 1C
OC 1F
OC23
OC24

5-56

1E
2B
BE
BF
C1
1F
E9

CO
DB
0040 R
05 0000 E
OB4F R

TEST 1

Version 2.00
(POST)

1-29
06-10-85
;

PUSH

AX

JMP

EI8

INITIALIZE FOR 40X25

80TH VIDEO CARDS FAILED SET DUMMY RETURN
PUSH
SUB
MOV
MOV
MOV
POP
JMP

IF RETRACE FAILURE

OS
AX, AX
; SET OS SEGMENT TO 0
DS,AX
OJ ,OFFSET @VIOEO INT
; SET INTERRUPT 10H TO DUMMY
WORD PTR [OJ J ,OFFSET OUMMY RETURN
; RETURN IF NO VIDEO CARD

as

E18_1

-

;

BYPASS REST OF VIDEO TEST

IBM Personal Computer MACRO Assembler
TEST! ---- 06/10/85
POWER ON SELF TEST
3039
3040
3041
3042
3043
3044
3045
3046
3041
3048
3049
3050

3051
3052
3053
3054 OC21
3055 OC21
3056 OC29
3051
3058
3059
3060 OC2C
3061 OC2F
3062 OC30
3063 OC33
3064 OC35
3065 OC31
3066 OC3A
3061 OC3D
3068 OC30
3069 OC3E
3010 OC3F
3011
3012
3013
3014 OC41
3015 OC44
3016 OC41
3011 OC4A
3018 OC4A
30J9 OC4B
3080 OC4C
3081
3082
3083
3084
3085 OC4E
3086 OC4F
3081 OC50
3088 OC56
3089 OC5C
3090
3091
3092
3093 OC62
3094 OC64
3095 OC61
3096 OC69
3091
3098 OC6B
3099 OC6E
3100 OC10
3101 OC13
3102 OC15
3103 OC11
3104 OC18
31050C1B
3106 OC1B
3101 OC1D
3108 OC1F
3109 OC81
3110 OC83
3[ I I OC84
31 12 OC86
3113
3114 OC88
3115
31 16 OC8D
31 11 OC8D
31 18 OC8F
3119 OC91
3120
3121 OC93
3122 OC95
3123
3124 OC96
3125 OC96
3126

1-30
06- I 0-65

Version 2.00
(POST)

PAGE
;
- - - - -- - - - - - - - -- - - - - - - - - - - - - - -- - - - - - - - - - - MANUFACTURING BOOT TEST CODE ROUTINE
;
LOAD A BLOCK OF TEST CODE THROUGH THE KEYBOARD PORT FOR MANUFACTURING
;
TESTS.
;
THIS ROUTINE WILL LOAD A TEST (MAX LENGTH=FAFFH) THROUGH THE KEYBOARD
;
PORT. CODE WILL BE LOADED AT LOCATION
0000l0500.
AFTER LOADING,
;
CONTROL WILL BE TRANSFERRED TO LOCATION
0000:0500.
THE STACK WILL
BE LOCATED AT 0000:0400.
THIS ROUTINE ASSUMES THAT THE FIRST 2 BYTES
TRANSFERRED CONTAIN THE COUNT OF BYTES TO BE LOADED
;
(BYTE 1 =COUNT LOW, BYTE 2=COUNT HI.J

-- --- -- - -- - - -- -- -- --- --

;----B4 00
E8 0000 E

- - -- --- - - - --

DEGATE ADDRESS LINE 20

MFG BOOTl
MOV
CALL

AH,DISABLE BIT20
GATE_A20
-

;
;

DEGATE COMMAND FOR ADDRESS LINE 20
I SSUE TO KEYBOARD ADAPTER' AND CLI

SETUP HARDWARE INTERRUPT VECTOR TABLE LEVEL 0-1 AND SOFTWARE INTERRUPTS
68
01
B9
8C
8E
BE
BF

---- R

PUSH

SET ES SEGMENT REG I STER TO ABSO

POP
"Oy
"Oy
MOV
"Oy
"Oy

ABSO
ES

0018
C8
08
0000 E
0020 R

CX,24
AX,CS
DS,AX
51 ,OFFSET VECTOR TABLE
01 ,OFFSET IlIINT_PTR

GET VECTOR COUNT
GET THE CURRENT CODE SEGMENT VALUE
SETUP OS SEPMENT REG I STER TO
POINT TO THE ROUTINE ADDRESS TABLE
SET DESTINATION TO FIRST USED VECTOR

A5
AB
E2 FC

MOVSW
STOSW
LOOP

MFG_Bl

MOVE ONE ROUTINE OFFSET ADDRESS
INSERT CODE SEGMENT VALUE
MOVE THE NUMBER OF ENTR I ES REQU I RED

B9 0008
BE 0000 E
BF OICO R

"Oy
"Oy
"Oy

CX,08
; GET VECTOR COUNT
51 iOFFSET SLAVE VECTOR TABLE
01 ,OFFSET IlISLAVE_INT_PTR

A5
AB
E2 FC

MOVSW
STOSW
LOOP

MFG_B2

SETUP HARDWARE

;----06
IF
C1 06 0008 R 0000 E
C1 06 00 14 R 0000 E
C1 06 0062 R F600
; -----

INTERRUPT VECTORS LEVEL 8-15

(VECTORS START AT

INT 10 HI

; MOVE ONE ROUTINE OFFSET ADDRESS
; INSERT CODE SEGMENT VALUE

SET UP OTHER INTERRUPTS AS NECESSARY
ASSUME
PUSH

OS: ASSO .ES; ABSO

POP
"Oy
"Oy
"Oy

OS

ES

ES= ABSO
TO ABSO
SET
Nt.! I INTERRUPT
PR I NT SCREEN
CASSETTE BAS I C SEGMENT

as

WORD PTR II!INMI PTR,OFFSET NMI INT
WORD PTR OINTS PTR,OFFSET PRTNT SCREEN
WORD PTR PBASIC_PTR+2,OF600H
-

ENABLE KEYBOARD PORT

BO
E8
BO
E6

60
0396 R
09
60

"OY
CALL
"OY
OUT

AL,60H
C8042
AL,00001001B
PORT_A,AL

WR I TE 6042 MEMORY LOCAT I ON 0
ISSUE THE COMMAND
SET INHIBIT OVERRIDE/ENABLE OBF
INTERRUPT AND NOT PC COMPATIBLE

E8
8A
j::8
8A
8A
FC
BF

OC8D R
F8
OC8D R
E8
CF

CALL
"OY
CALL
"OY
"OY
CLD
"OY

MFG B4
BH,AL
MFG B4
CH,AL
CL,BH

GET COUNT LOW
SAVE IT
GET COUNT HI

E4
A8
14
E4
AA
E6
E2

64
01
FA
60

IN
TEST
JZ

AL,STATUS PORT
At-, OUT BUF FULL
MFG B3AL,PORT_A

80
F3

STOSB
OUT
LOOP

MFG PORT ,AL
MFG=B3

GET 8042 STATUS PORT
KEYBOARD REQUEST PENDING?
LOOP TILL DATA PRESENT
GET DATA
STORE IT
DjSPLAY CHARACTER AT MFG PORT
LOOP TI LL ALL BYTES READ

J"P

II!IMFG_TEST_RTN

FAR JUMP TO CODE THAT WAS JWST LOADED

~t: ~~~ T~GFP~~~L

CHECK FOR OUTPUT BUFFER FULL
HANG HERE IF NO DATA AVAILABLE

0500 R

EA 0500

IN

---- R

E4 64
A8 01
EI FA

IN

E4 60
C3

ex

01 ,OFFSET  0 FLAGS ERROR
I

CLEAR

(BP)

REG' STER AS ERROR FLAG REG

I NTERRUPT MASK REG I STER REG I STERS

eLi

00
21
A\
00
21
EO
AI

0010 BO 25
00 IF E6 80

BP,BP

;

I SET DATA SEGMENT

AL,O
INTAOI,AL
INTSOI,AL

TURN OFF INTERRUPTS
SET INTERRUPT MASK REGISTER TO ZERO
SEND 10 2ND

I NTERRUPT CONTROLLER ALSO

J"F

1·2

IN
"OY
IN

AL,INTAOI
AH,AL
AL,INTBOI

READ I NTERRUPT MASK REG! STER
SAVE RESULTS
READ 2ND I NTERRUPT MASK REGI STER

OR
JNZ

AH,AL
06

BOTH '"R
O?
GO TO ERR ROUTI NE

"OY
OUT

AL,25H
"FG _PORT, AL

.

IF NOT 0

<> <><> <><> <><><><> <> <><>
<><> CHECKPOINT 25 <><>

IBM Personal Comput.er MACRO Assembler
VersIon 2.00
TEST2 ---- 06/10/85
POST TESTS AND INITIALIZATION ROUTINES
115
116
117
118
[[9
120
121
122

0021 BO FF
00 23E62[
0025 E6 A[
0027 E8 00
0029 E4 2[
0028 8A EO
0020 E4 AI

123
[24
125

002F 05 000 [
0032 75 15

1-2
06-10-85

MOY
OUT
OUT
JMP
IN
MaY
IN

"2

AL, [NTAOI
AH,AL
AL,INTBOI

01 SA8LE OEV I CE INTERRUPTS
WR J TE TO I NTERRUPT MASK REG [STER
WRITE TO 2ND INTERRUPT MASK REGISTER
110 DELAY
READ I NTERRUPT MASK REG [STER
SAVE RESULTS
READ 2ND I NTERRUPT MASK REG I STER

AOO
JNZ

AX,I
06

ALL lMR B[TS ON?
NO - GO TO ERR ROUT! NE

AL,OFFH
INTAOI,AL
INTBO I ,AL

12.
127
128
129

CHECK FOR HOT

1NTERRUPTS

1NTERRUPTS ARE MASKED OFF.

CHECK THAT NO I NTERRUPTS OCCUR.

130
131
132
133
134
135
13.
137
138
139
140
141
142
143
144
145
14.
147
148
149
150
151
152
153
154
155
15.
157
158
159

,.,

160

,.2
,.3
164
165
166
167
168
169

170
171
172
173
174
175
176
177

178
17'
180
181
182
183
184
[85
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
20 [
202
203
204
205
206
207
208
209

0034 A2 0068 R

MaY

 <> <> <> <> <> <> <> <> <> <> <>
<><> CHECK PO I NT
26 <><>
ENABLE EXTERNAL INTERRUPTS
WAIT 100 MILLISECONDS FOR ANY
INTERRUPTS THAT OCCUR
OJ 0 ANY 1 NTERRUPTS OCCUR?
NO - GO TO NEXT TEST

<><><><><><><><> <><><><>
<><> CHECKPO[NT
5 <><>
OJ SPLAY

101

ERROR

CHECK THE CONVERT I NG LOG I C
0056 80 27
0058 E6 80
005A
0050
OOSF
006 [
0063
0065
0068

88
E7
E4
86
E4
30
74

07:

AA55
82
82
C4
83
55AA
05

;----80
E6
89
E8
80
E6
80
74

AL,27H
MFG _PORT, AL

MaY
OUT
IN
XCHG
IN
eMP

AX,OAA55H
MFG_PORT+2,AX
AL,MFG_PORT+2
AL,AH
AL,MFG_PORT+3
AX,55AAH
07 A

MaY
JMP

SI ,OFFSET EI06
06A

<> <> <> <> <> <> <> <> <><> <> <>
27 <><>
<><> CHECKPOINT
WRITE A WORD
GET THE FIRST BYTE
SAVE IT
GET THE SECOND BYTE
IS [T OK?
GO IF YES

-

006A 8E 0000 E
0060 E8 E2

006F
006F
0071
0073
0076
0079
0078
0070
0082

MaY
OUT

00
70
0007
0000 E
80
70
3E 0068 R 00
09

CHECK FOR HOT NMI

01 SPLAY

INTERRUPTS WITHOUT

MaY
OUT
MaY
CALL
MaY
OUT
eMP
JZ

AL, CMOS REG 0
CMOS_PORT, AL
CX,7
WAITF
AL ,CMOS REG D+NM I
CMOS_PORT ,AL
rtlINTR_FLAG,OOH
07 e

0084 80 28
0086 E6 80

MaY
OUT

AL ,28H
MFG_PORT. AL

0088 BE 0000 E
008B E8 C4

MaY
JMP

SI,OFFSET El07
06A

106 ERROR

I/o-MEMORY PARITY ENABLED

TURN ON NM [
ADDRESS DEF AUL TREAD ONLY REG I STER
DELAY COUNT FOR 100 MICROSECONDS
WA [T FOR HOT NM [ TO PROCESS
TURN NM I ENABLE BACK OFF
DID ANY INTERRUPTS OCCUR?
CONT I NUE [F NOT

-

<> <><> <> <> <> <> <><><><> <>
<><> CHECKPOINT
28 <><>
D[SPLAY

107 ERROR

TEST THE DATA BUS TO T[MER 2
0080
008F
0091
0093
0095
0097

80 29
E6 80
E461
8A EO
24 FC
E6 61

0099
009B
0090
009F
00A2
00A4
OOA6
00A8
OOAA
COAC
OOAE
OOBO
0082
00B4
00B7

BO
E6
EB
B8
E6
EB
8A
E6
EB
E4
86
EB
E4
3D
74

07 e,

-

80
43
00
AA55
42
00
C4
42
00
42
EO
00
42
55AA
05

00B9 BE 0000 E
OOBC EB 93

MOY
OUT
IN
MaY
AND
OUT

AL,29H
MFG PORT, AL
AL,PORT_B
AH,AL
AL,OFCH
PORT_B,AL

MaY
OUT
JMP
MaY
OUT
JMP
MOY
OUT
JMP
IN
XCHG
JMP
IN
eMP
JZ

AL,IOIIOOOOB
TIMER+3,AL

MaY
JMP

<><> <><><> <> <> <> <> <> <> <>
<><> CHECKPOINT
29 <><>
GET CURRENT SETT I NG OF PORT
SAVE THAT SETTING
I NSURE SPEAKER OFF
SELECT TIM 2, LSB, MSB, B I NARY, MODE 0
WR I TE THE T I MER MODE REG [STER
I/O DELAY
WR I TE AN AA55
WR ITE T I MER 2 COUNT - L SB
110 DELAY

,'2

AX,OAA55H
TIMER+2,AL
'.2
AL,AH
T[MER+2,AL

'.2

WRITE TIMER 2 COUNT 1/0 DELAY
GET THE LSB
SAVE IT
[/0 DELAY
GET THE MSB
BUS OK?
GO [F OK

S [,OFFSET EI08
06A

DISPLAY

AL, TIMER+2
AH,AL
"2
AL,TIMER+2
AX,055AAH
07 a
-

MSB

108 ERROR

210
211

212

TEST.18
8254 T I MER CHECKOUT
DESCR I PT I ON
VERIFY THAT THE SYSTEM TIMER
TOO FAST OR TOO SLOW.

213

214
215
21.
217

(0)

DOESN'T COUNT

218

219
220
221
222
223
224

225
226

OOBE
OOCO
00C2
00C3
OOC5
OOC7
00C9
OOCB

BO
E6
FA
BO
E6

2A
80

FE
21
BO 10
E6 43
B9 002C

07 D,

-

MOV
OUT
eLi
MDY
OU7
MaY
OUT
MaY

AL,2AH
MFG_PORT, AL
AL,OFEH
INTAO[ ,AL
AL,OOOlOOO08
TIMER+3,AL
CX,2CH

MASK ALL [NTERRUPTS EXCEPT LEVEL 0
WR ITE THE 8259 IMR
SELECT TIM 0, LSB, MODE 0, BINARY
WRITE T[MER CONTROL MODE REG I STER
SET PROGRAM LOOP COUNT

JMP

$.2

[/0 DELAY

<> <> <> <> <> <> <> <> <><> <> <>
<><> CHECKPOINT
2A <><>

227
228

OOCE EB 00

TEST2

5-59

IBM Personal Computer MACRO Assembler
Version 2.00
TEST2 ---- 06/10/65
POST TESTS AND INITIALIZATION ROUTINES
229
230
231
232

0000
0002
0004
0005

6A Cl
E6 40
FB
F6 06 006B R 01

MOV
OUT

SET TIMER 0 COUNT REGISTER
WR I TE T I MER 0 COUNT REG I STER

AL,CL
TlMER+O,AL

511
08:

1-3
06-10-85

TEST

01 NTR_FLAG, a I H

JNZ
LOOP.

DB

MOV

(lMFG_ERR_FLAG.02H

233
234
235

OOOA 75 00
OpOC E2 F7
23.
237
OOOE C6 06 0015
23B
239
240
241
00E3 BE 0000 E
242
00E6 E9 0051 R
243
244
245
00E9 BO 2B
246
OOEB E6 80
241
248
OOEO FA
249
OOEE BlOC
250
OOFO BO FF
251
00F2 E6 40
252
00F4 C6 06 006B
253
00F9 BO FE
254
dOFB E6 21
255
OOFO FB
256
OOFE F6 06 006B
257
0103 75 DE
258
0105 E2 F7
259
2.0
2.1
262
0107 2B C9
2.3
264
0 I 09 BO 2C
265
01 OB E6 80
266
0100
267
0100 F6 06 006B
268
0112 15 08
269
0 I 14 E2 F1
210
2710116BEOOOOE
212
0119 E9 0051 R
213
214
215
27601lCFA
277
OliO BO FF
27801lFE621
279
0121 BO 36
280
0123 E6 43
281
0125 EB 00
282
0127 BO 00
263
0 j 29 E6 40
284
012B EB 00
285
0120 E6 40
2B.

R 02

SI,OFFSET EI02
O.A
09:

29.
291
29B
299
300
30 I
302
303
304
305
30.

MOV
OUT

<><> <> <><><> <> <> <> <> <> <> <> <> <>
<><> T I MER CHECKPO I NT ( 2) <><>
01 SPLA Y 102 ERROR
TIMER 0 INTERRUPT DID NOT OCCUR= ERROR

<> <> <><><><> <> <> <> <> <> <>
<><> CHECKPOINT
2B <><>

AL,2BH
MFG_PORT ,AL

eLi

R 00

R 01

DID:

MOV
MOV
OUT
"OV
"OV
OUT

CL,12
AL,OFFH
TIMER+O,AL
olNTR FLAG,O
AL,OFEH
INTAOI,AL

511
TEST
JNZ
LOOP

OINTR FLAG,OIH
08 A 01'0

WAIT FOR

SET PROGRAM LOOP COUNT
WR I TE T I MER a COUNT REG I STER
RESET INTERRUPT RECE I VED FLAG
RE-ENABLE T I MER a INTERRUPTS
DID TIMER a INTERRUPT OCCUR?
YES - TIMER COUNTING TOO FAST, ERROR
WA I T FOR I NTERRUPT FOR SPEC I F I ED T I ME

INTERRUPT

SUB

CX,CX

"OV
OUT

AL,2CH
MFG_PORT ,AL

TEST
JNZ
LOOP

(I]NTR _FLAG,O IH
OliO

DID TIMER 0
GO IF YES
TRY AGAIN

MOV
J"P

S I ,OFFSET EI03
O.A

DISPLAY 103 ERROR
ERROR IF NOT

<><><> <> <> <> <> <> <> <> <><>
<><> CHECKPOINT
2C <><>

011 0:
R 01

012

; -----

SETUP TIMER 0 TO MODE 3

012:

eLI
"OV
OUT
"OV
OUT
JMP
MOV
OUT
JMP
OUT

2.,
2BB

289
290
291
292
293
294
295

DID TI MER 0 I NTERRUPT OCCUR?
CHECK TIMER OPERATION FOR SLOW TIME
WAIT FOR INTERRUPT FOR SPECIFIED TIME

09

INTERRUPT OCCUR?

D I SABLE ALL DEV I CE

AL,OFFH
INTA01,AL
AL,36H
TIMER+3,AL

INTERRUPTS

$.2

SELECT TIMER O,LSB,MSB,MODE 3
WR I TE T I MER MODE REG I STER
1'/0 DELAY

AL,O
TIMER+O,AL
$<2
TlMER+O,AL

WRITE LSB TO TIMER 0 REGISTER
1/0 DELAY
WRITE MSB TO TIMER a REGISTER

8042 FOR LAST COMMAND ACCEPTED
012F
0131
0133
0135
0137
0139
a 13B

2B
80
E6
E4
A8
74
E2

C9
20
80
64
02
08
F8

SUB
MOV
OUT
013:

IN
TEST
JZ
LOOP

CX,CX
AL,20H
MFG PORT ,AL
AL,STATUS PORT
AL, I NPT BUF FULL
EI9
-

013

ERROR EXIT
0130 BE 0000 E
0140 E9 0051 R

"OV
JMP

;
;

301
30B
309

(MESSAGE

SET WAIT TIME

<> <><> <><><><> <> <> <> <> <>
<><> CHECKPOINT
20 <><>
GET THE 8042 STATUS
HAS THE LAST COMMAND BEEN ACCEPTED?
GO IF YES
TRY AGAIN

105)

S I ,OFFSET E I 05
D.A

PRINT lOS ERROR
GO ERROR HALT

- - - - -- - - - - - - - -- - - - - - - - - -- - - - - - - - - - - - - - - - - - - -- - -- - - - - -- - - - - - - -- - -- - -- - - -TEST.19
ADD I TJ ONAL READ/ WR iTE STORAGE TEST
++++ MUST RUN IN PROTECTED MODE ++++
OESCR I PT I ON
WRITE/READ DATA PATTERNS TO ANY READ/WRITE STORAGE AFTER THE
FIRST 64K.
STORAGE ADDRESSAB I LI TY I S CHECKED.

310

311
312
313
314
315

31.
317
318
319
320
321
322
323
324
325
326
327
32B
329
330
331
332
333
334
335
33.
337
338
339
340
341
342

0143
0143 E8 0000 E
0146 BO 2F
0148 E6 80

ASSUME

OS:DATA

CALL
MOV
OUT

ODS
AL,2FH
MFG_PORT ,AL

SET DA T A SEGMENT

eMP
JNE
JMP

ORE SET FLAG,! 234H
EI9A
SHUT2

WARM START?
GO IF NOT
GO TO NEXT TEST IF WARM START

E19:

014A 81 3E 0072 R 1234
0150 15 03
0152 £9 0420 R

<> <> <> <> <> <><> <> <> <> <><>
<><> CHECKPOINT
2F <><>

SET SHUTDOWN RETURN 2
0155 BO 30
0157 E6 80
0 I 59 B8 028F
OISC E8 0000 E

EI9A:

MOV
OUT

AL ,30H
MFG_PORT ,AL

MOV
CALL

AX.2-H+CMOS SHUT DOWN+NMI
CMOS_WR I TE -

<><> <><><> <> <><><><><> <>
<><> CHECKPO I NT
30 <><>
; ADDRESS FOR SHUTDOWN BYTE
SECOND ENTRY I N SHUTDOWN TABLE

ENABLE PROTECTED MODE
01 SF BC 0000
8E 04
0164 BC 8000

a I 62

MOV
MOV
MOV

SP,POST SS
SS, SP
SP.POST_SP

SET STACK FOR SYSINITI

GO ENABLE PROTECTED MODE

0167 E8 0000 E

CALL

SYSINITI

016A BO 31
0 !6C E6 80

MOV
DUT

AL,31H
MFG_PORT,AL

SET TEMPOMRY STACK

a I 6E

5-60

6A 08

TEST2

PUSH

BYTE PTR GOT _PTR

<> <><><> <> <> <><><> <> <> <>
<><> CHECKPOINT
31 <><>

1-4
06-10-85

IBM Personal Computer MACRO Assembler
Version 2.00
TEST2 ---- 06/10/85
POST TESTS AND INITIALIZATION ROUTINES

343
344
345
346
347
348

349
350
351
352
353
354
355
356
357
358
359
360
361

0 I 70
Ot71
0178
0 I 7E
0181
0 I 83

07
26: C7 06 005A 0000
26: C6 06 005C 00
BE 0058
8E 06
BC FFFD

POP
MOV
MOV
MOV
MOV
MOV

ES
ES: SS TEMP. 8ASE LO WORD, 0
BYTE PTR ES: ISS-TEMP. BASE H I BYTE), 0
S [ ,SS TEMP
SS,S[SP, MAX_SEG_LEN-2

DATA SEGMENT TO SYSTEM DATA AREA
0186 6A
0188 IF

18

0189 BO 80
018B E6 87

PUSH
POP

8YTE PTR RSDA PTR

MOV
OUT

AL,PARITY CHECK
DMA_PAGE+6,AL

OS

POINT TO DATA AREA

SET CHECK PAR[TY
SAVE WHICH CHECK TO USE

PR I NT 64 K BYTES OK
0180 88 0040
0190 E8 099F R

STARTING AMOUNT OF MEMORY OK
POST 65K OK MESSAGE

"OV
CALL

362
363

GET THE MEMORY 5 I ZE DETERM I NED

(PREPARE 8X AND OX FOR BAD CMOS)

364
MOV
CALL
XCHG
CALL
MOV
MOV
ADD

8081
0000 E
EO
0000 E
IE 0013 R
03
08

AX, (CMOS U M S LO+NMI) ·H+CMOS U M 5 HI+NMI
CMOS READ - - HIGH BYTEAH,AL
SAVE HIGH 8YTE
CMOS READ
LOW 8YTE
8X,@MEMORY SIZE
LOAD THE BASE MEMORY SIZE
DX,8X
SAVE BASE MEMORY SIZE
BX, AX
SET TOTAL MEMORY SIZE

365
366
367
368
369
370
371

0193 B8
0196 E8
019986
0198 E8
019E 88
0lA2 88
0lA4 03

372
373
374
375
376

0lA6 80 8E
0lA8 E8 0000 E

"OV
CALL

AL,CMOS D[AG+NMI
CMOS_READ

OETERM I NE THE COND I T I ON OF CMOS
GET THE CMOS STATUS

OIAB A8 CO
DIAD 74 02
0 I AF EB 58

TEST
JZ
JMP

AL,8AD BAT+BAO CKSUM
E2D80 SHORT E20C

CMOS OK?
GO IF YES
DEF AUL T I F NOT

I S CMOS GOOD?

377
378

379
380

381
382
383
384
385
386
387
388
389
390

GET THE BASE 0->640K MEMORY SIZE FROM CONFIGURATION
0181
0181
0184
0187
0189
0188
018E
OICO

889596
E8 0000 E
24 3F
86 EO
E8 0000 E
3B DO
74 13

MOV
CALL

50
B8
E8
DC
86
E8
58
38

PUSH
MOV
CALL

AND
XCHG
CALL
eMP
JZ

391
392
393
394
395
396
397
398
399
400
40 I
402
403
404
405

IN CMOS

AX,(CMOS B M S LO+NMI)·H+CMOS B M S HI+NMI
CMOS READ - - H[GH BYTe
AL,03FH
MASK OFF THE MANUFACTURING TEST BITS

~~O~L READ

;
;
;

DX,AX
E20BI

~~~E B~~~H O~Y~~SE

MEMORY SIZE
IS MEMORY SIZE GREATER THAN CONFIG?
GO IF EQUAL

SET MEMORY SIZE DETERM I NE NOT EQUAL TO CONF I GURA T I ON
0lC2
0 I C3
0lC6
0lC9
0lC8
OICO
DIDO
0I0I
0103
0105
0105
0107

8E8E
0000 E
10
C4
0000 E

DO
TT 37

AX

XCHG
CALL
POP
eMP
JA

DX,AX
E20C

SAVE AX
ADDRESS THE STATUS BYTE
GET THE STATUS
SET CMOS FLAG
SAVE AL AND GET ADDRESS
WRITE UPDATED STATUS
RESTORE AX
[S MEMORY SIZE GREATER THAN CONF [G
DEFAULT TO MEMORY SIZE DETERMINED 7

MOV
MOV

BX,AX
DX,AX

SET 8ASE MEMORY SIZE IN TOTAL REGISTER
SAVE IN BASE SIZE REG[STER

OR

AX,X· (CMOS DIAG+NMI)
CMOS READ AL,W-MEM SIZE
AL,AH
CMOS WR ITE

AX

-

7

E20BI:

8808
88 DO
406
407
408
409
010988 9798
410
OIDC E8 0000 E
411
OIDF 86 EO
412
OIEI E8 0000 E
413
0lE4 88 C8
414
415
416
0lE6 88 8081
4170lE9E80000E
418
OIEC 86 EO
419
OIEE E8 0000 E
420
421

CHECK MEMORY SIZE ABOVE 640K FROM CONF[GURATION
MOV
AX, (CMOS EMS LO+NMI ~ -H+ (CMOS EMS HI +NMI ~
CALL
CMOS READ - - ; HIGH-BYTE XCHG
AH,AL
; SAVE HIGH BYTE
CALL
CMOS READ
; LOW BYTE
MDV
CX,AX
; SAVE THE ABOVE 640K MEMORY SIZE
ABOVE 640K SIZE FROM MEMORY SIZE DETERMINE
CX=CONFIG
AX=MEMORY SIZE DETERMINE
MOV
AX, (CMOS U M 5 LO+NMI) ·H+ (CMOS U M 5 HI +NMI)
CALL
CMOS READ - - ; HIGH-BYTE XCHG
AH,AL
; SAVE HIGH 8YTE
CALL
CMOS READ
; LOW BYTE
WH [CH IS GREATER - AX = MEMORY 5 [ZE DETERM I NE
-- CX = CONFIGURATION (ABOVE 640) BX = SIZE (BELOW 640)

422
423
424
425
426
427
428
429
430
431
432
433
434

0 I F I 38 C8
0lF3 74 OF

CMP
JZ

0lF5
01 F6
0lF9
OIFC
OIFE
0200
0203

PUSH
MOV
CALL

;
:

IS CONFIGURATION EQUAL TO DETERMINED?
GO I F EQUAL

SET MEMORY SIZE DETERMINE NOT EQUAL TO CONFIGURATION
50
88
E8
DC
86
E8
58

8E8E
0000 E
10
C4
0000 E

OR
XCHG
CALL
POP

AX,X· (CMOS DIAG+NMI
CMOS READ AL,W-MEM SIZE
AL, AH
CMOS WR I TE

AX

~

-

SAVE AX
ADDRESS THE STATUS BYTE
GET THE STATUS
SET CMOS FLAG
SAVE AL
UPDATE STATUS BYTE
RESTORE AX

435
436
437
438
439
440
441
442
443
444

0204
0204
0206
0208
020A
020A
020C
020C
0210

445
446
447
448
449
450
451
452
453
454
455
456

0212
0215
0218
021 A
021C
021F
021F
0223
0226
0227

38 C8
TT 02
88 C8
03 09
81 FA 0201
72 00
88
E8
OC
86
E8

8383
0000 E
80
C4
0000 E

SETMEMI:
CMP
JA
MOV
SET MEM:
ADD
E20C:
eMP

CX,AX
SET MEM
Cx,AX

IS CONFIG GREATER THAN DETERMINED?
GO IF YES
USE MEMORY 5 [ZE DETERM I NE
SET TOTAL MEMORY SIZE

8X,CX

CHECK IF BASE MEMORY LESS 512K
GO IF YES

J8
MOV
CALL

OR
XCHG
CALL

89 IE 0017 R
C I E8 06

MOV
SHR

48
C I EA 06

DEC
SHR

AX,X·(CMOS
CMOS READ
AL,M640K
AL,AH
CMOS_WRITE

[NFOI28+NMI)

WORD PTR @KB FLAG, BX
BX,6
8X
DX,6

SET 640K BASE MEMORY BIT
GET THE CURRENT STATUS
TURN ON 640K BIT I F NOT ALREADY ON
SAVE THE CURRENT DIAGNOST[C STATUS
RESTORE THE STATUS
SAVE TOTAL 5 I ZE FOR LATER TEST I NG
DIVIDE BY 64
1ST 64K ALREADY DONE
DIVIDE BY 64 FOR BASE

TEST2

5-61

IBM Persona I Computer MACRO Assemb I er
Vers i on 2.00
TEST2 ---- 06/10/85
POST TESTS AND INITIALIZATION ROUTINES

457
456
459
460
461
462
463
464
465
466
461
466
469
410
471
412
473
414
475
476
471
476
479
460
481
482
483
484
465
46.
467
488
489
490
491
492
493
494
495
49.
491
498
499
500
501
502
503
504
505
506
507
508
509
510

~: ~

513
514

515
516
517
518
519
520
521
522
523
524
525
52.
527
528
529
530
531
532
533
534
535
53.
537
536
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
551
558
559
5'0

SAVE COUNTS IN STACK FOR BOTH MEMORY AND ADDRESSING TESTS

ox

022A 52
022B 6A 40
0220 53

PUSH
PUSH
PUSH

BYTE PTR 64

022E 52
022F 6A 40
0231 53

PUSH
PUSH
PUSH

BYTE PTR 64

;----0232 6A 08
0234 01

POP

;-----

SAVE BASE MEMORY SIZE COUNT
SAVE STARTING AMOUNT OF MEMORY OK
SAVE COUNT OF 64K BLOCKS TO BE TESTED

OX
BX

BYTE PTR GOT PTR

E5

MOD I FY THE OESCR I PTOR TABLE

-

SET TEMPORARY ES DESCRIPTOR 64K SEGMENT LIMIT STARTING AT 000000

0235
023C
0243
0249

26:
26:
26;
26:

C1
C7
C6
C6

06
06
06
06

0048
004A
004C
0040

FFFF
0000
00
93

MOV
MOV
MOV
MOV

024F
0256
0250
0263

26
26
26
26

C1
C1
C6
C6

06
06
06
06

0060
0062
0064
0065

FFFF
0000
00
93

MOV
MOV
MOV
MOV

0269
026B
0260
026F
0211

2A
E6
E6
FE
E6

ES: ES TEMP. SEG LI MIT, MAX SEG LEN
ES:ES-TEMP.BAsE La WORD,O
BYTE PTR ES: (ES-TEMP.BASE HI BYTEI,O
; FIRST 65K
BYTE PTR ES: (ES::::TEMP.DATA::::ACC_RIGHTS) ,CPLO_DATA_ACCESS

SET TEMPORARY OS DESCRIPTOR 64K SEGMENT LIMIT AT FIRST 65K 8LOCK

~~: g~-i~~~: ~~~EL ~~ I ~O~~~OSEG_LEN
BYTE PTR ESI lOS-TEMP.BASE HI BYTEI,O
BYTE PTR ES: lOS::::TEMP.DATA::::ACC_RIGHTS) ,CPLO_DATA_ACCESS

TEMPORARY SEGMENT SAVE IN DMA PAGE REGI STER FOR SECOND 65K BLOCK
CO
85
86
CO
84

SUB
OUT
OUT

; ----0273
0213 6A 08
0215 IF
0276 FE 06 0064
021A FE 06 004C

INC

AL -

OUT

DMA_PAGE+3,AL

MEMORY TEST LOOP -

E21:
PUSH
POP
I NC
INC
; -----

AL,AL
DMA PAGE+4, AL
DMA-PAGE+5.AL

INITIALIZE VALUES TO 010000
HIGH BYTE OF LOW WORD OF SEGMENT
LOW BYTE OF LOW WORD OF SEGMENT
SET HIGH BYTE OF SEGMENT WORD
HIGH BYTE OF SEGMENT

PO I NT TO NEXT BLOCK OF 32K WORDS

(64K)

;
MEMORY TEST LOOP
BYTE PTR GOT PTR
; PO I NT TO START OF DESCR I PTOR TABLE
OS
BYTE PTR OS: (OS TEMP. BASE H I BYTE I
; PO I NT TO NEXT BLOCK
8YTE PTR OS: (ES::TEMP. BASE::::H I::::BYTE)

CHECK FOR END OF 256K PLANAR MEMORY

021E 80 3E 0064 04
0283 12 04

CMP
..JB

8YTE PTR OS: (OS TEMP. BASE H I BYTE), 04H
E21_0
i-GO-IF STILL FIRST 256K OF BASE MEMORY

0285 BO CO
0281 E6 81

MOV
OUT

AL. PAR I TY CHECK+ 10 CHECK;
DMA_PAGE+6.AL
;

0289
0289 80 3E 0064 OA
028E 17 16

~~~~~~
;-----

0290
0291
0292
0293
0294
0295
0296
029A

59
5B
58
50
53
51
38 06 0064
12 OA

CMP
..JA

029C C6 06 0064 10
02A 1 C6 06 004C 10

BYTE PTR OS: (OS TEMP.BASE HI BYTE) ,OAH
NEXT
;-CONTINUE IF ABOVE

PUSH
PUSH
PUSH

CX
BX
AX
AX
BX
CX

1 MEG

GET COUNT
GET COUNT TESTED
RECOVER COUNT OF BASE MEMORY BLOCKS
SAVE BASE COUNT
SAVE TESTED COUNT
; SAVE TOTAL COUNT

CMP
JB

~~~~

PTR OS:

{DS_TEMP.BAS7_~6N~i~~~·~~

00 ADDITIONAL STORAGE ABOVE

I

NOT DONE

W;T~A~A~~S~E~g~~T

MEG

MOV
MOV

;-----

SAVE BASE_Hi_BYTE iN DMA PAGE REGISTERS 3

NEXT:

MOV
OUT

~~AB~!~E~~~A~S; {DS_TEMP.~A;~V~IT~~T~:GH
-

CHECK FOR TOP OF MEMORY
02AB 80 3E 004C FE
0280 74 29

;
(FEOOOO)

BYTE OF SEGMENT
FOR POSS I BLE ERROR

16 MEG
TOP OF MEMORY?
EX I T NEXT TEST

CMP
JE

; ----0282
0284
02B5
0281

CHECK FOR ANY TYPE OF PAR I TY ERROR
AFTER FIRST 256K
(END OF MAXIMUM BASE MEMORY)

CHECK FOR END OF BASE MEMORY TO BE TESTED
POP
POP
POP

; -----

02A6 AO 0064
02A9 E6 84

CHECK END OF FIRST 640K OR ABOVE

6A 60
IF
6A 48
01

SET ES AND OS REG I STERS TO MEMORY BLOCK
PUSH
POP

BYTE PTR OS_TEMP
OS

PUSH

BYTE PTR ES_ TEMP

POP

ES

02B8 BO 3 I
02BA E6 80

MOV
OUT

AL,31H
MFG_PORT ,AL

02BC
02BF
02C2
02C4
02C1
02C1
02C8

MOV

SET COUNT FOR 32K WORDS

CALL

CX,8000H
STGTST_CNT

JZ
JMP

N1
E21A

SKIP IF OK
GO PR I NT ERROR

POP
POP

CX
AX

B9
E8
74
E9

8000
0000 E
03
0361 R

<><> <> <> <><><><> <> <> <> <>
<><> CHECKPO I NT 31

NI:
59
58

WRITE THE CURRENT SIZE FOR

PDP CX TO GET AX
RECOVER TESTED MEMORY
(ADDRESS LINE 23-11 TEST)

USED LATER

02C9 2B FF
02CB AB

SUB
STOSW

DI,DJ

02CC 05 0040
02CF 50
0200 51

ADD
PUSH
PUSH

AX,64
AX
CX

POINT TO BEGINNING OR A BLOCK
WR I TE THE CURRENT SIZE
AT THE STARTING ADDRESS
ADVANCE COUNT TO NEXT BLOCK
SAVE TESTED MEMORY
SAVE LOOP COUNT

0201

CALL

PRT_OK

OJ SPLAY

5.5
566
561
568
5.9
570

SAVE BASE MEMORY SIZE COUNT
SAVE STARTING AMOUNT OF MEMORY OK
SAVE COUNT OF 64K BLOCKS TO BE TESTED

BX

MODJFY DESCRIPTOR TABLES
PUSH

561
5.2
563
564

1-5
06-10-85

5-62

E8 099F R

TEST2

"OXXXX OK ~

MESSAGE

I F DONE

,-.

IBM Personal Computer MACRO Assembler
Version 2.00
TEST2 ---- 06/10185
POST TESTS AND INITIALIZATION ROUTINES

511
572
573
57.
575
576
577
578
579
580
58'
582
583
58'
585
586
587
588
589
590
59'
592
593
59.
595
596
597
598
599
600
601
602
603

0204 59
0205 49
0206 E3 03

POP

0208 51
0209 EB 98

PUSH

ex

J"P

E2'

60'

02FO
02FO BO 33
02FF E6 80
0301 26: 80 06 0064 01

60S

606
607
608
609
610

6"
6'2

020B
020B 58
020C 58

DEC
JCXZ

K8 LOOP3:
POP
POP

06- \ 0-85
RECOVER 64K BLOCK COUNT
DECREMENT BLOCK COUNT FOR LOOP
CONTINUE TO NEXT TEST IF DONE

CX
CX

K8_LOOP3

SAVE LOOP COUNT
LOOP TILL ALL MEMORY CHECKED
END MA I N TEST LOOP
CLEAR MAX I MUM BLOCK COUNT
CLEAR 8ASE SIZE COUNT FROM STACK
ADDRESS TEST VALUES ARE IN STACK

AX
AX

ADDRESS LINE 16-23 TEST
0200 B9 40BB
02EO E8 0000 E

"OV
CALL

02E3
OZE5
02E6
02EC

6A 08
07
26: C6 06 0064 00
26: C7 06 0062 0000

PUSH
POP
MOV
MOV

02F3
02F5
02F7
02F9
02FB

2A
E6
E6
BO
E6

INITIALIZE

;----CO
85
86
01
84

os

DESCRIPTOR

BYTE PTR GOT PTR
ES
BYTE PTR ES: (OS TEMP.BASE HI BYTE~ ,0
ES:DS_TEMP,BASE:LO_WORD,O--

TEMPORARY SEGMENT SAVE IN OMA PAGE REGISTER
SUB
OUT
OUT

"OV
OUT

;-----

LET FIRST PASS BE SEEN
COUNT FOR 250 MS F I XED T I ME DELAY
ALLOW S I X 0 I SPLAY REFRESH CYCLES

CX,16511
WAITF

AL,AL
OMA PAGE+4,AL
OMA-PAGE+5,AL
AL,OIH
OMA_PAGE+3,AL

HIGH BYTE OF LOW WORD OF SEGMENT
LOW BYTE OF LOW WORD OF SEGMENT
SET HIGH BYTE OF SEGMENT WORD
HIGH BYTE OF SEGMENT

POINT TO NEXT BLOCK OF 64K

E21_A:
MOV
OUT
ADO
; -----

AL,33H
<><><><><><><><><><><><>
MFG PORT, AL
, < > < > CHECK PO 1NT 33 <><>
BYTE PTR ES: (DS_TEMP.BASE_HI_BYTEI ,01

CHECK FOR END OF BASE MEMORY TO BE TESTED

0307 26: 80 3E 0064 OA
0300 77 13

CMP
JA

BYTE PTR ES: (OS TEMP.BASE HI BYTEI, OAH
NEXT_A
-CONTINUE IF ABOVE

030F
0310
0311
0312
0313
0314
0315
031A

POP
POP
POP
PUSH
PUSH
PUSH
CMP
JB

CX
I GET COUNT
BX
; GET COUNT TESTED
AX
; RECOVER COUNT OF BASE MEMORY BLOCKS
AX
; SAVE BASE COUNT
BX
: SAVE TESTED COUNT
CX
; SAVE TOTAL COUNT
BYTE PTR ES: (OS TEMP.BASE HI BYTE~ ,AL
; MAX BASE COUNT
NEXT_A
;-CONTINUE IF NOT DONE WITH BASE MEMORY

I MEG

6'3

6"

6'5
6'6

6"
6'8

6,9
620
62'
622
623
62'
625
626
627
628
629
630
63'
632
633
63.
635
636

6"

59
58
58
50
53
51
26: 38 06 0064
12 06

DO ADD 1T I ONAL STORAGE ABOVE
031C
031C 26: C6 06 0064 10
0322
0322 26: AO 0064

6.'

6'2
6.3
6.5

6'6
6.7
6.8
6.9
650
65'
652
653
65.
655
656
657
658
659
660
66'
662
663
66'
665
666
6.7
668
669
670
611
672
6-73
67.
675

6,.
6"
678

0326 E6 84

0339
033C
033F
0340
0341
0342
0343
0345
0341

89
E8
59
58
50
51
3B
8B
15

60

68'

;
;

CHECK FOR TOP OF MEMORY

JZ
;-----

6A
IF
2B
88
8B
2B
89

AL,BYTE PTR ES: (OS_TEMP.8ASE_HI_BYTEI

DMA PAGE REGISTERS 3

e"p

0328 3C FE
032A 14 34

032C
032E
032F
0331
0333
0335
0337

1 MEG

BYTE PTR ES: (OS_TEMP.BASE_Hl_BYTEl ,I OH

OUT

:-----

AL,OFEH
KB_LOOP _3

(FEOOOO]

SAVE THE HIGH BYTE OF SEGMENT
FOR POSSIBLE ERROR
16 MEG

;
:

TOP OF MEMORY?
GO NEXT TEST IF

IT IS

SET OS REGISTER
PUSH
POP
SUB

BYTE PTR OS TEMP

as

FF
15
F7
CO
05

"OV
"OV

1 A69
0000 E

"OV
CALL

CX,6761
WAITF

POP
POP
PUSH
PUSH

CX

CX

"OV
JNZ

AX,OX
AX,OX
E21A

SUB

"OV

-

PO I NT TO START OF BLOCK
GET THE VALUE OF TH I S BLOCK
SET SI FOR POSSIBLE ERROR
CLEAR MEMORY LOCAT I ON

01,01
DX,oS:[DI]
SI,DI
AX,AX
[01] ,AX

ALLOW D I SPLA Y T I ME TO 0 I SPLA Y MESSAGE AND REFRESH TO RUN

C2
C2
IE

e"p

COUNT FOR 102 MS F I XED T I ME DELAY
ALLOW FIVE 0 I SPLA Y REFRESH CYCLES
GET THE LOOP COUNT
RECOVER TESTED MEMORY
SAVE TESTED MEMORY
SAVE LOOP COUNT
DOES THE BLOCK 10 MATCH
GET THE BLOCK 10 FOR POSS IBLE ERROR
GO PR I NT ERROR

AX
AX

CHECK FOR CHECK PAR 1TY
0349 E4 61
0348 24 CO
0340 15 18

AND
JNZ

034F
0350
0351
0354
0355
0356
0359
035A
035B

POP
POP
ADD
PUSH
PUSH
CALL
POP
OEC
JCXZ

59
58
05 0040
50
51
E8 099F R
59
49
E3 03

0350 51
035E EB 90

679
.80

.82
683
68'

"OV
;-----

638
639
6.0

64.

NEXT A2:
MOV

[N

AL,PORT B
AL,PARITY ERR
E21A
-

CHECK FOR 110 OR PARITY CHECK
STRIP UNWANTED BITS
EXIT IF PARITY ERROR

CX

POP CX TO GET AX
RECOVER TESTED MEMORY
64K INCREMENTS
SAVE TESTED MEMORY
SAVE LOOP COUNT
01 SPLAY OK MESSAGE
RECOVER 64K BLOCK COUNT
LOOP TILL ALL MEMORY CHECKED
CONTINUE

AX
AX,64
AX
CX

PRT OK
CX CX

KB_LOOP _3

PUSH

CX

J"P

E21_A

SACK TO REAL MODE 0360
0360 BO 34
0362 E6 80

KB LOOP 3:
-MOV
OUT

AL,34H
MFG_PORT ,AL

SAVE LOOP COUNT
CONTINUE TILL DONE
MEMORY TESTS DONE

<> <><><><><><><> <><><><>
<><> CHECKPOINT 34 <><>

TEST2

5-63

IBM Personal Computer MACRO Assembler
Version 2.00
TEST2 ---- 06/10/85
POST TESTS AND INITIALIZATION ROUTINES

6.5
686
6.7

0364 E9 0000 E

J"P

1-7
06-10-85
:
;

PROC_SHUTDOWN

BACK TO REAL MOOE
NEXT TEST V I A JUMP TABLE

I SHUT2)

6 ••

6.9
690
691
&92
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
71 7
718
719

;----;----;
0367
0369
036B
0360
036F
0371
0373

E6
8A
E6
88
E6
86
E6

82
C4
83
C6
86

0375
0377
0378
037A
037C
037E
0380
0382

28 F6
A8
E4 61
E6 88
OC OC
E6 61
24 F3
E6 61

E21 A:

OUT

"OY
OUT

"OY
OUT
XCHG
OUT

EO
85

; -----

CLEAR

I/O CHANNEL CHECK OR R/W PARITY CHECK
S[ •SI

WRITE TO FAILING BLOCK

AL,PORT B
DMA PAGE+7,AL
AL, RAM PAR OFF
PORT B7AL AL. RAM PAR ON
PORT_B7AL -

GET PAR I TY CHECK LATCHES
SAVE FOR ERROR HANDLER
TOGGLE J ID-PAR I TY CHECK ENABLE
TO RESET CHECKS

AND

0384 58
038558
0386 5B
0387 C 1 E3 06
038A 2B C3
038C 73 17

(LOW BYTE)

GET THE FA I LING OFFSET

IN

OUT

; -----

SAVE FAILING BIT PATTERN
SAVE HIGH BYTE

DMA PAGE+I .AL
AL,AH
DMA PAGE+2,AL
AX,51
OMA PAGE+5.AL
AH,AL
DMA_PAGE+4,AL

SUB
STOSW
OUT
OR
OUT

GET THE LAST OF GOOD MEMORY
POP
POP
POP
SHL
SUB
JAE

720
721
722
723
724

PRINT FAILING ADDRESS AND XOR'ED PATTERN IF DATA COMPARE ERROR
USE DMA PAGE REGI STERS AS TEMPORARY SAVE AREA FOR ERROR
SET SHUTDOWN 3

AX
AX

CLEAR BLOCK COUNT
GET THE LAST OF GOOD MEMORY
GET BASE MEMORY COUNTER
CONVERT TO MEMORY SIZE COUNTS
COMPARE LAST GOOD MEMORY WITH BASE
I F ABOVE OR EQUAL, USE REMA I NDER IN
CMOS_U_M_S_IH/U

BX

8X,6
AX,BX
E21 I

ELSE SET BASE MEMORY SIZE
038E 6A
0390 IF

18

PUSH
POP

BYTE PTR RSDA PTR
OS
-

SET THE DATA SEGMENT
I N PROTECTED MODE

ADO

AX,ax
IPMEMORY SIZE, AX

CONVERT BACK TO LAST WORK I NG MEMORY
TO INDICATE HOW MUCH MEMORY WORKING

725
726
727

72.
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
74'
745
746
747
748
749
750
751
752

0391 03 C3
0393 A3 0013 R

"OY

RESET 512K --> 640K OPT I ON
0396
0399
039C
039E
03AO
03A3
03A5
03A5
03A7
03A9
03AC
03AE
0380

B8
E8
24
86
E8
33

8383
0000 E
7F
C4
0000 E
CO

8B
80
E8
8A
BO
E8

C8
BI
0000 E
EI
BO
0000 E

XCHG
CALL
XOR

ADDRESS OPTIONS INFORMATION BYTE
READ THE MEMORY INFORMATION FLAG
SET 640K OPT I ON OFF
MOVE TO WORK REG I STER
UPDATE STATUS IF IT WAS ON
CLEAR VALUE FOR EXTENS J ON MEMORY

"OY
"OY
CALL
"OY
"OY
CALL

CX,AX
AL,CMOS U M S HI+NMI
CMOS WRITE - AH,C[
AL,CMOS U M S LO+NMI
CMOS_WRITE - -

SAVE ADJUSTED MEMORY 51 ZE

AND

E21 1:

; -----

"OY
CALL

03B9 E9 0000 E

JMP

AX,3·H+CMOS SHUT _ DOWN+NM I
CMOS_WRITE

SHUTDOWN

TEST2

SAVE THE HIGH BYTE MEMORY SIZE
GET THE LOW BYTE
DO THE LOW BYTE
WRITE IT

SET SHUTDOWN 3

0383 88 a38F
0386 E8 0000 E

5-64

I F SET

AX,X·(CM05INFOI28+NMI)
CMOS READ AL, NOT M64QK
AL,AH
CMOS WR ITE
AX,AX

"OY
CALL

PROC_SHUTDOWN

ADDRESS FOR SHUTDOWN RETURN
SET RETURN 3

'-8

IBM Personill Computer MACRO Assembler
Version 2.00
TEST2 ---- 06/10/85
POST TESTS AND INITIALIZATION ROUTINES

753

PAGE

;

754
755
756
757
758
759
760
76'
762
763
764
765
766
767
768
769

;

-- - -- - - -- - -- - - -- - -- -- -- - -- - - -- - -- - - -- - - -- - -- - - - - - -- - - -- - -- - - - - - - - - -(R/WI MEMORY OR PAR[TY ERRORS)

MEMORY ERROR REPORTING
DESCR[PTION FOR ERRORS 201
OR 202
"AABBCC DDEE 201"

(CMP ERROR OR PAR[TY)
(ADDRESS LINE 0-15 ERROR)

(OR 202)
AA=H I GH BYTE OF 24 B IT ADDRESS
BB=M[DDLE BYTE OF 24 BIT ADDRESS
CC=LOW BYTE OF 24 BI T ADDRESS
OD=HIGH BYTE OF XOR FA[LlNG B[T PATTERN
EE=LOW BYTE OF XOR FA[LlNG BIT PATTERN

DESCRIPTION FOR ERROR 202 (ADDRESS LINE 00-151
A WORD OF FFFF IS WRITTEN AT THE FIRST WORD AND LAST WORD
OF EACH 64K BLOCK WITH ZEROS AT ALL OTHER LOCATI ONS OF THE
BLOCK.
A SCAN OF THE BLOCK I S MADE TO I NSURE ADDRESS LI NE
a-Is ARE FUNCTIONING.

770
771
772
773
774
775
776
777
778
779
780
78'
782
783
784
785
786
787
788
789
790
79,
792
793
794
795
796
797
798
799
800
80 ,
802
803
804
805
806
807
808
809

06-10-85

DESCRIPTION FOR ERROR 203 (ADDRESS LINE 16-23)
AT THE LAST PASS OF THE STORAGE TEST, FOR EACH BLOCK OF
64K, THE CURRENT STORAGE SIZE (101 IS WRITTEN AT THE FIRST
WORD OF EACH BLOCK. IT IS USED TO FINO ADDRESSING FAILURES.
"AABBCC OOEE 203"
SAME AS ABOVE EXCEPT FOR DOEE
GENERAL DESCRIPTION FOR BLOCK 10
DD=H I GH BYTE OF BLOCK [0
EE=LOW BYTE OF BLOCK 10
BLOCK
0000
0040

[0

(DDEE WILL NOW CONTAINED THE

10)

ADDRESS RANGE
000000 --> OOFFFF
010000 --> OIFFFF

/I
090000 --> 09FFFF
100000 --> 10FFFF

0200

(512->576K) [F 640K BASE
(1024->1088K) IF 512K BASE

EXAMPLE (640K BASE MEMORY + 512K I fO MEMORY = I 152K TOT ALl
NOTE: THE CORRECT SLOCK 10 FOR THIS FAILURE IS 0280 HEX.
DUE TO AN ADDRESS FAILURE THE BLOCK ID+128K OVERLAYED
THE CORRECT BLOCK 10.
00640K OK
10000 0300 202

<-- LAST OK MEMORY
<-- ERROR DUE TO ADDRESS FAILURE

IF A PARITY LATCH WAS SET THE CORRESPONDING MESSAGE W[LL D[SPLAY.
"PARITY CHECK

I"

(OR 21

DMA PAGE REGISTERS ARE USED AS TEMPORARY SAVE AREAS FOR SEGMENT
OESCR I PTOR VALUES.
03BC
038C E8 0000 E

SHUT3 :

ENTRY FROM PROCESSOR SHUTDOWN 3
SET REAL MOOE DATA SEGMENT

CALL

DDS

MOV
MOV

«tMFG ERR FLAG+l,MEM FA[L;
",L,CR
-;
PRT HEX
AL,CF
PRT HEX
AL,DMA PAGE+3
XPC BYTE
AL,DMA PAGE+4
XPC BYTE
AL,DMA PAGE+5
XPC BYTE
AL,T ,
PRT HEX
AL,OMA PAGE+2
XPC BYTE
AL,OMA PAGE+ I
XPC_8YTE

BlO
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828

829
830
83'
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864

03BF
03C4
03C6
03C9
03CB
03CE
0300
0303
0305
0308
030A
0300
030F
03E2
03E4
03E7
03E9

C6
BO
E8
80
E8
E4
E8
E4
E8
E4
E8
BO
E8
E4
E8
E4
E8

06 0016 R 01
00
0000 E
OA
0000 E
84
0000 E
85
0000 E
86
0000 E
20
0000 E
83
0000 E
82
0000 E

03EC
03EE
03FO
03F3

E4
3C
BE
14

80
33
0000 E
OA

'N
eMP
MOV

03F5 BE 0000 E
03F8 3C 32
03FA 74 03

MOV
eMP

CALL
MOV

CALL

'N

CALL

'N
'N
CALL
CALL
MOV

CALL

'N
'N
CALL

CALL

<><> MEMORY FAILED
<><>
CLEAR AND SET MANUFACTURING ERROR FLAG
CARR I AGE RETURN
LINE FEED
GET THE HIGH BYTE OF 24 BIT ADDRESS
CONVERT AND PR I NT CODE
GET THE MIDDLE BYTE OF 24 BIT ADDRESS
GET THE LOW BYTE OF 24 B [T ADDRESS
SPACE TO MESSAGE
GET HIGH BYTE FAILING BIT PATTERN
CONVERT AND PR INT CODE
GET LOW BYTE FAILING BIT PATTERN
CONVERT AND PR INT CODE

CHECK FOR ADDRESS ERROR

03FC BE 0000 E
03FF
03FF E8 0000 E
0402 E4 88

JZ

JZ

AL ,MFG_PORT
AL,33H
S I ,OfFSET E203
ERR2

GET THE CHECKPO I NT
15 IT AN ADDRESS FAILURE?
LOAD ADDRESS ERROR 16->23
GO IF YES

S I ,OFFSET E202
AL,32H
ERR2

LOAD ADDRESS ERROR 00-> 15
GO IF YES

MOV

SI,OFFSET E201

SETUP ADDRESS OF ERROR MESSAGE

CALL

E MSG
AL,DMA_PAGE+1

PRINT ERROR MESSAGE
GET THE PORT_B VALUE

ERR2:
'N

DISPLAY

"PARITY CHECK

0404 A8 80
0406 74 OB

TEST
JZ

NM'

0408
0409
040C
040F
0412
0413
0413
0415

PUSH
CALL

50
E8 098F R
BE 0000 E
E8 0000 E
58

MOV

CALL
NM'

A8 40
14 09

0417 E8 098F R
041A BE 0000 E
0410 E8 0000 E
0420

- MI:

TEST
JZ

NM'

CALL

-

PADING
51 ,OFFSET 01
P MSG

AX

MOV
NM'

- M'

AX

POP

CALL

?" ERROR MESSAGES

AL,PAR[TY_CHECK

AL,IO_CHECK

- M2

PADING
S I ,OFFSET 02
P _MSG

CHECK FOR PLANAR ERROR
SKIP IF NOT
SAVE STATUS
I NSERT BLANKS
PLANAR ERROR, ADDRESS "PARITY CHECK
DISPLAY "PARITY CHECK I" MESSAGE
AND RECOVER STATUS
I/O PAR I TV CHt=:CK 1
SK I P I F CORRECT ERROR D I SPLA YEO
I NSERT BLANKS
ADDRESS OF "PAR I TY CHECK 2" MESSAGE
DISPLAY "PARITY CHECK 2" ERROR

M2:
CONTINUE TESTING SySTEM ••••

TEST2

5-65

j"

IBM Personal Computer MACRO Assembler
Version 2.00
TEST2 ---- 06/10/85
POST TESTS AND INITIALIZATION ROUTINES

8.5
8 ••
8.7
868
8.9
870
871
872
873
874
875
87.
877
878
879
880
881
882

PAGE
;----0420

1-9
06-10-85

ENTRY FROM SHUTDOWN

SHUT2 :
;- - - -- -- - - - - - - -- -- ---- - - - - - - - - - - - - - - - - - - --- - - - - - - - - - -- -; TEST. 20
;
ADDITIONAL PROTECTED (VIRTUAL MODE) TEST
; DESCRIPT[ON
;
THE PROCESSOR I S PUT [N PROTECTED MODE AND
;
THE FOLLOW I NG FUNCT IONS ARE VER I F I ED
;
1. VER I FY PROTECTED MODE
;
THE MACHINE STATUS [S CHECK FOR VIRTUAL MODE
;
;
2. PROGRAMMED I NTERRUPT TEST
AN PROGRAMMED INTERRUPT 32 IS ISSUED AND
;
AND VERIFIED
3. EXCEPT I ON INTERRUPT 13 TEST
;
A DESCR I PTOR SEGMENT LIM I TIS SET TO ZERO
;
AND A WR I TE TO THAT SEGMENT I S ATTEMPTED
;
AN EXCEPT I ON 13 I S EXPECTED AND VER I F I ED
;
LOT/SOT LTR/STR TEST
LOAD LOT REGISTER AND VERIFY CORRECT
LOAD TASK REG I STER AND VER I FY CORRECT
;
THEY ARE VERIFIED VIA THE STORE INSTRUCTION
;
5. THE CONTROL FLAGS OF THE 286 FOR D[RECTIDN
;
ARE VER I F I ED V I A THE STo AND CLD COMMANDS
;
;
I N PROTECTED MODE
BOUND INSTRUCTION TEST (EXCEPTION INT 5)
;
CREATE A SIGNED ARRAY INDEX WITHIN AND
;
OUTSIDE THE LIMITS.
CHECK THAT NO EXC INT
IF WITHIN LlM[T AND THAT AN EXC INT 5
;
OCCURS I F OUTS I DE THE LI M I TS.
;
7.
PUSH
ALL
POP
ALL
TEST
;
SET GENERAL PURPOSE REGISTERS TO DIFFERENT
;
VALUES, ISSUE A PUSH ALL, CLEAR THE REGISTERS
;
THEN I SSUE A POP ALL AND VER I FY CORRECT.
8. CHECK THE VERR/VERW INSTRUCTIONS
;
THE ACCESS BYTE I S SET TO READ ONLY THEN TO
;
A WR I TE ONLY AND THE VERR / VERW I NSTRUCT IONS
;
ARE VERIFIED.
;
9. CAUSE AN INTERRUPT 13 VIA A WRITE TO A
;
;
READ ONLY SEGMENT
;
VERIFY THE ARPL INSTRUCTION FUNCTIONS
SET THE RPL FIELD OF A SELECTOR AND
VERIFY THAT CURRENT SELECTOR RPL IS SET
;
CORRECTLY.
11. VERIFY THE LAR INSTRUCTION FUNCTIONS
;
12. VERIFY THE LSL INSTRUCTION FUNCTIONS
;
13. LOW MEG CH I P SELECT TEST
;

803
884
885
88.
887
888
889
890
891

892
893
894
895
89.
897
898
899
900
901
902
903
904
905
90.
907
908
909
910
911

912
913
914
915

91.
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
93.
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
95.
957
958
959
900
961
962
963
964
905
906
967
968
969
910
971
972
973
914
975
976
977
978

0420 E9 0000 E

JMP

POST3

GO TEST THE 286 PROTECTED MODE

FAILURE ENTRY FROM A SHUTDOWN
0423
0426
0428
042A
0420
042F

E8
E4
3C
BE
14
BE

0000 E
80
35
0000 E
00
0000 E

SHUT7:

IN
JZ
SHUT7A: MOV

043280 DE 0016 R 02
0437 E8 0000 E
043A E8 08
043C E8 0000 E

0000 E
CO
0017 R
OOOE
0082

2A CO
EE
42
E2 FA

@MFG_ERR_FLAG+I ,PRO_FA ILl

CALL

E MSG
SHORT SHUT6
E_MSG

CALL

ESTABLISH THE DATA SEGMENT
CHECK FOR CH I P SELECT ERROR
PR I NT ERROR 109
GO IF NOT
PROTECTED MODE FA I LED

<><> <><> <> <> <> <> <> <> <><> <> <> <>
<><> V I RTUAL MODE FA I LED
PR I NT MESSAGE
PR I NT MESSAGE

<><> <><><> <> <> <> <> <> <> <> <> <> <>
<><> LOW MEG CH I P SELECT

OR
; -----

E8
28
A3
89
8A

005
AL,MFG PORT
AL,35H51 ,OFFSET El09
SHUT7B
SI ,OFFSET El04

OR

JMP

SHUT7B:

043F 80 OE 0016 R 04

0444
0447
0449
044C
044F
0452
0452
0454
0455
0450

CALL
eMP
MOV

SHUT6:

PROTECTED MODE TEST PASSED ENTRY FROM A SHUTDOWN
CALL

DDS

SUB
MOV
MOV
MDV

AX,AX
WORD PTR @KB FLAG, AX
CX,OEH
OX ,DMA_PAGE+ 1

CLR LOOP:
SUB
DUT

PROTECTED MODE TEST PASSED
CLEAR KEYBOARD STATE FLAGS
CLEAR PAGE REG I STERS

AL,AL
DX,AL

INC

DX

LOOP

CLR_LOOP

; --- - --- --- -------------- - - -- - --- ---------I

;
;
;

;

TEST.21
KEYBOARD TEST
DESCRIPTION
RESET THE KEYBOARD AND CHECK THAT SCAN
CODE n AA" I S RETURNED TO THE PROCESSOR.
CHECK FOR STUCK KEYS.

- - --- -------------------------

0458 90 35
045A E6 80
045C
0461
0463
0406
0466
0460
0470
0472
0414
0475
0478
0470
0482
0484
0486
0489

5-66

F6
75
E9
80
75
E9
80
E6
FA
81
74
80
74
80
E8
87

06 0012 R 20
03
0516 R
3E 0072 R 64
03
0516 R
36
80
3E 0072 R 1234
17
3E 0072 R AA
10
AE
0000 E
04

TEST2

MOV
OUT

AL,35H
MFG_PORT ,AL

TEST
JNZ

@MFG TST,MFG LOOP
F7 AF7;
8YTE PTR @RESET FLAG,064H
F7 B
F7AL,36H
MFG_PORT ,AL

JMP

F7_A:

CMP
JNZ

F7_B:

MOV
OUT
eLI

JMP

eMP

JZ
eMP

JZ
MOV

CALL
MOV

<> <> <> <><> <> <><><> <><><>
<><> CHECK PO I NT
35 <><>
MANUFACTURING BURN

IN TEST MODE?

YES - SKIP KEYBOARD TEST
I MANUFACTURING RUN IN MODE?
YES -

SK I P KEYBOARO TEST
<><><><> <> <> <> <> <> <> <> <>
<><> CHECKPOINT
36 <><>

@RESET FLAG, 1234H
SOFT RESET?
Gl0
BYTE PTR @RESET FLAG, KB OK ; CHECK FOR AA ALREADY RECE I YEO
GI 0
GO I F YES
AL,ENA KBD
C8042 ; ENA8LE KEYBOARD
8H,4
; TRY 4 TIMES

IBM Personal Computer MACRO Assembler
Version 2.00
TEST2 ---- 00/10/85
POST TESTS AND INITIALIZATION ROUTINES
979
048B
980
048E
981
0490
982
0492
983
0494
984
0490
985
0499
986
049B
987
0490
988
04AO
989
04A3
990
04A5
991
04A7
992
993
04A9
994
995
04AE
996
04B I
997
04B3
998
0486
999
04B8
1000 04BA
1001 04BC
1002 04BF
1003
1004
1005
1006 04CI
1007 04C3
1008
1009 04C5
1010 04C7
101 1 04CA
1012 04CD
1013 04DO
1014 04D2
1015 0404
1016
1017 04D6
1018 04D8
1019
1020 04DA
1021 04DC
1022 04DF
1023
1024
1025
1026 04EI
1027 04E2
1028 04E4
I 029 04E6
1030 04E8
1031 04EA
1032 04EC
1033 04EE
1034 04FO
1035 04F2
1036 04F4
1037 04F6
1038 04F9
1039 04FB
1040 04FD
1041 04FF
10420501
1043
1044 0506
1045 0509
1046 050B
1047
1048 050E
1049
1050
1051 0513
1052
1053
1054
10550516
1056 0518
1057
1058 051A
1059 051C
1060 051E
1061 051F
1062 0521
1063 0524
1064 0526
1065
1060
1067
1068 0528
1069 052A
1070
107 I
1072
1073 0520
1074 052F
1075 0531
1076 0534
1071 0535
1078 0536
1079 0539
1080 053C
1081 0530
1082 053E
1083 053F
1084
1085
1086
1087
1088 0541
1089 0543
1090 0545
1091 0548
1092 0549

E8
75
FE
75
BO
E8
E4
BO
E8
E8
E4
A8
74

0000
04
CF
F7
AD
0000
60
EO
0000
0000
60
01
OA

E

LOOPI:

Gl0:
E
E
E

CALL
.JNZ
DEe
.JNZ
MDV
CALL
IN
MDV
CALL
CALL
IN
TEST
JZ

80 DE 0016 R 08
BE
EB
E8
E3
BO
E6
80
75

0000 E
00
0000 E
29
37
80
FB AA
20

1-10
06-10-85

OBF 42
GIO
BH
LOOPI
AL,DIS KBD
C8042
AL,PORT A
AL,KYBD-CLK DATA
C8042
08F 42
AL,PORT A
AL,KYBO-CLK

CHECK FOR OUTPUT BUFFER FULL
GO I F BUFFER FULL
o I SABLE KEYBOARD
FLUSH
GET THE CLOCK AND DATA LINES
WAIT FOR OUTPUT BUFFER FULL
GET THE RESULTS
KEYBOARD CLOCK MUST BE LOW

GI I
'1'IMFG_ERR_FLAG+ t ,KYCLK_FA I L ;

GI I:

MOV
JMP
CALL
JCXZ
MDV
OUT
eMP
JNE

<><><><><><><><><><><><><><><>

<><> KEYBOARD CLOCK HIGH <><>
DISPLAy 304 ERROR
REPORT ERROR
I SSUE RESET TO KEYBOARD
PR INT ERROR MESSAGE IF NO INTERRUPT

S I ,OFFSET E304
SHORT F60
KBD_RESET
F.
AL,37H
MFG PORT, AL
BL,KB_OK
F6

<> <><><> <> <><><> <><> <> <>
<><> CHECKPOINT 37 <><>
SCAN CODE AS EXPECTED?
NO - DI SPLAY ERROR MESSAGE

CHECK FOR STUCK KEYS
BO 38
E6 80

MOV
OUT

AL,38H
MFG_PORT ,AL

80
E8
B9
E8
E4
A8
74

MOV
CALL
MOV
CALL
IN
TEST
JE

AL ,ENA_KBD
C8042
CX ,6628
WAITF
AL, STATUS_PORT
AL ,OUT _ BUF _FULL
F7

BO 39
E6 80

MOV
OUT

AL , 39H
MFG_PORT ,AL

E4 60
E8 0000 E
EB 2A

IN
CALL
JMP

AL,PDRT_A
XPC BYTE
SHORT F6C

AE
0000 E
19E4
0000 E
64
0I
40

<> <><> <> <> <><> <> <> <> <> <>
<><> CHECKPOINT 38 <><>
ASSURE KEYBOARD ENABLED
I S SUE THE COMMAND
COUNT FOR 100 MILLISECONDS
DELA Y FOR A WH I LE
CHECK FOR STUCK KEYS
OUT BUFFER FULL?
YES - CONT I NUE TEST I NG

<> <> <> <> <> <> <> <><> <> <> <>
<><> CHECK PO I NT 39 <><>
GET THE SCAN CODE
CONVERT AND PR I NT
CONTINUE

KEYBOARD ERROR TRY TO DETERM I NE IF 8042
FA
BO AB
E6 64
2B C9
B7 05
E4 64
A8 01
ElF A
75 09
FE CF
75 F4
BE 0000 E
EB 18
E4 60
3C 00
74 OA
80 OE 0016 R 10
BE 0000 E
EB 08
BE 0000 E

F6:

F6A:

F6B:

F6C:

80 DE 0016 R 20
E8 0000 E

I S WORK I NG

MOV
JMP
MOV

AL, I NTR FACE CK
COMMAND TO 8042
STATUS PORT,AL
CX ,CX BH,05
WAIT FOR OUTPUT BUFFER FULL
AL,STATUS PORT
AL,OUT BUF FULL
8042 FINISHED TEST?
F6A
F6B
GO CHECK RESULTS
BH
F6A
TRY AGAIN
SI ,OFFSET E303
INDICATE PLANAR FAILURE
SHORT FoD
(REMOVE KEYBOARD TRY AGAIN)
AL,PORT A
GET THE RESULTS OF [NTERFACE TEST
AL,O
[S THE INTERFACE OK?
F6C
OMFG_ERR_FLAG+I,KY_SYS_FAIL;
<><><><><><><><><><><><>
;
<><> KEYBOARD/SYSTEM <><>
S[ ,OFFSET E303
; PLANAR FAILURE
SHORT F6D
; GO I F YES
SI,OFFSET E301
; GET MESSAGE ADDRESS

<><><><> <> <> <> <> <> <> <> <> <>
<><> KEYBOARD FAILED <><>

OR

F6D:

I NTERF ACE

eLi
MOV
OUT
SUB
MOV
IN
TEST
LOOPZ
JNZ
DEC
JNZ
MOV
JMP
IN
CMP
JZ
OR

CALL

;

PRINT MESSAGE ON SCREEN

INITIALIZE 8042 TO HONOR KEY LOCK
BO 3A
E6 80
80
E6
FA
BO
E8
BO
E6

F7:

AL,3AH
MFG _PORT, AL

MOV
OUT

AL,OFFH
INTAOI,AL

D[SABl.E INTERRUPTS

60
0000 E
45
60

MOV
CALL
MOV
OUT

AL, WR I TE 8042 LOC
C8042
AL,45H
PORT_A,AL

WR I TE 8042 MEMORY COMMAND
I SSUE THE COMMAND
SET SYSTEM FLAG - OUTBUF INTERRUPT PC I COMPATIBILITY
RESET INHIBIT OVER RIDE

eLi

; --B4 DO
E8 0000 E

DEGATE ADDRESS LINE 20
MOV
CALL

AH, 0 I SABLE B I T20
GATE_A20
-

SETUP HARDWARE
2B
8E
B9
OE
IF
BE
BF
A5
47
47
E2

<> <> <> <> <><><> <> <><><><>
<><> CHECKPOINT 3A <><>

MOV
OUT

FF
21

CO
CO
0008
0000 E
0020 R
F1A:
FB

SUB
MOV
MOV
PUSH
POP
MOV
MOV
MDVSW
INC
INC
LOOP

AX,AX
ES,AX
CX,08
CS
DS
S I ,OFFSET VECTOR TABLE
D I ,OFFSET 0 I NT _PTR
DI
01
F7A

SETUP HARDWARE
ASSUME
28 CO
8E CO
B9 0008
OE
IF

SUB

MOV
MOV
PUSH
POP

SET COMMAND IN AH
I SSUE THE COMMAND

[NTERRUPT VECTOR TABLE LEVEL 0-7

ES:ABSO
AX,AX
ES,AX
CX,08

es

GET VECTOR COUNT
SETUP DS SEGMENT REG I STER

:

SK I P OVER SEGMENT

INTERRUPT VECTORS LEVEL 8-15

(VECTORS START AT

INT 70H)

GET VECTOR COUNT
SETUP DS SEGMENT REGI STER

OS

TEST2 5-67

IBM Personal Comput!tr MACRO Assembler
Version 2.00
TEST2 ---- 06/10/85
POST TESTS AND INITIALIZATION ROUTINES

I-II
06-10-85

MOV
1093 054A BE 0000 E
1094 0540 BF 01 CO R
MOV
1095 0550 AS
F7AI:
MOVSW
; SK I P OVER SEGMENT
1096 0551 47
INC
01
1097 0552 47
01
INC
1098 0553 E2 FB
LOOP
F7At
1099
SET UP OTHER I NTERRUPTS AS NECESSARY
1100
1101
1102
OS:ABSO
ASSUME
1 103 0555 2B CO
AX,AX
; 05=0
SUB
1 104 0557 8E 08
MOV
OS.AX
1105 0559 C7 06 0008 R 0000 E
MOV
WORD PTR @NMI PTR. OFFSET NM I I NT ; NMI INTERRUPT
MOV
110,6 055F C7 06 0014 R 0000 E
8AS IC
1 107 0565 C7 06 0062 R F600
MOV
1108
ZERO RESJ::RVED VECTORS
1109
;
1110
MOV
I I I 1 056B BF 0180
DI.60H'"4
FILL INTERRUPT 60 THRU 67 WITH ZERO
1 1 12 056E B9 00 I 0
CX.16
CLEAR 16 WORDS
MOV
MOV
11130571 C7 05 0000
FTAZ:
WORD PTR 05:[01],0
1 I 14 0575 83 C7 02
01,2
POINT TO NEXT LOCATION
AOO
1115 0578E2 F7
LOOP
F7A2
1116
1117
SETUP TIMER 0 TO BLINK LED IF MANUFACTURING TEST MODE
I I 18
ASSUME
OS:DATA
1 I 19
; ESTABLISH DATA SEGMENT
1120 057A E8 0000 E
CALL
005
1121
; MFG. TEST MODE?
11220570 F6 06 0012 R 20
TEST
PMFG TST, MFG LOOP
F9
I 123 0582 75 08
JNZ
1124 0584 26: C7 06 0020 R 0000 E
MOV
WORD PTR ES: IP I NT PTR, OFFSET BL I NK I NT ; SETUP T I MER TO BL I NK LED
1125 058B BO FE
MOV
AL,OFEH
; ENABLE T I MER INTERRUPT
1126 0580 E6 21
OUT
INTAOI,AL
1127 058F FB
F9:
; ALLOW INTERRUPTS
STI
1128
; ----1129
ISSUE A RESET TO THE HARD FILE I F SOFT RESET
1130
1131059081 3E 0072 R 1234
CMP
PRESET_FLAG, 1234H
SOFT RESET?
1132 0596 75 OE
F9A
CaNT INUE IF NOT
JNZ
MOV
1133 0598 89 OOFF
CX,OFFH
1 134 0598 BA 03F6
MOV
DX,03F6H
1135 059E 80 04
MOV
AL,04H
RESET
1136 05AO EE
DX,AL
OUT
1137 OSA1 E2 FE
F9_A:
LOOP
F9 A
HOLD RESET
I 138 05A3 2A CO
SUB
AL7AL
1139 05A5 EE
REMOVE RESET
OUT
aX,AL
1140
; ----- - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - -1141
1142
TEST .23
1143
;
DISKETTE ATTACHMENT TEST
1144
DESCR I PT I ON
1145
CHECK IF IPL DISKETTE DRIVE IS ATTACHED TO SYSTEM.
IF
1146
ATTACHED, VERIFY STATUS OF NEC FoC AFTER A RESET. ISSUE
1147
A RECALIBRATE AND SEEK COMMAND TO FDC AND CHECK STATUS.
1148
COMPLETE SYSTEM INITIALIZATION THEN PASS CONTROL TO THE
1149
BOOT LOADER PROGRAM.
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - -- - - -- - - - - - - - - - - - - - - - - - - --1150
1151
1 152 05A6 BO 3C
F9A:
MOV
AL,3CH
<><><><> <> <> <> <> <> <> <><>
<><> CHECKPOINT
1153 05A8 E6 80
3C <><>
OUT
MFG _PORT, AL
1154
1155 05AA BO 02
MOV
AL,02H
SET DATA RATE TO 250 K BITS PER SECOND
1156 05AC SA 03F7
MOV
OX ,3F7H
'157 05AF EE
OUT
DX,AL
1158 05BO F6 06 0010 R 01
TEST
BYTE PTR @EQUIP FLAG, 1H
DISKETTE PRESENT?
FI5
11590585 74 55
JZ
1160 05B7 F6 06 0012 R 20
@MFG TST ,MFG LOOP
TEST
MFG JUMPER INSTALLED?
Ft5 1161 058C 74 4E
JZ
GO IF YES
1 162 058E
FlO:
DISK_TEST:
1163 058E E4 21
IN
AL, INTAO 1
1164 05CO EB 00
JMP
1/0 DELAY
1 165 05C2 24 8F
ENA8LE 0 I SKETTE INTERRUPTS
ANa
AL ,OBFH
1 166 05C4 E6 21
OUT
INTAO t ,AL
1167 05C6 B4 00
MOV
AH,O
RESET NEC FDC
MOV
1168 05C8 8A 04
SET FOR OR I VE 0
OL,AH
1169 05CA CD 13
INT
13H
VERIFY STATUS AFTER RESET
1170 05CC F6 C4 FF
TEST
AH,OFFH
STATUS OK?
1171 05CF 75 25
NO - FDC FAILED
JNZ
Fl3
1172
; - ---TURN DR I VE 0 MOTOR ON
1173
1174
1175 0501 BA 03F2
MOV
DX,03F2H
GET ADDRESS OF FDC CARD
TURN MOTOR ON, ENABLE DMA, INTERRUPTS
11760504BO IC
MOV
AL,ICH
11770506 EE
OX,AL
WR I TE FOC CONTROL REG I STER
OUT
11780507 2B C9
WA I TF COUNT FOR 0.988 SECONDS
SUB
CX,CX
1179 0509 E8 0000 E
CALL
WAITF
WA I T I SECOND FOR MOTOR
1180
1181 050C 33 FF
SELECT OR I VE 0
XOR
01.01
1182 050E B5 01
MOV
SELECT TRACK I
CH, t
MOV
11 ~3 05EO C6 06 003E R 00
IPSEEK STATUS,O
I NSURE RECALl BRATE
1 184 05E5 80 OE OOAO R 01
OR
IPRTC WA IT FLAG, 0 I
NO REAL T I ME CLOCK, USE WA I T LOOP
SEEK1 185 05EA E8 0000 E
RECAL I BRATE 0 I SKETTE
CALL
1186 05EO 72 07
GO TO ERR SUBROUT I NE I F ERR
JC
Fl3
1187 05EF B5 22
MOV
CH,34
SELECT TRACK 34
1188 05FI E8 0000 E
CALL
SEEK
SEEK TO TRACK '34
1 189 05F4 73 08
OK, TURN MOTOR OFF
JNC
Fl.
1190 05F6
F13:
1191 05F6 80 OE 0016 R 40
PMFG ERR FLAG+ I ,OSK FAIL; DSK_ER~!<><><> <> <> <><> <><> <> <><>
OR
;
<><> OISKETTE FAILED
<><>
1192
1193 05FB BE 0000 E
MOV
5 I ,OFFSET E601
GET ADDRESS OF MESSAGE
1 194 05FE E8 0000 E
CALL
E_MSG
; GO PRINT ERROR MESSAGE
1195
1196
TURN DR I VE 0 MOTOR OFF
1197
F14:
DRO OFF:
1198 0601
1 199 0601 80 26 OOAO R FE
ALLOW FOR RTC WA I T
ANa
OPRTC WA I T FLAG, OFEH
AL,OCH
TURN DR I VE 0 MOTOR OFF
1200 0606 BO OC
MOV
120 I 0,608 BA 03F2
MOV
OX ,03F2H
F'DC CONTROLLER ADDRESS
1202 060B EE
OUT
DX;AL
1203
;----- SETUP KEYBOARD PARAMETERS
1204
1205
F15:
MOV
SET STRAY INTERRUPT FLAG
00
1206 060C C6 06 006B R 00

:g~g ~i~ :~~~~C:~~R~~~~~~o~~TNT _S~R~~~MENi ~~~N6A~~~~~~

-----

--

------- - - --

-

-

-- ---- -

-

"2

-

=

5-68

TEST2

IBM Personal Computer MACRO Assembler
Version 2.00
TEST2 ---- 06/10/85
POST TESTS AND INITIALIZATION ROUTINES

1207 0611 8E ODIE R
1208 0614 89 36 001A
12090618 89 36 ODIC
1210 061C 89 36 0080
1211 062083 C6 20
1212062389 36 0082
1213
1214
1215
1216 0627 8F 0078 R
1217 062A IE
1218 0628 07
1219 062C 88 1414
1220 062F A8
1221 0630 A8
1222
1223
1224
12250631 88 0101
1226 0634 A8
1227 0635 A8
1228
1229
1230
1231 0636 E4 21
1232 0638 24 FE
1233 063A EB 00
1234 063C E6 21
1235
1236
1237
1238 063E F6 06 0012
1239 0643 75 03
1240 0645 E9 072E R
1241 0648
1242 0648 80 8E
1243 064A E8 0000 E
1244
1245 0640 8E 0000 E
1246 0650 A8 80
1247 0652 75 07
1248
1249 0654 8E 0000 E
1250 0657 A8 60
1251 0659 14 09
1252 0658
1253 0658 E8 0000 E
1254 (}65E 81 CD 8000
1255 0662 E8 45
1256
1257
1258
1259 0664 83 04
1260 0666 28 C9
1261 066880 8A
1262 066A E8 0000 E
1263 0660 A8 80
1264 066F 15 18
12650671 E2 F5
1266 0673 FE C8
1261 0675 15 EF
1268 0671 8E 0000 E
1269 067A E8 0000 E
1210
1271
1212
1213 0670 88 OE8E
1214 0680 E8 0000 E
1215 0683 DC 04
1276 0685 86 C4
1217 0687 E8 0000 E
1218 068A E8 DE
1279
1280
1281
1282 068C 89 0320
1283 068F 80 8A
1284 0691 E8 0000 E
1285 0694 A8 80
1286 0696 EO F7
1281 0698 E3 DO
1288
1289
1290
1291 069A
1292 069A 80 8E
1293 069C E8 0000 E
1294 069F A8 10
1295 06Al 1406
1296
1291
1298
1299 06A3 8E 0000
1300 06A6 E8 0000
130 I
1302
1303
1304 06A9 80 3E 0015
1305 06AE 8E 0000 E
1306 0681 74 OA
1301
13080683 80 3E 0015
1309 0688 75 06
1310 068A 8E 0000 E
1311 0680
1312 0680 E8 0000 E
1313
1314
1315
1316 06CO
1311 06CO 8A 03F 1
1318 06C3 EC
1319 06C4 24 F8
1320 06C6 3C 50

R
R
R

MOV
MOV
"OV
"OV

R

"OV

ADO

1-12
06-10-85

S I ,OFFSET @K8 8UFFER
.8UFFER HEAD,SI
(l8UFFER-TAIL,SI
(l8UFFER-ST ART,S I
SI,32
OBUFFER_END, S I

SETUP KEY80ARD PARAMETERS

DEFAULT 8UFFER OF 32 BYTES

SET PRINTER TIMEOUT DEFAULT
MOV
PUSH
POP
MOV
STOSW
STOSW

01 ,OFFSET ('PRINT TIM OUT;
OS
ES
AX, 1414H

SET DEFAULT PRINTER TIMEOUT

DEFAUL T=20

SET RS232 DEFAULT
MOV
STOSW
STOSW

AX,0101H

ENA8LE TI MER

IN

INTERRUPTS

AL,INTAOI
AL,OFEH

J"P

,.,

OUT

INTA01,AL

AND

RS232 OEFAULT=OI

ENABLE T I MER
I/O DELAY

INTERRUPTS

CHECK CMOS BATTERY AND CHECKSUM
R 20

J"P

@MFG TST ,MFG LOOP
81 DR
F15C

MFG JUMPER?
GO IF NOT
8YPASS IF YES

"OV
CALL

AL, CMOS 0 I AG+NM I
CMOS_READ

ADDRESS 0 I AGNOSTI C STATUS 8YTE
READ I T FROM CMOS

"OV
TEST
JNZ

SI,OFFSET EI61
AL,8AD BAT
81_ER -

LOAD 8AD 8ATTERY MESSAGE
BATTERY 8AD?
01 SPLA Y ERROR IF 8AD

"OV
TEST
JZ

S I ,OFFSET E I 62
AL,8AD CKSUM+BAD CONF I G
C_OK
-

LOAD CHECKSUM 8AO MESSAGE 162
CHECK FOR CHECKSUM OR NO 0 I SKETTE
SK I P AND CDNT I NUE TEST I NG CMOS CLOCK

CALL
OR

E MSG
8P,08000H
SHORT H_OK1A

ELSE DISPLAY ERROR MESSAGE
FLAG "SET SYSTEM OPTIONS· DISPLAYED
SKIP CLOCK TESTING IF ERROR

TEST
JNZ

J"P

161

TEST CLOCK UPDATING
C OK:
D-OK:
E:=OK:

F _OK:

MOV
SU8
MOV
CALL
TEST
JNZ
LOOP
DEC
JNZ
MOV
CALL

8L,04H
CX,CX
AL,CMOS REG A+NMI
CMOS READ
AL,80H
G OK

E-OK

Be
o

OK

SI ,OFFSET E 1 63
E_MSG

SET CMOS DIAGNOSTIC STATUS TO 04

"OV
CALL
OR
XCHG
CALL

J"P

AX,X·CMOS DIAG+NMI
CMOS REAOAL. CMOS CLK FA I L
AL,AH
CMOS WR I TE
SHORT H_OK

OUTER LOOP COUNT
I NNER LOOP COUNT
GET THE CLOCK UPDATE 8YTE
CHECK FOR UPDATE
GO I F YES
TRY AGAIN
DEC OUTER LOOP
TRY AGAIN
PRINT MESSAGE

IN PROGRESS

(CLOCK ERROR)
SET CLOCK ERROR
GET THE CURRENT STATUS
SET NEW STATUS
GET STATUS ADDRESS AND SAVE NEW STATUS
MOVE NEW 01 AGNOST I C STATUS TO CMOS
CONT INUE

CHECK CLOCK UPDATE

"OV
"OV
CALL
TEST
LOOPNZ
JCXZ

CX,800
AL,CMOS REG A+NMI
CMOS READ
AL,80H
I OK
F::::OK

LOOP COUNT
CHECK FOR OPPOSITE STATE

TRY AGAIN
PRINT ERROR

IF TIMEOUT

CHECK MEMORY SIZE DETERM I NED = CONF I GURA T I ON

"OV
CALL
TEST
JZ

AL, CMOS 0 I AG+NM I
CMOS READ
AL,W-MEM SIZE
H_OKTA
-

GET THE STATUS BYTE
WAS THE CONFIG= MEM SIZE DETERMINED?
GO I F YES
--

MEMORY SIZE ERROR

MOV
CALL

S I ,OFFSET E 164
E_MSG

PRINT SIZE ERROR
01 SPLAY ERROR

CHECK FOR CRT ADAPTER ERROR

R DC

H_OK1A:

@MFG ERR FLAG, OCH
S I ,OFFSET E401
H_OKI8

CHECK FOR MONOCHROME CRT ERROR
LOAD MONOCHROME CRT ERROR
GO IF YES

JNZ
"OV

@MFG ERR FLAG. ODH
J OKSI ,OFFSET E501

CHECK FOR COLOR CRT ADAPTER ERROR
CONT I NUE I F NOT
CRT ADAPTER ERROR MESSAGE

CALL

E_MSG

eMP

"DV
JZ
R 00

e"p

CHECK FOR MULTIPLE DATA RATE CAPA81L1TY

"OV
IN
AND

C"P

DX,03FIH
AL,OX
AL,!1111000B
AL,010100008

O/S/P DIAGNOSTIC REGISTER
READ O/S/P TYPE CODE
KEEP ONLY UN I QUE CODE FOR 0/ S /P
D/S/P CARD - MULTIPLE DATA RATE?

TEST2

5-69

IBM Personal Computer MACRO Assembler
Version 2.00
TEST2 ---- 06110/85
POST TESTS AND INITIALIZATION ROUTINES
!32!
1322
1323
! 324
1325
1326
1327
1328
! 329
t 330
1331
1332
1333
t 334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345

1-13
06-10-85

06C8 74 46

JZ

.J_OK3

IF SO JUMP

06CA
06CD
06CE
0600
0602

BA
EC
24
3C
74

MOV
IN
AND
eMP
JZ

OX,05F7H
AL,OX
AL,II t 10000B
AL,IOIOOOOOB
J_FAIL

F I XED 0 I SK 0 I AGNOSTI C REG I STER
READ F I XED DISK TYPE CODE
KEEP ONLY UNIQUE CODE FOR FlO
F I XED 0 I SK ADAPTER ?
MUST BE COMBO ELSE ERROR

0604
0606
0008
060B
060B
06DC
060E
06EO
06E2
ObE4
ObEb
ObE8
06EA
06EC
ObEC
ObEF
06FI
06F2
ObF4
06F5
06Fl
06F9
06F8
ObFC
06FE
06FF
0101

83 OF
28 C9
BA OIFl

MOV
SUB
MDV

BL,OFH
eX,ex
OX,OlF7H

HARD FILE STATUS PORT

IN
TEST
JZ
LOOP
DEC
JNZ
AND
JZ
JMP

AL,OX
AL,080H
J OK2
J-OKI
Be
J OKI
AC,OCH
J OK3
SHORT J_FAIL

GET THE STATUS
I S THE CONTROLLER BUSY?
CONTINUE IF NOT
TRY AGAIN
DECREMENT OUTER LOOP
TRY AGA I N I F NOT ZERO
BITS 2 & 3 " 0 IF MULTI DATA CAPABLE
GO IF YES
NO MULTIPLE DATA RATE CAPABILITY

MOV
MOV
OUT
JMP
IN
eMp
JNZ
MOV
OUT
JMP
IN
eMP
JZ

OX,IF4H
AL,055H
DX,AL

VERIFY MULTIPLE DATA RATE CAPABLE
WR I TE TO THE CYL I NDER BYTE

OE 0016 R 40

OR

ttMFG ERR FLAG+I,DSK FAIL;

0000 E
0000 E
IE

MOV
CALL
JMP

SI,OFFSETE601
E MSG
SHORT FISC

OR

OlILASTRATE,OUAL

FO
AD
2F

OUTER LOOP COUNT WA IT FOR BUSY OFF

J_OKI :
EC
A8
74
E2
FE
75
24
74
EB

80
OC
F9
CB
F5
OC
26
17
J_OK2 :

BA
BO
EE
EB
EC
3C
15
BO
EE
EB
EC
3C
74

134b
1341
! 348
1349
1350
1351
(352
1353
1354
1355
1350
1351 0103
1358 0103 80
1359
1360 0108 BE
1361 070B E8
1362 010E EB
1363
13640710
13650710 80
1366
1361
1368
13690715 BO
13100111 E6
1371 0119 E8
1312
1313
1314
1375 011C E6
1316 071F 8A
1317 0723 OA
1318 0125 74
1319012180
1380 072C B4
1381 012E
1382 072E BO
1383 0130 E8
1384 0133 A8
1385 0735 75
1386
1367 0131 BO
138e 0139 E8
1389 013C 24
1390 073E 3A
1391 0740 74
f 392
1393 0742 22
1394 0744 75
1395
1396 0746 E8
1391
1398
1399 0749
1400 0749 BO
1401 074B E6
1402
1403 0140 BO
1404 014F E8
1405 0152 3C
1406 0154 14
1401
1408 0156 Ee
1409
1410
1411
1412
1413
1414
1415
1416
1411 0159
1418 0159 FB
1419 015A BO
1420 015C E6
1421 015E E8
1422 0761 BO
1423 0163 E6
1424 0166
1425
1426
1427
1428 0166 2A
1429 0168 E6
1430 016A EB
1431 016C E6
1432 016E BA
1433 0711
1434 0711 8E

5-70

05Fl

0lF4
55
00
55
OA
AA
00
AA
00

'.2

I/O DELAY
CHECK DATA WRITTEN" DATA READ

AL,DX
AL,055H
..I FAIL
AL,OAAH
DX,AL

GO IF NOT
WR I TE ANOTHER PATTERN

"2

I/O DELAY

AL,DX
AL,OAAH
.J_DK3

I S DATA PATTERN THE SAME?
GO IF SO

J_FAIL:

-

-

-;
;
;
;

<><><><> <> <> <><><> <> <><> <>
<><> 01 SKETTE FAILED
GET ADDRESS OF MESSAGE
GO PR I NT ERROR MESSAGE
SK I P SETUP I F ERROR

J_OK3:
OE 0088 R 01
;-----

TURN ON DSPICOMBO FLAG

INITIALIZE FLOPPY FOR DRIVE TYPE

3D
80
0000 E

MOV
OUT
CALL

0000 E
26 0091 R
E4
07
DE 0010 R 40
FF

CALL
MOV
OR
JZ
OR
MOV

OOS
AH,(tDSK STATE+l
AH,AH
-

8E
0000 E
CO
22

MOV
CALL
TEST
JNZ

AL,CMOS DIAG+NMI
CMOS READ
AL,BAO BAT+BAD CKSUM
ROM_SCAN I

BATTERY I CHECKSUM OK
BYPASS DISK SETUP I F NOT

90
0000 E
OF
C4
07

MOV
CALL
ANa
eMp
JE

AL,CMOS DISKETTE+NMI
CMOS READ
AL,OOFH
AL,AH
FISC

ADDRESS DISKETTE TYPE BYTE
GET 0 I SKETTE TYPES
LOOK AT SECOND DR I VE TYPE DEF I NED
ARE BOTH I NO I CATORS ZERO
SKIP IF NO SECOND DRIVE

C4
03

ANa
JNZ

AL,AH
FI50

ARE BOTH INDICATORS NON-ZERO
SKIP IF DRIVE FOUND AND DEFINED

0000 E

CALL

CONFIG_BAD

SET BAD_CONFIG

AL,3DH
MFG PORT ,AL
DSKETTE_SETUP

<><><> <> <><><><><><><> <>
<><> CHECK PO I NT
3D <><>
INITIALIZE FLOPPY

CHECK FOR 2ND 0 I SKETTE DR I VE
INSURE DATA SEGMENT
GET STATE OF SECONO DRIVE
IS THERE A DRIVE 2 ATTACHED?
SKIP IF NOT
PTR 4lEQUIP FLAG,40H; ELSE SET SECOND DRIVE INSTALLED
AH,OFFH
; SET TEST MASK FOR DR I VE PRESENT

~~~~

FISC:
GET THE CMOS DIAGNOSTIC STATUS

IN CMOS_DIAG

INiTiALIZE HARD FILE
3E
eo

MOV
OUT

AL,3EH
MFG_PDRT ,AL

92

MOV
CALL
eMP
JZ

AL,CMOS DISK+NMI
CMOS READ
AL,oR
ROM_SCANI

I NSURE TYPE IS DEF I NED
BYPASS DISK SETUP I F NOT

CALL

DISK_SETUP

INITIALIZE HARD FILE(SI

0000 E
00
03
0000 E
;
;

- ~~~~ ~ ~ - - - -- - ---- - - ---- - - - --- -- - - - - - - - - - - - -- - - - - - - ----- --

-

OA

TEST2

STI
M~

OUT
CALL
MOV
CALL
ROM_SCAN:
; -----

CO
02
00
04
C800

I NSURE CMOS DEF I NES TYPE OF F I XED 0 I SK

TEST. 22
CHECK FOR OPTIONAL ROM FROM C800->EOOO IN 2K BLOCKS
:
(A VALID MODULE HAS 'S5AA' IN THE FIRST 2 LOCATIONS:
LENGTH INDICATOR (LENGTH/512} IN THE 3RD LOCATiON
:
AND TESTIINIT. CODE STARTING IN THE 4TH LOCATiON)

~~~

3B
eo
0000 E
OA
0000 E

<><><><><><><><><><> <><>
<><> CHECKPO I NT
3E <><>

ALLOW
~,~H

MFG PORT ,AL
DDSAL,10
PRT _HEX

INTERRUPTS
000000000000

<><> CHECKPOINT
38 <><>
SET REAL MODE DATA SEGMENT
LINE FEED ON DISPLAY

SET DMA MASK AND REQUEST REG I STERS

SUB
OUT
JOP
OUT
MOV
ROM SCAN2:
MOV

AL,AL
DMAI8+2,AL

SENO ZERO TO MASK REG I STER

DMAI8+4,AL
oX,oceOOH

SEND ZERO TO REQUEST REG I STER
SET BEG I NN I NG ADDRESS

'.2

DS,DX

IBM Personal Computer MACRO Assembler
Version 2.00
TEST2 ---- 06/10/85
POST TESTS AND INITIALIZATiON ROUTINES
1435 0113 51
1436 0114 BF ,01,,01,55
1431 0111 2B DB
1438 0119 88 01
1439 0118 3B C1
1440 0110 SF
1441 011E 15 05
1442 0180 E8 0000 E
1443 0183 EB 04
1444 0185
1445 0185 81 C2 0080
1446 0189
1441 0189 81 FA EOOO
1448 0180 1C E2
1449
1450
1451
1452 018F E8 0000 E
1453 0192 E4 64
1454019424 10
1455 0196 14 02
1456 0198 EB OB
1451 019,01,
1458019,01, 80 OE 0016
1459
1460
1461 019F SE 0000 E
1462 01A2 E8 0000 E
1463 01,01,5
1464
1465
1466
1461
1468 01A5 BF 0905 R
1469 01,01,8 8E 0000
1410 01AB
1411 01,01,8 2E: 88 15
1412 01AE 80 ,01,,01,
1413 0180 EE
1414 0181 EB 00
1415 01B3 IE
1416 0184 EC
1471 0785 IF
1418 0786 3C ,01,,01,
1479 07B8 75 06
1480 07BA 89 94 0008
1481 078E 46
1482 07BF 46
1483 07CO
1484 07CO 47
1485 07CI 47
1486 07C2 81 FF 090B
1481 07C6 75 E3
1488
1489
1490
1491 07C8 8B 0000
1492 07C8 BA 03FA
1493 07CE EC
1494 07CF ,01,8 F8
1495 0701 75 08
1496 0703 C7 81 0000
1491 0709 43
1498 070A 43
1499 0708 BA 02FA
1500 070E EC
1501 07DF A8 F8
1502 07El 75 08
1503 07E3 C7 81 0000
1504 07E9 43
1505 07EA 43
1506
1501
1508
1509 07EB
1510 07ES 8B C6
1511 07ED Bl 03
1512 07EF 02 C8
1513 07Fl OA C3
1514 01F3 ,01,2 0011 R
1515
1516
1511
1518 07F6 E8 0000 E
1519
1520
1521
1522 07F9 80 40
1523 07F8 E6 80
t 524
1525 07Fo SF 0067 R
1526 0800 33 CO
1521 0802 89 05
1528 0804 D8 E3
1529 0806 EB 00
1530 0808 09 3D
1531 080A 60
1532 080B 61
1533 080C 81 25 IF3F
1534 0810 81 3D 033F
1535 0814 75 13
1536
1537 0816 98 DO 3D
1538 0819 60
1539 081,01, 61
1540 0818 F1 05 888F
1541 081F 75 08
1542
1543 0821 E4 A I
1544 0823 24 OF
1545 0625 84 02
15460821 E6 AI
1547 0829
15480829,01,0 0010 R

PUSH
MOV
SUB
MOV
CMP
POP
"NZ
CALL
"MP
NEXT ROM:
ADD
ARE WE DONE:
- CMP

"L
;-----

1-14
06-10-85

NEXT ROM
ROM CHECK
SHORT ARE_WE_DONE

SAVE WORK REGISTER
GET TEST PATTERN
SET BX=OOOO
GET 1 ST WORD FROM MODULE
= TO 10 WORD?
RECOVER WORK REG I STER
PROCEED TO NEXT ROM I F NOT
CO CHECK OUT MODULE
CHECK FOR END OF ROM SPACE

DX,ooaOH

PO I NT TO NEXT 2K ADDRESS

DX,OEOOOH
ROM_SCAN2

AT EOOOO YET?
GO CHECK ANOTHER ADD.

01
DI,OAA55H
8X,BX
AX, (BX)
AX,DI

01

I F NOT

TEST FOR KEYBOARD LOCKED
CALL
IN
AND
JZ
JMP

005
AL,STATUS PORT
AL,KYBD INH
KEYI
SHORT KEY 1 0

OR

'L'MFG_ERR_FLAG+ I ,KEY_FA I L;

ASSUME
MOV
CALL

DS:DATA
S I ,OFFSET E302
E_MSG

SET OAT A SEGMENT
IS KEY80ARO UNLOCKED?
NO - SET ERROR FLAGS AND PR I NT MESSAGE
GO IF OFF

KEYI:
R 80

<><><><> <> <> <> <><> <><><><> <>
<><> KEYBOARD I S LOCKED <><>
PRINT LOCKED MESSAGE

(302)

KEY10:
; ====================
MOV
"OV

oI

,OFFSET F4
51,0

OFFSET OF PRINTER ADDRESS TABLE

MOV
MOV
OUT
"MP
PUSH
IN
POP
CMP
"NE
MOV
INC
INC

DX,CS:[DI)
AL,OAAH
DX,AL

eET PRINTER 8ASE ADDRESS
WRITE DATA TO PORT A

$.2

I/O DELAY
BUS SETTL I NG
READ PORT A

INC
INC
CMP
"NE

01
01
01 ,OFFSET F4E
FI6

F16:

R

OS
AL,DX
OS
AL,OAAH
FI1
~~R INTER_BASE [s I ] ,OX

DATA PATTERN SAME
NO - CHECK NEXT PR INTER CARD
YES - STORE PRINTER 8ASE ADDRESS
I NCREMENT TO NEXT WORD

5I

F17:
R

POINT TO NEXT BASE ADDRESS
ALL POSSIBLE ADDRESSES CHECKED?
PRT_BASE

~~~~~=~~~~~===
~~~=====~~:~==

R 03F8
F18:

R 02F8

;

-----

F19:

MOV
IN
TEST
JNZ
~~~

DX,3FAH
AL,DX
AL,OF8H
FI8
:~S232_BASE (BX), 3F8H

INC
MOV
IN
TEST
JNZ
MOV
INC
INC

8X
DX,2FAH
AL,DX
AL,OF8H
FI9
(IIRS232 BASE(BX},2F8H
8X
8X

POINTER TO RS232 TABLE
CHECK IF RS232 CARD 1 ATTACHED?
READ I NTERRUPT 10 REG I STER
SETUP RS232 CARD # 1 ADDRESS
CHECK IF RS232 CARD 2 ATTACHED
READ I NTERRUPT 10 REG I STER
BASE END
SETUP RS232 CARD #2

~~~" ~~" ;~Q~ ~~ :~~~~: ~~ =~~~ ~ ~~~~ '" ~~~B~~ = ~~ = ~~ ~ ~;~~~ = ~~~ =~~~~~ =~~~~~
; = = = = = = = = = = == == = = = = = = = = = = = = == = == ~ = B~~~ = ~~~ ~ = = == == = == = == == = = == = =::=
MOV
MOV
ROR
OR
MOV

AX,SI
;
CL,3
;
AL,CL
;
AL,BL
;
BYTE PTR Il'IEQU I P _FLAG+ 1 ,AL

SI HAS 2- NUM8ER OF RS232
SHIFT COUNT
ROTATE RIGHT :3 POSITIONS
OR IN THE PRINTER COUNT
; STORE AS SECOND BYTE

INSURE CMOS CLOCK HAS VALID HOURS.MINUTES.SECONDS
CALL
;-----

;

SET_TOO

INSURE CMOS CLOCK

ENA8LE HARDWARE INTERRUPT IF MATH PROCESSOR
MOV
OUT

AL,40H
MFG_PORT, AL

MOV
XOR
MOV
FNINIT
"MP
FNSTCW
PUSHA
POP A
AND
CMP
"NE

01 ,OFFSET 'L'IO_ROM_INIT
AX,AX
WORD PTR [DII,AX

S'2

IS VALID

(80287)

<> <> <> <><><><><><> <><> <>
<><> CHECKPO I NT 40 <><>
ADDRESS WORK STORAGE LOCATION
CLEAR WORK REGISTER
(AH)= 0 (NO 287)
CLEAR THE WORK LOCATION
INITIALIZE THE 60281 WITH NO WAJ1
; DELAY
; WR I TE THE CURRENT 80281 CONTROL WORD
; TIME FOR 60287 TO RESPOND

WORD PTR

{DI}

WORD PTR
WORD PTR
NO_287

(01},0IF3FH
(01] ,0033FH

CLEAR UNUSED 80287 81TS
IS THE 80287 INSTALLED?
GO IF MATH PROCESSOR IS NOT INSTALLED

FSTSW
PUSHA
POPA
TEST
"NZ

WORD PTR

(DI)

STORE THE STATUS WORD (WITH WAIT)
TIME FOR 80281 TO RESPOND

WORD PTR
NO_26T

[DI},088SFH

ALL BITS SHOULD 8E OFF
GO IF NOT INSTALLED

IN
AND
MOV
OUT

AL,INTBOI
AL,ODFH
AH,002H
INTBOI,AL

GET THE SLAVE INTERRUPT MASK
ENABLE 80287 INTERRUPTS
SET WORK REG I STER FOR 80287 FOUND

MOV

AL,8YTE PTR IPEQU I P _FLAG

GET LOW EQU I PMENT FLAG

(OR ERROR)

NO_287:

TEST2

5-71

[8M PersQnal CQmputer MACRO Assembler
VersiQn 2.00
TEST2 ---- 06/10/85
FOST TESTS AND [NITIALIZATION ROUTINES
1549 082C 24
1550 082E 3A
1551 0830 T4
1552
1553083280
1554 0831 E8
1555 083A
1556
1551
1558 083A C1
1559
1560
1561
1562 0840 E4
1563 0842 24
1564 0844 E8
1565 0846 E6
1566 0848 C6
1561
1568
1569
1510 0840 C6
1571 085280
1512 0854 E8
1573 0851 89
1574 085A E8
1575 0850 80
1576
1577
1578
1579 0862 80
1580 0867 74
1581
1582086984
1583 0868 82
1584 0860 FE
1585 0871 CO
1586 0873 FE
1581 0877 12
1588
1589 0819 E8
1590 081C
1591
1592
1593
1594
1595 081C 08
1596 081E 74
1591
1598 0880 80
1599 0885 8A
1600 0888 15
1601
1602
1603
1604 088A C6
1605 088F E4
1606 0891 24
1607 0893 15
1608
1609 0895 8A
1610 0898
1611 0898 E8
1612 0898 80
16130890 E8
1614 08AO A8
1615 08A2 14
1616
1617 08A4 F1
1618 08A8 15
1619
1620 08AA 8E
1621 08AD E8
1622
1623
1624
1625 0880
1626 0880 E4
1621088224
1628 0884 15
1629
1630 0886 6E
1631 0889 E8
1632
1633
1634
1635 OBBC
1636 08Be 8E
1637 oaBF E8
1638
1639
1640
1641 OaC2 64
! 642 08C4 2B
1643 08C6 CO
1644 oaca
1645 OaC8 BO
1646 08CA E6
1641 08CC 84
1648 08CE CO
1649 0800 80
1650 0803 15
1651 0805
16520805 F6
1653 080A 75
1654 080e E9
r655 080F 80
1656 08E4 14
1657
1658 08E6 BA
1659 08E9 E8
1660
1661
1662

5-72

02
C4
08

JE

AL,002H
AL,AH
OK_281

STR I P OF~ OTHER 8 ITS
DOES CMOS MATCH HARDWARE ?
SK I P IF EQU I PMENT FLAG CORRECT

XOR
CALL

BYTE PTR @EQUIP FLAG, 2H
CONFIG_BAD
-

ELSE SET 80281 BIT TO CORRECT VALUE
AND SET THE CONF[GURATION ERROR FLAG

AND
CMP

36 0010 R 02
0000 E

1-15
06-10-85

OK 281:

;-=---

06 0011 R 0000

SET KEYBOARD STATE FLAGS
MDV

;----21
FC
00
21
06 0015 R 00

WORD PTR olIKB_FLAG,O

ENABLE KEYBOARD/TIMER
IN
AND

AL,INTAOI
AL, OFCH

ENABLE T I MER AND KEYBOARD
I/O DELAY

'.2

JMP

INTAOI,AL
II'MFG_ERR_FLAG,O

OUT
MDV

READ KEYBOARD
06 0096 R AD
F2
0000 E
061A
0000 E
26 0096 R IF

RESET ALL KEYBOARD STATUS FLAGS

INTERRUPTS

10 TO

I NTERRUFTS

CLEAR MFG ERROR FLAG

I NIT I AL I ZE KEYBOARD TYPE AND NUM LOCK

:~~K~L~~A~ ,~g_ID+SET_NUM;L~ET TH; S S~~S~~~~ ~~y~g~~~N~ /~~Q~~~T
SND DATA
; USE KEYBOARD TRANSM] SS I ON ROUT I NE
CX,To58
; SET DELAY COUNT TO 25 M]LLlSECONDS
WAITF
; WAIT FOR READ ]0 RESPONSE (20 MS)
PKB_FLAG_3,NOT RD_[D+LC_AB+SET_NUM_LK
I RESET READ 10 COMMAND

MOV
MDV

CALL
MOV

CALL
AND

CHECK FOR SECOND F I XED 0 I SK PRESENT BUT NOT DEF I NED
3E 0015 R 02
13

eMP

10
81
06 0015 R
13
DE 0015 R
03

MDV
MOV

JE

INC
INT
DEC
JC

0000 E

CALL
FI5G:

II'HF_NUM,2
FI5G

CHECK FOR TWO DR I VES DEF I NED 8Y CMOS
SKIP TEST IF TWO DRIVES DEFINED

AH,OIOH
DL,081H
(tHF _NUM
13H
II'HF NUM
FI5G

GET TEST DR I VE READY COMMAND
POINT TO SECOND FIXED DISK
TELL 810S ]T HAS TWO DRIVES
CHECK READY THROUGH B] OS
RESTORE CORRECT COUNT (RETAIN CY)
SK I F I F SECOND DR I VE NOT READY
SECOND OR I VE NOT DEF I NED
SET CONFIGURATION BAD

CONF IG_8AD

- -- - - - - - - - - - - - - - - - - - - - - - - -~

I

TEST FOR ANY ERRORS

EO
55

OR
JE

3E 0012 R 64
0002
DE

CMP
MOV
JNZ
MFG RUN

06 0015 R AA
64
10
40

MOV

0000 E

BEEPS FOR ERROR (S)
ADDRESS CMOS
GET THE D]AGNOSTIC STATUS BYTE
CHECK FOR BAD HARDWARE CONF I GURAT] ON
SKIP IF NOT SET

TEST
JNZ

BP,08000H
ERR_WKEY

ELSE CHECK FOR E161/E162 POSTED
SK I P IF 0] SPLA YEO BEFORE NOW

MDV

SI,OFFSET E162

CALL

P _MSG

ELSE DISPLAY nOPTIONS NOT SET"
WITH NON HALTING ROUT[NE

C5 8000
06

0000 E
0000 E

CHECK FOR

ERR WKEY:
IN
AND
JNZ

0000 E
0000 E

] N MODE -> SET ERROR FLAG
@MFG ERR FLAG,OAAH
AL,S1'ATU5 PORT
AL ,KYBD INH
FI5A_O -

CALL
TEST
JZ

0000 E
20
DC

64
10
06

HUNLOCK SYSTEM UNIT KEYLOCK H MESSAGE REQUIRED

AL,STATUS PORT
AL,KYBD INH
ERR_WA ]1'2

CHECK r F RESUME MESSAGE NEEDED
I S THE KEYBOARD LOCKED
SK I P LOCK MESSAGE I F NOT

S [ ,OFFSET F3D I
P _MSG

ERROR MESSAGE FOR KEYBOARD LOCKED

CALL
DISPLAY

'(RESUME

MDV

ERR WAIT2:
MOV
CALL

=

3F
80
00
16
FC 38
F3
06 0012 R 20
03
0000 E
3E 0012 R 64
06

MDV
SUB

INT
ERRWAIT1:
MaV
OUT
MOV

INT
CMP

JNE

FI5A:

000 I
0000 E

;

RESUME ERROR MESSAGE

(ALTERNATE DISPLAY DEVICE)

AH, f
OX,OX

F]RST PRINTER

I1H
AL,3FH
MFG PORT ,AL
AH,OO
16H
AH,3BH
ERR_WAIT I

<> <><><><> <> <> <><><><><>
<><> CHECKPOINT 3F <><>
WAIT FOR

'Fl' KEY

TEST
JNZ

~~~~_TST,MFG_LOOP

~~G[~U~~TIN MODE

JMP

START r
;
BYTE PTR @RESET FLAG,64H;
FI58
-

GO LOOP POST
MFG RUN IN?
BYPASS BEEP [F YES

CMP
JZ

1 SHORT BEEP

; -----

TEST2

"Fl"

S I ,OFFSET F3D
P _MSG

IN]TIALIZE PRINTER
01
02
11

MFG RUN IN MODE?
2 SHORT BEEP COUNT FOR ERROR (S)
GO I F NOT

OX,S

MDV

;-----

BYTE PTR @RESET FLAG,64H;
OX, 2
ERR_WA I T

ERR BEEP
AL,CMOS 01 AG
CMOS READ
AL,8AD CONF]G
ERR_WKEY

MDV

ERR WAIT:
CALL

OE

0000 E
0000 E

CHECK (BP) = NON-ZERO
(ERROR HAPPENED)
SK I P PAUSE I F NO ERROR

I NO I CATE ERROR
CHECK KEY LOCK STATUS
I S THE KEYBOARD LOCKED
CONT] NUE MFG MODE I F NOT LOCKED
ELSE
5 SHORT BEEPS FOR MFG SETUP ERROR

IN
AND
JNZ

0005

(SP NOT ZERO)

(NO ERRORS)

IBM Personal Computer MACRO Assembler
Version 2.00
TEST2 ---- 06/10/85
POST TESTS AND INITIALIZATION ROUTINES
1663
1664 08EC E8 0000 E
1665
1666
1667
1668 05EF 2A E4
1669 08F 1 AO 0049 R
1670 08F4 CO 10
167 \
1672
1673
1674 OeF6 B9 01F4
1675 08F9 BF OOAO
1676 08FC 2B CO
1 b77 OBFE 8E CO
16780900 26: 8905
1679 0903 83 C7 02
1680 0906 E2 F8
1 b81
1652
1683
1684 0908 88 ---- R
1685 0908 8E DO
168b 0900 BC 0400 R
I b87
1688
1689
1690 0910 E4 21
1691 091224 FB
1b92 0914 EB 00
16930916 E6 21
1694
1695
169b
1697 0918 80 3E 0072
1698 0910 75 02
1699 091F EB 5C
1700
1701
17020921
17030921 E4 Al
1704 0923 24 FD
1705 0925 EB 00
17060927 E6 Al
1707
1708
1709
1110
171 I
1712
1113
1714
17 I 5 0929 BO 41
I 7 16 092B E6 80
1717
17180920 BO 80
1719 092F E6 70
1120
1721
1722
1723 0931 C6 Ob 0072
1724 0936 B8 EOOO
1725 0939 8E co
1726 0938 2B FF
1727 0930 26: 8B 05
1728 0940 53
1729 0941 5B
1730 0942 3D AA55
1731 0945 9C
1132 0946 26: 89 05
1 733 0949 E4 61
1734 0948 OC OC
1735 0940 Eb 61
1736 094F 24 F3
1731 0951 E6 61
1738 0953 90
1739 0954 75 27
1740
1141
1742
1743 0956 1E
\ 744 0957 06
1745 0958 IF
1746 0959 28 08
1147 0958 E8 0000 E
1745 095E IF
1749 095F 75 IC
1750
1751
1752
1753 0961 80 00
1754 0963 E6 70
1755
1 Hi6 0965 E4 61
1757 0967 24 F3
1758 0969 E6 61
1759
1760 0968 C7 06 0067
1761 0971 8C 06 0069
1762
1763 0975 80 42
1764 0977 E6 80
1765
1766
1767
1768 0979 FF IE 0067
1769
\ 710
1711
1772
1773 0970 BO 00
1714 097F E6 70
1775 09BI E4 61
1776 0983 24 F3

F158:

CALL

;-----

CLEAR DISPLAY SCREEN
SUB
MOV

INT

1-16
06-10-85

SET _TOO

CLEAR FLAGS

AH,AH
AL, II!ICRT MODE
10H
-

CLEAR SCREEN

CLEAR DESCR[PTOR TABLES
F20:

F20_A:

MOV
"OV
SUB
MOV
MOV
ADO
LOOP

CLEAR 1K
POINT ES TO START OF DESCRIPTORS

CX,0500
OI,SYS JOT LaC
AX,AX ES,AX
ES:[DJ],AX
OJ ,2
F20_A

CLEAR
POINT TO NEXT LOCATION
CONTINUE TILL DONE

SET POST SYSTEM STACK
MOV
MOV
MOV

GET THE POST STACK SEGMENT

AX, ABSO
SS, AX
SP,OFFSET II!ITOS

ENSURE THAT MASTER LEVEL 2 ENABLED

IN
AND
JMP
OUT

AL,INTAOI
AL,OFBH

GET THE CURRENT MASK

$,2

I/O DELAY

[NTAOI,AL

TEST FOR MFG RUN- I N TEST
R b4

CMP
JNZ
JMP

BYTE PTR ,pRESET FLAG, 64H;
END-287
SHORT SHUT4

I S THE THE MFG RUN- [N TEST?
GO IF NOT
BOOT LOAD IF YES

,
UNMASK SLAVE HARDWARE INTERRUPT 9 (LEVEL 71)
END 287:
IN
AL,INTBOI
GET THE CURRENT MASK
AL,OFDH
AND
JMP
1+2
I/O DELAY
OUT
I NTBO 1 ,AL
SET NEW MASK
;
;
;
;
;

- - - - - - - - - - -- - - -- -- - - - - - - - - - - - - -- -- --- - - - - - -- -- - - -- - - - - - -- - -- - - - --TEST FOR SYSTEM CODE AT SEGMENT EOOO: 0
FIRST WORD
AA55H
LAST 8YTE
CHECKSUM
ENTRY POINT = FIRST BYTE + 3
I F TEST I S SUCCESSFUL A CALL FAR TO THE ENTRY

R 00

=
=

MOV
OUT

AL, CMOS REG D+NM I
CMOS_PORT ,AL

;

"OV
MOV
MOV
SUB
"OV
PUSH
POP

; CLEAR FLAG
; SEGMENT OF SYSTEM CODE

e"p

8YTE, PTR @RESET FLAG. 0
AX,OEooaH
ES.AX
bJ,OJ
AX,ES: [OJ]
BX
BX
AX,OAA55H

IN

ES:[DI),AX
AL,PORT B

OR
OUT
AND
OUT
POPF
JNZ

OFF AND CMOS AT bEFAULT

; CHECK FOR AA55
BUS SETTLE
SAVE FLAGS
CLEAR POSS I BLE PAR I TY CHECK

~~R~A~:~~R _OFF

TOGGLE

I/O-PAR I TY CHECK ENABLES

AL.RAM PAR ON
PORT_B:AL RESTORE FLAGS
CONTINUE

SHUT4

OS

ES

;

SET SEGMENT TO TEST

BX,BX
ROM CHECKSUM
OS SHUT4

;

STARTING OFFSET

as

ENABLE NMI

AND

; RESTORE DATA SEGMENT
; GO I F CHECKSUM NOT OK

I/O-MEMORY PARITY CHECKS

"OV
OUT

~~O~:~~R~~~LD

ENABLE NMI

IN

AL,PORT B
AL, RAM PAR ON
PORT_8:AL -

ENABLE PAR I TY
ENABLE MEMORY PARITY CHECK

"OV
"OV

: : g:~g~:~~~~E~003H

SET THE OFFSET
SET THE SEGMENT

"OV
OUT

AL,42H
MFG_PORT, AL

AND
OUT

R 0003
R

INSURE NMI

CHECKSUM SYSTEM CODE
PUSH
PUSH
POP
SUB
CALL
POP
JNZ

;-----

<><><><><><><> <> <> <> <> <>
<><> CHECKPOINT 41 <><>

AL,41H
MFG:,...PORT • AL

PUSHF
"OV

; ---

po JNT [S EXECUTED

"OV
OUT

AND SET DEFAULT ADDRESS

/

I/O CHECK

<><><><><> <> <><><> <><> <>
<><> CHECKPO I NT 42 <><>

EX I T TO SYSTEM CODE
R

CALL

GO TO SYSTEM CODE
VIA ,CALL THROUGH DATA AREA LOCATION

; -----

ENABLE NMI

SHUT4:

MOV
OUT

IN
AND

INTERRUPTS + ENTRY FROM SHUTDOWN WITH BOOT REQUEST

AL, CMOS REG 0
CMOS PORT, AL
AL,PORT B
AL,RAM_PAR_ON

ENABLE NMJ

AND SET DEFAULT ADDRESS

ENA8LE PAR I TY
ENABLE MEMORY PARITY CHECK

TEST2

I

I/O CHECK

5-73

I BM Persona I Computer MACRO Assemb I er
Vers i on 2.00
TEST2 ---- 06/10/85
POST TESTS AND INITIALIZATION ROUTINES
1777
1778
1779
1780
1781
1782
1783
1184
1785
1786
1181
1788
1789
1190
1191
1192
1193
1194
1795
1796
1797
1198
1199
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
15 I 8
1519
1820
1821
1822
1823
1824
1825
1826
1827
1525
1529
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851

0985 E6 61

OUT

PORT_B,AL

0987 BO 43
0989 E6 80
098B FB

"OY
OUT
5TI

AL,43H
MFG_PORT ,AL

INT

19H

098C CD

19

PADING
B9 OOOF
PADI:
BO
E8
E2
90
E8
C3

<><><> <> <> <> <> <> <> <> <> <>
<><> CHECKPOINT
43 <><>
ENABLE I NTERRUPTS IF 0 I SABLEO
GO TO BOOT LOADER

HL T

098E F4
098F
098F
0992
0992
0994
0991
0999
099B
099E
099F

1-17
06-10-85

20
0000 E
F9
20
0000 E

099F
099F 50
09AO BB OOOA

PRT OK

-

PROC

NEAR
CX,I5

INSERT PADD I NG
GET BLANK CHARACTER COUNT

"OV
CALL
LOOP
"OV
CALL
RET
ENDF

AL,
PRT HEX
PADT
AL, ,- ,
PRT _HEX

GET FILL SPACE
WR I TE A SPACE
LOOP TILL I NSERT DONE
GET DASH CHARACTER
WRITE TO DISPLAY

PROC
PUSH

NEAR

"OV

BX, 10

PRINT "00000 K8 OK"
SAVE WORK REG I STER
SET DEC I MAL CONVERT

"OY

AX

CONVERT AND SAVE
09A3
09A6
09A8
09A8
09AA
09AC
09AF
0980

89 0005
28 FF
33
F1
80
52
E2

02
F3
CA 30

"OV
SUB
PRT DIV:
XOR

OIV
OR
PUSH
LOOP

F6

eX,5
01,01

a I SFLA Y

OX,DX
BX
OL ,30H
OX
PRT_DIV

OF 5 NIBBLES XX,XXX KB
REGEN BUFFER POS I T 1ON

DIViDE BY 10
MAKE INTO ASCII
SAVE

01 SFLA Y LAST OK MEMORY
0982 89 0005
09B5
0985 58
09B6 E8 0000 E
098947
098A E2 F9
098C 89 0007
098F BE 09CE R
09C2
09C2 2E: 8A 04
09C5 46
09C6 E5 0000 E
09C9 47
09CA E2 F6
09CC 58
09CD C3
09CE 20 4B 42 20 4F 48
0904 20
0905

=

0905

"OV
FRT DEC:
FOP
CALL

INC
LOOF

"OV
"OV
PRT LOOP:
MOV

INC
CALL

F38
F38 OK
F3B-PAD
.LIST
PRT_OK

;
;

RECOVER A NUMBER

MESSAGE

AL,CS:[Slj
51
PROT PRT HEX

INC

OJ

PRT LOOP

-

-

I NCREMENT BUFF PTR

POP
RET

AX -

RECOVER WORK REGISTERS

DB
DB
EQU

,

OK MESSAGE
PAD A SFACE

KB OK'

ENDP

--- -------------------PRINTER TABLE

F4

ow
ow
ow

F4E

LABEL

0908
090B

POST2
CODE

ENDP
ENDS

ENO

TEST2

I

01
; POINT TO DISPLAY REGEN BUFFER
PRT DEC
CX,OFFSET F3B PAD-OFFSET F3B
; LOAD MESSAGE LENGTH
51 ,OFFSET F3S; POINT TO PRINT' K8 OK','

LOOP

0905 03BC
0907 0318
0909 0278
09DB

5-74

CX,5
AX
PROT PRT HEX

03BCH
0378H
0278H
WORD

ADDRESS OF MONOCHROME PARALLEL ADAPTER
BASE ADDRESS STANDARD PARALLEL ADAPTER
ADDRESS OF ALTERNATE PARALLEL ADAPTER

I-I

IBM Personal Computer MACRO Assembler
Version 2.00
TEST3 ---- 06/10/85
POST EXCEPTION INTERRUPT TESTS

06-10-85

PAGE 118,121
TITLE TEST3 ---- 06/10/85
POST EXCEPTION INTERRUPT TESTS
.286C
.LIST
1-- ------------- - - - - - - - -- - - -- - - -- - - -- ----- - --- -TEST.20
;
ADDITIONAL PROTECTED (VIRTUAL MODEl TEST
DESCR I PT I ON
;
THE PROCESSOR I S PUT IN PROTECTED MODE AND
THE FOLLOW I NG FUNCT IONS ARE VER I F I ED
;

I
2
3

4
5
6
7

8
9
10
11
12
13
14
15

VER I FY PROTECTED MODE
THE MACHINE STATUS IS CHECK FOR VIRTUAL MODE
2. PROGRAMMED I NTERRUPT TEST
AN PROGRAMMED INTERRUPT 32 I S I SSUED AND
AND VERIFIED
3. EXCEPTION INTERRUPT 13 TEST
A DESCR I PTOR SEGMENT LIM I TIS SET TO ZERO
AND A WRITE TO THAT SEGMENT IS ATTEMPTED
AN EXCEPT I ON 13 I S EXPECTED AND VER I F I EO
LOT/SOT LTR/STR TEST
LOAD LOT REGISTER AND VERIFY CORRECT
LOAD TASK REGISTER AND VERIFY CORRECT
THEY ARE VERIFIED VIA THE STORE INSTRUCTION
5. THE CONTROL FLAGS OF THE 286 FOR 0 I RECT I ON
ARE VER I F I ED V I A THE STD AND CLD COMMANDS
I N PROTECTED MODE
BOUND INSTRUCTION TEST (EXCEPTION INT 5)
CREATE A SIGNED ARRAY INDEX WITHIN AND
OUTSIDE THE LIMITS.
CHECK THAT NO EXC 1NT
IF WITHIN LIMIT AND THAT AN EXC INT 5
OCCURS IF OUTSIDE THE LIMITS.
PUSH ALL POP ALL TEST
SET GENERAL PURPOSE REG I STERS TO 0 I FFERENT
VALUES ISSUE A PUSH ALL, CLEAR THE REGISTERS
I SSUE A POP ALL AND VER I FY CORRECT.
8. CHECK THE VERR /VERW I NSTRUCTI ONS
THE ACCESS BYTE I S SET TO READ ONLY THEN TO
A WR I TE ONLY AND THE VERR { VERW INSTRUCT 10NS
ARE VERIFIED.
9. CAUSE AN INTERRUPT 13 V I A A WR ITE TO A
READ ONLY SEGMENT
10. VERIFY THE ARPL INSTRUCTION FUNCTIONS
SET THE RPL FIELD OF A SELECTOR AND
VERIFY THAT CURRENT SELECTOR RPL IS SET
CORRECTLY.
I 1. VER I FY THE LAR I NSTRUCT I ON FUNCT IONS
12. VERIFY THE LSL INSTRUCTION FUNCTIONS
13. LOW MEG CH I P SELECT TEST

16

17
18
19
20
21
22
23
24
25
26
27
28
29

30
31
32
33

34
35

36
37
38
39

40
41
42
43
44
45
46
47
48
49

50
51
52
53

0000

54
55
56
57

58
59
60
61
62
63
64
65
66
67
68
69

0000
0000 E8 0000 E
0003 BO FO
0005 E6 80

POST3

PU8L IC

POST3

EXTRN
EXTRN
EXTRN
EXTRN

CMOS WR I TE: NEAR
DDS :NEAR
PROC SHUTDOWN: NEAR
SYSINITI :NEAR

ASSUME
PROC
CALL

CS:CODE

MOV
OUT

; -----

<> <><> <><> <> <> <> <> <> <> <>
<><> CHECKPOINT FO <><>

SET SHUTDOWN RETURN 1
MOV
CALL

0001 B8 018F
OOOA E8 0000 E

SET DATA SEGMENT

005
AL,OFOH
MFG_PORT ,AL

AX, PH+CMOS SHUT_DOWN+NMI
CMOS_WRITE

; ADDRESS FOR SHUTDOWN BYTE
SET ERROR EXIT (DOUBLE EXCEPTION? I

70
71

ENABLE PROTECTED MODE

72
13
74
75
16

0000
DOlO
0012
0015

BC
8E
BC
E8

MOV
MOV
MOV

0000
04
8000
0000 E

CALL

77
78
79
80
81
82
83
84
85
86
81

SET STACK FOR SYSINITI

SP,POST SS
SS, SP
SP,POST SP
SYSINITT

GO ENABLE PROTECTED MODE

SET TEMPORARY STACK
0018
OOIB
00 I 0
OOIF
0026
002C
002F
0031

MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV

B8 0008
8E CO
8E 08
26: C1 06 005A 0000
26 = C6 06 005C 00
BE 0058
8E 06
BC FFFD

AX, GOT PTR
ES ,AX DS,AX
ES:SS TEMP.BASE La WORD,O
BYTE PTR ES: (55-TEMP. BASE H I
SI,SS TEMP
SS,51SP,MAX_SEG_LEN-2

BYTE I ,0

88
89

90
91
92
0034 OF 01 EO
93
0031 A9 000 I
94
003A 15 03
95
003C E9 02CD R
96
97
003F 80 FI
98
0041 E6 80
99
100
101
102
0043 BO BO
103
0045 E6 88
104
0041 CD 20
105
0049 28 C9
106004BE488
101
0040 22 CO
108
004F EO FA
109
0051 14 03
110
0053 E9 02CD R
111
112
113
0056 BO F2
114

; -----

T7_1:

VER I FY PROTECTED MODE
SMSW
DB
TEST
JNZ
JMP

AX
OOFH,OOIH,OEOH
AX, VIRTUAL ENABLE
T11
ERROR_EX I T

MOV
OUT

AL.OFIH
MFG_PORT, AL

1NTERRUPT TEST

LOOPI:

MOV
OUT

AL,OBOH
DMA PAGE+OAH,AL

INT
SUB
IN
AND
LOOPNZ
JZ
JMP

32 CX,CX
AL,DMA PAGE+OAH
AL,AL LOOPI
T72
ERROR_EX I T

MOV

ARE WE
ERROR

I N PROTECTED MODE
IF NOT

<> <> <> <><><><> <> <> <> <> <>
<><> CHECKPOINT FI <><>

I PROGRAMMED

CAUSE AN EXCEPTI ON
T1_2:

GET THE MACHINE STATUS WORD

INTERRUPT

INTERRUPT 32)
SET EXCEPT I ON Fl-AG
FOR INTERRUPT 10
INTERRUPT
WA I T FOR 1NTERRUPT
DID THE

I NTERRUPT OCCUR?

M I 55 I NG

INTERRUPT

(GENERAL PROTECT I ON

INTERRUPT

1301

AL,OF2H

TEST3 5-75

1-2

IBM Personal Computer MACRO As.sembler
Version 2.00
TEST3 ---- 06/10/85
POST EXCEPTION INTERRUPT TESTS
115
116
117
118
119

0058 E6 80
005A 80 90
005C E6 88

120
121
122

139

140
141
142
143
144

,.5

,.8
,.9

170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
19.
197
198

210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228

SET SEGMENT TO 0

;

LOAD ES

SET ES REGI STER
PUSH
POP

BYTE PTR ES TEMP
E5
-

CAUSE AN EXCEPTION
SUB
MOY
SUB

LOOP2:

IN
AND

LOOPNZ

"Z
"MP

13

INTERRUPT

01,01
AX,ES:[Oll
CX,CX
AL,OMA PAGE+OAH
AL,AL LOOP2

;

773
ERROR_EXIT

TH I S SHOULD CAUSE AND EXCEPT! ON
WA I T FOR INTERRUPT
DID THE

INTERRUPT OCCUR?

CONTI NUE I F INTERRUPT
MISSING INTERRUPT

; ------------------ - ---- - --- -- ---- ------;
;

VER I FY 286 LOT I SOT L TR I STR
J NSTRUCT IONS
DESCRIPTION
LOAD LOT. REGISTERS WITH A
OESCR I PTOR AND VER I FY CORRECT

; ------------------ - --- - ------------WR I TE TO 286 LOT REG I STER
0089
0089 80 F3
0088 E6 80
0080 8F 0078
0090 OF
0091
0091 88 07
0093
0091
0091 00
0093

MOY
OUT
MOY

POOOO
1?000 I

LA8EL
ORG

DB
ORG

01

-

P0002

SLOT
DB
LABEL

n0003

LA8EL

SUB

03 CO

ADO
ORG

00

DB

25 00F8
30 0078
75 18

ORG
AND
CMP
"NZ

REGISTER FROM THIS AREA

OOFH
8YTE
OX,OI
8YTE
OFFSET CS: pOOOO
OOOH
OFFSET CS:??OOOI

READ AND VERIFY 286 LOT SELECTOR

OF

<><> <><><><> <><><><> <><>
<><> CHECKPO I NT F3 <><>

AL,OF3H
MFG PORT ,AL
01 ,POST LOTR

;----009328 CO
0095
0096
0096
0098
0096
0096
0098
0098
0098
009E

LLOT
DB
LA8EL
MOY

AX,AX
AX
OOFH
8YTE
AX,AX
BYTE
OFFSET CS: n0002
OOOH
OFFSET CS: 710003
AX,OF8H
AX ,POST LOTR
ERROR
-

CLEAR AX
GET THE LOT SELECTOR

STRIP TI /RPL
CORRECT SELECTOR?
GO IF NOT

WRITE TO 286 TR
00 AD 8F 0068
00A3 OF
OOM
00A4 88 OF
00A6
00A4
OOM 00
OOM

MOY
LTR

08
n0004
n0005

ORG
ORG

00A6 28 CO
OF
??0006
88 C8

5-76

DB
LA8EL
MOY

n0007

LABEL
ORG

00

DB

25 OaF8
3D 0068
75 08

ORG
AND
CMP
"NZ

FD
9C
58
A9 0200
74 03
E9 02CD R
A9 0400
75 03
E9 02CD R
FC
9C
58
A9 0400
74 03

TEST3

01 ,POST TR

01

-

AX,AX
AX
OOFH
8YTE
CX,AX
8YTE
OFFSET CS: 1?0006
OOOH
OFFSET CS:??0007
AX,OF8H
AX,POST TR
ERROR
-

GET THE TR

REG I STER

CORRECT SELECTOR?

TEST 286 CONTROL FLAGS

STO

SET 0 I RECT I ON FLAG FOR DECREMENT
GET THE FLAGS

PUSHF

"Z
JMP

AX
AX ,0200H
T7 4
ERROR_EX I T

TEST
"NZ
"MP

AX ,0400H
T7.5
ERROR_EX I T

POP

TEST

ERROR;
T7_ 4:

REGISTER FROM THIS AREA

OOFH
8YTE
eX,OI
BYTE
OFFSET CS: 710004
OOOH
OFFSET CS: ?10005

VERIFY 286 TR REGISTERS
SUB
STR

; ----0083
00B4
00B5
00B6
0089
0088
008E
OOBE
OOCI
00C3
00C6
00C6
00C7
00C8
00C9
OOCC

LA8EL
DB

;-----

OOA8
00A9
00A9
00A8
00A9
00A9
OOAB
OOAB
OOAE
0081

LABEL
MOY

199

200
201
202
203
204
205
206
207
208
209

;

DATA ACCESS RIGHTS

MOY
MOY
MOY

;

150
151
152
153
154
155

162
163
164
165
166
167

OS:ES_TEMP.SEG_LlMIT,O

;-----

,.9

'.0
161

CPLO,

; -----

14.
147
148

156
157
158
159

;-----

0074 6A 48
0076 07

0077 28 FF
007926: 8805
007C 28 C9
007E E4 88
0080 22 CO
0082 EO FA
0084 74 03
0086 E9 02CD R

;
<><> CHECKPO I NT F2 <><>
; SET INTERRUPT 13. FLAG
; FOR THE INTERRUPT HANDLER

MODIFY DESCRIPTOR TA8LES
SET TEMPORARY ES DESCRIPTOR TO SEGMENT LIMIT

0064 C6 06 0040 93
0069 C6 06 004C 0 I
006E C7 06 004A 0000

130
131
132
133
13.
135
13.
137
138

MFG P.ORT ,AL
AL,9DH
OMA_PAGE+OAH,AL

;----005E C7 06 0048 0000

123
12.
125
126
127
128
129

OUT
MOY
OUT

06-10-85

CLO

PUSHF
POP

TEST

"Z

I NTERRUPT FLAG SHOULD 8E OFF
CONT [NUE I F OFF
GO IF NOT
CHECK 0 I RECT I ON FLAG
GO

IF NOT SET

CLEAR 0 I RECT I ON FLAG
INSURE 0 I RECT [ON FLAG

I S RESET

IBM Personal Computer MACRO Assembler
Version 2.00
TEST3 - - -- 06/10/85
POST EXCEPT I ON I NTERRUPT TESTS
229

230
23 I
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
241
248
249
250
25 I
252
253
254
255
256
251
258
259
260
"

I

262
263
264
265
266
267
268
269
270
211
272
273
274
275

276
277
218
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342

OOCE E9 02CD R

;GOIFNOT
;
;

000 I
0001
0003
0005
0007

80 F4
E6 80
6A 48
01

0008
OODA
OODF
ODES
00E7
00E9
OOEC
OOEF
OOFI
00F3
00F5
00F7
00F9

28 FF
26; C1 05 0000
26: C1 45 02 1FFF
80 95
E6 88
88 1000
26: 62 05
28 C9
E2 FE
E4 88
3C 00
15 03
E9 02CO R

- - - - - - ----------------- - - -- ---------- --VERIFY 286 80UND INSTRUCTION
OESCR I PT I ON
CREA TE A SIGNED ARRAY INDEX
WITHIN AND OUTSIDE THE LIMITS
(EXPECT INT 5)

MOV
OUT
PUSH
FOF

<><><><><><><> <> <> <><><>
F4 <><>

AL,OF4H
MFG PORT ,AL
BYTE PTR ES TEMP

ES

<><> CHECKPOINT
LOAD ES REGI STER

-

CHECK BOUND FUNCT IONS CORRECTLY

LOOPA:

SUB
MOV
MOV
MOV
OUT
MOV
80UND
SUB
LOOP
IN
CMF

IN''
JMF

OI,DI
;
WORD PTR ES:(DI],O
;
WORD PTR ES:[DI+21,07FFFH
AL,095H
OMA PAGE+OAH,AL
AX,ToOOH
AX,aWORD PTR ES:{ol]
CX,CX
LOOPA
AL,OMA PAGE+OAH
AL,O
T7 7
ERROR_EXIT

CHECK LOW BOUND WORD CAUSES
OOFC
OOFC 28 FF
OOFE 26: C1 05 3FFO
010388 1000
0106 26: 62 05
0109 28 C9
0108
0108 E4 88
0100 3C 00
OIOF EO FA
0 I I I 14 03
0113 E9 02CO R

SET AX WITH I N SOUNDS
USE THE ES SEGMENT PO INTER
WA I T FOR POSS I BLE INTERRUPT
GET THE RESULTS
DID AN I NTERRUPT OCCUR?
CONT I NUE I F NOT
GO IF YES

INTERRUPT 5

SUB
MOV
MOV
80UND
SUB

01,01
WORD PTR ES:[Dlj,03FFOH
AX,IOOOH
AX,DWDRO PTR ES:[DI]
CX,CX

PO I NT BEG I NN I NG OF THE BLOCK
SET FIRST WORD TO 03FFOH
SET AX OUT OF BOUNDS

IN
CMF
LOOPNZ

AL,DMA PAGE+OAH
AL,OH LOOPB
T78
ERROR_EX I T

GET THE RESULTS
DID AN INTERRUPT OCCUR?
TRY AGAIN
CaNT I NUE I F INTERRUPT
GO IF NO INTERRUPT

WAIT FOR POSSI8LE INTERRUPT

LOOPB:

J"

JMF

;-----

CHECK HIGH BOUND WORD CAUSES

01168095
0118 E6 88
0I IA
OIIC
0121
0127
012A
a I 20
012F
a 12F
0131
0133
0135
0137

POINT BEGINN[NG OF THE 8LOCK
SET FIRST WORD TO ZERO
; SET SECOND TO 07FFFH
SET INTERRUPT 5 FLAG

AL,95H
DMA_PAGE+OAH, AL

28 FF
26: C7 05 0000
26: C7 45 02 OFFF
88 1000
26: 62 05
28 C9

INTERRUPT 5
SET FLAG FOR

INTERRUPT

SUB
MOV
MOV
MOV
BOUND
SUB

,01
PO I NT 8EG I NN I NG OF THE BLOCK
WORD PTR ES:[DI],O
, SET FIRST WORD TO 0
WORD PTR ES: [DI +2],OFFFH; SET SECOND TO OFFFH
SET AX OUT OF BOUNDS
AX,!OOOH
AX,DWORD PTR ES:{DI]
CX,ex
WAIT FOR POSSIBLE INTERRUPT

IN
CMF
LOOPNZ
.J"
.JMF

AL,OMA PAGE+OAH
AL,OH LOOPC
T7 9
ERROR_EX I T

O[

LOOPC:
E4
3C
EO
74
E9

88
00
FA
03
02CO R
;
;

013A
013A 80
013C E6
013E B8
0141 88
0143 43
0144 88
0146 41
0147 88
0149 42
014A 88
014C 47
0140 8B
014F 46
0150 55
0151 88
0153 45
015460
0155 28
0 I 57 88
0159 88
0 I 5B 8B
015D 88
0 I 5F 88
0161 88
016361
016483
0167 50
0168 75
016A 3D
0160 75
016F 83
017275
0 I 74 83
0177 75
0179 83
017C 75
017E 83
0181 15
018383
0186 74

GET THE RESULTS
DID AN INTERRUPT OCCUR?
TRY AGAIN
GO I F NO INTERRUPT

VERIFY PUSH ALL AND POP ALL INSTRUCTIONS:
DESCRIPTION
SET REGI STERS TO A KNOWN VALUE AND
:
PUSH ALL.
RESET THE REGISTERS, POP ALL:
AND VER IFY

T7 9:
F5
80
0001
D8
C8
Dl
FA
F7
EE
CO
08
C8
DO
F8
FO
E8
FO 07
IE
0001
19
FB 02
14
F9 03
OF
FA 04
OA
FF 05
05
FE 06
03

MOV
OUT
MOV
MOV
INC
MOV
INC
MOV
INC
MOV
INC
MOV
INC
PUSH
MOV
INC
PUSHA
SUB
MOV
MOV
MOV
MOV
MOV
MOV
POP A
CMF
FOF
.IN''
CMF
.IN''
CMP
.IN''
CMF
.IN''
CMF
.IN''
eMP
.IN''
CMF

J"

AL,OF5H
MFG PORT, AL
AX,OI
BX,AX

<> <><><><><><><><> <> <><>
<><> CHECKPO I NT F5 <><>
SET AX= 1
SET BX=2

BX
CX,BX

SET eX=3

CX

OX,CX
OX

DI,DX
01
SI,DI
5I
BF
BP,SI
BF
AX,AX
8X,AX
CX,AX
DX,AX
OI,AX
SI,AX
BP,AX
8P, 01
BF
ERROR EXITI
AX,O 1ERROR_EXIT!
8X,02
ERROR EXITI
CX,03ERROR EXIT1
DX,04ERROR_EX I T I
DI ,05
ERROR_EXIT!
S 1,06
T7_10

SET DX=4
SET DI=5
SET S I =6
SAVE THE
SET BP=7

(SP)

ERROR FLAG REGI STER

[SSUE THE PUSH ALL COMMAND
CLEAR ALL REG I STERS

GET THE REG I STERS BACK
BP SHOULD BE 7
RESTORE (BP) ERROR FLAG REGISTER
GO IF NOT
AX SHOULD BE I
GO IF NOT
BX SHOULD 8E 2
GO IF NOT
CX SHOULD BE 3
GO IF NOT
OX SHOULD BE 4
GO [F NOT
o I SHOULD 8E 5
GO IF NOT
S I SHOULD BE 6
CONTINUE IF [T IS

TEST3

5-77

1-4

IBM Personal Computer MACRO Assembler
Version 2.00
TEST3 ---- 06/10/85
POST EXCEPTION INTERRUPT TESTS

343
344
345
346
347
346
349
350
351
352
353
354
355
35.
357
358
359
360
361
362
363
3.4
3.5

;----0188
0188 E9 02CO R

06-10-85

ERROR EXIT

ERROR EXITI:
JMP

;

-- - - -- -- - - -- - ------ - --- ---- --- -- - - -- --- --- - -- --

;
VER I FY ACCESS RIGHTS FUNCT I ON CORRECTLY
; DESCRIPTION
;
SET ACCESS RIGHTS OF OEseR I PTOR TO
;
READ ONLY.
VERIFY THE VERW/VERR INSTR
;
ACCESS A READ ONLY WITH A WR I TE AND
;
VER I FY AN EXCEPT I ON I NTERRUPT 13
018B
0180
a 18F
0195
019A
01 AO
01 A3

BO
E6
C7
C6
C7
B8
8E

o I AS

3E

0lA6
0lA7
0lA7
o IA9
01 A7
01 A7
0lA9
0lA9

OF

F6
80
06 0048 FFFF
06 004C 00
06 004A FOOO
0048
CO

T7_10:

MOV
OUT

"OV
"OV
"OV
"OV
"OV

AL,OF6H
<><><><><><><><><><><><>
MFG PORT ,AL
, < > < > CHECKPOINT F6 <><>
OS IES TEMP. SEG LI M IT ,MAX SEG LEN
; SET SEGMENT TO OFFFFH
BYTE PTR OS: IE5 TEMP.BAsE HI-8YTEI,O
; SET THE ADDRESS
DSlES TEMP.BASE-LO WORD,OFOOOH
AX ,ES-TEMP
; LOAD ES REGI STER
ES, AXt TH I S SEGMENT SHOULD BE WR I TEABLE

INSURE ACCESS RIGHTS MAY BE WRiTTEN

3 ••
3.7
3.6
3.9

370
371

372
373

374
375
37.

377
376
379
360
381
382
383
3.4
385
3 ••
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
406
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
42.
427
426
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
45.

??0009

SEGOV
DB
VERW
DB
LABEL

? ?OOOA

LABEL

8B E8

"OV
ORO

00

DB
ORO

JNZ

75 00
;-----

01 AB C6 06 0040 91
alBa 88 0048
01B3 8E co

SET SEGMENT OVERRIDE TO START OF TABLE

OS

03EH
AX
OOFH
BYTE
BP,AX
BYTE
OFFSET CS:?? 0009
OOOH
OFFSET CS;? ?OOOA
ERROR_EXIT 1

CHECK THE ACCESS RIGHTS OF ES_TEMP

; ERROR

I F SEGMENT CAN NOT WR I TE

SET ACCESS RIGHTS TO READ ONLY

os:

0lB6
01 B7
a I 87
0189
0187
0187
0189
0189

OF

74 CD

JZ

BYTE PTR
IES TEMP.DATA ACC RIGHTS) ,91H
AX, ES TEMP
; -LOAD ES REG I STER
ES ,AXOS
SET SEGMENT OVERR I DE TO START OF TABLE
03EH
AX
CHECK THE ACCESS RIGHTS OF ES_TEMP
OOFH
BYTE
BP,AX
BYTE
OFFSET CS: ??OOOC
OOOH
OFFSET CS:? 10000
ERROR_EXITI
ERROR IF SEGMENT IS WRITEABLE

or BB

88 0048

"OV
SEGOV

OS

0185 3E
??OOOC
88 E8
? 10000

ORO

00

DB
ORO

08

018E 3E
a r8F
OICO
OICO
0lC2
OICO
OICO
0lC2
0lC2

??OOOF

VERR
DB
LABEL

?70010

"OV
LABEL

OF
88 EO

ORO

00

DB
ORO

75 C4

JNZ
;-----

0lC4
0lC6
0lC8
OICA
DICE
aiDa
0102
0104
0106

80 90
E6 88
2B F6
26: C6 04 00
28 C9
E4 88
22 CO
EO FA
75 BO

SUB

"OV
SUB

LOOPD:

LOOPNZ
JNZ
;-----

;
;

;
BO
E6
88
BS
00

IN
AND

I NSURE THAT SEGMENT

AX,ES TEMP

5-78

010 THE

RESTORE THE ACCESS RIGHTS BYTE

"OV
OUT
"OV
"OV
OR

1?0011

ARPL
LABEL

?? 00 1 2

"OV
LABEL
ORO

08
ORO

,CPLO_OATA_ACCESS

JNZ
AND

e"p

JNZ

<><> <><><> <> <> <> <> <><> <>

AL,OF7H
MFG PORT, AL
AX,ES TEMP
BX,OS-TEMP
AX,03H

AX,BX
BYTE
AX,BX
BYTE
OFFSET CS:??OOII
063H
OFFSET CS:? ?OO 12
ERROR EXITI
BL, 03H
BL,03H
ERROR_EXITI

<><> CHECKPOINT F7
PUT A SELECTOR I N AX
PUT A SELECTOR IN BX
MAKE ACCESS OF AX < ex
AX

SECOND OPERAND
;

I SSUE THE RPL COMMAND

GO IF RPL WAS NOT CHANGED
STR I P UNWANTED BITS
AS EXPECTED?
GO IF NOT

CHECK THAT ACCESS RIGHTS 00 NOT CHANGE

TEST3

I NTERRUPT OCCUR?

MISS I NG INTERRUPT

- --- - -- - -- - -- - --- - - - - -- - -- -- - --- -- - - - - - - - -- - - - --

80
0048
0060
0003

9A
E3 03
FB 03
92

WR ITE A BYTE THAT SHOULD
WA iT FOR INTERRUPT

VERIFY AO..JUST RPL FIELD OF SELECTOR
I NSTRUCT I ON (ARPL I FUNCT IONS
OESCR I PT I ON
SET THE RPL FIELD OF A SELECTOR
AND VER I FY THAT THE ZERO FLAG I S SET
CORRECTL Y AND THAT THE SELECTOR RPL
F I ELO I S SET CORRECTLY

8B C3

75
80
80
75

SET EXCEPT I ON FLAG
FOR INTERRUPT 13

AL,09DH
oMA PAGE+OAH ,AL
51,51
BYTE PTR ES:[Slj.OO
cX,ex
AL,DMA PAGE+OAH
AL,AL LOOPD
ERROR_EX I T 1

MOV
BYTE PTR os: (ES_TEMP.DATA_ACC_RIGHTSJ
--- --- --------- ---------------------------------

F7

63

GO I F SEGMENT NOT READABLE

13 INTERRUPT

NOTE BX ::: FIRST OPERAND
OlEA
0 r EA
OIEC
OlEA
0 I EA
OIEC
OIEC
0 I EE
OIFI
0lF4

IS READABLE

-

03EH
AX
OOFH
BYTE
SP,AX
BYTE
OFFSET CS:??OOOF
OOOH
OFFSET CS:??OOIO
ERROR_EXITI

CAUSE AN EXCEPTION

"DV
OUT

0 r 08 C6 06 0040 93

0100
0 I OF
aiEl
0 I E4
0 I E7

"OV
"OV
"OV
SEGOV
DB
VERW
DB
LABEL
"OV
LABEL

1-5

IBt.! Personal Computer MACRO Assembler
Ver.sion 2.00
TEST3 ---- 06/10/85
POST EXCEPTION INTERRUPT TESTS
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
476
479
480
481
462
463
464
485
486
487
466
46'
490

OlF6 BB 0060
0 I F9 B8 0048
0 I FC 80 CB 03

01FF
OIFF
020 I
OIFF
0 I FF
020 I
0201
0203
0206
0209

;-----

NOTE BX

= FIRST

??OO \ 3

ARPL
LABEL

AX,BX
BYTE
AX,BX
BYTE
OFFSET CS: 1100 13
063H
OFFSET CS:??0014
ERROR EXITI
BL,03H
BL,03H
ERROR_EX [T2

MOV

110014

LABEL
ORC

63

DB
ORC

JZ

85
E3 03
FB 03
2F

AND
CMP

JNZ

OPERAND

AX

= SECOND
;

OPERAND

I SSUE THE RPL COMMAND

GO IF RPL WAS NOT CHANGED
STRIP UNWANTED BITS
AS EXPECTED1
GO IF NOT

VER I FY LOAD SEGMENT LIM I T I LSL)
AND LOAD ACCESS RIGHTS iLAR} INSTRUCTION
;----020B 90 F8
0200 E6 80

CHECK THE LAR

INSTRUCTION

<><><> <><> <> <> <> <> <> <> <>
<> <> CHECKPO I NT F 8 <> <>

AL,OF8H
MFG_PORT, AL

MOV
OUT

SET THE DESCR I PTOR TO LEVEL 3
020F C6 06 0040 F3
0214 BB 0048
0217 2B CO

MOV
MOV
SUB

0219 OF
021A
021 A 88 C3
021C
021 A
021A 02
021C

DB
LABEL

BYTE PTR OS: lES TEMP.DATA ACC RIGHTS) ,CPL3 DATA ACCESS
BX,ES TEMP
-AX, AX; CLEAR AX

GET THE CURRENT DESCRIPTORS ACCESS RIGHTS

491
492
493
494
495
496
497
498

; FUT A SELECTOR IN BX
I PUT A SELECTOR I N A X
; MAKE ACCESS OF BX < AX

MOV
MOV
OR

8B C3

74
80
80
75

06-10-85

LAR
110015

AX,BX
OOFH
BYTE
AX,BX
BYTE
OFFSET CS:??0015
002H
OFFSET CS:??0016

MOV

110016

LABEL
ORC

DB
ORC

;

I SSUE THE LAR COMMAND

499

500

INSURE THE DESCRIPTOR WAS VISIBLE

501
502

503
504
505
506
507
506

;----021E 80 FC F3
0221 75 17

GO IF LAR WAS NOT CHANGED

THE DESCRIPTORS ACCESS RIGHTS MUST BE 3
AH,CPL3 DATA ACCESS
ERROR_EXIT2 -

CMP

JNZ

509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
546
54'
550
551
552
553
554
555
556
557
556
559
560
561
562
563
564
565
566
567
568
569

;

JNZ

; AS EXPECTED?
; GO IF NOT

I LOAD SEGMENT LIM I TS)

CHECK THE LSL

<><> <><><><><><><><><><>
<><> CHECKPOINT F9 <><>

0223 BO F9
0225 E6 80
0227 C7 06 0048 AAAA

MOV
OUT
MOV

~~~E~~~~M~~ SEG_LIM IT .OAAAAH

0220 C6 06 0040 93
0232 98 0048

MOV
MOV

~~~~SP~~M~S: I ES_TEMP. DAT~_~g~BR ~~H~~b i ~~~~_DATA_ACCESS

LSL

BX. AXOOFH
BYTE
BX,AX
BYTE
OFFSET CS:110017
003H
OFFSET CS:??0018
R07

0235
0236
0236
0238
0236
0236
0238
0238

OF
?? 00 I 7
8B 08

AL,OF9H

DB
LABEL
MOV

110018

LABEL
ORC

03

DB
ORC

74 03

JZ

023A
023A E9 02CD R

ERROR EX I T2:
..IMP

0230 81 FB AAAA
0241 C7 06 0048 5555
0247 B8 0048

R07:

OF
1?0019
8B 08
11001A

DB
LABEL
LABEL
ORC

DB
ORC

75 EB

JNZ

024F 81 FB 5555
0253 75 E5

CMP

BX ,05555H
ERROR_EX I T2

JNZ

;- - - 7; ~~; ~~~ ~~

;
;

;

-

~~~~~; ;~~;

MOV
OUT

PUSH

POP

AL,OFAH
MFG PORT ,AL
BYTE PTR GOT PTR
OS
-

<><><> <> <> <> <><><> <><><>
<><> CHECKPOINT FA <><>
MODIFY THE DESCRIPTOR TABLE

SET TEMPORARY ES DESCRIPTOR 64K SEGMENT L1MIT/CPLO DATA ACCESS
MOV
MOV

DS:ES TEMP.SEG LIMIT,MAX SEG LEN
BYTE PTR OS: (ES_TEMP.DATA_ACC_RIGHTS) ,CPLO_DATA_ACCESS

START WITH SEGMENT
C6 06 004C lB
C7 06 004A 0000
6A 48
07
2B FF
26: C7 05 AA55

INSURE CORRECT SEGMENT LIMIT
GO IF NOT

-------------------------------

TEST THAT A WRITE TO ADDRESS IBOOOO DOES NOT WRITE
TO BOOO:O, OR lB8000 DOES NOT WRITE TO B800:0

;-----

0267
026C
0272
0274
0275
0277

I F NOT SUCCESSFUL

- - - - - - - - - - - - - - -- -- - - - - - - - - - - -- - - - - - -- - - - - -- -- -- -- - - - - - --

0255 BO FA
0257 E6 80
0259 6A 08
025B IF

025C C7 06 0048 FFFF
0262 C6 06 0040 93

GO IF OK

BX,OAAAAH
; I NSURE CORRECT SEGMENT LIM I T
DS:ES TEMP.SEG LIMIT,05555H
;SET THE SEGMENT LIMIT TO 05555H
AX ,ES-TEMP
BX, AX; GET THE OESCR I PTOR SEGMENT LIM I T
OOFH
BYTE
BX,AX
BYTE
OFFSET CS:??OOI9
003H
OFFSET CS:??OOIA
ERROR_EXIT2
GO IF NOT SUCCESSFUL

MOV

03

SET SEGMENT LI MIT TO OAAAAH

GET THE DESCR I PTOR SEGMENT LIM I T

GO

CMP
MOV
MOV

LSL
024A
024B
024B
0240
024B
024B
0240
0240

;

;

IBOOOO

MOV
MOV

~~~~ti~M~:~l~~-~~M:O~~:~_HI_BYTE)

PUSH

BYTE PTR
ES TEMP E5
DI,DI
;
WORD PTR ES:[DI1,OAA55H ;

POP
SUB
MOV

,IBH
LOAD ES REG I STER

POINT TO FIRST LOCATION
WRITE A TEST PATTERN

570

TEST3

5-79

1-6
06-10 85

IBM Personal Computer MACRO Assembler
Version 2.00
TEST3 ---- 06/10/85
POST EXCEPTION INTERRUPT TESTS

571
512
513
574
575
516
571
516
519
580
581
582
583
584
565
586
567
588
589
590
591
592
593
594
595
596
597
596
599
600
601
602
603
60.
605
606
601
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
621
626
629
630

DO FOR SEGMENT
021C
0282
0284
0285

C7 06 004A 8000
6A 48
01
26: C7 05 AA55

028A
028F
0295
0291
0298

C6 06 004C 1A
Cl 06 o04A 0000
6A 48
01
26: Cl 05 AA55

MOV
PUSH
POP
MOV

DO FOR SEGMENT
MOV
MOV
PUSH
POP
MOV

188000

DS:ES TEMP. BASE LO WORD,BOOOH
BYTE PTR ES lEMP ; LOAD ES REGIS1ER
ES
WORD PTR ES: (0 r ] ,OAA55H I WR r TE A TEST PATTERN
I AOOOO

BYTE PTR OS: IES TEMP.BASE HI BYTE) ,IAH
DS:ES TEMP.SASE-LO WORD,o- BYTE PTR ES TEMP LOAD ES REG I STER
ES
WORD PTR ES:(DIJ,OAA55H ; WRITE A TEST PATTERN

B/W VIDEO CARD
0290 6A 20
029F 1F
02AO 88 05

PUSH
PDP
MDV

BYTE PTR
C BWCRT PTR
OS
-AX,OS: [DI J

SET OS TO S/W DISPLAY REGEN BUFFER
GET THE WORD FROM B/W V IDEO

COMPAT[BLE COLOR
02A2 6A 28
02A4 IF
02A5 88 10

PUSH
PDP
MDV

;-----

BYTE PTR C CCRT PTR
OS
-aX,OS:[DI)

SET OS TO COMPAT [BLE COLOR MEMORY
GET THE WORD FROM COLOR MEMORY

EGA COLOR

02A 1 6A 30
02A9 IF
02AA 88 00

PUSH

02AC 50
02AO 80 35
O'::AF E6 80
0281 58
0282 3D AA55
02857416
0281 81 F8 AA55
0288 74 10
0280 81 F9 AA55
02Cl 74 OA
02C3 80 34
02C5 E6 80

PUSH

PDP
MDV

BYTE PTR E CCRT PTR
OS
-CX,OS: [DJ J

EGA COLOR CRT PO I NTER LOW 64K

TEST FOR ERROR
MDV
OUT
POP
eMP
JZ
eMP
JZ
eMP
JZ
MOV
OU7

AX
AL,35H
MFG PORT ,AL
AX AX,OAA55H
ERROR EX [T
eX,OAA55H
ERROR EX I T
CX,OAA55H
ERROR EX IT
AL,34H
MFG_PORT, AL

SAVE RESULTS

<><><><><> <> <> <><><> <> <>
<><> CHECKPOINT 35 <><>

RESTORE CHECK PO J NT
<><> CHECKPO I NT

34 <><>

SHUTDOWN
02Cl
02C1 B8 068F
02CA E8 0000 E
02CD
02CD E9 0000 E

NORMAL EX IT!
- MOV
CALL
ERROR EXll:
-.IMP

0200

POST3

ENDP

CODE

ENDS
END

5-80

TEST3

AX,6·H+CMOS SHUT_OOWN+NMI
CMOS_WRITE
PRoe _ SHUTDOWN

ADDRESS FOR SHUTDOWN BYTE
SET GOOD END I NG

IBM Personal Computer MACRO Assembler
Version 2.00
TEST4 ---- 06/10/85
POST AND 8[OS UT[LlTY ROUTINES

I
2
3
4
5
6
7
B
9
10
II
12
13
14
15
16
17
IB
19
20
21
22
23
24
25
26
27
2B
29
30
31
32
33
34
35
36
37
3B
39
40
41
42
43
44
45
46
47
4B
49
50
51
52
53
54
55
56
57
5B
59
60
61
62
63
64
65
66
67

6B
69
70

PAGE 118,121
TITLE TEST4 ---- 06/10/85
POST AND BIOS UTILITY ROUTINES
.286C
.Ll ST
CODE
SEGMENT BYTE PUBL I C

0000

PUBLIC
PUBL [C
PUBLIC
PUBL [C
PUBL [C
PUBLIC
PUBL [C
PUBLIC
PUBLIC
PUBL [C
PUBL IC
PUBL IC
PUBLIC
PUBLIC
PUBL IC
PUBL IC
PUBLI C
PUBLIC
PUBL IC
PUBLIC
PUBLIC
PUBLIC
PUBL [C
PUBL IC

BEEP
BLINK INT
CMOS READ
CMOS-WR [TE
CONFTG BAD
011
DDS
DUMMY RETURN 1
ERR BEEP
E MSG
INT 2ST
KBD-RESET
POST4
PROT PRT HEX
PROC-SHUTDOWN
PRT HEX
PRT-SEG
P MSG
RE DIRECT
ROM CHECK
ROM-CHECKSUM
SET-TOO
WAITF
XPC_BYTE

EXTRN
EXTRN
EXTRN
EXTRN

EI63:NEAR
OSF 421NEAR
ROM-ERR:NEAR
XMIT_8042:NEAR

ASSUME
CS:CODE,DS:DATA
POST4 :
1--- CMOS READ ---------------------------------------------------------------READ BYTE FROM CMOS SYSTEM CLOCK CONFIGURATION TABLE

0000

0000
0000
000 I
0003
0004
0006
OOOT
0009
OOOA
00 DC
0000
00 OF
00 I I
0013
0014
0015
0018

I-I
06-10-85

9C
DO
F9
DO
FA
E6
90
E4
50
80
DO
E6
58
OE
E8
C3

INPUT:

(AL):

OUTPUT:

(AU

CMOS READ
PUSHF
08
TO
TI

IA
08
TO
0019 R

VALUE AT LOCATION (AL) MOVED INTO (AU.
IF BIT T OF (ALI WAS
ON THEN NM I LEFT DISABLED.
OUR I NG THE CMOS READ BOTH NM I AND
NORMAL INTERRUPTS ARE DISABLED TO PROTECT CMOS DATA INTEGRITY.
THE CMOS ADDRESS REGISTER IS POINTED TO A DEFAULT VALUE AND
THE INTERRUPT FLAG RESTORED TO THE ENTRY STATE ON RETURN.
ONLY THE (All REGISTER AND THE NMI STATE IS CHANGED.
PROC

ROL
STC
RCR
CLI
OUT
Nap
IN
PUSH
"OV
RCR
OUT
POP
PUSH
CALL
RET

CO

CMOS TABLE ADDRESS TO BE READ
BIT
T : 0 FOR NMI ENABLED AND I FOR NMI DISABLED ON EX[T
BITS 6-0 : ADDRESS OF TABLE LOCATION TO READ

NEAR

AL,I
AL, I
CMOS _PORT, AL
AL,CMOS_OATA
AX
AL,CMOS_REG_D-2
AL, I
CMOS_PORT, AL
AX
CS
CMOS_POPF

READ LOCATION (All INTO (I'\Ll
SAVE INTERRUPT ENABLE STATUS AND FLAGS
MOVE NMI B[T TO LOW POSITION
FORCE NM I B IT ON I N CARRY FLAG
HIGH BIT ON TO DISABLE NMI - OLD IN CY
DisABLE INTERRUPTS
ADDRESS LOCATION AND DISABLE NMI
I/O DELAY
READ THE REQUESTED CMOS LOCATION
SAVE (AH) REG I STER VALUE AND CMOS 8YTE
GET ADDRESS OF DEFAULT LOCATION
PUT OR I G I NAL NM I MASK 81 T I NTO ADDRESS
SET OEF AUL T TO READ ONLY REG I S TER
RESTORE (AHI AND (All = CMOS BYTE
-PLACE CODE SEGMENT IN STACK AND
-HANDLE POPF FOR B- LEVEL 80286
RETURN WITH FLAGS RESTORED

71

72
73
74
75
76

n

7B
79
BO
BI
B2
B3
B4
B5
B6
B7
BB
B9
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
lOB
109
110
III
112
113

0019

CMOS READ

ENDP

0019
0019 CF

CMOS POPF
IRET

PROC

00 I A

CMOS_POPF

ENDP

-

NEAR

POPF FOR LEVEL B- PARTS
RETURN FAR AND RESTORE FLAGS

; --- CMOS_WR I TE - -------- ------------------------------------------------------WRITE BYTE TO CMOS SYSTEM CLOCK CONFIGURATION TABLE
INPUT:

(AL)

=

(AHl

=

OUTPUT:

00 I A
00 I A
001 B
00 I C
DOlE
001F
0021
0022
0024
0026
0028
002A
002C
002E
002F
0030
0033

9C
50
DO CO
F9
DO 08

FA
E6
SA
E6
80
DO
E6
58
DE
ES
C3

TO
C4
Tl

IA
08
TO
0019 R

CMOS WR ITE
PUSHF
PUSH

ROL
STC
RCR
CLI
OUT
"OV
OUT
"OV
RCR
OUT
POP
PUSH
CALL

CMOS TABLE ADDRESS TO 8E WR ITTEN TO
81T
7:: 0 FOR NMI ENABLED AND I FOR NMI DISABLED ON EXIT
BITS 6-0 = ADDRESS OF TABLE LOCATION TO WRITE
NEW VALUE TO BE PLACED IN THE ADDRESSED TABLE LOCATION
VALUE IN {AHl PLACED IN LOCATION (ALl WITH NMI LEFT DISABLED
IF BIT 7 OF (ALI IS ON.
dURING THE CMOS UPDATE 80TH NMI AND
NORMAL INTERRUPTS ARE DISABLED TO PROTECT CMOS DATA INTEGRITY.
THE CMOS ADDRESS REG I STER I S PO I NTED TO A DEFAULT VALUE AND
THE INTERRUPT FLAG RESTORED TO THE ENTRY STATE ON RETURN.
ONLY THE CMOS LOCATION AND THE NMI STATE IS CHANGED.
PROC

NEAR

AL,I
AL,I
CMOS PORT, AL
AL,AH
CMOS DATA,AL
AL.C'MOS REG 0-2
AL,I
CMOS PORT, AL

AX
CS

-

CMOS_POPF

WRITE (AH) TO LOCATION (ALI
SAVE INTERRUPT ENABLE STATUS AND FLAGS
SAVE WORK REGISTER VALUES
MOVE NMI BIT TO LOW POSITION
FORCE NMJ 81T ON IN CARRY FLAG
HIGH BIT ON TO DISABLE NMI - OLD IN CY
D I SABLE INTERRUPTS
ADDRESS LOCATION AND DISABLE NMI
GET THE DATA BYTE TO WRITE
PLACE IN REQUESTED CMOS LOCATION
GET ADDRESS OF DEFAULT LocATION
PUT ORIGINAL NMI MASK BIT INTO ADDRESS
SET DEFAULT TO READ ONLY REGISTER
RESTORE WORK REG I STERS
-PLACE CODE SEGMENT IN STACK AND
-HANDLE POPF FOR B- LEVEL 80286

RET

0034

TEST4 5-81

1-2
06-10-85

IBM Personal Computer MACRO Assembler
Version 2.00
TEST4 ---- 06/10/85
POST AND BIOS UTILITY ROUTINES

114
115
116
111
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159

0034
0034 2E: 8E IE 003A R

PAGE
DDS

0039 C3

PROC
MDV
RE7

003A ---- R

DDSDATA OW

003C

DDS

NEAR
DS.CS:DDSDATA

LOAD (OS) TO DATA AREA
PUT SEGMENT VALUE OF DATA AREA
RETURN TO USER WITH (OS):: DATA

DATA

SEGMENT SELECTOR VALUE FOR DATA AREA

INTO OS

ENOP

;--- E MSG -- P MSG ----------------------------------------------------- THIS SUBROUTINE WILL PRINT A MESSAGE ON THE DISPLAY
ENTRY REQU I REMENTS:
SI :: OFFSET(ADDRESS) OF MESSAGE BUFFER
CX :: MESSAGE BYTE COUNT
MAX I MUM MESSAGE LENGTH IS 36 CHARACTERS
BP '" BIT 0=EI61/EI62, BIT I=CONFIG_BAD, 2-15= FIRST MSG OFFSET
PRoe
TEST
JNZ

NEAR
BP,03FFFH
E_MSG I

56
81 E6 3FFF
OB EE
5E

PUSH
AND
DR
PDP

SI

E8
IE
E8
F6
14

CALL
PUSH
CALL
TEST

P MSG
PR I NT MESSAGE
OS
SAVE CALLERS (OS)
DDS
; POINT TO POST/BIOS DATA SEGMENT
BYTE PTR @EQUIP FLAG,OIHj LOOP/HALT ON ERROR SWITCH ON ?
MFG_HAL T
; YES
THEN GO TO MANUFACTUR ING HALT

PDP
RE7

OS

RESTORE CALLERS

AL,@MFG ERR FLAG
MFG_PORT, ALMFG_HAL T

MANUFACTUR I NG LOOP MODE ERROR TRAP
o I SABLE INTERRUPTS
RECOVER ERROR I NO I CA TOR
SET INTO MANUFACTURING PORT
HALT SYSTEM
HOT NMJ TRAP

NEAR
AL,CS: [51]
SI
AX
PRT HEX
AX AL,LF
P _MSG

DISPLAY STRING FROM
PUT CHARACTER IN (AL)
PO I NT TO NEXT CHARACTER
SAVE PR INT CHARACTER
CALL VIDEO 10
RECOVER PRINT CHARACTER
WAS IT LINE FEED?
NO, KEEP PRINTING STRING

003C
003C F7 C5 3FFF
0040 75 08
0042
0043
0047
0049
004A
004A
0040
004E
0051
0056

E_MSG

0063 R
0034 R
06 0010 R 01
02

0058 IF
0059 C3
005A
005A
005B
005E
0060
0061

FA
AD 0015 R
E6 BO
F4
EB F1

MFG HALT:
CLI
MDV
DU7
HL 7
JMP

SI,03FFFH
BP,SI
SI

CHECK FOR NOT FIRST ERROR MESSAGE
SKIP IF NOT FIRST ERROR MESSAGE
SAVE MESSAGE POINTER
USE LOW 14 BI TS OF MESSAGE OFFSET
AS FIRST ERROR MESSAGE FLAG
(BIT 0 = E1611E162, BIT t = BAD_CONFIG

WS'

0063

IbO
161
162
163
164
165
166
161
168
169

0063
0063
0066
0061
0068
006B
006C
006E
0010

P _MSG

PROC
MDV
INC
PUSH
CALL
PDP
CMP
JNE
RET

P _MSG

ENDP

2E: 8A 04
46
50
E8 0128 R
58
3C OA
15 F3
C3

(CS:)

170
111

0011

172
173
174
175
176

177
178
179
180
181
182
183
184
185
186
187
188
189

190
191
192
193
194
195

ERR BEEP
9C
FA
OA F6
74 IE
70
0500
OOAF R
C233
00F5 R
CE
EE

0089 IE
008A E8 0034 R
0080 80 3E 0012 R 01
0092 IF
0093 74 C5

202
203
204
205

0095
0095
0091
009A
0090
OOAO
00A3
00A5

206

207
208

209

------------ --- ------------ --

NEAR

CLi
DR
JZ

DH,DH
G3

MDV
MDV
CALL
MDV
CALL
DEC
JNZ

BL.112
CX,I280
BEEP
CX,49715
WAITF
DH
Gl

SAVE FLAGS
DISABLE SYSTEM INTERRUPTS
ANY LONG ONES TO BEEP
NO, DO THE SHORT ONES
LONG BEEPS
COUNTER FOR LONG BEEPS 11-3/4 SECONDS)
DIVISOR FOR 932 HZ
DO THE BEEP
2/3 SECOND DELAY AFTER LONG BEEP
OELAY BETWEEN BEEPS
ANY MORE LONG BEEPS TO DO
LOOP TILL DONE

PUSH
CALL
CMP
PDP
JE

OS
DDS
@MFG_TST,OtH
OS
MFG_HAL T

MANUFACTURING TEST MODE?
RESTORE ORIGINAL CONTENTS OF
YES - STOP BLINKING LEO

SHORT BEEPS
COUNTER FOR A SHORT BEEP (9/32)
DIVISOR FOR 981 HZ
DO THE SOUND
I /2 SECOND DELAY AFTER SHORT BEEP
DELA Y BETWEEN BEEPS
DONE WITH SHORT BEEPS COUNT
LOOP 11 LL DONE

GI:
B3
B9
E8
89
E8
FE
75

'"

197
198
199
200
201

=
.-- ----------------- - PUSHF PROC

;
0011
0011
0072
0013
0075
0017
0017
0079
001C
001F
0082
0085
0087

-- ERR BEEP -------- -------------------------------------------------THIS PROCEDURE WILL ISSUE LONG TONES (1-3/4 SECONDS) AND ONE OR
MORE SHORT TONES (9/32 SECOND) TO INDICATE A FAILURE ON THE
PLANAR BOARD, A BAD MEMORY MODULE, OR A PROBLEM WITH THE CRT.
ENTRY PARAMETERS:
DH = NUMBER OF LONG TONES TO BEEP.
DL
NUMBER OF SHORT TONES TO BEEP.

G3:
B3
B9
E8
89
E8
FE
75

12
04B8
OOAF R
8178
00F5 R
CA
EE

MDV
MDV
CALL
MDV
CALL
DEC
JNZ

BL,I B
CX,I208
BEEP
CX,33144
WAITF
DL
G3

69 8178
E8 00F5 R

MDV
CALL
PDPF
RET

CX,33144
WAITF

SAVE OS REGISTER CONTENTS
(OS)

210
211
212
213
214
215

OOA 1
OOAA
OOAD
OOAE

216

OOAF

5-82

90
C3
ERR BEEP

-

TEST4

ENDP

1/2 SECOND DELAY AFTER LAST BEEP
MAKE I T ONE SECOND DEL A Y BEFORE RETURN
RESTORE FLAGS TO OR I G (NAL SETT I NGS
RETURN TO CALLER

'-3

[BM Personal Computer MACRO Assembler
Version 2.00
TEST4 ---- 06/[0/85
POST AND 8[05 UTILITY ROUTINES

217
216
2 ••
220
22'
222
223
224
225
226
221
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
246
249
2S0
251
252
253
254
255
256
2S7
258
259
260
261
262
263
264
265
266
261
266
269
270
27.
272
273
274
275
276

PAGE
; - -- BEEP - - -- -- - - --------------------- - ------------------------- --- ---ROUT I NE TO SOUND THE BEEPER US I NG T I MER 2 FOR TONE
ENTRY:
(BL)
DURATION COUNTER
( \ FOR 1/64 SECOND I
(CX) = FREQUENCY DIVISOR (1193180/FREQUENCYI (1331 FOR 886 HZ)

=

(AX) ,(BL), (CX)
OOAF
OOAF
0080
0081
00B3
0085
0087
0089
00B8
OOBD
OOBF
OOCI
00C3
OOCS
00C7
00C9
OOCA
OOCA
OOCD
0000
0002
0004
0005
0006
0008
DaDA
OOOC
OOoE
OOEO
00E2
00E3
OOE6
00E9
OOEA
OOEB
OOED
OOEF
OOFI
00F3
00F4

PROC
PUSHF

BEEP
9C
FA
80
E6
E8
8A
E6
E8
8A
E6
E4
8A
OC
E6
90

MODIF[ED.

NEAR

elI
86
43
00
CI
42
00
C5
42
61
EO
03
61

AL,IOIIOIIOB
TIMER+3,AL

"OY
OUT
JMP
MOY
OUT
JMP
"OY
OUT

'.2

AL,CL
TIMER+2,AL

"2

AL,CH
T[MER+2,AL
AL,PORT B
AH,AL
AL,GATE2+SPK2
PORT_B,AL

'N

"OY
OR
OUT
POPF

9C
FA
E4
OC
22
8A
24
E6
90
B9
E8
9C
FA
E4
24
OA
E6
90
C3

040B
00F5 R
CB
F6

CX,1035
WAITF

"OY
CALL
DEe
JNZ

BL
G7

PUSHF

elI
61
FC
EO
C4
FC
61

AL,PORT B
AL,NOT (GATE2+SPK21
AH,AL
AL,AH
AL,NOT (GATE2+SPK21
PORT_B,AL

'N
OR

AND
MOY

AND
OUT
POPF
MOY
CALL
PUSHF

040B
00F5 R

CX,1035
WA ITF

elI

'N

61
03
C4
61

00F5

1t:6~~~2~SPK2

AND

AL,AH
PORT_B,AL

OR
OUT
POPF
RET

BEEP

ENoP

ENTRY:
(CX)

= COUNT

OF 15.085737 MICROSECOND INTERVALS TO WAIT
MEMORY REFRESH TI MER \ OUTPUT USED AS REFERENCE

EXIT:
(CX

~

=0

AFTER

(ex)

TIME COUNT

(PLUS OR MINUS

16 MICROSECONDS)

PROC
PUSH

NEAR

AX

(CX)-15.085131 US
OELAY FOR
SAVE WORK REGISTER (AH)

'N
ANO
eMP
JE

AL.PORT_B
AL, REFRESH 8] T
AL,AH
WA[TFI

USE TIMER
OUTPUT BI TS
READ CURRENT COUNTER OUTPUT STATUS
MASK FOR REFRESH DETERMINE BIT
010 IT JUST CHANGE
WA IT FOR A CHANGE IN OUTPUT LINE

OOFE 8A EO
0100 E2 F4

"OY
LOOP

AH,AL
WAITFI

SAVE NEW FLAG STATE
DECREMENT HALF CYCLES TILL COUNT END

0102 58
0103 C3

POP

AX

RESTORE
RETURN

00F5
00F5 50
00F6
00F6
OOF8
OOFA
OOFC

WAITF
WAITFI:

E4
24
3A
14

61
10
C4
F8

RET

0104

WA[TF

296
299
300
301
302
303
304
305
306
301
308
309
310
31 I
312
313
314
31S

SAVE ] NTERRUPT STATUS
BLOCK I NTERRUPTS OUR I NG UPDATE
GET CURRENT PORT VALUE
I SOLATE CURRENT SPEAKER BITS I N CASE
SOMEONE TURNED THEM OFF OUR I NG BEEP
RECOVER VALUE OF PORT
FORCE SPEAKER DA T A OFF
AND STOP SPEAKER T[MER
RESTORE INTERRUPT FLAG STATE
FORCE I /64 SECOND DELAY (SHORT I
MIN] MUM DEL A Y BETWEEN ALL BEEPS
SAVE I NTERRUPT STATUS
BLOCK INTERRUPT S DUR I NG UPDATE
GET CURRENT PORT VALUE IN CASE
SOMEONE TURNED THEM ON
RECOVER VALUE OF PORT B
RESTORE SPEAKER STATUS
RESTORE [NTERRUPT FLAG STATE

; --- WA I TF --------- - ---------------- - -------------- ------ ---- ------ ----F I XED T I ME WA [T ROUT I NE (HARDWARE CONTROLLED - NOT PROCESSOR I

296
297

SETUP T I MER 2
SAVE [NTERRUPT STATUS
BLOCK I NTERRUPTS OUR I NG UPDATE
SELECT T] MER 2 I LSB I MSB I B] NARY
WRITE THE TIMER MODE REGISTER
I/O DELAY
DIVISOR FOR HZ (LOW)
WRITE TIMER 2 COUNT - LSB
I/O DELAY
DIVISOR FOR HZ (HIGH)
WRITE TIMER 2 COUNT - MSB
GET CURRENT SETT I NG OF PORT
SAVE THAT SETTING
GATE T I MER 2 AND TURN SPEAKER ON
AND RESTORE [NTERRUPT STATUS
I /64 SECOND PER COUNT (BLI
DELA Y COUNT FOR I /64 OF A SECOND
GO TO BEEP DELA Y I { 64 COUNT
(BL) LENGTH COUNT EXPIRED?
NO - CONT I NUE BEEP I NG SPEAKER

G7:
B9
E8
FE
75

271
276
27'
260
26.
282
283
264
285
286
281
288
289
2.0
291
292
2.3
294
295

06-10-85

;- - -

0 I 04
010450
0 I OS 86
0108 E8
0108 OC
010086
OIOF E8
0 I 12 58
01 \3 81
0111 C3
01 18

8E8E
0000 R
20
EO
OOIA R
CD 4000

.

(AHI
(CX)

=0

ENDP
CONF I G BAD ----- -- --------------- -------------- --- ------- ---- -- ----SET-CMOS DIAG WITH CONF]G ERROR B]T (WITH NMI DISABLED~
:
(BP) BIT-'4 SET ON TO INDICATE CONFIGURATION ERROR

CONF [G BAD
- PUSH
MOY
CALL
OR
XCHG
CALL
POP
OR
RET
CONF I G_BAD

PROC

NEAR

AX
AX,X- (CMOS DIAG+NMI)
CMOS READ AL,BAD CONFIG
AH,AL CMOS WR I TE

ADDRESS CMOS DIAGNOSTIC STATUS BYTE
GET CURRENT VALUE
SET BAD CONF[GURATION B[T
SETUP FOR WR I TE
UPDATE CMOS WITH BAa CONF]GURATION

BP,04000H

SET CONFIGURAT[ON BAD FLAG IN

AX

-

(BP)

ENDP

TEST4 5-83

1-4

IBM Personal Computer MACRO Assembler
VerSion 2.00
TEST4 ---- 06/10/85
POST AND 8105 UTILITY ROUTINES

316
317
318
31.
320
321
322
323
324
325
326
321
328
329
330
331
332
333
334
335
336
331
338
339
340
341
342
343
344
345
346
341
348
34.
350
351
352
353
354
355
356
351
358
359
360
361
362
363

364
365
366
367
368
36'
370

PAGE
;--- XPC...,:BYTE --

06-10-85

XLATE~PR

--

PRT~HEX

CONVERT AND PR I NT ASC I I

-----------------------------------

CODE CHARACTERS

AL CONTAINS NUMBER TO eE CONVERTED.
AX AND ex DESTROYED.
0118
0118
0119
OIIC
0 II F
0120

XPC_BYTE
50
CO E8 04
E8 0122 R
58
24 OF

PUSH
SHR
CALL
POP
AND

0 I 22
0 I 22 04 90
012421
0 I 25 14 40
012121

XLAT_PR PROC
ADD
OAA
Aoe

0 I 28
0 I 28
012A
012C
0 12E

PRT _HEX PROC
MOV
"OV
INT
RET

NEAR
PROC
AX
AL,4
XLAT_PR
AX
AL, OFH

DISPLAY TWO HEX DIGITS
SAVE FOR LOW NIBBLE 0 I SPLA Y
NIBBLE SWAP
00 THE HIGH NIBBLE DISPLAY
RECOVER THE NIBBLE
ISOLATE TO LOW NIBBLE
FALL INTO LOW NIBBLE CONVERSION

NEAR
AL,090H

CONVERT OO-OF TO ASC [[ CHARACTER
ADO FIRST CONVERSION FACTOR
AD-JUST FOR NUMERIC AND ALPHA RANGE
ADD CONVERSION AND ADJUST LOW NIBBLE
AD-JUST HIGH NIBBLE TO ASCI [ RANGE

AL,040H

OM

84 OE
B1 00
CD 10
C3

012F
012F
012F

NEAR
AH,OEH
BH,O
IOH

PRT HEX ENDP
XLAT PR ENDP
XPC_BYTE

01 SPLA Y CHARACTER

IN

(AL)

COMMAND

ENDP

; --- PRT SEG ---------------- - - - --- - ------ --------- -- -- ---------PR[NT A SEGMENT VALUE TO LOOK LIKE A 21 B[T ADDRESS
ox MUST CONTAIN SEGMENT VALUE TO BE PRINTED

; ------ - - 012F
012F
0131
0134
0136
0139
0138
013E
0140
0143

8A
E8
8A
E8
80
E8
80
E8
C3

C6
0118
C2
0118
30
0128
20
0128

R
R
R
R

0144

------------ -- -------

PRT SEG PROC
MOV
CALL
"DV
CALL
MDV
CALL
MOV
CALL
RET

NEAR
AL,OH
XPC BYTE
AL,DL
XPC BYTE
AL, '0'
PRT HEX
AL, T •
PRT _HEX

GET MSB
01 SPLA Y SEGMENT HIGH BYTE
LS8
01 SPLA Y SEGMENT LOW BYTE
PRINT A '0 •
TO MAKE LOOK LIKE ADDRESS
ADD ENDING SPACE

PRT SEG ENDP

PUT A CHARACTER TO THE DISPLAY BUFFERS WHEN
(ALJ
101 )

371

372
373

= ASC I I CHARACTER
= 0 I SPLA Y REGEN BUFFER

IN PROTECTED MODE

POS iT I ON

374

315
316
311
318

37.
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
3.7
3.8
3 ••
400
401
402
403
404
405
406
401
408
409
410
411
412
413
414
415
416
411
418
419
420
421
422

0144
0144 06
0145 51
0146 01 E1

PROT PRT HEX
PUSH
PUSH

SAL

PROC
ES

NEAR
SAVE CURRENT SEGMENT REGI STERS

01
DI,I

MULTIPLY OFFSET BY TWO

MONOCHROME V [OED CARD
0148
014A
0148
014C

6A 20
01
AA
4F

PUSH
POP
STOSB
DEC

BYTE PTR C BWCRT PTR
ES
-D[

GET MONOCHROME BUFFER SEGMENT SELECTOR
SET (ES) TO B/W D'ISPLAY BUFFER
PLACE CHARACTER [N BUFFER
ADJUST PO I NTER BACK

ENHANCED GRAPH I CS ADAPTER
0140 6A 30
014F 01
0 I 50 A'A
0151 4F
0152 6A 38
015401
0155 AA
0156 4F

PUSH
POP
STOSB
DEC
PUSH
PDP
STOSB
DEC

BYTE PTR E CCRT PTR
ES
--

01
BYTE PTR E CCRT PTR2
ES
-01

ENHANCED COLOR 0 I SPLA Y PO I NTER LOW 64K
LOAD SEGMENT SELECTOR
PLACE CHARACTER I N BUFFER
AD-JUST PO I NTER BACK
ENHANCED COLOR D I SPLA Y PO [NTER HI 64K
LOAO SEGMENT SELECTOR
PLACE CHARACTER I N BUFFER
AD-JUST PO I NTER BACK

COMPAT I BLE COLOR
0151 6A
0159 01
015A 53
015852
DI5C 51
0150 33
0 15F 8A
0162 93
0163
0163 EC
0164 A8
0166 EI
0 I 68 93
0169 AA
016A
016e
016C
0160
016E
016F

28

C9
03DA

BYTE PTR C CCRT PTR
-ES
8X
OX

SET

lOS)

TO COMPATIBLE COLOR MEMORY

CX,CX
DX,030AH
AX,BX

TIMEOUT LOOP FOR "BAD" HARDWARE
STATUS ADDRESS OF COLOR CARD
SAVE IN IBX) REGISTER

IN
TEST
LOOPZ
XCHG
STOSB

AL,OX
AL. RVRT+RHRZ
PROT S
AX,BX

GET COLOR CARD STATUS
CHECK FOR VERT I CAL RETRACE
TIMEOUT LOOP TILL FOUND
RECOVER CHARACTERS
PLACE CHARACTER I N BUFFER

ex

RESTORE REG I STERS

SAVE WORK REG I STERS

ex

PROT_S:
09
FB

59
5A
5B
5F
01
C3

POP
POP
PDP
PDP
POP
RET

0110

5-84

PUSH
POP
PUSH
PUSH
PUSH
XOR
"DV
XCHG

TEST4

OX
8X

01
ES

(OR HORZ I

1-5

IBM Personal Computer MACRO Assembler
VerSIon 2.00
TEST4 ---- 06/10/85
POST AND 8[05 UTIL[TY ROUTINES

423
424
425

06-10-85

PAGE
; --------- -;
ROM CHECKSUM SUBROUT I NE

---------- ----- ---------- ---

42b

421
428
429
430
431
432
433
434
435
43b

431
438
439
440
441
442
443
444
445
44b
441
448
449
450
4S1
452
453
454
455
45b
451
458
459
4bO
4bl
4b2
4b3
4b4
4b5
4bb
4b1
4b8
4b9

470
411
412
413
414

415
41b
411
418
419
480
481
482
483
484
485
48b
481
488
489
490
491
492
493
494
495
49b
491
498
499
500
50 I
502
503
504
505
506
501
508
509

0170
01702BC9

ROM CHECKSUM
SUB

0172
0172
0174
0174
0176
0177

ROM CHECKSUM CNT:
XOR AL,AL

32 CO
02 07
43
E2 FB

NEAR
NUMBER OF BYTES TO ADD

DR
RET

ROM_CHECKSUM

IS 64K

ENTRY FOR OPT I ONAL ROM TEST
GET (DS:BX)
PO I NT TO NEXT BYTE
ADD ALL 8YTES [N ROM MODULE

ADD
INC
LOOP

O! 79 OA CO
C3

o 17B
o 17C

PROC
CX,CX

AL,AL

=

SUM

01

ENDP

.; - - - - -- --THIS
- -- ----- --- - ---- - ------- - - -- - - -------- ------ - ----------- ----- --ROUT[NE CHECKSUMS OPTIONAL ROM MODULES AND
;
IF CHECKSUM IS OK, CALLS INIT[ALIZATION/TEST CODE IN MODULE
; - - - - - - - - - - --- - -- - -- - ---- - - - --- ----- - - -- - -- - --- - --- - - ---- - ------- - - -- - - -o 17C
017C B8
OI7F 8E
0181 2A
0183 8A
0186 CI
018988
0188 CI
018E 03
0190 E8
0193 74

---- R
CO
E4
47 02
EO 09
C8
E8 04
DO
0172 R
05

ROM CHECK:
MOV
MDV
SUB
MDV
5HL
MDV
SHR
ADD
CALL
JZ

0195 E8 0000 E
0198 E8 13

CALL
JMP

o 19A
o 19A
0198
0lA2
o I A7
01 AC

ROM CHECK I:
POSH
52
26: C7 06 0067 R 0003
MOV
26: 8C IE 0069 R
MDV
26: FF IE 0067 R
CALL
5A
POP

o lAD
o I AD
o IAE

C3

NEAR
PROC
AX,DATA
ES,AX
AH,AH
AL, [BX+2]
AX,9
CX,AX
AX,4DX,AX
ROM CHECKSUM CNT
ROM:=CHECK_I -

;

SET PO I NTER TO NEXT NODULE
DO CHECKSUM

ROM ERR
SHORT ROM_CHECK_END

POST CHECKSUM ERROR
AND EXIT

OX
SAVE POINTER
ES:!!IIO_ROM_INIT,0003H
LOAD OFFSET
ES: 1111 a ROM SEG, OS
j LOAD SEGMENT
DWORD PTR ES:OIO ROM INIT; CALL IN[TIALIZE/TEST ROUTINE
OX

-

-

ROM CHECK ENOl
RET
ROM_CHECK
; - - -

o IAE
01 AE 80 FF
OIBO E8 0000 E
0183 E3 23

j

PROC
NEAR
AL,OFFH
XMIT 8042
GI3

-

0lB5 3C FA
0187 75 IF

CMP
JNZ

AL,KB_ACK
CI3

0189
OIBB
OIBD
o IC2
0lC3
DIGS
0lG7
0lC7
OICC
DICE

80
E6
C6
F8
B3
28

MOV
OUT
MDV

01 NTR_FLAG, 0

DIDO
0102
0104
0104
0106
0108
0 I 08

FE C8
75 F3

SET KEYBOARD RESET COMMANO
GO I SSUE THE COMMANO
EX[T I F ERROR

MOV
SUB

BL,IO
CX,CX

ENABLE KEYBOARD INTERRUPTS
WRITE 8259 [NTERRUPT MASK REGI STER
RESET INTERRUPT INDICATOR
ENABLE INTERRUPTS
TRY FOR 400 M [LL I SECONDS
SETUP INTERRUPT TIMEOUT COUNT

TEST
JNZ
LOOP

(jIINTR _FLAG,02H
GI2
Gil

DID A KEYBOARD I NTERRUPT OCCUR
YES
READ SCAN CODE RETURNED
LOOP TILL TIMEOUT
NO

DEC
JNZ

BL
Gil

TRY AGAIN

IN
MOV

AL,PORT_A
8L,AL

READ KEYBOARD SCAN CODE
SAVE SCAN CODE JUST READ

AL,OFDH
INTAO! ,AL

5T1
OA
C9

RETURN TO CALLER

ENDP

K8D T~~;E~R;~~~~~~-; ~~~-~~~~-~-~;;~;~~~-~~~~~ -~~-~~~-~~;~~~~~~-----SCAN CODE
OAAH
SHOULD BE RETURNED TO THE PROCESSOR.
SCAN CODE
065H
[S DEFINED FOR MANUFACTURING TEST

KBD_RESET
MOV
CALL
JCXZ

FD
21
06 006B R 00

POINT ES TO DATA AREA

; ZERO OUT AH
; GET LENGTH I NO [CA TOR
MULTIPLY BY 512
SET COUNT

GIl:
F6 06 0068 R 02
75 06
E2 F7

,

-

G12:
E4 60
8A 08
G13:
C3

0109

RETURN TO CALLER

RET

KBD_RESET

ENDP

; -------------------------- - -- - --------

SID
511
Sl2
Sl3
Sl4
515
516
517
518
519
520
521
522
523
524

;
;
0109
0109 FB
OIDA 50
0108 E4 80
01003440
OIOF E6 80
OIEI 80 20
0 I E3 E6 20
0lE5 58
0lE6 CF

BLINK I NT
STI
PUSH
IN

525
526

0lE7

BL[NK INT

;

-----------------

BLINK LED PROCEDURE FOR MFG RUN-IN TESTS
IF LED IS ON, TURN IT OFF. IF OFF, TURN ON.

- - - - --- - - -- -- - - - - --- --- - - - - - -- - - ---- - -- - - - ----- ----- - --

XOR

OUT
MOV
OUT
PDP
IRET

PROC

NEAR

AX
AL,MFG PORT
AL,OlOo-00008
MFG PORT, AL
AL,EOI
INTAOO ,AL
AX

SAVE AX REGIStER CONTENTS
READ CURRENT VALUE OF MFG PORT
FLI P CONTROL 8 [T
-

RESTORE AX REGISTER

ENDP

TEST4

5-85

1-6

IBM Personal Computer MACRO Assembler
Version 2.00
TEST4 ---- 06/10/85
POST AND 8105 UTILITY ROUTINES

527
52.
529
530
531
532
533
534
535
536
537
536
539
540
541
542
543
544
545
546
547
54.
549
550
551
552
553
554
555
556
557
55.
559
560
561
562
563
564
565
566
567
56.
569
570
571
572
573
574
575
576
577
578
579
560
561
562
563
564
565
566
567
56.
56.
5'0
591
592
593
5'4
595
596
597
596
59.
600
601
602
603
604
605
606
607
606
60.
610
611
612
613
614
615
616
6"
618
61'
620
621
622
623
624
625
626
627
62'
629
630
631
632
633
634
635
636
637

06-10-55

PAGE

;
;
;
;
;
;
;

---- ---THIS
- ------------- ---- - ---- --- - ---- - ---- - --- - - -- - - - -- -- - -- - - - - - - -- - - - - - - - -ROUTINE INITIALIZES THE TIMER DATA AREA IN THE ROM BIOS
DATA AREA.
IT IS CALLED BY THE POWER ON ROUTINES.
IT CONVERTS
HR:MIN;SEC
FROM CMOS TO TIMER TICS.
IF CMOS IS INVALID, TIMER
IS SET TO ZERO.
INPUT

NONE PASSED TO ROUTINE BY CALLER
CMOS LOCAT IONS USED FOR T I ME

OUTPUT

ttTIMER LOW

;
;
;

!liT I MER-H I GH
;
IPTI MER-OFL
;
ALL REGI STERS UNCHANGED
;
~~~~;~ - ~~~ - - - - - - ~~~ - - -- - ~ ~ - --- - -- - - - - -

0012
0444
0007
0080
o IE7
01 E1
OlEa
01 E9
OIEC
OIEE
OIF!
0lF4
0lF7
0lF9
OIFC
OIFE
0200
0202
0202
0204
0207
0209

60

IE
Ea
2B
A2
A3
A3
80
E8
24
28
75

0034
CO
0070
006C
006E
8E
0000
C4
C9
64

R

COUNTS-M I N
COUNTS-HOUR
UPDATE:::TIMER

EQU
EQU
EQU

SET TOO PROC
PUSHA
PUSH
CALL
SUB

NEAR

R
R
R

MOV
MOV
MOV
MOV

R

CALL
AND

SUB
JNZ

1092
7
10000000B

-- - - ;~~~~ -~~; ~ - ~~~~~~~ ~ ~~ -~~~; ;~~ - - - -- --65543
65536
RTC UPDATE IN PROCESS BIT MASK

OS
DOS
ESTABLI SH SEGMENT
AX,AX
IPTIMER OFL,AL
RESET TIMER ROLL OVER INO[CATOR
oPT I MER-LOW, AX
AND T I MER COUNT
!liT I MER-H I GH, AX
AL, CMOS 0 I AG+NM I
CHECK CMOS VAll 0 ITY
CMOS READ
, READ DIAGNOSTIC LOCATION IN CMOS
AL,BAO BAT+BAo CKSUM+CMOS CLK FAIL
CX,CX -BAD-BATTERY, CHKSUM ERROR, CLOCK ERROR
CMOS NOT VALID -- TIMER SET TO ZERO
POD_DONE

UIP:
CALL
TEST
LOOPZ

AL,CMOS REG A+NMI
CMOS READ
AL, UPDATE T I MER
UIP
-

ACCESS REG I STER A
READ CMOS CLOCK REGISTER A

JCXZ

POD_DONE

CMOS CLOCK STUCK IF Tl MEOUT

MOV

CALL
TEST
LOOPNZ

AL,CMOS REG A+NMI
CMOS READ
AL,UPDATE TIMER
UIPOFF
-

NEXT WAIT TILL END OF UPDATE

0216 E3 4E

JCXZ

POD_DONE

CMOS CLOCK STUCK

0218
021A
0210
021F

80
Ea
3C
77

80
0000 R
59
48

MDV

AL, CMOS SECONOS+NMi
CMOS READ
AL,59H
TOO_ERROR

TIME JUST UPDATED
ACCESS SECONDS VALUE IN CMOS
ARE THE SECONDS WITH[N LIMITS?
GO IF NOT

0221
0224
0226
0229
0228
0220
022F
0231
0234
0236
0238
0238
023C
023E
0240
0241
0244
0246
0248
024A
0240
024F

E8
88
CI
83
F6
03
80
Ea
3C
77
E8
50
01
03
58

027F R
C8
E9 02

CALL

CVT BI NARY
CX,AX
CX,2
BL, COUNTS SEC
BL
CX,AX
AL,CMOS MINUTES+NMI
CMOS READ
AL,59H
TOO ERROR
CVT-B] NARY
AX AX,I
CX,AX
AX

CONVERT I T TO B I NARY
MOVE COUNT TO ACCUMULATl ON REG I STER
ADJUST FOR SYSTEMAT [C SECONDS ERROR

F7
03
80
E8
3C
77

E3
ca
84
0000 R
23

16

JA

0251
0254
0256
0258
025A
025C
025F
0263
OZ66
0266
0267
0268

E8
88
83
F6
03
83
89
A3

027F R
00
07
E3
CI
02 00
16 006E R
D06C R

MOV
MDV
MUL
ADD
ADC
MOV
MOV

0208
0200
0200
020F
0212
0214

0269
0269
026A
0268
026E
0271
0214
0277
0279
OZ7B
027E

80
E8
A8
EI

8A
0000 R
80

F7

E3 59
80
E8
A8
EO

8A
0000 R
80

F1

12
E3
C8
82
0000 R
59
31
027F R
E6
C8

88 0444

CMP

JA
MOV
SHR
MOV
MUL
ADO
MOV

CALL
CMP

JA
CALL
PUSH
SHR
ADD
POP
MOV
MUL
ADD
MOV

CALL
CMP

CALL

TOD ERROR;
POP
POPA

IF
61
BE
E8
B8
E5
DC
86
E8
C3

CALL

POD DONE:
POP
POPA
RET

IF
61
C3

0000
003C
8E8E
0000
04
C4
OOIA

~~,COUNTS_MIN

CX,AX
AL, CMOS HOURS+NM I
CMOS READ
AL,23H
TOO_ERROR
CVT BINARY
DX,AX
8L, COUNTS HOUR
BL
AX,CX
OX,OOOOH
PTIMER HICH,DX
eaT [MER=LOW. AX

[S ON

Os

MDV

S [ ,OFFSET E 163

R

CALL

E MSG

MOV

AX,X· (CMOS o[AG+NMI )
CMOS READ AL,CMOS CLK FAIL
AL,AH
CMOS_WRITE

R

CALL
OR

R

XCHG
CALL

ACCESS REG [STER A
READ CMOS CLOCK REG I STER A

[F TIMEOUT

COUNT FOR SECONDS
ACCESS MINUTES VALUE [N CMOS
ARE THE M[NUTES WITHIN LIMITS?
GO IF NOT
CONVERT I T TO B I NARY
SAVE MINUTES COUNT
A~JUST FOR SYSTEMAT[C MINUTES ERROR
ADD ADJUSTMENT TO COUNT
RECOVER BCD MINUTES VALUE
COUNT FOR M [NUTES
ADD TO ACCUMULATED VALUE
ACCESS HOURS VALUE [N CMOS
ARE THE HOURS WITHIN LIMITS?
GO IF NOT
CONVERT

I T TO B] NARY

COUNT FOR HOUR S

OS

E

RESTORE SEGMENT
RESTORE REGI STERS
01 SPLA Y CLOCK ERROR
SET CLOCK ERROR IN STATUS
READ D[AGNOSTIC CMOS LOCATION
SET NEW STATUS WITH CMOS CLOCK ERROR
MOVE NEW STATUS TO WORK REGI STER
UPDATE STATUS LOCATION

RE7
SET_TOO ENoP

8A
CO
24
05
C3

EO
EC 04
OF
OA

CVT BINARY
MOV
SHR
AND
AAD

PROC
AH,AL
AH,4
AL,DFH

RET

0259

5-86

WAIT TILL UPDATE BIT

UIPOFF:

027F
027F
027F
0281
0284
0256
0288

MOV

CVT_BINARY

TEST4

ENoP

NEAR
UNPACK 2 BCD DIG[TS IN AL
RESULT I SIN AX
CONVERT UNPACKED BCD TO B [NARY

IBM Perl:lonal Computer MACRO Assembler
Version 2.00
TEST4 ---- 06/10/85
POST AND 8[OS UTILITY ROUTINES

b38
b39
b40
b41
b42
b43
b44
b45
b4b
b47
b48
649
650
651
652
653
654
655
656
657
658
b59
660
661
662
663
664
665
666
667
668
669

1-7
06-10-85

PAGE
;--- D11 -- INT
?? H -- ( [RQ LEVEL ?? ) ------------------------------------: TEMPORARY INTERRUPT SERVICE ROUTINE FOR POST
;
TH I S ROUT [NE I S ALSO LEFT [N PLACE AFTER THE POWER ON 0 I AGNOSTI CS
;
TO SERVICE UNUSED INTERRUPT VECTORS.
LOCAT[ON "OINTR FLAG~ WILL
;
CONTAIN EITHER:
;
I) LEVEL OF HARDWARE INTERRUPT THAT CAUSED CODE TO BE EXECUTED, OR
;
2) "FF" FOR A NON-HARDWARE [NTERRUPT THAT WAS EXECUTED ACC I DENT ALL Y •
;
0289
0289
028A
0288
028D
028F
0291
0293
0295
0297

50
53
80
E6
E8
E4
8A
OA
15

Oil

PROC
PUSH
PUSH
"OV
OUT
J"P
IN
"OV
OR
JNZ

AL,INTAOO
AH,AL
AL,AH
HW_INT

0299
029B
0290
0290
029F
02A 1
02A3
02A5
02A7
02A9

84 FF
EB 2F

"OV
J"P

AH,OFFH
SHORT SET_INTR_FLAG

80
E6
EB
E4
8A
OA
74

08
AO
00
AO
F8
FF
10

"OV
OUT
J"P
IN
"OV
OR
JZ

AL,OBH
INT800,AL

E4
OA
E8
E6
80
E8
E6
E8

AI
C7
00
AI
20
00
AD
00

IN
OR
J"P
OUT
"OV
J"P
OU1
J"P

E4
E8
80
OA
E6
EB

21
00
E4 FB
C4
21
00

08
20
00
20
EO
C4
04

NEAR
AX

SAVE REGI STER AX CONTENTS

ex

AL, aBH
INTAOO,AL

'.2

'.2

AL,INTBOO
8H,AL
BH,BH
NOT_SEC

READ IN-SERVICE REGISTER
(FIND OUT WHAT LEVEL BEING
SERVICED}
GET LEVEL
SAVE IT
DO? INO HARDWARE ISR ACTIVE)

SET FLAG TO "FF"

IF NON-HARDWARE

READ IN-SERVICE REGISTER FROM
INTERRUPT CHIP #2
110 DELAY
CHECK THE SECOND INTERRUPT CH I P
SAVE IT
CONT I NUE I F NOT

b10
671
672
673
614
675
676
671
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
691
b98
699

02AB
02AO
02AF
0281
0283
0285
0287
0289
0288
0286
02BO
028F
02C2
02C4
02C6
02C8
02Ce
02CA
02CC
02CC
02CO
02CE
0201
0205
0206
0201
0207

BO 20
E6 20

NOT SEC:
IN
J"P
AND
OR
OUT
J"P
"OV
OUT
I NTR FLAQ:
POP
PUSH
CALL
"OV
POP
POP
DUMMY RETURN I:
IRETSET

58
IE
E8 0034 R
88 26 0068 R
1F
58
CF

0208

-

Oil

700
701

,'2

GET SECOND 1NTERRUPT MASK
MASK OFF LEVEL BE I NG SERV I CEO
I/O DELAY

,'2

SEND EO I TO SECOND CH I P
110 DELAY

INTBOI tAL
AL,EOI
INT800,AL
SHORT IS_SEC

AL,INTAOI

"2

AH,OFBH
AL,AH
INTAOI,AL

,.2

GET CURRENT MASK VALUE
1/0 DELAY
00 NOT
I SABLE SECOND CONTROLLER
MASK OFF LEVEL 8E I NG SERV I CEO
SET NEW I NTERRUPT MASK
110 DELAY

a

AL,EOI
INTAOO,AL

ex
05
ODS
IPINTR FLAG,AH
OS
AX

RESTORE I BX) FROM STACK
SAVE ACTIVE (OS)
SET DATA SEQMENT
SET FLAG
RESTORE REGI STER AX CONTENTS
NEED I RET FOR VECTOR T A8LE

ENDP

;--- HARDWARE INT
71 H -- ( IRQ LEVEL
9 I -- TO INT
; REDIRECT SLAVE INTERRUPT 9 TO INTERRUPT LEVEL 2
TH I S ROUT I NE FIELDS LEVEL 9 I NTERRUPTS AND
CONTROL IS PASSED TO MASTER INTERRUPT LEVEL 2

102
103
104

;

705

10b
107
708
109
110
11!
712
713
714
715
716

AL,INTBOI
AL,BH

0208
0208
0209
0208
0200
020E

50
BO 20
E6 AO
58
CD OA

--- -- - - - - - -- - - -- - - - - - - - - - - - -- - - - - -- -- - - - - - - -- -- - - - - - - - - - - -- - - - - -- - -- - - - -- -- ---

RE 0 I RECT PROC
PUSH
"OV
OUT
POP
INT

02EO CF

NEAR
AX
AL,EOI
[NTBOO,AL
AX
OAH

IRET

02El

OA H -------------------

SAVE

(AX)

EOI TO SLAVE INTERRUPT CONTROLLER
RESTORE I AX I
GIVE CONTROL TO HARDWARE LEVEL 2
RETURN

RE_DIRECT ENDP

117
718

;--- HARDWARE INT
75 H -- ( IRQ LEVEL 13 ) -.---------------------------------; SERVICE X281 INTERRUPTS
;
TH 1 S ROUT I NE FIELDS X281 I NTERRUPTS AND CONTROL
;
I S PASSED TO THE NM I I NTERRUPT HANDLER FOR
;
COMPATIBILITY.

119
120
721

122
123
124
725
726
727
128
129
130
131
732
133
734
735
136
131
738
739
740
741
742
743
744
745
746
747
748
749
750

;
02E 1
02El 50
02E2 32 CO
02E4 E6 FO
02E6
02E8
02EA
02EC
02ED

BO
E6
E6
58
CD

--- -- - - - - -- - - - - - - - - - - -- - - - - - -- -- - - - - - - - -- -- - - - - -- -- - - - - - -- -- - - -- - - - -- - -- - - - ---

INT 287 PROC
PUSH
XOR
OUT

20
AO
20

"OV
OUT
OUT
POP
INT

02

02EF CF
02FO

02F1
02F1

REMOVE THE

AL,EDI
INTBOO,AL
INTAQO,AL
AX
02H

ENABLE THE INTERRUPT
THE SLAVE
THE MASTER
RESTORE (AX)
GIVE CONTROL TO NMI

IRET

SAVE

(AX)
I NTERRUPT REQUEST

RETURN

INT 281 ENDP

-

02FO
02FO
02F2
02F4
02F4
02F5

NEAR
AX
AL,AL
X281,AL

PROC SHUTDOWN

-

BO FE
E6 64

"OV
OUT

-

PROC
AL, SHUT _ CMD
STATUS _PORT ,AL

COMMON 80286 SHUTDOWN WA I T
SHUTDOWN COMMAND
SEND TO KEY80ARD CONTROL PORT

PROC 51
F4
EB FD

HLT
J"P

PROC SHUTDOWN
CODE
ENDS
END

PRDC 5
-

WA I T FOR 80286 RESET
INSURE HALT

ENDP

TEST4 5-87

IBM Personal Computer MACRO Assembler
Version 2.00
TEST5 ---- 06/10/65
EXCEPTION INTERRUPT TEST HANDLERS

PAGE 118,121
TITLE TEST5 ---- 06/10/85
EXCEPTION INTERRUPT TEST HANDLERS
.286C
.LIST
CODE
SEGMENT BYTE PUBl I C

0000

PUBl I C
PUBLIC

8

9

"

12

13

3.

0000
0000
000080
0002 E9
0005
0005 80
0007 E9
00010.
00010. 80
OOOC E9
OOOF
OOOF 80
0011 E9
0014
001480
0016 E9
0019
0019 OE>
00110. 6A
ODIC 07

ASSUME

CS:CODE,DS:ABSO

90
0082 R

MOV
JMP

Al,90H
TEST_EXC

GO TEST

91
0082 R

MOV
JMP

Al.9IH
TEST_EXC

GO TEST

92
0092 R

MOV
JMP

AL,92H
TEST _EXC

GO TEST

93
0082 R

MOV
JMP

AL,93H
TEST_EXC

GO TEST

94
00B2 R

MOV
JMP

AL .94H
TEST_EXC

GO TEST

48

PUSH
PUSH

ES
BYTE PTR ES TEMP
ES
-

POP

36

<><> SET CHECKPOINT <><>
IF EXCEPTION WAS EXPECTED

<><> SET CHECKPOINT <><>
I F EXCEPT I ON WAS EXPECTED

<><> SET CHECKPOINT <><>
I F EXCEPT I ON WAS EXPECTED

<><> SET CHECKPOINT <><>
IF EXCEPTION WAS EXPECTED

<><> SET CHECKPOINT <><>
IF EXCEPTION WAS EXPECTED

LOAD ES REG I STER WITH SELECTOR

F I X 80UND PARAMETERS

37
38
39
40
41
42
43

OOID
001F
0024
00210.
0028
0020

45
46
47
48
49
50
51
52
53
54
55
5E>
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
I 10
III
112
I 13
'14

0030
0030
0032
0034
0034
003E>
0038
0038
00310.
003C
003C
003E
0040
0040
0042
0044
0044
0046
0048
0048
004A
004C
004C
004E
0050
0050
0052
0054
0054
0056
0058
0056
00510.
005C
005C
005E
0060
0060
0062
0064
0064
0066
0068
0068
OO&A
006C
006C
006E
0070
0070
0072
0074
0074
0076
0078
0078
00710.
007C
007e
007E
0080
0080
0082
0084
0084
0086
0088
0088
00810.
008e

4.

POST5
SYSINITI

--- --- --- - - -- -- - - -- - - -- ---- - -- - ----- ---EXCEPTION INTERRUPT ROUTINE
:
; --- ---- -- -- -- -------- ------- -- - - ---- ---;
;

10

I.
15
16
17
18
19
20
21
22
23
2-4
25
26
27
26
29
30
31
32
33
34

I-I
06-10-85

5-88

28 FF
2E>: C7 05 0000
26: C7 45 02 7FFF
07
80 95
E9 0092 R

SUB
MOV
MOV
POP
MOV
JMP

01,01
;
WORD PTR ES: [DI ] ,0
;
WORD PTR ES:[DI+2j,07FFFH
ES
AL,95H
TEST_EXC

POINT BEGINNING OF THE BLOCK
SET FIRST WORD TO ZERO
; SET SECOND TO 07FFFH

BO 96
EB 7E

MOV
JMP

AL,96H
SHORT
TEST_EXC

<><> SET CHECKPOINT <><>
GO TEST IF EXCEPTION WAS EXPECTED

BO 97
EB 7A

MOV
JMP

AL.97H
SHORT
TEST_EXC

GO TEST

BO 98
EB 7E>

MOV
JMP

AL,98H
SHORT
TEST_EXC

GO TEST

BO 99
E8 72

MOV
JMP

AL.99H
SHORT
TEST_EXC

GO TEST IF EXCEPTION WAS EXPECTED

BO 9A
EB 6E

MOV
JMP

AL,9AH
SHORT
TEST _EXC

<><> SET CHECKPOINT <><>
GO TEST IF EXCEPTION WAS EXPECTED

BO 9B
EB 6A

MOV
JMP

AL,96H
SHORT
TEST_EXC

<><> SET CHECKPOINT <><>
GO TEST IF EXCEPTION WAS EXPECTED

BO 9C
EB 66

MOV
JMP

AL ,9CH
SHORT
TEST_EXC

GO TEST

BO 9D
E8 62

MOV
JMP

AL,9DH
SHORT
TEST_EXC

GO TEST

BO 9E
EB 5£

MOV
JMP

AL,9EH
SHORT
TEST _EXC

<><> SET CHECKPOINT <><>
GO TEST IF EXCEPTION WAS EXPECTED

BO 9F
EB 5A

MOV

JMe

AL,9FH
SHORT
TEST_EXC

<><> SET CHECKPOINT <><>
GO TEST IF EXCEPTION WAS EXPECTED

BO AO
EB 56

MOV
JMP

AL,OAOH
SHORT
TEST_EXC

GO TEST

BO AI
EB 52

MOV

AL,OAIH
SHORT
TEST _EXC

GO TEST

80 A2
E8 4E

MOV

AL,OA2H
SHORT
TEST_EXC

GO TEST

BO 10.3
EB 410.

AL,OA3H
SHORT
TEST_EXC

GO TEST

BO A4
EB 46

AL,OA4H
SHORT
TEST_EXC

GO TEST

JMe
JMe

<><> SET CHECKPOINT <><>
GO TEST

IF EXCEPTION WAS EXPECTED

<><> SET CHECKPOINT <><>
IF EXCEPTION WAS EXPECTED
<><> SET CHECKPOINT <><>
IF EXCEPTION WAS EXPECTED

•

<><> SET CHECKPO I NT <><>

<><> SET CHECKPO I NT <><>
IF EXCEPTION WAS EXPECTED

<><> SET CHECKPOINT <><>
IF EXCEPTION WAS EXPECTED

<><> SET CHECKPOINT <><>
IF EXCEPTION WAS EXPECTED

<><> SET CHECKPOINT <><>
IF EXCEPTION WAS EXPECTED

<><> SET CHECKPOINT <><>
I F EXCEPT I ON WAS EXPECTEO

<><> SET CHECKPOINT <><>
I F EXCEPT I ON WAS EXPECTED

<><> SET CHECKPOINT <><>
1F EXCEPT I ON WAS EXPECTED

BO A5
EB 42

MOV

JMe

AL,OA5H
SHORT
TEST _EXC

<><> SET CHECKPOINT <><>
GO TEST IF EXCEPTION WAS EXPECTED

BO A6
E8 3E

MOV
JMP

AL,OA6H
SHORT
TEST_EXC

GO TEST

BO A7
E8 3A

MOV
JMP

AL, 010. 7H
SHORT
TEST_EXC

GO TEST

80 10.8
EB 36-

MOV
JMP

AL,OA8H
SHORT
TEST_EXC

GO TEST

BO A9
EB 32

MOY
JMP

AL,OA9H
SHORT
TEST_EXC

GO TEST

BO AA
E8 2E

MOV
JMP

AL,OAAH
SHORT
TEST_EXC

GO TEST

BO 10.8
E8 210.

MOV
JMP

AL,OABH
SHORT
TEST_EXC

GO TEST IF EXCEPTION WAS EXPECTED

AL,OACH
SHORT
TEST _Exe

<><> SET CHECKPOINT <><>
GO TEST IF EXCEPTION WAS EXPECTED

BO AC

E8 26

TESTS

<><> SET CHECKPOINT <><>
IF EXCEPTION WAS EXPECTED

<><> SET CHECKPOINT ..;><>
IF EXCEPTION WAS EXPECTED

<><> SET CHECKPOINT <><>
I F EXCEPT I ON WAS EXPECTED

<><> SET CHECKPOINT <><>
I F EXCEPT I ON WAS EXPECTED

<><> SET CHECKPOINT <><>
I F EXCEPT I ON WAS EXPECTED

<><> SET CHECKPOINT <><>

1-2
06-10-85

I BM Persona I Computer MACRO Assemb I er
Vers; on 2.00
TESTS ---- 06/10/85
EXCEPTION INTERRUPT TEST HANDLERS
115
I 16
I 17
118
1 19
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142

008C
008E
0090
0090
0092
0094
0094
0096
0098
0098
009A
009C
009C
009E
OOAO
OOAO
00A2
00A4
00A4
00A6
00A8
00A8
OOAA
OOAC
OOAC
OOAE
OOBO
0080

BO AD
EB 22

-

MOV
JMP

AL,OADH
SHORT
TEST _EXC

<><> SET CHECKPO 1NT <><>
GO TEST IF EXCEPTION WAS EXPECTED

MOV
JMP

AL,OAEH
SHORT
TEST_EXC

<><> SET CHECKPO I NT <><>
GO TEST IF EXCEPTION WAS EXPECTED

MOV
JMP

AL,OAFH
SHORT
TEST_EXC

<><> SET CHECKPOINT <><>
GO TEST IF EXCEPTION WAS EXPECTED

MOV
JMP

AL,080H
SHORT
TEST_EXC

GO TEST

MOV
JMP

AL,OBIH
SHORT
TEST_EXC

GO TEST

MOV
JMP

AL,OB2H
SHORT
TEST _EXC

GO TEST

MOV
JMP

AL,OB3H
SHORT
TEST _EXC

GO TEST

MOV
JMP

AL,OB4H
SHORT
TEST_EXC

GO TEST

MOV
JMP

AL,OB5H
SHORT
TEST _EXC

GO TEST IF

MOV

AL , OB6H

EXC 30:

BO AE
EB IE

EXC 31:

-

BO AF
EB 1 A

5Y5 32:

-

BO BO
EB 16

-

IF

I NTERRUPT WAS EXPECTED

<><> SET CHECKPOINT <><>
IF

INTERRUPT WAS EXPECTED

5Y5 34:

-

BO 82
E8 DE

-

<><> SET CHECKPOINT <><>
IF

INTERRUPT WAS EXPECTED

5Y5 35:
BO B3
EB OA

<><> SET CHECKPOINT <><>
IF

INTERRUPT WAS EXPECTED

5Y5 36:

-

BO 84
E8 06

-

<><> SET CHECKPOINT <><>
IF INTERRUPT WAS EXPECTED

5Y5 37 :
BO B5
EB 02
80 86

5Y5 - 38:

<><> SET CHECKPOINT <><>

GO TEST
00B2
00B2 E6 80
00B4 3C AF
00B6 77 I C

TEST EXC:
OUT

INTERRUPT WAS EXPECTED

<><> SET CHECKPO I NT <><>

143
144

145
146
147
148

<><> SET CHECKPOINT <><>

5Y5 33:
BO 81
EB 12

IF INTERRUPT WAS EXPECTED

JA

MFG PORT ,AL
AL IOAFH
TEST_EXCO

PUSH
PUSH
POP
MOV
MOV
PUSH
POP
POP
POP
POP
PUSH
CMP
JNZ

OS
SAVE THE CURRENT DATA SEGMENT
BYTE PTR GOT PTR
OS
OS: ES TEMP. SEG LI MIT, MAX SEG LEN
BYTE PTR OS: (E'S TEMP.DATA Ace RIGHTS) ,CPLO DATA ACCESS
BYTE PTR ES TEMP
-ES
OS
RESTORE REG I STERS
OX
CHECK I F CODE SEGMENT SECOND ON STACK
CX
CX
CX,SYS ROM CS
TEST _EXCO CONTI NUE I F ERROR CODE

eMP

OUTPUT THE CHECK PO I NT
CHECK FOR EXCEPT I ON
GO IF A SYSTEM INTERRUPT

149

150
151
152
153
154
155
156
157
158
159
160
161
162

00B8
00B9
OOBB
008C
00C2
00C7
00C9
OOCA
OOCB
OOCC

1E
6A 08
IF
C7 06 0048 FFFF
C6 06 0040 93
6A 48
07
IF
SA
59
ODeD 51
OOCE 83 F9 40
0001 7501

163

164
165
166
167
168
169
110
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186

0003
0004
0004
0006
0008
OODA
OODC
OODC
OODE
OOEO
00E2

52
86
E4
3A
74

EO
8B
C4
OE

IN
eMP

JZ
TEST EXC I:

-

E4 80
3C 38
72 01
CF

00E3
00E3
ODES
00E7
00E8

86 EO
E6 80
F4
EB F9

OOEA
OOEA
OOEC
OOEE
OOFI

2A CO
E6 88
B8 0 roo
CF

167

IN

CMP
JB

TEST EXC2:
XCHG
OUT
HL T
JMP

TEST EXC3:
SUB
OUT
MOV

OOFD
0100
0101
0104
0 I 05
0108

B8 0800
AB
B8DOAO
AB
B8 0000
AB

WAS THE EXCEPTiON EXPECTED7
GO IF YES
CHECK THE CURRENT CHECKPD I NT
HALT IF CHECKPO I NT BELOW 3SH

AH,AL
MFG_PORT, AL

OUTPUT THE CURRENT CHECK PO I NT
<><> CHECKPOINT 90 THRU B5 <><>

TEST_EXC2

INSURE SYSTEM HALT

AL,AL
OMA PAGE+OAH,AL
AX,0100H

CLEAR DMA PAGE

SYSINITI
81
80
0149 R
EF

NEAR
NO I NTERRUPTS ALLOWED
SAVE BP

PUSH

BP

MOV
OUT

CALL
MOV

AL,81H
MFG PORT ,AL
SlOT BLD
BP,OI

MOV

AX,SYS_IDT_LEN

<><> <> <> <> <> <> <> <><><><>
<><> CHECKPO I NT 8\ <><>

STOSW
MOV
MOV

AX,O

STOSW
SEGOV

ES

OB

aiDA
OIOB
010B
OIOE
OIOB
OIOB
010E
0 I DE

OB

nOOOI

LABEL
MOV

nOOO2

LA8t::L

BYTE

ORG
OB
ORG
MOV

OFFSET CS:??OOOI
OOIH
OFFSET CS: n0002
DI,BP

8B 5E 00

SAVE THE POINTER TO JUST PAST THE [OT
AS WE HAVE NO SDA, USE THE SIX BYTES
HERE TO LOAD THE IDTR.
WE W]LL SlOT
WHEN WE GET TO SOA INITIALlZAT[ON.
SEGMENT LIMIT = LENGTH OF lOT
STORE TI-IAT AS ]OT LIMIT
lOT ADDRESS
AND ACCESS RIGHTS BYTE (UNOEF I NED)
LOAD THE

026H
[BP]
OOFH
BYTE
BX,WORD PTR

LlDT
OF

8B FD

AX , SYS_IDT_LOC

STOSW

010926

01

(INT 5)

CS: CODE ,OS: NOTH I NG ,ES: NOTH I NG, SS: NOTH I NG
PROC

CLI

212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228

FOR BOUND INSTRUCTION EXPECTED
RETURN

THIS BUILDS THE DESCRIPTOR TABLES REQUIRED FOR PROTECTED MODE
PROCESSOR MUST BE IN REAL MODE

202
203
204
205
206
207
208
209
210
211

SAVE THE CHECKPOINT

AL,MFG PORT
AL, 03sR
TEST_EXC2

IRET

ASSUME
FA
55
BO
E6
E8
8B

PUT SEGMENT BACK ON STACK

AH,AL
AL,DMA PAGE+OAH
AL,AH TEST_EXC3

---

,
00F2
00F2
OOF3
00F4
00F6
OOF8
OOFB

OX

IRET

;

186
169

190
191
192
193
194
195
196
197
198
199
200
201

PUSH
TEST EXCO:
XCHG
-

lOT

REG I STER FROM TH] S AREA
[BP]

ES:O]

NOW

--> END OF [DT AGAIN

BUILD THE GOT.
0110 8F
01 13 E8
01 16 88
011888
011B AB

08AO
0140 R
EF
0088

MOV
CALL
MOV
MOV
STOSW

01 ,GOT LOC
GOT BLO
BP,OI
AX,GDT_LEN

SAVE THE ES:DI POINTER
AX = LENGTH OF THE GOT
PUT THAT IN THE LIMIT FIELD

TESTS

5-89

1-3

[BM Personal Computer MACRO Asselllbler
Version 2.00
TEST5 ---- 06/10/55 EXCEPTION INTERRUPT TEST HANDLERS

229
230
231
232
233
23.
235
236
231
236
239
2.0

2.,
2.2
2.3

2"
2.,

2.5
2.6

2'6
2'9
250
251
252
253
25.
255
256
251
256
259
260
261

2.2
263
26.
2.5
266
261
266
269
210
211
212
273
274
275
216
211
216
219
260
261
262
283
26.
265
266
267
266
269
290
291
292
293
29.
295
296
291
296
299
300
301
302
303
30.
305

306
301
306
309
310
311
312
313

31.

315

316
311
316
319
320
321
322
323

OIICB505AO
OIIF AB
0120 B5 0000
0123 AB
0124 26
0125
0126
0126
0129
0126
0126
0129
0129
012B
012C
0120

OF
110004
5B 56 00
170005

aI
5B FO
AB
A8
58 Fo

"OV
STOSW
"OV
STOSW
SEGOV
OB
LGDT
OB
LABEL
"OV
LA8EL
ORG
OB
ORG
"OV
STOSW
STOSW
"OV

06-10-85

AX,GOT_LOC
AX,O

E5
026H
[BP]
OOFH
BYTE
OX, WORD PTR [BP]
BYTE
OFFSET CS:?10004
00 I H
OFFSET CS I 110005
ol,BP

AX '" LOW WORD OF GOT ADDRESS
PUT THAT IN BASE FIELD - LOW
AX '" HIGH BYTE OF ADDRESS, AND
ACCESS RIGHTS BYTE IS UNDEFINED
LOAD THE GDTR
FROM THI S AREA

RESTORE THE ES: D I PO INTER

DI,BP

SW I TCH TO V I RTUAL MODE

o 12F 50
0130 B5 0001
0133 OF 01
0136
0137
0139
013B
013B
0130
o 13F

POP
MOV
LMSW
OB

FO

EA
013B R
0040

-

RESTORE SP
MACH I NE STATUS WORD NEEDED TO
SW I TCH TO V I RTUAL MODE

OOFH,OOIH,OFOH
OEAH
OFFSET DONE
SYS_ROM_CS

OB

Ow

JUMP FAR TO PURGE PRE-FETCH QUEUE
TO OFFSET
I N SEGMENT

DONE:
BO 55
E6 50
C3

"OV
OUT
RET

BE OlAF R
89 0044
F31 A5
C3

0149

0149
014C
014E
0150
0153
0155
0157
015A
015C
015E
0161

BE
BC
5E
BF
2B
8E
BB
B6
82
B9

0161

A5

0162
0164
0165
0167
0168
016B
016C
016E
0171

8B
AB
8B
AB
B8
AB
E2
89
Bo

NEAR
SI,OFFSET GOT DATA START
; DS:SI --> GOT
CX, (OFFSET GOT DATA END-OFFSET GOT DATA START) /2
; WORD COUNT
MOVSW
-; COpy GOT I NTO MEMORY

SloT_BLD

PROC

"OV
"OV
SUB
"OV

"OV
"OV

"OV
"OV
lOT:
MOVSW

"OV
STOSW
MOV
STOSW
"OV
STOSW
LOOP
"OV
"OV

CZ
0000
F3
ODED
0277 R

onc

26
26
26
26
26
26
26
C3

C7
C1
C7
C7
C7
C7
C7

lOT.

NEAR
THE

lOT WILL CONTAIN VECTORS FOR EXCEPTION HANDLERS

SI,OFFSET SYS lOT OFFSETS
; MAKE OS:SI POINT TO
AX,CS
;
INTERRUPT ENTRY POINTS
DS,AX
01, SYS lOT LOC
AX,AX ES,AX
WHERE THE lOT WILL BE.
BX,SYS ROM CS
CS I S THE SAME FOR ALL INTERRUPTS
OH, TRAP GATE
ACCESS RIGHTS BYTE FOR THE GATE
CL,O
THE WORD COUNT FIELD I S UNUSED
THERE ARE 32 RESERVED [NTERRUPTS
CX,32
TH [S LOOP BU I LOS 32 DESCR I PTQRS I N THE
lOT FOR THE RESERVED INTERRUPTS
GET A ROUT I NE ENTR Y PO I NT
AND PUT IT IN THE OFFSET FIELD
AX,BX
GET THE SYSTEM CODE SEGMENT SELECTOR
AND PUT I TIN THE SELECTOR F [ELO
AX,DX
GET THE INTERRUPT GATE BYTE
AND PUT IN THE ACCESS RIGHTS FIELD
AX,O
ZERO OUT
THE RESERVED POS [T I DNS
AND REPEAT AS DIRECTED
LOW lOT
CX,256-32
256 TOTAL - 32 DONE = WHATEVER [S LEFT
BP, OFFSET FREE_ [NTS
THERE IS A COPY OF AN UN-INITIALIZED
[NTERRUPT OEseR I PTOR AT FREE _, NTS

HIGH_lOT:

"OV

OS:SI --> FREE DESCRIPTOR
(ES:OI LEFT OFF AT INT 321
MOVE OFFSET OF THE I RET I NSTRUCT I ON
MOVE THE CS SELECTOR
MOVE THE ACCESS RIGHTS BYTE
ZERO OUT THE RESERVED WORD
FILL THE REMAINDER OF THE TABLE

SI,BP

MOVSW
MOVSW
MOVSW
STOSW
LOOP

06
06
06
06
06
06
06

olAO
DIA8
0180
0188
olCO
DIC8
DIDO

0098
009C
OOAO
00A4
OOA8
OOAC
OOBO

;-----

INITIALIZE THE ENTRY POINTS FOR POST TEST

R
R
R
R
R
R
R

"OV

"OV
"OV
"OV
"OV
"OV
MOV

ES:
ES:
ES:
ES:

(SYS lOT LDC+(032-DESC LEN)
(SYS- I OT-LOC+ (033-0ESC-LEN)
(SYS-IDT-LOC+ I 034·DESC-LEN)
(SYS-IOT-LOC+(035-0ESC-LENI

.ENTRY POINT)
• ENTRY-PO I NT)
.ENTRY-PO I NT)
.ENTRY-POINT)

,OFFSET
,OFFSET
,OFFSET
,OFFSET

SYS 32
SYS-33
SYS-34
SYS-35

~~; i~~~::gi=~gg::g;~:g~~g=~~~: :~~i=~:~g:~i: :g~~~~i ~~~:;~
ESI (SYS::::IDT::::LDC+(038-DESC::::LENI .ENTRY:POINTI ,OFFSET SYS:38

RET

OIAE
OIAE CF

S-90

BUILD THE
MOV
"OV

C3

A5
A5
A5
AS
E2 F8

INITIALIZATION

GOT BLD PROC
MOV
"OV
REP
RET
GOT _BLD ENoP

LOW

0176
0177
0178
0179
017A

SYSTEM
ENDP

0237 R
C5
05
oOAO
CO
CO
0040
87
00
0020

0114
0174 8B F5

<><><><><><> <><><> <> <> <>
<><> CHECKPOINT 82 <><>

AL,55H
MFG_PORT ,AL

SYSINITI

;-----

0183
018A
0191
0198
019F
0lA6
o I AD

AX

OW

0140
0140
0140
0143
0[46
0145
0149

BP
AX, V I RTUAL ENABLE

IRET ADDR
IRET
-

TESTS

LABEL

WORD

; FOR UN- I NIT I AL I ZED
; NULL RETURN

INTERRUPTS

[BM Personal

Computer

TESTS ---- 06/10/85

324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433

MACRO Assembler

EXCEPTION

VersIon

1-4

2.00

06-10-85

INTERRUPT TEST HANDLERS

PAGE

THE FOLLOWING DATA DEFINES THE PRE-INITIALIZED GOT FOR POST TESTS.
THESE MUST BE INITIALIZED IN THE ORDER IN WHICH THEY APPEAR IN THE
GDT_DEF STRUCTURE DEFINITION AS IT IS IN "SYSDATA.INC".
~

OlAF

GDT_DATA_START

EQU
(UNUSED_ENTRY)

FIRST ENTRY UNUSABLE
OlAF
D1BI
0183
0184
0185

SEGMENT LIMIT
SEGMENT BASE ADDRESS - LOW WORD
SEGMENT BASE ADDRESS - HIGH BYTE
ACCESS RIGHTS BYTE
RESERVED - MUST BE ZERO

DW
DW

0000
0000
00
00
0000

DB
DB

DW
THE GOT

ITSELF

0181 0088
0189 D8AD

DW
DW

GOT LEN
GDT-LOC

00
DIBC 93
01BD 0000

DB
DB

CPLO DATA ACCESS

0188

DW

o

THE SYSTEM
OIBF 0800

DIGI

DOAD
o IC3 00
Q1C4 93
DIGS 0000

[DT DESCRIPTOR

DW
DW
D8

SYS lOT LEN
SYS-IDT-LOC

DB

CPLO DATA ACCESS

DW

SEGMENT LIMIT
SEGMENT BASE ADDRESS - LOW WORD
SEGMENT BASE ADDRESS - HIGH BYTE
ACCESS RIGHTS BYTE
RESERVED - MUST BE ZERO

o -

o o

ISYS_IDT_PTR)
SEGMENT LIMIT
, SEGMENT BASE ADDRESS - LOW WORD
; SEGMENT BASE ADDRESS - HIGH BYTE
I ACCESS RIGHTS BYTE
; RESERVED - MUST BE ZERO

-

-

-

THE SYSTEM DATA AREA DESCRIPTOR

o IC7 0300
OlG9 0400
ICB 00
a I CC 93

DW
DW
D8
D8
DW

o

OIGD 0000

SDA LEN
SDA-LOC

-

IRSOA_PTR)
SEGMENT LIMIT
SEGMENT BASE ADDRESS - LOW WORD
SEGMENT BASE ADDRESS - HIGH BYTE
ACCESS RIGHTS BYTE
RESERVED - MUST BE ZERO

o CPLO OAT A ACCESS
o -

COMPATIBLE MONOCHROME DISPLAY REGEN BUFFER

o ICF

1000
0101 0000
0103 OB
0104 93
0105 0000

DW
DW
D8
D8
DW

MCRT SIZE
MCRT@ LO
MCRT<> <> <><><><><><><><><>
,
<><> CHECKPOINT
32 <><>
; RESTORE AX (SET AX TO ZERO)
; EXIT IF PARITY ERROR

64K ADDRESS TEST AND FILL WITH ZERO

OEC

AX

SUB
MOV
SUB
STOSW
INC
REP

01,01
CX,8X
CX,2

DEC

AX

STOSW
SUB
MOV
SUB
LOOSW
XOR
JNZ

WRITE FIRST AND LAST LOCATION=FFFF
POINT TO START OF 8LOCK
GET THE BLOCK COUNT
00 ALL LOCATIONS BUT LAST
WRITE FIRST LOCATION AS FFFFH
WR I TE ZERO
WRITE [T
LAST WORD 1S FFFF

AX
STOSW

S I, S I

POINT TO START OF BLOCK
GET THE 8LOCK COUNT

CX,BX
CX,2

GET THE DATA
CHECK CORRECT
EXIT IF NOT

AX ,OFFFFH
CI3

CI2A:
AD
OB
EI
75
AD
35
75

LOOSW
OR
LOOPZ
JNZ
LOOSW
XOR
JNZ

CO
F8
A2
FFFF
9C
; -----

OOEC
OOEE
OOEF
00F2

;
;
;

CHECKPOINT 32 FOR ADDRESS LINE 0->15 FAILURE
MOV

;-----

AL,PORT 8
AL,AH
AL,OMA PAGE+6
AH,AL -

2B FF
A8
8F FFFE
AB

AX ,OFFFFH
CI3

CLEAR WORD 0 AND FFFE
SUB
STOSW
MOV
STOSW

; -----

GET NEXT DATA
ANY 81T ON ?
CONTINUE TI LL LAST WORD
GO I F NOT CORRECT
GET LAST WORD
S/8 FFFF
EXIT IF NOT

AX,AX
C!2A
CI3

CLEAR FIRST WORD

01,01
0 I ,OFFFEH

CHECK FOR

;

CLEAR TOP WORD

I/O OR 8ASE MEMORY

221
222
223
224
225
226
227
228

00F3
00F5
OOFl
00F9
00F8
OOFE
0100

5-94

E4
86
E4
22
B8
EB

61
C4
81
EO
0000
88

IN
XCHG
IN
ANO
MOV

JMP
STGTST_CNT

TEST6

AL,PORT 8
AL,AH
AL ,OMA PAGE+6
AH,AL AX,O
CI3
ENOF

CHECK FOR I/O - PARITY CHECK
SAVE ERROR
CHECK FOR R/W OR I/O ERROR
SET AX EQUAL ZERO
ERROR EX I T IF ZF NOT SET

1-3

IBM Per50nal Computer MACRO A55embler
Ver5,on 2.00
TEST6 ---- 06/10/85
POST TESTS AND SYSTEM BOOT STRAP

229
230
231
232
233
234
235
236
237
236
239
240
241
242
243
244
245
246
247
246
249
250
251
252
253
254
255
256
257
256
259
260
261
262
263
264
265
266
267
266
269
270
271
272
273
274

275
276
277
276
279
260
261
262
263
264
265
266
267
266
269
290
291
292

293
294
295
296
297
296
299
300
301

302
303
304
305
306
307
306
309
310
311
312
313
314
315
316
317
316
319
320

PAGE

;- -;~ ~ ~~ - ~~~~~~ ~ - ~~~ - ~;;~~ - ~~~ ~~;~ - ;~~ - ~;~ - ~~~~~ ~~~ - ~;~~; ~ - -- - - - - - - - - --- --

~~~

0100
0100
a 1a 1
0102
0103
a I 06
0108
0109
010A
Dl0C

011181 FA C8DO
01151COO
0111 E8 0000 E
aliA BE 0000 E
0110 E8 0000 E
0120
0120 58
012! 01
0122 5A
0123 C3
0124
0124 BA 0 I 02
0121 E8 0000 E
OIZA EB F4
o 12C

-

~~;

-

52
06
50
B8 ---- R
8E CO
58
50
8C DA
26: 88360015 R

- ;;;; - - - -

~~~;

- - - - - - --- -- - -- -- - - - - -- - - -- ---- - - - -- --- - ------- - - - - ----

PUSH
PUSH
PUSH
MOV
MOV
POP
PUSH
MOV
MOV

OX
ES
AX
AX,DATA
ES,AX
AX
AX
DX,DS
ES: IIIMFG_ERR _FLAG, DH

C"P

DX,OC8DOH
ROM ERR BEEP
PRT-SEGS I ,OFFSET F3A
E_MSG

JL
CALL
"OV
CALL
ROM ERR END:
-POP
POP
POP

SAVE POINTER
SET ES TO DATA SEGMENT
RESTORE AX
GET ADDRESS POINTER
<> <> <> <> <> <> <> <> <> <> <> <><><>
<><> CHECKPOINTS CO->F4 <><>
OJ SPLAY CARD IN ERROR?
GIVE OISPLAY CARD FAIL BEEP
PRINT SEGMENT IN ERROR
D I SPLA Y ERROR MESSAGE

AX
ES
OX

RET
ROM ERR BEEP:
-MOV
CALL

; BEEP I LONG, 2 SHORT
DX,DI02H
ERR SEEP
SHORT ROM_ERR_END
J"P
ROM_ERR ENDP
; - - - - - - - - - - - -- -- - - - - - - - - - - - - - - - - - - -- - - -- - - - -- -- - ---; TH IS SUBROUTI NE SENDS AN OUTPUT COMMAND TO THE KEYBOARD ANO
RECE I VES THE KEYBOARD RESPONSE.
ENTRY REQU I REMENTS:
AL
COMMAND/DATA TO BE SENT
EXIT PARAMETERS:
ZERO FLAG = I IF ACK RECE J VED FROM THE KEY BOARD
AL = RESPONSE

-

-

----

---

------

=

~~ ~ ~ ~ ~ ~~;

o 12C

;- - - - -

o 12C

86 EO
012E 2B C9
0130
0130 E4 64
0132 A8 02
0134 EO FA
0136 E3 34
0138 86 EO

AL,STATUS PORT

~~ i +~66pBOF _FULL

JCXZ

SHORT XMIT EXIT
AH,AL
-

CHECK

I NPUT SUFFER FULL

RESTORE COMMAND

1 SSUE THE COMMAND
SEND THE COMMAND
SET LOOP COUNT

OUT
SUB

;- - - - 64
EO
01
02
60
C4 02
Fl
10

SAVE COMMAND
SET LOOP TIME-OUT

AH,AL
CX,CX

TEST
LOOPNZ
XCHG
;-----

E4
8A
A8
14
E4
F6
EO
15

I NPUT BUFFER FULL

IN

E6 60
013C 2B C9

013E
0140
0142
0144
0146
0148
014B
0140

- ;;;; -- ~~~; - - - ----- - -- ------ - - - ---- -- - - - -- -- - --- - - - --- -- - ---

CHECK

XCHG
SUB
XMITLOOP:

o 13A

CHECK OUTPUT SUFFER FULL

XMIT_I:

IN
"OV
TEST
JZ
IN
XMIT_2: TEST
LOOPNZ
JNZ

AL,STATUS PORT
AH,AL
-

SAVE STATUS
CHECK IF B042 HAS DATA
GO IF NOT
FLUSH DATA
CHECK COMMAND ACCEPTED

~~ i ~U~_BUF JULL
AL,PORT A
AH, I NPT-SUF FULL
XMIT I SHORT XMIT_EXIT

NO FLUSH OR COMMAND NOT ACCEPTED

CHECK OUTPUT BUFFER FULL
014F
0151
0153
0155
0151
0159
015B
0150
015F
0161

S3
2B
E4
A8
EI
15
FE
15
FE
EB

06
C9
64
01
FA
08
CB
F4
C3
09

"OV
XMIT_3:

SUB
IN
TEST
LOOPZ
JNZ
DEC
JNZ

INC

J"e

SET COUNT
SET LOOP COUNT

BL,6
cX,ex
AL,STATUS PORT
AL, OUT SUF FULL
XMIT 3XMIT-4
BL
SHORT XMJT 3
BL
SHORT XMIT_EXIT

CHECK I F HAS OATA
WAIT TILL DONE
DECREMENT OUTER LOOP
TRY AGAIN
SET ERROR FLAG
8042 STUCK BUSY

GET THE DATA
0163 2B C9

XMiT_ 4:

SUB

CX,CX

0lb5
0161
0169
016C
16C
0160

XMIT_5:

LOOP

XMJT 5
AL,PORT A
CX,OIH -

a

E2 FE
E4 60
83 E9 01
C3

IN
SUB
XMIT EXIT:
RET
XMIT_B042 ENDP

ALLOW T I ME FOR POSS IBLE
ERROR -> SYSTEM UNIT OR KEYBOARD
SET

ex

OTHER THAN ZERO

;--- BOOT_STRAP -- INT
19 H -------------------------BOOT STRAP LOADER
TRACK 0, SECTOR I I S READ I NTO THE
BOOT LOCATION (SEGMENT a OFFSET 1COO)
AND CONTROL I S TRANSFERRED THERE.

321

322
323
324
325
326
327
326
329
330
331
332
333
334
335
336
337
336
339
340
341
342

06-10-85

I F THERE
;

; ----

[S A HARDWARE ERROR CONTROL

[S

TO THE ROM BAS I e ENTRY PO [NT
-- - TRANSFERRED
- - - - - - - -- - -- - - - ---- - - - - ------- - ----- - - - - --- - - -ASSUME CS:CODE.DS:ABSO,ES:ASSO

OlbO
0160 B8 ---- R
0110 8E 08
0112 8E CO

SOOT_STRAP _I

"OV
"OV
"OV

PROC
AX,ABSO
DS,AX
ES,AX

NEAR
;

ESTABLISH ADDRESSING

RESET THE 0 I SK PARAMETER TABLE VECTOR
0114 C1 06 0018 R 0000 E
017A 8C OE 001A R

"OV
"OV

TEST6 5-95

1-4
06-10-85

IBM Personal Computer MACRO Assembler
Version 2.00
TEST6 ---- 06t I 0/85
POST TESTS AND SYSTEM BOOT STRAP

343
344
345
346
347
34B
349
350
351
352
353
354
355
356
357
35B
359
360
361
362
363
364
365
366
367
36B
369
370
371
372
373
374
375
376
377
37B
379
380
381
382
383
384
385
3B6
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426

CLEAR IIIBOOT_LOCN
017E
0180
0183
0186

33 CO
B9 0100
BF 7COO R
F31 AB

0188
0189
o 18C
0180
o 18F
0191

FB
B9 000451
B4- 00
CD 13
72 OF

0193
0196
0198
o 19A
0190
01 AO
01 A2
a I A3
o lAS
o IA8
01 AA
01 AC

BB
2B
8E
BB
B9
CD
59
73
80
74
E2
EB

XDR
MDV
MDV
REP

;-----

HI:

020 I
02
C2
7COO R
000 I
13
H2:

09
FC 80
22
EO
1E
;-----

01 AE 80 3E 7COO R 06
01 B3 72 71

H4:

AX,AX
CX,256
01 ,OFFSET IIIBOOT LOCN
STOSW
-

CLEAR 256 WORDS

;

LOAD SYSTEM FROM DISKETTE -- CX HAS RETRY COUNT
ST1
MDV
PUSH
MDV
1NT
JC

CX,4
CX
AH,O
13H
H2

SET RETRY COUNT
I PL SYSTEM
RESET THE DISKETTE SYSTEM
DISKETTE 10
IF ERROR-;- TRY AGA I N

MDV
SU8
MDV
MDV
MDV
1NT
PDP
JNC
CMP
JZ
LOOP
JMP

AX,20lH
DX,DX
ES,DX
8X. OFFSET 'lISOOT LOCN
CX, I
13H
CX
H4
AH,80H
H5
HI
SHORT H5

DRIVE 0, HEAD a
SECTOR I, TRACK 0
DISKETTE 10
RECOVER RETRY COUNT
CARRY FLAG SET 8Y UNSUCCESSFUL READ
IF TIME OUT, NO RETRY
TRY FIXED DISK
DO I T FOR RETRY TIMES
TRY FIXED DISK

REAO I N THE SINGLE SECTOR
TO THE BOOT LOCATION

800T RECORD READ SUCCESSFUL
INSURE FIRST 8YTE OF LOADED 800T RECORD
eMP
J8

BYTE PTR (!0800T LOCN,06H
HIO
-

IS VALID

INOT ZERO)

; CHECK FOR FIRST INSTRUCTION INVALID
; IF 800T NOT VALID PRINT MESSAGE HALT

INSURE DATA PATTERN FIRST 8 WORDS NOT ALL EQUAL
01 B5 BF 7COO R
0lB8 B9 0008
0lB8 AI TCOO R

o 18E
OICI
o IC3
o IC5

83
3B
EI
74

C7 02
05
F9
5F

H4A:

MDV
MDV
MDV

01 ,OFFSET 'lI800T LOCN
CX,8
AX,WORD PTR @800T_LOCN

CHECK OAT A PATTERN
CHECK THE NEXT 8 WORDS

ADD
CMP
LOOPZ
JZ

01,2
AX, [01
H4A

PO I NT TO NEXT LDCA T I ON
CHECK DATA PATTERN FOR A FILL PATTERN

0lC7 EA 7COO ---- R

1

HIO

SOOT NOT VAll 0 PR I NT MESSAGE HALT

@800T_LOCN
ATTEMPT BOOTSTRAP FROM FIXED DISK

a I CC BO 44
OICE E6 80

H5:

o I DO

EB 0000 E
0103 F6 06 0088 R 01

----

0108 BB
o lOB 8E 08
DIDO 74 3D

R

MDV
OUT
ASSUME
CALL
TEST
ASSUME
MDV
MDV
JZ

AL,044H
MFG PORT, AL
DS:OATA
DDS
@LASTRATE,DUAL
DS:ABSO
AX,ABSO
OS,AX
H9

CHECK FOR FIXED DISK

o IDF
o lEI
a IE4
01 E6

BO
EB
AB
75

DE
0000 E
08
34

a IE8
OlEA
a IEC

2B CO
28 02
CD 13
OIEE B9 0003
OIFI
a lFI 51
01 F2 BA 0080
01 F5 B8 020 I
OlF8 2B 08
OIFA 8E C3
OIFC 88 7COO R
01 FF 89 000 I
0202 CD 13
0204 59
0205 72 08
0207 81 3E 7DFE R AAS5
0200 74 88

<><><><> <> <> <> <> <> <> <> <>
<><> CHECKPO[NT 44 <><>
FLOPPY/FIXEO DISK CARD

INSTALLED

ESTABL I SH ADDRESS I NG
GO

IF NOl

INITIALIZATION ERROR

MDV
CALL
TEST
JNZ

AL,CMOS DIAG
CMOS READ
AL,HF FAIL
H9
-

GET POST POWER ON STATUS (NMI ENABLED)
FROM 0 I AGNOST I C STATUS BYTE
DID WE HAVE A FIXED DISK FAILURE?
GO IF YES

SUB

AX,AX
DX,DX
13H
CX,3

RESET D! SKETTE

PUSH
MOV
MOV
SUB
MOV
MOV
MOV
INT
pap
JC
CMP
JZ

CX
DX,0080H
AX,020IH
8X,BX
ES ,8X
BX. OFFSET (!OBOOT LOCN
CX, 1
-

SAVE RETRY COUNT
FIXED DISK ZERO
READ IN A SINGLE SECTOR

PUSH
MDV

ex

SUB
1NT
MDV

RETRY COUNT

H6:

13H

TO THE BOOT LDCAT I ON
SECTOR I, TRACK a
FILE I/O CALL
RECOVER RETRY COUNT

CX
H8
WORD PTR @800T LOCN+5100,OAA55H
H4_A
-

;

TEST FOR GENERIC BOOT BLOCK

427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456

020F
0210
0213
0215
0217
0218
021A

51
8A
2B
CD
59
72
E2

H8:
0080
CO

SUB

13

1NT
PDP

Je

08
05

LOOP

DX,0080H
AX,AX
13H

ex
HIOA
H6

UNABLE TO
021 C 80 45
021 E E6 80
0220 CD

H9:

18

0222 E2 E8
0224 E8 F6

F[XED DISK ZERO
RESET THE F I XED 0 I SK
FILE 110 CALL
RESTORE LOOP COUNT
IF ERROR, TRY AGAIN
DO [T FOR RETRY T[MES

[PL FROM THE DISKETTE OR F I XED 0 I SK

MDV
OUT

AL,045H
MFG_PORT, AL

1NT

18H

;-----

HARD FILE RESET FAILURE

Hl0A:

LOOP
JMP

H8
H9

<><><><><> <> <> <> <> <> <> <>
<><> CHECK PO I NT 45 <><>
GO TO RES I DENT BAS I C

TRY RESET AGAIN
GO TO RES I DENT BAS I C

[F DISKETTE READ OK BUT BOOT RECORD
0226 8E 0000 E
0229 E8 0000 E
022C E8 FE
022E
022E
022E

5-96

TEST6

HIO:

MOV
CALL
HI I:
JMP
BOOT STRAP I
PDST6
ENDP
CODE
ENDS
END

SI,OFFSET E602
E MSG
HII
ENDP

[S NOT STOP SYSTEM ALLOW SOFT RESET

; PR [NT 0 I SKETTE BOOT
; PRINT MESSAGE

IBM Per~onQl Computer MACRO A~~embler
OSKETTE -- 06/10/85
DISKETTE BIOS

I

2
3
4
5
6
7
8

9
10

"

12
13
14
15

0000

Ver~ion

2.00

I-I

06-] 0-85

PAGE 118,121
TITLE DSKETTE -- 06/10/85
DISKETTE BIOS
.266C
.LlST
CODE
SEGMENT BYTE PUBL I C
PUBLIC
PUBL I C
PUBL I C
PUBLIC

OISK INT 1
SEEKDSKETTE SETUP
DISKETTE_IO_'

EXTRN
EXTRN
EXTRN
EXTRN

CMOS READ:NEAR
DDS:NEAR
DISK BASE:NEAR
WAITF:NEAR

READ CMOS LOCATION ROUTINE
LOAD (OS) WITH DATA SEGMENT SELECTOR
DISKETTE PARAMETER TABLE LOCATION
FIXED WAIT ROUTINE - (CXI·'5.086 US

16

17

18
19
20
21

22
23
24
25
26

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

I NT 13H ----- ------------ -- - -- ------------------- ------------------------DISKETTE I/O
THIS INTERFACE PROVIDES ACCESS TO THE 5 1/4" DISKETTE DRIVES
320/360K DiSKETTE DRIVES AND 1.2M DISKETTE DRIVES SUPPORTED
INPUT
(AH)= OOH
RESET DISKETTE SYSTEM
HARD RESET TO NEC, PREPARE COMMAND, RECAL I BRATE REQU I RED
ON ALL DR I VES
(AH)= 01H

READ THE STATUS OF THE SYSTEM INTO
ODSKETTE_STATUS FROM LAST OPERATION

IAH)
IS USED

REGISTERS FOR READ/WRITE/VERIFY/FDRMAT
(DL) - DRIVE NUMBER 10-1 ALLOWED, VALUE CHECKED)
(DH) - HEAD NUMBER (0-1 ALLOWED, NOT VALUE CHECKED)
(CHI - TRACK NUMBER (NOT VALUE CHECKED)
MED 1 A
DR I VE
TRACK NUMBER
320/360
320/360
0-39
3201360
1.2101
0-39
1.2M
1.2M
0-79
720K
720K
0-79
(CLI - SECTOR NUMBER INOT VALUE CHECKED, NOT USED FOR FORMATI
MED I A
DR I VE
SECTOR NUMBER
320/360
320/360
1 -6/9
320/360
t .2M
1-6/9
1.2M
1.2M
1-15
720K
720K
1-9
(ALI - NUMBER OF SECTORS (NOT VALUE CHECKED)
MED I A
DR I VE
MAX NUMBER OF SECTORS
320/360
320 f 360
8/9
320/360
1.2101
8/9
1~2M
1.2101
15
720K
720K
9
(ES:BXI

-

ADDRESS OF BUFFER

( REQUIRED FOR VERIFY)

5.

(AH)= 02H

READ THE DESIRED SECTORS

55
56
57

(AH)= 03H

WRITE THE DESIRED SECTORS FROM MEMORY

58

(AH) = 04H

59
60

(AH)= 05H

61

62
63

6.
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
BO

BI
B2
B3

8.
B5
B6

B7
BB
B9

90
91
92
93

9'
95
96
97
9B
99
100
101
102
103
104
105
106
107

INTO MEMORY

VER I FY THE OES I RED SECTORS
FORMAT THE DESIRED TRACK
FOR THE FORMAT OPERATION, THE BUFFER POINTER IES,BX) MUST
POINT TO THE COLLECTION OF DESIRED ADDRESS FIELDS FOR THE
TRACK.
EACH F 1ELD I S COMPOSED OF 4 BYTES, I C, H, R, N), WHERE
C = TRACK NUMBER" H=HEAD NUMBER, R = SECTOR NUMBER, N= NUMBER
OF BYTES PER SECTOR 100=128, 01=256, 02=512, 03=1024,1
THERE MUST BE ONE ENTRY FOR EVERY SECTOR ON THE TRACK.
TH I 5 I NFORMA TI ON I S USED TO F I NO THE REQUESTED SECTOR OUR I NG
READ/WRITE ACCESS.
PRIOR TO FORMATTING A DISKETTE, IF THERE EXISTS MORE THAN
ONE SUPPORTED MEO I A FORMAT TYPE WITH IN' THE DR I VE I N QUEST I ON.
THEN "SET DASD TYPE" II NT 13H, AH = 1 7H I MUST BE CALLED TO
SET THE DISKETTE TYPE THAT IS TO BE FORMATTED.
IF "SET DASD
TYPE" IS NOT CALLED, THE FORMAT ROUTINE WILL ASSUME THE
MEDIA FORMAT TO BE THE MAXIMUM CAPACITY OF THE DRIVE.
IN ORDER TO FORMAT 320/360K MEDIA IN EITHER A 320/360K OR
1.2M DISKETTE DRIVE THE GAP LENGTH FOR FORMAT PARAMETER
OF DISK BASE MUST BE CHANGE TO 050H.
ALSO THE EDT
PARAMETER (LAST SECTOR ON TRACK) MUST BE SET TO THE
DESIRED NUMBER OF SECTORS/TRACK - 6 FOR 320K, 9 FOR 360K.
DISK BASE IS POINTED TO BY DISK POINTER LOCATED AT
ABSOLUTE ADDRESS 0:76.
WHEN 320/360K FORMAT OPERATIONS ARE COMPLETE, THE PARAMETERS
SHOULD BE RESTORED TO THEIR RESPECTIVE INITIAL VALUES.

(AH 1= 06H
REG I STERS
INPUT
(DL I OUTPUT
IES:OI)
(CHI (CLl I DH I (DLI IBH) IBL~
-

READ DR I VE PARAMETERS

DR I VE NUMBER

(0 - I

ALLOWED,

V ALUE CHECKED I

POINTS TO DISK BASE
LOW ORDER 8 OF 10 BITS MAXIMUM NUMBER OF TRACKS
BITS 7 & 6 - HIGH ORDER TWO BITS OF MAXIMUM TRACKS
BITS 5 THRU 0 - MAX I MUM SECTORS PER TRACK
MAX I MUM HEAD NUMBER
NUMBER OF DISKETTE DRIVES INSTALLED
0
BITS 7 THRU 4 - 0
BITS 3 THRU 0 - VALID DRIVE TYPE VALUE IN CMOS
(AX) - 0
UNDER THE FOLLOWING CIRCUMSTANCES:
11) THE DRIVE NUMBER IS INVALID,
(2) THE DR I VE TYPE I S UNKNOWN AND CMOS I S NOT PRESENT,
131 THE DR I VE TYPE I S UNKNOWN AND CMOS I S BAD,
141 OR THE DRIVE TYPE IS UNKNOWN AND THE CMOS DRIVE TYPE IS
THEN ES,AX,BX,CX,DH,OI=O ; DL=NUMBER OF DRIVES.
IF NO DRIVES ARE PRESENT THEN: ES,AX,BX,CX,OX.DI=O.
@DSKETTE_STATUS = a AND CY I S RESET.

DISKETTE

INVALID

5-97

IBM Personal Computer MACRO Assembler
DSKETTE -- 06/10/85
DISKETTE BIOS

108
109

110
III

112
113
114
115
116
117
118
119
120

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
13'
140
141
142

143

147
148

149
150
151
152
153
154
155
156

157
158

159
160
161
162

163
164
165
166
167
168

I

~2

06-! 0-85

PAGE

; ---;
;
;

I AH) = 15H
READ DASD TYPE
REGISTERS
(AH) - ON RETURN I F CARRY FLAG NOT SET, DTHERW I SE ERROR
00 - DRIVE NOT PRESENT
01 - DISKETTE, NO CHANGE LINE AVAILABLE
02 - DISKETTE, CHANGE LINE AVAILABLE
03 - FIXED DISK
IOL) - DRIVE NUMBER 10-1 ALLOWED, VALUE CHECKED)

;
;

;
;
;

; -------------------- - ---- -- --- ---- - - -- -- -- ------ - - - - ---- --- --------------- ---;
;
;
;
;

IAHI= 16H
DISK CHANGE LINE STATUS
REGISTERS
IAH)=OO - DISK CHANGE LINE NOT ACTIVE
06 - DISK CHANGE LINE ACTIVE & CARRY BIT ON
IDL) - DRIVE NUMBER 10-1 ALLOWED, VALUE CHECKED)

IAHI = 17H
SET DASD TYPE FOR FORMAT
REGI STERS
(ALl 00 - NOT USED
01 - DISKETTE 320/360K IN 360K DRIVE
02 - DISKETTE 360K IN 1.2M DRIVE
03 - DISKETTE 1.2M IN 1.2M DRIVE
04 - DISKETTE 720K IN 720K DRIVE
(DU - DRIVE NUMBER (0-1 ALLOWED, VALUE CHECKED;
DO NOT USE WHEN D[SKETTE ATTACH CARD USED)

;

----- --- -- - - -------- ----- ----- -- - - - - -- -- -------- ---- ---- ---

;

0 I SK CHANGE STATUS [S ONLY CHECKED WHEN A I . 2M BYTE 0 [SKETTE
DRIVE [S SPEC[FIED.
[F THE DISK CHANGE LINE IS FOUND TO BE
ACT J VE THE FOLLOW J NG ACT IONS TAKE PLACE:
ATTEMPT TO RESET DISK CHANGE LINE TO [NACTIVE STATE.
[F ATTEMPT SUCCEEDS SET DASD TYPE FOR FORMAT AND RETURN DISK
CHANGE ERROR CODE
[F ATTEMPT FAILS RETURN TIMEOUT ERROR CODE AND SET DASD TYPE
TO A PREDETERMINED STATE INDICATING MEDIA TYPE UNKNOWN.
I F THE 0 I SK CHANGE LINE I N I NACT I VE PERFORM SET DASD TYPE FOR FORMAT.

;
:
;
;

144

145
146

Version 2.00

;
;
; DATA VARIABLE -- @DISK POINTER
;
DOUBLE WORD PO I NTER TO THE CURRENT SET OF 0 I SKETTE PARAMETERS
;----- ------- - -------- ------ -------- -- -- -----------------; OUTPUT FOR ALL FUNCT IONS
AH
STATUS OF OPERATION
;
STATUS BITS ARE DEFINED IN THE EQUATES FOR @DSKETTE STATUS
;
VAR[ABLE IN THE DATA SEGMENT OF TH[S MODULE
;
CY
0
SUCCESSFUL OPERATION (AH=O ON RETURN, EXCEPT FOR READ DASD
;
TYPE AH=11511.
;
CY = 1 FAILED OPERATION IAH HAS ERROR REASON)
;
FOR READ/WR[TE/VERIFY
;
OS, BX, OX, CX PRESERVED
;
NOTE: IF AN ERROR IS REPORTED BY THE DISKETTE CODE, THE APPROPR[ATE
;
ACT I ON I S TO RESET THE 0 I SKETTE. THEN RETRY THE OPERAT I ON.
ON READ ACCESSES, NO MOTOR START DELAY [S TAKEN, SO THAT
;
THREE RETRIES ARE REQU[RED ON READS TO ENSURE THAT THE
;
PROBLEM IS NOT DUE TO MOTOR START-UP.

=
=

; DISKETTE STATE MACHINE .LI ST

ABSOLUTE ADDRESS 40:90

(DRIVE M

91

&

(DR[VE B)

169

ITO
ITI
1T2
1T3
1T4
1T5
1T6

I
I
I

RESERVED

ITT

1T8
I T9

000 :
001:
010:
011 :
100 :
101 :
110:
III:

180
181
182

183
184
185
186

187

UNESTABLISHED
UNESTABLISHED
UNESTABLISHED
ESTABLISHED
ESTABLISHED
ESTABLISHED

---> MEDIA/DRIVE ESTABLISHED

188
189

------->

190
191
192

193
194
195
196
19'
198
199

I
I
PRESENT STATE
360K IN 360K DRIVE
360K IN 1.2M DRIVE
1.2M IN 1.2M DRIVE
360K IN 360K DRIVE
360K IN 1.2M DRIVE
1.2M IN 1.2M DRIVE
RESERVED
NONE OF THE ABOVE

DOUBLE STEPPING REQUIRED
DR[VE)

(360K

IN

1.2M

--> DATA TRANSFER RATE FOR THIS DRIVE:
00: 500 KBS
01: 300 KBS
10: 250 KBS
1 1: RESERVED
LIST

200

20 I

STATE OPERATION STARTED -

ABSOLUTE ADDRESS 40 92

(DR[VE A)

&

93

IDRIVE BI

PRESENT CYLINDER NUMBER

ABSOLUTE ADDRESS 40 94

(DRIVE A)

&

95

IDRIVE BI

202

203
204

5-98

DISKETTE

IBM Personal Computer MACRO Assembler
OSKETTE -- 06/10/85
DISKETTE 8105

205
20.
201
208
209
210
211
212
213
214
215
21.

1-3

Version 2.00

06-10-85

PAGE
0000
0000
0001
0002
0003
0004
0005
0006

ASSUME
.LlST
DISKETTE 10 1
5TlPUSH
PUSH
PUSH
PUSH
PUSH

FB

55
51
52
53
51
88 EC

CS: CODE ,OS: DATA, ES :DATA
PROC

FAR

BP

DI
DX
BX

ex

MOV

BP,SP

PUSH
PUSH
CALL

DS

CMP

~~~~~~g_TAE-FNC_TA8) 12

217
218
21.
220
221
222
223

224
225
22.
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
241
248
249
250
251
252
253
254
255
25.
257
258
25.
2.0

0008
0009
OOOA
0000
0010

1E
56
E8 0000 E
80 FC 18
12 02

0012
0014
0014
0011
0019
001C
ODIE
0021
0023
0025
0025
0021
0029
002B
002E
0030
0032
0034
0036
0038
003C

B4 14
80
16
80
14
80
16
B4

FC 01
DC
FC 08
01
FA 01
02
14

8A
32
00
B8
03
8A
32

CC
ED
El
004E R
09
E6
F6
Fa
FA
26 0041
06 0041

88
8B
8A
C6

.JB
MOV

OK FUNC:
CMP
.JBE
CMP

.JZ
CMP

.JBE
MOV
MOV
XOR

SHL

00

MOV
ADO
MOV
XOR
MOV
MOV
MOV
MOV

51
DOS

I NTERRUPTS BACK ON
USER REG I STER
USER REG I STER
HEAD II, DRIVE' OR USER REGISTER
BUFFER OFFSET PARAMETER OR REGISTER
TRACK '-SECTOR' OR USER REGISTER
BP
=> PARAMETER LIST DEP. ON AH
[8P]
= SECTOR'
[BP"'11 = TRACK'
[BP+2j = BUFFER OFFSET
FOR RETURN OF DR I VE PARAMETERS:
CLI[BP] :: BITS 7&6 HI BITS OF MAX CYL
BITS 0-5 MAX SECTORS/TRACK
CH/[BP+I] = LOW 8 BITS OF MAX CYL.
BL/[8P+2] = BITS 7-4 = 0
BITS 3-0 :: VALID CMOS TYPE
BHI tBP+3] = 0
DLI[BP"'4] = , DRIVES INSTALLED
DHI (BP+5] = MAX HEAD ,
Dl/[BP+6] = OFFSET TO DISK BASE
BUFFER SEGMENT PARM OR USER REG I STER
USER REGISTERS
SEGMENT OF 81 OS OAT A AREA TO OS
CHECK FOR > LARGEST FUNCT I ON
FUNCT ION OK

AH,14H

REPLACE WITH KNOWN

AH,I
OK DRV
AH-;-8
OK ORV
DL-;-I
OK DRV
AH-;-14H

RESET OR STATUS ?
IF RESET OR STATUS DR I VE ALWAYS OK
READ DRIVE PARMS ?
IF SO DRIVE CHECKED LATER
DR IVES 0 AND I OK
IF 0 OR I THEN JUMP
REPLACE WITH KNOWN I NVAL I D FUNCT I ON

CL,AH
CH,CH
CL,I
~~:g~FSET FNC_TAB

CL :: FUNCT I ON
CX = FUNCT I ON
FUNCTION TIMES 2
LOAD START OF FUNCTION TABLE
ADO OFFSET INTO TABLE => ROUTINE
AX = HEAD "." OF SECTORS OR CASD TYPE
OX = DRIVE'
5 I = HEAD " , ' OF SECTORS OR OASD TYPE
01 = DRIVE"
LOAD STATUS TO AH FOR STATUS FUNCTION
INITIALIZE FOR ALL OTHERS

AH,OH
DH,DH
51 ,AX
DI,DX
AH,oOSKETTE STATUS
*OSKETTE_STATUS, 0

INVALID FUNCTION

THROUGHOUT THE DISKETTE BIOS, THE FOLLOWING INFORMATION IS CONTAINED IN
THE FOLLOWING MEMORY LOCATIONS AND REGISTERS. NOT ALL DISKETTE BIOS
FUNCTI ONS REQU I RE ALL OF THESE PARAMETERS.

2.,
2.2

DI

2.3

51-HI
51-LOW

2.4

ES

2.5

[BP]
[BP+I]
[BP+2]

2 ••
2.7
2.8

2.'
270

I DRIVE"
: HEAD"
I # OF SECTORS OR DASO TYPE FOR FORMAT
I BUFFER SEGMENT
: SECTOR'
: TRACK"
: BUFFER OFFSET

ACROSS CALLS TO SUBROUTINES THE CARRY FLAG ICY= I), WHERE INDICATED IN
SUBROUT I NE PROLOGUES, REPRESENTS AN EXCEPT I ON RETURN (NORMALLY AN ERROR
CONDITION). IN MOST CASES, WHEN CY
1, ttDSKETTE STATUS CONTAINS THE
SPECIFIC ERROR CODE.
; (AHI = ODSKETTE STATUS
, CALL THE REQUESTED FUNCT I ON
CALL
WORD PTR CS; [BX]
, RESTORE ALL REG 1STERS
POP
51

=

271

272
273
274
275
276
211
218
219
280
281
282
283

»> ENTRY PO I NT FOR ORG OEC59H

0041
0044
0045
0046
0041
0048
0049
004A
0048

2E: FF 11
5E
IF
59
58
SA
SF
50
CA 0002

284
285
286
281
288
289
290
291
292
293
294
295
296
291
298
299
300
301
302
303
304
305
306
301
308
309

004E 001E
0050 00E8
0052 00F4
0054 0 I 00
0056 010C
0058 01 18
005A 016A
005C 016A
OOSE 0114
0060 016A
0062 016A
0064 016A
0066 016A
0068 016A
006A 016A
006C 016A
006E 016A
0010 016A
0072 016A
0074 016A
0076 016A
0078 021A
007A 023C
007C 0261
= 001E

310
311

007E

R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R

POP
POP
POP
POP
POP
POP

RET

OS

ex
BX

DX

DI
BP
2

; THROW AWAY SAVED FLAGS

,--- ------------- - - ------------ - -- - ---- - ----------------- - - - - - - - ---- ------ - --=

FNC TA8 OW
OW
OW
OW
DW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW

DISK RESET
DISK-STATUS
DISK-READ
DISK-WRITE
DISK-VERF
DISK-FORMAT
FNC ERR
FNC-ERR
0 I SK PARMS
FNC ERR
FNC-ERR
FNC-ERR
FNC-ERR
FNC-ERR
FNC-ERR
FNC-ERR
FNC-ERR

AH
AH
AH
AH
AH
AH
AH
AH
AH
AH
AH
AH
AH
AH
AH
AH
AH

OW
OW
OW
OW
OW
FNC_TAE EQU

FNC-ERR
FNC-ERR
DISK TYPE
DISK-CHANGE
FORMAT SET
S
-

AH ::
AH =
AH =
AH ::
AH =
END

DISKETTE_IO_'

ENOP

g:

~~g=~~~

:~

00;
01,
021
:: 03;
041
= 05;
:: 06;
:: 01;
081
= 09;
:: OA;
:: 08;
OC;
00;
:: OE;
OFI
101

=
=
=
=
=
=
=
=

: :~;

RESET
STATUS
READ
WRITE
VERIFY
FORMAT
INVALID
INVALID
READ DR I VE PARAMETERS
INVALID
INVALID
INVALID
INVALID
INVALID
INVALID
INVALID
INVALID

:~~:~:g

131 INVALID
14; INVALID
15; READ DAse TYPE
161 CHANGE STATUS
1 7, SET DASD TYPE

DISKETTE

5-99

IBM P.rsonat Comput.r MACRO Assembler
OSKETTE -- 06/10/85
DISKETTE BIOS

312
313
314
315
310
317
318
319

320
321
322
323
324
325
320
321
328
32.
330
331
332
333
334
335
330
331
338
33.
340
341
342
343
34'
345
340
341
348

...
350
351
352
353

3.'
355
350
3.,
358
35.
360

301
302
303
304
305
300
301
308
30'
310

311

312
313
314
315
310
311
318
31.

.8."0
'"
•••
'"
"0

1-----------------------------------------------------------------------------I DISK_RESET;
RESET THE DISKETTE SYSTEM.
; ON EXITI

O~~H

OOSA
OOSC
OOSO
0092
0094
0096
0091
0098
0098
~090

OOAO
OOAO
OOA I
00A4
00A5
OOAl
OOAA
OOA$
OOAE
OOAF
OOBI
aOB5
00B7
0089
008C

SA
FA
AO
24
CO
OC
EE
C6
EB
OC
EE
FB
E8
12
B9
51
88
50
84
E8
sa
Ea
59
72
3A
75
FE
80
76

03F2
003F R
3F
CO 04

01 SK RESET
MOV
eLI
MOV
ANO
ROL

OR

08

OUT
MOV
JMP

06 003E R 00
00
04

OR
OUT

OOEO R
08
01BO R
08A4 R

CALL
Je
MOV
NXT DRV:
PUSH
MOV
PUSH
MOV
CALL
POP
CALL
POP

JC

30
OE 0042 R
2A
CI
F9 C3
E2

eMP
JNZ
INC
eMP
JBE
;-----

OOI3E
OOCI
00C2
00C4
00C7
00C9
ooee
OOCF
000 I
0004
00Q7
0008
0008
OODB
0000
OODF

88 0008
50
84 03
~8 07BD
2A 02
Ea 06Ce
E8 078D
B2 01
Ea 06CC
E8 0180
58

ADAPTER CONTROL PORT
NO INTERRUPTS
GET DIGITAL OUTPUT REGISTER REFLECTION
KEEP SELECTED AND MOTOR ON 81 TS
MOTOR VALUE TO HIGH NIBBLE
DR I VE SELECT TO LOW NIBBLE
TURN ON I NTERRUPT ENABLE
RESET THE AOA~TER
SET RECAI-IBRATE REQU I RED ON ALL DR I VES
WAIT FOR 1/0
TURN OFF RESET BI T
RESET' THE ADAPTER
ENABLE THE INTERRUPTS
WA I T FOR THE INTERRUPT
I F ERROR. RETURN IT
CL.:
EXPECTED .NEC_STATUS

~~:~~~T~~T~~ATUS
~L,4

AL,OOOOIOOOB
DX,AL
.SEEK STATUS,O
1+2 AL, 00000 I OOB
DX,AL
WAIT INT
OR ERR
CX-;-IIOOOOOOB

=

ex

SAVE FOR CALL
~OAD NEC_OUTPUT ERROR ADDRESS

~~, OFFSET DR_PDP_ERR

SENSE INTERRUPT STATUS COMMAND

AH,08H
NEC OUTPUT
AX RESULTS

THROW AWAY ERROR RETURN
READ I N THE RESULTS
RESTORE AFTER CALL
ERROR RETURN
TEST FOR OR I VE READY TRANS I T I ON
EVERYTH 1NG OK
NEXT EXPECTED ONEC STATUS
ALL POSS I BLE DR I VES CLEARED
FALL THRU IF 110001 OOB OR >

ex

DR ERR
CL-;-IlINEC STATUS
DR ERR eLCL,IIOOOOIIB
NXT_ORV

SEND SPECIFY COMMAND TO NEC

R

MOV
PUSH
MOV
CALL

R

SUB

R
R

CALL
CALL
MOV
CALL
CALL
POP

R
R

AX.OFFSET RES8AC
AX
AH, 03H
NEC OUTPUT
DL.DL
GET PARM
NEC:-OUTPUT

LOAD ERROR ADDRESS
; PUSH NEC OUT ERROR RETURN
I

~~~~~~Y TE~M~~~~AND

NEC-OUTPUT
AX -

FIRST SPECIF:Y 8YTE
GET PARA~ETER TO AH
OUTPUT THE COMMAND
SECOND SPEC I FY ,8YTE
GET PARAMETER TO AH
OUTPUT THE COMMAND
POP ERROR RETURN

SETUP END
BX.SIAL.8L

VARIOUS CLEANUPS
GET SAVED AL TO BL
PUT BACK FOR RETURN

g~;.TpARM

RES8AC:
Ea 0620 R
88 DE
8A C3
C3

OOEO
OOEO 59
OOEI
OOEI 150 OE 0041 R 20
00E6 E8 Fa
OOEa

CALL
MOV
MOV
RET
DR POP ERRI
- POP

OR
JMP
01 SK_RESET

ex

CLEAR STACK

ODSKETTE STATUS,BAD NEC
SHORT RESBAC
ENDP

SET ERROR CODE
RETURN FROM RESET

,- ------------------------------- ----- --------------- ---------------- - - --- ---'-

; DISK_STATUS:

ENT~YI

: ON

OOEa
00E8 1515 26 0041 R
OOEC E8 0620 R
OOEF 88 DE

~~~~ ~~

C3

00F4

OISKETTE STATUS.

AH : STATUS OF PREVIOUS OPERATION

; ON EXITa

AH. 1lI0SKETTE STATUS. CY REFLECT STATUS OF PREVIOUS OPERATION.

01 SK STATUS

PROC
NEAR
IlIQSKETTE STATUS.AH
SETUP_END
BX,SI
AL.BL

,-------- -------------------=-------- ------- --------- ------ ----------- -- -------

MOV
CALL
MOV
MOV
RET
DISK_STATUS
;
; DISK_READI
;
; ON ENTRY:
I

DI
51-HI
S I-LOW

ES

[BP]
[ BP t l ]

(~P+2~

ON EXIT:

00F4
00F4
00F9
OOFC
OOFF
0.00

DRIV.E •
HEAD.
• OF SECTORS
I BUFFER SEGMENT
I SECTOR.
TRACK #
BUFFER OFFSET

ltOSKETTE STATUS, CY REFLECT STATUS OF OPERATION

b;~~-~~~~-------;~~~----~~~~-------------------------- ------------------------80 26 003F R 7F
Ba E646
E8 03SC R
C3

-

~~~

:~~~~~4~~ AT!JS, a 1 1 1 I 11 18

CALL
RET

RD_WR_VF·

01 SK READ

ENDP

; OISK WRITE:
;
; ON ENTRY:

DISKETTE WRITE.

; !~O! C~~~ ~O:~~~D ~P~:~ T 6g~MANO
; COMMON READ/yt'RITE/VERIFY

,---=--------------------------------------------------------------------------

412

-

01

:
51-HI
I
51-LOW :
:
:
BP+11 :
8P+2
:

EI~P]
ON EXIT:

0100
0100 Ba C54A

5-100

: ~~~ I ~~~K C[~~N~~~UP _ENO
; GEt SAVED AL TO 8L
; PUT ~ACK FOR RETURN

ENDP
---------------------------- ---- - -- -------- - - - -------- - - - - - - - - - - - - - - - - - -- ---DISKETTE READ.

411

41.
410
417
418
41'
420
421
422
423
424
425

----=---:----------- --- -------- -- -- ------------------ ---- ---

PROC
NEAR
DX,.03F2H

SJI
081C R
44
OOCO

•• 5

.,..,3

ODSKETTE STATUS, CY REFLECT STATUS OF OPERATION

1- -: - -- .. ------------ ..

007E
007E
0081
0082
00S5

•• 2

3.7
3.8
3"
400
401
402
403
'04
405
400
401
408
40.
410

06-10-85

PAGE

~80

381
382
38.
.84
.85
.80
.81
.88

1-4

Version 2.00

DRIVE #
HEAD #
# OF SECTORS
BUFFER SEGMENT
SECTOR #
TRACK #
BUFFER OFFSET

ODSKETTE STATUS. CY REFLECT STATUS OF OPERATION

b~~;-;~~~~------;~~~----~~~~- --------------------------------------------------

DISKETTE

-

MOV

AX, OC54AH

I AX

=

NEC COMMANO, DMA COMMAND

IBM Personal Computer MACRO Assembler
DSKETTE -- 06/10/85
DISKETTE BIOS
426
427
428
429
430
431
432
433
434
435
436
437

438
439
440
441
442
443
444
445
446
447
448

0103 80 OE 003F R 80
0108 E8 035C R
a I 08 C3
01 OC

OR
CALL

450
451
452
453
454
455
456
457
45'
459
460
461
462
0118
463
0118 E8 02C8 R
464
011B E8 03CE R
465
aIlE 80 OE 003F R 80
466
0123 E8 0416 R
467
0126 7237
468
0 I 28 E8 0451 R
469
01 2B BO 4A
470
0120 E8 0471 R
471
0130 72 2D
472
0132 B4 40
473
0134 E8 04C7 R
474
0137 B8 015F R
475
013A 50
476
013B B2 03
477
01 3D E8 06CC R
478
0140 E8 07BD R
479
0143 B2 04
480
0145 E8 06CC R
481
0146 E8 07BD R
482
014B B2 07
483
014D E8 06CC R
484
0150 E8 07BD R
485
0153 B2 08
486
0155 E8 06CC R
487
0158 E8 07BD R
488
015B 58
489
015C E8 0530 R
490
015F
491
01 5F E8 02EE R
492
0162 E8 0620 R
493
0165 8B DE
494
0167 8A C3
495
0169 C3
496
0 I 6A
497
49'
499
500
501
502
503
016A
504
016A 8B C6
505
016C B4 01
506
016E 88 26 0041 R
5070172F9
508
0 I 73 C3
5090174
510
511
512
513
514
515
516
517
510
519
520
521
522
523
524
525
526
527
520
529
530
531
532
a 174
533
0 I 74 81 FF 0080
534
0 I 78 72 06
535
530
537
538
017A 8B C6
539
017C B4 01

~~~~-~~~~
-

01
SI-H[
S [-LOW
ES
[BP]
[BP+I]
[BP+2]

: DRIVE #
: HEAD #
: # OF SECTOR S
: BUFFER SEGMENT
: SECTOR #
: TRACK #
: BUFFER OFFSET

IttDSKETTE_STATUS, CY REFLECT STATUS OF OPERATION

ON EXIT:

449

IttMOTOR STATUS,IOOOOOOOB ; INDICATE WRITE OPERAT[ON
RD WR \IF
; COMMON READ/WR[TE/VERIFY

RET
DISK_WRITE
ENDP
; - - - - -- - - - -- - ------------------DISKETTE VER [FY •
DISK_VERF:
ON ENTRY:

0 I OC
OIOC 80 26 003F R 7F
a I I 1 88 E642
0114 E8 035C R
0117 C3
0118

1-5
06-10-85

Version 2.00

PROC

AND

NEAR

: !~D!C~~~ ~O~~~~D~P~~~T~g~MANO
RD_WR_VF
; COMMON READ/WRITE/VERIFY
RET
o [SK_ VERF
ENDP
; ---- --- - - - - -- -- ---------------------- -- ------ -- -- -- - -----D[SK_FORMAT:
DISKETTE FORMAT.

"oV

=~~6~~4~~ATUS,011111118

CALL

,
;

ON ENTRY:

01
S I-H [
S I -LOW
ES
[BP]
[BP+lj
[BP+2]

ON EXIT:

@DSKETTE_STATUS,

~ ~ ~~

DRIVE #
HEAD #
# OF SECTORS
BUFFER SEGMENT
SECTOR #
TRACK #
BUFFER OFFSET
CY REFLECT STATUS OF OPERATiON

- ~~~~~ ~ - - -- - ~~~~ - - - - ~~~~ - - - - - - -- - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - --

-

CALL
CALL
OR
CALL
.JC
CALL
MOV
CALL
.JC
MOV
CALL
MOV
PUSH
MOV
CALL
CALL
MOV
CALL
CALL
MOV
CALL
CALL
MOV
CALL
CALL
POP
CALL

XLAT NEW
FMT TNIT
@MOTOR STATUS,IOOOOOOOB
MED CHANGE
FM BON
SEND RATE
AL. 04AH
DMA SETUP
FM BON
AH-;-04DH
NEC IN[T
AX. OFFSET FM DON
AX
DL,3
GET PARM
NEC-OUTPUT
DL,4
GET PARM
NEC-OUTPUT
DL,"1
GET PARM
NEC-OUTPUT
DL,"8
GET PARM
NEC-OUTPUT
AX NEC_TERM

TRANSLATE STATE TO PRESENT ARCH.
ESTABLISH STATE IF UNESTABLISHED
INDICATE WRITE OPERATION
CHECK MEO [A CHANGE AND RESET [F SO
MED I A CHANGED, SK [P
SEND DATA RATE TO CONTROLLER
W[LL WR I TE TO THE 0 I SKETTE
SET UP THE DMA
RETURN WITH ERROR
ESTABLISH THE FORMAT COMMAND
INITIALIZE THE NEC
LOAD ERROR ADDRESS
PUSH NEC OUT ERROR RETURN
BYTES/SECTOR VALUE TO NEC

CALL
CALL

XLAT OLD
SETUP_END
BX,SI
AL,BL

TRANSLATE STATE TO COMPATIBLE MODE
VAR 10US CLEANUPS
GET SAVED AL TO BL
PUT BACK FOR RETURN

MOV
MOV

SECTORS/TRACK VALUE TO NEC
GAP LENGTH VALUE TO NEC
F [LLER BYTE TO NEC
THROW AWAY ERROR
TERM[NATE, RECEIVE STATUS, ETC.

RET
DISK FORMAT

ENDP

;
;

STATUS.

:

-~~~~~~~- ~-----~~~~~~;-~~~~~~;~ -~~~~~~~~;-;~-~ ~~ ~~~; -;~~ ~~~-~~~-~~;-~;~MAND
ON EX[T:

@DSKETTE_STATUS,

IN

CY REFLECT STATUS OF OPERATION

~~~-~~~-~~~~--- - ~~~~-------- -------- ----- I ~~~~~;-;~~~~~;~-~~~~~ST
-

MOV
MOV
MOV
STC

AX. S I
AH, BAD CMD
@DSKETTE_STATUS,AH

RESTORE AL
SET BAD COMMAND ERROR
STORE IN DATA AREA
SET CARRY INDICATING ERROR

RET
FNC _ERR ENDP
01 SK_PARMS:

READ OR I VE PARAMETERS.

ON ENTRY:

0 [ : DRIVE #

ON EXIT:

CLI [BP]

=

CHI [BP+ 11
BLI [BP+2]
BH/
DLI
DH/
01/
ES

[BP+3]
[BP+4]
[8P+5}
[BP+6]

AX
NOTE

6 ~ ~~

~ ~~~~

-

------

eMP
.JB

~~;~

B[TS 7 & 6 H[GH 2 BITS OF MAX CYLINDER
B[TS 0-5 MAX SECTORS/TRACK
= LOW 8 B[TS OF MAX CYLINDER
=B[TS7--4=0
BITS 3-0 = VALID CMOS DRIVE TYPE
~

0

'" # DRIVES INSTALLED
IVALUE CHECKED)
MAX HEAD #
= OFFSET OF 0 I SK BASE
= SEGMENT OF 0 I SI< BASE
'" 0
-

=

THE ABOVE INFORMATION IS STORED IN THE USERS STACK AT
THE LOCATIONS WHERE THE MAIN ROUT[NE WILL POP THEM
I NTO THE APPROPR I ATE REG I STERS BEFORE RETURN I NG TO THE
CALLER.

----

~~~~

DI,80H
DISK_P2

---------------------------------------;
;

CHECK FOR FIXED MEDIA TYPE REQUEST
CONT[NUE [F NOT REQUEST FALL THROUGH

F [XED 0 I SK REQUEST FALL THROUGH ERROR
MOV
MOV

AX, S I
AH,BAD_CMD

;
;

RESTORE AL WITH CALLERS VALUE
SET BAD COMMAND ERROR [N I AH)

DISKETTE

5-101

IBM Personal Computer MACRO Assembler
OSKETTE -- Ob/l0/85
DISKETTE BIOS

5.0
541
5.2
5.3
5 ••
5.5
5.6

547
5 ••
5.9
550
551
552
553
55.
555
556
557

55.
559
560
561
562
563
56.

565
566
567
56.
569
570
571
572
573
57.

575
576
577
57.
579
580
581
582
583

5 ••
5.5
586

017E F9
C3

01B2
01B5
01 B7
01B9
01BB
o 1BO

88 46 02
FE C8
00 EO
8A 08
32 FF
2E: 8B SF 0214 R

CALL
MOV
MOV
AND
MOV
eMP
JZ

XLAT NEW
WORD-PTR [8P+2] ,0
AX,G!lEQUIP FLAG
AL,I10000018
DL,2
AL,Ol0000018
01 SK_P3

TRANSLATE STATE TO PRESENT ARCH.
DRIVE TYPE
0
LOAD EQU I PMENT FLAG FOR # 0 I SKETTES
KEEP 0 I SKETTE DR I VE BITS
DISKETTE DRIVES
2
2 DRIVES INSTALLED?
IF YES .JUMP

DEC
CMP
JNZ

DL
AL, 0000000 18
DISK_P8

DISKETTE DRIVES = 1
1 DRIVE INSTALLED?
IF NO .JUMP

MDV
CMP
JA
MOV
CALL
Je
DR
JZ
CMP
.)A

[8P+4j ,DL
01,1
DISK P9
BYTE-PTR{BP+5],1
CMOS TYPE
DISK-P4
AL,AL
DISK P4
AL, (DR PTE-DR
DISK_P4
-

STORE NUMBER OF DR I VES
CHECK FOR VALID DRIVE
DRIVE INVALID
MAX I MUM HEAD NUMBER
1
RETURN DR I VE TYPE IN AL
IF CMOS SAD CHECKSUM ESTABLISHED
TEST FOR NO DR I VE TYPE
.JUMP IF SO
> MAXIMUM
IF SO .JUMP

MDV
DEC
SHL
MOV
XDR
MOV

(BP+2] ,AL
AL
AL, I
BL.AL
BH,BH
;
cX,CS;WORD PTR DR_PT{8X];

STORE VALID CMOS DRIVE TYPE
MAKE 0 ORIGIN
ACCOUNT FOR FIELD WIDTH
FINISH MAKING INDEX POINTER
CLEAR HIGH ORDER INDEX
GET MAX TRACK AND SECTOR

MDV
TEST
JNZ
eMP
')Z
JMP

AL,«tDSK STATE[DI]

8YTE-PTR (BP+2],O
DISK P9
SHORT 0 I SK_P6

LOAD STATE FOR THIS DRIVE
CHECK FOR ESTABLISHED STATE
GO TO CMOS FOR DR I VE CHECK
CHECK FOR CMOS 8AD/INVALID
CMOS BAO/[NVALID AND UNESTABLISHED
CMOS GOOD AND UNEST ABL I SHED; USE CMOS

=

=

DISK_P3:
88 56 04
83 FF 01
TT 66
C6 46 05 01
E8 06B3 R
72 I .
OA CO
14
3C 03

,.

TT

10

=

pn /2

01 SK_P4:
8A
A8
75
80
14
E8

85 0090 R

10
08
7E 02 00
31
IC

0102
0102 24 CO
0104 2E: 88 OE 0216 R
0109 3C 80
o lOB 15

~~S~E~5DET

DISK_P5:

"

5.7
5 ••
5.9
590

02C8 R
46 02 0000
0010 R
CI
02
41
06

FE CA
3C 01
75 6A

01 C8
01CA
01CE
0100

SET ERROR RETURN CODE

01 SK_P2:

0193
0195
0197
0199
0199
019C
019F
01 A I
01 AS
01 A8
01AA
01 AC
01AE
0180

o lC2
o IC2
o IC6

06-10-85
STC
RET

o l1F

0180
0180 E8
0183 C1
0188 AI
018824
0180 82
018F 3C
0191 14

1-6

Version 2.00

0IDD2E: 88 OE 0214 R
01 E2 F6 85 0090 R 01
lET 14 05

o

AND
MOV
eMP
JNE

~~:=~~~-~~~

AL,RATE MSK

I SOLATE STATE
GET DR I VE PARAMETERS FOR 1.2 M DR I VE
1.2M DRIVE?
300 OR 500 RATE IS 1.21.1 DRIVE

MOV
TEST
JZ

CX,WDRD PTR CS:DR PT
;~~~=~!ATE[DI], TRK_CAPA

GET OR I VE PARAMETERS 360K DR I VE
80 TRACK ?
MUST BE 360

CS:DR_PT+2

DISK_P6-

591
592
593

59.
595
596

597
59.

599
600
601
602
603
60.
605
606
b07
608
b09
610
bll
b12
613
614
615

01E9
01EE
01EE
01Fl
01F5
01 F8
01FA
01FA
01 FC
OIFF
0201
0202

2E:

88 OE 0218 R
4E 00
06 0000 E
46 06
C8

CX,WORD PTR CS:DR_PT+4

GET DR I VE PARAMETERS

[BP] ,CX
AX,DISK BASE
[BP+6],AX
AX,CS

SAVE POINTER IN STACK FOR RETURN
ADDRESS OF 0 I SK BASE
SAVE I N STACK
SEGMENT DISK_BASE ISAME AS THIS ONE)

MOV
CALL
XOR
CLC
RET

ES,AX
XLAT OLD
AX,AX

ES I S SEGMENT OF TABLE
TRANSLATE STATE TO COMPATIBLE MODE
CLEAR

OISK_P1:
8E CO
E8 02EE R
33 CO

F.

C3

NO DR I VE PRE SENT HANDLER

0203
0203 C6
0207
020733
0209 89
020C 88
020F 89
0212 E8
0214

46 04 00
CO
46 00
66 05
46 06
E6

616

DISK P8:
MOV
DISK P9~
XOR
MOV
MOV
MOV
JMP
01 SK_PARMS

;

617

;

61.
619
620
621
622

MOV
MOV
LEA
MOV
MDV

DISK_P61
89
80
89
8C

02140921
0216 OF 4F
0218 09 4F
021A

=

DB
DB
EQU

ON ENTRY

~ ~~

639
640
641
642
643
644
645
646
641
648
649
650
651

0220
0220
022E
0231
0232
0233
0235
0231
0238
0238
023A
023C

652
653

5-102

02C8 R
85 0090 R
CO
13
01
01
02
02

50
E8 02EE R
58
F8
88 DE
8A C3
C3
32 E4
EB Fl

~

ON EXIT:

6 E8
8A
OA
74
84
A8
74
84

OFH,04FH
09H, 04FH
•

DISK_TYPE:

;

021A
021A
0210
0221
0223
0225
0227
0229
022B

=

t o "

1.21.4
720K

- - - - --------- -- - - - - - - - ----- -- - - - - - - - -- - -- - - - --- - - - -- - - -- - - - - - - -- - - - - - - - - - - - - --

627
630
631
632
633
634
635
636
631
638

CLEAR PARMS I F NO DR I VES OR CMOS BAD
TRACKS, SECTORS /TRACK = 0
HEAD = 0
OFFSET TO 0 I SK BASE
0
EXIT
-

DR I VE PARAMETER TABLE

;

629

CLEAR NUMBER OF DR I VES

- - - - ------------ - - - - - --------- - -- - - - - - - - -- - - ------ ---- - - - - - - -- -- - -- --- - - - - -- --

DR_PTE
;

62.

[BP+4], 0

AX,AX
(BP] ,AX
(BP+5] ,AH
[BP+6] ,AX
DISK PT
ENDP-

6;~;~ ---~~ ------~ ~~: ~ ~ ;~- ---------------; -~~; ~ -~;;~;~: -~~~~~~~ I;;;~; -~~~~ -----;

623
62'
625
626

BYTE PTR

;y;~

-

THIS ROUTINE RETURNS THE TYPE OF MEDIA

01
AH

-------

;~~~

:

ORIVE TYPE,

----

~~;;

CY=O

---------------------------------------------------

CALL
MOV
OR
.JZ
MOV

XLAT NEW
AL.G!lDSK STATE[DI]
AL,AL
NO DRV
AH-;NOCHGLN

jiST

~~'~~~KCAPA

MOV

AH-;CHGLN

DT BACK:
PUSH
CALL
POP
eLC
MOV
MOV
RET

INSTALLED.

DRIVE #

TRANSLATE STATE TO PRESENT ARCH.
GET PRESENT STATE INFORMATION
CHECK FOR NO DRIVE
NO CHANGE LINE FOR 40 TRACK DR 1VE
IS THIS DRIVE AN 80 TRACK DRIVE?
IF NO JUMP
CHANGE LINE FOR 80 TRACK DRIVE

AX
XLAT OLD
AX
-

SAVE RETURN VALUE
TRANSLATE STATE TO COMPATIBLE MODE
RESTORE RETURN VALUE
NO ERROR
GET SAVED AL TO 8L
PUT BACK FOR RETURN

8X,SI
AL,BL
t

NO DR I VE PRESENT OR UNKNOWN

XOR
.JMP
01 SK_TYPE ENDP

AH,AH
SHORT DT_BACK

;-

-------- - - --- - - -- - - - - - - - - - - - - - - - - - - -- - - -- - - - --- -- -- -- - - - - - - - - -- - -- - - -- - - - - - --

;

DISK_CHANGE:

THIS ROUTINE RETURNS THE STATE OF THE DISK CHANGE LINE.

DISKETTE

IBM Person". I Computer MACRO Assembler
OSKETTE -- 06/10/85
OISKETTE BIOS

06-10-85

b54
b55
b5b

ON ENTRY:

01

b57

ON EXIT:

AH :
00 06 -

b5B
b59
bbO

661
662
663
664
665
666
667
bbB
669
670

511
672
b73
614
675
616
677
678
b79
6S0
681
682
683
6B4
bB5
bBb
6B7
bBB
6B9

690
691
692
693
694
695
696
697
69S
699
700
701
702
703
704
105

~ ~ ~~

023C
023C
023F
0243
0245
0247
0249

E8
SA
OA
74
A8
74

02C8 R
85 0090 R
CO
19
01
05

-

~~;~G~-

-

CALL
MOV
OR

0250 C6 06 0041
0255
0258
025B
0250
025F

E8
E8
8B
8A
C3

R 06

02EE R
0620 R
DE
C3

;~O~

Il!IDSKETTE STATUS
DISK CHANGE LINE INACTIVE, CY "
DISK CHANGE LINE ACTIVE, CY = I

----

~E;~

0

------- --------------------------------------------

jiST

~~fi~K_CAPA

TRANSLATE STATE TO PRESENT ARCH.
GET MEDIA STATE INFORMATION
OR I VE PRESENT ?
JUMP IF NO DRIVE

CALL
JZ

READ DSKCHNG
FINIS

GO CHECK STATE OF 0 I SK CHANGE LINE
CHANGE LINE NOT ACTIVE

XL AT OLD
SETUP END
BX,SIAL,BL

TRANSLATE STATE TO COMPATIBLE MODE
VAR 10US CLEANUPS
GET SAVED AL TO BL
PUT BACK FOR RETURN

SETIT:

MOV

FINIS:

CALL
CALL
MOV
MOV

R 80

OR

J"?
DISK _CHANGE

;

~~ ~~A:\~~~~\~ANGE

;

LINE

INDICATE MEDIA REMOVED

(tDSKETTE STATUS, T I ME OUT
SHORT FINIS
ENoP

;

SET TIMEOUT,

NO DRIVE

- --- -- - -- - - - - -- - - -- - -- - - - --- - -- - - -- - - - -- - - -- - - - -- -- -- - --- - - - -- - - -- - - -- - - - -- ---

;

FORMAT_SET

THIS ROUTINE IS USED TO ESTABLISH THE TYPE OF MEDIA TO BE USED
FOR THE FOLLOWING FORMAT OPERATION.

ON ENTRY:

S I LOW :
01
:

ON EXIT:

Il!IDSKETTE STATUS REFLECTS STATUS
AH : IIIDSKETTE STATUS
CY = I IF ERROR

~~~~~ ~

E8
56
88
32
8B
80
4E
75
80
EB

----

DRIVE #

RET

0260
0260 80 OE 0041
0265 EB EE
0267

0267
0261
026A
0268
0260
026F
0271
0216
0277
0279
021E

:

XL AT NEW
AL,Il!IDSK STATE[DI1
AL, AL
DC NON

.JZ

024B ES 08E3 R
024E 74 05

1-7

Version 2.00

02C8 R

-

C6
E4
FO
A5 0090 R OF
07
80 0090 R 90
37

~E~

------

CALL
PUSH
MOV
XOR
Mav

~~O~

OASD TYPE FOR FORMAT
DRIVE #

----

~E~~

---------------------------------------------------

XL AT NEW
SI
AX,SI
AH, AH
SI,AX

;
;
;
;
;

~~g

~~SK_STATE [011

JNZ

NOT 320

3~p

,NOT

TRANSLATE STATE TO PRESENT ARCH.
SAVE aASO TYPE
AH = ? , AL = DASa TYPE
AH : 0 , AL : aAsa TYPE
SI = DAsa TYPE

MED_D~T~~~~KS;~~+~~ri73~~~
;

MEO AC~E~= I

j

e~ATE

BYPASS IF NOT

~~g~TS~~TE[DI1,MEO_DET+RATE_250; SET TO 320/360

706
707
708
709
110

0280
0280 E8 0416 R
0283 80 3E 0041
02881420

NOT 320:
CALL

711
112
713
714
715

028A 4E
028B 15 07
028080800090 R 70
0292 E8 23

R 80

C"?
JZ
DEC
JNZ
OR

0294
0294
0295
0297
029C

4£
75 07
80 80 0090 RIO
E8 19

CHECK FOR TIME_OUT
IF TIME OUT TELL CALLER

CHECK FOR 320/360K IN 1.2M DRIVE
, BYPASS IF NOT
~~~~'fS~~TE[DI1 ,MED_DET+DBL_STEP+RATE_300 ; SET STATE

NOT 320

12

J"?

716
717
718
719
720
721

MED CHANGE
;
@DSKETTE STATUS,TIME OUT
SO
-

NOT 320 12:
-DEC
JNZ
OR

JM?

51
; CHECK FOR 1.2M MEDIA IN 1.2M DRIVE
NOT 12
; BYPASS IF NOT
 100000008
(250) -> 01000000B
(300) -> OOOOOOOOB

:g~~;i~~T~~~~Gs~~
-

-;
;
;

NO RETRY:
CLC

~~~~T 5~T~~~S R~6~

RETRY
SET CARRY FOR RETRY
RETRY RETURN
CLEAR CARRY NO RETRY
NO RETRY RETURN

RET

;

ATTEMPT TO NEXT RATE
(250)
(300)
(500)

AH,RATE 500+ I
; SET CY FOR RATE 500
AH, I
; TO NEXT STATE
AH.RATE MSK
; KEEP ONLY RATE B[TS
@DSK STATE[DIJ,NOT RATE MSK+DBL STEP
; RATE, DBL STEP OFF

STC
RET

RETRY

IS UPDATED FOR RETRY.

= I FOR RETRY, CY = 0 FOR NO RETRY

~~~~

ENDP

- -- -- - - -- - - - - - -- - - - - - -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - -- - - - - - -- - -- - -- - - - - --

;
;

NUM_TRANS:

THIS ROUTINE CALCULATES THE NUMBER OF SECTORS THAT WERE
ACTUALLY TRANSFERRED TO/FROM THE DISKETTE.

;
;
;

ON ENTRY:

[BP+l]
51-HI
[SP)

ON EXIT:

AL

,

~~~

-

~~~~~

R 00

R
R
R

-------

= TRACK
= HEAD
= START

= NUMBER

~~O~

----

~~~~

SECTOR

ACTUALLY TRANSFERRED

------- -----------------------------------

XOR
CMP
JNZ
MOV
CAI,..L
MOV
MOV
CMP
JNZ

AL, AL
(tDSKETTE STATUS,O
NT OUT
DL--;4
GET PARM
BL,liiNEC STATUS+5
CX, S I
CH,PNEC STATUS+4
DIF_HD -

CLEAR FOR ERROR
CHECK FOR ERROR
I F ERROR 0 TRANSFERRED
SECTORS !TRACK OFFSET TO DL
AH
SECTORS !TRACK
GET ENOING SECTOR
CH
HEAD # STARTED
GET HEAD ENDED UP ON
IF ON SAME HEAD, THEN NO ADJUST

MDV

CMP
JZ

CH, 80H - DISK
READ THE DESIRED SECTORS INTO MEMORY
WRITE THE DESIRED SECTORS FROM MEMORY
VERIFY THE DESIRED SECTORS
FORMAT THE DESIRED TRACK
UNUSED
UNUSED
RETURN THE CURRENT DRIVE PARAMETERS
INITIALIZE DRIVE PAIR CHARACTERISTICS
INTERRUPT 41 POINTS TO DATA BLOCK FOR DRIVE 0
INTERRUPT 46 POINTS TO DATA BLOCK FOR DRIVE I
READ LONG
WRITE LONG
(READ & WRITE LONG ENCOMPASS 512 + 4 BYTES ECC)
SEEK
ALTERNATE DISK RESET (SEE DLl
UNUSED
UNUSED
TEST DRIVE READY
RECALIBRATE
UNUSED
UNUSED
CONTROLLER INTERNAL 0 I AGNOST I C
READ DASD TYPE

00

67
68
69
70
71
72

REGISTERS USED FOR F[XED DISK OPERATIONS
(OLI
!CH)
(CHI
(CL)

73

74
75
76
77

NOTE:

78
79
80
81
82
83
54
85
86
87
88
89
90
91

(80H-81H FOR. DISK, VALUE CHECKED)
(0-15 ALLOWED, NOT VALUE CHECKED)
(0-1023, NOT VALUE CHECKED) 1SEE CLl
(1-17, NOT VALUE CHECKED)

HIGH 2 BITS OF, CYL I NDER NUMBER ARE PLACED
IN THE HIGH 2 BITS OF THE CL REGISTER
(10 BITS TOTAL)

(AL)

NUMBER OF SECTORS

(ES:8X~

ADDRESS OF BUFFER FOR,READS AND WRITES,
(NOT REQU I RED FOR VER [FY)

FORMAT

1MAXIMUM POSSIBLE RANGE 1-80H,
FOR READ/WRITE LONG 1-79HJ

(AH=51 ES:BX POINTS TO A 512 BYTE BUFFER.
THE F[RST
2· (SECTORS I TRACK) BYTES CONT A I N F ~ N FOR EACH SECTOR.
F
OOH FOR A GOOD SECTOR
80H FOR A BAD SECTOR
N = SECTOR NUMBER
FOR AN INTERLEAVE OF 2 AND 17 SECTORS/TRACK
THE TABLE SHOULD BE:

=

92
93
94
95
96
97
98

5-116

DRIVE NUMBER
HEAD NUMBER
CYLINDER NUMBER
SECTOR NUMBER

DB
DB
DB

DISK

OOH, 0 1H, OOH, OAH, OOH, 02H, OOH,OSH, OOH, 03H, OOH, OCH
OOH, 04H, OOH, ODH. OOH. 05H, OOH, OEH, OOH, 06H, OOH, OFH
00H,07H,OOH,10H,OOH,08H,OOH,IIH,OOH,09H

[BM Personal Computer MACRO Assembler
DISK ----- 06/10/85
FIXED DISK B[OS

99
100
101
102
103
104
105
1 Db
107
108
109
110
111
112
113
114
115
11.
117
118
119
120
121
122
123
124
125
12.
127
128
129
130
131
132
133
134
135
13.
137
138
139
140
141
142
143
144
145
14.
147
148
149
150
151
152
153
154
155
15.
157
158
159
,.0

,.,

,.2
,.3
164
,.5

..

,

,.7
,.8

1"
170
171
172
173
174
175
17.
177
178
179
180
181
182
1B3
1B4
185
18.
187

1-2

VersIon 2.00

06-[ 0-85

PAGE
I - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - ---

;

OUTPUT
AH = STATUS OF CURRENT OPERATION
STATUS BITS ARE DEFINED IN THE EQUATES BELOW
CY = a
SUCCESSFUL OPERATION (AH=O ON RETURN)
CY = I
FAILED OPERATION (AH HAS ERROR REASONI

;
I

,,
,
,,,

ERROR t IH
INO[CATES THAT THE DATA READ HAD A RECOVERABLE
ERROR WHICH WAS CORRECTED BY THE ECC ALGORITHM.
THE DATA
IS PROBABLY GOOD,
HOWEVER THE BIOS ROUTINE INDICATES AN
ERROR TO ALLOW THE CDNTROLLI NG PROGRAM A CHANCE TO DEC I DE
FOR
ITSELF.
THE
ERROR
MAY
NOT
RECUR
IF THE DATA IS
REWR ITTEN.

NOTE:

,,

IF DRIVE PARAMETERS WERE REQUESTED tDL >= BaH),
INPUT:
(DL) = DRIVE NUMBER
OUTPUT =
(DL I = NUMBER OF CONSECUT I VE ACKNOWLEOG I NG OR I VES A TT ACHED
(CONTROLLER CARD ZERO TALLY ONLY)
(CH) = MAXIMUM USEABLE VALUE FOR HEAD NUMBER
(CH) :: MAXIMUM USEABLE VALUE FOR CYLINDER NUMBER
(CL) = MAX [MUM USEABLE VALUE FOR SECTOR NUMBER
AND CYLINDER NUMBER HIGH BITS

,,,
,,,
1

,

( 1-2)

IF READ DASD TYPE WAS REQUESTED,

=

- NOT PRESENT
- 0 I SKETTE - NO CHANGE LINE AVA I LABLE
- DISKETTE - CHANGE LINE AVAILABLE
- FIXED DISK
CX, OX = NUMBER OF 512 BYTE BLOCKS WHEN AH = 3
AH

0
t
2
3

REG I STERS WILL BE PRESERVED EXCEPT WHEN THEY ARE USED TO RETURN
INFORMATION.
NOTE:

;
OOFF
OOEO
OOCC
008B
OOAA
0080
0040
0020
00 I I
00 t 0
OOOB
OOOA
0009
0007
0005
0004
0002
000 I

I F AN ERROR I S REPORTED BY THE 0 I SK CODE, THE APPROPR I ATE
ACTION IS TO RESET THE DISK, THEN RETRY THE OPERATION.

- -- - - - -- -- - - -- - - - - - -- - - - - - - - ---- ----- - ---- - - -- -- -- --- -- ----- -- -- - - --- - - - -- ----

SENSE FAIL
NO ERR
WRTTE FAULT
UNDEF-ERR
NOT RDY
TIME OUT
BAD SEEK
BAD - CNTLR
DATA CORRECTED
BAD ECC
BAD-TRACK
BAD-SECTOR
DMA -BOUNDARY
INIT FAIL
BAD RESET
RECORD NOT FND
BAD ADDR MARK
BAD::::CMD -

EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
fQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU

OFFH
OEOH
OCCH
OBBH
OAAH

BOH
40H
20H
l1H
IOH

08H
OAH
09H
07H

05H
04H
02H
OIH

NOT IMPLEMENTED
STATUS ERROR/ERROR REGISTER=O
WR I TE F AUL T ON SELECTED DR I VE
UNDEF I NED ERROR OCCURRED
DR I VE NOT READY
ATTACHMENT FAILED TO RESPOND
SEEK OPERATION FAILED
CONTROLLER HAS FAILED
ECC CORRECTED DATA ERROR
BAD ECC ON 0 I SK READ
NOT IMPLEMENTED
BAD SECTOR FLAG DETECTED
DATA EXTENDS TOO FAR
DR I VE PARAMETER ACT I V J TY FA I LED
RESET FA I LED
REQUESTED SECTOR NOT FOUND
ADDRESS MARK NOT FOUND
BAD COMMAND PASSED TO DISK I/O

FIXED DISK PARAMETER TABLE
+0
+2
+3
+5
+7
+8

+9
+12
+14
+t5

THE TABLE
(1
(I
(1
(I
(1
(I

1 S COMPOSED OF A BLOCK DEF I NED AS:

MAXIMUM NUMBER OF CYLINDERS
MAXIMUM NUMBER OF HEADS
NOT USED{SEE PC-XT
STARTING WRITE PRECOMPENSATION CYL
MAXIMUM ECC DATA BURST LENGTH
CONTROL BYTE
BIT
7 DISABLE RETRIES -ORBIT
6 OJ SA8LE RETRIES
B JT
3 MORE THAN 8 HEADS
(3 BYTES)- NOT USEO{SEE PC-XT
(1 WORD) -LANDINGZONE
(1 BYTE) - NUMBER OF SECTORS/TRACK
(1 8YTE) - RESERVED FOR FUTURE USE
-

WORD)
BYTE)
WORD)
WORD)
BYTE)
BYTE)

-

TO DYNAMICALLY DEFINE A SET OF PARAMETERS
8UILD A TABLE FOR UP TO 15 TYPES AND PLACE
THE CORRESPOND I NG VECTOR I NTO INTERRUPT 4 t
FOR DR [VE a AND INTERRUPT 46 FOR DR I VE 1.

DISK

5-117

IBM Personal Computer MACRO Assembler
OISK ----- 06/10/85
FIXEO DISK 810S

188
18.
,.0

06-10-85

PAGE

,--- - ---- - ---- - - ---- - -- - - -- -- -- - - - - - - -- - - - -- - - - - - - - - - - -,,
,,
;

,.,

;

,.2
'.3
I ••
,.5
I ••

HARDWARE SPECIFIC VALUES
CONTROLLER

110 PORT

I

> WHEN READ FROM:

;

,.,

,.8
I ••
200
20 I
202
203
20.
205
20.
201
208
20.
210
211
212
213
21.
215
21.
211
218
21.
220
221
222
223
22.
225
22.
227
228
22.
230
231
232
233
23.
235
23.
231
238
23.
2.0
2.,
2.2
2'3
2 ••
2.5
24.
2.,
2.8
2 ••
250
251
252
253
25.
255
25.
251
258
25.
2.0
261
2.2
2.3
2 ••
2.5
2 ••
2.,
268
2 ••

1-3

Version 2.00

HF PORT"O
HF-PORT ... I
HF-PORT ... 2
HF-PORT"3
HF-PORT"4
HF-PORT ... 5
HF-PORT"'6
HF=PORT .. 7

;
;

,
,
;
;

-

READ DATA (FROM CONTROLLER TO CPU)
GET ERROR REGISTER
GET SECTOR COUNT
GET SECTOR NUMBER
GET CYLINDER LOW
GET CYLINDER HIGH (2 8ITS)
GET SIZE/DR I VE/HEAO
GET STATUS REGISTER

;

> WHEN WR I TTEN TO:

;

,
,,
,

HF PORT"O
HF-PDRT"I
HF-PORT"'2
HF-PORT .. 3
HF-PORT"4
HF-PORT ... 5
HF-PORH6
HF=PORT .. 7

;
;

-

WRITE DATA (FROM' CPU TO CONTROLLER)
SET PRECDMPEN5ATlDN CYLINDER
SET SECTOR COUNT
SET SECTOR NUMBER
SET CYL I NDER LOW
SET CYLINDER HIGH (2 8ITS)
SET SIZE/DRIVE/HEAD
SET COMMAND REG I STER

,--- - ---- - --- - -- - - - - - - - - - - - - - - - - - - --- - - - - - - - - - -- - - -- ---;

;

OIFO
03F6

HF PORT
HF=REG_PORT

EQU
EQU

=

000 1

=
=
=
=

0004
0008
0010
0020
0040
0080

ST ERROR
5T-INDEX
ST-CORRCTO
ST-oRQ
ST-SEEK COMPL
ST-WRT FL T
ST-READY
ST=eUSY

EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU

0001
0002
0004

ERR DAM
ERR-TRK 0
ERR=A80RT

01FOH
03FbH

; DISK PORT

STATUS REGISTER

= 0002

=
=

;

=
=

-----

0010

iRR

0040
0080

iRR DATA ECC
ERR=8AD_BLOCK

0010
0020
0030
0040
0050
0060
0070
0090
0091
0001
0002
0008

RECAL CMD
READ eMD
WRITE CMD
VERIFY CMD
FMTTRK-CMO
INIT cK10
SEEK-CMD
DIAG-CMD
SET PARM CMD
NO RETRIES
ECe MODE
8UFFER_MODE

EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU

0002
0002

ECC CORRECT I ON SUCCESSFUL
SEEK COMPLETE
WRITE FAULT

ERROR REG ISTER
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU

10

000000018
000000 I 08
00000 1 008
0000 I 0008
000 100008
00 I 000008
010000008
100000008

0000000 18
000000 I 08
00000 I 008
0000 I 0008
000 I 00008
001000008
a I 0000008
100000008

DATA ADDRESS MARK NOT FOUND
TRACK 0 NOT FOUND ON RECAL
A80RTED COMMAND
NOT USED
10 NOT FOUND
NOT USED

000 I 00008
001000008
00 [ [00008
010000008
010100008
011000008
011100008
100 1 OOOOB
100100018
0000000 I 8
000000108
000010008

DR [VE RECAL
READ
WRITE
VERIFY
FORMAT TRACK
INITIALIZE
SEEK
DIAGNOSTIC
DR I VE PARMS
CMD MODIFIER
CMD MODIFIER
CMD MODIFIER

25H

(10H)
(20H)
(30H)
(40H)
(50H)
(60H)
(70H)
(90H)
(9IH)
(0 [H)
(02H)
(08H)

MAX FILE
S_~'(AX_F I LE

EQU
EQU

= 0025
= 0600
= 0100

DELAY I
DELAY-2
OELAY::::3

EQU
EQU
EQU

0600H
OIOOH

DELAY FOR OPERATION COMPLETE
DELA Y FOR READY
DELAY FOR DATA REQUEST

=

HF_FAIL

EQU

08H

CMOS FLAG IN BYTE OEH

; -----

COMMAND BLOCK REFERENCE

0008

5-118

EQU

DISK

8YTE PTR

(BPJ-8

(lCMD BLOCK REFERENCES BLOCK HEAD IN SS
(BPT PO I NTS TO COMMAND BLOCK TAl L
AS DEFINED BY THE "ENTER" PARMS

IBM Personal Computer MACRO Assembler
D]SK ----- 06/10185
F]XED D]SK BIOS

1-4

Version 2.00

Ob-IO-85

270
211
272
273
274
215

PAGE
; ----------- --- -- -- - - -- - - - - - ------------ ---- --------------------; FIXED DISK I/O SETUP

278
219
280
281
282
283
284
285
28.
287
288
289
290
291
292
293
294
295
296
297
298
299
300
30 I
302
303
304
305
30.
307
308
309
310
311
312
313
314
315
31.
311
318
319
320
321
322
323

;

;
;

2"
211

324
325
32.
327
328
329
330
331
332
333
334
335
33.
337
338
339
340
341

342
343
344
345
34.
347
348
349
350
351
352
353
354
355
35.
351
358
359
3.0

3.'
3.2
3.3
364
3.5
3 ••
3.7
3.8
3.9
370
311

312
373
374
375
37.
311
378
379
380
381
382
383

-

ESTABLISH TRANSFER VECTORS FOR THE FIXED DISK
PERFORM POWER ON 0 I AGNOST [CS
SHOULD AN ERROR OCCUR A "1101" MESSAGE [S D]SPLAYED

------- - - -- - --------- - - - ------------------- ---- -------- --------ASSUME

0000
0000
0001
0004
0006
0009
OOOC
OOOF
0012
0018
ODIC
0022
0026
002C
0030
0036
0031.
003C
003E
0040
0042
0044
0046
0048

FA
B8
8E
AI
A3
AI
1.3
Cl
8C
Cl
8C
Cl
BC
Cl
8C
E4
24
EB
E6
E4
24
Ea
E6

DISK SETUP
CLI
---- R
D8
004C R
DIDO R
004E R
0102 R
06 004C
DE 004E
06 0108
OE 0101.
06 0104
DE 0106
06 0118
OE 01 II.
AI
BF
00
AI
21
FB
00
21

R
R
R
R
R
R
R
R

06CD R
0000 E
0000 E

004B
004C
0040
0050
0055
0051.
005F
0061
0064
0066
0068
0061.
0060
0060
0010
0012
0015
0017
0011.
Q07F
0081
0084

IE
01
E8
C6
C6
C6
BO
E8
81.
24
74
E9

$.2
INTBOI.AL
AL,INTAOI
AL,OFBH

"2

STI
ASSUME
PUSH

OS :OATA, ES: ASSO

"OV

"OV

GET ABSOLUTE SEGMENT
SET SEGMENT REG I STER
GET 0 I SKETTE VECTOR
INTO INT 40H
F I XED 0 I SK HANDLER
F I XED 0 I SK INTERRUPT
PARM TABLE DR I VE 80
PARM TABLE DRIVE 81
SECOND INTERRUPT CH I P

LET I NTERRUPTS PASS THRU TO
SECOND CHIP

J"P
OUT

POP
CALL
"OV

INTAOI,AL

OS
ES

005
1II0lSK STATUS I ,0
IPHF NOM,O
PCONTROL BYTE. 0

MOVE ABSO PO]NTER TO
EXTRA SEGMENT PO INTER
ESTABL [SH DATA SEGMENT
RESET THE STATUS INDICATOR
ZERO NUMBER OF F I XED DISKS

"OV
CALL

~~o~M~~Agl AG+NM I

"OV
J"P

AH,AL
AL,BAD BAT+BAD CKSUM
LI
POD_DONE

ANO
"OV
CALL

AH,NOT HF FAIL
AL,CMOS DIAG+NMI
CMOS WRITE

ALLOW FIXED DISK
WRITE IT BACK

"OV
CALL

~~o~M~~Ag I SK+NM I

"OV

IIIPORT OFF, 0
BL,AL AX,OOOFOH
POD_DONE

ZERO CARD OFFSET
SAVE FIXED DISK BYTE
GET FIRST DRIVE TYPE AS OFFSET
NO FIXED DISKS

ANO
JZ

CHECK CMOS VALIDITY
SAVE CMOS FLAG
CHECK FOR VAL I 0 CMOS
CMOS NOT VALID -- NO FIXED DISKS

LI:
BO E4 F7
BO 8E
E8 0000 E
BO 92
E8 0000 E
C6 06 0071 R 00
81. DB
25 ODFO
14 72

"OV
ANO

JZ

e"p

0086 3C FO
0088 75 10
008A
008C
008F
0091
0093
0095
0091
009A
0091.
009D
001.1
001.6
001.8
OOAB
001.0

J"P
OUT

IN

0000 E
06 0014 R 00
06 0015 R 00
06 0076 R 00
8E
0000 E
EO
CO
03
OOFB R

NEAR

ANO

ANO

0041. FB

PROC

AX,ABSO
DS,AX
AX, WORD PTR IPORG VECTOR
WORD PTR 1110 I SK VECTOR, AX
AX,WORD PTR 1II0RG VECTOR+2
WORD PTR IPDISK VECTOR+2,AX
WORD PTR 1II0RG VECTOR,OFFSET 0] SK 10
WORD PTR 1II0RG-VECTOR+2,CS
WORD PTR IIIHDISK INT ,OFFSET HD INT
WORD PTR IIIHDISK-INT+2,CS
WORD PTR IIIHF TaL VEC ,OFFSET FO TBL
WORD PTR IIIHF-TBL-VEC+2 ,CS
WORD PTR IIIHFT TBC VEC, OFFSET FD TBL
WORD PTR Il'HF I-TBL-VEC+2. CS
AL, I NTBO I
; TURN ON
AL,OBFH

"OV
"OV
"OV
"OV
"OV
"OV
"OV
"OV
"OV
"OV
"OV
"OV
"OV
"OV
IN

011.9 R

WORK OFF OS REG [STER

CS:CODE,DS:ABSO

BO
E8
3C
74
3C
17
CI

99
0000 E
00
65
2F
61
EO 04

L2

"OV
CALL

~~o~M~~Ag I SK_'

e"p
JE

e"p
JA

SHL

CHECK FOR EXTENDED DR I VE TYPE BYTE USE
USE DRIVE TYPE I --> 14 IF NOT IN USE

AL,OFOH

JNE

lPL

+NM I

AL,OFOD DONE
AL,41
POD DONE
AX,4

GET EXTENDED TYPE FOR OR I VE C:
FROM CMOS
I S TYPE SET TO ZERO
EXIT IF NOT VALID AND NO FIXED DISKS
]S TYPE WITHIN VALID RANGE
EXIT WITH NO FIXED DISKS [F NOT VALID
ADJUST TYPE TO HIGH NIBBLE

L2:
05 FFFO E
26: A3 0104 R
C6 06 0075 R 01
8A C3
CO EO 04
74 2A
B4 00

AOO

"OV
"OV

"OV
SHL
JZ
MOV

AX,OFFSET FD TBL-16D
WORD PTR IPHF-TBL VEC, AX
!PHFNUM,!
AL,8L
AL,4
SHORT L4
AH,O

COMPUTE OFFSET OF FIRST DRIVE TABLE
SAVE IN VECTOR POINTER
AT LEAST ONE DRIVE
GET SECOND DR I VE TYPE
ONLY ONE DRIVE

OOAF 3C FO
OOBI 75 10

e"p

AL,OFOH
L3

CHECK FOR EXTENDED DR I VE TYpE BYTE USE
USE DRIVE TYPE I --> 14 IF NOT IN USE

00B3
00B5
00B8
0081.
OOBC
OOBE
OOCO
00C3
00C3
00C6
00C8
OOCC
OOCE
0002
0007
0007
0009
OOOB
0000
OODF
00E2
00E4
OOEl
00E9
OOEC
OOFf
00F3
OaFS
00F8
00F8

BO 9A
E8 0000 E
3C 00

MOV
CALL

~~o;M~~Ag [SK_2+NM I

14 18

JE
eMP
JA

AL,OL4
AL,47
L4
AX,4

GET EXTENDED TYPE FOR DR I VE 0:
FROM CMOS
I S TYFE SET TO ZERO
SKIP IF SECOND FIXED DISK NOT VALID
IS TYPE WITHIN VALID RANGE
SKIP IF NOT VALID
ADJUST TYPE TO HIGH NIBBLE

~;:~~FSET FD_TBL-16D

COMPUTE OFFSET FOR SECOND FIXED DISK

JNE

e"p

3C 2F
71 17
CI EO 04

as FFFO E
8B 08
2E: 83 3F 00
74 09
26: A3 0 I 18 R
C6 06 0075 R 02

SHL
L3:
AOO
MOV
eMP
JE
"OV

L4:
82
B4
CD
72
AI
88
05
BB
E8
80
76
B2
E8
C3

80
14
f3
fA
006C R
08
0444
C8
0104 R
3E 0075 R 0 f
05
81
0104 R

"OV
"OV

"OV
INT

Je
"OV

"OV
AOO
"OV
CALL

e"p

JBE
"OV
CALL
POD DONE:
RET

WORD PTR CS:(BX],O
; CHECK FOR ZERO CYLINDERS IN TABLE
L4
; SKIP DRIVE IF NOT A VALID TABLE ENTRY
WORD PTR IIIHF I TBL VEC, AX
@HF_NUM,2
TWO DRIVES
DL,80H
AH,14H

13H
CTL ERR X
AX. 'iTi MER LOW
8X,AX
AX,b-182
CX,AX
HD RESET I
PHF NUM,I
FaD-DONE
DL.8IH
HD_RESET_I

CHECK THE 'CONTROLLER
USE CONTROLLER DIAGNOSTIC COMMAND
CALL BIOS WITH DIAGNOSTIC COMMAND
DISFLAY ERROR MESSAGE IF BAD RETURN
GET START TIMER COUNTS
60 SECONDS-

18.2

SET UP DRIVE 0
WERE THERE TWO DR I VES?
NO-ALL DONE
SET UP DRIVE 1

DISK

5-119

IBM Personal Computer MACRO Assembler
DISK ----- 06/10/85
FIXED DISK BIOS

384
385
386
381
388

389
390
391
392
393
394
395
396
391
398
399
400
401
402
403
404
405
406
401
408
409
410
411
412
413
414
415
416
411
418
419
420

421
422
423
424

425
426
421
428
429
430

431
432
433
434
435
436
431
438
439
440
441
442
443

444
445
446
441
448
449
450
451
452
453
454
455
456
451

1-5

Version 2.00

Ob-IO-85

; ----- POD ERROR
00F9
OOF9
OOFC
OOFF
0102

8E 0000 E
E6 0 I 1C R
EB 0000 E
E6 F4

0104
0104 53
0105 51
010684 09
0108 CD 13
OIOA 72 06
OIOC 8411
010E CD 13
01101319
0112 E8 018A R
011513EF
0117 BE 0000 E
I I A F6 C2 01
o lID 75 51
OIIF 8E 0000 E
0122 E8 0!1C R
0125 E8 4F
01218400
0129 CD 13
012884 08
0120 8A DA
0!2F CD 13
0131 1238
013389 OE 0042 R
0137 8A D3
0139 B8 0401
013C CD 13
013E 13 39
014080 FC OA
01437434
0145 80 FC II
0148 14 2F
014A 80 FC 10
014D 74 2A
Ot4F E6 018A R
0152 12 11
0154 88 OE 0042 R
0158 8A CI
o 15A 24 3F
015C FE C8
015E 14 C1
016080 EI CO
0163 OA C8
016589 OE 0042 R
0169 E8 CE
0168 BE 0000 E
o 16E F6 C2 0 I
0171 15 03
0173 BE 0000 E
0176
0176 E8 0000 E
0179
0119 59
011A 58
o 1T8 C3
o 11C

o

OITC
011C
011F
0182
0184
0186
0189
018A

88
E8
OC
86
E8
C3

8E8E
0000 E
08
EO
0000 E

CTL ERR X ~
MOV
CALL
CALL
JMP
HD RESET 1
PUSH
PUSH
=
MOV

RES_'

1NT
Je

Mav

1NT
JNe
CALL
JNe
RES_FL: MOV
TEST
JNZ
RES_21

Mav

CALL
JMP
RES_RS: MOV

1NT
RES_CK

~

MOV

Mav

1NT
Je

Mav
RES_31

MOV
MOV

1NT
JNe
eMP
JE
eMP
JE
eMP
JE
CALL
Je
MOV
MOV

AND
DEe
JZ

AND
OR
RES_ER:

MOV
JMP
MOV
TEST
JNZ
MOV

SI,OFFSET FI182
SET FAIL
E MSG
POD_DONE
PRDC
8X

CONTROLLER ERROR
DO NOT IPL FROM DISK
01 SPLA Y ERROR AND SET

(BP)

ERROR FLAG

NEAR
SAVE TIMER LIMITS

ex
AH,09H

13H
RES 2
AH,lIH
13H
RES CK
POD-TCHK
RES-I
51 ,OFFSET FITal
DL, I
RES EI
SI,OFFSET FI180
SET FAIL
SHORT RES EI
AH,OOH
13H
AH,08H
BL,DL
13H
RES ER
WORD PTR IfINEC STATUS,CX
DL,8L
AX,0401H
13H
RES OK
AH, SAD SECTOR
RES OKAH,OATA CORRECTED
RES OK AH,BAD ECC
RES OKPOD-TCHK
RES-ER
CX,WORD PTR @NEC STATUS
AL ,CL
AL,3FH
AL
RES RS
CL,OCOH
CL,AL
WORD PTR @NEC STATUS,CX
RES 3
51 ,OFFSET FI191
DL,I
RES EI
51 ,OFFSET F1T90

SET DR I VE PARAMETERS
RECALl BRATE DR I VE
DRIVE OK
CHECK T I ME OUT
INDICATE DISK

1 FAILURE

INDICATE OISK 0 FAILURE
DO NOT TRY TO IPL DISK 0
RESET THE DR I VE
GET MAX CYLI NDER. HEAD, SECTOR
SAVE DR I VE CODE
SAVE MAX CYLINDER, SECTOR
RESTORE DR I VE CODE
VERIFY THE LAST SECTOR
VERIFY OK
OK ALSO IF JUST 10 READ

CHECK FOR TIME OUT
FAILED
GET SECTOR ADDRESS, AND CYLINDER
SEPARATE OUT SECTOR NUMBER
TRY PRE V I OUS ONE
WE'VE TR I EO ALL SECTORS ON TRACK
KEEP CYLINDER BITS
MERGE SECTOR WITH CYLINDER BITS
SAVE CYL I NDER, NEW SECTOR NUMBER
TRY AGAIN
INDICATE DISK 1 ERROR
INDICATE DISK 0 ERROR

RES_El :
CALL

DISPLAY ERROR AND SET

(SP)

ERROR FLAG

RES_OK:
POP
POP
RET
HD_RESET_I
SET FAIL
MOV
CALL

OR
XCHG
CALL
RET

RESTORE TIMER LIMITS
ENDP
PROC
NEAR
AX,X·(CMOS DIAG+NMI)
CMOS READ AL,HF FAIL
AH, ALCMOS_WR I TE

SET_FAIL

ENDP

POD TCHK
POP
POP
PDP
PUSH
PUSH
PUSH
MOV

PROC NEAR
AX

GET CMOS ERROR BYTE
SET DO NOT I PL FROM 0 I SK FLAG
SAVE IT
PUT IT OUT

458
459
460
461
402
463
464
465
466
461
468
469

4TO
411
412
413
414
415
416
411
418
419
480
481
482
483
484

485

018A
o 18A
0188
o 18C
o 18D
018E
o 18F
0190

58
59
58
53
51
50
AI 006C R

0193 38
0195 12
019138
0199 T2
0198 E8
0190 3B
019F 12
OIAI 38
01A3 12
01 A5
01 A6
01AT
01 A8
01 A9

D9
06
D8
OC
04
C3
04
CI
02

F9
C3
Fa
C3

,=

TCHKNG:
TCHKG:

AX
AX,0TIMER_LOW

ex,cx
TCHK I
eX,AX
TCHKG
SHORT TCHK2
AX,BX
TCHKNG
AX,CX
TCHKG

STC
RET

DISK

AND SAVE THEM AGAIN
RESTORE RETURN
AX ::: CURRENT T I ME
BX
START TI ME
CX
END TIME
START < END
END < START < CURRENT
END, CURRENT < START
CURRENT < START < END
START < CURRENT < END
OR CURRENT < END
START
CARRY SET I NO I CATES T I ME OUT
INDICATE STILL TIME

CLC

RET

01 A9

5-120

TCHK

BX
8X

J8
J8
JMP
CMP
J8
CMP
J8

CHECK FOR 30 SECOND TI ME OUT
SAVE RETURN
GET TIME OUT LIMITS

ex

eMP
eMP

TCHK2:

ex

POD_ TCHK

ENDP

01 SK_SETUP

ENOP

IBM Personal Computer MACRO Assembler
DISK ----- 06/10/85
FIXED DISK 8105

486

PAGE

487
488
489

;

492
493

494
495
49b
497
498
499
500
501
502
503
504
505
SOb

507
508
509
SID

511
512
513
514
515
51 b
517
518
519
520
521
522
523
524
525
52b
527
528
529
530
531
532
533
534
535
53b
537
538
539
540
541
542
543
544
545
54b
547
548
549
550
551
552
553
554
555
55b
557
558
559
5bO
5bl

5b2
5b3
5b4

5.5
5bb
5b7
5b8
569
510
571
572
573
574
575
57b
577
578

579
580
581
582
583
584
585
58.
587
588
589
590

591
592
593
594
595
59b
597
598
599

I-b
06-10-85

.----- ---------- --------------- ---------FIXED DISK BIOS ENTRY POINT
; ------ - - - ------------------- -- ----------

490
491

Version 2.00

01 A9

DISK
-

0lA9
01 AC
OIAE
OIBO
0190
0193
0lB3
0lB4
0lB6
0lB8
OIBA
OIBC
OIBF
OICI
OICI
0lC4
0lC6
0lC9
OICC
OICE
0101
0101

a ID5

0106
0101
0108
0109
o IDA
OIDB
OIOC
OIOE
OlEO
0lE2
0lE5
0lE8
OIEC
OIEF
01FO
OIFI
01 F2
0lF3
0lF4
01 F5
01 F6
01 F7
OlF8
OIFB

80 FA 80
13 05
CO 40
CA 0002

10 PROC
ASSUME
eMP
JAE
INT

FAR
OS ;OATA, ES: NOTH I NG
DL,eOH

TEST FOR FIXED DISK DRIVE
YES, HANDLE HERE
DISKETTE HANDLER

AI
40H

BACK TO CALLER

RET

AI:

5TI

FB
OA
75
CO
2A
80
77

E4
09
40
E4
FA 81
EF

80
75
E9
80
75
E9

FC 08
03
0393 R
FC 15
03
0353 R

C8
53
51
52
IE
06
56
51
OA
15
62
E8
E8
8A
80
F5
5F
5E
07
IF
5A
59
56
C9
CA

0008 00

ENABLE

OR
JNZ
I NT
SUB
CMP
JA

AH,AH
A2
40H
AH,AH
DL, {80H + S_MAX_FILE RET_2

eMP
JNZ
JMP
eMP
JNZ
JMP

AH,08H
A3
GET PARM N
AH,T5H
A4
READ_DASD_TYPE

INTERRUPTS

RESET NEC WHEN AH=O
II

A2:

A3:

A4:

E4
02
80
0225 R
0000 E
26' 0014 R
FC 01

0002

OIFB
OIFB 02CI
OIFD 0315
OIFF 031E
020 I 0325
0203 032C
0205 033E
0207 02B9
0209 02B9
0208 02B9
0200 03FI
020F 0423
0211 042A
0213 0431
0215 02CI
0217 02B9
02 \ 9 0289
0216 044F
0210 0466
021 F 02B9
0221 02B9
0223 048E
002A

ENTER
PUSH
PUSH
PUSH
PUSH
PUSH
PUSH
PUSH
OR

JNZ
MOY
CALL
CALL
MOY
eMP
eMe
POP
POP
POP
POP
POP
POP
POP
LEAVE
RET
DISK_IO ENDP

A5:

R

R

R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R

0225
0225 E8 0000 E
022880 FC 01
022B 75 03
0220 E9 0315 R
0230
0230 C6 06 0074 R 00
0235 53
0236 8A IE 0075 R
023A 50
023B 80 E2 7F
023E 3A DA
0240 76 15
0242 06
0243 E8 06B7 R
0246 26: 8B 41 05
024A CI E8 02
0240 88 46 F8
0250 26: 8A 47 08
0254 52
0255 BA 03F6
0258 EE
0259 5A
025A 07
025B 8A 26 0016 R
025F 80 E4 CO
0262 OA EO
0264 88 26 0076 R
0268 58
0269 88 46 F9
026C 50
0260 8A CI
026F 24 3F

MIL

LABEL
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
EQU

DISK_IO CONT
-CALL
eMP
JNZ
JMP
SUO:
MOV
PUSH
MOV
PUSH
AND
CMP
JBE
PUSH
CALL
MOV
SHR
Mav
MOV
PUSH
MOV
OUT
POP
POP
MOV
AND
OR
MOV
POP
MOV
PUSH
MOV
AND

8,

GET PARAMETERS

I S A SPEC I AL CASE

READ DASD TYPE

I S ALSO

SAVE REGISTERS DURING OPERATION
SAVE (BPI AND MAKE ROOM FOR @CMD BLOCK
IN THE STACK. THE COMMAND BLOCK-IS:
peMD_BLOCK
BYTE PTR [BPj-8

a

BX

==

ex
ox

OS
E5
5I
01
AH,AH

CHECK FOR RESET

AS

DL,80H
DISK 10 CONT
DDS AH,@DISK STATUS I
AH,I
-

01
51

FORCE OR I VE 80 FOR RESET
PERFORM THE OPERATION
ESTABL I SH SEGMENT
GET STATUS FRaM 'OPERATION
SET THE CARRY FLAG TO I NO I CATE
SUCCESS OR FAILURE
RESTORE REGISTERS

E5
OS

ox
ex

BX

ADJUST (SP I AND RESTORE
THROW AWAY SAVED FLAGS
WORD
D [SK RESET
RETURN STATUS
01 SK READ
DISK-WRITE
01 SK-VERF
FMT TRK
BAD-COMMAND
BAD-COMMAND
BAD-COMMAND
INIT DRV
RD LONG
WR-LONG
DISK 'SEEK
01 SK-RESET
BAD COMMAND
BAD-COMMAND
TST-RDY
HDISK RECAL
BAD COMMAND
BAD-COMMAND
CTLR D I AGNOST I C
$-MIPROC

FUNCT
OOOH
00 I H
OOZH
003H
004H
005H
006H
001H
008H
009H
OOAH
OOBH
OOCH
OODH
OOEH
OOFH
o IOH
o IIH
OIZH
013H
Ol4H

(BP)

[ON TRANSFER TABLE

FORMAT BAD SECTORS
FORMAT DR I VE
RETURN PARAMETERS

READ BUFFER
WRITE BUFF~R
MEMORY DIAGNOSTIC
DRIVE DIAGNOSTIC
CONTROLLER D I AGNOST I C

NEAR

005
AH,O IH

ESTABL I SH SEGMENT
RETURN STATUS

SUD

RETURN_STATUS
@DISK STATUSI,O
8X
BL,@HF NUM
AX
OL,1FH
BL,DL
BAD COMMAND POP
ES GET VEC
AX,WORD PTR ES:[BX][5]
AX,2
(ICMD BLOCK, AL
AL,BYTE PTR ES: [BX][81
OX
OX, HF REG PORT
DX,AL-OX
ES
AH.  PARAMETER BLOCK
AL,ES:[BX][2]
GET NUMBER OF HEADS
AL
CONVERT TO 0- INDEX
AH,(tCMD BLOCK+5
GET SOH REGI STER
AH, OFOHCHANGE HEAD NUMBER
AH, AL
TO MAX HEAD
(tCMD BLOCK + 5, AH
AL,ES:[BX][14]
MAX SECTOR NUMBER
II'CMO BLOCK + I • AL
AX,AX
(tCMD BLOCK + 3, AL
ZERO FLAGS
COMMAND
TELL CONTROLLER
INIT EXIT
CONTROLLER BUSY ERROR
NOT BUSY
WA IT FOR IT TO BE DONE
INIT EXIT
TIME OUT
CHECK_STATUS
ENDP

; -------------------------------- -------;

READ LONG

0423

RD_LONG

863
864

0423 C6 46 FE 22
0421 E9 04C6 R
042A

RD_LONG

MOV
JMP

;
;

(AH

= OAH)

:

PROC
NEAR
(tCMD BLOCK+6,READ CMD OR ECC MODE
COMMAND I'
ENDP

- -- -- - - - - -------- -- - - - ----------- --- -- -WRITE LONG

042A
042A C6 46 FE 32
042E E9 0505 R
0431

875

(AH

= OBH)

:

NEAR
PROC
~g~~A~~gCK+6.WRITE-CMD OR ECC_MODE
ENDP

----- - - -SEEK
- - - - - - - - - -- -- - - - - - - - - - - - - - - - ---(AH = OCH) :
; ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ---;
;

876

877
878
879
880
881
882
883
884
885
886
881
588
889
890
891
892
893

OPERATION FAILED

STC
JMP

GET_PARM

8602

871
812
813
874

SECTORS
HEADS
O-N RANGE
DRIVE COUNT

RE7

SUB
SUB
SUB

EA

857
8S8
8S9
860
861

8605
866
867
868
869
870

; HIGH TWO BITS OF CYLINDER

BX
ES

INITIALIZE DRIVE

03Fl
03Fl
d3F5
03F8
03FC
03FE
0401
0404
0406
0409
0400
0410
0412
0415
0418
041A
0410
041 F
0422
0422
0423

MAX NUMBER OF CYL I NDERS
ADJUST FOR O-N

G4:
C6
84
2A
28
28
F9
E8

834
83S
831
836
639
840
841
842
843
844
845

TEST WITHIN RANGE

G5:

58

833
8360

I

TBL_ VEC

0431
0431
0435
0438
043A
0430
043F
0442
0441
0449
044E
044E

C6
E8
75
E8
75
E8
80
75
C6

46 FE 10
054F R
14
0585 R
OF
0623 R
3E 0014 R 40
05
06 0074 R 00

"NZ
CALL
"NZ
CALL
eMP

"NE

MOV

PROC
NEAR
@CMD 8LOCK+6.SEEK CMO
COMMAND
OS EXiT
WATT
OS EXIT
CHECK STATUS
IDOl SK-STATUS I ,BAD SEEK
OS EXIT
IDDISK_STATUS 1,0

OS EXIT:
RET

C3

044F

5-124

DISK SEEK
MOV
CALL

DISK_SEEK

DISK

ENDP

CONTROLLER BUSY ERROR
T I ME OUT ON SEEK

[8M Personal Computer MACRO Assembler
o[SK ----- 06/10/85
FIXED DISK 8105

894
895

PAGE

896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
911
918
919
920
921
922
923
924
925
926
921
928
929
930
931
932

;

;

044F
044F
0452
0454
0451
045A
0458
045E
0460
0465
0466

E8
75
8A
SA
EE
E8
75
C6
C3

11
46 FD
01 F6
0635 R
05
06 0014 R 00

;

C6
E8
75
E8
14
E8
75

46 FE 10
054F R
19
0585 R
05
0585 R
OF

E6
80
15
C6

0623 R
3E 0014 R 40
05
06 0074 R 00

80 3E 0014 R 00
C3

TEST 0' SK READY

TST ROY PROC
CALL
JNZ
MOV
MOV
OUT
CALL
JNZ
MOV
TR EX:
RET
TST_RDY ENDP

;

0466
0466
046A
0460
046F
0412
0474
0477
0479
0419
047C
048[
0483
0488
0488
0480
048E

-----

1-10
06-10-85

Version 2.00

(AH

FA
E4
24
E8
E6
E4
24
EB
E6
F8
E8
15
8A
80
EE
E8
84
15
8A
EC
A2
84
3C
74
84

AI
8F
00
AI
21
FB
00
21

WA [T FOR CONTROLLER
SELECT OR J VE

CHECK STATUS ONLY
WIPE OUT DATA CORRECTED ERROR

--------------------------------RECALl8RATE
(AH = [IH) :
- - -- -- ------------- -------- ---- - - -- - ---

HDISK RECAL
MOV
CALL
JNZ
CALL
JZ
CALL
JNZ
RECAL X:
CALL
CMP
JNE
MOV
RECAL EXIT:
CMP
RET
HD[SK_RECAL

;
;
048E
048E
048F
0491
0493
0495
0497
0499
0498
0490
049F
04AO
04A3
04A5
04A8
04AA
04A8
04AE
04BO
0482
0485
0486
0489
0488
0480
04BF
04C 1
04C1
04C5
04C6

:

NEAR
NOT BUSY
TR EX
AL -;-Q!lCMD BLOCK -t 5
DX,HF PORT-+6
OX ,ALCHECK ST
TR EXQ!lDTsK_STATUS1,O

PROC
NEAR
<:!ICMD 8LOCK-+6,RECAL CMD
COMMAND
RECAL EX I T
WAIT RECAL X
WAIT RECAL_EXIT

SEEK NOT COMPLETE
IS OK

Q!lOISK_STATUS1,O
ENDP

CONTROLLER DIAGNOSTIC

(AH

-- ---- ---------------- --- - - --

CTLR 0 I AGNDST I C
CLI
IN
ANa
JMP
OUT
IN
ANa
J"P
OUT

START THE OPERAT[ON
ERROR
WA I T FOR COMPLET I ON
TIME OUT ONE OK ?
WAIT FOR COMPLETION LONGER
TIME OUT TWO TIMES IS ERROR

CHECK STATUS
olIDISK-STATUS1,8AD SEEK
RECAL -EX [T
@OISK::::STATUS1,O

933
934
935
936
931
938
939
940
941
942
943
944
945
946
941
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
914
975
976
917
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004

= 10H)

PROC

=

14H)

:

NEAR

AL,INTBOI
AL.08FH

D[SA8LE INTERRUPTS WH[LE CHANGING MASK
TURN ON SECOND INTERRUPT CH I P

$,2
INT80l,AL
AL.INTAOI
AL.OF8H

',2

LET I NTERRUPTS PASS THRU TO
SECOND CH IP

INTAOI,AL

5T I
05E6 R
1A
01 F7
90

CALL
JNZ
"OV
MOV
OUT
CALL
"OV
JNZ
"OV
IN
"OV
"OV
CMP
JE
MOV

05E6 R
80
OF
0 IF 1
0080 R
00
01
02
20

88 26 0074 R
C3

NOT 8USY
CD ERR
DX-;-HF PORT -+ 7
AL,DIAG CMD
OX, AL
NOT 8USY
AH,TIME OUT
CD EXITDX-;-HF PORT -t 1
AL,DX@HF ERROR, AL
AH,O
AL,I
SHORT CD EX I T
AH,8AD_CNTLR

WA I T FOR CARD
8AD CARD
ST ART DIAGNOSE
WA I T FOR

I T TO COMPLETE

TIME OUT ON DIAGNOSTIC
GET ERROR REG I STER
SAVE

IT

CHECK FOR ALL OK

CD ERR:
CD-EX IT:
MOV
@DISK_STATUSI,AH
RET
CTLR_DIAGNOSTIC ENOP

.-------- - - - - - -- -----------------;

04C6
04C6
04C9
04C8
04CO
0400
0402
0402
0405
0407
040A
0400
04DE
04DF
04El
04E2
04E6
04E8
04E8
04EO
04FO
04F3
04F4
04F1
04F8
04FA
04FO
04FF
0502
0504
0504
0504

COMMAND I
REPEATEDL Y J NPUTS OAT A TILL
NSECTOR RETURNS ZERO

~;~~~~~~~----E8
72
88
E8
75

0694 R
39
F8
054F R
32

E8 0585 R
75 20
89 0100
8A OIFO
FA
FC
F3/ 60
F8
F6 46 FE 02
14 12
E8 0600 R
72 17
8A 01 FO
89 0004
EC
26: 88 05
47
E2 F9
E8 0623 R
75 05
FE 4E F9
75 CE
C3

CALL
JC
"OV
CALL
JNZ

CHECK DMA
CMD ABORT
OJ ,BX
COMMAND
CMD_A80RT

CHECK 64K 80UNDARY ERROR

CALL
JNZ
MOV
"OV

WAIT
TM OUT
CX-;-256D
DX,HF _PORT

WA I T FOR DATA REQUEST
TIME OUT
SECTOR SIZE IN WORDS

OUTPUT COMMAND
INTERRUPT

CLI

CLO
REP

INSW

GET THE SECTOR

@CMD BLOCK-t6 I ECC MODE
CMD 13
WA [T ORQ
TM OOT
DX-;-HF PORT
CX , 4 AL,DX
ES:8YTE PTR [01] ,AL
01
CMD [2
CHECK STATUS
CMO ABORT
 DISK PARMS

SUB
MOV
ASSUME
TEST
JZ
LES
JMP

AX. AX
ES,AX
ES: A8S0
DL, I
GV 0
BX-;-@HFI TBL VEC
SHORT GV_ExTT

LES

BX,@HF_TBL_VEC

- ~~~ - ~;~~ - - - -~~~~ - -- - - - - - -- ---- - - - ~ - --

IE 0104 R

;

GET 0 I SK PARAMETER ADDRESS

ES:BX -> DRIVE PARAMETERS
ES: ex -> DR I VE PARAMETERS

GV EXiT:
RET
GET _ VEC ENDP

C3

;--- HARDWARE

INT

F I XED 0 I SK

HD_INT
50
IE
E8 0000 E
C6 06 008E R FF
80 20
E6 AD
E8 00
E6 20
IF
FB
889100
CD 15
58
CF

5-128

- - - ~~~; - --

AX
AX, 8000H
IrtCMo 8LOCK+6,ECC MODE
CKDIAX. 1F04H
AH,OltCMD BLOCK+ I
CKDOKCKDERR
AL,BL
CKDERR

PDP
RET
CHECK_DMA

F6 C2 01
74 01
26: C4 IE 0118 R
EB 05
26:

PUSH
MOV
TEST
JZ
MOV
CMP
JA
J8
CMP
JB
CLC
PDP

RET
CKDERR:

~~~

28 CO
8E CO

TEST ALL 8 BITS
MOVE NEXT ERROR BIT TO CARRY
FOUND THE ERROR
KEEP TRY I NG
COMPUTE ADDRESS OF
ERROR CODE
GET ERROR CODE
SAVE ERROR CODE

NO ERR
BAD ADDR MARK, BAD SEEK, BAD CMo, UNDEF ERR
RECORD NOT FND, UNDEF ERR, BAD ECC. BAD-SECTOR
ENDP--

~~~~~ - ~~~- - - - - - ~~~~
50
88
FE>
14
88
3A

GET THE ERROR REG I STER

30 2F

IRQ LEVEL

OS

ST[
"DV
[NT
POP
IRET

-----------

OS

OUT
PDP

""P

14)

NEAR
AX

OUT

INTAOO,AL
.
'2
AX,9100H
I5H
AX

ALL DONE
NON-SPECIFIC END OF
FOR CONTROLLER #2
WAIT
FOR CONTROLLER # 1

08

RETURN FROM

'06/10/85'

INTERRUPT

RE-ENABLE INTERRUPTS
OEV ICE POST
INTERRUPT
INTERRUPT

ENDP

ENDS
END

DISK

(

I NTERRUPT ROUT I NE

DDS
iPHF I NT FLAG, OFFH
AL,EOI I NTBOO, AL

"DV
"DV

HD_INT
30 36 2F 31
3835

PROC
PUSH
PUSH
CALL

76H --

RELEASE MARKER

OFFSET

IBM Persona! Computer MACRO Assembter
KY8D ----- 06/10/85
KEY80ARD 810S

0000

.2
.3
•5
46

10

11
12
13
14
15
16
11
1B
19
BO
BI
B2
B3
54
B5
B6
B1
BB
B9
90
91

92
93
9.
95
96

91
9B
99
100
101
102
103
10.
10 5
106
101
lOB
109
110
III
112
113

"'

PUBLIC
PUBLIC
PU8LI C
PUBLI C

KEYBOARD 10 I
KB INT 1- SND_DATA

EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN

BEEP:NEAR
005 :NEAR
START I :NEAR
KIO:BYTE
KII :BYTE
KI2:BYTE
KI3:BYTE
KI4:BYTE
KI5:BYTE
K6 :BYTE
KbL:A8S
K7:8YTE
K8:BYTE
K9 :BYTE

KI6

I NT 16 H ------------------------ -----------------------------------------KEYBOARD I/O
THESE ROUT I NES PROV I DE READ KEYBOARD SUPPORT
INPUT
IAH)= DOH
READ THE NEXT ASCII CHARACTER ENTERED FROM THE KEYBOARD,
RETURN THE RESULT I N I AL), SCAN CODE I N I AH) •
IAH)=
SET THE ZERO FLAG TO INDICATE IF AN ASCII CHARACTER IS
AVAILABLE TO BE READ FROM THE KEYBOARD BUFFER.
Izn= I -- NO CODE AVAILABLE
IZF)= 0 -- CODE IS AVAILABLE
IAX)= CHARACTER
I F I ZF) = 0, THE NEXT CHARACTER I N THE BUFFER TO BE READ IS
IN (AX), AND THE ENTRY REMAINS IN THE BUFFER.
(AH)= 02H
RETURN THE CURRENT SHIFT STATUS IN (AU REGISTER
THE BIT SETTINGS FOR THI S CODE ARE INDICATED IN THE
THE EQUATES FOR IItKB_FLAG
OUTPUT
AS NOTED ABOVE, ONLY (AX) AND FLAGS CHANGED
ALL REGISTERS RETAINED

.,

.B
.9
50
51
52
53
54
55
56
51
5B
59
60
61
62
63
6'
65
66
61
6B
69

Ob- 10-85

PAGE 118,121
TITLE KY8D ----- 06/10/85
KEY80ARD 8105
.LI ST
SEGMENT 8YTE PUBL I C
CODE

6
1
B
9
10
II
12
13
I.
15
16
IT
IB
19
20
21
22
23
2.
25
26
21
2B
29
30
31
32
33
3.
35
36
31
3B
39
.0

...,

I-I

Version 2.00

ASSUME
0000
0000
0001
0002
0003
0006
0008
OOOA
OOOC
OOOE
0010
0012
0013
0014

KEYBOARD

10

I

CS:C~DE,DS:DATA

PRoC

F8

STI-

IE
53
E8
OA
74
FE
74
FE
74
58
IF
CF

PUSH
PUSH
CALL

OS
BX

OR

AH,AH
KIB

0000 E
E4
08
CC
45
CC
61

"Z
DEC
"Z
DEC
"Z
POP
POP
IRET

FAR

;»> ENTRY POINT FOR ORG OE82EH
I N1ERRUPTS BACK ON
SAVE CURRENT OS
SAVE BX TEMPORARILY
ESTABLISH POINTER TO DATA REGION
CHECK FOR IAHI= OOH
ASC I I READ
CHECK-FOR IAHI = OIH
ASCI I STATUS
CHECK-FOR I AHI = 02H
SHIFT STATUS
RECOVER REGISTER

O~S

AH

K2
AH

K3
BX
OS

INVALID COMMAND EXIT

READ THE KEY TO FIGURE OUT WHAT TO DO
00 I 5 88 IE OOIA R
0019 38 IE ODIC R
DOlO 15 01
OOIF
0022
0024
0024
0025
0026
0027
0028
002F
0030
0031
0034
003/3
003A
0030
003F
0042
0043
0044
0045

KIB:

88 9002
CD 15

"NE

8X ,Il'BUFFER HEAD
BX,Il'BUFFER-TAIL
KIC
-

GET PO I NTER TO HEAD OF BUFFER
TEST END OF 8UFFER
IF ANYTH I NG IN 8UFFER SK I P INTERRUPT

MOV

AX,09002H

INT

I5H

MOVE IN WA I T CODE & TYPE
PERFORM OTHER FUNCT I ON
Ase I I READ
I NTERRUPTS BACK ON OUR I NG LOOP
ALLOW AN I NTERRUPT TO OCCUR
I NTERRUPTS BACK OFF
GET PO I NTER TO HEAD OF BUFFER
TEST END OF BUFFER
SAVE ADDRESS
SAVE FLAG
GO GET MODE INDICATOR DATA BYTE
GET PREV I OUS 81 TS
SEE I F ANY DIFFERENT
ISOLATE INDICATOR BITS
IF NO CHANGE BYPASS UPDATE

MOV
CMP

K I:
F8
90
FA
88
38
53
9C
E8
8A
32
80

511
NOP
K Ie:

IE OOIA R
IE ODIC R

0587 R
IE 0097 R
08
E3 01
74 04

E8 0549 R
FA
90
58
74 DO

eLI
MDV
CMP

BX ,OPBUFFER HEAD
BX ,Il'BUFFER-T A I L

PUSH
PUSHF
CALL

BX

MOV

XDR
AND

"Z

CALL

-

MAKE LED
8L,Il'K8 FLAG 2
BL,AL BL,KB LEOS
KIA
SND_LEDI

CLI
KIA:

POPF
POP

"Z

BX

KI

GO TURN ON MODE INDICATORS
D I SA8LE INTERRUPTS
RESTORE FLAGS
RESTORE ADDRESS
LOOP UNT I L SOMETH I NG I N BUFFER

0047 88 01
0049 E8 007F R
004C 89 IE OOIA R

MOV

K.

MOV

\!!I8UFFER _HEAD, 8X

GET SCAN CODE AND ASC I I CODE
MOVE POINTER TO NEXT POSITION
STORE VALUE IN VARIABLE

0050 58
0051 IF
0052 CF

POP
POP

BX
OS

RECOVER REGISTER
RECOVER SEGMENT
RETURN TO CALLER

CALL

IRET
ASCI I

0053
0053
0054
0058
005C
005E
005F
0060
00b3
00b7
0069
OObC

AX, [8X]

STATUS

K2:
FA
88
38
8B
9C
50
E8
8A
32
80
74

CLI
IE OOIA R
IE OOIC R
01

MOV
CMP
MDV

PUSHF
PUSH
CALL

0581 R
IE 0097 R
08
E3 07
03

006E E8 0549 R
0011 5B

MDV

XDR
AND

"Z

CALL
SK2:

POP

ex ,Il'BUFFER HEAD
8X,Il'BUFFER-TA JL
AX, [BX]
-

J NTERRUPTS OFF
GET HEAD PO INTER
I F EQUAL I Z= 1 I THEN NOTH I NG THERE

AX
MAKE LED
8L,Il'KB FLAG 2
BL,AL 8L ,K8 LEOS
SK2
-

SAVE FLAGS
SAVE CODE
GO GET MODE INDICATOR DATA 8YTE
GET PREV 10US BITS
SEE t F ANY 0 I FFERENT
ISOLATE INDICATOR 81TS
IF NO CHANGE BYPASS UPDATE

SND LEDI
AX -

GO TURN ON MODE INDICATORS
RESTORE CODE

KYBD

5-129

I BM Persona I Computer MACRO Assemb I er
KYBD ----- 06/10/85
KEYBOARD BIOS

115
116
117
116
119
120
121
122
123
124
125
126
127
126
129

13'
131
132
133
134
135
136
137
136
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162

0072
0013
0074
0075
0076

90
FB
56

1-2
06-10-85

ion 2.00

POPF
STI
POP
POP
RET

IF

CA 0002

RESTORE FLAGS
I NTERRUPTS BACK ON
RECOVER REG I STER
RECOVER SEGMENT
THROW AWAY FLAGS

8X

as
2

SHIFT STATUS
0079
0079 AO 0017 R
007C 5B
0070 IF
007E CF
007F

K3:
AL,IrtKB_FLAG
8X

MOV
POP
POP

KEYBOARD

IRET
10 I

-

GET THE SHIFT STATUS FLAGS
RECOVER REG I STER
RECOVER REG I STERS
RETURN TO CALLER

as

-

ENOF

I NCREMENT A BUFFER PO INTER
007F
007F
0080
0081
0085
0087
0089
008B
008C

K4

FROC

43
43
3B 1E 0082 R
75 04
8B IE 0080 R

NEAR
8X
8X
BX,

Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.3
Linearized                      : No
XMP Toolkit                     : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37
Create Date                     : 2014:07:13 18:53:36-08:00
Modify Date                     : 2014:07:13 18:22:13-07:00
Metadata Date                   : 2014:07:13 18:22:13-07:00
Producer                        : Adobe Acrobat 9.55 Paper Capture Plug-in
Format                          : application/pdf
Document ID                     : uuid:dad24be5-4a7f-ba44-8c4b-8457760487bd
Instance ID                     : uuid:a7fff187-1b38-e14c-9a10-e834ce911e20
Page Layout                     : SinglePage
Page Mode                       : UseNone
Page Count                      : 507
EXIF Metadata provided by EXIF.tools

Navigation menu