You are on page 1of 644

,.....

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

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 ............................ SECTION 3. POWER SUPPLY ...................... Inputs ...................................... Outputs ..................................... Output Protection ............................. Dummy Load ................................ Output Voltage Sequencing ..................... No-Load Operation ........................... Power-Good Signal ............................ 2-1 2-3 2-3 2-4 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:

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 16 INTERRUPT LEVELS 7 CHANNEL DMA CMOS 80287 COPROCESSOR ROM RAM REAL-TIME CLOCK OSCILLATOR SPEAKER CONNECTOR KEYBOARD CONTROLLER BATTERY CONNECTOR

---1

POWER SUPPLY 115/230 SPEAKER KEYBOARD

-H

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 ROM Subsystem RAM Subsystem ........................... 1-10

1-11 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 ............................
Specifications ................................... System Unit .................................. Size ..................................... Weight ................................... Power Cables .............................. Environment .............................. Heat Output ............................... Noise Level ............................... Electrical ................................. Connectors .................................. Logic Diagrams ...............................

1-38 1-38 1-39 1-40 1-40 1-43 1-45 1-45 1-48 1-54
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

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 24000 5.3%

4 ms/167 ns

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 000000 to 07FFFF 080000 to 09FFFF

Name 512Kb system board 128Kb

Function System board memory

I/O channel memory - IBM Personal Computer AT 128KB Memory Expansion Option Reserved for graphics display buffer

OAOOOOto OBFFFF OCOOOO to ODFFFF OEOOOO to OEFFFF OFOOOO to OFFFFF 100000 to FDFFFF

128Kb video RAM 128Kb I/O expansion ROM 64Kb Reserved on system board 64Kb ROM on the system board Maximum memory 15Mb

Reserved for ROM on I/O adapters

Duplicated code assignment at address FEOOOO Duplicated code assignment at address FFOOOO I/O channel memory - IBM Personal Computer AT 512KB Memory Expansion Option Duplicated code assignment at address OEOOOO Duplicated code assignment at address OFOOOO

FEOOOOto FEFFFF FFOOOOto FFFFFF

64Kb Reserved on system board 64Kb ROM on the svstem board

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 GATE 0 CLK IN 0 CLK OUT 0 Channel 1 System Timer Tied on 1.190 MHz OSC 8259A IRQ 0 Refresh Request Generator

1-8 System Board

GATE 1
CLKIN 1

Tied on 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
GATE 2
CLKIN 2

Tone Generation for Speaker

Controlled by bit 0 of port hex 61 PPI bit 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 D Clock Clear

o Refresh Requesl

System Bus

.
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 Clock Out 0 Clock Out I Clock Oul 2 To 8259A IRO 0

-----

AND

Driver

I
Low ~To Speaker Pass Filler

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

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 MicroProcessor NMI 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

Function Parity or I/O Channel Check

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.
8237A-5 A16<---------->A1

Source Address

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 OCO OC2 OC4 OC6 OC8 DCA OCC OCE 000 002 004 006 008 ODA DOC ODE Command Codes CHO CHO CH 1 CH 1 CH2 CH2 CH3 CH3 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

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

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

I
I I I I I I I I I I I I I I I
I

Al

Bl0

I I
I I I I I I I I

Al0

I I I I I I I I I I I I I I
LI-

B20

I I I I I I I I I I I

A20

B31

I
L....

A31 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

- I I I I I I I I I

r-

I I I I I I I I I I I I I I I I I I

C1

OlD

I I I I I I I I

C10

D18

I
L......
~

'-

C18

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

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. The following figure is an I/O address map.
Hex Range
000-01F 020-03F 040-05F 060-06F 070-07F 080-09F OAO-OBF OCO-ODF OFO OF1 OF8-0FF 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

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
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. An 8-bit Out command to port FI will reset the Math Coprocessor. The data output should be zero.

OFt

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

Scan-Code Translation Table

1-34 System Board

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

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

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

7A 70 71 7F or 84

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

(Part 2 of 2)

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

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

Scan-Code Translation Table

1-36 System Board

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
Data Bus

U
T
f---~p

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

~----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. Input Buffer Full-A 0 indicates that the keyboard controller's input buffer (II 0 address hex 60 or 64) is

Bit 1

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

Bit 3

Bit 4

Bit S

Bit 6

Bit 7

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

60

Reserved-Should be written to a O. 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. 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 4

Bit 3 Bit 2

Inhibit Override-Writing a 1 to this bit disables the keyboard inhibit function. System Flag-The value written to this bit is placed in the system flag bit of the controller's status register. Reserved-Should be written to a O. 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.

Bit 1 Bit 0

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. 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 01 02 03 No error detected. The keyboard clock line is stuck low.
I I

AB

The I keyboard clock I line is stuck high. The keyboard data line is stuck low.
I I

System Board 1-41

04 AC

The keyboard data line is stuck high.


I I

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. 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. Enable Keyboard Interface-This command clears bit 4 of the command byte, which releases the keyboard interface. 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. 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. 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.

AD

AE

CO

DO

Dl

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

Bit 5

Bit 6

Bit 7

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 00-00 Description

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

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


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

Bit 6-Bit 4

Bit 3-Bit 0

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. 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. Alarm Interrupt Enable (AIE)-A 1 enables the alarm interrupt, and a 0 disables it. The system initializes this bit to O. Update-Ended Interrupt Enabled (UIE)-A 1 enables the update-ended interrupt, and a 0 disables it. The system initializes this bit to O. 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. 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. 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.

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 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, I I , I I

Bit 3-Bit 0 Register D Bit 7

Reserved

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

Bits 6-Bit 0

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

Bit 5

o of the equipment byte set to 1).

At least one diskette drive to be installed (bit

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. 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. " Time Status Indicator-(POST validity check) A o indicates that the time is valid and a 1 indicates that the time is invalid. Reserved

Bit 3

Bit 2

Bit 1-Bit 0

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 0001 0010 No drive is present. Double Sided Diskette Drive (48 TPI) High Capacity Diskette Drive (96 TPI) Note: 0011 through 1111 are reserved.

Bit 3-Bit 0

Type of second diskette drive installed: 0000 0001 0010 No drive is present. Double Sided Diskette Drive (48 TPI) High Capacity Diskette Drive (96 TPI) Note: 0011 through 1111 are reserved.

Hex address 11 contains a reserved byte.

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 No fixed disk drive is present.

1-50 System Board

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 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Cylinders Heads 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

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

BIOS Fixed Disk Parameters

Hex address 13 contains a reserved byte.

Equipment Byte (Hex 14)


Bit 7-Bit 6 Indicates the number of diskette drives installed: 00 01 10 11 Bit 5-Bit 4 1 drive 2 drives Reserved Reserved

Primary display 00 Reserved

System Board 1-51

01

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

10

11 Bit 3-Bit 2 Bit 1

Not used. Math Coprocessor presence bit:

o
1 Bit 0

Math Coprocessor not installed. 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 Bit 7-Bit 0 Address hex 15-Low-byte base size Address hex 16-High-byte base size Valid Sizes: Ol 000 02000 02800 256Kb system-board RAM 512Kb system-board RAM 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 Bit 7-Bit 0 Address hex 17-Low-byte expansion size Address hex 18-High-byte expansion size Valid Sizes: 0200H 0400H 600H to 3COOH 15360Kb I/O adapter (15Mb maximum) Hex addresses 19 through 2D are reserved. 512Kb I/O adapter 1024Kb I/O adapter (2 adapters) 1536Kb I/O adapter (3 adapters)

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 Bit 7-Bit 0 Address hex 30-Low-byte expansion size Address hex 31-High-byte expansion size Valid Sizes: 0200H 0400H 512Kb I/O adapter 1024Kb I/O adapter

System Board 1-53

0600H to

1536Kb I/O adapter

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 Bit 6 Bit 5-Bit 0 Set if the IBM Personal Computer AT 128KB Memory Expansion Option is installed. This bit is used by the Setup utility to put out a first user message after initial setup. 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
Function Data out Key Ground +5Vdc

2 3 4

Speaker Connector (J19)

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

System Board 1-57

Pin 1 2

Assi~mments

Connector

3 4 5 6
1 2

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

PS8

3
4 5 6

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 1 2
Assi~mments

3 4 5

Keyboard clock Keyboard data Spare Ground +5Vdc

Keyboard Connector (J22)

The power LED and keylock connector is a 5-pin Berg strip. Its pin assignments follow:
Pin 1 Assignments 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

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


,1
I/O
CHANNEL CONNECTORS
VARIABLE

I;

~"

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


r';

Ii '18'

~IJrn ~

riI1

IJ

--

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

nri

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


JUMPER CONNECTOR

mmrnmrnmmrnrn ~ mmmmmm

00[J DUu0 ~ 0uru [J


~~~~~6~g~K

System Board Layout

1-60 System Board

Logic Diagrams

'"

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

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

~ fg\
'~

:f~
"
-

01

" "

~
,~ ~

I(;

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

N
0
~

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

,
-

...
tn
"0

CD J:

.... CD

0 In
CD ....
,J

co

E
II)

>tn

~~

~~~ ~

L...".
~~
S'i?
\'?!!?

~
~

"'M~"
>2!:'!
!2~\,!~

j:5:5:'i

~
~

~iii

~U:;-iii;t;
III:!:
'1~~\'!

--

"
~

System Board 1-61

..
N
~

(SHTI) (SHT3)

- RESET

82286

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

~ lI.l

rJ'1
~

a
= e;
0

(SHT6) (SHTl)

(MOLY

SO

~9

(SHTI)
(SHT 1)

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

"

CMOLY

'" r
" ,

RN') -It>

'"

'" '"
- MEMR ISHT 10,15,19.20
(SHT6,7,15,19) - MEMW

FiEAD~

PRO(ClK M/W

lftArjy

"

-lOR

(SHT6,15,20)

CPU HLDA

-(NTL OFF

.,

~CENLLJfn
15 MB

:8

~?~o

12

-lew
-INTA

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

t1t==J.

16

20

=-

(SHT3)

.Oi~;F; f

vee

AEN/CEN

DrIR

110

,
~U<;l7

(SHT 15)

'~~'
ALSO"
II 107

ALSO"

I?L

'"
12

FlO

J
I t CA'
,
7
SA' A

12

I-JeLl(

tk'
o US)
(LR
Q

(SHTel

" .,

(SHT 13) (SHT4)

XAO LSAO

1::::: "

, " , "
22

LSb't6

DJR

CBA seA

(SHTI)

j
(SHT I)
(SHT 1)

" " " "


Ol

00

06
~

D7

II~

!
DfR
A A A A A

A A

Ub7

, , ,

20

I
ALSZ"')

, " , " , "

SOD so, SOl SD3

(SHT 6,13.20)

, , " , "

so.
50< 506
SD7

(SHT6,13.20)
(SHT 7,10)

-)(8HE

I~
08

, '
, , , 7

(SHTI)

DO
010

D"

DI2 DI<

'"

, , :
,
:~

.
"D
U<l7

Ub6

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


0

~g~
SDIO

(SHT 6,13,19)

5011
SDI2
SOI~

12

5014
SDI'3

(SHT6,13.19)

DTiR
LSAO LSAQ

,
-

~~--

---

---

System Board (Sheet 2 of 22)

(SHT 11

-RESET PALlbL8A

RESE-

'A)
-XIOIoi

,AD

,
7 B
g
)

SM/W

" "
18
10 20
UI"3Q

"

--

-(5287 - INTA - BUSy -ERROR

--

"

.,
" R"

-NPCS -BUSY ZBb

IRGlI':!

2
1

.,
ENAS

(SHT 4, 1 C.12, 15,

21,22)

DMAC LK

(SHT 14, lSI


(SHT21)

(SHT 1)

R22 )0 R2I )0
(SHT 1)

EN AS (SHT 20)

(SHT 20.21 ,22)

(SHT 12)

-lbMHZ

"

",0

"

(SHT2,12)

R)4 )0
(SHT 1 7)

ISHT 17)

+ ENA 10 (K

iSHT 17)

Rll )0

ISHT 17)

(SHT 20)

- 10 (H (j(
_~<;I

00 '<

(SHT 10)

:4-

-PC~

{SHT 1\

l= ....
I Q'\

(SHT 13)
(SHT 18)

XD7

CPU HLDA
+AC~

GATE ALE +RESET

~~~~'iA"S2""'i~~~~~~
17
II Itj

A
A

Y '1 y

Y ~

BALE'"
RESET DRV

AEN

G U7':i

System Board (Sheet 3 of 22)

l NOI133S

--~'.i:

~~
~~

( 'II ('II

o v
.c ~

iII)

<i.

oooooooot..;>~

<i.

oooooook,l~

-t

000000 0

k:>1~

'E

o m
E
II)

IV

~
UI

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

Q::"''''~\!: :!'! ~ <c<c:i<:i"':-t

~~~~;;S

!i18~

"'~~
~

"

-~~~ ~~~

"---~ "

~-i

...
;:-;:-;n

~;:~~

" "

"

1-64 System Board

(SHT4)

(ST
(SHT1) (SHT21)

.., '"
AZI AZO AI, AlB AI7
+REFRESH

:~ ~ =-!'~il__'-~~1C~-IlIi"B'S'"'C-il l'
7 A&

DO 6

+RRASO

ALS')H

~!~

g~

+RCASO !RRAS2
-RCASr

I AI

Oil)

g '+g 0
~D
0

g l'i
Q

,)b/~12K

~ IO~
JIB

11f~

AD

06

-11

CS

Q 12 Q 14
01)

gIB~~~~~~~~~~
~
AL.SOQ

+RAM +RAM +RAM +RAN

0 I 2 ,

RAS RAS RAS RAS

(SHT 71 (SHT 7) (SHT 7) (SHT 7)

D71+

1 2

U72

II~OE'

-RAM 0 CAS -RAM I CAS -LI1EG CS +FSYS 16

(SHT 6,7) (SHT6,7)


(SHTl)

(SHlel

UbI!

RNI+-IO

'='

RA I JUMPER
(SHT 17) -RAM SEL. (SHT 19) - MEM CS 16

.,

I~

+RAH SEL

(SHT1O)

~U'~~'----~----------------------------------'i ALS12

(SHIel

(SHT3) (SHT2)

HLDA

ALE --------------------------~,Wua~~'--_t--------------~~-----------------------------------------------------

GATE ALE

(SHT3)

ALS21f'i SAl

q
1
')

B II

'T'
(SHT4)

SA' SA' 5 .. 5" SAO


SA7

If

:
A
A A

:
~

B 16
B 17 B 18

:2 :~

'AI

'" 'AS ''"


'lA7 AO
lAB

'AZ

SAB
-OMAAEN

(SHT1,1',14,15,16) (SHT 1,1',14,'5,'7) (SHT3,1',14,151 (SHT1,11,14,18) (SHT1',13,14) (SHT1',13,14) (SHT 11,13,14) (SHT",13,14)

(SHISI

"

RN't-'i
10K

t :

jU9~

ALS02

l'~ -

I DIR

GR'

(SHT8,15)

f =
U.
~

l 'T'

SAO SAID SAil 5AI2

5.,
S"
50' 50'

~
b

."
u,s

8 H

: A

: 12 B lit

XA. XAIO
XAII XAI2
XAI~

(SHT",13,14) (SHT1',14)

(SHT4)

~ ! ~ :
1
~DIR

: :~
: :Z

XAI4 XAl'i XAlb

(SHT11,14) (SHT",14,15)

-G

System Board (Sheet 5 of 22)

t NOIlJ3S

"'''''''''''''''' ",,,,Sb

--

I I

1-66 System Board

ALSZ"l+

(SHT5) (SHT2) (SHT2)

-LMEGCS -MEMR

~=Tf;4

~Al
AI

YI IB Y2 12

'" 'TRI'

10K

RI2

"
'4

RI,

'00
'CO

A2

u .. q

Rl4

l
Ub'
200 100 ,

- SMEMR - SMEMW

(SHT 20] (SHT 20)

+RAS q

(SHTel

FOO
+ RAS

IOJU90 8

,I
140

TIME DELAY PE21Z 13

120

121 "

10

l
ADDR SEL +CAS
(SHT 8)

ALSO"
(SHT 5)
-RAM 0 CAS

~
: USS 2

,
.2

c; FlO

" USl FlO u']e flO

,
12

R.2

" 10n 11-

-RAS

(SHT8)

UBI

~us;{~B

(SHT 5) (SHT 5)

+RAM 0 RAS +RAM 2RAS

I
ALSO" 1 ual

I~
']

7 ~on I(J

(SHT91

't U']7

(SHT 5)

-RAM I CAS

"

12 FOB Il1 U'>9

,
Z.

,
8

,. ,.onl't

-RAS 1

(SHT81

"

)0

FlO b ,.on l !
-RAS 1

(SHT 5) (SHT5)

+RAM~

+RAI'1I FlAS RAS

)1 U'>7
FlO

,
~

(SHT 9)

ALSO't

'J1 '<
~
~

(SHT 15)

S USI

"
11 't

1 USl FlO

2 10f! IS

(SHT81

U'>7\....i flO

I ~Ofllb

-CAS 0 H

(SHT8)

(SHT2)

-XBHE

51

q U<;:.

') lonl

10
II

-CAS1 L

(SHT9)

== = ...
to)

10 U<;:S\.. S

FlO S 10n 9
-CAS I H

(SHT 9)

Q.
I

....
.....
System Board (Sheet 7 of 22)

--

-XAO

(SHT 10)

Q'I

l NOll:J3S
I

....
a-,
QO
I

(SHT 10)
(SHT 10) (SHT 6)

MOPINO
MOPINI MOO

MD' MD2

Mil'<

MD>

'"'
MCf'lNO
MDD
I Oli'l U4, UI U7 DOUT 14 MDPOUT (SHT 9,10: 1,14 DIN/DOUT

MD6
MD7

Moe
MOO
MOlD
MOil

,p,

1,14
1,14

a.

3 t:cI o

MDll MOil
MOl4
(SHT 6) MOl'>

DIN/DOUT

,02

:r
5"

"" "" MDO


MDb MOJ MAD MAl MAZ MA> M" MAS MAb MA7

1,14
1,14

m
Uz> U28

"'

1.1"1
1,14 1,14
5

(SHT 4)

SA8

ISHT 21) -REFRESH

ISHT 4) SA(! (SHT2t) +REFRESH

~'I
-WE

DIN/DOUT
t<J

""

(SHT 22)

:6 11
, 2

Ii :~ H
Ab A7 WE

U,q

SANK 0

FI'5e

ISHr
(SHT 4) (SHT 7)

5 2A

m
SA>

14 1A 2 IA

Y2

5"
SAID
SAil 5AI2

SA'

" , lB ,
'D

~~

~2
4

,
7
2

l~14 MAO 10 MAl

'"

WE -RAsa
-CA L
A

,
I'>

RAS
(AS

b ::

US"

"

12 MAl MAl >C"


l'j

RASI
(9) 1281(>1; I

I-

18

,-------!'<
5A5

"
"

I
RASI MAO

SEC G

~
7
b 12
II

RASI

FI'iB

II ~A
2A

"r
(SHT51

SA7
SAI~

l't "3A

SAI4 SAle;
SAlb

(SHT 4)

I~ ~: " SEC t------------i G

10

48

U,"

"

"~ ' ~;

,>0" A MA'
b

MA'
MAZ MAO MAO MAb MA7

:~
A2
Ai
A4
SANK I

,on

" HAb I H 'J MA7

""
-WE -RAsa
CASOH

10
I~

A"

A7

At>

DECOUPLING

(AI'S:
BANK:

f'",OLTAGE

I~ ~o
I I" DIN/DOUT

\IE

MD8

U2 U8 U"
U20

I.,
U," U20 U,"

r .,

TO GND

'1-.,O!J.F

, I 9-.IOj.jF!
I
2-

10 IJF : (I,z

.<;2.'i~

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

2-IO .. F

IO~F

(8.12,11,21,2<1.

""Q,4,,48

""
MOil

MOIO

-RASO

-CASOL
-CASOH

MDI2
MDI~

'"1,14 '"1.14

DIN/DOUT

-RASI

MO'
MDI';

'"1.14
1,14

DIN/DOur ,
DIN/Dour

U,",

~.

U44

14

MDPOUTi (SHT9,10'

(<11 128 K Xl

System Board (Sheet 8 of 22)

MDPIN 0 HOD

I IDIN

UL+S

DOUOJ Ilf

liQl
HD2 HD' HD' HD' 1.11t

~
HD7 1,14

~ OIN / DOUT U30


1.11+ DiN / OOUT U;')I

DIN / DOUT UZ';

OlN /OOllT
AD AI

TAD

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

'iii

TA2

.=!!&.1

~!~

""
I I I I I
8ANK 2

=ciST[
(Q)

128K XI

{SHT6}

r(SHT8) HAD MAl MA2

+>

11
i

(SHT6) (SHT 7)

1 MA'
t

" ,

I
",0

'DIN

ULf6

I. PI

DINI DOUr UI+


8ANK

---.!..tIlt 1.11f 1,11+

M. . MA> MA' MA7

~UIO

1
VOLTAGE

DIN / DOUT UI6 DIN/oour U22

17

DECOUPLING CAP: I BANK

IOuF : O,It,'iIt,SS .IOuF: (Q,EI,t8,22,lO


~It,ItO,'+It,1t9

TO GNO

-RAS 1

+S

19-.IDuF I 9-.tOuF

.,.RAS2
-CASIL -CASIH

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

\FJ. '< [Il ~

(SHT7)

lS,III,It'),,;O

= " e;
c.
I ""'" =-~

51

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


(SHT 22)

MDPJN 0 I1DPIN I MDPOIJTO MOPOIJTI - TWE

(9)

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~

~~

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

= -

C'II C'II

'0 o ....

..
en
'2
o
ID

.c

.
CD

.I J.I J

.!

1-70 System Board

f~9
5 "

."

vIC

'!:

rt~O ~g::o~dde

'Cr'o
~.~---

I
I
!

C\I C\I

.......

,... ,...

~
"
w

CP CP .c::

"
w

,3

'C
I

I
I
I

... ca
o
CP
11)

ID

"
on
v

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

.(~ T"
"

.-

.. muow LL"':t:_

[J" m
"

I
Ii
I
I

;;;
E

l
I

~
0

System Board 1-71

"-

"

" "-

" ~

. ..

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

t=

'---:=:J-

-' m-.

:l ~

~~
~

"

" "-

"-

"

N "~ ~

"

" " "- ~

"-

'"

, "
"-

1-72 System Board

(SHT 6)

DIR 24'5

ALSZ4'5
(SHT2)

SOD
501

(SHT 2)

SO, SDl SD' SO, SO.


501

==== ====

SOD
I

~
~4
507

===
-

' 1

A A A A A A A

B" B B B 14 B1
: 1

SD~a

SO,
10

;.;!t.

' , 4

501,
5014

"

12

(SHT 6) GATE 24'5

------;

~ @IR

501'5

Ul0Z

(SHT2)

50s

(SHT2)

SOlO SDII 5DI2


5013

'"

5014 SOI'i

=== ===

=== ===
500 507

,
4
+A(I(

I~ ALSOII
(SHT 3) HLOA
(SHT 191-MASTER

~II
2 ALS27

I
'i

ALSO'!

,-----l CIR
-ACK

. '. "
,
8
' A 4

AL52

It,
B " B 12 B 11 B 14 B " B"
:

XOO XOI
X02

ISH1,4rI6,,,,'8)
(SHT 14,15,16,17,18) (SHT 3,14,15,16,17,18)

XO'

I~

Xo;
XD1

X04

<0.

U II,

" U81

1
U6Z'
1
,

+,6,(1(

(SHT 5) (SHT 5)
(SHT 15) (SHT 3)

XA9 XAS
-XIOR -NPCS
- INTA

~U8Lt

-ACK

(SHT 3) (SHT4,15)

12

ie

(SHT 2)

~04II Ii UI21

~
10

(SHT 5)
(SHT 5) (SHT 5)

X/6
XAb XA7

,,
C

ALSI ;a

,,,
Y1
Y4

YO YI

I;

Ilf

-OMA I CS -INTRles

(SHT 14) (SHT16)


(SHT16)

-TIC -PPI
1

cs

(S

(SHT 18)
(SHT14)

=
~
-..J
~

,
4

'('5
0'. 02B 01
Vb
Y1

10
'
1

-PG REG (S (SHT 15)

-UlTR 2CS (SHT 16)


-DMAzes

L-J.:

CS2B7

(SHT3)

UI 2,

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

...
N N
~

..
CD CD

.c::: ~

'E
o

IV

III

..
CD

E
>-

1/1

t/)

1- 7 4 System Board

~L
0'

~~L.
~~

C'I -

o It) ,..

....

G) G)

.t:.

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


,

~"<~

2-,.e'WI *

!! "EI I'C
III

o
G)

~ttt~~~~=m~

m
trtrtr

~~
;::~ u
~\2.

~"''''

>'l.~'!!.

System Board 1-75

... ..
Cii'
N

CD
CD
II)

"i-

f/)

.c

.,J

1-76 System Board

'8

'"

rn" '~'W mt
J'
~----.----i-l--H-1--l-J-l--l

...
N
N

....
o

,.. "'"
G) G)

.c

ID

'E III o
E
G)

U)

System Board 1-77

ID

'!l

'!l
~

"
" ,

~!?!?
III

!!U!].(,

m
~

...
N

C\I

CXI

.... CD
CD

.c ~

'E
N

~Q

<
1!i1

~~

Itj ~

F"
>
~

In

as o

~
"
000
,~

7ii >t rn

CD

~~~~

~~I~

.... \100'0

'~~I
'---------h

:g

r<

-IJ1~~,tl

g1iHgg~8

::!

:5 2.

~S2~~~e~

;:;

1-78 Svstem Board

011'.., .... O-NII'''

"

~~~~ ~g~~~

--

"~~~~~~~~~~~--~~~~~~

7?r~,~~~~~~~~~~~~~~~~~

o en ..c:::

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

Q) Q)

'E ca
In

E
Q)

'li)

Ii

~m
I I I I

System Board 1-79

=
oc
I

(SHT2)

'< ~
~

rJJ.

(SHT2)
(SHT4}

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

AO. A08 A07 AD.

JI

J2
J' J4 J' J\_ J7 02.
4.7K

ADS
A04

+,

+5
Oil IKO
-I/O (H (K (SHT3) (SHT 12,15,21)

AD' A02
."

a
0

=-

== ~

I
(SHT4) (SHT2) (SHT2) (SHT?) (SHT7) (SHT31 {SHT 10j (SHT14) (SHT3) (SHT3)
(SHT21)

0 A A 8

J8

:ci

SA'

A27 A26
A2'

110 CH ROY

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

SAIO

sm

SAil 511.12

SAIL4 SAI15
SAlb SAI7 SAI8

Ba< 82' BZ. B" B22 B21

IRQ q

(SHT 16)

IRQ "3

IRQ '+ [RG r; IRQ b IRQ 7

(SHT 16)

SAIQ

-lOR -lOW
-5 MEMR

81. B06 BI6

DRQ I DRQ2

-5 MEMW
SYSC L K

""
820

DRG '3

(SHT 14) (SHT 14) (SHT 14) (SHT 1,18)

BI2 BII lTP" PS8 POWEI

PWR GOOD

OSC
TIC

AEN
RESET DRV -REFRESH -DACK I -DACK 2 -DACK '3

B' B27 All B02


B09

+12
-12
G

~ ,
4

~N
-0

-----~
826 81S 828 B08

807
8" 801 810

(SHT 14) (SHT 14) (SHT 14) (SHT3) (SHT 22)

BALE OWS

(X26)

10";,+

+.04M (X24)

BOS

-, i ~
R~
4

~~'~
~

GOOD C C C

BO'

+,

1 1

C DC

"

System Board (Sheet 20 of 22)

c
~

"
~

~ "~
~~

N ('II

"

"

&

.
~

"
L
~'E-

.
~

"
~

System Board 1-81

'a

ID

... m

"

E
CD
I I)

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

'::'~

,
r '!! r

3~
.~~

~ ~

~~

I~
r

'"

rrr

""" ~~~

~M'"
r
00

rrr
WWOO

"'
00

00

1-82 System Board

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) 4 9 19 18 6-7 15-16 19

Approximate Range (Decimal)

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

16 32 64 80 32 64 80

-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 115 Vac Maximum 125 Voltage (Vac) Minimum 100 Current (Amperes) Maximum 5

Minimum 200 230 Vac Maximum 240

Maximum 3.0

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 PS9-1 PS9-2 PS9-3 PS9-4 PS9-5 PS9-6 P10-1 P10-2 P10-3 P10-4 P11-1 P11-2 P11-3 P11-4 P12-1 P12-2 P12-3 P12-4

Voltage (Vdc) Power Good +5 +12 -12 Ground Ground Ground Ground -5 +5 +5 +5 +12 Ground Ground +5 +12 Ground Ground +5 +12 Ground Ground +5

Max. Current (A) See note 3.B 0.7 0.3 0.0 0.0 0.0 0.0 0.3 3.B 3.B 3.B 2.B 0.0 0.0 1.B 2.B 0.0 0.0 1.B 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 .......................... Specifications .............................. Size ..................................... Weight ................................... Keyboard Connector ........................... 4-16 4-17 4-18 4-19 4-20 4-21 4-22 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

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

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

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

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 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Reserved Reserved Reserved Reserved Reserved Caps Lock indicator Numeric Lock indicator 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 I

4-12 Keyboard

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

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

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

clock and data


I I

4-14 Keyboard

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

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.

=-

a.
I

~
".

... ......
tr
NOI1~HS

...
I

.... QC
~
~ ~

~ .
(JC!

'<

== ... =-

-. =r.I'1

~
~

~ Q

.
~

Q..

i
l

[
~
.... 'C
I
01:00.

17

NOIl:l~S

German Keyboard

4-20 Keyboard

g ...
~

a.

[
N
I

....
t NDl133S

""

.1::0.
I ~ ~

"C

rJJ.
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 Signal Name

2 3 4
5

Clock Data Spare Ground +5Vdc

Keyboard Connector

Keyboard 4-23

01:0.
N
I

01:0.
0 00

t
+~

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

+~ 81
GND B2 GND N/C

CI

+~

~
RI UI 7406

r
LJ.

PI

~ B~ -0
~I

~2

"0
d

~,

P02AQ A3 P22 AI

P2d BI

~I~

LED 2

B _________ ..J B L
R1

P20,A2

,,"-

/'i':;\+

ED1

LED~LED
COMPONENT SIDE" CARD -----"\

HOLDER

U
PARTIAL VIEW

LARGE HOLE

B- B

Enhancement Logic Card Assembly

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 MOV CX,HIGH COUNT MOV DX.LOW COUNT INT tAH To read the time of day: MOV AH,O INT tAH ;function is to read time-of-day ;read the timer ;set the time ;function is to set time-of -day ;establish the current time

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.
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 4C-4F 50-53 54-57

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

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

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 108-1 DB 1DC-1DF 1 EO-1 FF 200-217 218-3C3 3C4-3FF Interrupt 20 21 22 23 24 25 26 27 28-3F 40-5F 60-67 68-6F 70 71 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

72
73 74 75 76

77
78-7F 80-85 86-FO F1-FF

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 400-4A1 4A2-4EF 4FO-4FF 500-5FF 500 Mode ROM BIOS 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

DOS

504 510-511 512-515 516-519 51 A-51 D

DOS BASIC BASIC BASIC BASIC

Reserved Memory Locations

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

System BIOS 5-9

Offset 2E 347 30 358 6A

Length 2 2 2 2 1

4E

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 Byte 1 Byte 2 Byte 3 Hex 55 HexAA A length indicator representing the number of 512-byte blocks in the ROM. 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 Bytel Byte 2 Byte 3 Hex 55 HexAA Not used 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

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


=

Upper Case Esc ! @

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

#
%
--,

&

*
( )

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

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

Backspace(008) _(009) q

w
e r t y u i
0

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

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

1 1 1 1 1 1 1 1 1 1 1

J
K L
:

1 1 1 1 1 1 1 1 1

-1

-1

\ z
x c

I
Z X C V B

v
b

1 1 1 1 1

(Part 1 of1).

Character Codes

System BIOS 5-15

Key

Base Case

Upper Case

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

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

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.

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) Break(Note 2)

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

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

(Part 2 of 2)

Character Codes

5-16 System BIOS

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 91 96 101 107 92 97 102 108 94 98 102 99 104 Num Lock 7 8 9 Base Case tome(Note 1) (Note 1) Page Up(Note 1) Alt -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 Note 2 Ctrl 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

_(Note 1) -1 _(Note 1) +Note 1) End(Note 1) t(Note 1) Page Down(Note 1) Ins Del(Notes 1,2)

5
6 + 1 2

3
0

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

Function

nd

Nul Character

72
73 75

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 Page Up and Home Cursor

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

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

Name

OOOOOH OFFFEH FFFFH


Origin Group Address

CODE

Publics by Name

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: 183 0000: 18E8 0000,18ED 0000,18F2

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


DISKETTE 10

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
0000: 0008

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

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

EO

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

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

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

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
0000: 169B

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

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


0000: 1805

PRoe SHUTDOWN

POST4 E_NSG P HSG ERR BEEP BEEP KBD RESET DDSD11


DUMMY RETURN 1

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


0000: 199C

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
DODD: 3605

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
VlDEO-ro 1
VIDEO-PARas

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


0000; 187F

INT 287 RE DIRECT PRT_SEG


EXC DO POSTS

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

EXC 01 EXC=02
EXC 03

EXC- 04 EXC - 05 EXC=06


EXC 07

EXC- 08 EXC=09
EXC 10

0000: IBCA 0000: 18CF

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


0000: 18Fe

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

EXC -19 EXC=20


EXC 21

OOOO,FOM 0000,37DC
0000: EOB7 0000: 3936

0000: 396
0000: 3A4C

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

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

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

EXC=22 EXC 23 EXC- 24 EXC- 25 EXC- 26 EXC- 27 EXC - 28 EXC-29 EXC - 30 EXC =31
SYS 32

Address
0000: 0000

Publics by Value
BEGIN
Abs
Abs
K6L

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

SYS - 33 SYS=34 SYS 35 SYS=36


SYS 37

SYS- 38 POST6 STGTST CNT


Rml

xmT

ERR

0000: 0008
0000:0010

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


0000: 03E5

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


E30B

0000: IBC6 0000: lC2D 0000: IFIA OOOO,IFFO 0000,IFF9 0000 20A5
OOOQ:24Cl 0000: 260E 0000: 2816 0000: 28DA

8042 BOOT-STRAP 1 H5 -

POST? SYSI:-.IITI
GDT BLD

SIDTB10 DISKETTE IO 1
SEEK

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
SHUT7

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

DISK INT 1 OSKETTE SETUP DISK SETUP DISK-JQ HD_INT


KE YBOARD 10 1 KB I~T 1-

0000: 3054
0000: 30[\9

Kl6

0000,346F 0000,34F5 0000,3605


0000: 364E

PRI~TER

10 1

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

0000 372A 0000:3751 0000: 377B

0000,3792 0000,37B6 0000,37DC


0000: 37FF

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

,,"'RITE _AC _CURRENT

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

5-24

ROS Map

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

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

~RITE

0000,FOE4
OOOO:FOEG 0000: FOF4

0000,F841
0000: F84D

0000, F859 0000,FA6E


0000: FE6E 0000 :FEAS

0000 3E76
00DO3F2F

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

Nf!! INT 1 SET=TODCASSETIE 10 1 SHUT9 GATE A20 TIME OF DAY 1 RTC INTTHIER INT 1 PRINT-SCREEN 1 FILL START C1 C2 C8042A OBF 42A C8042B C8042C
OBr 42B

0000 ,FEF3
QOQQ:FF23

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

0000,FF53 0000, FF54 0000, FFFO

DUHHY-RETURNPRINT-SCREEN P_O_R-

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


0000: EODO 0000: EOE9

EO 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, EOFC 0000: E IOC 0000: E lle 0000:E137


0000:152

0000, E150 0000, E 164 0000:E174


0000:E184

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


0000 :E1D7

0000, E1FB 0000,E21F


0000 :E234

em
CH2

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

erB
F4 F4E

mn

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

0000,E393 0000,E3A8
0000 :E3BD

FI780
Fl781
F1782

0000,E30B 0000,E3EE 0000,E401


0000 :E6F2

0000,E729 0000,E739 0000,E82E 0000,E87E 0000 ,E886 0000, E88E


0000: E8CB

F1790 Fl791 FD_TBL BOOT STRAP Al RS232_IO KEYBOARD 10 K6 K7 K8 K9 KID

0000, E8El
0000:E91B

Kll
K12
K13

0000, E955 0000,E95F


0000:E969

0000, E976 0000,E987 0000,EC59 0000, EF5 7 0000, EFC7


ODDO:EFD2

0000, F065 OOOO,FOA4

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

ROS Map

5-25

5-26

ROS Map

TITLE T5Tl

11/28/83 ROM POST

BIOS

I/O

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

BIOS1.SRC

B I OS2. SRC ORGS. SRC

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

0 0 0

0000 0000

oouo

= Dora = 0020 = 0010


0

c c c c c c c c c
c
C C C C

INCLUDE POSTEQU. SRC EQUATES TEST KY LOCK KEY_NUMS

X287

. -- -- -- - ------------ - ----------- -- --- -- -------------- - ------------- -- - -- - ---EQU OFOH Q20H ; MATH PROCESSOR

EQU EQU EQU

; ; ;

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

EQU EQU
POST SS POST-SP TEMP-STACK LO TEMP=STACK::::H! PORT A PORT-B PAR ITY ERR RAM PAR ON RAM-PAR-OFF 10 CHK PRTY_CHK EQU EQU EQU EQU

; ; ; ;

MFG LOOP POST JUMPER REFRESH TEST BIT POST STACK SEGMENT PO:;T STACK POINTER SET PROTECTED 0: FFFFH

0101'1

= 8000 = FFFF = 0000


0 0

0000

OH

c c
c

C C

8000li OFFFFH

~ODE

TEMP SS -

= ooeo
0 0 0

0060 0061

C C

c
C

OOF3 DO De

EQU EQU EQU EQU


[QU

= 0080
0 0

0040

C
C C C C

EQU EQU

60H 61H OCOH 111100119 00001100B 010000008 100000008

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?

0064
0001

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


0 0 0 0 0

C
C

C C
C C C

C
C C
C

QOAB

ODED 0001

C
0

0080
0001 0002 0004 0008 0010 0020 0040

C C C C C C C C C

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

0010
0020 0040

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

0095 0098
0097

0094 0092
COBE

c c c

0080
OOllO

0020 0010 0008 0004 00B3 0080 0040 0020

C C C C C C C

c
0020 0021 0020 OUAU UDAl DIHO 0010 C C C C C C C C C C C C C C

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 FROII 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 cSL 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

au

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

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

00'10
00'13
00110

COU EOU [qlJ

4011 4311 40ft

0001

[QU

01 08
00
ODOH OCOII 81H 8Ft!

porn ADDR POR r ADDR MASK DMA STATUS I{[G ponf AD OR DNA CH.O AOOR. REG POrtT AOQR
--~

= = = = = = = =

0005 0000
0000 ODeD
D08F

c
c c c c
C

[>MII08 DMA

O~IA18
D~lAl

------ ------- --- --- -- ---- --- ----- ---- -- ---- ---- --- -- -EQU EQU EQU E.OU
-

[QU [QU

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

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

= ooe1

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

DMA PAGE LAST _DHA_PAGE


MAX PER I OD

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

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

= 0540
.- 0002
0410 0060 0060 0061 0080

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

=
-

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


0054

0008 0004

c c

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

[QU 51 10H 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

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 SYSI 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 ATTACHi<lENT FAI LCD TO RESPOND SEEK OPERATION FAILEO NEG CONTROLLEH HAS FAI lED BAD enG ON DISKETTE READ ATrEMPT TO DMA ACROSS 64K BOUNDARY

5-28

Test 1

0008 OUOG

00011 0003 0002 0001


= 0002 = 0001 = 0080
c= 0007 '" OOFB " 0010 ~, Q003 = 0020 = ooro = OU02 = 0010 = 000 11 " 0001 = 0030 = OODA = OOOF " 0014 - 0080

EOU [au [QU EQU EQU [QU EOU EOU

081-1
UGH

04H 031-1 0211 01H


02H 01 H

OMA OVEf-{RUN ON OPERAT 1ON Mf-.OIA REMOVlD ON DUAL AlTACH CARD REqUESTED SECTOR NOT rOUND WRITE ATTEMPTED ON WRITE PROT DISK ADDRESS MAHK NOT FOUND BAD COMMAND PASSED TO 0 I SKETTE I/O 250KBS DAl A TRANSFER RATE DUAL ATTACH CARD PRESENT FLAG 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

= 0002
= = = = =

" 0001

0093 00711 0015


0061

0080

= (lOOF
= 0070 = 0071

OOCO OU10

= = 0002

Door

[au USK CIlC 080H SlATe MSf< [QU 007H [QU OF8H HEV STATE Ul0H DETEI\M I NCO FQU TRAN MSK Eau 031-1 DOUBLE STEP 020H EOU EQU MOTOR MSK QFOH [QU MAX DRV 002f1 HOM!:: 01011 EQU EQU seNSE DRV ST OOltH ONE EQU 00111 11{K SLAP EOO 030H qu lET SEEK EOU OOAH EOU HD12 SETTLE 0150 ()?OD H0320 SE rILE EOO ",/1{1 TCOP oeOH EQU PAGE ;------ DISK CHANGE LINE EQUATES NOCHGLN LQll OOlH CHGLN Equ 002H ;------ MEDIA/DRIVE STATE INDICATORS 1~3260326 Equ O')3H M3?601Z Equ 07411 [QU 015H 111:;>012 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 TIMER DATA AI'-EA COUNTS SI_C COUNTS--=M I N ; COUNTS_HOUR ; COUNTS DAY PAGE ' 1NClUDt. DSI:_G, SRC 0:0>86 INTERRUPI 0 LABEL LABEL ORG 5*4 I NT5_PTR ORC 8*4 I NT ADDR IN(:PTI{ ORG 10H*4 VIDEO 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 LABEL LABEL LABEL
LAf~El

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

UN
FOU rau EQU

18 1092 65543 1?73040 = 1800BOH

LOCATIONS (HEAD): BYTE WORD WORD WORD DWORO WORD ; DWORD WORD IMORD DWORD DWORD DWORD DWORD ; LABEL LABEL lABEL LABEL LABEL LABlL DWORD OWORD OWORD DWORD aWaRD DWOIW ;ABSOLUTE LOCATION OF DATA SlCMENT ; ; REAL T I ME Cl.OCK I NT F I XED 0 I SK I NT ERRU PT VECTOR DISKETTE PO INTER ; POINTER TO VIDEO PARMS LABEL
I ARrl

OOUO 0000 0008 0008 0014

Al~SO

SlCMEN r A'I
2-ltl~

srG LOCO or{C

0014 0020 0020 U020


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

lABEL

NEW FDISK

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

LABEL LABEL LABEL lABEL

0118
OlGa OlGa OlGa

ORC 70H*ll
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[ ; STACK -- US[O DURING

0108 0108
OIj(}O

01,00
0400 0500

LABEL [3YTl l ABEL WORD LABEL LABEL


FAR FAR

7coa

0500 7COO

7COD

INITIALIZATION ONLY

0000
0000

STACK

80 [
????

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

0100
01GO

TOS STACK

LABEL ENDS

WORD

ROM BIOS DATA ARFAS

0000 0000 0000

011 l

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

BYTE 4 DUP(?)

ADDRESSES OF RS232 AOAPTERS

0008

ow ow

4 OUP('1)

ADDRESSES 0:" PR 1NTERS

0010

01

EQLJ I P_FLAG 1??'1

1 DUP(?)

I NSTAI_LI'.O HARDWARE

Test 1 5-29

0012

01 [

MFG_ TST

OB

1 DUP{? )

INITIALIZATION FLAG

0013

01
????

ow
DB

1 OUP(?)

ME~'ORY

SIZE

IN K BYTES

0015

01

0016

01
??

c c c c c c
C C C C PAGE

1 DUP(?}

SCRATCH PAD FOR MANUF ACTUR I NG

DB

1 DUP(?}

ERROR CODES

KEYBOARD DATA AREAS KBJLAG


OB

OOl"r

01

C
C C C C C C C C C

1 DUP(? )

0018

01

[
??

DB

1 OUP(?)

SECOND BYTE Of KEYBOARD STATUS

0019

01

DB

1 DUPI?)

STORAGE FOR ALTERNATE KEYPAD ENTRY

001A

01
????

OOlC

01

DOlE

10 [
????

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

ow
BUFFER_TAil

1 DUP(?)

POINTER TO HEAD OF KEYBOARD BUFfER

OW

DUP(?

PO I NTER TO TAl l

Of KEYBOARD BU FFER

ow
LABEL HEAD'" TAil

160UP(?)

ROOM FOR 15 ENTR I [S

D03E

WORD rHAT THE BUFFER IS EMPTY

INDICATES

DISKETTE DATA AREAS


OB

003E

01

1 DUP(?)

DRIVE RECAliBRATION STATUS

003P

01

c c c
0040
01

c c c c c

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

??

c
01 SKETTE_STATUS DB
1 DUP(?) RETURN CODE STATUS BYTE

0041

01

0042 00 1 12 0042

07 [
??

CMD BLOCK liD ERROR NEC_STATUS

LABEL LABEL DB

BYTE BYTE

7 DUP(?)

SlATUS BYTES FROM NEC

c
0049
01
??

PAGE VIDEO DISPLAY DATA AREA

g
????

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

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

CURREN

004A

01

004C

01

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

c c c
CRT_COlS

CRT MOOt..

OW

1 OUP(?)

NUMBER Of COLUMNS ON SCREEN

CRT_LEN

OW

1 DUP(?)

L[NGTH OF REGEN

! N BYTES

004E

01
????

ow
OW

1 DUP(?)

START!NG ADDRESS

IN REGEN BUFFER

0050

08

8 DUP(?)

CURSOR FOR EACH OF UP TO 8

PAGES

0060

01
????

0062

01
??

0063

01

0065

01

l
??

c c c c c c c c c c c c c
c c c c c
CRT _PALLETTE

c c c

OW

DUP(?)

CURfiENT CURSOR MODE SETT I NG

DB

1 DUP(?)

CURRENT PAGE BEING DISPLAYED

ow
DB

1 DUP(?)

BASE ADDRESS FOR ACTIVE DISPLAY CARD

1 DUP(?)

CURRENT SETT I NG OF THE 3X8 REG I STER

0066

01

DB

1 OUP(?)

CURRENT PALLF.TTE SETT I NG COLOR CARD

PAGE

5-30

Test 1

POST DATA AREA

ow ow
DB

1 DUP(?)

PNTR TO OPTIONAL

I/O ROM

IN IT ROUTINE

1 llUP(?)

POINTER TO

iO ROM SEGMENT

1 DUP(?)

FLAG TO

INDICATE AN

INTERRUPT

HAPPE,\lD

Tlr.o1ER DAlA AREA

ow ow
DB

1 aU?(?)

lOW WORD OF T I MER COUNT

HIGH WORD OF TIMER COUNl

1 DUP(?)

T I MER HAS ROllED OVER SINCE LAST READ

SYSTEM DATA AREA DB 1 oUP(?) 61T 7=1 IF BREAK KEY HAS BEEN HIT

ow
PAGE

1 oUPt?)

WORD;1234H

IF KEY130ARD RESET UNDERWAY

HARD F IlE DATA AREAS


- -

DISK_STAfUSl

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


-

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 ow

1 DUP(?)

1 DUP(? )

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


lASTRATE BBH DB

ADDITIONAL FLOPPY DATA

1 DU?(?)

LAST DATA RATE SELECTED

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

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

C C C C

fir _SlATUS

ORG

8CH

DB

1 OUP(? )

STATUS REGISTER

HF - ERROR

DB

OUP(? )

ERROR REG I STER

HF - INT- FLAG

DB

1 DUP(? )

HARD FILE

J NTERRUPT

FLAG

HF _CNTRL

DB

1 OUP(? 1

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

c c
r, C DB 1 DU?(?) DRIVE 1 MEDIA STATE

c c
C DB 10UP(?) DRIVE 0 OPERATION START STATE

Test 1 5-31

?? 0093 01 ?? 0094 01

C C C C

DB

1 DUP(? )

DRIVE 1 OPERATION START STATE

C
C

n
[

C C C
C

DSK_TRK

DB

1 DUP(? )

OR I V 0 PRESENT CYL I NDER

0095

01

DB

1 DUP(? )

DRIVE 1 PRESENT CYL I NDER

0096

01

DB

1 OUP(? )

RfSERVEO

c
0097 0097 01

ADD I T I ONAl KEYBOARD LED FLAG ORG KB_FLAG_2

??

C C C C
C C C C

97H
OB

1 DUP(?)

PAGE

0098 0098

01

????

009A

01

..
00ge 01 ???? 009E 01

C C C C C C C C C

; -----

----------------------------------ORC
98H OW
1 OUP(? ) OFFSET ADDR OF USERS WAIT FLAG

REAL TIME CLOCK DATA AREA

USER- FLAG

USER - FLAG_SEG

OW

1 OUP(? )

SEG AGDR OF USER WAIT FLAG

C
C C C C C C C C C C C C C
C
RTC

- LOW

ow ow

1 DUP(? )

LOW WORD OF USER WAIT FLAG

RTC_H I GH

1 DUP(? )

HIGH WORD OF USER WA I T FLAG

...
OOAO 01

RTC_WA IT_FLAG

DB

1 DUP(? )

WAIT ACTIVE FLAG

..
OOAl

DATA

ENDS

0000
0000 01

0001

0000 0000 0000 0000

4000

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

h~~~ ~ ~

-- SEGMEN~ -; ~ -50H--- --- --- --- ------DB 1 DUP(?) ENDS VIDEO DISPLAY BUFFER

EXTRA DATA AREA

STATUS_BYTE

XXDATA

VIDEO RAM REGENLABEL REGENW LABEL


DB

SEGMENT AT OB800H BYTE WORD 1638 110UP(?)

4000

ENDS . LIST I NCLUOE SEGMENT. SRC CODE SEGMENT BYTE PUBLIC 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 CS: CODE, 55: CODE, ES: ABSO, OS : DATA

0000

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

5-32

Test 1

= 0000

BEGIN

EQU 6181028 6181029 66118811002289 COP R cOP R . CCOOPPRR .

0000

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

DB

IBM IBM IIBBMM

1 9 8 4 1 9 8 4
11998844'

; EVEN ; 000
; COPYR I GHT NOT I CE

INITIAL RELIABILITY TESTS --

PHASE 1

002e

POST1

PROC

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

B4 DO
E8 (JOOO E

MOV
CALL

AH,OISABLE 61T20 GATF _A?O -

OEGATE COMMAND I SSUE THE COMf~AND

;------- SETUP HARDWARE INT VECTOR TABLE LVL U-7


0032 003 1 1 0036 0039 003A 0038 003E 0041 12 001 0043 00411 28 CO BE CO 89 0008
SUB

AX,AX

MOV MOV
PUSH

[S,AX
CX,OB CS DS S I, OFFSET VECTOR_TABLE OI,OFFSET INT_PTR D! MFG_8 INT VECTOR TABLE LVL 8-15 (VECTORS START AT iNT 70H) (ill VECTOR ern SETU P OS SEG REG

OE 1F
BE 0000 E BF 0020 R A5 MFG_B;

POP MOV MOV MOVSW


INC INC LOOP

<,7 47
E2 m

0'

SK I P OYER SEGMENT

;------- SETUP HARDWARE 0046 0048 004A 0040 004E 004F 0052 00')5 0056 0057 0058 2B CO 8E CO 89 0008
SUB

OE 1F
BE 0000 E lJr OlCO R A5 MFG_C:

47 47 f2

MOV MOV PUSH POP MOV MOV MOVSW INC 'NC LOOP

AX,AX ES,AX CX,08 CS


OS

; ;

GET VECTOR CNT SETUP OS SEC REG

SI,OFFSET SLAVE_VECTOR_TABLE o I ,OfFSET SLAVE_I NT_PTR ; SK I P OVER SEGMENT

SET UP OTHER
ASSU~'E

I NTERRUPTS AS NECESSARY

ASSUME 005A OOSC OOSE 2B 8E c7 C7 Cl

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

SUB

BE 08

0060
0066 D06e

MOV MOV MOV


t~OV

MOV

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 0078 007 0080 0083 0085 0087 0088 0088 0088 0080 008F 0091 0093 0094 0096 0098 0090 009F OOAl OOA3 OOA5
BO 60

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

MOY CALL MOY OUT CALL


r~oy

AL,60H C8042 AL,00001001B PORT _A, AL MFC 2 BH, AL MFC 2 CH,AL CL,BH 0 t ,0500H AL, STATUS_PORT AL, OUT _BUf _FULL MFG 1 AL, rORT_A

WRIT[ 8042 RAM 0 ISSUE THE COMMAND SET INHIBIT DVERrOE/ENABLE OBF AND NOT PC COMP GET COUNT LOW SAVE IT GET COUNT HI CX NOW HAS COUNT SET OIR. FLAG TO INCRIMENT sl:.r tARGET OFfSET (05"'0000) GET 8042 STATUS PORT KB REQUEST PEND I NG? LOOP TILL DATA PRESENT CET DATA STORE IT DISPLAY CHAR AT MFG PORT LOOP TILL ALL BYTES READ

tNT

CALL MaY
r~ov

FC
BF 0500 E4 A8 74 4 AA 64 01 FA 60

ClO
MaY IN TEST

JZ
STOSB
OUT

'"

6 80
E2 f3 EA 0500 ---- R [4 64 A8 01 MfG_2:

MFG_PORT, AL MFG_1 MFG_ TEST_RTN AL, STATUS_PORT AL, OUT BUf FULL MFG_2 -

LOOP JMP IN TEST LOOPl

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

E1

FA

[4 60

C3

RET
; ; TEST.01 X286 PROCESSOR TEST (REAL MODE) DESCRt PTtON VERIFY fLAGS, REGISTERS AND CONDITIONAL JUMPS ASSUME CLI MOV SAHF .lNC 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

'"

00A6 OOA7 QOA9 QOAA OOAe QOAE OOBO 00B2

FA 84 9E 73 75 7B 79 9F

START_l: 05 2A 28 26 24

JNZ JNP JNS LAHF

Test 1 5-33

00B3 00B5 UOB7

01

05

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

02 CC 73 1 D
BO 40

9[

DO ,0 71 17 32 E4
76 12

CL,5 AH,CL [RHO? Al_,40H AL,1 ERR02 AH,AH ERR02 ERR02 ERR02 CL,5 AH,CL U-(R02 AII,1 [RR02 C7A EHROl MOV MOV AX,DAi"A DS,AX

78 10 "fA Of 9F Ell 05
02 EC 72 07 DO [4 70 03 EI> Ol! 90 E9 01l,C R
R B8 ~--OE 08

OOC(3
OOCD

ooer

0001 0003 0006 0009

ERR02; C7A;

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

0009
OODG

SET DATA SEGMEN-I

; ----- CHECK FOR PROCESSOR SHUTDOWN OODE OOEO 00E2 00E4 00['7 00E9 OOEB OOED OOEF OOFl OOF4

A8 (PI

6',

75 03 9 U 181 R

IN !"l.ST JNZ JMP ; ------ CHlCK FOR SHUTDOWN 9 C7B; AL_, SHUT __ OOWN CMOS PORT, AL SHORT $+? AL,CMOS_PORT+1 AL,AH AH,09t1 C7C RE-INITIALIZE THE 8259 INTERRUPT #1

CHECK FOR SHUTDOWN CO IF YFS

oou

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

CMOS ADDR FOR SHUTDOWN BYTE 10 DELAY GrT WHO SAVE TH[ SHlJTDOI-,N REQUEST 'rIAS IT SHUTOOWN REQUEST 9? BYPASS INIT or INT CHIPS CONTROLl_ER CHIP I NSUR[ MATH PROCESSOR RESET ICW1 EDGE, MASTER, ICI-I4 (8-F)

80 Fe 09 30

'"

; ; ;

OQF6 OOF8 oorA OOFC OOFE 0100 0102 0104 0106

?A CO E6 F1

SUB OUl

BO 11
E6 20 EB 00 BO 08 E6 21 EB 00

MOV

oor
OCi

JMP MOV JMP MOV


OUT
JI~P

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

WAIT STATE rOR 10 SETUP ICW2 - INT TYPE 8 WAlT STATE rOR SETUP ICW3 10

0108 OlOA

BO 04 E6 21
EB 00

MASTER LV 2

OlOe
OlOE

BO 01
E6 21 EB 00

MOV
OUT

10 WAIT STAle SETUP ICWI~ - ~IASTER,8086 MODE WAIT STATE rOR 10 MP.SK ALL INTS. OFF (VIDEO ROUTINE ENABLES INTERRUPT 112 CONTROLl_ER CIII? ICWI r:DGr, SLAVE ICW4
(50-~F)

0110
0112 0114

00 FF E6 21

JMP MOV
OUT

INTS.)

RF-INITIALIZE THE 8259

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

130 11
lu AO

MOV OUI
J~'P

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

MOV OUT MOV


,JMP OUT

[6 Al

EO 00 BO 01
E6 Al EB 00

JMP MOV
OUT

BO FF
[6 Al

JMP MOV
OU I

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

'rIAIT STATE FOR 10 snup ICW2 - INT TYPE 50 S[TUI' 1(;1013 SLAVE LV 2

10 WAI T STATE SETUP ICW4 - 80B6 MODE, WAIT STAT[ Fon 10 MASK ALL I NTS. OFF

SLAVE

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 BO E6 EB 2A l6 86 3C 77 BE 03 03 2E; FA BB 8E BC FB FF SF 70 00 CO 71 EO OA 2C 015>8 R FO FO 8B 1C ---- R DO U100 R E3 BRANCH; C7C: MOV
Olrl

,JMP
SUB DOT

OBC
013E 0140 014? 0145 014"1 0149 OlllC 0140 0150 0152 0155 0156 0158 015A 015C

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 AX, STACK 5S,AX sP,onS!:.l
BX

CLEAR CMOS [lYlE 10 orl AY


SET BYTE TO 0

GET

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

THE START OF BRANCH TABLE

POINT TO BRANCH ADDRESS GET BRANCH 10 BX SCT STACK

CL I
MOV
~10V

MOV

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

Sfl JNP OW OW OW

016E R 09BO R 0000 E

SHUlO SHUTl SHUT2

5-34

Test 1

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

OW OW OW

ow ow ow ow ow
SHUTO; ;-------

SHUT3 SHUT4 SHUT5 SHUT6 SHUT7 SHUTS SHUT9 SHUTA


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 imOE TEST1 FAILED BLOCK MOVE SHUTDOWN REQUEST JMP DWORD REQUEST (14/0 INTERRUPT IN IT)

JMP

0171 D173 0175 0177 0179 0176 0170

[4 A8 74 E4

64 01 02 60 BO 20 [6 20 Ff 2E 0067 R

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 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
C9:

MOV S7C JNC MOV MOV MOV MOV MOV


~tOV

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

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

MOV MOV MOV MOV JNC XOR JNZ ClC JMP

AX,DI ERROl
C8

PATTERN MAKE IT THRU ALL REGS NO - GO TO ERR ROUT I NE CLEAR CARRY FLAG TSTlA ZERO PATTERN MAKE IT THRU? YES - GO TO NEXT TEST ; HALT SYSTEM INTERRUPTS ARE DISABLED

OB C7 74 01 F4

OR AX, D t JZ C10A ERROl: HLT ;------- INSURE THAT CMOS CLOCK C10A: MOY
OUT JMP IN

OlAD OlAF 01Bl 01 B3 0165 01B7 016A D1BC OlBE Oleo 01C2 01C4 01C6 Olca OlCA 01CC

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

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

XCHG
ANO MOV OUT

XCHG
JMP OUT JMP MOV OUT JMP IN

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 SHORT $+2 AL, CMOS_ALARM+1 CMOS_PORT, AL SHORT $+2 AL. CMOS_PORT+1

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

10 DELAY 10 DELAY CLEAR PENDING 10 DELAY

INTERRUPT

; -------- RESET V IDEO ASSUME OlCE OlDl 0103 0109 010B 01DD OlEO 01E1 01E3 01 E5 01E6 01E8 ---- R 8E 08 81 3E 0072 R 1234 74 DB
B8 MOV MOV CMP JZ SUB MOV OUT INC MOV OUT

OS: DATA AX, DATA DS,AX RESET FLAG, 1234H SFT_RST AL,AL DX,3D8H DX,AL
Al

SET DATA SEGMENT SOFT RESET? GO I F YES

2A CO BA 03D8

EE
FE CO B2 B8

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

EE
BO FC E6 61

SFT _RST: MOV


OUT

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

; ; ;

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 alEE 01 F1 01 F3 01 F5 01 F7 01 F9 01 FB OHD 01 FF 0201 0203 0205 0207 0209 0208 0200 BO 02 E6 80 B9 B4 BO E6 8A EB E6 BO EB E6 EB E4 3A 75 00 E2 0009 01 8F 70 C4 00 71 8F
MOV OUT MOV MOV MOV OUT MOV JMP OUT MOV JMP OUT JMP IN CMP JNZ Rel

AL,2 MFG_PORT, AL 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

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

e10B:

00
70 00 71 C4 A1 04 E4

LOOP

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

(:,0:
;----- CHECKPOINT 3

020F 0211
0213 0215 021J 0219 021C 021 F 0222

80 03 E6 80
8C C8 8E DO 8E 08 8fi 0000 R BC 0000 E E9 0000 E

NOV
OUT

AL,03H
MfG _PORT,AL

; <><><><><><><><><><><><> ; <><><>CHECKPOI NT 3<><><> 5UUP SS SlG REG

MOV MOV MOV

AX,CS 5S,AX DS,AX 5S: CODE BX, OFfSET BEGIN SP, OFfSET C1 ROS - CHECKSUH ellA

SET UP DATA SEG fO RON ADDRESS

PO I NT TO

ASSUNE
MUV MOV JMP

SETUP STARTING ROS AODR SETUP RETURN ADDRESS SYSTEM

ell:
74 01
F4

0222
0224

JL

HALT

IF ERROR

RLT
; ; ; TEST.04 8253 CHECK TIMER 1 ALL BITS ON OEseR I PT ION SET TIMER COUNf CHECK THAT TIMER 1 ALL BITS ON ASSUNE DS:DATA AX, DATA DS,AX AL,OlHI MFG _PORT,AL ; SET DATA SEGMENT

0225
0228 022A 022C

B8 BE DB BD 04

----

CllA;

E6 80

MOV MOV MOV OUT

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

DI SABLE DMA CONTROLLER


MOV OUl OUT

022E 0230

E6 DB E6 DO

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 0232 0236 0238 023A 023C 023E 02'40 0242 0242 0244 02116 0248 024B 0240 024F 0251 0253 0255 0257

60 16 0072 R
BO

E6 43 [8 00 8A C1 6 41

5"

MOV MOV

OUT
JMP MOV OUT MOV

B7 05
C12 :

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


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

SAVE RESET FLAG WH I LE REFRESH SEL TIMER 1,LSB,MOOE 2 WAIT STATE FOR 10 SET INITIAL TIMER CNT TO 0 LOOP COUNT TIMERl BITS ON LATCH TIMER-1 COUNT 10 DELAY YES SEE I F ALL BITS GO OFF
TIMER1_BITS~OfF

I S OFF

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

Mav JMP OUT

CMP
JE IN OR

C13
AL, TIMER+l BL,AL

FE CF

LOOP DEC
JNZ

75 EB
'4

C12 611 C12

READ T I MER 1 COUNT ALL BITS Ot~ IN TIMER TIMER1_BITS_ON TRY AGAIN TIMER 1 FAILURE, TIMER1_BITS_OFF HALT SYS

HLT

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

BO 0':> E6 80
8A C3 28 C9
E6 41

Cl3:

MOV OUT

AL,05H MFG _PORT, AL

<><><> <><><> <><><> <><><> o<><>CHECKPO I NT 5<><><> SET TIMER 1 CNT

MOV SUB
OUl MOV

cX,ex
TIME:R+l,AL BH,05H SHORT $+2 AL,40H TIMER T 3,AL SHORT $T2 SHORT $+2 AL, T I MER+l BL,AL
Cl~

AL,BL

87 05 C14: EB 00

SET

BO

,,0

,IMP MOV
OUT JMP JMP IN AND

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

E6 43
[B 00

EB 00
E4 ',1

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

22 OR 7'1 07 E2 EE FE Cf

JL LOOP

DEC
,)NZ HlT

75
'4

EA

C14 SH C14

027A

HALT SYSTEM lEST

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. ; ----- 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 FF MOV MOV MOY OUT MOY OUT ;----- WRAP OMA
MOV
I~OV

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

08
F8

C16:

0008
0000 00 01 00

en:

MOV MOV MOV

OUT JMP QU'i


MOV

.iMP
IN JMP MOV IN

25T DMA

ffl 00
8A EO EC

5-36

Test 1

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

3B 08 711 01
r4

eMP JE HLT C18:

BX,AX C18 OX

42 2 EA
fE CO

INC
LOOP

C17
AL
C16 PATTERN

INC
Jl

74 DC

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

;------- WRITE OMA WITH 55 02BO 0283


0213~

80 FB 55 7', 09
8U
H.~

AA

0288 02BA 02BC

74 08 BO ~S>
[l3 C

eMP Jl eM? JZ MOV JMP

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 02BE 02CO

130 AA
EB CA

C19:

r~ov

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

JHP

AL,OAAH C16

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 026 130

Fr
C16A:

8A 08

8A f8
89 0008 SA

ooeo

EE
EB 00

C17A:

EE
AO 01 [8 00

EO
EB 00 SA EO

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

EC
38 08 74 01

IN CMP JE
HLT

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 PATTERN CHECK GO I F CHECK GO I F IF 55 PATTERN DONE YES IF AA PATTERN DONE YES

25T DMA

f4
C1BA:

02E7
02E7 02EA 02EC 02EE

83 c2 02
E2 E8

FE CO r4 OA
80 rB 55
74 09 80 rB AA 74 08 BO 55 EB CC

ADD DX,2 LOOP C17A INC AL C16A JZ WRITE OMA WITH 55 01P JZ CMP JZ MUV JMP BL,55H C20A BL,OAAH C21 AL,55H C16A

02FO 02F3 02f5 02f8 02FA

Dzre

;------- WRITE DMA WITH AA PATTERN 02fE 0300

BO AA EB C8

C2aA:

MOV JMP

AL,OAAH G16A

INITIALIZE AND START MEMORY REFRESH. 0302 0306 0309 8B 1 E 0072 R


A3 0010 R

C21 :

MOV MOV MOV OUT

ex, RESET _FLAG


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

GET THE RESET FLAG


DO A DUMMY WRITE RAM BEFORE REFRESH START TIMER

030B
0300 0300 030r 0311

80 12 E6 ,,1

2A CO E6 08 E6 DO

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

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

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

80 CO E6 06
tB 00 80 41 E6 08
E6 06

110V OUT MOV


OUT

EB 00
80 E6 E6 EB BO f6 4:;> OB

JMP MOV OUT OUT JMP MOV OUI


OUT

06
00

113
08

JMP MOV
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 FLAG

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

; ------- RESTORE RESET 0333 89 1 E 0072 R ; ; ;


~10V

RESET_fLAG, BX

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

; ----- CHECK PO I NT 8 0337

80 08

MOV

AL,08H

<><><><><><><><><><><><>

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
EE 42 B1

e22A:

FE CO fA OOaf 75 f6 86 EO FE CC
4A

OUT SUB MOV MOV OUT INC INC CMP JNZ

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


AL

<><><>CIiECKPO I NT 8<><><> DO ALL OAIA PArTERNS

XCHG C22B:
DEC DEC SUB IN CMP JNZ DEC DEC CMP JNL INC MOV

DX,8FH C22A AH.AL


AH

TEST DMA PAGES 81 THUR 8EH SAVE CURRENT DATA PATTERN CHECK LAST WR I TTEN CHANGE DATA BEFORE READ DATA AS WRITTEN? GO ERROR HALT I F NOT CONT I NUE TI LL PORT 80 NEXT PATTERN TO RI PPLE

2A CO
EC

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

OX AL.AL AL,DX AL,AH


C26 AH

75 FE 8A E2

fO
C4 C4 DB

OX OX, MFG_PORT C22B


AH

LOOP

AL,AH C22A

; -------- TEST LAST DMA PAGE REG I STER (USED FOR ADDRESS LINES OUR I NG REFRESH) 0368 036A 0360 036f 0370 0372 0373 0375 0377 037A 037C 037E 0380 0383 0385 0387

BO CC BA 008f 8A EO
EE

MOV AL,OCCH MOV DX,LAST_DMA_PAGE MOV AH,AL C23: OUT DX,AL ;-------- VERI FY PAGE REGISTER 8F C22: C24:
SUB IN CMP JNZ CMP JNZ MOV JMP CMP JZ SUB JMP

WR tTE AN CC TO PAGE REG I STERS SAVE THE DATA PATTERN OUTPUT PAGE REG CHANGE DATA PATTERN BEFORE READ GET THE DATA FROM PAGE REG GO I F ERROR 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

2A CO
EC

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

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

AL,AL AL,DX AL,AH


C26

AH,OCCH AL,033H
C22 C2'

C25:

AH,O
C27

AL,AL
C22

;------- ERROR HALT 0389


F4

C26:

; TEST. 09 ; STORAGE REFRESH TEST ; OESCRI PTION : VER I FY STORAGE REFRESH IS OCCURR I NG ; ;------- CHECKPOINT 9 TEST MEMORY REFRESH 03BA 038C 038E 0390 0392 0394 0396 0398 039A 039C 039E 03AO BO 09 E6 80 2B C9 E4 61 A8 10 E1 FA 74 F1 2B C9 E4 61 A8 10 EO FA 75 E7 C27:
MOV OUT SUB IN

--------------------------------------------------------- ----- ------------------------------------------ - -----AL,09H MFG_PORT, AL CX,ex <><><><><><><><><><><><> <><><>CHECKPOI NT 9<><><> I NSURE REFRESH B IT IS TOGGLI NG BII I NSURE REFRESH I S OFF GO IF NOT INSURE R[fR(SH IS ON
GO I F NO REFRESH

HlT

HALT SYSTEM

C28:

TEST LODPZ e29:


JZ SUB IN

~t:~~~~E~H
C28
C26

cX,ex AL, PORT B


C26

-- ------------- -- --------------------- - -------JNZ

TEST LOOPNZ

~~9REFRESH_BIT

. --------- --- ------------------- - -----------; ------- CHECKPO I NT OA 03A2 03A4 BO OA E6 80


MOV OUT

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

---

AL,OAH MFG_PORT, AL

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

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

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

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

T511 :

SUB IN MOV

TEST
JZ IN

TST2:

TEST LOQPNZ
JZ HLT

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

[RRO:

I SSUE A RESET TO THE 8042 03BB 03BO 03BF 03Cl 03C4 03C7 03C9 03ca 03CO 0300 0303 0305 0307 0309 030B BO OB E6 80 BO BC EB A8 74 E4 BC EB E4 3C AA 0000 E 3F 90 01 02 60 0000 E 3F 90 60 T8T4:
MOV OUT MOV MOV JMP

AL, aBH MFC _PORT ,AL AL,OAAH SP,OFFSET C8042A C8042 ~~t~~~_aUF _FULL AL, PORT_A Sf>, OFFSET oaF _ 42A OBF _42

<><><><><><><><><><><><> <><><>CHECKPO I NT OB <><> SELf TEST COMMAND SET RETURN ADDR IS THE OUTPUT BUFFER fULL? GO I F NOT FLUSH SET RETURN ADDR GO WAIT FOR BUFFER CET THE ENDING RESPONSE <><><><><><><><><><><><> <><><>CHECKPO I NT OC <><> GO IF NOT OK

TST4_B: TST4_A: TST4_C:

TEST
JZ IN MOV JMP IN CMP MOV OUT JNZ

55

~t:;g~T_A
AL,aCH MFG_PORT, AL ERRO

BO DC E6 80 75 OD

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

0300 03DF 032 03E5

BO BC EB BC

CO 0000 E 21 90 0000 E

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

5-38 Test 1

03E8 03EB 03EO

EB 27 90 (4 60

JMP

[30C:

IN
OUT

6 82

OSF 42 Al, PORT_A OMA_PAGE+l, AL

GO WAlT FOR RESPONSE G[T THE SWITCH SAVE TEMP

; ------ WR I TE BYTE 03EF 03Fl 03F4 03F7 03F9 03FS 03ro 03FE 0400 0402 BO Be EB 74 60 0000 E OF 90 05 May
MOY JMP

OF 8042 RAM

TST4_D: Jl May
OUT

AL,60H SP,OFFSET C8042B C8042 TSTlI_Dl AL,OOH MfG_PORT ,AL AL,5DH PORT_A, AL E30A I SSUE THE COMMAND TO TH[ 8042 STATUS_PORT,AL

WRITE BYTE COMf1AND SET RETURN ADDR I SSUf rHE COMMAND CONT I NUE I F COMMAND ACCEPTED <><><><><><><> <><><><><> <><><>CHECKPOI NT 00 <><> ENABLE OUTPUT BUFF FULL INT - DISABLE KEYBOARD SET SYS FlAG - PC 1 COMP - I NH OVERR I DE CONT I NUE

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

llLT
T5T4_D1: MOV
OUT JMP

; --------040~

FA

C8042 :

CLI
OUT SUB IN

0406 0408 040A

6 64

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

26 C9 Ell 64

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

OIIOC
040E 0410

A8 02 EO FA

TEST LOOPNl
REl

e3

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

28 C9
B3 E4 A8 75 E2 06 64 01 06 FB

OBf _ 42: C42_2:

FE CB
75 F4

SUB MOV IN TF:ST JNZ LOOP DEC JNZ

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


~

200MS/PER LOOP * 6 CHECK FOR RESPONSE GO I F RESPONSE TRY AGAIN DECREMENT LOOP COUNT CJ'ILLER

==1200 MS +

e3

C42_3: ; ; ;

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

RET

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
I~EMORY

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

WITH DATA ; SET CHECKPO I NT I EJ ; <><><><><><><><><><><>


GET THE SYSTEM SEGMENT OF DATA SAVE RESET FLAe IN BX SET OIR FLAG TO INC.

0422 0424 0426 0429 042B 042F

80 OE

DOA:

6 80
BB ---R

MOY OUT MOY

AL, OEH MFG_PORT, AL AX, DATA DS,AX 8X, RESET_FLAG

8E 08 88 l[ 0072 K
Fe

May
MOY eLO MOY

0430
OI~33

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

sua
SUB SUB MOY MaY eMP JNZ JMP

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

SET FOR 32K WCRDS


FIRST 16K

0435 0 1137 0439

01138
01130 0441 0443

GO

WARM START? I F NOT

;-------- GET THE 0 1146 0448 044A 044c 044E 0451 01 1 15 1 0 1156 0458 80 OF E6 80 80 E6 BC E9 88 75 E9 80 87 0000 E
MaY OUT MaY JMP MaY JNZ JMP

INPUT BUFFER (SWITCH SETTINGS) <><><><><><><><><><><><> <><><>CHECKPO I NT F<><><> SET BASE RAM PAR I TY USE AS 'EMP SAVE SET RETURN ADDRESS SAVE fAlLING Fli' PA'TERN STORAGE OK, CON'I NUE

AL.OFH MFG_PORT, AL AL, PRTY_CHK DMA PAGE+6,AL SP,OFrSET CZ STGTST_CNT

0000 E
08 C30 :

03
05F'

BX,AX e31

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

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 : SA C7 6 81 8A C3 1::6 82 r~ov

OUT
r~ov

OUT

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

SAVE HIGH BYTE SAVE LOW BYTE

CHECK FOR VIDEO ROM


MaY MaY SUB

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

89 8E 28 88

COOO 09 DB 07

M1 :

CX,oeaOOH DS,CX

START OF

10 ROM

ex, BX

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 GO I r NOT BYPASS ERROR DISPLAY IF vrDEO ROM

MOY
JMP

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

~~6~~X~+2
AA,OAA55H

CMP
JZ AOO eMP JL ANO

Z5
eX,oBoH CX,oe800H
Ml

cX,ex C32 C31_0

Z5:

JNZ
Jr~p

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

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

'" 0010 0484 0487 0489 BA 0308 2A CO


EE

M4
;------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 0493 0496

I3A 0388

130 01
EE 83 EA 04 BB 0030 E B9 DOlO Z_2:

MOY MOY OUT SUB MOV ASSUME MOV

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

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

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

; _____ ex
0499 32 E4

POINTS TO CORRECT ROW Of INITIALIZATION TABLE AH,AH ; AH WILL SERVE AS REGISTER NUMBER DURING LOOP THEN VALUE FROM TABLE

XOR

LOOP THROUGH TABLE, OUTPUTTTlNG REG AOOKI:.55, 0498 0490 049E 049F 04Al 04A4 04A5 04A6 04A7 04A9 04A6 OllAE 0481
01~B3

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

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

GET 6845 REG I STER NUMBER 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

ox

Ml0

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

;------ fiLL REGEN AREA WITH BLANK 0488 01.J.80 OI.J.CO G4C2 04C5 04CB a4CA a4CC 04CF 0401 01.J.04 33 FF 138 BODO 8E CO 89 0600 88 0720 F3/ AB 33 FF B8 BBOO 8E C3 89 2000 F3/ AS XOR MOY MOY MOY MOY REP XOR MOY MOY MOY REP 01,01 AX,OBOOOH ES,AX CX,2048 AX, I '+7*256 STOSW SET UP POINTER FOR REGEN SET UP ES TO V IDEO REGEN NUMBER OF WORDS I N MONO CARD FILL CHAR FOR ALPHA FILL THE REGEN BUFFER WITH BLANKS CLEAR COLOR V I ow RAM SET UP ES TO COLOR V IDEO RAM FILL WITH BLANKS

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

; _____ ENABLE VIDEO AND CORRECT PORT SETTING 0406 0409 04013 SA 03138 130 29 EE MOY MOY OUT DX,3B8H AL,29H OX,AL

SET V IDEO ENABLE PORT

;----- SET UP OVERSCAN REGISTER OI.J.DC OI.J.DD Oil-OF


OI~EO

42 60 30 EE BA 0308 BO 28 EE

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

04E3 04E5

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

04E6 011E? 04E9

112 BO 30 EE

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 04EA 04EC 04EE 0I.J.F1 04F3 Oil-f5 04F8 04FA 04fC 04FD 04FE
0500 0503 0505

BC C8 8E 00 BB BOOO 8E DB 80 89 2B 86 47 47 E2 30 0006 Ff 05 FA

MOY MOY
MOV MOY

AX,CS SS,AX eX,oeOOOH OS,BX AL, '0' CX,6 01,01 0::;:101 J,AL DI DI Z

SET STACK SEGMENT TO CODE SEGMENT

SET OS TO BW CRT BUFrER o I SPLAY BANK 000000 START AT 0 WR I TE TO CRT BUFFER POINT TO NEXT POSTITON

MOY MOY SUB MOV INC INC LOOP CMP JZ SUB MOY MOY MOY MOY JMP

80 FF 138 74 OC 213 FF 87 8E 67 8E EB 60 C3 68 DB E2

Z_,

BH,OB8H 01,01

CHECK THAT COLOR BUfFER WRITTEN POINT TO START OF BUFFER ES = MONO SET SEGMENT TO COLOR OS '" COLOR

0507 0509 O)OB 0500 050F

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

;-------- PRINT FAILING BIT PATTERN 0511 0513 0515 0518 0519 051A 051C 051E 0520 0523 0526 0526 052A 0520 0530 0532 0534 0536 0539 053C 053E 0540 130 20 88 05 26: 88 05 47 47 E4 81 B1 04 02 E8 6C 050E R EB 1E 90 E4 24 Be EB EI, 61 02 BC EB E4 21j. BC 81 OF 05EO R 14 90 82 04 E8 05E2 R 08 90 82 OF 05E4 R Z_l: MOY MOY MOY INC INC IN MOV SHR MOY JMP IN ANO MOY JMP IN MOY SMR MOY JMP IN AND MOY AL, as: I 01 J,AL ES;{DI1,AL DI DI AL, MFG_PORT+l CL,4 AL,CL SP,OFfSET Zl_O PR 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 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

Zl:

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

Z2:

Z3:

I SOLATE TO LOW NIBBLE RETURN TO Z4:

;------- CONVERT AND PRINT

5-40 Test 1

0')43 0545 0546 0548 0549 054B 054E 054F


0550

04 90 27 1'~ 40 27
86 05

PR:

ADD DAA ADC DAA

AL~090H
AL~040H

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 WR I TE TO COLOR BUffER WRITE TO MONO BUffER POINT TO NEXT POSTITON

26: 88 05 47 47
C3

MOV MOV INC INC

RET

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

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

0551 0553 0555 0558 0559


OS5A

130 20
68 AS

Z4: 05

055C
055E

0561 0562 0563 0565 0567 056A 056B 056C 0570

D56E

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

MOV MOV MOV INC INC MOV

AL

MOlt

05

05

05

MOV INC INC MOV MOV MOV INC INC MOV MOV MOV
;----~---

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

D5~1011.Al

DISPLAY A BLANK WR I TE TO CRT BUFFER WR I TE TO MONO BUFFER POINT TO NEXT POSTITON 01 SPLAY 201 ERROR WRITE TO CRT BUFFER WRITE TO MONO BUFFER POINT TO NEXT POSTITON WRITE TO CRT BUFFER WRITE TO MONO BUFFER PO I NT TO NEXT POSTI TON WRITE TO CRT BUfFER WRITE TO MONO BUffER FIRST THE CHECKPOINT <><><><><><><><><><><><><> <><><>CHECKPOINT DO <><><> ALSO 0 I SPLAY CHECK PO I NT I N PORT 83

ROLL ERROR CODE IN MFG_PORT AL,OOOH MFG PORT .Al MFG-PORT+3,AL

0573 0575 0577 0579 057B 057B 0570 057F 0582 0584
0586 0588 058A

BO E6 E6 2B

00 80 83
C9

C3l_0:

MOV
OUT OUT SUB SUB

cX,ex

2B CO BE 08 B8 AA55 2B FF 89 05
8B as E2 Fl

MOV MOV
SUB

A'V'>'

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

OS,AX

AX,OM55H
01,01 OS: f 01 l.AX AX.OS:(OI) C3l_A DS:(OI LAX AX,DS:[DI) C3'_B OS: [01 LAX AX,DS:(DI] C3'_C

MOV MOV lOOP MOV MOV lOOP MOV MOV lOOP MOV MOV lOOP MDV MOV lOOP

058A
058C 058E

89 88

E2 fA

as as

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

89 as 88 05
E2 FA

89 05 88 05 E2 FA 89 05 88 05
E2 FA

os: (01 J ,AX


AX.DS:[DI)

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

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

05A2 05A4 05A6 05A6 05A9 05AB


05AD 05AF 05AF 0581

E4 81
E6 80

JN

Al.MFG_PORT+l
MFG_PORT~AL

OU-: MOV MOV MOV LOOP MOV


MO'"

XOR Of FAILING BIT PATTERN HIGH BYTE


WRITE AN AA55

88 AA55 89 05 88 05 t2 F7 89 05
88 05 E2 FA C3el:

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

READ THE FIRST WORD

os: [DI I,AX


AX,DS:[DI

0583 0585 0585 0587 0589

LOOP MOV MOV lOOP

C31_H

89 05 8B 05 [2 FA

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

; -------- ROLL ERROR CODE IN MFC_PORT --> THEN THE lOW BYTE 05BB 05BO E4 82 E6 80

IN
DUT

Al.MfG_PORT+2 MFC_PORT ,AL

lOW BYTE WRITE AN AA)) READ THE FIRST WORD

05Bf OSC2 05C4 05C6 05C8


05CA 05CA 05CC

B8 2B 89 88 E2 89

AA5S FF 05
05 F8

C31_K:

MOV SUB MOV MOV lOOP NOV MOV lOOP MOV MOV lOOP MOV MOV LOOP JMP DW DW DW DW

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


C31_K OS:(OII,AX AX,DS:(DI] C3'_l OS: (01 LAX AX,os:IDIJ C31_M 01,01

05CE 0500 05DO 0502 0504 0506 0506 0508 05DA 05DC
05DE 050

8B 05 E2 FA

as

89 05 8B 05 E2 FA 89 05 813 05
E.2 FA

Ax.os:IDIJ
C31_N

OS:[OI

LAX
DO AGAI N TEMP TEMP TEMP TEMP STACK STACK STACK STACK

EB 95
0526 R 0530 R

C3'_O
2' 22 23

05E2 05E4

053C R 0551 R

24

; ------- CLEAR STORAGE ENTRY

05E6 056
058 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 GET STACK VALUE SET THE STACK UP

OS,AX SP,P05T_SS SS,SP

Test 1 5-41

O~FB

Be 80UO

MOV ; ________ GET THE INPUT

STACK

I S HEADY TO GO

BUFF[R (SWITCH SETTINGS)

05FE 0600 0602 0604 0606 0609 0606

60

'6

BO

"

l'iOV
OUT

AL,11H MFG_PORT, AL AL,DMA PAGE+1 AL,OFOH MFG_IS1,AI AL,AL OMA_PAGE+1, AL

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


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

E4 82 fO A? 0012 R

2"

IN
AND

2A CO

MOV SUB
OUT

E6 82

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 INDICATE COMPABILITY (R[AL) MODE ; GET THE CURRENT STATUS WORD

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

or
01 01 A9 75 37 EO

SMSW

+
+

DB

??OOOO

+ ??0001

LABEL SHL LABEL ORG


DB OKG

aoor

TEST JNZ

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

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

TEST PROTECTED MODE REGISTERS

0615 0617
0619 061A

no

12

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

MOY OUT PUSH POP MOY MOY MOV CALL MOV CALL SUB CALL SUB

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

; SET CHECK f'OINT 12 ; <><><><><><><><><><><:>


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

0615 061 E
0621 06211

I RST PATTERN

06z-t
06?A 0620 062F 0632

ViR \ TE NEXT PATTERN WRITE 0 RESTORE BP REG

TEST 286 CONTROl 0634 0635 0636 0637 OG3A 063C 063F 0641 0642 06 113 06 1 111 061-17 19 06 1 FD 9C 58 A9 75 A9 74 FC 9C 58 A9 75

STD
PUSHF

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

POP
0;:>00 10 0400 DB TEST JNZ TEST JZ CLO PlJSHF

AX AX,0200H ERR_PROT AX,OllOOH ERR_PROT


AX

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

POP
01100 03 nST JNZ

AX,040QH ERR_PROT C37A

GO

J F NOT

EB 3E 90

OGIIC

JMP ERR PROT:

TEST OK CONT I NUE PROTECTED MODE REGISTER FAILURE I NSURE NO BREAKOUT OF HALT

a611e
0640

Ftl m FO

HLT

JMP
WRITE TO 286 REGISTERS

064r 0652

0651,
0657 0658

89 0003 F3/ AB 8D DOAO

26
OF 88 5E 00 01 8D DOAQ ?f. OF 88 56 00 01

+
+

0659
0659

+
+

06SC
OG~9

WRT PA T: r~oY REPSTOSW MaY SECOY DB LI r)l DB LAlILL ??0003 MOY LABEL "?0004 ORG
DB

CX, 3 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 LOAD THE lOT

REGISTER FROM THIS AREA

0659
06%
065C 065F ()660 0661 0661 0664 0661 0661 06611 0664 0667 0668 0669 0669 066C 0669 0669 066C U66C 066F 0670 0671 0671 0674 0671 0671 0674

+
+ "?0006 + + ""0007

ORG MaY SEGOY DB LGDT DB LABEL MOV LAB[L ORG

I.OAD THE GDT FROM THE SAME AREA

DB

DOl H

ORC OFFSET CS; ??0007 READ AND YER I FY 286 REG I STERS BO 08AO 26 OF 8B liE 00 + ??OOQA ['lOY seGoy
DB

SlOT

BP, GOT LOC ES 026H [BP [

STORE THE REG1STERS HERE GET THE lOT REGS

DB

ourti

+ 110009
+

Mav
aRC DB

LABEL LABEL

01 SO 08A5 26

ORC MOY SEGOV


DB

BYTE ex, [BPI BYTE OFFSET CS;??0009 001H OFfSET CS: ??OOOA BP,GOT LOC+5

ES

or
03 46 00 01 BF 8B B9 BE 26: oOAD 05 0005 D8AO 3B 04

SCOT

+
+ "?OOOC +
+ ??OOOO

DB

LABEL
ADD

LABEL ORG

DB
ORG MOV MOV

06 f4

067'1

06'19
067C 067F

C37B:

May May CM'

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

5-42 Test 1

0682 0684 0685 0686 0688

75 C8

'[2 ,6
C3

46

F7

JNZ INC INC LOOP

ERR PROT 51 51 C37B

HALT I F ERROR POINT TO NEXT WORD CONTINUE TILL DONE JNTERRUPT #1 CONTROLLER CHI P : RESET MATH PROCESSOR ICW1 EDGE, MASTER, IC\,'4

RET

;
0689 068S 0680 068F 0691 2A CO E6 Fl

---------- - -- - -------------- ------------------------- - -SUB OUT MOY OUT JMP MOY OUT JMP MOY OUT JMP MOY OUT JMP MOY OUT

INITIALIZE THE 8259 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

C37A;

SO 11
E6 20 EB 00 SO 08 E6 21 EB 00 80 04 E6 21 [B 00

0693 0695
0697 0699 U696 069D 069F 06Al 06A3 06AS 06A7

WAIT STATE FOR 10 SETUP ICW2 - INI rYPE 8 (B-F) WAIT STATE FOR SETlJP leW3 10

MASTER LV 2

SO 01
E6 21 EB 00 SO FF E6 21

10 WAIT STATE SETUP ICW4 - MASTER,8086 MODE WAIT STATE FOR 10 MASK ALL I NTS. OFF (V IDEO ROUT I NE ENABLES NTERRUPT #2 CONTROLLER CH I P

INTS. )

IN J T J AL I ZE THE 8259 06A9 06AB 06AD 06AF 06Bl 06B3 06B5 06B7 0669 0666 06BD 066F 06Cl 06C3 06C5 06C7 06C9 06CB 06CD 0600 0602 060!... 0607 06D8 060A 060B

SO 13 E6 80
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

MOY OUT

AL,13H MFG_PORT,AL

<><><> <><><><><><> <><><> <><><>CHECKPO I NT 13 <><>

MOV OUT JMP MOV OUT MOV ,IMP OUT JMP MOV OUT JMP MOV OUT ;------- SET UP
MOY OUT MOY SUB MOY MOY

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 AL,14H MfG_PORT. AL CX,7BH 01, OJ ES,DI AX, OFFSET 011 AX, CS <><><><><><><><> <><><><> <><><>CHECKPO I NT 14 <><> fiLL ALL I NTERRU PT LOCAT IONS fiRST INTERRUPT LOCATION SET ES ALSO MOVE ADDRESS OF I NT OfFSET GET THE SEGMENT

BO 14 EG 80
B9 2B BE BB
AB AB

0078 FF C7 0000 E

03:

STOSW
MOY

Be CB E2 F7

STOSW LOOP

03
INT[flRUPT VECTORS <><><><><><><><><><><><> <><><>CHECKPOINT 15 <><> VIDIO INT AREA

0000 a60F 06E.1 06E4 06E5 06E6 06E8 06EB 06[E 06EF 06fO 06fl

80 15 E6 80
Bf 0040 R

;------- ESTABLISH BIOS SUBROUTINE CALL MOV AL,15H OUT MFG_PORT,AL MOV PUSH POP MOV MOY MOV D3A: MOVSW INC INC LOOP

DE
1F

8C 08 l3[ 0010 [ B9 0010


A5

OI,OFFSET VIDEO INT CS OS AX, OS ; SI,OFFSET VECTOR_TABLE+16 CX,16 01

S[l

SET UP ADDRESS OF VECTOR TABLE SET AX=SEGMENT ; START WITH VIDEO ENTRY MOVE VECTOR TABLE TO RAM

47 47
E2 FB

01
03A

SKI P SEGMENT

POINTER

; ;

TEST.12 VER I FY CMOS CHECKSUM/BATTERY COOD DESCRI PTION DETERMINe I f CONFIG RECORD SHOULD BE USED FOR INITIALIZATION ASSUME CALL May
OUT

06F3 06F6 06F8

E8 0000 E 80 16

CMOS:

DS:DATA DDS AL,16H MFG_PORT, AL

SET THE DATA SEGMENT <><><><><><><> <><><><><> <><><>CHECKPO I NT 16 <><>

6 BO
; -------

I S THE BATTERY LOW TH I S POWER UP'? May


OUT JMP IN

06FA 06FC 06FE 0700 0702 0704 0706 0708 070A 070e 070E 0710 0712

BO 80
E6 EB E4 A8 74 SO 6 EB E4 70 00 71 80 OF 8E 70 00 71

TEST JZ
MOY OUT JMP IN

A8 BO
74 21

TEST JZ
JMP

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 CMOS4

CHECK BATTERY CONDITION POINT TO BATTERY STATUS WAIT STATE FOR to I S THE BATTERY LOW? GO I F YES GET THE OLD STATUS

HAS CUSTOMER SETUP BEEN EXECUTED? GO CHECK CHECKSUM I F YES CONTINUE WiTHOUT CONFIG

E9 07Al R

SET DEFECT I VE BATTERY FLAG 0715 0717 0719 071B 0710 071F

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 MOV OUT JMP IN XCHG OR MaY OUT XCHC JMP OUT

AI.,17H MfG_PORT, AL 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

<><><><><><><><><><><><> <><><>CHECKPO I NT 17 <><> CMOS DIAGNOSTIC STATUS BYTE GET THE CURRENT STATUS SAVE SET THE DEAD BATTERY FLAG OUTPUT THE STATUS SET FLAG I N CMOS

0721
0723 0726 0728 072A 072e 072E

Test 1 5-43

0130 0733

E6 6f 90 60 E6 EB E4 fB 86 60 E6 81 75 86 24 8E 70 00 71 00

JMP CMOS4 ; ----- VER I FY CHECKSUM CMOS1 :


MOV OUT JMP JMP

GO TO MINIMUM COMFIG 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

013')
0737 0739 0736 073D 073f 0741 0"143 0749 0746 0740 074F 0752 0752 0754 0756

C4 8E 70 JE 0072 A 1234
07

XCHG
MOV OUT CMP

'"

EO 10

J"l XCHG
A"D JMP

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_MM_S I Z CMOSl - B AI,AI CMOS_PORT+l,AL BX,BX CX,CX Cl., CMOS_BEG I N CH,CMOS_END+l AL,CL CMOS_PORT, AL SHORT $+2 AL,CMOS_ PORT+l AH,AH BX,AX
CL

EB 03 90 ?A CO F6 71 2B DB CMOS1 - A,

StiR CMOS1 - B: OUT


SUB SUB Mav Mav

0758
075A 075C 075E 0760 0762 0764 0766 0768 076A 076C 076E 0770 0772 0774 0776 0778

2B C9 81 90 65 AE
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 CMOS2:

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

MOV OUT JMP

,N
SUB ADC

I MC
CMP

J"l
OR

Jl
MOV OUT JMP MOV MOV OUT JMP eMP JZ

unA

077C onE 0780 0782 0784 0786 0788

'"
,

"

74 17

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

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

BO 8E
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

CMOS3:

MOV
OUT JMP

," XCHG

AL,OIAG STATUS CMOS_PORT, AL SHORT $+2 Al,CMOS PORT+l AL,AH AI~,BAD_CKSUM

SET BAD CHECKSUM FLAG 10 DELAY GET THE CURRENT STATUS SAVE IT SET BAD CHECKSUM FLAG 10 DELAY SET FLAG <><> <><><> <> <> <> <> <><> <> <><><>CHECKPOI NT 18 <><>

DR MOV OUT JMP

XCHG
OUT

CMOS4:

MOV
OUT

AL,DIAG STATUS CMOS_PORT, AL SHORT $+2 AL,AH CMOS_PORT+1,AL AL,18H MFC_PORT, AL

ENABLE PROTECTED MODE 07A'j 07A7 07A9 07AB Ell OC r:f3 E6 61

OC
00 61 ; -------

OR JMP OUI

'"

AL, PORT 8 AL,K.AM PAR Off SHORT 3+2 POHT_B,AL

DISABLE IO/RAM PARITY CHK 10 DELAY

SET RETURN ADDRESS BYTE I M CMOS


MOV OUT MOV OUT JMP MDY OUT

DIAD
OlAF 0761

60 19
E6 80

AL,19H MFG_PORf ,AL AI., SHUT_DOWN CMOS_PORT ,AL SHORT $+2 AL.01H CMOS_PORT+1, AL SP,POST_SS 55, SP 5P, POST. SP SYSINITl AL,1AH
~1FG_PORT,AL

<><> <><><><><> <> <><><> <> <><><>CHECKPOI NT 19 <><> SET THE RETURN ADDR 10 DELAY fiRST SHUTDOWN RETN AD DR SET STACK FOR SYSINITl CALL TH[ DESCR I PTOR TABLE BU ILDER AND REAL-TO-PROTECTED MODE SWITCHER <><><> <><><> <> <> <><><><> <><><>CHE"CKPOI NT 1A <><>

07B3
07B5 07B7 0(B9 O/BB 07BE 07GO

BO E6 E6 60 E6
BC 8E BG E8

SF 70 00 01 71 0000 04 8000 0000 E

MOV
MOV MOV

07G3
07e6

CALL
May OUT

Olea

BO lA E6 80

; -------- SET TEMPORY STACK 07CA 07CO 07Cf 0705 07DA 0700 07Df

8E C7 C6 BE 8E BC

B8 0008 08 06 005A 0000 06 005e 00 0058 06 F FrD

MOV MOV MOV MOV MOV MOV MOV

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< ;------INSURE. PROllCJtU MOU!:. SMSW 07E2 07E3 07E3 07E5 073 07[3
AX

GET THE MACHINE STATUS WORD

Of
+ ??OOOE

DB

LABEL
SHL

01

[0
+ ??OOOf

LABEL
ORG

+ 01

DB

OOFH BYTE AX,1 BYTE OFFSET CS; ??OOOE 001H

5-44 Test 1

OtES OIES 07E8 07EA 07Ee OnE 07FO 07F2 07 F4

ORG
A9 0001 7S 10 80 E6 EB 60 E6 E9 8F 70 00 SHUT_8: TEST JNZ foIOV OCT

OFFSET CS:??OOOF AX, V I RTUAL ENABLE VIR_OI< AL., SHUT DOWN CMOS_PORT, AL SHORT $+2 AL.,08H CMOS_PORT+l, AL PROC_SHUTDOWN

ARE WE

I N PROTECTED l'lODE

SET THE RETURN AODR 10 DELAV SET SHUTDOWN 8 CAUSE A SHUTDOWN

OB
71 0000 E J;1P

;-------- VIRTUAL MODE ERROR HALT

07U
ona

",

SHUIS:

EB FL

IILI JMP

SHurB

ERROR HALT

;------- 64K SEGMENT LIMIT DHA C7 06 0048 FFFF ;------- CPLO, 0800 C6 06 0040 93 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 0810 0812 0814 c6 06 OOllC 01 C7 06 004A 0000
BO

MOV MOY MOV


OUT

BYTE PTR OS: ( ES_ TEMP. BASE_H I_BYTE) ,01 H OS: ES_ TEMP. BASE_LO_WORD, OH AL,lBH MFG_PORT, AL. BX,16*4

[6

18 60

<><><><><><> <> <><><> <><> <><><>-CHECKPO I NT 1 B <><>


SET THE FIRST 64K DONE

BB 0040

MOV

;------- START STORAGE SIZE/CLEAR 0817 0817 081A NOT DONE: MOY MOV CALL PO I NT ES TO DATA PO I NT TO SEGMENT TO TEST 00 THE" FIRST 6L: K CHECK I r TOP OF RAM BUMP MEMORY COUNT BY 611K BL.OCK

OBlC 031 r 0821 0824 0824

Ba BE [B 74 E9

0048 CO 0838 R 03 08B7 R

JZ
JMP NOT FIN:
ADO

AX, IeS_TEMP [S AX HOW BIG NOT-F I N DONE 8X,16*1,

83 C3 40

; ------- DO NEXT 64K (OXOOOO) 0827


FE 06 004C

I NC

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 3E 004C OA E5 088B R 08B7 R ; ------0838 0838 083A 083D 083F 0842 084 11 0847 084A oa4C 084 U8 1 1F 0852 HOW_BIG:
eMP

JNZ CALL JMP

BYTE PTR DS:(ES TEMP.BASE HI_BYTE),OMI NOT DONE HOW-BIG END DONE -

GO I F NOT GO SET MEMORY SIZE

FILL/CHECK LOOP SUB MOV MOV MOV MOV MOV MOV XOR JNZ PUSH MOY MOY CMP POP J NZ MOY IN JMP OR OUT JMP AND OUT t10V PUSH POP MOV IN AND MOY J NZ

28 FF 138 AAS5
8B C8 26: 89 05 60 OF 26: 8B 05 26: 89 05 33 Cl 75 3D

01,01
AX,OAA55H CX, AX ES: [D! [,AX AI_,orH AX,ES:[DI[ ES:[Dlj,AX AX, ex HOW_B IG_ENO OS AX, RSOA_PTR OS,AX RESET fL.AG,1234H 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 SOfT RESET RESTORE OS GO I F NOT SOFT RESET TURN OFF BOTH PARITY BITS 10 DELAY TOGGLE PAR I TY CHECK ENABLES 10 DELAY

IE
B8 BE 81 IF 75 26: 0018

08
3E 0072 R 1234

085 l l
085A 085B 085D 0862 0864 0866 OB68 086A DB6e OB6E 0810 0873 08711 0875

os-

26
e7 05 0101

HOW_B! G_2 WORD PTR [S:[OI ],0101H Al.,PORTG SHORT $+2 Al,RAM PAR OFF PORT B-;-AL SHORT $+2 AL, RM1_PAR_ON PORT_B,AL AX,orrrnl AX AX AX,ES:[Dlj AL, PORT.,_B AL, PAR I TY _ERR WORD PTR ES:[OI),O HOW_B I G_E..NO

[II 61 13 00 OC DC E6 61 EB 00 24 F3 E6 61
B8 50

rFFF 8B 05

58
26: F)I 61 21+ co 26: C7 05 0000

D[LAY CHECK PAR I TV CHECK FOR PARITV/IO CHECK I NSURE NO PAR I TY 10 CHECK GO IF PARITY/IO CHECK WR I TE ZEROS SET COUNT FOR 32K WORDS F j LL 32K WORDS

OB78 Oa7A
087C 0881 UB83 0883

75 08
28 CO 89 8000 F3/ AS C3 9C

HOW BIG 2: -SUB MOY REP

AX, AX
CX,2000H*4 STOSW

0885
0888 OB8A OBBa 0888 OBBe 088E

RET
HOW BIG [NO; --PUSHF MOV OUT SAVE THE CURRENT AL,lCH MFG_PORT ,AL FLAGS <><><> <> <> <><><><><><><> <><>CHECKPO I NT IG <><><>

80 1C
6 80

;-------- SET OR RESET 512 TO 640 0890 OB92 OB94 0(396 0898 OB9A 089C 089E OBAO OBA2 08A6 08A8 08AA BO 6 EB Ell OC 86 80 E6 B6 B3 70 00 "1 I BO CII B3 70 C4 FB 0200 02 7F 71 t10V
OUT

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

JMP
IN

OR XCHG MOV
OUT

81
77 24 E6

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

INSTALLED

Test 1 545

08AC 08AF 08Bl ORB') 08B6

B8 0018 8E 08 89 lE 0013 R

MOV MOV MOV

AX, RSOA PTR DS,AX MEMORY_SIZE,BX

RESTORE THE DATA SEGMENT SAVE MEMORY SIZE RESTORE THE FLAG REG

90 C3

popr
RET
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

08B7 08B7

OONE: B8 0008 8E D8
MOV MOV

aBBA

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


BO 10 6 80
2S OS

MOV MOV MOV


OUT SUB

BYTE PTR os: (ES_TEMP.BASE_HI_BYTE),lQH as: ES_TEMP. 8ASE_LO_WORD. OH AL,lOH MFG_PORT, AL BX, BX <><><><><><><><><><><><> <><><>CHECKPO I NT 10 <><> START WITH COUNT 0

OBC7
08C9 08CS

;------- START STORAGE SIZE/CLEAR 08CD 08CO 0800 0802 0805 0807 08DA NOT 00NE1: MOV
MOV

68 0048 BE CO E8 08EE R 74 03 EB 75 90 83 C3 40

CALL JZ
JMP

AX, ES TEMP ES, AXHOW_BIGl DONEA DONE1 BX,16*4

POINT ES TO DATA PO I NT TO SEGMENT TO TEST DO THE FIRST 64K CHECK I F TOP GO I F TOP BUMP MEMORY COUNT BY 64K

DONEA:

ADD

; ------- DO NEXT 6JIK (XXOOOO) BLOCK 0800 FE 06 004C INC BYTE PTR DS:(ES_TEMP.BASE_HI_BYTE)

;------- CHECK FOR TOP Of RAM (fEDOOO) 08El 08El 08E6 08E8 08EB 08EE 08EE DeFO 08FJ 08FS oaF8 08FA 08FO 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
MOV

; ;

LAST OF POSS I BLE RAM, GO I F NOT

; GO SET MEMORY SIZE

28 FF

B8 AA55
88 C8 26: 89 05 60 OF 26: 88 05 26: 89 05
_33 Cl

MOV MOV MOV MOV


XOR

0900 0902
0904 0905

75 2F

JNZ PUSH
~\oV

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

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 POINT TO SYSTEM DATA AREA SOFT RESET RESTORE OS GO I F NOT SOFT RESET TURN OFF BOTH PAR I TY BITS

1E B8 0018

os
AX, RSDA PTR DS,AX RESET_fLAG,1234H OS HOW_B I G_2A \.lORD PTR ES;[0Ij,0101H AX,OFFFFH
AX AX

0908
090A 0910 0911 0913 0918 091B 091C 0910 0920 0922 0924 0929 092B 092B 0920 0930 0932 0933 0933 0935

8E 08
81 3E 0072 R 1234

1F
75 18 26: C7 05 0101

MOV eMP POP

JNZ MOV
POP

88 FFFF 50 58
26: 88 05 Ell 61 A8 40 26 : C7 05 0000 75 08

t-tov
PUSH

MOV

IN
TEST
I~OV

AX, ES: [0 11 AL, PORT B AL, rO_CHK WORD PTR ES: [D I], 0 HOW_BIG_ENDl AX,AX eX,2000H*4 STOSW

DELAY CHECK PAR I TY CHECK fOR 10 CHECK I NSURE NO PAR I TY GO IF 10 CHECK 10 CHECK

26 CO 09 8000 F3/ A8
e3
80 1 E E6 80

JNL HOW BIG 2A: -SUB MOV

REP RET
HOW BI G ENOl: -MOV
OUT

WRITE ZEROS SET COUNT FOR 321< WORDS FILL 32K WORDS

AL,lEH MFG_PORT, AL 10 RAM SIZE IN CMOS

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

;------- SET 0937 0939 0938 0930 093F 0941


09t~3

0945
0947 0949 0946 0940

BO 70 00 C3 71 00 61 70 EB 00 8A C7 E6 71

BO E6 EB 8A E6 EB BO [6

MOV
OU, JMP

MOV
OUT
Ji~P

MOV OUT JMP

MOV
OUT

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

e3

RET
; ------- TEST ADDRESS Ll NES 19 23

094E 0950 0952 0957 095A

BO 1F
E6 C6 BA E8 2B C6 [8 C6 E8 C6 E8 c6 E8 80 06 004C 00 fFFF 09BA R

DONE1:

MOV
OUT

MOV MOV CALL


SUB

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

0950
095F 0964 0967 096C 096F 0974 0977 097C

02
06 004C 098A R 06 004C 098A R 06 004C 098A R 06 004C 098A R 08 10 20 40

~~~DX
BYTE SOO BYTE SDO BYTE SDO BYTE SOO

WRITE 0

MOV CALL MOV CALL MOV CALL MOV CALL

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 ;

5-46

Test 1

D97F 0981 , 0987 098A 098C 098F 0991 0994 0999 099C 099E 09A3 09A? 09AB

C6 06 004C 80 [8 098A R EB 20 90 28 fF B8 0048 8E CO 26 : 89 15 C6 06 004C 00 B8 BE 26: 74 E9 0048 CO 81 3D rFrF 03 07EA R


SOD:

MOV CALL
JMP

BYTE PTR DS: ( ES~ TEMP. BASE_H I_BYTE), 80H SOO SD2 OI,DI AX, ES TEMP ES,AXTEST PASSED CONT I NUE

SBB ,t,OV !'10V MOV MOV

ES: [01 LOX

WR I TE THE

POINT ES TO DATA PO I NT TO S[Gr'1ENT TO TEST PATTERN

BYTE PTR DS:(ES_TEMP.BASE_HI_BYTEj,OOH

MOV MOV
GMP

AX, ES_TEMP
ES,AX WORD PTR E.S:[DI J,OFFFFH

J7
Jr~p

Sal
SHUT _8

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

C3

SOl:

RET

; ------- CAUSE A SHUTDOWN 09A9 09AB 09AD 30 20

502:

MOV
OUT JMP

AL,20H

<><><><><> <><><><> <><><>


<><><>CHECKPOINT 20 <><> CAUSE A SHUTDON (RETURN VIA JUMP

1'"6 80
E9 0000 E
;

MfG PORT. AL
PROC_SHUTDOWN

--- ----------- - - -- - - -- ------- -- --- - -- - - - ------ - - ---- -- -RETURN 1 FROM SHUTDOWN


MOV

09130 09B2 09B4 09B7 D9B9 09Re 09BF

oe

BO 21 E6 80
---R

SHUll;

BE 01,

Mav r-lov
MOV

OUT

Be 0100 R B8 ---- R

AL, 21 H MFG_PORT ,AL SP, STACK SS,SP SP,OFFSET TOS


AX,DATA OS,AX

<><> <><><><> <><><> <><><> <><><>CHECKPOINT 21 <><> SET REAL MODE STACK

8 08

Mav Mav Mav


OUT

SET UP THE REAL DATA AREA

;-------- 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
E6 70
[:(j

lJU

E4 A8 74 EB 8A

{1

CO
M_OK:

03 77 90 EO BO BE E6 70 86 01 21\ OF E6 71 80 94 EB 00 E6 -to EB 00 E4 71

JI-IP IN n:ST JZ JMP MOV MOV


OUT

AL, 0 I AG.,STATUS CMOS_PORT,AL SHORT $12 Al, CMOS_PORT+l AL,OCOH


M OK

CHECK CMOS GOOD GET THE STATUS OK? GO IF YES GO I F NOT SAVE THE CMOS STATUS ADDRESS THE D I AG STATUS RESTORE THE STATUS BYTE CLEAR THE I~IN CONFIG BIT GET THE EQU I PMENT BYTE 10 DELAY

XCHG ANa
OUT

MOV
JMP OUT
Jt~P

IN ;--------

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

INSURE CONFIGURATION HAS CORRECT VIDEO TYPE AH,AL AL,030H MOS_OK_1 CHK V IDEO MOS:'::OK MfG_ TST, MFG_JMP NORMAL_CON FIG SAVE VIDEO TYPE ANY VIDEO? CaNT I NUE INSURE VIDEO ROM PRESENT CONT I NUE EXCEPT IF MFG JUMPER IS INSTALLED

09[6 09E8 09E" 09EC 09EF 09Fl

8A A8 75 E8 711

EO

30
2E 09FB R 4A

MOV TEST
,I NZ

CALL JZ TEST JZ

09F6
09F8 09rB

Ff) 06 0012 R 20 74 7A

GO IF INSTALLED

B IIG 90

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 eX,OCOOOH
AX OS DS,CX

09H} 09FE 09FE

89

cuou

START OF

\0 ROM

50
1E 8E 09 2B DB 88 07 1F 3D AA55

09FF
DADO OA02 OA04 OA06 OA07 OAOA OADB OAOO OAll
~AlS

SAVE THE CONF I G SAVE THE DATA SEGMENT GET THE fiRST 2 LOCATIONS

ex, BX
DS

AX, [BXJ AX,OAA55H AX CHK VIDE02 CX, (jaOH CX, QCBOOH CHK VIOEOI 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
RETUI~N

58

OA17 OA19 OA19

.'

711 OC 81 Cl 0080 F9 C800 7C E7 23 C9


G3

JZ
ADD
Cl~P

JL AND

cX,ex

CHK VIOE02: RCT ;-------- CMOS VIDEO BITS NON ZERO

TO CALLlR

(CHECK FOR PRIMARY DISPLAY AND NO VIDEO ROM)


; I S THE V IDEO ROM INSTALLED? WRONG CONFIGURATION IN CONFIG BYTE.

OA1A OA1A OAHl GAl r OA21 OA26

[8 09FB R 74 27

MOS OK 1: - CALL

JZ
MOV TEST JL

CHK VIDEO BAO=MOS AL, AH NFC TST,DSP JMP MOS=OK_2IS PRIMARY DISPLAY

8/... C4
F6 06 0012 R 40
74 OB

f\ESTORE CONF I GURATl ON CHECK FOR DISPLAY JUMPER GO IF COLOR CAHO IS PRIMARY DISPLAY (NO JUMPER INSTALLED)

;-------- MONO CARD

DAZ8
OA2A UA2e GA2E OA30

24 30 3C 30 7'5 18 8A C4 EB 09 90

AND
eMP

JNZ MOV
JMP

AL,30H I\L,30H BAO MOS AL,AH MaS_OK

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

MOS OK 2: - AND

3C 30
8A C4 74 OB

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 OA3B OA30 OA3F OA44 A8 01 75 33 F6 06 0012 R 20 74 2C
f~OS_OK:

TEST JNZ TEST

AL,OlH
NORf~AL CON F j G MFG_ TST, MFG_JMP NORMAL_CONFI G

JZ

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 547

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

8E 70 00 71 CO DE c4 BE 70

MDV OUT JMP IN

TEST
JNZ

AL, 0 lAG_STATUS CMOS PORT, AL SHORT $+2 AL,CMOS_PORT+l AL,OCOH BAD MQSl

GET THE DIAGNOSTIC STATUS

XCHG
MOV OUT JMP

00
C4 20

XCHG
OR
aUT

AL,AH AL. 0 lAG_STATUS CMOS PORT, AL SHORT $+2 AL,AH Al,20H


CMOS_PORT+l,AL
CHK VIDEO

WAS THE BATTERY DEFECTIVE OR BAD CKSUM GO I F YES SAVE THE STATUS CHECK CMOS GOOD RESTORE THE STATUS SET TH MIN eONFG FLAG STORE THE STATUS CHECK fOR V IDEO ROM DISKETTE ONLY GO I F V IDEO ROM PRESENT CHECK FOR 0 I SPLAY JUMPER DEFAULT TO 40X25 COLOR GO I F JUMPER J S INSTALLED

E6 71 E8 09fB R BO 01 74 OB
f6 06 0012 R 40 80 11 74 02

BAD MOS1: CALL


MDV JZ

OMi3
OA65 OM7 OA6C OA6E OA70

AL.01H NORMAL_CON FIG MfG_ TST. OSP _JMP AL, 1 lH NORMAL_CON FIG AL,31H

TEST
MDV JZ MDV

80 31

01 SKETTE /

BW CRT 80X25

CONFIGURATION AND MFG. MODE

OA72 DA72 OA77 OA79 OA7B OA7D OABO OAB6 f6 06 0012 R 20 75 02 24 3E 2A A3 81 74 E4 0010 R 3 0072 R 1234 2C

NORMAL_CONF I G: TEST
JNZ AND

MFG_TST, MFG_JMP NORMl AL,03EH


AH,A!1

I S THE MANUFACTUR I NG JUMPER GO IF NOT STR I POI SKETTE fOR MfG TEST SAVE SWITCH INFO BYPASS I F SOfT RESET

INSTALLED

NORM1:

SUB
MDV eMP JZ

EQUIP fLAG,AX RESET-FLAG,1234H


E6 -

; _______ GET THE FIRST SELf TEST RESULTS FROM KEYBOARD

OA88 OASA OASD OA8F OA91 OA93 OA96 OA99 OA9S OA90 OA9F OAAO OM2 OM5 OM6 OAA8

80 60 E8 01105 R 80 40 E6 60 2B C9 E8 040A R B9 7FFf 4 64 AS 01 El FA


T516:

Mav CALL MDV

AL,60H

C8042
AL,4DH PORT_A,AL

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 WAIT FOR COMMAND AGCEPTED

OUT SUB

eX,ex
e42 1

CALL
MDV IN

eX,07FFFH

AL, STATUS_PORT
AL.OUT_BUf_fULl TST6 AL, 01 S_KBD

SET LOOP COUNT FOR APPROX 100 MS TO RESPOND WA I T FOR OUTPUT BUfF FULL
TRY AGAIN IF NOT

TEST LOOPZ PUSHF


MDV

ge
BO AD E8 0405 R

90
74 DC 4 60 A2 0072 R

CALL POPF
JZ IN MOV

C8042
E6

DMA

AL. PORT_A BYTE PTR RESET _FLAG,AL

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

; -------- CHECK FOR MFG REQUEST

OAAD OAAF OABl

3C 65
75 03

9 002e R
TEST

eMP JNE JMP


.ll~

AL,065H
E6

;
;

LOAD MFG.

TEST REQUEST? I F SO

MFG_6DDT

GO TO BOOTSTRAP

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 E6:

OAB4 OAB4
DAB7

Al 0010 R 50

MOV

AX, [QU I P_FLAG


AX

PUSH
MDV MOV SUB I NT MDV MDV SUB I NT MOV I NT POP MDV AND JNZ

GET SENSE SAVE IT

INFO

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

80 30
A3 2A CD BO A3
~OlO

co 10
58

E4 10 20 0010 R 2A 4 B8 0001

CD 10 A3 ~OlO R 24 30 75 12

AL,30H EQU I P_FLAG, AX AH,AH INT_VIDEO AL,20H EQUIP FLAG,AX AH,AHINT_VIDEO AX,0001H INT VIDEO
AX -

SEND 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

EQUIP_fLAG,AX AL,30H E7
OS

1E 50 2B CO BE 08 SF 0040 R C7 05 0000 E 58 1F E9 OB68 R


7: 3C 30

PUSH PUSH
SUB MOV MOV MOV POP PDP JMP eMP JE I Ne eMP JNE MOV

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
OS

E18_1
AL,30H
EB AH

74 FE 3C 75 64 86 50 2A CD 58 50 BB BA

08 C4 20 02 03 EO EI+
10 BODO 03B8

AL,20H

E8
AH,3 AH,AL AX AH,AH INT VIDEO

8:

XCHG PUSH
SUB INT POP

AXAX

PUSH
MOV MDV

BX,OBOOOH DX,3BSH

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

5-48

Test 1

OB04 OB07 01309 OBOC OBOE OB10 OB13 OB15 OB17 OB17 OB18 OB1A OB1C

89 0800

60 01
80 74 87 BA B5 FE EE 8E 8E 01 8 75 FC 30 09 B8 0308 20 C8 E9: C3 DB C9

MOY MOV

CMP JE Mav Mav Mav aEe


aUT May May
RaR

CX.2048 AL,l AH,30H

E9 BH, D8SH OX,3D8H CH,20H AL


DX,AL ES,BX

os. ax
E,7

ORl E
OB21

0000
6F ; ; ; ;

CALL JNE

CX.l STGTST_CNT

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

RAM SET B/W YES BEG

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.

0623 0623 0825 OB27 OB28 OB29 OB2B OB20 OB30 OB32 OB35

bo:
BO 22 6 80

May OUT pap PUSH


MaY

AL,22H MFG_PORT. AL

<><><><><><><><><><><><> <><><>CHECKPOI NT 22 <><> 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

58 50
B4 00 CD 10 B8 7020 2B FF 69 0028 F3/ AS

INT

Mav
SU8

May
REP

;
; ; ; ;

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

AX AX AH,O INT VIDEO AX.7020H 01,01 CX,40 STOSW

TEST.16 CRT I NTERF ACE LINES TEST OESCRI PTION SENSE ON/OfF TRANSITION OF THE VIDEO ENABLE AND HORIZONTAL SYNC LINES.

--- - - ------- ----------: :

OB37 OB38 OB39 OB3C DB3F OB41 0844 0844 OB46 OB46 OB48 OB49 OB4B 0840 OB4F 0851 OB53 OB54 0856 OB58 OB5A

58 50
80 SA 74 8A FC 30 03BA 03 03DA Ell: 84 08 E12: 2B C9

POP PUSH eMP May JE May May


SUB

AX
AX AH,30H OX.03BAH E, , DX,030AH
AH.S 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: OFLOOP_CNT: 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 READ CRT STATUS PORT CHECK V' DEO/HORZ LINE ITS ON - CHECK NEXT LINE LOOP 1F ON TILL IT GOES OFf GO ERROR BEEP

EC 22 75 F? EB 28 [C 22 74 E2 B

E13: C4 04 F9 41 C9 C4

IN ANa JNZ
LOOP JMP
SUB

E14: E15:

05
F9

36 90

IN ANa JZ LOOP JMP

E'4 E13 SHORT El7 CX.CX AL,oX AL,AH E' 6

[15

E17

; ;

;------- CHECK HORIZONTAL LINE 0850 aBSF OB61 OB63 OB63 0864 0666 S1 03 02 EC 75 3 E16: E1S:

May SHR JNZ pap Mav

CL,3 AH,CL

GET NEXT BIT TO CHECK CONT I NUE o I SPLAY CURSOR; GET V IDEO SENSE SWS (AH) SET MODE AND SPLAY CURSOR CALL VIDEO I/O PROCEDURE

E, 2 AX AH,O INT_VIDEO
A~VANCED

58
B4 00 CD 10

INT

0'

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

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

53
58

May PUSH
POP

.,

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

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

; ; ;

rOST2

; -------- CRT ERROR SET MfG CKPT AND ERR BEEP OB92

8 0000 E

E17:

CALL

DDS

POINT TO DATA

;-------- CHECKPOINT OC "" MONO FAILED OB95 OB9A OB9F OBAl 013A6 OBA8 OBAB OBAE OBAF 0882 0884 OB86 C6 80 74 F6 74 BA E8

06 0015 R DC

3E 0072 R 64 00 06 0012 R 20

06
0102

0000 E
0010 R 30 30 31

,E Al 24 3C 74

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

MOV CMP

JZ

;-------- CHECKPOINT 00 "" COLOR FAILED OBB8 aBBD aBCO OSC2 aBC3 aSC6 OBCS c6 06 0015 R 00 BA 03BS BO 01

May May Mav aUT May Mav


Mav

MFG_ERR_fLAG, DOH OX,3B8H AL,1 OX,AL SX, DBODDH OS,BX AX,OAA55H

; <><><><>CRT ERR CHKPT. DISABLE B/W

00<><>

EE
BB BODO 8E DB BS AA55

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 56 DE 0010 R 0030 0010 R

[4
10 35 90

SUB MOV JMP MOV CMP POP JNZ OR MOV SUB INT JMP

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

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 GO

AX, EQU I P_FLAG AL,30H AL.30H AL.,AL 17_2 AL AX E18

I T THE B/W?

I F YES INIT FOR 40X25

;------- BOTH VIDEO CARDS FAI LED SET DUMMY RETURN I f OC2F OC2F OC30 OC32 OC34 OC37 OC3B OC3C OC3F OC3f E17_3:
1E

RETRACE fALl URE

26 8E BF C7

CO 08 0040 R 05 0000 E POSTl CODE

1F
E9 OB68 R

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 ].OFFST DUMMY_RETURN ; RETURN IF NO VIDEO CARD OS E18_1 ; 8YPASS REST OF V IDEO TEST

5-50

Test 1

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 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 EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN 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 H5: NEAR POST7:NEAR SET TOD:NEAR EO:"NEAR EO A: NEAR O::::B: NEAR 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 E1: NEAR ADERR1: NEAR ADERR:NEAR Fl: NEAR LOCK: NEAR Fl A:NEAR F1::::B:NEAR E1 B:NEAR

0000

101 ERROR CODE , 02 ERROR CODE 103 lRROR CODE 104 ERROR '05 ERROR 106 ERROR 107 ERROR 108 ERROR 109 ERROR 161 ERROR 162 ERROR 163 ERROR 164 ERROR CODE CODE CODE COOE CODE CODE CODE CODE CODE CODE

201 ERROR CODE 202 ERROR CODE 203 ERROR CODE 301 302 303 304 401 501 601 ERROR ERROR ERROR ERROR CODE CODE CODE CODE

ECC: NEAR
F3:NEAR KBD RESET: NEAR GATE_AZO: NEAR

ERROR CODE ERROR CODE ERROR CODE

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
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
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 POST2 ?ROC
MOV

CS:CODE OS:DATA NEAR AL,10


PRT - HEX DDS IMR REG I STERS

BO OA
[8 0000 8 0000 E

C2l:

LI NE FEED ON CRT

CALL CALL TEST THE

; SET DATA SEGMENT

0008

FA

C21A: Al 00 Zl

eLi
MDV OUT OUT JMP IN MOV IN OR JNZ MOV OUT MOV OUT

0009 OOOB
0000 OOOF 0011 0013 0015 0017 0019 001S

BO 00 6 21
E6 EB E4 8A E4

to

Al

AL,O INTA01,AL I NTBD1, AL SHORT $+2 AL,INTAOT AH,AL AL, I NTBOl AH,AL

TURN OFF INTERRUPTS SU IMIi 10 LERO SEND TO 2ND I NT READ t MR SAVE RESULTS READ 2ND IMR BOTH IMR = O? GO TO ERR ROUTINE IF NOT 0

OA EO 75 2C BO 25 E6 80 BO FF E6 2'

06
AL,25H MFG_PORT, AL AL,OFFH tNTA01,AL

0010 DOlf aD?'

; <><><><><><><><><><><><><><> ; <><><>CHECKPO t NT 25 <><><><> ; ; D I SABLE DEV t CE WRITE TO IMR I NTERRU?TS

Test 2 5-51

0023 0025 0027 0029 0028 0020 0030

[6 A 1 EB 00 [14 21 8A [0 Ell Al

OUT JNP IN MOV

IN
ADD JNZ

I NTB01, AL SHORT $+2 AL, I NTA01 AH, AL AL,INTB01 AX,l

WRITE TO 2ND 10 DELAY READ I MR SAVE RESULTS READ 2ND IMR

IMR

05 1 75 15

oao

06
FOR HOT INTERRUPTS

ALL IMR BIT ON? NO - GO TO ERR ROUT I NE

; ----- CHECK

INTERRUPTS ARE MASKED OFF. 0032 A2 006B R


MDV MDV OUT

CHECK THAT NO ; CLEAR

INTERRUPTS OCCUR. I NTERfWPT FLAG

IN fR ~FLAG,AL AL,26H MFG_PORT, AL

0035
0037 0039 003A 003C 003E 0040 0045 0047 004C aO/IF 0052 0053

BO 26 E6 80

; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 26 <><><><> ENABLE EXTErWAL INTERRUPTS WAIT 1 SEC FOR ANY INTRS THAT M I CHT OCCUR DID ANY INTERRUPTS OCCUR? NO - GO TO NEXT TEST <> <><> <> <><> <><><><> <><> <><> <><>CHECKPO I NT 5<><><><><><> D I SPLAY 101 ERROR HALT THE SYSTEM

rB
2B [2 2 80 '4 C9 FE FE

011:
05:

3E OOGB R 00
00

ST I SUD Loor LOOP GI1P JZ


MDV

CX,CX

a;

04
I NTR _FLAG, OUfI

07
MFG_ERR.JLAG,OSH SI,OFFSET E- MSG

C6 06 0015 R 05 BE 0000 E8 0000 FA F4

Dr;:
D6A:

Mav
CALL

Ea

eLi
HLT

; -------CHECK THE CONVERT I NG LOG I C 0054 0056 0058


OO~B

80 27 E6 80 B8 AA)5 E7 82 E4 82 86 C4 EB 00 E4 83 3D 5SM 74 05 BE 0000 E EB EO

07:

MOV OUT

Al,27H MFG_PORT ,AL AX,OAA551i MFG_PORT+2, AX AL, MFG_ PORT+2 AL,AH SHORT $+2 AL, MFG_PORT+3 AX, 55AAH 07 - A SI ,OFFSET CM4_A D6A

; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 27 <><><><> 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

0050 005F 0061 0063 0065 0068 006A 006D

II,OV OUT IN XCJlG JMP IN CMP JZ


MOV JMP

D I SPLAY 106 ERROR


10/RAM PARITY ENABLED

;------- CHECK fOR HOT NMI 006F 006F 0071 0073 0075 0077 007A 007e 007E 0080 0082 0084 0086 0088 008A 0080 AL,AL MfG_PORT,AL

INTt:RRUPTS WITHOUT

2/0. CO 6 80 0f 70 OOFF FE BO 8 F E6 "fa [I, 80 OA CO 74 U9 BO E6 B9 E2

SUB OUT MDV OUT MDV LOOP MOV OUT IN

SET FLAG TO ZERO SAVE IT TURN ON NM I DELAY TURN OFr NM I ANY NMI? CONT 1 NUF I F NOT

07 - Bo

OR
JZ MOV OUT

AL,OFH CMOS .PORT, AL CX,OOFFH D7 B AL-;-8FH CMOS_PORT,AL AL, MFG_PORT AL,AL D7 - C At., ?8H MrG _PORT,AL SI,OFFSET eM4 B D6A

BO 28 E6 80
BE 0000 8 eo

; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 28 <><><><>

MOV JMP

DISPLAY 107 ERROR

;------- TEST THE DATA BUS TO TIMER 2 0081 0091 0093 0095 009, 0099 0098 0090 OD9F DOAl 00A3 00A6 00A8 QOAA OOAC OOAE 0080 0082 OOBII 00B6 0088 00B8 0080 OOCO

BO ?9
[6 80 [It 61 8A EO EB 00 24 Fe E6 61

D7_C:

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 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 SIIORT $+2 AL, TIMER+2 AH,AL SHORT $+2 AL, T I MER+2 AX,OS5AAH
D7~D

; <><><><><><> <><><><><><><><> ; <><><>CH[CKPO I NT 29 <><><><> GET CURRENT SETT I NG OF PORT SAVE THAT SEll I NG 10 DELAY I N5Ur1E SP[AKER OFf

BO BO
E6 EB 68 E6 EB 8A [6 43 00 AA55
112

Mav
OUT JMP MOV OUT JMP !"-IOV OUT

00 Gli 42

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

Wf{ I 11:. I I MI:.R 2 eN


10 DELAY GET THE L5B SAVE IT 10 DELAY GET THE MSB BUS 01(7 GO I F OK DISPLAY 108 ERROR

MSB

EB 00 E4 42

86 F.O
EB E4 3D 74 00
112

55AA 05 I'10V JMP

BE 0000 E EB 80

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.

DOESN'T COUN,

OOC2 OOC4 00C6

ooer

OOC9 OOCB OOCD GoeF

BO E6 FA BO E6 BO E6 B9

2A
80 FE 21
10 43 002C

07_0;

MOV

our eLi

AL, ZAH MFG_PORT,AL AL,OfEH INTA01,AL AL, 000 1 00008 T I M_CTL, AL CX,16H*2 SHORT S+? AL,Cl TIMERO,AL INTR_fLAG,01H

<><><> <><> <><><><><> <><> <><> <><><>CHECKPOINT 2A <><><><> MASK ALL I ~!TRS EXCEPT LVL 0 WR I TE THE 3259 I MR SEL TIM 0, LSB, MODE 0, BINARY

MOV OUT
r~ov

OUT MOV

'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

0002
00D4 0006 OOOB 0009

Eli 00 8A C 1 E6 40 FB F6 06 006B R 01

08:

JMP 1'10V OUT STI TEST

552

Test 2

OOOE ODED 00E2

75 OD E2 F7 C6 06 0017 K 02

JNZ

LOOP
MOV

DO DB

DID TIMER 0 INTERRUPT OCCUR"! YES - CHECK TIMER OP FOR SLOW TIME WAIT fOR INTR fOR SPECifiED TIME ; <><><><><><><><><><><><><><> ;<><>TlMER CHECKPOINT {2l<> DISPLAY 102 ERROR TI MER 0 I NTR 0 I ON' T OCCUR ; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 28 <><><><> SET PGM LOOP CNT WR I TE TI MER 0 CNT REG RESET I NTR RECE I VEO FLAG REENABLE TI MER 0 I NTERRUTS DID TIMER 0 INTERRUPT OCCUR? YES - TIMER CNTING TOO FAST, ERR WAIT FOR INTR FOR SPECIFIED TIME

MFG_ERR_FLAG,02H

00E7 OOEA ODED DOEF 00F1 00F2 00F4 00F6 00F8 OOFO OOFF 0101 0102 0107 0109

BE 0000 E 9 004 F R BO 28 E6 80 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

D8_A: 09:

MOV
JMP

SI,OFFSET EO_A

00.
AL,2BH MFG_PORT, AL CL,12 AL,OFFH TIMERO,AL INTR FLAG,O AL,O'FEH INTA01,AL I NTR_FLAG, 01 H DB A 010

ERR

MOV
OUT

ell
MOV MOV OUT MOV MOV OUT

010:

STI TEST
JNZ

LOOP

;------- WAIT fOR INTERRUPT 010B 0100 OlOF 0111 0116 0118 011A 0110 2B C9 BO 2C E6 80 F6 06 0068 R 01 7508 E2 F7 BE 0000 E E9 004F R
SUB
MOV OUT

CX,CX AL,2CH MFG_PORT ,AL INTR fLAG,OlH 012 ; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 2C <><><><> DID TIMER GO IF YES TRY AGAI N

all:

TEST
JNZ

INTERRUPT OCCUR?

LOOP
MOV JMP

0"
Sl,OffSET EO_B D6A

OISPLAY 103 ERROR ERROR I F NOT

SETUP TIMER 0 TO MODE 3 0120 0121 0123 0125 0127 0129 012B 0120 012F 0131 FA BO 6 80 E6 EB BO E6 EB E6
012:

FF 21 36 43 00 00 40 00 40

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

=====:=======""====================;==
CX, CX AL,2DH MfG_PORT, AL AL, STATUS_PORT AL,INPT_BUf_FULL E19 013 EXIT (MSG 105) Sl,OffSET CM4 D6A

0133 0135 0137 0139 013B 0130 013F 0141 0144

2B BO 6 E4 A8 74 2

C9 20 80 64 02 DB F8

013:

SUB Mav OUT IN TEST JZ LOOP ERROR


MOV JMP

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

BE 0000 E E9 004F R

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 0147 0147 014A 014C 014E 0154 0156 E19: E8 0000 E BO 2F E6 80 B1 3E 0072 R 1234 75 03 9 0558 R CALL
MOV OUT eMP JNE JMP

OS: DATA
DDS AL,2FH MFG_PORT. AL

; SET DATA SEGMENT ; <><><><><><><><><><><><><><> ;<><><>CHECKPOINT 2f <><><><> WARM START? ; GO If NOT ; GO TO NEXT TEST I f WARM START

RESET_fLAG,1234H E19A SHUT2

; ------- SET SHUTDOWN RETURN 2 0159 0158 0150 015F 0161 0163 0165 SO 30 6 80 BO E6 BO EB E6 8F 70 02 00 71 E19A: MOV
OUT

AL,3011 MFG_PORT, AL AL, SHUT DOWN CMOS_PORT, AL AL,2 SHORT $+2 CMOS_PORT+l. AL

; <><><><><><><><><><><><><><> ; <><><>CHfCKPO I NT 30 <><><><> ADDR FOR SHUTDOWN BYTE SECOND ENTRY I NTO TABLE 10 DE-LAY

MOV OUT MDV JMP OUT

0167 016A 016C 016F 0172 0174

BC 0000 8E 04 BC 8000 E8 0000 E BO 31 E6 80

MOV
MOV MOV

sr, POST SS SS,SP SP, POST_SP SYSINIT1 AL,31H MfG_PORT. AL

SET STACK FOR SYSINITl

CALL
MOV OUT

GO ENABLE PROTECTED MODE ; <><><><><><><><><><><><><><> ; <><><>CHECKPO I fiT 31 <><><><>

; ------- SET TEMPORY STACK 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 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 0190 0193 0195 B8 0018 8E 08 BO 80
MOV MOV MOV

AX,RSDA]TR DS,AX AL, PRTY_CHK

POI NT TO DATA AREA SET CHECK PAR I TY

Test 2 5-53

0197

E6 87

OUT

SAVE WH I CH CHECK TO USE

; ------- PR I NT 64 K BYTES OK 0199 019C 0190 B8 0040 E20A:

50
E9 0347 R

MOV PUSH JMP I S CMOS GOOD? AL, DIAG STATUS CMOS_PORT, AL SHORT $+2 AL, CMOS_PORT+l

STARTl NG AMT. Of MEMORY OK SAVE MEMORY OK SIZE POST MESSAGE

; -------OlAO 01A2 01A4 01A6 01A8 BO E6 EB E4 BE 70 00 71 E20B:

MOV
OUT

DETERMINE THE CONDITION Of CMOS 10 DELAY GET THE CMOS STATUS SAVE CMOS STATUS

50

Jf1P IN PUSH

tv<

; ________ GET THE MEMORY SIZE DETERMINED (PREPARE BX FOR BAD CMOS) 01A9 OlAB OlAD OlAF 01B1 01B3 01B5 01B7 0169 OlBB OlaF Ole, olC5 01C6 01C8 01CA OlCO OlCO OlCF 0101 0103 0105 0107 0109 010B 0100 OlOF 013 ao E6 EB E4 86 BO E6 EO E4 8B 03 89 B1 70 00 71 EO 80 70 00 71 lE 0013 R 08 lE 0017 R
MDV
OUT

JMP IN XCHG MDV


OUT

JMP IN MDV
AOO

58
A8 CO 74 03 E9 026E R

MDV POP

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 10 DELAY LOW BYTE PRE LOAD THE MEMORY SIZE SET TOTAL MEMORY SIZE SAVE THE TOTAL SIZE RESTORE CMOS STATUS CMOS OK? GO ! F YES DEFAULT I F NOT

tv<
AL,OCOH E20BO E20e

TEST

JZ
JMP

E20BO: ;- ___ ~~ __ GET THE BASE O->640K MEMORY SIZE FROM CONFIG IN CMOS BO E6 EB E4 86 60 E6 EB E4 39 74 96 70 00 71 EO 95 70 00 71 06 0013 R 1C
MDV
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

50
BO E6 EB E4 OC 86 SO E6 86 f8 E6 8E 70 00 71 10 C4 8E 70 C4 00 71 06 0013 R 6B 08 0201 16 B3 70 00 71 80 C4 63 70 04 00 71 [20B1:

Mav
OUT

rUSH

JMP IN OR XCHC MDV


OUT

AX AL,DIAG_STATUS CMOS PORT, AL SHORT $+2 AL, CMOS_PORT+l AL,W MEM SIZE

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

AH

XCHG JMP
OUT

onc
OHD
0201 0203 0205 0208 020A 020C 020E 0210 0212

58
39 77 88 3D 72 BO E6 EB E'I DC 86 BO E6 86 EB E6

POP eMP JA MDV CfolI' JB MOV


OUT

0214 0216 0218 021A 021C 021 E

JMP IN OR XeHC MDV


OUT

XCHG JMP
OUT

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

;-------- CHECK MEMORY SIZE ABOVE 640K FROM CONFIG 0220 0220 0222 0224 0226 0228 022A 022C 022E 0230 0232 0234 0236 0238 023A 023C 023E 0240 0242 0244 0246 0248
021~A 021~B

NO~G40:

80 E6 EB E4 86 80 E6 E8 E4 88 BO E6 EB E4 86 80 E6 EB E4

98 70 00 71 EO 97 70 00 71 C8 B1 70 00 71 EO BO 70 00 71

3B C8 74 18

>0
BO E6 EB E4 DC 86 60 E6 86 EB E6 8E 70 00 71 10 C4 8E 70 C4 00 71

0240 024F 0251

0253 0255 0257 0259 025B 0250 025F 0261


0262

58

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

5-54 Test 2

0262 0264 0266 0268 0268 026A

38 C8 77 02 813 C8

03 09 89 1 E 0017 R 83 EB 40

CMP JA MOV SET MEM: ADO MOV

eX,Ax

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 I3X,16*4 CL,U6H BX,CL


OX

SeT TOTAL MEMORY SIZE


SAVE TOTAL SIZE FOR LATER TEST I NC 1 ST 64K ALREADY DONE DIVI DE BY 54 SAVE COUNT OF 64K BLOCKS

026E
026E 0271 0273 0275

B'

E20C: E200:

SUB
MOV SHR

06 D3 EB

53

PUSH

;-------'MODIFY DESCRIPTOR TABLES AX,GDT_PTR ES,AX

0276 02'9

B8 0008

8E CO

MOV MOV

MODI FY THE DESCRI PTER TABLE

;-------'SE1 0273

Tmp ES DESCRIPTOR G4K SEGMENT LIMIT 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 (SECOND 64K)

26:

C7 06 0048 rrrF

MOV ;------- CPLO,

0282

26:

c6 06 0040 93

MOV

;------- START WITH SEGMENT 010000 0258 02aE

26: C6 06 OOI~C 00 26: G7 06 004A 0000

MOV MOY

BYTE PTR ES:(ES_TEMP.8ASE_HI_BYTE),O ES: ES_ TEMP. BASE_LO_WORD, 0

;-------'SET TEMP DS OI::SCRIPTOR 64K SEGMENT LIMlr 0295 C7 06 0060 FFFF MOV ;------- CPLO,
02':1C

26:

ES: OS_TEMP. SEG_LIMI T, MAX_SlG_LEN DATA ACCESS RIGHTS BYTE PTR ES:(DS_TEP,'

;':6:

C6 06 u06';> 93

MOV

;------- START WITH SEGMENT 010000 02A2 02A8 26: 26: C6 06 006/-1 00 C7 06 0062 0000 MOV MOV BYTE PTR ES:(OS_TEMP.BASE_HI_BYTE),O ES: OS_TEMP. BASE_LO_WORD, 0 IN DMA PAGE REGISTER

;------- TEMPORARY SEGMENT SAVE 02AF 02[31 02B3 02B5 0287 2A CO EG 85


SOB
~OT

E6 86
FE CO E6 81~

OUT

INC
OUT

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
FE 06 0064 FE 06 004e

MOV MOV

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

BB 0018

'E

'2

CMP
.)13

BE DB AO 0012 R

,F

75 01,
80 40 E6 87

AB '0

PUSH MOV MaY MOY POP TEST JNZ MaY OUT

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

or

FIRST 516K OR 640K (END OF BASE RAM) SET 6401< [lASE HAM BIT ; ; 10 DELAY GET THE CURRENT STATUS

80 03 E6 70 [8 00 E4 71

E21_0:

HOV OUT JMP IN

At, INFO_STATUS CMOS_PORT, AL SHORT $+2 AL, CMOS_PORT +1

;-------- CHECK 02E7 02EC

FOR FND OF 512K PLANAR RAM BYTE PTR DS:(DS TEMP. BASE HI BYTE),08fi E12_A -GO-IF STILL BASE RAM 10 CHECK SAVE AL RES rORE AL 10 CARD) ; ; IS 640K BASE GO I F NO INSTALLED?

80 3E 0064 08 72 08

CMP JB

; ------- SET USE TEST

02EF.
O?FO 02F2 02F4

86 C4
BO 40
E6 8f

XCHG
MOV

86 C4

OUT XCHG

Al,AH AL, 10__ CHK DMA PAGE +6, Al AL,AH

;------- CHECK FOR 640K BASE RAM (128K 02F6 02F8 02FA 02FF 0301 A8 80 74 OA

8D 3[ 0064 OA 75 EB 08 90

C~lP

'"

.)NZ JMP

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

030 1 1
0309

80 3E 0064 08
7'5 OA

;------- 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 NEXTl: BYTE IN OMA PAGE REGISTERS 3

81~

MOV OUT

Al,BYTE PTR os: (OS_TEMP.BASE_HI_BYTE) DMA PAGE+3.AL ; SAVE THE HIGH BYTE OF SEGMENT .; FOR POS I BLE ERROR 16MEG TOP OF RAM?

;------- CHECK fOR TOP Of RAM (FEOOaO) 031A 031F 0321

80 3 004e 75 03 EB 66 90

FE

CMP JNZ JMP

BYTE PTR DS:(ES TEMP. BASE HI BYTE),OFEH ; NEXT ;-GO-IF NOT KB_LOOP3 ; GO NEXT TES--;-

; ------- SET ES AND OS REG I STERS

Test 2

5-55

032'1 0327 0329 032C 032E 0330 0332 0335 0338 033A 0330 033E

B8 BE B8 8E

0060

NEXT:

08
0048 CO

MOV MOV MOV


MOV MOV OUT MOV

AX, OS TEMP OS, AXAX, ES_TEMP ES,AX AL,31H MFG_PORT, AL CX,2000H*4 STGTST CNT N1 E21A CX AX ; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 31 <><><><>
SET COUNT FOR 32K WORDS

80 31

E6 80
B9 E8 74 E9 8000 0000 E 03 0470 R N1 :

CALL

JZ
JMP POP eop

59 58

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 033 F 0341 0342 0345 0346 0347 0347 0348 0346 034E
03~0

2B FF AB
05 0040

SUB STOSW ADO PUSH PUSH PRT_SIZ:

OI,OJ AX, 16*4 AX

PO) NT TO BEG I N I NG OR A BLOCK WRITE THE CURRENT SIZE AT THE STARTING ADDRESS SAVE TESTED MEr10RY SAVE LOOP COUNT

50 51 50
B6 OODA 69 0005 2B FF 33 02 F7 F3 80 CA 30

ex

0350 0352 0354 0357 0358 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 0389

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:

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 RECOVER 64K BLOCK COUNT LOOP TilL ALL MEM. CONT I NUE CHECKED

59 58
E2 03 EB 06 90

eoe eop

ex

LOOP
JMe

AX KG_LOOP2 KB_LOOP3

50 51
E9 0289 R

KB LOOP2: PUSH PUSH


JMe

ex
21

AX

SAVE LOOP COUNT LOOP TILL ALL MEM CHECKED

KB_LOOP3:

"""''''=====:=====:::-=:=====''''''
; -------. ADDRESS LINE 16-23 TEST

0=============="'========
; ------- CALCULATE NUMBER OF 0389 88 0040 64K BLOCKS START AT SECUO 64K SAVE START I NG AQOR GET THE MEMORY SIZE CET THE TOTAL MEMORY SIZE KB FLAG USED AS TEMP STORAGE START AT SECOND 64K BOUNDRY DIVIDE BY 64K SAVE LOOP COUNT

03ac
0380 0390 0392 0396 0399 0396 0390

50
B8 0018

MOV PUSH
MOV MOV MOV

AX,64 AX AX, RSDA PTR DS,AX 6X, WORD PTR KB_FLAG BX,64 CL,06H BX,CL
UX

BE 08
88 1E 0017 R 83 EB 40 B1 06

SUB MOV

03 EB 53
;-------

SHR
f>USH

INITIALIZE OS DESCRIPTOR
MOV MOV MOV MOV

039E 03A1 03A3 03A9

68 0008 BE eo 26: C6 06 0064 00 26: C7 06 0062 0000

;------- TEMPORARY SEGMENT SAVE 03BO 03B2 0364 0366 0368 2A E6 E6 BO E6 CO 85


SUB OUT
OUT MOV OUT

IN DMA PAGE REGISTER


HIGH BYTE OF LOW WORD OF SEGMENT LOW BYTE OF LOW WORD OF SEGMENT SET HIGH BYTE OF SEGMENT WORD HIGH BYTE OF SEGMENT

86
01 84

AL,AL DMA_PAGE+4.AL OMA_PAGE+5,AL AL,01H DMA_PAGE+3,AL

;------- POINT TO NEXT BLOCK OF 64K 03BA 03BA 03BC 03B BO 33 E6 80 26: 80 06 0064 01 E21_A: 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 BO 83

E6 70
EB [4 A8 74

00 71 80 OB

MOV OUT JMP

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
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_TMP.BASE_HI_BYTE)~OBH NEXT_A

5-56

Test 2

;------- 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 10 CHECK

; ------- SET USE TEST 03E9 036 03EO

BO flO
E6 87 26: AO 0064 NEXT_A:

MOV
OUT

AL, 10 CHK DMA_PAGE+6,AL AL,BYTE PTR ES:(OS_TEMP.BASE_HI_BYTE)

MOV

; ------- OMA PAGE REG I STERS 3 03fl (6 84


OUT

; ;

SAVE THE HIGH BYTE OF SEGMENT FOR POS I BLE ERROR

;------- CHECK FOR TOP OF RAM (FEOQOO) 0:H3 03F9 03F6 26: 80 3E 0064 FE 75 03 EB 79 90 CMP JNZ JMP

16MEG ; TOP OF RAM?

BYTE PTR ES:(OS_TEMP.BASE_Hl_BYTE).OFEH NEXT B ; GO IF NOT KB_LOOP _3 ; GO NEXT TEST

;------- SET OS REGISTER

03fE 0401 01103 0405 0407 0409 040B 0400 040r 0411 0 1113 01 114 0415 0 1116 0 1\17 0419
Ol~ 1B

B8 8E 2B 8B 86 8B 2B 89

0060 08 ff 05 DO f7 CO 05

2B C9 2 FE

59
58

50
51
3B C2 86 C2 75 60

0410 041E 0111 F


OJ~22

59
58
05 0040

0423 0424 0425

50 51 50
BB OOOA

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

NEXT_B:

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

ex
AX

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 SET DEC IMAL CONVERT

PUSH MOV

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 0437 043A 043A 0438 043 043f 04 1 11 0111111 0!147 011117 044A 01148 OIIIjE 04ljf 0451 0452 0 1153 01j54

52
E2 F6 B9 0005

58 ,,7
E8 0000

E2 F9 B9 0006 BE 0000 E 2E: 8A 04

46
E8 0000 E

47
E2 F6

58 59 58
E2 1B

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

OF 5 NI BBlES XX,XXX CRT BUFFER PGSITION DIVIDE BY 10 MAKE INTO ASC I I SAVE

KB

ex,s

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

POP POP LOOP

CX AX KB_lOOP _2

T ILL ALL MEM. CHECKED

; -------- CHECK PAR I TY 0456 0458 01j5A 01j5C 045F 0460 0462 01l61j 0466 0468 01j6A 01j6C 046E 01171 0 1171 01172 0473 01176 0476 0478 041A BO 31l E6 80 E6 86 E6 E4 24 86 E4 22 E4 86 l4 75 89 CIj 8A 61 CO C4 87 EO 8A C4 8':1 Of OUT XCHG OUT IN ANa XCHG IN AND IN XCHG IN JNZ JMP KB_LOOP_2: PUSH PUSH JMP 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 E21AKB_LOOP_3 AX ex 21 A SAVE AX CHECK FOR 10 OR PAR CHECK STRI P UNWANTED BITS SAVE ERROR CHECK FOR RjW OR 10 ERR RESTORE AX GO I F PAR J TY ERROR

EB 06 90

CONT I NUE SAVE LOOP COUNT CONTINUE TilL DONE

50 51
E9 03BA R

; ------- BACK TO REAL MODE KB_LOOP_3:

MOV
OUT

AL,34H MFG_PORT ,AL PROG_SHUTDOWN

; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 34 <><><><> ; ; BACK TO REAL MODE NEXT TEST VIA JUMP TABLE (SHUT2) IF OATA COMPARE ERROR

[9 0000 E

JMP

PRINT FAILING ADDRESS AND XOR'ED PATTERN

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

2B r6
AB

SUB

SI,SI AL, PORT_B AL, RAM PAR OFF SHORT S+2 PORT B,AL AL. RAM PAR ON SHORT S+2 PORT_B.AL

WRITE TO FAILING BLOCK TOGGLE IOjPAR CHECK ENABLE 10 DELAY 10 DELAY

STOSW 61 DC 00 61 F3

049A
01~9C

E4 DC EB E6 24

IN
OR
JMP OUT

AND
JMP OUT

EIJ 00
E6 61

049E

;-------; ~~~=~~~~~~=~7~~
a/lAO 04A3 B8 0018 8E 08
MOV

MOY

:-"'''''''===;======== AX, RSQA_PTR OS,AX

SET THE DATA SEGMENT I N PROTECTED MODE

;------- GET THE DIAG_STATUS FROM CMOS 04A5 04A7 04A9 04AS 04AD 04Ar 04a1 04B3 0485 04B7 BO E6 EB E4 8A BO E6 EB E4 8A 8E 70 00 71 08 B3 70
MOV OUT JMP

IN
MOV MOV OUl JMP

AL,DIAG STATUS CMOS_PORT, Al SHORT $+2 AL,CMOS_PORT+l BL,AL AL, INfO_STATUS CMOS_PORT ,AL SHORT $+2 AL.CMOS_PORT+l BH,AL

10 DELAY

SAVE THE STATUS BYTE

00
71 F8

10 DELAY

IN
MOV

SAVE THE STATUS BYTE

; ------- GET THE LAST OF GOOD MEMORY 04B9 04BA 04B8

59 58
88 C8

PDP POP MOV

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

LAST GOOD MEMORY BELOW 512K? GO If YES

; ----~-- BELOW 640K? 04C2 04C5 3D 0280 7211


eMP

AX, 640
M1

JB

LAST GOOD MEMDRY BELOW 61.j.0K? GO I F YES

; ------- 640K UP ERROR 04C7 04CA 04CC OIICF 0402 0405 F6 75 20 EB 20 E8 C7 80 06 0200 or 90 0260 09 90 TEST JNZ SUB JMP SUB JMP BH,M640K MO AX,512 M2 AX,640 M2 I S BASE RAM 640K 512K BASE RA!-'I 640K BASE RAM

MO;

; ------- 512K TD 640K ERROR 0408


01~08

0400

F6 C7 80 75 1E 20 0200

M1:

TEST BH,M640K JNZ M3 SUB AX,512 ;------- WRITE SIZE TO CMOS


MOV MOV OUT MOV JM'

I S BASE RAM 640K? GO I F YES STR I P BASE RAM FROM 10 RAM

04EO 042 04E4 04E6 048 04EA a4EC 04EE 04FO OllF2 04F4 04F6 04FB

88 BO E6 8A [B

C8 81 70 C5 00 [6 71

M2:

our

BO BO
EB E6 8A EB E6 EB 00 70 Cl 00 71 04 90 ;
~--~---

MOV JMP OUT MOV JMP OUT JMP

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

M4

10 DELAY WRIlE IT CONT I NUE

SET BASE MEMORY SIZE


MOV

04fB

A3 0013 R

M3:

TO INDICATE HOW MUCH MEM WORKING

; ------- SET SHUTDOWN 3 04FE 0500 0502 0504 0506 BO E6 60 EB E6 8F 70 03 00 71


MOV OUT MOV JMP OUT

AL , SHUT_DOWN CMOS PORT, Al AL.3SHORT $+2 CMOS_PORT+l,AL

AOOR FOR SHUTDOWN RETURN SET RETURN 3 10 DELAY

; ------- SHUTDOWN 0508 E9 0000 E 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 10 ADDRESS RANGF 000000 --> OOFFFF 010000 --> 01 FFFF 090000 --> 09FFFF 1512->576K) IF 640K BASE 100000 --> lQFFFF (1024->10881<) IF 512K BASE

II

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

OESCR! PTER VALUES. -------------- - -------------- ----------------------------- ---------MOV MOV AX,DATA OS,AX SET REAL MODE DATA SEGMENT

BE 08
; -------

""

---- R

SHUT3;

I NIT AND SET MFG ERROR MOV


MFG~ERR_FLAG+l,

0510 0515 051A 051C 05H 0521 0524 0526 0529 052B 052E 0530 0533 0535 0538 053A 0530 053F

C6 06 0016 R 00 80 DE 0016 R 01

CLEAR FLAG

OR
MOV GAll MOV CALL

MFG_ERR_FLAG+1 ,MEM_FAI L ; <><><><> <><><><><><><><><><><> ; <><> MEMORY FA I LEO<><><><><><> AL,13 PRT HEX AL, To PRT HEX AL,DMA_PAGE+3 XPC_BYTE 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 CARRAGE RETURN

E8 BO E8 E4 E8 E4 E8 E4 E8

BO 00 0000 E
OA 0000 E 84 0000 E 85 0000 86 0000 20 0000 83 0000 82 0000 E E E E

IN
CALL IN CALL IN CALL MOV CALL

G[T THE MIDDLE BYTE OF 2/1

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

BO 8
E4 E8 E4 E8

IN

CALL IN GALL

; -------- CHECK FOR ADDRESS ERROR 0542 0544 0546 0549 0546 E4 3C BE 74 BE 3C 74 BE E8

80 33
0000 OA 0000 32 03 0000 0000 E E E [

IN
CMP

MOV JZ MOV
CMP

054E
0550 0552 0555

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 0558 SHUT2: 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.
JMP

0558

E9 0000 [

POST7

GO TEST THE 286 PROTECTED MODE

;-------- FAILURE ENTRY fROM A SHUTDOWN 055B 055E 0560 0562 0565 0567 056A E8 E4 3C BE 74 BE 0000 E 80 35 0000 E OE 0000 E SHun: CALL IN
eMP

DDS
AL, MFG PORT Al,35HSI,OFFSET CM4_D SHUT7B SI ,OFFSET VIR_ERR

ESTABL! SH THE DATA SEGMENT CHECK FOR CH I P SELECT ERROR PR I NT ERROR 109 GO IF NOT PROTECTED MODE fA I LED

SHUT7A:

MOV JZ MOV

80 DE 0016 R 02

OR

MfG_ERR_FLAG+1 , PRO_fA I L ; <><><><><><><><><><><><><><><>

Test 2 5-59

;<><> VIRTUAL MODE FA!LED<><><> 056F 0512 0575 0578 [8 0000 E EB 09 90 E8 0000 E 80 DE 0016 R 04 CALL .JMP CALL
OR E ~~SG SHUTG E,_MSG

; ;

PRINT MSG PRINT MSG

SHuns:

MfG_ERR_FLAG+ 1, LMCS_fA I l_,; <><><><><><><><><><><><><><><> ; <><> LOW MEG CH I P SELECT <><>


r~ODE

;-------- PROTECTED 0570 0')80 0582 E8 28 A3 89 0000 E CO 00 I 7 R OOOE SA 0082 SHur6: CALL
SUB MOV MOV MOV

TEST PASSED ENTRY FROM A SHUTDOWN PROl [CTEO MODI:: TEST PASS[Q CLEAR KEYBOARD STATE FLAGS CLEAR PAGE REGS

DDS AX,AX

0585 0588
058B

WORD PTR K8 fLAG, AX CX,OtH DX,OMA_PAGE+l

0:"88 0580 O'-,flF


058F

2A CO E[
II?

E2 F/\

CLR LOOP: SUB OUT INC: LOOP TEST.21 KEYBOARD TEST oESCRI PllON RESET THE KEYBOARD AND CHECK THAT SCAN CODE -M' IS RETURNED TO THE CPU. CHECK FOR STUCK KEYS.
MOV OUT

; ;

0591 0593 0595 059A 059C 059F 05A4 05A6 05A9 05AB 05AD 05AE 0581\ 05136 058B 05130 05HF 05C2 05C4

BO 35
6 80 F6 06 0012 R 20 75 03 E9 0651 R 80 3E 0072 R 64 75 03 9 0651 R BO 36 E6 80
FA 81 3[ 0072 R 1234

AL,35H MFG_PORT, AL

; <><><><><><><><><><><><><><> ; <><><>CHECKPOI NT 35 <><><><>

TEST JNZ
JMP

Fl_A:
F7_B:

C~1P

JNZ
JMP

MOV
OUT

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

eLi
eMP

05C.,

05C9 OSCB 05CD 05CF 0502 0504 0506 0509 05DC OSDE 05EO 052 05E7 05EA
O~ED

74 80 7 1i BO 8 B7 8 75 FE 75 80

17 3E 0072 R AA 10 AE 0000 E 04 0000 E


OL~

JZ eMP JZ
MOV

CALL
MOV

LOOP1:

CALL JNZ
DEC

CF

F7
AD 0000 60 EO 0000 E 0000 E

GlO:

[8 4 BO E8 8 Eli A8 74 80
BE EB E8 3

JNZ MOV CALL IN


MOV

60
01 DB DE 0016 R 08 0000 [ 62 90 0000 E

CALL CALL IN TEST JZ OR

Gll:

05FO 05F2 D5F4 05F6 05F9

28

80 37
6 80 80 rI3 AA
75 1F

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

CHECK FOR STUCK KEYS 05FB 05FD OSFF 0601 0604 0606 0608 060A BO 38 E6 80 BO E8 2B E2 Ell A8 74 AE 0000 E C9
FE MOV OUT MOV

AL,3811
Mfe _PORT, AL

; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 3B <><><><> ASSURE KYBOARO ENABLED ISSUE THE COMMAND DELAY FOR A \-!H I LE CHECK FOR STUCK KEYS OUT BUFfCR FULL? CONT I NUE TEST I NG YES

CALL
SUB

AL, ENA_ KBD C8042

ex,cx
F5 F7

f5:

I_OOP

a60c
OGOE 0610 0612 0614 0617

611 01 43

IN
TEST
JE MOV OUT

AL, STATUS_ PORT AL,OUT_BUF_FULL AL,39H MFG _POfn,AL AL, PORT_A XPC_ BYTE F6e fO OFTFRMINE

BO 3') E6 80 E4 60 E8 0000 E EB 20 90 ; _______

; <><><><><><><><><><><><><><> ; <><><>OiECKPO I NT 39 <><><><> ; ; GET THE SCAN CODE CONVERT AND PRI NT CONT I NUE IF 8042 INTERFACE IS WORKiNG

IN
CALL
JMP

KEYROARO ERROR TRY Cl.I


~~ov

a61A 061 B 0610

FA BO A8 E6 64

F6:

061F 0621
0623 0625 0627 0629 0628 062D 062F 0632 0635 0637 0639 063B 0640 0643 061,6 0649 064E

28 C9
B7 U5 E4 64 A8 01
E1 FA

OUT SUB MOV

AL, I NTR FACE CK STATUS_PORT ,AL

COMMAND TO 8042 WAIT FOR OUTPUT BUFFER FULL 8042 FIN! SHED TEST? GO CHECK RESULTS 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? ; <><> KEYBOAROjSYSTEM<><><><><> ; PLANAR FAI LURE ; GO I F YES ; Gl I MSG ADDR

ex,cx
BH,O~

F6A:

75 FE 75 BE EB

OA CF F4 0000 E 1A 90 f6B:

IN TEST LOOPZ IN.l


DEC

AL, STATUS PORT AL, OUT BUF FULL F5A F6B BH

JNZ
MDV JMP

Ell 60
3C 00 74 DB 80 DE 0016 R 10 BE 0000 E EB 09 90 BE 0000 E 80 OE 0016 R 20 E8 0000 E

IN
eMP

F6A SI,OFFSET Fl __ A F6D AL, PORT __ A AL.O

JZ
DR MOV

~~g_ERR_FLAG+1 , KY_SYS_F A~ L; <><><><><><><><><><><><><><>


SI,OFFSET F1_A F6D SI,orf--SET Fl

JI1P F6C:
MOV

OR CALL

MrC_ERR_FLAC+1, KYBD_FAI L; <><><><><><><><><><><><><><><> ; <><> KEYBOARD FA I LED<><><><><> ; PR I NT MSG ON SCREEN

F6D:

INITIALIZE 80112 TO HONOR KEY LOCK

5-60 Test 2

0651 06::'3 065'.1 0657 0659

uo

3A l6 80

F"!;

r'10V OUl
MOV OUT eLi MOV CALL MOV OUl

AL,3 AH
MFG _POIn, AL

; <><><><><><><><><><><><><><> ; <><><>CIiECKPO I NT 3A <><><><> DISABLE IN1ERRUPTS

ff E6 21
FA

eo

AL,orfH INfA01,AL AL,60H C8U'I2 AL,4';,H PORl _A,AL

065A
06~c

065f 0661

BO fR t30 E6

60 0000 E 45

60

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 S[T COMI1ANO I N AI-! ISSUE THE COMI-1AND

;------- OECATE ADDRess LINE 20 0663 0665

0'. E8

00 0000 E

MOY CALL

All, 0 I SI\13LE_B I T20 CATE_A20

-- SETUP HARD\-.IARE 0668 D66A D66e 066F 0670 0611 0674 0677 0678 0679 067A 2B CO 81 cu 89 0008
SlJH

INT VECTOR TABLE LVL 0-7

DE.
1C BE 0000 E BF 0020 R A5 47
1~7

MOV 1-10V PUSH POP 1-10V

AX,AX ES,AX CX, DB CS

Gl.T VECTOR CNT SETUP OS SEC RlG

os
51 ,OFfsn VECTOR_TABLE UI,OI-)-::;[T INT_PTR 01 01 F7A ; SI< I P OVER SEGMENT

Mav

F7A;

E2 FB

MOVSW INC INC LOOP

;------- SETUP HARDWARE 061C 067l 0680 U683 0684 28 CU 8E CO 89 OU08 DE 1F 8F 0000 E SF 01CO R A5 47 117 E2 FO
SUB MOY MOV PUSH POP MOV MOV 1-10VSW INC INC LOOP

INT VECTOR TABLE LVL 8-15

(VECTORS START AT

INT 50H)

0685
0688

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 ; 5K I r OVER SEGMENT

068B
D6SC 0680 068E

F7Al :

;----- SET UP OlHCH 2B BF C7 [7 C7 CO 08 06 0008 H 0000 E 06 (H)14 R 0000 E 06 DOG? R F600 ASSUME SUB MOV MOV MOY MOV

INTERRUPTS AS NECESSARY OS""O NM I INTERRUPT PR I NT SCREEN SEGMENT FOR CASSEn!:. BAS I C

0690

0692
0694 069A 06AO

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

; -------- ZE:.RO HESERVEO VECTORS 06A6 06A9 06AC 06BO 0683 l3F 0180 B9 DOOE C7 05 0000 83 C7 02 E2 F7 MOV MOV MOV ADD LOOP 01,60H*4 eX,14 WORD PTR OS; [ 0 I a 1,2 F7A2 INT 60 THRU 67 FILL WI-IH ZERO CLEAR 14 WORDS POINT TO NEXT LOCATION IF MANUFACTURING TEST MODE

f7A2;

J, 0

; _____ SETUP TIMFR 0 TO BLINK LED 0685 UGBA OGSC OGC2 DGCII 06C6 06C7
F6 06 0412 R 20 75 UA C7 06 0020 R 0000 E BO FE [6 21 FO

T[ST JNZ
MOV MOV

F9:

OUT SFI

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 OS; DATA DDS 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[

E8 0000 E
;

ASSUME CALL
---~----

I SSUE A RESET TO THE HARD FILE RESET fLAG,1234H F9A CX,OFFH OX,03f6H AL,04H DX,AL F9 A AL-;-AL DX,AL

06CA 0600 06[);'> 0605 0608 060A 060B 0600 06DF

81

1 3E 0072 R 123 1 UOFF 03FG 04


FE CU

cr~p

0,

75 DE

JNZ
MOV
r~OV

BA BU EE E2 2A

F9_A;

FE

MOV OUT LOOP SU[3 OUT

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. F9A;
MOV OUT MOV MOV OUl TEST JZ TES1 JZ

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
BO 02
BA EE F6 74 F6 74 03F7 06 0010 R 01 4F 06 0012 R 20 48

AL,3CH MFG_PORT, AL

; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 3C <><><><>


SEC

FlO;
E4 21 EB 00 24 BF E6 21 B4 DO 8A 04 CO F6 C4 FF 75 24 IN JMP AND OUT 110V MOV I NT TEST JNZ

"

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

TURN DRIVE 0 MOTOR ON 070B 070E 0710 0711 0713 0715 BA BO EE 2B B2 03F2 le C9 OC Fl1;
MOV MOV OUT SUB MOV

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

0715 0717 0719 071B 0710 071F 0723 0726 0728 072A 0720 072F 072f 0734 0737

2 FE FE CA 75 FA 33 65 88 E8 72

LOOP
DEC

JNZ XOR
MOY NOV CALL

Ol Fll
OX,DX CH,1 srEK STATUS,DL SEEKF13 CH,34 SEEK

'"

WA I T FOR 1 SECOND DECREMENT DUTTER LOOP SELECT DR! VE 0 SELECT TRACK 1 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:

D2

01 16 003E R 0000 E 07 85 22 E8 0000 E 73 DB F13 :

Je
MDY CALL

JNe
OR MOV CALL

Fl4

80 DE 0016 R 40 BE 0000 E 8 0000

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

;----- TURN DRIVE 0 MOTOR OFF 073A 073A 073C 073F f14: 80 OC BA 03F2
EE

MOY MOY OUT

AL, OCH DX,03f2H DX,Al

ORO OFF: TURN DR I VE 0 MOTOR OFF fOC CTl ADDRESS

; ------ SETUP KEYBOARD PARAMETERS 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 R 00 R f15:
MOY MOV MOY MOY I'IOV ADO MOY

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 0758 075E 075F 0760 0763 0764

SF 0078 R 1E 07
B8 1414 AB AB

MOV PUSH POP MOV STOSW STOSW

OI,OFFSET PRINT_TiM_OUT ;SET DEFAULT PRINTER TIMEOUT OS ES AX,1414H ; O[fAULT=20

; -------- SET 4S232 DEFAULT 0765 0768 0769 88 0101 AB AB MOV STOSW STOSW AX,D1D1H ; RS232 DEFAULT=01

; -------- ENABLE T I MER INTERRUPTS 076A 076C 076E 0770 4 24 EB E6 21 FE 00 21 IN AND JMP OUT AL, I NTA01 AL,OFEH SHORT $+2 INTA01,AL ENABLE T I MER AND KB 10 DELAY I NTS

;------- CHECK CMOS BATTERY/CHECKSUM 0772 0777 0779 077C F6 75 9 80 06 0012 R 20 03 0858 R 8E E6 70 EB 00 E4 -11 TEST

JNZ
81_0K: JMP MOV OUT JMP IN AND .)Z TEST May

077
0780 0782 078'1 0786 0788 078A 0780 07aF 0792 0795 0795 0798 079B

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:

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

MFC JUMPER? GO I F NOT BYPASS I f YES

10 DELAY BAD BATTERY, CHK SUM~ OR MIN CONfIG? GO I F NOT BATTERY BAD? PF<l.OAD BATTERY MSG GO I F BATTERY OK PR I NT BATTERY MSG CONTINUE(BYPASS CLOCK ETC) PRE LOAD CKSUM BAD PRINT MSG BYPASS CLOCK TEST-MEM SIZE

JZ
CALL JMP MOY CALL JMP

B2 OK
E MSG H=:Ol<lA

SI,OFfSET CM2 E MSG ~COK1A

; ------- TEST CLOCK UPDAT I NG 079E 07AO 07A2 07A4 07A6 07A8 07AA 07AC 07AE 07BO 07B2 0784 07B7 83 03

C OK:
O-OK:

26 C9
SO 6 ES E4 A8 75 2 FE 75 BE E8 8A 70 00 71 80

(::01<:

folOV SUB MOV OUT JMP IN TEST

25
F2
C8 EC 0000 E 0000 E

JNZ
LOOP
DEC

BL,03H cX,CX AL, ClK_UP CMOS PORT, AL SHORT $+2 AL, CMOS_PORT+1 AL,80H G OK

OUTER lOOP COUNT I NNER LOOP COUNT GET THE CLOCK UPDATE BYTE 10 DELAY CHECK FOR UPDATE I N PROGRESS GO I f YES TRY AGAI N DEC OUTER LOOP TRY AGAI N PRINT MSG

JNZ
F_OK:

BL

COl(

MOV CALL

OK SI,OFFSET CM3 E_"MSC

;------- SET CMOS DIAG_STATUS 04 (CLOCK ERROR) 07BA 076C 07BE 07CO 07C2 07C4 07C6 07ea 07GA 07ee 07eE 0700 BO E6 a6 EB 4 DC 86 E6 8E 70 C4 00 71 04 C4 70 C4 00 71 12 90

1>1OY OUT XCHC JMP IN

OR
XCHG OUT XCHG JMP OUT JMP

86
EB E6 lOB

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 070 07[2 B9 BD EG lOB
El~

0258 8A 70 00

71

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 074 07E4 07E6 !.jOY OUT AL, 0 lAG_STATUS CMOS_PORT ,AL GET THE STATUS BYTE

80 8E
E6 70

5-62

Test 2

07[8 OlEA Q7EC 07EE

EB E4 A8 74

00 71 10 06

JMe IN

TEST
JZ

SIWRT $+2 AL, CMOS_PORT+1 AL,\.,(NM_SIZE H_OK1A

10 DELAY WAS THE CONFIGo::MEM SIZE DETERMINED? CO I f YES --

;-------- MEMORY SIZE ERROR 07FO 07F3 BE 0000 E E8 0000 E


MOV

CALL

51 ,OFFSET El A E_MSG -

PRINT SIZE ERROR DISPLAY ERROR

; -------- CHECK FOR CRT ERROR 01F6 07FB 07FE 0800 0805 0807 D8DA

B[

80 3E 0015 R OC 0000 [ 74 OA
80 3E 0015 R 00 75 06
BE 0000 E

H_OK1A:

CI-lP
MOV JZ eMP JNZ MOV

MFG ERR FLAG,OCH SI,OffSET E,_B H_OKl B MFG ERR fLAG,OOH J OK SI,OFFSET E1 C E_MSG -

CHECK fOR MONO CRT ERROR PRELOAD I~ONO CRT ERROR GO I F YES CHECK FOR COLOR CRT ERROR CaNT I NU[ I F NOT CRT ERROR MSG

E8 0000 E

H_OK1B:

CALL

"'=-=====-==-="'==-="'--.==========:-----; -------' 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

ex,cx

BL,OFH

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 VER I FY COMBO CARD \oJR I TE TO THE CYL BYTf 10 DELAY CHECK DATA WRITTEN'" DATA READ 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

Ee
A8 74 E2 FE 75 80 00 F9 CB F5 ?I~ DC "/4 lA EB 33 90 BA 01 F4 BO 55
EE

J_OK1:

IN TEST
JZ

LOOP
OEC

OX,01 F7H AI"DX AL,080H J OK2 J-OK1

Be

JNl
AND JZ JMP

.) OK1 AL,Qeli J OK3 F1SC OX,lF4H AL,055H OX,AL SHORT $+2 AL,OX Al,055H F15C AL,OAAH DX,AL SHORT $+2 AL,DX AL,OAAH F15C HF _CNTRL, DUAL

J_OK2:

MOY
MOV OUl Jj<',p IN

EB EC 3C 75 90
[[

00 55

25
AA

eMP JNZ
MOV OUT JMP IN eMP JNZ

EB 00
EC

3C AA 75 18 C6 06 008F R 01 ;-------

INITIALIZE fLOPPY FOR DRIVE TYPE MOV OUT CALL AL,3DIl MFG PORT, AL DSK(TTCSETUP ; <><><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 3D <><><><><> INITIALIZE FLOPPY

084? 0844 0846

80 30 E6 80 E8 0000 E

0849 D84C 0851 0853

[8 8U 74 80

0000 E 3E 0091 R 00 OS OE DOlO R 40

;-------- CHECK CALL CMP JZ OR ;-------

FOR 2ND DISKETTE DRIVE DDS DSK STATE+l,O F15C ; BYTE PTR EQUIP_FLAG,40H ;

I NSURE DATA SEGMENT IS THERE A DRIVE 2 ATTACHED? GO I f NOT SET SECOND DRIVE INSTALLD

INlllAlIZE HARD FILE


MOV OUT MOV OUT JMP IN

0858 085,11.. 085C oaSE 0860 0862 0864 0866 0868 086A 086C 086E 0870 0872 0874

BO 3E E6 80 80 8E [6 70 fB 00 [4 71 A8 co 75 OF BO 92 (6 70 EB 00 Ell 71 3C 00 74 03 E8 0000 E

F15C:

AL,3EH MFG_PORT, AL AL,OIAG_STATUS CMOS _PORT, AL SHORT $+2 AL, CMOS_ PORT+l AL,OCOH ROM SCAN1 Al, liO_F I LE_ TYPE CMOS PORT, AL SHORT $+2 Al, CMOS_PORT+1 AL,OH ROM_SCANl DISK_SETUP

; <><><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 3E <><><><><>

GEl THE CMOS STATUS

TEST
JNZ MOV OUT JMP IN

BATTE.RY/CHECKSUM OK BYPASS 0 I SK SETU P I F NOT I NSURE CMOS OEF I NES THE TYPE OF HARD FILE

CMP
JZ

I NSURE TYPE IS OEF I NED BYPASS DISK SETUP IF NOT INITIALIZE HARD FILE

CALL ; ;

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) ; ALLOW INTERRUPTS ; <><><><><><><><><><><><><>-<> ;<><><>CHECKPOINT 3B <><><><> SET REAL MODE DATA SEGMENT LINE FEED ON CRT

0877 0877 0878 D87A 087C 087F 0881 0884

FB

ROM SCAN1: STI 80 UUUO E OA 0000 E


MOV OUl

BO 3B
E6 UI BO E8

CALL
MOV

CALL ROM_SCAN:

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 2A E6 EB E6 SA CO D2 00 04 C80a
SUB OUT JMP OUT MOV

AL.AL DMA18+2,AL SHORT $+2


DMA18+j~,AL

SEND ZERO TO MASK REG SEND ZERO TO REQ REG SET BEG I NN I1';G ADDRESS SET BX=OOOO GET 15T WORD FROM MODULE BUS SETTL! ~:G '" TO I 0 WORD? PROCEED TO NEXT ROM I F NOT GO CHECK OUT MODULE CHECK fOR END OF ROM SPACE PO I NT TO NEXT 2K ADDRESS ; AT EOOOO YET?

OX,oe80UH OS, DX BX, BX AX, (BX!


BX BX

BE DA 28 DB 8B 07 3D 75 E8 EB

ROM SCAN2: MOV


SUB MOV

"

PUSH AA55 06 0000 E as 90


POP eMP JNZ

5B

CALL
JMP

AX,OAA55H NEXT ROM ROM CHECK ARE::::WE_DONE oX,OOaOH ox, OEODOH

81 C2 0080

Bl fA EOOO

NEXT ROM: ADD ARE WE DONE: - CMP

Test 2 5-63

08AA

7C E3

JL
END IF ; -------- TEST

ROM_SCAN2 FOR KEYBOARD LOCKED


DDS

; co

CHECK ANOTHER ADD.

I F NOT

08AC OSAF 0861 08B3 08B5 08B8 08B8

-(4

E8 0000 E E4 64 24 10 03 EB DC 90 KEY1 :

CALL IN AND JZ JMP OR ELSE

SET DATA

SEGf~ENT

Al, STATUS PORT AL, KYBD_I NH KEYl KEY1D

is KEYBOARD UNLOCKED? GO I F OFF

80 DE 0016 R 80

MfG_ERR_FLAG+l, KEY_FAIL; <><><><><><><><><><><><><><><> ; <><> KEYBOARD I S LOCKED <><><>

08BO

KEY9: ASSUME OS: OAT A


51, OFFSET LOCK RF 0000

ORAD
08CO 08C3

E8 0000 END I F KEY10:

MOY CALL

PR I NT LOCKED MESSAGE

(302)

E_MSG

; -------:: 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
r16:

MOY MOY MOY MOY


OUT

Ol,OFfSET f4

PRT _SRC_ TBL PRT_BASE: eET PR INTER BASE AD DR WRITE DATA TO PORT A 10 DELAY RIIS SETn I tIIG READ PORT A DATA PATTERN SAME NO CHECK NEXT PRT CD YES - STORE PHT BASE ADDR iNCREMENT TO NEXT WORD

51,0
DX,CS: [011 AL,OAAH OX,AL SHORT $+2
OS

2E: 8B 15 BO AA EE EB 00 lE Ee

1F
3C AA 75 06 89 94 0008

R
F17:

"6
46 47 47 81 FF 0000 E 75 E3

JMP PUSH IN POP eMP JNE MOY INC INe INC INe eMP JNE

AL,DX

as

AL,OAAH f17 PR INTER_BASEl S I ), OX 51 01 01 01, OffSET f4E f16

"

PO I NT TO NEXT BASE AODR

","'=",0;;0===;;;;;;===
SETUP RS232

ALL POSS I BLE ADORS CIIECKED? PRT_BASE

=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
03fA F8 08 87 0000 R 03F8 02FA F8 08 8-' 0000 R 02F8 F18:

MOV
MOV IN TEST JNZ MOV INe INC MOV IN TEST JNZ MOV . .C INC

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

PO I NTER TO RS232 TABLE CHECK If RS232 CO 1 ATTCH? READ INTR 10 REG


SETUP RS232 CD #1 ADDR CHECK IF RS232 CD 2 ATTCH READ INTERRUPT 10 REG BASE END SETUP RS232 CD

ox

112

==========0;;;;;;;;--=====-==-======-==-=======;;;::===="'==="'0;;======-=0;;=0;;
SET UP EQUIP_FLAG TO 0909 0909 0908 0900 090F 0911 F19; IN.DICATE NUMBER OF PRINTERS AND RS232 CARDS 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

813 C6
B1 03 R

02 C8
OA C3 A2 0011

MOV MOV ROR

OR
MOV

AX,51 CL,3 AL,CL AL,BL ; BYTE PTR EQUIP_fLAG+l,AL

; -------' TEST FOR ANY ERRORS (BP NOT ZERO) 0914 0914 0916 2B CO A3 0017 R

="'== ==::= ======;;; === = == = == - ==== =====


CLEAR KEYBOARD STATE FLAGS AX,AX WORD PTR KB_FLAG,AX INTERRUPTS RESET ALL KEYBOARD STATE FLAGS

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

K OK;

SUB MOV

ENABLE KEYBOARD AL, I NTAOl AL,OFDH SHOH I $+2 JNTA01,AL

0919 0918 0910 091 F 0921 0926 0929 092B 0930

E4 24 EEl E6

21 fD 00 21

IN AND JMI' OUT MOV eM? JE CMP JNZ

ENABLE TIMER AND KB 10 DELAY

INTS

C6 06 0015 R 00 83 FD 00 74 3D 80 3E 0072 R 64 75 08

BYTE PTR MFG_ERR_FLAG, BP,OOOOJ1 F15A_O

CLEAR ~IFG ERROR FLAG CHECK FOR BP= NON-ZERO (ERROR HArrENCO) CONTINUE If NO ERROR MFG RUN IN MODE? GO I f NOT

BYTE PTR RESET_FLAG,64H ERR_WAIT

; -------- MFG RUN 0932 0937 093A 093A 0930 0940 09 '.2 091111 0947 0949 094C 094F 0952 0952 C6 06 0015 R AA EB 2F 90 SA 0002 E8 0000 E E4 24 BE 75 BE E8 BE 64 10 0000 E 09 0000 E 0000 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

IN MOOE -> SET ERROR FLAG ; ; INDICATE ERROR CONT I NUE

BYTE PTR MFG_ERR_FLAG.OAAH f15A_0 DX,2 ERR_BEEP AL,STATUS PORT AL, KYSD_I NH 51 ,OFFSET f30 ERR WAIT2 S I, OfFSET F301 P_MSG SI,OFfSET F3D P_MSG (All DISPLAY DEVICE) ;

2 SHORT BEEPS (ERROR)

CHECK

If RESUME MSG TO BE DISPLAYED

RESUME ERROR MSG ERROR MSG fOR KEYBOARD LOCKED RESUME MSG

E8 0000 E

INIT PRINTER AH,1 OX,DX 17H

MOY SU8 INT ERR_WAIT1: MOV


OUT

FIRST PR INTER

AL,3FH MFG_PORT, AL

; <><><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 3 F <><><><><>

5-64 Test 2

095F 0961 0963 0966 0968 0968 0960 096F 0972

Bll CO 80 75 F6 75 E9 80 74

00 16 Fe 3B F3 06 0012 R 20 03 0000 E 3E 0072 R 64 06

MOV INT eMP JNE

AH,OO 16M AH,3BH ERR_WA 1T1 MfG_TST , LOOP_POST flSA START_l ; BYTE PTR RESET_FLAG,64H ; F15B ; DX,l ERR_BEEP AH,AH Al, CRT_MODE 10M

WAIT FOR ' f , ' KEY

TEST F15A:
JNZ JMP eMP JZ MOV

0977
0979 097C 097F 0981 0984

MFG BURN 1N MODE GO I F NOT GO lOOP POST MFG RUN 1N? BYPASS BEEP I f YES
1 SHORT BEEP (NO ERRORS)

SA 0001

E8 0000 E 2A E4 AO 0049 R CD 10
fl~B:

CALL SUB
MOV INT

CLEAR FLAGS 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

CX,0500 Dl,SYS_IDT_LOC AX,AX E5,AX ES: I DI LAX 01,2 F20_A

CLEAR 1K PO I NT ES TO START OF OEseR I PTORS CLEAR POINT TO NEXT LOCATION CONT I NUE TILL DONE

; -------- SET
0998 8 0000 E CALL

='='======'00=:===== T I ME OF DAY ===""=-==========

SET_TOO

; ~------- SET SYSTEM STACK 099B 099E 09AO


B8 ---- R 8E DO BC 0100 R
MOV MOV MOV

AX, STACK SS,AX SP, OFFSET T05

GET THE STACK SEGMENT

; ------- ENABLE HARDWARE I NTERRUPT I f MATH PROCESSOR (X287)

091\3
09A5 09A7 09AA 09AB 09AD 09BO 09B2 09B4 09B8 09139 09BA 0geo 0ge6 0ge8 09C9 09CD 09CE 09CF 0905 0907 09D9 090B 0900

80 40 E6 80 Al 0067 R

MOV OUT MOV

AL,40H MfG PORT ,AL Ax,To_ROM_IN1T


AX

; <><><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 40 <><><><><>


; TEMP STORAGE CLEAR ID_R011_INIT

,0
2B CO

PUSH SUB
MOV ESC XOR [SC

A3 0067 R
DB E3 33 CO

09 3E 0067 R

AX,AX 10_ROM_1NIT,AX 28,BX AX,AX 15,10_ROM_INIT 060H 061H 10 ROM LN1T,OlF3FH I O::::ROM::::I NIT ,0033fH NO_287

PUSHA
DB

T I ME

~OK

287 TO RESPOND

60 61
81 26 0067 R 1 F3F Bl 3E 0067 R 033F 75 24
9B

POPA
DB AND eMP JNZ

CLEAR UNUSED 287 BITS I S THE 287 INSTALLED? GO 1 F MATH PROCESSOR 1S NOT INSTALLED STORE THE STATUS WORD

WAIT
ESC

DO 3E 0067 R

PUSHA
DB

T I ME FOR 287 TO RESPOND


060H 061H IO_ROM_l NIT, OB8BFH NO_287 AL, 1NTBOl AL,OOFH SHORT $+2 INTB01,AL ALL BITs SHOULD BE Off GO I F NOT INSTALLED GET THE SLAVE 1NT MASK ENABLE 287 INTERRUPTS 10 DELAY

60

POPA

n 06 0067 R B8BF 75 15
Ell Al 24 OF EB 00 E6 A1 ;

61

DB

TEST
JNZ IN AND JMP OUT
--~-----

ENSURE THAT MASTER LEVEL 2 ENABLED AL,INTAOl AL,OFSH SHORT $+2 INTA01,AL BYTE PTR EQU I P_FLAG, 02H
AX

090F 09El 09E3 09E5 09E7 09EC 09Ee 09ED

E4 21

24 FB EB 00
E6 21 80 DE 0010 R 02 NO_287:

IN AND JMP OUT OR

GET THE CURRENT MASK 10 DELAY SET 287 BIT ON RESTORE 1O_ROM lNIT

58
A3 0067 R

POP MOV

la_ROM _INIT,AX

; --------- TEST FOR MFG RUN-I N TEST 09FO 09F5 09F7 09FA 09FA 09FC 09FE DADO 80 3[ 0072 R 64 75 03 EB 63 90 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

E4 24 EB E6

Al
fD

;-------- UNMASK SLAVE HARDWARE INT 9 (LEVEL 71) END_281: IN AL, lNTB01 GFT THE CURRENT MASK OUT

00 Al

~~~

~~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 OA06 DADS BO 4' 6 80 BO AD E6 70 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
MOV MOV MOV MOV OUT MOV OUT

AL,41H MFG_PORT, AL AL, CMOS_END CMOS_PORT, AL

; <><><><><><><><><><><><><><><> ; <><><>CHECKPO 1NT 41 <><><><><>


INSURE NM 1 OfF

SUB
MOV

PUSH
POP eMP

BYTE PTR RESET FLAG, AX, GEOOOH ES,AX OJ. DI AX,ES:[Dl] 8X


BX

CLEAR FLAG SEGMENT OF SYSTEM CODE CHECK FOR AAS5 BUS SETTLE SAVE FLAGS CLEAR pass 1BLE PAR 1TY CHECK TOGGLE 10/PAR CHECK ENABLE

AX,OAA55H E5:!Dl],AX AL, i'ORT_B AL, RAM_PAR_OFf

PUSHF
MOV IN OR

Test 2 5-65

01\26 OA28 OA2A OA2C


UA~t.

EB 00 E6 61

J~1?

2" F3 EB 00
1:.6 61

UA30 OA31

9D

15 29

OUT AND JMP OUT POPF JNZ

SHOI1T $+2 PORT _B,AL AL, RAM PAR ON SHOHT ~+2 PORT _B,AL SHUT4

10 DELAY 10 DELAY RESTORE FLAGS CONTI NU(

; ------- CHECKSUM SYSTEM CODE OA33 UI\34 OA35 OA36 01\38 OA3B OA3C IE 06 IF rUSH PUSH POP SUB CALL POP JNZ OS ES OS BX, BX fl:OS_CHFCKSUM OS SHUT4 AND IO/PAR CHECKS ENABLE NM I ENABLE" PAR I TY 10 DELAY [NAGLe RAM PCK AND SET THE OFFSET SET THE SEGI>1ENT ; <><><><><><><><><><><><:><><> ; <><><>GHECI<PO I NT 112 <><><><:> SET SEGMENT TO TEST STABTING OFFSET RESTOH[ DATA SEGMENT GO I F CHECKSUM NOT OK

28 OR EB 0000 E 1F

75

l(

ENABLE NMI OA3E OAIIO OA42 OA44 OA46 OA48 OA4A OA50 OA54 OA56

60 20 E6 70
E4 EB 24 E6 61 no F3 61

MOV OUT IN JMP

AL,~lm

CMOS _PORT,AL AL, PORT_B SHORT $+2 AL, RAM_PAR_ON PORT_B,Al DS; 10_ROM_INIT,0003H OS; I O__ IWM_SEG, ES AL,42H MFG_PORT ,AL

AND
OUT

10 CH

c7 06 0067 R 0003 8C 06 0069 R 80 42 E6 BO

MOV MOV I V OUT

;-------OA58 FF 1 E 0067 R

EX 1T TO SYSTEM CODE DWORD PTR


DS~

CALL

10_ROM_ I NIT

; GU I D SYS I lM CODE
VIA CALL

ENABLE NMI OA5C OA5E OA60 OA62 OAG4 UA66 OA68 OA6A

INTERRUPTS + ENTRY FROM SHUTDOWN 'vi I TH BOOT REQUEST ENABLE NMI ENABLE PAR I TY 10 DELAY ENABLE RAM PCK AND

80 20 E6 70
E4 61

SHUTlI:

MOV OUT IN JMP


AND

"L,2DH CMOS_PORT, AL AL, PORT B SHORT $+2 Al, RAf1_PAR_ON PORT _B,AL AL,43H MFG_PORT, AL

EB 00
24 F3 '6 61

10 CH

OUT MOV OUT (NDI r

80 43 E6 80

; <><><><><><><><><><><><><><> ;<><><>CHECI<POINf 43 <><><><>

OA6C OA6E

CO 19

INT ENOl F POST2 CODE ENDP ENOS END

19H

; GO TO BOOT LOADER

OA6

5-66

Test 2

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

POST UT I Lt TIES

0000

I NCLUDE SEGMENT. SRC CODE SEGMENT BYTE PUBLIC EXTRN ROM_ERR: NEAR ROS CHECKSUM SUBROUT I NE

;
0000 0000

-- - -- ----------- - --- ------- -------- -- --NEXT ROS MODULE NUMBER OF BYTES TO ADO IS 64K ENTRY FOR OPT I ONAL ROS TEST

0000 0002 0002 0004 0004 0006 0007 0009


OOOB

2B C9 32 CO 02 07 43
E2

FB

oooc

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

PO I NT TO NEXT BYTE AUD ALL BYTES IN ROS MODULE SUM = O?

RET ROS_CHECKSUM
IF LEO

ENOP
PROCEDURE FOR MFG RUN-I N TESTS IS ON, TURN IT OFF. I f OFF, TURN ON.

1311 NK LED

QOOC

OOOC 0000 OOOE 0010 0012 0014 0016 0019 0018 0010 DOH 0021 0022 0023

FB

50 E4 80 8A EO
F6 DO

ASSUME BLINK INT STI PUSH IN


MOV NOT AND ANU

OS; DATA PROC NEAR


AX

24 40
80 E4 BF
OA C4

OR
OUT MDV OUT POP

E6 80 BO 20 E6 20
5B CF

AL, MFG PORT AH,AL AL AL, 01 0000006 AH,10111111B AL,AH MFG PORT,AL AL, EOI INTAOO,AL
AX

SAVE AX REG CONTENTS READ CURRENT VAL OF MFG_PORT FLIP ALL BITS I SOLAT E CONTROL BIT MASK OUT OF OR I G I NAL VAL OR NEW CONTROL BIT IN

RESTORE AX RFG

IREl

Bli NK_I NT

ENOP

0023 0023 0026 0028 002A


0020 002F

ROM CHECK

BB ---- R 8E CO 2A E4 8A 47 02
B1 D3 8B 51 B:l D3 09

MOV MDV

PROC

NEAR POINT ES TO DATA AREA ZERO OUT AH GET LENGTH I NO I CATOR MULTIPLY BY 512 SET COUNT SAVE COUNT ADJUST 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 RETURN TO CALLER

AX, DATA
ES,AX AH,AH AL, [BX+2] CL,09H AX,CL CX,AX
CX

SUB
MOY MDV

EO
C8

SHL
MOV

0031
0033

PUSH

0034 0037 0039


0038

0004
8

MUV

SHR
ADD PDP

03 DO
59 E8 0002 R 711 06

CX,4 AX,CL OX,AX

ex

003C 003F 0041 0044 0047 0047 0048


004F

E8 0000 E
EB 14 90 52 BC 1 E 0069 R

CALL J7 CALL
JMP ROM CHECK 1;

ROS_CHECKSUM_CNT ROM_CHECK_, ROM ERR ROM=CHECK_END


OX

PUSH
MOV MOV

26: C7 06 0067 R 0003


26:

0054 0059
005A 005A

26:
5A

FF 1 E 0067 R

CALL
POP

ES: 10 ROM INIT,DD03H s: I O=ROM=SEG, OS OWORD PTR ES: 10 ROM INIT OX -

ROM_CHECK_END:

C3

RET

0058

ROM_CHECK

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 PROC PUSH
MOV SHR AX

NEAR 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 DISPLAY CHARACTER IN AL CALL VIDEO_IO

50
B1 04 02 E8 E8 0066 R

CALL
PDP AND

CL,4 AL,CL XLAT_PR


AX

58 24 OF 04 90 27 14 40 27 B4 DE B7 00
CO 10

AL,OFH NEAR AL,090H AL,040H NEAR AH,14 BH,a

XLAT_PR PROC
ADD DAA ADC OAA

DOGe
D06C D06E 0070 0072 0073 0073 00"13

PRT_HEX PROC
MDV MOV

INT
RET

10H

C3

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

~~~T=P~T=~E~----PROC----NE~R-----------------------

1E 53

PUSH PUSH ; ------- B/W

OS BX

SAVE CURRENT SEGMENT REGS CARD SET OS TO BW CRT BUFFER GO PR I NT CHARACTER

v I OEO

0075 0078 a07A

BB 0020
8E DB

MOV MOV

E6 0098 R

CALL

BX, C_BWCRT_PTR OS,BX PROT_PRT

Test 3 5-67

;-------- COMPATIBLE COLOR 0070 0080 0082 BB 0028 8E DB E8 0098 R MOV MOV CAll BX,C_CCRT_PTR OS,BX PROT_PRT SET OS TO COM PAT 1BlE COLOR RAM

; -------- ENtlANCED COLOR 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 0030 DB 0098 R 0038 DB 0098 R MOV MOV CAll MOV MOV CALL POP POP RET PROT- PRT: PUSH ROL MOV POP RET PROT PRT_HEX

ax, E_CCRT_PTR DS,BX PROT PRT BX, CCCRT_PTR2 OS, BX PROT_PRT BX


OS

ENHANCED COLOR ENHANCED COLOR PTR HI 64"

57 01 C7 88 05

SF
C3

01 01,1 OS:[DIj,Al 01

SAVE DISPLACEMENT MUlT *2 WR 1TE TO CRT BUFFER RESTORE DISPLACEMENT

ENDP PROC Al, SHUT_CMD STATUS_PORT,Al PROC_S ENDP SHUTDOWN COMMAND 1NSURE HALT

009f 009f OOAl OOA3 OOAlI 00A6 OOA6

BO FE E6 64

F4
EB FD

PROC_SHUTDOWN MOV OUT PROC_S: HLT JMP PROC_SHUTDOWN CODE ENDS END

5-68

Test 3

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

0000

I NCI"UDE SEGMENT. SRC CODE SEGMENT BYTE PUBLIC rXTRN [XTRN [XTRN EXTRN ASSUI-1 PRT HEX: NEAR

XPC~BYTE:NEAR

XMIT 80112:NEAR OBF 112: NEAR CS;COOE,DS:ABSO THIS SUBROUTINE WILL PRINT A MESSAGE ON THE DISPLAY

0000

POST1~:

ENTRY REQUIREMENTS: SI " OFFSET(ADDRESS) OF MESSAGE BUFFER CX " r~ESSAGE BYTE COUNT MAX I MUM MESSAGE LENGHI IS 36 CHARACTERS 0000 0000 0002 PROC MaY CALI PUSI-I ASSUME DS;DATA CALL MOV AND JNZ MFG HALT: eLI
MOV OUT

LMSG

8B EE [8 0019 R
1

0005 0006
0009

OS

NFAR BP, SI P MSG

SFT BP NON~ZERO TO FLAG ERR PRINT MESSAGE

aaoc

f8 OOAA H AO 0010 R 24 01 75 07
FA

OOOE 0010 0010 DOll 0014 0016 0017 0017 0018 001') 0019 0019 001C 0010 001 E 0021 0022 0024 0026 0027

DOS AL,BYTE PTR FQUIP_FIAG AL,OlH NOT_ON AL, MFG ERR FLAG MFG_PORT, AI

LOOP/HALT ON ER.ROR SW I TCH ON? NO - RETURN HALT SYSTEM YES RECOVER ERROR INDICATOR SET INTO MFG PORT HALT SYS WRITE_MSG:

AO 0015 R

[6 80
F"

HLT

1F G3

POP
E MSG P-MSG G12A: RET ENOP PROC MOV INC PUSH CALI

as
NEAR AL,es: [511 SI
AX

2[:
46

8A 04

50
E8 0000 E

58
3C OA

POP
CMP F3

75
G3

JME

RET

PRT HEX AX AL,10 G12A

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

P_MSG

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 ERR - BEEP PROC PUSHF Cli PUSH CALL OR JZ NEAR
DS DDS

9C FA 1E E8 OOAA R OA F6 74 14 06 0057 R FE CE F5 80 3E 0012 R 01 75 02 EB CB 83 01 8 0057 R E2 FE FE CA 75 F5 E2 FE E2 FE 1F 83 E8 E2 FE 75

; ; ;

SAVE FLAGS DISABLE SYSTEM INTERRUPTS SAVE OS REG CONTENTS

DH, DH
G3

G1 : G2:

Mav CAl.L LOOP DEC JNI


GMP

Bl,6
I)EEP G2
DH

G1 MFG_TST,l
G3

JNE JMP G3:


GIl:

MFG_HAL T BL,l BEEP


G4

004A
OOI~C

OOI(E

0050
0052 0054 0055 0056 0057

G5: G6:

90
C3 ERR_BEEP

Mav CALL LOOP DEC JNZ LOOP LOOP POP POPF

al
G3

G5 G6
DS

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

RET
ENDP ROUT I NE TO SOUND BEEPER

0057 0057

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

0059 0058
OU50 0060 0062 0064

PROC MOV OUT JMP

MOY
OUT JMP MOY OUT IN MOV JMP OR OUT SUB LOOP DEC

0066
0068 006A 006e 006E

0010
0072 0074 0076 0078

G7:

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

MOV OUT

AL,AH PORT_S, AL

RECOVER VALUE OF PORT RETURN TO CALLER

RET

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 0086 0088 OOBA OOBC OOBE 0093 0094 0096 0098 0090 009F OOAl 00A3 aOA5
OOA7

BO fF E6 0000 E E3 23 3C FA 75 IF BO FD E6 21 C6 06 006B R 00 FB B3 2B F6 75 E2 FE 75 OA C9 06 006B R 02 06 F7 CB F3


CMP JNZ MOV OUT MOV STI MOV SU8

AL, KB_ACK 013 AL,OFDH INTA01,AL INTR_FLAG,O BL,10 CX,CX INTR_FLAG,02H 012 011
BL

ENABLE KEYBOARD INTERRUPTS WRITE 8259 IMR RESET INTERRUPT INDICATOR ENABLE INTERRUPTS 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 TRY AGAIN READ KEYBOARD SCAN CODE SAVE SCAN CODE JUST READ RETURN TO CALLER

Gll:

TEST
JNZ

LOOP
DEC JNZ

ell

E4 60 8A 08

G12:

OOA9 OOAA
OOAA

C3

Gll: RET KBD_RESET


DDS

IN MOV

AL, PORT_A BL,AL ENDP NEAR


AX

OOAA OOAR OOAE OOBO OOBl 00B2

50 B8 58 C3

PROC PUSH
MOV MOV POP

---- R 6E 08
DDS

AX,DATA OS,AX
AX

RET

ENOP : : : :

00B2 00B2 00B3 00B4 00B5 0086 00B9 OOSB OOSO OOBf

011
lE

.------------------------------ ------ -------------------PROC NEAR


ASSUME PUSH PUSH PUSH PUSH CALL
MOV OUT JMP NOP IN MOV DR JNZ MOV JMP MOV OUT JMP IN MOV OR JZ IN OR JMP OUT MOV JMP OUT

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 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 INTR_fLAG,AH
BX AX OX OS

E8 BO E6 EB

52 50 53

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

OOAA R DB 20 00 20 0 C4 04 FF 2A DB AD 00 AO F8 FF DE Al C7 00 Al 20 00 AD 21 00 C4 21 00 20 20

ooeo

90
E4 8A OA 75 84 fB BO E6 EB E4 8A OA 74 E4 OA EB E6 BO EB E6 E4 EB OA E6 EB BO E6

oom
DOH OOFE OOFF

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

NOT_SEC: IN
JMP OR OUT JMP MOV OUT

SET_INTR_FLAG: 88 26 006S R

58 58 5A
1F
Cf

MOV POP POP POP POP

SET FLAG
RESTORE REG AX CONTENTS ; NEED IRET FOR VECTOR TABLE

DUMMY RETURN 1: IRET011 ENDP

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

------------------------------ - ------------------------NEAR
AX

~OFF

50

INT_287 PROC PUSH


XOR OUT MOV OUT OUT POP INT

SAVE AX REMOVE THE t NT REQUEST ENABLE THE INTERRUPT THE SLAVE THE MASTER RESTORE AX e I VE CONTROL TO NM I

0100 0102 0104 0106 0108 OlOA 010B

32 CO 6 Fa

AL,AL X287,AL AL,EOI INTBOO,AL INTADO,AL


AX

BO 20 [6 AD E6 20

58
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 R[ DIRECT PROC PUSH MOY OUT POP INT
I~

OlOE alOE OlaF


0111 0113 0114 0116 0117

50
SO 20
[6 AD
CD OA

5'

NEAR AX AL, EOI J NTBOO,AL AX UAH

SAVE AX TO SLAVE I NT CONTROLLER RESTORE AX GIVE CONTROL TO HARDWARE LEVEL 2


.n~

[0 I

CF

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

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 0000

SYS_32 SYS_33 SY5_34

m~n
ASSUME CS:CODE. DS:AB50

I NCLUOE SEGMENT. SRC CODE SEGMENT BYTE PUBLIC

0000 0000 0000 0002 0005 0005 0007 OOOA OOOA OOOC DOOF OOOF 0011 0014 0014 0016 0019 0019 001A 0010

P05T5: EXC_DD:

BO 90 E9 0007 R BO 91
E9 0007 R BO 92 9 00D7 R

MOV JMP

AL.90H TEST_EXC AL.91H TEST_EXC

i <~~>~~~~T

~H~~~~~~ ~~~>~~~>~~PECTED

EXC_Ol:
MOV JMP

; <~~>i~~~T I ~H~~~~~i~~~>~~~>~~PECTED
; <><><>5ET CHECKPO I NT<><><><> ; GO TEST If EXCEPTI ON WAS EXPECTED ; <><><>5T CHECKPO I NT<><><><> ; GO TEST I F EXCEPT I ON WAS EXPECTED : <><><>5ET CHECKPO I NT<><><><> ; GO TEST I F EXCEPT I ON WAS EXPECTED

EXC_02:
MOV JMP

Al.92H
TEST_EXC AL.93H TEST_EXC AL,94H TEST_Exe

EXC_03: BO 93 E9 0007 R EXC_04: EXC_05:


MOV J"P MOV J"P

BO 94
E9 0007 R

06
B8 0048 8E CO

PUSH
MOV MOV

ES
AX, ES_TEMP ES.AX LOAD ES REGISTER

;-------

FIX BOUND PARAMETERS


SUB
MOV MOV POP MOV JMP

DOH
0021 0026 002C 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

28 FF 26: C7 05 0000
26: C7 45 02 7FFF

01,01 WORD PTR E5:[01).0

POINT BEGINING OF THE BLOCK SET FIRST WORD TO ZERO SET SECOND TO 07FFFH

07
BO 95 E9 0007 R

WORD PTR ES:[01+2J,07FFFH ; ES AL.95H TEST_EXC AL.96H TEST_EXC AL,97H TEST_Exe AL.98H TEST_EXC AL.99H TEST_EXC AL,9AH

: <><><>5E1 CHECKPO I NT<><><><> : GO TEST IF EXCEPTION WAS EXPECTED ; <:><><>5ET CHECKPO J NT<><><><> ; GO TEST I F EXCEPT I ON WAS EXPECTED

EXC_06:
MOV JMP

BO 96 E9 0007 R
EXC_07: BO 97 E9 0007 R EXC_08: BO 98 E9 0007 R BO 99 E9 0007 R EXC_1O: BO 9A E9 0007 R EXC_ll: BO 9B E9 0007 R BO 9C E9 0001 R BO 90 E8 7E 90 EXC_14: 80 9E EB 79 90 BO 9F EB 74 90 EXC_16: BO AO EB 6F 90 EXC_17: BO A1 E8 6A 90 EXC_18: EXC_12: EXC_13:

MOV JMP MOV JMP

; <><><>5ET CHECK POI NT<><><><> ; CO TEST I F EXCEPT I ON WAS EXPECTED


: <><><>5ET CHECKPO I NT<><><><> ; GO TEST I F EXCEPT I ON WAS EXPECTED ; <><><>5ET CHECKPO I NT<><><><> ; GO TEST I F EXCEPT I ON WAS EXPECTED ; <><><>SET CHECKPO I NT<><><><> ; GO TEST I F EXCEPT I ON WAS EXPECTED ; <><;><>SET CHECKPO I NT<><><><> ; GO TEST I F EXCEPT I ON WAS EXPECTED ; <><><>SET CHECKPO I NT<><><><> ; GO TEST I F EXCEPT! ON WAS EXPECTED ; <><><>SET CHECKPO I NT<><><><> ; GO TEST IF EXCEPTION WAS EXPECTED ; <><><>5ET CHECKPO I NT<><><><> ; GO TEST I F EXCEPT I ON WAS EXPECTED ; <><><>SET CHECK PO I NT<><><><> ; GO TEST IF EXCEPTI ON WAS EXPECTED ; <><><>$ET CHECKPO I NT<><><><> ; GO TEST IF EXCEPTION WAS EXPECTED ; <><><>SET CHECKPO I NT<><><><> ; GO TEST IF EXCEPTI ON WAS EXPECTED ; <><><>5ET CHECKPO I NT<><><>...:::>

EXC_D9:
MOV JMP MOV JMP MOV J"P MOV JMP MOV JMP MOV JMP

TE5T_Exe
AL.9BH TEST_EXC AL.9CH TEST_EXC Al.9DH TEST_EXC Al.9EH TEST_EXC AL.9FH TESCEXC Al.OAOH TEST_EXC AL.OA1H
TEST_EXC

EXC_15:
MOV JMP MOV JMP MOV JMP MOV

80 A2

AL,OAZH

Test 5 5-73

0070 0073 0073

EB 65 90
EXC_19: 80 A2

JMP
t~Ov

; AL,OA2H TEST_EXC AL,OA3H TE5T_EXC AI"OA4H TESl_EXC AL, DASH TEST_EXC AL,OA6H TEST_EXC AL,OA7H TEST_EXC AL,OA8H TEST_EXC AL,OA9H TEST_EXC AL, OAAH TEST_EXC AL,OABH TEST_EXC AL,OACH TEST_EXC AL,OAOH TEST_EXC AL,OAEH TEST_EXC AL,OAFH TEST_EXC AL,OBOH fEST_EXC AL,061H TEST_EXC AL,082H TEST_EXC AL,063H TE5T_EXC AL,OB4H TEST_EXC AL,OB5H TEST_EXC MFG PORT,AL AL,OAEH TEST_Exeo OS
AX

GO TEST

I F EXCEPT I ON WAS EXPECTED

00 f'j
0078 0078 007A 0070 0070 007F 0082 0082 0084 OD87 0087 0089 008C D08C OU8E 0091 0091

[B 60 90
BO A3

JMP

; <><><>SET CHECKPO I NT<><><><> ; GO TEST I F EXCEPTION WflS EXPECTED ; <><><>5ET CH EGKPO I NT <><><><> ; GO TEST I F EXCEPT I ON WAS [XPECTED ; <><><>5ET CHECKPO I NT<><><><> ; GO TEST I F EXCEPTION WAS EXPECTED ; <><><>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 ; <><><>$ET CHECKPO I NT <><><><> ; GO TEST I F EXCEPT I ON WAS EXPECTED ; <><><>SET CHECKPO I NT<><><><> ; GO TEST IF EXCEPTION WAS EXPECTED ; <><><>5[T CH ECKPO I NT<><><><> ; GO T[ST I F EXCEPT I ON WAS EXPECTED ; <><><>SET CHECKPOI NT<><><><> ; GO TE5T I F EXCEPT I ON WAS EXPECTED ; <><><>SET GH ECKPO I NT <><><><> ; GO TEST I F EXCEPT ION WAS EXPECTED ; <><><>SET CH ECKPO I NT<><><><> ; GO TEST ! F EXCEPT I ON WAS EXPECTE[) ; <>"'--""'''5ET CHECKPO I NT <><><><> ; GO TEST IF EXCEPTION WAS EXPECTED ; <><><>SET CH ECKPO I NT<><><><> ; GO TEST I F EXCEPTION WAS EXPECTED ;<><><>SET CHECKPOINT<><><><> ; GO TEST I F INTERRUPT WAS EXPECTED ; <><><>SET CHECKPO I NT <><><><> ; GO TEST I F INTERRUPT WAS EXPECTED ; <><><>SET CH ECKPO I NT <><><><> ; GO TEST I F INTERRUPT WAS EXPECTED ; <><><>SET CHECKPO I NT <><><><> ; GO TEST IF IIHERRUPT WAS EXPECTED ; <><><>$ET CHECKPO I NT<><><><> ; GO TEST I F INTERRUPT WAS EXPECTED ; <><><>5l T l:HECKPO I NT<><><><> ; GO TEST I F INTERRUPT WAS EXPECTED ; <><><>SET CHECKPO I NT<><><><> GO TEST I F INTERRUPT WAS EXPECTED OUTPUT THE CHECKPO I NT CHECK FOR EXCEPT ION GO I F A SYSTEM I NT SAVE THE CURRENT DATA SEGMENT

MOV
JMP

[6 5B 90
SO A4

MOY
JMP

EB 56 90
BO A5
EB

MOV
JMP

51 90

80 A6 EB 4C 90 60 A7 EB 47 90 BO AB E6 42 90

MOV
JMP

MOV JMP MOV


JMP

0093 0096 0096


0098 0096

80 A9 ES 3D 90
60 AA E8 38 90 80 AB EB 33 90

MOV ,JMP
~10V

0098
0090 DOAO OOAO 00A2 OOA5 OOA5 OOA7 OOAA OOAA OOAC OOAF aOAF 0081 0084 0084 0086 0089 0089 OOBB OOBE OOSE

JMP

MOV
JMP

80 AC E6 2E
BO AD

MOV

90

JMP

MOy
JMP

EB 29 90

BO AE
EB 24 90 80 AF E8 1 F 90 60 130 EB 1A 90 BO S1 EB 15 90

MOV
JMP

MOV
JMP

MOV
JMP

ooeo ooe3

MOY
JMP

00C3

so

00C5
OOC8

B2 EB 10 90

MOV JMP MOV JMP SYS 37: MOV


JMP

ooca

OOCA OOCD OOCD OOCF 0002 0002 0004 0007 0007 0009 0008 DODD OOOE OOOF 00E2 DOEll DOEA OOEF 00F2 OOFII OOF5 00F6

BO 63 EB OB 90 BO 64 EB 06 90 BO BS E8 01 E6 80 3C AE 77 22 1E

90

MOV JMP TEST [XC; OUT


CMP

JA

50
B8 8E C7 c6 88 8E 58 1F 5A 0008 08 06 0048 FFFF 06 0040 93 0048 CO

PUSH PUSH MOV MOV MOV MOV MOY MOV


POP POP POP POP

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

oon

OX

CHECK

I F CODE SEG SECOND ON STACK

59
51 83 F9 40 75 01 52 86 E4 3A 74 EO 88 C4 OF

OOFB OOf9 OOFC DOFE OOFF OOFF 0101 0103

PUSH
Cf~P

cx ex
CX,SYS_ROM_CS TEST_EXCO ox AH,AL AL,OMA PAGE+OAH AL, AH JEST_EXC3 AL,MFG_PORT AL,03BH TEST_EXC2 AH,AL MFG_PORT, AL TEST_EXC2 AL,AL DMA_PAGE +OAH, AL AX, 01 DOH CONTINUE I F ERROR CODE PUT SEGMENT BACK ON STACK SAVE THE CHECKPOINT WAS THE EXCEPT I ON EXPECTED? GO I F YES CHECK THE CURRENT CHKPT HALT IF CHKPT BELOW 3BH

JNZ PUSH TEST EXCO; XCHG IN


CMP

0105
0107 0107 0109 010B 0100 alOE alOE 0110 0112 0113

JZ
TEST_EXC1; IN
CMP

E4 80 3C 3fl 72 01 CF 86 EO E6 80 Fli EB F9 2A CO E68B B80100 Cf

JB
IRET

TEST

EXC2: XCHG
OUT

OUTPUT THE CURRENT CHECKPO I NT <><><> CKPT 90 THRU B5 <><><> I NSURE SYSTEM HALT CLEAR DMA PAGE USED FOR BOUND
RETURN

HLT
JMP TEST EXC3;
SUB OUT

0115
0115 0117 0119 OllC 0110

MOV
IRET

I NSTR EXPECTED I NT5

CODE

ENDS END

5-74

Test 5

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 0000 I NCLUOE SEGMENT. SRC CODE SEGMENT BYTE PUBLI C 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 EO: NEAR E MSC: NEAR KSD_RESET: NEAR xrc 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 ASSUME ASSUME 0000 POST6 PROC CS: CODE os: DATA 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. 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 -

0000 0000 0002 0004 0006 0008

88 09
E4 EB DC E6 E8 24 E6 61 00 OC 61 00 F3 61

STCTST eNT - MOV

SAVE WORD COUNT OF BLOCK TO TEST 10 DELAY TOGGLE PAR I TY CHECK LATCHES 10 DELAY

IN
JMP OR OUT JMP AND OUT
;~-------

OOOA OOOC OOOE

ROLL A BIT THIWUGH THE FIRST WORD OX,OOOlH eX,16 DI,DI SI,SI AX,DX 51,51 AX, OX 01 A C13 OX,l 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

~OlO

0013 0016 0018 OOlA D01C 001D 001 F 0020 0022 0024 0027 0029

SA 89 28 28 88 AB 2B AD 33 74 E9 D1 E2

0001 0010 FF F6 C2 F6 C2 03 DOCS R E2 EB

el ;

MOV MOV SUB SUB t-lDV STOS .... SUB LOOSW XOR JZ JMP SHL LOOP

C1

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

FF F6

CO
FFOD 0001 05 Ff Ff

as

e2 03 00C5 R FF CO OOFf

SUB SUB SUB to\DV STOSW MOV MOV SUB MOV XOR JZ JMP

DI,OI S I, S I AX,AX DX,OFFOOH 01,1 BYTE PTR [OI},OfFH 01,01 AX,WORD PTR [01] AX,DX C1 B

START AT BEGINING OF BLOCK ; INITIALIZE DESTINATION POINTER ; WRITE 0 ; STORE DATA PATTERN ; AT THE FIRST ODD LOCATION ; WRITE A BYTE OF FF GET THE DATA CHECK THE FIRST WRITIf:.N EXIT IF NOT

e13

fF c6 05 FF 2B rr 8B 05 33 C2 75 6A

28 28 8A AB 28

C1 B,

SUB SUB MOV STOSW SUB MOV SUB MOV XOR JNZ

01,01 AX,AX DX,OOOFFH 01,01 BYTE PTR [01 ],OFFH 01,01 AX,WORD PTR [DI} AX,OX

START AT BEGINING OF BLOCK WR I T[ a 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

C13

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


006~

10 OR BASE RAM AL, PORT B AL, PARITY_ERR AL,AH AL,DMA PAGE+6 AH,AL CHECK fOR 10/PAR CHECK STR I P UNWANTED 8 I TS SAVE ERROR CHECK FOR R/W OR 10 ERR

006-( 0069 0068

E4 24 86 Ell 22

61 CO

eLI
87
EO

IN AND XCHG IN AND

; ------- RESTORE AX 006D 006F 0071 E4 8A 86 01 E4 89 IN XCHG IN AL,OMA_PAGE+9 AL,AH AL,DMA_PAGE+8 GET AH 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
AD

JNZ MDV C3: C4: C5: C6:


SUB SUB

C13 DX,OAA55H [)I,DI

Mav Mav RE? Mav


SUB

51,51 CX,BX AX,DX STOSW CX,BX SI,SI

33 C2 75 3A E2 F9

xaR

LOOSW

JNZ LOOP

en e6

AX,OX

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

;------- TEMP SAVE FOR A:X (PUSH NOT ALLOWED) 0080 008F 0091 0093 E6 86 EB E6 89 C4
OUT

00
8A

XCHG JMP
OUT

DMA_PAGE+8, AL AL,AH SHORT $+2 DMA_PAGE+9,AL

SAVE AX

; -------- CHECK 10 OR BASE RAM

0095
0097 0099 0098 0090

E4 24 86 E'-1 22

co
C4 87 EO

61

IN
AND XCHG IN AND

AL, PORT_B AL, PAR I TY ERR AL,AH AL,OMA PAGE +6 AH,AL -

CHECK FOR IO/PAR CHECK STR! P UNWANTED BITS SAVE ERROR CHECK fOR R/W OR 10 ERR

; ------- RESTORE AX 009F OOAl eOA3 E4 8A 86 C4 E4 89

IN
XCHG IN

AL,DMA_PAGE+9 AL,AH AL,OMA_PAGE+8

GET AH GET AL

;-------- PARITY ERROR EXIT aOA5 75 1 E JNZ

C13

GO

Jf

YES

; ------- CHECK fOR END Of 64K BLOCK OOA7 00A9 23 02 AND JZ OX,OX C14 ENDING ZERO PATTERN WRITTEN TO STC ? YES - RETURN TO CALLER WITH AL=O

74 lA
81 74 81 74 BA EB FA 55AA Of FA 0101 Of 55AA Be

OOAB OOAf OOBl 00135 00B7 OOBA

;------- SETUP NEXT PATTERN CMP OX,055AAII JZ C9 eMP OX,0101H JZ C10 MOV DX,055AAH JMP C3 ; -------- LAST PATTERN = 0000

CHECK I F LAST PATTERN =55AA GO I F NOT LAST PATTERN 0101? CO I F YES WRITE 55AA TO STORAGE

OOBC OOBE

2B 02 EB B8

C8:

SUB

OX,OX
C3

; WR I TE 0000 TO STORACE

JM? ;--------

INSURE PARITY BITS ARE NOT STUCK ON OX,OlOIH


C3

OOCO 00C3

BA Ul01 EB B3

C9:

Mav JM?
lX I I

WRITE 0101

TO STORAGE

; --------

00C5 OOC5

C3

C13: C14:

RET

;------- CHECKER BOARD TEST eOC6 OOC8 OOCA 2B FF 8B CO 01 E9 C10:


SUB

01,01
eX,BX eX,l AX, 010 1a 101 01 0 1 0 101 B AX,1010101010101010B

ooce
OOCf DODO 0003 0004 0006

B8 5555
AS

Cll:

0001;1 OODA
OODC 0000 OOEO 00E2 00E3 006 00E8

28 8B 01 AD 35 75
AD

B8 AAAA AB ~7 f6 f6 CB

MDV SHR MDV STOSW Mav

srosw
LOOP

ell
51,51
CX,BX CX,l AX, 0101010101 010 101 B

SUB

MUV
SHR

E9
C12: 5555 E3

LODSW
XUR

JNZ LODSW
XOR

C13
AX,1010101010101010B

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

35 AAAA 75 00 E2 F2

JNZ LOOP

en

e12

; ------- TEMP SAVE fOR AX (PUSH NOT ALLOWED) OOEA OOEC E6 89 86 C4


OUT

XCHG

DMA_PAGE+8,AL AL,AH

SAVE AX

5-76

Test 6

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

EXTHN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN 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 0000 0000 0003 0005 POST? [8 0000 E 60 FO E6 80

E MSG;NEAR xPC 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

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

SET DATA SEGMENT

; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT FO <><><><>

---- SET SHUTDOWN RETURN 7 0007 0009 00013 0000 BO 8F

MOV
OUT
~lOV

,6 70
BO 07 EB 00 E6 71

JMP

Dour

OUT

AL, SHUT DOWN CMOS_PORT, AL Al,7 SHORT $+2 CMOS_PORT+1,AL

AODR

FOR SHUTDOWN BYTE

SET ERROR EX I T (DOUBLE EXECPT ION? ) 10 DELAY

; -------' ENABLE PROTECTEO MODE 0011 0014 0016 UU1Y BC 0000 8E 04 BC 8000 [8 0000 E

MOV
I~OV

MOV

SP, POST_SS SS,SP SP, POST_SP SYSINIT1 ;

SET STACK FOR SYS I N I T1

CALL

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

BC FfFO

MOV ;

SP, MNCSEG_LEN-2

; ------- ;VER~FY-PROTE;;TEO-MODE

--------------------AX
OOFH BYTE

5MSW 0038 0039 0039 0038 0039 0039 0038 0038 003E 0040 0043 0045

GET THE MACHINE STATUS WORD

OF 01 EO 01
A9 0001 75 03 E9 02EA R BO f1 E6 80

+ + 110000 + + 110001 +

DB

LABEL
SHL

AX,1
BYTE OFFSET C5: 110000 00lH OFFSET CS: 110001 AX, V I RTUAL_ENABLE T7_1 ERROR_EXIT AL,OFlH MfG_PORT ,AL

LABEL

DRG
DB

ORG
TEST JHZ
JMP

; ;

ARE WE I N PROTECTED MODE ERROR I F NOT

T7_1:

MOV OUT

; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT F1 <><><><>

; ---- ---!. -~NTERRU;T-TE;;-( ;ROGR;~MED- ~;rERRU ;r-32i


0047 0049 0048 0040 004F 0051 0053 0055 0057 BO E6 CO 2B E4 22 EO 74 E9 AF 88 20 C9 88 CO fA 03 02EA R
~OV-----~L:O~;~--------------------------- SET EXCEPTION FLAG

LOOP1:

OUT INT SUB IN AND LOOPNZ

OMA_PAGE+OAH,AL 32 CX,CX AL,OMA_PAGE+OAH AL,AL LOOPl

FOR INT 10 INTERRUPT WAIT FOR INT DID THE 1NTERRUPT OCCUR? MISSING INTERRUPT

j~p

~~R~R_EXIT
AL,OF2H MFG_PORT. AL

; -------- CAUSE AN EXCEPTI ON INTERRUPT (GENERAL PROTECT I ON I NT 130) 005A 005C 005E 0060 BO f2 E6 80 BO 90 E6 88 MOV OUT ; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT F2 <><><><> 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 C7 06 0048 0000 MOV ;------- CPLO, DATA ACCESS RIGHTS 0068 0060 0072 C6 06 0040 93 C6 06 004C 01 C7 06 004A 0000 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 SEGMENT TO 0

; -------- SET ES REG I STER 0078 007B 0070 007F 0082 0084 0086 0088 aOBA OOBC DoaF B8 0048 BE CO 26 FF 26: 88 05 2B [4 22 EO 74 E9 MOV MOV AX, ES_TEMP ES,AX LOAD ES

;------- CAUSE AN EXCEPTION 13 INTERRUPT SUB 01,01 MOV AX, ES: (01 ]
SUB

TH I 5 SHOULD CAUSE AND EXCEPTI ON WAIT FOR INT DID THE INTERRUPT OCCUR? CONT 1NUE I F INTERRUPT M I S5 I NG INTERRUPT

c9
8B CO FA 03 02EA R LOOP2:

IN AND LOOPNZ JZ JMP

CX,CX AL,OMA_PAGE+OAH AL,AL LOOP2 T7 3 ERROR_EXIT

.-------------- --------------- ------------ ------;

y~~+~~C~~gNtOTjSOT

LTR/STR

; DESCR I PT I ON LOAD LOT REGISTERS WITH A DESCRIPTOR VER I fY CORRECT

--------------------- --------------------------MOV OUT I.lJOV LLOT DB LABEL MOV LABEL ORG


OR

; ------- 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 AL,OF3H MFG PORT ,AL OI,POST_LDTR 01 OOFH BYTE OX,OI BYTE OFFSET CS: 110002 OOOH OFFSET CS:??0003 ; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT f3 <><><><> REGISTER FROM THIS AREA

00

+ + 1?0002 + + 710003 +

ORG

; ------- READ AND VER I FY 266 LOT SELECTOR 0099 009B 009C OOgc 009E 00ge 009C 009E D09E DOAl 00A4 2B CO OF 03 CO
SUB

SLOT

AX,AX AX

; CLEAR AX ; GET THE LOT SE.LEC10R

+ + 1?0004 + : 1?0005

DB

LABEL ADD LABEL

ORG
DB

00
25 00f8 3D 0078 75 1B

ORG
AND
eMP

JNZ

OOFH BYTE AX,AX BYTE OFfSET cs: 1?0004 OOOH OFFSET cs: ??0005 AX,OF8H AX, POST_LOTR ERROR

STR I P TI jRPL CORRECT SELECTOR? GO IF NOT

; -------- WR I TE TO 286 TR 00A6 00A9 BF 0068 MOV

OF
8B OF

+
+ 110006 + + ??0007

LTR
DB

OOAA DOAA
OOAC

DOAA DDAA
OOAC

+
00

LABEL MDV LABEL DRG DB

ORG

01, POST_TR 01 OOFH BYTE BX,OI BYTE OFfSET CS: 710006 OOOH OffSET cs: 110007

REG I STER FROM TH I S AREA

;------- VERIFY 286 TR REGISTERS

5-78 Test 7

OOAC OOAE OOAr OOAF 0081 OOAF OOAF OOBl 00131 00B4 00137

28 CO

OF

88 C8

. .
+

SUB
5TR

AX, AX

AX
OOFH BYTE CX,AX BYTE OFfSET CS; ??0008 OOOH OFFSET CS: ??0009 AX,OFBI! AX, POST TR ERROR -

eET THE TR

REG

08

??0008

Mav

LABEL

+ ??0009

00
25 OOF8 3D 0068 75 08

LABEL ORO DB
ORG AND eMP JNZ

CORRECT SEL[CTOR?

;-------- TEST 286 CONTROL FLAGS 00139 OOBA OOBB OOBe OOBF OOC1
OOC4 FO 9C

58 A9 0200
14 03

STD PUSljF I'OP TEST ERROR:


JZ JMP

SeT 0 I RECT I ON FLAG FOR DECREMENT

GET THE FLAGS


AX
AX,02001i

17 4
ERROR
~-

[9 02EA R
A9 0400
75 03 E9 02EA R
FC 9C

EXIT

INTERRUPT FLAG SHOULD BE OFF CONT I NUE I F OFF GO I F NOT CHECK DIRECTION FLAG GO I F NOT SET CLEAR DIRECTION FLAG INSURE DIRECTION FLAG IS RESE.T

aoce

OQC4 OUC7 OQC9 OOGO OOGE Doer 0002 0004 0007

T7 - 4,

TEST
JNZ JMP

AX,0400H

r7

ERROR EXIT

T7 -~:

CtD PUSHF
POP

58
A9 0400 71~ 03 E9 02EA R

AX
AX,0400H

TEST
JZ JMP

17 6
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) AL,OF4H MFG PORT,AL AX,ES_TEMP [S .. AX
fUNCT IONS CORRECTLY

0007 0009 0008 OOoE

80 F4
E6 80 88 0048 8E CO

MOV

OUT t<\OV
MOV

; <><><><><><><><><><><><><><> ;<><><>CHECKPOINT F4 <><><><>


LOAD ES REGI STER

; ------- CHECK tlOUNU ODED 00E2 00E7 ODED OOEf OOFl OOF4 00F5 OOF5 OOf 7 OOFS OOfS 00F7 00F7 DOF9 OOFB OOFD OOFt 0101 0104

28 FF
26: 26: C7

os

0000

SUB MOV

01, DI WORD PTR [S:[OI],O

rOINT IH.GINING OF THE BLOCK SET FIRST WORD TO ZERO SET SECOND TO 07FFFH INTERRUPT 5 FLAG

C7 45 02 7fFF

MOV
MOV OUT

WORD PTR ES: [0 I +2], 07rFFH ; AL,09:;'H DMA_PAGE +OAH, AL AX,1000H

130 95 E6 813 138 1000

SET

26
+ ??OOOB

MOV SEGOV DB
BOUND

E5
026H AX, (01] BYTE AX, (01] (lYTE OFFSET CS:??OOOB 062H OFFSET CS: ??OOOC CX,CX LOOPA AL, DMA_PAGE +OAH AL,O

SET AX WITHltj BOUNDS USE THE" ES REG

88 05
62
28 E2 E4 3C G9
FE

+
+ ??OOOC

LABEL MOV LAt3LL ORG DB ORO


SUB

WAlT FOR POSSIBLE INTERRUPT


GET THE RESULTS DID AN I NTERRUPT OCCUR? CONT I NUE I F NOT GO I F YES INT 5

LOOPA:

88 00 7'y 03 E9 02EA R

LOOP IN eMP JNZ JHP

T7 I
ERROR_EXI T

T7 7:
28 FF
26: C7 05 3FFO

;-:------- CHECK LOW BOU~O WORD CAUSES

0104
0106 0108

Mav
MOV

SUB

BB 1000 26
+ ??OQO[

AX,10aOH
ES

S(T

SEGOV

AX OUT OF BOUNDS USE THE ES REG

alOE
OlaF Olor 0111 OlOF 010F 0111 0111 0113 0113 0115 011 7 0119 01113

DO
BOUND LA!3[L
MOV

88 05
+ ??OOOF

LABEL ORO

62
2B C9 LOOPB:

OB
ORe SUB

026H AX, [DI] BYTE AX, [01 I BYTE OFFSET eS:??OOOE 062H OFFSET CS:??OOOF cX,ex AL,DMA_PAGE+OAH AL,OH LOOPS

WA I T

FOR POSS I BLE

I NTERRU PT

[4 8B 3C 00 EO FA 74 03 9 OZEA R

IN
eMP

LOOPNZ
JZ JMP

178
EHfWR_[XI T
I NT

GET THE RI:.SULTS DID AN I NT[RRUPT OCCUR? TRY AGAIN CONTINUE IF INTERRUPT CO I F NO I NTERRU PT

; -------- CHECK HI CH BOUND WORD CAUSES

5
SET FLAG FOR INTERRUPT

all E 0120
0122 0124 0129 012F 0132 0133 0133 0135 0133 0133 0135 0135 013"7 0137 0139 01313 0130 013F

BO 95 6 8B

AL,95H OMA_PAGE +OAH, AL


SUB MDV
~10V

2B FF 26; c7 05 0000
26: C7 45 02 OHF 138 1000

MOV

SEGOV

26
813 05 + ??0011 + ... ??0012

OB
BOUND LABEL MOV LA[3[L ORO DB
ORC SUB

62
28 C9 l.OOpc:
El~

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 AL,OMA_PAGE+OAH AL,OH l.OOPC GET THE RESULTS DID AN INTERRUPT OCCUR? TRY AGAIN GO IF NO INTERRUPT

88

IN
CMP

3C 00 [0 FA 74 03 E9 02EA R ; ;

LOOPNZ
JZ JMP

T7 9
ERROR_EX I T

VERI FY PUSH ALL AND POP ALL OESCR I PT I ON

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 015C 0150 015f 0161 0163 0165 0167 0169 0168 016C 016F 0170 0172 0175

BO E6 B8 8B

f5 80 0001 D8

'13
8B CB

41
8B D1

42
86 fA

47
86 f7

46

MOV OUT MOV HOV INC MOV INC HOV INC HOV INC HOV INC

AL,OF5H MFG_PORT, AL AX,Ol eX,AX


BX

; <><><><><><><><><><><><><><> ; <><><>CHEGKPO I NT F5 <><><><> SET AX",1 SET BX=2 SET CX=3 SET OX=4 SET DI=5 SET SI=6 SAVE THE SP REGISTER SET BP=7 I SSUE THE PUSH ALL COMMAND

eX,BX
CX

OX,CX
DX

DI,DX
DI

$I,DI
SI BP

55
88 EE

PUSH
HOV INC

BP,SI
BP

45
60
2B 86 8B 86 86 86 88 CO 08 CB DO Fa FO E8

PUSHA
DB SUB MOV MOV MOV MOV MOV MOV

060H AX.,AX BX,AX CX,AX OX,AX OI,AX SI,AX BP,AX 061H BP,07
BP

CLEAR ALL REGS

paPA
OB CMP POP JNZ CMP JNZ CMP JNZ CMP JNZ CMP JNZ CMP JNZ CMP JNZ JMP

GET THE REG I STERS BACK

61
83 fD 07

5D
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
OHA 017C 017F 0181 0184 0186 0189 0188 018E 0190 0193 0193

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

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

7 1 2 3 4

5 6

E9 02EA R

;-----------ERROR [XIT ERROR EX I T1 : JMP ERROR_EXIT 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 MOV
OUT MOV HOV MOV

: : : :

;
0196 0198 019A OlAD 01A5 OlAB OlAE BO F6 E6 80 C7 06 0048 FFFF C6 06 OOllC 00 C7 06 004A FOO~ B8 0048 8E CO

------------------ ----------------------------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 f>IDV
MOV

T7_10:

;--------

INSURE ACCESS RIGHTS MAY BE WRITTEN

01BO 01B1 0162 0182 01B4 0182 01B2 01B4 01B4

3E
Df

+
+ ??0014

SEGOV DB VERW DB LABEL


MOV

as
03EH AX OOFH BYTE BP,AX BYTE OFFSET CS:??0014 OOOH OFFSET CS: ?70015 ;

SET SEGMENT OVER I DE TO START Of TABLE


CHECK THE ACCESS RIGHTS OF ES_TEMP

88 E8
DO

+
+ 710015

LABEL
ORG

DB
ORC JNZ

75 DO

ERROR

I F SEGMENT CAN NOT WR I TE

;------- SET ACCESS RIGHTS TO READ ONLY 0186 01B8 01 BE OlCO 01Cl 01C2 01C2 01C4 01C2 01C2 OlC4 01C4 01C6 01C9 OlCA OlCS OlCS 01GO OlGS OlCS OlGD OlGO C6 06 0040 91 B8 0048 8E CO MOV
MOV MOV

BYTE PTR DS:(ES_TEMP.DATA_ACC_RIGHTS),91H

AX, ES TEMP
ES, AXOS

LOAD ES REGISTER SET SEGMENT OVER I DE TO START OF TABLE CHECK THE ACCESS RIGHTS OF ES_TEMP

3E
Of

88 E8

+
+

+ ??0017

+ ??0018

00
74 CD B8

SEGOV De VERW DB LABEL MOV LA6EL ORG DB


ORG JZ MOV

03EI1 AX OOFH BYTE BP,AX BYTE OFFSET CS:??0017 OOOH OFFSET CS: ??0018 ERROR_EX I T1 AX, ES TEMP
OS -

ERROR 1 F SEGMENT IS WR I HABLE I NSURE THAT SEGMENT I S READABLE

0048

3E
OF

+
+ ??OOlA

SEGOV DB VERR DB LABEL


MOV

03EH

8S 0
00
75 C4

+ + ??0018 +

LABEL
ORG

DB
ORG JNZ

AX OOFH BYTE SP,AX BYTE OFFSET C5; ??OOlA OOGH OFFSET CS: ??001B
GO I F SEGMENT NOT READABLE INTERRUPT SET EXCEPT I ON FLAG FOR INT 13

;------- CAUSE AN EXCEPTION 13 OlCF

0101
0103

60 90 E6 86 28 F6

MOV OUT

AL,09DH DMA_PAGE+OAH,AL 51,SI

SUB

5-80 Test 7

0105 0109 o lOB OlOO 010F 01E1

26: C6 04 00 2B E4 22 EO C9 8B CO FA LOOPD:

MOV
SUB

BYTE PTR ES:(SI].OO CX,CX AL,OMA_PAGE-+-QAH AL,AL LQOPO ERROR_EX I T1

WR I TE A BYTE THAT SHOULD CAUSE AN EXCEPT I ON WAIT FOR INT DID THE MISSING INTERRUPT OCCUR? INTERRUPT

IN
AND

75 80

LOOPNZ JNZ

;-------- RESTORE THE ACCESS RIGIITS BYTE

013

C6 06 0040 93

MOV

BYTE PTR

os: (ES_ TEMP. DATA_ACC_R I GHTS), CPlO_DATA_ACCESS

;
01E8 OlEA OlEC 01EF 01 F2

-- - - - ---------- -------------------- - --- - -------MOV

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 AL,OF7H MFG PORT,AL AX,ES_TEMP BX,OS_TEMP AX,03H

BO F7 6 80 138 0048 BB 0060


00 0003

OUl
MOV MOV OR

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

; -------- NOTE BX = FIRST OPERAND 01 F5 01F5 01 F7 01 F5 01 F5 01 F7 01F7 01F9 01 FC 01 FF

8B C3

+
63
75 80 80 75 9A E3 03 Fe 03 92

+ ??OQ1G + + ??OQ1D

ARPL LABEL MOV LABEL ORG


DB

ORO JNZ
AND CMP

JNZ

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 B8 0048 80 CB 03

MOV MOV OR

BX, OS_TEMP AX, ES_TEMP BL,03H

; PUT A SELECTOR I N ; PUT A SIcU:CTOR I III AX ; MAKE ACCESS OF BX < AX AX = SECOND OPERAND ; I SSUE THE RPL COMMAND ; NOTE: SOURCE / TARGET REGS ARE REVERSED DUE TO QPCODE BIT 1

ex

;-------- NOTE BX "" FIRST OPERAND 02GA 02GA 020C 020A 020A 020e 020C 020E 0211 0214 -+- ??OOlE -++ ??OOl f ARPL LABEL MOV LABEL ORG
DB

8B C3

+
63
74 80 80 75 85 E3 03 F8 03 2F

ORO JZ
AND CMP

JNZ

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

GO 1 F R PL WAS NOT CHANGED ; STR I P UNWANTED BITS ; AS EXPECTED? ;GOIFNOT ;

--------------.--- -----------------------------================::==0==0===
========================
MOV

VERIFY LOAD SEGMENT LIMIT (LSLI AND LOAD ACCESS RIGHTS (LAR) I NSTR

;-------- CHECK THE LAR INSTRUCTION 0216 0218 80 F8 6 80 AL,OF8H MFG_PORT, AL ; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT f8 <><><><>

OUT

; ------- SET THE OESCRI PTOR TO LEVEL 3 021A 021F 0222

c6 06 0040 F3
BB 0048 28 CO

MOV
MOV
SUB

BYTE PTR OS: (ES_TEMP.DATA_ACC_RIGHTS),CPL3_0ATA_ACCESS BX, ES_TEMP AX,AX ; CLEAR AX

; -------- GET THE CURRENT DESCRI PTOR"S ACCESS RIGHTS

LAR
0224 0225 0225 0227 0225 0225 0227

Of
88 C3

DB

+ ? ?0020 +
-+-+- ??0021

LABEl MOV LABEL ORG


DB ORO

02

AX. BX DDFH BYTE AX,BX BYTE OFFSET CS:??0020 002H OFFSET CS: ??0021

1SSUE THE LAR COMMAND

;-----~--

INSURE THE DESCRIPTOR WAS VISABLE ; GO IF LAR WAS NOT CHANGED

02;>7

75 lC

JNZ

;-------- THE DISCRIPTOR"S ACCESS RIGHTS MUST BE 0229 022C 80 FC F3 CMP JNZ AH,
CPL3~DATA_ACCESS

75 1"1

ERROR~EXIT2

; AS EXPECTED? ; GO I F NOT

=:;o=;===============================:=:=
;-------'CHECK THE LSL (LOAD SEGMENT LIMITS)

==-==::====::=::==-=",=:=:::=:::::==0:==========
022E 0230 0232 0238 0230 0240 0241 0241 0243 0241 0241 0243 0243 0245 0245

BO F9 6 80 C7 06 0048 AAAA
C6 06 0040 93 B8 0048

f~OV

OUT
MOV

AL.OF9H MFG PORT,AL OS: IS_TEMP. SEG_LIMI T ,OAAAAH

; <><><><><><><><><><><><><><> ;<><><>CHECKPOINT F9 <><><><> ; SET SEGMENT L1 MIT TO OAAAAH

MOV

AXI ES_TEMP
BX,AX OOFH BYTE BX.AX BYTE OFFSET CS:??0022 003H OFFSET CS:??0023 R07

LOAD ES REG I STER ; GET THE OESCR I PTOR SEGMENT LIM I T

LSL

Of

DB

88 08
03 74 03
9 02EA R

+ ??0022 +

-+- ??OQ23

LABEL MOV LABEL ORG


DB ORO

JZ ERROR_EX! T2:
JMP

GO I F OK GO I F NOT SUCCESSFUL

Test 7 5-81

0248 024C 0252 0255 0256 0256 0258 0256 0256 0258 0258 025A 025E

81

FB AAAA

R07:

CM' MOV MOV LSL DB LABEL MOV LABEL ORG DB ORG JNZ CM' JNZ

BX,OMMH

I NSURE CORRECT SEGMENT LIM I T ;SET THE STMENT LIMIT TO 05555H

C7 06 0048 5555 88 0048 Of 88 08

os: ES_TEMP. SEG_LI HI T, 05555H


AX, ES_TMP BX,AX OOFH BYTE BX,AX BYTE OFFSET CS;??0024 003H OFFSET CS: ??0025 ERROR_EX I T2 6X,05555H ERROR_EX I T2

! !

+
170024 ??0025

; GET THE OESCR J PTOR SEGMENT LIM I T

03
75 EB 81 FB 5555 75 E5

+ +

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 FA 80 0008 08

----- ---- -------------------- ------------- ----------------MOV OUT MOV MOV AL,OFAH MFC_PORT, AL

H.ST fHAI A WRI1 10 ADDRESS 180000 00[5 NOT WRITE TO BOOO;O, OR lB8000 DOES NOT WRITE TO B800;0

~~:~~T_PTR

; <><><><><><><><><><><><><><> ;<><><>CHECKPOINT FA <><><><> ; MODIFY THE DESCRIPTER TABLE DATA ACCESS

; -------; sE~-T~~p-Es-DEscR~PToR-64~-S~G;~NT-L~~~~ /GPLO


;
0269 026F C7 06 0048 FFFF C6 06 0040 93

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

MOV MOV

os: ES_TEMP.SEG_LlMI T, MAX_SEG_LEN BYTE PTR OS: (ES_ TEMP. OATA_ACC_R I GHTS), CPLD_DATA_ACCESS
BYTE PTR OS; (ES_TEMP.BASE_HI_BYTEl,lBH as: ES_TEMP.BASE_LO_WORD,O

;------- START WITH SEGMENT lBOOOO 0274 0279 027F 0282 0284 0286 C6 06 OOIl.C 1B c7 06 004A 0000 B8 0048 BE CO 2B FF 26: C7 05 AA55 MOV MOV MOV MOV SUB MOV

AX. ES_TEMP
ES,AX 01,01 WORD PTR ES:(0IJ,OAA55H

LOAD ES REG POINT TO FIRST LOCATION WRITE A ZERO

; ------- DO FOR SEGMENT 1 B8000 0288 0291 0294 0296 C7 06 004A 8000 B8 0048 8E CO MOV MOV MOV MOV OS: ES_ TEMP. BASE_LO_WORD, 8000H AX,ES_TEMP ES,AX WORD PTR ES:[DIJ,OM55H LOAD ES REG WRITE A ZERO

26: C7 05 AA55

; -------- DO FOR SEGMENT 1AOOOO 0298 02AO C6 06 004c lA C7 06 004A 0000 88 0048 8E CO 26: C7 05 AA55 MOV MOV MOV MOV MOV ; ------- B/W 02BO 0283 02B5 BS 0020 61:. DB 66 05 MOV MOV MOV BYTE PTR DS:(ES_TEMP.BASE_HI_BYTE),1AH DS: ES_TEMP. BASE_LO_WORD,O AX, ES_TEMP ES,A>< WORD PTR ES:(DI],OM55H LOAD ES REG WRITE A ZERO

02M
02A9 02AS

v IDEO

CARD SET as TO BW CRT BUFFER GET THE WORD FROM B/W V IDEO

g~: ~XBWCRT _PTR


AX,DS:[DI

;-------- COMPATIBLE COLOR 02B7 02BA 02BC BS 0028 8E DB B6 10 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 028E 02C1 02c3 89 0030 BE 09 8B 00 MOV MOV MOV

g~; ~xCCRT _PTR

AGC COLOR CRT PTR LOW 64K

ex,os: [01]
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<><><>

; -------- TEST FOR ERROR 02C5 02C6 02ca 02CA 02CB 02eE 0200 0204 0206 020A 020C 020E

50
BO 35 E6 ao

58
30 AA55 74 1A

81 FB AA55
74 81 74 BO E6 14 F9 AA55 OE 34 80

PUSH MOV OUT POP eMP JZ CMP JZ CMP JZ MOV OUT

RESTORE CHEGKPOI NT <><>CHECKPOINT 34 <><><><>

;------- SHUTDOWN 02EO 02EO 02E2 02E4 02E6 02E8 02EA 02EA 02EO 02EO BO E6 BO EB E6 8F 70 06 00 71 NORMAL_EX IT; MOV OUT MOV .IMP OUT ERROR_EX IT: JM' POSH CODE ENOP ENOS 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

E9 0000 E

'NO

5-82

Test 7

TITLE

SYSINITl SYSINITl

09/26/83 INITIALIZE fOR PROTECTED MODE (POST TEST)

Include fi les INCLUDE I NCLUOE INCLUDE I NCLUOE I NCLUOE SYSDATA.INC ACCESS, I Ne SYSDATA.MAC I APX286. MAC POSTEQU, SRC SYSINI'Tl

.LIST PUBLIC EXTRN SlOT BLD:NEAR EXTRN GOT_BLD: NEAR I NCLUDE SEGMENT. SRC CODE SEGMENT BYTE PUBL I C ASSUME ASSUME ASSUME ASSUME 0000 PAGE SYSINITl CS: SS: OS: ES: CODE NOTH I NG NOTH I NG NOTH I NG

0000

PROC --- ----------- -I ----------------------------------------------------TH I S SU LOS THE DESCR! nOR TABLES REQU IRED fOR PROTECTED MODE PROCESSOR MUST BE I N REAL MODE ; ; NO I NTERRUPTS ALLOWED SAVE BP

NEAR

0000 0001 0002 000lJ. 0006 0009

FA 80 81 E6 80 E8 0000 E 8B EF

55

ell PUSH
MOV OUT

CALL
MOV

BP AL,81H MfG_PORT, AL SIOT_BLO BP,OI

; <><><><><><><><><><><><><> ; <><><>CHECKPO I NT 81 <><><>


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) LOAD THE lOT

OOOB OOOE OOOF 0012 0013 0016 0017 0018 0019 0019 001C 0019 0019 00lC 00lC

B8 0800 AB B8 DOAO

MOV

AX, SYS_I OT_LEN


AX, SYS_ lOT- loe
AX,O

STOSW
MOV

AB
B8 0000 AB

STOSW
MOV

26
OF
8B 5E 00

+
+

+ + ?10001 +
?10002

STOSW SEGOV DB LIOT DB LABEL


MOV

LABEL
ORe DB ORG MOV

01
8B FO

ES 026H I BPI OOFH BYTE BX, WORD PTR IBP] BYTE OFFSET CS: ??OOOl OOIH OfFSET CS:??OO02 01, BP

REG I STER fROM TH I S AREA

ES:DI

NOW

--> END OF lOT AGAIN

BUI LD THE GOT.


MOV

DOlE 0021 0024 0026 0029 002A 0020 002 0031 0032 0033 OU34 0034 0037 00311 0034 0037 0037 0039 003A 0038

BF E8 88 68 AO B8 AO B8 AB

D8AO 0000 E EF 0088 D8AO 0000

CALL
MOV MDV

DI,GOT_LOC GDT_BLD BP,OI AX, GOT_LEN AX,GOT_ lOC AX,O


ES 026H [BP J OOfH BYTE OX, WORD PTR [BPI BYTE OFfSET CS: 770004 00lH OFfSET CS: ??OO05 DI,BP

STOSW
MOV

SToSW
MOV

26
OF

STOSW SEGoV DB LGDT

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

88 56 00 01
88 fO
AB AB 8B FD

+ + 770004 + + ??OOO5 +

DB

LAB[L
MOV

LABEL
ORe OB ORe MOV

RESTORE THE ES:OI

POINTER

STOSW STOSW
MOV

01, BP

PAGE SW I TCH TO V I RTUAL MODE POP MOV LMSW DB LABEL 140V LABEL ORG DB ORC JUMPFAR DB OW OW
MDV OUT

0030 003 0041 0042 0042 0044

50
B8 0001

BP

AX, VI RTUAL_ENABLE

OF
8B fO

+ + ??0006 + + ??0007

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 AL,85H MFG_PORT ,AI

RESTORE BP MACHINE STATUS WORD NEEDED TO SW I TCH TO V I RTUAL MODE

0042
0042 0044 0044 0045 0047 0049 0049 0048 0040 004E 004E

01
EA 0049 R 0040

; MUST PURGE PRE-fETCH QUEUE Jump 1';;1 r direct

to th i s offset in this segment

DONE: BO 85 E6 80

e3
SYSINIT1 CODE

RET

DIDP
ENDS

; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 82 <><><><>


SYSTEM INITIALIZATION

END

Sys Init 583

5-84

Sys Init

0000

TITLE GDT_BlD . LI ST ! NCLUDE SEGMENT. SRC CODE SEGf~NT BYTE PUBl I C ASSUME ASSUME ASSUME ASSUME PUBl I C PAGE

09/26/83 BU IlD THE GOT

cs; CODE
SS;NOfHING OS; CODE ES;NOTHING GOT _BLO

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 DESCR DE F OW 0 SEC, 0, 0, 0, 0 Segment limit Segment base address Segment base addre:>:> Access rights byte Reserved

0000 0002 0004 0005 0006

0000 0000

ow
OB OB OW

DO 00
0000

0 0 0
0

low 'Word high byte

THE GOT

ITSELF

0008 OOOA OOOC 0000 OOOE

0088 D8AO

00 93 0000
PACE

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 THE SYSTEM lOT DESCRIPTOR

0010 0012 0014 001';> 0016

0800 DOAO

00 93
0000

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

-;

THE SYSTEM DATA AREA OESCRI PTOR 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 PAGE

0018 001A OOlC

0300
OI~OO

0010
001 E

00 93 0000

CaMPA T I BLE MONOCHROME CRT 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

0020 0022 0024 0025 0026

1000 0000

DB 93
0000

DB

r..:OMPA I I BLEc COLOR CR I 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

0028 002A 002C 0020 002E

11000 8000 DO

93
0000

- -

ENHANCED COLOR CRT -

ONE ENTRY FOR EACH 64K

0030 0032 0034 0035 0036

FFFF 0000

OA 93
0000

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

- -

SECOND PART OF CRT 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 PAGE CODE SEGMENT fOR POST CODE, SYSTEM lOT

0038 003A 003C 0030 003E

FffF 0000

OC 93
0000

00110 0042 0044 0045 0046

FFFF 0000

OF 9B
0000

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 TEMPORARY DESCR I PTORS FOR ES, CS, SS, AND OS

0048 004A oo4c

FFFF 0000

0040 D04E 0050 0052 0054

00 93
0000 fFFf 0000

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

00

0055
0056

93
0000

5-85

DESCR~DEf

0058 a05A DOse 0050 005E 0060 0062 0064 0065 0066 0068 0068 006A 006C 0060 006E 0070 0072 0074 0075 0076 0078 0078 007A 007C 0070 007E 0080 0082 0084 0085 0086 0088

FFFF 0000

00

93
0000 FFFF 0000

OW OW DB DB OW

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

00

93
0000

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

.,

0800

COOO 00
0000 0800 0068 R

00

93
0000

0088

DODO 00
E2 0000

0088 0078 R

00

93
0000

LABEL

WORD

END OF PRE-ALLOCATED GOT 0088 0088 008B 008E 0090 0091 0091 CODE ENDS END MPC ENDS BE 0000 R B9 0044 F3/ A5 MOY MOV REP PROC 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

C3

RET

5-86

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 0000 I NClUOE SEGMENT. SRC CODE SEGMENT BYTE PUBl! C ASSUME ASSUME ASSUME ASSUME 0000 PUBl! C PROC CS:CODE SS: NOTH I NG DS:NOTHING ES: NOTH I NG SlOT BlO NEAR-

BUilD TIlE lOT. THE lOT Will CONTAIN VECTORS FOR EXCEPT I ON HANDLERS 0000 0003 0005 0007 DaDA BE 8C 8E BF 2B 8E 0066 R C8 08 DDAD MOV MOV MOV MOV SUB MOV
MOV MOV MOV MOV

oooe

co co

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. BX, SYS_ROM_CS OH, TRAP_GATE Ol,O 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 256 TOTAL ~ 32 DONE == WHATEVER I S lEFT THERE IS A COPY Of AN UNINITIAllZED INTERRUPT DESCRIPTOR AT fREE_INTS

DaDE 0011 0013 0015 0018 0018 0019 001B OOlC


~OlE

BB 0040 B6 87 B2 00 B9 0020 LOW_lOT;


A5

MOVSW MOV STOSW MOV STOSW MOV STOSW lOOP


MOV MOV

8B C3
AB

AX,BX AX, OX AX,O LOW_lOT CX, 256~32 BP, OffSET FREE_I NTS

8B C2
AB

OOlF 0022 0023 0025

B8 0000
AB

E2 F3 B9 ODED BO OOM R PAGE

0028

002B 002B 0020 002E 002F 0030 0031 8B


A5 A5 A5 AB
F~

HIGH_lOT: MOV MOVSW MOVSW MOVSW STOSW lOOP SI,BP 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

E2 Fa

HIGH_lOT

INITIALIZE THE ENTRY POINTS fOR POST TEST 0033 003A 0041 0048 OOLiF 0056 0050 0064 26: C7 06 D1AO 0000 E 26: C7 06 D1A8 0000 E 26: C7 06 01S0 0000 E 26: C7 06 01B8 0000 E 26: C7 06 OlCO 0000 E 26: C7 06 01C8 0000 E 26: C7 06 0100 0000 E
C3

MOV MOV MOV MOV MOV MOV MOV


RET

WORD PTR ES: (SYS_I DT_LOC+( 032*DESC_LEN). ENTRY_POI NT) ,OffSET SYS_32 WORD PTR ES:(SYS_loT_LOC+(033*OESC_LEN).ENTRY_POINT),OFFSET SYS_33 WORD PTR ES: (SYS_I DT_LOC+(034*OESC_LEN). ENTRY_POINTI,OffSET SYS_34 WORD PTR ES: (SYS_I DT_LOC+( D35*OESC_LEN). ENTRY_POI NTI,OFFSET SYS_35 WORD PTR ES: (SVS_I oT_LOC+(036*DESC_LEN I. ENTRY_POI NT) ,OFFSET SYS_36 WORD PTR
ES:(SVS_IDT_LOC+(037*OESC~LEN).ENTRY_POINT),OFFSET

SYS_37

WORD PTR ES: (SYS_I DT_LOC+(03a*DESC_lEN). ENTRY_POI NT) ,OFFSET SYS_38

PAGE 0065 0065


CF

I RET_ADDR

LABEL I RET

WORD

fOR UNINITIALIZEO INTERRUPTS

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

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

1~I~mm~

~~g:=~~; ~~:=

SIDT~LD

5-87

EXTRN EXTRN EXTRN l:.XfRN EXTRN EXTRN EXTRN [XTRN EXTRN EXTRN EXTRN PAGE

EXC 28:NEAR EXC=29: NEAR EXC_30:NEAR EXC_31:NEAR SYS 32:NfAR SYS-33: NEAR SYS-34;NEAR SYS=35: NEAR SYS_36; NEAR SYS_37:NEAR SVS_38: NEAR

Entry points f'or the first. 32 system interrupts


0066 0066 0068 006A 006C 006[ 0070 0072 0074 0076 0078 007A 007C 007E 0080 0082 0084 0086 0088 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 [ [ [ [ [ E DW OW OW OW OW 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 LA8EL 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 WORD I NTERRUPTS AS DEF I NED EXCPT EXePT EXCPT EXePT EXePT EXCPT EXCPT ExePT EXCPT EXCPT EXePT EXe?T EXC?T EXePT 00 01 02 03 04 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

ow ow

E
E E
E E E

OW OW OW OW OW OW OW OW OW DW OW OW DW OW OW OW OW OW OW OW

05 06 07 -

08 09 -

l' '2 13 -

10 -

OOM
008C 008E 0090 0092 0094 0096 0098 009A 009C 009E OOAO 00A2 00A4

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

ExePT 16 -

OW OW OW OW OW
PAGE FORMAT

INTERRUPT DESCRIPTORS (GATES) 32

255

OOA6 OOAa OOAA OOAC OOAC

0065 R 0040 00 86

~REE

I NTS

OW OW DB [NDP ENDS

OFFSET I RET ADDR SYS_ROM_CS O,INT_GATE

DESTINATION OFFSET DEST I NAT ION SEGMENT UNUSED BYTE, ACCESS RIGHTS BYTE

END

5-88

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) (AH)=2 (AH )=3 (AH )=4 (AH)=5 ADDRESS OF BUFFER ( REQUIRED FOR VERifY)

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 RESERVED 000: 001: 002OOit; 005: 36011. 360K


1.2r~

--PRESENT STATE IN 36011. DRIVE UNESTA8LISHEO IN 1.2M DRIVE UNESTABLISHED IN 1. 2M DRIVE UNESTABLISHED IN 1.2M DRIVE ESTABLISHED IN 102M DRIVE ESTABLISHED

003~ 360K IN 360K DRIVE ESTABLISHED


36011. 1.2M

------>
--------------;>

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{VO 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)

0000 0000 0001 0002 0003 0004 0005 0006 0007 0008 OOOA 0000 OOOF 0012 0014 0017 0019 001 E 0021 0023 002 11 0027 0028 002A 0020 002F 0034 0036 0039 003B 003E 00 110
001~2

FB 53 51 1E 56 57 55 52 8B 8E 8E 80 76

EC
---R

DE Fe 01 OF

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
CMP

BO FA 01 76 OA C6 06 0041 R 01 BE 0000 EB 49
50 1:.8 OlOe R 5E 88 06 80 FE 01 76 30

JBE R5:
Mav Mav JMP

DL,l R4

CHECK DRIVE NUMBEH fOR VALIDITY I F VAll 0 CO NT I NUE

DISKETTE_STATUS,BAO_CMD; INVALID DRIVE ADDRESS, TERMINATE 51,0 INSURE THAT RETURN STATUS GETS SETUP SHORT OK GO TERM I NATE COMMAND AX J1
51

PUSH CALL POP MOV CMP JBE TEST JZ CMP JAE

OX,SI OH,1 OK HF_CNTRL,OUAL


OK

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 GO DETERMINE TYPE OF CONTROLLER CARD DISKETTE ATTACH CAR.D READ DISK CHANGE STATUS OR DISK TYPE COMMAND I F YES, BYPASS STATE PROCESS I NG RESTORE DR IVE PARAMETER ;ETUP ADDRESS 10 MEDIA STATE FOR THIS DRIVE

f6 06 008F R 01
74 36 80 FE 15 73 31
BB 32 8A 8A OA 75

DH,15H
OK

0046 0048 OOIIA 004E 0051 0053 0055 0058 0058 OOJE 0060 0063 0067 006C OOGf 0071 00-(5 0079 007A 0070 D07F 0081 0082
0081~

56 00 FF DA 26 0041 E4 4C

Mav
XOH
Mav

ox, [O? I
~~:~~

Mav
OR JNZ MOV TEST JNl MOV ANO AOO AND
OK

AH,DISKETTE_srATUS ; GET STATUS OF OPERATION AH, AH ; SEE I f ANY ERRORS RETRY ; JUMP TO CHECK FOR MEDI A CHANGE AH,OSK_SfATE[BX] AIi,DETERMINED OK2 ;
GET MEDIA STATE Of DRIVE SEE IF MEDIA STATE SET ALREADY I F SET, DONT CHANGE STATE

8A A7 0090 R F6 C4 10 75 14 8A 80 80 80 OA 80 88 C6 BB 813 50 E8 88 58 80 CC [1 C1 E4 El CC 07 03 F8

10 0090 R 87 0092 R 00 0004 06 0382 R 26 0040 R


CF 15

OR
Mav

OK2: OK:

0072

MOV MOV MOV PUSH CALL MOV


POP CMP

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
AX

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 PUT RFSULT IN AH SET SUCCESSFUL OPERATION GO LEAVE

IN

75 05
86 EO F8 E8 08 8A 26 0041 80 FC 01 F5 5A 50 5F
R

IN[ XCHG CLC


JMP

DfI,015H R20 AH,AL SHORT R19

R20: R19:

MOV
eMP eMe

0088

008B 008e
0080 008E 008r 0090 0091 0092 0093 0096 0098
OOYD OOAl 00A4 OOA7

POP
POP

5[
59
58

POP POP
POP

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

F CA 0002 80 3E 0041 74 54 8A 80 80 73

POP POP RET

ex
BX 2 ; ; RECOVER ADDRESS THROW AWAY SAVED FLAGS

os

R 06

RETRY:

CMP JE MOV AND CMP JAE

DISKETTE_STATUS,MEDIA_CHANGE ; CHECK FOR DISK CHANGE ERROR OK1 ; TRUE ERROR DONT RETRY 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 1 & 2 TRY NEXT STATE SEE If OVERFLOW IN NON-ESTABLISHED STATES SKIP RESET TO BEGINNING IF YES

A7 0090 R E4 07 Fe 03

BE

; ------ HANDLE STATES 0, OOA9 OOAB OOAE OOBO 00B2 00B6 00B9 FE C4 80 FC 03 75 02
84 8A 80 3A 00 AF 0092 R E5 07 EC

INC
eMP

AH

JNE

AH,3 R2

R2:

MOV t40V AND


eMP

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

5-90

Diskette

OOBB

74 47

JE

OK3

I F YES, THEN TRUE ERROR

;------ SETUP STATE INDICATOR fOR RETRY ATTEMPT OOBO

OOCl
00C3

8A AF 0090 R 00 C5 00 C5

ooce

OOC~

80 E5 03

MOV ROL ROL AND


DEC

CH, OSK_STATE[ BX] ; GET STATE I NOI CATOR CH.l ; MOVE TRANSFER RATE TO LOW ORDER BITS iRAN_MSK CH CH,OFFH R3 CH, XRATE CH,l CH,l

OOCA

OOCO OOCF
0001 0003 0005 0008 OODA 0000 OODF

FE CD 80 FD FF 75 02 02 CD CD R3:

g~;

eMP JNE MOV ROR ROR eMP JNE

SOLATE TRANSFER RATE BITS ; CONVERT TO NEXT RATE , SEE IF OVERFLOW OCCURRED ; JUMP I F NO OVERFLOW SET TO NEXT RATE :UT TRANSfER BI TS BACK WHERE THEY BELONG SEE IF TH I S STATE REQU I RES DOU8LE STEP I F NOT, BYPASS SETT I NG DOUBLE STEP

i7

B5 DO DO 80 75

FC 01
03 R9:

AH,l
R9

BO CD 20
OA E5 BB A 7 0090 R

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

MOV MOV MOV MOV JMP OK1 : MOV CALL JNZ JMP MOV JMP

DX 1 [BPj CX,[BP+l0l BX, [BP+121 AX, SI R4 OX, [BPj READ_DSKCHNG OK4


OK2

:ESTORE PARAMETERS fROM STACK

GO RETRY OPERATION 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 INDICATE TIMEOUT IF DRIVE EMPTY ERROR PUT STATE AT POWER ON ASSUHPT ION

oon OOF4 oon


00F9 OOFC 0101 0104 0109 OlOC

6B 56 00 E8 0604 R 75 03 E9 0067 R C6 06 0041 R 80 E9 0061 R C6 87 0090 R 80 E9 0067

DISKETTE_STATUS,TlMeOUT; OK2 DSK_STATEr BXl, POA_START ; OK2 ENOP

OK3:

MOV JHP

DISKETTE_IO_'

; ------ DETERM I NE NEW MED I A TYPE, NEED TO RESET 0 I 5K CHANGE II NE HERE OlOC

OlOC
OlOF 0111 01'6 0118 0118 0110 011E 011 F 0120 0121 0124 0126 0129

BO FC 01
76 76 F6 06 008F R 01

PROC eMP JBE TEST JZ

NEAR AH,1 J1E HF _CNTRL. DUAL J1A AH.15H J1E

TEST FOR RESET AND STATUS OPERATION BYPASS STATE CHECK AND UPDATE GO DETERM I NE TYPE OF CONTROLLER CARD 01 SKETTE ATTACH CARD TEST FOR 01 SK CHANGE STATUS OR 01 SK TYPE BYPASS STATE CHECK AND UPDATE

74 11
80 FC 15 13 6A 50 53 51 52

eMP JAE
PUSH PUSH PUSH PUSH CALL JZ JMP PUSH PUSH PUSH PUSH CALL JMP

AX

[8 0604 R 74 DC
E9 05E2 R 50 53

READ_DSKCHNG J1I

ex ox

BX

SAVE ORIGINAL PARAMETERS !AVE PARAMETERS GO READ DISK CHANGE LINE STATE BYPASS HANDLING DISK CHANGE LINE HANDLE 0 I SK CHANGE LI NE ACT I VE

Jlf
AX
BX

Ol2A
0128 012C 0120 0130 0132 0136 0138 013A 013C 0140 0142

51
52 E6 0604 R EB 51 BA 67 0090 R OA CO 75 06 BO 60 86 67 0090 R 3C 61 75 1E BS 4E OA

OX READ_DSKCHNG SHORT J1H

ex

SAVE OR I G I NAL PARAMETERS ;AVE PARAMETERS SELECT DRIVE FOR DISKETTE ATTACH CARD IGNORE DISK CHANGE STATUS

MOV OR JNZ MOV MOV


eMP JNE

AL,DSK_STATE[BX] ; GET MEDIA STATE INFORMATION FOR DRIVE AL,AL CHECK FOR NO STATE INFORMATION AT ALL J10 IF INFORMATION DONT DEFAULT AL. POA_START ; GET DEFAULT TO STATE DSK_STATE[ BXl.AL ; SET UP DEFAULT TO STATE 1 AL, POA_DUAL J1G CX, [BP+l0} CH.40 J1G SEE I F DOUBLE STEP RATE BYPASS TRACK CHECK GET ORIGINAL TRACK PARAMETER SEE I F TRACK IS PAST END OF 0 I SKETTE( 320) GO TRY OPERATION AT THIS STATE IF NOT

0144
0147 014A 014C

60 FO 26

72 16
C6 87 0090 R 02 BO 02 BA B7 0092 R OA F6 75 13

MOV eMP JB MOV MOV MOV OR JNZ MOV JMP MOV OR JHZ
J1C:

0151
0153 0157

0159
015B 0160 0162 0166 0166 Ol6A

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 DSK_STATE[BX+2], POA_DUAL ; SETUP STARTING STATE SHORT J1C ; BYPASS NEXT STEP ALREADY DONE DL.DSK_STATE[BX+2] ; GET START MEDIA STATE DL.DL SEE IF THIS IS ORIGINAL OPERATION OR A RETRY J1C IF RETRY IGNORE 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 LASTRATE,AL AL.1
~OVE

C6 67 0092 R 61
ES OC 6A 97 0092 R OA 02 75 04

88 87 0092 R
8A DE 008B R 3A C1 74 00 A2 008B R DO CO DO CO 24 03 BA 03F7 EE SA

Ol6E
0172 0174 0176 0179 0178 0170 017F 0162 0183 0184 0185 0186 0167 0189 OlSE 0190 0192 0194 0196 0196 0190 019F OlAl 01A3

MOV MOV eMP JE MOV ROL ROL AND HOV


OUT

SAVE NEW TRANSFER RATE FOR NEXT CHECK TRANSFER RATE DATA TO LOW BITS

AL,l
AL, TRAN_MSK OX,03F7H DX,AL ; ; CLEAR ALL BITS BUT DATA TRANSFER RATE BITS ADDRESS FLOPPY CONTROL REG I STER SET DATA TRANSFER RATE ~ESTORE PARAMETERS

J1H:

59 56 56
8A 80 OA 74 Fa 26 003F R 7F E4 36 CC 76 06 oOln R 00 CC 6E

J1E:

FE

74 C6 FE 14 FE CC 15 03 E9 0240 R

POP POP POP POP MOV AND OR JZ OEe JZ MOV


DEC

ox ex
AX

BX

DH,AL SAVE # SECTORS IN DH MOTOR_STATUS,07FH ; INDICATE A READ OPERATION AH,AH ; AH::O DISK RESET AH ; AH=l AH DISK READ AH -

g:~~E~~~~~~ATUS,O

RESET THE STATUS INDICATOR

; AH=2 ; AH=3 ; TEST_oISK_VERF

JZ
DEC

JHZ JMP

J2
DISK_WRITE

Diskette 5-91

01A6 01A6 01A8 DIM 01AC 01AE 0161 0163 01B6 01B8 alBA 0160 OlBF OlCl 01C4 01C9 01CA

J2: rE 74 FE 74 80 7S CC 6c CC 6C EC 10 03

Dec
JZ
DEC

JZ
SUO

AH DISK_VERF AH DISK rORMAT AH,10H

TEST_DISK_VERF AH"'4 AH=5 AH=15H BYPASS 01 SK TYPE OPERATION GO PERFORM OISI( TYPE OPERATION AH = 16H BYPASS 0 I SK CHANGE STATUS GO CHECK DISK CHANGE LINE STATUS AH = 17H BAD COMMAND GO SET MED I A/OR I VE TYPE FOR FORMAT ; ; ERROR CODE, NO SECTORS TRANSfERRED UNDEr I NED OPERAT I ON

JNZ
JMP

J3
01 SK_ TYPE
AH

E9 0698 R FE CC 75 03 E9 0646 R FE CC 7S 03 E9 0700 R c6 06 0041


C3

J3:

DEC

JNZ
JMP DEC

J4
DISK_CHANGE

JNZ
JMP

J'
FORMAT_SET

AH

R 01

MOV

U I SKIc II E_STATUS, BAO_CMO

RET Jl
ENoP

;------ RESET THE DISKETTE SYSTEM OlCA 01CA 01CD aleE 0101 0103 0105 0107 0109 010A 010F 01E6 01 E8 01 E9 01 EA OlEO OlfO Olf2 Olf" 01F9 DISK_RESET BA FA AO 24 Bl 02 OC EE C6 C6 EB OC EE FB 8 AD 3C 74 80
C3

03F2 003F R 3F 04 CO 08 U6 003E R 00 06 0041 R 00 00 04 051A R 0042 R CO 06 DE 0041 R 20

MOV

CLI
MOV AND MOV

ROL OR
OUT MOV MOV JMP OR OUT

OlE"

STI
CALL
MOV CMP

JZ

OR

RET

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

PROC NEAR DX,03F2H

; ------ SEND SPEC I FY COMMAND TO NEC OlfA OlfA OlfC 01 FF 0202 0205 0208 020B 020C J7: 64 E8 BB E8 BB 8
C3

03 03E2 R 0001 0382 R 0003 0382 R

MOV CALL MOV CALL MOV CALL

AH,03H NEC_OUTPUT BX,l GET PARM BX,"3 GET _PARM ENOP

RET
DISK_RESET ;------ DISKETTE STATUS ROUTINE

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

020C 020C 0200

C3

DISK STATUS RET DISK_STATUS

PRoe ENOP

NEAR

; ------ DISKETTE READ 0200 0200 020F 020f 0212 0214 0216 BO 46 J9: E8 04CA R 84 E6 EB 36 CALL
MOV JMP

PRoe NEAR AL,046H 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

DISK_READ

;------ DISKETTE VERifY 0216 0216 0218 021A D I SK_VERf

BO

1~2

EB F5

MOV JMP

PRoe NEAR AL,042H

J9
ENOP

VER I FY COMMAND FOR DMA DO AS IF olSI( READ

DISK_VERF

; ------ DISKETTE fORMAT 021A 021A 021F 0221 0224 0226 0228 0228 022B 022E 0231 0234 0237 023A 0230 0240 DISK FORMAT 80 BO EB B4 EB DE 003F R 80 4A 04CA R 40 24 Jl0: BB 0007 E8 0382 R BB 0009 8 03B2 R B6 OOOF [8 0382 R BB ~Oll E9 032A R
MOV

OR

MOV

CALL
MOV JMP

PROC NEAR MOTOR_STATUS, WRI TE_OP AL,04AH OMA SETUP AH, 04DH SHORT RW_OPN BX,7
Glcl PARM BX, '9 GET PARM

CALL
MOV

CALL
MOV

ax,15
ENOP

CALL
MOV JMP

GET PARM

ax,17
J16

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

DISK_fORMAT

; ------ 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 73 08 C6 06 0041 R 09 BO 00
C3

. - --- ------------------------------R~COPN
J NC MOV MOV RET

----

THIS ROUTINE PERfORMS THE READ/WRITE/VERIFY OPERATION

kW~OPN --P~OC--

--N E;'~------- -------------

Jll: PUSH

50

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 0265 026A 026F

51 8A BO 02 FA 8 11 74

CA 01 EO 06 003F R DC

PUSH MOV MOV


SAL

CX Cl,Dl Al,l Al,Cl Al, MOTOR_STATUS

Cli
TEST JZ
CMP

R13
MOTOR_COUNT, aECH MOTOR_COUNT,OFFH J14

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 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 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 RECOVER REG I STERS

80 3E 0040 R EC C6 06 0040 R FF 72 42

MOV JB

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
EE

06 003F R 04 26 003F R CF C2 16 003F R CA 003F R 3F CO DC 03F2

R13:

OR MOV AND ROl DR ROR


STI

MOTOR_STATUS,AL Cl,4 MOTOR_STATUS, OCFH Dl,Cl MOTOR_STATUS,DL DL,Cl Al, MOTOR_ STATUS Al,03FH Al,CL Al,OCH DX OX, 03F2H DX,AL DX

MOV AND ROl OR PUSH MOV


OUT POP

SA

; ------ WAI T FOR MOTOR 0294 0295 0298 029A 029C 029F 02A2 02A4 02A4 02A6 02A8 O?AA 02AD 02Af 02B1 02B3 02B3 02B4 F8 B8 90FD CD 15 72 17 B8 0014 E8 0362 R OA E4 J12: 74 00 28 C9 E2 FE 89 6006 E2 FE FE CC 75 F1 J14: FB 59
STI
POP Cle

MOV
INT JC

AX,090FDH

Jl'
aX,20 GET_PARM AH.AH

',H

CLEAR TIMEOUT INDICATOR LOAD WAIT CODE & TYPE PERFORM OTHER FUNCT I ON BYPASS liMING LOOP If IIM.l:.OUI O(;CUKKt.D 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

MOV CALL OR
JZ
SUB

J13: R18:

LOOP

J14 CX,CX J13


CX.06006H R18 AH J12

MOV LOOP
DEC JNZ

DECREMENT T I ME VALUE ARE WE DONE YET MOTOR RUN:-i j NG INTERRUPTS BACK ON FOR BYPASS WAIT

ex

;------ 00 THE SEEK OPERATION 02B5 02B8 02B9 02BB 02BO 02BF 02C2 E8 58 8A B6 72 BE 56 041C R FC 00 72 0331 R CALL POP MOV MOV JC MOV PUSH 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 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 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 02050 0208 020A 0200 020F 02E2 02E5 02E8 02EA 02EO 02FO 02F3 02F6 02F9 02FC 02FE 0302 0305 0307 030A 0300 0310 0313 0315 0317 0319 031C 031E 0320 0322 0324 0327 032A 032A 0320 80 f f 40 75 03 E9 0228 R SA E8 8A E8 8A E8 BB E8 aa E8 88 32 8A F6 14 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 J15:
CMP

BH.04DH

JNE
JMP

Jl,
JlO

IS THIS A fORMAT OPERATION NO. cornlNuE WITH R/W/V I F SO, HANDLE SPECIAL

MOV CALL MOV CALL MOV CALL MOV CALL MOV CALL MOV XOR MOV TEST JZ ANO
SUB

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 AH, 07H AH,03H AB,07H AH,O R16 AH,O?AH SHORT R15 AH,l R17 AH.023H SHORT R15 AH,OlBH NEC_OUTPUT BX,13 GET PARM SI STRIP OFF HIGH BITS REDUCE STATES STRIP OFF HIGH BITS CHECK FOR DISKETTE ATTACH CARD OR 320 DRIVE I F NOT CHECK FOR NEXT STATE I DAD 3::>0/360 OR 1VF GAP I fNGTH GO ounUT 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 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

80 E4 07 80 EC 03 60 E4 07 80 Fe 00 75 04 B4 2A EB DB 80 FC 01 75 04 B4 23 EB 02 B4 1S E8 03E2 R SS 0000 E8 0382 R 5E DO:

ANO
eMP

JNE ,.IOV
JMP

R16:

CMP

JNE

MOV
JMP

R17:
R15:

MOV CALL MOV CALL POP

J16:

; ------ LET THE OpERAT I ON HAPPEN 032E 0331 0331 E8 053B R J17: 72 45 JC J21 GALL WAIT_INT WAIT FOR THE INTERRUPT MOTOR OFF LOOK FOR ERROR

Diskette 5-93

0333 0336

E8 0580 R 72 3F

CALL Je

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 CLD MOV LODS AND JZ GMP JNZ ; 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 FIND OUT WHY GET Sil TEST FOR EOT fOUND 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

0042 R CO 3B 40 29

; ______ ABNORMAL TERMINATION,

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

LODS SAL MOV JC SAL SAL MOV JC SAL MOV JC SAL SAL MOV JC SAL MOV JC SAL MOV JC

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

; ------ NEC MUST HAVE fAI LED 036E 036E 0370 0370 0374 0377 0377 0378 0378 037B J18: 84 20 J19: 08 26 0041 8 05e8 R C3 J21 : E8 0580 R C3 CALL RET RESULTS R J20: RET OR CALL DISKETTE_STATUS. AH NUM_TRANS ; MOV RW-NEC-FAI L RW-FAI L HOW MANY WERE REALLY TRANSFERRED RW ERR RETURN TO CALLER 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

0382 0382 0383 0384 0386 0368 038C 038E 0390 0391 0392 0393 0396 0398 0390 039F 03A2 03A4 03A6 03A8 03AB 03AD 03AF 03B1 03B4 03B6 0368 03BO 03BF 03C1 03C2 03C3 03C6 03C8 03GA 03CC 0300 0301 0302 0304 0306 0308

GET
1E 56 28 CO 8E 08 C5 36 0078 R D1 EB 8A 20 5E 1F 9C 83 FB OA 75 19 F6 06 003F R 80 7 11 09 80 Fe 08 73 3A 811 08 EB 36 80 FC 05 73 31 84 05 EB 20 83 FB 09 75 28

----PARM ---- ---- ------ - -- - - - --- - -- - - -------- - -PROC NEAR


PUSH PUSH SUB MOV ASSUME LOS SHR I<lOV POP POP PUSHF ASSUME CMP JNE TEST OS SI AX,AX os, AX OS:ABSO SI,DISK POINTER BX,lAH,!SI+BX]

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 SAVE SEGMENT SAVE ZERO TO AX PO I NT TO BLOCK DIVIDE BX BY 2, AND SET FLAG FOR EXIT GET THE WORD RESTORE RESTORE SEGMENT SAVE RESULTS FOR EX I T LOOK FOR MOTOR STARTUP DELAY PARM 8YPASS I F NOT PARM LOOK I NG FOR IS THIS A WRITE NO, ENFORCE MINIMUM READ WAIT SEE IF AT LEAST A SECOND IS SPECIFIED IF YES, CONTINUE FORCE A SECOND WAIT FOR MOTOR START CONTINUE SEE I F A 625 MS WA IT ON READ I f THERE GO CONT I NUE ENFORCE A 625 MS WAIT CONT I NUE IS TH I S HEAD SETTLE PARM BYPASS I F NOT HEAD SETTLE SEE IF A WRITE OPERATION I F NOT. DONT ENFORCE ANY VALUES CHECK FOR ANY WA I T? I f THERE DONT ENfORCE SAVE REG I STER SAVE REG I STER GET ORIGINAL DRIVE REQUESTED UP ADDRESSING TO STATE INDICATOR

SI OS
OS:DATA BX,tO GPO MOTOR_STATUS,WRI TE_OP GP1 AH,8 GP2 AH,8 SHORT GP2 AH,5 GP2 AH,5 SHORT GP2 BX,9 GP2 MOTOR_STATUS, WR I TE_OP GP2 AH,AH GP2 OX BX ox, rBP] BH,BH BL,OL AH, HD12_SETTLE AL, OSK_STA TEl BX 1 BX OX AL, STATE_MSK ep4 AH, HD320_SETTLE SHORT GP2

.JZ
CMP JAE MOV JMP eMP JAE MOV JMP

GPO:

eMP JNE TEST JZ OR JNZ PUSH PUSH MOV XOR MOV MOV MOV pOP POP ANO JNZ MOV JMP

F6 06 003F R 80
74 21 OA E4 75 10 52 53 86 32 8A B4 8A 5B 5A 24 75

56 00 FF DA OF 87 0090 R 07 04

;ET

SPEC' ED HEAD SETTLE TI ME FOR 1 2 DR I VE GET MEDIA/DRIVE STATE RESTORE RESTORE I SOLATE STATE NUMBER BRANCH I f STATES 1 THRU 5 SPEC' ED HEAD SETTLE T I ME FOR 320 DR I VE GO TO WAIT LOOP

B4 14 EB 04

5-94

Diskette

030A 030C 03DE 03DF 03E1 03E2

3C 03 14 F8

J'
GP2:
GEl PARM

eMP

AL,3 GP3

SE[ IF STATE 3(320 DRIVE/320 MEDIA) CO REESTABLISH WAIT TIME RESTOR[ EXIT RESULTS I F FLAG SET, OUTPUT TO CONTROLLER RETURN TO CALLER

9D
7'2 01 e3

popr
JC RET ENDP

03[2 03E2 033 03EI. 03E5 03E8 03EA 03EC 03E.C 03D 03EF D3F1 03F3 03F5 03F1 03F7 03FC 03FD 03FE

;2
51

"

BA 03F4 B3 02 33 c9

EC
A8 40 7" 11 C2 F9 FE CB 75 F3

NEC_OUTPUT PUSH PUSH PUSH MOV MOV Rl1: XOR J23 : IN TEST JZ LOOP DEC JNZ j24: OR POP POP POP POP

-- --- - -- -- - - -- --- -- ------ - - ---- - - -------- ----- - -NEAR PROC


ex
OX SAVE REG I STERS BX OX,03F4H BL,2 CX,CX AL, OX AL,040H [\12 J23 BL

NEC OUTPUT TH I S ROUT I NE SENDS A BYTE TO THE NEC CONTROLLE.R AFTeR TESTING FOR CORRECT DIRECTION AND CONTROLLER READY THIS HOUTINE WilL TIME OUT IF THE BYTE IS NOT ACCEPTED WITHIN A REASONABLE AMOUNT Of TIME, SETTING THE DISKETTE STATUS ON COMPLET I ON INPUT (AH) BYTE TO BE OUT PUT OUTPUT CY = 0 SUCCESS CY", 1 FAIIURf_ -- DISkETTE:. STATUS UPDAHD IF A FAILURE HAS OCCURRED, THE RETURN IS MADE ONE LEVEL H ICIlER THAN THE CALLER OF NEC OUTPUT 1H I S REMOVES THE REQU I REMENT OF TEST I NG AFTER EVERY CALL Of NEC OUTPUT (Al) DESTROYED-

STATUS PORT Ii I Crt ORDER COUNTH COUNT FOR T I ME OUT

GET

STATUS TEST DIRECTION BIT

01 REeT I ON OK
DECREMENT COUNTER REPEAT TIL DELAY F!NISHED

ell

;8

80 OE 0041 R 80
59 5A 58 C9 C3

TIME ~[RROR DISKETTE _STATUS, TIME_OUT RESTORE REG I STfRS BX

ex

03FF
01100 01101 0402 011011 01 104 0406 0 1106 0407 0409 040B 040D 040F

OX AX BL,2 CX,CX AL,DX AL,080H J27 J26

STr:
Rl'?:
J2~:

SET [fmOR COOF ANn RFSTORF RfGS DISCARD THE RETURN ADDRESS INUIGAII:. I:.KKUK TO CALLER HIGH ORDER COUNT RESET THE COUNT

83 02 33 C9

RET MOV XOR

J26:

EC
A8 80 75 OB E2 F9

IN TEST JNZ LOOP DEC JNZ JMP J27: MOV MOV MOV OUT POP POP POP

GET THE STATUS IS IT READY YES, GO OUTPUT


COUNT DOWN AND TRY AGA IN DECREMENT COUNTER REPEAT TIL DELAY FIN I SHED ERROR COND I T I ON OUTPUT GET BYTE TO DUl PUT DATA PORT OU1PUT THE BYTE RECOVER REG ISTERS RECOVER REG I STERS CY '" 0 FROM TEST I NSTRUCT I ON

FE CB
15 F3 EO E4 8A C4
[\2

Dl.
J25 J24 AL,AH DX,03F5H DL,OF5H OX,AL

01 111 01113 0413


0111':>
Ol~

F5

11

EE

0418 0 1119 OlllA 041B 041C

,D

59
5A C3 SEEK

ex
OX ENOP

BX

RET

N!:.C_OUTPUT

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 01 124 0428 042A 01.2E DISKET1E STATUS SET ACCORDINGLY [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

SEEK

80 01 51 8A CA D2 CO 59 84 06 003E R 15 37
08 06 003( R E8 8A E8 E8 73

PROC tolOV PUSH MOV ROL POP TEST JNZ OR MOY CALL MOV CALL CALL
J~lC

ex

NEAR AL,l

CL, DL AL,CL

ex

AL, SEEK_STATlIS J28 SEEK_STATUS, AL AH,07H NEC OUTPUT AH, ill NEC OUTPUT CHK-STAT 2 J28A -

0430
0433 0435 0438 043B

D',

07
03E2 R
[2

032 R 051A R 14

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
032 R 051A R

72 78
F6 06 008F R 01

MOY MOV CALL MOy CALL CALL JC

DISKETTE_STATUS,O AH,01H NEC OUTPUT AH,DL NEC OUTPUT Ci-UCSTAT 2 RB -

; CLEAR OUT INYALID STATUS RECALIBRATE COMMAND OUTPUT THE DR lYE Jl:UMBER GET THE I NTERUPT ArlO SENSE SEEK_ERROR

I NT STATUS

74 09
FF 8A DA C6 87 0094 R 00 32

TEST JZ XOR MOY MOV DRIVE IS

H~

CNTRL, DUAL

Ji8
BH, BH
BL,DL DSK_1RKIBX),O

GO DETERMINE TYPE OF CONTROLLER CARD DISKETTE ATTACH CARD

;ET

UP ADDRESSING TO STATE

INDICATOR

SAVE NEW CYL I NDER AS PRESENT POS I T I ON SEEK TO TRACK

IN SYNCH WITH CONTROLLER,

0461

J28:

Diskette

5-95

01161 0"63 01 165 046A 046C 0471 0473 0475 0475 0479 0476 Oll7f 04B1 01lB4 0486 0489 0486 04BE 0491 0496 DII9B 0490 049F 04Al

32 8A f6 74

FF DA 06 D08f R 01 09

XOR MOV

TEST
JZ

BH. BH BL.DL H f _CNTRL. DUAL


R7 R7

~ET

UP ADDRESSING TO STATE INDICATOR

GO DETERMI NE TYPE OF CONTROLLER CARD DISKETTE ATTACH CARD

F6 87 0090 R 20 74 02 DO E5 R7: 3A Af 0094 R 74 3E 88 B4 EB BA 8 8A EB E8 f6 74 AF 0094 R OF 032 R E2 032 R E5 032 R 051A R 06 DOBf R 01 09

TEST
JZ SHL GMP JE MOV MOY

DSK_STATE[ ex]. DOUBLE_STEP ; CHECK FOR DOUBLE STEP REQUIRED ; SINGLE STEP REQU I RED BYPASS DOUBLE DOUBLE NUMBER OF STEP TO TAKE SEEK I F ALREADY AT THE DESI RED TRACK I F YES. DONT NEED TO SEEK 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

CH.1 CH. DSK_ TRK[ SX]


J32

OSK_TRK[ 6xl. CH AH,OfH


NEC~OUTPUT

CALL
MOY

CALL
MOV

CALL CALL TEST


JZ

AH.DL NEC_OUTPUT AH.CH NEC_OUTPUT CHK_STAT_2 HF_CNTRL. DUAL


RA

F6 87 0090 R 20 74 02 DO ED RA:

TEST
JZ SHR

DSK_STATElBXI.DOUBLE_STEP; CHECK FOR DOUBLE STEP REQUIRED RA ; 51 NGLE STEP REQU I RED BYPASS DOUBLE CH. ,

; SET BACK TO LOG I CAL SECTOR

; ----- WAIT FOR HEAD SETTLE 04A1 04A2 0',A5 04AB 04A9 04A9 04AC 04AE OliBO 04B2 04B4 04B6 04B6 04B7 04BB 04B9 04B9 04BE 04Cu 04C5 04C7 04C9 04C9 04CA
9C

PUSHF
MOY

BB 0012 E8 0382 R

51
B9 0320

CALL PUSH J29:


MOV OR JZ

BX.18 GET_PARM
GX

SAVE STATUS FLAGS ~ET HEAD SETTLE PARAMETER SAVE REG I STER HEAD_SETTLE 1 MS LOOP TEST FOR TIME EXPIRED DELAY FOR 1 MS OECREMENT THE COUNT 00 I T SOME MORE RECOVER STATE RETURN TO CALLER

OA E4
74 E2 FE EB
59 90 G3

CX.BOO AH,AH
J31 J30 AH J29 GX

06 FE CC F3

J30: J31 :

LOOP
OEC JMP POP

POPF
RET

j32: F6 06 008F R 01 74 09 f6 87 0090 R 20 74 02 DO ED RB:


C3 RET

TEST
JZ

HF_CNTRL. DUAL
RB RB

SEEK_ERROR GO DETERMI NE TYPE OF CONTROLLER CARD DISKETTE ATTACH CARD

TEST
JZ SHR

OSK_STATE[BX].OOU8LE_STEP ; CHECK FOR DOUBLE STEP REQUIRED ; 51 NGLE 5TEP REQU I RED BYPASS DOUBLE ; SET BACK TO LOG I CAL SECTOR ; RETIJRN TO CAU fR

CH# 1

SEEK ;

-------------- ---- ----- ----------------------------ENOP

DMA_SE~~fs
INPUT

ROUTINE SETS UP THE oMA FOR READ/WRITE/VERIFY OPERAT IONS. (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 042 OllE3 OllE5 04E7 04E9 04E8 04ED 04EF 04F1

51
FA E6 OC (8 00 E6 DB BC CO 81 04 03 CO 8A 8 24 FO 03 C3 73 02 FE C5

OMA SETUP PUSH


GLI OUT JMP OUT MOY MOY ROL MOY

.------------------------------------ --- --- --- ------PROC NEAR


DESTROYED CX OMA+12.AL
$+2

OUTPUT

{AX 1

ANO AOO
JNG

DMA+11.AL AX.ES CL.4 AX.CL CH,AL AL.OFOH AX.

ex

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 CARRY MEANS HIGH 4 BITS MUST BE INC SAVE START ADDRESS OUTPUT LOW ADDRESS WAIT FOR 10 OUTPUT HIGH ADDRESS GET HIGH 4 BITS I/O WAIT STATE OUTPUT THE HIGH 4 BITS TO PAGE REGISTER

ING

J33 GH AX

>U

J33: PUSH
OUT JMP MOY OUT MOY JMP

E6 EB 8A E6 BA EB 24 6

04 00 C4 04 CS 00 OF 81

DMA+4.AL
$+2

AL.AH DMA+4,AL AL,CH


$+2

ANO
OUT

AL,OFH OB1H.AL

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

BA E6 2A CO 01 E8

MOY SUB SHR

AH.oH AL.AL
AX,l AX

NUMBER OF SECTORS TIMES 256 INTO AX SECTORS 128 INTO AX

50
BB 0006 E8 0382 R BA CC

PUSH
MOY

CALL
MOY POP SHL

BX,6 GET PARM CL.AH


AX

GET THE BYTES/SECTOR PARM USE AS SHI FT COUNT (0=12B. ; ; ; ; ; 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 1=256 ETC)

58 ,,8 50

03 EO 05 00 C4 OJ

AX.CL
AX AX

OFC PUSH
OUT JMP MOV OUT

E6 EB 8A E6 FB
59

DMA+5,AL
$+2

AL.AH DMA+5.AL
GX AX

STI
POP POP

58
03 C1 60 02 E6 OA
C3

ADD
POP MOV OUT RET

AX,CX
GX

59

AL.2 DMA+l0,AL
ENOP

DMA_SETUP

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

CY = ,
(AX)

= 0 SUCCESS
fA I LURE -- ERROR IS! N 0 I DESTROYED
WAIT~INT
SKETTE~STATUS

051A 051A 0510 051 F 0521 0524 0527 0529 052C 052E 0530 0532 0533 0533 0534 0534 0539 053A 0538

b~;~;;~~=2------~~;~----~~;~-------------------------

E8 72 B4 E8 E8 72 AD 24 3C 74
f8

0536 R 14 08 03E2 R 0580 R


OA

0042 R 60 60 02
J34:

CALL JC MOV CALL CALL JC MOV AND CMP JZ CLC RET

J34 AH.08H NEG OUTPUT RESULTS J34 Al, NEC_STATUS AL,060H AL,060H J35

WAIT FOR THE INTERRUPT I F ERROR, RETURN IT SENSE INTERRUPT STATUS COMMAND 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 RETURN TO CALLER

e3 J35: 80 OE 0041 R 40
f9

OR STe

Dr SKETTCSTATUS, BAD_SEEK' CHK2_ERROR


ERROR RETURN CODE

e3 ;

RET

CHK_STAT_2

[NOP

------------------------------ - --- ---------WAIT I NT


INPUT 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

NONE
OUTPUT CY = 0 SUCCESS CY = 1 FAILURE -- DISKETTE STATUS IS SET ACCOROINGLY (AX) DESTROYED 5T I TURN ON I NTERRUPTS. JUST I N CASE ;AVE REG I STERS CLEAR TIMEOUT INDICATOR LOAD WA r T CODE AND TYPE PERFORM OTHER FUNCTION BYPASS TIM I NG LOOP 1FT I MEOUT OCCURRED CLEAR THE COUNTERS FOR 2 SECOND WA r T TEST FOR INTERRUPT OCCURR I NG

053B 0538 053C 0530 053E 053f 0540 0543 0545


051~7

~;

7; -7 N~ -------- ;~;~----~~~~- -----------------

fB

50 53 51
f8

~~;~
PUSH

~~

eLe
MOY INT JC MOY XOR

ex
AX,090Q1H 15H
J36A BL,4

88 9001 CD 15 72 11 83 (4 33 C9

0549 0548 0548 0550 0552 0554 0556 0558 0550 OSSE 05SE 055F 0564 0565 0566 0567 0568 0569

eX,ex
SEEK_STATUS, I NT_FLAG

J36:
F6 75 E2 FE 75
f9

ac
f7
F3

06 003E R 80

CB

TEST JNZ lOOP DEC JNZ

J37 J36
BL

COUNT DOWN WHILE WAITING SECOND LEVEL COUNTER

J36
DISKETTE_STATUS, TIME_OUT; NOTHING HAPPENED ; ERROR RETURN SEEK_STATUS,NOT ; SAVE CURRENT CARRY INT_FLAG ; TURN OfF INTERRUPT FLAG RECOVER CARRY ~ECOVER REG I STERS

80 DE 0041 R 80
9C

J36A: J37:

OR STC

80 26 003E R 7F
90

56
58 e3
WAIT - I NT

59

RET

PUSHf AND POPF POP POP POP

ex
BX AX

GOOD RETURN CODE COMES FROM TEST


ENOP

I NST

DISK INT - THIS ROUTINE HANDLES THE DISKETTE INPUT

INTERRUPT

;
; OUTPUT

NONE
THE I NTERRUPT FLAG I S SET \ S SEEK_STATUS

0569 0569 056A 0568 D.56C


056F

DISK INT 1

0574 0576
0578 0578

0570 057E 057F 0580

FB lE 50 [8 0000 E 80 DE 003E R 80 80 20 E6 20 B8 9101 CD 15 58 1f


CF

STI
PliStl PUSH

PROC

FAR

;>>> ENTRY POtNT FOR ORG OEF57H


RE ENABLE INTERRUPTS SAVE REG I STERS 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 RETURN FROM INTERRUPT

os
AX

CALL
OR MOY

ouT

MOY INT
POP POP IRET DISK_INT_l

OOS SEEK_STATUS, !NT_FLAG AL,20H 20H,AL AX,09101H

15H
AX

OS
ENDP

0580 0580 0581 0584 0585 0586 0587 0589 05BB 058B 0580 0590 0590 0591 0593 0595

fC

BF 0042 R

51 52 53
B3 07 B7 02 33 C9
SA 03F4

RESULTS PROC ClO MOV PUSH PUSH PUSH MOY

; .---- - ----------------------------------- ------NEAR

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

01, OFFSET NEC_STATUS

ex

PO I NTER TO DATA AREA SAVE COUNTER MAX STATUS BYTES HIGH ORDER COUNTER INPUT LOOP COUNTER STATUS PORT WA IT FOR MASTER GET STATUS MASTER READY TEST DIR WA I T=MASTER DECREMENT HIGH ORDER COUNTER

OX BX BL,7

; ------ WA I T fOR REQUEST FOR MASTER R10: MOV BH,2

J38:
XOR MOV CX. CX OX, 03 F4H AL. OX AL.oaOH J40A J39 6H

J39:
EC

A8 80 75 10 E2 F9 FE CF

IN TEST JNZ LOOP OEC

0597

Diskette 5-97

0599

75 FO
80 DE 0041 F9
R 80

JNZ
OR

J 38 DISKETTE _5fATUS, TIME_OUl

REPEAT TIL DELAY DONE RESULTS ERHOR SET ERROR RETURN

05913
O')AO 05AO O';:'{'1 05A2 05A3 05A4

J40: STC
POP POP POP

5B 5A

59
C3

8X OX CX

RET TEST THE DIRECTION BIT

05A5 05A6 OSA8 05AA 05AA OSAF

[C A8 40 75 07 80 OE 0041 [8 U
R 20

J40A: J41 ;

IN T[ST JNZ
OR JMP

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 IN THE STATUS OX AL, OX [01 \,AL 01 CX,20 J l l3 OX AL, DX Al.,0101i J41, 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 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 IS DONE

READ 05131 0581 0562 05B3 05115 0566 05139 05138 05BC 0580 05BF 05C1 05C3 OSC5 J42; INC IN
MOV

4? [C 88 05

"7

INC
MOV

89 0014
FE J43:

E2 4A EC AB 74 FE

10 06 CB 75 C4 EB E3

LOOP DEC IN TEST


JZ

DEC JN7
JMP

BE
Rl0 J41

RESULT OPERATION 05C7 OSC7 05C8 05C9 05CA J114: 08 oA


POP POP POP

59
C3

BX OX CX

RET

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 Oscs
OSGB

NUM TRANS
AO 3A AD 74 BB 0045 R C5 -

MOV
CMP MOV

05eE 0500 05D3 OSD5 05D8 0506 05DO OJ[)F

004"1 R OA

.JZ
MOV

PROC NEAR AL,NEC STATUS+3 AL,CH ~t5 NEC_STATUS+5 BX,8 GET PARM AL,AH AL AL,CL END?

G[T CYLI NDER ENDED UPON SAME AS WE STARTED GET END I NG SEC fOR I F ON SAME GYL, THEN NO ADJUST

051::1 051::2
05E2

0008 [8 0382 R 8A C4 FE CO 2A Cl C3

Mav

CALL

GET EDT VALUE


I Nro AL USE E.01'+1 FOR CALCULATION SUBTRACT START FROM END

INC J45; SUB RET NUM TRANS RESULTS lNDP

HANDLE 0 I SK CHANGE ACT I VE


0~l2

I F rOUND TO BE

C6 87 0090 R 61

MOV

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

R 06

rop

POP POP POP RET ; ;

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

0604 0604 0606 0608 060A OGor

0611 0613 0617 0619 0618 0610 OGlE 0622


0624 OG28 0620 062E 0631 0634 0636 0638 063A 063C 0630 0640

32 8A 130 80 81 D2 08 02 8A 02 fA 81. 75 08 C6 FB 8A AO ?4 81 02 DC [E BA EB

FF DA

READ DSKCI-ING XOR May


MOV

01
26 003F R CF OLI

AND
MOY

C3 1 E 003F H CB CB

HOL
OR

ROR
MOV

EO
06 003F R 09
06 003f R 06 0040 R FF

SHL CLI TEST JNZ

OR
MOV

R8: 03F2

ST I
MOV MOY

OOH R
3F 04
GO

AND
MOV ROL

OC 03F7 00

OR OUT
MOV JMP

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

EC A8 80 C3

RET
; ;

IN rEST

AL,DX AL,DSK_CHG ENOP

; ; ;

INPUT DIR CHECK FOR DISK CHANGE liNE ACTIVE RETURN TO CALLER WITH ZERO FLAG SET

READ_DSKCHNG

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
CHANCE TEST PROC NEAR HF CNTRl, DUAL OC2 ; ; GO OETERMI NE TYPE OF CONTROLLER CARD DISKETTE ATTACH CARD, SET CHANGE LINE ACTIVE

0646 0646 0646 0640 064F 0651 0655 0657 0659 0658 0650 0660 0662 0667 0668 066c 066E 0670 0675 0676 0678 067A 067C 067E 0680 0682 0684 0686 0688 068A 06Be 068E 0690 0692 0694 0696 0698

OJ SK
F6 06 008F R 01 74 29 32 8A 8A 24 3C 74 FF DA 87 0090 R 07 03 07

J2
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

72 OB E8 0604 R 74 05

JB
CALL

DCO
READ DSKCHNG FINIS

I F NOT

EST ABl I SHED,

GO CHECK FOR NO OR I VE

J2
SET IT:
FINIS: DCO: MOV RET MOV

GO CHECK STATE OF DISK CHANGE LINE CHANGE LINE NOT ACTIVE, RTURN

c6 06 0041 R 06
C3 8A 87 0090 R OA CO 75 F2 80 OE 0041 C3 60 E6 EB E4 A8 75 60 E.6 EB E4 OA 75 OE 70 00 71 CO EE 10 (0

DISKETTE STATUS,MEDIA CHANCE; INDICATE MEDIA REMOVED FROM DRIVE ; RETURN TO CAllER AL, DSK_STATE! BX 1 ; GET MEO I A STATE I NFORMAT I ON FOR DR I VE Al,Al ; CHECK FOR NO DRIVE INSTAllED SETIT ; IF DRIVE PRESENT, SET CHANGE liNE ACTIVE DISKETTE_STATUS, TIME_OUT; SET TIMEOUT BECAUSE NO DRIVE PRESENT RETURN TO CALLER AL, CMOSDSB ADDR ; cADR_prn, AI 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 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)I<IVE 1, DATA ALREADY IN LOW Nlt3~l1:.. GET ROTATE comn TO SH I FT HIGH TO lOW NIBBLE EXCHANGE NIBBLES CLEAR AWAY UNDESIRED Di1IVE DATA NO DRIVE THEN SET TIMEOUT ERROR DRIVE,

OR
JNZ DC1: OR RET

R 80

OC2:

MOV
OUT

JMP IN TEST JNZ

$+2
AL,CDATA_PRT Al, CMOS_COOD DCl Al, Ci10SDSK_BYTE ; CADR_PRT, Al ;

MOV
OUT

00
71 02 04

JMP IN

$+2
Al,CDATA_PRT Dl,Dl VC3 Cl,4 Al,CL AL, lOWN I B DCl SHORT SET I T ENDP

OR JNL
MOV ROR
DC3:
AND

81 Ol~ 02 C8 24 OF 74 OA EB CA

J2
Jr~p

ON 320/360K DRIVES SET DISK CHANGE

01 SK._CHANGE
; ; ; ; ;

D I SK._TYPE THIS ROUTINE IS USED TO EITHER ESTABLISH THE TYPE OF MEDIA/DRIVE TO BE USED IN THE NEXT OPERATION(fOR fORMAT ONLY) OR RETURN THE TYPE OF MEDIA/DRIVE INSTALLED AT THE DRIVE SPECI FlED PROC NEAR HF CNTRl, DUAL T2GO DET(RMI NE TYPE OF CONTROLLER CARD DISKETTE ATTACH CARD, GO DO TYPE OPERATION

0698 0698 0690 069F 06Al 06A3 06A7 06AA 06AC OGAF 0662

F6 06 ooaF 74 49

R 01

DISI( TYPE TEST JZ XOR MDV "MOV TEST JZ


AND

32 FF SA DA 8A A7 0090 R F6 C4 10 74 DB 80 E4 07 80 EC 03 75 DC

BH,8H CLEAR HI CH ORDER OFFSET Bl,DL ; lOAD DRIVE NUMBER AS OFFSET AH,DSK_STATEIBX1; GET PRESENT STATE INFORMATION AH,DETERMINED

T5
AH,STATE_MSK AH,D3H

SEE IF MEDIA/DRIVE TYPE ALREADY ESTABLISHED I F NOT. GO RETURN ZERO VALUE STRIP OFf HIGH ORDER BITS CONVERT TD TYPE FOR OUTPUT SK I P IF NDT 320/360 DR I VE AND MED I A INDICATE NO CHANGE liNE AVAILABLE RETURN TO CAllER CHECK FOR NO DR I VE I F NONE GO I NOICATE SUCH TO CALLER STRIP OFf HIGH ORDER BITS IF STATE 0 CHECK CMOS 1.2 DRIVE RETURN TO CALLER GET CMOS DIAGNOSTIC STATUS BYTE ADDR[SS WR I TE ADDRESS TO READ OUT TO CMOS DELAY GET CMOS STATUS SEE I F BATTERY GOOD AND CHECKSUM VALID ERRDR I F EITHER BIT ON ADDRESS or DSKETTE BYTE I N CMOS WR I TE ADDRESS TO READ OUT TO CMOS DELAY GET DSKETTE BYTE SEE WHICH DRIVE IN QUESTION IF DRIVE 1, DATA ALREADY IN lOW NIBBLE GET ROTATE COUNT TO SH I H HIGH TO lOW NIBBLE EXCHANGE NIBBLES CLEAR AWAY UNDESIRED DRIVE DATA SEE IF UNDEFINED DiSKETTE TYPE RETURN IF NOT, RESULTS IN AL STATE NO DRIVE PRESENT OR UNKNOWN RETURN TO CAllER GET CMOS DIAGNOSTIC STATUS BYTE ADDRESS

SUB

JNZ
MOV RET

T7
AL, NOCHGLN AH,AH

06B4
06B6 06B7 06B9 06B8 06BE 06CO 06C2 06C3 06e5 06C7 06C9 06CB 06CD 06CF 0601 0603 0605 0607 0609 06DB 0600 06DF 06El 06E3 06E5 06E7 06E8 06EA 06EC 06E[ 06FD 06F2 06F4

80 01
C3 OA E4 74 2A 80 E4 07 74 03 BO 02 C3

Ts:

OR JZ
AND

T1
AH,STATE_MSK
TA

JZ
MOV R[T MOV
OUT

AL,CHGlN Al, CMOSDSB_ADDR ; CADR_PRT, Al

BO DE
E6 70 EB 00 E4 71 A8 CO 75 16 10 70 00 71 OA 02 75 04 BO E6 [8 4

JMP IN TEST

$+2
Al,CDATA_PRT Al, CMOS_GOOD

JNZ
MOV
OUT

T1
AL,CMOSDSK_8YTE ; CADR PRT, AL $+2 Al. COAT A_PRT Dl,DL

JMP IN

OR
JNZ

TB
Cl,4 Al,Cl Al, lOWN I B Al,3 TC AL,Al Al,CMOSDSB_ADDR ;
CADR~PRT,AL

81 02 24 3C 72
C3 BO E6 EB 4 A8 75

04 C8 OF 03 02

MOV ROR
T8:
AND

CMP

J8

32 CO
DE 70 00 71 CO F1

h.
TC:

KOR
RET

12:

MOV
OUT

WR I TE ADDRESS TO READ OUT TO CMOS


DELAY GET CMOS STATUS SEE I F BATTERY GOOD AND CHECKSUM VALID ERROR IF EITHER BIT ON ADDRESS OF DSKETTE BY7E IN CMOS WI< I TE AODkl::.SS TO READ OU 1 To CMOS

JMP IN TEST JNZ MOV au I

$+2
Al, CDATA_PRT Al, CMOS_GOOD

T1
Al,CMOSDSI<_BYTE ; (;AOR_PRT ,AL

06F6

BO 10 E6 70

Diskette

5-99

06F8 06FA

OGre
06FE 0700 0702 0704 0706 0708 o-rOA 070C

[B 00 [II "(1 OA 02 75 04

JMP

$+2
AL, CDATA_PRT DI,DL

IN
Of{

JNZ
MOY

13
CL, AL,CL AL, LOWN t B AL, I NVAL I D_DRV

DELAY GET DSKETTE BYTE SFF WHICH DRIVE IN QUESTION \ F DRIVE 1, DATA ALREADY IN LOW NIBBLE

"'

D2 C8 211 OF 3C 02 72 02 32 co

0"

ROR T3:
AND eMP

'I

J8
XOR T6: HET DISK_lYPE [NOP ; ; ; ;

T6
AL, AL

GET ROTATE COUNT TO SH I FT Ii I GH TO LOW NIBBLE EXCHANGE NIBBLES CLEAR AWAY UNDESIRED DRIVE DATA SEE J I- UNl)EF I NED 0 I SKETTE TYPE RETURN I F NOT, RESULTS IN AL
STAlE NO DRIVE PRESENT OR UNKNOWN RETURN TO CALLER

e3

u-rOD

FORMAT_SET THIS ROUTINE IS USED TO [STABI. ISH THE TYPE OF MEDIA/DRIVE TO BE USED FOR THE FOLLOWING FORMAT OPERAT ION PROC NEAR fiF _CNTRL, DUAL SO BH, tlH Bl,DL GO DETERM I NE TYPE OF CONTROLLER CARD DISKETTE ATTACH CARD, GO 00 TYPE OPERATION CLEAR HIGH ORDER OFFSET LOAD DR I VE NUMBER AS OF FSET CHECK fOR 320/360K MEOlA & DHIVE BYPASS I F NOT

0700 0700

0712 0-(14
0716 0718 071A 071C 0721 0722 0723 0726

f6 06 008F R 01 74 5C 32 8A FE 75 FF OA C8 06

fORMAT SET - TEST JZ XOR


MOY

DEC

JNl
MOV RET rUSH CALL JZ R 06 MOV MOy MOV CALL MOY MOV CALL MOV CALL

Al 51

C6 87 0090 R 93

C3

OSK_STATE[BXJ,M326D326 ; SET STATE VARIABLE RETURN TO CALLER


AX

50
E8 0604 R 74 2 C6 06 0041 8B 56 00

READ_DSKCHNG

;
;

53

SAVE TYPE VALUE CO CIIECK 0 I 51( CHANGE 1I NE NOT ACT I VE GO ON PROCESS I NG

on8
0720 0730 0732 0735 0738 073A 0730 0740 07113 0745 07116 0748

B5 01
E8 85 8 8B E8 74

oInc

8B ?6 00
00 041C R 56 00 0604 R 11 06 0041 R 80 SE 00 FF 870090 R 61

JZ
POP MOV MOV XOR MOY RET
POP

CH,OlH SEEK OX, [BPl CH,OOH SEEK OX, [BP 1 READ DSKCHNG S3 -

DISKETTE_STATUS,MEDIA_CHANGE ; INOICATE DISK CHANGE ACTIVt:: OX, [BP] RESTORE DRiVE PARMETER MOVE TO CYLINDER 1 I SSUE SEEK RESTORE OR! VE PARMETER MOVE TO CYL I NDER 0 I SSU SEEK RESTORE DR lYE PARMETER GO CHECK DISK CHANGE LINE CHANGE LINE INACTIVE, GO SET TYPE

58
C6 8B 32 C6

07'lf 0150
0755 0756 0757
Ol~,)

e3

AX ; RESTORE TYPE yALU[ DISKETTE_STATUS,TIMeOUT; INDICATE NO MEDIA IN DRIVE BX,ISP] ; RES10RE DRIVE PARMETER FOR USE AS INDEX 81l,BH ; CLEAR HIGH ORDER orFSET OSK_STATE[BX],POA_DUAL; SET STATE TO POWU< ON ASSUMPT ION RETURN TO CALLER
AX

58
FE C8 I~ 06 C6 87 0090 R 74

OEe JNZ
MOV RET

Al
S2

; ; ;

RESTORE TYPE YALUE CHECK FOR 320/360K MEDIA BYPASS I r NOT

IN 102M DRIVE

0758 0760 0761 0763 0765 076A O"r6B 0770

e3
FE c8 75 06

DSK_STATE[BX],M326D12 ; SET STATE VARIABLE RETURN TO CALLER

$2:

OEe JNZ
MOY

Al Sl

; ;

CHECK FOR 1. 2M MED I A IN 1. 2M DR I VE BYPASS I F NOT, ERROR CON a I T I ON NOW EX I STS

C6 87 0090 R 15
e3
C6 06 0041 R 01

RET

OSK_STATE[BXj,M12D12 ; SEI STATE VARIABLE ; RETURN TO CALLFR OISKETTE_STATUS,BAD.. CMD ; UNKNOWN srAll,BAD COMMANl) ; RETURN TO CALLER ENDP

SE:

orn

C3

MOV SO: RET FORMAT_SET ; ; ; ; ;

DSKETTE_SETUP TH I S ROUT I N[ DOES A PRELl M I NARY CHECK TO SEE WHAT TYPE OF DISKETTE DRIYES ARE AlTACH TO THE SYSTEM. TEST IS ONLY PERFORMED WH[N A DUAL ATTACHMENT CARD EXISTS. NEAR

0771
0771 0772 0773 0774 0775 0776 0777 0778 0779 077A 0770 0780 0786 078C 0791 0796 0796 07AO 07Al 07A3 07A8 07AA 07AC

50
53
51

DSKETTE SETUP PROC 'PUSt-1 AX

PUSH
PUSH PUSH PUSH PUSH PUSH PUSH PUSH CALL MOY MOV MOY May MOY May MOV PUSH MOY
AND MUY

BX

ex

52 56

57
06
1E

OX SI DI
ES DS

;AVE REG I STERS

55 E8 0000 E
BB C7 C7 C6 C6 C6 C6 0000 87 0090 87 0092 06 008B 06 003E 06 00'-10 06 003F

R 0000 R 0000 R 00
R 00 R 00 R 00 SUPO;

53
BO 01 80 26 003F R CF B1 04 02 C3 08 1E 003F R 02 CB 8A CB 02 EO FA 84 06 003F R 75 09 08 06 003F R C6 06 0040 R FF

07130
0782 0764

ROl OR ROR
MUY

0786 07B7 0788


07BO 07Cl

SHL ell T[ST JNZ

8P DDS LOAD DATA SEGt1ENT REGISTER TO ROM BIOS AREA BX,O ; INITIALIZE DRIVE POINTER WORD PfR DSK_STATEfBX],O ; INITIALIZE STATES WORD PTR DSK_STATE[BX+?),O ; INITIALIZE SlART STATES LASTRATE,O INITIALIZE LAST DATA TRANSfER RATE SEEK_STATUS.O ; INDICATE RECALIBRATES NEEDED MOTOR COUN r, 0 ; I NIT I AL I ZE MOTOR COUNT MOTOR::::STATUS,O ; INITIALIZE DRIYES TO OFF STATE BX ; SAVE POINTER AL;Ol ; MASK FOR DETERMINING MOTOR BIT MOTOR_STATUS,OCFH ; CLEAR ENCODED DRIVE SELECT 8ITS(11 & 5) CL,4 SHIFT DRIVE NUMBER INTO HIGH NIBBLE COUNT BL,CL SHIfT DRIVE NurolBER INTO HIGH NIBBLE MOTOR STATUS,BL ADO IN DRIVE NUMBER SELECTED FOR LATER USE lJL,CLRESTORE DRIVE NUMBER GL,BL RESTORE DRIVE NUMBt:~ AL, CL FORM MOTOR ON 6 I T MASK NO INTERRUPTS WHILE DETERMING MOTOR STATUS AL, MOTOR_STATUS TEST SUP2 DONT NEED TO SELECT DEVICE IF MOTOR ON MOTOR_STATUS,AL ; TURN ON CURRENT MOTOR MOTOR COUNT,OFFH ; SET LARGE COUNT DURING OPERATION ENABLE I NTERRU PTS AGA I N DX,03F2H ADDRESS DIGITAL OUTPUT REGISTER AL, MOTOR STATUS GET 0 I G I TAL OUTPUT REG I STER REFLECT I ON AL,03FH STRI P AWAY UNWANTED BITS CL,4 SHIFT COUNT AL,CL PUT BITS IN DESIRED POSITIONS AL,OCH NO RESET, ENABLE DMA/I NT DX,AL SELECT DRIVE DX,8X ESTABLISH OR!VE PARM FOR SEEK ROUTINE CH, TRK SLAP GET TRACK TO SEEK TO(>L~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

07C6 07e7
07CA 07CD

FB
BA 03F2 AO 003 F R 24 3F

SUP2:

OR MOV STI May MOY


ANO

07CF 0701 0103


0705

B1 04 02 CO
OC OC EE .

MOV ROl OR
OUT

0/06 0-(06
07DA

88 03 05 30
8 041C R 5A

MOV
MaY

CALL
POP

0700
07DE

52
B5 OA EB 041C R

070f

07E1

PUSH MaY CALL

5-100

Diskette

07EI, 07E6 078 DnA

07[[3 07EC
07ED 07FO 07 F2

85 OA H F6 rE CD 5A 52

MOV

XOR
SUP3: D[C
POP

CH, QU lET_SEEK 51, SI


Cit

OX
DX

56
8 041 C R Bl.J 04 8 082C R E8 0580 R 5E 46 1'6 06 0042 R 10 75 08
fl3 F[ OB

PUSH PUSH CALL MOV CALL CALL POP INC 1[ST JNZ
eMP

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 SENSE DRIVE STATUS COMMAND BYTE I SSUE THE COMMAND GO GET STATUS RESTORE COUNHR COUNT NUMBER OF SEEKS TIL AT HOME( TRACK 0) LOOK TO SEt: I F HEAD I S AT TRACK 0 GO OETER~lINE DRIVE TYPE SEE 1F TilE NUMBER OF SEEKS = NUMBER I r LESS THAN, NOT DONE YET RESTORE POINTER DRIVE NOT INSTALLED, BYPASS ISSUED

07F5

OHB OlF9
OHA 07FF
0801

AH, SENSE OIlV ST sUPS RESULTS SI SI NEC_ST ATU5, HOME SUP4 51,QUIET S[EK+l SUP3 BX

0801,
0806 0807
0809 080A 08UO 0812 08111 0819 0819 081A 0810 081 F 0822 0823 08211 0825 0826 0827 0828 0829 082A 0828

72 2
5B EB 10
83 FE OA C6 8"1 0090 R 61

JB
POP JMP

SHORT NXT_DRV

'"

UPl.J:

POP CMP

73 05
C6 87 0090 R 93 NXT_DRV:

MOV JAE MOV INC


eMP

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 OSK_STATEI3Xj,M326D326
BX
j

ESTABLISH 320/360K STATE

43
83 FB 02 7l.J 03 E9 07AO R

JE
JMP

BX, !-lAX_ORY SUPl SUPO

POINT TO NEXT DRIVE SEE I F DONE IFF I N I SHED LEAVE TEST REPEAT TIL OONF FOR EACH DRIVE RESTORE ALL REGISTERS

50
1F 07 5> F SE SA 59 5B 58 C3

UP1:

POP
POP

Be
DS

POP
POP POP

ES 01 SI

POP
POP POP

ex
BX AX

DX

RET

POP

OTI-IERW I S[ ReTURN FOR CALL TO NEC_OUTPUl I F ERROR

KEEP STACK CORRECT 082C 082F 0831 0834 0835 0835 E8 03E2 R 8A 2 [8 03[2 R C3 SUP5: CALL

Mav
CALL

NEG OUTPUT AH,OL NEG_OUTPU T

OUTPUT TO NEC GET DR 1VF NUMBER SELECTED OUT PUT TO NEC

RET

OSKETTE_SETUP [NOP CODE ENDS


END

Diskette

5-101

5-102 Diskette

TITLE FIXED DISK BIOS FOR PUBLIC PUBLIC PUBLI C EX'rRN EXTRN EXTRN EXTRN EXTRN EXTRN
; --

IBM DISK CONTlWLLER 1-11-84

DISK 10 HD INT DI5K_SETUP

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. INPUT (AH == HEX VALUE) (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 ( OL) ( DH) (CH) (CL) DR I VE NUMBER HEAO NUMBER CYL.INDER NUMBER SECTOR NUMBER (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)

(AL) ( ES:BX)

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)

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

~OFF

OOEO DOCC 008B

OOAA
0080 0040

SENSE fAIL NO_ERR WRITE FAULT UNDEr-ERR NOT ROY TIME OUT BAD SEEK

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

0020 0011 0010 OOOB aoaA 0009 0007 0005 0004 0002 0001

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
~

[OU [QU [OU [OU [OU [QU [OU EQIJ [OU [QU [QU

20H

lHI
10H OBH OAH 09H 07H 05H O!IH 02H 01H

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

IXED DISK PARAMETER TABLE +0 +2 +3 +5 +7 +8 THE TABLE (1 (1 (1 (1 (1 (1 WORD) BYTE) WORD) WORD) BYTE) BYTE) IS COMPOSED OF A BLOCK DEFINED AS; -

-+-9 -+-12 -+-111 -+-15

(3 (1 (1 (1 -

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

0000

. LIST PAGE I NCLUOE SEGMENT. SRC CODE SEGMENT BYTE PUBLIC HARDWARE SPEC I f I C VALUES CONTROLLER Hf_PORT+O Hf_PORT+1 HF PORT+2 flr-POBT+3 Hr-PORT+4 HF::::PORT+5 Hr PORT+6 I/O PORT

> WHEN READ FROM:


- 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

= 01 FO == 03F6 '" 0001 '" 0002 := 0004 " 0008 == 0010

HF PORT Hf::::REG_POHT

[au

[OU

01 fOH
3 f6H

01 SK PORT

== 0020 == 0040 == 0080

, 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 ERROR REG I STER FRR DAM EqU ERR-TRK 0 EQU ERR::::ABORT EQU [Qu [OU 00000001 B 00000010B 00000100B 000010008 000100008 00100000B 010000006 100000008 000100008 00100000B 00110000B 010000008 01010000B 01100000B 01110000B 10010000B 10010D01B 00000001 B 0000001DB 000010006 OAOH 020H 20H

ECG CORRECT I ON SUCCESSFUL SEEK CONPLETE WRITE FAULT

= 0002
== 0004

=-

0001

== 0010
= OOIjU == 0080 = 0010 == 0020 - 0030 == 0040 = 0050 = 0060 = 0070 == 0090 = 0091 = 0001 = 0002 = 0008
== OOAO = 0020 = 0020

ERR DATA ECC ERR::::8AOJ'iLoCK


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 I NT CTL PORT I NT1_CTCPORT EOI MAX FILE S_MAX_F I LE DELAY 1 DELAY::::3 HF_FAI L
DELAY~2

~g~
EqU EQU EQU EQU [QU EqU EQU EQU EQU EQU EQU EqU EQU lQU EQU EQU EQU [aU
[QU [aU [OU [QU

DATA ADDRESS MARK NOT FOUND TRACK 0 NOT fOUND ON RECAL ABORTED COMMAND NOT USED j D NOT rOUND NOT USED

DRIVE RECAL READ WRITE VER I FY FORMT TRACK INITIALIZE SEEK DIAGNOSTIC DRIVE PARMS CND MODIFIER CMD MODI FIER CMD MODIFIER

(10H) (20H) (30H)


(1IO~j)

(50H) (60H) (70H) (90H) (91H) (OlH) (02H) (OSH)

8259 CONTROL PORT #2 8259 CONTROL PORT #1 [NO OF I NTERRUPT COMMAND

== 0002 == 0002 == 0020 == 0600

= 0100
;:; 0008

20H 0600H 0100H 08H P_MSG: NEAR

DELAY FOR or COMPLETE DELAY FOR READY DELAY FOR DATA REqUEST CMOS FLAG J N BYTE OEH TO INHIBIT DISK I PL

EXTRN ASSUME PAGE FIXED DISK 1/0 SETUP GS;CODE

5-104

Disk

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

0000 0000 0002 0004 0005 0009 0000


~Oll

DISK~SETUP

ASSUME 2B CO BE CO FA
SUB MOV

PROC NEAR ES: ABSO AX,AX ES,AX

ZERO

CLI
MOV MOV MOV MOV Mav MOV MOV MOV MOV MOV MOV MOV MOV

0015 DOle 0021 0024 0028 0020 0034 0039 0040 00115 0046 0048 004A 004e D04E 0050 0052 0055 0057 005C 0061 0066 0068 006A 006C 006E 0070 0072 0074 0077

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
E4 A 1 24 BF E6 A1 E4 21 24 FB E6 21

R 0197 R R
R
R 0000 I: R R 0000 E

STI
IN AND OUT IN AND OUT

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 VCTOR+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

**

ASSUME 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 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 FA E4 21 24 FE E6 21 FB C3 + ??OOOO + + 170001
~lOV

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

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

ISHl lABEL SHl lA8EL ORG


DB ORG DB JZ MOV AUD Mav MOV

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

ESTABLISH SEGMENT RESET THE STATUS I NO I CATOR 7ERO NUMBER OF HARD Fl lES 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 ZERO CARD OFFSET SAVE HARD FILE BYTE
GET FIRST DRIVE TYPE

I N CMOS

NO HARD FILES COMPUTE OFFSET AT LEAST ONE DRIVE GET SECOND DR I VE TYPE

4
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 ONLY ONE DRIVE COMPUTE OfFSET FOR DRIVE 1 TWO DRIVES CHECK THE CONTROLLER

L4:

MOV
MOV INT Je MOY MOY ADO MOV

GET START T I MER COUNTS 60 SECONOS .. lB.2 SET UP DRIVE a WERE THERE TWO DRIVES? NO-ALL DONE SET UP DRIVE 1

ex,AX

CALL
Cf~P

JBE Mav

0005 0008
0008 0009 OODB 0000 OOOF OOEO

CAll
POD~OONE;

HO RESET 1 HCNUM,1POD DONE Dl,e1H HD_RESET_1 Al,021H AL,OFEH 021H,Al

CLI
IN AND oaT STI RET

**

10 DELAY NOT REQU I RED BE SURE T I MER I S ENABLED

**

POD ERROR OOEl OOEl 00E4 00E7 OOEA ODED DOH


~OH

CTL_ERRX: BE E8 E8 SO EB 0000 E 0161 R 0000 E OOOF E9


MOV

CALL CALL
MOV JMP

S [, OFFSET F1782 SET FAIL P MSG BP,OFH SHORT POD~DONE PROC BX


ex

CONTROLLER ERROl{ DOtH I PL FROM DISK 01 SPLAY [RROR POD ERROR FLAG

OOFO OOFl OOF3 00f5 OaF? DOF9 OOFB OOFD 0100 0102 0105 0108 010A 0100 0110 0112

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

HD RESET 1 ~ PUSH PUSH MOV RES~l :


I NT JC MOV INT JNC

NEAR SAVE TIMER liMITS SET OR I VE PARMS REGAllBRATf DRIVE 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

AH,09H

13H
RES 2 AH,llH

13H
RES CK POO-TCHK RES-1 SI,OFFSET F1781 Dl,1 RES E1 SI, OFFSET F1780 SET FAIL SHORT RES_El AH,08H

RES_2:
RES~FL:

CAll
JNe Mav

TEST
JNZ MOV

R
RES_CK:

CALL
JMP
I~OV

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

8A Oil CD 13

MOV

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:

INT JC
MOV MaY INT JNC
CMP

l'

JE
eMP

JE
eMP

JE CALL

JC
MOV
u~_c

JZ
MOV MOV I SHL LABEL SHL LABEL ORC
DB

+ 1?0003 00 E1

eo
06
OA C8 EB CF BE 0000 E F6 C2 01

+ + ??0004 +

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

SAVE DRIVE CODE RESTORE DRIVE CODE VER I FY THE LAST SECTOR 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
OfFSET CS: ??0003 OCOH OFFSET CS: 1?0004

ORG OB OR
JMP

6
CL,AL R[S 3 5 I, OFFSET F1791 DL,1 RES E1 S I, OFFSET F1790 P M5G BP,OFH PUT SECTOR NUMBER IN PLACE TRY AGAI N INOICATE DISK 1 ERROR INDICATE DISK 0 ERROR RESTORE T I MER L! M I TS

RES_ER:

15 03
BE 0000 E8 0000 80 OOOF

59
5B e3

MOY rEST JNZ MOV RES_E1: CALL MDV RES_OK: POP


POP

ex

BX ENDP 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 ENDP PROC NEAR
AX

RET
HD_RESET_l SET FAIL Mav
OUT JMP

BO E6 EB E4 OC 8A BO E6 8A EB E6 e3

BE

GET CMOS ERROR BYTE

70
00 71
DB

EO
8f

IN OR MOV MOV
OUT

SET DONT I PL FROM 0 I SK FLAG SAVE IT CMOS BYTE ADDRESS

70
C4 00 71 SET FAIL

MOV
JMP OUT

PUT

I TOUT

RET POD TCHK POP POP POP PUSH PUSH PUSH MOV
CMP

one
0170 Ol7E 0181 0183 0185 0187 0189 018B 0180 018F 0191 0193 0194 0195 0196 Uly{ 0197

58 59 5B 53 51 50 A1 006C R 38 D9

ex BX ex
AX AX, T I MER_LOW BX,CX TCHKl aX,AX TCHKG SHORT TCHK2 AX, BX TCHKNC AX,CX TCHKG

ex

CHECK FOR 30 SECOND T I ME OUT SAVE RETURN GET TIME OUT LIMITS AND SAVE THEM AGAIN RESTORE RETURN AX :::: CURRENT TIME BX _ START TIME CX ~ END TIME START < END END < START < CURRENT END, CURRENT < START CURRENT < START < END START < CURREN r < END OR CURRENT < END < STARI CARRY SET INDICATES TIME OUT
I NO I CATE ST I LL T I ME

72 06
38 72 EB 3[} 72 3B 72 F9 e3 FB e3 DB OC a/I C] OJI Cl 02

JB
eMP

J8
JMP

TCHK1: TCHK2: TCHKNG: TCHKG: POO_fCHK

CMP JB CMP JB STC

RET
CLC RET ENDP ENDP

DISK SETUP PAGE-

FIXED DISK RIDS [NTRY POINT DISK 10 PROC ASSUME BO


FAR

0197 0197 019A 019C 019E 019E 01Al 01Al 01A2 01A4 01A6
0111B

FA 80 73 05 CO 40

CMP

JAE I NT

05: NOTH lNG, ES: NOTH I NG DL,80H HARD 01 SK 40H -

TEST FOR FIXED DISK DRIVE Y"S, HANULE HERE DISKETTE HANDLER BACK TO CALLER

CA 0002
fB OA -(5 CD 2A 80

RET HARD_DISK:
AS3Ur~[

08: DATA
ENABLE AH,AH A2 40H AH,AH OL,(80H + S MAX FILE RET_2 -AH,08H A3 GI:.T_PARM_N AH,15H A4 READ_DASa_TYPE INTERRUPTS

STI E4 09 40
Ell

OR
JNZ I NT
SlJB CMP

RESET NEC WHEN AH::::O 1) GET PARAMETERS READ OASD TYPE IS A SPECIAL CASE IS ALSO

01AA 01AD OlAF OlAF 01B2 01B4 01B7 01BA 01BC 01BF 01Bf 01CO 01Gl 01C2 01C3 01CII 0lC5 01c6 01C8 OlCA a1CC 01CF 0100 0103

FA 81 77 EF A2:

JA
eMP

80 FC 08 75 03 E9 038B R 80 FC 15 75 03 E9 0349 R 53 51 52 1E

JNZ A3: A4: PUSH PUSH PUSH rUSH PUSH PUSH PUSH OR JNZ MOV CALL PUSH
MOV JMP eMP

JNZ
JMP

ox
1)$

SAYE REGISTERS DURING OPERATION

ex
DX ES

06 56
57 OA 75 62 E-8 50 B8 BE

Fli 02 80 0212 R
---- R 08

A5:

MOV

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

5-106

Disk

0105 0106 010A 01 DO


01 DE 01DF 01 EO 01 E1 01 E2 01 E3 01 E4 01 E5 01E8

58

POP
MOY eMP eMe POP

AX

8A 26 0074 R 80 FC 01
f5 5F 5E 07

AH,DISK_STATUS1 AH,1 D'

GET STATUS FROM OPERAT I ON SET THE CARRY FLAG TO INDICATE SUCCESS OR FAILURE RESTORE REG I STERS

1F
5A 59 58 GA 0002 M1

POP POP POP POP POP POP


RET

51
ES OS OX

ex
BX

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 $-MlPROC
AX

THROW AWAY SAVED FLAGS FUIIICT OOOH 001H 002H 003H OOl.jH 005H 006H D07H D08H 009H OOAH OOSH OOCH OOOH OOEH OOFH I ON TRANSFER TABLE

DISK_IO ENDP

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

0263 0307 0310 0318 0320

R
R R R

0333 R

02AB R 02AB R 02AB R


03EA R

0204
0206 0206 020A 020G 020E

041 F R 0427 R 042 F R 02B3 R 02AB R


02AB R 044E R 0465 R 02AB R 02AB R 0489 R M1L 50 B8 ---- R BE 08 58 80 FC 01 75 03 E9 0307 R C6 06 0074 R 00 53 SA 1 E 0075 R

LABEL OW OW OW OW OW OW OW OW OW OW OW OW OW OW

fORMAT BAD SECTORS FORMAT DRIVE RETURN PARf1S

ow

OW OW OW

READ BUFfER WRITE BUFFER RAM DIAGNOSTIC DRIVE DIAGNOSTIC CONTROLLER 0 I AGNOST I

010H
011H 012H 013H 014H

ow
OW OW

0210 '" 002A


0212

EOU

0212
021.3

DISK_IO CONT -PUSH


MOV MDV POP

NEAR EST ABL I SH SEGMENT RETURN STATUS

0?16 0218
0219 021C 021 E

AX,DATA OS,AX
AX

CMP JNZ
JMP

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

0221
0221 0226

SUO:
MOV PUSH MOV PUSH " AND eMP JBE PUSH CALL MOV ISHR + 770006 LABEL + SHR + 7?0007 LABEL + ORG + ?70008 LABEL DB ORG

0227
022B 022C 022F 0231 0233 0234 0231 0238 023B 0230 0238 0238

50
80 E2 7F 3A 0/\ 76 76 06 E8 06B4 R 26: 86 47 05 01 8

0238 0230 0230 023E

02
112 0042 R 26: 8A 47 08 52 l3A 03 F6 EE

DB
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

2
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

0241
02!15 0246 0249 024A

GET CONTROL BYTE MOD I F I ER SET EXTRA HEAD OPT I ON SET EXTRA HEAD OPT I ON CONTROL BYTE IN

5A
07

024B
024G

8A 26 0076 R
80 E4 GO OA EO 88 26 0076 R

0250
0253

0255
0259

o25A
0250 02,)[ 0260 0262 0265 0269
0268 0268 0260 0268

58 A2 0043 R
50

SECTOR COUNT GtT SECTOR NUMBER GET CYL I NDER NUMBER

8A C1
24 3f A2 0044 R 88 2E 0045 R SA Gl + 770009 DO CO E8

AL,6
BYTE

+
+ 7?000A

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

02613
0260 0260 026E 0271

06
A2 0046 R SA C2 + 77000G DO EO GO 04 80 OA OC A2 58 50 32 E6 Of C6 AO

CYLINDER HIGH ORDER 2 BITS DR I VE NUMBER

0273 0273

0275
0273 0?73 0275 0275

+ +
+

710000

DB
AND DR DR MOV POP PUSH MoV XOR SAl MOV CMP J N8 POP POP PUSH PUSH MOV ISHR LABEL SItR LABEL ORG LABEL

4
DH,OFH AL,DH AL,80H OR 20H CMD_BLOCK+5, AL AX AX AL,AH AH,AH 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

0276
0279

027B 0270
0280 0281

0047 R

0282
0284

8A G4
E4

0286

01

EO

AX,l
SI,AX AX,M1L BAD COMMAND POP AX -

0288
028A

028D
028F 0290

0291
0292 0293

8B FO 3D 002A 73 lA 58 56 51 50 86 CS D1 E9

BX
CX AX ex, BX CX,4 BYTE

0295
029;' 0297

+ 77000F +

CX,l
BYTE OfFSET CS:??OOOF NEAR

0295 0295

+ + 770011

+ 770010

Disk 5-107

0295 0297 0297 0298 029A 029C 029E 02A2 02A3 02A4 02A9 02A9 02AA 02AS 02AS 02BO 02B2 0283

el CO 03 Cl 8E CO 81 E3 OOOF

a" BC

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 021 02EC o2EE 02f3
02F~

---------------------------------------- -------RESET THE 0 I SK SYSTEM (AH = OOOH) ------ ------ ---- -------------------------------PROC
~EAR

FA E4 24 E6 FB BO SA
EE

01 SK_RS~ll
Al SF A1

IN
ANa

04
03F6 ORO: FD 0076 R OF 050f R 2f OlF1 01

89 OOOA
75 AO 24 EE E8 75 BA Ee 3C 75 80 2A E8 E8 80 76 80 82 E8 E8 C6 e3 C6 C3

"9

OUT STI MOV MOV OUT MOV DEC JNZ MOV


ANa

Al, I NT _CTl_PORT+1 AL.OBfH I NT_CTl_PORT+l, Al 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 HF _NUM, 1 ORE CMO_BLOCK+5,010H OL,l INIT DRV HD J SICRECAl 01 SK_STATUSl ,0 01 SK_STATUSl ,BAD_RESET ENDP

**

10 DELAY NOT REQU I RED

GET THE MASK REG

**

ENABLE HARD FilE I NT. START INTERRUPTS RESET DELAY COUNT WAIT 4.8 MICRO-SEC SET HEAD OPT I ON TURN RESET OFF TIME OUT ON RESET GET RESET STATUS BAD RESET STATUS SET TO OR IVE 0 SET MAX HEADS RECAl TO RESET SEEK SPEED CHECK FDR OR I VE 1 SET TO ORIVE 1 SET MAX HEADS REGAL TO RESLT SEEK SPi:.ED I GNORE ANY SET UP ERRORS CARD fAI LED

OUT CALL
JNZ MOV

IN
eMP

27
26 0047 02 03EA R 0465 R 3E 0075 00 DE 0047 01 03EA R 0465 R 06 0074 R EF

JNZ
ANa SUB

GALL
R 01 R 10 CAll CMP JBE OR MOV CALL CAll MOV

~~: ~K~~~CAL

OZFa 02fB 0300 0301 0306 0307

R 00

ORE: OR ERR:

RET RET

06 0074 R 05

MOV

DISK_RESET

0307 0307 030A 030f 0310

AO 0074 R c6 06 0074 R 00 e3

; ------- --DISK STATUS ROUTINE (AH = 001H) ; RETURN_STATUS PROC NEAR MOV AL, 0 I SK_STATUS1 ; 01 SK_STATUSl ,0 ; MOV

-------------------- ------- ----------- ----------------------------------- ---- -- ---RET


OBTAIN PREVIOUS STATUS RESET STATUS ENOP (AH ::: 002H)

RETURN_STATUS

DISK READ ROUT I NE 0310 0310 0315 0318

c6 06 0048 R 20 E9 04BB R

o I SK_REA~OV
JMP

01 SK_READ ;

PRoe NEAR CMD BLOCK+6, READ CMD COMMAND I ENDP (AH 003H)

;
0318 0318 0310 0320 c6 06 0048 R 30 E9 04F8 R

= --- --------------------------------------------DISK WRITF ROUTINF


JMP

DISK_WRITE MOV DISK_WRITE

PROC NEAR CMO_BlOCK+6, WR I TE_CMO COMMANDO ENOP

; 0320 0320 0325 0328 032A 0320 032F 0332 0332 Q333 C6 E8 75 E8 75 8 e3 ; ; 0333 0333 0338 0339 033A 0330 0341 0344 0345 0346 0349 C6 06 0048 R 50 06 00'-18 R 40 0544 R 08 05A,) R 03 061 R

DISK VERIFY (AH = 004H) ----------- ------------------------------------PROC NEAR CMD_BLOCK+6, VERI FY_CMO COMMAND VERF EXI T CONTROLLER STI LL BUSY WAITVERF_EXIT ; TIME OUT CHECK_STATUS ENOP

OISK_VERF MOV CALL JHZ CALL JNZ CALL VERF_EXIT:


RET

DISK_VERF

-----------------------------------------------NEAR CMD_BLOCK+6, fMTTRK_CMO FORMAT TRACK (AH

------- ----------------------------------------=
fORMATTING (AH

005H )

06
53 8 0684 R 26: 8A 47 OE A2 0043 R 5B 07 E9 0500 R

FMT_TRK PRoe MOV PUSH PUSH CALL MOV MOV


POP POP JMP

= 005H)

'5 BX

GET_VEC Al,ES:[BX](14] CMO BLOCK+l. AL


BX ES

GET 01 SK PARMS ADDRESS GET SECTORS/TRACK SET SECTOR COUNT I N COMMAND GO EXECUTE THE COMMAND

CMo_OF

fMT TRK ENDP PAGE

; ;
031 19 0349 0349

-------------------------------------READ OASO TYPE (AH = 15H) --- --------------------------------------------LABEL PROC OS NEAR FAR ; ; GET DR I VE PARAMETERS SAVE REG I STERS

---------

lE

READ nASO TYPE REAO::::O.T PUSH

5-108

Disk

034A 03 1 413 03 11C 034F 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

06

53

BB BE 08

----

PUSH PUSH

ES

MOV MOV

ASSUME

e6 06 0074 R 00
8A 1 E 007';1 R 80 E2 7F 3A DA 76 22 E8 0<iB4 R 26: 8A 47 02 26; 8A 4F DE

MOV MOV AND CM? JBE

CALL
MOV MOV I MUL MOV DEC

BX AX, DATA DS,AX DS:OATA DISK_SfA"lUS1,0 BL, Hf _NUM DL,7fH BL,DL no r NO r PRESENT GET-VECAL,ES:IBX][2] CL,ES:[BXIl14]

ESTABLISH ADDRESSING

CET NUMBER OF DR[VES CET DRIVE NUMBER RETURN DR I VE NOT PRESENT GeT 0 I SK PARM ADDRESS HEADS NUMBER OF SECTORS MAX Nur~BER OF CYU NOERS LEAVE ONE FOR D 1AGNO$T I CS NUMBER OF SECTORS HIGH ORDER HALF LOW ORDER HALF INDICATE FIXED DISK RESTORE REGS CLEAR CARRY DR IVE NOT PRESENT RETURN ZERO BLOCK COUNT

E6 E9
26:
49

88 OF

ex,

Cl

ES:] BX]

rl E9
8[\ CA
8~

~lUl

ex

CX

00
RDT2;

28 CO B4 03

MOV MOV SOB MOV

58
0"(

POP
PO? POP

CX, ox DX,AX AX,AX AH,03H BX


ES OS

lf
F8

CI-C

CA 0002

RET

26 CO 813 CB 86 DO
EB F1

ROT NOT PRESENT; -SUB AX, AX MOY CX, AX MOV OX, AX Jl~P RDT2 READ 0 T ENDP PAGe GET PARAMETERS (AH NEAR
FAR

,=

8)

038B 038B 038B 038C 0380 038E 0390 0392 0395 03n 03<)8 0390 03A1 03A4 03/\6 U3A9 U3AC 03AE 0383 03B6 0369 03813 036[ 03r:O 03C2 03C6 03C8 03CC 03CE 0302 03011 0304 0305 0306 0307 030A 030A Q3DF 03E1
O.~F3

GrT PARM
1E

GET-

rAr~M

LABEL PROC
OS ES

GET DRIVE PARAMETERS

06
53 213 CO
BE 08

PUSH PUSH rUSH ASSUME SUB


MOV

SAVE REG I STERS

F6 C2 01 711 06 C'l lE 0118 R EB 014 C4 lE 0104 R


BB

TEST
JZ

BX [)S: A8S0 AX,AX DS,AX DL,l


GO

EST ABL I SH ADDRESS I NG CHECK FOR DRIVE 1

L ES
JMP

GO; Gl;

----

LES ASSUME
MOV MOV SUB

8E 08 BO EA 80 80 fA 02 73 2e C6 06 0074 R 00 26 ; [\13 07 ?D 0002


BA E8

eMP
JAE MOV MOV SUB MOV

25 0300
01 01 EB EO OE

ANa
SHR SHR 01< MOV

26: OA 41

8A Cil 26: 8A 77 02 FE CE BA 16 0075 R 213 CO C5:

I-l0V
DEC MOV SUB POP POP POP RET

BX, HF1_ TBl_VEe SHORT G1 BX, H F_ TBL_ VEe OS; DATA AX, DATA OS,AX DL,80H Dl, MAX_ FILE G4 01 SK_STATUS1, 0 AX, ES; [BX] AX,2 CH,AL AX,0300H AX,l AX, 1 AL,ES:[8X][14] CL,AL DH,ES:[BX1]2] Of! Dl, I1F _NUM AX,AX

[SfA8LISH SEGMENT TEST WI.H[N RANGE MAX NUMBER OF CYL I NOERS ADJUST FOR O-N HIGH TWO B[TS OF CYl

SECTORS HEADS O-N RANGE DR IVE COUNT RESTORE RECI STERS

56
07

ex
ES OS

lf
CA 0002 G4;

2 DISK_STA1US1,INIT FAI L AH,INIT_FAIL AL,Al OX, OX CX,CX


G5

e6 06 0074 R 07
BII 2A 213 213 07 CO 02 C9
eET PARM

03E5 03E7 03ER 03EA

MOV MOV SOB SOB SUB

; OPERAT [ON FA I LED

F9 EB EA

STC
JMP

so

ERROR FLAG

ENOP PACE

INIT[AlIZE DRIVE 03EA 03EA 03EF 03 F2 03 F6 U3F8 03FC 03FF 0401 'INIT DRV MOV
CALL MOV

C6 06 0048 R 91 (8 0684 R 26; 8A 47 02 FE CB 8A 26 001..7 R


80 E4 FO

o[e

PROC NEAR CMO_BlOCK+6. SET _PARM_CMD CfT VEC AL, ES: [BX][ 2]

AL
AH, CMD_BlOCK+5 AH,OFOH AH,AL eMU .)3LOCk+5, AH A[ ,ES:[BXJ[14] eMD BlOCK+1, AL AX,AX CMO BLOCK+3,AL COMMAND [NIT EXIT NOT BUSY [NIT EXIT CHEclCSTATUS ENDP (AH = OAH)

MOV

ANO

OA EO

08
MOV MOV MOV SOB MOV

ES: BX -> PARM BLOCK GE r NUM6EH OF HfAOS CONVERT TO 0-1 NOEX GET SOH RECI STER CHANGE HEAD NUMBER TO MAX HEAD MAX SECTOR NUMBER ZERO FLAGS TELL CONTROLLER CONTROL LER BUSY ERROR WA[T FOR IT TO BE DONE TIME OUT

0405 01 109
040C
O/~OE

88 26 00111 R 26: 8A 1(1 DE


A2 0043 R

213 CO
A2 001j5 R E8 051J4 R

0411 Ol~ 14 0 1416 0419 041B 0111 E 041 E 041 F

15 08
E8 05DF R 75 03 E8 061 E R C3

CALL JNZ CALL


JNZ

CALL
INIT EXIT:

RET INIT_DRV

READ l.ONG

04lF 041 F 0424

c6 06 00118 R 22
E9 04BB R

0421

PROC NEAR CMD BLOCK+6, READ CMO OR ECC MODE COMMAND [ ENOP WR [TE LONG (AH '" OBH)

04;0'[ 04?7 042C 042F

C6 06 0048 R 32 E9 04FB R

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 C6 E8 75 E8 75 E8 80 15 C6
C3

---------------------------------------SEEK (AH = OCH) ---------------------------------------CALL JNZ CAll JNZ CALL CM' JNE MOV 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 ENOP CONTROLLER BUSY ERROR T I ME OUT ON SEEK

04li8
0440

06 0048 R 70 0544 R 14 05A5 R OF 061E R 3E 0074 R 40 05 06 0074 R 00

o I SK_SEE~OV

04liD
044E

OS EXIT: RET DISK_SEEK

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

---------------- -- -----------------------------; TEST DISK READY (AH = 010H)

--- --------------------------------------------NEAR NOT_BUSY TR_EX AL, CMO_BLOCK+5 OX, HF_PORT+6 DX,Al CHECK_ST TR_EX o ISK_STATUS1 ,0

TST_ROY PROC CALL JNZ MOV MOV OUT CALL JNZ MOV

WAI T FOR CONTROLLER SELECT OR I VE CHECK STATUS ONLY ; WI PE OUT DATA CORRECTED ERROR

i:f=~6y ~~bp
; ;

;
0465 0465 046A 0460 046F 0472 0474 04n 047C 047E 0483 0483 0488 0489 C6 E8 75 E8 75 E8 80 75 C6 06 00"'8 R 10 0544 R

-------- ---------- -----------------------------= all -- --- ------------------------------------------RECAll BRATE (AH H) : 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 01 SK_STATUS1 ,0 ENOP START THE OPERATION ERROR WAI T FOR COMPLET ION TIME OUT SEEK NOT CO;.'lPLETE IS OK

14
OSA5 R Of 061E R 3E 0074 R 40 05 06 0074 R 00

80 3E 0074 R 00 C3

HOI SK RECAL MOV CALL JNZ CALL JNZ GALL CM' JNE MOV REGAL_EXIT: CMP RET HO I SK_RECAL

0489 0489 048B 0480 04eF 0491 0493 0495 0498 049A 0490 049F 04AO 04A3 04AS 04A7 04AA 04AIl 04AE 04BO 0482

E4 24 E6 E4 24 (6 8 75 SA 80

A1 BF Al

21
FB 21 050F R 1A 01 F7 90 050F R 80 OF 01 Fl 0080 R 00 01 02 20

EE
8 84 75 SA EC A2 84 3C 74 84

OliB4
04B6 04B6 04BA 0488

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 CO:EXIT: 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 01 SK_STATUSl,AH

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

**

88 26 0074 R C3

CTlR_D I AGNOST I C [NOP


~

RET

-CO;;;';'N~ ~----- ---------------------------------REPEATEDLY INPUTS DATA TIL NSECTOR RETURNS ZERO CHECK_OMA CMD_ABORT OI,BX COMMAND CMO_ABORT CALL JC MOV CALL JNZ CHECK 64K BOUNDARY ERROR OUTPUT COMMAND WAI T FOR DATA REQUEST INT TIME OUT SECTOR SIZE IN WORDS GET THE SECTOR ; CHECK fOR NORMAL INPUT

04BB 04BI1 04SE 04CO 04C2 04C5 01le7 04G1 04CA 04CC 04CF 0402 0403 0405 04DA 04DG 04DF 04E1 04E4 041 04E6 04E8 04EC 04EE 04F1 04F3 04F8 04FA 04fA 04FA

bOM;ANOi;---------------------------------------[8 72 8B E8 75 068F R 3A FB OSli4 R 33 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 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

; ;

WAIT FOR DATA REQUEST GET ECC BYTES GO SLOW FOR BOARD

47
E2 E8 15 F6 15
C3

f9 06lE R 07 06 008C R 80 co

ERROR RETURNED CHECK FOR MORE

COMMANDO REPEATEDLY OUTPUTS DATA TIL NSECTOR RETURNS ZERO

5-110 Disk

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

--------- - -- - - - --- -- -- ----------- - - ----------~-

CHECK DMA CMD ABORT

CHECK 64K BOUNDARY ERROR OUT PUT COMMAND \-IAI T FOR DATA REQUEST TOO LONG MOVE ES 10 OS PUT TH[ DATA OUT fO THE CARD

51,

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

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

COMMAND CMD ABORT WAIT _DRQ TM_OUT DS ES DS CX,2':>60 ox, IIF _PORT

ex

RESTORE OS CHECK FOR NORMAL OUIPUT WAI T FOR DATA REQUEST OUTPUT THE ECC BYTES

WAI T FOR SECTOR COMPLETE ERROR RETURNED CHECK FOR MORE

INT

; ;

COMMAND IHIS ROUTINE OUTPUTS THE COMMAND BLOCK OUT POT 131_ =' STA1US BH '" ERROR REG I STER

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

53 89 U6UU 51 E8 044E R 59 7" DB 80 3E 0074 R 80 74 43

COMMANO PROC PUSH


~10Y

NEAR OX CX,OCLAY_2
CX TST ROY CX COMMAND? 01 SK_STATUS1, TIM[_OUT eMU TIMEOUT COMMANDl SHORT COMMAND!I BX

\oIAI T FOR SEEK COMPLETE AND READY SET I NIT I AL DELAY BEFORE TEST SAVE LOOP COUNT CHECK DRIVE READY 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
-It-lt \ a OELAY NO:- REQU I RED ** RESET I NTERfWPT flAG TURN ON SECOND INTERRUPT CH I P

[2 1'0
Ea 44 58 57 C6 E4 24 LG

E',

06 008E R 00 At BF A1 21

0573
0578 057A 0570 057F 0581 0583
0~85

2'. E6 I3F OA F6 74 AO 24 3C

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

0587 OS8C 058C 058E 05BF 0590 0591 0595 0597 0598 0599 0599 059E 059E 059F 05A4 05A5

EE
47 42 81 FA 01 F8 75 F5 5F C3 C6 06 0074 R 20 58

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

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 AL, l DI] OX,AL

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 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 ZERO FLAG I S SET

DI
DX OX, HF _PORT+8 COMMAND3

RET
CMD f IMEOU r: MOV COHMAIIID4: POP eMP REl COMMAND ENDP ; WAI I FOR

DI
01 SK_STATUS1, BAO_CNTLR
BX DISK_STATUS1,O

80 3E 0074 R 00
C3

SET COND I T I ON CODE

FOR CALLER

I NfERRurl NEAR

05A5 05A5 05A6 05A8 05A9 05AC 05Al 051.30 0'jB5 05137

WAIT
Fa 213 G9 F8 B8 9000 co 15 7? 28 r6 06 008E R 80 75 11 03 20

PROC ST I SUB CLC MOV INT JC TEST JNZ MOV

ex,cx

MAKE SURE I NTt::RRU PTS ARE ON SEI INIIIAL DELAY BEfORE TEST DEVICE WAIT INTERRUPT

wn

AX,9000H 15H

HF INT _FLAG,BOH WT2 BL, DELAY_ 1

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 1 R 00 1 008E R 00 00711 R 00

W12;

w-rx;
WT3: '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 REPORT T I ME OUT ERROR

RET
MOV JMP ENDP

<':6 06 0074 R 80
Ea F3

DISK_STATUS1, TIME_OUT WTX

Disk 5-111

~~
;
05DF 050f 05EO 05E1 05E3 05E5 05E6 05E9 05EB 05EO OSEF OSf1 OSF3 05f5 05FA 05FB 0600 0601 0606 0608
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

----- ---- ----------------------- -----------------------PROC


BX

WAIT-FOR -coNTRoLLER -NOT-SUsY--------------------------NEAR MAKE SURE BL,OELAY_1 CX,CX ox, HF_PORT+7 AL,OX AL, ST_BUSY

NOT_BUSY

NBl:

STi PUSH MDV SUB MDV IN TEST LOOPNZ JZ


DEC JNZ JMP MOV POP CMP RET MOV JMP

INTERRUPTS ARE ON

SET I N I TI AL DELAY BEFORE TEST CHECK STATUS NOT 8USY--LETS GO KEEP TRYI NG FOR A WH I LE

NBI NB2 BL NBI


SHORT NB3 01 SK_STATUS1 ,0 BX
DISK_STATUS1~0

N82: NBX: NB3: NOT_BUSY

SET COND I TI ON CODE fOR CALLER REPORT T I ME OUT ERROR

DISK_STATUSl, TIME_OUT NBX ENDP

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 08 09 f9 06 0074 R 80

WCL1:

MOV MOV IN TEST JNZ LOOP MOV

CX,DELAY_3 ox, Hf_PDRT+7 AL,OX AL, ST_DRQ WCLOK W<L1 DISK_STATUS1, TIME_OUT

GET STATUS WAI T FOR ORQ


KEEP TRYING FOR A SHORT WHILE ERROR

F9
C3 FB C3

STC

RET

WCLOK: WAIT_DRQ
~

CLC RET ENOP

-CHECK- ~~RD -;;j LE-S;:A;:US--------------~ ---------AgL~E.EsgT~_=E~RiRDR


CHECK_51 CHECK_ER 01 SK_STATUS1. 0 ENDP

061E 061E 0621 0623 0625 0627 062A 062A 062F

bHECi(~S;:~i~~----PROC----NEAR--------------------E8 75 A8 74 E8 0630 R

07
01 03 0664 R

80 3 0014 R 00 C3

JTNEZ ST JZ CALL CHECK_51 : CMP

~ WERE tHERE ANY OTHER ERRORS ~~E~~R~~EW~~A~~~NgYTE


NO ERROR REPORTEO ERROR REPORTED SET STATUS FOR CALLER

RET

0630

0630 0630 0633 0634 0637 0639 063B 0630 063F 0641 0643 0645 0647 0649 0648 0640 0611f 0651 0653 0655 0657 0657 0658 065E 0660 0663 0663 0664

-cHEci(-;;ARo-;;iLE-sTATUS-BYTE-------------------7 bHEci(:sT--------PRoc----NEAR--------------------~
BA EC A2 B4 A8 75 B4 A8 75 B4 A6 74 B4 A6 74 B4 A8 75 84

CHECK_STATUS

01f7
008e R 00 80 lA CC 20
III

MOV IN MOV MOV

OX,Hf_PORT+7 AL,DX HF_STATUS,AL AH,D

GET THE STATUS

}~~T
MOV TEST JNZ MOV TEST TEST JZ MOV TEST JNZ MOV CKST_EXIT:

~h~~E~Y~Y
AH,WRITE_FAULT AL,ST_WRTJLT CKST_EXIT AH NOT_ROY AL, ST _READY AL, ST_SEK_COMPL CKST_EXIT AH. DATA_CORRECTED AL, ST_CORRCTO CKST_EXIT AH,D DISK_STATUS1,AH AH,OATA_CORRECTED CKST_EXl AH,O ENDP

If STILL BUSY REPORT OK CHECK fOR WR I TE fAULT CHECK FOR NOT READY CHECK FOR SEEK NOT COMPLETE CHECK FOR CORRECTED ECC

AA 40 DE 40 10 08 11 04 02 00

~~V

~~~~Ag~~~EK

88 26 0074 R 80 FC 11 74 03 80 Fe 00
C3

CMP JZ eMP CKST_EX1 :

MGV

SET ERROR FLAG KEEP GOING WITH DATA CORRECTED

RET

CHECK_ST

0664 0664 0667 0668 0668 066c 066F 0671 0673 0675 0678 061A 0670 0681 0682 0685 0686 0687 068B 06aF

.-----------------------------------------------CHECK_ER PROC NEAR


0008 EO 02 FA B8 0686 R 03 09 2E: 8A 21 88 26 0074 R 5B 80 FC 00 C3 EO 02 40 01 BS 04 SB 10 OA BA EC A2 53 89 DO 72 E2 01 Fl 0080 R CKl :
MOV IN MOV PUSH MOV SHL

; -cHEci(-HARO-F iLE-ERROR-REGJ STER ----------------DX,HF PORT+l AL,DXHF _ERROR, AL BX CX,B AL,l CK2 CKl BX,OFFSET ERR_TBL ax,Cx AH, BYTE PTR CS; I BX] 01 SK_STATUSl,AH BX AH,O

GET THE ERROR REG

..Ie

CK2:
CKEX:

LOOP MOV ADD MOV MOV POP CMP

TEST ALL 8 BITS MOVE NEXT ERROR BIT TO CARRY fOUND THE ERROR KEEP TRYI NG COMPUTE ADDRESS OF ERROR CODE GET ERROR CODE SAVE ERROR CODE

RET
ERR_TBl DB DB DB NO_ERR BAD_AOOR_MARK, BAD_SEEK, BAD_CMO, UNDEF_ERR RECORD_NOT_ n~O,UNOEF _ERR, BAO_ECC, BAD_SECTOR

CHECK_DHA ;

: SURE THAT IT WILL:

-~~~C~,~~b~~ ~~gM~N~Eg~~~~L~.MAKE

06af 068f 0690 0693

; -ES:BX HAS BEEN REVISED TO THE FORMAT SSSS:OOOX ; -OK IF # SECTORS < 80H (7tH I F LONG READ OR WR I TE) ; -OK IF # SECTORS = 80H (7FHI AND 8X <= DOH (04H) ; -ERROR OTHERWISE : bHECK~OMA--~----PROC----NEAR----------------------------50 B8 8000 f6 06 DOllS R 02 PUSH MOV TEST

AX AX, BOOOH

SAVE REGS , AH = MAX /I SECTORS ; Al = MAX OffSE.T

5-112

Disk

0698 069A
0690

711 03
B8 7 F04 3A 26 0043 R CK01:

JZ MOV CMP

CKDl

AX,7F04H
AH,CMD BLOCK+l CKDOK CKD[RR AL,BL CKOERR
AY.

Q6Al Q6A3 OMS


06A7

77 72 3A 72
F8

06 07 C3 03
eKOOK: CKDERR:

JA
JB
eMP

06A9 06AA OMB 06AC


06AD

0662 0683
0684

58 C3 F9 C6 06 0074 R 09 58 C3

JB CLC POP

ECC IS 4 MORE BYTES NUMBER OF SECTORS IT WILL FIT TOO MANY CHECK OFFSET ON MAX SECTORS ERROR CLEAR CARRY NORMAL RETURN

RET

STC MOV POP RET CHECK_DMA

DISK_STATUS1,DMA_60UNDARY INDICATE ERROR


AX

[NOP

~ -;ET-uP-Es~B~=:D~sK-P;RMs------
0684 0684 0686

bET:VEC-;ROC----~E;R- -----------28 CO BE CO

06B8 06BB 0680 06C2 06e4 06e4


06C9 06e9

F6 C2 01 74 07 26: C4 lE 0118 R EB 05
26: C4 lE 0104 R

SUB MOV ASSUME TEST JZ lES JMP LES

AX,AX ES,AX ES:ABSO

GET 0 I SK PARAMETER ADDRESS

DL,l GV a BX--;-HFl .TBL_VEC SHORT GV_EXIT

ES:BX

-> DRIVE PARAMETERS

ES: BX -> DR I VE PARAMETERS

C3

06CA

GV EXIT: RET GET_VEC [NOP ;

. -------------------------------HARD DISK INTERRUPT ROUTINE PRoe PUSH PUSH MOV MOV MOV MOV
OUT JMP OUT

06CA
06CA

HO_I NT

NEAR
AX OS

50
1E B8 ---- R 8E 08 c6 06 008E R FF BO 20 E6 AD B 00

06CB
a6CC

AX, DATA
DS,AX HF I NT FLAG, QFFH Al-:-EOII NT _CTl_PORT ,Al ALL DONE NON-SPEC I Fie ENO OF FOR CONTROLLER #2 WAIT FOR CONTROLLER #1 RE-ENABlE INTERRUPTS OEVI CE POST INTERRUPT

06CF 0601 06D6 06D8 06DA 060G


06DE

INTERRUPT

$+2
OS

E6 20
1F

I NTl eTL PORT, AL


~

POP

06Dr 06EO 06E3

FB
B8 9100 CD 15

Mav

ST'

.NT
POP

AX,910011 15H
AX

06E5
06E6 06E7

58 CF
HD_I NT

IRET ENDP

RETURN FROM INTERRUPT

06E7 06EE
06EE

31 2F 31 31 2F 38 34

DB

, 1/11/84' LABEL BYTE

RELEASE MARKER

END_ADDRESS CODE ENDS END

Disk 5-113

5-114

Disk

TITLE 01/04/84 KEYBOARD BIOS . LIST PUBLIC PUBLIC PUBLIC 0000 CODE EXTRN [XTRf./ EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN [XIRN EXTRN KEYBOARD_I o_1 KB INT 1 K16 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

ASSUMF 0000 0000 0001 0002 0003 0006 0008 COCA COOC OOOE 0010 0012 0013 0014 KEYBOARD !0 1 5TIPUSH PUSH CALL OR JZ
DEC

CS: CODE, OS: DATA PRoe

FAR

; > 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 I NVAL I 0 COMMAND

F. IE
E8 OA 74 FE 74 FE 74

53

.X
K2
AH K3

OS

0000 E 4

DOS

06
CC 45 CC 67

AH,AH K1. AH

JZ
OEC

5.
1F CF

JZ POP POP IRET

OX
OS

;------ READ THE KEY TO FIGURE OUT WHAT TO DO 0015 0019 0010 86 lE 001A R 3B lE 001C R 75 07 B8 9002
CD 15

K1B:

MOV eMP JNE MOV INT

BX, BUFfER_HEAD BX, BUFFER_TAl L K1C AX,09002H 15H

GET PO I NTER TO HEAD OF BUFFER TEST END OF BUFFER IF ANYTHING IN BUFFER DONT DO INTERRUPT 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 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

OOlF
0022 0024 0024 0025 0026 0027 0028 002f 0030 0031 0034 0038 003A 0030 003f 0042 0043 0044 0045 0047 0049 004C 0050 0051 0052

Kl :

F. 90 FA 8B lE 001A R 313 1'E DOle R

STI NOP K1C:

CLl
MOV CMP PUSH PUSHF CALL MOV

53
9C E8 8A 32 80 74
al18A R 1 0097 R 08 E3 07 011

.X

BX, BUFFER_HEAD BX, BUFFER_TAl L

XOR
AND JZ CALL K1A:

MAKE LED BL. KB_FLAG_2 BL,AL BL,07H K1A SND_LEDl

E8 044C R FA 90

5.
74 00 86 07 8 007F R 89 lE OOlA R

CLl POPF POP JZ


MOV CALL MOV POP POP IRET

.X
K1 AX,lBX)

K4 BUFFER_HEAD, BX

5.
1F CF

BX
OS

RECOVER REG ISlER RECOVER SEGMENT RETURN TO CALLER

; ------ ASC I I STATUS 0053 0053 0054 0058 005C 005E 005F 0060 0063 0067 0069 006c 006E 0071 0072 0073 007 11 0075 0076 K2:

FA
8B l [ 001A R 38 lE 001C R 88 07

CLl
MOV eMP MOV PUSHF PUSH CALL MOV XOR AND JZ SK2: CALL POP POpF STI POP PDP BX, BUFFER_HEAD BX, BUFFER_TAl L AX, [BX}

I NTERRUPTS OFF GET HEAD POINTER I F EQUAL (Z:=l) THEN NOTHING THERE SAVE FLAGS

9C

50

AX
MAKE LED BL, KBJLAG_2 BL,AL BL,071-1

E8 048A R SA 1 0097 R 32 08 80 E3 07 74 03

SK2

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

8 044C R

58 90
F.

AX-

SND LEDl

5.
1F CA DOD?

.X
OS

RET

SH I FT STATUS 0079 0079 007C 0070 007E 007F K3: AO 0017 R MOV AL, KB_FLAG GET THE SH I FT STATUS FLAGS RECOVER REC I STER RECOVER REG I STERS RETURN TO CALLER

5.
1F

rop

ax

CF

POP !RET KEYBOARD_I o_1

OS ENDP

Keyboard 5-115

INCREMENT A BUFFER POINTER 007F 007F 0080 0081 0085 0087 008B 0088 008C

"4
43 43 38 1[ 0082 R 75 04 8B 1 E 0080 R K5: C3 Kli

PROC
, NC CMP

INC

JNE
MOV

NEAR BX BX BX,BUfFER END K5 ; BX,BUFFER_START ;

MOVE TO NEXT WORD

IN LI ST

AT END OF !lUFFER? NO, CONT I NUE YES, RESET TO BUFfER BEGINNING

RET
ENOP KEYBOARD
I NTERRUPT ROUT I NE

008C 008C 0080 008E 008F 0090 0091 0092 0093 0094

KB FB

55 50 53 51 52 56 57
1E

0095
0096 0097 009A 009C 009F OOAO OOA2 OOA2 00A4 OOA6 OOM OOAA

06
FC E8 0000 E BO AD E8 0498 R FA 2B C9 E4 64 A8 02 EO FA E4 60 FB

I NT 1 PflOG - STI PUSH PUSH PUSH rUSH PUSH PUSH PUSH PUSH PUSH
CLO

FAR ; BP AX BX ENABLE INTERRUPTS

ex

OX SI 0I OS ES DOS AL,DIS I<BD SH!P_IT FORWARD DIRECTION SET UP ADDRESSING o I SABLE THE KEYBOARD EXECUTE 0 I SABLE

CALL MOV CALL

; ------- WA I T fOR COMMAND TO ACCEPTED DISABLE INTERRUPTS CLI SUB CX,CX 1<8 INT 01: - IN AL,STATUS_PORT ; i\L, I NPT BUF FULL TEST KB_INT_01 WAIT FOR COMMAND TO !3E ACCEPTED LOOPNZ

,N
STI

READ I N THE ClfARACTER ENABLE I NTERRU PTS AGA I N

;--------CHECK FOR A RESEND COMMAND TO KEYBOARD OOAB OOAD 3C FE 74 00


eMP

J E

; ;

I S HiE I NPUT A RESEND GO IF RESENO

; ------- CHECK FOR RESPONSE TO A COMMAND TO KEYBOARD OOAF OOBl 3C fA 75 12 C",lP

JNZ

AL, KB ACK KB_I NT_2

; ;

I S THE I NPUT AN ACKNOWLEDGE GO I F NOT I SSllFD

; ------- A COMMAND TO THE KEYBOARfl WAS 00B3


OOBI~

FA

00B9

80 DE 0097 R 10 9 01E2 R

CLI OR JMP

; KB_FLAG_2,KB_FA; K26 ;

DISABLE INTERRUPTS INDICATE ACK RECEIVED RETURN I F NOT (THIS ACK RETURNED FOR DATA)

------- RESEND THE LAST BYTE OOBC OOBC OOBO OUC2 OOC5 KB FA 80 DE 0097 R 20 E9 01E2 R KB INT 4: - Cli
OR JMP

KB_FLAG_2,KB_FE; K26 '

OJ SABLE INTERRUPTS INDICATE RESFNO RECEIVED RETURN I F NOT (THIS ACK RETURNED FOR DATA)

INT_2: INDICATORS IF CHANGE IN STATE SAVE DATA IN GO GET MODE INDICATOR DATA BYTE

;--------UPDATE MODE OOC5 OOC6 OQC9 OOCD DOCr 0002 0004 0007 0008

50
E8 048A R 8A 1 E 0091 R 32 08 80 (3 07 74 03 [8 0439 R

PUSH CALL
MOV XOR

AND
Jl
CALL UPO;
POP MOV

AX MAKE LED ElL, KB FLAG 2 BL,ALBL,07H UPO

GET PREVIOUS BITS


SEE I F ANY 01 FFERENT ISOLATE INDICATOR BITS I F NO GHANGE BYPASS UPDATE GO TURN ON MODE I ND1CArORS RESTORE DATA IN SAVE SCAN CODE ! N Atl ALSO

58
8A EO

SND LED AX AH,AL

; ------ TEST ()OOA OODC OODE 3C FF 75 03 E9 03D6 R


CMP

FOR OVERRUN SCAN CODE fROM KEYBOARD AL,OFFH

JNZ
JMP

"'6 "6>

IS TH I S AN OVERRUN CHAR NO, TEST FOR SHI FT KEY BUF FER_FULL_REEP

; ------ TEST fOR SH I FT KEYS OOEl OOEl 00[3 DOEll K16: AL,07FH
CS

24 7F DE
07

AND rUSH
POP

TEST SH I FT TURN-OFF THE BREAK BIT ESTABLISH ADDRESS OF SHIFT TABLE

ES
FOR SYSTEM KEY AL, SYS_KEY K16A AH,080H K16C

; ------- TEST

oon
009 OOEC OOEE 00F3 OOF5 aOFA OOFC OOFE 0100 0103 0106 0107 0109 OlOC 010F 0114 0116 0118 011A OlIO 0120 0121

OOE~

3C 54

eMr

75 3D
F6 C4 80 75 21 F6 06 0018 R 04 75 17 80 DE 0018 R 04 BO 20 U.> <'U

JNZ TEST
JNZ

1 SIT THE SYSTEM KEY? CONT I NUE I F NOT

CHECK IF TH I S A BREAK CODE DONT TOUCH SYSTEM I NO I CATOR

I F TRUE

TEST JNZ
OR MOV OUT MOV

KB FLAG 1,SYS SHIFT; SEE IF IN SYSTEM KEY HELD DOWN K16B - ; IF YES, DO NT PROCESS SYSTEM INDICATOR KB_FLAG_1, SYS_SH I FT AL, EO I 020H,AL AL, ENA_KBD SH I PIT AX,08500H 151'1 K27A 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

BO AE
E8 Bf! FB CD E9 E9 0498 R 8500 15 OlEC R 012 R

CA1.l
MOV

S"
K166: K16C:
I NT JMP JMP

"26

80 26 0018 R FB BO 20 6 20

AND
MOV OUT MOV

BO AE E8 0498 R BS 8501 FB CD 15

CALL
MOV

sn

INT

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

5-116

Keyboard

0123 0126 012') 012C 012E 0130 0132

i9 OlEC R

JMP

K27A OI,OffSET K6 ex, OFf SET K6L SCASB


AL,A~I

I GNORE SYSTEM KEY 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

BF 0000 E B<) 0000 E F2/ AE 8A C4 74 03 E9 D1CE R

K16A:

MOV MOV

RE PNE
MOV JF JMP

K17 K25

;------ SHIFT KlY fOUND


013~

013<) OBE OlllO 0142

81 EF 0001 E 2E: 8A A5 0000 E A8 80 74 02 E8 63

K17:

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<EY BREAK SH I FT FOUND CON11NUE

; -------- DETERM I NE SET OR TOGGLE 011HI 0147

80 FG 10 73 07

K17C:

CMP
JAE

AH,SCROI.L_SHI fT
K16

; SET SHIFl ON ; ;

I F SCROLL SH I fT OR ABOVE,

TOGGLE KEY

;------ PLAIN SHIFT KEY, 014') 01 110 08 26 0017 R E9 01E2 R

OR JMf'

KB FLAG, AH K26

TURN ON SHiFT BIT I NTERRU PT _RETURN

; ------ TOGGLED SH I FT KEY, 0150 0150 0155 0151 Ol5A


01~C

TEST FOR 1 ST MAKE OR NOT ; ; ; SH I FT-TOCGLE CHECK en SHI FT STATE JUMP I F NOT CTL STATE

K18: f6 06 0017 R 04 74 03 EB 15 90 3C 52 7':> ?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 K21 : r6 06 0017 R 03
7'1 F3

TEST
JZ JMP eMP

K8 FLAG, K18A

CTL SH I FT -

K18A:

OISE 0163 0165 0168 0160 016F 0174 0176 0176 0179 0181 01H3 0183 0187 0189 018B Ol8F

JN7: TEST
.lZ .lMP

K19:

TEST
JNZ

TEST
JZ

; JUMP IF CTL STATE K25 ; CHECK FOR I NS[RT KEY AL, INS_KEY ; JUMP I F NOT I NSERT KEY K22 ; CHECK ~OR ALlt.KNATE SHIfT KB FLAG, ALT_SHIFT ; JUMP IF NOT ALTERNATE SHIfT K19 K25 ; JUMP I F ALTERNATE Sftl rT KB FLAG, NUM_STATE ; CHECK FOR BASE STATE K21 ; JUMP IF NUM LOCK IS ON ; KB FLAG, LEFT_SHlrT-+ RIGHT_SHIFT JUMP I F BASE STATE K22 AX, 5230H K57 KB_FLAG, K20 ; 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

K20:
MOV JMP

onG onG

TEST
JZ

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<B FLAG 1.AH KB=FLAG~AH If

K22AO:

; ------- TOGGLE LED 0193 0196 01<)8 0199 019C 0190 019F 01Al 01A4

CAPS OR NUM KEY DEPRESSED

,0
56

F6 C4 70 74 OS EB 0439 R 3C 52 75 41 B8 5200 E9 0375 R K22B:

TEST JZ PUSH CALL POP CI-1P JNE


MOV JMP

AH, CAPS_SH I fT+NUM_SH I FT+SCROLL_SH 1FT; SH I fT TOGGLE? K22B GO I F NOT AX SAVE SCAN CODE AND SH I FT MASK SND LEO GO TURN MODE INDICATORS ON AX RESTORE SCAN CODE AL, INS_KEY
K26

AX, I NS_KEY*256
K57

TEST FOR 1ST MAKE OF I NSERT KEY JUMP I F NOT I NSERT KEY SET SCAN CODE INTO AH, 0 INTO AL PUT I NTO OUTPUT BUFFER

; ------ BREAK SH I fT fOUND 01A7 01A7 01AA OlAC alAE 0102 OlBI. K23: 80 FC 10
73 1A eMP

AH, SCROLL_Sil 1fT

JAE
NOT AND eMP

K20
AH Al ~ AL T_KEY+80H K26

F6 04 20 26 0017 R 3C B8 75 2C

KB FLAG,All

JNE

8REAK-SH I FT- FOUND IS THIS A TOGGLE KEY YES, HANDLE BREAK TOGGLE I NVERT MASK TURN OFr SHI fT BI T IS THIS ALTERNATE SHIFT RELEASE INTERRUPT_RETURN GET THE VALUE INTO BUFfER

;- _____ ALTERNATE SHIFT KEY RELEASED, 01B6 AO Blj 88 3C 74 E9 0019 R 00 26 0019 R 00 If D37E R K24: F6 04 20 26 0018 R EB 14 NOT
AND JMP AH KB FLAG _l,AH MOV
~lOV

01B9
OlBB Ol8F 01Cl 01G3 01C6 01C6 0lC8 DICC

MOV eMP JE JMP

AL,ALT_ INPUT AH,O ALT _INPUT,AH AL,O K26 K,8

SCAN CODE oro zmo OUT THE fl ELO WAS THE I NPUT""O INTERRUPT_RETURN IT WASN'T, SO PUT IN BUFFER BREAK-TOGGLE I NV[RT MASK I NO I CA TE NO LONGER DE PRESSEO INTERRUPT_RETURN

SHORT K26

; ------ TEST FOR HOLD STATE 01CE D1CE 0100 0102 0107 K25 : 3C 80
73 7" 10 1E eMP JAE

AL,80H
K26

F6 06 0018 R 08 3C 45 74 05 K26:
FA

TEST JZ
eMP JE AND

dlD9
OlDB

0100
01 E2 01E2 OlD 01 E5> 01E7 01 E7 01 E9 01EC OlED 01 EE 01Ef 0IFO 01FI 01F2 01 f3 01 f4 01f5 01f6

80 26 001B R f7

KB_FLAG_1, HOLD_STATE K26 AL, NUM_KEY K26 ; KB_FLAG_l, NOT HOLD_STATE

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 CAN'T END HOLD ON NUM_LOCK ; TURN OfF THE HOLD STATE BIT

CLI
MOV OUT

BO 20

E6 20
K27: BO Af E8 0498 R
FA 07 1F 5F 5E 5A 59 58 58 50 eF

AL, EOI 020H, AL AL, ENA_KBD SHIP_IT


ES
OS

MOV

CALL K27A:
eLi POP POP POP

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

DI
SI

POP
PDP POP POP POP PDP

D! SABLE
~ESTORE

INTERRUPTS REGI STERS

ex
BX AX BP

OX

I RET

RETURN,

INTERRUPTS BACK ON WITH

fLAG CHANGE

Keyboard

5-117

;------ NOT IN

HOLD STATE ; KB_FLAG.ALT_SHlfT K29 ; K36 ; NO-HOLD-STATE ; ARE WE IN ALTERNATE SHIfT JUMP IF ALTERNATE SHIFT JUMP I F NOT ALTERNATE

01f7 OlF7
Olrc

K26: F6 06 0017 R 06 75 03 E9 0290 R TEST


JNZ JMP

01 FE

;------ TEST FOR RESET KEY SEQUENCE (CTL ALT DEL)

0201 0201 0206 0208


02QA

K29: F6 06 0017 R 04
7~

3C

53

31

75 20

TEST JZ CMP JNE

; 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

020C 0212
0215

C7 06 0072 R 1234
E9 0000 E

MOV JMP

RESET_FLAG. 1234H ; SET FLAG fOR RESET fUNCTION START_l ; JUMP TO POWER ON DIAGNOSTICS

0215 021C
021F

52 4F 50 51 40 47 48 49
16 18 22 24

~B

4C

;------ ALT-INPUT-TABLE K30 LABEL BYTE DB 82, 79~80,61, 75, 76, 77 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 DB DB DB 24,25,30,31.32,33,34.35 36.37.38.44,45,46.47.48

10 11 12 13 14 15

0227
022F

0237

17 19 1 1F 20 21 23 25 26 2C 20 2E 2f 30 31 32

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 AL '

'32

K57

NO-RESET TEST FOR SPACE KEY NOT THERE SET SPACE CHAR BUFFER_fI LL

; ------ LOOK FOR KEY PAD ENTRY 0242 K32: BF 0215 R

0242 0245 0248 024A 024C 0250 0253 0255 0257 0259 025C

B9 DaDA F2/ AE 75 12 81 EF 0216 R AD 0019 R


B4 F6 03 A2 EB OA E4

MOV MOV

REPNE
JNE

OI,OFFSET K30 eX,10 SCASB DI,OFFSET K30+1 AL,ALT_INPUT

SUB
MOV MOV

'33

AH,10
AH

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 ADO I N THE LATEST ENTRY STORE I T AWAY THROW AWAY THAT KEYSTROKE

C7 0019 R
84

MUl ADD
MOV JMP

AX,DI ALT_INPUT.AL

.26

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

MOV MDV

ALT_INPUT,O

CX,26
SCASS

REPNE
JNE MOV JMP

."
'57

AL.O

; 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
K3~:

0273 02((
0275 027A

3C 02 72 DC 3C DE 73 DB

CMP

AL,2 AL,14

JB
CMP JAE

'35

60 (;476
BO 00 E9 0375 R

ADD
MOV JMP

'35 AH,116
AL,a

027C

'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 K35: 3C 3B


CMP JAE

AL,59

0281 0283 02B3


0286

73 03
K36: E9 01 E2 R K37:

.37 .26
AL,71

JMP CMP JAE MOV JMP

0286 0288
d28A 0280

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 K36:

F6 06 0017 R 04 7 1, 62

TEST
JZ

KSJlAG, CTL_SH I FT

ARE WE

'44

NOT-ALT-SHI FT I N CONTROL SH I FT NOT-CTL-SHI FT

0297 0299 029B

3C 46

75 1D
88 89 89 C6
1 E 0080 R

029F
02A3 02A1

1 E OOlA R
1 E 001C R 06 0011 R 80

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

BO E8 CO 28 E9

co

AE 0498 R 1B 0375 R K39:

MOV CALL INT SUB JMP


CMP JNE

AL. ENA_KBD SHIP_IT lBH AX,AX K57 AL,NUM_KEY

ENABLE KEYBOARD EXECUTE ENABLE BREAK I NTERRUPT VECTOR PUT OUT DUMMY CHARACTER BUFFER_F ILL NO-BREAK LOOK FOR PAUSE KEY NO-PAUSE TURN ON THE HOLD FLAG

3C 45
75 26 80 OE 0018 R 08

02BA
02BC

<41
KB_FLAG_'. HOLO_STATE

DR

; -------- ENABLE KEYBOARD 02el 02e3 02C6 02C8 BO E8 BO E6 AE 0498 R 20 20 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

5-118

Keyboard

; ------ OUR' NG PAUSE 02CA 02Cf 0201 0204 0207 0208

I N I ERVAL,

TURN CRT BACK ON 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

80 74 BA AO EE

3E 0049 R 07 07 0308 0065 R K40: ENOl

eMP JE MOV MOV OUT

CRT MODE,7 K40DX,03D8H AL, CRT_MaDE_SET DX,AL

F
TEST JNZ JMP KB FLAG 1, HOLD STATE K40A K27A

0208 0208 0200 020F O?f?

K40A: F6 06 0018 R 08 75 f9 E9 01 EC R K41 : ;------ TEST SPECIAL CASE KEY 55 LOOP UNT I l FLAG TURNED OFF I NTERRU PT RETURN NO EO I NO- PAUSE --

02E2 02E4 026 02E9

3C 75 88 E9

37
06 7200 0375 R

eMP JNE MOV JMP

AL,55 K42 AX,114*256 K57

; ; ;

NOT-KEY-55 START/STOP PRINTING SWITCH BUFFER_FilL

; ------ SET UP TO TRANSLATE CONTROL SH I FT 02[C 02EC 02EF 02F1 02F3 02f6 K42: BB 0000 E 3C 38 72 7E BB 0000 E E9 03CC R MOV eMP J8 MOV JMP ; ------ NOT 02F9 02F9 02FB 02FD 0302 3C 73 F6 74 47 33 06 0017 R 03 62 K44 : eM? JAE TEST JZ BX, OFFSET K8 AL,59 K56 BX, OFFSET K9 K63 I N CONTROL SH 1FT NOT-CTL-SHI FT 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 HANDLE SPECIAL CASES BACK TAB KEY NOT-BACK-TAB SET PSEUDO SCAN CODE BUFFER fiLL NOT-KEY-S5 SET UP TO TRANSLATE CTl IS IT IN TABLE YES, GO TRANSLATE CHAR eTL- TABLE-TRANSLATE CTL TABLE SCAN TRANSLATE_SCAN

;------ UPPER CASE,


0301~

0306 0308 0306 030D 0300 030F

3C OF 75 05 88 OFOO EB 68 K45: 3C 37 75 10

eMP JNE MOV JMP eMP JNE ISSUE

AL,15 K45 AX, 15*256 SHORT K57

AL,55 K46 INTERRUPT TO Al, ENA_KBD SH I P IT AL, EOI 020H,AL 8P 5H BP K27 AL,59 K47 BX, OFFSET K12 K63 BX, OFFSET K11 SHORT K56

NOT-BACK-TAB PR INT SCREEN KEY NOT-PRI NT-SCREEN INDICATE PRINT SCREEN FUNCTION 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 NOT-PRI NT-SCREEN FUNCT I ON KEYS NOT -U PPER- FUNCT I ON UPPER CASE PSEUDO SCAN CODES TRANSLATE_SCAN NOT -U PPER- FUNCT I ON POI NT TO UPPER CASE TABLE OK, TRANSLATE THE CHAR

0311 0313 0316 0318 031A 0318 0310 031 E 0321 0321 0323 0325 0328 0328 0328 032E

BO E8 BO E6 55 CO

AE 0498 R 20 20 05

5D
E9 01E7 R K46: 3C "12 88 E9 38 06 0000 E 03ce R K47 ;

MOV CALL MOV OUT PUSH INT POP JMP


C~lP

J8 MOV JMP

1313 0000 E
E8 41

MOV JMP

;------ KEYPAD KEYS, 0330 0330 0335 0337 OBe K48: F6 06 0017 R 20 75 21 F6 06 0017 R 03 TEST JNZ TEST JNZ

MUST TEST NUM LOCK FOR DETERMINATION

75 21

; 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 033E 0340 0342


034L~

K49: 3C 74 3C "14 2C SB 9 4A oe 4E CMP JE CMP AL,74 K50 AL,78

BASE-CASE SPECIAL CASE FOR A COUPLE Of KEYS MINUS CONVERT OR I GIN BASE CASE TABLE CONVERT TO PSEUDO SCAN MINUS BUFFER_F I LL PLUS BUFFER_F I LL

00
/17 0000 03CE K50: K51 :

.JE
SUB
~lOV

<51
AL,71 BX, OFFSET K15 K64

031~6

0348 0348 03/IE 0351 03')3 0356

JMP MOV JMP MOY JMP

88 11A20 EB 22

AX, 71~*256+'-'
SHORT K57 AX, 78*256+' +' SHORT 1<57

138 4E28
E8 10

;------ MIGHT BE NUM LOCK, 03')8 0358 0350 035F 035F 0361 0364 K52: F6 06 0017 R 03 75 OF K53 ; 2C LI6 88 0000 E EB OB ;-----U366 0366 0368 036A 036C 036E 036E K54: 3C 38 72 04 BO 00 EB 0"( K55: BB 0000 E MOV eMP JB MOV JMP AL,59 K55 AL,O SHORl K57 SUB MOV
Jl~P

TEST SHIFT STATUS

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 REALLY NUtl/ STATE CONVERT aRT GIN MUM STATE TABLE TRANSLATE_C:iAR

AL,70 BX, OFFSET K14 SHORT K56

PLAIN OLD LOWER CASE 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 NOT -LOWER- FUNCT I ON LC TABLE

BX, OfFSET K10

; ------ TRANSLATE THE CHARACTER

Keyboard

5-119

0311 0311 0313

K56: fE C8 2E: D7

XLAT

DEC

AL

CS: K11

TRANSLATE-CHAR CONVERT ORIGIN CONVERT THE SCAN CODE TO ASC II

;------ PUT CHARACTER INTO BUFFER 0315 0375 0377 0319 037C K57: 3C 14 80 711 ff 1f fC fF lA
CM'

AL.-l AH,-l

JE
CM'

'59 '59

JE

BUffER-fl LL IS THIS AN IGNORE CHAR YES, 00 fiOTHING WITH IT LOOK fOR -1 PSEUDO SCAN NEAR_I NTERRUPT_RETURN

; ------ HANDLE THE CAPS LOCK PROBLEM 037E 037E 0383 K58: f6 06 0017 R 40 74 20 TEST JZ KB_fLAG, CAPS_STATE 061 BUffER-f I LL-NOTEST ARE WE IN CAPS LOCK STATE SKIP If NOT

; ------ I N CAPS LOCK STATE 0385 038A f6 06 0017 R 03 74 Of 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 038C 038E 0390 0392 0394 0396 0398 0398 3C 72 3C 77 04 EB 41 15 5A 11 20 00 K59: E9 OlE2 R JMP 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
NOT_CAPS_STATE

CASE

02.

NEAR-I NTERRUPT-RETURN INTERRUPT_RETURN

; ------ 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: 3C 61 72 06 3C 7A 77 02 2C 20 eM' JB eM' JA
SUB

AL K6i AL

'a'

K61

'z'

; LOWER-TO-UPPER ; fiND OUT I f ALPHABETIC ; NOT_CAPS_STATE 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

AL,'a'-'A' BX, BUffER_TAl L SI,BX

K61 :
8B 88 E8 38 14 89 89 FA BO E6 BO E8 B8 CO E9 lE ODIC R f3 007f R IE 00lA R 22 04 IE 001C R 20 20 AE 0498 R 9102 15 alEC R MOV MOV CALL eM' JE MOV MOV

04
BX, BUffER_HEAD

K.2
[Sll,AX BUFFER_TAIL.ax AL, EOI 020H,AL AL, ENA_KBD

eLi
MOV OUT MOV CALL MOV INT JMP

~~~~9~62H
15H
K27A

; ------ TRANSLATE SCAN fOR PSEUDO SCAN CODES 03CC 03CC 03CE 03CE 0300 0302 0304 0306 0306 0308 030A 0300 030f 03EO 03EO 03E2 03E4 03E6 03E9 03EB 03EO 03Ef 03f2 03f4 03f5 03F? 03f8 03fA 80 E6 BB E4 20 20 0082 61 fC 00 61 OOCE fE 02 61 00E5 fE
K62~

K63: 2C 3B K64: 2E: 8A BO EB


D7 EO
SUB

AL,59 CS: K9 AH,AL AL,O

XLAT
Mav Mav JMP

00 9F

057

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

5D
24 EB E6 B9 E2 DC E6 B9 E2 4B

MOV OUT MOV IN PUSH AND JMP OUT MOV LOOP OR OUT MOV LOOP DEC JNZ POP OUT JMP

AL,EOI INTAOO,AL BX,82H AL, KB_CTL


AX

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

K65:

K66:

K67:

AL,OfCH SHORT 5+2 KB CTL,AL CX-;-OCEH K66 AL,2 KB_CTL, AL CX,OE5H K67 BX

75 E9 5.
E6 61 E9 01E7 R
~

K65
AX KB CTL, AL
K27

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

--------- -------- ----------- -- -----------------------------------------------NEAR

50 53 51
SA f8 B3 03 FA 80 26 0097 R Cf

SND_OATA p~~~C PUSH PUSH MOY MOY CLI AND

AX
BX CX BH,AL BL,3

~AVE

REG I STERS

500:

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 0412 0414 0416 0417 2B cg E4 64 AS 02 EO fA 8A C1 E6 60 FB B9 lAOO SUB S05: IN TEST LODPNZ CX,CX AL, STATUS_PORT ; AL, I NPT_BUf_fULL 505 AL,BH PORT_A,AL CX,OlAOOH

WA I T fOR COMMAND TO BE ACCEPTED REESTABLISH BYTE TO TRANSMIT SEND BYTE ENABLE INTERRUPTS LOAD COUNT fOR IOmS+

May
OUT STI MOY

5-120

Keyboard

041A 04H 0421 0423 0425 0427 042C 042E 0433

F6 06 0097 R 30 7":> 00 E2 F7 FE CI3 7S DO 80 OE 0097 R 80 EB 07 F6 06 0097 R 10 74 EE

SOl:

TEST JNZ LOOP

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

501

OTHERWISE WAIT DECREMENT RETRY COUNT RETRY TRANSM J SS I ON

SD2:

DEC JNZ
OR

8l
SOD

JMP 503: S04: TEST JZ POP POP POP

KB_FLAG_2, KB_ERR ; TURN ON TRANSM I T ERROR FLAG SHORT SD4 RETR I ES EXHAUSTED FORGET TRANSM I SS I ON KB_FLAG_2, KB_FA ; SD2 GX BX AX SEE
I F NOT.

IF TH J SIS AN ACKNOWLEDGE GO RES(ND

DIns
0436

0437 0 1138
0439

59 5B 58 e3

RESTORE REG I STERS RETURN. GOOD TRANSM ISS I ON

RET
SNO_DATA ENDP

TH I S ROUT! NES TURNS ON THE MODE SND_LED PROG


FA

I NO I CA TORS.

0439 0439 043A 043F 0441 04I.J6 0448 OI.JI.JA OIII.JC 04 1jC Q4I.JD 0452 0454 0459 01 158 045E 01,15F 0 1462 0I.J67 0466 0470

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 ; SLl -; TURN OFF INTERRUPTS CHECK FOR MODE INDICATOR UPDATE OONT UPDATE AGAIN I F UPDATE UNDERWAY

eLi
TEST JNZ

F6 06 0097 R 40 75 47 80 OE 0097 R 40 BO 20 E6 20 EB 00
FA

OR
MOV

OUT

JMP SND LED1:

eLi

F6 06 0097 R 40 75 34 80 DE 0097 R 40 BO ED E8 03FD R


FA

TEST JNZ

KB FLAG 2,KB PR LED;

OR
SLO:

MOV CALL

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 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 AL, KB_ENABLE SND_DATA ; 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

ell
CALL
AND

E8 048A R 80 26 0097 R F8 08 06 0097 R F6 06 0097 R 80 75 OB


E8 03FD R
FA

OR
TEST JNZ CALL

0472
0475 0476 047B 0470 047F 0482 0483 0488 0I.J89 048A

ell
TEST JZ SL2: SL3: SL1: MOY CALL

F6 06 0097 R 80 74 06
BO F4 E8 03FD R
FA

ell
AND ST!
RET

80 26 0097 R 3F
FB

e3

SNO_LED ENDP

THIS ROUTINES fORMS THE DATA BYTE NECESSARY TO TURN ON/OFF THE MODE INDICATORS
~~~E-~ED-;~~~---NEAR-----------------------------------------------------------

OI.J8A 0118A 0488 Q48E 0490 0492 01194 0I.J96 0497 0498

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 CX ; RETURN TO CALLER

ex

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

50
FA

PUSH AX ; SAVE DATA TO SEN!) ;------- WAIT fOR COMMAND TO ACCEPTED

0499 049A 049C 049C 049E 04AQ 04A2 04A3 04A5

28 C9

ell SUB

CX,CX AL,STATUS_PORT ; AL, I NPT_BUf _fULL SIO

D I SABLE INTERRUPTS CLEAR COUNTER

510:
E4 64 A8 02 EO FA

IN
TEST LOOPNZ
POP OUT

WAIT FOR COMMAND TO BE ACCEPTED GET DATA TO SEND SEND TO KEYBOARD CONTROllER ENABLE INTERRUPTS AGAIN RETURN TO CALLER

58
E6 64
FB

STI

OI.iA6
04A7 04A7

e3

RET
END

SHI P IT ENDP CODEENDS

Keyboard 5-121

5-122

Kevboard

0000

TITLE 09/09/83 PRINT BIOS .LIST I NCLUDE SEGMENT. SRC CODE SEGMENT BYTE PUBL I C 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 ASSUME

MI IS MODIFIED
ALL OTHERS UNCHANGED CS: CODE, OS: DATA PROC
OS OX

0000 0000 0001 0002 0003 0004 0005 0006 0009

PRINTER_'O_1
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

FAR

51 I
PUSH PUSH PUSH PUSH PUSH CALL MOV MOV SHL MOV OR JZ OR JZ DCC JZ DEC JZ B1 :
POP POP POP POP POP I RET

ENTRY POINT FOR ORG OEFD2H I NTERRUPTS BACK ON SAVE SEGMENT

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 BX CX

51

OOOB
OOOf 0011 0015 0017 0019
001~

0010

DOlf
0021 0023 0025 0025 0026 0021 0028 0029 002A

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

5B 59 5E 5A

51
OX OS

1F
CF

:------ PRINT THE CHARACTER IN (AL) 002B 0026 002e 0020 82:
50 EE 42

PUSH OUT INC

AX DX,AL OX

SAVE VALUE TO PRI NT OUT PUT CHAR TO PORT POI NT TO STATUS PORT

; ------- CHECK FOR PR I NTER BUSY OOZE 002F 0030 0032

53
EC A8 80 15 05

PUSH

IN TEST JNZ

BX AL,DX AL,8DH B2_A

GET STATUS I S THE PR I NTER CURRENTLY BUSY OUT_STROBE

:-------0034 0037 B8 90FE CD 15

INT 15 DEVICE BUSY AX,90FEH 15M FUNGT I ON 90 PR I NTER 10

MOV INT

:------ADJUST DUTTER LOOP COUNT 0039 0039 003B 0030 2A FF D1 03 01 03


SUB RCL RCL

BH.BH BX,1 BX.1

CLEAR BH MULT BY 4

;------WAIT BUSY 003F 0041 0042 0044 0046 0048 2B EC 8A A8 75 E2 4B 75


5B

C9 EO

B3: 83_1;

80 DE F7
F2

004A 0046
0040 004E 0051 0054 0056 0057 0059 005A 0056 0050 005F 0060

SUB IN MOV TEST JNZ LOOP DEC JNZ POP OR AND JMP POP MOV INC OUT MOV JMP OUT PDP

CX.CX AL. OX AH,AL Al,80H B4 B3 1 BXB3


BX

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 RESTORE BX ------SET ERROR FLAG TURN OFF THE UNUSED BITS RET URN WITH ERROR fLAG SET RESTORE BX ------OUT_STROBE SET THE STROBE HIGH SET THE STROBE LOW 10 DELAY RECOVER THE OUTPUT CHAR

80 CC 01 80 E4 F9 EB 17
5B

B4:

AH,1 AH,OF9H SHORT B7 BX AL,ODH DX,AL AL,OCH SHORT $+2 DX,AL AX

60 00 42 EE BO OC EB 00

ox

EE
58

PR I NTER STATUS 0061 0061 0062 0062 B5:


50

PUSH B6: MOV

AX

SAVE AL REG

8B 94 0008 R

UX,PRINTI:.R_BASE[SIJ

Printer 5-123

0066 0067 0068 006A 006D 0060 006E 0070 0073

42
EC

SA EO 80 E4 F8 B7:
5A

INC IN MOV AND PDP MOV XOR JMP

OX AL,DX AH,AL AH,OF8H

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

8A C2 80 F4 48 fB BO

.,

OX AL,OL AH.48H

;------ INITIALIZE THE PRINTER PORT


0075 0075 0076 0077 0078 007A 007B 007E 007E 007F 0081 0083 0084 0066 0086 BB:

50 42 42 BO 08
EE

B8 OFAO B9: 48 75 FO BO OC
EE

PUSH INC INC MOV OUT MOV


DEC JNZ MOV OUT JMP PR INTER_I 0_' CODE

AX

OX OX AL,8 DX.Al AX,1000*4


AX

SAVE AL PO I NT TO OUTPUT PORT


SET

INIT LINE LOW

89
AL,OCH DX,AL

I NIT_LOOP LOOP FOR RESET TO TAKE INIT LOOP NO I NTERRU PTS, NON AUTO LF, PRT_STATUS_ 1

IN IT HIGH

EB DC

86
ENDP ENOS
END

5-124

Printer

0000

TITLE DATE 07/06/83 RS232 _ LIST INCLUDE Si::GMENT. SRC CODE SEGMENT BYTE PUBlI C [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

2
STOPB I T

----- BAUD RATE --

- PAR I TY--

--WORD LENGTH--

(Ati)""

(Atl)o:=2

(AH)=3

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

or

(OX) "

PARAMETER

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

;
0000

AI 1 OTHERS UNCHANGED ----- ----- --- - - CS:CODE,DS;UATA -- --- ------- ------- --- - - - - - -- --- --ASSUME PROC FAR

;------ VECTOR 10 API'IWf'RIATE ROUTINE 0000 0001 0002 0003 0004 0005 0006 0007 0009 OOOB 0000 0010 0014 0016 0018 D01A 001C 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 A2; FE CC 75 03 E9 00B6 R A3; 5B 59 5F

STI PUSH PUSH PU5H PUSH PUSH PUSH MOY MOY SHL CALL MOY
DR

OS

I NTERRUPTS BACK ON SAVE SEGMENT

OX

ex
BX

SI 01

51,DX OI,DX SI,l


DOS

RS232 VALUE TO 51 AND TO DI (FOR TIMEOUTS) WORD OFFSET

JZ
OR

OX,RS232_BASE[ S I DX,DX A3 AH,AH

DOlE
0020 0022 00211 0021, 0026 0028 0023 002B 002e 0020 002E D02F 0030 0031

JZ DEC JZ DEC JZ DEC JNZ JMP POP POP POP POP POP POP IRET

Al,
AH

A5

Afl
A12
AH

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 TEST FOR (AH)=3 COMMUNICATION STATUS RETURN FROM RS232

A3 A18

cx
01 SI

8X

5E
5A 1F CF

ox
Os ; RETURN TO CALLER, NO ACT I ON

INITIALIZE THE COMMUNICATIONS PORT 0032 0032 0034 0037 0039


r~ov

8A EO 83 C2 03 80 80 EE

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 C2 1:2 DOOt:
r~ov

0"

MOY
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

BF 0000 E 03 FA 8B 94 0000 R 42 2E: 8A 45 01 EE 4A EB 00 2E: 8A 05

MOY
ADO

MOV

DI,OFFSET A1 DI,DX g~, RS232_BASEf S I AL,CS:[DI]+1 DX,AL

BASE OF TABLE PUT J NTO J NOEX REG I STER POINT TO HIGH ORDER OF DIVISOR

INC
MOV
OUT DEC JMP

GET HIGH ORDER OF DIVISOR


SET MS OF DIY TO

OX
SHORT $+2 AL,CS:[DI] DX,AL OX,3 AL,Ati AL,OlfH DX,AL 10 DELAY GET LOW ORDER OF DIVISOR SET LOW Of DIVISOR GET PARMS BACK STRIP OFF THE BAUD BITS I I NE CONTROL TO 8 BITS 10 DELAY I NTERRUPT ENABLES ALL OFF
(;UM~STATUS

MOY
OUT AOO

EE
83 C2 03 8A C4 24 IF FE

OOSA
0050 005F 0061 0062 0063 0064 0066

MOV
AND

OIJT
DEC DEC JMP

4A
'IA EB 00

OX OX SHORT $+2
AL,D aX,AL

60 00
EE

MOV
OUT JMP

0068 0009

1:.13 46

::>HOHJ A18

;------ SEND CHARACTER 006B 0066 006C 006f 0071 0072 0073 0074 AS: 50 83 C2 04 BO 03 EE 42 PUSH
AX

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 DATA SET REA[)Y & CLEAR TO SEND

AOD
MOV

our

DX,4 AL,3 OX,AL

42
B7 30
E8 DOCS R 74 06

0076
0079 0076

I NC INC MOV CALL

ox

OX
BH,30H WA I T_fOR_STATUS

ARE BOTH TRUE


YES, READY TO TRANSMIT CHAR

JE

A9
CX AL, CL AH, BOH A3 OX

A7:
POP MOV A8: OR JMP RELOAD DATA BYTE 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

007B
007C 007E 007E 0081 0083 0083 0084 0084 0086 0089 0088 0086 008E

59
8A Cl

80 CC 80 EB A8 A9:
4A A10: 67 20 E8 DOCS R 75 FO All: 83 EA 05 59 8A C1 EE EB 97

DEC

MOV CALL

BH,20H
WAIT_FOR_STATUS A7

JNZ
SUB

POP

cx

OX,5

008F
0091 0092

MOV
OUT

JMP

AL. CL DX,AL A3

IN AH

RECE I VE CHARACTER FROM COMMO II NE 0094 0094 0097 A12: 83 C2 04 BO 01 EE 42 42 A13: A[)O MOV OUT I/IIC DX,4 AL,1 OX, AL OX MODEM CONTROL REG I STER DATA TERMINAL READY MODEM STATUS REGISTER 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

0099
009A 0096 D09C

I NC
MOV
CALL JNZ A15: DEC A16;

ox

00ge
D09E OOAl DOA3 OOA3 00A4 00A4 OOA6 00A9 OOAB (JOAB

67 20
E8 OOC5 R 75 DB

BH,2QH
WAIT FOR STATUS AB -

4A

ox
BH,l WAI T fOR_STATUS A8 AH,OOOl1l10B RS232_BASE[ S I AL, OX A3

87 01
E8 DOCS R 75 03

MOV CALL JNZ Al7:


AND MOV
f/ll

OOAE
00B2 0063

80 Ell 1 E 86 94 0000 R EC E9 002B R

ox,

JMP

COMMO PORT STATUS ROUT I /liE 00B6 00B6 A18: 8B 94 0000 R 83 C2 05


EC

OOBA OOBO
OOBE

8A EO

OOCO OOCl
OOC2

42
EC

E9 002B R
,

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

MOV ADD IN MOV I NC 1N JMP

RS232_BASE[ 51] OX,5 AL,OX AH,AL OX AL, OX A3

ox,

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

; ENTRY: ; ;EXIT; ; OOC5 DOCS

~~!~T~?~S S~~H~) R?gT~~~K

FOR,

~; ~ ~ ~~~ -;~; ~us ;~~c8A 90 D07C R MOV

OX=ADDR. OF STATUS REG ZERO FLAG ON =: STATUS FOUND ZERO FLAG OFF = TIMEOUT. AH=LAST STATUS READ

- -BP
BX

-~ ~~~-

-------------;LOAD OUTER LOOP COUNT SAVE BP -----SAVE BX -----USE BP fOR DUTTER LOOP COUNT STRIP HIGH BITS MULl DUTTER BY 4

BL,RS232_TIM_OUT[DI]

; ------ADJUST DUTTER LOOP COUNT OOC9 GOCA OOCB OOCC 0000 0002 OOD4 0006 0007 00D9 OODB DODD OOOF OOEl 00E2 00E4 00E6 00E6 55 53 50 81 E5 DOff D1 D5 01 05 PUSH PUSH
POP AND

BP
BP,OOfFH

RCL RCL WFSO: wrSl; SUB IN MaY


AND CMP

BP,l
BP,1

2B C9
EC 8A 22 3A n E2 EO C7 C7 07 F5

ex,cx
AL, OX AH,AL AL,BH AL,6H WFS END \-IFSl

JE
lOOP
DEC

;GET STATUS ; MOVE TO AH ; ISOLATE BITS TO TEST ; EXACTLY = TO MASK iRETURN WITH ZERO FLAG ON ;TRY AGAIN ; SET ZERO FLAG OfF RESTORE BP -----

40
75 fO OA Ff WfS END: 50
-

BP
WFSO BH, BH

JNZ OR
PO?

Don
00E8 00E8 00E8

C3

RET

BP

WAIT fOR STATUS ENOP RS232_IO:=1 ENDP CODE ENDS

5-126

RS232

TITLE 08/18/83 VIDEOl . LIST

includes are

postequ,src,

dseg.src

0000

I NeLUN 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 VIDEO 10 1 EQU 601 OH

0010

PUBLIC M4

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 ENABUO -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 ,CHAR!

(AL)

BL STR I NG CURSOR
(AL) (AL) STR I NG CURSOR NOTE:

IS

ATTRIBUTE lCHAR,CHAR, I S MOVED

,CHARI ,CHAR,ATTRl ,CHAR,ATTRl

! CHAR, ATTR, CHAR, ATTR STR ING IS CURSOR I S NOT MOVED


CHAR, A TTR, CHAR, ATTR IS I S MOVED

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 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 CS: CODE, OS: OAT A, ES: V IDEO_RAM

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

R
R R R R R R R R

R R
R R R R

R
R R R R
Ml L

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

; 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

0028 0028 0029 002A 0026 002C 0020 002E 002F 0030 0031

FB FC 06 1 52 51 53 56 57 55

VIOO_'O_l ST I

PROC

NEAR

eLD
PUSH PUSH PUSH PliSH PUSH PUSH PUSH PliSH PUSH MOY
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

ex
SI 01

OX

BX

BP
AX

0032
0033

50
8A C4 32 4

0035 0037
0039 0038 003E 0040 0041 0044

XOR
SAL MOY
eMP

AL,AH AH,AH

01 EO
8B FO lD 0028 72 04 58 E9 0144 R M2: E8 88 88 81 0000 E B800 3E 0010 R E7 DOlO FF 30 02 M3:

AX,1
51 ,AX AX,M1L

JB POP
JMP

M2

AX
VIDEO_RETURN
ODS

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 SEGMENT GET EQU ISOLATE IS SElT FOR COLOR CARD I PMENT SETT I NG CRT SWITCHES I NG FOR BW CARD?

I N RANGE

0044
0047 OD4A 004

CALL MOY MOY


AND eMP

0052
0055

83 75
58
80 75 55 8B BE

JNE
MOY MOV POP
eMP

0057
0059

64 BO
8E CO FC 13 07 EC 46 10

AX,OB800H DI,EQUI PJLAG DI,30H DI,30H M3 AH,OBOH E5,AX


AX

0056

SEGMENT FOR 8W CARD SET UP TO POINT AT VIDEO RAM AREAS RECOVER VALUE TEST fOR WR I TE STR! NG OP If IT'S WRITE STRING THEN GET THE STR I NGS SEGMENT, SINCE I T GET CLOBBERED

Dose
005F 0061 0062 0064

JNE
PUSH MOY MOY

AH,13H MM'

BP BP,S? ES,[BPIES_POS

5-128 Video

0067 0068 0068

50 MM3: 8A 26 0049 R 2: FF A4 0000 R

POP MOV
J~lP

BP AH,CRT_MOOE ; GET CURRENT MODE WORD PTR CS:[SI+OffSET Ml] ENOP INTO AH

D06e
0071

VIDEO_IO_l

SET_MO~~IS
; ; ; ; ; 0071 0071 0074 0076 0079 0078 0070 0080 0082 0084 0087 008B
OOBC

ROUTINE INIT1ALlLES THE ATTACHMENT TO I NPUT THE SELECTED MODE. THE SCREEN I S BLANKED. (AL) = MODE SELECTED (RANGE 0-9)

OUTPUT

- ---- --------------------- - -- -------- - MOV MOV CMP

NONE

----

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


50 52

PROC NEAR f)X,03D4H BL,O DI,30H


M8

JNE
MOV MOV

INC

M8:

MOV
MOV MOV

0080 008E 0091 0093 0094 0095 0097 0099 0090 009E OOAl OOA4 OOA6 00A8 OOAB OOAD OOAF 00B2 0084

PUSH PUSH PUSH


AOO MOV OUT

AL,7 OX,03B4H BL AIi,AL CRT MODE,AL ADDIC6B45, OX OS


AX OX

83 C2 04 8A e3

EE
5A

OX,4 AL, BL DX,AL


OX

28 CO 8E 08

POP SUB
MOV

C5 1E 0074 R
58

ASSUME LOS
POP

AX,AX DS,AX DS:ABSO PARM_PTR

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

ax,

AX

ASSUME B9 80 72 03 80 72 03 80 72 03

DOlO
FC 02 10 D9 Fe 04 09 09 FC 07 02 09

MOV CMP JC ADO CMP JC AOO CMP JC AOO

OS:CODE CX,M4 AH,2 M9 BX,CX AH,11 M9 BX,CX AH,7 M9 BX.CX

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 00B7 00B8 OOBA OOBe DOBF ODCl DOC') M9:
50 06

PUSH PUSH CO CO 47 OA EO A3 0460 R


XOR MOV MOV

AX

OUT IN IT SAVE MODE [N AH

33 8E 88 86

XCHG ASSUME
MOV

26:
07

ASSUME
POP XOR

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 AH,AH ; AH WI LL SERVE AS REGISTER NUMBER DURING LOOP THEN VALUE fROM TABLE

Ooc6 ooca oocs


OOCA OOCB OOCC aOCE
~ODO

32 E4

LOOP THROUGH TABLE, OUTPUTTTING REG ADDRESS, M10: 8A C4


MOV OUT

EE
42

AL,AH DX,AL
OX

INIT LOOP GET 6845 REGISTER NUMBER 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

FE Cl~ BA 07

INC INC
MOV OUT

AH

0001 0002 0003

EE 43
4A [2 58

INC
OEC

AL, [BX] DX,AL BX


AX

f3

0005
0006

LOOP POP
POP

"'0
DS

OX

IF
;-~----

ASSUME

OS; DATA

FILL REGEN AREA WITH BLANK


XOR MOV MOV MOV CMP JC CMP

0007 0009 DODD 00E2 00E5 OOEa OOEA 00 ED OOEF OOFl OOF3 00F3 OOF5 OOF5 OOF8 OOf8

33 89 C6 B9

80

72 80 74 33 EB 05

fF 3 004E R 06 0062 R 00 2000 fe 04 DB FC 07 04 CO

01,01 CRT_START,OI ACT IVE _PAGE,O CX,8192 AH,4


M12

AH,7
M11

JE
XOR JMP

AX,AX SHORT Ml3 CH, 08H


AX,

Mll:
MOV

B5 06 M12: 88 0720 M13:

MOV

'+7*256

f3/

AB

REP

STOSW

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

;----- ENABLE VIDEO AND CORRECT PORT S[TTING OOfA

ooro

DOFf 0101 0105 0108

AD 0049 R 32 E4 88 Fa 8B 16 0063 R 83 C2 04 2E: SA 84 0000 E

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

MOV
OUT MOV

AL, CS: I S I + OfFSET BYTE PTR M7J DX,AL CRT_MOOE_SET ,AL ; ; SET V IDEO ENABLE PORT SAVE THAT VALUE

0100
OlOE

EE
A2 0065 R

;----- 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 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 011B


81

E6 OOOE

ANa

SI,OEH

WORD OFFSET I NTO CLEAR LENGTH TABLE

Video

5-129

011F 0124 0128 0128 a12E 012F 0130 0132

2E: 88 8C 0000 E 89 OE 004C R 89 0008 Bf 0050 R IE

MDV MDV MDV

CX,CS:ISI

+ OFFSET M5]

LENGTH TO CLEAR SAVE LENGTH OF CRT -- NOT USED FOR BW CLEAR ALL CURSOR POS tTl ONS ESTABL I SH SEGMENT ADDRESS I NG FI LL WITH ZEROES

tolOV PUSH
POP

CRT_LEN, CX CX,8 01, OFFSET CURSOR POSN


OS -

07
33 CO f3/ A8

XDR REP

ES AX,AX STOSW

SET UP OVERSCAN REG I STER

0134 0135 0137 013C 013E 0140 0141

,,2
SO 30 80 3E 0049 R 06 75 02 80 3F
EE M14:

INe
MDV

OX
AL,30H CRT_MODE,6 M14 AL,3FH DX,Al CRT_PALLETTE.AL

eMP

JNl
MDV

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

50 5F

"

5. 59 5A
IF

VIDEO RETURN: POP PDP POP POP


POP POP POP POP

13P
01 SI BX

ex ox
OS

07 eF

ES
ENOP

SFT_MOOF

;
; ; ; ;

-- --- CTVPE -- --- - ---------------------- --- -- -------- -- - SET


I NP~T TH I S ROUT I NE SETS THE CURSOR VALUE (CX) OUTPUT NONE MOV MOV CALL JMP HAS CURSOR VALUE eH-START LINE,

IRET

RECOVER SEGMENTS ALL DONE

CL-STOP LINE

014D 0140 014F 0153 0156

ET-CT~;E-------P~OC----NEA~-------------------------

B4 OA 89 OE 0060 R E8 0158 R EB EC

MI,10
CURSOR_MODE, CX M16 VIDEO_RETURN

; 6845 REGISTER FOR CURSOR SET


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

8B 16 0063 R
8A c4 EE

MDV MDV OUT

ox. ADOR_6845 AL,AH DX,Al


DX
SHORT $+2 AL.CH OX,Al

42 EB 00 8A C5
EE

INC

JMP
MDV OUT

ADDRESS REGI STER GET VALUE REG I STER SET DATA REG I STER 10 DELAY DATA 10 DELAY POINT TO OTHER DATA REGISTER SET FOR SECOND REG I STER
10 DELAY SECOND DATA VALUE

4A
E8 00 8A Ct. FE CO EE

DEC JMP
MDV

OX
SHORT $+2 AL,AH AL OX,Al

INC
OUT

42
[B

00

INC JMP
MOV OUT

OX
SHORT $+2 Al,Cl DX,Al ENDP

8A Cl

E[
C3

RET
SET.CIYPE

ALL DONE

0174

--------- ---- --- --------- --------------- ---SET CPOS


INPUT OUTPUT CURSOR IS SET AT 6845 IF DISPLAY PAGE IS CURRENT DISPLAY 1 HIS ROUT I NE SETS THE CURRENT CURSOR POS I T ION TO THE NEW x-v VALUES PASSED

ox BH -

ROW, COLUMN OF NEW CURSOR 0 I SPLAY PAGE OF CURSOR

0171, 0174
017(, 01"/8

SET
8A CF 32 ED 01 E1 88 F1

CPOS

lolOV

XDR
SAL
MOV MDV

017A
017C

0180 0181,
0186

0188 0188 0188 0180

89 94 0050 R 38 3E 0062 R 75 05 81::1 G2 E8 0180 R


EB 87

eMP

JNl
MOV

PRoe NEAR CL,BlI CH,CH ; CX,l ; S I,CX ; [ S' +OFFSET CURSOR ACT I VE_PACE, BH Ml7 AX, OX

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

CALL

M1B
V IDEO_RETURN ENOP

;------ SET CURSOR POSITION,

AX HAS ROW/COLUMN FOR CURSOR DETERMINE LOCATION IN REGEN BUFFER

0180 0180 0190 0192 0196 0198 019A 0190 019E

M18

E8 88 03 01 84 E8
C3

0211 R C8 DE 004E R F9

OE 0158 R
M18

PROC CAll MOV ADD SAR r-10V CALL

NEAR POSITION CX, AX CX, CRT START CX,l-

AH,14 M16

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

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

ENDP

Q19E

kEAD-~~~;~R-----;~OC----NEAR----------------

019E 01 AD 01A2 01A4


alAS

OlAC
OlAo

32 01 88 88 50
5F

8A OF FF

E3 97 0050 R DE 0060 R

OlAE OlAF 0180

5E 58 58

l:i.l10

01Bl 01B2 01B3 01B4 0185

58 1F 07
CF

POP

por

POP IRET READ_CURSOR

AX DS ES

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 AL HAS THE NEW ACT I VE 0 I SPLAY PAGE OUTPUT THE 6845 IS RESET TO DISPLAY THAl PROC NEAR ACTIVE PAGE,AL CX, CRT=LEN
AX

PAGE

0185 0185 01S8


01BC

A2 0062 R
8S DE 004C R

ACT DISP PAGE MOV MOV


eBW

01Bo 01B
OlCO

98 50
F7 [1
A3 004E 8B C8 01 F9

PUSH
MDL

ex
CRT _START, AX

01e3 01CS 01C7 01G9 01GC


01GD

01GF 0103 01D6


0109

B4 E8 58 01 88 E8

DC 0158 R
3 87 0050 R 0180 R

MOV MOV SAR MOV CALL


POP

eX,AX eX,l AH,12

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

SAL MOV CALL


JMP

E9 0144 R

ACT_DI SP_PAGE

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
AD 0066 R OA FF 75 OE

ADO
MOV
OR

PROC NEAR OX, ADoR_6845 oX,5 ; AL, CRT_PALLETTE ; BH,BH ;

JNZ

H20

I/O PORT FOR PALETTE OVERSCAN PORT GET THE CURRENT PALLETTE VALUE IS THIS COLOR OUT PUT COLOR 1

a?

; ------ HANDLE COLOR

BY SETT I NG THE BACKGROUND COLOR 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

01ef 01 E9 01 EC OlEE 01 EE 01 EF

24 EO 80 E3 1F OA C3 M19;
EE

AND AND

OR
OUT

AL,OEOH BL,Ol FH AL,8L

01f2

A2 0066 R E9 0144 R

MOV
JMP

OX, AI_ ; CRT PALLETTE,AL ; V IDEO_RETURN

; ------ HANDLE COLOR 1 BY SELECT I NG THE PALLETTE TO BE USED

01f5

M20:

on9

01F5 01F7

24 OF
DO

AND SHR

73 F3
DC .20

JNe
OR
JMP

01 rI3

OHD
OlFF

"'9 AL,2011
"'9 ENDP

AL,ODFH BL,1

EB EF

TURN OFF PALLETTE SELECT BIT TEST THE LOW ORDER BIT OF BL ALREADY DONE TURN ON PAtLETTF SFLFCT BIT GO DO IT

SET_COLOR

: ; ; ;

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 PROC NEAR AH, BYTE PTR CRT_COLS AL,CRT_MODE BH, ACT IVE_PAGE
GET NUMBER OF COLUMNS CURRENT MODE GET CURRENT ACT I VE PAGE RECOVER REG I STERS

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

\IIDEO STATE MOV MOV


MOV POP POP

BP 01

POP

POP
JMP

ex

SI

roll 5
ENDP

DISCARD SAVED BX RETURN TO CALLER

VI OED_STATE

;
;

POSITION THIS SERVICE ROU1INl CALCULATES THE REGEN BUFFER ADDRESS INPUT OF A CHARACTER IN THE ALPHA MODE
AX

= ROW,

COLUMN POSITION IN REGEN BUFFER

OUTPUT AX'" OFFSET OF CHAR POSITION 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

0211
0211 0212

POSITION 53 8B 8A F6 32 03 5B C3 POS I T I ON 08 C4 26 004A R PUSH MOV MOV


MDL

021!, 0216
021A 021C

FF
C3

XOR
ADD

021E 0220 0221 0222

01 EO

SAL POP RET

*"

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 0225 0228 022A 0220 022F 0232 0232 0233 0235 0238 023A 023e 023 0240 0240 02113 0245 0247 0249 02<IB 024B 024C 024E 024E 0251 0253 0255 0257 0257 025A 025F 0261 026 11 0267 0268 0268 0268 026B 026[) 026F E8 0303 R

80 FC 04
72 08 80 FC 07 74 03 E9 0405 R N1 :

CfojP

AH,4
N1

JC
eMP

JE
JMP

AH,7 N1 GRAPHICS_UP
BX

TEST FOR GRAPH I CS MODE HANDLE SEPARATELY TEST FOR BW CARD UP CONTINUE SAVE FILL ATTRIBUTE UPPER LEFT POSITION DO SETUP FOR SCROLL BLANK FIELD FROM ADDRESS II ROWS I N BLOCK II ROWS TO BE MOVED ROW LOOP MOVE ONE ROW

53

88 Cl E8 026F R
74 03 8A 2A 31 FO E6 E3 N2: E8 02B6 R 03 F5 03 FD FE cc 75 F5 N3:

PUSH NOY CALL

IN BH

JZ ADO
MOV
SUB

AX,CX SCROLL POS I T I ON N7 SI,AX AH,DfI AH,BL N10 SI, BP 01, BP


AH

CALL

ADO ADO DEC JNZ


PDP MDV

N2
AX

58 BO 20 N4:
E8 02BF R

AL,
N11 01, BP

CALL

03 FD
FE CB 75 F7 N5: E8 0000 E 80 3E 0049 R 07 7It 07 AO 0065 R BA 0308 EE N6: E9 0144 R 8A DE EB DC

ADO
DEC JNZ CALL
eMP

BL
N4

POINT TO NEXT LINE I N BLOCK COUNT Of LINES TO MOVE ROW_lOOP CLEAR_ENTRY RECOVER ATTRIBUTE IN AH FILL WITIi BLANKS CLEAR_LOOP CLEAR THE ROW POINT TO NEXT liNE COUNTER OF LI NES TO SCROLL CLEAR lOOP SCROLL_END IS TH I S THE BLACK AND WH I TE CARD I F SO, SKI P THE MODE RESET GET THE VALUE OF THE MODE SET ALWAYS SET COLOR CARD PORT V IDEO_RET _HERE

DOS
CRT_MODE, 7 N6 ; AL, CRT MODE SET DX,03DBH DX,AL

Mav
MOV
OUT JMP

JF

V IDEO_RETURN

Bl, DH
N3 ENDP

BLANK_F I ElO GET ROW COUNT GO CLEAR THAT AREA

; ----- HANDLE COMMON SCROLL SET UP HERE 026F 026f 02711 0276 0276 SCROLL POSITION PRDC NEAR - eMP CRT_MODE,2 JB N9 eMP CRT_MOOt, 3 JA N9 0270 027E 0281 0282 0282 0283 028') 80X25 COLOR CARD SCROLL rUSH MOV PUSH
OX

80 72 80 77

3E 0049 R 02 19 31:: 0049 I{ 03 12

TEST FOR SPECIAL CASE HERE HAVE TO HANDLE 80X25 SEPARATELY

52 SA 030A 50 EC A8 08 74 FB BO 25 SA 0308 EE 58 5A E8 0211 R 03 06 004E H 88 f8 88 FO 28 01 FF C6 Ff C2 32 ED 88 2E DOLi A R 03 EO 8A C3 F6 26 004A R 03 CO

OX,3DAH

GUARANTEED TO BE COLOR CARD HERE

AX

0281
0289 028C 0280 OZ8E 028f 0292 0296 0298 029A 029C 029E

02AD
DZA?, 0?A6 02A8

02AA
OZAE 02BO 02B1 02B2

06
1F

02B5
02B6 02136 0286

80 fB 00 C3

WAIT DISP ENABLE GET PORT AL,I)X WAIT FOR VERTICAL RETRACE AL,8 WA I T _0 I SP _ENABLE .JZ N8 MOY Al,25H MOV OX,0308H OUT OX, AL TURN OFF Y I OEO POP AX OUR I NG VERT I CAL RETRACE POP OX N9: CAll POSITION CONVERT TO REGEN POINTER ADD AX,CRT START OFFSET OF ACTIVE PAGE MOV 01 ,AX TO ADDRESS FOR SCROLL MOV 51 ,AX FROM ADDRESS FOR SCROLL SUB OX,CX OX = gROWS, HCOlS I N BLOCK INC DH INC DL I NCR[~lENT FOR 0 OR I G J N XOI{ CH,CH SET HIGH BYTE OF COUNT TO ZERO MOV BP, CRT COlS GfT NUMB[R OF COLUMNS I N a I SPLAY ADO [1P,BP TIMFS? FOR ATTRIBUTE BYTE MOV AL,BL ; GET LINE COUNT MUL BYTE PTR CRT COLS ; DETERMINE orFSET TO fROM ADDRESS ADD AX,AX *2 FOR ATTRIBUTE BYTE PUSH ES ESTABLISH ADDRESSING TO REGEN BUFfER POP OS fOR BOTH PO INTERS CMP BL,O 0 SCROLL MEANS BLANK F I [LO RET RETURN WITH FLAGS SET SCROLL_POS I T I ON [NOP

N8:

IN TEST

8A CA

02B8
0289 02BA OZBC 02BO 02BE 02BF

56
57 F3/ A5 5F C3

"

; ------ MOVCROW N10 PROC N[AR MOV CL,OL PUSH SI rUSH DI REP MOVSW POP DI POP SI
RET

GET

OF COlS TO MOVE

SAVE START ADDRESS MOVE THAT LI NE ON SCREEN RECOVER ADDRESSES

N10

ENDP

02lH 02BF 02Cl Q2C2


02CI~

02C5 02C6

8A CA 57 F3/ AB 5F C3

; ------ CLEAR_ROW N11 PKOG NEAR MaY CL,DL PUSH 0I REP srosw

GET

COLUMNS TO CLEAR

STORE THE FILL CHARACTER

pooP

01

RET
Nl1
ENDP SCROLL DOWN THIS ROUTINE MOYES THE CHARACTERS WITHIN A DEFINED BLOCK DOWN ON THE SCREEN, FILLING THE TOP LINES WITH A DEFINED CHARACTER INPUT (AH) ::: CURRENT CRT MODE (AL) ::: NUMBER OF LI NES TO SCROLL (CX) '" UPPER LEFT CORNER OF REG I ON (OX) = LOWER RIGHT CORNER OF REGION (BH) :: FILL CHARACTER (OS) =: OAf A SEGMENT (ESj =: REGEN SEGMENT OUPUT NONE -- SCREEN I S SCROLLED

02C6 02C6 02C7 Q2CA 02CD

FD E8 0303 R 80 FC 04 72 08

SCROLL DOWN - STO CALL


CMP

PROC AH,4N12

NEAR

TEST LINE COUNT; ;

a I RECT I ON

FOR SCROL_L DOWN

TEST FOR GRAPHICS

JC

5-132

Video

02CF 02D2 02011 0207 0207 0208 020A 0200 02DF U2E1 02[3 02E5 02E5 02E8 02EA 02fC 02EE 02FO 02rO 02Fl 02F3 02F3 O?F6 02F8 02FA 02FC 02FF 02FF 0301 0303

80 FC 07 71j 03 E9 052E R N12: C2 [8 0?6F R 74 20 2B FO 8A 6 2A E3 N13 : [8 28 2B FE 75 02136 R

CMP JE JMP

AH,7 N12 GRAPHICS_DOWN


BX AX, SCROLL POSITION N16 SI,AX AH,DH AH, BL

TEST FOR SW CARD CONT I NUE DOWN SAVE ATTRIBUTE IN BH LOWER RIGHT CORNER GET REGEN LOCAl ION
SI IS FROM ADDRESS GET TOTAL II ROWS COUNT TO MOVE I N SCROLL

all

53

PUSH MDY CALL JZ SUB MOY SUB CALL SUB SUB OEC JNZ N14:
POP MOY

ox

F5

Fa
CC

rs

51, BP 01,6? AM N13


AX AL, N11

"'0

MOVE ONE ROW

58
SO 20
N15: 8 02BF R ?R FO FE CB

RECOVER ATTRIBUTE

IN AH

75 F7
9 0257 R

CALL SUB DEC JNZ JMP N16:


MOY JMP SCROLL_DOWN

01, BP
BL N15 N5

CLEAR ONE ROW GO TO NEXT ROW SCROLL_END

8A DE EB ED

BL, DH N14 ENDP TEST IF AMOUNT OF LINES TO BE SCROLLED = AMOUNT OF LINES IF TRIJF THEN WE ADJUST AL, I F FALSE WE RETURN . PROC BL,AL AL,AL NEAR SAVE LI NE COUNT IN Bl_ 1[51 IF AL I S ALREADY ZERO I r I TIS THEN RETURN .. SAVE AX SUBTRACT LOWER ROW FROM UPPER ROW ADJUST 0 I FERENCE BY J TEST If l.INE COUNT = Af~OUNT OF ROWS RESTORE AX I F NOT THEN WE'RE All. SET OTHERWI SE SET BL TO ZERO P_ETURN IN WINDOW IN WINDOW

;--------;--------0303 0303

TEST_LINE_COUNT 8A 08 OA co 74 DE
MUY UK JZ PUSH
r~ov

rno')

0307 0309 030A 030C 030E U310 0312 0313 0315 0317 0317 0318

50
8A C6 2A C5

FE CO
3A C3

58
75 02 2A DB

SUB INC CMP POP

MAL,OH AL,CH

Bl SET

IN[
SUB

AL AL,BL AX 13L SET BL-;-BL

C3

RFT TEST_LINl_ .. COUNT ENDP

READ AC CURRENT - Ti'liS ROUTINE READS THE ATTRIBUTE AND CHARACTER AT THE CURRENT CURSOR POSITION AND RETURNS THEM TO THE CALLER INPUT (AH) = CURRENT CRT MODE (BH) = DISPLAY PAGE ( ALPHA MODES ONLY) ( OS) = DATA SEGMENT (ES) = REGEN SEGMENT OUTPUT (AL) = CHAR READ (AH) = ATTRIBUTE READ ASSUME RFAD AC CURRENT -CMP JC CMP JE JMP CALL MOY CS:COoE,DS:OATA,ES:oATA PROC NEAR AH,I.

0318 0318 0318 0310 0320 0322 0325 0325 0328

80 72 80 74 E9

FC 04 08 FC 07

IS THIS GRAPHICS IS THIS BWCARO

Pl
AH,7 P1 GRAPH I CS_READ fiND POSITION SI,BX

03
0669 R

E8 0342 R

88 F3

ESTABLISH ADDRESSING

IN SI

;------ WAIT FOR HORIZONTAL RETRAC[ 032A 032E 0331 0332 0333 0333 0334 0336 0338 0339 0339 033A OBC aBE

88 16 0063 R 83 C2 06

06
1F

MDY ADD PUSH POP

DX, ADDR_6B45 DX,6 [S OS AL,DX AL,1 P2 Al., OX AL,1 P3 V IDEO R[TURN ENDP PROC CL,BH Cli,CIi S I ,CX NEAR ; ;

GET BASE ADDRESS POINT AT STATUS PORT GET SEGMENT FOR QU I CK ACCESS WA I T FOR RETRACE LOW GET STATUS I S HaRT. RETRACE LOW WAIT UNTIL IT IS NO I'l0RE INTERRUPTS WA I T FOR RETRACE HIGH GET STATUS IS IT HIGH WAIT UNTIL IT IS GET THE CHAR/ATTR

P2:
[C A8 01 75 F13 FA IN TEST JNZ

CLi
P3: IN TEST JZ LODSW JMP READ_AC_CURRENT FIND POSITION MOV XOR MOY SAL MOY XDR JCXZ P4: ADO LOOP P5: CALL AOD

033r
0342 0342 0342 0344 0346 0348 034A 034E 0350 0352 0352 0356 0358 0358 0356 0350 035

EC A8 01 74 FB AD E9 0144 R

8A CF
32 88 01 8B 33 ED Fl

D I SPLAY PAGE TO CX

[6
84 0050 R 013

E3 06
03 1 E 004C R E2 FA EB 0211 03 08 C3

RET

MOVE TO S I FOR INDEX 51,1 : ... 2 ~OR WORD OFFSET AX, [S I + OFFSET CURSOR_POSN I ; GET ROW/COLUMN OF THAT PAGE 13X, BX SET START ADDRESS TO ZERO P5 NO PAGE PAGE LOOP BX,CRT LEN LENGTH OF BUFFER P4 NO PAGE POSITION DETERMINE LOCATION IN REGEN BX,AX ADD TO START OF REGEN ENDP

F I NO_POS I T I ON

WRITE AC CURRENT -THIS ROUTINE WRITES THE ATTRIBuTE AND CHARACTER AT THE CURRENT CURSOR POSlrlON INPUT (AH) "'- CURRENT CRT MODE (SH) ~ DISPLAY PAGE (CX) = COUNT Of CHARACTERS TO WR I TE (AL) _ CHAR TO I--IRITE (BL) ;0;; ATTRIBUTE OF CHAR TO WRITE (OS) = DATA SEGMENT ( ES) .::. REGEN SEGMENT OUTPUT NONE

Video

5-133

035
035E

0361 0363 0366 0368 0368


0368

80 72 80 74 E9

FC 04 08 FC 07 03 0588 R

0360 036 036F 0372 0374


0375

8A E3 50 51

E8 0342 R
88 F8 59 5B

WR I TCAC_CURRENT PROC CMP AH,4 JC P6 AH,7 CMP JE P6 JMP GRAPHICS_WRITE P6: AH, BL MOV PUSH AX PUSH FIND POSITION CALL

NEAR IS THIS GRAPHICS IS THIS BW GARD

ex ex

WR I TE_AC_CONT I NUE GET ATTRIBUTE TO AH SAVE ON STACK SAVE WR I TE COUNT ADDRESS TO 0 I REG I STER WR I TE COUNT CIIARACTER IN BX REG WR I TelOOP

MOV POP POP

OI,BX

BX

0376

P7: ;------ WAIT FOR HORIZONTAL RETRACE

0376 037A 0370 0370 037E 0380 0382 0383 0383 0384 0386 0388 038A 0388 038G 038E 0391

8B 16 0063 R 83 C2 06

MOV

ADO
P8:

OX, ADDR_6845 DX,6


AL,DX AL,1
PB

GET BASE ADDRESS POI NT AT STATUS PORT GET STATUS IS IT lOW WAIT UNTIL IT IS NO MORE INTERRUPTS GET STATUS IS IT HIGH WAIT utHll IT IS RECOVER THE CHARjATTR PUT THE CHARjATTR I NTERRUPTS BACK ON AS MANY TIMES AS REQUESTED

,e
A8 01 75 FB FA

IN
TEST JNZ

ell
P9:

Ee
A8 01 74 FB

IN TEST JZ
MOV

AL, OX AL,1

P9
AX,BX

8B C3
AB FB
E2 E8

E9 0144 R

STOSW STI LOOP JMP WR I TE_AC_CURRENT

P7
VIDEO RETURN ENDP

WRITE C CURRENT -TH I S ROUT I NE WR I TES THE CHARACTER AT THE CURRENT CURSOR POS I T ION, ATTR I BUTE UNCHANGED INPUT (AI-!) '" CURRENT CRT MODE (BH) '" DISPLAY PAGE (CX) := COUNT OF CHARACTERS TO WR I TE (AL) =:: CHAR TO WRITE (OS) =: DATA SEGMENT (ES) := REGEN SlGMENT OUTPUT NONE

0391 0391 0394 0396 0399 0398 039 039E 039F 03AO 03A3 03A5 03A6 03A7

80 72 80 74
50 51

Fe 04 08 FC 07 03 E9 05B8 R

E8 0342

WR I TE_C_CURRENT PROG NEAR CMP AH,4 JC P10 CMP AH,7 JE P10 JMP GRAPH I CS_WR I TE P10: PUSH AX PUSH FIND POSITION CALL

IS THIS GRAPHICS IS THIS BW CARD

ex ex
ox

SAVE ON STACK SAVE WRITE COUNT ADDRESS TO 01 WR I TE COUNT BL HAS GHAR TO WR I TE WRITE_LOOP

88 FB
59 5B
Pll :

MOV POP POP

OI,BX

;------ WAIT FOR HORIZONTAL RETRACE

03A7 03AIl 03AE 03Ar 03AF 03B1 0383 03B4 03B4 0385 0367 03B9 03BB 03BC 03BO 03BE 03CO 03C3

8B 16 0063 R 83 C2 06 P12:

MOV

ADO
IN TEST JNZ

OX,AOOR 6845 DX,6 AL.DX AL,l P12 Al,OX AL,l

GET eASl AUDRESS POINT AT STATUS PORT GET STATUS IS IT LOW WAIT UNTIL IT IS NO MORE INTERRUPTS GET STATUS IS IT HIGH WAIT UNTIL IT IS RECOVER CHAR ENABLE I NTS. PUT niE CHARjATTR BUMP POINTER PAST ATTRIBUTE AS MANY TIMES AS REQUESTED

Ee
A8 01 75 FB

FA
P13 :

ell
IN TEST JZ
MDV

Ee
A8 01 74 fll 8A C3

P13
Al,BL 01 P11 VIDEO RETURN ENOP -

FB
AA

47

E2 7 E9 0144 R

STI STOSB INC LOOP JMP WR J TE_C_CURRENT

page
WRITE STRING -ThiS routine writes a

string of characters to the crt.

INPUT (AL) =: WRITE STRING COMMAND 0 - 3 (BH) = DISPLAY PAGE (eX) =:: COUNT Of CHARACTERS TO WRITE, IF CX ='" 0 THEN RETURN (BL) = ATTRIBUTE OF CHAR TO WRITE IF AL:== 0 II AL == 1 ( ES) = STR I NG SEGMENT (SP) =: STRING OFFSET OUT rUT

RIA
03C3 03C3 03C5 03C7 03CA 03CC 03CE 0301 0302
0304 PROC NEAR TEST FOR INVALID WRITE STRING OPTION I F OPT J ON I NVAL I 0 THEN RETURN TEST FOR ZERO lENGTH STR I NG

3G all 72 03 E9 0115B R OB C9 75 03 E9 0458 R


53

WD:

eMP JB JMP OR

wo
W1

AL,04 DONE CX,CX

JNZ
JMP

141:

PUSH
MOV XDR

8A OF

0306
0308 03DC

32 FF 01 E3 8B 87 0050 R 58

SAL
MOV POP

0300
030E

56
50 B8 0200 CD 10

PUSH PUSH

I F ZERO LENGTH STR I NG THEN RETURN DONI:. SAVE PAGE AND pass I BLE ATTR I BUTE BX GET CURRENT CURSOR POS I T I ON BL, BH BH,BH BX,1 ; S I, [BX+OFFSET CURSOR_POSN 1 BX RESTORE BX SI SAVE CURRENT CURSOR POSITION AX AX,0200H SAVE WRITE STRING OPTION SET Nf:W CURSOR POS I T I ON RESTORE WRITE STRING OPTION

030F
03E2

MOV INT
PDP

10H
AX

03E4
03E5

58 51

03E5

03E6

53

WRITE CHAR: PUSH PUSH

ex
BX

5-134 Video

03[7 03E8 03E9 03E6 03Ef

50

06
86 EO 26: 8A 46 00 45

PUSH PUSH XCHG MOV INe

AX ES

AH,AL AL, ES: [ BPj BP

PUT THE WRITE STRING OPTION INTO AH GET CHARACTER FROM INPUT STRING BUMP PO I NTER TO CHARACTER

;----- TEST FOR SPECIAL CHARACTER'S OHO 03f2


03~4

3C 08 111 OC

C~\P

JE
CMP

JC uO
14 3C 71\ 3C 611 CO 8A DO 86 08 OA 04 07 DE 10 OF
[1

03F6 03f8 03FA 03FC 03FE 0400 0400 040? 0404 0406 0408 040C 0400 040E 040F 0410 01 113 O!~ 13 0416 0'119

JE
CMP

J E
eMP

75 13

.INr MOV I NT
I~OV

Al,8 DO TTY AL~ODH DO TTY Al-;OAH DO_TTY Al,O"(ti GET_ATTRIBUTE AH,111


lOll

I SIT A BACKSPACE BACK SPACE IS IT CARRIAGF RETURN CAR RET IS IT A LINE FEED LINE ff.ED I S IT A BELL I F NOT THEN DO WR I TE CHARACTER WHITE TTY CHARACTER TO THE CRT

SAL
t~OV

97 0050 R

07 58 56

59
E6 32 90 69 0001

I'or POP POP POP JMP GET ATTRI BUTE: MOV


CMP

Bl,!3H GET CURRENT CURSOR POS I T I ON SH,l ; INTO THE OX REGISTER DX, [BX+OFFSET CURSOR_POSN 1 ES AX ; RESTORE REG I STERS BX CX ROWS_SET CX,l AH.2 COT IT BL,F.S;[BP] SET CliARACTER HR I TE AMOUNT TO ONE IS THE A"TmIBUTE IN THE SlRING I F NOT THEN JUMP ELSt. (;1;.1 IT BUMP STRING POINIER WR I TE CHARACTER TO THE CRT RESTORE REG t STERS

80 Fe 02
72 05 26: 8A 5[ 00

04;8
041 F 0420 0420 0422 0424 0425 0426 0421 0428 042A 0112!:: 0430 0432 043 11 0437 0439
0/~3A

45
134 09 CD 10

JB MOV INC
MOV
I NT

BP
AH,09 10H
ES

07 58 5B 59
F[ C2 3A 16 004A R

POP
POP POP

AX

POP
INC eMP

ex
OL

OX
I NCREMENT COLUMN COUNTER IF COLS ARE WITHIN RANGE FOR Ttl I S MODE THEN GO TO COLS SET BUMP ROW COUN I ER BY ONE SET COLUMN COUNTER TO ZERO I F ROWS ARE < 25 THEN GO TO ROWS SET SAVE WR I TE SIR I NG PARAMETER REGS SAVE REG'S THAT GET CLOBBERED DO SCROLL ONE LI NE RESET ROW COUNTER TO 24 RESTORE REG'S

DL,BYTE PTR CRT_COLS


DH

72 1'1

rr c6

2A U2

JB INC SUB
eMP

COLUMNS SET
-

80 FE 19
72 OB

JB
PUSH PUSH MOV I NT

DL., f)1 OH,25 HOWS_SEl


ES AX

06 50
B8 OEOA CD 10 FE CE

0436 043E 04110 0442 0443 0444 0444 0444 0445 04118
OI~IIA

58 07 50
68 0200 CO 10

OEC POP
POP

AX,OEOAH 10H OH AX
ES

ROWS SET: COLUMNS SET: -"PUSH MOV I NT POP LOOP


POP eMP

AX

58
E2 98

0446 011110 044E 01 150 0452 0115 1 1

AX,0200H 10R AX WR I TE_CHAR


OX

SAVE WRITE STRING OPTION SET NEW CURSOR pas I T I ON DO


! T ONCE MORE UNT I L CX = ZERO

5A
3C 01

01156
0459 0458 045B 045E

"III 3C 74 68 CD

09 03 05 0200 10
DONf:

JE
eMP

JE MOV
I NT JMP

AL,l DONE AL,3 DONE AX,0200H 10H V IDEO_RETURN ENDP

RESTORE OLD CURSOR COORD I NATES I F CURSOR WAS TO BE MOVED THEN WE'RE DONE ELSE RESTORE OLD CURSOR POSiTION RETURN TO CALLER

E9 0144 R

WR I TE_sm I NG p<lge

READ DOT -- WR I TE DOT THESE ROUTINES WILL WRITE A DOT, OR READ THE DOT AT THE INDICATED LOCATION ENTRY -OX = ROW (0-199) (THE ACTUAL VALUE DEPENDS ON THE MODE) ex = COLUMN ( 0-639) ( THE VALUES AHE NOT HANCE. CHECKEO ) AL = DOT VALUE TO WRITE (1,2 OR 4 BITS DEPENDING ON MODE, REQ'I) FOR WRITE ~OT ONLY, RIGln JUSTIFIED) BIT., OF AL = 1 INDICATES XOR THE VALUE INfO THE LOCATION OS ~ DATA SEGMENT E$ = REGFN SEGMENT EXI T ; ASSUME READ DOT CALL MOV AND SHL
MOV

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

AL "--' DOT VALUE READ,

RICHT JUSTIFIED,

READ ONLY

04SE 045E 0461 0464 0466 01 168 0116A 0116C 046F 046F 046F 0471 0474 0476
0!~78

E8 0492 R 26: 8A 04 22 e4 02 EO SA CE 02 CO E9 0144 R

ROL
JMP

READ_DOT

CS; CODE, OS: OAT A, ES; OAT A PHoe NEAR DETERMtl'l[ BYTE POSITION OF ~OT R3 ; GET THE BYTE AL., [S: [SI J MASK OFF THE OTHER BITS I N THE BYTE AL,AH LEFT JUSTI FY THE VALUE AL,CL CET NUMBER OF BITS IN RFSlJl T CL, DH RIGHT JUST J FY THE RESULT AL,CL VIDEO RETURN RETURN FROM VIDEO 10 ENDP ~ PROC
AX

Dina

50
50
E8 0492 R 02 E8 22 e4 26; 8A DC

WRITE nOT PUSH PUSH CALL SHR


AND

NEAR SAVE DOT VALUE TWICE DeTERMINE BYTE POSITION OF THE DOT SH I fT TO SET UP THE BITS FOR OUTPUT STR I P OFF THE OTHER 8 I TS GET THE CURRENT BYTE RECOVER XOR FLAG I SIT ON YES, XOR THE DOT SET THE MASI{ TO REMOVE THE INDICATED BITS OR I N THE NEW VALUE OF THOSE 61 T5 FINISH DOT RESTORE THE BYTE I N MEMORY RETURN FROM V IDEO 10 XOR_DOT EXCLUSIVE OR THE DOTS

AX

R3
AL,CL AL,AH CL,ES:[Stl BX Bl,80H R2
AH

0478 047C 047f 0481 0483 0485 0487 0487 048A 048B 048E 048E

5B
F6 C3 80

'5 00
f6 04 22 CC OA Cl Rl :

MOV POP TEST JNZ NOT


ANO

OR MOV
POP JMP

CI.,AH AL,CL ES:[SIj,AL


AX

26: 88 04 58
E9 01'111 R

V I OED RETURN Al,CL

R2;
32 Cl

XOR

Video

5-135

01190 0492

EB F5

JMP

R1
[NDP

FINISH UP THE WRITING

WRITE DOT

0492 0492 0493

53 50

i"
;

- - - - - -- -- - - - -- - -- - -------------------- -- ----~ ~

THIS SUBROUTINE DEIERMINES THE REGEN BYTE LOCATION OF THE INDICATED ROW COLUMN VALUE IN GRAPHICS MODE. ENTRY -OX'" ROW VALUE (0-199) CX "" COLU~lN VALUE (0-639) EXIT -SI ::: OFFSET INTO REGEN BUffER FOR BYTE OF INTEREST AH = MASK TO STRIP OFF THE BITS OF INTEREST CL'" BITS TO SHIFT TO RIGHT JUSTIFY THE MASK IN AH DH = H BITS IN RESULT PROC PUSH PUSH NEAR 8X AX ; ; SAVE BX OUR I NG OPERAT I ON WILL SAVE Al DURING OPERATION

------

DETERMINE 1ST BYTE IN IDICATEO ROW BY MULTIPLYING ROW VALUE BY 40 ( LOW 611 OF ROW DETERMINES EVEN/ODD, 80 BYTES/ROW
MOV

0494 0496 0497 049A 049C 0490 04AO U4A2 OIIAS OIIAS 04A7 04AB

BO 28

AL,40

52
80 E2 FE f6 E2 SA F6 C2 01

PUSH
AND MUL POP

OX
DL,OFEH

DL OX
DL,1 R4 AX, ?OOOH SI,AX AX OX,CX

TEST

7'1 03 05 2000
R4: 8B FO

JZ ADO
MOV POP MOV

58
8B Dl

SAVE ROW VALUE STR I P OFr ODD/EVEN BIT AX HAS ADDRESS OF 1ST BYTE OF INDICATED ROW RECOVER IT TEST FOR EVEN/ODD JUMP I F EVEN ROW OFFSET TO LOCATION OF ODD ROWS EVEN ROW MOVE-PO I NTR TO S I RECOVER Al VALUE COLUMN VALUE TO OX IN [FfEel

;------ DETERMINE GRAPHICS MODE CURRENTLY

SET UP THE REG I STERS ACCORD I NG TO THE MODE CH = MASK FOR LOW OF COLUMN ADDRESS ( 7/3 FOR HI GH/MED RES) CL = H OF ADDRESS BITS IN COLUMN VALUE ( 3/2 FOR H/M) BL = I~ASK TO SELECT BITS FROM PO I NTD BYTE (80H/CQH FOR H/M 1 BH '" NUMBER OF VALID BITS IN POINTED BYTE ( 1/2 FOR H/I") O',AA 04AD 0480 04135 04137 048A 0480 0480 BB 02CO

139 0302
80 72 813 89

3E 0049 R 06 06 0180 0703


K';I:

MDV MDV CMP JC MOV MOV

BX,2COH CX,302H CRCMOOE,

SET PARMS FOR MED RES

6
HANDLE I F MED ARES SET PARMS fOR HIGH HES IN BYTE FROM COLUMN MASK ; ADDRESS OF PEL WITHIN BYTE TO CH IN COLUMN

R5 BX,180H CX,703H

;------ DETERMINE BIT OFFSET 22 EA


AND

CH,DL

;------ DETERMINE BYTE OFFSET FOR THIS LOCATION 04BF 01lC1 04C3 03 EA 03 F2 8A n
SHR ADD MOV

DX,CL SI,OX DH,BH

; ; ;

SH I FT BY CORRECT AMOUNT INCREMENT THE POINTER GET THE # OF BITS I N RESULT TO DH BY CH (BIT OFFSET)

;------ MULTIPLY BH (VAllO BITS 04C5 04C7 OiiC7 04C9 04C13 OljCD 04CF OljDl OljD3 0404 0405 2A C9 R6: 02 FE 75 8A 02
SUB RDR ADD DEC

IN BYTE) ZERO

CL,CL AL,1 Cl,CH


BR

I NTO STORAGE LOCAT I ON

DO C8 CO
CF F8

JNZ
MDV

R6
AH,BL AH,CL
BX

E3
EC
R3

SIIR
PDP

58
C3

RO ENOP

LEFT JUSTIFY THE VALUE IN AL (FOR WRITE) ADD I N THE BIT OFFSET VALUE LOOP CONTROL ON EX IT, CL HAS SH I FT COUNT TO RESTORE BITS CET MASK TO AH MOVE THE MASK TO CORRECT LOCAT I ON RECOVER REG RETURN WITH EVERYTH I NG SET UP

SCROLL UP THIS ROUTINE SCROLLS UP THE INFORMATION ON THE CRT ENTRY -CH,CL:.: UPPER LEFT CORNER OF REGION TO SCROLL DH,DL = LOWER RIGHT CORNER OF REGION TO SCROLL BOTh OF HIE ABOVE ARE IN CHARACTER POSITIONS BH = fiLL VALUE FOR BLANKED LINES Al'" # LINES TO SCROLL (AL=O MEANS BLANK THE ENTIRE FIELD) OS '" DATA SECMENT

lS = KlGlN ::;lliMEN I

EX I T -NOTH I NG, 0405 0405 OljD7 GRAPH ICS UP BA 08 813 Cl


MOV

THE SCREEN PROC BL,AL AX,CX

I S SCROLLED NEAR ; SAVE l. I NE COUNT I III I3L ; GET UPPER LEFT POSITION

Mav

INTO AX REG

;------ USE CHARACTER SUBROUTINE FOR POSITIONING ;------ AODHESS RETURNED IS MULTI PLIED BY 2 FROM CORRECT VALUE 0409 a4DC
[8 0748 R 8B Fa

CALL
MOV

SAVE RESULT AS DEST I NAT I ON ADDRESS

;------ DETERMINE SIZE OF WINDOW 040E OljEO 04E4 046

28 81 DO DO

01 C2 0101 E6 E6

SUB ADD

SAL SAL

oX,ex OX,101H DH,1 DH,l

ADJUST VALUES MULTI PLY # ROWS BY 4 SINCE 8 VERT DOTS/CHAR AND EVEN/ODD ROWS

; ------ OETERM I NE CRT MODE 04E8

04[0
04EF 04F1 04F3 04F3 04F4 04F5 04F7 04F9 04FB 04FO 04FF 0501 0503

80 3E 0049 R 06 73 04 DO E2 01 E7

eMP JNC

TEST FOR MED I UM RES F I NO_SOURCE

; ------ MEO I UM RES UP SAL DL,1 SAL 01,1

# COLUMNS 2, SINCE 2 BYTES/CHAR OFFSET *2 SI NCE 2 BYTES/CHAR

06 H
2A DO DO 74 8A B4 F6 ED E3 E3 20 C3 50 E4 813 F7 03 FO 8A E6

0505
0507

; ------ OETERM I NE THE SOURCE ADDRESS I N THE BUFFER R7: ; FIND SOURCE GET SEGMENTS BOTH PO I NT I NG TO REGEN PUSH ES POP OS SUB CH,CH ZERO TO HIGH OF COUNT REG SAL BL, I MULTI PLY NUMBER OF LINES BY 4 SAL BL,l JZ Rl1 IF ZERO, THEN BLANK ENTIRE FIELD MOV AL, BL GET NUMBER OF LI NES IN AL MOV AH,80 80 BYTES/ROW MUL AH DETERMINE OFFSET TO SOURCE MOV 51,01 SET UP SOURCE ADI) SI,AX ADD I N OFFSET TO IT MOV AH,DH NUMBER OF ROWS IN FIELD

5-136

Video

0509
OS08 OSOB
050E 0512 0516 0518 OSlA 051A 051C 051C 051 F 0523 0525 0527 052A D52A 052C 052E

2A E3

SUB

AH,BL

; DETERM I NE NUMBER TO MOVE

[8

81 81

05SE R EE 1 FBQ

EF 1 FBO FE CC

75 F1

; ------ LOOP THROUGH, MOVING ONE ROW AT A TIME, BOTH EVEN AND ODD FIELDS ROW LOOP R8: CALL R17 MOVE ONE ROW MOVE TO NEXT ROW S I ,200QH-80 SUB OI,2000H-80 SUB NUMBER Of ROWS TO MOVE DEC AH CONT I NUE TILL ALL MOVED JNZ RB

R9:
8A C7

MOY

FILL IN THE VACATED LlNE(S) CLEAR_ENTRY ATTRIBUTE TO FILL WITH AL,BIi R18 DI,2000H-80 BL R10 V IDEO_RETURN BL,DH CLEAR THAT ROW POINT TO NEXT UNE NUMBER OF LINES TO FILL CLEAR_LOOP EVERYTH I NG DONE BLANK_F I ELO SET BLANK COUNT TO EVERYTH I NG IN FIELD CLEAR THE f I ELO

.,

RlO: CALL SUB DEC JNZ JMP Rl1:


MOY JMP GRAPHICS_UP

E8 05A7 R Ef 1 fBO FE CB E9 0144 R

75 f5

SA DE EB EC

R9
ENDP

SCROLL DOWN TH I S ROUT I ME SCROLLS DOWN THE J NfORMAT I ON ON THE CRT ENTRY -CH,CL'" UPPER LEfT CORNER OF REGION TO SCROLL DH,Dl'" LOWER RIGHT CORNER OF REGION TO SCROll BOTH OF THE ABOVE ARE IN CHARACTER POSITIONS BH = FILL VALUE fOR BLANKED LINES AL = # LJ NES TO SCROLL (AL=O MEANS BLANK THE ENT I RE FI ElO) OS = DATA SEGMENT ES = REGEN SEGMENT EXIT -NOTH I NO, THE SCREEN I S SCROLLED 052E 052E 052F 0531 GRAPH I CS DOWN
fO SA 08 88 C2

STD

PROC 6L,AL AX, OX

MOV MOV

NEAR ; SET DIRECTION ; SAVE L J NE COUNT ; GET LOWER RIGHT

pas I T I ON I "ITO AX REG

IN BL

;------ USE CHARACTER SUBROUTINE fOR POSITIONING ;------ ADDRESS RETURNED IS MULTIPLIED BY 2 fROM CORRECT VALUE

0533
0536

[8 0748 R 8B F8

CALL MOY

GRAPH POSN DI,AX-

SAVE RESULT AS DESTINATION ADDRESS

;------ DETERMINE SIZE OF WINDOW 0538 053A 053E 0540 2B 81 DO DO 01 C2 0101 E6 E6 5UB AOO SAL SAL OX,CX DX,101H DH,1 DH,1 ADJUST VALUES MULTI PLY # ROWS BY 4 SINCE 8 VERT DOTS/CHAR AND EVEN/ODD ROWS

; ------ DETERM I NE CRT MODE


051~2

80 3E 0049 R 06

0547

73 05

CMP JNC

CRT MODE,6 R12-

TEST FOR MEO I UM RES F I ND_SOURCE_OOWN

;------ MEDIUM RES DOWN 0549 0548 0540 D54E OS4E OS4F OS50 OS52 0556 0558 055A 055e 055E 0560 0562 0561! 0?66 0566 056A 056A 0560 0571 05750577 0579 0579 0576 0576 057E 0582 0584 0586 0587 058A 058A OS8E DO E2 01 E7 47 SAL SAL INC DL,l 01,1 01

COLUMNS 2, SINCE 2 BYTES/CHAR (OFFSET OK) OFFSET *2 SINCE 2 BYTES/CHAR PO I NT TO LAST BYTE IN THE BUFFER REGEN

;------ DETERMINE" THE SOURCE ADDRESS 06 1f 2A 81 DO DO 74 8A B4 F6 86 213 8A 2A R12: ED C7 OOFO E3 E3 2E C3 50 E4 F7 PUSH POP SUB ADD SAL SAL JZ MOV MOV MUL MOV SUB MOV SUB ES OS CH, CH 01,240 BL,1 BL.1 R16 AL, BL AH,80 AH 51,01 SI,AX AH,OH AH, BL

~ ~b~~-;~~~~~T~O~~

ZERO TO HIGH Of COUNT REG POINT TO LAST ROW Of PIXELS MUlT1 PLY NUMBER OF LI NES BY 4 I F ZERO, THEN BLANK ENT I RE fl ELD GET NUMBER OF II NES IN AL 80 BYTES/ROW DETERMINE OFFSET TO SOURCE SET UP SOURCE SUBTRACT THE OffSET NUMBER OF ROWS J NFl ELD DETERMI NE NUMBER TO MOVE

fO
E6 3

8 81 81 FE 75

058E R EE 2050 EF 2050 CC F1

;------ LOOP THROUGH, MOVJNG ONE ROW AT A TIME, BOTH EVEN AND ODD FIELDS R13: ROW LOOP DOWN CALL R17 MOVE ONE-ROW SUB S I, 2000H+80 MOVE TO NEXT ROW SUB 0 I ,2000H+80 DEC AH NUMBER OF ROWS TO MOVE JNZ R13 corHINUE TILL ALL MOVED ;------ fiLL R14: IN THE VACATED LlNE(S) CLEAR_ENTRY _~OWN ATTRIBUlE TO FILL WITH AL,BH CLEAR LOOP DOWN CLEAR-A ROW R1B POINT TO NEXT LINE DI,2000H+80 NuMBER OF LI NES TO FILL BL CLEAR_LOOP _DOWN R15 RESET THE 0 I RECT I ON FLAG EVERYTH ING DONE BL,DH R14 ENDP BLANK_F IELO_DOWN SET BLANK COUNT TO EVERYTHING IN fiELD CLEAR Tile F IlLD INFORMATION NUMBER Of BYTES IN TH::: ROW SAVE PO INTERS MOVE THE EVEN FI ELO

8A C7 R1S: E8 81 FE 75 FC E9 05A7 R EF 2050 CB F5 0144 R R16: 8A DE EB EB

MOV
CALL SUB DEC JNZ CLO JMP
MDY JMP GRAPH I CS_DOWN

osee

j-----OSSE 058E 0590 0591 0592 0594 0595 0596 059A 059E R17 8A CA 56 57 F3/ A4 5F 5E 81 C6 2000 81 C7 2000

ROUTINE TO MOVE ONE ROW OF PROC MOY PUSH PUSH NEAR CL,DL 51 01 MOVSB 01 51 S 1,2DDOH Ol,2000H 51 01 CL,Dl MOVSB 01 51

REP

POP POP ADD

56
57 /:SA (;A F3/ A4 5F

059F
05AO 05A2 OSA4 05A5 05A6

AOO PUSH PUSH


MOY REP POP POP

POINT TO THE ODD FIELD

SAVE TH E PO INTERS COUNT BACK MOVE THE ODD FIELD PO INTERS BACK RETURN TO CALLER

5E
C3

RET

Video

5-137

O';>Af

R17

ENOP -- CLEAR A SI NGLE ROW

OSA7 0'>A7 05A9 05AA 05AC 05AD 05B1 05B2 0584 05B6 05B7 05B8

R18 8A GA 57 F3/ AA SF 81 C7 2000 57 8A CA F3/ AA SF" C3 R18

PROC
MOV

PUSH

REP
PDP ADO

Mav REP

PUSH
POP

NEAR CL,DL 01 STOSB 01 DI,2000H 01 CL, DL STOSB


DI

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

RET

[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 CS:COOE,OS:DATA,ES:DATA PROC NEAR AII,O ; ZERO TO HIGH or COOI: POINT AX ; SAVE CODE PO 1 NT VALUE IN REGEN BUFFER TO PUT CODE ; ; POINTS

05B8 05138 05BA

84 00 50

;------ DETERMINE POSITION 05B8 058E E8 0745 R 88 F8 CALL


MOV

FIND LOCATION IN REGEN BUFFER REGEN POINTER IN 01

;------ DETERMINE REGION TO GET CODE POINTS FROM OSCQ 05C1 05C3

58
3C 80 73 06

POP

CMf'
JAE

AX AL, BUH 51 IS IN fiRST HALF,


SI,O~~5~_1

; ; ;

RECOVER CODE PO I NT I::; 1"1" IN SECOND HALF YES

!MAGE 05C5 OSCs OSC9 BE 0000 E


DE

CONTAINED IN ROM ; OFFSET OF IMAGES ; SAVE SEGMENT ON STACK ; DETERM I NE_MODE

EB OF"

MOV PUSH JMP IMAGE IS

GKI

CS SHORT 52

CHAK tilN ~ -

IN SECOND HAl.F, AL, BaH D5 SI,SI DS,SI DS:ABSO S I ,EXT PTR OX, OS DS:DATA D5
OX

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 ; ; ; DE TERM I NE MODE MULTI Pl.Y CODE PO I NT VAl.UE BY 8 51 HAS OFFSET OF DESIRED CODES

05CS

Sl : 2C 80
1E

osce

05CD OSCE 0500 0502 0506 0508 O:>U:,I

2B F6 8E DE CS 36 OU7C R 8C OA

SUB PUSH 5UB


MOV

ASSUME LOS
MOV

ASSUME

,<
D1 01 D1

1F

PDP

PUSH

;------ DETERMINE GRAPHICS MODE 05DA 05DA 05DC 050E 05EO 05E2 05E7 05E.8 05EA 05EA 05B 52:
EO

EO EO

5AL 5AL SAL


ADD CMP POP JC

03 FO 80 3E 0049 R 06

1f "!2 2C

AX.1 AX,l AX,l 51 ,AX CRT_MODE,6 05

S7

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

57
'6 136 04
AC

OSEe
05EE

05[
05EF 05F2 05Flf 05F5 05F6 05F6 05FB 05F 0600

F6 C3 80 75 16
AA AC

;------ HIGH RESOLUTION MODE 53: PUSH DI 51 PUSH MDV DH,4 S4: LOOSB TEST BL,80H 56 JNZ STOSB LODSB

$5:
26: 88 85 1 FFF 83 C7 4F FE CE 75 EC
MOV ADO

ES: [UI+2000H-1 ],AL

01, '19
DH

DEC
JNZ pOP POP INC

; 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

54
51 01
DI

0602 0603
060 1 0605 0607 Q6QA 060A

5E 5F
117 2 E3 E9 0144 R S6:

LOOP
JMP

53
V IDEO_RETURN AL,ES:[DI]

?6:
AA AC

32 05

0600
a60E a60F 0614 0616 0616 0618

26: 32 EB EO

85 1FTF

XOR STOSB LODSB XOR JMP

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 MEO RES WRIIE SAVE HIGH COLOR BIT OFFSET*2 SINCE 2 BYTES/CHAR

8A 03
01

; ------ MED I UM RESOLU f I ON WR 1TE S7: MOV DL, BL SAL 01,1

5-138

Video

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

E8 06Fl

R
58:

CALL PUSH PUSH MOV 59: LODSB CALL AND TEST JZ


XOR XOR

519 01 51 DH,4 521 AX,BX Ol, BOH 510 AH,ES:(DI J AL,E5:[DI+1J ES: [01 J,AH ES:{DI+l1,AL 521 AX,BX DL, BOH ; 511 ; AH,ES:[DI+200DHj AL,ES:[DI+2001Hj

57 56
136 04

EXPAND BL TO FULL WORD OF COLOR MED CHAR SAVE REGEN PO INTER ; SAVE THE CODE POI NTER NUMBER OF LOOPS 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 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

AC
E8 0706 R 23 C3 F6 C2 80 74 07 26: 32 25 26: 32 45 01 S10:

26: 88 25
26: 88 45 01

AC
E8 0706 R 23 C3 F6 C2 80 74 OA 26: 32 AS 2000 26: 32 85 2001

MOV MDV LODSB CALL AND TEST JZ


XOR XOR

S11 :
26; 88 AS 2000 26: 88 85 2001 83 C7 50 FE CE 75 Cl
MDV MOV ADD DEC JNZ POP POP INC INC LOOP JMP GRAPH I CS_WR I TE

065C

065E 0660 0661 0662 0663 0664 0666 0669

47 47

50 5F

E2 B7 E9 0144 R

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 -

; 0669 0669 066c 066E 0671

GRAPH I CS READ 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

E8 8S 83 88

0745 R FO [C 08 EC

GRAPH I CS_REAO CALL MOV SUB MOV

DETERMINE GRAPHICS MODES 0673 0678 0679 067A 80 3E 0049 R 06

06
1F
72 lA

CMP PUSH PDP JC

CRT_MODE,6

E5
05 513 PO I NT TO REGEN SEGMENT MEDIUM RESOLUTION

HIGH RESOLUT ION READ GET VALUES FROM REGEN BUFFER AND CONVERT TO CODE PO I NT MOV OH,4 NUMBER PASSES

067C 067E 067E 0680 0683 0684 0688 068B 068C 068F 0691 0693 0696 0696 0698 069A 069A 0690 06A1

86 04 512: 8A 04 88 46 00

or

45
8A 84 2000 88 46 00

45
83 FE 75 EB C6 50 CE [B 17 90

MOV MOV INC MOV MOV INC ADD DtC JNZ JMP

AL, [51] [BP),AL BP AL, [5 1+200QH I [ BPI,AL BP 5 I, 6U DH 512

GET fiRST BYTE SAVE I N STORAGE AREA NEXT LOCAT I ON GET LOWER REGION BYTE ADJUST AND STORE PO I NTER I NTO REGEN LOOP CONTROL DO I T SOME MORE GO MATCH THE SAVED CODE PO I NTS MED_RES_REAO Off5EP"2 5 I NCE 2 BYTES/CHAR NUMBER OF PASSES 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

515

513:
D1 E6 B6 04

MEO I UM RESOLUT ION READ


SAL MOV

51,1 DH,4 523 5 I ,200QH 523 S I ,2000H-BO DH 514

514:
E8 81 E8 81 rE 75

06A4 a6A8
06AA 06AC 06AC 06Af 0600 06B1 06B4 06B6 06B7 06B9 06B9 a6BA 06BB a6BE 06BE
06B~

0728 R C6 2000 0728 R EE 1 FBO CE EE

CALL ADD CALL SUB DEC JNZ

DONE

SF 0000 E DE

07
83 EO 08 BI) F5

Fe
BO 00

16 1F
SA 0080

56

,r

a6co a6C3 06CS 06C9 06CA 06CB 06CD 06Cf 0602 0603

B9 0008 F3/ A6 8A H 0017 R

5F 5E 74 H
FE CO 83 C7 08

4A
75 E9

; -------- 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 CHAR NOT MATCHED, MIGHT BE 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

0605 0607 06U9 06DB 0600 06E1

3C 74 2B BE C4 8C OB 74 60 B

00 12 CO 08 3E 007C R CO C7 04 80 CE

CMP JE SUB MOV ASSUME

AL,O

518
AX,AX OS,AX DS:ABSO 01 ,EXT PTR AX, ES AX,DI 51B AL,128

LE5
MOV

06E3
065 067 069

OR
JZ MOV JMP ASSUME

516
OS: DATA

06E6 06EB 06EE

83 C4 08 9 0144 R

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

06Fl

GRAPH I GS~R[AO

ENOP

; ; ; ; ; 06F1 06Fl 06F4 06F6 06F7 06FA 06FA OGFG 06FE 0700 0702 0704 070? 0706

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)

80 E3 03 8A C3

51 89
DO OA E2 8A

0003 S20: EO

PROC AND MDV PUSH MOV

ex

NFAR Sl,3 AL. Bl

CX.3 Al,l AL,l BL,AL


520

I SOLATE THE COLOR BITS COPY TO AL SAVE REG I STER NUMBER OF TIMES TO 00 TH I S LEFT SHIFT BY 2 ANOTHER COLOR VERSION FilL ALL Of BL FILL UPPER PORTION REG I STER BACK ALL DONE

DO EO

SAL SAL
OR

08 F8
fB

INTO BL

59 03
$19
; ; ; ;

LOOP MOV POP


RET

SH,aL

ex

; ;

ENDP 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
SUB MOV

EXPAND~BYTE

0706 0706

NEAR

52

%r
0708 0709 070B 070E 070E 0710 0712 0714 0716 0718 071A 071C

53 "

ox ex

SAVE REG I STERS RESULT REG I STER MASK REG I STER BASE INTO TEMP USE MASK TO EXTRACT A g I T PUT I NTD RESULT REGI STER 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 RECOVER REGISTERS ALL DONE

BX

2B 02 B9 0001 S22;

DX,DX CX,l BX,AX BX,GX OX, BX AX,l CX,1 BX,AX BX,CX OX,BX CX, ,

071 E
0720 0722 0724 0725 0726 0727 0728

8B 23 DB D1 D1 8B 23 OB D1 73 8[3

08 09 03 ED E1 08 09 03 E1

MOV AND

OR SHL
SHl MOV AND OR

SHL
JNe MOV POP POP POP RET

f.C
C2

522
AX,
BX

ox

5B 59
SA

ex ox

e3

$21 ENOP ; MD 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

523 8A 21t 8A 44 01 89 COOO

PROC
MOV MOV MOV MOV

0720 0730
0732 0732 0734 0735 0737

82 00
S24: 85 C1 F8
711

NEAR AH, [$1 J AL. [SI +1 ) eX,oeOOOH DL,O AX,CX 525

GET FIRST BYTE GfT SECOND BYTE 2 BIT MASK TO TEST THE ENTRIES RESULT REG I SHR

cec
JZ
S25: SHR SHR

TEST
STe RCl

01

0738
073A 073G 073E 0740 0743 0744 0745

F9 00 02

01 9 01 E9
73 F2

ex, ,
CX,l S2 1t
BP

DL,l

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

88 % 00 1<5
C3
523

JNe MOV INC RET

[or J. oL

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

PHOC
MOV

0050 R

53
BB

GRAPH - POSN PUSH

08

SA C4
F6 26 Q04A R

MOV MOV MUl

01 ED D1 ED 2A Ff

SHL
SHl SUB

03 C3

ADD
POP RET

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

5B
C3

S26

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 ASSUME WRITE TTY PUSH PUSH
MOV MOV INT POP

075B 075B 075C 0750

50 50
B4 03 BA 3E 0062 R CD 10

o r~ ~

CS:COOE,OS:DATA PROC NEAR AX AX AH,3 RH, ACT I VE_PAGE


lOll AX

SAVE REG I STERS SAVE CHAR TO WR I TE


GET CURRENT pA(~r SFTTl NG READ HIE CURRENT CURSOR POS I T I ON RECOVER CHAR

0763 0765

58

ox
0r66

NOW HAS THE CURRENT CURSOR POSITION AL,8 U8 Al.,ODH 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

on8

076A 076C

076[
0770 0"172 077lt

3C 74 3C 74 3C 711 3C 74

08

CMP

52 00
'j7 OA 57 07 5A

J[
CMP J[ eMP

U9
AL,OAH

JE
CMP

Ul0
AL,07H U11

JE

; ----- WR I TE THE CHAR TO THE SCREEN

on8
077B

0776

B4 OA B9 0001 CD 10

MOV MOV I NT

AH,lD CX,1

lOH

WRITE CHAR ONLY ONLY ONE CHAR WR I TE THE CHAR

POSITION THE CURSOR FOR NEXT CHAR 0770 077F 0783 0785 0787 078A 078C 078C 078E B4 02 CO 10 FE C2 3A 16 OOllA R 75 33 82 00 80 FE 18 75 2A
INC CMP

JNl
MOV

DL DL, BYTE PTR CRT_COLS U7


DL,O DH,24

TEST FOR COLUMN OVERFLOW SET CURSOR COLUMN FOR CURSOR SET_CURSOR_I NC

CMP
JNZ

U6

SCROLL REQU I R[D

lJ1:
MOV I NT

AH,2
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

AD OOI~9 R 3C 011

r~ov Cf~P

72 06 3C 07
B7 00 75 06 U2: B4 08 CD 10 8A Fe U3: B8 0601

JC CMP MOV JNE

AL, CRT _MODE AL,I. U2 AL,7 BI-I,O U3 AH,8


lOll

GET THE CURRENT MODE READ-CURSOR FILL WITH BACKGROUND SCROLL-UP READ-CURSOR READ CHAR/ATTR AT CURRENT CURSOR STORE IN BII SCROLl.-UP SCROLl. ONE LI NE UPPER LEFT CORNER LOWER R I CHT ROW LOWER R I CHT COLUMN VI DEO-CALL-RUURN SCROLL UP THE SCREEN nY-RETURN RESTORE THE CHARACTER RETURN TO CALLER SET-CURSOR- INC NEXl ROW SET-CURSOR ESTABLISH THE NEW CURSOR

BH,AH AX,

28 C9 86 18
8A 16 004A R FE CA U4: CD 10

MOV SUB MOV MOV OEC

ex,cx
OL

601 H
PTR CRT_COlS

DH,24 OL, BYTE

omo

INT

1011
AX VIDEO RETURN

07B2 07B2 0(83 07B6 0786 07A8 07138 07BA

U5: 58
E9 0144 R
POP JMP

u6:
FE C6 U7 :
INC MOV JMP Oil

134 02
EB f4

AH,2 U.

; ----- BACK SPACE FOUND 01BC 07BC O"/BF 07C1 07C3 U8:

80 74 FE EB

fA 00 F7 CA F3

CMP

JE
OEC JMP

OL,O U7

DL
U7

ALREADY AT END OF LINE SET CURSOR NO JUST MOVE I T BACK SET_CURSOR

=-

;----- CARRIAGE RETURN FOUND 07CS 07CS 07C7 U9: MOVE TO FIRST COLUMN SET_CURSOR

B2 00 EB EF

MOV JMP

DL,O U7

LI HE FEED FOUND
07C9 07C9 07CC 07CE U10:

BO FE 75 E8 EB BC

"
U11 :

CMP JNE JMP

DH,24

u6
U1

BOTTOM Of SCR[EN YES, SCROLL TIl[ SCREEN NO, JUST SET THE CURSOR

-- BELL FOUND 0700 0700 0702 0705 0707


MOV

83 02 EB 0000 E EB DB

CALL
JMP

BL,2 BEEP

US
ENOP

; ; ;

SET UP COUNl FOR BEEP SOUND THE POD BELL TTY RETURN

WR I TE_ TTY

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

0707 0707 Q7DF

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
PROC NEAR

03 011

Video

5-141

;----- WAIT

FOR LIGHT PEN TO BE DEPRESSED AH,O DX,AODR_6845 DX,6 AL,DX AL,4 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

070r 07E1 07E5 07E8 07E9 07E8 07EO

(3/1 00 8B 16 0063 R 83 C2 06

Mav Mav
ADO

EC
A8 04 74 OJ E9 0872 R

TEST JZ
JMP

'N

V6 A V6-

NOW TEST fOR LICHT PEN TR I GGER 07FO 07F2 07 F4 A8 02 V6_A: TEST JNZ
JMP

75 03 E9 087C R

AL,2 V7A V7

TEST LIGHT PEN TRIGGER RETURN W! THOUT RESEH I NG TR I GoER READ THE VALUE ; IN

; ----- TR I OOER HAS BEEN SET, 07F7 07F7 V7A: 84 10

Mav Mav
MDV OUT

AH,16

LI GHT PEN REG I STERS ON 6845 IN OX

INPUT REGS POINTED TO BY AH, 07F9 07FD 07FF 0800 0802 0603 0804 0806 0807

AND CONVERT TO ROW COLUMN

88 16 0063 R 8A C4
EE

EB 00
42 EC 8A E8 4A FE C4 8A C4

JI1P INC IN

OX,ADOR_6845 AL,AH DX,AL SHORT $+2

ax

Mav
DEC
INC

AL,DX CH,AL

OX
AH AL,AH OX,AL

ADDRESS REGISTeR FOR 6845 REGISTER TO READ SET IT UP 10 DELAY DATA REGISTER GET THE VALUE SAVE IN CX ADDRESS REG I STER 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 MODE VALUE TO BX DETERM I NE Afv.OUNT TO SUBTRACT TAKE I T AWAY CONVERT TO CORRECT PAGE OR I GIN I r POSITIVE, DETERMINE MODE <0 PLAYS AS 0

OB09
0806

Mav
aUT

EE
42 EB 00

OBoe
0800

INC
JMP

OX
SHORT $+2 AL, OX AH,CH

OSOF
0810

EC
8~

E5

Mav Mav Mav


SHR SUB

"

; ----- AX HAS THE VALUE READ

0812

0816
0818 0810 081f 0823 0825 0827

SA 1 E 0049 R 2A FF 2E: SA 9F 0707 R 213 C3 88 lE 004E R 01 EB 28 C3

SUB MOV SUB

8l, CRT MODE BH, BH BL,CS:V1[I3Xj AX,BX BX, CRT _START

eX,l
AX,BX

0829

79 O? 28 CO

JNS
SUB

V2
AX,AX

;----- DETERMINE MODE Of OPERATION

0826
082'B 0820

V2: B1 80 72 80 74 03 JE 0049 R 04 2A 3E 0049 R 07 23


MOV CMP

OB32 OB34
0839

JB
CMP

V4 V4

CL,3 CRT MODE,4 CRT_MODE,7

DETERM I NE !<lOOf SET *8 SHIFT COUNT DETERMINE IF GRAPHICS OR ALPHA ALPHA_PEN ALPHA_PEN

JE

; ----- GRAPH I CS MODE 0838

82 28
f6 F2

Mav
DIV

DL,40

0830

DL

DIVISOR FOR GRAPHICS DETERM I NE ROW'( AL) AND COLUMN( AH) Al RANGE 0-99, AH RANGE 0-39 SAVE ROW VALUE INCH

DETERMINE GRAPHIC ROW POSITION 083F 0841 BA 02 8A 2A BO 75 Bl DO E8


MOV

0
DC

ABO
MOV SUB CMP

08Li3

0845 0847
DB/IC OB4E 0850 0652 0852

FF
3E 0049 R 06 04 UII E4 V3:

JNE
MOV

CH,AL CH,CH BL,AH BH, BH CRT MODE,6 V3 -

*2 FOR EVEN/ODD fiELD


COLUMN VALUE TO BX MULT I PLY BY 8 FOR MEG I UM RES DETERMINE f1EDIUM OR HIGH RES NOT HIGH RES SHI-FT VALUE FOR HIGH RES COLUMN VALUE TIMES 2 FOR HIGH RES NOT HIGH RES MULT1PLY-*16 FOR HIGH RES

Cl,4
AH,l BX,CL

SAL SHL

03 E3

;----- DETERMINE ALPHA CHAR POSITION 0854 0856 0858 085A 08SC 8/\ 8A DO 00 EB
DI~

FO EE EE 12

Mav Mav
SHR SHR JMP

DL,AII OH,AL OH,l DH,1 SHORT V5

COLUMN VALUE FOR RETURN ROW VALUE DIVIDE BY 4 rOR VALUE IN 0-24 RANGE II GHCPEN_RETURN_SET

;----- ALPHA MODE ON LIGHT PEN 08SE OBSE 0862 086 1 1 0866 0868 086A 086C 086E 0870 0870 0872 0872 0873 0877 087A 0878 V4: F6 36 004A R 8A fO 8A 04 BYTE PTR CRT GOLS DH, AL DL,AH AL,CL CH,AL BL.AH BIi, BH BX,CL AIi,l
OX

Mav Mav Mav


XOR
SAL V5:
MOV

DIV MOV

02 EO
8A [8 SA DC

SAL

32 fF 03 E3
84 01

ALPHA_PEN DETERMINE ROW,COLUMN VALUE ROWS TO DH COlS TO OL MULTIPLY ROWS ~, 8 GET HASTER VALUE TO RETURN REG COLUMN VALUE TO ax

l i GHT PEN RETURN SET


PUSH
MOV ADD OUT POP

v6: 52
88 16 0063 R 83 C2 07 OX, ADOR_6845 DX,7 DX,Al
OX

EE
5A V7:

oa7C 087C
0870 087E

INDICATE EVERTH1NG SET LI G~n PEN RETURN SAVE RETURN VALUE (IN CASE) GET BASE ADDRESS PO I NT TO RESET PARM ADDRESS. NOT DATA, IS IMPORTANT RECOVER VALUE RETURN_NO_RESET

50
5F 5E

POP

087F
0880 0881 0882 0883 0884

1F
1F 1F 1F 07 CF

pap POP POP POP

BP
DI 51

as

OS

DISCARD SAVED BX, CX, OX

POP
POP

os
OS

0885 0885

POP I RET READ LPEN CODe ENDS

ES
[NDP

END

5-142

Video

0000

TITLf 11/22/[13 BIOS . L I 5T I NCLUDE SEGMENT. SRC CODE SEGMENT BYTE PUBL I C EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTHN EXTRN EXTRN EXTRN EXTRN EXTflN PUBl.IC PUBL IC PUBL I C [;8042: NEAR 08F 4Z;NEAR
DD5:NEAR

PRl

HEX: NEAR

Dl :NEAR
D2: NEAR P MSG: NEAR D2A: NEAR PRT SEG: NEAR PROC SHUTDOWN: NEAR eM3: NEAR E_.MSC: NEAR MEMORY SIZE DETERMINE 1 (QUI PMENT 1NMI INT 1SET::::TOO-

; --- I NT 12 ----- ------ ---- -------------- --------------- --MEMORY SitE DETERMINE TH I S ROUT I NE RETURNSS THE AMOUNT OF MEMORY IN THE SYSTEM AS DETERMINED BY THE POST ROUTINE.S. NOIE THAT THE SYSTEM MAY NOT BE ABLE TO USE I/O MLMORY UNLESS THERE I S A FULl. COMPLEMENT OF 512K BYTES ON THE PLANAR. INPUT NO REC I STERS THE MEMORY SIZE VARIARI F IS SET DURING POWER ON DIAGNOSTICS ACCORDING TO THE FOLLOWING ASSlJtlIPTIONS: 1. CONFIGURATION RECORD IN NON-VOLATILE MEMORY EQUALS -IHE ACTUAL MEMORY SIZE INSTAl.LED. 2. Al.L INSTALLED MEMORY IS I-UNGrIONAL. IF THE MEMORY TEST DURING POST INDICATlS LESS, THEN THIS VALUE BECOMES TilE DEFAULT. IF NON-VOLAT I LE MEMORY IS NOT VALID (NOT INITIALIZED OR BATTERY FAILURE) THEN ACTUAL MEMORY DE rERM I NED BECOMES THE UUAUL T. ALL MEMORY fROM 0 TO 640K MUST BE CONT I GUOUS.
'" NUMBER OF CONTIGUOUS

3. OUTPUT

(AX)

1K BLOCKS OF t"lEJ>'IORY

ASSUME

CS:CODE,DS:DATA

0000 0000 0001 0002 0005 0008 0009 DOOA

MtMORY SIZE DUERMINE 1

FB
1E

- sr 1-

PROC FAR IN1ERIWPTS BACK ON SAVE SEGMENT EST ABL I SH ADDRESS! NG GET VALUE RECOVER SEGMENT RETURN TO CALLER

[8 0000 E Al 0013 R 1F CF

PUSH OS CALL DDS MOV AX,MEMORY_SIZE POP OS I RET MEMORY_SiZE_DETERMINE_l ENDP

; --- 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 aOUA
FqlJl PMENT 1

CS; CODE, OS: DATA FAR

PROC

>

oooe
0013

OOOA OOOB

FB 1E
E8 0000 E Al 0010 R 1F CF

STI PUSH CALL

ENTRY PO I NT FOR ORG 0 F84DH INILRRUPTS BACK ON

os
DDS

SAVE SEGMENT REG I STER

OOOF DOl? 0014

AX, EQU I P_FLAG MDV POP OS I RET 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. PARITY CHECK 1 = PLANAR BOAIW MEMORY FAILURE. PARITY CHECK 2 = OFF PLANAR BOARD MEMORY FAI lURE.

ESTABL I SH ADDRESS I NC GET THE CURRENT SETT I NGS RECOVER SEC/1ENT RETURN TO CALLER

0014 0014 0015 0017 0019 00113 001D 001 F

NMI
.

INT 1 PROC
-ASSUME

NEAR DS: DATA


AX

50
E4 FE EB EG 80

CO
00 80

PUSH IN INC
JI~P

OUT

AL, MFG PORT AL SHORT $+2 MFG_PORT, AL AL, PORT_B AL,PARITY_ERR

SAVE OR I G CONTENTS Of AX I NCRf.MENT NM I COUNT I N DELAY SET COUNT PAR I TY CHECK?

E4 61 A8 CO

IN TEST

BIOS

5-143

0021 0023 0025 0028 0028 002A 0020 002F 0031

8A EO 75 03 E9 OOCl

MOV JNZ JMP

AH,AL NMI 1

SAVE PAR I TY STATUS NO, EXIT FROM ROUTINE

014 ~

NMI 1: ;--:;---- GET THE SWITCH SETTINGS 80 AD E8 0000 E E4 60 MOV CALL AL,OIS KBO C8042 ~ Al, PORT A

o I SABLE
FLUSH tojPUT

THE KEYBOARD

IN
MOV CALL CAll

BO CO
E8 0000 E

~~6~~AO=8042_1

GET THE SWITCH SETT J NGS


ISSUE THE COMMAND WAI T FOR OUTPUT BUFF FULL GET THE SWI TeH SAVE SWI TCH

0034 0037
0039 0038 003E 0040 0043

8 0000 E 4 60 E6 80
BA 8E BE F6 75 BE ---- R DA 0000 E c4 40 03 0000 E

IN
OUT

OBF 42 Al, PORT A MFG_POR'='AL OX,OATA OS, ox 51 ,OFFSET 01 AH,40H NM1_2 SI,OFFSET 02

0046
0048 004B

MaY MOV MOV TEST JNZ MOV

ADOR OF ERROR MSG I/O PARITY CHECK DISPLAY ERROR MSG MUST BE PLANAR

004B 0040
0050 0052

co

B4 00 AD 0049 R 10 E8 0000 E

0055
0057 0059

80 FF 6 70

E4 61
EB 00

005B 0050
005F 0061 0063 0065 0067 006B 006e 006E

DC DC
E6 61 EB 00 24 F3 6 61 88 lE 0013 R

Fe
2B 02

006E
0070 0072 0075 0077 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

BE OA 8E C2 B9 8000 2B F6 F3/ AD E4 61 86 C4 81 FA 4000

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

IN
XCHG
eMP

72 OC
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 8e [8 BO E8 BO E8 BO 8 FA F4 OA 0000 28 0000 53 0000 29 0000 E E E
E

JB
eMP JAE

IN
TEST NMI_3: NMI 4: NMI=S:

JZ TEST JMP TEST JNZ


ADO SUB

"NZ
ell

MOV CALL HLT

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

SEE I F PAR I TY CHECK HAPPENED SAVE PAR t TY CHECK CHECK FOR END OF OF FIRST 256K 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 HALT SYSTEM

00B5
0087 008A OORe aOBF OOCO OOCl OOCl 00C3 DOC5

PRTNMI: MOV CALL MOV CALL MOV CALL MOV


CALL

OX,OS PRT SEG AL, T{' PRT ttEX AL TS' PRT HEX AL, T) I
PRT~HEX

PR I NT SEGMENT VALUE PRINT IS)

ell
HLT 014: MOV
OUT

HALT SYSTEM TOGGLE NMI 10 DELAY RESTORE OR I G CONTENTS OF AX

BO 8F E6 70 EB 00

OOC7
OOC9 DOCS ooce OOCD

80 Of
E6 70

JMP MOV
OUT POP

AL,8FH CMOS_PORT,AL SHORT S+2 AL,OFH CMOS_PORT ,AL


AX

58
CF

IRET NMI JNT 1 ENOP PAGE

------------------- - --- ------------------------------- - --------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 OUTPUT TIMER LOW T!MER-HIGH TIMER-OFL ALL REG I STERS UNCHANGED COUNTS SEC COUNTS~M I N
COUNTS~HOUR

SECONDS MI NUTES HOURS REGISTER A (UPDATE CMOS VAll 0 ) F ZERO

IN PROGRESS)

:: '" '"' :: = :: = ;:;; "" ;::

0012 0444 0007 0070 0071 OOOE 0000 0002 0004 OOOA = 0080 OOCO

CMOS ADR CMOS-DATA CMOS-VALl D CMOS-SECONDS CMOS-MJ NUTES


CMOS~HOURS

CMOS=REGA UPDATE TIMER SET TOO PROC ~ PUSHA

EOU EQU EQU EQU EQU EQU EQU EQU EQU EQU EQU NEAR

18 1092

7
70H

65543 -

65536

71 H
OEH OOH 02H 04H OAH 80H

5-144

BIOS

00 CD OOCE DOCF

60 1E BB

DB

060H
OS

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 00 70 00 71


MOV MOV SUB MOV MOV MOV MOV OUT JMP IN AND JNZ SUB MOV OUT JMP IN

0002
0004 0006 0009 OODe OODF OOEl DOn DOES 00E7 00E9 OOEB OOED QOH OOF1 DOF3 OafS

OOF7
OOF9 OOFB OOFE OOFE 0100 0102 0104 0106 0108 010A 0100 010F 0111 0113 0115 0117

8E 2B A2 A3 A3 BO 6 EB E4 24 75 28 BO E6 EB E4 A8 74 E2 EB BO E6 EB E4

UI P:

TEST
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
UIP

; ESTABL I SH SEGMENT
RESET T I MER ROLL OVER AND TI MER COUNT 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 INDICATOR

LOOP
JMP

POD_DONE AL, CMOS_SECONDS CMOS_AOR,AL SHORT $+2 AL, CMOS_DATA AL,59H TOO_ERROR CVT_BI NARY 8L, COUNTS_SEC
BL

; CMOS CLOCK STUCK ACCESS SECONDS VALUE I N CMOS

READ_SEC:
MOV OUT JMP IN CMP JA

3C 59 77 40 E8 0176 R
B3 12

GO

ARE THE SECONDS WITHIN LIMITS? I F NOT IT TO 61NARY

CALL
MOV MUL MOV MOV OUT JMP IN CMP JA

CONVERT

0119
0119 0110

f6 8B BO E6 EB E4

E3 C8 02 70 00 71

COUNT fOR SECONDS ACCESS MINUTES VALUE I N CMOS

CX,AX AL, CMOS~M I NUTES CMOS_AOR,AL SHORT $+2 AL, CMOS_DATA AL,59H TOO_ERROR CVT 81 NARY BX, COUNTS_M I N
BX

3C 59 77 38 8 0176 R BB 01144

GO

ARE THE MINUTES WITHIN LIMITS? I F NOT IT TO BINARY

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 0155 0156 0157

CALL
MOV MUL ADD MOV MDV OUT JMP IN CMP JA

CONVERT

f70
03 86 BO E6 EB 1::4 3C 77 E8 88 83 F6 03 83 89 A3
FA

COUNT FOR MINUTES

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

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
BL

ACCESS HOURS VALUE I N CMOS ; ARE THE HOURS WITHIN LIMITS? ; GO I F NOT ; CONVERT IT TO BINARY COUNT FOR HOURS

AX,CX DX,OOOOH T I MER_H I GH, OX T I MER_LOW, AX AL,021H AL,OFEH 021H,AL


OS

POD_DONE: E4 21
24 F. FE CLI IN AND OUT STI POP

** 10 DELAY NOT REQU I RED BE SURE T I MER I S ENABLED

**

E6 21

1F
61 C3 1F 61

POPA
DB RET

061H
OS

TOO_ERROR:
PDP

0157
0158 0159 01se 015f 0161 0163 0165 0167 0169 016B 0160 016f 0171 0173 0175 0176 0176 0176 0178 0178 017A 0178 0178 017A 017A 017B 0170 017f 0180 0180

POPA BE 8 BO 6 86 EB E4 OC 86 E6 86 EB E6
C3

RESTORE SEGMENT RESTORE REGS 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

0000 E 0000 E 8E 70 CII 00 71 all C4 70 C4 00 71

DB MOV

CALL
MOV OUT

XCHG
JMP IN OR

XCHG
OUT

XCHG
JMP OUT

RET

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

SET_TOO ENDP CVT_BI NARY 8A EO DO EC


CD 04 MOV

+ ??OOOO +
+ ?10001

SHR
DRG DB ORG DB AND AAD

ISHR LABEL

LABEL

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 ENor RESULT IS IN AX CONVERT UN PACKEO BCD TO B I NARY

211 Of
05 OA
C3

RET

CVT BINARY ENDS CODE


END

BIOS

5-145

5-146

BIOS

0000

TITLE 11/22/83 810S1 . LIST I NCLUDE SEGMENT. SRC CODE SEGMENT BYTE PUBL I C 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

. - - - -------- ------ -------------------------- -- --------------Extensions (AH) = 80H OEVICE OPEN (BX) = OEVICE ID (CX) = PROCESS ID

I N PUT - UNUSED FUNCT IONS (AH) '" Oil THROUGH 7F RETURNS FOR THESE FUNCTIONS ALWAYS (AH) == 86H,

CF '" 1)

---

(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 (AH) '" 91H (ALl DEVICE BUSY LOOP SEE TYPE CODE 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 DOli 01 Ii 021i Bali = = = = OESCR f PT I ON TIMEOUT YES YES NO NO YES YES

0 I SK 0 I SKETTE KEYBOARD NETWORK ES:BX --> NCB FDH = 0 I SKETTE MOTOR START FEH = PRI NTER

0000 0000 0001 0004 0006

CASSETTE
FB 80 72 80 OA

0009

FC 80 46 EC 80 4 CC 41 CC 3D CC 38 CC 78 CC 31 CC 07 CC

OOOB 0000
OOOF

74 45
FE 7V, FE 7'-i FE 74 FE 74 FE 74 FE 74 FE

0011
0013 U015 0017 0019 0018 0010 DOlF 0021 0023 0025

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

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

0027 0029

75 06 E9 0183 R
E9 0132 R FE CC C1_A: Cl_B:

JNZ
JMP

e1 0
BLOCKMOVE WAI T MOVE BLOCK WAIT

002e
002f 0031 0033 0036 0038
OQ3A

JMP

DEC
JNl
JMP

All

75 03
E9 0302 R
FE CC 75 03 E9 03E6 R 80 EC 07 C1_C:

e1 e

EXT _r~EMORY

GO GET THE EXTENDED MEMORY CHECK FOR FUNT!ON 89 SWAP TO V I RTUAL MODE CHECK FOR FUNCT I ON GO I F NOT

DEC JNZ
JMP

All (;1 U SET_VMODE


AH,7

0030 0040

Cl_D:

SUB

90

0042

75 03 9 0475 R

JNZ
JMP

e1

E DEV ICE_BUSY

00/.5 0047
00LI9

FE CC 75 03
E9 0479 R

Cl_E:

DEC JNl
JMP

e1

All
I NT_COMPLETE

CHECK FOR FUNCT I ON 86 GO I F NOT SET BAD COMMAND SET CARRY FLAG ON

004C
004E

B4 86
F9 CA 0002

Cl: C1

MOV STC

AH,86H

004F
004F 0052

RET
DEV_OPEN: DEV_CLOSE: PROG_TERM: SYS_REQ: JMP CASSETTCIO_l EVENT WA I T ASSUME PUSH CALL TEST JZ
POP

0052
0052
0052 0052 EB fB

00?4
0054 0054 0055 0058

Cl F END? PROC NEAR CS:CODE,OS:DATA OS


DDS

; RETURN

1E
E8 0000 E
F6 06 OOAO R 01

SAVE CHECK fOR FUNCTION ACTIVE SET ERROR RETURN

0050 005 F 0060 0061

74 04
1F F9 EB EC

RTC WAIT FLAG,Dl EVENT WAIT 1 OS -

STe
JMP

0063
0063 0064

0066

0068
006A 006E 0072

A1 FE Al 06 009A R 89 1 E 0098 R

FA E4 211 E6 8C

EVENT WAIT 1: CLI IN


AND OUT MUY MOY MOY MOV MOY MOY OUT

0076
007A

007F 0081 0083

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

0085 0087

AND
OR PUSH
MOY OUl POP OUT

"

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

NO INTERRUPTS ALLOWED ENSURE I NTERRU PT UNMASKED


SET UP TRANSFER TABLE

SET ON FUNCT I ON ACT I VE SW ITCH ENABLE PIE

a08A

0089

ooec
008E 008 F 0091 0092

80 DB
Ff1 70 58 E6(1 FB 1F EB BA

AX AL,OBH CMOS_PORT,AL AX CMOS_PORT+l,AL

0093
0095

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 INPUT (DX)"'O READ THE CURRENT SWI TCH[S RETURNS (AL)", SWITCH SETTINGS (DX)=l READ THE RESISTIVE INPU1S RETURNS (AX)=A(x) VALUE (BXJ=A(y) VAIUf (CX)=B(x) VALUE (DX)=B(y) VALUE I F NO ADAPTER CARD OR I NVAL I 0 CALL

IN BITS 7-4

CY fLAG ON

0095 0095

0096 0098
009B

FB 88 C2 SA 0201 OA CO

009D D09F
OOAl 00A3 DOA5 DO AS OOA6 OOA8 OOA8 OOA9 OOAB OOAD OOAD

74 FE 7/, EB

09
C8 OA A7

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 -

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

FB EB A7 jOY_2 : EC 24 FO EB F8 JOY_3: 83 E8 51 83 E8 51 83 E8 51 B3 E8 8B 59 56

511
JMP

e1 -

IN AND
JMP

AL, OX AL,OfQH JOY_ 1 6L,1 TEST_CORD

STRI P UNWANTED BITS OFF FINISHED

01
00C8 R 02 OOGB R

MOV

OOM
0082 0083 00B5 00B8

CALL PUSH
MOV

ex
BL,2 TEST_CORD

SAVE A(x) SAVE A(y)

VALUE VALUE

CALL PUSH
MOV

ex
BL,4 TEST_CORD

00139

04
OOCB R 08 01

aaBF

OOBB aasE 00C1 OOC4 OOC6 OOC7

CALL PUSH
MOV

ex
8l.,8 TEST CORD OX,cx

SAVE 8(x) VALUE SAVE B{y) VALUE GET B( x) VALUE GET A( y) VALUE GET A( x) VALUE FINISHED - RETURN

oaCB

CALL
MOV POP POP POP JMP

ex
BX

OOG8
OOC9 OOCEI

58
E6 DA

AX JOY_1
PROC NEAR

OOCB

52

TEST_CORD PUSH

OX

SAVE

5-148

BIOS 1

OOCC OOCD OOCF 0001 0003 0005 0007 0009 00D8 OODO

FA

CU
l.J3 00 40 00 EO 40 [0
MOV OUT JMP IN JMP MOV IN

80 00
E6 Ell E4 F:B 8A E4 86
50

XCHC PUSH
MOY OUT JMP

AL,O TIMER+3,AL SHORT $+2 AL,TIMER SHORT $+2 AH,Al AL,lIMER AH,AL
AX

BLOCK I NTERRU PTS WH I LE READ I NG SET UP TO LATCH T I MER a READ LOW BYTE OF TIMER 0 READ HIGH BYTE or TIMER 0 REARRANGE TO HIGH, LOW SAVE

OODE
OOEl 00E2 ODEll

B9 OliFF

EE
EB 00
EC

CX,Ip-FH OX,AL SHORT $+2 AL,DX AL,BL TEST CORD 1 CX,OCX

SET COUNT
FIRE T I MER READ VALUES HAS PULSE ENDED? ; ORIGINAL COUNT SET

00[4 005
00E7 00E9 OOEC

84 c3 EO FB 83 f9 00
59

TEST CORD 1: IN T[ST LOOPNZ


CMP POP

OOEO
DOEF oaFl OOF3 OOF3 00F5 OOF7 DOF9 OOFB OOfD DOFf 0101 0103 0105

75 04 2B C9 EB 20 BO E6 EB E4 8A 00 43 00 40 EO

JNZ
SUB JMP

~~~~~ TEST_CORD_~
SHORT TEST_CORD_3 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

6 COUNT
;

FOR RETURN EXIT WITH COUNT = 0

TEST CORD 2: MOV


OUT JMP IN MOV JMP IN

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

EB 00
E4 40 86 EO

XCHC
CMP

3B C8 73 OB
52

Olor
0108 010B 0100

JAE PUSH
MOV

SA FFFF 2B 00 03 CA
5A

SUB
AOO POP JMP

OlOF
0110 0112 0112
01111

EB 02
26 C8
81 01 01 01 D1

ADJUST FOR WRAP DX,AX CX, OX OX ; SHORT TEST_CORO_5 eX,AX

TEST CORD 11: SUB TEST_CORD_5: 1 FFO


ANO

0111j 0118 011A 011e 011E 0120 01?0 0121 0124 012:; 0126 0129 0129 012A 012C 012E 012f 0130 0131 0132 0132 013? 0132 0133

E1
E9

[9
E9 E9

SHR SIlR SHR


SHR

ex, 1 FFOH CX,l eX,l CX,l CX,l


OX,201H

ADJUST

FR

TEST CORD 3: S11


MOY

BA 0201

51
50

PUSH PUSH
~10V

ex
AX

I NTEHRUPTS 8ACK ON FLUSH OIHI:.K INf-'U'IS COUNT

69 04 f F [C A8 Of EO FB
58 59 5A C3

CX,4FFH AL, OX AL,OfH TEST_CORD_6


AX

TEST CORD 6: IN TEST l.OOPNZ


PDP
POf>

ex
OX
ENDP ENDP NEAR
OS DDS

POP

SET COUNT
Rl'TURN

RET
TEST CORD JOY_STICK WAIT

1E

0136
01313 0130 013E 013F 0142 0142 0143 0145
014~{

E8 0000 E F6 06 OOAO R 01 71j 05

PROC PUSH CAll TEST JZ


POP STC JMP

SAVE TEST FOR FUNCTION ACTIVE SET ERROR RETURN

RTC WAIT FLAG,Ol WAIT 1


OS -

1F
F9

E9 004F R WAI T_':


CA

C1_F

011~9

0140 0153 0157 015B 0160 0162 016 11 0166 0168 016A 01613 0160 016F 0170

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

CI I IN AND OUT MOV

'IOV
MOY MOV MOV MOV

BO DB
E6 70 III 71 24 7F

OUT
IN AND OR

OC 110

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
AX

50
BOOB
[6 70
58

PUSH
Mav

OUT
POP OUT

AL,OBH CMOS_PORT, AL
AX

[6 71
FB

CMOS_PORT+1, AL ENABLE RTC WAIT FLAG,080H WAI T 2 RTC WAIT FLAC,O OS Cl_F INTERRUPTS CHECK FOR END OF WAIT SET FUNCTION INACTIVE

0172 0173 0173 0178 017A 017F 0180


0183

STI WAI T_2: TEST


JZ MOY POP JMP

F6 06 DOAD R 80 74 F9 C6 06 OOAD R 00

1F
E9 004F R WAIT PAGE

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.

7. 8.

3. 4. 5. 6.
9.

~age
;

-_.--------------------------- ---------------------------------14.

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

-------------- --- --------------- --.- -- ----- --------------------: GOT


GOT.
(ES: SI )--

or

THE fOLLOWING DIAGRAM DEPICTS THE ORGANIZATION

+00 +08 +10 +18 +20 +28

1----------------1 1----------------1
I I I I
I
TARGET GOT BIOS CS 55

DUMMY i 1 1 1----------------1 r GOT LaC I 1 1 1----------------1 SOURCE GOT

I I I I
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 SOURCE.TARGET OW STRUC

ow

DB DB OW ENDS

SEGMENT LIMIT ('-65536 BYTES) 24 B IT SEGMENT PHYS! CAL ADDRESS (0 TO (16M-l) ACCESS RIGHTS BYTE RESERVED WORD

---------------------------------------------------------------: ---------------------------------------------------- -- ---------------THE GLOBAL DESCRIPTOR TABLE (ACTUAL LOCATION POINTED TO BY ES:SI) ; ------------------------- -- ------------------------- -----------------; ;
BLOCKMOVE_GDT.DEF 0000 0008 0010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 DUMMY STRue FIRST OESCR I PTOR NOT ACCESS I BLE LOCATION OF CALLING ROUTINE GOT SOURCE oESCR I PTOR TARGET DESCRI PTOR

DQ

CGOT_LOe OQ SOURCE TARGET BIOS.CS TEMP_5S

OQ DQ DQ DQ
ENOS

0018
0020 0028 0030

00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

B I OS CODE oESCR I PTCR


5T ACK OESCR I PTOR

BLOCKMOVE_GDT.OEF ;

--------------------------_.----_._-------------------------------._--

5-150 BIOS 1

ASSUME ASSUME 0183 BLOCKMOVE ;------0183 0184 01 B5 0186 0187 FA FC 60 06 lE


;---~---

CS; CODE DS;DATA NEAR

PROC

INITIALIZE rOR VIRTUAL MODE

eLi
CLD

PUSHA
OR

NO I NTERRUPTS ALLOWED SET 0 I RECT I ON SAVE GENERAL PURPOSE REGS 060H ES OS SAVE EXTRA SEGMENT

PUSH PUSH

CLEAR EXCEPTION ERROR FLAG


SUB
OUT

0188 018A

2A CO E6 80

AL,AL MFG_PORT, AL

SET TO 0

;------- GATE ADDRESS BIT 20 ON 018C 018E 0191 0193 0195 01')7 0199 B4 OF 8 03BO R 3C 00
MOV CALL eMP JZ MUV

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 Bl4:
MOV
OU

[6 70 EB 00 BO 09
E6 71

JNP MOV
OUT

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

01A6 01A8 OlAA OlAC OlAF OlAF 01Bl OlAF OlAF 01Bl 01 Bl 01B2 01B5 01B5 01B7 01B5 01B5 01B5

8e CO 8B OE 8A Fl~ 80 E6 FO

MOV MOV MOV

AND

DO EE
CO 04 80 E4 OF 01 EO

+ ??OOOO + + ??OO01 +

ISIIR LABEL
SHB

lABEL
ORG DB

DRC DB AND

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
AH,OOFH AX,II ByrE AX,1 BYTE OFFSET CS: ??0003 NEAR DC1H OFFSET CS; ??0004 STRIP I-IICH NIBBLE FROM AH SHI FT AX

Cl
04 03 08 73 02

+ ??0003 + + 170001 1 + + ??0005 +

ISHL LABEL SHL lABEL ORC LABEL


DB

01B7
0187 01B8 01l1A

ORe
DB AUU

alBC

FE C6

018E 01C2 01('6 OlCC

26; 26; ;>6; 26;

88 74 DC 89 5C OA C'1 411 08 FFFF C7 1111 DE 0000

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

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
DB

0102 0105 0106 0107 0107 aIDA 0107

BD 02Al 2E OF 88 5E 00

cs

BP,OFFSET ROM_,OT_LaC LOAD THE I DT FROM lHIS AREA

O?lH

LI DT

[131']
OOFH BYTE BX,WORD PTR [BPj BYTE OFFSET CS:??Q007 00111 OFFSET CS; ??0008

REGISTER

+
+ ??O007

DB

+
+ ??0008

+
01

LABEL MOV I ABEL ORC


DB
DRG

0107 OIDA

010A

26 OF 8854 08 01 + +

alOe

010B

01UC 01 DF 01De 01 DC OIDF

+ +
+

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

01DF

E8 0000 E

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 DO 0069 R C4 006! R
MOV MOV
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)
01 [C BC 00 8A Fli 80 6 FO
MOV MOV AND

01 EE 01 FO 01F3 01 F3 01F5 QlF3 01 F3

+ ??OOOC DO EE CO

+
+ ??ODOD

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

OFFSET CS:??OOOO

04 80 4 OF

DB

4
AH,OQFH AX,4 BYTE AX,l BYTE OfFSET CS; '?OOOF NEAR OC1H OFFSET CS:7?0010

+
01

??OOOF

EO

D1F9

01F9 01 F9
OHB OHB

+ + ??001O + + 7?0011

C1 04

AND ISHL LABEL SHI LABEL ORG LABEL DB ORC

STR J PHI GH NIBBLE FROM AH SHIFT AX

OB
;-------- 55

4
IS NOW IN POSITION FOR A 24 BIT ADDRESS --> SETUP THE OEseR I PTOR 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 HIGH BYTE LOW WORD SS SEGMENT LIMIT ; SET CPL 0

01FC 0200 0204 020A

26: 26; 26: 26:

88 74 89 44 C7 44 c6 44

2C 2A

BU:

28 FFff
20 93

MOV MOV MOV MOV

; -------- STACK

--->

SET UP THE CODE SEGMENT DESCR I PTOR

OZOF
0214 021A 0220 0225

26: 26: 26: 26: 26:

C6 C7 C7 C6 C7

4!~

44 44 44 44

24 22 20 25 26

Of 0000 fFFF 96 0000 ;------

MOV MOV MOV MOV MOV

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

SWITCH TO VIRTUAL MODE MOV LMSW DB LABEL MOV LABEL ORC DB ORC JUMPfAR DB 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

0226 022E 022F 022F 0231 022F 022f 0231 0231 0232 0234 0236

68 0001

OF
BB FO

+
+

?70012

+ ??0013

01
EA
0236 R 0020

+ +

MUST PURGE PRE-FETCH QUEUE

OW
OW VI RT:

; Jump far direct ; to th i s offset in this segment

;------- SET STACK SEGMENT 0236 0239 B8 0028 BE DO MOV MOV AX, TEMP 55 SS,AX -

(NEEDED FOR POSSIBLE EXCEPTIONS) USER'S SS+SP IS NOT A DESeRI PTOR

;------- SETUP SOURCE/TARGET REGISTERS 023B 023E 0240 0243 0245 0247 0249 B8 ~OlO 8E 08 B8 0018 8E CO 28 FF 2B F6 F3/ A5 MOV MOV NOV MOV SUB SUB AX, SOURCE DS,AX AX, TARGET ES,AX 01,01 SI,SI GET THE SOURCE ENTRY GET THE TARGET ENTRY

GeT INDEX R[GS TO ZERO


MOVE THE BLOCK

REP

MOVSW

;------- CHECK FOR RAM PARITY BEFORE SHUTDOWN 02413 0240 024F Ell 61 24 CO "(4 lC

IN
AND

JZ

AL, PORT_B AL, PAR I TY ERR DONEl -

GET THE PAR I TY LATCHES STRIP UNWANTEO BITS GO I F NO PAR I TY ERROR

;-------- CLEAR PARITY BEFORE SHUTDOWN 0251 0254 0257 0259 02513 0250 025F 0261 0263 0265 0267 0269 026B 26: 8B 04 26: 89 04 86 05 89 05 BO 01 [6 80 E4 61 MOV MOV MOV MOV MOV ES: r SJ LAX AX,DS: [DI] os: l 01 LAX AX,ES:lSI] FETCH CURRENT TARGET DATA WRITE IT BACK FETCH CURRENT SOURCE OATA WR ITE IT BACK SET PAR I TY CHECK ERROR

OUT

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 -

IN
JMP

EB 00 OC OC
E6 61 EB 00

OR
OUT
.JMP
AND

10 DELAY TOGGLE PAR I TY CHECK LATCHES


10 DELAY

24 F3 E6 61

OUT

; -------- CAUSE A SHUTDOWN 0260 E9 0000 E DONE1: JMP

=========-==="'===-=='" ;-------::. RETURN FROM SHUTDOWN 0270 0270 0272 2A CO E6 70 SHUT9: ;------- ENABLE NMI SUB OUT INTERRUPTS

AL, AL CMOS_PORT, Al

;------- GATE ADDRESS BIT 20 OFF 0274 0276 0279 DO E8 0380 R 3C 00 74 OA E4 80 3C 00 75 04 80 03 E6 80


Bl~

MOV
CALL CMP JZ IN CMP J NZ MOV OUT

DU6
0270 027F 0281 0283 0285

AH,OISABLE BIT20 GATE A20 Al,ODONE3 AL, MrG rORT AL,ODONE3 Al,03H MFG_PORT,AL

COMMAND ACCEPTED? GO I F YES CH[CK rOR eRROR WAS THERE AN ERROR? GO IF YES SET ERROR FLAG

; -------- RESTORE USERS STACK 0287 02BA 0280 028F 0292 ,E8 0000 E A 1 0069 R 8E DO Al 0067 R 8B EO OONE3 : GALL
ODS

SET OS TO DATA AREA SAVE STACK SEGMENT RI:.SrORE lHE STACK POINTER

lolOV MOV
MOY MOV

AX, 10_ROM_SEG SS,AX AX,IO_ROM_INIT SP,AX

;------- RESTORE THE USER DATA SEGMENT 0294 1f

POP

OS

RESTORE USER DATA SEGMENT

5-152

BIOS 1

0295 0296 0297 0299 0298 0290 029F 02AD

07

por
POPA OB XGHG
IN

ES

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

61
86 C4 4 80 3C 00 86 EO
FB CF

061H Al,AH Al,MFG_PORT Al,O AH,AL

XGHG 511 IRET

eM'

;-------- ROM lOT LOCATION

"" 0100
D2Al

ROM_lOT_LEN ROM_lOT _LOC:

EQU

32*8

SIZE OF THE EXCEPT I ON

INTERRUPTS

02Al Q2A3 Q2AS Q2A6

0100 02A7 R
OF

00

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 DB CSEG@ H I ; Segment ba se add ress - high byte DB 0 ; Rese rved ;-------- THE ROM EXCEPTION INTERRUPT VECIORS

02A? 02A7 02A9


02AS

03A7 R 0020 00 87 0000 03A7 R 0020 00 87 0000 03A7 R 0020 00 87 0000 03A7 R 0020 00 87 0000 03A7 R 0020 00 87 0000 03A7 R 0020 00 87 0000 03.l\7 R 0020 00 87 0000 03A7 R 0020

02AC 02AD 02AF 02B1 02B3 02B4 02B5 02B7 02B9 028B 02BC 02BO 02BF 02el 02C3 02C4 02C5 02C7 02C9 02CB 02CC 02CO 02CF 021)1 0203 02D4 0205 02D7 0209 020B 02DG 0200 020F 02E1 02E3 024
02E5

00
87 0000 U3Al R 0020 00 87 0000 03A7 R 0020 00 87 0000 U3A7 R 0020 00 87 0000 03A? R 0020 00 87 0000 03A7 R 0020 + +

02E7 02E9 02EB 02EC 02EO 02EF 02Fl 02F3 02F4 02F5

oa {
02F9 02FB 02FC 02FO 02FF 0301 0303 0304 0305 U307 0309

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
U3UC 03UO

00
nges)

08 08
OW

Word count for stack-to-stack copy (only for call TRAP o


~

gates when PL cha

87 0000
G3A7 R 0020

CATE

; Access Reserved

rights byte

U3{]F 0311 0313 0311, 0315 0317 0319 031B 031C 0310 031 F 0321 0323

00
87 0000
03A? R 0020

00
87 0000
03A7 R

0020

00 87
0000 03A? R 0020

0324 0325
032? 0329 032B 032C 0320 032F 0331 0333 0334 0335 0337 0339 0338 033C 0330 033F 0341 0343
031~11

00
87 0000
03A? R 0020

00
87 0000
03A7 R 0020

00
87 0000
03A? R 0020

00
8-( 0000
03A7 R 0020

0345 0347 031.9 0348 03/IC 0340 034F 0351 0353 0354 0355 0357 0359 0356 035C 0350 035F 03fil 0363 036 1, 0365 0367 0369 0368 03GC 0360 036F 0371 0373 0374 0375 0377 0379 0378 037C 0370 OHF 0381 0383 0384 0385

00
87
0000 G3A? R 0020

00
87 0000
G3A7 R 0020

00
07
0000 03AI R

no?o
00
87 0000

03A7 R 0020

00
87 0000
03A7 R 0020

00
87 0000
U3A? R 0020

00
87 0000
G3A7 R 0020

00
87 0000

; 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 TRAP GATE 08 o ~ 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

PL cha

copy (only for

CB

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

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

5154

BIOS 1

0387 0389 038B 038C 038D 038F 0391 0393 0394 0395 0397 0399 039B 039C 039D 039F 03Al 03A3 03A4 03A5

03A7 R 0020

OW OW

00
nges)

DB

EX INT BIOS CS

Destination offset Destination segment selector Word count for stack-to-stack copy (only for ca II gates \t{hen PL cha

87
0000 03A7 R 0020

00 87
0000 03A7 R 0020

00 87
0000 03A7 R 0020

00 87 0000

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

;------- EXCEPTION 03A7 03A7 03A9 03AS 03AE 03AE 03BO rX_1NT: BO 02 E6 80 E9 0000 E EX_I NTl EB FE JMP BLOCKMOVE PAGE MOV OUT JMP

INTERRUPT HANDLER SET EXCEPTION INT

AL,02H MFG_PORT,AL PROC_SHUTDOWN EX_I NTl END?

CAUSE A EARLY SHUTDOWN STAY HERE TILL SHUTDOWN

03BO 03BO 03B1 0384 03B6 03B8 03BA 0313D 03SF 03C1 03C3

GATE A20
FA

-------------------------------------------- - --------- ------PROC


CLl
CALL

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.

--------

E8 75 BO E6 E8 75 8A [6 E8

03C7 R
~

JNZ
OUT

01 64 03C7 R 07 C4

Mav

CALL

60
oge7 R

; 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 80l.j2 OUTPUT WILL SWITCH WITHIN 20 USEC OF ACCEPTING PORT DATA -----

03C6 03C6

e3

GATE A20 RETURN: 'RET

----- ------- -----------.- ------------------ - ------------------ - ---------EMPTY 8042


-THIS ROUTINE WAITS FOR THE 8042 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) INPUT BUFFER TO EMPTY.

03C7 03C? 03C8 03CA 03CA 03CC 03CE 0300 0301 0302

51
2B C9 E4 64 24 02 EO ~A

EMPTY 80112: PUSH SUB EMPTY LOOP: IN


AND

ex

cX,ex

; SAVE CX ;CX=O, WILL BE USED AS TIME OUT VALUE

59
e3

LOOPNZ POP
RET

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 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.
~~;:-MEM~~~

0302 0302 0303 0305 0307 0309 0308 0300 03DF

------ ;~~c ---------------------------- ---------------AL,31H CMOS_PORT, AL SHORT $+2 AL,CMOS_PORT+l AL,AH Al,30H CMOS_PORT, AL

FB BO E6 EB E4

31 70

00
71

86 C4
BO 30 E6 70

ST I MOV OUT JMP IN XCHG MOV OUT

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

031 033 035 036

EB 00 I~ 71 CF

JMP SHORT $+2 10 DELAY IN AL, CMOS_PORT+l I RET RETURN TO USER ENDP EXT MMORY 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.

ES:SI POINTS TO A DESCRIPTOR TABLE (GOT) BUILT BEFORE INTERRUPTI NG TO TH I S FUNCT ION. THESE DESCR I PTORS ARE ARE USD 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 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 INITIALlZD) 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. :

2.
3.

4.
5. 6.

7.
8.

NOTE -

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

3.
4. 5.

Rea I mode

-;;->

Vi rtua I mode ---> DESCRI PTlON:

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

1.
2.

3.

IJ..

5. 6.
7.
8. 9. 10. 11. 12.

page

. ------- ---- ----------------------------------------------- - ----THE FOLLOWING DIAGRAM DEPICTS THE ORGANIZATION Of GOT.

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

5-156

BIOS 1

GOT

(ES; S I)

--

+00

DUMMY

+08 1----------------1 1 GOT I +10

+18 1----------------1 I OS 1 +20 1----------------1 1 ES 1


+28

1 1

1 1 1----------------1
lOT

I 1

1 1 1----------------1 1
I
SS

+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 0040 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 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 GDTPTR lOT PTR USER - OS USER - ES USER SS USER_ CS B1O_CS STRUC FIRST DESCII I ['TOrt NOT ACCESS I BlE
GDT DESCR I PTOR lOT DEseR I PTOR

DC!

00
DO DO DO

USER DATA SEGEMNT DESCRITOR USER EXTRA SEG;'lEN r OEseR I nOR USER STACK SEGMENT DEseR J PTOR USER CODE SEGMENT OEseR I PTOR TEMPORARY B I OS OESCR I PTOR ENDS

00 00 00

V I RTUAL - ENABLE - GDT_OEF

ASSUME ASSUME 03(6 036 036


FA

CS: CODE as: DATA


PROC FAR

X VI RTUAL SET_VMODE:

eLi
;------- ENABLE ADDRESS LATCH BIT 20

NO I NTERRU PTS ALLOWED

03E7 039 a3EC 03[[ 03 ~o 03 F2 03F3 03 F4 03f4 03F5 03F6 03F6 03F9 03f6 03F6 03f9 03 f9 03fA 03fB 03FB 03 FE 03FB 03FB 03FE

BIt 8 3C 74 B4
F9 CF

OF 03BO R 00 04 FF

MOV CALL CMP

J7 MOV
STC I RET

AIt, ENABLE B I T20 GATE A20 AL,OBIT20 ON AII,orrll

ENABLE BIT 20 FOR ADDRESS GATE WAS THE COMMAND ACCE PTED? GO I f YES SET THE ERROR FLAG SET CARRY EARLY EXIT LOAD THE GLOBAL OEseR I nOR TABLE REG

BIT20 ON: SFGOV

ES

26
OF

DB

+ + ??0015
t-

8B 54 08

+ ??0016 +
01

LCDT OB LABEL MOV LABEL ORC OB


ORG

0261t [ SI].CDTPTR OOFH BYTE OX, WORD PTR [S I j. GOTPTR BYTE OFFSET CS:??OD15 00111 OFFSET CS: ??0016
ES

26
OF

SEGOV OB LIDT

LOAD THE

INTERUPT OEseR I PTOR TABLE REG

8B 5C 10

+ + ??0018 + + ??0019 +

DB

LABEL MOV LABEL aRC


DB ORG

026H [Slj.IDTPTR OOFH BYTE BX, WORD PTR [S I J. lOT PTR BYTE OFFSET CS: ??0018

01

00lH
OFFSET cs: ??0019 INTERRUPT CONTROLLER #1 TO TII( USER SPECIFI[[) OFFSET START INiTiALIZATION SEQUENCE-ICW1 EDGE, I NTERVAL-8, MASTER, lCW4 NEEDED HARDWARE INT'S START AT SEND I CW2 SEND ICW3 SEND I CW4 INT 1

; 03FE 0400 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 ; 041A 60 11

Rf:.INITIALIZE THE 8259 t10V


OUT

0 /102 0404
01~O6

JMP MOV
OUT

0408 040A all DC 040E

Mav
aUT

JMP JMP

01 110 0412 0414 0416 0418

Mav
OUT JMP

MOV
OUT

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

(BH)

MASTER LEVEL 2 MASTER,8086 MODE

MASK OFF ALL INTERRUPTS

REINJTIALIZE THE 8259 MOV AL,11H

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

OUT JMP MOV OUT MOV JMP OUT JMP MOV OUT JMP MOV OUT

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

EDGE~ INTERVAL-8,MASTER~

ICW4 NEEDED

IIARDWARE INT'S START AT tNT II (BL) SEND JCW2 SEND I CW3 SEND I CW4 SLAVE LEVEL 2 SLAVE,8086 MODE

MASK Off ALL INTERRUPTS

~ -sEj~;-B~OS-CODE SEGME~T-DEsc;;

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

7;;:0;;------------------------------------------

0436 043C 0441 0447 044C

26: C7 44 36 FFFF 26: c6 44 3C OF 26: C7 44 3A 0000


26: c6 44 3D 98 26: C7 44 3E 0000
; ;

; 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

-- -------- --.----------------------------------- ----------------- -----------ENABLE PROTECTED MODE MOV LMSW DB LABEL MOV LABEL ORG DB ORG JUMPFAR DB OW OW

0452 Q455 0456 0456 0458 0456 0456 0458 0456 0459 045B 0450

88 0001

OF
88 Fa

+ ??OOlA
+
: ??OOlB

01
EA

0450 R 0036
VMDDE:

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

; 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

~ -;E;~;- ~;ER-;EG~EN;

------------------ -----._----_.------------------------ -- ---------------_._-MOV MOV MOV MOV MOV MOV AX. USER_OS OS,AX AX. USER_ES SETUP USER'S DATA SEGMENT SETUP USER'S EXTRA SEGMENT SETUP USER'S STACK SEGMENT

-REG 7;;ER;---------- ---- ---- --- ------- --------------- -----

0450 0460 0462 0465 0467 046A

88 8E B8 6E B8 BE

0018 08 0020 CO 0028 DO

ES.N<
AX. USER_55 SS,AX

~-puT-TRAN;fER-ADDREss-ON-THE-sTAcK-AND-RETuRN-TO-THE-USER-------------------046C 0460 0470 0471 0473 0474 0105

;------------------------------------------------------------------------_._-POP AOO I PUSII OW PUSH

5"

83 c4 04

SP,4
USeR CS

"X

GET RETURN

6" 0030 53

0"

I P FROM THE STACK NORMALIZE STACK POINTER SET STACK FOR A RETURN FAR

068H USER.CS

C"

RET

BX
RETURN TO USER IN VIRTUAL MODE ENDP

X.V I RTUAL

;--- DEVICE BUSY AND INTERRUPT COMPLETE -----------------------THIS ROUTINE IS A TEMPORY HANDLER FOR DEVICE BUSY AND INTERRUPT COMPLETE INPUT SEE PROLOG

0475 0475 0476 0479 0479 0479 047A 047A

bE~~CE:B~S;-----PROC----NEAR------------------------------------

F8

E9 004f R

CLC JMP oEV ICE_BUSY INT_COMPLETE IRET I NT_COMPLETE CODE ENDS ENO

C1_f [NoP PROC ENoP NEAR

TURN CARRY 0 F f RETURN WITH CARRY FLAG

CF

RETURN

5-158

BIOS 1

0000

TITLE OB-OB-83 BIOS2 BIOS INTERRUPT . LIST INCLUDE. SECMlNT. SRC CODE SEGMENT BYTE PUBL I C 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 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) READ THE REAL TIME CLOCK RETURNS CH ;= HOURS I N BCD CL = MINUTES IN BCD DH = SECONDS 1N BCD
= 0

(AH) = 2

(AH)

=: 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,

ELSE 0

(AH)

= 4

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

(AH) = CH CL DH DL

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)
;=

RESET THE ALARM

NOTE:

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 ASSUME CS: CODE, OS: DATA PROC FAR I NTRRUPTS 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 SET ERROR RETURN

0000 0000 0001 0002 0005 0007 0009 OOOB 0000 0010 0012

FB lE
E8 0000 E

ee 23 80 FC 07 70 03 EB 2C 90

OA 74 FE 74

E4

TIME OF DAY 1 -STIPUSH CAr.l OR

as
ODS AH,AH

111

JZ
OEC

T2
AH

JZ
CMP JOE JMP

T3
AH,7

T1
RTC_O

OOP)
0015 0016

11:
FB lF CF F9 1F CA 0002 T2: FA AO 0070 R C6 Ol'i 0070 R 00 8B OE 006E R 8B 16 D06e R EB 5

sr I
POP IRET
STC

as

0017
0018 0018 0019 OOlA 0010 0010

POP
RET

as
2

001 [
0021 0026 002A OOZE 0030 0030 0031 0035 0039 003E 0040 0040 0042 0044

CI.I MOV MOV MOV MOV


JMP

READ TIME NO TIMER INTERRUPTS WHILE READING AL, T IMER_OFL T I MER_OFl, 0 CX,TIMER HIGH OX, T I MER-LOW GET OVERfLOW, TOO_RETURN SET TIME NO INTERRUPTS WHIU: WRITING T I MER_LOW, DX T I MER_H I GH, ex T I MER_OFl, 0 Tl
AH
RTC 2

AND RESET lH FLAG

T1

13:
FA 89 89 C6 fB FE 74 FE 74 16 006C R OE D06E R 06 0070 R 00 D5 CC 07 CC 26

Cli
MOV MOV MOV
JMP

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

OEO

JZ
DEC

AH RTC 3

004(, 0048 004B


004B 0048 004E 0050 0052 0052 0053 0055 0058 005A 005C 005F 0061 0063 0066

JZ
JMP

9 0007 R

RTC_GET_TIME CALL JNC JMP

RIC-' PROC

NEAR CHECK FOR UPDATE IN PROCESS GO AROUND I F OK RETURN I F ERROR I NTERRUPTS OfF DURI NG READ

[8 0' B7 R 73 02 EB C6 FA 62 E8 E4 8A E8 E4 8A EB E4 FE 0192 R 71 FQ 0192 R 71 CB 0192 R 71

UPD IN PR RTC-ZA11_" 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

Cli MOV CALL IN MOV CALL IN MOV CALL IN

SET ADDRESS OF SECONDS SAVE SET ADDRESS OF MINUTES SAVE SET ADDRESS OF HOURS

BIOS 2 5-159

0068 006A 006C

8A E8 62 00 EB A7

006E 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 OOA9
OOA9

MOV MOV JMP RTC_GET _ T I ME

CH,AL DL,O Tl ENDP PROC NEAR

SAVE SET OL TO ZERO RETURN

inc
E8 0187 R 73 03 E8 019A R FA

SET TIME RTC:~): CALL

JNe
CALL

UPO_iN_PR RTC 3A I NIT I AL IlE_ST ATUS

CHECK FOR UPDATE I N PROCESS GO AROUND I F CLOCK OPERAT I NG


J NTERRUPTS OFF OUR I NG SET SAVE FIRST ADDRESS UPDATE ADORESS GET T I ME BYTE - SECONDS STORE T I ME BYTE UPDATE ADDRESS GET TIME BYTE - MINUTES STORE T I ME BYTE UPDATE ADDRESS GET TIM[ BYTE - HOURS STORE 11 ME BYTE

eLi
FE 0192 R C6 71 0192 R Cl 71 0192 R C5 71 PUSH MOV CALL MOV OUT CALL MOV OUT CALL MOV OUT MOV CALL POP

52
B2 E8 8A E6 E8
SA

OX
DL, -2 PORT INC 2 AL,OH CMOS PORT+l,AL PORT-I NC 2 AL,CL CMOS PORT+1,Al PORT:::: I NC_2 AL,CH CMOS PORT+',AL OL,OAH PORT INC

E6 E8 8A

E6
82 E8 5A E4 24 OA OC 50 B2 E8 58 E6 [9

OA
0188 R 71 23 C2 02 OA 018B R 71 0015 R

OX

RESTORE

IN
AND

OR OR
PUSH f<lOV CALL POP OUT JMP RTC_SET_TIME RTC GET DATE RTC=4: CALL

AL,CMOS_PORHl AL,23H AL,DL AL,02H AX DL,OAH PORT INC AX CMOS_PORT+, ,AL

GET CURRENT VALUE


MASK FOR VALID BIT POSITIONS

GET DST BIT


TURN ON 24 HR MODE

T1
ENOP PRoe NEAR

; DONE

OOA9 OOA9
QQAe OOAE

E8 01 B7 R 73 03 E9 0018 R FA B2 E8 E4 8A E8 E4 SA [8 E4 8A 82 E8 E4 8A 8A E9 06 0186 71 [8 0188 71 FO 0188 71 C8 31 0188 71 D5 E8 0015

JNe JMP
ell MOV CALL

UPD_IN_FR RTC 4A Tl_A DL,6 PORT INC AL,CMOS_PORT+l CH,AL PORT INC AL,CM05_PORT+l DH,AL PORT INC AL,CMOS_PORT+l CL,AL DL,31H PORT ! NC AL,CMOS_PORT+1 OL,CH CH,AL Tl ENDP AM RTC 4 AM RTC 5 AM RTC 6 RTC:::) PROC NEAR

RETURN ON ERROR I NTERRUPTS OFf DURING READ POI NT TO DAY SAVE PO I NT TO MONTH SAVE PO I NT TO YEAR SAVE PO I NT TO CENTURY BYTE SAVE AREA GET VALUE GET DAY BACK FINISHED

OOBl
00S1 0082 0064 00B7 0089 R

IN
MOV CALL

00B8 OOBE
OOCO

R R

IN
MOV CALL

OOC2
OOC5 OOC7 OOC9 OOCB DOCE 0000 0002 00D4 0007

IN
R MOV MOV CALL

IN MOV MOV JMP RTC_GET_DATE


DEC

0007
DOD7 0009 ODOB 0000 OODF 00E1 00E3 00E6 00E6 00E6 DOE9 00E6 OO[E OOEE DOEF OOFO 00F2 OOF4 00F7 OOF9 OOFB 00 FE 0100 0102 0105 0107 0109 alOC OlOE 0110 0112 01'5 0117 0119 0'1B 011C 011E 0121 0123 0125 0128 0128 0128 0128 012A 0120 012F 0131 0133 0135 0138 0138 013B 0130 0140 0140 0141 0143 0146 0148 FE 74 FE 74 FE 74 E9 CC CE CC 07 CC 45 0175 R JZ
DEC

JZ
DEC

JZ JMP RTC_SET _DATE RTC_5 : CALL JNe CALL

AH co 4 READ RTC OATE AH '" 5 SET RTC DATE AH co 6 SET RTC ALARM RESET RTC ALARM

E8 0187 R 73 03 [8 019A R FA 51 8A EA 82 05 E6 0188 80 00 E6 71 [8 0188 8A C5 E6 71 E6 018B 8A C6 E6 71 E8 018s 8A C1 E6 71 820A E8 0188 E471 247F E6 71 59 8231 E8 018B 8A C5 E6 71 E9 0015

UPO_I !CPR RTC 5A I N IT I ALI ZE_STATUS

CHECK FOR UPDATE I N PROCESS GO AROUND iF CLOCK UPDATING I NTERRUPTS OFf OUR I NO SET SAVE SAVE DAY OF MONTH ADDRESS OF DAY OF WEEK REGI STER LOAD ZEROS TO 'DAY OF WEEK' BYTE ADDRESS OF DAY OF MOfiTH REGI STER GET DAY OF MOJ'llTH BYTE STORE IT ADDRESS MONTH REG I STER GET MONTH BYTE STORE IT ADDRESS OF YEAR REGISTER GET YEAR BYTE STORE IT GET CURRENT SEll NO CLEAR 'SET BIT' *ANO START CLOCK UPDATI NO GET BACK PO I NT TO SAVE AREA GET CENTURY BYTE SAVE IT RETURN

eLi
PUSH MOV MOV CALL MOV OUT CALL MOV OUT CALL MOV OUT CALL

ex
CH,OL DL,5 PORT INC AL,OOH CMOS PORT +1, AL PORT-I NC AL,CH CMOS PORT+l,Al PORT-INC AL,DH CMOS PORT+1,AL PORT:::: I NC AL,CL CMOS PORT+l,Al DL,OAH PORT INC AL, CMOS_PORHl AL,07FH cr<los PORT+l,A.L

R R R

MOV
OUT MOV CALL

IN
AND

R R

OUT POP MOV CALL MOV OUT JMP RIC_SlJ DAlE RTC SET ALARM RTC::::6: MOV CALL

ex -

DL,31H PORT_[ NC AL,CH CMOS PORT+l,AL Tl ENDP PROC NEAR

82 E6 E4 A8 74 33 E9

OA 0163 R 71 20 05 co 0018 R

IN TEST JZ XOR JMP


CALL JNe CALL eLI MOV CALL MOV OUT

Dl,OAH PORT INC AL,CMOS_PORT+l AL,20H RTC 6A

CHECK fOR ALARM ALREADY ENABLED GET CURRENT SETT I NG OF ALARM ENABLE ALARM NOT SET RETURN I F ERROR GO PROCESS

AX,Ax
Tl_A
UPO IN PR RTC::::6SI N IT I ALI ZE_STATUS DL, -1 PORT_I NC_2 AL,DH CMOS_PORT+1,AL

[8 01B7 R 73 03 E8 019A R FA B2 E8 8A [6 fF 0192 R C6 71

CHECK FOR UPDATE IN PROCESS

INTERRUPTS OFF DURING SET GET SECONDS BYTE LOAD ALARM BYTE -

SECONDS

5-160

BIOS 2

014A 0140 014F 0151 0154 0156 0158 015A 015C 015E 0160 0163 0165 0167 0169 Ol6A Ol6C 016F 0170 0172 0175 0175 0175 017'.) 0176 0178 017B 017D 011F 0180 0182 0185 0166 0168 018B 018B 018B 018B 0180 018F 0191 0192 0192 0195 0197 0199 O19A 019A 0198 019D 01AQ 01A2 01A4 01A7 01A9 OlAB OlAE 01BO 01B3 01B5 01B6 01B7 01B7 01B7 01B8 018B 01BB 01BO 01BF 01G1 01C3

E8 8A E6 E8 8A E6 E4 24 E6 82 E8 E4 24 OC

0192 R Cl 71 0192 R C5 71 Al FE Al OA 0188 R 71 7F 20

CALL MOV
OUT

CALL MOV
OUT

IN
AND OUT

MOV CALL IN
ANa

OR
PUSH MOV CAll
POP OUT JMP

50
82 OA E8 0188 R

58 E6 71

E9 0015 R

RTC_SET_ALARM

PORT INC 2 AL, c"C CMOS PORT+1.Al PORT=I TIIC_2 AL,CH CMOS_PORT+l,AL AL, OA 1H AL,OFEH QA1H,AL DL,OAH PORT INC AL, CMOS_PORT+l AL,07FH AL,20H AX Ol,OAH PORT INC AX CMOS PORT+1,AL T1 ENOP NEAR

GET HI NUTES PARAMETER LOAD ALARM BYTE - MINUTES GET HOURS PARAMETER ; LOAD ALARM BYTE - HOURS ; ENSURE I NTERRUPT UNMASKED

GEl CURRENT VALUE ENSURE SET BIT TURNED OFF TURN ON ALARM ENA8LE

ENABLE ALARM

RTC RESET ALARM PRoe RTC=7: FA B2 OA E8 0188 R E4 71 24 57

ell
MOV CALL IN AND PUSH MOV CALL POP OUT JMP RTC_RESEl_ALARM OL,OAH PORT INC AL. CMOS PORT+l AL,57H -

I NTERRUPTS MASKED OUR I NG RESET GET STATUS BYTE TURN OFF ALARM ENABLE SAVE

50
B2 OA E8 01S8 R

AX
OL,OAH PORT INC AXCMOS_PORT+l. AL T1 ENOl' NEAR ;

58
E6 71

RESTORE

E9 0015 R

FE C2 SA C2 E6 70

e3
SO C2 02 SA C2 E6 70

RTC_ T I MEB I OS_SUBR PRoe PORT INC: INC DL MOV AL,DL CMOS_PORT, AL OUT RET PORT_I NC_2:
ADD

I NCREMENT ADDRESS

MOV
OUT

DL,2 AL,DL CMOS_PORT, AL

I NCREMENT ADDRESS

e3

RET

I NIT I ALlZE_STATUS
52
82 E8 BO E6 E8 E6 E8 E4 E8 E4 09 018B R 26 71 01B8 R 71 0188 R 71 018B R 71 PUSH MOV CALL MOV OUT CALL MOV OUT CALL IN CALL IN POP

PROC

NEAR SAVE

BO 82

OX DL.09H PORT INC AL,26H CMOS PORT+l,AL PORT-I NC AL,82H CMOS PORT+l,AL PORT- r NC AL. CMOS_PORT+l PORT INC AL.CMOS PORT+1 OX -

INITIALIZE

'A'

REGISTER

SET 'SET BIT' FOR CLOCK INITIALIZATION AND 24 HOUR MODE INITIALIZE 'B' REGISTER READ RECISTER READ REGISTER RESTORE

'e' '0'

TO TO

INITIALIZE INITIALIZE

5A e3

RET
iNITIALIZE_STATUS ENOP

UPO IN PR:
51
89 0258 UPDATE: 80 E6 EB E4 A8 74 E2 33 OA 70 00 71 80 05 F2 CO -

PUSH

ex
CX.600 AL,OAH CMOS PORT. AL $+2 AL,CMOS_PORT+l AL,80H UPO_iN_PRENO UPDATE AX,AX SET LOOP COUNT ADDRESS OF A~

MOV

MOV
OUT JMP

REGISTER

IN TEST

I/O TIME DELAY READ IN REGISTER 'A' IF 8XH--:7 UIP BIT IS ON (CANNOT READ TIM

OlCS
01e7 O1C9 Olec O1CC Oleo OlCE aleE

JZ
LOOP

XOR
STC

Oles

F9 59 C3

SET CARRY FOR ERROR

UPD_I N_PRENO:
POP

ex

RET

RETURN

TIMES I OS_SUBR ENDP TIME OF DAY 1 ENDP PAGe ; --I NT 50 (LEVEL 8)- --------------------------------------------: TH I S ROUT I NE HANDLES THE PER t 00 I C AND ALARM I NTERRUPTS FROM THE NON-VOLATILE TIMER. INPUT FREQUENCY IS 1.024 KHZ OR APPROX I MATEL Y 1024 I NTERRUPTS EVERY SECOND FOR THE : PERIODIC If{1ERRUPT. fOR THE ALARM FUNCTION, AN INTERRUPT WILL: OCCUR AT THE DESIGNATED TIME. THE INTERRUPT IS ENABLED ONLY WHEN EVENT OR ALARM FUNCTIONS ARE ACTIVE. rOR THE EVENT INTERRUPT, THE HANDLER WILL OECRFMENT THE WAIT COUNTER AND WHEN IT EXPIRES WILL TURN ON THE HIGH ORDER BIT OF THE DESIGNATED FLAG. FOR THE ALARI., INTERRUPT, THE USER ROUTINE WILL BE INVOKED THE USER MUST CODE A ROUTINE AND PLACE THE THROUGH INT 4AH. CORRECT ADDRESS IN THE VECTOR TABLE.

hc_

OlCE 01CE OlCF OlDO OlD1 0102 01D3 0105 0108 010A OlOC 01DF 01 E1 01 E3 01 Ell 01E6 01 E8 01E8

Inc
FS lE 50 52 57 B2 OA [8 018B R E4 71 8A EO

I NT

PROC 5TI PUSH PUSH PUSH PUSH MOV CALL

FAR
OS

I NTERRUPT5 BACK ON SAVE REG I STERS

AX

OX
01 DL,OAH PORT INC AL. CMos PORT +1 AH.AL PORT INC AL, CMos PORT +1 AL,AH AX AL, 040H RTC I NT 9 DOSRTC LOW, 0976 RTC-HIGH,O RTC=I NT_9

GET ENABLES
SAVE

IN
MOV CALL

E8 0188 R
E4 71 22 C4

GET SOURCE
SAVE CHECK FOR PERIODIC INTERRUPT NO - GO AROUND EST ABL I SH ADDRESSAB I L I TY DECREMENT COUNT

IN
AND

50
AS 74 E8 81 83 40 2E 0000 E 2E 009C R 0300 1 E 009E R 00 77 lE

PUSH TEST

JZ
CALL
SUB SBB

01Fl
01F6

JA

BIOS 2 5-161

U1F8 01FA 01 FD OnT 0201 0202 0201J 0207 0208 020A 020f 0213 0216

B20A E80l8BR E4-/1


21~

or

50 B2 OA fB 018B R 58 [6 71 C6 06 OOAO R 00 C5 3E 0098 R C6 0':) 80 RTe


:>~

MOV CALL IN AND PUSH MOV CALL POP OUT MOV LOS MOV INT 9: -POP TEST JZ

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

0216
0217 0219 0218 0210 0210

A8 20 74 02 CD 4A

AX AL,20H RTC I NT 10
4AH~

1 NT
RTC_INT 10: -MOV OUT

Glf INTERRUPT SOURCE BACK TEST fOR ALARM INTERRUPT NO - GO AROUND TRANSFER TO USER ROUTINE

80 20
E6 AO E6 20 5F 5A 58 1F CF

021F
0221

OUT
POP POP POP POP I RET I NT ENDP

0223
0224 0225 0226 0227 0228

;\1_, [01 OAOH,AL 020H,AL DI OX

END OF

I NTERRUPT TO 8259 1

AND TO 8259 -

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 NTRRUPT 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, INT 1 S1'I I'USH PUSH PUSH CALL INC PROC
OS AX

OF THE 01 SKETTE,

0228

TIMER
FB

0228 0229 022A 0228 022C O??F 0233 0235 0239 0239 023E 0240 0246

FAR INTERRUPTS BACK ON

52
E8 FF 75 FF

1E 50
0000 E 00 006e R 04 06 006E R 3E 006E R

ox
riMER LOW

DDS

.3

75 15 81 3E 006C R 0080
75 00

,.

JNZ 1 NC
T4:
eMP

T4

TIMER_HIGH

JNZ eMP

T5
T5

TIMER HIGH,018H

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

T I MER_LOW, OBOH

JNZ

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

SUB MOV MOV MOV

AX,AX TIMER_HIGH,AX T I MER_LOW, AX TIMER_OFl,1

TEST FOR DISKETTE TIME 0255 0255 0259 02SB 0260 0262 0265 0266 0266 0268 026A 026C 0260 026E 026F 0270 T5: FE 75 80 BO SA OE OOIJO R OB 26 003f H OC 03F2

our

Fa

DEC ,INl

AND
MOV MOV

EE
T6;

OUl 1 NT
MOV

; 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
1 Gil

co

lC 80 20 E6 20

TIMER RET: TRANSFER CONTROl. TO A USER ROUT I NE END OF I NTERRUPT TO 8259

OUT
POP POP POP I RET TIMER

AL, EOI 0201-l,Al.

5A 5.

ox
AX

eF

1F

OS

RESET MAr:HINE STATE RETURN FROM INTERRUPT

- 1 NT-

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: 50:0 E I TIlER PR I NT SCREEN HAS NOT BEEN CALLED OR UPON RETURN FRot1 A CALL THIS INDICATES A SUCCESSFUL OPERATION. =1 =255 ASSUME PRINT SCREEN IS IN PROGRESS

ERROR ENCOUNTERED OUR I NG PR I NT I NG

CS;CODE,DS:XXDATA

0270 0270 0271 0272 0273 0274 0275 0276 0279

0278
0280

---- R 81:: 08 80 3E 0000 R 01 74 C6 84 CD 5f

FB 1E 50 53 51 52 B8

0282
0287

06 0000 R 01
OF 10

0289

PR I NT SCREEN 1 ST I PUSH PUSH PUSH PUSH PUSH MOY MOY eMP JZ MOY MOY INT

PROC
DS

FAR

MUST RUN WITH INTERRUPTS ENABLED MUST USE 50:0 fOR DATA AREA STORAGE 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

ex

AX BX

ox

AX,XXDATA OS,AX STATUS_BYTE,l EXIT STATUS_BYTE,l AH,15 10H

*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 MOY MOV CAL L PUSH MOV INl POP PUSH

** .... **** .. *.. *** .... ****** .. ****************** ...... ********* ... *****
CL,AH CII,25 CRLF CX AH, 3 10H 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

0288 0280 028F

0292
0293 0295 0297

SA CC 05 19 ER 02E7 R 51

B4 03
CD 10

59
52

cx
ox

0298
0299

33 02

**~ .. **~~~ ........ *~~;.~~*"1

H IlM

"*"***~*~!~_~*;~r*~~~;~~ .. ~~;!r!~~*r~*i2* 0 J
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

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

84 02
CD 10

;'Rll0:

*** ... *"I,!~~*~~!~!.;. .. ********************************************')1-*


MOV
I NT

AH,2

B4 08
CD 10 OA CO 75 02 BO 20 PRJ 15:

MOV

>NT
OR JNZ MOV PUSH XOR

lOti AH,8 10H AI.,AL pRI15 AL,' I


DX DX,DX AH,AH
Uti

52
33 02

32 E4 CO 17
5A

XOR >NT
POP TEST JNZ INC
OjP

OX
AH, 29H ERR10

F6 CII 29

75 21
FE C2 3A CA

OL
CL,DI I'R 110 DL,DL AH,DL

75 OF 32 02 8A E2 52 E8 02E7 'I<, 5A FE C6
3A EE

JNZ

XOR
MOV rUSH CALL POP INC
eMP

ox
OX OH

CRlF CH,DH PR 110


DX

"f5 DO
5A 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 PR120:

JNZ
POP

MOV I NT MOV JMI'

AH,2 10H 5T ATlIS_BYTE, 0 SHORT EXI T

RR10:
CRR20: EXI T:

POP

OX
AH,?

Mav

MOV I NT

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 RESTORE ALL THE REGI STERS USED

02E1
02E~

02[3 024 025 02E6 02[7

POP POP POP POP POP IRET PRI NT_SCREEN 1

ex

ox

BX AX OS ENDP LI NE FEED SUBROUTI NE PRINTER 0 WILL NOW SEND

; ------ CARR I AGE RETURN,

02E7
02U 02(9
02E~

CRLF 33 02

PROC

eo

32 Ell OA

XOR XOR
MOV

NEAR OX, OX AH,AH AL,12Q

I NIT I AL LF, CR TO PR INTER

LF
SEND THE LINE FEED NOW FOR THE CR CR SEND THE CARRIAGE RETURN

02ED u2EF 02F1 02F3 02F5 02r6 02F6

CD 32 110 CD C3

17
E" 00

>NT XOR
MOV
INT RET

17H
AH,AH AL,15Q 171-1

17
CIlLF CODE

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 ;

-----------------------------------------------------------------------------: ORG OEOOOH '6181028 COPR. IBM 1984' DB

; COPYRIGHT NOTICE

0000

36 38 2E 31

31 20 20 39

38 43 49 38

31 30 32 4F 50 52 42 40 20 34

005B 005B 005B 005S

RESET START: E9 0000 E

ORG ORG LABEL JMP

OE05BH 0005BH fAR START_'

; +++++++++++++++++++++++

~OSE

0060 0062 0064 0066 0068 006A

0000 0000 0000 0000 0000 0000 0000

E E

------------------------C, ow
C2 C8042A

E
E E E E

g:bli~~A
C8042C OBF _42B

OW OW OW OW OW OW

006C

0085

009E

00B1

0000

00E9

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

31 73 6F 72 31 73 6F 72 31 73 6f 72 31 73 6f 72 31 73 6F 72

30 74 61 72 30 74 61 72 30 74 61 72

31 65 72 6F 32 65 72 6F 33 65 72 6F

20 60 64 72 20 60 64 72 20 60 64 72 20 60 64 72 20 60 64 72

53 20 20 00 53 20 20 00 53 20 20 00 53 20 20 00 53 20 20 00

EO

~ -POS;-ERROR-MESSAGES----.------------------------D B ' 101-System

Board Error',13,10 ;

INTERRUPT FAILUE

EO_A

DB'

102-System Board Error',13,10 ; TIMER FAILURE

EO_B

D B ' l03-System Board Error',13.10 ; TIMER INTERRUPT FAILURE

30 34 74 65 61 72 72 6F 30 74 61 72 35 65 72 6F

VIR_ERR

DB

'104-SyStem Board Error',13,lO;

PROTECTED MODE FAILURE

CM4

D B ' l05-System Board Error',13,10 ;

LAST 8042 COMMAND NOT ACCEPTED

32 30 31 20 l~O 60 6F 72 79 20 72 72 6F 72 00 34 54 72 35 51 j 72 3? 60 64 20 00 32 60 64 20 00 4F 6F 4B 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 30 20 00 30 20 00 30 6F 64 45 OA 30 6F 64 45 OA 40 72 42 52 48 00 52 48 00 3F 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 31 45 OA 31 45 OA 3? 72 72 72 20 43 72 72

E1

D6

2Ql-Memory Error' ,13,10

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

[1 6

06 06 06

401-CRT Error', 13, 10 SOl-CRT Error' ,13,10 202-Memo ry Add ress Error' ,13, 10 LINE ERROR 00->15

20 43 72 12
?D 79 65 72 20 79 65 72 40 20 73 6F 40 20 73 6F

[1 C

AOERRl

33 72 72 72

AOERR

06

203-Memory Address Error', 13, 10

; LI NE ERROR 16->23

20 45 72 00 OA 20 4F 4B 49 45 OA 49 45 OA 3F 45 3D 20 OA 20 63 74 69 6C 54 59 43 4B 54 59 43 4B 3F 00 53 ~5 20 22 4B 45 20 6B 65 74 6F 55 20 60 20 63

f3A f36 01 02 D2A fJD

DB DB DB DB DB DB

'ROM Error' ,13,10 'KB OK',13 'PARITY CHECK 2',13,10 'PARITY CHECK 1',13,10 '?????',13,10 (KESUMI:. = "1-1" KI:.Y) , ,13,10

ROM CHECKSUM KB FOR MEMORY SIZE

F30l

DB

-Unlock System Unit KeylOck' ,13,10

31 20 4B 6F 61 72 72 72 6F 32 65 74 6F 20 61.j. 33 6F 20 60 20 63 4e 00 20 61 20 60 20 00 53 20 4B 6B 6F OA 4B 72 53 20 4S OA

F1

OB

301-Keyboard Error', 13,10

KEYBOARD ERROR

LOCK

D B ' 302-System Unit Keylock

is Locked', 13, 10

KEYBOARD LOCK ON

F1_A

D B ' 303-Keyboard Or System Unit Error', 13,10

72
65 74 72

5-166 ORGS

021F

0234

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

F3

DB

601-Diskette Error', 13, 10

DISKETTE ERROR

CM1

DB

161-SYStem Options Not Set-(Run SETUP)',13,10

DEAD BATTERY

4r -'0 -f/+ 69 6r 6E
73 53 75 55 20 7') liF 20
II~

6F 74 20
53 00 32 65 69 6F 2D 53 00 33 20 65 53 75 55 45 54 OA ?D 53 60 20 6r 6E 74 20 28 52 45 54 OA 20 26 20 65 6E 50 54 20 4E 74 20 29

65 74 20 28 52
20 29 36 74
-{J+

0250

6E 50 31 73 70 B 20 53 65 75 6E 55 50 20 31 69 60 44 61 6F 74 20 28 53 45 00 OA

CM2

DB

162-System Options Not. Set-(Run SETUP)', 13, 10

4[ "{II 20 29 36 65 74 20 52 54

0286

CM3

DB

; CMOS CHECKSUM ERROR 163-Time & Date Not Set-(Run SETUP}',13,10

; ; 02AC 02AC 02A[ 02BO 02B2 PR \ NTER TABLE LABEL OW OW OW LABEL WORD 3BCH 378H 278H WORD

CLOCK NOT UPDATING

F4
03Be 0378 0278
F4F:

; --------- NM \ ENTRY 02C3

= 02C3
02C3 02C6 [9 0000 E

ORO ORG EaU

OE2C3H 002C3H

20 31 30 36 20 79 73 74 6, 60 42 6 F 61 72 6 1 1 "5 72 72 6F 72
OA

53 20 20 00 53 20 20 00

DB

106-System Board Eccor' ,13, 10 ;

CONVERTING LOGIC TEST

02DF

20 79 42 45
OA

31 30 37 20 73 74 65 60 6F 61 72 64 72 72 6F 72

DB

107-System Board Error',13,10 ;

HOT NMI

TEST

02F8

20 79 42 ,,5
OA

31 30 38 20 53 73 74 65 60 20
6F 61 72 64 LU 53 20 20 00

DB

108-System Board Error', 13, 10 ;

TIMER BUS TEST

72 72 6F 72 00 31 30 39 20 73 74 65 60 6r 61 72 64 72 72 6F 72
DB

0311

20 79 42 45
OA

109-Syst.em Board Errol", 13, 10 ;

LOW MEG CHI P SELECT TEST

032A

20 65 53 72 52 54
20 65 64 79 55 72

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

; ---------- MEMORY SIZE ERROR El_A D B ' 164-Memory Size [rror-(Run SETUP}',13,10

03/IE

"; CMOS DOES NOT MATCH SYSTEM KEYBOARD/SYSTEM ERROR DB ' 304-Keyboard Or System Unit Error',13,10

; 0372 20 69 65 20 64 (2 31 69 46 65 31 69 1\6 65 31 69 6E 65 6C 31 69 45 36 73 20 52 20 00 37 73 61 00 37 73 61 00 3{ 73 74 72 75 37 73 72 30 6B 42 65 45 OA 38 68 69 OA 38 6B 69 OA 38 68 72 20 72 39 6B 72 32 65 6F 63 72 20 74 6f 6F 72 411 74 71, 72 6F

KEYBOARD CLOCK LINE HIGH

DISKETTE BOOT RECORD I S NOT VAll 0 DB '602-Diskettc Boot Record Error',13,10

0393

3020 44 20 30 20 6C 75 72 31 2044 20 31 20 6C 75 72 32 20 6F 46 65 30 20 6f 20 43 6C 61 00 20 30 72 411 6F 6C 69 OA 1I'1 20 00

; ---------- HARD fILE ERROR MSG F17BO DB '1780-0isk 0 Fa i lure' ,ODH,OAH

03A8

fl/S1

DB

'1781-Disk 1 failure'.OOH,OAH

0380

F1782

DB

'1762-0isk Controller Fa i lure' ,ODH,OAH

030n

F1790

DB

'1790-DiSk 0 Error' ,ODH,OAH

03EE

OA 31 37 39 31 20 44 69 73 6B 20 31 20 45 72 72 6f 72 00 OA

f1791

DB

'1791-Disk 1 Error' ,ODH,OAH

INITIALIZE DRIVE CHARACTERISTICS F IXCO 0 I SK PARAMETER TABLE 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

+0 +2

+,
+3

+7 +8

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.

0401

FO_ TBl: ;----- DRIVE TYPE 01

01101 0lf03 0404 0406 0408 0409 040A


OI~OD

0132

ow
DB

03060

04
0000 0080

OW OW
DB DB DB

040 0
01280

CYL I NOERS HEADS WRITE PRE-COMPENSATION CYL CONTROL BYTE I AND I NC ZONE SECTORS/TRACK

00 00
00 00 00 0131 11

0 0
0,0,0 03050

OW
DB DB

040F 0410

00

170 0

;----- DRIVE TYPE 02 01 .11 0413 0414


OI~16 O/~ 1 8 01119 041A 041D 041F 0420

026'1

04
0000 012C

OW DB OW OW
DB DB DB

06150

040 0
03000

CYLI NDERS HEADS WRIT[ PRE-COMPENSATION CYL CONTROL BYTE LANDING ZONE SECTORS/TRACK

00 00
00 00 00 0267 11

0 0
0,,0,0 06150

OW
OB

00

DB

170 0

DR I VE TYPE 03 0421 0423 0424 0426 0428 0429 042A 0420 042F 0430 0267

06
0000 012C

OW DB OW OW
DB DB DB

06150

060 0
03000

CYLI NDERS HEADS WRITE PKE-COMPENSArloN CYL CONTROL BYTE LAND I NG ZONE SECTORS/TRACK

00 00
00 00 00 0267 11

0 0
0,0,0 06150

OW
DB

00

DB

170 0

DR IVE TYPE 04 0431 0433 0434 0436 0438 0439 043l1, 0430 043F 0440 03AC

OW
DB

09400

DB 0000 0200 00 00 00 00 00 03AC 11 00

OW OW
DB DB DB

DBD 0
05120

CYL I NDERS HEADS WRITE PRE-COMPENSATION CYL CONTROL BYTE LANDI NG ZONE SECTORS/TRACK

0
0,0,0 09400

OW
DB DB

170 0

; ----- DRIVE TYPE 05 0/\41 0/f43 0444 0446 01148 0449 044A 01\40 044F 0450 03AC

OW

09400

06
0000 0200

08
OW OW
DB

060 0
05120

CYLI NDERS HEADS WRITE PRE-COMPENSATION CYL CONTROL BYTE LAND I NG ZONE SECTORS/TRACK

00 00
00 00 00 03AC 11

DB
DB

0 0
0,0,0 09400

OW
DB DB

00

170 0

;----- DRIVE TYPE 06 0 1\51 01\53 0454 0456 0458 0459 0li5A 0450 045f 0460 0267

ow
OB OW OW DB DB DB OW DB DB

0',
0000 FFFf

06150 040

CYLI HDERS HEAOS WRITE PRE-COMPENSATION CYL CONTROL BYTE LANDING ZONE SECTORS/TRACK

0
OFFFFH

00 00
00 00 00 0267 11

0 0
0,0,0 06150

00

170 0

DR I VE TYPE 07 0461 0463 0464 0466 0468 0469 01\6A 0460 046F 0470 01CE

DB 0000 0100 00 00 00 00 00 01 FF 11 00

OW DB OW OW DB

04620

080 0
02560

CYLI NDERS HEADS WRITE PRE-COMPENSATION CYL CONTROL BYTE LAND I NG ZONE SECTORS/TRACK

DB
DB OW DB DB

0 0
0,0,0 0511D

170 0

;----- DRIVE TYPE 08 0471 0473 0474 0476 0478 0479 047A 0470 047F 0480 0200

05
0000 FFFF

00 00
00 00 00 0200 11

OW DB OW OW DB DB DB OW

07330

050 0
OFFFFH

CYLI NDERS HEADS NO WRITE PRE-COMPENSATION CONTROL BYTE LAND I NG ZONE SECTORS/TRACK

0 0
0,0,0 07330

DB
DB

00

170 0

DR r VE TYPE 09 0481 0483 0484 0486 0384 OF 0000 FFFF


OW DB OW OW DB

09000

150 0
OFFFFH

CYLI NOERS HEADS NO WRITE PRE-COMPENSATION

0488

00

5-168

ORGS

0489 048A 0480 OIJ8F 0490

06
00 00 00 0385

11 00

DB DB OW 08 DB

008H

CONTROL BYTE LANDING ZONE SECTORS/TRACK

0,0,0
09010

170 0

;----- DRIVE TYPE 10 0491 0493 0494 0496 0498 0499 049A 0490 049F 04AO 0334

03
0000 FFFF

ow
DB DB DB OW DB DB

OW DB OW

08200

030 0
OFFFFH

CYL I NOERS HEADS NO WRITE PRE-COMPENSATION CONTROL BYTE


LAND I NG ZONE SECTORS/TRACK

00 00
00 00 00 0334

0
0 0,0,0 08200

11 00

170 0

DRIVE TYPE 11 04A1 04A3 04A4 04A6 04A8 04A9 04AA 04AO 04AF 0460 0357

05
0000 fHI'

00 00
00 00 00 0357 11

00

OW DB OW OW DB DB DB OW DB DB

0855D

050 0 0 0

CYLI NDERS HEADS NO WRITE PRE-COMPENSATION CONTROL BYTE LANDING ZONE SECTORS/TRACK

orFFFH

0,0,0 08550

170 0

DRIVE TYPE 12 0461 0463 0464 0466 0468 0469 046A 0460 04BF 04CO 0357

OW
06

07
0000 FFFF

0855D 070

CYLJ NDERS HEADS NO WRITE PRE-COMPENSATION CONTROL 6YTE LAND I NG ZONE SECTORS/TRACK

00 00
00 00 00 0357 11

00

OW OW DB DB DB OW DB DB

0
OFFfFH

0 0
0,0,0 08550

170 0

DR I VE TYPE 13

04C1 04C3 04C4 Q4C6 04C8 04C9 04CA a4CO 04CF 0400

0132

08
0000 0080

00 00
00 00 00 013F 11

00

OW DB OW OW DB DB DB OW DB DB

03060 OBO

CYL INDERS HEADS WR I TE PRE-COMPENSAT I ON CYL CONTROL BYTE LAND I NG ZONE SECTORS/TRACK

0
01280

0 0
0,0,0 03190

170 0

; ----- OR IVE TYPE 14 0401 0403 0404 01106 0lt08 0409 040A 0400 040F 04EO 0200

07
0000 FFFF

00 00
00 00 00

0200
11

00

OW DB OW OW DB DB DB OW DB DB

07330

070 0
OFFFFH

CYLI NDERS HEADS WRITE PRE-COMPENSATION CYl CONTROL BYTE lAND I NG ZONE SECTORS/TRACK RESERVED

0 0
0,0,0 07330

170 0

DRIVE TYPE 15 04El OlJE3 04E4 04E6 01lE8 04E9 04EA 04EO 04EF 04FO 0000

****

DO NOT USE CYll NDERS HEADS

****

00 0000
0000

00 00
00 00 00 0000

00 00

OW DB OW OW DB DB DB OW DB DB

00000 DOD 0 00000 0 0 0,0,0 00000 DOD 0

WRITE PRE-COMPENSATION CYL CON I ROL BYTE lAND I NG ZONE SECTORS/TRACK

; ---------- BOOT LOADER INTERRUPT 06F2 '" 06F2 06F2 E9 0000 E

BOOT_STRAP

ORO ORO EOU JMP

OE6F2H 006F2H

$
BOOT_STRAP_1
j

; ---------------BAUD RATE 0729 0729 0729 0726 0720 072F 0731 0733 0735 0737 0417 0300 0180 OOCO 0060 0030 0018 OOOC

NIT

A1
OW OW OW OW OW OW OW OW

ORO ORO LABEL


1047

OE729H a0729H WORD 110 BAUD

; TABLE OF INIT VALUE

768
384 192

150 300 600


1200 2400 4800 9600

96

48
24 12

;-------------- RS232 0739 '" 0739 0739 E9 0000 E

ORO ORO EOU JMP

OE739H 00739H RS232_IO_ 1

; --------------- KEYBOARD oa2E '" 082E 082E E9 0000 E

ORO ORG
KEY60ARD_IO
EOU JMP

OE82EH 0082EH

S
KEYBOARD_I 0_ 1 OE87EH 00a7EH

087E

ORG ORG

; ------ TABLE OF SH I fT KEYS AND MASK VALUES (EARLY PC 1

ORGS

5-169

087E 087E 52 087F 3A 45 46 38 10 0884 2A 36 == 0008

K6

LABEL
DB DB DB

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
0886

K7
80 40 20 10 08 04 02 01

0887 088G

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

SCAN CODE TABLES


088E 0896 089E 1B 1E FF FF FF 00 FF FF FF FF FF FF 1F FF 7F

K8

DB
DB

27, -1 ,0, -1, -1 ,-1,30,-1 -1,-1,-1,31,-1,127,-1,17 23,5,18,20,25,21,9,15 16,27,29,10,-1,1,19 4,6,7,8,10,11,12,-1,-1


-1, -1,28,26,24,3,22.2

11 DB
DB

D8A6 D8AD
08R6 08BE

17 05 12 14 19 lS 09 OF 10 1B 10 OA FF 01

13
04 06 07 08 OA DB

DB

OC

rr

H
DB

FF FF 1C 1A 18 03

16 02 08c6 U8C8
08C8 5E DE 00 FF FF FF FF Ff FF 20 FF

14,13,-1,-1,-1,-1,-1,-1
',_1

; ________ CIl TA~~E SCAN'


K9 LABEL BYTE

SF 60 61 62 63

DB
DB
DB

94,9?,96,97,98,99,100,101
102,103,-1,-1,119,-1,132,-1

0800
0808
08EO

64 65 66 67 FF FF 77 Ff 8J~ fF 73 r, 74 rr 75 FF 76 FF
FF

115,-1,116,-1,117,-1.118,-1
-1 OlBH, '1234567890-=' ,08H,09H 'qwertyuiop[]' ,ODH,-l, 'asdfghjkl;

08El 08El
D8FO

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

DB LC TABLE LABEL BYTE DB

72 74 79 70 5B 50
73 64 66 6B 6c 3B

DB

,027H

27
0909 091/\ 091B 091B 092A 60 FF 5C 7A 78 63 76 62 6E 60 2C 2E 2F FF 2A FF 20 FF

DB

60H,-1,5CH,'zxcvbnm,./',-l,'*',-1,'

DB ; ------ UC TABLE K11 LABEL BYTE DB DB

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


47 48 4A 22 7E rF 7C 56 42 4E 3F FF 00

25
5F

27.' !@#$' 37, 05EH, '&*( 1_+' ,08H, 0


'QWERTYU 10PIl' , ODH, -1, 'ASDFGHJKL:'"

59 70 46 4B 4C 3A SA 58 43 40 3C 3E FF 20 FF

U943

OIEH,-l,' IZXeYBNM<>?' ,-1,0,-1,'

',-1

0955

K12

0955
095G O')')f 095F 1 096 1 0969

5 11 5A

55 56 57 58

59

UC TABLE SCAN LABEL BYTE DB

84,85,86,87,88,89,90 91,92,93 104,105,106,10'1,108 109,110,111,112,113

5B 5C 50
68 69 6A 68 6C 6D 6E 6F 70 71

DB ; ------ AL T TABLE SCAN K13 LAflEL BYTE DB DB NUM STATE TABLE LABEL BYTE DB

K14
37 3" 36 2B
.:S~ ~LJ

0969

34

31 32 33 30
;------ BASE CASE TABLE K15 LABEL BYTE

2E
0976

"

'789-456+1230.'

0976
0970

47 48 49 FF 48 FF

DB
DB KEYBOARD

71,72,73,-1,75,-1,77
-1,79,80,81,82,83

40
FF 4F 50 51

52 53

INTERRUPT ORG

OE987H
00987H

0987 = 0987

ORC

0987

E9 0000 E

QU JMP OISKurE I/O

S
KB_I NT_'

OC59 = OC59

DISKETTE_IO

ORC ORC EOU

OEC59H OOC59H

OC59

E9 0000 E

JMP
;-------- DISKETTE ORG

DISKETTE_10_1 INTERRUPT OEF57H 00F57H

OF57
= OF57 OF57 E9 0000 E

ORC EOU

S
DISK_INT 1 PARMS OEFC7H OOFC7H

JMP
DISKETTE
ORC ORC

OfC7
; ; ; ; ;

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 DF 02

LABEL

BYH. SRT=D, HD UNLOAO=QF HQ LOAD=l, MOOE=DMA 1ST SPECIFY BYTE 2ND SPEC I FY BYTE

DB DB

11011111B 2

5-170 ORGS

OFC9 OFCA OFCB OFCC OFCD OFCE OFCF OFDO OFDl

25 02 OF 1B FF 51. F6 OF 08

DB DB
DB DB DB DB DB DB

MOTOR WAI T

2 15

OlBH OFFH 054H OF6H

15
8
10

DB ; ------- PR I NTER

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)

OFD2 == OFD2 [9 0000 [ OFD2

PRINTER_IO ;-------- VIDEO

ORG ORG EOU JMP


10

OEFD2H 00FD2H

$
PRINTER_IO_,

;--------- ADDEO FOR POSSIBLE COMPATABILI'IY ENTRY POINTS ; ORC or045H ORG 01045H CS: CODE, OS: DATA, E$; V IDEO_RAM

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 [

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 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 OF065H 01065H VIDEO - 10- 1

I/O

E
E E E E E E E E E E [ E E
M1L

ORG
1065 = 1065 1065 E9 0000 E
ORC

VIDEO - 10

[QU JMP

; --------- V IDEO PARMS 10A4 10ALI 10A4 10AB 38 28 20 OA 1 F 06 19 lC 02 07 06 07 00 00 00 00 71 50 SA OA I f 06 19 lC 02 07 06 07 00 00 00 00 ORC ORG LABEL OFOA4H OlOA4H BYTE ; SET UP FOR 40X25

INIT TABLE DB 38H,28H,2DH,OAH,1 fH,6, 19H DB DB DB DB lCH,2, 7,6, 7 0,0,0,0 S-v I DEO_PARMS 71H,50H,5AH,OAH,1 fH,6, 19H lCH,2,7,6,1 0,0,0,0 38H,28H, 20H, OAH, 7fH,6, 64H 70H,2,1,6,7

lOBO '-- 0010


10B4

Eau

SET UP FOR 80X25

lOBB
lOCO lOC4 lOCB 1000 1004 10DB 10EO 10ELI 10E4 10E6 10E8 10EA 10EC lOEC

013
DB

38 28 20 OA "IF 06

SET UP FOR GRAPHICS

64
70 02 01 06 07 00 00 00 00 61 50 52 0 F 19 06 19 190200QBQC 00 00 00 00 DB DB DB DB DB

0,0,0,0
61H,50H,52H,OFH, 19H,6, 19H 19H,2,ODH,OBH,OCH 0,0,0,0 WORD ; SET UP FOR 80XZ5 B&W CARD

M5
0800 1000 4000 4000

LABEL OW OW OW OW

2048
4096 1638LI

; TABLE OF REGEN LENGTHS 4DX25 80X25 GRAPH ICS

16384

28 28 50 50 28 28 50 50

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

10F4 10F4

2C 28 20 29 2A 2E 1 29

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

eo

1840 1840 18110 [9 0000 F

ORe aRC

EQU I PMENT

EaU

OF84011 0184011

JMP

EQU I PMENT_l

;---------- CASSETTE (NO BIOS SUPPORT) 1859 '" 1859 1859 E9 0000 E
aRC aRC

CASSEHCIO

Eau

OF85911 01859H

JMP

CASSETTE_I 0_1

; lA6E 1A6E lA6E 1A76 1A7E 1A86 lA8E 1A96 11\9E lAA6 1AAE 1AB6 lASE lAC6 lACE lA06 lADE 1A6 lAE 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

CI1ARACTER GENERATOR GRAPH I es FOR 320X200 AND 640X200 GRAPH I CS ORG OFA6EH ORC 01A6EH LABEL BYTE OOOH,OOOIl,OOOH,OOOH,OOOH,OOOH,OOOH,OOOH ; 07EH,081H,OA5H,081H,OBDH,099H,081H,07EH ; 07EH, OFFH, ODSH, OFFH,OC3H, OE7H, OFFH, 07EH ; 06CH,OFEH,OfEH,OFEH,07CH,038H,010H,000H ; 010H, 038H, 07CH, OFEH,07CH, 038H, 010H, OOOH ; 038H, 07CH, 038H,

CRT CHAR GEN 00 00 7E 81 7E FF 6C 10 10 38 38 10 38 00 00 FF FF 00 3C FF C3 OF CC 3C 7E 3F 00 00 00 00 00

DB

D_OO 0_o1 o_o2

00
81 A5 81 BO 99 7E FF DB FF C3 E7 7E FE FE FE 7C 38 38 00 7C 7C 10 7C 00 00 FF 7C FE 7C 38 38 FE FE 7C 38 7C FE 7C 18 3C 3C 18 E7 C3 C3 E7 66 42 42 66 99 SO BD 99
OF 70 CC CC

DB
DB

DB DB
DB

o_o3
o_04 0_05 0_06 0_07 0_08 0_09 D_OA O_OB D_OC 0_00 D_OE D_OF 0_10 0_11 o_12 LJ_13 0_14

10 00

FEH, OFEH, 07CH, 038H, 07CH ;

DB DB

01OH,010tl,038H,01CII,OFEH,07CH,038H,07CH ; OOOH,000H,018H,03CH,03CH,018H,OOQl-I,000H ; OFFH, OFfH, OE7H, OC3H, OC3H, OE7H,

DB DB DB DB
DB

FF
3C 00 C3 FF 07 78 66 18 33 EO 63 CO 5A 99

FFH, OFFH ;

OOOH, 03CH, 066H, 0112H, 0112H, 066H, 03CH, OOOH ; OFFH,oe3H,099H,OBDH,OBDII,099H,OC3H,OFFH ; 00 FH, 007H, OOFH, 070H, oeCH, OCCH, OCCH, 078H ; 03CH,066H,066H,066H,03CH,018H,07EH,018H ; 03FH,033H,03FH,030H,030H,070H,OFOH,OEOH ; 07FH, 063H, 07FH, 063H, 063H, 067H, OE6H, oeoll ; 099H, OSAH, 03CH, OE7H, OE7H, 03CH, OSAH, 099H ; 080H,OOH,OF8H,OfEH,Of8H,OEOH,080H,OOOH ; 002H,OOEH,03H,OFEH,03H,OOEH,002H,000H ; 018H, 03CH, 07H,018H, Ol8H, 07EH, 03CH, 018H ; 066H,066H,066H,066H,066H,OOOH,066H,UUllH ; 07FH,OOBH,00BH,07BH,01BH,01BH,01BH,000H ; 03EH, 063H, 038H, Q6CH, 06CH, 038H, OCGI-!, 078H ; OOOH, OOOH, OOOH, OOOH, 07EH, 07H, 07EH, OOOH o 18H, 03CH, 07EH, 01 8H, 07[H, 03CH, o 18H, 03GH, 07EH, 0' 8H, 0 18H, 018H, OOOH,

66 66 3C 18
3F 30 30 70 7F 63 63 67 3C E7 E7 3C F8 FE F8 EO 3E FE 3E DE 7 18 18 7 66 66 66 00 DB 7B 18 1B 38 6C 6C 38 00 00 lE 7E 7E 18 -rr 3C 7E 18 lR 18 18 18 7E 3e DC FE DC 18 6U H=- 60 30 CO CO CO FE 66 FF 66 24 3C 7E FF FF FF iE 3C 18 00 00 00 00 78 30 3000 6C 00 00 00 FE 6e FE 6C

DB

FO
7F E6 99 5A 80 80 02 02 18 3C 66 66 7F

DB
DB DB DB DB DB DB DB
DB DB DB
DB

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 00 C6 00 6C 00 60 00 30 00 30 00 66 00 30 00 00 60 00 00 00 00 DC 00 C6 00 70 00 CC 00 CC 00

0_15
o_16 0_17 0_18 0_19 0_1 A 0_1 B 0_1 C 0_10 0_ 1 E 0_1 F SP 0_20
!

18H, 0 18H,

18H, OFFH

18H, 018H, OOOH

18H, 07H, 03CH,

DB DB DB OB DB DB DB DB

18H, OOOH

18H, OOGH, 0 FEH, OOCH, 01811, OOOH, OOOH

00011, 030H, 060H,

FEH, 060H, 030H, OOOH, OOOH

OOOH, OOOH, OCOH, OCOH, OCOH, 0 FEH, 00011, OOOH OOOH, 024H, 066H, OFFH, 066H, 024H, OOOH, OOOH OOOH, 018H, 03CH, 0111, OF FH, OFFH, OOOH, OOOH OOOH, 0 F FH, OFFH, 07[H, Q3CH, 018H, OOOH, OOOH OOOH,OOOH,OOOH,OOOH,OONI,OOOH,OOOH,OOOH 030H, 078H, 078H, 030H, 030H, OOOH, 030H,000H 06CH,06CH,06CH,OOOH,OOOH,000H,OOOH,OOOH 06CH,06CII,OFEH,06CH,OFEH,06CH,06CH,QOOH 030H, 07CH, OCOH, 078H, OOCH, OF8H, 030H,000H OOOH, OC6H, OCCH, 0 1811,03011, 066H, OCuH, OOOH 038H, 06CH, 038H, 076H, OOCH, OCCH, 076H, OOOH 060H, 060H, OCOH, OOOH, OOOH, OOOH, OOOH, OOOH 018H,03011,060H,060H,060H,030H,018H,OOOH 060H,030H,01BH,018H,018H,030H,060H,000H OOOH, 066H, 03CH, OFFH, 03CH, 066H, OOOH, 00011 OOOH, 030H, 030H,

0_21

DB
08
DB DB OB DB DB DB
DB

"0_22

0 23

lC CO 78 OC F8
CC 18 30 66 38 76 DC CC CO 00 00 00 60 60 60 30 18 18 18 30 3C FF 3C 66 30 FC 30 30 00 00 00 30 00 Fe 00 00 00 00 00 30 18 30 60 CO CE DE F6 E6 30 30 30 30 oe 38 60 ee DC 38 oc CC

$ 0_24
PER CENT o_25
& 0_26

0_27 {0_28 ) o_29

DB DB DB
DB

D_2A

FCH, 030H, 030H, OOOH, OOOH

+ D_26
,D_<'C

OOOH, OOOH, OOOH, OOOH, OOOH, 030H,030H, 060H

OOOH,OOOH,OOOH,OFCH,OOOH,OOOH,OOOH,OOOH ;- o_20 OOOH, OOOH, OOOH, OOOH, OOOH, 030H, 030H, OOOH 006H, OOCH, 018H, 030H, 060H, OCOH, 080H,OOOH 07CH, OC6H, OCEH, ODEH, 0 F6H, OE6H, O/CH, OOOH 030H, 070H, 030H, 030H, 030H, 030H,OFCH,000H ; 078H, OCCH, OOCH, 038H, 060H, OCCH, OFCH, UOUH ; 078H, OCCH, OOCH, 038H, OOCH,OCCH,078H, OOOH ; / D_2E 0_2F

DB

7e 7e 30 FC 78 FC 78 78

08
DB DB

0 0_30 1 0_31 2 0_32 3 0_33

DB

5-172

ORGS

lCOE lC16 lCIE


1 C26

lC2[ lC36 lC3E lC46 1C4E 1C56 lC5E lC66 le6E 1C76 1C7
1 C86

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

6C CC FE DC F8 DC OC CC CO F8

DB DB DB DB

01CH,03CH,06CH,OCCH,OFEH,OOCH,01EH,OOOH ; OFCH,OCOH,OF8H,00CH,00CH,OCCH,078H,OODH ; 03BH,060H,OCOH, OF8H, OCCH, OCCI!, 078H, OOOH ; OFCH, OCCH,OOCH, 01SH, 030H, 030H, 030H, 00011 ; 07BH,OCCll,OCCH,0781-I,OCC!l,OCC11,078H,000H ;

4 0_34 5 o_35 6 o_36 7 o_37 8 0_38 9 o_39 O_3A ;

cc

ec

DC 18 30 30

ec 78 ec

cc
DB DB DB DB DB DB DB

ec 7C DC 18 30 00 00 30 30 00 00 30 60

078H,OCCH,OCCH,07CH,00CH,018H,070H,OOOH OOOH, 030H, 030H, OOOH, OOOH, 030H, 030H, OOOH; OOOH,030H,030H,OOOH,OOOH,030Ii,030H,060H; 018H,030H,060H,QCOH,060H,030H,018H,OOOH ; OOOH,OOOH,OFCH,OOOH,OOOH,OFCH,OOOll,OOOH ; 060H,030H, 018H, OOCH, 018H, 030H, 060H, OOOH ; 078H,OCCH, OOCH, 018H, 030H, OOQH, 030H, OOOH 07CH, OC6H, OOEH, OOEH, OOEH, OCOH, 078H, OOOH 030H,078H,OCCH,OCCH,OFCH,OCCH,OCCH,000H ; OFCH,06GH,066H,07CIl,066H,066H,OFCH,000H 03CH,066H, oeOH, oeOH, OCOH, 066H, 03CH, OOOH OF8H,06CH,066H,066H,066H,06CH,OF8H,OOOH orEH,062H, 068H, 07811, u61:$H, 062H, orEH, OOOH OFEH,062H,068H,078H,068H,060H,OFOH,OOOH; 03CH,066H,OCOH,OCOH,OCEH,066H,03EH,000H ; OCCll, OCCH, UCCH, OFCH, oeCH, OCCH, OCCH, OOOH ; 078H,030H,030H,030H,030H,030H,078H,000H 01 fH, (lOCH, OOCH, OOCH, QCCH, OCCH, 078H, OOOH OE6H, 066H, 06CH, 0781-1, 06CH, 066H, OE6H, OOOH OFOH,060H,060H,060H,062H,066H,OfEH,OOOH OC6H,OEl:.H,OFEH,OFEH,oo6H,OC6H,oc6H,OOOh OC6H, OE61-1, OF6H, OOEH, OCEH, DC6H, DC6H, OOOH 038H, 06CH, OC6H,OC6H,OC6H, 06CH, 038H, OOOH OFCH,066H,066H,07CH,060H,060H,OFOH,000H 078H,occH,oecH,oceH,ODcH,078H,01CH,OOOH OfCH,066H,066H,07CH,06CH,066H,OE6H,OOOH 078H, OCCH, OEOH, 070H, OICH, OCCH, 078H, OOOH OFCH, OB4H, 030H, 030H, 030H, 030H, 07811, OOOH OCCH,OCCH,OCCH,OCCH,OCCH,OCCH,OFCH,OOOH OCCH,OCCH,OCCH,OCCH,OCCH,078H,030H,000f! OC611, OC6H, OC6H, 006H, OFEH, OEEH, OC6H, OOOH OC6H, OC6H, 06CH, 038H, 038H, 06CH, OC6H, OOOH DCCH, OCCH, OCCH, 078H, 030H, 030H, 078H, 00011 ; OFEH,OC6H,08CH,018H,032H,066H,OFEH,OOOH D78H,060H,060H,06oH,060H,060H,078H,000H ; OCOH, 060H, 030H, 0 18H, OOCH, 006H, 00211, OOOH ; 078H,018H,018H,018H,018H,018H,078H,OOOll; 01 OH, 038H, 06CH, OC6H, OOOH, OOOH, OOOH, OOOH OOOH,OOOH,OOOH,OOOH,OOOH,OOOH,OOOH,OFFH 030H, 03011, 01BH, OOOH, OOOH, OOOH, GOOH, OOOH OQOH,00011,078H,OOCH,07CH,OCCH,076H,OOOH OEOH, 060H,060H, 07CH, 066H, 066H, OOCH, OOOH ; OOOH,0001-!,078H,OCCH,OCQH,OCCH,078H,000H ; 0ICH,OOCH,OOCH,07CH,OCCH,OCCll,0'16H,OGOH;

0_36

co

60 30

< O_3C
'" 0_30

re

00 00 Fe

18 oe 18 30

> 0_3E
? 0_3F
@ 0_110

60 00
78 CC OC 18 30 00

30 00
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 DE DE DE CO CC CC Fe 66 7C
DB DB DB DB DB DB DB DB DB DB DB DB DB DB DB DB

cc
66

A o_41
B o_42

66 66

co co eo

C D_ 43

lC8E

66 66 66 6C

0_44

lC96
IC9E

68 78 68 62 68 78 68 60
CO CO C[ 66

E 0_4:;
F 0_46
G 0_47

1 CAG
1 CAE

lCB6
1 eBE

CC cc cc Fe CC cc cc 00 78 30 30 30 30 30 78 00
1 E DC DC OC CC

H 0_118
I 0_lj9

ec
66 66

J 0_ 4A
K 0_ 4B L D_4C
M o_40
N 0_ 4E

lGC6

1 GeE
1COG lCOE lCE6 lCEE

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
66 7C 60 60 ee CC DC 78 66 7C 6G EO 70 Ie

0_ 4F

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

FC 66 Fa 00 78 CC lG 00 FC 66 F6 00 78 ce 78 00 FC 84 78 00 CC ce FC 00 CC CC 30 00 C6 C6 C6 00 C6 C6 C6 00 CC CC 78 00 FE C6 FE 00 78 60 78 00 CO 60 02 00 78 18 78 00 10 38 00 00 00 UU 00 rF 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

DB DB DB

PO_50
Q 0_51

66

R 0_:>2 SO_53 TO_54

cc

DB DB
08
DB DB DB DB DB DB DB DB DB DB

30 30 30 30 cc CC CC CC CC CC CC 78 C6 [)6 fCE E.E 6C 38 38 6C CG 78 30 30 8C 18 32 66 60 60 60 60 30 18 OC 06 18 18 18 18 6C C6 00 00 00 00 00 00

U 0_'::>5

0_56

W 0_57
X 0_58 YO_59

Z 0_5A
[

05B

BACKSlASH 0_5C

50

CIRCUMFLEX 0_5E 5F

30 18 00 00 00

DB DB DB DB

o_60 LOWER CASE A o_61 L. C. L.C. L.C. L.C. L. C. L.C. L.C. L.C.
B 0_62

00
00 00 60 00 00 00 OC 00 00 00 6C 00 00 FS 60 00 00 00 00 78 780C 7C CC 60 7C 66 66 78 CC co CC DC 7C CC CC 78 CC FC CO 60 FQ 60 60 76 CC CC 7C 6C 76 66 66 70 30 30 30 OC OC DC CC
DB DB DB DB

C 0_63 00_611 E o_65


f

OOOH,000H,078H,OCCH,OFCH,OCOH,078H,000H ; 038H,06cH, 0601'1, OFOH. 060H, 060H, OFOH, OOOH ; OOOH,OOOH,076H,OCCH,OCCH,07CH,OOCH,Of8H ; OEOH,060H,06CH,076H,066H,066H,OE6H,000H ; 030H.000H,070H,030H,030H,030H,078H,OOOH 00CH,000H,OOCH,OOCH,OOCH,OCCH,OCCH,078H OEOH, 060H.066H, 06CH, 078H, 06CH, OE6H, OOOH 070H, 030H, 030H, 030H, 0301-1, 030H, 078H, OOOH

0_66

G 0_67

H 0_68
I

08
DB DB

0_69 D_6A

t C. J
L.C. L. C. L.C.

60 66 6c 78 6C
00 30 30 30 30 30

K 0_68 L D_6C M o_60

00
DB DB DB

10E6
1 DEE

00 CC FE FE 06 00 00 F8 CC CC CC CC 00 00 00 78 CC CC CC 78 00 00 00 DC 66 66 7C 60 FO

000H,000H,OCCH,OFEH,OFEH,006H,QC6H,OOOH OOOH,OOOH,OF8H,OCCH,OCCH,OCCH.OCCH,000H OOOH,000H,078H,OCCH,OCCH,OCCH,078H,OOOH ; OOOH,OOOH,OOCH,066H,066H,07CH,060H,OFOH;

L.C. N D_6E
L.C. LC.

0_6f

DB

P o_70

ORGS

5-173

10f6 lOfE lE06

1 EOE
1 E16

1 E1 E
1 E26
1 E2E 1E36 1 E3E 1E46 1 E4E
1 E56

1 ESE 1E66

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

76 CC CC 7C DC 76 66 60 7C CO 78 DC 7C 30 30 34 CC CC CC CC CC CC CC 78 C6 06 FE FE C6 6c 38 6C CC CC CC 7C FC 98 30 64 30 EO 30 30 18 00 18 18 30 lC 30 30 00 00 00 00

DB DB DB DB DB DO DB DO DB DB DB DB DB DB

OOOH, OOOH, 076H, OCCH, OCCH, 07CH, OOCH, 01 EH ; OOOH, OOOH, OOCH, 076H, 066H, 060H, 0 FOH, OOOH OOOH, OOOH, 07CH, OCOH, 07BH, OOCH, OF8H, OOOH ; 01011, 030H, 07CH, 030H, 030H, 034H, 01 8H, OOOH OOOH, OOOH, OCCH, OCCH, OCCH, QCCH, 076H. OOOH OOOH, OOOH, OCCH, OCCH, OCCH, 07BH, 030H, OOOH OOOH, OOOH, OC6H, 006H, OFEH, OFEH, 06CH, OOOH ; OOOH, OOOH, OC6H, 06CH, 038H. 06CH, OC6H, OOOH ; OOOH, OOOH, OCCH, OCCH, OCCH. 07CH, OOCH, OfBH OOOH, OOOH,

L.C.
L.C. L.C. L.C. L.C. L.C.

0~7l

R 0_72 S

o_73

T 0_74
U o_75

V o_76

L.C. W L.C.

0_77

X o_78

L. C. Y 0_79

aFCH, 09BH, 030H, 064H, OFCH, OOOH

L. C.

Z 0_7A

01 CH, 030H, 030H, OEOH, 030H, 030H, 0 1CH, OOOH ; 018H, 01 BH, 0 18H, OOOH, 018H, 01 8H, 0 18H, OOOH ; OEOH, 030H, 030H, 0 1 CH, 030H, 030H, OEOH, OOOH ; 076H, OOCH, OOOH, OOOH, OOOH, OOOH, OOOH, OOOH ; OOOH, Q10H, 038H, 06CH, OC6H, OC6H, OFEH, OOOH

0_7B

0_7C 0_70 D_7E

00 10 38 6C C6 C6 FE 00 .LI ST

DB

OELTA D_7F

; ------ T I ME OF OAY
1E6E '" 1 E6E 1 E6E E9 0000 E ;-------- TIMER
ORG ORG

o FE6EII
01 E6EH

EQU JMP

$
TIME_OF_DAY_1

INTERRUPT
ORG ORG

1 EA5 '" lEA5 1 EA5 E9 0000 E

OFEA5H 01 EA5H

EQU JMP
; -------- VECTOR TABLE

TIMER_INT_l

1 EF3 1EF3

ORG ORG

VECTOR_TABLE lEAS 0987 0000 0000 0000 0000 OFS7 0000

LABEL

OFEF3H 01 EF3H WORD VECTOR TABLE INTERRUPT 8 INTERRUPT 9 INTERRUPT A (SLAVE INTERRUPT B INTERRUPI (; INTERRUPT 0 I NTERRU PT E INTERRUPT f

1EF3 1 U5 1 EF7 1 EF9

R
R E E E E R

OW

1 ErO 1 EFO 1 EFF 1 FOl

DW DW DW DW
OW OW

ow

OFFSET TIMER INT OF FSET KB I NT OFFSET D1T OFFSET 011 OffSET 011 OFFSET 011 OFFSET DISK INT OFFSET D11 INTERRUPTS

INPUT)

;------- 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 lF15 lF17 lF19 1F1B 1 FlO 1F1F 1 F21 1 F23 1 F23 1 F25 1 F27 1 F29 1 F2B 1 F20 1 F2F lF31 0000 UOOO 0000 0000 0000 0000 0000 0000 06F2 1t::6E lF53 1F53 10A4 OFC7 0000 R R R R R R

ow
DW
OW

OFfSET VIDEO 10 OFFSET [QUI PMENT 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

INT 10H INT 11H

DW
OW

g~~~~~ ~T~~~iT~I~~_OETERMI7~T

13H

INT 12H

ow ow ow Ow ow ow
OW

011

[Jw

ow Ow
OW

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~

SLAVE_VECTOR TABLE LABEL WORD

Ow ow Ow

OW OW OW OW OW

OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET

RTC (NT RE DIRECT 01T 011 011 INT_287 011 011

75 MATH PROCESSOR I NTt::HHUPT 76 77

; ------- DUMMY

I NTERRUPT HANDLER
ORG ORG

1F53 '" 1 F53


1 F53

OFF53H 01 F53H

OUMMY_RETURN CF ; -------

EQU
IRET

PR I N r SCREEN
ORG ORG [QU

1 F54 '" 1 F54 1 F54 E9 0000 E

OFF5 t lH 01 F54H

S
PRINT_SCREEN_l ; TUTOR

JMP

. LI Sl

5-174

ORGS

POWER ON RESET VECTOR ORC OFFFOH aRC 01 FFOH PUBLIC r 0 R ; ------ POWER ON RESET P_O_R LABEL fAR
EA DB

1 FFO 1 FFO HFO 1FF1 HF3 1FF5 1FFE HfE lFfF 005B R FOOO 30 31 2F 31 38 34
FC

ow
30 2F

DW

OEAH OFfSET OFOOOH

RESEr

; HARD CODE JUMP ;OFFSO ; SEGMENT ; RELEASE MARKER ;TH IS

DB DRC
CODE
DB ENDS END

'01/10/84' 01 FFEH OFCH

pc's

10

ORGS

5-175

5176

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 mod reg r/w

10001 OOW

Register/Memory to Register 1000101w mod reg r/w

1100011w

mod 000 r/w

data if w = 1

1011wreg

I data

Immediate to Register

I data if w = 1

Memory to Accumulator 1010000w

I addr-Iow I addr-Iow

I addr-high
Accumulator to Memory

1010001w

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

I 000regl10 I 01101050 I 01100000


POP = Pop
data

Segment Register

Immediate

I data if

5 =

PUSHA = Push All


Push All

Memory 10001111 modOOO r/m

I 01011 reg

Register

I 000regl11

Segment Register reg", 0

POPA = POp All

I 01100001

Pop All

6-4 Instruction Set

XCHG

= Exchange
Register Memory with Register 1 mod reg rim

1000011w

Register with Accumulator 10010reg

IN

= Input From
Fixed Port 1 port

1110010w

Variable Port 1110110w

OUT

= Output To
Fixed Port port

1110011 w

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 1 mod reg rim

LDS

= Load Pointer to DS
Load Pointer to OS 1 mod reg rim mod", 11

11000101

Instruction Set 6-5

LES = Load Pointer to ES

I 11000100
I 10011111

I mod reg rim

Load Pointer to ES mod 11

LAHF = Load AH with Flags


Load AH with Flags

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
1 oOOOOOOw
Reg/Memory with Register to Either

I mod reg rim

100000sw

data if sw = 01

1 0000010w

I data

Immediate to Accumulator

I data if w = 1

ADC = Add with Carry

6-6 Instruction Set

000100dw

Reg/Memory with Register to Either mod reg rim

100000sw

data if sw = 01

Immediate to Accumulator 000101 Ow data

I data if w = 1

INC

= Increment
Register/Memory modOOO rim

1111111w

Register 01000reg

SUB

= Subtract
Reg/Memory with Register to Either mod reg rim

001010dw

Immediate from Register Memory 100000sw mod101 rim

I data I data if w = 1

I data if sw = 01

Immediate from Accumulator 0010110w data

SBB = Subtract with Borrow

I 000110dw
100000sw

Reg/Memory with Register to Either mod reg rim

Immediate to Register Memory mod011 rim data data if sw = 01

Instruction Set 6-7

10001110w

I data

Immediate to Accumulator

I data ifw= 1

DEC = Decrement
Register/Memory lllll11w modOOl rim

I 01001 reg
CMP = Compare

Register

I 0011101w I 0011100w
100000sw

Register/Memory with Register mod reg rim

Register with Register/Memory mod reg rim

Data if sw = 01

I 0001110w

Immediate with Accumulator Data

I Data if w = 1

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

I 00111111
DAS

ASCII Adjust for Subtract

= Decimal Adjust for Subtract


Decimal Adjust for Subtract

I 00110111

MUL = Multiply (Unsigned)

I 1111011w I mod100
I mod101

Multiply

rIm

IMUL = Integer Multiply (Signed)


Integer Multiply 11111011w

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 ! 00001010

AAD

= ASCII Adjust for Divide

Instruction Set 6-9

ASCII Adjust for Divide 11010101 1 00001010

CBW

= 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

Register Memory by CL 1101001w 1 mod TTT rim

Register Memory by Count 1100000w 1 mod TTT rim 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 mod reg rim

1 001000dw

6-10 Instruction Set

1000000w

Data if w = 1

I 0010010w

Data

Immediate to Accumulator Data if w = 1

TEST = AND Function to Flags; No Result


100001 Ow Register Memory and Register mod reg rim

Immediate Data and Register Memory 1111011w modOOO rim

I Data I Data if w = 1

I Data if w=1

Immediate to Accumulator 0000110w Data

Or= Or
Reg/ Memory and Register to Either 000010dw mod reg rim

Immediate to Register Memory 1000000w mod001 rim

I Data I Data if w = 1

I Data if w = 1

Immediate to Accumulator 0000110w Data

XOR = Exclusive OR
Reg/Memory and Register to Either 001100dw mod reg rim

Immediate to Register Memory 1000000w mod110 rim

I Data

I Data if w = 1

Instruction Set 6-11

I 0010010w

Immediate to Accumulator Data

I Data if w = 1

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 11010010w

CMPS

= Compare String
Compare String
11010011w

1 1111001z

SCAS

= Scan String
Scan String
11010111w

111110010

LODS

= Load String
Load String
1 1010110w

1 11110010

STOS

= Store String
Store String
11010101w

111110010

INS

= Input String
Input String
1 011011 Ow

1 11110010

OUTS

= Output String
Output String
11010011w

11110010

Control Transfer

Instruction Set 6-13

CALL = Call
11101000

I disp-Iow

Direct Within Segment

I disp-Iow

11111111

I mod010 rim
Se

Register/Memory Indirect Within Segment

10011010

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 I disp=low

Short/Long

Direct within Segment

11101001

I disp-high

6-14 Instruction Set

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
I 01111100

I disp
I disp

Jump on Equal Zero

JL/JNGE = Jump on Less Not Greater, or Equal


Jump on Less Not Greater, or Equal

JLE/JNG = Jump on Less, or Equal Not Greater

I 01111110
JB/JNAE

Jump on Less, or Equal Not Greater

I disp
= Jump on Less, or Equal Not Greater
Jump on Less, or Equal Not Greater

I 01110010

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
Jump on Overflow

JO = 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 I 01111101 I 01111111


JNB/JAE

I disp

Jump on Not Equal Not Zero

JNL/ JGE = Jump on Not Less Greater or Equal


Jump on Not Less Greater or Zero

I disp
Jump on Not Less or Equal Greater

JNLE/JG = 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
Jump on Not Below or Equal Above

JNBE/ JA = Jump on Not Below or Equal Above


101110111

I disp

JNP / JPO

= Jump on Not Parity


I disp

Parity Odd

Jump on Not Parity Parity Odd

I 01111 011
JNO

= Jump on Not Overflow


Jump on Not Overflow

I 01110001
JNS

I disp
Jump on Not Sign

= Jump on Not Sign

I disp LOOP = Loop ex Times

I 01111 011

Instruction Set 6-17

loop

ex Times

11100010

1 disp

LOOPZ/LOOPE
1 11100001 1 disp

= Loop while Zero Equal


loop while Zero Equal

LOOPNZ/LOOPNE
1 11100000 1 disp

= Loop while Not Equal Zero


loop while Not Equal Zero

JCXZ

= Jump on CX Zero
Jump on

ex Zero

1 11100011

1 disp

ENTER = Enter Procedure


Enter Procedure

11001000

1 data-low

1 data-high

1L

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

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

1 00000110

ESC

= 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 00001111 I 00001111

I 00000001 I 00000001 I 00000001

I modOOO rim I mod011 rim I mod001 rim

LIDT = Load Interrupt Descriptor Table Register


Load Interrupt Descriptor Table Register

SIDT = Store Interrupt Descriptor Table Register


Store Interrupt Descriptor Table Register

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 00001111

I 00000000
I 00000000

I modOOO r / m
I mod011 r / m

LTR = Load Task Register from Register Memory


load Task Register from Register Memory

Instruction Set 6-21

STR

= Store Task Register to Register Memory


00000000

00001111

LMSW

= Load Machine Status Word from Register Memory


Load Machine Status Word from Register Memory 100000001

100001111

I mod110rlm

SMSW

= Store Machine Status Word

100001111

I 00000001

Store Machine Status Word

I mod100 rim I mod reg rim

LAR = Load Access Rights from Register Memory


Load Access Rights from Register Memory

I 00001111
I 00001111
ARPL

I 00000010 I 00000011

LSL = Load Segment Limit from Register Memory


Load Segment Limit from Register Memory

I mod reg rim

= Adjust Requested Privilege Level from Register Memory


Adjust Requested Privilege Level from Register Memory

I 01100011 I 00001111
VERR

I mod reg rim I mod100 rim


Verify Write Access

VERR = Verify Read Access; Register Memory


Verify Read Access; Register Memory

I 00000000

= 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
reg 00 01 10 11

Segment Override Prefix

reg is assigned as follows: Segment Register ES CS SS DS


16-bit (w = 1) 000 AX 001 CX 010 OX 011 BX 100 SP 101 BP 110 SI 111 01 8-bit (w= 0) 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

I escape MF 1 I escape 111 I escape 011 I escape 111 I escape 001


FST = Store

I mod 000 rim

Integer/Real Memory to ST(O)

I mod 101 rim I mod 101 rim

Long Integer Memory to ST(O)

Temporary Real Memory to STlO)

I mod 100 rim


11000ST(i}

BCD Memory to ST(O)

ST(i) to ST(O)

I escape MF 1 I escape 101

I mod 010 rim


11010 ST(i}

ST(O) to Integer/Real Memory

ST(O) to ST(i)

6-24 Instruction Set

FSTP = Store and Pop

I escape MF 1 I escape 111 I escape 011 I escape 111 I escape 101 I escape 001

I mod011 rim

ST(O) to Integer/Real Memory

I mod 111 rim

ST(O) to Long Integer Memory

I mod 111 rim I mod 110 rim


11011 STIi)

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) 11001 ST(j)

Comparison
FCOM = Compare
Integer/Real Memory to ST(O)

I escape MF 0 I escape 000 I escape MF 0

I mod 010 rim


11010 STIi)

ST(i) to ST(O)

FCOMP = Compare and Pop


Integer/Real Memory to ST(O)

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

+ 0.0 into ST(O)


Load + 0.0 into ST(O) 111101110

I escape 000
FLDI ... Load
1 escape 001

+ 1.0 into ST(O)


Load + 1.0 into ST(O) 1 11101000
'TT' into ST(O)

FLDPI - Load 'TT'into ST(O)


1 escape 001 1 11101011

Load

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 111101100

1 escape 001

FLDLN2

= 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 mod 000 rim

1 escape MF 0

STU) and ST(O)

1 escape dPO

11000 ST(i)

FSUB = Subtraction
Integer/Real Memory with ST(O)

1 escape MF 0

1 mod 10r rim

ST(i) and ST(O)

1 escape dPO

1110r r /m

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

STIiI and ST(O)


1 escape dPO

1 1111rr/m

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 111111101

FPREM

= Partial Remainder of ST(O) + ST(1)


Partial Remainder of ST(O) + ST(1) 111111000

1 escape 001

FRNDINT = Round ST(O) to Integer


Round ST(O) to Integer 1 escape 001 111111100

FXTRACT
1 escape 001

= Extract Components of ST(O)


Extract Components of ST(O) 111110100

FABS

= Absolute Value of ST(O)


Absolute Value of ST(O) 111100001

1 escape 001

FCHS

= Change Sign of ST(O)


Change Sign of ST(O) 111100000

1 escape 001

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
ST(O)-1

F2XMI = 2 ST(O)_1

escape 001

I 11110000
ST(1) x log

FYL2X

= ST(1) X Log2 [ST(O)) 2 [ST(O)]

I escape 001 I escape 001

I 11110001
X

FYL2XPI = ST(1)

LogdST(O)

+ I] 2 [ST(O) + 1]

ST(1) x log

/ 11111001

Processor Control
FINT

= Initialize NPX

I escape 011 I escape 011

I 11100011 I 11100100

Initialize NPX

FSETPM = Enter Protected Mode


Enter Protected Mode

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

1 mod 101 rim

FCLEX

= Clear Exceptions
Clear Exceptions 1 11100010

1 escape 011

FSTENV = Store Environment


Store Environment

I escape 001

1 mod 110 rim

FLDENV = Load Environment


Load Environment 1 escape 001

I mod 100 rim


Save State

FSAVE = 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

I escape 001
FDECSTP

I 11110111

Increment Stack Pointer

= Decrement Stack Pointer


Decrement Stack Pointer

I escape 001

I 11110110
Free ST(i)

FFREE = Free ST(i)

I escape 101
I escape 001

I 11000ST(i)
No Operation 11010000

FNOP = No Operation

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

As Characters
"'V7Q"VftVO

Color/Graphics Monitor Adapter Modes


:
_U~ft. . .

vw,"v

,"v

IBM Monochrome Display Adapter Non-Display Underline Normal Normal Normal

00

Blank (Null)

Ctrl2

Black

Black Blue

02 03 04

2 3

06 07 08 7 8

+ ...
0

lack Ctrl C Black

GI Cyan

Ctrl E

Black

Magenta

Normal

CtrlG Ctrl H. Backspace. Shift Backspace Ctrll Ctrl J. Ctrl.,J

Black Black

Light Grey Dark Grey

Normal Non-Display

09 OA

9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Black Black Black Black

Light Blue Light Green Light Green Light Red Light Magenta Yellow White Black Blue Green Cyan Red Magenta

HiQh Intensity Underline High Intensity High Intensity Higllintensity High Intensity High " .. ~ .. ~ .. High

OB OC 00 OE OF 10 11 12 13 14 15 16 17

cr'
9

Ctrl K Ctrl L. Ctrl M Shift.-J Ctrl N CtrlO CtrlP Ctrl Q Ctrl R Ctrl S Ctrl T Ctrl U Ctrl V CtrlW

Jl
~ U

.-J.

Black

Black Black Blue Blue Blue Blue Blue

""""''''y

...

Normal Underline Normal

1..
.

! !! IT

Normal Normal Normal Normal

Blue Blue

Brown Light Grey

Characters, Keystrokes, and Color 7-3

As Text Attributes IBM Monochrome Display Modes Background Foreground Adapter Blue Blue Dark Grey Light Blue High Intensity High Intensity Underline High Intensity High Intensity Color/Graphics Monitor Adapter

Value Hex Dec Symbol 18 19 24 25


1

As Characters Keystrokes Ctrl X Ctrl Y

1A 1B

26 27

Ctrl Z Ctrl [, Esc, Shift Esc, Ctrl Esc Ctrl \ Ctrl

Blue Blue

Light Green Light Cyan

1C 10

28 29

L
+--+

Blue Blue

Light Red Light Magenta Yellow White Black

High Intensity High Intensity

1E 1F 20

30 31 32

" Blank
Space

Ctrl6 Ctrl Space Bar, Shift, Space, Ctrl Space, Ait Space

Blue Blue Green

High Intensity High Intensity Normal

21 22 23 24 25 26 27 28 29

33 34 35 36 37 38 39 40 41

!
"

!
"

Shift Shift Shift Shift Shift Shift

Green Green Green Green Green Green Green

Blue Green Cyan Red Magenta Brown Light Grey Dark Grey Light Blue

Underline Normal Normal Normal Normal Normal Normal High Intensity High Intensity Underline High Intensity High Intensity High Intensity High Intensity

$
%

$
%

&

&

Shift Shift

Green Green

2A 28 2C 20

42 43 44 45

.
+ +

Note 1 Shift

Green Green Green

Light Green Light Cyan Light Red Light Magenta Yellow

Green

2E

46

Note 2

Green

High Intensity

7 -4 Characters, Keystrokes, and Color

As Text Attributes Value Hex Dec Symbol 2F 30 31 32 33 34 35 36 37 38 39 47 48 49 50 51 52 53 54 55 56 57


/

As Characters Keystrokes
/

IBM Monochrome Display Modes Background Foreground Adapter Green Note 3 Note 3 Note 3 Note 3 Note 3 Note 3 Note 3 Note 3 Note 3 Note 3 Cyan Cyan Cyan Cyan Cyan Cyan Cyan Cyan Cyan Cyan White 81ack 81ue Green Cyan Red Magenta 8rown Light Grey Dark Grey Light Blue High Intensity Normal Underline Normal Normal Normal Normal Normal Normal High Intensity High Intensity Underline High Intensity High Intensity High Intensity High Intensity

Color/Graphics Monitor Adapter

0 1 2

0 1 2 3 4 5 6 7 8 9

3
4 5 6 7 8 9

3A 3B 3C 3D

58 59 60 61

Shift

Cyan Cyan

Light Green Light Cyan Light Red Light Magenta Yellow White Black Blue Green Cyan Red Magenta Brown Light Grey Dark Grey Light Blue

<
=

< = >
?
@
A B C D E F G H I

Shift

Cyan Cyan

3E 3F 40 41 42 43 44 45 46 47 48 49

62 63 64 65 66 67 68 69 70 71

>
?
@
A B C D E F G H I

Shift Shift Shift Note 4 Note 4 Note 4 Note 4 Note 4 Note 4 Note 4 Note 4 Note 4

Cyan Cyan Red Red Red Red Red Red Red Red Red Red Red

High Intensity High Intensity Normal Underline Normal Normal Normal Normal Normal Normal High Intensity High Intensity Underline High Intensity

72
73

4A

74

Note 4

Light Green

Characters, Keystrokes, and Color 7-S

As Text Attributes IBM Monochrome Display Modes Background Foreground Adapter Note 4 Note 4 Note 4 Red Red Red Light Cyan Light Red Light Magenta Yellow White Black Blue Green Cyan Red Magenta Brown Light Grey Oark Grey Light Blue High Intensity High Intensity High Intensity Color/Graphics Monitor Adapter

Value Hex Dec Symbol 4B 4C 40 75 76

As Characters Keystrokes

K
L M

K
L M

77
78 79 80 81 82 83 84 85 86 87 88 89

4E 4F 50 51 52 5;3 54 55 56 57 58 59

Note 4 Note 4 Note 4 Note 4 Note 4 Note 4 Note 4 Note 4 Note 4 Note 4 Note 4 Note 4

Red Red Magenta Magenta Magenta Magenta Magenta Magenta Magenta Magenta Magenta Magenta

High Intensity High Intensity Normal Underline Normal Normal Normal Normal Normal Normal High Intensity High Intensity Underline High Intensity High Intensity High Intensity High Intensity

0
p
Q

0
P
Q

R S T U V W
X

R S T U V W
X

5A 5B 5C 50

90 91 92 93

Z
[
\

Z
[
\

Note 4

Magenta Magenta Magenta Magenta

Light Green Light Cyan Light Red Light Magenta Yellow White Black Blue Green Cyan Red Magenta Brown

I
A

I
A

5E 5F 60 61 62 63 64 65 66

94 95 96 97 98

Shift Shift

Magenta Magenta Yellow

High Intensity High Intensity Normal Underline Normal Normal Normal Normal Normal

a b c d e f

a b c d e
f

Note 5 Note 5 Note 5 Note 5 Note 5 Note 5

Yellow Yellow Yellow Yellow Yellow Yellow

99
1()() 101 102

7 -6 Characters, Keystrokes, and Color

As Text Attributes IBM Monochrome Display Adapter Modes Background Foreground Note 5 Note 5 Note 5 Yellow Yellow Yellow Light Grey Dark Grey Light Blue Normal High Intensity High Intensity Underline High Intensity High Intensity High Intensity High Intensity Color /Graphics Monitor Adapter

Value Hex Dec Symbol 67 68 69 103 104 105 g h i

As Characters Keystrokes g h i

6A 106 6B 6C 6D 107 108 109

J
k I m

Note 5 Note 5 Note 5 Note 5

Yellow Yellow Yellow Yellow

Light Green Light Cyan Light Red Light Magenta Yellow White Black Blue Green Cyan Red Magenta Brown Light Grey Dark Grey Light Blue

k I m

6E 6F 70 71

110 11 1 112 113 114 115 116 117 118 119

n
0

Note 5 Note 5 Note 5 Note 5 Note 5 Note 5 Note 5 Note 5 Note 5 Note 5 Note 5 Note 5

Yellow Yellow White White White White White White White White White White

High Intensity High Intensity Reverse Video Underline Normal Normal Normal Normal Normal Normal Reverse Video High Intensity Underline High Intensity High Intensity High Intensity High Intensity

a
p
Q

p
Q

72
73 74 75 76

r s

r s

I
u v w
x

I
u v w
x

77

78 120
79 121

7A 122 7B 7C 123 124

z
{
I I

Note 5 Shilt Shift Shift

White White White White

Light Green Light Cyan Light Red Light Magenta Yellow White

I
I I

7D 125

7E 7F

126 127

t:.

Ctrl -

Shift

White White

High Intensity High Intensity

Characters, Keystrokes, and Color 7-7

As Text Attributes IBM Monochrome Display Modes Background Foreground Adapter Color / Graphics Monitor Adapter

Value Hex Dec Symbol

As Characters Keystrokes

.. . .
80 B1 82 83 B4 85 86 87 88 89

80 to FF Hex are Flashing in both Color &. IBM Monochrome'

128 129 130 131 132 133 134 135 136 137

C
U

Alt 128 Alt 129 Alt 130 Alt 131 Alt 132 Alt 133 Alt 134 Alt 135 Alt 136 Alt 137

Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6

Black Black Black Black Black Black Black Black Black Black

Black Blue Green Cyan Red Magenta Brown Light Grey Dark Grey Light Blue

Non-Display Underline Normal Normal Normal Normal Normal Normal Non-Display High Intensity Underline High Intensity High Intensity High Intensity High Intensity

e a a
II

a
C

e e
e
'i i i

8A 8B 8C 8D

138 139 140 141

Alt 138 Alt 139 Alt 140 Alt 141

Note 6 Note 6 Note 6 Note 6

Black Black Black Black

Light Green Light Cyan Light Red Light Magenta Yellow White Black Blue Green Cyan Red Magenta Brown Light Grey Dark Grey Light Blue

8E 8F 90 91 92 93 94 95 96 97 98 99

142 143 144 145 146 147 148 149 150 151 152 153

Alt 142 Alt 143 Alt 144 Alt 145 Alt 146 Alt 147 Alt 148 Alt 149 Alt 150 Alt 151 Alt 152 Alt 153

Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6

Black Black Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue

High Intensity High Intensity Normal Underline Normal Normal Normal Normal Normal Normal High Intensity High Intensity Underline High Intensity

E
ae

AE
6

0
b

a
U

Y
0
U

9A 154

Alt 154

Note 6

Blue

Light Green

7 -8 Characters, Keystrokes, and Color

As Text Attributes

Value Hex Dec Symbol 9B 9C 155 156

As Characters Keystrokes Alt 155 Alt 156 Alt 157

IBM Monochrome Display Modes Background Foreground Adapter


Color/Graphics Monitor Adapter Note 6 Note 6 Note 6 Blue Blue Blue Light Cyan Light Red Light Magenta Yellow White Black Blue Green Cyan Red Magenta Brown Light Grey Dark Grey Light Blue High Intensity High Intensity High Intensity

90 157

9E 9F

158 159

Pt

Alt 158 Alt 159 Alt 160 Alt 161

Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6

Blue Blue Green Green Green Green Green Green Green Green Green Green

High Intensity High Intensity Normal Underline Normal Normal Normal Normal Normal Normal High Intensity High Intensity Underline High Intensity High Intensity High Intensity High Intensity

AO 160 A 1 161 A2 A3 A4 A5 A6 A7 A8 A9 162 163 164 165 166 167 168 169

Alt 162 Alt 163 Alt 164 Alt 165 Alt 166 Alt 167 Alt 168 Alt 169

AA 170 AB AC 171 172

Alt 110 Alt 171 Alt 172 Alt 173

Note 6 Note 6 Note 6 Note 6

Green Green Green Green

Light Green Light Cyan Light Red Light Magenta Yellow White Black Blue Green Cyan Red Magenta Brown

AD 173

AE AF BO Bl B2 B3

174 175 176 177 178 179


-------

Alt 174 Alt 175 Alt 176 Alt 177

Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6

Green Green Cyan Cyan Cyan Cyan Cyan Cyan Cyan

High Intensity High Intensity Normal Underline Normal Normal Normal Normal Normal

I
r-r--t

Alt 178 Alt 179 Alt 180 Alt 181 Alt 182

B4 180 B5 B6

181 ~ 182

Characters, Keystrokes, and Color 7-9

As Text Attributes Color / Graphics Monitor Adapter Modes Background Foreground Note 6 Note 6 Note 6 Cyan Cyan Cyan Light Grey Dark Grey Light Blue IBM Monochrome Display Adapter Normal High Intensity High Intensity Underline High Intensity High Intensity High Intensity High Intensity

Value Hex Dec Symbol B7 B8 B9 183

As Characters Keystrokes Alt 183 Alt 184 Alt 185

III 184 R
185

BA 186 BB BC BD 187 188 189

Alt 186

Note 6 Note 6 Note 6 Note 6

Cyan Cyan Cyan Cyan

Light Green Light Cyan Light Red Light Magenta Yellow White Black Blue Green Cyan Red Magenta Brown Light Grey Dark Grey Light Blue

h1
~

Alt 187 Alt 188 Alt 189

BE BF CO Cl C2 C3 C4 C5 C6 C7 C8 C9

190 191 192 193 194 195 196 197 198 199 200 201

WJ P
11
L-

Alt 190 Alt 191 Alt 192 Alt 193 Alt 194

Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6

Cyan Cyan Red Red Red Red Red Red Red Red Red Red

High Intensity High Intensity Normal Underline Normal Normal Normal Normal Normal Normal High Intensity High Intensity Underline High Intensity High Intensity High Intensity High Intensity

fIrL==
---.J L -

Ait 195 Alt 196 Alt 197

===

Alt 198 Alt 199 Alt 200 Alt 201

II
I~

CA 202 CB 203

Alt 202 Alt 203 Alt 204 Alt 205

Note 6 Note 6 Note 6 Note 6

Red Red Red Red

Light Green Light Cyan Light Red Light Magenta Yellow White Black

--, r -

CC 204 CD 205

CE CF

206 207

:::;;:::
I

Alt 206 Alt 207 Alt 208

Note 6 Note 6 Note 6

Red Red Magenta

High Intensity High Intensity Normal

DO 208

1-10 Characters, Keystrokes, and Color

As Text A.ttributes

Value Hex IDec 1Symbol 1209 D2 210 D3 211 D4 1212 D5 213 D6 12 D7 215 D8 216 D9 217

As Characters
K"Y~"VR~~

IBM Monochrome Display Modes Background Foreground Adapter


Coior / Graphics Monitor Adapter Note 6 Note 6 Note 6 6 Note 6 Note 6 Note 6 Note 6 Note 6 Magenta Magenta Magenta Magenta Magenta Magenta Magenta Magenta Magenta Blue Green Cyan Red Magenta Brown Light Grey Dark Grey Light Blue Normal Normal Normal High Intensity High Intensity Underline High Intensity High Intensity High Intensity High Intensity Underline Normal Normal

Alt 209 Alt 210

!L-

Alt 211 Alt 212 Alt 213 Alt 214 Alt 215 Alt 216 Alt 217

C::: F

rI

f----DA 218 DB 219 DC 220 DD 221 Alt 218 Alt 219 Alt 220 Alt 221 Note 6 Note 6 Note 6 Note 6 Magenta Magenta Magenta Magenta Light Green Light Cyan Light Red Light Magenta Yellow White Black Blue
GI

DE 222 DF 223 EO 1224 1i1 E2 225 226 227 E4 E5 228 229

Alt Alt 223 Alt 224

Note 6 Note 6 Note 6 Note 6 6 Note 6 Note 6 Note 6 NI 6 6 Note 6 Note 6

Magenta Magenta Yellow Yellow Yellow Yellow Yellow Yellow Yellow Yel Yellow Yellow

High Intensity High Intensity Normal Underline NI Normal Normal Normal

f3

Alt 225 Alt 226 Alt Alt 228 Alt 229 Alt 230

r
rr

Cyan Red Magenta Brown Grey Dark Grey Light Blue

E6 1230 E7 E8 E9 231 232 233


{J
T

Alt 231 Alt Alt 233

Norm, High Intensity High Intensity Underline H ig h Intensity High Intensity

EA 234 EB 235

n
{j

Alt 234 Alt 235

Note 6 Note 6

Yellow Yellow

Light Green Light Cyan

Characters, Keystrokes, and Color 7-11

As Text Attributes IBM Monochrome Display Modes Background Foreground Adapter Note 6 Note 6 Yellow Yellow Light Red Light Magenta Yellow White Black Blue Green Cyan Red Magenta Brown Light Grey Dark Grey Light Blue High Intensity High Intensity Color/Graphics Monitor Adapter

Value Hex Dec Symbol


EC 236

As Characters Keystrokes Alt 236 Alt 237

ED

237

EE

238 239
Ii

Alt 238 Alt 239 Alt 240

Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6 Note 6

Yellow Yellow White White White White White White White White White White

High Intensity High Intensity Reverse Video Underline Normal Normal Normal Normal Normal Normal Reverse Video High Intensity Underline High Intensity High Intensity High Intensity High Intensity

EF

Fa 240 F1 F2
F3

241 242
243

Alt 241 Alt 242 Alt 243

F4 244 F5 F6 F7
F8
245

Alt 244 Alt 245 Alt 246 Alt 247

246 247
248 249

Alt 248 Alt 249

F9

FA 250 FB FC FD 251

Alt 250 Alt 251 Alt 252 Alt 253

Note 6 Note 6 Note 6 Note 6

White White White White

Light Green Light Cyan Light Red Light Magenta Yellow White

252
253

FE FF

254

255

BLANK

Alt 254 Alt 255

Note 6 Note 6

White White

High Intensity High Intensity

7-12 Characters, Keystrokes, and Color

NOTES
1.
2. 3. Asterisk (*) can be typed using two methods: press the PrtSc key or, in the shift mode, press the 8 key. Period (.) can be typed using two methods: press the. key or, in the shift or Num Lock mode, press the Del key. 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. Uppercase alphabetic characters (A-Z) can be typed in two modes: the shift mode or the Caps Lock mode. Lowercase alphabetic characters (a-z) can be typed in two modes: in the normal mode or in Caps Lock and shift mode combined. 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.)

4. 5.

6.

Characters, Keystrokes, and Color 7-13

DECIMAL VALUE

0 1 2 3 4 5 6 7 8 9 10
II

.
1~!~~MtL
HEXA

0 0
BLANK (NULL)

16 1
~

32 2

48 3

64 4

80 5

96 112 6 7

0 1 2 3 4 5 6 7 8 9 A

BLANK (SPACEI

-" + !

~ ......

..

crT

4t

t
!

0
d Q j

B
C

+--

12 13 14 15

L
+--+

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 * , K Z J Z [ k { + , < L "- I


0 @
II

I I

~
1)-

..

... /

M ] m } > N /\ n rv
?

7 -14 Characters, Keystrokes, and Color

DECIMAL VALUE

0 1 2 3 4
5

HEXA DECIMAL VALUE

.
0 2 3 4 5
6

128 144 160 176 192 208 224 240 8


9

~
U

E
cE

e .IE 0, ~ A
--.../

, a , 1 ,

:.:-: .:.:. :.:.: .:.:.

.. .. .. .. ..

E
OC

F
-

f3
- LL
I

6 7 8
9

7 8
9

~ 0 U a 0 n , , a 0 N= I\. a u a ,
0

+ > <

1T -

-1

i==

b L ( ) F (J' . Y -.
,--

" e

(, I

~
I
.......--

-...,

-...,
0

10 11 12 13 14 15

e 0 , e U

I
I

Q 8

-r n
2

='L
f--

n
0
ex:>

c Y2 ==,
~

c
0

" 1 ,
1

:=!

Pt
f'

E
F

A A

--1J d
I]

<P

I
BLANK
'F F'

Characters, Keystrokes, and Color 7-15

Notes:

7 -16 Characters, Keystrokes, and Color

SECTION 8. COMMUNICATIONS

Contents
Communications .............................. 8-3 ........................ 8-6

Establishing a Data Link

Communications 8-1

Notes:

8-2 Communications

Communications
Information-processing equipment used for communication is called data terminal equipment (DTE.) Equipment used to connect the DTE to the communication line is called data communication equipment (DCE.) An adapter connects the data terminal equipment to the data communication line as shown in the following figure:
Data Terminal Equipment Data Communications Equipment Communications Line

Z
Voice Line

EIA/CCITT Adapter

Cable Conforming to EIA or CCITT Standards

The EIA/ CCITT adapter allows the DTE to be connected to the DCE using EIA or CCITT standardized connections. An external modem is shown in the figure; however, other types of DCE also can be connected to the DTE using EIA or CCITT standardized connections. EIA standards are labeled RS-x (recommended standards-x), and CCITT standards are labeled V.x or X.x, where x is the number of the standard. The EIA RS-232 interface standard defines the connector type, pin numbers, line names, and signal levels used to connect data terminal equipment to data communications equipment for the purpose of transmitting and receiving data. Since the RS-232 standard was developed, it has been revised three times. The three revised standards are RS-232A, RS-232B, and the presently used RS-232C. The CCITT V.24 interface standard is equivalent to the RS-232C standard; therefore, the descriptions of the EIA standards also apply to the CCITT standards.
Communications 8-3

The following is an illustration of data terminal equipment connected to an external modem using connections defined by the RS-232C interface standard:
Data Terminal Equipment

Communications Line

--:::::'"""'~--//

"
;,,"

;/

.........

" '"
Telephone Co. Lead Number ....r---""""I

" "
//

Adapter ,,"- Cable Conforming ............ , ' T o RS-232C Standards ................ ~

,',EIA/CCITT line Number Protective Ground Signal Ground Transmitted Data Received Data Request to Send Clear to Send Data Set Ready Data Terminal Equipment Data Terminal Ready

~ ...

" '"

"'"

0-AA/101 C2)--AB/102 -BA/103 --BB/104

--

@-CA/105
C B 1 106

@-CC/107 @--CD/108.2
Modem

Connect Data Set to Line --@--"/108.1 Received Line Signal Detector Speed Select Transmit Signal Element Timing Receive Signal Element Timing Select Standby Ring Indicator Test

CF/109

--0-:- 00/115
@--U/116 @--DE/125

~ DB/114

~"/H'
I
External Modem Cable Connector

\ 0 0 0 0 0 0 0 0 0 0 0 0 OJ

\000000000000
2524 232221 20 19 18 1716 15 14 (Modem) DCE Data Communications--1 Equipment-I

r----

Dat~ Terminal . _ _ _ EqUIpment

. +
Pin Number

131211109

765

'Not used when business machine clocking is used. "Not standardized by EIA (Electronics Industry Association). "'Not standardized by CCITT

8-4 Communications

Establishing a Data Link


The following bar graphs represent normal timing sequences of operation during the establishment of communication for both switched (dial-up) and nonswitched (direct line) networks.
Switched Timing Sequence Data Terminal Ready Data Set Ready Request to Send Clear to Send Transmitted Data
~r---------------------------------

________-'-------------.L---

Nonswitched Timing Sequence Data Terminal Ready Data Terminal Ready Request to Send Clear to Send Transmitted Data

----1

______

s---------------~L---

The following examples show how a link is established on a nonswitched point-to-point line, a nonswitched multipoint line, and a switched point-to-point line.

Communications 8-5

oc I
~

Establishing a Link on a Nonswitched Point-to-Point Line


1.

("')
Q

The terminals at both locations activate the 'data terminal ready' linesaandll Normally the 'data set ready' linesDandllfrom the modems are active whenever the modems are powered on. Terminal A activates the 'request to send' linea, which causes the modem at terminal A to generate a carrier signal. Modem B detects the carrier, and activates the 'received line signal detector' line (sometimes called data carrier detect)m. Modem B also activates the 'receiver signal element timing' line (sometimes called receive clock)lIto send receive clock signals to the terminal. Some modems activate the clock signals whenever the modem is powered on. After a specified delay, modem A activates the 'clear to send' line . ' which indicates to terminal A that the modem is ready to transmit data. Terminal A serializes the data to be transmitted (through the serdes) and transmits the data one bit at a time (synchronized by the transmit clock) onto the 'transmitted data' linellto the modem. The modem modulates the carrier signal with the data and transmits it to the modem B

2.

I. n
~

3.
4.

8 '"

C".

11. Terminal A and modem A now become receivers and wait for a response from terminal B, indicating that all data has reached terminal B. Modem A begins an echo delay (50 to 150 milliseconds) to ensure that all echoes on the line have diminished before it begins receiving. An echo is a reflection of the transmitted signal. If the transmitting modem changed to receive too soon, it could receive a reflection (echo) of the signal it just transmitted. 12. Modem B deactivates the 'received line signal detector' linemand, if necessary, deactivates the receive clock signals on the 'receiver signal element timing, linell. 13. Terminal B now becomes the transmitter to respond to the request from terminal A. To transmit data, terminal B activates the 'request to send' linell, which causes modem B to transmit a carrier to modem A. 14. Modem B begins a delay that is longer than the echo delay at modem A before turning on the 'clear to send' line. The longer delay (called request-to-send to clear-to-send delay) ensures that modem A is ready to receive when terminal B begins transmitting data. After the delay, modem B activates the 'clear to send' lineal to indicate that terminal B can begin transmitting its response. 15. After the echo delay at modem A, modem A senses the carrier from modem B (the carrier was activated in step 13 when terminal B activated the 'request to send' line) and activates the 'received line signal detector' linellto terminal A. 16. Modem A and terminal A are now ready to receive the response from terminal B. Remember, the response was not transmitted until after the request-to-send to clear-to-send delay at modem B (step 14)

5.

6.

7. 8. 9.

II.

Modem B demodulates the data from the carrier signal and sends it to terminal B on the 'received data' linell. Terminal B deserializes the data (through the serdes) using the receive clock signals (on the 'receiver signal element timing' line) IIfrom the modem.

10. After terminal A completes its transmission, it deactivates the 'request to send' linea,which causes the modem to turn off the carrier and deactivate the 'clear to send' linea.

II II

ir======::;-]
Communications

Terminal A

Terminal B

II

II
Modem A
Communications Mod.::m B

rr:======ll II
Communications

Adapte,

II
Data Set Readv Request to Send

II II II II' II II II II II II II II II II II
II

:cI
: ~ I I t I
1

,I
r
0

II Data Terminal Ready

r----i I Power I

Li

II II III
Data Termmal Read

Adapter

0
0

'--_--r --~
,-

Supply

Data Set ReadvO


I

----1
Cartier

L_J

I I

Clear to Send

II

a
'

_L
0 1 I e I : ': Ia I I y I

_~e~e~a~J
,-----, I T~ansmit ~ I CIrcuits L ___ ~J 1
0

II
- - - / ~'
I

-,
5
t

I t:

r------, Rece"e

II II II
Transmitter Signal Etement Timing

L_J
r------,
Modem I
Clock ____
...l

m
I I I I
:

-C.'.'C~I~J
,

Received line Signal DetectmlIll


I

II II II II II II
I

r---i
Modem'

II
Receiver Signal

: II
9 : \

Element Timing m e l
I

II

Transmitted Data

I L

d u I

I Clock '! _~-----'mRecelved I

Dem:-d-:;;';-;-o-;---'

Data

a
t

III
r-----l

!0

if.
L

--------=l---~
Echo
Delay

II II
II

III I II II

I
I

II II II
II

I-~J

II II
Received Line Signal Detector

I Echo ~ I Delay L ____ J

r -=--=--==-' c . -,
I
arrler

Request

II to Sendlll II
[D

1----1
ReceIve

a ~.
QO
-..J

~
I

II II II
II

Ii II II
_ e :::::::::5

i-c.":c~" --'
c-- -"I Modem
I ____ L Clock I
~

' b -----,
L Circuits

I _ _ _ _ I IDI r 1 ~ Generate

II
II

Receiver Signal Element Timing

1
--,
L

------' J
I
I

Ie

Clear to Send I

Transmit I

yl r ___ ~_J
Clock L ____

I I

a I

II
'I
Transmitter Signal Element Timing

II

II II II II II II
II
11

Modem -,

.J

II II II II
II

II II II II
II

:::,
::::::::::

-L-fJ

II II II II II
Received Data

r------

I _ _ _ _ _ _ ......JI Demodulator L-

_ _ _ _ _ _ _ ---'

Modulatm

II
Transmitted Data

II

II

II II II

t..::

::'J

L.'::=====
8 N0I1:J3S

:'J

QC I QC

Establishing a Link on a Nonswitched Multipoint Line


1.

(1

The control station serializes the address for the tributary or secondary station (AA) and sends its address to the modem on the 'transmitted data' linea. Since the 'request to send' line and, therefore, the modem carrier, is active continuously the modem immediately modulates the carrier with the address, and, thus, the address is transmitted to all modems on the line.

6.

a
7. 8.

After a short delay to allow the control station modem to receive the carrier, the tributary modem activates the 'clear to send' line

e.

~.
~.

2.

a,

When station A detects the active 'clear to send' line, it tansmits its response. (For this example, assume that station A has no data to send; therefore, it transmits an EOT

II.)

3.

All tributary modems, including the modem for station A, demodulate the address and send it to their terminals on the 'received data' line

II.

After transmitting the EOT, station A deactivates the 'request to send' line This causes the modem to deactivate the carrier and the 'clear to send' line

II.

a.

9.

4.

Only station A responds to the address; the other stations ignore the address and continue monitoring their 'received data' line. To respond to the poll, station A activates its 'request to send' line which causes the modem to begin transmitting a carrier signal.

II

II

When the modem at the control station (host) detects the absence of the carrier, it deactivates the 'received line signal detector' line

10. Tributary station A is now in receive mode waiting for the next poll or select transmission from the control station.

5.

The control station's modem receives the carrier and activates the 'received line signal detector' lineEiand the 'receiver signal element timing' line.(to send clock signals to the control station). Some modems activate the clock signals as soon as they are powered on.

II II

r;:..======:;-]
Communications

Host

Tributary or Secondary Station A

Terminal

Adaple,

Ij
Host Modem Communications
U
Modem

II II
r-~:e;-i
: On

ir-=-=--=--=-==ll
Communications
Adapter

II
II II II II

II II II II II II II III II: II II II II II II II III II: III

-,
GI
0

" Data Terminal Ready' Data Set Ready'

1----'
L_--, __ .J
I I

Data Terminal

On

Power

,
I

nI

Request to Send'D

1
, 0

I
,

" L _J

Clear to Send1 I

II II

r
I

l' _~~e~":J
~:
I
1

' ----,
Carner

'- - L.::.::::

Ready1

II

Data Set Ready 1

II

-,
o I

r-----,

AA
~:
:

II II II
Transmitter Signal
Element Timing'

'aI IY I _J
L

'-- ---1
,t,
01
,-~J

: Transmit

r--'----,
I L

110
II

AA

Modem I Clock I _ _ _ _ ...J

dI u I , I aI I

M', o ,
r

--1
j

, I

Received line Signal

.
I
_.J

Detector 1

Receiver

r---

1
'I

I I

Modem

Receiver Signal Element Timmgl

; : II II ; : II 9 I II
e I

~:~c.:

_J

II

- -

- - - -...,

Received Data

I Demodulator L _ _ _ _ _ _ _ ..J

Transmitted Data

r - - .- -..,
I Carner

o
i
0

II II II

Request to Send

0" Received Line Signal


Detector Receiver Signal

"I

,------,
I Receiver

L ~e~e~~..J r 0
r - - - - -, : e

II

Clear to Send

a!!

.
l'I
~

~
I

AA

Element Timing'

)~~~~T
Modem I
I _ _ _ _ --.lI Clock L

~ ----I--iLIT':~?~ _lU
1-:

T"nsm;l1e' iLna,
Element Timing

Modem"l

III
II: II: II L

"I

~;

ct.

00

II II

~,~,

II II II II II II
Received Data

~':'-"C':'_J
~_~~~~~_ J
r -----,

r------

-..,

I _ _ _ _ _ _ ---1I Demodulator 1.....

EOT

II II II II II II
II

i--l AA
I
I S I e I,
: d
I

II II II II II II ,II : II III : II : II 'II II

, e , s

Transmitted Data

~f
II

II

\C

L.:::-===

==.:J

'These lines are active continuously

L':::====
B NOll::J]S

=:J

oc
Q

I .....

Establishing a Link on a Switched Point-To-Point Line


1.
Terminal A is in communications mode; therefore, the 'data terminal ready' linellis active. Terminal B is in communication mode waiting for a call from terminal A. When the terminal A operator lifts the telephone handset, the 'switch hook' line from the coupler is activatedll. Modem A detects the 'switch hook' line and activates the 'off hook' linea, which causes the coupler to connect the teleohone set to the line and activate the 'coupler cut-through' line lito the modem. Modem A activates the 'data modem ready' line lito the coupler (the 'data modem ready' line is on continuously in some modems). The terminal A operator sets the exclusion key or talk/data switch to the talk position to connect the handset to the communications line. The operator then dials the terminal B number. When the telephone at terminal B rings, the coupler activates the 'ring indicate' line to modem Modem B indicates that the 'ring indicate' line was activated by activating the 'ring indicator' linemto terminal B. 8. 9. The autoanswer circuits in modem B activate the 'off hook' line to the coupler

S. n
ct.
0
~

~
~

II.

2.
3.

The coupler connects modem B to the communications line through the 'data tip' and 'data ring' linesllland activates the 'coupler cutthrough' lineDto the modem. Modem B then transmits an answer tone to terminal A.

4.

10. The terminal A operator hears the tone and sets the exclusion key or talk/data switch to the data position (or performs an equivalent operation) to connect modem A to the communications line through the 'data tip' and 'data ring' lines

a.

5.

11. The coupler at terminal A deactivates the 'switch hook' lineEl. This causes modem A to activate the 'data set ready' linea indicating to terminal A that the modem is connected to the communications line. The sequence of the remaining steps to establish the data link is the same as the sequence required on a nonswitched point-topoint line. When the terminals have completed their transmission, they both deactivate the 'data terminal ready' line to disconnect the modems from the line.

6.

Bm.

7.

Terminal B activates the 'data terminal ready' line to modem which activates the autoanswer circuits in modem B. (The 'data terminal ready' line might already be active in some terminals.)

BIB,

r;:======::;-] II Communications II
II II II II ~_ II: S II I t III 0 I' III a II I g II Adapter II Modem A
I

Terminal A

Terminal B

CBS
Coupler

CBS
Coupler

II
Modem 8 Switch Hook ISH) Off Hook IOH)
Coupler

r;:======ll
Adapte,

Communications II

r-, IC
I aI I n I t I I
1'1 I 0

r--..,----,

I
L

Carner I Generate I

rCii
II II II II

L~J

Ie I II: Ia I IyI
L_J

----r1 r
M
101

Switch Hook ISH)

II

i~~ ~-A-n~~;,l
I u II Tone I

L____ JI
101

ED

Data Terminal

II II

II II II -, II II II II II II II II III III III II

r-l

Off Hook IOH)1I Couple, D Cut-Through II ICCT)

0
0

:t I
10 1 Ia I

.!ieady Data Set Ready


Received Line

CI

10 1

ie

:d Iu II a It

I
I I

I : I I I I

Cut-Through ICCTI
Data Modem

Data Modem

IewiI I
I, I

In I Is I

Ready IDA)

r-'
IJ

II: III II: III III II II II II

Transmit Data

10: 1'1
L-

II II II II II II II II II II II II II II
Transmit Clock

Data Tip lOT) Data Data Ring lOR)

Ie I II I Ia : YI IS I
L-J

i R:

I RI IeI II I aI IY IS I
L_J

r-l

Ready IDA) Ring Indicate IR)

Uil

l_J

Data Tip IDT)m Data Data Ring lOR)

Signal Detecto, Ie I Ring Indic!lorlll Iml 10 I II Id I II :u II I II Ia I II It I Received Data

r-'

nl :t :
1'1 101

L~J

10

~_J

' I

" II
II II II II II II

S. = a.
/")

(j 0

IE C I :c I : Ih a I 10 ml I __ J L pi r--M-od;mj

r--,

II II II II II

/I
II L_ II II

= '" I .... ....


QC

1 ISI e I , I d I I el S I l .J

L_C.!.o~"--J

iM~de;;'1 Clock _-,-_..JI

II II II II II II II
Receive Clock

r -,
IsL I e I--

I I

II

~======~

t=ff

~ r
~!!I!~
B NOIlJ~S

ir~::: II I d!-- .... II I Ie 1-II

L1J JI

I~

II

II

II

::J

Communications Line

Notes:

8-12 Communications

SECTION 9. IBM PERSONAL COMPUTER COMPATIBILITY

Contents
Hardware Considerations ............................ System Board ................................. 20Mb Fixed Disk Drive .......................... High Capacity Diskette Drive ..................... Adapters ..................................... Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. The IBM Personal Computer AT Does Not Support .... 9-3 9-3 9-4 9-4 9-4 9-4 9-5

Application Guidelines ....................... 9-5 High-Level Language Considerations ............... 9-5 Assembler Language Programming Considerations ... .. 9-6 Multi-tasking Provisions ........................ 9-11 Interfaces ................................. 9-11 Classes ................................... 9-13 Timeouts ................................. 9-15 SYS REQ Key ................................ 9-15 Subsystem Structure ........................ 9-15 Subsystem Startup and Lockout . . . . . . . . . . . . . . .. 9-16 SYS REQ Key Functions ..................... 9-17 SYS Key Interfaces ......................... 9-18 Copy Protection .............................. 9-22 Bypassing BIOS ............................ 9-22 Diskette Drive Differences ................... 9-22 Write Current ............................. 9-23 Machine-Sensitive Code ........................ 9-23

Compatibility 9-1

Notes:

9-2 Compatibility

This section shows the differences between the IBM Personal Computer AT and the rest of the IBM Personal Computer family. It also contains information necessary to design hardware and programs that will be compatible with all IBM Personal Computers.

Hardware Considerations
In order to design compatible hardware or programs, hardware differences between the IBM Personal Computers must be considered. The following are hardware features of the IBM Personal Computer AT that are not supported by the rest of the IBM Personal Computer Family.

System Board
The IBM Personal Computer AT system board uses an Intel 80286 microprocessor which is generally compatible with the Intel 8088 microprocessor used in the rest of the IBM Personal Computers. Programming considerations because of the faster processing capability of the 80286 are discussed later in "Application Guidelines." The system board expansion slots in the IBM Personal Computer AT have a 36-pin connector in addition to the 62-pin connector. Adapters designed to make use of the 36-pin connector are not compatible with the rest of the IBM Personal Computers. On the 110 channel: The system clock signal should only be used for synchronization and not for applications requiring a fixed frequency. The 14.31818 MHz oscillator is not synchronous with the system clock.
I

ALE is activated during DMA cycles.


I

Compatibility 9-3

The I/O write signal is not active during refresh cycles.


I I

Pin B04 supports IRQ 9.

20Mb Fixed Disk Drive


The fixed disk drive used in the IBM Personal Computer AT can store up to 20Mb of data. Reading from and writing to this drive is initiated in the same way as with the Personal Computer XT; however, the IBM Personal Computer AT Fixed Disk and Diskette Drive Adapter may be addressed from different BIOS locations.

High Capacity Diskette Drive


This diskette drive is capable of reading and writing diskettes in 160/180Kb, 320/360Kb, and 1.2Mb mode. However, if a diskette, formatted in either the 160/180Kb or 320/360Kb mode is written on by this diskette drive, that information may only be read by a high capacity diskette drive. Note: Diskettes, designed for use in this drive, in the 1.2Mb mode may not be used in either a 160/ 180Kb or a 320/360Kb diskette drive.

Adapters
The IBM Personal Computer AT 128KB Memory Expansion Option, the IBM Personal Computer AT 512KB Memory Expansion Option, the IBM Personal Computer AT Prototype Adapter, and the IBM Personal Computer AT Fixed Disk and Diskette Drive Adapter use the additional 36 pin system board expansion slot and are not compatible with the rest of the IBM Personal Computer Family.

Keyboard

9-4 Compatibility

The IBM Personal Computer AT Keyboard is an 84-key unit that can perform all functions of the other IBM Personal Computer keyboards, but is not plug-compatible with any of the other keyboards.

The IBM Personal Computer AT Does Not Support


Expansion Unit IBM Asynchronous Communications Adapter IBM 64/256KB Memory Expansion Adapter IBM Printer Adapter Other keyboards

Application Guidelines
The following information should be used to develop application programs for the IBM Personal Computer family.

High-Level Language Considerations


The IBM-supported languages of BASIC, FORTRAN, COBAL, Pascal, and APL are the best choices for writing compatible programs.
If a program uses specific features of the hardware, that program may not be compatible with all IBM Personal Computers. Specifically, the use of assembler language subroutines or hardware-specific commands (In, Out, Peek, Poke, ... ) must follow the assembler language rules (see "Assembler Language . Programnnng ") .

Compatibility 9-5

Any program that requires precise timing information should obtain it through a DOS or language interface; for example, TIME$ in BASIC. If greater precision is required, the assembler techniques in "Assembly Language Programming" are available. The use of programming loops may prevent a program from being compatible with other IBM Personal Computers.

Assembler Language Programming Considerations


The following OP codes work differently on the IBM Personal Computer AT than they do on other IBM Personal Computers.
If the system microprocessor executes a POPF instruction in

either the real or the virtual address mode with CPL~IOPL, then a pending maskable interrupt (the INTR pin active) may be improperly recognized after executing the POPF instruction even if maskable interrupts were disabled before the POPF instruction and the value popped had IF=O. If the interrupt is improperly recognized, the interrupt is still correctly executed. This errata has no effect when interrupts are enabled in either real or virtual address mode. This errata has no effect in the virtual address mode when CPL>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 CF OE E8FB FF JMP$+3 IRET PUSHCS CALL $-2 ;jump around IRET ;POP CS, IP, flags ;push CS ;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

;WAIT code in AH and

9-12 Compatibility

;TYPE code in AL
INT hex 15 JCTIMEOUT

;issue call ;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) OOh->7Fh 80h->OBFh Description serially reusable devices; operating system must serialize access reentrant devices; ES:BX is used to distinguish different calls (multiple I/O calls are allowed simultaneously) wait only calls; there is no complementary "POST" for these waits--these are timeout only. Times are function number dependent.

OCOh->OFFh

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) OOH Timeout yes (6 sec) Description mM Personal Computer AT fixed disk

9-14 Compatibility

OlH

yes (2 sec) no

IBM Personal Computer AT diskette IBM Personal Computer AT keyboard

02H

OFDH

yes (1 sec-write) (625 msec-read)

diskette motor start

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

I Task "Othen" A Task 1 B I Task 28

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 MOVES,AX MOV BX,OFFSET SYSLOCK MOV AX,2000H INT ISH ;offset of lock ;segment of lock

;AH=20H, AL=O

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
code A code B code C

subsysA subsys B subsys C

Entry Points

# subsystems

current subsystem # cur

num

9-18 Compatibility

State/Transition Table
Current State Idle Input SYS REQ SYS code Startup Next State Action Active Active Super Idle activate subsys 'cur' activate subsys 'code' 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' Startup Idle Active set 'cur' to 'num' increment 'num' insert entry point and code SYS code Active Super Completion 'cur' Startup Active Super Idle Active activate subsys 'code' set 'cur' to 'num' 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 MOVES,AX MOV BX,OFFSET entryJoint MOVCX,XXXX MOV AX,2010H ;super shift mode code ;AH=20H, AL= 10 ;address for SYS to call

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 MOVES,AX MOV BX,OFFSET entryJoint ;ES:BX must contain the same ;values as the startup call MOV AX,2011H INT 1SH ;AH=20H, AL= IlH ;address for SYS to call

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 OFF OFE OFD OFC Machine Identification 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.

Prefix micro; 0.000001. Microsecond; 0.000001 second.

(-ts.

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.) Kb. 1024 bytes.
kg. Kilogram; 1000 grams.

= 2 to the

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 INTEL Corporation.210844.001

Introduction to the iAPX 286 INTEL Corporation.21 0308. 001

iAPX 286 Operating Systems Writer's Guide INTEL Corporation. 121960. 001

iAPX 286 Programmer's Reference Manual INTEL Corporation.21 0498.001

iAPX 286 Hardware Reference Manual INTEL Corporation. 21 0760.001

Numeric Processor Extension Data Sheet 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

----------- --- - --------_.Reader's Comment Form Technical Reference

The Personal Computer Hardware Reference Library

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

NO POSTAGE NECESSARY IF MAILED INTHE UNITED STATES

POSTAGE WILL BE PAID BY ADDRESSEE

IBM PERSONAL COMPUTER SALES & SERVICE P.O. BOX 1328-C BOCA RATON, FLORIDA 33432

9J911 PIO.:!

--------- - - --------- - - - - ----_.-

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 IBM Expansion Unit

Displays IBM Monochrome Display IBM Portable Personal Computer Display IBM Color Display

Printers IBM Graphics Printer IBM Personal Computer Color Printer IBM PC Compact Printer

Storage Devices 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 64/256KB Memory Expansion Option 128KB Memory Expansion Option 512KB Memory Expansion Option Monochrome Display and Printer Adapter Color/Graphics Monitor Adapter Printer Adapter 5 1/4" Diskette Drive Adapter Fixed Disk Drive Adapter Fixed Disk and Diskette Adapter Asynchronous Communications Adapter Serial/Parallel Adapter Binary Synchronous Communications Adapter Synchronous Data Link Control (S DLC) Adapter Cluster Adapter Game Control Adapter Prototype Card Prototype Adapter

Yes Yes No No Yes Yes Yes Yes Yes No Yes

Yes Yes No No Yes Yes Yes Yes Yes No Yes

Yes Yes No

No No Yes
Yes

No Yes No No No No Yes No Yes No Yes

No
No Yes Yes Yes No No Yes

Yes Yes No No No Yes No

No Yes

No Yes

No Yes

Yes Yes

No Yes

Yes

Yes

Yes

Yes

Yes

Yes Yes Yes No

Yes Yes Yes No

Yes Yes Yes No

No Yes No Yes

Yes Yes Yes No

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

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

- ---..... ...,-. - -_._-..... --"" --_... - ...,..-_.,....,""-.-

'"""

.....

--,,, -..

. ...

,.....-'

..,.,."

--

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 Certification Requirement 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

Signal Pin 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34

0
I I I I I I I I

0 0 0
I

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 +12 Vdc +12 Vdc return +5 Vdc return +5Vdc Pin 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 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

Non-operating limits

Mechanical dimensions

Weight

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

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

Performance Specifications

6 Double Sided Diskette Drive

Logic Diagrams

,...
o

.... CI)
CI)

.c ~

.~

>

CI)

=:: CI)
..lI::
til

CI)

C
"C
CI)

en
CI)

"0

:il
C

Double Sided Diskette Drive 7

QO

o
l'C)

I
I

l'C)

~ ~ ==o
~
~

I +12V

yI I I I I I
I I I

I \

I I

T
101

ST(]P

01

02

-Kj-

--Kt
AI

11

~~9

51K

J ,1
A10

I
12 11
I

I
I
I

UK
VAl
30K

I
12

~JJOSI
R8 !i,IM C7

e8 ell ,.. 33"


~

g~ 2.2" un
~:-72.2"
R1S

I I
I

Ie.
M51720P

9
16

~
6 5 A6 RJ 4JK

O.15.u

9
le2 M51721l

e6

1~

I
I

O.OOI/JD.47/J

8
5 6

A3 A. .3K

l'C)

lOOK

0 I I
I
I

:I. -< l'C)

n
I
GND

C3 10.056/J A2 33K

0.15/.1

~A?12K

R.3
330~:!

=
~
I
HI -.J

-"---

13

2
1

I
I
I

141

e.

13

O.b~'/J
r.

lc4
0 047 . "(

RIJ
l.li!

un

R18

R14

'"~
330Sl

lJon
RI2
J30n

, '(
I I I

r.

I I I I

I I

I I I

I
bLED

:= .___l__D_~

I I

n
Double Sided Diskette Drive (Sheet 2 of 2)

-_ '""_.

.,---,..... ,-_._ --

-- ,_w,,_ __ --- ---

_.

."'-...

P:orJll!lri/ (ooOm/iliter

..,.,.,,, ... .........

ff cirdu.'~cr{" R (jereml

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 Certification Requirement 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 - 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 Control Interface (P1/J1)

I/O
I I

Signal Pin 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34

0
I I I I I I I I

0 0 0
I

Ground Pin 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33

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.

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

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

Performance Specifications

6 High Capacity Diskette Drive

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

+-----'='--=",ob

MOTOR

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

Modem Connector Or Other RS-232 Data Communications Equipment

Communications Adapter Connector

~~~ ~
COco <:0(2) co
COco

t:5
9

13

25

25-Pin D-Shell Connector

9-Pin D-Shell Connector

8
3
Carrier Detect Received Data Transmitted Data Data Terminal Ready Signal Ground

;--

1..
2

ADAPTER

DCE

25-Pin

2 20

3-

4
5

CunneclDr

Data Set Ready Request To Send Clear To Send Ring Indicator

6_

9- Pin
CD nneclar

_4
5 22

78.

9 ..

NOTE: ALL OTHER PINS ON THE 25-PIN CONNECTOR ARE NOT USED. CONNECTOR SPECIFICATIONS

2 Communications Cable

128KB Memory Expansion

()ption

,':,

"~j',

i ," \' "" ~

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 '3 01 COMPARATOR

IS Q2

16 01;

'"

U02
LSI2"i DRIVER

o (JQ
,
~
2 "' 1
~

IN~~~~~~ ~

Q"i

-.
~

+c;~ab
12 as

'"

p;Q~

-MEM C.SI6 ALS<;7l TRANSPARENT D LATCH 2

(SHT7)

_.

(SHT 7) (SHT 7) (SHT7) (SHT 7) (SHT 7)

+ LAn + LAZ2 +LA21 + LAZO

2 PI

17 P2

FOO
2 01

4 " 1<; PI;

(JQ
QI lq

+ LA 1';1

.-~~~--~pc;
1'3 PO

.~'

+ RAS (SO

(SHT 2)

.....

(SHT 7) -flREFRESI < (SHT7) (SHT 7) +LA!6

P7

+ lAI7

II PB

...
N
QC)
._--

=
~ (">

~~__.___J
AlSOI;

a
lJ1
U 14

.
ALS:!4

__ 2
+"iV

D':i

Q<;

IE>

+ (AS CSO

(SHT 2)

.:!
t'!!'l
"CI
~

8 c
~

o--.~~_._-----.l

Db

Qb

r!L---

~oc
~ E~AalE
(

I
ALS'32

"CI

.... ..
C
~

= C = 0
~.
(SHT 6)

+ BALE

~~~--

..

+ ($

(SHT 3.4)

1 28 KB Memory Expansion Option (Sheet 1 of 8)

"" .....
N
~

(SHT 7) -MEMR
(SHT 7) -MEMIrv'

,
9;:)U"/
~

J
I

TIME DELAY
PE212" UI8 40 80 4 160

IN

J
zoo
8
AODR SEL (SHT 5)

= 3:
~
~
(SHT 1) +CA5 (SO

OCI ~

121

+CAS

~
9
FOB

a
~
6

~
t UI7 11

12

5
;

FlO JUl.

\...J,

II 10n 6
- RAS

RNZ

(SHT 5)

"=' ~
0

"=' e.
0

= fi!l. = 0 =

(SHT 11 +RAS CSO

I, FlO
ALS04

(SHT 71

+BAO

5
UIO

IJ UI U
I, FlO

12

9 10Q 8
RNZ -CAS OL (SHT 51

ALS04
(SHT 71 - SBHE

9
UIO

~U1B ../

12

14

'3on
RN2

'3

-CAS OH

(SHT 5)

+ SBHE
-BAD

(SHT 4) (SHT 4)

128 KB Memory Expansion Option (Sheet 2 of 8)

CD .... 0
8

CO)
0

..
Q) Q)

!!!.
c:
0

.r::

:;:::
Q,

l!'

~ ~~

~
..,

:.i <;t

; !Ii

Si

~ I~ I.,

0 c: 0 "; c:

>< w

IV Q,

. ~~~
~

E
Q)

~ 0

~ &D
~

,..
~
I

CO

"
"

~
~

00

" ~

l'
iO

+
I

" "

00

128KB Memory Expansion Option 5

a <

". ; o.
~

::

~ ~

" , -

< . ~I

~,~ I~ I~

<

:;::

c o
C

Q.

"; c
W
Q. >C

o
as

o
CD

:&
~
!!:

i
~!2 ~

~~
!!:

ID

...

co ('II

~ H~
t.:
ii;"

m ;;;;;;

~ ~~~~

6 128KB Memory Expansion Option

(SHT 5) +HDP OUT 0

~U"~
,
"

~U<I

F2eD ~"cu
PARITY CHECK

8 A (SHT 3) (SHT 3) (SHT3) (SHT 3) (SHT 3) (SHT 3) (SHT 3] (SHT 3)

8
C U7

EVEN

+ MDf'

IN 0

(SHT 5)

+1'02

"

+MC,

12 E

+ MD4

" c
,

+ MDS
+MDb
+HD7

2 H

"

(SHT 5)+ MOP OUT I

,;iu,,~

I~ FOB

F260
""'ITYCHECK

(SHT 3) + MOB (SHT 3) + MQ9

,
"

8 A 8 C EVEN

+ M:lP

IN I

(SHT 5)

...
N

(SHT 3)

+ MOIO
+ MOil

"

(SHT3) + MOil (SHT 3) (SHT 3)

"'

"
" ,

E
F G

~ 3:
9
~
~

OC

+ HOI,
+ MOIS

(SHT 3) + MOl'; (SHT 3)

2 H

"

(SHT 2)

-BAO

g
~

=
i!l.

(SHT 7)-BtMR (SHT 1)

>CS

~
II UIC 10

I
1

(SHT 2) +SBtE

~~~
I, 12 U2 II F7'; 10 - }U2 B 120 I'fl II
Q 9

U2

(L~(lLR ~

(S"T 7) (SHT3)

-BMEM -(S

-= a.

= = 0 = = ......

'I,

~
U4

"

.;,

I, UI'!

82

LSSl U2

~LSIZ')

-I/O (1-1 CK (SHT 8)

10

VI'!

'! Ulq

,,_

U2

(SHT 8) +RESET

1 28 KB Memory Expansion Option (Sheet 5 of 8)

co .... o

..
CD
II) II)

~
----~-----~

c:

o
III

c:

c:

1l.

ca Q. ><

o E II)
~

::E m

...
('II

co

8 128KB Memory Expansion Option

CARD TABS

AD9 (SHT 4) -110 CH CK ADI AD8 AD7 AD6 AD.,

+500
+501
'SOZ

(SHT3) (SHT3) (SHT3) (SHT3) (SHT3) (SHT3) ISHT3) (SHT3) (SHT7) (SHTS) ISHTS) (SHTS) ISHTS) (SHT S) (SHTS) (SHTS) (SHTS) (SHTS) (SHTS) (SHTS) (SHT S) (SHTS) (SHTS) (SHT5) (SHTS)

+503

,.,.

+504
+SD'>

AD,

+50&

ADZ
A,J A,O AZ' AZ8 AZ7

+507
+ SAO +SAI +SAZ

+SA1
+ SA. + SA'> +SA6 +SA7

AZb
~

N
QC

AZ'> AZ. AZ,

i:

+SAB

AZZ
AZI AZO AI.

+SM
+SAIO +SAII + SAIZ

f
8 o "CI
8
~

f
IC

..,

AI8

+ SAl,
+SAI't

92. ~

AI1 Alb AI'>

+ SAl")
+SAlb

f!
810

AI" A"

+ SAI7
+ SAI8

9"

9Z8
819

+ BALE (SHT 1) -REFRESH (SHT?) +RESET DRV (SHT 4)

80Z

128 KB Memory Expansion Option (Sheet 7 of 8)

U':I..,.

co:. C".I ~ C<lI lEI cD lEI CICI <1:1 C l C I C l C I = 0=. (1')(1')0':1(1')_""

iii' o co
.r:.

iCD
o o
><
C

!!
c
:;::

o
;;;;
~

Q.

~
:
~

'iii c
N

Q.

10

~ ~ ~

:~

u;> ;:;

:
;z: ~

Jl!HJ

JJJlt JJ

o E
:!:
In
CD

::.:::

...
N

co

10 128KB Memory Expansion Option

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

:g
~

~ o
I/O Read/Write --+Command and Address Buffer Address Bit 0
L '_ _ _ _

Bit 0-7 Oata Bus

>1 Data Bus


8

!.,

Bus Direction ' B u s Transceiver

Bullered Data Bus Bits 0-7

..... ~

Spare ----i Address Bit 0 ~ Address Bit 2 ..f...----

Address Bit 3 Address Bit 9 -I--Address Enable - -

--tlAddress Buffer

r7

I/O Address Decode Logic

H
I/O Decode (Hex 300-31F Inclusive)

Data Bus

Low Bus Enable High Bus Enable

L------,HH Enable Logic

Spare-Memory Read/Write ~

Buller

System High Byte Enable

Bus Direction

Bus Transceiver

Bit 8-15 Data Bus

:~ Data Bus

Buffered Data Bus Bits 8-15

+s
~

t Jumper JI

lOKn +8 Bit/-16 Bit Data Bus

Prototype Adapter Block Diagram

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 Your code lOR Your code NEXT:

After
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 100 ns 850 ns

16-Bit Device 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

+ 1/0 Cycle
(Sheet 2 01 11)

I~ I 1
4
en

Time Delay (Iote) PE21214

Time Delay (Note) PE21214


..L

10

rt..

Time Delay (Note) PE21214

10

=
~

i;'

en

... ...

...
c::> c::>

en

=
3

... ...

c::>

... ...
c::>

en z

... ...

;i\
:

Jumper 14ALS244 UB 5

:i
/I)

S"

S
14 S14 '----"-3---11' ClK Q5 '--_ _ _ _ _ _ _ _ _ _---=.1=0 Reset 4 Set 15

+ 1/0 Channel Ready


Tab Pin AID (Sheet 4 01 11)

f .
/I)

+5V "

til

Wait-State Generator Circuit

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 416 nanoseconds--Jumper 1 to 5 583 nanoseconds--Jumper 2 to 5 750 nanoseconds--Jumper 3 to 5 916 nanoseconds--Jumper 4 to 5

2 wait states 3 wait states 4 wait states 5 wait states

8-Bit Design
4 wait states

750 nanoseconds--No Jumper 916 nanoseconds--Jumper 4 to 5

5 wait states

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

s02i
<D

Du

::0 '"

sl

::0

SOCS
ro

::0

r--

sD~
::0

08
5

0">

::0

00

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')

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 J1

TTL # 74500 74510 74L5245 745139 745138 74AL5244

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 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) Part no. (Amp) or equivalent 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) (AS) + DATA BIT !

~
~

,.,.""mo~.A ., A (A7) +OATA BIT 2 '+


(Ab) + DATA BIT., (A'5) + DATA BIT '+
(A4) + DATA sn '} (Al) + DATA BITt. (AZ) + DATA BIT 7

B 16 B 17 B
,~

I.

A~A

A U, 6 A
C; 1 A

"
14

(SHT 3)

(SHT 3) (SHT 3)

8 A
9 A

12

BUFFERED DATA BUS BITS 0-7

(H[XnOQ (HEX)'3IF

I/O DECODE FOR PROTOTYPE: CARD A7AbA 4 A, A Al 1 100000000


I I 0 0

DrCOOE" RANGE.

o (J'O
n
~ (J'O

"

>

-. o -.

I'
7'tAlS244
~~
~~
~~~

ENABLE LOW Bm

~
~b 71+500

+ 1/0 CYCLE
:-BJOR

(SHT 21 (SHT 2)

..,
~

"'I

~~~

(SHT3)
~~ ~~

) (A,I) +ADOR. BIT 0 ) (A,O) + ADOR. BIT I ) (A29) + ADDR. BIT 2 )

(BI1) -lOW (BIZ) -SMEMR (BII) -SMEHW (BI4) -IOO (SPARE)

~~~~~~~~l'il
11
4 8

:3 7JJ.

(SHT 3)

(SHT 3)

~~~i ~l ~~~; + ::gg:-.~i ~to ~ >------(A2'5) ADOR. BIT (A24)+ADDR.BIT7


II

(A28) +AOOR. BIT '3 )

(SHT3)

(SHT3)

i~~i~: ~:~~;:=:~~:
(AII)+A[N

:~
1

~=====~' AI ",Ir ~ft---==::j=='--~ti A~b ~


j

245"8

L _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _-- + 8 BIT 1/0 JEVICE (SHT 2)

A2

.,

II

ENl

l -110 DECOOE (SHT 21 "00 HE1<-l1F <EX INCLUSIVE)

'5 EW2

4Elfi

'"
20 +'5V6 '(1+ 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)

(SHT 4) (SHT 4) (SHT4) (SHT 4) (SHT 4) (SHT 4) (SHT 4) (SHT 4) (SHT 1)

[( II) [(12) [em [eI4) [e IS) Ib) [(17) [(18)

+DATA BIT 8 .DATA BIT 9 + DATA BIT 10 >---.DATA BIT II +DATA BIT 12 +DATA BIT" DATA BIT 14 +DATA BIT 10; )

7r-8 6 S AU9 A A A A

74LS24S

11

B'j2 8 B~ B

B~

~ A ~ ~

B~ ~'i8

J..f.---.--

f BUFFERED
OAT A BUS
BITS B-[I)

-BIOR

[~ ~IR
+sv
2D

t;

f-iID

(8..".

- ENABLE HIGH BYTE


(SHT 1)

+ liD CYCLE

"
74SI,Q

(SHT 1) B BIT I/O DEVICE )

B BIT

YYICE?fAo
~AI
1,.J U4

74ALS244

EN

ISHT 4) [SHE. 0;) (SHT 4)

(e I)

- SSHE (e9) SPARE (C[O) - MEMW SPARE IIG"

U8

1'4 18 12

~
___________________ L
(SHT 1)

-+_________

f
... .... VI

74ALS244 ---"+8_B'>!IClT-'D;<Ec'C"-'le""'E_ _--~I~'R7 v uB -110 DECODE 19 G

, -l/oes 16(002)

(SHT4)

-liD DECOO

Prototype Adapter (Sheet 2 of 4)

="

...

(SHT 1) (SHT 1)

:p = ....
~

= ....
~

GROUND +RESET DRV +';VDC +IRQ q -';VDC

BI B2 B3

B4
B<;

AI A2 A3 A4 A<; Ao A7 A8 A9 AIO All

.@i
~

C.

>

+DRQ Z -IZVDC + 0 WAIT STATE +IZ VDC (SHT 1) GROUND (SHT 1) -SHE'" W -SMEHR -lOW (SHT 1) -lOR

....

...

80 B7 88 B9 BIO BII BIZ

- [10 CHANNEL CHECK +DATA BIT 7 +DATA BIT 0 +DATA BIT <; +DATA BIT 4 +DATA BIT 3 +DATA Bn 2 +DATA BIT I +DATA BIT 0 +1/0 CHANNEL READY +AEN +ADDRESS BIT Iq + ADDRESS BIT IB + ADDRESS BIT 17 + ADDRESS BIT 10 + ADDRESS BrT l'i + ADDRESS + ADDRESS +ADDRESS + ADDRESS + ADDRESS BIT BIT BrT BIT BIT 14 13 IZ II 10

(SHT 1)

(SHT 1) (SHT 1)

al>
BI4 BI<; Blo BI7 BIB BI9 120 121 IZ2
B2~

Al2 611
AI4
AI~

-DACK 3 +DRQ 3 - DACK I -DRQ I -REFRESH ClK +IRQ 7 +IRQ 0 +IRQ '; +IRQ 4 +IRQ 3 -DACK Z +T/( +BAlE (SHT 1) (SHT1) +<;V DC OSC GROUND

Alo AI7

AI8
AI'! 1020 1021 1022

AZ1
1024
A2~

+ ADDRE SS BIT + ADDRESS BIT +ADDRESS BIT + ADDRESS BIT + ADDRESS BIT + A~DRESS BIT + ADDRESS Bn + ADDRESS BIT + ADDRESS BIT + ADDRESS BIT

q
B 0 <; 4

(SHT1)

124
12~

120 127

A20 1027 1028

928
IZ9

3
I

no
_I~,--

iAZ9
A~O

~_'_-

(SHT 1)

P[N SIDE

COHPONENT SlOE

Prototype Adapter (Sheet 3 of 4)

,6 PIN TAB CONNECTOR - (SHT 2) -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 DI D2 D, D4 DI) D6 D7 DB D9 DID DII DI2 DI"3 014 OIl) 16 017 OIB CI C2
("3

cia
CII CI2 CI"3 CI4 (II) , Clf> CI7 CI8

C4 CI) C6 C7 CB C9

+ + + + + + + + + + + + + + +

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,
22 21 20 19 18 17

(SHT2)

(SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT 2)

i
~

PIN SIDE

COMPONENT SIDE

..
.......

Prototype Adapter (Sheet 4 of 4)

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

Switch Bank 1

4th 512KB Memory Expansion Adapter

~~~~~~~~~~ ~~~~~~~~
~~~~~~~~~~ ~~~~~~~~
12345678 12345678

12345678

1 234 5 6 7 8

5th 512KB Memory Expansion Adapter

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

{SHT7

SWI
SWii!

7:~:
1

S2<NQ!@

lu>
Ii':!

OJ2 NOT@ LSb8Z QICOHPARATOR


I 02

rQ
\IQ
~

5Wl"

en
I
QIf

sw'+
ISHT?

U6Z

______.... ,w.+_--'t;_.// SWto b


SW7./
(SHTT (SHT7)
(SHT7) [SHT7)

: Q7

p-:Q~
~

---11---------.=..: '-.==.=--+--+-~ PI

I' Q8

11"b>~1i..VE=-'----1r---------------------2 uL
t

- HEM CSlb (SHT 7)

~
\IQ ""1
~
~

_. _.

TRAONS~flHNT
2: FlO

AL.So;H

--..jh------------+---+-""'! P2 ..

(SHTT)
{SHTT)

jtljl::;:=========t=:t~ ::::
.-+------'

~ T ,.1 T

P,

P7'

1;---t-I~!O

-RH' ~,J:
I

~~ ,::,\!bL-__<401
~
UII'
1
If 02

QI

I~

+RAS

eso

(SHT 2)

G
12

Q2\-l117~------111.:;.._ _ _ _ _ _ __ alrYilt

+AAS CS I

(SHT 2)

:3 rIJ,

RIC~Kn
'5

P8

~~~ 0
'All

14 Fll9

ii"81

!12~

UI
N

""'"

SW9

S"O~~ ,~
I"
I

-;:--". ~

SI(NOTEl)
!III;;

IR QI

'O"'A TO'
UitO I,,,

I"'''''

~9;JUI;
,......tJ.!..0

'\A

to
0,

+AAS CSZ

(SHT 2)

--4:F1ZZ 9

"G'
If

l
r-

...

.,

SWII I SW12

...

Ql
QIf

ij-SI2'i L~UI;)II ~~~. '5 Ul ~LSOLt


11 UIC 12

10'+
'5 0')

QI+

1'+

+RAS

en
eso

(SHT 2)

sw" 1.1
SlOb

SWIIf
$WI')

t8
81

__ ------'.L

'" "'~~ +'5~ alb


Tn ----;;

Q'5;i-!'!!!..--......- - - - -

+CAS

(SHT 2)

Jr.ii I>" IALSOIf

07

., UIC

If

Db

Q6~1"-.-__.__+-----

+ (AS (5J. (SHT 2)

_ _ _ ..J

2 QS

L-~~-+~4_--------_+~1 :~
LJ-+++---------t-Il1 P,
L _ _ _ _ _ _ _ _.....

Ll-l~--I-__l_--------_l--,,''11'1

~~
~
ENABLE C

f.

"C:I Q;

1':1:
P7
~P.

VI
(SHT81

~'~ -----.iJUIfr-

+CS

(SHT 3,4)

51 2 KB Memory Expansion Option (Sheet 1 of 8)

" ~
~

"

" "
a

" " ~ ~

'"
~

<I

" ...
~

iD
~

iD
~

.,
~

"
~

"
~

i
,

~
N

iD

~
~

J
+

co o
N

.... CD
CD

.c:

'"
!!:_'"
!!:

'"
N

.
~~
...

i o
c

~~~S~5~S
Q=,,"

o ";
C lIS
Q.

><

E
B
llF-~-t--~

~
CD

:t
IX!

~3,!~

:.:::

N ,..

an

fl 5

""
;0 ;0

;0
~

;0
~

"

"

"

'<

"

"

'<

~ ~

"

6 SI2KB Memory Expansion Option

I W

..
OJ o
C')
~

CII CII

.. o
I:

.2
Q.

o
1I'

I:

~ ~~

~ ~

~~

00

: ;r;

~ ~ ~ I~

,'"

I: It! Q.

IIJ

><

CII

o E

:::?i
~

III

C'oI ,...
It)

""" "" ~ '" "


I W I I I W

00
I W

;0
I W

"""""" "
I I W I

I W

I W

I W

I W

"

I W

512KB Memory Expansion Option 7

co ...
o v
~

.s::.

CD CD

~~-----t~_-t __

3-

~~ ~ ~' ~
g.

o
C

o ...

Q.

o
III

m
)(

Q.

UJ

o E
CD

:::E
a:J
~

~:;

3
-

C"I .,...

10

"
~

c c " " " """ ~ " " "


r r r
I
~

" " " "" "


M
~

i'i

"

"

"

"

"

"

""
r
I

"

"
r

8 512KB Memory Expansion Option

I~ : ~ ; :: : :1 ~1~:;:::::li
~
~

~ ~;

" g

75 ~ _~~---'--, ~-~-----L.-,
<

<

0"

"

000
It)

..... Q)
Q)

.r::

!e
I: 0

:0::

Q.

0
I:

0
III

I:
Q.

IV

~-------~
,--L -_ _ _ _ _ _~~

W
0

><

E
Q)

~nn

nn
F I I I

ca

~
~

...
N

It)

512KB Memory Expansion Option 9

VI

o
N

(5tH 3) +1'100
ISHT 3) +1'101 ISHT 3) +1102
(SHT3) +1'10'3 ISHT 3) +1'104

"
U'; U,"

ISHT 3) +1'10'5 (SHT 3) +1'106

f ~
g" o -= .... S"
~

ISHT3) +M07
(SHT 3) +1'108 (SHT 3) +HDQ (SHT 3) +11010

(SHT 3) +1'1011 (SHT 3) +,",01 Z


(SHT31+MOI~

g
=

(5HT3)+11014

(SHT 31 +HDI'> (SHT 5)-8HAO


(SHT 5) -8HA I

l~lLLL~
('I) IZ8KX)
1M!,}p 00.1 I

(SHT 5) -BHA2

(SHT51-BHAl
(SHT 5) -8HAli

(SHT 5) -aHA"
(SHT 51-811A6
(SHT5)-BMA7

(SHT 2)
(5HT2) (5HT2) (SHT2)

-US 'I

-(AS IL

------~
------~
------~

l~.,
l~,

" I I IU"1uz;
"
l
2

(SHT 71

-BBP'E"'W'

r~,
-RAS 1
ilBH[HW
-Il.l1<;

21~

(SHT 4) +1'101' IN 0

RAn

ISHT 4) +HDP IN I
(SHT 5) +MDP OUT 0 ------~

wr

4~

(SHT 5) +MOPOI!T I

-------<

-(A5IH

:c;~

m
14

Hnl

i,14 DIN/DOUT

1...1'1'"
Hon _

DI~/DOUT

__,1'1 DIN/DOUT

1'1010

IHOP

n.

.LIOINI DOUT

'"

512 KB Memory Expansion Option (Sheet 6 of 8)

~ '" < i i" " "


~~ ~~

co
~

o ,...

..
Q) Q)

&:.

!!!
:;:

o
Q.

t:

'iii

o
ca
>(

t: t:

Q.

1l

W ~

E Q) :IE
!XI
~

.,....
It)

('II

512KB Memory Expansion Option 11

....
~

CARD

TABS

til ....
~

A09
(SHT 4) -I/O CH (I<

AOI

+5DO
+501

(SHT 3) (SHT3) (SHT3) (SHT3) (SHT 3) (SHT3) (SHT3) (SHT3) (SHT7) (SHT 5) (SHT 5) (SHT 5) (SHT 5) (SHT5) (SHT5) (SHT5) (SHT 5) (SHT 5) (SHT 5) (SHT5) (SHT5)
(SHT 5)

::

~
~

.oS A07 A06 ADS

+502
+50'3
+$04 +$0')

f
g o "'CI
g
~ B29
~.

..,.

A03 .02 A31 A30 A29 A2S A27 A26 A2S A2" A23 A22 A21 A20 AI9 AlB AI7 AI6

+SDb
+507
+SAQ +SAI +SA2

+SA'3
+ SA" +SAS +SA6 +SA7

eo

+SA8
+SAq

+ SAID
+SAII

+ SAI2
+ SAl,

+S

AIS

+ SAl... + SAP:; + SAlt) + SAI7 + SAI8

(SHT 5)
(SHT 5)

(SHT 5)

f!
BID B31

AI" AI3

828 819 B02

+ BALE (SHT 1)
-REFRESH
(SHT7)
+RESET DRY (SHT 4)

512 KB Memory Expansion Option (Sheet 8 of 8)

----

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

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 Bus

Address Decode

Chip Select Register Select

. ..

...

Controller Asynchronous Communications Chip

Data Bus Interrupt

I Oscillator i 1.8432 MHz


EIA Receivers

...

r----.

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

Pin 40-+5 Vdc supply 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 I

Interrupt Enable Register


Bit

Ihex XF9)

7 6 5 4 3 2 1 0

11ll::> ,-.,,""" '"."." ,~"'"


> >
Enable Tx Holding Register Empty Interrupt

> ' - - - - - > =0


=0 =0 ' - - - - - - - > =0
'-------->
'--------~>

Enable Receive Line Status Interrupt Enable Modem Status Interrupt

Interrupt Enable Register

Bit 0 Bit 1 Bit 2 Bit 3 Bits 4-7

When set to logical 1, enables the received-data-available interrupt. When set to logical 1, enables the transmitter-holding-register-empty interrupt. When set to logical 1, enables the receiver-line-status interrupt. When set to logical 1, enables the modem-status interrupt. These four bits are always logical

o.

8 Serial/Parallel Adapter

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

~> ""~'""'."'.
> > > > > > >
Interrupt ID Bit 0 =0 =0 =0 =0 =0 Interrupt ID Bit 1

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. These two bits identify the pending interrupt that has the highest priority interrupt pending, as shown in the following figure. These five bits are always logical O.

Bits 1-2

Bits 3-7

Serial/ParaDel Adapter 9

Interrupt ID Register Bit

Interrupt Set And Reset Functions

2
0 1

Bit 1
0
1

Bit 0
0 0

Priority Level
-

Interrupt Type None Receiver Line Status

Interrupt Source None Overrun Error or Parity Error or Framing Error or Break Interrupt Receiver Data Available Transmitter Holding Register Empty Clear to Send or Data Set Ready or Ring Indicator or Received Line Signal Detect

Interrupt Reset Control

Reading the Line Status Register

Highest

Second

Received Data Available Transmitter Holding Register Empty Modem Status

Reading the Receiver Buffer Register Reading the II R (if source of interrupt) or writing into the THR Reading the Modem Status Register

Third

Fourth

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~ ,.~,,,.,,"," >
> > > > > >
Parity Enable Even Parity Select Stuck Panty Set Break Divisor Latch Access Bit

Word Length Select Bit 1 Number of Stop Bits

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

Word Length (Bits)

0 0 1 1

0 1 0 1

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

Bit 4

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

Bit 6

Bit 7

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).
Modem Control Register Ihex XFCI
Bit
7 6 543210

> ~> "'"',,";~"~ > > > Loop > =0 > =0 > =0
Request to Send Out 1 Out 2

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

Bit 1

Bit 2

Bit 3

Bit 4

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

Bit 1

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

Bit 4

Bit 5

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

Bit 6

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

~> """'~,~",'
> > > > > > >
Clear to Send Data Set Ready Ring Indicator

Delta Data Set Ready Trailing Edge Ring Indicator Delta Data Carrier Detect

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

Bit 2

Bit 3

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

Bit 5

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

Bit 7

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.

Carrier Detect

Receive Data Transmit Data Data Terminal Ready Signal Ground Data Set Ready

2_
3
4
5

...
Serial Parallel Adapter

External Device

6_
7

Request To Send Clear To Send Ring Indicator

B_
9'"

L-

18 Serial/Parallel Adapter

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

[]] []]

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

.. -

Address Decode

.
..

Buffer Control Signals

..

Interrupt

Data Bus

Data Output Buffer

r-Z5-Pin 0 Connector

Data Wrap Buffer

--"'

Control Output 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 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

Not used Not used Not used + IRQ Enable-A 1 in this position al10ws an interrupt to occur when' -ACK' changes from true to false. +SLCT IN-A 1 in this bit position selects the printer. -INIT-A 0 starts the printer (50-microsecond pulse, minimum). +AUTO FD XT-A 1 causes the printer to line-feed after a line is printed. +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. -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. + PE-A 1 means the printer has detected the end of paper.

Bit 6

Bit 5

Serial/Parallel Adapter 21

Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

+SLCT-A 1 means the printer is selected. -Error-A 0 means the printer has encountered an error condition. Unused. Unused. 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.

o
o

0 0
0

14

- Strobe Data Bit 0 Data Bit 1 Data Bit 2 Data Bit 3 Data Bit 4 Data Bit 5 Data Bit 6 Externa I Device Data Bit 7 -ACK BUSY PE SLCT - AUTO fEED XT - ERROR -INIT - SLCT IN 1 2 3 4 5 6 7 8
9

r-

10 11 12 13 14 15 16

Serial Parallel Ad.pter

17
18-25

Ground

'----

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

Parallel Control
Sink current Source current High level output voltage Low level output voltaqe 24 rnA -15 rnA 2.0 Vdc 0.5 Vdc Max Max Min Max

Parallel Processor Interface (except IRQ)

The following are the specifications for the serial interface.


Function On Condition

Spacing condition (binary 0, positive voltage). Marking condition (binary 1, negative voltage).
Function Invalid On Invalid Off Invalid

Off

Voltage above +15 Vdc +3 Vdc to +15 Vdc -3 Vdc to +3 Vdc -3 Vdc to -15 Vdc Below -15 Vdc

Serial Port Functions

24 Serial/Parallel Adapter

Logic Diagrams
~~n
r:I::r
~~~

nN
II
r.l)U)

~
I
~

''" "
I
~

C;; I

'" '"
~

~,,~

,
~
~

~~'" 2;g~~

t:~

I~ ~

I~ ~

I I

:5! -"

! I

!I !::~~;!.!.'::t:::.eg;~~ ,~o~
:

~l

JJJ ~~~I

..... 11'1-

""~-<>N

-"

,"~NIJr~
-

~I:

8 - 2:: ;!

;g lli~~~J~I'
Ci I
~

"

:~J

~~ ~~
f-'v~

~,

f--f~
f-<e~

f-S~
f-'0~ f-'~~
~

,
~

';:
Q.

... Q)

s:.

....
Q) Q)

...

c. (11
Q)

'C

<C
C

::::::
';:
(11

en

Q)

~ ~
~

,.
_J
=

f-'v~

"

"

"
>-----

N~ R<~

8~

0!

~::r~

~~~~~

I~~~

~~~~~

.
"

g~Ii\I~

III
;;

I~
;;;

~
~

,_~
+ + +
g~'

Q~~~~~~~
:I5~ril

~
~

~~~

g~~~1

w~

:J
~o;

~I~I~I

gl
OJ
I

Serial/Parallel Adapter 25

N
Q\

'LSI,)'>

00

ISHT 1) ISHT 1)
(SHT 1)

ENABLEFAAALLEll&:~
n
"3
I

~~ 2C ~~~~N/c
2G

e:. ......... ;p ... = !E.


~

:3.

AD

ISHT 1) ISHT 11

AI
BICR

2n~NIt
UI2

:~~

6RPB
'iRP(

L1...:~~N/C
0, (13 -(20 (QX},0022 uF

Ie

IY2

!....
~

>

~
JlSO

(8X) 2111

u"

"

'19 ' "

CI7 ' "

...

BDtft 20 ~~ 70 ~SD ~~ bD
I~
~

~~

10

SQ"
IQ

ZQ 16
7Q

~~ ~g

,.12 bQ (')

r-

~~ ~

, , " ,
I. 1
10

I 2 4

" "
12

" +0,"'I1' ' wlJ~:::4:: I - "


C20

2') PIN 'D'SHELl CONNECTOR

P2

>--#.~

, ,
Z 4 b 1 S

DATA 0

DATA I
DATA 2 DATA :I DATA ..

17 ZA4 2 IA I

~ 2'1'4
2'1'1 2'1'2

':I

I'l'l 19

b lA, 1'5 2A,


II 2AI 13 2A2

In 14 2'(; ')
q 7

, " ,
~-

DATA ') DATA b


DATA 7

'+ lA2

1'1'2 Ie
1'1'4 12

BE

eLK
UI6 -RNI 4.7KIl---..

."

tIt ~
-ERROR -AUTO FO Xl

8 IA4

SOO SOl 802 S" S04 S" Db S01

Uq

ISHT ISHT ISHT ISHT (SHT ISHT (SHT ISHT

1) 1) 1) 1) 11 1) 1) 1)

SDO BOI BOZ

'" ,,,
BD4 SD6 807
RESET

BOO BD I BDZ BO' BD4 B" BOb 801

'7777;

'":;:!;fu 20
Ir---------'!

~ 60
BO'i1 40 CLK

BOO

~
ID

IQ 2 6Q I

~"
nUll 12
OC; II UII

nil

"

12

L
/)

,
~SI2<; UI

~ - sTROBE

to

l
I

~i~

2Q'i

~O4
1'1 UI,)

12

'i~ V

" ~
Ib

-[NIT -SlCT IN +SLCT + BUSY

II Ulb

~4

10

~2G

V
q

(SHT 1)

U4 I '.~~ l;---------1~C qU11

'5Qpt--

r--lle---,-,-~

~04 8
Ulb

l:---t ::~ ~~~ ~ L-~ ~~~ :~~ ott-Ir----H-~:~ :~i:~


~~

6 IAl

2'1'44-

2Y2~

.PE

Y---;o-+ IRQ EN

-ACK

'~Jt""
L504
IUlb 2

~"

~
q UI

10
6

~~O\
(SHT 1) (SHT (SHT (SHT (SHT
1) 1)

- IRQ EN
.5

C;<SIZ')

PARA 8
IRQ')

t}

IRQ7

2 ,

'~
1 b

'"

R P,

["'I'N'-O ~ ~ K

12 UI

1}

SAS

~
Serial/Printer Adapter (Sheet 2 of 3)

~
II LSIZ'5

(SHT 1)

A8

'I
, 1

0:;;==1'

(SHT 1) (SHT 1)

BAS

_S_ER_A~._ _ _ _ _ _ _ _~

(SHT 1) (SHT

RESET
BOO

O~IO==~-----t-~ "1;I
NS lI:oLf'>O
1:0

====-======t=====
U2
+'iV

I~(SHT11

IRQ...

(SHT 1)

_,I

0uTZ "

1'1R

INTRPT

~IN

'~

tJ

(SHT II (SHTl) (SHT 1J (SHT 1) (SHT1) (SHT1)

fiOI'\ ~
BOLf

./C
N/e

LS)2'i

!QL ~

BO'> ISHT11 !Q2.... .07

>ZZ 1117777777

7IZ?? l I Z I I I I I I I II:

N/e

+'iV~ 10
(SHT 11
(SHT1)

EIA RTS 17

(SHT1)

ISHTIl (SHT 1)

~,==~~g~~~~~""fTR "
"l1l\I""'--A2

BIOR

.j

SIGGNO,,)

AO'---

Ii 21 I

lliim
AO AI

Soor lll

EtA TX OATA '1

+;V

if [

:; (51

U'
(SHT 1)

-ENABLE SER 1/0

,,(SO

+'iV~
N/e

e52

"

N/e

'L:"Uil J

./e

XTAl2

i..

I
N ....J

"-

.,
7';00

"

XTAl I

"

'-~l,J

RECEIVE OATA

Serial/Printer Adapter (Sheet 3 of 3)

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 - Drive selected +MFM write data -MFM write data +MFM read data -MFM read data Ground

Signal Pin 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 +12 Vdc +12 Vdc return +5Vdc +5 Vdc return Pin 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. 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.

Buffered Seek

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

+ 5 or restored.

+ 12 V dc fluctuates or is lost momentarily but

If the drive attempts to retry a seek after settling on a track.

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

20Mb 512

17
5M bits/second 2 ms

40 ms 85 ms
12 ms 8.4 ms 750 TPI

Performance Specifications

820MB Fixed Disk Drive

Logic Diagrams

20MB Fixed Disk Drive 9

=.. I.

;:~:I~!I
1

"11 Iii
: . , [I

,-------_ _-----.J

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 Data register Error register Sector count Sector number Cylinder low Cylinder high Drive/head Status reQister

Write 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 03 04 05

Controller error Sector buffer error ECC device error 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. 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. 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. Not used. 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. Not used Data ECC Error-This bit indicates that an uncorrectable ECC error occurred in the target's data field during a read command.

Bit 1

Bit 2

Bit 3 Bit 4

Bit 5 Bit 6

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

Cylinder High Register bits Cylinder bits

Cylinder Low

76543210
--98

76543210 76543210

Cylinder Number Registers

Drive/Head Register
Bit 7 Bit 6 Bit 5 Bit 4 Set to 1 Set to 0 Set to 1 Drive Select-This bit selects the drive. A 0 indicates the first fixed disk drive, and a 1 indicates the second. 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.

Bit 3-Bit 0

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. 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. Write Fault-A 1 on this bit indicates improper operation of the drive; read, write, or seek is inhibited. Seek Complete-A 1 on this bit indicates that the read/write heads have completed a seek operation. 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. 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. Index-This bit is set to 1 each revolution of the disk. 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.

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1 Bit 0

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 Restore Seek Read Sector Write Sector Format Track Read Verify Diagnose Set Parameters

Bits 7 6 0 0 0 0 0 0 1 1 0 1 0 0 1 1 0 0

5
0 1 1 1 0 0 0 0

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 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 RO 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Stepping Rate 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
Data Only Retries Enabled

1
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

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 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

Reserved Reserved Drive B Motor Enable Drive A Motor Enable Enable Diskette Interrupts and DMA Diskette Function Reset Reserved 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 Bit 6

Diskette Change Write Gate

Fixed Disk and Diskette Adapter 11

Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

Head Select 3/Reduced Write Current Head Select 2 Head Select 1 Head Select 0 Drive Select 1 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. 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. Non-DMA Mode (NDM)-The diskette controller is in the non-DMA mode. Diskette Controller Busy (CB)- A Read or Write command is being executed. Reserved Reserved Diskette Drive B Busy (DBB)- Diskette drive B is in the seek mode. Diskette Drive A Busy (DAB)- Diskette drive A is in the seek mode.

Bit 6

Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

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. Cylinder Number-Contains the current or selected cylinder number in binary notation.

14 Fixed Disk and Diskette Adapter

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 EOT GPL H HD HLT Data Length-When N is 00, DTL is the data length to be read from or written to a sector. End of Track-The final sector number on a cylinder. Gap Length-The length of gap 3 (spacing between sectors excluding the VCO synchronous field). Head Address-The head number, either 0 or 1, as specified in the ID field. Head-The selected head number, 0 or 1. (H = HD in all command words.) 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 ). 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. FM or MFM Mode-A 0 selects FM mode and a 1 selects MFM (MFM is selected only if it is implemented. ) Multitrack-A 1 selects multitrack operation. (Both HDO and HD 1 will be read or written.) Number-The number of data bytes written in a sector. New Cylinder-The new cylinder number for a seek operation

HUT

MF

MT N NCN

Fixed Disk and Diskette Adapter 15

ND PCN

Non-Data Mode- This indicates an operation in the non-data mode. Present Cylinder Number-The cylinder number at the completion of a Sense interrupt status command (present position of the head). Record-The sector number to be read or written. Read/Write-This stands for either a signal.
I

R R/W SC SK SRT

read or write
I I

Sector-The number of sectors per cylinder. Skip-This stands for skip deleted-data address mark. This 4 bit byte indicates the stepping rate for the diskette drive as follows: 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

X HD

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

Format a Track Command Phase: The following bytes are issued by the processor in the command phase:

a MF a a } 1

x x
N

x x X HD US} usa

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

HD USl

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

HD

USI

usa

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 X MF X

SK 1 1 1
X X X HD

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 HLT )( HUT
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

a
usa

x x x x X HO US}

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
NCN

USl

usa

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 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. Invalid Command Issue (IC)-The issued command was never started. Abnormal termination because, during the execution of a command, the ready signal from the diskette drive changed state.
I I

10 11

Bit 5 Bit 4

Seek End (SE)-Set to 1 when the controller completes the Seek command. 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. Head Address (HD )-Indicates the state of the head at interrupt. Unit select 1 and 2 (US 1 and 2)-Indicate a drive's unit number at interrupt.

Bit 2 Bit 1-Bit 0

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. Not Used-Always O.

Bit 6

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. Overrun (OR)-Set if the controller is not serviced by the main system within a certain time limit during data transfers. Not Used-This bit is always set to O. 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. 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 I

Bit 4

Bit 3 Bit 2

Bit 1

Bit 0

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 Bit 6 Not Used-Always O. 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. Data Error in Data Field (DD)-Set if the controller detects an error in the data.

Bit 5

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. Scan Equal Hit (SH)-Set if the contiguous sector data equals the processor data during the execution of a Scan command. Scan Not Satisfied (SN)-Set if the controller cannot find a sector on the cylinder that meets the condition during a Scan command. 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. 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.

Bit 3

Bit 2

Bit 1

Bit 0

Command Status Register 3 (ST3)


The following are bit definitions for command status register 3. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Fault (FT)-Status of the fault signal from the diskette drive.
I I

Write Protect (WP)-Status of the I write-protect I signal from the diskette drive. Ready (RY)-Status of the the diskette drive. Track 0 (TO)-Status of the from the diskette drive. Two Side (TS)-Status of the from the diskette drive.
I

ready signal from


I

track 0 signal
I

two side signal


I

Fixed Disk and Diskette Adapter 27

Bit 2 Bit 1 Bit 0

Head Address (HD )-Status of the I side-select I signal from the diskette drive. 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.
I

unit select

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 3F2 3F4 3F5 3F6 3F7 Secondary 372 374 375 376 377 Read Main status register Diskette data register Digital input register Write 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 1 FO 1 F1 1 F2 1 F3 1 F4 1 F5 1 F6 1 F7 Secondary 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 Write Data register Write precomp Sector count Sector number Cylinder low Cylinder high Drive/head register Command reQister

Fixed Disk Function

Note: Interrupt request is level 14.

28 Fixed Disk and Diskette Adapter

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

34

Ground - Odd Numbers _ - Reduced Write Current/- Head Select 3

1-33 2 4 6 8_ 10_ 12.. 14 16 18 20_ 22_ 24

Fixed Dis k Drive

_ - Head Select 2 _ - Write Gate - Seek Complete - Track 000 - Write Fault

Fix ed Disk And Diskette Ada pter

__ - Head Select 0 Reserved

_ - Head Select 1

-Index - Ready

_ - Step

- - Drive Select 1
Reserved Reserved

26 28 30 32 34

-: - Drive Select 2

__ - Direction In

'---

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

+ MFM Write Data


- MFM Write Data

13 14 17 18 2.4,6,11,12,15,16,19,20 Fixe d Disk And Diskette Ada pter

+ MFM Read Data


Fixed Disk Drive

- MFM Read Data Ground-Pins

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

Ground - Odd Numbers 1-33 2 4 6

r--

... -

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

8 ..
10 12 14 16 18 20 22 24

Diskette Drive

... -

Fixe d Disk And Diskette Ada pter

----

...

26 .. 28 ..

30 .. 32

Side 1 Select Diskette Change

34 ..

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

31
~I

~I

I I

r----------- I
I I I
I

05'
o
I

I
I

------,
L ____________________ _

~------------~
~r--l_

... r------'_

~~,,~

i:
~,

I
I ..,1

I
I 1... 2

.,
~I

~l

~~

I ___________ J

~
~

5~

H'

;;
I~
~ ~

!i

~ ~
~

!!

"
Fixed Disk and Diskette Adapter 3S

,-----~------------------,

I I I

I I

I I

I I

L _________ _
I

..
ii)

o
Q) Q)

C'I

L-~----~~--------------_,

.c
Q)

.....
:::: Q)
Q)

Q. I'G

"C
---------~--------------------

.. III

I;'"
I~

,.
,.
I~
__ ______ - __ - ______ I
I
,........

C
"C C
I'G .. III

:" Pi{3>
:-~

:
1

L _______ ...J

C
"C
Q) )(

ii:

36 Fixed Disk and Diskette Adapter

co ..
o
Q) Q)
C')

U)
I

,.
~

" ~

~: O-<~~-f'_'++----;

L_~~_..J

-I~

" "

, ~

-.. ...
Q)

.s:

Q.

"

Q)

"0

aI

..\I:

til

C
"0
aI ..\I:

r:::

til

C
"0

u::

Fixed Disk and Diskette Adapter 37

..
to
0
CD CD
o;t

.c ~

..
"-

CD

Q.

'tl

1\1

<C
CD

.:t:.

:::: CD
1/1

C
'tl
I:

1\1 .:t:.

1/1

C
'tl

u:

><

CD

,
5 ~
c

38 Fixed Disk and Diskette Adapter

::

~~

'" " ::
:e
::

"

-[

'"

~r

I::;

.!:

:!:

",W

11

~ =~ ~

,. "

~ ~ :~ g ~ ~ ~ ~ ::~II
'1 :1

CX)

10

.... Q)

~ ~ _ ~ ~ ~

~~
-

'" :> ,. :;

IO:~( r!
i~
~

s::.

CP

~~::::il::~:::n:~
~~~

~ ~

Q.
"0
CO

... CP
Q)

2-

.,. .,.

<C

.... ~ en
C "0 c:
CO
~

en
Q)
~

C
"0

u:

Fixed Disk and Diskette Adapter 39

..
co
co

.c ~

CD CD

Q.
"0
c(

... CD

'"
CD
Ul

j
"

C
"0

"

.lII:

'"
Ul

c::

C
"0

= u::
~
c
~

I I

L!<>-_-_ _-_-..J...E...---1 ..
!
I

40 Fixed Disk and Diskette Adapter

~
~
Q

"
~

~~<lJ<8

co .... ....
s:::.

Q) Q)

~
Q) .... C.

...

Q)

'tI

10

en

C
'tI
I::::

10
~

en
Q)

C
'tI

u::

><

Fixed Disk and Diskette Adapter 41

, , = " =
;,;

;;
N

" "

;;;

FO

11

=-

11

r----I
I

1 I
I

I'

::: ;: = =:: :

~m-mni
"L
I

I I I __ "___ J

42 Fixed Disk and Diskette Adapter

You might also like