1502494_PC_AT_Technical_Reference_Mar84 1502494 PC AT Technical Reference Mar84

1502494_PC_AT_Technical_Reference_Mar84 1502494_PC_AT_Technical_Reference_Mar84

User Manual: 1502494_PC_AT_Technical_Reference_Mar84

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

Download1502494_PC_AT_Technical_Reference_Mar84 1502494 PC AT Technical Reference Mar84
Open PDF In BrowserView PDF
,.....----§ : :i~s:

Personal Computer
Hardware Reference
Library

Technical·
Reference

1502494

Personal Computer
Hardware Reference
Lihrary

Technical
Reference

First Edition (March 1984)
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 manual "as is," without warranty of any kind, either expressed or implied,
including, but not limited to, the particular purpose. IBM may make improvements and/or
changes in the product(s) and/or the program(s) described in this manual at any time.
This product 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.
It is possible that this material 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 product and for
technical information about the system should be made to your authorized IBM Personal
Computer dealer.
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 Corp., 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.
All specifications subject to change without notice.

© Copyright International Business Machines Corporation 1984

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 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 IBM are used with the
equipment, it is suggested to use shielded, grounded
cables with in-line filters if necessary.
CAUTION
The 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 IBM Personal Computer AT.
This manual consists of nine sections, four of which describe the
hardware aspects of the IBM Personal Computer AT including
signal charts and register information. Section 5 contains
information about the usage of BIOS and a system BIOS listing.
Section 6 contains instruction sets for the 80286 microprocessor
and 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 IBM Personal Computer AT and
the rest of the IBM Personal Computer family.
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)

•

Hardware Maintenance and Service for the IBM Personal
Computer AT

•

MACRO Assembler for the IBM Personal Computer

vi

Contents

SECTION 1. SYSTEM BOARD ..................... 1-1
Description .................................. 1-3
Memory ................................ 1-4
Microprocessor ............................... 1-4
System Performance ........................... 1-7
System Timers ............................... 1-8
System Interrupts ............................ 1-10
ROM Subsystem ............................. 1-11
RAM Subsystem ............................. 1-12
Direct Memory Access (DMA) ................. 1-12
I/O Channel ................................ 1-15
Other Circuits ............................... 1-30
Speaker ................................ 1-30
Jumper ................................ 1-30
Type of Display Adapter Switch ............. 1-31
Variable Capacitor ....................... 1-31
Keyboard Controller ...................... 1-31
Real-time Clock/Complementary Metal Oxide
Semiconductor CRT/CMOS) RAM Information 1-45
Specifications ............................... 1-55
System Unit ............................ 1-55
Connectors ............................. 1-57
Logic Diagrams .......................... 1-61
SECTION 2. COPROCESSOR ......................
Description ..................................
Programming Interface .........................
Hardware Interface ............................

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

SECTION 3. POWER SUPPLY ......................
Inputs ......................................
Outputs .....................................
Output Protection .............................
Dummy Load ................................
Output Voltage Sequencing .....................
No-Load Operation ...........................
Power-Good Signal ............................

3-1
3-3
3-3
3-4
3-4
3-4
3-5
3-5

vii

Fan-Out ................................ 3-6
Connectors .................................. 3-6
SECTION 4. KEYBOARD •.••••..•................. 4-1
Description .................................. 4-3
Interface ................................ 4-3
Sequencing Key Code Scanning .............. 4-3
Keyboard Buffer .......................... 4-3
Keys ................................... 4-3
Functions Performed at Power-On Time ........... 4-4
Power-On Reset .......................... 4-4
Basic Assurance Test ...................... 4-4
Commands from the System ..................... 4-5
Keyboard Outputs ........................... 4-10
Key Scan Codes ......................... 4-10
Command Codes to the System ................. 4-12
Clock and Data Signals ........................ 4-14
Keyboard Data Output .................... 4-15
Keyboard Data Input ..................... 4-15
Keyboard Layout ............................ 4-16
Specifications ............................... 4-23
Keyboard Connector ..................... 4-23
SECTION 5. SYSTEM BIOS ............•....••..... 5-1
System BIOS ................................. 5-3
System BIOS Usage ....................... 5-3
Keyboard Encoding and Usage .............. 5-12
Extended Codes ......................... 5-17
SECTION 6. INSTRUCTION SET .......•••......... 6-1
Instruction Sets ............................... 6-3
80286 Microprocessor Instruction Set ............. 6-3
Data Transfer ............................ 6-3
Arithmetic ............................... 6-6
Logic .................................. 6-10
String Manipulation ...................... 6-12
Control Transfer ......................... 6-13
Processor Control ........................ 6-19
Protection Control ....................... 6-21
80287 Coprocessor Instruction Set ............... 6-24
Data Transfer ........................... 6-24
Comparison ............................ 6-25
Constants .............................. 6-26

viii

Arithmetic .............................. 6-27
Transcendental .......................... 6-29
Processor Control ........................ 6-29
SECTION 7. CHARACTERS, KEYSTROKES, AND
COLORS ...............•...............•...... 7-1
Characters, Keystrokes, and Color ................ 7-3
SECTION 8. COMMUNICATIONS .................. 8-1
Communications .............................. 8-3
Establishing a Data Link ........................ 8-5
SECTION 9. IBM PERSONAL COMPUTER
COMPATIBILITY ......•.............•.......... 9-1
Hardware Considerations ....................... 9-3
System Board ............................ 9-3
20Mb Fixed Disk Drive .................... 9-4
High Capacity Diskette Drive ................ 9-4
Adapters ................................ 9-4
Keyboard ............................... 9-4
The IBM Personal Computer AT Does Not Support 9-5
Application Guidelines ......................... 9-5
High-Level Language Considerations .......... 9-5
Assembler Language Programming Considerations 9-6
Multi-tasking Provisions .................... 9-11
SYS REO Key .......................... 9-15
Copy Protection ......................... 9-22
Machine-Sensitive Code ................... 9-23
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 .............................................. .

xiii

Notes:

xiv

System Block Diagram

SYSTEM UNIT
SYSTEM BOARD
80286
MICROPROCESSOR

80287
COPROCESSOR

OSCILLATOR

---1

16 INTERRUPT
LEVELS

ROM

SPEAKER
CONNECTOR

-

7 CHANNEL
DMA

RAM

KEYBOARD
CONTROLLER

CMOS

REAL-TIME
CLOCK

BATTERY
CONNECTOR

POWER SUPPLY
115/230
SPEAKER

-H

KEYBOARD

BATTERY

DISKETIE
DRIVES

xv

Notes:

xvi

SECTION 1. SYSTEM BOARD

Contents
Description
Memory

1-3
1-4

Microprocessor ............•.........•••••..••...• 1-4
Real-Address Mode .......................... 1-4
Protected Mode ............................. 1-5
System Performance ......................•........ 1-7
System Timers .•••.......•.•...................... 1-8
System Interrupts

•...................•••....•.... 1-10

ROM Subsystem

1-11

RAM Subsystem

1-12

Direct Memory Access (DMA) ...................... 1-12
Programming the 16-Bit DMA Channels ......... 1-14
I/O Channel ...•.•.............................. 1-15
I/O Channel Signal Description ............... 1-22
Other Circuits .........................•.•.......
Speaker .....................................
Jumper .....................................
Type of Display Adapter Switch ..................
Variable Capacitor ............................
Keyboard Controller ...........................
Receiving Data from the Keyboard .............
Scan Code Translation. . . . . . . . . . . . . . . . . . . . . ..
Sending Data to the Keyboard .................
Inhibit ...................................
Keyboard Controller System Interface ..........

1-30
1-30
1-30
1-31
1-31
1-31
1-32
1-32
1-37
1-37
1-37

System Board 1-1

Status Register .............................
Status-Register Bit Definition .................
Output Buffer .............................
Input Buffer ...............................
Commands (I/O Address hex 64) ..............
I/O Ports .................................
Real-time Clock/Complementary Metal Oxide
Semiconductor (RT/CMOS) RAM Information. . . . ..
Real-time Clock Information ..................
CMOS RAM Configuration Information .........
I/O Operations ............................

1-38
1-38
1-39
1-40
1-40
1-43

Specifications ...................................
System Unit ..................................
Size .....................................
Weight ...................................
Power Cables ..............................
Environment ..............................
Heat Output ...............................
Noise Level ...............................
Electrical .................................
Connectors ..................................
Logic Diagrams ...............................

1-55
1-55
1-55
1-55
1-55
1-55
1-56
1-56
1-56
1-57
1-61

1-2 System Board

1-45
1-45
1-48
1-54

Description
The system board is approximately 30.5 by 33 centimeters (12 by
13 inches) and uses very large scale integration (VLSI)
technology. It has the following components:
•

Intel 80286 Microprocessor

•

System support function:
-

7-Channel Direct Memory Access (DMA)

-

16-level interrupt

-

System clock
Three programmable timers

•

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

•

Either a 256Kb or a 512Kb random-access memory (RAM)
Subsystem

•

Speaker 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

•

Keyboard attachment

•

8 input/output (I/O) slots:
-

6 with a 36- and a 62-pin card-edge socket.

-

2 with only the 62-pin card-edge socket.

System Board 1-3

Memory
The system board has two banks of memory sockets, each
supporting 18 128K by 1 modules for a total maximum memory
size of 5 12Kb, with parity checking.

Microprocessor
The Intel 80286 Microprocessor has a 24-bit address, 16-bit
memory interface!, an extensive instruction set, DMA and
interrupt support capabilities, a hardware fixed-point multiply and
divide, integrated memory management, four-level memory
protection, I-gigabyte (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
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.
All segments in the real-address mode are 64Kb 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
In this manual. the term interface refers to a device that carries signals between
functional units.

1-4 System Board

not use the full 64Kb, the unused end of the segment may be
overlayed by another segment to reduce physical memory
requirements.

Protected 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.
The protected mode provides a I-gigabyte virtual address space
per task mapped into a 16-megabyte 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-bit offset is added to the segment base
address to form the physical address. The tables are
automatically referenced by the microprocessor 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.
Following is a block diagram of the system board.

System Board 1-5

1-6 System Board

System Performance
The 80286 Microprocessor operates at 6 MHz, which results in a
clock cycle time of 167 nanoseconds.
A bus cycle requires three clock cycles (which includes 1 wait
state) so that a 500-nanosecond, 16-bit, microprocessor cycle
time is achieved. 8-bit bus operations to 8-bit devices take 6
clock cycles (which include 4 wait states), resulting in a
lOOO-nanosecond microprocessor cycle. 16-bit bus operations to
8-bit devices take 12 clock cycles (which include lO I/O wait
states) resulting in a 2000 nanosecond microprocessor cycle.
The refresh controller operates at 6 MHz. 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 percent of bandwidth used
for refresh.

% Bandwidth used
for Refresh

5 cycles X 256

1280

= --------------

4 ms/167 ns

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 five 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.
The following figure is a system memory map.

System Board 1-7

Address

Name

Function

000000 to
07FFFF

512Kb system
board

System board memory

080000 to
09FFFF

128Kb

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

OAOOOOto
OBFFFF

128Kb video
RAM

Reserved for graphics display buffer

OCOOOO to
ODFFFF

128Kb I/O
expansion ROM

Reserved for ROM on I/O adapters

OEOOOO to
OEFFFF

64Kb Reserved
on system board

Duplicated code assignment at
address FEOOOO

OFOOOO to
OFFFFF

64Kb ROM on
the system board

Duplicated code assignment at
address FFOOOO

100000 to
FDFFFF

Maximum
memory 15Mb

I/O channel memory - IBM Personal
Computer AT 512KB Memory
Expansion Option

FEOOOOto
FEFFFF

64Kb Reserved
on system board

Duplicated code assignment at
address OEOOOO

FFOOOOto
FFFFFF

64Kb ROM on
the svstem board

Duplicated code assignment at
address OFOOOO

System Memory Map

System Timers
The system has three programmable timer/counters controlled by
an Intel 8254-2 timer/counter chip and defined as Channels 0
through 2 as follows:
Channel 0

System Timer

GATE 0

Tied on

CLK IN 0

1.190 MHz OSC

CLK OUT 0

8259A IRQ 0

Channel 1

Refresh Request Generator

1-8 System Board

GATE 1

Tied on

CLKIN 1

1.190 MHz OSC

CLK OUT 1 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

Controlled by bit 0 of port hex 61 PPI bit

CLKIN 2

1.190 MHz OSC

CLK OUT 2 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. Following is a
system-timer block diagram.

System Board 1-9

+5 Vdc
-Refresh

'--

.

System Bus

D
Clock
Clear

o Refresh Requesl

Gale D
+5 Vdc
I/O Addra ss
Hax 0061
Port Bit 0

-

Clock In 0

-----

Gate I
Clock In I
Gale 2
Clock In 2
To 8259A IRO 0

Clock Out 0
Clock Out I

-

Clock Oul 2
AND

I/O Address
Hex 0061
Port Bit I
PCLK
(2.38MHz)

Divide
by 2

W

Driver

I

I

Low ~To Speaker
Pass
Filler

System Interrupts
The 80286 Microprocessor NMI and two 8259A Interrupt
Controller chips provide 16 levels of system interrupts. The
following shows the interrupt-level assignments in decreasing
priority.
Note: Any or all interrupts may be masked (including the
microprocessor's NMI).

1-10 System Board

Level

Function

MicroProcessor NMI

Parity or I/O Channel Check

Interrupt Controllers
CTLR 1
CTLR2
IRQ 0
IRQ 1
IRQ 2
IRQ 8
IRQ 9
IRQ 10
IRQ 11
IRQ 12
IRQ 13
IRQ 14
IRQ 15
IRQ 3
IRQ 4
IRQ 5
IRQ 6
IRQ 7

Timer Output 0
Keyboard (Output Buffer Full)
Interrupt from CTLR 2
Realtime Oock Interrupt
Software Redirected to INT ~AH (IRQ 2)
Reserved
Reserved
Reserved
Coprocessor
Fixed Disk Controller
Reserved
Serial Port 2
Serial Port 1
Parallel Port 2
Diskette Controller
Parallel Port 1

ROM Subsystem
The system board's ROM subsystem consists of two 32K by 8-bit
ROM/EPROM modules or four 16K 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 (hex OFOOOO and
hex FFOOOO). ROM is not parity-checked. Its access time is 150
nanoseconds and its cycle time is 230 nanoseconds.

System Board 1-11

RAM Subsystem
The system board's RAM subsystem starts at address hex 000000
of the 16M address space. It consists of either 256Kb or 512Kb
of 128K by I-bit RAM modules. 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 channel 1 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.

Direct Memory Access (DMA)
The system supports seven DMA channels. Two Intel 8237 A-5
DMA Controller Chips are used, with four channels for each
chip. The DMA channels are assigned as follows:
Ctlr 1
Ch 0 - Spare
Ch 1 - SDLC
Ch 2 - Diskette (IBM
Personal Computer)
Ch 3 - Spare

Ctlr2
Ch 4 - Cascade for Ctlr 1
Ch 5 - Spare
Ch 6 - Spare
Ch 7 - Spare

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

1-12 System Board

16-bit system memory. Each channel can transfer data
throughout the 16-megabyte system-address space in 64Kb
blocks.
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 16-megabyte system-address
space in 128Kb blocks. Channels 5, 6, and 7 cannot transfer data
on odd byte boundaries.
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

I/O Hex Address
0087
0083
0081
0082
0088
0089
008A
008F

Page Register Addresses

The following figures show address generation for the DMA
channels.
Source
Address

8237A-5
A15<---------->AO

Address Generation for DMA Channels 3 through 0

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

Source
Address

8237A-5
A16<---------->A1

Address Generation for DMA Channels 7 through 5

Note: The addressing signals, 'BHE' and 'AO', are forced to
a logic O.
System Board 1-13

Addresses for all DMA channels do not increase or decrease
through page boundaries (64Kb for channels 0 through 3 and
128Kb for channels 5 through 7).

Programming the 16-Bit DMA Channels
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 (8237 A-5), which controls these channels, is through
I/O addresses OCO through ODF. The command codes for the
DMA controller are as follows:
Hex
Address

Command Codes

OCO
OC2
OC4
OC6
OC8
DCA
OCC
OCE

CHO
CHO
CH 1
CH 1
CH2
CH2
CH3
CH3

000
002
004
006
008
ODA
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

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 Registers

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
that is 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 16Mb memory space into 128Kb pages.
When the DMA page registers for channels 5 through 7 are

1-14 System Board

programmed, data bits D7 through D 1 should 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.
After power-up time, all internal locations, especially the mode
registers, should be loaded with some valid value. This should be
done even if some channels are unused.

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

I/O address space hex 100 to hex 3FF

•

24-bit memory addresses (16Mb)

•

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

•

Interrupts

•

DMA channels

•

I/O wait-state generation

•

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

•

Refresh of system memory from channel microprocessors.

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

System Board 1-15

1-16 System Board

The following figure shows the pin numbering for I/O channel
connectors J1 through J8.

Rear Panel

Bl

r-

I

-

I

Bl0

B20

B31

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

L....

Al

I

L-

Al0

A20

A31

I-

Component Side

I/O Channel Pin Numbering
(11-J8)

System Board 1-17

The following figure shows the pin numbering for I/O channel
connectors J12 through J16 and J18.

lear Panel

- -

D1

OlD

D18

r-

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I

I
I

I

I

I

I

I

I

I

I

I

I

I

C10

I

I
L......

C1

C18

I
~

'-

CDmpDnent Side
I/O Channel Pin Numbering
(J1 O-J14 and J16)

1-18 System Board

The following figures summarize pin assignments for the II0
channel connectors.
I/O Pin
A1
A2
A3
A4
A5
A6
A7
A8
A9
Al0
A 11
A 12
A13
A 14
A 15
A 16
A 17
A 18
A19
A20
A 21
A22
A23
A 24
A 25
A26
A 27
A28
A29
A30
A 31

Signal Name
-I/O CH CK
S07
S06
S05
S04
S03
S02
S01
SOO
-I/O CH ROY
AEN
SA19
SA18
SA17
SA16
SA15
SA14
SA13
SA12
SA11
SA10
SA9
SA8
SA7
SA6
SA5
SM
SA3
SA2
SAl
SAO

I/O
I
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I

a

I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O

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

System Board 1-19

I/O Pin
B1
B2
B3
B4
B5
B6
B7
B8
B9
B 10
B 11
B 12
B13
B14
B15
B16
B 17
B18
B19
B20
B 21
B22
B23
B24
B25
B26
B 27
B28
B29
B30
B 31

Signal Name
GND
RESET DRV
+5Vdc
IRQ9
-5Vdc
DRQ2
-12 Vdc
OWS
+12 Vdc
GND
-SMEMW
-SMEMR
-lOW
-lOR
-DACK3
DRQ3
-OACK1
ORQ1
-Refresh
ClK
IRQ7
IRQ6
IRQ5
IRQ4
IRQ3
-OACK2
T/C
BALE
+5Vdc
OSC
GND

I/O
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)

1-20 System Board

I/O Pin
C1
C2
C3
C4
C5
C6
C7
C8
C9
C10
C 11
C 12
C 13
C 14
C15
C 16
C 17
C18

Signal Name
SBHE
LA23
LA22
LA21
LA20
LA19
LA18
LA17
-MEMR
-MEMW
S008
S009
S010
SOll
S012
S013
S014
S015

I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O

I/O Channel (C-Side J1 0 through J14 and J16)

I/O Pin
D1
02
03
D4
05
D6
D7
08
D9
010
011
D12
013
D 14
015
D 16
D17
018

Sianal Name
-MEM CS16
-I/O CS16
IRQ10
IRQ11
IRQ12
IRQ15
IRQ14
-OACKO
DRQO
-OACK5
DRQ5
-OACK6
DRQ6
-DACK7
ORQ7
+5Vdc
-MASTER
GNO

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

0
I

0
I

0
I
Power
I
Ground

I/O Channel (D-Side, J1 0 through J14 and J16)

System Board 1-21

I/O 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.
~AO

through SA19 (I/O)

Address bits 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 16Mb of memory.
SAO through SA 19 are gated on the system bus when '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.

~A17 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 16Mb of
addressability. 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 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. It is a synchronous
microprocessor cycle clock with a cycle time of 167 nanoseconds.
The clock has a 50% duty cycle. This signal should only be used
for synchronization. It is not intended for uses requiring a fixed
frequency.

1-22 System Board

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

SDO through SDIS (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 D15 is the most-significant bit. A118-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 DIS 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)
, Address latch enable' 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 'AEN ' ). Microprocessor addresses
SAO through SA19 are latched with the falling edge of 'BALE.'
'BALE' is forced high during DMA cycles.

""-

~I/O

CH CK (I)

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

System Board 1-23

. , I/O eH RDY (I)
'I/O channel ready' 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.

IRQ3-IRQ7, IRQ9-IRQI2 and IRQ 14 through 15 (I)
Interrupt Requests 3 through 7,9 through 12, and 14 through 15
are used to signal the microprocessor that an I/O device needs
attention. The interrupt requests are prioritized, with IRQ9
through IRQ12 and IRQ14 through 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
must be held high until the microprocessor acknowledges the
interrupt request (Interrupt Service routine). Interrupt 13 is used
on the system board and is not available on the 1/ 0 channel.
Interrupt 8 is used for the real-time clock.

-lOR (I/O)

, -1/ 0 Read' instructs an I/O device to drive its data onto the
data bus. It may be driven by the system microprocessor or DMA
controller, or by a microprocessor or DMA controller resident on
the 1/ 0 channel. This signal is active low.
-lOW (I/O)
'-I/O Write' instructs an I/O device to read the data on the
data bus. It may be driven by any microprocessor or DMA
controller in the system. This signal is active low.

1-24 System Board

-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 1Mb 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 1Mb 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 system clock period 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 1Mb of the memory space.
'-MEMW' is active on all memory read 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 1Mb 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 system clock period before driving
'-MEMW' active. Both signals are active low.

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

System Board 1-25

-DACKO to -DACK3 and -DACK5 to -DACK7 (0)
-DMA Acknowledge 0 to 3 and 5 to 7 are used to acknowledge
DMA requests (DRQO through DRQ7). They are active low.

~AEN (0)
, Address Enable' 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).
'",-

-REFRESH (I/O)
This signal is used to indicate a refresh cycle and can be driven by
a microprocessor on the 1/ a channel.

TIC (0)
'Terminal Count' provides a pulse when the terminal count for
any DMA channel is reached.
~SBHE

(I/O)

'Bus High Enable' (system) indicates a transfer of data on the
upper byte of the data bus, SD8 through SDI5. Sixteen-bit
devices use 'SBHE' to condition data bus buffers tied to SD8
through SD 15.

"

-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', an I/O
microprocessor may pull '-MASTER' low, which will allow it to

1-26 System Board

control the system address, data, and control lines (a condition
known as tri-state). After '-MASTER' is low, the I/O
microprocessor must wait one system clock period before driving
the address and data lines, and two clock periods before issuing a
Read or Write command. If this signal is held low for more than
15 microseconds, system memory may be lost because of a lack of
refresh.

, -MEM CS16 (I)
'-MEM 16 Chip Select' signals the system board if the present
data transfer is a 1 wait-state, 16-bit, memory cycle. It must be
derived from the decode of LA 17 through LA23. ' -MEM
CS16' should be driven with an open collector or tri-state driver
capable of sinking 20 rnA.

"-I/O CS16 (I)
, -I/O 16 bit Chip Select' signals the system board 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)
'Oscillator' (OSC) 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 'Zero Wait State' (OWS) 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 be driven active one system clock after the

System Board 1-27

Read or Write command is active 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 the system clock. 'OWS
is active low and should be driven with an open collector or
tri-state driver capable of sinking 20 rnA.

I

The following figure is an I/O address map.

000-01F
020-03F
040-05F
060-06F
070-07F
080-09F
OAO-OBF
OCO-ODF
OFO
OF1
OF8-0FF

Hex Range

Device
DMA controller 1, 8237 A-5
Interrupt controller 1, 8259A, Master
Timer, 8254.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

lFO-1F8
200-207
278-27F
2F8-2FF
300-31F
360-36F
378-37F
380-38F
3AO-3AF
3BO-3BF
3CO-3CF
3DO-3DF
3FO-3F7
3F8-3FF

Fixed Disk
Game I/O
Parallel printer port 2
Serial port 2
Prototype card
Reserved
Parallel printer port 1
SDLC, bisynchronous 2
Bisynchronous 1
Monochrome Display and Printer Adapter
Reserved
Color / Graphics Monitor Adapter
Diskette controller
Serial port 1

I/O Address Map

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.
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:
Mask On

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

1-28 System Board

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. 'Busy' will be latched if
the coprocessor asserts its error signal while it is busy. The
data output should be zero.

OFt

An 8-bit Out command to port FI 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 (74LS6I2).
The '-I/O channel check signal' (-I/O CH CK) is used to report
uncorrectable errors on RAM adapters on the I/O channel. This
check will create a non-maskable interrupt (NMI) if enabled (see
the figure, "I/O Address Map," for enable control). At
power-on time, the NMI is masked off and check is disabled.
Before check or NMI is enabled, the following steps should be
taken.
1. Write data in all I/O RAM-adapter memory locations; this
will establish good parity at all locations.

2. Enable 1/ a channel check.
3. Enable NMI.
Note: All three of these functions are performed by POST.
When a check occurs, an interrupt (NMI) will result. Check the
status bits to determine the source of the NMI (see the figure,
"I/O Address Map"). To determine the location of the failing
adapter, write to any memory location within a given adapter. If
the parity check was from that adapter, '-I/O CH CK' will be
inactive.

System Board t-29

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 clock out

•

Both

Jumper
The system board has a 3-pin, Berg-strip connector. The
placement of a jumper across the pins of the connector
determines whether the system board's 2nd 256Kb of RAM is
enabled or disabled. Following are the pin assignments for the
connector.
Pin
1
2

3

Assignments
No connection
Ground
A8 (28542)

RAM Jumper Connector(J18)

The following shows how the jumper affects RAM.

Jumper Positions
1 and 2
2 and 3

Function
Enable 2nd 256Kb of system board ram
Disable 2nd 256Kb of system board ram

RAM Jumper

Note: The normal mode is the enable mode. The disable
mode permits the 2nd 256Kb of RAM to reside on adapters
plugged into the I/O bus.

1-30 System Board

Type of Display Adapter Switch
The system board has a slide switch, the purpose of which is to
tell the system into which display adapter the primary display is
attached. Its positions are assigned as follows:
On (toward the rear of the system unit): The primary display is
attached to Color/Graphics Monitor Adapter.
Off (toward the front of the system unit): The primary display
is attached to the Monochrome Display and Printer Adapter.
Note: The primary display is activated when the system is
turned on.

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

Keyboard Controller
The keyboard controller is a single-chip microcomputer (Intel
8042) that is programmed to support the IBM Personal Computer
AT 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 will interrupt the
system when data is placed in its output buffer. The status
register contains bits that indicate if an error was detected while
receiving the data. Data may be sent to the keyboard by writing
to the keyboard controller's input buffer. The byte of data will be
sent to the keyboard serially with an odd parity bit automatically
inserted. The keyboard is required to acknowledge all data
transmissions. No transmission should be sent to the keyboard
until acknowledgment is received for the previous byte sent.

System Board 1-31

Receiving Data from the Keyboard
The keyboard sends data in a serial format using an II-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, 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.

Scan Code Translation
Scan codes, which are received from the keyboard, are converted
by the keyboard controller before they are put into the
controller's output buffer. The following figure shows the
keyboard layout with key numbers.

1-32 System Board

System Board 1-33

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

Key

System Scan Code

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

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

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

(Part 1 of 2).

1-34 System Board

Scan-Code Translation Table

Keyboard Scan Code
32
31
3A
41
49
4A
59
7C
11
29
58
05
06
04
OC
03
OB
02 or 83
OA
01
09
77

7E
6C
75
70
78
68
73
74
79
69
72

7A
70
71
7F or 84

(Part 2 of 2)

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

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

System Scan Code
30
31
32
33
34
35
36
37
38
39
3A
3B
3C
3D
3E
3F
40
41
42
43
44

45
46
47
48
49
4A
4B
4C
40
4E
4F
50
51
52
53
54

Scan-Code Translation Table

System Board 1-35

The following scan codes are reserved.
Keyboard Scan Code
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

Key
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R

Scan-Code Translation Table

1-36 System Board

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

73
74
75
76
77

78
79
7A
78
7C
70
7E
7F

Sending Data to the Keyboard
Data is sent to the keyboard 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 out of 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. If the
response contains a parity error, a hex FE is placed in the
keyboard controller's 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 time limit for the keyboard to
respond. If 25 milliseconds are exceeded, the keyboard controller
places a hex FE in its output buffer and sets the transmit and
receive time-out error bits in the status register. No retries will be
made by the keyboard controller for any transmission error.

Inhibit
The keyboard interface may be inhibited by a key-controlled
hardware switch, although all transmissions to the keyboard will
be allowed, regardless of the state of the switch. 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 command 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.

System Board 1-37

RAM on the System Board
Manufacturing Mode
Display Type
Keyboard Inhibited

o
U

Data
Bus

T
f---~p

System Reset
Gate A2D
+ Output Buffer Full - . . .
+ Input Buffer Empty------.
Keyboard Clock -~----II...

U

T

~----l

Keyboard Data --l--.---'"

TO ~--------I
Tl~------~

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 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.

Bit 1

Input Buffer Full-A 0 indicates that the keyboard
controller's input buffer (II 0 address hex 60 or 64) is

1-38 System Board

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 2

System Flag-This bit may be set to 0 or 1 by writing to
the system's flag bit in the keyboard controller's
command byte. It is set to 0 after a power on reset.

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 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 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.
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
On. 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 On.

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 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 with odd
parity.

System Board 1-39

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's 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, that 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 equal to 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 to 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

1-40 System Board

Personal Computer. This includes converting a
two-byte break sequence to the one-byte IBM
Personal Computer format.
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
clock line low. Data is not sent or received.
I

I

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 to 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
keyboard clock and data lines. The test result is placed in
the output buffer as follows:
00

No error detected.

01

The keyboard clock line is stuck low.

02

The I keyboard clock I line is stuck high.

03

The keyboard data line is stuck low.

I

I

I

I

System Board 1-41

04

The keyboard data line is stuck high.
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.

Dl

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.

EO

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

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

1-42 System Board

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 8-bit I/O ports and two test
inputs. One of the ports is assigned for input and the other for
output. The controller uses the test inputs to read the state of the
keyboard's clock line and the keyboard's data line.
I

I

I

I

System Board 1-43

The following figures show bit definitions for the input, output,
and test-input ports.
Bit 0
Bit 1
Bit 2
Bit 3
Bit 4

Bit 5

Bit 6

Bit 7

Undefined
Undefined
Undefined
Undefined
RAM on the system board
0= Disable 2nd 256Kb of system board RAM
1 = Enable 2nd 256Kb of system board RAM
Manufacturing jumper
0= Manufacturing jumper installed
1 = Jumper not installed·
Display type switch
0= Primary display attached to Color/Graphics adapter
1 = Primary display attached to Monochrome adapter
Keyboard inhibit switch
o = Keyboard inhibited
1 = Keyboard not inhibited

Input-Port Definitions

Bit 0
Bit 1
Bit 2
Bit 3
Bit 4
Bit 5
Bit 6
Bit 7

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

Output-Port Bit Definitions

Test-Input Port Bit Definitions

1-44 System Board

Real-time Clock/Complementary Metal Oxide
Semiconductor (RT /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

Description

00-00

* Real-time clock information
* Diagnostic status byte
* Shutdown status byte

DE
OF
10
11
12
13
14
15
16
17
18
19-20
2E-2F
30
31
32
33
34-3F

Diskette drive type byte - drives A and B
Reserved
Fixed disk type byte - drives C and 0
Reserved
Equipment byte
Low base memory byte
High base memory byte
Low expansion memory byte
High expansion memory 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.
Real-time Clock Information
The following figure describes real-time clock bytes and specifies
their addresses.

System Board 1-45

Byte

0
1
2
3
4

5
6
7
8
9
10
11
12
13

Function
Seconds
Second alarm
Minutes
Minute alarm
Hours
Hour alarm
Day of week
Date of month
Month
Year
Status Register A
Status Register B
Status Register C
Status Register D

Address

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

Real-Time Clock Information (addresses OO-OD)

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 is 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.768kHz time base.

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.024kHz
square wave output frequency and a 976.562
microsecond periodic interrupt rate.

1-46 System Board

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.

Bit 1

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

System Board 1-47

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.

Register C
Bit 7-Bit 4

IRQF, PF, AF, UF-These flag bits are read
only and are affected when the AlE
PIE
and UIE interrupts are enabled in register B.
I

I

Bit 3-Bit 0

I,

I

I ,

I

Reserved

Register D
Bit 7

Valid RAM Bit (VRB )-This bit is read only and
indicates the condition of the contents of the
CMOS RAM through the power sense pin. A
low state of the power sense pin indicates that the
real-time clock has lost its power (battery dead).
A 1 on the VRB indicates power on the real-time
clock and a 0 indicates that the real-time clock
has lost power.

Bits 6-Bit 0

Reserved

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

Real-time clock chip has lost power. A 0
indicates that the chip has not lost power, and a 1
indicates that the chip lost power.

1-48 System Board

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
hardware in the system.

Bit 4

Memory Size Miscompare-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
lip. "

Bit 2

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

Bit 1-Bit 0

Reserved

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. "

System Board 1-49

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

Type of first diskette drive installed:
0000

No drive is present.

0001

Double Sided Diskette Drive (48 TPI)

0010

High Capacity Diskette Drive (96 TPI)
Note: 0011 through 1111 are
reserved.

Bit 3-Bit 0

Type of second diskette drive installed:
0000

No drive is present.

0001

Double Sided Diskette Drive (48 TPI)

0010

High Capacity Diskette Drive (96 TPI)
Note: 0011 through 1111 are
reserved.

Hex address 11 contains a reserved byte.

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

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

No fixed disk drive is present.

000 1 through 1111 define type 1 through type 15
(see BIOS listing at label FD_TBL).
Bit 3-Bit 0

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

1-50 System Board

No fixed disk drive is present.

0001 through 1111 define type 1 through type 15
(see BIOS listing at label FD_TBL).
The following figure shows the BIOS fixed disk parameters.
Type

Cylinders

Heads

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

306
4
615
4
615
6
940
8
940
6
615
4
462
8
733
5
900
15
820
3
855
5
855
7
306
8
733
7
Reserved--set to zeros

Write
Pre-comp
128
300
300
512
512
no
256
no
no8
no
no
no
128
no

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

BIOS Fixed Disk Parameters

Hex address 13 contains a reserved byte.

Equipment Byte (Hex 14)
Bit 7-Bit 6

Bit 5-Bit 4

Indicates the number of diskette drives installed:
00

1 drive

01

2 drives

10

Reserved

11

Reserved

Primary display
00

Reserved

System Board 1-51

01

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

10

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

11

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

Bit 3-Bit 2

Not used.

Bit 1

Math Coprocessor presence bit:

Bit 0

o

Math Coprocessor not installed.

1

Math Coprocessor installed.

The set condition of this bit indicates that
diskette drives are 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 15-Low-byte base size

Bit 7-Bit 0

Address hex 16-High-byte base size
Valid Sizes:
Ol 000

256Kb system-board RAM

02000

512Kb system-board RAM

02800

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

1-52 System Board

Low and High Memory Expansion 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:
0200H

512Kb I/O adapter

0400H

1024Kb I/O adapter (2 adapters)

600H

1536Kb I/O adapter (3 adapters)

to
3COOH 15360Kb I/O adapter (15Mb
maximum)
Hex addresses 19 through 2D are reserved.

Checksum (Hex 2E and 2F)
Address hex 2E High byte of checksum
Address hex 2F Low byte of checksum
Note: Checksum is on addresses hex 10-20.

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:
0200H

512Kb I/O adapter

0400H

1024Kb I/O adapter

System Board 1-53

0600H

1536Kb I/O adapter

to
3COOH 15360Kb I/O adapter (15Mb

maximum)
Note: This word reflects the total expansion memory above
the 1Mb 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.

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

Set if the IBM Personal Computer AT 128KB
Memory Expansion Option is installed.

Bit 6

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

Bit 5-Bit 0

Reserved

Note: Hex addresses 34 through 3F are reserved.

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.

1-54 System Board

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.

Specifications

System Unit
Size
•

Length: 540 millimeters (21.3 inches)

•

Depth: 439 millimeters (17.3 inches)

•

Height: 162 millimeters (6.8 inches)

Weight
•

19.05 kilograms (42 pounds)

Power Cables
•

Length: 1.8 meters (6 feet)

System Board 1-55

Environment
•

•

•

Air Temperature
-

System On: 15.6 to 32.2 degrees C (60 to 90 degrees F)

-

System Off: 10 to 43 degrees C (50 to 110 degrees F)

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 per hour

Noise Level
•

Meets Class 3; 42 decibels average-noise rating

Electrical
•

VA-450

•

Range 1
-

Nominal- 115 Vac

-

Minimum - 100 Vac

1-56 System Board

•

Maximum - 125 Vac

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

Connectors
The system board has the following connectors:
•

Speaker connector (119)

•

Two power-supply connectors (PS8 and PS9)

•

Keyboard connector (J9)

•

Power LED and keylock connector (J20)

•

Battery connector (121)

The speaker connector is a 4-pin, keyed, Berg strip. The pin
assignments follow.
Phi
1

2
3
4

Function
Data out
Key
Ground
+5Vdc

Speaker Connector (J19)

The pin assignments for power-supply connectors, P8 and P9, are
as follows:

System Board 1-57

Pin
1
2

3
4
5
6
1
2

3
4
5
6

Assi~mments

Power good
+5Vdc
+12 Vdc
-12Vdc
Ground
Ground
Ground
Ground
-5Vdc
+5Vdc
+5Vdc
+5Vdc

Connector

PS8

PS9

Power Supply Connectors

The keyboard connector is a 5-pin, 90-degree Printed Circuit
Board (PCB) mounting, DIN connector. The pin assignments are
as follows:
Pin

Assi~mments

1
2

Keyboard clock
Keyboard data
Spare
Ground
+5Vdc

3
4
5

Keyboard Connector (J22)

The power LED and keylock connector is a 5-pin Berg strip. Its
pin assignments follow:
Pin

Assignments

1

LED Power
Key
Ground
Keyboard inhibit
Ground

2
3
4
5

Power LED and Keylock Connector (J20)

The battery connector is a 4-pin, keyed, Berg strip. The pin
assignments follow:

1-58 System Board

Pin
1

2
3
4

Assignments
Ground
Not Used
Not Used
6Vdc.

Battery Connector (J21)

System Board 1-59

The following figure shows the layout of the system board.

~"

,'0

I;

~ ~C3 ~"[§JO ~
p 11 P ~'
ti

Ii '18'

r';

~IJrn ~

riI1

IJ

Ii, tl, II, ~I, II, II, II' II~ ~§I: ~ [I ~ ~
,1

I/O
CHANNEL
CONNECTORS

VARIABLE

--

~~onDQ.~DDDDDOW~~~
uuB888urnD~UDUD
m mmrnm 0rn~ DOD 0 rn OJ UU

nri

mmrnmrnmmrnrn
~ mmmmmm

00[J DUu0 ~ 0uru [J

0 @l~~rJD 00 DOD D[J
!ill illilllruwmm 0D' ~~. _",,"
JUMPER

CONNECTOR

System Board Layout

1-60 System Board

~~~~~6~g~K

Logic Diagrams

'"

N

"-----~---~~
~
\'!

~

gl~ ~~;;:(.:;j,;~~~,;;:~~~~~s.;~~~~~!;i~~~~

~fg\
'~

:f~·
"

~

-

01

,~

~

3
"- <;>:'::"'''''

" "

I(;

-

N

-

-

N

0

~

....CD

CD
J:

,

-...
tn

go~~~~~8~~~O~5~~~

"0

co

0
In

-

E

....CD

II)

>tn

,J

1

~~

~
~

N

~

>2!:'!

"'M~§"

~

~iii

!2~\,!~

~

--

j:5:5:'i

I

~~~ ~

~U:;-iii;t;
III:!:

'1~~\'!

L...".
~~

"
~

S'i?
\'?!!?

System Board 1-61

..
I

~

N

(SHTI)
(SHT3)

82286

-a

rJ'1

~
lI.l

~

=
e;

(SHT6)
(SHTl)

(MOLY

(SHTI)

"

(SHT 1)

(SHT 1)
(SHT 1)
ISHT 1)
(SHT 12)

FiEAD~

PRO(ClK
M/W

CPU HLDA

-(NTL OFF

0

=-

(SHT3)

~9

CMOLY

I

lftArjy

:8

~?~o

~

SO

.,

MRDe

~

~CENLLJfn

.Oi~;F;
f

15

MB

20

vee

N

ALSO"

I

DrIR

,

'"

~U<;l7

12

I?L

FlO

(SHTI)

j
(SHT I)

12

- MEMR

ISHT 10,15,19.20

- MEMW

(SHT6,7,15,19)

-lOR

(SHT6,15,20)

-lew

(SHT 15,20)

-INTA

(SHT3,4,13,16,21)
(SHT 4,5,6)

tk'

J

12

(LR

o US)

Q

Q

e

(SHTel

"
.,

LSb't6

,
"" ,

ALSO"

DJR

1::::: "

XAO
LSAO

'" '"

I-JeLl(

II 107
(SHT 13)
(SHT4)

"

t1t==J.

'~~'

(SHT 15)

'"

16

110

I

" ,

~

~w;~ 12
~ I~
i~lA '5
DEN..

AEN/CEN

'" r

RN') -It>

r'

- RESET

22

CBA
seA

I t CA'

00

,

"
"""
Ol

7

II~

06

D7

SA'
A

~

A
A

Ub7

!

I

,,,

20

,, ""

,, "",
, "

SOD
so,

(SHT 6,13.20)

SOl
SD3

so.
50<
506

r

SD7

(SHT6,13.20)

-)(8HE

(SHT 7,10)

~g~

(SHT 6,13,19)

~

ALSZ"')

I~
(SHT 1)

08

I

DO

(SHTI)

DfR

, '
,
,
,

010

D"

DI2

A
A
A
A
A

0

.

,, :

7

'"

DI<

-

~~--

---

-

DTiR

,

LSAO
LSAQ

:~

-

,, "
,,, ,"
,,, "
"

"D
U~

1~

IV

o
m

E
II)

UI

~

,

:;~;;;:.:~:~~~~

Q::"''''~\!: :!'!
~ 9

"

)0

I

,

,

11

(SHT2)

FlO

1 USl

"
~

" 10n 11-

12

7 ~on I(J

,

,. ,.onl't

8

b ,.on l !

,

2 10f! IS

-RAS

a

(SHT8)

(SHT91

-RAS 1

(SHT81

-RAS 1

(SHT 9)

FlO

)1 U'>7

Z.

R.2

,

FlO

(SHT81

I ~Ofllb

U'>7\....i

-CAS 0 H

(SHT8)

-CAS1 L

(SHT9)

-CAS I H

(SHT 9)

-XAO

(SHT 10)

-XBHE

~

't

51

flO

q U<;:.

') lonl

8

10
II

==
=
...

,

FlO
S 10n 9

10 U<;:S\.. S

to)

Q.

....

--

I

Q'I

.....

System Board (Sheet 7 of 22)
l NOll:J3S
I

....
I

a-,

(SHT 10)

MOPINO

(SHT 10)
(SHT 6)

MOPINI
MOO

MD'
MD2

QO

'"'

Mil'<
MD>

i

3
t:cI
o

a.

MD6

MCf'lNO

MD7

Moe

MDD

MOO

,p,

MOlD

I

MOil

MDll
MOil
(SHT 6)

,02

MOl'>

5"
(SHT 4)

SA8

ISHT 21) -REFRESH

ISHT 4)
SA(!
(SHT2t) +REFRESH

~'I
-WE

FI'5e
5 2A

m
SA>

5"

SA'

SAID
(SHT 4)
(SHT 7)

SAil
5AI2

Y2

14 1A
2 IA

," lB

b ::

,

'D

,

,-------!'<

~~

US"

~2
4

"

(SHT 4)

-CA
-

12 MAl
l'j MAl
2
>C"

SA7

l't

"
"3A

SAI~

10

48

Ii :~
H

:611
L

A

,

Ab
A7

2

WE

,

U,q

SANK 0

RAS

I'>

(AS

;

RASI

I-

(9) 1281(>1; I

"~; ~'

I~ ~:
"
t------------i GSEC

U,"

"

,>0" A MA'
b

,

8

,on

I" H
HAb
'J MA7

RASI
MAO

~

MA'

7

MAZ
MAO

b
12

""

MAO
MAb
MA7

-WE
-RAsa
CASOH

RASI

:~
A2
A4

10

A"

,

A7

2

\IE

I~

SANK I

Ai

II

DECOUPLING

At>

f'",OLTAGE

r .,

I~ ~o
I I"

""

'"1,14 DIN/DOUT
'"1.14

MOIO

-RASO

MOil

MDI2

-CASOH
MDI~

MO'
MDI';

~.

DIN/DOUT

I.,

U2

(AI'S:

'1-.,O!J.F

,
I 9-.IOj.jF!

2-IO .. F

I

BANK:

TO GND

MD8

-CASOL
-RASI

DIN/DOUT
t
M"
MAS
MAb
MA7

(SHT 9,10:

"'

"

II ~A

SAI4
SAle;

1.1"1

WE
-RAsa

l~14 MAO
10 MAl

,

Uz>

1,14

MOJ

MDPOUT

UI
U7

m

1,14

MDb

(SHT 22)

ISHr

1,14

DOUT 14

U4,

DIN/DOUT

1,14

""
""
MDO

:r

MOl4

I Oli'l

1,14 DIN/DOUT

1,14

D

1

I

2-

IO~F

.

10 IJF : (I,z

.<;2.'i~

.louF: (7,11.16.20,28.
'2,~8,42,47,

(8.12,11,21,2<1.

""Q,4,,48

U8
U"
U20

U,"

'"1.14

U20
U,"

1,14

DIN/DOur
,

U,",

DIN/Dour
(<11 128 K Xl

System Board (Sheet 8 of 22)

U44

14

MDPOUTi (SHT9,10'

MDPIN 0

I IDIN

UL+S

DOUOJ Ilf

HOD

liQl
HD2
HD'
1.11t

HD'

~
HD7

TAD

~
(SHT6)

{SHT6}

r(SHT8)

+>

HAD
MAl
MA2

1 MA'

(SHT6)

\FJ.
'<
[Il
~

51

=
"e;

M. .
MA>
MA'
MA7

(SHT 7)

-RAS 1

t

.,.RAS2

(SHT7)

TA2

HOD
HOI
HD2
HD'
HD'
HD'
HD'
HD7
HM
HD'
MOlD
11011
HD.
H'"
I101Lt
11011)

DIN / DOUT UZ';

~ OIN / DOUT U30

HD'

1.11+ DiN / OOUT U;')I
1,14

OlN /OOllT
AD
AI

'iii

""

~!~

~

I

I I I I

8ANK 2

.=!!&.1

~

=ciST[
(Q)

"
,

11

128K XI

I

I. PI

",0

---.!..tIlt

i

1.11f
1,11+

17

'DIN

ULf6

DINI DOUr UI+

~UIO

DIN/oour U22

MDPJN 0
I1DPIN I
MDPOIJTO
MOPOIJTI

(SHT 22)

- TWE

1

DECOUPLING CAP:
I
BANK

VOLTAGE

IOuF : O,It,'iIt,SS

TO GNO

+S

19-.IDuF I 9-.tOuF

.IOuF: (Q,EI,t8,22,lO
~It,ItO,'+It,1t9

(IO,IIf'\9,2;,,1

-CASIL
-CASIH

(SHT 10)
(SHT 10)
(SHT8)
(SHT8)

8ANK

DIN / DOUT UI6

lS,III,It'),,;O

c.

(9)

""'I "
=-~

1261< XI

System Board (Sheet 9 of 22)
1 NOll:J3S

a~;-

.i:;;(~~~!!c:i!;i ~S"!i;:i~!i~~gQ~~g:&81:i1tl~
g~

~~~

~~N

~

_~e

~

~e

N

I~

2

~~

S

!i0i~~:l~~!:i~s:l;~~~U:~8521:;i!i~.8bltfc ~:
g~

~

~3

~~

N

= -

~

-

N

C'II
C'II

'0
o
....

.
CD

.c

-..
en
'2
o

ID

E

.I J.I J

1-70 System Board

.!

~

f-

rt~O
~g::o~dd-

~9
5 "

."

vIC

e

'!:

'Cr'o

.......

I

C\I
C\I

o

,...
,...

I

CP
CP
.c::

!

~.~---

!

~
"

,-

"
~

"
«on

v

.. muow LL"':t:_

CP

[J" ·m
"

I

,

I

1

I

11)

~
0

I

Ii
I

;;;
E

I

I

0

-

o

ID

3

Q..., .... <:>7_

.(~ T"
"

.-

...ca

I

I

w

w

'C

l

I

I

System Board 1-71

"

"-

""-

"~

.

~

N

~

.
..

~

~

~

;;: do~:;;;d;:'

-' -.
m

'---:=:J-

t=

:l
~

""-

"

~~

" ~N ~

"

"-

~

""- "~

"

1-72 System Board

~

~

"-

~

~

'"

~

,
"
"-

(SHT 6)

DIR 24'5

(SHT2)

SOD

ALSZ4'5
501

SO,
SDl
SD'
SO,
SO.

====
====

SOD
I

~

501

===

(SHT 6) GATE 24'5

------;

1

(SHT 2)

(SHT2)

50s

'"

1

(SHT2)

SOlO
SDII
5DI2
5013

5014
SOI'i

,

~4

A
A
A

'
,4

A
•A
A
A

,

;.;!t.

-

'
1
•

507

~ @IR

SO,
10

B1

"
501,

:

5014

12

1

501'5

B

Ul0Z

===
===

===
===

SD~a

B"
B
B
B 14

.
•
'.
•
"·

AL52

,

500

It,
B
B
B
B

8 •

,
•
4

' A

4 •

507

+A(I(

I~ ALSOII
(SHT 3)

HLOA

(SHT 191-MASTER

~II

I

,-----l

ALSO'!

" U81

(SHT 15)

ie

=
~

XA9
XAS

~U8Lt

-XIOR

(SHT 3)

-NPCS

(SHT 2)

- INTA

~04
Ii UI21
II

12

XO'
X04

B "
B"

Xo;

:

XD1

<0.

I~

(SHT 14,15,16,17,18)
(SHT 3,14,15,16,17,18)

U II,

1

~
'i

X02

-ACK
B

2 ALS27

(SHT 5)
(SHT 5)

~
CIR

ISH1,4rI6,,,,'8)

XOO
XOI

"
12
11
14

(SHT 3)
(SHT4,15)

+,6,(1(

-ACK

U6Z'

10

,,

(SHT 5)

X/6

1 •

(SHT 5)
(SHT 5)

XAb
XA7

,

ALSI ;a
YO
YI

I;

,,,

C

Ilf

Y1

,
4

0'.
02B

L-J.: 01

Y4

1

'('5

10

-OMA I CS
-INTRles

(SHT 14)
(SHT16)

-TIC
-PPI

(SHT16)

(S

cs

(SHT 18)

-PG REG (S (SHT 15)

-UlTR 2CS (SHT 16)

Vb

'

-DMAzes

(SHT14)

Y1

1

CS2B7

(SHT3)

UI 2,

""""
I

-..J
~

System Board (Sheet 13 of 22)
L NOI1:ns

1

-

-...
N
N

o

..

~

CD
CD

.c:::
~

'E

IV

o

III

..

E
CD

1/1

>-

t/)

i

1- 7 4 System Board

~L
0'

~

N

5

-

~~L.
~~

~

C'I

o
It)
,..

....

-

G)
G)

.t:.

D

~"<~

!!
"EI'CI

•

o

85~~~~888g~~ ~~~5 ~I$~

III

, ••

E

2-,.e'WI *••

G)

~ttt~~~~=m~

~

m

~~

~"''''

trtrtr

>'l.~'!!.

;::~
u
~\2.

System Board 1-75

-.....
Cii'
N

o

CD
CD
II)

"i-

.c

f/)

.,J

1-76 System Board

£

'"

'8

.•
£

N

~

~

rn" '~'W mt
J'

....

-...
N

N

o

,..
"'"
G)
G)

~----.----i-l--H-1--l-J-l--l

.c

~

'EIII
o

ID

E
G)

i

U)

System Board 1-77

ID

~!?!?

"

III

!!U!].(,£

'!l

'!l

~

m

",

~

I

C\I

-...
N

o

CXI

....CD
CD

.c
~

'E
as
o

~Q

N

<

c

1!i1

Itj ~

~~

~§

N

In

F"

E
CD

7ii
>t
rn

>

~
"

000
,~

~

~~§~~

~~I~

'~~I

.... \100'0

'---------h

r<

:g

::!

~

:5
2.

~S2~~~e~

1-78 Svstem Board

;:;

I

-IJ1~~,tl

g1iHgg~8

011'.., ....

"

--

O-NII'''

~~~~ ~g~~~

o
en
.-

7?r~,~~~~~~~~~~~~~~~~~
"~~~~~~~~~~~--~~~~~~

-'~~---~~~~~~~--~~~~~~~

Q)
Q)

.c:::

~

'Eca
o

In

E
Q)

'li)

Ii

~m
I

I

I

I

System Board 1-79

-=
I

oc

rJJ.

'<
~
~

a
==
~

0

=-

(SHT2)

1

(SHT2)
(SHT4}

I

500
501
502
SO,
504
505
506
507
SAO
SAl
SAl
SA>
5,"

SA'

SA.
SA7
SA8
SAO

SAIO

SAil
511.12

sm

SAIL4
SAI15
SAlb
SAI7
SAI8
(SHT4)

SAIQ

(SHT2)
(SHT2)
(SHT?)
(SHT7)

-lOR
-lOW

(SHT31
{SHT 10j
(SHT14)
(SHT3)
(SHT3)

-5 MEMR

-5 MEMW
SYSC L K

OSC
TIC

AEN
RESET DRV

(SHT 14)
(SHT 14)
(SHT 14)

-REFRESH
-DACK I
-DACK 2
-DACK '3

(SHT3)
(SHT 22)

BALE
OWS

(SHT21)

AO.
A08
A07
AD.

ADS
A04

AD'
A02
."

0
A •
A 8

JI

J2
J'

+,

+5

J4
J'

02.
J\_
J7

4.7K

J8

Oil
IKO

:°ci

-I/O (H (K

A27
A26

110 CH ROY

(SHT3)
(SHT 12,15,21)

IRQ q

(SHT 16)

A2'

AZ'
A22
I
0
AI.
AI8
AI7
AI6
AIS
AI4
An
AI2
BI4

Ba<
82'
BZ.
B"
B22
B21

IRQ "3

IRQ '+
[RG r;

IRQ b

81.
B06
BI6

""

BI2
BII

B'
B27
All
B02

-----~
826
81S
828
B08

(SHT 16)

DRQ I
DRQ2

DRG '3

(SHT 14)
(SHT 14)
(SHT 14)

PWR GOOD

(SHT 1,18)

lTP"
PS8
POWEI

820

~N

B09

+12

,~

807

-12

4

8"
801
810

G

10";,+

(X26)

+.04M
(X24)

BOS

BO'

~

+,

1 1

System Board (Sheet 20 of 22)

-0

P

~~'~
~

-, i ~
4

R~
-

I

GOOD
C
C
C

~

C

"

DC

!

IRQ 7

~

c

~

"

~

~

~

Q

~ "~
~~

N
('II

o

"

~

"

~

.

&

~

.

"

~

~'E-

L

.
~

"
~

System Board 1-81

...m

'a

o

ID

E
CD

I I)

"

~

v

,
'::'~

~--\-+-- -----~o+

~
3~

,
r
'!!

.~~

r

'"

"""
~~~

rrr

1-82 System Board

~

~

~~

r

rrr

I~

~M'"
00

WWOO

r

00

"'
00

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 with extreme
accuracy.
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 provide the
equivalent capacity of the 40 16-bit registers in the
microprocessor. 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. The following figure shows
representations of large and small numbers in each data type.

Coprocessor 2-3

Data Type

Bits

Significant
Digits
(Decimal)

Approximate Range (Decimal)

Word Integer
Short Integer
Long Integer
Packed Decimal
Short Real *
Long Real *
Temporary Real

16
32
64
80
32
64
80

4
9
19
18
6-7
15-16
19

-32.768~ x ~+32.767
-2 x 109 < x <+2 x 109
-9 x 1018~ x-~+9 x 1018
-99 ... 99~ x :;;+99 ... 99 (18 digits)
8.43 x 10- 37 < x <3.37 x 1038
4.19 x 10- 307< x - < 1.67 x 10308
3.4 x 10- 4932 x 1.2 x 104932

< <

Data Types

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

Hardware Interface
The math coprocessor uses the same clock generator as the
microprocessor. It works at one-third the frequency of the system
microprocessor clock. The coprocessor is wired so that it
functions as an I/O device through I/O port addresses hex OOF8,
OOF A, and OOFe. 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 busy 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 BUSY signal to the
coprocessor to be held in the busy state. The BUSY signal may
be cleared by an 8-bit I/O Write command to address hex FO
with DO through D7 equal to O.
I

I

I

I

The power-on-self test code in the system ROM enables
hardware interrupt 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

2-4 Coprocessor

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 or
an I/O write operation to port hex OOFl, 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 OOFl, 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-3
Output Protection ................................. 3-4
Dummy Load ..................................... 3-4
Output Voltage Sequencing .......................... 3-4
No-Load Operation

3-5

Power-Good Signal ................................ 3-5
Fan-Out ..................................... 3-6
Connectors ...................................... 3-6

Power Supply 3-1

Notes:

3-2 Power Supply

The system's 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 SO ±3 Hz and it can operate at 110 Vac, S A or 220/240 Vac,
2.S 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

Maximum 5

115 Vac
Maximum 125

Minimum 200

Maximum 3.0

230 Vac
Maximum 240

Input Requirements

Note: The maximum in-rush current is 100 A.

Outputs
The power supply provides +S, -S, + 12, and -12 Vdc. The
following figure shows the load current and regulation tolerance
for the voltages.
Note: The power supply also supplies either lIS Vac or 230
Vac for the IBM Monochrome Display.

Power Supply 3-3

Nominal
Output
+5Vdc
-5Vdc
+12 Vdc
-12 Vdc

Load Current (AI
Min
7.0
0.0
2.5
0.0

Max
19.8
0.3
7.3
0.3

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

DC Load Requirements

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

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

Dummy Load must be connected to PIO. The Dummy Load is a
5 ohm, 50 watt resistor.

Output Voltage Sequencing
Under normal conditions, the output voltage levels track within
300 milliseconds of each other when power is applied to, or
removed from the power supply, provided at least minimum
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 cycle will be
required. The power supply requires a minimum load for proper
operation.

Power-Good Signal
The power supply provides a 'power-good' signal to indicate
proper operation of the power supply.
When the supply is switched off for a minimum of 1 second and
then switched on, the 'power-good' 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 power-good signal is also a TTL-compatible high level for
normal operation, or a low level for fault conditions. The ac fail
signal causes power-good to go to a low level at least 1
millisecond before any output voltage falls below the regulation
limits. The operating point used as a reference for measuring the
1 millisecond is normal operation at minimum line voltage and
maximum load.
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. The following figure shows the
minimum sense levels for the output voltages.

Power Supply 3-5

Level (Vdc)
+5
-5
+12
-12

Minimum (Vdc)
+4.5
-3.75
+10.8
-10.4

Sense Levels

Fan-Out
Fan-out is the number of inputs that one output can drive. The
I power-good I signal can drive six standard TTL loads.

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

3-6 Power Supply

Load Point
PSB-1
PSB-2
PSB-3
PSB-4
PSB-5
PSB-6

Voltage (Vdc)
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
3.B
3.B
3.B

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

+12
Ground
Ground
+5

2.B
0.0
0.0
1.B

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

+12
Ground
Ground
+5

2.B
0.0
0.0
1.B

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

+12
Ground
Ground
+5

1.0
0.0
0.0
0.6

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 ......................................
Interface .....................................
Sequencing Key Code Scanning ...................
Keyboard Buffer ...............................
Keys ........................................

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

Functions Performed at Power-On Time ................ 4-4
Power-On Reset ............................... 4-4
Basic Assurance Test .. . . . . . . . . . . . . . . . . . . . . . . . . .. 4-4
Commands from the System ..........................
Reset (Hex FF) .............................
Resend (Hex FE) ............................
No-Operation (NOP) (Hex FD through F7) .......
Set Default (Hex F6) .........................
Default Disable (Hex F5) .....................
Enable (Hex F4) ............................
Set Typematic Rate/Delay (Hex F3) ............
No-Operation (NOP) (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

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

4-12
4-12
4-12
4-13
4-13
4-13
4-13
4-13

Keyboard 4-1

Clock and Data Signals ............................ 4-14
Keyboard Data Output ......................... 4-15
Keyboard Data Input ................ . . . . . . . . . .. 4-15
Keyboard Layout .........................•.......
U.S. English Keyboard .......... . . . . . . . . . . . ..
U.K. English Keyboard ......................
French Keyboard ...........................
GennanKeyboard ..........................
Italian Keyboard ...........................
Spanish Keyboard ..........................

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

Specifications .•......•................•••.......
Size .....................................
Weight ...................................
Keyboard Connector ...........................

4-23
4-23
4-23
4-23

4-2 Keyboard

Description
The keyboard is a low-profile, 84 key, detachable unit.

Interface
The keyboard uses a bidirectional serial interface to carry signals
between the keyboard and system unit.

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 keylock 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
characters in 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 4-3

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
Fa).
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.

Functions Performed at Power-On Time

Power-On Reset
The keyboard logic generates a paR when power is applied to the
keyboard. The POR lasts a minimum of 300 milliseconds and a
maximum of 9 seconds.
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.

Basic Assurance Test
Immediately following the paR, 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

4-4 Keyboard

(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 paR.)
The BAT can also be started by a Reset command.
After the BAT, and when the interface is enabled ( clock 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

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 acknowledge signal (ACK) and ensures the
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
I

I

I

I

I

I

I

I

I

I,

Keyboard 4-5

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
res end 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 I ACK I , 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.

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

I,

4-6 Keyboard

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 ±200/0. 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 Rate

Bit Rate

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

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

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.6
8.0

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

Typematic Rate

The keyboard responds to the Set Typematic Rate Delay
command with an I ACK I , 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
I

I,

Keyboard 4-7

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.
It is up to the using system to remember the previous state of an
indicator. This is in case its setting does not change when a
command sequence is issued to change the state of another
indicator.

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.
The command has the following format:

4-8 Keyboard

I Command

I Options

Set/Reset Command

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 format of the option byte is as follows:
Bit 7

Reserved

Bit 6

Reserved

Bit 5

Reserved

Bit 4

Reserved

Bit 3

Reserved

Bit 2

Caps Lock indicator

Bit 1

Numeric Lock indicator

Bit 0

Scroll Lock indicator

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 I ACK I , 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 in 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.

Keyboard 4-9

Keyboard Outputs

Key Scan Codes
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. The following figure is a keyboard layout.

4-10 Keyboard

Keyboard 4-11

The following figure lists the positions of the keys and their make
scan codes.
Key Positions and Their Make Codes

1--0E
2--16
3--lE
4--26
5--25
6--2E
7--36
8--3D
9--3E
10--46
11--45
12--4E
13--55
14--50
15--66
16--00
17--15

18--10
19--24
20--20
21--2C
22--35
23--3C
24--43
25--44
26--40
27--54
28--58
30--14
31--1 C
32--18
33--23
34--28
35--34

36--33
37--38
38--42
39--48
40--4C
41--52
43--5A
44--12
46--1A
47--22
48--21
49--2A
50--32
51--31
52--3A
53--41
54--49

55--4A
56--51
57--59
58--11
60--19
61--29
64--58
65--06
66--0C
67--08
68--0A
69--09
70--05
71--04
72--03
73--83
74--01

90--76
91--6C
92--68
93--69
94--77
96--75
97--73
98--72
99--70
100--7E
101--70
102--74
103-7A
104--71
105--84
106--7C
107--78

Make Scan Codes

Command Codes to the System
The command codes described here are those sent by the
keyboard. The codes 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.

ACK (Hex FA)
The keyboard issues an ACK response to any valid input other
than an Echo or Resend command. If the keyboard is interrupted
I

4-12 Keyboard

I

while sending I ACK I , it will discard I ACK I 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.

Keyboard 4-13

Clock and Data Signals
The keyboard and system communicate over the I clock I and
data 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 II-bit
data streams that are sent serially over the serial data line. The
following figure shows the structure of the data stream.
Bit
1st bit
2nd bit
3rd bit
4th bit
5th bit
6th bit
7th bit
8th bit
9th bit
10th bit
11th bit

Function

o start bit
Data bit 0 (least-significant)
Data bit 1
Data bit 2
Data bit 3
Data bit4
Data bit 5
Data bit 6
Data bit 7 (most-significant)
Parity bit (odd parity)
Stop bit

Transmission Data Stream

The parity bit is either I or 0, and the eight data bits, plus the
parity bit, always have 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-14 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 clock
and data lines. If the clock line is low (inhibit status), data is
stored in the keyboard buffer. If the clock line is high and
I data I is low (request-to-send), data is stored in the keyboard
buffer, and the keyboard receives system data.
I

I

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 before the falling edge and beyond the rising edge of
clock 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

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 clock line to a negative level.
If the keyboard transmission is beyond the tenth clock, the system
must receive the transmission.
I

I

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 ( data line
will be low), it allows the I clock I line to go to a positive level.
I

I

I

I

Keyboard 4-15

The keyboard checks the state of the I clock I 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 I data I 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.
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.

Keyboard Layout
The IBM Personal Computer AT Keyboard is available in six
different layouts:
•

U.S. English

•

U.K. English

•

French

•

German

•

Italian

•

Spanish

The following pages show all six possible keyboard layouts.

4-16 Keyboard

.rtJ.~

i....
rIJ.

=-

i

l

~

a.

~

.........
".
I

tr

NOI1~HS

...

....
QC
I

~
~

'<

==
...
=~

~

.~

~

--.=-

(JC!

r.I'1

~

~
Q

.
~

Q..

i

i

l

[
~
01:00.

....'C
I

17

NOIl:l~S

German Keyboard

4-20 Keyboard

g...
~

~

i

a

~

a.

[

""
I

N

....
t NDl133S

.1::0.
I
~
~

~

g

a

rJJ.

"C

!i....
III

=-

i

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)

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

2
3
4
5

Signal Name

Clock
Data
Spare
Ground
+5Vdc

Keyboard Connector

Keyboard 4-23

01:0.
I

N

01:0.

t

0
00

)

o

NOTES:

A1

PARTIAL VIEW

A-A

SOLDERING: THIS MANUFACTURING PROCESS
MAY INCWDE HAZARDOUS OPERATIONS AND
REQUIRE SPECIAL HEALTH AND/OR
SAFETY PRECAUTIONS.

~

~ POLARIZE PI AT POSITION A1

+~

PI

GND

~

B2

P02AQ A3

+~

CI

+~ 81

r

PI

LJ.

GND
N/C

~ B~ -0
~I

b

~2

"0

~,

d

0

RI

P22 AI
UI
7406

B
L _________ ..JB

LED 2

P2d BI

~I~

P20,A2

,,"-

2

ED1

/'i':;\+

LED~LED

R1

COMPONENT SIDE"
CARD ------

U

"\

LARGE HOLE

HOLDER

PARTIAL VIEW

Enhancement Logic Card Assembly

B- B

SECTION 5. SYSTEM BIOS

Contents
System BIOS .................................... 5-3
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-11
System Board Additional ROM Modules ......... 5-12
Keyboard Encoding and Usage ................... 5-12
Encoding ................................. 5 -12
Character Codes ........................... 5-13
Extended Codes .............................. 5-17
Extended Functions ......................... 5 -17
Special Handling ........................... 5 -21

System BIOS 5-1

Notes:

5-2 System BIOS

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. Additional ROM modules may be placed on option
adapters to provide device level control for that option adapter.
BIOS routines enable the assembler language programmer to
perform block (disk or diskette) or character-level I/O operations
without concern for device address and characteristics. System
services, such as time-of-day and memory size determination, are
provided by the BIOS.
If the sockets labeled V17 and V37 on the system board are
empty, additional ROM modules may be placed 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 "System
Board Additional ROM Modules" later in this section.

The goal of the ROM 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 protects
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
become transparent to user programs.
The IBM Personal Computer MACRO 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 BIOS is through program interrupts of the 80286 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 80286 in the real mode, INT 12H
will invoke the BIOS routine for determining the memory size and
return 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 lKb
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:
MOV AH,t

;function is to set time-of -day

MOV CX,HIGH COUNT

;establish the current time

MOV DX.LOW COUNT
INT tAH

;set the time

To read the time of day:
MOV AH,O

;function is to read time-of-day

INT tAH

;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.

5-4 System BIOS

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

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

0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
10
11
12

4C-4F
50-53
54-57

13
14
15

Diskette / Disk
Communications
Cassette

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

16
17
18
19
1A
1B
1C
1D
1E
1F

Keyboard
Printer
Resident BASIC
Bootstrap
Time of Day
Keyboard Break
Timer Tick
Video Initialization
Diskette Parameters
Video Graohics Chars

Name
Divide by Zero
Single Step
Nonmaskable
Breakpoint
Overflow
Print Screen
Reserved
Reserved
Time of Day
Keyboard
Reserved
Communications
Communications
Alternate Printer
Diskette
Printer
Video

Equipment Check
Memory

BIOS Entrv
D11
D11
NMIINT
D11
D11
PRINT SCREEN
D11
D11
TIMER INT
KBINT
D11
D11
D11
D11
DISK INT
D11
VIDEO 10
EQUIPMENT
MEMORY SIZE
DETERMINE
DISKETTE 10
RS23210
CASSETTE
10/System
Extensions
KEYBOARD 10
PRINTER 10
F600:0000
BOOT STRAP
TIME OF DAY
DUMMY RETURN
DUMMY RETURN
VIDEO PARMS
DISK BASE
0

80286 Program Interrupt listing (Real Mode Only)

System BIOS 5-5

The following figure shows hardware, BASIC, and DOS reserved
interrupts.
Address
80-83
84-87
88-8B
8c-8F
90-93
94-97
98-9B
9C-9F
AO-FF
100-17F
180-19F
1AO-1BF
1CO-1C3
1C4-1C7
1C8-1CB
1CC-1CF
100-103
104-107

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

72
73
74
75

108-1 DB
1DC-1DF
1 EO-1 FF
200-217
218-3C3

76

3C4-3FF

F1-FF

77
78-7F
80-85
86-FO

Function
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
Reserved for user program interrupts
Not used
IRQ 8 Realtime clock INT (BIOS entry
RTC INT)
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 011)
IRQ 15 (BIOS entry 011)
Not used
Reserved by BASIC
Used by BASIC interpreter while BASIC is
running
Not used

Hardware, BASIC, and DOS Interrupts

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

Device open

•

Device closed

• Program termination
• Event wait

5-6 System BIOS

• Joystick support
•

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 IB--Keyboard Break Address: This vector points to
the code that will be executed when the Ctrl and Break keys are
pressed on the keyboard. The vector is invoked while responding
to 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.
Control may be retained by this routine with the following
problems:
•

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 1 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.

System BIOS 5-7

Interrupt 1D--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
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 1E--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
paramelers 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 1F --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 lKb, 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 an IBM Personal Computer AT
Fixed Disk and Diskette Drive Adapter is installed, the BIOS
routines use interrupt 40 to revector the diskette pointer.

Interrupt 41 and 46: 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.

5-8 System BIOS

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
addresses of any RS-232C adapters attached to the system.
Locations hex 408 to 40F contain the base addresses of the
printer adapter.
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

51 A-51 D

BASIC

Function
See BIOS listing
Reserved
Reserved as intra-application communication
area for any application
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
Clock interrupt vector segment: offset store
Break key interrupt vector segment: offset
store
Disk error interrupt vector segment: offset
store

Reserved Memory Locations

If you do a DEF SEG (default workspace segment):

System BIOS 5-9

Offset
2E
347
30
358

Length
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
default is 3.
Example
100 PRINT PEEK (&H2E)
L
Hex 64

o. The

+ 256 x PEEK (&H2F)

H
Hex 00

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

BIOS interrupt vectors
Available 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.

5-10 System BIOS

If an error is reported by the disk or diskette code, you should

reset the drive adapter and retry the operation. A specified
number of retries should be required for diskette reads to ensure
that 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 programmer should restore the original environment. 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.

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

Byte 1

HexAA

Byte 2

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

Byte 3

Entry via 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.

System BIOS 5-11

When the POST identifies a valid ROM, it does a far call to byte
3 of the ROM, which should be executable code. The adapter
may now perform its power-on initialization tasks. The adapter's
ROM should now return control to the BIOS routines by
executing a far return.

System Board Additional ROM Modules
The POST provides a way to integrate additional ROM modules'
code into the system. These modules are placed in the sockets
marked U17 and U37 if they are empty. 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 hex EOOOO through EFFFF are scanned in
a 64K block in search of a valid checksum. Valid ROM is defined
as follows:
Byte 0

Hex 55

Bytel

HexAA

Byte 2

Not used

Byte 3

Entry via 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 hex EFFFF.
When the POST identifies a valid ROM at this segment, it does a
far call to byte 3 of the ROM, which should be executable code.

Keyboard Encoding and Usage
Encoding
The keyboard routine provided by IBM in the ROM scan codes
into what will be termed Extended ASCII

5-12 System BIOS

Extended ASCII encompasses one-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 following character codes 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 Section 7 for the
exact codes.

System BIOS 5-13

The following figure is a keyboard layout showing the key
positions.

5-14 System BIOS

Kev
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 Ctrl
31
32
33
34
35
36
37
38
39
40
41
1
44 Shift
14
46
47
48
49
50

Upper Case

Base Case
Esc
1
2
3
4
5
6
7
8
9
0

Esc
!
@

#

$

%
--,

&

*
(
)

-

+

=

Backspace(008)
_(009)
q
e
r
t
y
u
i

Backspace(008)
_(Note 1)
Q
W
E
R
T
Y
U
I

0

0

p

P
{
}
CR
-1
A
S
D
F
G
H

w

[

1

CR
-1
a
s
d
f
9
h
j
k
I

J
K
L
:

Q

•

-1

-1

\
z
x
c

v
b

(Part 1 of1).

0

I
Z
X
C
V
B

Ctrl
Esc
-1
NuI(OOO) Note 1
-1
-1
-1
RS(030)
-1
-1
-1
-1
US(031)
-1
De1(127)
-1
DC1(017)
ETB(023)
ENQ(005)
DC2(018)
DC4(020)
EM(025)
NAK(021)
HT(009)
S1(015)
DLE(016)
Esc(027)
GS(029)
LF(010)
-1
SOH(OOl)
DC3(019)
EOT(004)
ACK(006)
BEL(007)
BS(008)
LF(010)
VT(Oll)
FF(012)
-1
-1
-1
-1
FS(028)
SUB(026)
CAN(024)
ETX(003)
SYN(022)
STX(022)

Alt
-1
Note
Note
Note
Note
Note
Note
Note
Note
Note
Note
Note
Note
-1
-1
Note
Note
Note
Note
Note
Note
Note
Note
Note
Note
Note
-1
-1
-1
Note
Note
Note
Note
Note
Note
Note
Note
Note
-1
-1
-1
-1
-1
Note
Note
Note
Note
Note

1
1
1
1
1
1
1
1
1
1
1
1

1
1
1
1
1
1
1
1
1
1
1

1
1
1
1
1
1
1
1
1

1
1
1
1
1

Character Codes

System BIOS 5-15

Key

Base Case

Upper Case

51
n
N
52
m
M
<
,
53
>
54
55
"7
/
-1
-1
57 Shift
106
Note 2
*
56Alt
-1
-1
61
SP
SP
64 Caps
-1
-1
Lock
Lock
Nul(Note 1)
Nul(Note 1)
70
Nul(Note 1)
Nul(Note 1)
65
Nul(Note 1)
Nul(Note 1)
71
Nul(Note 1)
Nul(Note 1)
66
Nul(Note 1)
72
Nul(Note 1)
Nul(Note 1)
Nul(Note 1)
67
73
Nul(Note 1)
Nul(Note 1)
Nul(Note 1)
Nul(Note 1)
68
Nul(Note 1)
Nul(Note 1)
74
Nul(Note 1)
Nul(Note 1)
69
-1
-1
95 Num
Lock
-1
-1
100
Scroll
Lock
Notes:
1. Refer to Extended Codes in this section.
2. Refer to Special Handling in this section.

(Part 2 of 2)

5-16 System BIOS

Ctrl

Alt

SO(014)
CR(013)
-1
-1
-1
-1
Note 1
-1
SP
-1

Note 1
Note 1
-1
-1
-1
-1
-1
-1
SP
-1

Nul(Note 1)
Nul(Note 1)
Nul(Note 1)
Nul(Note 1)
Nul(Note 1)
Nul(Note 1)
Nul(Note 1)
Nul(Note 1)
Nul(Note 1)
Nul(Note 1)
Pause(Note 2)

Nul(Note
Nul(Note
Nul(Note
Nul(Note
Nul(Note
Nul(Note
Nul(Note
Nul(Note
Nul(Note
Nul(Note
-1

Break(Note 2)

-1

Character Codes

1)
1)
1)
1)
1)
1)
1)
1)
1)
1)

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

Alt

Ctrl

tome(Note 1)
(Note 1)
Page Up(Note 1)

-1
-1
-1

Clear Screen
-1
Top of Text and
Home
-1
Reverse
Word(Note 1)
-1
Advance
Word(Note 1)
-1
Erase to
EOL(Note 1)
-1
Erase to
EOS(Note 1)
-1
Note 2

91
96
101

Num
Lock
7
8
9

107
92

-

-

4

_(Note 1)

-1
-1

97
102

5
6

-1
_(Note 1)

-1
-1

108
94

+
1

+Note 1)
End(Note 1)

-1
-1

98
102

2

3

t(Note 1)
Page Down(Note 1)

-1
-1

Ins
Del(Notes 1,2)

-1
Note 2

99
104

0

Base Case

Notes:
Refer to Extended Codes in this section.
Refer to Special Handling in this section

Special Character Codes

Extended Codes
Extended Functions
For certain functions that cannot be represented by the 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.

System BIOS 5-17

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

AltQ, W, E, R, T, Y, U, I, 0, P
Alt A, S, D, F, G, H, J, K, L
Alt Z, X, C, V, B, N, M
F1 to F10 Function keys base case
rome

-f-

Page Up and Home Cursor

nd

Page Down and Home Cursor
Ins(insert)
Del(delete)
F11 to F20(uppercase F1 to F10)
F21 to F30(Ctrl F1 to F10)
F31 to F40(Alt F1 to 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(c1ear 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 home cursor)

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 ROM keyboard routine. The following keys
result in altered shift states:
Shift: This key temporarily shifts keys 1-14, 16-28,31-41,
46-55,106, and 65-74 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-93, 96, 98, and 101-103.

5-18 System BIOS

Ctrl: This key temporarily shifts keys 3,7,13,15,17-28,31-39,
46-52,106,65-74,42, 101,92, 102,91,93,95,100, and 103 to
the Ctrl state. The Ctrl key is also used with the AU 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.
Alt: This key temporarily shifts keys 1-13, 17-26,31-39,46-52,
and 65-74 to the Alt state. The Alt key is also used with the Ctrl
and Del keys to cause the system reset function.
The Alt key also allows the user to enter any character code from
0-255 into the system from the keyboard. The user holds down
the Alt key and types the decimal value of the characters desired
on the numeric keypad (keys 91-93, 96-98, and 101-103). The
Alt key is then released. If more than three digits are typed, a
modulo-256 result is created. These three digits are interpreted as
a character code and are sent through the keyboard routine to the
system or application program. Alt is handled internal to the
keyboard routine.

Break: The combination of the Ctrl and Break keys results in the
keyboard routine signaling interrupt hex 1A. The extended
characters AL=hex 00, AH=hex 00 are also returned.
Pause: The combination of the Ctrl and Num Lock keys causes
the keyboard interrupt routine to loop, waiting for any key except
Num Lock to be pressed. This provides a system- or
application-transparent method of temporarily suspending list,
print, etc. and then resuming the operation. The key used to
resume operation is thrown away. Pause is handled internal to the
keyboard routine.

Print Screen: The combination of the Shift and PrtSc keys
results in an interrupt invoking the print screen routine. This
routine works in the alphanumeric or graphics mode, with
unrecognizable characters printing as blanks.

Caps Lock: This key shifts keys 17-26,31-39, and 46-52 to
uppercase. When Caps Lock is pressed again, it reverses the
action. Caps Lock is handled internal to the keyboard routine.

System BIOS 5-19

When Caps Lock is pressed, it toggles 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: This key is interpreted by appropriate application
programs as indicating that the use of cursor control keys should
cause windowing over the text rather than cursor movement.
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
toggles the Scroll Lock Mode indicator. If the indicator was on, it
will go off; and if it was off, it will go on.
Num Lock: This key shifts keys 90-93 and 95-104 to upper
case. 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 toggles the Num Lock Mode indicator. If
the indicator was on, it will go off; if it was off, it will go on.

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.
Sys Req
When the Sys key is pressed, a hex 8500 is placed in AX, and an
interrupt 15 is executed. When the Sys key is released, a hex
8501 is placed in AX, and another interrupt 15 is executed. If an
application is to use the Sys key, 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

5-20 System BIOS

If no, go to previous address

It is the responsibility of the application to preserve the value in

all registers, except AX, upon return. Sys is handled internal to
the keyboard routine.

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.

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

System BIOS 5-21

Notes:

5-22 System BIOS

Warning: No STACK segment
Start

Stop

Length

OOOOOH OFFFEH FFFFH
Origin
Group
Address

0000 :E729
0000:3792
0000 ,E137
OOOO,E11G
0000: 17AA
0000,0000
0000,16B9
0000,E372
0000 ,E6F2
0000,lB66
0000, E05E
0000: 0222
0000, E060
0000,OC3F
0000,0454
0000: 0405
0000, E062
0000, E066
0000; E068
0000: F859
0000,3FE2
0000, 09FB
0000:E234
0000, E25D
0000,E286
OOOO,EODO
0000: E2C6
0000: E2DF
0000, E2F8
0000,E311
0000: FA6E
0000:£164
0000,1805
0000,E174
0000:E184
0000: 17FD
0000: EC59
0000: 20A5
0000: EFC7
0000,EF57
0000: 260E
0000: 2A71
0000,28DA
0000,2816
0000,FF53
0000,1851
0000 ,E06C
0000, E085
0000, E09E
0000,EOE9
OOOQ:E32A
0000, EOFC
OOOO,E10G
0000,03E5
0000, 03EB
0000,F84D
0000,3E6C
0000' InA
0000: 187F
0000: 1884
0000,1889
0000: 188E
0000,1893
0000: 1898
0000,18B1
0000, 18B6
0000' 18BB
0000,18CO
0000' 18C5
0000, 18GA
0000, 18CF
0000: 18D4
0000,18D9
0000: 18DE
0000: 18£3
0000: 18E8
0000,18ED
0000,18F2

Name

CODE

Publics by Name

Al
AGT_DISP _PAGE
ADERR
ADERR1
BEEP
BEGIN
BLINK INT
BOOT INVA
BOOT-STRAP
BOOT-STRAP 1
C1 -

Gll
C2
C21
C30
CB042

C8042A
C8042B
CB042C

CASSETTE 1U
CASSETTE - IO 1
CHK VIDEO -

cm-

CH2
CH3

CM
CM4 A
CH4 B
C~14 - C

GM4=D
CRT GHAR GEN
D1 D11
D2
D2A
DDS

0000: 0008

DISKETTE 10

OISKETTE-IO 1
DISK_BASE DISK INT
DISK-'NT 1
DISK-1O DISK-SETUP
DSKETTE SETUP
DUHHY RETURN
DUHHY-RETURN 1

EO

0000: 18F7
0000.18Fe
0000,1901
0000,1906
0000; 190B
0000: 1910
0000,1915
0000,191A
0000,191F
0000: 1924
0000,1929
0000,192E
0000: 17.')3
0000,ElC2
0000: E393
0000, E3A8
0000: EJED
0000: E3DB
0000, E3EE
0000: E1FB
0000, E34E
0000: E2IF
0000:E152
0000: E15D
0000: E18B
0000, E1A1
0000, E2AC
0000: E2B2
0000:E401
0000:4752
0000:4392
0000: lFFO
0000,lBC6
0000,2FA4
0000,1852
0000, E8E 1
0000, E91B
0000, E955
0000: E9SF
0000:E969
0000,E976
0000: JOA9
0000,E87E

-

EO_A
EO_B
E1
E1_A
E1_B
E1_G
E30B
E30G
EQUIPMENT
EQUIPHENT 1
ERR BEEP EXC - 00
EXG 01
EXC=02
EXG 03
EXC-04
EXC 05
EXG- 06
EXC 07
EXG-08
EXC - 09
EXG 10
EXC 11
EXC-12
EXG-13
EXC=14
EXC 15
EXC=16
EXC 17
EXC-18
EXC=19

-

0000, E886
0000, E88E
0000, E8CS
0000,17D2
0000,E987
0000: 3054
0000, E82E
0000,2FG8
0000, E1D7
0000: 0010
0000: FOE4

0000, FOEC
0000, FOF4
0000, F841
0000,3E62
0000, E2G3
0000: 3E76
0000, 0411
0000, E064
0000: E06A
0000: 002e
0000: OC3F
0000, 16AO
0000,1753
0000: 187F
0000,199C
0000: 1C2D
0000: EFD2
0000,346F
0000, FF54
0000 46CC
0000: 174C
0000:1720
0000: 1719
0000,186A
0000: 176C
0000 :FFFO
0000,38F5
0000: 377B
0000,3A38
0000,3DBG
0000: 1861

EXC 20
EXC 21
EXC - 22
EXC- 23
EXC=24
EXC 25
EXC- 26
EXG 27
EXC _28
EXC 29
EXC- 30
EXC - 31
E tlSG

Fl

F1780
F178l
F1782
F1790
Fl791
F1_A
Fl B
F3F3A
F3B
F3D
F3D1
F4
F4E
FD_TBL
FILL
GATE_A20
GDT_BLD

H5
HD INT
IN't287
KID

Kll
K12

K13
K14
K15
K16
K6
Abs

K6L

K7
K8
K9
KBD_RESET
KB INT
KB-INT 1
KEYBOARD 10
KEYBOARD - IO
LOGK
-Abs

U4

H5
M6
H7
~lEHORY_SIZE

DETERHINE

}lEHORY SIZE-DETERmNE 1

NNI_'NT

-

NMI INT 1
OBF=42
OBF 42A

OBF = 42B
POST 1

POST2
POST3
POST4
POSTS
POST6
POSTl
PRINTER 10
PRINTER=IO_1
PRI:-.!T SCREEN
PRINT=SGREEN 1
PROG _ SHUTD0\1N
PROT PRT HEX

PRT HEX PRT=SEG
P HSG
P--O R
READ AC CURRENT
READ - GURSOR
READ-DOT
READ=LPEN
RE_DIRECT

ROS Map

5-23

0000,16DO
0000,IAF9
0000,16AD
0000,E739
0000,34F5
0000,462A
0000,3SA3
0000,37FF
0000,24Cl
0000,37B6
0000,3751
0000,372A
0000,364E
0000,3F2F
0000,1197
0000,114A

ROH CHECK
ROM-ERR
ROS -CHECKSUM
RS232 10
RS232=IO_l
RTC INT
SCROLL DOWN
SCROLL-UP
SEEK -

0000,174C
0000:1753
0000,1753
0000,176C
OOOO,l77A
0000,17M
0000: 1702
0000,17FD

SET COLOR

0000,1851
0000,1852
0000,1861
0000, IBM

DUMMY RETURN 1

0000; 187F

EXC DO
POSTS

OOOO,IF1A
0000,1933
0000: 1938
0000,193D
0000,1942
0000,1947
0000,194C
0000,1951
0000, FEA5
0000,4684
0000 ,FE6E
0000,445C
0000, 03C7
0000, 03D3
0000: 03F7
0000 :FEF3
0000, F065

SET-CPOS
SET-C'lYPE
SET-HaDE
SET-TOO
SHUT2
SHUT3
SHUT4
SHUT6
SHUT7
SHUT9
SlOT 810
SLAVE VECTOR TABLE
STARTSTART 1
STGTST CNT
SYSINITI
SYS 32
SYS -33
SYS - 34
SYS - 35
SYS - 36
SYS- 37
SYS- 38
THIER INT
THIER-INT 1
TIHE OF DAY
TIME-OF-DAY 1
TST4-B TST4-C
TST4-D
VECTOR TABLE
VIDEO 10

DODD: 3605

VlDEO-ro 1

0000: 169B

OOOO,11BC
0000,119A
0000,4252
0000,IFF9
0000, FF23
0000,E05B
OOOO,OOM
0000: 199C

0000: 396£
0000: 3A4C

0000,3D38
0000,1713
0000,IB25
0000,1708

Address

EXC- 04
EXC - 05
EXC=06
EXC 07

EXC- 08
EXC=09
EXC 10

0000: IBCA
0000: 18CF

EXC-ll
EXC -12
EXC -13
EXC-14
EXC -IS
EXC -16
EXC=17
EXC 18

EXC -19
EXC=20
EXC=22
EXC 23
EXC- 24
EXC- 25
EXC- 26
EXC- 27
EXC - 28
EXC-29
EXC - 30
EXC =31

0000:1933

SYS 32

SYS - 33
SYS=34
SYS 35
SYS=36

BEGIN

0000,1938
0000,193D
0000,1942
0000:1947
0000,194C
0000,1951
0000,199C
0000,199C
0000,IAF9
0000,IB25

0000: 0008

Abs

K6L

0000: 1866

0000:0010

Abs

0000, 002C
0000,00A6
0000, 0222
0000, 03C7
0000, 03D3

M4
POST!
START 1
C11 1'5'14 B
TST4=C

0000: IBC6
0000: lC2D
0000: IFIA
OOOO,IFFO
0000,IFF9
0000 20A5

0000: 03E5

E30B

0000, 03EB
0000, 03F7
0000,0405
0000, 0411
0000,0454
0000, 09FB
0000, OC3F
0000,OC3F
0000,114A
0000,1197
0000, !l9A
0000, !lBC
0000, 169B
0000,16AD
0000: 16AD
0000,16B9
0000,16DO
0000,1708
0000,1713
0000,1719
0000,1720

E30C
TST4 0
C8042
OBF 42
C30CHK VIDEO
POST2
C21
SHUn
SHUT2

5-24

EXC 01
EXC=02

0000; 18CS

0000,1804
0000,IBD9
0000,18DE
0000,18E3
0000,18E8
0000,18ED
0000,18F2
0000,18F7

SHUT7

SHUT6
SHUT4
ROS CHECKSUM
POST3
BLINK INT
RON CHECK
XPC-BYTE
XLAT PR
PRT HEX
PROT]RT_HEX

ROS Map

OOOQ:24Cl
0000: 260E
0000: 2816
0000: 28DA

0000,2A71
0000: 2FA4
0000: 2FC8

0000: 3054
0000: 30[\9

0000,346F
0000,34F5
0000,3605
0000: 364E

0000 372A
0000:3751
0000: 377B

0000,3792
0000,37B6
0000,37DC
0000: 37FF

0000: 38A3
0000,38F5
0000:393B

-

EXC 03

0000,1901
0000,1906
0000,190B
0000: 1910
0000,1915
0000.191A
0000,191F
0000: 1924
0000,1929
OOOO,I92E

Publics by Value

0000: 0000

INT 287
RE DIRECT
PRT_SEG

EXC 21

VIDEO-STATE
VIR ERR
\{RITE AC CURRENT
\VRITE - C CURRENT
WRITE-OOT
WRITE-TTY
XLAT PR
XNIT-8042
XPC BYTE

0000: EOB7
0000: 3936

0000: 18 7F
0000,IB84
0000,1889
0000,188E
0000: 1893
0000,1898
0000:18B1
0000, 18B6
0000,18BB
0000' 18CO

POST4
E_NSG
P HSG
ERR BEEP
BEEP
KBD RESET
DDSD11

0000: 18Fe

VIDEO-PARas

OOOO,FOM
0000,37DC

0000: 1805

PRoe SHUTDOWN

SYS 37

SYS- 38
POST6
STGTST CNT
Rml

xmT

ERR

8042
BOOT-STRAP 1
H5 -

POST?
SYSI:-.IITI
GDT BLD

SIDTB10
DISKETTE IO 1
SEEK

DISK INT 1
OSKETTE SETUP
DISK SETUP
DISK-JQ
HD_INT
KE YBOARD 10 1
KB I~T 1-

Kl6

-

PRI~TER

10 1

RS232 10 1VIDEO-ro-l
SET l'lODESET- CTYPE
SET=CPOS
READ CURSOR
ACT DISP PAGE
SET-COLOR
VIDEO STATE
SCROLL UP
SCROLL- DOiifN
READ AC CURRENT

,,"'RITE _AC _CURRENT

0000,396E
0000: 3A3B
0000: 3A4C
0000: 3D38
0000: 3DBC
0000: 3E62
0000: 3E6C

0000 3E76
00DO·3F2F

0000,3FE2
0000,4252
0000,4392
0000, 445C
OOOO:462A

0000,4684
0000,46CC
0000,4752
0000, E058
0000, E05E
0000, E060
0000: I062
0000, E064
0000, E066
0000: E068
0000; EGGA

0000, E06C
0000, E085
0000, E09E
0000:E087

~RITE

C CURRE~T
READ_DOT
"'RITE DOT
WRITE-TTY
READ LPEN
NHIORY SIZE DETER~llNE
EQUIP~lENT 1-

Nf!! INT 1·
SET=TODCASSETIE 10 1
SHUT9
GATE A20
TIME OF DAY 1
RTC INTTHIER INT 1
PRINT-SCREEN 1
FILL -

em

0000 :E250
0000 :E286
0000 :E2AC
0000 :E282
0000 :E2C3
0000,E2C6
0000,E20F
0000 :E2FB
0000,E311
0000,E32A
0000,E34E

CH2

0000, E150
0000, E 164
0000:E174
0000:E184

0000, E 188
OOOO:EIAI
0000,F.1C2
0000 :E1D7

0000 :E372

0000,E393
0000,E3A8

FI780
Fl781

RS232_IO
KEYBOARD 10
K6
K7
K8
K9
KID

0000:E91B

Kll

0000, E955
0000,E95F

K13

0000:E969

0000, E976
0000,E987
0000,EC59
0000, EF5 7
0000, EFC7
ODDO:EFD2

0000, F065
OOOO,FOA4

SLAVE VECTOR TABLE

DUHHY-RETURNPRINT-SCREEN
P_O_R-

INT
CH4-A
Cfl4- B
C,'4=C
CH4 D
E1 A
F1-B
BOOT INVA

F1782

0000, E8El

QOQQ:FF23

mn

F1790
Fl791
FD_TBL
BOOT STRAP
Al -

0000: E8CB

0000 ,FEF3
0000,FF53
0000, FF54
0000, FFFO

erB

0000,E30B
0000,E3EE
0000,E401
0000,E729
0000,E739
0000,E82E
0000,E87E
0000 ,E886
0000, E88E

0000: FE6E
0000 :FEAS

F4
F4E

0000 :E3BD

0000 :E6F2

0000, F859
0000,FA6E

EO -

0000 :E234

0000:£152

0000: F84D

OBr 42B

0000, E1FB
0000,E21F

0000, EOFC
0000: E IOC
0000: E lle
0000:E137

0000,F841

M5
H6
H7
HEllORY SIZE DETERHINE
EQUIPHENT CASSETTE_IO
CRT CHAR GEN
TIHE OF DAY
TIHER INT
VECTOR_TABLE

START
C1
C2
C8042A
OBF 42A
C8042B
C8042C

EO A
EO=B
VIR ERR
CH4El
E1_B
El C
ADERRI
ADERR
F3A
F3B
D1
D2
D2A
F3D
F3Dl
F1
LOCK
FlA
F3-

0000: EODO
0000: EOE9

0000,FOE4
OOOO:FOEG
0000: FOF4

K12
K14
K15
KB INT
DISKETIE 10
DISK INTDISK=BASE
PRINTER 10
VIDEO_IO
VIDEO_PARHS

ROS Map

5-25

5-26

ROS Map

TITLE T£5Tl

BIOS

I/O

11/28/83 ROM POST

INTERFACE

THESES INTERFACE LISTINGS, PROVIDE ACCESS TO BIOS ROUTINES
THESE BIOS ROUTINES ARE MEANT TO BE ACCESSED THROUGH
ANY ADDRESSES PRESENT IN
SOFTWARE INTERRUPTS ONLY,
THE LISTINGS
ARE INCLUDED
ONLY fOR
COMPLETENESS,
NOT FOR
REFERENCE.
APPLICATIONS WHICH
REFERENCE
ABSOLUT E
ADDRESSES
WITH I N
THE
CODE
SEGMENT
VIOLATE THE STRUCTURE AND DESIGN OF BIOS.

----- - --- - - - ---------- -- -- -- ----- - ---- - - -- -- -- ---- -- - ----------- - ---

PAGE

MODULES R[QU I REO
DATA.SRC
TEST1,SRG
TEST? SRC
TEST3. SRC

--">

-->

TEST4. SRC

TESTS.SRC
TEST6. SRC

-->

-->

TEST7. SRC
SYSI N IT1. SRC
GOT BLD. SRC
5101' BLD. SRC
DSKETTE. SRC
OISK.SRC
KYBD. SRC
PRT. SRC
RS232. SRC
VI DE01. SRC
BIOS.SRC

DATA AREA
TEST.01 THRU TEST. 16
TEST.17 THRU TEST. 22
PROCEDURES
ROS CHECKSUM
BLINI\_INT
ROM_CHECK
XPC BYrE
PRT-HEX
PROT PRT HEX
PROC-SHUTDOWN
E MSG
P-MSG
BEEP
ERR BEEP
KBO-RESET
Dll-DUMMY I NT HANDLER
I NTl3 - X?87 HANDLER
PRT SEG
ODSHARDWARE I NT 9 HANDLER (TYPE 71)
EXCEPTION INTERRUPTS
STGTST CNT
ROM ERR
xMIT 8042
BOOT-STRAP
PROTECTED MODE TEST
BU I LO PROTECTED MODE DESCR I PTORS
DISKETTE BIOS
HARD FI LE BIOS
KEYBOARD B I OS
PRINTER BIOS
RS232 BIOS
VIDEO BIOS
MEM SIZE
EQUIP_DET
NMI

SET TOO
DUMMY-CASSETTE (INT 15)
DEVICE OPEN
DEVICE CLOSE
PROGRAM TERM J NAT I ON
EVENT WA I T
JOYSTICK SUPPORT
SYSTEM REQUEST KEY
WAI T
MOVE BLOCK
EXTENOEn MFMORY SIZE DETERMINE
PROCESSOR TO V I RTUAL MODE
TIME OF DAY
TIMERl INT
PR I NT SCREEN
PC COMPATABILITY AND TABLES
POST ERROR MESSAGES

BIOS1.SRC

B I OS2. SRC
ORGS. SRC

0
0
0

0000
0000

oouo

= Dora
= 0020
= 0010
0

0000
8000

= FFFF
=
= 0000

c
c
c
c
c
c
c
c
c
c

INCLUDE POSTEQU. SRC
EQUATES
TEST
KY LOCK
KEY_NUMS

EQU
EQU
EQU

X287

EQU

OFOH

; MATH

EQU

Q20H

;

MFG LOOP POST JUMPER

C
C
C
C

c

C
C

c
c

;
;
;

0

0060
0061

C
C

OOF3
DO De

C

0040

C

= ooeo
0
0
0

= 0080
0

0064

0

0001

= 0002
= 0004
0008
= 0010
0020
= 0040
= 0080
= OOFE

c
c

C
C
C
C

C
C

0

C
C

0

C
C
C

0

QOAB

0

ODED
0001

0

C
C
C
C

C
0

0080
0001
0002
0004
0008
0010
0020
0040

C
C
C
C
C
C
C
C
C

PROCESSOR

EQU

0101'1

;

REFRESH TEST BIT

POST SS
POST-SP
TEMP-STACK LO
TEMP=STACK::::H!

EQU
EQU
EQU
EQU

OH
8000li
OFFFFH

;
;

POST STACK SEGMENT
PO:;T STACK POINTER

PORT A
PORT-B
PAR ITY ERR
RAM PAR ON
RAM-PAR-OFF
10 CHK PRTY_CHK

EQU
EQU
EQU
EQU

o

c

0

CONDITIONAL ASH {TEST2.SRCj
CONDITIONAL ASM (TEST2.SRC)
CONDITIONAL ASM (KYBD.SRCj

. -- -- -- - ------------ - ----------- -- --- -- -------------- - ------------- -- - -- - ----

[QU

EQU
EQU

60H
61H
OCOH
111100119
00001100B
010000008
100000008

~

SET PROTECTED

; 0: FFFFH

~ODE

TEMP SS
-

8042 KEYBOARD SCAN/DIAG OUTPUTS
8042 READ WR I TE REG I STER
RAMI I 0 CHANNEL PAR I TY ERROR
AND TH! S VALUE
OR TH I S VALUE
! 0 CHECK?
PARITY CHECK?

STATUS PORT
EQU
64H
;8042 STATUS PORT
OUT_BUF_fULL
EQU
01H
0 = +OUTPUT BUFFER FULL
INPT BUF FULL
tau
02H
1 = -tINPUT BUFFER fULL
SYS_FLAGEQU
04H
2 = -SYSTEM FLAG -PORI-SELf TEST
CMD_DATA
EQU
08H
3 = -COMMANO/+OATA
KYBD_I NH
EQU
10H
4 '" +KEYBOARD I NH I B I TED
TRANS_ TMOUT
[QU
20H
5 '" +TRANS ...., ITT I M[OUT
Rev TMOUT
EQU
40H
6 = +RECE I VE T I ME OUT
PARTTY EVEN
EQU
BOH
7 = +PAR I TY I SEVEN
SHUT CMD
EQU
OFEH
CAUSE A SHUTDOWN COMMAND
EQU
OABH
CHECK 8042 INTERFACE CMD
I NTR-FACE CK
KYBD::::CLK_DATA
EQU
OEOH
GET KYSD CLOCK AND DATA CMD
KYBD_CLK
EQU
001H
; KEYBOARD CLOCK BIT a
; ----------MANUFACTVR 1NG PORT -----------------------------------------------MFG PORT
EQU
80H
; MMl'UfACTURING CH£CKf'OINT PORT
; ---=-------MANUFACTUR I NG BIT DEF I NIT I ON FOR MFG_ERR_fLAG+1 ------------------MEM_fAIL
[QU
00000001S
STORAGE TEST fAILED (ERROR 20X)
PRO_fAIL
EQU
000000108
VIRTUAL MODE TEST FAILED (ERROR 104)
LMCS_FA I L
[Qu
00000100B
LOW MEG CH I P SELECT FA IUD (E.RROR 109)
KYCLK FA I L
EQU
00001000B
KEYBOARD CLOCK TEST FA I LED (ERROR 304)
KY_SYSJAIL
EQU
00010000B
KEYBOARD OR SYSTEM FAILED (ERROR 303)
KYBD FAIL
EQU
001000008
KEYBOARD FAILED (ERROR 301)
DSK_FA I L
EQU
01 OOOOOOB
0 I SKETTE TEST FA I LED (ERROR 601)

Test 1 5-27

=

0080

c

=

0010

C
C

0020
0040

C

c

=
= 0080
= 0010
= 0020
= 0060
= DOAA
= OOGO
= QDAE
= QOAD
= OOOF
= 0000
= OOFl
= oorlj
= oorl
= OOFl
= ~OFf"
= ODED
= OOAA
= DorA
= DOFF
= OOFE
= Doro
= 0010
= 0020
= OOllO
= 0070
= 0081\
= 008B

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
C
C
C
C
C
C
C
C
C
C
C

= UOYU
QOAD
= D08F
= 0080
=
=
=
=
=
=
=
=
=

00B1
0080
0096

C

c

0095
0098

C
C
C
C

0097

0094
0092

=
=
=
=
=
=
=
=
=
=
=

COBE

=
=
=
=
=
=
=
=
=

0020
0021
0020
OUAU
UDAl
DIHO
0010

c
c
c

C
C
C
C
C
C
C

0080
OOllO

0020
0010
0008
0004
00B3
0080
0040
0020

c

-

=
=
=

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

00'10
00'13
00110

0001

0005
0000

c
c
c
c
c

0000
ODeD

= ooe1

c

D08F

C

= 0540

C

=
=
=
=
=

c

0410
0060

C
C
C
C
C

0060
0061
0080

c

= 0080
110
= 00
= OO?O
= 0010
= 0008
= 0004
= 0002
= UUOl
= 0080
= 00 110

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

0020

=
-

au

; -=--=---------

.

----=-------

COU
EOU
[qlJ

4011
4311
40ft

[QU

01

[>MII08
DMA

[QU
[QU

08
00

DMA STATUS I{[G ponf AD OR
DNA CH.O AOOR. REG POrtT AOQR

O~IA18
D~lAl

EQU
EQU

ODOH
OCOII

2ND DMA S lATUS PORT ADDR
2ND DMA CII,Q AODR. REG PORT AD DR

DMA PAGE
LAST _DHA_PAGE

EQU
E.OU

81H
8Ft!

srART OF [)~lA PAGE REGISTERS
LAST OHA PAGE REG I SHR

0010

0008
0004

c
c

= 0045
= 00116
= 0038
= 0010
= 003A
= 002A
= 0036
0052
= 0053

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

0054

= 0080
0025
= 0080
00110
= 0020
= 0010
= 0009

5-28

Test 1

porn ADDR
POR r ADDR
MASK

------ ------- --- --- -- ---- --- ----- ---- -- ---- ---- --- -- --

-

C

.- 0002

=

KEY_FAil.
CQU
10000000[)
; K[YBOARD LOC:,[D (EnrWR 302)
-----.--8'J"2 INPIJT porn BI T
I NI T ION----------------------EQU
, OH
; BASE R/W M[MOrW
EQU
2011
; LOOP POST JUMP[R
[QU
(lOll
;DISPLAY lYPE JUI1PER
[QU
SOH
;KEY~OARD INHIBIT SWITCH
RAI1 DU I NIT I ON-- ----- ----- - ---- ---- ------- -- -- -- - - ----- - ----EQU
1011
; BY1T 0 BIT 4 OF 80112 RAM
CO~IMANOS - ---- - ---- -- -- - - - ----------- -- -- ---- -- ----- --- ----EQU
201l
BITS 0-4 '"' ADDRESS (20-3F)
EQU
60H
EOU
OAAH
801le SELF TfST
H~U
OCOH
READ 80112 INPUT POl\1
fQU
OM II
ENABLE K[YBOAr{f) COI1MAND
[QU
OADH
f) I SABI_E KEYBOARD COMMAND
~_NAf3LE AODr{ LINL BIT 20
LQU
ODFH
[QU
O[)DH
OISABL[AODRlINEBIT20
KfYBOAHD! LED COMMANDS -- --- ---------- --- -- ---- -- -------- ---[aU
orlH
EQU
OF4H
EOU
()F7H
[OU
orEIl
EQU
OFFlI
[QU
OEOI1
; ---- --------- -- KEYBOARD RESPONSE ---------- -- ---- --- -- ------ -- ---- - -- - ---KB. OK
EQU
OAAt!
flESPONSE FROI·I S[Lr 0 lAG
KB-ACK
[qu
Ol-AH
ACKNO\·H_EDGE FROM TRANSMISSION
KB-OYUl. RUN
EQU
OFFH
OYER RUN
KB-RE::S[ND
EOU
OFEH
RESfND REQU[ST
KB-BREAK
EQU
OFOH
KEYBOAt\O BH[AK CODE
KB-FA
EQU
OlOH
ACK RECEIVED
W-f[
EQU
020H
RESEND RECE IVt::D FLAG
Kll PR lED
EQU
OilOH
MODE INDICATat, UPDATE:
CMOS EQUATES ------------------ ------- -- ------ - - -------- -- ---CMOS PORT
rQu
D70H
10 ADDRESS OF CMOS PORT
CLK UP
[QU
D8AH
CLOCK UPDATt:: STATUS
CMOS ALARM
EQU
D8BH
CMOS-BfG I N
EQU
090H
C~lOS-END
EQU
OALJH
SHUT-DOWN
EQU
08FH
SHUTDOWN OF c·SL 1
BATTERY STAr US
BATTERY COND STATUS EaU OeDIi
M SIZE HI
EaU
OB1H
10 MEMORY SIZE. HIGH BYTE (POST)
I1-S I ZE-LO
EQU
OBOH
I () MFMORY S I /1· 10 flYTr
(POST)
0->6110K CONFIG MEMORY SIZE (SETUP)
~fl SIZE HI
[QU
09611
LOW BYTE (SETUP)
Ml-SIZCLO
EQu
095H
M2-SIZCHI
[Qu
098H
640K->UP CONrl G MEMORY SIZE (SETUP)
lOW BYTE (SETUP)
M2-SIZCLO
[QU
097H
CMOS EqU I PI'I[NT FLAG
C Eau I PEQU
09411
HAKO FILE. TYPL 13Yll:.
HD FILE TYPE
EQU
0921i
PAGE
LACS---- -- -- ~-- ---- - -- ----- --- -- --; --------------- CMOS DIAG_STATUS ERROR
CMOS ADDRFSS OF OIAG STATUS
DIAG SIA"iUS
EQU
08EH
DEAD BATTERY
BAD SAl
EOU
080H
CHECKSUM Eki~OH
BAD-CKSUM
EaU
0401f
BAD-CONFIG
[QU
020H
MINIMUM CONFIG USED INSTEAD OF CMOS
MEMORY SIZE NOT EOUAl TO CON 1'. I G
W MtM SIZE
EQU
OlOH
HARD FILE FAilURE ON INIT
HI' FAil
EQU
D08H
CMOS ClK NOT UPDATING OR NOT VALID
CMOS ClK FAI L
EQU
004H
r;MOS INFORMATION FLAGS- -----------------------------------CMOS ADDRESS OF INFO BYTE
I NFO STATUS
[aU
083H
512K ~> 64GK CARD INSTALLED
M640"K
Equ
G80H
FLAG USED BY C~tOS SETUP UT I L I TY
NEW I NST
EQU
040H
BOOT HARD FILE FLAG
HF _BOOT
EOU
020H
INTERRUPT [QUATlS ----- -----------------------------------[QU
20H
8259 POI(T
I:.QU
21 H
8259 POI'" f
EqU
20H
EQU
(jAOH
2ND 8259
EaU
OA1H
fQU
u7()H
START OF 8259 INTERRUPT TABLE LOCATION
[qu
01011
VIOFO yeCTOR

---------- -- ----------

[QU
5 110H
MIN-PER I 00
[QU
II lOH
KBO-I N
EQU
60H
KBOINl
EQU
02
KB DATA
EQU
60H
KB-CTL
FQU
61H
K8=E!H~
EQU
80H
FLAG FQUATES WITHIN KB_FLAG
[·QU
8011
[OU
11011
EQU
20H
[QU
lOll
lQU
08H
EQU
04H
EQU
02H
EQU
0111
EQU
80H
[QU
40H
[QU
20H
EQU
10H
FQU
OBH
COU
U4H
EOU
69
[aU
(0
EaU
?6
(QU
29
EOU
~5
[QU
lie
EQU
5/1
EQU
82
EaU
83
CQu
54H
-------------- DISKETTE EQUATES
EQU
oeOH
) NT FLAG
MOTOR \1111 T
EQU
37
T I ME OUT
EQU
80H
RAO S,FK
EQU
IIOH
BAI)·-N~~C
EQU
20H
BAD-enc
EQU
10H
DMA:::'80lJNDARY
EQU
U9H

--~

-

--------- - ---

MAX PER I OD

K[YBOIIRD DATA IN ADDR PORT
KEYBOIIRD IN rR t'lASK
Kr·-YROARO sr;AN coor PORT
CONTROL BITS FOR KEYBOARD SENSE DATA
KEYBOARD TRANSt~ I T ERROR fLAG
INSeRT STATE IS ACTIVE
CAPS LOCK STATE liAS BFf.N TOCCLEO
NUM LOCK SIAII· HAS IH.lN TOGGI.FO
SCIWLL LOCK STAl E liAS BEEN TOGGLED
ALTERNATE SHIFT KEY DEPRESSED
CONTROL SH I FT KEY DE PRESSED
LEFT SH I FT KEY DEPRESSED
RIGHT SH 1FT I(EY D[pr~ESS[D
I NSERT KEY I S DEPRESSED
CAPS LOCK KEY I S DEPRESSED
NUM lOCK K[Y I S DEPRESSED
SCROLL LOCI( K~Y IS DEPRESSED
SUSPEND KlY liAS BEEN TOGGL[Q
SYS·I EM KEY DEP:{ESS([) AND HELD
SCAN CODE FOR NUMBER LOCK
SCROLL LOCK KEY
ALTERNATE SHIFT KEY SCAN CODE
SCAN CODE FOR CONTROL KEY
SCAN CODE FOR Sil I FT LOCK
SCAN CODE FOR l.EFT Sf! 1FT
SCM~ CODE FOR RIGHT SH 1FT
SCAN CO:)[ FOR I NS[RT KEY
SCAN CO~E FOR DELETE KEY
SCAN CODE FOR SYSTEM KEY
INTERRUPT OCCURHENCE fLAG
2 SECS OF COUNTS fOR MOTOR TURN OFF
ATTACHi012
POA DUAL
EQU
061 H
POA-STAHT
EQU
U80f!
,----=---- UtOS NON-VOLATILE RAM EQUAllS
CMOSUSB AODR
EQU
00 EI-I
CADR PRT
EQU
070H
COATA PRI
EQU
071H
CMOS GOO I)
EQU
()eOI!
CQU
010H
CMOSOSk IWTF
LOWNIB [au
OOFH
I NVAL I D_DRV
Eau
D02H

= 0080

=
=
=
=
=

EOU
[au
[QU
EQU
EQU
[QU

OOCO
OU10

Door

=
= 0002

DISKETll CHANGE FLAG MASK BIT
usm TO STRI P OFF STAll OF MEDIA
USFD AS MASK re)R STATt: BITS
SET STATE DETmMINEO IN STATE BITS
ISOIAH SHIFTED 1RANSFER RATE BITS
MASK TO 1 UHN ON DOUBLE STEPP I NG
MASK TO CLEAR MOTOR ON BIT S
MAX NUMBER OF DR I VES
TI{ACK 0 MASK
SCNSE DR Ive STATUS COMMAND
SErK ONE TRACK
CRASH STOP (48 TPI DRIVES)
SEEK TO TRACK 10
1.2 M HEAD SETTU: TIME'
320 K IlrAD SETTLE TIME
WRITE OPERATION FLAG
NO I) I SK CHANGE 1..1 NE AVA I LABLE
DISK CHANCE LINE AVAILABLE

DISKETTE STATUS BYTE ADDRESS
CMOS ADDRESS PORT ADDRESS
CMOS DATA PORT ADDRESS
SA TT fRY AND Gil ECKSUM I NO I CA TOk
OISKf"TTE fWT[-, ADDRESS
ISOl_Alt: LOW NIBBLE IN HlGISllH MASK
FIHST INVALID DISKETTE TYPE

TIMER DATA AI'-EA

UN

;

COUNTS SI_C
COUNTS--=M I N
; COUNTS_HOUR
; COUNTS DAY
PAGE
'

18
1092
65543
1?73040 = 1800BOH

FOU
rau
EQU

1NClUDt. DSI:_G, SRC
0:0>86

SlCMEN r A'I
srG LOCO
or{C 2-ltl~

LOCATIONS (HEAD):

0
LABEL

BYTE

LABEL

WORD

lABEL

WORD

LABEL
LABEL

WORD
DWORO

LABEL

WORD

ORG 5*4
I NT5_PTR

0014
0020
0020
U020

ORC 8*4
I NT ADDR
IN(:PTI{
ORG 10H*4
INT
Of'lG 13H*4
ORC VECIOf'l
ORC 1811*11
BASIC PTf,
ORC 19H*4
BOOT VEC
BOOT-VECTOR
~
ORG 1011*4
PARM PTR
ORC 1 EH*4
DISK POINTfR
ORG 01 FH*4
EXT_PIR
Of'lC 40H*4
DISK VECTOR
ORG 111 H1<-I\
HF TBl VEe
- ORC 46H*4
Ilfl_TBL_VEC

0040
0011()
OOIIC
OOIIC
0060
0060
00611
006/1

VIDEO

uo6 1t
007/1
0014
00"/8
OO-,R
007C
007C
0100
a 100
010 1-1
0104
0118

0118

LAf~El

DWORD

LABEL

WORD

I ARrl

LABEL

IMORD
DWORD

LABEL

DWORD

LABEL

DWORD

lABEL

DWORD

LABEL

DWORD

LABEL

OWORD

lABEL

OWORD

LABEL
LABEL

DWORD
aWaRD

LABlL

DWOIW

;

NEW FDISK

;

POINTER TO VIDEO PARMS

;

DISKETTE

;
;

REAL T I ME Cl.OCK I NT
F I XED 0 I SK I NT ERRU PT VECTOR

PO INTER

ORC 70H*ll

OlGa
OlGa
OlGa

SLAVE INT PIR
RTC I NT vrc
.- ORG 7GlI*4
HDISK INT
ORG
40011
DAT A AREA
DATA-WOf'lD
OKG
0500H
MFG TEST RTN
ORG
7eOOH
BOOT LOCN
ABSOENDS
PAG[

0108
0108
OIj(}O

01,00
0400
0500

0500
7COO

7coa

7COD

;

STACK -- US[O DURING

STACK

0000
0000

INTERRUPI

Al~SO

OOUO
0000
0008
0008
0014

80 [

LABEL [3YTl
l ABEL WORD
LABEL

FAR

LABEL

FAR

;ABSOLUTE LOCATION OF DATA SlCMENT

INITIALIZATION ONLY

SEGME.NT AT 30H
ow
1<::8 DU?(?)

????
TOS
STACK

0100
01GO

LABEL
ENDS

WORD

ROM BIOS DATA ARFAS

0000
0000
0000

bAIA
SFGMENT AT 40H
DATA BASE
LABEL
RS232_Bi\SE.
OW

011 l

0008

0010

EQLJ I P_FLAG

01

BYTE
4 DUP(?)

ADDRESSES OF RS232 AOAPTERS

ow

4 OUP('1)

ADDRESSES 0:" PR 1NTERS

ow

1 DUP(?)

I NSTAI_LI'.O HARDWARE

1??'1

Test 1 5-29

0012

01 [

0013

01

MFG_ TST

OB

1 DUP{? )

INITIALIZATION FLAG

ow

1 OUP(?)

ME~'ORY

DB

1 DUP(?}

SCRATCH PAD FOR MANUF ACTUR I NG

DB

1 DUP(?}

ERROR CODES

SIZE

IN K BYTES

????

0015

0016

01

c

01
??

OOl"r

01

0018

01

[
??

0019

01

c
c
c
c
c
c
C
C
C
C

PAGE

C
C
C
C
C
C
C
C
C

KBJLAG

KEYBOARD DATA AREAS
OB

1 DUP(? )

DB

1 OUP(?)

SECOND BYTE Of KEYBOARD STATUS

DB

1 DUPI?)

STORAGE FOR ALTERNATE KEYPAD ENTRY

ow

1 DUP(?)

POINTER TO HEAD OF KEYBOARD BUFfER

OW

1

PO I NTER TO TAl l

ow

160UP(?)

C

C

001A

c

01
????

OOlC

01

DOlE

10 [
????

BUFFER_TAil

c
c

D03E

003E

c
c
c
c
c
c
c
c
c
c
c
c

01

LABEL

c
c
c
c
c
c
c

[

HEAD'" TAil

DUP(?

1

Of KEYBOARD BU FFER

ROOM FOR 15 ENTR I [S

WORD

INDICATES

rHAT THE BUFFER

IS EMPTY

DISKETTE DATA AREAS
OB

1 DUP(?)

DRIVE RECAliBRATION STATUS

OB

1 DUP(?)

BIT 3-0
DR I Vi: 3-0 NEEDS RECAL
BEFORE NEXT SEEK If BIT IS = 0
MOTOR STATUS

DB

1 DUP(? )

BIT 3-0 = DRIVE 3-0 !S CURRENTLY
RUNN I NG
BIT 7 - CURRENT OPERATION IS A WRITE,
[{lQU 1 RES OELAY
TIME OUT COUNTER FOR DRIVE TURN OFF

01 SKETTE_STATUS DB

1 DUP(?)

RETURN CODE STATUS BYTE

CMD BLOCK
liD ERROR
NEC_STATUS

7 DUP(?)

c
c

c
003P

01

c
c

[

c

c
c
c

c
c
c
0040

01

??

0041

01

0042
00 112
0042

07 [

c
c

c

[

LABEL
LABEL
DB

BYTE
BYTE
;

SlATUS BYTES FROM NEC

??

c

PAGE

C

0049

g

01
??

004A

01
????

004C

004E

01

01
????

0050

0060

08

01

01
??

0063

01

0065

01

l
??

0066

c
c
c
c
c
c

Test 1

r

CRT MOOt..

CRT_COlS

OW

1 OUP(?)

NUMBER Of COLUMNS ON SCREEN

CRT_LEN

OW

1 DUP(?)

L[NGTH OF REGEN

ow

1 DUP(?)

START!NG ADDRESS

c
c

OW

8 DUP(?)

CURSOR FOR EACH OF UP TO 8

OW

1

DB

1 DUP(?)

CURRENT PAGE BEING DISPLAYED

ow

1 DUP(?)

BASE ADDRESS FOR ACTIVE DISPLAY CARD

DB

1 DUP(?)

CURRENT SETT I NG OF THE 3X8 REG I STER

DB

1 OUP(?)

CURRENT PALLF.TTE SETT I NG COLOR CARD

c
c

c
c
c

c
c
c
c
c
c
c
c
c
c
c
c
c

c

5-30

CURREN

c
c
c

c
c
c
c
c

01

p(;i---------

c
c
c

c
c
????

0062

VIDEO DISPLAY DATA AREA

C~T=~~~~~~-~----DB------'-D~

CRT _PALLETTE

PAGE

DUP(?)

! N BYTES

IN REGEN BUFFER

PAGES

CURfiENT CURSOR MODE SETT I NG

POST DATA AREA

ow

1 DUP(?)

PNTR TO OPTIONAL

ow

1 llUP(?)

POINTER TO

DB

1 DUP(?)

FLAG TO

1 aU?(?)

lOW WORD OF T I MER COUNT

I/O ROM

IN IT ROUTINE

iO ROM SEGMENT

INDICATE AN

INTERRUPT

HAPPE,\lD

Tlr.o1ER DAlA AREA

ow
ow

HIGH WORD OF TIMER COUNl

DB

1 DUP(?)

T I MER HAS ROllED OVER SINCE LAST READ

DB

1 oUP(?)

61T 7=1

ow

1 oUPt?)

WORD;1234H

SYSTEM DATA AREA
IF BREAK KEY HAS BEEN HIT

IF KEY130ARD RESET UNDERWAY

PAGE
HARD F IlE DATA AREAS
- -

-------DB-- -- ----1 --OUP(?)
- - - - ------- --

DISK_STAfUSl

H~

NUM

DB

DUP(? )

DB

1 OUP(?)

DB

1 OUP(?)

PRINTER AND RS232 TIME-OUT VARIABLES
4DUP(?)

11- DU?(?)

ADD I T I ONAl KEYBOARO OA TA AREA

ow

1 DUP(?)

ow

1 DUP(? )

ADDITIONAL FLOPPY DATA

- -- - - --- - -- - --- -- -- - - -- -- --- - - - - - -- - --ORG

lASTRATE

BBH
DB

1 DU?(?)

LAST DATA RATE SELECTED

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
C
C
C

PAGE
--------------------- -------- ---------ADDITIONAL HARD FilE DATA
------- -------------- ------------------

ORG

8CH

fir _SlATUS

DB

1 OUP(? )

STATUS REGISTER

HF - ERROR

DB

,

ERROR REG I STER

HF - INT- FLAG

DB

1 DUP(? )

HF _CNTRL

DB

1 OUP(? 1

OUP(? )

HARD FILE

J NTERRUPT

FLAG

; COMBO HARD FilE/FLOPPY CARD BIT 0=1

--------------- ------------------------ADDITIONAL DISKETTE AREA
. ---------------------------------------ORC
90ft
DSK_STATE
LABEL
BYTE
DB
1 DU?(?)
DRIVE 0 MEOlA STATE

c

c
c
r,
C

DB

1 DU?(?)

DRIVE 1 MEDIA STATE

C

DB

10UP(?)

DRIVE 0 OPERATION START STATE

c
c

Test 1 5-31

??
01

0093

??

C
C
C
C

DB

1 DUP(? )

DRIVE 1 OPERATION START STATE

DB

1 DUP(? )

OR I V£ 0 PRESENT CYL I NDER

DB

1 DUP(? )

DRIVE 1 PRESENT CYL I NDER

DB

1 OUP(? )

RfSERVEO

C
C

01

0094

n

C
C
C

DSK_TRK

C

0095

01

0096

01

0097
0097

01

[

ADD I T I ONAl KEYBOARD LED FLAG

c
[

??

C
C
C
C
C
C
C
C

0098
0098

01

009A

01

????

..

C
C
C
C
C
C
C
C
C

ORG
KB_FLAG_2

????
009E

01

...
01

OOAO

[

..
OOAl

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

OB

1 DUP(?)

PAGE
REAL TIME CLOCK DATA AREA

; -----

----------------------------------ORC

98H
OW

1 OUP(? )

OFFSET ADDR OF USERS WAIT FLAG

OW

1 OUP(? )

SEG AGDR OF USER WAIT FLAG

ow

1 DUP(? )

LOW WORD OF USER WAIT FLAG

RTC_H I GH

ow

1 DUP(? )

HIGH WORD OF USER WA I T FLAG

RTC_WA IT_FLAG

DB

1 DUP(? )

WAIT ACTIVE FLAG

USER- FLAG

USER - FLAG_SEG

C
01

00ge

97H

RTC

- LOW

DATA

ENDS

C

0000
[

01

0000

0001

0000
0000
0000
0000

4000

[

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

EXTRA DATA AREA

h~~~ ~ ~

-- SEGMEN~ -; ~ -50H--- --- --- --- -------

STATUS_BYTE

XXDATA

ENDS

VIDEO RAM
REGENLABEL
REGENW
LABEL
DB

SEGMENT AT OB800H
BYTE
WORD
1638 110UP(?)

ENDS
. LIST
I NCLUOE SEGMENT. SRC
CODE SEGMENT BYTE PUBLIC

0000

FXTRN
[XTRN
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
EXTRN
FXTRN
EXTRN
EXTRN

VIDEO PARMS: BYTE
POSTi:NEAR
DOS: NEAR
011: NEAR
VECTOR TABlE:NEAR
KBD RESET: NEAR
DUMMY RETURN: NEAR
STGTST CNT:NEAR
ERR BEEP:NEAR
ROM-CHECK: NEAR
ROS-CHECKSUM:NEAR
SYSIN I T1: NEAR
SHUT2: NEAR
SHUT3; NEAR
SHUT4: NEAR
SHUT6: NEAR
SHun: NEAR
SIIUT9; NEAR
PROC SHUTDOWN; NEAR
Cl : NEAR
C2: NEAR
C8042A: NEAR
OBf 42A: NEAR
C8042B:NEAR
C8042C: NEAR
OBF 42B: NEAR
f3B:NEAR
Sl.AVE VECTOH TABLE: NEAR
NMI INT:NfARPRINT SCREEN:NEAR
GATE_A20: NEAR
ASSUME

PUI3l1 C
PUBlI C
PUBLIC
PUBLIC
PUBLIC
PUOll C
PUBLIC
PUBll C
PUBL I C
PUBLI C
PUBll C
PUBL I C
PUBLIC

5-32

1 DUP(?)

VIDEO DISPLAY BUFFER

C
C
C
C
C

4000

DB

Test 1

CS: CODE, 55: CODE, ES: ABSO, OS : DATA

POST 1
BEG IN
CHK VIDEO
START 1
C8042Ol3r 42
CllC30
TST4 B
TST4-C
TST4'-D
E30BEJOC

BEGIN

= 0000

0000

EQU

DB

36 36 31 31 38 38
31 31 30 30 32 32
38 39 20 20 43 42
IjF ljF 50 ')0 52 ')2
7E 2E 20 20 49 jl9
1!2 1\2 40 40 20 20
31 31 39 39 38 38
34 34

6181028
6181029
• 66118811002289

COP R •
cOP R .
CCOOPPRR •.

INITIAL RELIABILITY TESTS -POST1

002e

PROC

IBM
IBM
IIBBMM

1 9 8 4
1 9 8 4

; EVEN
; 000

11998844'

; COPYR I GHT NOT I CE

PHASE 1

NEAR

LOAD A BLOCK OF TEST CODE THROUGH THE KEYBOARD PORT
FOR ~IANU FACTU I NG TES 1 •
THIS ROUTINE WILL LOAD A TEST (MAX LENGTH.::FAFFH) THROUGH
THE KEYBOARD PORT. CODE WILL BE LOADED AT LOCA T I ON
0000:0500. AFTER LOADING, CONTROL WILL BE TRANSFEREO
TO LOCATION 0000:0500. STACK WILL BE LOCATED AT 30:100
Hi I S ROUT I NE ASSUMES THAT THE FIRST 2
BYTES TRANSFERED CONTAIN THE COUNT OF BYTES TO !JE LOADI:::[)
(BYT[ l=COUNT LOW, BYTE 2=COUNT HI.)

002C
OU2e;

MFG BOOT:
-

fA

CLI

NO

I NTERRU PTS

;------- OEGATE ADDRESS LINE 20
0020
002F

MOV

B4 DO
E8 (JOOO E

CALL

OEGATE COMMAND
I SSUE THE COMf~AND

AH,OISABLE 61T20
GATF _A?O
-

;------- SETUP HARDWARE INT VECTOR TABLE LVL U-7
0032
003 11
0036
0039
003A
0038
003E
0041
00112
0043
00411

28 CO
BE CO
89 0008

0046
0048
004A
0040
004E
004F
0052
00')5
0056
0057
0058

2B CO
8E CO
89 0008

SUB

MOV
MOV
PUSH

OE
1F
BE 0000 E
BF 0020 R
A5

POP
MOV
MOV
MOVSW

MFG_B;

<,7
47

INC
INC
LOOP

E2 m

AX,AX

[S,AX
CX,OB
CS
DS
S I, OFFSET VECTOR_TABLE
OI,OFFSET INT_PTR
D!

;

0'

SUB

OE
1F
BE 0000 E
OlCO R

lJr

MFG_C:

A5

47
47
f2

m

ASSUME
005A
OOSC
OOSE

0060
0066
D06e

2B

co

SUB

MOV
MOV
MOV

BE 08
8E
c7
C7
Cl

CO
06 0008 R 0000 E
06 0014 R 0000 E
06 0062 R F600

t~OV

MOV

INT VECTOR TABLE LVL 8-15 (VECTORS START AT

AX,AX
ES,AX
CX,08
CS

;
;

iNT 70H)

GET VECTOR CNT
SETUP OS SEC REG

OS

SI,OFFSET SLAVE_VECTOR_TABLE
o I ,OfFSET SLAVE_I NT_PTR
;

SET UP OTHER
ASSU~'E

SK I P OYER SEGMENT

MFG_8

;------- SETUP HARDWARE

MOV
MOV
PUSH
POP
MOV
MOV
MOVSW
INC
'NC
LOOP

(ill VECTOR ern
SETU P OS SEG REG

SK I P OVER SEGMENT

I NTERRUPTS AS NECESSARY

os: ABSO
ES:ABSO
AX,AX
OS,AX
ES,AX
NMI_ PTR,OFFSET NMI_INT
INT5_PTR,OFFSET PRINT_SCREEN
BAS I C_PTR+2. 0 F600H

05=0
[$=0
/'1M I I NTERRU PT
PR I NT SCREEN
SEGMENT FOR CASSETTE BAS I C

; ------- ENABLE KEYBOARD PORT
0072
0074
0077
0079

BO 60

0078
007£
0080
0083
0085
0087
0088
0088
0088
0080
008F
0091
0093

E8
SA
[8
SA
SA

0094

£6 80

0096

[8 0405 R
BO 09
£6 60
0090 R
F8
0090 R
E8
CF

MOY
CALL
MOY
OUT

AL,60H
C8042
AL,00001001B
PORT _A, AL

WRIT[ 8042 RAM 0
ISSUE THE COMMAND
SET INHIBIT DVERrOE/ENABLE OBF
AND NOT PC COMP

CALL

MFC 2
BH, AL
MFC 2
CH,AL
CL,BH

GET COUNT LOW
SAVE IT
GET COUNT HI

r~oy

CALL
MaY
r~ov

ClO

FC

tNT

CX NOW HAS COUNT
SET OIR. FLAG TO INCRIMENT
sl:.r tARGET OFfSET (05"'0000)

BF 0500

MaY

0 t ,0500H

E4
A8
74
£4
AA

IN
TEST

JZ

AL, STATUS_PORT
AL, OUT _BUf _FULL
MFG 1
AL, rORT_A

GET 8042 STATUS PORT
KB REQUEST PEND I NG?
LOOP TILL DATA PRESENT
CET DATA
STORE IT

OUT

MFG_PORT, AL

DISPLAY CHAR AT MFG PORT

E2 f3

LOOP

MFG_1

LOOP TILL ALL BYTES READ

0098

EA 0500 ---- R

JMP

MFG_ TEST_RTN

0090
009F
OOAl

[4 64
A8 01

IN
TEST
LOOPl

AL, STATUS_PORT
AL, OUT BUf FULL
MFG_2 -

FAR JUMP TO CODE THAT WAS JUST
LOADED
CHECK FOR OUTPUT BUFF FULL
HANG HERE I F NO DATA AVA I LABLE

OOA3
OOA5

[4 60

E1

64
01
FA
60

'"

STOSB

MfG_2:

FA

;
;

00A6
OOA7
QOA9
QOAA
OOAe
QOAE
OOBO
00B2

FA
84
9E
73
75
7B
79
9F

TEST.01
X286 PROCESSOR TEST (REAL MODE)
DESCRt PTtON
VERIFY fLAGS, REGISTERS
AND CONDITIONAL JUMPS

START_l:
05
2A
28
26
24

GET THE COUNT

'"

RET

C3

ASSUME
CLI
MOV
SAHF
•.lNC

JNZ
JNP
JNS
LAHF

CS: CODE, OS: DATA, ES: NOTH I fIIG, SS: NOTH I NG
o I SABLE INTERRUPTS
AH,OD5H
SET SF, CF, ZF, AND AF FlAGS ON
ERR02
ERR02
ERR02
ERR02

GO TO ERR
GO TO ERR
GO TO ERR
GO TO ERR
LOAD FLAG

ROUTI NE IF CF
ROUT I NE IF IF
ROUT I NE IF PF
ROUT I NE I F SF
I MAGE TO AH

NOT
NOT
NOT
NOT

SET
SET
SET
SET

Test 1 5-33

00B3
00B5
UOB7

0"0[\9
OOBB
OOBD
OOBF
OOCl
OQC2
OOCII
OOC6
OOC8
OOC9

OOC(3
OOCD

ooer

0001
0003
0006

DO ,0
71 17
32 E4

CL,5
AH,CL
[RHO?
Al_,40H
AL,1
ERR02
AH,AH

76 12

ERR02

10
Of

ERR02
ERR02

05

CL,5
AH,CL
U-(R02
AII,1
[RR02
C7A
EHROl

01

05

02 CC
73 1 D
BO 40

LOAD CNT REG WITH SHIFT CNT
SH 1FT Af I NTO CARRY BIT pas
IF AF NOT SET
SET THE OF flAG ON
SETUP FOR TES-II NG
GO TO ERR ROUT I NE I F Of NOT SET
SET AH = 0
CLEAR Sf, CF, Zf, AND PF
GO TO ERR ROUl I I'll IF CF ON
GO TO ERR ROUTiNE If IF ON
GO TO ERR ROUT I NE I F SF ON
GO TO ERR ROUT I NE IF PF ON
LOAD FLAG I MAGE TO AH
LOA!) CNT REG 'rI1 Tif SH I FT CNT
SIIIFT 'AF' INTO CARRY BIT pas
GO TO ERR ROUT I NF. I F ON
CHECK THAT' OF' I S CLEAR
co TO [RR ROUT I NE I F ON
CONTINU!:.
ERROR EX I T
GO TO ERR ROUT I NE

9[

78
"fA
9F
Ell
02
72
DO
70

EC

07
[4
03

EI> Ol! 90
E9 01l,C R

ERR02;
C7A;

0009

0009

B8

OODG

OE 08

~---

SET DATA SEGMEN-I

AX,DAi"A
DS,AX

MOV
MOV

R

; ----- CHECK FOR PROCESSOR SHUTDOWN
OODE
OOEO
00E2
00E4

£4

6',

75 03
£9 U 181 R

00['7

oou

00E9
OOEB
OOED
OOEF
OOFl
OOF4

BO 8F
E6 70
EB 00
E" 71
86 c4

80 Fe 09
30

'"

RE-INITIALIZE THE 8259

?A CO
E6 F1

SUB
OUl

BO 11
E6 20

MOV

EB 00

JMP
MOV

EB 00

JMP

0106

BO 04
E6 21

MOV

OlOe
OlOE

CO

; ------ CHlCK FOR SHUTDOWN 9
C7B;
AL_, SHUT __ OOWN
CMOS PORT, AL
SHORT $+?
AL,CMOS_PORT+1
AL,AH
AH,09t1
C7C

OQF6
OOF8
oorA
OOFC
OOFE
0100
0102
0104

0108
OlOA

CHECK FOR SHUTDOWN

IN
!"l.ST
JNZ
JMP

A8 (PI

OCi

JI~P

MOV

0110

E6 21
EB 00

0112
0114

00 FF
E6 21

OUT

JMP
MOV
OUT

lu AO

MOV
OUI

En 00
110 7<1
[6 A 1
BO 02

MOV
OUT
MOV

130 11

[6 Al

,JMP
OUT

EO 00
BO 01

JMP
MOV

E6 Al
EB 00

OUT

EB 00

JMP
MOV

BO FF

OU I

[6 Al

-

EDGE,

MASTER,

WAlT STATE rOR
SETUP

ICI-I4

ICW3 -

(8-F)

10

MASTER LV 2

10 WAIT STAle
SETUP ICWI~ - ~IASTER,8086 MODE
WAIT STATE rOR 10
MP.SK ALL INTS. OFF
(VIDEO ROUTINE ENABLES

INTS.)

INTERRUPT 112 CONTROLl_ER CIII?

AL,1111
I N I HOO, Al
SHOIl.l $+2
AL, INr~lYPE
INTB01,AI
AL,02H
SIIOH I $+;>
I NTB01 ,AL
SHORT $+2
AL, 01 H
INTIJ01,AL
SIIORT $-t2
AL,OfFH
IN1B01,AL

J~'P

CONTROLl_ER CHIP

ICW1

RF-INITIALIZE THE 8259

0116
0118
011A
011C
011E
0120
01??
0124
0126
0128
012A
o 12C
012E
0130

;
;
;

WAIT STATE rOR 10
SETUP ICW2 - INT TYPE 8

AL,04H
INTA01,AL
SHORT $+2
AL,OHI
INTA01,AL
SHORT $+2
AL,OFFH
INTA01,AL

OUT

EB 00

BO 01

CMOS ADDR FOR SHUTDOWN BYTE
10 DELAY
GrT WHO
SAVE TH[ SHlJTDOI-,N REQUEST
'rIAS IT SHUTOOWN REQUEST 9?
BYPASS INIT or INT CHIPS

I NSUR[ MATH PROCESSOR RESET

AL,AL
X2S7+1,AL
AL,11H
I NTA()O, AL
SHORT $+2
AL,8
INIAU1,AL
SHORT $+2

oor

BO 08
E6 21

INTERRUPT #1

IF YFS

ICWI

-

r:DGr,

SLAVE

ICW4

'rIAIT STATE FOR 10
snup ICW2 - INT TYPE 50
S[TUI'

1(;1013 -

(50-~F)

SLAVE LV 2

10 WAI T STATE
SETUP ICW4 - 80B6 MODE,

SLAVE

WAIT STAT[ Fon 10
MASK ALL I NTS. OFF

SHUTDOWN
R[l"lIlm CONTROL AFTER A SHUTDOWN COMMAND I S I 35UED
DESCR I PT I ON
A TEST IS MAO[ FOH THE SYSTEM FLAG BEING
IF
lliE SYSTE::M FLAG I S SET, THE SHUTDOWN BYTE IN CMOS
IS USED TO DETERMINE WHERE CONTROI_ IS RETURN[D.

so.

~

a
1
2
3
4
5
6
7
8
=c 9
'" A

SOFT RlS[T OR UNEXPECTED SHUfOOWN
SHUT DOWN ArTER MEMORY SIZE
SHUT DOWN AFTER MEMORY TEST
SHUT DOWN Vi I TIl MEMORY ERROR
SHUT DOWN WITH BOOT LOADER REQUEST
JMP OWORD REQUEST (WITH INT INI T)
PROTECTED f~O[)[ TFST7 PASSED
PROffel [0 MOOE TfST7 FAI U:O
PROTECTED MODE TEST1 FAI LED
BLOCK MOVE SHUTDOWN REQUEST
JMP DWORD REQUl5T (W/O INT INIT)

=
=
=
=
-::
=
'"

;----- CHECK FROM WHERE
0132
01311
0136
0138
DBA
013E
0140
014?
0145
014"1
0149
OlllC
0140
0150
0152
0155
0156

BO
E6
EB
2A
l6
86
3C
77
BE
03
03
2E;
FA
BB
8E
BC
FB
FF

0158
015A
015C

016E R
09BO R
0000 E

OBC

5-34

SF
70
00
CO
71
EO
OA
2C
015>8 R
FO
FO
8B 1C

C7C:

MOV
Olrl

,JMP
SUB
DOT

XCHG
CNP
JA
MOV
ADD
ADO
MOV

AL, SHUT_DOWN
CMOS PORT, AL
SHOkr S+?
AL,AL
CMOS~PORT+l ,AL
AH,AL
AL,OAII
SHUTO
51 ,OFFSET BRANCH
SI,AX
51 ,AX
BX,CS:[Slj

CLEAR CMOS [lYlE
10 orl AY
SET BYTE TO 0

MAX TA[~l.f f"NTRYS
GO I r Cf{[ATER THAN MAX

GET

THE START OF BRANCH TABLE

POINT TO BRANCH ADDRESS
GET BRANCH 10 BX

CL I

Test 1

AX, STACK
5S,AX
sP,onS!:.l

Sfl
JNP

BX

JUMP BACK

OW
OW
OW

SHUlO
SHUTl
SHUT2

NORMAl POWER LP/UNCXPECTED SHUTDOWN
SHUT DOWN AFTf Il MEMORY SIZE
SHUT DOWN AFT'ER MEMORY TEST

~10V

E3
BRANCH;

SCT STACK

MOV

MOV

---- R
DO
U100 R

TOS

015E
0160
0162
0164
0166
0168
016A
016C
D16E

0000 E
0000 E
0171 R
0000 [
0000 [
07F7 R
0000 E
017D R
EB 11 9D

SHUTO;

OW
OW
OW

ow
ow
ow
ow
ow

SHUT3
SHUT4
SHUT5
SHUT6
SHUT7
SHUTS
SHUT9
SHUTA

JMP

e7

SHUT DOWN WITH MEMORY ERROR
SHUT DOWN WITH BOOT LOADER REQUEST
JMP DWORD REQUEST (WITH INTERRUPT INIT)
PROTECTED MODE TEST7 PASSED
PROTECTED MODE TEsn FAILED
PROTECTED i·mOE TEST1 FAILED
BLOCK MOVE SHUTDOWN REQUEST
JMP DWORD REQUEST (14/0 INTERRUPT IN IT)

;-------

0171
D173
0175
0177
0179
0176

[4
A8
74
E4

64
01
02
60
BO 20
[6 20

IO_ROM_INIT MUST BE INITIALIZED BY THE USER
FLUSH THE KEYBOARD BUFFER
CHECK I F OUTPUT BUFFER FULL
AL,STATU$_PORT
SHUT5:
IN
AL,OUT BUF FULL
TEST
SHUT5BGO IF NOT
JZ
FLUSH
AL, PORT A
IN
AL,EOI FLUSH LAST T I MER TICK
SHUT58 : MOV
-TO ALLOW T I MER INTERRUPTS
!NTAOO,AL
OUT

0170

Ff 2E 0067 R

SHUTA:

JMP

DWORD PTR DS:tO_ROM_INIT;

CH[CKPO I NT 1
0181
0183

80 01
[6 80

C7:

MOV
OUT

AL,OlH
MFG_PORT, AL

<><><><><> <><><><><><><>
<><><>CHECKPO I NT 1 <><><>

READ/WR I TE THE X286 GENERAL AND SEGMENT AT I ON REG I STERS
WITH ALL ONE'S AND ZEROES'S,

0185
0188
0189
0186
01BD
OlaF
0191
0193
0195
0197
0199
0196
0190
019F
OlAl
01A3
OlAS
01A6
01A8
01A8
01AA
01AC

68 FFFF
F9
73 21
BE 08

C8:

8e
8E
8C
8E
8C
86
86
88
8B

DB
C3
Cl
Dl
02
E2
EC
F5
FE
73 07
33 C7
75 07
F8
EB E3

MOV
S7C
JNC
MOV
MOV
MOV
MOV
MOV
~tOV

MOV
MOV
MOV
MOV
JNC
XOR
JNZ
ClC
JMP

AX,OFFFFH
ERROl
DS,AX
BX,OS
ES, BX
CX, ES
SS,CX
DX,SS
SP,DX
BP,SP
S I, BP
DI,51

SETUP ONE'S PATTERN IN AX
SET CARRY FLAG
GO I F NO CARRY
WR I TE PATTERN TO ALL REGS

C9

AX,DI
ERROl

PATTERN MAKE IT THRU ALL REGS
NO - GO TO ERR ROUT I NE
CLEAR CARRY FLAG

C8

C9:
OB C7
74 01
F4

TSTlA
OR
AX, D t
ZERO PATTERN MAKE IT THRU?
JZ
C10A
YES - GO TO NEXT TEST
ERROl:
HLT
; HALT SYSTEM
;------- INSURE THAT CMOS CLOCK INTERRUPTS ARE DISABLED

C10A:

JMP
OUT

AL, CMOS_ALARM
CMOS_PORT, AL
SHORT $+2
AL, CMOS_PORT+l
AL,AH
AIi,07H
AL, CMOS_ALARM
CMOS_PORT, AL
AL,AH
SHORT $+2
CMOS_PORT +1, AL

JMP
MOV
OUT
JMP
IN

SHORT $+2
AL, CMOS_ALARM+1
CMOS_PORT, AL
SHORT $+2
AL. CMOS_PORT+1

MOY

OlAD
OlAF
01Bl
01 B3
0165
01B7
016A
D1BC
OlBE
Oleo
01C2

BO
£6
EB
E4
86
80
BO
[6
86
EI3
E6

BB
70
00
71
C4
E4 07
86
70
C4
00
71

01C4
01C6
Olca
OlCA
01CC

EB
BO
E6
EB
E4

00
8C
70
00
71

OlCE
OlDl
0103
0109

B8

---- R
8E 08
81 3E 0072 R 1234
74 DB

MOV
MOV
CMP
JZ

010B
01DD
OlEO
01E1
01E3
01 E5
01E6
01E8

2A CO
BA 03D8

SUB
MOV
OUT
INC
MOV
OUT

OUT
JMP
IN

XCHG
ANO
MOV
OUT

XCHG

GET THE CURRENT CONTROL REG
SAVE IT
CLEAR SET,PIE,A!E, AND SQWE BITS

10 DELAY
10 DELAY
CLEAR PENDING

INTERRUPT

10 DELAY

; -------- RESET V IDEO
ASSUME

EE
FE CO
B2 B8

EE
BO FC
E6 61

SFT _RST: MOV
OUT

;
;
;

OS: DATA
AX, DATA
DS,AX
RESET FLAG, 1234H
SFT_RST

SET DATA SEGMENT
SOFT RESET?
GO I F YES

AL,AL
DX,3D8H
DX,AL

DISABLE COLOR VIDEO

Al

DL,OB8H
DX,AL
AL,111111DOB
PORT_B,AL

DISABLE B/W VIDEO,EN HIGH RES
DISABLE PARITY CHECKERS

TEST.02
YER I FY CMOS SHUTDOWN BYTE
DESCRIPTION
ROLLING BIT WRITTEN AND VERifiED
AT SHUTDOWN ADDRESS

;----- VERI FY AND CLEAR SHUTDOWN FLAG
OlEA
01EC

BO 02
E6 80

MOV
OUT

AL,2
MFG_PORT, AL

alEE
01 F1
01 F3
01 F5
01 F7
01 F9
01 FB
OHD
01 FF
0201
0203
0205
0207
0209
0208
0200

B9
B4
BO
E6
8A
EB
E6
BO
EB
E6
EB
E4
3A
75
00
E2

MOV
MOV
MOV
OUT
MOV
JMP
OUT
MOV
JMP
OUT
JMP
IN
CMP
JNZ
Rel

CX,09H
AIi,1
AL, SHUT_DOWN
CMOS_PORT, AL
AL,AH
SHORT $+2
CMOS_PORT+1, AL
AL, SHUT_DOWN
SHORT $+2
CMOS_PORT, AL
SHORT $+2
AL, CMOS_PORT+l
AL,AH
ERROl
AH,1
ClOB

0009
01
8F
70
C4
00
71
8F

00
70
00
71
C4
A1
04
E4

e10B:

LOOP

; <><><><><><><><><><><>
; <><><>CHECKPO I NT 2<><>
LOOP COUNT
START WITH BIT 0
OUTPUT ROLL! NG BIT
10 DELAY
READ CMOS
10 D[LAY
10 DELAY
MUST BE THE SAME
ERROR I r NOT
ROLL A BIT THRU SHUT DOWN
LOOP TILL DONE

TEST. 03
ROS CHECKSUM TEST I
OESCR I PT I ON
A CHECKSUM IS DONE FOR THE 32K
ROS MODULES CONTAINING POD AND

Test 1 5-35

BIOS.

(:,0:

020F

;----- CHECKPOINT 3
; <><><><><><><><><><><><>
; <><><>CHECKPOI NT 3<><><>

020F
0211

80 03
E6 80

NOV

AL,03H

OUT

MfG _PORT,AL

0213
0215
021J

8C C8
8E DO
8E 08

MOV
MOV
MOV

AX,CS
5S,AX
DS,AX

ASSUNE
0219
021C
021 F
0222

8fi 0000 R
BC 0000 E
E9 0000 E

MUV
MOV
JMP

5S: CODE
BX, OFfSET BEGIN
SP, OFfSET C1
ROS - CHECKSUH

SETUP STARTING ROS AODR
SETUP RETURN ADDRESS

0222

74 01

JL

ellA

HALT

0224

F4

ell:

0228
022A
022C

SET UP DATA SEG fO
RON ADDRESS

SYSTEM

PO I NT TO

IF ERROR

RLT
;
;
;

0225

5UUP SS SlG REG

----

B8
BE DB
BD 04

R

TEST.04
8253 CHECK TIMER 1 ALL BITS ON
OEseR I PT ION
SET TIMER COUNf
CHECK THAT TIMER 1 ALL BITS ON

CllA;

E6 80

ASSUNE DS:DATA
AX, DATA
DS,AX
AL,OlHI
MFG _PORT,AL

MOV
MOV
MOV
OUT

;

SET DATA SEGMENT

. ~><><><><><><;><;><><><><><><><>
; <><><><>CHECKPO I NT 4<><><><><>

DI SABLE DMA CONTROLLER
MOV
OUl
OUT

022E
0230

E6 DB
E6 DO

0232
0236
0238
023A
023C
023E
02'40
0242
0242
0244
02116
0248
024B
0240
024F
0251
0253
0255
0257

60 16 0072 R

AL,04
DMA08,At.
DMA18,Al

AL ALREADY = OI+H
o I SABLE DMA CONTROLLER 1
o I SABLE DMA CONTROLLER 2

;----- VERI FY THAT TIMER 1 FUNCT IONS OK

BO

MOV
MOV

5"

OUT

E6 43
[8 00
8A C1
£6 41

JMP
MOV
OUT
MOV

B7 05

ox, RESET_FLAG
AL,54H
rIMER+3,AL
SHOHT $+2
AL,CL
T I NrR+l, AL
BH,05H

C12 :

CMP

YES -

JE
IN
OR

C13

TIMER1_BITS~OfF

AL, TIMER+l
BL,AL

READ T I MER 1 COUNT
ALL BITS Ot~ IN TIMER
TIMER1_BITS_ON

FE CF

LOOP
DEC

75 EB

JNZ

E2

EF

C12
611
C12

HLT

'4

I S OFF

LOOP COUNT
TIMERl BITS ON
LATCH TIMER-1 COUNT
10 DELAY

AL,40H
SHORT $+2
fIMER+3,AL
1:1t.,UHH

Mav
JMP
OUT

BO 40
EB 00
£6 43
tiU FO H
74 OB
E4 ljl
OA 08

SAVE RESET FLAG WH I LE REFRESH
SEL TIMER 1,LSB,MOOE 2
WAIT STATE FOR 10
SET INITIAL TIMER CNT TO 0

SEE

I F ALL BITS GO OFF

TRY AGAIN
TIMER 1 FAILURE,
TIMER1_BITS_OFF

HALT SYS

-------------------------------------------------------TEST .05

;
;

8253 CH[CK TIMEH 1 ALL Bll OFF
DESCRIPTION
SET T I MER COUNT
CII[CK THAT TIMER 1 ALL BITS OFf

;------ CHECKPOINT ';)
0258

025A
025C
025E
0260
0262
026'1
0264
0266
0268
026A
026C
026E
0270
02"12
0274
0276
0278

027A

Cl3:

BO 0':>
E6 80

MOV
OUT

AL,05H
MFG _PORT, AL

<><><> <><><> <><><> <><><>
o·<><>CHECKPO I NT 5<><><>

8A C3
28 C9

MOV
SUB

cX,ex

AL,BL

SET TIMER 1 CNT

E6 41

OUl
MOV

TIME:R+l,AL
BH,05H

SET

,,0

,IMP
MOV

E6 43

OUT
JMP
JMP
IN
AND

SHORT $+2
AL,40H
TIMER T 3,AL
SHORT $T2
SHORT $+2
AL, T I MER+l
BL,AL

87 05
C14:
EB 00

BO

[B 00

EB 00
E4 ',1

22 OR
7'1 07
E2 EE
FE Cf

JL
LOOP

75

,)NZ
HlT

DEC

EA

'4

Cl~

C14
SH
C14

TRY AGAIN COUNT
TIMER LOOP
j a DELAY
LATCH TIMER 1 COUNT

DELAY FOR T II1CR
ADDEO DELAY FOR TIMER
REAO TIMER 1 COUNT
WRAP O~1A REG
TIMER lOOP

-

HALT SYSTEM

I'I::SI.06
8237 DNA 0 INITIALIZATION CHANNEL REGISTER
OEseR I PT I ON
01 SABL E TH E 8237 DMA CONTROLLER.
WR I TE/READ THE CURRENT
ADDRESS AND WORD COUNT REGI STERS FOR ALL
CHANNELS.

lEST

; ----- CHECKPO I NT 6
0278
0278
027E
0280
0282
0284
0288
028A
028C
Q28E
0290
0293
0296
0297
0299
029A
029C
U29E
029F
OZA1
02A3

C15:
88
---- R
8E 08
80 06
E6 80
89 16 0072 R
£6 00
BO
8A
SA
89
I:1A
EE
E8
EE
80
ED
EC

MOV
MOV
MOY
OUT
MOY
OUT
;----- WRAP OMA
MOV

FF
C16:

08
F8

0008
0000

en:

I~OV

MOV
MOV
MOV

00

OUT
JMP
QU'i

01
00

.iMP

ffl 00
8A EO
EC

IN
JMP
MOV
IN

5-36

MOV

Test 1

AX, DATA
; SET DATA SEGMENT
DS,AX
AL,0611
; <><><><><><><><><><><><>
MFG_PORT,AL
;<><><>CIIECKPOINT 6<><><>
RESET_ FLAG,DX
; RESTORE SOFT HEser FLAG
DMA+OOH,AL
; SEND MASTER CLEAR TO DMA
0 r:HANNEL ADDRESS AND COUNT REGISTERS
AL,OFFH
BL,AL
BH,AL
CX,S
OX,DMA
DX,AL
SHORT $+2
DX,AL.
AL,OlH
SIlORl $+2
AL., OX
SHORT $+2
AH,AL
AL, OX

WRITE PATTERN 1'1' TO ALL REGS
SAVE PATTERN fOR COMPARE
SETUP LOOP CNT
SETUP I/O PORT ADDR OF REG
WR I TE PATTERN TO REG, LSB
WAIT STATE FOR 10
MSB OF 16 BIT REG
AL TO A~OTHER PAT BEfORE RO
WAIT STATE FOR 10
READ 16-B I T O!>',A Cli REG, LSB
WAIT STATE FOR 10
SAVE LSB OF 16-B I T REG
READ MSB OF DMA GH REG

25T DMA

eMP
JE
HLT

02M
02A6
02A8
02A9
02A9
02AA
02AC
02AE

3B 08
711 01

02BO
0283

80 FB 55
7', 09

r4

BX,AX
C18

PATTERN READ AS WRITTEN?
YES - CHECK NEXT REG
NO - HALT THE SYSTEM
NXT DMA CH
SET-IO porn TO NEXT CH REG
WRITE PATTERN TO NEXT REG
SET PATTERN TO a
YES caNT I NU E

C18:

INC

42
£2 EA
fE CO

74 DC

OX

LOOP

C17

INC

AL

Jl

C16

;------- WRITE OMA WITH 55

H.~

0213~

8U

0288
02BA
02BC

74 08
BO ~S>

02BE
02CO

130 AA

eMP
Jl
eM?
JZ
MOV
JMP

AA

[l3 C£

PATTERN

BL,55H
C19
BL, OAAH
elO
AL, 5~H
C16

CHECK IF 55 PATTERN aONE
GO I F YES
CHECK 11- AA PATTERN DONE
GO I F YES

;------- WRITE OMA WITH AA PATTERN
C19:

r~ov

JHP

EB CA

AL,OAAH
C16

- - -- - - - -- - - -- - --- -- -- - -- - -- -- -- -- -- -- --- - - --------- -- - -TEST.07
823"1 DMA 1 INITIALIZATION CHANNEL REGISTER TEST
OESCR I PT ION
DISAI'l.[ THE 8237 DMA CONIIWLLER 1.
ITE/READ THE CURRENT OMA 1
ADDRESS AND WORD COUNT REG I STERS FOR ALL
CHANNELS.

1m

; ------- CHECKPO I NT 7 DHA 1
02C2
02C4
02C6

130 07
£6 80
E6 DA

C20:

NOV
OUT
OUI

AI,07H
MrG PORT,AL
DMA'" -1-0011*2, AL

;
;

<><><><><><><><><><><><>
<><><>CIIECKPO I NT 7<><><>

;

SEND MASTER CLEAR TO 2ND DMA

;----- WRAP DMA 1 CHANNEL ADDRESS AND COUNT REGISTERS
02C8
02CA
02CC
02CE
0201
0204
0205
0207
02[)8
02DA
020C
0200
020F
02El
02E2
02E4
02£6

130

Fr

8A 08

C16A:

8A f8
89 0008
SA

ooeo

EE

C17A:

EB 00

EE
AO 01
[8 00

EO
EB 00
SA EO

MOV
MOV
MOV
MOV
MOV
OUT
JMP
OUT
MOV
JMP
IN
JMP
,'~()V

EC

IN
CMP
JE

38 08
74 01

f4

AL,OFFH
BL,AL
BH,AL
CX,8
DX,OMAl
DX,AL
SIIORT $+2
DX,AL
AL,OlH
SHORT $+2
AL,DX
SHORT $+2
AH,AL
AL, OX
BX,AX
C18A

WKIII:. PATII:.I{N Ff TO ALL REGS
SAVE PATTERN FOR COMPARE
SETUP LOOP CNT
SETUP I/O PORT ADOR OF REG
WRITE PATTER~ TO REG, LSB
WAIT STATE FOR 10
MSB or 16 BIT REG
AL TO ANOTHER PAT BEFORE RD
WAIT STATE FaH 10
READ 16-B11 [lNA CH REG, LSB
WAIT STAlE FOR 10
SAVE l.SB OF 16-6 I T REG
READ MSB OF LiMA CH REG
PATTERN READ AS WRITTEN?
YES - CHECK NEXT REG
NO - HALT HIE SYSTEM
NXT DMA CH
SET-IO PORT TO NEXT CH REG
WRITE PATTERN TO NEXT REG
SET PATTERN TO 0
YES CONTINUE

HLT

C1BA:

02E7
02E7
02EA
02EC
02EE

83 c2 02

02FO
02F3
02f5
02f8
02FA

80 rB 55

Dzre

74 09
80 rB AA
74 08
BO 55
EB CC

02fE
0300

BO AA
EB C8

ADD
DX,2
LOOP
C17A
INC
AL
C16A
JZ
WRITE OMA WITH 55

E2 E8

FE CO
r4 OA

01P
JZ
CMP
JZ
MUV
JMP

25T DMA

PATTERN

BL,55H
C20A
BL,OAAH
C21
AL,55H
C16A

CHECK
GO I F
CHECK
GO I F

IF 55 PATTERN DONE
YES
IF AA PATTERN DONE
YES

;------- WRITE DMA WITH AA PATTERN
C2aA:

MOV
JMP

AL,OAAH
G16A

INITIALIZE AND START MEMORY REFRESH.
0302

8B 1 E 0072 R

0306
0309

A3 0010 R

030B

80 12
E6 ,,1

0300
0300
030r

2A CO
E6 08

0311

E6 DO

C21 :

MOV

ex, RESET _FLAG

GET THE RESET FLAG

MOV
MOV
OUT

EQU I I' _FLAG, AX
AL,18
TIMER+1,AL

DO A DUMMY WRITE RAM BEFORE REFRESH
START TIMER

; ------- SET DHA COMMAND
C21Z:
suo
AL,AL
OUl
DMA+8,AL
OUT

DACK SENSE LOW,DREQ SENSE HIGH
LATE WRITE,flXED PRIORITY,NORMAL Tllo1lNG
CONTROLLER ENA13LI:.. CHQ ADOR HOLI) lll5ABLE
~lEMORY TO MEM D I SABLE
SAME TO SECOND CONTROLLER

OMA18,AL

; -------- MODE SE1 ALL DMA CHANNELS
0313
0315
0317
0319
031R
0310
031F
0321
0323
0325
0327
0329
0328
0320
032F
0331

BO 40
E6 OB

1·10V
OUT
MOV

80 CO
E6 06

OUT

tB 00
80 41
E6 08

JMP
MOV
OUT
OUT
JMP
MOV
OUI

E6 06

EB 00
80
E6
E6
EB
BO
f6

4:;>
OB

06

OUT

00

JMP
MOV

113
08

OUl

[6 06

OUT

AL,40H
DMA+QBH, AL
IIL,OCOH
OMA18+06H,AL
SHORT $-1-2
AL,41H
DMA+OBH, AL
DMA 1 8+D6H, AL
SHORT $+2
AL,42H
UMA+Q13II,AL
DMA18+06H,AL
SHORT $-1-2
AL,43H
DMA+OBH, AL
DMA18+0611,AL

; ------- RESTORE RESET
0333

~10V

89 1 E 0072 R
;
;
;

SET MODE FOR CHANNEL 0
SET CASCADE MODE ON CIiANNEL 4
WAIT STATE FOR 10
SET MODE FOR CHANNEL 1
SET MODE FOR CHANNEL 5
WAIT STATE rOR 10
SET MODE FOR CHANNEL 2
SET MODE FOR CHANNEL 6
WAIT STATE fOR 10
SET MODE FOR CHANNEL 3
SET MODE FOR CHANNEL 7

FLAG

RESET_fLAG, BX

TEST.08
DMA PAGE REG I STER TEST
OEseR I PTION
WR I TE/f"<><><><><><><><><><><>

Test 1 5-37

0339
033B
033D
0340
0343
0344
0314.5
0347
034B
0340
034F
0351
0352
0354
0355
0357
0359
035B
035C
0360
0362
0364
0366

E6 80
2A CO
BA 0081
89 ~OFF

0368
036A
0360
036f

BO CC
BA 008f
8A EO

0370
0372
0373
0375
0377
037A
037C
037E
0380
0383
0385
0387

2A CO

e22A:

EE
42

FE CO
fA OOaf
75 f6
86 EO
FE CC

B1

C22B:

EC

3A C4
75 30
FE CC
4A
B1 fA 0080

75
FE
8A
E2

fO
C4
C4
DB

DO ALL OAIA PArTERNS

AL

XCHG

4A

2A CO

<><><>CIiECKPO I NT 8<><><>

MFG_PORT,AL
AL,Al
OX, DMA PAGE
CX,OFfH
DX,AL
OX

OUT
SUB
MOV
MOV
OUT
INC
INC
CMP
JNZ

TEST DMA PAGES 81 THUR 8EH

DX,8FH
C22A
AH.AL

SAVE CURRENT DATA PATTERN
CHECK LAST WR I TTEN

AH

DEC
DEC
SUB
IN
CMP
JNZ
DEC
DEC
CMP
JNL
INC
MOV

OX
AL.AL
AL,DX
AL,AH

CHANGE DATA BEFORE READ
DATA AS WRITTEN?
GO ERROR HALT I F NOT

C26
AH

OX
OX, MFG_PORT
C22B

CONT I NUE TI LL PORT 80
NEXT PATTERN TO RI PPLE

AH

LOOP

AL,AH
C22A

; -------- TEST LAST DMA PAGE REG I STER (USED FOR ADDRESS LINES OUR I NG REFRESH)

EE

SAVE THE DATA PATTERN
OUTPUT PAGE REG

C24:

CHANGE DATA PATTERN BEFORE READ
GET THE DATA FROM PAGE REG

EC

3A
77
80
75
BO
EB
80
714.
2A
EB

e4
12
Fe CC
04
33
EA
FC 00
05
CO
E1

WR tTE AN CC TO PAGE REG I STERS

MOV
AL,OCCH
MOV
DX,LAST_DMA_PAGE
MOV
AH,AL
C23:
OUT
DX,AL
;-------- VERI FY PAGE REGISTER 8F
C22:

C25:

AL,AL
AL,DX
AL,AH

SUB
IN
CMP
JNZ
CMP
JNZ
MOV
JMP
CMP
JZ
SUB
JMP

GO I F ERROR

C26

AH,OCCH
GO I F ERROR
SET UP DATA PATTERN OF 33
DO DATA 33
CHECK DONE
GO IF YES
SET UP FOR DATA PATTERN 00
00 DATA 0

C2'

AL,033H
C22

AH,O
C27

AL,AL
C22

;------- ERROR HALT
0389

C26:

F4

HlT

HALT SYSTEM

--------------------------------------------------------

; TEST. 09
;
STORAGE REFRESH TEST
; OESCRI PTION
:
VER I FY STORAGE REFRESH IS OCCURR I NG
;

-- ----- ------------------------------------------ - ------

;------- CHECKPOINT 9 TEST MEMORY REFRESH
03BA
038C

BO 09
E6 80

038E
0390
0392
0394
0396
0398
039A
039C
039E
03AO

2B C9
E4 61
A8 10
E1 FA
74 F1
2B C9
E4 61
A8 10
EO FA
75 E7

C27:

C28:

CX,ex

SUB
IN

TEST
LODPZ
e29:

;

<><><><><><><><><><><><>
<><><>CHECKPOI NT 9<><><>

AL,09H
MFG_PORT, AL

MOV
OUT

JZ
SUB
IN

~t:~~~~E~H
C28

I NSURE REFRESH B IT IS TOGGLI NG
BII
-

C26

cX,ex
AL, PORT B

TEST
LOOPNZ

~~9REFRESH_BIT

JNZ

C26

I NSURE REFRESH I S OFF
GO IF NOT
INSURE R[fR(SH IS ON

-- ------------- -- --------------------- - --------

GO I F NO REFRESH

TEST. 10
8042 TEST AND CONfiGURATION JUMPERS
DESCR I PT I ON
ISSUE A SELF TEST TO THE 8042
I NSURE A 55H IS RECE I VED
CET MANUFACTURING/DISPLAY TYPE JUMPER
INPUT PORT INFO SAVED IN MFG_TEST

. --------- --- ------------------- - ------------

---

; ------- CHECKPO I NT OA
03A2
03A4

BO OA
E6 80

03A6
03A8
03M
03AC
03AF
03B1
03B3
0366
03B8

2B C9
EI~ 64
8A EO
F6 C4 01
74 02
E4 60
F6 C4 02
EO FO
74 01

03BA

F4

AL,OAH
MFG_PORT, AL

MOV
OUT

: <><><><><><><><><><><>
; <><>CHECPOINT OA<><><>

;------- SOFT RESET (HANDLE ALL POSSIBLE CONDITIONS)

T511 :

SUB
IN
MOV

TEST
JZ
IN

TST2:

TEST
LOQPNZ
JZ

[RRO:

eX,ex
AL,STATUS_PORT
AH,AL
AH, OUT _BUF _FULL
TST2
AL, PORT_A
AH, I NPT_BUF_FULL
TS11
TST4

100 MSEC FOR TH I SLOOP
CHECK FOR I NPUT BUFFER FULL
GO IF NOT
FLUSH
IS THE OUTPUT BUFFER ALSO FULL?
TRY AGAIN
CONTINUE IF OK
HALT SYSTEM I F BUFFER FULL

HLT

I SSUE A RESET TO THE 8042
T8T4:

MOV
OUT

AL, aBH
MFC _PORT ,AL

<><><><><><><><><><><><>
<><><>CHECKPO I NT OB <><>

MOV
MOV
JMP

AL,OAAH
SP,OFFSET C8042A
C8042
~~t~~~_aUF _FULL

SELf TEST COMMAND
SET RETURN ADDR

03BB
03BO

BO OB
E6 80

03BF
03Cl
03C4
03C7
03C9
03ca
03CO
0300
0303
0305

BO
BC
EB
A8
74
E4
BC
EB
E4
3C

55

JZ
IN
MOV
JMP
IN
CMP

0307
0309

BO DC
E6 80

MOV
OUT

AL,aCH
MFG_PORT, AL

<><><><><><><><><><><><>
<><><>CHECKPO I NT OC <><>

030B

75 OD

JNZ

ERRO

GO IF NOT OK

0300
03DF
03£2
03E5

BO
BC
EB
BC

AA
0000 E
3F 90
01
02
60
0000 E
3F 90
60

TST4_B:
TST4_A:
TST4_C:

TEST

AL, PORT_A
Sf>, OFFSET oaF _ 42A
OBF _42

~t:;g~T_A

IS THE OUTPUT BUFFER fULL?
GO I F NOT
FLUSH
SET RETURN ADDR
GO WAIT FOR BUFFER
CET THE ENDING RESPONSE

;------- GET THE SWITCH SETTINGS

CO
0000 E
21 90
0000 E

5-38 Test 1

MOV
MOV
JMP

E30B:

MOV

AL,OCOH
SP,OFfSET C8042C
C8042
SP. OFFSET OSF_ 42S

READ I NPUT COMMAND
SET RETURN ADDRESS
ISSUE COMMAND
SET RETURN ADDRESS

03E8
03EB
03EO

EB 27 90
(4 60

03EF
03Fl
03F4
03F7

BO
Be
EB
74

03F9
03FS
03ro
03FE
0400
0402

BO 00
E6 80
F4
BO 50
[6 60
EB 1E 90

040~

FA

OSF 42
Al, PORT_A
OMA_PAGE+l, AL

JMP

[30C:

IN
OUT

£6 82

a

; ------ WR I TE BYTE
May

60
0000 E
OF 90
05

MOY
JMP

TST4_D: Jl
May
OUT

OF 8042 RAM

AL,60H
SP,OFFSET C8042B
C8042
TSTlI_Dl

WRITE BYTE COMf1AND
SET RETURN ADDR
I SSUf rHE COMMAND
CONT I NUE I F COMMAND ACCEPTED

AL,OOH
MfG_PORT ,AL

<><><><><><><> <><><><><>
<><><>CHECKPOI NT 00 <><>

AL,5DH
PORT_A, AL
E30A

ENABLE OUTPUT BUFF FULL INT - DISABLE KEYBOARD
SET SYS FlAG - PC 1 COMP - I NH OVERR I DE
CONT I NUE

llLT
T5T4_D1: MOV
OUT
JMP

; --------C8042 :

I SSUE THE COMMAND TO TH[ 8042

CLI

0406

£6 64

OUT

STATUS_PORT,AL

0408
040A

26 C9
Ell 64
A8 02
EO FA

SUB
IN

ex,cx

OIIOC
040E
0410

GO WAlT FOR RESPONSE
G[T THE SWITCH
SAVE TEMP

TEST
LOOPNl

e3

AL, STATUS_PORT
AL, I NPT BUF FULL
C42_'
-

NO I NTERRUPTS ALLOWED
SENO COMMAND IN AL REG
LOOP COUNT
WAIT fOR THE COMIMNO ACCI:Plr..o

REl

;------- WAIT fOR 8042 RESPONSE
0411
0413
0415
01117
0419
041B
0410
041F
0421

OBf _ 42:

28 C9
B3
E4
A8
75
E2

06
64
01
06
FB

SUB
MOV
IN
TF:ST
JNZ
LOOP
DEC
JNZ

C42_2:

FE CB
75 F4

RET

C42_3:

e3

. ---- - ---------- --

;
;
;

80 OE

0426
0429
042B
042F

BB

DOA:

£6 80
----

R

AX, DATA
DS,AX
8X, RESET_FLAG

B9 8000

OI~33

01130
0441
0443

28 FF
26 F6
2B co
8E 08
8E CO
81 F!3 1234
75 03
F9 05E6 R

SUB
SUB
MOY
MaY
eMP
JNZ
JMP

0 1146
0448

80 OF
E6 80

044A
044c
044E
0451
0 115 11
0 1156
0458

80
E6
BC
E9
88
75
E9

sua

cx, ZOOOH*4
OI,DI
SI,SI
AX,AX
OS,AX
ES,AX
ex. 1234H
£30A 0
CLR - STC

;-------- GET THE

MaY
OUT
MaY
JMP
MaY
JNZ
JMP

80
87
0000 E

0000 E
08

C30 :

03

; SET CHECKPO I NT I EJ
; <><><><><><><><><><><>
GET THE SYSTEM SEGMENT
OF DATA
SAVE RESET FLAe IN BX
SET OIR FLAG TO INC.

SET FOR 32K WCRDS
FIRST 16K

WARM START?
I F NOT

GO

INPUT BUFFER (SWITCH SETTINGS)

AL.OFH
MFG_PORT, AL

<><><><><><><><><><><><>
<><><>CHECKPO I NT F<><><>

AL, PRTY_CHK
DMA PAGE+6,AL
SP,OFrSET CZ
STGTST_CNT

SET BASE RAM PAR I TY
USE AS 'EMP SAVE
SET RETURN ADDRESS

BX,AX
e31

SAVE fAlLING Fli' PA'TERN
STORAGE OK,

e33
--BASE
-- - - - -- ------------- -- -- -- --------------64K STORAGE FAILURE

R

CJ'ILLER

WITH DATA

MOY

0430

Fe

I~EMORY

AL, OEH
MFG_PORT, AL

May

8E 08
88 l[ 0072 K

05F'

==1200 MS +

GO I F RESPONSE
TRY AGAIN
DECREMENT LOOP COUNT

TO
-- -- - -- - -- - - ---------- - RETURN
-- - -- --

MOY
OUT

MOY
eLO
MOY

01138

~

200MS/PER LOOP * 6
CHECK FOR RESPONSE

TEST. 11
BASE 64K READ/WRITE STORAGE TEST
DESCRI PTION
WR I TE/READ/VER I FY DATA PATTERNS
AA,55,FF,Ol, AND 00 TO 1ST 64K OF
STORAGE _ VER I FY STORACE ADDRESSAB I L I TY.
FILL

0422
0424

0435
0 1137
0439

ex, CX
BL,6
AL,STATUS_PORT
AL, OUT_BUF _FULL
C42 3
C42-Z
BL C42_2

CON'I NUE

DISPLAY THE CHECKPOINT (MfG CHECKPOINT)
AND XOR EXPECTED WITH READ IN MFG_PORT
DISPLAY CHECKPOINT IN MFG PORT+3
DISPLAY XOR'D DATA HIGH BYTE MFG PORT+1
LOW BVTE IN MFG PORT+2
A READ/WRITE SCOPE LOOP OF THE FIRST
WORD fOR POSSIBLE AOOR[SS LIN[ FA!LURES

045B
0458
0450
045F
0461

C31 :
r~ov

SA C7
£6 81
8A C3
1::6 82

OUT
r~ov

OUT

0463
0466
0468
046A
046C
0116E
01171
0473
Oll77
0117B
0470
Oll7F
0481

89
8E
28
88

COOO
09
DB
07

M1 :

JMP

CX,oeaOOH
DS,CX

ex, BX

~~6~~X~+2

cX,ex

GO I r NOT
BYPASS ERROR DISPLAY

AA,OAA55H

JZ
AOO
eMP
JL
ANO

Z5

75 03
E9 0573 R

Jr~p

BA 0308
2A CO
EE

eX,oBoH
CX,oe800H
Ml

--------- - -- --- -- --- ------------ - -- - ---- -- - - -- - -~ SET V IDEO MODE TO 0 I SPLAY MEMORY ERROR

IF vrDEO ROM

IIIIS ROUTINE INITIALIZES TIlE ATTAGrIMENT TO
TO DISPLAY FIRST 64K STORAGE ERRORS.
BOTH COLOR AND MONO ATTACHMENTS ARE I NIT I AL I ZED.

M4

'" 0010

10 ROM

C32
C31_0

CMP

JNZ

START OF

GET THE FIRST 2 LOCATIONS
BUS SETTLE
I S THE V IDEO ROM PRESENT?
GO I F YES
POINT TO NExT 2K BLOCK
TOP OF V j OED ROM AREA YET?
TRY AGAIN
SET NON ZERO FlAG

EB 00
3D AA55
711 OC
81 Cl 0080
81 F9 C800
7C E9
23 C9

Z5:

SAVE HIGH BYTE
SAVE LOW BYTE

CHECK FOR VIDEO ROM
MaY
MaY
SUB

MOY

;
;

0484
0487
0489

AL, BH
MFG_PORT+1, AL
AL,BL
MfG_PORT+2, AL

;-------

EQU
10H
INIT COLOR/MONO

C32:

MOY
SUB
OUT

DX,3D8H
AL,AL
OX,AL

CONTROL REG ADDRESS OF COLOR CARD
MODE SET

Test 1 5-39

o48A
0460
04ef
0490

I3A 0388

130 01
EE
83 EA 04

0493

BB 0030 E

0496

B9 DOlO

0499

32 E4

Z_2:

CONTROL REG ADDRESS OF BW CARD
MODE SET fOR CARD
RESET VIDEO
BACK TO BASE REG I STER

MOY
MOY
OUT
SUB

OX,03B8H
AL,l
DX,AL
DX,4

MOV
ASSUME
MOV

BX,OFFSET VIOEO_PARMS+M4*3
; POINT TO VIDEO PARMS
OS: CODE
CX,M4
; COUNT OF MONO VIDEO PARMS

; _____ ex

POINTS TO CORRECT ROW Of INITIALIZATION TABLE

XOR

AH,AH

; AH WILL SERVE AS REGISTER NUMBER DURING LOOP

LOOP THROUGH TABLE, OUTPUTTTlNG REG AOOKI:.55,
Ml0:

MOV
OUT
INC
INC
MOV
OUT
INC
DEC
LOOP
MOV
AND
CMP
JZ
MOV
MOV
JMP

AL,AH
DX,AL
OX
AH
AL,CS: {ax]
OX,AL
BX

THEN VALUE FROM TABLE

GET 6845 REG I STER NUMBER

0466
0469

8A C4
EE
42
FE e4
2E: 6A 07
EE
43
4A
E2 F2
6A E2
60 E4 FO
80 FC DO
74 08
BB 0000 E
SA 03D4
EB DB

0488
01.J.80
OI.J.CO

33 FF
138 BODO
8E CO

XOR
MOY
MOY

01,01
AX,OBOOOH
ES,AX

SET UP POINTER FOR REGEN
SET UP ES TO V IDEO REGEN

G4C2
04C5
04CB

89 0600
88 0720
F3/ AB

MOY
MOY
REP

CX,2048
AX, I '+7*256
STOSW

NUMBER OF WORDS I N MONO CARD
FILL CHAR FOR ALPHA
FILL THE REGEN BUFFER WITH BLANKS

a4CA
a4CC
04CF
0401
01.J.04

33 FF
B8 BBOO
8E C3
89 2000
F3/ AS

XOR
MOY
MOY
MOY
REP

01,01
BX,oeBOOH
ES,BX
CX,B192
STOSW

CLEAR COLOR V I ow RAM
SET UP ES TO COLOR V IDEO RAM

0498
0490
049E
049F
04Al
04A4
04A5
04A6
04A7
04A9
04A6
OllAE
0481
01~B3

ox

Ml0

AH,OL
AH,OFOH
AH,OOOH
Z_3
aX,OFFSET VIDEO PARMS
OX,3Dil-H
Z_2

POINT TO DATA PORT
NEXT REG I STER VALUE
GET TABLE VALUE
OUT TO CHIP
NEXT I N TABLE
BACK TO POINTER REGISTER
DO THE WHOLE TABLE
CHECK I f COLOR CARD DONE
STR I P UNWANTED BITS
I SIT THE COLOR CARD?
CONT I NUE I f COLOR
POINT TO VIDEO PARMS
COLOR BASE
CONT I NUE

;------ fiLL REGEN AREA WITH BLANK

FILL WITH BLANKS

; _____ ENABLE VIDEO AND CORRECT PORT SETTING
0406
0409
04013

MOY
MOY
OUT

SA 03138
130 29
EE

DX,3B8H
AL,29H
OX,AL

SET V IDEO ENABLE PORT

;----- SET UP OVERSCAN REGISTER
INC
MOY
OUT

DX
AL,30H
DX,AL

SET OVERSCAN PORT TO A DEFAULT
VALUE OF 30li FOR ALL MODES EXCEPT 640X200
OUTPUT THE CORRECT VALUE TO 309 PORT

OI.J.DC
OI.J.DD
Oil-OF

42
60 30
EE

OI~EO

04E3
04E5

BA 0308
BO 28
EE

04E6
011E?
04E9

112
BO 30
EE

04EA
04EC

BC C8
8E 00

MOY
MOY

AX,CS
SS,AX

04EE
0I.J.F1

BB BOOO
8E DB

MOV
MOY

eX,oeOOOH
OS,BX

SET OS TO BW CRT BUFrER

04F3
Oil-f5
04F8
04FA
04fC
04FD
04FE

80
89
2B
86
47
47
E2

MOY
MOY
SUB
MOV
INC
INC
LOOP

AL, '0'
CX,6
01,01
0::;:101 J,AL
DI
DI
Z

START AT 0
WR I TE TO CRT BUFFER
POINT TO NEXT POSTITON

0500
0503
0505

80 FF 138
74 OC
213 FF

CMP
JZ
SUB

Z_,

0507
0509
O)OB
0500
050F

87
8E
67
8E
EB

MOY
MOY
MOY
MOY
JMP

0511
0513
0515
0518
0519
051A
051C
051E
0520
0523

130 20
88 05
26: 88 05
47
47
E4 81
B1 04
02 E8
6C 050E R
EB 1E 90

Z_l:

0526
0526
052A
0520
0530
0532
0534
0536
0539
053C
053E
0540

E4
24
Be
EB
EI,
61
02
BC
EB
E4
21j.
BC

Zl:

; _____ ENABLE COLOR V IDEO AND CORRECT PORT SETT I NG
MOV
oX,3DaH
MOV
AL,28H
OUT
DX,AL
SET VIDEO ENABLE PORT
; ----- SET UP OVERSCAN REGI STER
INC
MOY
OUT

DX
AL,30H
DX,AL

SET OVERSCAN PORT TO A DEFAULT
VALUE OF 30H fOR ALL MODES EXCEPT 640X200
OUTPUT THE CORRECT VALUE TO 309 PORT

:------- DISPLAY FAILING CHECKPOINT AND

30
0006
Ff
05
FA

60
C3
68
DB
E2

SET STACK SEGMENT TO CODE SEGMENT

o I SPLAY BANK 000000

BH,OB8H

CHECK THAT COLOR BUfFER WRITTEN

01,01

POINT TO START OF BUFFER

BH,OBOH
ES,BX
BH,OB8H
OS,BX
Z_O

ES = MONO
SET SEGMENT TO COLOR
OS '" COLOR

;-------- PRINT FAILING BIT PATTERN

81
OF
05EO R
14 90
82
04
E8
05E2 R
08 90
82
OF
05E4 R

Z2:

Z3:

MOY
MOY
MOY
INC
INC
IN
MOV
SHR
MOY
JMP

AL, •
as: I 01 J,AL
ES;{DI1,AL
DI
DI
AL, MFG_PORT+l
CL,4
AL,CL
SP,OFfSET Zl_O
PR

IN
ANO
MOY
JMP
IN
MOY
SMR
MOY
JMP
IN
AND
MOY

AL, MfG_PORT+l
AL,OFH
SP, OFFSET Z2_0
PR
AL, MFG_PORT+2
CL,4
AL,CL
SP, OFFSET Z3_0
PR
AL,MFG_PORT+2
AL,OFH
SP, OFFSET Z4_0

;------- CONVERT AND PRINT

5-40 Test 1

DISPLAY A BLANK
WRITE TO COLOR BUFfER
WR I TE TO MONO BUFFER
PO I NT TO NEXT POST I TON
GET THE HIGH BYTE Of FAll NG PATTERN
SHI fT COUNT
NIBBLE SWAP

ISOLATE TO LOW NIBBLE
GET THE HIGH BYTE OF fAll NG PATTERN
SH I FT COUNT
NIBBLE $WAP

I SOLATE TO LOW NIBBLE
RETURN TO Z4:

0')43
0545
0546
0548

04 90
27
1'~ 40
27

0549
054B
054E
054F

86 05

0550

C3

PR:

26: 88 05
47
47

CONVERT 00-0 f TO ASC I I CHARACTER
ADO FIRST CONVERSION fACTOR
ADJUST FOR NUMERIC AND ALPHA RANGE
ADO CONVERSION AND AD.JUST LOW NIBBLE
ADJUST HIGH NIBBLE TO ASCHI RANGE

ADD
DAA
ADC
DAA

AL~090H

MOV
MOV
INC
INC

DS:{OI ).Al
ES:{DI }.AL
DI
DI

RET

AL~040H

WR I TE TO COLOR BUffER
WRITE TO MONO BUffER
POINT TO NEXT POSTITON

; ------- 0 I SPLAY 201 ERROR

0551
0553
0555
0558
0559
OS5A

055C
055E

0561
0562
0563
0565
0567
056A
056B
056C

D56E

0570

130 20

Z4:

68 AS

26: 88
47
47
BO 32
88 05
26: 86
47
47
80 30
88 05
26: 88
47
47
80 31
88 05
26: 88

05

MOV
MOV
MOV
INC
INC
MOV

MOlt

MOV
INC
INC
MOV
MOV
MOV
INC
INC
MOV
MOV
MOV

05

05

05

;----~---

0573
0575
0577
0579
057B

BO
E6
E6
2B

00
80
83

057B
0570
057F
0582
0584

2B CO
BE 08

C3l_0:

MOV

SUB

MOV
MOV

B8 AA55
2B FF
89 05

E5:[01 ).Al
DI
DI
AL '2'
OS:(OI }.AL
ES:IOI1.AL
DI
DI
AL, '0'
OS:[OI ],Al
ES:[DI],Al
DI
DI
Al, ' , '
OS:(OI LAl
ES:IOI J.AL

FIRST THE CHECKPOINT
<><><><><><><><><><><><><>
<><><>CHECKPOINT DO <><><>
ALSO 0 I SPLAY CHECK PO I NT I N PORT 83

SETUP SEGMENT

AX,OM55H

WRITE A.N AA55
READ THE FIRST WORD
DISPLAY CHKPT LONGER

OS,AX

01,01
OS: f 01 l.AX
AX.OS:(OI)
C3l_A

058A

89
88

as
as

MOV
MOV
lOOP

DS:(OI LAX
AX,DS:[DI)
C3'_B

89 as
88 05
E2 FA

MOV
MOV
lOOP

OS: [01 LAX
AX,DS:(DI]
C3'_C

89 05
88 05
E2 FA

MOV
MOV
lOOP

C31_0

89 05
88 05

MDV
MOV
lOOP

OS:[Oll,AX
AX.DS: [01]
C31_E

SUB

E2 FA

WRITE TO CRT BUfFER
WRITE TO MONO BUffER
-~>

A'V'>'

MOV
MOV
lOOP

E2 fA

WRITE TO CRT BUFFER
WRITE TO MONO BUFFER
PO I NT TO NEXT POSTI TON

cX,ex

8B as
E2 Fl

0590
0590
0592
0594
0596
0596
0598
059A
059C
059C
059E
05AO

01 SPLAY 201 ERROR
WRITE TO CRT BUFFER
WRITE TO MONO BUFFER
POINT TO NEXT POSTITON

AL,OOOH
MFG PORT .Al
MFG-PORT+3,AL

0586
0588
058A
058C
058E

DISPLAY A BLANK
WR I TE TO CRT BUFFER
WR I TE TO MONO BUFFER
POINT TO NEXT POSTITON

D5~1011.Al

ROLL ERROR CODE IN MFG_PORT

OUT
OUT
SUB

C9

AL •

os: (01 J ,AX
AX.DS:[DI)

; -------- ROLL ERROR CODE IN MFG_PORT --> NEXT THE HIGH 8YTE

05A2
05A4
05A6
05A6
05A9
05AB
05AD
05AF
05AF
0581

JN

E6 80

OU-:

MFG_PORT~AL

XOR Of FAILING BIT PATTERN
HIGH BYTE

88 AA55
89 05
88 05
t2 F7

MOV
MOV
MOV
LOOP

AX,OAA55H

WRITE AN AA55

DS:[DI].AX
AX.DS:[DI J
C31_G

READ THE FIRST WORD

89 05

MOV

os: [DI I,AX

MO'"

AX,DS:[DI

LOOP

C31_H

MOV
MOV
lOOP

OS: (01) ,AX
AX. OS: [01 ]
C3'_'

E4 81

88 05
E2 FA

0583
0585
0585
0587
0589

89 05
8B 05
[2 FA

05BB
05BO

E4 82
E6 80

05Bf
OSC2
05C4
05C6
05C8

B8
2B
89
88
E2

AA5S
FF
05

89

Al.MFG_PORT+l

J

C3el:

; -------- ROLL ERROR CODE IN MFC_PORT --> THEN THE lOW BYTE

05CA
05CA
05CC

05CE
0500
05DO
0502
0504
0506
0506
0508
05DA
05DC
05DE
05£0

05E2
05E4

IN
DUT

Al.MfG_PORT+2
MFC_PORT ,AL

lOW BYTE
WRITE AN AA))

AX,DAA55H

MOV
SUB
MOV
MOV
lOOP

OS:[OI LAX
AX,OS:[DI]

8B 05
E2 FA

as

NOV
MOV
lOOP

OS:(OII,AX
AX,DS:(DI]
C3'_l

89 05
8B 05
E2 FA

MOV
MOV
lOOP

OS: (01 LAX
AX,os:IDIJ
C31_M

89 05
813 05

MOV
MOV
LOOP
JMP

C3'_O

DO AGAI N

2'
22
23

TEMP
TEMP
TEMP
TEMP

C31_K:

05
F8

E.2 FA

EB 95

DW
DW
DW
DW

0526 R
0530 R

053C R
0551 R

01,01

READ THE FIRST WORD

C31_K

OS:[OI

LAX

Ax.os:IDIJ
C31_N

24

STACK
STACK
STACK
STACK

; ------- CLEAR STORAGE ENTRY

05E6
05£6
05£8
05EB

05EO

F3/ A8
B8 ---- R
8E 08
89 1E 0072 R

ClR_STG: ASSUME
R[P
MOV
MOV
MOV

os: DATA
STOSW
AX,DATA
OS,AX
RESET_FLAG,

STORE 32K WORDS OF 0000
RESTORE DATA SEGMENT

ax

RESTORE RESET FLAG

; ----- SETUP STACK SEC AND SP

05fl
05f4
05F6
05f9

B8 ---- R
8E 08
BC 0000
8E 04

C33:

MOV
MOV
MOV
MOV

AX~DATA

SET DATA SEGMENT

OS,AX
SP,P05T_SS
SS,SP

GET STACK VALUE
SET THE STACK UP

Test 1 5-41

O~FB

;

MOV

Be 80UO

; ________ GET THE
05FE
0600

60

0602
0604
0606
0609
0606

E4 82
fO
A? 0012 R

'6

l'iOV

"

OUT

BO

IN

2"

AND

MOV
SUB

2A CO

OUT

E6 82

INPUT

STACK

I S HEADY TO GO

BUFF[R (SWITCH SETTINGS)

AL,11H
MFG_PORT, AL

<> <><><> <> <><><><> <><><>
<><><>CHECKPO I NT 11 <><>

AL,DMA PAGE+1
AL,OFOH
MFG_IS1,AI
AL,AL
OMA_PAGE+1, AL

GCT THE SWITCH SETTINGS
STRIP UNUSED BITS
SAVE SElT I NGS
RESET DHA_PAGE

TEST .11A
YERIFY 286 LGOT/SC,OT LIOT/SIOT
I NSTRUCT IONS
DESCR I PT I ON
LOAD COT AND IDT RlGISTERS WITH
AA. 55,00 AND VER I FY CORRECT
;-------- VERIFY STATUS

0600
060E
060E
0610
060r
060E
0610
0610
0613

SMSW

or
01

+

+
EO

DB

??OOOO

+
+ ??0001

+

LABEL
SHL
LABEL
ORG
DB
OKG

01

aoor

INDICATE COMPABILITY (R[AL) MODE

AX
(JOFH
BYTE
AX,1
BYTE
OFFSET CS;??OOOO
OOlfi
OFfSET CS: ??0001
AX,OFIi
ERR_PROT

A9
75 37

TEST
JNZ

0615
0617

no

£6 80

MOY
OUT

AL,12H
MFG_PORT,AL

0619
061A

1E
07
BF DOAD
B9 0003
88 AAAA
E8 064F R
B8 5555
E8 064F R
2B CO
E8 D64r R
29 ED

PUSH
POP
MOY
MOY
MOV
CALL
MOV
CALL
SUB
CALL
SUB

OS
ES
D I ,SYS lOT LOC
CX,3
AX,OAAAAH
WRT PAT
AX,05555H
WRT PAT
AX, AX
win PAT
BP,SP

;

GET THE CURRENT STATUS WORD

PE/MP/EM/TS BITS SHOULD BE ZERO
GO I F STATUS NOT REAL MODE

TEST PROTECTED MODE REGISTERS

061£5
061 E
0621
06211

06z-t
06?A
0620
062F
0632

12

TEST 286 CONTROl
FD
9C
58
A9
75
A9
74
FC
9C
58
A9
75

06 119

EB 3E 90

0640

r

I RST PATTERN

ViR \ TE NEXT PATTERN
WRITE 0
RESTORE BP REG

SET 0 I RECT I ON FLAG FOR DECREMENT
GET THE fLAGS

PUSHF

POP

SET [5 TO SAME SEGMENT AS OS
USE TH I:; AKEA TO flU I Lo TEST PATTERN

FLAGS

STD

0634
0635
0636
0637
OG3A
063C
063F
0641
0642
06 113
06 1111
061-17

OGIIC
a611e

; SET CHECK f'OINT 12
; <><><><><><><><><><><:>

AX
AX,0200H
ERR_PROT
AX,OllOOH
ERR_PROT

I NHRRUPT FLAG SHOULD BE OFF
GO I f NOT
CHECK DIRECflON FLAG
GO I F NOT SET
CLEAR D I REcr J ON FLAG
INSURE DIRECT I ON fLAG IS HESEl

0;:>00
10
0400
DB

TEST
JNZ
TEST
JZ
CLO
PlJSHF

POP

AX

01100
03

nST
JNZ

AX,040QH
ERR_PROT

GO

C37A

TEST OK CONT I NUE

JMP
ERR PROT:

-

Ftl
m FO

HLT

J F NOT

PROTECTED MODE REGISTER FAILURE
I NSURE NO BREAKOUT OF HALT

JMP
WRITE TO 286 REGISTERS

064r
0652

0651,

89 0003
F3/ AB
8D DOAO

0657

26

0658

OF

+

88 5E 00

+

+

0659
0659

+

06SC

+

OG~9

0659

WRT PA T: r~oY
REPSTOSW
MaY
SECOY
DB
LI r)l
DB
LAlILL
??0003
MOY
LABEL
"?0004
ORG
ORG
MaY
SEGOY
DB
LGDT
DB
LABEL
MOV
LAB[L
ORG

DB

DOl H

065C

8D DOAQ

065F

?f.

()660
0661
0661
0664
0661
0661
06611

OF

+

88 56 00

+ "?0006
+
+ ""0007

0664

BO 08AO

['lOY
seGoy

0667

26

DB

01

0668
0669
0669
066C
0669
0669
066C
U66C

OF

066F

26

0670
0671
0671
0674
0671
0671
0674

or

06 f4

BF
8B
B9
BE
26:

06'19
067C
067F

LOAD THE

lOT

REGISTER FROM THIS AREA

I.OAD THE GDT
FROM THE SAME AREA

ORC
OFFSET CS; ??0007
READ AND YER I FY 286 REG I STERS

SlOT

067'1

STORE 6 BYTES OF PATTERN
BP, SY5 lOT LOC
E5
026H
[BPI
OOFH
BYTE
BX,WORD PTR {BP]
BYTE
OFFSET cs: ??0003
001H
OFFSET CS: ??0004
BP, SY5 lOT LOC
[S
026H
{BP J
UOFH
BYTE
OX,WORD PTR [BP]
BYTE
orrsCT CS:??0006

DB

01

06%

CX, 3

+

+ 110009

8B liE 00

DB

ourti

LABEL

BYTE
ex, [BPI
BYTE
OFFSET CS;??0009
001H
OFfSET CS: ??OOOA
BP,GOT LOC+5

Mav

+ ??OOQA

LABEL

+

aRC
DB

01

ORC
MOY
SEGOV

SO 08A5

DB

SCOT

03 46 00

+

DB

+ "?OOOC
+

ADD

+ ??OOOO

+

LABEL
LABEL
ORG

DB

01
oOAD
05
0005
D8AO
3B 04

5-42 Test 1

ORG
MOV
MOV

C37B:

BP, GOT LOC
ES
026H
[BP [

May
May
CM'

ES

STORE THE REG1STERS HERE
GET THE

lOT REGS

-

026H
{BP I
OOFH
BYTE
AX, [BPj
BYTE
OFFSET CS: ??OOOC
001H
OFFSET CS: ??OOOO
01, SYS lOT LOC
AX,DS:!DIICX,5
SI,GOT lOC
AX, ES: [SI]

GET

rHE GOT REGS

GET TH[ PATTERN WR I TTEN
CHECK ALL ReG I STERS
PO I NT TO THE BEG I NN I NG

0682
0684
0685
0686
0688

JNZ
INC
INC
LOOP

75 C8

46

'[2,6

F7

;

0693
0695
0697

2A CO
E6 Fl

CONTINUE TILL DONE

RET

C3

INITIALIZE THE 8259

0689
068S
0680
068F
0691

HALT I F ERROR
POINT TO NEXT WORD

ERR PROT
51 51
C37B

JNTERRUPT #1 CONTROLLER CHI P :

---------- - -- - -------------- ------------------------- - --

C37A;

SO 11
E6 20
EB 00
SO 08
E6 21
EB 00

SUB
OUT
MOY
OUT
JMP
MOY
OUT
JMP

AL,AL
X287+1.AL
AL, 11 H
I NTAOO,AL
SHORT $+2
AL,8
INTAQ1,AL
SHORT $+2
AL,04H
INTA01,AL
SHORT $+2
Al.,Ol H
INTA01,AL
SHORT $+2
AL,OFfH
INTA01,AL

RESET MATH PROCESSOR
ICW1

-

EDGE,

MASTER,

WAIT STATE FOR
SETlJP

leW3 -

80 04
E6 21
[B 00
E6 21
EB 00
SO FF
E6 21

MOY
OUT
JMP
MOY
OUT
JMP
MOY
OUT

06A9
06AB

SO 13
E6 80

MOY
OUT

06AD
06AF
06Bl
06B3
06B5
06B7
0669
0666
06BD
066F
06Cl
06C3
06C5
06C7

BO 11
E6 AO
EB 00
80 70
E6 Al
BO 02
EB 00
E6 Al
EB 00
80 01
E6 Al
EB 00
BO FF
[6 Al

06C9
06CB

BO 14
EG 80

MOY
OUT

AL,14H
MfG_PORT. AL

06CD
0600
0602
060!...
0607
06D8
060A
060B

B9
2B
BE
BB

MOY
SUB
MOY
MOY

CX,7BH
01, OJ
ES,DI
AX, OFFSET 011

MOVE ADDRESS OF
GET THE SEGMENT

IN J T J AL I ZE THE 8259

0078
FF
C7
0000 E

MOV
OUT
JMP
MOV
OUT
MOV
,IMP
OUT
JMP
MOV
OUT
JMP
MOV
OUT
;------- SET UP

03:

AB

STOSW
MOY

AX, CS

STOSW
LOOP

03

80 15
E6 80

06E.1
06E4
06E5
06E6
06E8
06EB

Bf 0040 R

06[E
06EF
06fO
06fl

A5

MOV
PUSH
POP
MOV
MOY
MOV

DE
1F

8C 08
l3[ 0010 [
B9 0010
D3A:

47
47
E2 FB

06F6
06F8

E8 0000 E

MOVSW
INC
INC
LOOP

CMOS:

£6 BO

I NT OfFSET

INT[flRUPT VECTORS
<><><><><><><><><><><><>
<><><>CHECKPOINT 15 <><>

OI,OFFSET VIDEO INT
CS
OS
AX, OS
;
SI,OFFSET VECTOR_TABLE+16
CX,16

S[l

VIDIO

INT AREA

SET UP ADDRESS OF VECTOR TABLE
SET AX=SEGMENT
; START WITH VIDEO ENTRY
MOVE VECTOR TABLE TO RAM

01

01

SKI P SEGMENT

POINTER

03A

DS:DATA
DDS

SET THE DATA SEGMENT

AL,16H
MFG_PORT, AL

<><><><><><><> <><><><><>
<><><>CHECKPO I NT 16 <><>

I S THE BATTERY LOW TH I S POWER UP'?
May

E6
EB
E4
A8
74
SO
£6
EB
E4

OUT
JMP
IN

E9 07Al R

fiLL ALL I NTERRU PT LOCAT IONS
fiRST INTERRUPT LOCATION
SET ES ALSO

ASSUME
CALL

BO 80

74 21

<><><><><><><><> <><><><>
<><><>CHECKPO I NT 14 <><>

May
OUT

; -------

0712

;

<><><> <><><><><><> <><><>
<><><>CHECKPO I NT 13 <><>

TEST.12
VER I FY CMOS CHECKSUM/BATTERY COOD
DESCRI PTION
DETERMINe I f CONFIG RECORD SHOULD BE
USED FOR INITIALIZATION

80 16

06FA
06FC
06FE
0700
0702
0704
0706
0708
070A
070e
070E
0710

NTERRUPT #2 CONTROLLER CH I P

;------- ESTABLISH BIOS SUBROUTINE CALL
MOV
AL,15H
OUT
MFG_PORT,AL

;
;

06F3

j

INTS. )

AL,11H
ICWl - EDGE, SLAVE ICW4
INTBOO,AL
SHORT $+2
WAIT STATE FOR 10
AI..,INT_TYPE
SETUP ICW2 - INT TYPE 50 (50-5f)
I NTB01 ,AL
Al.,02H
SETUP ICW3 - SLAVE LV 2
SHORT $+2
INTB01,AL
SHORT $+2
10 WAlT STATE
AL, 01 H
SETUP ICW4 - 80B6 MODE, SLAVE
INTB01,AL
SHORT $+2
WA I T STATE FOR 10
AL,OFfH
MASK ALL INTS. OFf
I NTBOl ,AL
;
THE INTERRUPT VECTORS TO TEMP INTERRUPT

Be CB

0000
a60F

10 WAIT STATE
SETUP ICW4 - MASTER,8086 MODE
WAIT STATE FOR 10
MASK ALL I NTS. OFF
(V IDEO ROUT I NE ENABLES

AL,13H
MFG_PORT,AL

AB

E2 F7

10

MASTER LV 2

0699
U696
069D
069F
06Al
06A3
06AS
06A7

SO 01

IC\,'4

WAIT STATE FOR 10
SETUP ICW2 - INI rYPE 8 (B-F)

70
00
71
80
OF
8E
70
00
71

CHECK BATTERY CONDITION
POINT TO BATTERY STATUS
WAIT STATE FOR to

TEST
JZ

AL, SA TlERY_CONO_STATUS
CMOS_PORT, AL
SHORT $+2
AL, CMOS_PORT +1
AL,80H
CMOS1A
AL,DIAG_STATUS
CMOS_PORT, AL
SHORT $+2
AL, CMOS_PORT+1
AL,BAD BAT
CMOS1 -

JMP

CMOS4

CONTINUE WiTHOUT CONFIG

TEST
JZ
MOY
OUT
JMP
IN

A8 BO

I S THE BATTERY LOW?
GO I F YES
GET THE OLD STATUS

HAS CUSTOMER SETUP BEEN EXECUTED?
GO CHECK CHECKSUM I F YES

SET DEFECT I VE BATTERY FLAG
0715
0717
0719
071B
0710
071F

0721
0723
0726
0728
072A
072e
072E

SO 17
E6 80
SO BE
E6 70
EB 00
£4 71
86 C4
80 CC BO
KO 8E
E6 70
86 C4
EB 00
E6 71

CMOS1A:

MOV
OUT

AI.,17H
MfG_PORT, AL

<><><><><><><><><><><><>
<><><>CHECKPO I NT 17 <><>

MOV
OUT
JMP
IN
XCHG
OR
MaY
OUT
XCHC
JMP
OUT

AL,DIAG_STATUS
CMOS PORT, AL
SHORT $+2
AL, CMOS_PORT+1
AL,AH
AH, BAD_BAT
AL, 01 AG_STATUS
CMOS PORT. AL
AL, AH
SHORT $+2
CMOS_PORT +1, AL

CMOS DIAGNOSTIC STATUS BYTE
GET THE CURRENT STATUS
SAVE
SET THE DEAD BATTERY FLAG
OUTPUT THE STATUS
SET FLAG

I N CMOS

Test 1 5-43

0130

E6 6f 90

JMP
CMOS4
; ----- VER I FY CHECKSUM

0733

60
E6
EB
E4
fB
86
60
E6
81
75
86
24

CMOS1 :

013')
0737
0739
0736
073D
073f
0741
0"143
0749
0746
0740

8E
70
00
71
00

EO

J"l
XCHG
A"D

EB 03 90

0756

2B DB

0758

2B C9
81 90
65 AE

unA

MOV
OUT
CMP

10

?A CO
F6 71

077C
onE
0780
0782
0784
0786
0788

XCHG

07

0752
0752
0754

075E
0760
0762
0764
0766
0768
076A
076C
076E
0770
0772
0774
0776
0778

'"

JMP

C4
8E
70
JE 0072 A 1234

074F

075A
075C

MOV
OUT
JMP

JMP

CMOS1 - A,

StiR
CMOS1 - B: OUT

CMOS2:

8A Cl
E6 70
EB 00
[4 71
2A E4
13 08
FE C1
3A E9
75 EE
DB DB
74 16
BO AI::
E6 70
EB 00
E4 71
8A EO
BO AF
E6 70
E6 00
E4 71
36 C3

MOV
OUT
JMP

AL,CL
CMOS_PORT, AL
SHORT $+2
AL,CMOS_ PORT+l
AH,AH
BX,AX

I MC

CL

CMP

CH,CL
CMOS2
BX,BX
CMOS3
AL, CMOS_ENO+l
CMOS_PORT,AL
SHORT $+2
AL, CMOS_ PORT+1
AH,AL
AL,CMOS_END+2
CMOS_PORT,AL
SHORT $+2
AL,CMOS_PORT+l
AX,BX
CMOS4

J"l
OR

Jl
MOV
OUT
JMP

'"

MOV
MOV
OUT
JMP

,

"

eMP
JZ

CLEAR OLD STATUS
10 D[LAY
GET THE CURRENT STATUS
10 DELAY
SAVE THE CURRENT STATUS
IS THIS A SOFT RESET
GO I F NOT
RESTORE THE STATUS
CLEAR ALL BUT TlI[ CMOS/POR MEMORY size
MI SCOMPARE

AI,AI
CMOS_PORT+l,AL
BX,BX
CX,CX
Cl., CMOS_BEG I N
CH,CMOS_END+l

,N

GO TO MINIMUM COMFIG

CMOSl - B

SUB
SUB
Mav
Mav

SUB
ADC

74 17

AL, DJAG_ STATUS
CMOS PORT,AL
SHORT $+2
AL,CMOS PORT+1
SHORT $+2
AL,AH
AL,DIAG_STATUS
CMOS _PORT ,AL
RESET_FLAG,1234H
CMOS1 - A
AH,AL
AL, W_M£M_S I Z£

SET START OF CMOS
51:.1 lNO Or CMOS
ADDRESS THE BEG I NN I NG
WAIT STATE FOR 10
INSURE AH=O
ADD TO CURRENT VALUE
POINT TO NEXT WORD
FIN I SHED?
GO I F NOT
BX MUST NOT BE 0
CMOS BAD IF CKSUM=O
GET THE CHECK SUM
FIRST BYTE OF CHECKSUM
SAVE IT
SECOND BYTE OF CHECKSUM

I S THE CHECKSUM OK
GO ! f YES

; ------- SET CMOS CHECKSUM ERROR
078A
078C
078E
0790
0792
0794
0797
0799
079B
0790
079F
07A1
07A3

CMOS3:

BO 8E

MOV
OUT
JMP

E6
EB
E4
86
80

70
00
71
C4
CC 40
60 8£
£6 70
EB 00
86 C4
E6 71
no 18
E6 80

,"
XCHG

DR
MOV
OUT
JMP

XCHG
OUT

CMOS4:

MOV
OUT

AL,OIAG STATUS
CMOS_PORT, AL
SHORT $+2
Al,CMOS PORT+l
AL,AH
AI~,BAD_CKSUM

AL,DIAG STATUS
CMOS_PORT, AL
SHORT $+2
AL,AH
CMOS_PORT+1,AL
AL,18H
MFC_PORT, AL

SET BAD CHECKSUM FLAG
10 DELAY
GET THE CURRENT STATUS
SAVE IT
SET BAD CHECKSUM FLAG
10 DELAY
SET FLAG
<><> <><><> <> <> <> <> <><> <>
<><><>CHECKPOI NT 18 <><>

ENABLE PROTECTED MODE

'"

61

AL, PORT 8
AL,K.AM PAR Off
SHORT 3+2 POHT_B,AL

DISABLE IO/RAM PARITY CHK

07A'j
07A7
07A9
07AB

Ell
OC
r:f3
E6

DIAD

60 19

OlAF

E6 80

MOV
OUT

AL,19H
MFG_PORf ,AL

<><> <><><><><> <> <><><> <>
<><><>CHECKPOI NT 19 <><>

0761

BO
E6
E6
60
E6

SF
70
00
01
71

MOV
OUT
JMP
MDY
OUT

AI., SHUT_DOWN
CMOS_PORT ,AL
SHORT $+2
AL.01H
CMOS_PORT+1, AL

SET THE RETURN ADDR

BC
8E
BG
E8

0000
04
8000
0000 E

MOV

SP,POST_SS
55, SP
5P, POST.• SP
SYSINITl

SET STACK FOR SYSINITl

OR
JMP
OUI

OC
00
61
; -------

07B3
07B5
07B7
0·(B9
O·/BB
07BE
07GO

07G3
07e6

Olea

SET RETURN ADDRESS BYTE I M CMOS

MOV
MOV

CALL
May
OUT

BO lA
E6 80

10 DELAY

AL,1AH
~1FG_PORT,AL

10 DELAY
fiRST SHUTDOWN RETN AD DR

CALL TH[ DESCR I PTOR TABLE BU ILDER
AND REAL-TO-PROTECTED MODE SWITCHER
<><><> <><><> <> <> <><><><>
<><><>CHE"CKPOI NT 1A <><>

; -------- SET TEMPORY STACK
07CA
07CO
07Cf
0705
07DA
0700
07Df

MOV
MOV
MOV
MOV
MOV
MOV
MOV

B8 0008
08
06 005A 0000
06 005e 00
0058
06
F FrD

8E
C7
C6
BE
8E
BC

AX, GOT PTR
DS,AX ;
DS:SS TEMP. BASE LO WORD,O
BYTE PTR OS: (SS-TEMP.BASE HI BYTE),TEMP STACK HI
S I ,SS TEMP
.-55,SISP,~1AX_SEG_LEN-2

TEST. 13
PROTECTED MODE TEST
CHECK MSW FOR PROTECTED MODE
MEMORY SIZE DETERMINE (RAM -> 640K)
OESCR I PT ION
THIS ROUTINF RUNS IN PROTECTED MOOE IN
ORDER TO ADDRESS ALL STORAGE
MEMORY SIZE IS SAVED AT MEMORY SIZE
CMOS DIAGNOSTIC BYTE BIT 4 = 512 -> 6401<
;-------

07E2
07E3
07E3
07E5
07£3
07[3

Of
+ ??OOOE

01

[0

01

5-44 Test 1

INSURE. PROllCJtU MOU!:.
SMSW

AX

DB

OOFH
BYTE
AX,1
BYTE
OFFSET CS; ??OOOE
001H

LABEL
SHL

+ ??OOOf

LABEL

+

ORG

DB

;

GET THE MACHINE STATUS WORD

ORG

OtES
OIES
07E8

A9 0001
7S 10

07EA
07Ee
OnE
07FO
07F2
07 F4

80
E6
EB
60
E6
E9

TEST
JNZ

8F
70
00

SHUT_8:

foIOV
OCT

OB
71
0000 E

J;1P

OFFSET CS:??OOOF
AX, V I RTUAL ENABLE
VIR_OI<
-

ARE WE

AL., SHUT DOWN
CMOS_PORT, AL
SHORT $+2
AL.,08H
CMOS_PORT+l, AL
PROC_SHUTDOWN

I N PROTECTED l'lODE

SET THE RETURN AODR
10 DELAV
SET SHUTDOWN 8
CAUSE A SHUTDOWN

;-------- VIRTUAL MODE ERROR HALT

07U
ona

",

SHUIS:

EB FL

IILI
JMP

;

SHurB

ERROR HALT

;------- 64K SEGMENT LIMIT
FFFF

DHA

C7 06 0048

0800

C6 06 0040 93

;------- CPLO,
MOV

DATA ACCESS RIGHTS
BYTE PTR DS:(ES_TEMP.DATA_ACC_RIGHTS),CPL.O_DATA_ACCESS

;------- START WITH SEGMENT AGDR 01-0000 (SECOND 6llK)
0805
DaDA

c6 06 OOllC 01
C7 06 004A 0000

0810
0812

BO

[6

0814

BB 0040

18
60

MOV
MOY

BYTE PTR OS: ( ES_ TEMP. BASE_H I_BYTE) ,01 H
OS: ES_ TEMP. BASE_LO_WORD, OH

MOV
OUT

AL,lBH
MFG_PORT, AL.

<><><><><><> <> <><><> <><>
<><><>-CHECKPO I NT 1 B <><>

MOV

BX,16*4

SET THE

FIRST 64K DONE

;------- START STORAGE SIZE/CLEAR
0817
0817
081A

OBlC
031 r
0821
0824
0824

Ba
BE
[B
74
E9

0048
CO
0838 R
03
08B7 R

NOT DONE:
MOY
MOV
CALL
JMP

AX, IeS_TEMP
[S AX
HOW BIG
NOT-F I N
DONE

ADO

8X,16*1,

JZ
NOT FIN:

83 C3 40

; ------- DO NEXT 64K (OXOOOO)
0827

PO I NT ES TO DATA
PO I NT TO SEGMENT TO TEST
00 THE" FIRST 6L: K
CHECK I r TOP OF RAM

I NC

FE 06 004C

BUMP MEMORY COUNT BY 611K
BL.OCK

BYTE PTR OS: ( ES_ TEMP. BASE_H I _BYTE)

: ------- CHECK FOR END OF FIRST 640K (END OF BASE RAM)
082B
0830
0832
0835

80
75
E8
E9

eMP

3E 004C OA
E5
088B R
08B7 R

JNZ
CALL
JMP
; -------

0838
0838
083A
083D
083F
0842
084 11
0847
084A
oa4C
084£
U8 11F
0852

28 FF
138 AAS5

01,01

PUSH
MOY
MOY
CMP
POP
J NZ

OS
AX, RSOA_PTR
OS,AX
RESET fL.AG,1234H
HOW_B! G_2

SOfT RESET
RESTORE OS
GO I F NOT SOFT RESET

MOY

WORD PTR [S:[OI ],0101H

TURN OFF BOTH PARITY BITS

IN
JMP
OR
OUT
JMP
AND
OUT

Al.,PORTG
SHORT $+2
Al,RAM PAR OFF
PORT B-;-AL SHORT $+2
AL, RM1_PAR_ON
PORT_B,AL

t10V
PUSH
POP
MOV

AX,orrrnl
AX
AX
AX,ES:[Dlj

IN
AND

AL, PORT.,_B
AL, PAR I TY _ERR

CHECK FOR PARITV/IO CHECK

75 08

MOY
J NZ

WORD PTR ES:[OI),O
HOW_B I G_E..NO

I NSURE NO PAR I TY 10 CHECK
GO IF PARITY/IO CHECK

28 CO

HOW BIG 2:
-SUB

AX, AX

WR I TE ZEROS

CX,2000H*4
STOSW

SET COUNT FOR 32K WORDS
F j LL 32K WORDS

IE

085D

26:

0862
0864
0866
OB68
086A
DB6e
OB6E

[II 61
£13 00
OC DC
E6 61
EB 00
24 F3
E6 61
B8
50

0018

08
3E 0072 R 1234

26
e7 05 0101

rFFF

58
26:

8B 05

OB78
Oa7A

F)I 61
21+ co

087C
0881
UB83
0883

26:

0885

89 8000
F3/ AS
C3

0888
OB8A
OBBa
0888
OBBe
088E

FILL/CHECK LOOP
SUB
MOV
MOV
MOV
MOV
MOV
MOV
XOR
JNZ

8B C8
26: 89 05
60 OF
26: 8B 05
26: 89 05
33 Cl
75 3D

085A
085B

0810
0873
08711
0875

C7 05 0000

9C

80 1C
£6 80

MOY
REP

AX,OAA55H
CX, AX
ES: [D! [,AX
AI_,orH
AX,ES:[DI[
ES:[Dlj,AX
AX, ex
HOW_B IG_ENO

BO
£6
EB
Ell
OC
86
80
E6
B6

81
77
24
E6

B3
70
00
"1 I
BO
CII
B3
70
C4
FB 0200
02
7F
71

TI:.5T PATTERN
SAVE PIITTERN
SEND PATTERN TO MEM.
PUT SOMETH I NG IN AL.
GET PATTERN
INSURE NO PARITY 10 GHECK
COMPARE PATTERNS
GO END I F NO COMPARE
POINT TO SYSTEM DATA AREA

os-

10 DELAY
TOGGLE PAR I TY CHECK ENABLES
10 DELAY

D[LAY
CHECK PAR I TV

RET
HOW BIG [NO;
--PUSHF
MOV
OUT

SAVE THE CURRENT
AL,lCH
MFG_PORT ,AL

;-------- SET OR RESET 512 TO 640
0890
OB92
OB94
0(396
0898
OB9A
089C
089E
OBAO
OBA2
08A6
08A8
08AA

GO I F NOT
GO SET MEMORY SIZE

HOW_BIG:

B8
BE
81
IF
75

085 l l

BYTE PTR DS:(ES TEMP.BASE HI_BYTE),OMI
NOT DONE
HOW-BIG END
DONE
-

t10V
OUT

JMP
IN

OR
XCHG
MOV
OUT

XCHG
GNP

JA
K640:

AND
OUT

AL, INFO_STATUS
CMOS_PORT ,AL
SHORT $+2
AL, GMOS PORT+l
Al, M640K
AL,AH
At, INFO_ STATUS
CMOS PORT, AL
AL,AH
BX,512
K640
AL, NOT M640K
CNOS_PORT+l,AL

FLAGS
<><><> <> <> <><><><><><><>
<><>CHECKPO I NT IG <><><>

INSTALLED FLAG
SET /RESET 640K STATUS FLAG
10 DELAY
GET THE DIAGNOSTIC STATUS
SAVE THE STATUS
RESTORt THF SIATlJS
CHeCK M[MORY SIZE
SET rLAG FOR 512 -> 640

INSTALLED

Test 1 5·45

08AC
08AF
08Bl
ORB')
08B6

B8 0018
8E 08
89 lE 0013 R

MOV
MOV
MOV

90
C3

RET

RESTORE THE DATA SEGMENT

AX, RSOA PTR
DS,AX
MEMORY_SIZE,BX

SAVE MEMORY SIZE
RESTORE THE FLAG REG

popr
TEST,13A
MEMORY SIZE DETERMINE (RAM ABOVE l024K)
OEseR I PT I ON
TH I S ROUT I NE RUNS I N PROTECTED MODE
MEMORY SIZE ABOVE 1 MEG ADDRESS I NG IS
SAVED I N CMOS
OONE:

08B7
08B7

aBBA

MOV
MOV

B8 0008
8E D8

;

AX,GOT PTR
OS,AX -

POINT

os

TO THE DESCRIPTER TABLE

; _______ START WITH SEGMENT ADDR 10-0000 (ONE MEG AND ABOVE)
DBBC
D8Cl

c6 06 OD4C 1D
C7 06 004A 0000

MOV
MOV

BYTE PTR os: (ES_TEMP.BASE_HI_BYTE),lQH
as: ES_TEMP. 8ASE_LO_WORD. OH

OBC7

BO 10
£6 80

MOV
OUT

AL,lOH
MFG_PORT, AL

<><><><><><><><><><><><>
<><><>CHECKPO I NT 10 <><>

2S OS

SUB

BX, BX

START WITH COUNT 0

08C9
08CS

;------- START STORAGE SIZE/CLEAR
08CD
08CO
0800
0802

NOT 00NE1:
MOV

68 0048
BE CO
E8 08EE R

0805
0807

74 03
EB 75 90

08DA

83 C3 40

AX, ES TEMP
ES, AXHOW_BIGl

POINT ES TO DATA
PO I NT TO SEGMENT TO TEST
DO THE FIRST 64K

JMP

DONEA
DONE1

CHECK I F TOP
GO I F TOP

ADD

BX,16*4

BUMP MEMORY COUNT BY 64K

MOV

CALL
JZ
DONEA:

; ------- DO NEXT 6JIK (XXOOOO) BLOCK
0800

INC

FE 06 004C

BYTE PTR DS:(ES_TEMP.BASE_HI_BYTE)

;------- CHECK FOR TOP Of RAM (fEDOOO)
08El
08El
08E6
08E8
08EB

80
75
E8
EB

3E 004C FE
E5
0933 R
61 90

NOT END BASE:
-CMP
BYTE PTR DS:(ES_TEMP.BASE_HI_BYTE),OFEH
JNZ
NOT DONE'
CALL
HOW=BIG_ENDl
JMP
DONEl
; ------- FILL/CHECK LOOP
HOW BIGl:
SUB
MOV

08EE
08EE
DeFO
08FJ
08FS
oaF8
08FA
08FO

88 C8
26: 89 05
60 OF
26: 88 05
26: 89 05

0900
0902

_33 Cl

XOR

75 2F

JNZ

0904
0905

0908

28 FF

B8 AA55

MOV

MOV
MOV
MOV
MOV

1E

B8 0018
8E 08

090A
0910
0911

81

0913
0918
091B
091C
0910
0920
0922

26:

1F
C7 05 0101

80 1 E
E6 80

AX
AX

IN
TEST

26 : C7 05 0000
75 08

0933
0933
0935

\.lORD PTR ES;[0Ij,0101H
AX,OFFFFH

MOV

26: 88 05
Ell 61
A8 40

26 CO
09 8000
F3/ A8

I~OV

JNL
HOW BIG 2A:
-SUB
MOV

REP
RET
HOW BI G ENOl:
-MOV
OUT

;------- SET

0947
0949
0946

BO
70
00
C3
71
00
61
70
EB 00
8A C7
E6 71

0940

e3

0937
0939
0938
0930
093F
0941
09t~3

0945

MOV

BO
E6
EB
8A
E6
EB
BO
[6

OU,
JMP

MOV
OUT
Ji~P

MOV
OUT
JMP

MOV
OUT

PAR I TY BITS

DELAY
CHECK PAR I TY
CHECK fOR 10 CHECK

WORD PTR ES: [D I], 0
HOW_BIG_ENDl

I NSURE NO PAR I TY
GO IF 10 CHECK

AX,AX
eX,2000H*4
STOSW

WRITE ZEROS
SET COUNT FOR 321< WORDS
FILL 32K WORDS

AL,lEH
MFG_PORT, AL

<><><><> <><><><><><><><>
<><>CHECKPO I NT 1 E <><><>

10 RAM SIZE

10 CHECK

IN CMOS

AL,M SIZE LO
CMOS=PORT-;AL
SHORT $+2
AL, BL
CMOS_PORT+l,AL
SHORT $+2
AL,M_SIZE_HI
CMOS_PORT ,Al
SHORT $+2
AL, BH
CMOS_PORT+l,AL

ADDRESS LO BYTE
10 DELAY
SET LOW MEMORY SIZE
I N CMOS
10 DELAY
ADDRESS H I BYTE
10 DELAY
SET THE HIGH MEMORY SIZE
I N CMOS

RET

DONE1:

BO 1F
80
06 004C 00
fFFF
09BA R

0950

E6
C6
BA
E8
2B

095F
0964
0967
096C
096F
0974
0977
097C

C6
[8
C6
E8
C6
E8
c6
E8

06 004C
098A R
06 004C
098A R
06 004C
098A R
06 004C
098A R

5-46

TURN OFF BOTH

AX, ES: [0 11
AL, PORT B
AL, rO_CHK

; ------- TEST ADDRESS Ll NES 19 094E
0950
0952
0957
095A

POINT TO SYSTEM DATA AREA
SOFT RESET
RESTORE OS
GO I F NOT SOFT RESET

PUSH
POP

LAST OF POSS I BLE RAM,
GO I F NOT

; GO SET MEMORY SIZE

TEST PATTERN
SAVE PATTERI';
SEND PATTERN TO MEM.
PUT SOMETH I NG IN AL
GET PATTERN
I NSURE NO PAR I TY 10 CHECK
COMPARE PATTERNS
GO END I f NO COMPARE

MOV

t-tov

88 FFFF
50
58

e3

os
AX, RSDA PTR
DS,AX RESET_fLAG,1234H
OS
HOW_B I G_2A

JNZ

75 18

0924
0929
092B
092B
0920
0930
0932

PUSH
~\oV

MOV
eMP
POP

3E 0072 R 1234

01,01
AX,OAA55H
CX,AX
ES: [01 LAX
AL,OfH
AX,ES:[DI J
ES:[DIj,AX
AX,CX
HOW_B I G_END1

;
;

02
08
10
20
40

Test 1

MOV
OUT

MOV
MOV
CALL

23

AL, 1 FH
; <><><><><><><><><><><><>
MFG_PORT,AL
; <><><>CHECKPOINT IF <><>
BYTE PTR os: (ES_TEMP. BASE_H I_BYTE), OOH
DX,OFFFFH
; WRITE FFFF AT ADDRESS 0

SUB

~~~DX

MOV
CALL
MOV
CALL
MOV
CALL
MOV
CALL

BYTE
SOO
BYTE
SDO
BYTE
SDO
BYTE
SOO

;

WRITE 0

PTR os: (ES_TEMP. BASE_H I_BYTE), 08H
;
PTR os: (ES_TEMP.BASE_HI_BYTE1,10H
;
PTR as: (ES_TEMP.BASE_HI_BYTE1,2QH
;
PTR OS; (ES_TEMP. BASE_H I_BYTE), 40H
;

BYTE PTR DS: ( ES~ TEMP. BASE_H I_BYTE), 80H
SOO

D97F
0981,

C6 06 004C 80
[8 098A R

MOV
CALL

0987

EB 20 90

JMP

SD2

098A
098C
098F
0991

28 fF
B8 0048
8E CO
26 : 89 15

SBB
,t,OV
!'10V
MOV

OI,DI
AX, ES TEMP
ES,AX-

SOD:

TEST PASSED CONT I NUE

POINT ES TO DATA
PO I NT TO S[Gr'1ENT TO TEST
PATTERN

WR I TE THE

ES: [01 LOX

0994

C6 06 004C 00

MOV

BYTE PTR DS:(ES_TEMP.BASE_HI_BYTEj,OOH

0999
099C
099E
09A3
09A?
09AB

B8
BE
26:
74
E9

MOV
MOV

AX, ES_TEMP

0048
CO
81 3D rFrF
03
07EA R

SOl:

C3

GMP

ES,AX
WORD PTR E.S:[DI J,OFFFFH

J7

Sal

Jr~p

SHUT _8

RET

POI NT ES TO DATA
PO I NT TO SEGMENT TO TEST
DID LOCAl I ON 0 CHANGE?
CONT I NUE I f NOT
GO HALT I F YES

; ------- CAUSE A SHUTDOWN
09A9
09AB
09AD

502:

£30 20

1'"6 80
E9 0000 E
;

09130
09B2
09B4
09B7
D9B9
09Re
09BF

MOV

AL,20H

<><><><><> <><><><> <><><>

OUT
JMP

MfG PORT. AL

<><><>CHECKPOINT 20 <><>
CAUSE A SHUTDON (RETURN VIA JUMP

MOV

<><> <><><><> <><><> <><><>
<><><>CHECKPOINT 21 <><>
SET REAL MODE STACK

SET UP THE REAL DATA AREA

PROC_SHUTDOWN

--RETURN
- ----------- - - -- - - -- ------- -- --- - -- - - - ------ - - ---- -- -1 FROM SHUTDOWN

SHUll;

Be 0100 R

MOV

AL, 21 H
MFG_PORT ,AL
SP, STACK
SS,SP
SP,OFFSET TOS

B8

Mav
Mav

AX,DATA
OS,AX

BO 21
E6 80

oe

----

BE 01,

OUT

Mav
r-lov

R

---- R

8£ 08

;-------- GET THE CONFIGURATION FROM CMOS
0gel
09C3
0ge?
09C7
09C9
09G8
09CD
0900
09D2
0904
0906
0908
090A
090C
09D[
09EO
09E2
09E4

BO BE

Mav

E6 70

OUT

[:(j

lJU

E4
A8
74
EB
8A

·{1

CO

03
77 90
EO
BO BE
E6 70
86 01
21\ OF
E6 71
80 94
EB 00
E6 -to
EB 00
E4 71

M_OK:

JI-IP
IN
n:ST
JZ
JMP
MOV
MOV
OUT

XCHG
ANa
OUT

MOV
JMP
OUT
Jt~P

IN
;--------

09[6
09E8
09E"
09EC
09EF

8A
A8
75
E8
711

09Fl

09F6

Ff) 06 0012 R 20
74 7A

09F8

£B IIG 90

09rB

09H}
09FE
09FE

09FF
DADO
OA02
OA04
OA06
OA07
OAOA
OADB
OAOO
OAll
~AlS

OA17
OA19
OA19

89

30

cuou

50
1E
8E 09
2B DB
88 07
1F
3D AA55

58

.'

M OK

BAD_MaS
AH,AI
AL, D lAG_STATUS
CI~OS PORT, AL
AL,AH
AL,ODrH
CMOS PORT+l,AL
AL, C:'::EQU I P
SHORT $+2
CMos_porn ,AL
SHORT $+2
AL, CMOS_PORT +1

[8 09FB R
74 27

GAl r
OA21
OA26

8/... C4

DAZ8

24 30
3C 30
7'5 18
8A C4
EB 09 90

10 DELAY

CALL
JZ
TEST
JZ

MfG_ TST, MFG_JMP
NORMAL_CON FIG

GO IF INSTALLED

EXCEPT

IF MFG JUMPER

IS

INSTALLED

JMP
BAD MOS
; GO DEFAULT
j-------- ROUTINE CHECK FOR VIDEO ROM PRESENT
CHK VIDEO;
MOV
CIII( VI DE01:
PUSH
PUSH
MOV
SUB
MOV
POP
eMP
POP

JZ
ADD
Cl~P

JL
AND

eX,OCOOOH

START OF

AX
OS

SAVE THE CONF I G
SAVE THE DATA SEGMENT

DS,CX

ex, BX

GET THE fiRST 2

DS

F6 06 0012 R 40
74 OB

cX,ex

RETUI~N

JZ

CHK VIDEO
BAO=MOS

MOV
TEST
JL

AL, AH
NFC TST,DSP JMP
MOS=OK_2-

AND
eMP

JNZ
MOV
JMP

LOCATIONS

RESTORE DATA SEC AND BUS SETTLE
\ S THE V I DEO ROt~ PRESENT?
GET THE C:ONFIG
GO I F VIDEO ROM INSTALLED
PO I NT TO NEXT 2K BLOCK
TOP OF VIDEO ROM AREA YET?
lRYAGAIN
SET N.ON ZERO FLAG

AX,OAA55H
AX
CHK VIDE02
CX, (jaOH
CX, QCBOOH
CHK VIOEOI

CHK VIOE02:
RCT

MOS OK 1:
- CALL

\0 ROM

AX, [BXJ

;-------- MONO CARD

OA2A
UA2e
GA2E
OA30

GET THE EQU I PMENT BYTE

SAVE VIDEO TYPE
ANY VIDEO?
CaNT I NUE
INSURE VIDEO ROM PRESENT
CONT I NUE

;-------- CMOS VIDEO BITS NON ZERO
OA1A
OA1A
OAHl

RESTORE THE STATUS BYTE
CLEAR THE I~IN CONFIG BIT

AH,AL
AL,030H
MOS_OK_1
CHK V IDEO
MOS:'::OK

,I NZ

711 OC
81 Cl 0080
F9 C800
7C E7
23 C9
G3

CHECK CMOS GOOD
GET THE STATUS
OK?
GO IF YES
GO I F NOT
SAVE THE CMOS STATUS
ADDRESS THE D I AG STATUS

INSURE CONFIGURATION HAS CORRECT VIDEO TYPE

MOV
TEST

EO
2E
09FB R
4A

AL, 0 I AG.,STATUS
CMOS_PORT,AL
SHORT $12
Al, CMOS_PORT+l
AL,OCOH

IS PRIMARY DISPLAY

AL,30H
I\L,30H
BAO MOS
AL,AH
MaS_OK

TO CALLlR

(CHECK FOR PRIMARY DISPLAY AND NO VIDEO ROM)
;

;

I S THE V IDEO ROM INSTALLED?
WRONG CONFIGURATION IN CONFIG BYTE.

f\ESTORE CONF I GURATl ON
CHECK FOR DISPLAY JUMPER
GO IF COLOR CAHO IS PRIMARY DISPLAY
(NO JUMPER

INSTALLED)

INSURE MONO IS PRIMARY
eONFIG OK7
GO I F NOT
RESTORE CONFIGURATION
USE THE CONFIG BYTE FOR CRT

; -------- COLOR CARD

DAB
OA33
OA35
QA37
OA39

24 38
3C 30
8A C4
74 OB

OA3B
OA30
OA3F
OA44

A8 01
75 33
F6 06 0012 R 20
74 2C

MOS OK 2:
- AND

01P
MOV
JZ

AL,30H
AL,3QH
AL,AH
BAD_MOS

STRI P UNWANTED BITS
MUST NOT BE MONO WITH JUMPER
RESTORE CONfiGURATION
GO I rYES

INSTALLED

;-------- CONFIGURATION MUST HAVE AT LEAST ONE DISKETrE
f~OS_OK:

TEST
JNZ
TEST

JZ

AL,OlH
NORf~AL CON F j G
MFG_ TST, MFG_JMP
NORMAL_CONFI G

MUST HAVE A"J LfAST ON 0 I SKETTE
GO SET CONFIGURATION IF OK
EXCEPT IF MFG JUMPER IS INSTALLED
GO I F INSTALLED

Test 1 5·47

;-------- MINIMUM CONFIG WITH BAD CMOS OR NON VAllO VIDEO

OA46
OAJI6
OA48
OA4A
OA4C
OA4E
OA5a
OA52
OA54
OA56
OAS8
OASA
OA5C
OASE
GA6a
OA6a

BAD_MOS:

80
(6
EB
E4
A8
75
86
BO
E6
E8
86
OG

MDV
OUT
JMP
IN

8E
70
00
71
CO
DE
c4
BE
70

TEST
JNZ

WAS THE BATTERY DEFECTIVE OR BAD CKSUM
GO I F YES
SAVE THE STATUS
CHECK CMOS GOOD

00

MOV
OUT
JMP

C4
20

OR

AL,AH
AL. 0 lAG_STATUS
CMOS PORT, AL
SHORT $+2
AL,AH
Al,20H

aUT

CMOS_PORT+l,AL

STORE THE STATUS

CHK VIDEO

XCHG

XCHG

E6 71

OA65

E8 09fB R
BO 01
74 OB

OM7
OA6C
OA6E

f6 06 0012 R 40
80 11
74 02

OA70

80 31

OMi3

GET THE DIAGNOSTIC STATUS

AL, 0 lAG_STATUS
CMOS PORT, AL
SHORT $+2
AL,CMOS_PORT+l
AL,OCOH
BAD MQSl

BAD MOS1:
CALL

RESTORE THE STATUS
SET TH£ MIN eONFG FLAG

MDV
JZ

AL.01H
NORMAL_CON FIG

CHECK fOR V IDEO ROM
DISKETTE ONLY
GO I F V IDEO ROM PRESENT

TEST
MDV
JZ

MfG_ TST. OSP _JMP
AL, 1 lH
NORMAL_CON FIG

CHECK FOR 0 I SPLAY JUMPER
DEFAULT TO 40X25 COLOR
GO I F JUMPER J S INSTALLED

MDV

AL,31H

01 SKETTE /

BW CRT 80X25

CONFIGURATION AND MFG. MODE
NORMAL_CONF I G:

OA72

JNZ
AND

MFG_TST, MFG_JMP
NORMl
AL,03EH

SUB

AH,A!1

MDV
eMP
JZ

EQUIP fLAG,AX
RESET-FLAG,1234H

TEST

DA72
OA77
OA79

f6 06 0012 R 20
75 02
24 3E

OA7B
OA7D
OABO
OAB6

2A
A3
81
74

OA88
OASA
OASD

80 60
E8 01105 R
80 40

Mav
CALL
MDV

OA8F

E6 60

OUT

PORT_A,AL

OA91
OA93

2B C9
E8 040A R

SUB

eX,ex

CALL

e42 1

OA96

B9 7FFf

OA99
OA9S
OA90

£4 64
AS 01
El FA

OA9F
OAAO
OM2
OM5
OM6
OAA8

ge

PUSHF

BO AD
E8 0405 R

MDV

AL, 01 S_KBD

CALL
POPF

C8042

90
74 DC
£4 60
A2 0072 R

JZ
IN
MOV

E4
0010 R
3£ 0072 R 1234
2C

NORM1:

E6

I S THE MANUFACTUR I NG JUMPER
GO IF NOT
STR I POI SKETTE fOR MfG TEST

INSTALLED

SAVE SWITCH INFO
BYPASS I F SOfT RESET

-

; _______ GET THE FIRST SELf TEST RESULTS FROM KEYBOARD

DMA

T516:

ENABLE KEYBOARD
ISSUE WR I TE BYTE COMMNAD
ENABLE OUT BUFF fULL INT
SYS FLAG - PC 1 COMP - I NH OVERR I DE
ENABLE KEYBOARD

AL,60H

C8042
AL,4DH

WAIT FOR COMMAND AGCEPTED

-

MDV

eX,07FFFH

IN

AL, STATUS_PORT

SET LOOP COUNT FOR APPROX 100 MS
TO RESPOND
WA I T FOR OUTPUT BUfF FULL

TEST
LOOPZ

AL.OUT_BUf_fULl
TST6

TRY AGAIN

IF NOT

SAVE FLAGS
KEYBOARD
I SSU£ THE COMMAND
RESTORE fLAGS
CONTINUE WITHOUT RESULTS
GET I NPUT FROM KEY BOARD
TEMP SAVE FOR AA REC I EVED

o I SABLE

E6

AL. PORT_A
BYTE PTR RESET _FLAG,AL

; -------- CHECK FOR MFG REQUEST

OAAD
OAAF
OABl

eMP
JNE
JMP

3C 65
75 03

£9 002e R
TEST

AL,065H

;

LOAD MFG.

;

GO TO BOOTSTRAP

TEST REQUEST?

E6

MFG_6DDT

I F SO

.ll~

I NIT I AL I ZE AND START CRT CONTROLLER (6845)
TEST VIDEO READ/WRITE STORAGE.
OEseR I PT I ON
RESET THE VIDEO ENABLE SIGNAL.
SEl,[<.T ALPHANIJl4ER I C MO~I'", 40 '* 25, B & W.
READ/WRITE DATA PATTERNS TO STG. CHECK STC
ADDRESSAB I L I TY.
ERROR == 1 LONG AND 2 SHORT BEEPS

OAB4
OAB4
DAB7

OAB8
OABA
OASD
OABf
OACl
OAG3
OAG6
OM':8
QAGA
OAGD
OACF
OADO
OAD3
DAD5
DAD7
DAD8
OAD9
OADB
DADO
OAED
OAE4
OAES
OAE6
DAE9
OAE9
OAEB
DAED
OAEf
OAFl
OAf3
OAFS
OAf?
OAFS
OAFA
OAFC
OAfD
OAFE
OBOl

E6:

Al 0010 R
50
80 30
A3 ~OlO R
2A E4
CD 10
BO 20
A3 0010 R
2A £4

co 10

B8 0001
CD 10

58
A3 ~OlO R
24 30
75 12
1E
50
2B CO
BE 08
SF 0040 R
C7 05 0000 E
58
1F
E9 OB68 R

MOV

AX, [QU I P_FLAG

PUSH

AX

MDV
MOV
SUB
I NT
MDV
MDV
SUB
I NT
MOV
I NT
POP
MDV
AND
JNZ

AL,30H
EQU I P_FLAG, AX
AH,AH
INT_VIDEO
AL,20H
EQUIP FLAG,AX
AH,AHINT_VIDEO
AX,0001H
INT VIDEO

PUSH
PUSH
SUB
MOV
MOV
MOV
POP
PDP
JMP

AX -

EQUIP_fLAG,AX
AL,30H
E7
OS

eMP
JE
I Ne
eMP
JNE
MOV

74
FE
3C
75
64
86
50
2A
CD
58
50
BB
BA

5-48

08
C4
20
02
03
EO

£8:

XCHG
PUSH

EB
AH

AL,20H

E8
AH,3
AH,AL
AX
AH,AH
INT VIDEO

SUB
INT
POP

PUSH

AX

BODO
03B8

MOV
MDV

BX,OBOOOH
DX,3BSH

Test 1

AND

I NIT TO S/W CARD
I NIT COLOR CARD

SET COLOR 40X25 MODE
RECOVER REAL SWITCH INFO
RESTORE IT
I SOLATE V IDEO SWS
V IDEO SWS SET TO 07
SAVE THE DATA SEGMENT

OS

E18_1
AL,30H

10

EI+

SEND

INFO

AX
SET DATA SEGMENT TO 0
AX, AX
OS,AX
DI,OFFSET VIDEO INT
; SET INT 10H TO DUMMY
WORD PTR [Dll,OFFSET DUMMY_RETURN; RETURN IF NO VIDEO CARD
AX
RESTORE REG I STERS

£7:
3C 30

GET SENSE
SAVE IT

AX-

BYPASS VIDEO TEST
TEST VIDEO:
B/W CARD ATTACHED?
YES - SET MODE FOR B/W CARD
SET COLOR ,.,.oOE FOR COLOR CD
80X25 MODE SELECTED?
NO - SET MODE FOR 40X25
SET MODE FOR BOX25
SET MODE:
SAVE V IDEO MODE ON STACK
INITIALIZE TO ALPHANUMER1C MD
CALL VIDEO 10
RESTORE V I DEO SENSE SWS IN AH
RESAVE VALUE
BEG V IDEO RAM ADDR B/W CD
MODE REG FeR S/W

OB04
OB07
01309
OBOC
OBOE
OB10
OB13
OB15
OB17
OB17
OB18
OB1A
OB1C

ORl E
OB21

MOY
MOV

89 0800

60 01
80
74
87
BA
B5
FE

CMP
JE
Mav
Mav
Mav
aEe

FC 30
09
B8
0308
20
C8

OB27
OB28
OB29
OB2B
OB20
OB30
OB32
OB35

C3
DB
C9

E9
BH, D8SH
OX,3D8H
CH,20H

AL

aUT
May
May

DX,AL
ES,BX

RaR

CX.l
STGTST_CNT

CALL

0000 £

JNE

6F

os. ax
E,7

TEST. 15
SETUP VIDEO DATA ON SCREEN FOR VIDEO
LINE TEST.
DESCRIPTION
ENABLE V IDEO SIGNAL AND SET MODE.
DISPLAY A HORIZONTAL BAR ON SCREEN.

bo:
BO 22
£6 80

May
OUT

AL,22H
MFG_PORT. AL

<><><><><><><><><><><><>
<><><>CHECKPOI NT 22 <><>

58
50

pap
PUSH

AX
AX
AH,O
INT VIDEO
AX.7020H
01,01
CX,40
STOSW

GET V IDEO SENSE SWS (AH)
SAVE IT
ENABLE V IDEO AND SET MODE
VIDEO
WRT BLANKS I N REVERSE V IDEO
SETUP START I NG LaC
NO. OF BLANKS TO 0 I SPLAY
WRITE VIDEO STORAGE

MaY

B4 00
CD 10
B8 7020
2B FF
69 0028
F3/ AS

INT
Mav
SU8

May
REP

;
;
;
;
;

OB37
OB38
OB39
OB3C
DB3F
OB41
0844
0844
OB46
OB46
OB48
OB49
OB4B
0840
OB4F
0851
OB53
OB54
0856
OB58
OB5A

WORD CNT FOR B/W CD
MODE fOR BW CARD
V IDEO C/,RD ATTACHED?
- GO TEST V IDEO STG
V IDEO RAM ADOR COLOR CD
MODE REG FOR COLOR CD
RAM WORD CNT FOR COLOR CO
SET MODE TO 0 FOR COLOR CD
TEST. VIDEO STG:
o I SABLE V IDEO FOR COLOR CO
PO I NT ES TO V IDEO RAM
PO I NT OS TO V I OED RAM
DIVIDE BY 2 FOR WORD COUNT
GO TEST V IDEO R/W STG
R/W STG FAI LURE - BEEP SPK

E9:
EE
8E
8E
01
£8
75

;
;
;
;

0623
0623
0825

RAM
SET
B/W
YES
BEG

CX.2048
AL,l
AH,30H

- - - - -- -- -- -------

58
50
80
SA
74
8A

--- - - ------- -----------

TEST.16
CRT I NTERF ACE LINES TEST
OESCRI PTION
SENSE ON/OfF TRANSITION OF THE
VIDEO ENABLE AND HORIZONTAL
SYNC LINES.

FC 30
03BA
03
03DA

POP
PUSH
eMP
May
JE
May

AX

May

AH.S

SUB

CX,CX
AL,OX
AL,AH

:
:

GET V IDEO SENSE SW INFO
SAVE IT
B/W CARD ATTACHED?
SETUP ADOR OF BW STATUS PORT
YES - GO TEST LINES
COLOR CARD I S ATTACHED
LINeTST:

AX
AH,30H
OX.03BAH
E, ,
DX,030AH

Ell:
84 08

OFLOOP_CNT:

E12:
2B C9

EC
22
75
F?
EB
28
[C
22
74
E2
£B

E13:
C4
04
F9
41
C9

IN
ANa
JNZ
LOOP
JMP

E14:
E15:

C4

05
F9

36 90

SUB

IN
ANa
JZ
LOOP
JMP

READ CRT STATUS PORT
CHECK V IDEO/HaRZ LI NE
I TS ON - CHECK IF IT GOES OFF
LOOP TILL m~ OR TIMEOUT
GO PR 1NT ERROR MSG

E'4
E13
SHORT El7
CX.CX
AL,oX
AL,AH

E' 6

[15

;
;

E17

READ CRT STATUS PORT
CHECK V' DEO/HORZ LINE
ITS ON - CHECK NEXT LINE
LOOP 1F ON TILL IT GOES OFf
GO ERROR BEEP

;------- CHECK HORIZONTAL LINE
0850
aBSF
OB61
OB63
OB63
0864
0666

S1 03
02 EC
75 £3

E16:

May
SHR
JNZ

CL,3
AH,CL

GET NEXT BIT TO CHECK

E, 2

pap
Mav

AX
AH,O
INT_VIDEO

CONT I NUE
o I SPLAY CURSOR;
GET V IDEO SENSE SWS (AH)
SET MODE AND
SPLAY CURSOR
CALL VIDEO I/O PROCEDURE

E1S:

58
B4 00
CD 10

INT

;--------- CHECK FOR THE
0868
OB68
OB60
OB6F
OB71
OB73
OB75
OB76
OB77
OB7A
087C
OB7f
OB81
0885
OB89
OB8B
OB8D
DB8F

BA
BO
£6
8E
2B
88

CODa
23
80
DA
DB
07

El8 1:
E18A:

MOV
MOV
aUT

May
SU8

May
PUSH

53

POP

58
3D AA55
75 05
E8 0000 E
£B 04
81 C2 0080
FA csoa
7C EO
BO 24
E6 80
E9 0000 E

.,

E18B:
E18C:

eMP
JNZ
CALL
JMP
ADO
CMP
JL
May
aUT
JMP

0'

A~VANCED

oX,oeaOOH
AL,23H
MFC PORT ,AL
OS,DX
I3X,BX
AX, {BX}
8X
8X
AX,OAA55H
E188
ROM CHECK
SHORT El8C
OX,0080H
OX,OCSOOH
ElSA
AL,24H
MFG PORT,AL

;
;
;

VIDEO CARD
SET THE LOW SEGMENT VALUE
<><><><><><><><><><><><>
<><><>CHECKPO I NT 23 <><>
GET FIRST 2 LOCATIONS
LET BUS SETTLE
PRESENT?
NO? GO LOOK FOR OTHER MODULES
GO SCAN MODULE
POINT TO NEXT 2K BLOCK
TOP Of VIDEO ROM AREA YET?
GO SCAN FOR ANOTHER MODULE
<><><><><><><><><><><><><><>
<><><>CHECKPO I NT 24 <><><><>
GO TO NEXT TEST

rOST2

; -------- CRT ERROR SET MfG CKPT AND ERR BEEP
OB92

£8 0000 E

E17:

CALL

DDS

;

POINT TO DATA

;-------- CHECKPOINT OC "" MONO FAILED
C6
80
74
F6
74
BA
E8

06 0015 R DC

MOV
CMP

MFG_ERR_FLAG,OCH
;<><><><>CRT ERR CHKPT. OC<><>
BYTE PTR RESET_FLAG,064H ; IS THIS A MfG REQUEST?
E19
BY PASS ERROR BEEP I F YES
TlcST
MFG_TST,MFG_JMP
IS THE MFG LOOP JUMPER lNSTALLEO?
JZ
E19
BY PASS ERROR BEEP I F YES
MOV
OX,102H
GO BEEP SPEAKER
CALL
ERR_BEEP
PUSH
OS
E19 :
GET THF CURRENT V IDEO
NOV
AX, EQU I P_FLAG
STRIP OTHER BITS
AND
AL,30H
IS IT MONO?
CMP
AL,30H
GO I f YES
JZ
TRY COLOR
;------- COLOR FAILED TRY MONO

OB95
OB9A
OB9F
OBAl
013A6
OBA8
OBAB
OBAE
OBAF
0882
0884
OB86

,E
Al
24
3C
74

OBB8

c6 06 0015 R 00

May

MFG_ERR_fLAG, DOH

aBBD
aBCO
OSC2
aBC3
aSC6
OBCS

BA 03BS
BO 01

May
Mav
aUT
May
Mav

OX,3B8H
AL,1
OX,AL
SX, DBODDH
OS,BX
AX,OAA55H

3E 0072 R 64
00
06 0012 R 20

06
0102

0000 E
0010 R
30
30
31

JZ

;-------- CHECKPOINT 00 "" COLOR FAILED

EE
BB BODO
8E DB
BS AA55

Mav

; <><><><>CRT ERR CHKPT.

00<><>

DISABLE B/W
OUTPUT THE 01 SABLE
CHECK FOR MONO VloEO RAM
WRITE AN AA55

Test 1 5-49

aBca
aBCD
OBCF
OBDl
0803
0806
0807
0809
080F
ORF?
OBE4
08E6

213
89
EB
8B
3D
1F
75
81
A1
2A
CO
fB

DB
07
00
07
AA55

SUB
MOV
JMP
MOV
CMP
POP
JNZ
OR
MOV
SUB
INT
JMP

56
DE 0010 R 0030
0010 R

[4
10
35 90

ax, ax
[ BX),AX
SHORT $+2
AX, [BX]
AX, OAA~~H
OS
E17 3
EQUIPJLAG, 30H
AX, EQU I P_FLAG
AH,AH
INT_VIDEO
E17_1

TO THE FIRST LOCATION
ALLOW BUS TO SETTLE
READ THE fiRST LOCATION
I S THE MONO V IDEO CARD THERE?
RESTORE THE DATA SEGMENT
CO I F NOT
TURN ON MONO BITS IN EQUI P FLAG
ENABLE V IDEO
CONTINUE

;-------- MONO FAILED TRY COLOR
OBE9
OB£9
OSEB
as ED
aBH
OBF2
OBF4
OBF5
OBF8
OBFA
OBFD
OBFF
OCOl
aC03
Ocos
acoa
OC09
OCOB
OC11
OC17
OC19
OC1S
OC1D
OC1D
OC1E
OC21
OC23
OC25
OC27
OC29
OC2B
OC2C

BO
2A
CD
BA
BO
EE
BB
8E
B8
2B
89
EB
88
3D
1F
75
B1
81

01
£4
10
0308
00
B800
DB
AA55
DB
07
00
07
AA55
21~

26 0010 R FFCF
OE 0010 R 0010

BO 01
2A Eli
CD 10

58
A1
24
3C
2A
74
FE

0010 R
30
30
Co
02
co

50
E9 OB63 R

TRY_COLOR:
MOV
SUB
INT
MOV
MOV
OUT
MOV
MOV
MOV
SUB
MOV
JMP
MOV
CMP
POP
JNZ
AND
OR
MOV
SUB
INT
E17_1 :
POP
MOV
AND
CMP
SUB
JZ
INC
E17_2:
PUSH
E17_4:
JMP

AL,OlH
AH,AH
INT_VIDEO
DX,3DSH
AL,O
OX,AL
BX, GB80GH
oS,ax
AX,OAA55H
aX,ax
[ BXj.AX
SHORT $+2
AX, [BX]
AX,OAA55H
OS
E17_3
EQU I P_FLAG,OFFCFH
EQU I P_FLAG,10H
AL.,OlH
AH,AH
INT_VIDEO
AX

AX, EQU I P_FLAG
AL,30H
AL.30H
AL.,AL
£17_2
AL
AX
E18

SET MODE COLOR 4GX25
o I SABLE COLOR
OUTPUT TilE DISABLE
CHECK FOR COLOR V IDEO RAM
\,fR I TE AN AA55
TO THE FIRST LOCATION
ALLOW aus TO SEn L.E
READ !tIE FIRST LOCATION
IS THE COLOR VIDEO CARD THERE?
RESTORE THE DATA SEGMENT
GO I F NOT
TURN OFF VIDEO BITS
SET COL.OR 40><24

SET NEW VIDEO TYPE ON STACK
IS

I T THE B/W?

I F YES
INIT FOR 40X25

GO

;------- BOTH VIDEO CARDS FAI LED SET DUMMY RETURN I f
OC2F
OC2F
OC30
OC32
OC34
OC37
OC3B
OC3C
OC3F
OC3f

RETRACE fALl URE

E17_3:
1E

26
8E
BF
C7

CO
08
0040 R
05 0000 E

1F
E9 OB68 R

5-50

POSTl
CODE

Test 1

PUSH
SUB
MOV
MOV
MOV
POP
JMP
ENOP
ENOS
ENO

OS

AX,AX
SET as SEGMENT TO 0
DS,AX
OI,OFFSET VIDEO_INT
SET INT lOH TO DUMMY
WORD PTR [01 ].OFFS£T DUMMY_RETURN
; RETURN IF NO VIDEO CARD
OS
E18_1
; 8YPASS REST OF V IDEO TEST

T I HE 01/03/84 TEST2 POWER ON SELF TEST
. II ST
PURLLC
CZl
PUBL I C SHUT2
PUBL I C
SliUT3
PUBL I C SHUT4
PUBL I C SHUT6
PUBL I C SHun
PUBL I C
PO::;T""
t NCLUDE SEGMENT. SRC
CODE SEGMENT BYTE PUBLIC

0000

EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN

H5: NEAR
POST7:NEAR
SET TOD:NEAR
EO:"NEAR
EO A: NEAR
£O::::B: NEAR

101 ERROR CODE
, 02 ERROR CODE
103 lRROR CODE

EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN

VIR ERR:NEAR
CM4:NEAR
CM4 A: NEAR
CM4-S:NEAR
CM4 -C: NEAR
CM4-D:NEAR
CM1:NEAR
CM2:NEAR
CM3:NEAR
E1_A:NEAR

104 ERROR
'05 ERROR
106 ERROR
107 ERROR
108 ERROR
109 ERROR
161 ERROR
162 ERROR
163 ERROR
164 ERROR

EXTRN
EXTRN
EXTRN

E1: NEAR
ADERR1: NEAR
ADERR:NEAR

201 ERROR CODE
202 ERROR CODE
203 ERROR CODE

EXTRN
EXTRN
EXTRN
EXTRN

Fl: NEAR
LOCK: NEAR
Fl A:NEAR
F1::::B:NEAR

301
302
303
304

ERROR
ERROR
ERROR
ERROR

EXTRN
EXTRN

E1

ECC: NEAR

401
501

ERROR CODE
ERROR CODE

EXTRN

F3:NEAR

601

ERROR CODE

EXTRN
EXTRN

KBD RESET: NEAR
GATE_AZO: NEAR

EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN

E MSG: NEAR
XPC BYTE: NEAR
VECTOR TABLE: NEAR
SLAVE VECTOR TABLE: NEAR
NMI INT:NEARPR I NT SCREEN: NEAR
BLINK-INT:NEAR
?RT HEX: NEAR
f3B:NEAR
PRT SEG:NEAR
XPC::::BYTE: NEAR

EXTRN
EXTHN
EXTRN
EXTRN
EXTRN
EXTRN
[XTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
UTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN

ROM_CHECK: NEAR
RDS CHECKSUM: NEAR
SEEK: NEAR
ERR BEE?;NEAR
P MSG: NEAR
START 1:NEAR
F4: NEAR
F4E: NEAR
F3A: NEAR
0 I SK BASE: NEAR
F3D: NCAR
F3Dl :NEAR
PRoe SHUTDOWN: NEAR
SYSINITl :NEAR
PROT PRT HEX: NEAR

B:NEAR

CODE
CODE
CODE
COOE
CODE
CODE
CODE
CODE
CODE
CODE

CODE
CODE
CODE
CODE

DISK~IO~NEAR

HO INT:NEAR
C801~2: NEAR
OBF 42:NEAR
STGTST CNT: NEAR
BOOT STRA? 1: NEAR
XI" I T-6042:NEAR
ROM ERR:NEAR
DDS:NEAR
01 SK SETtJP:NEAR
DSKETTE_SETU P; NEAR

TEST. 17
8259 I NTERRU PT CONTROLLER TEST
OESCR I PT I ON
READ/WRllE THE INTERRUPT MASK REGISTER (IMR)
WITH ALL ONES AND ZEROES. ENABLE SYSTEM
INTERRUPTS.
MASK DEVICE INTERRUPTS OFF. CHECK
FOR HOT INTERRUPTS (UNEXPECTED).
ASSUME
ASSUME
0000
0000
0002
0005

BO OA

?ROC

NEAR

C2l:

MOV

AL,10

;

CALL
CALL

PRT - HEX
DDS

; SET DATA SEGMENT

[8 0000 £
£8 0000 E

TEST THE
C21A:

0008

FA

0009
OOOB

BO 00
£6 21

0000
OOOF
0011
0013
0015

E6
EB
E4
8A
E4

0017
0019
001S

CS:CODE
OS:DATA

POST2

LI NE FEED ON CRT

IMR REG I STERS

eLi

TURN OFF INTERRUPTS
SU IMIi 10 LERO

MDV
OUT
OUT
JMP
IN
MOV
IN

AL,O
INTA01,AL
I NTBD1, AL
SHORT $+2
AL,INTAOT
AH,AL
AL, I NTBOl

OA EO
75 2C

OR
JNZ

AH,AL

0010

BO 25
E6 80

MOV
OUT

AL,25H
MFG_PORT, AL

; <><><><><><><><><><><><><><>
; <><><>CHECKPO t NT 25 <><><><>

DOlf
aD?'

BO FF
E6 2'

MOV
OUT

AL,OFFH
tNTA01,AL

;
;

Al
00
Zl

to

Al

SEND TO 2ND I NT
READ t MR
SAVE RESULTS
READ 2ND IMR
BOTH IMR = O?
GO TO ERR ROUTINE

06

D I SABLE DEV t CE
WRITE TO IMR

IF NOT 0

I NTERRU?TS

Test 2 5-51

OUT
JNP
IN
MOV

0023
0025
0027
0029
0028

[6 A 1
EB 00
[14 21
8A [0
Ell Al

0020
0030

05
1
75 15

IN

oao

ADD
JNZ

; ----- CHECK

I NTB01, AL
SHORT $+2
AL, I NTA01
AH, AL
AL,INTB01

WRITE TO 2ND
10 DELAY
READ I MR
SAVE RESULTS
READ 2ND IMR

AX,l

ALL IMR BIT ON?
NO - GO TO ERR ROUT I NE

06
FOR HOT

IMR

INTERRUPTS

INTERRUPTS ARE MASKED OFF.

CHECK THAT NO

A2 006B R

MDV

IN fR ~FLAG,AL

;

0035

BO 26
E6 80

MDV
OUT

AL,26H
MFG_PORT, AL

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 26 <><><><>

rB

ST I
SUD
Loor
LOOP
GI1P
JZ

a;

Dr;:

MDV

MFG_ERR.JLAG,OSH

Mav
D6A:

CALL

SI,OFFSET
E- MSG

0037
0039
003A
003C
003E
0040
0045

2B
[2
£2
80
·'4

0047

C6 06 0015 R 05

004C
aO/IF
0052
0053

BE 0000
E8 0000
FA
F4

C9
FE
FE

011:
05:

3E OOGB R 00
00

eLi

CLEAR

INTERRUPTS OCCUR.

0032

I NTERfWPT FLAG

ENABLE EXTErWAL INTERRUPTS
WAIT 1 SEC FOR ANY INTRS THAT
M I CHT OCCUR

CX,CX

04

DID ANY INTERRUPTS OCCUR?
NO - GO TO NEXT TEST

I NTR _FLAG, OUfI

07

Ea

<> <><> <> <><> <><><><> <><> <><>
<><>CHECKPO I NT 5<><><><><><>
D I SPLAY 101 ERROR
HALT THE SYSTEM

HLT

; -------CHECK THE CONVERT I NG LOG I C
; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 27 <><><><>

0054
0056

80 27
E6 80

MOV
OUT

Al,27H
MFG_PORT ,AL

0058
0050
005F
0061
0063
0065
0068

B8 AA)5
E7 82
E4 82
86 C4
EB 00
E4 83
3D 5SM
74 05

II,OV
OUT
IN
XCJlG
JMP
IN
CMP
JZ

AX,OAA551i
MFG_PORT+2, AX
AL, MFG_ PORT+2
AL,AH
SHORT $+2
AL, MFG_PORT+3
AX, 55AAH
07 - A

006A
006D

BE 0000 E
EB EO

MOV
JMP

SI ,OFFSET CM4_A
D6A

006F
006F
0071

2/0. CO
£6 80

OO~B

07:

;------- CHECK fOR HOT NMI

SUB
OUT

AL,AL
MfG_PORT,AL

MDV
OUT
MDV
LOOP
MOV
OUT
IN

WRITE A WORl)
GET THE r I RST BYTE
SAVE IT
10 DELAY
GET THE SECOND BYTE
IS I T OK?
GO I F YES

D I SPLAY 106 ERROR

INTt:RRUPTS WITHOUT

10/RAM PARITY ENABLED

SET FLAG TO ZERO
SAVE IT
TURN ON NM I

0073
0075
0077
007A
007e
007E
0080
0082
0084

0f
70
OOFF
FE
BO 8 F
E6 "fa
[I, 80
OA CO
74 U9

JZ

AL,OFH
CMOS .PORT, AL
CX,OOFFH
D7 B
AL-;-8FH
CMOS_PORT,AL
AL, MFG_PORT
AL,AL
D7 - C

0086
0088

BO 28
E6 80

MOV
OUT

At., ?8H
MrG _PORT,AL

008A
0080

BE 0000 £
£8 eo

MOV
JMP

SI,OFFSET eM4 B
D6A

0081
0091
0093
0095
009·,
0099
0098

BO ?9
[6 80
[It 61
8A EO
EB 00
24 Fe
E6 61

MOV
OUT
IN
MOV
,IMP
AND
OUT

AI.,2YH
MFG_PO,QT,AL
AL., PORT_B
AfI,AL
SHORT $+2
Al,OFCH
POHT_B,AL

0090
OD9F
DOAl
00A3
00A6
00A8
QOAA
OOAC

BO BO

Mav

E6
EB
68
E6
EB
8A
[6

AL,101100006
r I MfR+3, AI
SHORT $+2
AX,OAA55H
T I M[R+2, AL
SHORT $+2
AL,AH
T I MER+2, AL

SEL TIM 2,LSB,MSB,BINARY,MOOE 0
WRITF THE TIMER MODf RfG
10 DELAY
I-/R I T[ AN AA55
WRITE TIMER 2 CNT - LSB
10 DELAY

SIIORT $+2
AL, TIMER+2
AH,AL

10 DELAY
GET THE L5B
SAVE IT

SHORT $+2
AL, T I MER+2
AX,OS5AAH

10 DELAY
GET THE MSB
BUS 01(7
GO I F OK

BO
E6
B9
E2

07 - Bo

OR

DELAY
TURN OFr NM I
ANY NMI?
CONT 1 NUF

I F NOT

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 28 <><><><>

-

DISPLAY 107 ERROR

;------- TEST THE DATA BUS TO TIMER 2
D7_C:

OUT
JMP
MOV
OUT
JMP
!"-IOV
OUT

43
00
AA55
112

00
Gli
42

EB 00
E4 42

OOAE
0080
0082

86 F.O

OOBII
00B6
0088
00B8

EB
E4
3D
74

0080
OOCO

BE 0000 E
EB 80

00
112

55AA
05

D7~D

I'10V
JMP

51,OFFSET CM4 C
D6A
-

TEST.18
8253 T I MER CHECKOUT
OESCR I PT I ON
VERIFY THAT THE SYSTEM TIMER (0)
TOO FAST OR TOO SLOW.

OOC2
OOC4
00C6

ooer

OOC9
OOCB
OOCD
GoeF

0002
00D4
0006
OOOB
0009

BO
E6
FA
BO
E6
BO
E6
B9

MOV

80

our
eLi

AL, ZAH
MFG_PORT,AL

FE
21

MOV
OUT

10
43
002C

OUT
MOV

AL,OfEH
INTA01,AL
AL, 000 1 00008
T I M_CTL, AL
CX,16H*2

07_0;

2A

Eli 00
8A C 1
E6 40
FB
F6 06 006B R 01

5·52

Test 2

r~ov

08:

JMP
1'10V
OUT
STI
TEST

SHORT S+?
AL,Cl
TIMERO,AL
INTR_fLAG,01H

; <><><><><><> <><><><><><><><>
; <><><>CH[CKPO I NT 29 <><><><>
GET CURRENT SETT I NG OF PORT
SAVE THAT SEll I NG
10 DELAY
I N5Ur1E SP[AKER OFf

Wf{ I 11:. I I MI:.R 2 eN

r

MSB

DISPLAY 108 ERROR

DOESN'T COUN,

<><><> <><> <><><><><> <><> <><>
<><><>CHECKPOINT 2A <><><><>
MASK ALL I ~!TRS EXCEPT LVL 0
WR I TE THE 3259 I MR
SEL TIM 0, LSB, MODE 0, BINARY

'r/R I TE T I MER CONTROL MODE REG
SET PGM LOOP GNT
10 DELAY
SET T I MER 0 CNT REG
WRITE TIMER
CNT REG

a

OOOE
ODED

75 OD
E2 F7

JNZ

LOOP

DO
DB

00E2

C6 06 0017 K 02

MOV

MFG_ERR_FLAG,02H

00E7
OOEA

BE 0000 E
£9 004 F R

D8_A:

ODED
DOEF

BO 28
E6 80

09:

00F1
00F2
00F4
00F6
00F8
OOFO
OOFF
0101
0102
0107
0109

FA
BlOC
BO FF
E6 40
C6 06 0068 R 00
BO FE
E6 21
FB
F6 06 0068 R 01
75 DE
E2 F7

010B

2B C9

SUB

CX,CX

0100
OlOF

BO 2C
E6 80

MOV
OUT

AL,2CH
MFG_PORT ,AL

0111
0116
0118

F6 06 0068 R 01
7508
E2 F7

011A
0110

BE 0000 E
E9 004F R

MOV

; <><><><><><><><><><><><><><>
;<><>TlMER CHECKPOINT {2l<>
DISPLAY 102 ERROR
TI MER 0 I NTR 0 I ON' T OCCUR -

SI,OFFSET EO_A

JMP

00.

MOV

AL,2BH
MFG_PORT, AL

OUT

DID TIMER 0 INTERRUPT OCCUR"!
YES - CHECK TIMER OP FOR SLOW TIME
WAIT fOR INTR fOR SPECifiED TIME

ell
MOV
MOV
OUT
MOV
MOV
OUT

010:

STI
TEST
JNZ

LOOP

ERR

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 28 <><><><>

CL,12
AL,OFFH
TIMERO,AL
INTR FLAG,O
AL,O'FEH
INTA01,AL

SET PGM LOOP CNT
WR I TE TI MER 0 CNT REG

I NTR_FLAG, 01 H
DB A
010

DID TIMER 0 INTERRUPT OCCUR?
YES - TIMER CNTING TOO FAST, ERR
WAIT FOR INTR FOR SPECIFIED TIME

RESET I NTR RECE I VEO FLAG
REENABLE TI MER 0 I NTERRUTS

;------- WAIT fOR INTERRUPT

all:

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 2C <><><><>

a

JNZ

INTR fLAG,OlH
012 -

LOOP

0"

DID TIMER
GO IF YES
TRY AGAI N

MOV
JMP

Sl,OffSET EO_B
D6A

OISPLAY 103 ERROR
ERROR I F NOT

TEST

INTERRUPT OCCUR?

SETUP TIMER 0 TO MODE 3
012:

0120
0121
0123
0125
0127
0129
012B
0120
012F
0131

FA
BO
£6
80
E6
EB
BO
E6
EB
E6

FF
21
36
43
00
00
40
00
40

0133
0135
0137
0139
013B
0130
013F

2B
BO
£6
E4
A8
74
£2

C9
20
80
64
02
DB
F8

0141
0144

BE 0000 E
E9 004F R

ell
MOV
OUT
MOV
OUT
JMP
Mav
OUT
JMP
OUT

AL, OfFH
I NTA01,AL
AL,36H
T I MER+3, AL
SHORT $+2
AL, a
TIMER,AL
SHORT $+2
TIMER,AL

OISABLE ALL DEVICE INTERRUPTS
SEL TIM O,LSB,MSB,MODE 3
WRITE TIMER MODE REG
10 DI:.LAY
WRITE LSB TO TIMER 0 REG
, 10 DELAY
; WRITE MSB TO TIMER 0 REG

============="'===================="''''
; -------' CHECK 8042 fOR LAST COMMAND ACCEPTED

=====:=======""====================;==

013:

SUB
Mav
OUT
IN
TEST
JZ
LOOP
ERROR

CX, CX
AL,2DH
MfG_PORT, AL
AL, STATUS_PORT
AL,INPT_BUf_FULL
E19
013
EXIT (MSG 105)

MOV
JMP

Sl,OffSET CM4
D6A

SET WA IT TI ME
; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 20 <><><><>
GET THE 8042 STATUS
HAS THE LAST COMMAND BEEN ACCEPTED"!
GO I F YES
TRY AGAIN
PR I NT 105 ERROR
GO ERROR HALT

TEST. 19
ADD I T IONAL READ/WR I TE STORAGE TEST
;
++++ MUST RUN I N PROTECTED MODE ++++
; DESCR I PTI ON
WRITE/READ DATA PATTERNS TO ANY READ/WRITE
STORAGE AFTER THE fiRST 6111<.
STORAGE
ADDRESSAB III TY I S CHECKED.
ASSUME

OS: DATA

CALL
MOV
OUT

DDS
AL,2FH
MFG_PORT. AL

; SET DATA SEGMENT
; <><><><><><><><><><><><><><>
;<><><>CHECKPOINT 2f <><><><>

eMP
JNE
JMP

RESET_fLAG,1234H
E19A
SHUT2

WARM START?
; GO If NOT
; GO TO NEXT TEST I f WARM START

0147
0147
014A
014C

E8 0000 E
BO 2F
E6 80

E19:

014E
0154
0156

B1 3E 0072 R 1234
75 03
£9 0558 R

0159
0158

SO 30
£6 80

0150
015F
0161
0163
0165

BO
E6
BO
EB
E6

0167
016A
016C

BC 0000
8E 04
BC 8000

016F

E8 0000 E

CALL

SYSINIT1

0172
0174

BO 31
E6 80

MOV
OUT

AL,31H
MfG_PORT. AL

0176
0179
0178
0182
0188
0188
0180

B8 0008
BE CO
26: C7 06 005A 0000
26: C6 06 005C 00
BE 0058
8E 06
BC FFFD

0190
0193

B8 0018
8E 08

MOV
MOV

AX,RSDA]TR
DS,AX

POI NT TO DATA AREA

0195

BO 80

MOV

AL, PRTY_CHK

SET CHECK PAR I TY

; ------- SET SHUTDOWN RETURN 2

8F
70
02
00
71

E19A:

MOV

; <><><><><><><><><><><><><><>
; <><><>CHfCKPO I NT 30 <><><><>

OUT

AL,3011
MFG_PORT, AL

MOV
OUT
MDV
JMP
OUT

AL, SHUT DOWN
CMOS_PORT, AL
AL,2
SHORT $+2
CMOS_PORT+l. AL

ADDR FOR SHUTDOWN BYTE

MOV

sr, POST SS
SS,SP SP, POST_SP

SET STACK FOR SYSINITl

MOV
MOV

SECOND ENTRY I NTO TABLE
10 DE-LAY

GO ENABLE PROTECTED MODE
; <><><><><><><><><><><><><><>
; <><><>CHECKPO I fiT 31 <><><><>

; ------- SET TEMPORY STACK
MOV
MOV
MOV
MOY
MOV
MOV
MOV

AX, GOT PTR
ES,AX ES:SS_TEMP.BASE_LO_WORD,O
BYTE PTR ES:(SS_TEMP.BASE_HI_BYTEl,D
SI, SS TEMP
SS, SISP, MA)CSEG_LEN-2

; ------- DATA SEGMENT TO SYSTEM DATA AREA

Test 2 5-53

0197

SAVE WH I CH CHECK TO USE

OUT

E6 87

; ------- PR I NT 64 K BYTES OK
0199
019C
0190

B8 0040

OlAO
01A2
01A4
01A6
01A8

BO
E6
EB
E4

01A9
OlAB
OlAD
OlAF
01B1
01B3
01B5
01B7
0169
OlBB
OlaF
Ole,
olC5

ao
E6
EB
E4
86
BO
E6
EO
E4
8B
03
89

01C6
01C8
01CA
OlCO

A8 CO
74 03
E9 026E R

OlCO
OlCF
0101
0103
0105
0107
0109
010B
0100
OlOF
01£3

BO
E6
EB
E4
86
60
E6
EB
E4
39
74

E20A:

50
E9 0347 R

; -------BE
70
00
71

E20B:

I S CMOS GOOD?

MOV
OUT

Jf1P
IN
PUSH

50

STARTl NG AMT. Of MEMORY OK
SAVE MEMORY OK SIZE
POST MESSAGE

MOV
PUSH
JMP

AL, DIAG STATUS
CMOS_PORT, AL
SHORT $+2
AL, CMOS_PORT+l

tv<

DETERMINE THE CONDITION Of CMOS
10 DELAY
GET THE CMOS STATUS
SAVE CMOS STATUS

; ________ GET THE MEMORY SIZE DETERMINED (PREPARE BX FOR BAD CMOS)
MDV

B1
70
00
71
EO
80
70
00
71
lE 0013 R
08
lE 0017 R

OUT

JMP
IN
XCHG
MDV
OUT

JMP
IN
MDV
AOO

MDV
POP

58

TEST

JZ
JMP

AL,M_SIZE_HI
CMOS PORT ,AL
SHORT $+2
AL, CMOS_PORT+1
AH,AL
AL,M SIZE La
CMOS=PORT-;-AL
SHORT $+2
AL, CMOS_PORT+l
BX, MEMORY _S I ZE
BX,AX
WORD PTR KB_FLAG, BX

GfT THE HIGH BYTE
10 D[LAY
IlIGH BYTE
SAVE HIGH BYTE
GfT LOW BYTE

tv<

10 DELAY
LOW BYTE
PRE LOAD THE MEMORY SIZE
SET TOTAL MEMORY SIZE
SAVE THE TOTAL SIZE
RESTORE CMOS STATUS

AL,OCOH
E20BO
E20e

CMOS OK?
GO ! F YES
DEFAULT I F NOT

E20BO:
;- ___ ~~ __ GET THE BASE O->640K MEMORY SIZE FROM CONFIG IN CMOS
MDV

96
70
00
71
EO
95
70
00
71
06 0013 R
1C

OUT

JMP
IN
XCHG
MDV
OUT

JMP
IN
C~lP

JZ

AL,Ml_SIZE_HI
CMOS_PORT, AL
SHORT $+2
AL, CMOS_PORT+l
AH,AL
AL,Ml_SIZE_LO
CMOS_PORT, AL
SHORT $+2
AL,CMOS PORT+l
M~MOKY _5 I ZE, AX
E20B1

GfT THE HIGH BYTE
10 DELAY
HIGH BYTE
SAVE HIGH BYTE
GET LOW BYTE
10 DELAY
LOW BYTE
IS MEMORY SIZE GREATER THAN CONFIG?
GO I F EQUAL

;------- SET MEMERY SIZE DETERMINE NOT EQUAL TO CONFIG
01 £5
01E6
01E8
OlEA
OlEC
01 EE
01F0
01F2
01F4
01F6
01F8
OHA

onc
OHD

0201
0203
0205
0208
020A
020C
020E
0210
0212

0214
0216
0218
021A
021C
021 E

rUSH

50
BO
E6
EB
E4
OC
86
SO
E6
86
f8
E6

Mav

8E
70
00
71
10
C4
8E
70
C4
00
71

OUT

JMP
IN
OR
XCHC
MDV
OUT

XCHG
JMP
OUT

58
39
77
88
3D
72
BO
E6
EB
E'I
DC
86
BO
E6
86
EB
E6

06 0013 R
6B
08
0201
16
B3
70
00
71
80
C4
63
70
04
00
71

[20B1:

POP
eMP
JA
MDV
CfolI'
JB
MOV
OUT

JMP
IN
OR
XeHC
MDV
OUT

XCHG
JMP
OUT

AX
AL,DIAG_STATUS
CMOS PORT, AL
SHORT $+2
AL, CMOS_PORT+l
AL,W MEM SIZE

AH

i):AG STATUS
(.110S_PORT,AL
AL,MI
SHORT $+2
CMOS_PORT+1,AL
AX
MEMORY SIZE,AX
E20e
BX,AX
AX,513
NO 6110
AL-;-INFO STATUS
CMos_rORT,AL
SHORT $+2
AL, CMOS_PORT+l
AL,M640K
Al,AH
AL, I Nro STATUS
CMOS_PORT, AL
AL,AH
SHORT $+2
CMOS_PORT+l,AL

SAVE AX
AODRESS THE STATUS BYTE
10 DELAY
GET THE STATUS
SET CMOS FLAG
SAVE AL
RESTORE AL
10 DELAY
RESTORE AX
IS MEMORY SIZE GREATER TiIAN CONfIG?
DEFAULT TO MEM SIZE DET IF YES
SET BASE MEMORY SIZE
CHECK I F BASE RAM LESS 512K
GO I F YES
SET 640K BASE RAM BIT
10 DELAY
GET THE CURRENT STATUS
TURN ON 640K BIT I F NOT ALREAOY ON
SAVE THE CURRENT DIAG STATUS
ADOR THE STATUS BYTE
RESTORE THE STATUS
10 DELAY

;-------- CHECK MEMORY SIZE ABOVE 640K FROM CONFIG
NO~G40:

0220
0220
0222
0224
0226
0228
022A
022C
022E
0230
0232

80
E6
EB
E4
86
80
E6
E8
E4
88

98
70
00
71
EO
97
70
00
71
C8

0234
0236
0238
023A
023C
023E
0240
0242
0244

BO
E6
EB
E4
86
80
E6
EB
E4

B1
70
00
71
EO
BO
70
00
71

0246
0248

3B C8
74 18

021~A
021~B

0240
024F
0251

0253
0255
0257
0259
025B
0250
025F
0261

>0
BO
E6
EB
E4
DC
86
60
E6
86
EB
E6

8E
70
00
71
10
C4
8E
70
C4
00
71

58

0262

5-54 Test 2

GET THE HIGH BYTE
MOV
AL,M2 SIZE HI
OUT
CMOS PORT, AL
10 DELAY
JM?
SHORT $+2
HIGH BYTE
IN
AL,CMOS PORT+l
SAVE HIGH BYTE
XCHC
AH,ALCET LOW BYTE
MOV
AL,M2 SIZE LO
OUT
CMOS PORT, Al
JMP
SHORT $+2
10 DELAY
IN
AL, CMOS_PORT+l
LOW BYTE
MOV
CX,AX
; SAVE THE ABOVE 640K RAM SIZE
;------- ABOV[ 640K SIZE FROM MEMORY SIZE DETERMINE
;------- CX=CONFIG AX=MEMORY SIZE DETERMINE
MOV
Al,M_SIZE_H!
GET THE HIGH BYTE
OUT
CMOS_PORT, AL
10 DELAY
JMP
SHORT $+2
HIGH BYTE
IN
AL, CMOS PORT+1
SAVE HIGH BYTE
XCHG
AH, AL GET LOW BYTE
MOV
AL,M SIZE LO
OUT
CMOS:=PORT-;-AL
10 DELAY
JMP
SHORT $+2
LOW BYTE
IN
AL,CMOS_PORT+l
WHICH IS GREATER
; _______ AX=MEMORY SIZE DETERMINE CX=CONfIG (ABOVE 640)
BX=SIZE (BELOW 640)
CMP
CX,AX
; IS CONFIG EQUAL TO DETERMINED?
JZ
SET _MEM1
; GO I F EQUAL
; _______ SET MEMERY SIZE OETERMINE NOT EQUAL TO CONFIG
PUSH
AX
SAVE AX
MOV
AL,DIAG_STATUS
ADDRESS THE STATUS BYTE
OUT
CMOS PORT, AL
10 DELAY
JMP
SHORT $+2
GET THE STATUS
:N
AL,CMOS PORT+l
SET CMOS FLAG
OR
AL, W_"U;-M_517f
SAVE Al
XeHG
AL,AH
MOV
AL,DIAG STATUS
OUT
CMOS_PORT,AL
RESTORE AL
XCHG
AL,AH
10 DELAY
JMP
SHORT $+2
OUT
CMOS PORT+1, AL
POP
AXRESTORE AX

j-------

0262
0264
0266
0268
0268
026A

CMP
JA
MOV
SET MEM:
ADO
-

38 C8
77 02
813 C8

03 09
89 1 E 0017 R

MOV

026E
026E
0271
0273
0275

83 EB 40

0276
02·'9

B8 0008

B'

E20C:
E200:

06

D3 EB
53

eX,AX
SET MEM

IS CONFIG GREATER THAN DETERMINED?
GO I f YES
USE I~EMORY SIZE DETERMINE I F NOT

BX,CX
WORD PTR KB_FLAG, BX

SeT TOTAL MEMORY SIZE

eX,Ax

SUB
MOV
SHR

I3X,16*4
CL,U6H
BX,CL

PUSH

OX

SAVE TOTAL SIZE FOR LATER TEST I NC
1 ST 64K ALREADY DONE
DIVI DE BY 54
SAVE COUNT OF 64K BLOCKS

;-------'MODIFY DESCRIPTOR TABLES

;-------'SE1
0273

26:

AX,GDT_PTR
ES,AX

MOV
MOV

8E CO

C7 06 0048 rrrF

MOV
;------- CPLO,

0282

26:

c6 06 0040 93

;

MOV

ES: ES_ T[MP. SEG_L I MIT, MAX_SEG_LEN
DATA ACCI::SS RIGHTS
BYTE PTR ES: (ES_ TEMP. OATA_ACC_,R I CHTS). CPLD_DATA_ACCESS

;------- START WITH SEGMENT 010000
0258
02aE

26: C6 06 OOI~C 00
26: G7 06 004A 0000

0295

26:

MODI FY THE DESCRI PTER TABLE

Tmp ES DESCRIPTOR G4K SEGMENT LIMIT

MOV
MOY

(SECOND 64K)

BYTE PTR ES:(ES_TEMP.8ASE_HI_BYTE),O
ES: ES_ TEMP. BASE_LO_WORD, 0

;-------'SET TEMP DS OI::SCRIPTOR 64K SEGMENT LIMlr
C7 06 0060

FFFF

MOV
;------- CPLO,

02':1C

;':6:

C6 06 u06';> 93

MOV

ES: OS_TEMP. SEG_LIMI T, MAX_SlG_LEN
DATA ACCESS RIGHTS
BYTE PTR ES:(DS_TEP,·'

;------- START WITH SEGMENT 010000
C6 06 006/-1 00
C7 06 0062 0000

02A2
02A8

26:
26:

MOV
MOV

02AF
02[31
02B3
02B5
0287

2A CO
EG 85

~OT

E6 86

OUT

FE CO
E6 81~

OUT

BYTE PTR ES:(OS_TEMP.BASE_HI_BYTE),O
ES: OS_TEMP. BASE_LO_WORD, 0

;------- TEMPORARY SEGMENT SAVE
SOB

INC

IN DMA PAGE REGISTER

AL,AL
OMA_PAGE+4,AL
DMA PAGE+5,AL
AL DMA_PAGE+3,AL

;
;
;
;

HIGH BYTE OF LOW WORD OF SEGMENT
LOW BYTE OF LOW WORO OF SEGMENT
SET HIGH ByrE. OF SEGMENT WORD
HIGH BYTE OF SEGMENT

;------- POINT TO NEXT BLOCK OF 32K WORDS
0289
02BC
0?[3[
02C2

138 0008

£21 :

BE 08

MOV
MOV

FE 06 0064
FE 06 004e

INC
INC

AX, GOT_PTR
; PO I NT TO START OF OESCR TABLE
OS,AX
;
BYTE PTR DS;{DS TEMP. BASE HI BYTE)
BYTE PTR DS:(ES::::TEMP.BASCHI::::BVTE)

;-------- CHECK FOR END OF 256K PLANAR RAM
02C6
02CB
02CO
02CE
0201
0203
02D6
02D7
02D9
020B
0200

80 3E 0064 04

72

'E

CMP

'2

.)13

PUSH
MOV
MaY
MOY
POP
TEST
JNZ
MaY
OUT

BB 0018

BE DB
AO 0012 R

,F

AB '0
75 01,
80 40
E6 87

BYTE PTR OS: (OS_TEMP.BASE_HI_BYTE),04H
E21 0
GO IF STILL BA:SE RAM
OS SAVE THE CURRENT DATA SEGMENT
AX, RSDA_PTR
POI NT TO POST DATA SFGMFNT
OS,AX
AL,MFG_TST
GET THE JUMPER INFO
OS
RESTORE OS
AL, BASE_RAM
CHECK I F SECOND 256K ON BASE PLANAR
E21 a
GO IF YES
AL, To CHK
SET 10 CHANNEL CHECK TEST
DMA_PAGE+6,AL

;------- CHECK END
02DF
02E1
02[3
02[5

80 03
E6 70
[8 00
E4 71

02E7
02EC

80 3E 0064 08
72 08

E21_0:

HOV
OUT
JMP
IN

;-------- CHECK
CMP
JB

or

86 C4

XCHG

BO 40

MOV

E6 8f

86 C4

OUT
XCHG

02F6
02F8

A8 80
74 OA

02FA
02FF
0301

8D 3[ 0064 OA
75
EB 08 90

030 11

80 3E 0064 08

0309

7'5 OA

SET 6401< [lASE HAM BIT
;
;

FOR FND OF 512K PLANAR RAM

10 CHECK

Al,AH
AL, 10__ CHK
DMA PAGE +6, Al
AL,AH

;------- CHECK FOR 640K BASE RAM (128K

SAVE AL
RES rORE AL
10 CARD)
;
;

C~lP

'"

.)NZ
JMP

10 DELAY
GET THE CURRENT STATUS

BYTE PTR DS:(DS TEMP. BASE HI BYTE),08fi
E12_A
-GO-IF STILL BASE RAM

; ------- SET USE TEST

02EF.
O?FO
02F2
02F4

FIRST 516K OR 640K (END OF BASE RAM)

At, INFO_STATUS
CMOS_PORT, AL
SHORT $+2
AL, CMOS_PORT +1

IS 640K BASE
GO I F NO

INSTALLED?

BYTE PTR OS: (OS_TEMP. BASCHI_BYTE) ,OAH
NEXTl
E12_C
; CONTINUE
BYTE PTR OS: ( OS_TEMP. BASE_H I_BYTE), 08H
1'1 !:.XT 1

;------- DO ADDITIONAL STORAGE ABOVE 1 MEG
0303
0310

CG 06 006i~ 10
CG 06 V04C 10

BYTE PTR DS:(DS TEMP.BAS[ HI 13YTE),lDH
BYTE PTR OS: (ES::::TEMP.BASE:::H(_ BYTE), lOH
;------- SAVE BASE HI

031 )
0318

AO 00611

031A
031F
0321

80 3£ 004e FE

£6

81~

NEXTl:

MOV
OUT

BYTE

IN OMA PAGE REGISTERS 3

Al,BYTE PTR os: (OS_TEMP.BASE_HI_BYTE)
DMA PAGE+3.AL
; SAVE THE HIGH BYTE OF SEGMENT
.;
FOR POS I BLE ERROR

;------- CHECK fOR TOP Of RAM (FEOOaO)

75 03
EB 66 90

CMP
JNZ
JMP

16MEG

BYTE PTR DS:(ES TEMP. BASE HI BYTE),OFEH ;
NEXT
;-GO-IF NOT
KB_LOOP3
; GO NEXT TES--;-

TOP OF RAM?

; ------- SET ES AND OS REG I STERS

Test 2

5-55

032'1
0327
0329
032C

B8
BE
B8
8E

0060

NEXT:

MOV

AX, OS TEMP
OS, AXAX, ES_TEMP
ES,AX

MOV
OUT

AL,31H
MFG_PORT, AL

MOV

CX,2000H*4
STGTST CNT
N1
E21A
CX
AX

MOV
MOV
MOV

08
0048
CO

032E
0330

80 31

0332
0335
0338
033A
0330
033E

B9
E8
74
E9

033 F
0341

2B FF
AB

SUB
STOSW

OI,OJ

0342
0345
0346

05 0040

50
51

ADO
PUSH
PUSH

AX, 16*4
AX

0347
0347
0348

B6 OODA

0346
034E

69 0005
2B FF

E6 80
8000
0000 E
03
0470 R

CALL

JZ
JMP
POP
eop

N1 :

59
58

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 31 <><><><>
SET COUNT FOR 32K WORDS

CONTINUE I F OK
GO PR I NT ERROR
POP CX TO GET AX
RECOVER TESTED MEMORY

; _______ WRITE THE CURRENT SIZE FOR (ADDRESS LINE 23-17 TEST) USED LATER

035A
0350
0350
035E
0361
0362
0364
0367
036A
036A
0360
036E
0371
0372
0374
0375
0378
037A
0370
0370
037E
037F
0381
0384
0384
0385
0386

SAVE TESTED MEr10RY
SAVE LOOP COUNT

ex

PRT_SIZ:

50

03~0

0350
0352
0354
0357
0358

PO) NT TO BEG I N I NG OR A BLOCK
WRITE THE CURRENT SIZE
AT THE STARTING ADDRESS

33 02
F7 F3
80 CA 30

52
E2 F6
B9 0005

58
E8 0000 E

47
E2 F9
B9 0006
BE 0000 E
2E:

8A 04

46
E8 0000 E

47
E2 F6

58
3D 0040
75 03
E9 01AO R

PU~H
AX
MOV
BX,10
CONVERT AND SAVE
CX,5
I.,OV
SUB
01,01
DECIMAL LOOP:
-XOR
OX, OX
DIV
BX
OR
DL,30H
PUSH
DX
LOOP
OECIMAL LOOP
DISPLAY LAST 6ii: MEMORY
MOV
CX,5
PRT DEC LOOP:
-POP
AX
PROT_PRT_HEX
CALL
01
INC
PRT DEC LOOP
LOOP
CX,6
MOV
SI,OFFSET F3B
MOV
KB LOOP;
MOV
AL,CS:ISlj
INC
51
CALL
PROCPRT_HEX
INe
01
LOOP
KB_LOOP
eoe
AX
AX, 16*4
eMe
KB LOOP1
JNZ
E20B
JMe
KB LOOPl:

59
58

eoe
eop

E2 03
EB 06 90

JMe

LOOP
KB LOOP2:
PUSH
PUSH

50
51

JMe

E9 0289 R

SET DEC I MAL CONVERT
OF 5 NIBBLES XX,XXx KB
CRT BU FFER POS I T ION
DIVIDE BY 10
MAKE INTO ASC I I
SAVE

RECOVER A NUMBER
PO I NT TO CRT OUfF
PRINT

KB OK'

I NCREMENT BUFF PTR
RECOVER WORK REGS
~ I KS-I
PASS?
GO I F NOT

ex

RECOVER 64K BLOCK COUNT

AX
KG_LOOP2
KB_LOOP3

LOOP TilL ALL MEM.
CONT I NUE

CHECKED

AX

ex

SAVE LOOP COUNT
LOOP TILL ALL MEM CHECKED

£21

KB_LOOP3:

0389

"""''''=====:=====:::-=:=====''''''
; -------. ADDRESS LINE 16-23 TEST

0=============="'========
; ------- CALCULATE NUMBER OF
0389

88 0040

03ac

50

64K BLOCKS

MOV
PUSH

AX,64
AX

START AT SECUO 64K
SAVE START I NG AQOR

AX, RSDA PTR
DS,AX -

GET THE MEMORY SIZE
CET THE TOTAL MEMORY SIZE
KB FLAG USED AS TEMP STORAGE
START AT SECOND 64K BOUNDRY
DIVIDE BY 64K

0380
0390

B8 0018

BE 08

MOV
MOV

0392

88 1E 0017 R

MOV

6X, WORD PTR KB_FLAG

0396
0399
0396
0390

83 EB 40
B1 06

SUB
MOV

SHR

BX,64
CL,06H
BX,CL

f>USH

UX

03 EB
53
;-------

039E
03A1
03A3
03A9

68 0008
BE eo
26: C6 06 0064 00
26: C7 06 0062 0000

03BO
03B2
0364
0366
0368

2A
E6
E6
BO
E6

SAVE LOOP COUNT

INITIALIZE OS DESCRIPTOR
MOV
MOV
MOV
MOV

;------- TEMPORARY SEGMENT SAVE
CO
85

SUB
OUT

86

OUT
MOV
OUT

01
84

IN DMA PAGE REGISTER

AL,AL
DMA_PAGE+4.AL
OMA_PAGE+5,AL
AL,01H
DMA_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:

03BA
03BA
03BC
03B£

BO 33
E6 80
26: 80 06 0064 01

MOV
OUT
ADD

AL,33H
. <><><><><><><><><><><><><><>
MFG_PORT,AL
:<><><>CHECKPOINT 33
BYTE PTR ES:(OS_TEMP.BASCHI_BYTEl.Ol

;------- CHECK END OF FIRST 516K OR 640K (END OF BASE RAM)
03C4
03C6
03C8
03CA
03CC
03CE

MOV
OUT
JMP

BO 83

E6 70
EB
[4
A8
74

00
71
80
OB

IN
TEST

JZ

AL, INFO STATUS
CMOS_PORT, AL
SHORT $+2
AL,CMOS PORT+l
Al, M640K
NEXT_A1

SET 640K BASE RAM BIT
10 DELAY
GET THE CURRENT STATUS
CHECK FOR 6ll0K BASE RAM
GO I r ONLY 512K

;-------- CHECK FOR END OF 512K PLANAR RAM
0300
0306
0308
030B
03E1

26: 80 3E 0064 OA
75 15
EB 09 90
26: 80 3E 0064 08
75 OA

5-56

Test 2

eMP

JNZ
JMP
NEXT Al:CMP
JNZ

BYTE PTR ES: (OS_TEMP. BASCH I_BYTEj ,OAtl
NEXT A
; GO IF STILL BASE RAM
NEXT=A2
;
BYTE PfR ES:(OS_T£MP.BASE_HI_BYTE)~OBH
NEXT_A

;------- DO ADDITIONAL STORAGE ABOVE 1 MEG

03[3

26:

C6 06 0064 10

NEXT _A2: MOV

BYTE PTR ES: (DS_TEMP. BASE_H I_BYTE), 10H

; ------- SET USE TEST

10 CHECK

03E9
03£6

BO flO

MOV

E6 87

OUT

AL, 10 CHK
DMA_PAGE+6,AL

03EO

26:

MOV

AL,BYTE PTR ES:(OS_TEMP.BASE_HI_BYTE)

AO 0064

NEXT_A:

; ------- OMA PAGE REG I STERS 3
;
;

OUT

03fl

(6 84

0:H3
03F9
03F6

26: 80 3E 0064 FE
75 03
EB 79 90

03fE
0401
01103
0405
0407
0409
040B
0400

B8
8E
2B
8B
86
8B
2B
89

040r
0411
0 1113
0 1114
0415
0 1116
0 1\17
0419

2B C9
£2 FE

;------- CHECK FOR TOP OF RAM (FEOQOO)
CMP
JNZ
JMP

SAVE THE HIGH BYTE OF SEGMENT
FOR POS I BLE ERROR

16MEG

BYTE PTR ES:(OS_TEMP.BASE_Hl_BYTE).OFEH
NEXT B
; GO IF NOT
KB_LOOP _3
; GO NEXT TEST

;

TOP OF RAM?

;------- SET OS REGISTER

Ol~ 1B

0410
041E
0111 F
OJ~22

0423
0424
0425

NEXT_B:

MOV
AX, OS TEMP
MOV
OS, AXSUB
01,01
MOV
AX,DS:[OI]
MOY
OX, AX
MOY
SI,DI
SUB
AX,AX
MOY
OS;[DI],AX
;------- ALLOW CRT TIME TO DISPLAY MSG
SUB
CX,CX
Z2:
LOOP
Z2
POP
ex
POP
AX
PUSH
AX
PUSH
CX
eMP
AX,DX
MOV
AX, OX
JNZ
E21A
POP
CX
AX
POP
AOD
AX,64
PUSH
AX
PUSH

0060
08
ff
05
DO
f7
CO
05

59
58

50
51
3B C2
86 C2
75 60

59
58
05 0040

50
51

PO I NT TO START OF BLOCK
GET THE VALUE OF TH I S BLOCK
SAVE
SET 51 FOR POSSIBLE ERROR
CLEAR RAM LOCAT I ON

GET THE LOOP COUNT
RECOYER rESTED r.,EMORY
SAVE TESTED MEMORY
SAVE LOOP COUNT
DOES THE 13LOCK I D MATCH
GET THE BLOCK ID fOR POSSIBLE [RROR
GO PR I NT ERROR
POP ex TO GET AX
RECOVER TESTEO MEMORY
64K INCREMENTS
SAVE TESTED MFMORY
SAVE LOOP COUNT

ex

PUSH
MOV

50
BB OOOA

AX

SET DEC IMAL CONVERT

BX,10

; ------- CONVERT AND SAVE
0428
042B
042D
0420
042F
01~31

B9 0005
2B FF
33 02
F7 F3
80 CA 30

0431.1
0435

52

0437
043A
043A
0438
043£
043f
04 111
0111111
0!147
011117
044A
01148
OIIIjE
04ljf
0451
0452
0 1153
01j54

B9 0005

E2 F6

58
E8 0000

,,7

KB

DIVIDE BY 10
MAKE INTO ASC I I
SAVE

ex,s

E

E2 F9
B9 0006
BE 0000 E
2E:

OF 5 NI BBlES XX,XXX
CRT BUFFER PGSITION

MOY
CX,5
SUB
01,01
DEC LOOP:
XOR
OX, OX
DIV
BX
OR
DL,30H
PUSt!
OX
LOOP
DEC LOOP
; - - - - - - - 0 I SPLAY LAST OK MEMORY
MOV
PRT_DEC:
POP
AX
CALL
PROT_PRT_HEX
INC
DI
PRT_DEC
LOOP
~lOY
eX,6
SI,OfFSET F3B
MOV
KB LOOP 1;
-MOY
AL,CS:(Sll
INC
51
CALL
PROT PRT HEX
DI
INC
KB LOOP 1
LOOP
AXPOP
POP
CX
POP
AX
LOOP
KB_lOOP _2

8A 04

46
E8 0000 E

47
E2 F6

58
59
58
E2 1B

RECOVER A NUMBER
POINT TO CRT BUFF
PRINT'

KB

OK'

I NCR(MENT BU F F PTR
RECOVER WORK REGS
RECOVER 64K BLOCK COUNT
LOOP

T ILL ALL MEM. CHECKED

; -------- CHECK PAR I TY
0456
0458
01j5A
01j5C
045F
0460
0462
01l61j
0466
0468
01j6A
01j6C

E6
86
E6
E4
24
86
E4
22
E4
86
l4
75

046E
01171
0 1171
01172

EB 06 90

0473

OUT
XCHG
OUT
IN
ANa
XCHG
IN
AND
IN
XCHG
IN
JNZ

89
CIj
8A
61
CO
C4
87
EO
8A
C4
8':1
Of

50
51

JMP
KB_LOOP_2:
PUSH
PUSH
JMP

E9 03BA R

SAVE AX

DMA_PAGE+8, AL
AL,AH
DMA_PAGE+9,AL
AL, PORT B
AL, PARITY ERR
AL, AH
AL,DMA_PAGE+6
AH, AL
AL,OMA_PAGE+9
AL,AH
Al,DMA PAGE+8
E21A-

CHECK FOR 10 OR PAR CHECK
STRI P UNWANTED BITS
SAVE ERROR
CHECK FOR RjW OR 10 ERR
RESTORE AX
GO

AX
ex
£21

I F PAR J TY ERROR

CONT I NUE

KB_LOOP_3

SAVE LOOP COUNT
CONTINUE TilL DONE

A

; ------- BACK TO REAL MODE
KB_LOOP_3:

01176
0476
0478

BO 31l
E6 80

MOV
OUT

AL,34H
MFG_PORT ,AL

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 34 <><><><>

041A

[9 0000 E

JMP

PROG_SHUTDOWN

;
;

BACK TO REAL MODE
NEXT TEST VIA JUMP TABLE (SHUT2)

PRINT FAILING ADDRESS AND XOR'ED PATTERN

IF OATA COMPARE ERROR

USE OMA PAGE REGISTERS AS TEMPORY SAVE AREA FOR ERROR
SET SHUTDOWN 3
0470
047F
0481
0483
0485
0487
0489
048B
0480

E6
8A
EB
E6
8B
E6
86
EB
E6

82
C4
00
83
C6
86
EO
00
85

E21A:

OUT
MOV
JMP
OUT
MOV
OUT
XCHG
JMP
OUT

OMA PAGE+l,AL
Al,AH
SHORT $+2
DMA_PAGE+2,AL
AX,SI
DMA_PAGE+5,AL
AH,AL
SHORT $+2
DMA_PAGE+4, AL

SAVE FAILING BIT PATTERN (LOW BYTE)
SAVE HIGH BYTE

10 DELAY
GET THE FAI:"ING OFFSET

I 0 DELAY

Test 2 5-57

; ------- CLEAR lOCH CHK OR R!W PAR CHK
048F
0491
0492
0494
0496
0/~98

049A

SUB

2B r6
E4
DC
EB
E6
24

SI,SI

WRITE TO FAILING BLOCK

STOSW

AB

IN

61
DC
00
61
F3

01~9C

EIJ 00

049E

E6 61

OR
JMP
OUT

AND
JMP
OUT

AL, PORT_B
AL, RAM PAR OFF
SHORT S+2 PORT B,AL
AL. RAM PAR ON
SHORT S+2 PORT_B.AL

TOGGLE IOjPAR CHECK ENABLE
10 DELAY
10 DELAY

;-------; ~~~=~~~~~~=~7~~
a/lAO
04A3

:-"'''''''===;========
AX, RSQA_PTR
OS,AX

SET THE DATA SEGMENT
I N PROTECTED MODE

MOV

B8 0018
8E 08

MOY

;------- GET THE DIAG_STATUS FROM CMOS
04A5
04A7
04A9
04AS
04AD

BO
E6
EB
E4
8A

8E
70
00
71
08

MOV
OUT
JMP

04Ar
04a1
04B3
0485
04B7

BO
E6
EB
E4
8A

B3
70

00

MOV
OUl
JMP

71
F8

MOV

04B9
04BA
04B8

59
58

IN
MOV

IN

AL,DIAG STATUS
CMOS_PORT, Al
SHORT $+2
AL,CMOS_PORT+l
BL,AL

SAVE THE STATUS BYTE

AL, INfO_STATUS
CMOS_PORT ,AL
SHORT $+2
AL.CMOS_PORT+l
BH,AL

SAVE THE STATUS BYTE

10 DELAY

10 DELAY

; ------- GET THE LAST OF GOOD MEMORY
PDP
POP
MOV

88 C8

ex
AX

GET THE LAST OF GOOD MEMORY

CX,AX

SAVE

IT

;------- BELOW S12K?
0480
04CO

3D 0200

eMP

AX,S12

72 39

JB

M3

04C2
04C5

3D 0280
7211

LAST GOOD MEMORY BELOW 512K?
GO If YES

; ----~-- BELOW 640K?
eMP

AX, 640

JB

M1

LAST GOOD MEMDRY BELOW 61.j.0K?
GO I F YES

; ------- 640K UP ERROR
C7 80
06
0200
or 90
0260
09 90

04C7
04CA
04CC
OIICF
0402
0405

F6
75
20
EB
20
E8

0408

F6 C7 80
75 1E
20 0200

M1:

04EO
04£2
04E4
04E6
04£8
04EA
a4EC
04EE
04FO
OllF2
04F4
04F6
04FB

88
BO
E6
8A
[B

M2:

04fB

A3 0013 R

MO;

TEST
JNZ
SUB
JMP
SUB
JMP

I S BASE RAM 640K

BH,M640K
MO
AX,512
M2
AX,640
M2

512K BASE RA!-'I
640K BASE RAM

; ------- 512K TD 640K ERROR
01~08

0400

C8
81
70
C5
00
[6 71

TEST
BH,M640K
JNZ
M3
SUB
AX,512
;------- WRITE SIZE TO CMOS

our

MOV
JMP
OUT
MOV
JMP
OUT
JMP

BO BO
EB
E6
8A
EB
E6
EB

MOV
MOV
OUT
MOV
JM'

00
70
Cl
00
71
04 90
;

~--~---

M3:

I S BASE RAM 640K?
GO I F YES
STR I P BASE RAM FROM 10 RAM

CX,AX
AL,M_SIZE_HI
CMOS_PORT, AL
AL,CH
SHORT $+2
CMOS_PORT+1,AL
AL.M SIZE LO
SHORT $+2CMOS PORT, AL
AL,C[
SHORT $+2
CMOS_PORT+1,AL

SAVE ADJUSTED MEMORY SIZE
GET THE HIGH BYTE MEMORY SIZE
10 DELAY
WRITE IT

UO THE lOW BYTE
GET THE LOW BYTE

10 DELAY
WRIlE IT
CONT I NUE

M4

SET BASE MEMORY SIZE
TO INDICATE HOW MUCH MEM WORKING

MOV

; ------- SET SHUTDOWN 3
04FE
0500
0502
0504
0506

BO
E6
60
EB
E6

8F
70
03
00
71

0508

E9 0000 E

MOV
OUT
MOV
JMP
OUT

AOOR FOR SHUTDOWN RETURN

AL , SHUT_DOWN
CMOS PORT, Al
AL.3SHORT $+2
CMOS_PORT+l,AL

SET RETURN 3
10 DELAY

; ------- SHUTDOWN
JMP
PROC_SHUTDOWN
PACE
; ------- ENTRY 3 FROM PROCESSOR SHUTDOWN
MEMORY mROR REPORT I NG
DESCRIPTION FOR ERRORS 201(CMP ERROR or PARITY)
or 202(ADDRESS LINE 0-15 ERROR)
RjW MEMORY ERRORS WILL BE R[PORH.D AS taLLOWS
MBBCC DDEE 201(or 202)
AA=HIGH BYTE OF 24 BIT ADDRESS
BB=MIDDLE BYTE OF 24 BIT ADDRESS
CC=LOW BYTE OF 24 B IT ADDRESS
DD=HIGH BYTE OF XOR FAILING BIT PATTERN
[["'LOW BYTE OF XOR FAILING BIT PATTERN
DESCR I PT I ON fOR ERROR 202 (ADDRESS
A WORD Of rFrr IS WR I TTEN AT
OF EACH 64K BLOCK WITH ZEROS
BLOCK.
A SCAN OF THE BLOCK
0-15 ARE FUNCTIONING.

LINE 00- 1 5)
THE FIRST WORD AND LAST WORD
AT ALL OTHER LOCATIONS OF THE
I S MADE TO I NSURE ADDRESS LI NE

DESCRI PTION FOR ERROR 203 (ADDRESS LINE 16-23)
AT THE LAST PASS Of THE STORAGE TEST, FOR EACH BLOCK OF
64K, THE CURRENT STORAGE SIZE (ID) IS WRITTEN AT THE FIRST
WORD Of EACH BLOCK.
IT IS USED TO DETERMINE ADDRESSING
FAILURES.
AABBCC DOEE 203

SAME AS ABOVE EXCEPT fOR DOEE

5-58

Test 2

GENERAL DESCR I PT I ON FOR BLOCK I D (DDEE WILL NOW cornA I NT THE 10)
DD=H I GH BYTE Of BLOCK I D
EE=LOW BYTE OF BLOCK I D
BLOCK
0000
0040

ADDRESS RANGF
000000 --> OOFFFF
010000 --> 01 FFFF

10

II

090000 --> 09FFFF 1512->576K) IF 640K BASE
100000 --> lQFFFF (1024->10881<) IF 512K BASE

0200

EXAMPLE 1640K BASE RAM + 5121< 10 RAM = 1152K TOTAL}
NOTE: THE CORRECT BLOCK 10 FOR THIS FAILURE IS 0280 HEX.
DUE TO AN ADDRESS FAILUE THE BLOCK ID+128K OVERLAYED THE CORRECT BLOCK 10.
006401< OK
<-- LAST OK MEMORY
10000 0300 202
<-- ERROR DUE TO ADDRESS FAI LURE
DMA PAGE REG I SHRS ARE USED AS TEMPORARY SAVE AREAS FOR SEGMENT

;
050R
050E

""

---- R

OESCR! PTER VALUES.
------------- - -------------- ----------------------------- ----------

SHUT3;

MOV
MOV

BE 08
; -------

SET REAL MODE DATA SEGMENT

AX,DATA
OS,AX

I NIT AND SET MFG ERROR
CLEAR FLAG

0510

C6 06 0016 R 00

MOV

MFG~ERR_FLAG+l,

0515

80 DE 0016 R 01

OR

MFG_ERR_FLAG+1 ,MEM_FAI L ; <><><><> <><><><><><><><><><><>
; <><> MEMORY FA I LEO<><><><><><>

051A
051C
05H
0521
0524
0526

BO 00
0000 E

MOV
GAll
MOV
CALL

AL,13
PRT HEX
AL, To
PRT HEX
AL,DMA_PAGE+3
XPC_BYTE

CARRAGE RETURN

E8
BO
E8
E4
E8

AL, DMA_PAGE +4
XPG BYTE
AL, DMA_PAGE +5
XPC BYTE
Al T ,
PRT HEX
Al,DMA_PAGE+2
XPC_BYTE
AL, DMA_PAGE +1
XPC_BYTE

G[T THE MIDDLE BYTE OF 2/1

0529
052B
052E
0530
0533
0535
0538
053A
0530
053F

E4
E8
E4
E8

BO
£8
E4
E8
E4
E8

OA
0000 E
84
0000 E
85
0000
86
0000
20
0000
83
0000
82
0000

IN
CALL
IN
CALL
IN
CALL
MOV
CALL

E
E
E

IN
CALL
IN
GALL

E

E

0

GET THE H! GH BYTE OF 24 BIT ADDRESS
CONVERT AND PR I NT CODE
CHECKPO I NT OD->FE
BIT ADDRESS
GET THE LOW' BYTE OF 24 BIT ADDRESS
SPACE TO MESSAGE
GET HIGH BYTE FAILING BIT PATTERN
CONVERT AND PR I NT CODE
GET LOW BYTE FAI LI NG BIT PATTERN
CONVERT AND PR I NT CODE

; -------- CHECK FOR ADDRESS ERROR
0542
0544
0546
0549
0546

054E
0550
0552
0555

E4
3C
BE
74
BE
3C
74
BE
E8

IN

80
33
0000
OA
0000
32
03
0000
0000

CMP

MOV
JZ
MOV

E
E

CMP

E
[

ERR2:

JZ
MOV
CALL

AL, MFG_PORT
AL,33H
SI,OFFSET AOERR
ERR2
SI,OFFSET ADERR1
AL,32H
ERR2
SI,OFFSET E1
E_MSG

GET THE CHECKPOINT
IS IT AN ADDRESS FA!LURE?
PRELOAO ADDRESS ERROR 16->23
GO I F YES
PRELOAD ADDRESS ERROR 00->15
GO If YES
SETUP ADDRESS OF ERROR MSG
PR I NT ERROR MSG

; ------- ENTRY FROM SHUTDOWN
SHUT2:

0558

TEST.20
ADD I T I ONAL PROTECTED (V I RTUAL MODE) TEST
OESCR I PT I ON
THE PROCESSOR I S PUT I N PROTECTED MODE AND
THE FOLLOW I NG FUNCT IONS ARE VER I F I ED
1. VERI FY PROTECTED MODE
THE MACH I NE STATUS I S CHECK FOR V I RTUAL MODE
PROGRAMMED I NTERRU PT TEST
AN PROGRAMMED INTERRUPT 32 IS ISSUED AND
AND VER I F I [0
3. EXCEPTION INT 13 TEST
A DESCR I PTOR SEGMENT LIM I TIS SET TO ZERO
AND A WRITE TO THAT SEGMENT IS ATTEMPTED
AN EXCEPT!ON 13 IS EXPECTED AND VERIFIED
4. LOT/SOT LTR/STR TEST
LOAD LOT REGISTER AND VERI FY CORRECT
LOAD TASK REG I SHR AND VER I FY CORRECT
THEY ARE VERIFIED VIA THE STORE INSTRUCTION
S. THE CONTROL FLAGS Of THE 286 FOR DIRECTION
ARE VERIFIED VIA THE STD AND CLO COMMANDS
I N PRO I ECTED MODE
6. BOUND ! NSTRUCT ION TEST ([XC I NT 5)
CREATE A SIGNED ARRAY INDEX W!TH!N AND
OUTSIDE THE LIMITS.
CHECK THAT NO EXC INT
I F WITHIN LIMIT AND THAT AN EXC INT 5
OCCURS IF OUTSIDE THE LIMITS.
7. PUSH ALL POP ALL TEST
SET ALL GENERAL PURPOSE REGS TO O! FFERENT
VALUES ! SSUE A PUSH ALL, CLEAR THE REGS
I SSUE A POP ALL AND VER I FY CORRECT.
8. CHECK THE VERRjVERW INSTRUCTIONS
THE ACCESS BYTE IS SET TO READ ONLY THEN TO
A WR! TE ONLY AND THE VERR/VERW I NST ARE
VERLFIED.
9. CAUSE AN INTERRUPT 13 VIA A WRITE TO A
READ ONLY SEGMENT
10. VER I FY THE ARPL 1NSTRUCT I ON FUNGT LONS
SET THE RPL f I ELO OF A SELECTOR AND
VERIFY THAT CURRENT SELECTOR RPL IS SET
CORRECTLY.
11. VER I FY THE LAR I NSTRUCT I ON FUNCT IONS
12. VER I FY THE LSL I NSTRUCT I 0111 fUNCT! ONS
13. LOW MEG CH I P SELECT TEST
2.

0558

JMP

E9 0000 [

POST7

GO TEST THE 286 PROTECTED MODE

;-------- FAILURE ENTRY fROM A SHUTDOWN
055B
055E
0560
0562
0565
0567

E8
E4
3C
BE
74
BE

0000 E
80
35
0000 E
OE
0000 E

056A

80 DE 0016 R 02

SHun:

CALL
IN

SHUT7A:

DDS

ESTABL! SH THE DATA SEGMENT
CHECK FOR CH I P SELECT ERROR

MOV
JZ
MOV

AL, MFG PORT
Al,35HSI,OFFSET CM4_D
SHUT7B
SI ,OFFSET VIR_ERR

OR

MfG_ERR_FLAG+1 , PRO_fA I L ; <><><><><><><><><><><><><><><>

eMP

PR I NT ERROR 109
GO IF NOT
PROTECTED MODE fA I LED

Test 2 5-59

;<><> VIRTUAL MODE FA!LED<><><>
056F
0512
0575

[8 0000 E
EB 09 90
E8 0000 E

0578

80 DE 0016 R 04

0570
0')80
0582

E8
28
A3
89

SHuns:

0585
0588
058B

0:"88
0580
O'-,flF

2A CO
E[
II?

058F

E2 F/\

SHur6:

BO 35

0595
059A
059C
059F
05A4
05A6
05A9
05AB
05AD
05AE
0581\
05136
058B
05130
05HF
05C2
05C4

F6 06 0012 R 20
75 03
E9 0651 R
80 3E 0072 R 64
75 03
£9 0651 R
BO 36
E6 80

MfG_ERR_FLAG+ 1, LMCS_fA I l_,; <><><><><><><><><><><><><><><>
; <><> LOW MEG CH I P SELECT
<><>

05C.,

05C9
OSCB
05CD
05CF
0502
0504
0506
0509
05DC
OSDE
05EO
05£2
05E7
05EA
O~ED

05FO
05F2
D5F4
05F6
05F9

CALL

C~1P

F7_B:

MOV

JNZ
JMP
OUT
eMP

MOV

CALL
MOV

LOOP1:

CALL
JNZ

CF

GlO:

DEC

BH

LOOP1
o I SABLE KEYBOARD
AL, D I S_KBO
C8042
FLUSH
AL, PORT A
AL, KYBo-CLK DATA
GET THE CLOCK AND DATA lINLS
C8042
'riAl T FOR OUTPUT BUFFER FULL
OBF 112
GET THE RESULTS
AL, PORT A
AL, KYBD-ClK
KEYBOARD CLOCK MUST BE LOW
G11
MFG_ERR_FLAG+l ,KYCLK_FA I L; <><><><><><><><::'<><><><><><>
; <><> KEYBOAKD CLOCK III GH<><><>
; [) I SPLAY 304 ERR.OR
SI,OFFSET Fl_B
; REPORT ERROR
f6D
; I SSU[ RESET TO KEYBRD
KBD RESET
F6 ; PRINT ERR MSG IF NO INTERRUPT
; <><><><><><><><><><><><><><>
AL,37H
; <><><>CHECKPO I NT 37 <><><><>
MFG_PORT,AL
; SCAN CODE AS EXPECTED?
BL,OAAH
;
NO - D! SPLAY ERROR MSG
F6

CALL
CALL
IN
TEST
JZ
OR

01
DB
DE 0016 R 08

Gll:

28

80 37
£6 80

80 rI3 AA
75

; SOfT RESET?
RESET_FLAG,1234H
G10
BYTE PTR RESET FLAG,OAAH ; CHECK FOR AA ALREADY REC I EYED
Gl0
~
GOIFYES
AL, ENA KBO
C80!~2 I:.NABLE KEYBOARD
TRY l~ TIMES
BH,4
CHECK FOR OUTPUT BUFfER FlJLL
OBF 42
G10~
GO I F BUFFER FULL

JNZ
MOV
CALL
IN
MOV

60

; <><><><><><><><><><><><><><>
; <><><>CHECKPOI NT 35 <><><><>

; MANUFACTURING BURN IN TEST MODE?
MFG TST, LOOP POST
F7_A
F7
; YES - SK I P KEYBOAHD TEST
BYTE PTR RESET_FLAG,064H ; MANUFACUTRING RUN IN MODE?
1'7 B
F7; YES - SK I P KEYBOARD TEST
; <><><><><><><><><><><><><><>
AL,36H
; <><><>CHECKPO! NT 36 <><><><>
MFG_PORl, AL

JMP

OL~

0000 [
62 90
0000 E

PAGE REGS

TEST
JNZ

Fl_A:

JZ
eMP
JZ

BE
EB
E8
£3

CLEAR

AL,35H
MFG_PORT, AL

74
80
7 1i
BO
£8
B7
£8
75
FE
75
80

F7

PROl [CTEO MODI:: TEST PASS[Q
CLEAR KEYBOARD STATE FLAGS

WORD PTR K8 fLAG, AX
CX,OtH
DX,OMA_PAGE+l

MOV
OUT

eLi

AD
0000 £
60
EO
0000 E
0000 E

TEST PASSED ENTRY FROM A SHUTDOWN

TEST.21
KEYBOARD TEST
oESCRI PllON
RESET THE KEYBOARD AND CHECK THAT SCAN
CODE -M' IS RETURNED TO THE CPU.
CHECK FOR STUCK KEYS.

FA
81 3[ 0072 R 1234

[8
£4
BO
E8
£8
Eli
A8
74
80

r~ODE

DDS
AX,AX

CLR LOOP:
SUB
OUT
INC:
LOOP

£6 80

17
3E 0072 R AA
10
AE
0000 E
04
0000 E

PRINT MSG

OR

SUB
MOV
MOV
MOV

;
;

0591
0593

PRINT MSG

;

E ~~SG
SHUTG
E,_MSG

;-------- PROTECTED
0000 E
CO
00 I 7 R
OOOE
SA 0082

;

CALL
.JMP
CALL

1F

CHECK FOR STUCK KEYS
05FB
05FD

BO 38
E6 80

MOV
OUT

OSFF
0601
0604
0606
0608
060A

MOV

a60c

BO
E8
2B
E2
Ell
A8
74

OGOE
0610

AE
0000 E
C9
FE

AL, ENA_ KBD
C8042

ex,cx

ASSURE KYBOARO ENABLED
ISSUE THE COMMAND

SUB

I_OOP

F5

IN

AL, STATUS_ PORT
AL,OUT_BUF_FULL

DELAY FOR A \-!H I LE
CHECK FOR STUCK KEYS
OUT BUFfCR FULL?
CONT I NUE TEST I NG
YES

CALL

f5:

611
01
43

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 3B <><><><>

AL,3811
Mfe _PORT, AL

TEST

-

JE

F7

BO 3')
E6 80

MOV
OUT

AL,39H
MFG _POfn,AL

; <><><><><><><><><><><><><><>
; <><><>OiECKPO I NT 39 <><><><>

0612
0614
0617

E4 60
E8 0000 E
EB 20 90

IN
CALL

AL, PORT_A
XPC_ BYTE
F6e

;
;

a61A
061 B
0610

FA
BO A8
E6 64

061F
0621

28 C9

JMP

; _______

0623
0625
0627
0629
0628
062D
062F
0632
0635
0637
0639
063B

B7 U5
E4 64
A8 01
E1

FA

75
FE
75
BE
EB

OA
CF
F4
0000 E
1A 90

Ell 60

F6:

OUT
SUB
MOV

F6A:

BE 0000 E
EB 09 90
BE 0000 E

0649

80 OE 0016 R 20

064E

E8 0000 E

IN
TEST
LOOPZ
IN.l
DEC

JNZ
MDV
JMP

f6B:

fO OFTFRMINE

IF 8042

IS WORKiNG

IN
eMP

JZ
DR
MOV

JI1P
F6C:

MOV

F6D:

CALL

OR

AL, I NTR FACE CK
STATUS_PORT ,AL

COMMAND TO 8042

BH,O~

WAIT FOR OUTPUT BUFFER FULL

AL, STATUS PORT
AL, OUT BUF FULL
F5A
-

8042 FIN! SHED TEST?

ex,cx

F6B
BH

GO CHECK RESULTS

F6A
SI,OFFSET Fl __ A
F6D
AL, PORT __ A
AL.O

TRY AGAIN
I NO I CATE rLANAr- FA I LUr-E
(HlMOVE KEYBOARD TRY AGAIN)
GET THE RESULTS OF I NTERFAC[ TEST
I S THE I NTfRFACF OK?

~~g_ERR_FLAG+1 , KY_SYS_F A~ L; <><><><><><><><><><><><><><>
SI,OFFSET F1_A
F6D
SI,orf--SET Fl

; <><> KEYBOAROjSYSTEM<><><><><>
; PLANAR FAI LURE
; GO I F YES
; Gl I MSG ADDR

MrC_ERR_FLAC+1, KYBD_FAI L; <><><><><><><><><><><><><><><>
; <><> KEYBOARD FA I LED<><><><><>
;

INITIALIZE 80112 TO HONOR KEY LOCK

5-60 Test 2

INTERFACE

Cl.I
~~ov

3C 00
74 DB
80 DE 0016 R 10

0640
0643
061,6

KEYROARO ERROR TRY

GET THE SCAN CODE
CONVERT AND PRI NT
CONT I NUE

PR I NT MSG ON SCREEN

0651
06::'3

uo

065'.1
0657
0659

eo

065A
06~c

065f
0661

3A
l6 80

F"!;

r'10V
OUl
MOV
OUT
eLi
MOV
CALL
MOV
OUl

ff

E6 21
FA
BO 60
fR 0000 E
t30 45

E6 60

; <><><><><><><><><><><><><><>
; <><><>CIiECKPO I NT 3A <><><><>

AL,3 AH
MFG _POIn, AL

AL,orfH
INfA01,AL

DISABLE

IN1ERRUPTS

AL,60H
C8U'I2
AL,4';,H
PORl _A,AL

WR I TE 8042 RAM COMMAND
I SSUE THE COMr-1AND
SET SYS I [M FLAG - OUl13U f I NT ~
SYSH.M fLAG - PC 1 CDMf'ATABILITY
RI::SET INHIBIT OVER RIDE

;------- OECATE ADDRess LINE 20
0663
0665

0'.
E8

MOY
CALL

00
0000 E

0668
D66A
D66e
066F
0670
0611
0674
0677
0678
0679
067A

2B CO
81 cu
89 0008

061C

28 CU
8E CO
89 OU08
DE
1F
8F 0000 E
SF 01CO R
A5
47
117
E2 FO

SlJH

MOV
1-10V
PUSH
POP
1-10V

DE.
1C
BE 0000 E
BF 0020 R
A5
47

F7A;

1~7

E2 FB

067l

0685
0688

068B
D6SC
0680
068E

F7Al :

Mav

51 ,OFfsn VECTOR_TABLE
UI,OI-)-::;[T INT_PTR

MOVSW
INC
INC
LOOP

01
01
F7A

SUB
MOY
MOV
PUSH
POP
MOV
MOV
1-10VSW
INC
INC
LOOP

0694
069A
06AO

06A6
06A9
06AC
06BO
0683

l3F 0180
B9 DOOE
C7 05 0000
83 C7 02
E2 F7

0685
UGBA
OGSC
OGC2
DGCII
06C6

F6 06 0412 R 20
75 UA
C7 06 0020 R 0000 E
BO FE
[6 21

06C7

E8 0000 E

0692

ASSUME
SUB
MOV
MOV
MOY
MOV

CO
08
06 0008 H 0000 E
06 (H)14 R 0000 E
06 DOG? R F600

Gl.T VECTOR CNT
SETUP OS SEC RlG

os

;

SI< I P OVER SEGMENT

INT VECTOR TABLE LVL 8-15

(VECTORS START AT

INT 50H)

AX,AX
[S,AX
eX,08
; GET VECTOR erf;CS
SETU P US StG REG
OS
S i, OFFSET SLAVE:. VECTOR TABLE
a I , OFf- SET SLAVE:::: I NT._ PTR
DI
01
F7Al

;----- SET UP OlHCH
2B
BF
C7
[7
C7

0690

INT VECTOR TABLE LVL 0-7

AX,AX
ES,AX
CX, DB
CS

;------- SETUP HARDWARE

0680
U683
0684

S[T COMI1ANO I N AI-!
ISSUE THE COMI-1AND

All, 0 I SI\13LE_B I T20
CATE_A20

-- SETUP HARD\-.IARE

;

5K I r

OVER SEGMENT

INTERRUPTS AS NECESSARY

DS;ABSO
AX, AX
[)S,AX
NMI_PTR,OFFsn NMI_INT
I NT5_PTR, OFFSFT PR I NT_SCREEN
BAS j C_Pl R+2, 0 F600H

OS""O
NM I INTERRUPT
PR I NT SCREEN
SEGMENT FOR CASSEn!:. BAS I C

; -------- ZE:.RO HESERVEO VECTORS

f7A2;

MOV
MOV
MOV
ADD
LOOP

01,60H*4
eX,14
WORD PTR OS; [ 0 I
a 1,2
F7A2

; _____ SETUP TIMFR 0 TO BLINK LED
T[ST
JNZ

;
06CA
0600
06[);'>
0605
0608
060A
060B
0600
06DF

3E 0072 R 123 11
DE
UOFF
BA 03FG
BU 04
EE
E2 FE
2A CU

ASSUME
CALL

OS; DATA
DDS

I SSUE A RESET TO THE HARD FILE

81

cr~p

75
0,

JNZ
MOV
r~OV

FE

IF MANUFACTURING TEST MODE

OUT
SFI

---~----

F9_A;

POINT TO NEXT LOCATION

OATA_AREA[MFG_TST-OATA_base],LOOP_POST; MFG. TEST MODE?
F9
INT_ADDR,OFFSn BLlNK_INr
SETUP TIMER INTR TO BLINK LED
AL,OFEH
ENABLE TIMER INTERRUPT
INTA01,AL
ALLOW INTERRUPTS

MOV
MOV

F9:

FO

INT 60 THRU 67 FILL WI-IH ZERO
CLEAR 14 WORDS

J, 0

MOV
OUT
LOOP
SU[3
OUT

RESET fLAG,1234H
F9A CX,OFFH
OX,03f6H
AL,04H
DX,AL
F9 A
AL-;-AL
DX,AL

ESTABLISH DATA SEGMENT
THE OPERAT I NG SYSTEM
I F SOFT RESET
SOFT R[SET?
CONT I NUE I F NOT
RESET
HOLD RESET
RE~lOV[

RESET

fEST.23
DISKETTE ATTACHHENT T[ST
OEcSCHI rTION
CHlCK IF IPL DISKETTE DRIVE IS ATTACHED TO SYSTEM.
IF
ATTACIIED, VERIFY STATUS OF NEC FOC AFTER A RESET. ISSUE
A REGAL AND SEEK CMD TO FDC AND CHECK STATUS. CO~1PL[TE
SYSTEM INITIAliZATION THEN PASS CONTROL TO THE BOOT
LOADER PROGRAM.

06EO
06E2
06[4
OGE6
06E9
06EA
06EF
06Fl
06F6
06F8
06F8
06FA
OGFe
06FE
0700
0"102
U704
u706
0709

00 3e
E6 80

F9A;

BO 02
BA
EE
F6
74
F6
74

03F7
06 0010 R 01
4F
06 0012 R 20
48

AL,3CH
MFG_PORT, AL

MOV
MOV
OUl
TEST
JZ
TES1
JZ

AL,02H
; SET DATA RATE TO 250 K BITS /
OX,3F7H
DX,AL
;
BYTE PTR EQUIP_FLAG,OlH
; DISKETTE PRESENT?
F15
MFG_TST, LOOP_POST
MFG .JUMPER INSTALLED?
co I F YES
F15
DISK_TEST:
AL,INTAOl
10 DELAY
SHORT $+2
ENABLE 0 I SK[TTE INTERRUPTS
AL,OBFH
INTA01,AL
RESET ",e FOG
AH,O
OL,AH
SET FOR DR IVE 0
VER I FY STATUS AFTER RESET
13H
STATUS OK?
AH,OFFH
NO - Foe FA I LED
F13

FlO;
IN
JMP
AND
OUT
110V
MOV
I NT
TEST
JNZ

E4 21
EB 00

24 BF
E6
B4
8A
CO
F6
75

21
DO
04

BA
BO
EE
2B
B2

03F2
le

"

C4 FF
24

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 3C <><><><>

MOV
OUT

SEC

TURN DRIVE 0 MOTOR ON
070B
070E
0710
0711
0713
0715

MOV
MOV
OUT
SUB
MOV

C9
OC
Fl1;

OX,03F2H
AI.,lCH
OX,AL
CX,CX
aL,12

eET ADDR OF roc CARD
TURN MOTOR ON, EN OMA/I NT
WRITE FOC CONTROL REG

,

WAIT
SECOND
MOTOR_WA IT:

Test 2

5-61

LOOP

'"

WA I T FOR 1 SECOND
DECREMENT DUTTER LOOP

OX,DX
CH,1
srEK STATUS,DL
SEEKF13
CH,34
SEEK

SELECT DR! VE 0
SELECT TRACK 1

0715
0717
0719

£2 FE
FE CA
75 FA

JNZ

071B
0710
071F
0723
0726
0728
072A
0720
072F

33
65
88
E8
72

D2

XOR

JNe

Fl4

072f

80 DE 0016 R 40

OR

0734
0737

BE 0000 E
£8 0000 £

MOV
CALL

MFG_EHR_flAG+l ,DSK_FA I L ; <><><><><><><><><><><><><><><>
; <><> 0 I SKETTE FA I LEO<><><><><>
SI,OFFSET f3
GET AODR OF MSG
E_MSG
GO PR I NT ERROR MSG

073A
073A
073C
073F

80 OC
BA 03F2

0740
0745
0748
074C
0750
0754
0757

CG 06 0066
B£ DOlE R
89 36 OOlA
89 36 00lC
89 36 0080
83 C6 20
89 36 0082

DEC

MOY
NOV
CALL

01
16 003E R
0000 E
07
85 22
E8 0000 E
73 DB

Je
MDY
CALL

Ol
Fll

F13 :

RECAll BRA TE D j SKETTE
GO TO ERR SUBROUT I NE I F ERR
SELECT TRACK 34
SEEK TO TRACK 34
OK, TURN MOTOR OFf
DSK_ERR:

;----- TURN DRIVE 0 MOTOR OFF
f14:
MOY
MOY
OUT

EE

AL, OCH
DX,03f2H
DX,Al

ORO OFF:
TURN DR I VE 0 MOTOR OFF
fOC CTl ADDRESS

; ------ SETUP KEYBOARD PARAMETERS
R 00

MOY
MOV
MOY
MOY
I'IOV
ADO
MOY

f15:

R

R
R
R

I NTR_FLAG, DOH
51 ,OFFSET KB SUFFER
BUFFER_HEAD, SI
BUFFER_TAil,S!
BUFFER_START, SI
51,32
BUFfER_END,SI

SET STRAY INTERRUPT FLAG = 00
SETUP KEYBOARD PARAMETERS

; DEfAULT BuFFER OF 32 BYTES

;-------- SET PRINTER TIMEOUT DEFAULT
MOV
PUSH
POP
MOV
STOSW
STOSW

SF 0078 R
1E
07

0758
075E
075F
0760
0763
0764

B8 1414
AB
AB

0765
0768
0769

88 0101
AB
AB

076A
076C
076E
0770

£4
24
EB
E6

0772
0777
0779
077C

F6
75
£9
80

OI,OFFSET PRINT_TiM_OUT ;SET DEFAULT PRINTER TIMEOUT
OS
ES
AX,1414H
; O[fAULT=20

; -------- SET 4S232 DEFAULT
MOV
STOSW
STOSW

AX,D1D1H

; RS232 DEFAULT=01

; -------- ENABLE T I MER INTERRUPTS
IN
AND
JMP
OUT

21
FE
00
21

AL, I NTA01
AL,OFEH
SHORT $+2
INTA01,AL

ENABLE T I MER AND KB
10 DELAY

I NTS

;------- CHECK CMOS BATTERY/CHECKSUM

077£
0780
0782
078'1
0786
0788
078A
0780
07aF
0792
0795
0795
0798
079B

06 0012 R 20
03
0858 R
8E
E6 70
EB 00
E4 -11

JMP
MOV
OUT
JMP
IN
AND
.)Z
TEST
May

MFG_ TST , lOOP_POST
B1_0K
f15C
AL,OIAG_STATUS
CMOS PORT, Al
SHORT $+2
Al, CMOS_PORT+1
AL,OEQH
e OK
AL,80H
SI,OFFSET CMl

TEST

JNZ
81_0K:

2'1 EO
74 16
A8 80
BE 0000 10
74 06
[8 0000 E
lOB 62 90
BE 0000 10
[8 0000 £
EB 59 90

B_OK:

83 03

C OK:

MFC JUMPER?
GO I F NOT
BYPASS I f YES

10 DELAY

JZ

B2 OK

CALL
JMP

E MSG
H=:Ol1OY
OUT
XCHC
JMP
IN

OR
XCHG
OUT
XCHG
JMP
OUT
JMP

AL,D!AG_STATUS
CMOS_PORT, AL
AL,AH
SHORT $+2
AL,CMOS_PORT+l
Al,CMOS_CLK_FAI L
AL,AH
CMOS PORT, AL
AL,AH
SHORT $+2
CMOS_PORT+l,AL
H_OK

SET CLOCK ERROR
SAVE STATUS ADDRESS
10 DELAY
GET THE CURRENT STATUS
SET NEW STATUS
GET STATUS ADDR AND SAVE NEW STATUS
fO DELAY

CONT I NU£

---- CHECK CLOCK UDATE
0703
0706
0708
070A
070C
070E
07£0
07[2

A8 80
EO F4
E3 DO

MDV
MDY
OUT
JMP
IN
TEST
lOOPNZ
JCXZ

CX,600
AL,CLK_UP
CMOS_PORT,AL
SHORT $+2
AL,CMOS_PORT+l
AL,80H
I_OK
F_OK

LOOP COUNT
CHECK FOR appesl TE STATE
10 DELAY
TRY AGAIN
PR I NT ERROR

1FT I MEOUT

;-------- CHECK MEMORY SIZE DETERMINED == CONFIG
07£4
07E4
07E6

!.jOY
OUT

80 8E
E6 70

5-62

Test 2

AL, 0 lAG_STATUS
CMOS_PORT ,AL

GET THE STATUS BYTE

07[8
OlEA
Q7EC
07EE

EB
E4
A8
74

07FO
07F3

BE 0000 E
E8 0000 E

01F6
07FB
07FE

B[

JMe
IN

00
71
10
06

TEST
JZ

SIWRT $+2
AL, CMOS_PORT+1
AL,\.,(N£M_SIZE
H_OK1A

10 DELAY
WAS THE CONFIGo::MEM SIZE DETERMINED?
CO I f YES
--

;-------- MEMORY SIZE ERROR
MOV

CALL

PRINT SIZE ERROR
DISPLAY ERROR

51 ,OFFSET El A
E_MSG
-

; -------- CHECK FOR CRT ERROR

0800
0805
0807
D8DA

80 3E 0015 R OC
0000 [
74 OA

H_OK1A:

eMP
JNZ
MOV

80 3E 0015 R 00
75 06
BE 0000 E

E8 0000 E

CI-lP
MOV
JZ

H_OK1B:

CALL

MFG ERR FLAG,OCH
SI,OffSET E,_B
H_OKl B

CHECK fOR MONO CRT ERROR
PRELOAD I~ONO CRT ERROR
GO I F YES

MFG ERR fLAG,OOH
J OK
SI,OFFSET E1 C
E_MSG
-

CHECK FOR COLOR CRT ERROR
CaNT I NU[ I F NOT
CRT ERROR MSG

"'=-=====-==-="'==-="'--.==========:-----; -------' CHECK fOR COMBO HARD F I LE/D I SKETTE CARD
0800
0800
080F
0811
08111
0815
0817
0819
081 B
0810
081 F
0821
0823
0826
0829
0828
D82C
U82l
082F
0831
0833
0835
0836
0838
0839
083B
0830

MOV
SUB
MOV

83 OF

28 C9
RA 01 F7
J_OK1:

Ee

IN
TEST

A8
74
E2
FE
75

80
00
F9
CB
F5
?I~ DC
"/4 lA
EB 33 90
BA 01 F4
BO 55

JZ

LOOP
OEC

J_OK2:

00
55

25
AA

[[

EB 00
EC

3C AA
75 18

MOY
MOV
OUl
Jj<',p
IN
eMP
JNZ
MOV
OUT
JMP
IN
eMP
JNZ

OX,lF4H
AL,055H
OX,AL
SHORT $+2
AL,OX
Al,055H
F15C
AL,OAAH
DX,AL
SHORT $+2
AL,DX
AL,OAAH
F15C

0849
D84C
0851
0853

[8
8U
74
80

0858
085,11..

BO 3E
E6 80

0000 E
3E 0091 R 00
OS
OE DOlO R 40

;-------- CHECK
CALL
CMP
JZ
OR

F15C:

80 8E

GO I F NOT
WR I TE ANOTHER PATTERN
10 DELAY
IS DATA PATTERN THE SAME?
GO I F NOT
SET THE HF/FLOPPY SWITCH ON

FOR 2ND DISKETTE DRIVE
DDS
DSK STATE+l,O
F15C
;
BYTE PTR EQUIP_FLAG,40H ;

AL,3EH
MFG_PORT, AL

MOV
OUT
JMP
IN

AL,OIAG_STATUS
CMOS _PORT, AL
SHORT $+2
AL, CMOS_ PORT+l
AL,OCOH
ROM SCAN1

0868
086A
086C
086E
0870
0872

BO 92
(6 70
EB 00
Ell 71
3C 00
74 03

MOV
OUT
JMP
IN

E8 0000 E

TEST
JNZ

I NSURE DATA SEGMENT
IS THERE A DRIVE 2 ATTACHED?
GO I f NOT
SET SECOND DRIVE INSTALL£D

; <><><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 3E <><><><><>

GEl THE CMOS STATUS

BATTE.RY/CHECKSUM OK
BYPASS 0 I SK SETU P I F NOT
I NSURE CMOS OEF I NES THE TYPE OF HARD FILE

JZ

Al, liO_F I LE_ TYPE
CMOS PORT, AL
SHORT $+2
Al, CMOS_PORT+1
AL,OH
ROM_SCANl

I NSURE TYPE IS OEF I NED
BYPASS DISK SETUP IF NOT

CALL

DISK_SETUP

INITIALIZE HARD FILE

CMP

;
;

; <><><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 3D <><><><><>
INITIALIZE FLOPPY

INlllAlIZE HARD FILE

[4 71
A8 co
75 OF

[6 70
fB 00

AL,3DIl
MFG PORT, AL
DSK(TTCSETUP

MOV
OUT

085C
oaSE
0860
0862
0864
0866

0877
0877
0878
D87A
087C
087F
0881
0884

10 DELAY
CHECK DATA WRITTEN'" DATA READ

INITIALIZE fLOPPY FOR DRIVE TYPE
MOV
OUT
CALL

;-------

0874

VER I FY COMBO CARD
\oJR I TE TO THE CYL BYTf

HF _CNTRL, DUAL
;-------

80 30
E6 80
E8 0000 E

Be

.) OK1
AL,Qeli
J OK3
F1SC

C6 06 008F R 01

084?
0844
0846

OUTTER LOOP COUNT WAI T fOR BUSY OFF
HARD FILE STArus PORT
GET THE STATUS
I S THE CONTROLLER BUSY?
CONT I NUE I F NOT
TRY AGAI N
DECREMENT OUTTER LOOP
TRY AGA I N I F NOT ZERO
BITS 2 & 3 ~ 0 IF COMBO CARO
GO I F YES
NO COMBO CARD

ex,cx

AND
JZ
JMP

JNl

EE

EB
EC
3C
75
90

BL,OFH

OX,01 F7H
AI"DX
AL,080H
J OK2
J-OK1

TEST.22
CHECK FOR OPT I ONAL ROM FROM C800->EOOO IN 2K BLOCKS
:
(A VALID MODULE HAS '55AA' IN THE FIRST 2 LOCATIONS:
LENGTH I NO I CATOR (tENGTH/512) • N HIE 3RD LOCA T JON
:
AND TEST/INIT. CODE STARTING IN THE 4TH LOCATION)

ROM SCAN1:
STI

FB

BO 3B
E6
UI
BO
E8

80
UUUO E
OA
0000 E

2A
E6
EB
E6
SA

CO
D2
00
04
C80a

MOV
OUl

CALL
MOV

CALL
ROM_SCAN:

; ALLOW INTERRUPTS
; <><><><><><><><><><><><><>-<>
;<><><>CHECKPOINT 3B <><><><>
SET REAL MODE DATA SEGMENT
LINE FEED ON CRT

AL.3BH
MFG PORT ,AL
DDSAL,10
PRT_HEX

;-- _____ SET DMA MASK AND REQUEST REGISTERS
0884
0886
0888
088A
08BC
088F
088F
0891
0893
0895
0696
0897
089A
089C
08gr
08A2
08A2
08A6
08A6

BE DA
28 DB
8B 07

"

ROM SCAN2:
MOV
SUB
MOV

PUSH

5B

3D
75
E8
EB

SUB
OUT
JMP
OUT
MOV

AA55
06
0000 E
as 90

81 C2 0080

Bl fA EOOO

POP
eMP
JNZ

CALL
JMP

NEXT ROM:
ADD
ARE WE DONE:
- CMP

AL.AL
DMA18+2,AL
SHORT $+2

SEND ZERO TO MASK REG

OX,oe80UH

SEND ZERO TO REQ REG
SET BEG I NN I1';G ADDRESS

OS, DX
BX, BX
AX, (BX!

SET BX=OOOO
GET 15T WORD FROM MODULE

DMA18+j~,AL

BX
BX

BUS SETTL! ~:G
'" TO I 0 WORD?
PROCEED TO NEXT ROM I F NOT
GO CHECK OUT MODULE
CHECK fOR END OF ROM SPACE

AX,OAA55H
NEXT ROM
ROM CHECK
ARE::::WE_DONE

PO I NT TO NEXT 2K ADDRESS

oX,OOaOH
ox, OEODOH

;

AT EOOOO YET?

Test 2 5-63

08AA

JL

7C E3

END IF
; -------- TEST
08AC
OSAF
0861
08B3
08B5
08B8
08B8

E8 0000 E
E4 64
24 10
03
EB DC 90

CALL
IN
AND
JZ
JMP

-(4

; co

ROM_SCAN2

CHECK ANOTHER ADD.

I F NOT

FOR KEYBOARD LOCKED
DDS

SET DATA

Al, STATUS PORT
AL, KYBD_I NH
KEYl
KEY1D

is KEYBOARD UNLOCKED?
GO

SEGf~ENT

I F OFF

KEY1 :
80 DE 0016 R 80

OR

MfG_ERR_FLAG+l, KEY_FAIL; <><><><><><><><><><><><><><><>
; <><> KEYBOARD I S LOCKED <><><>

ASSUME

OS: OAT A

MOY
CALL

51, OFFSET LOCK

ELSE
08BO

KEY9:

ORAD

RF 0000

08CO

E8 0000

PR I NT LOCKED MESSAGE

(302)

E_MSG

END I F
KEY10:

08C3

; -------:: SETUP PR INTER_BASE
08C3
08C6
06C9
08C9
08CC
08CE
oeCF
0801
0802
0803
0804
0806
0808
08DC
0800
080E
080E
080f
08EO
08EIJ.

Bf 0000
BE 0000

E

MOY
MOY

Ol,OFfSET f4

PRT _SRC_ TBL

51,0

r16:
MOY
MOY

2E: 8B 15
BO AA
EE
EB 00
lE
Ee

OUT

1F
3C AA
75 06
89 94 0008

R

"6
46

JMP
PUSH
IN
POP
eMP
JNE
MOY
INC
INe

51

INC
INe
eMP
JNE

01
01
01, OffSET f4E
f16

F17:
47
47
81 FF 0000 E
75 E3

PRT_BASE:
eET PR INTER BASE AD DR
WRITE DATA TO PORT A

DX,CS: [011
AL,OAAH
OX,AL
SHORT $+2

10 DELAY
RIIS SETn I tIIG
READ PORT A

OS

AL,DX

as

DATA PATTERN SAME
NO
CHECK NEXT PRT CD
YES - STORE PHT BASE ADDR
iNCREMENT TO NEXT WORD

AL,OAAH
f17
PR INTER_BASEl S I ), OX

-

"

PO I NT TO NEXT BASE AODR

ALL POSS I BLE ADORS CIIECKED?
PRT_BASE

","'=",0;;0===;;;;;;===
SETUP RS232

=0;;0;;;"'0;;"'=;"''''=:::==
08;::6
08E9
08EC
08ED
08EF
oaFl
oaF7
oaf8
08f9
Oflfe
08FO
08FF
0901
0907
0908

BS
BA
Ee
A8
75
C7
43
43
SA
Ee
A8
75
C7
43
43

0000

MOV

03fA

MOV
IN
TEST
JNZ
MOV
INe
INC
MOV
IN
TEST
JNZ
MOV
. .C
INC

F8
08
87 0000 R 03F8
02FA

F18:

F8
08
8-' 0000 R 02F8

PO I NTER TO RS232 TABLE
CHECK If RS232 CO 1 ATTCH?
READ INTR 10 REG

BX,O
OX,3FAH
AL,DX
AL,OF8H
fl.
RS232_BASE[ ex), 3F8H
BX
8X
OX,2fAH
AL,
AL, OF8~1
f19
RS232_BASEI BXI, 2F8H
BX
BX

SETUP RS232 CD #1 ADDR
CHECK IF RS232 CD 2 ATTCH
READ INTERRUPT 10 REG

ox

BASE END
SETUP RS232 CD

112

==========0;;;;;;;;--=====-==-======-==-=======;;;::===="'==="'0;;======-=0;;=0;;
SET UP EQUIP_FLAG TO
0909
0909
0908
0900
090F
0911

IN.DICATE NUMBER OF PRINTERS AND RS232 CARDS

F19;

813 C6
B1

MOV
MOV
ROR

03

02 C8
OA C3
A2 0011

OR
R

MOV

BASE END:
S I HAS 2* NUMBER Of RS232
Sf! I FT COUNT
ROTATE R ICHT 3 POSI nONS
OR IN THE PRINTER COUNT
; STORE AS SECOND BYT E

AX,51
CL,3
AL,CL
AL,BL
;
BYTE PTR EQUIP_fLAG+l,AL

; -------' TEST FOR ANY ERRORS (BP NOT ZERO)

="'== ==::= ======;;; === = == = == - ==== =====

K OK;

0914
0914
0916

;-==------2B CO
A3 0017 R

; -------0919
0918
0910
091 F

E4
24
EEl
E6

0921
0926
0929

21
fD
00
21

CLEAR KEYBOARD STATE FLAGS

SUB
MOV

AX,AX
WORD PTR KB_FLAG,AX

ENABLE KEYBOARD

RESET ALL KEYBOARD STATE FLAGS

INTERRUPTS

IN
AND
JMI'
OUT

AL, I NTAOl
AL,OFDH
SHOH I $+2
JNTA01,AL

C6 06 0015 R 00
83 FD 00

MOV
eM?

BYTE PTR MFG_ERR_FLAG,
BP,OOOOJ1

74 3D

JE

F15A_O

CLEAR ~IFG ERROR FLAG
CHECK FOR BP= NON-ZERO
(ERROR HArrENCO)
CONTINUE If NO ERROR

092B
0930

80 3E 0072 R 64
75 08

CMP
JNZ

BYTE PTR RESET_FLAG,64H
ERR_WAIT

MFG RUN IN MODE?
GO I f NOT

0932
0937
093A
093A
0930

C6 06 0015 R AA
EB 2F 90

0940
09 '.2
091111
0947
0949
094C
094F
0952
0952

E4
24
BE
75
BE
E8
BE

; -------- MFG RUN

SA 0002
E8 0000 E
64
10
0000 E
09
0000 E
0000 £
0000 E

E8 0000 E

MaY
JMP
ERR_WA J T ~OV
CALL
IN
AND
MOV
JNZ
MOV
CALL
MaY
ERR WAIT2;
CALL
;--------

0955
0957
0959
0956
0956
0950

B4 01
26 02
CD 17
BO 3f
E6 80

5-64 Test 2

OUT

a

INTS

IN MOOE -> SET ERROR FLAG

BYTE PTR MFG_ERR_FLAG.OAAH
f15A_0

;
;

INDICATE ERROR
CONT I NUE

DX,2
ERR_BEEP

2 SHORT BEEPS (ERROR)

AL,STATUS PORT
AL, KYSD_I NH
51 ,OFFSET f30
ERR WAIT2
S I, OfFSET F301
P_MSG
SI,OFfSET F3D

CHECK

If RESUME MSG TO BE DISPLAYED

RESUME ERROR MSG
ERROR MSG fOR KEYBOARD LOCKED
RESUME MSG

P_MSG

INIT PRINTER

MOY
SU8
INT
ERR_WAIT1:
MOV

ENABLE TIMER AND KB
10 DELAY

(All DISPLAY DEVICE)

AH,1
OX,DX
17H

;

AL,3FH
MFG_PORT, AL

; <><><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 3 F <><><><><>

FIRST PR INTER

095F
0961
0963
0966
0968
0968
0960
096F
0972

0977

Bll
CO
80
75

00
16
Fe 3B
F3

F6
75
E9
80
74

06 0012 R 20
03
0000 E
3E 0072 R 64
06

F15A:

MOV
INT
eMP
JNE

AH,OO
16M
AH,3BH
ERR_WA 1T1

TEST

MfG_TST , LOOP_POST
flSA
START_l
;
BYTE PTR RESET_FLAG,64H ;
F15B
;

MFG BURN 1N MODE
GO I F NOT
GO lOOP POST
MFG RUN 1N?
BYPASS BEEP I f YES

DX,l
ERR_BEEP

1 SHORT BEEP (NO ERRORS)

AH,AH
Al, CRT_MODE
10M

CLEAR FLAGS

JNZ
JMP
eMP
JZ

0979
097C

SA 0001

MOV

E8 0000 E

CALL

097F
0981
0984

2A E4
AO 0049 R
CD 10

fl~B:

SUB
MOV
INT

WAIT FOR ' f , ' KEY

CLEAR SCREEN

; -------- CLEAR OESCRI PTOR TABLES
0986
0989
098C
098E
0990
0993
0996

B9
BF
2B
BE

01 F4
DOAO
eo
co
26: 89 05
83 C7 02
E2 F8

F20:

MOV
t10V
SUB
MOV

f20_A:

MOV
ADD

LOOP

CLEAR 1K
PO I NT ES TO START OF OEseR I PTORS

CX,0500
Dl,SYS_IDT_LOC
AX,AX
E5,AX
ES: I DI LAX
01,2
F20_A

CLEAR
POINT TO NEXT LOCATION
CONT I NUE TILL DONE

='='======'00=:=====
T I ME OF DAY
===""=-==========

; -------- SET
0998

CALL

£8 0000 E

SET_TOO

; ~------- SET SYSTEM STACK
099B
099E
09AO

B8
---- R
8E DO
BC 0100 R

091\3

80 40
E6 80
Al 0067 R

MOV
MOV
MOV

AX, STACK
SS,AX
SP, OFFSET T05

GET THE STACK SEGMENT

; ------- ENABLE HARDWARE I NTERRUPT I f MATH PROCESSOR (X287)

09A5
09A7
09AA
09AB
09AD
09BO
09B2
09B4

,0
2B CO

A3 0067 R

MOV
OUT
MOV

AL,40H
MfG PORT ,AL
Ax,To_ROM_IN1T

PUSH
SUB

AX

;

09 3E 0067 R

09B8

60

DB

09139
09BA
0geo
0ge6

61
81 26 0067 R 1 F3F
Bl 3E 0067 R 033F
75 24

DB
AND
eMP
JNZ

0ge8
09C9

9B

WAIT

DO 3E 0067 R

ESC

09CD

60

DB

09CE
09CF
0905

n 06 0067 R B8BF
75 15

JNZ

061H
IO_ROM_l NIT, OB8BFH
NO_287

0907
09D9
090B
0900

Ell Al
24 OF
EB 00
E6 A1

IN
AND
JMP
OUT

AL, 1NTBOl
AL,OOFH
SHORT $+2
INTB01,AL

090F
09El
09E3
09E5
09E7
09EC

E4 21
24 FB
EB 00
E6 21
80 DE 0010 R 02

TEMP STORAGE
CLEAR ID_R011_INIT

AX,AX
10_ROM_1NIT,AX
28,BX
AX,AX
15,10_ROM_INIT

MOV
ESC
XOR
[SC

DB E3
33 CO

; <><><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 40 <><><><><>

T I ME

PUSHA

~OK

287 TO RESPOND

060H

POPA
061H
10 ROM LN1T,OlF3FH
I O::::ROM::::I NIT ,0033fH
NO_287

CLEAR UNUSED 287 BITS
I S THE 287 INSTALLED?
GO 1 F MATH PROCESSOR 1S NOT INSTALLED
STORE THE STATUS WORD

T I ME FOR 287 TO RESPOND

PUSHA
060H

POPA

61

DB

TEST

;

09Ee
09ED

--~-----

ALL BITs SHOULD BE Off
GO I F NOT INSTALLED
GET THE SLAVE 1NT MASK
ENABLE 287 INTERRUPTS
10 DELAY

ENSURE THAT MASTER LEVEL 2 ENABLED

IN
AND
JMP
OUT
OR

AL,INTAOl
AL,OFSH
SHORT $+2
INTA01,AL
BYTE PTR EQU I P_FLAG, 02H

GET THE CURRENT MASK

POP
MOV

AX

RESTORE

10 DELAY
SET 287 BIT ON

NO_287:

58
A3 0067 R

1O_ROM lNIT

la_ROM _INIT,AX

; --------- TEST FOR MFG RUN-I N TEST
09FO
09F5
09F7

80 3[ 0072 R 64
75 03
EB 63 90

09FA
09FA
09FC
09FE
DADO

E4
24
EB
E6

Al

CMP
JNZ
JMP

BYTE PTR RESET fLAG,64H ;
END 287
,
SHUT4
;

I S THE THE MFG RUN- I N TEST?
GO IF NOT
BOOT LOAD I F YES

;-------- UNMASK SLAVE HARDWARE INT 9 (LEVEL 71)
END_281:
IN
AL, lNTB01
GFT THE CURRENT MASK

~~~

fD

00
Al

OUT

~~6~~D~+2

;

INTB01,AL

;

10 DELAY
SET NEW MASK

TEST FOR SYSTEM CODE AT SEGMENT EOOO:O
FIRST WORD == AAS5H
LAST BYTE == CHECKSUM
ENTRY POINT == FIRST BYTE + 3
I F TEST 15 SUCCESSFUL A CALL FAR TO THE ENTRY PO 1NT IS EXCUTED
OA02
OA04

BO 4'
£6 80

MOV
OUT

AL,41H
MFG_PORT, AL

OA06
DADS

BO AD
E6 70

MOV
OUT

AL, CMOS_END
CMOS_PORT, AL

MOV
MOV
MOV

PUSH

BYTE PTR RESET FLAG,
AX, GEOOOH
ES,AX
OJ. DI
AX,ES:[Dl]
8X

POP
eMP

AX,OAA55H

; <><><><><><><><><><><><><><><>
; <><><>CHECKPO 1NT 41 <><><><><>
INSURE NM 1 OfF

ENOl F
OADA
oAor
OA12
OA14
OA16
OA19
OA1A
OAlS
DAlE
OA1F
OA22
OA24

C6 06 0072 R 00
B8 EDOO
8E CO
2B ff
26: 8B 05
53
5B
3D AA55
9C
26: 89 OS
E4 61
OC DC

SUB
MOV

CLEAR FLAG
SEGMENT OF SYSTEM CODE
CHECK FOR AAS5
BUS SETTLE

BX

PUSHF
MOV
IN
OR

a

E5:!Dl],AX
AL, i'ORT_B
AL, RAM_PAR_OFf

SAVE FLAGS
CLEAR pass 1BLE PAR 1TY CHECK
TOGGLE 10/PAR CHECK ENABLE

Test 2 5-65

01\26
OA28
OA2A
OA2C

J~1?

EB 00
E6 61

OUT
AND
JMP
OUT
POPF
JNZ

2" F3
EB 00

UA~t.

1:.6 61

UA30
OA31

9D

OA33
UI\34
OA35
OA36
01\38
OA3B
OA3C

IE
06
IF

OA3E
OAIIO

60 20
E6 70

MOV
OUT

OA42
OA44
OA46
OA48

E4
EB
24
E6

61
no
F3
61

IN
JMP

OA4A
OA50

c7 06 0067 R 0003
8C 06 0069 R

OA54
OA56

80 42
E6 BO

15 29

10 DELAY

SHOI1T $+2
PORT _B,AL
AL, RAM PAR ON
SHOHT ~+2 PORT _B,AL

10 DELAY
RESTORE FLAGS
CONTI NU(

SHUT4

; ------- CHECKSUM SYSTEM CODE
rUSH
PUSH
POP
SUB
CALL
POP
JNZ

28 OR
EB 0000 E
1F

75

l(

OS
ES
OS
BX, BX
fl:OS_CHFCKSUM
OS
SHUT4

ENABLE NMI

80 20
E6 70

OA60
OA62
OAG4
UA66

E4 61

SHUTlI:

ENABLE NM I

OUT

MOV
MOV

DS; 10_ROM_INIT,0003H
OS; I O__ IWM_SEG, ES

SET THE OFFSET
SET THE SEGI>1ENT

I V
OUT

AL,42H
MFG_PORT ,AL

10 CH

; <><><><><><><><><><><><:><><>
; <><><>GHECI<><><:>

EX 1T TO SYSTEM CODE
DWORD PTR

DS~

10_ROM_ I NIT

; GU I D SYS I lM CODE
VIA CALL

ENABLE NMI
OA5C
OA5E

IO/PAR CHECKS

AL,~lm

CMOS _PORT,AL
ENABLE" PAR I TY
10 DELAY
[NAGLe RAM PCK AND

CALL

FF 1 E 0067 R

STABTING OFFSET
RESTOH[ DATA SEGMENT
GO I F CHECKSUM NOT OK

AL, PORT_B
SHORT $+2
AL, RAM_PAR_ON
PORT_B,Al

AND

;-------OA58

AND

SET SEGMENT TO TEST

INTERRUPTS + ENTRY FROM SHUTDOWN 'vi I TH BOOT REQUEST

MOV
OUT

"L,2DH
CMOS_PORT, AL

ENABLE NMI

IN
JMP

ENABLE PAR I TY
10 DELAY
ENABLE RAM PCK AND

24

F3
'6 61

AND

OUT

AL, PORT B
SHORT $+2
Al, RAf1_PAR_ON
PORT _B,AL

OA68
OA6A

80 43
E6 80

MOV
OUT

AL,43H
MFG_PORT, AL

; <><><><><><><><><><><><><><>
;<><><>CHECI<><><>

OA6C

CO 19

INT

19H

; GO TO BOOT LOADER

EB 00

(NDI r
ENOl F
POST2
CODE

OA6E

OA6£

5-66

Test 2

ENDP
ENOS
END

10 CH

POST UT I Lt TIES

I I TLE 09-26-83 TEST3
. Lt ST
PUBLIC
POST3
PUBL I eROS_CHECKSUM
PUBL I C BL I NK I NT
PUBL I C ROM_CHECK
PUBl1 C XPC BYTE
PUBl1 C PRT-HEX
PUBliC XLAT PR
PU8L I C PROT-PRT HEX
PUBL I C PROC=SHUTDOWN
I NCLUDE SEGMENT. SRC
CODE SEGMENT BYTE PUBLIC

0000

EXTRN

ROM_ERR: NEAR
ROS CHECKSUM SUBROUT I NE

;
0000
0000

0000
0002
0002
0004
0004
0006
0007
0009
OOOB

oooc

2B C9
32 CO
02 07
43
E2

FB

OA CO
C3

-- - -- ----------- - --- ------- -------- -- ---

ASSUME
CS;CODE, DS:ABSO
POSH:
ROS CHECKSUM
PROC
NEAR
SUB
ex,cx
ROS CHECKSUM CNT:
XOR AL,AL
C26;
ADD
AL,OS:iBXj
INC
ax
LOOP
C26
AL,AL
OR

RET
ROS_CHECKSUM

NEXT ROS MODULE
NUMBER OF BYTES TO ADO IS 64K
ENTRY FOR OPT I ONAL ROS TEST

PO I NT TO NEXT BYTE
AUD ALL BYTES IN ROS MODULE
SUM = O?

ENOP

1311 NK LED

IF LEO
QOOC

OOOC
0000
OOOE
0010
0012
0014
0016
0019
0018
0010
DOH
0021
0022
0023

0023
0023
0026
0028
002A
0020
002F

0031
0033

0034
0037
0039
0038

003C
003F
0041
0044
0047
0047
0048

FB

50
E4 80

ASSUME
BLINK INT
STI
PUSH
IN

8A EO
F6 DO
80 E4 BF

MOV
NOT
AND
ANU

OA C4

OR

E6 80
BO 20
E6 20

OUT
MDV
OUT
POP

24 40

5B
CF

SAVE AX REG CONTENTS
READ CURRENT VAL OF MFG_PORT

AX

AL, MFG PORT
AH,AL AL
AL, 01 0000006
AH,10111111B
AL,AH
MFG PORT,AL
AL, EOI
INTAOO,AL

FLIP ALL BITS
I SOLAT E CONTROL BIT
MASK OUT OF OR I G I NAL VAL
OR NEW CONTROL BIT IN

;

AX

RESTORE AX RFG

IREl

Bli NK_I NT

ENOP

ROM CHECK
-

BB
---- R
8E CO
2A E4
8A 47 02
B1
D3
8B
51
B:l
D3

PROCEDURE FOR MFG RUN-I N TESTS
IS ON, TURN IT OFF. I f OFF, TURN ON.

OS; DATA
PROC
NEAR

PROC

MOV
MDV

CL,09H
AX,CL
CX,AX

MDV

EO

SHL

C8

MOV

PUSH

CX

0004

MUV

£8
03 DO
59
E8 0002 R
711 06

SHR

CX,4
AX,CL
OX,AX

ADD
PDP

-

52

26: C7 06 0067 R 0003

004F

26:

BC 1 E 0069 R

0054
0059

26:

FF 1 E 0067 R

5A

005A
005A

C3

ROS_CHECKSUM_CNT
ROM_CHECK_,
ROM ERR
ROM=CHECK_END

JMP
ROM CHECK 1;

PUSH

OX

MOV
MOV

ES: 10 ROM INIT,DD03H
£s: I O=ROM=SEG, OS
OWORD PTR ES: 10 ROM INIT
OX
-

CALL
POP

ZERO OUT AH
GET LENGTH I NO I CATOR
MULTIPLY BY 512
SET COUNT
SAVE COUNT
ADJUST

ex

CALL
J7
CALL

E8 0000 E
EB 14 90

POINT ES TO DATA AREA

ES,AX
AH,AH
AL, [BX+2]

MOY

09

NEAR

AX, DATA

SUB

SET POINTER TO NEXT MODULE
RETR I VE COUNT
DO CHECKSUM
POST CHECKSUM ERROR
AND EXIT
SAVE PO INTER
LOAD OFFSET
LOAD SEGMENT
CALL INIT./TEST ROUTINE

ROM_CHECK_END:
RETURN TO CALLER

RET

ROM_CHECK

0058

ENDP

CONVERT AND PR I NT ASC I I CODE
AL MUST CONTAIN NUMBER TO BE CONVERTED.
AX AND BX DESTROYED.
005B
005B
D05C
005E
0060
0063
0064
0066
0066
0068
0069
006B

XPC_BYTE
PUSH

AX

B1 04
02 E8
E8 0066 R

MOV
SHR

CL,4
AL,CL
XLAT_PR

CALL

58
24 OF

PDP
AND

XLAT_PR PROC
ADD
DAA
ADC
OAA

04 90
27
14 40
27

DOGe
D06C
D06E
0070
0072
0073
0073
00"13

PROC

50

PRT_HEX PROC

NEAR

AX

AL,OFH
NEAR
AL,090H
AL,040H

SAVE FOR LOW NIBBLE 0 I SPLAY
SH I FT COUNT
NIBBLE SWAP
DO THE 11lGII NIBBL[ DISPLAY
RECOVER THE NIBBLE
ISOLATE TO LOW NIBBLE
FALL INTO LOW NIBBLE CONVERSION
CONVERT OO-OF TO ASCII CHARACTER
ADD FIRST CONVERSION FACTOR
ADJUST FOR NUMERIC AND ALPHA RANGE
ADD CONYERS I ON AND ADJ UST LOW NIBBLE
ADJUST HIGH NIBBLE TO ASCHI RANGE

MDV
MOV

NEAR
AH,14
BH,a

DISPLAY CHARACTER IN AL

CO 10

INT

10H

CALL VIDEO_IO

C3

RET

B4 DE
B7 00

PRT_HEX ENDP
XLAT_PR ENDP
XPC_6YTE

ENDP

; -PU~- C~;~;CTER- T~ -THE-C~T - ;~~ -T£;T ~~ ~ -~N- -- -- ----;

PROTECTED MODE

~ AL=ASCII CHARTER DI=CRT BUfFER POSITION
0073
0073
0074

0075
0078
a07A

~~~T=P~T=~E~----PROC----NE~R-----------------------

1E
53

BB 0020

PUSH
PUSH

OS
BX

; ------- B/W

v I OEO

8E DB

MOV
MOV

E6 0098 R

CALL

SAVE CURRENT SEGMENT REGS
CARD

BX, C_BWCRT_PTR
OS,BX
PROT_PRT

SET OS TO BW CRT BUFFER
GO PR I NT CHARACTER

Test 3 5-67

;-------- COMPATIBLE COLOR
0070
0080
0082

BB 0028
8E DB
E8 0098 R

0085
0088
008A
0080
0090
0092
0095
0096
0097
0998
0098
0099
009B
0090
009E
009f

BB
BE
E8
BB
8E
E8
5B
If
C3

MOV
MOV
CAll

BX,C_CCRT_PTR
OS,BX
PROT_PRT

SET OS TO COM PAT 1BlE COLOR RAM

; -------- ENtlANCED COLOR

009f
009f
OOAl
OOA3
OOAlI
00A6
OOA6

0030
DB
0098 R
0038
DB
0098 R

57
01 C7
88 05

SF
C3

ax, E_CCRT_PTR
DS,BX
PROT PRT
BX, CCCRT_PTR2
OS, BX
PROT_PRT
BX

PROC_SHUTDOWN
MOV
OUT
PROC_S: HLT
JMP
PROC_SHUTDOWN
CODE
ENDS
END

PROC
Al, SHUT_CMD
STATUS_PORT,Al

-

BO FE
E6 64

F4
EB FD

5-68

MOV
MOV
CAll
MOV
MOV
CALL
POP
POP
RET
PROT- PRT:
PUSH
ROL
MOV
POP
RET
PROT PRT_HEX

Test 3

ENHANCED COLOR
ENHANCED COLOR PTR HI 64"

OS

01
01,1
OS:[DIj,Al
01

SAVE DISPLACEMENT
MUlT *2
WR 1TE TO CRT BUFFER
RESTORE DISPLACEMENT

ENDP

PROC_S
ENDP

SHUTDOWN COMMAND
1NSURE HALT

TITLE 10/05/83 TEST4
POST UTILITIES
. LIST
PUBL I C
PQS rll
PUBL I C
[~ISG
PUBLIC
KBD RESET
PUBLIC
rsr(p
PUBLIC
ERR BEEP
PUBLIC
[MSC
rUBLI cobs
PUBLIC
P MSG
rUBLI C
PRT SEG
PUBLI C
DUMMY RETURN 1
PU8LIC
011
PURl IC
I NT 287
PUBLIC
ReDIRECT
I NCI"UDE SEGMENT. SRC
CODE SEGMENT BYTE PUBLIC

0000

rXTRN
[XTRN
[XTRN
EXTRN
ASSUI-1£

PRT HEX: NEAR

XPC~BYTE:NEAR

XMIT 80112:NEAR
OBF 112: NEAR
CS;COOE,DS:ABSO

POST1~:

0000

THIS SUBROUTINE WILL PRINT A MESSAGE ON THE DISPLAY
ENTRY REQUIREMENTS:
SI " OFFSET(ADDRESS) OF MESSAGE BUFFER
CX " r~ESSAGE BYTE COUNT
MAX I MUM MESSAGE LENGHI IS 36 CHARACTERS
LMSG

0000
0000
0002

8B EE
[8 0019 R

0005

1£

0006

f8 OOAA H
AO 0010 R

0009

aaoc

OOOE
0010
0010
DOll
0014
0016
0017
0017
0018
001')
0019
0019
001C
0010
001 E
0021
0022
0024
0026
0027

24 01
75 07
FA

PROC
MaY
CALI
PUSI-I
ASSUME
DS;DATA
CALL
MOV
AND
JNZ
MFG HALT:
eLI

POP

as

WRITE_MSG:

NEAR
AL,es: [511
SI

HLT

8A 04

46

50
E8 0000 E

POP

58
3C OA

CMP

75

JME

F3

RET

G3

P_MSG

LOOP/HALT ON ER.ROR
SW I TCH ON?
NO - RETURN

RET
ENOP
PROC
MOV
INC
PUSH
CALI

MOV
OUT

F"

2[:

DOS
AL,BYTE PTR FQUIP_FIAG
AL,OlH
NOT_ON

HALT SYSTEM
YES RECOVER ERROR INDICATOR
SET INTO MFG PORT
HALT SYS

[6 80

E MSG
P-MSG
G12A:

SFT BP NON~ZERO TO FLAG ERR
PRINT MESSAGE

AL, MFG ERR FLAG
MFG_PORT, AI

AO 0015 R

1F
G3

NFAR
BP, SI
P MSG

OS

PUT CHAR IN AL
PO I Nl TO NEXT CHAR
SAVE PR I NT CHAR
CALL VIDEO 10
RECOVER PRINT CHAR
WAS IT LINE FEED?
NO, KEE P PR I NT I NG STR I NG

AX

PRT HEX
AX AL,10
G12A

ENoP

INITIAL RELIABILITY TEST -- SUBROUTINES
ASSUME

CS; CODE,

os: DATA

SUBROUT I NES FOR POWER ON 0 I AGNOST I C$
THIS PROCEDURE WILL ISSUE ONE LONG TONE (3 SEeS) AND ONE OR
MORE SHORT TONES (1 SEC) TO INDICATE A FAILURE ON THE PLANAR
BOARD, A BAD RAM MODULE, OR A PROBLEM WI TH THE CRT.
ENTRY PARAM[TFRS:
DH = NUMBER OF LONG TONES TO BEEP
OL = NUMBER OF SHORT TONES TO BEEP.
0027
0027
0028
0029
OD2A
0020
002F
0031
0031
0033
0036
0038
003A
003C
0041
0043
0045
0045
0047

004A
OOI~C

OOI(E

0050
0052
0054
0055
0056
0057

9C
FA
1E
E8 OOAA R
OA F6
74 14

ERR - BEEP

PROC
PUSHF
Cli
PUSH
CALL
OR
JZ

NEAR
DS
DDS

DH, DH
G3

G1 :
83
E8
E2
FE
75

06
0057 R
FE
CE
F5
80 3E 0012 R 01
75 02
EB CB

G2:

Mav
CAl.L
LOOP
DEC
JNI

Bl,6
I)EEP
G2
DH

GMP

G1
MFG_TST,l

JNE
JMP

MFG_HAL T

G3

G3:
83 01
£8 0057 R
E2 FE
FE CA
75 F5
E2 FE
E2 FE
1F

GIl:

G5:
G6:

90

Mav
CALL
LOOP
DEC
JNZ
LOOP
LOOP
POP
POPF

BL,l
BEEP
G4

al
G3

G5
G6
DS

RET

C3
ERR_BEEP

;
;
;

SAVE FLAGS
DISABLE SYSTEM INTERRUPTS
SAVE OS REG CONTENTS

ANY LONG ONES TO BEEP
NO, DO THE SHORT ONES
LONG_BEEP:
COUNTER FOR BEf.PS
DO THE BEEP
DELAY BETWEEN BEEPS
ANY MORE TO DO
DO IT
MFG TEST MODE?
YES - CONTINUE BEEPING SPEAKER
STOP BLINKING LED
SHORT BEEP:
COUNTER FOR A SHORT BEEP
DO THE SOUND
DELAY BETWEEN BEEPS
DONE WITH SHORTS
00 SOME MORE
LONG DELAY BEFORE RETURN
RESTORE OR I G CONTENTS OF OS
RESTORE FLAGS TO OR I G SETT I NGS
RETURN TO GALLER

ENDP
ROUT I NE TO SOUND BEEPER

0057
0057

0059
0058
OU50
0060
0062
0064

0066
0068
006A
006e
006E

0010
0072
0074
0076
0078

BEEP
BO B6
E.6 43
[8 00
B8 0533
E6 42
EB 00
SA C4
E6 112
E4 61
8A EO
EB 00
OC 03
E6 61
26 C9
E2 FE
FE CB
75 FA

PROC
MOV
OUT
JMP

MOY

G7:

OUT
JMP
MOY
OUT
IN
MOV
JMP
OR
OUT
SUB
LOOP
DEC

JNl

NEAR
AL,10110110B
T I MER+3, AL
SHORT $+2
AX, S33H
TlMER+2,AL
SHORT $+2
AL,AH
T I MER+2, Al
AL,PORT_B
AH,AL
SHORT $+2
AL,03
PORT_B,AL
CX, ex
G7
BL
G7

SEL TIM 2, LSB, MSB, B I NARY
WR I TE THE T I MER MODE REG
10 DELAY
D I V I SOR FOR 896 HZ
WRITE TIMER 2 CNT - LSB
LO DELAY
WRITE TIMER 2 CNT - MSB
GET CURRENT SETT I NG OF PORT
SAVE THAT SElT I NG
10 DELAY
TU~i~ SPEAKER ON
SET CNT TO WA I T 500 MS
DELAY BEFORE TURN I NG Off
DELAY CNT EXPIRED?
NO - CONT I NUE BEEP I NG SPK

Test 4

5-69

007A
007C
007E
007f

8A c4
E6 61
C3

MOV
OUT

RECOVER VALUE OF PORT

AL,AH
PORT_S, AL

RET

BEEP
;

RETURN TO CALLER

ENOP

----- ---------- --------- -------- ----------------------------------------THIS PROCEDURE WILL SEND A SOFTWARE RESET TO THE KEYBOARD.
SCAN CODE ~ AA' SHOULD BE RETURNED TO THE CPU.
SCAN CODE ~65' IS DEFINED FOR MANUFACTURING TEST

007t
007F
0061
0084

BO fF
E6 0000 E
E3 23

0086
0088

3C FA
75 IF

CMP
JNZ

AL, KB_ACK
013

OOBA
OOBC
OOBE
0093

BO FD
E6 21
C6 06 006B R 00
FB

MOV
OUT
MOV
STI

AL,OFDH
INTA01,AL
INTR_FLAG,O

ENABLE KEYBOARD INTERRUPTS
WRITE 8259 IMR
RESET INTERRUPT INDICATOR
ENABLE INTERRUPTS

0094
0096
0098
0090
009F
OOAl
00A3

B3
2B
F6
75
E2
FE
75

MOV
SU8

BL,10
CX,CX
INTR_FLAG,02H
012
011

TRY FOR 400 MSEC
SETUP I NTERRU PT TIMEOUT CNT
o lOA KEYBOARD I NTR OCCUR?
YES - READ SCAN CODE RETURNED
NO - LOOP TILL TIMEOUT

aOA5

E4 60
8A 08

OOA7

OOA9
OOAA

OA
C9
06 006B R 02
06
F7
CB
F3

C3

TEST
JNZ

LOOP

G12:

DEC
JNZ

BL

ell

TRY AGAIN

IN
MOV

AL, PORT_A
BL,AL

READ KEYBOARD SCAN CODE
SAVE SCAN CODE JUST READ
RETURN TO CALLER

Gll:
RET
KBD_RESET
DDS

OOAA

OOAA
OOAR
OOAE
OOBO
OOBl
00B2

Gll:

50
B8

PROC
PUSH
MOV
MOV
POP

---- R
6E 08

58
C3

RET

DDS

ENDP
NEAR
AX

AX,DATA
OS,AX
AX

ENOP

TEMPORARY INTERRUPT SERVICE ROUTINE
1. TH I S ROUT I NE I S ALSO LEFT I N PLACE AfTER THE
POWER ON DIAGNOSTICS TO SERVICE UNUSED
INTERRUPT VECTORS. LOCATION' INTR_FLAG' WI LL
CONTALN EITHER: 1. LEVEL OF HARDWARE INT. THAT
CAUSED CODE TO BE EXEC.
2. 'FF' FOR NON-HARDWARE INTERUPTS THAT WAS
EXECUTED ACCIDENTLY •

ooeo

00C2
00C4
00C6
00C8
OOCA
OOCC
OOCC
OOCE
0000
0002
0004
0006
0008
OODA
oaDC
OODE
OOEO
00E2
00E4
00E6
OOEB
DOEA
OOEe
OOEE
OOFO
00F2
OOF4
OOF6
OOF6
aOFA
oaFS
aOFc

oom
DOH
OOFE
OOFF

:
:

.----------------------------------- -------------------PROC
NEAR

011

00B2
00B2
00B3
00B4
00B5
0086
00B9
OOSB
OOSO
OOBf

:
:

ASSUME
PUSH
PUSH
PUSH
PUSH
CALL

lE

52
50
53

E8
BO
E6
EB

OOAA R
DB
20
00

MOV
OUT
JMP
NOP
IN
MOV
DR
JNZ
MOV
JMP

90
E4
8A
OA
75
84
fB

20
£0
C4
04
FF
2A

BO
E6
EB
E4
8A
OA
74
E4
OA
EB
E6
BO
EB
E6
E4
EB
OA
E6
EB
BO
E6

DB
AD
00
AO
F8
FF
DE
Al
C7
00
Al
20
00
AD
21
00
C4
21
00
20
20

MOV
OUT
JMP
IN
MOV
OR
JZ
IN
OR
JMP
OUT
MOV
JMP
OUT

NOT_SEC: IN
JMP
OR
OUT
JMP
MOV
OUT

OS: DATA
OS
ox
AX
BX
DDS
AL,OBH
I NTAOO, AL
SHORT $+2
AL,INTAOO
AH,AL
AL,AH
HW_I NT
AH,OFFH
SHORT SET_INTR_FLAG
AL,OBH
lNTBOO,AL
SHORT $+2
AL, ItHBOO
SH,AL
BH,BH
NOT_SEC
AL,lNTBOl
AL,BH
SHORT $+2
I NTB01,AL
AL,EOI
SHORT $+2
INTBOO,AL
AL INTA01
SHORT $+2
AL,AH
INTA01,AL
SHORT $+2
AL, EOI
I NTAOO, AL

SAVE REG AX CONTENTS
SET DATA SEGM.ENT
READ I N-SERVt CE REG
(FIND OUT WHAT LEVEL BEING
10 DELAY
SERVI CED)
GET LEVEL
SAVE IT
OO? (NO HARDWARE ISR ACTIVE)
SET fLAG TO r F If NON-HDWARE
READ IN-SERVICE REG INT CHI P 2
10 DELAY
CHECK THE SECOND I NT CH I P
SAVE IT
CONT I NUE I F NOT
GET SECOND I NT MASK
MASK OFF LVL BEING SERVICED
10 DELAY
SEND EO I TO SECOND CH I P
J 0 DELAY
GET MASK VALUE
10 DELAY
MASK OFF LVL BE I NG SERV t CEO
10 DELAY

SET_INTR_FLAG:
88 26 006S R

MOV
POP
POP
POP
POP

58
58
5A
1F
Cf

INTR_fLAG,AH
BX
AX
OX
OS

DUMMY RETURN 1:
IRET011
ENDP

SET FLAG
RESTORE REG AX CONTENTS
;

NEED IRET FOR VECTOR TABLE

; --HARDWARE I NT 13 (LEVEL 75H) -------------------------SERVICE X287 INTERRUPTS
:
TH I S ROUT I NE f I [LOS X287 I NTERRUPTS AND CONTROL :
IS PASSED TO THE NM I I NTERRUPT HANDLER FOR
COMPATABILITY.

;
~OFF

------------------------------ - -------------------------

INT_287 PROC
PUSH

NEAR
AX

SAVE AX

0100
0102

32 CO
£6 Fa

XOR
OUT

AL,AL
X287,AL

REMOVE THE t NT REQUEST

0104
0106
0108

BO 20
[6 AD
E6 20

MOV
OUT
OUT

AL,EOI
INTBOO,AL
INTADO,AL

ENABLE THE INTERRUPT
THE SLAVE
THE MASTER

OlOA
010B

58

POP
INT

AX

2

RESTORE AX
e I VE CONTROL TO NM I

~OFF

50

CD 02

5-70 Test 4

0100

CF
I NT_287

010£

;

lRET
ENDP

RETURN

;--HARDI-JAKE INT 9 (LEVEL 7111) -------------------------; REDIRECT SLAVE INTERRUPT 9 TO INTERRUPT LEVEL 2
TH I S ROUT I ME F I ELOS LEVEL 9 I NTERRUPTS AND
CONTROL IS PASSED TO MASTER INTERRUPT LEVEL 2

OlOE
alOE
OlaF
0111
0113
0114
0116
0117

R[ DIRECT PROC
PUSH
MOY
OUT
POP
INT

50
SO 20
[6 AD

5'

CD OA

NEAR
AX
AL, EOI
J NTBOO,AL
AX
UAH

I~

CF

SAVE AX
[0 I

TO SLAVE I NT CONTROLLER
RESTORE AX
GIVE CONTROL TO HARDWARE LEVEL 2
.n~

RCD I RECT [NDP
PRINT A SEGMET VALUE TO LOOK LI KE A 21 BIT ADDRESS
OX MUST GONTA I N SEGMENT VALUE TO BE PR I NTED

0117
0117
0119
Ol1C
011E
0121
0123
0126
0128
012B
012C
Q12C

SA
£8
8A
[8
80
[8
80
[8
C3

C6
0000
C2
0000
30
0000
20
0000

E

E
E
E

PRT SEC PROC
MOV
CALL
May
CALL
May
CALL
May
CALL

NEAR
AL,OH
XPC BYTE
AL,DL
XPC BYTE
A,L, TO'
PRT HEX
\L T ,
PR"LHEX

GET MSB
LSB
PRINT A '0
SPACE

RET
PRT SEG ENDP
CODE
ENDS
[NO

Test 4 5-71

5-72 Test 4

TITLE 12/16/83 TEST5
• LIST
PUBLIC POSTS
PUBLIC EXC_OO
PUBLIC EXC_Ol
PUBLIC EXC_02
PUBLIC EXC_03
PUBLIC EXC_04
PUBLIC
PUBLIC
PUBLIC EXC_07
PUBLIC EXC_08
PUBLIC EXC_09
PUBLIC EXC_10
PUBLIC EXC_l1
PUBLIC EXC_ 12
PUBLIC EXC_13
PUBLIC EXC_ 14
PUBLIC EXC_'5
PUBLIC EXC_ 16
PUBLIC EXC_17
PUBLIC EXC_ 18
PUBLIC EXC_19
PUBL IC EXC_20
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC EXC_27
PUBLIC EXC_28
PUBLIC EXC_29
PUBLIC EXC_30
PUBLIC EXC_3 1

EXCEPTION INTERRUPT HANDLER

~~g:g~

~g:~~

I~~~ii

PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC

m~n

I NCLUOE SEGMENT. SRC
CODE SEGMENT BYTE PUBLIC

0000

0000
0000
0000
0002
0005
0005
0007
OOOA
OOOA
OOOC
DOOF
OOOF
0011
0014
0014
0016
0019

SYS_32
SYS_33
SY5_34

ASSUME

CS:CODE. DS:AB50

MOV
JMP

AL.90H
TEST_EXC

i <~~>~~~~T

MOV
JMP

AL.91H
TEST_EXC

; <~~>i~~~T I ~H~~~~~i~~~>~~~>~~PECTED

MOV
JMP

Al.92H
TEST_EXC

; <><><>5ET CHECKPO I NT<><><><>
; GO TEST If EXCEPTI ON WAS EXPECTED

MOV
J"P

AL.93H
TEST_EXC

; <><><>5£T CHECKPO I NT<><><><>
; GO TEST I F EXCEPT I ON WAS EXPECTED

MOV
J"P

AL,94H
TEST_Exe

: <><><>5ET CHECKPO I NT<><><><>
; GO TEST I F EXCEPT I ON WAS EXPECTED

P05T5:
EXC_DD:

BO 90
E9 0007 R

EXC_Ol:

BO 91
E9 0007 R

~H~~~~~~ ~~~>~~~>~~PECTED

EXC_02:

BO 92
£9 00D7 R
EXC_03:
BO 93
E9 0007 R

I

EXC_04:

BO 94
E9 0007 R
EXC_05:

0019

06

PUSH

ES

001A
0010

B8 0048
8E CO

MOV
MOV

AX, ES_TEMP
ES.AX

;-------

LOAD ES REGISTER

FIX BOUND PARAMETERS
POINT BEGINING OF THE BLOCK
SET FIRST WORD TO ZERO

0021

28 FF
26: C7 05 0000

MOV

01,01
WORD PTR E5:[01).0

0026
002C

26: C7 45 02 7FFF

07

MOV
POP

WORD PTR ES:[01+2J,07FFFH ;
ES

BO 95
E9 0007 R

MOV
JMP

AL.95H
TEST_EXC

MOV
JMP

AL.96H
TEST_EXC

; <:><><>5ET CHECKPO J NT<><><><>
; GO TEST I F EXCEPT I ON WAS EXPECTED

MOV
JMP

AL,97H
TEST_Exe

; <><><>5ET CHECK POI NT<><><><>
; CO TEST I F EXCEPT I ON WAS EXPECTED

MOV
JMP

AL.98H
TEST_EXC

: <><><>5ET CHECKPO I NT<><><><>
; GO TEST I F EXCEPT I ON WAS EXPECTED

DOH

0020
002F
0032
0032
0034
0037
0037
0039
003C
OOlC
003E
0041
0041
0043
0046
0046
0048
0048
0048
0040
0050
0050
0052
0055
0055
0057
005A
005A
OO,}C
005F
005F
0061
0064
0064
0066
0069
0069
0068
006E
006E

SUB

EXC_06:

BO 96
E9 0007 R
EXC_07:
BO 97
E9 0007 R
EXC_08:
BO 98
E9 0007 R

EXC_D9:

BO 99
E9 0007 R

MOV
JMP

AL.99H
TEST_EXC

; <><><>5ET CHECKPO I NT<><><><>
; GO TEST I F EXCEPT I ON WAS EXPECTED

MOV
JMP

AL,9AH

TE5T_Exe

; <><><>SET CHECKPO I NT<><><><>
; GO TEST I F EXCEPT I ON WAS EXPECTED

MOV
J"P

AL.9BH
TEST_EXC

; <><;><>SET CHECKPO I NT<><><><>
; GO TEST I F EXCEPT I ON WAS EXPECTED

MOV
JMP

AL.9CH
TEST_EXC

; <><><>SET CHECKPO I NT<><><><>
; GO TEST I F EXCEPT! ON WAS EXPECTED

MOV
JMP

Al.9DH
TEST_EXC

; <><><>SET CHECKPO I NT<><><><>
; GO TEST IF EXCEPTION WAS EXPECTED

MOV
JMP

Al.9EH
TEST_EXC

; <><><>5ET CHECKPO I NT<><><><>
; GO TEST I F EXCEPT I ON WAS EXPECTED

MOV
JMP

AL.9FH
TESCEXC

; <><><>SET CHECK PO I NT<><><><>
; GO TEST IF EXCEPTI ON WAS EXPECTED

MOV
JMP

Al.OAOH
TEST_EXC

; <><><>$ET CHECKPO I NT<><><><>
; GO TEST IF EXCEPTION WAS EXPECTED

MOV
JMP

TEST_EXC

; <><><>SET CHECKPO I NT<><><><>
; GO TEST IF EXCEPTI ON WAS EXPECTED

MOV

AL,OAZH

; <><><>5ET CHECKPO I NT<><><>...:::>

EXC_1O:
BO 9A
E9 0007 R
EXC_ll:
BO 9B
E9 0007 R
BO 9C
E9 0001 R

EXC_12:
EXC_13:

BO 90
E8 7E 90
EXC_14:
80 9E
EB 79 90

SET SECOND TO 07FFFH

: <><><>5E1 CHECKPO I NT<><><><>
: GO TEST IF EXCEPTION WAS EXPECTED

EXC_15:

BO 9F
EB 74 90
EXC_16:
BO AO
EB 6F 90
EXC_17:
BO A1
E8 6A 90

AL.OA1H

EXC_18:

80 A2

Test 5 5-73

EB 65 90
80 A2

t~Ov

00 f'j

[B 60 90

JMP

0078
0078
007A
0070
0070
007F
0082
0082
0084
OD87
0087
0089
008C
D08C
OU8E
0091
0091

0093
0096
0096

BO A3

MOV

[6 5B 90

JMP

SO A4

MOY

EB 56 90

JMP

BO A5

MOV

00C5

AL,OA3H
TE5T_EXC

; <><><>5ET CH EGKPO I NT <><><><>
; GO TEST I F EXCEPT I ON WAS [XPECTED

AI"OA4H
TESl_EXC

; <><><>5ET CHECKPO I NT<><><><>
; GO TEST I F EXCEPTION WAS EXPECTED

AL, DASH
TEST_EXC

; <><><>5ET CHECKPO I NT<> <><><>
; GO TE5T I F EXCEPT I ON WAS EXPECTED
; <><><>5[T CHECKPO I NT<><><><>
; GO TEST I F EXCEPT I ON WAS EXPECTED

JMP

MOV
JMP

AL,OA6H
TEST_EXC

60 A7
EB 47 90

MOV
JMP

AL,OA7H
TEST_EXC

; <><><>$ET CHECKPO I NT <><><><>
; GO TEST I F EXCEPT I ON WAS EXPECTED

BO AB
E6 42 90

MOV
JMP

AL,OA8H
TEST_EXC

; <><><>SET CHECKPO I NT<><><><>
; GO TEST IF EXCEPTION WAS EXPECTED

80 A9

MOV
,JMP

AL,OA9H
TEST_EXC

; <><><>5[T CH ECKPO I NT<><><><>
; GO T[ST I F EXCEPT I ON WAS EXPECTED

~10V

AL, OAAH
TEST_EXC

; <><><>SET CHECKPOI NT<><><><>
; GO TE5T I F EXCEPT I ON WAS EXPECTED

AL,OABH
TEST_EXC

; <><><>SET GH ECKPO I NT <><><><>
; GO TEST I F EXCEPT ION WAS EXPECTED

AL,OACH
TEST_EXC

; <><><>SET CH ECKPO I NT<><><><>
; GO TEST ! F EXCEPT I ON WAS EXPECTE[)

AL,OAOH
TEST_EXC

; <>"'--""'''5ET CHECKPO I NT <><><><>
; GO TEST IF EXCEPTION WAS EXPECTED

AL,OAEH
TEST_EXC

; <><><>SET CH ECKPO I NT<><><><>
; GO TEST I F EXCEPTION WAS EXPECTED

AL,OAFH
TEST_EXC

;<><><>SET CHECKPOINT<><><><>
; GO TEST I F INTERRUPT WAS EXPECTED

AL,OBOH
fEST_EXC

; <><><>SET CHECKPO I NT <><><><>
; GO TEST I F INTERRUPT WAS EXPECTED

60 AA
E8 38 90

00C3

; <><><>SET CHECKPO I NT<><><><>
; GO TEST I F EXCEPTION WflS EXPECTED

51 90

ES 3D 90

ooeo
ooe3

JMP

MOV

80 AB
EB 33 90

80 AC
E6 2E

JMP

MOV

90

JMP

MOy

BO AD
EB 29 90

JMP

BO AE

MOV

EB 24 90

JMP

80 AF
E8 1 F 90

MOV

60 130
EB 1A 90

MOV

JMP

JMP

JMP

AL,061H
TEST_EXC

; <><><>SET CH ECKPO I NT <><><><>
; GO TEST I F INTERRUPT WAS EXPECTED

so

B2
EB 10 90

MOV
JMP

AL,082H
TEST_EXC

; <><><>SET CHECKPO I NT <><><><>
; GO TEST IF IIHERRUPT WAS EXPECTED

BO 63
EB OB 90

MOV
JMP

AL,063H
TE5T_EXC

; <><><>$ET CHECKPO I NT<><><><>
; GO TEST I F INTERRUPT WAS EXPECTED

MOV

AL,OB4H
TEST_EXC

; <><><>5l T l:HECKPO I NT<><><><>
; GO TEST I F INTERRUPT WAS EXPECTED

AL,OB5H
TEST_EXC

; <><><>SET CHECKPO I NT<><><><>
GO TEST I F INTERRUPT WAS EXPECTED

MOY

BO S1
EB 15 90

OOC8

ooca

OOCA
OOCD
OOCD
OOCF
0002
0002
0004
0007
0007
0009
0008
DODD
OOOE
OOOF
00E2
DOEll
DOEA
OOEF
00F2
OOFII
OOF5
00F6

oon

OOFB
OOf9
OOFC
DOFE
OOFF
OOFF
0101
0103

0105
0107
0107
0109
010B
0100
alOE
alOE
0110
0112
0113

SYS 37:
BO 64
EB 06 90
BO BS
E8 01

90

E6 80
3C AE
77 22

JMP

MOV
JMP
TEST [XC;
OUT
CMP

JA

PUSH
PUSH
MOV
MOV
MOV
MOV
MOY
MOV

1E

50
B8
8E
C7
c6
88
8E
58
1F
5A

0008
08
06 0048 FFFF
06 0040 93
0048
CO

POP
POP
POP
POP

59

PUSH

51
83 F9 40
75 01
52
86
E4
3A
74

Cf~P

JNZ
PUSH
TEST EXCO;
XCHG
IN

EO
88
C4
OF

CMP

JZ
TEST_EXC1;
IN

E4 80
3C 3fl
72 01
CF

CMP

JB
TEST

86 EO
E6 80

EXC2:
XCHG
OUT

OUTPUT THE CHECKPO I NT
CHECK FOR EXCEPT ION
GO I F A SYSTEM I NT

OS

SAVE THE CURRENT DATA SEGMENT

AX

flX,GDT PTR
OS,AX ;
os: ES_ TEMP. SEG_L I MIT, MAX_SEG_LEN
BYTE PTR OS: (ES_ TEMP. DATA ACC_R I GHTS) ,CPLO_DATA_ACCESS
AX, ES TEMP
E5,A)C
AX
RESTORE REGS
OS

OX

CHECK

I F CODE SEG SECOND ON STACK

cx
ex
CX,SYS_ROM_CS
TEST_EXCO
ox

CONTINUE I F ERROR CODE
PUT SEGMENT BACK ON STACK

AH,AL
AL,OMA PAGE+OAH
AL, AH JEST_EXC3

WAS THE EXCEPT I ON EXPECTED?
GO I F YES

SAVE THE CHECKPOINT

AL,MFG_PORT
AL,03BH
TEST_EXC2

CHECK THE CURRENT CHKPT
HALT IF CHKPT BELOW 3BH

AH,AL
MFG_PORT, AL

OUTPUT THE CURRENT CHECKPO I NT
<><><> CKPT 90 THRU B5 <><><>

HLT

Fli
EB F9

JMP
TEST EXC3;
SUB
OUT

2A CO
E68B
B80100
Cf

5-74

MFG PORT,AL
AL,OAEH
TEST_Exeo

IRET

0115
0115
0117
0119
OllC
0110

I F EXCEPT I ON WAS EXPECTED

AL,OA2H
TEST_EXC

80 A6
EB 4C 90

EB

0098

0084
0084
0086
0089
0089
OOBB
OOBE
OOSE

GO TEST

EXC_19:

0098
0096
0090
DOAO
OOAO
00A2
OOA5
OOA5
OOA7
OOAA
OOAA
OOAC
OOAF
aOAF
0081

;

JMP

0070
0073
0073

MOV
IRET

CODE

Test 5

ENDS
END

TEST_EXC2

I NSURE SYSTEM HALT

AL,AL
DMA_PAGE +OAH, AL
AX, 01 DOH

CLEAR DMA PAGE
USED FOR BOUND
RETURN

I NSTR EXPECTED I NT5

TITLE 01/03/84 TEST6 POWER ON SELF TEST
. LI ST
PUBL I C
STGTST CNT
PUBL I C ROM ERR
PUBL I e
BOOT STRAP 1
PUBLIC
XMIT-B042PUBLI C
POSTt;
PUBLIC
H5
I NCLUOE SEGMENT. SRC
CODE SEGMENT BYTE PUBLI C

0000

EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
[XTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
PAGE

POST6

0000

;
;

0000
0000
0002
0004
0006
0008

OOOA
OOOC
OOOE

88 09
E4
EB
DC
E6
E8
24
E6

61
00
OC
61
00
F3
61

SA
89
28
28
88
AB
2B
AD
33
74
E9
D1
E2

0001
0010
FF
F6
C2

EO: NEAR
E MSC: NEAR
KSD_RESET: NEAR
BYTE; NEAR
F 1; NEAR
VECTOR TABLE:NEAR
NMI INT:NEAR
PR I NT _SCREEN_l : NEAR
BLINK_INT:NEAR
PRT_HEX:NEAR
F3B: NEAR
PRT SEC: NEAR
XPC-BYTE: NEAR
El: NEAR
ROM CHECK: NEAR
ROS:=CHECKSUM: NEAR
SEEK: NEAR
f3:NEAR
ERR_BEEP; NEAR
P MSG:NEAR
START 1: NEAR
F4;NEAR
F4[; N[AR
DDS: NEAR
F3A: NEAR
o ISK_BAS[; NEAR
F3D: NEAR
PRoe SHUTDOWN: NEAR
SYS I N I T1 : NEAR
PROT _PRT _HEX: NEAR
DISK 10:NEAR
HD I NT: NEAR
C8042; NEAR
tWOI_INVA:NEAR

xrc

ASSUME
ASSUME

CS: CODE
os: DATA

PROC

NEAR

TH I S SUBROUT I NE PERFORMS A READ/WR I TE STORAGE TEST ON A BLOCK
Of STORAGE.
ENTRY REQU I RnlENTS:
ES = ADDRESS OF STORAGE SEGMENT BE I NG TESTED
OS '" ADDRESS OF STORAGE SEGMENT BE I NG TESTED
CX == WORD COUNT OF STORAGE BLOCK TO BE TESTED
EXI T PARAMETERS:
ZERO FLAG = 0 IF STORAGE ERROR (DATA COMPARE OR PARITY
CHECK). AL=O OENOTES A PAR I TV CHECK. [LSE AL=XOR' ED
B IT PATTERN OF THE EXPECTED DATA PATTERN VS THE ACTUAL
DATA READ.
AX,BX,CX,DX,OI, AND 51 ARE ALL DESTROYED.

STCTST eNT
- MOV

IN
JMP
OR
OUT
JMP
AND
OUT
;~-------

~OlO

0013
0016
0018
OOlA
D01C
001D
001 F
0020
0022
0024
0027
0029

el ;

F6
C2
03
DOCS R
E2
EB

PRoe
NEAR
BX,CX
AL, PORT_B
SHORT $+2
Al ,RAM_PAR_OF f
PORT_B,AL
SHORT $+2
AL, RAM PAR ON
PORT_B-:-AL -

SAVE WORD COUNT OF BLOCK TO TEST
10 DELAY
TOGGLE PAR I TY CHECK LATCHES
10 DELAY

ROLL A BIT THIWUGH THE FIRST WORD

MOV
MOV
SUB
SUB
t-lDV
STOS ....
SUB
LOOSW
XOR
JZ
JMP
SHL
LOOP

OX,OOOlH
eX,16
DI,DI
SI,SI
AX,DX
51,51
AX, OX
01 A
C13
OX,l

C1

WRITE THE IN IT OATA PATTERN
ROLL 16 BIT POSITIONS
START AT BECININC OF BLOCK
INITIALIZE DESTINATION POINTER
GET THE PATTERN
STORE DATA PATTERN
START AT BEGINNING
GET THE FIRST WR I TrEN
INSURE DATA AS EXPECTED
EX I T I F NOT
SHIFT BIT TO NEXT BIT POSITION
LOOP TILL DONE

;-------- CHECK CAS LINES FOR HIGH BYTE LOW BYTE
0028
0020
002F
0031
0034
0035
0038
0036
0030
003f
0041
0043
0046
0048
004A
0040
004E
0050
0053
0055
0057
0059

28
28
28
BA
AB
BF
C6
28
8B
33
74
E9

28
28
8A
AB
28

FF
F6

CO
FFOD
0001
05 Ff
Ff

as

e2
03
00C5 R
FF
CO
OOFf
fF

c6 05 FF

2B rr
8B 05
33 C2
75 6A

-

C1 B,

START AT BEGINING OF BLOCK
; INITIALIZE DESTINATION POINTER
; WRITE 0

SUB
SUB
SUB
to\DV
STOSW
MOV
MOV
SUB
MOV
XOR
JZ
JMP

DI,OI
S I, S I
AX,AX
DX,OFFOOH

e13

EXIT

SUB
SUB
MOV
STOSW
SUB
MOV
SUB
MOV
XOR
JNZ

01,01
AX,AX
DX,OOOFFH

START AT BEGINING OF BLOCK
WR I T[ a

01,1
BYTE PTR [OI},OfFH
01,01
AX,WORD PTR [01]
AX,DX
C1 B

01,01
BYTE PTR [01 ],OFFH
01,01
AX,WORD PTR [DI}
AX,OX

C13

; STORE DATA PATTERN
; AT THE FIRST ODD LOCATION
; WRITE A BYTE OF FF
GET THE DATA
CHECK THE FIRST WRITIf:.N
IF NOT

STORE DATA PATTERN
AT THE FIRST EVEN LOCATION
WRITE A BYTE OF Ff
BUS SETTLE
GET THE DATA
CHECK THE fiRST WRITTEN
EXI T I F NOT

;------- TEMP SAVE FOR AX (PUSH NOT ALLOWED)
005B
0050
005F
0061

E6
86
EB
E6

89
C4
00
BA

OUT
XCHG
JMP
OUT

DMA PAGE+B, AL
AL,AH
SHORT $+2
DMA_PAGE+9,AL

SAVE AX

Test 6 5-75

; -------- CHECK

006-(
0069
0068

E4
24
86
Ell
22

006D
006F
0071

E4 8A
86 01
E4 89

0063
006~

IN
AND
XCHG
IN
AND

61
CO

eLI
87
EO

10 OR BASE RAM
CHECK fOR 10/PAR CHECK
STR I P UNWANTED 8 I TS
SAVE ERROR
CHECK FOR R/W OR 10 ERR

AL, PORT B
AL, PARITY_ERR
AL,AH
AL,DMA PAGE+6
AH,AL -

; ------- RESTORE AX
IN
XCHG
IN

GET AH

AL,OMA_PAGE+9
AL,AH
AL,DMA_PAGE+8

GET AL

;-------- PARITY ERROR EXIT

0073
0075
0078
007A
007C
007E
0080
0082
00811
0086
0087
0089
008B

75 50
BA AA55
28 FF
26 F6
88 CB
88 C2
F3/ AS
8B C8
26 F6

JNZ
MDV
C3:
C4:
C5:

Mav
Mav
RE?
Mav
SUB

C6:

AD

SUB
SUB

33 C2
75 3A
E2 F9

GO I F YES
WRITE THE INIT DATA PATTERN
START AT BEGINING Of BLOCK
INITlALlZ[ DeSTINATION POINTER
SETUP BYTE COUNT fOR LOOP
GET THE PATTERN
STORE 64K BYTES (32K WORDS)
SET COUNT
START AT RFG INN 1 NG
GET THE FIRST WR I HEN
I NSURE DATA AS EXPECTED
EXIT IF NOT
LOOP T J LL DONE

C13
DX,OAA55H
[)I,DI

51,51
CX,BX
AX,DX
STOSW
CX,BX
SI,SI

LOOSW

xaR

JNZ
LOOP

AX,OX

en
e6

;------- TEMP SAVE FOR A:X (PUSH NOT ALLOWED)
0080
008F
0091
0093

E6
86
EB
E6

0095
0097
0099
0098
0090

E4
24
86
E'-1
22

009F
OOAl
eOA3

E4 8A
86 C4
E4 89

OUT

89
C4

00

XCHG
JMP

8A

OUT

SAVE AX

DMA_PAGE+8, AL
AL,AH
SHORT $+2
DMA_PAGE+9,AL

; -------- CHECK 10 OR BASE RAM
61

IN

C4
87
EO

AND
XCHG
IN
AND

co

CHECK FOR IO/PAR CHECK
STR! P UNWANTED BITS
SAVE ERROR
CHECK fOR R/W OR 10 ERR

AL, PORT_B
AL, PAR I TY ERR
AL,AH
AL,OMA PAGE +6
AH,AL -

; ------- RESTORE AX

IN
XCHG
IN

GET AH

AL,DMA_PAGE+9
AL,AH
AL,OMA_PAGE+8

GET AL

;-------- PARITY ERROR EXIT
aOA5

JNZ

75 1 E

GO

C13

Jf

YES

; ------- CHECK fOR END Of 64K BLOCK
AND
JZ

23 02

OOA7
00A9

74 lA

OOAB
OOAf
OOBl
00135
00B7
OOBA

81
74
81
74
BA
EB

OOBC
OOBE

2B 02
EB B8

FA 55AA
Of
FA 0101
Of
55AA
Be

ENDING ZERO PATTERN WRITTEN TO STC ?
YES - RETURN TO CALLER WITH AL=O

OX,OX
C14

;------- SETUP NEXT PATTERN
CMP
OX,055AAII
JZ
C9
eMP
OX,0101H
JZ
C10
MOV
DX,055AAH
JMP
C3

CHECK I F LAST PATTERN =55AA
GO I F NOT
LAST PATTERN 0101?
CO I F YES
WRITE 55AA TO STORAGE

; -------- LAST PATTERN = 0000
C8:

SUB

OX,OX

JM?

C3

;-------OOCO
00C3

BA Ul01
EB B3

C9:

Mav
JM?

; --------

00C5
OOC5

C13:
C14:

C3

; WR I TE 0000 TO STORACE

INSURE PARITY BITS ARE NOT STUCK ON
OX,OlOIH

;

WRITE 0101

TO STORAGE

C3

lX I I

RET

;------- CHECKER BOARD TEST
eOC6
OOC8
OOCA

ooce
OOCf
DODO
0003
0004
0006

0001;1
OODA
OODC
0000
OOEO
00E2
00E3
00£6
00E8

2B FF
8B CO
01 E9

C10:

SUB

01,01

B8 5555

Cll:

MDV
SHR
MDV
STOSW
Mav

eX,BX
eX,l
AX, 010 1a 101 01 0 1 0 101 B

LOOP

ell

AS

B8 AAAA
AB
~7 f6
28 f6
8B CB
01 E9
AD
35 5555
75 E3
AD

35 AAAA
75 00
E2 F2

srosw

51,51

MUV

CX,BX
CX,l

SHR

C12:

AX,1010101010101010B

SUB

LODSW
XUR

AX, 0101010101 010 101 B

JNZ
LODSW

C13

XOR

AX,1010101010101010B

JNZ
LOOP

e12

en

PO I NT TO START 0 F BLOCK
GET THE BLOCK COUNT
DIVIDE BY 2
fiRST CHECKER PATTERN
WRITE IT
SECOND CHECKER PATTERN
WRITE IT
00 I T FOR CX COlJNT
PO I NT TO START OF BLOCK
GET THE BLOCK COUNT
DIVIDE BY 2
GET THE DATA
CHECK CORRECT
EXIT IF NOT
GET NEXT DATA
GO I F NOT CORRECT
CONT I NUE TILL DONE

; ------- TEMP SAVE fOR AX (PUSH NOT ALLOWED)
OOEA
OOEC

OUT

E6 89
86 C4

5-76

XCHG

Test 6

DMA_PAGE+8,AL
AL,AH

SAVE AX

ITLE 12/28/83 TEsn EXCEPTION

INTeRRUPT TEST

TEST.20
ADD I T IONAL PROTECTED (Y 1 RTUAL HODE) TEST
DESCHI PT ION
THE PRoceSSOR I S PUT IN PROTECl ED MODE AND
1HE ~ OllOW I NG FUNCT IONS ARE VER I F I ED
1.

2.
3.

4.

5.
6.

7.

8.

9.

10.

11.
12.

13.

VER I FY PROTECI LlJ MOUt:
THE MACHINE STATUS IS CHECK rOR VIRlUAL MODE
PROCRAHMED I NTERRUPT TEST
AN PROGRAMM[O INTERRUPT 32 IS ISSUED AND
AND VER I F I ED
lXCEI"1 ION INT 13 lEST
A DESCRIPTOR SEGMENT LIMIT IS SET TO ZERO
AND A WRITE TO THAT SEGMENT IS ATTEMPTED
AN EXCEPT 1ON 13 I S EXPECTED AND VER I r I ED
LD1/SDT LTR/STR TEST
lOAf) lOT REGISTEH AND VERIFY CORRECT
I DAD TASK REG I STER AND VCR I FY CORRECT
THEY AR~_ VERIFIED VIA THE srORE INSTRUCTION
T1IE CONTROL FLAGS OF THE 286 rOR DIRECTION
ARE VERifiED VIA THE STD AND CLD COMMANDS
I N PROTECTED MODE
UOlJND INSTRUGTION TEST (EXC INT 5)
CREATE A SIGNED AHRAY INDEX WITHIN AND
OUTSIDE THE LIMITS.
CHECK THAT NO EXC INT
If WITHIN LIMIT AND THAT AN EXC INT 5
OCCURS IF OU1SIDE TilE LlMITS.
PUSH ALL POP AL.L TEST
SET ALL GENERAL PURPOSE REGS TO 01 FFERENT
VALUES I SSUE A PUSH ALL, CLEAR THE REGS
I SSUE A POP ALL AND VER I FV CORRECT.
CHECK THE VERR/VERW INSTRUCTIONS
THE ACCESS BYTE I S SET TO READ ONLY THEN TO
A WRITf ONLY AND THE VERR/VERW INST ARE
VERIFIED.
CAUSE AN INTERRUPT 13 VIA A WRITE TO A
READ ONLY SEGMENT
VERIFY THE ARPL INSTRUCTION FUNCTIONS
SET THE RPL FIELD OF A SEt ECTOR AND
VERIFY THAT CURRENT SELECTOR RPL IS SET
CORRECny.
VER I FY THE lAR I NSTRUCT I ON FUNGT IONS
V[[,IFY THE LSL INSTRUCTION FUNCTIONS
LOW I~EG CH I l' SELECT TEST

POST7
INCLUDE S[GMENT. SRC
CODE SEGMENT BYTE PUBLIC

0000

0000
0000
0003
0005

EXTHN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN

E MSG;NEAR
x·PC BVTE:NEAR
F1; NEAR
VECTOR TABLE: NEAR
PRINT SCREEN:NEAR
BLiNK-INT:NEAR
pRT HEX: NEAR
F3B:NfAR
PRT _SEG: NEAR
XPC BYTE; NEAR
E 1 ; NEAR

EXTRN
EXTRN
EXTRN
EXTRN
(XTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
!::XTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXfRN
[XTRN
(XTRN
[XTRN
EXTRN
EXTRN
EXTRN

F3 ;NEAR
EHI~ BEEP: NEAR
P MSG:NEAR
START l;NEAR
fJI:N[AH
filE; NEAH
F3A; NEAR
DISK BASE: NEAR
F30: NEAR
rJD1: NEAR
PROC SHUTDOWN: NEAH
SVSINIT1:NFAR
PROT I>RT HEX: NEAR
DISK-rO:NEAR
Hll INT;NfAR
CB042: NEAR
OBF 112:NEAR
SlG1SI CNI;NEAR
BOOT STRAP l;NEAR
XM I T-BOI.J2; NEAR
ROt~ ERR;NEAR
DDS;NEAR
CM1 :NEAR
CM2: NEAF\
CM}: NEAR
LOCK:N[AR
DISK 'SETUP; NEAR
ADERR: NEAR
ADERR1; NEAR
ASSUME
CS; CODE, DS:DATA
PIWC
CAL.L
DDS
MOV
Al,OFOH
OUT
MFG_PORT, AL

POST?
[8 0000 E
60 FO
E6 80

;

SET DATA SEGMENT

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT FO <><><><>

---- SET SHUTDOWN RETURN 7
0007
0009
00013
0000

Dour

BO 8F

MOV

,6 70

OUT

BO 07
EB 00
E6 71

JMP

~lOV

OUT

AODR

AL, SHUT DOWN
CMOS_PORT, AL
Al,7
SHORT $+2
CMOS_PORT+1,AL

FOR SHUTDOWN BYTE

SET ERROR EX I T (DOUBLE EXECPT ION? )
10 DELAY

; -------' ENABLE PROTECTEO MODE
0011
0014
0016

BC 0000
8E 04
BC 8000

UU1Y

[8 0000 E

MOV
MOV

SP, POST_SS
SS,SP
SP, POST_SP

CALL

SYSINIT1

I~OV

SET STACK FOR SYS I N I T1

;

CO ENABLE PROTECTEO MODE

; ------- SET TEMPORY STACK

DOle
001 F
0021
0023

002A
0030
0033

B8 0008
8E CO
8E 08
26: C7 06 005A 0000
26: C6 06 005C 00

BE 005B
8E 06

MOV
MOV
MaV
MOV
MOV
MOY
MOV

AX, GOT PTR
FS, AX OS,AX
ES: SS TEMP. BASE LO WORD,
BYTE PTA ES:(SS=TEMP.BASE_HI_BYTE),O
SI ,S5 TEMP
SS,SI-

°

Test 7 5-77

0035

MOV

BC FfFO

SP, MNCSEG_LEN-2

; ------- ;VER~FY-PROTE;;TEO-MODE
;
0038
0039
0039
0038
0039
0039
0038
0038
003E
0040

OF

0043
0045

BO f1
E6 80

0047
0049
0048
0040
004F
0051
0053
0055
0057

BO
E6
CO
2B
E4
22
EO
74
E9

005A
005C

BO f2
E6 80

005E
0060

BO 90
E6 88

01 EO

+
+ 110000
+
+ 110001
+

---------------------

5MSW

AX

DB

LABEL

OOFH
BYTE

SHL

AX,1

LABEL

GET THE MACHINE STATUS WORD

01

DB

A9 0001
75 03
E9 02EA R

JMP

BYTE
OFFSET C5: 110000
00lH
OFFSET CS: 110001
AX, V I RTUAL_ENABLE
T7_1
ERROR_EXIT

MOV
OUT

AL,OFlH
MfG_PORT ,AL

DRG
ORG
TEST
JHZ

T7_1:

;

ARE WE I N PROTECTED MODE

;

ERROR I F NOT

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT F1 <><><><>

; ---- ---!. -~NTERRU;T-TE;;-( ;ROGR;~MED- ~;rERRU ;r-32i
~OV-----~L:O~;~--------------------------- SET EXCEPTION FLAG

AF
88
20
C9
88
CO
fA
03
02EA R

LOOP1:

OUT
INT
SUB
IN
AND
LOOPNZ

OMA_PAGE+OAH,AL
32
CX,CX
AL,OMA_PAGE+OAH
AL,AL
LOOPl

j~p

~~R~R_EXIT

FOR INT 10
INTERRUPT
WAIT FOR INT
DID THE 1NTERRUPT OCCUR?
MISSING INTERRUPT

; -------- CAUSE AN EXCEPTI ON INTERRUPT (GENERAL PROTECT I ON I NT 130)
; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT F2 <><><><>

AL,OF2H
MFG_PORT. AL
MOV
OUT

SET INT 13 FLAG
FOR THE I NT HANDLER

AL,9DH
OMA_PAGE+OAH, AL

; ------- MOO I FY DESCR I PTOR TABLES

.-------------------------------------------------- -------- ---------------------

; -------. SET TEMP ES OESCR I PTOR TO SEGMENT LI MI T
;
0062

;

MOV

C7 06 0048 0000

SET SEGMENT TO 0

;------- CPLO, DATA ACCESS RIGHTS
0068
0060
0072

C6 06 0040 93
C6 06 004C 01
C7 06 004A 0000

0078
007B

B8 0048
BE CO

HOV
MOV
MOV

BYTE PTR OS:, ES_ TEMP. OATA_ACC_R I GHTS), CPLO_DATA_ACCESS
BYTE PTR OS:(ES_TEMP.BASE_HI_BYTE),Ol
; 00 ALL TESTS ON 2ND 64K
WORD PTR OS: (ES_TEHP. BASCLO_WDROI. 0

; -------- SET ES REG I STER

0070
007F

26 FF
26: 88 05

0082
0084
0086
0088
aOBA
OOBC

2B
[4
22
EO
74
E9

MOV
MOV

LOAD ES

AX, ES_TEMP
ES,AX

;------- CAUSE AN EXCEPTION 13 INTERRUPT
SUB
01,01
MOV
AX, ES: (01 ]

c9

SUB

LOOP2:

8B
CO
FA
03
02EA R

IN
AND
LOOPNZ
JZ
JMP

TH I 5 SHOULD CAUSE AND EXCEPTI ON
WAIT FOR INT

CX,CX
AL,OMA_PAGE+OAH
AL,AL
LOOP2
T7 3
ERROR_EXIT

DID THE INTERRUPT OCCUR?
CONT 1NUE I F INTERRUPT
M I S5 I NG INTERRUPT

.-------------- --------------- ------------ -------

DoaF

y~~+~~C~~gNtOTjSOT

;

LTR/STR

; DESCR I PT I ON
LOAD LOT REGISTERS WITH A DESCRIPTOR
VER I fY CORRECT

;

--------------------- ---------------------------

; ------- WR I TE TO 286 LOT REGI STER
OOBf
0091
0093
0096
0097
0097
0099
0097
0097
0099

BO F3
£6 80
Bf 0078
OF
8B 07

00

+
+ 1?0002
+
+ 710003
+

+

MOV
OUT
I.lJOV
LLOT
DB
LABEL
MOV
LABEL
ORG
OR

ORG

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT f3 <><><><>

AL,OF3H
MFG PORT ,AL
OI,POST_LDTR
01
OOFH
BYTE
OX,OI
BYTE
OFFSET CS: 110002
OOOH
OFFSET CS:??0003

REGISTER FROM THIS AREA

; ------- READ AND VER I FY 266 LOT SELECTOR
0099

2B CO

009B
009C
OOgc
009E
00ge
009C
009E
D09E
DOAl
00A4

OF

25 00f8
3D 0078
75 1B

00A6

BF 0068

00A9

OF

+

DB

8B OF

+ 110006
+
+ ??0007

LABEL
MDV
LABEL
DRG
DB

SUB

SLOT
03 CO

+
+ 1?0004
+
: 1?0005

DB

LABEL
ADD
LABEL

ORG
DB

00

ORG
AND
eMP

JNZ

AX,AX
AX

OOFH
BYTE
AX,AX
BYTE
OFfSET cs: 1?0004
OOOH
OFFSET cs: ??0005
AX,OF8H
AX, POST_LOTR
ERROR

; CLEAR AX
; GET THE LOT SE.LEC10R

STR I P TI jRPL
CORRECT SELECTOR?
GO IF NOT

; -------- WR I TE TO 286 TR

OOAA
DOAA
OOAC

DOAA
DDAA

MOV

+
00

OOAC

LTR

ORG

01, POST_TR
01
OOFH
BYTE
BX,OI
BYTE
OFfSET CS: 710006
OOOH
OffSET cs: 110007

;------- VERIFY 286 TR REGISTERS

5-78 Test 7

REG I STER FROM TH I S AREA

OOAC

28 CO

OOAE
OOAr
OOAF
0081
OOAF
OOAF
OOBl
00131
00B4
00137

OF

..
+

88 C8

??0008

+ ??0009

SUB

AX, AX

5TR

AX

08

OOFH
BYTE
CX,AX
BYTE
OFfSET CS; ??0008
OOOH
OFFSET CS: ??0009
AX,OFBI!
AX, POST TR
ERROR
-

LABEL

Mav

00

LABEL
ORO
DB

25 OOF8
3D 0068
75 08

ORG
AND
eMP
JNZ

eET THE TR

REG

CORRECT SEL[CTOR?

;-------- TEST 286 CONTROL FLAGS
00139
OOBA
OOBB
OOBe
OOBF
OOC1

STD
PUSljF
I'OP
TEST

FO
9C

58
A9 0200
14 03

[9 02EA R

ERROR:

T7 - 4,

OOC4

OQC4
OUC7
OQC9

aoce

OOGO
OOGE
Doer
0002
0004
0007

A9 0400
75 03
E9 02EA R

T7 -~:

FC

SeT 0 I RECT I ON FLAG FOR DECREMENT

GET THE FLAGS
AX
INTERRUPT FLAG SHOULD BE OFF
CONT I NUE I F OFF
GO I F NOT

AX,02001i

JZ
JMP

17 4

TEST

AX,0400H

JNZ
JMP

ERROR EXIT

ERROR

r7

~-

EXIT

CHECK DIRECTION FLAG

5

GO I F NOT SET
CLEAR DIRECTION FLAG

-

CtD

INSURE DIRECTION

PUSHF

9C

POP

A9 0400
03
E9 02EA R

TEST

AX,0400H

JZ
JMP

17 6

71~

FLAG

IS RESE.T

AX

58

ERROR EXIT

GO

-

I F NOT

VCR I FY 286 BOUNO I NSl RUCT I ON
DESCR I PT I ON
CRFATE A SIGNED ARRAY INDEX WITHIN AND
OUTSIDE THE LIMITS (EXPECT Ii'll 5)

0007
0009
0008
OOoE

80 F4

MOV

E6 80
88 0048
8E CO

MOV

ODED
00E2

26:

C7

00E7

26:

C7 45 02 7fFF

ODED
OOEf

OUT
t<\OV

; <><><><><><><><><><><><><><>
;<><><>CHECKPOINT F4 <><><><>

AL,OF4H
MFG PORT,AL
AX,ES_TEMP
[S .. AX

; ------- CHECK tlOUNU

LOAD ES REGI STER

fUNCT IONS CORRECTLY

rOINT IH.GINING OF THE BLOCK
SET FIRST WORD TO ZERO

SUB
MOV

01, DI
WORD PTR [S:[OI],O

MOV

WORD PTR ES: [0 I +2], 07rFFH ;

130 95
E6 813

MOV
OUT

AL,09:;'H
DMA_PAGE +OAH, AL

SET

OOFl

138 1000

SET AX WITHltj BOUNDS
USE THE" ES REG

26

MOV
SEGOV
DB

AX,1000H

OOF4

28 FF

os

0000

BOUND

00F·5
OOF5
OOf 7
OOFS
OOfS
00F7
00F7
DOF9
OOFB
OOFD
OOFt
0101
0104

+ ??OOOB

88 05

+
+ ??OOOC

62
28
E2
E4
3C

SUB

G9
FE

LABEL
MOV
LAt3LL
ORG
DB
ORO

LOOPA:

88
00
7'y 03
E9 02EA R

LOOP
IN
eMP
JNZ
JHP

E5
026H
AX, (01]
BYTE
AX, (01]
(lYTE
OFFSET CS:??OOOB
062H
OFFSET CS: ??OOOC
CX,CX
LOOPA
AL, DMA_PAGE +OAH
AL,O

0106

26:

ERROR_EXI T

MOV

SEGOV

ES

26

DO

026H
AX, [DI]
BYTE
AX, [01 I
BYTE
OFFSET eS:??OOOE
062H
OFFSET CS:??OOOF
cX,ex

+ ??OQO[

BOUND
LA!3[L
MOV

88 05
+ ??OOOF

LABEL
ORO

OB

62

ORe
SUB

2B C9

AX OUT OF BOUNDS
USE THE ES REG

AX,10aOH

BB 1000

alOE

S(T

WA I T

IN

[4 8B
3C 00
EO FA
74 03
£9 OZEA R

eMP

LOOPNZ
JZ
JMP

I NTERRU PT

GET THE RI:.SULTS
DID AN I NT[RRUPT OCCUR?
TRY AGAIN
CONTINUE IF INTERRUPT
CO I F NO I NTERRU PT

AL,DMA_PAGE+OAH
AL,OH
LOOPS

178
EHfWR_[XI T

AL,95H
OMA_PAGE +OAH, AL

all E
0120

BO 95
£6 8B

0122
0124
0129
012F

2B FF
26; c7 05 0000

SUB
MDV

26: C7 45 02 OHF
138 1000

MOV

~10V

SEGOV
0132

FOR POSS I BLE

LOOPB:

; -------- CHECK HI CH BOUND WORD CAUSES

0133
0133
0135
0133
0133
0135
0135
013"7
0137
0139
01313
0130
013F

INT 5

SUB

Mav

C7 05 3FFO

0108

OlaF
Olor
0111
OlOF
010F
0111
0111
0113
0113
0115
011 7
0119
01113

GET THE RESULTS
DID AN I NTERRUPT OCCUR?
CONT I NUE I F NOT
GO I F YES

T7 I

;-:------- CHECK LOW BOU~O WORD CAUSES

28 FF

INTERRUPT 5 FLAG

WAlT FOR POSSIBLE INTERRUPT

T7 7:

0104

SET SECOND TO 07FFFH

OB

26
813 05

+ ??0011
+
... ??0012

62

BOUND
LABEL
MOV
LA[3[L
ORO
DB
ORC
SUB

28 C9

I NT

5
SET FLAG FOR

INTERRUPT

POINT BEGININC OF THE BLOCK
01,01
WORD PTR ES: (011.0
; SET FIRST WORD TO 0
WORO PTR ES:[DI+2],OFFFH ; SET SECOND TO OFFFH
SET AX OUT OF BOUNDS
AX,1000H
USE THE. ES REG
ES
02611
AX, [DI J
BYTE
AX, [DI I
BYTE
OFFSET CS:??OOl1
062H
OfFSET CS;7?0012
WAIT FOR POSSIBLE INTERRUPT
cX,ex

l.OOpc:
El~

88

IN
CMP

3C 00
FA
74 03
E9 02EA R

LOOPNZ

[0

JZ
JMP

;
;

AL,OMA_PAGE+OAH
AL,OH
l.OOPC

GET THE RESULTS
DID AN INTERRUPT OCCUR?
TRY AGAIN

T7 9
ERROR_EX I T

VERI FY PUSH ALL AND POP ALL
OESCR I PT I ON

GO

IF NO

INTERRUPT

INSTRUCTIONS:

Test 7

5-79

SET REG I STERS TO A KNOWN VALUE AND
PUSH ALL.
RESET THE REG I STERS POPALL
AND VERI FY

0142
0142
0144
0146
0149
014B
014C
014E
014F
0151
0152
0154
0155
0157
0158
0159
015B

BO
E6
B8
8B

'13
8B CB

41
8B D1

42
86 fA

47
86 f7

46

PUSH

55

HOV
INC

88 EE

45

015C
0150
015f
0161
0163
0165
0167
0169

60

0168
016C
016F
0170
0172
0175

61

2B
86
8B
86
86
86
88

; <><><><><><><><><><><><><><>
; <><><>CHEGKPO I NT F5 <><><><>
SET AX",1
SET BX=2

AL,OF5H
MFG_PORT, AL
AX,Ol
eX,AX
BX

SET CX=3

eX,BX
CX

OX,CX
SET OX=4

DX

DI,DX
SET DI=5

DI

$I,DI
SET SI=6
SAVE THE SP REGISTER
SET BP=7

SI
BP

BP,SI
BP

I SSUE THE PUSH ALL COMMAND

PUSHA
DB
SUB
MOV
MOV
MOV
MOV
MOV
MOV

CO
08
CB
DO
Fa
FO
E8

5D

OHA
017C
017F
0181
0184
0186
0189
0188
018E
0190
0193
0193

E9 02EA R

BO F6
E6 80
C7 06 0048 FFFF
C6 06 OOllC 00
C7 06 004A FOO~

OlAB
OlAE

B8 0048
8E CO

01BO

3E

01B1
0162
0182
01B4
0182
01B2
01B4

Df

01B4

75 DO

-

BP SHOULD BE
RESTORE BP
GO I f NOT
AX SHOULD BE
GO I F NOT
BX SHOULD BE
GO I F NOT
CX SHOULD BE
GO I F NOT
OX SHOULD BE
CO I F NOT
01 SHOULD BE
GO I f NOT
SI SHOULD BE
GO I F NOT

BP

CRROR_EX I T1
AX,Ol
ERROR_EXlTl
BX,02
ERROR_EX I 11
CX,03
ERROR EXITl
DX,04ERROR EXI11

01,05ERROR_EX I T1
SI,06
ERROR_EX I T1
T7_10

7
1
2
3
4

5
6

:
:
:
:

------------------ -----------------------------

T7_10:

MOV
OUT
MOV
HOV
MOV

f>IDV
MOV

+ ??0014

+

MOV

+ 710015

+

LABEL
ORG

+

AL,OF6H
; <><><><><><><><><><><><><><>
MFG_PORT,AL
;<><><>CHECKPOINT F6 <><><><>
OS: ES_TEMP.5EG_LlMIT,MAX_SEG_LEN
; SET SEGMENT TO OfffFH
BYTE PTR DS:(ES_TEMP,BASE_HI_BYTE1,O ;S[T THE ADDRESS
OS: ES_ TEMP. BASE_La_WORD, DFDOOH
;
;

AX, ES TEMP
ES,AX-

LOAD ES REG I STER
THIS SEGMENT SHOULD BE WRITEABLE

INSURE ACCESS RIGHTS MAY BE WRITTEN

SEGOV
DB
VERW
DB
LABEL

+

DO

GET THE REG I STERS BACK

061H
BP,07

VER I FY ACCESS R I CHTS FUNCT I ON CORRECTLY
DESCR I PT I ON
SET ACCESS RIGHTS Of DESCRI PTER TO
VER I FV THE VERW/VERR I NSTR
READ ONLY,
ACCESS A READ ONLY WITH A WR I TE AND
VERIFY AN EXCEPTION INT 13

;--------

88 E8

CLEAR ALL REGS

;-----------ERROR [XIT
ERROR EX I T1 :
JMP
ERROR_EXIT

;
0196
0198
019A
OlAD
01A5

060H
AX.,AX
BX,AX
CX,AX
OX,AX
OI,AX
SI,AX
BP,AX

paPA
OB
CMP
POP
JNZ
CMP
JNZ
CMP
JNZ
CMP
JNZ
CMP
JNZ
CMP
JNZ
CMP
JNZ
JMP

83 fD 07
75 21
3D 0001
75 lC
83 FB 02
75 17
83 F9 03
75 12
83 FA 04
75 00
83 FF 05
75 08
83 FE 06
75 03
E8 04 90

0177

MOV
OUT
MOV
HOV
INC
MOV
INC
HOV
INC
HOV
INC
HOV
INC

f5
80
0001
D8

DB
ORC

as

SET SEGMENT OVER I DE TO START Of TABLE

03EH
AX
OOFH
BYTE
BP,AX
BYTE
OFFSET CS:??0014
OOOH
OFFSET CS: ?70015

CHECK THE ACCESS RIGHTS OF ES_TEMP

;

JNZ

ERROR

I F SEGMENT CAN NOT WR I TE

;------- SET ACCESS RIGHTS TO READ ONLY
0186

C6 06 0040 91

MOV

BYTE PTR DS:(ES_TEMP.DATA_ACC_RIGHTS),91H

01B8
01 BE

B8 0048
8E CO

MOV
MOV

AX, ES TEMP
OS

LOAD ES REGISTER

ES, AXSET SEGMENT OVER I DE TO START OF TABLE

OlCO

3E

01Cl
01C2
01C2
01C4
01C2
01C2
OlC4

Of

+

88 E8

+

00

SEGOV
De
VERW
DB
LABEL
MOV
LA6EL
ORG
DB

01C4

74 CD

JZ

ERROR_EX I T1

ERROR 1 F SEGMENT IS WR I HABLE

01C6

B8

MOV

AX, ES TEMP

I NSURE THAT SEGMENT I S READABLE

01C9
OlCA
OlCS
OlCS
01GO
OlGS
OlCS
OlGD
OlGO

+ ??0017

+ ??0018

+

ORG

0048

3E
OF

+

8S £0

+
+ ??0018
+

+ ??OOlA

00
75 C4

SEGOV
DB
VERR
DB
LABEL
MOV

LABEL
ORG

DB
ORG

03EI1
AX
OOFH
BYTE
BP,AX
BYTE
OFFSET CS:??0017
OOOH
OFFSET CS: ??0018

OS

-

03EH

AX
OOFH
BYTE
SP,AX
BYTE
OFFSET C5; ??OOlA
OOGH
OFFSET CS: ??001B
GO I F SEGMENT NOT READABLE

JNZ

;------- CAUSE AN EXCEPTION 13

0101

60 90
E6 86

MOV
OUT

AL,09DH
DMA_PAGE+OAH,AL

0103

28 F6

SUB

51,SI

OlCF

5-80 Test 7

CHECK THE ACCESS RIGHTS OF ES_TEMP

INTERRUPT
SET EXCEPT I ON FLAG
FOR INT 13

0105

26: C6 04 00

0109
o lOB
OlOO
010F
01E1

2B
E4
22
EO

C9
8B
CO
FA

LOOPD:

MOV

BYTE PTR ES:(SI].OO

SUB

CX,CX
AL,OMA_PAGE-+-QAH
AL,AL
LQOPO
ERROR_EX I T1

IN
AND

LOOPNZ
JNZ

75 80

WR I TE A BYTE THAT SHOULD
CAUSE AN EXCEPT I ON
WAIT FOR INT
DID THE

INTERRUPT OCCUR?

MISSING

INTERRUPT

;-------- RESTORE THE ACCESS RIGIITS BYTE

01£3

MOV

C6 06 0040 93

BYTE PTR

os: (ES_ TEMP. DATA_ACC_R I GHTS), CPlO_DATA_ACCESS

VER I FY ADJUST RPl FIELD OF SELECTOR
I NSTRUCT I ON (ARPL) FUNCT IONS
OESCR 1 PT 1ON
SET THE RPL FIELD OF A SELECTOR
AND VER I FY THAT THE ZERO FLAG 1S SET
CORRECTLY AND THAT THE SELECTOR RPL
FIELD IS SET CORRECTLY

;
01E8
OlEA
OlEC
01EF

BO F7
£6 80
138 0048
BB 0060

01 F2

00 0003

-- - - - ---------- -------------------- - --- - -------MOV
MOV

AL,OF7H
MFG PORT,AL
AX,ES_TEMP
BX,OS_TEMP

OR

AX,03H

MOV

OUl

; -------- NOTE BX = FIRST OPERAND
01 F5
01F5
01 F7
01 F5
01 F5
01 F7
01F7
01F9
01 FC
01 FF

8B C3

+ ??OQ1G
+
+ ??OQ1D

+

DB

63
75
80
80
75

ARPL
LABEL
MOV
LABEL
ORG
ORO
JNZ

9A
E3 03
Fe 03
92

AND
CMP

JNZ

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT F1 <><><><>
PUT A SELECTOR I N AX
PUT A SELECTOR IN BX
MAKE ACCESS Of AX < BX
AX = SECOND OPERAND
; I SSUE TIlE RPL COMMAND
; NOTE: SOURCE / TARGET REGS ARE REVERSED
DUE TO OPCDDE BIT 1

AX,BX
BYTE
AX,BX
BYTE
OFFSET CS; 7?OOlC
063H
OFFSET CS: ??0010
ERROR EXI Tl
BL,03H
BL,03H
ERROR_EX I T1

GO IF R PL WAS NOT CHANGED
STR i P UNWANTED BITS
AS f.XPFCTED?
GO IF NOT

;-------- CHECK THAT ACCESS RIGHTS DO NOT CHANGE
0201
0204
0207

BB 0060

MOV
MOV
OR

B8 0048
80 CB 03

;-------- NOTE BX "" FIRST OPERAND
02GA
02GA
020C
020A
020A
020e
020C
020E
0211
0214

8B C3

-+- ??OOlE
-++ ??OOl f

+

DB

63
74
80
80
75

ARPL
LABEL
MOV
LABEL
ORG
ORO
JZ

85
E3 03
F8 03
2F

AND
CMP

JNZ

ex

; PUT A SELECTOR I N
; PUT A SIcU:CTOR I III AX
; MAKE ACCESS OF BX < AX

BX, OS_TEMP
AX, ES_TEMP
BL,03H

AX = SECOND OPERAND

AX,BX
BYTE
AX,BX
BYTE
OFFSET cs: ??OOl E
063H
OFFSET CS: 7?001 F
ERROR EXI T1
BL,03H
BL,03H
ERROR_EX I T2

; I SSUE THE RPL COMMAND
; NOTE: SOURCE / TARGET REGS ARE REVERSED
DUE TO QPCODE BIT 1

GO 1 F R PL WAS NOT CHANGED
; STR I P UNWANTED BITS
; AS EXPECTED?
;GOIFNOT
;

VERIFY LOAD SEGMENT LIMIT (LSLI
AND LOAD ACCESS RIGHTS (LAR) I NSTR

;

-------------.--- -----------------------------================::==0==0===

;-------- CHECK THE LAR INSTRUCTION

========================
MOV

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT f8 <><><><>

AL,OF8H
MFG_PORT, AL

0216
0218

80 F8
£6 80

021A

c6 06 0040 F3

MOV

BYTE PTR OS: (ES_TEMP.DATA_ACC_RIGHTS),CPL3_0ATA_ACCESS

021F
0222

BB 0048
28 CO

MOV

BX, ES_TEMP
AX,AX

OUT

; ------- SET THE OESCRI PTOR TO LEVEL 3

SUB

; CLEAR AX

; -------- GET THE CURRENT DESCRI PTOR"S ACCESS RIGHTS

LAR
0224
0225
0225
0227
0225
0225
0227

Of
88 C3

•

DB

+ ? ?0020

LABEl
MOV
LABEL
ORG

-+-+- ??0021

+

DB
ORO

02

;-----~--

02;>7

75 lC

AX. BX
DDFH
BYTE
AX,BX
BYTE
OFFSET CS:??0020
002H
OFFSET CS: ??0021

;

1SSUE THE LAR COMMAND

INSURE THE DESCRIPTOR WAS VISABLE
; GO

JNZ

IF LAR WAS NOT CHANGED

;-------- THE DISCRIPTOR"S ACCESS RIGHTS MUST BE
0229
022C

CMP
JNZ

80 FC F3

75 1"1

AH,

CPL3~DATA_ACCESS

ERROR~EXIT2

3

; AS EXPECTED?
; GO I F NOT

=:;o=;===============================:=:=
;-------'CHECK THE LSL (LOAD SEGMENT LIMITS)

==-==::====::=::==-=",=:=:::=:::::==0:==========
£6 80
C7 06 0048 AAAA

0238

C6 06 0040 93

0230

B8 0048

0240
0241
0241
0243
0241
0241
0243
0243
0245
0245

Of

88 08

AL.OF9H
MFG PORT,AL
OS: IS_TEMP. SEG_LIMI T ,OAAAAH

MOV

AXI ES_TEMP

LSL

BX,AX
OOFH
BYTE
BX.AX
BYTE
OFFSET CS:??0022
003H
OFFSET CS:??0023
R07

OUT

•

DB

+ ??0022
+

LABEL
MOV
LABEL
ORG

-+- ??OQ23

+
03
74 03

MOV

f~OV

BO F9

022E
0230
0232

DB
ORO

JZ
ERROR_EX! T2:

£9 02EA R

JMP

; <><><><><><><><><><><><><><>
;<><><>CHECKPOINT F9 <><><><>
; SET SEGMENT L1 MIT TO OAAAAH

LOAD ES REG I STER
; GET THE OESCR I PTOR SEGMENT LIM I T

GO I F OK
GO I F NOT SUCCESSFUL

Test 7 5-81

I NSURE CORRECT SEGMENT LIM I T

0248

81

CM'

BX,OMMH

024C

C7 06 0048 5555

MOV

os: ES_TEMP. SEG_LI HI T, 05555H

0252

88 0048

0255
0256
0256
0258
0256
0256
0258
0258

Of

75 EB

MOV
LSL
DB
LABEL
MOV
LABEL
ORG
DB
ORG
JNZ

AX, ES_T£MP
BX,AX
OOFH
BYTE
BX,AX
BYTE
OFFSET CS;??0024
003H
OFFSET CS: ??0025
ERROR_EX I T2

025A
025E

81 FB 5555
75 E5

CM'
JNZ

6X,05555H
ERROR_EX I T2

FB AAAA

R07:

+

88 08

!
!

03

+
+

170024
??0025

;

;SET THE S£TMENT LIMIT TO 05555H

; GET THE OESCR J PTOR SEGMENT LIM I T

GO I F NOT SUCCESSFUL
I NSURE CORRECT SEGMENT LI MIT
GO I F NOT

; -LOW- ~E; -~~~; -SELECT -TEsT---------------------------------;
;
;
0260
0262
0264
0267

BO
[6
B8
BE

H.ST fHAI A WRI1£ 10 ADDRESS 180000 00[5 NOT WRITE TO
BOOO;O, OR lB8000 DOES NOT WRITE TO B800;0

----- ---- -------------------- ------------- ----------------; <><><><><><><><><><><><><><>
;<><><>CHECKPOINT FA <><><><>
; MODIFY THE DESCRIPTER TABLE

AL,OFAH
MFC_PORT, AL

MOV
OUT
MOV
MOV

FA
80
0008
08

~~:~~T_PTR

; -------; sE~-T~~p-Es-DEscR~PToR-64~-S~G;~NT-L~~~~ /GPLO
;
0269
026F

------------- - -- -------- - -------- -------

os: ES_TEMP.SEG_LlMI T, MAX_SEG_LEN
BYTE PTR OS: (ES_ TEMP. OATA_ACC_R I GHTS), CPLD_DATA_ACCESS

MOV
MOV

C7 06 0048 FFFF
C6 06 0040 93

DATA ACCESS

;------- START WITH SEGMENT lBOOOO
0274
0279

C6 06 OOIl.C 1B
c7 06 004A 0000

MOV
MOV

BYTE PTR OS; (ES_TEMP.BASE_HI_BYTEl,lBH
as: ES_TEMP.BASE_LO_WORD,O

027F
0282

B8 0048
BE CO

MOV
MOV

AX. ES_TEMP

LOAD ES REG

ES,AX

SUB
MOV

POINT TO FIRST LOCATION
WRITE A ZERO

01,01
WORD PTR ES:(0IJ,OAA55H

0284
0286

2B FF
26: C7 05 AA55

0288

C7 06 004A 8000

MOV

OS: ES_ TEMP. BASE_LO_WORD, 8000H

0291
0294

B8 0048
8E CO

MOV
MOV

AX,ES_TEMP
ES,AX

LOAD ES REG

0296

26: C7 05 AA55

MOV

WORD PTR ES:[DIJ,OM55H

WRITE A ZERO

0298
02AO

C6 06 004c lA
C7 06 004A 0000

MOV
MOV

BYTE PTR DS:(ES_TEMP.BASE_HI_BYTE),1AH
DS: ES_TEMP. BASE_LO_WORD,O

02M
02A9
02AS

88 0048
8E CO
26: C7 05 AA55

MOV
MOV
MOV

AX, ES_TEMP
ES,A><
WORD PTR ES:(DI],OM55H

02BO
0283
02B5

BS 0020
61:. DB
66 05

; ------- DO FOR SEGMENT 1 B8000

; -------- DO FOR SEGMENT 1AOOOO

; ------- B/W

v IDEO

MOV
MOV
MOV

LOAD ES REG
WRITE A ZERO

CARD

g~: ~XBWCRT _PTR
AX,DS:[DI

J

SET as TO BW CRT BUFFER
GET THE WORD FROM B/W V IDEO

;-------- COMPATIBLE COLOR
02B7
02BA
02BC

BS 0028
8E DB
B6 10

028E
02C1
02c3

89 0030
BE 09
8B 00

MOV
MOV
MOV

BX,C_CCRT_PTR
DS, BX
BX,OS:[Olj

SET OS TO COMPAT I BLE COLOR RAM
GET THE WORD FROM COLOR RAM

; -------- AGC COLOR
MOV
MOV
MOV

g~; ~xCCRT _PTR

AGC COLOR CRT PTR LOW 64K

ex,os: [01]

; -------- TEST FOR ERROR
02C5
02C6
02ca
02CA
02CB
02eE
0200
0204
0206
020A
020C
020E

PUSH
MOV
OUT
POP
eMP
JZ
CMP
JZ
CMP
JZ
MOV
OUT

50
BO 35
E6 ao

58
30 AA55
74 1A

81 FB AA55
74
81
74
BO
E6

14
F9 AA55
OE
34
80

AX
AL.35H
MFG_PORT. AL
AX
AX,OAA55H
ERRORJXI T
BX,OAA55H
ERROR_EX I T
CX,OM55H
ERROR_EX I T
AL,34H
MFG_PORT, AL

SAVE RESUL IS
<><><><><><><><><><><>
<><>CHECKPO I NT 35<><><>

RESTORE CHEGKPOI NT
<><>CHECKPOINT 34 <><><><>

;------- SHUTDOWN
NORMAL_EX IT;

02EO
02EO
02E2
02E4
02E6
02E8
02EA
02EA

BO
E6
BO
EB
E6

8F
70
06
00
71

E9 0000 E

MOV
OUT
MOV
.IMP
OUT
ERROR_EX IT:
JM'
POSH
CODE

02EO
02EO

ENOP
ENOS

'NO

5-82

Test 7

AL, SHUT DOWN
CMOS_PORT, AL
AL,6
SHORT $+2
CMOS_PORT+l,AL
PROC_SHUTDOWN

ADDR FOR SHUTDOWN BYT E
SET GOOO END I NG
J 0 DELAY

TITLE

SYSINITl -

09/26/83 INITIALIZE fOR PROTECTED MODE (POST TEST)

Include fi les

SYSINITl

INCLUDE
I NCLUOE
INCLUDE
I NCLUOE
I NCLUOE

SYSDATA.INC
ACCESS, I Ne
SYSDATA.MAC
I APX286. MAC
POSTEQU, SRC

PUBLIC

SYSINI'Tl

.LIST
EXTRN
SlOT BLD:NEAR
EXTRN
GOT_BLD: NEAR
I NCLUDE SEGMENT. SRC
CODE SEGMENT BYTE PUBL I C

0000

ASSUME
ASSUME
ASSUME
ASSUME
PAGE
SYSINITl

0000

;

CS:
SS:
OS:
ES:

CODE
NOTH I NG
NOTH I NG
NOTH I NG

NEAR

PROC
--- ----------- ----------------------------------------------------TH I S SU I LOS THE DESCR! nOR TABLES REQU IRED fOR PROTECTED MODE
PROCESSOR MUST BE

0000
0001
0002
000lJ.
0006
0009

ell
PUSH

FA
80 81
E6 80
E8 0000 E
8B EF

MOV
OUT
MOV

BP
AL,81H
MfG_PORT, AL
SIOT_BLO
BP,OI

OOOB
OOOE
OOOF
0012
0013
0016

B8 0800
AB
B8 DOAO

MOV

AX, SYS_I OT_LEN

AB

STOSW

B8 0000
AB

MOV

0017

26

0018
0019
0019
001C
0019
0019
00lC
00lC

OF

55

8B 5E 00

CALL

I N REAL MODE
;
;

SAVE THE PO I NTER TO JUST PAST THE lOT
SINCE WE HAVE NO SOA, USE THE SIX BYTES
HERE TO LOAD THE 10TR.
WE WILL SlOT
WHEN WE GET TO SOA INITIALIZATION.
SEGMENT LIMiT = LENGTH OF lOT
STORE THAT AS lOT LIMIT
lOT ADDRESS
AND ACCESS RIGHTS BYTf (UNDEfiNED)

STOSW
AX, SYS_ lOT- loe

MOV

+
+ ?10001
+

+

?10002

+

AX,O

STOSW
SEGOV
DB
LIOT
DB
LABEL

ES
026H
I BPI
OOFH
BYTE
BX, WORD PTR IBP]
BYTE
OFFSET CS: ??OOOl
OOIH
OfFSET CS:??OO02
01, BP

MOV

LABEL
ORe
DB
ORG
MOV

01
8B FO

NO I NTERRUPTS ALLOWED
SAVE BP

; <><><><><><><><><><><><><>
; <><><>CHECKPO I NT 81 <><><>

LOAD THE

lOT

REG I STER fROM TH I S AREA

;

ES:DI

NOW

--> END OF lOT AGAIN

BUI LD THE GOT.

DOlE
0021
0024
0026
0029
002A
0020
002£
0031

BF
E8
88
68
AO
B8
AO
B8
AB

0032

26

0033
OU34
0034
0037
00311
0034
0037
0037
0039
003A
0038

OF

DI,GOT_LOC
GDT_BLD
BP,OI
AX, GOT_LEN

MOV

D8AO
0000 E
EF
0088

CALL
MOV
MDV

STOSW
D8AO

MOV

0000

MOV

AX,GOT_ lOC

SToSW

88 56 00

AX,O

STOSW
SEGoV
DB
LGDT

+
+ 770004
+
+ ??OOO5
+

DB

LAB[L
MOV

LABEL

88 fO

ORe
OB
ORe
MOV

AB
AB
8B FD

MOV

01

ES
026H
[BP J
OOfH
BYTE
OX, WORD PTR [BPI
BYTE
OFfSET CS: 770004
00lH
OFfSET CS: ??OO05
DI,BP

SAVE THE ES:DI POINTER
AX '" U.NGTH Of THE GOT
; PUT THAT IN THE LIMIT FIELD
; AX = LOW WORD or GOT ADDRESS
; PUT THAT I N BASE F I ELO - LOW
; AX '" HIGH BYTE Of ADDRESS, AND
ACCESS RIGHTS B'fTE IS UNDEfIN[D
LOAD THE CDTR
FROM TH I S AREA

RESTORE THE ES:OI

POINTER

STOSW
STOSW
01, BP

PAGE
SW I TCH TO V I RTUAL MODE

0030
003£
0041
0042
0042
0044

50
B8 0001

OF
8B fO

+
+ ??0006
+
+ ??0007

0042
0042
0044

01

0044
0045
0047
0049
0049
0048
0040
004E
004E

EA
0049 R
0040

POP
MOV
LMSW
DB
LABEL
140V
LABEL
ORG
DB
ORC
JUMPFAR
DB
OW
OW

BP

AX, VI RTUAL_ENABLE

AX
00 fH
BYTE
51 ,AX
BYTE
OFFSET CS: ??0006
001 H
OFFSET CS: ??0007
DONE, SYS_ROM_CS
OEAH
(OfFSET DONE)
5YS_ROM_CS

RESTORE BP
MACHINE STATUS WORD NEEDED TO
SW I TCH TO V I RTUAL MODE

; MUST PURGE PRE-fETCH QUEUE
Jump 1';;1 r direct

to th i s offset
in this segment

DONE:
BO 85
E6 80

MDV
OUT

RET

e3
SYSINIT1
CODE

AL,85H
MFG_PORT ,AI

o

; <><><><><><><><><><><><><><>
; <><><>CHECKPO I NT 82 <><><><>
SYSTEM INITIALIZATION

DIDP
ENDS

END

Sys Init 5·83

5-84

Sys Init

TITLE
GDT_BlD . LI ST
! NCLUDE SEGMENT. SRC
CODE SEGf~£NT BYTE PUBl I C

0000

09/26/83 BU IlD THE GOT

ASSUME
ASSUME
ASSUME
ASSUME

cs; CODE

PUBl I C

GOT _BLO

SS;NOfHING
OS; CODE
ES;NOTHING

PAGE

THE FOLLOWING DATA DF:FINES THE PRE-INITIALIZED GOT.
THESE MUST BE lNITIALILED IN THE ORDER IN ~IIIICH TIlEY APPEAR
IN THE CDT_DEF STRUCTURE DEFINITION AS IT IS IN SYSDATA.INC.

0000
FI RST ENTRY UNUSABLE

0000
0002
0004
0005
0006

0000
0000

0008
OOOA
OOOC
0000
OOOE

0088
D8AO

DESCR DE F
OW
0

ow
OB
OB
OW

DO
00
0000

SEC,

0

THE GOT

0, 0, 0
Segment limit
Segment base address Segment base addre:>:> Access rights byte
Reserved

low 'Word
high byte

ITSELF

OESCR OEf
SEC, COT_LEN, GOT_LOC, 0, CPLO_OAfA_ACCESS
OW
GOT L[N
; Segment lim i t
OW
GOr-LOC
; Segment base address - low word
DB
0 ; Segment base address - high byte
OB
CI-'LO OAT A ACL:!;.SS
; Access rights byte
OW
0
; Reserved

00
93
0000
PACE

THE SYSTEM

0010
0012
0014
001';>
0016

0,

0
0
0

lOT DESCRIPTOR

OESCR_OEf
SEC, SYS_IOT_LEN, SYS_IOT._LOC, 0, CPLO_OATA_ACCESS
OW
SYS_IOT_LEN
; Segment limit
OW
SYS_IDT_LOC
; Segment base address - 10'W 'Word
DB
0
; Segment base address - high byte
DB
CPLO DATA ACCESS
: Access rights byte
I)W
Rese rvcd

0800
DOAO

00
93

°

0000

-;

THE SYSTEM DATA AREA OESCRI PTOR

0018
001A
OOlC

0010
001 E

SEC, SOA LEN, SOA LOC, 0, CPLO_DATA_ACCESS
OESCR OEF
ow
SOA LEN
; Segment ITmit
OW
SOA-LOC
; Segment base address - 10'W 'Word
DB
0 ; Segment base address - high byte
DB
CPLO_DATA_ACCESS
; Access rights byte
OW
Reserved

0300
OI~OO

00
93
0000

°

PAGE

;

CaMPA T I BLE MONOCHROME CRT

0020
0022
0024
0025
0026

OESCR OEf
SEC, MCRT_S1ZE, MCRT@_LO, MCRT@_HI, CPLO_OATA_ACCESS
OW
MCRT_SI7F
; Segment limit
OW
MCRT@ LO
; Segment base address - low 'Word
MCRT@-HI
; Segment ba se add ress - high byte
DB
CPLO_DATA_ACCESS
; Access rights byte
OW
0
; Reserved

1000
0000

DB

DB
93
0000

r..:OMPA I I BLEc COLOR CR I

0028
002A
002C
0020
002E

DESCR_DEf
SEG, ceRT_SIZE, CCRT@_lO, CCRT@_HI, CPLO_OATA_ACCESS
Segment limit
OW
CCRT SIZE
DI~
CCRT@ LO
Segment base address - 10lt( 'Word
DB
CCRT@-HI
Scgment base address - high byte
OU
CPLO DATA ACCESS
; Access rights byte
OW
Reserved

11000
8000
DO

° - -

93
0000

;

ENHANCED COLOR CRT -

0030
0032
0034
0035
0036

ONE ENTRY FOR EACH 64K

OESCR OEF
SEC, ECCRT SIZE, ECCRT@ LO LO, ECCRT@ La HI, CPLO_DATA_ACCESS
OW
ECCRT SIZE
- ; segment-limit
OW
[CCRT@_LO_LO
; Segment base address - low 'Word
DB
ECCRT@_LO_HI
; Segment base address - high byte
013
CPLO DATA ACGESS
; Access rights byte
OW
Reserved

FFFF
0000

OA
93

° - -

0000

;

SECOND PART OF CRT

0038
003A
003C
0030
003E

DESCR OEF
SEG, EGCRT_SIZE, ECCRT@_HI_LO, ECCRT@_HI_HI, CPLO_OATA_ACCESS
OW
ECCRT S 11E
; Segment Jim i t
OW
ECCRT@ HI LO
; Segment base address - low word
DB
ECCRT@-HI-fll
; Segment base address - high byte
DB
CPLO_DATA:=ACCESS
; Access rights byte
OW
0
; Reserved

FffF
0000

OC
93
0000
PAGE

CODE SEGMENT fOR POST CODE,

00110
0042
0044
0045
0046

FFFF
0000

OF
9B
0000

SYSTEM

TEMPORARY DESCR I PTORS FOR ES,

0048
004A
oo4c

FFFF
0000

0040

00
93

D04E

0000

0050
0052
0054

fFFf
0000

0055

93

0056

0000

00

lOT

OEseR OEF
SEC, MAX SEG LEN, CSEC@ LO, CSEG@ HI, CPlO_CODE_ACCESS
OW
MAX_SEC_LEN
- ; segment-limit
ow
CSEG@_LO
; Segment base add res:> - 10 .... wont
DB
CSEC@_HI
; Segment base address - high byte
DB
CPLO_COOE_ACCESS
; Access rights byte
OW
0
; Reserved
CS,

SS,

AND OS

OESeR OEF
SEG, MAX SEC LEN, NSEG@ La, NSEC@ HI, CPLO_DATA_ACCESS
ow
MAX SEC LEN
- ; Segment-I imit
OW
NSEG®_LO
; Segment base address - low ....ord
DB
N5lG@_Hi
; Segment base address - high byte
DB
CPLO_DATA_ACCESS
; Access rights byte
OW
0
; Rese rved
OESCR._DEF
SEC, MAX_SEG_L[N, NSEG@_LO, NSEG@_HI, CPLO_OATA_ACCESS
OW
MAX SEC LEN
; Segment I imi t
OW
NSEG@ LO
; Segment base address - low 'Word
DB
NSEG@:=Ht
; Segment base address - high byte
DB
CPLO_OATA_ACCESS
; Access rights byte
OW
0
; Rese rved

5-85

DESCR~DEf

0058
a05A
DOse
0050
005E

FFFF
0000

0060
0062
0064
0065
0066

FFFF
0000

00

93
0000

93
0000

0070
0072
0074
0075
0076
0078
0078
007A
007C
0070
007E
0080
0082
0084
0085
0086

.,

0800

COOO
00
0000
0800
0068 R

00

93
0000

0088

DODO
00
E2
0000

0088
0078 R

00

93
0000

SEG, MA)CSEC_LEN, NSEOO_LO, NSEG@_HI. GPLO_DATA_ACCESS
MAX_SEC_LEN
; Segment limit
NSEG@_lO
; Segment base address - loy{ Y{ord
NSEG@_HI
; Segment base address - high byte
CPLO_OATA_ACCESS
; Access rights byte
0
; Reserved

OESCR_OEF
SEG, MAX_SEG_LEN, NSEG@_LO, NSEG@LHI, CPLO_OATA_ACCESS
OW
MtuCSEG LEN
; Segment lim i t
OW
NSEG@ LO
; Segment base address - low ....or'd
DB
NSEG@=HI
; Segment base add~ess - high byte
08
CPLO_OATA_ACCESS
; Access rIghts byte
OW
0
; Rese rved

00

0068
0068
006A
006C
0060
006E

OW
OW
DB
DB
OW

; POST_TR
TR_lOC:
OESCR_OEF
SEG, 800H, OCOOOH, 0, fREE TSS
Segment I imft
OW
800H
; Segment base address - loW' W'ord
OW
oeODOH
; Segment base address - high byte
DB
0
;
Access
rights
byte
DB
FREE_ TSS
; Reserved
OW
0
POST TSS PTR
- OESCR OEF
SEC, 80QH, TR_LOC, 0, CPLO_DATA_ACCESS
OW
800H
; Segment I; mit
OW
TR_LOC
; Segment base address - loW' W'ord
DB
Segment base address - high byte
DB
CPLO_OATA_ACCESS
; Access rights byte
OW
0
; Rese rved
LOT LOC:
POST LDTR
- OESCR DEF
SEG, COT_LEN, ODaaOH, 0, LDT_OESC
OW
GOT_LEN
; Segment limit
; Segment base address - loW' W'ord
OW
OOOOOH
; Segment base address - high byte
DB
0
; Access rights byte
DB
LOT_DESC
; Reserved
DW
0
POST LOT PTR
- DESCR_OEF
SEG, GOT_LEN, LOT_LOC, 0, CPLO_DATA_ACCESS
OW
COT LEN
; Segment lim I t
Ow
LDT=LOC
; Segment base address - loW' W'ord
DB
0
; Segment base audress - high byte
08
CPLO_OATA_ACCESS
; Access rights byte
OW
a
; Reserved
PAGE

a

LABEL

0088

;

WORD

END OF PRE-ALLOCATED GOT
PROC

0088
0088
008B
008E

BE 0000 R
B9 0044
F3/ A5

MOY
MOV
REP

0090

C3

RET

NEAR

SI,OFFSET GOT_OATA_START
; DS:SI --> GOT
CX,(GOT_DATA_ENO-GOT_DATA_START)/2; NUMBER OF WORDS TO COPY
MOVSW
; COPY GOT INTO RAM

0091
0091

5-86

CODE

ENDS
END

MPC

ENDS

TITLE

SIOT_BlO 6/10/83 PROTECTED MODE INTERRUPT TABLE

SIOT_BlD Include f"i les
INCLUDE SYSDATA.INC
I NClUDE ACCESS. INC
INCLUDE SYSDATA.MAC
INCLUDE IAPX286. MAC
.LlST
I NClUOE SEGMENT. SRC
CODE SEGMENT BYTE PUBl! C

0000

0000

ASSUME
ASSUME
ASSUME
ASSUME

CS:CODE
SS: NOTH I NG
DS:NOTHING
ES: NOTH I NG

PUBl! C
PROC

SlOT BlO
NEAR-

BUilD TIlE lOT.
THE lOT Will CONTAIN VECTORS FOR
EXCEPT I ON HANDLERS
0000
0003
0005
0007
DaDA

oooe

BE
8C
8E
BF
2B
8E

0066 R
C8
08
DDAD

DaDE
0011
0013

BB 0040
B6 87
B2 00

0015

B9 0020

co
co

MOV
MOV
MOV
MOV
SUB
MOV

51 ,OffSET SYS_loT_OFFSETS ; MAKE DS:SI POINT TO
AX,CS
;
INTERRUPT ENTRY POINTS
OS,AX
;
OI,SYS_IDT_lOC
; POINT TO SYS_IDT_LOC
AX,AX
;
ES.AX
;
WHERE THE lOT WILL BE.

MOV
MOV
MOV

BX, SYS_ROM_CS
OH, TRAP_GATE
Ol,O

MOV

CX,32

CS I S THE SAME fOR All INTERRUPTS
ACCESS RIGHTS BYTE FOR THE GATE
THE WORD COUNT FiElD I S UNUSED
THERE ARE 3? RfsfRVm INTERRUPTS
THIS LOOP BUILDS 32 DESCRIPTORS IN THE
lOT FOR THE RESERVED INTERRUPTS
GET A ROUTINE ENTRY POINT
AND PUT IT IN THE OFFSET FIELD
GET THE SYSTEM CODE SEGMENT SELECTOR
AND PUT I TIN THE SELECTOR FIELD
GET THE I NTERRUPT GATE BYTE
AND PUT IT I N THE ACCESS RIGHTS FI ELO
ZERO OUT
THE RESERVED POST I TI ONS
AND REPEAT AS DIRECTED

LOW_lOT;

0018
0018

A5

MOVSW

0019
001B
OOlC

8B C3
AB

OOlF
0022
0023

AB

E2 F3

MOV
STOSW
MOV
STOSW
MOV
STOSW
lOOP

AX,BX

~OlE

B9 ODED
BO OOM R

MOV
MOV

CX, 256~32
BP, OffSET FREE_I NTS

256 TOTAL ~ 32 DONE == WHATEVER I S lEFT
THERE IS A COPY Of AN UNINITIAllZED
INTERRUPT DESCRIPTOR AT fREE_INTS

MOV

SI,BP

MOVSW
MOVSW
MOVSW
STOSW
lOOP

HIGH_lOT

05:51 -~> FREE DESCRIPTOR
([S:DI LEFT OFF AT INT 32)
MOVE THE OFFSET OF THE IRET INSTRUCTION
MOVE THE CS SELECTOR
MOVE THE ACCESS RIGHTS BYTE
ZERO OUT THE RESERVCD WORD
FilL THE REMAINDER OF THE TABLE

0025

0028

AB

8B C2
B8 0000

AX, OX
AX,O
LOW_lOT

PAGE
HIGH_lOT:

002B
002B

8B

0020
002E
002F
0030
0031

A5
A5
A5
AB

F~

E2 Fa

INITIALIZE THE ENTRY POINTS fOR POST TEST
0033

26: C7 06 D1AO 0000 E

MOV

WORD PTR ES: (SYS_I DT_LOC+( 032*DESC_LEN). ENTRY_POI NT) ,OffSET SYS_32

003A

26: C7 06 D1A8 0000 E

MOV

WORD PTR ES:(SYS_loT_LOC+(033*OESC_LEN).ENTRY_POINT),OFFSET SYS_33

0041

26: C7 06 01S0 0000 E

MOV

WORD PTR ES: (SYS_I DT_LOC+(034*OESC_LEN). ENTRY_POINTI,OffSET SYS_34

0048

26: C7 06 01B8 0000 E

MOV

WORD PTR ES: (SYS_I DT_LOC+( D35*OESC_LEN). ENTRY_POI NTI,OFFSET SYS_35

OOLiF

26: C7 06 OlCO 0000 E

MOV

WORD PTR ES: (SVS_I oT_LOC+(036*DESC_LEN I. ENTRY_POI NT) ,OFFSET SYS_36

0056

26: C7 06 01C8 0000 E

MOV

WORD PTR

0050

26: C7 06 0100 0000 E

MOV

WORD PTR ES: (SYS_I DT_LOC+(03a*DESC_lEN). ENTRY_POI NT) ,OFFSET SYS_38

0064

C3

ES:(SVS_IDT_LOC+(037*OESC~LEN).ENTRY_POINT),OFFSET

SYS_37

RET

PAGE
I RET_ADDR

0065
0065

LABEL

WORD

;

fOR UNINITIALIZEO INTERRUPTS

I RET

CF

EXTRNS FOR THE FIRST 32 SYSTEM INTERRUPTS
EXTRN
EXTRN
EXTRN
[XTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
[XTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN

1~I~mm~

EXC_05: NEAR
EXC_06: NEAR
EXC_07: NEAR
[XC_08: NEAR
EXC 09: NEAR
EXC-'O: NEAR
EXC-'l: NEAR
EXC:='2:NEAR
EXC_13: NEAR
EXC_'4:NEAR
EXC_15:NEAR
EXC_'6:NEAR
EXC_17: NEAR
EXC_18:NEAR
EXC_19:NEAR
EXC_20: NEAR
EXC_21 : NEAR
EXC_22: NEAR
EXC_23:NEAR
EXC_24: NEAR
EXC_25: NEAR

~~g:=~~; ~~:=

SIDT~LD

5-87

EXTRN
EXTRN
EXTRN
l:.XfRN

EXC 28:NEAR
EXC=29: NEAR
EXC_30:NEAR
EXC_31:NEAR

EXTRN
EXTRN
EXTRN
[XTRN
EXTRN
EXTRN
EXTRN

SYS 32:NfAR
SYS-33: NEAR
SYS-34;NEAR
SYS=35: NEAR
SYS_36; NEAR
SYS_37:NEAR
SVS_38: NEAR

PAGE

Entry points f'or the first. 32 system interrupts
LA8EL

0066
0066
0068
006A
006C
006[
0070
0072
0074
0076
0078
007A
007C
007E
0080
0082
0084
0086
0088

OOM
008C
008E
0090
0092
0094
0096
0098
009A
009C
009E
OOAO
00A2
00A4

[
[
[
[
[
E

DW
OW
OW
OW
OW

E

OW
OW
OW

ow

E
E

ow

E
E
E

E
E
E
E
UOOO E
0000 E
0000 E
0000 E
0000 E
0000 E
0000 E
0000 E
0000 E
0000 E
0000 E
0000 E
0000 E
0000 E
0000 E
0000 E

OW
OW
OW
OW
OW
OW
DW
OW
OW
DW
OW
OW
OW
OW
OW
OW
OW

OW
OW
OW
OW
OW

0065 R
0040
00 86

~REE

I NTS

END

5-88

OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OffSET
OFFSET
OFFSET
OFFSET
OFFSET
OffSET
OFFSET
OFfSET
OFFSET
OfFSET
OfFSET
OFfSET
OFfSET
OFfSET
OfFSET
OfFSET
OFFSET
OffSET
OfFSET
OFFSET
OFFSET

EXC 00
EXC-Ot
EXC-02
EXC-03
EXC-04
EXC-05
EXC-06
EXC-07
EXC-OB
EXC-09
EXC-lO
EXC-l1
EXC-12
EXC-' 3
EXC-'4
EXC-' 5
[XC-'6
EXC-17
EXC-18
EXC-19
EXC-20
EXC-21
EXC-22
EXC-23
EXC-24
EXC-25
EXC-26
EXC-27
EXC-28
EXC-Z9
EXC-30
EXC=31

EXCPT
EXePT
EXCPT
EXePT
EXePT
EXCPT
EXCPT
ExePT
EXCPT
EXCPT
EXePT
EXe?T
EXC?T
EXePT

00
01
02
03
04

-

05 06 07 -

08 09 10 -

l' '2 13 -

ExePT 16 -

OIVIDE ERROR
SINGLE STEP
NM I. SYS REQ FOR D1
BREAKPOINT
I NTO DETECT
BOUND
INVALID OPCODE
PROCESSOR EXT NOT AVA I L
DOUBLE EXCEPTION
PROCESSOR EXT SEGMENT ERR
STK PL BAD I N GATE TRANSFER
SEGMENT NOT PRESENT
STACK SEGMENT NOT PRESENT
GENERAL PROTECTION
PROCESSOR EXTENSION ERROR

PAGE
FORMAT

OOA6
OOAa
OOAA
OOAC
OOAC

WORD
I NTERRUPTS AS DEF I NED

0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000

INTERRUPT DESCRIPTORS (GATES) 32

OW
OW
DB
[NDP
ENDS

OFFSET I RET ADDR
SYS_ROM_CS O,INT_GATE

~

255

DESTINATION OFFSET
DEST I NAT ION SEGMENT
UNUSED BYTE, ACCESS RIGHTS BYTE

0000

TITLE DSKETTE DATE 01-12-84 DISKETTE BIOS
• LI ST
INCLUDE SEGHENT. SRC
CODE SEGMENT BYTE PUBL I C
PUBLIC
PUBLIC
PUBLIC
EXTRN

DISK INT 1
SEEKDSKETTE SETUP
DDS: NEAR

I NT 13 ------------------------------------------------------------DISKETTE r/O
THIS INTERFACE PROVIDES ACCESS TO THE 5 1/4" DISKETTE DRIVES
320/36DK DISKETTE DRIVES AND 1.2M DISKETTE DRIVES SUPPORTED
INPUT
(AH )=0
RESET 0 I SKETTE SYSTEM
HARD RESET TO NEC, PREPARE COMMAND, RECAL REQD ON ALL DRIVES
(AH)=1
READ THE STATUS OF THE SYSTEM INTO (AH)
DISKETTE_STATUS FROM LAST OP'N IS USED
REG I STERS FOR REAll/WR I TE/VER I FY / FORMAT
(DL) - DRIVE NUMBER (0-1 ALLOWED, VALUE CHECKED)
(DH) - HEAD NUMBER (0-1 ALLOWED, NOT VALUE CHECKED)
(CH) - TRACK NUMBER (NOT VALUE CHECKED)
MED I A
OR I VE
TRACK NUMBER
320/360
320/360
0-39
320/360
1. 2M
0-39
1.2M
1.2M
0-79
(CL) - SECTOR NUMBER (NOT VALUE CHECKED, NOT USED FOR FORMAT)
MEDIA
DRIVE
SECTOR NUMBER
320/360
320/360
1-B/9
320/360
1. 2M
1 -8/9
1.2M
1.2M
1-15
(AL) - NUMBER OF SECTORS (NOT VALUE CHECKED)
I~EDIA
DRIVE
r~AX NUMBER Of SECTORS
320/360
320/360
8/9
320/360
1.2M
8/9
1,2M
1.2M
15
(ES:BX)

-

ADDRESS OF BUFFER (

REQUIRED FOR VERifY)

(AH)=2
(AH )=3
(AH )=4
(AH)=5

READ THE DESIRED SECTORS INTO MEMORY
WR I TE THE DES I REO SECTORS FROM MEMORY
VER I fY THE DES I RED SECTORS
FORMAT THE DESIRED TRACK
FOR THE FORMAT OPERAT ION, THE BUFfER PO INTER (ES, BX) MUST
POINT TO THE COLLECTION OF DESIRED ADDRESS fiELDS FOR THE
TRACK.
EACH FIELD IS COMPOSED OF 4 BYTES, (C,H,R,N), WHERt
C = TRACK NUMBER, H=HEAD NUMBER, R '" SECTOR NUMBER, N= NUMBER
OF BYTES PER SECTOR (00=128, 01=256, 02"'512, 03=1024,)
THERE MUST BE ONE ENTRY FOR EVERY SEcrOR ON THE TRACK,
TH!S INFORMATION IS USED TO fiNO THE REQUESTED SECTOR DURING
READ/WR I TE ACCESS.
PRIOR TO FORMATTING A DISKETTE, FUNCTION CALL 17 OF THIS
ROUT I NE MUST BE I NVOKED TO SET THE 0 I SKETTE TYPE THAT I S TO
BE FORMATTED.
IN ORDER TO FORMAT 320/360K MEDIA IN EITHER A 320/360K OR
1 .2M DISKETTE ORIVF THE GAP LENGTH FOR FORMAT PARAMETER
OF DISI< BASE MUST BE CHANGE TO OSOH.
ALSO THE EOT
PARAMETER (LAST SECTOR ON TRACK) MUST BE SET TO THE
DESIRED NUMBER OF SECTORS/TRACK - 8 FOR 320K, 9 FOR 360K.
DISK BASE IS POINTED TO BY DISK POINTER LOCATED AT
ABSOLUTE ADDRESS 0: 78.
WHEN 320/360K FORMAT OPEt{AT IONS ARE COMPLETE, THE PARAMETERS
SHOULD BE RESTORED TO THEIR RESPECTIVE INITIAL VALUES.
(AH)=15 READ DASD TYPE
REGI STERS
(AH) - ON RETURN I F CARRY FLAG NOT SET, OTHERW I SE ERROR
00 - OR I VE NOT PR[S[NT
01 - DISKETTE, NO CHANGE LINE AVAILABLE
02 - DISKETTE, CHANGE LINE AVAILABLE
03 - FIXED DISK
(DL) - OR I VE NUMBER (0-1 ALLOWED, VALUE CHECKED)
(AH)=16 DISK CHANGE LINE STATUS
REG I STERS
(AH)=OO - DISK CHANGE LINE NOT ACTIVE
06 - DISK CHANGE LINE ACTIVE & CARRY BIT ON
(OL) - DRIVE NUMBER (0-1 ALLOWED, VALUE CHECKED)
(AH}=17 SET DASD TYPE FOR FORMAT
REGI STERS
(Al)
00 - NOT USED
01 - DISKETTE 320j360K IN 320/360K DRIVE
02 - DISKETTE 320/3601<'. IN 1.2M DRIVE
03 - OISKETTE 1 ,21~ IN 1.2M DRIVE
(Dl) - DRIVE NUMBER (0-1 ALLOWED, VALUE CHECKED;
DO NOT USE WHEN DISKE.TTE ATTACH CARD USED)
DISK CI1ANGE STATUS IS ONLY CHECKED WHEN A 1.2M BYTE DISKETTE
DRIVE IS SPECIFIED.
IF THE DISK CHANGE LINE IS fOUND TO BE
ACTIVE THE FOLLOWING ACTIONS TAKE PLACE:
ATTEMPT TO RESET DISK CHANGE LINE TO INACTIVE STATE.
IF ATTEMPT SUCCEEDS SET DASD TYPE fOR FORMAT AND RETURN 0151<
CHANGE ERROR CODE
I f ATTEMPT FAILS RETURN TIMEOUT ERROR CODE AND SET OASD TYPE
TO A PREDETERMINED STATE INDICATING 1~[DIA TYPE UNKNOWN.
IF THE DISK CHANGE LINE IN INACTIVE PERFORM SET DASD TYPE FOR FORMAT.
DATA VARIABLE -- DISK POINTER
DOUBLE WORD POINTER TO THE CURRENT SET OF DISKETTE PARAMETERS
OUTPUT
AH = STATUS OF OPERAT I ON
STATUS BITS ARE DEFINED IN THE EQUATES FOR DISKETTE STATUS
VARIABLE IN THE DATA SEGMENT OF THIS j~ODULE
CY = 0
SUCCESSFUL OPERATION (AH=O ON RETURN, EXCEPT FOR READ DASD
TYPE AH=(lS)).
CY = 1
FAILED OPERATION (AH HAS ERROR REASON)
FOR READ/WR I TE/VER I FY
OS, BX, OX, eH, CL PRESERVED
NOTE: IF AN ERROR IS REPORTED BY THE DISI<[TTE CODE, THE APPROPRIATE
ACTION IS TO RESET THE DISKETTE, THEN RETRY THE OPERATION.
ON READ ACCESSES, NO MOTOR START DELAY IS TAKEN, SO lllAT
THREE RETR I ES ARE REQU I RED ON READS TO ENSURE THAT THE
PROBLEM IS NOT DUE TO MOTOR START-UP.
DISKETTE STATE MACHINE - ABSOLUTE ADORESS 40:90 & 91
(DRIVE 0 - 90, DRIVE 1 - 91)
BITS

Diskette 5-89

I

I
RESERVED

--PRESENT STATE

000:
001:
002-

36011.
360K
1.2r~

IN 36011. DRIVE UNESTA8LISHEO
IN 1.2M DRIVE UNESTABLISHED
IN 1. 2M DRIVE UNESTABLISHED

OOit;
005:

36011.
1.2M

IN 1.2M DRIVE ESTABLISHED
IN 102M DRIVE ESTABLISHED

003~ 360K IN 360K DRIVE ESTABLISHED

------>
--------------;>

MEDIA/DRIVE ESTABLISHED
DOUBLE STEPP I NG REQU I RED (360K IN 1 _2M
DRIVE)

---------------------------- -> DATA TRANSFER RATE FOR THIS DRIVE;
00: 500 KBS
01; 300 KBS
10; 250 KBS
11: KI;.::;ll{V£O
STATE OPERATION STARTED
(DRIVE 0 - 92, DRIVE 1
PHESENT CYLI NDER NUMBER
(ORIV[ 0 - 94, DRIVE 1

-

ABSOLUTE ADDRESS 40:92 &: 93
93)
AflSOLUTE ADDRESS 40: 94 &: 95
95)

ASSUME
CS;CODE,DS:DATA,ES:DATA
PUBLIC
DISKETTE_IO_1
;;>:>:> ENTRY PO I NT FOR ORC OEC59H
DISKETTE 10 1
PROC
FAR
STII NTERRUPTS BACK ON
SAVE ADDRESS
PUSH
BX
ex
PUSH
SAVE SEGMENT REG I STtR VALUE
PUSH
os
SAVE ALL REGISTERS DURINC OPERATION
51
PUSH
PUSH
DI
BP
PUSH
OX
PUSH
SP, SP
SET UP PO I NTER TO HE/\D PARM
Mav
SI,DATA
Mav
Mav
05,51
SET DATA REGIOI~
CHECK FOR RESET AND STATUS OPERATIONS
eMP
AH,l
BYPASS DR I VE CH EGK I F YES
JBE
R4

0000
0000
0001
0002
0003
0004
0005
0006
0007
0008
OOOA
0000
OOOF
0012

FB
53
51
1E
56
57
55
52
8B
8E
8E
80
76

0014
0017

BO FA 01
76 OA

0019
001 E
0021

C6 06 0041 R 01
BE 0000
EB 49

0023
002 11
0027
0028
002A
0020

50
1:.8 OlOe R
5E
88 06
80 FE 01
76 30

002F
0034

74 36

TEST
JZ

0036
0039

80 FE 15
73 31

CMP
JAE

OK

003B
003E
00 110

Mav

ox, [O? I

XOH

~~:~~

0046
0048

BB
32
8A
8A
OA
75

OR
JNZ

AH,DISKETTE_srATUS
; GET STATUS OF OPERATION
AH, AH
; SEE I f ANY ERRORS
RETRY
; JUMP TO CHECK FOR MEDI A CHANGE

OOIIA
004E
0051

8A A7 0090 R
F6 C4 10
75 14

MOV
TEST
JNl

AH,OSK_SfATE[BX]
AIi,DETERMINED
OK2

0053
0055
0058
0058
OOJE
0060
0063
0067
006C
OOGf
0071

8A
80
80
80
OA
80
88
C6
BB
813
50
E8
88
58
80

MOV
ANO
AOO
AND

CL,AH
Cl, STATE_MSK
CL,3
AH, REV STATE
AH,GL AH,DETERMINED
;
DSK_STATE[6XI.AH ;
DSK_STATE[6X+2],0
BX,4
DX,SI
AX
GET PARM
r40TOR_COUNT, AH

001~2

0072

00-(5
0079
007A
0070

EC
----

R

DE
Fe 01
OF

f6 06 008F R 01

56 00
FF
DA
26 0041
E4
4C

CC
[1
C1
E4
El
CC

CHECK DRIVE NUMBEH fOR VALIDITY
I F VAll 0 CO NT I NUE

JBE

DL,l
R4

Mav
Mav
JMP

DISKETTE_STATUS,BAO_CMD; INVALID DRIVE ADDRESS, TERMINATE
51,0
INSURE THAT RETURN STATUS GETS SETUP
SHORT OK
GO TERM I NATE COMMAND

PUSH
CALL
POP
MOV
CMP
JBE

AX
J1

CMP

R5:

SAVE ORIGINAL OPERATION FOR RETRY LATER ON
CALL THE REST TO ENSUHE OS RESTORED
RESTORE OR I G I NAl OPERAT I ON FOR RETRY
GET OR I G I NAL OPERAT J ON FOR TEST I NG
SEE I FIT J S A RESET OR STATUS OPERAT I ON
BYPASS STATE UPDATE

51

OX,SI
OH,1
OK

GO DETERMINE TYPE OF CONTROLLER CARD
DISKETTE ATTACH CAR.D

HF_CNTRL,OUAL
OK

READ DISK CHANGE STATUS OR DISK TYPE COMMAND
I F YES, BYPASS STATE PROCESS I NG

DH,15H

RESTORE DR IVE PARAMETER
;ETUP ADDRESS 10 MEDIA STATE FOR THIS DRIVE

;

Mav

Mav

R

07
03
F8

OK

10
0090 R
87 0092 R 00
0004
06

OR

M

Mav

OK2:
OK:

0382 R
26 0040 R

MOV
MOV
MOV
PUSH
CALL
MOV
POP
CMP

CF 15

;

AX

DfI,015H
R20

GET MEDIA STATE Of DRIVE
SEE IF MEDIA STATE SET ALREADY
I F SET, DONT CHANGE STATE

GET PRESENT STATE
I SOLATE STATE NUMBER
ELEVATE STATE TO SET ALREADY
CLEAR OUT STATE NUMBER
SET NEW STATE NUMBER
MAKE MEDIA STATE SET
SAVE IN DRIVE STATE INDICATOR
; CLEAR ORIGINAL STATE OPERATION STARTED
GET THE MOTOR 'riA I T PARAMETER
GET ORIGINAL OP AGAIN
SAVE RETURN VALUE
SET THE TIMER COUNT FOR THE MOTOR
RESTORE RETURN VALUE
SEE I FREAD DASD OPERATION
I F NOT BYPASS

75 05

IN[

D07F
0081
0082

86 EO
F8
E8 08

XCHG
CLC

AH,AL

JMP

SHORT R19

0081~

8A 26 0041
80 FC 01
F5
5A
50
5F

MOV

AH,DISKETTE_STATUS
; GET STATUS OF OPERATION
AH,1
SET THE CARRY FLAG TO INDICATE
;
SUCCESS OR FAI lURE
ox
; RESTORE ALL REGISTERS
BP
01
Sl

0088

008B
008e
0080
008E
008r
0090
0091
0092
0093

R

R20:

eMP
eMe

R19:

POP
POP

POP
POP

5[

PUT RFSULT IN AH
SET SUCCESSFUL OPERATION
GO LEAVE

os

F

POP

59

POP
POP
RET

ex

CMP
JE

DISKETTE_STATUS,MEDIA_CHANGE ; CHECK FOR DISK CHANGE ERROR
OK1
; TRUE ERROR DONT RETRY

MOV
AND
CMP
JAE

AH,DSK_STATE[BX]; GET MEDIA STATE or DRIVE
AH, STATE MSK
I SOlATE STATE
AH,3
SEE IF IN STATE 3
OK2
IF fSTABLISHED STATE THEN TRUE ERROR

58
CA 0002

0096
0098

80 3E 0041
74 54

OOYD
OOAl
00A4
OOA7

8A
80
80
73

OOA9
OOAB
OOAE

FE C4
80 FC 03
75 02

OOBO
00B2
00B6
00B9

84
8A
80
3A

R 06

RETRY:

A7 0090 R
E4 07
Fe 03

BE

BX
2

; ------ HANDLE STATES 0,

5-90

00
AF 0092 R
E5 07
EC

Diskette

INC

AH

eMP

AH,3
R2

JNE

R2:

MOV
t40V
AND
eMP

;
;

RECOVER ADDRESS
THROW AWAY SAVED

FLAGS

1 & 2
TRY NEXT STATE
SEE If OVERFLOW IN NON-ESTABLISHED STATES
SKIP RESET TO BEGINNING IF YES

AH,O
; NEXT STATE TO TRY M fEH OVERFLOW
CH,DSK_STATE[BX+2] ; GET START REfRY STATE
CH,STATE_MSK
; ISOLATE STATE BITS
CH,AH
; ALL STATES TRIED

IN

OOBB

JE

74 47

OK3

;

I F YES, THEN TRUE ERROR

;------ SETUP STATE INDICATOR fOR RETRY ATTEMPT
OOBO
00C3

8A AF 0090 R
00 C5
00 C5

OOC~

80 E5 03

OOCl

ooce

OOCA

OOCO
OOCF
0001
0003
0005
0008
OODA
0000
OODF

MOV
ROL
ROL
AND
DEC

FE CD
80 FD FF
75 02

B5
DO
DO
80
75

eMP
JNE

02
CD
CD

R3:

FC 01
03

BO CD 20
OA E5
BB A 7 0090 R

R9:

CH, OSK_STATE[ BX] ; GET STATE I NOI CATOR
CH.l
; MOVE TRANSFER RATE TO LOW ORDER BITS

g~;

iRAN_MSK
CH
CH,OFFH
R3

i7

SOLATE TRANSFER RATE BITS
; CONVERT TO NEXT RATE
, SEE IF OVERFLOW OCCURRED
; JUMP I F NO OVERFLOW

CH, XRATE
CH,l
CH,l

SET TO NEXT RATE
:UT TRANSfER BI TS BACK WHERE THEY BELONG

AH,l

SEE IF TH I S STATE REQU I RES DOU8LE STEP
I F NOT, BYPASS SETT I NG DOUBLE STEP

MOV
ROR
ROR
eMP
JNE

R9

DR
OR
MOV

TURN ON DOUBLE STEP REQU I REO
CH, DOUBLCSTEP
AH.CH
• COMBINE WITH STATE TO MAKE NEW INDICATOR
DSK_STATE[8Xj,AH ; SAVE AS NEW INDICATOR

;------ SETUP FOR ACTUAL RETRY OPERATION

00E3
00E6
00E9
OOEC
OOEE

88
BB
BB
8B
E9

56 00
4E OA
SE OC
C6
0023 R

oon
OOF4
oon

6B 56 00
E8 0604 R
75 03

OK1 :

MOV
MOV
MOV
MOV
JMP

DX 1 [BPj
CX,[BP+l0l
BX, [BP+121
AX, SI
R4

:ESTORE PARAMETERS fROM STACK

MOV
CALL
JNZ

OX, [BPj
READ_DSKCHNG
OK4

RESTORE DR I VE PARMETER
GO READ DISK CHANGE LINE STATUS
IF ACTIVE. NO DISKETTE IN DRIVE. TIMEOUT
IF NOT ACTIVE. DISKETTE IN DRIVE, DISK CHANGE

GO RETRY OPERATION

00F9

E9 0067 R

JMP

OK2

OOFC
0101

C6 06 0041 R 80
E9 0061 R

MOV
JMP

DISKETTE_STATUS,TlMeOUT;
OK2

0104
0109

C6 87 0090 R 80
E9 0067

MOV
JHP

DSK_STATEr BXl, POA_START ;
OK2

n

OK3:

DISKETTE_IO_'

OlOC

INDICATE TIMEOUT IF DRIVE EMPTY
ERROR PUT STATE AT POWER ON ASSUHPT ION

ENOP

; ------ DETERM I NE NEW MED I A TYPE, NEED TO RESET 0 I 5K CHANGE II NE HERE
OlOC

OlOC

BO FC 01

OlOF

76 76

PROC
eMP
JBE

NEAR
AH,1
J1E

TEST FOR RESET AND STATUS OPERATION
BYPASS STATE CHECK AND UPDATE

HF _CNTRL. DUAL
J1A

GO DETERM I NE TYPE OF CONTROLLER CARD
01 SKETTE ATTACH CARD

0111
01'6

74 11

TEST
JZ

0118
0118

80 FC 15
13 6A

eMP
JAE

AH.15H
J1E

TEST FOR 01 SK CHANGE STATUS OR 01 SK TYPE
BYPASS STATE CHECK AND UPDATE

0110
011E
011 F
0120
0121
0124

50
53
51
52

AX

ex
ox

[8 0604 R
74 DC

PUSH
PUSH
PUSH
PUSH
CALL
JZ

READ_DSKCHNG
J1I

.

0126

E9 05E2 R

JMP

Jlf

HANDLE 0 I SK CHANGE LI NE ACT I VE

0129

50
53

AX
OX
READ_DSKCHNG
SHORT J1H

.

F6 06 008F R 01

SAVE ORIGINAL PARAMETERS
!AVE PARAMETERS

BX

GO READ DISK CHANGE LINE STATE
BYPASS HANDLING DISK CHANGE LINE

SAVE OR I G I NAL PARAMETERS
;AVE PARAMETERS

0128
012C
0120
0130

52
E6 0604 R
EB 51

PUSH
PUSH
PUSH
PUSH
CALL
JMP

0132
0136
0138

BA 67 0090 R
OA CO
75 06

MOV
OR
JNZ

AL,DSK_STATE[BX] ; GET MEDIA STATE INFORMATION FOR DRIVE
AL,AL
CHECK FOR NO STATE INFORMATION AT ALL
J10
IF INFORMATION DONT DEFAULT

013A
013C

BO 60
86 67 0090 R

MOV
MOV

AL. POA_START
; GET DEFAULT TO STATE
DSK_STATE[ BXl.AL ; SET UP DEFAULT TO STATE 1

0140
0142

3C 61
75 1E

eMP
JNE

AL, POA_DUAL
J1G

SEE I F DOUBLE STEP RATE
BYPASS TRACK CHECK

0144

BS 4E OA

0147
014A

60 FO 26

72 16

MOV
eMP
JB

CX, [BP+l0}
CH.40
J1G

GET ORIGINAL TRACK PARAMETER
SEE I F TRACK IS PAST END OF 0 I SKETTE( 320)
GO TRY OPERATION AT THIS STATE IF NOT

014C

C6 87 0090 R 02
BO 02
BA B7 0092 R
OA F6
75 13

MOV
MOV
MOV
OR
JNZ

OSK STATE[BXl.02H ; SET NEXT STATE TO TRY IN ALGORITHM
AL,02H
, PUT NEW STATE IN WORKING REGISTER
OH, DSK_STATE[ BX+2j , CFT OPERATION START STATE
DH,DH
CHECK FOR OPERATION START
J 1C
I F STARTED PREV I OUSLY, BYPASS SETT I NG IT UP

015B
0160

C6 67 0092 R 61
ES OC

MOV
JMP

DSK_STATE[BX+2], POA_DUAL ; SETUP STARTING STATE
SHORT J1C
; BYPASS NEXT STEP ALREADY DONE

0162
0166
0166

6A 97 0092 R
OA 02
75 04

MOV
OR
JHZ

DL.DSK_STATE[BX+2] ; GET START MEDIA STATE
DL.DL
SEE IF THIS IS ORIGINAL OPERATION OR A RETRY
J1C
IF RETRY IGNORE

Ol6A

88 87 0092 R

Ol6E

8A DE 008B R
3A C1
74 00

MOV
MOV
eMP
JE

DSK STATE(BX+2],AL ; SAVE AS STARTING DATA RATE
CL, IASTRATE
; GET LAST DATA RATE SELECTED
AL,CL
; COMPARE TO LAST OPERATION
J1H
; I F SAME DONT SELECT NEW TRANSFER RATE

MOV
ROL
ROL
AND
HOV

AL,l

Ol2A

0151
0153
0157

0159

0172
0174
0176
0179
0178
0170
017F
0162
0183
0184
0185
0186
0167
0189
OlSE
0190
0192
0194
0196
0196
0190
019F
OlAl
01A3

51

A2 008B R
DO CO
DO CO
24 03
BA 03F7
EE
SA

59
56
56
8A
80
OA
74

FE

Fa
26 003F R 7F
E4
36
CC
76
06 oOln R 00
CC
6E

74
C6
FE
14
FE CC
15 03
E9 0240 R

J1C:

OUT

J1H:

J1E:

POP
POP
POP
POP
MOV
AND
OR
JZ
OEe
JZ
MOV
DEC

JZ
DEC

JHZ
JMP

BX

ex

SELECT DRIVE FOR DISKETTE ATTACH CARD
IGNORE DISK CHANGE STATUS

a

SAVE NEW TRANSFER RATE FOR NEXT CHECK
TRANSFER RATE DATA TO LOW BITS

LASTRATE,AL
AL.1
AL, TRAN_MSK
OX,03F7H
DX,AL

ox
ex

BX

~OVE

;
;

CLEAR ALL BITS BUT DATA TRANSFER RATE BITS
ADDRESS FLOPPY CONTROL REG I STER
SET DATA TRANSFER RATE
• ~ESTORE PARAMETERS

,

.

AX

DH,AL
• SAVE # SECTORS IN DH
MOTOR_STATUS,07FH
; INDICATE A READ OPERATION
AH,AH
; AH::O
DISK RESET
AH ; AH=l

g:~~E~~~~~~ATUS,O

AH
DISK READ
AH -

J2

;

RESET THE STATUS INDICATOR

; AH=2
; AH=3
; TEST_oISK_VERF

DISK_WRITE

Diskette 5-91

J2:

01A6
01A6
01A8
DIM
01AC
01AE
0161

rE
74
FE
74
80
7S

0163

E9 0698 R

01B6
01B8

FE CC
75 03

alBA
0160
OlBF

Dec

CC
6c
CC
6C
EC 10
03

TEST_DISK_VERF
AH"'4

SUO

AH
DISK_VERF
AH
DISK rORMAT
AH,10H

JNZ

J3

JMP

01 SK_ TYPE

GO PERFORM OISI( TYPE OPERATION
AH = 16H
BYPASS 0 I SK CHANGE STATUS

JZ
DEC

JZ

AH=5
AH=15H
BYPASS 01 SK TYPE OPERATION

DEC

AH

JNZ

J4

E9 0646 R

JMP

DISK_CHANGE

GO CHECK DISK CHANGE LINE STATUS

FE CC
7S 03

DEC

AH

JNZ

AH = 17H
BAD COMMAND

OlCl

E9 0700 R

JMP

FORMAT_SET

01C4
01C9
01CA

c6 06 0041

MOV

U I SKIc II E_STATUS, BAO_CMO

J3:

R 01

J'

GO SET MED I A/OR I VE TYPE FOR FORMAT
;

RET

C3

; ERROR CODE, NO SECTORS TRANSfERRED
UNDEr I NED OPERAT I ON

ENoP

Jl

;------ RESET THE DISKETTE SYSTEM
OlCA
01CA
01CD
aleE
0101
0103
0105
0107
0109
010A
010F

OlE"

01E6
01 E8
01 E9
01 EA
OlEO
OlfO
Olf2
Olf"
01F9

DISK_RESET
BA
FA
AO
24
Bl
02

03F2

MOV

003F R
3F
04
CO

MOV
AND
MOV

OC
EE
C6
C6
EB
OC
EE
FB
£8
AD
3C
74
80

08

OR

U6 003E R 00
06 0041 R 00
00
04

OUT
MOV
MOV
JMP
OR
OUT

CLI

ROL

STI
CALL

051A R
0042 R
CO
06
DE 0041 R 20

MOV
CMP

JZ

OR

RET

C3

PROC
NEAR
DX,03F2H

ADAPTER CONTROL PORT
NO INTERRUPTS
WHICH MOTOR IS ON
STRI P Ofr UNWANTED BITS
SH I fT COUNT
MOvE MOTOR VALUE TO HIGH NIBBLE, DRIVE SELECT
TO LOW NIBBLE
AL,8
TURN ON I NTERRUPT ENABLE
OX, AL
RESET THE ADAPTER
SEEK_STATUS, a
,SET REGAL REQUIRED ON ALL DRIVES
DISKETTE STATUS,O ; SET OK STATUS FOR DISKETTE
$+2
; I/O WAIT STATE
AL,4
TURN OFf RESET
OX, AL
TURN OFF THE RESET
REENABLE THE INTERRUPTS
CHK STAT 2
00 SENSE I NTERRUPT STATUS fOLLOW I NG RESET
AL, 'NEC STATUS
IGNORE ERROR RETURN AND 00 OWN TEST
AL,OCOH
; TEST FOR DRIVE READY TRANSITION
J7
; EVERYTH I NG OK
DISKETTE_STATUS,BAO_NEC ; SET ERROR CODE
AL, MOTOR_STATUS;
AL,03FH
CL,4
AL, CL

; ------ SEND SPEC I FY COMMAND TO NEC
OlfA
OlfA
OlfC
01 FF
0202
0205
0208
020B
020C

J7:
64
E8
BB
E8
BB
£8

MOV
CALL
MOV
CALL
MOV
CALL

03
03E2 R
0001
0382 R
0003
0382 R

AH,03H
NEC_OUTPUT
BX,l
GET PARM
BX,"3
GET _PARM

RET

C3

DISK_RESET

DR IVE READY
SPECIFY COMMAND
OUTPUT THE COMMAND
FIRST BYTE PARM I N BLOCK
TO THE NEC CONTROLLER
SECOND eyrE PARM I N BLOCK
TO THE NEe CONTROLLER
RESET RE
RETURN TO CALLER

ENOP

;------ DISKETTE STATUS ROUTINE
020C
020C
0200

DISK STATUS
RET
DISK_STATUS

C3

PRoe

NEAR

ENOP

; ------ DISKETTE READ
0200
0200
020F
020f
0212
0214
0216

PRoe
NEAR
AL,046H

BO 46
J9:
CALL

E8 04CA R
84 E6
EB 36

MOV
JMP

DISK_READ

DHA SETUP
AH,OE611
SHORT RW OPN
ENOP
-

READ COMMAND fOR DMA
DISK READ CONT
SET ijp THE OMA
SET UP READ COMMAND fOR NEC CONTROLLER
GO 00 THE OPERATION

;------ DISKETTE VERifY
0216
0216
0218
021A

D I SK_VERf

BO

MOV
JMP

1~2

EB F5

DISK_VERF

PRoe
NEAR
AL,042H

VER I FY COMMAND FOR DMA
DO AS IF olSI( READ

J9
ENOP

; ------ DISKETTE fORMAT
021A
021A
021F
0221
0224
0226
0228
0228
022B
022E
0231
0234
0237
023A
0230
0240

MOV
JMP

PROC
NEAR
MOTOR_STATUS, WRI TE_OP
AL,04AH
OMA SETUP
AH, 04DH
SHORT RW_OPN

MOV

BX,7

CALL

Glcl PARM
BX, '9
GET PARM

DISK FORMAT
80
BO
EB
B4
EB

-

DE 003F R 80
4A
04CA R
40
24

OR

MOV

CALL
Jl0:

BB 0007
E8 0382 R
BB 0009
£8 03B2 R
B6 OOOF
[8 0382 R
BB ~Oll
E9 032A R

MOV

CALL
MOV

ax,15

CALL

GET PARM

MOV
JMP

J16

DISK_fORMAT

ax,17

INDICATE WRITE OPERATION
WILL WRITE TO THE DISKETTE
SET UP THE DHA
ESTA8L1 SH THE FORMAT COMMAND
DO THE OPERATION
CONTINUATION OF RW_OPN fOR fMT
GET THE
BYTES/SECTOR VALUE TO NEC
GET THE
SECTORS/TRACK VALUE TO NEC
GET THE
GAP LENGTH VALUE TO NEC
GEl THE fl LLER BYTE
TO TH E CONTROLLER

ENOP

; ------ 0 I SKETTE WR j TE ROUT I NE
0240
0240
0245
0247
024A
024C

80
60
E8
B4

OE 003F R 80
4A
04CA R
C5

DISK WRITE
PROC
NEAR
OR
MOTOR_STATUS,WRI TE_OP
INDICATE WRITE OPERATION
MOV
AL,04AH
DMA WR I TE COMMAND
CALL
DMA SETUP
MOV
AH,OC5H
NEC COMMAND TO WRITE TO DISKETTE
DISK_WRITE
ENDP
;----- ALLOW WRITE ROUTINE TO FALL INTO RW_OPN

. - --- -------------------------------

;
;
024C
024C
024E
0253
0255
0256
0256

R~COPN

kW~OPN --P~OC--

J NC
MOV
MOV
RET

73 08
C6 06 0041 R 09
BO 00
C3

Jll:
PUSH

50

----

THIS ROUTINE PERfORMS THE READ/WRITE/VERIFY OPERATION

--N E;'~------- -------------

J 11
; T EST FOR OI-IA ERROR
DISKEHE_STATUS,DHA_BOUNDARY
; SET ERROR
AL,O
; NO SECTORS TRANSfERRED
j RETURN TO MAIN ROUTINE
; DO RWOPN
AX
; SAVE THE COMMAND

;------ TURN ON THE MOTOR AND SELECT THE DRIVE

5-92

Diskette

0257
0258
02SA
02se
025E
025F
·0263

51
8A
BO
02
FA
8 11
74

PUSH
MOV
MOV

CA
01
EO

SAL

CX
Cl,Dl
Al,l
Al,Cl

Cli
06 003F R
DC

0265
026A
026F

80 3E 0040 R EC
C6 06 0040 R FF
72 42

0271
0275
0277
027C
027E
0282
0284
0285
0288
028A
028C
028E
028F
0292
0293

08
B1
80
02
08
02
FB
AO
24
02
DC
52
SA

06 003F R
04
26 003F R CF
C2
16 003F R
CA

R13:

TEST
JZ

Al, MOTOR_STATUS

CMP

MOV
JB

MOTOR_COUNT, aECH
MOTOR_COUNT,OFFH
J14

SEE I F THE MOTOR HAS BEEN ON LONG ENOUGH
ENSURE MOTOR DOESNT TURN OFF OUR I NG OPERATI ON
I S LESS THAN EC, THEN TURN ON NOT DUE TO
READING Of DISK CHANGE LINE, OTHERWISE
CO TEST FOR WAIT NECESSARY

OR
MOV
AND
ROl
DR
ROR

MOTOR_STATUS,AL
Cl,4
MOTOR_STATUS, OCFH
Dl,Cl
MOTOR_STATUS,DL
DL,Cl

TURN ON THE CURRENT MOTOR
SH I FT COUNT TO MOVE DR I VE TO HIGH NIBBLE
CLEAR ENCODED DRIVE SELECT 81TS(4 & 5)
MOVE DRIVE ENCODED BITS TO HIGH NIBBLE
SAVE AS SELECTED DR I VE
RESTORE
INTERRUPTS BACK ON
GET MOTORS ON AND DR I VE SELECTED
STRIP OFF UNWANTED BITS
SH I FT BITS AROUND TO DES I REO pas I T IONS
NO RESET, [NABLE DMAII NT
SAVE REG
CONTROL PORT ADDRESS

R13

STI

MOV
AND
ROl
OR
PUSH
MOV

003F R
3F
CO
DC
03F2

OUT
POP

EE

SA

SAVE THE J IS PARMS
GET DR I VE NUMBER AS SH I FT COUNT
MASK FOR DETERMINING MOTOR BIT
SHIFT THE MASK BIT
NO INTERRUPTS WHILE DETERMINING MOTOR STATUS
IS THIS MOTOR ON
I F NOT GO TEST FOR WAIT NECESSARY

Al, MOTOR_ STATUS
Al,03FH
Al,CL
Al,OCH
DX
OX, 03F2H
DX,AL
DX

RECOVER REG I STERS

; ------ WAI T FOR MOTOR
0294
0295
0298
029A

F8
B8 90FD
CD 15
72 17

Cle

MOV

AX,090FDH

INT
JC

Jl'

029C
029F
02A2
02A4
02A4
02A6
02A8

B8 0014
E8 0362 R
OA E4

MOV
CALL
OR

aX,20
GET_PARM
AH.AH

74 00
28 C9
E2 FE

JZ
J13:

LOOP

J14
CX,CX
J13

O?AA
02AD

89 6006
E2 FE

R18:

MOV
LOOP

CX.06006H
R18

02Af
02B1

FE CC
75 F1

',H

J12:
SUB

DEC
JNZ

AH
J12

FB
59

02B5
02B8
02B9
02BB
02BO
02BF
02C2

E8
58
8A
B6
72
BE
56

041C R

02C3
02C6
02C9
02es
02CO
0200
0202

£6
8A
DO
DO
80
OA
£8

03E2 R
66 01
Ell
E4
E4 04
£2
03E2 R

02050
0208
020A

80 f f 40
75 03
E9 0228 R

0200
020F
02E2
02E5
02E8
02EA
02EO
02FO
02F3
02F6
02F9
02FC
02FE
0302
0305

SA
E8
8A
E8
8A
E8
BB
E8
aa
E8
88
32
8A
F6
14

STI
POP

GET THE MOTOR WAIT
PARAMETER
TEST FOR NO WAIT
TEST WAIT TIME
EXIT-WITH-TIME EXPIRED
SET UP 1/8 SECOND LOOP TIME
WAIT FOR THE REQUIRED TIME

DECREMENT T I ME VALUE
ARE WE DONE YET
MOTOR RUN:-i j NG
INTERRUPTS BACK ON FOR BYPASS WAIT

J14:

02B3
02B3
02B4

CLEAR TIMEOUT INDICATOR
LOAD WAIT CODE & TYPE
PERFORM OTHER FUNCT I ON
BYPASS liMING LOOP If IIM.l:.OUI O(;CUKKt.D

ex

;------ 00 THE SEEK OPERATION
CALL
POP
MOV
MOV
JC
MOV
PUSH

FC
00
72
0331 R

SEEK
AX
BH,AH
OH,O
J17
SI,OFFSET J17
SI

MOVE TO CORRECT TRACK
RECOVER COMMAND
SAVE COMMAND IN aH
SET NO SECTORS READ I No CASE OF ERROR
I F ERROR, THEN EX I T AFTER MOTOR OFF
DUMMY RETURN ON STACK FOR NEC OUTPUT
SO THAT IT WILL RETURN TO MOTOR OFF LOCATION

; ------ SEND OUT THE PARAMETERS TO THE CONTROLLER
CALL
MOV
SAL
SAL

AND
OR
CALL

NlC OUIPUI
AH, TBP+11
AH,l
AH.l
AH,4
AH.OL
NEC_OUTPUT

au I PUT 1 HE. OPE.RAI ION COMMAND
GET THE CURRENT HEAD NUMBER
MOVE IT TO BIT 2
ISOLATE THAT BIT
OR I N THE DR I VE NU~IBER

; ------ TEST FOR FORMAT COMMAND

£5
03E2 R
66 01
03E2 R
E1
03E2 R
0007
0382 R
0009
0382 R
SE 00
FF
A7 0090 R
C4 10
06

0307
030A

80 E4 07
80 EC 03

0300
0310
0313

60 E4 07
80 Fe 00
75 04

0315
0317

B4 2A
EB DB

0319
031C

80 FC 01
75 04

031E
0320

B4 23
EB 02

0322
0324
0327
032A
032A
0320

B4 1S
E8 03E2 R
SS 0000

J15:

CMP

BH.04DH

JNE

Jl,

JMP

JlO

MOV
CALL
MOV
CALL
MOV
CALL
MOV
CALL
MOV
CALL
MOV
XOR
MOV
TEST
JZ

AH.CH
CYLINDER NUMBER
NEC OUTPUT
AH,TBP+1]
HEAD NUMBER FROM STACK
NEC_OUTPUT
AH,CL
SECTOR NUMBER
NEC_OUTPUT
BX,7
BYTES/SECTOR PARM FROM BLOCK
GET_PARM
TO THE NEC
aX,9
EaT PARM FROM BLOCK
GET PARM
TO THE NEC
ax, TSP1
RESTORE DRIVE NUMBER FROM PARMS
BH,BH
CLEAR HJGH ORDER INDEX REGISTER
AH,DSK_STATE[BX] ; GET DRIVE STATE VALUE
AH, DETERM I NED
SEE I F STATE ALREADY ESTABLI SHED
DO
BYPASS STATE REDUCT I ON FOR GAP LENGTH

ANO

AH, 07H
AH,03H

STRIP OFF HIGH BITS
REDUCE STATES

AB,07H
AH,O
R16

STRIP OFF HIGH BITS
CHECK FOR DISKETTE ATTACH CARD OR 320 DRIVE
I F NOT CHECK FOR NEXT STATE

SUB

DO:

ANO
eMP

JNE
,.IOV
JMP

R16:

CMP

JNE

R15:

AH,O?AH
SHORT R15

I DAD 3::>0/360 OR 1VF GAP I fNGTH
GO ounUT

AH,l
R17

CHECK FOR 320 MEDIA IN 1.2 DRIVE
IF NOT, THEN HANDLE 1.2 MEDIA IN 1.2 DRIVE
LOAD 320/360 ME:.DIA IN 1.2 DRIVE GAP LENGTH

JMP

AH.023H
SHORT R15

MOV
CALL
MOV

AH,OlBH
NEC_OUTPUT
BX,13

CALL
POP

GET PARM
SI -

MOV

R17:
J16:

E8 0382 R
5E

IS THIS A fORMAT OPERATION
NO. cornlNuE WITH R/W/V
I F SO, HANDLE SPECIAL

LOAD 1.2 MEDIA IN 1.2 DRIVE GAP LENGTH
OTL PARM FROM BLOCK
RW OPN FINISH
T'O THE NEC
CAN NOW DISCARD THAT DUMMY RETURN ADDRESS

; ------ LET THE OpERAT I ON HAPPEN
032E
0331
0331

E8 053B R

GALL

WAIT_INT

JC

J21

J17:
72 45

WAIT FOR THE INTERRUPT
MOTOR OFF
LOOK FOR ERROR

Diskette 5-93

0333
0336

CALL
Je

E8 0580 R
72 3F

;
;

RESULTS
J20

GET THE NEC STATUS
LOOK FOR ERROR

;------ CHECK THE RESULTS RETURNED BY THE CONTROLLER
0338
0339
OBG
0330
033F
0341
0343

FC
BE
AC
24
74
3C
75

03lj5
03 116
0348
03 1jA
034e
0311E
0350
0352
0354
0356
0358
035A
035C
035E
0360
0362
0364
0366
0368
036A
036e

AC
DO EO
B4 04
72 24
DO EO
DO EO
B4 10
72 lC
DO EO
84 08
72 16
DO EO
DO EO
B4 04
72 DE
DO EO
Blj 03
72 08
DO EO
84 02
72 02

CLD
MOV
LODS
AND
JZ
GMP
JNZ

0042 R
CO
3B
40
29

; SET THE CORRECT DIRECTION
S I, OfFSET NEC STATUS
PO I NT TO STATUS FIELD
NEC_STATUS
GET STO
AL,OCOH
; TEST FOR NORMAL TERM I NAT I ON
J22
; OPN OK
AL.040H
; TEST FOR ABNORMAL TERMINATION
J18
; NOT ABNORMAL, BAD NEC

; ______ ABNORMAL TERMINATION,
LODS
SAL
MOV
JC
SAL
SAL
MOV
JC
SAL
MOV
JC
SAL
SAL
MOV
JC
SAL
MOV
JC
SAL
MOV
JC

FIND OUT WHY
GET Sil
TEST FOR EOT fOUND

NEC_STATUS
AL,l
AH, REGORD_NOT_FNO
J19
AL,l
AL,l
AH, BAD_CRG
J19
AL,l
AH. BAD _OMA
J 19
AL.1
AL,l
AH, RECORO_NOT_FN
J 19
AL,l
AH, WR I TE PROTECT
J19
AL,1
AH, BAD_AODR_MARK
J19

RI'CfAI L
TEST rOR CRC ERROR
RW FAJ L
TEST fOR DMA OVERRUN
RW_FAI L
TEST FOR RECORD NOT fOUND
RW_FAI L
TESI fOR WfUTE PROTECT
RW FAIL
TEST MISSING ADDRESS MARK
RW_FAI L

; ------ NEC MUST HAVE fAI LED
036E
036E
0370
0370
0374
0377
0377
0378
0378
037B

RW-NEC-FAI L

J18:
MOV

84 20

RW-FAI L

J19:
08 26 0041
£8 05e8 R

OR
CALL

R

DISKETTE_STATUS. AH
NUM_TRANS

J20:
RET

C3
J21 :

CALL
RET

E8 0580 R
C3

HOW MANY WERE REALLY TRANSFERRED
RW ERR
RETURN TO CALLER
;

RESULTS

RW_ERR_RES
FLUSH THE RESULTS BUFrER

;------ OPERATION WAS SUCCESSFUL
037C
037C
037F
0381
0382

J22:
£8 05ce R
32 E4
C3
RW_OPN

CALL
XOR
RET
ENDP

NUM TRANS
AH,AH

OPN OK
HOW-MANY COT MOVED
NO ERRORS

GET PARM
THIS ROUTINE FETCHES THE INDEXED POINTER FROM
THE DISK_BASE BLOCK POINTED AT BY THE DATA
VARIABLE DISK_POINTER
A BYTE FROM THAT TABLE IS THEN MOVED INTO AH,
THE I NDEX Of THAT BYTE BE! NG THE PARM IN BX
ENTRY -BX '" I NDEX OF BYTE TO BE FETCHED * 2
IF THE LOW BIT OF ex IS ON, THE BYTE IS IMMEDIATELY
OUTPUT TO THE NEC CONTROLLER
EX I T -AH = THAT BYTE FROM BLOCK

----PARM
- - -- ---- ---- ------ - -- - - - --- - -- - - -------PROC
NEAR

GET

0382
0382
0383
0384
0386

1E
56
28 CO
8E 08

0368
038C
038E
0390
0391
0392

C5 36 0078 R
D1 EB
8A 20
5E
1F
9C

0393
0396

83 FB OA
75 19

0398
0390

F6 06 003F R 80
7 11 09

039F
03A2

80 Fe 08
73 3A

03A4
03A6

811 08
EB 36

03A8
03AB
03AD
03AF
03B1
03B4

83 FB 09
75 28

03B6
0368

-

PUSH
PUSH
SUB
MOV
ASSUME
LOS
SHR
I

[\2

RET
MOV

BL,2

HIGH ORDER COUNT

XOR

CX,CX

RESET THE COUNT

IN
TEST
JNZ

AL,DX
AL,080H
J27

GET THE STATUS
IS IT READY
YES, GO OUTPUT

E2 F9

LOOP

J26

COUNT DOWN AND TRY AGA IN

FE CB

Dl.

15 F3

DEC
JNZ

J25

DECREMENT COUNTER
REPEAT TIL DELAY FIN I SHED

EO E4

JMP

J24

MOV
MOV
MOV
OUT
POP
POP
POP

AL,AH
DX,03F5H
DL,OF5H
OX,AL

83 02

Rl'?:
J2~:

33 C9
J26:

EC

ERROR COND I T I ON
OUTPUT
GET BYTE TO DUl PUT
DATA PORT

J27:

11

EE

0418
0 1119
OlllA
041B
041C

,D

Ol~

NEC_OUTPUT
PUSH
PUSH
PUSH
MOV
MOV
Rl1:
XOR
J23 :
IN
TEST
JZ
LOOP

F5

59
5A
C3

OU1PUT THE BYTE
RECOVER REG ISTERS
RECOVER REG I STERS

BX

ex
OX

RET

CY '" 0

N!:.C_OUTPUT

FROM TEST

I NSTRUCT I ON

ENOP

SEEK
THIS ROUfINE. WILL MOVE THE HEAD ON THE NAMED DRIVE
TO THE NAMED TRACK.
IF THE DRIVE HAS NOT BEEN ACCESSED
SINCE THE DRIVE RESET COMl'lAND WAS ISSUEn, THE ORlvr WILL BE
RECALIBRATED.
INPUT
(DL) '" DRIVE TO SEEK ON
(CH) "'" TRACK TO SEEK TO
OUTPUT
CY '" 0 SUCCESS
CY", 1 FAILURE -(AX) DESTROYED
041C
041C
041 E
Ol~ 1 F
0421
0lt23
0 1124
0428

SEEK

80 01
51
8A CA
D2 CO
59
84 06 003E R
15 37

042A
01.2E

08 06 003( R

0430

E8
8A
E8
E8
73

0433
0435
0438
043B

D',

PROC
tolOV
PUSH
MOV
ROL
POP
TEST
JNZ

ex

CL, DL
AL,CL

ex

AL, SEEK_STATlIS
J28

OR
MOY
CALL
MOV
CALL
CALL

07
03E2 R
[2

03£2 R
051A R
14

DISKET1E STATUS SET ACCORDINGLY
-

NEAR
AL,l

SEEK_STATUS, AL
AH,07H
NEC OUTPUT
AH, ill
NEC OUTPUT
CHK-STAT 2
J28A
-

J~lC

[Sl ABL I Srt MASK FOR RECAL TEST
SAVE I NPur VAllJ[S
GET OR IVE VALUE INTO CL
SHIFT IT BY THE DRIVE VALUE
RECOVER l'RACK VALUE
TEST fOR RECAL REQUIRED
NO_RECAL
TURN ON THE NO RECAL BIT
R[CAL I BRATE COMMAND

I N FLAG

OUTPUT THE DR lyE NUiolBER
GET THE. INHRUPT AND SENSE
SEEK_COMPLETE

lNT STATUS

ISSUE RECAL I !3RAT[ FOR 80 TRACK 01 SKETTES
0430
0442
0444
0441
0449
044C
044F
0451
0451
0456
0458
045A
04')C

C6 06 0041 R 00
BII
E8
8A
E8
[8

07
03E2 R

£2
03£2 R
051A R

72 78
F6 06 008F R 01

74 09

MOY
MOV
CALL
MOy
CALL
CALL
JC

DISKETTE_STATUS,O
AH,01H
NEC OUTPUT
AH,DL
NEC OUTPUT
Ci-UCSTAT 2
RB -

TEST
JZ

Ji8

GO DETERMINE TYPE OF CONTROLLER CARD
DISKETTE ATTACH CARD

BH, BH

;ET

FF
8A DA
C6 87 0094 R 00

DRIVE
0461

H~

XOR
MOY
MOV

32

CNTRL, DUAL

BL,DL
DSK_1RKIBX),O
IS

; CLEAR OUT INYALID STATUS
RECALIBRATE COMMAND
OUTPUT THE DR lYE Jl:UMBER
GET THE I NTERUPT ArlO SENSE
SEEK_ERROR

UP ADDRESSING TO STATE

I NT STATUS

INDICATOR

SAVE NEW CYL I NDER AS PRESENT POS I T I ON

IN SYNCH WITH CONTROLLER,

SEEK TO TRACK

J28:

Diskette

5-95

~ET

UP ADDRESSING TO STATE INDICATOR

01161
0"63
0 1165
046A

32
8A
f6
74

FF
DA
06 D08f R 01
09

TEST

BH. BH
BL.DL
H f _CNTRL. DUAL

JZ

R7

046C
0471

F6 87 0090 R 20
74 02

JZ

R7

0473
0475
0475
0479

DO E5

SHL

CH.1

DOUBLE NUMBER OF STEP TO TAKE

3A Af 0094 R
74 3E

GMP
JE

CH. DSK_ TRK[ SX]
J32

SEEK I F ALREADY AT THE DESI RED TRACK
I F YES. DONT NEED TO SEEK

0476
Oll7f
04B1
01lB4
0486
0489
0486
04BE
0491
0496

88
B4
EB
BA
£8
8A
EB
E8
f6
74

MOV
MOY

OSK_TRK[ 6xl. CH
AH,OfH

XOR
MOV

GO DETERMI NE TYPE OF CONTROLLER CARD
DISKETTE ATTACH CARD

DSK_STATE[ ex]. DOUBLE_STEP ; CHECK FOR DOUBLE STEP REQUIRED
; SINGLE STEP REQU I RED BYPASS DOUBLE

TEST

R7:

AF 0094 R
OF
03£2 R
E2
03£2 R
E5
03£2 R
051A R
06 DOBf R 01
09

CALL

NEC~OUTPUT

MOY

CALL
CALL
TEST

AH.DL
NEC_OUTPUT
AH.CH
NEC_OUTPUT
CHK_STAT_2
HF_CNTRL. DUAL

JZ

RA

TEST

CALL
MOV

SAVE NEW CYL 1NOER AS PRESENT POS I T I ON
SEEK COMMAND TO NEC
DR I VE NUMBER
GET CYLI NDER NUMBER
GET ENDING INTERRUPT AND SENSE STATUS
GO DETERMINE TYPE OF CONTROLLER CARD
DISKETTE ATTACH CARD

DII9B
0490

F6 87 0090 R 20
74 02

JZ

DSK_STATElBXI.DOUBLE_STEP; CHECK FOR DOUBLE STEP REQUIRED
RA
; 51 NGLE STEP REQU I RED BYPASS DOUBLE

049F
04Al

DO ED

SHR

CH. ,

04A1
04A2
0',A5
04AB
04A9
04A9
04AC
04AE
OliBO
04B2
04B4
04B6
04B6
04B7
04BB

9C

PUSHF

BB 0012
E8 0382 R

MOY

; SET BACK TO LOG I CAL SECTOR

RA:
; ----- WAIT FOR HEAD SETTLE

51

CX.BOO
AH,AH

SAVE REG I STER
HEAD_SETTLE
1 MS LOOP
TEST FOR TIME EXPIRED

OEC
JMP

J31
J30
AH
J29

DELAY FOR 1 MS
OECREMENT THE COUNT
00 I T SOME MORE

POP

GX

RECOVER STATE

SEEK_ERROR
GO DETERMI NE TYPE OF CONTROLLER CARD
DISKETTE ATTACH CARD

GX

J29:
MOV
OR
JZ

B9 0320

OA E4
74
E2
FE
EB

06
FE
CC
F3

J30:

LOOP

J31 :
59
90
G3

POPF
RETURN TO CALLER

RET

j32:

04B9
04B9
04BE

F6 06 008F R 01
74 09

TEST

HF_CNTRL. DUAL

JZ

RB

04Cu
04C5

f6 87 0090 R 20
74 02

JZ

RB

DO ED

SHR

CH# 1

04C7
04C9
04C9
04CA

SAVE STATUS FLAGS
~ET HEAD SETTLE PARAMETER

BX.18
GET_PARM

CALL
PUSH

OSK_STATE[BX].OOU8LE_STEP ; CHECK FOR DOUBLE STEP REQUIRED
; 51 NGLE 5TEP REQU I RED BYPASS DOUBLE

TEST

RB:

; SET BACK TO LOG I CAL SECTOR
; RETIJRN TO CAU fR

RET

C3

-------------- ---- ----- -----------------------------

SEEK
;

ENOP

DMA_SE~~fs

ROUTINE SETS UP THE oMA FOR READ/WRITE/VERIFY
OPERAT IONS.

INPUT

=

(AL)
MODE BYTE FOR THE DMA
(ES:BXI - ADDRESS TO READ/WRITE THE DATA

•
04CA
O/ICA
04CB
OliCC
04CE
04DO
0402
0404
0406
0408
04DA
040C
04DE
04EO
04E2
04£2
OllE3
OllE5
04E7
04E9
04E8
04ED
04EF
04F1

OUTPUT

{AX 1

.-------------------------------------- --- --- ------PROC
NEAR

OMA SETUP
PUSH

51

GLI
OUT
JMP
OUT
MOY
MOY
ROL
MOY

FA
E6 OC
(8 00
E6 DB
BC CO
81 04
03 CO
8A £8
24 FO
03 C3
73 02
FE C5

>U

E6
EB
8A
E6
BA
EB
24
£6

ANO
AOO
JNG

DESTROYED
CX

SAVE THE REG I STER
DISABLE INTERRUPTS DURING oMA SET-UP
SET THE FIRST/LAST F/F
WAIT FOR 10
OUTPUT THE MODE BYTE
GET THE ES VALUE
SHI FT COUNT
ROTATE LEFT
GET HIGHEST NYBBLE OF ES TO CH
ZERO THE LOW NYBBLE FROM SEGMENT
TEST FOR CARRY FROM AOD I TI ON

OMA+12.AL
$+2

DMA+11.AL
AX.ES
CL.4
AX.CL
CH,AL
AL.OFOH
AX.

ex

ING

J33
GH

PUSH

AX

OUT
JMP
MOY
OUT
MOY
JMP

DMA+4.AL

CARRY MEANS HIGH 4 BITS MUST BE INC

J33:

04
00
C4
04
CS
00
OF
81

ANO
OUT

SAVE START ADDRESS
OUTPUT LOW ADDRESS
WAIT FOR 10

$+2

AL.AH
DMA+4,AL
AL,CH
$+2

OUTPUT HIGH ADDRESS
GET HIGH 4 BITS
I/O WAIT STATE

AL,OFH
OB1H.AL

OUTPUT THE HIGH 4 BITS TO PAGE REGISTER

;------ DETERMINE COUNT
Ol~ F3
01lF5
04F7
Ollf9
04FA
04FD
0500
0502
0503
0505
0506
0507
0509
050B
0500
OjOF
0510
0511
0512
0514
0515
0517
0519
051A

MOY
SUB
SHR

BA E6
2A CO
01 E8

PUSH

50
BB 0006
E8 0382 R
BA CC

MOY

CALL
MOY
POP
SHL

,,8
50

OFC
PUSH

AX
AX

OUT
JMP
MOV
OUT

AL.AH
DMA+5.AL

E6
EB
8A
E6
FB

05
00
C4
OJ

POP
POP

58

AX.CL
DMA+5,AL
$+2

GX
AX

03 C1

ADD

AX,CX

59

POP
MOV
OUT
RET

GX

60 02
E6 OA
C3

DMA_SETUP

USE AS SHI FT COUNT (0=12B.

1=256 ETC)

AX

STI

59

*

GET THE BYTES/SECTOR PARM

BX,6
GET PARM
CL.AH

58

03 EO

NUMBER OF SECTORS
TIMES 256 INTO AX
SECTORS
128 INTO AX

AH.oH
AL.AL
AX,l
AX

AL.2
DMA+l0,AL

;
;
;
;
;

MULTIPLY BY CORRECT AMOUNT
-1 FOR DMA VALUE
SAVE COUNT VALUE
LOW BYTE OF COUNT
WAIT FOR 10
HIGH BYTE OF COUNT
RE-ENABLE I NTERRU PTS
RECOVER COUNT VALUE
RECOVER ADDRESS VALUE
ADD, TEST FOR 64K OVERFLOW
RECOVER REG I STER
MODE FOR 8237
INITIALIZE THE 01 SKETTE CHANNEL
RETURN TO CALLER. CfL SET BY ABOVE I F ERROR

ENOP

CHK_STAT_2
TH I S ROUTI NE HANDLES THE INTERRUPT RECE I VED AFTER
A RECAlIBRATE. SEEK, OR RESET TO THE ADAPTER.
THE INTERRUPT IS WAITED FOR. THE INTERRUPT STATUS SENSED.
AND THE RESULT RETURNED TO THE CALLER.

5-96

Diskette

INPUT
NONE
OUTPUT
CY

= 0 SUCCESS

CY = ,

fA I LURE -- ERROR IS! N 0 I
DESTROYED

(AX)

051A
051A
0510
051 F
0521
0524
0527
0529
052C
052E
0530
0532
0533
0533
0534
0534
0539
053A
0538

SKETTE~STATUS

b~;~;;~~=2------~~;~----~~;~-------------------------

E8
72
B4
E8
E8
72
AD
24
3C
74

0536 R
14
08
03E2 R
0580 R

WAIT~INT

CALL
JC
MOV
CALL
CALL
JC
MOV
AND
CMP
JZ
CLC

OA

0042 R
60
60
02

f8

WAIT FOR THE INTERRUPT
I F ERROR, RETURN IT
SENSE INTERRUPT STATUS COMMAND

J34
AH.08H
NEG OUTPUT
RESULTS
J34
Al, NEC_STATUS
AL,060H
AL,060H
J35

RFAD IN THF RESULTS
CHK2 RETURN
GET THE FIRST STATUS BYTE
ISOLATE THE BITS
TEST FOR CORRECT VALUE
I F ERROR, GO MARK IT
GOOD RETURN

J34:

e3

RET

RETURN TO CALLER

J35:
80 OE 0041 R 40

Dr SKETTCSTATUS, BAD_SEEK' CHK2_ERROR

OR
STe

f9

ERROR RETURN CODE

RET

e3

[NOP

CHK_STAT_2

;

------------------------------ --- ---------WAIT I NT
-

THIS ROUTINE WAITS FOR AN INTERRUPT TO OCCUR
A T f ME OUT ROUT! NE TAKES PLACE OUR I NG THE WA IT. SO
THAT AN ERROR MAY BE RETURNED I f THE DRIVE IS NOT READY

INPUT

NONE
OUTPUT
CY = 0 SUCCESS
CY = 1 FAILURE -- DISKETTE STATUS IS SET ACCOROINGLY
(AX) DESTROYED
-

053B
0538
053C
0530
053E
053f
0540
0543
0545
051~7

0549
0548
0548
0550
0552
0554
0556
0558
0550
OSSE
05SE
055F
0564
0565
0566
0567
0568
0569

~;

7; -7 N~ -------- ;~;~----~~~~- -----------------

fB

-

5T I

50
53
51

~~;~

~~

PUSH

ex

f8

eLe

88 9001
CD 15
72 11

MOY
INT
JC

83 (4
33 C9
F6
75
E2
FE
75

06 003E R 80

f7
CB

F3

80 DE 0041 R 80

J36A:

0578
0578

SEEK_STATUS, I NT_FLAG

TEST FOR

J37
J36

INTERRUPT OCCURR I NG

COUNT DOWN WHILE WAITING
SECOND LEVEL COUNTER

BL

J36
DISKETTE_STATUS, TIME_OUT; NOTHING HAPPENED
; ERROR RETURN

OR
STC

f9

J37:
PUSHf
AND
POPF
POP
POP
POP

9C

80 26 003E R 7F
90

59

56
58
e3

RET

CF

ex

; SAVE CURRENT CARRY
INT_FLAG ; TURN OfF INTERRUPT FLAG
RECOVER CARRY
~ECOVER REG I STERS

BX
AX

GOOD RETURN CODE COMES FROM TEST

DISK INT
- THIS ROUTINE HANDLES THE DISKETTE
INPUT

I NST

INTERRUPT

NONE
OUTPUT

DISK INT 1

FB
lE
50
[8 0000 E
80 DE 003E R 80
80 20
E6 20
B8 9101
CD 15
58
1f

SEEK_STATUS,NOT

ENOP

WAIT - I NT

THE

0570
057E
057F
0580

CLEAR THE COUNTERS
FOR 2 SECOND WA r T

eX,ex

TEST
JNZ
lOOP
DEC
JNZ

ac

;

0574
0576

BL,4

MOY
XOR

;

056F

CLEAR TIMEOUT INDICATOR
LOAD WA r T CODE AND TYPE
PERFORM OTHER FUNCTION
BYPASS TIM I NG LOOP 1FT I MEOUT OCCURRED

AX,090Q1H
15H
J36A

J36:

;

0569
0569
056A
0568
D.56C

TURN ON I NTERRUPTS. JUST I N CASE
;AVE REG I STERS

-

STI
PliStl
PUSH

CALL
OR
MOY

ouT

MOY
INT
POP
POP
IRET
DISK_INT_l

I NTERRUPT FLAG

PROC

I S SET

\ S SEEK_STATUS

FAR

os

;>>> ENTRY POtNT FOR ORG OEF57H
RE ENABLE INTERRUPTS
SAVE REG I STERS

AX

OOS
SEEK_STATUS, !NT_FLAG
AL,20H
20H,AL
AX,09101H

15H
AX

SETUP DATA ADDRESS I NG
TURN ON I NTERRUPT OCCURRED
END OF I NTERRU PT MARKER
I NTERRUPT CONTROL PORT
I NTERRUPT POST CODE & TYPE
CO PERFORM OTHER TASK
~ECOVER REG

OS
RETURN FROM

INTERRUPT

ENDP

RESULTS
THIS ROUTINE WILL READ ANYTHING THAT THE NEC CONTROLLER
HAS TO SAY FOLLOWING AN INTERRUPT.
INPUT
NONE
OUTPUT
SUCCESSFUL TRANSFER
CY = 0
CY = 1
FAILURE -- TIME OUT IN WAITING FOR STATUS
NFC STATUS ARFA, HAS STA,TUS BYTE LOADED INTO IT
(AH) DESTROYED

0580
0580
0581
0584
0585
0586
0587
0589
05BB
058B
0580
0590
0590
0591
0593
0595

0597

.; ---- - ----------------------------------------NEAR

B3 07

RESULTS PROC
ClO
MOV
PUSH
PUSH
PUSH
MOY

B7 02

; ------ WA I T fOR REQUEST FOR MASTER
R10:
MOV
BH,2

fC

BF 0042 R

51
52
53

01, OFFSET NEC_STATUS

ex

PO I NTER TO DATA AREA
SAVE COUNTER

OX
BX
BL,7

MAX STATUS BYTES

XOR
MOV

CX. CX
OX, 03 F4H

A8 80
75 10
E2 F9

IN
TEST
JNZ
LOOP

AL. OX
AL.oaOH
J40A
J39

HIGH ORDER COUNTER
INPUT LOOP
COUNTER
STATUS PORT
WA IT FOR MASTER
GET STATUS
MASTER READY
TEST DIR
WA I T=MASTER

FE CF

OEC

6H

DECREMENT HIGH ORDER COUNTER

J38:
33 C9
SA 03F4

J39:
EC

Diskette 5-97

0599

75 FO

05913

80 DE 0041

O')AO
05AO
O';:'{'1
05A2
05A3
05A4

5B
5A

R 80

REPEAT TIL DELAY DONE

JNZ

J 38

OR

DISKETTE _5fATUS, TIME_OUl
RESULTS ERHOR
SET ERROR RETURN

J40:
STC

F9

POP
POP
POP

59

8X
OX
CX

RET

C3

TEST THE DIRECTION BIT
05A5
05A6
OSA8
05AA
05AA
OSAF

05131
0581
0562
05B3
05115
0566
05139
05138
05BC
0580
05BF
05C1
05C3
OSC5

[C
A8 40
75 07

J40A:

IN
T[ST
JNZ

J41 ;
80 OE 0041
[8 U

OR
JMP

R 20

GCT STATUS REG AGAIN
; TEST DIRECTION BIT
; OK TO READ STATUS
; NEC FAIL
D I SKETTE_ST A TUS,BAD_NEC
RESUL TS_ERROR
J40
AL, OX
AL, Q40H
J42

READ

IN THE STATUS

INC
IN

OX
AL, OX
[01 \,AL
01
CX,20
J l l3
OX
AL, DX
Al.,0101i
J41,

MOV

INC

"7

89 0014

E2
4A
EC
AB
74
FE

MOV

FE

J43:

10
06
CB
75 C4
EB E3

LOOP
DEC
IN
TEST
JZ

DEC
JN7
JMP

POINT AT STATUS PORr
GCT STATUS
rEST FOR NEC ST ILL BUSY
RESULTS DONE
; DECHEMENT TH[ STATUS COUNTER
; GO BACK fOR MOI~E
; CH I P HAS FAILED

BE
Rl0
J41

RESULT OPERATION
05C7
OSC7
05C8
05C9
05CA

INPUT - STAT
POI NT AT DATA PORT
GET THE DATA
STORE THE BYTE
INCREMENT Tl-JE PO INTER
LOOP TO KI LL TIME FOR NEC

J42;

4?
[C
88 05

IS DONE

J114:
POP
POP
POP

08
oA

59

BX
OX
CX

;

RET

C3

RECOVER REG I STERS
GOOD RETURN CODE FROM TEST

I NST

NUM TRANS
THIS ROUTINE CALCULATES THE NUMBER OF SECTORS lHAT
WERE AGTUALL Y TRANSfERRED TO/ FROM THE 0 I SKETTE.
INPUT
(CH) '" CYLINDER OF OPERATION
(CL) '" START SECTOR OF OPERAT I ON
OUT PUT
(AL) = NUMBER ACTUALLY TRANSFERRED
NO OTHER REG I STms MOO I F I EO

NUM TRANS

Oscs
OSGB

05eE
0500
05D3
OSD5
05D8
0506
05DO
OJ[)F

051::1
051::2
05E2

AO
3A
AD
74
BB

-

0045 R
C5

MOV
CMP
MOV

004"1 R
OA

.JZ
MOV

0008
[8 0382 R
8A C4
FE CO
2A Cl
C3

CALL

Mav

INC
J45;
SUB
RET
NUM TRANS
RESULTS lNDP

PROC
NEAR
AL,NEC STATUS+3
AL,CH ~t5 NEC_STATUS+5
BX,8
GET PARM
AL,AH
AL
AL,CL

MOV

C6 87 0090 R 61

GET EDT VALUE
I Nro AL
USE E.01'+1 FOR CALCULATION
SUBTRACT START FROM END

END?

HANDLE 0 I SK CHANGE
ACT I VE
0~l2

G[T CYLI NDER ENDED UPON
SAME AS WE STARTED
GET END I NG SEC fOR
I F ON SAME GYL, THEN NO ADJUST

I F rOUND TO BE

DSK_5fATE(BXL POA_DUAL

;

CLEAR STATE FOR THIS DRIVE

THIS SEQUENCE OF SEEKS IS USED TO RESET DISKETTE CHANGE SIGNAL
05E7
05EA
05EO
D5EF
05F2
OSF5
05F7
O')FA
OS FF
0600
0601
0602
0603

E8 01CA R
813 56 00
B5 01
E8 ollle R
8f} 56 00
135 00
[8 041C I~
c6 06 0041
5A
59
58
58
C3

CALL
MOV
MOV
CALL
MOV
MOV
CALL
MOV

R 06

rop

POP
POP
POP
RET
;
;

0604
0604
0606
0608
060A
OGor

0611
0613
0617
0619
0618
0610
OGlE
0622

32
8A
130
80
81
D2
08
02
8A
02
fA
81.
75

0624
OG28
0620
062E
0631
0634
0636
0638
063A
063C
0630
0640

08
C6
FB
8A
AO
?4
81
02
DC
[E
BA
EB

READ DSKCHNG
THIS ROUTINE READS THE STATE OF THE
DISK CHANGE LINE
ZERO FLAG:
0 - DISK CHANGE LINE INACTIVE
1 - 0 I SK CHANGE LIN E ACT I VE

READ DSKCI-ING
XOR
May

FF
DA
01

MOV

AND

26 003F R CF
OLI

MOY

C3
1 E 003F H
CB
CB

HOL

EO
06 003F R
09

SHL
CLI
TEST
JNZ

06 003f

OR

OR

ROR
MOV

R

MOV

06 0040 R FF
R8:
03F2

OOH R
3F
04
GO

DISK RESET
RI:.SEf NEC
DX,[BPj
RESTORE DRIVE PARMETER
CH,OlH
MOVE TO CYLINDER 1
SEEK
I SSU[ SEEK
DX,[BP]
KI:.$IORE DRIVE PARMETER
CH,OQH
MOVE TO CYLINDER 0
SEEK
; I SSUE SEEK
DISKETTE_STATUS,MEOIA ,CHANGE; INDICATE MEDIA REMOVED FROM DRIVE
OX
RESTORE PARAMETERS
CX
...
GX
AX
M[QIA CHANGE, GO LJETERMINE NEW TYPE

ST I
MOV
MOY

AND
MOV
ROL

OC

OR
OUT

03F7
00

MOV
JMP

PROC
NEAR
BH, BH
;
BL,DL
;
AL, 01
;
MorOR_STATUS,OCFH
CL,4
BL,CL
MOTOR_S r ATUS, BL
BL,CL
CL, BL
AL, CL
AL, MOTOR_STATUS
R8

CLEAR HIGH ORDER 0' FSF.T
LOAD DR I VE NUMBER AS OF rSET
MASK FOR DETERM I N I NO MOTOR 81 T
; CLEAR ENCODED OHlvr SFt.ECT 8IT$\4 & 5)
SHirr DRIVE NUMU[~ INTO HIGH NIBBLE COUNT
SHin DRIVE NUM3EH INTO HIGH NIBBLE
ADD I N DR I VE NUMBER SELECTED rOR LATER USE
RESTORE DRIVE NUi'1BER
RESTORE DRIVE NUMBER
FORM MOTOR ON BIT t~ASK
NO INTERRUPTS WHILE DETERMING MOTOR STATUS
TEST
DONT NEED TO SELECT DEVICE IF MOTOR ON

MurOR_STATUS,AL ; TURN ON CURRENT MOTOR
MOTOR_COUNT, 0 F 1"11 ; SET LARGE COUNT OUR I t-.;G 0 PERAT I ON
ENABLE I NTERRU PTS AGA I N
ADDRESS DIGITAL OUTPUT REGISTER
DX, 03 F2H
GET DIGI1AL OUTPUT REGISTER REFLECTION
AL, MOTOR 5T ATUS
AL,03FH STRIP AWAY UNWANTED BITS
SH I FT COUNT
CL,4
PUT BITS IN DESIRED POSITIONS
AL, CL
NO RESET, ENABLE O,"1A/1 NT
AL,OCH
SELECT DR I VE
DX,AL
ADDRESS
DIGITIAL INPUT REGISTER
OX,03F-rH
DELAY FOR sUPPOIn CHI P
$+2

06112
0643
0645
0646

IN
rEST

EC
A8 80
C3

RET

READ_DSKCHNG
;
;

AL,DX
AL,DSK_CHG

;
;
;

INPUT DIR
CHECK FOR DISK CHANGE liNE ACTIVE
RETURN TO CALLER WITH ZERO FLAG SET

ENOP

01 SK CHANGE
THIS ROUTINE RETURNS THE STATE OF THE
UI::;K CI!ANGE LINE
DISKETTE STATUS:
00 - DISK CHANGE LINE INACTIVE
06 - DISK CHANGE LINE ACTIVE

OJ SK

J2

PROC
NEAR
HF CNTRl, DUAL
OC2

XOR
MOV
MOV
AND
CMP
JE

BH,BH
; CLEAR HIGH ORDER OFFSET
Bl,Dl
; LOAD DR I VE NUMBER AS OFFSET
Al, DSK_STATE[ BX] ; GET MED IA STATE I NFORMATI ON FOR DR IVE
AL, STATE_MSK
I SOLATE STATE
Al,3
CHECK FOR !.8TPI DRIVE & NOT ESTABLISHED STATES
SET I T
I F FOUND SET DISK CHANGE ACT I VE

CHANCE
TEST

0646
0646
0646

F6 06 008F R 01
74 29

0640
064F
0651
0655
0657
0659

32
8A
8A
24
3C
74

0658

72 OB

JB

DCO

0650
0660

E8 0604 R
74 05

CALL

READ DSKCHNG
FINIS

0662
0667

c6 06 0041 R 06
C3

FINIS:

MOV
RET

DISKETTE STATUS,MEDIA CHANCE; INDICATE MEDIA REMOVED FROM DRIVE
; RETURN TO CAllER

0668
066c
066E

8A 87 0090 R
OA CO
75 F2

DCO:

MOV

0670
0675

80 OE 0041
C3

0676
0678
067A
067C
067E
0680

60
E6
EB
E4
A8
75

OE
70
00
71
CO
EE

0682
0684
0686
0688
068A
06Be

60
E.6
EB
E4
OA
75

10
·(0

MOV

00

JMP
IN

068E
0690
0692
0694

81 Ol~
02 C8
24 OF
74 OA

0696
0698

EB CA

-

FF
DA
87 0090 R
07
03
07

J2

R 80

SET IT:

OC2:

MOV
OUT

AL, CMOSDSB ADDR ;
cADR_prn, AI

JMP
IN
TEST
JNZ

AL,CDATA_PRT
Al, CMOS_COOD
DCl

MOV
ROR
AND

Jr~p

01 SK._CHANGE

$+2

GET CMOS DIAGNOSTIC STATUS BYTE ADDRESS
WR I T[ ADDRESS TO READ OUT TO CMOS
DELAY
GET CMOS STATUS
SEE I F BATTERY GOOD AND CHECKSUM VAll 0
ERROR I F EITHER BIT ON

Al,CDATA_PRT
Dl,Dl
VC3

ADDRESS OF DSKETTE BYTE I N CMOS
WR I TE ADDR.ESS TO READ OUT TO CMOS
DELAY
GET DSKETTE BYTE
SEE WHICH DRIVE IN QUESTION
I~ I)IL~O)
SEEK SEEK TO TRACK
OX
RESTORE PO INTER
OX
SAVE POINTER
CIl,QUIET SEEK
SEEK SO FAR IN, BEFORE ISSUING SINGLE STEPS
SEEK
SEEK TO TRACK 10

07EI,
07E6
07£8
DnA

07[[3
07EC

£8 041 C R

PUSH
PUSH
CALL

DX

56

07ED

SI
SEEK

GET TRACK AT PRESENTLY
CLEAR SEEK COUNTER
SEEK TO NEXT TRACK, TOWARDS TRACK 0
RESTORE PO INTER
SAVE PO j NTER
SAVE COUNTER
SEEK TO TRACK

07FO
07 F2

OHB
OlF9

Bl.J 04
£8 082C R
E8 0580 R
5E
46

MOV
CALL
CALL
POP
INC

AH, SENSE OIlV ST
sUPS
RESULTS
SI
SI

SENSE DRIVE STATUS COMMAND BYTE
I SSUE THE COMMAND
GO GET STATUS
RESTORE COUNHR
COUNT NUMBER OF SEEKS TIL AT HOME( TRACK 0)

OHA
07FF

1'6 06 0042 R 10
75 08

1[ST
JNZ

NEC_ST ATU5, HOME
SUP4

LOOK TO SEt: I F HEAD I S AT TRACK 0
GO OETER~lINE DRIVE TYPE

0801

fl3 F[ OB

eMP

0801,

72 £2

JB

51,QUIET S[EK+l
SUP3
-

SEE 1F TilE NUMBER OF SEEKS = NUMBER
I r LESS THAN, NOT DONE YET

0806

5B
EB 10

POP
JMP

BX

RESTORE POINTER
DRIVE NOT INSTALLED,

POP
CMP

BX
RESTORE POI NTER
SI,QUIET_SEEK
,SEE IF S[EKS S'/EPPED EQUAL THE Of{IGINAL
OSK_STATEIBX1,POA_DUAL, SETUP POWER ON ASSUMPTION
NXT_DRV
j
IF YES 1.2 DRIVE

07F5

0807
0809
080A
08UO
0812

85 OA
H F6
rE CD
5A
52

'"

MOV
SUP3:

§UPl.J:

83 FE OA
C6 8"1 0090 R 61
C6 87 0090 R 93

081 F
0822
0823
08211
0825
0826
0827
0828
0829
082A
0828

50

CH, QU lET_SEEK
51, SI
Cit

POP

OX

MOV
JAE

73 05

08111
0819
0819
081A
0810

XOR
D[C

MOV

SHORT NXT_DRV

OSK_STATEI3Xj,M326D326

BYPASS

ESTABLISH 320/360K STATE

NXT_DRV:

43

INC

BX

83 FB 02
7l.J 03

eMP

JE

BX, !-lAX_ORY
SUPl

E9 07AO R

JMP

§UP1:

1F
07
5> F
SE
SA
59
5B
58
C3

E8 03E2 R
8A £2
[8 03[2 R
C3

SUPO

REPEAT TIL OONF FOR EACH DRIVE

POP

Be

RESTORE ALL REGISTERS

DS

POP

ES
01
SI

POP
POP

POP
POP
POP

POP

RET

SUP5:

POINT TO NEXT DRIVE
SEE I F DONE
IFF I N I SHED LEAVE TEST

POP

DX

ex
BX
AX

OTI-IERW I S[ ReTURN

KEEP STACK CORRECT
082C
082F
0831
0834

j

ISSUED

CALL

Mav
CALL

NEG OUTPUT
AH,OL
NEG_OUTPU T

FOR CALL TO NEC_OUTPUl

I F ERROR

OUTPUT TO NEC
GET DR 1VF NUMBER SELECTED
OUT PUT TO NEC

RET

0835

OSKETTE_SETUP [NOP

0835

CODE

ENDS
END

Diskette

5-101

5-102 Diskette

TITLE FIXED DISK BIOS FOR
PUBLIC
PUBLIC
PUBLI C

IBM DISK CONTlWLLER 1-11-84

DISK 10
HD INT
DI5K_SETUP

EX'rRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
; --

F1I80:NEAR
F1781:NEAH
F17f12:NEAR
r1790: NEAR
F1791: NEAR
FD TBL:NEAR
I NT 13 --------------------- ---- ----- - - ------------- ---- -- ---

FIXED DISK I/O INTERFACE
THIS IIHERrACE PROVIDES ACCESS TO 5 1/1\" FIXED DISKS
THROUGH THE IBM F1XED DISK CONTROLLER.
TilE
BIOS ROUTINES ARt: MEANT TO BE ACCESSED THROUGH
ANY ADDRESSES PRESErH IN
SOFTWARE INTERRUPTS ONLY.
THE liSTINGS
ARE INCLUDED
ONLY FOR
COMPLETENESS,
REfERENCE.
APPLICATIONS WHICH
REFERENCE
NOT FOR
ABSQLiJTE
AOORESSES
WITHIN
THE
CODE
SEGMENT
VIOLATE THE STRUCTURE AND DESIGN OF BIOS.
(AH == HEX VALUE)

INPUT

(AH)=OO RES!:.! DISK (OL == 8QH,811-1) / OlSKETTE
(AH)=Ol READ THE STATUS OF THE LAST DISK OPERATION INTO (AL)
NOTE: DL < SOH - DISKETTE
DL :> 80H - 0 I SK
(AH)""02 READ THE DESIRED SECTORS INTO MEMORY
(All )"'0.) WR I TE THE DES I RED SECTORS FROM MFMORY
(AH) =0/1 VER I FY THE DES I REO SECTORS
(AH)=05 FORNAT THe. DESIRED TRACK
(AH)=06 UNUSED
(AH )""07 UNUSED
(AH)=08 RETURN THE CURRENT DRIVE PARAMETERS
(AH)=09 INITIALIZE DRIVE PAIR CHAHAGIERISTICS
INTERRUPT 41 POINTS TO DATA BLOCK FOR DRIVE 0
INTERRUPT 46 PO I NTS TO DATA BLOCK FOR DR I VE 1
(AH)==OA READ LONG
(MI )=06 WR I TE LONG
NO fe.: HEAD AND WR I TE LONG CNCOMPASS 512 + 1-1 BYTES ECC
(AH )=OC SEEK
(AH)=OD ALTERNATE DISK RESET (SEE DL)
(AI-I )=OE UNUSED
(AH)=OF UNUSED
(AH)=10 TEST DRIVE RFADY
(AH)=l1 RECAlIBRATE
(AI-I )=12 UNUSED
(Ali)==13 UNUSED
(AH )= 1 ,+ CONTROLLER INTERNAL D I AGNOST I C
(AH)=15 READ DASD TYPE
REG I STERS USED FOR f I XED 0 I SI( OPERAT IONS
(80H-8 1 H FOR 0 I SK, VALUE CHECKED)
(0-15 ALLOWED, NOT VALUE CHECKED)
(0-1023, NOT VALUE CHECKED)(SEE CL)
(1-17, NOT VALUE CHECKED)

( OL)
( DH)
(CH)
(CL)

DR I VE NUMBER
HEAO NUMBER
CYL.INDER NUMBER
SECTOR NUMBER

(AL)

NOTE: HIGH 2 BITS OF CYLINDER NUMBER ARE PLACED
IN THE HIGH 2 BITS OF THE CL REGISTER
(10 BITS TOTAl)
NUMBER OF SECTORS (MAXIMUM POSSIBLE RANGE 1-80H,
FOR READ/WR I TE LONG 1-79H)
ADDRESS OF BUFFER fOR READS AND WRITES,
(NOT REQUIRED FOR VERIFY)

( ES:BX)

FORMAT (AH==5) ES:BX POINTS TO A ~12 BYTE BUfFER.
THE fiRST
2*{SECTORS/TRACK) BYTES CONTAIN F,N FOR EACH SECTOR.
F == DOH FOI<. A GOOD SECTOR
80H FOR A BAD SECTOR
N = SECTOR NUMBER
FOR AN I NTERLCAVE OF 2 AND 17 SECTORS/TRACK
THE TABLE SHOULD BE:
DB
OOH, 01 H, DOH, OAll. OOli, 02H, OOH, OBH, DOH, 031-1, OOH, OCH
DB
OOH, WIH, OOH, OOH, OOH, OSH, DOH, OEH, DOH, 06H, DOH, 0 FH
DB
DOH, 07tl, DOH, 1 OH, DOH, 08H, QOH, 1 1 H, DOH, 091-1
OUTPUT
AH " STATUS OF CURRENT OPERATION
STATUS BITS ARE DEFINED IN THE EQUATES BELOW
CY = 0
SUCCESSFUL OPERATION (AH;:O ON R[TURN)
CY", 1
FAILED OPERAT!ON (AH HAS ERROR REASON)
NOH.:

ERROR 11H
INDICATES THAT THE DATA READ HAD A RECOVERABLE
THE DATA
ERROI\ WH I CH WAS CORRECTED BY THE ECC ALGOR I THM.
IS PROBABLY GOOD,
HOWEVER THE BIOS ROUTINE INDICATES AN
ERROR TO ALLOW THE CONTROlL I NG PROGRAM A CHANCE TO DEC I DE
FOR
ITSELF.
TI-IE
ERROR MAY NOT
RECliR
I F THE DATA IS
RE'rIRI HEN.

I F DR I VE PARAMETERS WERE REQUESTED,
DL'" NUMBER OF CONSECUTIVE ACKNOWLEDGING DRIVES ATTACHED (0-2)
(CONTROLLER CARD ZERO TALLY ONLY)
DH ~ MAXIMUM USEABLE VALUE FOR HEAQ NUMBER
CH = MAX 1MUM USEABLE VALUE FOR CYL I NDER NUMBER
CL == MAXIMUM USEABLE VALUE FOR SECTOR NUMBER
AND CYLINDER NUMBER HIGH BITS
1 FREAD DASD TYPE WAS REQUESTED,
AH = 0 -

NOT PRESENT

1 - 0 I SKETTE - NO CHANGE L j NE AVA I LABLE
0 I SKETTE - CHANGE LINE AVA I LABlE
FIXED DISK
CX,DX:o NUMBER OF 512 BYTE BLOCKS WHEN AH = 3
2 -

3 -

REGISTERS WILL BE PRESERVED EXCEPT WHEN THEY ARE USED TO RETURN
INFORMATION.
NOTE:

~OFF

OOEO
DOCC
008B

OOAA
0080
0040

SENSE fAIL
NO_ERR
WRITE FAULT
UNDEr-ERR
NOT ROY
TIME OUT
BAD SEEK

IF AN ERROR IS REPORTED BY THE DISK CODE, THE APPROPRIATE
ACT ION I S TO RESET THE 01 5K, THEN RETRY THE DPERAT J ON.
EQU
EQU
EQU
EQU
EQU
[QU
EQU

OfFH
OEDH
OCCH
08BH
OAAH

80H
40H

NOT IMPLEMENTED
STATUS ERROR/ERROR REG=O
WRITE FAULT ON SELECTED DRIVE
UNDEF I NED ERROR OCCURRED
DR I VE NOT READY
ATTACHMENT FAI LED TO RESPOND
SEEK OPERATION FAILED

Disk

5-103

BAD CNTLR
DATA CORRECTED
I3AD Icc
BAD-TRACK
BAD-SECTOR
DHA -BOUNDARY
INIT FAIL
BAD RFSFT
RECORD NOT FND
BAD AODR MARK
BAO-CMD PAGE

0020
0011
0010
OOOB
aoaA
0009
0007
0005
0004
0002
0001

~

[OU
[QU
[OU
[OU
[OU
[QU
[OU
EQIJ
[OU
[QU
[QU

CONTROLLER HAS FAI LED
ECC CORRECTED DATA ERROR
BAD ECC ON 0 I SK READ
NOT IMPLEMENTED
8AD SECTOR FLAG DETECTED
DATA EXTENDS TOO FAR
DRIVE PARAMETER ACTIVITY FA I LED
RESET FAILED
REQUESTED SECTOR NOT FOUND
ADDRESS MARK NOT FOUND
BAD COMMAND PASSED TO 0 I SK I/O

20H

lHI
10H
OBH
OAH
09H
07H
05H
O!IH
02H
01H

IXED DISK PARAMETER TABLE
-

THE TABLE

+0
+2
+3
+5
+7
+8

(1
(1
(1
(1
(1
(1

-+-9
-+-12
-+-111
-+-15

(3
(1
(1
(1
-

IS COMPOSED OF A BLOCK DEFINED AS;

WORD)
BYTE)
WORD)
WORD)
BYTE)
BYTE)

-

MAX I MUM NUMBER OF CYL I NOERS
MAXIMUM NUMBER OF HEADS
NOT USED/SEE PC-XT
STARTING WRITE PRECOMPENSATION CYL
MAXIMUM EGC DATA BURST LENGTH
CONTROL BYTE
BIT
7 OISAFl/F RFTRIES -ORB IT
6 D I SABLE RETR I ES
BIT
3 MORE THAN 8 HEADS
BYTES)- NOT USED/SEE PC-XT
WORD) - LANDING ZONE
BYTE) - NUMBER OF SECTORS/TRACK
BYTE) - R[SERVEU f-OR FU/,URE USE
TO DYNAMICALLY DEFINE A SET Of PARAMETERS
BUILD A TABLE fOR UP TO 15 TYPES AND PLACE
THE CORRESPONDING VECTOR INTO INTERRUPT 41
FOR DRIVE 0 AND INTERRUPT 46 FOR DRIVE 1 •

. LIST
PAGE
I NCLUOE SEGMENT. SRC
CODE SEGMENT BYTE PUBLIC

0000

HARDWARE SPEC I f I C VALUES
CONTROLLER

I/O PORT

> WHEN READ FROM:
Hf_PORT+O
Hf_PORT+1
HF PORT+2
flr-POBT+3
Hr-PORT+4
HF::::PORT+5
Hr PORT+6

- READ DATA (FROM CONTROLLER TO CPU)
- GET ERROR REGISTER
- GET SECTOR COUNT
- GET SECTOR NUMBER
- GET CYLINDER LOW
- GET CYLINDER HIGH (2 BITS)
- GET SIZE/DRIVE/HEAD
Hr~PORT+7 - GET STATUS REGISTER
> WHEN WR I TTEN TO:
Hf_PORT+O - WRITE DATA (FROM CPU TO CONTROLLER)
HF PORT+1 - SET PRECOMPENSATION CYLINOER
HF-PORT+2 - SET Si:.CTOR COUNT
Hf-PORT+3 - SET SECTOR NUMBER
HF-PORT+4 - SET CYLINDER LOW
HCPORT+5 - SET CYLINDER HIGH (2 BITS)
HF PORT+6 - SET SIZE/DRIVE/HEAD
HCrORT+7 - SET COMMAND REGISTER

HF PORT
Hf::::REG_POHT

= 01 FO
== 03F6

[OU

[au

01 fOH

'" 0001
'" 0002
:= 0004
" 0008
== 0010

== 0020
== 0040
== 0080

;

01 SK PORT

3 f6H

,
STATUS REGISTER
ST ERROR
EQU
00000001 B
ST-I NO[X
EqU
00000010B
ST~CORliCTD
EQU
00000100B
ST-DRQ
[Qu
00001000B
ST-SEEK COMPL
EQU
000100DOB
ST-WRT FLT
Equ
001000008
ST-REAGY
EQU
01000000B
ST::::BUSY
EQU
100000008

ECG CORRECT I ON SUCCESSFUL
SEEK CONPLETE
WRITE FAULT

== 0010

ERROR REG I STER
FRR DAM
EqU
ERR-TRK 0
EQU
ERR::::ABORT
EQU
[Qu
[OU

= OOIjU
== 0080

ERR DATA ECC
ERR::::8AOJ'iLoCK

EqU

00000001 B
00000010B
00000100B
000010008
000100008
00100000B
010000006
100000008

= 0010
== 0020
- 0030
== 0040
= 0050
= 0060
= 0070
== 0090
= 0091
= 0001
= 0002
= 0008

REGAL CMO
READ CMI)
WR I r't'. CMD
VER I FY eMD
FMTTRK-CMD
INIT CMD
SEEK-CMD
01 AC=CMD
SET PARM GMD
NO RETR I ES
ECG MODE
BUfFER_MODE

EQU
EQU
EQU
[QU
EqU
EQU
EQU
EQU
EQU
EQU
EqU
EQU

000100008
00100000B
00110000B
010000008
01010000B
01100000B
01110000B
10010000B
10010D01B
00000001 B
0000001DB
000010006

DRIVE RECAL
READ
WRITE
VER I FY
FORMT TRACK
INITIALIZE
SEEK
DIAGNOSTIC
DRIVE PARMS
CND MODIFIER
CMD MODI FIER
CMD MODIFIER

== OOAO
= 0020
= 0020

I NT CTL PORT
I NT1_CTCPORT
EOI

lQU
EQU
EQU

OAOH
020H
20H

8259 CONTROL PORT #2
8259 CONTROL PORT #1
[NO OF I NTERRUPT COMMAND

== 0002
== 0002

MAX FILE
S_MAX_F I LE

EQU
[aU

== 0020
== 0600

DELAY 1

[QU
[aU
[OU

20H
0600H
0100H

DELAY FOR or COMPLETE
DELAY FOR READY
DELAY FOR DATA REqUEST

[QU

08H

CMOS FLAG J N BYTE OEH
TO INHIBIT DISK I PL

EXTRN

P_MSG: NEAR

=-

0001

= 0002
== 0004

~g~

DELAY~2

= 0100

DELAY::::3

;:; 0008

HF_FAI L

ASSUME

GS;CODE

PAGE
FIXED DISK

5-104

Disk

1/0 SETUP

DATA ADDRESS MARK NOT FOUND
TRACK 0 NOT fOUND ON RECAL
ABORTED COMMAND
NOT USED
j D NOT rOUND
NOT USED

(10H)
(20H)
(30H)
(1IO~j)

(50H)
(60H)
(70H)
(90H)
(91H)
(OlH)
(02H)
(OSH)

-

~Oll

0015
DOle
0021
0024
0028
0020
0034
0039
0040
00115
0046
0048
004A
004e
D04E
0050

PROC
NEAR
ES: ABSO
AX,AX
ES,AX

DISK~SETUP

0000
0000
0002
0004
0005
0009
0000

ESTAaLI SH TRANSFER VECTORS FOR THE f I XED 0 I SK
PERfORM POWER ON DIAGNOSTICS
SHOULD AN ERROR OCCUR A "1701" MESSAGE IS DISPLAYED

ASSUME
2B CO
BE CO
FA

SUB
MOV

26 A 1 004e R
26 A3 0100 R
26 A1 004E R
26 A3 0102 R
26 C7 06 004C
26 8e OE 004E
B8 06CA R
26 A3 010B R
26 Be DE 010/\
26
C7 06 0104
26
BC DE 0106
26
C7 06 0118
26 8C DE OllA
FB

MOV
MOV
MOV
MOV
Mav
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV

CLI

R 0197 R
R
R
R 0000 I:
R
R 0000 E

R

STI
IN
AND
OUT
IN
AND
OUT

E4 A 1
24 BF
E6 A1
E4 21
24 FB
E6 21

ASSUME
0052
0055
0057
005C
0061
0066
0068
006A
006C
006E
0070
0072
0074
0077

0079
007B
0070
007F
0081
0083
0085
0087
0089
008E
0090
0092
0094
0096
0099
0090
DOA2
00A4
00A4
OOA6
OOA4
OOAlI
OOA6
OOA6
00A7
00"9
OOAB
aOAE
00B2
00B7
0089
0000
OOBD
QOBF
00C2
OOC4
00C7
OOC9
OOCC
0001
0003

0005
0008
0008
0009
OODB
0000
OOOF
OOEO

~lOV

B8
---- R
8E 08
C6 06 0074 R 00
C6 06 0075 R 00
C6 06 0076 R 00
BO 8E
[6 70
EB 00
E4 71
8A EO
24 CO
75 64
80 E4 F7
BO 8E
E6 70
8A C4
EB 00
E6 71
80 92
E6 70
EB 00
E4 71
C6 06 0077 R 00
8A 08
B4 00
24 FO
74 42
05 FFFO E
26; A3 0104 R
C6 06 0075 R 01
8A C3

MOV
MOV
MOV
MOV
MOV
OUT
JMP
IN
MOV
AND
JNZ
AND
MOV
OUT
MOV
JMP
OUT
MOV

OUT
JMP
IN
MOV
MDV
MOV
AND
JZ
ADD
MOV
MOV
MOY

+ ??OOOO
+
+ 170001

DO EO

+
co
04
74 (IE
B4 00
05 FFro E
26: A3 0118 R
C6 06 0075 R 02
B2 80
64 111
CO 13
72 22
Al 006C R
8B 08
05 0444
8B C8
E8 OOEF R
80 3E 0075 R 01
76 05
62 81
E8 GOEF R

ISHl
lABEL
SHl
lA8EL
ORG
DB
ORG
DB
JZ
MOV
AUD
Mav
MOV

L4:

MOV
MOV
INT
Je
MOY
MOY
ADO
MOV

CALL
Cf~P

JBE
Mav

CAll

**

DS:DATA
AX,DATA
OS,AX
DISK STATUS1, 0
flF _NUM,O
CONTROl_BYTE,O
Al,8EH
70H,Al
SHORT $+2
Al,71H
AH,AL
AL, OCOH
POD DONE
AH, NOT HF _FAI L
Al,8EH
7DH,Al
Al,AH
SHORT $+2
71H,Al
Al,92H
70H,AL
SHORT $+2
AL,71H
PORT_OFF,O
Bl,Al
AH,O
Al,OfOH
POD OOI';E
AX,OFFSET FD_TBL-16D
WORD PTR HF_TBL_VEC,M
HF _NUM, 1
Al,I3L
Al,4
BYTE
Al,l
BYTE
OFFSET CS;170000
GCOH
OFFSET CS:??OOOl
SHORT l4
AH,O
AX,OfFSET FD~TBl-160
WORD PTR HF1_TBl_VEC,AX
HF NUM,2
Dl--;-80H
AH,14H
13H
CTL ERRX
AX, TIMER_lOW
BX,AX
AX,6*182

CHECK CMOS VAL I D I TY
SAVE CMOS FLAG
CMOS NOT VAll 0 -- NO HARD FI LES
AllOW HARD FilE I PL
WRITE IT BACK

ACCESS HARD FILE BYTE

I N CMOS

ZERO CARD OFFSET
SAVE HARD FILE BYTE
GET FIRST DRIVE TYPE

NO HARD FILES
COMPUTE OFFSET
AT LEAST ONE DRIVE
GET SECOND DR I VE TYPE

ONLY ONE DRIVE
COMPUTE OfFSET FOR DRIVE 1
TWO DRIVES
CHECK THE CONTROLLER

GET START T I MER COUNTS
60 SECONOS .. lB.2

ex,AX

HO RESET 1
HCNUM,1POD DONE
Dl,e1H
HD_RESET_1

SET UP DRIVE a
WERE THERE TWO DRIVES?
NO-ALL DONE
SET UP DRIVE 1

**

CLI
IN
AND
oaT
STI
RET

ESTABLISH SEGMENT
RESET THE STATUS I NO I CATOR
7ERO NUMBER OF HARD Fl lES

4

POD~OONE;

FA
E4 21
24 FE
E6 21
FB
C3

ZERO

GET 0 I SKETTE VECTOR
AX, WORD PTR ORC VECTOR
INTO INT 40H
WORD PTR 01 SK VECTOR,AX
AX, WORD PTR ORG_ VECTOR+2
WORD PTR 0 I SK VECTOR+2, AX
HD I SK HANDLER
WORD PTR ORG_ VECTOR, OF fSET 0 j SK_' 0
WORD PTR ORG V£CTOR+2, CS
HDISK INTERRUPT
AX, OFFSET HD_If'H
WORD PTR HD I SK_' NT. AX
WORD PTR HOISK INT+2,CS
PARM TBl DRV 80
WORD PTR HF TBL VEe, OFFSET FD TBl
WORD PTR HF-TBl-VEC+2,CS
PARM TBL DRV 81
WORD PTR HFl TBL VEC, OFFSET FD TBl
WORD PTR HF()BL:=VEC+2, CS
10 DELAY NOT REQU I RED **
TURN ON SECOND I NTERRU PT CH I P
Al, I NT __ CTL]ORT+l
AL,OBFH
INT CTl PORT+1,Al
LET I NTERRUPTS PASS THRU TO
Al,INTl-Cll PORT+1
Al,OFBHSECOND CH I P
I NTl_CTl_PORT+1, AL

10 DELAY NOT REQU I RED
BE SURE T I MER I S ENABLED

Al,021H
AL,OFEH
021H,Al

**

POD ERROR
OOEl
OOEl
00E4
00E7
OOEA
ODED

CTL_ERRX:
BE
E8
E8
SO
EB

0000 E
0161 R
0000 E
OOOF
E9

53
51
84
CO
72
B4
CD
73
E8
73
BE
f6
75
BE
E8
EB
84

09
13
06
11
13
15
0178
EF
0000
C2 01
4£
0000
0161
46
08

~OH

CALL
CALL
MOV
JMP

HD RESET 1
~
PUSH
PUSH
MOV
RES~l :

DOH
OOFO
OOFl
OOF3
00f5
OaF?
DOF9
OOFB
OOFD
0100
0102
0105
0108
010A
0100
0110
0112

MOV

I NT
JC
MOV
INT
JNC

R

RES_2:

£

RES~FL:

CAll
JNe
Mav

TEST
JNZ
MOV

E

R

CALL
JMP

RES_CK:

I~OV

S [, OFFSET F1782
SET FAIL
P MSG
BP,OFH
SHORT POD~DONE
PROC
BX

CONTROLLER ERROl{
DOtH I PL FROM DISK
01 SPLAY [RROR
POD ERROR FLAG

NEAR
SAVE TIMER liMITS

ex

AH,09H

SET OR I VE PARMS

13H
RES 2
AH,llH

REGAllBRATf DRIVE

13H
RES CK
POO-TCHK
RES-1
SI,OFFSET F1781
Dl,1
RES E1
SI, OFFSET F1780
SET FAIL
SHORT RES_El
AH,08H

DRIVE OK
CHECK T I ME OUT
INDICATE DISK 1 FAI lURE
INDICATE DISK a FAILURE
DONT TRY TO (PL DISK 0
GET MAX CVL, HEAD, SECTOR

Disk 5-105

0114
0116
0118
011A
01le
0-" F
0121
0123
0126
0128
012B
0120
0130
0132
0135
0137
013A
013C
013E
0142
0146
0146
0148
0146
0146
0148
0148
0149
OlllB
0140
0150
0153
0155
0158
0158
015E
015F
0160
0161
0161
0161
0163
0165
0167
0169
016B
u160
016f
0171
0173
0175
0177
0178
0178
0178
0179
017A
0178

MOV

8A Oil
CD 13

INT
JC

72 33
8A 03
B8 01101
CD 13
73 3B
80 Fe OA
74 36
BO Fe
74 31
BO Fe 10
74 2C
E8 0178 R
72 16
AD 0044 R
FE C8
74 D4
8A 2E 0045 R
8A DE 0046 R

RES_3:

CMP

JE

l'

eMP

JE
eMP

JE
CALL

JC
MOV
u~_c

JZ

+ 1?0003
00

+
+ ??0004
+

E1

eo

MOV
MOV
I SHL
LABEL
SHL
LABEL
ORC
DB

ORG
OB
OR

06
OA C8
EB CF
BE 0000 E
F6 C2 01

15 03
BE 0000
E8 0000
80 OOOF

59

JMP

RES_ER:

MOY
rEST
JNZ
MOV
RES_E1: CALL
MDV
RES_OK: POP
POP

5B
e3

BO
E6
EB
E4
OC
8A
BO
E6
8A
EB
E6
e3

MOV
MaY
INT
JNC

VER I FY OK
OK ALSO I F JUST

10 READ

CHECK FOR T I ME OUT
FAI LED
GET SECTOR ADDRESS
TRY PREY I OlJS ONE
WE'VE TRI ED ALL SECTORS ON TRACK
GET CYL I NOER
NUMBER
MOVE THE BITS UP

BYTE
6
PUT SECTOR NUMBER IN PLACE
TRY AGAI N
INOICATE DISK 1 ERROR

CL,AL
R[S 3
5 I, OFFSET F1791
DL,1
RES E1
S I, OFFSET F1790
P M5G
BP,OFH

INDICATE DISK 0 ERROR

ex

RESTORE T I MER L! M I TS

BX

RET

BE

ENDP

SET FAIL
Mav

PROC
NEAR
AL,BEH
70H,AL
SHORT $+2
AL,71H
AL, ~IF FAI L
AH,ALAL,BEH
70H,AL
AL,AH
SHORT $+2
71H,AL

70

OUT
JMP

00
71

IN
OR
MOV
MOV

DB

EO
8f

70

OUT

C4
00
71

JMP
OUT

MOV

GET CMOS ERROR BYTE

SET DONT I PL FROM 0 I SK FLAG
SAVE IT
CMOS BYTE ADDRESS

PUT

I TOUT

RET
ENDP

SET FAIL
POD TCHK
POP
POP
POP
PUSH
PUSH
PUSH
MOV

0170
Ol7E
0181
0183
0185
0187
0189
018B
0180
018F
0191

38 D9

CMP

72 06

JB

38
72
EB
3[}
72
3B
72

eMP

0193
0194
0195
0196
Uly{

RESTORE DRIVE CODE
VER I FY THE LAST SECTOR

OfFSET CS: ??0003
OCOH
OFFSET CS: 1?0004

HD_RESET_l

58
59
5B
53
51
50
A1 006C R

one

SAVE DRIVE CODE

BL,DL
13H
RES ER
DL,BL
AX, 0401 H
1311
RES OK
AH, BAD SECTOR
RES_OKAH, DATA CORRECTED
RES OK AH,BAD ECC
RES_OKPOD TCHK
RES-ER
AL, eMU BLOCK+2
AL
RES CK
CH,CMD BLOCK+3
CL,CMO-BLOCK+4
CL,6 BYTE':
Ct,l

DB
OC
a/I
C]
OJI
Cl
02

J8
JMP

TCHK1:
TCHK2:
TCHKNG:

F9
e3
FB
e3

CMP
JB
CMP
JB

CHECK FOR 30 SECOND T I ME OUT
SAVE RETURN
GET TIME OUT LIMITS

PROC NEAR
AX

ex

ex
BX
ex

AND SAVE THEM AGAIN
RESTORE RETURN
AX :::: CURRENT TIME
BX _ START TIME
CX ~ END TIME

AX
AX, T I MER_LOW
BX,CX
TCHKl
aX,AX
TCHKG
SHORT TCHK2
AX, BX
TCHKNC
AX,CX
TCHKG

START < END
END < START < CURRENT
END, CURRENT < START
CURRENT < START < END
START < CURREN r < END
OR CURRENT < END < STARI
CARRY SET INDICATES TIME OUT

STC

RET
TCHKG:

ENDP

DISK SETUP
PAGE-

0197

I NO I CATE ST I LL T I ME

CLC
RET

POO_fCHK

ENDP

FIXED DISK RIDS [NTRY POINT
DISK 10 PROC
ASSUME

0197
0197
019A
019C
019E
019E
01Al
01Al
01A2
01A4
01A6
0111B

01AA
01AD
OlAF
OlAF
01B2
01B4
01B7
01BA
01BC
01BF
01Bf
01CO
01Gl
01C2
01C3
01CII
0lC5
01c6
01C8
OlCA
a1CC
01CF
0100
0103

CMP

FA 80
73 05
CO 40

BO

JAE
I NT

AS3Ur~[

BACK TO CALLER

08: DATA
ENABLE

STI

OR

E4
09
40

JNZ
I NT
SlJB
CMP

Ell

FA 81
77 EF

JA

AH,AH
A2
40H
AH,AH
OL,(80H + S MAX FILE RET_2
--

A2:
80 FC 08
75 03
E9 038B R
80 FC 15
75 03
E9 0349 R

eMP

JNZ
A3:

JMP
eMP

JNZ
JMP

A4:
53
51
52
1E

06
56
57
OA
75
62
E-8
50
B8
BE

TEST FOR FIXED DISK DRIVE
Y"S, HANULE HERE
DISKETTE HANDLER

RET
HARD_DISK:

CA 0002
fB
OA
-(5
CD
2A
80

FAR

05: NOTH lNG, ES: NOTH I NG
DL,80H
HARD 01 SK
40H -

Fli
02
80
0212 R
---- R
08

5-106

Disk

A5:

PUSH
PUSH
PUSH
rUSH
PUSH
PUSH
PUSH
OR
JNZ
MOV
CALL
PUSH
MOV

MOV

INTERRUPTS

RESET NEC WHEN AH::::O
1)

AH,08H
A3
GI:.T_PARM_N
AH,15H
A4
READ_DASa_TYPE

GET PARAMETERS

IS A SPECIAL CASE

READ OASD TYPE

IS ALSO

ox

SAYE REGISTERS DURING OPERATION

ex
DX
1)$

ES

SI
01
AH,AH
A5
DL,80H
DISK 10 CONT
AX AX, DATA
OS, AX

CHECK FOR RESET
FORCE DR I VE 80 FOR RESET
PI:.RFORM THE OPERATION
ESTABL I SH SEGMENT

0105
0106
010A
01 DO
01 DE
01DF
01 EO
01 E1
01 E2
01 E3
01 E4
01 E5
01E8

01 E6
01 E8
OlEA
01 EG
01EE
01 FO
01 F2
01 F4
01 F6
01 F6
01 FA
01FC
01 FE
0200
0202

58

POP

AX

8A 26 0074 R
80 FC 01

MOY
eMP
eMe
POP

AH,DISK_STATUS1
AH,1

f5
5F
5E
07

POP
POP
POP
POP
POP
POP

1F
5A
59
58
GA 0002

RET

M1

0263
0307
0310
0318
0320

R
R
R
R

R

0333 R

02AB R
02AB R
02AB R
03EA R

041 F R
0427 R
042 F R
02B3 R
02AB R

0206
0206
020A
020G
020E

0210
'" 002A

021.3
0219
021C
021 E

OW
OW
OW

ow
OW
OW
M1L

0227
022B
022C
022F
0231
0233
0234
0231
0238
023B
0230
0238
0238

0238
0230
0230
023E

0241
02!15
0246
0249
024A

024B
024G

0250
0253

0255

50
B8
---- R
BE 08
58
80 FC 01
75 03
E9 0307 R

50
80 E2 7F
3A 0/\
76 76
06
E8 06B4 R
26: 86 47 05
01

£8

MOV
MDV
POP

CMP
JNZ
JMP

07

8A 26 0076 R
80 E4 GO
OA EO

50

+ 770009
DO

E8

+ 7?000A
CO

06
A2 0046 R
SA C2
+ 77000G
DO EO

E6 Of
C6
AO

0047 R

0282

8A G4
32

01

028D
028F
0290

0291
0292
0293

E4

EO
8B FO
3D 002A
73 lA
58
56
51
50
86 CS

0295
029;'
0297

0295
0295

710000

GO

0286
028A

+
+
+

0284

0288

+
+

0280
0281

027B
0270

MOV
PUSH
MOV
PUSH
" AND
eMP
JBE
PUSH
CALL
MOV
ISHR
+ 770006 LABEL
+
SHR
+ 7?0007 LABEL
+
ORG
+ ?70008
LABEL
DB
ORG

5A

04
80
OA
OC
A2
58
50

0279

I ON TRANSFER TABLE

fORMAT BAD SECTORS
FORMAT DRIVE
RETURN PARf1S

READ BUFfER
WRITE BUFFER

010H
011H
012H
013H
014H

RAM DIAGNOSTIC
DRIVE DIAGNOSTIC
CONTROLLER 0 I AGNOST I

e

NEAR

AX

AX,DATA
OS,AX

EST ABL I SH SEGMENT

AX

RETURN STATUS

AH,OlH
SUO

RETURN_STATUS
DISK STATUS1,O
BXBL,Hf NUM
AX
DL,7fH
BL,DL
BAO_COMMAND_POP
ES
GET VEC
AX,WORD PTR ES:[BX)[5i
AX,2
BYTE
AX,l
BYTE
OFfSET CS: 770006
NEAR
OC1H
OFfSET CS: n0007

2

0275

0276

PROC

CMD_BLOCK~ AL
AL,BYH PTR ES:[BXj(8j
OX
OX, HF _REG_PORT
OX, AL
OX
ES
AH,CoNTROL_BYTE
AI-I,oCOH
AH, AL
CoNTROL_BYTE,AH
AX
CMD_BLOCK+l ,AL
AX
Al, CL
AL,3fH
CMD BLOCK+2,AL
CMD-BLOCK+3,CH
AL, Cl

24 3f
A2 0044 R
88 2E 0045 R
SA Gl

0273
0273

FUIIICT
OOOH
001H
002H
003H
OOl.jH
005H
006H
D07H
D08H
009H
OOAH
OOSH
OOCH
OOOH
OOEH
OOFH

DB

8A C1

0273
0?73
0275
0275

THROW AWAY SAVED FLAGS

MOV
MOV
PUSH
MOV
OUT
POP
POP
MOV
AND
OR
MOV
POP
MOV
PUSH
MOY
AND
MOY
MOV
MOV
ISHR
LABEL
SHR
LABEL
ORG
DB
ORG
DB
MOV
MOV
ISHL
LABEL
SHL
LABEL
ORG
DB
ORG

0250
02,)[

02613

2
WORD
DI SK RESET
RETURN STATUS
DISK READ
01 SK-WRI TE
01 SK-VERF
FMT TRK
BAD-COMMAND
BAD-COMMAND
BAD-COMMAND
INIT DRV
RO LONG
WR LONG
DISK SEEK
01 SK-RESET
BAD COMMAND
BAD-COMMAND
TST-RDY
HDISK REGAL
BAD GOMMAND
BAO=COMMAND
CTLR DIAGNOSTIC
$-Ml-

02

0260
0262
0265
0269

0260
0260
026E
0271

ex
BX

112 0042 R
26: 8A 47 08
52
l3A 03 F6
EE

o25A

0268
0268
0260
0268

51

SUO:
C6 06 0074 R 00
53
SA 1 E 0075 R

88 26 0076 R
58
A2 0043 R

0259

EOU

DISK_IO CONT
-PUSH

0221
0221
0226

LABEL
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW
OW

ow

02AB R
044E R
0465 R
02AB R
02AB R
0489 R

0212

0?16
0218

D'
ES
OS
OX

DISK_IO ENDP

0204

0212

GET STATUS FROM OPERAT I ON
SET THE CARRY FLAG TO INDICATE
SUCCESS OR FAILURE
RESTORE REG I STERS

D1

E9

+ 77000F
+
+ 770010

+
+ 770011

;

RESET THE STATUS INDICATOR
SAVE DATA ADDRESS
GET NUMBER OF DRIVES
GET DRIVE AS 0 OR 1
INVALID DRIVE
GET 0 I SK PARMS
GET WR I TE PRE-COMP CYL

GET CONTROL BYTE MOD I F I ER
SET EXTRA HEAD OPT I ON
SET EXTRA HEAD OPT I ON
CONTROL BYTE

IN

SECTOR COUNT
GtT SECTOR NUMBER
GET CYL I NDER NUMBER

AL,6
BYTE

AL,l
BYTE
OfFSET CS:?70009
OCOH
OfFSET CS:77000A
6
CMD_BLOCK+4,AL
AL, DL
AL,4
BYTE
AL,l
BYTE
OffSET CS:?7000C
oCOH
OFFSET CS:7?OOOD

DB

4

AND
DR
DR
MOV
POP
PUSH
MoV
XOR
SAl
MOV
CMP
J N8
POP
POP
PUSH
PUSH
MOV
ISHR
LABEL
SItR
LABEL
ORG
LABEL

DH,OFH
AL,DH
AL,80H OR 20H
CMD_BLOCK+5, AL
AX
AX
AL,AH
AH,AH

AX,l
SI,AX
AX,M1L
BAD COMMAND POP
AX -

BX
CX
AX
ex, BX
CX,4
BYTE

CYLINDER HIGH ORDER 2 BITS
DR I VE NUMBER

HEAD NUMBER
ECC AND 512 BYTE SECTORS
ECC/S I ZE/DR I VE/HEAD
GET I NTO LOW BYTE
ZERO HIGH BYTE
*2 FOR TABLE LOOKUP
PUT INTO S I FOR BRANCH
TEST WITHIN RANGE
RESTORE AX
AND DATA ADDRESS
ADJUST ES: BX
GET 3 HIGH ORDER NYBBLES OF BX

CX,l
BYTE
OfFSET CS:??OOOF
NEAR

Disk 5-107

0295
0297
0297
0298
029A
029C
029E
02A2
02A3
02A4
02A9
02A9
02AA
02AS
02AS
02BO
02B2
0283

el

a"
BC

CO
03 Cl
8E CO
81 E3 OOOF

58
59
2E:

FF A4 01E8 R

58
5B
C6 06 0074 R 01
BO 00

e3

DB
OC1H
ORG
OfFSET CS:??0010
OB
"
MOV
AX, ES
ADD
AX, CX
MOV
ES, AX
AND
BX,OOOFH
; ES:BX CHANGED TO ES:OOOX
PiJP
AX
POP
CX
JMP
WORD PTR CS: [SI + OFFSET Ml]
BAD_COMMAND_POP:
POP
AX
POP
BX
BAD COMMAND:
MOV
0ISK_STATUS1,BAD_CMD
COMMAND ERROR
MOV
AL,a
RET
DISK_IO_CONT
ENDP

;
;
02B3
02B3
02B4
02B6
02B8
02BA
02BB
02BO
02CO
02C'
02c4
Q2C5
Q2C7
02CA
02CC
02CD
0200
0202
0205
0206
0208
020A
020f
02E1
02E4
02£1
02EC
o2EE
02f3
02F~

OZFa
02fB
0300
0301
0306
0307

0307
0307
030A
030f
0310

FA
E4
24
E6
FB
BO
SA

----------------------------------------------RESET THE 0 I SK SYSTEM
(AH = OOOH)
------ --------- --------------------------------

01 SK_R£S~ll

IN

Al
SF
A1

ANa

OUT
STI
MOV
MOV
OUT
MOV
DEC
JNZ
MOV

04
03F6

EE

89 OOOA
"9

75
AO
24
EE
E8
75
BA
Ee
3C
75
80
2A
E8
E8
80
76
80
82
E8
E8
C6
e3
C6
C3

ORO:
FD
0076 R
OF

ANa

OUT
CALL

050f R
2f
OlF1

JNZ
MOV

IN
01

eMP

27

JNZ

26 0047
02
03EA R
0465 R
3E 0075
00
DE 0047
01
03EA R
0465 R
06 0074

R EF

ANa
SUB

GALL

START INTERRUPTS
Al,04H
OX, HF _REG_PORT
DX,Al
CX,10
CX
ORO
Al, CONTROL_BYTE
Al,OFH
OX,Al
NOT_BUSY
DR ERR
OX, HF _PORT+l
Al,DX
AL,l
DR ERR
CMO_BLOCK+5,OEFH
DL,Dl

RET

CARD fAI LED

ENDP

-------------------- ------- ----------- ----------------------------------- ---- -- ----

AO 0074 R
c6 06 0074 R 00
e3

RET

RETURN_STATUS

c6 06 0048 R 20
E9 04BB R

o I SK_REA~OV
JMP

01 SK_READ

c6 06 0048 R 30
E9 04F8 R

ENOP
(AH ::: 002H)

06 00'-18 R 40
0544 R
08
05A,) R
03
061£ R

JMP

003H)

PROC
NEAR
CMD_BLOCK+6, VERI FY_CMO
COMMAND
VERF EXI T
CONTROLLER STI LL BUSY
WAITVERF_EXIT
; TIME OUT
CHECK_STATUS

RET

DISK_VERF

;
C6 06 0048 R 50

06
53
£8 0684 R
26: 8A 47 OE
A2 0043 R
5B
07
E9 0500 R

fORMATTING

005H )

(AH

= 005H)

NEAR
CMD_BLOCK+6, fMTTRK_CMO

FORMAT TRACK

GET_VEC
Al,ES:[BX](14]
CMO BLOCK+l. AL

GET 01 SK PARMS ADDRESS
GET SECTORS/TRACK
SET SECTOR COUNT I N COMMAND

CMo_OF

GO EXECUTE THE COMMAND

'5
BX

BX ES

fMT TRK ENDP
PAGE

---------

-------------------------------------READ OASO TYPE
(AH = 15H)
--- ---------------------------------------------

READ nASO TYPE
REAO::::O.T PUSH

Disk

(AH

------------------------------------------------

POP
POP
JMP

;

lE

ENOP

------- ----------------------------------------=

FMT_TRK PRoe
MOV
PUSH
PUSH
CALL
MOV
MOV

;

5-108

(AH

PROC
NEAR
CMO_BlOCK+6, WR I TE_CMO
COMMANDO
ENOP

DISK VERIFY
(AH = 004H)
---------- -------------------------------------

OISK_VERF
MOV
CALL
JHZ
CALL
JNZ
CALL
VERF_EXIT:

e3

PRoe
NEAR
CMD BLOCK+6, READ CMD
COMMAND I
ENDP

DISK WRITF ROUTINF

DISK_WRITE

C6
E8
75
E8
75
£8

OBTAIN PREVIOUS STATUS
RESET STATUS

=
--- ---------------------------------------------

DISK_WRITE
MOV

;

03119
0349
0349

SET TO ORIVE 1
SET MAX HEADS
REGAL TO RESLT SEEK SPi:.ED
I GNORE ANY SET UP ERRORS

;
------- --DISK STATUS ROUTINE
(AH = 001H)
;
RETURN_STATUS
PROC
NEAR
MOV
AL, 0 I SK_STATUS1
;
01 SK_STATUSl ,0
;
MOV

;

0333
0333
0338
0339
033A
0330
0341
0344
0345
0346
0349

BAD RESET STATUS
SET TO OR IVE 0
SET MAX HEADS
RECAl TO RESET SEEK SPEED
CHECK FDR OR I VE 1

01 SK_STATUSl ,BAD_RESET

;

0320
0320
0325
0328
032A
0320
032F
0332
0332
Q333

TIME OUT ON RESET
GET RESET STATUS

MOV

;
0318
0318
0310
0320

SET HEAD OPT I ON
TURN RESET OFF

~~: ~K~~~CAL

DISK READ ROUT I NE
0310
0310
0315
0318

RESET
DELAY COUNT
WAIT 4.8 MICRO-SEC

OR ERR:

RET

**

ENABLE HARD FilE I NT.

ORE:

DISK_RESET

10 DELAY NOT REQU I RED

GET THE MASK REG

HF _NUM, 1
ORE
CMO_BLOCK+5,010H
OL,l
INIT DRV
HD J SICRECAl
01 SK_STATUSl ,0

R 10

R 00

**

CAll
CMP
JBE
OR
MOV
CALL
CAll
MOV

R 01

06 0074 R 05

~EAR

PROC

Al, I NT _CTl_PORT+1
AL.OBfH
I NT_CTl_PORT+l, Al

LABEL
PROC
OS

NEAR
FAR

;
;

GET DR I VE PARAMETERS
SAVE REG I STERS

034A
03 1413
03 11C
034F

PUSH
PUSH

06

53

----

BB
BE 08

MOV
MOV

8

ASSUME
0351
0356
035A
0350
035F
0361
036 11
0368
036C
036E
0371
0372
037'1
0376
037R
037A
037C
0370
037E
037F
0380
0383
0383
0385
0387
038<)
0388

e6 06 0074 R 00

MOV
MOV
AND
CM?
JBE

8A 1 E 007';1 R
80 E2 7F

3A DA
76 22
E8 0 PARM BLOCK
GE r NUM6EH OF HfAOS
CONVERT TO 0-1 NOEX

(AH '" OBH)

PflOC
NEAR
eMD BLOCK+6, WR I TE CMO OR ECC MODE
COMMANDO
ENOP

Disk 5-109

;
;
042F
042F
0434
0437
0439
043e
043E
0441
0446

04li8

C6
E8
75
E8
75
E8
80
15
C6

o I SK_SEE~OV

06 0048 R 70
0544 R
14
05A5 R
OF
061E R
3E 0074 R 40
05
06 0074 R 00

CALL
JNZ
CAll
JNZ
CALL
CM'
JNE
MOV
OS EXIT:
RET
DISK_SEEK

0440

04liD

---------------------------------------SEEK
(AH = OCH)
----------------------------------------

C3

044E

PROC
NEAR
CMD_BLOCK+6, SEEK_CMD
COMMAND
OS_EXIT
WAIT
OS EXIT
C~I'ECK STATUS
01 SK_STATUS1, BAD_SEEK
DS_EXI T
0ISK_STATUS1,0

CONTROLLER BUSY ERROR
T I ME OUT ON SEEK

ENOP

----------------- -----------------------------;
TEST DISK READY
(AH = 010H)

;
;
044E
044E
0451
0453
0456
0459
045A
0450
045f
0464
0"'65

E8
75
AD
SA
EE
E8
75
C6
C3

05DF R
11
0047 R
01r6
0630 R
05
06 0014 R 00

i:f=~6y ~~bp
;
;

;
0465
0465
046A
0460
046F
0472
0474
04n
047C
047E
0483
0483
0488
0489

0489
0489
048B
0480
04eF
0491
0493
0495
0498
049A
0490
049F
04AO
04A3
04AS
04A7
04AA
04AIl
04AE
04BO
0482

OliB4
04B6
04B6
04BA
0488

04BB
04BI1
04SE
04CO
04C2
04C5
01le7
04G1
04CA
04CC
04CF
0402
0403
0405
04DA
04DG
04DF
04E1
04E4
04£1
04E6
04E8
04EC
04EE
04F1
04F3
04F8
04FA
04fA
04FA

C6
E8
75
E8
75
E8
80
75
C6

06 00"'8 R 10
0544 R

14
OSA5 R
Of
061E R
3E 0074 R 40
05
06 0074 R 00

80 3E 0074 R 00
C3

E4
24
E6
E4
24
(6
£8
75
SA
80

A1
BF
Al

21
FB
21
050F R
1A
01 F7
90

EE
£8
84
75
SA
EC
A2
84
3C
74
84

--- ---------------------------------------------

TST_ROY PROC
CALL
JNZ
MOV
MOV
OUT
CALL
JNZ
MOV

050F R
80
OF
01 Fl
0080 R
00
01
02
20

88 26 0074 R
C3

NEAR
NOT_BUSY
TR_EX
AL, CMO_BLOCK+5
OX, HF_PORT+6
DX,Al
CHECK_ST
TR_EX
o ISK_STATUS1 ,0

WAI T FOR CONTROLLER
SELECT OR I VE
CHECK STATUS ONLY
; WI PE OUT DATA CORRECTED ERROR

-------- ---------- -----------------------------= all
-- --- ------------------------------------------RECAll BRATE

(AH

H)

HOI SK RECAL
MOV
CALL
JNZ
CALL
JNZ
GALL
CM'
JNE
MOV
REGAL_EXIT:
CMP
RET
HO I SK_RECAL

PROC
NEAR
CMD_BLOCK+6. REGAL_CMO
COMMAND
RECAL EXIT
WAIT RECAL_EXI T
CHECK_STATUS
01 SK_STATUS1,BAO_SEEK
RECAL_EXIT
DISK_STATUS1,0

CTLR_DIAGNOSTIC
IN
AND
OUT
IN
AND
OUT
CALL
JNZ
MOV
MOV
OUT
CALL
MOV
JNZ
MOV
IN
MOV
MOV
CMP
JE
CO ERR: MOV

PROC
NEAR
AL,INT_CTl_PORT+l
AL,OBFH
INT_CTL_PORT+l,AL
Al,INTl_CTL_PORT+l
AL,OFBH
I NTl_CTL_PORT+1,AL
NOT_BUSY
CO_ERR
DX, HF _PORT+7
AL,OIAG_CMO
OX,Al
NOT_BUSY
AH, T I ME_OUT
CO_EXIT
OX, UF _PORT+l
AL,OX
H F ERROR, AL
AH-;-O
AL,1
SIiORT CO EXIT
AH, BAD_CNTLR

CO:EXIT: MOV

01 SK_STATUSl,AH

:

START THE OPERATION
ERROR
WAI T FOR COMPLET ION
TIME OUT
SEEK NOT CO;.'lPLETE
IS OK

01 SK_STATUS1 ,0
ENOP

**

10 DELAY NOT REQU I RED
TURN ON SECOND INTERRUPT CH I P
LET I NTERRUPTS PASS THRU TO
SECOND CHI P
WA I T FOR CARD
BAD CARD
START DIAGNOSE
WAIT FOR IT TO COMPLETE
T I ME OUT ON 0 I AGNOSTI C
GET ERROR REG I STER
SAVE IT
CHECK fOR ALL OK

RET

CTlR_D I AGNOST I C [NOP
~

-CO;;;';'N~ ~----- ----------------------------------

;
;

REPEATEDLY INPUTS DATA TIL NSECTOR
RETURNS ZERO

bOM;ANOi;---------------------------------------[8
72
8B
E8
75

068F R
3A
FB
OSli4 R
33

CALL
JC
MOV
CALL
JNZ

CHECK_OMA
CMD_ABORT
OI,BX
COMMAND
CMO_ABORT

CHECK 64K BOUNDARY ERROR
OUTPUT COMMAND

CMo_ 11:
1:.8 o~A~ R
75 2E
89 0100
BA 01 Fa
FC
F3 60
F6 06 0048 R 02
74 12
E8 0608 R
72 19
SA 01 FO
89 0004
EC
26: 88 05

47
E2
E8
15
F6
15

f9
06lE R
07
06 008C R 80
co

C3

GALL
WAlT
TM OUT
JNZ
MOV
CX-;-256D
MOV
DX,HF_PORT
CLO
REP_ INSW
DB
OF3H,060H
TEST
CMo_BLOCK+6, ECC_f'lODE
JZ
CMD_13
CALL
WAIT_ORQ
JC
TM OUT
OX-::-HF _PORT
MOV
MOV
CX,4
CMD_12: IN
AL,OX
MOV
ES:8YTE PTR [01 J,AL
INC
01
LOOP
CMO 12
CMD_ 13: CALL
CHECK STATUS
CMO ABORT
JNZ
Hf'_STATUS,ST_BUSY
TEST
SHORT CMO_ll
JNZ
CMO ABORT:
TM_OUT:
RET

WAI T FOR DATA REQUEST INT
TIME OUT
SECTOR SIZE IN WORDS
GET THE SECTOR
;

GET ECC BYTES
GO SLOW FOR BOARD

ERROR RETURNED
CHECK FOR MORE

COMMANDO
REPEATEDLY OUTPUTS DATA TIL NSECTOR
RETURNS ZERO

5-110 Disk

CHECK fOR NORMAL INPUT

WAIT FOR DATA REQUEST

--------- - -- - - - --- -- -- ----------- - - ----------~-

04FB
OIIFB
04FE
O~OO

0502
0505
0507
050A
050C
0:'>00
050E
05DF
0512
0515
0516
0518
0519
051 E
0520
0523
0525
0528
052B
052E
052F
0530
0532
0532
0535
0:;'37
053A
053C
05 111
05 Jn

E8
72
8B
E8
75
E8
72
1E
06

D68r R
FA
F3
054/1 R
F3
0608 R

EE

COMMANDO:
CALL
JC
CMD_OF: MOV
CALL
JNZ
CALL
JC
CHD_01 : PUSII
PUS~I

1F
B9 0100
BA 01 Fa
FC
F3 6F

1F
F6 06 0048 R 02
74 12
E8 0608 R
72 05
BA 01 FO
B9 0004
26: 8A 04

EE
46
E2 F9

E8 05A5 R
75 C3
E8 061E R
75 BE
F6 06 008C R 08
75 C9
C3

0573
0578
057A
0570
057F
0581
0583
0~85

0587
OS8C
058C
058E
05BF
0590
0591
0595
0597
0598
0599
0599
059E
059E
059F
05A4
05A5

53
89 U6UU
51
E8 044E R
59
7" DB
80 3E 0074 R 80
74 43

[2 1'0
Ea 44
58
57
C6
E4
24
LG

E',

2'.
E6
I3F
OA
F6
74
AO
24
3C

06 008E R 00
At
BF
A1
21

Fil
21
0042 R
01 F 1
06 0076 R CO
12
0048 R
Fa

cO

72 09
3C '10
77 05
80 OE 00/18 R 01
8A 05

EE
47
42
81 FA 01 F8
75 F5
5F
C3
C6 06 0074 R 20
58

80 3E 0074 R 00
C3

ex

OUT PUT COMMAND

COMMAND
CMD ABORT
WAIT _DRQ
TM_OUT
DS
ES
DS
CX,2':>60
ox, IIF _PORT

\-IAI T FOR DATA REQUEST
TOO LONG
MOVE ES 10 OS
PUT TH[ DATA OUT

fO THE CARD

RESTORE OS
CHECK FOR NORMAL OUIPUT
WAI T FOR DATA REQUEST
OUTPUT THE ECC BYTES

WAI T FOR SECTOR COMPLETE
ERROR RETURNED

INT

CHECK FOR MORE

COMMAND
IHIS ROUTINE OUTPUTS THE COMMAND BLOCK
OUT POT
131_ =' STA1US
BH '" ERROR REG I STER

COMMANO PROC
PUSH
~10Y

COMMAN01 :
PUSH
CAl L
POP
JZ
CMP
JZ
l.OOP
JMP
COMMAND2:
POP
PUS,l
MOV
IN
AND
OUT
IN
AND
OUT
MOV
MOV
lEST
JZ
MOV
AND
CMP
JB
CMP
JA
OR
COMMAND3:
MOV
OUT
INC
INC
GMP
JNZ
POP

RET

WAI I

WAIT
Fa
213 G9
F8
B8 9000
co 15
7? 28
r6 06 008E R 80
75 11
03 20

FOR

NEAR
OX
CX,OCLAY_2

\oIAI T FOR SEEK COMPLETE AND READY
SET I NIT I AL DELAY BEFORE TEST
SAVE LOOP COUNT
CHECK DRIVE READY

CX
TST ROY
CX COMMAND?
01 SK_STATUS1, TIM[_OUT
eMU TIMEOUT
COMMANDl
SHORT COMMAND!I

DR lYE I S READY
TST_RDY TIMED OUT--GIVE UP
KEEP TRYI NG FOR A \-IH ILE
\ TS NOT GO I NG TO GET REAOY

BX

-It-lt
\ a OELAY NO:- REQU I RED **
RESET I NTERfWPT flAG
TURN ON SECOND INTERRUPT CH I P

DI
HF I NT FLAG,O
AL-::-I NT=:CTL_PORT+l
AI.,OBFH
\NT CTL rORT+l,AL
AL, 1111 f'=:CTL_PORT+1
AL,OFBH
INTl GTl PORT+l,AL
01 ,OfFSET CMD_BLOCK
DX,HF_PORT+l
CaNT ROL_BYTE, OCOH
COMMAND3
AL, CMD BLOCK+6
AL,OFOll
AL,20H
COMMAND3
AL,IIOH
COMMAND3
CMD_BLOCK+6, NO_RETR I ES

LET I NTERRUPTS PASS THRU TO
SECOND CH I P
I ND[X THE COMMAND TABLE
DISK ADDRESS
CHECK FOR RETRY SUPPRESS I ON
YES-GET OP CODE
GET RID OF MODIFIERS
20H-40H I S READ, 'rIR I TE,

VER I FY

VALID OP FOR RETRY SUPPRESS

AL, l DI]
OX,AL

GET THE COM~\Atm STR I NG
GIVE IT TO CONi ROLLER
N[XT BYTE
NEXT DISK REGISTER
ALL DONE?
NO--GO DO NEXT ONE

DI
DX
OX, HF _PORT+8
COMMAND3

DI
ZERO FLAG

CMD f IMEOU r:
MOV
COHMAIIID4:
POP
eMP
REl
COMMAND ENDP
;

05A5
05A5
05A6
05A8
05A9
05AC
05Al
051.30
0'jB5
05137

51,

POP
MOV
MOV
CLD
REP _OUTSw
08
OF3H,06FH
PDP
OS
TEST
CMD_BLOCK+6, ECC_MODE
JZ
CMD 03
CALL
WAIT _DRQ
TM OUT
JC
MOV
DX~HF _PORT
MOV
CX,4
AL, ES; BYTE PTR [S I J
CMO_02 : MOV
OUT
DX,AL
INC
51
CMO_02
LOOP
CMD_03 :
CALL
WAIT
TM OUT
JNZ
CALL
CHECK STATUS
CMD ABORT
JNZ
HF _STATUS, 5T_ DRQ
TEST
SHORT CMD_Ol
JNZ
RET

;
;

0544
05 '-14
0545
0548
0')48
0549
054C
OSI,O
OS4f
055 11
0556
0558
05'>A
055A
0558
O55C
0561
0563
0?6'.l
0567
0569
056L:l
0560
0':>70

CHECK 64K BOUNDARY ERROR

CHECK DMA
CMD ABORT

I S SET

01 SK_STATUS1, BAO_CNTLR
BX
DISK_STATUS1,O

;

SET COND I T I ON CODE

FOR CALLER

I NfERRurl

PROC
ST I
SUB
CLC
MOV
INT
JC
TEST
JNZ
MOV

NEAR

ex,cx
AX,9000H
15H

wn

HF INT _FLAG,BOH
WT2
BL, DELAY_ 1

MAKE SURE I NTt::RRU PTS ARE ON
SEI INIIIAL DELAY BEfORE TEST
DEVICE WAIT

INTERRUPT

DEVICE TIMED OUT
TEST FOR I NTERRUPT ALREADY
SET DELAY COUNT

WAIT LOOP

05139
OSSE
OSGO
OSC2
05C4
05C6
OSC8
OSCD
0502
0507
0508
OSOO
OSDF

F6 06
F1 F9
06
FE CB
7S F3
EB 10
C6 06
C6 06
80 3E
C3

008E R 80

WT1;

75

007 11 R 00
008E R 00
00711 R 00

W12;

<':6 06 0074 R 80

WT3:

w-rx;

Ea F3

'riAl T

TEST
LOOPZ
JNZ
D[C
JN7
JMP
MOV
MOV
Ct-lP

HF INT _FLAG,BOH
WTl
WT2
BL
WT1
SHORT 1413
DISK_STATUS1,0
HF INT _FLAG,O
DISK_STATUS1,O

TEST FOR

INTERRUPT

INTERRUPT--LETS GO
KEEP TRYI NG FOR A WHilE

SET COND I T I ON CODE FOR CALLER

RET
MOV
JMP
ENDP

DISK_STATUS1, TIME_OUT
WTX

REPORT

T I ME OUT ERROR

Disk 5-111

~~
;
05DF
050f
05EO
05E1
05E3
05E5
05E6
05E9
05EB
05EO
OSEF
OSf1
OSF3
05f5
05FA
05FB
0600
0601
0606
0608

WAIT-FOR -coNTRoLLER -NOT-SUsY---------------------------

----- ---- ----------------------- ------------------------

NOT_BUSY
FB
53
B3 20
28 C9
SA 01F7
Ee
A660
EO FB
7JI 06
fE CB
75 F5
£B DC
C6 06 0014 R 00
5B
80 3E 0074 R 00
C3
C6 06 0074 R 80
EB F2

STi
PUSH
MDV
SUB
MDV
IN
TEST
LOOPNZ
JZ

NBl:

DEC
JNZ
JMP
MOV
POP
CMP
RET
MOV
JMP

N82:
NBX:
NB3:
NOT_BUSY

PROC

NEAR
MAKE SURE

INTERRUPTS ARE ON

BX

BL,OELAY_1
CX,CX
ox, HF_PORT+7
AL,OX
AL, ST_BUSY

NBI
NB2
BL
NBI

SET I N I TI AL DELAY BEFORE TEST
CHECK STATUS
NOT 8USY--LETS GO
KEEP TRYI NG FOR A WH I LE

SHORT NB3
01 SK_STATUS1 ,0
BX
DISK_STATUS1~0

SET COND I TI ON CODE fOR CALLER

DISK_STATUSl, TIME_OUT
NBX
ENDP

REPORT T I ME OUT ERROR

i -WA~;:-FO;- D~;:A-;E;;uEs;:------------ -------------7
0608
0608
060B
060E
060F
0611
0613
0615
061A
0618
061e
0610
061E

~A~T-oR;;--------PRoc----NEAR---------------------

B9
BA
Ee
A8
75
E2
C6

0100
01 f7

-

F9

CX,DELAY_3
ox, Hf_PDRT+7
AL,OX
AL, ST_DRQ
WCLOK
W DRIVE PARAMETERS

HARD DISK INTERRUPT ROUTINE

06Dr
06EO
06E3
06E6
06E7

ES:BX

ES: BX -> DR I VE PARAMETERS

06DE

06E5

GET 0 I SK PARAMETER ADDRESS

. --------------------------------

;

a6CC

;

AX,AX
ES,AX
ES:ABSO

-

RETURN FROM INTERRUPT

IRET
ENDP

DB

END_ADDRESS
CODE
ENDS
END

INTERRUPT

, 1/11/84'
LABEL

;

RELEASE MARKER

BYTE

Disk 5-113

5-114

Disk

TITLE 01/04/84 KEYBOARD BIOS
. LIST

0000

PUBLIC
PUBLIC
PUBLIC

KEYBOARD_I o_1
KB INT 1
K16
-

CODE
EXTRN
[XTRf./
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
[XIRN
EXTRN

SEGMENT BYTE PUBL I C
DDS: NEAR
START_l:NEAR
K6: 6YTE
K6L: ASS
K7:BYTE
K8:BYTE
K9:BYT£
Kl0:BYTE
Kll:BYTE
K12:BYTE
K13:BYTE
K14:BYTE
K15: BYTE

I NT 16 ------------------------------------- -------------------KEYBOARD I/O
THESE ROUTINES PROVIDE KEYBOARD SUPPORT
INPUT
(AH )=0
READ THE NEXT ASC I I CHARACTER STRUCK FROM THE KEYBOARD
RETURN THE RESULT IN (AL), SCAN CODE IN (AH)
(AH)=l
SET THE Z FLAG TO INDICATE IF AN ASCII CHARACTER IS AVAILABLE
TO BE READ.
(ZF)==l -- NO CODE AVAILABLE
(ZF)=D -- CODE IS AVAILABLE
IF ZF == 0, THE NEXT CHARACTER IN THE BUFFER TO BE READ IS
IN AX, AND THE ENTRY REMAINS IN THE BUfFER
(AH)=2
RETURN THE CURRENT SHIFT STATUS IN AL REGISTER
THE BIT SETTINGS FOR THIS CODE ARE INDICATED IN THE
TIlE [QUATES FOR KB_FLAG
OUTPUT
AS NOTED ABOVE, ONLY AX AND FLAGS CHANGED
ALL REG I STERS RET A I NEO

0000
0000
0001
0002
0003
0006
0008
COCA
COOC
OOOE
0010
0012
0013
0014

KEYBOARD

F.
IE

53

E8
OA
74
FE
74
FE
74

0000 E
£4

06

ASSUMF

CS: CODE, OS: DATA

!0 1
5TIPUSH
PUSH
CALL
OR
JZ

.X

DEC

CC
45
CC
67

1F
CF

FAR

DOS

AH,AH
K1.
AH

JZ

K2

OEC

AH
K3

JZ
POP
POP
IRET

5.

PRoe
OS

OX

; »> ENTRY PO I NT FOR ORG OE82EH
INTERRUPTS BACI< ON
SAVE CURRENT OS
SAVE BX TEMPORAR I L Y
ESTABLISH POINTER TO DATA REGION
AH"'O
ASC I I READ
AH=1 ASCII STATUS
AH=2 SHI FT STATUS
RECOVER REG I STER

OS

I NVAL I 0 COMMAND

;------ READ THE KEY TO FIGURE OUT WHAT TO DO
0015
0019
0010

86 lE 001A R
3B lE 001C R
75 07

K1B:

MOV
eMP
JNE

BX, BUFfER_HEAD
BX, BUFFER_TAl L
K1C

GET PO I NTER TO HEAD OF BUFFER
TEST END OF BUFFER
IF ANYTHING IN BUFFER DONT DO INTERRUPT

MOV
INT

AX,09002H
15H

MOVE IN WAIT CODE & TYPE
PERFORM OTHER FUNCT I ON
ASC 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
CO GEl MUUl INDICATOR DATA BYTE
GET PREVIOUS BITS
SEE I f ANY D I HERENT
ISOLATE INDICATOR BITS
I F NO CHANGE BYPASS UPDATE

OOlF

B8 9002

0022
0024
0024
0025
0026
0027
0028
002f
0030
0031
0034
0038
003A
0030

CD 15

003f
0042
0043
0044
0045

E8 044C R
FA
90
74 00

CLl
POPF
POP
JZ

0047
0049
004C

86 07
£8 007F R
89 lE OOlA R

MOV
CALL
MOV

0050
0051
0052

5.

POP
POP
IRET

Kl :

F.
90
FA
8B lE 001A R
313 1'E DOle R

STI
NOP
K1C:

9C
E8
8A
32
80
74

CLl
MOV
CMP
PUSH
PUSHF
CALL
MOV

53
al18A R
1 £ 0097 R
08
E3 07
011

AND
JZ

MAKE LED
BL. KB_FLAG_2
BL,AL
BL,07H
K1A

CALL

SND_LEDl

XOR

K1A:

5.

1F
CF

BX, BUFFER_HEAD
BX, BUFFER_TAl L

.X

.X
K1

AX,lBX)

K4
BUFFER_HEAD, BX

BX
OS

GO TURN ON MODE I ND I CATORS
D I SABLE INTERRUPTS
RESTORE FLAGS
RESTORE ADDRESS
LOOP UNl I L SOMETH I NG I N BUFFER
GET SCAN CODE AND ASC I I CODE
MOVE POINTER TO NEXT POSITION
STORE VALUE IN VAR I ABLE

RECOVER REG ISlER
RECOVER SEGMENT
RETURN TO CALLER

; ------ ASC I I STATUS
0053
0053
0054
0058
005C
005E

K2:

FA

CLl

8B l [ 001A R
38 lE 001C R

MOV
eMP
MOV
PUSHF

88 07
9C

005F
0060
0063
0067
0069
006c

50

PUSH
CALL
MOV
XOR
AND
JZ

006E
0071
0072
0073
007 11
0075
0076

£8 044C R

CALL
POP
POpF
STI
POP
PDP

E8 048A R
SA 1£ 0097 R
32 08
80 E3 07
74 03

58
90

SK2:

F.

5.
1F
CA DOD?

RET

BX, BUFFER_HEAD
BX, BUFFER_TAl L

I NTERRUPTS OFF
GET HEAD POINTER
I F EQUAL (Z:=l) THEN NOTHING THERE

AX, [BX}
SAVE FLAGS

AX
MAKE LED
BL, KBJLAG_2
BL,AL
BL,071-1

SK2
SND LEDl

AX-

.X
OS

2

SAVE CODE
GO GET MODE INDICATOR DATA BYTE
GET PREV I OUS BITS
SEE I F ANY 01 FFERE.'H
ISOLATE INDICATOR BITS
! F NO CHANGE BYPASS UpDATE
GO TURN ON MODE INDICATORS
RESTORE CODF
RESTORE FLAGS
I NTERRUPTS BACK ON
RECOVER REG I STER
RECOVER SEGMENT
THROW AWAY FLAGS

SH I FT STATUS
0079
0079
007C
0070
007E
007F

K3:
AO 0017 R

5.
1F

CF

MOV

rop

POP
!RET
KEYBOARD_I o_1

AL, KB_FLAG

ax

OS

GET THE SH I FT STATUS FLAGS
RECOVER REC I STER
RECOVER REG I STERS
RETURN TO CALLER

ENDP

Keyboard 5-115

INCREMENT A BUFFER POINTER
007F
007F
0080
0081
0085
0087
008B
0088
008C

PROC

"4

NEAR
BX
BX
BX,BUfFER END
K5
;
BX,BUFFER_START ;

INC

43
43
38 1[ 0082 R
75 04
8B 1 E 0080 R

, NC
CMP

JNE
MOV

K5:
Kli

KB
FB

ENOP

-

55
50
53
51
52
56
57
1E

0095

06

0096
0097
009A
009C

FC
E8 0000 E
BO AD
E8 0498 R

009F
OOAO
OOA2
OOA2
00A4
OOA6

FA
2B C9

OOM
OOAA

E4 60
FB

IN LI ST

AT END OF !lUFFER?
NO, CONT I NUE
YES, RESET TO BUFfER BEGINNING

RET

C3

KEYBOARD
008C
008C
0080
008E
008F
0090
0091
0092
0093
0094

MOVE TO NEXT WORD

I NT 1 PflOG
- STI
PUSH
PUSH
PUSH
rUSH
PUSH
PUSH
PUSH
PUSH
PUSH

I NTERRUPT ROUT I NE

FAR
;

ex

OX
SI
0I
OS
ES
FORWARD DIRECTION
SET UP ADDRESSING
o I SABLE THE KEYBOARD
EXECUTE 0 I SABLE

CLO

CALL
MOV
CALL

ENABLE INTERRUPTS

BP
AX
BX

DOS
AL,DIS I

IS TH I S AN OVERRUN CHAR
NO, TEST FOR SHI FT KEY
BUF FER_FULL_REEP

; ------ TEST fOR SH I FT KEYS
K16:

; ------- TEST

AL,07FH

TEST SH I FT
TURN-OFF THE BREAK BIT
ESTABLISH ADDRESS OF SHIFT TABLE

FOR SYSTEM KEY
AL, SYS_KEY
K16A

1 SIT THE SYSTEM KEY?
CONT I NUE I F NOT

JNZ

AH,080H
K16C

CHECK IF TH I S A BREAK CODE
DONT TOUCH SYSTEM I NO I CATOR

F6 06 0018 R 04
75 17

TEST
JNZ

KB FLAG 1,SYS SHIFT; SEE IF IN SYSTEM KEY HELD DOWN
K16B
- ; IF YES, DO NT PROCESS SYSTEM INDICATOR

OOF5
aOFA
OOFC

80 DE 0018 R 04
BO 20
U.> <'U

OR
MOV
OUT

KB_FLAG_1, SYS_SH I FT
AL, EO I
020H,AL

OOFE
0100
0103
0106
0107
0109
OlOC

MOV

E8
Bf!
FB
CD
E9
E9

AL, ENA_KBD
SH I PIT
AX,08500H

010F
0114
0116

80 26 0018 R FB
BO 20
£6 20

0118
011A
OlIO
0120
0121

BO AE
E8 0498 R
BS 8501
FB
CD 15

3C 54

eMr

75 3D

JNZ

00£9
OOEC

F6 C4 80
75 21

TEST

OOEE
00F3

OOE~

oon

BO AE

CA1.l

0498 R
8500

MOV

S"
15
OlEC R
01£2 R

5-116

K166:

I NT
JMP
JMP

K16C:

AND

Keyboard

MOV
OUT
MOV

CALL
MOV

sn

INT

151'1
K27A

"26

I F TRUE

I NO I CATE SYSTEM KEY DEPRESSED
; END OF I NTEIlRUPT COMMAND
; SEND COMMAND TO INTERRUPT CONTROL PORT
; I NTERRUPT-RETURN-NO-ED I
; I NSURE KEYBOARD I S ENABLED
; EXECUTE ENABLE
FUNGT I ON VALUE FOR MAKE OF SYSTEM KEY
!"IAKE SURE I NTERRUPTS ENABLED
USER INTERRUPT
END PROCESS I NG
I GNORE SYSTEM KEY

KB FLAG 1,NOT SYS SHI'FT
TURN OFF SHIFT KEY HELD DOWN
AL-;-EO I ; END OF I NTERRUPT COMMAND
020H,AL
; SEND COMMAND TO INTERRUPT CONTROL PORT
; INTERRUPT -RETURN-NO-EO I
; I NSURE KEYBOARD I S ENABLED
AL, ENA_KBD
; EXECUTE ENABLE
SH I PIT
FUNCTION VALUE FOR BREAK OF SYSTEM KEY
AX, 08501 H
MAKE SURE I NTERRUPTS ENABLED
USER I NTERRU PT
15H

0123

i9 OlEC R

0126
012')
012C
012E
0130
0132

BF 0000 E
B<) 0000 E
F2/ AE
8A C4
74 03
E9 D1CE R

K16A:

JMP

K27A

I GNORE SYSTEM KEY

MOV
MOV

OI,OffSET K6
ex, OFf SET K6L
SCASB

SHI FT KEY TABLE
LENGTH
LOOK THROUGH THE TABLE FOR A MATCH
RECOVER SCAN CODE
JUMP I f MATCH FOUND
I F NO MATCH, THEN SH I FT NOT fOUND

RE PNE
MOV
JF
JMP

AL,A~I

K17
K25

;------ SHIFT KlY fOUND
013~

81 EF 0001 E
2E: 8A A5 0000 E
A8 80
74 02
E8 63

K17:

013<)
OBE
OlllO
0142

011HI
0147

80 FG 10
73 07

K17C:

SUB
MOV

rEST
JZ
JMP

OJ ,OFFSET K6+1
AH,CS:K7[O[ J
AL,80H
1(17C
SHORT K23

ADJUST PTR TO SCAN CODE MTCH
GET MASK I NTO All
TEST fOR BREAK 1 ?5
f6 06 0017 R 08
71l 03
EB 67 90
F6 06 0017 R 20
75 00
F6 06 001 r f{ U3
74 00
B8 5230
E9 0375 R

0181

7'1

01H3
0183
0187
0189
018B
Ol8F

K18A:

TEST

KB_FLAG,
K20

K21 :
JZ

0190
019F
01Al
01A4

; NUMER IC ZERO, NOT I NSERT KEY
; PUT OUT AN ASC I I ZERO
; BUFFER_FI LL
; MIGHT BE NUMERIC
LEFT_SHIFT+ RIGHT_SHIFT
;
JUMP NUMER I C, NOT INSERT
; SH I FT TOCGLE KEY HIT; PROCESS J T
IS KEY ALREADY DEPRESSED
; GO If NOl
; JUMP IF KEY ALREADY DEPRESSED
; INDICATE THAT THE KEY IS DEPRESSED
; TOGGLE THE SH I fT STATE

K22:
84 26 0018 R
74 02
EB 57
08 26 0018 R
30 26 0017 R

AH, KB_FLAG_.1
K22AO
SHORT K26
I
01E7
01 E7
01 E9

BO Af
E8 0498 R

01EC
OlED
01 EE
01Ef
0IFO
01FI
01F2
01 f3
01 f4
01f5
01f6

FA
07
1F
5F
5E
5A
59
58
58
50
eF

CLI

FA

BO 20

E6 20

MOV
OUT

AL, EOI
020H, AL

MOV

CALL

AL, ENA_KBD
SHIP_IT

eLi
POP
POP
POP

DI

K27:

K27A:

POP
PDP
POP
POP
POP
PDP

I RET

OS

SI

CAN'T END HOLD ON NUM_LOCK
; TURN OfF THE HOLD STATE BIT

I NTERRlJPT-RETURN
TURN Ofr ! NTERRUPTS
END Of I NTERRUPT COMMAND
SEND COMMAND TO I NTERRU PT CONTROL PORT
INTERRUPT -RETURN-NO- EO I
I NSURI:. KEYBOAKO I S ENABLED
EXECUTE ENABLE
D! SABLE

ES

NO-SHI FT-FOUND
TEST FOR BREAK KEY
NOTH I NG FOR BREAK CHARS FROM HERE ON
ARE W[ I N HOLD STATE
BRANCH AROUND TEST I F NOT

.

INTERRUPTS
REGI STERS

RETURN,

INTERRUPTS BACK ON WITH

~ESTORE

OX

ex
BX
AX
BP

fLAG CHANGE

Keyboard

5-117

01f7
OlF7
Olrc

01 FE

;------ NOT IN

HOLD STATE

K26:

;
KB_FLAG.ALT_SHlfT
K29
;
K36
;

F6 06 0017 R 06
75 03
E9 0290 R

TEST
JNZ
JMP

NO-HOLD-STATE
; ARE WE IN ALTERNATE SHIfT
JUMP IF ALTERNATE SHIFT
JUMP I F NOT ALTERNATE

;------ TEST FOR RESET KEY SEQUENCE (CTL ALT DEL)

0201
0201
0206
0208

3C

02QA

75 20

020C
0212

C7 06 0072 R 1234

K29:
F6 06 0017 R 04
7~

TEST
JZ
CMP
JNE

31

53

; TEST-RESET
KB_FLAG,CTL_SHIFT; ARE WE IN CONTROL SHIFT ALSO
K31
; NO_RESET
AL,DEL_KEY
; SHIFT STATE IS THERE. TEST KEY
K31
; NO_RESET

;------ CTL-ALl-DEL HAS BEEN FOUND, 00 I/O CLEANUP
MOV
JMP

E9 0000 E

0215

0215
021C
021F

0227
022F

0237

52 4F 50 51
40
47 48 49

~B

RESET_FLAG. 1234H ; SET FLAG fOR RESET fUNCTION
START_l
; JUMP TO POWER ON DIAGNOSTICS

;------ ALT-INPUT-TABLE
K30
LABEL
BYTE
DB
82, 79~80,61, 75, 76, 77

4C

DB
71.72,73
; 10 NUMBERS ON KEYPAD
;------ 5UPER-SHI FT-TABLE
DB
16,17,18,19,20,21.22.23 ; A-Z TYPEWRITER CHARS

10 11 12 13 14 15

16
18
22
24

17
19 1£ 1F 20 21
23
25 26 2C 20 2E
2f 30
31 32

DB

24,25,30,31.32,33,34.35

DB

36.37.38.44,45,46.47.48

DB

49,50

;------ IN ALTERNATE SHIFT, RESET NOT FOUND

0239
0239
023B
023D
023F

K31 :

3C 39
75 05
BO 20
E9 0375 R

CMP
JNE
MOV
JMP

AL,57

'32

AL '

1

K57

NO-RESET
TEST FOR SPACE KEY
NOT THERE
SET SPACE CHAR
BUFFER_fI LL

; ------ LOOK FOR KEY PAD ENTRY
0242

0242
0245
0248
024A
024C
0250
0253
0255
0257
0259
025C

K32:
BF 0215 R

MOV
MOV

B9 DaDA
F2/ AE
75 12
81 EF 0216 R
AD 0019 R
B4
F6
03
A2
EB

REPNE
JNE

SUB
MOV
MOV

OA
E4

MUl
ADD

C7
0019 R

MOV
JMP

84

OI,OFFSET K30
eX,10
SCASB

'33

DI,OFFSET K30+1
AL,ALT_INPUT

AH,10

ALT-KEY-PAD
ALT-INPUT-TABLE
LOOK FOR ENTRY USI NG KEYPAD
LOOK FOR MATCH
NO_ALCKEYPAO
01 NOW HAS ENTRY VALUE
GET THE CURRENT BYTE
MULTI PLY BY 10

AH

AX,DI
ALT_INPUT.AL

.26

ADO I N THE LATEST ENTRY
STORE I T AWAY
THROW AWAY THAT KEYSTROKE

; ------ LOOK FOR SUPERSH I FT ENTRY

025E
025E
0263
0266
0268
026A
026C

K33:

C6 06 0019 R 00
B9 OOlA
F2/ AE
75 05
BO 00
E9 0375 R

ALT_INPUT,O

MOV
MDV

CX,26

REPNE

SCASS

JNE
MOV
JMP

AL.O

."
'57

; NO-ALT-KEYPAD
; ZERO ANY PREVIOUS ENTRY INTO INPUT
DI,ES ALREADY POINTING
; LOOK FOR MATCH I N ALPHABET
; NOT FOUND, FUNCT ION KEY OR OTHER
; ASCII CODE OF ZERO
; PUT I TIN THE BUffER

;------ LOOK FOR TOP ROW OF ALTERNATE SHI FT
026F
026F
0271

0273
0275

02((

027A

027C

K3~:

3C 02
72 DC
3C DE
73 DB

CMP

JB
CMP
JAE

60 (;476

ADD

BO 00
E9 0375 R

MOV
JMP

AL,2

'35

AL,14

'35
AH,116
AL,a

'57

ALT-TOP-ROW
KEY WITH ' , ' ON IT
NOT ONE OF I NTERESTI NG KEYS
IS IT IN THE REGION
ALT-FUNCT I ON
CONVERT PSUEOO SCAN CODE TO RANGE
INDICATE AS SUCH
BUfFER_F I LL

; ------ TRANSLATE ALTERNATE SH I fT PSEUDO SCAN CODES
027F
027F

0281
0283
02B3

K35:
CMP
JAE

3C 3B

73 03
K36:
E9 01 E2 R

d28A
0280

.37

JMP

.26

CMP
JAE
MOV
JMP

AL,71

K37:

0286

0286
0288

AL,59

3C 47
73 f9
B8 0000 E
E9 03ec R

<36
BX, OFFSET K13

<63

ALT-FUNCTION
TEST FOR I N TABLE
ALT-CONTINUE
CLOSE-RETURN
I CNORE THE KEY
ALT-CONTI NUE
I N KEYPAD REG I ON
I F SO. IGNORE
AL T SH I FT PSEUDO SCAN TABLE
TRANSLATE THAT

;------ NOT I N ALTERNATE SHI FT
0290
0290
0295

0297
0299
029B

029F
02A3
02A1

K36:

F6 06 0017 R 04
7 1, 62

3C 46

75 1D
88
89
89
C6

1 E 0080 R

1 E OOlA R
1 E 001C R
06 0011 R 80

TEST

KSJlAG, CTL_SH I FT

JZ

'44

NOT-ALT-SHI FT
I N CONTROL SH I FT
NOT-CTL-SHI FT

ARE WE

;------ CONTROL SHIFT, TEST SPECIAL CHARACTERS
; ------ TEST FOR· BREAK AND PAUSE KEYS
CMP
AL, SCROLL_KEY
TEST FOR BREAK
NO-BREAK
JNE
K39
RESET BUFFER TO EMPTY
MOV
BX,BUfFER_START
MOV
BUf'FER_HEAD,BX
MOV
BUFFER_TAl L.BX
TURN ON 8 lOS_BREAK BIT
MOV
BIOS_BREAK,60H
; -------- ENABLE KEYBOARD

02AC
02AE
0261

0283
0285
02B8
0288

02BA
02BC

BO
E8
CO
28
E9

AE
0498 R
1B

co

0375 R

MOV
CALL
INT
SUB
JMP

AL. ENA_KBD
SHIP_IT
lBH
AX,AX
K57

ENABLE KEYBOARD
EXECUTE ENABLE
BREAK I NTERRUPT VECTOR
PUT OUT DUMMY CHARACTER
BUFFER_F ILL

CMP
JNE

AL,NUM_KEY

DR

KB_FLAG_'. HOLO_STATE

NO-BREAK
LOOK FOR PAUSE KEY
NO-PAUSE
TURN ON THE HOLD FLAG

K39:

3C 45
75 26
80 OE 0018 R 08

<41

; -------- ENABLE KEYBOARD
02el
02e3
02C6
02C8

BO
E8
BO
E6

AE
0498 R
20
20

5-118

Keyboard

MOV
CALL
MOV
OUT

AL. ENA_KBD
SHIP_IT
AL, EOI
020H,AL

ENABLE KEYBOARD
EXECUTE ENABLE
END OF I NTEllRUPT TO CONTROL PORT
ALLOW FURTHER KEYSTROKE I NTS

; ------ OUR' NG PAUSE
02CA
02Cf
0201
0204
0207
0208

80
74
BA
AO
EE

3E 0049 R 07
07
0308
0065 R

I N I ERVAL,

TURN CRT BACK ON

eMP
JE
MOV
MOV
OUT

CRT MODE,7
K40DX,03D8H
AL, CRT_MaDE_SET
DX,AL

TEST
JNZ
JMP

KB FLAG 1, HOLD STATE
K40A
K27A

IS TH I S BLACK AND WH ITE CARD
YES, NOTH I NG TO DO
PORT FOR COLOR CARD
GET THE VALUE Of THE CURRENT MODE
SET THE CRT MODE, SO THAT CRT IS ON
PAUSE-LOOP

K40:
ENOl

0208
0208
0200
020F
O?f?

F6 06 0018 R 08
75 f9
E9 01 EC R

02E2
02E4
02£6
02E9

3C
75
88
E9

02[C
02EC
02EF
02F1

BB 0000 E
3C 38
72 7E

02F3
02f6

BB 0000 E
E9 03CC R

F

K40A:
LOOP UNT I l FLAG TURNED OFF
I NTERRU PT RETURN NO EO I
NO- PAUSE --

K41 :
;------ TEST SPECIAL CASE KEY 55
eMP
JNE
MOV
JMP

37
06
7200
0375 R

AL,55
K42
AX,114*256
K57

;
;
;

NOT-KEY-55
START/STOP PRINTING SWITCH
BUFFER_FilL

; ------ SET UP TO TRANSLATE CONTROL SH I FT
K42:
MOV
eMP
J8

BX, OFFSET K8
AL,59
K56

MOV
JMP

BX, OFFSET K9
K63

; ------ NOT

I N CONTROL SH 1FT
NOT-CTL-SHI FT

K44 :

02F9
02F9
02FB
02FD
0302

3C
73
F6
74

0301~

0306
0308
0306

3C OF
75 05
88 OFOO
EB 68

030D
0300
030F

eM?
JAE
TEST
JZ

47
33
06 0017 R 03
62

AL,71
TEST FOR KEYPAD REG I ON
K48
; HANDLE KEYPAD REG I ON
KB. FLAG, LEFT SHIFT+RIGHT SHIFT
K54
- TEST FOR SH I FT STATE

;------ UPPER CASE,

0321
0321
0323
0325
0328

HANDLE SPECIAL CASES

eMP
JNE
MOV
JMP

AL,15
K45
AX, 15*256
SHORT K57

BACK TAB KEY
NOT-BACK-TAB
SET PSEUDO SCAN CODE
BUFFER fiLL

3C 37
75 10

eMP
JNE

AL,55
K46

NOT-BACK-TAB
PR INT SCREEN KEY
NOT-PRI NT-SCREEN

BO
E8
BO
E6
55
CO

MOV
CALL
MOV
OUT
PUSH
INT
POP
JMP

Al, ENA_KBD
SH I P IT
AL, EOI
020H,AL
8P
5H
BP
K27

I NSURE KEYBOARD IS ENABLED
[XECUTE ENABLt:
END OF CURRENT INTERRUPT
SO FURTHER TH I NGS CAN HAPPEN
SAVE PO INTER
ISSUE PR I NT SCREEN INTERRUPT
RESTORE PO INTER
GO BACK WITHOUT EOI OCCURRI NG

C~lP

J8
MOV
JMP

AL,59
K47
BX, OFFSET K12
K63

NOT-PRI NT-SCREEN
FUNCT I ON KEYS
NOT -U PPER- FUNCT I ON
UPPER CASE PSEUDO SCAN CODES
TRANSLATE_SCAN

MOV
JMP

BX, OFFSET K11
SHORT K56

NOT -U PPER- FUNCT I ON
POI NT TO UPPER CASE TABLE
OK, TRANSLATE THE CHAR

-

K45:

ISSUE
0311
0313
0316
0318
031A
0318
0310
031 E

NOT-KEY-S5
SET UP TO TRANSLATE CTl
IS IT IN TABLE
YES, GO TRANSLATE CHAR
eTL- TABLE-TRANSLATE
CTL TABLE SCAN
TRANSLATE_SCAN

AE
0498 R
20
20
05

5D
E9 01E7 R

INTERRUPT TO

INDICATE PRINT SCREEN FUNCTION

K46:
3C
"12
88
E9

38
06
0000 E
03ce R
K47 ;

0328
0328
032E

1313 0000 E

0330
0330
0335
0337
OBe

F6 06 0017 R 20
75 21
F6 06 0017 R 03

E8 41

;------ KEYPAD KEYS,
K48:
TEST
JNZ
TEST
JNZ

75 21

MUST TEST NUM LOCK FOR DETERMINATION

; KEYPAD-REG I ON
KB_FLAG, NUM_STATE
; ARE WE IN NUM_LOCK
K52
; TEST FOR SURE
KB_FLAG,LEFT_SHIFT+RIGHT_SHII-I
; AKl Wl IN SHIFT STATE
K53
; IF SHIFTED, REALLY NUM STATE

; ------ BASE CASE FOR KEYPAD

033E
0340
0342
034L~

031~6

0348
0348

BASE-CASE

K49:

033E
3C
74
3C
"14
2C
SB
£9

SPECIAL CASE FOR A COUPLE Of KEYS
MINUS

4A
oe
4E

CMP
JE
CMP

AL,74
K50
AL,78

00

.JE

<51

/17
0000
03CE

SUB
JMP

AL,71
BX, OFFSET K15
K64

CONVERT OR I GIN
BASE CASE TABLE
CONVERT TO PSEUDO SCAN
MINUS
BUFFER_F I LL

~lOV

03/IE
0351

88 11A20
EB 22

K50:

MOV
JMP

AX, 71~*256+'-'

03')3
0356

138 4E28

K51 :

MOY
JMP

AX, 78*256+' +'
SHORT 1<57

E8 10

SHORT K57

;------ MIGHT BE NUM LOCK,
K52:

03')8
0358
0350

F6 06 0017 R 03
75 OF

035F
035F
0361
0364

2C LI6
88 0000 E
EB OB

U366
0366
0368
036A
036C

3C 38
72 04
BO 00
EB 0"(

036E
036E

BB 0000 E

TEST
JNZ

; AlMOST-NUI-1-STATE
KB FLAG, LEFT SH I FT+R I GHT SH I FT
!(1~9
SHI flED TEMP OUT OF NUM STATE

K53 ;
SUB
MOV
Jl~P

;------

PLUS
BUFFER_F I LL

TEST SHIFT STATUS

AL,70
BX, OFFSET K14
SHORT K56

REALLY NUtl/ STATE
CONVERT aRT GIN
MUM STATE TABLE
TRANSLATE_C:iAR

PLAIN OLD LOWER CASE

eMP
JB
MOV
JMP

AL,59
K55
AL,O
SHORl K57

NOT-SHI FT
TEST FOR FU~:CT I ON KEYS
NOT -LOWER- rUNCT I ON
SCAN CODE I N Ali AI READY
BUFFf.R_FILL

MOV

BX, OfFSET K10

NOT -LOWER- FUNCT I ON
LC TABLE

K54:

K55:
; ------ TRANSLATE THE CHARACTER

Keyboard

5-119

0311
0311
0313

TRANSLATE-CHAR
CONVERT ORIGIN
CONVERT THE SCAN CODE TO ASC II

K56:
DEC

fE C8
2E: D7

XLAT

AL

CS: K11

;------ PUT CHARACTER INTO BUFFER
0315
0375
0377
0319
037C

BUffER-fl LL
IS THIS AN IGNORE CHAR
YES, 00 fiOTHING WITH IT
LOOK fOR -1 PSEUDO SCAN
NEAR_I NTERRUPT_RETURN

K57:
3C
14
80
711

ff
1f
fC fF
lA

CM'

JE

AL.-l

'59

CM'

AH,-l

JE

'59

; ------ HANDLE THE CAPS LOCK PROBLEM
K58:

037E
037E
0383

f6 06 0017 R 40
74 20

0385
038A

f6 06 0017 R 03
74 Of

038C
038E
0390
0392
0394
0396

3C
72
3C
77
04
EB

TEST
JZ

BUffER-f I LL-NOTEST
ARE WE IN CAPS LOCK STATE
SKIP If NOT

KB_fLAG, CAPS_STATE
061

; ------ I N CAPS LOCK STATE
TEST

JZ

KBJLAG.LEFT_SHIFT+RIGHT_SHIFT; TEST fOR SHIFT STATE
K60
; I f NOT SH 1FT, CONVERT LOWER TO UPPER

;------ CONVERT ANY UPPER CASE TO LOWER CASE

0398
0398

41
15
5A
11
20
00

CM'
JB
eM'
JA
ADO
JM'

AL. 'A'
061
AL. 'z'
061
AL. 'a '-'A'
SHORT K61

fiNO OUT I f ALPHABET I C
NOT_CAPS_STATE

~g~V~~~ST~Tt6~ER

JMP

E9 OlE2 R

CASE

NOT_CAPS_STATE
NEAR-I NTERRUPT-RETURN
INTERRUPT_RETURN

K59:

02.

; ------ CONVERT ANY LOWER CASE TO UPPER CASE
0396
039B
0390
039f
03Al
03A3
03A5
03A5
03A9
03AB
03AE
03B2
03B4
03B6
03BA
03B8
03BO
03Bf
03Cl
03C4
03C1
03C9

K60:
AL
K6i
AL

SUB

AL,'a'-'A'

lE ODIC R
f3
007f R
IE 00lA R
22
04
IE 001C R

MOV
MOV
CALL
eM'
JE
MOV
MOV

BX, BUffER_TAl L
SI,BX

20
20
AE
0498 R
9102
15
alEC R

MOV
OUT
MOV
CALL
MOV
INT
JMP

K61 :
8B
88
E8
38
14
89
89
FA
BO
E6
BO
E8
B8
CO
E9

K61

; LOWER-TO-UPPER
; fiND OUT I f ALPHABETIC
; NOT_CAPS_STATE

'a'

eM'
JB
eM'
JA

3C 61
72 06
3C 7A
77 02
2C 20

'z'

NOT_CAPS_STATE
CONVERT TO UPPER CASE
NOT-CAPS-STATE
GET THE END POINTER TO THE BUffER
SAVE THE VALUE
AOVANCE THE TAIL
liAS THE BUffER WRAPPED AROUND
BUffER_fULL_BEEP
STORE THE VALUE
MOVE THE PO I N1ER UP
TURN OFF I inERRUPTS
END Of I NHRRUPI COMMAND
SEND COMMAND TO I NTERRUPT CONTROL PORT
I NSURE KEYBOARD IS ENABLED
EXECUTE ENABLE
MOVE I N POST CODE &: TYPE
PERfORM OTHER fUNCTION
I Nl ERRUPT_RETURN

04
BX, BUffER_HEAD

K.2
[Sll,AX
BUFFER_TAIL.ax

eLi
AL, EOI
020H,AL
AL, ENA_KBD

~~~~9~62H
15H

K27A

; ------ TRANSLATE SCAN fOR PSEUDO SCAN CODES
03CC
03CC
03CE
03CE
0300
0302
0304

TRANSLATE-SCAN
CONVERT OR I GIN TO fUNCT I ON KEYS
TRANSLATE-SCAN-ORGO
CTl TABLE SCAN
PUT VALUE INTO AH
ZERO ASCI I CODE
PUT IT INTO THE BUffER

K63:
2C 3B
K64:
2E:
8A
BO
EB

00
9F

80
E6
BB
E4

20
20
0082
61

D7
EO

SUB

AL,59

XLAT

CS: K9
AH,AL
AL,O

Mav
Mav
JMP

057

0306
0306
0308
030A
0300
030f
03EO
03EO
03E2
03E4
03E6
03E9
03EB
03EO
03Ef
03f2
03f4
03f5
03F?
03f8
03fA

K62~

5D
24
EB
E6
B9
E2
DC
E6
B9
E2
4B

K65:
fC
00
61
OOCE
fE
02
61
00E5
fE

K66:

K67:

75 E9
5.
E6 61
E9 01E7 R
~

MOV
OUT
MOV
IN
PUSH

AL,EOI
INTAOO,AL
BX,82H
AL, KB_CTL

AND
JMP
OUT
MOV
LOOP
OR
OUT
MOV
LOOP
DEC
JNZ
POP
OUT
JMP

AL,OfCH
SHORT 5+2
KB CTL,AL
CX-;-OCEH
K66
AL,2
KB_CTL, AL
CX,OE5H
K67
BX

AX

K65
AX
KB CTL, AL
K27

ENABLE I NTR. CTL. CH I P
NUMBER OF CYCLES fOR 1/8 SECOND TONE
GET CONTROL I NfORHA T I ON
SAVE
BEEP-CYCLE
TURN Off TIMER GATE AND SPEAKER DATA
10 DELAY
OUT PUT TO CONTROL
HALf CYCLE T I ME fOR TONE
SPEAKER Off
TURN ON SPEAKER BIT
OUTPUT TO CONTROL
SET UP COUNT
ANOTHER HALf CYCLE
TOTAL TIME COUNT
00 ANOTHER CYCLE
RECOVER CONTROL
OUTPUT THE CONTROL
EXIT

----------------- ----------- -------------------------------------------- -----THIS ROUTINES HANDLES TRANSMISSION Of COMMAND AND DATA BYTES
TO THE KEYBOARD AND RECEIPT Of ACKNOWLEDGEMENTS.
IT ALSO
HANDLES ANY RETRIES If REQUIRED

;
03FD
03FD
03fE
03ff
0400
0402
0404
0405

--------- -------- ----------- -- ------------------------------------------------

SND_OATA p~~~C

50
53
51
SA f8
B3 03
FA
80 26 0097 R Cf

500:

PUSH
PUSH
MOY
MOY
CLI
AND

NEAR

AX

~AVE

REG I STERS

BX
CX
BH,AL
BL,3

SAVE TRANSMITTED BY FOR RETRIES
LOAD RETRY COUNT
; DISABLE INTERRUPTS
KB_FLAG_2, NOT (KB_fE+KB_fA) ; CLEAR ACK AND RESENO fLAGS

;------- WAIT fOR COMMAND TO ACCEPTED
aliOA
G40C
a40C
040E
0410

2B cg

SUB

CX,CX

E4 64
AS 02
EO fA

IN
TEST
LODPNZ

AL, STATUS_PORT ;
AL, I NPT_BUf_fULL
505

0412
0414
0416
0417

8A C1
E6 60
FB
B9 lAOO

May

AL,BH
PORT_A,AL

5-120

S05:

OUT
STI
MOY

Keyboard

CX,OlAOOH

WA I T fOR COMMAND TO BE ACCEPTED
REESTABLISH BYTE TO TRANSMIT
SEND BYTE
ENABLE INTERRUPTS
LOAD COUNT fOR IOmS+

041A
04H

F6 06 0097 R 30
7":> 00

0421

E2 F7

0423
0425

FE CI3
7S DO

0427
042C

80 OE 0097 R 80
EB 07

042E
0433

F6 06 0097 R 10
74 EE

503:

DIns

59
5B
58
e3

S04:

0436

0437
0 1138

SOl:

TEST
JNZ

SD2:

KB_FLAG_2, KB_FE+KB_FA ; SEE I F EITHER BIT SET
SD3
I F SET, SOMETH I NG RECE I VEO GO PROCESS

LOOP

501

OTHERWISE WAIT

DEC
JNZ

8l

DECREMENT RETRY COUNT
RETRY TRANSM J SS I ON

OR

JMP

KB_FLAG_2, KB_ERR ; TURN ON TRANSM I T ERROR FLAG
SHORT SD4
RETR I ES EXHAUSTED FORGET TRANSM I SS I ON

TEST
JZ

KB_FLAG_2, KB_FA ;
SD2

POP
POP
POP

GX
BX
AX

SOD

SEE

IF TH J SIS AN ACKNOWLEDGE
GO RES(ND

I F NOT.

RESTORE REG I STERS

RET

RETURN.

GOOD TRANSM ISS I ON

SNO_DATA ENDP

0439

TH I S ROUT! NES TURNS ON THE MODE
SND_LED PROG

0439
0439
043A
043F

FA

eLi

F6 06 0097 R 40
75 47

TEST
JNZ

0441
04I.J6
0448
OI.JI.JA

80 OE 0097 R 40
BO 20
E6 20
EB 00

OIII.JC
04 1jC
Q4I.JD
0452
0454
0459
0 1158
045E
01,15F
0 1462
0I.J67
0466
0470

OR
MOV

OUT

JMP

I NO I CA TORS.

NEAR
; TURN OFF INTERRUPTS
KB_FLAG_2,KB_PR_LED; CHECK FOR MODE INDICATOR UPDATE
SL1
; DONT UPDATE AGAIN JF UPDATE UNDERWAY
KB_FLAG_2, KB_PR_LED ; TURN ON UPDATE I N PROCESS
AL, EO!
END OF I NTERRUPT COMMAND
Q20H,AL
; SEND COMMAND TO INTERRUPT CONTROL POKI
SHORT SLD
; GO SEND MODE INDICATOR COMMAND

SND LED1:
FA

-

eLi

TEST
JNZ

F6 06 0097 R 40
75 34
80 DE 0097 R 40
BO ED
E8 03FD R

OR
MOV
CALL

SLO:

FA

ell

E8 048A R
80 26 0097 R F8
08 06 0097 R
F6 06 0097 R 80
75 OB

OR

CALL
AND

TEST
JNZ

;

TURN OFF INTERRUPTS
CHECK FOR MODE INDICATOR UPDATE
OONT UPDATE AGAIN I F UPDATE UNDERWAY

KB FLAG 2,KB PR LED;

SLl

-

-

-;

KB_Fl.AG_2,KB_PR_lED ; TURN ON UPDATE IN PROCESS
AL.lED CMD
l.ED CMD BYTE
SND_DATA
SEND DATA TO KFYBOARD
MAKE_LED

; GO FORM I ND I CATOR OAT A BYTE
KB_FLAG~2, OF8H
; CLEAR MODE I NO I CATOR BITS
KB_FLAG_2,AL
; SAVE PRESENT INDICATORS SlATES FOR NEXT TIME
KB FLAG_2,KB_ERR ; TRANSMIT ERROR DETECTED
SL2
I F YES, BYPASS SECOND BYTE TRANSM I SS I ON

0472

E8 03FD R

CALL

0475
0476
047B

FA

ell

F6 06 0097 R 80
74 06

TEST
JZ

SND_DATA
; SEND DATA TO KEYBOARD
; TURN OFF INTERRUPTS
KB FLAG 2,KB ERR; TRANSMIT ERROR DETECTED
SL3
I F NOT, DONT SEND AN ENABLE COMMAND

0470
047F
0482
0483

MOY
CALL

AL, KB_ENABLE
SND_DATA

80 26 0097 R 3F

SL3:

AND

FB

SL1:

ST!

0488
0I.J89
048A

BO F4
E8 03FD R

SL2:

ell

FA

e3

RET

; GET KEYBOARD CSA ENABLE COMMAND
; SEND DATA TO KEYBOARD
; TURN OFF INTERRUPTS
KB_FI AG_2,NOT(KB_PR_LED+KB_ERR) : TURN OFF MODE INDICATOR
; UPDATE AND TRANSMIT ERROR FLAG
; ENABLE INTERRUPTS
; RETURN TO CAllER

SNO_LED ENDP

THIS ROUTINES fORMS THE DATA BYTE NECESSARY TO TURN ON/OFF
THE MODE INDICATORS

OI.J8A
0118A
0488
Q48E
0490
0492
01194
0I.J96
0497
0498

~~~E-~ED-;~~~---NEAR-----------------------------------------------------------

-

51
AO 0017 R
24 70
131 04
02 CO
24 07
59
C3

PUSH
MOV
AND
MOV
ROL
AND

SAVE CX
AL,KB_FLAG
; GET CAPS & NUM LOCK INDICATORS
AL,CAPS_ST ATE+NUM_STAT[+SGROLL_STATE; I SOLATE I NO I CATORS
CL,4
SH I fT COUNT
AL,CL
; SHIfT BITS OVER TO TURN ON INDICATORS
AL,07H
; MAKE SURE ONLY MODE BITS ON

ex

;

~~~

CX

;

RETURN TO CALLER

MAKE_LEO ENDP
SH!P_IT
THIS ROUTINES HANDLES TRANSMISSION OF COMMAND AND DATA BYTES
TO THE KEYBOARD CONTROLLER.
~~i;-IT-P~~~----NEAR-----------------------------------------------------------

0498
0498

0499
049A
049C
049C
049E
04AQ

50

ell
SUB

FA

28 C9

CX,CX

D I SABLE INTERRUPTS
CLEAR COUNTER

AL,STATUS_PORT
;
AL, I NPT_BUf _fULL
SIO

WAIT FOR COMMAND TO BE ACCEPTED

510:
E4 64
A8 02
EO FA

IN
TEST
LOOPNZ

E6 64

POP
OUT

FB

STI

04A2
04A3
04A5

58

OI.iA6

e3

04A7
04A7

PUSH
AX
; SAVE DATA TO SEN!)
;------- WAIT fOR COMMAND TO ACCEPTED

RET

GET DATA TO SEND
SEND TO KEYBOARD CONTROllER
ENABLE INTERRUPTS AGAIN
RETURN TO CALLER

SHI P IT ENDP
CODEENDS
END

Keyboard 5-121

5-122

Kevboard

TITLE 09/09/83 PRINT BIOS
.LIST
I NCLUDE SEGMENT. SRC
CODE SEGMENT BYTE PUBL I C

0000

EXTRN
DDS: NEAR
PUBLIC
PR'NTER_'O_1
; --- I NT 17 ---------------------- -----------------------------PRINTER 10
THIS ROUTINE PROVIDES COMMUNICATION WITH THE PRINTER
INPUT
{AH)=O
PRINT THE CHARACTER IN (AL)
ON RETURN, AH=1 IF CHARACTER COULD NOT BE PRINTED (TIME" OUT)
OTHER BITS SET AS ON NORMAL STATUS CALL
(AH)=l
INITIALIZE THE PRINTER PORT
RETURNS WITH (AH) SET WITH PRINTER STATUS
(AH)=2
READ THE PRINTER STATUS INTO (AH)
7
6
5
4
3
2-1
0
1
I
I
I
1
I
1_ T I ME OU r
I
I
I
I
I
I_UNUSED
I
I
I
J
I 1 '" I /0 ERROR
I
I
I
I 1 '" SELECTED
I
I
1_ 1 '" OUT Of PAPER
1 "" ACKNOWLEDGE
I
I
I
1 '" NOT BUSY
(OX) = PR'I NTER TO BE USED (0,1,2) CORRESPOND I NG TO ACTUAL VALUES
IN PR I NTER BASE AREA
DATA AREA PRINTER BASE CONTAINS THE BASE ADDRESS Of THE PRINTER CAROISI
AVAILABLE (LOCATED AT BEGINNING Of DATA SEGMENT, 408H ABSOLUTE, 3 WORDS)
DATA AREA PRINT TIM OUT (BYTE) MAY BE CHANGE TO CAUSE 01 FFERENT
TIME OUT WAITS.-DEFAULToo20 * 4
REG I STERS

MI IS MODIFIED
ALL OTHERS UNCHANGED

ASSUME
0000
0000
0001
0002
0003
0004
0005
0006
0009

OOOB
OOOf
0011
0015
0017
0019
001~

0010

DOlf
0021
0023
0025
0025
0026
0021
0028
0029
002A

CS: CODE, OS: DATA
PROC

PRINTER_'O_1

ENTRY POINT FOR ORG OEFD2H
I NTERRUPTS BACK ON
SAVE SEGMENT

FAR

51 I

FB
1E
52
56
51
53
E8 0000 E
8B F2
8A 9C 0078 R
01 [6
88 94 0008 R
08 02
74 OC
OA [4
74 DE
FE CC
14 54
FE CC
14 3C

PUSH
PUSH
PUSH
PUSH
PUSH
CALL
MOV
MOV
SHL
MOV
OR
JZ
OR
JZ
DCC
JZ
DEC
JZ

OS
OX

51

ex
BX
ODS
SI,OX
BL,PRINT_TIM_OUT[SI}
Sl,l
OX, PR I NTER_I:lASE[ ~ I}
OX, OX
B1
AH,AH
82
AH
B8
AH
B5

B1 :
BX
CX

POP
POP
POP
POP
POP
I RET

5B
59
5E
5A

1F
CF

GET PR INTER PARM
LOAD TIMEOUT VALUE
WORD OFFSET I NTD TABLE
GET BASE ADDRESS FOR PR I NTER CARD
TEST OX FOR ZERO, INDICATING NO PRINTE
RETURN
TEST FOR (AH)=O
PRINT AL
TEST FOR (AH)=l
INIT PRT
TEST-FOR (AH)=2
PR I NTER STATUS
RETURN
RECOVER REG! STERS
RECOVER REG I STERS

51
OX
OS

:------ PRINT THE CHARACTER IN (AL)
002B
0026
002e
0020

82:
SAVE VALUE TO PRI NT
OUT PUT CHAR TO PORT
POI NT TO STATUS PORT

AX
DX,AL
OX

PUSH
OUT
INC

50
EE
42

; ------- CHECK FOR PR I NTER BUSY
BX
AL,DX
AL,8DH
B2_A

PUSH

OOZE
002F
0030
0032

EC
A8 80
15 05

0034
0037

B8 90FE
CD 15

0039
0039
003B
0030

2A FF
D1 03
01 03

53

IN
TEST
JNZ

:--------

GET STATUS
I S THE PR I NTER CURRENTLY BUSY
OUT_STROBE

INT 15 DEVICE BUSY
FUNGT I ON 90 PR I NTER 10

AX,90FEH
15M

MOV
INT

:------ADJUST DUTTER LOOP COUNT
BH.BH
BX,1
BX.1

CLEAR BH
MULT BY 4

CX.CX
AL. OX
AH,AL
Al,80H
B4
B3 1
BXB3

INNER lOOP (64K)
GET STATUS
STATUS TO At! ALSO
IS THE PRINTER CURRENTLY BUSY
OUT STROBE
LOOP I F NOT
DROP OUTER LOOP COUNT -----MAKE ANOTHER PASS I F NOT ZERO

SUB
RCL
RCL

;------WAIT BUSY
003F
0041
0042
0044
0046
0048

C9

B3:
83_1;

SUB
IN
MOV
TEST
JNZ
LOOP
DEC
JNZ

004A
0046

2B
EC
8A
A8
75
E2
4B
75

0040

5B

POP

BX

RESTORE BX -------

004E
0051
0054
0056

80 CC 01
80 E4 F9
EB 17

OR
AND
JMP
POP

AH,1
AH,OF9H
SHORT B7
BX

0057
0059
005A
0056
0050
005F
0060

60 00
42
EE
BO OC
EB 00

MOV
INC
OUT
MOV
JMP
OUT
PDP

AL,ODH

SET ERROR FLAG
TURN OFF THE UNUSED BITS
RET URN WITH ERROR fLAG SET
RESTORE BX ------OUT_STROBE
SET THE STROBE HIGH

DX,AL
AL,OCH
SHORT $+2
DX,AL
AX

RECOVER THE OUTPUT CHAR

EO

80
DE
F7
F2

5B

B4:

EE
58

ox

SET THE STROBE LOW
10 DELAY

PR I NTER STATUS
0061
0061
0062
0062

B5:
50

;

SAVE AL REG

PUSH

AX

MOV

UX,PRINTI:.R_BASE[SIJ

B6:
8B 94 0008 R

Printer 5-123

0066
0067
0068
006A
006D
0060
006E
0070
0073

42

INC
IN
MOV

EC

SA EO
80 E4 F8

AND

OX
AL,DX
AH,AL
AH,OF8H

B7:
PDP
MOV
XOR
JMP

5A

8A C2
80 F4 48
fB BO

OX
AL,OL
AH.48H

.,

GET PRINTER STATUS
TURN OFF UNUSED BITS
STATUS_SET
RECOVER AL REG
GET CHARACTER INTO AL
FLIP A COUPLE OF BITS
RETURN FROM ROUTI NE

;------ INITIALIZE THE PRINTER PORT
0075
0075
0076
0077
0078
007A
007B
007E
007E
007F
0081
0083
0084
0066
0086

BB:
PUSH
INC
INC
MOV
OUT
MOV

50
42
42
BO 08
EE

B8 OFAO

AX

OX
OX
AL,8
DX.Al
AX,1000*4

B9:
48
75 FO
BO OC

DEC
JNZ
MOV
OUT
JMP
PR INTER_I 0_'
CODE

EE

EB DC

AX

89
AL,OCH
DX,AL

86
ENDP
ENOS
END

5-124

Printer

SAVE AL
PO I NT TO OUTPUT PORT
SET

INIT LINE LOW

I NIT_LOOP
LOOP FOR RESET TO TAKE
INIT LOOP
NO I NTERRU PTS, NON AUTO LF,
PRT_STATUS_ 1

IN IT HIGH

TITLE DATE 07/06/83 RS232
_ LIST
INCLUDE Si::GMENT. SRC
CODE SEGMENT BYTE PUBlI C

0000

[XTRN
EXTRN
PUBLIC

DDS;NEAR
A1; NEAR
RS232_IO_'

; ----- I NT 14--- ----------------------------- -----------;RS232 10
- THIS ROUTINE PROVIDES BYTE STREAM I/O TO THE COMMUNICATIONS
PORT ACCOHOING TO THE PARAMeTERS;
(AH)=O
INITIALIZE THE COMMUNICATIONS PORT
(AL) HAS PARMS rOR INITIALIZATION

7

6

4

5

----- BAUD RATE --

(Ati)""

r

(Atl)o:=2

(AH)=3

(OX) "

3

- PAR I TY--

2

1

STOPB I T

0

--WORD LENGTH--

000-110
XO-NONE
0-110-7BITS
001-1?O
01-000
1-21'-86ITS
0'0 - 300
"
- EVEN
01' - 600
100 - 12()O
101 - 2400
110 - 4800
111 - 9600
ON RETURN, CONDITIONS SEl AS IN CALL TO COMMa STATUS (AH=3)
SEND THE CHARACTER IN (AL) OVER THE COMt~O LINE
(AL) REGI~ITR IS PRESERVED
ON EXIT, BIT 7 OF AH IS SET IF THE ROUTINE WAS UNABLE TO
10 TRANSMIT THE BYTE OF DATA OVER THE LINE.
I
BIT 7
AH IS NOT SET, THE
REMAINDER OF AH IS SET AS IN A STATUS REQUEST,
RErELtCTING THE CURRENT STATUS OF fHF liNE.
R[CEIVE A CHARACTER IN (AL) FROM COMMa LINE BEFORE
RETURN I NG TO CAI,LER
ON EXIT, AH HAS THE CURRENT LINE STATUS, AS SET BY THE
THE STATUS ROUTINt::, EXCEPT THAT THE ONLY BITS
LEFT ON ARE THE ERROR BITS (7,4,3,2,1)
IF AH HAS BIT 7 ON (TIME OUT) THE REMAINlNG
BITS ARE NOT PRED I CT ABLE.
THUS, AH I S NON ZERO ONLY WHEN AN ERROR OCCURRED.
RETURN THE COMMD PORT STATUS IN (AX)
AH CONTAINS THE LINE CONTROL STATUS
f:S IT 7 == T I ME OUT
BIT 6 '" TRANS SHtFT REGISTER EMPTY
BIT 5 '" TRAN HOLDING REGISTER EMPTY
BIT 4 "" BREAK DETECT
BIT 3 := FRAMING ERROR
BtT 2 == PARITY ERROR
6 I T 1 = OVERRUN ERROR
61 T D '" DATA READY
AL GONTAINS THE MODEM STATUS
6 I T 7 = RECEVED LI NE SIGNAL DETECT
BIT 6 == RING INDICATOR
61 T 5 == DATA SET READY
BIT 4 = CLEAR TO SEND
BIT 3 = DELTA RECEIVE LINE SIGNAL DETECT
BIT 2 = TRA III NG EDGE RING DETECTOR
61 T 1 = DELTA DATA SET READY
BIT 0 - DELTA CLEAR TO SEND
PARAMETER

or

INDICATING WHICH RS232 CARD (0,1

ALLOWED)

DATA AREA RS232 BASE CONTAINS THE BASE ADDRESS OF THE 8250 ON THE CARD
l_DCATION 40011 CONTAINS UP TO 4 RS232 ADDRESSES POSSIBLE
DATA Af-lEA LABLE RS232 TIM OUT (BYTE) CONTAINS OUTER LOOP COUNT
;OUTPUT VALUE FOR TIMEOUT (Dr"FAULT=l)
AX MOD 1Ft ED ACCORD I NG TO

;

PARMS OF CALL

AI 1 OTHERS UNCHANGED
----- ---ASSUME
-- --- - - - --- - - - - - -- --- ----- --- ------- ------CS:CODE,DS;UATA
PROC

0000

FAR

;------ VECTOR 10 API'IWf'RIATE ROUTINE
0000
0001
0002
0003
0004
0005
0006
0007
0009
OOOB
0000
0010
0014
0016
0018
D01A
001C

DOlE
0020
0022
00211
0021,
0026
0028
0023
002B
002e
0020
002E
D02F
0030
0031

STI
PUSH
PUSH
PU5H
PUSH
PUSH
PUSH
MOY
MOY
SHL
CALL
MOY

FB

lE
52

56
57
51
53
8B
88
01
E8
88
DB
74
OA

F2
FA
E6
0000 E
94 0000 R
02
13
E4
74 16
FE CC
74 48
FE CC
74 70

DR

JZ
OR

I NTERRUPTS BACK ON
SAVE SEGMENT

OS

OX
SI
01

ex
BX

RS232 VALUE TO 51
AND TO DI (FOR TIMEOUTS)
WORD OFFSET

51,DX
OI,DX
SI,l
DOS

OX,RS232_BASE[ S I
DX,DX
A3
AH,AH

JZ
DEC
JZ
DEC
JZ

Al,

DEC
JNZ
JMP

AH

J

GET BASE ADDRESS
TES'1 FOR 0 BASE ADDRESS
RETURN
rESf fOr< (AH)=O
COMMUN INIT
TEST FOR (AH )"'1
SEND AL
TEST FOR (AH )=2
RfCFIVE INTO Al

AH

A5

Afl
A12

A2;
FE CC
75 03
E9 00B6 R

TEST FOR (AH)=3

A3
A18

COMMUNICATION STATUS
RETURN FROM RS232

A3;
POP
POP
POP
POP
POP
POP
IRET

5B
59
5F

5E
5A
1F
CF

8X

cx
01
SI

ox
Os
;

RETURN TO CALLER,

NO ACT I ON

INITIALIZE THE COMMUNICATIONS PORT
0032
0032
0034
0037
0039

8A EO
83 C2 03
80 80
EE

r~ov

ADD

MDY

OUT

AH,AL
DX,3
AL,80H
OX,AL

SAVE IN IT PARMS IN AH
PO I NT TO 8250 CONTROL REG I STER
SET DlAB=1

;------ DETERMINE BAUD RATE UIVl50R
003A
003C
003E
0040

8A
81
02
81

04

r~ov

0"

MOY

C2
1:2 DOOt:

RDL
AND

DL,AH
CL,4
DL,CL
OX,O[II

GET PARMS TO OL
I SOLATE THEM

RS232

5-125

0044
0047
0049
0040
004E
0052
0053

0054
0056
0059

EE

OOSA

83 C2 03
8A C4
24 IF
FE

0050
005F
0061
0062
0063
0064
0066

0068
0009

MOY

BF 0000 E
03 FA
8B 94 0000 R
42
2E: 8A 45 01
EE
4A
EB 00
2E: 8A 05

ADO

MOV

INC
MOV
OUT
DEC
JMP

MOY
OUT
AOO

MOV
AND

OIJT

DI,OFFSET A1
DI,DX
g~, RS232_BASEf S I

DEC
DEC
JMP

OX
OX
SHORT $+2

MOV

EE

OUT
JMP

AL,D
aX,AL

0076
0079
0076

42
E8 DOCS R
74 06

59
8A Cl

0091
0092

PUSH

AX

AOD

10 DELAY
I NTERRUPT ENABLES ALL OFF
(;UM~STATUS

IN (AL) OVER COMMO LINE
SAVE CHAR TO SEND
MODEM CONTROL REG I srER
OTR AND RTS
DATA TERMINAL READY, REQUEST TO SEND
MODEM STATUS REGISTER

our

DX,4
AL,3
OX,AL

I NC
INC
MOV
CALL

BH,30H
WA I T_fOR_STATUS

ARE BOTH TRUE

JE

A9

YES,

POP
MOV

CX
AL, CL

RELOAD DATA BYTE

OR
JMP

AH, BOH
A3

MOV

B7 30

007C
007E
007E
0081

008F

GET PARMS BACK
STRIP OFF THE BAUD BITS
I I NE CONTROL TO 8 BITS

AS:
50
83 C2 04
BO 03
EE
42

007B

0083
0083
0084
0084
0086
0089
0088
0086
008E

a

10 DELAY
GET LOW ORDER OF DIVISOR
SET LOW Of DIVISOR

::>HOHJ A18

;------ SEND CHARACTER
006B
0066
006C
006f
0071
0072
0073
0074

SET MS OF DIY TO

OX
SHORT $+2
AL,CS:[DI]
DX,AL
OX,3
AL,Ati
AL,OlfH
DX,AL

'IA
EB 00
1:.13 46

GET HIGH ORDER OF DIVISOR

AL,CS:[DI]+1
DX,AL

60 00

4A

BASE OF TABLE
PUT J NTO J NOEX REG I STER
POINT TO HIGH ORDER OF DIVISOR

I

ox

OX
DATA SET REA[)Y & CLEAR TO SEND
READY TO TRANSMIT CHAR

A7:
A8:

80 CC 80
EB A8

INDICATE TIME OUT
RETURN
CLEAR TO SENO
LINE STATUS REGISTER
WAI T SEND
IS TRANSM I TTER READY
TEST FOR TRANSMITTER REAOU
RETURN WITH TIME OUT SET
OUT CHAR
DATA PORT
RECOVER IN CX TEMPORARILY
MOVE CHAR TO AL FOR OUT, STATUS
OUT PUT CHARACTER
RETURN

A9:
DEC

4A

OX

A10:
MOV
CALL

67 20
E8 DOCS R
75 FO

JNZ

BH,20H
WAIT_FOR_STATUS
A7

All:
SUB

83 EA 05
59
8A C1
EE
EB 97

OX,5

POP

cx

MOV

AL. CL
DX,AL
A3

OUT

JMP

IN AH

RECE I VE CHARACTER FROM COMMO II NE
0094
0094
0097

0099
009A
0096
D09C

A12:
A[)O
MOV
OUT
I/IIC

83 C2 04
BO 01
EE
42
42

67 20

D09E
OOAl
DOA3
OOA3
00A4
00A4
OOA6
00A9
OOAB
(JOAB

E8 OOC5 R
75 DB

00B2
0063

MODEM STATUS REGISTER

I NC

ox

MOV

BH,2QH

CALL
JNZ

WAIT FOR STATUS
AB
-

WAIT OSR
DATA-SET READY
TEST FOR DSR
RETURN WI TH ERROR
WAI T aSR END
LlNCSlA1US REGISTER
WAI T RECV
RECEIVE BUFFER FULL
TEST FOR REG, BUFF, FULL
SET T I ME OUT ERROR
GET CHAR
TEST FOR ERROR CONDITIONS ON RECV CHAR
DATA PORT
CET CHARACTER FROM LI NE
RETURN

A13:

00ge

OOAE

MODEM CONTROL REG I STER
DATA TERMINAL READY

DX,4
AL,1
OX, AL
OX

A15:

4A

DEC

ox

MOV
CALL
JNZ

BH,l
WAI T fOR_STATUS
A8

AND
MOV

AH,OOOl1l10B
RS232_BASE[ S I
AL, OX
A3

A16;

87 01
E8 DOCS R
75 03
Al7:
80 Ell 1 E
86 94 0000 R
EC
E9 002B R

f/ll

JMP

ox,

J

COMMO PORT STATUS ROUT I /liE
00B6
00B6

OOBA
OOBO

A18:
MOV
ADD
IN
MOV
I NC
1N
JMP

8B 94 0000 R
83 C2 05
EC

OOBE

8A EO

OOCO
OOCl

42

OOC2

E9 002B R

EC
,

;

- --- - - -- - - ------------ -- - - -- -------------

; ENTRY:
;
;EXIT;
;
OOC5
DOCS

ox,

RS232_BASE[ 51]
OX,5
AL,OX
AH,AL
OX
AL, OX
A3

-

~~!~T~?~S S~~H~) R?gT~~~K

-

FOR,

OX=ADDR. OF STATUS REG
ZERO FLAG ON =: STATUS FOUND
ZERO FLAG OFF = TIMEOUT.
AH=LAST STATUS READ

- --

~; ~ ~ ~~~ -;~; ~us ;~~c8A 90 D07C R

CONTROL PORT
GET LINE CONTROL STATUS
PUT IN AH FOR RETURN
PO I NT TO MODEM STATUS REG I STER
GET MODEM CONTROL STATUS
RETURN

MOV

-~ ~~~-

--------------

BL,RS232_TIM_OUT[DI]

;LOAD OUTER LOOP COUNT

; ------ADJUST DUTTER LOOP COUNT
OOC9
GOCA
OOCB
OOCC
0000
0002
OOD4
0006
0007
00D9
OODB
DODD
OOOF
OOEl
00E2
00E4
00E6
00E6

Don

55
53
50
81 E5 DOff
D1 D5
01 05
WFSO:
wrSl;

2B C9
EC
8A
22
3A
n
E2

EO
C7
C7
07
F5

BP

PUSH
PUSH

BX

POP
AND

BP,OOfFH

RCL
RCL

BP,1

SUB
IN
MaY
AND
CMP

JE
lOOP

BP

BP,l

ex,cx
AL, OX
AH,AL
AL,BH
AL,6H
WFS END
\-IFSl

40

DEC

BP

75 fO
OA Ff

JNZ
OR

WFSO
BH, BH

PO?

BP

SAVE BP -----SAVE BX -----USE BP fOR DUTTER LOOP COUNT
STRIP HIGH BITS
MULl DUTTER BY 4

;GET STATUS
; MOVE TO AH
; ISOLATE BITS TO TEST
; EXACTLY = TO MASK
iRETURN WITH ZERO FLAG ON
;TRY AGAIN
; SET ZERO FLAG OfF

WfS END:
-

50

RET

C3

00E8
00E8

WAIT fOR STATUS ENOP
RS232_IO:=1
ENDP

00E8

CODE

5-126

RS232

ENDS

RESTORE BP -----

TITLE 08/18/83 VIDEOl
. LIST

includes are

postequ,src,

dseg.src

I NeLUN

0000

~

0010

SEGMENT. SRC
GODE SEGMENT BYTE PUBLIC
EXTRN
EXTRN
LXIHN
EXTRN
EXTRN
EXTRN

DDS: NEAR
1'15: WORD
M6:BYTE
1'17: BYTE
CRT CHAR erN: NEAR
BEEP: NEAR

PUBLIC
M4

VIDEO 10 1
EQU
601 OH

I NT 1 0 ---------------------------------------------------------VIDEO 10
THESE ROUTINES PROVIDE TH!:. CRT INTERFACE
fHE FOLLOWING FUNCTIONS ARE PROVIDED;
(AH)"'O
SET MOUE (AL) CONTAINS MODE VALUE
(AL)"'O 40X2~ BW (POWER ON DEFAULT)
(AL)",l 40X25 COLOR
(AL)",2
80X25 6W
(AL)",3
80X25 COLOR
GRAPH I CS MODES
(AL)",4
3?OX200 COLOR
(AL).::5
320X?'OO BW
{AL)"'6
64QX200 8W
CRT MODE'" 7 8QX25 B&W CARD (USED JNT[RNAL TO VIDEO ONLY)
-it-it-it NOTES -BW MODES OPERATE SAME AS COLOR MODES,
BUT COLOR
BURST IS NOl ENABU·O
-CURSOR IS NOT DISPLAYED IN GRAPHICS MODE
(AH) '" 1
SET CURSOR TYPE
(GIi) '"
I:IITS 4-0 ;0 START LINE FOR CURSOR
-it* HARDWARE WILL ALWAYS CAUSE BL I NK
*-11- SETTING BIT 5 OR 6 WILL CAUSE ERRATIC BLINKING
OR NO CURSOR AT ALL
(CL) =
BITS 4-0 '" END LINE FOR CURSOR
(AII)=2
SeT CURSOR POSITION
(DH,DL) = ROW,COLUMN
(0,0) IS UPPER LEFT
( BH) '" PAGE NUMBER (MUST BE 0 fOR GRAPH I CS MODES)
(AH)=3
READ CURSOR POSITION
( BIi) ;= PAGE NUMBER (MUST B[ 0 FOR GRAPH I CS MODES)
ON EX I T (DH, DL) ;= ROW, COLUMN OF CURRENT CURSOR
(GH,CL) ;= CURSOR MODE CURRENTLY SET
(AH)"'4
READ LIGHT PEN POSITION
ON EXIT:
(AH) = 0 - - LIGHT PEN SW I TCH NOT DOWN/NOT TR I GGERED
(AH) = 1 -- VALID LIGHT PEN VALUE IN REGISTERS
(DH,DL) "" ROW,COLUMN or CHARACTER LP POSN
(CH) = RASTER LINE (0-199)
(BX) '" PiXEL COLUMN (0-319,639)
(AH)=5
SEl.ECT ACTIVE DISPLAY PAGE (VALID ONLY FOR ALPHA MODES)
(AL)=NEW PAGE VALUE (0-7 FOR MODES 0&1, 0-3 FOR MODES 2&3)
(AH)"'6
SCROLL ACTIVE PAGE UP
(AL) = NUMBER OF II NES, I NPU' LINES BLM':KED AT BOTTOM OF WINDOW
AL = 0 MEANS BLANK ENT I RE WINDOW
(GH,CL) ;= ROW,COLUMN OF UPPER LEFT CORNER OF SCROLL
(OH,DL) = ROW,COLUMN OF LOWER RIGHT CORNER OF SCROLL
(BH) '" ATTR I BUTE TO BE USED ON BLANK LI NE
(AH)"'7
SCROLL ACTIVE PAGE DOWN
(AL) '" NUMBER OF LINES, INPUT LINE.S BLANKED AT lOP OF WINDOW
AL'" 0 MEANS BLANK ENTIRE WINDOW
(CH,Cl) = ROW,COLUMN OF UPPER LEFT CORNER OF SCROLL
(OH,DL) = ROW,COLUMN OF LOWER RIGHT CORNER OF SCROLL
(BH) '" ATTRIBUTE TO 1)[ USED ON BLANK LINE
CHARACTER HANDLI NG ROUT I NES
8 READ AlTR I BUTE/CHARACTER AI" CURRENT CURSOR POS I T I ON
(BH) ;0 DISPLAY PAGF (VALID FOR ALPHA MODES ONLY)
ON EXIT;
(Al) = CHAR READ
(AH) = ATTRIBUTE Of CHARACTER READ (ALPHA MODES ONLY)
(AH) = 9 WRITE ATlRIBUTE/CHARACTER AT CURRENT CURSOR POSITION
(BH) '" 0 I SPLAY PAGE (VAll 0 FOR ALPHA MODES ONLY)
(CX) ;= COUNT OF CIiAHACTERS· TO WRITE
(AL) ;:0 CHAR TO WRITE
(BL) '" ATTRIBUTE OF CHARACT[R (ALPHA)/COLOR OF CHAR (GRAPHICS)
SEE NOTE ON WRITE [)OT fOR I3IT 7 Of BL = 1.
(AH) == 10 WRITE CHARACTER ONLY AT CURRENT CURSOR POSITION
(BH) = DISPl.AY PAGE (VALID FOR ALPHA MODES ONLY)
(CX) ;0 COUNT OF CHARACTERS TO wRITE
(AL) ;0 CHAR TO WRITE
FOR READ/WRITE CHARACTER INTERfACE WHILE IN GRAPHICS MODE, rtlE
CHARACTERS ARC FORMED FROM A CHARAC1ER GENERATOR IMAGE
MAINTAINED IN THE SYSTEM ROM.
ONLY HIE 1ST 128 CHARS
ARE CONTAIN[D THERE.
TO READ/WRITE TilE SECOND 128 CHAr~S,
THE USER MUST iNITIALIZE THE POINTER AT INTERRUPT 1FH
(LOCATION 0007CH) TO POINT TO TIlE lK BYTE TABLE CONTAINING
THE CODE POINTS FOR THE SECOND 128 CHARS (128-255).
FOR WRITE CHARACTER INTERFACE IN GRAPHICS MODE, HiE REPLICATION fACTOR
CONTAIN!:'D IN (ex) ON ENTRY WilL PRODUCE VALID RESULTS ONLY
FOR CHARACTERS CONTAINED ON THE SAME RO'...'.
CONTINUATION TO
SUCCEED I NG LINES WILL NOT PRODUCE CORRECTLY.
(AH)

;0

GRAPHICS INTERFACE
(AH) == 11 SeT COl.OR PALETTE
(BH) = PALLETTE COLOR 10 BEING SET (0-127)
(8L) "" COLOR VALUE TO BE USED WITH THAT COLOR 10
NOT E: FOR THE CURRENT COLOR CARD, TH j S ENTRY PO I NT HAS
MEAN I NG ONLY FOR 320X200 GRAPH I CS.
COLOR 10 == 0 SELECTS THE BACKGROUND COLOR (0-15)
COLOR 10 '" 1 SELECTS THE PALl.ETTE I 0 ~[ USED:
0= GREEN(1)/RED(2)/YELlOW(3)
1;= CYAN(1)/MAGENTA(2)/WIfITE(3)
IN 40X25 OR BOX25 ALPHA MODES, TI1E VALUE SET FOR
PALLETTE COLOR 0 I toWlCATES THE BORDER COLOR
TO BE USED (VALU[S 0-31, WHERE 16-31 SELECT THE
HIGH I tHENS I TY BACKGROU;m SET.
(AH)
12 WRITE DOT
( OX) '" ROW NUMBER
(CX) '" COLUMN NUMBER
(AL) =- COLOR VALUE
IF BI T 7 or AL == 1, THEN THE COLOR VALUE j S EXCLUS IVE
ORID WITH THE CURHENT CONTENTS OF THE DOT
(AH) = 13 READ DOT
(OX) = ROW NUMBFR
(CX) ;= COLUMN NUMBER
(AL) RETURNS THE DOT READ

Video

5-127

ASCII

TELETYPE ROUTINE FOR OUTPUT
(AH) '" 14 WHITE TELE1YPE TO ACTIVE PAGE
(AL) =; CHAR TO WRITE
(BL) := FOREGROUND COLOR IN GRAPHICS MODE
NOTE -- SCREEN WIDTH IS CONTROLLED BY PREVIOUS MODE SET
(AH)

15 CURRENT VIDEO STATE
RETURNS THE CURRENT VIDEO STATE
(AL) '" MODE CURRENTLY SET ( SEE AH=D FOR EXPLANATION)
(Ali) = NUMBER OF CHARACTER COLUMNS ON SCREEN
(BH) = CURRENT ACT I VE 0 I SPLAY PAGE

(AH) = 16 RESERVED
(AH) = 17 RESERVED
(AH) = 18 RESERVED
(AH)

=;

19 WRITE STRING
ES:BP
CX
OX
BH
(AL)

-

POINTER TO STRING TO BE WRITTEN
LENGTH OF CHARAC[f( STR I NG TO WR I TTEN
CURSOR POS I T I ON fOR STR I NG TO BE WR I TTEN
PAGE NUMBER

= 0
ATTRIBUTE
BL
STR I NG IS
iCHAR,CHAR,
CURSOR NOT MOVED

(AL)

-

ATTRIBUTE
BL
lCHAR,CHAR,
STR I NG IS
CURSOR I S MOVED
(AL)

,CHARI

! CHAR, ATTR, CHAR, ATTR
STR ING IS
CURSOR I S NOT MOVED

(AL)
STR I NG
CURSOR
NOTE:

,CHAR!

1

CHAR, A TTR, CHAR, ATTR
IS
I S MOVED

,CHAR,ATTRl
,CHAR,ATTRl

CARRIAGE RETURN, LJNE FEED, BACKSPACE, AND BELL ARE
TREATED AS COMMANDS RATHER THAN PRINTABLE CHARACTERS.

SS,SP,ES,DS,DX.CX,BX.SI,DI,BP PRESERVED DURING CALL
ALL OTHERS DESTROYED.
ASSUME

0000
0000
0071
0002
0140
00011
0174
0006
019£
0008
07DF
OOOA
01B5
OOOC
0222
000£
02C6
0010
0318
0012
035£
0014
0391
0016
0109
0018
046F
001A
045£
OOlC
0756
001 E OUF
0020
0144
0022
01411
0024
0144
0026
03C3
'" 0028

PUBL I C
PUBL I C
PUBLJ C
PUBLIC
PUBL I C
PUBLIC
PUBlI C
PUBL I C
PUBLIC
PUBL I C
PUBLIC
PUBL I C
PUBL I G
PUBL I C
PUBLIC
PUBLIC
Ml

R
R
R
R
R
R
R
R
R

R
R

R
R
R
R
R

FB
FC
06
1£
52
51
53
56
57
55

0032

50

0033

8A C4
32 £4

0044

E8
88
88
81

0055

0057

XOR
SAL
MOY
eMP

NEAR

ES
OS

ENTRY PO I NT FOR ORG OF065H
I NTERRUPT5 BACK ON
SET 0 I RECT I ON FORWARD
SAVE SEGMENT REG I S II:.RS

OX

ex

BX

SI
01

BP
AX

AL,AH
AH,AH

AX,1
51 ,AX
AX,M1L

JB
POP

M2

JMP

VIDEO_RETURN

AX

SAVE AX VALUE
CET I NTO LOW BYTE
ZERO TO HIGH BYTE
*2 FOR TABLE LOOKUP
PUT INTO S I FOR BRANCH
TEST FOR WITH I N RANGE
BRANCH AROUND BRANCH
THROW AWAY THE PARAMETER
; DO NOTH I NG I f NOT

I N RANGE

M2:

83
75

CALL
MOY
MOY

0000 E
B800
3E 0010 R
E7 DOlO
FF 30
02

AND
eMP

JNE

64 BO

0059

8E CO

0056

58

Dose

80
75
55
8B
BE

005F
0061
0062
0064

PUSH
PUSH
PUSH
PliSH
PUSH
PUSH
PUSH
PliSH
PUSH
MOY

01 EO
8B FO
lD 0028
72 04
58
E9 0144 R

0052

PROC

;
TABLE OF ROUTINES WITHIN VIDEO I/O
SET MODE
Sn-CTYPE
SET-CPOS
READ CURSOR
REAO-LPEN
ACT DISP PAGE
SCROLL UP
SCROLL:::::DOWN
READ AC CURRENT
WRITE AC CURRENT
WR I TE::::C_CURRENT
SET COLOR
WRITE DOT
READ DOT
WRITE TTY
V IDEO-STATE
V I OED-RETURN
Reserved
V IDEO-RETURN
Reserved
V I OED-RETURN
Reserved
WR I TE:::::STR I NG
CASE 19h, Write string

eLD

0039
0038
003E
0040
0041
0044
0047
OD4A
004£

Ml L

VIO£O_'O_l
ST I

0028
0028
0029
002A
0026
002C
0020
002E
002F
0030
0031

0035
0037

R
R
R
R

CS: CODE, OS: OAT A, ES: V IDEO_RAM

SET MODE
SET-CTYPE
SET-CPOS
READ CURSOR
REAO-LPEN
ACT_DISP_PAGE
SCROLL UP
SCROLL=OOWN
READ AC CURRENT
WR I TE AC CURRENT
WRITCC CURRENT
SET_COLOR
WR I TE_DOT
READ DOT
WRITE TTY
VIDEO-STATE
LABEL
WORD
OW
OFFSET
OW
OrrSET
OW
OFFSET
OW
OFFSET
OW
OFFSET
OW
OFFSET
OW
OFFSET
OW
OFFSET
OW
OffSET
OW
OFFSET
OW
OFFSET
OW
OFFSET
uw
OffSET
OW
OfFSET
OW
OFFSET
OW
OFFSET
OW
OffSET
OW
OfFSET
OW
OFFSET
OW
OFFSET
EQU
$-Ml

M3:

MOY
MOV
POP

ODS

AX,OB800H
DI,EQUI PJLAG
DI,30H
DI,30H
M3
AH,OBOH
E5,AX
AX

SEGMENT
GET EQU
ISOLATE
IS SElT

FOR COLOR CARD
I PMENT SETT I NG
CRT SWITCHES
I NG FOR BW CARD?

SEGMENT FOR 8W CARD
SET UP TO POINT AT VIDEO RAM AREAS
RECOVER VALUE

FC 13
07

AH,13H
MM'

TEST fOR WR I TE STR! NG OP

JNE
PUSH
MOY
MOY

BP

EC
46 10

BP,S?
ES,[BPI·ES_POS

If IT'S WRITE STRING THEN GET THE
STR I NGS SEGMENT, SINCE I T GET CLOBBERED

5-128 Video

eMP

0067
0068
0068

D06e

50

POP

BP

MOV

AH,CRT_MOOE
; GET CURRENT MODE
WORD PTR CS:[SI+OffSET Ml]
ENOP

MM3:
8A 26 0049 R
2£: FF A4 0000 R

J~lP

VIDEO_IO_l

0071

INTO AH

SET_MO~~IS
;
;
;
;

;
0071
0071
0074
0076
0079
0078
0070
0080
0082
0084
0087
008B
OOBC

0080
008E
0091
0093
0094
0095
0097

ROUTINE INIT1ALlLES THE ATTACHMENT TO
I NPUT THE SELECTED MODE.
THE SCREEN I S BLANKED.
(AL) = MODE SELECTED (RANGE 0-9)

OUTPUT
NONE

- ---- --------------------- - -- -------- - MOV
MOV
CMP

PROC
NEAR
f)X,03D4H
BL,O
DI,30H

JNE

M8

MOV
MOV

AL,7
OX,03B4H
BL
AIi,AL
CRT MODE,AL
ADDIC6B45, OX
OS

SET_MODE
SA 0304
33 00
83 FF 30
75 07
BO 07
SA 03B4
FE C3
8A EO
A2 0049 R
89 16 0063 R
1E

INC

M8:

MOV
MOV
MOV

PUSH
PUSH
PUSH

50
52

OX,4
AL, BL
DX,AL

EE
5A

POP

OX

SUB

AX,AX
DS,AX
DS:ABSO
PARM_PTR

28 CO
8E 08

MOV

C5 1E 0074 R

ASSUME
LOS

0099
0090

58

009E
OOAl
OOA4
OOA6
00A8
OOAB
OOAD
OOAF
00B2
0084

B9
80
72
03
80
72
03
80
72
03

FC 02
10

D9
Fe 04
09
09
FC 07
02

09

ax,

POP

AX

ASSUME

OS:CODE
CX,M4
AH,2
M9
BX,CX
AH,11
M9
BX,CX
AH,7
M9
BX.CX

MOV
CMP
JC
ADO
CMP
JC
AOO
CMP
JC
AOO

DOlO

ADDRESS OF COLOR CARD
MODE SET fOR COLOR CARD
IS BW CARD INSTALLED
OK WITH COLOR
INDICATE BW CARD MODE
ADDRESS OF BW CARD
; MODE SET fOR BW CARD
SAVE MODE IN AH
SAVE I N GLOBAL VARIABLE
SAVE ADDRESS OF BASE
SAVE POINTER TO DATA SEGMENT
SAVE MODE
SAVE OUTPUT PORT VALUE
PO I NT TO CONTROL REG I STER
GET MODE SET FOR CARD
RESET VIDEO
BACK TO BASE REG I STER
SET UP FOR ABSO SEGMENT
ESTABLI SH VECTOR TABLE ADDRESS I NG

AX
OX

AOO
MOV
OUT

83 C2 04
8A e3

----

GET POINTER TO VIDEO PARI1S
RECOVER PARMS
LENGTH OF EACH ROW OF TABLE
DETERMINE WHICH ONE TO USE
MODE ISO OR 1
MOVE TO NEXT ROW OF

I NIT TABLE

MODE IS 2 OR 3
MOVE TO GRAPHICS ROW OF INIT_TABLE
MODE IS 4,5, OR 6
MOVE TO BW CARD ROW OF

INIT_TABLE

;----- BX POINTS TO CORRECT ROW OF INITIALIZATION TABLE
00B6
00B6

OUT IN IT
SAVE MODE [N AH

M9:
50

PUSH

AX

00B7
00B8
OOBA
OOBe
DOBF

06

PUSH

ODCl

26:

DOC')

07

POP

ES
SAVE SCREEN BUFFER'S SEGMENT
AX, AX
ESTABL I SH ADDRESS I BILl TY TO ABSO
ES,AX
AX,WORD PTR [BX+10]
GET THE CURSOR MODE FROM THE TABLE
AH,AL
PUT CURSOR MODE IN CORRECT POST ION
ES:ABSO
ES:WORD PTR DATA_AREA[CURSOR_MODE-DATA],AX
ES:V1DEO_RAM
; RESTORE THE SCREEN BUFFER'S SEGMENT
ES

Ooc6

32 E4

XOR

AH,AH

33
8E
88
86

XOR
MOV
MOV

CO
CO
47 OA
EO

XCHG
ASSUME

A3 0460 R

MOV

ASSUME

;

AH WI LL SERVE AS REGISTER NUMBER DURING LOOP

LOOP THROUGH TABLE, OUTPUTTTING REG ADDRESS,

ooca
oocs

8A C4

OOCA
OOCB
OOCC
aOCE

FE Cl~
BA 07

~ODO

0001
0002
0003

EE
42

0005
0006

IF

33
89
C6
B9

80

INC
INC

AH

INC
OEC

f3

;-~----

0007
0009
DODD
00E2
00E5
OOEa
OOEA
00 ED
OOEF
OOFl
OOF3
00F3
OOF5
OOF5
OOF8
OOf8

AL,AH
DX,AL

MOV
OUT

EE
43
4A
[2
58

MOV
OUT

fF
3£ 004E R
06 0062 R 00
2000
fe 04
DB
FC 07
04
CO

72
80
74
33
EB 05

POINT TO DATA PORT
NEXT REG I STER VALUE
GET TABLE VALUE
OUT TO CHI P
NEXT IN TABLE
BACK TO PO I NTER REG I STER
DO THE WHOLE TABLE
GET MODE BACK
RECOVER SEGMENT VALUE

OX

AL, [BX]
DX,AL
BX
OX

"'0

LOOP
POP

AX

POP

DS

ASSUME

OS; DATA

FILL REGEN AREA WITH BLANK
XOR
MOV
MOV
MOV
CMP
JC
CMP

01,01
CRT_START,OI
ACT IVE _PAGE,O
CX,8192
AH,4

JE

M11

SET UP PO I NTER FOR REGEN
START ADDRESS SAVED IN CLOBAL
SET PAGE VALUE
NUMBER OF WORDS I N COLOR CARD
TEST FOR GRAPH I CS
NO_GRAPHICS_INIT
TEST fOR BW CARD
BW_CARD_I NIT
F ILL FOR GRAPH I CS MODE
CLEAR_BUFfER
BW CARD INIT
BUFfER SIZE ON BW CARD (2048)
NO GRAI'H1CS INIT
FilL CHAR FOR ALPHA
CLEAR_BUFfER
FILL THE REGEN BUFFER WI TH BLANKS

M12

AH,7

XOR
JMP

AX,AX
SHORT Ml3

MOV

CH, 08H

MOV

AX,

REP

STOSW

Mll:

B5 06
M12:
88 0720
M13:

f3/

AB

THEN VALUE fROM TABLE

INIT LOOP
GET 6845 REGISTER NUMBER

M10:

'+7*256

;----- ENABLE VIDEO AND CORRECT PORT S[TTING
OOfA
DOFf
0101
0105

AD 0049 R
32 E4
88 Fa
8B 16 0063 R
83 C2 04

0108

ooro

MOV
XOR
MOV
MOV
AOO

AL,CRT MODE
AH,AH 51 ,AX
DX,ADDR_6845
OX,4

; GET THE MODE
;
I NTO AX REG I STER
; TABLE POINTER, I NDEXEQ BY MODE
PRE PARE TO OUTPUT TO V I OED ENABLE PORT

2E: SA 84 0000 E

MOV

AL, CS: I S I + OfFSET BYTE PTR M7J

0100

EE

OlOE

A2 0065 R

OUT
MOV

DX,AL
CRT_MOOE_SET ,AL

;
;

SET V IDEO ENABLE PORT
SAVE THAT VALUE

;----- DETERMINE NUMBER OF COLUMNS, BOTH FOR ENTIRE DISPLAY
;----- AND THE NUMBER TO BE USED FOR TTY INTERFACE
0111
0116
0118

2E: 8A 84 0000 E
32 E4
A3 OD4A R

011B

81

MOV
XOR
MOV

AL,es: [SI + OFFSET BYTE PTR M6j
AH,AH
CRT_eoLS, AX
NUMBER OF COLUI-INS IN TH I S SCREEN

;----- SET CURSOR POSITIONS
E6 OOOE

ANa

SI,OEH

WORD OFFSET I NTO CLEAR LENGTH TABLE

Video

5-129

2E: 88 8C 0000 E

MDV

CX,CS:ISI

0124
0128
0128
a12E
012F
0130
0132

89 OE 004C R
89 0008
Bf 0050 R
IE

MDV
MDV

CRT_LEN, CX
CX,8
01, OFFSET CURSOR POSN

SAVE LENGTH OF CRT -- NOT USED FOR BW
CLEAR ALL CURSOR POS tTl ONS

OS

ESTABL I SH SEGMENT
ADDRESS I NG

tolOV
PUSH

XDR
REP

33 CO
f3/ A8

-

ES
AX,AX
STOSW

POP

07

+ OFFSET M5]

LENGTH TO CLEAR

011F

FI LL WITH ZEROES

SET UP OVERSCAN REG I STER

0134
0135
0137
013C
013E
0140
0141

,,2

INe

OX

SO 30
80 3E 0049 R 06
75 02
80 3F

MDV

JNl

AL,30H
CRT_MODE,6
M14
AL,3FH
DX,Al
CRT_PALLETTE.AL

eMP
MDV

M14:

EE

DU7
MDV

A2 0066 R

SET OVERSCAN PORT TO A DEFAULT
VALUE OF 30H FOR ALL MODES EXCEPT 640X200
SEE 41 F THE MODE IS 6'-1.0X200 8W
I FIT I SNT 640X200, THEN GOTO REGULAR
IF IT IS 640X200, THEN PUT iN 3FH
OUTPUT THF CORRFCT VAl ttF TO 309 PORT
SAVE THE VALUE FOR FUTURE USE

; ----- NORMAL RETURN FROM ALL V IDEO RETURNS

0141,
0144
0145
0146
0141
0148
0148
0149
014A
0146
014C
0140

VIDEO RETURN:
POP
PDP
POP
POP

50
5F

"

5.

01
SI
BX

ex
ox

POP
POP
POP
POP

59
5A
IF

07
eF

OS

RECOVER SEGMENTS
ALL DONE

ES

IRET

--SET
--- - -- - - -- --- - ---------------------- --- -- -------CTVPE

SFT_MOOF

;

014D
0140
014F
0153
0156

13P

ENOP

;

I NP~T TH I S ROUT I NE SETS THE CURSOR VALUE

;
;
;

OUTPUT

(CX)

HAS CURSOR VALUE eH-START LINE,

CL-STOP LINE

NONE

§ET-CT~;E-------P~OC----NEA~-------------------------

-

B4 OA
89 OE 0060 R
E8 0158 R
EB EC

MOV
MOV
CALL
JMP

MI,10

; 6845 REGISTER FOR CURSOR SET

CURSOR_MODE, CX
M16
VIDEO_RETURN

;
;

SAVE t N DATA AREA
OUTPUT CX REG

;------ THIS ROUTINE OUTPUTS THE CX REGISTER TO THE 6845 REGS NAMED IN AH

0158
0158
015C
015E
015F
0160
0162
0164
0165
0166
0168
016A
016C
016D
016E
0170
0172
0173

M16:

42
EB 00
8A C5

INC

DX

JMP

SHORT $+2
AL.CH
OX,Al

MDV
OUT

EE
E8 00
8A Ct.
FE CO
EE

SHORT $+2
AL,AH
AL
OX,Al

MDV

INC
OUT

00

SHORT $+2
Al,Cl
DX,Al

MOV
OUT

E[

10 DELAY
POINT TO OTHER DATA REGISTER
SET FOR SECOND REG I STER

OX

INC
JMP

42
8A Cl

ADDRESS REGI STER
GET VALUE
REG I STER SET
DATA REG I STER
10 DELAY
DATA

OX

DEC
JMP

4A

[B

ox. ADOR_6845
AL,AH
DX,Al

MDV
MDV
OUT

8B 16 0063 R
8A c4
EE

10 DELAY
SECOND DATA VALUE

RET

C3

ALL DONE
ENDP

SET.CIYPE

0174

;

------------ --- --------- --------------- ---SET CPOS
-

1 HIS ROUT I NE SETS THE CURRENT CURSOR POS I T ION TO THE
NEW x-v VALUES PASSED

INPUT

ox BH -

ROW, COLUMN OF NEW CURSOR
0 I SPLAY PAGE OF CURSOR

OUTPUT
CURSOR

0171,
0174
017(,
01"/8

017A
017C

0180
0181,
0186

0188
0188
0188
0180

SET

-

8A CF
32 ED
01 E1
88 F1

CPOS

CALL

M1B

SAL
MOV
MDV

eMP

JNl

PROC
CAll
MOV
ADD
SAR
r-10V
CALL

M18

E8
88
03
01
84
E8

IS CURRENT DISPLAY

ESTABLISH LOOP COUNT
WORD OffSET
USE INDEX REGI STER
POSH 1, ox
; SAVE THE PO INTER
SET.CPOS.RETURN
GET ROW/COLUMN TO AX
CURSOR SET
SET.CPOS_RETURN

V IDEO_RETURN
ENOP

EB 87

;------ SET CURSOR POSITION,

0180
0180
0190
0192
0196
0198
019A
0190
019E

IF DISPLAY PAGE

MOV

XDR

89 94 0050 R
38 3E 0062 R
75 05
81::1 G2
E8 0180 R

IS SET AT 6845

PRoe
NEAR
CL,BlI
CH,CH
;
CX,l
;
S I,CX
;
[ S' +OFFSET CURSOR
ACT I VE_PACE, BH
•
Ml7
AX, OX

lolOV

0211 R
C8
DE 004E R
F9

OE
0158 R

NEAR
POSITION
CX, AX
CX, CRT START
CX,l-

AH,14
M16

AX HAS ROW/COLUMN FOR CURSOR
DETERMINE LOCATION

IN REGEN BUFFER

ADD I N THE START ADDRESS FOR TH I SPACE
o I V I DE BY 2 FOR CHAR ONLY COUNT
REG I STER NUMBER FOR CURSOR
OUTPUT THE VALUE TO THE 6845

RE'r

C3
M18

; --

ENDP

---------------------- --- -- -- ---- - -- - - ------------

READ_CURSOR
TH I S ROUT I NE READS THE CURRENT CURSOR VALUE fROM THE
6845, FORMATS IT, AND SENDS I T BACK TO THE CALLER
INPUT
BH - PAGE OF CURSOR
OUTPUT
OX - ROW, COLUMN OF THE CURRENT CURSOR POSITION
CX - CURRENT CURSOR MODE

kEAD-~~~;~R-----;~OC----NEAR----------------

Q19E

019E
01 AD
01A2
01A4
alAS

OlAC

8A OF
FF

32
01
88
88
50

OlAo

5F

OlAE
OlAF
0180

5E
58
58

E3
97 0050 R
DE 0060 R

l:i.l10

-

MOV
XOR
SAL
MOV
MOV
POP
POP
POP
POP
POP

BL, BH
BH, BH
BX,l
; WORO OFFSET
OX, [BX+OFFSET CURSOR_POSN 1
ex, CURSOR MODE
SP
•
DI
SI
BX
; 01 SCARO SAVED CX AND OX

01Bl
01B2
01B3
01B4
0185

58
1F
07

POP

AX
DS
ES

por

POP
IRET
READ_CURSOR

CF

ENOP

;

ACT 0 I SP PAGE
THIS ROUT I NE SETS THE ACT IVE 01 SPLAY PAGE, ALLOWI NG
INPUT THE FULL USE OF THE RAM SET ASIDE FOR THE VIDEO ATTACHMENT

;
;

OUTPUT

AL HAS THE NEW ACT I VE 0 I SPLAY PAGE
THE 6845

0185
0185
01S8
01BC

A2 0062 R
8S DE 004C R
98

01Bo
01B£

50

OlCO

A3 004E
8B C8
01 F9

01e3
01CS
01C7
01G9
01GC
01GD

01GF
0103
01D6

ACT DISP PAGE
MOV
MOV
PUSH

AX

ex

DC
0158 R

MOV
MOV
SAR
MOV
CALL

eX,AX
eX,l
AH,12

£3
87 0050 R
0180 R

SAL
MOV
CALL

R

POP

E9 0144 R

JMP

ACT_DI SP_PAGE

0109

PAGE

SAVE ACT IVE PAGE VALUE
GET SAVED LENGTH OF REGEN BUFFER
CONVERT AL TO WORD
SAVE PAGE VALUE
DISPLAY PAGE TIMES REGEN LENGTH
SAVE. START ADDRESS fOR LATER REQU I REMENTS
START ADDRESS TO CX
DIVIDE BY 2 FOR 6845 HANDLING
6845 REGISTER FOR START ADDRESS

eBW

MDL

F7 [1

B4
E8
58
01
88
E8

IS RESET TO DISPLAY THAl
PROC
NEAR
ACTIVE PAGE,AL
CX, CRT=LEN

CRT _START, AX

M16
BX
RECOVER PAGE VALUE
BX,l
; *2 fOR WORD OFFSET
AX, [8X "'" OFFSET CURSOR_POSN]
; GET CURSOR
M18
; SET THE CURSOR POSITION
V IDEO RETURN
ENoP -

FOR TH I S PAGE

SET COLOR
THIS ROUTINE WILL ESTABLISH THE BACKGROUND COLOR, THE OVERS"AN COlOR,
AND THE FOREGROUND COLOR SET fOR MED I UM RESOLUT ION GRAPH I CS
INPUT
(BH) HAS COLOR 10
IF BH=:O, THE BACKGROUND COLOR VALUE I S SET
mOM THE LOW BITS OF BL (0-31)
IF BH=1. THE PALLETTE SELECT I ON I S MADE
BASED ON THE LOW BIT Of BL:
0= GREEN, RED, YELLOW FOR COLORS 1,2,3
1 = BLUE, CYAN, MAGENTA FOR COLORS 1,2,3
(BL) HAS THE COLOR VALUE TO BE USED
OUl PUT
THE COLOR SELECT ION I S UPDATED

0109
0109
0100
01 EO
01 E3
01E5

8B 16 0063 R

SET COLOR
MOV

83 C2 05

OR

PROC
NEAR
OX, ADoR_6845
oX,5
;
AL, CRT_PALLETTE ;
BH,BH
;

JNZ

H20

ADO
MOV

AD 0066 R
OA FF
75 OE

; ------ HANDLE COLOR

01ef
01 E9
01 EC
OlEE
01 EE
01 EF

01f2

24 EO
80 E3 1F
OA C3

AND
AND

OR

;

0

EE

OUT

MOV

AL,OEOH
BL,Ol FH
AL,8L

OX, AI_
;
CRT PALLETTE,AL ;
V IDEO_RETURN

JMP

a?

BY SETT I NG THE BACKGROUND COLOR

M19;
A2 0066 R
E9 0144 R

I/O PORT FOR PALETTE
OVERSCAN PORT
GET THE CURRENT PALLETTE VALUE
IS THIS COLOR
OUT PUT COLOR 1

TURN OFF LOW 5 BITS OF CURRENT
TURN OFF HIGH 3 BITS Of INPUT VALUE
PUT VALUE INTO REGISTEH
OUTPUT THE PALLETTE
OUTPUT COLOR SELECT: ON TO 309 PORT
SAVE THE COLOR VALUE

; ------ HANDLE COLOR 1 BY SELECT I NG THE PALLETTE TO BE USED

01f5

M20:

24 OF

01F5
01F7

DO

m

AND
SHR

73 F3

JNe

01 rI3

DC .20

OHD

OR

EB EF

on9

OlFF

JMP

SET_COLOR

:
;
;
;

OlFF
011"F

0203
0206
020A
020B
020C
020D
020E
0211

8A 26 004A. R
AO 0049 R
8A 3E 0062 R
50
5F
5E
59
E9 01118 R

PROC
NEAR
AH, BYTE PTR CRT_COLS
AL,CRT_MODE
BH, ACT IVE_PAGE

MOV
POP
POP

POP

SI

ex

POP

DISCARD SAVED BX
RETURN TO CALLER

roll 5

JMP

ENDP

POSITION
THIS SERVICE ROU1INl CALCULATES THE REGEN BUFFER ADDRESS
INPUT OF A CHARACTER IN THE ALPHA MODE

;

AX

= ROW,

COLUMN POSITION

OUTPUT
AX'" OFFSET OF CHAR POSITION

0211
0211
0212

021!,
0216
021A
021C

021E
0220
0221
0222

POSITION
53
8B
8A
F6
32
03

GET NUMBER OF COLUMNS
CURRENT MODE
GET CURRENT ACT I VE PAGE
RECOVER REG I STERS

BP
01

VI OED_STATE

;

"'9
ENDP

TURN OFF PALLETTE SELECT BIT
TEST THE LOW ORDER BIT OF BL
ALREADY DONE
TURN ON PAtLETTF SFLFCT BIT
GO DO IT

VIDEO STATE
RETURNS THE CURRENT VIDEO STATE IN AX
AH = NUMBER Of COLUMNS ON THE SCREEN
AL =: CURRENT V I OED MODE
BH = CURRENT ACT IVE PAGE

\IIDEO STATE
MOV
MOV

;

AL,ODFH
BL,1

"'9
AL,2011

PUSH
MOV
MOV

08
C4
26 004A R

MDL

FF

XOR

C3

ADD

01 EO

SAL
POP
RET

5B
C3
POS I T I ON

IN REGEN BUFFER

PROC
NEAR
BX
; SAVE REG I STER
BX,AX
AL, AH
; ROWS TO AL
BYTE PTR CRT~COLS
; DETERM I NE BYTES TO ROW
BH,BH
AX, ex
; ADD I N COLUMN VALUE
AX,l
;
2 FOR ATTRIBUTE BYTES
BX

*"

ENDP

SCROLL UP
THIS ROUTINE MOVES A BLOCK OF CHARACTERS UP
ON THE SCREEN
INPUT
(NI) '" CURRENT CRT MODE
(AL) '" NUMBER OF ROWS TO SCROLL
(ex) '" ROW/COLUMN OF UPPER LEFT CORNER
(OX) == ROW/COLUMN Of LOWER RIGHT CORNER
(BH) = ATTRIBUTE TO BE USED ON BLANkED LINE
(OS) = DATA SEGMENT
(ES) = REGEN BUFFER SEGMENT
OUTPUT
NONE -- THE REGEN BUFfER IS MODifIED
ASSUME

CS: CODE, OS: DATA, ES: DATA

Video

5-131

0222
0222

E8 0303 R

0225
0228
022A
0220
022F
0232
0232
0233
0235
0238
023A
023e
023£
0240
0240
02113
0245
0247
0249
02Af

ENOP
-- CLEAR A SI NGLE ROW

OSA7
0'>A7
05A9
05AA
05AC
05AD
05B1
05B2
0584
05B6
05B7
05B8

R18

PROC

Mav
REP

NEAR
CL,DL
01
STOSB
01
DI,2000H
01
CL, DL
STOSB

POP

DI

MOV

8A GA
57
F3/ AA
SF
81 C7 2000
57
8A CA
F3/ AA
SF"
C3

PUSH

REP
PDP
ADO

PUSH

RET
R18

NUMBER OF BYTES IN FIELD
SAVE POI NTER
STORE: THE: NEW VALUE
PO I NTER BACK
; POINT TO OOD FIELD
FILL THE ODD FJLELD
RETURN TO CALLER

[NOP

GRAPHICS WRITE
THIS ROUTINE WRITES THE ASCII CHARACTER TO THE CURRENT
POSIT!ON ON THE SCREEN.
ENTRY -Al ::= CHARACTER TO WR I TE
BL "" COLOR ATTR I BUTE TO BE USED FOR FOREGROUND COLon
IF BIT 7 IS SET, THE CHAR IS XOR'D INTO THE REGEN BUFFER
(0 I S USED FOR THE BACKCROUND COLOR)
ex = NUMBER OF CHARS TO WR I TE
OS = DATA SEGMENT
ES ::= REGEN SEGMENT
EXIT -NOTH I NG I S RETURNED
GRAPHICS READ
HilS ROUTINE READS THE ASCII CHARACTER AT THE GUgRENT CURSOR
POS I T I ON ON THE SCREEN BY MATCH I NG THE DOTS ON THE SCREEN TO THE
CHARACTER GENERATOR CODE PO I NTS
ENTRY -NONE
(0 IS ASSUMED AS THE BACKGROUND COLOR)
EXI T -AL = CHARACTER READ AT THAT POSITION (0 RETURNED IF NONE FOUND)
FOR BOTH ROUTINES, THE IMAGES USED ')0 FORM CHARS ARE CONTAINED IN ROM
fOR THE 1ST 128 CHARS.
TO ACCESS CHARS IN THE SECOND HALF, THE USER
MUST INITIALIZE THE VECTOR AT INTERRUPT 1FH (LOCATION 0007CH) TO
POINT TO fHE USER SUPPLIED TABLE OF GRAPHIC IMAGES (8X8 BOXES).
FAILURE TO DO SO WILL CAUSE IN STRANGE RESULTS
ASSUME
GRAPHICS WRITE
MOV
PUSH

05B8
05138
05BA

84 00
50

05B8
058E

E8 0745 R
88 F8

OSCQ
05C1
05C3

58

CS:COOE,OS:DATA,ES:DATA
PROC
NEAR
AII,O
; ZERO TO HIGH or COOI: POINT
AX
; SAVE CODE PO 1 NT VALUE

;------ DETERMINE POSITION

IN REGEN BUFFER TO PUT CODE
;
;

CALL
MOV

POINTS

FIND LOCATION IN REGEN BUFFER
REGEN POINTER IN 01

;------ DETERMINE REGION TO GET CODE POINTS FROM

JAE

!MAGE
05C5
OSCs
OSC9

IS

MOV
PUSH
JMP

BE 0000 E
DE

EB OF"

;
;
;

AX
AL, BUH
51

POP

CMf'

3C 80
73 06

IMAGE IS

IN fiRST HALF,
SI,O~~5~_1

GKI

CS
SHORT 52

osce

2C 80

05CD
OSCE
0500

1E

2B F6
8E DE

MOV

0502
0506

CS 36 OU7C R
8C OA

MOV

0508
O:>U:,I

,<

SUB
PUSH
5UB

IN SECOND HAl.F,

PDP

AL, BaH
D5
SI,SI
DS,SI
DS:ABSO
S I ,EXT PTR
OX, OS DS:DATA
D5

PUSH

OX

ASSUME
LOS
ASSUME

1F

;------ DETERMINE GRAPHICS MODE

05EA
05EA
05£B

OSEe

5AL
5AL
SAL

EO

EO
EO

1f
"!2 2C

IN USER HAM
EXTFND CHAR
ZERO ORIGIN FOR SECOND HALf
SAVE DATA PO INTER
ESTABLI SH VECTOR ADDRESS I NG
GET THE OffSET OF THE TABLE
CET THE SEGMENT OF THE TABLE
RECOVER OATA S[GMENT
SAVE TABLE SEGMENT ON STACK
IN OPERATION

'6
136 04
AC

F6 C3 80
75 16

AX.1
AX,l
AX,l
51 ,AX
CRT_MODE,6
05

S7

;------ HIGH RESOLUTION MODE
53:
PUSH
DI
51
PUSH
MDV
DH,4
S4:
LOOSB
TEST
BL,80H
56
JNZ
STOSB
LODSB

57

05[£

AA
AC

$5:
26: 88 85 1 FFF
83 C7 4F
FE CE
75 EC

0602
0603

5E
5F

060 1•
0605
0607

117
£2 E3
E9 0144 R

Q6QA
060A

?6:

0616
0616
0618

ADD
CMP
POP
JC

03 FO
80 3E 0049 R 06

05EF
05F2
05Flf
05F5
05F6
05F6
05FB
05F£
0600

a60E
a60F
0614

; OFFSET OF IMAGES
; SAVE SEGMENT ON STACK
; DETERM I NE_MODE

;
;

DE TERM I NE MODE
MULTI Pl.Y CODE PO I NT
VAl.UE BY 8

;

51

52:
D1
01
D1

05EE

0600

CONTAINED IN ROM

CHAK tilN
~
-

Sl :

05CS

05DA
05DA
05DC
050E
05EO
05E2
05E7
05E.8

RECOVER CODE PO I NT
I::; 1"1" IN SECOND HALF
YES

ES: [UI+2000H-1 ],AL

MOV
ADO

01, '19

DEC

DH

JNZ
pOP
POP
INC

54
DI

LOOP

53

JMP

V IDEO_RETURN

XOR
STOSB
LODSB
XOR
JMP

AL,ES:[DI]

51
01

HAS OFFSET OF DESIRED CODES

RECOVER TABLE PO I NTER SEGMENT
TEST FOR MED I UM RESOLUT I ON MODE
HIGH CHAR
SAVCREGEN PO INTER
SAV1=- CODE PO INTER
NUM8ER OF TIMES THROUGH LOOP
GET BYTE FROM CODE POIHTS
SHOULD WE lJSE THE FUNCT I ON
TO PUT CHAR IN
STORE I N REGEN BUFFER

; STORE IN SECOND HALF
MOVE fO NEXT ROW I N REGEN
DONE WITH LOOP
RECOVER REGEN POI NTER
POINT TO NEXT CHAR POSITION
MORE CIIARS TO WRITE

S6:
32 05

AA
AC

26: 32
EB EO

85 1FTF

; ------ MED I UM RESOLU f I ON WR 1TE
S7:
MOV
DL, BL
SAL
01,1

8A 03
01

£7

5-138

EXCLUSIVE OR WITH CURRENT
STORr THf GOOF PO I NT
; AGA I N FOR ODD FIELD
AL,ES:[DI+2000H-l)
;
S5
BACK TO MA I NSTREAM

Video

MEO RES WRIIE
SAVE HIGH COLOR BIT
OFFSET*2 SINCE 2 BYTES/CHAR

Of;lA
0610
0610
061E
061F
0621
0621
0622
0625
0627
062A
062C
062F
0633
0633
0636
063A
063[3
063E
06110
0643
0645
064A
064F
064F
065'.
0659

065C

065E
0660
0661
0662
0663
0664
0666
0669

E8 06Fl

R

136 04

519

PUSH
PUSH
MOV

01
51
DH,4

EXPAND BL TO FULL WORD OF COLOR
MED CHAR
SAVE REGEN PO INTER
; SAVE THE CODE POI NTER
NUMBER OF LOOPS

521
AX,BX
Ol, BOH
510
AH,ES:(DI J
AL,E5:[DI+1J

GET CODE PO I NT
DOUBLE UP ALL THE BITS
CONVERT THEM TO FOREGROUND COLOR ( 0 BACK )
IS THIS XOR FUNCTION
NO, STORE IT IN AS IT IS
DO fUNCT I ON WITH HALf
AND WITH OTHER HALF

59:
LODSB
CALL
AND
TEST
JZ

AC
E8 0706 R
23 C3
F6 C2 80
74 07
26: 32 25
26: 32 45 01

XOR
XOR

S10:

26: 88 25
26:

MOV
MDV
LODSB
CALL
AND
TEST
JZ

88 45 01

AC
E8 0706 R
23 C3
F6 C2 80
74 OA
26: 32 AS 2000
26: 32 85 2001

XOR
XOR

ES: [01 J,AH
ES:{DI+l1,AL
521
AX,BX
DL, BOH
;
511
;
AH,ES:[DI+200DHj
AL,ES:[DI+2001Hj

STORE fiRST BYTE
STORE SLCUND I::loYTf.
GET CODE PO I NT
CONVERT TO COLOR
AGAIN, IS THIS XOR FUNCTION
NO, JUST STORE THE VALUES
; fUNCT I ON WITH fiRST HALF
; AND WITH SECOND HALF

S11 :
26; 88 AS 2000
26: 88 85 2001
83 C7 50
FE CE
75 Cl

50
5F

47
47

E2 B7
E9 0144 R

MDV
MOV
ADD
DEC
JNZ
POP
POP
INC
INC
LOOP
JMP
GRAPH I CS_WR I TE

;
0669
0669
066c
066E
0671

CALL
58:

57
56

E8
8S
83
88

0745 R
FO
[C 08
EC

ES:IDI+2000H],AH'
ES:[DI+2000H+lI.AL
; STORE IN SECOND PORTION OF BUFFER
01,80
POINT TO NEXT LOCATION
DH
KEEP
GOI
NG
59
51
RECOVER CODE PONTER
RECOVER REGEN POINTER
DI
POINT TO NEXT CHAR POSITION
DI
DI
MORE TO WR I TE
58
V IDEO RETURN
ENOP -

GRAPH I CS READ

GRAPH I CS_REAO
CALL
MOV
SUB
MOV

PROC
526
51 ,AX
SP, B
SP, SP

NEAR
CONVERTED TO OFFSET IN REGEN
SAVE IN SI
ALLOCATE SPACE TO SAVE THE READ CODE PO I NT
PO I NTER TO SAVE AREA

DETERMINE GRAPHICS MODES
0673
0678
0679
067A

CMP
PUSH
PDP
JC

80 3E 0049 R 06

06
1F
72 lA

CRT_MODE,6

E5
05
513

PO I NT TO REGEN SEGMENT
MEDIUM RESOLUTION

HIGH RESOLUT ION READ

067C
067E
067E
0680
0683
0684
0688
068B
068C
068F
0691
0693
0696
0696
0698
069A
069A
0690
06A1

06A4
a6A8
06AA
06AC
06AC
06Af
0600
06B1
06B4
06B6
06B7
06B9
06B9
a6BA
06BB
a6BE
06BE
06B~

GET VALUES FROM REGEN BUFFER AND CONVERT TO CODE PO I NT
MOV
OH,4
NUMBER
PASSES

or

86 04
512:

MOV
MOV
INC
MOV
MOV
INC
ADD
DtC
JNZ
JMP

8A 04
88 46 00

45
8A 84 2000
88 46 00

45
83
FE
75
EB

C6 50
CE
[B
17 90

513:
D1 E6
B6 04

AL, [51]
[BP),AL
BP
AL, [5 1+200QH I
[ BPI,AL
BP
5 I, 6U
DH
512

515

SAL
MOV

51,1
DH,4

CALL
ADD
CALL
SUB
DEC
JNZ

523
5 I ,200QH
523
S I ,2000H-BO
DH
514

E8
81
E8
81
rE
75

0728 R
C6 2000
0728 R
EE 1 FBO
CE
EE

SF 0000 E
DE

07
83 EO 08
BI) F5

Fe
BO 00

16
1F
SA 0080

56

,r

B9 0008
F3/ A6
8A H 0017 R

3C
74
2B
BE

00
12
CO
08

CMP
JE
SUB
MOV
ASSUME

0600
06E1

C4
8C
OB
74
60
£B

3E 007C R
CO
C7
04
80
CE

LE5

5F
5E
74 H
FE CO
83 C7 08

4A

CHAR NOT MATCHED, MIGHT BE

83 C4 08
£9 0144 R

GET PAl R BYTES fROM REGEN INTO SI NGLE SAVE
GO TO LOWER REG I ON
GET THIS PAIR INTO SAVE
ADJUST POINTER BACK Irno UPPER
KEEP GOING UNTIL ALL

a

DONE

; -------- SAVE AREA HAS CHARACTER I NIT, MATCH IT
S15:
; fiND_CHAR
!-'lOV
OI,OFFSET CRT CHAR GEN
; ESTABLISH ADDRESSING
PUSH
CS
-POP
ES
; CODE POINTS IN CS
SUB
SP,8
ADJUST POINTER TO BEGINNING Of SAVE AREA
MOV
SI,BP
CLD
ENSURE 0 j RECT I ON
MOV
AL,O
CURRENT CODE POINT BEING MATCHED
S16 :
ESTABLISH ADDRESSING TO STACK
55
PUSH
fOR THE STR I NG COMPARE
POP
D5
NUMBER TO TEST AGAI NST
MOV
OX,128
S17:
SAVE SAVE AREA PO INTER
PUSH
51
DI
SAVE CODE PO INTER
PUSH
CX,8
NUMBER OF BYTES TO MATCH
MOV
CMPSB
COMPARE THE B BYTES
REPE
READ ANY BYTE OF STORAGE
MOV
BL, KB_FLAG
RECOVER HIE POINTERS
POP
DI
51
POP
I F ZERO fLAG SET, THEN MATCH OCCURRED
518
JZ
NO MATCH, MOVE ON TO NEXT
INC
AL
ADD
01,8
NEXT CODE PO I NT
DX
LOOP CONTROL
DEC
DO ALL OF THEM
JNZ
S11

0605
0607
06U9
06DB

06E6
06EB
06EE

MED_RES_REAO
Off5EP"2 5 I NCE 2 BYTES/CHAR
NUMBER OF PASSES

514:

75 E9

06E3

PO I NTER I NTO REGEN
LOOP CONTROL
DO I T SOME MORE
GO MATCH THE SAVED CODE PO I NTS

MEO I UM RESOLUT ION READ

a6co
a6C3
06CS
06C9
06CA
06CB
06CD
06Cf
0602
0603

06£5
06£7
06£9

GET fiRST BYTE
SAVE I N STORAGE AREA
NEXT LOCAT I ON
GET LOWER REGION BYTE
ADJUST AND STORE

MOV

OR
JZ
MOV
JMP
ASSUME

AL,O

518
AX,AX
OS,AX
DS:ABSO
01 ,EXT PTR
AX, ES AX,DI
51B
AL,128

516

I N USER SUPPLl ED SECOND HALF
AL<> 0 If ONLY 1ST HALF SCANNED
IF 00 0, THEN ALL HAS BEEN SCANNED
ESTABL I SH ADDRESS I NG TO VECTOR
GET POINTER
SEE IF THE POINTER REALLY EXISTS
! FALL O. THEN DOESN'T EXI ST
NO SENSE LOOK I NG
ORIGIN fOR SECOND HALF
GO BACK AND TRY fOR IT

OS: DATA

; ------ CHARACTER I S FOUND ( AL=O ! f NOT FOuND )
S18:
; READJUST THE STACK,
ADD
SI>,8
; ALL DONE
V IDEO_RETURN
JMP

TH~OW

AWAY SAVE

Video

5-139

GRAPH I GS~R[AO

06Fl

;
;
;
;
;
06F1
06Fl
06F4
06F6
06F7
06FA
06FA
OGFG
06FE
0700
0702
0704
070?
0706

PROC
AND
MDV
PUSH
MOV

0003

0706
0706
0708
0709
070B
070E
070E
0710
0712
0714
0716
0718
071A
071C

071 E
0720
0722
0724
0725
0726
0727
0728

NFAR
Sl,3
AL. Bl

I SOLATE THE COLOR BITS
COPY TO AL
SAVE REG I STER
NUMBER OF TIMES TO 00 TH I S

ex

CX.3

S20:

DO EO
DO
OA
E2
8A

SAL
SAL

EO

OR

08
F8

LOOP
MOV
POP

fB

59
03

Al,l
AL,l
BL,AL
520

SH,aL

ex

;
;

RET

LEFT SHIFT BY 2
ANOTHER COLOR VERSION
FilL ALL Of BL
FILL UPPER PORTION
REG I STER BACK
ALL DONE

INTO BL

ENDP

$19
;
;
;
;

%r

=

80 E3 03
8A C3

51
89

ENOP

EXPAND MED COLOR
TH I S ROUTINE EXPANDS THE LOW 2 81 TS IN BL TO
FILL THE ENTIRE BX REGISTER
ENTRY -~
BL
COLOR TO BE USED ( LOW 2 BITS)
EX I T -BX = COl.OR TO BE USED ( 8 REPLICATIONS OF THE 2 COLOR BITS)

EXPAND~BYTE
THIS ROUTINE TAKES THE BYTE IN AL AND DOUBLES ALL
OF HIE BITS, TURNING THE 8 BITS INTO 16 BITS.
THE RESULT IS LEFT IN AX
PROC
PUSH
PUSH
PUSH

52

"53

2B 02
B9 0001

NEAR

ox
ex

SAVE REG I STERS

BX

SUB
MOV

DX,DX
CX,l

RESULT REG I STER
MASK REG I STER

MOV
AND

BX,AX
BX,GX
OX, BX
AX,l
CX,1
BX,AX
BX,CX
OX,BX
CX, ,

BASE INTO TEMP
USE MASK TO EXTRACT A g I T
PUT I NTD RESULT REGI STER

S22;

8B
23
DB
D1
D1
8B
23
OB
D1
73
8[3

08
09
03
ED
E1
08
09
03
E1

OR
SHL
SHl
MOV
AND
OR

SHL
JNe
MOV
POP
POP
POP
RET

f.C
C2

5B
59
SA

e3

522
AX,

ox

SH I FT BASE AND MASK BY 1
BASE TO TEMP
EXTRACT THE SAME BIT
PUT I NTO RESULT
SHI FT ONLY MASK NOW, MOVING TO NEXT BASE
USE MASK BIT COMING OUT TO TERMINATE
RESULT TO PARM REGISTER

BX

ex
ox

RECOVER REGISTERS
ALL DONE

$21
ENOP
;
M£D READ I3YTE

------------- -- - -- ---------- ----- - -- --- -- -- - --- -THIS ROUTINE WILL TAKE 2 BYTES FROM THE REGEN BUFFER,
COMPARE AGAINST THE CURRENT FOREGROUND COLOR, AND PLACE
THE CORRESPONDING ON/OFF BIT PATTERN INTO THE CURRENT
POSITION IN THE SAVE AREA
ENTRY -S I, OS = PO I NTER TO REGEN AREA OF INTEREST
BX == EXPANDED FOREGROUND COLOR
SP = POINTER TO SAVE AREA
EXIT -SP I S I NCREMENT AFTER SAVE

0728
0728
072A

0720
0730
0732
0732
0734
0735
0737

0738
073A
073G
073E
0740
0743
0744
0745

523
8A 21t
8A 44 01
89 COOO

82 00

MOV
MOV
MOV
MOV

PROC

NEAR
AH, [$1 J
AL. [SI +1 )
eX,oeOOOH
DL,O

TEST

AX,CX

JZ

525

GET FIRST BYTE
GfT SECOND BYTE
2 BIT MASK TO TEST THE ENTRIES
RESULT REG I SHR

S24:
85 C1
F8
711

cec

01

F9
00 02

S25:

STe
RCl

01 £9
01 E9

SHR
SHR

73 F2

JNe
MOV
INC
RET

88 % 00
1<5
C3
523

DL,l

ex, ,
CX,l
S2 1t

[or J. oL

BP

IS TH I S SECT I ON BACKGROUND']
CLEAR CARRY IN HOPES THAT IT IS
IF ZERO, IT IS BACKGROUND
WASN'T, SO SET CARRY
MOVE THAT BIT I NTO THE RESULT
MOVE THE MASK TO THE RIGHT BY 2 BITS
DO IT AGAIN IF MASI( DIDN'T FALL OUT
STORE RESULT I N SAVE AREA
ADJUST POINTER
ALL DONE

ENDP

V4 POSITION
THIS ROUTINE TAKES THE CURSOR POSITION CONTAINED IN
THE MEf-iORY LOCATION, AND CONVERTS IT INTO AN OffSET
I NTO THE REGEN BUF F ER, ASSUM I NG ONE BYTE/CHAR.
FOR f-iEDIUM RESOLUTION GRAPHICS, THE NUMBER MUST
BE DOUBLED.
lNIRY -- NO KU;ISIERS,MEMORY LOCATION CUHSOK_PO::>N IS USED
EXIT-AX CONTAINS OFFSeT INTO REGEN BUFFER
0745
07 115
0748
07il8
0749
074B
074D
0751
0753
0755
0757
0759
075A
075B

526
A1
BB

PHOC
MOV

0050 R

GRAPH - POSN
PUSH

53
08

MOV
MOV
MUl

SA C4
F6 26 Q04A R

01 ED
D1 ED
2A Ff

SHL

03 C3

ADD

5B

POP
RET

SHl
SUB

C3

S26

NEAR
AX, GURSOR_POSN
NEAR
LABEL
BX
BX,AX
Al,AH
BYTE PTR CRT COLS
AX,1
AX,1
BH, BH
AX, BX
BX

GET CURRENT CURSOR
SAVE REG I STER
SAVE A COPY OF CURRENT CURSOR
GET ROWS TO AL
MULTI PLY BY BYTES/COLUMN
MULTIPLY*4 SINCE 4 ROWS/BYTE
ISOLATE COLUI"N VALUE
DETERM I NE Of FSET
RECOVER POINTER
ALL DONE

ENDP

WRITE TTY
THIS INTERFACE PROVIDES A TELETYPE LIKE INTERfACE TO THE
VIDEO CARD.
THE I NPUT CHARACTER IS WR I TTEN TO THE CURRENT
CURSOR pas I T I ON, AND THE CURSOR I S MOVED TO THE NEXT POS I T I ON.
) F THE CURSOR LEAVES THE LAST COLUMN OF THE F I ELO, THE COLUMN
IS SET TO ZERO, AND THE ROW VALUE IS INCREMENTED.
I F THE ROW
RO'" VALUE LEAVES THE FIELD. THE CURSOR IS PLACED ON THE LAST ROW,
FIRST COLUMN, AND THE ENTIRE SCREEN IS SCROLLED UP ONE LINE.
WHEN HIE SCREEN IS SCROLLED UP, THE ATTRIBUTE FOR FILLING THE
NEWLY BLANKED LINE IS READ FROM THE CURSOR POSITION ON THE PREVIOUS
LINE BE.fORE THE SCROLL, IN CHARACTER MODE.
IN GRAPHICS MODE,
THE 0 COLOR I S USED,
ENTRY -(/lH) '" CURRENT CRT MODE
(AL) '"- CHARACTER TO BE WRI TTEN
NOTE THAT BACK SPACE, CAR RET, BELL AND LINE FEED ARE HANDLED

5-140 Video

AS COMMANDS RATHER THAN AS DISPLAYABLE GRAPlil CS
(el) = FOREGROUND COLOR FOR CHAR WRITE IF CURRENTLY IN A GRAPHICS MODE
EXI T -ALL REG I STERS SAVED

075B
075B
075C
0750

o r~ ~

0763
0765

ASSUME
WRITE TTY
PUSH
PUSH

50
50
B4 03
BA 3E 0062 R
CD 10

MOV
MOV
INT
POP

58

ox
0·r66

on8

076A
076C

076[
0770
0"172
077lt

3C
74
3C
74
3C
711
3C
74

CS:COOE,OS:DATA
PROC
NEAR
AX
AX
AH,3
RH, ACT I VE_PAGE

GET CURRENT pA(~r SFTTl NG
READ HIE CURRENT CURSOR POS I T I ON
RECOVER CHAR

NOW HAS THE CURRENT CURSOR POSITION

08

CMP

52
00

J[
CMP
J[
eMP

'j7
OA
57
07
5A

lOll
AX

SAVE REG I STERS
SAVE CHAR TO WR I TE

I SIT A BACKSPACE
BACK SPACE
IS IT CARRIAGE RETURN
CAR RET
IS IT A LINE F[ED
1I N[ FEED
IS IT A BELL
BELL

AL,8
U8
Al.,ODH

U9
AL,OAH

JE

Ul0

CMP

AL,07H
U11

JE

; ----- WR I TE THE CHAR TO THE SCREEN

077B

B4 OA
B9 0001
CD 10

0770
077F
0783
0785
0787
078A

FE C2
3A 16 OOllA R
75 33
82 00
80 FE 18
75 2A

0776

on8

WRITE CHAR ONLY
ONLY ONE CHAR
WR I TE THE CHAR

AH,lD
CX,1

MOV
MOV
I NT

lOH

POSITION THE CURSOR FOR NEXT CHAR

DL
DL, BYTE PTR CRT_COLS
U7

INC
CMP

JNl
CMP

DL,O
DH,24

JNZ

U6

MOV

TEST FOR COLUMN OVERFLOW
SET CURSOR
COLUMN FOR CURSOR
SET_CURSOR_I NC

SCROLL REQU I R[D

lJ1:

078C
078C
078E

AH,2

MOV
I NT

B4 02
CO 10

;

lOll

SET THE CURSOR

DETERMINE VALUE TO FILL WITH DURING SCROLL
0790
0793
0795
0'797
0799
079B
079D
0790
079F
07A1
07A3
07A3
07A6
OlA8
O·{AA
07A[
07BO

omo

07B2
07B2
0·(83
07B6
0786
07A8
07138
07BA

AD OOI~9 R
3C 011

r~ov
Cf~P

72 06
3C 07

JC
CMP
MOV
JNE

B7 00
75 06

GET THE CURRENT MODE

AL, CRT _MODE
AL,I.
U2
AL,7
BI-I,O
U3

READ-CURSOR
FILL WITH BACKGROUND
SCROLL-UP
READ-CURSOR

U2:
AH,8

B4 08
CD 10
8A Fe

READ CHAR/ATTR AT CURRENT CURSOR
STORE IN BII

lOll

BH,AH

SCROLl.-UP
SCROLl. ONE LI NE
UPPER LEFT CORNER
LOWER R I CHT ROW
LOWER R I CHT COLUMN

U3:
AX,

MOV
SUB
MOV
MOV
OEC

B8 0601

28 C9
86 18
8A 16 004A R
FE CA

601 H

ex,cx

DH,24
OL, BYTE

PTR CRT_COlS

OL

VI DEO-CALL-RUURN
SCROLL UP THE SCREEN
nY-RETURN
RESTORE THE CHARACTER
RETURN TO CALLER

U4:

INT

CD 10

1011

U5:
58
E9 0144 R

POP
JMP

AX
VIDEO RETURN

INC

Oil

MOV
JMP

AH,2
U.

-

SET-CURSOR- INC
NEXl ROW
SET-CURSOR

u6:
FE C6
U7 :

134 02
EB f4

ESTABLISH THE NEW CURSOR

; ----- BACK SPACE FOUND
01BC
07BC
O"/BF
07C1
07C3

U8:

80
74
FE
EB

JE

OL,O
U7

OEC
JMP

U7

CMP

fA 00
F7
CA
F3

ALREADY AT END OF LINE
SET CURSOR
NO
JUST MOVE I T BACK
SET_CURSOR

=-

DL

;----- CARRIAGE RETURN FOUND
07CS
07CS
07C7

U9:
MOV
JMP

B2 00
EB EF

MOVE TO FIRST COLUMN
SET_CURSOR

DL,O
U7

LI HE FEED FOUND
07C9
07C9
07CC
07CE

U10:

BO FE
75 E8
EB BC

BOTTOM Of SCR[EN
YES, SCROLL TIl[ SCREEN
NO, JUST SET THE CURSOR

DH,24

CMP
JNE
JMP

"

u6
U1

-- BELL FOUND
0700
0700
0702
0705
0707

U11 :
83 02
EB 0000 E
EB DB

MOV

CALL

BL,2
BEEP

JMP

US

WR I TE_ TTY

;
;
;

SET UP COUNl FOR BEEP
SOUND THE POD BELL
TTY RETURN

ENOP

LIGHT PEN
THIS ROUTINE T[STS HIE LIGHT PEN SWITCH AND THE LlGH'
PEN TRIGGER. IF BOTH ARE SET, THE lOCATION OF THE LIGHT
PEN IS DETERMINED. OTilERWISE, A RETURN WITH NO INFORMATION
IS MADE.
ON EXIT:
(AH) =
IF NO LIGHT PEN INFORMATION IS AVAILABLE
BX, ex, DX ARE DESTROYED
(AH) '" 1 IF LIGHT PEN IS AVAilABLE
(DH,DL)
ROW,COLUMN OF CURRENT LIGHT PEN POSITION
(CH) '" RASTER POSITION
(8X) = BEST GUESS AT PIXEL HORIZONTAL POSITION

a

0707
0707

ASSUME
CS:CODE,DS:OATA
; ----- SUBTRACT_TABLE
Vl
LABEL
BYTE
03 03 05 05 03 03

DB

3,3,5,5,3,3,3,4

03 011
Q7DF

PROC

NEAR

Video

5-141

;----- WAIT

070r
07E1
07E5
07E8
07E9
07E8
07EO

Mav
Mav

(3/1 00
8B 16 0063 R
83 C2 06

ADO

EC

'N

TEST
JZ

A8 04
74 OJ
E9 0872 R

JMP

FOR LIGHT PEN TO BE DEPRESSED
SET NO LICHT PEN RETURN CODE
GET BASE ADDRESS OF 6845
POINT TO STATUS REGISTER
GET STATUS REG I STER
TEST LIGHT PEN SWITCH
GO j f YES
NOT SET, RETURN

AH,O
DX,AODR_6845
DX,6
AL,DX
AL,4

V6 A
V6-

NOW TEST fOR LICHT PEN TR I GGER
07FO
07F2
07 F4

V6_A:

A8 02

75 03
E9 087C R

TEST
JNZ
JMP

; ----- TR I OOER HAS BEEN SET,
07F7
07F7

V7A:
84 10

Mav

TEST LIGHT PEN TRIGGER
RETURN W! THOUT RESEH I NG TR I GoER

AL,2
V7A
V7

READ THE VALUE
;

AH,16

INPUT REGS POINTED TO BY AH,
07F9
07FD
07FF
0800
0802
0603
0804
0806
0807

Mav

88 16 0063 R
8A C4

MDV
OUT

EE

JI1P
INC
IN

EB 00
42
EC
8A E8
4A
FE C4
8A C4

Mav

0806

EE

OBoe

42
EB 00

OB09
0800

Mav

EC
8~

OX

aUT

INC

OX

JMP

SHORT $+2
AL, OX
AH,CH

0812

SA 1 E 0049 R
2A FF
2E: SA 9F 0707 R
213 C3
88 lE 004E R
01 EB
28 C3

Mav

E5

ax

AH
AL,AH
OX,AL

; ----- AX HAS THE VALUE READ

0816
0818
0810
081f
0823
0825
0827

0829

Mav
SUB
MOV
SUB

Mav

79 O?
28 CO

IN OX

ADDRESS REGISTeR FOR 6845
REGISTER TO READ
SET IT UP
10 DELAY
DATA REGISTER
GET THE VALUE
SAVE IN CX
ADDRESS REG I STER

AL,DX
CH,AL

INC

"

OSOF
0810

AND CONVERT TO ROW COLUMN

OX,ADOR_6845
AL,AH
DX,AL
SHORT $+2

DEC

IN

LI GHT PEN REG I STERS ON 6845

SECOND DATA REG I STER
POINT TO DATA REGISTER
10 DELAY
GET SECOND DATA VALUE
AX HAS I NPUT VALUE
I N FROM THE 6845

8l, CRT MODE
BH, BH BL,CS:V1[I3Xj
AX,BX
BX, CRT _START

MODE VALUE TO BX
DETERM I NE Afv.OUNT TO SUBTRACT
TAKE I T AWAY

eX,l

SHR
SUB

AX,BX

JNS

V2

SUB

AX,AX

CONVERT TO CORRECT PAGE OR I GIN
I r POSITIVE, DETERMINE MODE
<0 PLAYS AS 0

;----- DETERMINE MODE Of OPERATION

0826
082'B
0820

OB32
OB34
0839

V2:
B1
80
72
80
74

MOV
CMP

03
JE 0049 R 04
2A
3E 0049 R 07
23

JB

CL,3
CRT MODE,4

V4 -

CMP

CRT_MODE,7

JE

V4

DETERM I NE !'IORY

CS:CODE,DS:DATA

-

PROC FAR

PUSH
OS
CALL
DDS
MOV
AX,MEMORY_SIZE
POP
OS
I RET
MEMORY_SiZE_DETERMINE_l ENDP

IN1ERIWPTS BACK ON
SAVE SEGMENT
EST ABL I SH ADDRESS! NG
GET VALUE
RECOVER SEGMENT
RETURN TO CALLER

; --- I NT 11 ------------------------- ---------------------------:
EQU I P~lENT DETERM I NAT I ON
THIS ROUTINE ATTEMPTS TO DETERMINE WHAT OPTIONAL
DEVICES ARE ATTACHED TO THE SYSTEM.
INPUT
NO REG I STERS
THE FQUIP fLAG VARiABLE IS SET DURING THE POWER ON
DIAGNOSTICS USING THE FOl.LOWING HARDWARE ASSUMPTIONS:
PORT 3FA := INTeRRUPT 10 REGISTER OF 8250 (PRI!"iARY)
2FA:-: INTERRUPT ID REGISTER OF 8250 (SECONDARY)
61 TS 7-3 ARt ALWAYS 0
PORT 378 '" OUTPUT PORT Of PRINTER (PRIMARY)
278 = OUTPUT PORT OF PR I NT[R (SECONDARY)
3BC'" OUTPUT PORT Of PRINTER (I~ONO-PRINTER)
OUTPUT
(AX) IS SET, BIT SIGNIFICANT, TO INOICATE ATTACHED I/O
BI-I 15,14 '" NUMBER OF PRINTERS ATTACHED
BIT 13,12 NOT USED
BIT 11,10,9 = NUMBER OF RS232 CARDS A1TACHED
BIT 8 '" NOT USED
BIT 7,6 = NUMBER OF DISKETTE DRIVES
00= 1, 01=2 ONLY I FBI T 0 = 1
BIT 5,11 = INITIAL VIDEO MODE
00 - UNUSED
01 - 40X25 BW US I NG COLOR CARD
10 - 8UX25 llW us I NG COLOR CARD
11 - 80X25 BW US 1NG BW CARD
BIT 3 '" NOT USED
BIT 2 = NOT USED
BIT 1 :0 MATH COPROCESSOR
BIT 0 =c 1 (IPl. DISKETTE INSTALIF'D)
NO OTIlER REG I STERS AFF[CTED
ASSUME
FqlJl PMENT 1

aOUA

OOOA
OOOB

FB
1E

OOOF
DOl?

E8 0000 E
Al 0010 R
1F
CF

oooe
0013

CS; CODE, OS: DATA

PROC

STI
PUSH
CALL
MDV

POP

FAR

»>

ENTRY PO I NT FOR ORG 0 F84DH
INILRRUPTS BACK ON

os

SAVE SEGMENT REG I STER

DDS

ESTABL I SH ADDRESS I NC
GET THE CURRENT SETT I NGS
RECOVER SEC/·1ENT
RETURN TO CALLER

AX, EQU I P_FLAG
OS

I RET

0014

EQU I PMENT 1
ENOl"
; -- I NT 2-- ----- ---- ---------- --- -------- - ---- ---------------- - -:
NON-MASKABLE INTERRUPT ROUTINE (REAL MODE)
THIS ROUTINE WILL PRINT A "PARITY CHECK 1 OR 2" ~l[SSACE
AND AnEMPT TO FIND THE STORACE lOCATION CONTAINING THE
BAD PAR I TY.
I F rOUND, HIE SEGMENT ADDRESS WILL BE
PRINTED.
IF NO PARITY ERROR CAN B[ FOUND j INTERMITTENT
RfAD PROBLEM) ?????<:-WILL BE PRINTED WHERE THE ADDRESS
WOUl.D NORMALLY CO.

0014

NMI

PARITY CHECK 1 = PLANAR BOAIW MEMORY FAILURE.
PARITY CHECK 2 = OFF PLANAR BOARD MEMORY FAI lURE.
INT 1 PROC
.

0014
0015
0017
0019
00113

50

001D
001 F

E4 61
A8 CO

E4
FE
EB
EG

80

CO
00
80

-ASSUME

PUSH
IN
INC

NEAR
DS: DATA
AX

OUT

AL, MFG PORT
AL
SHORT $+2
MFG_PORT, AL

IN
TEST

AL, PORT_B
AL,PARITY_ERR

JI~P

SAVE OR I G CONTENTS Of AX
I NCRf.MENT NM I COUNT
I N DELAY
SET COUNT
PAR I TY CHECK?

BIOS

5-143

8A EO
75 03
E9 OOCl

0028
002A
0020
002F
0031

80 AD
E8 0000 E
E4 60

MOV
CALL

BO CO

0034
0037

£8 0000 E
£4 60

MOV
CALL
CAll

R

IN

E8 0000 E

~~6~~AO=8042_1

0039

E6 80

OUT

0038
003E
0040
0043

BA
8E
BE
F6
75
BE

MaY
MOV
MOV
TEST
JNZ
MOV

OX,OATA
OS, ox
51 ,OFFSET 01
AH,40H
NM1_2
SI,OFFSET 02

0048
004B

004B
0040

---- R
DA
0000 E
c4 40
03
0000 E

B4 00
AD 0049 R
10
E8 0000 E

0050
0052

co

0055

80 FF
£6 70

0057
0059

E4 61

005B
0050

EB 00

DC DC

005F
0061
0063
0065
0067
006B
006e
006E

E6 61
EB 00
24 F3
£6 61
88 lE 0013 R

006E

BE OA
8E C2
B9 8000
2B F6

0070
0072
0075

IN

Fe
2B 02

F3/ AD

0079
0078
0070
0081
0083
0087
0089
008B
0080
ooaF
0092
0095
0098
009A
009E
OOAl
00A3
00A6
00A9
OOAA
OOAB
OOAB
OOAD
OOBO
00B2

E4 61
86 C4
81 FA 4000

XCHG

72 OC

JB

81 FA 8000
73 OC
£4 80
A8 10
74 06
F6 C4 80
fB 04 90
F6 C4 40
75 11
81 C2 lOaD
83 fB 40
75 CB
BE 0000 E
E8 0000 E
FA
F4

eMP
JAE

00B5
0087
008A
OORe
aOBF
OOCO
OOCl
OOCl
00C3
DOC5

OOC7
OOC9
DOCS
ooce
OOCD

OA
0000
28
0000
53
0000
29
0000

E
E
E

EXIT FROM ROUTINE

o I SABLE

THE KEYBOARD

FLUSH

GET THE SWITCH SETT J NGS

tojPUT

ISSUE THE COMMAND
WAI T FOR OUTPUT BUFF FULL
GET THE SWI TeH
SAVE SWI TCH

ADOR OF ERROR MSG
I/O PARITY CHECK
DISPLAY ERROR MSG
MUST BE PLANAR

IIIIIT AND SET MODE FOR VIDEO
MaY
AH,O
MOV
AL, CRT MODE
J NT
lOH; CALL V IDEO 10 PROCEDURE
;
PR
I NT ERROR MSG
CALL
P MSG
; ----- SEE IF LOCAT I ON THAT CAUSED PAR J TY CHECK CAN BE FOUND
MASK TRAP
MOY
AL, OFFH
OUT
CMOS PORT, AL
JN
AL, PORT 8
)0 DElAY
JMP
SHORT $+2
TOGCLE PAR J TY CHECK ENABLES
OR
AL, RAM PAR OFF
OUT
PORT B-;-AL ~
; 10 OELAY
JMP
SHORT $+2
AND
AL, RAM PAR ON
OUT
PORT B-;-AL ~
GET MEMORY SIZE WORD
MaY
eX,MEMORY SIZE
CLO
SET 0 I R FLAG TO I NCR I MENT
POINT ox AT START OF MEM
SUB
OX, OX
NMI LOOP:
MOV
OS,DX
MOV
ES,DX
SET FOR 64KB SCAN
eX,4000H*2
MOV
SET SI TO BE REALTIVE TO
SUB
51,SI
START OF ES
READ 64K8 OF MEMORY
REP
LODSW

0077

8e
[8
BO
E8
BO
E8
BO
£8
FA
F4

NO,

AL,OIS KBO
C8042 ~
Al, PORT A

OBF 42
Al, PORT A
MFG_POR'='AL

0046

SAVE PAR I TY STATUS

MOV
AH,AL
JNZ
NMI 1
JMP
014 ~
NMI 1:
;--:;---- GET THE SWITCH SETTINGS

0021
0023
0025
0028

IN
eMP

IN
NMI_3:
NMI 4:
NMI=S:

TEST
JZ
TEST
JMP
TEST
JNZ
ADO
SUB

"NZ

MOV
CALL

SEE I F PAR I TY CHECK HAPPENED
SAVE PAR t TY CHECK
CHECK FOR END OF OF FIRST 256K

AL, PORT B
AL,AH
DX,4000H
NMI_3
OX,8000H
NMI 4
AL,MFG PORT
AL, BASE RAM
NMI 4 AH, PRTY CHK
NMI 5 AH, To CHK
PRT NMI
oX,lOOOH
eX,160*4
NMJ LOOP
SI,(OFFSET D2A)
P_MSG

CHECK A30VE 51 2K
CHECK FOR 10 CHECK
GET THE SW I TCH SEn I NGS
CHECK FOk ~ND 256K ON PLANAR
GO IF NOT
CHECK FOR PARITY ERR
CONT I NUE
TEST FOR J 0 ERROR
GO PRINT AOORESS IF IT DID
POINT TO NEXT 64K BLOCK
PRINT ROW OF ????? IF PARITY
CHECK COULD NOT BE RE-CREATED

ell

HALT SYSTEM

HLT
PRTNMI:
MOV
CALL
MOV
CALL
MOV
CALL
MOV

OX,OS
PRT SEG
AL, T{'
PRT ttEX
AL TS'
PRT HEX
AL, T) I

CALL

PRT~HEX

E

PR I NT SEGMENT VALUE
PRINT IS)

HALT SYSTEM

ell
HLT
014:

BO 8F
E6 70
EB 00

MOV

80 Of

MOV

E6 70

OUT
POP

OUT

JMP

58

AL,8FH
CMOS_PORT,AL
SHORT S+2
AL,OFH
CMOS_PORT ,AL

TOGGLE NMI

AX

RESTORE OR I G CONTENTS OF AX

10 DELAY

IRET
NMI JNT 1 ENOP
PAGE

CF

;

------------------- - --- ------------------------------- - --------THIS ROUTINE INITIALIZES THE TIMER DATA AREA IN THE
ROM BIOS DATA ARfA.
IT IS CALLED BY THE POWER ON
ROUTINES.
IT CONVERTS HR:MIN:SEC FROM CMOS TO TIMER
TICS.
IF CMOS IS INVALID, TIMER DATA IS SET TO ZERO.
) NPUT

NONE PASSED TO ROUT I NE BY CALLER

CMOS BYTES USED FOR SETUP
00
02
04
OA
OE

SECONDS
MI NUTES
HOURS
REGISTER A (UPDATE
CMOS VAll 0 ) F ZERO

IN PROGRESS)

OUTPUT
TIMER LOW
T!MER-HIGH
TIMER-OFL
ALL REG I STERS UNCHANGED
COUNTS SEC
COUNTS~M I N

::
'"
'"'
::
=
::
=
;:;;
""
;::

0012
0444
0007
0070
0071
OOOE
0000
0002
0004
OOOA
= 0080
OOCO

5-144

COUNTS~HOUR

CMOS ADR
CMOS-DATA
CMOS-VALl D
CMOS-SECONDS
CMOS-MJ NUTES
CMOS~HOURS

CMOS=REGA
UPDATE TIMER
SET TOO PROC
~
PUSHA

BIOS

EOU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
NEAR

18
1092

7
70H

71 H
OEH
OOH
02H
04H
OAH
80H

;

65543 -

65536

00 CD
OOCE

60
1E

DOCF

BB

0002

8E
2B
A2
A3
A3
BO
£6
EB
E4
24
75
28
BO
E6
EB
E4
A8
74
E2
EB

0004
0006
0009
OODe
OODF
OOEl
DOn
DOES
00E7
00E9
OOEB
OOED
QOH
OOF1
DOF3
OafS

OOF7
OOF9
OOFB
OOFE
OOFE
0100
0102
0104

DB

PUSH
ASSUME
---- R
08
CO
0070 R
D06e R
006E R
DE
70
00
71
C4
61
C9
OA
70
00
71
80
as
F2
4F 90

UI P:

060H
OS

JZ

OS: DATA
AX, DATA
OS,AX
AX,AX
T I MER_OfL, AL
TIMER_LOW,AX
TIMER_HIGH,AX
AL,CMOS_VALID
CMOS_ADR, AL
SHORT $+2
AL,CMOS_DATA
AL,OC4H
POD_DONE
cX,ex
AL, CMOS_REGA
CMOS_AOR, Al
SHORT $+2
AL,CMOS_OATA
AL, UPDATE_TIMER
READ_SEC

LOOP

UIP

MOV
MOV
SUB
MOV
MOV
MOV
MOV
OUT
JMP
IN
AND
JNZ
SUB
MOV
OUT
JMP
IN

TEST
JMP

POD_DONE

; ESTABL I SH SEGMENT
RESET T I MER ROLL OVER
AND TI MER COUNT

INDICATOR

CHECK CMOS VALIDITY
BAD BATTERY, I CHKSUM ERROR OR CLOCK ERROR
CMOS NOT VAL'ID -- T I MER SET TO ZERO
ACCESS REG I STER A

; CMOS CLOCK STUCK

READ_SEC:
BO
E6
EB
E4

00
70
00
71

MOV
OUT
JMP
IN

AL, CMOS_SECONDS
CMOS_AOR,AL
SHORT $+2
AL, CMOS_DATA

ACCESS SECONDS VALUE I N CMOS

ARE THE SECONDS WITHIN LIMITS?
I F NOT

0106
0108

3C 59
77 40

CMP
JA

AL,59H
TOO_ERROR

010A
0100
010F
0111
0113
0115
0117

E8 0176 R

CALL

CVT_BI NARY
8L, COUNTS_SEC

CONVERT

BL

COUNT fOR SECONDS

CX,AX
AL, CMOS~M I NUTES
CMOS_AOR,AL
SHORT $+2
AL, CMOS_DATA

ACCESS MINUTES VALUE I N CMOS

GO

IT TO 61NARY

B3

12

0119

f6
8B
BO
E6
EB
E4

E3
C8
02
70
00
71

MOV
MUL
MOV
MOV
OUT
JMP
IN

0119
0110

3C 59
77 38

CMP
JA

AL,59H
TOO_ERROR

011F
0122
01;,?5
0127
0129
0128
0120
012F
0131
0133
0135
0137
OHA
013C
Ol3E
0140
0142
0145
0149
014C
Oll,iC
0140
014F
0151
0153
0154

£8 0176 R
BB 01144

CALL

CVT 81 NARY
BX, COUNTS_M I N

CONVERT

BX

COUNT FOR MINUTES

1F

CLI
IN
AND
OUT
STI
POP

0155
0156
0157

61
C3

DB
RET

0157

1F

PDP

0158
0159
01se
015f
0161
0163
0165
0167
0169
016B
0160
016f
0171
0173
0175

61

DB
MOV

MOV
MUL
ADD
MOV
MDV
OUT
JMP
IN
CMP
JA

f70
03
86
BO
E6
EB
1::4
3C
77
E8
88
83
F6
03
83
89
A3

Cl
C8
04
70
00
71
23
20
0176 R
DO
07
E3
C1
02 00
16 006E R
D06e R

CALL
MDV
MOV
MUL
ADD
ADC
MOV
MOV

FE

E6 21
F.

0178
0178
017A
0178
0178
017A
017A
017B
0170
017f
0180
0180

IT TO BINARY

ACCESS HOURS VALUE I N CMOS
; ARE THE HOURS WITHIN LIMITS?
; GO I F NOT
; CONVERT IT TO BINARY
COUNT FOR HOURS

BL

AX,CX
DX,OOOOH
T I MER_H I GH, OX
T I MER_LOW, AX

POD_DONE:
FA

E4 21
24

** 10 DELAY NOT REQU I RED
BE SURE T I MER I S ENABLED

AL,021H
AL,OFEH
021H,AL

**

OS

POPA
061H

TOO_ERROR:
RESTORE SEGMENT
RESTORE REGS

OS

POPA
BE
£8
BO
£6
86
EB
E4
OC
86
E6
86
EB
E6

0000 E
0000 E
8E
70
CII
00
71
all
C4
70
C4
00
71

CALL
MOV
OUT

XCHG
JMP
IN
OR

XCHG
OUT

XCHG
JMP
OUT

RET

C3

061H
SI,OFFSET CM3
E MSG
AI,OIAG_STATUS
CMOS_PORT, AL
AL.AH
SHORT $-+2
AL.CMOS_PORT+1
AL, CMOS_CLK_FAI L
AL,AH
CMOS_PORT ,AL
AL.AH
SHORT $+2
CMOS_PORT+1.AL

DISPLAY CLOCK ERROR
SET CLOCK ERROR
SAVE STATUS ADDRESS
10 DELAY
GET THE CURRENT STATUS
SET NEW STATUS
GET STATUS ADDR AND SAVE NEW STATUS
10 DELAY

SET_TOO ENDP

0176
0176
0176

AX,CX
CX,AX
AL;CMOS_HOURS
CMOS_ADR,AL
SHORT $+2
AL, CMOS_DATA
AL,23H
TOO ERROR
CVT-BINARY
oX,AX
BL, COUNTS_HOUR

ARE THE MINUTES WITHIN LIMITS?
I F NOT

GO

CVT_BI NARY
MOV

8A EO
DO EC
CD
04

211 Of
05 OA
C3

+ ??OOOO
+

ISHR
LABEL

SHR

+ ?10001

LABEL

+

DRG
DB
ORG
DB
AND
AAD

PROC
NEAR
AH,AL
AH,'-lBYTE
AH,l
BYTE
OffSET CS: 110000
OCOH
OfFSET CS:??0001

;

UNPACK 2 BCD DICITS

IN AL

4
AL,orH

RESULT IS IN AX
CONVERT UN PACKEO BCD TO B I NARY

RET

CVT BINARY
ENDS
CODE

ENor

END

BIOS

5-145

5-146

BIOS

TITLE 11/22/83 810S1
. LIST
I NCLUDE SEGMENT. SRC
CODE SEGMENT BYTE PUBL I C

0000

EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN

DDS:NEAR
PRT HEX: NEAR
01: NEAR
02: NEAR
P MSG:NEAR
02A:NEAR
PRT SEG:NEAR
PROG_SHUTDOWN: NEAR

PUBL I C StlUT9
PUBLIC
CATE A20
PUBLIC CASSETTE_IO_l
J NT 15 --- -------------.---------- ------------------------J NPUT CASSETTE I/O fUNCT IONS
(AH) '" 00
(AH) = 01
(Ali) '" D2
(Ali) = 03
RETURNS FOR THESE rUNGT IONS ALWAYS (AH) '" 861i, Cf = 1)
I f CASSETTE PORT NOT PRESENT

I N PUT - UNUSED FUNCT IONS
(AH) '" Oil THROUGH 7F
RETURNS FOR THESE FUNCTIONS ALWAYS (AH) == 86H,

---

CF '" 1)

. - - - -------- ------ -------------------------- -- --------------Extensions
(AH) = 80H
OEVICE OPEN
(BX) = OEVICE ID
(CX) = PROCESS ID

(Ali) = 81H
DEVICE CLOSE
(ax) == DEVICE ID
(CX) = PROCESS ID
(AH) = 82H
PROGRAM TERMINATION
(BX) = DEVICE 10
(AH) = 83H
EVENT WAIT
(AL) = 0 SET INTERVAL
(ES:BX) POINTER TO A BYTE IN CALLERS MEMORY
THAT WILL liAVE THE HIGH ORDER BIT SET
AS SOON AS POSS I BLE AFTER THE INTERVAL
EXPIRES.
(GX,OX) NUMBER OF MICROSECONDS TO ELAPSE BEFORE
POST! NG.
(AL) :0 1 CANCEL
(AH) '" 84H
( OX) =

JOYST I CK SUPPORT
0 - READ THE CURRENT SW ITCH SETT 1NGS
RETURNS AL == SWITCH SETTINGS (BITS 7-4)
(OX) = 1 - READ THE RESISTIVE INPUTS
RETURNS AX = A( x) VALUE
BX = A(y) VALUE
ex = B(x) VALUE
OX = B(y) VALUE

SYSTEM REQUEST KEY PRESSED
(AH) '" 85H
(AL) = 00 MAKE OF KEY
(AL) = 01 BREAK OF KEY
(AH) = 86H
WAIT
(ex, OX) NUMBER OF MICROSECONDS TO ELAPSE BEFORE
RETURN TO CALLER
MOVE BLOCK
(AH) '" 87H
NUMBER OF WORDS TO MOVE
(ex)
(ES:SI)
PO I NTER TO OESCR I PTOR TABLE
EXTENDED MEMORY SIZE DETERM I NE
(AH) = 88H
PROCESSOR TO V I RTUAL MODE
(AH) '" 89H
(AH) '" 90H
{AL 1

DEVICE BUSY LOOP
SEE TYPE CODE

(AH) '" 91H
(ALl

INTERRUPT COMPLETE FLAG SET
TYPE CODE
~OH -> 7f"H
SER I ALLY REUSABELE DEV ICES;
OPERAT I NG SYSTEM MUST SER I AL I ZE
ACCESS
SOH -> BFH
REENTRANT DEVICES; ES:BX IS
USED TO 0 I ST I NGU I SH 0 I FFERENT
CALLS (MULTI PLE I/O CALLS ARE
ALLOWED SIMULTANEUSLY)
COM -> HH
WAIT ONLY CALLS;
THERE IS NO
COMPLEMENTARY' POST' FOR THFS[
WAITS - - THESE ARE TIMEOUT
ONLY.
TIMES ARE FUNCT ION NUMBER
DEPENDENT
TYPE

OESCR f PT I ON

0 I SK
0 I SKETTE
KEYBOARD
NETWORK
ES:BX --> NCB
FDH = 0 I SKETTE MOTOR START
FEH = PRI NTER

DOli
01 Ii
021i
Bali

0000
0000
0001
0004
0006

0009

OOOB
0000
OOOF

0011
0013
U015
0017
0019
0018
0010
DOlF
0021
0023
0025

CASSETTE
FB
80
72
80
OA

FC 80
46
EC 80
£4

74 45
FE
7V,
FE
7'-i
FE
74
FE
74
FE
74
FE
74
FE

CC
41
CC
3D
CC
38
CC
78
CC
31
CC
07
CC

ASSUME CS: CODE
PROC
FAR
10_'
STI
eMP
AH,80H
JB
C1
SUB
AH,80H
OR
AH,AH
DEV_OPEN
JZ
AH
DEC
DEY_CLOSE
JZ
AH
DEC
PROG_TERM
JZ
DEC
AH
EVENT_WAI T
JZ
DEC
AH
JOY_STICK
JZ
AH
DEC
SYS_RfQ
JZ
AH
DEC
C1_A
JZ
AH
DEC

=
=
=
=

TIMEOUT
YES
YES
NO
NO
YES
YES

CHECK FOR RANGE
RETURN IF 0O-7FH
BASE ON 0
DEVICE OPEN
DEV I CE CLOSE
PROGRAM TERMINATION
EVEMT WAIT
JOYSTICK BIOS
SYSTEM REQUEST KEY
WAIT

BIOS 1 5-147

JNZ

0027
0029

75 06
E9 0183 R

002e

E9 0132 R

C1_A:
Cl_B:

e1 0

JMP

BLOCKMOVE

MOVE BLOCK

JMP

WAI T

WAIT

002f

FE CC

DEC

All

0031
0033

75 03

JNl

e1 e

E9 0302 R

JMP

EXT _r~EMORY

GO GET THE EXTENDED MEMORY

0036
0038

FE CC

DEC
JNZ
JMP

All
(;1 U
SET_VMODE

CHECK FOR FUNT!ON 89
SWAP TO V I RTUAL MODE

OQ3A

0030
0040

C1_C:

75 03
E9 03E6 R
Cl_D:

80 EC 07

0042

75 03
£9 0475 R

00/.5
0047

FE CC
75 03

00LI9

E9 0479 R

004C

B4 86

004E

F9

Cl_E:

Cl:
C1

004F
004F

SUB

AH,7

JNZ
JMP

E
DEV ICE_BUSY

DEC
JNl

e1

JMP

I NT_COMPLETE

MOV
STC

AH,86H

0052

DEV_CLOSE:

0052

PROG_TERM:

0052
0052

SYS_REQ:
EB fB

JMP
CASSETTCIO_l

1E

EVENT WA I T
ASSUME
PUSH
CALL
TEST
JZ

00?4
0054
0054
0055
0058

E8 0000 E

0050
005 F
0060
0061

74 04
1F
F9
EB EC

F6 06 OOAO R 01

006A
006E
0072

0076
007A

007F
0081
0083

0085
0087
0089

a08A

ooec
008E
008 F
0091
0092

0093

CHECK FOR FUNCT I ON 86
GO I F NOT

All

SET BAD COMMAND
SET CARRY FLAG ON

POP

Cl F
END?

; RETURN

PROC
NEAR
CS:CODE,OS:DATA
OS

SAVE

DDS

RTC WAIT FLAG,Dl
EVENT WAIT 1
OS
-

CHECK fOR FUNCTION ACTIVE
SET ERROR
RETURN

STe
JMP

0063

0068

FA
E4
211
E6
8C

A1
FE
Al
06 009A R
89 1 E 0098 R

EVENT WAIT 1:
CLI
IN
AND
OUT
MUY
MOY
MOY
MOV
MOY
MOY
OUT

89 DE 009E R
B9 16 009C R
C6 06 OOAO R 01
BO OB
[6 -(0
1::4 71

"

24 7F
OC 40
50

AND

80 DB

MOY
OUl
POP
OUT

OR
PUSH

Ff1 70
58
E6·(1
FB
1F
EB BA

NO INTERRUPTS ALLOWED
ENSURE I NTERRU PT UNMASKED

AL, OAl H
AL,OFEH
OA1H,AL
USER_FLAG_SEG, ES
USER_fLAG,6X
RTC_HIGH,eX
RTC_LOW, OX
RTC WAlT FLAG,01
AL,OBH
CMOS_PORT,AL
AL, CMOS PORT +1
AL,07fHAL,040H

SET UP TRANSFER TABLE

SET ON FUNCT I ON ACT I VE SW ITCH
ENABLE PIE

AX
AL,OBH
CMOS_PORT,AL
AX
CMOS_PORT+l,AL

ENABLE I NTERHUPTS
S1I
POP
OS
JMP
C1_F
[VF.:NT WA I T
ENDP
; --- JOY _ ST I CK -------------- -- ----- ------- -- ------------------THIS ROUTINE WILL READ THE JOYSTICK PORT

0095

INPUT
(DX)"'O READ THE CURRENT SWI TCH[S
RETURNS (AL)", SWITCH SETTINGS
(DX)=l

0096
0098
009B

009D
D09F
OOAl
00A3
DOA5
DO AS
OOA6
OOA8
OOA8
OOA9
OOAB
OOAD
OOAD

74
FE
7/,
EB

09
C8
OA
A7

EC
24 FO
EB F8

OOC9

MOV

E6 DA

00C8 R

CALL
PUSH

02
OOGB R

MOV

CALL
PUSH

04

MOV

OOCB R

CALL
PUSH
MOV

08

oaCB

R

TEST_CORD
PUSH

52

5-148

CALL
MOV
POP
POP
POP
JMP

01

OOCEI

OOCB

AL, OX
AL,OfQH
JOY_ 1

I NTEHRU PTS BACK ON
GET SUB FUNCT I ON CODE
ADDRESS OF PORT
READ SW ITCHES
READ RESISTIVE INPUTS
GO TO ERROR RETURN
GO TO COMMON RETURN

F

STRI P UNWANTED BITS OFF
FINISHED

JOY_3:

58

aaBF

e1 -

IN
AND
JMP

01

OOG8

00139
OOBB
aasE

JMP

I NVAL I 0 CALL

jOY_2 :

00C1
OOC4
OOC6
OOC7

0082
0083
00B5
00B8

511

FB
EB A7

83
E8
51
83
E8
51
83
E8
51
B3
E8
8B
59
56

OOM

I F NO ADAPTER CARD OR

ASSUME CS: CODE
JOY 5T I CK
PROC
NEAR
STI
MOV
AX, DX
MOV
DX,201H
OR
AL,AL
JZ
JOY 2
DEC
AL JZ
JOY 3
JMP
C1 -

FB
88 C2
SA 0201
OA CO

IN BITS 7-4

READ THE RESISTIVE INPU1S
RETURNS (AX)=A(x) VALUE
(BXJ=A(y) VAIUf
(CX)=B(x) VALUE
(DX)=B(y) VALUE

CY fLAG ON

0095
0095

90

RET

CA 0002

DEV_OPEN:

0066

CHECK FOR FUNCT I ON
GO I F NOT

F·

0052

0063
0064

e1

BIOS 1

6L,1
TEST_CORD

ex

SAVE A(x)

VALUE

SAVE A(y)

VALUE

BL,2
TEST_CORD

ex
BL,4
TEST_CORD

ex

SAVE 8(x) VALUE

8l.,8
TEST CORD
OX,cx

ex
BX

AX
JOY_1
PROC

OX

SAVE B{y) VALUE
GET B( x) VALUE
GET A( y) VALUE
GET A( x) VALUE
FINISHED - RETURN

NEAR
SAVE

OOCC
OOCD
OOCF
0001
0003
0005
0007
0009
00D8
OODO

CU

FA

80 00
E6
Ell
E4
F:B
8A
E4
86

MOV
OUT
JMP
IN
JMP
MOV
IN

l.J3
00
40
00
EO
40
[0

XCHC
PUSH

50

OODE

B9 OliFF

OOEl
00E2
ODEll

EE

00[4
00£5
00E7
00E9
OOEC

OOEO
DOEF
oaFl
OOF3
OOF3
00F5
OOF7
DOF9
OOFB
OOfD
DOFf
0101

MOY
OUT
JMP

EB 00
EC

84 c3
EO FB
83 f9 00

TEST CORD 1:
IN
T[ST
LOOPNZ
CMP
POP

59

JNZ

75 04
2B C9
EB 20
BO
E6
EB
E4
8A

SUB
JMP

TEST CORD 2:
MOV

00
43
00
40
EO

OUT
JMP
IN
MOV
JMP
IN

EB 00
E4 40
86 EO

XCHC

0103
0105

3B C8
73 OB

Olor

52

JAE
PUSH

0108

SA FFFF

MOV

010B
0100

2B 00
03 CA

OlOF

5A

0110

EB 02

0112
0112

26 C8

CMP

SUB
AOO
POP
JMP

TEST CORD 11:
SUB
TEST_CORD_5:

01111

0111j
0118
011A
011e
011E

81
01
01
01
D1

E1

ANO

1 FFO

SHR
SIlR
SHR

E9

[9
E9
E9

SHR

AL,DX
AL,BL
TEST CORD 1
CX,OCX

AL.D
TIMER+3,AL
SHORT $+2
AL, TIMER
AH,AL
SHORT $+2
AL, T I MER
Ati,AL
eX,AX
TEST CORD 4
OX
OX,-l

AX

POf>

ex

0131
0132
0132

C3

RET

0140
0153
0157
015B
0160
0162
016 11
0166
0168
016A
01613
0160
016F
0170

0172
0173
0173
0178
017A
017F
0180
0183

BA 0201

MOY

OX,201H

51

PUSH
PUSH

AX

50

~10V

69 04 f F

TEST CORD 6:
IN
TEST
l.OOPNZ

POP

TEST CORD
JOY_STICK
WAIT
1E

E8 0000 E
F6 06 OOAO R 01
71j 05

PROC
PUSH
CAll
TEST
JZ
POP
STC
JMP

1F
F9

E9 004F R
WAI T_':

SET

6 COUNT
;

FOR RETURN
EXIT WITH COUNT = 0

SET UP TO LATCH T I MER 0
READ LOW BYTE OF T I MER 0
READ HIGH BYTE OF TIMER 0
REARRANGE TO HI OH, LOW
CHECK FOR COUNTER WRAP
GO ! F NO

eX,AX

ex, 1 FFOH
CX,l
eX,l
CX,l
CX,l

TEST CORD 3:
S11

FR

ORIGINAL COUNT

ADJUST FOR WRAP
DX,AX
CX, OX
OX
;
SHORT TEST_CORO_5

PDP

011~9

;

SHORT TEST_CORD_3

58
59
5A

014~{

READ VALUES
HAS PULSE ENDED?

~~~~~ TEST_CORD_~

012E
012f
0130

01313
0130
013E
013F
0142
0142
0143
0145

READ HIGH BYTE or TIMER 0
REARRANGE TO HIGH, LOW
SAVE
SET COUNT
FIRE T I MER

CX,Ip-FH
OX,AL
SHORT $+2

[C
A8 Of
EO FB

0136

READ LOW BYTE OF TIMER 0

AX

0120
01?0
0121
0124
012:;
0126
0129
0129
012A
012C

013?
0132
0133

BLOCK I NTERRU PTS WH I LE READ I NG
SET UP TO LATCH T I MER a

AL,O
TIMER+3,AL
SHORT $+2
AL,TIMER
SHORT $+2
AH,Al
AL,lIMER
AH,AL

ex

CX,4FFH

ADJUST

I NTEHRUPTS 8ACK ON
FLUSH OIHI:.K INf-'U'IS
COUNT

AL, OX
AL,OfH
TEST_CORD_6

SET COUNT

OX

Rl'TURN
ENDP
ENDP
NEAR
SAVE

OS
DDS

RTC WAIT FLAG,Ol
WAIT 1
OS

TEST FOR FUNCTION ACTIVE

-

C1_F

SET ERROR
RETURN

IN
AND
OR

NO I NTERRUPTS ALLOWED
AL, OA 1 H
ENSURE I NTERRUPT UNMASKED
AL,OFEH
OA1H,AL
USER_Fl.AG_SEC, OS
; SET UP TRANSFER TABLE
USER_Fl.AG, OFFSET RT C_WA IT_flAG
Inc HIGH,CX
RTC-LOW, ox
RTC-WAIT FLAG,01
SET ON FUNCTIO:-.l ACTIVE SWITCH
AL, aBH
ENABLE PIE
CMOS PORT, AL
AL, CMOS_PORT+l
AL,07FH
AL,040H

50

PUSH

AX

BOOB

Mav

[6 70

OUT

AL,OBH
CMOS_PORT, AL

58

[6 71

POP
OUT

CMOS_PORT+1, AL

FB

STI

CI I
IN
AND
OUT
MOV

CA

E4
24
E6
8e
C7
89
89
C6

A1
FE
Al
1 E 009A R
06 0098 R OOAO R
DE 009E R
16 009(; R
06 OOAD R 01

'·IOV
MOY
MOV
MOV
MOV

BO DB

OUT

E6 70
III 71
24 7F

OC 110

AX

ENABLE

INTERRUPTS

WAI T_2:
TEST

F6 06 DOAD R 80
74 F9
C6 06 OOAD R 00

JZ
MOY
POP
JMP

1F
E9 004F R
WAIT
PAGE

RTC WAIT FLAG,080H
WAI T 2
RTC WAIT FLAC,O
OS Cl_F

CHECK FOR END OF WAIT
SET FUNCTION

INACTIVE

ENOP

INT 15 (FUNCTION 87H - MOVE BLOCK) --------------------PURPOSE;
THIS 810S FUNCTION PROVIDES A MEANS TO TRANSFER A BLOCK
or STORAGE TO AND FROM STOKAGE ABOVE THE 1 MEG ADDRESS
RANGE IN VI RTUAL (PROTECTED) MODE.
ENTRY REQU I REMENTS;
ES:SI POINTS TO A DESCRIPTOR TABLE (GOT) 8UILT 3EFORE
IN 11IHW PT I NG TO TH I S FUNCT I ON.
THESE OEseR I PTORS ARE
ARE USED BY THIS FUNCTION TO PERFORM THE 8LOCK MOVE.
THE SOURCE AND TARGET DESCRIPTORS BUILT BY THE USER
MUST HAVE THE SEGMENT LENGTH = 2 * CX - 1 OR GREATER.
THE DATA ACCESS RIGHTS BYTE WILL BE SET TO CPLO-RjW(93H)
THE 24 BIT ADDRESS (BYTE HI, WORD LOW) WILL BE SET
TO TilE TARGET/SOURCE.
THE OESCR I PTORS ARE DEF I NED AS FOLLOWS:

BIOS 1 5-149

1.
2.

3.

4.

5.
6.
,

THE FIRST OESCR I PTOR I S THE REQU I RED DUMMY.
(USER INITIALIZED TO 0)
THE SECOND OESCR I PTOR PO I NTS TO THE GOT TABLE AS
A DATA SEGMENT.
(USER INITIALIZED TO 0)
THE THIRD DESCRIPTOR IS THE DESCRIPTOR THAT POINTS
TO THE SOURCE TO BE MOVED. (FROM)
(USER INITIALIZED)
THE FOURTH OESCR I PTOR IS THE DESCR I PTOR THAT PO I NTS
TO THE DESTINATION. (TO)
(USER INITIALIZED)
THE FIFTH IS A DESCRIPTOR THAT THIS FUNCTION USES
TO CREATE A VI RTUAL CODE SEGMENT
(USER INITIALIZED TO 0)
THE SIXTH IS A DESCR! PTOR THAT THIS FUNCTION USES
TO CREATE A VIRTUAL STACK SEGMENT.
(POINTS TO USERS
STACK)
(USER INITIALIZED TO 0)

~AGE------------------------------------------------------------

~ ------

I NT 15 (FUNCT I ON 81H CaNT I NUED) ------------------------ ~
AH=87
(FUNCT ION CALL)
ES:SI = LOCATION OF THE GOT TABLE BUILD BY ROUTINE
USING THIS FUNCTION.
CX = WORD COUNT OF STORAGE BLOCK TO BE MOVE.
NOTE: MAX COUNT

=

8000H

32K WOROS

EXI T PARAMETERS:
AH = 0
I F SUCCESSFUL
AH
1
IF RAM PARITY (PARtTY ERROR IS CLEARED)
AH = 2
I F EXCEPT I ON I NTERRUPT ERROR
AH = 3
IF GATE ADDRESS LINE 20 FAILED
ALL REG I STER ARE RESTORED EXCEPT AX.
CARRY FLAG
1 I F ERROR
ZERO FLAG
1 I F SUCCESSFUL
CONSI DERAT IONS:

=

=
=

NO I NTERRUPTS ARE ALLOWED.
TIME OF DAY (ADJUSTED BY USER???)
DESCR I PT ION:

1.
2.

3.
4.
5.
6.

7.
8.

;

9.
10.
1.1 •
12.
13.

CLI (NO INTERRUPTS ALLOWED) WHILE THIS FUNCTION IS
EXECUT ING.
ADDRESS LINE 20 IS GATED ACTIVE.
:
THE lOT (INTERRUPT DESCRIPTOR TABLE) IS ROM RESIDENT:
THE CURRENT USER STACK SEGMENT AND OFFSET IS SAVED. :
THE GOTR IS LOADED WITH THE OFFSET INTO ES:SI
:
THE loTR SELECTOR IS ROM RESIDENT AND IS LOADED.
:
THE PROCESSOR IS PUT IN VIRTUAL MODE
:
DATA SEGMENT IS LOADED WITH THE SOURCE DESCRI PTOR
EXTRA SEGMENT IS LOADED WITH THE TARGET oESCRI PTOR
:
DS:SI (SOURCE) ES:DI (TARGET) REP MOVSW IS EXECUTED:
SHUTDOWN 09 I S EXECUTED.
STACK SEGMENT/OFFSET IS RESTORED.
ADDRESS LINE 20 IS DEGATED.
INTERRUPTS ARE ALLOWED

-_.--------------------------- ---------------------------------14.

;

~age
;

THE fOLLOWING DIAGRAM DEPICTS THE ORGANIZATION

or

-------------- --- ----------------.- -- ----- --------------------:
GOT
GOT.

(ES: SI )--»

+00
+08
+10
+18
+20
+28

DUMMY
i
1
1
1----------------1
r
GOT LaC
I
1
1
1----------------1

I

I

SOURCE
GOT

I

I
I

TARGET
GOT

I
I

I

I

BIOS
CS

I

I

55

I

r

1----------------1
1----------------1

I

1----------------1

1
1
,----------------,
SAMPLE OF SOURCE OR TARGET DESCRI PTOR
SOURCCTARGET.DEf
SEG LIMIT
BASE LO WORD
BASE=H I ::::BYTE
DATA_ACC.RIGHTS
DATA_RESERVED

STRUC
SEGMENT LIMIT ('-65536 BYTES)
24 B IT SEGMENT PHYS! CAL
ADDRESS (0 TO (16M-l»)
ACCESS RIGHTS BYTE
RESERVED WORD

OW

ow

DB
DB
OW

SOURCE.TARGET

ENDS

---------------------------------------------------------------:
----------------------------------------------------- ---------------THE GLOBAL DESCRIPTOR TABLE (ACTUAL LOCATION POINTED TO BY ES:SI)
; ------------------------- -- ------------------------- -----------------;
;

BLOCKMOVE_GDT.DEF
0000
0008

00
00
00
00
00
00

00 00 00 00 00
00
00 00 00 00 00
00
00 00 00 00 00
00

STRue

DQ

FIRST OESCR I PTOR NOT ACCESS I BLE

CGOT_LOe OQ

LOCATION OF CALLING ROUTINE GOT

DUMMY

SOURCE

OQ

SOURCE oESCR I PTOR

0018

00 00 00 00 00 00
00 00

TARGET

DQ

TARGET DESCRI PTOR

0020

00 00 00 00 00 00
00 00
00 00 00 00 00 00
00 00

BIOS.CS

DQ

B I OS CODE oESCR I PTCR

TEMP_5S

DQ

5T ACK OESCR I PTOR

0010

0028
0030

5-150 BIOS 1

--------------------------_.----_._-------------------------------._--

BLOCKMOVE_GDT.OEF
;

ENOS

ASSUME
ASSUME
BLOCKMOVE

0183

;-------

CS; CODE
DS;DATA

PROC

NEAR

INITIALIZE rOR VIRTUAL MODE

0183
0184

FA
FC

eLi

01 B5
0186
0187

60
06
lE

OR

NO I NTERRUPTS ALLOWED
SET 0 I RECT I ON
SAVE GENERAL PURPOSE REGS

CLD

PUSHA
PUSH
PUSH
;---~---

0188
018A

SAVE EXTRA SEGMENT

CLEAR EXCEPTION ERROR FLAG
SUB

2A CO
E6 80

060H
ES
OS

OUT

AL,AL
MFG_PORT, AL

SET TO 0

;------- GATE ADDRESS BIT 20 ON
018C
018E
0191
0193
0195
01')7
0199

MOV
CALL
eMP
JZ
MUV

B4 OF
£8 03BO R
3C 00

74 07
BO 03
E6 80
E9 0270 R

our

JMP

AH, ENA8LE_B! T20
GATE A20
AL,OBL4
AL,03H
MFG PORT. AL
SHUT9

WAS THE COMMAND ACCEPTED?
GO I F YES
SET THE ERROR FLAG
EARLY EXI T

;-------- SET SHUQOWN RETURN ADOR
019C
019E
01AO
01A2
01A4

80 8F

01A6
01A8
OlAA
OlAC
OlAF
OlAF
01Bl
OlAF
OlAF
01Bl
01 Bl
01B2
01B5
01B5
01B7
01B5
01B5
01B5

Bl4:

OU

E6 71

OUT

8e CO
8B OE
8A Fl~
80 E6 FO

MOV
MOV
MOV

AND

+ ??OOOO
+
+ ??OO01
+

DO EE

ISIIR
LABEL
SHB

lABEL

CO

ORG
DB

04
80 E4 OF

DRC
DB
AND

01

+ ??0003
+
+ 1700011
+
+ ??0005
+

EO

Cl

01B7
04
03 08
73 02

alBC

FE C6

26;
26;

88 74 DC
89 5C OA

;>6;
26;

C'1 411 08 FFFF
C7 1111 DE 0000

0102

BD 02Al
2E

0106
0107
0107
aIDA
0107

OF

0107
OIDA

01

DB

ORe

Al,SHUT DOWN
CMOS PORT, AL
SHOR"f $+2
Al,9
CMOS_PORT+l,AL

SET THE SHUTDOWN BYTE
TO SHUT DOWN 9
10 DELAY

AX, ES
BX,51
DH,AH
OH,OFOH
oH,4
IWTE
OH,l
BYTE
OFrSET CS; ??OOOO
OCOH
OFfSET cs; !'!0001

GET THE CURRENT DATA SEGMENT
GET THE CUIUO:.N I OFFSET
DEVELOPE THE M IGH BYTE OF THE 24BI T ADDR
USE. ONLY THE HIGH NIBBLE
SHI FT RIGHT

I.

4
STRIP I-IICH NIBBLE FROM AH
SHI FT AX

AH,OOFH
AX,II
ByrE
AX,1
BYTE
OFFSET CS: ??0003
NEAR
DC1H
OFFSET CS; ??0004

4

DEVELOPE THE LOW worm ADDRESS
BX,AX
GO I F NO CARRY
BUA
I NCREMENT THE HIGH BYTE ADORES
DH
=- ===-==-=-=;-------.'.. SET THE CDT_LOC
=-===""--------.
BUA:
MOV
ES; [S j ] , ceaT _LOC _ BASE_H I_BYTE, DH
; SET THE HIGH BYTE
MOV
ES:(SI],CGDT_LOC.BASE_LO_WORD,8X; SET THE lOW WORD

JNe
rue

01('6
OlCC

0105

ISHL
LABEL
SHL
lABEL
ORC
LABEL

DB
AUU

018E
01C2

010A

r

JNP
MOV

0187
01B8
01l1A

MOV
ES; [S I ]. CGDT_LOC. SEG_L I MIT, MAX_SEC_LEN
MOV
ES:! S 11. CCDT ... LOC. DATA_RESOWED, 0
; RESERVED
==="'====-=-====
LOAD THE JOT
MOV
SECOV

R

88 5E 00

BP,OFFSET ROM_,OT_LaC

cs

DB

O?lH

LI DT

[131']

+

DB

+ ??O007

LABEL
MOV
I ABEL
ORC

OOFH
BYTE
BX,WORD PTR [BPj
BYTE
OFFSET CS:??Q007
00111
OFFSET CS; ??0008

+
+ ??0008

+

DB
DRG

26

010B

OF

+
+

01UC
01 DF
01De
01 DC
OIDF

8854 08

+
+

01DF

E8 0000 E

alOe

MOV

[6 70
EB 00
BO 09

+
01

LOAD THE

I DT

REGISTER

FROM lHIS AREA

; -------' LOAD THE CDTR
="="'==="''''-====
SEGOV
ES
; LOAD THE GLOBAL DESCRlPTOR TABLE REG
DB
026H
LCOT
[ S I ] . CGDT _LOC
08
OOFH
??OOOA
l.ABEL
BYTE
MOV
OX,WORD PTR [SI].CGoT_LOC
??OOOB
LABEL
BYfE
OI~G
OFFSET CS: ??OOOA
DB
001 H
ORG
OfFSFT (;S;??OOOB
;------- SET THE DATA SEGMENT TO BIOS RAM
CALL

DDS

;

SET OS TO DATA AREA

;-------- SAVE THE CALLING KOUTINE"S STACK
01E2
01 E4
01[7
01 E9

8C
1\3
8B
A3

01 [C

BC 00

01 EE
01 FO

8A Fli
80 £6 FO

MOV
MOV

DO
0069 R
C4
006! R

MOV

NOV

AX, SS
10 ROM SEC,AX
AX--;-SP 'O_HOM_'N'T,AX

;
;

GET lHE STACK SEGMENT
SAVE STACK S[GI~ENT
SAVE STACK ?OlNTER

PAGE
------- MAKE A 24 BIT ADDRESS OUT OF THE S5 (Sf' REI':AINS USER SP)

01F3
01 F3
01F5
QlF3
01 F3

MOV
MOV
AND

+ ??OOOC
DO EE

+
+ ??ODOD

+
CO

I SHR
LABEL
SHR
I.ABEL
ORC
DB

AX,55
DH,AH
DH,OFOH
DH,4
BYTE
DH,l
leW]l
OFFSET CS: ??OOOC
OCOH

CET THE CURRENT STACK SEGMENT
DEVELOPE THE HIGH BYTE OF THE 24BIT AOOR
USE ONLY THE HIGH NIBBLE
SHI FT RIGr!T

J.

BIOS 1 5-151

OlF'}
01 F5
01F6
01F9
01F9
QHB

ORG

04
80 £4 OF

+
01

+
+ ??001O
+
+ 7?0011

EO

D1F9

01F9
01 F9
OHB
OHB

??OOOF

+

C1
04

4
AH,OQFH
AX,4
BYTE
AX,l
BYTE
OfFSET CS; '?OOOF
NEAR
OC1H
OFFSET CS:7?0010

OB

4

;-------- 55
01FC
0200
0204
020A

26:
26;
26:
26:

88 74
89 44
C7 44
c6 44

OZOF
0214
021A
0220
0225

26:
26:
26:
26:
26:

C6
C7
C7
C6
C7

0226

68 0001

022E
022F
022F
0231
022F
022f
0231

OF

BU:

2C
2A

28 FFff
20 93

OFFSET CS:??OOOO

DB
AND
ISHL
LABEL
SHI
LABEL
ORG
LABEL
DB
ORC

IS NOW IN POSITION FOR A 24 BIT ADDRESS --> SETUP THE OEseR I PTOR

MOV
MOV
MOV
MOV

; -------- STACK
4!~

44
44
44
44

24
22
20
25
26

MOV
MOV
MOV
MOV
MOV

Of
0000
fFFF
96
0000
;------

0231
0232
0234
0236

+

+

?70012

+

BB FO

+ ??0013

+
+

01
EA

ES:[SI[.TEMP_SS.BASE_Hl_BYTE,DH
; SET THE
ES: [ S I I. TEMr _55. BASE_LO_WORD, AX
; SET THE
ES:[SI].TEMP_SS.SEG_LlMIT,MAX_SEG_LEN
; SET THE
ES:[SIJ.TEMP_SS.DATA_ACC_RIGHTS,CPLD_DATA_ACCESS
I S NOW SET

--->

SET UP THE CODE SEGMENT DESCR I PTOR

ES:[Slj.BIOS_CS.BASE_HI_BYTE,CSEG@_HI
; HIGH BYTE OF CS=OF
ES;[Slj.BIOS_CS.BASE_LO_WORD,CSEG@_LO; LOW WORD OF CS;;oO
ES: [S I ]. B I OS_CS. SEG_LI MI T, MAX__ SEG_LEN
ES: I S I 1. B I OS_CS. OAT A_ACC_R I CHTS, CPLO_CODE_ACCESS
ES: I S I 1. BI OS_CS. DATA_RESERVED, 0
; RESERVED

OW

AX, VIRTUAL ENABLE
AX
oorH
BYTE
SI,AX
BYTE
OfFSET CS:7?0012
001H
OFFSET CS:770013
VIRT,BIOS_CS
OEAH
(OFFSET VIRT)
B I OS_CS

MACH I NE STATUS WORD NEEDED TO
SW J TCH TO V I RTUAL MODE

;

MUST PURGE PRE-FETCH QUEUE

; Jump far direct
;
to th i s offset
in this segment

VI RT:
;------- SET STACK SEGMENT

0236
0239

HIGH BYTE
LOW WORD
SS SEGMENT LIMIT
; SET CPL 0

SWITCH TO VIRTUAL MODE
MOV
LMSW
DB
LABEL
MOV
LABEL
ORC
DB
ORC
JUMPfAR
DB

OW

0236 R
0020

STR J PHI GH NIBBLE FROM AH
SHIFT AX

MOV
MOV

B8 0028
BE DO

(NEEDED FOR POSSIBLE EXCEPTIONS)
USER'S SS+SP IS NOT A DESeRI PTOR

AX, TEMP 55
SS,AX -

;------- SETUP SOURCE/TARGET REGISTERS
023B
023E

B8 ~OlO
8E 08

MOV
MOV

AX, SOURCE
DS,AX

GET THE SOURCE ENTRY

0240
0243

B8 0018
8E CO

NOV
MOV

AX, TARGET
ES,AX

GET THE TARGET ENTRY

0245
0247

28 FF
2B F6

SUB
SUB

01,01
SI,SI

0249

F3/ A5

02413
0240
024F

Ell 61
24 CO
"(4 lC

0251
0254
0257
0259
02513
0250

26: 8B 04
26: 89 04
86 05
89 05
BO 01
[6 80

REP

GeT INDEX R[GS TO ZERO
MOVE THE BLOCK

MOVSW

;------- CHECK FOR RAM PARITY BEFORE SHUTDOWN

IN
AND

JZ

GET THE PAR I TY LATCHES
STRIP UNWANTEO BITS
GO I F NO PAR I TY ERROR

AL, PORT_B
AL, PAR I TY ERR
DONEl
-

;-------- CLEAR PARITY BEFORE SHUTDOWN

025F
0261
0263
0265
0267
0269
026B

MOV
MOV
MOV
MOV
MOV

OUT

E4 61

IN

EB 00
OC OC

OR

JMP

OUT

E6 61
EB 00

.JMP

24 F3
E6 61

OUT

AND

FETCH CURRENT TARGET DATA
WRITE IT BACK
FETCH CURRENT SOURCE OATA
WR ITE IT BACK
SET PAR I TY CHECK ERROR

AX,ES:lSI]
ES: SJ LAX
AX,DS: [DI]

r

os: l 01

LAX

AL,Ol
MFG_PORT .AL
AL, PORT B
SHORT $+2
Al, RAM PAR OFF
PORT_S-;AL SHORT $+2
AL, RAM PAR ON
PORT_B-;AL -

10 DELAY
TOGGLE PAR I TY CHECK LATCHES
10 DELAY

; -------- CAUSE A SHUTDOWN
0260

E9 0000 E

DONE1:

JMP

=========-==="'===-=='"
;-------::. RETURN FROM SHUTDOWN
SHUT9:
;------- ENABLE NMI

0270
0270
0272

2A CO
E6 70

0274
0276
0279

Bl~

SUB
OUT

INTERRUPTS

AL, AL
CMOS_PORT, Al

;------- GATE ADDRESS BIT 20 OFF

MOV

AH,OISABLE BIT20
GATE A20
Al,ODONE3
AL, MrG rORT
AL,ODONE3
Al,03H
MFG_PORT,AL

0270
027F
0281
0283
0285

DO
E8 0380 R
3C 00
74 OA
E4 80
3C 00
75 04
80 03
E6 80

0287

,E8 0000 E

GALL

ODS

SET OS TO DATA AREA

02BA
0280

A 1 0069 R
8E DO

lolOV
MOV

AX, 10_ROM_SEG
SS,AX

SAVE STACK SEGMENT
RI:.SrORE lHE STACK POINTER

028F
0292

Al 0067 R
8B EO

MOY
MOV

AX,IO_ROM_INIT
SP,AX

0294

1f

DU6

CALL
CMP
JZ
IN
CMP
J NZ
MOV
OUT

COMMAND ACCEPTED?
GO I F YES
CH[CK rOR eRROR
WAS THERE AN ERROR?
GO IF YES
SET ERROR FLAG

; -------- RESTORE USERS STACK
OONE3 :

;------- RESTORE THE USER DATA SEGMENT

5-152

POP

BIOS 1

OS

;

RESTORE USER DATA SEGMENT

0295

07

por

ES

0296
0297

61
86 C4

POPA
OB
XGHG

061H
Al,AH

0299
0298
0290
029F
02AD

IN

£4 80
3C 00
86 EO

eM'

XGHG
511
IRET

FB
CF

RESTORE USER EXTRA SEGMENT
RFSTORE THE GENERAL PURPOSE REGS
SAVE AL
CHECK THE END I NG STATUS
SET THE ZERO FLAG
RESTORE AL
TURN INTERRUPTS ON
RETURN TO USER

Al,MFG_PORT
Al,O
AH,AL

;-------- ROM lOT LOCATION

EQU

"" 0100

ROM_lOT_LEN

D2Al

ROM_lOT _LOC:

02Al
Q2A3
Q2AS
Q2A6

DB
DB

OF

00

;-------- THE ROM EXCEPTION

02A?
03A7 R
0020
00

02AC
02AD

87
0000

02AF
02B1
02B3

03A7 R
0020
00

02B4
02B5

87
0000

02B7
02B9
028B

03A7 R
0020
00

02BC
02BO

87
0000

02BF
02el
02C3

03A7 R
0020
00

02C4
02C5

87
0000

02C7
02C9
02CB

03A7 R
0020
00

02CC
02CO

87
0000

02CF
021)1
0203

03A7 R
0020
00

02D4
0205

87
0000

02D7
0209
020B

03.l\7 R
0020
00

02DG
0200

87
0000

020F
02E1
02E3

03A7 R
0020

02£4
02E5

87
0000

02E7
02E9
02EB

U3Al R
0020
00

02EC
02EO

87
0000

02EF
02Fl
02F3

03A7 R
0020
00

02F4
02F5

87
0000

oa {
02F9
02FB

U3A7 R
0020
00

02FC
02FO

87
0000

02FF
0301
0303

03A? R
0020
00

0304
0305

87
0000

U307
0309

03A7 R
0020

02A7
02A9

INTERRUPTS

lOT GOT OEF
ROM_IOT_LI::N,ROM_IOT,CSEG@_HI
DW -ROM lOT [EN
; Segfilent lim i t
ow
ROM::::IDT; Segment base address - low word
CSEG@ H I ; Segment ba se add ress - high byte
0
; Rese rved

0100
02A7 R

02AS

SIZE OF THE EXCEPT I ON

32*8

+

+

+

+

+

+

+

00

INTERRUPT VECIORS

ROM t DT:
;EXCEPTION 00
DESCR_DEF GATE, EX_I NT, B I OS__ CS, 0 , TRAP_GATE
UW
EX INT
Destination offset
OW
BIOS_CS
Destination segment selector
DB
a
Word count for stack-to-stack
nges)
DB
TRAP GATI::
; Access rights byte
OW
0
Reserved
;EXCEPTION 01
DESCR_DEf GATE, EX_INT,BIOS_CS,O, TRAP_GATE
Ow
EX INT
; Destination offset
Ow
BIOS CS
Destination segment selector
DB
0
Word count for stack-to-stack
nges)
DB
TRAP_GATf
; Access rights byte
Ow
0
Rese rved
; EXCEPT I ON 02
DESCR_DEf GATE, EX_I NT, B I OS_CS, 0, TRAP_GATE
OW
EX INT
Destination offset
OW
BIOS CS
Destination segment selector
DB
0
Word count for stack-to-stack
nges)
DB
TRAP GATE
; Access rights byte
ow
0
Reserved
;EXCEPTION 03
DEseR_DEF GATE, EX_I NT, B I OS_CS,
TRAP_GATE
Ow
EX tNT
Destination offset
OW
BIOS_CS
Destination segment selector
DB
0
Word count for stack-to-stack
nges)
DB
TRAP GATE
; Access rights byte
Ow
0
Reserved
; EXCEPT I ON 04
DEseR_DEf GATE, EX_ j NT, B I OS_CS. 0, TRA? _CATE
OW
EX INT
; Destination offset
OW
BIOS CS
; Destination segment selector
DB
0
; Word count for stack-to-stack
nges)
DB
TRAP_GATE
; Access rights byte
OW
0
; Reserved
; EXCEPT I ON 05
OESCR_DEF GATE,I::X_INT,BIOS_CS,O, TRAP_GATE
OW
EX INT
; Destination offset
OW
BIOS CS
; Destination segment selector
DB
0
Word count for stack-to-stack
nges)
DB
TRAP_GATE
; Access ri ghts byte
OW
0
Rese rved
;EXCEPTION 06
OESCR OEF GATE,EX INT,BIOS CS,O,TRAP GATE
• OW
EX INT
; Destination of'fset
OW
BIOS CS
; Destination segment selector
DB
0
Word count for stack-to-stack
nges)
DB
TRAP GATE
; Access rights byte
OW
0
; Rese rved
; EXCEPT I ON 07
oESeR_OEF GATE, EX_I NT. B i OS_CS, 0, TRAP_GATE
DW
EX INT
. Destination offset
OW
BIOS_CS
Destination segment selector
DB
0
Word count for stack-to-stack
nges)
DB
TRAP GATE
; Access ri ghts byte
DW
Rese rved
; EXCEPTION 08
DESCR_DEr GATE, EX_I NT. B !OS_CS,O, TRAP_GATE
OW
EX INT
; Destination offset
OW
BIOS_CS
Destination segment selector
DB
0
word count for stack-to-stack
nges)
DB
TRAP_GATE
; Access rights byte
OW
Q
Re se rved
; EXCEPT I ON 09
DESCR_DEF GATE, EX_I NT. 81 OS_CS,0, TRAP _GATI::
DW
EX INT
; Destination offset
OW
BIOS_CS
; Destination segment selector
06
0
; Word count for stack-to-stack
nges)
DB
TRAP GATE
; Access rights byte
OW
0
Reserved
; EXCEPT I ON 10
OESCR_OH. GATE, EX_I NT, 61 OS_CS,D, TRAP_GATE
OW
EX INT
Destination offset
OW
BIOS CS
Destination segment selector
DB
Word count for stack-to-stack
nges)
DB
TRAP_GATE
; Access rights byte
Ow
0
Reserved
; EXCEPTION
DESCR_DEF GATE, EX_I NT, BI OS_CS, 0, TRAP_GATE
DW
EX INT
Destination offset
Ow
BIOS_CS
Destination segment selector
DB
0
Word count for stack-to-stack
nges)
DB
TRAP GATE
; Access rights byte
Ow
0
Reserved
;EXCEPTION 12
OESCR_OEF GATE, EX_I NT, 81 OS_CS,O, TRAP_GATE
OW
EX INT
; Destination offset
OW
BIOS_CS
; Destination segment selector

copy (only for call

gates when PL cha

copy (only for cal I gates when PL cha

copy (only for call

gates when PL cha

°,

copy (only for call gates when PL cha

copy (only for call gates when PL chB

copy (only for call

gates .... hen PL cha

copy (only for call

gates .... hen ?L cha
'l'

copy (only for call gates ""hen PL cha

° -

+

+

+

° -

copy (only for call gates ....hen Pl cha

copy (only for call gates ....hen PL cha

copy (only for ca I I gates when PL cha

'1

+

copy (only for call gates ....hen PL cha

BIOS 1 5-153

030B

00

U3UC
03UO

87
0000

U3{]F
0311
0313

G3A7 R
0020

0311,
0315

87
0000

0317
0319
031B

03A? R
0020

031C
0310

87
0000

031 F
0321
0323

03A7 R

0324
0325

87

032?
0329
032B

03A? R
0020

032C
0320

87
0000

032F
0331
0333

03A? R
0020

0334
0335

87
0000

0337
0339
0338

03A7 R
0020

033C
0330

87
0000

033F
0341
0343

03A? R
0020

031~11

8-(
0000

Word count for stack-to-stack copy (only for call

08

gates when PL cha

nges)

0345

08
OW

+

00

+

00

+

0020

00
0000

+

00

+

00

00

+

00

0347
031.9
0348

03A7 R
0020

03/IC
0340

87
0000

034F
0351
0353

G3A? R
0020

0354
0355

87
0000

0357
0359
0356

G3A7 R
0020

035C
0350

07
0000

035F
03fil
0363

03AI R

036 1,
0365

87
0000

0367
0369
0368

03A7 R
0020

03GC
0360

87
0000

036F
0371
0373

03A7 R
0020

0374
0375

87
0000

0377
0379
0378

U3A? R
0020

037C
0370

87
0000

OHF
0381
0383

G3A7 R
0020

0384
0385

87
0000

+

00

+

00

+

00

no?o

+

+

00

+

00

00

5·154

~

CATE

; Access
Reserved

rights byte

; EXCEPT ION 13
DESCR_OEF
GATE, EX_I NT, B I OS_CS, 0, TRAP_GATE
OW
EX INT
Destination offset
OW
BIOS GS
LJestin"tlon segment selector
DB
0
Word count for !;tack-to-stack
ngesJ
DB
TRAP GATE
; Access rigtns byte
ow
0
Reserved
;FXCEPTION 14
OESCR_DE F GAfE, EX_I NT, B I OS_CS, 0 , TRAP_GATE
OW
EX INT
Destination offset
DW
BIOS CS
Destination segment. selector
OIJ
0
Word count for StaCk-to-stack
ngesJ
DB
TRAP GATE
; Access rights byte
OW
0
Rese rved
;EXCEPTJON 15
OESCR_DfF
GATE, EX_I NT, 8 I OS_CS, 0 , TRAP_GATE
OW
EX INT
Destination Offset
OW
BIOS CS
Destination segment selector
08
0
Word count for stack-to-stacK
ngesJ
DB
TRAP GATE
; Access rights byte
OW
0
Reserved
;EXGEPTION Hi
OESCR_OEF
GATE, EX_INT,BIOS_.CS,O, TRAP_ .. CATE
OW
EX INT
Destination offset
OW
BIOS CS
Destination segment selector
DB
0
Word count for stack-to-stack
nges)
DH
rRAP GATt:
; Access rights byte
OW
0
Reserved
;EXCEPTION 17
DESCR_OfF
GATE, £X_I NT ,B I OS_CS, 0 , TRAP_GATE
DW
EX INT
Destinat ion offset
OW
BIOS es
Destinatiun segment selector
DB
0
Wo rd count fa r s tack-to- stack
nges)
DB
TRAP GATE
; Access rights byte
OW
0
Rese rved
;EXCEPTJON 18
OESCR_DEF
GATE, EX_I NT, B lOS_CS, 0 , TRAP_GATE
OW
EX INT
Destination offset
OW
BIOS_CS
Destination segment 5elector
DB
0
Word count for stack-to-stack
nges)
DB
TRAp GATE
; Access rights byte
OW
0
Rese rved
;EXCEPTION 19
CESCR_DEF
GATE, EX_I NT ,B I OS_CS, 0 , TRAP_GATE
OW
EX INT
Destination offset
OW
BIOS CS
Destination segment.. ~",I",ctur
DB
0
Word count for stack-ta-stack
nges)
DB
TRAP GATE
; Access rights byte
OW
0
Reserved
;EXCEPTION 20
OESeR_OEF
GATE, EX_I NT, B I OS_CS, 0, TRAP _GATE
OW
EX_INT
Destination off"set
OW
BIOS CS
Destination segment selector
DB
0
Word count for stack-to-stack
ngesJ
DB
TRAP GA I t . ; Access ri ghts byte
OW
0
-Reserved
;EXCEPTION 21
DESCR_OEF
GATE, EX_I NT, B I OS_CS, 0 , TRAP_GATE
DW
EX INT
Destination offset
OW
BIOS CS
Destination segment.. :;.eluctur
DB
0
Word count for stack-to-stack
nges)
DB
TRAP CAT[
; Access rights byte
OW
0
Reserved
; EXCEPT I ON 22
DESCR_OEF
GAl (, EX_I NT, B I OS_CS, 0 , TRAP_GATE
DW
EX INT
Destination offset
DW
BIOS CS
Destination segment selector
DB
0
Word count for stack-to-stack
nges)
; Access rights byte
TRAP GATE
DB
~
Reserved
OW
;EXCEPTION 23
DESeR_OEF
GATE, EX_I NT, B I OS_CS, 0 , TRAP_GATE
OW
EX INf
Destination offset
OW
BIOS CS
De~tinntion segment selector
DB
0
Word count for stack-to-stack
ngesJ
DO
TRAP GATE
; Access rights byte
OW
0
Re::;e rved
;EXCEPTION 24
OESeR_DE r
GATE, EX_I NT, III OS_CS, 0, THAP _GATE
OW
EX INT
Destination offset
OW
BIOS CS
Destination segment selector
DB
0
Word count for stack-ta-stack
ngesJ
DEl
TRAP GATE
; Access rights byte
OW
0
Rese rved
;EXCEPTION 25
DESCR_OEF
GATE, EX_I NT, B I OS_CS, [) , TRAP_GATE
OW
EX INT
Destination offset
OW
RIDS CS
Destination segment ~elector
DB
0
Word count for stack-to-stack
nges)
; Access rights byte
TRAP GATE
OB
~
Reserved
OW
;EXCEPTION 26
OEseR_OEf
GATE, EX_I NT, 8 I OS_CS, 0, TRAP_GATE
OW
EX INT
Destination offset
DH
BIOS CS
Destination segment selector
DB
Word count for stack-to-stack
nges)
; Access rights byte
DB
TRAP GATE
~
Reserved
OW
; EXCEPT I ON 27
DESGR_DEF
GATE, EX_I NT, B I OS_CS, 0, TRAP_GATE
OW
EX INT
Destination offset
OW
BIOS CS
Destination segment selector
DB
0
Word count for stack-to-stack
nges)
; Access rights byte
08
oTRAP ~ GATE
Reserved
OW
; EXCEPT I ON 28
GA I E, EX_I NT, B I OS_CS, 0, TRAP_GATE
DESGR._lJU

copy (only for call

gates when

copy (only for

II

gates when PL cha

copy (only for call

gates when PL cha

copy (only for ca II

gates when PL cha

copy (on I y

CB

PL cha

fo r ca I J ga tes ... hen PL cha

copy (only for ca II

gates ... hen PL cha

copy (only for ca II

gates when

PL cha

copy (only for ca II gates when

PL cha

copy (only for ca II gates 'When

PL cha

copy (only for ca II gates 'When

PL cha

copy (only for ca II

gates 'When

PL cha

copy (only for ca II

gat.es when PL cha

copy (only for ca II

gates ""hen PL cha

copy (only for call

gates when PL cha

copy (only for call

gates when PL cha

o

00

00

oTRAP

o

+

° o

BIOS 1

0387
0389
038B

03A7 R
0020

OW
OW

00

DB

038C
038D

87

038F
0391
0393

03A7 R
0020

0394
0395

87

0397
0399
039B

03A7 R
0020

EX INT
BIOS CS

o

Destination offset
Destination segment selector
Word count for stack-to-stack copy (only for ca II gates \t{hen PL cha

-

nges)

039C
039D

0000

00
0000

00
87
0000

039F
03Al
03A3

03A7 R
0020

03A4
03A5

87
0000

00

DB
TRAP GATE
; Access rights byte
OW
0
Reserved
;EXCEPTION 29
OESCR DEF
GATE,EX INT,BIOS CS,O,-fHAP GATE
OW
EX INT
Destination offset
OW
BIOS_CS
Destination segment selector
DB
0
Word count for stack-to-stack copy (only for ca II gates when PL cha
nges)
DB
TRAP GATE
; Access rights byte
OW
0
Reserved
; EXCEPT ION 30
O(SCR_DEF
GATE, EX_I NT, B I OS_CS, D , TRAP_GATE
OW
EX INT
Destination offset
OW
BIOS_CS
Destination segment selector
DB
0
Word count for stack-to-stack copy (only for ca II gates when PL cha
nges)
DB
TRAP GATE
; Access rights byte
OW
0
Reserved
;EXCEPTION g1
DESCR_DEF
GAl 1:., EX_I N'I ,B I OS_CS, 0 , TRAP_GATE
OW
EX INT
Destination offset
OW
BIOS_CS
Destination segment selector
DB
0
Word count for stack-to-stack copy (only for ca II gates when PL cha
nges)
DB
TRAP_GATE
; Access rights byte
OW
Reserved

o

;------- EXCEPTION
03A7
03A7
03A9
03AS
03AE
03AE

INTERRUPT HANDLER

rX_1NT:
BO 02
E6 80
E9 0000 E

AL,02H
MFG_PORT,AL
PROC_SHUTDOWN

MOV
OUT
JMP

SET EXCEPTION

INT

CAUSE A EARLY SHUTDOWN

EX_I NTl
EB FE

EX_I NTl

JMP
BLOCKMOVE
PAGE

03BO

STAY HERE TILL SHUTDOWN

END?

GATE A20
- TH I S ROUT I NE CONTROLS A SIGNAL WH I CH GATES ADORFSS BIT 20.
THE GATE A20 SIGNAL IS AN OUTPUT OF THE 8042 SLAVE PROCCESSOR.
ADDRESS BIT 20 SHOULD BE GATED ON BEFORE ENTERING PROTECTED MODE.
IT SHOULD BE GATED OFF AFTER ENTERING REAL MODE FROM PROTECTED
MODE.
INPUT
(AH)"'DOH ADDRESS BIT 20 GATE OFf. (A2D ALWAYS ZERO)
(AH)=DFH ADDRESS BIT 20 GATE ON. (A20 CONTROLLED BY 80286)
OUT PUT
(AL)",O OPERATION SUCCESSFUL. 8042 HAS ACCEPTED COMMAND.
(AL)=2 FAILURE--8042 UNABLE TO ACCEPT COMMAND.

-------------------------------------------- --------- ------PROC

GATE A20

03BO
03BO
03B1
0384
03B6
03B8
03BA
0313D
03SF
03C1
03C3

E8
75
BO
E6
E8
75
8A
[6
E8

03C6
03C6

e3

-

FA

03C7 R
~

0

01
64
03C7 R
07
C4

CLl

--------

; 0 I SABLE INTERRUPTS WH I LE USI NG 8042
EMPTY._8042
; INSURE 8042 I N PUT BUFFER EMPTY
GATE A20 RETURN ; RETURN IF 8042 UNABLE TO ACCEPT COMMAND
AL, 051 H ; 8042 COMMAND TO WR I TE OUTPUT PORT
STATUS_PORT, AL
; OUTPUT COMMAND TO 8042
EMPTY_8042
;WAIT FOR 8042 TO ACCEPT COMMAND
JNZ
GATE_A20_RETURN ;RETURN IF 8042 UNABLE TO ACCEPT COMMAND
MOV
AL, AH
; 8042 PORT DATA
OUT
PORT A,AL
;OUTPUT PORT DATA TO 8042
CALL
EMPTY_8042
;WAIT FOR 8042 TO ACCEPT PORT OATA

CALL

JNZ

Mav

OUT

CALL

60
oge7 R

80l.j2 OUTPUT WILL SWITCH WITHIN 20 USEC OF ACCEPTING PORT DATA ----GATE A20 RETURN:
'RET

;

--EMPTY
--- ------- -----------.- ------------------ - ------------------ - ---------8042
-THIS ROUTINE WAITS FOR THE 8042

INPUT BUFFER TO EMPTY.

INPUT
NONE
OUTPUT
(AL)",O 8042 INPUT BUFFER E~IPTY (ZERO FLAG SET)
(AL)=2 TIME OUT, 8042 INPUT BUFFER FULL (NON-ZERO fLAG SET)
03C7
03C?
03C8
03CA
03CA
03CC
03CE
0300
0301

51
2B C9
E4 64
24 02
EO ~A

EMPTY 80112:
PUSH
SUB
EMPTY LOOP:
IN
AND

59

LOOPNZ
POP

e3

RET

ex

cX,ex

; SAVE CX
;CX=O, WILL BE USED AS TIME OUT VALUE

AL, STATUS_PORT
; READ 8042 STATUS PORT
AL,INPT_BUF_FULL;TEST INPUT BUFFER FULL FLAG (BIT 1)
EMPTY LOOP
;LOOP UNTIL INPUT BUFFER EMPTY OR TIME OUT
CX
; RESTORE ex

GATE A20
ENDP
PAGE;------ INT 15 (FUNCTION 88H - 10 MEMORY SIZE DETERMINE) -------EXT MEMORY
TH I S ROUT I NE RETURNS
THE AMOUNT Of MEMORY I N TilE
SYSTEM THAT IS LOCATED STARTING AT THE 10241( ADDRESSING
RANGE, AS DETERMINED BY THE POST ROUTINES.
NOTE THAT THE SYSTEM MAY N01 BE ABLE TO USE 110 MEMORY
UNLESS THERE IS A FULL COMPLEMENT OF 5121< OR 640 8YTES
ON THE PLANAR.
THIS SIZE IS STORED IN CMOS AT ADDRESS
30 AND 31.
INPUT
AH ~ 88H

0302

THE 10 MEMORY SIZE VARIABLE IS SET DURING POWER ON
DIAGNOSTICS ACCORDING TO THE FOLLOWING ASSUMPTIONS:

3. AI t. I NST ALLED MEMORY IS FUNCT I ONAL.

4. ALL MEMORY FROM 0 TO 640K MUST BE CONT I GUOUS.
OUTPUT

(AX) = NUMBER OF CO NT I GUOUS 1 I( BLOCKS OF MEMORY A
AVAILABLE STARTING AT ADDRESS 1024K.

0302
0302
0303
0305
0307
0309
0308
0300
03DF

~~;:-MEM~~~

FB
BO
E6
EB
E4

31
70

00
71

86 C4
BO 30
E6 70

------ ;~~c ---------------------------- ----------------

ST I
MOV
OUT
JMP
IN
XCHG
MOV
OUT

AL,31H
CMOS_PORT, AL
SHORT $+2
AL,CMOS_PORT+l
AL,AH
Al,30H
CMOS_PORT, AL

I NTERRUPTS BACK ON
GET THE HIGH BYTE OF 10 MEMORY
10 DELAY
PUT HIGH BYTE IN POSITION (AH)
GET THE LOW BYTE OF 10 MEMORY

BIOS 1 5-155

03£1
03£3
03£5
03£6

EB 00
£I~ 71

JMP
SHORT $+2
10 DELAY
IN
AL, CMOS_PORT+l
I RET
RETURN TO USER
ENDP
EXT M£MORY
PAGE
INT 15H (FUNCTION 89H) --------------------------------PURPOSE:
THIS BIOS FUNCTION PROVIDES A MEANS TO THE USER TO
SWITCH IN~O VIRTUAL (PROTECTED) MODE.
UPON COMPLETION
OF THIS FUNGTION THE PROCESSOR WILL BE IN VIRTUAL
(PROTECTED) MODE AND CONTROL WILL BE TRANSFEREO TO THE
CODE SEGMENT THAT WAS SPEC I F I EO BY THE USER.

CF

ES:SI POINTS TO A DESCRIPTOR TABLE (GOT) BUILT BEFORE
INTERRUPTI NG TO TH I S FUNCT ION.
THESE DESCR I PTORS ARE
ARE US£D BY THIS FUNCTION TO INITIALIZE THE IDTR, THE
GDTR AND THE STACK SEGMENT SELECTOR.
THE DATA SEGMENT
(OS) SELECTOR AND THE EXTRA SEGMENT (ES) SELECTOR WILL
BE INITIALIZE TO DESCRIPTORS BUILT BY THE ROUTINE USING
TH I S fUNGT.! ON.
BH - OFfSET I NTO THE INTERRUPT DESCR I PTOR TABLE
STATING WIJERE THE FIRST EIGHT HARDWARE INTERRUPTS
WILL BEGIN. ( INTERRUPT LEVEL 1 )
BL - OffSET INTO THE INTERRUPT DESCRIPTOR TABLE
STATING WHERE THE SECOND EIGHT HARDWARE
INTERRUPTS WILL BEGIN. ( INTERRUPT LEVEL 2
THE OESCR I PTORS ARE DEF I NED AS FOLLOWS:
1•

2.
3.

4.
5.
6.

7.
8.

NOTE -

THE FIRST OESCR I PTOR I S THE REQU I RED ~UMMY.
(USER INITIALIZED TO 0)
THE SECOND DESCRIPTOR POINTS TO THE GOT TABLE AS
A DATA SEGMENT.
(USER INITIALIZED)
THE TH I RD DESCR I PTOR PO I NTS TO THE USER OEF I NED
INTERRUPT DESCRIPTOR TABLE (lOT).
(USfR INITIAI17fD)
THE FORTH DESCRIPTOR POINTS TO THE USER'S DATA
SEGMENT (OS).
(USER INITIALlZ£D)
TIlE fiFTH DESCR I PTOR PO I NTS TO THE USER'S EXTRA
SEGMENT (ES I.
(USER INITIALIZED)
THE SIXTH DESCR I PTOR PO I NTS TO THE USER I S STACK
SEGMENT (SS I.
(USER INITIALIZED)
THE SEVENTH DESGR I PTOR PO I NTS TO THE CODE SEGMENT
THAT THIS fUNCTION WILL IlCTUIlN TO.
(USER INITIALIZED TO THE USER'S CODE SEGMENT.)
THE EIGTH DESCRIPTOR IS USED BY THIS FUNCTION TO
ESTABLI SH A CODE SEGMENT fOR ITSELf. TH r S r S
NEEDED SO THAT THIS fUNCTION CAN COMPLETE IT'S
EXECUT I ON WH I LE I N PROTECTED MODE.
WHfN CONTROl
GETS PASSED TO THE USER'S CODE TH I S DESCR I PTOR CAN
BE USED BY HIM IN ANY WAY HE CHOOSES.
EACH DESCRIPTOR MUST CONTAIN ALL THE NECESSARY
:
I.E. THE LIMIT,
BASE ADDRESS AND THE ACCESS:
DATA
RIGHTS BYTE.
:

AH=68H
(rUNClI ON CALL I
ES:SI = LOCATION OF THE GOT TABLE BUILD BY ROUTINE
USING THIS fUNCTION.
EXIT PARAMETERS:
AH = a
I f SUCCESSfUL
ALL SEGMENT REG I STERS ARE CHANGED, AX AND BP DESTROYED
CONSIDERATIONS;
1.
2.

3.
4.
5.

NO B I OS AVA I LABLE TO USER.
USER MUST HANDLE ALL
10 COMMANDS.
INTERRUPTS - INTERRUPT VECTOR LOCATIONS MUST BE
MOVED,
DUE TO THE 286 RESERVED AREAS.
THE
:
HARDWARE I NTERRUPT CONTROLLERS MUST BE RE I NIT r ALI ZED:
TO DEFINE LOCATIONS THAT 00 NOT RESIDE IN THE 286
RESERVED AREAS.
EXCEPTION INTERRUPT TABLE AND HANDLER MUST BE
INITIALIZED BY TIlE USER.
lilE INTERRUPT OESCR I PTOR TABLE MUST NOT OVERLAP
HIE REAL MODE BIOS INTERRUPT DESCRI PTOR TABLE.
THE fOLLOWING GIVES AN IDEA OF WHAT THE USER CODE
SHOULD LOOK LIKE WHEN INVOKING THIS FUNCTION.

Rea I mode

-;;->

Vi rtua I mode --->

"USER
MOV
MOV
MOV
MOV
MOV
MOV
I NT
lIUSER

CODE"
AX, GOT SEGMENT
ES,AX
SI,GDT OFFSET
BH, HARDWARE I NT LEVEL 1 OFFSET
BL, HARDWARE I NT LEVEL 2 OfFSET
AH,88H
1511
CODE"

DESCRI PTlON:

1.
2.

3.

IJ..

5.
6.
7.
8.
9.
10.
11.
12.

CLI (NO INTERRUPTS ALLOWED) WHILE THIS FUNCTION IS
EXECUT I NG.
ADDRESS LINE 20 IS GATED ACTIVE.
THE CURRENT USER STACK SEGMENT DESCR t PTOR IS
INITIALIZED.
TilE GDTR I S LOADED WITH THE GOT BASE ADDRESS.
THE tDTR IS LOADED WITH THE lOT BASE ADDRESS.
THE 8259 IS REINITIALIZEO WITH THE NEW INTERRUPT
OFFSETS.
THE PROCESSOR I S PUT I N V I RTUAL MODE WI TH THE CODE
SEGMENT DES I CNATED FOR TH I S FUNCT I ON.
DATA SEGMENT IS LOADED WITH THE USER DEFINED
SELECTOR FOR THE OS REGI STER.
EXTRA SEGMEtiT I S LOADED WITH THE USER OEF I tiED
SELECTOR FOR THE ES REGISTER.
STACK SEGMENT IS LOADED WITH THE usm DEFINED
SELECTOR fOR THE SS REGISTER.
CODE SEGMENT DESCR I PTOR SELECTOR VALUE IS
SUBSTITUTED ON THE STACK FOR RETURN TO USER.
WE TRANSFER CONTROL TO THE USER WITH 1NTERRUPTS
01 SABLED •

. ------- ---- ----------------------------------------------- - -----

page

THE FOLLOWING DIAGRAM DEPICTS THE ORGANIZATION
Of GOT.

5-156

BIOS 1

GOT

(ES; S I)

--»

+00

i

i

DUMMY

1

1

+08 1----------------1
1
GOT
I
+10

1
1
1----------------1

1
1

I
1

lOT

+18 1----------------1
I
OS
1

1

1

+20 1----------------1
1
ES
1
+28

1
1
1----------------1
I

1

SS

1

1

1

I

+30 1----------------1
1
' CS
I
+38 1----------------1
1
TEMP BIOS
I
J
CS

!

THE GLOBAL OESCR I PTOR TABLE (ACTUAL LOCAl ION POI N II:J) TO BY [S: S I)
V I RTUAL_ ENABLE_GDT_OEF
0000
0008
0010
0018
0020
0028
0030
0038

00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00

00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00

GUMY

DC!

FIRST DESCII I ['TOrt NOT ACCESS I BlE

00 00 00 00

GDTPTR

00

GDT DESCR I PTOR

00 00 00 00

lOT PTR

DO

lOT DEseR I PTOR

00 00 00 00

USER - OS

DO

USER DATA SEGEMNT DESCRITOR

00 00 00 00

USER - ES

DO

USER EXTRA SEG;'lEN r OEseR I nOR

00 00 00 00

USER SS

00

USER STACK SEGMENT DEseR J PTOR

00 00 00 00

USER_ CS

00

USER CODE SEGMENT OEseR I PTOR

00 00 00 00

B1O_CS

00

TEMPORARY B I OS OESCR I PTOR

V I RTUAL - ENABLE - GDT_OEF

0040

ASSUME
ASSUME
03(6
03£6
03£6

STRUC

00 00 00 00

X VI RTUAL
SET_VMODE:

ENDS

CS: CODE
as: DATA
PROC

FAR

eLi

FA

NO I NTERRU PTS ALLOWED

;------- ENABLE ADDRESS LATCH BIT 20
03E7
03£9
a3EC
03[[
03 ~o
03 F2
03F3

BIt
£8
3C
74
B4

OF
03BO R
00
04
FF

MOV
CALL
CMP

J7
MOV
STC
I RET

F9
CF

03 F4

BIT20 ON:
SFGOV

03f4

26

03F5
03F6
03F6
03F9
03f6
03F6
03f9

OF

03 f9

26

03fA
03fB
03FB
03 FE
03FB
03FB
03FE

OF

DB

+
+ ??0015

8B 54 08

t-

+ ??0016
+
01

ORG

SEGOV
OB
LIDT

8B 5C 10

+
+ ??0018
+
+ ??0019
+

01

+

0 /102
0404
01~O6

0408
040A
all DC
040E

0 1110
0412
0414
0416
0418

BO
E6
EB
8A
E6
E8
60
E6
E6
60
E6
EB
60
£6

11
20
00
C7
21
00
04
21
00
01
21
00
Ff
21

60 11

LABEL
MOV
LABEL
aRC

OUT

JMP
MOV
OUT

JMP

Mav
aUT

JMP

Mav
OUT
JMP

MOV
OUT

LOAD THE GLOBAL OEseR I nOR TABLE REG

ES

;

ES

LOAD THE

INTERUPT OEseR I PTOR TABLE REG

026H
[Slj.IDTPTR
OOFH
BYTE
BX, WORD PTR [S I J. lOT PTR
BYTE
OFFSET CS: ??0018

00lH
OFFSET cs: ??0019
INTERRUPT CONTROLLER #1 TO TII( USER SPECIFI[[) OFFSET

AL,111l
I NTADO,AL
SHORT $+2
AL, BH
INTA01,AL
SHORT S+2
AL,04H
INTA01,AL
SHORT $+2
AL,OlH
INTA01,AL
SHORT S+2
AL, Of FH
INTA01,AL

REINJTIALIZE THE 8259
MOV

ENABLE BIT 20 FOR ADDRESS GATE
WAS THE COMMAND ACCE PTED?
GO I f YES
SET THE ERROR FLAG
SET CARRY
EARLY EXIT

0261t
[ SI].CDTPTR
OOFH
BYTE
OX, WORD PTR [S I j. GOTPTR
BYTE
OFFSET CS:??OD15
00111
OFFSET CS: ??0016

Rf:.INITIALIZE THE 8259
t10V

;
041A

DB

DB
ORG

;
03FE
0400

LCDT
OB
LABEL
MOV
LABEL
ORC
OB

AIt, ENABLE B I T20
GATE A20 AL,OBIT20 ON
AII,orrll

AL,11H

1

START INiTiALIZATION SEQUENCE-ICW1
EDGE, I NTERVAL-8, MASTER, lCW4 NEEDED
HARDWARE INT'S START AT
SEND I CW2

INT

SEND ICW3 -

MASTER LEVEL 2

SEND

MASTER,8086 MODE

I CW4 -

#

(BH)

MASK OFF ALL INTERRUPTS

INTERRUPT CONTROLLER #2 TO THE USER SPECIFIED OFFSE'l
;

START

I NIT SEQUENCE-I CW1

FOR SLAVE

BIOS 1 S-lS7

O41C
041E
0420
0422
0424
0426
0428
042A
042C
o42E
0430
0432
0434

E6
EB
SA
E6
BO
EB
E6
EB
Bo
E6
EB
80
E6

AD
00
C3
A1
02
00
A1
00
01
Al
00
FF
A1

0436
043C
0441

26: C7 44 36 FFFF
26: c6 44 3C OF
26: C7 44 3A 0000

MOV
MOV
MOV

0447
044C

26: c6 44 3D 98
26: C7 44 3E 0000

MOV
MOV

0452

88 0001

Q455
0456
0456
0458
0456
0456
0458

OF

OUT
JMP
MOV
OUT
MOV
JMP
OUT
JMP
MOV
OUT
JMP
MOV
OUT

-

~ -sEj~;-B~OS-CODE SEGME~T-DEsc;;

;

;
;

0456
0459
045B

+

??OOlB

EA

0450 R
0036

88
8E
B8
6E
B8
BE

SLAVE,8086 MODE

7;;:0;;------------------------------------------

; SET LENGTH
; SET HIGH BYTE OF CS=OF
; SET LOW WORD OF CS=O
; SET ACCESS RIGHTS BYTE
ES: [SI J. B 10.CS. OATA.ACC.RI GHTS,CPLO.CODE_ACCESS
ES: [SI J.BIO.CS.DATA.RESERVED.O
; ZERO RESERVED AREA

MOV
LMSW
DB
LABEL
MOV
LABEL
ORG
DB
ORG
JUMPFAR
DB
OW
OW

AX, V I RTUAL ENABLE
AX
OOFH
BYTE
SI,AX
BYTE
OFFSET CS:?70D1A
00lH
OFFSET CS:170D1B
VMOOE,BIO.CS
OEAH
(OFFSET VMODE)
BIO_CS

~ -;E;~;- ~;ER-;EG~EN;

0450
0460
0462
0465
0467
046A

SEND I CW4 -

MASK Off ALL INTERRUPTS

ES:[SI J.BIO.CS.SEG.LIMIT,MAX.SEG.LEN
ES: [SIJ.BIO.CS.BASE.HI.BYTE,CSEOO.HI
ES: [SI J.BIO.CS.BASE.LO.WORD,CSEOO.LO

VMDDE:

;

SLAVE LEVEL 2

ENABLE PROTECTED MODE

01

0450

SEND I CW3 -

-- -------- --.----------------------------------- ----------------- ------------

+

:

ICW4 NEEDED

IIARDWARE INT'S START AT tNT II (BL)
SEND JCW2

------------------------------------------------ --- -------------- --------- ---

+ ??OOlA

88 Fa

EDGE~ INTERVAL-8,MASTER~

INTBOO,AL
SHORT $+2
AL,BL
I NTB01,AL
AL,02H
SHORT $+2
INTB01,AL
SHORT $+2
AL,OlH
INTB01,AL
SHORT $+2
AL,OFFH
INTB01,AL

; MACHINE STATUS WORD NEEDED TO
;
SWITCH TO VIRTUAL MODE

; MUST PURGE PRE-FETCH QUEUE
; Jump far direct
;
to th i s offset
in th j s segment

-REG 7;;ER;---------- ---- ---- --- ------- --------------- -----

------------------ -----._----_.------------------------ -- ---------------_._-MOV
MOV
MOV
MOV
MOV
MOV

0018
08
0020
CO
0028
DO

AX. USER_OS
OS,AX
AX. USER_ES

SETUP USER'S DATA SEGMENT
SETUP USER'S EXTRA SEGMENT

ES.N<
AX. USER_55
SS,AX

SETUP USER'S STACK SEGMENT

~-puT-TRAN;fER-ADDREss-ON-THE-sTAcK-AND-RETuRN-TO-THE-USER--------------------

;------------------------------------------------------------------------_._--

046C
0460
0470
0471
0473
0474

POP
AOO
I PUSII

5"

83 c4 04

0"

6"
0030
53

OW
PUSH

RET

C"

X.V I RTUAL

0105

"X

GET RETURN

I P FROM THE STACK
NORMALIZE STACK POINTER
SET STACK FOR A RETURN FAR

SP,4
USeR CS

068H·
USER.CS

BX
RETURN TO USER IN VIRTUAL MODE
ENDP

;--- DEVICE BUSY AND INTERRUPT COMPLETE -----------------------THIS ROUTINE IS A TEMPORY HANDLER FOR DEVICE BUSY
AND INTERRUPT COMPLETE
INPUT
SEE PROLOG
bE~~CE:B~S;-----PROC----NEAR------------------------------------

0475
0475
0476
0479

E9 004f R

CLC
JMP
oEV ICE_BUSY

C1_f
[NoP

0479
0479
047A

CF

INT_COMPLETE
IRET
I NT_COMPLETE

ENoP

F8

CODE

047A

5-158

BIOS 1

ENDS
ENO

PROC

TURN CARRY 0 F f
RETURN WITH CARRY FLAG
NEAR
RETURN

TITLE OB-OB-83 BIOS2
BIOS INTERRUPT
. LIST
INCLUDE. SECMlNT. SRC
CODE SEGMENT BYTE PUBL I C

0000

EX1RN
DDS:NEAR
PUBL I C T IME_O~ _DAY_l, T I MER_I NT_ 1, PRI NT_SCREEN_l
PUBLIC
RfC INr
I NT lA- ----------- -----------------------------------------TIME OF OAY
- TH I S ROUT I N[ ALLOWS THE CLOCK TO BE SET/READ
= 0

READ THE CURRENT CLOCK SETT I NG
RETURNS CX = HIGH PORT I ON 0 F COUNT
OX ;= LOW PORT I ON OF COUNT
AL = 0 1FT IMER HAS NOT PASSED 24 HOURS
SINCE LAST READ. <> 0 I r ON ANOTHER DAY
(AH) ;= 1
SET THE CURRENT CLOCK
CX = HIGH PORTION OF COUNT
OX = LOW POkT I ON OF COUNl
NOTE:

COUNTS OCCUR AT THE RATE OF 1193180/h5536 COUNTS/SEC
(OR ABOUT 18.2 PER SECOND -- SEE EQUATES)

(AH) = 2

(AH)

(AH)

READ THE REAL TIME CLOCK
RETURNS CH ;= HOURS I N BCD
CL = MINUTES IN BCD
DH = SECONDS 1N BCD

=: 3
SET THE REAL TIME CLOCK
CH '" HOURS I N BCD
CL
MINUTES IN BCD
011 = SECONDS I N BCD
DL = 1 IF DAYLIGHT SAVINGS TIME OPTION,

= 4

(AH) =
CH
CL
DH
DL

ELSE 0

READ THE DAlE FROM THE RlAL TIME CLOCK
RETURNS CH == CENTURY I N BCD (19 OR 20)
CL == YfAR IN BCD
DH '" MONTH IN BCO
DL = DAY IN BCD

5
SET THE DATE INTO THE REAL TIME CLOCK
== CENTURY IN BCD (19 OR 20)
== YEAR I N BCD
MONTH I N BCD
== DAY IN BCD
:=

(AH) == 6

SET THE ALARM
IHE ALARM CAN BE SET TO INTERRUPT ur TO
23:59:59 FROM PRESENT TIME.
ONE ALARM FUNCTION MAY B[ ACTIVE AT ANY TIME

Gil ;= HOURS I N BCD
CL = MINUTFS IN BCD
DH =: SECONDS I N BCD
(AH)

NOTE:

;=

7

ASSUME
0000
0000
0001
0002
0005
0007
0009
OOOB
0000
0010
0012

FB
lE
E8 0000

OA
74
FE
74

E

E4

11:

0017

FB
lF
CF

0018
0018
0019
OOlA

F9
1F
CA 0002

0010
0010

001 [
0021
0026
002A
OOZE
0030
0030
0031
0035
0039
003E
0040
0040
0042
0044

004(,
0048
004B
004B
0048
004E
0050
0052
0052
0053
0055
0058
005A
005C
005F
0061
0063
0066

JZ

111

OOP)
0015
0016

TIME OF DAY 1
-STIPUSH
CAr.l
OR

ee
23
80 FC 07
70 03
EB 2C 90

RESET THE ALARM

Fon AH = 2, 4, 6 - CY FLAG SET I F CLOCK NOT OPERATING
FOR AH = 6 - CY FLAG SET I F ALARM ALREADY ENABL ED
FOR THE ALARM FUNCTION (AH = 6) THE USER MUST CODE A
ROUTINE AND PLACE THE CORRECT ADDRESS IN THE VECTOR
TABLE FOR I NT 4Ali
CS: CODE, OS: DATA
PROC

T2

OEC

AH

T3

CMP
JOE
JMP

T1

POP
IRET
STC

I NT£RRUPTS BACK ON
SAVE SEGMENT
SET OAT A SEGMENT
AH=O
READ TIME
AH=1SET TIME
CHECK I F VALID
RI:.1URN IF NOT VALID
GO CHECK OTHER FUNCT IONS
TOO RETURN
INTERRUPTS BACK ON
RECOVER SEGMENT
RETURN TO CALLER

ODS
AH,AH

JZ

sr I

FAR

as

AH,7
RTC_O

as

SET ERROR RETURN

POP

as

RET

2

CI.I
MOV
MOV
MOV
MOV

AL, T IMER_OFL
T I MER_OFl, 0
CX,TIMER HIGH
OX, T I MER-LOW

READ TIME
NO TIMER INTERRUPTS WHILE READING

T2:
FA
AO 0070 R
C6 Ol'i 0070 R 00

8B OE 006E R
8B 16 D06e R
EB £5

JMP

13:
FA
89
89
C6
fB

OE D06E R
06 0070 R 00
D5

FE
74
FE
74

CC
07
CC
26

16 006C R

£9 0007 R

T1

-

JMP

T I MER_LOW, DX
T I MER_H I GH, ex
T I MER_OFl, 0
Tl

OEO

AH

JZ

AH RTC 3

JMP

RIC-'
PROC

NEAR

[8 0' B7 R
73 02
EB C6

CALL
JNC
JMP

UPD IN PR
RTC-ZA11_"

FA
62
E8
E4
8A
E8
E4
8A
EB
E4

Cli
MOV
CALL
IN
MOV
CALL
IN
MOV
CALL
IN

DL,-2
PORT INC 2
AL,CMOS PORT+1
DH, AL PORT INC 2
AL, CMos PORT+1
CL, AL PORT INC 2
AL,CMOS_PORT+l

FE
0192 R
71
FQ
0192 R
71
CB
0192 R
71

SET THE TIME
RESET OVERFLOW
TOO_RETURN
AH '" 2
RE.AD RTC T I ME
AH = 3
SET RTC TIME
GO CHECK REMA I N I NG FUNCT IONS

RTC 2

DEC

JZ
RTC_GET_TIME

AND RESET lH£ FLAG

TOO_RETURN
SET TIME
NO INTERRUPTS WHIU: WRITING

Cli
MOV
MOV
MOV

GET OVERfLOW,

CHECK FOR UPDATE IN PROCESS
GO AROUND I F OK
RETURN I F ERROR
I NTERRUPTS OfF DURI NG READ
SET ADDRESS OF SECONDS
SAVE
SET ADDRESS OF MINUTES
SAVE
SET ADDRESS OF HOURS

BIOS 2 5-159

0068
006A
006C

MOV
MOV
JMP
RTC_GET _ T I ME

8A E8
62 00
EB A7

006E

inc

006E
Q06E
006E
0071
0073
0076
0076
0077
0078
007A
0070
007F
0081
00811
0086
0088
008B
0080
008F
0091
0094
0095
0097
0099
0098
0090
009E
QOAO
aOA3

OOM
OOA6

E8 0187 R

73 03
E8 019A R

SA

E6
E8
8A

E6
82
E8
5A
E4
24
OA
OC
50
B2
E8
58
E6
[9

FE
0192 R
C6
71
0192 R
Cl
71
0192 R
C5
71

OA
0188 R

AND

OR
OR

OA
018B R
71
0015 R

OOA9
QQAe
OOAE

PUSH
MOV
CALL
MOV
OUT
CALL
MOV
OUT
CALL
MOV
OUT
MOV
CALL
POP

IN

71
23
C2
02

OOA9
OOA9
OOA9

JNe
CALL

PROC

NEAR

UPO_iN_PR
RTC 3A
I NIT I AL IlE_ST ATUS

E8 01 B7 R
73 03
E9 0018 R

PUSH
f~

0217
0219
0218
0210
0210

A8 20
74 02
CD 4A

021F

E6 AO
E6 20
5F
5A
58
1F
CF

0221

0223
0224
0225
0226
0227
0228

MOV
CALL
IN
AND
PUSH
MOV
CALL
POP
OUT
MOV
LOS
MOV

B20A
E80l8BR
E4-/1
21~

INT 9:
-POP
TEST
JZ

1 NT
RTC_INT 10:
-MOV
OUT

80 20

OUT
POP
POP
POP
POP
I RET
I NT ENDP

DL,OAH
TURN OfF PIE
PORT INC
AL, CMOS_PORT+1
AI., OBnl
AX
DL,OAH
PORCINC
AX
CMOS PORT+1,AI
RTC WAIT FLAG,O ; SET FUNCTION ACTIVE FLAG OFF
DI,D'rIORO-PTR USER_FLAG; SET UP OS,OI TO POINT TO USER FLAG
BYTE PTR[ 0 I], 80H ; TURN ON USERS FLAG

AX
AL,20H
RTC I NT 10

Glf INTERRUPT SOURCE BACK
TEST fOR ALARM INTERRUPT
NO - GO AROUND
TRANSFER TO USER ROUTINE

4AH~

;\1_, [01
OAOH,AL
020H,AL
DI
OX

END OF

I NTERRUPT TO 8259 -

AND TO 8259 -

1

RESTORE REG I STERS

AX
OS

END OF INTERRUPT
RTC
PAGE
; -- I NT 8 (LEVEL 0) ------ ---------------------- ---------- -------:
THIS ROUTINE HANDLES THE TIMER INTERfWPT FROM
CHANNEL 0 OF THE 8253 TIMER.
INPUT FREQUENCY IS 1.19318 MHZ:
AND THE DIVISOR IS 65536, RESULTING IN APPROX. 18.2 INTERRUPTS;
EVERY SECOND.
THE INTERRUPT Hft.NOLER MAINTAINS A COUNT OF INTERRUPTS SINCE
POWER ON TIME, WHICH MAY BE USED TO ESTABLISH TIME OF DAY.
TH£ I NT£RRUPT HANDLER ALSO OECREMENfS THE MOTOR CONTROL COUNT
AND WHEN IT EX?I RES, WI LL TURN OFF THE
DISKETTE MOTOR( s), AND RESET THE MOTOR RUNN I NG FLAGS.
THE INTERRUPT HANDLER WILL ALSO INVOKE A USER ROUTINE THROUGH
INTEHRUPT 1CH AT EVERY TIME TICK.
THE USER MUST CODE A
ROUTINE AND PLACE THE CORRECT ADDRESS IN THE VECTOR TABLE,

OF THE 01 SKETTE,

TIMER

0228

0228
0229
022A
0228
022C
O??F
0233
0235
0239
0239
023E
0240
0246

FB

1E
50

52
E8
FF
75
FF

0000 E
00 006e R
04
06 006E R

.3

3E 006E R

,.

-

INT 1
S1'I
I'USH
PUSH
PUSH
CALL
INC

JNZ
1 NC

PROC

FAR
INTERRUPTS BACK ON

OS
AX

ox

SAVE MACHINE STATE
ESTABL I SH AOORESSAB I L I TY
INCREMENT T I ME
TEST DAY
INCREMENT HIGH WORD OF TIME
TEST DAY
TEST-FOR COUNT EQUALLI NG 24 HOURS
01 SKETTE_CTL

DDS

riMER LOW

T4

-

TIMER_HIGH

T4:
eMP

TIMER HIGH,018H

75 15
81 3E 006C R 0080

JNZ
eMP

T5

75 00

JNZ

T5

-

T I MER_LOW, OBOH

01 SKETTCCTL

T I MER HAS GONE 24 HOURS
0248
02 1lA
0240
0250

2B
A3
A3
c6

CO
006E R
006C R
06 0070 R 01

0255
0255
0259
02SB
0260
0262
0265

FE
75
80
BO
SA

OE OOIJO R
OB
26 003f H
OC
03F2

SUB
MOV
MOV
MOV

AX,AX
TIMER_HIGH,AX
T I MER_LOW, AX
TIMER_OFl,1

TEST FOR DISKETTE TIME

0266
0266
0268
026A
026C
0260
026E
026F
0270

T5:
DEC
,INl

Fa

AND
MOV
MOV

OUl

EE

our

; 01 SKETTE GTl
MOTOR COUNT
T6
; RETURN I r COUNT NOT OUT
MOTOR_STATUS,OFOH
; TURN OFF MOTOR RUNNING BITS
At.,OCIi
OX, 03 F2H
; FOC CTL PORT
DX,AL
TURN OFF THE MOTOR

T6;

co

lC
80 20
E6 20

1 NT

1 Gil

TIMER RET:
TRANSFER CONTROl. TO A USER ROUT I NE

MOV

AL, EOI
0201-l,Al.

END OF

OUT

5A
5.

POP
POP
POP
I RET

1F

eF

TIMER

- 1 NT-

1

ox

I NTERRUPT TO 8259

AX
RESET MAr:HINE STATE
RETURN FROM INTERRUPT

OS

ENDP

I NT 5 -------------------- --.------------------------ --------------THIS LOGIC WILL BE INVOKED BY INTERRUPT 05H TO PRINT
THE SCREEN. THE CURSOR POSITION AT THE TIME THIS ROUTINE
IS INVOKED WILL BE SAVED AND RESTORED UPON COMPLETION. THE
ROUTINE IS INTENDED TO RUN WITH INTERRUPTS E.NABLED.
IF A SUBSEQUENT 'PRINT SCREEN KlY IS OEPKESSE.D DURING THE
T I ME TH I S ROU TINE IS PR I NT I NG IT WILL Be I CNORED,
ADDHESS 50:0 CONTAINS "iHE STATUS OF THE PRINT SCREEN:
E I TIlER PR I NT SCREEN HAS NOT BEEN CALLED
OR UPON RETURN FRot1 A CALL THIS INDICATES
A SUCCESSFUL OPERATION.

50:0

ASSUME

0270
0270
0271
0272
0273
0274
0275
0276
0279

0278
0280

0282
0287

0289

FB
1E
50
53
51
52
B8

---- R
81:: 08
80 3E 0000 R 01
74
C6
84
CD

5f

06 0000 R 01
OF
10

PR I NT SCREEN 1
ST I PUSH
PUSH
PUSH
PUSH
PUSH
MOY
MOY
eMP
JZ
MOY
MOY
INT

=1

PRINT SCREEN

=255

ERROR ENCOUNTERED OUR I NG PR I NT I NG

IS

IN PROGRESS

CS;CODE,DS:XXDATA

PROC

FAR

DS

MUST RUN WITH INTERRUPTS ENABLED
MUST USE 50:0 fOR DATA AREA STORAGE

AX
BX

ex

ox

AX,XXDATA
OS,AX
STATUS_BYTE,l
EXIT
STATUS_BYTE,l
AH,15
10H

WILL USE THIS LATER FOR CURSOR LIMITS
W Il L HOLD CURRENT CURSOR POS I T I ON
HEX 50
SE.E IF PR I NT ALREADY I N PROGRESS
JUMP IF PR I NT ALREADY I N PROGRESS
INDICATE PRINT NOW IN PROGRESS
WI LL REQUEST THE CURRENT SCREEN MODI:.
[AL]=MODE
[AH)oooNUMBER COLUMNS/LINE

*lI-********************~*** ...* ...... ~~~l~~!~~~-;*:!~~********** ......

5-162

BIOS 2

AT THIS POINT WE KNOW THE COLUMNS/LINE ARE IN
IAXI AND THE PAGE IF APPLICABLE IS IN [BHI. THE STACK
HAS OS, AX, BX, ex, ox PUSHED. [AL I HAS VJ OED MODE

** .... **** .. *.. *** .... ****** .. ****************** ...... ********* ... *****

0288
0280
028F

0292

MOY
MOV
CAL L
PUSH
MOV
INl
POP
PUSH

SA CC
05 19
ER 02E7 R
51

0293
0295
0297

B4 03

0298

52

0299

33 02

CD 10

59

WILL MAKE USE OF (CXI REGISTER TO
CONTROL ROW Be COLUMNS
CARR I AGE RETURN LINE FEED ROUT I NE
SAVE SCREEN BOUNDS
WILL NOW I{EAD I Ht: CURSOt{.
AND PRESERVE THE POSITION
RECALL SCREEN BOUNDS
RECALL (BH I"'V I SUAL PAGE

CL,AH
CII,25
CRLF
CX
AH, 3
10H

cx
ox

**~ .. **~~~ ........ *~~;.~~*"1

H IlM

"*"***~*~!~_~*;~r*~~~;~~ .. ~~;!r!~~*r~*i2* 0 J

THE lOOP FRON PRI10 TO THE INSTRUCTION PRIOR TO PRI20
IS THE LOOP TO READ EACH CURSOR POSITION FROM THE SCREEN

U2Yl:>
0290
O?9F
02A1
02A3
02A5
02A7
02A9
02A9
02AA
02AC
D2AE:
02BO
02B1
02B4
O;:>B6
0288
02BA
02BC
02BE
02CO
02C1
02c4
02C5
02c7
02C9
02C8
02CC
02C£
02DO
0205
020-(
0208
02DA
02DC

02E1
02E~

02[3
02£4
02£5
02E6
02[7

*** ... *"I,!~~*~~!~!.;. .. ********************************************')1-*
MOV

AH,2

CD 10

I NT

B4 08

MOV

lOti
AH,8
10H
AI.,AL
pRI15
AL,' I

84 02

;'Rll0:

>NT

CD 10
OA CO

OR
JNZ
MOV

75 02
BO 20
PRJ 15:
33 02

PUSH
XOR

32 E4
CO 17

XOR
>NT

52

POP
TEST
JNZ
INC

5A

F6 CII 29

75 21
FE C2
3A CA

OjP

JNZ

75 OF
32 02
8A E2
52
E8 02E7 'I<,
5A
FE C6

MOV
rUSH
CALL
POP
INC

3A EE

eMP

"f5 DO

JNZ

5A

XOR

PR120:

B4 02
CD 10
C6 06 0000 R 00
[[3 OA
5A
B4 02
CD 10
C6 06 0000 R FF
5A
59
58
5B
1F
CF

10H
;
STATUS_BYTE,DFFH

SAVE CURSOR pas I T I ON
INDICATE PRINTER 1
TO INDICATE PRINT CHAR IN [ALI
PR I NT THE CHARACTER
RECALL CURSOR POS IT! ON
TEST FOR PR INTER ERROI{
JUMP! F ERROR DETECTED
ADVANCE TO NEXT COUJMN
SEE JF AT END OF LINE
I F NOT PROCEED
BACK TO COLUMN 0
[AH 1::=0
SAVf NEW CURsor~ pas I T I ON
LINE FEED CARRIAGE RETURN
RECALL CURSOR POS I T I ON
ADVANCE TO NEXT LINE
FINISHED?
I F NOT CONT I NUE
RECALL CURSOR POS I T I ON
TO INDICATE CURSOR SfT RFQUf.ST
CURSOR paS I T I ON RESTORED
INDICATE FINISHED
EXIT THE ROUTINE
GET CURSOR POS I T I ON
TO REQUEST CURSOR SEl
CURSOR POSITION RESTORED
; INDICATE ERROR

ox

RESTORE ALL THE REGI STERS USED

DX
DX,DX
AH,AH
Uti

OX
AH, 29H
ERR10

OL
CL,DI
I'R 110
DL,DL
AH,DL

ox

CRlF

OX
OH
CH,DH
PR 110

POP

DX

MOV
I NT
MOV
JMI'

AH,2
10H
5T ATlIS_BYTE, 0
SHORT EXI T

£RR10:

POP

OX

MOV
I NT

AH,?

CRR20:

Mav

EXI T:

POP
POP
POP
POP
POP
IRET
PRI NT_SCREEN 1

ex

BX
AX
OS
ENDP

; ------ CARR I AGE RETURN,
CRLF

02E7
02U
02(9
02E~

02ED
u2EF
02F1
02F3
02F5
02r6
02F6

TO INDICATE CURSOR SET REQUEST
NEW CURSOR POSITION ESTABLISHED
TO JNDICAlE READ CHARACTER
CHARACTER NOW IN [AL J
SEE I F VALID CHAR
J UM? I F VAL I 0 CHAR
MAKE:. A BLANK

PROC

XOR
XOR

33 02

32 Ell

eo

MOV

OA
CD 17
32 E"
110 00
CD 17
C3

>NT
XOR
MOV
INT
RET

CIlLF
CODE

NEAR
OX, OX
AH,AH
AL,12Q

17H
AH,AH
AL,15Q
171-1

LI NE FEED SUBROUTI NE
PRINTER 0
WILL NOW SEND

I NIT I AL LF, CR TO PR INTER

LF
SEND THE LINE FEED
NOW FOR THE CR
CR
SEND THE CARRIAGE RETURN

ENDP
[NilS
END

BIOS 2

5-163

5-164 BIOS 2

0000

TITLE 12/08/83 ORCS
• LIST
I NCLUOE SEGMENT. SRC
COOf.. SEGMENT BYTE PUBLIC
ASSUME CS:CODE,
EXTRN
EXTI(N
EXTRN
EX1RN
EXTRN
[XTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
.£XTRN
EXTRN
EXTRN
EXTRN
[XTRN
EXTI{N
EXTRN
EXTRN
EXTRN
EXTRN

DS:DATA

K1 6: NEAR
INT 287;NEAR
DSKETTE SETUP:NEAR
DISK SCfUP:NEAK
SEEK:NEAR
RTC I NT: NEAR
STI\HT 1 :N[AH
NM I I NT 1: NEAR
ROOT S1RAP 1: NEAR
K[YBOI\IW 10 1 :NEAR
KB INT l:NEAR
r)!SKETTE 10 l;NEAR
D I SK_.I NT~'l: NEAR
PRINTER 10 l:NEAR
VIDEO 10 1:NEAR
MEMORY SIZE DETERM I NE 1. NEAR
EQU I PMENT 1:NEAR
CASSETTE 10 1 :NEAR
TIME OF -DAY-1;NEAR
T [MER INT '--:NEAR
011: NEAR RS232 10 1: NEAR
DUMMY-RETURN l ' NEAR
PR I NT-SCREEN-' : NEAR
Cl1;NEAR
C30: NEAR
rST4 B;NEAR
IST4-C:NEAR
rST4-0: NEAR
E30B:NEAR
E30C;NEAR
RE_D I REeT: NEAR

PUBL I C BOOT INVA
PU6l1 C TUTOR
rUSL I C START
PUBLIC
C1
PUBLIC
e2
PUBL I C
C8042A
PUI3L I C OBF 42B
PUBLi C OSF ,=42A
PUBLi C
C8042B
PUBL I C CB042C
PUf"lL I C f_O
PUBLI C EO A
PUBLIC
EO-B
PUBLIC
VIR ERR
PUl3l1 C
ElPUBL! C
f3A
PUBLIC
01
PUBLIC
02
PUBLIC
02A
PUBLIC
F3D
PUBLI C
F3D1
PUBLIC.
Fl
PUBL! C
r1_A
PUBLIC
Fl B
PUBLIC
F3PUSL I CLOCK
PUBLIC
CMl
PUBLIC
CM2
PUBL I C C~13
PUBLIC
CM4
PUBLIC
PUBLIC
PUBLIC
PUBLI C
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBL I C
PUBLIC
puBL I C
PUBL I C
PUBLIC
PUBL I C
PUBLI C
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
puBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBl I C
PUBLIC
PUBLIC
PUBLI C
PUBLI C
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLI C
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBLIC
PUBliC

CM4 A
CMt.-[3
CM/{-C
CM4-D
F3BF/,
F4E
E1 A
[,-[3
El-C
AD[HR
ADERRl
VEC10K I ABLE
SlAVE_ VECTOR_TABLE
DISK BASE
V IDEO PARMS
M4

-

M~

M6
M7
CRT_CHAR_GEN
PRINT_SCREEN
Al
K6
K6L
K7
K8
K9
K1U
K11
K12
K13
I\l4
1\15
RS232 10
DUMMY-RETURN
NMI_INT
BOOT STRAP
KEYBOARD_IO
KB I NT
DISKETTE 10
DISK INTPRINTER 10
VIDEO 10
MEMOI~Y SIZE DETERMINE
EQU I PMENT CASS[TTE 10
riME OF DAY
TIMER INT
HRD FLOPPY
SEEKS 1
F1780F1781
F1782

ORGS

5-165

PUBLI C
PUBLIC
PUBLI C

f1790
F1791
FO_ TSl

; THIS MODULE HAS BEEN ADDED TO FACILITATE THE EXPANSION OF THIS PROGRAM.
; IT ALLOWS FOR THE fiXED ORG STATEMENT ENTRY POINTS THAT HAVE TO REMAIN
; AT THE SAME ADDRESSES. ADDED ON 9/16/82
;

-----------------------------------------------------------------------------:

; COPYRIGHT NOTICE
ORG
0000

005B
005B
005B
005S

36
38
2E
31

31
20
20
39

38
43
49
38

31 30 32
4F 50 52
42 40 20
34

OEOOOH

DB

RESET
START:
E9 0000 E

'6181028 COPR.

ORG
ORG
LABEL

OE05BH
0005BH
fAR

JMP

START_'

IBM 1984'

; +++++++++++++++++++++++

~OSE

0060
0062
0064
0066
0068
006A

006C

0085

009E

00B1

0000

00E9

0000
0000
0000
0000
0000
0000
0000

20
79
42
45
OA
20
79
42
45
OA
20
79
42
45
OA
20
79
42
45
OA
20
79
42
45
OA
20
65
1~5

OOFC
01 DC

011C

0137

0152
0150
0164

0174
0184
018!!

OlAl

01C2

0107

OHB

OA
20
52
6F
20
52
6F
20
65
41
73
72
20
65
41
73
72
52
72
20
00
50
20
20
50
20
20
3f
OA
20
40
46
59
20
6E
53
20
4B
6B
20
65
64
72
20
79
55
65
20
63
20
65
64
79
55
72

C,------------------------ow

E
E

OW
OW
OW
OW
OW
OW

C2
C8042A

E

g:bli~~A

E
E
E
E

C8042C
OBF _42B

~ -POS;-ERROR-MESSAGES----.------------------------D B ' 101-System

31
73
6F
72

30
74
61
72

31
65
72
6F

20
60
64
72

53
20
20
00

EO

31
73
6F
72

30
74
61
72

32
65
72
6F

20
60
64
72

53
20
20
00

EO_A

DB'

31
73
6f
72

30
74
61
72

33
65
72
6F

20
60
64
72

53
20
20
00

EO_B

D B ' l03-System Board Error',13.10 ; TIMER INTERRUPT FAILURE

31
73
6f
72

30 34
74 65
61 72
72 6F

20
60
64
72

53
20
20
00

VIR_ERR

DB

31
73
6F
72

30
74
61
72

20
60
64
72

53
20
20
00

CM4

D B ' l05-System Board Error',13,10 ;

32 30 31 20 l~O
60 6F 72 79 20
72 72 6F 72 00

E1

D6

34
54
72
35
5 1j
72
3?
60
64
20
00
32
60
64
20
00
4F
6F
4B

30
20
00
30
20
00
30
6F
64
45
OA
30
6F
64
45
OA
40
72
42

20 43
72 72

41
43
32
41
43
31
3f
28
45
31
29
20
6C
79
55
65
00
33
79
20
00
33
73
6E
79
69
6B
33
79
20
73
6E
72

35
65
72
6F

Board Error',13,10 ;

INTERRUPT FAILUE

102-System Board Error',13,10 ; TIMER FAILURE

'104-SyStem Board Error',13,lO;

PROTECTED MODE FAILURE

LAST 8042 COMMAND NOT ACCEPTED

2Ql-Memory Error' ,13,10

31
45
OA
31
45
OA
3?
72
72
72

[1 6

-

06

401-CRT Error', 13, 10

20 43
72 12

[1 C

06

SOl-CRT Error' ,13,10

?D
79
65
72

40
20
73
6F

AOERRl

06

202-Memo ry Add ress Error' ,13, 10

LINE ERROR 00->15

33
72
72
72

20
79
65
72

40
20
73
6F

AOERR

06

203-Memory Address Error', 13, 10

; LI NE ERROR 16->23

20 45 72
00 OA
20 4F 4B

f3A

DB

'ROM Error' ,13,10

ROM CHECKSUM

f36

DB

'KB OK',13

KB FOR MEMORY SIZE

52
48
00
52
48
00
3F

49
45
OA
49
45
OA
3F

54 59
43 4B

01

DB

'PARITY CHECK 2',13,10

54 59
43 4B

02

DB

'PARITY CHECK 1',13,10

3F 00

D2A

DB

'?????',13,10

52
20
22
00
20
6F
73
6E
79
OA
30
62
45
OA
30
14
69
6c
73
65
30
62
4F
74
69
6F

45
3D
20
OA
20
63
74
69
6C

53 ~5
20 22
4B 45

fJD

DB

20
6B
65
74
6F

F30l

DB

31 20 4B
6F 61 72
72 72 6F

F1

OB

32
65
74
6F
20
61.j.
33
6F

LOCK

D B ' 302-System Unit Keylock

F1_A

D B ' 303-Keyboard Or System Unit Error', 13,10

72
65
74
72

20
60
20
63
4e
00
20
61
20
60
20
00

55
20
60
20
63

53
20
4B
6B
6F
OA
4B
72
53
20
4S
OA

5-166 ORGS

-

(KESUMI:. = "1-1" KI:.Y) , ,13,10

-Unlock System Unit KeylOck' ,13,10

301-Keyboard Error', 13,10

;

KEYBOARD ERROR

is Locked', 13, 10

;

KEYBOARD LOCK ON

021F

203630312044
69 73 6B 65 74 74
65 20 117 72 72 6F
72 00 OA
20 31 36 31 20 53
79 73 711 65 60 20

0234

F3

DB

601-Diskette Error', 13, 10

CM1

DB

161-SYStem Options Not Set-(Run SETUP)',13,10

CM2

DB

CM3

DB

;

DISKETTE ERROR

;

DEAD BATTERY

4r -'0 -f/+ 69 6r 6E
73
53
75
55
20
7')
liF

0250

0286

20

II~

6F 74 20

65 74 20 28 52

6E
50
31
73
70
B 20
53 65
75 6E
55 50

20
29
36
74
4[
"{II
20
29

53
00
32
65
69
6F
2D
53
00

45 54
OA
?D 53
60 20
6r 6E
74 20
28 52
45 54
OA

20 31
69 60
44 61
6F 74
20 28
53 45
00 OA

36
65
74
20
52
54

33
20
65
53
75
55

20
26
20
65
6E
50

-{J+

54
20
4E
74
20
29

,

162-System Options Not. Set-(Run SETUP)', 13, 10

; CMOS CHECKSUM ERROR
163-Time & Date Not Set-(Run SETUP}',13,10

;
;

F4

02AC
02AC
02A[
02BO
02B2

CLOCK NOT UPDATING

PR \ NTER TABLE
LABEL
OW
OW
OW
LABEL

03Be
0378
0278
F4F:

WORD
3BCH
378H
278H
WORD

; --------- NM \ ENTRY

ORO
ORG
EaU

OE2C3H
002C3H

53
20
20
00

DB

,

106-System Board Eccor' ,13, 10 ;

CONVERTING LOGIC TEST

53
20
20
00

DB

,

107-System Board Error',13,10 ;

HOT NMI

31 30 38 20 53
73 74 65 60 20

DB

,

108-System Board Error', 13, 10 ;

TIMER BUS TEST

DB

,

109-Syst.em Board Errol", 13, 10 ;

LOW MEG CHI P SELECT TEST

02C3

= 02C3
02C3

[9 0000 E

02C6

20 31 30 36 20
79 73 74 6, 60
42 6 F 61 72 6 11
"5 72 72 6F 72

$

OA
02DF

20
79
42
45

02F8

20
79
42
,,5

31 30 37 20
73 74 65 60
6F 61 72 64
72 72 6F 72

TEST

OA
6F 61

72 64 LU
72 72 6F 72 00

OA
0311

20
79
42
45

31 30 39 20
73 74 65 60
6r 61 72 64
72 72 6F 72

032A

20
65
53
72
52
54

31 36 34 20 40
60 6F 72 79 20
697A652045
72 6F 72 20 28
75 6E 20 53 45
55 50 29 00 OA

03/IE

20
65
64
79
55
72

33
79
20
73
6E
72

30
62
4F
74
69
6F

31\
6F
72
65

20
61
20
GO
14 20
72 00

4B
72
53
?O
115
OA

0372

20
69
65
20
64
(2

36
73
20
52
20
00

30
6B
42
65
45
OA

32
65
6F
63
72

411
74
71,
72
6F

0393

31
69
46
65
31
69
1\6
65
31
69
6E
65
6C
31
69
45

37
73
61
00
37
73
61
00
3{
73
74
72
75
37
73
72

38
68
69
OA
38
6B
69
OA
38
68
72
20
72
39
6B
72

3020 44
20 30 20
6C 75 72

53
20
20
00

OA
; ---------- MEMORY SIZE ERROR
El_A
D B ' 164-Memory Size [rror-(Run SETUP}',13,10

"; CMOS DOES NOT MATCH SYSTEM
KEYBOARD/SYSTEM ERROR
DB
' 304-Keyboard Or System Unit Error',13,10

;

03A8

0380

030n

03EE

20
74
6f
6F
72

KEYBOARD CLOCK LINE HIGH

DISKETTE BOOT RECORD I S NOT VAll 0
DB
'602-Diskettc Boot Record Error',13,10

; ---------- HARD fILE ERROR MSG
F17BO
DB
'1780-0isk 0 Fa i lure' ,ODH,OAH

31 2044
20 31 20
6C 75 72

fl/S1

DB

'1781-Disk 1 failure'.OOH,OAH

32
20
6F
46
65
30
20
6f

F1782

DB

'1762-0isk Controller Fa i lure' ,ODH,OAH

F1790

DB

'1790-DiSk 0 Error' ,ODH,OAH

f1791

DB

'1791-Disk 1 Error' ,ODH,OAH

20
43
6C
61
00
20
30
72

411
6F
6C
69
OA
1I'1
20
00

OA
31 37 39 31 20 44
69 73 6B 20 31 20
45 72 72 6f 72 00
OA

INITIALIZE DRIVE CHARACTERISTICS
F IXCO 0 I SK PARAMETER TABLE
-

+0
+2

+,
+3

+7
+8

THE TABLE
(1 WORD)
(1 BYTE)
(1 WORD)
(1 WORD)
(1 BYTE)
(1 BYTE)

I S COMPOSED OF A BLOCK DEfINED AS;
-

MAX I MUM NUMBER OF CYL I NDERS
MAXIMUM NUMBER OF HEADS
NOT USED/SEE PC-XT
STARTING WRITE PRECOMPENSATION CYL
NOT USED/SEE PC-XT
CONTROL BYTE
BIT
7 DISABLE RETRIES -ORBIT
6 DISABLE RETRIES

ORGS

5-167

+9
+12
+14
+15

(3
(1
(1
(1
-

BYTES)WORD) BYTE) BYTE) -

BIT
3 MORE THAN B HEADS
NOT USED/SEE PC-XT
LANDING ZONE
NUMBER OF SECTORS/TRACK
RESERVED FOR FUTURE USE

TO DYNAMICALLY DEFINE A SET OF PARAMETERS
eu I LO A TABLE fOR UP TO 15 TYPES AND PLACE
1HE CORRESPONOING VECTOR INTO INTERRUPT 41
FOR DRIVE
AND INTERRUPT 46 FOR DRIVE 1.

°

FO_ TBl:

0401

;----- DRIVE TYPE 01
01101
0lf03
0404
0406
0408
0409
040A
OI~OD

040F
0410

0132

ow

04

DB

0000
0080

OW
OW

00
00

DB
DB
DB

00 00 00
0131
11

00

03060

040
0

CYL I NOERS
HEADS

01280

WRITE PRE-COMPENSATION CYL

0
0

CONTROL BYTE

OW

0,0,0
03050

DB
DB

170
0

I AND I NC ZONE
SECTORS/TRACK

;----- DRIVE TYPE 02
0 1.11
0413
0414
OI~16

OW
DB
OW
OW

026'1

04
0000
012C

DB
DB
DB

06150

040
0

WRIT[ PRE-COMPENSATION CYL

0
0

CONTROL BYTE

O/~ 1 8
01119
041A
041D
041F
0420

00
00

0421
0423
0424
0426
0428
0429
042A
0420
042F
0430

0267

0431
0433
0434
0436
0438
0439
043l1,
0430
043F
0440

03AC

OW

09400

DB
0000
0200
00
00
00 00 00
03AC
11
00

DB

DBD
0

0/\41
0/f43
0444
0446
01148
0449
044A
01\40
044F
0450

03AC

OW

06

08

0000
0200

OW
OW

00
00

DB

00 00 00
03AC
11

DB

0 1\51
01\53
0454
0456
0458
0459
0li5A
0450
045f
0460

0267

ow

0',

OB
OW
OW
DB
DB
DB
OW
DB
DB

00 00 00
0267
11

OW
OB

DB

00

CYLI NDERS
HEADS

03000
0,,0,0
06150

170
0

LANDING ZONE
SECTORS/TRACK

DR I VE TYPE 03

OW
DB
OW
OW

06
0000
012C

DB
DB
DB

00
00
00 00 00
0267
11

OW
DB

DB

00

06150

060
0

CYLI NDERS
HEADS

03000

WRITE PKE-COMPENSArloN CYL

0
0

CONTROL BYTE

0,0,0
06150

170
0

LAND I NG ZONE
SECTORS/TRACK

DR IVE TYPE 04

OW
OW
DB
DB
DB

05120

0

0

OW

0,0,0
09400

DB
DB

170
0

CYL I NDERS
HEADS
WRITE PRE-COMPENSATION CYL
CONTROL BYTE
LANDI NG ZONE
SECTORS/TRACK

; ----- DRIVE TYPE 05

DB

00

09400

060
0

CYLI NDERS
HEADS

05120

WRITE PRE-COMPENSATION CYL

0
0

CONTROL BYTE

OW

0,0,0
09400

DB
DB

170
0

LAND I NG ZONE
SECTORS/TRACK

;----- DRIVE TYPE 06

0000
FFFf

00
00
00 00 00
0267
11

00

06150
040

CYLI HDERS
HEAOS

0
OFFFFH

WRITE PRE-COMPENSATION CYL

0
0

CONTROL BYTE

0,0,0
06150

170
0

LANDING ZONE
SECTORS/TRACK

DR I VE TYPE 07
0461
0463
0464
0466
0468
0469
01\6A
0460
046F
0470

01CE

0471
0473
0474
0476
0478
0479
047A
0470
047F
0480

0200

OW
DB
OW
OW
DB

DB
0000
0100
00
00
00 00 00
01 FF
11
00

DB
DB
OW
DB
DB

04620

080
0

CYLI NDERS
HEADS

02560

WRITE PRE-COMPENSATION CYL

0
0

CONTROL BYTE

0,0,0
0511D

170
0

LAND I NG ZONE
SECTORS/TRACK

;----- DRIVE TYPE 08
OW
DB
OW
OW
DB
DB
DB
OW

05
0000
FFFF

00
00
00 00 00
0200
11

DB
DB

00

07330

050
0

CYLI NDERS
HEADS

OFFFFH

NO WRITE PRE-COMPENSATION

0
0

CONTROL BYTE

0,0,0
07330

170
0

LAND I NG ZONE
SECTORS/TRACK

DR r VE TYPE 09
0481
0483
0484
0486

0384
OF
0000
FFFF

0488

00

5-168

OW
DB
OW
OW
DB

ORGS

09000

150
0
OFFFFH

0

CYLI NOERS
HEADS
NO WRITE PRE-COMPENSATION

DB
DB
OW
08
DB

0489
048A
0480
OIJ8F
0490

06

0491
0493
0494
0496
0498
0499
049A
0490
049F
04AO

0334

04A1
04A3
04A4
04A6
04A8
04A9
04AA
04AO
04AF
0460

0357

0461
0463
0464
0466
0468
0469
046A
0460
04BF
04CO

0357

OW

07

06

0000
FFFF

OW
OW
DB
DB
DB
OW
DB
DB

04C1
04C3
04C4
Q4C6
04C8
04C9
04CA
a4CO
04CF
0400

0132

0401
0403
0404
01106
0lt08
0409
040A
0400
040F
04EO

0200

04El
OlJE3
04E4
04E6
01lE8
04E9
04EA
04EO
04EF
04FO

0000

00 00 00
0385

11
00

CONTROL BYTE

008H

0,0,0
LANDING ZONE
SECTORS/TRACK

09010

170
0

;----- DRIVE TYPE 10

OW
DB
OW

03
0000
FFFF

ow
DB
DB
DB
OW
DB
DB

00
00
00 00 00
0334

11
00

CYL I NOERS
HEADS

08200

030
0
OFFFFH

NO WRITE PRE-COMPENSATION

0

CONTROL BYTE

0
0,0,0
08200

LAND I NG ZONE
SECTORS/TRACK

170
0

DRIVE TYPE 11

OW
DB
OW
OW
DB
DB
DB
OW
DB
DB

05
0000
fHI'

00
00
00 00 00
0357
11

00

CYLI NDERS
HEADS

0855D

050
0

orFFFH

NO WRITE PRE-COMPENSATION

0
0

CONTROL BYTE

0,0,0
08550

LANDING ZONE
SECTORS/TRACK

170
0

DRIVE TYPE 12

00
00
00 00 00
0357
11

00

CYLJ NDERS
HEADS

0855D
070

0
OFFfFH

NO WRITE PRE-COMPENSATION

0
0

CONTROL 6YTE

0,0,0
08550

LAND I NG ZONE
SECTORS/TRACK

170
0

DR I VE TYPE 13

OW
DB
OW
OW
DB
DB
DB
OW
DB
DB

08
0000
0080

00
00
00 00 00
013F
11

00

CYL INDERS
HEADS

03060
OBO

0
01280

WR I TE PRE-COMPENSAT I ON CYL

0
0

CONTROL BYTE

0,0,0
03190

LAND I NG ZONE
SECTORS/TRACK

170
0

; ----- OR IVE TYPE 14

OW
DB
OW
OW
DB
DB
DB
OW
DB
DB

07
0000
FFFF

00
00
00 00 00

0200
11

00

070
0
OFFFFH

WRITE PRE-COMPENSATION CYl

0
0

CONTROL BYTE

0,0,0
07330

00
0000
0000

00
00
00 00 00
0000

00
00

lAND I NG ZONE
SECTORS/TRACK

170
0

DRIVE TYPE 15

OW
DB
OW
OW
DB
DB
DB
OW
DB
DB

CYLI NDERS
HEADS

07330

RESERVED

****

DO NOT USE

****

CYll NDERS
HEADS

00000
DOD

0
00000

WRITE PRE-COMPENSATION CYL

0
0

CON I ROL BYTE

0,0,0
00000
DOD

lAND I NG ZONE
SECTORS/TRACK

0

; ---------- BOOT LOADER INTERRUPT
06F2
'" 06F2
06F2
E9 0000 E

BOOT_STRAP

ORO
ORO
EOU
JMP

OE6F2H
006F2H

$
BOOT_STRAP_1

; ---------------BAUD RATE
0729
0729
0729
0726
0720
072F
0731
0733
0735
0737

ORO
ORO
LABEL

A1
0417
0300
0180
OOCO
0060
0030
0018
OOOC

OW
OW
OW
OW
OW
OW
OW
OW

j

NIT

OE729H
a0729H
WORD

1047

110 BAUD

768

150
300
600

384
192

; TABLE OF INIT VALUE

1200
2400
4800
9600

96

48
24
12

;-------------- RS232

ORO
ORO
EOU
JMP

0739
'" 0739
0739
E9 0000 E

OE739H
00739H

S

RS232_IO_ 1

; --------------- KEYBOARD
oa2E
'" 082E
082E
E9 0000 E

087E

KEY60ARD_IO

ORO
ORG

OE82EH
0082EH

EOU
JMP

KEYBOARD_I 0_ 1

ORG
ORG

OE87EH
00a7EH

S

; ------ TABLE OF SH I fT KEYS AND MASK VALUES (EARLY PC 1

ORGS

5-169

LABEL

087E
087E
52
087F
3A 45 46 38 10
0884
2A 36
== 0008

K6L

EOU

BYTE
INS_KEY
; I fIISERT KEY
CAPS_KEY, NUM_KEY, SCROLL_KEY, AL T_KEY, GIL_KEY
LEFT KEY,RIGHT KEY
$-K6 -

0886

K7

LABEL
DB
DB
DB

BYTE
I NS_Sf! 1FT
; I NSERT MODe Sit I n
CAPS_SH 1FT, NUM_SH I FT, SCROLL_SH J FT ,ALT _SH I FT ,CTL_SH J FT
LEFT_SH 1FT, RI CHT_SH I FT

0886

0887
088G

K6

DB
DB
DB

80
40 20 10 08 04
02 01

SCAN CODE TABLES
088E
0896
089E

D8A6

1B
1E
FF
FF

FF 00 FF FF FF
FF
FF FF 1F FF 7F

K8

17 05 12 14 19 lS
09 OF
10 1B 10 OA FF 01

13
D8AD

04 06 07 08 OA DB

OC

rr

FF FF 1C 1A 18 03

08BE

DE 00 FF FF FF FF
Ff FF
20 FF

0800
0808
08EO

08El
08El
D8FO

091/\
091B
091B
092A

U943

LABEL

64 65
66 67 FF FF 77 Ff
8J~ fF
73 r, 74 rr 75 FF
76 FF

1B 31 32 33 34 35
36 37 38 39 30 20
3D 08 09
71 77 65
75 69 6 F
00 F F 61
6i 68 6A

72 74 79

lB 21 40 23 24
5E 26 2A 28 29
2B 08 00
51 57 115 52 54
55 49 Ilf 50 7B
DD FF 41 53 114

DB

102,103,-1,-1,119,-1,132,-1

DB

115,-1,116,-1,117,-1.118,-1

5B 5C 50

O')')f
095F
096 11

68 69 6A 68 6C
6D 6E 6F 70 71

25

55 56 57 58

DB

60H,-1,5CH,'zxcvbnm,./',-l,'*',-1,'

r

OIEH,-l,' IZXeYBNM<>?' ,-1,0,-1,'

59

34

UC TABLE SCAN
LABEL
BYTE
DB

DB
; ------ AL T TABLE SCAN
K13
LAflEL
BYTE
DB
DB

K14
~LJ

27.' !@#$' • 37, 05EH, '&*( 1_+' ,08H, 0
'QWERTYU 10PIl' , ODH, -1, 'ASDFGHJKL:'"

DB

"

NUM STATE TABLE
LABEL
BYTE
DB

',-1

84,85,86,87,88,89,90
91,92,93
104,105,106,10'1,108
109,110,111,112,113

'789-456+1230.'

;------ BASE CASE TABLE
K15
LABEL
BYTE

47 48 49 FF 48 FF

40
FF 4F 50 51

52 53

DB

71,72,73,-1,75,-1,77

DB

-1,79,80,81,82,83

KEYBOARD

0987
= 0987

E9 0000 E

INTERRUPT
ORG

OE987H

ORC

00987H

£QU
JMP

S

OISKurE

OC59
= OC59

DISKETTE_IO

KB_I NT_'

I/O
OEC59H
OOC59H

ORC
ORC
EOU

S

DISKETTE_10_1

JMP

E9 0000 E

;-------- DISKETTE

INTERRUPT
OEF57H
00F57H

ORG
ORC
EOU

OF57
= OF57
OF57
E9 0000 E

S
DISK_INT 1

JMP
DISKETTE

PARMS

ORC
ORC

OfC7
;
;
;
;
;

LABEL
DF
02

5-170 ORGS

OEFC7H
OOFC7H

DISK_BASE
TH I SIS THE SET or PARAMETERS REQU 1RED rOR
DISKETTE OPERATION.
THEY ARE POINTED AT BY THE
DATA VAHIABLE DISK __ POINTER.
TO MODIFY THE PARAMETERS,
BUILD ANOTHER PARAMETER BLOCK AND POINT AT IT

OFG7
OFC7
OFC8

,027H

'qwertyuiop[]' ,ODH,-l, 'asdfghjkl;

31 32 33 30

2E

OC59

OlBH, '1234567890-=' ,08H,09H

DB

5F

0969

0987

-1

DB

K12

095G

0970

94,9?,96,97,98,99,100,101

; ------ UC TABLE
K11
LABEL
BYTE
DB

59
70
46
47 48 4A 4B 4C 3A
22
7E rF 7C SA 58 43
56 42 4E 40 3C 3E
3F FF 00 FF 20 FF

5 11
5A

0976

',_1

BYTE

73 64 66
6B 6c 3B

60 FF 5C 7A 78 63
76 62 6E 60 2C 2E
2F FF 2A FF 20
FF

.:S~

14,13,-1,-1,-1,-1,-1,-1

70 5B 50

0955

0976

4,6,7,8,10,11,12,-1,-1

DB
LC TABLE
LABEL
BYTE
DB

FF

37 3"
36 2B

16,27,29,10,-1,1,19

DB

DB

SF 60 61 62 63

0955

0969

23,5,18,20,25,21,9,15

; ________ CIl TA~~E SCAN'

27
0909

DB
DB

DB

K9

U8C8
5E

-1,-1,-1,31,-1,127,-1,17

-1, -1,28,26,24,3,22.2

16 02

08C8

27, -1 ,0, -1, -1 ,-1,30,-1

DB

H

08R6

08c6

DB

11

DB
DB

BYH.

11011111B
2

SRT=D, HD UNLOAO=QF HQ LOAD=l, MOOE=DMA -

1ST SPECIFY BYTE
2ND SPEC I FY BYTE

OFC9
OFCA
OFCB
OFCC
OFCD
OFCE
OFCF
OFDO
OFDl

MOTOR WAI T

DB
DB

25
02
OF
1B
FF
51.
F6
OF
08

2
15

DB
DB
DB
DB
DB
DB

OlBH
OFFH
054H
OF6H

DB

8

15

; ------- PR I NTER
OFD2
== OFD2
[9 0000 [
OFD2

-

10

ORG
ORG
EOU
JMP

PRINTER_IO
;-------- VIDEO

WAIT AFTER OPN TIL MOTOR OFF
512 BYTES/SECTOR
EOT ( LAST SECTOR ON TRACK)
GAP LENGTH
DTL
GAP LENGTH FOR FORMAT
FILL BYTE FOR FORMAT
HEAD SETTLE T I ME (M I LL I SECONDS)
MOTOR START TIME (1/8 SECONDS)

OEFD2H
00FD2H

$
PRINTER_IO_,

10

;--------- ADDEO FOR POSSIBLE COMPATABILI'IY ENTRY POINTS

1045
ASSUME
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
EXTRN
1045
1045 0000
1047
0000
1 01~9
0000
104B 0000
1040 0000
104F 0000
1051
0000
1053
0000
1055 0000
1057 0000
1059
0000
105B 0000
1050 0000
105F 0000
1061
0000
1063
0000
= 0020

M1
[

E
£
E
E
E
E
E
E
E
E
E
E
[
E
E
M1L

SET MODE:NEAR
SET-CTYP[;NEAR
SET-CPOS: NEAR
READ CURSOR; NEAR
READ-LPEN;NEAR
ACT DISP PAGE;NEAR
SCROLL_UP: NEAR
SCROLL_DOWN: NEAR
READ AC CURRENT; NEAR
WR I TE AC CURRENT: NEAR
WRIICC GURRENT:NEAR
SET COLOR;NEAR
WRITE DOT;NEAR
READ DOT; NEAR
WRI TE TTY: NCAII
VIDEO=STATE;NEAR
LABEL
DW
OW
DW
DW
DW
DW
OW
DW
DW
OW
DW
OW
OW
DW
DW
OW
EOU

1065

WORO
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFf'S!;, I
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OfFSET
S-Ml

TABLE OF ROUTINES WITHIN VIDEO
SET_MODE
SET CTYPE
SET-CPOS
READ_CURSOR
READ LPEN
ACT DISP PACE
SCROLL_UP
SCROLL DOWN
READ AC CURRENT
WR I {'CAe_CURRENT
WR I TE C CURRENT
SET COLOR
WR IrE DOT
READ DOT
WRITE TTY
V1DEO=STATE

ORG

OF065H
01065H

ORC

= 1065
1065

; ORC
or045H
ORG
01045H
CS: CODE, OS: DATA, E$; V IDEO_RAM

E9 0000 E

[QU
JMP

VIDEO - 10

I/O

S

VIDEO - 10- 1

; --------- V IDEO PARMS
ORC
ORG
LABEL

10A4
10ALI
10A4
10AB

lOBO
'-- 0010
10B4

lOBB
lOCO

OFOA4H
OlOA4H
BYTE

INIT TABLE
DB 38H,28H,2DH,OAH,1 fH,6, 19H

38 28 20 OA 1 F 06
19
lC 02 07 06 07
00 00 00 00

DB
DB

Eau

lCH,2, 7,6, 7
0,0,0,0
S-v I DEO_PARMS

DB

71H,50H,5AH,OAH,1 fH,6, 19H

DB

lCH,2,7,6,1
0,0,0,0

71 50 SA OA I f 06
19
lC 02 07 06 07
00 00 00 00

013

38 28 20 OA "IF 06

DB

38H,28H, 20H, OAH, 7fH,6, 64H

lOCB
1000

70 02 01 06 07
00 00 00 00

DB
DB

0,0,0,0

1004

61 50 52 0 F 19 06
19
190200QBQC
00 00 00 00

DB

61H,50H,52H,OFH, 19H,6, 19H

10DB
10EO

DB
DB

19H,2,ODH,OBH,OCH
0,0,0,0

10ELI
10E4
10E6
10E8
10EA

LABEL
OW
OW
OW
OW

WORD

0800
1000
4000
4000

lOC4

;

SET UP FOR 40X25

;

SET UP FOR 80X25

;

SET UP FOR GRAPHICS

;

SET UP FOR 80XZ5 B&W CARD

64

10EC
lOEC

10F4
10F4

M5

28 28 50 50 28 28
50 50

2C 28 20 29 2A 2E
1£ 29

70H,2,1,6,7

; TABLE OF REGEN LENGTHS
4DX25
80X25
GRAPH ICS

2048
4096
1638LI

16384

; ------ COLUMNS
M6
LABEL
BYTE
DB
40,40,80,80,40,40,80,80
;------ C_REG_TAB
M7
LABEL
BYTE
; TABLE OF MODE SETS
DB
2CH,28H,2DH,29H,2AH,2EH,lEH,29H ;

;-------- MEMORY SIZE
ORG

1841
'" 1841
1841
E9 0000 E

ORG
MEMORY S / ZE DI:..1 J:.KM I NE
JMP

QF841H
01841H
EQU
$
MEMORY_S 1ZE_OETERM 1 NE_ 1

EQU I PMENT DETERM I NE

ORGS

5-171

1840
1840
18110
[9 0000 F

eo

OF84011
0184011

ORe
aRC

EQU I PMENT

EaU

S

EQU I PMENT_l

JMP

;---------- CASSETTE (NO BIOS SUPPORT)
1859
'" 1859
1859
E9 0000 E

1A76
1A7E
1A86

1A96
11\9E
lAA6
1AAE
1AB6
lASE
lAC6
lACE
lA06

10
10
38
38
10
38
00
00
FF
FF
00
3C
FF
C3
OF
CC
3C
7E
3F

ORG
OFA6EH
ORC
01A6EH
LABEL
BYTE
OOOH,OOOIl,OOOH,OOOH,OOOH,OOOH,OOOH,OOOH ;

D_OO

DB

07EH,081H,OA5H,081H,OBDH,099H,081H,07EH ;

0_o1

DB

07EH, OFFH, ODSH, OFFH,OC3H, OE7H, OFFH, 07EH ;

o_o2

DB

06CH,OFEH,OfEH,OFEH,07CH,038H,010H,000H ;

o_o3

7C FE 7C 38

DB

010H, 038H, 07CH, OFEH,07CH, 038H, 010H, OOOH ;

o_04

38 FE FE 7C

DB

038H, 07CH, 038H,

FEH, OFEH, 07CH, 038H, 07CH ;

0_05

38 7C FE 7C

DB

01OH,010tl,038H,01CII,OFEH,07CH,038H,07CH ;

0_06

18 3C 3C 18

DB

OOOH,000H,018H,03CH,03CH,018H,OOQl-I,000H ;

0_07

E7 C3 C3 E7

DB

OFFH, OFfH, OE7H, OC3H, OC3H, OE7H,

66 42 42 66

DB

OOOH, 03CH, 066H, 0112H, 0112H, 066H, 03CH, OOOH ;

0_09

99 SO BD 99

DB

OFFH,oe3H,099H,OBDH,OBDII,099H,OC3H,OFFH ;

D_OA

OF 70 CC CC

DB

00 FH, 007H, OOFH, 070H, oeCH, OCCH, OCCH, 078H ;

O_OB

66 66 3C 18

DB

03CH,066H,066H,066H,03CH,018H,07EH,018H ;

D_OC

3F 30 30 70

DB

03FH,033H,03FH,030H,030H,070H,OFOH,OEOH ;

0_00

7F 63 63 67

DB

07FH, 063H, 07FH, 063H, 063H, 067H, OE6H, oeoll ;

D_OE

3C E7 E7 3C

DB

099H, OSAH, 03CH, OE7H, OE7H, 03CH, OSAH, 099H ;

D_OF

F8 FE F8 EO

DB

080H,O£OH,OF8H,OfEH,Of8H,OEOH,080H,OOOH ;

0_10

3E FE 3E DE

DB

002H,OOEH,03£H,OFEH,03£H,OOEH,002H,000H ;

0_11

7£ 18 18 7£

DB

018H, 03CH, 07£H,018H, Ol8H, 07EH, 03CH, 018H ;

o_12

66 66 66 00

DB

066H,066H,066H,066H,066H,OOOH,066H,UUllH ;

LJ_13

DB 7B 18 1B

DB

07FH,OOBH,00BH,07BH,01BH,01BH,01BH,000H ;

0_14

38 6C 6C 38

DB

03EH, 063H, 038H, Q6CH, 06CH, 038H, OCGI-!, 078H ;

0_15

00 00 lE 7E

DB

OOOH, OOOH, OOOH, OOOH, 07EH, 07£H, 07EH, OOOH

7E 18 -rr 3C

DB

o 18H, 03CH, 07EH, 01 8H, 07[H, 03CH,

7E 18 lR 18

DB

o 18H, 03GH, 07EH,

18 18 7E 3e

DB

0' 8H, 0 18H, 018H,

DC FE DC 18

DB

OOOH,

6U H=- 60 30

DB

00011, 030H, 060H,

CO CO CO FE

DB

OOOH, OOOH, OCOH, OCOH, OCOH, 0 FEH, 00011, OOOH

0_1 C

66 FF 66 24

OB

OOOH, 024H, 066H, OFFH, 066H, 024H, OOOH, OOOH

0_10

3C 7E FF FF

DB

OOOH, 018H, 03CH, 01£11, OF FH, OFFH, OOOH, OOOH

0_ 1 E

FF iE 3C 18

DB

OOOH, 0 F FH, OFFH, 07[H, Q3CH, 018H, OOOH, OOOH

0_1 F

00 00 00 00

DB

OOOH,OOOH,OOOH,OOOH,OONI,OOOH,OOOH,OOOH

SP 0_20

78 30 3000

DB

030H, 078H, 078H, 030H, 030H, OOOH, 030H,000H

!

6C 00 00 00

DB

06CH,06CH,06CH,OOOH,OOOH,000H,OOOH,OOOH

"0_22

00 00 00 00 00

00
81 A5 81 BO 99
7E
FF DB FF C3 E7
7E
FE FE FE 7C 38

FO
lADE
1A£6
lA£E
1AF6
1AFE
1 B06
1BOE
1816
1Bl1':
1B26
1B2[
11336
lB3E
1B46
lB4E
1 B56
lB5£
lB66
1 B6E
lB76
1B7E
1B86
lB8E
1896
lB9E
lSA6
18AE
16B6
lBBE
lBC6
1 BCE
1 BD6
lBOE
1 BE6
1 BEE
lBF6
16FE
lC06

7F
E6
99
5A

38
00
7C
7C
10
7C
00
00
FF

FF
3C
00
C3
FF
07
78
66
18
33
EO
63
CO
5A
99

80
80
02
02
18
3C
66
66
7F

EO
00
DE
00
3C
18
66
00
08
18 00
3E 63
CC 78
00 00
7E 00
18 3C
18 FF
HI 3C
18 00
18 18
18 00
00 18
00 00
UO:W
00 00
00 00
00 00
00 21j
00 00
00 18
00 00
00 FF
00 00
00
00
30
30
6C
00
6C
6C
30
30
00
C6
38
76
60
00
18
18
60
60
00
00
00
00
00
30
00
00
00
30
06
80

00
00
78
00
6C
00
6c
00

lC
00
C6
00
6C
00
60
00
30
00
30
00
66
00
30
00
00
60
00
00
00
00
DC
00

7e
7e
30
FC
78
FC
78
78

C6
00
70
00
CC
00
CC
00

5-172

CASSETTE_I 0_1

DB

10 00
lA8E

S

CI1ARACTER GENERATOR GRAPH I es FOR 320X200 AND 640X200 GRAPH I CS

CRT CHAR GEN
00
00
7E
81
7E
FF
6C

Eau

JMP

;
lA6E
1A6E
lA6E

OF85911
01859H

aRC
aRC

CASSEHCIO

-

°

°

18H, 0 18H,

°

°

FFH, OFFH ;

°

0_08

o_16

18H, OFFH

0_17

18H, 018H, OOOH

0_18

°

°

18H, OOOH

0_19

18H, OOGH, 0 FEH, OOCH, 01811, OOOH, OOOH

0_1 A

°

18H, 07£H, 03CH,

°

FEH, 060H, 030H, OOOH, OOOH

0_1 B

0_21

FE 6e FE 6C

08

06CH,06CII,OFEH,06CH,OFEH,06CH,06CH,QOOH

#

CO 78 OC F8

DB

030H, 07CH, OCOH, 078H, OOCH, OF8H, 030H,000H

$ 0_24

CC 18 30 66

DB

OOOH, OC6H, OCCH, 0 1811,03011, 066H, OCuH, OOOH

PER CENT o_25

38 76 DC CC

OB

038H, 06CH, 038H, 076H, OOCH, OCCH, 076H, OOOH

& 0_26

CO 00 00 00

DB

060H, 060H, OCOH, OOOH, OOOH, OOOH, OOOH, OOOH

0_27

60 60 60 30

DB

018H,03011,060H,060H,060H,030H,018H,OOOH

{0_28

0 23

18 18 18 30

DB

060H,030H,01BH,018H,018H,030H,060H,000H

) o_29

3C FF 3C 66

DB

OOOH, 066H, 03CH, OFFH, 03CH, 066H, OOOH, 00011

*

30 FC 30 30

DB

OOOH, 030H, 030H,

FCH, 030H, 030H, OOOH, OOOH

+ D_26

00 00 00 30

DB

OOOH, OOOH, OOOH, OOOH, OOOH, 030H,030H, 060H

,D_<'C

00 Fe 00 00

DB

OOOH,OOOH,OOOH,OFCH,OOOH,OOOH,OOOH,OOOH ;- o_20

00 00 00 30

DB

OOOH, OOOH, OOOH, OOOH, OOOH, 030H, 030H, OOOH

18 30 60 CO

DB

006H, OOCH, 018H, 030H, 060H, OCOH, 080H,OOOH

/

CE DE F6 E6

08

07CH, OC6H, OCEH, ODEH, 0 F6H, OE6H, O/CH, OOOH

0 0_30

30 30 30 30

DB

030H, 070H, 030H, 030H, 030H, 030H,OFCH,000H ;

1 0_31

oe 38 60 ee

DB

078H, OCCH, OOCH, 038H, 060H, OCCH, OFCH, UOUH ;

2 0_32

DC 38 oc CC

DB

078H, OCCH, OOCH, 038H, OOCH,OCCH,078H, OOOH ;

3 0_33

ORGS

°

D_2A

D_2E
0_2F

lCOE

6C CC FE DC

DB

01CH,03CH,06CH,OCCH,OFEH,OOCH,01EH,OOOH ;

4 0_34

F8 DC OC CC

DB

OFCH,OCOH,OF8H,00CH,00CH,OCCH,078H,OODH ;

5 o_35

ec

DB

03BH,060H,OCOH, OF8H, OCCH, OCCI!, 078H, OOOH ;

6 o_36

DC 18 30 30

DB

OFCH, OCCH,OOCH, 01SH, 030H, 030H, 030H, 00011 ;

7 o_37

lC5E

le 3C
1E 00
Fe co
78 00
3860
78 00
Fe CC
30 00
n ce
78 00
78 ce
70 00
00 30
30 00
00 30
30 60
18 30
18 00
00 00
00 00
60 30

18 oe 18 30

DB

060H,030H, 018H, OOCH, 018H, 030H, 060H, OOOH ;

lC66

78 CC OC 18 30 00

DB

078H,OCCH, OOCH, 018H, 030H, OOQH, 030H, OOOH

? 0_3F

DE DE DE CO

DB

07CH, OC6H, OOEH, OOEH, OOEH, OCOH, 078H, OOOH

@ 0_110

cc

DB

030H,078H,OCCH,OCCH,OFCH,OCCH,OCCH,000H ;

A o_41

66 66

DB

OFCH,06GH,066H,07CIl,066H,066H,OFCH,000H

B o_42

66

DB

03CH,066H, oeOH, oeOH, OCOH, 066H, 03CH, OOOH

C D_ 43

66 66 66 6C

DB

OF8H,06CH,066H,066H,066H,06CH,OF8H,OOOH

°

68 78 68 62

DB

orEH,062H, 068H, 07811, u61:$H, 062H, orEH, OOOH

E 0_4:;

68 78 68 60

DB

OFEH,062H,068H,078H,068H,060H,OFOH,OOOH;

F 0_46

CO CO C[ 66

DB

03CH,066H,OCOH,OCOH,OCEH,066H,03EH,000H ;

G 0_47

CC cc cc Fe CC cc
cc 00
78 30 30 30 30 30

DB

OCCll, OCCH, UCCH, OFCH, oeCH, OCCH, OCCH, OOOH ;

H 0_118

DB

078H,030H,030H,030H,030H,030H,078H,000H

I 0_lj9

ec

DB

01 fH, (lOCH, OOCH, OOCH, QCCH, OCCH, 078H, OOOH

J 0_ 4A

66

DB

OE6H, 066H, 06CH, 0781-1, 06CH, 066H, OE6H, OOOH

K 0_ 4B

66

DB

OFOH,060H,060H,060H,062H,066H,OfEH,OOOH

L D_4C

DB

OC6H,OEl:.H,OFEH,OFEH,oo6H,OC6H,oc6H,OOOh

M o_40

DB

OC6H, OE61-1, OF6H, OOEH, OCEH, DC6H, DC6H, OOOH

N 0_ 4E

DB

038H, 06CH, OC6H,OC6H,OC6H, 06CH, 038H, OOOH

°

7C 60 60

DB

OFCH,066H,066H,07CH,060H,060H,OFOH,000H

PO_50

CC DC 78

DB

078H,occH,oecH,oceH,ODcH,078H,01CH,OOOH

Q 0_51

7C 6G

66

DB

OfCH,066H,066H,07CH,06CH,066H,OE6H,OOOH

R 0_:>2

70 Ie

cc

DB

078H, OCCH, OEOH, 070H, OICH, OCCH, 078H, OOOH

SO_53

30 30 30

DB

OFCH, OB4H, 030H, 030H, 030H, 030H, 07811, OOOH

TO_54

CC CC CC

08

OCCH,OCCH,OCCH,OCCH,OCCH,OCCH,OFCH,OOOH

U 0_'::>5

CC CC 78

DB

OCCH,OCCH,OCCH,OCCH,OCCH,078H,030H,000f!

v

fCE E.E

DB

OC611, OC6H, OC6H, 006H, OFEH, OEEH, OC6H, OOOH

W 0_57
X 0_58

lC16
lCIE
1 C26

lC2[
lC36
lC3E
lC46
1C4E
1C56

CO F8

cc

cc

07BH,OCCll,OCCH,0781-I,OCC!l,OCC11,078H,000H ;

8 0_38

ec 7C DC 18

DB

078H,OCCH,OCCH,07CH,00CH,018H,070H,OOOH

9 o_39

30 00 00 30

DB

OOOH, 030H, 030H, OOOH, OOOH, 030H, 030H, OOOH;

30 00 00 30

DB

OOOH,030H,030H,OOOH,OOOH,030Ii,030H,060H;

ec 78 ec

O_3A
;

0_36

60

co

60 30

DB

018H,030H,060H,QCOH,060H,030H,018H,OOOH ;

< O_3C

re

00 00 Fe

DB

OOOH,OOOH,OFCH,OOOH,OOOH,OFCH,OOOll,OOOH ;

'" 0_30

> 0_3E

60 00
30 00
le6E
1C76
1C7£
1 C86

lC8E

lC96
IC9E

1 CAG
1 CAE

lCB6

7C C6
78 00
30 78
CC 00
FC 66
FC 00
3C 66
3C 00
F8 6C
F8 00
FE 62
FE 00
FE 62
FO 00
3C 66
3E 00

CC CC Fe
66 7C

co co eo

78 00
1 eBE

lGC6

1 GeE
1COG
lCOE
lCE6
lCEE

lCFG
1eFE
1006
100E
1016
1D1E
1026
l02E
1036
103E
1046
104E
1056
lD5E
1066
106E
1076
107 E
1086
108E
1096
109E
101\6
lDAE
1066
lOBE
10C6
10CE
1006
lODE

10E6
1 DEE

1 E DC DC OC CC

78 00
[666 6C 78 6e
£6
FO 60 60 60 62

uo

F[
e6
e6
G6
CG
38
38

00
EE FE FE 06 c6
00
£6 F6 DE C[ C6
00
6C C6 C6 C6 6e
00

FC 66 66
Fa 00
CC ee
00
66 66
00
ce EO
00
84 30
00
ce cc
00
CC CC
00
C6 C6
00
C6 6C
00
CC CG
00
C6 8C
00
60 60
00
CO 60 30
02 00
78 18 18
78 00
10 38 6C
00 00
00 UU 00
00 rF
78
lG
FC
F6
78
78
FC
78
CC
FC
CC
30
C6
C6
C6
C6
CC
78
FE
FE
78
78

30
00
00
76
EO
DC
00
78
IC
76
00
78
38
FD
00
OC
EO
[6
30
78
DC
CC
EO
E6
70
78
00
C6
00

[)6

0_44

0_ 4F

0_56

38 38 6C

DB

OC6H, OC6H, 06CH, 038H, 038H, 06CH, OC6H, OOOH

78 30 30

DB

DCCH, OCCH, OCCH, 078H, 030H, 030H, 078H, 00011 ;

YO_59

18 32 66

DB

OFEH,OC6H,08CH,018H,032H,066H,OFEH,OOOH

Z 0_5A
05B

60 60 60

DB

D78H,060H,060H,06oH,060H,060H,078H,000H ;

[

18 OC 06

DB

OCOH, 060H, 030H, 0 18H, OOCH, 006H, 00211, OOOH ;

BACKSlASH 0_5C

°

18 18 18

DB

078H,018H,018H,018H,018H,018H,078H,OOOll;

1

C6 00 00

DB

01 OH, 038H, 06CH, OC6H, OOOH, OOOH, OOOH, OOOH

CIRCUMFLEX 0_5E

00 00 00

DB

OOOH,OOOH,OOOH,OOOH,OOOH,OOOH,OOOH,OFFH

°

30 18 00 00 00

DB

030H, 03011, 01BH, OOOH, OOOH, OOOH, GOOH, OOOH

o_60

780C 7C CC

DB

OQOH,00011,078H,OOCH,07CH,OCCH,076H,OOOH

LOWER CASE A o_61

60 7C 66 66

DB

OEOH, 060H,060H, 07CH, 066H, 066H, OOCH, OOOH ;

L. C.

B 0_62

78 CC co CC

DB

OOOH,0001-!,078H,OCCH,OCQH,OCCH,078H,000H ;

L.C.

C 0_63

0ICH,OOCH,OOCH,07CH,OCCH,OCCll,0'16H,OGOH;

L.C.

00_611

OOOH,000H,078H,OCCH,OFCH,OCOH,078H,000H ;

L.C.

E o_65

50

5F

00
00
00
60
00
00
00
OC
00
00
00
6C
00
00
FS
60
00
00
00
00
78

DC 7C CC CC
78 CC FC CO

DB

60 FQ 60 60

DB

038H,06cH, 0601'1, OFOH. 060H, 060H, OFOH, OOOH ;

L. C.

f

76 CC CC 7C

DB

OOOH,OOOH,076H,OCCH,OCCH,07CH,OOCH,Of8H ;

L.C.

G 0_67

0_66

6C 76 66 66

DB

OEOH,060H,06CH,076H,066H,066H,OE6H,000H ;

L.C.

H 0_68

70 30 30 30

08

030H.000H,070H,030H,030H,030H,078H,OOOH

L.C.

I

0_69

OC OC DC CC

DB

00CH,000H,OOCH,OOCH,OOCH,OCCH,OCCH,078H

t•• C. J

D_6A

60 66 6c 78 6C

DB

OEOH, 060H.066H, 06CH, 078H, 06CH, OE6H, OOOH

L.C.

070H, 030H, 030H, 030H, 0301-1, 030H, 078H, OOOH

L. C.

L D_6C

000H,000H,OCCH,OFEH,OFEH,006H,QC6H,OOOH

L.C.

M o_60

DB

OOOH,OOOH,OF8H,OCCH,OCCH,OCCH.OCCH,000H

L.C. N D_6E

00
30 30 30 30 30

K 0_68

00

00 CC FE FE 06
00
00 F8 CC CC CC
CC 00
00 00 78 CC CC CC
78 00

DB

DB

OOOH,000H,078H,OCCH,OCCH,OCCH,078H,OOOH ;

L.C.

°

00 00 DC 66 66 7C
60 FO

DB

OOOH,OOOH,OOCH,066H,066H,07CH,060H,OFOH;

LC.

P o_70

0_6f

ORGS

5-173

10f6

00 00
DC lE
00 00
fO 00
00 00
F8 00
10 30
18 00
00 00
76 00
00 00
30 00
00 00
6C 00
00 00
C6 00
00 00
DC F8
00 00
FC 00
1C 30
1C 00
18 18
18 00
EO 30
EO 00
76 DC
00 00

lOfE
lE06

1 EOE
1 E16

1 E1 E
1 E26
1 E2E
1E36
1 E3E
1E46
1 E4E
1 E56

1 ESE
1E66

76 CC CC 7C

DB

OOOH, OOOH, 076H, OCCH, OCCH, 07CH, OOCH, 01 EH ;

L.C.

Q

DC 76 66 60

DB

OOOH, OOOH, OOCH, 076H, 066H, 060H, 0 FOH, OOOH

L.C.

R 0_72

0~7l

o_73

7C CO 78 DC

DB

OOOH, OOOH, 07CH, OCOH, 07BH, OOCH, OF8H, OOOH ;

L.C.

S

7C 30 30 34

DB

01011, 030H, 07CH, 030H, 030H, 034H, 01 8H, OOOH

L.C.

T 0_74

CC CC CC CC

DB

OOOH, OOOH, OCCH, OCCH, OCCH, QCCH, 076H. OOOH

L.C.

U o_75

CC CC CC 78

DO

OOOH, OOOH, OCCH, OCCH, OCCH, 07BH, 030H, OOOH

L.C.

V o_76

C6 06 FE FE

DB

OOOH, OOOH, OC6H, 006H, OFEH, OFEH, 06CH, OOOH ;

L.C. W

C6 6c 38 6C

DO

OOOH, OOOH, OC6H, 06CH, 038H. 06CH, OC6H, OOOH ;

L.C.

CC CC CC 7C

DB

OOOH, OOOH, OCCH, OCCH, OCCH. 07CH, OOCH, OfBH

L. C. Y 0_79

FC 98 30 64

DB

OOOH, OOOH,

30 EO 30 30

DB

01 CH, 030H, 030H, OEOH, 030H, 030H, 0 1CH, OOOH ;

aFCH, 09BH, 030H, 064H, OFCH, OOOH

;

L. C.

Z 0_7A

0_7B

I

18 00 18 18

DB

018H, 01 BH, 0 18H, OOOH, 018H, 01 8H, 0 18H, OOOH ;

30 lC 30 30

DB

OEOH, 030H, 030H, 0 1 CH, 030H, 030H, OEOH, OOOH ;

0_70

00 00 00 00

DB

076H, OOCH, OOOH, OOOH, OOOH, OOOH, OOOH, OOOH ;

D_7E

DB

OOOH, Q10H, 038H, 06CH, OC6H, OC6H, OFEH, OOOH

00 10 38 6C C6 C6
FE 00

0_77

X o_78

0_7C

OELTA D_7F

.LI ST

; ------ T I ME OF OAY
ORG
ORG

1E6E
'" 1 E6E
1 E6E
E9 0000 E

EQU
JMP
;-------- TIMER

1 EA5
'" lEA5
1 EA5
E9 0000 E

o FE6EII
01 E6EH

$
TIME_OF_DAY_1

INTERRUPT
ORG
ORG

OFEA5H
01 EA5H

EQU
JMP

S

TIMER_INT_l

; -------- VECTOR TABLE
ORG
ORG

1 EF3
1EF3

1EF3
1 U5
1 EF7
1 EF9

1 ErO
1 EFO
1 EFF
1 FOl

VECTOR_TABLE
lEAS
0987
0000
0000
0000
0000
OFS7
0000

R

OW

R
E
E
E
E
R

DW
DW
DW
DW
OW
OW

ow

E

LABEL

ow

lF15
lF17
lF19
1F1B
1 FlO
1F1F
1 F21

06F2
1t::6E
lF53
1F53
10A4
OFC7
0000

DW
OW

DW
OW

ow
011

ow
ow
Ow
ow

R
R
R
R
R
R

[Jw

ow
OW

ow
OW

Ow

1 F23
1 F25
1 F27
1 F29
1 F2B
1 F20
1 F2F
lF31

OW
OW
OW
OW

0000
UOOO
0000
0000
0000
0000
0000
0000

Ow

OW

ow
Ow

; ------- DUMMY

1F53
'" 1 F53
1 F53

OUMMY_RETURN

; -------

1 F54
'" 1 F54
1 F54
E9 0000 E

5-174

;

INT 10H
INT 11H

g~~~~~ ~T~~~iT~I~~_OETERMI7~T
OFFSET RS232 10CASSETTE: 10 OFFSET KEYBOARD 10
OFFSET PRINTER To
OOOOOH
OF600H
OFFSET BOOT STRAP
TIME OF OAYDUMMY RETURN
DUMMY-RETURN
VIDEO-PARMS
OFFSET 0151< BASE

o

-

OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET
OFFSET

RTC (NT
RE DIRECT
01T
011
011
INT_287
011
011

13H

INT 12H

INT lllH
INT 15H
INT 16H
INT 17H
I NT 1BH
MUST BE INSEIHEO INfO TABLE LATER
I NT 19H
INT 1AH -- TIME OF OAY
INT lBH -- KEYBOARD BREAK AOOR
INT lCH -- TIMER BREAK AODR
INT lDH -- VIDEO PARAMETERS
INT lEH -- DISK PARMS
INT lFH -- POINTER TO VIDEO Exr
; ( INTERRUPT 70 THRU 7F)
INT
INT
I NT
I NT
I NT
I NT
INT
INT

70 REAL TIME CLOCK INTfRRUPT VECTOR
71 REDIRECT TH IS TO INT A
72
73
71~

75 MATH PROCESSOR I NTt::HHUPT
76
77

I NTERRUPT HANDLER
ORG
ORG

OFF53H
01 F53H

EQU

S

IRET

CF

ORGS

. LI Sl

INPUT)

INTERRUPTS

OFfSET VIDEO 10
OFFSET [QUI PMENT

SLAVE_VECTOR TABLE LABEL WORD

1 F23

VECTOR TABLE
INTERRUPT 8
INTERRUPT 9
INTERRUPT A (SLAVE
INTERRUPT B
INTERRUPI (;
INTERRUPT 0
I NTERRU PT E
INTERRUPT f

OFFSET TIMER INT
OF FSET
KB I NT
OFFSET
D1T
OFFSET
011
OffSET
011
OFFSET
011
OFFSET DISK INT
OFFSET
D11

;------- SOfTWARE
1 F03
1065 R
1 FO~
1840 R
lF07
1841 R
OCS9 R
1 F09
1 FOB
0739 R
1859 R
1 FaD
1 FOF
082E R
lFl10F02R
1 F13
0000

OFEF3H
01 EF3H
WORD

PR I N r SCREEN
OFF5 t lH
01 F54H

ORG
ORG
[QU

S

JMP

PRINT_SCREEN_l
;

TUTOR

POWER ON RESET VECTOR
ORC
OFFFOH
aRC
01 FFOH
PUBLIC
r 0 R
; ------ POWER ON RESET
P_O_R
LABEL
fAR

1 FFO
1 FFO
HFO
1FF1
HF3
1FF5
1FFE
HfE
lFfF

EA

DB

005B R
FOOO

ow

30 31 2F 31
38 34

DW

30 2F

FC

CODE

OEAH
OFfSET
OFOOOH

RESEr

; HARD CODE JUMP
;OFFSO
; SEGMENT

DB

'01/10/84'

; RELEASE MARKER

DRC

01 FFEH
OFCH

;TH IS

DB
ENDS
END

pc's

10

ORGS

5-175

5·176

ORGS

SECTION 6. INSTRUCTION SET

Contents
Instruction Sets

6-3

80286 Microprocessor Instruction Set .................. 6-3
Data Transfer ................................. 6-3
Arithmetic .................................... 6-6
Logic ....................................... 6-10
String Manipulation ............................ 6-12
Control Transfer .............................. 6-13
Processor Control ............................. 6-19
Protection Control ............................ 6-21
80287 Coprocessor Instruction Set ...................
Data Transfer ................................
Comparison ..................................
Constants ...................................
Arithmetic ...................................
Transcendental ...............................
Processor Control .............................

6-24
6-24
6-25
6-26
6-27
6-29
6-29

Instruction Set 6-1

Notes:

6-2 Instruction Set

Instruction Set
80286 Microprocessor Instruction Set
T~e

following is an instruction set summary for the Intel 80286
mIcroprocessor .

Data Transfer
MOV

= move
Register to Register Memory

10001 OOW

mod reg r/w

1000101w

mod reg r/w

1100011w

mod 000 r/w

Register/Memory to Register

1011wreg

I data

data if w = 1

Immediate to Register

I data if w = 1

Memory to Accumulator
1010000w

I addr-Iow

1010001w

I addr-Iow

I addr-high
Accumulator to Memory

I addr-high

ister
10001110

Instruction Set 6-3

Segment Register to Register Memory
10001100

modO reg r/w

PUSH = Push
Memory
11111111

modl10 r/w

Register
01010reg

Segment Register

I 000regl10
I 01101050

Immediate
data

I data if

5 =

0

PUSHA = Push All
Push All

I 01100000
POP = Pop

Memory
10001111

modOOO r/m

Register

I 01011 reg

I 000regl11

Segment Register
reg", 0

POPA = POp All

I 01100001

6-4 Instruction Set

Pop All

XCHG

= Exchange

1000011w

Register Memory with Register
1 mod reg rim

Register with Accumulator
10010reg

IN

= Input From
Fixed Port

1110010w

1 port

Variable Port
1110110w

OUT

= Output To
Fixed Port

1110011 w

port

Variable Port
1110111 w

XLAT

= Translate Byte to AL
Translate Byte to AL

111010111

LEA = Load EA to Register
Load EA to Register
1 10001101

LDS

1 mod reg rim

= Load Pointer to DS
Load Pointer to OS

11000101

1 mod reg rim

mod", 11

Instruction Set 6-5

LES = Load Pointer to ES

I 11000100

Load Pointer to ES
mod ¢ 11

I mod reg rim

LAHF = Load AH with Flags
Load AH with Flags

I 10011111

SAHF = Load AH with Flags
Store AH with Flags

110011110

PUSHF

= Push Flags
Push Flags

1 10011100

POPF = Pop Flags
Pop Flags

10011101

Arithmetic
ADD = Add
Reg/Memory with Register to Either

1 oOOOOOOw

I mod reg rim

100000sw

1 0000010w

data if sw = 01

I data

Immediate to Accumulator

ADC = Add with Carry

6-6 Instruction Set

I data if w = 1

000100dw

Reg/Memory with Register to Either
mod reg rim

100000sw

data if sw = 01

Immediate to Accumulator
000101 Ow

INC

I data if w = 1

data

= Increment
Register/Memory

1111111w

modOOO rim

Register
01000reg

SUB

= Subtract
Reg/Memory with Register to Either

001010dw

mod reg rim

Immediate from Register Memory
100000sw

mod101 rim

0010110w

data

I data

I data if sw = 01

Immediate from Accumulator

I data if w = 1

SBB = Subtract with Borrow

I 000110dw

Reg/Memory with Register to Either
mod reg rim

Immediate to Register Memory
100000sw

mod011 rim

data

data if sw = 01

Instruction Set 6-7

10001110w

Immediate to Accumulator

I data

I data ifw= 1

DEC = Decrement
Register/Memory
lllll11w

modOOl rim

Register

I 01001 reg
CMP = Compare

I 0011101w

Register/Memory with Register
mod reg rim

I 0011100w

mod reg rim

Register with Register/Memory

100000sw

I 0001110w

Data if sw = 01

Immediate with Accumulator

I Data if w = 1

Data

NEG = Change Sign
Change Sign
11111011w

I modOll

rim

AAA = ASCII Adjust for Add
ASCII Adjust for Add
100110111

DEC = Decimal Adjust for Add
Decimal Adjust for Add

I 00100111

6-8 Instruction Set

AAS = ASCII Adjust for Subtract
ASCII Adjust for Subtract

I 00111111
DAS

= Decimal Adjust for Subtract

I 00110111

Decimal Adjust for Subtract

MUL = Multiply (Unsigned)

I 1111011w I mod100

Multiply

rIm

IMUL = Integer Multiply (Signed)
Integer Multiply
11111011w

I mod101

rIm

IIMUL = Integer Immediate Multiply (Signed)
Integer Immediate Multiply
! 011010s1

I mod reg

rIm

! Data

! Data if s

=0

DIV = Divide (Unsigned)
Divide
!1111011w

! mod110

rIm

IDIV = Integer Divide (Signed)
Integer Divide
!1111011w

! mod111

rIm

AAM = ASCII Adjust for Multiply
ASCII Adjust for Multiply
!11010100

AAD

! 00001010

= ASCII Adjust for Divide

Instruction Set 6-9

ASCII Adjust for Divide
11010101

CBW

1 00001010

= Convert Byte to Word
Convert Byte to Word

110011000

CWD

= Convert Word to Double Word
Convert Word to Double Word

10011001

Logic
Shift Rotate Instructions
Register Memory by 1
1101000w

1 modTTTr/m

1101001w

1 mod TTT rim

1100000w

1 mod TTT rim

Register Memory by CL

Register Memory by Count
1 Count

T T T Instruction
000 ROL
001 ROR
010 RCL
011 RCR
100 SHL/SAL
101 SHR
111 SAR
AND

= And
Reg/Memory and Register to Either

1 001000dw

1 mod reg rim

6-10 Instruction Set

Data if w = 1

1000000w

I 0010010w

Data

Immediate to Accumulator
Data if w = 1

I

TEST = AND Function to Flags; No Result
100001 Ow

Register Memory and Register
mod reg rim

1111011w

modOOO rim

0000110w

Data

Immediate Data and Register Memory

I Data

I Data if w=1

Immediate to Accumulator

I Data if w = 1

Or= Or
Reg/ Memory and Register to Either
000010dw

mod reg rim

1000000w

mod001 rim

0000110w

Data

Immediate to Register Memory

I Data

I Data if w = 1

Immediate to Accumulator

I Data if w = 1

XOR = Exclusive OR
Reg/Memory and Register to Either
001100dw

mod reg rim

1000000w

mod110 rim

Immediate to Register Memory

I Data

I Data if w = 1

Instruction Set 6-11

I 0010010w

Immediate to Accumulator

I Data if w = 1

Data

NOT = Invert Register/Memory
Invert Register/Memory
1111011w

I mod01O rim

String Manipulation
MOVS

= Move Byte Word
Move Byte Word

I 1010010w
CMPS

= Compare Byte Word
Compare Byte Word

11010011w

seAS

= Scan Byte Word
Scan Byte Word

I 1010111w

LODS = Load Byte Word to AL/AX
Load Byte Word to AL/AX

11010110w

STOS = Store Byte Word from AL/ AX
Store Byte Word from AL/AX

11010101w

INS = Input Byte from DX Port
Input Byte Word from OX Port

I 0110110w

6-12 Instruction Set

OUTS

= Output Byte to DX Port
Output Byte Word to OX Port

1 0110111 w

MOVS = Move String
Move String
111110010

CMPS

11010010w

= Compare String
Compare String

1 1111001z

SCAS

11010011w

= Scan String
Scan String

111110010

LODS

11010111w

= Load String
Load String

1 11110010

STOS

1 1010110w

= Store String
Store String

111110010

INS

11010101w

= Input String
Input String

1 11110010

OUTS

1 011011 Ow

= Output String
Output String

11110010

11010011w

Control Transfer

Instruction Set 6-13

CALL = Call
Direct Within Segment

11101000

I disp-Iow

I disp-Iow

11111111

I mod010 rim

Register/Memory Indirect Within Segment

10011010

Se

Protected Mode Only (Direct Intersegment)
•

Via call gate to same privilege level

•

Via call gate to different privilege level, no parameters

•

Via call gate to different privilege level, x parameters

•

Via TSS

•

Via task gate.
Indirect Interse ment

11111111

mod011 rim (mod#11)

Protected Mode Only (Indirect Intersegment)
•

Via call gate to same privilege level

•

Via call gate to different privilege level, no parameters

•

Via call gate to different privilege level, x parameters

•

Via TSS

•

Via task gate.

JMP = Unconditional Jump
11101011

I disp-Iow

11101001

I disp=low

Short/Long

Direct within Segment

6-14 Instruction Set

I disp-high

Indirect Within Se ment

11111111

11101010

Se

Protected Mode Only (Direct Intersegment)

•

Via call gate to same privilege level

•

Via TSS

•

Via task gate.
Indirect Intersegment

11111111

mod101 rim (mod ¥- 11)

Protected Mode Only (Indirect Intersegment)

•

Via call gate to same privilege level

•

Via TSS

•

Via task gate.

RET = Return from Call
Within Segment

11000011

11000010

Intersegment

11001011

11001010

Protected Mode Only (RET)

•

To Different Privilege Level

Instruction Set 6-15

JE/ JZ

= Jump on Equal Zero

I 01110100

Jump on Equal Zero

I disp

JL/JNGE = Jump on Less Not Greater, or Equal

I 01111100

Jump on Less Not Greater, or Equal

I disp

JLE/JNG = Jump on Less, or Equal Not Greater

I 01111110
JB/JNAE

I 01110010

Jump on Less, or Equal Not Greater

I disp
= Jump on Less, or Equal Not Greater
Jump on Less, or Equal Not Greater

I disp

JBE/JNA = Jump on Below, or Equal NotAbove
Jump on Below, or Equal Not Above

I 01110110 I disp
JP/ JPE = Jump on Parity Parity Even
Jump on Parity Parity Even

101111010

I disp

JO = Jump on Overflow
Jump on Overflow

I 01110000
JS

I disp

= Jump on Sign
Jump on Sign

I 01111000

I disp

JNE/ JNZ = Jump on Not Equal Not Zero

6-16 Instruction Set

I 01110101

Jump on Not Equal Not Zero

I disp

JNL/ JGE = Jump on Not Less Greater or Equal
Jump on Not Less Greater or Zero

I 01111101

I disp

JNLE/JG = Jump on Not Less or Equal Greater

I 01111111
JNB/JAE

Jump on Not Less or Equal Greater

I disp
= Jump on Not Below Above or Equal
Jump on Not Below Above or Equal

I 01110011

I disp

JNBE/ JA = Jump on Not Below or Equal Above
Jump on Not Below or Equal Above
101110111

JNP / JPO

I disp

= Jump on Not Parity

Parity Odd

Jump on Not Parity Parity Odd

I 01111 011
JNO

I disp

= Jump on Not Overflow
Jump on Not Overflow

I 01110001
JNS

I disp

= Jump on Not Sign

I 01111 011

Jump on Not Sign

I disp
LOOP = Loop ex Times

Instruction Set 6-17

loop

11100010

ex Times

1 disp

LOOPZ/LOOPE

= Loop while Zero Equal
loop while Zero Equal

1 11100001

1 disp

LOOPNZ/LOOPNE

= Loop while Not Equal Zero
loop while Not Equal Zero

1 11100000

JCXZ

1 disp

= Jump on CX Zero
Jump on

1 11100011

ex Zero

1 disp

ENTER = Enter Procedure
Enter Procedure

11001000

1 data-low

1 data-high

L=O
L=l
L>l
LEAVE

= Leave Procedure
Leave Procedure

111001001

INT = Interrupt
Type Specified

11001101

1 Type

Type 3

11001100

6-18 Instruction Set

1L

INTO = Interrupt on Overflow
Interrupt on Overflow

111001110

Protected Mode Only
•

Via interrupt or trap gate to same privilege level

•

Via interrupt or trap gat to different privilege level

•

Via task gate.

IRET = Interrupt Return
Interrupt Return

1 11001111

Protected Mode Only
•

To same privilege level

•

To different task (NT = 1).

BOUND

= Detect Value Out of Range
Detect Value Out of Range

1 01100010

1 mod reg rIm

Processor Control
CLC = Clear Carry
Clear Carry

11111100

CMC

= Complement Carry
Complement Carry

1 11001111

STC

= Set Carry
Set Carry

11111001

Instruction Set 6-19

CLD = Clear Direction
Clear Direction

111111100

STD

= Set Direction
Set Direction

1 11111101

CLI Clear Interrupt
Clear Interrupt

111111010

STI

= Set Interrupt
Set Interrupt

1 11111011

HLT

= Halt
Halt

111110100

WAIT

= Wait
Wait

110011011

LOCK = Bus Lock Prefix
Bus Lock Prefix

111110000

CTS

= Clear Task Switched Flag
Clear Task Switched Flag

1 00001111

ESC

1 00000110

= Processor Extension Escape

6-20 Instruction Set

Processor Extension Escape

10011TTT

modLLL rim

Protection Control
LGDT = Load Global Descriptor Table Register
00001111

SGDT = Store Global Descriptor Table Register
Store Global Descriptor Table Register

I 00001111

I 00000001

I modOOO rim

LIDT = Load Interrupt Descriptor Table Register
Load Interrupt Descriptor Table Register

I 00001111

I 00000001

I mod011 rim

SIDT = Store Interrupt Descriptor Table Register
Store Interrupt Descriptor Table Register

I 00001111

I 00000001

I mod001 rim

LLDT = Load Local Descriptor Table Register from Register
Memory
00001111

SLDT = Store Local Descriptor Table Register from Register
Memory
Store Local Descriptor Table Register from Register Memory

I 00001111

I 00000000

I modOOO r / m

LTR = Load Task Register from Register Memory
load Task Register from Register Memory

I 00001111

I 00000000

I mod011 r / m

Instruction Set 6-21

STR

= Store Task Register to Register Memory

00001111

LMSW

00000000

= Load Machine Status Word from Register Memory
Load Machine Status Word from Register Memory

100001111

SMSW

I mod110rlm

100000001

= Store Machine Status Word
Store Machine Status Word

100001111

I 00000001

I mod100 rim

LAR = Load Access Rights from Register Memory
Load Access Rights from Register Memory

I 00001111

I 00000010

I mod reg rim

LSL = Load Segment Limit from Register Memory
Load Segment Limit from Register Memory

I 00001111
ARPL

I 00000011

I mod reg rim

= Adjust Requested Privilege Level from Register Memory
Adjust Requested Privilege Level from Register Memory

I 01100011

I mod reg rim

VERR = Verify Read Access; Register Memory
Verify Read Access; Register Memory

I 00001111
VERR

I 00000000

I mod100 rim

= Verify Write Access
Verify Write Access

100001111

I 00000000

I mod101 rim

Note: The effective address (EA) of the memory operand is
computed according to the mod and rim fields:
If mod = 11, then rim is treated as a reg field.
If mod

= 00, then disp = 0, disp-low and disp-high are absent.

6-22 Instruction Set

If mod = 01, then disp = disp-low sign-extended to 16 bits,
disp-high is absent.
If mod

= 10, then disp

= disp-high:disp-low.

= (BX) + (SI) + disp
If rim = 001, then EA = (BX) + (SI) + disp
If rim = 010, then EA = (BP) + (SI) + disp
If rim = all, then EA = (BP) + (DI) + disp
If rim = 100, then EA = (SI) + disp
If rim = 000, then EA

+ disp
If rim == 110, then EA ::: (BP) + disp
If rim = 111, then EA = (BX) + disp
If rim = 101, then EA = (DI)

disp follows the second byte of the instruction (before data if
required).
Segment Override Prefix

I 001reg001

Segment Override Prefix

reg is assigned as follows:
reg

Segment Register

00

ES

01

CS

10

SS

11

DS
16-bit (w = 1)

8-bit (w= 0)

000 AX
001 CX
010 OX
011 BX
100 SP
101 BP
110 SI
111 01

OOOAl
001 Cl
0100l
011 Bl
100AH
101 CH
1100H
111 BH

Instruction Set 6-23

The physical addresses of all operands addressed by the BP
register are computed using the SS segment register. The physical
aadresses of the destination operands of the string primitive
operations (those addressed by the DI register) are computed
using the ES segment, which may not be overridden.

80287 Coprocessor Instruction Set
The following is an instruction set summary for the 80287
coprocessor.

Data Transfer
FLD = Load
Integer/Real Memory to ST(O)

I escape MF 1

I mod 000 rim

I escape 111

I mod 101 rim

I escape 011

I mod 101 rim

I escape 111

I mod 100 rim

I escape 001

11000ST(i}

Long Integer Memory to ST(O)

Temporary Real Memory to STlO)

BCD Memory to ST(O)

ST(i) to ST(O)

FST = Store

I escape MF 1

ST(O) to Integer/Real Memory

I mod 010 rim

ST(O) to ST(i)

I escape 101

11010 ST(i}

6-24 Instruction Set

FSTP = Store and Pop
ST(O) to Integer/Real Memory

I escape MF 1

I mod011 rim

I escape 111

I mod 111 rim

I escape 011

I mod 111 rim

I escape 111

I mod 110 rim

I escape 101

11011 STIi)

ST(O) to Long Integer Memory

ST(O) to Temporary Real Memory

ST(O) to BCD Memory

ST(O) to ST(i)

FXCH = Exchange ST(i) and ST(O)
Exchange ST(i) and ST(O)

I escape 001

11001 ST(j)

Comparison
FCOM = Compare

I escape MF 0

Integer/Real Memory to ST(O)

I mod 010 rim

ST(i) to ST(O)

I escape 000

11010 STIi)

FCOMP = Compare and Pop
Integer/Real Memory to ST(O)

I escape MF 0

I mod 011 rim

Instruction Set 6-25

ST{i) to ST(O)
1 escape 000

1 11010ST(i)

FCOMPP == Compare ST(i) to ST(O) and Pop Twice
Compare ST{i) to ST(O) and pop twice

1 escape 110

111011001

FTST ... Test ST(O)
TestST(O)
1 escape 001

1 11100100

FXAM ... Examine ST(O)
Examine ST(O)
1 escape 001

111100101

Constants
FLDZ = Load

I escape 000
FLDI ... Load

+ 0.0 into ST(O)
Load + 0.0 into ST(O)
111101110

+ 1.0 into ST(O)
Load + 1.0 into ST(O)

1 escape 001

1 11101000

FLDPI - Load 'TT'into ST(O)

'TT' into ST(O)

Load
1 escape 001

1 11101011

FLDL2T == Load log2 10 intoST(O) 210 into ST(O)
Load log

1 escape 001

111101001

6-26 Instruction Set

FLDLG2

= Load log10 2 into ST(O) 10 2 into ST(O)
Load log

1 escape 001

FLDLN2

111101100

= Load loge 2 into ST(O) e 2 into ST(O)
Load log
11101101

1 escape 001

Arithmetic
FADD

= Addition
Integer/Real Memory with ST(O)

1 escape MF 0

1 mod 000 rim

1 escape dPO

11000 ST(i)

STU) and ST(O)

FSUB = Subtraction
Integer/Real Memory with ST(O)

1 escape MF 0

1 mod 10r rim

1 escape dPO

1110r r /m

ST(i) and ST(O)

FMUL = Multiplication
Integer/Real Memory with ST(O)

1 escape MF 0

1 mod 001 rim

STIil and ST(O)

1 escape dPO

11001 rim

FDIV = Division

Instruction Set 6-27

Integer/Real Memory with ST(O)

1 escape MF 0

1 mod 11rr/m

1 escape dPO

1 1111rr/m

STIiI and ST(O)

FSQRT = Square Root of ST(O)
Square Root of ST(O)
1 escape 001

1 11111010

FSCALE = Scale ST(O) by ST(1)
Scale ST(O) by ST(1)
1 escape 001

FPREM

111111101

= Partial Remainder of ST(O) + ST(1)
Partial Remainder of ST(O) + ST(1)

1 escape 001

111111000

FRNDINT = Round ST(O) to Integer
Round ST(O) to Integer
1 escape 001

FXTRACT

111111100

= Extract Components of ST(O)
Extract Components of ST(O)

1 escape 001

FABS

111110100

= Absolute Value of ST(O)
Absolute Value of ST(O)

1 escape 001

FCHS

111100001

= Change Sign of ST(O)
Change Sign of ST(O)

1 escape 001

111100000

6-28 Instruction Set

Transcendental
FPTAN = Partial Tangent of ST(O)
Partial Tangent of ST(O)

I escape 001
FPATAN

/11110010

= Partial Arctangent of ST(O)

-;- ST(1)

Partial Arctangent of ST(O) -;- ST(1)

I escape 001

I 11110011

F2XMI = 2 ST(O)_1

escape 001

FYL2X

ST(O)-1

I 11110000

= ST(1) X Log2 [ST(O)) 2 [ST(O)]
ST(1) x log

I escape 001

I 11110001

FYL2XPI = ST(1)

X

LogdST(O)

+ I] 2 [ST(O) + 1]

ST(1) x log

I escape 001

/ 11111001

Processor Control
FINT

= Initialize NPX

I escape 011

I 11100011

Initialize NPX

FSETPM = Enter Protected Mode
Enter Protected Mode

I escape 011

I 11100100

Instruction Set 6-29

FSTSWAX = Store Control Word
Store Control Word
1 escape 111

111100000

FLDCW = Load Control Word

I escape 001

Load Control Word
1 mod 101 rim

FSTCW = Store Control Word
Store Control Word
1 escape 001

1 mod 111 rim

FSTSW = Store Status Word
Store Status Word

1 escape 101

FCLEX

1 mod 101 rim

= Clear Exceptions
Clear Exceptions

1 escape 011

1 11100010

FSTENV = Store Environment
Store Environment

I escape 001

1 mod 110 rim

FLDENV = Load Environment
Load Environment
1 escape 001

I mod 100 rim

FSAVE = Save State
Save State

1 escape 101

I mod 110 rim

FRSTOR = Restore State

6-30 Instruction Set

I escape 101
FINCSTP

Restore State
mod 100 rim

= Increment Stack Pointer
Increment Stack Pointer

I escape 001
FDECSTP

I 11110111

= Decrement Stack Pointer
Decrement Stack Pointer

I escape 001

I 11110110

FFREE = Free ST(i)
Free ST(i)

I escape 101

I 11000ST(i)

FNOP = No Operation
No Operation

I escape 001

11010000

Instruction Set 6-31

Notes:

6-32 Instruction Set

SECTION 7. CHARACTERS,
KEYSTROKES, AND COLORS

Contents
Characters, Keystrokes, and Color ..................... 7-3
NOTES .................................. 7-13

Characters, Keystrokes, and Colors 7-1

Notes:

7-2 Characters, Keystrokes, and Color

Characters, Keystrokes, and Color
As Text,.
Value
He~ IDee _Symbol

00

0

02

2

03

3

Color/Graphics
Monitor Adapter

As Characters

Blank
(Null)

"'V7Q"VftVO

Ctrl2

Modes

:

_U~ft. . .

Black

~

04

06

••
...+
••

lack
Black

Ctrl C

,"v

vw,"v

IBM
Monochrome
Display
Adapter

Black

Non-Display

Blue

Underline

GI

Normal

Cyan

Normal
Normal

Ctrl E

Black

Magenta

Normal

CtrlG

Black

Light Grey

Normal

Ctrl H.
Backspace.
Shift
Backspace

Black

Dark Grey

Non-Display

Ctrll

Black

Light Blue

HiQh Intensity
Underline

Ctrl J.
Ctrl.,J

Black

Light Green

High Intensity

07

7

08

8

09

9

OA

10

OB

11

cr'

Ctrl K

Black

Light Green

High Intensity

OC

12

9

Ctrl L.

Black

Light Red

Higllintensity

00

13

Jl

Ctrl M •
Shift.-J

Black

Light
Magenta

High Intensity

OE

14

Black

Yellow

High " .. ~ .. ~ ..

15

~
U

Ctrl N

OF

CtrlO

Black

White

High

10

16

CtrlP

Blue

Black

Normal

11

17

Ctrl Q

Blue

Blue

Underline

12

18

Blue

Green

Normal

19

Ctrl S

Blue

Cyan

14

20

!
!!
IT

Ctrl R

13

Ctrl T

Blue

Red

Normal

15

21

§.

Ctrl U

Magenta

Normal

16

22

17

23

0

~

...

1..

.-J.

""""''''y

Ctrl V

Blue

Brown

Normal

CtrlW

Blue

Light Grey

Normal

Characters, Keystrokes, and Color 7-3

As Text Attributes

Value

As Characters

Hex Dec Symbol

Keystrokes

Color/Graphics
Monitor Adapter

IBM
Monochrome
Display
Modes Background Foreground
Adapter

18

24

1

Ctrl X

Blue

Dark Grey

High Intensity

19

25

1

Ctrl Y

Blue

Light Blue

High Intensity
Underline

1A

26

-

Ctrl Z

Blue

Light Green

High Intensity

1B

27

Blue

Light Cyan

High Intensity

-

Ctrl [,
Esc, Shift
Esc, Ctrl
Esc

L

Ctrl \

Blue

Light Red

High Intensity

1

Blue

Light
Magenta

High Intensity

Ctrl6

1C

28

10

29

1E

30

1F

31

20

32

+--+

•
"
Blank
Space

Ctrl

Blue

Yellow

High Intensity

Ctrl -

Blue

White

High Intensity

Space Bar,
Shift,
Space,
Ctrl Space,
Ait Space

Green

Black

Normal

21

33

!

!

Shift

Green

Blue

Underline

22

34

"

"

Shift

Green

Green

Normal

23

35

#

#

Shift

Green

Cyan

Normal

24

36

$

$

Shift

Green

Red

Normal

25

37

%

%

Shift

Green

Magenta

Normal

26

38

&

&

Shift

Green

Brown

Normal

27

39

Green

Light Grey

Normal

28

40

(

(

Shift

Green

Dark Grey

High Intensity

29

41

)

)

Shift

Green

Light Blue

2A

42

.

High Intensity
Underline

Note 1

Green

Light Green

High Intensity

28

43

+

Shift

Green

Light Cyan

High Intensity

2C

44

Green

Light Red

High Intensity

20

45

Green

Light
Magenta

High Intensity

2E

46

Green

Yellow

High Intensity

-

+

-

Note 2

7 -4 Characters, Keystrokes, and Color

As Text Attributes
Value

As Characters

Hex Dec Symbol

Keystrokes

Color/Graphics
Monitor Adapter

IBM
Monochrome
Display
Modes Background Foreground
Adapter

2F

47

/

/

Green

White

High Intensity

30

48

0

0

Note 3

Cyan

81ack

Normal

31

49

1

1

Note 3

Cyan

81ue

Underline

32

50

2

2

Note 3

Cyan

Green

Normal

33

51

3

3

Note 3

Cyan

Cyan

Normal

34

52

4

4

Note 3

Cyan

Red

Normal

35

53

5

5

Note 3

Cyan

Magenta

Normal

36

54

6

6

Note 3

Cyan

8rown

Normal

37

55

7

7

Note 3

Cyan

Light Grey

Normal

38

56

8

8

Note 3

Cyan

Dark Grey

High Intensity

39

57

9

9

Note 3

Cyan

Light Blue

High Intensity
Underline

3A

58

Shift

Cyan

Light Green

High Intensity

3B

59

Cyan

Light Cyan

High Intensity

3C

60

<

Cyan

Light Red

High Intensity

3D

61

<
=

Shift

=

Cyan

Light
Magenta

High Intensity

3E

62

>

>

Shift

Cyan

Yellow

High Intensity

3F

63

?

?

Shift

Cyan

White

High Intensity

40

64

@

@

Shift

Red

Black

Normal

41

65

A

A

Note 4

Red

Blue

Underline

42

66

B

B

Note 4

Red

Green

Normal

43

67

C

C

Note 4

Red

Cyan

Normal

44

68

D

D

Note 4

Red

Red

Normal

45

69

E

E

Note 4

Red

Magenta

Normal

46

70

F

F

Note 4

Red

Brown

Normal

47

71

G

G

Note 4

Red

Light Grey

Normal

48

72

H

H

Note 4

Red

Dark Grey

High Intensity

49

73

I

I

Note 4

Red

Light Blue

High Intensity
Underline

4A

74

J

J

Note 4

Red

Light Green

High Intensity

Characters, Keystrokes, and Color 7-S

As Text Attributes

As Characters

Value
Hex Dec Symbol
4B

75

K

Keystrokes

K

Color/Graphics
Monitor Adapter

IBM
Monochrome
Display
Modes Background Foreground
Adapter
Note 4

Red

Light Cyan

High Intensity

Light Red

High Intensity

4C

76

L

L

Note 4

Red

40

77

M

M

Note 4

Red

Light
Magenta

High Intensity

4E

78

N

N

Note 4

Red

Yellow

High Intensity

4F

79

0

0

Note 4

Red

White

High Intensity

50

80

p

P

Note 4

Magenta

Black

Normal

51

81

Q

Q

Note 4

Magenta

Blue

Underline

52

82

R

R

Note 4

Magenta

Green

Normal

5;3

83

S

S

Note 4

Magenta

Cyan

Normal

54

84

T

T

Note 4

Magenta

Red

Normal

55

85

U

U

Note 4

Magenta

Magenta

Normal

56

86

V

V

Note 4

Magenta

Brown

Normal

57

87

W

W

Note 4

Magenta

Light Grey

Normal

58

88

X

X

Note 4

Magenta

Oark Grey

High Intensity

59

89

Y

Y

Note 4

Magenta

Light Blue

High Intensity
Underline

5A

90

Z

Z

Note 4

Magenta

Light Green

High Intensity

5B

91

[

[

Magenta

Light Cyan

High Intensity

5C

92

\

\

Magenta

Light Red

High Intensity

50

93

I

I

Magenta

Light
Magenta

High Intensity

5E

94

A

A

Shift

Magenta

Yellow

High Intensity

5F

95

-

-

Shift

Magenta

White

High Intensity

60

96

Yellow

Black

Normal

61

97

a

a

Note 5

Yellow

Blue

Underline

62

98

b

b

Note 5

Yellow

Green

Normal

63

99

c

c

Note 5

Yellow

Cyan

Normal

64

1()()

d

d

Note 5

Yellow

Red

Normal

65

101

e

e

Note 5

Yellow

Magenta

Normal

66

102

f

f

Note 5

Yellow

Brown

Normal

7 -6 Characters, Keystrokes, and Color

As Text Attributes

As Characters

Value
Hex Dec Symbol

Keystrokes

Color /Graphics
Monitor Adapter

IBM
Monochrome
Display
Adapter
Modes Background Foreground

g

Note 5

Yellow

Light Grey

Normal

67

103

g

68

104

h

h

Note 5

Yellow

Dark Grey

High Intensity

69

105

i

i

Note 5

Yellow

Light Blue

High Intensity
Underline

6A 106

j

J

Note 5

Yellow

Light Green

High Intensity

6B

107

k

k

Note 5

Yellow

Light Cyan

High Intensity

6C

108

I

I

Note 5

Yellow

Light Red

High Intensity

6D

109

m

m

Note 5

Yellow

Light
Magenta

High Intensity

6E

110

n

n

Note 5

Yellow

Yellow

High Intensity

6F

11 1

a

0

Note 5

Yellow

White

High Intensity

70

112

p

p

Note 5

White

Black

Reverse Video

71

113

Q

Q

Note 5

White

Blue

Underline
Normal

72

114

r

r

Note 5

White

Green

73

115

s

s

Note 5

White

Cyan

Normal

74

116

I

I

Note 5

White

Red

Normal

75

117

u

u

Note 5

White

Magenta

Normal

76

118

v

v

Note 5

White

Brown

Normal

77

119

w

w

Note 5

White

Light Grey

Normal

78 120

x

x

Note 5

White

Dark Grey

Reverse Video

121

y

y

Note 5

White

Light Blue

High Intensity
Underline

7A 122

z

z

Note 5

White

Light Green

High Intensity

123

I

{

Shilt

White

Light Cyan

High Intensity

124

I
I

I
I

Shift

White

Light Red

High Intensity

7D 125

I

I

Shift

White

Light
Magenta

High Intensity

7E

126

-

-

Shift

White

Yellow

High Intensity

7F

127

t:.

Ctrl -

White

White

High Intensity

79

7B
7C

Characters, Keystrokes, and Color 7-7

As Text Attributes

Value

As Characters

Hex Dec Symbol

.. . .

Keystrokes

Color / Graphics
Monitor Adapter

IBM
Monochrome
Display
Modes Background Foreground
Adapter

80 to FF Hex are Flashing in both Color &. IBM Monochrome' • • •

80

128

C

Alt 128

Note 6

Black

Black

Non-Display

B1

129

U

Alt 129

Note 6

Black

Blue

Underline

82

130

Note 6

Black

Green

Normal

131

Alt 131

Note 6

Black

Cyan

Normal

B4

132

e
a
a

Alt 130

83

Alt 132

Note 6

Black

Red

Normal

85

133

II

Alt 133

Note 6

Black

Magenta

Normal

86

134

a

Alt 134

Note 6

Black

Brown

Normal

87

135

C

Alt 135

Note 6

Black

Light Grey

Normal

88

136

Alt 136

Note 6

Black

Dark Grey

Non-Display

89

137

e
e

Alt 137

Note 6

Black

Light Blue

High Intensity
Underline

8A

138

e

Alt 138

Note 6

Black

Light Green

High Intensity

8B

139

'i

Alt 139

Note 6

Black

Light Cyan

High Intensity

8C

140

i

Alt 140

Note 6

Black

Light Red

High Intensity

8D

141

i

Alt 141

Note 6

Black

Light
Magenta

High Intensity

8E

142

A

Alt 142

Note 6

Black

Yellow

High Intensity

8F

143

A

Alt 143

Note 6

Black

White

High Intensity

90

144

E

Alt 144

Note 6

Blue

Black

Normal

91

145

ae

Alt 145

Note 6

Blue

Blue

Underline

92

146

AE

Alt 146

Note 6

Blue

Green

Normal

93

147

6

Alt 147

Note 6

Blue

Cyan

Normal

94

148

0

Alt 148

Note 6

Blue

Red

Normal

95

Alt 149

Note 6

Blue

Magenta

Normal

Blue

Brown

Normal

149

b

96

150

a

Alt 150

Note 6

97

151

U

Alt 151

Note 6

Blue

Light Grey

Normal

98

152

Y

Alt 152

Note 6

Blue

Dark Grey

High Intensity

99

153

0

Alt 153

Note 6

Blue

Light Blue

High Intensity
Underline

9A 154

U

Alt 154

Note 6

Blue

Light Green

High Intensity

7 -8 Characters, Keystrokes, and Color

As Text Attributes

Value

As Characters

Hex Dec Symbol

Keystrokes

IBM
Monochrome
Display
Modes Background Foreground
Adapter
Color/Graphics
Monitor Adapter

9B

155

¢

Alt 155

Note 6

Blue

Light Cyan

High Intensity

9C

156

£

Alt 156

Note 6

Blue

Light Red

High Intensity

Alt 157

Note 6

Blue

Light
Magenta

High Intensity

90 157

9E

158

Pt

Alt 158

Note 6

Blue

Yellow

High Intensity

9F

159

f

Alt 159

Note 6

Blue

White

High Intensity

AO 160

Alt 160

Note 6

Green

Black

Normal

A 1 161

Alt 161

Note 6

Green

Blue

Underline

Alt 162

Note 6

Green

Green

Normal

Alt 163

Note 6

Green

Cyan

Normal

6

A2

162

A3

163

A4

164

Alt 164

Note 6

Green

Red

Normal

A5

165

Alt 165

Note 6

Green

Magenta

Normal

A6

166

Alt 166

Note 6

Green

Brown

Normal

A7

167

Alt 167

Note 6

Green

Light Grey

Normal

A8

168

Alt 168

Note 6

Green

Dark Grey

High Intensity

A9

169

Alt 169

Note 6

Green

Light Blue

High Intensity
Underline

AA 170

Alt 110

Note 6

Green

Light Green

High Intensity

AB

171

Alt 171

Note 6

Green

Light Cyan

High Intensity

AC

172

Alt 172

Note 6

Green

Light Red

High Intensity

AD 173

Alt 173

Note 6

Green

Light
Magenta

High Intensity

Alt 174

Note 6

Green

Yellow

High Intensity

Alt 175

Note 6

Green

White

High Intensity

Alt 176

Note 6

Cyan

Black

Normal

Alt 177

Note 6

Cyan

Blue

Underline

Alt 178

Note 6

Cyan

Green

Normal

AE

174

AF

175

«
»

BO

176

-------

Bl

177

B2

178

B3

179

I

Alt 179

Note 6

Cyan

Cyan

Normal

r--

Alt 180

Note 6

Cyan

Red

Normal

B5

181 ~

Alt 181

Note 6

Cyan

Magenta

Normal

B6

182

r--t

Alt 182

Note 6

Cyan

Brown

Normal

B4 180

Characters, Keystrokes, and Color 7-9

As Text Attributes

Hex Dec Symbol
B7
B8
B9

183

III
184
R
185

Color / Graphics
Monitor Adapter

As Characters

Value

W

Keystrokes

Modes Background Foreground

Alt 183

Note 6

Cyan

Light Grey

Normal

Alt 184

Note 6

Cyan

Dark Grey

High Intensity

Alt 185

Note 6

Cyan

Light Blue

High Intensity
Underline

Alt 186

Note 6

Cyan

Light Green

High Intensity

Alt 187

Note 6

Cyan

Light Cyan

High Intensity

Alt 188

Note 6

Cyan

Light Red

High Intensity

Alt 189

Note 6

Cyan

Light
Magenta

High Intensity

Alt 190

Note 6

Cyan

Yellow

High Intensity

Alt 191

Note 6

Cyan

White

High Intensity

Alt 192

Note 6

Red

Black

Normal
Underline

h

BA 186
BB

187

BC

188

BD

189

BE

190

BF

191

CO

192

h1
~

WJ
P
11

L-

IBM
Monochrome
Display
Adapter

Cl

193

Alt 193

Note 6

Red

Blue

C2

194

Alt 194

Note 6

Red

Green

Normal

C3

195

Ait 195

Note 6

Red

Cyan

Normal

C4

196

Alt 196

Note 6

Red

Red

Normal

C5

197

Alt 197

Note 6

Red

Magenta

Normal

C6

198

Note 6

Red

Brown

Normal

C7

199

===

Alt 198

Ir-

Alt 199

Note 6

Red

Light Grey

Normal

C8

200

L==

Alt 200

Note 6

Red

Dark Grey

High Intensity

C9

201

Alt 201

Note 6

Red

Light Blue

High Intensity
Underline

Alt 202

Note 6

Red

Light Green

High Intensity

CA 202
CB

203

CC 204

f-

II

---.J L -

--, r -

I~

CD 205

CE

206

CF

207

DO 208

:::;;:::
I

Alt 203

Note 6

Red

Light Cyan

High Intensity

Alt 204

Note 6

Red

Light Red

High Intensity

Alt 205

Note 6

Red

Light
Magenta

High Intensity

Alt 206

Note 6

Red

Yellow

High Intensity

Alt 207

Note 6

Red

White

High Intensity

Alt 208

Note 6

Magenta

Black

Normal

1-10 Characters, Keystrokes, and Color

As Text A.ttributes

Value

As Characters

Hex IDec 1Symbol

K"Y~"VR~~

IBM
Monochrome
Display
Modes Background Foreground
Adapter
Coior / Graphics
Monitor Adapter

1209

Alt 209

Note 6

Magenta

Blue

Underline

D2 210

Alt 210

Note 6

Magenta

Green

Normal
Normal

D3 211

!L-

Alt 211

Note 6

Magenta

Cyan

D4 1212

C:::
F

Alt 212

6

Magenta

Red

Alt 213

Note 6

Magenta

Magenta

Normal

Alt 214

Note 6

Magenta

Brown

Normal

Alt 215

Note 6

Magenta

Light Grey

Normal

Alt 216

Note 6

Magenta

Dark Grey

High Intensity

Alt 217

Note 6

Magenta

Light Blue

High Intensity
Underline

DA 218

Alt 218

Note 6

Magenta

Light Green

High Intensity

DB 219

Alt 219

Note 6

Magenta

Light Cyan

High Intensity

DC 220

Alt 220

Note 6

Magenta

Light Red

High Intensity

DD 221

Alt 221

Note 6

Magenta

Light
Magenta

High Intensity

DE 222

Alt

Note 6

Magenta

Yellow

High Intensity

DF 223

Alt 223

Note 6

Magenta

White

High Intensity

D5 213
D6 12

rI

D7 215
D8 216
D9 217

f-----

EO 1224

Alt 224

Note 6

Yellow

Black

Normal

1i1

225

f3

Alt 225

Note 6

Yellow

Blue

Underline

E2

226

r

Alt 226

6

Yellow

GI

NI

227

rr

Alt

Note 6

Yellow

Cyan

Normal

E4

228

2

Alt 228

Note 6

Yellow

Red

Normal

E5

229

Alt 229

Note 6

Yellow

Magenta

Normal

E6 1230

Alt 230

NI

6

Yellow

Brown

6

Yel

E7

231

E8

232

Grey

Norm,

T

Alt 231
Alt

Note 6

Yellow

Dark Grey

High Intensity

233

{J

Alt 233

Note 6

Yellow

Light Blue

High Intensity
Underline

EA 234

n

Alt 234

Note 6

Yellow

Light Green

H ig h Intensity

EB 235

{j

Alt 235

Note 6

Yellow

Light Cyan

High Intensity

E9

Characters, Keystrokes, and Color 7-11

As Text Attributes

Value

As Characters

Hex Dec Symbol

Keystrokes

Color/Graphics
Monitor Adapter

IBM
Monochrome
Display
Modes Background Foreground
Adapter

EC 236

Alt 236

Note 6

Yellow

Light Red

High Intensity

ED

237

Alt 237

Note 6

Yellow

Light
Magenta

High Intensity

EE

238

Alt 238

Note 6

Yellow

Yellow

High Intensity

EF

239

Alt 239

Note 6

Yellow

White

High Intensity

Alt 240

Note 6

White

Black

Reverse Video

Alt 241

Note 6

White

Blue

Underline

Ii

Fa 240

±

F1

241

F2

242

Alt 242

Note 6

White

Green

Normal

F3

243

Alt 243

Note 6

White

Cyan

Normal

r

Alt 244

Note 6

White

Red

Normal

F5

245

Alt 245

Note 6

White

Magenta

Normal

F6

246

Alt 246

Note 6

White

Brown

Normal

F7

247

Alt 247

Note 6

White

Light Grey

Normal

F8

248

o

Alt 248

Note 6

White

Dark Grey

Reverse Video

F9

249

•

Alt 249

Note 6

White

Light Blue

High Intensity
Underline

•

Alt 250

Note 6

White

Light Green

High Intensity

F4 244

FA 250
FB

251

Alt 251

Note 6

White

Light Cyan

High Intensity

FC

252

Alt 252

Note 6

White

Light Red

High Intensity

FD

253

Alt 253

Note 6

White

Light
Magenta

High Intensity

FE

254

Alt 254

Note 6

White

Yellow

High Intensity

FF

255

Alt 255

Note 6

White

White

High Intensity

2

•

BLANK

7-12 Characters, Keystrokes, and Color

NOTES
1.

Asterisk (*) can be typed using two methods: press the
PrtSc key or, in the shift mode, press the 8 key.

2.

Period (.) can be typed using two methods: press the. key
or, in the shift or Num Lock mode, press the Del key.

3.

Numeric characters 0-9 can be typed using two methods:
press the numeric keys on the top row of the keyboard or, in
the shift or Num Lock mode, press the numeric keys in the
keypad portion of the keyboard.

4.

Uppercase alphabetic characters (A-Z) can be typed in two
modes: the shift mode or the Caps Lock mode.

5.

Lowercase alphabetic characters (a-z) can be typed in two
modes: in the normal mode or in Caps Lock and shift mode
combined.

6.

The three digits after the Alt key must be typed from the
numeric keypad. Character codes 0-255 may be entered in
this fashion (with Caps Lock activated, character codes
97-122 will display uppercase.)

Characters, Keystrokes, and Color 7-13

DECIMAL
VALUE

.

0

16

32

48

64

80

96 112

2

3

4

5

6

•

1~!~~MtL

0

1

0

0

BLANK
(NULL)

~

1

1

~ ......

2

2

3

3

4

4

5

5

6

6

7

7

8

8

9

9

10

A

II

B

12

C

13

D

14

E

~

15

F

1)-

HEXA

-• "
+
•!

..

crT

4t §

• t

r

0

!
~

d
Q
j

+--

L
+--+

..

7

p , P
I• 1 A Q a q
2 B R b r
=IF 3 C S c s
$ 4 D T d t
0/0 5 E U e u
& 6 F V f v
,
7 GW g W
(
8 H X h x
) 9 I Y 1• y
.
•
•
J Z J Z
*
+ ,• K [ k {
, < L "- I

BLANK
(SPACEI

0 @

II

I
I

-

•

... /

M ] m }
> N /\ n rv

-

?
•

7 -14 Characters, Keystrokes, and Color

0

-

0

~

DECIMAL
VALUE

.

128 144 160 176 192 208 224 240

•

HEXA
DECIMAL
VALUE

8

9

0

0

~

E

1

1

U

cE

2

2

3

3

e .IE 0, ~
A

4

4

5

5

6

6

7

7

8

8

e" y

9

9

••

10

A

11

B

••

12

c

13

0

",1 £

14

E

15

F

••

,

A

B

,
a,
1
,

···....
···......

C

~

0

·

••

e 0
, ••
e U
1

1

A
A

i==

~

(, I

••

I

~

I

c Y2 ==,

¥
Pt
f'

.......--

='L

I

~

f--

:=!

· --1J
• d

«
»

OC

---

f3

+
-

- LL

-1

U

I

I

--.../

0

E

:.:-:
.:.:.
:.:.:
.:.:.

~ 0 U
••
••
a 0 n , ,
a 0 N=
I\.
a u a
,

I]

r

->

<

1T -

b L (
)
F (J'
.
Y -.
,--

T

-...,

Q
8

0

n
0
ex:>

H

F

0

-...,

•
•
-r
n

IOPL. The POPF instruction may be simulated with the following code macro: POPFF Macro ;use POPFF instead of POPF ;simulate popping flags ;using IRET EBOI JMP$+3 ;jump around IRET CF IRET ;POP CS, IP, flags OE PUSHCS ;push CS E8FB FF CALL $-2 ;CALL within segment ;program will continue here 9-6 Compatibility • PUSH SP pushes the current stack pointer. The microprocessor used in the IBM Personal Computer and the IBM Personal Computer XT pushes the new stack pointer. • Single step interrupt (when TF = 1) does not occur on the interrupt instruction (OP code hex CC,CD). The microprocessor in the IBM Personal Computer and the IBM Personal Computer XT does interrupt on the INT instruction. • The divide error exception (interrupt 0) pushes the CS:IP of the instruction, causing the exception. The IBM Personal Computer and the IBM Personal Computer XT push the CS:IP following the instruction, causing the exception. • Shift counts are masked to 5 bits. Shift counts greater than 31 are treated mod 32, that is, a shift count of 36 shifts the operand 4 places. Assembler language programs should perform all 110 operations through ROM BIOS or DOS function calls. • Program interrupts are used for access to these functions. This practice removes the absolute addressing from the program. Only the interrupt number is required. • The math 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 BUSY signal to the coprocessor to be held in the busy state. The BUSY signal may be cleared by an 8-bit 1/0 Write command to address hex FO with DO through D7 equal to o. I I I I The power-on-self test code in the system ROM enables hardware interrupt 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 Compatibility 9-7 the coprocessor. If the interrupt was not generated by the coprocessor, control should be passed to the original NMI interrupt handler. • Back to back I/O commands to the same I/O ports will not permit enough recovery time for I/O chips. To insure enough time, a JMP SHORT $+2 must be inserted between IN/OUT instructions to the same I/O chip. Note: MOV AL,AH type instruction does not allow enough recovery time. An example of the correct procedure follows: OUT IO_ADD,AL JMP SHORT$+2 MOV AL,AH OUT IO_ADD,AL • In the IBM Personal Computer AT IRQ 9 is redirected to INT hex OA (hardware IRQ 2). This insures that hardware designed to use IRQ 2 will operate in the IBM Personal Computer AT. • The system can mask hardware sensitivity. New devices can change the ROM BIOS to accept the same programming interface on the new device. • In cases where BIOS provides parameter tables, such as for video or diskette, a program may substitute new parameter values by building a new copy of the table and changing the vector to point to that table. However, the program should copy the current table, using the current vector, and then modify those locations in the table that need to be changed. In this way, the program will not inadvertently change any values that should be left the same. • Disk Base consists of 11 parameters required for diskette operation. They are pointed at by the data variable, Disk Pointer, at absolute address 0:78. It is strongly recommended that the values supplied in ROM be used. If it 9-8 Compatibility becomes necessary to modify any of the parameters, build another parameter block and modify the address in Disk-Pointer to point to the new block. The parameters were established to operate both the High Capacity Diskette Drive and the Double Sided Diskette Drive. Three of the parameters in this table are under control of BIOS in the following situations. The Gap Length Parameter is no longer retrieved from the parameter block. Gap length used during diskette read, write, and verify operations is derived from within diskette BIOS. Gap length for format operations is still obtained from the parameter block. Special considerations are required for formatting operations. See the prologue of Diskette BIOS for the required details. If a parameter block contains a head settle time parameter value of 0 milliseconds, and a write operation is being performed, at least 15 milliseconds of head settle time will be enforced for a High Capacity Diskette Drive and 20 milliseconds will be enforced for a Double Sided Diskette Drive. If a parameter block contains a motor start wait parameter of less than 1 second for a write or format operation or 625 milliseconds for a read or verify operation, Diskette BIOS will enforce those times listed above. • The following procedure is used to determine the type of media inserted in the High Capacity Diskette Drive: 1. Read Track 0, Head 0, Sector 1 to allow diskette BIOS to establish the medial drive combination. If this is successful, continue with the next step. 2. Read Track 0, Sector 15. If an error occurs, a double sided diskette is in the drive. If a successful read occurs, a high capacity diskette is in the drive. 3. If Step 1 fails, issue the reset function (AH=O) to diskette BIOS and retry. If a successful read cannot be done, the media needs to be formatted or is defective. ROM BIOS and DOS do not provide for all functions. The following are the allowable I/O operations with which IBM will maintain compatibility in future systems. Compatibility 9-9 • Control of the sound using port hex 61, and the sound channel of the timer/counter. A program can control timer/counter channels 0 and 2, ports hex 40, 42, and 43. A program must not change the value in port hex 41, because this port controls the dynamic-memory refresh. Channel 0 provides the time-of -day interrupt, and can also be used for timing short intervals. Channel 2 of the timer/counter is the output for the speaker and cassette ports. This channel may also be used for timing short intervals, although it cannot interrupt at the end of the period. • Control of the Game Control Adapter, port hex 201 Note: Programs should use the timer for delay on the paddle input rather than a program loop. • Interrupt Mask Register (IMR), port hex 21, can be used to selectively mask and unmask the hardware features. The following information pertains to absolute memory locations. • Interrupt Vectors (hex O)--A program may change these to point at different processing routines. When an interrupt vector is modified, the original value should be retained. If the interrupt, either hardware or program, is not directed toward this device handler, the request should be passed to the next item in the list. • Video Display Buffers (hex BOOOO and B8000)-- For each mode of operation defined in the video display BIOS, the memory map will remain the same. For example, the bit map for the 320 x 200 medium-resolution graphics mode of the Color/Graphics Monitor adapter will be retained on any future adapter that supports that mode. If the bit map is modified, a different mode number will be used. • ROM BIOS Data Area (40:0)--Any variables in this area will retain their current definition, whenever it is reasonable to do so. IBM may use these data areas for other purposes when the variable no longer has meaning in the system. In general, ROM BIOS data variables should be read or modified through BIOS calls whenever possible, and not with direct access to the variable. 9-10 Compatibility A program that requires timing information should use either the time-of-day clock or the timing channels of the timer/counter. The input frequency to the timer will be maintained at 1.19 MHz, providing a constant time reference. Program loops should be avoided. Programs that use copy protection schemes should use the ROM BIOS diskette calls to read and verify the diskette and should not be timer dependent. Any method can be used to create the diskette, although manufacturing capability should be considered. The verifying program can look at the diskette controller's status bytes in the ROM BIOS data area for additional information about embedded errors. More information about copy protection may be found under I Copy Protection I later in this section. Any DOS program must be relocatable and insensitive to the size of DOS or its own load addresses. A program's memory requirement should be identified and contiguous with the load module. A program should not assume that all of memory is available to it. Multi-tasking Provisions The IBM Personal Computer AT BIOS contains a feature to assist multi-tasking implementation. "Hooks" are provided for a multi-tasking dispatcher. Whenever a busy (wait) loop occurs in the BIOS, a hook is provided for the system to break out of the loop. Also, whenever an interrupt is serviced by the BIOS, which causes a corresponding wait loop to be exited, another hook is provided for the system. Thus a system may be written which employs the bulk of the device driver code. The following is valid only in the microprocessor's real address mode. Several steps must be taken by the system code in order to allow this support. First, the system is responsible for the serialization of access to the device driver. The BIOS code is not reentrant. Second, the system is responsible for matching corresponding wait and post calls. Compatibility 9-11 Interfaces There are four interfaces to be used by the multi-tasking dispatcher: Startup The first thing to be done is for the startup code to hook interrupt hex 15. The dispatcher is responsible to check for function codes AH = hex 90 and 91. The "Wait" and "Post" sections describe these codes. The dispatcher must pass all other functions through to the previous user of interrupt hex 15. This can be done via a JMP or a CALL. If the function code is hex 90 or 91, then the dispatcher should do the appropriate processing and return via the lRET instruction. Serialization It is up to the multi-tasking system to insure that the device driver code is used in a serial fashion. Multiple entries into the code can result in very serious errors. Wait (Busy) Whenever the BIOS is about to enter a busy loop, it first issues an interrupt 15 with a function code of hex 90 in AH This signals a WAIT condition. At this point, the dispatcher should save the task status and dispatch another task. This allows overlapped execution of tasks when the hardware is busy. The following is is an outline of the code which has been added to the BIOS to implement this function. EXAMPLE DEVICE BUSY LOOP DO UNTIL MOY AX, hex 90XX 9-12 Compatibility ;WAIT code in AH and ;TYPE code in AL INT hex 15 ;issue call JCTIMEOUT ;optional: for timeout or ;if carry is set, timeout ;occurred NORMAL TIMEOUT LOGIC ;normal timeout UNTIL INTERRUPT COMPLETE FLAG IS SET POST (Interrupt) Whenever the BIOS has set an interrupt flag for a corresponding busy loop, an interrupt 15 occurs with a function code hex 91 in AH. This signals a POST condition. At this point, the dispatcher should set the task status to "ready to run" and return to the interrupt routine. The following BIOS has been added to code to implement this function. INTERRUPT PROCESSING SET INTERRUPT COMPLETE FLAG FOR BUSY LOOP MOV AX,hex 91XX ; post code AH and ; type code AL INThex 15 ; issue call Classes The following types of wait loops are supported: Compatibility 9-13 • The class for 0-> 7Fh is serially reusable. This means that for the devices that use these codes, access to the BIOS must be restricted to only one task at a time. • The class for 80h->BFh is reentrant. There is no restriction on the number of tasks which may access the device. • The class for COh->FFh is non-interrupt. There is no corresponding interrupt for the wait loop. Therefore, it is the responsibility of the dispatcher to determine what satisfies this condition to exit the loop. Function Code Classes type code (AL) Description OOh->7Fh serially reusable devices; operating system must serialize access 80h->OBFh reentrant devices; ES:BX is used to distinguish different calls (multiple I/O calls are allowed simultaneously) OCOh->OFFh wait only calls; there is no complementary "POST" for these waits--these are timeout only. Times are function number dependent. Function Code Assignments The following are specific assignments for the IBM Personal Computer AT BIOS. They are grouped according to the classes described under "Function Code Classes". Type Code (AL) Timeout Description OOH yes (6 sec) mM Personal Computer AT fixed disk 9-14 Compatibility OlH yes (2 sec) IBM Personal Computer AT diskette 02H no IBM Personal Computer AT keyboard OFDH yes (1 sec-write) diskette motor start (625 msec-read) OFEH yes (?? sec) printer The asynchronous support has been omitted. The IBM Personal Computer AT Serial/Parallel Adapter will generate interrupts, but BIOS does not support it in the interrupt mode. Therefore, the support should be included in the multi-tasking system code if that device is to be supported. Timeouts In order to support timeouts properly, it is necessary for the multi-tasking dispatcher to be aware of time. If a device enters a busy loop, it generally should remain there for a specific amount of time before indicating an error. The dispatcher should return to the BIOS wait loop with the carry bit set if a timeout occurred. SYS REQ Key The following describes the use of the SYS REQ key in a multi-tasking environment. It assumes that tasks used are cooperative in some manner. The system must employ a task monitor to allow the user to select various tasks. This selection may be for starting tasks, terminating tasks, supplying input to tasks from the keyboard, or any other function that requires user input. Compatibility 9-15 Subsystem Structure The following figure shows three subsystems which have multiple tasks. They are arranged in order of hierarchy. Tasks in subsystem B can only run when Task "Other" A is active in subsystem A and tasks in subsystem C can only run when Task "Other" B is active in subsystem B. Task 1A I Task 2A I Task 3A Subsystem B Inhibited I Task "Othen" A Task 1 B I Task 28 I Subsystem C Inhibited Task 8 "Other" Task 1C Task 2C Multiple Task Subsystems The order in which subsystems were installed (loaded into main storage) determines their priority. The first one installed is higher on the hierarchy. An inhibit mechanism provided at startup time enforces the hierarchy. As a subsystem starts, it broadcasts to the rest of the subsystems, previously installed, that it is starting and at the same time, provides the address of a lock. This lock must be set (incremented) by subsystems higher in the hierarchy whenever they wish to run one of their own tasks. This flag must be set for each subsystem lower on the hierarchy, for example, when subsystem A is about to start Task 2A, the dispatcher must set subsystem B inhibit and subsystem C inhibit. Subsystem Startup and Lockout In order for multiple subsystems to cooperate, there must be communication between subsystems when a subsystem is loaded into storage and initialized. The subsystem being loaded tells the previously loaded subsystems that it is being loaded and broadcasts the address of its synchronization lock. Higher priority subsystems use this lock to exclude the new subsystem from accessing any system resources (DOS, interrupts, etc.). 9-16 Compatibility After a subsystem is loaded, it must "listen" for any subsystems that may be loaded later so that it can lock them out when it is running. The following describes the code sequence for startup. Startup Interface MOV AX,SEG SYSLOCK ;segment of lock MOVES,AX MOV BX,OFFSET SYSLOCK ;offset of lock MOV AX,2000H ;AH=20H, AL=O INT ISH Lockout Interface The register ES:BX points to a byte which initially contains a value of O. Whenever a higher priority subsystem wishes to run, it increments the lock. When it completes running, it decrements the lock. This allows proper synchronization of resources and subsystems. SYS REQ Key Functions During initialization, the subsystem also needs to connect to the SYS REQ key function. It is necessary for the SYS key code to be included in each subsystem. This startup section determines if the SYS support is already loaded and loads the support if necessary. The SYS functions provide a means for the subsystem's main screen or menu to be displayed. If the subsystem requires no user action, then these functions need not be provided. SYS Key Modes There are two SYS key modes: multiple press and super shift. Compatibility 9-17 Multiple Press Mode: This mode allows the user to sequence through subsystems. Subsystems are displayed in the reverse order of their installation. Super Shift Mode: This mode allows the user direct access to any subsystem regardless of the priority. The user activates this mode by holding the SYS key pressed and pressing another key which designates another subsystem. Multiple Key Sequence If a subsystem is to be used on the IBM Personal Computer and the IBM Personal Computer XT, a multiple key sequence must be used to access the SYS key functions. SYS Key Interfaces There are four interfaces needed by the SYS code to support a subsystem: startup, activation, cancellation, and completion. The subsystem activates two of these: startup and completion. The SYS code in conjunction with user input activates the other two. The following is a description, in tabular form, of the states, transitions, and actions needed to implement the SYS REO functions. Subsystem Entry Points subsysA subsys B subsys C code A code B code C Entry Points # subsystems num 9-18 Compatibility current subsystem # cur State/Transition Table Current State Input Next State Action Idle SYS REQ Active activate subsys 'cur' SYS code Active Super activate subsys 'code' Startup Idle increment 'num' set 'cur' to 'num' insert entry point and code Active SYS REO Active cancel subsys 'cur' decrement 'cur' activate subsys 'cur' Completion 'cur' Idle set 'cur' to 'num' Startup Active increment 'num' insert entry point and code Active Super SYS code Active Super activate subsys 'code' Completion 'cur' Idle set 'cur' to 'num' Startup Active increment 'num' insert entry point and code Compatibility 9-19 Startup At startup, a call is issued to determine if the SYS REO key support is already loaded and to initialize the support for the new subsystem. The parameters for the startup routine are the address of the entry point and the function code (direct-access mode). If the operation was successful, the carry flag is set. The following shows the calling sequence. MOV AX,SEG entryJoint ;address for SYS to call MOVES,AX MOV BX,OFFSET entryJoint MOVCX,XXXX ;super shift mode code MOV AX,2010H ;AH=20H, AL= 10 INT ISH If the carry flag is not set, the initialization code needs to hook the vector for interrupt 15H, save the previous address, and reissue the initialization call. Activation This is a signal from the SYS REO processing module that a subsystem's monitor is to be activated. This entry into the subsystem dispatcher signals that the monitor task should be activated. It should be treated as a signal to set a flag for the subsystem rather than an opportunity to gain control of the system asynchronously as it may not be a proper time for the subsystem to run. The subsystem may have to wait until a higher priority subsystem allows it to have control before the subsystem's monitor gets control. The subsystem entry point is CALLED with the AH register set to o. 9-20 Compatibility Cancellation This signal from the SYS REQ processing module tells the subsystem monitor to ignore the previous activation signal and take the necessary action to return to its previous state. This entry into the subsystem dispatcher signals that the monitor task should be deactivated. The subsystem may not have control of the system. It is necessary for the subsystem to note that a cancellation has occurred and to wait until it has a valid opportunity to run through its dispatcher code in a normal fashion. The subsystem entry point is CALLED with the AH register set to 1. Completion The following call signals completion. Completion constitutes any action taken by the user when the subsystem's menu is displayed. The completion call causes the activation pointer to be reset to the lowest priority subsystem. A11lower priority subsystems also receive a cancellation notification. MOV AX,SEG entryJoint ;address for SYS to call MOVES,AX MOV BX,OFFSET entryJoint ;ES:BX must contain the same ;values as the startup call MOV AX,2011H ;AH=20H, AL= IlH INT 1SH Compatibility 9-21 Copy Protection Some modes of copy protection will not work on the IBM Personal Computer AT due to the following conditions: • Bypassing BIOS • Diskette drive differences • Write current differences Bypassing BIOS Copy protection, which depends on the following will not work on the IBM Personal Computer AT: Track Density: The High Capacity Diskette Drive records tracks at a density of 96TPI. This drive has to double step in the 48TPI mode, which is performed by BIOS. Data Transfer Rate: BIOS selects the proper data transfer rate for the media being used. Disk Base: Copy protection, which creates its own disk base will not work on the High Capacity Diskette Drive. - Diskette Drive Differences Copy protection, which depends on the following will not work on the High Capacity Diskette Drive: Rotational Speed: Copy protection using the time between two events on a diskette will not work on the High Capacity Diskette Drive. Access Time: Diskette BIOS must set the track to track access time for the different types of media used on the IBM Personal Computer AT. 9-22 Compatibility Head Geometry: See High Capacity Diskette Drive earlier in I I this section. Diskette Change Signal: Copy protection may not be able to reset this signaL Write Current The IBM Personal Computer AT Fixed Disk and Diskette Drive Adapter selects the proper write current for the media being used. Machine-Sensitive Code Programs may program for machine specific features, but they must test for specific machine type. Location hex OFFFF:OE contains the machine identification: Hex Machine Identification OFF OFE OFD OFC IBM IBM IBM IBM Personal Computer Personal Computer XT PCjr Personal Comouter AT Machine Identification Code IBM will define methods for uniquely determining the specific machine type or I/O feature for any new device. Compatibility 9-23 Notes: 9-24 Compatibility Glossary (-t. (-ts. Prefix micro; 0.000001. Microsecond; 0.000001 second. A. Ampere. ac. Alternating current. accumulator. A register in which the result of an operation is formed. active high. Designates a signal that has to go high to produce an effect. Synonymous with positive true. active low. Designates a signal that has to go low to produce an effect. Synonymous with negative true. adapter. An auxiliary device or unit used to extend the operation of another system. address bus. One or more conductors used to carry the binary-coded address from the processor throughout the rest of the system. algorithm. A finite set of well-defined rules for the solution of a problem in a finite number of steps. all points addressable (APA). A mode in which all points of a displayable image can be controlled by the user. alphameric. Synonym for alphanumeric. alphanumeric (A/N). Pertaining to a character set that contains letters, digits, and usually other characters, such as punctuation marks. Synonymous with alphameric. Glossary-l alternating current (ac). A current that periodically reverses its direction of flow. American National Standard Code for Information Exchange (ASCII). The standard code, using a coded character set consisting of 7-bit coded characters (8 bits including parity check), used for information exchange between data processing systems, data communication systems, and associated equipment. The ASCII set consists of control characters and graphic characters. ampere (A). The basic unit of electric current. A/N. Alphanumeric analog. (1) Pertaining to data in the form of continuously variable physical quantities. (2) Contrast with digital. AND. A logic operator having the property that if P is a statement, Q is a statement, R is a statement, ... , then the AND of P, Q, R, .. .is true if all statements are true, false if any statement is false. AND gate. A logic gate in which the output is 1 only if all inputs are 1. AND operation. The boolean operation whose result has the boolean value 1, if and only if, each operand has the boolean value 1. Synonymous with conjunction. APA. All points addressable. ASCII. American National Standard Code for Information Exchange. assemble. To translate a program expressed in an assembler language into a computer language. Glossary-2 assembler. A computer program used to assemble. assembler language. A computer-oriented language whose instructions are usually in one-to-one correspondence with computer instructions. asynchronous transmission. (1) Transmission in which the time of occurrence of the start of each character, or block of characters, is arbitrary; once started, the time of occurrence of each signal representing a bit within a character, or block, has the same relationship to significant instants of a fixed time frame. (2) Transmission in which each information character is individually transmitted (usually timed by the use of start elements and stop elements). audio frequencies. Frequencies that can be heard by the human ear (approximately 15 hertz to 20 000 hertz). auxiliary storage. (1) A storage device that is not main storage. (2) Data storage other than main storage; for example, storage on magnetic disk. (3) Contrast with main storage. BASIC. Beginner's all-purpose symbolic instruction code. basic input/output system (BIOS). The feature of the IBM Personal Computer that provides the level control of the major 1/0 devices, and relieves the programmer from concern about hardware device characteristics. baud. (1) A unit of signaling speed equal to the number of discrete conditions or signal events per second. For example, one baud equals one bit per second in a train of binary signals, one-half dot cycle per second in Morse code, and one 3-bit value per second in a train of signals each of which can assume one of eight different states. (2) In asynchronous transmission, the unit of modulation rate corresponding to one unit of interval per second; that is, if the duration of the unit interval is 20 milliseconds, the modulation rate is 50 baud. BCC. Block-check character. Glossary-3 beginner's aU-purpose symbolic instruction code (BASIC). A programming language with a small repertoire of commands and a simple syntax, primarily designed for numeric applications. binary. (1) Pertaining to a selection, choice, or condition that has two possible values or states. (2) Pertaining to a fixed radix numeration system having a radix of 2. binary digit. (1) In binary notation, either of the characters 0 or 1. (2) Synonymous with bit. binary notation. Any notation that uses two different characters, usually the binary digits 0 and 1. binary synchronous communications (BSC). A uniform procedure, using a standardized set of control characters and control character sequences for synchronous transmission of binary-coded data between stations. BIOS. Basic input/output system. bit. Synonym for binary digit bits per second (bps). A unit of measurement representing the number of discrete binary digits transmitted by a device in one second. block. (1) A string of records, a string of words, or a character string formed for technical or logic reasons to be treated as an entity. (2) A set of things, such as words, characters, or digits, treated as a unit. block-check character (BCC). In cyclic redundancy checking, a character that is transmitted by the sender after each message block and is compared with a block-check character computed by the receiver to determine if the transmission was successful. boolean operation. (1) Any operation in which each of the operands and the result take one of two values. (2) An operation that follows the rules of boolean algebra. Glossary-4 bootstrap. A technique or device designed to bring itself into a desired state by means of its own action; for example, a machine routine whose first few instructions are sufficient to bring the rest of itself into the computer from an input device. bps. Bits per second. BSC. Binary synchronous communications. buffer. (1) An area of storage that is temporarily reserved for use in performing an input/output operation, into which data is read or from which data is written. Synonymous with I/O area. (2) A portion of storage for temporarily holding input or output data. bus. One or more conductors used for transmitting signals or power. byte. (1) A sequence of eight adjacent binary digits that are operated upon as a unit. (2) A binary character operated upon as a unit. (3) The representation of a character. C. Celsius. capacitor. An electronic circuit component that stores an electric charge. CAS. Column address strobe. cathode ray tube (CRT). A vacuum tube in which a stream of electrons is projected onto a fluorescent screen producing a luminous spot. The location of the spot can be controlled. cathode ray tube display (CRT display). (1) A CRT used for displaying data. For example, the electron beam can be controlled to form alphanumeric data by use of a dot matrix. (2) The data display produced by the device as in (1). Glossary-5 CCITT. International Telegraph and Telephone Consultative Committee. Celsius (C). A temperature scale. Contrast with Fahrenheit (F). central processing unit (CPU). Term for processing unit. channel. A path along which signals can be sent; for example, data channel, output channel. character generator. (1) In computer graphics, a functional unit that converts the coded representation of a graphic character into the shape of the character for display. (2) In word processing, the means within equipment for generating visual characters or symbols from coded data. character set. (1) A finite set of different characters upon which agreement has been reached and that is considered complete for some purpose. (2) A set of unique representations called characters. (3) A defined collection of characters. characters per second (cps). A standard unit of measurement for the speed at which a printer prints. check key. A group of characters, derived from and appended to a data item, that can be used to detect errors in the data item during processing. closed circuit. A continuous unbroken circuit; that is, one in which current can flow. Contrast with open circuit. CMOS. Complementary metal oxide semiconductor. code. (1) A set of unambiguous rules specifying the manner in which data may be represented in a discrete form. Synonymous with coding scheme. (2) A set of items, such as abbreviations, representing the members of another set. (3) To represent data or a computer program in a symbolic form that can be accepted by a data processor. (4) Loosely, one or more computer programs, or part of a computer program. Glossary-6 coding scheme. Synonym for code. collector. An element in a transistor toward which current flows. column address strobe (CAS). A signal that latches the column addresses in a memory chip. compile. (1) To translate a computer program expressed in a problem-oriented language into a computer-oriented language. (2) To prepare a machine-language program from a computer program written in another programming language by making use of the overall logic structure of the program, or generating more than one computer instruction for each symbolic statement, or both, as well as performing the function of an assembler. complementary metal oxide semiconductor (CMOS). A logic circuit family that uses very little power. It works with a wide range of power supply voltages. computer. A functional unit that can perform substantial computation, including numerous arithmetic operations or logic operations, without intervention by a human operator during a run. computer instruction code. A code used to represent the instructions in an instruction set. Synonymous with machine code. computer program. A sequence of instructions suitable for processing by a computer. computer word. A word stored in one computer location and capable of being treated as a unit. configuration. (1) The arrangement of a computer system or network as defined by the nature, number, and the chief characteristics of its functional units. More specifically, the term configuration may refer to a hardware configuration or a software configuration. (2) The devices and programs that make up a system, subsystem, or network. conjunction. Synonym for AND operation. Glossary-7 contiguous. Touching or joining at the edge or boundary; adjacent. control character. A character whose occurrence in a particular context initiates, modifies, or stops a control operation. control operation. An action that affects the recording, processing, transmission, or interpretation of data; for example, starting or stopping a process, carriage return, font change, rewind, and end of transmission. control storage. A portion of storage that contains microcode. cps. Characters per second. cpu. Central processing unit. CRe. Cyclic redundancy check. CRT. Cathode ray tube. CRT display. Cathode ray tube display. CTS. Clear to send. Associated with modem control. cursor. (1) In computer graphics, a movable marker that is used to indicate a position on a display. (2) A displayed symbol that acts as a marker to help the user locate a point in text, in a system command, or in storage. (3) A movable spot of light on the screen of a display device, usually indicating where the next character is to be entered, replaced, or deleted. cyclic redundancy check (CRC). (1) A redundancy check in which the check key is generated by a cyclic algorithm. (2) A system of error checking performed at both the sending and receiving station after a block-check character has been accumulated. cylinder. (1) The set of all tracks with the same nominal distance from the axis about which the disk rotates. (2) The tracks of a disk storage device that can be accessed without repositioning the access mechanism. Glossary-8 daisy-chained cable. A type of cable that has two or more connectors attached in series. data. (1) A representation of facts, concepts, or instructions in a formalized manner suitable for communication, interpretation, or processing by human or automatic means. (2) Any representations, such as characters or analog quantities, to which meaning is, or might be assigned. data base. A collection of data that can be immediately accessed and operated upon by a data processing system for a specific purpose. data processing system. A system that performs input, processing, storage, output, and control functions to accomplish a sequence of operations on data. data transmission. Synonym for transmission. dB. Decibel. dBa. Adjusted decibels. dc. Direct current. debounce. An electronic means of overcoming the make/break bounce of switches to obtain one smooth change of signal level. decibel. (1) A unit that expresses the ratio of two power levels on a logarithmic scale. (2) A unit for measuring relative power. decoupJing capacitor. A capacitor that provides a low impedance path to ground to prevent common coupling between circuits. Deutsche Industrie Norm (DIN). (1) German Industrial Norm. (2) The committee that sets German dimension standards. digit. (1) A graphic character that represents an integer; for example, one of the characters 0 to 9. (2) A symbol that Glossary-9 represents one of the non-negative integers smaller than the radix. For example, in decimal notation, a digit is one of the characters 0 to 9. digital. (1) Pertaining to data in the form of digits. (2) Contrast with analog. DIN. Deutsche Industrie Norm. DIN connector. One of the connectors specified by the DIN committee. DIP. Dual in-line package. DIP switch. One of a set of small switches mounted in a dual in-line package. direct current (de). A current that always flows in one direction. direct memory access (DMA). A method of transferring data between main storage and I/O devices that does not require processor intervention. disable. To stop the operation of a circuit or device. disabled. Pertaining to a state of a processing unit that prevents the occurrence of certain types of interruptions. Synonymous with masked. disk. Loosely, a magnetic disk unit. disk drive. A mechanism for moving a disk pack and controlling its movements. disk pack. A removable assembly of magnetic disks. diskette. A thin, flexible magnetic disk and a semirigid protective jacket, in which the disk is permanently enclosed. Synonymous with flexible disk. Glossary-l0 diskette drive. A mechanism for moving a diskette and controlling its movements. display. (1) A visual presentation of data. (2) A device for visual presentation of information on any temporary character imaging device. (3) To present data visually. (4) See cathode ray tube display. display attribute. In computer graphics, a particular property that is assigned to all or part of a display; for example, low intensity, green color, blinking status. DMA. Direct memory access. dot matrix. (1) In computer graphics, a two-dimensional pattern of dots used for constructing a display image. This type of matrix can be used to represent characters by dots. (2) In word processing, a pattern of dots used to form characters. This term normally refers to a small section of a set of addressable points; for example, a representation of characters by dots. dot printer. Synonym for matrix printer. dot-matrix character generator. In computer graphics, a character generator that generates character images composed of dots. DSR. Data set ready. Associated with modem control. DTR. In the IBM Personal Computer, data terminal ready. Associated with modem control. dual in-line package (DIP). A widely used container for an integrated circuit. DIPs have pins in two parallel rows. The pins are spaced 1/ 10 inch apart. See also DIP switch. duplex. (1) In data communication, pertaining to a simultaneous two-way independent transmission in both directions. (2) Contrast with half -duplex. Glossary-It duty cycle. In the operation of a device, the ratio of on time to idle time. Duty cycle is expressed as a decimal or percentage. dynamic memory. RAM memory using transistors and capacitors as the memory elements. This memory requires a refresh (recharge) cycle every few milliseconds. Contrast with static memory. EBCDIC. Extended binary-coded decimal interchange code. ECC. Error checking and correction. edge connector. A terminal block with a number of contacts attached to the edge of a printed-circuit board to facilitate plugging into a foundation circuit. EIA. Electronic Industries Association. electromagnet. Any device that exhibits magnetism only while an electric current flows through it. enable. To initiate the operation of a circuit or device. end of block (EOB). A code that marks the end of a block of data. end of file (EO F). An internal label, immediately following the last record of a file, signaling the end of that file. It may include control totals for comparison with counts accumulated during processing. end-of-text (ETX). A transmission control character used to terminate text. end-of-transmission (EOT). A transmission control character used to indicate the conclusion of a transmission, which may have included one or more texts and any associated message headings. Glossary-12 end-of-transmission-block (ETB). A transmission control character used to indicate the end of a transmission block of data when data is divided into such blocks for transmission purposes. EOB. End of block. EOF. End of file. EOT. End-of-transmission. EPROM. Erasable programmable read-only memory. erasable programmable read-only memory (EPROM). A PROM in which the user can erase old information and enter new information. error checking and correction (ECC). The detection and correction of all single-bit errors, plus the detection of double-bit and some multiple-bit errors. ESC. The escape character. escape character (ESC). A code extension character used, in some cases, with one or more succeeding characters to indicate by some convention or agreement that the coded representations following the character or the group of characters are to be interpreted according to a different code or according to a different coded character set. ETB. End-of-transmission-block. ETX. End-of-text. extended binary-coded decimal interchange code (EBCDIC). A set of 256 characters, each represented by eight bits. Glossary-13 F. Fahrenheit. Fahrenheit (F). A temperature scale. Contrast with Celsius (C). falling edge. Synonym for negative-going edge. FCC. Federal Communications Commission. fetch. To locate and load a quantity of data from storage. FF. The form feed character. field. (1) In a record, a specified area used for a particular category of data. (2) In a data base, the smallest unit of data that can be referred to. fixed disk. In the IBM Personal Computer, synonym for disk drive. flag. (1) Any of various types of indicators used for identification. (2) A character that signals the occurrence of some condition, such as the end of a word. (3) Deprecated term for mark. flexible disk. Synonym for diskette. flip-flop. A circuit or device containing active elements, capable of assuming either one of two stable states at a given time. font. A family or assortment of characters of a given size and style; for example, 10 point Press Roman medium. foreground. (1) In multiprogramming, the environment in which high-priority programs are executed. (2) On a color display screen, the characters as opposed to the background. Glossary-14 form feed. (1) Paper movement used to bring an assigned part of a form to the printing position. (2) In word processing, a function that advances the typing position to the same character position on a predetermined line of the next form or page. form feed character. A control character that causes the print or display position to move to the next predetermined first line on the next form, the next page, or the equivalent. format. The arrangement or layout of data on a data medium. frame. (1) In SDLC, the vehicle for every command, every response, and all information that is transmitted using SDLC procedures. Each frame begins and ends with a flag. (2) In data transmission, the sequence of contiguous bits bracketed by and including beginning and ending flag sequences. g. Gram. G. (1) Prefix giga; 1 000 000 000. (2) When referring to computer storage capacity, 1 073 741 824. (1 073 741 824 = 2 to the 30th power.) gate. (1) A combinational logic circuit having one output channel and one or more input channels, such that the output channel state is completely determined by the input channel states. (2) A signal that enables the passage of other signals through a circuit. Gb. I 073 741 824 bytes. general-purpose register. A register, usually explicitly addressable within a set of registers, that can be used for different purposes; for example, as an accumulator, as an index register, or as a special handler of data. giga (G). Prefix 1 000 000 000. Glossary-15 gram (g). A unit of weight (equivalent to 0.035 ounces). graphic. A symbol produced by a process such as handwriting, drawing, or printing. graphic character. A character, other than a control character, that is normally represented by a graphic. half-duplex. (1) In data communication, pertaining to an alternate, one way at a time, independent transmission. (2) Contrast with duplex. hardware. (1) Physical equipment used in data processing, as opposed to programs, procedures, rules, and associated documentation. (2) Contrast with software. head. A device that reads, writes, or erases data on a storage medium; for example, a small electromagnet used to read, write, or erase data on a magnetic disk. hertz (Hz). A unit of frequency equal to one cycle per second. hex. Common abbreviation for hexadecimal. hexadecimal. (1) Pertaining to a selection, choice, or condition that has 16 possible different values or states. These values or states are usually symbolized by the ten digits 0 through 9 and the six letters A through F. (2) Pertaining to a fixed radix numeration system having a radix of 16. high impedance state. A state in which the output of a device is effectively isolated from the circuit. highlighting. In computer graphics, emphasizing a given display group by changing its attributes relative to other display groups in the same display field. high-order position. The leftmost position in a string of characters. See also most-significant digit. Glossary-16 housekeeping. Operations or routines that do not contribute directly to the solution of the problem but do contribute directly to the operation of the computer. Hz. Hertz image. A fully processed unit of operational data that is ready to be transmitted to a remote unit; when loaded into control storage in the remote unit, the image determines the operations of the unit. immediate instruction. An instruction that contains within itself an operand for the operation specified, rather than an address of the operand. index register. A register whose contents may be used to modify an operand address during the execution of computer instructions. indicator. (1) A device that may be set into a prescribed state, usually according to the result of a previous process or on the occurrence of a specified condition in the equipment, and that usually gives a visual or other indication of the existence of the prescribed state, and that may in some cases be used to determine the selection among alternative processes; for example, an overflow indicator. (2) An item of data that may be interrogated to determine whether a particular condition has been satisfied in the execution of a computer program; for example, a switch indicator, an overflow indicator. inhibited. (1) Pertaining to a state of a processing unit in which certain types of interruptions are not allowed to occur. (2) Pertaining to the state in which a transmission control unit or an audio response unit cannot accept incoming calls on a line. initialize. To set counters, switches, addresses, or contents of storage to 0 or other starting values at the beginning of, or at prescribed points in, the operation of a computer routine. inputloutput (II 0). (1) Pertaining to a device or to a channel that may be involved in an input process, and, at a different time, in an output process. In the English language, "inputloutput" may be Glossary-17 used in place of such terms "input/output data", "input/output signal", and "input/output terminals", when such usage is clear in a given context. (2) Pertaining to a device whose parts can be performing an input process and an output process at the same time. (3) Pertaining to either input or output, or both. instruction. In a programming language, a meaningful expression that specifies one operation and identifies its operands, if any. instruction set. The set of instructions of a computer, of a programming language, or of the programming languages in a programming system. interface. A device that alters or converts actual electrical signals between distinct devices, programs, or systems. interleave. To arrange parts of one sequence of things or events so that they alternate with parts of one or more other sequences of the same nature and so that each sequence retains its identity. interrupt. (1) A suspension of a process, such as the execution of a computer program, caused by an event external to that process, and performed in such a way that the process can be resumed. (2) In a data transmission, to take an action at a receiving station that causes the transmitting station to terminate a transmission. (3) Synonymous with interruption. I/O. Input/output. I/O area. Synonym for buffer. irrecoverable error. An error that makes recovery impossible without the use of recovery techniques external to the computer program or run. joystick. In computer graphics, a lever that can pivot in all directions and that is used as a locator device. k. Prefix kilo; 1000. Glossary-18 K. When referring to storage capacity, 1024. (1024 10th power.) = 2 to the Kb. 1024 bytes. kg. Kilogram; 1000 grams. kHz. Kilohertz; 1000 hertz. kilo (k). Prefix 1000 kilogram (kg). 1000 grams. kilohertz (kHz). 1000 hertz latch. (1) A simple logic-circuit storage element. (2) A feedback loop in sequential digital circuits used to maintain a state. least-significant digit. The rightmost digit. See also low-order position. LED. Light-emitting diode. light-emitting diode (LED). A semiconductor device that gives off visible or infrared light when activated. load. In programming, to enter data into storage or working registers. low power Schottky TTL. A version (LS series) of TTL giving a good compromise between low power and high speed. See also transistor-transistor logic and Schottky TTL. low-order position. The rightmost position in a string of characters. See also least-significant digit. m. (1) Prefix milli; 0.001. (2) Meter. Glossary-19 M. (1) Prefix mega; 1 000000. (2) When referring to computer storage capacity, 1 048 576. (1 048 576 = 2 to the 20th power.) mAo Milliampere; 0.001 ampere. machine code. The machine language used for entering text and program instructions onto the recording medium or into storage and which is subsequently used for processing and printout. machine language. (1) A language that is used directly by a machine. (2) Deprecated term for computer instruction code. magnetic disk. (1) A flat circular plate with a magnetizable surface layer on which data can be stored by magnetic recording. (2) See also diskette. main storage. (1) Program-addressable storage from which instructions and other data can be loaded directly into registers for subsequent execution or processing. (2) Contrast with auxiliary storage. mark. A symbol or symbols that indicate the beginning or the end of a field, of a word, of an item of data, or of a set of data such as a file, a record, or a block. mask. (1) A pattern of characters that is used to control the retention or elimination of portions of another pattern of characters. (2) To use a pattern of characters to control the retention or elimination of portions of another pattern of characters. masked. Synonym for disabled. matrix. (1) A rectangular array of elements, arranged in rows and columns, that may be manipulated according to the rules of matrix algebra. (2) In computers, a logic network in the form of an array of input leads and output leads with logic elements connected at some of their intersections. matrix printer. A printer in which each character is represented by a pattern of dots; for example, a stylus printer, a wire printer. Synonymous with dot printer. Glossary-20 Mb. 1 048 576 bytes. mega (M). Prefix 1 000 000. megahertz (MHz). 1 000 000 hertz. memory. Term for main storage. meter (m). A unit of length (equivalent to 39.37 inches). MFM. Modified frequency modulation. MHz. Megahertz; 1 000 000 hertz. microcode. (1) One or more microinstructions. (2) A code, representing the instructions of an instruction set, implemented in a part of storage that is not program-addressable. microinstruction. (1) An instruction of microcode. (2) A basic or elementary machine instruction. microprocessor. An integrated circuit that accepts coded instructions for execution; the instructions may be entered, integrated, or stored internally. microsecond (ILS). 0.000 001 second. milli (m). Prefix 0.001. milliampere (rnA). 0.001 ampere. millisecond (ms). 0.001 second. mnemonic. A symbol chosen to assist the human memory; for example, an abbreviation such as "mpy" for "multiply". Glossary-21 mode. (1) A method of operation; for example, the binary mode, the interpretive mode, the alphanumeric mode. (2) The most frequent value in the statistical sense. modem (modulator-demodulator). A device that converts serial (bit by bit) digital signals from a business machine (or data communication equipment) to analog signals that are suitable for transmission in a telephone network. The inverse function is also performed by the modem on reception of analog signals. modified frequency modulation (MFM). The process of varying the amplitude and frequency of the 'write' signal. MFM pertains to the number of bytes of storage that can be stored on the recording media. The number of bytes is twice the number contained in the same unit area of recording media at single density. modulation. The process by which some characteristic of one wave (usually high frequency) is varied in accordance with another wave or signal (usually low frequency). This technique is used in modems to make business-machine signals compatible with communication facilities. modulation rate. The reciprocal of the measure of the shortest nominal time interval between successive significant instants of the modulated signal. If this measure is expressed in seconds, the modulation rate is expressed in baud. module. ( 1) A program unit that is discrete and identifiable with respect to compiling, combining with other units, and loading. (2) A packaged functional hardware unit designed for use with other components. modulo check. A calculation performed on values entered into a system. This calculation is designed to detect errors. monitor. (1) A device that observes and verifies the operation of a data processing system and indicates any significant departure from the norm. (2) Software or hardware that observes, supervises, controls, or verifies the operations of a system. most-significant digit. The leftmost (non-zero) digit. See also high-order position. Glossary-22 ms. Millisecond; 0.001 second. multiplexer. A device capable of interleaving the events of two or more activities, or capable of distributing the events of an interleaved sequence to the respective activities. multiprogramming. ( 1) Pertaining to the concurrent execution of two or more computer programs by a computer. (2) A mode of operation that provides for the interleaved execution of two or more computer programs by a single processor. n. Prefix nano; 0.000000001. NAND. A logic operator having the property that if P is a statement, Q is a statement, R is a statement, ... , then the NAND of P, Q ,R, ... is true if at least one statement is false, false if all statements are true. NAND gate. A gate in which the output is 0 only if all inputs are 1. nano (n). Prefix 0.000 000 001. nanosecond (ns). 0.000000001 second. negative true. Synonym for active low. negative-going edge. The edge of a pulse or signal changing in a negative direction. Synonymous with falling edge. non-return-to-zero change-on-ones recording (NRZI). A transmission encoding method in which the data terminal equipment changes the signal to the opposite state to send a binary 1 and leaves it in the same state to send a binary o. non-return-to-zero (inverted) recording (NRZI). Deprecated term for non-return-to-zero change-on-ones recording. Glossary-23 NOR. A logic operator having the property that if P is a statement, Q is a statement, R is a statement, ... , then the NOR of P, Q, R, ... is true if all statements are false, false if at least one statement is true. NOR gate. A gate in which the output is 0 only if at least one input is 1. NOT. A logical operator having the property that if P is a statement, then the NOT of P is true if P is false, false if P is true. NRZI. Non-return-to-zero change-on-ones recording. ns. Nanosecond; 0.000000001 second. NUL. The null character. null character (NUL). A control character that is used to accomplish media-fill or time-fill, and that may be inserted into or removed from, a sequence of characters without affecting the meaning of the sequence; however, the control of the equipment or the format may be affected by this character. odd-even check. Synonym for parity check. offline. Pertaining to the operation of a functional unit without the continual control of a computer. one-shot. A circuit that delivers one output pulse of desired duration for each input (trigger) pulse. open circuit. (1) A discontinuous circuit; that is, one that is broken at one or more points and, consequently, cannot conduct current. Contrast with closed circuit. (2) Pertaining to a no-load condition; for example, the open-circuit voltage of a power supply. Glossary-24 open coUector. A switching transistor without an internal connection between its collector and the voltage supply. A connection from the collector to the voltage supply is made through an external (pull-up) resistor. operand. (1) An entity to which an operation is applied. (2) That which is operated upon. An operand is usually identified by an address part of an instruction. operating system. Software that controls the execution of programs; an operating system may provide services such as resource allocation, scheduling, input/output control, and data management. OR. A logic operator having the property that if P is a statement, Q is a statement, R is a statement, ... , then the OR of P, Q, R, .. .is true if at least one statement is true, false if all statements are false. OR gate. A gate in which the output is 1 only if at least one input is 1. output. Pertaining to a device, process, or channel involved in an output process, or to the data or states involved in an output process. output process. (1) The process that consists of the delivery of data from a data processing system, or from any part of it. (2) The return of information from a data processing system to an end user, including the translation of data from a machine language to a language that the end user can understand. overcurrent. A current of higher than specified strength. overflow indicator. (1) An indicator that signifies when the last line on a page has been printed or passed. (2) An indicator that is set on if the result of an arithmetic operation exceeds the capacity of the accumulator. overrun. Loss of data because a receiving device is unable to accept data at the rate it is transmitted. Glossary-25 overvoltage. A voltage of higher than specified value. parallel. (1) Pertaining to the concurrent or simultaneous operation of two or more devices, or to the concurrent performance of two or more activities. (2) Pertaining to the concurrent or simultaneous occurrence of two or more related activities in multiple devices or channels. (3) Pertaining to the simultaneity of two or more processes. (4) Pertaining to the simultaneous processing of the individual parts of a whole, such as the bits of a character and the characters of a word, using separate facilities for the various parts. (5) Contrast with serial. parameter. (1) A variable that is given a constant value for a specified application and that may denote the application. (2) A name in a procedure that is used to refer to an argument passed to that procedure. parity bit. A binary digit appended to a group of binary digits to make the sum of all the digits either always odd (odd parity) or always even (even parity). parity check. (1) A redundancy check that uses a parity bit. (2) Synonymous with odd-even check. PEL. Picture element. personal computer. A small home or business computer that has a processor and keyboard and that can be connected to a television or some other monitor. An optional printer is usually available. phototransistor. A transistor whose switching action is controlled by light shining on it. picture element (PEL). The smallest displayable unit on a display. polling. (1) Interrogation of devices for purposes such as to avoid contention, to determine operational status, or to determine readiness to send or receive data. (2) The process whereby stations are invited, one at a time, to transmit. Glossary-26 port. An access point for data entry or exit. positive true. Synonym for active high. positive-going edge. The edge of a pulse or signal changing in a positive direction. Synonymous with rising edge. potentiometer. A variable resistor with three terminals, one at each end and one on a slider (wiper). power supply. A device that produces the power needed to operate electronic equipment. printed circuit. A pattern of conductors (corresponding to the wiring of an electronic circuit) formed on a board of insulating material. printed-circuit board. A usually copper-clad plastic board used to make a printed circuit. priority. A rank assigned to a task that determines its precedence in receiving system resources. processing program. A program that performs such functions as compiling, assembling, or translating for a particular programming language. processing unit. A functional unit that consists of one or more processors and all or part of internal storage. processor. (1) In a computer, a functional unit that interprets and executes instructions. (2) A functional unit, a part of another unit such as a terminal or a processing unit, that interprets and executes instructions. (3) Deprecated term for processing program. (4) See microprocessor. program. (1) A series of actions designed to achieve a certain result. (2) A series of instructions telling the computer how to handle a problem or task. (3) To design, write, and test computer programs. programmable read-only memory (PROM). A read-only memory that can be programmed by the user. Glossary-27 programming language. (1) An artificial language established for expressing computer programs. (2) A set of characters and rules with meanings assigned prior to their use, for writing computer programs. programming system. One or more programming languages and the necessary software for using these languages with particular automatic data-processing equipment. PROM. Programmable read-only memory. propagation delay. (1) The time necessary for a signal to travel from one point on a circuit to another. (2) The time delay between a signal change at an input and the corresponding change at an output. protocol. (1) A specification for the format and relative timing of information exchanged between communicating parties. (2) The set of rules governing the operation of functional units of a communication system that must be followed if communication is to be achieved. pulse. A variation in the value of a quantity, short in relation to the time schedule of interest, the final value being the same as the initial value. radio frequency (RF). An ac frequency that is higher than the highest audio frequency. So called because of the application to radio communication. radix. (1) In a radix numeration system, the positive integer by which the weight of the digit place is multiplied to obtain the weight of the digit place with the next higher weight; for example, in the decimal numeration system the radix of each digit place is 10. (2) Another term for base. radix numeration system. A positional representation system in which the ratio of the weight of anyone digit place to the weight Glossary-28 of the digit place with the next lower weight is a positive integer (the radix). The permissible values of the character in any digit place range from 0 to one less than the radix. RAM. Random access memory. Read/write memory. random access memory (RAM). Read/write memory. RAS. In the IBM Personal Computer, row address strobe. raster. In computer graphics, a predetermined pattern of lines that provides uniform coverage of a display space. read. To acquire or interpret data from a storage device, from a data medium, or from another source. read-only memory (ROM). A storage device whose contents cannot be modified. The memory is retained when power is removed. read/write memory. A storage device whose contents can be modified. Also called RAM. recoverable error. An error condition that allows continued execution of a program. red-green-blue-intensity (RGBI). The description of a direct-drive color monitor that accepts input signals of red, green, blue, and intensity. redundancy check. A check that depends on extra characters attached to data for the detection of errors. See cyclic redundancy check. register. (1) A storage device, having a specified storage capacity such as a bit, a byte, or a computer word, and usually intended for a special purpose. (2) A storage device in which specific data is stored. Glossary-29 retry. To resend the current block of data (from the last EOB or ETB) a prescribed number of times, or until it is entered correctly or accepted. reverse video. A form of highlighting a character, field, or cursor by reversing the color of the character, field, or cursor with its background; for example, changing a red character on a black background to a black character on a red background. RF. Radio frequency. RF modulator. The device used to convert the composite video signal to the antenna level input of a home TV. RGBI. Red-green-blue-intensity. rising edge. Synonym for positive-going edge. ROM. Read-only memory. ROM/BIOS. The ROM resident basic input/output system, which provides the level control of the major I/O devices in the computer system. row address strobe (RAS). A signal that latches the row address in a memory chip. RS-232C. A standard by the EIA for communication between computers and external equipment. RTS. Request to send. Associated with modem control. run. A single continuous performance of a computer program or routine. Glossary-30 schematic. The representation, usually in a drawing or diagram form, of a logical or physical structure. Schottky TTL. A version (S series) of TTL with faster switching speed, but requiring more power. See also transistor-transistor logic and low power Schottky TTL. SDLC. Synchronous Data Link Control sector. That part of a track or band on a magnetic drum, a magnetic disk, or a disk pack that can be accessed by the magnetic heads in the course of a predetermined rotational displacement of the particular device. SERDES. Serializer / deserializer. serial. (1) Pertaining to the sequential performance of two or more activities in a single device. In English, the modifiers serial and parallel usually refer to devices, as opposed to sequential and consecutive, which refer to processes. (2) Pertaining to the sequential or consecutive occurrence of two or more related activities in a single device or channel. (3) Pertaining to the sequential processing of the individual parts of a whole, such as the bits of a character or the characters of a word, using the same facilities for successive parts. (4) Contrast with parallel. serializer/deserializer (SERDES). A device that serializes output from, and de serializes input to, a business machine. setup. (1) In a computer that consists of an assembly of individual computing units, the arrangement of interconnections between the units, and the adjustments needed for the computer to operate. (2) The preparation of a computing system to perform a job or job step. Setup is usually performed by an operator and often involves performing routine functions, such as mounting tape reels. (3) The preparation of the system for normal operation. Glossary-31 short circuit. A low-resistance path through which current flows, rather than through a component or circuit. signal. A variation of a physical quantity, used to convey data. sink. A device or circuit into which current drains. software. (1) Computer programs, procedures, and rules concerned with the operation of a data processing system. (2) Contrast with hardware. source. The origin of a signal or electrical energy. square wave. An alternating or pulsating current or voltage whose waveshape is square. square wave generator. A signal generator delivering an output signal having a square waveform. 88. Start-stop. start bit. (1) A signal to a receiving mechanism to get ready to receive data or perform a function. (2) In a start-stop system, a signal preceding a character or block that prepares the receiving device for the reception of the code elements. start-of-text (8TX). A transmission control character that precedes a text and may be used to terminate the message heading. start-stop system. A data transmission system in which each character is preceded by a start bit and is followed by a stop bit. start-stop (88) transmission. (1) Asynchronous transmission such that a group of signals representing a character is preceded by a start bit and followed by a stop bit. (2) Asynchronous transmission in which a group of bits is preceded by a start bit that prepares the receiving mechanism for the reception and registration of a character and is followed by at least one stop bit that enables the receiving mechanism to come to an idle condition pending the reception of the next character. Glossary-32 static memory. RAM memory using flip-flops as the memory elements. Data is retained as long as power is applied to the flip-flops. Contrast with dynamic memory. stop bit. (1) A signal to a receiving mechanism to wait for the next signal. (2) In a start-stop system, a signal following a character or block that prepares the receiving device for the reception of a subsequent character or block. storage. (1) A storage device. (2) A device, or part of a device, that can retain data. (3) The retention of data in a storage device. (4) The placement of data into a storage device. strobe. An instrument that emits adjustable-rate flashes of light. Used to measure the speed of rotating or vibrating objects. STX. Start-of-text. symbol. (1) A conventional representation of a concept or a representation of something by reason of relationship, association, or convention. (2) A representation of something by reason of relationship, association, or convention. synchronization. The process of adjusting the corresponding significant instants of two signals to obtain the desired phase relationship between these instants. Synchronous Data Link. Control (SDLC). A protocol for management of data transfer over a data link. synchronous transmission. (1) Data transmission in which the time of occurrence of each signal representing a bit is related to a fixed time frame. (2) Data transmission in which the sending and receiving devices are operating continuously at substantially the same frequency and are maintained, by means of correction, in a desired phase relationship. syntax. (1) The relationship among characters or groups of characters, independent of their meanings or the manner of their Glossary-33 interpretation and use. (2) The structure of expressions in a language. (3) The rules governing the structure of a language. (4) The relationships among symbols. text. In ASCII and data communication, a sequence of characters treated as an entity if preceded and terminated by one STX and one ETX transmission control character, respectively. time-out. (1) A parameter related to an enforced event designed to occur at the conclusion of a predetermined elapsed time. A time-out condition can be cancelled by the receipt of an appropriate time-out cancellation signal. (2) A time interval allotted for certain operations to occur; for example, response to polling or addressing before system operation is interrupted and must be restarted. track. (1) The path or one of the set of paths, parallel to the reference edge on a data medium, associated with a single reading or writing component as the data medium moves past the component. (2) The portion of a moving data medium such as a drum, or disk, that is accessible to a given reading head position. transistor-transistor logic (TTL). A popular logic circuit family that uses multiple-emitter transistors. translate. To transform data from one language to another. transmission. (1) The sending of data from one place for reception elsewhere. (2) In ASCII and data communication, a series of characters including headings and text. (3) The dispatching of a signal, message, or other form of intelligence by wire, radio, telephone, or other means. (4) One or more blocks or messages. For BSC and start-stop devices, a transmission is terminated by an EOT character. (5) Synonymous with data transmission. TTL. Transistor-transistor logic. v. Volt. Glossary-34 video. Computer data or graphics displayed on a cathode ray tube, monitor, or display. volt. The basic practical unit of electric pressure. The potential that causes electrons to flow through a circuit. w. Watt. watt. The practical unit of electric power. word. (1) A character string or a bit string considered as an entity. (2) See computer word. write. To make a permanent or transient recording of data in a storage device or on a data medium. write precompensation. The varying of the timing of the head current from the outer tracks to the inner tracks of the diskette to keep a constant 'write' signal. Glossary-35 Notes: Glossary-36 Bibliography • Microprocessor and Peripheral Handbook - • Introduction to the iAPX 286 - • INTEL Corporation. 21 0760.001 Numeric Processor Extension Data Sheet - • INTEL Corporation.21 0498.001 iAPX 286 Hardware Reference Manual - • INTEL Corporation. 121960. 001 iAPX 286 Programmer's Reference Manual - • INTEL Corporation.21 0308. 001 iAPX 286 Operating Systems Writer's Guide - • INTEL Corporation.210844.001 INTEL Corporation.21 0920 80287 Support Library Reference Manual - INTEL Corporation. 12 212 9 • National Semiconductor Corporation. NS 1645 0 • Motorola Microprocessor's Data Manual - Motorola Inc. Series B BibJiograpby-l Notes: Bibliograpby-2 Index A AAA 6-8 AAD 6-9 AAM 6-9 AAS 6-9 access time, track-to-track 9-22 ADC 6-6 ADD 6-6 additional ROM modules 5-12 address generation, DMA 1-13 address latch enable 1-26 address latch enable, buffered 1-23 address mode real 1-4 address space, 1/0 1-15 address, segment 1-4 addresses, CMOS RAM 1-45 addresses, page register 1-13 AEN 1-23, 1-26 ALE 9-3 alternate key 5-19 AND 6-10 APL 9-5 application guidelines 9-5 arithmetic instructions 6-6,6-27 ARPL 6-22 ASCII, extended 5-12 Index-l B BALE 1-22, 1-23 bandwith 1-7 BASIC 9-5 basic assurance test 4-4 BASIC interrupts 5-6 BAT 4-4 battery connector 1-58 BHE 1-13 BIOS fixed disk parameters 1-51 BIOS memory map 5-10 BIOS programming hints 5-10 block diagram keyboard interface 1-38 system xv system board 1-6 system timer 1-9 board, system 1-3 BOUND 6-19 break code 4-4, 4-10 break key 5-19 buffer, keyboard 4-3 buffered address latch enable 1-23 buffers, video display 9-10 bus controller 1-23 bus cycle 1-7 busy loop 9-11 bypassing BIOS 9-22 byte high enable 1-13 c CALL 6-14 cancellation, multi-tasking 9-21 capacitor, variable 1-31 caps lock key 5-19 CBW 6-10 Index-2 channel, 1/0 1-15 channels, DMA 1-7,1-12,1-15 character codes 5-13 classes, wait loop 9-13 CLC 6-19 CLD 6-20 CLI 6-20 CLK 1-22 clock real-time 1-45 clock cycle 1-7 clock line, keyboard 1-43,4-5,4-14,4-15 clock, system 1-22 CMC 6-19 CMOS RAM 1-45 CMOS RAM addresses 1-45 CMOS RAM configuration 1-48 CMOS RAM I/O operations 1-54 CMP 6-8 CMPS 6-12,6-13 COBAL 9-5 code device driver 9-11 machine identification 9-23 machine-sensitive 9-23 codes character 5-13 extended 5-17 multi-tasking function 9-11 color burst signal 1-31 command codes, DMA controller 1-14 commands I/O 9-8 keyboard 4-12 keyboard controller 1-40 keyboard system 4-5 comparison instructions 6-25 compatibility, hardware 9-3 completion, multi-tasking 9-21 condition, wait 9-12 configuration record 1-45 configuration, CMOS RAM 1-48 Index-3 connectors battery 1-58 I/O channel 1-15,1-17,1-18,1-19 keyboard 1-58,4-23 power LED and keylock 1-58 power supply 1-57 power supply output 3-6 speaker 1-57 system board 1-57 constants instructions 6-26 control game 9-10 sound 9-10 control key 5-19 control transfer instructions 6-13 controller, keyboard 1-31 controllers bus 1-23 DMA 1-7, 1-12, 1-13, 1-22 interrupt 1-10 refresh 1-7 controls, math coprocessor 1-29 coprocessor programming 2-3 coprocessor, math 2-3 copy protection 9-11,9-22 Ctrl state 5-17 CTS 6-20 CWD 6-10 cycle bus 1-7 clock 1-7 microprocessor 1-7 D DACKO-DACK3 1-26 DACK5-DACK7 1-26 DAS 6-9 data area, ROM BIOS 9-10 data communication equipment 8-3 data input, keyboard 4-15 Index-4 data line, keyboard 1-43,4-5,4-14,4-15 data output, keyboard 4-15 data stream 4-14 data terminal equipment 8-3 data transfer instructions 6-3, 6-24 data transfer rate, diskette 9-22 DEC 6-8 decodes, memory 1-22, 1-23 default segment workspace 5-9 descriptors 1-5 device driver code 9-11 diagnostic checkpoint port 1-29 direct memory access 1-12 disk pointer 9-8 disk_base 9-8,9-22 diskette change signal 9-23 diskette data transfer rate 9-22 diskette rotational speed 9-22 diskette track density 9-22 diskette write current 9-23 DIV 6-9 divide error exception 9-7 DMA 1-12 DMA address generation 1-13 DMA channels 1-7,1-12, 1-15 DMA controller 1-7,1-22 DMA controller command codes 1-14 DMA controller 1 1-12 DMA controller 2 1-13 DMA controllers 1-12 DOS 9-6 DOS function calls 9-7 DOS interrupts 5-6 DRQO-DRQ3 1-25 DRQ5-DRQ7 1-25 dummy load 3-4 Index-5 E EIA/CCITT 8-3 encoding, keyboard 5-12 ENTER 6-18 ESC 6-20 exception, divide error 9-7 extended ASCII 5-12 extended codes 5-17 F FABS 6-28 FADD 6-27 fan out 3-6 FCHS 6-28 FCLEX 6-30 FCOM 6-25 FCOMP 6-25 FCOMPP 6-26 FDECSTP 6-31 FDIV 6-27 FFREE 6-31 FIFO 4-3 FINCSTP 6-31 FINT 6-29 FLD 6-24 FLDCW 6-30 FLDENV 6-30 FLDLG2 6-27 FLDLN2 6-27 FLDL2T 6-26 FLDPI 6-26 FLDZ 6-26 FLDI 6-26 FMUL 6-27 FNOP 6-31 FORTRAN 9-5 Index-6 FPATAN 6-29 FPREM 6-28 FPTAN 6-29 French keyboard 4-19 FRNDINT 6-28 FRS TOR 6-30 FSAVE 6-30 FSCALE 6-28 FSETPM 6-29 FSQRT 6-28 FST 6-24 FSTCW 6-30 FSTENV 6-30 FSTP 6-25 FSTSW 6-30 FSTSWAX 6-30 FSUB 6-27 FTST 6-26 function calls, DOS 9-7 function codes, multi-tasking 9-14 FXAM 6-26 FXCH 6-25 FXTRACT 6-28 FYL2X 6-29 FYL2XP1 6-29 F2XM1 6-29 G game control 9-10 gap length parameter 9-9 generator, refresh request 1-8 German keyboard 4-20 graphics modes 5-8 guidelines, application 9-5 Index-7 H hard code 5-10 hardware compatibility 9-3 hardware interrupts 5-6 HLT 6-20 hooks 9-11 I I/O address map 1-28 I/O address space 1-15 I/O CH CK 1-23, 1-30 I/O CH RDY 1-24 I/O channell-IS I/O channel check 1-23 I/O channel connectors 1-15,1-17,1-18,1-19 I/O channel ready 1-24 I/O channel signals 1-22 I/O chip select 1-27 I/O commands 9-7 I/O CS16 1-27 I/O ports, keyboard controller 1-43 I/O read 1-24 I/O write 1-24 IDIV 6-9 IIMUL 6-9 IMR 9-10 IMUL 6-9 IN 6-5 INC 6-7 inhibit keyboard 1-37 input buffer, keyboard controller 1-40 input port, keyboard controller 1-44 input requirements 3-3 inputs, power supply 3-3 INS 6-12,6-13 Index-8 instructions arithmetic 6-6,6-27 comparison 6-25 constants 6-26 control transfer 6-13 data transfer 6-3, 6-24 logic 6-10 processor control 6-19 protection control 6-21 shift rotate 6-10 string manipulation 6-12 INT 6-18 interface, keyboard 4-3 interfaces, multi-tasking 9-12 interfaces, SYS code 9-18 interrupt controller 1-10 interrupt mask register 9-10 interrupt service routine 1-24 interrupt vectors 9-10 interrupt, single step 9-7 interrupts 1-15,5-5 BASIC 5-6 DOS 5-6 hardware 5-6 program 5-3 system 1-10 INTO 6-19 lOR 1-24 lOW 1-24 lRET 6-19 IRQ 2 9-8 IRQ 9 9-4, 9-8 IRQI4-IRQI5 1-24 IRQ3-IRQ7 1-24 IRQ9 1-24 Italian keyboard 4-21 J JB/JNAE 6-16 JBE/JNA 6-16 Index-9 JCXZ 6-18 JE/JZ 6-16 JL/JNGE 6-16 JLE/JNG 6-16 JMP 6-14 JNB/JAE 6-17 JNBE/JA 6-17 JNE/JNZ 6-16 JNL/JGE 6-17 JNLE/JG 6-17 JNO 6-17 JNP/JPO 6-17 JNS 6-17 JO 6-16 joystick support 5-6 JP/JPE 6-16 JS 6-16 jumper, RAM 1-30 K key scan codes 4-10 keyboard buffer 4-3 clock line 1-43,4-5,4-14,4-15 commands 4-12 connector 1-58,4-23 controller 1-31 controller commands 1-40 controller I/O ports 1-43 controller input buffer 1-40 controller input port 1-44 controller output buffer 1-40 controller output port 1-44 controller status register 1-38 controller test input port 1-44 data input 4-15 data line 1-43,4-5,4-14,4-15 data output 4-15 encoding 5-12 Index-lO inhibit switch 1-37 interface 4-3 interface block diagram 1-38 layout 1-33,4-10,5-14 outputs 4-10 routine 5-21 specifications 4-23 system commands 4-5 keyboard, French 4-19 keyboard, German 4-20 keyboard, Italian 4-21 keyboard, Spanish 4-22 keyboard, U.K. English 4-18 keyboard, U.S. English 4-17 keylock 4-3 keys 4-3 alternate 5-19 break 5-19 caps lock 5-19 combinations 5-20 control 5-19 number lock 5-20 pause 5-19 print screen 5-19 scroll lock 5-20 shift 5-18 SYS REQ 9-15 system request 5-6,5-20 keys, typematic 4-4 L LAHF 6-6 LAR 6-22 layout system board 1-60 layout, keyboard 1-33,4-10,5-14 LA17-LA23 1-22 LDS 6-5 LEA 6-5 LEAVE 6-18 Index-11 LED 4-4 LES 6-6 LGDT 6-21 LIDT 6-21 light emitting diodes 4-4 line contention 4-15 line, multipoint 8-5 line, point-to-point 8-5 LLDT 6-21 LMSW 6-22 load current 3-3 LOCK 6-20 LODS 6-12,6-13 logic instructions 6-10 LOOP 6-17 loop, busy 9-12 LOOPNZ/LOOPNE 6-18 loops, program 9-10 LOOPZ/LOOPE 6-18 LSL 6-22 LTR 6-21 M machine identification code 9-23 machine-sensitive code 9-23 make code 4-3,4-10 mask off 1-29 mask on 1-29 master 1-26 math coprocessor 2-3,9-6 math coprocessor controls 1-29 MEM chip select 1-27 MEM CS16 1-27 memory 1-4 memory decodes 1-22, 1-23 memory locations, reserved 5-9 memory map, BIOS 5-10 MEMR 1-25 MEMW 1-25 Index-12 microprocessor 1-3, 1-4, 1-7 microprocessor cycle 1-7 modes, graphic 5-8 modules, RAM 1-12 modules, ROM/EPROM 1-11 MOV 6-3 MOVS 6-12,6-13 MUL 6-9 multi-tasking cancellation 9-21 completion 9-21 function codes 9-14 interfaces 9-12 provisions 9-11 serialization 9-12 startup 9-12,9-20 subsystems 9-16 multipoint line 8-5 N NEG 6-8 network, nonswitched 8-5 network, switched 8-5 NMI 1-10, 1-29 no load protection 3-5 non-maskable interrupt 1-29 nonswitched network 8-5 NOT 6-12 . NumLockstate 5-17 number lock key 5-20 o operations, CMOS RAM I/O 1-54 OR 6-11 Index-13 OSC 1-27, 1-31 oscillator 1-27 OUT 6-5 output buffer, keyboard controller 1-40 output port, keyboard controller 1-44 output protection 3-4 output voltage sense levels 3-6 output voltage sequencing 3-4 outputs, keyboard 4-10 outputs, power supply 3-3 OUTS 6-13 p page register addresses 1-13 parameter gap length 9-9 passing 5-4 tables 9-8 parameters, BIOS fixed disk 1-51 PASCAL 9-5 pause key 5-19 performance, system 1-7 point-to-point line 8-5 POP 6-4 paPA 6-4 POPF 6-6. 9-6 paR 4-4 port, diagnostic checkpoint 1-29 POST 9-12 power good signal 3-5, 3-6 power LED and keylock connector 1-58 power on reset 4-4 power supply connectors 1-57 inputs 3-3 output connectors 3-6 outputs 3-3 print screen key 5-19 priorities, shift key 5-20 Index-14 processor control instructions 6-19 program interrupts 5-3 program loops 9-11 programming hints, BIOS 5-10 programming, coprocessor 2-3 protected mode 1-5, 5-6 protection control instructions 6-21 protection, no load 3-5 provisions, multitasking 9-11 PUSH 6-4 PUSH SP 9-7 PUSHA 6-4 PUSHF 6-6 R RAM jumper 1-30 RAM modules 1-12 RAM subsystem 1-12 RAM, CMOS 1-45 rate, typematic 4-4, 4-7 real address mode 1-4, 2-5 real mode 5-3 real-time clock 1-45 record, configuration 1-45 refid=admod.virtual 1-4 REFRESH 1-26 refresh controller 1-7 refresh request generator 1-8 regulation tolerance 3-3 requirements, input 3-3 reserved memory locations 5-9 reserved scan codes 1-36 RESETDRV 1-23 reset, system 5-21 RET 6-15 ROM BIOS 9-7 ROM BIOS data area 9-10 ROM modules, additional 5-12 ROM scan codes 5-12 Index-15 ROM subsystem 1-11 ROM/EPROM modules 1-11 rotational, speed 9-22 routine, interrupt service 1-24 routine, keyboard 5-21 RS-232 8-3 s SAHF 6-6 SAO-SAI9 1-22 SBB 6-7 SBHE 1-26 scan code translation 1-32 scan codes 4-12 scan codes, key 4-10 scan codes, ROM 5-12 SeAS 6-12,6-13 scroll lock key 5-20 SO)-SOI5 1-23 segment address 1-4 segments 1-4 sense levels, output voltage 3-6 sequencing, output voltage 3-4 serialization, multi-tasking 9-12 SGOT 6-21 shift counts 9-7 shift key 5-18 shift key priorities 5-20 shift rotate instructions 6-10 Shift state 5-17 shift states 5-18 SlOT 6-21 signals diskette change 9-23 power good 3-5, 3-6 system clock 9-3 signals, I/O channels 1-22 single step interrupt 9-7 SLOT 6-21 Index-16 SMEMR 1-25 SMEMW 1-25 SMSW 6-22 sound control 9-10 Spanish keyboard 4-22 speaker 1-30 speaker connector 1-57 speaker tone generation 1-9 special vectors 5-6 specifications, keyboard 4-23 startup, multi-tasking 9-12,9-18 states Ctrl 5-17 Num Lock 5-17 Shift 5-17 status register, keyboard controller 1-38 STC 6-19 STD 6-20 STI 6-20 STOS 6-12,6-13 STR 6-22 string manipulation instructions 6-12 SUB 6-7 subsystem, RAM 1-12 subsystem, ROM 1-11 subsystems, multi-tasking 9-16 support joystick 5-6 switched network 8-5 switches keyboard inhibit 1-37 type of display 1-31 SYS code interfaces 9-18 SYS REQ key 9-15 system BIOS usage 5-3 system block diagram xv system board 1-3 system board block diagram 1-6 system board connectors 1-57 system board layout 1-60 system bus high enable 1-26 system clock 1-22 system clock signal 9-3 system interrupts 1-10 Index-17 system performance 1-7 system request key 5-6, 5-20 system reset 5-21 system timer block diagram 1-9 system timers 1-8 T T/C 1-26 table, translation 1-34 tables, parameter 9-8 terminal count 1-26 TEST 6-11 test input port, keyboard controller 1-44 time outs 9-15 timer/counter 1-9 timer / counters 1-8 timers, system 1-8 tone generation, speaker 1-9 track density, diskette 9-22 track-to-track access time 9-22 translation table 1-34 translation, scan code 1-32 tri -state 1-26 type of display adapter switch 1-31 typematic keys 4-4 typematic rate 4-4, 4-7 u U.K. English keyboard 4-18 U.S. English keyboard 4-17 Index-18 v variable capacitor 1-31 vectors, special 5-6 VERR 6-22 video display buffers 9-10 virtual address mode 1-4, 2-5 w WAIT 6-20 wait condition 9-12 wait loop classes 9-13 workspace, default segment 5-9 write current, diskette 9-23 x XCHG 6-5 XLAT 6-5 XOR 6-11 z zero wait state 1-27 Index-19 Numerals OWS 1-27 80286 1-3, 1-4, 1-7 8042 1-31 82288 1-23 8237A-5 1-12 8254-2 1-8 8259A 1-10 Index-20 ---- ------ ---- --------_.- The Personal Computer Hardware Reference Library Reader's Comment Form Technical Reference 1502494 Your comments assist us in improving the usefulness of our publication; they are an important part of the input used for revisions. IBM may use and distribute any of the information you supply in any way it believes appropriate without incurring any obligation whatever. You may, of course, continue to use the information you supply. Please do not use this form for technical questions regarding the IBM Personal Computer or programs for the IBM Personal Computer, or for requests for additional publications; this only delays the response. Instead, direct your inquiries or request to your authorized IBM Personal Computer dealer. Comments: 111111 BUSINESS REPLY MAIL FIRST CLASS PERMIT NO. 321 BOCA RATON, FLORIDA 33432 POSTAGE WILL BE PAID BY ADDRESSEE IBM PERSONAL COMPUTER SALES & SERVICE P.O. BOX 1328-C BOCA RATON, FLORIDA 33432 9J911 PIO.:! NO POSTAGE NECESSARY IF MAILED INTHE UNITED STATES --------- -- - ------------_.- ® International Business Machines Corporation P.O. Box 1328-C Boca Raton, Florida 33432 1502494 Printed in the United States of America This package contains updated pages for the Technical Reference Option and Adapters manual. It also contains modules with information about specific IBM Personal Computer AT options. Replace your pages with the updated pages and add these modules in the following sections. Storage Devices • IBM Personal Computer AT High Capacity Diskette Drive • IBM Personal Computer AT Double Sided Diskette Drive • IBM Personal Computer AT 20MB Fixed Disk Drive Memory • IBM Personal Computer AT 128KB Memory Expansion Option • IBM Personal Computer AT 512KB Memory Expansion Option Adapters • IBM Personal Computer AT Serial/Parallel Adapter • IBM Personal Computer AT Fixed Disk and Diskette Adapter • IBM Personal Computer AT Prototype Adapter 6137872 Miscellaneous • IBM Personal Computer AT Prototype Adapter Cables and Connectors • IBM Personal Computer AT Communications Cable Contents Volume 1 • Expansion Unit - • Displays - • IBM Graphics Printer IBM Personal Computer Color Printer IBM PC Compact Printer Storage Devices • IBM Monochrome Display IBM Portable Personal Computer Display IBM Color Display Printers - • IBM Expansion Unit IBM 5 1/4" Diskette Drive IBM Slimline Diskette Drive IBM 10MB Fixed Disk Drive IBM Personal Computer AT High Capacity Diskette Drive IBM Personal Computer AT Double Sided Diskette Drive IBM Personal Computer AT 20MB Fixed Disk Drive Memory Expansion - IBM 64/256KB Memory Expansion Option and IBM 64KB Memory Module Kit IBM Personal Computer AT 128KB Memory Expansion Option IBM Personal Computer AT 512KB Memory Expansion Option vii Volume 2 • Adapters IBM Monochrome Display and Printer Adapter IBM Color/Graphics Monitor Adapter IBM Printer Adapter IBM 5 1/4" Diskette Drive Adapter IBM Fixed Disk Adapter IBM Personal Computer AT Fixed Disk and Diskette Adapter IBM Asynchronous Communications Adapter IBM Binary Synchronous Communications Adapter IBM Synchronous Data Link Control (SDLC) Communications Adapter IBM Personal Computer AT Serial/Parallel Adapter IBM Cluster Adapter IBM Game Control Adapter • Miscellaneous IBM Prototype Card IBM Personal Computer AT Prototype Adapter • Cables and Connectors IBM PC Compact Printer Connector Adapter IBM Communications Adapter Cable IBM Personal Computer AT Communications Cable viii System to Adapter Compatibility Chart The following chart identifies the adapters supported by each system. IBM Portable IBM Personal IBM Personal Personal IBM Personal Expansion Computer Computer XT Computer Computer AT Unit 64KB Memory Module Kit Yes Yes Yes No No 64/256KB Memory Expansion Option Yes Yes Yes No Yes 128KB Memory Expansion Option No No No Yes No 512KB Memory Expansion Option Monochrome Display and Printer Adapter No No No Yes No Yes Yes No Yes No Yes Yes Yes Yes No Yes Yes Yes No Yes 5 1/4" Diskette Drive Adapter Yes Yes Yes No No Fixed Disk Drive Adapter Fixed Disk and Diskette Adapter Asynchronous Communications Adapter Yes Yes No No Yes No No No Yes No Yes Yes Yes No Yes Serial/Parallel Adapter No No No Yes No Binary Synchronous Communications Adapter Yes Yes Yes Yes Yes Synchronous Data Link Control (S DLC) Adapter Cluster Adapter Yes Yes Yes Yes Yes Yes Yes Yes No Yes Game Control Adapter Yes Yes Yes Yes Yes Prototype Card Yes Yes Yes No Yes Prototype Adapter No No No Yes No Color/Graphics Monitor Adapter Printer Adapter System to Adapter Compatibility Chart ix Option to Adapter Compatibility Chart Because some adapters perform multiple functions, the following chart identifies the options supported by each adapter. 5 1/4" Diskette Drive Adapter Fixed Disk Drive Adapter Fixed Disk and Diskette Drive Adapter Color Graphics Monitor Adapter Monochrome Display and Printer Adapter Printer Adapter Asynchronous Communications Adapter Serial/Parallel Adapter Game Control Adapter x- Ad.pler Callpllible .iI~ Oplian Option to Adapter Compatibility Chart x ..... '""" . ... --,,, -.. ,.....-' --.....--...,-...... --"" -_._---_ ... ... ,..-_.,....,""- - _ ~ ""'."'.~-.'-"'-' ---~ -.- ..,.,." -- DOllble Sid,cd Diskette :Orive Contents Description .................................... Interfaces ..................................... Input Signals ............................... Output Signals ............................. Specifications .................................. Logic Diagrams ................................. 1 1 2 4 5 7 ill iv Description The Double Sided Diskette Drive is a direct-access device that can store 320/360Kb of data on a dual-sided 5-1/4 inch diskette. All data format and access control is in the system. The following figure describes the type of diskette required by this drive. Characteristic Requirement Certification Double sided 96TPI 80 tracks/ surface Soft sector 9,646 bits per inch 600 to 650 Oersteds Standard 5-1/4 inch Recording density Media coercivity Jacket Diskette Requirements The signals for operating the diskette drive are generated through the IBM Personal Computer AT Fixed Disk and Diskette Drive Adapter. Interfaces The diskette drive has two types of interface: control and dc power. The following figure shows the signals and pin assignments for the control interface. Double Sided Diskette Drive 1 Signal Name - Reduced write Reserved - Drive select 3 -Index - Drive select 0 - Drive select 1 - Drive select 2 -Motor on - Direction select -Step -Write data -Write gate -Track 00 -Write protect -Read data -Side 1 select -Diskette change I/O I - I 0 I I I I I I I I 0 0 0 I 0 Signal Pin 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 Ground Pin 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 Control Interface (P1/J1) Following are the signals and pin assignments for the dc power interface. Signal Name Pin +12 Vdc +12 Vdc return +5 Vdc return +5Vdc 1 2 3 4 Power Interface (P2/J2) All signals operate between following definitions: + 5 V dc and ground with the Inactive Level: +2.5 to +5.25 Vdc Active Level: 0.0 to +0.4 Vdc All outputs from the drive can sink 40 rnA at the active level. The system provides pull-up registers. Input Signals All input signals are active when low. 2 Double Sided Diskette Drive Drive Select 0 through 3 These 'drive select' signals enable or disable all other drive interface signals, except 'motor on'. When 'drive select' is at the active level, the drive is enabled. When it is at the inactive level, all controlled inputs are ignored, and all drive outputs are disabled. The enabled or disabled condition of the drive is established within 500 nanoseconds after a change to the select input, excluding head-load time and settling times. -Motor On An active level of this signal starts the drive motor. There must be a 750 millisecond delay after '-motor on' becomes active before any read or write operation starts. -Direction Select This signal determines the direction the read/write head moves when the step signal is pulsed. An active level indicates away from the center of the diskette (out); an inactive level indicates toward the center of the diskette (in). Any change in the , direction seleGt' signal must be made at least 1 microsecond before the leading edge of the step pulse, and at least 1 microsecond after the trailing edge of the step pulse. -Step This signal causes the read/write heads to move in the direction determined by the 'direction select' signal. Motion is started each time the signal changes from an active to inactive level (at the trailing edge of the pulse). -Write Data Each time this signal changes from the inactive to inactive level, the current through the read/write heads reverses, thereby writing Double Sided Diskette Drive 3 a data bit. This signal is enabled when 'write gate' is at the active level. -Write Gate A 250-nanosecond active pulse of this signal causes a bit to be written on the diskette. These pulses may occur with either a 4, 6, or 8-microsecond spacing (±O.5%). After deactivating 'write gate' , deactivation of 'drive select' and' motor on' , and changing 'side select' must be delayed 1 millisecond, because the erase head is active for this period. -Side 1 Select This signal determines which side of the two-sided diskette will be used for reading or writing. An inactive level of this signal selects the read/write head on the 0 side of the diskette; an active level selects the 1 side. A lOO-microsecond delay must be allowed after switching from one head to the other before starting to read or write. Output Signals -Index When the drive senses the index hole in the diskette, it generates a 1- to 8-microsecond active pulse on this line. -Track 00 An active level of this signal means that the read/write heads are at Track 0 (the outermost track). -Write Protect An active level of this signal means that a diskette without a write-protect notch is in the drive. The drive will not write when a protected diskette is loaded. 4 Double Sided Diskette Drive -Read Data A 2SD-nanosecond active pulse is provided on this line for each bit detected on the diskette. These pulses may occur with either 4, 6, or 8-microsecond spacing. Specifica tions The following figures show the physical, and performance specifications for this drive. Power dissipation Operating limits Non-operating limits Mechanical dimensions Weight 11 W(TYP) Ambient temperature 5 to 46 degrees Celsius (41 to 114.8 degrees Farenheit) Relative humidity 20 to 80 % Maximum wet bulb 29 degrees Celsius (84 degrees Farenheit) Ambient temperature -40 to 60 degrees Celcius (-40 to 140 degrees Farenheit) Humidity no condensation Width 146.0 mm (5.8 in) Height 41.0 mm (1.6 in) Depth 203.2 mm (8 in) 1.6 kg Physical Specifications Double Sided Diskette Drive 5 Capacity unformatted Capacity formatted 15 sectors per track Recording density Track density Cylinders Tracks Encoding method Rotational speed Transfer rate Latency (average) Access time Average Track to track Settling time Head load time Motor start time Performance Specifications 6 Double Sided Diskette Drive 1604Kb 1.2Mb 9646 bits per inch 96TPI 80 160 MFM 360 RPM 500K bits/second 83 ms 91 ms 3 ms 18 ms 50ms 750 milliseconds Logic Diagrams o ,... ....CI) CI) .c ~ CI) > .~ c CI) =::CI) ..lI:: til C "C CI) "0 en CI) :il j o C Double Sided Diskette Drive 7 QO I I o I l'C) I I ~ ~ ==-o l'C) ~ ~ l'C) o :I. -< l'C) I +12V T I I\ y- 01 02 -Kj- --Kt 51K 11 J UK I I VAl 30K I 12 ~ A3 I I I I lOOK A. .3K I n GND Ie. 6 16 5 A2 33K • RJ 4JK O.b~'/J O.OOI/JD.47/J ,.. 33" le2 M51721l 6 13 RIJ R18 l.li! r. • 2 un bLED 1~ I ~:-72.2" I 0 I I R.3 I 330~:! I I I R14 '"~ 330Sl lJon I , '( I 1 ( I I I I R1S 8 RI2 J30n I I I I I I I I 12K lc4 1 g~ 2.2" un 5 0 047 . "( r. I 9 ell e8 e6 -"--13 11 O.15.u A6 0.15/.1 e. I ~ ~ 141 I 12 I ~A?- • I C7 ~ 9 ~ C3 10.056/J R8 !i,IM M51720P • A10 ~JJOSI I AI I I I ~~9 101 ST(]P J ,1 I I ~ = ~ I HI -.J I I I I :=£ .___l_···_D_~ I n I I I Double Sided Diskette Drive (Sheet 2 of 2) I _. .,---,. -_._ .... ,--- P:orJll!lri/ (ooOm/iliter ""_. ff cirdu.'~cr·{" R (jereml ."'-... --__,_w,,_ ---- -_ '- ..,.,.,,, ... ......... rl , , ... - High Capacity I)iskette Drive Contents Description .................................... Interfaces ..................................... Input Signals ............................... Output Signals ............................. Power Sequencing ........................... Drive-in-Use Indicator ....................... Specifications .................................. Logic Diagrams ................................. 1 1 2 4 5 5 5 7 iii Notes: iv Description The IBM Personal Computer AT High Capacity Diskette Drive is a direct-access device that can store 1.2Mb of data on a dual-sided 5-1/4 inch diskette. All data format and access control is in the system. The following figure describes the type of high-density diskette required by this drive. Diskettes, which meet these specifications may not be used in either a 160/180Kb or a 320/360Kb diskette drive. Characteristic Requirement Certification Double sided 96 TPI 80 tracks / surface Soft sector 9,646 bits per inch 600 to 650 Oersteds Standard 5-1/4 inch Recording density Media coercivity Jacket Diskette Requirements The signals for operating the diskette drive are generated through the IBM Personal Computer AT Fixed Disk and Diskette Drive Adapter. Note: This drive also can read diskettes formatted for a 320/360Kb dual-sided drive or a 160/180Kb single-sided drive. Interfaces The diskette drive has two types of interface: control and dc power. The following show the signals and pin assignments for the control interface. High Capacity Diskette Drive 1 Signal Name I/O Signal Pin - Reduced write Reserved - Drive select 3 -Index - Drive select 0 - Drive select 1 -Drive select 2 -Motor on - Direction select -Step -Write data -Write gate - Track 00 -Write protect -Read data -Side 1 select - Diskette chanQe I 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 - I 0 I I I I I I I I 0 0 0 I 0 Ground Pin 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 Control Interface (P1/J1) The signals and pin assignments for the dc power interface are as follows: Signal Name +12 Vdc +12 Vdc return +5 Vdc return +5Vdc Pin 1 2 3 4 DC Power Interface (P2/J2) All signals operate between following definitions: + 5 V dc and ground with the Inactive Level: +2.5 to +5.25 Vdc Active Level: 0.0 to +0.4 Vdc All outputs from the drive can sink 40 rnA at the active level. The system provides pull-up registers. Input Signals Following are descriptions of the input signals. 2 High Capacity Diskette Drive -Reduced Write The inactive state of this signal indicates that high-density media is present requiring normal write currents, and the active state indicates low-density media is present, requiring a reduced write current. - Drive Select 0, 1, 2, and 3 The Drive Select signals enable or disable all other drive interface signals, except 'motor on'. When 'drive select' is at the active level, the drive is enabled. When it is at the inactive level, all controlled inputs are ignored, and all drive outputs are disabled. The enabled or disabled condition of the drive is established within 500 nanoseconds after a change to the select input, excluding head-load time and settling time. -Motor On The spindle motor runs when this input is active. The drive requires a 1 second delay after '-motor on' becomes active before a read or write operation. - Direction Select If this input is at a inactive level the 'step' input signal moves the heads away from the drive spindle. An active level causes the opposite. This input is stable for a minimum of 1 microsecond before and after the trailing edge of the step pUlse. -Step A 1-microsecond active pulse on this input causes the read/write heads to move one track. The state of '-Direction Select' at the trailing edge of the Step pulse determines the direction of motion. High Capacity Diskette Drive 3 -Write Data A ISO-nanosecond pulse on this input causes a bit to be written on the disk if Write Gate is active. These pulses may occur with either a 2,3,3.3,4,5, or 6.67-microsecond spacing ±O.S %. When Write Gate is inactive, pulses do not appear on this input. -Write Gate An active level of this input enables the write current circuits, and the Write Data input controls the writing of information. Transitions of this line occur 4 to 8 microseconds before the first significant data bit, and 4 to 8 microseconds after the last significant data bit. Making this input inactive removes all current from the read/write heads and allows the read circuits to operate within 590 microseconds All motor-start, head-settle, and head-load times are complied with before the line becomes active. -Side 1 Select Making this input active selects the upper head; otherwise the lower head is selected. Output Signals Following are descriptions of the output signals. -Index When a diskette's index hole aligns with the hole in the diskette jacket, a 1- to 8-microsecond active pulse is generated on this line. -Track 00 This signal is active when the upper head is on Track 00. 4 Hi~h Canadtv Di"kpttp OrivP -Write Protect This output is active when a diskette without a write-protect notch is inserted. It prevents the erasing or writing of data. -Read Data Each bit detected provides a 150-nanosecond active pulse on this line. These pulses may occur with either a 2, 3, 3.33, 4, 5, or 6.67-microsecond spacing ±0.5%. - Diskette Change This output is active unless a diskette is present and a step pulse is received when the drive is selected. Power Sequencing The I write gate I signal is turned off and is kept off before power is switched on or off. The read/write heads return to Track 00 when the system power is switched on. Drive-in-Use Indicator The Drive-in-Use indicator lights when the drive is selected. Specifications The following figures show the performance, physical, and performance specifications for this drive. High Capacity Diskette Drive 5 Power dissipation Operating limits Non-operating limits Mechanical dimensions Weight 11 W (TYP) Ambient temperature 5 to 46 degrees Celsius (41 to 114.8 degrees Farenheit) Relative humidity 20 to 80 % Maximum wet bulb 29 degrees Celsius (84 degrees Farenheit) Ambient temperature -40 to 60 degrees Celcius (-40 to 140 degrees Farenheit) Humidity no condensation Width 146.0 mm (5.8 in) Height 41.0 mm (1.6 in) Depth 203.2 mm (8 in) 1.6 kg Physical Specifications Capacity unformatted Capacity formatted 15 sectors per track Recording density Track density Cylinders Tracks Encoding method Rotational speed Transfer rate Latency (average) Access time Average Track to track Settling time Head load time Motor start time Performance Specifications 6 High Capacity Diskette Drive 1604Kb 1.2Mb 9646 bits per inch 96TPI 80 160 MFM 360 RPM 500K bits/second 83 ms 91 ms 3 ms 18 ms 50 ms 750 milliseconds Logic Diagrams HUDD Of" HElD 1 Of" DRIVE SHECT MOTIIA OH~'J!!:l"l!16,-j,.~~---Ln===-=====t====~ snPI'Jl.20 TRACKOO SENSOR MEDIA SENSOR INDEX SENSOR -+_________---, +l2¥ RET \'"J""""-'_ _ _ High Capacity Diskette Drive (Sheet 1 of 2) High Capacity Diskette Drive 7 +" ... STEPPINS J30AZ MIIT1IR u--~~~+-~-------, II co DO H--------~--t_ri_t_+------+_~ ,, ,, . .13.15~ IIBIVIE • MOTOR +-----'='--=",ob High Capacity Diskette Drive (Sheet 2 of 2) 8 High Capacity Diskette Drive ......,-_. ....... --,_.- - ----._.- " ,......" -""""._",-",-, -. -........ ,--, _.. l.,lh" r',; C:()mmunicati()ns (,:able Contents Description .................................... 1 Specifications .................................. 2 iii iv Description The IBM Personal Computer AT Communications Cable cable is for connection of an IBM communications adapter with a 9-pin D-shell connector to a modern or other RS-232C DCE (data communications equipment). It is fully shielded and provides a high quality, low noise channel for interface between the communications adapter and DCE. Communications Cable 1 Specifica tions One connector is a 9-pin D-shell connector and the other is a 25-pin D-shell connector. The pin numbering and connector specifications follow. 14 co co co co COco 6 Modem Connector Or Other RS-232 Data Communications Equipment ~~~ ~ COco COco <:0(2) co 13 Communications Adapter Connector t:- 25 25-Pin D-Shell Connector 9-Pin D-Shell Connector - ;-- - DCE 25-Pin CunneclDr 9 5 8 Carrier Detect 1.. 3 Received Data 2 2 Transmitted Data 3- 20 Data Terminal Ready 4 Signal Ground 5 Data Set Ready 6_ Request To Send 7- 5 Clear To Send 8. 22 Ring Indicator 9 .. 6 _4 NOTE: ALL OTHER PINS ON THE 25-PIN CONNECTOR ARE NOT USED. CONNECTOR SPECIFICATIONS 2 Communications Cable ADAPTER 9- Pin CD nneclar - - 128KB Memory Expansion ()ption ,':, "~j', i ," \' "" ~ 1 Contents Description .................................... Memory Cycles ............................. 110 Channel Check ......................... Addressing ................................ Specifications .................................. Voltage Tolerances .......................... Power Dissipation ........................... Temperature Variation ....................... Logic Diagrams ................................. 1 1 1 1 1 1 2 2 3 iii Notes: iv Description This adapter has 18 RAM modules (64K x 1) for a total capacity of 128Kb. Memory Cycles MEMR and MEMW commands require a l-wait-state, 3-clock memory cycle. Data moves as a byte (8 data bits and 1 parity bit) or as a word (16 data bits and 2 parity bits) and is parity-checked on the adapter. A parity error causes an I/O channel check (non-maskable interrupt) to the system. I/O Channel Check When the I/O channel check occurs, a non-mask able interrupt (NMI) results, and the status bits determine the source (one status bit is I/O channel check, and the other is system board parity check). Writing to the failing card will clear the status bit. Addressing This adapter responds to addresses from hex 080000 to hex 09FFFF. Specific a tions Voltage Tolerances The maximum variation of the + 5 V dc is pins. ±5 % at the adapter 128KB Memory Expansion Option 1 Power Dissipation The +5-Vdc power used by the adapter is a maximum of 5.25 watts, and the maximum current used is 1 ampere. Temperature Variation The adapter will operate between 10 and 50 degrees Celsius (50 and 122 degrees Farenheit). 2 128KB Memory Expansion Option ~ lS682 o (JQ '3 01 COMPARATOR IS Q2 1 '" 16 01; IN~~~~~~ ~ '" p;Q~ + LAn (SHT 7) + LAZ2 17 P2 (SHT7) +LA21 (SHT 7) + LAZO 4 " 1<; PI; (SHT 7) + LA 1';1 .-~~~--~pc; (SHT 7) -flREFRESI < 1 +LA!6 , (SHT 7) + lAI7 II PB = TRANSPARENT D LATCH 2 P7 QI 2 01 ~ lq + RAS (SO (SHT 2) a lJ1 U 14 AlSOI; . __ 2 D':i Q<; Db Qb IE> + (AS CSO (SHT 2) + ($ (SHT 3.4) ALS:!4 +"iV 8c o--.~~_._-----.l ~oc .:! ~ E~AalE t'!!'l ~ "CI ( r!L--- I ~ = C = 0 ~. .. .... "CI ALS'32 (SHT 6) + BALE ~~~-- .. C = ~ ..... ~ ~~__.___J ~ ("> _. ~ (JQ FOO .~' ._-- ~ ALS<;7l ~ ... QC) (SHT7) 1'3 PO (SHT7) N -MEM C.SI6 2 "' 12 as (SHT 7) ~ , LSI2"i DRIVER +c;~ab 2 PI -. U02 Q"i 1 28 KB Memory Expansion Option (Sheet 1 of 8) "" ..... N OCI ~ , (SHT 7) -MEMR 8 J 1 9;:)U"/ (SHT 7) -MEMIrv' IN I ~ = 3: PE212" UI8 40 80 4 121 a 8 ~ t UI7 11 ~ 9 (SHT 1) +CA5 (SO (SHT 5) J 12 5 ; FlO JUl. \...J, II 10n 6 - RAS RNZ a (SHT 5) FOB ~ "=' ~ = fi!l. 0= zoo 6 AODR SEL 0 ~ 160 +CAS ~ ~ J TIME DELAY 6 (SHT 11 +RAS CSO 0 "=' e. I, FlO 0 = ALS04 (SHT 71 +BAO 5 UIO • (SHT 71 - SBHE 12 9 10Q 8 RNZ I, FlO ALS04 8 9 IJ UI • U ~U1B ../ 12 14 '3on '3 -CAS OL (SHT 51 -CAS OH (SHT 5) + SBHE (SHT 4) -BAD (SHT 4) RN2 UIO 128 KB Memory Expansion Option (Sheet 2 of 8) CD .... 0 .. CO) 8 ~ ~ Q) Q) 0 .r:: !!!. c: 0 :;::: Q, 0 c: 0 "; c: ~ l!' ~ ~ ~~ .., :.i <;t ~ ; !Ii ~ Si ~ I~ I., IV Q, >< w ~ 0 .~~~ E ~ Q) ~ &D ~ 3 ~ CO N ,.. ~ " I " ~ ~ I 00 "~ ~ + iO I l' "" 00 128KB Memory Expansion Option 5 ~ a < I I :: ~ ". ; o. ~ ~ • " • , - ~ ~ 0 ~,~ I~ I~ < . ~I· . < c o :;:: Q. o C o "; c as Q. >C W ~ o E CD :& ~ ~~ i !!: ~!2 ~ !!: ID ~ co ('II ... ~ H~§ t.: ii;" m ;;;;;; ~ ~~~~ 6 128KB Memory Expansion Option I ~UCS -BMEM (SHT3) -(S IN I (SHT 5) "' I 10 I ~~~ I, 12 U2 II 1 (SHT 2) +SBtE (S"T 7) + M:lP ~ (SHT 7)-Bt£MR (SHT 1) " " , EVEN 2 H (SHT 3) + MOl'; (SHT 3) , ""'ITYCHECK (SHT 3) + MQ9 (SHT3) + MOil (SHT 5) F260 8 A (SHT 3) IN 0 I I~ FOB (SHT 3) + MOB + MDf' G ,;iu,,~ (SHT 5)+ MOP OUT I S U7 , ~ 'I, U4 " I, UI'! 10 '! Ulq 82 VI'! , ,,_ ~ F7'; 10 - }U2 U2 J B 120 I'fl II Q 9 (L~(lLR ~ .;, LSSl U2 U2 b (SHT 8) +RESET 1 28 KB Memory Expansion Option (Sheet 5 of 8) ~LSIZ') -I/O (1-1 CK (SHT 8) co .... o .. CD II) II) ~ - ~ ----~-----~ c: o i o c: o III c: 1l. ca Q. >< W ~ o E II) ::E m ~ co ... ('II 8 128KB Memory Expansion Option CARD TABS ADI (SHT 4) -110 CH CK AD9 +500 (SHT3) AD8 +501 (SHT3) AD7 'SOZ (SHT3) AD6 +503 (SHT3) ,.,. +504 (SHT3) +SD'> (SHT3) +50& ISHT3) AD., AD, ADZ A,J A,O AZ' AZ8 AZ7 AZb ~ f 8 o "CI (SHTS) ISHTS) (SHTS) (SHTS) +SM (SHTS) +SAIO (SHTS) +SAII (SHTS) + SAIZ (SHT S) + SAl, (SHTS) +SAI't (SHTS) Alb + SAl") (SHT5) AI'> +SAlb (SHTS) AI" + SAI7 A" + SAI8 AZI AZO AI. AI8 AI1 9" 9Z8 819 80Z ~ 8 IC +SA1 + SA. +SAB AZZ f! ISHTS) (SHTS) i: 810 (SHTS) +SAZ +SA7 AZ, 92. ~ +SAI (SHT S) AZ. .., (SHT7) + SA'> QC f (SHT3) + SAO +SA6 AZ'> N +507 128 KB Memory Expansion Option (Sheet 7 of 8) + BALE (SHT 1) -REFRESH (SHT?) +RESET DRV (SHT 4) U':I..,. = co:. C".I ~ C

  • < - :~ Jl!HJ W - - u;> ;:; z : ;z: ~ JJJlt JJ 10 128KB Memory Expansion Option ~ o E CD :!: In ::.::: co ... N PfrJO!hi! (,'umputer J-i ardware R eji:rence Llhr(lrv Prototype Adapter Contents Description .................................... 1 Adapter Design ............................. 3 IBM Personal Computer AT Prototype Adapter Layout .................................. 7 Interfaces .................................... 13 Logic Diagrams ................................ 14 iii iv Description The IBM Personal Computer AT Prototype Adapter is 121.9 millimeters (4.8 inches) high by 333.25 millimeters (13.12 inches) long and plugs into any system-unit expansion slot except number 1 or 7. Two card-edge tabs, one 2-by 31- position and one 2-by 18-position, provide all system control signals and voltages. The adapter has a voltage bus (+5 Vdc) and a ground bus (0 Vdc). Each bus borders the adapter, with the ground bus on the component side and the voltage bus on the pin side. A system interface is also provided on the adapter with a jumper to specify whether the device has an 8- or a 16-bit data hus. This adapter also accommodates a D-shell connector from 9 to 37 positions. Note: All components must be installed on the component side of the adapter. The total width of the adapter, including components, may not exceed 12.7 millimeters (0.5 inch). If these specifications are not met, components on the IBM Personal Computer AT Prototype Adapter may touch other adapters plugged into adjacent expansion slots. The following is a block diagram of the IBM Personal Computer AT Prototype Adapter. Prototype Adapter 1 N ~ o S :g Bit 0-7 Oata Bus 2 I/O Read/Write --+- ~ !., ..... ~ >1 Data Bus Spare ----i Address Bit 0 ~ Address Bit 2 ..f...---- Bullered Data Bus Bits 0-7 I 8 Buffered Data Bus Bits 8-15 Bus Direction ' B u s Transceiver Command and Address Buffer Address Bit 0 L '_ _ _ _ --tl- Address Bit 3 Address Bit 9 -I--- 8 / Address Buffer I/O Address Decode Logic 6 r7 H Data Bus L------,HH Enable Logic I/O Decode (Hex 300-31F Inclusive) Low Bus Enable High Bus Enable Address Enable - - Spare-Memory Read/Write ~ Buller Bus Direction System High Byte Enable Bit 8-15 Data Bus +s ~ t Jumper JI ~ lOKn +8 Bit/-16 Bit Data Bus Prototype Adapter Block Diagram Bus Transceiver :~ Data Bus / Adapter Design The following information is provided to assist in designing an adapter using the IBM Personal Computer AT Prototype Adapter. Designing an Input/Output Adapter The following information may be used to design an input/output type of adapter. Programming Insert a Jump instruction after all I/O read (lOR) or I/O write (lOW) assembler language instructions to avoid a potential timing problem caused by slow I/O devices. The following figure shows a typical programming sequence. Before After Your code lOR Your code NEXT: Your code lOR JMP NEXT Your code Program Sequence Jumper Wire (Jl) Your design can use either 8 bits of the data bus (jumper off) or the full 16 bits of the data bus (jumper on). Most devices have 8-bit data buses. Wait-State Generator Circuits If your device runs too slow, you must add a wait-state generator to make the I/O read and write signals longer. First, determine the time needed by your device from the start of an lOR signal until it can put data on the system's data bus. Next, compare that Prototype Adapter 3 time with the time given by the system's microprocessor. The system microprocessor gives 750 nanoseconds for 8-bit devices and 250 nanoseconds for 16-bit devices. A similar problem may exist for an lOW signal. Determine the write data setup time, which is the time required by your design from the time it is given valid data until it is told to take this data by the lOW signal. The time given by the system microprocessor from when data is first valid to the device until the lOW signal goes active and then inactive is shown in the following figure. Your design can take the data when lOW goes active (less setup time) or when lOW goes inactive (more setup time). I I 8-Bit Device 16-Bit Device 100 ns 850 ns 100 ns 350 ns Data valid until lOW is active. Data valid until lOW is inactive. lOW Timing If the time given by the system microprocessor is not enough, you must add a wait-state generator circuit that will provide longer lOR and lOW signals. A recommended wait-state generator circuit is shown in the following figure. Note: Pulse Engineering Inc. PE21214 is the delay module used. 4 Prototype Adapter Time Delay (Iote) PE21214 + 1/0 Cycle (Sheet 2 01 11) I~ 1 I 4 i;' u Time Delay (Note) PE21214 6 B I ...... = en en ~ ... c::> = z :i /I) f. ...... c::> 4 3 : ~ = ~ ;i\ Jumper S 14 S14 '----"-3---11' ClK Q5 '--_ _ _ _ _ _ _ _ _ _---=.1=0 Reset 4 Set +5V " 2 0 /I) til B en z z c::> c::> 6 u u = 10 ...... ...... u 2 S" rt.. ..L 10 en z Time Delay (Note) PE21214 Wait-State Generator Circuit 15 14ALS244 UB 5 + 1/0 Channel Ready Tab Pin AID (Sheet 4 01 11) Note: To add wait states and increase the time given by the microprocessor for I/O Read and Write commands, install one of the following jumpers. • • 16-Bit Design 1 wait state 250 nanoseconds--No jumper 2 wait states 416 nanoseconds--Jumper 1 to 5 3 wait states 583 nanoseconds--Jumper 2 to 5 4 wait states 750 nanoseconds--Jumper 3 to 5 5 wait states 916 nanoseconds--Jumper 4 to 5 8-Bit Design 4 wait states 750 nanoseconds--No Jumper 5 wait states 916 nanoseconds--Jumper 4 to 5 Designing a Memory Adapter The following information may be used to design a memory adapter. Control Lines There are two sets of memory control lines. SMEMR for system-memory read, and SMEMW for system-memory write. They are active when accessing memory in the first megabyte (address bits 20 through 23 are all off). If you use these lines, you can avoid an address decode circuit that checks for address bits 20 through 23 being off. The other set of control lines is MEMR and MEMW. These are active when addressing all memory locations. If you wish to design memory that will answer to addresses above the first 6 Prototype Adapter megabyte, you must use these lines and decode address bits 20 through 23 to select the particular address range your memory occupies. System Address Lines (SA) The 20 lowest-order address lines are SAO through SA19. SA address bits are active a minimum of 30 nanoseconds before a control line goes active, and they stay active until a minimum of 66 nanoseconds after the control line goes inactive. Timings are at the adapter socket. Local Address Lines (LA) There are seven high-order address lines called LA17 through LA23. LA address bits are active a minimum of 159 nanoseconds before a control line goes active, and they stay active until typically 83 nanoseconds before the control line goes inactive. LA bits should be decoded to select the particular address range your memory occupies. Because this decode will go inactive 83 nanoseconds before the control line goes inactive, it may be necessary to latch the decode. The output of this decoder circuit should be connected to the input of a transparent latch, such as a 74ALS573 (+BALE should be connected to the clock pin on the latch). If this is done, the output of the 74LS573 will be active approximately 30 nanoseconds before a control line goes active, and will stay active until approximately 66 nanoseconds after the control line goes inactive. Timings are at the adapter socket. IBM Personal Computer AT Prototype Adapter Layout The IBM Personal Computer AT Prototype Adapter has two layers screened onto it: one on the front and one on the back. It also has 4,311 plated through-holes that are 10.1 millimeters (0.04 inch) wide and have a 1.52-millimeter (0.06-inch) pad. These holes are arranged in a 2.54-millimeter (0. I-inch) grid. There are 37 plated through-holes, 1.22 millimeters (0.048 inch) wide, on the rear of the adapter that are used for a 9- to 37-position D-shell connector. The adapter also has 5 holes that Prototype Adapter 7 are 3.18 millimeters (0.125 inch) wide. One of these is just above the two rows of D-shell connector holes, and each of the other four is in a corner of the adapter. 8 Prototype Adapter Component Side The component side of the adapter has a ground bus, 1.27 millimeters (0.05 inch) wide screened onto it and two card-edge tabs labeled Al through A3l and C 1 through C31. The following figure shows the ground bus and card edge-tabs. Prototype Adapter 9 The component side of the adapter also has a silk screen printed on it that may be used as a component guide for the I/O interface. The following figure shows this silk screen. :; N ::0 M ::0 c:=Jc::=::3 ~ ::0 08 sl ::0 '" Du s02i ::0 00 S D~ 10 Prototype Adapter Pin Side The pin side of the adapter has a 5-Vdc bus, 1.27 millimeters (0.05 inch) wide, screened onto it, and two card-edge tabs: labeled Bl through B3l and Dl through Dl8. The following figure shows the 5-Vdc bus and card edge-tabs. I') I o Prototype Adapter 11 Card-Edge Tabs Each card-edge tab is connected to a plated through-hole by a 0.3-millimeter (0.012-inch) land. Four ground tabs are connected to the ground bus by four 0.3-millimeter (0.012-inch) lands, and three 5 Vdc tabs are connected to the 5-Vdc bus by three O.3-millimeter (0.012 inch) lands. Additional Information Additional information regarding the I/O interface may be found under "I/O Channel" in Section 1 of IBM Personal Computer AT Technical Reference manual. Logic diagrams of the IBM Personal Computer AT Prototype Adapter may be found later in this section. If the recommended interface logic is to be used, the following figure shows the recommended components and their TTL numbers. Component U1 U2 U3, U9 U4 U5 U6, U7, U8 C1, C6 C2, C3, C4, C5, C7,C8 R1 TTL # 74500 74510 74L5245 745139 745138 74AL5244 J1 Description Quad 2 input NAND Triple 3 input NAND Octal bus transceiver Dual 1 of 4 decoder 1 of 8 decoder Octal buffers 1O-microfarad tantalum capacitor 0.047-microfarad ceramic capacitor 10 Kohm, .25-watt, 10% resistor (axial leads) Jumper wire Recommended Components Note: 11, U8, and U9 are not required for a design using only the low-order 8 bits of the data bus. Designs using all 16 bits of the data bus require these components. 12 Prototype Adapter Interfaces Internal Interface Because of the number of adapters that may be installed in the system, II 0 bus loading should be limited to 1 Schottky TTL load. If the recommended interface logic is used, this requirement is met. Power limitations may be found under "Power Supply" in the IBM Personal Computer AT Technical Reference Manual. External Interface The following figure lists the recommended connectors for the rear of the adapter. Connector Part no. (Amp) or equivalent 9-pin D-shell (male) 9-pin D-shell (female) 15-pin D-shell (male) 15-pin D-shell (female) 25-pin D-shell (male) 25-pin D-shell (female) 37-pin D-shell (male) 37-pin D-shell (female) 205865-1 205866-1 205867-1 205868-1 205857-1 205858-1 205859-1 205860-1 Recommended Connectors Prototype Adapter 13 .... .&:0. ~ ~ 74LS24, (SHT (SHT (SHT (SHT (SHT 3) 31 3) 3) 3) (SHT 3) (SHT 3) (SHT 3) ,.,.""mo~. ., A (A7) +OATA BIT 2 '+ A (AS) + DATA BIT ! (Ab) + DATA BIT., (A'5) + DATA BIT '+ B 16 B 17 B A U, 6 A C; (A4) + DATA sn '} (Al) + DATA BITt. (AZ) + DATA BIT 7 1 A 8 A 9 A " 14 ,~ ~ I/O DECODE FOR PROTOTYPE: CARD A7AbA 4 A, A Al 1 100000000 A~A I. 1 (H[XnOQ (HEX)'3IF BUFFERED DATA BUS BITS 0-7 - 12 I I o (J'O 0 0 -. -.o DrCOOE" RANGE. n " ~ > - ! ~ "'I I' ~b 71+500 7'tAlS244 ~~ ~~ ~~~ ~~~ (BI1) -lOW (BIZ) -SMEMR (BII) -SMEHW (BI4) -IOO (SPARE) ~~~~~~~~l'il (SHT 3) (A28) +AOOR. BIT '3 ) ~ (SHT 3) (A2'5) ADOR. BIT (A24)+ADDR.BIT7 II i~~i~: ~:~~;:=:~~: :~ ~~~i ~l ~~~; +::gg:-.~i ~to ~ >------- (SHT3) (AII)+A[N :-BJOR (SHT 21 (SHT 2) ~=====~' ~ft---==::j=='--~ti AIA~",I~ rb A2 ., II ENl '5 EW2 L 4Elfi b '" 20 +'5V6 '(1+ .., ~ L _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _--» + 8 BIT 1/0 JEVICE (SHT 2) 245"8 j 1 ~ (J'O :3 7JJ. 4 8 ) (A,I) +ADOR. BIT 0 ) (A,O) + ADOR. BIT I ) (A29) + ADDR. BIT 2 ) (SHT3) + 1/0 CYCLE 11 ~~ ~~ (SHT3) ~ ENABLE LOW Bm NOTES: I IF THE liD DE.VICE REQUIRES A 16 BIT WIDE DATA BUS, THEN INSTAU_ JUMPER JI. fOR 8 BIT WIDE I/O DEVICES NO JUHPERING IS REQUIRED. Prototype Adapter (Sheet 1 of 4) l -110 DECOOE (SHT 21 "00 HE1<-l1F ---.DATA BIT II +DATA BIT 12 +DATA BIT" • DATA BIT 14 +DATA BIT 10; ) (SHT 1) -BIOR 7r-8 6 S AU9 A A A A ~ A ~ ~ 11 B'j2 B~ 8 B~ B J..f.---.-- B~ ~'i8 f BUFFERED OAT A BUS BITS B-[I) [~ ~IR 2D +sv t; f-iID (8..". - ENABLE HIGH BYTE (SHT 1) + liD CYCLE " 74SI,Q Y£YICE?fAo (SHT 1) • B BIT I/O DEVICE ) • B BIT ~AI U4 74ALS244 ISHT 4) [SHE. 0;) (SHT 4) - SSHE (e9) SPARE (C[O) - MEMW SPARE (e I) U8 1,.J EN 1'4 18 12 IIG" ~ Q f f ... ....VI -+_________ L___________________ (SHT 1) 74ALS244 ---"+£8_B'>!IClT-'D; ~ (SHT 1) AI A2 A3 A4 A<; + ADDRESS + ADDRESS +ADDRESS + ADDRESS + ADDRESS AI8 BIT BIT BrT BIT BIT 14 13 IZ II 10 + ADDRE SS BIT + ADDRESS BIT q +ADDRESS BIT + ADDRESS BIT 120 127 A20 1027 928 1028 + ADDRESS BIT + A~DRESS BIT + ADDRESS Bn +<;V DC IZ9 iAZ9 + ADDRESS BIT OSC GROUND _I~,-- P[N SIDE (SHT 1) (SHT 1) + ADDRESS BIT 17 + ADDRESS BIT 10 + ADDRESS BrT l'i -DACK Z +T/( +BAlE no (SHT 1) A~O ~_'_- + ADDRESS BIT + ADDRESS BIT COHPONENT SlOE Prototype Adapter (Sheet 3 of 4) (SHT1) B 0 <; 4 3 I 0 (SHT 1) ,6 PIN TAB- CONNECTOR - (SHT 2) i DI D2 D, D4 DI) D6 D7 DB D9 DID DII DI2 DI"3 014 OIl) 16 017 OIB -MEM CsI6 -1/0 CsI6 +IRQ 10 + IRQ II + IRQ 12 + IRQ 1"3 + IRQ 14 -DACK 4 +DRQ 4 -DACK I) +DRQ I) -DACK 6 +DRQ 6 -DACK 7 +DRQ 7 +1) VDC -MASTER GND E PIN SIDE CI C2 + + + + + + + + + + + + + + + ("3 C4 CI) C6 C7 CB C9 cia CII CI2 CI"3 CI4 (II) , Clf> CI7 CI8 COMPONENT SIDE t i .. ~ ....... Prototype Adapter (Sheet 4 of 4) sBHE LA ADDRESS LA ADDRESS LA ADDRESS LA ADDRESS LA ADDRESS LA ADDRESS LA ADDRESS MEMR MEMW DATA HIT 8 DATA BIT 9 DATA BIT 10 DATA BIT II DATA BIT 12 DATA BIT 1"3 DATA BIT 14 DATA BIT II) BIT BIT BIT BIT BIT BIT BIT 2, (SHT2) 22 21 20 19 18 17 (SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT 2) 18 Prototype Adapter ---- ----------------- Pcmmai C'omputer Hardware R ejerence Librarv 512KB Memory Expansion Option Contents Description .................................... Memory Cycles ............................. Memory Address Switches .................... 1/ 0 Channel Check ......................... Specifications .................................. Voltage Tolerances .......................... Power Dissipation ........................... Temperature Variation ....................... Logic Diagrams ................................. 1 1 1 3 3 3 3 3 4 iii iv Description This adapter has 36 RAM modules (128K x 1) for a total capacity of 512Kb. Memory Cycles MEMR and MEMW commands require a 1-wait-state, 3-clock memory cycle. Data moves as a byte (8 data bits and 1 parity bit) or as a word (16 data bits and 2 parity bits) and is parity-checked on the adapter. A parity error causes an I/O channel check (non-maskable interrupt) to the system. Memory Address Switches There are two banks of memory address switches on each memory adapter. These switches are set to values for the first, second, third, etc. memory adapter in the system. The following figure shows the switch configuration for each adapter. The first memory expansion adapter must start at address space hex 100000. If more than one adapter is installed, no gaps between memory are allowed. All expansion memory must be one contiguous block starting at address hex 100000. 512KB Memory Expansion Option 1 Switch Bank 0 4th 512KB Memory Expansion Adapter 5th 512KB Memory Expansion Adapter Switch Bank 1 12345678 1 234 5 6 7 8 12345678 12345678 ~~~~~~~~~~ ~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~ 2 512KB Memory Expansion Option 110 Channel Check When the I/O channel check occurs, a non-maskable interrupt (NMI) results, and the status bits determine the source (one status bit is I/O channel check and the other is system-board parity check). Writing to the failing card will clear the status bit. Specifications Voltage Tolerances The maximum variation of the +5 Vdc is ±5% at the adapter pins. Power Dissipation The +5-Vdc power used by the adapter is a maximum of 5.25 watts, and the maximum current used is 1 ampere. Temperature Variation The adapter will operate between 10 and 50 degrees Celsius (50 and 122 degrees Farenheit). 512KB Memory Expansion Option 3 Notes: 4 512KB Memory Expansion Option rQ {SHT7 SWI , r lu> 7:~: SWii! 5Wl" 1 sw'+ Ii':! ~ ISHT? OJ2 NOT@ LSb8Z QICOHPARATOR S2" I., UIC eso 10'+ Db LJ-+++---------t-Il1 P, ~~ ~ ENABLE C 1':1: L _ _ _ _ _ _ _ _..... P7 ~P. o § \IQ ""1 2 QS Ll-l~--I-__l_--------_l--,,''11'1 § "C:I Q; +RAS 111.:;.._ _ _ _ _ _ __ alr- to ... I~ Q2\-l117~------- If 02 ,......tJ.!..0 r- QI 1 i j - S~~~. I2'i L~UI;)II '5 Ul ~LSOLt ., L-~~-+~4_--------_+~1 :~ f. ~ G --4:F1Z 9 Z IR QI I" sw" 1.1 I 'All 'O"'A •• TO' !III;; SWII I~!O I"''''' S"O~~ ,~ ~ 1;---t-- ~~ ,::,\!bL-__<401 ~'~ -----.iJUIfr(SHT81 51 2 KB Memory Expansion Option (Sheet 1 of 8) ~ ~ TRAONS~flHNT 2: FlO -RH' ~,J: . - HEM CSlb (SHT 7) AL.So;H ~ P8 SI(NOTEl) ""'" t P, '5 N 2 uL P7' RIC~Kn .-+------' UI 11"b>~1i..VE=-'----1r---------------------- p-:Q~ :Q7 I' Q8 SW7./ [SHT7) ~ U6Z QIf _. _. \IQ 02 +CS (SHT 3,4) ~ :3 rIJ, " ~ "~ ~ " " ~ ~ a ~ ~ '" " "- ~ w ~ iD iD ~ ~ " • < W ~ o E CD B :t llF-~-t--~ IX! ~3,!~ :.::: N ,.. an o fl 5 , •" •" ;0 ;0 ;0 ~ " ~ ~ ~ " '< " ;0 ~ " 6 SI2KB Memory Expansion Option '< " ~ ~ " I W -.. OJ o C') CII CII ~ ~ .. I: .2 Q. o I: o IIJ 1I' ~ ~ ~ ~~ « ~~ 00 : ;r; ~ ~ ~ I~ I: It! Q. ,'" >< W ~ o E CII :::?i III ~ C'oI ,... It) "~ " " " " '" " I W I I I W 00 ;0 I W I W """""" " I I W I W I W I W I W I W " I W I W 512KB Memory Expansion Option 7 -co... o v CD CD .s::. ~ c ~~ ~ ~' ~ ~~-----t~_-t __ 3- ...o Q. o g. C o III c m Q. )( UJ ~ o E CD :::E a:J ~ ~:; C"I .,... . 3 - - 10 I " I ~ " " " "c "c ~" " " " r r r I ~ I ~ r " " " "" " i'i M I " r I ~ r ~ I ~ I ~ I " 8 512KB Memory Expansion Option r N r ~ " " N r I " "" r " I W " r " I~ : ~ ; :: : :1 ~1~:;:::::li g ~ ~ s a ~ ~; ~ " g § 75· ~ _~~---'--, < " 0" ~-~-----L.-, 000 It) ..... Q) Q) < .r:: !e I: 0 :0:: Q. 0 I: 0 III I: IV Q. >< ~-------~ ,--- ~nn L -_ _ _ _ _ _~~ nn F I I I W ~ 0 E Q) ~ ca ~ ... N It) 512KB Memory Expansion Option 9 o VI N ~ f~ g ~ g" o -=....S" = (5tH 3) +1'100 ISHT 3) +1'101 ISHT 3) +1102 " (SHT3) +1'10'3 ISHT 3) +1'104 ISHT 3) +1'10'5 (SHT 3) +1'106 ISHT3) +M07 U'; (SHT 3) +1'108 U," (SHT 3) +HDQ (SHT 3) +11010 l~lLLL~ (SHT 3) +1'1011 (SHT 3) +,",01 Z (SHT31+MOI~ (5HT3)+11014 (SHT 31 +HDI'> (SHT 5)-8HAO (SHT 5) -8HA I (SHT 5) -BHA2 ('I) IZ8KX) (SHT51-BHAl (SHT 5) -8HAli 1M!,}p 00.1 I (SHT 5) -aHA" (SHT 51-811A6 (SHT5)-BMA7 (SHT 2) -US 'I (5HT2) (5HT2) -(AS IL ------~ -BBP'E"'W' ------~ (SHT2) (SHT 71 (SHT 4) +1'101' IN 0 ------~ l~, r~, (SHT 5) +MDP OUT 0 ------~ -------< 21~ " -RAS 1 ilBH[HW ISHT 4) +HDP IN I (SHT 5) +MOPOI!T I " I I IU"1uz; l~., l RAn 2 wr ~ 4~ -Il.l1<; -(A5IH Hnl :c;~ m i,14 DIN/DOUT 1...1'1'" 14 Hon _ DI~/DOUT __,1'1 DIN/DOUT 1'1010 IHOP n. I .LIOINI DOUT '" 512 KB Memory Expansion Option (Sheet 6 of 8) • i i" "~ "'"< i ~~ ~~ co ~ ,...o .. Q) Q) &:. !!! t: o :;: Q. o t: o 'iii t: ca Q. >( 1l W ~ o E Q) :IE !XI ~ ('II .,.... It) 512KB Memory Expansion Option 11 .... CARD TABS ~ til .... ~ ~ A09 AOI (SHT 4) -I/O CH (I< .oS A07 :: A06 ADS ..,. ~ ~ A03 .02 A31 f A30 A29 A2S ~. g o "'CI A27 g A22 A26 A2S A2" eo A23 A21 A20 AI9 +S ~ B29 f! (SHT 3) +501 (SHT3) +502 (SHT3) +50'3 (SHT3) +$04 (SHT 3) +$0') (SHT3) +SDb (SHT3) +507 (SHT3) +SAQ (SHT7) +SAI (SHT 5) +SA2 (SHT 5) +SA'3 (SHT 5) + SA" (SHT 5) +SAS (SHT5) +SA6 (SHT5) +SA7 (SHT5) +SA8 (SHT 5) +SAq (SHT 5) + SAID (SHT 5) +SAII (SHT5) + SAI2 (SHT5) AlB + SAl, (SHT 5) AI7 + SAl... + SAP:; + SAlt) (SHT 5) AI6 AIS BID +5DO (SHT 5) (SHT 5) AI" AI3 + SAI7 + SAI8 828 + BALE (SHT 1) B31 819 B02 512 KB Memory Expansion Option (Sheet 8 of 8) -REFRESH (SHT7) +RESET DRY (SHT 4) -------- -- - ----------- ---- PCrJotltd Cumputer H arduHlrc R e/~ren{(UhrfJn' ' Serial/Pa,rallel Adapter o36167.~ Contents IBM Personal Computer AT Serial/Parallel Adapter .... 1 Serial Portion of the Adapter .................. 1 Programmable Baud-Rate Generator ........... 17 Parallel Portion of the Adapter ................ 19 Specifications ............................. 24 Logic Diagrams ................................ 26 iii iv IBM Personal Computer AT Serial/Parallel Adapter The IBM Personal Computer AT Serial/Parallel Adapter provides a parallel port and a serial port. It plugs into a system-board expansion slot. All system-control signals and voltage requirements are provided through a 2- by 31-position card edge connector. Serial Portion of the Adapter The serial portion of the adapter is fully programmable and supports asynchronous communications. It will add and remove start, stop, and parity bits. A programmable baud-rate generator allows operation from 50 baud to 9600 baud. Five-, six-, sevenand eight-bit characters with 1, 1.5, or 2 stop bits are supported. A prioritized interrupt system controls transmit, receive, error, and line status as well as data-set interrupts. The rear of the adapter has a 9-pin D-shell connector that is classified as an RS-232C port. When the optional IBM Communications Cable (9-Pin), which has a 9-pin D-shell connector on one end and a 25-pin D-shell connector on the other end, is connected to the adapter, the 25-pin end of the cable has all the signals of a standard EIA RS-232C interface. The following figure is a block diagram of the serial portion of the adapter. Serial/Parallel Adapter 1 Address Address Decode Bus Chip Select Register Select -- -... Data Bus Interrupt Controller Asynchronous Communications Chip ... I Oscillator i 1.8432 MHz - r----. -... EIA Receivers -- ... g-Pin Connector - EIA Drivers - Serial Portion Block Diagram The serial portion of the adapter has a controller that provides the following functions: • Adds or deletes standard, asynchronous-communications bits to or from a serial data stream. • Provides full, double buffering, which eliminates the need for precise synchronization. • Provides a programmable baud-rate generator. • Provides modem controls (CTS, RTS, DSR, DTR, RI, and CD). Communications Application The serial output port may be addressed as either communications port 1 or communications port 2 as defined by jumper 11 (see the following figure). In this section hex addresses begin with an X which can be either a 3 for communications port 1 (interrupt level 4) or a 2 for communications port 2 (interrupt level 3). 2 Serial/ParaDel Adapter Port 1 The data format will be as follows: DO 01 02 03 04 05 06 07 Marking Start [ Bit ++ + + ++ ++ [[[[[I[[ Parity Bit Stop Bit Data bit 0 is the first bit to be sent or received. The controller automatically inserts the start bit, the correct parity bit (if programmed to do so), and the stop bit (1, 1.5, or 2, depending on the command in the line-control register). Controller Specifications The following describes the function of controller input/output signals. Serial/Parallel Adapter 3 Input Signals -Clear to Send: (-CTS), Pin 36-The '-CTS' signal is a modem-control function input, the condition of which can be tested by the processor by reading bit 4 (CTS) of the modem status register. Bit 0 (DCTS) of the modem status register indicates if the '-CTS' input has changed state since the previous reading. Note: Whenever the CTS bit of the modem status register changes state, an interrupt is generated if the modem-status interrupt is enabled. -Data Set Ready: (-DSR), Pin 37-When low, indicates the modem or data set is ready to establish the communications link and transfer data with the controller. The '-DSR' signal is a modem-control function input, the condition of which can be tested by the processor reading bit 5 (DSR) of the modem status register. Bit 1 (DDSR) of the modem status register indicates if the '-DSR' input has changed since the previous reading. Note: Whenever the DSR bit of the modem status register changes state, an interrupt is generated if the modem-status interrupt is enabled. -Data Carrier Detect: (-DCD), Pin 38-When low, indicates the modem or data set detected a data carrier. The '-DCD' signal is a modem-control function input, the condition of which can be tested by the processor reading bit 7 (DCD) of the modem status register. Bit 3 (DCD) of the modem status register indicates if the '-DCD' input has changed state since the previous reading. Note: Whenever the DCD bit of the modem status register changes state, an interrupt is generated if the modem status interrupt is enabled. -Ring Indicator: (-RI), Pin 39-When low, indicates the modem or data set detected a telephone ringing signal. The '-RI' signal is a modem-control function input, the condition of which can be 4 Serial/Parallel Adapter tested by the processor reading bit 6 (RI) of the modem status register. Bit 2 (TERI) of the modem status register indicates if the '-RI' input has changed from an active to an inactive state since the previous reading. Note: Whenever the RI bit of the modem status register changes from an inactive to an active state, an interrupt is generated if the modem-status interrupt is enabled. vee Pin 40-+5 Vdc supply VSS Pin 20-Ground (0 Vdc) reference Output Signals -Data Terminal Ready: (-DTR), Pin 33-When active, informs the modem or data set that the controller is ready to communicate. The 'DTR' output signal can be set to an active level by programming bit 0 (DTR) of the modem control register to an active level. The '-DTR' signal is set inactive upon a master reset operation. -Request to Send: (-RTS), Pin 32-When active, informs the modem or data set that the controller is ready to send data. The , -R TS' output signal can be set to an active level by programming bit 1 (RTS) of the modem control register to an active level. The '-R TS' signal is set inactive upon a master reset operation. -Output 1: (-OUT 1), Pin 34-User-designated output that can be set to an active level by programming bit 2 (-OUT 1) of the modem control register to an inactive level. The '-OUT I' signal is set inactive upon a master reset operation. Pin 34 is connected to an active source. -Output 2: (-OUT 2), Pin 31-User-designated output that can be set to an active level by programming bit 3 (-OUT 2) of the modem control register to an inactive level. The '-OUT 2 ' signal is set inactive upon a master reset operation. Pin 31 controls interrupts to the system. Serial/Parallel Adapter 5 ControUer-Accessible Registers The controller has a number of accessible registers. The system programmer may gain access to or control any of the controller registers through the microprocessor. These registers are used to control the controller's operations and to transmit and receive data. The X in the register address determines the the port selected; 3 is for port 1 and 2 is for port 2. Specific registers are selected according to the following figure: I/O Address XF8 XF8 XF8 XF9 XF9 XFA XFB XFC XFD XFE XFF Register Selected TX buffer RX buffer Divisor Latch LSB Divisor Latch MSB Interrupt Enable Register Interrupt Identification Register Line Control Register Modem Control Register Line Status Register Modem Status Register Reserved DLAB State o (write) o (read) 1 1 0 Controller-Accessible Registers Transmitter Holding Register (Hex XF8): The transmitter holding register (THR) contains the character to be sent. Transmitter HDlding Register (hex XF81 Bit 7 6 5 4 3 2 1 0 ~~>""' .. " > > > . -----> > > > Data Bit 1 Data Bit 2 Data Bit 3 Data Bit 4 Data Bit 5 Data Bit 6 Data Bit 7 Transmitter Holding Register Bit 0 is the least-significant bit and the first bit sent serially. Receiver Buffer Register (Hex XF8): The receiver buffer register (RBR) contains the received character. 6 Serial/Parallel Adapter Receiver Buller Register [hex XF81 Bit 7 6 543210 ~"~"" > > > > > > > Data Bit 1 Data Bit 2 Data Bit 3 Data Bit 4 Data Bit 5 Data Bit 6 Data Bit 7 Receiver Buffer Register Bit 0 is the least-significant bit and the first bit received serially. Divisor Latch LSB (Hex XF8) Divisor Latch leist Significant Bit [hex XF81 Bit 7 6 543210 ~>""" > > > > > > > Bit 1 Bit2 Bit 3 Bit4 Bit 5 Bit6 Bit 7 Divisor Latch Least Significant Bit Information about this register may be found under "Programmable Baud Rate Generator" later in this section. Divisor Latch MSB (Hex XF9) Divisor Lltch Most Significlnt Bit [hex XF91 Bit 7 6 543210 ~~:: > > > > > > Bit2 Bit 3 Blt4 Bit 5 Blt6 Bit 7 Divisor Latch Most Significant Bit Serial/Parallel Adapter 7 Information about this register may be found under "Programmable Baud Rate Generator" later in this section. Interrupt Enable Register (Hex XF9): This 8-bit register allows the four types of controller interrupts to separately activate the I chip-interrupt I (INTRPT) output signal. The interrupt system can be totally disabled by resetting bits 0 through 3 of the interrupt enable register (IER). Similarly, by setting the appropriate bits of this register to logical 1, selected interrupts can be enabled. Disabling the interrupt system inhibits the IER and the active I INTRPT I output from the chip. All other system functions operate normally, including the setting of the line-status and modem-status registers. I Interrupt Enable Register Bit I Ihex XF9) 7 6 5 4 3 2 1 0 11ll::> ,-.,,""" '"."." ,~"'" > Enable Tx Holding Register Empty Interrupt > Enable Receive Line Status Interrupt Enable Modem Status Interrupt > ' - - - - - > =0 =0 =0 ' - - - - - - - > =0 '--------> '--------~> Interrupt Enable Register Bit 0 When set to logical 1, enables the received-data-available interrupt. Bit 1 When set to logical 1, enables the transmitter-holding-register-empty interrupt. Bit 2 When set to logical 1, enables the receiver-line-status interrupt. Bit 3 When set to logical 1, enables the modem-status interrupt. Bits 4-7 These four bits are always logical 8 Serial/Parallel Adapter o. Interrupt Identification Register (Hex XFA): The controller has an on-chip interrupt capability that makes communications possible with all of the currently popular microprocessors. In order to minimize programming overhead during data character transfers, the controller prioritizes interrupts into four levels: receiver line status (priority 1), received data ready (priority 2), transmitter holding register empty (priority 3), and modem status (priority 4). Information about a pending prioritized interrupt is stored in the interrupt identification register (IIR). (See the figure "Interrupt Control Functions," later.) The IIR, when addressed during chip-select time, stops the pending interrupt with the highest priority, and no other interrupts are acknowledged until the processor services that particular interrupt. Inlerrupl Identification Register (hex XFAI Bit 7 6 5 4 3 2 t 0 ~> ""~'""'."'. > > > > > > > Interrupt ID Bit 0 Interrupt ID Bit 1 =0 =0 =0 =0 =0 Interrupt Identification Register Bit 0 This bit can be used in either hard-wired, prioritized, or polled conditions to indicate if an interrupt is pending. When bit 0 is logical 0, an interrupt is pending, and the IIR contents may be used as a pointer to the appropriate interrupt service routine. When bit 0 is logical 1, no interrupt is pending, and polling (if used) continues. Bits 1-2 These two bits identify the pending interrupt that has the highest priority interrupt pending, as shown in the following figure. Bits 3-7 These five bits are always logical O. Serial/ParaDel Adapter 9 Interrupt ID Register Bit Bit 0 Interrupt Set And Reset Functions Priority Level Interrupt Type Interrupt Source Interrupt Reset Control 2 Bit 1 0 0 0 - None None 1 1 0 Highest Receiver Line Status Overrun Error or Parity Error or Framing Error or Break Interrupt Reading the Line Status Register 1 0 0 Second Received Data Available Receiver Data Available Reading the Receiver Buffer Register 0 1 0 Third Transmitter Holding Register Empty Transmitter Holding Register Empty Reading the II R (if source of interrupt) or writing into the THR 0 0 0 Fourth Modem Status Clear to Send or Data Set Ready or Ring Indicator or Received Line Signal Detect Reading the Modem Status Register - Line-Control Register (Hex XFB): The system programmer specifies the format of the asynchronous data communications exchange through the line control register. In addition to controlling the format, the programmer may retrieve the contents of the line control register for inspection. This feature simplifies system programming and eliminates the need to store line characteristics separately in system memory. 10 Serial/Parallel Adapter Une Control Register (hex XFBI Bit 7 6 5 4 3 2 1 0 l~> W~ ,.~,,,.,,"," > > > > > > Word Length Select Bit 1 Number of Stop Bits Parity Enable Even Parity Select Stuck Panty Set Break Divisor Latch Access Bit Line Control Register Bits 0, 1 These two bits specify the number of bits in each serial character that is sent or received. The encoding of bits and 1 is as follows: ° Bit 1 Bit2 0 0 1 1 0 1 0 1 Word Length (Bits) 5 6 7 8 Word length Bit 2 This bit specifies the number of stop bits in each serial character that is sent or received. If bit 2 is a logical 0, one stop bit is generated or checked in the data sent or received. If bit 2 is logical 1 when a 5-bit word length is selected through bits and 1, 1-1/2 stop bits are generated or checked. If bit 2 is logical 1 when either a 6-, 7-, or 8-bit word length is selected, two stop bits are generated or checked. ° Bit 3 This bit is the parity-enable bit. When bit 3 is logical 1, a parity bit is generated (transmit data) or checked (receive data) between the last data word and stop bit of the serial data. (The parity bit is used to produce an even or odd number of 1's when the data-word bits and parity bit are summed.) Bit 4 This bit is the even-parity-select bit. When bit 3 is a logical 1 and bit 4 is a logical 0, an odd Humber of Serial/Parallel Adapter 11 logical l's is sent or checked in the data word bits and parity bit. When both bit 3 and bit 4 are a logical 1, an even number of bits is sent or checked. Bit 5 This bit is the stuck-parity bit. When bit 3 is a logical 1 and bit 5 is a logical 1, the parity bit is sent and then detected by the receiver as a logical 0, if bit 4 is a logical 1, or as a logical 1 if bit 4 is a 10gical0. Bit 6 This bit is the set-break control bit. When bit 6 is set to a logical 1, the serial output (SOUT) is forced to the spacing (logical 0) state and remains there regardless of other transmitter activity. The set-break is disabled by setting bit 6 to logical O. This feature enables the microprocessor to select a specific terminal in a computer communications system. Bit 7 This bit is the divisor-latch access bit (DLAB). It must be set high (logical 1) to gain access to the divisor latches of the baud-rate generator during a read or write operation. It must be set low (logical 0) to gain access to the receiver buffer, the transmitter holding register, or the interrupt enable register. Modem Control Register (Hex XFC): This 8-bit register controls the data exchange with the modem or data set (an external device acting as a modem). l Modem Control Register Ihex XFCI Bit 7 6 543210 ~>>> "'"',,";~"~ Request to Send Out 1 Out 2 > > Loop > =0 > =0 > =0 Modem Control Register 12 Serial/ParaDel Adapter Bit 0 This bit controls the '-data terminal ready' (-DTR) output. When bit 0 is set to logical 1, the -DTR output is forced active. When bit 0 is reset to logical 0, the '-DTR' output is forced inactive. Bit 1 This bit controls the '-request-to-send' (-RTS) output. Bit 1 affects the '-RTS' output in the same way bit 0 affects the '-DTR' output. Bit 2 This bit controls the '-Output 1 ' (-OUT 1) signal, which is a spare the programmer can use. Bit 2 affects the '-OUT I' output in the same way bit 0 affects the '-DTR' output. Bit 3 This bit controls the' -Output 2' (-OUT 2) signal, which is a spare the programmer can use. Bit 3 affects the '-OUT 2' output in the same way bit 0 affects the '-DTR' output. Bit 4 This bit provides a loopback feature for diagnostic testing of the controller. When bit 4 is set to logical 1, the following occur: the 'transmitter serial output' (SOUT) is set to the active state; the 'receiver serial input' (SIN) is disconnected; the output of the transmitter shift register is "looped back" to the receiver shift register input; the four modem-control inputs ('-CTS', '-DSR', '-RLSD', and '-RI') are disconnected; and the four modem-control outputs ('-DTR', '-RTS', '-OUT l' and '-OUT2') are internally connected to the four modem control inputs. In the diagnostic mode, data sent is immediately received. This feature allows the processor to verify the transmit- and receive-data paths of the controller. In the diagnostic mode, the receiver and transmitter interrupts are fully operational, as are the modem-control interrupts. But the interrupts' sources are now the lower four bits of the modem control register (MCR) instead of the four modem-control inputs. The interrupts are still controlled by the interrupt enable register. Serial/Parallel Adapter 13 The controller's interrupt system can be tested by writing to the lower six bits of the line status register and the lower four bits of the modem status register. Setting any of these bits to logical 1 generates the appropriate interrupt (if enabled). Resetting these interrupts is the same as for normal controller operation. To return to normal operation, the registers must be reprogrammed for normal operation, and then bit 4 of the MeR must be reset to logical O. Bits 5-7 These bits are permanently set to logical O. Line Status Register (Hex XFD): This 8-bit register provides the processor with status information about the data transfer. Line Status Register (hex XFDI Bit 7 6 5 4 3 2 1 0 ~~>"~~. > > > > > Overrun Error Parity Error Framing Error Break Interrupt Transmitter Holding Register Empty > Tx Shift Register Empty > =0 line Status Register Bit 0 This bit is the receiver data ready (DR) indicator. It is set to logical 1 whenever a complete incoming character has been received and transferred into the receiver buffer register. Bit 0 may be reset to logical o by the processor either reading the data in the receiver's buffer register or writing logical 0 in it. Bit 1 This bit is the overrun error (OE) indicator. It indicates that data in the receiver's buffer register was not read by the processor before the next character was transferred into the register, thereby destroying the previous character. The OE indicator is reset whenever the processor reads the contents of the line status register. 14 Serial/Parallel Adapter Bit 2 This bit is the parity error (PE) indicator and indicates the received data character does not have the correct even or odd parity, as selected by the even-parity-select bit. The PE bit is set to logical 1 upon detection of a parity error, and is reset to logical 0 whenever the processor reads the contents of the line status register. Bit 3 This bit is the framing error (FE) indicator. It indicates the received character did not have a valid stop bit. Bit 3 is set to logical 1 whenever the stop bit following the last data bit or parity bit is detected as a zero bit (spacing level). Bit 4 This bit is the break interrupt (BI) indicator. It is set to logical 1 whenever the received data input is held in the spacing state (logical 0) for longer than a fullword transmission time (that is, the total time of start bit + data bits + parity stop bits). Note: Bits 1 through 4 are error conditions that produce a receiver line-status interrupt whenever any of the corresponding conditions are detected. Bit 5 Bit 6 This bit is the transmitter holding register empty (THRE) indicator. It indicates the controller is ready to accept a new character for transmission. In addition, this bit causes the controller to issue an interrupt to the processor when the TRHE interrupt enable is set active. The THRE bit is set to logical 1 when a character is transferred from the transmitter holding register into the transmitter shift register. It is reset to logical 0 when the processor loads the transmitter holding register. This bit is the transmitter empty (TEMT) indicator. It is set to logical 1 whenever the transmitter holding request (THR) and the transmitter shift request (TSR) are both empty. It is reset to logical 0 whenever THR or TSR contains a data character. Bit 7 This bit is permanently set to logical O. Serial/Parallel Adapter 15 Modem Status Register (Hex XFE): The 8-bit MSR provides the current state of the control lines from the modem (or external device) to the processor. In addition, four bits of the MSR provide change information. These four bits are set to logical 1 whenever a control input from the modem changes state. They are reset to logical 0 whenever the processor reads this register. Modem Status Register (bex XFE) Bit 7 6 5 4 3 2 t I 0 ~> """'~,~",' > > > > > > > Delta Data Set Ready Trailing Edge Ring Indicator Delta Data Carrier Detect Clear to Send Data Set Ready Ring Indicator Data Carner Detect Modem Status Register Bit 0 This bit is the delta clear-to-send (DCTS) indicator. It indicates the '-CTS' input to the chip has changed state since the last time it was read by the processor. Bit 1 This bit is the delta data-set-ready (DDSR) indicator. It indicates the '-DSR' input to the chip has changed state since the last time it was read by the processor. Bit 2 This bit is the trailing-edge ring-indicator (TERn detector. It indicates the' -RI' input to the chip has changed from an active condition to an inactive condition. Bit 3 This bit is the delta data-carrier-detect (DDCD) indicator. It indicates the '-DCD' input to the chip has changed state. Note: Whenever bit 0, 1, 2, or 3 is set to a logical 1, a modem status interrupt is generated. 16 Serial/Parallel Adapter Bit 4 This bit is the opposite of the I -clear-to-send I (-CTS) input. If bit 4 of the MCR loop is set to a logical 1, this bit is equivalent to RTS of the MCR. Bit 5 This bit is the opposite of the -data-set-ready (-DSR) input. If bit 4 of the MCR is set to a logical 1, this bit is equivalent to DTR of the M CR. Bit 6 This bit is the opposite of the I -ring-indicator I (-RI) input. If bit 4 of the MCR is set to a logical 1, this bit is equivalent to OUT 1 of the MCR. Bit 7 This bit is the opposite of the -data-carrier-detect (-DCD) input. If bit 4 of the MCR is set to a logical 1, this bit is equivalent to OUT 2 of the MCR. I I I I Programmable Baud-Rate Generator The controller has a programmable baud-rate generator that can divide the clock input (1.8432 MHz) by any divisor from 1 to 655,535 or 216_1. The output frequency of the baud-rate generator is the baud rate multiplied by 16. Two 8-bit latches store the divisor in a 16-bit binary format. These divisor latches must be loaded during setup to ensure desired operation of the baud-rate generator. When either of the divisor latches is loaded, a 16-bit baud counter is immediately loaded. This prevents long counts on the first load. Serial/Parallel Adapter 17 Pin Assignment for Serial Port The following figure shows the pin assignments for the serial port in a communications environment. 5 - - ~ External Device - Carrier Detect 1 Receive Data 2_ Transmit Data 3 Data Terminal Ready 4 Signal Ground 5 Data Set Ready 6_ Request To Send 7 Clear To Send B_ Ring Indicator 9'" - 18 Serial/Parallel Adapter ... Serial Parallel Adapter L- Parallel Portion of the Adapter The parallel portion of the adapter makes possible the attachment of various devices that accept eight bits of parallel data at standard TTL levels. The rear of the adapter has a 25-pin, D-shell connector. This port may be addressed as either parallel port 1 or 2. The port address is determined by the position of jumper 12, as shown in the following figure. m~ ~jrn m []] []] mi] m[1] Port 1 Serial/Parallel Adapter 19 The following figure is a block diagram of the parallel portion of the adapter. Address Bus ..- Data Bus ~ ~ Address Decode .. -. Buffer Control Signals Interrupt Data Output Buffer .. r-Z5-Pin 0 Connector . Control Output Buffer Data Wrap Buffer Control Wrap and Signal Input --"' r---. Parallel Portion Block Diagram Printer Application The following discusses the use of the parallel portion of the adapter to connect to a parallel printer. Hexidecimal addresses in this section begin with an X, which is replaced with a 3 to indicate port 1, or a 2 to indicate port 2. Data Latch (Hex X78, X7C) Writing to this address causes data to be stored in the printer's data buffer. Reading this address sends the contents of the printer's data buffer to the system microprocessor. Printer Controls (hex X7 A, X7E) Printer control signals are stored at this address to be read by the system microprocessor. The following are bit definitions for this byte. 20 Serial/Parallel Adapter Bit 7 Not used Bit 6 Not used Bit 5 Not used Bit 4 + IRQ Enable-A 1 in this position al10ws an interrupt to occur when' -ACK' changes from true to false. Bit 3 +SLCT IN-A 1 in this bit position selects the printer. Bit 2 -INIT-A 0 starts the printer (50-microsecond pulse, minimum). Bit 1 +AUTO FD XT-A 1 causes the printer to line-feed after a line is printed. Bit 0 +STROBE-A 0.5-microsecond minimum, high, active pulse clocks data into the printer. Valid data must be present for a minimum of 0.5 microsecond before and after the strobe pulse. Printer Status - Address X79, X7D Printer status is stored at this address to be read by the microprocessor. The fol1owing are bit definitions for this byte. Bit 7 -BUSY-When this signal is active, the printer is busy and cannot accept data. It may become active during data entry, while the printer is offline, during printing, when the print head is changing positions, or while in an error state. Bit 6 -ACK-This bit represents the current state of the printer's '-ACK' signal. A 0 means the printer has received the character and is ready to accept another. Normally, this signal will be active for approximately 5 microseconds before '-BUSY' stops. Bit 5 + PE-A 1 means the printer has detected the end of paper. Serial/Parallel Adapter 21 Bit 4 +SLCT-A 1 means the printer is selected. Bit 3 -Error-A 0 means the printer has encountered an error condition. Bit 2 Unused. Bit 1 Unused. Bit 0 Unused. 22 Serial/ParaUel Adapter Parallel Ioterface The adapter has a 25-pin, D-shell connector at the rear of the adapter. The following figure shows the signals and their pin assignments. Typical printer input signals also are shown. 1 - 0 ~ 0 14 1 Data Bit 0 2 Data Bit 1 3 Data Bit 2 4 Data Bit 3 5 Data Bit 4 6 Data Bit 5 7 Data Bit 6 8 Data Bit 7 -ACK 9 11 PE 12 SLCT 13 - AUTO fEED XT 14 - ERROR 15 -INIT 16 Ground Serial Parallel Ad.pter 10 BUSY - SLCT IN - 0 o r- Strobe Externa I Device o 17 18-25 '---- Serial/Parallel Adapter 23 Specifications The following figures list characteristics of the output driver. Sink current Source current High-level output voltage Low-level output voltage 24 rnA -2.6 rnA 2.4 Vdc 0.5 Vdc Max Max Min Max Parallel Data and Processor IRQ Sink current Source current High level output voltage Low level output voltage 16 rnA 0.55 rnA 5Vdc 0.4 Vdc Max Max Minus pull-up Max 24 rnA -15 rnA 2.0 Vdc 0.5 Vdc Max Max Min Max Parallel Control Sink current Source current High level output voltage Low level output voltaqe Parallel Processor Interface (except IRQ) The following are the specifications for the serial interface. Function Condition On Spacing condition (binary 0, positive voltage). Off Marking condition (binary 1, negative voltage). Voltage above +15 Vdc +3 Vdc to +15 Vdc -3 Vdc to +3 Vdc -3 Vdc to -15 Vdc Below -15 Vdc Function Invalid On Invalid Off Invalid Serial Port Functions 24 Serial/Parallel Adapter Logic Diagrams ~~n nN ~ r:I::r II I ~~~ §~~'" 2;g~~ , ~,,~ '"'" I ~ r.l)U) C;; I ~ t:~ ~ '" '" I I ~ ~ I~ ~ I~ ~ ~ ~ ~ I II . :5! -" • - J M o .... I! «~l Q) Q) JJJ ~~~I !I !::~~;!.!.'::t:::.eg;~~ ,~o~ : -" - ,"~NIJr~ ..... 11'1- ~I: ~~ ~~ ""~-<>N :~J " Ci - f--f~ ~ f-S~ ----- 8~ = I~ ;;; Q) en f-'v~ _J ~ ';: Q. ';: f-'~~ ~ C :::::: f-'0~ N ... 'C f- Q\ 00 ISHT 1) ISHT 1) :3. ISHT 1) ISHT 11 ~ e:. ......... ;p... = !E. (SHT 1) ~~ ENABLEFAAALLEll&:~ 2C ~~~~N/c AD n AI "3 ~ BICR I Ie 2n~NIt 2G UI2 :~~ 6RPB IY2 'iRP( L1...:~~N/C P2 2') PIN 'D'SHELl CONNECTOR 0, (13 -(20 (QX},0022 uF +0:::4:: "', I1' ' wlJ~ § I " ~ " u" ~~ JlSO !.... 10 BDtft 20 ~~ 70 ~SD ~~ bD ... ~~ ~g ~ r- I~ m CI7 ' " I 2 4 ~ SQ" IQ , ~ ", "" Z ,, " ZQ 16 7Q 1 ,.12 bQ (') b 1 S 12 , ", ~~ ~ UI6 ~- -RNI 4.7KIl---.. ~ ISHT ISHT ISHT ISHT (SHT ISHT (SHT ISHT 1) 1) 1) 1) 11 1) 1) 1) (SHT 1) SDO BOI BOZ BOO BD I BDZ BO' BD4 B" BOb 801 '" ,,, BD4 SD6 807 BOO ID 60 IQ 2 6Q I ~i~ 2Q'i ~ '7777; l RESET '":;:!;fu 20 BO'i1 40 CLK Ir---------'! I ~" ~ nUll 12 OC; II UII to ~O4 1'1 UI,) DATA 2 DATA :I DATA .. , 10 12 nil " 12 ." L DATA ') DATA b DATA 7 ~ II 2AI 13 2A2 2'1'1 2'1'2 q 7 '+ lA2 1'1'2 Ie 8 IA4 1'1'4 12 Uq , ~SI2<; UI , -ERROR -AUTO FO Xl ~4 -[NIT Ib ~ r--lle---,-,-- 8 In 14 2'(; ') ~ - sTROBE '5Qpt-- U4 I '.~~ l;---------1~C qU11 I'l'l 19 b lA, 1'5 2A, ~ ~ /) SOO SOl 802 S" S04 S" Db S01 ':I 17 ZA4 2 IA I tIt ~ " 'i~ V ~ 2'1'4 DATA 0 DATA I 4 I. eLK BE ~ C20 >--#.- (8X) 2111 ~ > '19 ' " ~ II Ulb 10 V -SlCT IN +SLCT q ~04 8 V + BUSY 1 ~ ~2G 6 IAl 2'1'44- 2Y2~ l:---t ::~ ~~~ ~ L-~ ~~~ :~~ ott-Ir----H-~:~ :~i:~ ~" '~Jt"" .PE ~~ Ulb L504 Y---;o-- -ACK IUlb 2 + IRQ EN ~~O\ (SHT 1) (SHT (SHT (SHT (SHT 1) 1) t} 1} IRQ') SAS '~ 2 , .5 ~ Serial/Printer Adapter (Sheet 2 of 3) 6 C;O _,I (SHT tJ (SHT II (SHTl) (SHT 1J (SHT 1) (SHT1) (SHT1) 1:0 0uTZ " 1'1R INTRPT 7 '~ ./C BOO >ZZ 1117777777 LS)2'i N/e !QL ~ BOLf +'iV ~IN fiOI'\ ~ BO'> ISHT11 !Q2.... .07 U2 N/e 7IZ?? l I Z I I I I I I I II: +'iV~ 10 (SHT 11 (SHT1) (SHT1) ISHTIl (SHT 1) .j Ii 21 I AO'--- "- I i.. N ....J lliim AO AI Soor lll EtA TX OATA '1 A2 :; (51 U' (SHT 1) SIGGNO,,) ~,==~~g~~~~~""fTR " BIOR "l1l\I""'--- +;V if [ EIA RTS 17 -ENABLE SER 1/0 ./e ., (SO +'iV~ e52 N/e ,,- " N/e 'L:"Uil J XTAl2 " XTAl I 7';00 " RECEIVE OATA Serial/Printer Adapter (Sheet 3 of 3) v '-~l,J I~(SHT11 IRQ... (SHT 1) 28 Serial/Parallel Adapter --.--- -- ---------,------._,--- .__ .... <.. PaS()1la/ Computer Hardware R ejerencf Librar}! . --_ .. __.. ..... .... ._ .. _"--- -- - - .- ...... _-_.._._--- - - . 20MB Fixed Disk Drive Contents Description .................................... Interfaces ..................................... Control Input Signals ........................ Output Control Signals ....................... Data-Transfer Signals ........................ Overlapped Seek ............................ Specifications .................................. Logic Diagrams ................................. 1 1 2 4 6 7 7 9 iii iv Description The fixed disk drive is a direct-access device that can store up to 20Mb of formatted data. The average access time is 40 milliseconds using a quasi closed-loop servo positioner. Interfaces The interfaces of this drive are divided into three categories: control, data transfer, and dc power. The control interface is a 34 pin printed circuit board (PCB) edge connector. The following shows the signals and pin assignments. Signal Name - Head select 3 - Head select 2 -Write gate -Seek complete -Track 000 -Write fault -Head select 0 Reserved -Head select 1 -Index -Ready -Step - Drive select 1 - Drive select 2 - Drive select 3 - Drive select 4 -Direction in SiQnal Pin 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 Ground Pin 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 Control Interface The data transfer interface is a 20 Pin PCB connector. The signals and pin assignments are as follows: 20MB Fixed Disk Drive 1 Signal Name Signal Pin - Drive selected +MFM write data -MFM write data +MFM read data -MFM read data Ground 1 13 14 17 18 2, 4, 6, 8, 11, 12, 15, 16, 19 Data-Transfer Interface The dc power interface is a 4-pin PWB connector. The signals and pin assignments follow. Signal Name Pin +12 Vdc +12 Vdc return +5Vdc +5 Vdc return 1 2 4 3 DC Power Interface Control Input Signals The control input signals are of two types: those that are multiplexed in a multiple drive system, and those intended to do the mUltiplexing. These input signals have the following specifications. • Active: 0.0 to 0.4 Vdc at 40 rnA • Inactive: 2.5 to 5.25 Vdc at 0 rnA The following are descriptions of the control input signals. -Write Gate The active level of this signal allows data to be written on the disk. The inactive level allows data to be read from the disk, and allows the step pulse to move the heads. 220MB Fixed Disk Drive -Head Select 0, 1,2, and 3 These four signals enable the selection of each read/write head in a binary-coded sequence. ' -Head Select 0' is the least significant. Heads are numbered 0 through 15. When all Head Select signals are inactive, head 0 is selected. - Direction In This signal defines the direction the read/write heads move when , -Step' is pulsed. A inactive level defines the direction as out, and if a pulse is applied to '-Step', the read/write heads move away from the center of the disk. An active level defines the direction as in, and the read/write heads move toward the center of the disk. -Step This signal causes the read/write heads to move in the direction defined by the '-Direction In' signal. The motion starts when the '-Step' signal changes from active to inactive (the trailing edge of this signal pulse). Any change in '-Direction In' is made at least 100 nanoseconds before the leading edge of the step pUlse. This drive supports two methods of stepping or seeking: Slow Seek The read/write heads move at the rate of incoming step pulses. The minimum time between successive steps is 3 milliseconds and the minimum pulse width is 2 microseconds. Buffered Seek The adapter's controller may burst step pulses to the drive until the time after the last pulse exceeds 200 microseconds or the maximum number of step pulses is received (1 for each track). The drive starts motion of the heads after receiving the first step pulse. Step pulses are sent to the drive every 35 microseconds. 20MB Fixed Disk Drive 3 - Drive Select Signals 1 through 4 When one of these signals is active, it connects that drive to the control lines. Making the appropriate jumper connections at the drive determines which select line of the interface activates that drive. The fixed disk drive provides a 220/230 ohm termination for a single drive select signal. The signal lead that is terminated is the one that selects the drive based on the position of the drive select jumpers. I I Output Control Signals An open-collector output stage, which is capable of sinking a maximum of 40 rnA at logical 0 to an active state with a maximum voltage of 0.4 Vdc at the driver, drives the output control signals. When the line driver is at the inactive level, the driver's transistor is off and the collector's cutoff current is a maximum of 250 microamperes. -Seek Complete This signal goes active when the read/write heads settle on the final track at the end of a seek. Reading or writing is not attempted when -Seek Complete is inactive. The following situations force -Seek Complete inactive. • When power-on starts a recalibration sequence because the read/write heads are not over track O. • When less than 2 microseconds have elapsed after the trailing edge of a step pulse or a series of step pulses. • If the • If the drive attempts to retry a seek after settling on a track. + 5 or restored. + 12 V dc fluctuates or is lost momentarily but 420MB Fixed Disk Drive -Seek Complete returns to the active level no later than 100 milliseconds (1 second if a seek retry occurs) after the trailing edge of the last -Step pulse. -Track 000 This signal is at an active level when the drive's read/write heads are at the outermost track. -Write Fault This signal means that a condition at the drive is causing improper operation of the disk. An active level of this signal prevents further writing and stepping at the drive until drive power is switched off. This signal goes active when any of the following conditions occur: • Write current exists in the head without '-Write Gate' active, or no write current exists in the head with '-Write Gate' active and '-Drive Selected' active. • More than one seek retry between Seek commands from the controller • A step pulse is received while '-Write Gate' is active. -Index The drive provides this output signal once each revolution to indicate the beginning of a track. This signal normally is inactive and goes active to indicate '-Index'. Only the change from inactive to active is valid (leading edge of the pulse). -Ready When this signal and '-Seek Complete' are active, the drive is ready to read, write, or seek, and the I/O signals are valid. An 20MB Fixed Disk Drive 5 inactive level of this signal prevents all writing and seeking. '-Ready' is inactive four times during drive operation: • At power-up time '-Ready' remains inactive until: Access recalibration to track 0 is complete. Spindle speed is stable within ±O.S% of nominal (10 revolution average). Drive self-check is complete. • Spindle speed deviates +0.25% of nominal (10 revolution average). • '-Write Fault' is active. • DC voltages are out of tolerance. Data-Transfer Signals All signals associated with the transfer of data between the drive and the system are differential (pairs of balanced signals) and are not multiplexed. Two pairs of balanced signals are used for the transfer of data: Write Data and Read Data. The following describes the data-transfer signals. MFM Write Data This is a differential pair that defines signal shifts written on the track. When' +MFM Write Data' goes more positive than '-MFM Write Data', flux reverses on the track, provided that 'Write Gate' is active. The system drives '-MFM Write Data' to an active level ('-MFM Write Data' more negative than '+MFM Write Data') when in the read mode. 620MB Fixed Disk Drive To ensure data integrity, the controller applies a write-precompensation of ± 12 nanoseconds to all write data on cylinders 300 and greater. MFM Read Data Read data is sent to the system through the differential pair of MFM Read Data lines. When '+ MFM Read Data' goes more positive than '-MFM Read Data', flux reverses on the track of the selected head. Overlapped Seek The drive supports overlapped-seek operations. An overlapped seek occurs when the drive is deselected 20 microseconds after the last step pulse is sent. Another drive is then selected, and the '-Step' and '-Direction In' signals are set by the operation desired. The controller provides at least 100 nanoseconds of hold time on '-Step' and '-Direction In' after' -Drive Select' is inactive. Specifications The following figures list the internal and performance specifications of this drive. 20MB Fixed Disk Drive 7 Rotational speed Cylinders R/W heads Index 3573 rpm :!:0.5 % 615 + landing zone 6 1 Internal Specifications Formatted capacity Bytes/ sector Sectors / track Transfer rate Access time Track-to-track Average Maximum Settling Average latency Track density Performance Specifications 820MB Fixed Disk Drive 20Mb 512 17 5M bits/second 2 ms 40 ms 85 ms 12 ms 8.4 ms 750 TPI Logic Diagrams 20MB Fixed Disk Drive 9 =.. I. ;:~:I~!I "11 Iii 1 : ,-------_ _-----.J . I , [I I L':::__ " , Iii , I 1020MB Fixed Disk Drive - 20MB Fixed Disk Drive 11 ,-------~+--.--~~3 U",f-"~' ,! g .Ul ,----' !, --++-~ ~--------.---------.-~ 12 20MB Fixed Disk Drive ---,----- ---_ ------------..... PerJ(wal ComjJUter Hardware Reference Librarv Fixed Disk and Diskette Adapter Contents Description .................................... 1 Fixed Disk Function ............................. 1 Task File .................................. 1 Task File Registers .......................... 2 Miscellaneous Information ................... 10 Diskette Function .............................. 10 Diskette Controller ......................... 12 Diskette Controller Commands ............... 14 Controller Commands ...................... 17 Command Status Registers ................... 24 Interfaces .................................... 28 Interface Lines ............................ 30 Logic Diagrams ................................ 35 iii iv Description The IBM Personal Computer AT Fixed Disk and Diskette Drive Adapter connects to the system board using one of the system expansion slots. The adapter controls the 5-1/4 inch diskette drives and fixed disk drives. Connectors on the adapter supply all the signals necessary to operate up to two fixed drives and one diskette drive or one fixed drive and two diskette drives. The adapter will allow concurrent data operations on one diskette and one fixed disk drive. The adapter operates when connected to a system board expansion slot. This channel is described in the "System Board" section of the IBM Personal Computer AT Technical Reference Manual. Fixed Disk Function The fixed disk function features 512-byte sectors; high-speed, PIO data transfers; ECC correction of up to five bits on data fields; multiple sector operations across track and cylinder boundaries; and on-board diagnostic tests. The adapter will support two fixed disks with up to 16 read/write heads and 1024 cylinders. Task File A task file, which contains eight registers, controls fixed-disk operations. The following figure shows the addresses and functions of these registers. Fixed Disk and Diskette Adapter 1 I/O ~ ddress Primary Secondary 1 FO 170 1 F1 171 1 F2 172 1 F3 173 1 F4 174 1F5 175 1 F6 176 1 F7 177 Read Write Data register Error register Sector count Sector number Cylinder low Cylinder high Drive/head Status reQister Data reg ister Write precomp Sector count Sector number Cylinder low Cylinder high Drive/head Command register Task File Task File Registers Data Register The data register provides access to the sector buffer for read and write operations in the PIO mode. This register must not be accessed unless a Read or Write command is being executed. The register provides a 16-bit path into the sector buffer for normal Read and Write commands. When a R/W Long is issued, the 4 ECC bytes are transferred by byte with at least 2 microseconds between transfers. Data Request (DRQ) must be active before the transferring of the ECC bytes. I I Error Register The error register is a read-only register that contains specific information related to the previous command. The data is valid only when the error bit in the status register is set, unless the adapter is in diagnostic mode. Diagnostic mode is the state immediately after power is switched on or after a Diagnose command. In these cases, the register must be checked regardless of the status register indicator. The following are bit values for the diagnostic mode. Diagnostic Mode 01 No errors 2 Fixed Disk and Diskette Adapter 02 Controller error 03 Sector buffer error 04 ECC device error 05 Control processor error The following are bit definitions for the operational mode. Operational Mode Bit 0 Data Address Mark (DAM) Not Found-This bit indicates that DAM could not be found within 16 bytes of the ID field. Bit 1 TR 000 Error-This bit will be set if, during a Restore command, the track 000 line from the fixed disk is not true within 1023 step pulses to the drive. Bit 2 Aborted Command-A command is aborted based on the drive status (Write Fault, Not Seek Complete, Drive Not Ready, or an invalid command). The status and error registers may be decoded to determine the cause. Bit 3 Not used. Bit 4 ID Not Found-The ID field with the specified cylinder, head, and sector number could not be found. If retries are enabled, the controller attempts to read the ID 16 times before indicating the error. If retries are disabled, the track is scanned a maximum of two times before setting this error bit. Bit 5 Not used Bit 6 Data ECC Error-This bit indicates that an uncorrectable ECC error occurred in the target's data field during a read command. Fixed Disk and Diskette Adapter 3 Bit 7 Bad Block Detect-This bit indicates that the bad block mark was detected in the target's 10 field. No Read or Write commands will be executed in any data fields marked bad. Write Precompensation Register The value in this register is the starting cylinder divided by 4. The reduced write current signal to the drive is activated and the adapter's Write Precompensation logic is turned on. I I Sector Count Register The sector count register defines the number of sectors to be transferred during a Verify, Read, Write, or Format command. During a multi-sector operation, the sector count is decremented and the sector number is incremented. When the disk is being formatted, the number of sectors per track must be loaded into the register prior to each Format command. The adapter supports multi-sector transfers across track and cylinder boundaries. The drive characteristics must be set up by the Set Parameters command before initiating a multi-sector transfer. The sector count register must be loaded with the number of sectors to be transferred for any data-related command. Note: A 0 in the sector count register specifies a 256-sector transfer. Sector Number Register The target's logical sector number for Read, Write, and Verify commands is loaded into this register. The starting sector number is loaded into this register for multi-sector operations. Cylinder Number Registers The target number for Read, Write, Seek, and Verify commands is loaded into these registers as shown in the following figure. The cylinder-number registers address up to 1024 cylinders. 4 Fixed Disk and Diskette Adapter Register bits Cylinder bits Cylinder High Cylinder Low 76543210 76543210 76543210 --98 Cylinder Number Registers Drive/Head Register Bit 7 Set to 1 Bit 6 Set to 0 Bit 5 Set to 1 Bit 4 Drive Select-This bit selects the drive. A 0 indicates the first fixed disk drive, and a 1 indicates the second. Bit 3-Bit 0 Head Select Bits-Bits 3 through 0 specify the desired read/write head. Bit 0 is the least-significant (0101 selects head 5). The adapter supports up to 16 read/write heads. For access to heads 8 through 15, bit 3 of the fixed disk register (address hex 3F6) must be set to 1. Note: This register must be loaded with the maximum number of heads for each drive before a Set Parameters command is issued. Status Register The controller sets up the status register with the command status after execution. The program must look at this register to determine the result of any operation. If the busy bit is set, no other bits are valid. A read of the status register clears interrupt request 14. If write fault or error is active, or if seek complete or ready is inactive, a multi-sector operation is aborted. I I I I I I I I The following defines the bits of the status register. Fixed Disk and Diskette Adapter 5 Bit 7 Busy-This bit indicates the controller's status. A 1 indicates the controller is executing a command. If this bit is set, no other status register bit is valid, and the other registers reflect the status register's contents; therefore, the busy bit must examined before any fixed disk register is read. Bit 6 Drive Ready-A 1 on this bit together with a 1 on seek complete bit (bit 4) indicates that the fixed disk drive is ready to read, write, or seek. A o indicates that read, write, and seek are inhibited. Bit 5 Write Fault-A 1 on this bit indicates improper operation of the drive; read, write, or seek is inhibited. Bit 4 Seek Complete-A 1 on this bit indicates that the read/write heads have completed a seek operation. Bit 3 Data Request-This bit indicates that the sector buffer requires servicing during a Read or Write command. If either bit 7 (busy) or this bit is active, a command is being executed. Upon receipt of any command, this bit is reset. Bit 2 Corrected Data-A 1 on this bit indicates that the data read from the disk was successfully corrected by the ECC algorithm. Soft errors will not end multi-sector operations. Bit 1 Index-This bit is set to 1 each revolution of the disk. Bit 0 Error-A 1 on this bit indicates that the previous command ended in an error, and that one or more bits are set in the error register. The next command from the controller resets the error bit. This bit, when set, halts multi-sector operations. 6 Fixed Disk and Diskette Adapter Command Register The command register accepts eight commands to perform fixed disk operations. Commands are executed by loading the task file and writing in the command register while the controller status is not busy. If -write fault is active or if -drive ready or -seek complete are inactive, the controller will not execute any command. Any code not defined in the following causes an Aborted Command error. Interrupt request 14 is reset when any command is written. The following are acceptable commands to the command register. I I I I I I Command Bits 7 6 5 Restore Seek Read Sector Write Sector Format Track Read Verify Diagnose Set Parameters 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 0 1 0 0 1 1 0 0 4 3 2 1 0 1 R3 R2 R1 RO 1 R3 R2 R1 RO 0 0 0 L T 1 0 0 L T 1 0 0 0 0 0 0 0 0 T 1 0 0 0 0 1 0 0 0 1 Valid Command-Register Commands The following figure shows the stepping rate as defined by R3 through RO. R3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 R2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 R1 RO Stepping Rate 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 35 us 0.5 ms 1.0 ms 1.5 ms 2.0 ms 2.5 ms 3.0 ms 3.5 ms 4.0 ms 4.5 ms 5.0 ms 5.5 ms 6.0 ms 6.5 ms 7.0 ms 7.5 ms Stepping Rate Fixed Disk and Diskette Adapter 7 Note: After a Diagnose or Reset Command, the stepping rate is set to 7.5 milliseconds. The following figure shows the bit definitions for bits Land T. Bit L T Definition Data Mode Retry Mode 0 1 Data Only Retries Enabled Data plus 4 byte ECC Retries Disabled Land T Bit Definitions Note: The system verifies the operation of ECC by reading and writing with the ECC bytes. When retries are disabled, ECC and ID field retries are limited to less than two complete revolutions. Following are descriptions of the valid command-register commands. Restore: The controller issues step pulses to the drive at 3 milliseconds per step until the track 000 indicator from the drive is active. If track 000 is not active within 1023 steps, the error bit in the status register is set, and a track 000 error is placed in the error register. The implied seek step rate is set by this command. Seek: The Seek command moves the R/W heads to the cylinder specified in the task files. The adapter supports overlapped seeking on two drives or setup of the buffered seek stepping rate for the implied seek during a Read/Write command. An interrupt is generated at the completion of the command. Read Sector: A number of sectors (1-256) may be read from the fixed disk with or without the ECC field appended in the Programmed I/O (PIO) mode. If the heads are not over the target track, the controller issues step pulses to the drive and checks for the proper ID field before reading any data. The stepping rate used during the implied seek is the value specified during the previous Seek or Restore command. Data errors, up to 5 bits in length, are automatically corrected on Read Short commands. If an uncorrectable error occurs, the data transfer still takes place; however, a multi-sector read ends after the 8 Fixed Disk and Diskette Adapter system reads the sector in error. Interrupts occur as each sector is ready to be read by the system. No interrupt is generated at the end of the command, after the lost sector is read by the system. Write Sector: A number of sectors (1-256) may be written to the fixed disk with or without the ECC field appended in the PIO mode. The Write Sector command also supports implied seeks. Interrupts for the Write command occur before each sector is transferred to the buffer (except the first) and at the end of the command. The first sector may be written to the buffer immediately after the command has been sent, and data request is active. I I Format Track: The track specified by the task file is formatted with ID and data fields according to the interleave table transferred to the buffer. The interleave table is composed of two bytes per sector as follows: 00, Physical Sector 1, 00, Physical Sector 2, ... 00 ,Physical Sector 17. The table for 2-to-l interleave is: 00,01,00, OA, 00, 02, 00, OB, 00, 03, 00, OC, 00, 04,00,OD,00,05,00,OE,00,06,00,OF,00,07,00,10,00,08, 00, 11,00,09. The data transfer must be 512 bytes even though the table may be only 34 bytes. The sector count register must be loaded with the number of sectors per track before each Format Track command. An interrupt is generated at the completion of the command; the Format Track command supports no error reporting. A bad block may be specified by replacing a 00 table entry with an 80. When switching between drives, a restore command must be executed prior to attempting a format. Read Verify: This command is similar to to a Read command except that no data is sent to the host. This allows the system to verify the integrity of the fixed disk drive. A single interrupt is generated upon completion of the command or in the event of an error. Diagnose: This command causes the adapter to execute its self-test code and return the results to the error register. An interrupt is generated at the completion of this command. Set Parameters: This command sets up the drive parameters (maximum number of heads and sectors per track). The drive/head register specifies the drive affected. The sector count Fixed Disk and Diskette Adapter 9 and drive/head registers must be set up before this command is issued. The adapter uses the values specified for track and cylinder crossing during multi-sector operations. An interrupt is generated at the completion of this command. This command must be issued before any multi-sector operations are attempted. The adapter supports two fixed disk drives with different characteristics, as defined by this command. Miscellaneous Information The following is miscellaneous information about the fixed disk drive function. • The adapter performs normal read/write operations on a data field only after a successful match of that sector's ID with the targeted ID. • ID fields are checked for errors when read from the disk. • The adapter supports only ECC on data fields and only CRC on ID fields. The CRC polynomial is X16 + X12 + X5 + 1; the ECC polynomial is X32 + X28 + X26 + X19 + X17 + XI0 + X6 + X2 + 1. All shift registers are preset to hex F before calculating the checksums, which begin with the respective address marks. Diskette Function The 5-1/4 inch diskette drive function is an integral part of the IBM Personal Computer AT Fixed Disk and Diskette Drive Adapter. One or two diskette drives are attached to the adapter through an internal, daisy-chained, flat cable. The attachment will support 160K.-, 320K.-, and 1.2M.-byte diskette drives. The adapter is designed for a double-density, MFM-coded, diskette drive and uses write precompensation with an analog circuit for clock and data recovery. The diskette-drive parameters are programmable, and the diskette drive's write-protect feature is supported. The adapter is buffered on the I/O bus and uses the 10 Fixed Disk and Diskette Adapter system board's direct memory access (DMA) for record data transfers. An interrupt level also is used to indicate when an operation is complete and that a status condition requires microprocessor attention. Digital Output Register (Hex 3F2) The digital output register (DOR) is an output-only register used to control drive motors, drive selection, and feature enable. All bits are cleared by the I/O interface reset line. The bit definitions follow. Bit 7 Reserved Bit 6 Reserved Bit 5 Drive B Motor Enable Bit 4 Drive A Motor Enable Bit 3 Enable Diskette Interrupts and DMA Bit 2 Diskette Function Reset Bit 1 Reserved Bit 0 Drive Select-A 0 on this bit indicates that drive A is selected. Note: A channel reset clears all bits. Digital Input Register The digital input register is an 8-bit, read- only register used for diagnostic purposes. The following are bit definitions for this register. Bit 7 Diskette Change Bit 6 Write Gate Fixed Disk and Diskette Adapter 11 Bit 5 Head Select 3/Reduced Write Current Bit 4 Head Select 2 Bit 3 Head Select 1 Bit 2 Head Select 0 Bit 1 Drive Select 1 Bit 0 Drive Select 0 Note: Bits 0 through 6 apply to the currently selected fixed disk drive. Data Rates The diskette function will support three data rates: 250,000, 300,000 and 500,000 bits per second. The 300,000-and 500,000-bps incoming data pulse widths will be those associated with a 500,000-bps data signal. Diskette Controller The diskette controller has two registers to which the main system processor has access: a status register and a data register. The 8-bit status register has the status information about the diskette and may be accessed at any time. The 8-bit data register (hex 3F5), which actually consists of several registers in a stack with only one register presented to the data bus at a time, stores data, commands, and parameters, and provides diskette-drive status information. Data bytes are read from or written to the data register in order to program or obtain results after a particular command. The main status register may only be read and is used to facilitate the transfer of data between the processor and diskette controller. The bits in the main status register (hex 34F) are defined as follows: 12 Fixed Disk and Diskette Adapter Bit 7 Request for Master (RQM)- The data register is ready to send or receive data to or from the processor. Bit 6 Data Input/Output (DIO)-The direction of data transfer between the diskette controller and the processor. If this bit is aI, transfer is from the diskette controller's data register to the processor; if it is a 0, the opposite is true. Bit 5 Non-DMA Mode (NDM)-The diskette controller is in the non-DMA mode. Bit 4 Diskette Controller Busy (CB)- A Read or Write command is being executed. Bit 3 Reserved Bit 2 Reserved Bit 1 Diskette Drive B Busy (DBB)- Diskette drive B is in the seek mode. Bit 0 Diskette Drive A Busy (DAB)- Diskette drive A is in the seek mode. The diskette controller can perform 11 different commands. Each command is initiated by a multibyte transfer from the processor, and the result after execution of the command may also be a multibyte transfer back to the processor. Because of this multibyte interchange of information between the diskette controller and the processor, each command can be considered to consist of three phases: Command Phase: The processor issues a sequence of Write commands to the diskette controller that direct the controller to perform a specific operation. Execution Phase: The diskette controller performs the specified operation Fixed Disk and Diskette Adapter 13 Result Phase: After completion of the operation, status and other housekeeping information is made available to the processor through a sequence of Read commands to the processor. Diskette Controller Commands The following is a list of commands that may be issued to the diskette controller. • Read Data • Format a Track • Scan Equal • Scan Low or Equal • Scan High or Equal • Recalibrate • Sense Interrupt Status • Specify • Sense Drive Status • Seek • Invalid Symbol Descriptions The following are descriptions of the symbols used in the "Command Definitions" later in this section. AO Address Line O-A 0 selects the main status register, and a 1 selects the data register. C Cylinder Number-Contains the current or selected cylinder number in binary notation. 14 Fixed Disk and Diskette Adapter D Data-Contains the data pattern to be written to a sector. D7-DO Data Bus-An 8-bit data bus in which D7 is the most-significant bit and DO is the least- significant. DTL Data Length-When N is 00, DTL is the data length to be read from or written to a sector. EOT End of Track-The final sector number on a cylinder. GPL Gap Length-The length of gap 3 (spacing between sectors excluding the VCO synchronous field). H Head Address-The head number, either 0 or 1, as specified in the ID field. HD Head-The selected head number, 0 or 1. (H = HD in all command words.) HLT Head Load Time-The head load time in the selected drive (2 to 256 milliseconds in 2- millisecond increments for the 1. 2M -byte drive and 4 to 512 milliseconds in 4 millisecond increments for the 320K-byte drive ). HUT Head Unload Time-The head unload time after a read or write operation (0 to 240 milliseconds in 16-millisecond increments for the l.2M-byte drive and 0 to 480 milliseconds in 32- millisecond increments for the 320K-byte drive. MF FM or MFM Mode-A 0 selects FM mode and a 1 selects MFM (MFM is selected only if it is implemented. ) MT Multitrack-A 1 selects multitrack operation. (Both HDO and HD 1 will be read or written.) N Number-The number of data bytes written in a sector. NCN New Cylinder-The new cylinder number for a seek operation Fixed Disk and Diskette Adapter 15 ND Non-Data Mode- This indicates an operation in the non-data mode. PCN Present Cylinder Number-The cylinder number at the completion of a Sense interrupt status command (present position of the head). R Record-The sector number to be read or written. R/W Read/Write-This stands for either a signal. SC Sector-The number of sectors per cylinder. SK Skip-This stands for skip deleted-data address mark. SRT This 4 bit byte indicates the stepping rate for the diskette drive as follows: I read or write I I I 1.2M-Byte Diskette Drive 1111 1 millisecond 1110 2 milliseconds 1101 3 milliseconds 320K-Byte Diskette Drive 1111 2 milliseconds 1110 4 milliseconds 1101 6 milliseconds ST O-ST 1 Status O-Status 3-0ne of the four registers that stores status information after a command is executed. STP Scan Test-If STP is 1, the data in contiguous sectors is compared with the data sent by the processor during a scan operation. If STP is 2, then alternate sections are read and compared. USO-US1 Unit Select-The selected driver number encoded the same as bits 0 and 1 of the digital output register (DOR). 16 Fixed Disk and Diskette Adapter Controller Commands The following are commands that may be issued to the controller. Note: An X is used to indicate a don't-care condition. Read Data Command Phase: The following bytes are issued by the processor in the command phase: MT MF SK 0 0 X X X X 1 X HD 1 0 USl USO C H R N EOT GPL DTL Result Phase: The following bytes are issued by the controller in the result phase: Fixed Disk and Diskette Adapter 17 STa STl ST2 C H R N Format a Track Command Phase: The following bytes are issued by the processor in the command phase: a MF a a } 1 x x a a x x X HD US} usa N SC GPL o Result Phase: The following bytes are issued by the controller in the result phase: 18 Fixed Disk and Diskette Adapter STO STl ST2 c H R N Scan Equal Command Phase: The following bytes are issued by the processor in the command phase: MT MF SK 1 0 0 X X X X X 0 HD USl 1 usa c H R N EOT GPL STP Result Phase: The following bytes are issued by the controller in the result phase: Fixed Disk and Diskette Adapter 19 STO STl ST2 c H R N Scan Low or Equal Command Phase: The following bytes are issued by the processor in the command phase: MT MF SK 1 1 0 0 1 X HD USI usa X X X X c H R N EOT GPL STP Result Phase: The following bytes are issued by the controller in the result phase: 20 Fixed Disk and Diskette Adapter STO STl ST2 C H R N Scan High or Equal Command Phase: The following bytes are issued by the processor in the command phase: MT MF SK 1 1 1 X X X X X HD 0 1 USl USO C H R N EOT GPL STP Result Phase: The following bytes are issued by the controller in the result phase: Fixed Disk and Diskette Adapter 21 STO STl ST2 C H R N Recalibrate Command Phase: The following bytes are issued by the processor in the command phase: 00000111 x X X X X 0 US1 usa Result Phase: This command has no result phase. Sense Interrupt Status Command Phase: The following bytes are issued by the processor in the command phase: 0000100 0 Result Phase: The following bytes are issued by the controller in the result phase: 22 Fixed Disk and Diskette Adapter STa peN Specify Command Phase: The following bytes are issued by the processor in the command phase: o a a a a a } } SRT )( HUT HLT NO Result Phase: This command has no result phase. Sense Driver Status Command Phase: The following bytes are issued by the processor in the command phase: a a a a 0 a } x x x x X HO US} a usa Result Phase: The following bytes are issued by the controller in the result phase: s13 Seek Command Phase: The following bytes are issued by the processor in the command phase: Fixed Disk and Diskette Adapter 23 a a a all x x x x X HD 1 1 USl usa NCN Result Phase: This command has no result phase. Invalid Command Phase: The following bytes are issued by the processor in the command phase: Invalid Codes x X X X X HD USl usa Result Phase: The following bytes are issued by the controller in the result phase: STa Command Status Registers The following is information about the command status registers STO through ST3. Command Status Register 0 (STO) The following are bit definitions for command status register O. Bit 7-Bit 6 Interrupt Code (IC) 00 Normal Termination of Command (NT)-The command was completed and properly executed. 24 Fixed Disk and Diskette Adapter 01 Abrupt Termination of Command (AT)-The execution of the command was started but not successfully completed. 10 Invalid Command Issue (IC)-The issued command was never started. 11 Abnormal termination because, during the execution of a command, the ready signal from the diskette drive changed state. I I Bit 5 Seek End (SE)-Set to 1 when the controller completes the Seek command. Bit 4 Equipment Check (EC)-Set if a fault signal is received from the diskette drive, or if the track-O signal fails to occur after 77 step pulses (Recalibrate Command). I I I I Bit 3 Not Ready (NR)-This flag is set when the diskette drive is in the not-ready state and a Read or Write command is issued. It is also set if a Read or Write command is issued to side 1 of a single-sided diskette drive. Bit 2 Head Address (HD )-Indicates the state of the head at interrupt. Bit 1-Bit 0 Unit select 1 and 2 (US 1 and 2)-Indicate a drive's unit number at interrupt. Command Status Register 1 (STl) The following are bit definitions for command status register 1. Bit 7 End of Cylinder (EC)-Set when the controller tries to gain access to a sector beyond the final sector of a cylinder. Bit 6 Not Used-Always O. Fixed Disk and Diskette Adapter 25 Bit 5 Data Error (DE)-Set when the controller detects a CRC error in either the ID field or the data field. Bit 4 Overrun (OR)-Set if the controller is not serviced by the main system within a certain time limit during data transfers. Bit 3 Not Used-This bit is always set to O. Bit 2 No Data (ND)-Set if the controller cannot find the sector specified in the ID register during the execution of a Read Data, Write Deleted Data, or Scan Command. This flag is also set if the controller cannot read the ID field without an error during the execution of a Read ID command or if the starting sector cannot be found during the execution of a Read Cylinder commnd. Bit 1 Not Writable (NW)-Set if the controller detects a write-protect signal from the diskette drive during execution of a Write Data, Write Deleted Data, or Format Cylinder command. I Bit 0 I Missing Address Mark (MA)-Set if the controller cannot detect the ID address mark. At the same time, the MD of status register 2 is set. Command Status Register 2 (ST2) Bit 7 Not Used-Always O. Bit 6 Control Mark (CM)-This flag is set if the controller encounters a sector that has a deleted data-address mark during execution of a Read Data or Scan command. Bit 5 Data Error in Data Field (DD)-Set if the controller detects an error in the data. 26 Fixed Disk and Diskette Adapter Bit 4 Wrong Cylinder (WC)-This flag is related to ND (no data) and when the contents of C on the medium are different from that stored in the ID register, this flag is set. Bit 3 Scan Equal Hit (SH)-Set if the contiguous sector data equals the processor data during the execution of a Scan command. Bit 2 Scan Not Satisfied (SN)-Set if the controller cannot find a sector on the cylinder that meets the condition during a Scan command. Bit 1 Bad Cylinder (BC)-Related to ND; when the contents of C on the medium are different from that stored in the ID register, and the contents of C is FF, this flag is set. Bit 0 Missing Address Mark in Data Field (MD)- Set if the controller cannot find a data address mark or a deleted data address mark when data is read from the medium. Command Status Register 3 (ST3) The following are bit definitions for command status register 3. Bit 7 Fault (FT)-Status of the fault signal from the diskette drive. Bit 6 Write Protect (WP)-Status of the I write-protect I signal from the diskette drive. Bit 5 Ready (RY)-Status of the the diskette drive. Bit 4 Track 0 (TO)-Status of the from the diskette drive. Bit 3 Two Side (TS)-Status of the from the diskette drive. I I I ready signal from I I track 0 signal I I two side signal I Fixed Disk and Diskette Adapter 27 Bit 2 Head Address (HD )-Status of the I side-select I signal from the diskette drive. Bit 1 Unit Select 1 (US I)-Status of the unit-select-l signal from the diskette drive. I I Unit Select 0 (US O)-Status of the signal from the diskette drive. Bit 0 o I unit select I Interfaces The system interface is through the I/O channel. The address, DMA, and interrupt assignments are shown in the following figures. I/O Address Primary Secondary 3F2 3F4 3F5 3F6 3F7 372 374 375 376 377 Read Write Main status register Diskette data register Digital input register Digital output register Main status register Diskette data register Fixed disk register Diskette control register Diskette Function Note: DMA request is level 2 and interrupt request is level 6. I/O) ddress Primary Secondary 1 FO 1 F1 1 F2 1 F3 1 F4 1 F5 1 F6 1 F7 170 171 172 173 174 175 176 177 Read Data register Error register Sector count Sector number Cylinder low Cylinder high Drive/head register Status reoister Fixed Disk Function Note: Interrupt request is level 14. 28 Fixed Disk and Diskette Adapter Write Data register Write precomp Sector count Sector number Cylinder low Cylinder high Drive/head register Command reQister The following operations are supported by this adapter: • 16 bit programmed I/O (PIO), data transfers to the fixed disk. All other transfers must be 8 bits wide. • The I/O addresses, recognized by the adapter for either the fixed disk or the diskette function, are independently selected by jumpers. Fixed Disk and Diskette Adapter 29 Interface Lines The interface to the fixed disk drive consists of two cables: 'control' and 'data'. The following figures show signals and pin assignments for these cables. 30 Fixed Disk and Diskette Adapter 2 34 - ~ Ground - Odd Numbers _ - Reduced Write Current/- Head Select 3 - 2 _ - Head Select 2 - 4 _ - Write Gate 6 - Seek Complete - - Track 000 10_ - Write Fault 12.. - - 14 Reserved 16 _ - Head Select 1 18 - -Index 20_ - Ready 22_ _ - Step - - - Drive Select 1 -: - Drive Select 2 28 Reserved 30 Reserved 32 - __ - Direction In Fix ed Disk And Diskette Ada pter - 24 - 8_ __ - Head Select 0 - Fixed Dis k Drive 1-33 26 34 '--- Note: Connection is through a 2-by-17 Berg connector. Pin 15 is reserved to polarize the connector. Fixed Disk and Diskette Adapter 31 1 2 c::=:J c:J c=J .. [::J c:Jc:::::::JC::::J c=.::J 19 20 - - Fixed Disk Drive + MFM Write Data 13 - MFM Write Data 14 + MFM Read Data 17 - MFM Read Data 18 Ground-Pins Fixe d Disk And Diskette Ada pter 2.4,6,11,12,15,16,19,20 All Other Pins Unused - - Note: Connection is through a 2-by-lO Berg connector. Pin 8 is reserved to polarize the connector. The interface to the diskette drives is a single cable that carries both data and control signals. The signals and pin assignments as follows. 32 Fixed Disk and Diskette Adapter 1 2 - r-- Ground - Odd Numbers --... ---... - Diskette Drive Reduced Write 2 Reserved 4 Drive Select 3 6 Index 8 .. - Drive Select 0 10 Drive Select 1 12 Drive Select 2 14 Motor On 16 --- Direction Select 18 Step 20 Write Data 22 - Write Gate 24 Track 00 26 .. Write Protect 28 .. Read Data 30 .. Side 1 Select 32 Diskette Change 34 .. ... ------ -- 1-33 Fixe d Disk And Diskette Ada pter - Note: Connection is through a 2-by-17 Berg connector. Pin 5 is reserved to polarize the connector. Fixed Disk and Diskette Adapter 33 Notes: 34 Fixed Disk and Diskette Adapter Logic Diagrams -------------------------1 I I ~I 31 :, ~I ~I I I 05' o r----------- I I I I I I I ------, I L ____________________ _ ~------------~ ~r--l_ I I ..,1 ... r------'_ ~~,,~ : i: ~, ~l I ., ~I I 1... 2 ~~ I ___________ JI 5~ ~ H' ~ ;; I~ !i ~ !! = ~ ~ ~ ~ " Fixed Disk and Diskette Adapter 3S ,-----~------------------, I I I I I -.. ii) o I I C'I I I Q) Q) L _________ _ L-~----~~--------------_, .c I ~ ..... Q) Q. I'G "C ---------~-------------------- I « Q) ::::Q) .¥. III ,. I;'" C ,. I~ I~ :" Pi{3> :-~ ,........ I __ ______ - __ - ______ I : 1 I L _______ ...J "C C I'G .¥. III C "C Q) )( ii: 36 Fixed Disk and Diskette Adapter -co.. o C') Q) Q) .s: -..... U) I -• e ,. s ~ "~ ~ - I ~ ~: O-<~~-f'_'++----; L_~~_..J ~ -- , ~ " " I~ - Q) , ~ ~ - Q. aI " .- "0 « Q) i ..\I: til C "0 r::: aI ..\I: til C "0 = u:: Fixed Disk and Diskette Adapter 37 - -.. to 0 o;t CD CD .c ~ .. "- CD Q. 1\1 'tl < u: ~ 38 Fixed Disk and Diskette Adapter , 5~ c ~ :: '" ":: :e ~~ " :: -[ ~r .!: :!: '" ~ I::; ~ - - ",W CX) o 11 10 ....Q) ~ ~ :~ g ~ ~ ~ ~ ::~II ~ ~~ IO:~ ~ = ~ ~ ~ ~ _ ~ ~ ~ r! ( ,. " '1 :1 - '" :> ,. :; ~~::::il::~:::n:~ ~ ~ i~ ~ ~~~ 2- .,. .,. CP s::. ~ ...CP Q. CO "0 -_-_.._-_-..J...E...---1 I ! 40 Fixed Disk and Diskette Adapter ~ ~ Q ~ " ~ ~ ~ ~ ~ ~~< u:: Fixed Disk and Diskette Adapter 41 , , = " = ;,; ~ , ;; . N ~ l " " - ; FO ;;; 11 i =- ~ 11 i = r----I 1 I I' ::: ;: = =:: : I I ~m-mni I I "L I I I __ "___ J 42 Fixed Disk and Diskette Adapter

  • 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
    Producer                        : Adobe Acrobat 9.2 Paper Capture Plug-in
    Modify Date                     : 2009:12:31 09:32:31-08:00
    Create Date                     : 2009:12:31 09:32:31-08:00
    Metadata Date                   : 2009:12:31 09:32:31-08:00
    Format                          : application/pdf
    Document ID                     : uuid:8b34168a-ad14-43ae-9196-f1232af69636
    Instance ID                     : uuid:899145e6-434e-4948-a889-a12b5fdb78c7
    Page Layout                     : SinglePage
    Page Mode                       : UseNone
    Page Count                      : 644
    
    EXIF Metadata provided by EXIF.tools

    Navigation menu