PC AT Technical Reference Mar84
PC AT Technical Reference Mar84
PC AT Technical Reference Mar84
----- : :i~s:
Technical Reference
1502494
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.
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
ix
Notes:
xi
Notes:
xii
Section 8: Communications
............................ .
Glossary ........................................... .
Bibliography ........................................ .
Index .............................................. .
xiii
Notes:
xiv
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
-H
BATTERY
DISKETIE DRIVES
xv
Notes:
xvi
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
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
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.
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.
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 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.
5 cycles X 256
= --------------
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.
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
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
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
GATE 1
CLKIN 1
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
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.
o Refresh Requesl
System Bus
.
Gale D
'--
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
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).
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
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.
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.
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
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
The following figures show address generation for the DMA channels.
Source Address
8237A-5 A15<---------->AO
Note: The addressing signal, 'byte high enable' (BHE), is generated by inverting address line AO.
8237A-5 A16<---------->A1
Source Address
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).
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
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
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.
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....
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)
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 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
0
I
0
I I/O
0
I I I I I
0 0 0
Power
0
Ground
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
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
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.
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.
""-
~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.
-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.
-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.
~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
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.
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
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
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
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.
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)
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.
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.
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).
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
45 46 47 48 49 4A 4B 4C 40 4E 4F 50 51 52 53 54
(Part 2 of 2)
73 74 75 76
77
78 79 7A 78 7C 70 7E 7F
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.
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.
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
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
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.
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
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
04 AC
Diagnostic Dump-Sends 16 bytes of the controller's RAM, the current state of the input port, the current state of the output port, and the controller's program status word to the system. All items are sent in scan-code format. 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
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
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
System reset Gate A20 Undefined Undefined Output buffer full Input buffer empty Keyboard clock (output) Keyboard data (output)
DE
OF 10 11 12 13 14 15 16 17 18 19-20 2E-2F 30 31 32 33 34-3F
* 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.
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
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
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
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
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
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
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
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.
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.
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
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
o
1 Bit 0
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.
0600H to
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.
110 Operations
Writing to CMOS RAM involves two steps: 1. OUT to port hex 70 with the CMOS address that will be written to. 2. OUT to port hex 71 with the data to be written.
Reading CMOS RAM also requires two steps: 1. OUT to port hex 70 with the CMOS address that is to be read from. 2. IN from port hex 71, and the data read is returned in the AL register.
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)
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)
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
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
The pin assignments for power-supply connectors, P8 and P9, are as follows:
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
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
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
The battery connector is a 4-pin, keyed, Berg strip. The pin assignments follow:
Pin 1
2 3
4
,'0
I;
~"
Ii '18'
~IJrn ~
riI1
IJ
--
nri
mmrnmrnmmrnrn ~ mmmmmm
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~~\'!
--
"
~
..
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)
"
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
" .,
XAO LSAO
1::::: "
, " , "
22
LSb't6
DJR
CBA seA
(SHTI)
j
(SHT I)
(SHT 1)
00
06
~
D7
II~
!
DfR
A A A A A
A A
Ub7
, , ,
20
I
ALSZ"')
(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
~g~
SDIO
(SHT 6,13,19)
5011
SDI2
SOI~
12
5014
SDI'3
(SHT6,13.19)
DTiR
LSAO LSAQ
,
-
~~--
---
---
(SHT 11
-RESET PALlbL8A
RESE-
'A)
-XIOIoi
,AD
,
7 B
g
)
SM/W
" "
18
10 20
UI"3Q
"
--
--
"
.,
" R"
IRGlI':!
2
1
.,
ENAS
21,22)
DMAC LK
(SHT 1)
R22 )0 R2I )0
(SHT 1)
EN AS (SHT 20)
(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~
~~~~'iA"S2""'i~~~~~~
17
II Itj
A
A
Y '1 y
Y ~
BALE'"
RESET DRV
AEN
G U7':i
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
:;~;;;:.:~:~~~~
~~~~;;S
!i18~
"'~~
~
"
-~~~ ~~~
"---~ "
~-i
...
;:-;:-;n
~;:~~
" "
"
(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
0 I 2 ,
D71+
1 2
U72
II~OE'
(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)
If
:
A
A A
:
~
B 16
B 17 B 18
:2 :~
'AI
'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'
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
(SHT11,14) (SHT",14,15)
-G
t NOIlJ3S
"'''''''''''''''' ",,,,Sb
--
I I
ALSZ"l+
-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
+RAS q
(SHTel
FOO
+ RAS
IOJU90 8
,I
140
120
121 "
10
l
ADDR SEL +CAS
(SHT 8)
ALSO"
(SHT 5)
-RAM 0 CAS
~
: USS 2
,
.2
c; FlO
,
12
R.2
-RAS
(SHT8)
UBI
~us;{~B
(SHT 5) (SHT 5)
I
ALSO" 1 ual
I~
']
7 ~on I(J
(SHT91
't U']7
(SHT 5)
-RAM I CAS
"
,
Z.
,
8
,. ,.onl't
-RAS 1
(SHT81
"
)0
FlO b ,.on l !
-RAS 1
(SHT 5) (SHT5)
+RAM~
)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"
1,14
1,14
m
Uz> U28
"'
1.1"1
1,14 1,14
5
(SHT 4)
SA8
~'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
'"
WE -RAsa
-CA L
A
,
I'>
RAS
(AS
b ::
US"
"
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)
10
48
U,"
"
"~ ' ~;
,>0" A MA'
b
MA'
MAZ MAO MAO MAb MA7
:~
A2
Ai
A4
SANK I
,on
""
-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
MDPIN 0 HOD
I IDIN
UL+S
DOUOJ Ilf
liQl
HD2 HD' HD' HD' 1.11t
~
HD7 1,14
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}
+>
11
i
(SHT6) (SHT 7)
1 MA'
t
" ,
I
",0
'DIN
ULf6
I. PI
~UIO
1
VOLTAGE
17
TO GNO
-RAS 1
+S
19-.IDuF I 9-.tOuF
.,.RAS2
-CASIL -CASIH
(IO,IIf'\9,2;,,1
(SHT7)
lS,III,It'),,;O
= " e;
c.
I ""'" =-~
51
(9)
1261< XI
~; 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
.!
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
.(~ T"
"
.-
.. muow LL"':t:_
[J" m
"
I
Ii
I
I
;;;
E
l
I
~
0
"-
"
" "-
" ~
. ..
;;: do~:;;;d;:'
t=
'---:=:J-
-' m-.
:l ~
~~
~
"
" "-
"-
"
N "~ ~
"
"-
'"
, "
"-
(SHT 6)
DIR 24'5
ALSZ4'5
(SHT2)
SOD
501
(SHT 2)
==== ====
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
------;
~ @IR
501'5
Ul0Z
(SHT2)
50s
(SHT2)
'"
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
-TIC -PPI
1
cs
(S
(SHT 18)
(SHT14)
=
~
-..J
~
,
4
'('5
0'. 02B 01
Vb
Y1
10
'
1
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:.
~"<~
2-,.e'WI *
!! "EI I'C
III
o
G)
~ttt~~~~=m~
m
trtrtr
~~
;::~ u
~\2.
~"''''
>'l.~'!!.
... ..
Cii'
N
CD
CD
II)
"i-
f/)
.c
.,J
'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)
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~
;:;
"
~~~~ ~g~~~
--
"~~~~~~~~~~~--~~~~~~
7?r~,~~~~~~~~~~~~~~~~~
o en ..c:::
-'~~---~~~~~~~--~~~~~~~
Q) Q)
'E ca
In
E
Q)
'li)
Ii
~m
I I I I
=
oc
I
(SHT2)
'< ~
~
rJJ.
(SHT2)
(SHT4}
500 501 502 SO, 504 505 506 507 SAO SAl SAl SA> 5," SA. SA7 SA8 SAO
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
IRQ q
(SHT 16)
IRQ "3
(SHT 16)
SAIQ
-lOR -lOW
-5 MEMR
DRQ I DRQ2
-5 MEMW
SYSC L K
""
820
DRG '3
PWR GOOD
OSC
TIC
AEN
RESET DRV -REFRESH -DACK I -DACK 2 -DACK '3
+12
-12
G
~ ,
4
~N
-0
-----~
826 81S 828 B08
807
8" 801 810
BALE OWS
(X26)
10";,+
+.04M (X24)
BOS
-, i ~
R~
4
~~'~
~
GOOD C C C
BO'
+,
1 1
C DC
"
c
~
"
~
~ "~
~~
N ('II
"
"
&
.
~
"
L
~'E-
.
~
"
~
'a
ID
... m
"
E
CD
I I)
,
~--\-+-- -----~o+
'::'~
,
r '!! r
3~
.~~
~ ~
~~
I~
r
'"
rrr
""" ~~~
~M'"
r
00
rrr
WWOO
"'
00
00
SECTION 2. COPROCESSOR
Contents
Description ...................................... 2-3 Programming Interface ............................ 2-3
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
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
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
Notes:
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
Maximum 3.0
Input Requirements
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.
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.
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.
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.
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
Notes:
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.
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.
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.
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
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.
4-6 Keyboard
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%.
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
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
4-12 Keyboard
while sending I ACK I , it will discard I ACK I and accept and respond to the new command.
Keyboard 4-13
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
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.
4-14 Keyboard
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.
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
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
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
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
Notes:
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.
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.
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
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
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
Program termination
Event wait
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.
DOS
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*
*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
H
Hex 00
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.
A checksum is also done to test the integrity of the ROM module. Each byte in the defined ROM module is summed modulo hex 100. This sum must be 0 for the module to be valid.
When the POST identifies a valid ROM, it does a 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.
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.
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.
Kev 90 2 3 4 5 6 7 8 9 10 11 12 13 15 16
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
Key
Base Case
Upper Case
51 n N 52 m M < , 53 > 54 55 "7 / -1 -1 57 Shift 106 Note 2 * 56Alt -1 -1 61 SP SP 64 Caps -1 -1 Lock Lock Nul(Note 1) Nul(Note 1) 70 Nul(Note 1) Nul(Note 1) 65 Nul(Note 1) Nul(Note 1) 71 Nul(Note 1) Nul(Note 1) 66 Nul(Note 1) 72 Nul(Note 1) Nul(Note 1) Nul(Note 1) 67 73 Nul(Note 1) Nul(Note 1) Nul(Note 1) Nul(Note 1) 68 Nul(Note 1) Nul(Note 1) 74 Nul(Note 1) Nul(Note 1) 69 -1 -1 95 Num Lock -1 -1 100 Scroll Lock Notes: 1. Refer to Extended Codes in this section. 2. Refer to Special Handling in this section.
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
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
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.
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)
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.
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.
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.
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
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.
Notes:
Length
Name
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
cm-
CH2 CH3
CM
CM4 A CH4 B
C~14 - C
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
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
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
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
PRoe SHUTDOWN
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: 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- 08 EXC=09
EXC 10
EXC-ll EXC -12 EXC -13 EXC-14 EXC -IS EXC -16 EXC=17
EXC 18
OOOO,FOM 0000,37DC
0000: EOB7 0000: 3936
0000: 396
0000: 3A4C
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
xmT
ERR
0000: 0008
0000:0010
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
0000: 3054
0000: 30[\9
Kl6
PRI~TER
10 1
SHUT6 SHUT4 ROS CHECKSUM POST3 BLINK INT RON CHECK XPC-BYTE XLAT PR PRT HEX PROT]RT_HEX
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 3E76
00DO3F2F
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
DUHHY-RETURNPRINT-SCREEN P_O_R-
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-
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
0000,E393 0000,E3A8
0000 :E3BD
FI780
Fl781
F1782
0000, E8El
0000:E91B
Kll
K12
K13
ROS Map
5-25
5-26
ROS Map
TITLE T5Tl
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
-->
-->
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
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
c c c c c c c c c
c
C C C C
X287
. -- -- -- - ------------ - ----------- -- --- -- -------------- - ------------- -- - -- - ---EQU OFOH Q20H ; MATH PROCESSOR
; ; ;
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
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
= 0080
0 0
0040
C
C C C C
EQU EQU
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
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
c
C C C C
0095 0098
0097
0094 0092
COBE
c c c
0080
OOllO
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
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
---------- -- ----------
= 0540
.- 0002
0410 0060 0060 0061 0080
= 0080 = 00 110 = OO?O = 0010 = 0008 = 0004 = 0002 = UUOl = 0080 = 00 110
0020
0010
=
-
0008 0004
c c
[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
081-1
UGH
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
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
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
Al~SO
SlCMEN r A'I
2-ltl~
lABEL
NEW FDISK
uo6 1t
007/1 0014 00"/8 OO-,R 007C 007C 0100 a 100 010 1 -1 0104
0118
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
7coa
0500 7COO
7COD
INITIALIZATION ONLY
0000
0000
STACK
80 [
????
0100
01GO
TOS STACK
LABEL ENDS
WORD
011 l
BYTE 4 DUP(?)
0008
ow ow
4 OUP('1)
0010
01
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(?}
DB
1 DUP(?}
ERROR CODES
OOl"r
01
C
C C C C C C C C C
1 DUP(? )
0018
01
[
??
DB
1 OUP(?)
0019
01
DB
1 DUPI?)
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(?)
OW
DUP(?
PO I NTER TO TAl l
Of KEYBOARD BU FFER
ow
LABEL HEAD'" TAil
160UP(?)
D03E
INDICATES
003E
01
1 DUP(?)
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 [
??
LABEL LABEL DB
BYTE BYTE
7 DUP(?)
c
0049
01
??
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(?)
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(?)
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(?)
DB
1 DUP(?)
ow
DB
1 DUP(?)
1 DUP(?)
0066
01
DB
1 OUP(?)
PAGE
5-30
Test 1
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
ow ow
DB
1 aU?(?)
1 DUP(?)
SYSTEM DATA AREA DB 1 oUP(?) 61T 7=1 IF BREAK KEY HAS BEEN HIT
ow
PAGE
1 oUPt?)
WORD;1234H
DISK_STAfUSl
H~
NUM
DB
DUP(? )
DB
1 OUP(?)
DB
1 OUP(?)
11- DU?(?)
ow ow
1 DUP(?)
1 DUP(? )
1 DU?(?)
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(? )
HF - INT- FLAG
DB
1 DUP(? )
HARD FILE
J NTERRUPT
FLAG
HF _CNTRL
DB
1 OUP(? 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(? )
C
C
n
[
C C C
C
DSK_TRK
DB
1 DUP(? )
0095
01
DB
1 DUP(? )
0096
01
DB
1 OUP(? )
RfSERVEO
c
0097 0097 01
??
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
USER- FLAG
USER - FLAG_SEG
OW
1 OUP(? )
C
C C C C C C C C C C C C C
C
RTC
- LOW
ow ow
1 DUP(? )
RTC_H I GH
1 DUP(? )
...
OOAO 01
RTC_WA IT_FLAG
DB
1 DUP(? )
..
OOAl
DATA
ENDS
0000
0000 01
0001
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
STATUS_BYTE
XXDATA
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
0000
DB
1 9 8 4 1 9 8 4
11998844'
; EVEN ; 000
; COPYR I GHT NOT I CE
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
B4 DO
E8 (JOOO E
MOV
CALL
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;
<,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
; ;
SET UP OTHER
ASSU~'E
I NTERRUPTS AS NECESSARY
co
CO 06 0008 R 0000 E 06 0014 R 0000 E 06 0062 R F600
SUB
BE 08
0060
0066 D06e
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
; ------- 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
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 -
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
'"
FA 84 9E 73 75 7B 79 9F
START_l: 05 2A 28 26 24
Test 1 5-33
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
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
; ----- 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
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
'"
; ; ;
?A CO E6 F1
SUB OUl
BO 11
E6 20 EB 00 BO 08 E6 21 EB 00
MOV
oor
OCi
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.)
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
[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
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
GET
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
5-34
Test 1
OW OW OW
ow ow ow ow ow
SHUTO; ;-------
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
[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
AL,OlH MFG_PORT, AL
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:
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
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
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
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
; ; ;
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
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
AX,CS 5S,AX DS,AX 5S: CODE BX, OFfSET BEGIN SP, OFfSET C1 ROS - CHECKSUH ellA
PO I NT TO
ASSUNE
MUV MOV JMP
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
022E 0230
E6 DB E6 DO
;----- 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 :
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
CMP
JE IN OR
C13
AL, TIMER+l BL,AL
FE CF
LOOP DEC
JNZ
75 EB
'4
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
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
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
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
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:
.iMP
IN JMP MOV IN
25T DMA
ffl 00
8A EO EC
5-36
Test 1
3B 08 711 01
r4
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
80 FB 55 7', 09
8U
H.~
AA
74 08 BO ~S>
[l3 C
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
; ;
;
;----- 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
Dzre
BO AA EB C8
C2aA:
MOV JMP
AL,OAAH G16A
C21 :
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
EB 00
80 E6 E6 EB BO f6 4:;> OB
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
RESET_fLAG, BX
TEST.08 DMA PAGE REG I STER TEST OEseR I PTION WR I TE/f"<EAD ALL PAGE REG I STERS
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
XCHG C22B:
DEC DEC SUB IN CMP JNZ DEC DEC CMP JNL INC MOV
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
75 FE 8A E2
fO
C4 C4 DB
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
AH,OCCH AL,033H
C22 C2'
C25:
AH,O
C27
AL,AL
C22
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:
~t:~~~~E~H
C28
C26
TEST LOOPNZ
~~9REFRESH_BIT
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
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
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
BO BC EB BC
CO 0000 E 21 90 0000 E
E30B:
MOV
READ I NPUT COMMAND SET RETURN ADDRESS ISSUE COMMAND SET RETURN ADDRESS
5-38 Test 1
EB 27 90 (4 60
JMP
[30C:
IN
OUT
6 82
; ------ 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
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
FE CB
75 F4
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 -- - -- --
80 OE
DOA:
6 80
BB ---R
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
01138
01130 0441 0443
GO
;-------- 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
0000 E
08 C30 :
03
05F'
BX,AX e31
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
OUT
r~ov
OUT
0463 0466 0468 046A 046C 0116E 01171 0473 Oll77 0117B 0470 Oll7F 0481
89 8E 28 88
COOO 09 DB 07
M1 :
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
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
M4
;------C32:
MOY
SUB OUT
Test 1 5-39
I3A 0388
130 01
EE 83 EA 04 BB 0030 E B9 DOlO Z_2:
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
Ml0:
MOV OUT INC INC MOV OUT INC DEC LOOP MOV AND CMP JZ MOV MOV JMP
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
;------ 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
; _____ ENABLE VIDEO AND CORRECT PORT SETTING 0406 0409 04013 SA 03138 130 29 EE MOY MOY OUT DX,3B8H AL,29H OX,AL
42 60 30 EE BA 0308 BO 28 EE
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
112 BO 30 EE
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 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
;-------- 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:
5-40 Test 1
04 90 27 1'~ 40 27
86 05
PR:
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
RET
130 20
68 AS
Z4: 05
055C
055E
D56E
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
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
C31_0
OS:[Oll,AX AX.DS: [01] C31_E
; -------- ROLL ERROR CODE IN MFG_PORT --> NEXT THE HIGH 8YTE
E4 81
E6 80
JN
Al.MFG_PORT+l
MFG_PORT~AL
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
C31_H
89 05 8B 05 [2 FA
; -------- ROLL ERROR CODE IN MFC_PORT --> THEN THE lOW BYTE 05BB 05BO E4 82 E6 80
IN
DUT
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
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
05E6 056
058 05EB
05EO
ax
B8 ---- R 8E 08 BC 0000 8E 04
C33:
AX~DATA
Test 1 5-41
O~FB
Be 80UO
STACK
I S HEADY TO GO
60
'6
BO
"
l'iOV
OUT
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
or
01 01 A9 75 37 EO
SMSW
+
+
DB
??OOOO
+ ??0001
aoor
TEST JNZ
AX (JOFH BYTE AX,1 BYTE OFFSET CS;??OOOO OOlfi OFfSET CS: ??0001 AX,OFIi ERR_PROT
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
0615 061 E
0621 06211
I RST PATTERN
06z-t
06?A 0620 062F 0632
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
POP
0;:>00 10 0400 DB TEST JNZ TEST JZ CLO PlJSHF
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
GO
J F NOT
EB 3E 90
OGIIC
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
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
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
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
DB
ourti
+ 110009
+
Mav
aRC DB
LABEL LABEL
01 SO 08A5 26
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:
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
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
75 C8
'[2 ,6
C3
46
F7
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
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
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
E8 0000 E 80 16
CMOS:
6 BO
; -------
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
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,
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
,N
SUB ADC
I MC
CMP
J"l
OR
Jl
MOV OUT JMP MOV MOV OUT JMP eMP JZ
unA
'"
,
"
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
; ------- 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
SET BAD CHECKSUM FLAG 10 DELAY GET THE CURRENT STATUS SAVE IT SET BAD CHECKSUM FLAG 10 DELAY SET FLAG <><> <><><> <> <> <> <> <><> <> <><><>CHECKPOI NT 18 <><>
XCHG
OUT
CMOS4:
MOV
OUT
OC
00 61 ; -------
OR JMP OUI
'"
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
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
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
Of
+ ??OOOE
DB
LABEL
SHL
01
[0
+ ??OOOf
LABEL
ORG
+ 01
DB
5-44 Test 1
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
OB
71 0000 E J;1P
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
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
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
Ba BE [B 74 E9
JZ
JMP NOT FIN:
ADO
83 C3 40
I NC
: ------- 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
BYTE PTR DS:(ES TEMP.BASE HI_BYTE),OMI NOT DONE HOW-BIG END DONE -
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
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
B8 0018 8E 08 89 lE 0013 R
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
POINT
os
; _______ START WITH SEGMENT ADDR 10-0000 (ONE MEG AND ABOVE) DBBC D8Cl
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
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
; ;
28 FF
B8 AA55
88 C8 26: 89 05 60 OF 26: 88 05 26: 89 05
_33 Cl
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
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
REP RET
HOW BI G ENOl: -MOV
OUT
WRITE ZEROS SET COUNT FOR 321< WORDS FILL 32K WORDS
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
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
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
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
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
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
WR I TE THE
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
502:
MOV
OUT JMP
AL,20H
1'"6 80
E9 0000 E
;
MfG PORT. AL
PROC_SHUTDOWN
oe
BO 21 E6 80
---R
SHUll;
BE 01,
Mav r-lov
MOV
OUT
Be 0100 R B8 ---- R
<><> <><><><> <><><> <><><> <><><>CHECKPOINT 21 <><> SET REAL MODE STACK
8 08
;-------- GET THE CONFIGURATION FROM CMOS 0gel 09C3 0ge? 09C7 09C9 09G8 09CD 0900 09D2 0904 0906 0908 090A 090C 09D[ 09EO 09E2 09E4
BO BE
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
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
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
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
.'
JZ
ADD
Cl~P
JL AND
cX,ex
TO CALLlR
[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)
DAZ8
OA2A UA2e GA2E OA30
24 30 3C 30 7'5 18 8A C4 EB 09 90
AND
eMP
JNZ MOV
JMP
INSURE MONO IS PRIMARY eONFIG OK7 GO I F NOT RESTORE CONFIGURATION USE THE CONFIG BYTE FOR CRT
DAB
OA33 OA35 QA37 OA39
24 38
MOS OK 2: - AND
3C 30
8A C4 74 OB
01P
MOV
JZ
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:
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
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
TEST
JNZ
AL, 0 lAG_STATUS CMOS PORT, AL SHORT $+2 AL,CMOS_PORT+l AL,OCOH BAD MQSl
XCHG
MOV OUT JMP
00
C4 20
XCHG
OR
aUT
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
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
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
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
OA88 OASA OASD OA8F OA91 OA93 OA96 OA99 OA9S OA90 OA9F OAAO OM2 OM5 OM6 OAA8
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
ge
BO AD E8 0405 R
90
74 DC 4 60 A2 0072 R
CALL POPF
JZ IN MOV
C8042
E6
DMA
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
3C 65
75 03
9 002e R
TEST
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
PUSH
MDV MOV SUB I NT MDV MDV SUB I NT MOV I NT POP MDV AND JNZ
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
EQUIP_fLAG,AX AL,30H E7
OS
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
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
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
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
;
; ; ; ;
- - - - -- -- -- -------
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
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
[15
E17
; ;
;------- CHECK HORIZONTAL LINE 0850 aBSF OB61 OB63 OB63 0864 0666 S1 03 02 EC 75 3 E16: E1S:
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
.,
E18B: E18C:
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
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
[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~
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
I T THE B/W?
;------- BOTH VIDEO CARDS FAI LED SET DUMMY RETURN I f OC2F OC2F OC30 OC32 OC34 OC37 OC3B OC3C OC3F OC3f E17_3:
1E
26 8E BF C7
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
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
BO OA
[8 0000 8 0000 E
C2l:
LI NE FEED ON CRT
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
Test 2 5-51
[6 A 1 EB 00 [14 21 8A [0 Ell Al
IN
ADD JNZ
IMR
05 1 75 15
oao
06
FOR HOT INTERRUPTS
; ----- CHECK
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
CX,CX
a;
04
I NTR _FLAG, OUfI
07
MFG_ERR.JLAG,OSH SI,OFFSET E- MSG
Dr;:
D6A:
Mav
CALL
Ea
eLi
HLT
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
;------- 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
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
MOV JMP
;------- 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:
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
MSB
EB 00 E4 42
86 F.O
EB E4 3D 74 00
112
BE 0000 E EB 80
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,
ooer
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
0002
00D4 0006 OOOB 0009
Eli 00 8A C 1 E6 40 FB F6 06 006B R 01
08:
552
Test 2
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
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
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
2B BO 6 E4 A8 74 2
C9 20 80 64 02 DB F8
013:
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
; ------- 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
MOV MOV
CALL
MOV OUT
; ------- 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
Test 2 5-53
0197
E6 87
OUT
50
E9 0347 R
MOV PUSH JMP I S CMOS GOOD? AL, DIAG STATUS CMOS_PORT, AL SHORT $+2 AL, CMOS_PORT+l
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 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
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
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
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
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
38 C8 77 02 813 C8
03 09 89 1 E 0017 R 83 EB 40
eX,Ax
IS CONFIG GREATER THAN DETERMINED? GO I f YES USE I~EMORY SIZE DETERMINE I F NOT
026E
026E 0271 0273 0275
B'
E20C: E200:
SUB
MOV SHR
06 D3 EB
53
PUSH
0276 02'9
B8 0008
8E CO
MOV MOV
;-------'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
0282
26:
c6 06 0040 93
MOV
MOV MOY
;-------'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
E6 86
FE CO E6 81~
OUT
INC
OUT
; ; ; ;
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
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
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:
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
02EF.
O?FO 02F2 02F4
86 C4
BO 40
E6 8f
XCHG
MOV
86 C4
OUT XCHG
;------- 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?
80 3 004e 75 03 EB 66 90
FE
BYTE PTR DS:(ES TEMP. BASE HI BYTE),OFEH ; NEXT ;-GO-IF NOT KB_LOOP3 ; GO NEXT TES--;-
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
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
; _______ 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
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
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
ex
21
AX
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
86
01 84
;------- 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
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
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
03[3
26:
C6 06 0064 10
BO flO
E6 87 26: AO 0064 NEXT_A:
MOV
OUT
MOV
; ;
;------- CHECK FOR TOP OF RAM (FEOQOO) 0:H3 03F9 03F6 26: 80 3E 0064 FE 75 03 EB 79 90 CMP JNZ JMP
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
59
58
05 0040
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
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
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
OK'
I NCR(MENT BU F F PTR RECOVER WORK REGS RECOVER 64K BLOCK COUNT LOOP
CX AX KB_lOOP _2
; -------- 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
50 51
E9 03BA R
MOV
OUT
; <><><><><><><><><><><><><><> ; <><><>CHECKPO I NT 34 <><><><> ; ; BACK TO REAL MODE NEXT TEST VIA JUMP TABLE (SHUT2) IF OATA COMPARE ERROR
[9 0000 E
JMP
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
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
;------- 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
00
71 F8
10 DELAY
IN
MOV
59 58
88 C8
ex
AX
CX,AX
SAVE
IT
AX,S12
72 39
JB
M3
AX, 640
M1
JB
; ------- 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;
0400
F6 C7 80 75 1E 20 0200
M1:
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 ;
~--~---
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
M4
04fB
A3 0013 R
M3:
; ------- 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
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;
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
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
;-------- 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
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
; ;
SHuns:
;-------- 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
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
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
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
60
01 DB DE 0016 R 08 0000 [ 62 90 0000 E
Gll:
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
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
; <><><><><><><><><><><><><><> ; <><><>OiECKPO I NT 39 <><><><> ; ; GET THE SCAN CODE CONVERT AND PRI NT CONT I NUE IF 8042 INTERFACE IS WORKiNG
IN
CALL
JMP
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
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:
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
JZ
DR MOV
JI1P F6C:
MOV
OR CALL
F6D:
5-60 Test 2
uo
3A l6 80
F"!;
r'10V OUl
MOV OUT eLi MOV CALL MOV OUl
AL,3 AH
MFG _POIn, AL
ff E6 21
FA
eo
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
0'. E8
00 0000 E
MOY CALL
-- SETUP HARD\-.IARE 0668 D66A D66e 066F 0670 0611 0674 0677 0678 0679 067A 2B CO 81 cu 89 0008
SlJH
DE.
1C BE 0000 E BF 0020 R A5 47
1~7
os
51 ,OFfsn VECTOR_TABLE UI,OI-)-::;[T INT_PTR 01 01 F7A ; SI< I P OVER SEGMENT
Mav
F7A;
E2 FB
;------- 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
(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
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
81
cr~p
0,
75 DE
JNZ
MOV
r~OV
BA BU EE E2 2A
F9_A;
FE
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
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
eET ADDR OF roc CARD TURN MOTOR ON, EN OMA/I NT WRITE FOC CONTROL REG
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
Je
MDY CALL
JNe
OR MOV CALL
Fl4
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
; ------ 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
;-------- SET PRINTER TIMEOUT DEFAULT 0758 075E 075F 0760 0763 0764
SF 0078 R 1E 07
B8 1414 AB AB
; -------- 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
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
; ------- 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<:
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
;------- 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
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
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
EB E4 A8 74
00 71 10 06
JMe IN
TEST
JZ
CALL
51 ,OFFSET El A E_MSG -
; -------- 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
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
80 30 E6 80 E8 0000 E
[8 8U 74 80
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
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
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
FB
BO 3B
E6 UI BO E8
CALL
MOV
CALL ROM_SCAN:
;-- _____ 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
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?
BE DA 28 DB 8B 07 3D 75 E8 EB
"
5B
CALL
JMP
81 C2 0080
Bl fA EOOO
Test 2 5-63
08AA
7C E3
JL
END IF ; -------- TEST
; co
I F NOT
-(4
E8 0000 E E4 64 24 10 03 EB DC 90 KEY1 :
SET DATA
SEGf~ENT
80 DE 0016 R 80
08BO
ORAD
08CO 08C3
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:
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
"
","'=",0;;0===;;;;;;===
SETUP RS232
=0;;0;;;"'0;;"'=;"''''=:::==
08;::6 08E9 08EC 08ED 08EF oaFl oaF7 oaf8 08f9 Oflfe 08FO 08FF 0901 0907 0908 BS BA Ee A8 75 C7 43 43 SA Ee A8 75 C7 43 43
0000
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
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
OR
MOV
; -------' TEST FOR ANY ERRORS (BP NOT ZERO) 0914 0914 0916 2B CO A3 0017 R
;-==------; --------
K OK;
SUB MOV
E4 24 EEl E6
21 fD 00 21
INTS
C6 06 0015 R 00 83 FD 00 74 3D 80 3E 0072 R 64 75 08
CLEAR ~IFG ERROR FLAG CHECK FOR BP= NON-ZERO (ERROR HArrENCO) CONTINUE If NO ERROR MFG RUN IN MODE? GO I f NOT
; -------- 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
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) ;
CHECK
RESUME ERROR MSG ERROR MSG fOR KEYBOARD LOCKED RESUME MSG
E8 0000 E
FIRST PR INTER
AL,3FH MFG_PORT, AL
5-64 Test 2
Bll CO 80 75 F6 75 E9 80 74
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
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 OESCRI PTOR TABLES 0986 0989 098C 098E 0990 0993 0996 B9 BF 2B BE 01 F4 DOAO eo co 26: 89 05 83 C7 02 E2 F8 F20: MOV t10V SUB
MOV
f20_A:
MOV
ADD
LOOP
CLEAR 1K PO I NT ES TO START OF OEseR I PTORS CLEAR POINT TO NEXT LOCATION CONT I NUE TILL DONE
; -------- SET
0998 8 0000 E CALL
SET_TOO
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
,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
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
E4 21
24 FB EB 00
E6 21 80 DE 0010 R 02 NO_287:
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
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
SUB
MOV
PUSH
POP eMP
CLEAR FLAG SEGMENT OF SYSTEM CODE CHECK FOR AAS5 BUS SETTLE SAVE FLAGS CLEAR pass 1BLE PAR 1TY CHECK TOGGLE 10/PAR CHECK ENABLE
PUSHF
MOV IN OR
Test 2 5-65
EB 00 E6 61
J~1?
2" F3 EB 00
1:.6 61
UA30 OA31
9D
15 29
SHOI1T $+2 PORT _B,AL AL, RAM PAR ON SHOHT ~+2 PORT _B,AL SHUT4
; ------- 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
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
;-------OA58 FF 1 E 0067 R
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:
"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
80 43 E6 80
OA6C OA6E
CO 19
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
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
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
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
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
0004
8
MUV
SHR
ADD PDP
03 DO
59 E8 0002 R 711 06
ex
E8 0000 E
EB 14 90 52 BC 1 E 0069 R
CALL J7 CALL
JMP ROM CHECK 1;
PUSH
MOV MOV
0054 0059
005A 005A
26:
5A
FF 1 E 0067 R
CALL
POP
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
58 24 OF 04 90 27 14 40 27 B4 DE B7 00
CO 10
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
ENDP
~~~T=P~T=~E~----PROC----NE~R-----------------------
1E 53
OS BX
v I OEO
BB 0020
8E DB
MOV MOV
E6 0098 R
CALL
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
57 01 C7 88 05
SF
C3
01 01,1 OS:[DIj,Al 01
ENDP PROC Al, SHUT_CMD STATUS_PORT,Al PROC_S ENDP SHUTDOWN COMMAND 1NSURE HALT
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
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
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
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
; ; ;
DH, DH
G3
G1 : G2:
Bl,6
I)EEP G2
DH
G1 MFG_TST,l
G3
004A
OOI~C
OOI(E
0050
0052 0054 0055 0056 0057
G5: G6:
90
C3 ERR_BEEP
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
0059 0058
OU50 0060 0062 0064
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
8A c4 E6 61 C3 BEEP ;
MOV OUT
AL,AH PORT_S, AL
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
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
IN MOV
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
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
SET FLAG
RESTORE REG AX CONTENTS ; NEED IRET FOR VECTOR TABLE
; --HARDWARE I NT 13 (LEVEL 75H) -------------------------SERVICE X287 INTERRUPTS : TH I S ROUT I NE f I [LOS X287 I NTERRUPTS AND CONTROL : IS PASSED TO THE NM I I NTERRUPT HANDLER FOR COMPATABILITY.
;
~OFF
------------------------------ - ------------------------NEAR
AX
~OFF
50
SAVE AX REMOVE THE t NT REQUEST ENABLE THE INTERRUPT THE SLAVE THE MASTER RESTORE AX e I VE CONTROL TO NM I
32 CO 6 Fa
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~
50
SO 20
[6 AD
CD OA
5'
[0 I
CF
0117 0117 0119 Ol1C 011E 0121 0123 0126 0128 012B 012C Q12C
SA 8 8A [8 80 [8 80 [8 C3
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
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
~~g:g~
~g:~~
I~~~ii
m~n
ASSUME CS:CODE. DS:AB50
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
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
BO 94
E9 0007 R
06
B8 0048 8E CO
PUSH
MOV MOV
ES
AX, ES_TEMP ES.AX LOAD ES REGISTER
;-------
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
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:
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
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
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
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
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
JA
50
B8 8E C7 c6 88 8E 58 1F 5A 0008 08 06 0048 FFFF 06 0040 93 0048 CO
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
59
51 83 F9 40 75 01 52 86 E4 3A 74 EO 88 C4 OF
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
0105
0107 0107 0109 010B 0100 alOE alOE 0110 0112 0113
JZ
TEST_EXC1; IN
CMP
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
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 -
88 09
E4 EB DC E6 E8 24 E6 61 00 OC 61 00 F3 61
SAVE WORD COUNT OF BLOCK TO TEST 10 DELAY TOGGLE PAR I TY CHECK LATCHES 10 DELAY
IN
JMP OR OUT JMP AND OUT
;~-------
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
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
SAVE AX
Test 6 5-75
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
E4 24 86 Ell 22
61 CO
eLI
87
EO
; ------- 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
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
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
SAVE AX
0095
0097 0099 0098 0090
E4 24 86 E'-1 22
co
C4 87 EO
61
IN
AND XCHG IN AND
CHECK FOR IO/PAR CHECK STR! P UNWANTED BITS SAVE ERROR CHECK fOR R/W OR 10 ERR
IN
XCHG IN
GET AH GET AL
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
;------- 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? ;--------
OOCO 00C3
BA Ul01 EB B3
C9:
Mav JM?
lX I I
WRITE 0101
TO STORAGE
; --------
00C5 OOC5
C3
C13: C14:
RET
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
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
XCHG
DMA_PAGE+8,AL AL,AH
SAVE AX
5-76
Test 6
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
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
MOV
OUT
~lOV
,6 70
BO 07 EB 00 E6 71
JMP
Dour
OUT
AODR
; -------' ENABLE PROTECTEO MODE 0011 0014 0016 UU1Y BC 0000 8E 04 BC 8000 [8 0000 E
MOV
I~OV
MOV
CALL
DOle
001 F 0021 0023
002A
0030 0033
BE 005B
8E 06
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
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
; ;
T7_1:
MOV OUT
LOOP1:
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 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:
y~~+~~C~~gNtOTjSOT
LTR/STR
; ------- 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
+ + 1?0004 + : 1?0005
DB
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
OF
8B OF
+
+ 110006 + + ??0007
LTR
DB
OOAA DOAA
OOAC
DOAA DDAA
OOAC
+
00
ORG
01, POST_TR 01 OOFH BYTE BX,OI BYTE OFfSET CS: 710006 OOOH OffSET cs: 110007
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
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
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
80 F4
E6 80 88 0048 8E CO
MOV
OUT t<\OV
MOV
; ------- 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
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
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
88 05
62
28 E2 E4 3C G9
FE
+
+ ??OOOC
LOOPA:
88 00 7'y 03 E9 02EA R
T7 I
ERROR_EXI T
T7 7:
28 FF
26: C7 05 3FFO
0104
0106 0108
Mav
MOV
SUB
BB 1000 26
+ ??OQO[
AX,10aOH
ES
S(T
SEGOV
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
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
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
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
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
; <><><><><><><><><><><><><><> ; <><><>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
paPA
OB CMP POP JNZ CMP JNZ CMP JNZ CMP JNZ CMP JNZ CMP JNZ CMP JNZ JMP
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
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:
;--------
3E
Df
+
+ ??0014
as
03EH AX OOFH BYTE BP,AX BYTE OFFSET CS:??0014 OOOH OFFSET CS: ?70015 ;
88 E8
DO
+
+ 710015
LABEL
ORG
DB
ORC JNZ
75 DO
ERROR
;------- 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
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
03EI1 AX OOFH BYTE BP,AX BYTE OFFSET CS:??0017 OOOH OFFSET CS: ??0018 ERROR_EX I T1 AX, ES TEMP
OS -
0048
3E
OF
+
+ ??OOlA
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
0101
0103
60 90 E6 86 28 F6
MOV OUT
SUB
5-80 Test 7
26: C6 04 00 2B E4 22 EO C9 8B CO FA LOOPD:
MOV
SUB
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
013
C6 06 0040 93
MOV
BYTE PTR
;
01E8 OlEA OlEC 01EF 01 F2
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
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
8B C3
+
63
75 80 80 75 9A E3 03 Fe 03 92
+ ??OQ1G + + ??OQ1D
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
;-------- CHECK THAT ACCESS RIGHTS DO NOT CHANGE 0201 0204 0207
BB 0060 B8 0048 80 CB 03
MOV MOV OR
; 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
--------------.--- -----------------------------================::==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
c6 06 0040 F3
BB 0048 28 CO
MOV
MOV
SUB
LAR
0224 0225 0225 0227 0225 0225 0227
Of
88 C3
DB
+ ? ?0020 +
-+-+- ??0021
02
AX. BX DDFH BYTE AX,BX BYTE OFFSET CS:??0020 002H OFFSET CS: ??0021
;-----~--
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
MOV
AXI ES_TEMP
BX,AX OOFH BYTE BX.AX BYTE OFFSET CS:??0022 003H OFFSET CS:??0023 R07
LSL
Of
DB
88 08
03 74 03
9 02EA R
+ ??0022 +
-+- ??OQ23
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
! !
+
170024 ??0025
03
75 EB 81 FB 5555 75 E5
+ +
; -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
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
; ------- 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
;-------- 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
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
;------- 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
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
FA 80 81 E6 80 E8 0000 E 8B EF
55
ell PUSH
MOV OUT
CALL
MOV
OOOB OOOE OOOF 0012 0013 0016 0017 0018 0019 0019 001C 0019 0019 00lC 00lC
B8 0800 AB B8 DOAO
MOV
STOSW
MOV
AB
B8 0000 AB
STOSW
MOV
26
OF
8B 5E 00
+
+
+ + ?10001 +
?10002
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
ES:DI
NOW
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
CALL
MOV MDV
STOSW
MOV
SToSW
MOV
26
OF
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
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
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
0042
0042 0044 0044 0045 0047 0049 0049 0048 0040 004E 004E
01
EA 0049 R 0040
DONE: BO 85 E6 80
e3
SYSINIT1 CODE
RET
DIDP
ENDS
END
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
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 0000
ow
OB OB OW
DO 00
0000
0 0 0
0
THE GOT
ITSELF
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
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
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
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
11000 8000 DO
93
0000
- -
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
FffF 0000
OC 93
0000
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
FFFF 0000
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_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
8B C3
AB
AX,BX AX, OX AX,O LOW_lOT CX, 256~32 BP, OffSET FREE_I NTS
8B C2
AB
B8 0000
AB
0028
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
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
I RET_ADDR
LABEL I RET
WORD
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
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
255
0065 R 0040 00 86
~REE
I NTS
OW OW DB [NDP ENDS
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
--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
------>
--------------;>
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
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
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
OR
Mav
OK2: OK:
0072
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
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
ex
BX 2 ; ; RECOVER ADDRESS THROW AWAY SAVED FLAGS
os
R 06
RETRY:
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:
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
OOCl
00C3
8A AF 0090 R 00 C5 00 C5
ooce
OOC~
80 E5 03
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~;
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
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
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
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
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
ex
SAVE OR I G I NAL PARAMETERS ;AVE PARAMETERS SELECT DRIVE FOR DISKETTE ATTACH CARD IGNORE DISK CHANGE STATUS
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
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
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
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
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
J3:
DEC
JNZ
JMP DEC
J4
DISK_CHANGE
JNZ
JMP
J'
FORMAT_SET
AH
R 01
MOV
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
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
; ------ 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
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
C3
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
READ COMMAND fOR DMA DISK READ CONT SET ijp THE OMA SET UP READ COMMAND fOR NEC CONTROLLER GO 00 THE OPERATION
DISK_READ
BO
1~2
EB F5
MOV JMP
J9
ENOP
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
. - --- ------------------------------R~COPN
J NC MOV MOV RET
----
kW~OPN --P~OC--
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
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
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
R13:
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
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
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
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
ANO
eMP
JNE ,.IOV
JMP
R16:
CMP
JNE
MOV
JMP
R17:
R15:
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
; ;
;------ 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
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
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
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
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-
GET
01 REeT I ON OK
DECREMENT COUNTER REPEAT TIL DELAY F!NISHED
ell
;8
80 OE 0041 R 80
59 5A 58 C9 C3
ex
03FF
01100 01101 0402 011011 01 104 0406 0 1106 0407 0409 040B 040D 040F
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
J26:
EC
A8 80 75 OB E2 F9
IN TEST JNZ LOOP DEC JNZ JMP J27: MOV MOV MOV OUT POP POP POP
FE CB
15 F3 EO E4 8A C4
[\2
Dl.
J25 J24 AL,AH DX,03F5H DL,OF5H OX,AL
F5
11
EE
,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
; 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
H~
CNTRL, DUAL
Ji8
BH, BH
BL,DL DSK_1RKIBX),O
;ET
UP ADDRESSING TO STATE
INDICATOR
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
~ET
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
CALL
MOY
CALL
MOV
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. ,
; ----- 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
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
TEST
JZ
HF_CNTRL. DUAL
RB RB
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 ;
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
OUTPUT
{AX 1
ANO AOO
JNG
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
ANO
OUT
AL,OFH OB1H.AL
BA E6 2A CO 01 E8
AH.oH AL.AL
AX,l AX
50
BB 0006 E8 0382 R BA CC
PUSH
MOY
CALL
MOY POP SHL
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
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
0042 R 60 60 02
J34:
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
e3 ;
RET
CHK_STAT_2
[NOP
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
~;
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
J37 J36
BL
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
ex
BX AX
I NST
INTERRUPT
;
; OUTPUT
NONE
THE I NTERRUPT FLAG I S SET \ S SEEK_STATUS
DISK INT 1
0574 0576
0578 0578
STI
PliStl PUSH
PROC
FAR
os
AX
CALL
OR MOY
ouT
MOY INT
POP POP IRET DISK_INT_l
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 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
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
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
0597
Diskette 5-97
0599
75 FO
80 DE 0041 F9
R 80
JNZ
OR
05913
O')AO 05AO O';:'{'1 05A2 05A3 05A4
J40: STC
POP POP POP
5B 5A
59
C3
8X OX CX
[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
DEC JN7
JMP
BE
Rl0 J41
59
C3
BX OX CX
RET
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
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
I F rOUND TO BE
C6 87 0090 R 61
MOV
DSK_5fATE(BXL POA_DUAL
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
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
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
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
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
EC A8 80 C3
RET
; ;
IN rEST
; ; ;
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
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
$+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
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
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
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
$+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
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
50
E8 0604 R 74 2 C6 06 0041 8B 56 00
READ_DSKCHNG
;
;
53
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
; ; ;
IN 102M DRIVE
e3
FE c8 75 06
$2:
OEe JNZ
MOY
Al Sl
; ;
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
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
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
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
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:
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
5-100
Diskette
07[[3 07EC
07ED 07FO 07 F2
85 OA H F6 rE CD 5A 52
MOV
XOR
SUP3: D[C
POP
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:
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
43
83 FB 02 7l.J 03 E9 07AO R
JE
JMP
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
KEEP STACK CORRECT 082C 082F 0831 0834 0835 0835 E8 03E2 R 8A 2 [8 03[2 R C3 SUP5: CALL
Mav
CALL
RET
Diskette
5-101
5-102 Diskette
TITLE FIXED DISK BIOS FOR PUBLIC PUBLIC PUBLI C EX'rRN EXTRN EXTRN EXTRN EXTRN EXTRN
; --
F1I80:NEAR F1781:NEAH F17f12:NEAR r1790: NEAR F1791: NEAR FD TBL:NEAR I NT 13 --------------------- ---- ----- - - ------------- ---- -- ---
FIXED DISK I/O INTERFACE THIS IIHERrACE PROVIDES ACCESS TO 5 1/1\" FIXED DISKS THROUGH THE IBM F1XED DISK CONTROLLER. TilE BIOS ROUTINES ARt: MEANT TO BE ACCESSED THROUGH ANY ADDRESSES PRESErH IN SOFTWARE INTERRUPTS ONLY. THE liSTINGS ARE INCLUDED ONLY FOR COMPLETENESS, REfERENCE. APPLICATIONS WHICH REFERENCE NOT FOR ABSQLiJTE AOORESSES WITHIN THE CODE SEGMENT VIOLATE THE STRUCTURE AND DESIGN OF BIOS. 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
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
OOAA
0080 0040
SENSE fAIL NO_ERR WRITE FAULT UNDEr-ERR NOT ROY TIME OUT BAD SEEK
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; -
(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
HF PORT Hf::::REG_POHT
[au
[OU
01 fOH
3 f6H
01 SK PORT
, 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
= 0002
== 0004
=-
0001
== 0010
= OOIjU == 0080 = 0010 == 0020 - 0030 == 0040 = 0050 = 0060 = 0070 == 0090 = 0091 = 0001 = 0002 = 0008
== OOAO = 0020 = 0020
~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
= 0100
;:; 0008
DELAY FOR or COMPLETE DELAY FOR READY DELAY FOR DATA REqUEST CMOS FLAG J N BYTE OEH TO INHIBIT DISK I PL
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
DISK~SETUP
ASSUME 2B CO BE CO FA
SUB MOV
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
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;
CLI
IN AND oaT STI RET
**
**
CALL CALL
MOV JMP
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
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
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
70
00 71
DB
EO
8f
IN OR MOV MOV
OUT
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
RET
CLC RET ENDP ENDP
0197 0197 019A 019C 019E 019E 01Al 01Al 01A2 01A4 01A6
0111B
FA 80 73 05 CO 40
CMP
JAE I NT
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)$
ex
DX ES
06 56
57 OA 75 62 E-8 50 B8 BE
Fli 02 80 0212 R
---- R 08
A5:
MOV
CHECK FOR RESET FORCE DR I VE 80 FOR RESET PI:.RFORM THE OPERATION ESTABL I SH SEGMENT
5-106
Disk
58
POP
MOY eMP eMe POP
AX
8A 26 0074 R 80 FC 01
f5 5F 5E 07
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
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
R
R R R
0333 R
0204
0206 0206 020A 020G 020E
LABEL OW OW OW OW OW OW OW OW OW OW OW OW OW OW
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
EOU
0212
021.3
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
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
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
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
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
**
**
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
R 00
ORE: OR ERR:
RET RET
06 0074 R 05
MOV
DISK_RESET
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
RETURN_STATUS
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
; 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
DISK_VERF
------- ----------------------------------------=
fORMATTING (AH
005H )
06
53 8 0684 R 26: 8A 47 OE A2 0043 R 5B 07 E9 0500 R
= 005H)
'5 BX
GET 01 SK PARMS ADDRESS GET SECTORS/TRACK SET SECTOR COUNT I N COMMAND GO EXECUTE THE COMMAND
CMo_OF
; ;
031 19 0349 0349
-------------------------------------READ OASO TYPE (AH = 15H) --- --------------------------------------------LABEL PROC OS NEAR FAR ; ; GET DR I VE PARAMETERS SAVE REG I STERS
---------
lE
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
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
58
0"(
POP
PO? POP
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
06
53 213 CO
BE 08
TEST
JZ
L ES
JMP
GO; Gl;
----
LES ASSUME
MOV MOV SUB
eMP
JAE MOV MOV SUB MOV
25 0300
01 01 EB EO OE
ANa
SHR SHR 01< MOV
26: OA 41
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
56
07
ex
ES OS
lf
CA 0002 G4;
e6 06 0074 R 07
BII 2A 213 213 07 CO 02 C9
eET PARM
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
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
213 CO
A2 001j5 R E8 051J4 R
15 08
E8 05DF R 75 03 E8 061 E R C3
CALL
INIT EXIT:
RET INIT_DRV
READ l.ONG
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)
C6 06 0048 R 32 E9 04FB R
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
o I SK_SEE~OV
04liD
044E
; ;
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
--- --------------------------------------------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
**
88 26 0074 R C3
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
5-110 Disk
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
EE
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
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
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
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
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
ex,cx
MAKE SURE I NTt::RRU PTS ARE ON SEI INIIIAL DELAY BEfORE TEST DEVICE WAIT INTERRUPT
wn
AX,9000H 15H
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
W12;
w-rx;
WT3: 'riAl T
HF INT _FLAG,BOH WTl WT2 BL WT1 SHORT 1413 DISK_STATUS1,0 HF INT _FLAG,O DISK_STATUS1,O
TEST FOR
INTERRUPT
RET
MOV JMP ENDP
<':6 06 0074 R 80
Ea F3
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
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:
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
B9 BA Ee A8 75 E2 C6
0100 01 f7 08 09 f9 06 0074 R 80
WCL1:
CX,DELAY_3 ox, Hf_PDRT+7 AL,OX AL, ST_DRQ WCLOK W<L1 DISK_STATUS1, TIME_OUT
F9
C3 FB C3
STC
RET
WCLOK: WAIT_DRQ
~
bHECi(~S;:~i~~----PROC----NEAR--------------------E8 75 A8 74 E8 0630 R
07
01 03 0664 R
80 3 0014 R 00 C3
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
}~~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
MGV
RET
CHECK_ST
0664 0664 0667 0668 0668 066c 066F 0671 0673 0675 0678 061A 0670 0681 0682 0685 0686 0687 068B 06aF
; -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
..Ie
CK2:
CKEX:
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 ;
-~~~C~,~~b~~ ~~gM~N~Eg~~~~L~.MAKE
; -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
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.
77 72 3A 72
F8
06 07 C3 03
eKOOK: CKDERR:
JA
JB
eMP
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
[NOP
~ -;ET-uP-Es~B~=:D~sK-P;RMs------
0684 0684 0686
bET:VEC-;ROC----~E;R- -----------28 CO BE CO
F6 C2 01 74 07 26: C4 lE 0118 R EB 05
26: C4 lE 0104 R
ES:BX
C3
06CA
. -------------------------------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
INTERRUPT
$+2
OS
E6 20
1F
POP
FB
B8 9100 CD 15
Mav
ST'
.NT
POP
AX,910011 15H
AX
06E5
06E6 06E7
58 CF
HD_I NT
IRET ENDP
06E7 06EE
06EE
31 2F 31 31 2F 38 34
DB
RELEASE MARKER
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
FAR
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
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:
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 :
CLl
MOV CMP PUSH PUSHF CALL MOV
53
9C E8 8A 32 80 74
al18A R 1 0097 R 08 E3 07 011
.X
XOR
AND JZ CALL K1A:
E8 044C R FA 90
5.
74 00 86 07 8 007F R 89 lE OOlA R
.X
K1 AX,lBX)
K4 BUFFER_HEAD, BX
5.
1F CF
BX
OS
; ------ 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
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
IN LI ST
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
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
; ------- 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
J E
; ;
JNZ
; ;
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
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
58
8A EO
JNZ
JMP
"'6 "6>
; ------ TEST fOR SH I FT KEYS OOEl OOEl 00[3 DOEll K16: AL,07FH
CS
24 7F DE
07
AND rUSH
POP
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
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
i9 OlEC R
JMP
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
K16A:
MOV MOV
RE PNE
MOV JF JMP
K17 K25
K17:
SUB MOV
rEST
JZ JMP
ADJUST PTR TO SCAN CODE MTCH GET MASK I NTO All TEST fOR BREAK 1<EY BREAK SH I FT FOUND CON11NUE
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
OR JMf'
KB FLAG, AH K26
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
,0
56
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
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
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
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
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
ex
BX AX BP
OX
I RET
RETURN,
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
01 FE
K29: F6 06 0017 R 04
7~
3C
53
31
75 20
; 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
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
K31 :
3C 39 75 05 BO 20 E9 0375 R
AL,57 AL '
'32
K57
NO-RESET TEST FOR SPACE KEY NOT THERE SET SPACE CHAR BUFFER_fI LL
0242 0245 0248 024A 024C 0250 0253 0255 0257 0259 025C
MOV MOV
REPNE
JNE
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
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
AL,59
73 03
K36: E9 01 E2 R K37:
.37 .26
AL,71
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
F6 06 0017 R 04 7 1, 62
TEST
JZ
KSJlAG, CTL_SH I FT
ARE WE
'44
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
0283
0285 02B8 0288
BO E8 CO 28 E9
co
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
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
F
TEST JNZ JMP KB FLAG 1, HOLD STATE K40A K27A
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 --
3C 75 88 E9
37
06 7200 0375 R
; ; ;
; ------ 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
3C OF 75 05 88 OFOO EB 68 K45: 3C 37 75 10
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 ;
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
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 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
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 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
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
Keyboard
5-119
K56: fE C8 2E: D7
XLAT
DEC
AL
CS: K11
;------ 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
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.
; ------ 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
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~
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
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
50 53 51
SA f8 B3 03 FA 80 26 0097 R Cf
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
SOl:
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
SD2:
DEC JNZ
OR
8l
SOD
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.
DIns
0436
0437 0 1138
0439
59 5B 58 e3
RET
SNO_DATA ENDP
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
eLi
TEST JNZ
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
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
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
28 C9
ell SUB
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
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
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
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
AX DX,AL OX
SAVE VALUE TO PRI NT OUT PUT CHAR TO PORT POI NT TO STATUS PORT
53
EC A8 80 15 05
PUSH
IN TEST JNZ
MOV INT
CLEAR BH MULT BY 4
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
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:
60 00 42 EE BO OC EB 00
ox
EE
58
AX
SAVE AL REG
8B 94 0008 R
UX,PRINTI:.R_BASE[SIJ
Printer 5-123
42
EC
SA EO 80 E4 F8 B7:
5A
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
50 42 42 BO 08
EE
B8 OFAO B9: 48 75 FO BO OC
EE
AX
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
- 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
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
OX
ex
BX
SI 01
JZ
OR
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
8A EO 83 C2 03 80 80 EE
ADD
MDY
OUT
;------ DETERMINE BAUD RATE UIVl50R 003A 003C 003E 0040 8A 81 02 81 04 C2 1:2 DOOt:
r~ov
0"
MOY
RDL AND
RS232
5-125
0054
0056
0059
MOY
ADO
MOV
BASE OF TABLE PUT J NTO J NOEX REG I STER POINT TO HIGH ORDER OF DIVISOR
INC
MOV
OUT DEC JMP
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
42
B7 30
E8 DOCS R 74 06
0076
0079 0076
ox
OX
BH,30H WA I T_fOR_STATUS
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
OOAE
00B2 0063
ox,
JMP
OOBA OOBO
OOBE
8A EO
OOCO OOCl
OOC2
42
EC
E9 002B R
,
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
FOR,
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
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
5-126
RS232
includes are
postequ,src,
dseg.src
0000
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
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
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
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
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
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
NONE
----
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
83 C2 04 8A e3
EE
5A
28 CO 8E 08
POP SUB
MOV
C5 1E 0074 R
58
ASSUME LOS
POP
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
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
AX
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
32 E4
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
EE 43
4A [2 58
INC
OEC
f3
0005
0006
LOOP POP
POP
"'0
DS
OX
IF
;-~----
ASSUME
OS; DATA
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
AH,7
M11
JE
XOR JMP
Mll:
MOV
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
ooro
; 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
E6 OOOE
ANa
SI,OEH
Video
5-129
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
07
33 CO f3/ A8
XDR REP
ES AX,AX STOSW
,,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
0141, 0144 0145 0146 0141 0148 0148 0149 014A 0146 014C 0140
50 5F
"
5. 59 5A
IF
13P
01 SI BX
ex ox
OS
07 eF
ES
ENOP
SFT_MOOF
;
; ; ; ;
IRET
CL-STOP LINE
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
;------ 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
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
ox BH -
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
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
M18
E8 88 03 01 84 E8
C3
0211 R C8 DE 004E R F9
OE 0158 R
M18
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----------------
OlAC
OlAo
32 01 88 88 50
5F
8A OF FF
E3 97 0050 R DE 0060 R
5E 58 58
l:i.l10
58 1F 07
CF
POP
por
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
A2 0062 R
8S DE 004C R
01Bo 01B
OlCO
98 50
F7 [1
A3 004E 8B C8 01 F9
PUSH
MDL
ex
CRT _START, AX
B4 E8 58 01 88 E8
DC 0158 R
3 87 0050 R 0180 R
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
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
83 C2 05
AD 0066 R OA FF 75 OE
ADO
MOV
OR
JNZ
H20
I/O PORT FOR PALETTE OVERSCAN PORT GET THE CURRENT PALLETTE VALUE IS THIS COLOR OUT PUT COLOR 1
a?
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
01f2
A2 0066 R E9 0144 R
MOV
JMP
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
BP 01
POP
POP
JMP
ex
SI
roll 5
ENDP
VI OED_STATE
;
;
POSITION THIS SERVICE ROU1INl CALCULATES THE REGEN BUFFER ADDRESS INPUT OF A CHARACTER IN THE ALPHA MODE
AX
= ROW,
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
021!, 0216
021A 021C
FF
C3
XOR
ADD
01 EO
*"
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:
IN BH
JZ ADO
MOV
SUB
CALL
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
; ----- 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
OX,3DAH
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
N10
ENDP
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
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
FD E8 0303 R 80 FC 04 72 08
PROC AH,4N12
NEAR
a I RECT I ON
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
CMP JE JMP
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
"'0
58
SO 20
N15: 8 02BF R ?R FO FE CB
RECOVER ATTRIBUTE
IN AH
75 F7
9 0257 R
01, BP
BL N15 N5
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
MAL,OH AL,CH
Bl SET
IN[
SUB
C3
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.
80 72 80 74 E9
FC 04 08 FC 07
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
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
80 72 80 74 E9
FC 04 08 FC 07 03 0588 R
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
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
OI,BX
BX
0376
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:
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
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
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 :
OI,BX
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
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
page
WRITE STRING -ThiS routine writes a
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
WD:
eMP JB JMP OR
wo
W1
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
ex
BX
5-134 Video
50
06
86 EO 26: 8A 46 00 45
AX ES
PUT THE WRITE STRING OPTION INTO AH GET CHARACTER FROM INPUT STRING BUMP PO I NTER TO CHARACTER
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
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
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
72 1'1
rr c6
2A U2
JB INC SUB
eMP
COLUMNS SET
-
80 FE 19
72 OB
JB
PUSH PUSH MOV I NT
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
AX
58
E2 98
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
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
RICHT JUSTIFIED,
READ ONLY
04SE 045E 0461 0464 0466 01 168 0116A 0116C 046F 046F 046F 0471 0474 0476
0!~78
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
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 :
OR MOV
POP JMP
26: 88 04 58
E9 01'111 R
R2;
32 Cl
XOR
Video
5-135
01190 0492
EB F5
JMP
R1
[NDP
WRITE DOT
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
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
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
CH,DL
;------ DETERMINE BYTE OFFSET FOR THIS LOCATION 04BF 01lC1 04C3 03 EA 03 F2 8A n
SHR ADD MOV
; ; ;
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
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
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
28 81 DO DO
01 C2 0101 E6 E6
SUB ADD
SAL SAL
ADJUST VALUES MULTI PLY # ROWS BY 4 SINCE 8 VERT DOTS/CHAR AND EVEN/ODD ROWS
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
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
[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
.,
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
MOV MOV
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
;------ 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
80 3E 0049 R 06
0547
73 05
CMP JNC
;------ 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
;------ 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
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
56
57 /:SA (;A F3/ A4 5F
059F
05AO 05A2 OSA4 05A5 05A6
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
OSA7 0'>A7 05A9 05AA 05AC 05AD 05B1 05B2 0584 05B6 05B7 05B8
PROC
MOV
PUSH
REP
PDP ADO
Mav REP
PUSH
POP
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
84 00 50
;------ DETERMINE REGION TO GET CODE POINTS FROM OSCQ 05C1 05C3
58
3C 80 73 06
POP
CMf'
JAE
; ; ;
EB OF"
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
2B F6 8E DE CS 36 OU7C R 8C OA
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
03 FO 80 3E 0049 R 06
1f "!2 2C
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
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
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
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:
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
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
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 -
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
06
1F
72 lA
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
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
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~
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
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
3C 74 2B BE C4 8C OB 74 60 B
00 12 CO 08 3E 007C R CO C7 04 80 CE
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
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
ex
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
; ; ; ;
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
------------- -- - -- ---------- ----- - -- --- -- -- - --- -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
PROC
MOV MOV MOV MOV
0720 0730
0732 0732 0734 0735 0737
82 00
S24: 85 C1 F8
711
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
[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
08
SA C4
F6 26 Q04A R
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
50 50
B4 03 BA 3E 0062 R CD 10
o r~ ~
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
on8
077B
0776
B4 OA B9 0001 CD 10
MOV MOV I NT
AH,lD CX,1
lOH
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
TEST FOR COLUMN OVERFLOW SET CURSOR COLUMN FOR CURSOR SET_CURSOR_I NC
CMP
JNZ
U6
lJ1:
MOV I NT
AH,2
lOll
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
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
ex,cx
OL
601 H
PTR CRT_COlS
omo
INT
1011
AX VIDEO RETURN
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
=-
;----- 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 :
DH,24
u6
U1
BOTTOM Of SCR[EN YES, SCROLL TIl[ SCREEN NO, JUST SET THE CURSOR
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
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
(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
Mav Mav
MDV OUT
AH,16
INPUT REGS POINTED TO BY AH, 07F9 07FD 07FF 0800 0802 0603 0804 0806 0807
88 16 0063 R 8A C4
EE
EB 00
42 EC 8A E8 4A FE C4 8A C4
JI1P INC IN
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
"
0812
0816
0818 0810 081f 0823 0825 0827
eX,l
AX,BX
0829
79 O? 28 CO
JNS
SUB
V2
AX,AX
0826
082'B 0820
OB32 OB34
0839
JB
CMP
V4 V4
DETERM I NE !<lOOf SET *8 SHIFT COUNT DETERMINE IF GRAPHICS OR ALPHA ALPHA_PEN ALPHA_PEN
JE
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
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
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
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
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
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
BP
DI 51
as
OS
POP
POP
os
OS
0885 0885
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
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
; --- 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
PROC
>
oooe
0013
OOOA OOOB
FB 1E
E8 0000 E Al 0010 R 1F CF
os
DDS
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
NMI
.
INT 1 PROC
-ASSUME
50
E4 FE EB EG 80
CO
00 80
PUSH IN INC
JI~P
OUT
E4 61 A8 CO
IN TEST
BIOS
5-143
8A EO 75 03 E9 OOCl
AH,AL NMI 1
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
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
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
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:
"NZ
ell
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
OX,OS PRT SEG AL, T{' PRT ttEX AL TS' PRT HEX AL, T) I
PRT~HEX
ell
HLT 014: MOV
OUT
BO 8F E6 70 EB 00
OOC7
OOC9 DOCS ooce OOCD
80 Of
E6 70
JMP MOV
OUT POP
58
CF
------------------- - --- ------------------------------- - --------THIS ROUTINE INITIALIZES THE TIMER DATA AREA IN THE ROM BIOS DATA ARfA. IT IS CALLED BY THE POWER ON ROUTINES. IT CONVERTS HR:MIN:SEC FROM CMOS TO TIMER TICS. IF CMOS IS INVALID, TIMER DATA IS SET TO ZERO. ) NPUT NONE PASSED TO ROUT I NE BY CALLER
CMOS BYTES USED FOR SETUP 00 02 04 OA OE OUTPUT TIMER LOW T!MER-HIGH TIMER-OFL ALL REG I STERS UNCHANGED COUNTS SEC COUNTS~M I N
COUNTS~HOUR
IN PROGRESS)
0012 0444 0007 0070 0071 OOOE 0000 0002 0004 OOOA = 0080 OOCO
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
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
READ_SEC:
MOV OUT JMP IN CMP JA
3C 59 77 40 E8 0176 R
B3 12
GO
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
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
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
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
POD_DONE: E4 21
24 F. FE CLI IN AND OUT STI POP
**
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
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
+ ??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
IN AL
4
AL,orH ENor RESULT IS IN AX CONVERT UN PACKEO BCD TO B I NARY
211 Of
05 OA
C3
RET
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
. - - - -------- ------ -------------------------- -- --------------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
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
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
; RETURN
1E
E8 0000 E
F6 06 OOAO R 01
74 04
1F F9 EB EC
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
0076
007A
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
a08A
0089
ooec
008E 008 F 0091 0092
80 DB
Ff1 70 58 E6(1 FB 1F EB BA
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
01
00C8 R 02 OOGB R
MOV
OOM
0082 0083 00B5 00B8
CALL PUSH
MOV
ex
BL,2 TEST_CORD
VALUE VALUE
CALL PUSH
MOV
ex
BL,4 TEST_CORD
00139
04
OOCB R 08 01
aaBF
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
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
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
;
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
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
ADJUST
FR
BA 0201
51
50
PUSH PUSH
~10V
ex
AX
69 04 f F [C A8 Of EO FB
58 59 5A C3
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~{
1F
F9
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
'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
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:
= =
1.
2.
7. 8.
3. 4. 5. 6.
9.
~age
;
-_.--------------------------- ---------------------------------14.
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
or
1----------------1 1----------------1
I I I I
I
TARGET GOT BIOS CS 55
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
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
BLOCKMOVE_GDT.OEF ;
--------------------------_.----_._-------------------------------._--
5-150 BIOS 1
PROC
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
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
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
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
01B7
0187 01B8 01l1A
ORe
DB AUU
alBC
FE C6
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
BD 02Al 2E OF 88 5E 00
cs
O?lH
LI DT
[131']
OOFH BYTE BX,WORD PTR [BPj BYTE OFFSET CS:??Q007 00111 OFFSET CS; ??0008
REGISTER
+
+ ??O007
DB
+
+ ??0008
+
01
0107 OIDA
010A
26 OF 8854 08 01 + +
alOe
010B
+ +
+
; -------' 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
;-------- 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
; ;
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
+ ??OOOC DO EE CO
+
+ ??ODOD
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
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
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
88 74 89 44 C7 44 c6 44
2C 2A
BU:
28 FFff
20 93
; -------- STACK
--->
OZOF
0214 021A 0220 0225
C6 C7 C7 C6 C7
4!~
44 44 44 44
24 22 20 25 26
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
+ +
OW
OW VI RT:
;------- SET STACK SEGMENT 0236 0239 B8 0028 BE DO MOV MOV AX, TEMP 55 SS,AX -
;------- 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
REP
MOVSW
;------- CHECK FOR RAM PARITY BEFORE SHUTDOWN 02413 0240 024F Ell 61 24 CO "(4 lC
IN
AND
JZ
;-------- 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
24 F3 E6 61
OUT
=========-==="'===-=='" ;-------::. RETURN FROM SHUTDOWN 0270 0270 0272 2A CO E6 70 SHUT9: ;------- ENABLE NMI SUB OUT INTERRUPTS
AL, AL CMOS_PORT, Al
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
POP
OS
5-152
BIOS 1
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
eM'
"" 0100
D2Al
EQU
32*8
INTERRUPTS
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
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
'1
BIOS 1 5-153
030B
U3UC 03UO
00
nges)
08 08
OW
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
gates when
PL cha
CB
II
copy (on I y
gates when
PL cha
PL cha
PL cha
PL cha
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
03BO 03BO 03B1 0384 03B6 03B8 03BA 0313D 03SF 03C1 03C3
GATE A20
FA
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
03C7 03C? 03C8 03CA 03CA 03CC 03CE 0300 0301 0302
51
2B C9 E4 64 24 02 EO ~A
ex
cX,ex
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:
------ ;~~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
BIOS 1 5-155
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
-;;->
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
1 1
1 1 1----------------1
lOT
I 1
1 1 1----------------1 1
I
SS
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
X VI RTUAL SET_VMODE:
eLi
;------- ENABLE ADDRESS LATCH BIT 20
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
J7 MOV
STC I RET
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
ES
26
OF
DB
+ + ??0015
t-
8B 54 08
+ ??0016 +
01
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
8B 5C 10
+ + ??0018 + + ??0019 +
DB
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
0 /102 0404
01~O6
JMP MOV
OUT
Mav
aUT
JMP JMP
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)
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
~ -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;;------------------------------------------
; 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
~ -;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
88 8E B8 6E B8 BE
ES.N<
AX. USER_55 SS,AX
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
bE~~CE:B~S;-----PROC----NEAR------------------------------------
F8
E9 004f R
CLC JMP oEV ICE_BUSY INT_COMPLETE IRET I NT_COMPLETE CODE ENDS ENO
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
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
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
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
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
JZ
JMP
9 0007 R
RIC-' PROC
NEAR CHECK FOR UPDATE IN PROCESS GO AROUND I F OK RETURN I F ERROR I NTERRUPTS OfF DURI NG READ
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
SET ADDRESS OF SECONDS SAVE SET ADDRESS OF MINUTES SAVE SET ADDRESS OF HOURS
BIOS 2 5-159
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
inc
E8 0187 R 73 03 E8 019A R FA
JNe
CALL
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
T1
ENOP PRoe NEAR
; DONE
OOA9 OOA9
QQAe OOAE
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
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
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
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 -
82 E6 E4 A8 74 33 E9
OA 0163 R 71 20 05 co 0018 R
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
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
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
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
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
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
FAR
OS
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
or
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
END OF
I NTERRUPT TO 8259 1
AND TO 8259 -
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
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
2B A3 A3 c6
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
OUT
POP POP POP I RET TIMER
5A 5.
ox
AX
eF
1F
OS
- 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
CS;CODE,DS:XXDATA
0278
0280
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
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
0292
0293 0295 0297
SA CC 05 19 ER 02E7 R 51
B4 03
CD 10
59
52
cx
ox
0298
0299
33 02
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:
AH,2
B4 08
CD 10 OA CO 75 02 BO 20 PRJ 15:
MOV
>NT
OR JNZ MOV PUSH XOR
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
"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
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~
ex
ox
02E7
02U 02(9
02E~
CRLF 33 02
PROC
eo
32 Ell OA
XOR XOR
MOV
LF
SEND THE LINE FEED NOW FOR THE CR CR SEND THE CARRIAGE RETURN
CD 32 110 CD C3
17
E" 00
>NT XOR
MOV
INT RET
17H
AH,AH AL,15Q 171-1
17
CIlLF CODE
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
; THIS MODULE HAS BEEN ADDED TO FACILITATE THE EXPANSION OF THIS PROGRAM. ; IT ALLOWS FOR THE fiXED ORG STATEMENT ENTRY POINTS THAT HAVE TO REMAIN ; AT THE SAME ADDRESSES. ADDED ON 9/16/82 ;
; COPYRIGHT NOTICE
0000
36 38 2E 31
31 20 20 39
38 43 49 38
31 30 32 4F 50 52 42 40 20 34
; +++++++++++++++++++++++
~OSE
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
Board Error',13,10 ;
INTERRUPT FAILUE
EO_A
DB'
EO_B
30 34 74 65 61 72 72 6F 30 74 61 72 35 65 72 6F
VIR_ERR
DB
CM4
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
OOFC
01 DC
011C
0137
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
; 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
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
F30l
DB
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
KEYBOARD ERROR
LOCK
is Locked', 13, 10
KEYBOARD LOCK ON
F1_A
72
65 74 72
5-166 ORGS
021F
0234
F3
DB
DISKETTE ERROR
CM1
DB
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
4[ "{II 20 29 36 65 74 20 52 54
0286
CM3
DB
; ; 02AC 02AC 02A[ 02BO 02B2 PR \ NTER TABLE LABEL OW OW OW LABEL WORD 3BCH 378H 278H WORD
F4
03Be 0378 0278
F4F:
= 02C3
02C3 02C6 [9 0000 E
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
02DF
20 79 42 45
OA
31 30 37 20 73 74 65 60 6F 61 72 64 72 72 6F 72
DB
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
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
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
0393
03A8
fl/S1
DB
'1781-Disk 1 failure'.OOH,OAH
0380
F1782
DB
030n
F1790
DB
03EE
OA 31 37 39 31 20 44 69 73 6B 20 31 20 45 72 72 6f 72 00 OA
f1791
DB
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
(3 (1 (1 (1 -
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
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
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
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
09000
150 0
OFFFFH
0488
00
5-168
ORGS
06
00 00 00 0385
11 00
DB DB OW 08 DB
008H
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
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
****
****
00 0000
0000
00 00
00 00 00 0000
00 00
OW DB OW OW DB DB DB OW DB DB
BOOT_STRAP
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
768
384 192
96
48
24 12
ORO ORG
KEY60ARD_IO
EOU JMP
OE82EH 0082EH
S
KEYBOARD_I 0_ 1 OE87EH 00a7EH
087E
ORG ORG
ORGS
5-169
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
K8
DB
DB
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
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
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,'
25
5F
59 70 46 4B 4C 3A SA 58 43 40 3C 3E FF 20 FF
U943
',-1
0955
K12
0955
095G O')')f 095F 1 096 1 0969
5 11 5A
55 56 57 58
59
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
S
KB_I NT_'
OC59 = OC59
DISKETTE_IO
OEC59H OOC59H
OC59
E9 0000 E
JMP
;-------- DISKETTE ORG
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
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
25 02 OF 1B FF 51. F6 OF 08
DB DB
DB DB DB DB DB DB
MOTOR WAI T
2 15
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)
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
Eau
lOBB
lOCO lOC4 lOCB 1000 1004 10DB 10EO 10ELI 10E4 10E6 10E8 10EA 10EC lOEC
013
DB
38 28 20 OA "IF 06
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
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
ORG
MEMORY S / ZE DI:..1 J:.KM I NE JMP
ORGS
5-171
eo
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,
DB
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
DB DB
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
DB DB DB OB DB DB DB DB
18H, 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
DB DB DB
DB
D_2A
+ D_26
,D_<'C
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
DB
5-172
ORGS
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 ;
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
cc
DB DB
08
DB DB DB DB DB DB DB DB DB DB
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
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
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
L.C. N D_6E
L.C. LC.
0_6f
DB
P o_70
ORGS
5-173
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
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
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
OFEA5H 01 EA5H
EQU JMP
; -------- VECTOR TABLE
TIMER_INT_l
1 EF3 1EF3
ORG ORG
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
R
R E E E E R
OW
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
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~
Ow ow Ow
OW OW OW OW OW
; ------- DUMMY
I NTERRUPT HANDLER
ORG ORG
OFF53H 01 F53H
OUMMY_RETURN CF ; -------
EQU
IRET
PR I N r SCREEN
ORG ORG [QU
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
RESEr
DB DRC
CODE
DB ENDS END
pc's
10
ORGS
5-175
5176
ORGS
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
Notes:
Data Transfer
MOV
= move
Register to Register Memory mod reg r/w
10001 OOW
1100011w
data if w = 1
1011wreg
I data
Immediate to Register
I data if w = 1
I addr-Iow I addr-Iow
I addr-high
Accumulator to Memory
1010001w
I addr-high
ister 10001110
PUSH = Push
Memory 11111111 modl10 r/w
Register 01010reg
Segment Register
Immediate
I data if
5 =
I 01011 reg
Register
I 000regl11
I 01100001
Pop All
XCHG
= Exchange
Register Memory with Register 1 mod reg rim
1000011w
IN
= Input From
Fixed Port 1 port
1110010w
OUT
= Output To
Fixed Port port
1110011 w
XLAT
= Translate Byte to AL
Translate Byte to AL
111010111
LDS
= Load Pointer to DS
Load Pointer to OS 1 mod reg rim mod", 11
11000101
I 11000100
I 10011111
110011110
PUSHF
= Push Flags
Push Flags
1 10011100
10011101
Arithmetic
ADD = Add
1 oOOOOOOw
Reg/Memory with Register to Either
100000sw
data if sw = 01
1 0000010w
I data
Immediate to Accumulator
I data if w = 1
000100dw
100000sw
data if sw = 01
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
I data I data if w = 1
I data if sw = 01
I 000110dw
100000sw
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
Data if sw = 01
I 0001110w
I Data if w = 1
I modOll
rim
I 00100111
I 00111111
DAS
I 00110111
I 1111011w I mod100
I mod101
Multiply
rIm
rIm
I mod reg
rIm
! Data
! Data if s
=0
rIm
rIm
AAD
CBW
110011000
CWD
10011001
Logic
Shift Rotate Instructions
Register Memory by 1 1101000w 1 modTTTr/m
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
1000000w
Data if w = 1
I 0010010w
Data
I Data I Data if w = 1
I Data if w=1
Or= Or
Reg/ Memory and Register to Either 000010dw mod reg rim
I Data I Data if w = 1
I Data if w = 1
XOR = Exclusive OR
Reg/Memory and Register to Either 001100dw mod reg rim
I Data
I Data if w = 1
I 0010010w
I Data if w = 1
I mod01O rim
String Manipulation
MOVS
I 1010010w
CMPS
11010011w
seAS
I 1010111w
11010110w
11010101w
I 0110110w
OUTS
1 0110111 w
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
CALL = Call
11101000
I disp-Iow
I disp-Iow
11111111
I mod010 rim
Se
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
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.
I disp-Iow I disp=low
Short/Long
11101001
I disp-high
11111111
11101010
Se
Via call gate to same privilege level Via TSS Via task gate.
Indirect Intersegment
11111111
Via call gate to same privilege level Via TSS Via task gate.
11000011
11000010
Intersegment
11001011
11001010
JE/ JZ
I 01110100
I 01111100
I disp
I disp
I 01111110
JB/JNAE
I disp
= Jump on Less, or Equal Not Greater
Jump on Less, or Equal Not Greater
I 01110010
I disp
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
I disp
I disp
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
I disp
JNP / JPO
Parity Odd
I 01111 011
JNO
I 01110001
JNS
I disp
Jump on Not Sign
I 01111 011
loop
ex Times
11100010
1 disp
LOOPZ/LOOPE
1 11100001 1 disp
LOOPNZ/LOOPNE
1 11100000 1 disp
JCXZ
= Jump on CX Zero
Jump on
ex Zero
1 11100011
1 disp
11001000
1 data-low
1 data-high
1L
= Leave Procedure
Leave Procedure
111001001
INT = Interrupt
Type Specified
11001101
1 Type
Type 3
11001100
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.
1 11001111
Protected Mode Only To same privilege level To different task (NT = 1).
BOUND
1 01100010
Processor Control
CLC = Clear Carry
Clear Carry
11111100
CMC
= Complement Carry
Complement Carry
1 11001111
STC
= Set Carry
Set Carry
11111001
111111100
STD
= Set Direction
Set Direction
1 11111101
111111010
STI
= Set Interrupt
Set Interrupt
1 11111011
HLT
= Halt
Halt
111110100
WAIT
= Wait
Wait
110011011
111110000
CTS
1 00001111
1 00000110
ESC
10011TTT
modLLL rim
Protection Control
LGDT = Load Global Descriptor Table Register
00001111
I 00001111
I 00001111
I 00000000
I 00000000
I modOOO r / m
I mod011 r / m
STR
00001111
LMSW
100001111
I mod110rlm
SMSW
100001111
I 00000001
I 00001111
I 00001111
ARPL
I 00000010 I 00000011
I 01100011 I 00001111
VERR
I 00000000
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
If mod = 01, then disp = disp-low sign-extended to 16 bits, disp-high is absent. If mod
= 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
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.
Data Transfer
FLD = Load
ST(i) to ST(O)
ST(O) to ST(i)
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 ST(i)
Comparison
FCOM = Compare
Integer/Real Memory to ST(O)
ST(i) to ST(O)
1 escape 110
111011001
Constants
FLDZ = Load
I escape 000
FLDI ... Load
1 escape 001
Load
1 escape 001
111101001
FLDLG2
1 escape 001
FLDLN2
1 escape 001
Arithmetic
FADD
= Addition
Integer/Real Memory with ST(O) 1 mod 000 rim
1 escape MF 0
1 escape dPO
11000 ST(i)
FSUB = Subtraction
Integer/Real Memory with ST(O)
1 escape MF 0
1 escape dPO
1110r r /m
FMUL = Multiplication
Integer/Real Memory with ST(O)
1 escape MF 0
1 escape dPO
11001 rim
FDIV = Division
1 escape MF 0
1 mod 11rr/m
1 1111rr/m
FPREM
1 escape 001
FXTRACT
1 escape 001
FABS
1 escape 001
FCHS
1 escape 001
Transcendental
FPTAN = Partial Tangent of ST(O)
Partial Tangent of ST(O)
I escape 001
FPATAN
/11110010
-;- ST(1)
I escape 001
I 11110011
ST(O)-1
F2XMI = 2 ST(O)_1
escape 001
I 11110000
ST(1) x log
FYL2X
I 11110001
X
FYL2XPI = ST(1)
LogdST(O)
+ I] 2 [ST(O) + 1]
ST(1) x log
/ 11111001
Processor Control
FINT
= Initialize NPX
I 11100011 I 11100100
Initialize NPX
I escape 001
1 escape 101
FCLEX
= Clear Exceptions
Clear Exceptions 1 11100010
1 escape 011
I escape 001
I escape 101
FINCSTP
I escape 001
FDECSTP
I 11110111
I escape 001
I 11110110
Free ST(i)
I escape 101
I escape 001
I 11000ST(i)
No Operation 11010000
FNOP = No Operation
Notes:
Contents
Characters, Keystrokes, and Color ..................... 7-3 NOTES .................................. 7-13
Notes:
As Characters
"'V7Q"VftVO
vw,"v
,"v
00
Blank (Null)
Ctrl2
Black
Black Blue
02 03 04
2 3
06 07 08 7 8
+ ...
0
GI Cyan
Ctrl E
Black
Magenta
Normal
Black Black
Normal Non-Display
09 OA
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
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
""""''''y
...
1..
.
! !! IT
Blue Blue
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
1A 1B
26 27
Blue Blue
1C 10
28 29
L
+--+
Blue Blue
1E 1F 20
30 31 32
" Blank
Space
Ctrl6 Ctrl Space Bar, Shift, Space, Ctrl Space, Ait Space
21 22 23 24 25 26 27 28 29
33 34 35 36 37 38 39 40 41
!
"
!
"
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
2E
46
Note 2
Green
High Intensity
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
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
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
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
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
High Intensity High Intensity Normal Underline Normal Normal Normal Normal Normal
a b c d e f
a b c d e
f
99
1()() 101 102
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
As Characters Keystrokes g h i
J
k I m
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
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
z
{
I I
Light Green Light Cyan Light Red Light Magenta Yellow White
I
I I
7D 125
7E 7F
126 127
t:.
Ctrl -
Shift
White White
As Text Attributes IBM Monochrome Display Modes Background Foreground Adapter Color / Graphics Monitor Adapter
As Characters Keystrokes
.. . .
80 B1 82 83 B4 85 86 87 88 89
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
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
As Text Attributes
90 157
9E 9F
158 159
Pt
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
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
-------
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
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
III 184 R
185
Alt 186
Light Green Light Cyan Light Red Light Magenta Yellow White Black Blue Green Cyan Red Magenta Brown Light Grey Dark Grey Light Blue
h1
~
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 -
===
II
I~
CA 202 CB 203
Light Green Light Cyan Light Red Light Magenta Yellow White Black
--, r -
CC 204 CD 205
CE CF
206 207
:::;;:::
I
DO 208
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~~
!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
Magenta Magenta Yellow Yellow Yellow Yellow Yellow Yellow Yellow Yel Yellow Yellow
f3
Alt 225 Alt 226 Alt Alt 228 Alt 229 Alt 230
r
rr
EA 234 EB 235
n
{j
Note 6 Note 6
Yellow Yellow
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
ED
237
EE
238 239
Ii
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
F4 244 F5 F6 F7
F8
245
246 247
248 249
F9
FA 250 FB FC FD 251
Light Green Light Cyan Light Red Light Magenta Yellow White
252
253
FE FF
254
255
BLANK
Note 6 Note 6
White White
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.
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
+--+
I I
~
1)-
..
... /
M ] m } > N /\ n rv
?
DECIMAL VALUE
0 1 2 3 4
5
.
0 2 3 4 5
6
~
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'
Notes:
SECTION 8. COMMUNICATIONS
Contents
Communications .............................. 8-3 ........................ 8-6
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
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
" "
//
,',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
~ ...
" '"
"'"
--
@-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----
. +
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
________-'-------------.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
~
("')
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
r----i I Power I
Li
II II III
Data Termmal Read
Adapter
0
0
'--_--r --~
,-
Supply
----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
,
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
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
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
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
(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
Terminal
Adaple,
Ij
Host Modem Communications
U
Modem
II II
r-~:e;-i
: On
ir-=-=--=--=-==ll
Communications
Adapter
II
II II II II
-,
GI
0
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
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
dI u I , I aI I
M', o ,
r
--1
j
, I
.
I
_.J
Detector 1
Receiver
r---
1
'I
I I
Modem
; : 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
"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------
-..,
EOT
II II II II II II
II
i--l AA
I
I S I e I,
: d
I
, e , s
Transmitted Data
~f
II
II
\C
L.:::-===
==.:J
L':::====
B NOll::J]S
=:J
oc
Q
I .....
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
II
i~~ ~-A-n~~;,l
I u II Tone I
L____ JI
101
ED
Data Terminal
II II
r-l
0
0
:t I
10 1 Ia I
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
Transmit Data
10: 1'1
L-
II II II II II II II II II II II II II II
Transmit Clock
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
Uil
l_J
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
1 ISI e I , I d I I el S I l .J
L_C.!.o~"--J
II II II II II II II
Receive Clock
r -,
IsL I e I--
I I
II
~======~
t=ff
~ r
~!!I!~
B NOIlJ~S
L1J JI
I~
II
II
II
::J
Communications Line
Notes:
8-12 Communications
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
Compatibility 9-3
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.
Application Guidelines
The following information should be used to develop application programs for the IBM Personal Computer family.
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.
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.
9-12 Compatibility
;TYPE code in AL
INT hex 15 JCTIMEOUT
;issue call ;optional: for timeout or ;if carry is set, timeout ;occurred
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.
OCOh->OFFh
9-14 Compatibility
OlH
yes (2 sec) no
02H
OFDH
OFEH
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.
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
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.
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.
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.
Entry Points
# subsystems
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:
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. -
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
this section.
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
IBM will define methods for uniquely determining the specific machine type or I/O feature for any new device.
Compatibility 9-23
Notes:
9-24 Compatibility
Glossary
(-t.
(-ts.
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.
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.
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.)
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
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
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
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)
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
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
iAPX 286 Operating Systems Writer's Guide INTEL Corporation. 121960. 001
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
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
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
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
Contents
Volume 1
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
Cables and Connectors IBM PC Compact Printer Connector Adapter IBM Communications Adapter Cable IBM Personal Computer AT Communications Cable
viii
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 No Yes
Yes
No
No Yes Yes Yes No No Yes
No Yes
No Yes
No Yes
Yes Yes
No Yes
Yes
Yes
Yes
Yes
Yes
No Yes No Yes
ix
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
""'."'.~-.'-"'-' ---~
'"""
.....
--,,, -..
. ...
,.....-'
..,.,."
--
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
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.
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
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
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.
-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
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.
-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
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
80
160 MFM 360 RPM 500K bits/second 83 ms 91 ms 3 ms 18 ms 50ms 750 milliseconds
Performance Specifications
Logic Diagrams
,...
o
.... CI)
CI)
.c ~
.~
>
CI)
=:: CI)
..lI::
til
CI)
C
"C
CI)
en
CI)
"0
:il
C
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
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
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)
-_ '""_.
.,---,..... ,-_._ --
_.
."'-...
P:orJll!lri/ (ooOm/iliter
ff cirdu.'~cr{" R (jereml
rl
... -
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
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.
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
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.
-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.
-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.
-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
-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.
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
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
-+_________---,
+"
...
STEPPINS
J30AZ MIIT1IR
u--~~~+-~-------,
II
co
DO
H--------~--t_ri_t_+------+_~
.13.15~
, , , ,
IIBIVIE
+-----'='--=",ob
MOTOR
-........
......,-_.
,--, _ ..
l.,lh"
r',;
C:()mmunicati()ns
(,:able
Contents
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
~~~ ~
COco <:0(2) co
COco
t:5
9
13
25
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
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
()ption
,':,
"~j',
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.
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
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).
IS Q2
16 01;
'"
U02
LSI2"i DRIVER
o (JQ
,
~
2 "' 1
~
IN~~~~~~ ~
Q"i
-.
~
+c;~ab
12 as
'"
p;Q~
(SHT7)
_.
2 PI
17 P2
FOO
2 01
(JQ
QI lq
+ LA 1';1
.-~~~--~pc;
1'3 PO
.~'
+ RAS (SO
(SHT 2)
.....
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)
"" .....
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 =
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)
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
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 ;;;;;;
~ ~~~~
~U"~
,
"
~U<I
F2eD ~"cu
PARITY CHECK
8
C U7
EVEN
+ MDf'
IN 0
(SHT 5)
+1'02
"
+MC,
12 E
+ MD4
" c
,
+ MDS
+MDb
+HD7
2 H
"
,;iu,,~
I~ FOB
F260
""'ITYCHECK
,
"
8 A 8 C EVEN
+ M:lP
IN I
(SHT 5)
...
N
(SHT 3)
+ MOIO
+ MOil
"
"'
"
" ,
E
F G
~ 3:
9
~
~
OC
+ HOI,
+ MOIS
2 H
"
(SHT 2)
-BAO
g
~
=
i!l.
>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')
10
VI'!
'! Ulq
,,_
U2
(SHT 8) +RESET
co .... o
..
CD
II) II)
~
----~-----~
c:
o
III
c:
c:
1l.
ca Q. ><
o E II)
~
::E m
...
('II
co
CARD TABS
+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
i:
+SAB
AZZ
AZI AZO AI.
+SM
+SAIO +SAII + SAIZ
f
8 o "CI
8
~
f
IC
..,
AI8
+ SAl,
+SAI't
92. ~
+ SAl")
+SAlb
f!
810
AI" A"
+ SAI7
+ SAI8
9"
9Z8
819
80Z
U':I..,.
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
PfrJO!hi! (,'umputer
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 '_ _ _ _
!.,
..... ~
--tlAddress Buffer
r7
H
I/O Decode (Hex 300-31F Inclusive)
Data Bus
Spare-Memory Read/Write ~
Buller
Bus Direction
Bus Transceiver
:~ Data Bus
+s
~
t Jumper JI
Adapter Design
The following information is provided to assist in designing an adapter using the IBM Personal Computer AT Prototype 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
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
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
10
rt..
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
f .
/I)
+5V "
til
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
8-Bit Design
4 wait states
5 wait states
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.
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
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 !
~
~
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
(H[XnOQ (HEX)'3IF
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)
~~ ~~
~~~~~~~~l'il
11
4 8
:3 7JJ.
(SHT 3)
(SHT 3)
(SHT3)
(SHT3)
i~~i~: ~:~~;:=:~~:
(AII)+A[N
:~
1
245"8
A2
.,
II
ENl
'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.
+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..".
+ liD CYCLE
"
74SI,Q
B BIT
YYICE?fAo
~AI
1,.J U4
74ALS244
EN
(e I)
U8
1'4 18 12
~
___________________ L
(SHT 1)
-+_________
f
... .... VI
, -l/oes 16(002)
(SHT4)
-liD DECOO
="
...
(SHT 1) (SHT 1)
:p = ....
~
= ....
~
BI B2 B3
B4
B<;
.@i
~
C.
>
+DRQ Z -IZVDC + 0 WAIT STATE +IZ VDC (SHT 1) GROUND (SHT 1) -SHE'" W -SMEHR -lOW (SHT 1) -lOR
....
...
- [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
928
IZ9
3
I
no
_I~,--
iAZ9
A~O
~_'_-
(SHT 1)
P[N SIDE
COHPONENT SlOE
,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)
2,
22 21 20 19 18 17
(SHT2)
(SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT2) (SHT 2)
i
~
PIN SIDE
COMPONENT SIDE
..
.......
18 Prototype Adapter
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.
Switch Bank 0
Switch Bank 1
~~~~~~~~~~ ~~~~~~~~
~~~~~~~~~~ ~~~~~~~~
12345678 12345678
12345678
1 234 5 6 7 8
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).
Notes:
{SHT7
SWI
SWii!
7:~:
1
S2<NQ!@
lu>
Ii':!
rQ
\IQ
~
5Wl"
en
I
QIf
sw'+
ISHT?
U6Z
: Q7
p-:Q~
~
---11---------.=..: '-.==.=--+--+-~ PI
I' Q8
11"b>~1i..VE=-'----1r---------------------2 uL
t
~
\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
10'+
'5 0')
QI+
1'+
+RAS
en
eso
(SHT 2)
sw" 1.1
SlOb
SWIIf
$WI')
t8
81
__ ------'.L
Q'5;i-!'!!!..--......- - - - -
+CAS
(SHT 2)
07
., UIC
If
Db
Q6~1"-.-__.__+-----
_ _ _ ..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)
" ~
~
"
" "
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
~
"
"
"
'<
"
"
'<
~ ~
"
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)
00
I W
;0
I W
"""""" "
I I W I
I W
I W
I W
I W
"
I W
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
"
~
i'i
"
"
"
"
"
"
""
r
I
"
"
r
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)
VI
o
N
(5tH 3) +1'100
ISHT 3) +1'101 ISHT 3) +1102
(SHT3) +1'10'3 ISHT 3) +1'104
"
U'; U,"
f ~
g" o -= .... S"
~
ISHT3) +M07
(SHT 3) +1'108 (SHT 3) +HDQ (SHT 3) +11010
g
=
(5HT3)+11014
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
'"
co
~
o ,...
..
Q) Q)
&:.
!!!
:;:
o
Q.
t:
'iii
o
ca
>(
t: t:
Q.
1l
W ~
E Q) :IE
!XI
~
.,....
It)
('II
....
~
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)
::
~
~
+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
(SHT 5)
(SHT 5)
(SHT 5)
f!
BID B31
AI" AI3
+ BALE (SHT 1)
-REFRESH
(SHT7)
+RESET DRY (SHT 4)
----
PCrJotltd
Cumputer
'
H arduHlrc R e/~ren{(UhrfJn'
Serial/Pa,rallel
Adapter
o36167.~
Contents
IBM Personal Computer AT Serial/Parallel Adapter .... 1 Serial Portion of the Adapter .................. 1 Programmable Baud-Rate Generator ........... 17 Parallel Portion of the Adapter ................ 19 Specifications ............................. 24 Logic Diagrams ................................ 26
iii
iv
Serial/Parallel Adapter 1
Address Bus
Address Decode
. ..
...
...
r----.
EIA Drivers
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
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.
vee
VSS
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.
-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
1 0
~~>""' .. "
> > > . -----> > > >
Data Bit 1 Data Bit 2 Data Bit 3 Data Bit 4 Data Bit 5 Data Bit 6 Data Bit 7
Bit 0 is the least-significant bit and the first bit sent serially.
~"~""
> > > > > > >
Data Bit 1 Data Bit 2 Data Bit 3 Data Bit 4 Data Bit 5 Data Bit 6 Data Bit 7
Bit 0 is the least-significant bit and the first bit received serially.
~>"""
> > > > > > >
Information about this register may be found under "Programmable Baud Rate Generator" later in this section.
~~::
> > > > > >
Bit2
Blt6 Bit 7
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
Ihex XF9)
7 6 5 4 3 2 1 0
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
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
2
0 1
Bit 1
0
1
Bit 0
0 0
Priority Level
-
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
Highest
Second
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
10 Serial/Parallel Adapter
l~ W~ ,.~,,,.,,"," >
> > > > > >
Parity Enable Even Parity Select Stuck Panty Set Break Divisor Latch Access Bit
Bits 0, 1
These two bits specify the number of bits in each serial character that is sent or received. The encoding of bits and 1 is as follows:
Bit 1
Bit2
0 0 1 1
0 1 0 1
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
> ~> "'"',,";~"~ > > > Loop > =0 > =0 > =0
Request to Send Out 1 Out 2
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.
7 6 5 4 3 2 1 0
~~>"~~.
>
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
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
Bit 0
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
Serial/Parallel Adapter 17
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
B_
9'"
L-
18 Serial/Parallel Adapter
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
.
..
..
Interrupt
Data Bus
r-Z5-Pin 0 Connector
--"'
r---.
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.
20 Serial/Parallel Adapter
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.
Bit 6
Bit 5
Serial/Parallel Adapter 21
+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
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 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
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
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
: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"
"
...
BDtft 20 ~~ 70 ~SD ~~ bD
I~
~
~~
10
SQ"
IQ
ZQ 16
7Q
~~ ~g
,.12 bQ (')
r-
~~ ~
, , " ,
I. 1
10
I 2 4
" "
12
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
In 14 2'(; ')
q 7
, " ,
~-
'+ lA2
1'1'2 Ie
1'1'4 12
BE
eLK
UI6 -RNI 4.7KIl---..
."
tIt ~
-ERROR -AUTO FO Xl
8 IA4
Uq
1) 1) 1) 1) 11 1) 1) 1)
'" ,,,
BD4 SD6 807
RESET
'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
II Ulb
~4
10
~2G
V
q
(SHT 1)
'5Qpt--
r--lle---,-,-~
~04 8
Ulb
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
fiOI'\ ~
BOLf
./C
N/e
LS)2'i
!QL ~
>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
+;V
if [
:; (51
U'
(SHT 1)
,,(SO
+'iV~
N/e
e52
"
N/e
'L:"Uil J
./e
XTAl2
i..
I
N ....J
"-
.,
7';00
"
XTAl I
"
'-~l,J
RECEIVE OATA
28 Serial/Parallel Adapter
._ .. _"--- --
- - .- ...... _-_.._._--- - - .
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:
Signal Name - Drive selected +MFM write data -MFM write data +MFM read data -MFM read data Ground
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
-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.
- 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
-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.
-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
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.
To ensure data integrity, the controller applies a write-precompensation of 12 nanoseconds to all write data on cylinders 300 and greater.
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.
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
Logic Diagrams
=.. I.
;:~:I~!I
1
"11 Iii
: . , [I
,-------_ _-----.J
L':::__
" , Iii
, I
,-------~+--.--~~3 U",f-"~'
,!
g
.Ul
! ,
,----'
--++-~
~--------.---------.-~
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.
Task File
A task file, which contains eight registers, controls fixed-disk operations. The following figure shows the addresses and functions of these registers.
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
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
02 03 04 05
Controller error Sector buffer error ECC device error Control processor error
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
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.
Cylinder Low
76543210
--98
76543210 76543210
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
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
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
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
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
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
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.
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.
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
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.
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.
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:
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
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
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.
Read Data
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.
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
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).
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
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:
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
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
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
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:
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:
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
Normal Termination of Command (NT)-The command was completed and properly executed.
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 6
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.
Bit 5
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
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
track 0 signal
I
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
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.
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.
34
_ - Head Select 2 _ - Write Gate - Seek Complete - Track 000 - Write Fault
_ - 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
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.
1 2
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
... -
----
...
26 .. 28 ..
30 .. 32
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:
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:
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::
..
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
::
~~
'" " ::
: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:
..
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
~
~
Q
"
~
~~<lJ<8
co .... ....
s:::.
Q) Q)
~
Q) .... C.
...
Q)
'tI
10
en
C
'tI
I::::
10
~
en
Q)
C
'tI
u::
><
, , = " =
;,;
;;
N
" "
;;;
FO
11
=-
11
r----I
I
1 I
I
I'
::: ;: = =:: :
~m-mni
"L
I
I I I __ "___ J