6139362_PC_AT_Technical_Reference_Sep85 6139362 PC AT Technical Reference Sep85
6139362_PC_AT_Technical_Reference_Sep85 6139362_PC_AT_Technical_Reference_Sep85
User Manual: 6139362_PC_AT_Technical_Reference_Sep85
Open the PDF directly: View PDF .
Page Count: 507
Download | |
Open PDF In Browser | View PDF |
------ - ----------- --- _--.- Personal Computer Hardware Reference Library Technical Reference First Edition (September, 1985) The following paragraph does not apply to the United Kingdom or any country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. This publication could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time. It is possible that this publication may contain reference to, or information about, IBM products (machines and programs), programming, or services that are not announced in your country. Such references or information must not be construed to mean that IBM intends to announce such IBM products, programming, or services in your country. Products are not stocked at the address below. Requests for copies of this publication and for technical information about IBM Personal Computer products should be made to your authorized IBM Personal Computer dealer, IBM Product Center, or your IBM Marketing Representative. The following paragraph applies only to the United States and Puerto Rico: A Reader's Comment Form is provided at the back of this publication. If the form has been removed, address comments to: IBM Corporation, Personal Computer, P.O. Box 1328-C, Boca Raton, Florida 33432. IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligations whatever. © Copyright International Business Machines Corporation 1985 Federal Communications Commission Radio Frequency Interference Statement Warning: The equipment described herein has been certified to comply with the limits for a Class B computing device, pursuant to Subpart J of Part 15 of the FCC rules. Only peripherals (computer input/output devices, terminals, printers, etc.) certified to comply with the Class B limits may be attached to the computer. Operation with non-certified peripherals is likely to result in interference to radio and TV reception. If peripherals not offered by mM are used with the equipment, it is suggested to use shielded grounded cables with in-line filters if necessary. CAUTION This product described herein is equipped with a grounded plug for the user's safety. It is to be used in conjunction with a properly grounded receptacle to avoid electrical shock. iii Notes: iv Preface This manual describes the various units of the IBM Personal Computer AT and how they interact. It also has information about the basic input/output system (BIOS) and about programming support. The information in this publication is for reference, and is intended for hardware and program designers, programmers, engineers, and anyone else who needs to understand the design and operation of the IDM Personal Computer AT. This manual consists of nine sections: • • • • • • • The first three sections describe the hardware aspects of the IBM Personal Computer AT including signal charts and register information. . Section 4 describes keyboard operation, the commands to and from the system, and the various keyboard layouts. Section 5 contains information about the usage of BIOS and system BIOS listing. . . . Section 6 contains instruction sets for the 80286 microprocessor arid the 80287 math coprocessor. Section 7 provides information about characters, keystrokes, and colors. . . . Section 8 has general communications information. Section 9 contains information about the compatibility of the IDM Personal Computer AT and the r~st of the IDM Personal Computer family .. a A glossary of terms and a bibliography of related publications are included. v Prerequisite Publications Guide to Operations for the IBM Personal Computer AT Suggested Reading • BASIC for the IBM Personal Computer • Disk Operating System (DOS) • MACRO Assembler for the IBM Personal Computer vi Contents SECTION 1. SYSTEM BOARD ..................... 1-1 Memory .................................... 1-4 Microprocessor ............................... 1-4 System Performance ........................... 1-7 Direct Memory Access ......................... 1-9 System Interrupts ............................ 1-12 Hardware Interrupt Listing ................. 1-13 Interrupt Sharing .... . . . . . . . . . . . . . . . . . . . .. 1-14 System Timers .............................. 1-22 System Clock ............................... 1-23 ROM Subsystem ............................. 1-23 RAM Subsystem ............................. 1-24 I/O Channel ................................ 1-24 Connectors ............................. 1-25 I/O Channel Signal Description ............. 1-31 NMI and Coprocessor Controls ............. 1-38 Other Circuits ............................... 1-40 Speaker ................................ 1-40 RAM Jumpers ........................... 1-40 Display Switch .......................... 1-41 Variable Capacitor ....................... 1-41 Keyboard Controller ...................... 1-42 Real-Time Clock/CMOS RAM Information ... 1-56 Specifications ............................... 1-69 System Unit ............................ 1-69 Connectors ............................. 1-71 Logic Diagrams - Type 1 .................. 1-76 Logic Diagrams - Type 2 .................. 1-98 SECTION 2. COPROCESSOR ...................... Description .................................. Programming Interface ......................... Hardware Interface ............................ 2-1 2-3 2-3 2-4 SECTION 3. POWER SUPPLY ...................... 3-1 Inputs ...................................... 3-3 vii Outputs ..................................... DC Output Protection ......................... Output Voltage Sequencing ..................... No-Load Operation ........................... Power-Good Signal ............................ Connectors .................................. 3-4 3-4 3-4 3-5 3-5 3 -7 SECTION 4. KEYBOARD .......................... 4-1 Description .................................. 4-3 Power-On Routine ............................ 4-4 Commands from the System ..................... 4-5 Commands to the System ....................... 4-9 Keyboard Scan-Code Outputs .................. 4-11 Clock and Data Signals ........................ 4-12 Keyboard Layouts ........................... 4-15 Specifications ............................... 4-22 Logic Diagram .............................. 4-23 SECTION 5. SYSTEM BIOS ........................ 5-1 System BIOS Usage ........................... 5-3 Keyboard Encoding and Usage .................. 5-13 Quick Reference ......................... ,... 5-24 SECTION 6. INSTRUCTION SET ................... 6-1 80286 Instruction Set .......................... 6-3 Data Transfer ............................ 6-3 Arithmetic ............................... 6-6 Logic ................................... 6-9 String Manipulation ...................... 6-11 Control Transfer ......................... 6-13 Processor Control ........................ 6-17 Protection Control ....................... 6-18 80287 Coprocessor Instruction Set ............... 6-22 DataTransfer ........................... 6-22 Comparison ............................ 6-23 Constants .............................. 6-24 Arithmetic .............................. 6-25 Transcendental .......................... 6-26 SECTION 7. CHARACTERS, KEYSTROKES, AND COLORS .........................••........... 7-1 Character Codes .............................. 7-3 Quick Reference ............................. 7-14 viii SECTION 8. COMMUNICATIONS .................. 8-1 Hardware ................................... 8-3 Establishing a Communications Link .............. 8-5 SECTION 9. IBM PERSONAL COMPUTER COMPATIBILITY ............................... 9-1 Hardware Considerations ....................... 9-3 System Board ............................ 9-3 Fixed Disk Drive .......................... 9-5 Diskette Drive Compatibility ................ 9-5 Copy Protection .......................... 9-5 Application Guidelines ......................... 9-7 High-Level Language Considerations .......... 9-7 Assembler Language Programming Considerations 9-8 Multitasking Provisions .................... 9-16 Machine-Sensitive Code ................... 9-19 Glossary ................................... Glossary-1 Bibliography .............................. Bibliography-1 Index ........................................ Index-1 ix Notes: x INDEX TAB LISTING Section 1: System Board ............................... . Section 2: Coprocessor ................................ . Section 3: Power Supply ............................... . Section 4: Keyboard .................................. . Section 5: System BIOS ............................... . Section 6: Instruction Set .............................. . xi Notes: xii Section 7: Characters, Keystrokes, and Colors .............. . Section 8: Communications ............................ . Section 9: Compatibility ............................... . Glossary .................................. ; ........ . Bibliography ........................................ . Index .............................................. . System Block Diagram System Unit System Board 80286 Microprocessor 80287 Coprocessor Oscillator Power Supply 16 Interrupt Levels ROM Speaker Connector Speaker 7 Channel DMA RAM Keyboard Controller Keyboard CMOS Real-Time Clock Battery Connector Battery 1/0 Channel 115/230 00000000 DDDDD D I xiv •I Adapters I Fixed Disk Drives Diskette Dr i ves I I Fixed Disk and Diskette Adapter SECTION 1. SYSTEM BOARD Contents Memory ........................•................ 1-4 Microprocessor ................................... 1-4 Real Address Mode .......................... 1-4 Protected (Virtual Address) Mode .............. 1-5 System Performance ............................... 1-7 Direct Memory Access ............................. 1-9 System Interrupts ................................ Hardware Interrupt Listing ...................... Interrupt Sharing .............................. Design Overview ........................... Program Support ........................... Precautions ............................... Examples ................................. 1-12 1-13 1-14 1-14 1-15 1-17 1-18 System Timers ..........................•........ 1-22 System Clock ................................•... 1-23 ROM Subsystem 1-23 RAM Subsystem 1-24 110 Channel 1-24 1-25 1-31 1-38 .................................... Connectors .................................. I/O Channel Signal Description .................. NMI and Coprocessor Controls .................. Other Circuits .............................•.•... 1-40 Speaker ..................................... 1-40 RAM Jumpers ................................ 1-40 System Board 1-1 I Display Switch ............ ;................... Variable Capacitor ............................ Keyboard Controller .. ,........................ Keyboard Controller Initialization .............. Receiving Data from the Keyboard ............. Scan Code Translation ....................... Sending Data to the Keyboard ................. Inhibit ................................... Keyboard Controller System Interface .......... Status Register ............................. Status-Register Bit Definition ................. Output Buffer ............................. Input Buffer ............................... Commands (I/O Address Hex 64) ............. I/O Ports ................................. Real-Time Clock/CMOS RAM Information ........ Real-Time Clock Information ................. CMOS RAM Configuration Information ......... I/O Operations ............................. Specifications ................................... 1-69 System Unit .................................. Size ..................................... Weight ................................... Power Cables .............................. Environment .............................. Heat Output ............................... Noise Level ............................... Electrical ................................. Connectors .................................. Logic Diagrams - Type 1 ........................ Logic Diagrams - Type 2 ........................ 1-2 1-41 1-41 1-42 1-42 1-43 1-43 1-48 1-48 1-48 1-49 1-49 1-50 1-51 1-51 1-54 1-56 1-57 1-59 1-68 System Board 1-69 1-69 1-69 1-69 1-69 1-70 1-70 1-70 1-71 1-76 1-98 The type 1 system board is approximately 30.5 by 35 centimeters (12 by 13.8 inches). The type 2 system board is approximately 23.8 by 35 centimeters (9.3 by 13.8 inches). Both types of system boards use very large scale integration (VLSI) technology and have the following components: • Intel 80286 Microprocessor • System support function: Seven-Channel Direct Memory Access (DMA) Sixteen-level interrupt Three programmable timers System clock • 64K read-only memory (ROM) subsystem, expandable to 128K • A 512K random-access memory (RAM) Subsystem • Eight input/output (I/O) slots: Six with a 36-pin and a 62-pin card-edge socket Two with only the 62-pin card-edge socket • Speaker attachment • Keyboard attachment • Complementary metal oxide semiconductor (CMOS) memory RAM to maintain system configuration • Real-Time Clock • Battery backup for CMOS configuration table and Real-Time Clock System Board 1-3 Memory The type 1 system board has four banks of memory sockets, each supporting 9 128K-by-1-bit modules for a total memory size of 512K, with parity checking. The type 2 system board has two banks of memory sockets, each supporting 9 256K-by-1-bit modules for a total memory size of 512K, with parity checking. Microprocessor The Intel 80286 microprocessor has a 24-bit address, 16-bit memory interface 1 , an extensive instruction set, DMA and interrupt support capabilities, a hardware fixed-point multiply and divide, integrated memory management, four-level memory protection, 1G (1,073,741,824 bytes) of virtual address space for each task, and two operating modes: the 8086-compatible real address mode and the protected or virtual address mode. More detailed descriptions of the microprocessor may be found in the publications listed in the Bibliography of this manual. Real Address Mode In the real address mode, the microprocessor's physical memory is a contiguous array of up to one megabyte. The microprocessor addresses memory by generating 20-bit physical addresses. The selector portion of the pointer is interpreted as the upper 16 bits of a 20-bit segment address. The lower 4 bits of the 20-bit segment address are always zero. Therefore, segment addresses begin on multiples of 16 bytes. In this manual, the term interface refers to a device that carries signals between functional units. 1-4 System Board All segments in the real address mode are 64 K in size and may be read, written, or executed. An exception or interrupt can occur if data operands or instructions attempt to wrap around the end of a segment. For example, a word with its low-order byte at offset FFFF and its high-order byte at 0000. If, in the real address mode, the information contained in the segment does not use the full 64K, the unused end of the segment may be overlayed by another segment to reduce physical memory requirements. Protected (Virtual Address) Mode The protected mode offers extended physical and virtual memory address space, memory protection mechanisms, and new operations to support operating systems and virtual memory. Note: See "BIOS Programming Hints" in Section 5 for special cautions while operating in the protected mode. The protected mode provides a 1G virtual address space for each task mapped into a 16M physical address space. The virtual address space may be larger than the physical address space, because any use of an address that does not map to a physical memory location will cause a restartable exception. As in the real address mode, the protected mode uses 32-bit pointers, consisting of 16-bit selector and offset components. The selector, however, specifies an index into a memory resident table rather than the upper 16 bits of a real memory address. The 24-bit base address of the desired segment is obtained from the tables in memory. The 16-bitoffset is added to the segment base address to form the physical address. The microprocessor automatically refers to the tables whenever a segment register is loaded with a selector. All instructions that load a segment register will refer to the memory-based tables without additional program support. The memory-based tables contain 8-byte values called descriptors. System Board 1-5 Following is a block diagram of the system board. 1-6 System Board System Performance The 80286 microprocessor operates at 6 MHz, resulting in a clock cycle time of 167 nanoseconds. A bus cycle requires 3 clock cycles (which includes 1 wait state) so that a 500-nanosecond, 16-bit, microprocessor cycle time is achieved. Eight-bit bus operations to 8-bit devices take 6 clock cycles (which include 4 wait states), resulting in a WOO-nanosecond microprocessor cycle. Sixteen-bit bus operations to 8-bit devices take 12 clock cycles (which include 10 wait states) resulting in a 2-microsecond microprocessor cycle. The refresh controller steps one refresh address every 15 microseconds. Each refresh cycle requires 5 clock cycles to refresh all of the system's dynamic memory; 256 refresh cycles are required every 4 milliseconds. The following formula determines the percentage of bandwidth used for refresh. % Bandwidth used 5 cycles X 256 for Refresh -------------4 ms/167 ns 1280 24000 = 5.3% The DMA controller operates at 3 MHz, which results in a clock cycle time of 333 nanoseconds. All DMA data-transfer bus cycles are 5 clock cycles or 1.66 microseconds. Cycles spent in the transfer of bus control are not included. DMA channels 0, 1,2, and 3 are used for 8-bit data transfers, and channels 5, 6, and 7 process 16-bit transfers. Channel 4 is used to cascade channels 0 through 3 to the microprocessor. System Board 1-7 The following figure is a system memory map. Address Name Functi on 000000 to 07FFFF 512K system board System board memory 080000 to 09FFFF 128K I/O channel memory - IBM Personal Computer AT 128K Memory Expansion Option OAOOOO to OBFFFF 128K video RAM Reserved for graphics display buffer OCOOOO to ODFFFF 128K I/O expansion ROM Reserved for ROM on I/O adapters OEOOOO to OEFFFF 64K reserved on system board Duplicated code assignment at address FEOOOO OFOOOO to OFFFFF 64K ROM on the system board Duplicated code assignment at address FFOOOO 100000 to FDFFFF Maximum memory 15M I/O channel memory - 512K to 15M installed on memory expansion options FEOOOO to FEFFFF 64K reserved on system board Duplicated code assignment at address OEOOOO FFOOOO to FFFFFF 64K ROM on the system board Duplicated code assignment at address OFOOOO System Memory Map 1-8 System Board Direct Memory Access The system supports seven direct memory access (DMA) chartnels. Two Intel 8237A-5 DMA Controller chips are used, with four channels for each chip. The DMA channels are assigned as follows: Controller 1 Ch 0 - Reserved Ch 1 - SDLC Ch 2 - Diskette ( IBM Personai Computer) Ch 3 - Reserved Controller 2 Ch 4 - Cascade for Ctlr 1 Ch 5 - Reserved Ch 6 - Reserved Ch 7 - Reserved DMA Channels DMA controller 1 contains channels 0 through 3. These channels support 8-bit data transfers between 8-bit I/O adapters and 8- or 16-bit system memory. Each channel can transfer data throughout the 16M system-address space in 64K blocks. The following figures show address generation for the DMA channels. Source DMA Page Registers Controller Address A23<---------->A16 A15<---------->AO Address Generation for DMA Channels 0 through 3 Note: The addressing signal, byte high enable (BHE), is generated by inverting address line AO. I I System Board 1-9 DMA controller 2 contains channels 4 through 7. Channel 4 is used to cascade channels 0 through 3 to the microprocessor. Channels 5, 6, and 7 support 16-bit data transfers between 16-bit I/O adapters and 16-bit system memory. These DMA channels can transfer data throughout the 16M system-address space in 128K blocks. Channels 5, 6, and 7 cannot transfer data on odd-byte boundaries. Source DMA Page Registers Controller Address A23<---------->AI7 AI6<---------->Al Address Generation for DMA Channels 5 through 7 Note: The addressing signals, BHE and AO, are forced to a logicalO. The following figure shows the addresses for the page register. Page Register DMA Channel DMA Channel DMA Channel DMA Channel DMA Channel DMA Channel DMA Channel Refresh 0 1 2 3 5 6 7 1/0 Hex Address 0087 0083 0081 0082 008s 0089 008A 008F Page Register Addresses Addresses for all DMA channels do not increase or decrease through page boundaries (64K for channels 0 through 3, and 128K for channels 5 through 7). DMA channels 5 through 7 perform 16-bit data transfers. Access can be gained only to 16-bit devices (I/O or memory) during the DMA cycles of channels 5 through 7. Access to the DMA controller, which controls these channels, is through I/O addresses hex OCO through ODP. 1-10 System Board The DMA controller command code addresses follow. Hex Address OCO OC2 Register Function OC6 OC8 DCA OCC OCE CHO CHO CHl CHl CH2 CH2 CH3 CH3 000 002 004 006 008 OOA DOC ODE Read Status Register/Write Command Register Write Request Register Write Single Mask Register Bit Write Mode Register Clear Byte Pointer Flip-Flop Read Temporary Register/Write Master Clear Clear Mask Register Write All Mask Register Bits oc4 base base base base base base base base and and and and and and and and current current current current current current current current address word count address word count address word count address word count DMA Controller All DMA memory transfers made with channels 5 through 7 must occur on even-byte boundaries. When the base address for these channels is programmed, the real address divided by 2 is the data written to the base address register. Also, when the base word count for channels 5 through 7 is programmed, the count is the number of 16-bit words to be transferred. Therefore, DMA channels 5 through 7 can transfer 65,536 words, or 128Kb maximum, for any selected page of memory. These DMA channels divide the 16M memory space into 128K pages. When the DMA page registers for channels 5 through 7 are programmed, data bits D7 through Dl contain the high-order seven address bits (A23 through A17) of the desired memory space. Data bit DO of the page registers for channels 5 through 7 is not used in the generation of the DMA memory address. At power-on time, all internal locations, especially the mode registers, should be loaded with some valid value. This is done even if some channels are unused. System Board 1-11 System Interrupts The 80286 microprocessor's non-maskable interrupt (NMI) and two 8259A Controller chips provide 16 levels of system interrupts. Note: Any or all interrupts may be masked (including the microprocessor's NMI). 1-12 System Board Hardware Interrupt Listing The following shows the interrupt-level assignments in decreasing priority. Level Function Microprocessor NMI Parity or I/O Channel Check Interrupt Controllers CTRL I CTRL 2 IRQ. 0 IRQ 1 IRQ 2 +- Timer OutlJut 0 Keyboard (Output Suffer Full) Interrupt from CTRL 2 IRQ 8 IRQ 9 - IRQ 3 IRQ 4 IRQ 5 IRQ 6 IRQ 7 IRQ. IRQ. IRQ IRQ IRQ IRQ 10 11 12 13 14 15 Realtime Clock Interrupt Software Redirected to INT OAH PC Network * PC Network(Alt.) * Reserved Reserved Reserved Coprclcessor Fixed Disk Controller Reserved Serial Port 2 BSC BSC (Alt.) Cluster (Primary) PC Network * PC Network (Alt.) * SDLC Serial Port 1 BSC BSC (Alt.) SDLC Parallel Port 2 Diskette Controller Fixed Disk and Diskette Drive Parallel POrt 1 Data Aguisition and Control *** GPIB *11 Cluster (Secondary) * The ** The *** PC Network is jumper selectable. GPIB Adapter can be set to interrupts 2 through 7. The Data Acquisition Adapter can be set to interrupts 3 through 7. The default interrupt is 7. Hardware Interrupt Listing System Board 1-13 Interrupt Sharing A definition for standardized hardware design has been established that enables multiple adapters to share an interrupt level. This section describes this design and discusses the programming support required. Note: Since interrupt routines do not exist in ROM for protected mode operations, this design is intended to run only in the microprocessor's real address mode. Design Overview Most interrupt-supporting adapters hold the I interrupt request I line (IRQ) at a low level and then drive the line high to cause an interrupt. In contrast, the shared-interrupt hardware design allows IRQ to float high through pull-up resistors on each adapter. Each adapter on the line may cause an interrupt by pulsing the line to a low level. The leading edge of the pulse arms the 8259A Interrupt Controller; the trailing edge signals the interrupt controller to cause the interrupt. The duration of this pulse must be between 125 and 1,000 nanoseconds. The adapters must have an I interrupt I status bit (INT) and a I interrupt enable I bit (ENA) that can be controlled and monitored by its software. Each adapter sharing an interrupt level must monitor the IRQ line. When any adapter drives the line low, all other adapters on that line must be prevented from issuing an interrupt request until they are rearmed. If an adapter's INT status bit is at a high level when the interrupt sharing logic is rearmed, the adapter must reissue the interrupt. This prevents lost interrupts if two adapters issue an interrupt at the same time and an interrupt handler issues a Global Rearm after servicing one of the adapters. 1-14 System Board The following diagram is an example of the shared interrupt hardware logic. Q I-------i INT ENA +5 Q -Q >CLK 2.2K Ohms -CLR System Clock-~---+-------I ">4---+- IRQ +5 Q '------j>CLK -Q -CLR -Global Rearm----+--------' Shared Interrupt Logic Diagram Program Support During multitasking, tasks are constantly being activated and deactivated in no particular order. The interrupt-sharing program support described in this section provides for an orderly means to: • Link a task's interrupt handler to a chain of interrupt handlers • Share the interrupt level while the task is active • Unlink the interrupt handler from the chain when the task is deactivated. Linking to a Chain Each newly activated task replaces the interrupt vector in low memory with a pointer to its own interrupt handler. The old interrupt vector is used as a forward pointer (FPTR) and is stored at a fixed offset from the new task's interrupt handler. System Board 1-15 Sharing the Interrupt Level When the new task's handler gains control as a result of an interrupt, the handler reads the contents of the adapter's interrupt status register to determine if its adapter caused the interrupt. If it did, the handler services the interrupt, disables the interrupts (eLI), issues a non-specific End of Interrupt (EOI), and then, to rearm the interrupt hardware, writes to address 02FX, where X corresponds to interrupt levels 3 through 7, and 9 (IRQ9 is 02F2). A write to address 06FX, where X may be 2 through 7, is required for interrupt levels 10 through 15, respectively. Each adapter in the chain decodes the address which results in a Global Rearm. An adapter is required to decode the least significant 11 bits for this Global Rearm command. The handler then issues a Return From Interrupt (IRET). If its adapter did not cause the interrupt, the handler passes control to the next interrupt handler in the chain. Unlinking from the Chain To unlink from the chain, a task must first locate its handler's position within the chain. By starting at the interrupt vector in low memory, and using the offset of each handler's FPTR to find the entry point of each handler, the chain can be methodically searched until the task finds its own handler. The FPTR of the previous handler in the chain is replaced by the task's FPTR, thus removing the handler from the chain. Error Recovery Should the unlinking routine discover that the interrupt chain has been corrupted (an interrupt handler is linked but does not have a valid SIGNATURE), an unlinking error-recovery procedure must be in place. Each application can incorporate its own unlinking error procedure into the unlinking routine. One application may choose to display an error message requiring the operator to either correct the situation or power down the system. Another application may choose an error recovery procedure that restores the original interrupt vector in low memory, and bypasses the corrupt portion of the interrupt chain. This error recovery 1-16 System Board procedure may not be suitable when adapters that are being serviced by the corrupt handler are actively generating interrupts, since unserviced interrupts lock up that interrupt level. ROS Considerations Adapters with their handlers residing in ROS may choose to implement chaining by storing the 4 byte FPTR (plus the FIRST flag if it is sharing interrupt 7 or 15) in on-adapter latches or ports. Adapter ROS without this feature must first test to see that it is the first in the chain. If it is the first in the chain, the adapter can complete the link; if not, the adapter must exit its routine without linking. Precautions The following precautions must be taken when designing hardware or programs using shared interrupts: • Hardware designers should ensure the adapters: Do not power up with the ENA line active or an interrupt pending. Do not generate interrupts that are not serviced by a handler. Generating interrupts when a handler is not active to service the adapter causes the interrupt level to lock up. The design relies on the handler to clear its adapter's interrupt and issue the Global Rearm. Can be disabled so that they do not remain active after their application has terminated. • Programmers should: Ensure that their programs have a short routine that can be executed with the AUTOEXEC.BAT to disable their adapter's interrupts. This precaution ensures that the adapters are deactivated if the user reboots the system. System Board 1-17 Treat words as words, not bytes. Remember that data is stored in memory using the Intel format (word 424B is stored as 4B42). Interrupt Chaining Structure ENTRY: JKP FPTR SIGNATURE SHORT PAST DO 0 OW 424BH FLAGS FIRST JKP RES BYTES DB EQU SHORT DB - PAST: BOH RESET DUP 7 (0 ) , Jump around structure , Porward Pointer , Used when unlinking to identify , compatible interrupt handlers , Flags , Flag for being first in chain , Future , Actual expansion start of code The interrupt chaining structure is a 16-byte format containing FPTR, SIGNATURE, and RES BYTES. It begins at the third byte from the interrupt handler'sentry point. The first instruction of every handler is a short jump around the structure to the start of the routine. Since the position of each interrupt handler's chaining structure is known (except for the handlers on adapter ROS), the FPTRs can be updated when unlinking. The FIRST flag is used to determine the handler's position in the chain when unlinking when sharing interrupts 7 and 15. The RESET routine, an entry point for the operating system, must disable the adapter's interrupt and RETURN FAR to the operating system. Note: All handlers designed for interrupt sharing must use 424B as the signature to avoid corrupting the chain. Examples In the following examples, notice that interrupts are disabled before control is passed to the next handler on the chain. The next handler receives control as if a hardware interrupt had caused it to receive control. Also, notice that the interrupts are disabled before the non-specific EOI is issued, and not reenabled in the interrupt handler. This ensures that the IRET is executed (at which point the flags are restored and the interrupts 1-18 System Board reenabled) before another interrupt is serviced, protecting the stack from excessive build up. Example of an Interrupt Handler xxxx Location of your card's interrupt control/status register Interrupt bit in your card's interrupt control status register ISB EQU REARM EQU 2F7H Global Rearm location for interrupt level 7 EQU 67H Specific EOI for 8259'5 interrupt level 7 EOI OCR EQU EQU 20H 20H Non-specific EOI Location of 8259 operational control IMR EQU 21H register Location of 8259 interrupt mask register MVCSEG ENTRY SEGMENT PARA ASSUME PROC JMP DO CS:MYCSEG,DS:DSEG FAR SHORT PAST FPTR SIGNATURE OW FLAGS FIRST JMP DB EQU SHORT RES_BYTES· DB PAST: o 424BH PUSH TEST JNZ TEST JNZ POP CLI JMP Forward POinter Used when unlinking to identify compatible interrupt handlers Flags 80H RESET DUP 7 (0) STI MOV IN Entry point of handler DX,YOUR_CARD AL,DX AL,ISB SERVICE CS:FLAGS,FIRST EXIT Future expansion Actual start of handler code Save needed registers Select your status register Read the status register Your card caused the interrupt? yes. branch to service logic Are we the first ones in? If yes, branch for EOI and Rearm Restore registers Disable interrupts DWORD PTR CS:FPTR SERVICE: Pass control to next guy on chain Service the interrupt EXIT: CLI MOV OUT MOV OUT POP IRET Disable the interrupts AL,EOI aeR,AL DX,REARM DX,AL Restore registers RESET: Disable your card Return FAR to operating system RET ENTRY Issue non-specific EOI to 8259 Rearm the cards ENOP MYCSEG END ENDS ENTRY System Board 1-19 Linking Code Example PUSH ES eLI ~ Disable interrupts Set forward pointer to value of interrupt vector in low memory ASSUME CS:CODESEG,DS:CODESEG PUSH ES MOV AX,350FH DOS get interrupt vector INT 21H MOV SI,OFFSET CS:FPTR Get offset of your forward pointer in an indexable register MOV MOV CMP JNZ MOV SETVECTR: POP PUSH cs: 151] ,EX CS: ISI+2) ,ES ES:BYTE PTR{BX],CFH store the old interrupt vector in your forward pointer for chaining Test for IRET SETVECTR CS:FLAGS,FIRST Set up first in chain flag ES DS ; Make interrupt vector in low memory pOint to your handler MOV DX,OFFSET ENTRY Make interrupt vector point to your handler If DS not = CS, get it OS, AX and put it in DS AX,2S0FH DOS set interrupt vector INT 21H POP DS Unmask (enable) interrupts for your level IN AL, IMR Read interrupt mask register $+2 JMP 10 delay AND AL,07FH Unmask interrupt level 7 OUT IMR,AL write new interrupt mask MOV AL,SPC_EOI Issue specific EOI for level 7 $+Z JMP to allow pending level 7 interrupts (if any) to be serviced OUT OeR,AL STI Enable interrupts POP ES MOV AX, SEG ENTRY MOV MOV 1-20 System Board Unlinking Code Example PUSH PUSH eLI MOV INT MOV DS ES AX,350FH 21H CX,ES Are we the first handler in the chain? MOV AX,eS CMP BX,OFFSET ENTRY JNE CMP UNCHAIN_A AX,CX Disable interrupts DOS qet interrupt vector BS:BX points to first of chain Pickup segment part of interrupt vector Get code seq into comparable register Interrupt vector in low memory pointing to your handler's offset? No, branch vector pointing to your handler's segment? No, branch JNE Set interrupt vector in low memory to point to the handler pointed to by your pOinter PUSH MOV MOV MOV INT POP JMP UNCHAIN_A: CMP DS DX,WORD PTR CS:FPTR DS,WORD PTR CS FPTR[2[ AX,2S0FH ~ DOS set interrupt vector 21H DS UNCHAIN_X BX = FPTR offset, ES FPTR segment, ex = CS ES:[BX+6),4B42H Is handler using the appropriate JNE LDS CMP exception JNE MOV CMP UNCHAIN_B CX,DS AX,CX SI,ES: [BX+2) 51,OFFSET ENTRY JNE conventions (is SIGNATURE present in the interrupt chaining structure)? No, invo~e error exception handler Get FPTR's segment and offset Is this forward pointer pointing to your hand~er's offset? ~o, branch Kove to compare Is this forward pointer pointing to your handler's segment? NO, branch Located your handler in the chain MOV AX,WORD PTR CS:FPTR MOV MOV MOV MOV AND OR JMP UNCHAIN_B: MOV PUSH PUSH JMP UNCHAIN_X: STI POP POP Get your FPTR's offset Replace offset of FPTR of handler that points to you AX,WORD PTR CS:FPTR[2] J Get your FPTR's segment ES: [BX+4 J , AX Replace segment of FPTR of handler that points to you AL,CS:FLAGS Get your flags AL,FIRST Isolate fIRST flag ES: [BX + 6),AL Set your first flag into prior routine ES:[BX+2[,AX UNCHAIN_X BX,SI DS ES UNCHAIN_A Kove new offset to BX Examine next handler in chain Enable interrupts ES DS System Board 1-21 System Timers The system has three programmable timer/counters, Channels 0 through 2. They are controlled by an Intel 8254-2 Timer/Counter chip, and are defined as follows: Channel 0 System Timer GATE 0 CLKINO CLKOUTO Tied on 1.190 MHz OSC 8259AIRQ 0 Channell Refresh Request Generator GATE 1 CLKIN 1 CLKOUT 1 Tied on 1.190 MHz OSC Request refresh cycle Note: Channel 1 is programmed as a rate generator to produce a 15-microsecond period signal. Channel 2 Tone Generation for Speaker GATE 2 CLKIN2 CLKOUT2 Controlled by bit 0 of port hex 61, PPI bit 1.190 MHz OSC Used to drive the speaker The 8254-2 Timer/Counter is a programmable interval timer/counter that system programs treat as an arrangement of four external I/O ports. Three ports are treated as counters; the fourth is a control register for mode programming. The following is a system-timer block diagram. 1-22 System Board +5 Vdc -Refresh Refres h Reques t Q Clock Clear D LSystem B u s _ Gate 0 +5 Vdc I/O Add ress Hex 006 1 Port Bi t 0 Clock In 0 Gate I >-- Clock In I ~ Gate 2 0--- Clock In 2 IRQ 0 Clock Out 0 Clock Out 1 - Clock Out 2 I/O Add ress Hex 006 1 Port Bi t 1 PC LK (2 .38MHz) I Driver I I I AND Divide by 2 Low Pass F i Iter r---+ To Speaker II System-Timer Block Diagram System Clock The 82284 System Clock Generator is driven by a 12-MHz crystal. Its output I clock I signal (CLK) is the input to the system microprocessor, the coprocessor, and I/O channel. ROM Subsystem The system board's ROM subsystem consists of two 32K by 8-bit ROM/EPROM modules in a 32K-by-16-bit arrangement. The code for odd and even addresses resides in separate modules. ROM is assigned at the top of the first and last 1M address space (OFOOOO and FFOOOO). ROM is not parity-checked. Its access time is 150 nanoseconds and its cycle time is 230 nanoseconds. System Board 1-23 RAM Subsystem The system board's RAM subsystem starts at address 000000 of the 16M address space. It is 512K of 128K-by-1-bit RAM modules (type 1 system board) or 512K of 256K-by-1-bit RAM modules (type 2 system board). Memory access time is 150 nanoseconds and the cycle time is 275 nanoseconds. Memory refresh requests one memory cycle every 15 microseconds through the timer/counter (channell). The RAM initialization program performs the following functions: • Initializes channell of the timer/counter to the rate generation mode, with a period of 15 microseconds. • Performs a memory write operation to any memory location. Note: The memory must be accessed or refreshed eight times before it can be used. I/O Channel The I/O channel supports: • I/O address space hex 100 to hex 3FF • 24-bit memory addresses (16M) • Selection of data accesses (either 8- or 16-bit) • Interrupts • DMA channels • I/O wait-state generation 1-24 System Board • Open-bus structure (allowing mUltiple microprocessors to share the system's resources, including memory) • Refresh of system memory from channel microprocessors. Connectors The following figure shows the location and the numbering of the I/O channel connectors. These connectors consist of six 36-pin and eight 62-pin edge connector sockets. Note: The 36-pin connector is not present in two positions on the I/O channel. These positions can support only 62-pin I/O bus adapters. I/O CHANNEL CONNECTORS r ----------~~,--------~ REAR PANEL o """"" r I/O Channel Connector Location System Board 1-25 The following figure shows the pin numbering for I/O channel connectors 11 through J8. Rear Panel B1 Al Bl0 Al0 B20 A20 B31 A31 Component Side I/O Channel Pin Numbering (J1-J8) 1-26 System Board The following figure shows the pin numbering for I/O channel connectors J1 0 through J14 and J16. Rear Panel 01 C1 010 C10 018 c18 Component Side I/O Channel Pin Numbering (J10-J14 and J16) System Board 1-27 The following figures summarize pin assignments for the I/O channel connectors. I/O Pin Signal Name I/O Al A2 A3 A4 A5 A6 A7 A8 A9 AIO All Al2 Al3 Al4 Al5 Al6 Al7 Al8 Al9 A20 A21 A22 A23 A24 A25 A26 A27 A28 A29 A30 A31 -I/O CH CK S07 S06 S05 So4 S03 S02 SOl SOO -I/O CH ROY AEN SAl9 SAl8 SAl7 SAl6 SAl5 SAl4 SAl3 SAl2 SAIl SAIO SA9 SA8 SA7 SA6 SA5 SA4 SA3 SA2 SAl SAO I I/O I/O I/O I/O I/O I/O I/O I/O I 0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 I/O Channel (A-Side, J1 through J8) 1-28 System Board I/O Pin Signal Name I/O B1 B2 B3 B4 B5 B6 B7 B8 B9 Bl0 B11 B12 B13 B14 B15 B16 B17 B18 B19 B20 B21 B22 B23 B24 B25 B26 B27 B28 B29 B30 B31 GND RESET DRV +5 Vdc IRQ 9 -5 Vdc DRQ2 -12 Vdc OWS +12 Vdc GND -SMEMW -SMEMR -lOW -lOR -DACK3 DRQ3 -DACKI DRQl -REFRESH ClK IRQ7 IRQ6 IRQ5 IRQ4 IRQ3 -DACK2 T/C BALE +5Vdc OSC GND Ground 0 Power I Power I Power I Power Ground 0 0 I/O I/O 0 I 0 I I/O 0 I I I I I 0 0 0 Power 0 Ground I/O Channel (B-Side, J1 through J8) System Board 1-29 I/O Pin Signa1 Name I/O C1 C2 C3 C4 C5 C6 C7 c8 C9 Cl0 C11 C12 C13 C14 C15 C16 C17 C18 SBHE LA23 LA22 LA21 LA20 LA19 LA18 LA17 -MEMR -MEMW SD08 SD09 SD10 SDll SD12 SD 13 SD14 SD15 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 /0 I/O Channel (C-Side, J10 through J14 and 16) I/O Pin Signa1 Name I/O D1 D2 D3 D4 D5 D6 D7 D8 D9 Dl0 D11 D12 D13 D14 D15 D16 D17 D18 -MEM CS16 -I/O CS16 IRQ10 IRQll IRQ12 IRQ15 IRQ14 -DACKO DRQO -DACK5 DRQ5 -DACK6 DRQ6 -DACK7 DRQ7 +5 Vdc -MASTER GND I I I I I I I 0 I 0 I 0 I 0 I POWER I GROUND I/O Channel (D-Side, J10 through J14 and 16) 1-30 System Board 110 Channel Signal Description The following is a description of the system board's I/O channel signals. All signal lines are TTL compatible. I/O adapters should be designed with a maximum of two low-power Shottky (LS) loads per line. SAO through SA19 (I/O) Address signals 0 through 19 are used to address memory and I/O devices within the system. These 20 address lines, in addition to LA17 through LA23 , allow access of up to 16M of memory. SAO through SA19 are gated on the system bus when I buffered address latch enable I signal (BALE) is high and are latched on the falling edge of BALE. These signals are generated by the microprocessor or DMA Controller. They also may be driven by other microprocessors or DMA controllers that reside on the I/O channel. LA17 through LA23 (I/O) These signals (unlatched) are used to address memory and I/O devices within the system. They give the system up to 16M of address ability. These signals are valid when BALE is high. LA17 through LA23 are not latched during microprocessor cycles and therefore do not stay valid for the whole cycle. Their purpose is to generate memory decodes for 16-bit, 1 wait-state, memory cycles. These decodes should be latched by I/O adapters on the falling edge of BALE. These signals also may be driven by other microprocessors or DMA controllers that reside on the I/O channel. eLK (0) This is the 6-MHz system clock signal. It is a synchronous microprocessor cycle clock with a cycle time of 167 nanoseconds. The clock has a 50% duty cycle. This signal should be used only I I System Board 1-31 for synchronization. It is not intended for uses requiring a fixed frequency. RESET DRV (0) The 'reset drive' signal is used to reset or initialize system logic at power-up time or during a low voltage condition. This signal is active high. SDO through SD15 (I/O) These signals provide bus bits 0 through 15 for the microprocessor, memory, and I/O devices. DO is the least-significant bit and DIS is the most-significant bit. A1l8-bit devices on the I/O channel should use DO through D7 for communications to the microprocessor. The 16-bit devices will use DO through DIS. To support 8-bit devices, the data on D8 through D15 will be gated to DO through D7 during 8-bit transfers to these devices; 16-bit microprocessor transfers to 8-bit devices will be converted to two 8-bit transfers. BALE (0) (buffered) The 'buffered address latch enable' signal is provided by the 82288 Bus Controller and is used on the system board to latch valid addresses and memory decodes from the microprocessor. It is available to the I/O channel as an indicator of a valid microprocessor or DMA address (when used with 'address enable' signal, AEN). Microprocessor addresses SAO through SA19 are latched with the falling edge of BALE. BALE is forced high (active) during PMA cycles. -I/O cn CK (I) The '-I/O channel check' signal provides the system board with parity (error) information about memory or devices on the I/O channel. When this signal is active (low), it indicates a non-correctable system error. 1-32 System Board I/O cn RDY (I) The '1/0 channel ready signal is pulled low (not ready) by a memory or I/O device to lengthen I/O or memory cycles. Any slow device using this line should drive it low immediately upon detecting its valid address and a Read or Write command. Machine cycles are extended by an integral number of clock cycles (167 nanoseconds). This signal should be held low for no more than 2.5 microseconds. I IRQ3-IRQ7, IRQ9-IRQ12, IRQ14, and IRQ15 (I) Interrupt requests 3 through 7, 9 through 12, 14, and 15 are used to signal the microprocessor that an I/O device needs attention. The interrupt requests are prioritized, with IRQ9 through IRQI2, IRQI4, and IRQ15 having the highest priority (IRQ9 is the highest), and IRQ3 through IRQ7 having the lowest priority (IRQ7 is the lowest). An interrupt request is generated when an IRQ line is raised from low to high. The line is high until the microprocessor acknowledges the interrupt request (Interrupt Service routine). Note: Interrupt 13 is used on the system board and is not available on the I/O channel. IRQ 8 is used for the real-time clock. -lOR (I/O) The I -I/O read I signal instructs an I/O device to drive its data onto the data bus. This signal may be driven by the system microprocessor or DMA controller, or by a microprocessor or DMA controller resident on the I/O channel. This signal is active low. -lOW (I/O) The I -I/O write I signal instructs an I/O device to read the data off the data bus. It may be driven by any microprocessor or DMA controller in the system. This signal is active low. System Board 1-33 -SMEMR (0) -MEMR (I/O) These signals instruct the memory devices to drive data onto the data bus. -SMEMR is active only when the memory decode is within the low 1M of memory space. -MEMR is active on all memory read cycles. -MEMR may be driven by any microprocessor or DMA controller in the system. -SMEMR is derived from -MEMR and the decode of the low 1M of memory. When a microprocessor on the I/O channel wishes to drive -MEMR, it must have the address lines valid on the bus for one clock cycle before driving -MEMR active. Both signals are active low. -SMEMW (0) -MEMW (I/O) These signals instruct the memory devices to store the data present on the data bus. -SMEMW is active only when the memory decode is within the low 1M of the memory space. -MEMW is active on all memory write cycles. -MEMW may be driven by any microprocessor or DMA controller in the system. -SMEMW is derived from -MEMW and the decode of the low 1M of memory. When a microprocessor on the I/O channel wishes to drive -MEMW, it must have the address lines valid on the bus for one clock cycle before driving -MEMW active. Both signals are active low. DRQO-DRQ3 and DRQ5-DRQ7 (I) The I DMA request I signals 0 through 3 and 5 through 7 are asynchronous channel requests used by peripheral devices and a microprocessor to gain DMA service (or control of the system). They are prioritized, with DRQO having the highest priority and DRQ7 the lowest. A request is generated by bringing a DRQ line to an active (high) level. A DRQ line is held high until the corresponding I DMA acknowledge I (DACK) line goes active. DRQO through DRQ3 perform 8-bit DMA transfers; DRQ5 through DRQ7 perform 16-bit transfers. DRQ4 is used on the system board and is not available on the 110 channel. 1-34 System Board -DACKO to -DACK3 and -DACKS to -DACK7 (0) -DMA acknowledge 0 through 3 and 5 through 7 are used to acknowledge DMA requests. These signals are active low. AEN (0) The I address enable I signal is used to degate the microprocessor and other devices from the I/O channel to allow DMA transfers to take place. When this line is active, the DMA controller has control of the address bus, the data-bus Read command lines (memory and I/O), and the Write command lines (memory and I/O). This signal is active high. -REFRESH (I/O) This signal is used to indicate a refresh cycle and can be driven by a microprocessor on the I/O channel. This signal is active low. T/C (0) The I terminal count I signal provides a high pulse when the terminal count for any DMA channel is reached. SBHE (I/O) The I system bus high enable I signal indicates a transfer of data on the upper byte of the data bus, SD8 through SD15. Sixteen-bit devices use SBHE to condition data bus buffers tied to SD8 through SD15. This signal is active high. -MASTER (I) This signal is used with a DRQ line to gain control of the system. A processor or DMA controller on the I/O channel may issue a DRQ to a DMA channel in cascade mode and receive a -DACK. Upon receiving the -DACK, a microprocessor may pull System Board 1-35 -MASTER active (low), which will allow it to control the system address, data, and control lines (a condition known as tri-state). After -MASTER is low, the microprocessor must wait one clock cycle before driving the address and data lines, and two clock cycles before issuing a Read or Write command. If this signal is held low for more than 15 microseconds, the system memory may be lost because of a lack of refresh. -MEM CS16 (I) The I-memory 16-bit chip select I signal indicates to the system that the present data transfer is a 1 wait-state, 16-bit, memory cycle. It must be derived from the decode of LA17 through LA23. -MEM CS16 is active low and should be driven with an open collector or tri-state driver capable of sinking 20 mAo -I/O CS16 (I) The I-I/O 16-bit chip select I signal indicates to the system that the present data transfer is a 16-bit, 1 wait-state, I/O cycle. It is derived from an address decode. -I/O CS16 is active low and should be driven with an open collector or tri-state driver capable of sinking 20 rnA. OSC (0) The Ioscillator I signal is a high-speed clock with a 70-nanosecond period (14.31818 MHz). This signal is not synchronous with the system clock. It has a 50% duty cycle. OWS (I) The Izero wait state I signal tells the microprocessor that it can complete the present bus cycle without inserting any additional wait cycles. In order to run a memory cycle to a 16-bit device without wait cycles, OWS is derived from an address decode gated with a Read or Write command. In order to run a memory cycle to an 8-bit device with a minimum of two wait states, OWS should 1-36 System Board be driven active one clock cycle after the Read or Write command is active, and gated with the address decode for the device. Memory Read and Write commands to an 8-bit device are active on the falling edge of eLK. OWS is active low and should be driven with an open collector or tri-state driver capable of sinking 20 rnA. The following figure is an I/O address map. Hex Range DOO-OIF OZO-03F 040-05F 06o-06F 070-07F 080-09F OAO-OBF OCO-ODF OFO OFI OF8-0FF Device DMA controller 1, 8237A-5 Interru~t controller 1,8259A, Master Timer 254-2 8042 (Keyboard) Real-time clock, NMI (non-maskable interrupt) mask DMA page register , 74LS612 Interrupt Controller 2, 8259A DMA controller 2, 8237A-5 Clear Math Coprocessor Busy Reset Math Coprocessor Math Coprocessor Note: I/O Addresses, hex 000 to OFF, are reserved for the system board I/O. Hex 100 to 3FF are available on the I/O channel. I/O Address Map (Part 1 of 2) System Board 1-37 Hex Range 1FO-1F8 200-207 20C-20D 21F 278-27F 2BO-2DF 2E1 2E2 & 2E3 2F8-2FF 300-31F 360-363 364-367 368-36B 36C-36F 378-37F 380-38F 390-393 3AO-3AF 3BO-3BF 3CO-3CF 3DO-3DF 3FO-3F7 3F8-3FF 6E2 & 6E3 790-793 AE2 & AE3 B90-B93 EE2 & EE3 1390-1393 22E1 2390-2393 42E1 62E1 82E1 A2E1 C2E1 E2E1 Device Fixed Disk Game I/O Reserved Reserved Parallel printer port 2 Alternate Enhanced Graphics Adapter GPIB (Adapter 0) Data Acquisition (Adapter 0) Serial port 2 Prototype card PC Network (low address) Reserved PC Network (high address) Reserved Parallel printer port 1 SDLC, bisynchronous 2 Cluster Bisynchronous 1 Monochrome Display and Printer Adapter Enhanced Graphics Adapter Color/Graphics Monitor Adapter Diskette controller Serial port 1 Data Acquisition (Adapter 1) Cluster (Adapter 1) Data Acquisition (Adapter 2) Cluster (Adapter 2) Data Acquisition (Adapter 3) Cluster (Adapter 3) GP I B (Adapter 1) Cluster (Adapter 4) GPIB (Adapter 2) GPIB (Adapter 3) GPIB (Adapter 4) GPIB (Adapter 5) GPIB (Adapter 6) GPIB (Adapter 7) Note: I/O Addresses, hex 000 to OFF, are reserved for the system board I/O. Hex 100 to 3FF are available on the I/O channe I. I/O Address Map (Part 2 of 2) NMI and Coprocessor Controls At power-on time, the non-maskable interrupt (NMI) into the 80286 is masked off. The mask bit can be set and reset with system programs as follows: 1-38 System Board Mask On Write to I/O address hex 070, with data bit 7 equal to a logic O. Mask Off Write to I/O address hex 070, with data bit 7 equal to a logic 1. Note: At the end of POST, the system sets the NMI mask on (NMI enabled). The following is a description of the Math Coprocessor controls. OFO An 8-bit Out command to port FO will clear the latched Math Coprocessor -busy signal. The -busy signal will be latched if the coprocessor asserts its I -error I signal while it is busy. The data output should be zero. I OF1 I I I An 8-bit Out command to port Fl will reset the Math Coprocessor. The data output should be zero. I/O address hex 080 is used as a diagnostic-checkpoint port or register. This port corresponds to a read/write register in the DMA page register (74LS612). The I -I/O channel check I signal (-I/O CH CK) is used to report non-correctable errors on RAM adapters on the I/O channel. This check will create an NMI if the NMI is enabled. At power-on time, the NMI is masked off and -I/O CH CK is disabled. Follow these steps when enabling -I/O CH CK and the NMI. 1. Write data in all I/O RAM-adapter memory locations; this will establish good parity at all locations. 2. Enable -I/O CH CK. 3. Enable the NMI. Note: All three of these functions are performed by POST. When a check occurs, an interrupt (NMI) will result. Read the status bits to determine the source of the NMI (see the figure, "1/ a Address Map", on page 1-37). To determine the location of the failing adapter, write to any memory location within a given System Board 1-39 adapter. If the parity check was from that adapter, -I/O CH CK will be reset to inactive. Other Circuits Speaker The system unit has a 2-1/4 inch permanent-magnet speaker, which can be driven from: • • • The I/O-port output bit The timer/counter's CLK OUT 2 Both of the above RAM Jumpers The system board has a 3-pin, Berg-strip connector (J18). Starting at the front of the system, the pins are numbered 1 through 3. Jumper placement across these pins determines how much system board RAM is enabled. Pin assignments follow. Pin Assignments 1 2 No Connection - RAM SEL Ground 3 RAM Jumper Connector (J18) 1-40 System Board The following shows how the jumpers affect RAM. Jumper Positions 1 and 2 2 and 3 Function Enable 2nd 256K of system board RAM Disable 2nd 256K of system board RAM RAM Jumper Note: The normal mode is the enable mode. The other mode permits the additional RAM to reside on adapters plugged into the I/O bus. Display Switch Set the slide switch on the system board to select the primary display adapter. Its positions are assigned as follows: On (toward the front of the system unit): The primary display is attached to the Color/Graphics Monitor Adapter or Professional Graphics Controller. Off (toward the rear of the system unit): The primary display is attached to the Monochrome Display and Printer Adapter. The switch may be set to either position if the primary display is attached to an Enhanced Graphics Adapter. Note: The primary display is activated when the system is powered on. Variable Capacitor The system board has a variable capacitor. Its purpose is to adjust the 14.31818 MHz oscillator signal (OSC), used to obtain the color-burst signal required for color televisions. System Board 1-41 Keyboard Controller The keyboard controller is a single-chip microcomputer (Intel 8042) that is programmed to support the keyboard serial interface. The keyboard controller receives serial data from the keyboard, checks the parity of the data, translates scan codes, and presents the data to the system as a byte of data in its output buffer. The controller can interrupt the system when data is placed in its output buffer, or wait for the system to poll its status register to determine when data is available. Data is sent the keyboard by first polling the controller's status register to determine when the input buffer is ready to accept data and then writing to the input buffer. Each byte of data is sent to the keyboard serially with an odd parity bit automatically inserted. The keyboard is required to acknowledge all data transmissions, another byte of data should not be sent to the keyboard until acknowledgement is received for the previous byte sent. The output-buffer-full interrupt may be used for both send and receive routines. Keyboard Controller Initialization At power on, the keyboard controller set the system flag bit to O. After a power-on reset or the execution of the Self Test command, the keyboard controller disables the keyboard interface by forcing the 'keyboard clock' line low. The keyboard interface parameters are specified at this time by writing to locations within the 8042 RAM. The keyboard-inhibit function is then disabled by setting the inhibit-override bit in the command byte. A hex 55 is then placed in the output buffer if no errors are detected during the self test. Any value other than hex 55 indicates that the 8042 is defective. The keyboard interface is now enabled by lifting the 'keyboard data' and 'keyboard clock' signal lines, and the system flag is set to 1. The keyboard controller is then ready to accept commands from the system unit microprocessor or receive keyboard data. 1-42 System Board Receiving Data from the Keyboard The keyboard sends data in a serial format using an 11-bit frame. The first bit is a start bit, and is followed by eight data bits, an odd parity bit, and a stop bit. Data sent is synchronized by a clock supplied by the keyboard. At the end of a transmission, the keyboard controller disables the interface until the system accepts the byte. If the byte of data is received with a parity error, a Resend command is automatically sent to the keyboard. If the keyboard controller is unable to receive the data correctly after a set number of retries, a hex FF is placed in its output buffer, and the parity bit in the status register is set to 1, indicating a receive parity error. The keyboard controller will also time a byte of data from the keyboard. If a keyboard transmission does not end within two milliseconds, a hex FF is placed in the keyboard controller's output buffer, and the receive time-out bit in the status register is set. No retries will be attempted on a receive time-out error. Note: When a receive error occurs in the default mode (bits 5,6, and 7 of the command byte set to 0), hex 00 is placed in the output buffer instead of hex FF. See "Commands (I/O Address Hex 64)" on page 1-51 for a detailed description of the command byte. Scan Code Translation Scan codes received from the keyboard are converted by the keyboard controller before being placed into the controller's output buffer. The following figure shows the keyboard layout. Each key position is numbered for reference. System Board 1-43 Keyboard 1-44 System Board The following figure is the scan-code translation table. System Scan Code Keyboard Scan Code 01 02 03 04 05 06 07 08 09 OA OB OC 00 OE OF 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 10 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 20 2E 2F 76 16 1E 26 25 2E 36 30 3E 46 45 4E 55 66 00 15 10 24 20 2C 35 3C 43 44 40 54 5B 5A 14 1C 1B 23 2B 34 33 3B 42 4B 4c 52 OE 12 50 1A 22 21 2A Key 90 2 3 4 5 6 7 8 9 10 11 12 13 15 16 17 18 19 20 21 22 23 24 25 26 27 28 43 30 31 32 33 34 35 36 37 38 39 40 41 1 44 14 46 47 48 49 Scan-Code Translation Table (Part 1 of 2) System Board 1-45 System Scan Code Keyboard Scan Code Key 30 31 32 33 34 35 36 38 39 3A 3B 3C 30 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4c 40 4E 4F 50 51 52 53 54 32 31 3A 41 49 4A 59 11 29 58 05 06 04 OC 03 OB 02 or 83 OA 01 09 50 51 52 53 54 55 57 58 61 64 70 65 71 66 77 7E 6C 75 70 7B 6B 73 74 79 69 72 7A 70 71 7F or 84 Scan-Code Translation Table (Part 2 of 2) 1-46 System Board 72 67 73 68 74 69 95 100 91 96 101 107 92 97 102 108 93 98 103 99 104 105 The following scan codes are reserved. Key Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved System Scan Code Keyboard Scan Code 55 56 57 58 59 5A 5B 5C 50 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 60 6E 6F 70 71 60 61 78 07 OF 17 1F 27 2F 37 3F 47 4F 56 5E 08 10 18 20 28 30 38 40 48 50 57 6F 13 19 39 51 53 5C 5F 62 63 64 65 67 68 6A 60 6E 72 73 74 75 76 77 78 79 7A 7B 7C 70 7E 7F Reserved Scan-Code Translation Table System Board 1-47 Sending Data to the Keyboard The keyboard sends data in the same serial format used to receive data from the keyboard. A parity bit is automatically inserted by the keyboard controller. If the keyboard does not start clocking the data from the keyboard controller within 15 milliseconds, or complete that clocking within 2 milliseconds, a hex FE is placed in the keyboard controller's output buffer, and the transmit time-out error bit is set in the status register. The keyboard is required to respond to all transmissions. The keyboard responds to any valid command and parameter, other than Echo and Resend, with an Acknowledge (ACK) response, hex FA. If the response contains a parity error, the keyboard controller places a hex FE in its output buffer, and the transmit time-out and parity error bits are set in the status register. The keyboard controller is programmed to set a 25-millisecond time limit for the keyboard to respond. If this time limit is exceeded, the keyboard controller places a hex FE in its output buffer and sets the transmit time-out and receive time-out error bits in the status register. No retries are attempted by the keyboard controller for any transmission error. Inhibit The keyboard interface may be inhibited by setting input port bit 7 (keyboard inhibit switch) to O. All transmissions to the keyboard will be allowed regardless of the state of this bit. The keyboard controller tests data received from the keyboard to determine if the byte received is a command response or a scan code. If the byte is a com.mand response, it is placed in the keyboard controller's output buffer. If the byte is a scan code, it is ignored. Keyboard Controller System Interface The keyboard controller communicates with the system through a status register, an output buffer, and an input buffer. The following figure is a block diagram of the keyboard interface. 1-48 System Board .--- RAM on the system board N .--- Manufacturing mode p .--- Display type Input Buffer r . System Data Bus ~ U T .--- Keyboard Inhibited ~ == ~~~~e~2~eset IRQ 1---+ u - +-jr-,-======= Output Buffer 1 T - Keyboard Clock--r-+ TPu Keyboard Data - -~2_K_R~_~_8~r+-_~ITTI+-_ _ _ _ _ _~ Keyboard Controller Interface Block Diagram Status Register The status register is an 8-bit read-only register at I/O address hex 64. It has information about the state of the keyboard controller (8042) and interface. It may be read at any time. Status-Register Bit Definition Bit 7 Parity Error-A 0 indicates the last byte of data received from the keyboard had odd parity. A 1 indicates the last byte had even parity. The keyboard should send data with odd parity. Bit 6 Receive Time-Out-A 1 indicates that a transmission was started by the keyboard but did not finish within the programmed receive time-out delay. Bit S Transmit Time-Out-A 1 indicates that a transmission started by the keyboard controller was not properly completed. If the transmit byte was not clocked out within the specified time limit, this will be the only error. System Board 1-49 If the transmit byte was clocked out but a response was not received within the programmed time limit, the transmit time-out and receive time-out error bits are set to 1. If the transmit byte was clocked out but the response was received with a parity error, the transmit time-out and parity error bits are set to 1. Bit 4 Inhibit Switch-This bit is updated whenever data is placed in the keyboard controller's output buffer. It reflects the state of the keyboard-inhibit switch. A 0 indicates the keyboard is inhibited. Bit 3 Command/Data-The keyboard controller's input buffer may be addressed as either I/O address hex 60 or 64. Address hex 60 is defined as the data port, and address hex 64 is defined as the command port. Writing to address hex 64 sets this bit to 1; writing to address hex 60 sets this bit to O. The controller uses this bit to determine if the byte in its input buffer should be interpreted as a command byte or a data byte. Bit 2 System Flag-This bit is monitored by the system during the reset routine. If it is a 0, the reset was caused by a power on. The controller sets this bit to 0 at power on and it is set to 1 after a successful self test. This bit can be changed by writing to the system flag bit in the command byte (hex 64). Bit 1 Input Buffer Full-A 0 indicates that the keyboard controller's input buffer (I/O address hex 60 or 64) is empty. A 1 indicates that data has been written into the buffer but the controller has not read the data. When the controller reads the input buffer, this bit will return to O. Bit 0 Output Buffer Full-A 0 indicates that the keyboard controller's output buffer has no data. A 1 indicates that the controller has placed data into its output buffer but the system has not yet read the data. When the system reads the output buffer (I/O address hex 60), this bit will return to a O. 1-50 System Board Output Buffer The output buffer is an 8-bit read-only register at I/O address hex 60. The keyboard controller uses the output buffer to send scan codes received from the keyboard, and data bytes requested by command, to the system. The output buffer should be read only when the output-buffer-full bit in the status register is 1. Input Buffer The input buffer is an 8-bit write-only register at I/O address hex 60 or 64. Writing to address hex 60 sets a flag, which indicates a data write; writing to address hex 64 sets a flag, indicating a command write. Data written to I/O address hex 60 is sent to the keyboard, unless the keyboard controller is expecting a data byte following a controller command. Data should be written to the controller's input buffer only if the input buffer's full bit in the status register is O. The following are valid keyboard controller commands. Commands (I/O Address Hex 64) 20 Read Keyboard Controller's Command Byte-The controller sends its current command byte to its output buffer. 60 Write Keyboard Controller's Command Byte-The next byte of data written to I/O address hex 60 is placed in the controller's command byte. Bit definitions of the command byte are as follows: Bit 7 Reserved-Should be written as a O. Bit 6 IBM Personal Computer Compatibility Mode-Writing a 1 to this bit causes the controller to convert the scan codes received from the keyboard to those used by the IBM Personal Computer. This includes converting a 2-byte break sequence to the 1-byte IBM Personal Computer format. System Board 1-51 Bit 5 IBM Personal Computer Mode-Writing a 1 to this bit programs the keyboard to support the IBM Personal Computer keyboard interface. In this mode the controller does not check parity or convert scan codes. Bit 4 Disable Keyboard-Writing a 1 to this bit disables the keyboard interface by driving the I clock I line low. Data is not sent or received. Bit 3 Inhibit Override-Writing a 1 to this bit disables the keyboard inhibit function. Bit 2 System Flag-The value written to this bit is placed in the system flag bit of the controller's status register. Bit 1 Reserved-Should be written as a O. Bit 0 Enable Output-Buffer-Full Interrupt-Writing a 1 to this bit causes the controller to generate an interrupt when it places data into its output buffer. AA Self-Test-This commands the controller to perform internal diagnostic tests. A hex 55 is placed in the output buffer if no errors are detected. AB Interface Test-This commands the controller to test the I keyboard clock I and I keyboard data I lines. The test result is placed in the output buffer as follows: 00 01 02 03 04 1-52 No error detected. The I keyboard clock I line is stuck low. The keyboard clock line is stuck high. The keyboard data line is stuck low. The I keyboard data I line is stuck high. I I System Board I I AC Diagnostic Dump-Sends 16 bytes of the controller's RAM, the current state of the input port, the current state of the output port, and the controller's program status word to the system. All items are sent in scan-code format. AD Disable Keyboard Feature-This command sets bit 4 of the controller's command byte. This disables the keyboard interface by driving the clock line low. Data will not be sent or received. AE Enable Keyboard Interface-This command clears bit 4 of the command byte, which releases the keyboard interface. CO Read Input Port-This commands the controller to read its input port and place the data in its output buffer. This command should be used only if the output buffer is empty. DO Read Output Port-This command causes the controller to read its output port and place the data in its output buffer. This command should be issued only if the output buffer is empty. D1 Write Output Port-The next byte of data written to I/O address hex 60 is placed in the controller's output port. Note: Bit 0 of the controller's output port is connected to System Reset. This bit should not be written low as it will reset the microprocessor. EO Read Test Inputs-This command causes the controller to read its TO and T 1 inputs. This data is placed in the output buffer. Data bit 0 represents TO, and data bit 1 represents T1. System Board 1-53 FO-FF Pulse Output Port-Bits 0 through 3 of the controller's output port may be pulsed low for approximately 6 microseconds. Bits 0 through 3 of this command indicate which bits are to be pulsed. A 0 indicates that the bit should be pulsed, and a 1 indicates the bit should not be modified. Note: Bit 0 of the controller's output port is connected to System Reset. Pulsing this bit resets the microprocessor. I/O Ports The keyboard controller has two I/O ports, one assigned for input and the other for output. Two test inputs are used by the controller to read the state of the keyboard's clock (TO) and data (Tl) lines. I I I I The following figures show bit definitions for the input and output ports, and the test-inputs. 1-54 System Board Bit 7 Bit 6 Bit 5 Bit 4 Bit Bit Bit Bit 3 2 1 0 Keyboard inhibit switch o = Keyboard inhibited 1 = Keyboard not inhibited Display switch - Primary display attached to: o = Color/Graphics adapter 1 = Monochrome adapter Manufacturing Jumper o = Manufacturing jumper installed 1 = Jumper not installed RAM on the system board o = Enable 512K of system board RAM 1 = Enable 256K of system board RAM Reserved Reserved Reserved Reserved Input-Port Bit Definitions Bit Bit Bit Bit Bit Bit Bit Bit 7 6 5 4 3 2 1 0 Keyboard data (output) Keyboard clock (output) Input buffer empty Output buffer full Reserved Reserved Gate A20 System reset Output-Port Bit Definitions Keyboard data (input) Keyboard clock (input) Test-Input Bit Definitions System Board 1-55 Real-Time Clock/CMOS RAM Information The RT/CMOS RAM chip (Motorola MC146818) contains the real-time clock and 64 bytes of CMOS RAM. The internal clock circuitry uses 14 bytes of this RAM, and the rest is allocated to configuration information. The following figure shows the CMOS RAM addresses. Addresses 00 - 00 DE OF 10 11 12 13 14 15 16 17 18 19 lA lB - 20 2E - 2F 30 31 32 33 34 - 3F Description * * Real-time clock information Diagnostic status byte * Shutdown status byte Diskette drive type byte - drives A and B Reserved Fixed disk type byte - types 1-14 Reserved Equipment byte Low base memory byte High base memory byte Low expansion memory byte High expansion memory byte Disk C extended byte Disk 0 extended byte Reserved 2-byte CMOS checksum * Low expansion memory byte * High expansion memory byte * Date century byte * Information flags (set during power on) Reserved CMOS RAM Address Map * These bytes are not included in the checksum calculation and are not part of the configuration record. 1-56 System Board Real-Time Clock Information The following figure describes real-time clock bytes and specifies their addresses. Byte Function Address 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Seconds Second Alarm Minutes Minute Alarm Hours Hour Alarm Day of Week Date of Month Month Year Status Register Status Register Status Register Status Register 00 01 02 03 04 05 06 07 08 09 OA OB OC OD A B C D Real-Time Clock Information (Addresses 00 - 00) Note: The setup program initializes registers A, B, C, and D when the time and date are set. Also Interrupt 1A is the BIOS interface to read/set the time and date. It initializes the status bytes the same as the Setup program. Status Register A Bit 7 Update in Progress (UIP)-A 1 indicates the time update cycle is in progress. A 0 indicates the current date and time are available to read. Bit 6-Bit 4 22-Stage Divider (DV2 through DVO)-These three divider-selection bits identify which time-base frequency is being used. The system initializes the stage divider to 010, which selects a 32.768-kHz time base. System Board 1-57 Bit 3-Bit 0 Rate Selection Bits (RS3 through RSO)-These bits allow the selection of a divider output frequency. The system initializes the rate selection bits to 0110, which selects a 1.024-kHz square wave output frequency and a 976.562-microsecond periodic interrupt rate. Status Register B Bit 7 Set-A 0 updates the cycle normally by advancing the counts at one-per-second. A 1 aborts any update cycle in progress and the program can initialize the 14 time-bytes without any further updates occurring until a 0 is written to this bit. Bit 6 Periodic Interrupt Enable (PIE)-This bit is a read/write bit that allows an interrupt to occur at a rate specified by the rate and divider bits in register A. A 1 enables an interrupt, and a 0 disables it. The system initializes this bit to O. Bit 5 Alarm Interrupt Enable (AIE)-A 1 enables the alarm interrupt, and a 0 disables it. The system initializes this bit to O. Bit 4 Update-Ended Interrupt Enabled (UIE)-A 1 enables the update-ended interrupt, and a 0 disables it. The system initializes this bit to O. Bit 3 Square Wave Enabled (SQWE)-A 1 enables the the square-wave frequency as set by the rate selection bits in register A, and a 0 disables the square wave. The system initializes this bit to O. Bit 2 Date Mode (DM)-This bit indicates whether the time and date calendar updates are to use binary or binary coded decimal (BCD) formats. A 1 indicates binary, and a 0 indicates BCD. The system initializes this bit to O. 1-58 System Board Bit 1 24/ 12-This bit indicates whether the hours byte is in the 24-hour or 12-hour mode. A 1 indicates the 24-hour mode and a 0 indicates the 12-hour mode. The system initializes this bit to 1. Bit 0 Daylight Savings Enabled (DSE)-A 1 enables daylight savings and a 0 disables daylight savings (standard time). The system initializes this bit to O. Status Register C Bit 7-Bit 4 IRQF, PF, AF, UP-These flag bits are read-only and are affected when the AlE, PIE, and VIE bits in register B are set to 1. Bit 3-Bit 0 Reserved-Should be written as a O. Status Register D Bit 7 Valid RAM Bit (VRB)-This bit is read-only and indicates the status of the power-sense pin (battery level). A 1 indicates battery power to the real-time clock is good. A 0 indicates the battery is dead, so RAM is not valid. Bits 6-Bit 0 Reserved-Should be written as a O. CMOS RAM Configuration Information The following lists show bit definitions for the CMOS configuration bytes (addresses hex OE - 3F). Diagnostic Status Byte (Hex OE) Bit 7 Power status of the real-time clock chip-A 0 indicates that the chip has not lost power, and a 1 indicates that the chip lost power. System Board 1-59 Bit 6 Configuration Record (Checksum Status Indicator)-A 0 indicates that checksum is good, and a 1 indicates it is bad. Bit 5 Incorrect Configuration Information-This is a check, at power-on time, of the equipment byte of the configuration record. A 0 indicates that the configuration information is valid, and a 1 indicates it is invalid. Power-on checks require: • At least one diskette drive to be installed (bit o of the equipment byte set to 1). • The primary display adapter setting in configuration matches the system board's display switch setting and the actual display adapter hardware in the system. Bit 4 Memory Size Comparison-A 0 indicates that the power-on check determined the same memory size as in the configuration record, and a 1 indicates the memory size is different. Bit 3 Fixed Disk Adapter/Drive C Initialization Status-A 0 indicates that the adapter and drive are functioning properly and the system can attempt "boot up." A 1 indicates that the adapter and/or drive C failed initialization, which prevents the system from attempting to "boot up." Bit 2 Time Status Indicator (POST validity check)- A o indicates that the time is valid, and a 1 indicates that it is invalid. Bit 1-Bit 0 Reserved 1-60 System Board Shutdown Status Byte (Hex OF) The bits in this byte are defined by the power on diagnostics. For more information about this byte, see "BIOS Listing. " Diskette Drive Type Byte (Hex 10) Bit 7-Bit 4 Type of first diskette drive installed: 0000 0001 0010 No drive is present. Double Sided Diskette Drive (48 TPI). High Capacity Diskette Drive (96 TPI). Note: Bit 3-Bit 0 0011 through 1111 are reserved. Type of second diskette drive installed: 0000 0001 0010 No drive is present. Double Sided Diskette Drive (48 TPI). High Capacity Diskette Drive (96 TPI). Note: 0011 through 1111 are reserved. Hex address 11 contains a reserved byte. System Board 1-61 Fixed Disk Type Byte (Hex 12) Bit 7-Bit 4 Bit 3-Bit 0 1-62 Defines the type of first fixed disk drive installed (drive C): 0000 No fixed disk drive is present. 0001 to 1110 Define type 1 through type 14 as shown in the following table (also see BIOS listing at label FD_TBL) 1111 Type 16 through 255. See "Drive C Extended Byte (Hex 19)" on page 1-65 . Defines the type of second fixed disk drive installed (drive D): 0000 No fixed disk drive is present. 0001 to 1110 Define type 1 through type 14 as shown in the following table (also see BIOS listing at label FD_TBL) 1111 Type 16 through 255. See "Drive D Extended Byte (Hex 1A)" on page 1-65 . System Board The following figure shows the BIOS fixed disk parameters. Type Cylinders Heads Wr i te Pre-Comp Landing Zone 1 2 3 4 5 6 7 8 9 10 11 12 13 14 306 615 615 940 940 615 462 733 900 820 855 855 306 733 4 4 6 8 6 4 8 5 15 3 5 7 8 7 128 300 300 512 512 None 256 None None None None None 128 None 305 615 615 940 940 615 511 733 901 820 855 855 319 733 15 Extended Parameters (hex 19 and 1A) BIOS Fixed Disk Parameters Hex address 13 contains a reserved byte. Equipment Byte (Hex 14) Bit 7-Bit 6 Indicates the number of diskette drives installed: 00 01 10 11 Bit 5-Bit 4 1 drive 2 drives Reserved Reserved Primary display 00 Primary display is attached to an adapter that has its own BIOS, such as one of the following: • • the Enhanced Graphics Adapter the Professional Graphics Controller. System Board 1-63 01 Primary display is in the 40-column mode and attached to the Color/Graphics Monitor Adapter. 10 Primary display is in the 80-column mode and attached to the Color/Graphics Monitor Adapter. 11 Primary display is attached to the Monochrome Display and Printer Adapter. Bit 3-Bit 2 Not used. Bit 1 Math Coprocessor presence bit: o 1 Math Coprocessor not installed Math Coprocessor installed Diskette drive presence bit: Bit 0 o 1 Diskette drive not installed Diskette drive installed Note: The equipment byte defines basic equipment in the system for power-on diagnostics. Low and High Base Memory Bytes (Hex 15 and 16) Bit 7-Bit 0 Address hex 1S-Low-byte base size Bit 7-Bit 0 Address hex 16-High-byte base size Valid Sizes: 0100H 0200H 0280H 1-64 System Board 256K-system board RAM 512K-system board RAM 640K-512K system board RAM and the IBM Personal Computer AT 128KB Memory Expansion Option Low and High Expansion Memory Bytes (Hex 17 and 18) Bit 7-Bit 0 Address hex 17-Low-byte expansion size Bit 7-Bit 0 Address hex 18-High-byte expansion size Valid Sizes: 512K-1/0 adapter 1024K-1/0 adapter (2 adapters) 1536K-1/0 adapter (3 adapters) through 3COOH 15360K I/O adapter (15M maximum). 0200H 0400H 0600H Drive C Extended Byte (Hex 19) Bit 7-Bit 0 Defines the type of first fixed disk drive installed (drive C): 00000000 through 00001111 are reserved. 00010000 to 11111111 define type 16 through 255 as shown in the following table (see BIOS listing at label FD_TBL). Drive D Extended Byte (Hex lA) Bit 7-Bit 0 Defines the type of second fixed disk drive installed (drive D): 00000000 through 00001111 are reserved. 00010000 to 11111111 define type 16 through 255 as shown in the following table (see BIOS listing at label FD_TBL). System Board 1-65 The following figure shows the BIOS fixed disk parameters for fixed disk drive types 16 through 22. Note: Types 23 through 255 are reserved. Type Cylinders Heads 16 17 18 19 20 21 22 612 977 977 1024 733 733 733 4 5 7 7 5 7 7 Wr ite Pre-Comp All Cyl 300 None 512 300 300 300 23 Reserved 255 Reserved Landing Zone 663 977 977 1023 732 732 733 BIOS Fixed Disk Parameters (Extended) Hex addresses IB through 2D are reserved. Checksum (Hex 2E and 2F) Bit 7-Bit 0 Address hex 2E-High byte of checksum Bit 7-Bit 0 Address hex 2F-Low byte of checksum Note: 1-66 Checksum is calculated on addresses hex 1O-2D. System Board Low and High Expansion Memory Bytes (Hex 30 and 31) Bit 7-Bit 0 Address hex 30-Low-byte expansion size Bit 7-Bit 0 Address hex 31-High-byte expansion size Valid Sizes: 02000 0400H 0600H 512K-1/0 adapter 1024K-I/0 adapter 1536K-I/0 adapter through 3COOH 15360K I/O adapter (15M maximum). Note: This word reflects the total expansion memory above the 1M address space as determined at power-on time. This expansion memory size can be determined through system interrupt 15 (see the BIOS listing). The base memory at power-on time is determined through the system memory-size-determine interrupt (hex 12). Date Century Byte (Hex 32) Bit 7-Bit 0 BCD value for the century (BIOS interface to read and set). Information Flag (Hex 33) Bit 7 When set, this bit indicates that the top 128K of base memory is installed. Bit 6 This bit is set to instruct the Setup utility to put out a first user message after initial setup. Bit 5-Bit 0 Reserved Hex addresses 34 through 3F are reserved. System Board 1-67 110 Operations Writing to CMOS RAM involves two steps: 1. OUT to port hex 70 with the CMOS address that will be written to. 2. OUT to port hex 71 with the data to be written. Reading CMOS RAM also requires two steps: 1. OUT to port hex 70 with the CMOS address that is to be read from. 2. IN from port hex 71, and the data read is returned in the AL register. 1-68 System Board Specifications System Unit Size • Length: 540 millimeters (21.3 inches) • Depth: 439 millimeters (17.3 inches) • Height: 162 millimeters (6.8 inches) Weight • 20.0 kilograms (44 pounds) Power Cables • Length: 1.8 meters (6 feet) Environment • Air Temperature System On: 15.6 to 32.2 degrees C (60 to 90 degre@s F) System Off: 10 to 43 degrees C (50 to 110 degrees F) • Wet Bulb Temperature System On: 22.8 degrees C (73 degrees F) System Off: 26.7 degrees C (80 degrees F) System Board 1-69 • Humidity System On: 8% to 80% System Off: 20% to 80% • Altitude Maximum altitude: 2133.6 meters (7000 feet) Heat Output • 1229 British Thermal Units (BTU) per hour Noise Level • Meets Class 3; 59 decibels average-noise rating (without printer) Electrical • Power: 450 VA • Range 1 Nominal: 115 Vac Minimum: 100 Vac Maximum: 125 Vac • Range 2 Nominal: 230 Vac Minimum: 200 Vac Maximum: 240 Vac 1-70 System Board Connectors The system board has the following additional connectors: • Two power-supply connectors (PS8 and PS9) • Speaker connector (119) • Power LED and key lock connector (J20) • Battery connector (J21) • Keyboard connector (J22) The pin assignments for the power-supply connectors, PS8 and PS9, are as follows. The pins are numbered 1 through 6 from the rear of the system. Connector ps8 PS9 Pin Assignments 1 2 3 4 5 6 Power Good +5 Vdc +12 Vdc -12 Vdc Ground Ground 1 2 3 4 5 6 Ground Ground -5 Vdc +5 Vdc +5 Vdc +5 Vdc Power Supply Connectors (PS8, PS9) System Board 1-71 The speaker connector, 119, is a 4-pin, keyed, Berg strip. The piris are numbered 1 through 4 from the front of the system. The pin assignments are as follows: Pin Function 1 Data out Key Ground +5 Vdc 2 3 4 Speaker Connector (J19) The power LED and key lock connector, J20, is a 5-pin Berg strip. The pins are numbered 1 through 5 from the front of the system. The pin assignments are as follows: Pin ASSignments 1 2 LED Power Key Ground Keyboard Inhibit Ground 3 4 5 Power LED and Key Lock Connector (J20) The battery connector, J21, is a 4-pin, keyed, Berg strip. The pins are numbered 1 through 4 from the right of the system. The pin assignments are as follows: Pin 1 2 3 4 Assignments Ground Not Used Key 6 Vdc Battery Connector (J21) 1-72 System Board The keyboard connector, 122, is a 5-pin, 90-degree Printed Circuit Board (PCB) mounting, DIN connector. For pin numbering, see the "Keyboard" Section. The pin assignments are as follows: Pin 1 2 3 4 5 Assignments Keyboard Clock Keyboard Data Reserved Ground +5 Vdc Keyboard Connector (J22) System Board 1-73 The following figure shows the layout of the system board. Keyboard Connector Rear Panel Battery ~~ Connector ~~=I=' (J21) Power Supply Connectors I/O Channel Connectors Variable Capacitor - - - - - -, rnrnrnrnrnrnrnrnrn I I rn~rnrnrnrnrnrnrn : @] 1-74 System Board Note: The memory module layout and system board dimensions may vary. Notes: System Board 1-75 Logic Diagrams - Type 1 ~e; go2l:;g~;%~g~~65~~ ~~ - - C\I C\I 0 .... .... G) G) •• .c .. 8C~Sg~gb~g~5~5~~§ ~ IV C IV a: ,-- 1 m ~ C\I .- Il) .- :r -I' G) c. li~I~~ jl*ego~~",~g:;~g~o~:::g~~" 8 ~~ 1-7 6 System Board ~~~~ §"§' ",iS~'~i~ 11'1 It! , "" ::.:~gi:"'''''i ... "'II'I~!. iil~~ SA' so. 1 (SH.4) (SH.6) 7 , 5 ,, SAS SA6 m SA' -OM' "EN RNI+-1 '5 10. , ALS02 ~IO. Isr (SH.4) r , ,, , SAil "0 5., s.., , 5 r . : A A A 19 . .. ," ," '" ,,"" ,," " B" glR 7 '" SAID ".5" : A (81'1.1,11,14,15,16) (SH.l,1',14,15,17) (SH.3,1',14,15) us '" '" (SH.l,1',14,18) (SH.l',13,14) (SH.11,13,14) (SH.11,l3,14) (SH.l1,_13,14) GRZ (SH.e,lS) '" (SH.l1,l3,14) '" '" '" A 2 .. 0; A ," ,,8""\2 A A • B , "I' : 1& DlR G '" '" (SH.3) "" Type 1 512KB Planar (Sheet 5 of 22) XAIO XAII XAI2 ISH,C4( XAIl ~AI" XAI'i· XAIE. (SH.l1,14) (SH.ll,14,lS) (SH.2) I (SH.2) , SDO SOl SDl S", SD6 SD, Il I (8H.2) SOli 5012 SDI~ Il 5010:; l .... (SH.5) (SH.5) (SH.4) -RAM 0 CA8 -RAM 1 CAS -LCS ROM (SH.15) +0 -XMEMR (8H.5) (SH.22) '" "" (SH.8,9,10.11) "" "" (SH.8.9,IO.ll) MOlD Hall MOl2 Hon HOI.. HalO:; " ,' I' WI! SDI" 1 "Db '. ~ ," ,, "" '' soe SD' (51·1.15) f= , ~' st>m (SH.8,9.10,11) "DZ ~'""", ,, SO, (5H.1S) (8H.2) ",>0 "" "" "" "" ~: SO, ' I (SH.6,9,10,11) IIr~- II~j '" ~----------~~:l'-'------J ~ '~-----------j BM/IO (SH.2) ALSO" (SH.2) (SH.2) {SH.71 (SH.2) (8H.2) (8H.12) (SH.19) ALE -MEMW +RAS -lOR +AIQW 01 -10 CS 16 !~~:~;l ~~~~ ~~:~) ~:~~~8 I HUll 10 !~ i"~H'I-I ,-I UO PAllt>l' ~ III1~~~~~~n ~'~'~~~~~~~~~~~~~~~~~~~~ gfJ~.fsONV i~~: ~~; GATE 245 -OMAAEN -END eyc (SH.13) (8H.5.1S) (8H.12) __________________ __________ 20 -i ~ I .... QO Type 1 512KB Planar (Sheet 6 of 22) l N0I1:J3S ... f= ., ·'f: I 10K QO N ~ (SH.5) -LMEGCS (SH.2) -I'1EHR -HEHW (SH.2) ALS"" ~:~ ~T-P~' 1.2 l 9 "K AI, y~1 '12 "n ',on " 16 " I Y2 12 U'I9 FOD l;Ju90 8 l '" + RAS 1,J DEL"Y U61 PEllZ n ItO 110 If [20 160 200 10 6 'I 1 (SH.5) -RAM 0 CAS (SH.5) (SH.5) +RAM 0 RAS +RAM 2RAS (SH.5) -IW'II CAS I U81 ALSO If (SH.5) (SH.5) 1 uel , , I Z u,,)q ~ +RM'IIRAS U,)II II) 6 I 2 UC;II II) FlO I 10 (SH.2) XAO -XllH' 'i U81 6 12 -RAS 0 7 100 ,0 (SH.a) (SH.e) 1 100 1'4 (SH.a) Fro , II U,)7"'\. 8 2 FlO 13 u'n 11 FlO ~ U'51 II FlO OJ U'il 10 II If 1011 11 FlO t~ AlSO" (SH.15) ,., FlO ~ u·n\..6 , II (SH.6) (SH.a) If U,)1\'6 12 Foe 11 U'>9 +RAMl AtS FO' 1 .RAS +(A5 ~ ALSOIf (SH.20) (SH.20) l TINE III -SHEHR -SMEMW FtO ~ use Type 1 512KB Planar (Sheet 7 of 22) 12 12 • , tI 101'1 11 2 1OO ; DINI DOUT ,,lit -"" SA' S" SAO SAID SAl' SAIl """'SEL _n rm Hf)II; ISH. 21) _ REFRESH -- I: I 110" I DIN U..l 1.11f DlN/OOUT I Iii 1.'1t 'I 'I VI 1 ~I -... -RAS' , ,,on , ," I ItA, H. . q HAl "AO HAl -"" U. . -• 1- ...."" """ HO' MO" ""' 1101' _HI -, lRASi AO . . A' 12 ~ , Al , ' ., " ~ ~o m I ,It DIN/Dour ,. -, r ., I • TO ClIO 9-.10/ol;J I ., '" DIN/OOOT ,~ i' HAO HAl (SH.9) "A' , I~TAGE HMo MAO 8H "" ItA' H'" I 2-IOIIF , 9-.'Oj.\~ ( 10pF: Cl,2,52,53 .10,.F: C7,1',16,20,28, 32,38.42,47 ca,12,17,21.29. 2-,o"rl 33,39,43,48 ...w, '" "'""'" '" '"I,llt 1,IIt U. . U. . , DIN/OOUT "" DIN/DOUT (9) 128KX! U'tlt'lf rIFOUTl (SH. 9,10) ~ I ~ ~ Type 1 51 2KB Planar (Sheet 8 of 22) L NOl133S .... ~ I MOO MOl CID olio. MOl MO' IZl M" ~ ~ ~ !!!!! Ii! = l 10 lit ""' .!!!! DIN IDOUT Ul') 1.11f 1.11f DIN / DOUT lI2'i DIN IOOUT U~ 1.11f tIN /OOUT TA. 1& (SH.e) r TA, m MOO .. m- I1DII .=.!&..l "01 "0' ~ -.... "'", OO =1!ll " - -CAS IL MO" "00 .o, ~ Ie "Al !! 1 """A'"A' 11 "AI ItA, (SH.a) .... 1 (SH.7) -to. . , t (SH.7) -RAS. -CASIL -rutH -+-- • FZIt' AN' It'L2 u•• TAO TAl t . --' L..J1 , ,.n TA' TA' TA TA. TA7 HOPIN I HOPINO (SH.1O) HOPINI (SH.8) (SH.a) (SH.22) "'fOUT. ......url -TVE I,DIN MIlII MD. 1.11f hi .. HOlD 1,'1f HDII MOl2 I, 'If Ulfe. . DIN/DOur Uif ~UIO BAN" OJN lOOUT UII DrN / DOUT U22 HOll MaIO liT m TAl 'm" m TA, ~fAS , ::;w-!!AS • -CAS I H OECOUPUNG CAP: YOLTAGE I lANK TO GND + '5 ~ TAO {SH.l0) I OPTIONAL HDPOUT I I. (SH.S) l( PQ)pour 0 -. .-"'"'.....+. (SH.e) lANk 2 =l.!tL " "1 ~ I~ 7 +. ..., AI "'2 A• A' •• A7 ~wr I·.~ (,,) 128 K IC I ~ OPTIONAL Type 1 512KB Planar (Sheet 9 of 22) 19-.IQuF I "-./OuF 2-101.11'" I Z-IOuF lOpF: C3,4,54,55 .1Op.F: ca,l3,18,22.30. 34,40,44,49 Cl0,14,19,23,31, 35,41,45.50 ~ ~ ~ @ ~ ~ ~ f ~ 0; "" "'" .,.. ~ @ " ~ "~ "" '" "~ "~ ~" " ~ i="iil N ~ !2.~ I:l :i:r I I:l :J: System Board 1-85 i4~~~~~!;;;~S:~i~!ii~'lf:8c21~gl!';8::;~ ~: = ~~~~ ~~ ~~ ~ ~--~-~ N .... ........ CD CD .c -.. U) as c as a:: III ~ C'\I .... It) 1-86 System Board r--------------- I I 1 1 I I , '8 - 01 (SH.B,tS) (SH.t) -ARDY - on (SH.S) L--f---------':========i-----------------------JIJI- RES/i!I'oIS ~Jl----::-=----------------------AROyEN (SH.S) (SH.1) (SH.S) .ATA CONY FI1'l '" +CONYA' l_-.__~~~___________~~::--------~~~~~DZ DI (SH.4) ., i == D' CLftUIOO -RESET (SH.3) -~5 r;lE>' III l .. +CONVAlE (SH.4) ~-CNTLOFF (8H.2) 11 I~. I QC ...... Type 1 512KB Planar (Sheet 12 of 22) l I NOll::J~S . """" I Of) Of) (SH.6) (SH.21 t OIR'Zlfl) fI} {SH.21 ~ (SH.6) GATEl't'i -e ~ == 0 a. + (SH.21 I so; SO SO, SO' SO, SO 00 ••• o • ,, •• • I 'DO 500 SO ,• , 500 507 2 ALSZIf"i 5 SO, """ •• " •• ~ ~IR ." • I SDt~ " : 17 • SOIl) UI02 508 SO, 5010 1 (SH.21 SOil SO" 501' SI'" 500 •• , o• 5"' .. , 00 507 11 ALS08 (SH.31 ·..' . .'"'"" '. • SDllf HLDA (SH.19) -MASTER 12 U"~ II I AlS04 q us. • Al 52 Lt') B :"i • I :• 17 18 "• ,---l OIR 2 AlS27 (SH.2) -lNTA , UI21 (SH.5) (SH.5) (SH.5) ,u I 2 • 'I KA7 ., '2 .13 . • ~ .q 'D' 'D7 (SH.14,15,16,17,18) (SH. 3,14,15,16,17,18) +ACK -ACK (SH.3) (SH.4,15) Uill I~ ALSOIf 'D' '0' -A(K JIM XA8 -XIOR -NPCS V2 (SH.14('.'''''8) KO' ~ (SH.S) (SH.5) (SH. 15) (SH.3) UBit '00 '01 '02 U62 8 10 USIH , L---'.: TO • C G2' G2B GI to; tit n 12 ~ 10 YO • T7 7 UI 2 1 Type 1 51 2KB Planar (Sheet 13 of 22) -OMAt (S -INTRICS -TIC (s (SH.14) (SH.lS) (SH.1S) -PPI (S ISH. 18) -PG REG (S (SH. 15) -ItHR 2CS (SH.l{;1 -OMA2(S (SH.14) - CS 287 (SH.3) . . ~ "- 55 fij ~2~~ ~ wfii ~ §"§~~ "- ~ ~~ IIII !!H'?.~~ 1 t:1~1~'~1 W·· ..···· :1tr~1~1~ f···· ..· I~J ~ <>-"'r-->I!",:t''''N I ~ noon:ooool~ 0000:000'" J~~l~c~ :lJ:r :l:r =-Lre:oaH~~ 8-2l~g~~3 >< ex ><><><>< g~ , ltlf of ~~ # I~ c- ?= " ~ ~~~ ~ ~~ <>-"'r-- .o",%",N . f:'1f:'1f:'1~ z. ~~~~ I------ fijfij ~ .J r im •, ~~ . .;; ~ ~.~.,g o~~ ~1;g ~ . ~ J~~ o ~ ~ nn~I~I~I~'~~d~ ~ Nr •~ I~ - ~ o ~ ,... ... .d ["., . . • ~ 5 6 I ~i . ~ ~n ~ ~~~~ 5 ~ .;;, •• ~., 8o~ ~g ~ g8~n~1i1~~I~'"~d ~ ~""."~~'"-~'"N'. ___ N_'=·-Il ~~~~~~~~~~~~~~~N - -- - , Q) Q) ~ --... (/) IU C IU c: ID ~ t- if-- ('II ,... It) ,... I Q) Q. ~ ~-~5x'~'oo~-~~.~~- l ~ ~ = •"~ - 'ld~ '"~! ~, f I~~j~j~j ~ ~ ~8~~ ~S~e~~H~ee .I! Igl~I~I~I;I~I~~I~I! I ;M~ :il:I !:2.f:'1~ System Board 1-89 ! g'" ~.:;.... ~ 5 'i~!-' ~~ C\I C\I -... o It) ....Q) Q) s: -. tJ) - aI C aI is:: m ~ D ~ ~~ ... ... C\I ·-='·~·IT~j It) # - '. 1tH~==I=+:j::j:=j:+=+==t1t1l .... ~ ~I L~ -< mo . ... ~.c« ' IOKtAN'i-!I .."" 5"t'NC\-!L--NC ICEYBOARDCONIt. ('iPINOIN) ~::::=l::l:j:t===~ ~ :: ~k:A r-:-;::::=ti:It===3:j; ~ ::~ ~~O , 'TESTO ruTl .§..M!! klIOCLK 0 "" l:,:·::r IOTTOI't (PlNSIOE") ,SH.l0) l:~: ~I (SH.21) PCK~~~~~~~~~~~~~~~~~'III 10 ~~g REFDET Type 1 512KB Planar (Sheet 17 of 22) .1 I • "f~'i. FUl (SH.22) (SH.t! (SH.51 (SH.tB) -.... C\I C\I o ..... CO :;:~ ~ a: :JL-., Q) Q) .c tn -... «I c: «I D: ID . ~~ ~ e§ [~ ~ E ~ zz N I~ ~ ~ .... ~ ... ... ,r C\I 10 ~ ,N ~~ > 5 M MN ~-;;; 1!21!2 1!2 ~iO§'~~ ~~~~~ System Board 1-93 ... I '= ~ 00 '< '".... ~ e t:C Q ~ =- ~ ~~n ~;;Og r-'~~~-J~,;rr 'T SDe so, SOlO SOli SOl2 SOt1 so," (SH.2) s~s (SH.4) LAn LAZ2 LA21 LA2D ! (SH.4) (SH.2,21) (Sh.2l SBI£ -M[I1R -I'1EI'1W CII liD m '" ill CONNECTOR 06 PIN} ill DI7 1001 002 ill: I (SH.14) -DACKO -OA(I<'; -OAO B11 u All DOInCDI D1SUC!8 Type 1 512KB Planar (Sheet 19 of 22) (SH.14) (SH.14) (SH.14) (SH.14) (SH.16) t (SH.IS) (SH.2) SDO SOl S02 1 (SH.2) (SH.4) SOl S," S", SD6 S07 SAD SAl SAl SAl S'" SA> SA' SA7 SAO SAO 5,1,'0 SAil SAI2 SA" 5,1",+ (SH.4) 00 '< ~ S,I,I'j SAlt. SAI7 SAle SAt9 A" A08 A 7 A , AOJ J8 A27 A22 ,ALE OWS ". (SH.3) (SH.12,15,21) IRQ 9 IRQ ~ IRQ '+ IRQ'i IRQ 6 IRQ 7 (SH.16) 822 .IB ." ." AI2 (SH.3) (SH.22) -liD (H (I( J/O (H ROY '" .21 BI' .".26.17 ." ".'" Am '04 A" -REFRESH -0,1,(1( t -0,1,(1( 2 -0,1,(1( ~ ., .", A ." AlB AI7 AI AI; A" (SH.21) (SH.14) (SH.14) (SH.14) Os( ,+,1K J7 Al' A27 m Al' A SYS(LI( 7 Ie AEN .29 J6 A7I (SH.3) (SH.l0) (SH.14) (SH.3) (SH.3) RESET DRY ., ", JS A02 -lOR -S MEMR -5 MEMW '" AOS A04 (SH.2) (SH.2) (SH.7) (SH.7) -lOW JI " I 811 L ! (SH.16) ORQ I ORQ2 (SH.14) (SH.14) (SH.14) PWR GOOD (SH.1,1S) TPI2 PS. PCYoIER 820 J 827 All .02 '0' 807 +12 -12 G ." 1D"~1,"7"F .01 BID 82. 0(26) ", 'D7 I ~ +, (X2'I) I I ONN. iID':l S'" ~ -'i ~ PS' GNO I GNO ~-o;YI +, y 'j 6 GOOO e c e c +0; ~ DC +'i \ DC ('I) a = Q .., ~ =- .... I \C fA Type 1 51 2KB Planar (Sheet 20 of 22) L NOI133S N N -.... o N .... Q) Q) .c -... en CU C CU D: 1%1 ::.:: N .... It') !i "~ 1-96 ~ ~ , ~ ~ "~ §,.,. xi ~~ System Board "~ Ii ~ ~ .• ~ ~ • '" ~ iii ~ '" . . w , 12 ~ , Ii ~ ~ ~a: .1 .d fp!-o~ 8 5 e v ~ : Q ~ -.. ~ C'I o L--'-- C'I C'I ~ ~ 0 10 d CD CD ~ .c -.'".. ~ U) C a::'" III :.::: ... ... C'I it) !:l!! = S 5 ~ ~ L i i ~ ~ _0_ .~~ --- iii !'J.!'J.a. ~ 3j ~ ~ ~< ~ :: ~iOJi9 ~ ~~~ ~ IS ~ ~ i i" System Board 1-97 Logic Diagrams - Type 2 ~-.-----" ~ '~ g ~~ ~~c~:~~~~~~~~~~~~~~~~~~~$ ~L ~ t- -........ ('oj +- 0 ....... Q) Q) .c -... en IV c: IV c:: r:D ~ ('oj .... 10 ('oj l~P~1 ~~ re i!iH~~ ~_ ~~ - _ .. ~~ ~=:= i?'! 1-98 ~~ System Board @@@~ ~~ L-. = ... "'....... Q) Q. Ir--"l'", ~ :;; ~ ; "~ "a ~. ~ ~i? :i:i @.@. "- ~, -.=-c; n 1a.!1. ~~~!i'~ 9~ ~~ ~ = ey -- e;::-;::;::";=-;::xIII:':I :.;:i !!2-12!!2-!2!!H.2 [{d.!Q. ~ < " ~ < " :~ ~~ gc2:l52)~i!:S ra.ra. ~-- iI < " !:g~~~~~!S ~ -~ System Board 1-99 ...... = I = 00- '< [I} (SH.t) (SH.2) (SH.l) .... 11 "" + RESET 281 " 19 -XIOW (SH.4) (SH.t) (SH.l) HALlbL8A p, (SH.5) (SH.14) (SH.14) (SH.12) R[SE'l -fInn ,, ,"/!l> -(52IH " ,, -IHTA ~ OUSY -ERROft +RESET ., (SH.l,2,11,12) (SH.t) (SH.l5) ""19 10 lO (SH.4,9,11,14,20,21) UI30 ~ a t:= (SH.t) -MP(S -BUSY 286 rRG n OI1AClI( (SH.13,14) -OMACLK (SH.20) (SH.t) 0 e; EHAS (SH.l7) All Co " " SVSCLK (SH.19,20,21) -SYSCLI( {SH.ll} Al' (SH. 1) -16t'1HZ PROCCLK " " "lO PROCell( +PClK (SH. 16) + n" 10 (If (SH.2,1t) (SH.l6) (SH.16) ., (SH.t6) (SH.19) -JOCKO (SH.9l -PCk (SH.12) X07 (SH. 17) -""I C5 (SH.l) (SH.12) (SH.5) (SH.l) U(I( G~~~ 'PU"'-'" ,HI ~LL' Y,~'~~~~ "" :~ .' .---..!L : Y. 7 ;: C U1'i Type 2 512KB Planar (Sheet 3 of 21) (SH.l) fllDA (SH. 1,5,12,20) BALE (SH.t9) (SH.19) (SH.t9) RESET ORV ":;}'" -~~ n !QIQ ~ at 6l ~ ~-~!Q !Q -,'".. o 'It ....GI GI .c -... en CO c: ~! ~ "0(<0; '" "'c..: .. ~'" t ~ :iii! g CO Nr 00000 0 Go. c:: k.:>1'S IX! ~ '" '" ,.. It) GI Q, ~ ~ :; ~ C~;~~~:o::~ ~i~~~~~! ~~N~!:!!!: . . . . . C .... C ~~ ~ Y ~-~~ 12!!?. !!?. -~ "" ~-~ ;:-;:-;0 ~~~ ~ I §. "~ §" System Board 1-101 ...... (SH.4) I = N if .... (I.l (SH.l) ! (SH.l) (SH.20) .. ," ...'" 'A20 21 ." "' , ~P,J "K 51 = e; Q. '2 - HLOA ALE (SH.4) (SH.6) l~' , RCASI - ( r------rl- ~ ,ii. "72 ~ , U6~ ; , '" If UIIO ,AI . SA< -OM.....EN .. ,." ,. , , 5,1,10 ..0 SAH ... , ,, , , 7 '" ,"" '" '" 5AII (SH,7) o 12 ~ 19 0" -RAN 0 (AS -RAM I CAS -LMEG (s (SH.6,7) (SH.5) (SH.7) +FSYS 16 (SH.6) "b' ALS02 t : "" " 6 6 SA2 RH'f-l (SH.4i lit ., JUP1.PER " "K 'ST I "~~ 0'18 0Ht:: g~ 0 0 0 0 -ReA.SO -HEM CS.6 (SH.3) I g~ '0 DZ , ," , 0 , 0 RAS ,"" Iq 47 ALS,)H ,+RRAsa ,-+ -RAM SEL {SH."} (SH.4) Dt RN't-IO ')6/o;IZK R. t {SH.16} (SH.1S) 00' 2" AI7 .REF"ESH ~ 0 285 .. 2 r 2 . .. ··."" . · " .Ob"" e" • .OB 7 • A : "" " Ib OIR r' XAI XA2 XA4 XAS XA6 XA7 XA8 (SH.l,10,13,14,15) (SH.l,10,13,14,16) (SH.3,10,13,14) (SH.l,10,13,17) (SH,lO,12,13) (SH.l0,12,13) (SH.l0,12,13) (SH.l0,12.13) GRZ (SH.8,14) XIIIO (SHf" XA~ B :~ , , 19 (SH.3) "" ..,, .. . " ··" ,. '" 2 GATE ALE AL5Z't., : glR (SH.6) "'" Type 2 512KB Planar (Sheet 5 of 21) (SH.l0,12.13) JAil XAI2 XAI'l XAI~ ~A'b (SH.l0,13) (SH.l0,13,14) ..... ... C'I r; .. 0 CD Q ~I Q) Q) .c -... en ........................ c:w as s::::: as ........................ 01..:0 c:: m ~ C'I ..... It) C'I Q) C. >- -I I .,'" ~I ~ 1 1 I I I 1 1 1 1 1 1 1 1 I I 1 1 , L _ _ _ _ _ _ _ ...J =2 ~~~ ~~~~~m . ~~~~~~~~ e HtJ, N ~ N ~ LfiLfi., ~-~ "- iii 121212 N i-i 12 12 "- ~ N I- ,---:;; ----, , - - ..1- " !:l! '!'- I:;:'~ ,I ,I L~. I '" ~, ~~ ~ 1il~ . "- ~~ r::-NNN;:~!25;1il; ~ ~~~~~~~~~~~ System Board 1-103 .... I•• ~ <= "" en. .. ··f~." I (SH.5) fSH.2) -LMEG CS -!'lEMA (SH.2) -"E"" G~! :TF~' A2 '< .u.."" , "III ." ,.n I. yzl1 1 Rlif' U"9 ~~ EI i=-= 9 FOD ,;JU't6 8 +RAS 1 TItlE II DELAY U.' PE21211 "0 80 I2L ' 120160 I• • I 200 8 -SMEttR -SMEI1W .... I I USI 2 I 2 U"i" ~ (SH. 5) +RAH 0 RAS ALSI" (SH.14) lAO , USI F.8 1 ~ "i FlO ~ UIj'l ISH. 8) II FlO • -HAS 0 (SH.SI -CASOl (SH.S) -CASOH {SH.81 .N2 .. lOOn I • ,9 U"il II 'N2 8 - XBHE r1DD,:l I FlO I'll U"iB (SH. 2) AODR SEL +CAS U"iB (SH.5) '-RApt 0(A5 ISH.S) I ! ~ ALSO" (SH-19) (51:1.19) 8 ! 1 10'11&1 L _..1 -UD + RAM SEL Type 2 512-KB Planar (Sheet 7 of 21) (SH.9) (SH. 9) ,.. -... N o co Q) Q) or: -... tJ) co c co c:: m ~ N ,.. It) - N I Q) Q. ~ ~~::~~~~'!'~I" LI':!'" ~ ..0_"-0;;> !C ~R xi-xi ~ ~!!! System Board 1-105 """I , = =" ,~. oscl rz 171tl esc (SH.191 1.19 MHZ (SH. 15) """ 00 ~ .... ~ CLKi-!- Ne {SH.l} flC (SH.3) PULL Uf' 51 t= = +-__~'.~"'~'~ '~LKCL' '00 (SH.S) FleD 1<; .. A ~ d- PClf(' l (SH.S) HDO HOI H., H.' H•• HO' (SH.S) H•• H., H.' H •• "'" HO" HO" MOil (SH.S) (SH.7) (SH.7) (SH.2) HO" H., -lAO +R""'SEl -..... 10K ~::~J ""r------'~""E ,, ' I ~ +-__-":I":=::h~6 (SH.B) (SH.S) ~ ,. RN"-'i +'; ~ U~ FlBD ~" ----If~ ~'" ~~ ,' I ~- (SH.B) "]"r----------t-' "E UI2 ~~==~~~~~~h--"I II I us"> 8 11 ;,~ mQP'~-,,_ __ (l~86 :r"I.!.._-+T___ 12 0 II (LR " (SH.14) (SH,1S) I (SH.S) 'i~O:b Type 2 512KB Planar (Sheet 9 of 21) (SH.3) (SH.1S) i;;;:S!!:;:ii~ttii:lt~i~~;:,!!;;8i5~S~~;!l~ ~: go- ... II' lC~- -_ ~_:f!!:: ~ -.... ~ '0 o .... i .c -. en cu cu c a:: m ~ ~ .... II) 111 ~ CD Do ~ •" " " "~ ~ , ~" System Board 1-107 ~ (SH.3) -PROCCll( (SH.3) ...,..,.. I ~ = QC ISH. 20) \1.1 '< ;- e = a. => (SH.l) (SH.19) -5YS(LK PUU UP (SH.4) AU ALE (SH.l) +RESET (SH.S) -ENDm (SH.S) ARDY (SH.l) QLf (SH.S) +IOCMRDY' (SH.3) (SH.21) (SH.s,17) - ....T oW> RES/flWS (SH.6) AROVEN (SH.1) CONVAO ISH. 4) CONVALE (SH.4) (NTlOFF (SH.2) DATA (ON' -RESET (SH.3) -fFCS Type 2 512KB Planar (Sheet 11 of 21) (SH.6) O1R 2"1j: (SH.. 2) 5DO 5D' 5DZ 5D' ==== - (SH.2) SDO SD7 (SH.6) GATE 2'l1j ----i ... -===::: 5D'I (SH.2) 1 (SH.2) SDO SDIO SDIl SD~ 51>' SD" .,.. 'DO ~ 1 ... ALS2ltlj: , ===: • , ••• , , 1 ~ ~ A A A A A A A • R'• === , = i """ """ = \C -"PCS -INT'" ISH. 5) (SH.5) (SH.5) , .... ,., -'lOR . u,o. ," AlS21t'i 5.0 ~UIlc0--11 .. I ALSO .. • UB' ~ • U8't 12 4·' 121 "" "IZ 8 ,. ~ 9 : :'i ' ' •• '.0 (813., .. ... (SH.13,l4,15,16,17) (SH.3,13,14,lS,l6.1n '0' ,.z ,., '0' ,., B:tt ,A :'"" '01 ,5., ••171 riglR Uill -ACK 2 ALS2l f---!kJ ·•...• • A 1,,"LS08 (SH.·2) SDn SOltt SLlI'i : lit SI!.J •• ...... " :'"' ===::: 507 ISH. 5) (SH.5) (SH.14) (SH.3) ROO '" 29 "27 00 DI D2 01 " "' Z2 I 17 "''' RI .. -DHA""" -XMEHW -Dt1A2CS H 1 " I ~oUy., EOP ... Dr; g~ OREG2 11 OREal ~ !ET I~ ~ , 'l' "CO, ~g ...18' AEN'I "., ~ '" "" "" "" I1fI' ~ I~S08 Z LstlZ 1)110 , 00 . . "'" ,,., ~g~ ~g~ D7 :=::ii :::. f.-----l.l " i-------'" ., (SH.12) '" "" '" ~ , f:'... -" (SH.13)- DHA HEttI: (SH.3) PULL" (SH.3) 0I1A (LI ." OS, ," I . , 'i 'ir. l51Z'i 'iUJq to r 1'1 l'i Ito 17 R5Z Zl l:" "'" ~ :J:~:;: I ~ I -RESET = a. (SH.5) (SH,2) e ...... I~ '"' g L==:I 0 UII'I HRQI do (SHt) (8H.4) (8H.4) '"' -lOW -lOR -lIE'" -","" SA' (SH.19) +IOCHRO't ~ %" . A : US'I I " ~F=T XBIE , , ~ Q Q!'; f:' T'," J~ ~ -IJoIAAEN ~3if. -to; 00 U'J'I to (SH.2.6l (SH.2.3.6,7.13,15.17) LHRQ I (SH.20) SDCLk (SH.2t) UIZI 9 1 :18 'I 1 (SH.l) I " 1 A 8 n 'i~I'j (SH.l) 1M I ~'es,,, 00 l a ., RN'i-Io; If (SH.t) (SH.13) (SH.5) ., :~:09E r .Alto '" '""" '" '" '" 1'1 U.' leo RSO (SH.5) (SH.5) (SH.5) h HOO HOI HOZ HOl ," " "", """ "" ., IOCLRQ'J UIO'J IJCLI~8 ~ ~ 'U"'i 'i ALSOZ ;:) IJCII ~ -XICW (SH.l,3,13.15,16.17) -11M (SH.l,12.13.15,18,17) -xt£HW (SH.13,21) -XI'EHR(SH.6,9.10) +DI'IA ROV (SH. 13) b I Type 2 512KB Planar (Sheet 14 of 21) L NOIl~HS I"'" (SH.1S) S.. dDATA-----------------------~ I I"'" I"'" W ~ ~ m = e ~. Q. el'j9A (SH.1!!) (SH.tS) (SH.t9) f (SH.tS) (SH.t:!!) (SH.t2) I (SH.t2) (SH.14) (SH.14J (SH.14) (SH.:!) ISH.51 (SH.17) (SH.t9) (SH.tS) (SH.t8) . (SH.tS) (SH.S) (SH.tS) (SH.ts) (SH.t2) OPT aUF 18'IRO =.~ --------uii1 ...,,.,, ,- U... ~IRI - INTI-ll ~::~ '" '" ll:J ::; Il107 -MltleS .::!1M xx.,•• x., xXOl m,... ., ~ ~ ill RN'j-l SP/EN II> "'t!-"., AO "INTA DO iOl GN°h ., .,.,." 91 01 .. XI" XII7 -1I0R -""" ". CASO~ CASt 11 .7 -INTI. (SH.20) (HASTER)C"52 "" , ':il( IRIIIO IRQII ....,, .... (SH.9) m GNO'" ., , ~ ~ ~ 0 , '" " ... -lNnrzcs r' t::::::::tt"~"IIO 2:~~ ~ g~H. n ==tljt===== = _ Tiff 2~TE·5PI( J 1.19tfHZ I I ~:1 . . I (SLA'" ---r-- IIr . I~:; XDI . r.·",~. t====If -T/ces eLK 0 II Dl If If g~ X[)6 2 'n Db I (SH.tll) T!F Uo;Z !{C - 'co lY~ Ilun ........ ~ (SH.tB) (SH.t) , ..'" ----.--Jes: ..=!.l.Ql!. IN' 21 - 1 01 " Type 2 512KB Planar (Sheet 15 of 21) -:- (SH.t5) (SH.te) W)~;::§' ~~~~ ~ ;~e. '::~I:I- I I r::::.- ~ ~ r- -.... - ~H' f------<,;:-" C'I o E~ CD .... ....CD ~ CD .s:: -.. en ~L JJJJ ~;;:::i'~ ftI C ftI . ~ a: ~ 3 m _N .d I---- JJ ~li "~~~~ i:~£~ ~ ~ ~~ ~ ~ J ~ ~ C'I .... ~a ~ It) C'I CD C. 3 i ~~I~~~~ ~;e"'lC ~ . . 1~1~t:l5l 852!l::\ ~!!' g~8S ---- ~ .I~ .e .~ ~" ~~~: aiieHHii ~~~W) !' ~; ii:I:i @.f!1.~i8. i ~ '" ~ ~ ~ ~ '~" Oii?§'~ '~" iiii !2!2!!He System Board 1-113 ~ "'" ""'" ~~~ III @..@..@.. . e l -,.. N o ~ ..... ,.. .... 5 ~~ ~H' G) G) .c ~ ...IV c: IV ii: r:D ~ N ,.. It) N G) C. ~ ~i3'~~~ ~~~~~ 1-114 System Board +s Jf6 *JR 0+1j ~on ~ ~~n ,)11 :n D+'i t ~~n Jill (SH.2) I (SH.2l (SH.4) I (SH.4) (SH.2) (SH.2) SOl se' SOl! SOl SOl< 501" SOl' SIH' LAlI LAlO SO"" -I1EMR -MEMW -DAekO I -OACK'5 -DACK6 (SH.13) -"""" JIO .•~~~~~~~~~~~~~~::~~;;~~~(I!'r-"fIli.O;;::;"' (I.'" lA21 tAU (SH.13) (O,"EOO' (12 en 0& PIN) I""' 002 m -HEM CS 16 (SH. 4.12.' 3) (SH.5) - cs (SH.6) 10 Ib m CIS 009 011 (02 "((j"j DRQO DRG c; ORO 6 ORG 1 (SH.13) (SH.13) (SH.13) (SH.13) DOlt 00') 006 JAQID IRQ II (SH.15) 007 IRGIe; DI~ (oif ~ Ole; CIO ill coo 001 IRQI2 IRQI4 t (SH.15) D08 rna QL. 0," ~+s (SH.4) (SH.4) (SH.4) fa = l ...... ...u. LAt9 ~ ( 06 n 1 m 110 (ONNE(TOR FROM SOARD TOP SlOE: I 801~. AOI JI (8 CONN. TOTALl *FOR FUTURE USE 81t •• All OOln(OI DlSUCI8 I Type 2 51 2KB Planar (Sheet 18 of 21) l NOll::J3S .... .... .... I ~ (SH.2) I (SH.2) !f ;. (SH.4) 500 501 S02 SO, SO, SO, 506 507 SAO SAl SAl SA' 5," e 5. . SA. SA7 SAO SA. SA'O SAil SAIZ =:I a Q SAH SAIIt 5AI5 5... 16 SAI1 (SH:4) (SH.2) (SH.2) (SH.7) (SH.7) (SH.3) (SH.9) (SH.13) (SH.3) (SH.3) SAI8 SAIQ -lOR -lOW AO' AOO A 7 A AO' AO' AO' A02 AEN (SH.20) (SH.13) (SH.13) (SH.13) -REFRESH -DA(I( I -DACK 2 (SH.3) (SH.21) OAlE 0" -DAtI( '3 J' A.. J. +, A" 't.7K IKD J'f- J8 Aoci A Al7 A • A2S A A" All '0' ." ." ." ." AI. A 10 AI7 AIS AI4 AI> AI> .,. BlO '0. • 14 m +12 12 ." Bl6 .06 10"J (X22) 6O. I 60' ~ I 1) (SH.1S) IRQIf IRQ ') IRQ6 IRQ 7 (SH.1S) +, 1,o41"' c•• CIOO l'lOPF I'SOPF (X'32) I I Type 2 512KB Planar (Sheet 19 of 21) U ClOI (SH.13) (SH.13) (SH.13) +PWRGOOD (SH.l,17) 2 POWER ~N. POWER GOOD 1 +S voe I<)()PF ~,~ ~~~ l.~ ~ I r=' _, 4ro Rf- PSO ~ G BOI 81O ." IRQ ORQ2 BO' '0' 81' (SH.3) (SH.l1,14,20) DRQ I r .,..,. -I/O CH (I( JIO CH ROY IRQ 1 821 AI. SYS( l K osc ~, A BlO B' B27 All B02 RESET DRY +, J' , BI BII , Ie J2 A1I -s MEHR -s HEMW JI ~ ~ ~ ~ ~ [ • ~ -.,.. -.. C'i o oC'i CD CD -... .i: en ca c ca a:: In ~ C'i .,.. It) C'i CD c. r: ~ " ~ ~ ~ u u ~ "~ ~ "~ ~O> ~'!1 "~ ~ System Board ~ 1-117 ~ -I ~ ~~~ 5 v v ~ . '--~ -I,. ~ C\I o ,.. ~ 5 u ,.. a C\I ....CD CD .c -... en IV c:: IV a:: m ~ C\I ,.. It) C\I CD Q. ~ ~ . , ~ ~ • " ~ ~ « • " 1-118 . ~. .0 • ~~ --- :iii !1!£.!a- ." :e System Board ~~ ~ ~M'" ii:i @.!Q.!1 !~ ~ ."" ." ~ SECTION 2. COPROCESSOR Contents Description ...................................... 2-3 Programming Interface ............................• 2-3 Hardware Interface ................................ 2-4 Coprocessor 2-1 Notes: 2-2 Coprocessor Description The IBM Personal Computer AT Math Coprocessor enables the IBM Personal Computer AT to perform high-speed arithmetic, logarithmic functions, and trigonometric operations. The coprocessor works in parallel with the microprocessor. The parallel operation decreases operating time by allowing the coprocessor to do mathematical calculations while the microprocessor continues to do other functions. The coprocessor works with seven numeric data types, which are divided into the following three classes: • Binary integers (3 types) • Decimal integers (1 type) • Real numbers (3 types) Programming Interface The coprocessor offers extended data types, registers, and instructions to the microprocessor. The coprocessor has eight 80-bit registers, which provides the equivalent capacity of forty 16-bit registers. This register space allows constants and temporary results to be held in registers during calculations, thus reducing memory access and improving speed as well as bus availability. The register space can be used as a stack or as a fixed register set. When used as a stack, only the top two stack elements are operated on. Coprocessor 2-3 The following figure shows representations of large and small numbers in each data type. Significant Digits Bits (Decimal) Approximate Range (Decimal) Data Type Word Integer 16 4 Short Integer 32 9 Long Integer 64 19 Packed Decimal 80 18 32 6-7 64 80 Short Real Long Real * * Temporary Real -32,768 :5 x :5 +32,767 -2x10 9 -9x10 18 :5 x :5 +2x 10 9 :5 x:5 +9x1018 -9 .. 99 :5 x :5 +9 .. 99 (18 digits) 8. 43x 10- 37 :5 x :5 3. 37x 10 38 15-16 4. 19x 10- 307 :5 x :5 1.67xl0 308 19 3. 4x 10-4932 :5 x :5 1. 2x 10 4932 Data Types * The Short Real and Long Real data types correspond to the single and double precision data types. Hardware Interface The coprocessor uses the same clock generator as the microprocessor. It works at one-third the frequency of the system microprocessor (2.66 MHz). The coprocessor is wired so that it functions as an I/O device through I/O port addresses hex OOF8, OOFA, and OOFC. The microprocessor sends OP codes and operands through these I/O ports. The microprocessor also receives and stores results through the same I/O ports. The coprocessor's I busy I signal informs the microprocessor that it is executing; the microprocessor's Wait instruction forces the microprocessor to wait until the coprocessor is finished executing. The coprocessor detects six different exception conditions that can occur during instruction execution. If the appropriate exception mask within the coprocessor is not set, the coprocessor sets its error signal. This error signal generates a hardware interrupt (interrupt 13) and causes the I busy I signal to the coprocessor to be held in the busy state. The I busy I signal may 2-4 Coprocessor be cleared by an 8-bit I/O Write command to address hex FO with DO through D7 equal to O. The power-on self-test code in the system ROM enables IRQ 13 and sets up its vector to point to a routine in ROM. The ROM routine clears the I busy I signal's latch and then transfers control to the address pointed to by the NMI interrupt vector. This allows code written for any IBM Personal Computer to work on an IBM Personal Computer AT. The NMI interrupt handler should read the coprocessor's status to determine if the NMI was caused by the coprocessor. If the interrupt was not generated by the coprocessor, control should be passed to the original NMI interrupt handler. The coprocessor has two operating modes similar to the two modes of the microprocessor. When reset by a power-on reset, system reset, or an I/O write operation to port hex OOF 1, the coprocessor is in the real address mode. This mode is compatible with the 8087 Math Coprocessor used in other IBM Personal Computers. The coprocessor can be placed in the protected mode by executing the SETPM ESC instruction. It can be placed back in the real mode by an I/O write operation to port hex 00F1, with D7 through DO equal to O. The coprocessor instruction extensions to the microprocessor can be found in Section 6 of this manual. Detailed information for the internal functions of the Intel 80287 Coprocessor can be found in books listed in the bibliography. Coprocessor 2-5 Notes: 2-6 Coprocessor SECTION 3. POWER SUPPLY Contents Inputs .......................................... 3-3 Outputs ......................................... 3-4 DC Output Protection ...........•...•.............. 3-4 Output Voltage Sequencing .....•.........•.......... 3-4 No-Load Operation .......•...•.................... 3-5 Power-Good Signal .......................•........ 3-5 Load Resistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 3-5 Connectors ...................................... 3-7 Power Supply 3-1 Notes: 3-2 Power Supply The system power supply is contained inside of the system unit and provides power for the system board, the adapters, the diskette drives, the fixed disk drives, the keyboard, and the IBM Monochrome Display. Inputs The power supply can operate at a frequency of either 60 ±3 Hz or 50 ±3 Hz and it can operate at 110 Vac, 5 A or 220/240 Vac, 2.5 A. The voltage is selected with the switch above the power-cord plug at the rear of the power supply. The following figure shows the input requirements. Range Voltage (Vac) Current (Amperes) Minimum 100 115 Vac Maximum 5 Maximum 125 230 Vac Minimum 200 Maximum 3.0 Maximum 240 Input Requirements Note: The maximum in-rush current is 100 A. Power Supply 3-3 Outputs The power supply provides +5, -5, + 12, and -12 Vdc. The following figQ.re shows the load current and regulation tolerance for these voltages. The power supply also supplies either 115 Vac or 230 Vac for the IBM Monochrome Display. Nominal OU,tput Load Current (A) Min Max Regulation Tolerance +5 -5 +12 -12 7.0 0.0 2.5 0.0 +5% to -4% +10% to -8% +5% to -4% +10% to -9% Vdc Vdc Vdc Vdc 19.8 0.3 7.3 Q.3 DC Load Requirements DC Output Protection If any output becomes overloaded, the power supply will switch btf within 20 milliseconds. An overcurrent condition will not damage the power supply. Output Voltage Sequencing Under normal conditions, the output voltage levels track within 300 milliseconds of ~ach other when power is applied to, or remowd from the power supply, provided at least minimqrn. loading is present. . 3-4 Power Supply No-Load Operation No damage or hazardous conditions occur when primary power is applied with no load on any output level. In such cases, the power supply may switch off, and a power-on reset will be required. The power supply requires a minimum load for proper operation. Power-Good Signal The power supply provides a I power-good I signal to indicate proper operation of the power supply. When the supply is switched off for a minimum of one second and then switched on, the I power-good I signal is generated, assuming there are no problems. This signal is a logical AND of the dc output-voltage sense signal and the ac input-voltage sense signal. The I power-good I signal is also a TTL-compatible high level for normal operation, or a low level for fault conditions. The ac fail signal causes I power-good I to go to a low level at least one millisecond before any output voltage falls below the regulation limits. The operating point used as a reference for measuring the one millisecond is normal operation at minimum line voltage and maximum load. Load Resistor If no fixed disk drive is connected to the power supply, the load resistor must be connected to PI O. The load resistor is a 5 ohm, 50 watt resistor. Power Supply 3-5 The dc output-voltage sense signal holds the power-good signal at a low level when power is switched on until all output voltages have reached their minimum sense levels. The power-good signal has a turn-on delay of at least 100 milliseconds but not longer than 500 milliseconds and can drive six standard TTL loads. I I I The following figure shows the minimum sense levels for the output voltages. Level (Vdc) Minimum (Vdc) +5 -5 +12 -12 Sense Level 3-6 Power Supply +4.5 -3.75 +10.8 -10.4 I Connectors The following figure shows the pin assignments for the power-supply output connectors. Load Point Voltage (Vdc) PSB-l PSB-2 PSB-3 PSB-4 PSB-5 psB-6 Power Good +5 +12 -12 Ground Ground Max. Current (A) See Note 3.B 0.7 0.3 0.0 0.0 PS9-1 PS9-2 PS9-3 PS9-4 PS9-5 PS9-6 Ground Ground -5 +5 +5 +5 0.0 0.0 0.3 Pl0-l Pl0-2 Pl0-3 Pl0-4 +12 Ground Ground +5 0.0 0.0 P11-1 P11-2 PII-3 PII-4 +12 Ground Ground +5 0.0 0.0 P12-1 P12-2 P12-3 P12-4 +12 Ground Ground +5 1.0 0.0 0.0 0.6 3.B 3.B 3.B 2.B I.B 2.B I.B DC Load Distribution Note: For more details, see "Power-Good Signal". Power Supply 3-7 Notes: 3-8 Power Supply SECTION 4. KEYBOARD Contents Description ................................... Cabling ................................... Sequencing Key Code Scanning ................. Keyboard Buffer ............................ Keys ..................... " ............... 4-3 4-3 4-3 4-3 4-4 Power-On Routine ......•......................... 4-4 Power-On Reset ............................ 4-4 Basic Assurance Test ......................... 4-4 Commands from the System .......................... Reset (Hex FF) .... ; ........................ Resend (Hex FE) ............................ No-Operation (NaP) (Hex FD through F7) ....... Set Default (Hex F6) ......................... Default Disable (Hex F5) ..................... Enable (Hex F4) ............................ Set Typematic Rate/Delay (Hex F3) ............ No-Operation (NaP) (Hex F2 through EF) ....... Echo (Hex EE) ........... ;................. Set/Reset Mode Indicators (Hex ED) ............ 4-5 4-5 4-6 4-6 4-6 4-6 4-6 4-7 4-8 4-8 4-8 Commands to the System ............................ 4-9 Resend (Hex FE) ............................ 4-9 ACK (Hex FA) ........ ; .................... 4-9 Overrun (Hex 00) .......................... 4-10 Diagnostic Failure (Hex FD) .................. 4-10 Break Code Prefix (Hex FO) .................. 4-10 BAT Completion Code (Hex AA) .............. 4-10 ECHO Response (Hex EE) ................... 4-10 Keyboard Scan-Code Outputs ....................... 4-11 Keyboard 4-1 Clock and Data Signals ...................•........ 4-12 Keyboard Data Output ...................... 4-13 Keyboard Data Input ........................ 4-13 Keyboard Layouts .............•.................. FrenchKeyboard ........................... German Keyboard .......................... Italian Keyboard ........................... Spanish Keyboard .......................... u.K. English Keyboard ...................... U.S. English Keyboard ....................... 4-15 4-16 4-17 4-18 4-19 4-20 4-21 Specifications ................................... 4-22 Size ..................................... 4-22 Weight ................................... 4-22 Logic Diagram 4-2 Keyboard 4-23 Description The keyboard is a low-profile, 84-key, detachable unit. A bidirectional serial interface in the keyboard is used to carry signals between the keyboard and system unit. Cabling The keyboard cable connects to the system board through a 5-pin DIN connector. The following figure lists the connector pins and their signals. DIN Connector Pins Signal Name 1 +KBD ClK +KBD DATA Reserved Ground +5.0 Vdc 2 3 4 5 Sequencing Key Code Scanning The keyboard is able to detect all keys that are pressed, and their scan codes will be sent to the interface in correct sequence, regardless of the number of keys held down. Keystrokes entered while the interface is inhibited (when the key lock is on) will be lost. Keystrokes are stored only when the keyboard is not serviced by the system. Keyboard Buffer The keyboard has a 16-character first-in-first-out (FIFO) buffer where data is stored until the interface is ready to receive it. A buffer-overrun condition will occur if more than sixteen codes are placed in the buffer before the first keyed data is sent. The seventeenth code will be replaced with the overrun code, hex 00. (The 17th position is reserved for overrun codes). If more keys are pressed before the system allows a keyboard output, the data will be lost. When the keyboard is allowed to send data, the Keyboard 4-3 characters iIi the buffer will be sent as in normal operation, and new data entered will be detected and sent. Keys All keys are classified as make/break, which means when a key is pressed, the keyboard sends a make code for that key to the keyboard controller.. When the key is released, its break code is sent (the break code for a key is its make code preceded by hex FO). All keys are typematic. When a key is pressed and held down, the keyboard continues to send the make code for that key until the key is released. The rate at which the make code is sent is known as the typematic rate (The typematic rate is described under "Set Typematic Rate/Delay"). When two or more keys are held down, only the last key pressed repeats at the typematic rate. Typematic operation stops when the last key pressed is released, even if other keys are still held down. When a key is pressed and held down while the interface is inhibited, only the first make code is stored in the buffer. This prevents buffer overflow as a result of typematic action. Power-On Routine Power-On Reset The keyboard logic generates a POR when power is applied to the keyboard. The POR lasts a minimum of 300 milliseconds and a maxImum of 9 secorids. Note: The keyboard may issue a false return during the first 200 milliseconds after the +5 Vdc is established at the 90% level. Therefore, the keyboard interface is disabled for this period. 4-4 Keyboard Basic Assurance Test Immediately following the POR, the keyboard executes a basic assurance test (BAT). This test consists of a checksum of all read-only memory (ROM), and a stuck-bit and addressing test of all random-access memory (RAM) in the keyboard's microprocessor. The mode indicators-three light emitting diodes (LEDs) on the upper right-hand corner of the keyboard-are turned on then off, and must be observed to ensure they are operational. Execution of the BAT will take from 600 to 900 milliseconds. (This is in addition to the time required for the POR.) The BAT can also be started by a Reset command. After the BAT, and when the interface is enabled ( I clock I and data lines are set high), the keyboard sends a completion code to the interface-either hex AA for satisfactory completion or hex FC (or any other code) for a failure. If the system issues a Resend command, the keyboard sends the BAT completion code again. Otherwise, the keyboard sets the keys to typematic and make/break. I I Commands from the System The commands described below may be sent to the keyboard at any time. The keyboard will respond within 20 milliseconds. Note: The following commands are those sent by the system. They have a different meaning when issued by the keyboard. Reset (Hex FF) The system issues a Reset command to start a program reset and a keyboard internal self-test. The keyboard acknowledges the command with an I acknowledge I signal (ACK) and ensures the Keyboard 4-5 system accepts the ACK before executing the command. The system signals acceptance of the ACK by raising the clock and data for a minimum of 500 microseconds. The keyboard is disabled from the time it receives the Reset command until the ACK is accepted or until another command overrides the previous one. Following acceptance of the ACK, the keyboard begins the reset operation, which is similar to a power-on reset. The keyboard clears the output buffer and sets up default values for typematic and delay rates. Resend (Hex FE) The system can send this command when it detects an error in any transmission from the keyboard. It can be sent only after a keyboard transmission and before the system enables the interface to allow the next keyboard output. Upon receipt of Resend, the keyboard sends the previous output again unless the previous output was Resend. In this case, the keyboard will resend the last byte before the Resend command. No-Operation (NOP) (Hex FD through F7) These commands are reserved and are effectively no-operation or NOP. The system does not use these codes. If sent, the keyboard will acknowledge the command and continue in its prior scanning state. No other operation will occur. Set Default (Hex F6) The Set Default command resets all conditions to the power-on default state. The keyboard responds with ACK, clears its output buffer, sets default conditions, and continues scanning (only if the keyboard was previously enabled). Default Disable (Hex F5) This command is similar to Set Default, except the keyboard stops scanning and awaits further instructions. 4-6 Keyboard Enable (Hex F4) Upon receipt of this command, the keyboard responds with ACK, clears its output buffer, and starts scanning. Set Typematic Rate/Delay (Hex F3) The system issues this command, followed by a parameter, to change the typematic rate and delay. The typematic rate and delay parameters are determined by the value of the byte following the command. Bits 6 and 5 serve as the delay parameter and bits 4,3,2, 1, and 0 (the least-significant bit) are the rate parameter. Bit 7, the most-significant bit, is always O. The delay is equal to 1 plus the binary value of bits 6 and 5 multiplied by 250 milliseconds ±20%. The period (interval from one typematic output to the next) is determined by the following equation: Period = (8 + A) X (2B ) X 0.00417 seconds, where A = binary value of bits 2, 1, and 0 and B = binary value of bits 4 and 3. The typematic rate (make code per second) is l/period. The period is determined by the first equation above. The following table results. Bit 4 - 0 Typematic Rate ± 20% Bit 4 - 0 Typematic Rate ± 20% 00000 00001 00010 00011 00100 00101 00110 00111 01000 01001 01010 01011 01100 01101 01110 01111 30.0 26.7 24.0 21.8 20.0 18.5 17.1 16.0 15.0 13.3 12.0 10.9 10.0 9.2 8.0 8.0 10000 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 11101 11110 11111 7.5 6.7 6.0 5.5 5.0 4.6 4.3 4.0 3.7 3.3 3.0 2.7 2.5 2.3 2.1 2.0 Keyboard 4-7 The keyboard responds to the Set Typematic Rate Delay command with an ACK, stops scanning, and waits for the rate parameter. The keyboard responds to the rate parameter with another ACK, sets the rate and delay, and continues scanning (if the keyboard was previously enabled). If a command is received instead of the rate parameter, the set-typematic-rate function ends with no change to the existing rate, and the new command is processed. However, the keyboard will not resume scanning unless instructed to do so by an Enable command. The default rate for the system keyboard is as follows: The typematic rate = 10 characters per second ± 20% and the delay = 500 ms ±20%. No-Operation (NOP) (Hex F2 through EF) These commands are reserved and are effectively no-operation (NOP). The system does not use these codes. If sent, the keyboard acknowledges the command and continues in its prior scanning state. No other operation will occur. Echo (Hex EE) Echo is a diagnostic aide. When the keyboard receives this command, it issues a hex EE response and continues scanning if the keyboard was previously enabled. Set/Reset Mode Indicators (Hex ED) Three mode indicators on the keyboard are accessible to the system. The keyboard activates or deactivates these indicators when it receives a valid command from the system. They can be activated or deactivated in any combination. The system remembers the previous state of an indicator so that its setting does not change when a command sequence is issued to change the state of another indicator. 4-8 Keyboard A Set/Reset Mode Indicators command consists of two bytes. The first is the command byte and has the following bit setup: 11101101 - hex ED The second byte is an option byte. It has a list of the indicators to be acted upon. The bit assignments for this option byte are as follows: Bit 0 I 2 3-7 Indicator Scroll Lock Indicator Num Lock Indicator Caps Lock Indicator Reserved (must be O's) Note: Bit 7 is the most-significant bit; bit 0 is the least-significant. The keyboard will respond to the Set/Reset Mode Indicators command with an ACK, discontinue scanning, and wait for the option byte. The keyboard will respond to the option byte with an ACK, set the indicators, and continue scanning if the keyboard was previously enabled. If another command is received iIi place of the option byte, execution of the function of the Set/Reset Mode Indicators command is stopped with no change to the indicator states, and the new command is processed. Then scanning is resumed. Commands to the System The commands described here are those sent by the keyboard. They have a different meaning when issued by the system. Resend (Hex FE) The keyboard issues a Resend command following receipt of an invalid input, or any input with incorrect parity. If the system sends nothing to the keyboard, no response is required. Keyboard 4-9 ACK(HexFA) The keyboard issues an ACK response to any valid input other than an Echo or Resend command. If the keyboard is interrupted while sending ACK, it will discard ACK and accept and respond to the new command. Overrun (Hex 00) An overrun character is placed in position 17 of the keyboard buffer, overlaying the last code if the buffer becomes full. The code is sent to the system as an overrun when it reaches the top of the buffer. Diagnostic Failure (Hex FD) The keyboard periodically tests the sense amplifier and sends a diagnostic failure code if it detects any problems. If a failure occurs during BAT, the keyboard stops scanning and waits for a system command or power-down to restart. If a failure is reported after scanning is enabled, scanning continues. Break Code Prefix (Hex FO) This code is sent as the first byte of a 2-byte sequence to indicate the release of a key. BAT Completion Code (Hex AA) Following satisfactory completion of the BAT, the keyboard sends hex AA. Hex FC (or any other code) means the keyboard microprocessor check failed. ECHO Response (Hex EE) This is sent in response to an Echo command from the system. 4-10 Keyboard Keyboard Scan-Code Outputs Each key is assigned a unique 8-bit, make scan code, which is sent when the key is pressed. Each key also sends a break code when the key is released. The break code consists of two bytes, the first of which is the break code prefix, hex FO; the second byte is the same as the make scan code for that key. The typematic scan code for a key is the same as the key's make code. Refer to "Keyboard Layouts" beginning on page 4-15 to determine the character associated with each key number. The following figure lists the positions of the keys and their make scan codes. Key Number Make Code Key Number Make Code Key Number Make Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 30 OE 16 lE 26 25 2E 36 30 3E 46 45 4E 55 50 66 00 15 10 24 20 2C 35 3C 43 44 40 54 5B 14 31 32 33 34 35 36 37 38 39 40 41 43 44 46 47 48 49 50 51 52 53 54 55 57 58 61 64 65 66 1C lB 23 2B 34 33 3B 42 4B 4c 52 5A 12 lA 22 21 2A 32 31 3A 3C 49 4A 59 11 29 58 06 OC 67 68 69 70 71 OB OA 09 05 04 03 83 01 76 6C 6B 69 72 73 74 90 91 92 93 95 96 97 98 99 100 101 102 103 104 105 106 107 108 77 75 73 72 70 7E 70 74 7A 71 84 7C 7B 79 Note: Break codes consists of two bytes; the first is hex FO, the second is the make scan code for that key. Keyboard 4-11 Clock and Data Signals The keyboard and system communicate over the clock and I data I lines. The source of each of these lines is an open-collector device on the keyboard that allows either the keyboard or the system to force a line to a negative level. When no communication is occurring, both the clock and data lines are at a positive level. I I I I I I Data transmissions to and from the keyboard consist of 11-bit data streams that are sent serially over the data line. The following figure shows the structure of the data stream. I Bit I Function Start bit (always 1) Data bit 0 (least-significant) Data bit 1 Data bit 2 Data bit 3 Data bit 4 Data bit 5 Data bit 6 Data bit 7 (most-significant) Parity bit (always odd) Stop bit (always 1) 1 2 3 4 5 6 7 8 9 10 11 The parity bit is either 1 or 0, and the eight data bits plus the parity bit always equals an odd number. When the system sends data to the keyboard, it forces the data line to a negative level and allows the clock line to go to a positive level. I I I I When the keyboard sends data to~ or receives data from the system, it generates the clock signal to time the data. The system can prevent the keyboard from sending data by forcing the clock line to a negative level; the data line may go high or low during this time. I I I I I During the BAT, the keyboard allows the lines to go to a positive level. 4-12 Keyboard I I clock and data I I I Keyboard Data Output When the keyboard is ready to send data, it first checks for a keyboard-inhibit or system request-to-send status on the I clock I and data lines. If the clock line is low (inhibit status), data is stored in the keyboard buffer. If the I clock I line is high and data is low (request-to-send), data is stored in the keyboard buffer, and the keyboard receives system data. I I I I I I If I clock I and I data I are both high, the keyboard sends the 0 start bit, 8 data bits, the parity bit and the stop bit. Data will be valid after the rising edge and before the falling edge of the I clock I line. During transmission, the keyboard checks the clock line for a positive level at least every 60 milliseconds. If the system lowers the I clock I line from a positive level after the keyboard starts sending data, a condition known as line contention occurs, and the keyboard stops sending data. If line contention occurs before the rising edge of the tenth clock (parity bit), the keyboard buffer returns the data and clock lines to a positive level. If contention does not occur by the tenth clock, the keyboard completes the transmission. I I I I I I Following a transmission, the system can inhibit the keyboard until the system processes the input or until it requests that a response be sent. Keyboard Data Input When the system is ready to send data to the keyboard, it first checks if the keyboard is sending data. If the keyboard is sending but has not reached the tenth clock, the system can override the keyboard output by forcing the I clock I line to a negative level. If the keyboard transmission is beyond the tenth clock, the system must receive the transmission. If the keyboard is not sending, or if the system elects to override the keyboard's output, the system forces the clock line to a negative level for more than 60 microseconds while preparing to send. When the system is ready to send the start bit ( I data I line will be low), it allows the I clock I line to go to a positive level. I I Keyboard 4-13 The keyboard checks the state of the clock line at intervals of no less than 60 milliseconds. If a request-to-send is detected, the keyboard counts 11 bits. After the tenth bit, the keyboard forces the data line low and counts one more (the stop bit). This action signals the system that the keyboard has received its data. Upon receipt of this signal, the system returns to a ready state, in which it can accept'keyboard output, or goes to the inhibited state until it is ready. I I I I Each system command or data transmission to the keyboard requires a response from the keyboard before the system can send its next output. The keyboard will respond within 20 milliseconds unless the system prevents keyboard output. If the keyboard response is invalid or has a parity error, the system sends the command or data again. A Resend command should not be sent in this case. 4-14 Keyboard Keyboard Layouts The keyboard has six different layouts: • French • German • Italian • Spanish • u.K. English • U.S. English The following pages show the six keyboard layouts. Keyboard 4-15 ... ". I ~ ia. i I f f f ....""''-l I 11 NOI13:1S oI:lo. .... QC I ~ ~ ~ £ ~r f rJ1 "C ....~ ~ i l ia ....... I \C t NOIl:J3S "'" I = N ~ ~ ~ ~ e;Q. .~ . ~ ~ as. •• ~ ~ ~ i a ~ \fl i... \Ij =- i I ~ I ~ ~ t> N0I1:J3S Specifications Size • Length: 540 millimeters (21.6 inches) • Depth: 100 millimeters (4 inches) • Height: 225 millimeters (9 inches) Weight • 2.8 kilograms (6.2 pounds) 4-22 Keyboard ~ _. _. o (J'Q 0 00 ) o A3 PARTIAL VIEW A-A ~ [I] ~ ~ (J'Q +5 PI GND +5 81 ~N/C • GND r +5 ~ CI - UI ~- r- A ' iL-A J PI oUI P11 rn 1 81 I" 51)-- , UI r-.. . ~ r'l r'l l)RI LED I 10 PO~~~ ~~)±---! ,....!406. "'"l ., l,lR1 r'l R3 l,l LED 1 0 LED 3 01 L ____________ ,~ " O"~;W','I __ 0 0 '0 7 LARGE HOLE f PARTIAL VIEW 8-8 Enhancement Logic Card Assembly oIao. I N ~ 17 N0I1:ns a 8 j ~ LED HOLDER LED~ R1 LED 3 ~ 1 ;! Notes: 4-24 Keyboard SECTION 5. SYSTEM BIOS Contents System BIOS Usage ............................... 5-3 Parameter Passing ........................... 5-4 Vectors with Special Meanings ................. 5-6 Other Read/Write Memory Usage .............. 5-8 BIOS Programming Hints .................... 5-10 Adapters with System-Accessible ROM Modules .. 5-12 Additional System Board ROM Modules ......... 5-13 Keyboard Encoding and Usage ....••..•..•........... Character Codes ........................... Extended Functions ......................... Shift States ................................ Special Handling ........................... 5-13 5-14 5-18 5-19 5-21 Quick Reference ...••....•........•.............. 5-24 System BIOS 5-1 Notes: 5-2 System BIOS The basic input/output system (BIOS) resides in ROM on the system board and provides level control for the major I/O devices in the system and provides system services, such as time-of-day and memory size determination. Additional ROM modules may be placed on option adapters to provide device-level control for that option adapter. BIOS routines enable the assembly language programmer to perform block (disk or diskette) or character-level I/O operations without concern for device address and characteristics. If the sockets labeled V17 and V37 on the system board are empty, additional ROM modules may be installed in these sockets. During POST, a test is made for valid code at this location, starting at address hex EOOOO and ending at hex EFFFF. More information about these sockets may be found under "Additional System Board ROM Modules" on page 5-13 . The goal of the BIOS is to provide an operational interface to the system and relieve the programmer of concern about the characteristics of hardware devices. The BIOS interface isolates the user from the hardware, allowing new devices to be added to the system, yet retaining the BIOS level interface to the device. In this manner, hardware modifications and enhancements are not apparent to user programs. The IBM Personal Computer MA CR 0 Assembler manual and the IBM Personal Computer Disk Operating System (DOS) manual provide useful programming information related to this section. A complete listing of the BIOS is given later in this section. System BIOS Usage Access to the BIOS is through program interrupts of the microprocessor in the real mode. Each BIOS entry point is available through its own interrupt. For example, to determine the amount of base RAM available in the system with the microprocessor in the real mode, INT 12H invokes the BIOS routine for determining the memory size and returns the value to the caller. System BIOS 5-3 Parameter Passing All parameters passed to and from the BIOS routines go through the 80286 registers. The prolog of each BIOS function indicates the registers used on the call and return. For the memory size example, no parameters are passed. The memory size, in lK increments, is returned in the AX register. If a BIOS function has several possible operations, the AH register is used at input to indicate the desired operation. For example, to set the time of day, the following code is required: HOV AH,1 HOV HOV eX,RIGH_COUNT INT 1AR ; function is to set time-of-day ; establish the current time DX.LOW_COU~T ; set the time To read the time of day: MOV INT AR,O 1AR ; function is to read time-of-day ; read the timer The BIOS routines save all registers except for AX and the flags. Other registers are modified on return only if they are returning a value to the caller. The exact register usage can be seen in the prolog of each BIOS function. ~-4 System BIOS The following figure shows the interrupts with their addresses and functions. Int o Address Name 0-3 4-7 8-B C-F 10-13 14-17 18-1B lC-1F 20-23 24-27 28-2B 2C-2F 30-33 34-37 38-3B 3C-3F 40-43 44-47 48-4B Divide by Zero Single Step Nonmaskable Breakpoint Overf low Print Screen Reserved Reserved Time of Day Keyboard Reserved Communications Communications Alternate Printer Diskette Printer Video Equipment Check Memory 13 14 15 4c-4F Di skette/D i sk Communications Cassette 16 17 18 58-5B 5C-5F 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 19 lA lB lC lD IE 1F 50-53 54-57 60-63 64-67 68-6B 6C-6F 70-73 74-77 78-7B 7C-7F Keyboard Printer Resident Basic Bootstrap Time of Day Keyboard Break Timer Tick Video Initialization Diskette Parameters Video Graphics Chars BIOS Entry D11 D11 NMI I NT D11 D11 PRINT SCREEN D11 D11 TIMER INT KB INT Dn D11 D 11 D11 DISK INT D11 VIDEO 10 EQUIPMENT MEMORY SIZE DETERMINEDISKETTE 10 RS232 10CASSETTE 10/System Extensions KEYBOARD 10 PR I NTER To F600:0000 BOOTSTRAP TIME OF DAY DUMMY RETURN DUMMY-RETURN VIDEO-PARMS DISK BASE o 80286-2 Program Interrupt Listing (Real Mode Only) Note: For BIOS index, see the BIOS Quick Reference on page 5-24 . System BIOS 5-5 The following figure shows hardware, BASIC, and DOS reserved interrupts. Interrupt Address Function 20 21 22 23 24 25 26 27 28-3F 40-5F 60-67 68-6F 70 80-83 84-87 88-8B 8C-8F 90-93 94-97 98-9B 9C-9F AO-FF 100-17F 180-19F lAO-1BF lCO-1C3 71 73 74 75 lc4-1C7 lC8-1CB lCC-1CF 100-103 104-107 76 77 78-7F 80-85 86-FO 108-10B 10C-l0F lEO-IFF 200-217 218-3C3 Fl-FF 3C4-3FF DOS program terminate DOS function call DOS terminate address DOS Ctrl Break exit address DOS fatal error vector DOS absolute disk read DOS absolute disk write DOS terminate, fix in storage Reserved for DOS Reserved for BIOS Reserved for user program interrupts Not used IRQ 8 Realtime clock INT (BIOS entry RTC I NT) IRQ 9 \BIOS entry RE DIRECT) IRQ 10 (BIOS entry 011) IRQ 11 (BIOS entry 011) IRQ 12 (BIOS entry 011) IRQ 13 BIOS Redirect to NMI interrupt (BIOS entry INT 287) IRQ 14 (BIOS entry-Oil) IRQ 15 (BIOS entry 011) Not used Reserved for BASIC Used by BASIC interpreter while BASIC is running Not used 72 Hardware, Basic, and DOS Interrupts Vectors with Special Meanings Interrupt I5-Cassette I/O: This vector points to the following functions: • Device open • Device closed • Program termination • Event wait • Joystick support 5-6 System BIOS • System Request key pressed • Wait • Move block • Extended memory size determination • Processor to protected mode Additional information about these functions may be found in the BIOS listing. Interrupt tB-Keyboard Break Address: This vector points to the code that is executed when the Ctrl and Break keys are pressed. The vector is invoked while responding to a keyboard interrupt, and control should be returned through an IRET instruction. The power-on routines initialize this vector to point to an IRET instruction so that nothing will occur when the Ctrl and Break keys are pressed unless the application program sets a different value. This routine may retain control with the following considerations: • The Break may have occurred during interrupt processing, so that one or more End of Interrupt commands must be sent to the 8259 controller. • All 110 devices should be reset in case an operation was underway at the same time. Interrupt t C-Timer Tick: This vector points to the code that will be executed at every system-clock tick. This vector is invoked while responding to the timer interrupt, and control should be returned through an IRET instruction. The power-on routines initialize this vector to point to an IRET instruction, so that nothing will occur unless the application modifies the pointer. The application must save and restore all registers that will be modified. Interrupt tD-Video Parameters: This vector points to a data region containing the parameters required for the initialization of the 6845 on the video adapter. Notice that there are four System BIOS 5-7 separate tables, and all four must be reproduced if all modes of operation are to be supported. The power-on routines initialize this vector to point to the parameters contained in the ROM video routines. Interrupt IE-Diskette Parameters: This vector points to a data region containing the parameters required for the diskette drive. The power-on routines initialize this vector to point to the parameters contained in the ROM diskette routine. These default parameters represent the specified values for any IBM drives attached to the system. Changing this parameter block may be necessary to reflect the specifications of other drives attached. Interrupt IF-Graphics Character Extensions: When operating in graphics modes 320 x 200 or 640 x 200, the read/write character interface will form a character from the ASCII code point, using a set of dot patterns. ROM contains the dot patterns for the first 128 code points. For access to the second 128 code points, this vector must be established to point at a table of up to 1K, where each code point is represented by 8 bytes of graphic information. At power-on time, this vector is initialized to 000:0, and the user must change this vector if the additional code points are required. Interrupt 40-Reserved: When a Fixed Disk and Diskette Drive Adapter is installed, the BIOS routines use interrupt 40 to revector the diskette pointer. Interrupt 41 and 46-Fixed Disk Parameters: These vectors point to the parameters for the fixed disk drives, 41 for the first drive and 46 for the second. The power-on routines initialize the vectors to point to the appropriate parameters in the ROM disk routine if CMOS is valid. The drive type codes in CMOS are used to select which parameter set the vector points to. Changing this parameter hook may be necessary to reflect the specifications of other fixed drives attached. Other Read/Write Memory Usage The IBM BIOS routines use 256 bytes of memory from absolute hex 400 to hex 4FF. Locations hex 400 to 407 contain the base 5-8 System BIOS addresses of any RS-232C adapters installed in the system. Locations hex 408 to 40F contain the base addresses of any printer adapters. Memory locations hex 300 to hex 3FF are used as a stack area during the power-on initialization and bootstrap, when control is passed to it from power-on. If the user desires the stack to be in a different area, that area must be set by the application. The following figure shows the reserved memory locations. Address Mode 400-4A1 4A2-4EF 4FO-4FF ROM BIOS 500-5FF 500 DOS 504 510-511 512-515 516-519 DOS BASIC BASIC BASIC 51A-51D BASIC Function See BIOS listing Reserved Reserved as intra-application communication area for any app I i cat i on Reserved for DOS and BASIC Print screen status flag store O=Print screen not active or successful print screen operation 1=Print screen in progress 255=Error encountered during print screen operation Single drive mode status byte BASIC's segment address store C)dck interrupt vector segment:offset store Break key interrupt vector segment:offset store Disk error interrupt vector segment:offset store Reserved Memory Locations The following is the BASIC workspace for DEF SEG (default workspace) . Offset Length 2E 347 30 358 2 2 2 2 6A 1 4E 1 Line number of current line being executed Line number of last error Offset into segment of start of program text Offset into segment of start of variables (end of program text 1-1) Keyboard buffer contents O=No characters in buffer 1=Characters in buffer Character color in graphics mode* Basic Workspace Variables *Set to 1,2, or 3 to get text in colors 1-3. Do not set to O. The default is 3. System BIOS 5-9 Example 100 PRINT PEEK (&H2E) + 256 x PEEK (&H2F) H Hex 00 The following is a BIOS memory map. Starting Address 00000 OOIEO 00400 00500 EOOOO FOOOO BIOS interrupt vectors Avai lab Ie interrupt vectors BIOS data area User read/write memory Read only memory BIOS program area BIOS Memory Map BIOS Programming Hints The BIOS code is invoked through program interrupts. The programmer should not "hard code" BIOS addresses into applications. The internal workings and absolute addresses within BIOS are subject to change without notice. If an error is reported by the disk or diskette code, reset the drive adapter and retry the operation. A specified number of retries should be required for diskette reads to ensure the problem is not due to motor startup. When altering I/O-port bit values, the programmer should change only those bits necessary to the current task. Upon completion, the original environment should be restored. Failure to adhere to this practice may cause incompatibility with present and future applications. Additional information for BIOS programming can be found in Section 9 of this manual. 5-10 System BIOS Move Block BIOS The Move Block BIOS was designed to make use of the memory above the 1M address boundary while operating with IBM DOS. The Block Move is done with the Intel 80286 Microprocessor operating in the protected mode. Because the interrupts are disabled in the protected mode, Move Block BIOS may demonstrate a data overrun or lost interrupt situation in certain environments. Communication devices, while receiving data, are sensitive to these interrupt routines; therefore, the timing of communication and the Block Move should be considered. The following table shows the interrupt servicing requirements for communication devices. Baud Rate 300 1200 2400 4800 9600 11 Bit (ms) 33.33 8.33 4.16 2.08 1. 04 9 bit (ms) 30.00 7.50 7.50 1.87 0.93 Times are approximate Communication Interrupt Intervals The following table shows the time required to complete a Block Move. Block Size Normal 512 Byte Maximum 64K Buffer Addresses Both even Even and odd Both odd Both Even Even and odd Both odd Time in ms 0.98 1. 04 1. 13 37.0 55.0 72.0 Time is approximate Move Block BIOS Timing System BIOS 5-11 Following are some ways to avoid data overrun errors and loss of interrupts: • Do not use the Block Move while communicating, or • Restrict the block size to 512 bytes or less while communicating, or • Use even address buffers for both the source and the destination to keep the time for a Block Move to a minumum. Adapters with System-Accessible ROM Modules The ROM BIOS provides a way to integrate adapters with on-board ROM code into the system. During POST, interrupt vectors are established for the BIOS calls. After the default vectors are in place, a scan for additional ROM modules occurs. At this point, a ROM routine on an adapter may gain control and establish or intercept interrupt vectors to hook themselves into the system. The absolute addresses hex C8000 through EOOOO are scanned in 2K blocks in search of a valid adapter ROM. A valid ROM is defined as follows: Byte 0 Hex 55 Bytel HexAA Byte 2 A length indicator representing the number of 512-byte blocks in the ROM Byte 3 Entry by a CALL FAR A checksum is also done to test the integrity of the ROM module. Each byte in the defined ROM module is summed modulo hex 100. This sum must be 0 for the module to be valid. When the POST identifies a valid ROM, it does a CALL FAR to byte 3 of the ROM, which should be executable code. The adapter can now perform its power-on initialization tasks. The 5-12 System BIOS adapter's ROM should then return control to the BIOS routines by executing a RETURN FAR. Additional System Board ROM Modules The POST provides a way to integrate the code for additional ROM modules into the system. These modules are placed in the sockets marked U17 and U3 7. A test for additional ROM modules on the system board occurs. At this point, the additional ROM, if valid, will gain controL The absolute addresses, EOOOO through EFFFF, are scanned in 64K blocks for a valid checksum. Valid ROM is defined as follows: Byte 0 Hex 55 Byte 1 HexAA Byte 2 Not used Byte 3 Entry by a CALL FAR A checksum is done to test the integrity of the ROM modules. Each byte in the ROM modules is summed modulo hex 100. This sum must be 0 for the modules to be valid. This checksum is located at address EFFFF. When the POST identifies a valid ROM at this segment, it does a CALL FAR to byte 3 of the ROM, which should be executable code. Keyboard Encoding and Usage The keyboard routine, provided by IBM in the ROM BIOS, is responsible for converting the keyboard scan codes into what will be termed Extended ASCII. The extended ASCII codes returned by the ROM routine are mapped to the U.S. English keyboard System BIOS 5-13 layout. Some operating systems may make provisions for alternate keyboard layouts by providing an interrupt replacer, which resides in the read/write memory. This section discusses only the ROM routine. Extended ASCII encompasses 1-byte character codes, with possible values of 0 to 255, an extended code for certain extended keyboard functions, and functions handled within the keyboard routine or through interrupts. Character Codes The character codes described later are passed through the BIOS keyboard routine to the system or application program. A" -1 " means the combination is suppressed in the keyboard routine. The codes are returned in the AL register. See "Characters, Keystrokes, and Color" later in this manual for the exact codes. 5-14 System BIOS The following figure shows the keyboard layout and key positions. System BIOS 5-15 Key Base Case Uppercase I 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ~ 1 2 3 4 5 6 7 8 9 0 ! @ # $ % A & * ( ) - + = \ 16 17 18 19 20 21 22 23 24 25 26 27 28 30 Ctrl 31 32 33 34 35 36 37 38 39 40 41 43 44 Shift (Left ) 46 47 48 Backs)ace (008 --+1 (009) q 1 Backspace (008) I+- (*) Q w w e r t y u i E R T Y U I 0 0 p p { } [ 1 -1 a s d f -1 A S D F G H 9 h j J k 1 j K L : I " CR -1 CR -1 z Z x c X C Ctrl -1 -1 Nul(OOO) (*) -1 .-1 -1 RS(030) -1 -1 -1 -1 US(03]) -1 FS(028) Del(12]) -1 (*) (*) (*) (*) (*) (*) (*) (*) (*) (*) (*) (*) -1 -1 -1 DCl(Ol]) ETB(023) ENQ(005) DC2(018) Dc4(020) EM(025) NAK(02]) HT(009) SI(015) DLE(016) Esc(02]) GS(029) -1 SOH(OOl) DC3(019) EOT(004) ACK(006) BEL (00]) BS(008) LF(010) VT( 0 11 ) FF(012) -1 -1 LF(OlO) -1 -1 (*) (*) (*) (*) (*) (* ) (*) (* ) (*) (*) (*) -1 -1 (*) (*) (*) (* ) (*) (*) (* ) (*) (* ) -1 -1 -1 -1 SUB(026) CAN(024) ETX(003) ( ) ( ) ( ) Notes: i*) Refer to "Extended Functions" in this section. ('*) Refer to "Special Hand 1i ng " in this section. Character Codes (Part 1 of 2) 5-16 System BIOS Alt Key 49 50 51 52 53 54 55 57 Shift (Right) 58 Alt 61 64 Caps Lock 90 95 Num Lock 100 Scroll Lock 107 108 112 113 114 115 116 117 118 Base Case Uppercase Ctrl Alt (*) (*) (*) (*) -1 -1 -1 -1 -1 -1 SYN(022) STX(002) SO(014) CR(013) -1 -1 -1 -1 -1 Space -1 -1 Space -1 -1 Space -1 Esc -1 Esc -1 (*) Esc Pause (**) -1 -1 -1 -1 Break (**) -1 Enter Null (* ) Nu 11 (*) Null (* ) Null (*) Null (*) Null (*) Null (*) Enter Null (*) Null (*) Null (*) Null (*) Null (*) Nu 11 (*) Nu 11 (*) v V b B N n m M , / < > ? - (*) -1 Null (*) Null (*) Null (*) Nu 11 (*) Null (*) Nu 11 (*) Null (*) -1 Space -1 (*) -1 Null (*) Null (*) Null (*) Null (*) Nill ](*) Null (*) Null(*) Notes: i*) Refer to "Extended Functions" in this section. (,,*) Refer to "Special Handling " in this section. Character Codes (Part 2 of 2) System BIOS 5-17 The following figure lists keys that have meaning only in Num Lock, Shift, or Ctrl states. The Shift key temporarily reverses the current Num Lock state. Key Num Lock 91 92 7 4 Home (*) ... (*) -1 -1 Clear Screen Reverse Word 93 1 End (*) -1 Erase to EOL 96 97 98 99 101 8 5 2 0 9 t (*) Ins Page Up (*) -1 -1 -1 -1 -1 102 6 ... (*) -1 -1 -1 -1 -1 Top of Text and Home Advance Word 103 3 Pa£!e Down -1 Erase to EOS - Delete (*,**) Sys Request 104 105 106 + Base Case -1 t (*) Al t (" ) + (*) (** ) -1 -1 Ctrl (*) (*) (*) r) ( , *) -1 -1 Notes: (* ) Refer to "Extended Functions " in this section. (**) Refer to "Special Hand 1 i ng " in this section. Special Character Codes Extended Functions For certain functions that cannot be represented by a standard ASCII code, an extended code is used. A character code of 000 (null) is returned in AL. This indicates that the system or application program should examine a second code, which will indicate the actual function. Usually, but not always, this second code is the scan code of the primary key that was pressed. This code is returned in AH. 5-18 System BIOS The following is a list of the extended codes and their functions. Second Code 3 15 16-25 30-38 44-50 59-68 71 72 73 75 77 79 80 81 82 83 84-93 94-103 104-113 114 115 116 117 118 119 120-131 132 Function Nul Character I+- (Back-tab) Alt Q, W, E, R, T, Y, U, 1,0, P Alt A, S, D, F, G, H, J, K, l Alt Z, X, C, V, B, N, M F1 to FlO Function Keys (Base Case) Home t (Cursor Up) Page Up and Home Cursor ... (Cursor left) ~ (Cursor Right) End t (Cursor Down) Page Down and Home Cursor Ins (Insert) Del (Delete) F11 to F20 (Shift-F1 through Shift-FlO) F21 to F30 (Ctrl-F1 through Ctrl-F10) F31 to F40 (Alt-F1 through Alt-F10) Ctrl PrtSc (Start/Stop Echo to Printer) Ctrl ... (Reverse Word) Ctrl ~ (Advance Word) Ctrl End (Erase to End of line-EOl) Ctrl PgDn (Erase to End of Screen-EOS) Ctrl Home (Clear Screen and Home) Alt 1,2, 3, 4, 5,6,7,8,9,0, -, = keys 2-13 Ctrl PgUp (Top 25 lines of Text and Cursor Home) Keyboard Extended Functions Shift States Most shift states are handled within the keyboard routine, and are not apparent to the system or application program. In any case, the current status of active shift states is available by calling an entry point in the BIOS keyboard routine. The following keys result in altered shift states: Shift: This key temporarily shifts keys 1 through 13, 15 through 29,31 through 41, and 46 through 55, to uppercase (base case if in Caps Lock state). Also, the Shift temporarily reverses the Num Lock or non-Num Lock state of keys 91 through 93, 96, 98, 99, and 101 through 104. System BIOS 5-19 CtrI: This key temporarily shifts keys 3, 7, 12, 15, 17 through 29, 31 through 39, 43, 46 through 52, 91 through 93, and 101 through 103 to the Ctrl state. The Ctrl key is also used with the Alt and Del keys to cause the system-reset function; with the Scroll Lock key to cause the break function; and with the Num Lock key to cause the pause function. The system-reset, break, and pause functions are described under "Special Handling" later in this section. AIt: This key temporarily shifts keys 1 through 13, 17 through 26, 31 through 39, and 46 through 52 to the Alt state. The Alt key is also used with the Ctrl and Del keys to cause a system reset. The Alt key also allows the user to enter any character code from 1 to 255. Note: Character codes 97-122 will display uppercase with Caps Lock activated. The user holds down the Alt key and types the decimal value of the characters desired on the numeric keypad (keys 91 through 93,96 through 99, and 101 through 103). The Alt key is then released. If the number is greater than 255, a modulo;..256 value is used. This value is interpreted as a character code and is sent through the keyboard routine to the system or application program. Alt is handled internal to the keyboard routine. Caps Lock: This key shifts keys 17 through 26,31 through 39, and 46 through 52 to uppercase. When Caps Lock is pressed again, it reverses the action. Caps Lock is handled internal to the keyboard routine. When Caps Lock is pressed, it changes the Caps Lock Mode indicator. If the indicator was on, it will go off; and if it was off, it will go on. Scroll Lock: When interpreted by appropriate application programs, this key indicates that the cursor-control keys will cause windowing over the text rather than moving the cursor. When the Scroll Lock key is pressed again, it reverses the action. The keyboard routine simply records the current shift state of the Scroll Lock key. It is the responsibility of the application program to perform the function. When Scroll Lock is pressed, it 5-20 System BIOS changes the Scroll Lock Mode indicator. If the indicator was on, it will go off; and if it was off, it will go OIl. Nom Lock: This key shifts keys 91 through 93, 96 through 99, and 101 through 104 to uppercase. When Num Lock is pressed again, it reverses the action. Num Lock is handled internal to the keyboard routine. When Num Lock is pressed, it changes the Num Lock Mode indicator. If the indicator was on, it will go off; if it was off, it will go on. If the keyboard Num Lock Mode indicator and the system get out of synchronization, pressing the key combination of Shift and Num Lock will synchronize them. This key combination changes the Num Lock bit in the keyboard memory, but sends only the scan code for the Shift key to the system. Shift Key Priorities and Combinations: If combinations of the Alt, Ctrl, and Shift keys are pressed and only one is valid, the priority is as follows: the Alt key is first, the Ctrl key is second, and the Shift key is third. The only valid combination is Alt and Ctrl, which is used in the system-reset function. Special Handling System Reset The combination of the Alt, Ctrl, and Del keys results in the keyboard routine that starts a system reset or restart. System reset is handled by BIOS. Break The combination of the Ctrl and Break keys results in the keyboard routine signaling interrupt hex tB. The extended characters AL=hex 00, and AH=hex 00 are also returned. System BIOS 5-21 Pause The Pause key (Ctrl and Num Lock) causes the keyboard interrupt routine to loop, waiting for any key except Num Lock to be pressed. This provides a method of temporarily suspending an operation, such as listing or printing, and then resuming the operation. The method is not apparent to either the system or the application program. The key stroke used to resume operation is discarded. Pause is handled internal to the keyboard routine. Print Screen The PrtSc key results in an interrupt invoking the print-screen routine. This routine works in the alphanumeric or graphics mode, with unrecognizable characters printing as blanks. System Request When the System Request (Sys) key is pressed, a hex 8500 is placed in AX, and an interrupt hex 15 is executed. When the Sys key is released, a hex 8501 is placed in AX, and another interrupt hex 15 is executed. If an application is to use System Request, the following rules must be observed: Save the previous address. Overlay interrupt vector hex 15. Check AH for a value of hex 85: If yes, process may begin. If no, go to previous address. The application program must preserve the value in all registers, except AX, upon return. System Request is handled internal to the keyboard routine. 5-22 System BIOS Other Characteristics The keyboard routine does its own buffering, and the keyboard buffer is large enough to support entries by a fast typist. However, if a key is pressed when the buffer is full, the key will be ignored and the "alarm" will sound. The keyboard routine also suppresses the typematic action of the following keys: Ctrl, Shift, Alt, Num Lock, Scroll Lock, Caps Lock, and Ins. During each interrupt 09H from the keyboard, an interrupt 1SH, function (AH)=4FH is generated by the BIOS after the scan code is read from the keyboard adapter. The scan code is passed in the (AL) register with the carry flag set. This is to allow an operating system to intercept each scan code prior to its being handled by the interrupt 09H routine, and have a chance to change or act on the scan code. If the carry flag is changed to 0 on return from interrupt 1SH, the scan code will be ignored by the interrupt handler. System BIOS 5-23 Quick Reference Testl .......................................... Data Area Description . . . . . . . . . . . . . . . . . . . . . . . . .. Common POST and BIOS Equates ................ Test .01 Through Test .16 ....................... POST and Manufacturing Test Routines ............ 5-28 5-30 5-32 5-36 5-57 Test2 .......................................... 5-58 Test .17 Through Test .23 ....................... 5-58 Test3. POST Exception Interrupt Tests ................ 5-75 Test4. POST and BIOS Utility Routines ............... CMOS READ .............................. CMOS--VVRITE ............................. E MSG P MSG........................... ERR BEEP--................................ BEEP ...................................... VVAITF ..................................... CONFIG BAD.............................. PRT SEG .................................. KBD- RESET ............................... D11 - Dummy Interrupt Handler ................. Hardware Interrupt 9 Handler (Type 71) ........... 5-81 5-81 5-81 5-82 5-82 5-83 5-83 5-83 5-84 5-85 5-87 5-87 Test5. Exception Interrupt Tests ..................... SYSINIT1 - Build Protected Mode Descriptors ....... GDT BLD - Build the GDT for POST ............ SIDT--BLD - Build the IDT for POST ............ 5-88 5-89 5-89 5-91 Test6 .......................................... STGTST CNT .............................. ROM ERR ................................. XMIT-- 8042 ................................ BOOT-- STRAP .............................. 5-93 5-93 5-95 5-95 5-95 Diskette BIOS .................................. 5-97 Fixed Disk (Hard File) BIOS ....................... 5-116 5-24 System BIOS Keyboard BIOS .................................. 5-129 Printer BIOS 5-138 RS232 BIOS 5-140 Video BIOS .................•.................. 5-143 BIOS .......................••............... Memory Size Determine ....................... Equipment Determine ......................... NMI ...................................... 5-161 5-161 5-161 5-162 BIOS1. . ..............................•....... Event Wait ................................. Joystick Support ............................. Wait ...................................... Block Move ................................ Extended Memory Size Determine ............... Processor to Virtual Mode ..................... 5-163 5-164 5-165 5-166 5-167 5-172 5-174 BIOS2 ......................•................ Time of Day ................................ Alarm Interrupt Handler ....................... Print Screen ................................. Timer 1 Interrupt Handler ...................... 5-176 5-176 5-179 5-180 5-181 ORGS - PC Compatibility and Tables ................ 5-182 POST Error Messages .. , ...................... 5-182 System BIOS 5-25 Address FOOO:E129 FOOO:3A23 FOOO: 6000 FOOO:19FO FOOO: IBIA FOOO:2022 FOOO:OC96 FOO~ :0396 FOOO;4135 FOOO:1941 FOOO: 195B FOOO: 1 A45 FOOO:E6F5 FOOO :FA6E FOOO:E020 FOOO:IBCA FOOO:E030 FOOO:E040 FOOO: 1915 FOOO:20E3 FOOO:EFC1 FOOO:2AI1 FOOO:2C2B FOOO:2A82 FOOO:2A2E FOOO:FF53 FOOO; ICI8 FOOO:E05E FOOO:EOl1 FOOO:E090 FOOO IEOA9 FOOO :EOC2 FOOO :EODB FOOO :EOF4 FOOO lEI 00 FOOO:EI26 FOOO:EI3F FOOO:EI68 FOOO:EI91 FOOO:EIB1 FOOO:EIDB FOOO:E1EE FOOO:E209 FOOD ;E224 FOOO:E239 FOOO:E2C6 FOO~ :E2EA FOOD ;E30E FOOO:E31E FOOD ;E32E FOOD :E343 FOOD :40A8 FOOD: 19B2 FOOD: 1910 FOOD :E364 FOOD IE319 FOOD :E38E FOOD :E3AC FOOOIE3BF FOOD IE302 FOOO:E25D FOOD ;E3DF FOOO:E401 FOO~ :4888 FOOO:FF5E FOOO:4501 FOOO:314F FOOD :FF5A FOOO: IC22 FOOO:E8EI FOOO:E9IB FOOO :E955 FOOO:E95F FOOO IE969 FOOO:E916 FOOO:3261 FOOO:E81E FOOO: 0008 FOOO:E886 FOOO:E88E FOOO;E8C8 FOOO: IAEF FOOO:3IFE FOOO: 3112 FOOO:OOIO FOOO :FOE4 FOOO:FOEC FOOO:FOF4 FOOO:409E FOOO :E2C3 FOOO;40B2 FOOO I 03A2 FOOO: 0000 FOOO: OC96 FOOO; 1611 FOOOl1941 FOOD: I C38 FOOD: IEB5 5-26 Pub I i 05 by Name Aba Abs Address AI ACT DISP PAGE BASTc BEEP BLINK INT BOOT STRAP 1 C21 C8042 CASSETTE 10 1 CMOS READ CMOS-WRITE CQNFTG BAD CONF TeL CRT CHAR GEN 01 011 02 D2A DDS DISKETTE 10 I DISK BASE 01 SK-'NT 1 DISK-IO DISK-SETUP DSKETTE SETUP DUMMY RETURN DUMMY-RETURN , EIOI EI02 EI03 EI04 EI05 EI06 EIOl EI08 EI09 EI61 EI62 EI63 EI64 E201 E202 E203 E30 I E302 E303 E304 E401 E501 E601 E602 EQUIPMENT I ERR BEEP E MSG FT180 FI781 FI782 FI790 FI191 F3A F3D F3DI FD TBL FILL FLOPPY GATE A20 HD INT HRo INT 281 KIOKII KI2 KI3 KI4 FOOD FOOD FOOD FOOD FOOD FOOD FOOD FOOD Kt5 FOOD FOOD FOOD FOOD FOOD FOOO K16 Kb K6L K' K8 K9 KBO RESET K8 TNT I KEYBOARD 10 M4 ., FOO~ FOOD FOOO FOOD FOOD FOOD FOO~ FOOD FOOD FOOD FOOD FOOD FOOD FOOO FOOD FOO~ FOOD FOOO FOOO FOO~ FOOD FOOO FOOD FOO~ FOOD FOOD FOOD FOOO FOOD FOO~ FOOO FOOO FOOO FOOO FOOO FOOO FOOD FOO~ FOOO FOOD FOOD FOOO FOOO FOO~ FOOO FOOO FOOO FOO~ FOOO FOOO FOO~ FOOD FOOD FOO~ FOO~ I "5 M. MEMORY SIZE DET I NMI INT NMI-INT I OBF-42 POST 1 PDST2 POS13 POST4 POSTS POST6 MAP FOO~ FOOD FOOO FOOD FOOD FOOD FOOD FOOD FOOO FOOD FOOO FOOD FOOO FOOD FOOD FOOD FOOD FOOD FOOD FOOD FOOD FOOO FOOO FOOO FOOD FOOO FOOD FOOD FOO~ 0000 0008 0010 0050 0396 03A2 OC96 OC96 r 052 IOB6 IOB9 10DA 1613 1671 1941 1941 195B 1915 1970 19A4 19B2 19FO I A36 IM5 1 A59 I A69 IA70 I A85 IABI I ABO I AEF IBIA 1828 I BCA ICI8 ICI9 I C22 IC31 I C38 ID2A IEB5 I EB5 IFB5 IFEI 2022 20E3 28C I 2All 2A2E 2A82 2C2B 314F 3112 31FE 3261 366C 3116 31AO 38BO 38EF 39BF 39E4 3AOC 3A23 3A41 3A6D 3A90 3B2F 3B8 r 38DB 3COD 3CeO 3CCE 3F12 3FF9 409E 40A8 40B2 4135 43BF 450 I 45BO 413F 47A9 483F 4888 bOOO E020 E030 E040 E05E E071 E090 EOA9 EOC2 EOOS EOF4 EIOD Publios by Value Aba Abs POSTI KbL "4 START I C8042OSF 42 1"051'2 C21 SHUT3 SHUT2 SHUn SHUT6 SHUT4 POST3 CMOS READ POST4 CMOS WR I TE DOS E MSG P-MSG ERR SEEP BEEP WAITF CONFIG BAD XPC BYTE PRT-HEX PRT-SEG PROT PRT HEX ROM CHECKSUM ROM-CHECK KBD-RESET BLINK INT SET TOO 011DUMMY RETURN 1 RE DIRECT INT 287 PROC SHUTDOWN POST5 SYSINITI POST6 STGTST CNT ROM ERR XMIT 8042 BOOT-STRAP 1 DISKETTE 10 I SEEK -DISK tNT I DSKETTE SETUP 01 SK SETUP DISK-IO HD INT KEYSOARD 10 1 KB INT 1- KI6 SND DATA PRINTER 10 r RS232 10 1VIDEO-IO-I SET MODESET-CTYPE SET-CPOS READ CURSOR ACT sp PAGE SET-COLOR VIDEO STATE SCROLL UP SCROLL-DOWN READ AC CURRENT WR I TE AC CURRENT WR I TE-C CURRENT READ DOT WRITE DOT WR 1TE-TTY READ LpEN MEMORY SIZE oET I EQUIPMENT 1NMI INT 1CASSETTE 10 I SHUT9 -GATE A20 TIME-OF DAY I RTC TmpR I NT SCREEN I TIMER-'NT 1 FILL BASIC 01 02 D2A EIOI EI02 EI03 EI04 EI05 EI06 EI07 EI08 or FOOO FOOO FOOO FOOO FOOO FOOO FOOO FOOO FOOO FOOD FOOO FOOD FOOO FOOO FOOD FOOD FOOD FOOO FOOD FOOO FOOD FOOD FOOD FOOO FOOD FOOD FOOO FOOD FOOO FOOO FOOO FOOO FOOO FOOO FOOO FOOO FOOO FOOO FOOO FOOD FOOO FOOO FOOO FOOO FOOO FOOO FOOD FOOO FOOD FOOD FOOO FOOD FOOO 3116 FF54 41A9 lC31 1 A85 1 A69 lA10 19A4 FFFO 3B81 3AOC 3CBD 3FF9 lC19 I ABO 1ABI 1FB5 31M 413F 382F 3A90 28Cl FF62 3A41 39E4 39BF 38EF 1828 IOB6 1052 1613 100A 10B9 43BF FF23 366C 0050 1E85 ID2A 483F 45BO FF66 FEF3 38BO FOA4 3A6D I A36 3BDB 3COD 3CCE 3F12 lFE\ 1 A59 PRINTER [0 1 PR 1NT SCREEN PR [NT- SCREEN t PROC SHUTDOWN PROT-PRT HEX PRT 'HEX PRT-SEG P MSG P-O R READ AC CURRENT READ-CURSOR READ-DDT READ-LPEN RE OTRECT ROM CHECK ROM-CHECKSUM ROM-ERR RS232 [0 \ RTC INT SCROLL DOWN SCROLL-UP SEEK SEEKS t SET COLOR SET-CPOS SET-CTYPE SET-MODE SET-TOO SHUT2 SHUT3 SHUT4 SHUT6 SHUn SHUT9 SLAVE VECTOR TABLE SND DATA START I STGTST CNT SYSINITI TIMER INT I TIME OF DAY I TUTOR VECTOR TABLE VIDEO To 1 V IOEO-PARMS V [OED-STATE WA ITFWR I TE AC CURRENT WR I TE-C CURRENT WR I TE-DOT WR 1TE-TTY XMIT 8042 XPC_BYTE FOOD FOOO FOOD FOOD FOOD FOOO FOOD FOOD FOOO FOOD FOOD FOOO FOOD FOOD FOOO FOOD FOOD FOOD FOOD FOOO FOOO FOOO FOOD FOOD FOOD FOOD FOOD FOOO FOOO FOOD FOOD FOOO FOOD FOOO FOOO FOOD FOOO FOOD FOOD FOOD FOOO FOOO FOOO FOOO FOOO FOOD FOOO FOOD FOOO FOOO FOOO FOOO FOOD EI26 EI3F EI68 E19\ EI81 EIOB EIEE E209 E224 E239 E250 E2C3 E2C6 E2EA E30E E3\E E32E E343 E364 E319 E38E E3AC E38F E3D2 E3DF E40 I E6F5 E129 E81E E886 E88E E8C8 E8EI E91B E955 E95F E969 E916 EFC1 FOM FOE4 FOEC FOF4 FA6E FEF3 FF23 FF53 FF54 FF5A FF5E FF62 FF66 FFFO El09 EI61 EI62 E163 EI64 E201 E202 E203 E301 E302 F3D NMI INT E303 E304 E401 E501 E601 E602 FI180 F1181 FI182 FI190 F119\ F3A F30\ FO TBL CONF TBL AI - K. K1 K8 K9 KIO Kl1 K 12 K13 K 14 K 15 DISK BASE V IDEO PARMS .5 .,•• - CRT CHAR GEN VECTOR TABLE SLAVE VECTOR TA8LE OUMMY-RETURNPR [NT-SCREEN HRO FLOPPY SEEKS I TUTORP _O_R THE 8105 ROUTINES ARE MEANT TO BE ACCESSED THROUGH SOFTWARE INTERRUPTS ONLY. ANY ADDRESSES PRESENT 1N THESE LIST I NGS ARE INCLUDED ONL Y FOR COMPLETENESS, NOT FOR REFERENCE. APPL I CAT [ONS WH I CH REFERENCE ANY ABSOLUTE ADDRESSES WITH I N THE CODE SEGMENTS OF 810S VIOLATE THE STRUCTURE AND DESIGN OF 8105. ADDRESSES WITH I N THE 810S CODE SEGMENT ARE SUBJECT TO CHANGE AND ROUT I NES SHOULD BE ACCESSED THROUGH PO I NTERS IN THE I NTERRUPT VECTORS OR WHEN NECESSARY THROUGH THE POINTERS [N THE 8105 ~OATA" SEGMENT. MAP 5-27 IBM Personal Computer MACRO Assembler TESTI ---- 06/10/85 POWER ON SELF TEST 1 2 3 Version 2.00 (POST) PAGE 118,121 TITLE TESTI ---- 06/I0/8S .286C • 1-1 06-10-8S POWER ON SELF TEST (POST) 5 6 1 8105 • 9 10 I/O INTERFACE THESE LISTINGS PROVIDE INTERFACE INFORMATION FOR ACCESSING THE BIOS ROUTINES. THE POWER ON SELF TEST rs INCLUDED. 11 12 13 THE BIOS ROUTINES ARE MEANT TO BE ACCESSED THROUGH INTERRUPTS ONLY. ANY ADDRESSES PRESENT IN SOFTWARE THESE LISTINGS ARE INCLUDED ONLY FOR COMPLETENESS, NOT FOR REFERENCE. APPL I CAT IONS WH I CH REF~RENCE ANY ABSOLUTE ADDRESSES WITH I N THE CODE SEGMENTS OF B I OS VIOLATE THE STRUCTURE AND DESIGN OF BIOS. I. 15 " 16 11 19 20 21 22 23 2. MODULE REFERENCE 25 26 TEST! .ASM DSEG.INC POS TEQU. INC SYSDATA. INC 21 2. 29 30 31 --> --> TEST2.ASM 32 33 lEST3. ASM TEST4.ASM 3. --> --> 35 36 31 3B 39 .0 "'2 43 4. '5 '6 ".B 49 50 51 52 53 5. 55 56 51 5B TESTS.ASM 59 60 61 62 TEST6.ASM 63 6. 65 66 61 6B 69 10 DSKETTE. ASM 11 12 ,. DISK.ASM 16 11 KYBD.ASM --> 13 18 PRT .ASM RS232.ASM VIDEOI.ASM BIOS.ASM B. B5 B6 B1 810S1.ASM BB B9 90 91 92 93 9. 95 96 91 9B 99 100 101 102 103 10. 105 106 101 lOB 109 110 BIOS2.ASM ORGS.ASM LIST TESTl OISKETTE 8105 DISKETTE 10 I DISK INT-l OSKETTE SETUP FIXED DISK BIOS DISK SETUP DISK-IO KE~~0!~6 8105 15 19 BO B1 B2 B3 POST AND MANUFACTURING TEST ROUTINES DATA SEGMENTS LOCATIONS COMMON EQUATES FOR POST AND 8105 POWER ON SELF TEST EQUATES FOR PROTECTED MODE POST TEST. 0 1 THROUGH TEST. 16 POST TEST AND INITIALIZATION ROUTINES POST TEST. 1 7 THROUGH TEST. 22 POST EXCEPT I ON I NTERRUPT TESTS POST AND BIOS UTILITY ROUTINES CMOS READ - READ CMOS LOCATI ON ROUT INE CMOS-WRITE - WRITE CMOS LOCATION ROUTiNE DDS - LOAD (OS:) WITH DATA SEGMENT E MSG - POST ERROR MESSAGE HANDLER MFG HAL T - MANUF ACTUR I NG ERROR TRAP - POST STRING DISPLAY ROUTiNE P MSG ERR 8EEP - POST ERROR BEEP PROCEDURE BEEP - SPEAKER BEEP CONTROL ROUT I NE WAITF - FIXED TIME WAIT ROUTINE CONFIG BAD - SET BAD CONFIG IN CMOS DIAG XPC BYTE - D I SPLA Y-HEX BYTE AS 00-- FF PRT-HEX - DISPLAY CHARACTER PRT-SEG - 01 SPLAY SEGMENT FORMAT ADDRESS PROT PRT HEX - POST PROTECTED MODE DISPLAY ROM CHECKSUM - CHECK ROM MODULES FOR CHECKSUM RON-CHECK - ROM SCAN AND I NIT I AL f ZE KBD-RESET - POST KEYBOARD RESET ROUT I NE BLINK INT - MANUFACTURING TOGGLE BIT ROUTINE SET TOO - SET TI MER FROM CMOS RTC - DUMMY I NTERRUPT HANDLER -> I NT 7?H D 1 1RE 0 I RECT - HARDWARE I NT 9 RED I RECl (L 2) INT 287 - HARDWARE INT 13 REDIRECT (281) PROC SHUTDOWN - 80286 RESET ROUT I NE EXCEPTToN I NTERRUPT TEST HANDLERS FOR POST TESTS SYSINITI - BUILD PROTECTED MODE POINTERS GOT BlD - BUILD THE GOT FOR POST SlOT BLO - BUILD THE lOT FOR POST POST TESTS AND SYSTEM BOOT STRAP STGTST CNT - SEGMENT STORAGE TEST ROM ERR - ROM ERROR 0 I SPlA Y ROUT I NE XMIT 8042 - KEYBOARD DIAGNOSTiC OUTPUT BOOT:::STRAP - BOOT STRAP LOADER -INT 19H --> --> - INT 13H BIOS ENTRY (40H) -INT 13H HAROWARE INTERRUPT HANDLER -INT OEH POST SETUP DR I VE TYPES - SETUP 0 I SK VECTORS AND TEST INT 13H BIOS ENTRY -INT 13H - HARDWARE INTERRUPT HANDLER -INT 16H KEYBOARD 10 I - INT 16H BIOS ENTRY -INT 16H KB I NT 1- - HARDWARE I NTERRUPT -I NT 09H SNO DATA - KEYBOARD TRANSMISSION PRINTER 'ADAPTER BIOS -INT l1H COMMUNICATIONS BIOS FOR RS232 -INT 14H VIDEO BIOS -INT IOH BIOS ROUTINES MEMORY 5 I ZE DET 1 - REAL MODE SIZE 12H EQU I PM~NT 1- -EQU I PMENT DETERM I NAT I ON -INT llH NMI INT ,- NMI HANDLER -INT 02H I NTERRUPT- j 5H B I OS ROUT I NES -INT 15H DEV OPEN - NULL DEV I CE OPEN HANDLER DEV-CLOSE - NULL DEV I CE CLOSE HANDLER PROG TERM - NULL PROGRAM TERM I NAT I ON EVENT WA I T - RTC EVENT WA I T IT I MEOUT ROUTI NE JOY STICK - -JOYSTICK PORT HANDLER SYS-REQ - NULL SYSTEM REQUEST KEY WAIT - RTC TIMED WAIT ROUTiNE BLOCKMOVE - EXTENDED MEMORY MOVE INTERFACE GATE A20 - ADDRESS 81T 20 CONTROL EXT MEMORY - EXTENDED MEMORY SIZE DETERM I NE SET-VMODE - SW I TCH PROCESSOR TO V I RTUAL MODE DEVTcE BUSY - NULL DEVICE 8USY HANDLER I NT COMPLETE - NULL I NTERRUPT COMPLETE HANDLER B I OS TNTERRUPT ROUT I NES TIME OF DAY' - TIME OF DAY ROUTINES -INT IAH RTC TNT- I RQ LEVEL 8 ALARM HANDLER - I NT 10H PR I NT SCREEN' - PR I NT SCREEN ROUT I NE -I NT OSH TlMER-'NT 1 - TIMERI INTERRUPT HANDLER ->INT lCH COMPATIBILITY MODULE POST ERROR MESSAGES DISKETTE - DISK - ,VIDEO DATA TABLES IBM TESTI Computer MACRO A55embler Ver5ion 2.00 ---- Ob/l0/65 POWER ON SELF TEST (POST) DSEG.INC - DATA SEGMENTS Per~onal 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 12b 127 128 129 C e 0006 0008 ???????? 0014 0014 ???777?? 0020 0020 ???????? 0040 0040 ?????7?? 004C 004C ????7??? 0060 0060 ?????7?? 139 140 141 142 143 144 0014 0014 ???"?" 0018 0018 154 155 156 163 I b4 1 b5 166 161 168 169 170 111 112 173 114 NON-MASK ABLE INTERRUPT VECTOR IPINT5_PTR ORG 4·005H DO? PRINT SCREEN INTERRUPT VECTOR III I NT_PTR ORG 4·008H DO? HARDWARE IIIVIDEO_INT ORG 4·010H DO? VIDEO 1II0RG_VECTOR ORG 4·013H DO? DISKETTE/DI SK IIIBASIC_PTR ORG DD POINTER TO CASSETTE BASIC IIIPARM_PTR ORG 4·01DH DO? POINTER TO VIDEO PARAMETERS IPDISK_POINTER ORG 4·01EH DO? POINTER TO DISKETTE PARAMETER TABLE IlIEXT _PTR ORG 4·01FH DO? PO I NTER TO GRAPH I C CHARACTERS IIIDISK_VECTOR ORG 4·040H DO? POINTER TO DISKETTE IlIHF_TBL_VEC ORG 4·041H DO? POINTER TO FIRST DISK PARAMETER TABLE IIIHF1_TBL_VEC ORG 4·046H DO? POINTER TO SECOND DISK PARAMETER TABLE iIISLAVE_INT_PTR DRG 4·070H DO? POINTER TO SLAVE @HDISK_INT ORG DO POINTER TO FIXED DISK IPTOS ORG 0400H OW? C C C C C C C C C C C C C C C C C c ???????? C C INTERRUPT VECTOR TABLE INTERRUPT POINTER 0104 0104 ???????? e e aI e 4·018H ") I/O (8-F) INTERRUPT VECTOR INTERRUPT VECTOR 128-255 C INTERRUPT CODE C C 18 011817117??? C 01CO OICO ???????? C C 0108 0108 ???????? C C C 160 161 162 START OF ORG 4·002H DO? 001C 001C ????17?? 157 158 159 DB PNMI_PTR 0100 0100 ????1717 151 152 153 IPSTG_LOCO C C C C C C 145 146 141 148 149 150 C C C C 136 131 138 ; ------------ ---------------------------- C 0000 133 134 135 PAGE INCLUDE DSEG. INC C; 80286 INTERRUPT LOCAT IONS C; REFERENCED BY POST & B I OS ; -- ---------- ---------------------------C C C SEGMENT AT 0 ADDRESS= 0000;0000 130 131 132 1-2 06-10-65 INTERRUPT HANDLER C 4·016H ") INTERRUPT CODE C 0400 0400 ???? C C 0500 0500 C C C C 1COO 1COO 7eOO (ioMFG_TEST_RTN C C C IlIBOOT_LOCN C CASSO ~G STACK -- USED DURING POST ONLY USE WILL OVERLAY INTERRUPTS VECTORS LABEL 0500H FAR LOAD LOCATION FOR MANUFACTURING TESTS ORG LABEL 1COOH FAR BOOT STRAP CODE LOAD LOCATION ENDS TESTl 5-29 1-3 IBM Pereonal Computer MACRO Aseembler Version 2.00 TESTI ---- Ob/10/85 POWER ON SELF TEST (POST) OSEG.INC - DATA SEGMENTS "5 ". C C 117 "B "9 IBO IBI IB2 IB3 lB. IB5 lB. IB7 IBB IB9 190 191 192 193 19' 195 19. 197 19B 199 200 201 202 203 20. 205 20. 207 20B 209 210 211 212 213 21' 215 21. 2.7 2'B 2'9 250 251 252 253 25. 255 25. 257 25B 2.9 2.0 2., 2.2 2.3 2 •• 2 •• 2 •• 2.7 2.B 2.9 270 DATA C C C C C C ttEQUIP FLAG ttMFG TST PMEMORY SIZE PMFG_ERR_FLAG C ; C C ;-- ; C C C C C C C SEGMENT AT 40H ADDRESS= 0040: 0000 DW DW DW DW DW DW DW DW DW DB DW DB DB BASE ADDRESSES OF RS232 ADAPTERS SECOND LOGICAL RS232 ADAPTER RESERVED RESERVED BASE ADDRESSES OF PRINTER ADAPTERS SECOND LOGICAL PRINTER ADAPTER THIRD LOGICAL PRINTER ADAPTER RESERVED INSTALLED HARDWARE FLAGS INITIALIZATION FLAGS BASE MEMORY SIZE IN K BYTES (X 1024) SCRATCHPAD FOR MANUFACTUR I NG ERROR CODES - -- - - -- -- - - - - -- - - - - ---- - - - ---- -- - --- - - -DATA AREAS 1 -----KEY80ARD - ----- - - ----- - - ---- - -- --- - - - - - - -- C C DB DB DB ttKB FLAG ttKB-FLAG 1 PAL"f INPUT tt8UFFER HEAD PBUFFER:TAIL ; ------ KEYBOARD SHIFT STATE AND STATUS FLAGS • SECOND 8YTE OF KEYBOARD STATUS ; STORAGE FOR ALTERNATE KEY PAD ENTRY I PO [NTER TO HEAD OF KEYBOARD 8UFFER ; PO I NTER TO TAl L OF KEY80ARD 8UFFER DW DW HEAD C C = TAIL DW INDICATES THAT THE BUFFER IS EMPTY 16 DUP!?} ROOM FOR 15 SCAN CODE ENTR I ES C C C C C C ;I ----- - DISKETTE ----- -- - --- - -- --- -- - - ---- - - - ---DATA AREAS : C C DB DRIVE RECALI8RATION STATUS BIT 3-0 = DRIVE 3-0 RECALIBRATION BEFORE NEXT SEEK IF BIT IS = MOTOR STATUS BIT 3-0 '" DRIvE 3-0 CURRENTLY RUNNING BIT 1 = CURRENT OPERATION IS A WRITE T I ME OUT COUNTER FOR MOTOR ( S) TURN OFF RETURN CODE STATUS 8YTE C C C C C C C C a DB IPMOTOR COUNT DB IPDSKETTE_STATUS DB DB C C 1 DUP(?) II ~~~T~~O~~TE~ N F~6~C~ I ~~~T~~ S~p~~~~~6~ON C C C 0049 004A 004C 004E 0050 ?? 1111 111? 1111 OB ???1 OObO 0062 0063 0065 0066 11?? 1? 1?1? 11 1? ;-- C C I C C C C C C OCRT MODE II'ICRT-COLS IPCRT-LEN PCRT-START ttCURSOR_POSN DB OW OW OW C C C C II.'ICURSOR MODE II'IACT I VE-PAGE OADDR 6845 II'ICRT MODE SET OCRT:PALETTE OW DB OW DB DB ; ow CURRENT 01 SPLAY MODE I TYPE) NUMBER OF COLUMNS ON SCREEN LENGTH OF REGEN BUFFER I N BYTES STARTING ADDRESS IN REGEN BUFFER CURSOR FOR EACH OF UP TO 8 PAGES ? ? 8 DUPIn c c I ; 0061 0069 006B ------------ --- --- ----- - - - ----- -----VIDEO DISPLAY DATA AREA : -- -- ------ ------ -- --------- --- ----- ---- C c 2., 2 •• --- ------------------------ - ---- - -- ---ROM 8105 DATA AREAS : -- --- ----- ----- - - ----- -- ---- - -- ----- - -- C C 22' 225 2.3 2 •• 2.5 ; ; C C 219 220 221 222 223 2.2 ; C C C C C 2" 21B 22. 227 22B 229 230 231 232 233 23. 235 23. 237 23B 239 2.0 PAGE C C C 06-10-85 11?1 11?1 11 POST AND BIOS WORK DATA AREA - --- - -- - -- -- - - ---- - ---- - - - - - -- - - - ---- --- 010 ROM INIT OIO-ROM-SEG 11'1 I NTR_FLAG ; ; C CURRENT CURSOR MODE SETT I NG CURRENT PAGE BEING DISPLAYED BASE ADDRESS FOR ACTIVE DISPLAY CARD CURRENT SETT I NG OF THE 3X8 REG I STER CURRENT PALETTE SETTI NG - COLOR CARO STACK SAVE, etc. POINTER TO ROM INITIALIZATION ROUTINE PO I NTER TO I / a ROM SEGMENT FLAG INDICATING AN INTERRUPT HAPPENED DW DW DB - ---- -- - - - --- - --- - - - - -- - - - - --- - - - - - -- --TIMER DATA AREA ; ---------------------------------------- C 006C 006E 0010 0011 0012 1111 1??1 " C C C C C C 11 1??? IPBIOS BREAK ttRESET]LAG C C C C C C C C DW DW DB ; ; ; LOW WORD OF T I MER COUNT HIGH WORD OF T I MER COUNT TIMER HAS ROLLED OVER SINCE LAST READ -- -- ------ -----DATA - - ------------- -------------- -- -SYSTEM ---- ------- AREA - - - - - - - - - - - - - - - - -- - -- C C C TESTl ; ; 272 273 27. 275 27. 217 27B 279 5-30 ; C C 271 0014 0015 0016 0011 OTIMER LOW ttT I MER-H I GH IPTI MER:OFL DB DW I ; BIT 7=1 IF BREAK KEY HAS BEEN PRESSED WORD= 1 234H I F KEYBOARD RESET UNDERWAY I - - - - - --- - - -- ---- - - - - - - - - - - - - - -- - - -- - ---; FIXED DISK DATA AREAS ~ ODISK STATUS! ttHF NUM OCONTROL BYTE OPORT_OFF DB DB DB DB FIXED DISK STATUS COUNT OF FIXED DISK DRIVES HEAD CONTROL 8YTE RESERVED ~ PORT OFFSET) IBM Personal Computer MACRO Assembler Version 2.00 TESTI ---- 06/10/65 POWER ON SELF TEST (POST) OSEG.INC - DATA SEGMENTS 280 281 282 283 28. 285 0076 11 286 0079 ?? 281 001A 11 288 001B ?? 289 007C 290 0010 291 001E ?? 292 007F 11 293 29. 295 296 291 298 299 0080 11?? 300 0082 ???? 301 302 303 3D. 305 306 0084 11 301 0065 ???? 308 0067 ?? 309 0088 11 310 0089 11 311 008A ?? 312 313 31' 315 316 311 008B 11 318 OGBC ?? 319 0080 ?? 320 008E 11 321 OOBF 11 0090 11 322 323 0091 ?? 32. 0092 11 325 0093 ?? 326 0094 ?? 321 • 0095 11 328 329 330 331 332 0096 ?? 333 33. 0097 11 335 336 331 338 339 3.0 0098 ?? 3., 009A 11 009C ?? 3'2 343 009E ?? 3 •• OOAO ?? 3.5 3'6 3" 3.8 3.9 350 OOAI 01 [ 351 11 352 353 35. 355 356 351 358 00A8 1111??1? 359 360 361 362 363 36. 365 0100 366 361 0100 ?? 368 369 310 0101 311 312 1-' 06-10-85 PAGE ;- - -------------------------------------; TIME-OUT VARIABLES : ; ------ -- ---- ---- --- --- --- ----- --- -- G!lPRINT_TIM_OUT n ORS232_ TIM_OUT ; ; ; - -- -- - - - - -- - - - - - - - - - -- - - - - -- - - - -- -- - ---KEYBOARD DATA AREA ----- - - ADDITIONAL ---- - ---- - -------- - - ---- - - - -- - -- G!lBUFFER START G!lBUFFER:END ; T I ME OUT COUNTERS FOR PR [NTER RESPONSE SECOND LOG I CAL PR [NTER ADAPTER TH I RD LOG I CAL PR I NTER ADAPTER RESERVED T I ME OUT COUNTERS FOR RS232 RESPONSE SECOND LOG I CAL RS232 ADAPTER RESERVED RESERVED DB DB DB DB DB DB DB DB ; BUFFER LOCATION WITHIN SEGMENT 40H ; OFFSET OF KEYBOARD BUFFER START ; OFFSET OF END OF BUFFER ow ow - - --- - - - - - - - - - -- - - - ---- - - -- - - - - - - - - - - - -- ; EGA/PGA DISPLAY WORK AREA 1--- ---- - - - - - - - - - - - - - - - - - - - - - - - - - - --- - --OROWS OPOINTS OINFO OINFO_3 ; ; ; OW DB DB DB DB I) - - - - -- - - - -- - - - - -- - -- ---- - --- -- - --- - - ---ADDITIONAL MEDIA DATA ----- - --- - - ---- - - - -- - - --- - - - --- - - - -- - -- G!lLASTRATE IPHF STATUS IPHF-ERROR OHF-I NT FLAG IlIHF-CNTRL IPOSK_STATE C e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e C e e e e e e e e e e e e ROWS ON THE ACT I VE SCREEN (LESS BYTES PER CHARACTER MODE OPT IONS FEATURE BIT SWITCHES RESERVED FOR 0 I SPLAY ADAPTERS RESERVED FOR 0 I SPLA Y ADAPTERS DB OOSK_TRK ; --; DB DB DB DB DB DB DB DB DB DB DB LAST DISKETTE DATA RATE SELECTED STATUS REGI STER ERROR REG I STER F I XED 0 I SK I NTERRUPT FLAG COMBO FIXED DISK/DISKETTE CARD BIT 0=1 DRIVE MEDIA STATE DRIVE 1 MEDIA STATE DRIVE 0 OPERATION START STATE DRIVE 1 OPERATION START STATE DRIVE 0 FRESENT CYLINDER DR I VE 1 PRESENT CYL I NDER a -----ADDITIONAL - ----- - --------------- ------ ---KEYBOARD FLAGS ; ---------------------------- -----------OKB FLAG 3 OKB:FLAG:2 ; I DB DB KEYBOARD MODE STATE AND TYPE FLAGS KEYBOARD LED FLAGS --- - - - -- - - ---- - - --- -- - - -- - - ---REAL T I ME CLOCK DATA AREA ; ------ - - ; OUSER FLAG OUSER-FLAG SEG OoRTC COW G!lRTC-H I GH OoRTC:WA IT_FLAG ow OW DW ow DB - - -- ---- - ---- - - -- -- ----- - ---- - ------ ---; AREA FOR NETWORK ADAPTER ,--------- - ------ ---- -- ----------- - - - --- OFFSET ADDRESS OF USERS WA I T FLAG SEGMENT ADDRESS OF USER WA I T FLAG LOW WORD OF USER WA I T FLAG HIGH WORD OF USER WAIT FLAG WAIT ACTIVE FLAG {OI=BUSY. 60=POSTED} (OO=POST ACKNOWLEDGED} ; ONET ; ; ; DB RESERVED FOR NETWORK ADAPTERS 1 OUP!?) - - -- - --- - --- - - - -- - - -- - - - - -- -- - --- - - - ---EGA/PGA PALETTE POINTER --------- ---------- - ---------- - -------DO ; PO I NTER TO EGA PARAMETER CONTROL BLOCK , RESERVED ; ADORESS= 0040: - - - - - - --- - - - - - - - - - - - --- - - ---- - ----- - ---OATA AREA - PRINT SCREEN I ; ---------- - ------ --- - -- ---------- ---- --; ; DRG DATA 100H a 100 (REF 0050: 0000) DB ; PRINT SCREEN STATUS BYTE OO=READY 10K, 01 =BUSY, FF=ERROR ENOS I END OF BIOS DATA SEGMENT .LlST TEST1 5-31 IBM Personal Computer MACRO Assembler Version 2.00 TESTI ---- 06/10/65 POWER ON SELF TEST (POST) POSTEQU.INC - COMMON EQUATES 373 374 375 376 377 378 37. 380 381 382 383 384 385 386 387 388 38. 3'0 3., 3'2 3.3 3.4 3'5 396 3.7 3'8 3" 400 401 402 403 404 405 406 407 408 40. 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 42. 430 431 432 433 434 435 436 437 438 43. 440 441 442 443 444 445 446 447 448 44. 450 451 452 453 454 455 456 457 458 45. 460 461 462 463 464 465 466 467 468 46. 470 471 472 473 474 475 476 477 478 47. 480 481 482 483 484 485 C PAGE INCLUDE POSTEQU. INC C ; C C • C 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 OOFC 0000 000 I F6A7 F9FD C C C C C C C C C C C C 0060 0061 00F3 OOOC OOCO 000 I 0002 00 I 0 0020 0040 0060 0064 0001 0002 0004 0008 0010 0020 0040 0080 C C C C C C C C C C C C C C C C C C C C C 0008 0010 0020 0040 0080 C C C C C C C C C C 0060 OOAA 00A8 00.1.0 OOAE OOCO 0000 DOoF OOEO OOFE 0001 C C C C C C C C C C C C C C C C C C C ODED 00F2 00F4 OOAA OOFA OOFE DOFF 0001 0002 0004 0008 00 I 0 0020 0040 0080 C C C C C C ; 1-5 06-10-85 - - - ---- - - - - - --- - --- --- - --- - - ------ - - -- -EQUATES USED BY POST AND B I OS - ---- - - ---- - - - - - - - - - - - - - - - - - - - - - ---- - --- MODEL BYTE SUB MODEL BYTE BIOS LEVEL RATE-UPPER RATE::::LOWER EOU EOU EOU EOU EOU 1--------- 8042 PORT A PORT-B RAM PAR ON RAM-PAR-OFF PARTTY ERR GATE2 SPK2 REFRESH BIT OUT2 10 CHECK PARITY CHECK STATUS-PORT OUT 8UF FULL I NPT BUF FULL SYS FLAGCMD-DATA KYBD INH TRANS TMOUT RCV TM"OUT PARTTY_EVEN KEYBOARD INTERFACE AND DIAGNOSTIC CONTROL REGISTERS -----------EQU 060H 8042 KEYBOARD SCAN CODE/CONTROL PORT EQU 061H PORT B READ/WRITE DIAGNOSTIC REGISTER EQU 111100/18 AND MASK FOR PARITY CHECKING ENABLE ON EQU OOOOIIOOB OR MASK FOR PARITY CHECKING ENABLE OFF EQU I 1000000B R/W MEMORY - I/O CHANNEL PAR I TY ERROR EQU 0000000IB TIMER 2 INPUT GATE CLOCK BIT EQU 00000010B SPEAKER OUTPUT DATA ENA8LE BIT EQU 000100008 REFRESH TEST BIT EQU 00100000B SPEAKER TIMER OUT2 INPUT BIT EQU 01000000B I/O (MEMORY) CHECK OCCURRED BIT MASK EQU 100000008 MEMORY PARITY CHECK OCCURRED BIT MASK EQU 064H 8042 STATUS PORT EQU 000000018 0 = +OUTPUT BUFFER FULL EQU 000000 108 I + I NPUT BUFFER FULL EQU 000001008 2 = -SYSTEM FLAG -POST/-SELF TEST EQU 0000 I 0008 3 = -COMMAND/ +DATA EQU 000100008 4 +KEYBOARD INHIBITED EQU 001000008 5 +TRANSMIT TIMEOUT EQU 010000008 6 = +RECEIVE TIME OUT EQU 100000008 7 +PARITY IS EVEN 8042 BASE MEM8 BASE-MEM MFG LOOP DSP-..JMP KEY::::BD_INHI8 INPUT PORT BIT DEFINITION EQU 000010008 EQU OOOIOOOOB • EQU 00100000B ; EQU OIOOOOOOB ; EQU 10000000B ; ; --------- 8042 WRITE 8042 LOC SELF TEST INTR-FACE CK DIS 'K8D ENA-K80 READ 8042 INPUT DISABLE BTT20 ENABLE BIT20 KYBD CLK DATA SHUT-CMDKYBD::::CLK COMMANDS ------------------------------------------------------EQU 060H WRITE 8042 COMMAND 8YTE EQU OAAH 8042 SELF TEST EQU OABH CHECK 8042 INTERFACE COMMAND EQU OADH DISABLE KEYBOARD COMMAND EQU OAEH ENABLE KEYBOARD COMMAND EQU OCOH READ 8042 I NPUT PORT EQU ODDH DISABLE ADDRESS LINE BIT 20 EQU ODFH ENABLE ADDRESS LINE BIT 20 EQU OEOH GET KEYBOARD CLOCK AND DATA COMMAND EQU OFEH CAUSE A SHUTDOWN COMMAND OOIH KEYBOARD CLOCK BIT 0 EQU OFCH OOOH OOIH OF8A7H OF9FoH SYSTEM MODEL BYTE • SYSTEM SUB-MODEL TYPE ; BIOS REVISION LEVEL OF952H + 1 OX ; OF952H -lOX I = = = = ;---------- KEYBOARD/LED COMMANDS LED CMD EQU OEDH KB READ 10 EQU OF2H K8:ENABLE EQU OF4H ; ; ; SAVED IN !lIMFG TST -------------------BASE PLANAR R/W MEMORY EXTENSION 640/X BASE PLANAR R/W MEMORY SIZE 256/512 LOOP POST ..JUMPER BtT FOR MANUFACTURING DISPLAY TYPE SWITCH ..JUMPER BIT KEY80ARD INHIBIT SWITCH BIT LED WR I TE COMMAND READ KEY80ARD 10 COMMAND KEY80ARD ENABLE ; -- -------- 8042 KEYBOARD RESPONSE ------------ ----- ---------------------------KB OK EQU OAAH ; RESPONSE FROM SELF 0 I AGNOST I C K8-ACK EQU OFAH ; ACKNOWLEDGE FROM TRANSMISSION KB-RESENo EQU OFEH ; RESEND REQUEST K8:0VER_RUN EQU OFFH ; OVER RUN SCAN CODE ;---------- FLAG EQUATES WITHIN OKB FLAG -------------------------------------RIGHT SHIFT EQU OOOOOOOIB RIGHT SHIFT KEY DEPRESSED LEFT SHIFT EQU 000000108 LEFT SHIFT KEY DEPRESSED CTL SHIFT EQU 000001008 CONTROL SHIFT KEY DEPRESSED ALT-SHIFT EQU 000010008 ALTERNATE SHIFT KEY DEPRESSED SCROLL STATE EQU 0001 OOOOB SCROLL LOCK STATE HAS BEEN TOGGLED NUt.! STATE EQU 001000008 NUM LOCK STATE HAS BEEN TOGGLED CAPS STATE EQU OIOOOOOOB CAPS LOCK STATE HAS BEEN TOGGLED INS_STATE EQU 100000008 INSERT STATE IS ACTIVE C C C C C 0004 0008 0010 0020 0040 0080 C C C C C C 0007 C 0010 0020 0040 0080 C C C C C C C C C C C 0001 0002 0004 0020 0040 0080 C C ;---------- FLAG EQUATES WITHIN !lIKB FLAG 1 -----------------------------------SYS SHIFT EQU 000001008 -SYSTEM KEY DEPRESSED AND HELD HOLD STATE EQU 00001000B SUSPEND KEY HAS BEEN TOGGLED ~B~O~~T~~IFT ~~~ ~~~ 6~~~~~ ; ~~:O~~C~O~~Y K~~ CAPS SH I FT INS_SHIFT EQU EQU 01 OOOOOOB 10000000B ; ; b~p~~~~~6SED CAPS LOCK KEY I S DEPRESSED INSERT KEY IS DEPRESSED ;---------- FLAGS EQUATES WITHIN !lIKB FLAG 2 ----------------------------------K8 LEOS EQU 00000111B 'KEYBOARD LEO STATE 81TS ~B -FA K8-FE KB-PR LED KS:ERR ~~~ EQU EQU EQU ~~~~ 6~~~~ 001 OOOOOB 010000008 100000008 ; ~~~~~~~~o~~~~i ~~c~~~~b ; ; ; RESEND RECE I VED FLAG MODE INDICATOR UPDATE KEYBOARD TRANSMIT ERROR FLAG ;---------- FLAGS EQUATES WITHIN !lIK8 FLAG 3 ----------------------------------K8X EQU OOOOOOOIB - ; RBX INSTALLED LC HC EQU 000000108 LAST SCAN CODED WAS A HIDDEN CODE GRAPH ON EQU 00000100B ALL GRAPHICS KEY DOWN (W.T. ONLY) N~M ;ET LC A8 RO:ID LK - ~~~ ~~~6~~~g~ EQU EQU 010000008 10000000B ~~~~~V~BM (~g~~ ~~ ~~~g) 10 AND K8X LAST CHARACTER WAS FIRST ID CHARACTER DOING A READ 10 IMUST BE BITO) C 0 0 0 0 0 0 0 0 0 0 0 C C C C C C 00A8 0041 0038 0010 003A 0053 0052 002A 0045 0036 0046 0054 5-32 C C C C TESTl ; ---------- KEYBOARD SCAN CODES 10 I EQU OABH 10-2 EQU 041H AL T KEY EQU 56 CTL -KEY EQU 29 CAPS KEY EQU 58 DEL 'KEY EQU 83 INS-KEY EQU 82 LEFT KEY EQU 42 NUM 'KEY EQU 69 RIGHT KEY EQU 54 SCROLL KEY EQU 70 SYS_KEY EQU 84 I ST 10 CHARACTER FOR KBX 2ND 10 CHARACTER FOR K8X SCAN CODE FOR ALTERNATE SHIFT KEY SCAN CODE FOR CONTROL KEY SCAN CODE FOR SH I FT LOCK KEY SCAN CODE FOR DELETE KEY SCAN CODE FOR I NSERT KEY SCAN CODE FOR LEFT SH I FT SCAN CODE FOR NUMBER LOCK KEY SCAN CODE FOR RIGHT SH I FT SCAN CODE FOR SCROLL LOCK KEY SCAN CODE FOR SYSTEM KEY IBM Peri50nal Computer MACRO Assembler Version 2.00 TESTI ---- 06/10/85 POWER ON SELF TEST (POST} POSTEQU.INC - COMMON EQUATES 46. 461 466 469 490 491 492 493 494 495 49. 491 496 499 500 501 502 503 504 505 50. 501 506 509 510 511 512 513 514 515 516 511 516 519 520 521 522 523 524 525 526 521 52' 529 530 531 532 533 534 535 536 531 536 539 540 541 542 543 544 545 54. 541 546 549 550 551 552 553 554 555 55. 551 556 559 560 561 562 563 564 565 56. 561 56' 569 510 511 512 513 514 515 516 511 518 519 560 SOl 562 563 564 565 56. 561 566 569 590 591 592 593 1-' 06-10-85 PAGE I - - - ---- --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - -; CMOS EQUATES FOR THI S SYSTEM : 0070 0071 0080 0000 000 I 0002 0003 000 ... 0005 0006 0007 0008 0009 OOOA OOOB OOOC 0000 OOOE OOOF 0010 0012 - ~~~~ ;~~~ -------~~~ -----~ ;~~--- ---------~ -~ I ~- ~~~~~~~ -~; -~~~~ -~~~~~~~- ;~~~- ----- CMOS-DATA NMi - EQU EQU 011 H 100000008 ; ; ; I/O ADDRESS OF CMOS DATA PORT DISABLE NMI INTERRUPTS MASK HIGH BIT OF CMOS LOCATION ADDRESS ; ---------- CMOS TABLE LOCAT I ON ADDRESS'S ## ----------------------------------CMOS SECONDS EQU OOOH SECONDS CMOS-SEC ALARM EQU OOIH SECONDS ALARM ## NOTE: ALL LOCATIONS g~g;:~: ~O!E~RM ~~~ gg~~ ~: ~~i~; II !~ET7~M C~~~ ~~E~ CMOS-HOURS CMOS-HR ALARM CMOS-DAY WEEK EQU EQU EQU OO ... H 005H 006H ALARM HOURS HOURS ALARM DAY OF THE WEEK A CMOS-REG-B CMOS-REG-C CMOS-REG-D CMOS-DIAG CMOS-SHUT DOWN CMOS-D I SKETTE EQU EQU EQU EQU EQU EQU OOBH OOCH OODH OOEH OOFH 0 I OH STATUS REGISTER B ALARM STATUS REGISTER C FLAGS STATUS REGISTER 0 BATTERY POST DIAGNOSTIC STATUS RESULTS BYTE SHUTDOWN STATUS COMMAND BYTE DISKETTE DR I VE TYPE BYTE • EQU EQU EQU EQU EQU EQU EQU EQU EQU 013H OI"'H 0 ISH 016H 017H 018H 019H OIAH 0 I BH TYPE BYTE - RESERVED EQUIPMENT WORD LOW BYTE BASE MEMORY SI ZE - LOW BYTE (X I 024) BASE MEMORY SIZE - HIGH BYTE EXPANSION MEMORY SIZE - LOW BYTE EXPANSION MEMORY SIZE - HIGH BYTE F I XED 0 I SK TYPE - DR I VE C EXTENS I ON FIXED DISK TYPE - DRIVE 0 EXTENSION - I BH THROUGH 2DH - RESERVED :E ;C ;K :S ;U ;M :E :0 ; ~~~ g~~~ g~g; g~~g~~~~ ;: EQU EQU EQU EQU EQU 030H 031 H 032H 033H 03 ...H USABLE MEMORY ABOVE I MEG - LOW BYTE USABLE MEMORY ABOVE I MEG - HIGH BYTE DATE CENTURY BYTE (BCD) 128KB INFORMATION STATUS FLAG BYTE - 3"'H THROUGH 3FH - RESERVED g~g;:~~~;~ONTH ~~~ g~gF~~~R ~~~ ~MOS-DISK ~~~ gg~~ gg:~ g:~~ ~~~T~F THE MONTH ~~~~U~T~~G~ ~~~~S~ I I AND SUB.JECT TO CHANGE. ONLY THE POST & BIOS CODE ~~g~~~ Lg~~~~6~~ '-~~_~~~:_:~~~~~:.: 1 ;1~~~E~y~~ l~ 001'" 00 IS 0016 OOf 7 0018 0019 OOIA ; CMOS EQUIP CMOS-B M S LO CMOS-B-M-S-HI CMOS-E-M-S-LO CMOS-E-M-S-HI CMOS-DTsK T CMOS:DISK:2 002E 002F 0030 0031 0032 0033 CKSUM HI CMOS-CKSUM-LO CMOS-U M S-LO CMOS-U-M-S-H I CMOS-CENTURY CMOS:I NFO 1'28 000 ... 0008 00 I 0 0020 00 ... 0 0080 ;---------- CMOS DIAGNOSTIC STATUS ERROR FLAGS WITHIN CMOS_DIAG ---------------CMOS CLK FAIL EQU 000001008 CMOS CLOCK NOT UPDATING OR NOT VALID HF FAIL EQU OOOOIOOOB FIXED DISK FAILURE ON INITIALIZATION W MEM SIZE EQU OOOIOOOOB MEMORY SIZE NOT EQUAL TO CONFIGURATION BAD CDNFIG EQU OOIOOOOOB MINIMUM CONFIG USED INSTEAD OF CMOS BAD-CKSUM EQU 0 I OOOOOOB CHECKSUM ERROR BAD:BAT EQU 10000000B DEAD BATTERY - CMOS LOST POWER 0080 ~MOS = ~~~HB~i~E ; ---------- CMOS I NFORMA T10N FLAGS --------------------------------------------M6"'OK EQU 10000000B ; 512K -> 640K OPTION INSTALLED (128K) EQU OIOOOOOOB ; FLAG USED BY CMOS SETUP UTILITY 000 I 0080 0080 00 I 0 00 I 0 000'" 0030 OOOA 0002 OOOF 00 I ... 0025 ; ---------- 0 I SKETTE EQUATES --------------------------------------------------DUAL EQU OOOOOOOIB MASK FOR COMBO/DSP ADAPTER INT FLAG EQU 10000000B INTERRUPT OCCURRENCE FLAG DSK-CHG EQU 10000000B DISKETTE CHANGE FLAG MASK BIT DETERMINED EQU OOOIOOOOB SET STATE DETERMINED IN STATE BITS HOME EQU 000 I OOOOB TRACK 0 MASK 00000100B SENSE DRIVE STATUS COMMAND SEN'SE DRV ST EQU TRK SLAP EQU 030H CRASH STOP ( ... 8 TP I DR I VES) QU I ET SEEK EQU OOAH SEEK TO TRACK 10 MAX DRV EQU 2 MAX NUMBER OF DR I VES HD 12 SETTLE EQU I5 1 .2 M HEAD SETTLE T I ME H03io SETTLE EQU 20 320 K HEAD SETTLE TIME MOTOR:WAIT EQU 37 2 SECONDS OF COUNTS FOR MOTOR TURN OFF ·· · 0080 00 ... 0 0020 00 I 0 0009 0008 0006 000 ... 0003 0002 000 I ;---------- DISKETTE ERRORS TI ME OUT EQU 080H BAD SEEK EQU 040H BAD-NEC EQU 020H BAD-CRC EQU 0 I OH DMA-BOUNDARY EQU 009H BAO-OMA EQU 008H MEDTA CHANGE EQU 006H RECORD NOT FND EQU OO ...H WR I TE PROTECT EQU 003H BAD ADDR MARK EQU 002H BAO:CMO EQU 001 H · 000 I 0002 ;---------- DISK CHANGE LINE EQUATES ------------------------------------------NOCHGLN EQU OOIH ; NO DISK CHANGE LINE AVAILABLE CHGLN EQU 002H ; DISK CHANGE LINE AVAILABLE 0001 0002 000 ... 00 I 0 0020 OOCO 0000 00 ... 0 0080 OOOC OOCO ; ---------- MED I A/DR I VE STATE I NO I CATORS --------------------------------------TRK CAPA EQU 0000000IB 80 TRACK CAPABILITY FMT-CAPA EQU OOOOOOIOB MULTIPLE FORMAT CAPABILITY (1.2M) DRV-DET EQU OOOOOIOOB DRIVE DETERMINED MED-DET EQU OOOIOOOOB MEDIA DETERMINED BIT DBL-STEP EQU OOIOOOOOB DOUBLE STEF BIT RATE MSK EQU IIOOOOOOB MASK FOR CLEARING ALL BUT RATE RATE-500 EQU OOOOOOOOB 500 KBS DATA RATE RATE-300 EQU 0 I OOOOOOB 300 KBS DATA RATE RATE-250 EQU 10000000B 250 KBS DATA RATE STRT-MSK EQU 00001100B OPERATION START RATE MASK SEND=MSK EQU 11000000B MASK FOR SEND RATE BITS 0000 0001 0002 0007 ;---------- MEDIA/DRIVE STATE INDICATORS COMPATIBILITY ------------------------M3D3U EQU OOOOOOOOB 360 MED I AlOR I VE NOT ESTAeLi SHED M3D1U EQU OOOOOOOIB 360 MEDIA,I.2DRIVE NOT ESTABLISHED MIOIU EQU OOOOOOIOB 1.2 MEDIA/DRIVE NOT ESTABLISHED MED_UNK EQU 00000 t I IB NONE OF THE ABOVE ·· ··· · ·· ATTACHMENT FAILED TO RESPOND SEEK OPERATION FAILED DISKETTE CONTROLLER HAS FAILED BAD CRC ON 0 I SKETTE READ ATTEMPT TO DMA ACROSS 6 ... K BOUNDARY DMA OVERRUN ON OPERATION MEO I A REMOVED ON DUAL ATT ACH CARD REQUESTED SECTOR NOT FOUND WRITE ATTEMPTED ON WRITE PROTECT DISK ADDRESS MARK NOT FOUND BAD COMMAND PASSED TO DISKETTE 110 TEST1 5-33 IBM Personal Computer MACRO Assembler Version 2.00 TEST I ---- 06/ to/85 POWER ON SELF TEST (POST) POSTEQU. INC - COMMON EQUATES 594 595 596 597 59. 599 600 601 602 603 604 605 606 607 60. 609 610 611 612 613 614 615 616 617 61. 619 620 621 622 623 624 625 626 627 62. 629 630 631 632 633 63. 635 636 637 63. 639 640 641 642 643 644 C C C C C C C C C C C C C C C C C C C C C C C C C C 0020 0020 0021 OOAO OOA I 0070 0010 0008 0000 0000 OOCO 0040 0080 0001 0002 0004 0008 00 I a 0020 0040 0080 c C C C C C C 0081 DDaF PAGE ~~7-------- I NTE~~~PT EQ~~6~S ------------~~~- ~~-7~~~~~~~~-~~~~~~;-~~-~~~~-----I NT AOO I NT AD I INT800 INT801 INT TYPE INT:=VIOEO 6~~ ~~ 020H 021 H OAOH OAIH 070H 010H 8259 PORT 8259 PORT 2ND 8259 ; START OF 8259 VIDEO VECTOR OOOH ODOH OCOH ; ; ; DMA CH.O ADDRESS REGISTER PORT ADDRESS 2ND DMA STATUS PORT ADDRESS 2ND DMA CH. 0 ADDRESS REG I STER ADDRESS INTERRUPT TABLE LOCATION -----------~~~ -----~~~~ ------------~ -~~; -;~ ~ ~~; -~~; ~;;~~ -;;~~ -~~~~~;; ------ DMA DMAI8 DMA 1 i EQU EQU EQU EQU EQU EQU ~ ~~~ --------- EQU EQU EQU --~~C- ----~~~~ ------------~ -~ ~~~ -~ ~ ~~~ -=- ~~;~ - ~~~~~;; ------ ------- ; --------- MANUFACTUR I NG PORT ------------------------------------- ------------MFG PORT EQU 80H ; MANUFACTURING AND POST CHECKPOINT PORT ; DMA CHANNEL 0 PAGE REG [STER ADDRESS ;--------- MANUFACTURING BIT DEFINITION FOR IiIIMFG ERR FLAG+l -------------------MEM FAIL EQU 000000018 STORAGE TEST FAILED (ERROR 20X) PRO-FAIL EQU 000000106 VIRTUAL MODE TEST FAILED (ERROR 104) LMCS FAIL EQU OOOOOIOOB LOW MEG CHIP SELECT FAILED (ERROR 109) KYCLK FAIL EQU OOOOIOOOB KEYBOARD CLOCK TEST FAILED (ERROR 304) KY SYS FAIL EQU 000 I OOOOB KEYBOARD OR SYSTEM FAILED (ERROR 3031 KYBo FAIL EQU OOIOOOOOB KEYBOARD FAILED (ERROR 301) OSK FAIL EQU OIOOOOOOB DISKETTE TEST FAILED (ERROR 601) KEY:=FAIL EQU 10000000B KEYBOARD LOCKED (ERROR 302) c C C C C C C C C C C C C C C C OOFO 0000 8000 0000 OOOA 0008 0001 o t 00 0101 5-34 1-7 06-10-85 EQU POST=SP ~~ EQU 08000H - - - - - - - - --- - - - ~~~ - -- - - ~ ~ ~;~ - - - - - - - - - -- LF RVRT RHRZ H X .LIST TEST 1 OFOH ; MATH COPROCESSOR CONTROL PORT ~;;~-;;---------~~c-----~~~~~~----------~-~~;~-;;~~;-;~~~~~~-------------------- EQU EQU EQU EQU EQU OOOAH 00001 OOOB 000000018 256 H+ 1 ; POST STACK POINTER CARR I AGE RETURN CHARACTER LINE FEED CHARACTER V IDEO VERT I CAL RETRACE BIT VIDEO HORIZONTAL RETRACE BIT HIGH BYTE FACTOR (X 100H) HIGH AND LOW BYTE FACTOR (X 101H) IBM Per50nill Computer MACRO A5sembler Version 2.00 1-8 TESTI ---- 06/10/85 POWER ON SELF TEST jPDST) 06-10-85 SYSOATA.INC - DESCRIPTOR EQUATES 645 646 641 648 649 650 651 652 653 654 655 656 651 658 659 660 661 662 663 664 665 666 661 668 669 610 611 612 613 614 615 616 6TT 618 619 680 681 682 683 684 685 686 681 688 689 690 691 692 693 694 695 696 691 698 699 100 101 102 103 104 105 106 101 108 109 110 111 112 113 114 115 116 111 118 119 120 121 122 123 124 125 126 121 128 129 130 131 132 133 134 135 136 131 138 139 140 141 142 PAGE INCLUDE SYSDATA.INC ; - - -- - - - - - - - - - - - --- - -- - - - -- - - - - - - - - - - --- -- -- - - - - - - - - - - - - - - - - -- - - - - -- - - - - - - - - --; PROTECTED MODE EQUATES FOR POST TESTS AND BIOS ROUTINES - ; - - - - - - -- - - - - --- - - - - - ---- - - - --- -- -- --- - - - -- - - - - - -- - - - - - - - - - --- -- - -- - --- - - - --- --LENGTH EQUATES FOR PROTECTED MODE TESTS 0 0 0 0 0 0 0 0 0300 0800 0088 0008 1000 4000 FFFF FFFF 0000 SDA LEN SYS-IOT LEN GDT-LENDESC LEN MCRT-S I ZE CCRT-S I ZE ECCRT SIZE MAX SEG LEN NULL_ SEG_LEN EOU EOU EOU EOU EOU EOU EOU EOU EOU 00300H 256-B TYPE GOT OEF TYPE DATA DESC 4-1024 16-1024 OFFFFH OFFFFH OOOOOH SYSTEM DATA AREA LENGTH 256 SYSTEM lOT ENTRIES, 8 BYTES EACH GOT STRUCTURE LENGTH LENGTH OF A DESCR I PTOR MONOCHROME CRT SIZE COMPATIBLE COLOR CRT SIZE SIZE OF EACH PORT I ON OF THE ENHANCED MAX I MUM SEGMENT LENGTH b4K NULL SEGMENT LENGTH = 0 = LOCATION EQUATES FOR PROTECTED MODE TESTS 0 0 0 0 0 0 0 0 0 0 0 0 DOAO 0400 D8AO 0000 OOOB BOOO OOOB 0000 OOOA 0000 OOOB 0000 OOOF 0000 0000 SYS lOT LOC SDA-LOCGOT-LaC MCRTO LO MCRTO-HI CCRTO-LO CCRTO-H I ECCRTQ) La LO ECCRTO-LO-H I ECCRTO-HI-LO ECCRTO-HI-HI CSEGOlI [0 CSEG.-HI NSEGP-LO NSEGP=HI ;----- EOU EOU EOU EOU EOU EOU EOU EOU EOU EOU EOU EOU EOU EOU EOU ; THE SYSTEM lOT IS AT THE BOTTOM ODOAOH 00400H ; SAME AS REAL (SYS lOT LaC + SYS lOT LEN) OOOOH MONOCHROME CRT ADDRESS (OBOOOOH) OBH BOOOH COMPATIBLE COLOR CRT ADDRESS (OB8000H) OBH OOOOH (OAOOOOH) OAH OOOOH (OBOOOOH) OBH CODE SEGMENT POST I B I OS OOOOH ; (OFQOOOH) FOR TESTS OFH OOOOH ; ABSO OOH DEFINITIONS FOR ACCESS RIGHTS BYTES 00F3 CPL3 DATA ACCESS EOU 11110011B 0 0093 009B 00E2 OOB I 0086 0081 CPLO DATA ACCESS CPLO-CODE- ACCESS LOT OESC FREE TSS I NT GATE TRAP_GATE EOU EOU EOU EOU EOU EOU 10010011B 1001101lB 11100010B 10000001B 10000110B 10000111B 0 000 I VIRTUAL_ENABLE EOU 000000000000000 I B 0 0 0 0 0 - ;----- ;----- '? 0000 0002 0004 0005 0006 OOOB ?' ?? ?? ?? ?' DO DO DO DO DO DO DO DO DO DO DO DO DO DO DO DO DO UNUSED ENTRY THIS ENTRY POINTS TO THIS TABLE POST INTERRUPT DESCRIPTOR TABLE THE REAL SYSTEM DATA AREA FOR POST CaMPA TI BLE BW CRT FOR POST COMPATIBLE COLOR CRT FOR POST ENHANCED COLOR GRAPH I CS CRT (1 b BYTES) CS - POST lOT, ROM RESIDENT DYNAMIC POINTER FOR ES DYNAMIC POINTER FOR CS DYNAMIC POINTER FOR SS DYNAMIC POINTER FOR os TR VALUE FOR THIS MACHINE'S TSS LOTR VALUE FOR TH I S MACH I NE • SLOT ENDS SEGMENT DESCRIPTOR TABLE ENTRY STRUCTURE DATA DESC SEG LIMIT BASE LO WORD BASE-HI-BYTE OATA-ACC RI(;HTS DATA-RESERVED DATA=DESC ;----- PROTECTED MODE ENABLE STRUC GOT PTR SYS-IOT PTR RSDA PTR C BWCRT PTR C-CCRT PTR E-CCRT-PTR E-CCRT-PTR2 SYS ROM CS ES TEMPCS-TEMP SS-TEMP OS-TEMP POST TR POST-TSS PTR POST-LOTR POST-LOT PTR GDT_DEF - 0000 0002 0004 0005 0006 OOOB ; THE GLOBAL DESCRIPTOR TABLE DEFINITION FOR POWER ON SELF TESTS GDT_OEF 0000 OOOB 00 I 0 0018 0020 002B 0030 0038 0040 004B 0050 0058 0060 0068 0010 001B OOBO OOBB PRESENT DPL 3 CODE/DATA SEGMENT NOT EXECUTABLE GROW-UP (OFFSET <0 LIMIT) WRITABLE ACCESSED DPL 0 ePL 0 - NON-CONFORM I NG STRUC OW OW DB DB OW ENDS SEGMENT LI MIT (I - b5535 BYTES) 24 BIT SE(;MENT PHYS I CAL ADDRESS {O - (16M- 1 ) ) ACCESS RIGHTS BYTE RESERVED - MUST BE 0000 FOR THE 802B6 GATE DESCRIPTOR TABLE ENTRY STRUCTURE (;ATE DESC ENTRY POINT CS_SELECTOR WORD COUNT GATE-ACC RIGHTS GATE-RESERVED GATE=DESC STRUC OW OW DB DB OW ENOS DESTINATION ROUTINE ENTRY POINT SELECTOR FOR DESTINATION SEGMENT NUMBER OF WOROS TO COPY FROM STACK ACCESS RIGHTS BYTE RESERVED - MUST BE 0000 FOR THE B02B6 ,LIST TESTl 5-35 113M Perso"al Computer M~CRQ Assembler TESTI ---- 06'10/8~ POWER ON SELF TEST 743 744 745 746 7.7 7'8 749 750 751 752 753 75. 755 756 757 758 759 760 761 762 763 76' 765 766 767 768 769 770 771 772 773 77. 775 776 777 118 719 780 78 r 782 763 764 785 766 767 788 789 790 791 792 793 194 795 796 797 198 799 800 801 802 803 80. 805 806 807 808 809 810 811 812 813 81. 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 83. 835 836 837 836 639 840 64,1 842 843 844 645 8.6 847 848 849 850 851 852 853 654 855 856 PAGE CODE 0000 0000 = 0000 0000 36 30 20 4F 39 36 34 43 49 52 36 35 38 4F 42 50 31 20 0022 36 30 30 4F 2E 42 31 35 004E 20 36 30 31 4F 2E 42 31 35 20 34 34 38 38 30 30 39 39 20 20 43 43 50 50 52 52 20 20 49 49 40 40 20 20 39393838 30 50 40 2E 2C 20 30 52 20 20 31 1-' VerSio" 2.00 (POST) 06-10-85 SEGMENT WORD PUBL I C PUBLIC PUBLIC PUBLIC PUBLIC C8042 OBF" 42 POST 1 START_I EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN CMOS READ I NEAR CMQS-WR I TE :NEAR eONFT G BAD: NEAR Dr! ;NEAR ODS;NEAR DUMMY RETURN: NEAR ERR BEEP: NEAR GATE A20:NEAR KBO RESET I NEAR NM'-'NT:Ni::AR POST2:NEAR PR I NT SCREEN: NEAR PRoe SHUTDOWN: NEAR ROM CHECK: NEAR SHUT21NEAR SHUT3 :NEAR SHUT4:NEAR SHUT6:NEAR SHUTT :NEAR SHUT9;NEAR SLAVE VECTOR TABLE:NEAR STGTST CNT: NEAR SYSINITI :NEAR VECTOR TABLE:NEAR VIOEOJS'ARMSIB'fTE ASSUME CS: CODE, OS: NOTH I NG, ES: NOTH I NG, SS: NOTH I NG POST I PROC NEAR BEGIN EQU DB • 39 2E 43 31 39 '6480090COPR. I BM CORP. 1981, 1985 ' ;COPYRIGHT NOTICE EVEN ; 6B ; ; ; I I ; 76 7A 9F 02 72 DO 70 74 - ------- - - - -- - - - -- - - - -- - - - - - - - ---- - - - - -TEST.OI 80286 PROCESSOR TEST (REAL MODE) DESCR I PTI ON VER I FY FLAGS, REG I STERS AND CONDITIONAL .JUMPS. : : - - - --- - - --- ------------------- - - - -- -- --- 0580 10 DS:DATA SHL 00 OZ AH,CL ERR02 AH,l ERR02 C7A o I SABLE INTERRUPTS FLAG MASK IN (AH) AND NMI MASK IN (ALl 01 SA8LE NM I INTERRUPTS SET "SF" ~ZF" "AF" "PF" "CF" FLAGS ON GO TO ERROR ROUTINE IF "CF" NOT SET GO TO ERROR ROUTINE IF "ZF" NOT SET GO TO ERROR ROUTINE IF "PF" NOT SET GO TO ERROR ROUTINE IF "SF" NOT SET LOAD FLAG IMAGE TO (AH) LOAD COUNT REG I STER WITH SH I FT COUNT SH I FT "AF" I NTO CARRY 81 T PQS I TI ON GO TO ERROR ROUTINE IF "AF" NOT SET SET THE "OF" FLAG ON SETUP FOR TES T I NG GO TO ERROR ROUT I NE IF" OF" NOT SET SET (AH) = 0 CLEAR "SF". "CF", "ZF", AND "PF" GO TO ERROR ROUTINE IF "CF" ON GO TO ERROR ROUTINE IF "ZF" ON GO TO ERROR ROUTINE IF "SF" ON GO TO ERROR ROUTINE IF "PF" ON LOAD FLAG IMAGE TO (AH) SH I FT .. AF" I NTO CARRY BIT pas I TI ON GO TO ERROR ROUT I NE I F ON CHECK THA T ~ OF" I S CLEAR GO TO ERROR ROUT I NE I F ON CONT I NUE CONF IDENCE TESTS IF" ZF" SET HLT JMP ERR02 ERROR HALT ERROR LOOP TRAP MOV MOV AX,OATA DS,AX SET DATA SEGMENT 1NTO THE (OS) SEGMENT REG I STER MOV DUT SAHF oNC oNZ oNP oNS LAHF 27 25 23 21 as AX.OD500H+CMOS REG O+NM I CMOS_PORT, AL ERR02 ERR02 ERR02 ERR02 XDR CL,5 AH,CL ERR02 AL.40H AL,I ERR02 AH,AH OF SAHF JBE ERR02 00 08 OP MDV EC rA 40 EO 14 E4 SHR JNC MDV SHL oND oS ERR02 ERR02 LAHF EC 06 E4 02 03 SHR OC ERRP2: F4 EB FO C7A: ;----- 5-36 ; EVEN BOUNDARY ; EVEN MODULE ;000 MODULE ;COPYRIGHT NOTICE (POST!) CLI 0083 0083 88 ---- R 0086 8E 08 0088 008A 008C 0?8E ! 9 8 5 ! 9 8 5 11998855' ;PAD INITIAL RELIABILITY TESTS -- START_I: FA 88 E6 9E 73 75 78 79 9F BI 02 73 BO DO 71 32 9E 76 IBM IBM IIBBMM - - - -- -- - - --- - ---- - ---- - ----- - ------ -- - ---- - ----- ASSUME 0071 0073 0075 0076 0078 007A 007C 007E 0080 0060 0081 COP R • COP R • CCOOPPRR •• DB ; 0050 0050 0051 0054 0056 0057 0059 0058 0050 005F 0060 0062 0064 0066 0068 006A 006C 006E 006F 6480090 6480091 '66448800009901 E4 A8 15 E9 64 04 03 0123 R TESTl CHECK FOR PROCESSOR SHUTDOWN IN TEST oNZ oMP AL,STATUS PORT AL,SYS FLAG C78 SHUTO READ CURRENT KEYBOARD PROCESSOR STATUS CHECK FOR SHUTDOWN I N PROCESS FLAG GO IF YES ELSE CONT I NUE NORMAL POWER ON CODE IBM Personal Computer MACRO Assembler TEST I ---- 06/10/85 POWER ON SELF TEST 851 858 859 8bO 861 862 863 864 865 866 861 868 86' 870 871 1-10 06-10-85 Version 2.00 (POST) PAGE 0091 0091 0093 0095 0097 0099 009B 0090 6~~~-BO Eb EB E4 3C 86 74 8F 70 00 71 09 C4 41 CHECK FOR SHUTDOWN 09 AL.CMOS SHUT OOWN+NMI CMOS PORT. AL1+2 AL.CMOS DATA AL,09H AL.AH "OV OUT J"P IN C"P XCHG JE ; ----- C1C CMOS ADDRESS FOR SHUTDOWN BYTE I/O DELAY GET REQUEST NUMBER WAS IT SHUTDOWN REQUEST 97 SAVE THE SHUTDOWN REQUEST BYPASS INITIALIZING INTERRUPT CHIPS CHECK FOR SHUTDOWN OA 009F 80 FC OA 00A2 74 3C C"P JE AH,OAH C1C WAS I T SHUTDOWN REQUEST A? BYPASS INITIALIZING INTERRUPT CHIPS 00A4 2A CO 00A6 E6 FI SUB OUT AL.AL X287+ I. AL INSURE MATH PROCESSOR RESET 812 873 874 815 816 811 818 879 880 881 882 883 884 885 88b 887 888 889 890 691 892 8.3 8 •• 8'5 896 897 898 899 900 90 I 902 903 904 905 906 907 908 909 .10 RE-INITIALIZE THE 6259 ; 00A8 OOAA OOAC OOAE OOBO 00B2 00B4 00B6 00B8 OOBA OOBC OOBE OOCO 00C2 BO E6 EB BO E6 EB BO Eb EB BO Eb EB BO Eb II 20 00 08 21 00 04 21 00 0I 21 00 FF 21 00C4 00C6 OOC8 OOCA OOCC OOCE 0000 0002 0004 0006 0008 OODA OODC OODE BO E6 ES SO E6 BO E8 E6 E8 80 E6 E8 BO E6 I I AO 00 70 AI 02 00 AI 00 0I AI 00 FF AI OUT "2 J"P "OV '.2 OUT '.2 '.2 J"P "OV -- - - - --- - - --- -- - -- - - - - -- - - - - - - - - - - - - - - - - --- - - -- - - - - - - ---RE-INITIALIZE THE 8259 OUT '.2 '.2 '.2 '.2 J"P "OV AL,INT TYPE INTBOI-;-AL AL,02H OUT "OV J"P AL,OIH INT80l,AL OUT J"P "OV - EDGE, : SLAVE ICW4 WAIT STATE FOR 110 SETUP [CW2 - INTERRUPT TYPE 70 SETUP I CW3 - SLAVE LEVEL 2 1/0 DELAY SETUP ICW4 - 8086 MODE, (l0-7F1 AL.OFFH INTBOI,AL OUT SLAVE WAIT STATE FOR I/O MASK ALL I NTERRUPTS OFF SHUTDOWN - RESTART RETURN CONTROL AFTER A SHUTDOWN COMMAND I S ISSUED DESCR I PT I ON A TEST IS MADE FOR THE SYSTEM FLAG BEING SET. IF THE SYSTEM FLAG IS SET, THE SHUTDOWN BYTE I N CMOS I S USED TO DETERM I NE WHERE CONTROL IS RETURNED • CMOS CMOS CMOS CMOS CMOS CMOS CMOS CMOS CMOS CMOS CMOS .2..22 .23 '25 .26 '21 .28 92. =0 = = 1 2 = = 4 5 = = 8 9 SOFT RESET OR UNEXPECTED SHUTDOWN SHUT DOWN AFTER MEMORY SIZE SHUT DOWN AFTER MEMORY TEST SHUT DOWN WITH MEMORY ERROR SHUT DOWN WITH BOOT LOADER REQUEST JMP DWORD REQUEST - (INTERRUPT CHIPS & 287 ARE INITIALIZED) PROTECTED MODE TEST3 PASSED PROTECTED MODE TEST3 FAILED PROTECTED MODE TEST! FAILED BLOCK MOVE SHUTDOWN REQUEST JMP DWORD REQUEST - (W/O INTERRUPT CHIPS INITIALIZED) =3 =6 =7 =A NOTES: • 30 .31 .32 '33 .3. 935 960 961 962 963 964 965 966 967 968 969 970 ICWI INT80l,AL OUT J"P "OV '" .5. INTERRUPT #2 CONTROLLER CHIP AL,IIH INT800,AL "OV 912 913 91. 915 916 • 11 918 91' .20 .21 • 36 .31 .38 939 940 941 942 943 944 945 946 947 948 949 950 951 .52 .53 95. 955 956 957 958 (8-F) WAIT STATE FOR 1/0 MASK ALL INTERRUPTS OFF (V IDEO ROUT I NE ENABLES INTERRUPTS) AL,OFFH INTAOI,AL OUT I CW4 I/O WAIT STATE SETUP I CW4 - MASTER, 8086 MODE AL,OIH INTAO\ ,AL OUT EDGE, MASTER, WAIT STATE FOR I/O SETUP I CW3 - MASTER LEVEL 2 AL.04H INTAOI,AL J"P "OV - WAIT STATE FOR I/O SETUP I CW2 - I NTERRUPT TYPE 8H AL.08H INTAO\ ,AL OUT J"P "OV ; CONTROLLER CHIP; I CW I AL,IIH INTAOO,AL "OV ; INTERRUPT " -- -- - - - - - - - - - -- - - - --- - - --- -- ---- - -- - --- -- - -- - - ---- - - - - -- RETURNS ARE MADE WITH I NTERRUPTS AND NM I DISABLED • USER MUST RESTORE SS;SP (POST DEFAULT SET 0000:0400), ENABLE NON-MASK ABLE INTERRUPTS (NM I) WITH AN OUT TO PORT 70H WITH HIGH ORDER BIT OFF, AND THEN ISSUE A ST I TO ENABLE INTERRUPTS. FOR SHUTDOWN (5) THE USER MUST ALSO RESTORE THE INTERRUPT MASK REGISTERS • = CHECK FROM WHERE ODED ODED 00E2 OOE4 ODES 00E7 OOE9 OOEB OOED OOEF OOF2 00F4 00F6 80 8F Eb 70 90 2A CO E6 71 86 EO 3C OA 77 34 BE 0103 R 03 FO 03 FO 2E: 8B IC "OV AL, CMOS SHUT DOWN+NM I CMOS_PORT, AL- C"P JA "OV AL,AL CMOS OATA,AL AH,AL AL,OAH SHUTO S I ,OFFSET BRANCH SI,AX SI,AX BX,CS: [SI] OUT Nap SUB OUT XCHG AOO AOO "OV CLEAR CMOS BYTE I/O DELAY SET 8YTE TO a COMPARE WITH MAX I MUM TABLE ENTR [ES SKIP TO POST IF GREATER THAN MAXIMUM POINT TO THE START OF THE BRANCH TABLE POINT TO BRANCH ADDRESS MOVE BRANCH TO ADDRESS TO BX REGISTER SET TEMPORARY STACK FOR POST 00F9 OOFC OOFE 0101 B8 8E BC FF ---- R 00 0400 R E3 0103 a I 05 0107 0 I 09 OIOB 0100 a I OF alii 0113 0 I IS 0117 0123 0990 0000 0000 0000 0119 0000 0000 0793 0000 OIIF R R E E E R E E R E R BRANCH: "OV "OV "OV J"P AX, ABSO SS,AX SP, OFFSET <><><><><><><> <> <><><> <><> CHECKPO I NT 0 I <><> AL,OIH MFG_PORT. AL READ/WRITE/TEST THE 80286 REGISTERS WITH ONE'S AND ZERO'S "OV 51C JNC AX ,OFFFFH SETUP ONE'S PATTERN IN SET CARRY FLAG GO IF NO CARRY ERROl (AX) C8: C9: "OV MOV "OV "OV "OV "OV "OV "OV "OV "OV JNC XOR JNZ CLC J"P DS,AX BX,DS ES,BX CX,ES SS,CX DX,SS SP,DX BP,SP SI,BP 01,51 OR JZ AX,DI CIOA WRITE PATTERN TO ALL REGISTERS C9 AX,DI ERROl PATTERN MAKE IT THROUGH ALL REGISTERS NO - GO TO ERROR ROUT I NE CLEAR CARRY FLAG c. TSTIA ZERO PATTERN MAKE IT THROUGH? YES - GO TO NEXT TEST ERROl: HLT HALT SYSTEM INSURE THAT CMOS CLOCK "OV OUT Nap IN AND XCHG ;----- , : ; ; ~ AL,CMOS DATA AL,OOOOOI11B AL,AH XCHG ~~~!RPORT • AL CMOS_DATA.AL "OV Nap OUT Nap IN CMOS_PORT .AL AL ,CMOS_REG_C+NMI AL,CMOS_oATA ADDRESS TO BOTH (AH) AND (AL) ADDRESS CMOS ALARM BYTE WITH NM I =OFF I/O DELAY GET THE CURRENT CONTROL RECiISTER CLEAR SET,PIE,AIE, AND SQWE BITS SAVE IT ADDRESS CMOS FLAGS BYTE WITH NM I =OFF I/O DELAY I/O DELAY READ STATUS TO CLEAR PENDING INTERRUPT RESET VIDEO "OV "OV OUT INC "OV OUT "OV IN "OV IN "OY "OV OUT "OV OUT ; AX,X· (CMOS REG B+NMI CMOS_PORT ,AL - OUT OUT INTERRUPTS ARE DISABLED AL,O OX.03D8H DX,AL AL DL,088H DX,AL DL,OBAH AL.DX DL,ODAH AL,DX AL,O DL,OCOH DX,AL AL,111I11008 PORT_B,AL CLEAR OAT A BYTE TO 0 I SABLE V IDEO GET COLOR MODE CONTROL PORT ADDRESS o I SABLE COLOR V IDEO MONOCHROME MODE RESET MASK GET ADDRESS OF MONOCHROME MODE CONTROL DISABLE B/W VIDEO, ENABLE HIGH RES ADDRESS OF MONOCHROME STATUS REGISTER READ STATUS TO DISABLE ECiA VIDEO ADDRESS OF COLOR MODE STATUS REGISTER READ STATUS TO DISABLE EGA VIDEO SELECT ATTR I BUTE PALETTE REG I STER 0 WR I TE 0 TO ATTR I BUTE ADDRESS REG I STER TO DI SABLE EGA VIDEO o I SABLE PAR I TY CHECKERS - - --- - - ---- ------- ------------------- - -TEST. 02 ROM CHECKSUM TEST I DESCRIPTION A CHECKSUM 1 S DONE FOR THE :32K READ ONLY MEMORY MODULES (TWO) : CONTAINING POST, BASIC AND BIOS.I --- - ---- ---- ---- - ---- --- ---- - - - - - - - -- - -- :----- CI I; CHECKPOINT 02 "OV OUT AL.02H MFG_PORT, AL ASSUME SS:CODE AX,CS SS,AX oS,AX SI,SI BX.BX CH,080H "OV MOV "OV XOR XOR "OV LODSW ADD ADD BL,AH BL,AL LOOP CII JNC CIIE JZ CIIA <> <> <> <><><><><><><><><> <><> CHECKPOINT 02 <><> SETUP SS SEGMENT REG I STER SET UP DATA SEGMENT TO POINT TO ROM ADDRESS START CLEAR CHECK REG I STER COUNT FOR 32K WORDS MOVE TWO BYTES INTO AX -- 51=51+2 ADO ODD BYTE AT DS:SI+I TO CHECKSUM ADD EVEN BYTE AT OS: S I TO CHECKSUM LOOP COUNT FOR 65K BYTES (32K WORDS) EXIT IF ~LOOP~ RESET THE CARRY FLAG (NOTE: MODEL BYTE MUST NOT = ZERO) CONTINUE IF CHECKSUM VALID (ZERO) CI1E: HLT TEST.03 VER I FY CMOS SHUTDOWN 8YTE ELSE HALT IF CHECKSUM PROBLEM IBM Personal Computer MACRO Assembler TEST! ---- 06/ I 0/85 POWER ON SELF TEST 1085 108b 1087 1088 1089 1090 1091 019F 1092 019F 80 1093 0 I A I E6 1094 1095 0 I A3 89 1096 OIAb 84 1097 0lA6 1098 0lA8 80 1099 OIAA E6 1100 OIAC 8A 1101 OIAE E6 I 102 0180 80 1103 0182 90 1 104 0183 Eb I 105 0185 90 1106 018b E4 11010188 3A 1105 018A 15 1109 018C 00 I I 10 018E E2 1111 I I 12 1113 I I 14 IllS I I 16 1117 I 118 1119 1120 OICO 88 \ 121 0lC3 8E I \ 22 01 C5 80 1123 0lC1 E6 1124 1 125 1126 I 121 01 C9 E6 1128 01Ca Eb 1129 1\30 1131 1132 OICO 88 1133 0101 80 1134 0103 E6 1135 0105 EB 1136 0101 8A 1137 0109 E6 1138 olDe 81 1139 0100 1140 0100 eo 1141 01DF Ee 1142 OIEI E6 1143 0lE3 50 1144 01E6 14 1145 0lE6 E4 1146 OlEA OA 1141 DIEC E2 1148 OIEE FE 1\49 OIFO 15 11500lF2F4 1151 1152 1153 1154 1155 1156 1151 1158 1159 1160 1161 l1b2 01F'3 80 1163 01F'5 E6 1164 IIb5 OIFT 6A IIb6 0lF9 28 1161 OIFB E6 1168 OIF'D 81 IIb9 01FF 1110 01FF BO 1 11\ 0201 E6 1112 0203 E8 11130205 E8 11740201 E4 1115 0209 22 111b 0208 14 I 111 0200 E2 1118 020F FE 1179021175 1180 0213 F4 118[ 1182 1183 1184 1185 118b 1187 1188 1189 1190 119( 1192 1193 1194 [19502[4 1196 0214 88 11970211 8E 1198 0219 80 1-12 06-\ 0-85 Version 2.00 (POST) ; DESCRIPTION ROLLING BIT WRITTEN AND VERIFIED AT SHUTDOWN ADDRESS. VER I FY AND CLEAR SHUTDOWN FLAG 03 80 0009 01 <><> <> <> <><><><><><> <><> <><> CHECKPO I NT 03 <><> "OV OUT "L,03H MFG_PORT ,AL "OV "OV CX,09H AH,I "OV OUT "OV OUT "OV Nap OUT Nap IN CMP JNZ RCL LOOP AL, CMOS_SHUT _DOWN+NM I CMOS _PORT ,AL AL,AH CMOS_DATA,AL AL, CMOS_SHUT _OOWN+NM I LOOP COUNT START WITH BIT 0 C\ lB: 8F 70 C4 71 8F 70 71 C4 92 04 E8 ; ; ; ; ; I CMOS_PORT ,AL 110 DELAY AL,CMOS_DATA AL,AH ERROl AH,I CllB MUST BE THE SAME ERROR IF NOT ROLL A a IT THROUGH SHUTDOWN BYTE LOOP TILL DONE -- -- - --- - - - - -------- - - - - -- -- -- - -- - - -- - -TEST. 04 8254 CHECK TIMER DESCRIPTION SET T I MER COUNT CHECK THAT TIMER 1 ALL BITS ON : : : 81TS ON : -- -- --- - - - - - - -- -- --- - -- - -1 - -ALL - - - - -- -- - - - -ASSUME MOV MOV MOV OUT ---- R 08 04 80 :----- DS:DATA AX,DATA DS,AX AL.,04H MFG _PORT, AL SET DATA SEGMENT <><><><><><><><><><><><> <><> CHECKPOINT 04 <><> DISABLE DMA CONTROL.LER 08 DO OUT OUT lb 0012 R 54 43 00 Cl 41 05 MOV "OV OUT JMP "OV OUT MOV (AU ALREADY = 04H 01 SA8L.E OMA CONTROLL.ER I o I SABLE OMA CONTROL.LER 2 DMA05,AL DMAI8,AL VERIFY THAT TIMER I ox ,IltRESET FUNCTIONS OK SAVE RESET FLAG WHILE REFRESH SEL.ECT TIMER I,LSB,MODE 2 FL.AG AL.,54H TIMER+3,AL "OV JMP OUT CMP JE IN OR L.OOP OEC JNZ HLT $'2 AL.,CL. T1MER+I,AL BH,05H LOOP COUNT TIMERI BITS ON L.ATCH TIMER-I COUNT 110 DELAY AL.,40H $'2 TIMER+3,AL. 8L,OFFH CI3 AL,T1MER+I 8L.,AL. CO2 BH CO2 YES - SEE IF ALL 81TS GO OFF TIMER I BITS OFF READ TIMER T COUNT ALL BITS ON IN TIMER TIMERI_8ITS_ON - - --- - - -- -- ---- - -- - - - --- - ----------: ; TEST .05 : - ---- ; 05 80 8254 CHECK TIMER DESCR I PTI ON SET TIMER COUNT CHECK THAT TIMER ----- C13: C3 C9 41 05 I ALL. 8IT OFF I : AL.L. BITS OFF: TRY AGAIN TIMER I fAILURE, T I MER 1_81 TS_OFF HAL.T SYSTEM : CHECKPO I NT 05 MOV OUT AL,05H MFG_PORT, AL "OV SUB OUT MOV AL.8L. CX,CX TlMER+ I,AL. BH,05H MOV OUT JMP JMP IN ANa JZ LOOP OEC JNZ HLT AL,40H TIMER+3,AL <><><><><><><><><><><> <> <><> CHECKPO I NT 05 <><> SET T [MER I COUNT SET TRY AGA I N COUNT TIMER LOOP LATCH-T I MER I COUNT C14: 40 43 00 00 41 08 01 FO CF EC IS OFF 110 DELAY SET I N I TI AL TI MER COUNT TO 0 C12: 40 00 43 FB FF 08 41 08 EF CF E8 I ; OUTPUT ROLLING 81T READ CMOS I/O DELAY DEL.A Y FOR T I MER ADDED DELAY FOR T I MER READ TIMER I COUNT $'2 $'2 AL,TIMER+I BL,AL CIS CI. BH CI. GO TO WRAP DMA REGISTER TESTS TIMER_LOOP HALT SYSTEM ;---------------------- ----------------TEST.Ob 8231 oMA 0 INITIALIZATION CHANNEL REG I STER TEST ~SCR[~I~ : THE 8237 OMA CONTROL.LER.: WRITE/READ THE CURRENT ADDRESS : AND WORD COUNT REG I STERS FOR ALL CHANNEL.S. o I SABLE ; ; ----;----- -- --- - -- - - - - - - ---- - - - --- - ---------CHECKPOINT 06 C15: ---- R 08 06 MOV "OV MOV AX,OATA DS,AX AL,ObH ; SET DATA SEGMENT TESTl 5-39 IBM Personal Comp .... ter MACRO Assembler TEST 1 ---- 06/10/85 POWER ON SELF TEST 1199 0218 E6 80 1200021089 16 0072 R 120 I 0221 E6 00 1202 1203 1204 1205 0223 80 FF 1206 0225 8A 08 f 207 0227 8A F8 1208 0229 89 0008 1209 022C 8A 0000 1210 022F EE 12110230E800 1212 0232 EE 1213 0233 BO 01 1214 0235 EB 00 1215 0237 EC 1216 0238 EB 00 1217 023A 8A EO 1218 023C EC 1219 0230 38 08 1220 023F 74 01 1221 0241 F4 1222 0242 1223 0242 42 1224 0243 E2 EA 1225 0245 FE CO 1226 0247 74 DC 1227 1228 1229 1230 0249 80 F8 55 1231 024C 74 09 1232 024E 80 F8 AA f 233 0251 74 08 1234 0253 80 55 1235 0255 E8 CE 1236 f 237 1238 1239 0257 80 AA 1240 0259 E8 CA 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 0258 80 07 1256 0250 E6 80 1257 025F E6 DA 1258 1259 1260 1261 0261 BO FF 1262 0263 8A 08 1263 0265 8A F8 1264 0267 B9 0008 1265 026A BA OOCO 1266 0260 EE 1267 026E E8 00 1268 0270 EE 12690271 80 01 1270 0273 E8 00 1271 0275 EC 1272 0276 E8 00 1273 0278 8A EO 1274 027A EC 1275 0278 38 08 1276 0270 74 01 1277 027F F4 1278 0280 1279 0280 83 C2 02 1280 0283 E2 E8 1281 0285 FE CO 1282 0287 74 DA 1283 1284 1285 1286 0289 80 F8 55 1287 028C 74 09 1288 028E 80 F8 AA 12890291 7408 1290 0293 80 55 1291 0295 E8 CC 1292 1293 1294 1295 0297 80 AA 1296 0299 Ea C8 1297 1298 1299 1300 0298 1301 029888 IE 0072 R 1302 029F A3 0010 R 1303 02A2 BO 12 1304 02A4 E6 41 1305 1306 1307 1308 02A6 2A CO '309 02A8 E6 08 310 1311 1312 02AA E6 00 5-40 TESTl Version 2.00 (POST) 1-13 06- 10-85 ; OUT MDY DUT ;----C161 C17: ; ; <><> CHECKPO I NT 06 <><> RESTORE SOFT RESET FLAG SEND MASTER CLEAR TO DMA WRAP DMA 0 CHANNEL ADDRESS AND COUNT REGISTERS MDY MDY MDY MDY MDY DUT "MP DUT MOY "MP IN "MP MOY IN CMP "E HLT Al,OFFH al,Al 8H,Al CX,8 OX IDMA OX,Al WRITE PATTERN "FF" TO All REGISTERS SAVE PATTERN FOR COMPARE SETUP lOOP COUNT SETUP I/O PORT ADDRESS OF REG I STER WRITE PATTERN TO REGISTER, lSB I/O DELAY MSB OF 16 BIT REG[STER Al TO ANOTHER FA TTERN BEFORE READ I/O DELAY READ 16-81T DNA CH REG, lS8 2ST DNA I/O DELAY SAVE lSB OF 16-81T REGISTER READ MS8 OF DNA CHANNEL REGISTER PATTERN READ AS WRITTEN? YES - CHECK NEXT REG I STER NO - HALT THE SYSTEM NXT DNA CH SET-I/O-PORT TO NEXT CHANNEL REGISTER WRITE PATTERN TO NEXT REGISTER SET PATTERN TO 0 YES CONT I NUE ,'2 DX,Al Al,OIH "2 "2 Al,DX AH,Al Al,DX aX,AX CI8 C18: INC lOOP INC "Z OX CI1 AL CI6 WR[TE DMA WITH 55 PATTERN CMP "Z CMP "Z MOY "MP Bl,055H C19 Bl,OAAH C20 Al,055H C16 CHECK GO IF CHECK GO [F ;----- WRITE DMA WITH AA PATTERN C19: MOY "MP ; ; ; ; IF "55" PATTERN DONE YES IF "AA" PATTERN DONE YES Al,OAAH C16 --- ------------------- -----------------TEST.07 8237 DMA I INITIALIZATION CHANNEL REGI STER TEST DESCR I PT I ON DISABLE 8237 DMA CONTROllER 1. WR[TE/READ THE CURRENT DMA I ADDRESS AND WORD COUNT REG I STERS FOR All CHANNELS. ---- ------------------ -----------------CHECKPO I NT 07 - C20: MOY OUT OUT WRAP DNA CI6A: CI7A: MOY MOY MDY MOY MOY OUT "MP OUT MDY "MP IN "MP MOY IN CMP "E DMA 1 Al,07H MFG PORT ,Al DMA1+0DH-2,Al 1 CHANNEL ADDRESS AND COUNT REGISTERS AL,OFFH Bl,Al 8H,AL CX,8 OX ,DMA 1 DX,Al "2 DX,AL Al,OIH "2 AL,DX '.2 AH,Al AL,DX BX,AX CI8A HLT cr8Al ADO LOOP INC "Z ;----- <><><> <> <><> <><> <><><> <> <><> CHECKPOINT 07 <><> SEND MASTER CLEAR TO 2ND DMA DX,2 CI7A AL CI6A WRITE PATTERN FF TO All REGISTERS SAVE PATTERN FOR COMPARE SETUP LOOP COUNT SETUP I/O PORT ADDRESS OF REG I STER WRITE PATTERN TO REGISTER, LSB I/O DELAY MS8 OF 16 8[T REGISTER Al TO ANOTHER PAT 8EFORE RD I {a OElAY READ 16-BIT DMA CH REG, lS8 2ST DMA I/O DELAY SAVE LSB OF 16-BIT REGISTER READ MS8 OF DMA CH REG I STER PATTERN READ AS WR ITTEN? YES - CHECK NEXT REG I STER NO - HALT THE SYSTEM NXT DMA CH SET-I/O-PORT TO NEXT CHANNEL REGI STER WRITE PATTERN TO NEXT REGISTER SET PATTERN TO 0 YES CONTI NUE WRITE DMA WITH 55 PATTERN CMP "Z CMP "Z MOY "MP Bl,55H C20A 8l,OAAH C21 Al,55H CI6A CHECK GO IF CHECK GO IF IF 55 PATTERN DONE YES IF AA PATTERN DONE YES WRITE OMA W[TH AA PATTERN C20A: MOV "MP ;----- INITIALIZE AND START MEMORY REFRESH C21 : MOY MOY "OY DUT ; ----- Al,OAAH CI6A ex, ~RESET FLAG PEQUIP FlAG,AX AL, 18 TIMER+! ,AL GET THE RESET FLAG DO A DUMMY MEMORY WR ITE 8EFORE REFRESH START REFRESH TIMER SET DMA COMMAND SUB OUT Al,Al OMA+8,Al OUT DMAI8,Al OACK SENSE lOW,DREQ SENSE HIGH lATE WRITE, FIXED PR[ORITY, NORMAL TIM I NG, CONTROLLER ENABLE, CHO ADDRESS HOLD 0 I SA8LE. MEMORY TO MEMORY 0 I SABLE SAME TO SECOND CONTROLLER IBM Personal Computer MACRO Assembler TEST 1 ---- 06/10/65 POWER ON SELF TEST 1313 1314 1315 1316 02AC 80 40 1317 02AE E6 08 1316028080 CO 1319 0282 E6 06 1320 0284 E8 00 1321 0286 BO 41 1322 0286 E6 08 1323 028A E6 06 1324 02BC E8 00 1325 02BE BO 42 1326 02CO E6 OB 1327 02C2 E6 06 1326 02C4 EB 00 1329 02Cb BO 43 1330 02C8 E6 OB 1331 02CA E6 Db 1332 1333 1334 1335 02CC 89 IE 0072 R 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 0200 80 08 1341 0202 E6 80 1348 0204 2A CO 1349 0206 BA 0081 1350 0209 B9 DOFF 1351 02DC EE 1352 0200 42 1353 02DE FE CO 1354 02EO 81 FA 008F 1355 02E4 75 Fb 1356 02E6 86 EO 1357 02E8 FE CC 1358 02E,4, 4,4, 1359 02E8 2A CO 13bO 02ED EC 1361 02EE 3A C4 1362 02FO 75 30 1363 02F2 FE CC 1364 02F4 4A 1365 02F5 81 FA 0080 13b6 02F9 15 FO 1367 02FB FE C4 1368 02FD 8A C4 1369 02FF E2 DB 1370 1311 1312 1373 0301 130 CC 1314 0303 8A 008F 1375 0306 8A EO 1376 0308 EE 1371 1318 1379 1380 0309 2A CO 1381 030B EC 1382 030C 3A C4 1383 030E 75 12 1384031080 FC CC 1385 0313 15 04 13860315 BO 33 13870311 E8 EA 1388 0319 1389031980 FC 00 1390 031C 14 05 1391 031E 2,4, CO 1392 0320 E8 EI 1393 1394 1395 0322 1396 0322 F4 ! 391 1398 1399 1400 1401 1402 1403 1404 1405 1406 0323 1407 0323 80 09 1408 03~5 E6 80 1409 0327 28 C9 1410 0329 14110329E461 1412 032B A8 10 1413 0320 El FA 1414 032F E3 Fl 1415 0331 1416 0331 E4 61 1417 0333 A8 10 1418 0335 EO FA 1419 0331 E3 E9 1420 1421 1422 1423 1424 1425 1426 ; ----- Version 2.00 (POST) MODE SET ALL DMA CHANNELS MOV OUT MOV OUT 110 DELAY SET MODE FOR CHANNEL 1 '.2 SET MODE FOR CHANNEL 5 I/O DELAY SET MODE FOR CHANNEL 2 ,'2 SET MODE FOR CHANNEL 6 I/O DELAY SET MODE FOR CHANNEL 3 AL,42H DMA+OBH,AL DMAI8+06H,AL AL,43H DMA+OBH, AL DMAI8+06H,AL SET MODE FOR CHANNEL 1 RESTORE RESET FLAG MOV ;- ~~~~: ~ ~-- I SET CASCADE MODE ON CHANNEL 4 "2 AL,41H OMA+OBH,AL DMAI8+06H,AL OUT OUT "MP MOV OUT OUT "MP MOV OUT OUT ; SET MODE FOR CHANNEL 0 AL,40H DMA+08H,AL AL,OCOH DMAI8+06H,AL ""P MOV ; ----- 1-14 06-10-85 ORESET_FLAG,BX -- ---- ---------- - --- ------- --- DMA PAGE REG I STER TEST DESCRIPTION ALL PAGE REGISTERS .; - - --- - - WRITE/READ - - - - - - - - - - - - - - - - - - -- - - -- - - - - - - - -CHECKPOINT 08 C22A: C228: MOV OUT SUB "OV MOV OUT INC INC CMP "NZ XCHG DEC DEC SUB IN CMP "NZ DEC DEC CNP "NZ INC "DV LOOP "DV NOV "DV OUT DO ALL DATA PATTERNS AL DX,8FH C22A AH,AL TEST OMA PAGES 81 THROUGH 8EH AH SAVE CURRENT DATA PATTERN CHECK LAST WR I TTEN OX AL.AL AL.DX AL,AH C2. DATA AS WRITTEN? GO ERROR HALT IF NOT CHANGE DATA 8EFORE READ AH OX DX,MFG_PORT C228 CONTINUE TILL PORT 80 AH NEXT PATTERN TO RIPPLE AL,AH C22A TEST LAST DMA PAGE REGISTER C22: <><><><><><><> <><><><><> <><> CHECKPOINT 08 <><> AL,08H MFG_PORT ,AL AL,AL DX,DMA PAGE CX,OFFH OX,AL OX (USED FOR ADDRESS LINES DURING REFRESH) AL,OCCH OX ,LAST _DMA_PAGE AH,AL DX,AL WR J TE AN CC TO PAGE REG I STERS SAVE THE DATA PATTERN OUTPUT PAGE REG I STER VERIFY PAGE REGISTER 8F SUB IN CMP "NZ CMP "NZ NOV "MP AL,AL AL,DX AL,AH C2. AH,OCCH C25 AL,033H C22 CHANGE DATA PATTERN BEFORE READ GET THE DATA FROM PAGE REGISTER GO IF ERROR SET UP DATA PATTERN OF 33 DO DATA 33 COP "Z SUB "MP AH,O C21 AL,AL C22 CHECK DONE GO IF YES SET UP FOR DATA PATTERN 00 DO DATA 0 GO IF ERROR C25: 1----C26: ERROR HALT HLT i- ~~ ~~ :~~- ; ; ; ; HALT SYSTEM ------------------------------- STORAGE REFRESH TEST DESCRIPTION I FY REFRESH I S OCCURR I NG ---- --- VER -- --- - -- - --- - - - - -------- - - - - -- - -CHECKPOINT 09 - TEST MEMORY REFRESH <><><><><><><><><><><><> <><> CHECKPO I NT 09 <><> MOV OUT SUB AL,09H MFG _PORT, AL CX,CX IN TEST LOOPZ JCXZ AL,PORT B AL '. REFRESH _ BIT C28 C2. I NSURE REFRESH I S OFF ERROR HALT IF TIMEOUT IN TEST LOOPNZ JCXZ AL,PORT_8 AL,REFRESH_BIT C29 C26 ERROR HALT I F NO REFRESH 8 I T C28: INSURE REFRESH BIT IS TOGGLING C29: I NSURE REFRESH J S ON TEST. 10 8042 INTERFACE TEST READ CONFIGURATION JUMPERS DESCRIPTION I SSUE A SELF TEST TO THE 8042. TEST 1 5-41 IBM Personal Computer MACRO Assembler TEST 1 ---- 06/10/85 POWER ON SELF TEST 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 14:37 1438 1439 1440 1441 1442 144:3 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1414 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 151 1 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 Version 2.00 (POST) 1-15 06-10-85 INSURE A 55H IS RECEIVED. READ MANUFACTURING AND DISPLAY ; ;----0339 BO OA 033B E6 80 CHECKPOINT OA MOV OUT AL,OAH MFG_PORT ,AL SOFT RESET 0:330 0:33F 0341 0:343 0346 0348 0:34A 0340 034F 2B E4 8A F6 14 E4 F6 EO 74 0351 F4 C9 64 EO C4 01 02 60 C4 02 FO 01 : I AND SAVE IN MFG_TEST. --- --- - ,JUMPERS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- -- SUB TST! : IN MOV TEST "Z IN TST2: TEST LOOPNZ "Z ERROl <><><><><><><><><><> <> <> <><> CHECKPOINT OA <><> (HANDLE ALL POSS ISLE CONO I T IONS) CX,CX AL, ST ATUS PORT AH,AL AH, OUT aUF FULL TST2 AL ,PORT A AH, 1NFT-8UF FULL TST I TST4 HLT 100 MILL I SECONDS FOR TH I SLOOP CHECK FOR I NPUT BUFFER FULL CO IF NOT FLUSH I S THE OUTPUT BUFFER ALSO FULL? TRY AGAIN CaNT I NUE I F OK HALT SYSTEM IF BUFFER FULL I SSUE A RESET TO THE 8042 0:352 BO OB 0:354 E6 80 0:356 0:358 035B 0350 035F 0:361 0363 0366 0368 036A BO BC EB A8 74 E4 BC EB E4 3C AA 03EE R 39 01 02 60 03FO R 3A 60 55 TST4: MOV OUT MOV MOV TST4_B: "MP TEST R IN TST4_A: TST4_C: MOV "MP IN CMP AL ,OBH MFG_PORT ,AL AL,SELF TEST SP,OFFSET C8042A SHORT C8042 AL ,OUT BUF FULL TST4 AAL ,PORT A SP, OFFSET OBF 42A SHORT OBF 42 AL,PORT AAL,55H - 036C BO OC 036E E6 80 MOV OUT AL.OCH MFC_PORT, AL 0370 75 OF "NZ ERRO 0372 0374 0377 0379 031C 037E 0380 MOV MOV <> <><><><><><><> <> <> <> <> <><> CHECKPOINT 08 <><> SELF TEST COMMAND SET RETURN ADDRESS I S THE OUTPUT BUFFER FULL? GO IF NOT FLUSH SET RETURN ADDRESS GO WA I T FOR BUFFER GET THE END I NC RESPONSE <> <><><><><> <> <> <> <> <> <> <><> CHECKPOINT OC <><> GO IF NOT OK GET THE SW ITCH SETT I NGS BO BC EB BC EB E4 E6 CO 03F4 R 10 03F6 R 24 60 82 E30B: "MP MOV "MP E30C: IN OUT AL, READ 8042 INPUT SP ,OFFSET C8042C SHORT C8042 SP, OFFSET OBF 42B SHORT OBF 42 AL,PORT ADMA_PAGE+ I ,AL READ I NPUT COMMAND SET RETURN ADDRESS I SSUE COMMAND SET RETURN ADDRESS GO WA I T FOR RESPONSE eET THE SW ITCH SAVE TEMPORARY WR ITE BYTE 0 OF 8042 MEMORY 0382 0384 0387 0389 BO BC EB 74 60 03F2 R 00 05 038B 0380 038F 0390 0390 0392 0394 BO 00 E6 80 F4 BO 50 E6 60 EB 10 MOV MOV TST4_D: MOV OUT HLT TST4 01: MOV OUT "MP ; ----0396 FA 0397 E6 0399 039B 0390 039F 03Al 2B E4 A8 EO C3 C8042: C9 64 02 FA C42 2B 8:3 E4 A8 75 E2 FE 75 C3 - I, IN TEST LOOPNZ RET C9 06 64 01 06 F8 CB F4 ----- OBF _ 42: SUB MOV IN TEST "NZ LOOP OEC "NZ C42_31 ; AL,ODH MFG_PORT ,AL AL, SOH PORT A, AL SHORT E30A WR I TE BYTE COMMAND SET RETURN ADDRESS I S SUE THE COMMAND CaNT I NUE I F COMMAND ACCEPTED <><><><><><> <> <> <><><><> <><> CHECK PO I NT 00 <><> ENABLE OUTPUT BUFFER FULL INTERRUPT, DISABLE KEYBOARD, SET SYSTEM FLAe, PC I COMPATIBILITY, INHIBIT OVERRIDE STATUS_PORT ,AL CX,CX AL,STATUS PORT AL, I NPT_BOF _FULL C42 I NO I NTERRUPTS ALLOWED SEND COMMAND IN AL REG J STER LOOP COUNT WA I T FOR THE COMMAND ACCEPTED - WAIT FOR 8042 RESPONSE C42 2, - AL, WR I TE 8042 LaC SP,OFFSET C8042B SHORT C8042 TST4_DI I SSUE THE COMMAND TO THE 8042 CLI OUT SUB ; 03A2 03A4 03A6 03A8 03AA 03AC 03AE 03BO 03S2 "MP ,JZ RET CX,CX BL,6 AL, STATUS PORT AL. OUT _BUF_FULL 200MS/PER LOOp· 6 CHECK FOR RESPONSE -- GO I F RESPONSE TRY AGAIN DECREMENT LOOF COUNT - RETURN TO CALLER C42 3 C42 2 BL C42 2 =1200 MS + - ---------------------------------- ----- ; TEST. I 1 ; BASE 64K READ/WRITE MEMORY TEST ; OESCR I PTI ON : : WRITE/READ/VERIFY DATA PATTERNS I ; AA,55,FF,OI, AND 00 TO 1ST 64K : ; OF STORAGE. VER I FY STORAGE ADDRESSABILITY. ; ; - - -- - - - -- - ---- -- - - - - - - - -- --- - - -- -- --- - 0383 80 OE 03B5 E6 80 03B7 038A 03BC 03CO 03C 1 03C4 5-42 88 8E 88 FC B9 28 ---- R 08 IE 0072 R 8000 FF TESTl ;----- FILL MEMORY WITH DATA E30A: MOV OUT MOV MOV MOV CLO MOV SUB AL,OEH MFG_PORT ,AL AX,DATA DS,AX BX • 'PRESET_FLAG CX,2000H*4 OJ ,01 <><><><><><><><><> <><> <> <><> CHECKPO I NT OE <><> GET THE SYSTEM SEGMENT OF· DATA SAVE 'PRESET FLAC IN BX SET 0 I RECT ION FLAG TO INCREMENT SET FOR 32K WORDS FIRST 16K IBM Personal Computer MACRO Assembler TESTI ---- Ob/l0/85 POWER ON SELF TEST 1541 03Cb 2B Fb 1542 03C8 2B CO 1543 03CA 8E 08 1544 03CC 8E CO 1545 03CE 81 FB 1234 154b 0302 15 03 1541 0304 E9 0582 R 1548 1549 1550 1551 0301 BO OF 1552 0309 Eb 80 1553 1554 03DB 80 80 1555 0300 Eb 81 1556 03DF BC 03EC R 1551 03E2 E9 0000 E 1558 03E5 8B 08 1559 03E1 15 OF 1560 03E9 E9 0580 R 15bl 1562 1563 15b4 03EC 03E5 R r 5b5 03EE 0350 R 156b 03FO 03b8 R 1561 03F2 0389 R r 5b8 03F4 0319 R 15b9 03Fb 037E R 1510 1511 1512 1513 1514 1515 151b 1511 1518 1519 1580 1581 1582 03F8 1583 03F8 8A C1 1584 03FA Eb 81 1585 03FC 8A C3 158b 03FE Eb 82 1581 1588 1589 1590 0400 B9 COOO 1591 0403 8E 09 1592 0405 2B DB 1593 0407 8B 07 1594 0409 E8 00 1595 040B 3D AA55 1596 040E bA 00 1597 0410 14 OC 1598 0412 81 Cl 0080 1599 041b 81 F9 C800 1600 041A 7C E7 lbOl 041C 23 C9 lb02 041E lb03 041E 75 03 1b04 0420 E9 050F R lb05 lb06 1607 1608 1 b09 1610 1611 1612 1613 1614 1615 0423 BA 0308 1616 0426 2A CO 1617 0428 EE 1618 1619 0429 BA 0388 1620 042C BO 01 1621 042E EE 1622 042F 83 EA 04 1623 1624 = 0010 1625 1626 0432 BB 0030 E 1627 16280435 B9 0010 1629 1630 1631 1632 0438 32 E4 1633 1634 1635 1636 043A 8A C4 1637 043C EE 1638 0430 42 1639 043E FE C4 1640 0440 2E: SA 07 1641 0443 EE 1642 0444 43 1643 0445 4A 1644 0446 E2 F2 1645 0448 8A E2 1646 044A 80 E4 FO 1641 044D 80 FC DO 1648 0450 74 08 1649 0452 BB 0000 E 1650 0455 BA 0304 1651 0458 EB DB 1652 1653 1654 1-16 06-10-85 Version 2.00 (POST) SUB SUB MOV MOV CMP JNZ JMP S I, S I AX,AX DS,AX ES,AX BX,1234H E30A 0 CLR_STG ; ; ;----- GET THE INPUT BUFFER E30A MOV OUT AL,OFH MFG_PORT, AL MOV OUT MOV JMP MOV JNZ JMP AL,PARITY_CHECK DMA_PAGE+6.AL SP,OFFSET C2 STGTST_CNT BX,AX C31 C33 - " C30: WARM START? GO IF NOT (SWITCH SETTINGSI <><><><><><><> <><><><><> <><> CHECKPO I NT OF <><> SET BASE MEMORY PAR I TY USE AS TEMPORARY SAVE SET RETURN ADDRESS SAVE FAILING BIT PATTERN STORAGE OK. CaNT I NUE TEMPORARY STACK FOR POST ROUTINES C2 C8042A OBF 42A C8042a C8042C OBF _ 42B OW OW OW OW OW OW C30 TST4 B TST4-C TST4-0 E30BE30C .-- - - - - - - - - - - - --- - - - - --- - - - - - - - - - - - - - - - - -; BASE 64K STORAGE FAILURE 0 I SPLAY THE CHECKPO I NT (MFG CHECKPO I NT I AND XOR EXPECTED WITH READ IN MFG PORT DISPLAY CHECKPOINT IN MFG PORT+3 DISPLAY XOR'D DATA HIGH BYTE MFG PDRT+I LOW BYTE IN MFG PDRT+2 A READ/WRITE SCOPE LOOP OF THE FIRST WORD FOR POSSIBLE ADDRESS LINE FAILURES ; ; ; ; ; ; ; C31: MOV OUT MOV OUT SAVE HIGH BYTE AL,BH MFG PORT+ 1, AL AL,BL MFG_PORT+2,AL SAVE LOW BYTE CHECK FOR V IDEO ROM MI: MOV MOV SUB MOV JMP CMP POP JZ AOO CMP JL ANa CX,OCOOOH DS,CX BX,BX AX, [BX} S·2 AX ,OAA55H START OF I/O ROM POINT TO SEGMENT GET THE FIRST 2 LOCATIONS Z5 CX,080H CX,oe800H MI CX,CX GO IF YES PO I NT TO NEXT 2K 8LOCK TOP OF VIDEO ROM AREA YET? TRY AGAIN SET NON ZERO FLAG JNZ JMP C32 C31 0 GO IF NOT BUS SETTLE I S THE V IDEO ROM PRESENT? Z5: BYPASS ERROR DISPLAY - ;~~ - ~ ~ ~~~ - ~~~~ - ~~ - ~ ~ ;~~~ ~ - ~~~~~~ - ~~~~~ --- -- - - - ---- - - -- IF VIDEO ROM ; THIS ROUTINE INITIALIZES THE ATTACHMENT TO , TO 0 I SPLAY FIRST 64K STORAGE ERRORS. ; BOTH COLOR AND MONOCHROME ATTACHMENTS ARE INITIALIZED. ; - -- - ---- - - - - ---- - - - - -- -- - - - --- - - - - -- - - - --- - --- --- - - - --- ;----- I NIT I AL I ZE COLOR / MONOCHROME C32: MOV SUB OUT OX ,3D8H AL,AL DX,AL CONTROL REGISTER ADDRESS OF COLOR CARD MODE SET MOV MOV OUT SUB DX,03B8H AL, I DX,AL DX,4 CONTROL REGISTER ADDRESS OF MODE SET FOR CARD RESET V IDEO BACK TO BASE REG I STER 10H MOV ASSUME MOV eX,OFFSET VIDEO PARMS+M4-3 ; POINT TO VIDEO PARAMETERS DS:CODE CX,M4 ; COUNT OF MONOCHROME V IDEO PARAMETERS XOR MOV OUT INC INC MOV OUT INC OEC LOOP MOV ANa CMP JZ MOV MOV JMP INITIALIZATION TABLE AH,AH LOOP THROUGH TABLE, ; ----- CARD EOU BX POINTS TO CORRECT ROW OF Ml 0: a/w I AH J S REG I STER NUMBER OUR I NG LOOP OUTPUTTING REGISTER ADDRESS, THEN VALUE FROM TABLE AL,AH DX,AL GET b845 REG I STER NUMBER OX POINT TO DATA PORT NEXT REGISTER VALUE GET T ABLE VALUE OUT TO CHIP NEXT IN TABLE BACK TO POINTER REGI STER DO THE WHOLE TABLE CHECK I F COLOR CARD DONE STRIP UNWANTED BITS I SIT THE COLOR CARD? CaNT J NUE I F COLOR POINT TO VIDEO PARAMETERS COLOR BASE CONTINUE AH AL,CS: [BX} DX,AL BX ox MIO AH,DL AH,OFOH AH,ODOH Z 3 BX,OFFSET VIDEO PARMS DX,3D4H Z_2 FILL REGEN AREA WITH BLANK TESTt 5-43 IBM Personal Computer MACRO Assembler TESTI ---- 06/10/85 POWER ON SELF' TEST 1655 1656 1657 1658 1659 1660 1661 16&2 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1 &80 1681 1682 1683 1684 1685 1686 1&87 1666 1689 1690 1691 169Z 1693 1694 1695 1696 1697 1698 1699 1700 1701 170Z 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1711 1718 1119 17Z0 17Z1 1722 1723 17Z4 1725 1126 1727 1728 1729 1730 1731 1132 1733 1734 1135 1736 1737 1138 1739 1740 1741 174Z 1743 1744 1745 1746 1747 1748 1749 1750 1151 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 045A 33 F'F' 045C 88 8000 045F' 8E CO Z_31 Version 2.00 (POST) 1-17 06-' 0-85 XOR MOV MOV 01,01 AX,OBOOOH ES,AX SET UP PO I NTER FOR REGEN SET UP ES TO VIDEO REGEN 0461 89 0800 0464 88 0720 0467 F'3/ A8 MOV MOV REP CX, Z048 AX, • '+7·H STOSW NUMBER OF WORDS I N MONOCHROME CARD FILL CHARACTER FOR ALPHA + ATTRIBUTE FILL THE REGEN BUFFER WITH BLANKS 0469 0468 046E 0470 0473 XOR MOV MOV MOV REP 01,01 BX,OB800H ES,BX CX,S192 STOSW CLEAR COLOR V IDEO BUFFER MEMORY SET UP ES TO COLOR VIDEO MEMORY 33 F'F' 88 8800 8E C3 89 2000 F'3/ A8 ; ----- 0475 8A 0388 0478 BO 29 047A EE MOV MOV OUT ; ----- 0478 42 047C BO 30 047E EE ; ----- OX,3BSH AL,29H OX,AL SET V IDEO ENABLE PORT SET UP OVERSCAN REG I STER INC MOV OUT 047F' BA 0308 0482 BO 28 0484 EE FILL WITH BLANKS ENABLE V IDEO AND CORRECT PORT SETT I NG OX AL,30H OX,AL SET OVERSCAN PORT TO A DEFAULT VALUE 30H FOR ALL MODES EXCEPT 640X200 OUTPUT THE CORRECT VALUE TO 309 PORT ENABLE COLOR V IDEO AND CORRECT PORT SETTI NG MOV MOV OUT OX,30SH AL,28H OX,AL SET V IDEO ENABLE PORT SET UP OVERSCAN REGI STER 0465 42 0466 BO 30 0488 EE INC MOV OUT ; ----- OX AL ,30H OX,AL DISPLAY FAILING CHECKPOINT AND 0489 8C C8 048B 8E DO MOV MOV AX,CS SS ,AX 0480 8B BOOO 0490 8E 08 MOV MOV BX ,OBOOOH OS,BX 0492 0494 0497 0499 049B 049C 0490 30 0006 FF 05 MOV MOV SUB MOV INC INC AL, '0' CX,6 01,01 [01] ,AL 01 01 FA BO 89 28 88 47 47 EZ SET OVERSCAN PORT TO A DEFAULT VALUE 30H FOR ALL, MODES EXCEPT 640X200 OUTPUT THE CORRECT VALUE TO 309 PORT SET STACK SEGMENT TO CODE SEGMENT SET OS TO B/W DISPLAY BUFFER DISPLAY BANK 000000 START AT 0 WR I TE TO 0 I SPLA '( REGEN BUFFER POINT TO NEXT POSITION LOOP Z 049F 80 FF 88 04AZ 74 OC 04A4 ZB FF CMP JZ SUB BH,OB8H oT.ol POINT TO START OF BUFFER 04A6 04A8 04AA 04AC 04AE MOV MOV MOV MOV JMP BH,OBOH ES,BX BH,OBSH OS,BX ES = MONOCHROME SET SEGMENT TO COLOR OS COLOR 87 8E B7 8E E8 80 C3 B8 DB E2 ;----048080 ZO 04B2 88 05 0484 26: 88 05 04B7 47 04B8 47 0489 E4 81 04B8 81 04 0480 02 E8 048F BC 057A R 04C2 EB 18 04C4 04C6 04C8 04C8 04CO 04CF 0401 0403 0406 0408 040A 040C E4 24 BC E8 E4 Bl DZ BC EB E4 24 BC 81 OF 057C R 12 82 04 E8 057E R 01 82 OF 0580 R ZI: Z2: Z3, ;----04DF 04El 04E2 04E4 04 90 27 1440 27 04E5 04E7 04EA 04EB 04EC 88 05 26: 88 05 47 47 C3 04ED 04EF 04F' 04F4 04F5 0-4F6 04F8 04FA 04Fo BO ZO 88 05 Z6: 88 05 47 47 BO 32 88 05 Z6: 88 05 47 PR: Z 5-44 TEST 1 = Z_O PRINT FAILING BIT PATTERN MOV MOV MOV INC INC IN MOV SHR MOV JMP (01] ,AL ES: (01] ,AL 01 01 AL,MFG_PORT+ 1 CL.4 AL,CL SP "OFFSET Z 1_0 SHORT PR IN ANa MOV JMP IN MOV SHR MOV JMP IN ANa MOV AL,MFG_PORT+ 1 AL,OFH SP, OFFSET Z2 0 SHORT PR AL, MFG_PORT +2 CL,4 AL,CL SP,OFFSET Z3_0 SHORT PR AL,MFG_PORT+2 AL,OFH SP,OFFSET Z4_0 AL, 01 SPLAY A BLANK WR I TE TO COLOR BUFFER WR I TE TO MONOCHROME REGEN BUFFER PO I NT TO NEXT POS I Ti ON GET THE HIGH BYTE OF FAILING PATTERN SHIFT COUNT NIBBLE SWAP ISOLATE TO LOW NIBBLE GET THE HIGH BYTE OF FAILING PATTERN SHIFT COUNT NIBBLE SWAP ISOLATE TO LOW NIB8LE RETURN TO Z4: CONVERT AND PR I NT AOO OAA AOC OAA AL,090H MOV MOV INC INC RET [01] .AL ES:[OIJ,AL 01 01 AL,040H 01 SPLA Y 20 I Z4; CHECK THAT COLOR BUFFER WR I TTEN I MOV MOV MOV INC INC MOV MOV MOV INC CONVERT OO-OF TO ASCI I CHARACTER ADD FIRST CONVERSION FACTOR ADJUST FOR NUMERIC AND AL:.PHA RANGE ADD CONVERS I ON AND ADJUST LOW N 18BLE ADJUST HIGH NIBBLE TO ASCII RANGE WR I TE TO COLOR BUFFER WR I TE TO MONOCHROME BUFFER POINT TO NEXT POSITION ERROR AL,' • [01 J ,AL ES:[OI],AL 01 01 AL, '2' (OIJ.AL ES: (01] ,AL 01 DISPLAY A BLANK WRITE TO DISPLAY REGEN BUFFER WR I TE TO MONOCHROME BUFFER PO I NT TO NEXT POS I TI ON D I SPLAY 20 I ERROR WR I TE TO D I SPLA Y REGEN BUFFER WR I TE TO MONOCHROME BUFFER POINT TO NEXT POSITION IBM Perso.,:!l Computer MACRO Assembler TESTI ---- 06/10/85 POWER ON SELF TEST 1769 04FE 47 1710 04FF 80 30 1771 0501 88 05 1712 0503 26: 88 05 1773 0506 47 1774 0507 47 17750508 BO 31 1776 050,.1, 88 05 1777 050C 26: 8805 1778 1779 1780 1781 050F BO DD 1782 051 I E6 80 17830513 E6 83 17840515 2B C9 17850517 1786 1787 0517 2B CO 17880519 8E 08 1789 051B 88 ,.1,,.1,55 1790 051E 28 FF 1791 0520 89 05 1792 0522 88 05 1793 0524 E2 F I 1794 0526 1795 0526 89 05 1796 0528 88 05 1797 052,.1, E2 FA 1798 052C 1799 052C 89 05 1800 052E 88 05 1801 0530 E2 FA 1802 0532 1803 0532 89 05 1804 0534 88 05 1805 0536 E2 FA 1806 0538 1807 0538 89 05 1808 053A 88 05 1809 053C E2 FA 1810 1811 1812 1813 053E E4 81 1814 0540 E6 80 1815 0542 1816 0542 B8 AA55 1817 0545 89 05 1818 0547 88 05 1819 0549 E2 F7 1820 0548 1821 054B 89 05 1822 054D 88 05 1823 054F E2 FA 1824 0551 1825 0551 89 05 1826 0553 8B 05 1827 0555 E2 FA 1828 1829 1830 1831 0557 E4 82 1832 0559 E6 80 1833 055B B8 AA55 1834 055E 2B FF 1835 0560 89 05 1836 0562 8B 05 1837 0564 E2 F8 1838 0566 1839 0566 89 05 1840 0568 8B 05 1841 056A E2 FA 1842 056C 1843 056C 89 05 1844 056E 88 05 1845 0570 E2 FA 1846 0572 1847 0572 89 05 1848 0574 88 05 1849 0576 E2 FA 1850 0578 E8 95 1851 1852 057,.1, 04C4 R 1853 057C 04CO R 1854 057E 04D8 R 1855 0580 04EO R 1856 1857 1858 1859 1860 1861 0582 1862 18(:,3 0582 F3/ AB 1864 0584 88 ---- R 1865 0587 8E 08 1866 0589 89 IE 0072 R 1867 1868 1869 1870 058D 1871 058D 88 ---- R 1872 0590 8E D8 1873 0592 BC 0000 1874 0595 8E D4 1875 0597 8C 8000 1876 1811 1878 1879 059A C6 06 0084 R 1880 1881059FBOIl 1882 05Al E6 80 INC MOV MOV MOV INC INC MOV MOV MOV 01 AL, '0' [Oll,AL ES:[Dll,AL 01 01 AL, '1' (01] ,AL ES:[Dl),AL ROLL ERROR CODE C31 C31 - 0, AL,OOaH MFG_PORT, AL MFG PORT +3, AL SUB MOV MOV SUB MOV MOV AX,AX DS,AX AX,OAA55H DI,DI [DI] ,AX AX, [01] C31 A - B, MOV MOV -C, MOV MOV LOOP C31 - 0, MOV MOV LOOP MOV MOV LOOP j----- IN -G, MOV MOV MOV LOOP C31 - H, C31 - I, MOV MOV LOOP MOV MOV LOOP ;----- - K, OUT MOV SUB MOV MOV LOOP - L, MOV MOV LOOP C31 - M, MOV MOV LOOP C31 - N, MOV MOV LOOP JMP ZI Z2 Z3 Z' FIRST THE CHECKPOINT <><><><><> <> <><> <><><><> <><> CHECK PO I NT aD <><> ALSO DISPLAY CHECK POINT IN PORT 83 - 00 -- 00 ; ----- OW OW ow ow READ THE FIRST WORD 0] SPLAY CHECKPO I NT LONGER AX, [0] 1 C31 B - [Oll,AX AX, [011 C31 C - [OI],AX AX, [DI] C31 0 - [DI],AX AX, [D11 C31 E - IN MFG_PORT --> NEXT THE HIGH BYTE AL,MFG_PORT+ I MFG _PORT, AL XOR OF FAILING BIT PATTERN HIGH BYTE AX,OAA55H (Dll,AX AX, [01] C31 G WR I TE AN AA55 READ THE FIRST WORD - [OI],AX AX, [DI] C31 H - [OI],AX AX, [D]] C31 I - ]N MFG_PORT AL,MFG_PORT+2 MFG_PORT ,AL AX ,OAA55H OI,D] {Ol] ,AX AX. [01] C31 K --> THEN THE LOW BYTE LOW BYTE WR I TE AN AA55 ; READ THE FIRST WORD - [011.AX AX,[OI] C31 L - [01] ,AX AX, (01] C31 M - [0]] ,AX AX, (01] C31 N C31 0 - ZI '2 Z3 Z4 DO AGAIN TEMPORARY TEMPORARY TEMPORARY TEMPORARY STACK STACK STACK STACK CLEAR STORAGE ENTRY CLR STG: ASSUME REP MOV MOV MOV j----- SETUP SEGMENT WR I TE AN AA55 - ROLL ERROR CODE IN C31 --> [0]] ,AX ROLL ERROR CODE OUT C31 WRITE TO DISPLAY RECiEN BUFFER WR I TE TO MONOCHROME BUFFER cX,Ex C31 _E: C31 WRITE TO DISPLAY REGEN BUFFER WR I TE TO MONOCHROME BUFFER PO I NT TO NEXT POS I TI ON -A, LOOP C31 IN MFG_PORT MOV OUT OUT SUB LOOP C31 1-18 06-( 0-85 Versio., 2.00 (POST) OS:OATA STOSW AX,OATA OS,AX (IRE SET _FLAG, BX STORE 32K ¥lORDS OF 0000 RESTORE DATA SEGMENT RESTORE RESET FLAG SETUP STACK SEGMENT AND SP C33: MOV MOV MOV MOV MOV AX,OATA OS,AX SP,POST SS SS, SP SP,POST_SP SET DATA SEGMENT GET STACK VALUE SET THE STACK UP ST ACK I S READY TO GO ] N I TI ALI ZE 0] SPLA Y ROW COUNT 18 MOV oltROWS,25-1 MOV OUT AL,IIH MFG_PORT ,AL SET ROWS FOR PRINT SCREEN DEFAULT <><><><><><><> <><><><><> <> <> CHECKPO I NT 1 1 <> <> TESTl 5-45 IBM Personal Computer MACRO Assembler TESTI ---- 06/10/85 POWER ON SELF TEST 1883 1684 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1696 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 191 I 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1936 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 ,958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1966 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 Version 2.00 (POST) 1-19 06- I 0-85 VERIFY SPEED/REFRESH CLOCK RATES 05A3 05A5 05A7 05A8 05A6 05AA 05AC 05AE 05AE 05BO 0582 32 08 33 C9 90 (ERROR = 1 LONG AND 1 SHORT BEEP) 8L,BL CX,CX ; CLEAR REFRESH CYCLE REPEAT COUNT ; INITIALIZE SPEED RATE REGISTER ; PLACE ON EVEN WORD BOUNDARY IN TEST LOOPZ AL.PORT 8 AL,REFRESH BIT C34 - ; ; IN AL,PORT B AL,REFRESH 81T C35 - READ REFRESH BIT REG I STER MASK FOR BIT DECREMENT LOOP COUNTER TILL OFF DECREMENT REFRESH CYCLE REPEAT COUNT REPEAT TILL CYCLE COUNT DONE XOR XOR EVEN C34: E4 61 A8 10 El FA READ REFRESH BIT REGISTER MASK FOR 81T DECREMENT LOOP COUNTER TILL ON C35: E4 61 A8 10 EO FA TEST LOOPNZ 0584 FE CB 05B6 75 FO OEC JNZ BL 05B8 05BC 05BE 058E 05C 1 05C4 05C5 05C5 05C9 CMP JAE CX ,RATE UPPER C36 - CHECK FOR RATE BELOW UPPER LIMIT SKIP ERROR 8EEP IF BELOW MAXIMUM MOV DX,0101H ERR_BEEP GET BEEP COUNTS FOR REFRESH ERROR CALL TO POST ERROR BEEP ROUT I NES HALT SYSTEM - BAD REFRESH RATE osce OSCO 05CF 0502 0504 81 F9 F8A7 73 07 C3. C36E: 8A 0101 E8 0000 E F4 CALL HLT C36; 81 F9 F9FO 77 F3 E4 24 A2 2A E6 82 F8 0012 R CO 82 CMP JA CX .RATE LOWER C36E - GET THE INPUT BUFFER CHECK FOR RATE ABOVE LOWER LIMIT GO TO ERROR BEEP IF 8ELOW M J N I MUM (SWITCH SETTINGS) IN ANa MOV STRIP SITS SUB OUT ; ; ; ; I ; ---- --- - - - -- -- -- - - -- ------ - -- - --- -----TEST.llA VERIFY 286 LGOT/SGOT LlOT/SIDT I NSTRUCTI ONS DESCRIPTION LOAD GOT AND lOT REGISTERS WITH AA,55,OO AND VERIFY CORRECT. -------- - --- -- - -- - - - - - - - - - - - ---- --- --- --: ;----0506 OF 01 EO 0509 A9 OOOF 050C 75 34 VERIFY STATUS INDICATE COMPATIBILITY {REAL~ MODE SMSW AX GET THE CURRENT STATUS WORD OB OOFH,OOIH,OEOH AX,OFH ERR_PROT PE/MP/EM/TS BITS SHOULD BE ZERO GO IF STATUS NOT REAL MODE TEST JNZ TEST PROTECTED MODE REG I STERS 050E BO 12 05EO E6 80 MOV OUT 05E2 05E3 05E4 05E7 05EA 05EO 05FO 05F3 05F6 05F8 IE 07 SF 89 B8 E8 88 E8 28 E8 PUSH 05F8 05FC 05FO 05FE 0601 0603 0606 0608 0609 060A 0608 060E FO 9C 56 A9 75 A9 74 FC 9C 58 A9 75 POP MOV MOV MOV OOAO 0003 AAAA 0615 R 5555 0615 R CO 0615 R CALL MOV CALL SUB CALL I ----- ; USE TH I S AREA TO BU I LO TEST PATTERN FIRST PATTERN WRITE NEXT PATTERN WRITE 0 TEST 286 CONTROL FLAGS ; ; PDP AX TEST AX,0200H ERR PROT AX,0400H ERR_PROT JNZ TEST JZ CLO POP AX TEST JNZ AX,0400H ERR_PROT JMP SHORT C37A MOV OB OF + 110001 + + 110002 [BP] OOFH BYTE BX,WORD PTR [BP] BYTE OFFSET CS: 110001 001H OFFSET CS; 110002 BP,SYS lOT LOC ES 026H [BP] OOFH BYTE OX,WORD PTR [81"] BYTE OFFSET CS: 110004 OOIH OFFSET csn10005 LABEL MOV LABEL ORG OB ORG MOV SEGOV DB LGOT TESTl OB 110004 LABEL MOV 110005 LABEL ORG OB ORG ; STORE 6 BYTES OF PATTERN ; LOAD THE ; REGI STER FROM THI S AREA ; LOAD THE GOT ; FROM THE SAME AREA lOT 026H OB 01 0625 26 CX,3 STOSW ~~,SYS_IOT_LOC LIDT BD DOAO 0626 OF 0627 0627 8B 56 00 062A 0627 0627 01 062A TEST OK CONTINUE WRITE TO 286 REGISTERS WRT PAT;MOV REP 0610 26 GO IF NOT PROTECTED MODE REGISTER FAILURE I NSURE NO BREAKOUT OF HALT JMP SEGOV 88 5E 00 I ERR PROT I HLT 1----- SET 0 I RECT I ON FLAG FOR DECREMENT GET THE FLAGS I NTERRUPT FLAG SHOULD 8E OFF GO IF NOT CHECK DIRECTION FLAG GO IF NOT SET CLEAR 0 I RECT I ON FLAG INSURE DIRECTION FLAG IS RESET PUSHF 0400 02 0615 89 0003 0618 F3/ A8 061A BO DOAO 5-46 SET ES TO SAME SEGMENT AS OS ES STO 0610 E8 3D 0612 0612 F4 0613 EB FO 061E 061F 061F 0622 061F 061F 0622 0622 as DI,SYS IOT_LOC CX,3 AX,OAAAAH WRT PAT AX,05555H WRT PAT AX.AX WRT _PAT PUSHF 0200 OF 0400 OA <><><><><><><><> <><><><> <><> CHECKPOINT 12 <><> AL,12H MFG_PORT, AL IBM Perllonal Computer MACRO AlIlIembler TESTI ---- 06/10/65 POWER ON SELF TEST 1997 1996 1999 2000 062A 2001 2002 0620 2003 2004 062E 2005 062F 2006 062F 2007 0632 2008 062F 2009 062F 2010 0632 201 I 0632 2012 2013 0635 2014 2015 0636 2016 0631 20170637 2018 063A 2019 0637 2020 0637 2021 063A 2022 063A 2023 0630 2024 063F 2025 0642 2026 0645 2027 0648 2028 064A 2029 0648 2030 064C 2031 064E 2032 2033 2034 2035 2036 2037 064F 2038 064F 2039 0651 2040 0653 2041 0655 2042 0651 2043 0659 2044 0658 2045 0650 2046 2047 065F 2048 0661 2049 0663 2050 0665 2051 0667 2052 0669 2053 066B 2054 0660 2055 2056 2051 2058 2059 2060 066F 2061 0671 2062 2063 0673 2064 0675 2065 0677 2066 0679 2067 067B 2068 0670 2069 067F 2070 0681 2071 0683 2012 0685 2013 0687 2014 0669 2075 068B 2016 0680 2017 2078 2019 2080 068F 2081 0691 2082 2083 0693 2084 0696 2085 0696 2086 069A 2081 069D 2088 069E 2089 06AO 2090 06A I 2091 2092 2093 2094 06A3 2095 06A5 2096 2097 2098 06A 7 2099 06AA 2100 06AB 2101 06AC 2102 06AE 2103 06Bl 2104 2105 06B4 2106 0685 2107 06B6 2108 0687 2109 2110 ;----BO 08AO 26 OF n0007 88 4E 00 110006 0 I BD D6A5 26 OF nOOOA 034600 11000B 0I BF DOAO 8B 05 89 0005 BE D8AO 26: 38 04 75 C8 46 46 E2 F7 C3 C37B: ; 1-20 06-10-a5 VerlllOn 2.00 (POST) READ AND VERIFY 286 REGISTERS MOV SEGOV DB SlOT DB LA8EL MOV LABEL ORG DB ORG MOV SEGOV DB SGOT DB LABEL ADD LABEL DRG DB ORG MDV MDV MOV MOV CMP JNZ BP,GDT LOC E5 026H [BP] OOFH 8YTE CX, [8P) INC INC 51 51 LOOP RET C37B ; STORE THE REG I STERS HERE ; GET THE IDT REGI STERS BYTE OFFSET CS: 110007 OOIH OFFSET CS: 710008 BP,GDT LOC+5 E5 026H [BP) OOFH BYTE AX, [BP] GET THE GOT REG I STERS BYTE OFFSET CS: ?1000A OOIH OFFSET CS: 11000B ol,SYS lOT LOC AX, [OIT CX,5 S I ,GOT LOC AX.ES:Tsl} ERR PROT GET THE PATTERN WR I TTEN CHECK ALL REG I STERS POINT TO THE BEGINNING HALT I F ERROR PO I NT TO NEXT WORD CONT I NUE TILL DONE - - - - - - - ----- -- - -- - - --- - - - - - -- --- - - - -- - - - ---- - - ----- - - --- ; INITIALIZE THE 8259 INTERRUPT #1 CONTROLLER CHIP: ~;;~;---------------------------------------------------- 2A E6 BO E6 E8 80 E6 EB CO Fl I I 20 00 08 21 00 SUB OUT MOV OUT JMP MOV OUT JMP BO E6 EB BO E6 EB BO E6 04 21 00 01 21 00 FF 21 MOV OUT JMP MOV OUT JMP MOV OUT ; ; ; AL,AL X287+I,AL AL,IIH INTAOO.AL '.2 '.2 '.2 '.2 ICWI EDGE. MASTER, SETUP ICW2 - AL,a INTAOI.AL ICW4 I NTERRUPT TYPE a (8-F) 110 DELAY AL,04H INTAOI,AL I AL,OIH INTAOI,AL SETUP I CW3 - MASTER LEVEL 2 110 DELAY SETUP ICW4 - MASTER,8066 MODE 110 DELAY MASK ALL I NTERRUPTS OFF (V IDEO ROUT I NE ENA8LES INTERRUPTS) AL,OFFH INTAOI,AL - - -- --- ------- - ------- ------ - - ---------- - -- ---- - - - ------THE 6259 INTERRUPT #2 CONTROLLER CHIP : -- - - - - - --INITIALIZE ------ --- - --- -- - - - - ----- - - - - -- - - - -- - - - - --- - - - - -MOV OUT AL,I3H MFG_PORT ,AL BO E6 EB BO E6 BO EB E6 E8 BO E6 EB BO E6 MOV OUT JMP MOV OUT MOV JMP OUT JMP MOV OUT JMP MOV OUT AL,IIH INTBOO,AL II AD 00 70 AI 02 00 AI 00 01 AI 00 FF AI ;----- AL,OFFH INTBOI,AL SET UP THE CX,76H SLAVE ICW4 INTERRUPT TYPE 70 SETUP ICW3 - SLAVE LEVEL 2 I/O DELAY SETUP JCW4 - 6066 MODE, ( 70-7F) SLAVE I NTERRUPTS OFF MASK ALL INTERRUPT <><> <><><><><><><><><><> <><> CHECKPOINT 14 <><> FILL ALL INTERRUPT LOCAT IONS FIRST INTERRUPT LOCATION SET (ES) ALSO GET ADDRESS OF I NTERRUPT OFFSET PLACE I N I NTERRUPT VECTOR LOCAT I ON GET THE CURRENT CODE SEGMENT PLACE CODE SEGMENT I N VECTOR LOCAT I ON 01,01 ES,DI AX,OFFSET OIl AX,CS 03 ESTABLISH BIOS SUBROUTiNE CALL INTERRUPT VECTORS BO 15 E6 80 MOV OUT AL.15H MFG_PORT ,AL BF 0040 R OE IF 8C D8 8E 0010 E B90010 MOV PUSH POP MOV MOV MOV 01 ,OFFSET ~VIDEO INT CS OS AX,DS • SI,OFFSET VECTOR TABLE+16 CX,I6 - MOVSW INC INC LOOP DI 01 D3A 03A: EDGE, INTERRUPT VECTORS TO TEMPORARY AL,14H MFG_PORT, AL ;----- - 110 DELAY MOV OUT C8 ICWI 110 DELAY SETUP JCW2 - INTBO' ,AL AL,OIH INTBOI,AL MDV SUB MOV MOV STOSW MOV STOSW LOOP Fl I '.2 '.2 '.2 '.2 B9 2B 8E B8 AB 6C AB E2 03: <><><><><><><> <> <><><><> <><> CHECKPO I NT 13 <><> AL,INT TYPE INTBO'-;-AL AL.02H BO 14 E6 80 AS 47 47 E2 FB - 110 DELAY BO 13 E6 80 0078 FF C7 0000 E ; RESET MATH PROCESSOR <><><><><><><><><><><><> <><> CHECKPO I NT 15 <><> SET VIDEO INTERRUPT AREA SET UP ADDRESS OF VECTOR TA8LE SET AX=SEGMENT ;START WITH VIDEO ENTRY MOVE VECTOR TABLE TO LOW MEMORY SK I P SEGMENT PO INTER TESTl 5-47 IBM Peraonal Computer MACRO Aaaembler TESTI ---- 06/10/85 POWER ON SELF TEST 2111 2112 2113 2114 2115 2116 2117 2118 0689 2119 2120 06BC 2121 06BE 2122 2123 2124 2125 06CO 2126 06C2 2127 06C5 2128 06C7 2129 2130 06C9 2131 06CB 2132 06CE 21330600 2134 2135 0602 2136 2137 2138 2139 0604 2140 0606 2141 2142 0608 2143 0608 2144 06DE 2145 06EO 2146 06E2 2147 06E5 2148 2149 2150 2151 06El 2152 06EA 2153 06EO 2154 06F3 2155 2156 06F5 2151 06Fl 215806F9 2159 06F9 2160 06FB 2161 06FB 2162 06FO 2163 2164 0100 2165 0102 2166 0104 2167 0106 2168 2169 0108 2110 010A 2111 0100 2112 010F 21130111 21140113 21150115 21160111 2117 0719 2118 011B 2119 OliO 2180 0120 2181 0122 2182 0124 2163 0121 2184 0129 2185 2186 2161 2188 012B 2189 012E 2190 0131 2191 0733 2192 0135 2193 2194 2195 2196 0138 2191 0138 2198 073B 2199 013E 2200 0740 2201 2202 0142 2203 0744 2204 0746 2205 0149 2206 0149 2201 014B 2208 2209 2210 2211 0740 2212 014F 2213 0151 2214 2215 2216 22110153 2218 0155 2219 2220 0157 2221 015A 2222 2223 0150 2224 0160 5-48 Version 2.00 (POSn 1-21 06-10-85 TEST.12 VERIFY CMOS CHECKSUM/BATTERY OK OESCR I PT I ON OETERM I NE IF CONF I G RECORD CAN BE USED FOR INITIALIZATiON. : : : : : ---- ------------------ -----------------E8 0000 E ASSUME CALL OS:OATA DDS BO 16 E6 80 MOV OUT AL,16H MFG_PORT ,AL :----- SET THE DATA SEGMENT '<>'<> '<>'<> '<>'<>'<>'<>'<> '<> '<> '<> '<>'<> CHECKPO I NT 16 IS THE BATTERY LOW THIS POWER UP? BO E8 A8 74 80 0000 E 80 DB MOV CALL TEST JZ AL, CMOS REG O+NM I CMOS REAO AL,10000000B CMOS 1 A 80 E8 A8 74 8E 0000 E 80 15 MOV CALL TEST JZ AL, CMOS 0 I ACi+NM I CMOS READ AL,BAD BAT CMOS I - GET THE OLD STATUS FROM DIAGNOSTIC STATUS BYTE HAS CUSTOMER SETUP BEEN EXECUTED? GO CHECK CHECKSUM IF YES JMP SHORT CMOS4 CONT I NUE WITHOUT CONF I GURAT I ON E8 64 ; ; CHECK BATTERY CONDiTiON READ THE BATTERY STATUS IS THE BATTERY LOW? ERROR IF YES SET DEFECTIVE BATTERY FLACi 80 17 E6 80 88 E8 OC 86 E6 EB 8E8E 0000 E 80 C4 0000 E 51 88 E6 61 15 8E6E 0000 E 3E 0012 R 1234 04 24 10 EB 02 CMOSIA: MOV OUT AL,11H MFG_PORT ,AL MOV CALL AX,X·{CMOS DIAG+NMI! CMOS READ AL,BAO BAT AL,AH CMOS WR ITE SHORT CMOS4 OR XCHCi CALL JMP ;----- VERIFY CHECKSUM CMOS I: MOV CALL CMP JNZ ANa JMP A: SUB CMOS 1 B: XCHG CALL '<>'<>'<> '<> '<> '<>'<>'<>'<> '<>'<>'<> 17 '<>'<> '<>'<> CHECKPOINT CMOS DIAGNOSTIC STATUS BYTE GET THE CURRENT STATUS SET THE DEAD BATTERY FLAG SAVE OUTPUT THE STATUS GO TO MINIMUM CONFIGURATION AX,X·(CMOS DIAG+NMI) CMOS READ IIIRESET FLAG, 1234H CMOS I_A CLEAR OLD STATUS GET THE CURRENT STATUS IS THIS A SOFT RESET GO IF NOT AL,W MEM SIZE SHORT CMOS I_B CLEAR ALL BUT THE CMOS/POR MEMORY SIZE AL,AL CLEAR STATUS CMOSI 2A CO 86 C4 E8 0000 E 2B 2B BI B5 DB C9 90 AE 8A E8 2A 03 FE 3A 15 DB CMOS2: BO E8 8A BO E8 3B 74 CI 0000 E E4 08 CI E9 FI DB 10 AE 0000 E EO AF 0000 E C3 00 ;----- SET CMOS CHECKSUM ERROR B8 E8 DC 86 E8 8E8E 0000 E 40 C4 0000 E CMOS3: MOV CALL 14 SUB SUB MOV MOV BX,BX CX,CX CL,CMOS 01 SKETTE+NM I CH,CMOS=CKSUM_HI +NM I MOV CALL SUB AOO INC CMP JNZ AL,CL CMOS READ AH,AH BX,AX OR JZ MOV CALL MOV MOV CALL CMP JZ OR XCHG CALL IF POWER ON RESET SAVE THE CURRENT STATUS SET START OF CMOS CHECKSUMEO AREA SET END OF CMOS CHECKSUMED AREA + 1 (FIRST BYTE OF CHECKSUM! ADDRESS THE BEGINNING INSURE AH=O ADD TO CURRENT VALUE PO I NT TO NEXT BYTE ADDRESS I N CMOS FINISHED? (AT CHECKSUM BYTE HIGH) GO IF NOT BX MUST NOT BE 0 CMOS BAD IF CHECKSUM=O GET THE CHECK SUM HIGH BYTE FIRST BYTE OF CHECKSUM SAVE IT SECOND BYTE OF CHECKSUM CL CH,CL CMOS2 BX,BX CMOS3 AL,CMOS CKSUM HI+NMI CMOS READ AH,AL AL,CMOS CKSUM LO+NMI CMOS READ AX,BX CMOS4 I S THE CHECKSUM OK GO IF YES AX,X·{CMOS DIAG+NMI) CMOS READ AL ,BAD CKSUM AL,AH CMOS_WRITE ADDRESS DIAGNOSTIC STATUS GET THE CURRENT STATUS SET BAD CHECKSUM FLAG SAVE IT SET FLAG I NSURE CMOS 0 I V I DERS SET CMOS4: B8 E8 24 75 8A8A 0000 E OF 01 BO 26 86 C4 E8 0000 E MOV CALL ANa JNZ AX,X·{CMOS REG A+NMI! CMOS READ AL,OOFH CMOS9 ADDRESS CMOS REGISTER A GET CURRENT 0 I V I SOR S LOOK AT PERIODIC RATE BITS EX I T I F SET TO SOMETH I NG USEFUL MOV XCHG CALL AL ,26H AL,AH CMOS_WR ITE ELSE SET THE STANDARD DEFAULT USED BY BIOS FOR THE 916.56 US RATE FOR THE PER I 00 I C CLOCK MOV OUT AL,18H MFG_PORT, AL CMOS9: BO 18 E6 80 ;----- '<>'<> '<>'<>'<> '<>'<>'<>'<>'<>'<>'<> 18 '<>'<> '<>'<> CHECKPO I NT ENABLE PROTECTED MODE E4 61 DC OC E6 61 OUT BO 19 E6 80 MO' OUT AL,19H MFG_PORT ,AL B8 018F E8 0000 E MOV CALL AX, I ·H+ (CMOS SHUT DOWN+NM I ! : SET THE RETURN ADDRESS FOR CMOS_WRITE I THE FIRST SHUTDOWN RETURN ADDRESS BC 0000 8E 04 MO' MO' SP,POST SS SS, SP - IN OR AL,PORT B AL, RAM PAR OFF PORT_B:AL - SET RETURN ADDRESS BYTE TESTl DISABLE MEMORY AND I/O PARITY CHECKS IN CMOS '<>'<>'<>'<>'<>'<>'<>'<>'<>'<>'<> '<> '<>'<> CHECKPO I NT 19 '<>'<> ; SET STACK FOR SYSINITI IBM Personal Computer MACRO Assembler TESTI ---- 06/10/85 POWER ON SELF TEST 2225 0162 2226 0165 2221 2228 2229 0166 2230 016.1. 2231 2232 2233 2234 016C 2235 016E 2236 016F 2231 0115 2238 011.1. 2239 0170 2240 011F 2241 2242 2243 2244 2245 2246 2241 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 0182 2260 0185 2261 0168 2262 2263 016.1. 2264 0180 2265 0190 2266 2261 2266 2269 0193 2270 0194 2211 2212 2273 2214 0196 2215 2276 2217 2216 019C 2219 2280 2261 2282 01AI 2283 01.1.6 2284 2285 01AC 2286 01AE 2281 2288 01BO 2289 2290 2291 2292 0183 2293 01B3 2294 0185 2295 01B6 2296 01B9 2291 018B 2298 2299 018E 2300 018E 2301 2302 2303 2304 01C 1 2305 2306 2301 2308 01C5 2309 01CA 2310 01CC 2311 01eF 2312 2313 2314 23150702 2316 0702 2311 0104 2318 0701 2319 0709 2320 070C 2321 070E 2322 OlE 1 2323 01E4 2324 01E6 2325 2326 01E8 2321 01E9 2328 01EB 2329 2330 2331 2332 01EC 2333 01F2 2334 01F3 2335 2336 2331 2338 07F5 1-22 06-10-85 Version 2.00 (POST) BC 8000 E8 0000 E "OV BO I A E6 80 "OV ; CALL THE DESCRIPTOR TABLE BUILDER AND REAL-TO-PROTECTED MODE SWITCHER CALL OUT <><><><><><><><><><><><> <><> CHECKPOINT lA <><> AL,IAH MFG _PORT, AL SET TEMPORARY STACK 6A IF Cl C6 BE 8E BC 06 PUSH POP 06 005.1. 0000 06 005C 00 0056 06 FFFD "OV , SET (OS II SELECTOR TO GOT SEGMENT "OV "OV "OV MOV ; ; ; ----- -- - -- - - - ---- - - - - -- - - --- -- - - - ----- --- - - - - ---- - ----- - - ---- -- - -- --- ---- -- --TEST. 13 PROTECTED MODE TEST AND MEMORY SIZE DETERMINE --> 640K I (0 ; ; DESCR I PT I ON: ; ; ; ; ; ; THIS ROUTINE RUNS IN PROTECTED MODE IN ORDER TO.ADDRESS ALL OF STORAGE. IT CHECKS THE MACHINE STATUS WORD (MSW} FOR PROTECTED MODE AND THE BASE MEMORY SIZE IS DETERMINED AND SAVED. BIT 4 OF THE CMOS DIAGNOSTIC STATUS BYTE IS SET IF 512K --> 640K MEMORY IS INSTALLED. OUR I NG A POWER UP SEQUENCE THE MEMORY SIZE DETERM I NE 1 S DONE WITH PLANAR AND I/O PARITY CHECKS DISABLED. DURING A SOFT RESET THE MEMORY SIZE DETERMINE WILL CHECK FOR PARITY ERRORS. ;----- F4 EB FD GET THE MACHINE STATUS WORD AX SHUT_S: MOV CALL AX, S-H+ (CMOS SHUT DOWN+NM I). ; SET THE RETURN ADDRESS CMOS WR I TE ; AND SET SHUTDOWN 6 PROC:SHUTODWN ; CAUSE A SHUTDOWN ; ----- V I RTUAL MODE ERROR HALT SHUTS: HLT OF 0 I EO A9 000 I 75 OC B8 086F E6 0000 E E9 0000 E INSURE PROTECTED MODE SMSW OB TEST JNZ J"P J"P ;----- OOFH. 00 I H. OEOH ~~I(~~TUAL_ENABLE ARE WE SHUT8 ; I N PROTECTED MODE ERROR HALT 64K SEGMENT LIMIT Cl 06 0046 FFFF ;----- CPLO. DATA ACCESS RIGHTS MOV C6 06 0040 93 ;----- BYTE PTR OS: (ES_TEMP.DATA_ACC_RIGHTS) ,CPLO_DATA_ACCESS START WITH SEGMENT ADDRESS 01-0000 (SECOND MK) C6 06 004C 01 Cl 06 004A 0000 MOV MOV BYTE PTR OS: (ES TEMP.BASE HI BYTE) .OtH DS:ES_TEMP.BASE:LD_WORD,OH- BO IB E6 80 MOV OUT AL, tBH MFG_PORT • AL 88 0040 "OV ;----- 6A 01 E8 14 E9 48 0102 R 03 0810 R 83 C3 40 <><> <><><;>0<><><><><><><> <><> CHECKPO I NT 1B <><> SET THE FIRST 64K DONE START STORAGE SIZE/CLEAR NOT DONE: PUSH POP CALL JZ J"P ES - NOT FIN: .1.00 FE 06 004C INC (OXOOOO) BLOCK BYTE PTR OS: (ES_TEMP.BASE_HI_BYTE\ CHECK FOR ENO OF FIRST 640K CMP ..JNZ CALL ..JMP 3E 004C OA El 0840 R 0810 R ;----- 28 FF 88 AA55 8B C8 26: 89 05 80 OF 26: 88 05 26: 89 05 33 C 1 15 65 1E 6A 16 IF POINT ES TO DATA PO I NT TO SEGMENT TO TEST DO THE FIRST 64K CHECK IF TOP OF MEMORY 8UMP MEMORY COUNT BY 64K DO NEXT 64K 80 15 E8 E9 : ; I 1 BYTE PTR ES TEMP HOW BIG NOT-FIN DONE (END OF BASE MEMORY) BYTE PTR OS: IES TEMP. BASE HI 8YTE) ,OAH NOT DONE ;-GO-IF NOT HOW-BIG END ; GO SET MEMORY SIZE DONE- FILL/CHECK LOOP HOW BIG: SUB "OV MOV JNZ 01.01 AX,OAA55H CX,AX ES; [01] ,AX AL.OFH AX.ES:[DI] ES; [01] ,AX AX,CX HOW_BIG_END PUSH PUSH BYTE PTR RSDA PTR "OV "OV MOV "OV XOR POP ; I I ; ; ; ; ; as os TEST PATTERN SAVE PATTERN WRITE PATTERN TO MEMORY PUT SOMETH I NG IN AL GET PATTERN INSURE NO PARITY I/O CHECK COMPARE PATTERNS GO END I F NO COMPARE POINT TO SYSTEM DATA AREA GET (OS;) - IS THIS A SOFT RESET e"p 81 3E 0012 R 1234 IF 15 36 POP JNZ 26: Cl 05 0101 MOV PRESET FLAG, 1234H as SOFT RESET RESTORE OS GO I F NOT SOFT RESET - HOW_8I G_2 INSURE NO PARITY WITH PARITY BITS OFF WORD PTR ES:[DI].010IH ; TURN OFF BOTH PARITY 8ITS TEST1 5-49 IBM Personal Computer MACRO A55embler TESTI ---- 06/10/85 POWER ON SELF TEST 2339 2340 01FA E4 61 2341 01FC DC OC 2342 01FE E6 61 2343 0800 24 F3 2344 0802 E6 61 2345 0804 6A FF 2346 0806 58 2341 0801 26: 88 05 2348 2349 080A E4 61 2350 080C 24 CO 2351 080E 26: 89 05 23520811 75 3A 2353 2354 2355 2356 0813 26: C7 05 FFFF 2357 DB 18 26: 89 05 2358081950 2359 081C E4 61 2360 081E 24 CO 2361 0820 26: 89 05 2362 0823 58 2363 0824 75 21 2364 0826 3D FFFF 2365 0829 75 22 2366 2367 2368 2369 0828 2370 0828 28 CO 2311 0820 89 8000 2312 0830 F3/ AS 2313 2314 0832 IE 2375 0833 06 2316 0834 06 2317 0835 IF 2378 0836 89 BOOO 2319 0839 28 F6 2380 0838 F3/ AD 2381 0830 28 FF 2382 083F E4 61 2383 0841 24 CO 2384 0843 26: C1 05 0000 2385 0848 07 2386 0849 IF 2387 084A 15 01 2388 2389 084C C3 2390 2391 0840 2392 0840 9C 2393 084E 60 1C 2394 0850 E6 80 2395 2396 2397 2398 0852 88 8383 2399 0855 E8 0000 E 2400 0858 OC 80 2401 085A 81 F8 0200 2402 085E 77 02 2403 0860 24 7F 2404 0862 2405 0862 86 C4 2406 0864 E8 0000 E 2407 2408 0867 6A 18 2409 0869 1F 2410 086A 89 IE 0013 R 2411 OB6E 90 2412 086F C3 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 0870 2427 0870 6A 08 2428 0872 IF 2429 2430 2431 2432 0873 C6 06 004C 10 2433 087B C7 06 004A 0000 2434 2435 087E 80 10 2436 0880 E6 80 2437 2438 0882 28 08 2439 2440 2441 2442 0884 2443 0884 6A 48 2444 0886 07 2445 0887 E8 08A3 R 2446 088A 74 03 2447 2448 088C £9 092A R 2449 2450 088F 83 C3 40 2451 2452 5-50 TESTl Ver5ion 2.00 (POST) 1-23 06-10-85 PUSH AL,PORT B AL, RAM PAR OFF PORT B~AL AL,RAM PAR ON PORT B~AL BYTE-PTR OFFH POP MOV AX AX,ES: [01] [N OR OUT ANa OUT [N AND MOV JNZ TOGGLE PAR[TY CHECK ENABLES PLACE OFFFFH IN STACK (BUS B[TS ON) DELAY - CAUSING BUS BITS ON CHECK PAR I TY CHECK FOR PLANAR OR AL,PORT B AL ,PAR (TY ERR ES:[O[],AX HOW_8I G_END I/O PARITY CHECK CLEAR pass IBLE PAR I TY ERROR GO [F PLANAR OR I/O PARITY CHECK CHECK ALL 81 TS WR [TE OK MOV MOV WORD PTR ES:[DI],OFFFFH AX,ES:[D[] PUSH AX AL,PDRT B AL.PAR[Ty ERR ES:[D[] ,AX AX HOW BIG END AX,OFFFFH HOW_BIG_END [N AND MOV POP JNZ eMP JNZ TURN ON ALL 8 I TS CHECK FOR FFFFH SAVE RESULTS CHECK FOR PLANAR OR [10 PAR I TY CHECK CLEAR POSSIBLE PARITY ERROR GET RESULTS GO I F PAR I TY CHECK CHECK 64K BLOCK FOR PAR [TY CHECK HOW BIG 2: -SU8 MOV REP PUSH PUSH PUSH POP MOV SUB REP SUB [N AND MOV POP POP JNZ AX,AX CX,2000H·4 STOSW WR [TE ZEROS SET COUNT FOR 32K WORDS FILL 32K WORDS OS ES ES OS CX.2000H·4 S [, S I LODSW 01,01 AL,PORT B AL,PARITY ERR WORD PTR ES: [DI].O ES CLEAR POSSIBLE PARITY ERROR RESTORE SEGMENTS HOW_8IG_END GO IF PLANAR OR GET ES TO OS SET COUNT FOR 32K WORDS SET TO BEG I NN I NG OF BLOCK CHECK FOR PLANAR OR 110 PAR[TY CHECK as [10 PAR[TY CHECK RET HOW BIG END: -PUSHF MDV OUT ;----- I SAVE THE CURRENT FLAGS <> <> <><> <> <> <> <> <> <> <> <> <><> CHECK PO I NT I C <><> AL, tCH MFG_PORT ,AL SET OR RESET 512 TO 640 [NSTALLED FLAG MOV CALL OR CMP JA AND AX, X· (CMOS I NFO I 28+NM I ) CMOS READ AL,M640K BX, 512 K640 AL, NOT M640K SET IRESET 640K STATUS FLAG GET THE D[AGNOSTIC STATUS XCHG AL,AH CMOS_WR I TE SAVE THE STATUS RESTORE THE STATUS 8YTE PTR RSDA PTR OS @MEMORY_SIZE,BX RESTORE THE DATA SEGMENT CHECK MEMORY SIZE SET FLAG FOR 512 -> 640 [NSTALLEO K640 : CALL PUSH PDP MOV SAVE MEMORY SIZE RESTORE THE FLAG REG I STER POPF RET ; --- -- --------------------- -----I ----------------- -- - ------------- - ---- TEST. 13A PROTECTED MODE TEST AND MEMORY SIZE DETERM I NE (ABOVE 1024K ) ; ; ; ; ; ; ; DESCRIPTION: THIS ROUTINE RUNS IN PROTECTED MODE IN ORDER TO ADDRESS ABOVE I MEG. THE MEMORY SIZE IS DETERMINED AND SAVED IN CMOS. OUR I NG A POWER UP SEQUENCE THE MEMORY SIZE DETERM I NE J S DONE WITH PLANAR AND I/O PARITY CHECKS DISABLED. DURING A SOFT RESET THE MEMORY SIZE DETERMINE W[LL CHECK FOR PARITY ERRORS. DONE: PUSH PDP BYTE PTR GOT PTR OS - START WITH SEGMENT ADDRESS MOV MOV ; 10-0000 PO I NT OS TO THE DESCR I PTOR TABLE (ONE MEG AND ABOVE) BYTE PTR OS: (ES TEMP .BASE H I BYTE), I OH DS:ES_TEMP.BASE:::\O_WORO,OH- MOV OUT AL, tDH MFG_PORT, AL SUB BX,BX <> <> <><><><><><><> <> <> <> <><> CHECKPO[NT 10 <><> START WITH COUNT 0 ST ART STORAGE S I ZEI CLEAR NOT DONE I: PUSH DONEA: BYTE PTR ES TEMP ES CALL JZ HOW BIGI DONEA JMP DONE! GO ADD BX,16·4 BUMP MEMORY COUNT BY 64K DO NEXT 64K - POINT ES TO DATA POINT TO SEGMENT TO TEST DO THE FIRST 64K CHECK I F TOP POP (XXOOOO) BLOCK IF TOP IBM Personal ComPlJter MACRO Assembler TEST! ---- 06/10/85 POWER ON SELF TEST 2453 2454 0892 FE 06 004C 2455 2456 2457 2458 0896 80 3E 004C FE 2459 0898 75 E7 2460 0890 E8 0917 R 2461 08AO E9 092A R 2462 2463 2464 2465 08A3 2466 08A3 28 FF 2467 D8A5 88 AA55 2468 D8A8 88 C8 2469 D8AA 26: 89 05 2470 08AD 80 OF 2471 08AF 26: 8805 2472 0862 26: 89 05 2473 0885 33 CI 2474 08B7 75 5E 2475 2476 2477 2478 0889 IE 2479 088A 6A 18 2480 088C IF 2481 088081 3E 0072 R 1234 2482 08C3 IF 2483 08C4 75 2F 2484 2485 2486 2487 08C6 26: C7 05 0101 2488 08C8 6A FF 2489 08CO 58 2490 08CE 26: 8B 05 2491 2492 080 I E4 61 2493 0803 24 CO 2494 OelO5 26: 89 05 2495 0808 75 3D 2496 2497 2498 2499 08DA 26: C7 05 FFFF 2500 080F 6A 00 250 I 08E 1 58 2502 08E2 26: 88 05 2503 08E5 50 2504 08E6 E4 61 2505 08E8 24 CO 2506 08EA 26: 89 05 2507 08EO 58 2508 08EE 75 27 2509 08FO 3D FFFF 2510 08F3 75 22 251 I 2512 2513 2514 08F5 2515 08F5 2B CO 2516 08F7 B9 8000 2517 08FA F3/ AB 2518 2519 2520 2521 08FC IE 2522 08FD 06 2523 08FE 06 2524 08FF 1F 2525 0900 B9 8000 2526 09113 2B F6 2527 0905 F3/ AD 2528 0907 2B FF 2529 0909 E4 61 2530 090B 24 CO 2531 0900 26: C7 05 0000 2532 0912 07 2533 0913 IF 2534 0914 75 01 2535 2536 0916 C3 2537 25380917 2539 0917 BO IE 25400919 E6 80 2541 2542 2543 2544 091B BO BO 2545 0910 8A E3 2546 091 F E8 0000 E 2547 0922 BO BI 2548 0924 8A E7 2549 0926 E8 0000 E 2550 0929 C3 2551 2552 2553 2554 092A BO IF 2555 092C E6 80 2556 092E C6 06 004C 00 2557 0933 2B FF 2558 0935 BA FFFF 2559 0938 E8 0967 R 2560 0938 28 02 2561 2562 0930 C6 06 004C 08 2563 0942 E8 0967 R 2564 0945 C6 06 004C 10 2565 094A E8 0967 R 2566 0940 C6 06 004C 20 INC ;----- BYTE PTR OS: (ES_TEMP.BASE_HI_BYTEI CHECK FOR TOP OF MEMORY eMP JNZ CALL JMP ;----- 1-24 06-10-85 Version 2.00 (POST) (FEOOOO) BYTE PTR OS: (ES TEMP.BASE HI BYTEI,OFEH NOT DONEI HOW-BIG ENOl DONE I - LAST OF MEMORY? GO IF NOT GO SET MEMORY SIZE FILL/CHECK LOOP HOW BIGI: SUB MaY MaY MaY MaY MaY MaY XOR JNZ OI,DJ AX,OAA55H CX,AX ES:[OI),AX AL,OFH AX,ES: [01 1 ES:[ol),AX AX,CX HOW_BIG_ENoI TEST PATTERN SAVE PATTERN SEND PATTERN TO MEMORY PUT SOMETH I NG IN AL GET PATTERN INSURE NO PAR ITY I fO CHECK COMPARE PATTERNS GO END I F NO COMPARE IS THI S A SOFT RESET PUSH PUSH pop eMP pop JNZ as as as BYTE PTR RSOA PTR POINT TO SYSTEM DATA AREA ilIRESET FLAG,I234H SOFT RESET RESTORE OS GO I F NOT SOFT RESET - - HOW_BIG_2A CHECK PARITY WITH PARITY BITS OFF MaY PUSH pop MaY WORD PTR ES:[Dlj,OIOIH BYTE PTR OFFH AX AX,ES:[DI1 TURN OFF BOTH PAR I TY 8 I TS PLACE OFFFFH IN STACK (BUS BITS ON I DELAY - CAUSIN(; BUS BITS ON CHECK PAR I TY IN AL,PORT B AL, PAR !'TY ERR ES:[OI),AX HOW_BIG_ENOl CHECK FOR PLANAR OR ANa MaY JNZ liD PARITY CHECK CLEAR POSSIBLE PARITY ERROR GO IF PLANAR OR I/O PARITY CHECK CHECK ALL BITS MaY PUSH pop MaY PUSH IN ANa MaY pop JNZ eMP JNZ WORD PTR ES: [011 ,OFFFFH BYTE PTR 0 ; AX AX,ESI (011 ; AX AL,PORT B AL,PARITY ERR ES: [Oll,AX AX HOW BIG ENOl AX,OFFFFH HOW_B I G_ENO I TURN ON ALL BITS PLACE OOOOOH IN STACK (BUS BITS OFF) DELAY - CAUSING BUS BITS OFF CHECK FOR FFFFH SAVE RESULTS CHECK FOR PLANAR OR 110 PARITY CHECK CLEAR POSSIBLE PARITY ERROR GET RESULTS IF PLANAR OR I/O PARITY CHECK (;0 CLEAR 64K BLOCK OF MEMORY HOW BIG 2A: -SUB MaY REP AX,AX CX,2000H·4 STOSW ; WR I TE ZEROS ; SET COUNT FOR 32K WORDS ; FILL 32K WORDS CHECK 64K BLOCK FOR PARITY CHECK PUSH PUSH PUSH pop MaY SUB REP SUB IN ANa MaY pop pop JNZ (VALID TEST ~URING SOFT RESET ONLY) as ES ES GET ES TO OS CX,2000H·4 SET COUNT FOR 32K WORDS as S I, S I LOOSW 01,01 AL ,PORT 8 AL,PARITY ERR WORD PTR ES:[Olj,o SET TO BEG I NN I NG OF BLOCK CHECK FOR PLANAR OR I/O PAR I TY CHECK ES CLEAR POSS I BLE PAR I TY ERROR RESTORE SEGMENT HOW_BI G_ENDI GO as IF PLANAR OR 110 PARITY CHECK RET HOW BIG ENOl: -MOV OUT ;----- AL,IEH MFG_PORT, AL <><><> <><><> <><><><><><> <><> CHECKPO I NT ! E <><> SET EXPANSION MEMORY SIZE DETERMINED IN CMOS MaY MaY CALL MaY MaY CALL. AL,CMOS U M S LO+NMI AH,BL - - - CMOS WR I TE AL,CMOS U M S HI+NMI AH,BH - - - CMOS_WR I TE ADDRESS LOW BYTE GET LOW MEMORY SIZE SET LOW 8YTE ADDRESS H I BYTE GET THE HIGH MEMORY SIZE PLACE I N CMOS RET ;----DONE!: TEST ADDRESS LINES 19 MOV OUT MaY SUB MaY CALL SUB MOV CALL MOV CALL MOV 23 AL,IFH <><><><><><><><><><><><> MFG PORT, AL , < > < > CHECKPO I NT 1F <><> BYTE PTR OS: (ES TEMP.BASE HI BYTE! ,OOH 01,01 I-SET LOCATION POINTER TO ZERO OX,OFFFFH ; WRITE FFFF AT ADDRESS 0 500 OX,OX ; WRITE 0 BYTE PTR OS: (ES TEMP.BASE HI BYTE) ,08H SOO BYTE PTR OS: (ES TEMP. BASE H I BYTE), IOH SOO BYTE PTR OS: (ES_TEMP.BASE_HI_BYTE! ,20H TEST1 5-51 ~ersion IBM Personal <;:omputer MACRO Assembler TESTI ---- 06/10/85 POWER ON SELF TEST 2561 2568 2569 2510 2511 2572 2573 2514 2575 2516 2511 2578 2579 2580 2581 2582 2583 2584 2585 2586 2581 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 26 I 3 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2621 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2615 2616 2677 2678 2679 2680 0952 0955 095A 0950 0962 E8 C6 E8 C6 E8 0965 E8 0961 R 06 004C 40 0967 R 06 004C 80 0961 R CALL MOV CAL..L MOV CALL 18 0967 0961 6A 48 0969 01 096A 26: 89 1-25 06-10-85 2.00 (POSn SOD BYTE PTR OS: (ES TEMP.BASE HI BYTE) ,40H SOD BYTE PTR OS: (ES TEMP.BASE HI 8YTE) ,80H SDO SHORT SD2 TEST PASSED CONT I NUE BYTE PTR ES TEMP E5 ES: [OI],DX POINT ES TO DATA PO I NT TO SEGMENT TO TEST WRITE THE PATTERN BYTE PTR ES TEMP E5 WORD PTR ES:[DI],OFFFFH POINT ES TO DATA POINT TO SEGMENT TO TEST DID LOCATiON 0 CHANGE? CONT I NUE I F NOT GO HALT IF YES SDO: PUSH POP MOV 15 0960 C6 06 004C 00 0912 0974 0915 0919 0978 091E 091E 6A 48 01 26: 83 3D FF 74 03 E9 OHIA R 091F 0981 0963 0985 0987 0989 0988 0980 BO E6 E4 OC E6 24 E6 E9 PUSH POP eMP JZ JMP 501 SHUT_8 SOl; C3 RET CAUSE A SHUTDOWN 20 80 61 OC 61 F3 61 0000 E MOV OUT SD2: IN OR OUT AND OUT JMP AL,20H MFG PORT, AL AL..,PORT B AL",RAM' PAR OFF PORT B~AL AL,RAM PAR ON PORT B~AL PROC=SHUTDOWN <> <><> <><><> <> <><> <><> <> <><> CHECKPOINT 20 <><> TOGGLE PAR I TY CHECK ENABLES CAUSE A SHUTOOWN (RETURN V I A JUMP) - - --------- ------------; 0990 0992 0994 0991 0999 BO E6 BC 8E BC 21 80 099C 099E 09AO 09A3 2B FF 8E C7 B8 0000 E A8 RETURN SHUT1: 1 _ FROM SHUTDOWN MOV OUT MOV MOV MOV -~-~ R 04 0400 R AL,21H MFG PORT ,AL SP, ABSO SS, SP SP, OFFSET @TOS <> <> <><> <> <> <><> <><> <> <> 21 <><> <><> CHECKPOINT SET REAL MODE STACK SET 0 I V I DE 0 VECTOR OFFSET SUB "OV MOV 01,01 ES,DI AX.oFFSET DII POINT TO FIRST INTERRUPT LOCATION SET ES TO ABSO SEGMENT GET ADDRESS. OF INTERRUPT OFFSET PLACE OFFSET IF NUL..L HANDLER I N VECTOR ODS SET UP THE REAL DATA AREA STOSW 09A4 E8 0000 E CALL GET THE CONFIGURATION FROM CMOS 09;\7 09AA 09AO 09AF 09B 1 0984 0984 0986 0988 88 E8 A8 14 E9 8E8E 0000 E CO 03 OA3A R MOV CALL TEST JZ JMP 24 OF 86 C4 E8 0000 E AND XCHG CALL ;----- 80 E8 24 3C 75 CLEAR THE MINIMUM CONFIG BIT SAVE THE STATUS BYTE BACK I NTO CMOS IN MODE CHECK FOR SOFT RESET BYPASS I F SOFT RESET JNE AL,CMOS B M S HI-tNMI CMOS REAO- - AL,OCOH AL.OCOH M_OK_64 MASK FOR MANUFACTUR I NG, TEST BI TS CHECK FOR MANUFACTURING TEST MODE SET SKIP IF NOT MANUFACTURING LINE TEST MOV BYTE PTR @RESET_FLAG,64H; ELSE SET THE MFG TEST FLAG CALL AND eMP 09CE C6 06 0012 R 64 AL..,ODFH AL,AH CMOS_WRITE @RESET FLAG, 1234H M_OK_64 MOV 9C 0000 E CO CO 05 CHECK CMOS GOOD GET THE STATUS VALID CMOS? GO IF YES GO IF NOT CHECK FOR CMOS RUN 0988 81 3E 0012 R 1234 09CI 74 10 09C3 09C5 09C8 09CA 09CC AX,X·(CMOS OIAG+NMI) CMOS READ AL,8AD BAT+BAD CKSUM M OK BAD_MOS GET THE BASE MEMORY SIZE HIGH BYTE 1NSURE CONF I GURAT I ON HAS CORRECT V IDEO TYPE 0903 0903 0905 09D8 09DA 090C 09DE 09El M OK 64: 80 E8 8A A8 7q E8 74 94 0000 E EO - - 31 09EC R 4C 09EA E8 4E ;----- TEST JZ @MFG TST ,MFG LOOP NORMAL.. _ CONF I G EXCEPT IF MFG JUMPER GO IF INSTALLED JMP SHORT BAD_MOS GO DEFAULT SAVE VIDEO TYPE ANY VIDEO? CONTINUE I NSURE V IDED ROM PRESENT CONT INUE IS INSTALLED ROUTINE CHECK FOR VIDEO FEATURE ROM PRESENT CHK_VIOEO: 89 COOO 50 IE 57 8E BF 28 8B 3B 5F IF 58 14 OA02 81 OA06 81 5-52 AL, CMOS EQU I P-tNM I CMOS READ AH,A[ AL,030H MOS OK I CHK-VIOEO MOS=OK GET THE EQU I PMENT BYTE TEST JNZ CALL JZ MOV 30 09E3 F6 06 0012 R 20 09E8 74 6F 09EC 09EC 09EF 09EF 09FO 09Fl 09F2 09F4 09F1 09F9 09FB 09FD 09FE 09FF OAOO MOV CALL MOV CHK VIDE01: PUSH PUSH PUSH eX,oeOOOH START OF FEATURE 1/0 ROM AX OC J. 01 OS AX CHK_VIDE02 SAVE THE CONFIGURATION SAVE THE DATA SEGMENT SAVE' COMPARE REG I STER GET ROM SEGMENT GET THE PRESENCE SIGNATURE CLEAR I NOEX PO INTER GET THE FIRST 2 LOCATIONS IS THE VIDEO FEATURE ROM PRESENT? RESTORE WORK REG I STER RESTORE DATA SEGMENT GET THE CONF 1GURATI ON GO IF VIDEO ROM INSTALLEO Cl 0080 F9 C80a AOO eMP CX.080H CX ,OC800H PO I NT TO NEXT 2K BLOCK TOP OF V IDEO ROM AREA YET? 09 AA55 08 07 C7 TESTl MOV MOV SUB MOV eMP POP POP POP DS 01 DS,CX DI,OAA55H BX,8X AX, [BX] AX,OI IBM Personal Computer MACRO Assembler TESTI ---- 06/10/85 POWER ON SELF TEST 2681 2682 2683 2684 2685 2686 2681 2688 2689 2690 2691 2692 2693 2694 2695 2696 2691 2698 2699 2100 210 I 2102 2103 2104 2105 2106 2101 2108 2109 2110 2111 2112 2113 2114 2115 2116 2111 2118 2119 2120 2121 2122 2723 2124 2725 2726 2127 2128 2129 2730 2131 2132 2733 2134 2735 2736 2731 2738 2739 2140 2741 2742 2143 2144 2745 2746 2741 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2160 2761 2762 2763 2764 2165 2766 2167 2168 2769 2770 2111 2112 2113 2774 2175 2116 2177 2178 2119 2780 2781 2182 2183 2784 2785 2786 2787 2788 2189 2190 2191 2192 2193 2194 OAOA 1C E3 OAOC 23 C9 OAOE OAOE C3 CHK V[DE02: RET OAOF OAOF E8 09EC R OAI2 14 26 MOS OK I: - CALL JZ JL AND i----- CHK VIDEO I cX,Ex 24 3C 15 8A EB 30 30 11 C4 08 AND eMP JNZ MDV JMP TRY AGAIN SET NON ZERO FLAG ICHECK FOR PRIMARY DISPLAY AND NO VIDEO ROMI CHK VIDEO 8AD~)'OS [S THE VIDEO ROM INSTALLED? WRONG CONFIGURATION IN CONFIG BYTE AL,AH PMFG TST ,DSP .JMP MOS_OK_2 - RESTORE CONFIGURATION CHECK FOR 0 I SPLA Y .JUMPER GO 1F COLOR CARD 1 S PR I MARY 0 I SPLA Y MONOCHROME CARD OAIO OAIF OA21 OA23 OA25 f I ; RETURN TO CALLER CMOS VIDEO BITS NON ZERO MDV TEST JZ OAI4 8A C4 OAI6 F6 06 0012 R 40 OAtB 14 OA 1-26 06-10-85 Version 2.00 IPOSn [S PR 1MARY 0 I SPLA Y (NO .JUMPER INSTALLEDI I NSURE MONOCHROME [5 PR [MARY CONFIGURATION OK? GO IF NOT RESTORE CONFIGURATION USE THE CONFIGURATION BYTE FOR DISPLAY AL,30H AL,30H BAD MOS AL,AH SHORT MOS_OK COLOR CARD OA21 OA21 24 30 OA29 3C 30 OA2B 8A C4 OA20 74 OB MOS_OK_2: ;----- CONFIGURATION MUST HAVE AT LEAST ONE DISKETTE OA2F OA31 OA33 OA38 MOS_OK: TEST JNZ TEST JZ A8 01 1526 F6 06 0012 R 20 14 IF AND eMP MDV JZ AL,30H AL,30H AL,AH BAD_MOS STRIP UNWANTED BITS MUST NOT BE MONO W[TH JUMPER RESTORE CONFIGURATION GO IF YES ; ; i ; INSTALLED MUST HAVE AT LEAST ONE DISKETTE GO SET CONFIGURATION [F OK EXCEPT IF MFG .JUMPER IS INSTALLED GO IF INSTALLED MINIMUM CONFIGURATION WITH BAD CMOS OR NON VALID VIDEO OA3A OA3A OA30 OA40 OMZ OA44 OM1 OA47 OA4A OA4C 008E 0000 E CO 03 BAD MOS: MOV CALL TEST JNZ E8 0000 E CALL E8 09EC R BO 0 I 14 OB BAD MOS 1 : CALL Mav JZ B8 E8 A8 15 AX,CMOS DIAG+NMI CMOS READ AL,BAD BAT+BAD CKSUM BAD 1'11051 - GET THE DIAGNOST[C STATUS WAS BATTERY DEFECT I VE OR BAD CHECKSUM GO [F YES CONFI G_BAD SET THE MINIMUM CONFIGURATION FLAG CHK V IDEO AL,OIH NORMAL_CONF I G CHECK FOR V [OED ROM DISKETTE ONLY GO I F V IDEO ROM PRESENT OA4E F6 06 0012 R 40 OA53 80 I I OA55 14 02 TEST Mav JZ ~MFG TST ,DSP .JMP AL,ITH NORMAL _ CONF I G CHECK FOR 0 I SPLA Y .JUMPER DEF AUL T TO 40X25 COLOR GO IF .JUMPER [S INSTALLED OA57 BO 31 Mav AL,31H DISKETTE! B!W DISPLAY 80X25 CONF I GURAT I ON AND MFG MODE OA59 OA59 F6 06 0012 R 20 OA5E 75 02 OA60 24 3E NORMAL CONF I G: - TEST JNZ OA62 OA64 OA61 OA60 NORM 1 : 2A A3 81 14 E4 0010 R 3E 0012 R 1234 2C AND IPMFG TST ,MFG LOOP NORMT AL,03EH IS THE MANUFACTURING JUMPER GO IF NOT STRIP DISKETTE FOR MFG TEST SUB Mav eMP JZ AH,AH I1IEQU I P _FLAG, A~ I1IRESET FLAG, 1234H E6 - SAVE SWITCH INFORMATiON BYPASS IF SOFT RESET INSTALLED GET THE F[RST SELF TEST RESULTS FROM KEYBOARD MDV CALL Mav AL, WR I TE_B042_LOC C8042 AL,4DH OA76 E6 60 OUT PORT _A,AL OA78 2B C9 OA1A E8 039B R SUB CX,CX e42 I WA 1T FOR COMMAND ACCEPTED CALL OA70 B9 7FFF Mav CX,01FFFH IN TEST LOOPZ AL,STATUS_PORT AL, OUT _BUF _FULL TST6 SET LOOP COUNT FOR APPROX[MATELY TO RESPOND WA 1T FOR OUTPUT BUFFER FULL OA6F BO 60 OA71 E8 0396 R OA74 BO 40 OA80 E4 64 OA82 A8 0 I OA84 EI FA OAB6 OA87 OA89 OA8C OA80 9C 80 AD E8 0396 R 90 74 OC OA8F E4 60 OA91 A2 0072 R TST6: ENABLE KEYBOARD ISSUE WRITE BYTE COMMAND ENABLE OUTPUT BUFFER FULL INTERRUPT, SET SYSTEM FLAG, PC I COMPATIBILITY, I NH I BI T OVERR I DE, ENABLE KEYBOARD - TRY AGAIN IF NOT PUSHF Mav CALL POPF JZ E6 SAVE FLAGS D I SABLE KEYBOARD I S SUE THE COMMAND RESTORE FLAGS CONT I NUE WITHOUT RESULTS IN "av AL,PORT_A BYTE PTR 'lIRESET _FLAG, AL GET I NPUT FROM KEYBOARD TEMPORARY SAVE FOR AA RECEIVED AL,DIS_KBD C8042 lOOMS CHECK FOR MFG REQUEST OA94 3C 65 OA96 15 03 OA98 E9 OC27 R eMP JNE JMP AL,065H E6 MFG_BOOT LOAD MANUFACTUR 1NG TEST REQUEST? CONT I NUE I F NOT ELSE GO TO MANUF ACTUR 1NG BOOTSTRAP TEST.\4 INITIALIZE AND START CRT CONTROLLER (6845) TEST VIDEO READ/WRITE STORAGE. DESCR 1PT I ON RESET THE V IDEO ENABLE SIGNAL. SELECT ALPHANUMERIC MODE, 40 • 25, B & W. READ/WRITE DATA PATTERNS TO MEMORY. CHECK STORAGE ADDRESSABILlT'l'. ERROR = 1 LONG AND 2 SHORT BEEPS TESTl 5-53 IBM Personal Computer MACRO Assembler TESTI ---- 06/10/85 POWER ON SELF TEST 2795 2796 2797 OA98 2798 OA98 AI 0010 R 2799 OA9E 50 2800 OA9F BO 30 280 I OAA 1 A3 0010 R 2802 OAA4 28 CO 2803 OAA6 CD 10 2804 OAA8 80 20 2805 OAAA A3 00 lOR 2806 OAAD 88 0003 2807 OA80 CO 10 2808 OAB2 98 000 I 2809 OAB5 CD 10 2810 OAB7 58 .2811 OAB8 A3 0010 R 2812 OA8S 24 30 28130AB07511 2814 OABF IE 2815 OACO 50 2816 OAC 1 2B CO 2817 OAC3 8E 08 2818 OAC5 BF 0040 R 2819 OAC8 C7 05 0000 E 2820 OACC 58 2821 OACD IF 2822 OACE EB 7F 2823 OADO 2824 OADO 3C 30 2825 OAD2 74 08 2826 OAD4 FE C4 2827 OA06 3C 20 2B2B DADa 75 02 2829 OADA B4 03 2830 OADC 2831 OADC 86 EO 2832 DADE 50 2833 OADF 2A E4 2834 OAEI CD 10 2835 OAE3 58 2836 OAE4 50 2837 OAE5 88 BOOO 2838 OAE8 BA 03B8 2839 OAE8 89 0800 2840 OAEE 80 FC 30 2841 OAFI 74 07 2842 OAF3 87 B8 2843 OAF5 BA 0308 2844 OAF8 85 20 2845 OAFA 2846 OAFA AO 0065 R 2847 OAFD 24 37 2848 OAFF EE 2849 OBOO 8E C3 2850 OB02 8E DB 2851 OB04 01 C9 2852 OB06 f8 0000 E 2853 0809 75 70 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 OB08 BO 22 2865 OBOD E6 80 2866 2867 OBOF 58 2868 OBIO 50 2869 0811 84 00 28700813 CD 10 2871 081588 7020 287.2 OB18 2B FF 2873 OBIA B9 0028 2874 0810 F3/ AB 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 OB1F 58 2886 0820 50 2887 0921 80 FC 30 2888 OB24 BA 03BA 2889 OB27 74 03 2890 0829 BA 03DA 2891 OB2C 2892 OB2C 84 08 2893 OB2E 2894 OB2E 2B C9 2895 OB30 2896 0830 EC 2897 0831 22 C4 2898 0833 75 04 2899 0835 E2 F9 2900 0837 E8 42 2901 0839 2902 0839 2B C9 2903 OB38 2904 OB38 EC 2905 OB3C 22 C4 2906 OB3E 74 04 2907 OB40 E2 F9 2908 0842 EB 37 5-54 TESTl 1-21 Version 2.00 (POST) 06-10-85 E6: MOV AX,Q!lEQUIP FLAG PUSH AX "OV "OV AL .30H SUB INT "OV MOV MOV INT MOV INT POP "OV :~~~~P _FLAG,AX INT VIDEO AL,20H Q!lEQUIP FLAG,AX AX.0003H INT VIDEO AX,OOOIH INT VIDEO AX - AND PEQU I P FLAG, AX AL,30H- "NZ PUSH PUSH OS AX SUB "OV MOV "OV POP POP E7 : - ""P CMP "E E7 AX,AX SET DATA SEGMENT TO 0 DS,AX 01 • OFFSET @VIOEO I NT ; SET INTERRUPT 10H TO DUMMY WORD PTR (0 I] ,OFFSET DUMMY RETURN ; RETURN I F NO V IDEO CARD AX RESTORE REGISTERS OS BYPASS VIDEO TEST SHORT E18_1 AL,30H E8 INC AH CMP "OV AL,20H E8 AH.3 XCHG PUSH AX SUB INT AH,AH INT VIDEO POP AX - "NE GET SENSE INFORMATION SAVE [T FORCE MONOCHROME TYPE INTO EQUIPMENT FLAG MODE SET COMMAND FOR DEFAULT MODE SEND INITIALIZATION TO B/W CARD FORCE COLOR AT 80 BY 25 INTO EQUIPMENT FLAG TO CLEAR BUFFERS AND INITIALIZATION COLOR CARD 80X25 MODE SET 80 X 25 SET COLOR 40 X 25 MODE SET DEF AUL T COLOR MODE RECOVER REAL SW I TCH I NFORMAT I ON RESTORE IT ISOLATE VIDEO SWITCHES VIDEO SWITCHES SET TO O? SAVE THE DATA SEGMENT B/W CARD ATTACHED? YES - SET MODE FOR B / W CARD SET COLOR MODE FOR COLOR CARD 80X25 MODE SELECTED? NO - SET MODE FOR 40X25 SET MODE FOR 80X25 E8: AH,AL PUSH AX MOV MOV MOV CMP BX,OBOOOH DX,388H CX,2048 AH,30H MOV MOV BH,OB8H DX,3D8H CH,20H SAVE VIDEO MODE ON STACK INITIALIZE TO ALPHANUMERIC MD CALL VIDEO 10 RESTORE V IDEO SENSE SW I TCHES IN AH SAVE VALUE STARTING VIDEO MEMORY ADDRESS B/W CARD MODE REG I STER FOR B/W MEMORY WORD COUNT FOR B/W CARD B/W VIDEO CARD ATTACHED? YES - GO TEST V IDEO STORAGE STARTiNG MEMORY ADDRESS FOR COLOR CARD MODE REG I STER FOR COLOR CARD MEMORY WORD COUNT FOR COLOR CARD AL, Q!lCRT MODE SET AL,037HDX,AL ES,BX DS,BX CX,I STGTST CNT E17 - GET CURRENT MODE SET VALUE SET VIDEO BIT OFF D I SABLE V IDEO FOR COLOR CARD POINT ES TO VIDEO MEMORY POINT OS TO VIDEO MEMORY DIVIDE BY 2 FOR WORD COUNT GO TEST VIDEO READ/WRITE STORAGE R/W MEMORY FAILURE - BEEP SPEAKER "E MOV E' E9: MOV AND OUT MOV MOV ROR CALL "NE ; - - - -- -- - --- - -- ---- --- - -- --- - --- - -- - - - - - - - - --- --- ; TEST. 15 ; SETUP VIDEO DATA ON SCREEN FOR VIDEO ; LINE TEST. ; DESCRIPTION ; ENABLE V IDED SIGNAL AND SET MODE. ; DISPLAY A HORIZONTAL BAR ON SCREEN. ; : - - - - -- - --- - -- - - -- - - - - -- - -- -- - - - -- - --- - -- - - -- - --MOV OUT POP PUSH MOV INT MOV SUB "OV REP AL.22H MFG_PORT ,AL AX AX AH,O INT VIDEO AX, 'f020H 01,01 CX,40 STOSW <> <><> <><><> <> <> <> <> <> <> <><> CHECKPOINT 22 <><> GET V IDEO SENSE SW ITCHES (AH) SAVE IT ENABLE V IDEO AND SET MODE VIDEO WR I TE BLANKS I N REVERSE V IDEO SETUP STARTING LOCATION NUMBER OF BLANKS TO 0 I SPLA Y WR I TE V IDEO STORAGE ------ ; ------------ -- ------------ ------; TEST.! 6 ; CRT INTERFACE LINES TEST ; DESCRIPTION ; SENSE ON/OFF TRANSITION OF THE ; VIDEO ENABLE AND HORIZONTAL ; SYNC LINES. POP PUSH AX AX CMP MOV "E MOV AH,30H DX,038AH EI I OX,03DAH SUB CX,CX IN AND "MP AI.. ,OX AL,AH EI' EI3 SHORT EI7 SUB CX,CX IN AND AL,DX AL,AH Elb LOOP E'5 SHORT EI7 GET V IDEO SENSE SW I TCH I NFORMAT I ON SAVE IT B / W CARD A TT ACHED? SETUP ADDRESS OF B/W STATUS PORT YES - GO TEST LINES COLOR CARD IS ATTACHED Ell: AH,8 E12: E13: "NZ LOOP READ CRT STATUS PORT CHECK VIDEO/HORIZONTAL LINE ITS ON - CHECK IF IT GOES OFF LOOF UNT I L ON OR TIMEOUT GO PR I NT ERROR MESSAGE E14: E15: "Z "MP READ CRT STATUS PORT CHECK VIDEO/HORIZONTAL LINE I TS ON - CHECK NEXT LINE LOOP IF ON UNTIL IT GOES OFF GO ERROR BEEP IBM Personal Computer MACRO Assembler TESTI ---- 06/10/85 POWER ON SELF TEST 2909 2910 2911 2912 0844 2913 OB46 2914 0848 2915 084A 2916 OB4A 29170848 2918 0840 2919 2920 2921 2922 OB4F 2923 OB52 2924 OB52 2925 0854 2926 OB56 2927 OB58 2928 0859 2929 OS5C 2930 OB5E 2931 OB60 2932 0862 2933 OB63 2934 2935 0865 2936 OB68 2937 OB6A 2938 OB6A 2939 OB6E 2940 OB6E 2941 OB72 2942 2943 OB74 2944 OB76 2945 2946 0878 2947 2948 2949 2950 2951 OB79 2952 2953 2954 2955 OB7E 2956 OB83 2957 OB88 2958 OB8A 2959 OB8F 2960 OB91 2961 OB94 2962 OB97 2963 OB97 2964 OB98 2965 OB98 2966 0890 2967 089F 2968 2969 2910 2971 OBAI 2912 2913 OBA6 2974 OBA9 2975 08A8 2976 OBAC 2917 OBAF 2978 OBB 1 2979 OB84 2980 0886 2981 OB88 2962 OBBA 2983 OBBC 2984 OBBF 2985 OBCO 2986 OBC2 2987 OBC8 2988 08ce 2989 OBCD 2990 OBCF 2991 2992 2993 2994 OBDI 2995 0801 2996 OBD3 2997 OBD5 2998 OB07 2999 080A 3000 OBOC 3001 OBOO 3002 OBEO 3003 OBE2 3004 OBE5 3005 OBE7 3006 OBE9 3007 OBEB 3008 OBED 3009 oeFO 3010 OBF 1 3011 OBF3 3012 OBF9 3013 08FF 30 14 OCO 1 3015 OC03 3016 OC05 3017 OC05 3018 OC06 3019 OC09 3020 OCOB 3021 OCOD 3022 OCOF B I 03 02 EC 75 E4 Version 2.00 (POSTI ;----- CHECK HORIZONTAL LINE E16: MOV SHR 1-28 06-10-85 CL,3 AH,CL EI2 GET NEXT BIT TO CHECK JNZ POP MOV INT AX AH,O lNT_VIDEO GET V IDEO SENSE SW ITCHES (AH I SET MODE AND 01 SPLAY CURSOR CALL VIDEO I/O PROCE~URE CONT I NUE E18: 58 B4 00 CD 10 BA COOO BO E6 8E 57 SF 28 88 38 5F 75 ;----- CHECK FOR THE ADVANCED VIDEO CARD E 18 I: EI8A: MOV DX,OCOOOH SET THE LOW SEGMENT VALUE MOV OUT MOV AL,23H MFG_PORT, AL DS,OX 01 Ol,OAA55H BX,BX AX, [BX] AX,OI 01 EI8B SAVE WORK REGISTER PRESENCE SIGNATURE CLEAR PO INTER GET FIRST 2 LOCATIONS PRESENT? RECOVER REG I STER NO? GO LOOK FOR OTHER MODULES 23 80 OA PUSH AA55 08 07 C7 MDV SUB MDV eMP PDP JNZ 05 E8 0000 E EB 04 CALL <> <> <> <> <> <> <> <> <> <> <> <> <><> CHECKPOINT 23 <><> ROM CHECK SHORT E 1BC GO SCAN MODULE JMP ADD DX.OOBOH PO r NT TO NEXT 2K BLOCK 81 FA C800 7C DE eMP JL DX,OCBOOH EI BA TOP OF V IDEO ROM AREA YET? GO SCAN FOR ANOTHER MODULE BO 24 E6 80 MDV OUT AL ,24H MFG_PORT ,AL JMP POST2 EI8B: 81 C2 0080 EI8C: E9 0000 E <> <><><><><><><><><><><> <><> CHECKPOINT 24 <><> GO TO NEXT TEST CRT ERROR SET MFG CHECKPO I NT AND ERROR BEEP E8 0000 E E17: CALL C6 80 74 F6 74 BA EB 06 00 15 R DC 3E 0072 R 64 00 06 0012 R 20 06 0102 0000 E ; DDS CHECKPOINT OC POINT TO DATA = MONOCHROME FAILED MOV CMP JZ TEST JZ MOV CALL 'PMFG ERR FLAG, OCH ; BYTE-PTR-.RESET FLAG,064H EI9 PMFG TST ,MFG LOOP E 19 DX,102H ERR_BEEP PUSH OS MDV AND CMP AX ,IIIEQU I P FLAG AL,30H AL,30H TRY_COLOR <><> CRT ERROR CHECKPO I NT OC <><> ; IS THIS A MFG REQUEST? BY PASS ERROR BEEP IF YES I S THE MFG LOOP JUMPER INSTALLED? BY PASS ERROR BEEP J F YES GO BEEP SPEAKER E19: 1E AI 0010 R 24 30 3C 30 74 30 JZ ;----- COLOR FAILED TRY MONOCHROME - GET THE CURRENT V IDEO STRIP OTHER BITS I SIT MONOCHROME ? GO 1F YES CHECKPOINT 00 = COLOR FAILED C6 06 0015 R 00 MDV OMFG _ERR _FLAG, ODH <><> CRT ERROR CHECKPOINT BA 03B8 90 01 EE BB BODO 8E DB B8 AA55 28 DB 69 07 EB 00 88 07 3D AA55 1F 75 55 81 DE 0010 R 0030 AI 0010 R 2A E4 CD 10 EB 34 MDV MDV OUT MDV MDV MDV SUB MDV JMP MDV CMP PDP DX,3B8H AL,I OX,AL BX,OBOOOH OS,BX AX, OAA55H BX,BX [BX] .AX DISABLE B/w JNZ EI7 3 IilIEQOIP FLAG,30H AX,OEQUIP FLAG AH,AH INT VIDEO SHORT E11_1 DR MDV SUB INT JMP '.2 AX, [BX] AX, OAA55H OS 00 <><> OUTPUT THE D I SABLE CHECK FOR MONOCHROME V IDEO MEMORY WR I TE AN AA55 TO THE FIRST LOCATION ALLOW BUS TO SETTLE READ THE FIRST LOCATION I S THE MONOCHROME V IDEO CARD THERE? RESTORE THE DATA SEGMENT GO IF NOT TURN ON MONOCHROME 8 I TS IN EQU I P FLAG ENABLE V IDEO CONTINUE MONOCHROME FAIl.ED TRY COLOR BO 2A CD BA BO EE BB 8E B8 2B 89 EB 88 3D 1F 75 81 81 BO 2A CO 58 Al 24 3C 2A 74 01 E4 10 0308 00 B800 DB AA55 DB 07 00 07 AA55 24 26 0010 R FFCF OE 0010 R 0010 01 E4 10 0010 R 30 30 CO 02 TRY COLOR: MOV SUB INT MDV MDV OUT MDV MOV MDV SUB MDV JMP MDV eMP PDP JNZ AND DR MDV SUB INT PDP MDV AND eMP SUB JZ AL,OIH AH,AH INT VIDEO DX,3D8H AL,O DX,AL 8X,OB800H OS,BX AX ,OAA55H BX,BX [BX] ,AX '.2 AX. [BX] AX ,OAA55H OS E17 3 IIIEQU 1P FLAG, OFFCFH IIIEQU I P-FLAG, I OH AL,OIHAH,AH INT_VIDEO AX AX, olOEQU I P FLAG AL,30H AL ,30H AL.AL Ell_2 SET MODE COLOR 40X25 o I SABLE COLOR OUTPUT THE 0 I SABLE CHECK FOR COLOR V IDEO MEMORY WR I TE AN AA55 TO THE FIRST LOCATION ALLOW 8US TO SETTLE READ THE FIRST LOCATION IS THE COLOR VIDEO CARD THERE? RESTORE THE DATA SEGMENT GO IF NOT TURN OFF VIDEO 8ITS SET COLOR 40X24 SET NEW V IDEO TYPE ON STACK IS IT THE B/W? GO IF YES TESTl 5-55 IBM Personal Computer MACRO Assembler TEST I ---- 06/10/85 POWER ON SELF TEST 3023 3024 3025 30260 302, 3028 3029 3030 3031 3032 3033 3034 3035 3036 3031 3038 OCI I FE CO OCI3 OCI3 50 OCI4 OCI4 E9 OB4A R INC ; ----OC 11 OCI1 OC 18 OCIA OC 1C OC 1F OC23 OC24 5-56 1E 2B BE BF C1 1F E9 CO DB 0040 R 05 0000 E OB4F R TEST 1 Version 2.00 (POST) 1-29 06-10-85 ; PUSH AX JMP EI8 INITIALIZE FOR 40X25 80TH VIDEO CARDS FAILED SET DUMMY RETURN PUSH SUB MOV MOV MOV POP JMP IF RETRACE FAILURE OS AX, AX ; SET OS SEGMENT TO 0 DS,AX OJ ,OFFSET @VIOEO INT ; SET INTERRUPT 10H TO DUMMY WORD PTR [OJ J ,OFFSET OUMMY RETURN ; RETURN IF NO VIDEO CARD as E18_1 - ; BYPASS REST OF VIDEO TEST IBM Personal Computer MACRO Assembler TEST! ---- 06/10/85 POWER ON SELF TEST 3039 3040 3041 3042 3043 3044 3045 3046 3041 3048 3049 3050 3051 3052 3053 3054 OC21 3055 OC21 3056 OC29 3051 3058 3059 3060 OC2C 3061 OC2F 3062 OC30 3063 OC33 3064 OC35 3065 OC31 3066 OC3A 3061 OC3D 3068 OC30 3069 OC3E 3010 OC3F 3011 3012 3013 3014 OC41 3015 OC44 3016 OC41 3011 OC4A 3018 OC4A 30J9 OC4B 3080 OC4C 3081 3082 3083 3084 3085 OC4E 3086 OC4F 3081 OC50 3088 OC56 3089 OC5C 3090 3091 3092 3093 OC62 3094 OC64 3095 OC61 3096 OC69 3091 3098 OC6B 3099 OC6E 3100 OC10 3101 OC13 3102 OC15 3103 OC11 3104 OC18 31050C1B 3106 OC1B 3101 OC1D 3108 OC1F 3109 OC81 3110 OC83 3[ I I OC84 31 12 OC86 3113 3114 OC88 3115 31 16 OC8D 31 11 OC8D 31 18 OC8F 3119 OC91 3120 3121 OC93 3122 OC95 3123 3124 OC96 3125 OC96 3126 1-30 06- I 0-65 Version 2.00 (POST) PAGE ; - - - - -- - - - - - - - -- - - - - - - - - - - - - - -- - - - - - - - - - - MANUFACTURING BOOT TEST CODE ROUTINE ; LOAD A BLOCK OF TEST CODE THROUGH THE KEYBOARD PORT FOR MANUFACTURING ; TESTS. ; THIS ROUTINE WILL LOAD A TEST (MAX LENGTH=FAFFH) THROUGH THE KEYBOARD ; PORT. CODE WILL BE LOADED AT LOCATION 0000l0500. AFTER LOADING, ; CONTROL WILL BE TRANSFERRED TO LOCATION 0000:0500. THE STACK WILL BE LOCATED AT 0000:0400. THIS ROUTINE ASSUMES THAT THE FIRST 2 BYTES TRANSFERRED CONTAIN THE COUNT OF BYTES TO BE LOADED ; (BYTE 1 =COUNT LOW, BYTE 2=COUNT HI.J -- --- -- - -- - - -- -- -- --- -- ;----B4 00 E8 0000 E - - -- --- - - - -- DEGATE ADDRESS LINE 20 MFG BOOTl MOV CALL AH,DISABLE BIT20 GATE_A20 - ; ; DEGATE COMMAND FOR ADDRESS LINE 20 I SSUE TO KEYBOARD ADAPTER' AND CLI SETUP HARDWARE INTERRUPT VECTOR TABLE LEVEL 0-1 AND SOFTWARE INTERRUPTS 68 01 B9 8C 8E BE BF ---- R PUSH SET ES SEGMENT REG I STER TO ABSO POP "Oy "Oy MOV "Oy "Oy ABSO ES 0018 C8 08 0000 E 0020 R CX,24 AX,CS DS,AX 51 ,OFFSET VECTOR TABLE 01 ,OFFSET IlIINT_PTR GET VECTOR COUNT GET THE CURRENT CODE SEGMENT VALUE SETUP OS SEPMENT REG I STER TO POINT TO THE ROUTINE ADDRESS TABLE SET DESTINATION TO FIRST USED VECTOR A5 AB E2 FC MOVSW STOSW LOOP MFG_Bl MOVE ONE ROUTINE OFFSET ADDRESS INSERT CODE SEGMENT VALUE MOVE THE NUMBER OF ENTR I ES REQU I RED B9 0008 BE 0000 E BF OICO R "Oy "Oy "Oy CX,08 ; GET VECTOR COUNT 51 iOFFSET SLAVE VECTOR TABLE 01 ,OFFSET IlISLAVE_INT_PTR A5 AB E2 FC MOVSW STOSW LOOP MFG_B2 SETUP HARDWARE ;----06 IF C1 06 0008 R 0000 E C1 06 00 14 R 0000 E C1 06 0062 R F600 ; ----- INTERRUPT VECTORS LEVEL 8-15 (VECTORS START AT INT 10 HI ; MOVE ONE ROUTINE OFFSET ADDRESS ; INSERT CODE SEGMENT VALUE SET UP OTHER INTERRUPTS AS NECESSARY ASSUME PUSH OS: ASSO .ES; ABSO POP "Oy "Oy "Oy OS ES ES= ABSO TO ABSO SET Nt.! I INTERRUPT PR I NT SCREEN CASSETTE BAS I C SEGMENT as WORD PTR II!INMI PTR,OFFSET NMI INT WORD PTR OINTS PTR,OFFSET PRTNT SCREEN WORD PTR PBASIC_PTR+2,OF600H - ENABLE KEYBOARD PORT BO E8 BO E6 60 0396 R 09 60 "OY CALL "OY OUT AL,60H C8042 AL,00001001B PORT_A,AL WR I TE 6042 MEMORY LOCAT I ON 0 ISSUE THE COMMAND SET INHIBIT OVERRIDE/ENABLE OBF INTERRUPT AND NOT PC COMPATIBLE E8 8A j::8 8A 8A FC BF OC8D R F8 OC8D R E8 CF CALL "OY CALL "OY "OY CLD "OY MFG B4 BH,AL MFG B4 CH,AL CL,BH GET COUNT LOW SAVE IT GET COUNT HI E4 A8 14 E4 AA E6 E2 64 01 FA 60 IN TEST JZ AL,STATUS PORT At-, OUT BUF FULL MFG B3AL,PORT_A 80 F3 STOSB OUT LOOP MFG PORT ,AL MFG=B3 GET 8042 STATUS PORT KEYBOARD REQUEST PENDING? LOOP TILL DATA PRESENT GET DATA STORE IT DjSPLAY CHARACTER AT MFG PORT LOOP TI LL ALL BYTES READ J"P II!IMFG_TEST_RTN FAR JUMP TO CODE THAT WAS JWST LOADED ~t: ~~~ T~GFP~~~L CHECK FOR OUTPUT BUFFER FULL HANG HERE IF NO DATA AVAILABLE 0500 R EA 0500 IN ---- R E4 64 A8 01 EI FA IN E4 60 C3 ex 01 ,OFFSET 0 FLAGS ERROR I CLEAR (BP) REG' STER AS ERROR FLAG REG I NTERRUPT MASK REG I STER REG I STERS eLi 00 21 A\ 00 21 EO AI 0010 BO 25 00 IF E6 80 BP,BP ; I SET DATA SEGMENT AL,O INTAOI,AL INTSOI,AL TURN OFF INTERRUPTS SET INTERRUPT MASK REGISTER TO ZERO SEND 10 2ND I NTERRUPT CONTROLLER ALSO J"F 1·2 IN "OY IN AL,INTAOI AH,AL AL,INTBOI READ I NTERRUPT MASK REG! STER SAVE RESULTS READ 2ND I NTERRUPT MASK REGI STER OR JNZ AH,AL 06 BOTH '"R O? GO TO ERR ROUTI NE "OY OUT AL,25H "FG _PORT, AL . IF NOT 0 <> <><> <><> <><><><> <> <><> <><> CHECKPOINT 25 <><> IBM Personal Comput.er MACRO Assembler VersIon 2.00 TEST2 ---- 06/10/85 POST TESTS AND INITIALIZATION ROUTINES 115 116 117 118 [[9 120 121 122 0021 BO FF 00 23E62[ 0025 E6 A[ 0027 E8 00 0029 E4 2[ 0028 8A EO 0020 E4 AI 123 [24 125 002F 05 000 [ 0032 75 15 1-2 06-10-85 MOY OUT OUT JMP IN MaY IN "2 AL, [NTAOI AH,AL AL,INTBOI 01 SA8LE OEV I CE INTERRUPTS WR J TE TO I NTERRUPT MASK REG [STER WRITE TO 2ND INTERRUPT MASK REGISTER 110 DELAY READ I NTERRUPT MASK REG [STER SAVE RESULTS READ 2ND I NTERRUPT MASK REG I STER AOO JNZ AX,I 06 ALL lMR B[TS ON? NO - GO TO ERR ROUT! NE AL,OFFH INTAOI,AL INTBO I ,AL 12. 127 128 129 CHECK FOR HOT 1NTERRUPTS 1NTERRUPTS ARE MASKED OFF. CHECK THAT NO I NTERRUPTS OCCUR. 130 131 132 133 134 135 13. 137 138 139 140 141 142 143 144 145 14. 147 148 149 150 151 152 153 154 155 15. 157 158 159 ,., 160 ,.2 ,.3 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 17' 180 181 182 183 184 [85 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 20 [ 202 203 204 205 206 207 208 209 0034 A2 0068 R MaY <> <> <> <> <> <> <> <> <> <> <> <><> CHECK PO I NT 26 <><> ENABLE EXTERNAL INTERRUPTS WAIT 100 MILLISECONDS FOR ANY INTERRUPTS THAT OCCUR OJ 0 ANY 1 NTERRUPTS OCCUR? NO - GO TO NEXT TEST <><><><><><><><> <><><><> <><> CHECKPO[NT 5 <><> OJ SPLAY 101 ERROR CHECK THE CONVERT I NG LOG I C 0056 80 27 0058 E6 80 005A 0050 OOSF 006 [ 0063 0065 0068 88 E7 E4 86 E4 30 74 07: AA55 82 82 C4 83 55AA 05 ;----80 E6 89 E8 80 E6 80 74 AL,27H MFG _PORT, AL MaY OUT IN XCHG IN eMP AX,OAA55H MFG_PORT+2,AX AL,MFG_PORT+2 AL,AH AL,MFG_PORT+3 AX,55AAH 07 A MaY JMP SI ,OFFSET EI06 06A <> <> <> <> <> <> <> <> <><> <> <> 27 <><> <><> CHECKPOINT WRITE A WORD GET THE FIRST BYTE SAVE IT GET THE SECOND BYTE IS [T OK? GO IF YES - 006A 8E 0000 E 0060 E8 E2 006F 006F 0071 0073 0076 0079 0078 0070 0082 MaY OUT 00 70 0007 0000 E 80 70 3E 0068 R 00 09 CHECK FOR HOT NMI 01 SPLAY INTERRUPTS WITHOUT MaY OUT MaY CALL MaY OUT eMP JZ AL, CMOS REG 0 CMOS_PORT, AL CX,7 WAITF AL ,CMOS REG D+NM I CMOS_PORT ,AL rtlINTR_FLAG,OOH 07 e 0084 80 28 0086 E6 80 MaY OUT AL ,28H MFG_PORT. AL 0088 BE 0000 E 008B E8 C4 MaY JMP SI,OFFSET El07 06A 106 ERROR I/o-MEMORY PARITY ENABLED TURN ON NM [ ADDRESS DEF AUL TREAD ONLY REG I STER DELAY COUNT FOR 100 MICROSECONDS WA [T FOR HOT NM [ TO PROCESS TURN NM I ENABLE BACK OFF DID ANY INTERRUPTS OCCUR? CONT I NUE [F NOT - <> <><> <> <> <> <> <><><><> <> <><> CHECKPOINT 28 <><> D[SPLAY 107 ERROR TEST THE DATA BUS TO T[MER 2 0080 008F 0091 0093 0095 0097 80 29 E6 80 E461 8A EO 24 FC E6 61 0099 009B 0090 009F 00A2 00A4 OOA6 00A8 OOAA COAC OOAE OOBO 0082 00B4 00B7 BO E6 EB B8 E6 EB 8A E6 EB E4 86 EB E4 3D 74 07 e, - 80 43 00 AA55 42 00 C4 42 00 42 EO 00 42 55AA 05 00B9 BE 0000 E OOBC EB 93 MOY OUT IN MaY AND OUT AL,29H MFG PORT, AL AL,PORT_B AH,AL AL,OFCH PORT_B,AL MaY OUT JMP MaY OUT JMP MOY OUT JMP IN XCHG JMP IN eMP JZ AL,IOIIOOOOB TIMER+3,AL MaY JMP <><> <><><> <> <> <> <> <> <> <> <><> CHECKPOINT 29 <><> GET CURRENT SETT I NG OF PORT SAVE THAT SETTING I NSURE SPEAKER OFF SELECT TIM 2, LSB, MSB, B I NARY, MODE 0 WR I TE THE T I MER MODE REG [STER I/O DELAY WR I TE AN AA55 WR ITE T I MER 2 COUNT - L SB 110 DELAY ,'2 AX,OAA55H TIMER+2,AL '.2 AL,AH T[MER+2,AL '.2 WRITE TIMER 2 COUNT 1/0 DELAY GET THE LSB SAVE IT [/0 DELAY GET THE MSB BUS OK? GO [F OK S [,OFFSET EI08 06A DISPLAY AL, TIMER+2 AH,AL "2 AL,TIMER+2 AX,055AAH 07 a - MSB 108 ERROR 210 211 212 TEST.18 8254 T I MER CHECKOUT DESCR I PT I ON VERIFY THAT THE SYSTEM TIMER TOO FAST OR TOO SLOW. 213 214 215 21. 217 (0) DOESN'T COUNT 218 219 220 221 222 223 224 225 226 OOBE OOCO 00C2 00C3 OOC5 OOC7 00C9 OOCB BO E6 FA BO E6 2A 80 FE 21 BO 10 E6 43 B9 002C 07 D, - MOV OUT eLi MDY OU7 MaY OUT MaY AL,2AH MFG_PORT, AL AL,OFEH INTAO[ ,AL AL,OOOlOOO08 TIMER+3,AL CX,2CH MASK ALL [NTERRUPTS EXCEPT LEVEL 0 WR ITE THE 8259 IMR SELECT TIM 0, LSB, MODE 0, BINARY WRITE T[MER CONTROL MODE REG I STER SET PROGRAM LOOP COUNT JMP $.2 [/0 DELAY <> <> <> <> <> <> <> <> <><> <> <> <><> CHECKPOINT 2A <><> 227 228 OOCE EB 00 TEST2 5-59 IBM Personal Computer MACRO Assembler Version 2.00 TEST2 ---- 06/10/65 POST TESTS AND INITIALIZATION ROUTINES 229 230 231 232 0000 0002 0004 0005 6A Cl E6 40 FB F6 06 006B R 01 MOV OUT SET TIMER 0 COUNT REGISTER WR I TE T I MER 0 COUNT REG I STER AL,CL TlMER+O,AL 511 08: 1-3 06-10-85 TEST 01 NTR_FLAG, a I H JNZ LOOP. DB MOV (lMFG_ERR_FLAG.02H 233 234 235 OOOA 75 00 OpOC E2 F7 23. 237 OOOE C6 06 0015 23B 239 240 241 00E3 BE 0000 E 242 00E6 E9 0051 R 243 244 245 00E9 BO 2B 246 OOEB E6 80 241 248 OOEO FA 249 OOEE BlOC 250 OOFO BO FF 251 00F2 E6 40 252 00F4 C6 06 006B 253 00F9 BO FE 254 dOFB E6 21 255 OOFO FB 256 OOFE F6 06 006B 257 0103 75 DE 258 0105 E2 F7 259 2.0 2.1 262 0107 2B C9 2.3 264 0 I 09 BO 2C 265 01 OB E6 80 266 0100 267 0100 F6 06 006B 268 0112 15 08 269 0 I 14 E2 F1 210 2710116BEOOOOE 212 0119 E9 0051 R 213 214 215 27601lCFA 277 OliO BO FF 27801lFE621 279 0121 BO 36 280 0123 E6 43 281 0125 EB 00 282 0127 BO 00 263 0 j 29 E6 40 284 012B EB 00 285 0120 E6 40 2B. R 02 SI,OFFSET EI02 O.A 09: 29. 291 29B 299 300 30 I 302 303 304 305 30. MOV OUT <><> <> <><><> <> <> <> <> <> <> <> <> <> <><> T I MER CHECKPO I NT ( 2) <><> 01 SPLA Y 102 ERROR TIMER 0 INTERRUPT DID NOT OCCUR= ERROR <> <> <><><><> <> <> <> <> <> <> <><> CHECKPOINT 2B <><> AL,2BH MFG_PORT ,AL eLi R 00 R 01 DID: MOV MOV OUT "OV "OV OUT CL,12 AL,OFFH TIMER+O,AL olNTR FLAG,O AL,OFEH INTAOI,AL 511 TEST JNZ LOOP OINTR FLAG,OIH 08 A 01'0 WAIT FOR SET PROGRAM LOOP COUNT WR I TE T I MER a COUNT REG I STER RESET INTERRUPT RECE I VED FLAG RE-ENABLE T I MER a INTERRUPTS DID TIMER a INTERRUPT OCCUR? YES - TIMER COUNTING TOO FAST, ERROR WA I T FOR I NTERRUPT FOR SPEC I F I ED T I ME INTERRUPT SUB CX,CX "OV OUT AL,2CH MFG_PORT ,AL TEST JNZ LOOP (I]NTR _FLAG,O IH OliO DID TIMER 0 GO IF YES TRY AGAIN MOV J"P S I ,OFFSET EI03 O.A DISPLAY 103 ERROR ERROR IF NOT <><><> <> <> <> <> <> <> <> <><> <><> CHECKPOINT 2C <><> 011 0: R 01 012 ; ----- SETUP TIMER 0 TO MODE 3 012: eLI "OV OUT "OV OUT JMP MOV OUT JMP OUT 2., 2BB 289 290 291 292 293 294 295 DID TI MER 0 I NTERRUPT OCCUR? CHECK TIMER OPERATION FOR SLOW TIME WAIT FOR INTERRUPT FOR SPECIFIED TIME 09 INTERRUPT OCCUR? D I SABLE ALL DEV I CE AL,OFFH INTA01,AL AL,36H TIMER+3,AL INTERRUPTS $.2 SELECT TIMER O,LSB,MSB,MODE 3 WR I TE T I MER MODE REG I STER 1'/0 DELAY AL,O TIMER+O,AL $<2 TlMER+O,AL WRITE LSB TO TIMER 0 REGISTER 1/0 DELAY WRITE MSB TO TIMER a REGISTER 8042 FOR LAST COMMAND ACCEPTED 012F 0131 0133 0135 0137 0139 a 13B 2B 80 E6 E4 A8 74 E2 C9 20 80 64 02 08 F8 SUB MOV OUT 013: IN TEST JZ LOOP CX,CX AL,20H MFG PORT ,AL AL,STATUS PORT AL, I NPT BUF FULL EI9 - 013 ERROR EXIT 0130 BE 0000 E 0140 E9 0051 R "OV JMP ; ; 301 30B 309 (MESSAGE SET WAIT TIME <> <><> <><><><> <> <> <> <> <> <><> CHECKPOINT 20 <><> GET THE 8042 STATUS HAS THE LAST COMMAND BEEN ACCEPTED? GO IF YES TRY AGAIN 105) S I ,OFFSET E I 05 D.A PRINT lOS ERROR GO ERROR HALT - - - - -- - - - - - - - -- - - - - - - - - -- - - - - - - - - - - - - - - - - - - -- - -- - - - - -- - - - - - - -- - -- - -- - - -TEST.19 ADD I TJ ONAL READ/ WR iTE STORAGE TEST ++++ MUST RUN IN PROTECTED MODE ++++ OESCR I PT I ON WRITE/READ DATA PATTERNS TO ANY READ/WRITE STORAGE AFTER THE FIRST 64K. STORAGE ADDRESSAB I LI TY I S CHECKED. 310 311 312 313 314 315 31. 317 318 319 320 321 322 323 324 325 326 327 32B 329 330 331 332 333 334 335 33. 337 338 339 340 341 342 0143 0143 E8 0000 E 0146 BO 2F 0148 E6 80 ASSUME OS:DATA CALL MOV OUT ODS AL,2FH MFG_PORT ,AL SET DA T A SEGMENT eMP JNE JMP ORE SET FLAG,! 234H EI9A SHUT2 WARM START? GO IF NOT GO TO NEXT TEST IF WARM START E19: 014A 81 3E 0072 R 1234 0150 15 03 0152 £9 0420 R <> <> <> <> <> <><> <> <> <> <><> <><> CHECKPOINT 2F <><> SET SHUTDOWN RETURN 2 0155 BO 30 0157 E6 80 0 I 59 B8 028F OISC E8 0000 E EI9A: MOV OUT AL ,30H MFG_PORT ,AL MOV CALL AX.2-H+CMOS SHUT DOWN+NMI CMOS_WR I TE - <><> <><><> <> <><><><><> <> <><> CHECKPO I NT 30 <><> ; ADDRESS FOR SHUTDOWN BYTE SECOND ENTRY I N SHUTDOWN TABLE ENABLE PROTECTED MODE 01 SF BC 0000 8E 04 0164 BC 8000 a I 62 MOV MOV MOV SP,POST SS SS, SP SP.POST_SP SET STACK FOR SYSINITI GO ENABLE PROTECTED MODE 0167 E8 0000 E CALL SYSINITI 016A BO 31 0 !6C E6 80 MOV DUT AL,31H MFG_PORT,AL SET TEMPOMRY STACK a I 6E 5-60 6A 08 TEST2 PUSH BYTE PTR GOT _PTR <> <><><> <> <> <><><> <> <> <> <><> CHECKPOINT 31 <><> 1-4 06-10-85 IBM Personal Computer MACRO Assembler Version 2.00 TEST2 ---- 06/10/85 POST TESTS AND INITIALIZATION ROUTINES 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 0 I 70 Ot71 0178 0 I 7E 0181 0 I 83 07 26: C7 06 005A 0000 26: C6 06 005C 00 BE 0058 8E 06 BC FFFD POP MOV MOV MOV MOV MOV ES ES: SS TEMP. 8ASE LO WORD, 0 BYTE PTR ES: ISS-TEMP. BASE H I BYTE), 0 S [ ,SS TEMP SS,S[SP, MAX_SEG_LEN-2 DATA SEGMENT TO SYSTEM DATA AREA 0186 6A 0188 IF 18 0189 BO 80 018B E6 87 PUSH POP 8YTE PTR RSDA PTR MOV OUT AL,PARITY CHECK DMA_PAGE+6,AL OS POINT TO DATA AREA SET CHECK PAR[TY SAVE WHICH CHECK TO USE PR I NT 64 K BYTES OK 0180 88 0040 0190 E8 099F R STARTING AMOUNT OF MEMORY OK POST 65K OK MESSAGE "OV CALL 362 363 GET THE MEMORY 5 I ZE DETERM I NED (PREPARE 8X AND OX FOR BAD CMOS) 364 MOV CALL XCHG CALL MOV MOV ADD 8081 0000 E EO 0000 E IE 0013 R 03 08 AX, (CMOS U M S LO+NMI) ·H+CMOS U M 5 HI+NMI CMOS READ - - HIGH BYTEAH,AL SAVE HIGH 8YTE CMOS READ LOW 8YTE 8X,@MEMORY SIZE LOAD THE BASE MEMORY SIZE DX,8X SAVE BASE MEMORY SIZE BX, AX SET TOTAL MEMORY SIZE 365 366 367 368 369 370 371 0193 B8 0196 E8 019986 0198 E8 019E 88 0lA2 88 0lA4 03 372 373 374 375 376 0lA6 80 8E 0lA8 E8 0000 E "OV CALL AL,CMOS D[AG+NMI CMOS_READ OETERM I NE THE COND I T I ON OF CMOS GET THE CMOS STATUS OIAB A8 CO DIAD 74 02 0 I AF EB 58 TEST JZ JMP AL,8AD BAT+BAO CKSUM E2D80 SHORT E20C CMOS OK? GO IF YES DEF AUL T I F NOT I S CMOS GOOD? 377 378 379 380 381 382 383 384 385 386 387 388 389 390 GET THE BASE 0->640K MEMORY SIZE FROM CONFIGURATION 0181 0181 0184 0187 0189 0188 018E OICO 889596 E8 0000 E 24 3F 86 EO E8 0000 E 3B DO 74 13 MOV CALL 50 B8 E8 DC 86 E8 58 38 PUSH MOV CALL AND XCHG CALL eMP JZ 391 392 393 394 395 396 397 398 399 400 40 I 402 403 404 405 IN CMOS AX,(CMOS B M S LO+NMI)·H+CMOS B M S HI+NMI CMOS READ - - H[GH BYTe AL,03FH MASK OFF THE MANUFACTURING TEST BITS ~~O~L READ ; ; ; DX,AX E20BI ~~~E B~~~H O~Y~~SE MEMORY SIZE IS MEMORY SIZE GREATER THAN CONFIG? GO IF EQUAL SET MEMORY SIZE DETERM I NE NOT EQUAL TO CONF I GURA T I ON 0lC2 0 I C3 0lC6 0lC9 0lC8 OICO DIDO 0I0I 0103 0105 0105 0107 8E8E 0000 E 10 C4 0000 E DO TT 37 AX XCHG CALL POP eMP JA DX,AX E20C SAVE AX ADDRESS THE STATUS BYTE GET THE STATUS SET CMOS FLAG SAVE AL AND GET ADDRESS WRITE UPDATED STATUS RESTORE AX [S MEMORY SIZE GREATER THAN CONF [G DEFAULT TO MEMORY SIZE DETERMINED 7 MOV MOV BX,AX DX,AX SET 8ASE MEMORY SIZE IN TOTAL REGISTER SAVE IN BASE SIZE REG[STER OR AX,X· (CMOS DIAG+NMI) CMOS READ AL,W-MEM SIZE AL,AH CMOS WR ITE AX - 7 E20BI: 8808 88 DO 406 407 408 409 010988 9798 410 OIDC E8 0000 E 411 OIDF 86 EO 412 OIEI E8 0000 E 413 0lE4 88 C8 414 415 416 0lE6 88 8081 4170lE9E80000E 418 OIEC 86 EO 419 OIEE E8 0000 E 420 421 CHECK MEMORY SIZE ABOVE 640K FROM CONF[GURATION MOV AX, (CMOS EMS LO+NMI ~ -H+ (CMOS EMS HI +NMI ~ CALL CMOS READ - - ; HIGH-BYTE XCHG AH,AL ; SAVE HIGH BYTE CALL CMOS READ ; LOW BYTE MDV CX,AX ; SAVE THE ABOVE 640K MEMORY SIZE ABOVE 640K SIZE FROM MEMORY SIZE DETERMINE CX=CONFIG AX=MEMORY SIZE DETERMINE MOV AX, (CMOS U M 5 LO+NMI) ·H+ (CMOS U M 5 HI +NMI) CALL CMOS READ - - ; HIGH-BYTE XCHG AH,AL ; SAVE HIGH 8YTE CALL CMOS READ ; LOW BYTE WH [CH IS GREATER - AX = MEMORY 5 [ZE DETERM I NE -- CX = CONFIGURATION (ABOVE 640) BX = SIZE (BELOW 640) 422 423 424 425 426 427 428 429 430 431 432 433 434 0 I F I 38 C8 0lF3 74 OF CMP JZ 0lF5 01 F6 0lF9 OIFC OIFE 0200 0203 PUSH MOV CALL ; : IS CONFIGURATION EQUAL TO DETERMINED? GO I F EQUAL SET MEMORY SIZE DETERMINE NOT EQUAL TO CONFIGURATION 50 88 E8 DC 86 E8 58 8E8E 0000 E 10 C4 0000 E OR XCHG CALL POP AX,X· (CMOS DIAG+NMI CMOS READ AL,W-MEM SIZE AL, AH CMOS WR I TE AX ~ - SAVE AX ADDRESS THE STATUS BYTE GET THE STATUS SET CMOS FLAG SAVE AL UPDATE STATUS BYTE RESTORE AX 435 436 437 438 439 440 441 442 443 444 0204 0204 0206 0208 020A 020A 020C 020C 0210 445 446 447 448 449 450 451 452 453 454 455 456 0212 0215 0218 021 A 021C 021F 021F 0223 0226 0227 38 C8 TT 02 88 C8 03 09 81 FA 0201 72 00 88 E8 OC 86 E8 8383 0000 E 80 C4 0000 E SETMEMI: CMP JA MOV SET MEM: ADD E20C: eMP CX,AX SET MEM Cx,AX IS CONFIG GREATER THAN DETERMINED? GO IF YES USE MEMORY 5 [ZE DETERM I NE SET TOTAL MEMORY SIZE 8X,CX CHECK IF BASE MEMORY LESS 512K GO IF YES J8 MOV CALL OR XCHG CALL 89 IE 0017 R C I E8 06 MOV SHR 48 C I EA 06 DEC SHR AX,X·(CMOS CMOS READ AL,M640K AL,AH CMOS_WRITE [NFOI28+NMI) WORD PTR @KB FLAG, BX BX,6 8X DX,6 SET 640K BASE MEMORY BIT GET THE CURRENT STATUS TURN ON 640K BIT I F NOT ALREADY ON SAVE THE CURRENT DIAGNOST[C STATUS RESTORE THE STATUS SAVE TOTAL 5 I ZE FOR LATER TEST I NG DIVIDE BY 64 1ST 64K ALREADY DONE DIVIDE BY 64 FOR BASE TEST2 5-61 IBM Persona I Computer MACRO Assemb I er Vers i on 2.00 TEST2 ---- 06/10/85 POST TESTS AND INITIALIZATION ROUTINES 457 456 459 460 461 462 463 464 465 466 461 466 469 410 471 412 473 414 475 476 471 476 479 460 481 482 483 484 465 46. 467 488 489 490 491 492 493 494 495 49. 491 498 499 500 501 502 503 504 505 506 507 508 509 510 ~: ~ 513 514 515 516 517 518 519 520 521 522 523 524 525 52. 527 528 529 530 531 532 533 534 535 53. 537 536 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 551 558 559 5'0 SAVE COUNTS IN STACK FOR BOTH MEMORY AND ADDRESSING TESTS ox 022A 52 022B 6A 40 0220 53 PUSH PUSH PUSH BYTE PTR 64 022E 52 022F 6A 40 0231 53 PUSH PUSH PUSH BYTE PTR 64 ;----0232 6A 08 0234 01 POP ;----- SAVE BASE MEMORY SIZE COUNT SAVE STARTING AMOUNT OF MEMORY OK SAVE COUNT OF 64K BLOCKS TO BE TESTED OX BX BYTE PTR GOT PTR E5 MOD I FY THE OESCR I PTOR TABLE - SET TEMPORARY ES DESCRIPTOR 64K SEGMENT LIMIT STARTING AT 000000 0235 023C 0243 0249 26: 26: 26; 26: C1 C7 C6 C6 06 06 06 06 0048 004A 004C 0040 FFFF 0000 00 93 MOV MOV MOV MOV 024F 0256 0250 0263 26 26 26 26 C1 C1 C6 C6 06 06 06 06 0060 0062 0064 0065 FFFF 0000 00 93 MOV MOV MOV MOV 0269 026B 0260 026F 0211 2A E6 E6 FE E6 ES: ES TEMP. SEG LI MIT, MAX SEG LEN ES:ES-TEMP.BAsE La WORD,O BYTE PTR ES: (ES-TEMP.BASE HI BYTEI,O ; FIRST 65K BYTE PTR ES: (ES::::TEMP.DATA::::ACC_RIGHTS) ,CPLO_DATA_ACCESS SET TEMPORARY OS DESCRIPTOR 64K SEGMENT LIMIT AT FIRST 65K 8LOCK ~~: g~-i~~~: ~~~EL ~~ I ~O~~~OSEG_LEN BYTE PTR ESI lOS-TEMP.BASE HI BYTEI,O BYTE PTR ES: lOS::::TEMP.DATA::::ACC_RIGHTS) ,CPLO_DATA_ACCESS TEMPORARY SEGMENT SAVE IN DMA PAGE REGI STER FOR SECOND 65K BLOCK CO 85 86 CO 84 SUB OUT OUT ; ----0273 0213 6A 08 0215 IF 0276 FE 06 0064 021A FE 06 004C INC AL - OUT DMA_PAGE+3,AL MEMORY TEST LOOP - E21: PUSH POP I NC INC ; ----- AL,AL DMA PAGE+4, AL DMA-PAGE+5.AL INITIALIZE VALUES TO 010000 HIGH BYTE OF LOW WORD OF SEGMENT LOW BYTE OF LOW WORD OF SEGMENT SET HIGH BYTE OF SEGMENT WORD HIGH BYTE OF SEGMENT PO I NT TO NEXT BLOCK OF 32K WORDS (64K) ; MEMORY TEST LOOP BYTE PTR GOT PTR ; PO I NT TO START OF DESCR I PTOR TABLE OS BYTE PTR OS: (OS TEMP. BASE H I BYTE I ; PO I NT TO NEXT BLOCK 8YTE PTR OS: (ES::TEMP. BASE::::H I::::BYTE) CHECK FOR END OF 256K PLANAR MEMORY 021E 80 3E 0064 04 0283 12 04 CMP ..JB 8YTE PTR OS: (OS TEMP. BASE H I BYTE), 04H E21_0 i-GO-IF STILL FIRST 256K OF BASE MEMORY 0285 BO CO 0281 E6 81 MOV OUT AL. PAR I TY CHECK+ 10 CHECK; DMA_PAGE+6.AL ; 0289 0289 80 3E 0064 OA 028E 17 16 ~~~~~~ ;----- 0290 0291 0292 0293 0294 0295 0296 029A 59 5B 58 50 53 51 38 06 0064 12 OA CMP ..JA 029C C6 06 0064 10 02A 1 C6 06 004C 10 BYTE PTR OS: (OS TEMP.BASE HI BYTE) ,OAH NEXT ;-CONTINUE IF ABOVE PUSH PUSH PUSH CX BX AX AX BX CX 1 MEG GET COUNT GET COUNT TESTED RECOVER COUNT OF BASE MEMORY BLOCKS SAVE BASE COUNT SAVE TESTED COUNT ; SAVE TOTAL COUNT CMP JB ~~~~ PTR OS: {DS_TEMP.BAS7_~6N~i~~~·~~ 00 ADDITIONAL STORAGE ABOVE I NOT DONE W;T~A~A~~S~E~g~~T MEG MOV MOV ;----- SAVE BASE_Hi_BYTE iN DMA PAGE REGISTERS 3 NEXT: MOV OUT ~~AB~!~E~~~A~S; {DS_TEMP.~A;~V~IT~~T~:GH - CHECK FOR TOP OF MEMORY 02AB 80 3E 004C FE 0280 74 29 ; (FEOOOO) BYTE OF SEGMENT FOR POSS I BLE ERROR 16 MEG TOP OF MEMORY? EX I T NEXT TEST CMP JE ; ----0282 0284 02B5 0281 CHECK FOR ANY TYPE OF PAR I TY ERROR AFTER FIRST 256K (END OF MAXIMUM BASE MEMORY) CHECK FOR END OF BASE MEMORY TO BE TESTED POP POP POP ; ----- 02A6 AO 0064 02A9 E6 84 CHECK END OF FIRST 640K OR ABOVE 6A 60 IF 6A 48 01 SET ES AND OS REG I STERS TO MEMORY BLOCK PUSH POP BYTE PTR OS_TEMP OS PUSH BYTE PTR ES_ TEMP POP ES 02B8 BO 3 I 02BA E6 80 MOV OUT AL,31H MFG_PORT ,AL 02BC 02BF 02C2 02C4 02C1 02C1 02C8 MOV SET COUNT FOR 32K WORDS CALL CX,8000H STGTST_CNT JZ JMP N1 E21A SKIP IF OK GO PR I NT ERROR POP POP CX AX B9 E8 74 E9 8000 0000 E 03 0361 R <><> <> <> <><><><> <> <> <> <> <><> CHECKPO I NT 31 NI: 59 58 WRITE THE CURRENT SIZE FOR PDP CX TO GET AX RECOVER TESTED MEMORY (ADDRESS LINE 23-11 TEST) USED LATER 02C9 2B FF 02CB AB SUB STOSW DI,DJ 02CC 05 0040 02CF 50 0200 51 ADD PUSH PUSH AX,64 AX CX POINT TO BEGINNING OR A BLOCK WR I TE THE CURRENT SIZE AT THE STARTING ADDRESS ADVANCE COUNT TO NEXT BLOCK SAVE TESTED MEMORY SAVE LOOP COUNT 0201 CALL PRT_OK OJ SPLAY 5.5 566 561 568 5.9 570 SAVE BASE MEMORY SIZE COUNT SAVE STARTING AMOUNT OF MEMORY OK SAVE COUNT OF 64K BLOCKS TO BE TESTED BX MODJFY DESCRIPTOR TABLES PUSH 561 5.2 563 564 1-5 06-10-85 5-62 E8 099F R TEST2 "OXXXX OK ~ MESSAGE I F DONE ,-. IBM Personal Computer MACRO Assembler Version 2.00 TEST2 ---- 06/10185 POST TESTS AND INITIALIZATION ROUTINES 511 572 573 57. 575 576 577 578 579 580 58' 582 583 58' 585 586 587 588 589 590 59' 592 593 59. 595 596 597 598 599 600 601 602 603 0204 59 0205 49 0206 E3 03 POP 0208 51 0209 EB 98 PUSH ex J"P E2' 60' 02FO 02FO BO 33 02FF E6 80 0301 26: 80 06 0064 01 60S 606 607 608 609 610 6" 6'2 020B 020B 58 020C 58 DEC JCXZ K8 LOOP3: POP POP 06- \ 0-85 RECOVER 64K BLOCK COUNT DECREMENT BLOCK COUNT FOR LOOP CONTINUE TO NEXT TEST IF DONE CX CX K8_LOOP3 SAVE LOOP COUNT LOOP TILL ALL MEMORY CHECKED END MA I N TEST LOOP CLEAR MAX I MUM BLOCK COUNT CLEAR 8ASE SIZE COUNT FROM STACK ADDRESS TEST VALUES ARE IN STACK AX AX ADDRESS LINE 16-23 TEST 0200 B9 40BB 02EO E8 0000 E "OV CALL 02E3 OZE5 02E6 02EC 6A 08 07 26: C6 06 0064 00 26: C7 06 0062 0000 PUSH POP MOV MOV 02F3 02F5 02F7 02F9 02FB 2A E6 E6 BO E6 INITIALIZE ;----CO 85 86 01 84 os DESCRIPTOR BYTE PTR GOT PTR ES BYTE PTR ES: (OS TEMP.BASE HI BYTE~ ,0 ES:DS_TEMP,BASE:LO_WORD,O-- TEMPORARY SEGMENT SAVE IN OMA PAGE REGISTER SUB OUT OUT "OV OUT ;----- LET FIRST PASS BE SEEN COUNT FOR 250 MS F I XED T I ME DELAY ALLOW S I X 0 I SPLAY REFRESH CYCLES CX,16511 WAITF AL,AL OMA PAGE+4,AL OMA-PAGE+5,AL AL,OIH OMA_PAGE+3,AL HIGH BYTE OF LOW WORD OF SEGMENT LOW BYTE OF LOW WORD OF SEGMENT SET HIGH BYTE OF SEGMENT WORD HIGH BYTE OF SEGMENT POINT TO NEXT BLOCK OF 64K E21_A: MOV OUT ADO ; ----- AL,33H <><><><><><><><><><><><> MFG PORT, AL , < > < > CHECK PO 1NT 33 <><> BYTE PTR ES: (DS_TEMP.BASE_HI_BYTEI ,01 CHECK FOR END OF BASE MEMORY TO BE TESTED 0307 26: 80 3E 0064 OA 0300 77 13 CMP JA BYTE PTR ES: (OS TEMP.BASE HI BYTEI, OAH NEXT_A -CONTINUE IF ABOVE 030F 0310 0311 0312 0313 0314 0315 031A POP POP POP PUSH PUSH PUSH CMP JB CX I GET COUNT BX ; GET COUNT TESTED AX ; RECOVER COUNT OF BASE MEMORY BLOCKS AX ; SAVE BASE COUNT BX : SAVE TESTED COUNT CX ; SAVE TOTAL COUNT BYTE PTR ES: (OS TEMP.BASE HI BYTE~ ,AL ; MAX BASE COUNT NEXT_A ;-CONTINUE IF NOT DONE WITH BASE MEMORY I MEG 6'3 6" 6'5 6'6 6" 6'8 6,9 620 62' 622 623 62' 625 626 627 628 629 630 63' 632 633 63. 635 636 6" 59 58 58 50 53 51 26: 38 06 0064 12 06 DO ADD 1T I ONAL STORAGE ABOVE 031C 031C 26: C6 06 0064 10 0322 0322 26: AO 0064 6.' 6'2 6.3 6.5 6'6 6.7 6.8 6.9 650 65' 652 653 65. 655 656 657 658 659 660 66' 662 663 66' 665 666 6.7 668 669 670 611 672 6-73 67. 675 6,. 6" 678 0326 E6 84 0339 033C 033F 0340 0341 0342 0343 0345 0341 89 E8 59 58 50 51 3B 8B 15 60 68' ; ; CHECK FOR TOP OF MEMORY JZ ;----- 6A IF 2B 88 8B 2B 89 AL,BYTE PTR ES: (OS_TEMP.8ASE_HI_BYTEI DMA PAGE REGISTERS 3 e"p 0328 3C FE 032A 14 34 032C 032E 032F 0331 0333 0335 0337 1 MEG BYTE PTR ES: (OS_TEMP.BASE_Hl_BYTEl ,I OH OUT :----- AL,OFEH KB_LOOP _3 (FEOOOO] SAVE THE HIGH BYTE OF SEGMENT FOR POSSIBLE ERROR 16 MEG ; : TOP OF MEMORY? GO NEXT TEST IF IT IS SET OS REGISTER PUSH POP SUB BYTE PTR OS TEMP as FF 15 F7 CO 05 "OV "OV 1 A69 0000 E "OV CALL CX,6761 WAITF POP POP PUSH PUSH CX CX "OV JNZ AX,OX AX,OX E21A SUB "OV - PO I NT TO START OF BLOCK GET THE VALUE OF TH I S BLOCK SET SI FOR POSSIBLE ERROR CLEAR MEMORY LOCAT I ON 01,01 DX,oS:[DI] SI,DI AX,AX [01] ,AX ALLOW D I SPLA Y T I ME TO 0 I SPLA Y MESSAGE AND REFRESH TO RUN C2 C2 IE e"p COUNT FOR 102 MS F I XED T I ME DELAY ALLOW FIVE 0 I SPLA Y REFRESH CYCLES GET THE LOOP COUNT RECOVER TESTED MEMORY SAVE TESTED MEMORY SAVE LOOP COUNT DOES THE BLOCK 10 MATCH GET THE BLOCK 10 FOR POSS IBLE ERROR GO PR I NT ERROR AX AX CHECK FOR CHECK PAR 1TY 0349 E4 61 0348 24 CO 0340 15 18 AND JNZ 034F 0350 0351 0354 0355 0356 0359 035A 035B POP POP ADD PUSH PUSH CALL POP OEC JCXZ 59 58 05 0040 50 51 E8 099F R 59 49 E3 03 0350 51 035E EB 90 679 .80 .82 683 68' "OV ;----- 638 639 6.0 64. NEXT A2: MOV [N AL,PORT B AL,PARITY ERR E21A - CHECK FOR 110 OR PARITY CHECK STRIP UNWANTED BITS EXIT IF PARITY ERROR CX POP CX TO GET AX RECOVER TESTED MEMORY 64K INCREMENTS SAVE TESTED MEMORY SAVE LOOP COUNT 01 SPLAY OK MESSAGE RECOVER 64K BLOCK COUNT LOOP TILL ALL MEMORY CHECKED CONTINUE AX AX,64 AX CX PRT OK CX CX KB_LOOP _3 PUSH CX J"P E21_A SACK TO REAL MODE 0360 0360 BO 34 0362 E6 80 KB LOOP 3: -MOV OUT AL,34H MFG_PORT ,AL SAVE LOOP COUNT CONTINUE TILL DONE MEMORY TESTS DONE <> <><><><><><><> <><><><> <><> CHECKPOINT 34 <><> TEST2 5-63 IBM Personal Computer MACRO Assembler Version 2.00 TEST2 ---- 06/10/85 POST TESTS AND INITIALIZATION ROUTINES 6.5 686 6.7 0364 E9 0000 E J"P 1-7 06-10-85 : ; PROC_SHUTDOWN BACK TO REAL MOOE NEXT TEST V I A JUMP TABLE I SHUT2) 6 •• 6.9 690 691 &92 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 71 7 718 719 ;----;----; 0367 0369 036B 0360 036F 0371 0373 E6 8A E6 88 E6 86 E6 82 C4 83 C6 86 0375 0377 0378 037A 037C 037E 0380 0382 28 F6 A8 E4 61 E6 88 OC OC E6 61 24 F3 E6 61 E21 A: OUT "OY OUT "OY OUT XCHG OUT EO 85 ; ----- CLEAR I/O CHANNEL CHECK OR R/W PARITY CHECK S[ •SI WRITE TO FAILING BLOCK AL,PORT B DMA PAGE+7,AL AL, RAM PAR OFF PORT B7AL AL. RAM PAR ON PORT_B7AL - GET PAR I TY CHECK LATCHES SAVE FOR ERROR HANDLER TOGGLE J ID-PAR I TY CHECK ENABLE TO RESET CHECKS AND 0384 58 038558 0386 5B 0387 C 1 E3 06 038A 2B C3 038C 73 17 (LOW BYTE) GET THE FA I LING OFFSET IN OUT ; ----- SAVE FAILING BIT PATTERN SAVE HIGH BYTE DMA PAGE+I .AL AL,AH DMA PAGE+2,AL AX,51 OMA PAGE+5.AL AH,AL DMA_PAGE+4,AL SUB STOSW OUT OR OUT GET THE LAST OF GOOD MEMORY POP POP POP SHL SUB JAE 720 721 722 723 724 PRINT FAILING ADDRESS AND XOR'ED PATTERN IF DATA COMPARE ERROR USE DMA PAGE REGI STERS AS TEMPORARY SAVE AREA FOR ERROR SET SHUTDOWN 3 AX AX CLEAR BLOCK COUNT GET THE LAST OF GOOD MEMORY GET BASE MEMORY COUNTER CONVERT TO MEMORY SIZE COUNTS COMPARE LAST GOOD MEMORY WITH BASE I F ABOVE OR EQUAL, USE REMA I NDER IN CMOS_U_M_S_IH/U BX 8X,6 AX,BX E21 I ELSE SET BASE MEMORY SIZE 038E 6A 0390 IF 18 PUSH POP BYTE PTR RSDA PTR OS - SET THE DATA SEGMENT I N PROTECTED MODE ADO AX,ax IPMEMORY SIZE, AX CONVERT BACK TO LAST WORK I NG MEMORY TO INDICATE HOW MUCH MEMORY WORKING 725 726 727 72. 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 74' 745 746 747 748 749 750 751 752 0391 03 C3 0393 A3 0013 R "OY RESET 512K --> 640K OPT I ON 0396 0399 039C 039E 03AO 03A3 03A5 03A5 03A7 03A9 03AC 03AE 0380 B8 E8 24 86 E8 33 8383 0000 E 7F C4 0000 E CO 8B 80 E8 8A BO E8 C8 BI 0000 E EI BO 0000 E XCHG CALL XOR ADDRESS OPTIONS INFORMATION BYTE READ THE MEMORY INFORMATION FLAG SET 640K OPT I ON OFF MOVE TO WORK REG I STER UPDATE STATUS IF IT WAS ON CLEAR VALUE FOR EXTENS J ON MEMORY "OY "OY CALL "OY "OY CALL CX,AX AL,CMOS U M S HI+NMI CMOS WRITE - AH,C[ AL,CMOS U M S LO+NMI CMOS_WRITE - - SAVE ADJUSTED MEMORY 51 ZE AND E21 1: ; ----- "OY CALL 03B9 E9 0000 E JMP AX,3·H+CMOS SHUT _ DOWN+NM I CMOS_WRITE SHUTDOWN TEST2 SAVE THE HIGH BYTE MEMORY SIZE GET THE LOW BYTE DO THE LOW BYTE WRITE IT SET SHUTDOWN 3 0383 88 a38F 0386 E8 0000 E 5-64 I F SET AX,X·(CM05INFOI28+NMI) CMOS READ AL, NOT M64QK AL,AH CMOS WR ITE AX,AX "OY CALL PROC_SHUTDOWN ADDRESS FOR SHUTDOWN RETURN SET RETURN 3 '-8 IBM Personill Computer MACRO Assembler Version 2.00 TEST2 ---- 06/10/85 POST TESTS AND INITIALIZATION ROUTINES 753 PAGE ; 754 755 756 757 758 759 760 76' 762 763 764 765 766 767 768 769 ; -- - -- - - -- - -- - - -- - -- -- -- - -- - - -- - -- - - -- - - -- - -- - - - - - -- - - -- - -- - - - - - - - - -(R/WI MEMORY OR PAR[TY ERRORS) MEMORY ERROR REPORTING DESCR[PTION FOR ERRORS 201 OR 202 "AABBCC DDEE 201" (CMP ERROR OR PAR[TY) (ADDRESS LINE 0-15 ERROR) (OR 202) AA=H I GH BYTE OF 24 B IT ADDRESS BB=M[DDLE BYTE OF 24 BIT ADDRESS CC=LOW BYTE OF 24 BI T ADDRESS OD=HIGH BYTE OF XOR FA[LlNG B[T PATTERN EE=LOW BYTE OF XOR FA[LlNG BIT PATTERN DESCRIPTION FOR ERROR 202 (ADDRESS LINE 00-151 A WORD OF FFFF IS WRITTEN AT THE FIRST WORD AND LAST WORD OF EACH 64K BLOCK WITH ZEROS AT ALL OTHER LOCATI ONS OF THE BLOCK. A SCAN OF THE BLOCK I S MADE TO I NSURE ADDRESS LI NE a-Is ARE FUNCTIONING. 770 771 772 773 774 775 776 777 778 779 780 78' 782 783 784 785 786 787 788 789 790 79, 792 793 794 795 796 797 798 799 800 80 , 802 803 804 805 806 807 808 809 06-10-85 DESCRIPTION FOR ERROR 203 (ADDRESS LINE 16-23) AT THE LAST PASS OF THE STORAGE TEST, FOR EACH BLOCK OF 64K, THE CURRENT STORAGE SIZE (101 IS WRITTEN AT THE FIRST WORD OF EACH BLOCK. IT IS USED TO FINO ADDRESSING FAILURES. "AABBCC OOEE 203" SAME AS ABOVE EXCEPT FOR DOEE GENERAL DESCRIPTION FOR BLOCK 10 DD=H I GH BYTE OF BLOCK [0 EE=LOW BYTE OF BLOCK 10 BLOCK 0000 0040 [0 (DDEE WILL NOW CONTAINED THE 10) ADDRESS RANGE 000000 --> OOFFFF 010000 --> OIFFFF /I 090000 --> 09FFFF 100000 --> 10FFFF 0200 (512->576K) [F 640K BASE (1024->1088K) IF 512K BASE EXAMPLE (640K BASE MEMORY + 512K I fO MEMORY = I 152K TOT ALl NOTE: THE CORRECT SLOCK 10 FOR THIS FAILURE IS 0280 HEX. DUE TO AN ADDRESS FAILURE THE BLOCK ID+128K OVERLAYED THE CORRECT BLOCK 10. 00640K OK 10000 0300 202 <-- LAST OK MEMORY <-- ERROR DUE TO ADDRESS FAILURE IF A PARITY LATCH WAS SET THE CORRESPONDING MESSAGE W[LL D[SPLAY. "PARITY CHECK I" (OR 21 DMA PAGE REGISTERS ARE USED AS TEMPORARY SAVE AREAS FOR SEGMENT OESCR I PTOR VALUES. 03BC 038C E8 0000 E SHUT3 : ENTRY FROM PROCESSOR SHUTDOWN 3 SET REAL MOOE DATA SEGMENT CALL DDS MOV MOV «tMFG ERR FLAG+l,MEM FA[L; ",L,CR -; PRT HEX AL,CF PRT HEX AL,DMA PAGE+3 XPC BYTE AL,DMA PAGE+4 XPC BYTE AL,DMA PAGE+5 XPC BYTE AL,T , PRT HEX AL,OMA PAGE+2 XPC BYTE AL,OMA PAGE+ I XPC_8YTE BlO 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 83' 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 03BF 03C4 03C6 03C9 03CB 03CE 0300 0303 0305 0308 030A 0300 030F 03E2 03E4 03E7 03E9 C6 BO E8 80 E8 E4 E8 E4 E8 E4 E8 BO E8 E4 E8 E4 E8 06 0016 R 01 00 0000 E OA 0000 E 84 0000 E 85 0000 E 86 0000 E 20 0000 E 83 0000 E 82 0000 E 03EC 03EE 03FO 03F3 E4 3C BE 14 80 33 0000 E OA 'N eMP MOV 03F5 BE 0000 E 03F8 3C 32 03FA 74 03 MOV eMP CALL MOV CALL 'N CALL 'N 'N CALL CALL MOV CALL 'N 'N CALL CALL <><> MEMORY FAILED <><> CLEAR AND SET MANUFACTURING ERROR FLAG CARR I AGE RETURN LINE FEED GET THE HIGH BYTE OF 24 BIT ADDRESS CONVERT AND PR I NT CODE GET THE MIDDLE BYTE OF 24 BIT ADDRESS GET THE LOW BYTE OF 24 B [T ADDRESS SPACE TO MESSAGE GET HIGH BYTE FAILING BIT PATTERN CONVERT AND PR INT CODE GET LOW BYTE FAILING BIT PATTERN CONVERT AND PR INT CODE CHECK FOR ADDRESS ERROR 03FC BE 0000 E 03FF 03FF E8 0000 E 0402 E4 88 JZ JZ AL ,MFG_PORT AL,33H S I ,OfFSET E203 ERR2 GET THE CHECKPO I NT 15 IT AN ADDRESS FAILURE? LOAD ADDRESS ERROR 16->23 GO IF YES S I ,OFFSET E202 AL,32H ERR2 LOAD ADDRESS ERROR 00-> 15 GO IF YES MOV SI,OFFSET E201 SETUP ADDRESS OF ERROR MESSAGE CALL E MSG AL,DMA_PAGE+1 PRINT ERROR MESSAGE GET THE PORT_B VALUE ERR2: 'N DISPLAY "PARITY CHECK 0404 A8 80 0406 74 OB TEST JZ NM' 0408 0409 040C 040F 0412 0413 0413 0415 PUSH CALL 50 E8 098F R BE 0000 E E8 0000 E 58 MOV CALL NM' A8 40 14 09 0417 E8 098F R 041A BE 0000 E 0410 E8 0000 E 0420 - MI: TEST JZ NM' CALL - PADING 51 ,OFFSET 01 P MSG AX MOV NM' - M' AX POP CALL ?" ERROR MESSAGES AL,PAR[TY_CHECK AL,IO_CHECK - M2 PADING S I ,OFFSET 02 P _MSG CHECK FOR PLANAR ERROR SKIP IF NOT SAVE STATUS I NSERT BLANKS PLANAR ERROR, ADDRESS "PARITY CHECK DISPLAY "PARITY CHECK I" MESSAGE AND RECOVER STATUS I/O PAR I TV CHt=:CK 1 SK I P I F CORRECT ERROR D I SPLA YEO I NSERT BLANKS ADDRESS OF "PAR I TY CHECK 2" MESSAGE DISPLAY "PARITY CHECK 2" ERROR M2: CONTINUE TESTING SySTEM •••• TEST2 5-65 j" IBM Personal Computer MACRO Assembler Version 2.00 TEST2 ---- 06/10/85 POST TESTS AND INITIALIZATION ROUTINES 8.5 8 •• 8.7 868 8.9 870 871 872 873 874 875 87. 877 878 879 880 881 882 PAGE ;----0420 1-9 06-10-85 ENTRY FROM SHUTDOWN SHUT2 : ;- - - -- -- - - - - - - -- -- ---- - - - - - - - - - - - - - - - - - - --- - - - - - - - - - -- -; TEST. 20 ; ADDITIONAL PROTECTED (VIRTUAL MODE) TEST ; DESCRIPT[ON ; THE PROCESSOR I S PUT [N PROTECTED MODE AND ; THE FOLLOW I NG FUNCT IONS ARE VER I F I ED ; 1. VER I FY PROTECTED MODE ; THE MACHINE STATUS [S CHECK FOR VIRTUAL MODE ; ; 2. PROGRAMMED I NTERRUPT TEST AN PROGRAMMED INTERRUPT 32 IS ISSUED AND ; AND VERIFIED 3. EXCEPT I ON INTERRUPT 13 TEST ; A DESCR I PTOR SEGMENT LIM I TIS SET TO ZERO ; AND A WR I TE TO THAT SEGMENT I S ATTEMPTED ; AN EXCEPT I ON 13 I S EXPECTED AND VER I F I ED ; LOT/SOT LTR/STR TEST LOAD LOT REGISTER AND VERIFY CORRECT LOAD TASK REG I STER AND VER I FY CORRECT ; THEY ARE VERIFIED VIA THE STORE INSTRUCTION ; 5. THE CONTROL FLAGS OF THE 286 FOR D[RECTIDN ; ARE VER I F I ED V I A THE STo AND CLD COMMANDS ; ; I N PROTECTED MODE BOUND INSTRUCTION TEST (EXCEPTION INT 5) ; CREATE A SIGNED ARRAY INDEX WITHIN AND ; OUTSIDE THE LIMITS. CHECK THAT NO EXC INT IF WITHIN LlM[T AND THAT AN EXC INT 5 ; OCCURS I F OUTS I DE THE LI M I TS. ; 7. PUSH ALL POP ALL TEST ; SET GENERAL PURPOSE REGISTERS TO DIFFERENT ; VALUES, ISSUE A PUSH ALL, CLEAR THE REGISTERS ; THEN I SSUE A POP ALL AND VER I FY CORRECT. 8. CHECK THE VERR/VERW INSTRUCTIONS ; THE ACCESS BYTE I S SET TO READ ONLY THEN TO ; A WR I TE ONLY AND THE VERR / VERW I NSTRUCT IONS ; ARE VERIFIED. ; 9. CAUSE AN INTERRUPT 13 VIA A WRITE TO A ; ; READ ONLY SEGMENT ; VERIFY THE ARPL INSTRUCTION FUNCTIONS SET THE RPL FIELD OF A SELECTOR AND VERIFY THAT CURRENT SELECTOR RPL IS SET ; CORRECTLY. 11. VERIFY THE LAR INSTRUCTION FUNCTIONS ; 12. VERIFY THE LSL INSTRUCTION FUNCTIONS ; 13. LOW MEG CH I P SELECT TEST ; 803 884 885 88. 887 888 889 890 891 892 893 894 895 89. 897 898 899 900 901 902 903 904 905 90. 907 908 909 910 911 912 913 914 915 91. 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 93. 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 95. 957 958 959 900 961 962 963 964 905 906 967 968 969 910 971 972 973 914 975 976 977 978 0420 E9 0000 E JMP POST3 GO TEST THE 286 PROTECTED MODE FAILURE ENTRY FROM A SHUTDOWN 0423 0426 0428 042A 0420 042F E8 E4 3C BE 14 BE 0000 E 80 35 0000 E 00 0000 E SHUT7: IN JZ SHUT7A: MOV 043280 DE 0016 R 02 0437 E8 0000 E 043A E8 08 043C E8 0000 E 0000 E CO 0017 R OOOE 0082 2A CO EE 42 E2 FA @MFG_ERR_FLAG+I ,PRO_FA ILl CALL E MSG SHORT SHUT6 E_MSG CALL ESTABLISH THE DATA SEGMENT CHECK FOR CH I P SELECT ERROR PR I NT ERROR 109 GO IF NOT PROTECTED MODE FA I LED <><> <><> <> <> <> <> <> <> <><> <> <> <> <><> V I RTUAL MODE FA I LED PR I NT MESSAGE PR I NT MESSAGE <><> <><><> <> <> <> <> <> <> <> <> <> <> <><> LOW MEG CH I P SELECT OR ; ----- E8 28 A3 89 8A 005 AL,MFG PORT AL,35H51 ,OFFSET El09 SHUT7B SI ,OFFSET El04 OR JMP SHUT7B: 043F 80 OE 0016 R 04 0444 0447 0449 044C 044F 0452 0452 0454 0455 0450 CALL eMP MOV SHUT6: PROTECTED MODE TEST PASSED ENTRY FROM A SHUTDOWN CALL DDS SUB MOV MOV MDV AX,AX WORD PTR @KB FLAG, AX CX,OEH OX ,DMA_PAGE+ 1 CLR LOOP: SUB DUT PROTECTED MODE TEST PASSED CLEAR KEYBOARD STATE FLAGS CLEAR PAGE REG I STERS AL,AL DX,AL INC DX LOOP CLR_LOOP ; --- - --- --- -------------- - - -- - --- ---------I ; ; ; ; TEST.21 KEYBOARD TEST DESCRIPTION RESET THE KEYBOARD AND CHECK THAT SCAN CODE n AA" I S RETURNED TO THE PROCESSOR. CHECK FOR STUCK KEYS. - - --- ------------------------- 0458 90 35 045A E6 80 045C 0461 0463 0406 0466 0460 0470 0472 0414 0475 0478 0470 0482 0484 0486 0489 5-66 F6 75 E9 80 75 E9 80 E6 FA 81 74 80 74 80 E8 87 06 0012 R 20 03 0516 R 3E 0072 R 64 03 0516 R 36 80 3E 0072 R 1234 17 3E 0072 R AA 10 AE 0000 E 04 TEST2 MOV OUT AL,35H MFG_PORT ,AL TEST JNZ @MFG TST,MFG LOOP F7 AF7; 8YTE PTR @RESET FLAG,064H F7 B F7AL,36H MFG_PORT ,AL JMP F7_A: CMP JNZ F7_B: MOV OUT eLI JMP eMP JZ eMP JZ MOV CALL MOV <> <> <> <><> <> <><><> <><><> <><> CHECK PO I NT 35 <><> MANUFACTURING BURN IN TEST MODE? YES - SKIP KEYBOARD TEST I MANUFACTURING RUN IN MODE? YES - SK I P KEYBOARO TEST <><><><> <> <> <> <> <> <> <> <> <><> CHECKPOINT 36 <><> @RESET FLAG, 1234H SOFT RESET? Gl0 BYTE PTR @RESET FLAG, KB OK ; CHECK FOR AA ALREADY RECE I YEO GI 0 GO I F YES AL,ENA KBD C8042 ; ENA8LE KEYBOARD 8H,4 ; TRY 4 TIMES IBM Personal Computer MACRO Assembler Version 2.00 TEST2 ---- 00/10/85 POST TESTS AND INITIALIZATION ROUTINES 979 048B 980 048E 981 0490 982 0492 983 0494 984 0490 985 0499 986 049B 987 0490 988 04AO 989 04A3 990 04A5 991 04A7 992 993 04A9 994 995 04AE 996 04B I 997 04B3 998 0486 999 04B8 1000 04BA 1001 04BC 1002 04BF 1003 1004 1005 1006 04CI 1007 04C3 1008 1009 04C5 1010 04C7 101 1 04CA 1012 04CD 1013 04DO 1014 04D2 1015 0404 1016 1017 04D6 1018 04D8 1019 1020 04DA 1021 04DC 1022 04DF 1023 1024 1025 1026 04EI 1027 04E2 1028 04E4 I 029 04E6 1030 04E8 1031 04EA 1032 04EC 1033 04EE 1034 04FO 1035 04F2 1036 04F4 1037 04F6 1038 04F9 1039 04FB 1040 04FD 1041 04FF 10420501 1043 1044 0506 1045 0509 1046 050B 1047 1048 050E 1049 1050 1051 0513 1052 1053 1054 10550516 1056 0518 1057 1058 051A 1059 051C 1060 051E 1061 051F 1062 0521 1063 0524 1064 0526 1065 1060 1067 1068 0528 1069 052A 1070 107 I 1072 1073 0520 1074 052F 1075 0531 1076 0534 1071 0535 1078 0536 1079 0539 1080 053C 1081 0530 1082 053E 1083 053F 1084 1085 1086 1087 1088 0541 1089 0543 1090 0545 1091 0548 1092 0549 E8 75 FE 75 BO E8 E4 BO E8 E8 E4 A8 74 0000 04 CF F7 AD 0000 60 EO 0000 0000 60 01 OA E LOOPI: Gl0: E E E CALL .JNZ DEe .JNZ MDV CALL IN MDV CALL CALL IN TEST JZ 80 DE 0016 R 08 BE EB E8 E3 BO E6 80 75 0000 E 00 0000 E 29 37 80 FB AA 20 1-10 06-10-85 OBF 42 GIO BH LOOPI AL,DIS KBD C8042 AL,PORT A AL,KYBD-CLK DATA C8042 08F 42 AL,PORT A AL,KYBO-CLK CHECK FOR OUTPUT BUFFER FULL GO I F BUFFER FULL o I SABLE KEYBOARD FLUSH GET THE CLOCK AND DATA LINES WAIT FOR OUTPUT BUFFER FULL GET THE RESULTS KEYBOARD CLOCK MUST BE LOW GI I '1'IMFG_ERR_FLAG+ t ,KYCLK_FA I L ; GI I: MOV JMP CALL JCXZ MDV OUT eMP JNE <><><><><><><><><><><><><><><> <><> KEYBOARD CLOCK HIGH <><> DISPLAy 304 ERROR REPORT ERROR I SSUE RESET TO KEYBOARD PR INT ERROR MESSAGE IF NO INTERRUPT S I ,OFFSET E304 SHORT F60 KBD_RESET F. AL,37H MFG PORT, AL BL,KB_OK F6 <> <><><> <> <><><> <><> <> <> <><> CHECKPOINT 37 <><> SCAN CODE AS EXPECTED? NO - DI SPLAY ERROR MESSAGE CHECK FOR STUCK KEYS BO 38 E6 80 MOV OUT AL,38H MFG_PORT ,AL 80 E8 B9 E8 E4 A8 74 MOV CALL MOV CALL IN TEST JE AL ,ENA_KBD C8042 CX ,6628 WAITF AL, STATUS_PORT AL ,OUT _ BUF _FULL F7 BO 39 E6 80 MOV OUT AL , 39H MFG_PORT ,AL E4 60 E8 0000 E EB 2A IN CALL JMP AL,PDRT_A XPC BYTE SHORT F6C AE 0000 E 19E4 0000 E 64 0I 40 <> <><> <> <> <><> <> <> <> <> <> <><> CHECKPOINT 38 <><> ASSURE KEYBOARD ENABLED I S SUE THE COMMAND COUNT FOR 100 MILLISECONDS DELA Y FOR A WH I LE CHECK FOR STUCK KEYS OUT BUFFER FULL? YES - CONT I NUE TEST I NG <> <> <> <> <> <> <> <><> <> <> <> <><> CHECK PO I NT 39 <><> GET THE SCAN CODE CONVERT AND PR I NT CONTINUE KEYBOARD ERROR TRY TO DETERM I NE IF 8042 FA BO AB E6 64 2B C9 B7 05 E4 64 A8 01 ElF A 75 09 FE CF 75 F4 BE 0000 E EB 18 E4 60 3C 00 74 OA 80 OE 0016 R 10 BE 0000 E EB 08 BE 0000 E F6: F6A: F6B: F6C: 80 DE 0016 R 20 E8 0000 E I S WORK I NG MOV JMP MOV AL, I NTR FACE CK COMMAND TO 8042 STATUS PORT,AL CX ,CX BH,05 WAIT FOR OUTPUT BUFFER FULL AL,STATUS PORT AL,OUT BUF FULL 8042 FINISHED TEST? F6A F6B GO CHECK RESULTS BH F6A TRY AGAIN SI ,OFFSET E303 INDICATE PLANAR FAILURE SHORT FoD (REMOVE KEYBOARD TRY AGAIN) AL,PORT A GET THE RESULTS OF [NTERFACE TEST AL,O [S THE INTERFACE OK? F6C OMFG_ERR_FLAG+I,KY_SYS_FAIL; <><><><><><><><><><><><> ; <><> KEYBOARD/SYSTEM <><> S[ ,OFFSET E303 ; PLANAR FAILURE SHORT F6D ; GO I F YES SI,OFFSET E301 ; GET MESSAGE ADDRESS <><><><> <> <> <> <> <> <> <> <> <> <><> KEYBOARD FAILED <><> OR F6D: I NTERF ACE eLi MOV OUT SUB MOV IN TEST LOOPZ JNZ DEC JNZ MOV JMP IN CMP JZ OR CALL ; PRINT MESSAGE ON SCREEN INITIALIZE 8042 TO HONOR KEY LOCK BO 3A E6 80 80 E6 FA BO E8 BO E6 F7: AL,3AH MFG _PORT, AL MOV OUT AL,OFFH INTAOI,AL D[SABl.E INTERRUPTS 60 0000 E 45 60 MOV CALL MOV OUT AL, WR I TE 8042 LOC C8042 AL,45H PORT_A,AL WR I TE 8042 MEMORY COMMAND I SSUE THE COMMAND SET SYSTEM FLAG - OUTBUF INTERRUPT PC I COMPATIBILITY RESET INHIBIT OVER RIDE eLi ; --B4 DO E8 0000 E DEGATE ADDRESS LINE 20 MOV CALL AH, 0 I SABLE B I T20 GATE_A20 - SETUP HARDWARE 2B 8E B9 OE IF BE BF A5 47 47 E2 <> <> <> <> <><><> <> <><><><> <><> CHECKPOINT 3A <><> MOV OUT FF 21 CO CO 0008 0000 E 0020 R F1A: FB SUB MOV MOV PUSH POP MOV MOV MDVSW INC INC LOOP AX,AX ES,AX CX,08 CS DS S I ,OFFSET VECTOR TABLE D I ,OFFSET 0 I NT _PTR DI 01 F7A SETUP HARDWARE ASSUME 28 CO 8E CO B9 0008 OE IF SUB MOV MOV PUSH POP SET COMMAND IN AH I SSUE THE COMMAND [NTERRUPT VECTOR TABLE LEVEL 0-7 ES:ABSO AX,AX ES,AX CX,08 es GET VECTOR COUNT SETUP DS SEGMENT REG I STER : SK I P OVER SEGMENT INTERRUPT VECTORS LEVEL 8-15 (VECTORS START AT INT 70H) GET VECTOR COUNT SETUP DS SEGMENT REGI STER OS TEST2 5-67 IBM Personal Comput!tr MACRO Assembler Version 2.00 TEST2 ---- 06/10/85 POST TESTS AND INITIALIZATION ROUTINES I-II 06-10-85 MOV 1093 054A BE 0000 E 1094 0540 BF 01 CO R MOV 1095 0550 AS F7AI: MOVSW ; SK I P OVER SEGMENT 1096 0551 47 INC 01 1097 0552 47 01 INC 1098 0553 E2 FB LOOP F7At 1099 SET UP OTHER I NTERRUPTS AS NECESSARY 1100 1101 1102 OS:ABSO ASSUME 1 103 0555 2B CO AX,AX ; 05=0 SUB 1 104 0557 8E 08 MOV OS.AX 1105 0559 C7 06 0008 R 0000 E MOV WORD PTR @NMI PTR. OFFSET NM I I NT ; NMI INTERRUPT MOV 110,6 055F C7 06 0014 R 0000 E 8AS IC 1 107 0565 C7 06 0062 R F600 MOV 1108 ZERO RESJ::RVED VECTORS 1109 ; 1110 MOV I I I 1 056B BF 0180 DI.60H'"4 FILL INTERRUPT 60 THRU 67 WITH ZERO 1 1 12 056E B9 00 I 0 CX.16 CLEAR 16 WORDS MOV MOV 11130571 C7 05 0000 FTAZ: WORD PTR 05:[01],0 1 I 14 0575 83 C7 02 01,2 POINT TO NEXT LOCATION AOO 1115 0578E2 F7 LOOP F7A2 1116 1117 SETUP TIMER 0 TO BLINK LED IF MANUFACTURING TEST MODE I I 18 ASSUME OS:DATA 1 I 19 ; ESTABLISH DATA SEGMENT 1120 057A E8 0000 E CALL 005 1121 ; MFG. TEST MODE? 11220570 F6 06 0012 R 20 TEST PMFG TST, MFG LOOP F9 I 123 0582 75 08 JNZ 1124 0584 26: C7 06 0020 R 0000 E MOV WORD PTR ES: IP I NT PTR, OFFSET BL I NK I NT ; SETUP T I MER TO BL I NK LED 1125 058B BO FE MOV AL,OFEH ; ENABLE T I MER INTERRUPT 1126 0580 E6 21 OUT INTAOI,AL 1127 058F FB F9: ; ALLOW INTERRUPTS STI 1128 ; ----1129 ISSUE A RESET TO THE HARD FILE I F SOFT RESET 1130 1131059081 3E 0072 R 1234 CMP PRESET_FLAG, 1234H SOFT RESET? 1132 0596 75 OE F9A CaNT INUE IF NOT JNZ MOV 1133 0598 89 OOFF CX,OFFH 1 134 0598 BA 03F6 MOV DX,03F6H 1135 059E 80 04 MOV AL,04H RESET 1136 05AO EE DX,AL OUT 1137 OSA1 E2 FE F9_A: LOOP F9 A HOLD RESET I 138 05A3 2A CO SUB AL7AL 1139 05A5 EE REMOVE RESET OUT aX,AL 1140 ; ----- - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - -1141 1142 TEST .23 1143 ; DISKETTE ATTACHMENT TEST 1144 DESCR I PT I ON 1145 CHECK IF IPL DISKETTE DRIVE IS ATTACHED TO SYSTEM. IF 1146 ATTACHED, VERIFY STATUS OF NEC FoC AFTER A RESET. ISSUE 1147 A RECALIBRATE AND SEEK COMMAND TO FDC AND CHECK STATUS. 1148 COMPLETE SYSTEM INITIALIZATION THEN PASS CONTROL TO THE 1149 BOOT LOADER PROGRAM. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - -- - - -- - - - - - - - - - - - - - - - - - - --1150 1151 1 152 05A6 BO 3C F9A: MOV AL,3CH <><><><> <> <> <> <> <> <> <><> <><> CHECKPOINT 1153 05A8 E6 80 3C <><> OUT MFG _PORT, AL 1154 1155 05AA BO 02 MOV AL,02H SET DATA RATE TO 250 K BITS PER SECOND 1156 05AC SA 03F7 MOV OX ,3F7H '157 05AF EE OUT DX,AL 1158 05BO F6 06 0010 R 01 TEST BYTE PTR @EQUIP FLAG, 1H DISKETTE PRESENT? FI5 11590585 74 55 JZ 1160 05B7 F6 06 0012 R 20 @MFG TST ,MFG LOOP TEST MFG JUMPER INSTALLED? Ft5 1161 058C 74 4E JZ GO IF YES 1 162 058E FlO: DISK_TEST: 1163 058E E4 21 IN AL, INTAO 1 1164 05CO EB 00 JMP 1/0 DELAY 1 165 05C2 24 8F ENA8LE 0 I SKETTE INTERRUPTS ANa AL ,OBFH 1 166 05C4 E6 21 OUT INTAO t ,AL 1167 05C6 B4 00 MOV AH,O RESET NEC FDC MOV 1168 05C8 8A 04 SET FOR OR I VE 0 OL,AH 1169 05CA CD 13 INT 13H VERIFY STATUS AFTER RESET 1170 05CC F6 C4 FF TEST AH,OFFH STATUS OK? 1171 05CF 75 25 NO - FDC FAILED JNZ Fl3 1172 ; - ---TURN DR I VE 0 MOTOR ON 1173 1174 1175 0501 BA 03F2 MOV DX,03F2H GET ADDRESS OF FDC CARD TURN MOTOR ON, ENABLE DMA, INTERRUPTS 11760504BO IC MOV AL,ICH 11770506 EE OX,AL WR I TE FOC CONTROL REG I STER OUT 11780507 2B C9 WA I TF COUNT FOR 0.988 SECONDS SUB CX,CX 1179 0509 E8 0000 E CALL WAITF WA I T I SECOND FOR MOTOR 1180 1181 050C 33 FF SELECT OR I VE 0 XOR 01.01 1182 050E B5 01 MOV SELECT TRACK I CH, t MOV 11 ~3 05EO C6 06 003E R 00 IPSEEK STATUS,O I NSURE RECALl BRATE 1 184 05E5 80 OE OOAO R 01 OR IPRTC WA IT FLAG, 0 I NO REAL T I ME CLOCK, USE WA I T LOOP SEEK1 185 05EA E8 0000 E RECAL I BRATE 0 I SKETTE CALL 1186 05EO 72 07 GO TO ERR SUBROUT I NE I F ERR JC Fl3 1187 05EF B5 22 MOV CH,34 SELECT TRACK 34 1188 05FI E8 0000 E CALL SEEK SEEK TO TRACK '34 1 189 05F4 73 08 OK, TURN MOTOR OFF JNC Fl. 1190 05F6 F13: 1191 05F6 80 OE 0016 R 40 PMFG ERR FLAG+ I ,OSK FAIL; DSK_ER~!<><><> <> <> <><> <><> <> <><> OR ; <><> OISKETTE FAILED <><> 1192 1193 05FB BE 0000 E MOV 5 I ,OFFSET E601 GET ADDRESS OF MESSAGE 1 194 05FE E8 0000 E CALL E_MSG ; GO PRINT ERROR MESSAGE 1195 1196 TURN DR I VE 0 MOTOR OFF 1197 F14: DRO OFF: 1198 0601 1 199 0601 80 26 OOAO R FE ALLOW FOR RTC WA I T ANa OPRTC WA I T FLAG, OFEH AL,OCH TURN DR I VE 0 MOTOR OFF 1200 0606 BO OC MOV 120 I 0,608 BA 03F2 MOV OX ,03F2H F'DC CONTROLLER ADDRESS 1202 060B EE OUT DX;AL 1203 ;----- SETUP KEYBOARD PARAMETERS 1204 1205 F15: MOV SET STRAY INTERRUPT FLAG 00 1206 060C C6 06 006B R 00 :g~g ~i~ :~~~~C:~~R~~~~~~o~~TNT _S~R~~~MENi ~~~N6A~~~~~~ ----- -- ------- - - -- - - -- ---- - - "2 - = 5-68 TEST2 IBM Personal Computer MACRO Assembler Version 2.00 TEST2 ---- 06/10/85 POST TESTS AND INITIALIZATION ROUTINES 1207 0611 8E ODIE R 1208 0614 89 36 001A 12090618 89 36 ODIC 1210 061C 89 36 0080 1211 062083 C6 20 1212062389 36 0082 1213 1214 1215 1216 0627 8F 0078 R 1217 062A IE 1218 0628 07 1219 062C 88 1414 1220 062F A8 1221 0630 A8 1222 1223 1224 12250631 88 0101 1226 0634 A8 1227 0635 A8 1228 1229 1230 1231 0636 E4 21 1232 0638 24 FE 1233 063A EB 00 1234 063C E6 21 1235 1236 1237 1238 063E F6 06 0012 1239 0643 75 03 1240 0645 E9 072E R 1241 0648 1242 0648 80 8E 1243 064A E8 0000 E 1244 1245 0640 8E 0000 E 1246 0650 A8 80 1247 0652 75 07 1248 1249 0654 8E 0000 E 1250 0657 A8 60 1251 0659 14 09 1252 0658 1253 0658 E8 0000 E 1254 (}65E 81 CD 8000 1255 0662 E8 45 1256 1257 1258 1259 0664 83 04 1260 0666 28 C9 1261 066880 8A 1262 066A E8 0000 E 1263 0660 A8 80 1264 066F 15 18 12650671 E2 F5 1266 0673 FE C8 1261 0675 15 EF 1268 0671 8E 0000 E 1269 067A E8 0000 E 1210 1271 1212 1213 0670 88 OE8E 1214 0680 E8 0000 E 1215 0683 DC 04 1276 0685 86 C4 1217 0687 E8 0000 E 1218 068A E8 DE 1279 1280 1281 1282 068C 89 0320 1283 068F 80 8A 1284 0691 E8 0000 E 1285 0694 A8 80 1286 0696 EO F7 1281 0698 E3 DO 1288 1289 1290 1291 069A 1292 069A 80 8E 1293 069C E8 0000 E 1294 069F A8 10 1295 06Al 1406 1296 1291 1298 1299 06A3 8E 0000 1300 06A6 E8 0000 130 I 1302 1303 1304 06A9 80 3E 0015 1305 06AE 8E 0000 E 1306 0681 74 OA 1301 13080683 80 3E 0015 1309 0688 75 06 1310 068A 8E 0000 E 1311 0680 1312 0680 E8 0000 E 1313 1314 1315 1316 06CO 1311 06CO 8A 03F 1 1318 06C3 EC 1319 06C4 24 F8 1320 06C6 3C 50 R R R MOV MOV "OV "OV R "OV ADO 1-12 06-10-85 S I ,OFFSET @K8 8UFFER .8UFFER HEAD,SI (l8UFFER-TAIL,SI (l8UFFER-ST ART,S I SI,32 OBUFFER_END, S I SETUP KEY80ARD PARAMETERS DEFAULT 8UFFER OF 32 BYTES SET PRINTER TIMEOUT DEFAULT MOV PUSH POP MOV STOSW STOSW 01 ,OFFSET ('PRINT TIM OUT; OS ES AX, 1414H SET DEFAULT PRINTER TIMEOUT DEFAUL T=20 SET RS232 DEFAULT MOV STOSW STOSW AX,0101H ENA8LE TI MER IN INTERRUPTS AL,INTAOI AL,OFEH J"P ,., OUT INTA01,AL AND RS232 OEFAULT=OI ENABLE T I MER I/O DELAY INTERRUPTS CHECK CMOS BATTERY AND CHECKSUM R 20 J"P @MFG TST ,MFG LOOP 81 DR F15C MFG JUMPER? GO IF NOT 8YPASS IF YES "OV CALL AL, CMOS 0 I AG+NM I CMOS_READ ADDRESS 0 I AGNOSTI C STATUS 8YTE READ I T FROM CMOS "OV TEST JNZ SI,OFFSET EI61 AL,8AD BAT 81_ER - LOAD 8AD 8ATTERY MESSAGE BATTERY 8AD? 01 SPLA Y ERROR IF 8AD "OV TEST JZ S I ,OFFSET E I 62 AL,8AD CKSUM+BAD CONF I G C_OK - LOAD CHECKSUM 8AO MESSAGE 162 CHECK FOR CHECKSUM OR NO 0 I SKETTE SK I P AND CDNT I NUE TEST I NG CMOS CLOCK CALL OR E MSG 8P,08000H SHORT H_OK1A ELSE DISPLAY ERROR MESSAGE FLAG "SET SYSTEM OPTIONS· DISPLAYED SKIP CLOCK TESTING IF ERROR TEST JNZ J"P 161 TEST CLOCK UPDATING C OK: D-OK: E:=OK: F _OK: MOV SU8 MOV CALL TEST JNZ LOOP DEC JNZ MOV CALL 8L,04H CX,CX AL,CMOS REG A+NMI CMOS READ AL,80H G OK E-OK Be o OK SI ,OFFSET E 1 63 E_MSG SET CMOS DIAGNOSTIC STATUS TO 04 "OV CALL OR XCHG CALL J"P AX,X·CMOS DIAG+NMI CMOS REAOAL. CMOS CLK FA I L AL,AH CMOS WR I TE SHORT H_OK OUTER LOOP COUNT I NNER LOOP COUNT GET THE CLOCK UPDATE 8YTE CHECK FOR UPDATE GO I F YES TRY AGAIN DEC OUTER LOOP TRY AGAIN PRINT MESSAGE IN PROGRESS (CLOCK ERROR) SET CLOCK ERROR GET THE CURRENT STATUS SET NEW STATUS GET STATUS ADDRESS AND SAVE NEW STATUS MOVE NEW 01 AGNOST I C STATUS TO CMOS CONT INUE CHECK CLOCK UPDATE "OV "OV CALL TEST LOOPNZ JCXZ CX,800 AL,CMOS REG A+NMI CMOS READ AL,80H I OK F::::OK LOOP COUNT CHECK FOR OPPOSITE STATE TRY AGAIN PRINT ERROR IF TIMEOUT CHECK MEMORY SIZE DETERM I NED = CONF I GURA T I ON "OV CALL TEST JZ AL, CMOS 0 I AG+NM I CMOS READ AL,W-MEM SIZE H_OKTA - GET THE STATUS BYTE WAS THE CONFIG= MEM SIZE DETERMINED? GO I F YES -- MEMORY SIZE ERROR MOV CALL S I ,OFFSET E 164 E_MSG PRINT SIZE ERROR 01 SPLAY ERROR CHECK FOR CRT ADAPTER ERROR R DC H_OK1A: @MFG ERR FLAG, OCH S I ,OFFSET E401 H_OKI8 CHECK FOR MONOCHROME CRT ERROR LOAD MONOCHROME CRT ERROR GO IF YES JNZ "OV @MFG ERR FLAG. ODH J OKSI ,OFFSET E501 CHECK FOR COLOR CRT ADAPTER ERROR CONT I NUE I F NOT CRT ADAPTER ERROR MESSAGE CALL E_MSG eMP "DV JZ R 00 e"p CHECK FOR MULTIPLE DATA RATE CAPA81L1TY "OV IN AND C"P DX,03FIH AL,OX AL,!1111000B AL,010100008 O/S/P DIAGNOSTIC REGISTER READ O/S/P TYPE CODE KEEP ONLY UN I QUE CODE FOR 0/ S /P D/S/P CARD - MULTIPLE DATA RATE? TEST2 5-69 IBM Personal Computer MACRO Assembler Version 2.00 TEST2 ---- 06110/85 POST TESTS AND INITIALIZATION ROUTINES !32! 1322 1323 ! 324 1325 1326 1327 1328 ! 329 t 330 1331 1332 1333 t 334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1-13 06-10-85 06C8 74 46 JZ .J_OK3 IF SO JUMP 06CA 06CD 06CE 0600 0602 BA EC 24 3C 74 MOV IN AND eMP JZ OX,05F7H AL,OX AL,II t 10000B AL,IOIOOOOOB J_FAIL F I XED 0 I SK 0 I AGNOSTI C REG I STER READ F I XED DISK TYPE CODE KEEP ONLY UNIQUE CODE FOR FlO F I XED 0 I SK ADAPTER ? MUST BE COMBO ELSE ERROR 0604 0606 0008 060B 060B 06DC 060E 06EO 06E2 ObE4 ObEb ObE8 06EA 06EC ObEC ObEF 06FI 06F2 ObF4 06F5 06Fl 06F9 06F8 ObFC 06FE 06FF 0101 83 OF 28 C9 BA OIFl MOV SUB MDV BL,OFH eX,ex OX,OlF7H HARD FILE STATUS PORT IN TEST JZ LOOP DEC JNZ AND JZ JMP AL,OX AL,080H J OK2 J-OKI Be J OKI AC,OCH J OK3 SHORT J_FAIL GET THE STATUS I S THE CONTROLLER BUSY? CONTINUE IF NOT TRY AGAIN DECREMENT OUTER LOOP TRY AGA I N I F NOT ZERO BITS 2 & 3 " 0 IF MULTI DATA CAPABLE GO IF YES NO MULTIPLE DATA RATE CAPABILITY MOV MOV OUT JMP IN eMp JNZ MOV OUT JMP IN eMP JZ OX,IF4H AL,055H DX,AL VERIFY MULTIPLE DATA RATE CAPABLE WR I TE TO THE CYL I NDER BYTE OE 0016 R 40 OR ttMFG ERR FLAG+I,DSK FAIL; 0000 E 0000 E IE MOV CALL JMP SI,OFFSETE601 E MSG SHORT FISC OR OlILASTRATE,OUAL FO AD 2F OUTER LOOP COUNT WA IT FOR BUSY OFF J_OKI : EC A8 74 E2 FE 75 24 74 EB 80 OC F9 CB F5 OC 26 17 J_OK2 : BA BO EE EB EC 3C 15 BO EE EB EC 3C 74 134b 1341 ! 348 1349 1350 1351 (352 1353 1354 1355 1350 1351 0103 1358 0103 80 1359 1360 0108 BE 1361 070B E8 1362 010E EB 1363 13640710 13650710 80 1366 1361 1368 13690715 BO 13100111 E6 1371 0119 E8 1312 1313 1314 1375 011C E6 1316 071F 8A 1317 0723 OA 1318 0125 74 1319012180 1380 072C B4 1381 012E 1382 072E BO 1383 0130 E8 1384 0133 A8 1385 0735 75 1386 1367 0131 BO 138e 0139 E8 1389 013C 24 1390 073E 3A 1391 0740 74 f 392 1393 0742 22 1394 0744 75 1395 1396 0746 E8 1391 1398 1399 0749 1400 0749 BO 1401 074B E6 1402 1403 0140 BO 1404 014F E8 1405 0152 3C 1406 0154 14 1401 1408 0156 Ee 1409 1410 1411 1412 1413 1414 1415 1416 1411 0159 1418 0159 FB 1419 015A BO 1420 015C E6 1421 015E E8 1422 0761 BO 1423 0163 E6 1424 0166 1425 1426 1427 1428 0166 2A 1429 0168 E6 1430 016A EB 1431 016C E6 1432 016E BA 1433 0711 1434 0711 8E 5-70 05Fl 0lF4 55 00 55 OA AA 00 AA 00 '.2 I/O DELAY CHECK DATA WRITTEN" DATA READ AL,DX AL,055H ..I FAIL AL,OAAH DX,AL GO IF NOT WR I TE ANOTHER PATTERN "2 I/O DELAY AL,DX AL,OAAH .J_DK3 I S DATA PATTERN THE SAME? GO IF SO J_FAIL: - - -; ; ; ; <><><><> <> <> <><><> <> <><> <> <><> 01 SKETTE FAILED GET ADDRESS OF MESSAGE GO PR I NT ERROR MESSAGE SK I P SETUP I F ERROR J_OK3: OE 0088 R 01 ;----- TURN ON DSPICOMBO FLAG INITIALIZE FLOPPY FOR DRIVE TYPE 3D 80 0000 E MOV OUT CALL 0000 E 26 0091 R E4 07 DE 0010 R 40 FF CALL MOV OR JZ OR MOV OOS AH,(tDSK STATE+l AH,AH - 8E 0000 E CO 22 MOV CALL TEST JNZ AL,CMOS DIAG+NMI CMOS READ AL,BAO BAT+BAD CKSUM ROM_SCAN I BATTERY I CHECKSUM OK BYPASS DISK SETUP I F NOT 90 0000 E OF C4 07 MOV CALL ANa eMp JE AL,CMOS DISKETTE+NMI CMOS READ AL,OOFH AL,AH FISC ADDRESS DISKETTE TYPE BYTE GET 0 I SKETTE TYPES LOOK AT SECOND DR I VE TYPE DEF I NED ARE BOTH I NO I CATORS ZERO SKIP IF NO SECOND DRIVE C4 03 ANa JNZ AL,AH FI50 ARE BOTH INDICATORS NON-ZERO SKIP IF DRIVE FOUND AND DEFINED 0000 E CALL CONFIG_BAD SET BAD_CONFIG AL,3DH MFG PORT ,AL DSKETTE_SETUP <><><> <> <><><><><><><> <> <><> CHECK PO I NT 3D <><> INITIALIZE FLOPPY CHECK FOR 2ND 0 I SKETTE DR I VE INSURE DATA SEGMENT GET STATE OF SECONO DRIVE IS THERE A DRIVE 2 ATTACHED? SKIP IF NOT PTR 4lEQUIP FLAG,40H; ELSE SET SECOND DRIVE INSTALLED AH,OFFH ; SET TEST MASK FOR DR I VE PRESENT ~~~~ FISC: GET THE CMOS DIAGNOSTIC STATUS IN CMOS_DIAG INiTiALIZE HARD FILE 3E eo MOV OUT AL,3EH MFG_PDRT ,AL 92 MOV CALL eMP JZ AL,CMOS DISK+NMI CMOS READ AL,oR ROM_SCANI I NSURE TYPE IS DEF I NED BYPASS DISK SETUP I F NOT CALL DISK_SETUP INITIALIZE HARD FILE(SI 0000 E 00 03 0000 E ; ; - ~~~~ ~ ~ - - - -- - ---- - - ---- - - - --- -- - - - - - - - - - - - -- - - - - - - ----- -- - OA TEST2 STI M~ OUT CALL MOV CALL ROM_SCAN: ; ----- CO 02 00 04 C800 I NSURE CMOS DEF I NES TYPE OF F I XED 0 I SK TEST. 22 CHECK FOR OPTIONAL ROM FROM C800->EOOO IN 2K BLOCKS : (A VALID MODULE HAS 'S5AA' IN THE FIRST 2 LOCATIONS: LENGTH INDICATOR (LENGTH/512} IN THE 3RD LOCATiON : AND TESTIINIT. CODE STARTING IN THE 4TH LOCATiON) ~~~ 3B eo 0000 E OA 0000 E <><><><><><><><><><> <><> <><> CHECKPO I NT 3E <><> ALLOW ~,~H MFG PORT ,AL DDSAL,10 PRT _HEX INTERRUPTS 000000000000 <><> CHECKPOINT 38 <><> SET REAL MODE DATA SEGMENT LINE FEED ON DISPLAY SET DMA MASK AND REQUEST REG I STERS SUB OUT JOP OUT MOV ROM SCAN2: MOV AL,AL DMAI8+2,AL SENO ZERO TO MASK REG I STER DMAI8+4,AL oX,oceOOH SEND ZERO TO REQUEST REG I STER SET BEG I NN I NG ADDRESS '.2 DS,DX IBM Personal Computer MACRO Assembler Version 2.00 TEST2 ---- 06/10/85 POST TESTS AND INITIALIZATiON ROUTINES 1435 0113 51 1436 0114 BF ,01,,01,55 1431 0111 2B DB 1438 0119 88 01 1439 0118 3B C1 1440 0110 SF 1441 011E 15 05 1442 0180 E8 0000 E 1443 0183 EB 04 1444 0185 1445 0185 81 C2 0080 1446 0189 1441 0189 81 FA EOOO 1448 0180 1C E2 1449 1450 1451 1452 018F E8 0000 E 1453 0192 E4 64 1454019424 10 1455 0196 14 02 1456 0198 EB OB 1451 019,01, 1458019,01, 80 OE 0016 1459 1460 1461 019F SE 0000 E 1462 01A2 E8 0000 E 1463 01,01,5 1464 1465 1466 1461 1468 01A5 BF 0905 R 1469 01,01,8 8E 0000 1410 01AB 1411 01,01,8 2E: 88 15 1412 01AE 80 ,01,,01, 1413 0180 EE 1414 0181 EB 00 1415 01B3 IE 1416 0184 EC 1471 0785 IF 1418 0786 3C ,01,,01, 1479 07B8 75 06 1480 07BA 89 94 0008 1481 078E 46 1482 07BF 46 1483 07CO 1484 07CO 47 1485 07CI 47 1486 07C2 81 FF 090B 1481 07C6 75 E3 1488 1489 1490 1491 07C8 8B 0000 1492 07C8 BA 03FA 1493 07CE EC 1494 07CF ,01,8 F8 1495 0701 75 08 1496 0703 C7 81 0000 1491 0709 43 1498 070A 43 1499 0708 BA 02FA 1500 070E EC 1501 07DF A8 F8 1502 07El 75 08 1503 07E3 C7 81 0000 1504 07E9 43 1505 07EA 43 1506 1501 1508 1509 07EB 1510 07ES 8B C6 1511 07ED Bl 03 1512 07EF 02 C8 1513 07Fl OA C3 1514 01F3 ,01,2 0011 R 1515 1516 1511 1518 07F6 E8 0000 E 1519 1520 1521 1522 07F9 80 40 1523 07F8 E6 80 t 524 1525 07Fo SF 0067 R 1526 0800 33 CO 1521 0802 89 05 1528 0804 D8 E3 1529 0806 EB 00 1530 0808 09 3D 1531 080A 60 1532 080B 61 1533 080C 81 25 IF3F 1534 0810 81 3D 033F 1535 0814 75 13 1536 1537 0816 98 DO 3D 1538 0819 60 1539 081,01, 61 1540 0818 F1 05 888F 1541 081F 75 08 1542 1543 0821 E4 A I 1544 0823 24 OF 1545 0625 84 02 15460821 E6 AI 1547 0829 15480829,01,0 0010 R PUSH MOV SUB MOV CMP POP "NZ CALL "MP NEXT ROM: ADD ARE WE DONE: - CMP "L ;----- 1-14 06-10-85 NEXT ROM ROM CHECK SHORT ARE_WE_DONE SAVE WORK REGISTER GET TEST PATTERN SET BX=OOOO GET 1 ST WORD FROM MODULE = TO 10 WORD? RECOVER WORK REG I STER PROCEED TO NEXT ROM I F NOT CO CHECK OUT MODULE CHECK FOR END OF ROM SPACE DX,ooaOH PO I NT TO NEXT 2K ADDRESS DX,OEOOOH ROM_SCAN2 AT EOOOO YET? GO CHECK ANOTHER ADD. 01 DI,OAA55H 8X,BX AX, (BX) AX,DI 01 I F NOT TEST FOR KEYBOARD LOCKED CALL IN AND JZ JMP 005 AL,STATUS PORT AL,KYBD INH KEYI SHORT KEY 1 0 OR 'L'MFG_ERR_FLAG+ I ,KEY_FA I L; ASSUME MOV CALL DS:DATA S I ,OFFSET E302 E_MSG SET OAT A SEGMENT IS KEY80ARO UNLOCKED? NO - SET ERROR FLAGS AND PR I NT MESSAGE GO IF OFF KEYI: R 80 <><><><> <> <> <> <><> <><><><> <> <><> KEYBOARD I S LOCKED <><> PRINT LOCKED MESSAGE (302) KEY10: ; ==================== MOV "OV oI ,OFFSET F4 51,0 OFFSET OF PRINTER ADDRESS TABLE MOV MOV OUT "MP PUSH IN POP CMP "NE MOV INC INC DX,CS:[DI) AL,OAAH DX,AL eET PRINTER 8ASE ADDRESS WRITE DATA TO PORT A $.2 I/O DELAY BUS SETTL I NG READ PORT A INC INC CMP "NE 01 01 01 ,OFFSET F4E FI6 F16: R OS AL,DX OS AL,OAAH FI1 ~~R INTER_BASE [s I ] ,OX DATA PATTERN SAME NO - CHECK NEXT PR INTER CARD YES - STORE PRINTER 8ASE ADDRESS I NCREMENT TO NEXT WORD 5I F17: R POINT TO NEXT BASE ADDRESS ALL POSSIBLE ADDRESSES CHECKED? PRT_BASE ~~~~~=~~~~~=== ~~~=====~~:~== R 03F8 F18: R 02F8 ; ----- F19: MOV IN TEST JNZ ~~~ DX,3FAH AL,DX AL,OF8H FI8 :~S232_BASE (BX), 3F8H INC MOV IN TEST JNZ MOV INC INC 8X DX,2FAH AL,DX AL,OF8H FI9 (IIRS232 BASE(BX},2F8H 8X 8X POINTER TO RS232 TABLE CHECK IF RS232 CARD 1 ATTACHED? READ I NTERRUPT 10 REG I STER SETUP RS232 CARD # 1 ADDRESS CHECK IF RS232 CARD 2 ATTACHED READ I NTERRUPT 10 REG I STER BASE END SETUP RS232 CARD #2 ~~~" ~~" ;~Q~ ~~ :~~~~: ~~ =~~~ ~ ~~~~ '" ~~~B~~ = ~~ = ~~ ~ ~;~~~ = ~~~ =~~~~~ =~~~~~ ; = = = = = = = = = = == == = = = = = = = = = = = = == = == ~ = B~~~ = ~~~ ~ = = == == = == = == == = = == = =::= MOV MOV ROR OR MOV AX,SI ; CL,3 ; AL,CL ; AL,BL ; BYTE PTR Il'IEQU I P _FLAG+ 1 ,AL SI HAS 2- NUM8ER OF RS232 SHIFT COUNT ROTATE RIGHT :3 POSITIONS OR IN THE PRINTER COUNT ; STORE AS SECOND BYTE INSURE CMOS CLOCK HAS VALID HOURS.MINUTES.SECONDS CALL ;----- ; SET_TOO INSURE CMOS CLOCK ENA8LE HARDWARE INTERRUPT IF MATH PROCESSOR MOV OUT AL,40H MFG_PORT, AL MOV XOR MOV FNINIT "MP FNSTCW PUSHA POP A AND CMP "NE 01 ,OFFSET 'L'IO_ROM_INIT AX,AX WORD PTR [DII,AX S'2 IS VALID (80287) <> <> <> <><><><><><> <><> <> <><> CHECKPO I NT 40 <><> ADDRESS WORK STORAGE LOCATION CLEAR WORK REGISTER (AH)= 0 (NO 287) CLEAR THE WORK LOCATION INITIALIZE THE 60281 WITH NO WAJ1 ; DELAY ; WR I TE THE CURRENT 80281 CONTROL WORD ; TIME FOR 60287 TO RESPOND WORD PTR {DI} WORD PTR WORD PTR NO_287 (01},0IF3FH (01] ,0033FH CLEAR UNUSED 80287 81TS IS THE 80287 INSTALLED? GO IF MATH PROCESSOR IS NOT INSTALLED FSTSW PUSHA POPA TEST "NZ WORD PTR (DI) STORE THE STATUS WORD (WITH WAIT) TIME FOR 80281 TO RESPOND WORD PTR NO_26T [DI},088SFH ALL BITS SHOULD 8E OFF GO IF NOT INSTALLED IN AND MOV OUT AL,INTBOI AL,ODFH AH,002H INTBOI,AL GET THE SLAVE INTERRUPT MASK ENABLE 80287 INTERRUPTS SET WORK REG I STER FOR 80287 FOUND MOV AL,8YTE PTR IPEQU I P _FLAG GET LOW EQU I PMENT FLAG (OR ERROR) NO_287: TEST2 5-71 [8M PersQnal CQmputer MACRO Assembler VersiQn 2.00 TEST2 ---- 06/10/85 FOST TESTS AND [NITIALIZATION ROUTINES 1549 082C 24 1550 082E 3A 1551 0830 T4 1552 1553083280 1554 0831 E8 1555 083A 1556 1551 1558 083A C1 1559 1560 1561 1562 0840 E4 1563 0842 24 1564 0844 E8 1565 0846 E6 1566 0848 C6 1561 1568 1569 1510 0840 C6 1571 085280 1512 0854 E8 1573 0851 89 1574 085A E8 1575 0850 80 1576 1577 1578 1579 0862 80 1580 0867 74 1581 1582086984 1583 0868 82 1584 0860 FE 1585 0871 CO 1586 0873 FE 1581 0877 12 1588 1589 0819 E8 1590 081C 1591 1592 1593 1594 1595 081C 08 1596 081E 74 1591 1598 0880 80 1599 0885 8A 1600 0888 15 1601 1602 1603 1604 088A C6 1605 088F E4 1606 0891 24 1607 0893 15 1608 1609 0895 8A 1610 0898 1611 0898 E8 1612 0898 80 16130890 E8 1614 08AO A8 1615 08A2 14 1616 1617 08A4 F1 1618 08A8 15 1619 1620 08AA 8E 1621 08AD E8 1622 1623 1624 1625 0880 1626 0880 E4 1621088224 1628 0884 15 1629 1630 0886 6E 1631 0889 E8 1632 1633 1634 1635 OBBC 1636 08Be 8E 1637 oaBF E8 1638 1639 1640 1641 OaC2 64 ! 642 08C4 2B 1643 08C6 CO 1644 oaca 1645 OaC8 BO 1646 08CA E6 1641 08CC 84 1648 08CE CO 1649 0800 80 1650 0803 15 1651 0805 16520805 F6 1653 080A 75 1654 080e E9 r655 080F 80 1656 08E4 14 1657 1658 08E6 BA 1659 08E9 E8 1660 1661 1662 5-72 02 C4 08 JE AL,002H AL,AH OK_281 STR I P OF~ OTHER 8 ITS DOES CMOS MATCH HARDWARE ? SK I P IF EQU I PMENT FLAG CORRECT XOR CALL BYTE PTR @EQUIP FLAG, 2H CONFIG_BAD - ELSE SET 80281 BIT TO CORRECT VALUE AND SET THE CONF[GURATION ERROR FLAG AND CMP 36 0010 R 02 0000 E 1-15 06-10-85 OK 281: ;-=--- 06 0011 R 0000 SET KEYBOARD STATE FLAGS MDV ;----21 FC 00 21 06 0015 R 00 WORD PTR olIKB_FLAG,O ENABLE KEYBOARD/TIMER IN AND AL,INTAOI AL, OFCH ENABLE T I MER AND KEYBOARD I/O DELAY '.2 JMP INTAOI,AL II'MFG_ERR_FLAG,O OUT MDV READ KEYBOARD 06 0096 R AD F2 0000 E 061A 0000 E 26 0096 R IF RESET ALL KEYBOARD STATUS FLAGS INTERRUPTS 10 TO I NTERRUFTS CLEAR MFG ERROR FLAG I NIT I AL I ZE KEYBOARD TYPE AND NUM LOCK :~~K~L~~A~ ,~g_ID+SET_NUM;L~ET TH; S S~~S~~~~ ~~y~g~~~N~ /~~Q~~~T SND DATA ; USE KEYBOARD TRANSM] SS I ON ROUT I NE CX,To58 ; SET DELAY COUNT TO 25 M]LLlSECONDS WAITF ; WAIT FOR READ ]0 RESPONSE (20 MS) PKB_FLAG_3,NOT RD_[D+LC_AB+SET_NUM_LK I RESET READ 10 COMMAND MOV MDV CALL MOV CALL AND CHECK FOR SECOND F I XED 0 I SK PRESENT BUT NOT DEF I NED 3E 0015 R 02 13 eMP 10 81 06 0015 R 13 DE 0015 R 03 MDV MOV JE INC INT DEC JC 0000 E CALL FI5G: II'HF_NUM,2 FI5G CHECK FOR TWO DR I VES DEF I NED 8Y CMOS SKIP TEST IF TWO DRIVES DEFINED AH,OIOH DL,081H (tHF _NUM 13H II'HF NUM FI5G GET TEST DR I VE READY COMMAND POINT TO SECOND FIXED DISK TELL 810S ]T HAS TWO DRIVES CHECK READY THROUGH B] OS RESTORE CORRECT COUNT (RETAIN CY) SK I F I F SECOND DR I VE NOT READY SECOND OR I VE NOT DEF I NED SET CONFIGURATION BAD CONF IG_8AD - -- - - - - - - - - - - - - - - - - - - - - - - -~ I TEST FOR ANY ERRORS EO 55 OR JE 3E 0012 R 64 0002 DE CMP MOV JNZ MFG RUN 06 0015 R AA 64 10 40 MOV 0000 E BEEPS FOR ERROR (S) ADDRESS CMOS GET THE D]AGNOSTIC STATUS BYTE CHECK FOR BAD HARDWARE CONF I GURAT] ON SKIP IF NOT SET TEST JNZ BP,08000H ERR_WKEY ELSE CHECK FOR E161/E162 POSTED SK I P IF 0] SPLA YEO BEFORE NOW MDV SI,OFFSET E162 CALL P _MSG ELSE DISPLAY nOPTIONS NOT SET" WITH NON HALTING ROUT[NE C5 8000 06 0000 E 0000 E CHECK FOR ERR WKEY: IN AND JNZ 0000 E 0000 E ] N MODE -> SET ERROR FLAG @MFG ERR FLAG,OAAH AL,S1'ATU5 PORT AL ,KYBD INH FI5A_O - CALL TEST JZ 0000 E 20 DC 64 10 06 HUNLOCK SYSTEM UNIT KEYLOCK H MESSAGE REQUIRED AL,STATUS PORT AL,KYBD INH ERR_WA ]1'2 CHECK r F RESUME MESSAGE NEEDED I S THE KEYBOARD LOCKED SK I P LOCK MESSAGE I F NOT S [ ,OFFSET F3D I P _MSG ERROR MESSAGE FOR KEYBOARD LOCKED CALL DISPLAY '(RESUME MDV ERR WAIT2: MOV CALL = 3F 80 00 16 FC 38 F3 06 0012 R 20 03 0000 E 3E 0012 R 64 06 MDV SUB INT ERRWAIT1: MaV OUT MOV INT CMP JNE FI5A: 000 I 0000 E ; RESUME ERROR MESSAGE (ALTERNATE DISPLAY DEVICE) AH, f OX,OX F]RST PRINTER I1H AL,3FH MFG PORT ,AL AH,OO 16H AH,3BH ERR_WAIT I <> <><><><> <> <> <><><><><> <><> CHECKPOINT 3F <><> WAIT FOR 'Fl' KEY TEST JNZ ~~~~_TST,MFG_LOOP ~~G[~U~~TIN MODE JMP START r ; BYTE PTR @RESET FLAG,64H; FI58 - GO LOOP POST MFG RUN IN? BYPASS BEEP [F YES CMP JZ 1 SHORT BEEP ; ----- TEST2 "Fl" S I ,OFFSET F3D P _MSG IN]TIALIZE PRINTER 01 02 11 MFG RUN IN MODE? 2 SHORT BEEP COUNT FOR ERROR (S) GO I F NOT OX,S MDV ;----- BYTE PTR @RESET FLAG,64H; OX, 2 ERR_WA I T ERR BEEP AL,CMOS 01 AG CMOS READ AL,8AD CONF]G ERR_WKEY MDV ERR WAIT: CALL OE 0000 E 0000 E CHECK (BP) = NON-ZERO (ERROR HAPPENED) SK I P PAUSE I F NO ERROR I NO I CATE ERROR CHECK KEY LOCK STATUS I S THE KEYBOARD LOCKED CONT] NUE MFG MODE I F NOT LOCKED ELSE 5 SHORT BEEPS FOR MFG SETUP ERROR IN AND JNZ 0005 (SP NOT ZERO) (NO ERRORS) IBM Personal Computer MACRO Assembler Version 2.00 TEST2 ---- 06/10/85 POST TESTS AND INITIALIZATION ROUTINES 1663 1664 08EC E8 0000 E 1665 1666 1667 1668 05EF 2A E4 1669 08F 1 AO 0049 R 1670 08F4 CO 10 167 \ 1672 1673 1674 OeF6 B9 01F4 1675 08F9 BF OOAO 1676 08FC 2B CO 1 b77 OBFE 8E CO 16780900 26: 8905 1679 0903 83 C7 02 1680 0906 E2 F8 1 b81 1652 1683 1684 0908 88 ---- R 1685 0908 8E DO 168b 0900 BC 0400 R I b87 1688 1689 1690 0910 E4 21 1691 091224 FB 1b92 0914 EB 00 16930916 E6 21 1694 1695 169b 1697 0918 80 3E 0072 1698 0910 75 02 1699 091F EB 5C 1700 1701 17020921 17030921 E4 Al 1704 0923 24 FD 1705 0925 EB 00 17060927 E6 Al 1707 1708 1709 1110 171 I 1712 1113 1714 17 I 5 0929 BO 41 I 7 16 092B E6 80 1717 17180920 BO 80 1719 092F E6 70 1120 1721 1722 1723 0931 C6 Ob 0072 1724 0936 B8 EOOO 1725 0939 8E co 1726 0938 2B FF 1727 0930 26: 8B 05 1728 0940 53 1729 0941 5B 1730 0942 3D AA55 1731 0945 9C 1132 0946 26: 89 05 1 733 0949 E4 61 1734 0948 OC OC 1735 0940 Eb 61 1736 094F 24 F3 1731 0951 E6 61 1738 0953 90 1739 0954 75 27 1740 1141 1742 1743 0956 1E \ 744 0957 06 1745 0958 IF 1746 0959 28 08 1147 0958 E8 0000 E 1745 095E IF 1749 095F 75 IC 1750 1751 1752 1753 0961 80 00 1754 0963 E6 70 1755 1 Hi6 0965 E4 61 1757 0967 24 F3 1758 0969 E6 61 1759 1760 0968 C7 06 0067 1761 0971 8C 06 0069 1762 1763 0975 80 42 1764 0977 E6 80 1765 1766 1767 1768 0979 FF IE 0067 1769 \ 710 1711 1772 1773 0970 BO 00 1714 097F E6 70 1775 09BI E4 61 1776 0983 24 F3 F158: CALL ;----- CLEAR DISPLAY SCREEN SUB MOV INT 1-16 06-10-85 SET _TOO CLEAR FLAGS AH,AH AL, II!ICRT MODE 10H - CLEAR SCREEN CLEAR DESCR[PTOR TABLES F20: F20_A: MOV "OV SUB MOV MOV ADO LOOP CLEAR 1K POINT ES TO START OF DESCRIPTORS CX,0500 OI,SYS JOT LaC AX,AX ES,AX ES:[DJ],AX OJ ,2 F20_A CLEAR POINT TO NEXT LOCATION CONTINUE TILL DONE SET POST SYSTEM STACK MOV MOV MOV GET THE POST STACK SEGMENT AX, ABSO SS, AX SP,OFFSET II!ITOS ENSURE THAT MASTER LEVEL 2 ENABLED IN AND JMP OUT AL,INTAOI AL,OFBH GET THE CURRENT MASK $,2 I/O DELAY [NTAOI,AL TEST FOR MFG RUN- I N TEST R b4 CMP JNZ JMP BYTE PTR ,pRESET FLAG, 64H; END-287 SHORT SHUT4 I S THE THE MFG RUN- [N TEST? GO IF NOT BOOT LOAD IF YES , UNMASK SLAVE HARDWARE INTERRUPT 9 (LEVEL 71) END 287: IN AL,INTBOI GET THE CURRENT MASK AL,OFDH AND JMP 1+2 I/O DELAY OUT I NTBO 1 ,AL SET NEW MASK ; ; ; ; ; - - - - - - - - - - -- - - -- -- - - - - - - - - - - - - -- -- --- - - - - - -- -- - - -- - - - - - -- - -- - - - --TEST FOR SYSTEM CODE AT SEGMENT EOOO: 0 FIRST WORD AA55H LAST 8YTE CHECKSUM ENTRY POINT = FIRST BYTE + 3 I F TEST I S SUCCESSFUL A CALL FAR TO THE ENTRY R 00 = = MOV OUT AL, CMOS REG D+NM I CMOS_PORT ,AL ; "OV MOV MOV SUB "OV PUSH POP ; CLEAR FLAG ; SEGMENT OF SYSTEM CODE e"p 8YTE, PTR @RESET FLAG. 0 AX,OEooaH ES.AX bJ,OJ AX,ES: [OJ] BX BX AX,OAA55H IN ES:[DI),AX AL,PORT B OR OUT AND OUT POPF JNZ OFF AND CMOS AT bEFAULT ; CHECK FOR AA55 BUS SETTLE SAVE FLAGS CLEAR POSS I BLE PAR I TY CHECK ~~R~A~:~~R _OFF TOGGLE I/O-PAR I TY CHECK ENABLES AL.RAM PAR ON PORT_B:AL RESTORE FLAGS CONTINUE SHUT4 OS ES ; SET SEGMENT TO TEST BX,BX ROM CHECKSUM OS SHUT4 ; STARTING OFFSET as ENABLE NMI AND ; RESTORE DATA SEGMENT ; GO I F CHECKSUM NOT OK I/O-MEMORY PARITY CHECKS "OV OUT ~~O~:~~R~~~LD ENABLE NMI IN AL,PORT B AL, RAM PAR ON PORT_8:AL - ENABLE PAR I TY ENABLE MEMORY PARITY CHECK "OV "OV : : g:~g~:~~~~E~003H SET THE OFFSET SET THE SEGMENT "OV OUT AL,42H MFG_PORT, AL AND OUT R 0003 R INSURE NMI CHECKSUM SYSTEM CODE PUSH PUSH POP SUB CALL POP JNZ ;----- <><><><><><><> <> <> <> <> <> <><> CHECKPOINT 41 <><> AL,41H MFG:,...PORT • AL PUSHF "OV ; --- po JNT [S EXECUTED "OV OUT AND SET DEFAULT ADDRESS / I/O CHECK <><><><><> <> <><><> <><> <> <><> CHECKPO I NT 42 <><> EX I T TO SYSTEM CODE R CALL GO TO SYSTEM CODE VIA ,CALL THROUGH DATA AREA LOCATION ; ----- ENABLE NMI SHUT4: MOV OUT IN AND INTERRUPTS + ENTRY FROM SHUTDOWN WITH BOOT REQUEST AL, CMOS REG 0 CMOS PORT, AL AL,PORT B AL,RAM_PAR_ON ENABLE NMJ AND SET DEFAULT ADDRESS ENA8LE PAR I TY ENABLE MEMORY PARITY CHECK TEST2 I I/O CHECK 5-73 I BM Persona I Computer MACRO Assemb I er Vers i on 2.00 TEST2 ---- 06/10/85 POST TESTS AND INITIALIZATION ROUTINES 1777 1778 1779 1780 1781 1782 1783 1184 1785 1786 1181 1788 1789 1190 1191 1192 1193 1194 1795 1796 1797 1198 1199 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 15 I 8 1519 1820 1821 1822 1823 1824 1825 1826 1827 1525 1529 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 0985 E6 61 OUT PORT_B,AL 0987 BO 43 0989 E6 80 098B FB "OY OUT 5TI AL,43H MFG_PORT ,AL INT 19H 098C CD 19 PADING B9 OOOF PADI: BO E8 E2 90 E8 C3 <><><> <> <> <> <> <> <> <> <> <> <><> CHECKPOINT 43 <><> ENABLE I NTERRUPTS IF 0 I SABLEO GO TO BOOT LOADER HL T 098E F4 098F 098F 0992 0992 0994 0991 0999 099B 099E 099F 1-17 06-10-85 20 0000 E F9 20 0000 E 099F 099F 50 09AO BB OOOA PRT OK - PROC NEAR CX,I5 INSERT PADD I NG GET BLANK CHARACTER COUNT "OV CALL LOOP "OV CALL RET ENDF AL, PRT HEX PADT AL, ,- , PRT _HEX GET FILL SPACE WR I TE A SPACE LOOP TILL I NSERT DONE GET DASH CHARACTER WRITE TO DISPLAY PROC PUSH NEAR "OV BX, 10 PRINT "00000 K8 OK" SAVE WORK REG I STER SET DEC I MAL CONVERT "OY AX CONVERT AND SAVE 09A3 09A6 09A8 09A8 09AA 09AC 09AF 0980 89 0005 28 FF 33 F1 80 52 E2 02 F3 CA 30 "OV SUB PRT DIV: XOR OIV OR PUSH LOOP F6 eX,5 01,01 a I SFLA Y OX,DX BX OL ,30H OX PRT_DIV OF 5 NIBBLES XX,XXX KB REGEN BUFFER POS I T 1ON DIViDE BY 10 MAKE INTO ASCII SAVE 01 SFLA Y LAST OK MEMORY 0982 89 0005 09B5 0985 58 09B6 E8 0000 E 098947 098A E2 F9 098C 89 0007 098F BE 09CE R 09C2 09C2 2E: 8A 04 09C5 46 09C6 E5 0000 E 09C9 47 09CA E2 F6 09CC 58 09CD C3 09CE 20 4B 42 20 4F 48 0904 20 0905 = 0905 "OV FRT DEC: FOP CALL INC LOOF "OV "OV PRT LOOP: MOV INC CALL F38 F38 OK F3B-PAD .LIST PRT_OK ; ; RECOVER A NUMBER MESSAGE AL,CS:[Slj 51 PROT PRT HEX INC OJ PRT LOOP - - I NCREMENT BUFF PTR POP RET AX - RECOVER WORK REGISTERS DB DB EQU , OK MESSAGE PAD A SFACE KB OK' ENDP --- -------------------PRINTER TABLE F4 ow ow ow F4E LABEL 0908 090B POST2 CODE ENDP ENDS ENO TEST2 I 01 ; POINT TO DISPLAY REGEN BUFFER PRT DEC CX,OFFSET F3B PAD-OFFSET F3B ; LOAD MESSAGE LENGTH 51 ,OFFSET F3S; POINT TO PRINT' K8 OK',' LOOP 0905 03BC 0907 0318 0909 0278 09DB 5-74 CX,5 AX PROT PRT HEX 03BCH 0378H 0278H WORD ADDRESS OF MONOCHROME PARALLEL ADAPTER BASE ADDRESS STANDARD PARALLEL ADAPTER ADDRESS OF ALTERNATE PARALLEL ADAPTER I-I IBM Personal Computer MACRO Assembler Version 2.00 TEST3 ---- 06/10/85 POST EXCEPTION INTERRUPT TESTS 06-10-85 PAGE 118,121 TITLE TEST3 ---- 06/10/85 POST EXCEPTION INTERRUPT TESTS .286C .LIST 1-- ------------- - - - - - - - -- - - -- - - -- - - -- ----- - --- -TEST.20 ; ADDITIONAL PROTECTED (VIRTUAL MODEl TEST DESCR I PT I ON ; THE PROCESSOR I S PUT IN PROTECTED MODE AND THE FOLLOW I NG FUNCT IONS ARE VER I F I ED ; I 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VER I FY PROTECTED MODE THE MACHINE STATUS IS CHECK FOR VIRTUAL MODE 2. PROGRAMMED I NTERRUPT TEST AN PROGRAMMED INTERRUPT 32 I S I SSUED AND AND VERIFIED 3. EXCEPTION INTERRUPT 13 TEST A DESCR I PTOR SEGMENT LIM I TIS SET TO ZERO AND A WRITE TO THAT SEGMENT IS ATTEMPTED AN EXCEPT I ON 13 I S EXPECTED AND VER I F I EO LOT/SOT LTR/STR TEST LOAD LOT REGISTER AND VERIFY CORRECT LOAD TASK REGISTER AND VERIFY CORRECT THEY ARE VERIFIED VIA THE STORE INSTRUCTION 5. THE CONTROL FLAGS OF THE 286 FOR 0 I RECT I ON ARE VER I F I ED V I A THE STD AND CLD COMMANDS I N PROTECTED MODE BOUND INSTRUCTION TEST (EXCEPTION INT 5) CREATE A SIGNED ARRAY INDEX WITHIN AND OUTSIDE THE LIMITS. CHECK THAT NO EXC 1NT IF WITHIN LIMIT AND THAT AN EXC INT 5 OCCURS IF OUTSIDE THE LIMITS. PUSH ALL POP ALL TEST SET GENERAL PURPOSE REG I STERS TO 0 I FFERENT VALUES ISSUE A PUSH ALL, CLEAR THE REGISTERS I SSUE A POP ALL AND VER I FY CORRECT. 8. CHECK THE VERR /VERW I NSTRUCTI ONS THE ACCESS BYTE I S SET TO READ ONLY THEN TO A WR I TE ONLY AND THE VERR { VERW INSTRUCT 10NS ARE VERIFIED. 9. CAUSE AN INTERRUPT 13 V I A A WR ITE TO A READ ONLY SEGMENT 10. VERIFY THE ARPL INSTRUCTION FUNCTIONS SET THE RPL FIELD OF A SELECTOR AND VERIFY THAT CURRENT SELECTOR RPL IS SET CORRECTLY. I 1. VER I FY THE LAR I NSTRUCT I ON FUNCT IONS 12. VERIFY THE LSL INSTRUCTION FUNCTIONS 13. LOW MEG CH I P SELECT TEST 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 0000 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 0000 0000 E8 0000 E 0003 BO FO 0005 E6 80 POST3 PU8L IC POST3 EXTRN EXTRN EXTRN EXTRN CMOS WR I TE: NEAR DDS :NEAR PROC SHUTDOWN: NEAR SYSINITI :NEAR ASSUME PROC CALL CS:CODE MOV OUT ; ----- <> <><> <><> <> <> <> <> <> <> <> <><> CHECKPOINT FO <><> SET SHUTDOWN RETURN 1 MOV CALL 0001 B8 018F OOOA E8 0000 E SET DATA SEGMENT 005 AL,OFOH MFG_PORT ,AL AX, PH+CMOS SHUT_DOWN+NMI CMOS_WRITE ; ADDRESS FOR SHUTDOWN BYTE SET ERROR EXIT (DOUBLE EXCEPTION? I 70 71 ENABLE PROTECTED MODE 72 13 74 75 16 0000 DOlO 0012 0015 BC 8E BC E8 MOV MOV MOV 0000 04 8000 0000 E CALL 77 78 79 80 81 82 83 84 85 86 81 SET STACK FOR SYSINITI SP,POST SS SS, SP SP,POST SP SYSINITT GO ENABLE PROTECTED MODE SET TEMPORARY STACK 0018 OOIB 00 I 0 OOIF 0026 002C 002F 0031 MOV MOV MOV MOV MOV MOV MOV MOV B8 0008 8E CO 8E 08 26: C1 06 005A 0000 26 = C6 06 005C 00 BE 0058 8E 06 BC FFFD AX, GOT PTR ES ,AX DS,AX ES:SS TEMP.BASE La WORD,O BYTE PTR ES: (55-TEMP. BASE H I SI,SS TEMP SS,51SP,MAX_SEG_LEN-2 BYTE I ,0 88 89 90 91 92 0034 OF 01 EO 93 0031 A9 000 I 94 003A 15 03 95 003C E9 02CD R 96 97 003F 80 FI 98 0041 E6 80 99 100 101 102 0043 BO BO 103 0045 E6 88 104 0041 CD 20 105 0049 28 C9 106004BE488 101 0040 22 CO 108 004F EO FA 109 0051 14 03 110 0053 E9 02CD R 111 112 113 0056 BO F2 114 ; ----- T7_1: VER I FY PROTECTED MODE SMSW DB TEST JNZ JMP AX OOFH,OOIH,OEOH AX, VIRTUAL ENABLE T11 ERROR_EX I T MOV OUT AL.OFIH MFG_PORT, AL 1NTERRUPT TEST LOOPI: MOV OUT AL,OBOH DMA PAGE+OAH,AL INT SUB IN AND LOOPNZ JZ JMP 32 CX,CX AL,DMA PAGE+OAH AL,AL LOOPI T72 ERROR_EX I T MOV ARE WE ERROR I N PROTECTED MODE IF NOT <> <> <> <><><><> <> <> <> <> <> <><> CHECKPOINT FI <><> I PROGRAMMED CAUSE AN EXCEPTI ON T1_2: GET THE MACHINE STATUS WORD INTERRUPT INTERRUPT 32) SET EXCEPT I ON Fl-AG FOR INTERRUPT 10 INTERRUPT WA I T FOR 1NTERRUPT DID THE I NTERRUPT OCCUR? M I 55 I NG INTERRUPT (GENERAL PROTECT I ON INTERRUPT 1301 AL,OF2H TEST3 5-75 1-2 IBM Personal Computer MACRO As.sembler Version 2.00 TEST3 ---- 06/10/85 POST EXCEPTION INTERRUPT TESTS 115 116 117 118 119 0058 E6 80 005A 80 90 005C E6 88 120 121 122 139 140 141 142 143 144 ,.5 ,.8 ,.9 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 19. 197 198 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 SET SEGMENT TO 0 ; LOAD ES SET ES REGI STER PUSH POP BYTE PTR ES TEMP E5 - CAUSE AN EXCEPTION SUB MOY SUB LOOP2: IN AND LOOPNZ "Z "MP 13 INTERRUPT 01,01 AX,ES:[Oll CX,CX AL,OMA PAGE+OAH AL,AL LOOP2 ; 773 ERROR_EXIT TH I S SHOULD CAUSE AND EXCEPT! ON WA I T FOR INTERRUPT DID THE INTERRUPT OCCUR? CONTI NUE I F INTERRUPT MISSING INTERRUPT ; ------------------ - ---- - --- -- ---- ------; ; VER I FY 286 LOT I SOT L TR I STR J NSTRUCT IONS DESCRIPTION LOAD LOT. REGISTERS WITH A OESCR I PTOR AND VER I FY CORRECT ; ------------------ - --- - ------------WR I TE TO 286 LOT REG I STER 0089 0089 80 F3 0088 E6 80 0080 8F 0078 0090 OF 0091 0091 88 07 0093 0091 0091 00 0093 MOY OUT MOY POOOO 1?000 I LA8EL ORG DB ORG 01 - P0002 SLOT DB LABEL n0003 LA8EL SUB 03 CO ADO ORG 00 DB 25 00F8 30 0078 75 18 ORG AND CMP "NZ REGISTER FROM THIS AREA OOFH 8YTE OX,OI 8YTE OFFSET CS: pOOOO OOOH OFFSET CS:??OOOI READ AND VERIFY 286 LOT SELECTOR OF <><> <><><><> <><><><> <><> <><> CHECKPO I NT F3 <><> AL,OF3H MFG PORT ,AL 01 ,POST LOTR ;----009328 CO 0095 0096 0096 0098 0096 0096 0098 0098 0098 009E LLOT DB LA8EL MOY AX,AX AX OOFH 8YTE AX,AX BYTE OFFSET CS: n0002 OOOH OFFSET CS: 710003 AX,OF8H AX ,POST LOTR ERROR - CLEAR AX GET THE LOT SELECTOR STRIP TI /RPL CORRECT SELECTOR? GO IF NOT WRITE TO 286 TR 00 AD 8F 0068 00A3 OF OOM 00A4 88 OF 00A6 00A4 OOM 00 OOM MOY LTR 08 n0004 n0005 ORG ORG 00A6 28 CO OF ??0006 88 C8 5-76 DB LA8EL MOY n0007 LABEL ORG 00 DB 25 OaF8 3D 0068 75 08 ORG AND CMP "NZ FD 9C 58 A9 0200 74 03 E9 02CD R A9 0400 75 03 E9 02CD R FC 9C 58 A9 0400 74 03 TEST3 01 ,POST TR 01 - AX,AX AX OOFH 8YTE CX,AX 8YTE OFFSET CS: 1?0006 OOOH OFFSET CS:??0007 AX,OF8H AX,POST TR ERROR - GET THE TR REG I STER CORRECT SELECTOR? TEST 286 CONTROL FLAGS STO SET 0 I RECT I ON FLAG FOR DECREMENT GET THE FLAGS PUSHF "Z JMP AX AX ,0200H T7 4 ERROR_EX I T TEST "NZ "MP AX ,0400H T7.5 ERROR_EX I T POP TEST ERROR; T7_ 4: REGISTER FROM THIS AREA OOFH 8YTE eX,OI BYTE OFFSET CS: 710004 OOOH OFFSET CS: ?10005 VERIFY 286 TR REGISTERS SUB STR ; ----0083 00B4 00B5 00B6 0089 0088 008E OOBE OOCI 00C3 00C6 00C6 00C7 00C8 00C9 OOCC LA8EL DB ;----- OOA8 00A9 00A9 00A8 00A9 00A9 OOAB OOAB OOAE 0081 LABEL MOY 199 200 201 202 203 204 205 206 207 208 209 ; DATA ACCESS RIGHTS MOY MOY MOY ; 150 151 152 153 154 155 162 163 164 165 166 167 OS:ES_TEMP.SEG_LlMIT,O ;----- ,.9 '.0 161 CPLO, ; ----- 14. 147 148 156 157 158 159 ;----- 0074 6A 48 0076 07 0077 28 FF 007926: 8805 007C 28 C9 007E E4 88 0080 22 CO 0082 EO FA 0084 74 03 0086 E9 02CD R ; <><> CHECKPO I NT F2 <><> ; SET INTERRUPT 13. FLAG ; FOR THE INTERRUPT HANDLER MODIFY DESCRIPTOR TA8LES SET TEMPORARY ES DESCRIPTOR TO SEGMENT LIMIT 0064 C6 06 0040 93 0069 C6 06 004C 0 I 006E C7 06 004A 0000 130 131 132 133 13. 135 13. 137 138 MFG P.ORT ,AL AL,9DH OMA_PAGE+OAH,AL ;----005E C7 06 0048 0000 123 12. 125 126 127 128 129 OUT MOY OUT 06-10-85 CLO PUSHF POP TEST "Z I NTERRUPT FLAG SHOULD 8E OFF CONT [NUE I F OFF GO IF NOT CHECK 0 I RECT I ON FLAG GO IF NOT SET CLEAR 0 I RECT I ON FLAG INSURE 0 I RECT [ON FLAG I S RESET IBM Personal Computer MACRO Assembler Version 2.00 TEST3 - - -- 06/10/85 POST EXCEPT I ON I NTERRUPT TESTS 229 230 23 I 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 241 248 249 250 25 I 252 253 254 255 256 251 258 259 260 " I 262 263 264 265 266 267 268 269 270 211 272 273 274 275 276 277 218 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 OOCE E9 02CD R ;GOIFNOT ; ; 000 I 0001 0003 0005 0007 80 F4 E6 80 6A 48 01 0008 OODA OODF ODES 00E7 00E9 OOEC OOEF OOFI 00F3 00F5 00F7 00F9 28 FF 26; C1 05 0000 26: C1 45 02 1FFF 80 95 E6 88 88 1000 26: 62 05 28 C9 E2 FE E4 88 3C 00 15 03 E9 02CO R - - - - - - ----------------- - - -- ---------- --VERIFY 286 80UND INSTRUCTION OESCR I PT I ON CREA TE A SIGNED ARRAY INDEX WITHIN AND OUTSIDE THE LIMITS (EXPECT INT 5) MOV OUT PUSH FOF <><><><><><><> <> <> <><><> F4 <><> AL,OF4H MFG PORT ,AL BYTE PTR ES TEMP ES <><> CHECKPOINT LOAD ES REGI STER - CHECK BOUND FUNCT IONS CORRECTLY LOOPA: SUB MOV MOV MOV OUT MOV 80UND SUB LOOP IN CMF IN'' JMF OI,DI ; WORD PTR ES:(DI],O ; WORD PTR ES:[DI+21,07FFFH AL,095H OMA PAGE+OAH,AL AX,ToOOH AX,aWORD PTR ES:{ol] CX,CX LOOPA AL,OMA PAGE+OAH AL,O T7 7 ERROR_EXIT CHECK LOW BOUND WORD CAUSES OOFC OOFC 28 FF OOFE 26: C1 05 3FFO 010388 1000 0106 26: 62 05 0109 28 C9 0108 0108 E4 88 0100 3C 00 OIOF EO FA 0 I I I 14 03 0113 E9 02CO R SET AX WITH I N SOUNDS USE THE ES SEGMENT PO INTER WA I T FOR POSS I BLE INTERRUPT GET THE RESULTS DID AN I NTERRUPT OCCUR? CONT I NUE I F NOT GO IF YES INTERRUPT 5 SUB MOV MOV 80UND SUB 01,01 WORD PTR ES:[Dlj,03FFOH AX,IOOOH AX,DWDRO PTR ES:[DI] CX,CX PO I NT BEG I NN I NG OF THE BLOCK SET FIRST WORD TO 03FFOH SET AX OUT OF BOUNDS IN CMF LOOPNZ AL,DMA PAGE+OAH AL,OH LOOPB T78 ERROR_EX I T GET THE RESULTS DID AN INTERRUPT OCCUR? TRY AGAIN CaNT I NUE I F INTERRUPT GO IF NO INTERRUPT WAIT FOR POSSI8LE INTERRUPT LOOPB: J" JMF ;----- CHECK HIGH BOUND WORD CAUSES 01168095 0118 E6 88 0I IA OIIC 0121 0127 012A a I 20 012F a 12F 0131 0133 0135 0137 POINT BEGINN[NG OF THE 8LOCK SET FIRST WORD TO ZERO ; SET SECOND TO 07FFFH SET INTERRUPT 5 FLAG AL,95H DMA_PAGE+OAH, AL 28 FF 26: C7 05 0000 26: C7 45 02 OFFF 88 1000 26: 62 05 28 C9 INTERRUPT 5 SET FLAG FOR INTERRUPT SUB MOV MOV MOV BOUND SUB ,01 PO I NT 8EG I NN I NG OF THE BLOCK WORD PTR ES:[DI],O , SET FIRST WORD TO 0 WORD PTR ES: [DI +2],OFFFH; SET SECOND TO OFFFH SET AX OUT OF BOUNDS AX,!OOOH AX,DWORD PTR ES:{DI] CX,ex WAIT FOR POSSIBLE INTERRUPT IN CMF LOOPNZ .J" .JMF AL,OMA PAGE+OAH AL,OH LOOPC T7 9 ERROR_EX I T O[ LOOPC: E4 3C EO 74 E9 88 00 FA 03 02CO R ; ; 013A 013A 80 013C E6 013E B8 0141 88 0143 43 0144 88 0146 41 0147 88 0149 42 014A 88 014C 47 0140 8B 014F 46 0150 55 0151 88 0153 45 015460 0155 28 0 I 57 88 0159 88 0 I 5B 8B 015D 88 0 I 5F 88 0161 88 016361 016483 0167 50 0168 75 016A 3D 0160 75 016F 83 017275 0 I 74 83 0177 75 0179 83 017C 75 017E 83 0181 15 018383 0186 74 GET THE RESULTS DID AN INTERRUPT OCCUR? TRY AGAIN GO I F NO INTERRUPT VERIFY PUSH ALL AND POP ALL INSTRUCTIONS: DESCRIPTION SET REGI STERS TO A KNOWN VALUE AND : PUSH ALL. RESET THE REGISTERS, POP ALL: AND VER IFY T7 9: F5 80 0001 D8 C8 Dl FA F7 EE CO 08 C8 DO F8 FO E8 FO 07 IE 0001 19 FB 02 14 F9 03 OF FA 04 OA FF 05 05 FE 06 03 MOV OUT MOV MOV INC MOV INC MOV INC MOV INC MOV INC PUSH MOV INC PUSHA SUB MOV MOV MOV MOV MOV MOV POP A CMF FOF .IN'' CMF .IN'' CMP .IN'' CMF .IN'' CMF .IN'' eMP .IN'' CMF J" AL,OF5H MFG PORT, AL AX,OI BX,AX <> <><><><><><><><> <> <><> <><> CHECKPO I NT F5 <><> SET AX= 1 SET BX=2 BX CX,BX SET eX=3 CX OX,CX OX DI,DX 01 SI,DI 5I BF BP,SI BF AX,AX 8X,AX CX,AX DX,AX OI,AX SI,AX BP,AX 8P, 01 BF ERROR EXITI AX,O 1ERROR_EXIT! 8X,02 ERROR EXITI CX,03ERROR EXIT1 DX,04ERROR_EX I T I DI ,05 ERROR_EXIT! S 1,06 T7_10 SET DX=4 SET DI=5 SET S I =6 SAVE THE SET BP=7 (SP) ERROR FLAG REGI STER [SSUE THE PUSH ALL COMMAND CLEAR ALL REG I STERS GET THE REG I STERS BACK BP SHOULD BE 7 RESTORE (BP) ERROR FLAG REGISTER GO IF NOT AX SHOULD BE I GO IF NOT BX SHOULD 8E 2 GO IF NOT CX SHOULD BE 3 GO IF NOT OX SHOULD BE 4 GO [F NOT o I SHOULD 8E 5 GO IF NOT S I SHOULD BE 6 CONTINUE IF [T IS TEST3 5-77 1-4 IBM Personal Computer MACRO Assembler Version 2.00 TEST3 ---- 06/10/85 POST EXCEPTION INTERRUPT TESTS 343 344 345 346 347 346 349 350 351 352 353 354 355 35. 357 358 359 360 361 362 363 3.4 3.5 ;----0188 0188 E9 02CO R 06-10-85 ERROR EXIT ERROR EXITI: JMP ; -- - - -- -- - - -- - ------ - --- ---- --- -- - - -- --- --- - -- -- ; VER I FY ACCESS RIGHTS FUNCT I ON CORRECTLY ; DESCRIPTION ; SET ACCESS RIGHTS OF OEseR I PTOR TO ; READ ONLY. VERIFY THE VERW/VERR INSTR ; ACCESS A READ ONLY WITH A WR I TE AND ; VER I FY AN EXCEPT I ON I NTERRUPT 13 018B 0180 a 18F 0195 019A 01 AO 01 A3 BO E6 C7 C6 C7 B8 8E o I AS 3E 0lA6 0lA7 0lA7 o IA9 01 A7 01 A7 0lA9 0lA9 OF F6 80 06 0048 FFFF 06 004C 00 06 004A FOOO 0048 CO T7_10: MOV OUT "OV "OV "OV "OV "OV AL,OF6H <><><><><><><><><><><><> MFG PORT ,AL , < > < > CHECKPOINT F6 <><> OS IES TEMP. SEG LI M IT ,MAX SEG LEN ; SET SEGMENT TO OFFFFH BYTE PTR OS: IE5 TEMP.BAsE HI-8YTEI,O ; SET THE ADDRESS DSlES TEMP.BASE-LO WORD,OFOOOH AX ,ES-TEMP ; LOAD ES REGI STER ES, AXt TH I S SEGMENT SHOULD BE WR I TEABLE INSURE ACCESS RIGHTS MAY BE WRiTTEN 3 •• 3.7 3.6 3.9 370 371 372 373 374 375 37. 377 376 379 360 381 382 383 3.4 385 3 •• 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 406 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 42. 427 426 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 45. ??0009 SEGOV DB VERW DB LABEL ? ?OOOA LABEL 8B E8 "OV ORO 00 DB ORO JNZ 75 00 ;----- 01 AB C6 06 0040 91 alBa 88 0048 01B3 8E co SET SEGMENT OVERRIDE TO START OF TABLE OS 03EH AX OOFH BYTE BP,AX BYTE OFFSET CS:?? 0009 OOOH OFFSET CS;? ?OOOA ERROR_EXIT 1 CHECK THE ACCESS RIGHTS OF ES_TEMP ; ERROR I F SEGMENT CAN NOT WR I TE SET ACCESS RIGHTS TO READ ONLY os: 0lB6 01 B7 a I 87 0189 0187 0187 0189 0189 OF 74 CD JZ BYTE PTR IES TEMP.DATA ACC RIGHTS) ,91H AX, ES TEMP ; -LOAD ES REG I STER ES ,AXOS SET SEGMENT OVERR I DE TO START OF TABLE 03EH AX CHECK THE ACCESS RIGHTS OF ES_TEMP OOFH BYTE BP,AX BYTE OFFSET CS: ??OOOC OOOH OFFSET CS:? 10000 ERROR_EXITI ERROR IF SEGMENT IS WRITEABLE or BB 88 0048 "OV SEGOV OS 0185 3E ??OOOC 88 E8 ? 10000 ORO 00 DB ORO 08 018E 3E a r8F OICO OICO 0lC2 OICO OICO 0lC2 0lC2 ??OOOF VERR DB LABEL ?70010 "OV LABEL OF 88 EO ORO 00 DB ORO 75 C4 JNZ ;----- 0lC4 0lC6 0lC8 OICA DICE aiDa 0102 0104 0106 80 90 E6 88 2B F6 26: C6 04 00 28 C9 E4 88 22 CO EO FA 75 BO SUB "OV SUB LOOPD: LOOPNZ JNZ ;----- ; ; ; BO E6 88 BS 00 IN AND I NSURE THAT SEGMENT AX,ES TEMP 5-78 010 THE RESTORE THE ACCESS RIGHTS BYTE "OV OUT "OV "OV OR 1?0011 ARPL LABEL ?? 00 1 2 "OV LABEL ORO 08 ORO ,CPLO_OATA_ACCESS JNZ AND e"p JNZ <><> <><><> <> <> <> <> <><> <> AL,OF7H MFG PORT, AL AX,ES TEMP BX,OS-TEMP AX,03H AX,BX BYTE AX,BX BYTE OFFSET CS:??OOII 063H OFFSET CS:? ?OO 12 ERROR EXITI BL, 03H BL,03H ERROR_EXITI <><> CHECKPOINT F7 PUT A SELECTOR I N AX PUT A SELECTOR IN BX MAKE ACCESS OF AX < ex AX SECOND OPERAND ; I SSUE THE RPL COMMAND GO IF RPL WAS NOT CHANGED STR I P UNWANTED BITS AS EXPECTED? GO IF NOT CHECK THAT ACCESS RIGHTS 00 NOT CHANGE TEST3 I NTERRUPT OCCUR? MISS I NG INTERRUPT - --- - -- - -- - -- - --- - - - - -- - -- -- - --- -- - - - - - - - -- - - - -- 80 0048 0060 0003 9A E3 03 FB 03 92 WR ITE A BYTE THAT SHOULD WA iT FOR INTERRUPT VERIFY AO..JUST RPL FIELD OF SELECTOR I NSTRUCT I ON (ARPL I FUNCT IONS OESCR I PT I ON SET THE RPL FIELD OF A SELECTOR AND VER I FY THAT THE ZERO FLAG I S SET CORRECTL Y AND THAT THE SELECTOR RPL F I ELO I S SET CORRECTLY 8B C3 75 80 80 75 SET EXCEPT I ON FLAG FOR INTERRUPT 13 AL,09DH oMA PAGE+OAH ,AL 51,51 BYTE PTR ES:[Slj.OO cX,ex AL,DMA PAGE+OAH AL,AL LOOPD ERROR_EX I T 1 MOV BYTE PTR os: (ES_TEMP.DATA_ACC_RIGHTSJ --- --- --------- --------------------------------- F7 63 GO I F SEGMENT NOT READABLE 13 INTERRUPT NOTE BX ::: FIRST OPERAND OlEA 0 r EA OIEC OlEA 0 I EA OIEC OIEC 0 I EE OIFI 0lF4 IS READABLE - 03EH AX OOFH BYTE SP,AX BYTE OFFSET CS:??OOOF OOOH OFFSET CS:??OOIO ERROR_EXITI CAUSE AN EXCEPTION "DV OUT 0 r 08 C6 06 0040 93 0100 0 I OF aiEl 0 I E4 0 I E7 "OV "OV "OV SEGOV DB VERW DB LABEL "OV LABEL 1-5 IBt.! Personal Computer MACRO Assembler Ver.sion 2.00 TEST3 ---- 06/10/85 POST EXCEPTION INTERRUPT TESTS 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 476 479 480 481 462 463 464 485 486 487 466 46' 490 OlF6 BB 0060 0 I F9 B8 0048 0 I FC 80 CB 03 01FF OIFF 020 I OIFF 0 I FF 020 I 0201 0203 0206 0209 ;----- NOTE BX = FIRST ??OO \ 3 ARPL LABEL AX,BX BYTE AX,BX BYTE OFFSET CS: 1100 13 063H OFFSET CS:??0014 ERROR EXITI BL,03H BL,03H ERROR_EX [T2 MOV 110014 LABEL ORC 63 DB ORC JZ 85 E3 03 FB 03 2F AND CMP JNZ OPERAND AX = SECOND ; OPERAND I SSUE THE RPL COMMAND GO IF RPL WAS NOT CHANGED STRIP UNWANTED BITS AS EXPECTED1 GO IF NOT VER I FY LOAD SEGMENT LIM I T I LSL) AND LOAD ACCESS RIGHTS iLAR} INSTRUCTION ;----020B 90 F8 0200 E6 80 CHECK THE LAR INSTRUCTION <><><> <><> <> <> <> <> <> <> <> <> <> CHECKPO I NT F 8 <> <> AL,OF8H MFG_PORT, AL MOV OUT SET THE DESCR I PTOR TO LEVEL 3 020F C6 06 0040 F3 0214 BB 0048 0217 2B CO MOV MOV SUB 0219 OF 021A 021 A 88 C3 021C 021 A 021A 02 021C DB LABEL BYTE PTR OS: lES TEMP.DATA ACC RIGHTS) ,CPL3 DATA ACCESS BX,ES TEMP -AX, AX; CLEAR AX GET THE CURRENT DESCRIPTORS ACCESS RIGHTS 491 492 493 494 495 496 497 498 ; FUT A SELECTOR IN BX I PUT A SELECTOR I N A X ; MAKE ACCESS OF BX < AX MOV MOV OR 8B C3 74 80 80 75 06-10-85 LAR 110015 AX,BX OOFH BYTE AX,BX BYTE OFFSET CS:??0015 002H OFFSET CS:??0016 MOV 110016 LABEL ORC DB ORC ; I SSUE THE LAR COMMAND 499 500 INSURE THE DESCRIPTOR WAS VISIBLE 501 502 503 504 505 506 507 506 ;----021E 80 FC F3 0221 75 17 GO IF LAR WAS NOT CHANGED THE DESCRIPTORS ACCESS RIGHTS MUST BE 3 AH,CPL3 DATA ACCESS ERROR_EXIT2 - CMP JNZ 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 546 54' 550 551 552 553 554 555 556 557 556 559 560 561 562 563 564 565 566 567 568 569 ; JNZ ; AS EXPECTED? ; GO IF NOT I LOAD SEGMENT LIM I TS) CHECK THE LSL <><> <><><><><><><><><><> <><> CHECKPOINT F9 <><> 0223 BO F9 0225 E6 80 0227 C7 06 0048 AAAA MOV OUT MOV ~~~E~~~~M~~ SEG_LIM IT .OAAAAH 0220 C6 06 0040 93 0232 98 0048 MOV MOV ~~~~SP~~M~S: I ES_TEMP. DAT~_~g~BR ~~H~~b i ~~~~_DATA_ACCESS LSL BX. AXOOFH BYTE BX,AX BYTE OFFSET CS:110017 003H OFFSET CS:??0018 R07 0235 0236 0236 0238 0236 0236 0238 0238 OF ?? 00 I 7 8B 08 AL,OF9H DB LABEL MOV 110018 LABEL ORC 03 DB ORC 74 03 JZ 023A 023A E9 02CD R ERROR EX I T2: ..IMP 0230 81 FB AAAA 0241 C7 06 0048 5555 0247 B8 0048 R07: OF 1?0019 8B 08 11001A DB LABEL LABEL ORC DB ORC 75 EB JNZ 024F 81 FB 5555 0253 75 E5 CMP BX ,05555H ERROR_EX I T2 JNZ ;- - - 7; ~~; ~~~ ~~ ; ; ; - ~~~~~; ;~~; MOV OUT PUSH POP AL,OFAH MFG PORT ,AL BYTE PTR GOT PTR OS - <><><> <> <> <> <><><> <><><> <><> CHECKPOINT FA <><> MODIFY THE DESCRIPTOR TABLE SET TEMPORARY ES DESCRIPTOR 64K SEGMENT L1MIT/CPLO DATA ACCESS MOV MOV DS:ES TEMP.SEG LIMIT,MAX SEG LEN BYTE PTR OS: (ES_TEMP.DATA_ACC_RIGHTS) ,CPLO_DATA_ACCESS START WITH SEGMENT C6 06 004C lB C7 06 004A 0000 6A 48 07 2B FF 26: C7 05 AA55 INSURE CORRECT SEGMENT LIMIT GO IF NOT ------------------------------- TEST THAT A WRITE TO ADDRESS IBOOOO DOES NOT WRITE TO BOOO:O, OR lB8000 DOES NOT WRITE TO B800:0 ;----- 0267 026C 0272 0274 0275 0277 I F NOT SUCCESSFUL - - - - - - - - - - - - - - -- -- - - - - - - - - - - -- - - - - - -- - - - - -- -- -- -- - - - - - -- 0255 BO FA 0257 E6 80 0259 6A 08 025B IF 025C C7 06 0048 FFFF 0262 C6 06 0040 93 GO IF OK BX,OAAAAH ; I NSURE CORRECT SEGMENT LIM I T DS:ES TEMP.SEG LIMIT,05555H ;SET THE SEGMENT LIMIT TO 05555H AX ,ES-TEMP BX, AX; GET THE OESCR I PTOR SEGMENT LIM I T OOFH BYTE BX,AX BYTE OFFSET CS:??OOI9 003H OFFSET CS:??OOIA ERROR_EXIT2 GO IF NOT SUCCESSFUL MOV 03 SET SEGMENT LI MIT TO OAAAAH GET THE DESCR I PTOR SEGMENT LIM I T GO CMP MOV MOV LSL 024A 024B 024B 0240 024B 024B 0240 0240 ; ; IBOOOO MOV MOV ~~~~ti~M~:~l~~-~~M:O~~:~_HI_BYTE) PUSH BYTE PTR ES TEMP E5 DI,DI ; WORD PTR ES:[DI1,OAA55H ; POP SUB MOV ,IBH LOAD ES REG I STER POINT TO FIRST LOCATION WRITE A TEST PATTERN 570 TEST3 5-79 1-6 06-10 85 IBM Personal Computer MACRO Assembler Version 2.00 TEST3 ---- 06/10/85 POST EXCEPTION INTERRUPT TESTS 571 512 513 574 575 516 571 516 519 580 581 582 583 584 565 586 567 588 589 590 591 592 593 594 595 596 597 596 599 600 601 602 603 60. 605 606 601 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 621 626 629 630 DO FOR SEGMENT 021C 0282 0284 0285 C7 06 004A 8000 6A 48 01 26: C7 05 AA55 028A 028F 0295 0291 0298 C6 06 004C 1A Cl 06 o04A 0000 6A 48 01 26: Cl 05 AA55 MOV PUSH POP MOV DO FOR SEGMENT MOV MOV PUSH POP MOV 188000 DS:ES TEMP. BASE LO WORD,BOOOH BYTE PTR ES lEMP ; LOAD ES REGIS1ER ES WORD PTR ES: (0 r ] ,OAA55H I WR r TE A TEST PATTERN I AOOOO BYTE PTR OS: IES TEMP.BASE HI BYTE) ,IAH DS:ES TEMP.SASE-LO WORD,o- BYTE PTR ES TEMP LOAD ES REG I STER ES WORD PTR ES:(DIJ,OAA55H ; WRITE A TEST PATTERN B/W VIDEO CARD 0290 6A 20 029F 1F 02AO 88 05 PUSH PDP MDV BYTE PTR C BWCRT PTR OS -AX,OS: [DI J SET OS TO S/W DISPLAY REGEN BUFFER GET THE WORD FROM B/W V IDEO COMPAT[BLE COLOR 02A2 6A 28 02A4 IF 02A5 88 10 PUSH PDP MDV ;----- BYTE PTR C CCRT PTR OS -aX,OS:[DI) SET OS TO COMPAT [BLE COLOR MEMORY GET THE WORD FROM COLOR MEMORY EGA COLOR 02A 1 6A 30 02A9 IF 02AA 88 00 PUSH 02AC 50 02AO 80 35 O'::AF E6 80 0281 58 0282 3D AA55 02857416 0281 81 F8 AA55 0288 74 10 0280 81 F9 AA55 02Cl 74 OA 02C3 80 34 02C5 E6 80 PUSH PDP MDV BYTE PTR E CCRT PTR OS -CX,OS: [DJ J EGA COLOR CRT PO I NTER LOW 64K TEST FOR ERROR MDV OUT POP eMP JZ eMP JZ eMP JZ MOV OU7 AX AL,35H MFG PORT ,AL AX AX,OAA55H ERROR EX [T eX,OAA55H ERROR EX I T CX,OAA55H ERROR EX IT AL,34H MFG_PORT, AL SAVE RESULTS <><><><><> <> <> <><><> <> <> <><> CHECKPOINT 35 <><> RESTORE CHECK PO J NT <><> CHECKPO I NT 34 <><> SHUTDOWN 02Cl 02C1 B8 068F 02CA E8 0000 E 02CD 02CD E9 0000 E NORMAL EX IT! - MOV CALL ERROR EXll: -.IMP 0200 POST3 ENDP CODE ENDS END 5-80 TEST3 AX,6·H+CMOS SHUT_OOWN+NMI CMOS_WRITE PRoe _ SHUTDOWN ADDRESS FOR SHUTDOWN BYTE SET GOOD END I NG IBM Personal Computer MACRO Assembler Version 2.00 TEST4 ---- 06/10/85 POST AND 8[OS UT[LlTY ROUTINES I 2 3 4 5 6 7 B 9 10 II 12 13 14 15 16 17 IB 19 20 21 22 23 24 25 26 27 2B 29 30 31 32 33 34 35 36 37 3B 39 40 41 42 43 44 45 46 47 4B 49 50 51 52 53 54 55 56 57 5B 59 60 61 62 63 64 65 66 67 6B 69 70 PAGE 118,121 TITLE TEST4 ---- 06/10/85 POST AND BIOS UTILITY ROUTINES .286C .Ll ST CODE SEGMENT BYTE PUBL I C 0000 PUBLIC PUBL [C PUBLIC PUBL [C PUBL [C PUBLIC PUBL [C PUBLIC PUBLIC PUBL [C PUBL IC PUBL IC PUBLIC PUBLIC PUBL IC PUBL IC PUBLI C PUBLIC PUBL IC PUBLIC PUBLIC PUBLIC PUBL [C PUBL IC BEEP BLINK INT CMOS READ CMOS-WR [TE CONFTG BAD 011 DDS DUMMY RETURN 1 ERR BEEP E MSG INT 2ST KBD-RESET POST4 PROT PRT HEX PROC-SHUTDOWN PRT HEX PRT-SEG P MSG RE DIRECT ROM CHECK ROM-CHECKSUM SET-TOO WAITF XPC_BYTE EXTRN EXTRN EXTRN EXTRN EI63:NEAR OSF 421NEAR ROM-ERR:NEAR XMIT_8042:NEAR ASSUME CS:CODE,DS:DATA POST4 : 1--- CMOS READ ---------------------------------------------------------------READ BYTE FROM CMOS SYSTEM CLOCK CONFIGURATION TABLE 0000 0000 0000 000 I 0003 0004 0006 OOOT 0009 OOOA 00 DC 0000 00 OF 00 I I 0013 0014 0015 0018 I-I 06-10-85 9C DO F9 DO FA E6 90 E4 50 80 DO E6 58 OE E8 C3 INPUT: (AL): OUTPUT: (AU CMOS READ PUSHF 08 TO TI IA 08 TO 0019 R VALUE AT LOCATION (AL) MOVED INTO (AU. IF BIT T OF (ALI WAS ON THEN NM I LEFT DISABLED. OUR I NG THE CMOS READ BOTH NM I AND NORMAL INTERRUPTS ARE DISABLED TO PROTECT CMOS DATA INTEGRITY. THE CMOS ADDRESS REGISTER IS POINTED TO A DEFAULT VALUE AND THE INTERRUPT FLAG RESTORED TO THE ENTRY STATE ON RETURN. ONLY THE (All REGISTER AND THE NMI STATE IS CHANGED. PROC ROL STC RCR CLI OUT Nap IN PUSH "OV RCR OUT POP PUSH CALL RET CO CMOS TABLE ADDRESS TO BE READ BIT T : 0 FOR NMI ENABLED AND I FOR NMI DISABLED ON EX[T BITS 6-0 : ADDRESS OF TABLE LOCATION TO READ NEAR AL,I AL, I CMOS _PORT, AL AL,CMOS_OATA AX AL,CMOS_REG_D-2 AL, I CMOS_PORT, AL AX CS CMOS_POPF READ LOCATION (All INTO (I'\Ll SAVE INTERRUPT ENABLE STATUS AND FLAGS MOVE NMI B[T TO LOW POSITION FORCE NM I B IT ON I N CARRY FLAG HIGH BIT ON TO DISABLE NMI - OLD IN CY DisABLE INTERRUPTS ADDRESS LOCATION AND DISABLE NMI I/O DELAY READ THE REQUESTED CMOS LOCATION SAVE (AH) REG I STER VALUE AND CMOS 8YTE GET ADDRESS OF DEFAULT LOCATION PUT OR I G I NAL NM I MASK 81 T I NTO ADDRESS SET OEF AUL T TO READ ONLY REG I S TER RESTORE (AHI AND (All = CMOS BYTE -PLACE CODE SEGMENT IN STACK AND -HANDLE POPF FOR B- LEVEL 80286 RETURN WITH FLAGS RESTORED 71 72 73 74 75 76 n 7B 79 BO BI B2 B3 B4 B5 B6 B7 BB B9 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 lOB 109 110 III 112 113 0019 CMOS READ ENDP 0019 0019 CF CMOS POPF IRET PROC 00 I A CMOS_POPF ENDP - NEAR POPF FOR LEVEL B- PARTS RETURN FAR AND RESTORE FLAGS ; --- CMOS_WR I TE - -------- ------------------------------------------------------WRITE BYTE TO CMOS SYSTEM CLOCK CONFIGURATION TABLE INPUT: (AL) = (AHl = OUTPUT: 00 I A 00 I A 001 B 00 I C DOlE 001F 0021 0022 0024 0026 0028 002A 002C 002E 002F 0030 0033 9C 50 DO CO F9 DO 08 FA E6 SA E6 80 DO E6 58 DE ES C3 TO C4 Tl IA 08 TO 0019 R CMOS WR ITE PUSHF PUSH ROL STC RCR CLI OUT "OV OUT "OV RCR OUT POP PUSH CALL CMOS TABLE ADDRESS TO 8E WR ITTEN TO 81T 7:: 0 FOR NMI ENABLED AND I FOR NMI DISABLED ON EXIT BITS 6-0 = ADDRESS OF TABLE LOCATION TO WRITE NEW VALUE TO BE PLACED IN THE ADDRESSED TABLE LOCATION VALUE IN {AHl PLACED IN LOCATION (ALl WITH NMI LEFT DISABLED IF BIT 7 OF (ALI IS ON. dURING THE CMOS UPDATE 80TH NMI AND NORMAL INTERRUPTS ARE DISABLED TO PROTECT CMOS DATA INTEGRITY. THE CMOS ADDRESS REG I STER I S PO I NTED TO A DEFAULT VALUE AND THE INTERRUPT FLAG RESTORED TO THE ENTRY STATE ON RETURN. ONLY THE CMOS LOCATION AND THE NMI STATE IS CHANGED. PROC NEAR AL,I AL,I CMOS PORT, AL AL,AH CMOS DATA,AL AL.C'MOS REG 0-2 AL,I CMOS PORT, AL AX CS - CMOS_POPF WRITE (AH) TO LOCATION (ALI SAVE INTERRUPT ENABLE STATUS AND FLAGS SAVE WORK REGISTER VALUES MOVE NMI BIT TO LOW POSITION FORCE NMJ 81T ON IN CARRY FLAG HIGH BIT ON TO DISABLE NMI - OLD IN CY D I SABLE INTERRUPTS ADDRESS LOCATION AND DISABLE NMI GET THE DATA BYTE TO WRITE PLACE IN REQUESTED CMOS LOCATION GET ADDRESS OF DEFAULT LocATION PUT ORIGINAL NMI MASK BIT INTO ADDRESS SET DEFAULT TO READ ONLY REGISTER RESTORE WORK REG I STERS -PLACE CODE SEGMENT IN STACK AND -HANDLE POPF FOR B- LEVEL 80286 RET 0034 TEST4 5-81 1-2 06-10-85 IBM Personal Computer MACRO Assembler Version 2.00 TEST4 ---- 06/10/85 POST AND BIOS UTILITY ROUTINES 114 115 116 111 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 0034 0034 2E: 8E IE 003A R PAGE DDS 0039 C3 PROC MDV RE7 003A ---- R DDSDATA OW 003C DDS NEAR DS.CS:DDSDATA LOAD (OS) TO DATA AREA PUT SEGMENT VALUE OF DATA AREA RETURN TO USER WITH (OS):: DATA DATA SEGMENT SELECTOR VALUE FOR DATA AREA INTO OS ENOP ;--- E MSG -- P MSG ----------------------------------------------------- THIS SUBROUTINE WILL PRINT A MESSAGE ON THE DISPLAY ENTRY REQU I REMENTS: SI :: OFFSET(ADDRESS) OF MESSAGE BUFFER CX :: MESSAGE BYTE COUNT MAX I MUM MESSAGE LENGTH IS 36 CHARACTERS BP '" BIT 0=EI61/EI62, BIT I=CONFIG_BAD, 2-15= FIRST MSG OFFSET PRoe TEST JNZ NEAR BP,03FFFH E_MSG I 56 81 E6 3FFF OB EE 5E PUSH AND DR PDP SI E8 IE E8 F6 14 CALL PUSH CALL TEST P MSG PR I NT MESSAGE OS SAVE CALLERS (OS) DDS ; POINT TO POST/BIOS DATA SEGMENT BYTE PTR @EQUIP FLAG,OIHj LOOP/HALT ON ERROR SWITCH ON ? MFG_HAL T ; YES THEN GO TO MANUFACTUR ING HALT PDP RE7 OS RESTORE CALLERS AL,@MFG ERR FLAG MFG_PORT, ALMFG_HAL T MANUFACTUR I NG LOOP MODE ERROR TRAP o I SABLE INTERRUPTS RECOVER ERROR I NO I CA TOR SET INTO MANUFACTURING PORT HALT SYSTEM HOT NMJ TRAP NEAR AL,CS: [51] SI AX PRT HEX AX AL,LF P _MSG DISPLAY STRING FROM PUT CHARACTER IN (AL) PO I NT TO NEXT CHARACTER SAVE PR INT CHARACTER CALL VIDEO 10 RECOVER PRINT CHARACTER WAS IT LINE FEED? NO, KEEP PRINTING STRING 003C 003C F7 C5 3FFF 0040 75 08 0042 0043 0047 0049 004A 004A 0040 004E 0051 0056 E_MSG 0063 R 0034 R 06 0010 R 01 02 0058 IF 0059 C3 005A 005A 005B 005E 0060 0061 FA AD 0015 R E6 BO F4 EB F1 MFG HALT: CLI MDV DU7 HL 7 JMP SI,03FFFH BP,SI SI CHECK FOR NOT FIRST ERROR MESSAGE SKIP IF NOT FIRST ERROR MESSAGE SAVE MESSAGE POINTER USE LOW 14 BI TS OF MESSAGE OFFSET AS FIRST ERROR MESSAGE FLAG (BIT 0 = E1611E162, BIT t = BAD_CONFIG WS' 0063 IbO 161 162 163 164 165 166 161 168 169 0063 0063 0066 0061 0068 006B 006C 006E 0010 P _MSG PROC MDV INC PUSH CALL PDP CMP JNE RET P _MSG ENDP 2E: 8A 04 46 50 E8 0128 R 58 3C OA 15 F3 C3 (CS:) 170 111 0011 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 ERR BEEP 9C FA OA F6 74 IE 70 0500 OOAF R C233 00F5 R CE EE 0089 IE 008A E8 0034 R 0080 80 3E 0012 R 01 0092 IF 0093 74 C5 202 203 204 205 0095 0095 0091 009A 0090 OOAO 00A3 00A5 206 207 208 209 ------------ --- ------------ -- NEAR CLi DR JZ DH,DH G3 MDV MDV CALL MDV CALL DEC JNZ BL.112 CX,I280 BEEP CX,49715 WAITF DH Gl SAVE FLAGS DISABLE SYSTEM INTERRUPTS ANY LONG ONES TO BEEP NO, DO THE SHORT ONES LONG BEEPS COUNTER FOR LONG BEEPS 11-3/4 SECONDS) DIVISOR FOR 932 HZ DO THE BEEP 2/3 SECOND DELAY AFTER LONG BEEP OELAY BETWEEN BEEPS ANY MORE LONG BEEPS TO DO LOOP TILL DONE PUSH CALL CMP PDP JE OS DDS @MFG_TST,OtH OS MFG_HAL T MANUFACTURING TEST MODE? RESTORE ORIGINAL CONTENTS OF YES - STOP BLINKING LEO SHORT BEEPS COUNTER FOR A SHORT BEEP (9/32) DIVISOR FOR 981 HZ DO THE SOUND I /2 SECOND DELAY AFTER SHORT BEEP DELA Y BETWEEN BEEPS DONE WITH SHORT BEEPS COUNT LOOP 11 LL DONE GI: B3 B9 E8 89 E8 FE 75 '" 197 198 199 200 201 = .-- ----------------- - PUSHF PROC ; 0011 0011 0072 0013 0075 0017 0017 0079 001C 001F 0082 0085 0087 -- ERR BEEP -------- -------------------------------------------------THIS PROCEDURE WILL ISSUE LONG TONES (1-3/4 SECONDS) AND ONE OR MORE SHORT TONES (9/32 SECOND) TO INDICATE A FAILURE ON THE PLANAR BOARD, A BAD MEMORY MODULE, OR A PROBLEM WITH THE CRT. ENTRY PARAMETERS: DH = NUMBER OF LONG TONES TO BEEP. DL NUMBER OF SHORT TONES TO BEEP. G3: B3 B9 E8 89 E8 FE 75 12 04B8 OOAF R 8178 00F5 R CA EE MDV MDV CALL MDV CALL DEC JNZ BL,I B CX,I208 BEEP CX,33144 WAITF DL G3 69 8178 E8 00F5 R MDV CALL PDPF RET CX,33144 WAITF SAVE OS REGISTER CONTENTS (OS) 210 211 212 213 214 215 OOA 1 OOAA OOAD OOAE 216 OOAF 5-82 90 C3 ERR BEEP - TEST4 ENDP 1/2 SECOND DELAY AFTER LAST BEEP MAKE I T ONE SECOND DEL A Y BEFORE RETURN RESTORE FLAGS TO OR I G (NAL SETT I NGS RETURN TO CALLER '-3 [BM Personal Computer MACRO Assembler Version 2.00 TEST4 ---- 06/[0/85 POST AND 8[05 UTILITY ROUTINES 217 216 2 •• 220 22' 222 223 224 225 226 221 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 246 249 2S0 251 252 253 254 255 256 2S7 258 259 260 261 262 263 264 265 266 261 266 269 270 27. 272 273 274 275 276 PAGE ; - -- BEEP - - -- -- - - --------------------- - ------------------------- --- ---ROUT I NE TO SOUND THE BEEPER US I NG T I MER 2 FOR TONE ENTRY: (BL) DURATION COUNTER ( \ FOR 1/64 SECOND I (CX) = FREQUENCY DIVISOR (1193180/FREQUENCYI (1331 FOR 886 HZ) = (AX) ,(BL), (CX) OOAF OOAF 0080 0081 00B3 0085 0087 0089 00B8 OOBD OOBF OOCI 00C3 OOCS 00C7 00C9 OOCA OOCA OOCD 0000 0002 0004 0005 0006 0008 DaDA OOOC OOoE OOEO 00E2 00E3 OOE6 00E9 OOEA OOEB OOED OOEF OOFI 00F3 00F4 PROC PUSHF BEEP 9C FA 80 E6 E8 8A E6 E8 8A E6 E4 8A OC E6 90 MODIF[ED. NEAR elI 86 43 00 CI 42 00 C5 42 61 EO 03 61 AL,IOIIOIIOB TIMER+3,AL "OY OUT JMP MOY OUT JMP "OY OUT '.2 AL,CL TIMER+2,AL "2 AL,CH T[MER+2,AL AL,PORT B AH,AL AL,GATE2+SPK2 PORT_B,AL 'N "OY OR OUT POPF 9C FA E4 OC 22 8A 24 E6 90 B9 E8 9C FA E4 24 OA E6 90 C3 040B 00F5 R CB F6 CX,1035 WAITF "OY CALL DEe JNZ BL G7 PUSHF elI 61 FC EO C4 FC 61 AL,PORT B AL,NOT (GATE2+SPK21 AH,AL AL,AH AL,NOT (GATE2+SPK21 PORT_B,AL 'N OR AND MOY AND OUT POPF MOY CALL PUSHF 040B 00F5 R CX,1035 WA ITF elI 'N 61 03 C4 61 00F5 1t:6~~~2~SPK2 AND AL,AH PORT_B,AL OR OUT POPF RET BEEP ENoP ENTRY: (CX) = COUNT OF 15.085737 MICROSECOND INTERVALS TO WAIT MEMORY REFRESH TI MER \ OUTPUT USED AS REFERENCE EXIT: (CX ~ =0 AFTER (ex) TIME COUNT (PLUS OR MINUS 16 MICROSECONDS) PROC PUSH NEAR AX (CX)-15.085131 US OELAY FOR SAVE WORK REGISTER (AH) 'N ANO eMP JE AL.PORT_B AL, REFRESH 8] T AL,AH WA[TFI USE TIMER OUTPUT BI TS READ CURRENT COUNTER OUTPUT STATUS MASK FOR REFRESH DETERMINE BIT 010 IT JUST CHANGE WA IT FOR A CHANGE IN OUTPUT LINE OOFE 8A EO 0100 E2 F4 "OY LOOP AH,AL WAITFI SAVE NEW FLAG STATE DECREMENT HALF CYCLES TILL COUNT END 0102 58 0103 C3 POP AX RESTORE RETURN 00F5 00F5 50 00F6 00F6 OOF8 OOFA OOFC WAITF WAITFI: E4 24 3A 14 61 10 C4 F8 RET 0104 WA[TF 296 299 300 301 302 303 304 305 306 301 308 309 310 31 I 312 313 314 31S SAVE ] NTERRUPT STATUS BLOCK I NTERRUPTS OUR I NG UPDATE GET CURRENT PORT VALUE I SOLATE CURRENT SPEAKER BITS I N CASE SOMEONE TURNED THEM OFF OUR I NG BEEP RECOVER VALUE OF PORT FORCE SPEAKER DA T A OFF AND STOP SPEAKER T[MER RESTORE INTERRUPT FLAG STATE FORCE I /64 SECOND DELAY (SHORT I MIN] MUM DEL A Y BETWEEN ALL BEEPS SAVE I NTERRUPT STATUS BLOCK INTERRUPT S DUR I NG UPDATE GET CURRENT PORT VALUE IN CASE SOMEONE TURNED THEM ON RECOVER VALUE OF PORT B RESTORE SPEAKER STATUS RESTORE [NTERRUPT FLAG STATE ; --- WA I TF --------- - ---------------- - -------------- ------ ---- ------ ----F I XED T I ME WA [T ROUT I NE (HARDWARE CONTROLLED - NOT PROCESSOR I 296 297 SETUP T I MER 2 SAVE [NTERRUPT STATUS BLOCK I NTERRUPTS OUR I NG UPDATE SELECT T] MER 2 I LSB I MSB I B] NARY WRITE THE TIMER MODE REGISTER I/O DELAY DIVISOR FOR HZ (LOW) WRITE TIMER 2 COUNT - LSB I/O DELAY DIVISOR FOR HZ (HIGH) WRITE TIMER 2 COUNT - MSB GET CURRENT SETT I NG OF PORT SAVE THAT SETTING GATE T I MER 2 AND TURN SPEAKER ON AND RESTORE [NTERRUPT STATUS I /64 SECOND PER COUNT (BLI DELA Y COUNT FOR I /64 OF A SECOND GO TO BEEP DELA Y I { 64 COUNT (BL) LENGTH COUNT EXPIRED? NO - CONT I NUE BEEP I NG SPEAKER G7: B9 E8 FE 75 271 276 27' 260 26. 282 283 264 285 286 281 288 289 2.0 291 292 2.3 294 295 06-10-85 ;- - - 0 I 04 010450 0 I OS 86 0108 E8 0108 OC 010086 OIOF E8 0 I 12 58 01 \3 81 0111 C3 01 18 8E8E 0000 R 20 EO OOIA R CD 4000 . (AHI (CX) =0 ENDP CONF I G BAD ----- -- --------------- -------------- --- ------- ---- -- ----SET-CMOS DIAG WITH CONF]G ERROR B]T (WITH NMI DISABLED~ : (BP) BIT-'4 SET ON TO INDICATE CONFIGURATION ERROR CONF [G BAD - PUSH MOY CALL OR XCHG CALL POP OR RET CONF I G_BAD PROC NEAR AX AX,X- (CMOS DIAG+NMI) CMOS READ AL,BAD CONFIG AH,AL CMOS WR I TE ADDRESS CMOS DIAGNOSTIC STATUS BYTE GET CURRENT VALUE SET BAD CONF[GURATION B[T SETUP FOR WR I TE UPDATE CMOS WITH BAa CONF]GURATION BP,04000H SET CONFIGURAT[ON BAD FLAG IN AX - (BP) ENDP TEST4 5-83 1-4 IBM Personal Computer MACRO Assembler VerSion 2.00 TEST4 ---- 06/10/85 POST AND 8105 UTILITY ROUTINES 316 317 318 31. 320 321 322 323 324 325 326 321 328 329 330 331 332 333 334 335 336 331 338 339 340 341 342 343 344 345 346 341 348 34. 350 351 352 353 354 355 356 351 358 359 360 361 362 363 364 365 366 367 368 36' 370 PAGE ;--- XPC...,:BYTE -- 06-10-85 XLATE~PR -- PRT~HEX CONVERT AND PR I NT ASC I I ----------------------------------- CODE CHARACTERS AL CONTAINS NUMBER TO eE CONVERTED. AX AND ex DESTROYED. 0118 0118 0119 OIIC 0 II F 0120 XPC_BYTE 50 CO E8 04 E8 0122 R 58 24 OF PUSH SHR CALL POP AND 0 I 22 0 I 22 04 90 012421 0 I 25 14 40 012121 XLAT_PR PROC ADD OAA Aoe 0 I 28 0 I 28 012A 012C 0 12E PRT _HEX PROC MOV "OV INT RET NEAR PROC AX AL,4 XLAT_PR AX AL, OFH DISPLAY TWO HEX DIGITS SAVE FOR LOW NIBBLE 0 I SPLA Y NIBBLE SWAP 00 THE HIGH NIBBLE DISPLAY RECOVER THE NIBBLE ISOLATE TO LOW NIBBLE FALL INTO LOW NIBBLE CONVERSION NEAR AL,090H CONVERT OO-OF TO ASC [[ CHARACTER ADO FIRST CONVERSION FACTOR AD-JUST FOR NUMERIC AND ALPHA RANGE ADD CONVERSION AND ADJUST LOW NIBBLE AD-JUST HIGH NIBBLE TO ASCI [ RANGE AL,040H OM 84 OE B1 00 CD 10 C3 012F 012F 012F NEAR AH,OEH BH,O IOH PRT HEX ENDP XLAT PR ENDP XPC_BYTE 01 SPLA Y CHARACTER IN (AL) COMMAND ENDP ; --- PRT SEG ---------------- - - - --- - ------ --------- -- -- ---------PR[NT A SEGMENT VALUE TO LOOK LIKE A 21 B[T ADDRESS ox MUST CONTAIN SEGMENT VALUE TO BE PRINTED ; ------ - - 012F 012F 0131 0134 0136 0139 0138 013E 0140 0143 8A E8 8A E8 80 E8 80 E8 C3 C6 0118 C2 0118 30 0128 20 0128 R R R R 0144 ------------ -- ------- PRT SEG PROC MOV CALL "DV CALL MDV CALL MOV CALL RET NEAR AL,OH XPC BYTE AL,DL XPC BYTE AL, '0' PRT HEX AL, T • PRT _HEX GET MSB 01 SPLA Y SEGMENT HIGH BYTE LS8 01 SPLA Y SEGMENT LOW BYTE PRINT A '0 • TO MAKE LOOK LIKE ADDRESS ADD ENDING SPACE PRT SEG ENDP PUT A CHARACTER TO THE DISPLAY BUFFERS WHEN (ALJ 101 ) 371 372 373 = ASC I I CHARACTER = 0 I SPLA Y REGEN BUFFER IN PROTECTED MODE POS iT I ON 374 315 316 311 318 37. 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 3.7 3.8 3 •• 400 401 402 403 404 405 406 401 408 409 410 411 412 413 414 415 416 411 418 419 420 421 422 0144 0144 06 0145 51 0146 01 E1 PROT PRT HEX PUSH PUSH SAL PROC ES NEAR SAVE CURRENT SEGMENT REGI STERS 01 DI,I MULTIPLY OFFSET BY TWO MONOCHROME V [OED CARD 0148 014A 0148 014C 6A 20 01 AA 4F PUSH POP STOSB DEC BYTE PTR C BWCRT PTR ES -D[ GET MONOCHROME BUFFER SEGMENT SELECTOR SET (ES) TO B/W D'ISPLAY BUFFER PLACE CHARACTER [N BUFFER ADJUST PO I NTER BACK ENHANCED GRAPH I CS ADAPTER 0140 6A 30 014F 01 0 I 50 A'A 0151 4F 0152 6A 38 015401 0155 AA 0156 4F PUSH POP STOSB DEC PUSH PDP STOSB DEC BYTE PTR E CCRT PTR ES -- 01 BYTE PTR E CCRT PTR2 ES -01 ENHANCED COLOR 0 I SPLA Y PO I NTER LOW 64K LOAD SEGMENT SELECTOR PLACE CHARACTER I N BUFFER AD-JUST PO I NTER BACK ENHANCED COLOR D I SPLA Y PO [NTER HI 64K LOAO SEGMENT SELECTOR PLACE CHARACTER I N BUFFER AD-JUST PO I NTER BACK COMPAT I BLE COLOR 0151 6A 0159 01 015A 53 015852 DI5C 51 0150 33 0 15F 8A 0162 93 0163 0163 EC 0164 A8 0166 EI 0 I 68 93 0169 AA 016A 016e 016C 0160 016E 016F 28 C9 03DA BYTE PTR C CCRT PTR -ES 8X OX SET lOS) TO COMPATIBLE COLOR MEMORY CX,CX DX,030AH AX,BX TIMEOUT LOOP FOR "BAD" HARDWARE STATUS ADDRESS OF COLOR CARD SAVE IN IBX) REGISTER IN TEST LOOPZ XCHG STOSB AL,OX AL. RVRT+RHRZ PROT S AX,BX GET COLOR CARD STATUS CHECK FOR VERT I CAL RETRACE TIMEOUT LOOP TILL FOUND RECOVER CHARACTERS PLACE CHARACTER I N BUFFER ex RESTORE REG I STERS SAVE WORK REG I STERS ex PROT_S: 09 FB 59 5A 5B 5F 01 C3 POP POP PDP PDP POP RET 0110 5-84 PUSH POP PUSH PUSH PUSH XOR "DV XCHG TEST4 OX 8X 01 ES (OR HORZ I 1-5 IBM Personal Computer MACRO Assembler VerSIon 2.00 TEST4 ---- 06/10/85 POST AND 8[05 UTIL[TY ROUTINES 423 424 425 06-10-85 PAGE ; --------- -; ROM CHECKSUM SUBROUT I NE ---------- ----- ---------- --- 42b 421 428 429 430 431 432 433 434 435 43b 431 438 439 440 441 442 443 444 445 44b 441 448 449 450 4S1 452 453 454 455 45b 451 458 459 4bO 4bl 4b2 4b3 4b4 4b5 4bb 4b1 4b8 4b9 470 411 412 413 414 415 41b 411 418 419 480 481 482 483 484 485 48b 481 488 489 490 491 492 493 494 495 49b 491 498 499 500 50 I 502 503 504 505 506 501 508 509 0170 01702BC9 ROM CHECKSUM SUB 0172 0172 0174 0174 0176 0177 ROM CHECKSUM CNT: XOR AL,AL 32 CO 02 07 43 E2 FB NEAR NUMBER OF BYTES TO ADD DR RET ROM_CHECKSUM IS 64K ENTRY FOR OPT I ONAL ROM TEST GET (DS:BX) PO I NT TO NEXT BYTE ADD ALL 8YTES [N ROM MODULE ADD INC LOOP O! 79 OA CO C3 o 17B o 17C PROC CX,CX AL,AL = SUM 01 ENDP .; - - - - -- --THIS - -- ----- --- - ---- - ------- - - -- - - -------- ------ - ----------- ----- --ROUT[NE CHECKSUMS OPTIONAL ROM MODULES AND ; IF CHECKSUM IS OK, CALLS INIT[ALIZATION/TEST CODE IN MODULE ; - - - - - - - - - - --- - -- - -- - ---- - - - --- ----- - - -- - -- - --- - --- - - ---- - ------- - - -- - - -o 17C 017C B8 OI7F 8E 0181 2A 0183 8A 0186 CI 018988 0188 CI 018E 03 0190 E8 0193 74 ---- R CO E4 47 02 EO 09 C8 E8 04 DO 0172 R 05 ROM CHECK: MOV MDV SUB MDV 5HL MDV SHR ADD CALL JZ 0195 E8 0000 E 0198 E8 13 CALL JMP o 19A o 19A 0198 0lA2 o I A7 01 AC ROM CHECK I: POSH 52 26: C7 06 0067 R 0003 MOV 26: 8C IE 0069 R MDV 26: FF IE 0067 R CALL 5A POP o lAD o I AD o IAE C3 NEAR PROC AX,DATA ES,AX AH,AH AL, [BX+2] AX,9 CX,AX AX,4DX,AX ROM CHECKSUM CNT ROM:=CHECK_I - ; SET PO I NTER TO NEXT NODULE DO CHECKSUM ROM ERR SHORT ROM_CHECK_END POST CHECKSUM ERROR AND EXIT OX SAVE POINTER ES:!!IIO_ROM_INIT,0003H LOAD OFFSET ES: 1111 a ROM SEG, OS j LOAD SEGMENT DWORD PTR ES:OIO ROM INIT; CALL IN[TIALIZE/TEST ROUTINE OX - - ROM CHECK ENOl RET ROM_CHECK ; - - - o IAE 01 AE 80 FF OIBO E8 0000 E 0183 E3 23 j PROC NEAR AL,OFFH XMIT 8042 GI3 - 0lB5 3C FA 0187 75 IF CMP JNZ AL,KB_ACK CI3 0189 OIBB OIBD o IC2 0lC3 DIGS 0lG7 0lC7 OICC DICE 80 E6 C6 F8 B3 28 MOV OUT MDV 01 NTR_FLAG, 0 DIDO 0102 0104 0104 0106 0108 0 I 08 FE C8 75 F3 SET KEYBOARD RESET COMMANO GO I SSUE THE COMMANO EX[T I F ERROR MOV SUB BL,IO CX,CX ENABLE KEYBOARD INTERRUPTS WRITE 8259 [NTERRUPT MASK REGI STER RESET INTERRUPT INDICATOR ENABLE INTERRUPTS TRY FOR 400 M [LL I SECONDS SETUP INTERRUPT TIMEOUT COUNT TEST JNZ LOOP (jIINTR _FLAG,02H GI2 Gil DID A KEYBOARD I NTERRUPT OCCUR YES READ SCAN CODE RETURNED LOOP TILL TIMEOUT NO DEC JNZ BL Gil TRY AGAIN IN MOV AL,PORT_A 8L,AL READ KEYBOARD SCAN CODE SAVE SCAN CODE JUST READ AL,OFDH INTAO! ,AL 5T1 OA C9 RETURN TO CALLER ENDP K8D T~~;E~R;~~~~~~-; ~~~-~~~~-~-~;;~;~~~-~~~~~ -~~-~~~-~~;~~~~~~-----SCAN CODE OAAH SHOULD BE RETURNED TO THE PROCESSOR. SCAN CODE 065H [S DEFINED FOR MANUFACTURING TEST KBD_RESET MOV CALL JCXZ FD 21 06 006B R 00 POINT ES TO DATA AREA ; ZERO OUT AH ; GET LENGTH I NO [CA TOR MULTIPLY BY 512 SET COUNT GIl: F6 06 0068 R 02 75 06 E2 F7 , - G12: E4 60 8A 08 G13: C3 0109 RETURN TO CALLER RET KBD_RESET ENDP ; -------------------------- - -- - -------- SID 511 Sl2 Sl3 Sl4 515 516 517 518 519 520 521 522 523 524 ; ; 0109 0109 FB OIDA 50 0108 E4 80 01003440 OIOF E6 80 OIEI 80 20 0 I E3 E6 20 0lE5 58 0lE6 CF BLINK I NT STI PUSH IN 525 526 0lE7 BL[NK INT ; ----------------- BLINK LED PROCEDURE FOR MFG RUN-IN TESTS IF LED IS ON, TURN IT OFF. IF OFF, TURN ON. - - - - --- - - -- -- - - - - --- --- - - - - - -- - - ---- - -- - - - ----- ----- - -- XOR OUT MOV OUT PDP IRET PROC NEAR AX AL,MFG PORT AL,OlOo-00008 MFG PORT, AL AL,EOI INTAOO ,AL AX SAVE AX REGIStER CONTENTS READ CURRENT VALUE OF MFG PORT FLI P CONTROL 8 [T - RESTORE AX REGISTER ENDP TEST4 5-85 1-6 IBM Personal Computer MACRO Assembler Version 2.00 TEST4 ---- 06/10/85 POST AND 8105 UTILITY ROUTINES 527 52. 529 530 531 532 533 534 535 536 537 536 539 540 541 542 543 544 545 546 547 54. 549 550 551 552 553 554 555 556 557 55. 559 560 561 562 563 564 565 566 567 56. 569 570 571 572 573 574 575 576 577 578 579 560 561 562 563 564 565 566 567 56. 56. 5'0 591 592 593 5'4 595 596 597 596 59. 600 601 602 603 604 605 606 607 606 60. 610 611 612 613 614 615 616 6" 618 61' 620 621 622 623 624 625 626 627 62' 629 630 631 632 633 634 635 636 637 06-10-55 PAGE ; ; ; ; ; ; ; ---- ---THIS - ------------- ---- - ---- --- - ---- - ---- - --- - - -- - - - -- -- - -- - - - - - - -- - - - - - - - -ROUTINE INITIALIZES THE TIMER DATA AREA IN THE ROM BIOS DATA AREA. IT IS CALLED BY THE POWER ON ROUTINES. IT CONVERTS HR:MIN;SEC FROM CMOS TO TIMER TICS. IF CMOS IS INVALID, TIMER IS SET TO ZERO. INPUT NONE PASSED TO ROUTINE BY CALLER CMOS LOCAT IONS USED FOR T I ME OUTPUT ttTIMER LOW ; ; ; !liT I MER-H I GH ; IPTI MER-OFL ; ALL REGI STERS UNCHANGED ; ~~~~;~ - ~~~ - - - - - - ~~~ - - -- - ~ ~ - --- - -- - - - - - 0012 0444 0007 0080 o IE7 01 E1 OlEa 01 E9 OIEC OIEE OIF! 0lF4 0lF7 0lF9 OIFC OIFE 0200 0202 0202 0204 0207 0209 60 IE Ea 2B A2 A3 A3 80 E8 24 28 75 0034 CO 0070 006C 006E 8E 0000 C4 C9 64 R COUNTS-M I N COUNTS-HOUR UPDATE:::TIMER EQU EQU EQU SET TOO PROC PUSHA PUSH CALL SUB NEAR R R R MOV MOV MOV MOV R CALL AND SUB JNZ 1092 7 10000000B -- - - ;~~~~ -~~; ~ - ~~~~~~~ ~ ~~ -~~~; ;~~ - - - -- --65543 65536 RTC UPDATE IN PROCESS BIT MASK OS DOS ESTABLI SH SEGMENT AX,AX IPTIMER OFL,AL RESET TIMER ROLL OVER INO[CATOR oPT I MER-LOW, AX AND T I MER COUNT !liT I MER-H I GH, AX AL, CMOS 0 I AG+NM I CHECK CMOS VAll 0 ITY CMOS READ , READ DIAGNOSTIC LOCATION IN CMOS AL,BAO BAT+BAo CKSUM+CMOS CLK FAIL CX,CX -BAD-BATTERY, CHKSUM ERROR, CLOCK ERROR CMOS NOT VALID -- TIMER SET TO ZERO POD_DONE UIP: CALL TEST LOOPZ AL,CMOS REG A+NMI CMOS READ AL, UPDATE T I MER UIP - ACCESS REG I STER A READ CMOS CLOCK REGISTER A JCXZ POD_DONE CMOS CLOCK STUCK IF Tl MEOUT MOV CALL TEST LOOPNZ AL,CMOS REG A+NMI CMOS READ AL,UPDATE TIMER UIPOFF - NEXT WAIT TILL END OF UPDATE 0216 E3 4E JCXZ POD_DONE CMOS CLOCK STUCK 0218 021A 0210 021F 80 Ea 3C 77 80 0000 R 59 48 MDV AL, CMOS SECONOS+NMi CMOS READ AL,59H TOO_ERROR TIME JUST UPDATED ACCESS SECONDS VALUE IN CMOS ARE THE SECONDS WITH[N LIMITS? GO IF NOT 0221 0224 0226 0229 0228 0220 022F 0231 0234 0236 0238 0238 023C 023E 0240 0241 0244 0246 0248 024A 0240 024F E8 88 CI 83 F6 03 80 Ea 3C 77 E8 50 01 03 58 027F R C8 E9 02 CALL CVT BI NARY CX,AX CX,2 BL, COUNTS SEC BL CX,AX AL,CMOS MINUTES+NMI CMOS READ AL,59H TOO ERROR CVT-B] NARY AX AX,I CX,AX AX CONVERT I T TO B I NARY MOVE COUNT TO ACCUMULATl ON REG I STER ADJUST FOR SYSTEMAT [C SECONDS ERROR F7 03 80 E8 3C 77 E3 ca 84 0000 R 23 16 JA 0251 0254 0256 0258 025A 025C 025F 0263 OZ66 0266 0267 0268 E8 88 83 F6 03 83 89 A3 027F R 00 07 E3 CI 02 00 16 006E R D06C R MOV MDV MUL ADD ADC MOV MOV 0208 0200 0200 020F 0212 0214 0269 0269 026A 0268 026E 0271 0214 0277 0279 OZ7B 027E 80 E8 A8 EI 8A 0000 R 80 F7 E3 59 80 E8 A8 EO 8A 0000 R 80 F1 12 E3 C8 82 0000 R 59 31 027F R E6 C8 88 0444 CMP JA MOV SHR MOV MUL ADO MOV CALL CMP JA CALL PUSH SHR ADD POP MOV MUL ADD MOV CALL CMP CALL TOD ERROR; POP POPA IF 61 BE E8 B8 E5 DC 86 E8 C3 CALL POD DONE: POP POPA RET IF 61 C3 0000 003C 8E8E 0000 04 C4 OOIA ~~,COUNTS_MIN CX,AX AL, CMOS HOURS+NM I CMOS READ AL,23H TOO_ERROR CVT BINARY DX,AX 8L, COUNTS HOUR BL AX,CX OX,OOOOH PTIMER HICH,DX eaT [MER=LOW. AX [S ON Os MDV S [ ,OFFSET E 163 R CALL E MSG MOV AX,X· (CMOS o[AG+NMI ) CMOS READ AL,CMOS CLK FAIL AL,AH CMOS_WRITE R CALL OR R XCHG CALL ACCESS REG [STER A READ CMOS CLOCK REG I STER A [F TIMEOUT COUNT FOR SECONDS ACCESS MINUTES VALUE [N CMOS ARE THE M[NUTES WITHIN LIMITS? GO IF NOT CONVERT I T TO B I NARY SAVE MINUTES COUNT A~JUST FOR SYSTEMAT[C MINUTES ERROR ADD ADJUSTMENT TO COUNT RECOVER BCD MINUTES VALUE COUNT FOR M [NUTES ADD TO ACCUMULATED VALUE ACCESS HOURS VALUE [N CMOS ARE THE HOURS WITHIN LIMITS? GO IF NOT CONVERT I T TO B] NARY COUNT FOR HOUR S OS E RESTORE SEGMENT RESTORE REGI STERS 01 SPLA Y CLOCK ERROR SET CLOCK ERROR IN STATUS READ D[AGNOSTIC CMOS LOCATION SET NEW STATUS WITH CMOS CLOCK ERROR MOVE NEW STATUS TO WORK REGI STER UPDATE STATUS LOCATION RE7 SET_TOO ENoP 8A CO 24 05 C3 EO EC 04 OF OA CVT BINARY MOV SHR AND AAD PROC AH,AL AH,4 AL,DFH RET 0259 5-86 WAIT TILL UPDATE BIT UIPOFF: 027F 027F 027F 0281 0284 0256 0288 MOV CVT_BINARY TEST4 ENoP NEAR UNPACK 2 BCD DIG[TS IN AL RESULT I SIN AX CONVERT UNPACKED BCD TO B [NARY IBM Perl:lonal Computer MACRO Assembler Version 2.00 TEST4 ---- 06/10/85 POST AND 8[OS UTILITY ROUTINES b38 b39 b40 b41 b42 b43 b44 b45 b4b b47 b48 649 650 651 652 653 654 655 656 657 658 b59 660 661 662 663 664 665 666 667 668 669 1-7 06-10-85 PAGE ;--- D11 -- INT ?? H -- ( [RQ LEVEL ?? ) ------------------------------------: TEMPORARY INTERRUPT SERVICE ROUTINE FOR POST ; TH I S ROUT [NE I S ALSO LEFT [N PLACE AFTER THE POWER ON 0 I AGNOSTI CS ; TO SERVICE UNUSED INTERRUPT VECTORS. LOCAT[ON "OINTR FLAG~ WILL ; CONTAIN EITHER: ; I) LEVEL OF HARDWARE INTERRUPT THAT CAUSED CODE TO BE EXECUTED, OR ; 2) "FF" FOR A NON-HARDWARE [NTERRUPT THAT WAS EXECUTED ACC I DENT ALL Y • ; 0289 0289 028A 0288 028D 028F 0291 0293 0295 0297 50 53 80 E6 E8 E4 8A OA 15 Oil PROC PUSH PUSH "OV OUT J"P IN "OV OR JNZ AL,INTAOO AH,AL AL,AH HW_INT 0299 029B 0290 0290 029F 02A 1 02A3 02A5 02A7 02A9 84 FF EB 2F "OV J"P AH,OFFH SHORT SET_INTR_FLAG 80 E6 EB E4 8A OA 74 08 AO 00 AO F8 FF 10 "OV OUT J"P IN "OV OR JZ AL,OBH INT800,AL E4 OA E8 E6 80 E8 E6 E8 AI C7 00 AI 20 00 AD 00 IN OR J"P OUT "OV J"P OU1 J"P E4 E8 80 OA E6 EB 21 00 E4 FB C4 21 00 08 20 00 20 EO C4 04 NEAR AX SAVE REGI STER AX CONTENTS ex AL, aBH INTAOO,AL '.2 '.2 AL,INTBOO 8H,AL BH,BH NOT_SEC READ IN-SERVICE REGISTER (FIND OUT WHAT LEVEL BEING SERVICED} GET LEVEL SAVE IT DO? INO HARDWARE ISR ACTIVE) SET FLAG TO "FF" IF NON-HARDWARE READ IN-SERVICE REGISTER FROM INTERRUPT CHIP #2 110 DELAY CHECK THE SECOND INTERRUPT CH I P SAVE IT CONT I NUE I F NOT b10 671 672 673 614 675 676 671 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 691 b98 699 02AB 02AO 02AF 0281 0283 0285 0287 0289 0288 0286 02BO 028F 02C2 02C4 02C6 02C8 02Ce 02CA 02CC 02CC 02CO 02CE 0201 0205 0206 0201 0207 BO 20 E6 20 NOT SEC: IN J"P AND OR OUT J"P "OV OUT I NTR FLAQ: POP PUSH CALL "OV POP POP DUMMY RETURN I: IRETSET 58 IE E8 0034 R 88 26 0068 R 1F 58 CF 0208 - Oil 700 701 ,'2 GET SECOND 1NTERRUPT MASK MASK OFF LEVEL BE I NG SERV I CEO I/O DELAY ,'2 SEND EO I TO SECOND CH I P 110 DELAY INTBOI tAL AL,EOI INT800,AL SHORT IS_SEC AL,INTAOI "2 AH,OFBH AL,AH INTAOI,AL ,.2 GET CURRENT MASK VALUE 1/0 DELAY 00 NOT I SABLE SECOND CONTROLLER MASK OFF LEVEL 8E I NG SERV I CEO SET NEW I NTERRUPT MASK 110 DELAY a AL,EOI INTAOO,AL ex 05 ODS IPINTR FLAG,AH OS AX RESTORE I BX) FROM STACK SAVE ACTIVE (OS) SET DATA SEQMENT SET FLAG RESTORE REGI STER AX CONTENTS NEED I RET FOR VECTOR T A8LE ENDP ;--- HARDWARE INT 71 H -- ( IRQ LEVEL 9 I -- TO INT ; REDIRECT SLAVE INTERRUPT 9 TO INTERRUPT LEVEL 2 TH I S ROUT I NE FIELDS LEVEL 9 I NTERRUPTS AND CONTROL IS PASSED TO MASTER INTERRUPT LEVEL 2 102 103 104 ; 705 10b 107 708 109 110 11! 712 713 714 715 716 AL,INTBOI AL,BH 0208 0208 0209 0208 0200 020E 50 BO 20 E6 AO 58 CD OA --- -- - - - - - -- - - -- - - - - - - - - - - - -- - - - - -- -- - - - - - - -- -- - - - - - - - - - - -- - - - - -- - -- - - - -- -- --- RE 0 I RECT PROC PUSH "OV OUT POP INT 02EO CF NEAR AX AL,EOI [NTBOO,AL AX OAH IRET 02El OA H ------------------- SAVE (AX) EOI TO SLAVE INTERRUPT CONTROLLER RESTORE I AX I GIVE CONTROL TO HARDWARE LEVEL 2 RETURN RE_DIRECT ENDP 117 718 ;--- HARDWARE INT 75 H -- ( IRQ LEVEL 13 ) -.---------------------------------; SERVICE X281 INTERRUPTS ; TH 1 S ROUT I NE FIELDS X281 I NTERRUPTS AND CONTROL ; I S PASSED TO THE NM I I NTERRUPT HANDLER FOR ; COMPATIBILITY. 119 120 721 122 123 124 725 726 727 128 129 130 131 732 133 734 735 136 131 738 739 740 741 742 743 744 745 746 747 748 749 750 ; 02E 1 02El 50 02E2 32 CO 02E4 E6 FO 02E6 02E8 02EA 02EC 02ED BO E6 E6 58 CD --- -- - - - - -- - - - - - - - - - - -- - - - - - -- -- - - - - - - - -- -- - - - - -- -- - - - - - -- -- - - -- - - - -- - -- - - - --- INT 287 PROC PUSH XOR OUT 20 AO 20 "OV OUT OUT POP INT 02 02EF CF 02FO 02F1 02F1 REMOVE THE AL,EDI INTBOO,AL INTAQO,AL AX 02H ENABLE THE INTERRUPT THE SLAVE THE MASTER RESTORE (AX) GIVE CONTROL TO NMI IRET SAVE (AX) I NTERRUPT REQUEST RETURN INT 281 ENDP - 02FO 02FO 02F2 02F4 02F4 02F5 NEAR AX AL,AL X281,AL PROC SHUTDOWN - BO FE E6 64 "OV OUT - PROC AL, SHUT _ CMD STATUS _PORT ,AL COMMON 80286 SHUTDOWN WA I T SHUTDOWN COMMAND SEND TO KEY80ARD CONTROL PORT PROC 51 F4 EB FD HLT J"P PROC SHUTDOWN CODE ENDS END PRDC 5 - WA I T FOR 80286 RESET INSURE HALT ENDP TEST4 5-87 IBM Personal Computer MACRO Assembler Version 2.00 TEST5 ---- 06/10/65 EXCEPTION INTERRUPT TEST HANDLERS PAGE 118,121 TITLE TEST5 ---- 06/10/85 EXCEPTION INTERRUPT TEST HANDLERS .286C .LIST CODE SEGMENT BYTE PUBl I C 0000 PUBl I C PUBLIC 8 9 " 12 13 3. 0000 0000 000080 0002 E9 0005 0005 80 0007 E9 00010. 00010. 80 OOOC E9 OOOF OOOF 80 0011 E9 0014 001480 0016 E9 0019 0019 OE> 00110. 6A ODIC 07 ASSUME CS:CODE,DS:ABSO 90 0082 R MOV JMP Al,90H TEST_EXC GO TEST 91 0082 R MOV JMP Al.9IH TEST_EXC GO TEST 92 0092 R MOV JMP AL,92H TEST _EXC GO TEST 93 0082 R MOV JMP AL,93H TEST_EXC GO TEST 94 00B2 R MOV JMP AL .94H TEST_EXC GO TEST 48 PUSH PUSH ES BYTE PTR ES TEMP ES - POP 36 <><> SET CHECKPOINT <><> IF EXCEPTION WAS EXPECTED <><> SET CHECKPOINT <><> I F EXCEPT I ON WAS EXPECTED <><> SET CHECKPOINT <><> I F EXCEPT I ON WAS EXPECTED <><> SET CHECKPOINT <><> IF EXCEPTION WAS EXPECTED <><> SET CHECKPOINT <><> IF EXCEPTION WAS EXPECTED LOAD ES REG I STER WITH SELECTOR F I X 80UND PARAMETERS 37 38 39 40 41 42 43 OOID 001F 0024 00210. 0028 0020 45 46 47 48 49 50 51 52 53 54 55 5E> 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 I 10 III 112 I 13 '14 0030 0030 0032 0034 0034 003E> 0038 0038 00310. 003C 003C 003E 0040 0040 0042 0044 0044 0046 0048 0048 004A 004C 004C 004E 0050 0050 0052 0054 0054 0056 0058 0056 00510. 005C 005C 005E 0060 0060 0062 0064 0064 0066 0068 0068 OO&A 006C 006C 006E 0070 0070 0072 0074 0074 0076 0078 0078 00710. 007C 007e 007E 0080 0080 0082 0084 0084 0086 0088 0088 00810. 008e 4. POST5 SYSINITI --- --- --- - - -- -- - - -- - - -- ---- - -- - ----- ---EXCEPTION INTERRUPT ROUTINE : ; --- ---- -- -- -- -------- ------- -- - - ---- ---; ; 10 I. 15 16 17 18 19 20 21 22 23 2-4 25 26 27 26 29 30 31 32 33 34 I-I 06-10-85 5-88 28 FF 2E>: C7 05 0000 26: C7 45 02 7FFF 07 80 95 E9 0092 R SUB MOV MOV POP MOV JMP 01,01 ; WORD PTR ES: [DI ] ,0 ; WORD PTR ES:[DI+2j,07FFFH ES AL,95H TEST_EXC POINT BEGINNING OF THE BLOCK SET FIRST WORD TO ZERO ; SET SECOND TO 07FFFH BO 96 EB 7E MOV JMP AL,96H SHORT TEST_EXC <><> SET CHECKPOINT <><> GO TEST IF EXCEPTION WAS EXPECTED BO 97 EB 7A MOV JMP AL.97H SHORT TEST_EXC GO TEST BO 98 EB 7E> MOV JMP AL,98H SHORT TEST_EXC GO TEST BO 99 E8 72 MOV JMP AL.99H SHORT TEST_EXC GO TEST IF EXCEPTION WAS EXPECTED BO 9A EB 6E MOV JMP AL,9AH SHORT TEST _EXC <><> SET CHECKPOINT <><> GO TEST IF EXCEPTION WAS EXPECTED BO 9B EB 6A MOV JMP AL,96H SHORT TEST_EXC <><> SET CHECKPOINT <><> GO TEST IF EXCEPTION WAS EXPECTED BO 9C EB 66 MOV JMP AL ,9CH SHORT TEST_EXC GO TEST BO 9D E8 62 MOV JMP AL,9DH SHORT TEST_EXC GO TEST BO 9E EB 5£ MOV JMP AL,9EH SHORT TEST _EXC <><> SET CHECKPOINT <><> GO TEST IF EXCEPTION WAS EXPECTED BO 9F EB 5A MOV JMe AL,9FH SHORT TEST_EXC <><> SET CHECKPOINT <><> GO TEST IF EXCEPTION WAS EXPECTED BO AO EB 56 MOV JMP AL,OAOH SHORT TEST_EXC GO TEST BO AI EB 52 MOV AL,OAIH SHORT TEST _EXC GO TEST 80 A2 E8 4E MOV AL,OA2H SHORT TEST_EXC GO TEST BO 10.3 EB 410. AL,OA3H SHORT TEST_EXC GO TEST BO A4 EB 46 AL,OA4H SHORT TEST_EXC GO TEST JMe JMe <><> SET CHECKPOINT <><> GO TEST IF EXCEPTION WAS EXPECTED <><> SET CHECKPOINT <><> IF EXCEPTION WAS EXPECTED <><> SET CHECKPOINT <><> IF EXCEPTION WAS EXPECTED • <><> SET CHECKPO I NT <><> <><> SET CHECKPO I NT <><> IF EXCEPTION WAS EXPECTED <><> SET CHECKPOINT <><> IF EXCEPTION WAS EXPECTED <><> SET CHECKPOINT <><> IF EXCEPTION WAS EXPECTED <><> SET CHECKPOINT <><> IF EXCEPTION WAS EXPECTED <><> SET CHECKPOINT <><> I F EXCEPT I ON WAS EXPECTEO <><> SET CHECKPOINT <><> I F EXCEPT I ON WAS EXPECTED <><> SET CHECKPOINT <><> 1F EXCEPT I ON WAS EXPECTED BO A5 EB 42 MOV JMe AL,OA5H SHORT TEST _EXC <><> SET CHECKPOINT <><> GO TEST IF EXCEPTION WAS EXPECTED BO A6 E8 3E MOV JMP AL,OA6H SHORT TEST_EXC GO TEST BO A7 E8 3A MOV JMP AL, 010. 7H SHORT TEST_EXC GO TEST 80 10.8 EB 36- MOV JMP AL,OA8H SHORT TEST_EXC GO TEST BO A9 EB 32 MOY JMP AL,OA9H SHORT TEST_EXC GO TEST BO AA E8 2E MOV JMP AL,OAAH SHORT TEST_EXC GO TEST BO 10.8 E8 210. MOV JMP AL,OABH SHORT TEST_EXC GO TEST IF EXCEPTION WAS EXPECTED AL,OACH SHORT TEST _Exe <><> SET CHECKPOINT <><> GO TEST IF EXCEPTION WAS EXPECTED BO AC E8 26 TESTS <><> SET CHECKPOINT <><> IF EXCEPTION WAS EXPECTED <><> SET CHECKPOINT ..;><> IF EXCEPTION WAS EXPECTED <><> SET CHECKPOINT <><> I F EXCEPT I ON WAS EXPECTED <><> SET CHECKPOINT <><> I F EXCEPT I ON WAS EXPECTED <><> SET CHECKPOINT <><> I F EXCEPT I ON WAS EXPECTED <><> SET CHECKPOINT <><> 1-2 06-10-85 I BM Persona I Computer MACRO Assemb I er Vers; on 2.00 TESTS ---- 06/10/85 EXCEPTION INTERRUPT TEST HANDLERS 115 I 16 I 17 118 1 19 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 008C 008E 0090 0090 0092 0094 0094 0096 0098 0098 009A 009C 009C 009E OOAO OOAO 00A2 00A4 00A4 00A6 00A8 00A8 OOAA OOAC OOAC OOAE OOBO 0080 BO AD EB 22 - MOV JMP AL,OADH SHORT TEST _EXC <><> SET CHECKPO 1NT <><> GO TEST IF EXCEPTION WAS EXPECTED MOV JMP AL,OAEH SHORT TEST_EXC <><> SET CHECKPO I NT <><> GO TEST IF EXCEPTION WAS EXPECTED MOV JMP AL,OAFH SHORT TEST_EXC <><> SET CHECKPOINT <><> GO TEST IF EXCEPTION WAS EXPECTED MOV JMP AL,080H SHORT TEST_EXC GO TEST MOV JMP AL,OBIH SHORT TEST_EXC GO TEST MOV JMP AL,OB2H SHORT TEST _EXC GO TEST MOV JMP AL,OB3H SHORT TEST _EXC GO TEST MOV JMP AL,OB4H SHORT TEST_EXC GO TEST MOV JMP AL,OB5H SHORT TEST _EXC GO TEST IF MOV AL , OB6H EXC 30: BO AE EB IE EXC 31: - BO AF EB 1 A 5Y5 32: - BO BO EB 16 - IF I NTERRUPT WAS EXPECTED <><> SET CHECKPOINT <><> IF INTERRUPT WAS EXPECTED 5Y5 34: - BO 82 E8 DE - <><> SET CHECKPOINT <><> IF INTERRUPT WAS EXPECTED 5Y5 35: BO B3 EB OA <><> SET CHECKPOINT <><> IF INTERRUPT WAS EXPECTED 5Y5 36: - BO 84 E8 06 - <><> SET CHECKPOINT <><> IF INTERRUPT WAS EXPECTED 5Y5 37 : BO B5 EB 02 80 86 5Y5 - 38: <><> SET CHECKPOINT <><> GO TEST 00B2 00B2 E6 80 00B4 3C AF 00B6 77 I C TEST EXC: OUT INTERRUPT WAS EXPECTED <><> SET CHECKPO I NT <><> 143 144 145 146 147 148 <><> SET CHECKPOINT <><> 5Y5 33: BO 81 EB 12 IF INTERRUPT WAS EXPECTED JA MFG PORT ,AL AL IOAFH TEST_EXCO PUSH PUSH POP MOV MOV PUSH POP POP POP POP PUSH CMP JNZ OS SAVE THE CURRENT DATA SEGMENT BYTE PTR GOT PTR OS OS: ES TEMP. SEG LI MIT, MAX SEG LEN BYTE PTR OS: (E'S TEMP.DATA Ace RIGHTS) ,CPLO DATA ACCESS BYTE PTR ES TEMP -ES OS RESTORE REG I STERS OX CHECK I F CODE SEGMENT SECOND ON STACK CX CX CX,SYS ROM CS TEST _EXCO CONTI NUE I F ERROR CODE eMP OUTPUT THE CHECK PO I NT CHECK FOR EXCEPT I ON GO IF A SYSTEM INTERRUPT 149 150 151 152 153 154 155 156 157 158 159 160 161 162 00B8 00B9 OOBB 008C 00C2 00C7 00C9 OOCA OOCB OOCC 1E 6A 08 IF C7 06 0048 FFFF C6 06 0040 93 6A 48 07 IF SA 59 ODeD 51 OOCE 83 F9 40 0001 7501 163 164 165 166 167 168 169 110 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 0003 0004 0004 0006 0008 OODA OODC OODC OODE OOEO 00E2 52 86 E4 3A 74 EO 8B C4 OE IN eMP JZ TEST EXC I: - E4 80 3C 38 72 01 CF 00E3 00E3 ODES 00E7 00E8 86 EO E6 80 F4 EB F9 OOEA OOEA OOEC OOEE OOFI 2A CO E6 88 B8 0 roo CF 167 IN CMP JB TEST EXC2: XCHG OUT HL T JMP TEST EXC3: SUB OUT MOV OOFD 0100 0101 0104 0 I 05 0108 B8 0800 AB B8DOAO AB B8 0000 AB WAS THE EXCEPTiON EXPECTED7 GO IF YES CHECK THE CURRENT CHECKPD I NT HALT IF CHECKPO I NT BELOW 3SH AH,AL MFG_PORT, AL OUTPUT THE CURRENT CHECK PO I NT <><> CHECKPOINT 90 THRU B5 <><> TEST_EXC2 INSURE SYSTEM HALT AL,AL OMA PAGE+OAH,AL AX,0100H CLEAR DMA PAGE SYSINITI 81 80 0149 R EF NEAR NO I NTERRUPTS ALLOWED SAVE BP PUSH BP MOV OUT CALL MOV AL,81H MFG PORT ,AL SlOT BLD BP,OI MOV AX,SYS_IDT_LEN <><> <> <> <> <> <> <> <><><><> <><> CHECKPO I NT 8\ <><> STOSW MOV MOV AX,O STOSW SEGOV ES OB aiDA OIOB 010B OIOE OIOB OIOB 010E 0 I DE OB nOOOI LABEL MOV nOOO2 LA8t::L BYTE ORG OB ORG MOV OFFSET CS:??OOOI OOIH OFFSET CS: n0002 DI,BP 8B 5E 00 SAVE THE POINTER TO JUST PAST THE [OT AS WE HAVE NO SDA, USE THE SIX BYTES HERE TO LOAD THE IDTR. WE W]LL SlOT WHEN WE GET TO SOA INITIALlZAT[ON. SEGMENT LIMIT = LENGTH OF lOT STORE TI-IAT AS ]OT LIMIT lOT ADDRESS AND ACCESS RIGHTS BYTE (UNOEF I NED) LOAD THE 026H [BP] OOFH BYTE BX,WORD PTR LlDT OF 8B FD AX , SYS_IDT_LOC STOSW 010926 01 (INT 5) CS: CODE ,OS: NOTH I NG ,ES: NOTH I NG, SS: NOTH I NG PROC CLI 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 FOR BOUND INSTRUCTION EXPECTED RETURN THIS BUILDS THE DESCRIPTOR TABLES REQUIRED FOR PROTECTED MODE PROCESSOR MUST BE IN REAL MODE 202 203 204 205 206 207 208 209 210 211 SAVE THE CHECKPOINT AL,MFG PORT AL, 03sR TEST_EXC2 IRET ASSUME FA 55 BO E6 E8 8B PUT SEGMENT BACK ON STACK AH,AL AL,DMA PAGE+OAH AL,AH TEST_EXC3 --- , 00F2 00F2 OOF3 00F4 00F6 OOF8 OOFB OX IRET ; 186 169 190 191 192 193 194 195 196 197 198 199 200 201 PUSH TEST EXCO: XCHG - lOT REG I STER FROM TH] S AREA [BP] ES:O] NOW --> END OF [DT AGAIN BUILD THE GOT. 0110 8F 01 13 E8 01 16 88 011888 011B AB 08AO 0140 R EF 0088 MOV CALL MOV MOV STOSW 01 ,GOT LOC GOT BLO BP,OI AX,GDT_LEN SAVE THE ES:DI POINTER AX = LENGTH OF THE GOT PUT THAT IN THE LIMIT FIELD TESTS 5-89 1-3 [BM Personal Computer MACRO Asselllbler Version 2.00 TEST5 ---- 06/10/55 EXCEPTION INTERRUPT TEST HANDLERS 229 230 231 232 233 23. 235 236 231 236 239 2.0 2., 2.2 2.3 2" 2., 2.5 2.6 2'6 2'9 250 251 252 253 25. 255 256 251 256 259 260 261 2.2 263 26. 2.5 266 261 266 269 210 211 212 273 274 275 216 211 216 219 260 261 262 283 26. 265 266 267 266 269 290 291 292 293 29. 295 296 291 296 299 300 301 302 303 30. 305 306 301 306 309 310 311 312 313 31. 315 316 311 316 319 320 321 322 323 OIICB505AO OIIF AB 0120 B5 0000 0123 AB 0124 26 0125 0126 0126 0129 0126 0126 0129 0129 012B 012C 0120 OF 110004 5B 56 00 170005 aI 5B FO AB A8 58 Fo "OV STOSW "OV STOSW SEGOV OB LGDT OB LABEL "OV LA8EL ORG OB ORG "OV STOSW STOSW "OV 06-10-85 AX,GOT_LOC AX,O E5 026H [BP] OOFH BYTE OX, WORD PTR [BP] BYTE OFFSET CS:?10004 00 I H OFFSET CS I 110005 ol,BP AX '" LOW WORD OF GOT ADDRESS PUT THAT IN BASE FIELD - LOW AX '" HIGH BYTE OF ADDRESS, AND ACCESS RIGHTS BYTE IS UNDEFINED LOAD THE GDTR FROM THI S AREA RESTORE THE ES: D I PO INTER DI,BP SW I TCH TO V I RTUAL MODE o 12F 50 0130 B5 0001 0133 OF 01 0136 0137 0139 013B 013B 0130 o 13F POP MOV LMSW OB FO EA 013B R 0040 - RESTORE SP MACH I NE STATUS WORD NEEDED TO SW I TCH TO V I RTUAL MODE OOFH,OOIH,OFOH OEAH OFFSET DONE SYS_ROM_CS OB Ow JUMP FAR TO PURGE PRE-FETCH QUEUE TO OFFSET I N SEGMENT DONE: BO 55 E6 50 C3 "OV OUT RET BE OlAF R 89 0044 F31 A5 C3 0149 0149 014C 014E 0150 0153 0155 0157 015A 015C 015E 0161 BE BC 5E BF 2B 8E BB B6 82 B9 0161 A5 0162 0164 0165 0167 0168 016B 016C 016E 0171 8B AB 8B AB B8 AB E2 89 Bo NEAR SI,OFFSET GOT DATA START ; DS:SI --> GOT CX, (OFFSET GOT DATA END-OFFSET GOT DATA START) /2 ; WORD COUNT MOVSW -; COpy GOT I NTO MEMORY SloT_BLD PROC "OV "OV SUB "OV "OV "OV "OV "OV lOT: MOVSW "OV STOSW MOV STOSW "OV STOSW LOOP "OV "OV CZ 0000 F3 ODED 0277 R onc 26 26 26 26 26 26 26 C3 C7 C1 C7 C7 C7 C7 C7 lOT. NEAR THE lOT WILL CONTAIN VECTORS FOR EXCEPTION HANDLERS SI,OFFSET SYS lOT OFFSETS ; MAKE OS:SI POINT TO AX,CS ; INTERRUPT ENTRY POINTS DS,AX 01, SYS lOT LOC AX,AX ES,AX WHERE THE lOT WILL BE. BX,SYS ROM CS CS I S THE SAME FOR ALL INTERRUPTS OH, TRAP GATE ACCESS RIGHTS BYTE FOR THE GATE CL,O THE WORD COUNT FIELD I S UNUSED THERE ARE 32 RESERVED [NTERRUPTS CX,32 TH [S LOOP BU I LOS 32 DESCR I PTQRS I N THE lOT FOR THE RESERVED INTERRUPTS GET A ROUT I NE ENTR Y PO I NT AND PUT IT IN THE OFFSET FIELD AX,BX GET THE SYSTEM CODE SEGMENT SELECTOR AND PUT I TIN THE SELECTOR F [ELO AX,DX GET THE INTERRUPT GATE BYTE AND PUT IN THE ACCESS RIGHTS FIELD AX,O ZERO OUT THE RESERVED POS [T I DNS AND REPEAT AS DIRECTED LOW lOT CX,256-32 256 TOTAL - 32 DONE = WHATEVER [S LEFT BP, OFFSET FREE_ [NTS THERE IS A COPY OF AN UN-INITIALIZED [NTERRUPT OEseR I PTOR AT FREE _, NTS HIGH_lOT: "OV OS:SI --> FREE DESCRIPTOR (ES:OI LEFT OFF AT INT 321 MOVE OFFSET OF THE I RET I NSTRUCT I ON MOVE THE CS SELECTOR MOVE THE ACCESS RIGHTS BYTE ZERO OUT THE RESERVED WORD FILL THE REMAINDER OF THE TABLE SI,BP MOVSW MOVSW MOVSW STOSW LOOP 06 06 06 06 06 06 06 olAO DIA8 0180 0188 olCO DIC8 DIDO 0098 009C OOAO 00A4 OOA8 OOAC OOBO ;----- INITIALIZE THE ENTRY POINTS FOR POST TEST R R R R R R R "OV "OV "OV "OV "OV "OV MOV ES: ES: ES: ES: (SYS lOT LDC+(032-DESC LEN) (SYS- I OT-LOC+ (033-0ESC-LEN) (SYS-IDT-LOC+ I 034·DESC-LEN) (SYS-IOT-LOC+(035-0ESC-LENI .ENTRY POINT) • ENTRY-PO I NT) .ENTRY-PO I NT) .ENTRY-POINT) ,OFFSET ,OFFSET ,OFFSET ,OFFSET SYS 32 SYS-33 SYS-34 SYS-35 ~~; i~~~::gi=~gg::g;~:g~~g=~~~: :~~i=~:~g:~i: :g~~~~i ~~~:;~ ESI (SYS::::IDT::::LDC+(038-DESC::::LENI .ENTRY:POINTI ,OFFSET SYS:38 RET OIAE OIAE CF S-90 BUILD THE MOV "OV C3 A5 A5 A5 AS E2 F8 INITIALIZATION GOT BLD PROC MOV "OV REP RET GOT _BLD ENoP LOW 0176 0177 0178 0179 017A SYSTEM ENDP 0237 R C5 05 oOAO CO CO 0040 87 00 0020 0114 0174 8B F5 <><><><><><> <><><> <> <> <> <><> CHECKPOINT 82 <><> AL,55H MFG_PORT ,AL SYSINITI ;----- 0183 018A 0191 0198 019F 0lA6 o I AD AX OW 0140 0140 0140 0143 0[46 0145 0149 BP AX, V I RTUAL ENABLE IRET ADDR IRET - TESTS LABEL WORD ; FOR UN- I NIT I AL I ZED ; NULL RETURN INTERRUPTS [BM Personal Computer TESTS ---- 06/10/85 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 MACRO Assembler EXCEPTION VersIon 1-4 2.00 06-10-85 INTERRUPT TEST HANDLERS PAGE THE FOLLOWING DATA DEFINES THE PRE-INITIALIZED GOT FOR POST TESTS. THESE MUST BE INITIALIZED IN THE ORDER IN WHICH THEY APPEAR IN THE GDT_DEF STRUCTURE DEFINITION AS IT IS IN "SYSDATA.INC". ~ OlAF GDT_DATA_START EQU (UNUSED_ENTRY) FIRST ENTRY UNUSABLE OlAF D1BI 0183 0184 0185 SEGMENT LIMIT SEGMENT BASE ADDRESS - LOW WORD SEGMENT BASE ADDRESS - HIGH BYTE ACCESS RIGHTS BYTE RESERVED - MUST BE ZERO DW DW 0000 0000 00 00 0000 DB DB DW THE GOT ITSELF 0181 0088 0189 D8AD DW DW GOT LEN GDT-LOC 00 DIBC 93 01BD 0000 DB DB CPLO DATA ACCESS 0188 DW o THE SYSTEM OIBF 0800 DIGI DOAD o IC3 00 Q1C4 93 DIGS 0000 [DT DESCRIPTOR DW DW D8 SYS lOT LEN SYS-IDT-LOC DB CPLO DATA ACCESS DW SEGMENT LIMIT SEGMENT BASE ADDRESS - LOW WORD SEGMENT BASE ADDRESS - HIGH BYTE ACCESS RIGHTS BYTE RESERVED - MUST BE ZERO o - o o ISYS_IDT_PTR) SEGMENT LIMIT , SEGMENT BASE ADDRESS - LOW WORD ; SEGMENT BASE ADDRESS - HIGH BYTE I ACCESS RIGHTS BYTE ; RESERVED - MUST BE ZERO - - - THE SYSTEM DATA AREA DESCRIPTOR o IC7 0300 OlG9 0400 ICB 00 a I CC 93 DW DW D8 D8 DW o OIGD 0000 SDA LEN SDA-LOC - IRSOA_PTR) SEGMENT LIMIT SEGMENT BASE ADDRESS - LOW WORD SEGMENT BASE ADDRESS - HIGH BYTE ACCESS RIGHTS BYTE RESERVED - MUST BE ZERO o CPLO OAT A ACCESS o - COMPATIBLE MONOCHROME DISPLAY REGEN BUFFER o ICF 1000 0101 0000 0103 OB 0104 93 0105 0000 DW DW D8 D8 DW MCRT SIZE MCRT@ LO MCRT <> <> <><><><><><><><><> , <><> CHECKPOINT 32 <><> ; RESTORE AX (SET AX TO ZERO) ; EXIT IF PARITY ERROR 64K ADDRESS TEST AND FILL WITH ZERO OEC AX SUB MOV SUB STOSW INC REP 01,01 CX,8X CX,2 DEC AX STOSW SUB MOV SUB LOOSW XOR JNZ WRITE FIRST AND LAST LOCATION=FFFF POINT TO START OF 8LOCK GET THE BLOCK COUNT 00 ALL LOCATIONS BUT LAST WRITE FIRST LOCATION AS FFFFH WR I TE ZERO WRITE [T LAST WORD 1S FFFF AX STOSW S I, S I POINT TO START OF BLOCK GET THE 8LOCK COUNT CX,BX CX,2 GET THE DATA CHECK CORRECT EXIT IF NOT AX ,OFFFFH CI3 CI2A: AD OB EI 75 AD 35 75 LOOSW OR LOOPZ JNZ LOOSW XOR JNZ CO F8 A2 FFFF 9C ; ----- OOEC OOEE OOEF 00F2 ; ; ; CHECKPOINT 32 FOR ADDRESS LINE 0->15 FAILURE MOV ;----- AL,PORT 8 AL,AH AL,OMA PAGE+6 AH,AL - 2B FF A8 8F FFFE AB AX ,OFFFFH CI3 CLEAR WORD 0 AND FFFE SUB STOSW MOV STOSW ; ----- GET NEXT DATA ANY 81T ON ? CONTINUE TI LL LAST WORD GO I F NOT CORRECT GET LAST WORD S/8 FFFF EXIT IF NOT AX,AX C!2A CI3 CLEAR FIRST WORD 01,01 0 I ,OFFFEH CHECK FOR ; CLEAR TOP WORD I/O OR 8ASE MEMORY 221 222 223 224 225 226 227 228 00F3 00F5 OOFl 00F9 00F8 OOFE 0100 5-94 E4 86 E4 22 B8 EB 61 C4 81 EO 0000 88 IN XCHG IN ANO MOV JMP STGTST_CNT TEST6 AL,PORT 8 AL,AH AL ,OMA PAGE+6 AH,AL AX,O CI3 ENOF CHECK FOR I/O - PARITY CHECK SAVE ERROR CHECK FOR R/W OR I/O ERROR SET AX EQUAL ZERO ERROR EX I T IF ZF NOT SET 1-3 IBM Per50nal Computer MACRO A55embler Ver5,on 2.00 TEST6 ---- 06/10/85 POST TESTS AND SYSTEM BOOT STRAP 229 230 231 232 233 234 235 236 237 236 239 240 241 242 243 244 245 246 247 246 249 250 251 252 253 254 255 256 257 256 259 260 261 262 263 264 265 266 267 266 269 270 271 272 273 274 275 276 277 276 279 260 261 262 263 264 265 266 267 266 269 290 291 292 293 294 295 296 297 296 299 300 301 302 303 304 305 306 307 306 309 310 311 312 313 314 315 316 317 316 319 320 PAGE ;- -;~ ~ ~~ - ~~~~~~ ~ - ~~~ - ~;;~~ - ~~~ ~~;~ - ;~~ - ~;~ - ~~~~~ ~~~ - ~;~~; ~ - -- - - - - - - - - --- -- ~~~ 0100 0100 a 1a 1 0102 0103 a I 06 0108 0109 010A Dl0C 011181 FA C8DO 01151COO 0111 E8 0000 E aliA BE 0000 E 0110 E8 0000 E 0120 0120 58 012! 01 0122 5A 0123 C3 0124 0124 BA 0 I 02 0121 E8 0000 E OIZA EB F4 o 12C - ~~; - 52 06 50 B8 ---- R 8E CO 58 50 8C DA 26: 88360015 R - ;;;; - - - - ~~~; - - - - - - --- -- - -- -- - - - - -- - - -- ---- - - - -- --- - ------- - - - - ---- PUSH PUSH PUSH MOV MOV POP PUSH MOV MOV OX ES AX AX,DATA ES,AX AX AX DX,DS ES: IIIMFG_ERR _FLAG, DH C"P DX,OC8DOH ROM ERR BEEP PRT-SEGS I ,OFFSET F3A E_MSG JL CALL "OV CALL ROM ERR END: -POP POP POP SAVE POINTER SET ES TO DATA SEGMENT RESTORE AX GET ADDRESS POINTER <> <> <> <> <> <> <> <> <> <> <> <><><> <><> CHECKPOINTS CO->F4 <><> OJ SPLAY CARD IN ERROR? GIVE OISPLAY CARD FAIL BEEP PRINT SEGMENT IN ERROR D I SPLA Y ERROR MESSAGE AX ES OX RET ROM ERR BEEP: -MOV CALL ; BEEP I LONG, 2 SHORT DX,DI02H ERR SEEP SHORT ROM_ERR_END J"P ROM_ERR ENDP ; - - - - - - - - - - - -- -- - - - - - - - - - - - - - - - - - - -- - - -- - - - -- -- - ---; TH IS SUBROUTI NE SENDS AN OUTPUT COMMAND TO THE KEYBOARD ANO RECE I VES THE KEYBOARD RESPONSE. ENTRY REQU I REMENTS: AL COMMAND/DATA TO BE SENT EXIT PARAMETERS: ZERO FLAG = I IF ACK RECE J VED FROM THE KEY BOARD AL = RESPONSE - - ---- --- ------ = ~~ ~ ~ ~ ~ ~~; o 12C ;- - - - - o 12C 86 EO 012E 2B C9 0130 0130 E4 64 0132 A8 02 0134 EO FA 0136 E3 34 0138 86 EO AL,STATUS PORT ~~ i +~66pBOF _FULL JCXZ SHORT XMIT EXIT AH,AL - CHECK I NPUT SUFFER FULL RESTORE COMMAND 1 SSUE THE COMMAND SEND THE COMMAND SET LOOP COUNT OUT SUB ;- - - - 64 EO 01 02 60 C4 02 Fl 10 SAVE COMMAND SET LOOP TIME-OUT AH,AL CX,CX TEST LOOPNZ XCHG ;----- E4 8A A8 14 E4 F6 EO 15 I NPUT BUFFER FULL IN E6 60 013C 2B C9 013E 0140 0142 0144 0146 0148 014B 0140 - ;;;; -- ~~~; - - - ----- - -- ------ - - - ---- -- - - - -- -- - --- - - - --- -- - --- CHECK XCHG SUB XMITLOOP: o 13A CHECK OUTPUT SUFFER FULL XMIT_I: IN "OV TEST JZ IN XMIT_2: TEST LOOPNZ JNZ AL,STATUS PORT AH,AL - SAVE STATUS CHECK IF B042 HAS DATA GO IF NOT FLUSH DATA CHECK COMMAND ACCEPTED ~~ i ~U~_BUF JULL AL,PORT A AH, I NPT-SUF FULL XMIT I SHORT XMIT_EXIT NO FLUSH OR COMMAND NOT ACCEPTED CHECK OUTPUT BUFFER FULL 014F 0151 0153 0155 0151 0159 015B 0150 015F 0161 S3 2B E4 A8 EI 15 FE 15 FE EB 06 C9 64 01 FA 08 CB F4 C3 09 "OV XMIT_3: SUB IN TEST LOOPZ JNZ DEC JNZ INC J"e SET COUNT SET LOOP COUNT BL,6 cX,ex AL,STATUS PORT AL, OUT SUF FULL XMIT 3XMIT-4 BL SHORT XMJT 3 BL SHORT XMIT_EXIT CHECK I F HAS OATA WAIT TILL DONE DECREMENT OUTER LOOP TRY AGAIN SET ERROR FLAG 8042 STUCK BUSY GET THE DATA 0163 2B C9 XMiT_ 4: SUB CX,CX 0lb5 0161 0169 016C 16C 0160 XMIT_5: LOOP XMJT 5 AL,PORT A CX,OIH - a E2 FE E4 60 83 E9 01 C3 IN SUB XMIT EXIT: RET XMIT_B042 ENDP ALLOW T I ME FOR POSS IBLE ERROR -> SYSTEM UNIT OR KEYBOARD SET ex OTHER THAN ZERO ;--- BOOT_STRAP -- INT 19 H -------------------------BOOT STRAP LOADER TRACK 0, SECTOR I I S READ I NTO THE BOOT LOCATION (SEGMENT a OFFSET 1COO) AND CONTROL I S TRANSFERRED THERE. 321 322 323 324 325 326 327 326 329 330 331 332 333 334 335 336 337 336 339 340 341 342 06-10-85 I F THERE ; ; ---- [S A HARDWARE ERROR CONTROL [S TO THE ROM BAS I e ENTRY PO [NT -- - TRANSFERRED - - - - - - - -- - -- - - - ---- - - - - ------- - ----- - - - - --- - - -ASSUME CS:CODE.DS:ABSO,ES:ASSO OlbO 0160 B8 ---- R 0110 8E 08 0112 8E CO SOOT_STRAP _I "OV "OV "OV PROC AX,ABSO DS,AX ES,AX NEAR ; ESTABLISH ADDRESSING RESET THE 0 I SK PARAMETER TABLE VECTOR 0114 C1 06 0018 R 0000 E 017A 8C OE 001A R "OV "OV TEST6 5-95 1-4 06-10-85 IBM Personal Computer MACRO Assembler Version 2.00 TEST6 ---- 06t I 0/85 POST TESTS AND SYSTEM BOOT STRAP 343 344 345 346 347 34B 349 350 351 352 353 354 355 356 357 35B 359 360 361 362 363 364 365 366 367 36B 369 370 371 372 373 374 375 376 377 37B 379 380 381 382 383 384 385 3B6 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 CLEAR IIIBOOT_LOCN 017E 0180 0183 0186 33 CO B9 0100 BF 7COO R F31 AB 0188 0189 o 18C 0180 o 18F 0191 FB B9 000451 B4- 00 CD 13 72 OF 0193 0196 0198 o 19A 0190 01 AO 01 A2 a I A3 o lAS o IA8 01 AA 01 AC BB 2B 8E BB B9 CD 59 73 80 74 E2 EB XDR MDV MDV REP ;----- HI: 020 I 02 C2 7COO R 000 I 13 H2: 09 FC 80 22 EO 1E ;----- 01 AE 80 3E 7COO R 06 01 B3 72 71 H4: AX,AX CX,256 01 ,OFFSET IIIBOOT LOCN STOSW - CLEAR 256 WORDS ; LOAD SYSTEM FROM DISKETTE -- CX HAS RETRY COUNT ST1 MDV PUSH MDV 1NT JC CX,4 CX AH,O 13H H2 SET RETRY COUNT I PL SYSTEM RESET THE DISKETTE SYSTEM DISKETTE 10 IF ERROR-;- TRY AGA I N MDV SU8 MDV MDV MDV 1NT PDP JNC CMP JZ LOOP JMP AX,20lH DX,DX ES,DX 8X. OFFSET 'lISOOT LOCN CX, I 13H CX H4 AH,80H H5 HI SHORT H5 DRIVE 0, HEAD a SECTOR I, TRACK 0 DISKETTE 10 RECOVER RETRY COUNT CARRY FLAG SET 8Y UNSUCCESSFUL READ IF TIME OUT, NO RETRY TRY FIXED DISK DO I T FOR RETRY TIMES TRY FIXED DISK REAO I N THE SINGLE SECTOR TO THE BOOT LOCATION 800T RECORD READ SUCCESSFUL INSURE FIRST 8YTE OF LOADED 800T RECORD eMP J8 BYTE PTR (!0800T LOCN,06H HIO - IS VALID INOT ZERO) ; CHECK FOR FIRST INSTRUCTION INVALID ; IF 800T NOT VALID PRINT MESSAGE HALT INSURE DATA PATTERN FIRST 8 WORDS NOT ALL EQUAL 01 B5 BF 7COO R 0lB8 B9 0008 0lB8 AI TCOO R o 18E OICI o IC3 o IC5 83 3B EI 74 C7 02 05 F9 5F H4A: MDV MDV MDV 01 ,OFFSET 'lI800T LOCN CX,8 AX,WORD PTR @800T_LOCN CHECK OAT A PATTERN CHECK THE NEXT 8 WORDS ADD CMP LOOPZ JZ 01,2 AX, [01 H4A PO I NT TO NEXT LDCA T I ON CHECK DATA PATTERN FOR A FILL PATTERN 0lC7 EA 7COO ---- R 1 HIO SOOT NOT VAll 0 PR I NT MESSAGE HALT @800T_LOCN ATTEMPT BOOTSTRAP FROM FIXED DISK a I CC BO 44 OICE E6 80 H5: o I DO EB 0000 E 0103 F6 06 0088 R 01 ---- 0108 BB o lOB 8E 08 DIDO 74 3D R MDV OUT ASSUME CALL TEST ASSUME MDV MDV JZ AL,044H MFG PORT, AL DS:OATA DDS @LASTRATE,DUAL DS:ABSO AX,ABSO OS,AX H9 CHECK FOR FIXED DISK o IDF o lEI a IE4 01 E6 BO EB AB 75 DE 0000 E 08 34 a IE8 OlEA a IEC 2B CO 28 02 CD 13 OIEE B9 0003 OIFI a lFI 51 01 F2 BA 0080 01 F5 B8 020 I OlF8 2B 08 OIFA 8E C3 OIFC 88 7COO R 01 FF 89 000 I 0202 CD 13 0204 59 0205 72 08 0207 81 3E 7DFE R AAS5 0200 74 88 <><><><> <> <> <> <> <> <> <> <> <><> CHECKPO[NT 44 <><> FLOPPY/FIXEO DISK CARD INSTALLED ESTABL I SH ADDRESS I NG GO IF NOl INITIALIZATION ERROR MDV CALL TEST JNZ AL,CMOS DIAG CMOS READ AL,HF FAIL H9 - GET POST POWER ON STATUS (NMI ENABLED) FROM 0 I AGNOST I C STATUS BYTE DID WE HAVE A FIXED DISK FAILURE? GO IF YES SUB AX,AX DX,DX 13H CX,3 RESET D! SKETTE PUSH MOV MOV SUB MOV MOV MOV INT pap JC CMP JZ CX DX,0080H AX,020IH 8X,BX ES ,8X BX. OFFSET (!OBOOT LOCN CX, 1 - SAVE RETRY COUNT FIXED DISK ZERO READ IN A SINGLE SECTOR PUSH MDV ex SUB 1NT MDV RETRY COUNT H6: 13H TO THE BOOT LDCAT I ON SECTOR I, TRACK a FILE I/O CALL RECOVER RETRY COUNT CX H8 WORD PTR @800T LOCN+5100,OAA55H H4_A - ; TEST FOR GENERIC BOOT BLOCK 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 020F 0210 0213 0215 0217 0218 021A 51 8A 2B CD 59 72 E2 H8: 0080 CO SUB 13 1NT PDP Je 08 05 LOOP DX,0080H AX,AX 13H ex HIOA H6 UNABLE TO 021 C 80 45 021 E E6 80 0220 CD H9: 18 0222 E2 E8 0224 E8 F6 F[XED DISK ZERO RESET THE F I XED 0 I SK FILE 110 CALL RESTORE LOOP COUNT IF ERROR, TRY AGAIN DO [T FOR RETRY T[MES [PL FROM THE DISKETTE OR F I XED 0 I SK MDV OUT AL,045H MFG_PORT, AL 1NT 18H ;----- HARD FILE RESET FAILURE Hl0A: LOOP JMP H8 H9 <><><><><> <> <> <> <> <> <> <> <><> CHECK PO I NT 45 <><> GO TO RES I DENT BAS I C TRY RESET AGAIN GO TO RES I DENT BAS I C [F DISKETTE READ OK BUT BOOT RECORD 0226 8E 0000 E 0229 E8 0000 E 022C E8 FE 022E 022E 022E 5-96 TEST6 HIO: MOV CALL HI I: JMP BOOT STRAP I PDST6 ENDP CODE ENDS END SI,OFFSET E602 E MSG HII ENDP [S NOT STOP SYSTEM ALLOW SOFT RESET ; PR [NT 0 I SKETTE BOOT ; PRINT MESSAGE IBM Per~onQl Computer MACRO A~~embler OSKETTE -- 06/10/85 DISKETTE BIOS I 2 3 4 5 6 7 8 9 10 " 12 13 14 15 0000 Ver~ion 2.00 I-I 06-] 0-85 PAGE 118,121 TITLE DSKETTE -- 06/10/85 DISKETTE BIOS .266C .LlST CODE SEGMENT BYTE PUBL I C PUBLIC PUBL I C PUBL I C PUBLIC OISK INT 1 SEEKDSKETTE SETUP DISKETTE_IO_' EXTRN EXTRN EXTRN EXTRN CMOS READ:NEAR DDS:NEAR DISK BASE:NEAR WAITF:NEAR READ CMOS LOCATION ROUTINE LOAD (OS) WITH DATA SEGMENT SELECTOR DISKETTE PARAMETER TABLE LOCATION FIXED WAIT ROUTINE - (CXI·'5.086 US 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 I NT 13H ----- ------------ -- - -- ------------------- ------------------------DISKETTE I/O THIS INTERFACE PROVIDES ACCESS TO THE 5 1/4" DISKETTE DRIVES 320/360K DiSKETTE DRIVES AND 1.2M DISKETTE DRIVES SUPPORTED INPUT (AH)= OOH RESET DISKETTE SYSTEM HARD RESET TO NEC, PREPARE COMMAND, RECAL I BRATE REQU I RED ON ALL DR I VES (AH)= 01H READ THE STATUS OF THE SYSTEM INTO ODSKETTE_STATUS FROM LAST OPERATION IAH) IS USED REGISTERS FOR READ/WRITE/VERIFY/FDRMAT (DL) - DRIVE NUMBER 10-1 ALLOWED, VALUE CHECKED) (DH) - HEAD NUMBER (0-1 ALLOWED, NOT VALUE CHECKED) (CHI - TRACK NUMBER (NOT VALUE CHECKED) MED 1 A DR I VE TRACK NUMBER 320/360 320/360 0-39 3201360 1.2101 0-39 1.2M 1.2M 0-79 720K 720K 0-79 (CLI - SECTOR NUMBER INOT VALUE CHECKED, NOT USED FOR FORMATI MED I A DR I VE SECTOR NUMBER 320/360 320/360 1 -6/9 320/360 t .2M 1-6/9 1.2M 1.2M 1-15 720K 720K 1-9 (ALI - NUMBER OF SECTORS (NOT VALUE CHECKED) MED I A DR I VE MAX NUMBER OF SECTORS 320/360 320 f 360 8/9 320/360 1.2101 8/9 1~2M 1.2101 15 720K 720K 9 (ES:BXI - ADDRESS OF BUFFER ( REQUIRED FOR VERIFY) 5. (AH)= 02H READ THE DESIRED SECTORS 55 56 57 (AH)= 03H WRITE THE DESIRED SECTORS FROM MEMORY 58 (AH) = 04H 59 60 (AH)= 05H 61 62 63 6. 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 BO BI B2 B3 8. B5 B6 B7 BB B9 90 91 92 93 9' 95 96 97 9B 99 100 101 102 103 104 105 106 107 INTO MEMORY VER I FY THE OES I RED SECTORS FORMAT THE DESIRED TRACK FOR THE FORMAT OPERATION, THE BUFFER POINTER IES,BX) MUST POINT TO THE COLLECTION OF DESIRED ADDRESS FIELDS FOR THE TRACK. EACH F 1ELD I S COMPOSED OF 4 BYTES, I C, H, R, N), WHERE C = TRACK NUMBER" H=HEAD NUMBER, R = SECTOR NUMBER, N= NUMBER OF BYTES PER SECTOR 100=128, 01=256, 02=512, 03=1024,1 THERE MUST BE ONE ENTRY FOR EVERY SECTOR ON THE TRACK. TH I 5 I NFORMA TI ON I S USED TO F I NO THE REQUESTED SECTOR OUR I NG READ/WRITE ACCESS. PRIOR TO FORMATTING A DISKETTE, IF THERE EXISTS MORE THAN ONE SUPPORTED MEO I A FORMAT TYPE WITH IN' THE DR I VE I N QUEST I ON. THEN "SET DASD TYPE" II NT 13H, AH = 1 7H I MUST BE CALLED TO SET THE DISKETTE TYPE THAT IS TO BE FORMATTED. IF "SET DASD TYPE" IS NOT CALLED, THE FORMAT ROUTINE WILL ASSUME THE MEDIA FORMAT TO BE THE MAXIMUM CAPACITY OF THE DRIVE. IN ORDER TO FORMAT 320/360K MEDIA IN EITHER A 320/360K OR 1.2M DISKETTE DRIVE THE GAP LENGTH FOR FORMAT PARAMETER OF DISK BASE MUST BE CHANGE TO 050H. ALSO THE EDT PARAMETER (LAST SECTOR ON TRACK) MUST BE SET TO THE DESIRED NUMBER OF SECTORS/TRACK - 6 FOR 320K, 9 FOR 360K. DISK BASE IS POINTED TO BY DISK POINTER LOCATED AT ABSOLUTE ADDRESS 0:76. WHEN 320/360K FORMAT OPERATIONS ARE COMPLETE, THE PARAMETERS SHOULD BE RESTORED TO THEIR RESPECTIVE INITIAL VALUES. (AH 1= 06H REG I STERS INPUT (DL I OUTPUT IES:OI) (CHI (CLl I DH I (DLI IBH) IBL~ - READ DR I VE PARAMETERS DR I VE NUMBER (0 - I ALLOWED, V ALUE CHECKED I POINTS TO DISK BASE LOW ORDER 8 OF 10 BITS MAXIMUM NUMBER OF TRACKS BITS 7 & 6 - HIGH ORDER TWO BITS OF MAXIMUM TRACKS BITS 5 THRU 0 - MAX I MUM SECTORS PER TRACK MAX I MUM HEAD NUMBER NUMBER OF DISKETTE DRIVES INSTALLED 0 BITS 7 THRU 4 - 0 BITS 3 THRU 0 - VALID DRIVE TYPE VALUE IN CMOS (AX) - 0 UNDER THE FOLLOWING CIRCUMSTANCES: 11) THE DRIVE NUMBER IS INVALID, (2) THE DR I VE TYPE I S UNKNOWN AND CMOS I S NOT PRESENT, 131 THE DR I VE TYPE I S UNKNOWN AND CMOS I S BAD, 141 OR THE DRIVE TYPE IS UNKNOWN AND THE CMOS DRIVE TYPE IS THEN ES,AX,BX,CX,DH,OI=O ; DL=NUMBER OF DRIVES. IF NO DRIVES ARE PRESENT THEN: ES,AX,BX,CX,OX.DI=O. @DSKETTE_STATUS = a AND CY I S RESET. DISKETTE INVALID 5-97 IBM Personal Computer MACRO Assembler DSKETTE -- 06/10/85 DISKETTE BIOS 108 109 110 III 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 13' 140 141 142 143 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 I ~2 06-! 0-85 PAGE ; ---; ; ; I AH) = 15H READ DASD TYPE REGISTERS (AH) - ON RETURN I F CARRY FLAG NOT SET, DTHERW I SE ERROR 00 - DRIVE NOT PRESENT 01 - DISKETTE, NO CHANGE LINE AVAILABLE 02 - DISKETTE, CHANGE LINE AVAILABLE 03 - FIXED DISK IOL) - DRIVE NUMBER 10-1 ALLOWED, VALUE CHECKED) ; ; ; ; ; ; -------------------- - ---- -- --- ---- - - -- -- -- ------ - - - - ---- --- --------------- ---; ; ; ; ; IAHI= 16H DISK CHANGE LINE STATUS REGISTERS IAH)=OO - DISK CHANGE LINE NOT ACTIVE 06 - DISK CHANGE LINE ACTIVE & CARRY BIT ON IDL) - DRIVE NUMBER 10-1 ALLOWED, VALUE CHECKED) IAHI = 17H SET DASD TYPE FOR FORMAT REGI STERS (ALl 00 - NOT USED 01 - DISKETTE 320/360K IN 360K DRIVE 02 - DISKETTE 360K IN 1.2M DRIVE 03 - DISKETTE 1.2M IN 1.2M DRIVE 04 - DISKETTE 720K IN 720K DRIVE (DU - DRIVE NUMBER (0-1 ALLOWED, VALUE CHECKED; DO NOT USE WHEN D[SKETTE ATTACH CARD USED) ; ----- --- -- - - -------- ----- ----- -- - - - - -- -- -------- ---- ---- --- ; 0 I SK CHANGE STATUS [S ONLY CHECKED WHEN A I . 2M BYTE 0 [SKETTE DRIVE [S SPEC[FIED. [F THE DISK CHANGE LINE IS FOUND TO BE ACT J VE THE FOLLOW J NG ACT IONS TAKE PLACE: ATTEMPT TO RESET DISK CHANGE LINE TO [NACTIVE STATE. [F ATTEMPT SUCCEEDS SET DASD TYPE FOR FORMAT AND RETURN DISK CHANGE ERROR CODE [F ATTEMPT FAILS RETURN TIMEOUT ERROR CODE AND SET DASD TYPE TO A PREDETERMINED STATE INDICATING MEDIA TYPE UNKNOWN. I F THE 0 I SK CHANGE LINE I N I NACT I VE PERFORM SET DASD TYPE FOR FORMAT. ; : ; ; 144 145 146 Version 2.00 ; ; ; DATA VARIABLE -- @DISK POINTER ; DOUBLE WORD PO I NTER TO THE CURRENT SET OF 0 I SKETTE PARAMETERS ;----- ------- - -------- ------ -------- -- -- -----------------; OUTPUT FOR ALL FUNCT IONS AH STATUS OF OPERATION ; STATUS BITS ARE DEFINED IN THE EQUATES FOR @DSKETTE STATUS ; VAR[ABLE IN THE DATA SEGMENT OF TH[S MODULE ; CY 0 SUCCESSFUL OPERATION (AH=O ON RETURN, EXCEPT FOR READ DASD ; TYPE AH=11511. ; CY = 1 FAILED OPERATION IAH HAS ERROR REASON) ; FOR READ/WR[TE/VERIFY ; OS, BX, OX, CX PRESERVED ; NOTE: IF AN ERROR IS REPORTED BY THE DISKETTE CODE, THE APPROPR[ATE ; ACT I ON I S TO RESET THE 0 I SKETTE. THEN RETRY THE OPERAT I ON. ON READ ACCESSES, NO MOTOR START DELAY [S TAKEN, SO THAT ; THREE RETRIES ARE REQU[RED ON READS TO ENSURE THAT THE ; PROBLEM IS NOT DUE TO MOTOR START-UP. = = ; DISKETTE STATE MACHINE .LI ST ABSOLUTE ADDRESS 40:90 (DRIVE M 91 & (DR[VE B) 169 ITO ITI 1T2 1T3 1T4 1T5 1T6 I I I RESERVED ITT 1T8 I T9 000 : 001: 010: 011 : 100 : 101 : 110: III: 180 181 182 183 184 185 186 187 UNESTABLISHED UNESTABLISHED UNESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ---> MEDIA/DRIVE ESTABLISHED 188 189 -------> 190 191 192 193 194 195 196 19' 198 199 I I PRESENT STATE 360K IN 360K DRIVE 360K IN 1.2M DRIVE 1.2M IN 1.2M DRIVE 360K IN 360K DRIVE 360K IN 1.2M DRIVE 1.2M IN 1.2M DRIVE RESERVED NONE OF THE ABOVE DOUBLE STEPPING REQUIRED DR[VE) (360K IN 1.2M --> DATA TRANSFER RATE FOR THIS DRIVE: 00: 500 KBS 01: 300 KBS 10: 250 KBS 1 1: RESERVED LIST 200 20 I STATE OPERATION STARTED - ABSOLUTE ADDRESS 40 92 (DR[VE A) & 93 IDRIVE BI PRESENT CYLINDER NUMBER ABSOLUTE ADDRESS 40 94 (DRIVE A) & 95 IDRIVE BI 202 203 204 5-98 DISKETTE IBM Personal Computer MACRO Assembler OSKETTE -- 06/10/85 DISKETTE 8105 205 20. 201 208 209 210 211 212 213 214 215 21. 1-3 Version 2.00 06-10-85 PAGE 0000 0000 0001 0002 0003 0004 0005 0006 ASSUME .LlST DISKETTE 10 1 5TlPUSH PUSH PUSH PUSH PUSH FB 55 51 52 53 51 88 EC CS: CODE ,OS: DATA, ES :DATA PROC FAR BP DI DX BX ex MOV BP,SP PUSH PUSH CALL DS CMP ~~~~~~g_TAE-FNC_TA8) 12 217 218 21. 220 221 222 223 224 225 22. 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 241 248 249 250 251 252 253 254 255 25. 257 258 25. 2.0 0008 0009 OOOA 0000 0010 1E 56 E8 0000 E 80 FC 18 12 02 0012 0014 0014 0011 0019 001C ODIE 0021 0023 0025 0025 0021 0029 002B 002E 0030 0032 0034 0036 0038 003C B4 14 80 16 80 14 80 16 B4 FC 01 DC FC 08 01 FA 01 02 14 8A 32 00 B8 03 8A 32 CC ED El 004E R 09 E6 F6 Fa FA 26 0041 06 0041 88 8B 8A C6 .JB MOV OK FUNC: CMP .JBE CMP .JZ CMP .JBE MOV MOV XOR SHL 00 MOV ADO MOV XOR MOV MOV MOV MOV 51 DOS I NTERRUPTS BACK ON USER REG I STER USER REG I STER HEAD II, DRIVE' OR USER REGISTER BUFFER OFFSET PARAMETER OR REGISTER TRACK '-SECTOR' OR USER REGISTER BP => PARAMETER LIST DEP. ON AH [8P] = SECTOR' [BP"'11 = TRACK' [BP+2j = BUFFER OFFSET FOR RETURN OF DR I VE PARAMETERS: CLI[BP] :: BITS 7&6 HI BITS OF MAX CYL BITS 0-5 MAX SECTORS/TRACK CH/[BP+I] = LOW 8 BITS OF MAX CYL. BL/[8P+2] = BITS 7-4 = 0 BITS 3-0 :: VALID CMOS TYPE BHI tBP+3] = 0 DLI[BP"'4] = , DRIVES INSTALLED DHI (BP+5] = MAX HEAD , Dl/[BP+6] = OFFSET TO DISK BASE BUFFER SEGMENT PARM OR USER REG I STER USER REGISTERS SEGMENT OF 81 OS OAT A AREA TO OS CHECK FOR > LARGEST FUNCT I ON FUNCT ION OK AH,14H REPLACE WITH KNOWN AH,I OK DRV AH-;-8 OK ORV DL-;-I OK DRV AH-;-14H RESET OR STATUS ? IF RESET OR STATUS DR I VE ALWAYS OK READ DRIVE PARMS ? IF SO DRIVE CHECKED LATER DR IVES 0 AND I OK IF 0 OR I THEN JUMP REPLACE WITH KNOWN I NVAL I D FUNCT I ON CL,AH CH,CH CL,I ~~:g~FSET FNC_TAB CL :: FUNCT I ON CX = FUNCT I ON FUNCTION TIMES 2 LOAD START OF FUNCTION TABLE ADO OFFSET INTO TABLE => ROUTINE AX = HEAD "." OF SECTORS OR CASD TYPE OX = DRIVE' 5 I = HEAD " , ' OF SECTORS OR OASD TYPE 01 = DRIVE" LOAD STATUS TO AH FOR STATUS FUNCTION INITIALIZE FOR ALL OTHERS AH,OH DH,DH 51 ,AX DI,DX AH,oOSKETTE STATUS *OSKETTE_STATUS, 0 INVALID FUNCTION THROUGHOUT THE DISKETTE BIOS, THE FOLLOWING INFORMATION IS CONTAINED IN THE FOLLOWING MEMORY LOCATIONS AND REGISTERS. NOT ALL DISKETTE BIOS FUNCTI ONS REQU I RE ALL OF THESE PARAMETERS. 2., 2.2 DI 2.3 51-HI 51-LOW 2.4 ES 2.5 [BP] [BP+I] [BP+2] 2 •• 2.7 2.8 2.' 270 I DRIVE" : HEAD" I # OF SECTORS OR DASO TYPE FOR FORMAT I BUFFER SEGMENT : SECTOR' : TRACK" : BUFFER OFFSET ACROSS CALLS TO SUBROUTINES THE CARRY FLAG ICY= I), WHERE INDICATED IN SUBROUT I NE PROLOGUES, REPRESENTS AN EXCEPT I ON RETURN (NORMALLY AN ERROR CONDITION). IN MOST CASES, WHEN CY 1, ttDSKETTE STATUS CONTAINS THE SPECIFIC ERROR CODE. ; (AHI = ODSKETTE STATUS , CALL THE REQUESTED FUNCT I ON CALL WORD PTR CS; [BX] , RESTORE ALL REG 1STERS POP 51 = 271 272 273 274 275 276 211 218 219 280 281 282 283 »> ENTRY PO I NT FOR ORG OEC59H 0041 0044 0045 0046 0041 0048 0049 004A 0048 2E: FF 11 5E IF 59 58 SA SF 50 CA 0002 284 285 286 281 288 289 290 291 292 293 294 295 296 291 298 299 300 301 302 303 304 305 306 301 308 309 004E 001E 0050 00E8 0052 00F4 0054 0 I 00 0056 010C 0058 01 18 005A 016A 005C 016A OOSE 0114 0060 016A 0062 016A 0064 016A 0066 016A 0068 016A 006A 016A 006C 016A 006E 016A 0010 016A 0072 016A 0074 016A 0076 016A 0078 021A 007A 023C 007C 0261 = 001E 310 311 007E R R R R R R R R R R R R R R R R R R R R R R R R POP POP POP POP POP POP RET OS ex BX DX DI BP 2 ; THROW AWAY SAVED FLAGS ,--- ------------- - - ------------ - -- - ---- - ----------------- - - - - - - - ---- ------ - --= FNC TA8 OW OW OW OW DW OW OW OW OW OW OW OW OW OW OW OW OW DISK RESET DISK-STATUS DISK-READ DISK-WRITE DISK-VERF DISK-FORMAT FNC ERR FNC-ERR 0 I SK PARMS FNC ERR FNC-ERR FNC-ERR FNC-ERR FNC-ERR FNC-ERR FNC-ERR FNC-ERR AH AH AH AH AH AH AH AH AH AH AH AH AH AH AH AH AH OW OW OW OW OW FNC_TAE EQU FNC-ERR FNC-ERR DISK TYPE DISK-CHANGE FORMAT SET S - AH :: AH = AH = AH :: AH = END DISKETTE_IO_' ENOP g: ~~g=~~~ :~ 00; 01, 021 :: 03; 041 = 05; :: 06; :: 01; 081 = 09; :: OA; :: 08; OC; 00; :: OE; OFI 101 = = = = = = = = : :~; RESET STATUS READ WRITE VERIFY FORMAT INVALID INVALID READ DR I VE PARAMETERS INVALID INVALID INVALID INVALID INVALID INVALID INVALID INVALID :~~:~:g 131 INVALID 14; INVALID 15; READ DAse TYPE 161 CHANGE STATUS 1 7, SET DASD TYPE DISKETTE 5-99 IBM P.rsonat Comput.r MACRO Assembler OSKETTE -- 06/10/85 DISKETTE BIOS 312 313 314 315 310 317 318 319 320 321 322 323 324 325 320 321 328 32. 330 331 332 333 334 335 330 331 338 33. 340 341 342 343 34' 345 340 341 348 ... 350 351 352 353 3.' 355 350 3., 358 35. 360 301 302 303 304 305 300 301 308 30' 310 311 312 313 314 315 310 311 318 31. .8."0 '" ••• '" "0 1-----------------------------------------------------------------------------I DISK_RESET; RESET THE DISKETTE SYSTEM. ; ON EXITI O~~H OOSA OOSC OOSO 0092 0094 0096 0091 0098 0098 ~090 OOAO OOAO OOA I 00A4 00A5 OOAl OOAA OOA$ OOAE OOAF OOBI aOB5 00B7 0089 008C SA FA AO 24 CO OC EE C6 EB OC EE FB E8 12 B9 51 88 50 84 E8 sa Ea 59 72 3A 75 FE 80 76 03F2 003F R 3F CO 04 01 SK RESET MOV eLI MOV ANO ROL OR 08 OUT MOV JMP 06 003E R 00 00 04 OR OUT OOEO R 08 01BO R 08A4 R CALL Je MOV NXT DRV: PUSH MOV PUSH MOV CALL POP CALL POP JC 30 OE 0042 R 2A CI F9 C3 E2 eMP JNZ INC eMP JBE ;----- OOI3E OOCI 00C2 00C4 00C7 00C9 ooee OOCF 000 I 0004 00Q7 0008 0008 OODB 0000 OODF 88 0008 50 84 03 ~8 07BD 2A 02 Ea 06Ce E8 078D B2 01 Ea 06CC E8 0180 58 ADAPTER CONTROL PORT NO INTERRUPTS GET DIGITAL OUTPUT REGISTER REFLECTION KEEP SELECTED AND MOTOR ON 81 TS MOTOR VALUE TO HIGH NIBBLE DR I VE SELECT TO LOW NIBBLE TURN ON I NTERRUPT ENABLE RESET THE AOA~TER SET RECAI-IBRATE REQU I RED ON ALL DR I VES WAIT FOR 1/0 TURN OFF RESET BI T RESET' THE ADAPTER ENABLE THE INTERRUPTS WA I T FOR THE INTERRUPT I F ERROR. RETURN IT CL.: EXPECTED .NEC_STATUS ~~:~~~T~~T~~ATUS ~L,4 AL,OOOOIOOOB DX,AL .SEEK STATUS,O 1+2 AL, 00000 I OOB DX,AL WAIT INT OR ERR CX-;-IIOOOOOOB = ex SAVE FOR CALL ~OAD NEC_OUTPUT ERROR ADDRESS ~~, OFFSET DR_PDP_ERR SENSE INTERRUPT STATUS COMMAND AH,08H NEC OUTPUT AX RESULTS THROW AWAY ERROR RETURN READ I N THE RESULTS RESTORE AFTER CALL ERROR RETURN TEST FOR OR I VE READY TRANS I T I ON EVERYTH 1NG OK NEXT EXPECTED ONEC STATUS ALL POSS I BLE DR I VES CLEARED FALL THRU IF 110001 OOB OR > ex DR ERR CL-;-IlINEC STATUS DR ERR eLCL,IIOOOOIIB NXT_ORV SEND SPECIFY COMMAND TO NEC R MOV PUSH MOV CALL R SUB R R CALL CALL MOV CALL CALL POP R R AX.OFFSET RES8AC AX AH, 03H NEC OUTPUT DL.DL GET PARM NEC:-OUTPUT LOAD ERROR ADDRESS ; PUSH NEC OUT ERROR RETURN I ~~~~~~Y TE~M~~~~AND NEC-OUTPUT AX - FIRST SPECIF:Y 8YTE GET PARA~ETER TO AH OUTPUT THE COMMAND SECOND SPEC I FY ,8YTE GET PARAMETER TO AH OUTPUT THE COMMAND POP ERROR RETURN SETUP END BX.SIAL.8L VARIOUS CLEANUPS GET SAVED AL TO BL PUT BACK FOR RETURN g~;.TpARM RES8AC: Ea 0620 R 88 DE 8A C3 C3 OOEO OOEO 59 OOEI OOEI 150 OE 0041 R 20 00E6 E8 Fa OOEa CALL MOV MOV RET DR POP ERRI - POP OR JMP 01 SK_RESET ex CLEAR STACK ODSKETTE STATUS,BAD NEC SHORT RESBAC ENDP SET ERROR CODE RETURN FROM RESET ,- ------------------------------- ----- --------------- ---------------- - - --- ---'- ; DISK_STATUS: ENT~YI : ON OOEa 00E8 1515 26 0041 R OOEC E8 0620 R OOEF 88 DE ~~~~ ~~ C3 00F4 OISKETTE STATUS. AH : STATUS OF PREVIOUS OPERATION ; ON EXITa AH. 1lI0SKETTE STATUS. CY REFLECT STATUS OF PREVIOUS OPERATION. 01 SK STATUS PROC NEAR IlIQSKETTE STATUS.AH SETUP_END BX,SI AL.BL ,-------- -------------------=-------- ------- --------- ------ ----------- -- ------- MOV CALL MOV MOV RET DISK_STATUS ; ; DISK_READI ; ; ON ENTRY: I DI 51-HI S I-LOW ES [BP] [ BP t l ] (~P+2~ ON EXIT: 00F4 00F4 00F9 OOFC OOFF 0.00 DRIV.E • HEAD. • OF SECTORS I BUFFER SEGMENT I SECTOR. TRACK # BUFFER OFFSET ltOSKETTE STATUS, CY REFLECT STATUS OF OPERATION b;~~-~~~~-------;~~~----~~~~-------------------------- ------------------------80 26 003F R 7F Ba E646 E8 03SC R C3 - ~~~ :~~~~~4~~ AT!JS, a 1 1 1 I 11 18 CALL RET RD_WR_VF· 01 SK READ ENDP ; OISK WRITE: ; ; ON ENTRY: DISKETTE WRITE. ; !~O! C~~~ ~O:~~~D ~P~:~ T 6g~MANO ; COMMON READ/yt'RITE/VERIFY ,---=-------------------------------------------------------------------------- 412 - 01 : 51-HI I 51-LOW : : : BP+11 : 8P+2 : EI~P] ON EXIT: 0100 0100 Ba C54A 5-100 : ~~~ I ~~~K C[~~N~~~UP _ENO ; GEt SAVED AL TO 8L ; PUT ~ACK FOR RETURN ENDP ---------------------------- ---- - -- -------- - - - -------- - - - - - - - - - - - - - - - - - -- ---DISKETTE READ. 411 41. 410 417 418 41' 420 421 422 423 424 425 ----=---:----------- --- -------- -- -- ------------------ ---- --- PROC NEAR DX,.03F2H SJI 081C R 44 OOCO •• 5 .,..,3 ODSKETTE STATUS, CY REFLECT STATUS OF OPERATION 1- -: - -- .. ------------ .. 007E 007E 0081 0082 00S5 •• 2 3.7 3.8 3" 400 401 402 403 '04 405 400 401 408 40. 410 06-10-85 PAGE ~80 381 382 38. .84 .85 .80 .81 .88 1-4 Version 2.00 DRIVE # HEAD # # OF SECTORS BUFFER SEGMENT SECTOR # TRACK # BUFFER OFFSET ODSKETTE STATUS. CY REFLECT STATUS OF OPERATION b~~;-;~~~~------;~~~----~~~~- -------------------------------------------------- DISKETTE - MOV AX, OC54AH I AX = NEC COMMANO, DMA COMMAND IBM Personal Computer MACRO Assembler DSKETTE -- 06/10/85 DISKETTE BIOS 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 0103 80 OE 003F R 80 0108 E8 035C R a I 08 C3 01 OC OR CALL 450 451 452 453 454 455 456 457 45' 459 460 461 462 0118 463 0118 E8 02C8 R 464 011B E8 03CE R 465 aIlE 80 OE 003F R 80 466 0123 E8 0416 R 467 0126 7237 468 0 I 28 E8 0451 R 469 01 2B BO 4A 470 0120 E8 0471 R 471 0130 72 2D 472 0132 B4 40 473 0134 E8 04C7 R 474 0137 B8 015F R 475 013A 50 476 013B B2 03 477 01 3D E8 06CC R 478 0140 E8 07BD R 479 0143 B2 04 480 0145 E8 06CC R 481 0146 E8 07BD R 482 014B B2 07 483 014D E8 06CC R 484 0150 E8 07BD R 485 0153 B2 08 486 0155 E8 06CC R 487 0158 E8 07BD R 488 015B 58 489 015C E8 0530 R 490 015F 491 01 5F E8 02EE R 492 0162 E8 0620 R 493 0165 8B DE 494 0167 8A C3 495 0169 C3 496 0 I 6A 497 49' 499 500 501 502 503 016A 504 016A 8B C6 505 016C B4 01 506 016E 88 26 0041 R 5070172F9 508 0 I 73 C3 5090174 510 511 512 513 514 515 516 517 510 519 520 521 522 523 524 525 526 527 520 529 530 531 532 a 174 533 0 I 74 81 FF 0080 534 0 I 78 72 06 535 530 537 538 017A 8B C6 539 017C B4 01 ~~~~-~~~~ - 01 SI-H[ S [-LOW ES [BP] [BP+I] [BP+2] : DRIVE # : HEAD # : # OF SECTOR S : BUFFER SEGMENT : SECTOR # : TRACK # : BUFFER OFFSET IttDSKETTE_STATUS, CY REFLECT STATUS OF OPERATION ON EXIT: 449 IttMOTOR STATUS,IOOOOOOOB ; INDICATE WRITE OPERAT[ON RD WR \IF ; COMMON READ/WR[TE/VERIFY RET DISK_WRITE ENDP ; - - - - -- - - - -- - ------------------DISKETTE VER [FY • DISK_VERF: ON ENTRY: 0 I OC OIOC 80 26 003F R 7F a I I 1 88 E642 0114 E8 035C R 0117 C3 0118 1-5 06-10-85 Version 2.00 PROC AND NEAR : !~D!C~~~ ~O~~~~D~P~~~T~g~MANO RD_WR_VF ; COMMON READ/WRITE/VERIFY RET o [SK_ VERF ENDP ; ---- --- - - - - -- -- ---------------------- -- ------ -- -- -- - -----D[SK_FORMAT: DISKETTE FORMAT. "oV =~~6~~4~~ATUS,011111118 CALL , ; ON ENTRY: 01 S I-H [ S I -LOW ES [BP] [BP+lj [BP+2] ON EXIT: @DSKETTE_STATUS, ~ ~ ~~ DRIVE # HEAD # # OF SECTORS BUFFER SEGMENT SECTOR # TRACK # BUFFER OFFSET CY REFLECT STATUS OF OPERATiON - ~~~~~ ~ - - -- - ~~~~ - - - - ~~~~ - - - - - - -- - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - -- - CALL CALL OR CALL .JC CALL MOV CALL .JC MOV CALL MOV PUSH MOV CALL CALL MOV CALL CALL MOV CALL CALL MOV CALL CALL POP CALL XLAT NEW FMT TNIT @MOTOR STATUS,IOOOOOOOB MED CHANGE FM BON SEND RATE AL. 04AH DMA SETUP FM BON AH-;-04DH NEC IN[T AX. OFFSET FM DON AX DL,3 GET PARM NEC-OUTPUT DL,4 GET PARM NEC-OUTPUT DL,"1 GET PARM NEC-OUTPUT DL,"8 GET PARM NEC-OUTPUT AX NEC_TERM TRANSLATE STATE TO PRESENT ARCH. ESTABLISH STATE IF UNESTABLISHED INDICATE WRITE OPERATION CHECK MEO [A CHANGE AND RESET [F SO MED I A CHANGED, SK [P SEND DATA RATE TO CONTROLLER W[LL WR I TE TO THE 0 I SKETTE SET UP THE DMA RETURN WITH ERROR ESTABLISH THE FORMAT COMMAND INITIALIZE THE NEC LOAD ERROR ADDRESS PUSH NEC OUT ERROR RETURN BYTES/SECTOR VALUE TO NEC CALL CALL XLAT OLD SETUP_END BX,SI AL,BL TRANSLATE STATE TO COMPATIBLE MODE VAR 10US CLEANUPS GET SAVED AL TO BL PUT BACK FOR RETURN MOV MOV SECTORS/TRACK VALUE TO NEC GAP LENGTH VALUE TO NEC F [LLER BYTE TO NEC THROW AWAY ERROR TERM[NATE, RECEIVE STATUS, ETC. RET DISK FORMAT ENDP ; ; STATUS. : -~~~~~~~- ~-----~~~~~~;-~~~~~~;~ -~~~~~~~~;-;~-~ ~~ ~~~; -;~~ ~~~-~~~-~~;-~;~MAND ON EX[T: @DSKETTE_STATUS, IN CY REFLECT STATUS OF OPERATION ~~~-~~~-~~~~--- - ~~~~-------- -------- ----- I ~~~~~;-;~~~~~;~-~~~~~ST - MOV MOV MOV STC AX. S I AH, BAD CMD @DSKETTE_STATUS,AH RESTORE AL SET BAD COMMAND ERROR STORE IN DATA AREA SET CARRY INDICATING ERROR RET FNC _ERR ENDP 01 SK_PARMS: READ OR I VE PARAMETERS. ON ENTRY: 0 [ : DRIVE # ON EXIT: CLI [BP] = CHI [BP+ 11 BLI [BP+2] BH/ DLI DH/ 01/ ES [BP+3] [BP+4] [8P+5} [BP+6] AX NOTE 6 ~ ~~ ~ ~~~~ - ------ eMP .JB ~~;~ B[TS 7 & 6 H[GH 2 BITS OF MAX CYLINDER B[TS 0-5 MAX SECTORS/TRACK = LOW 8 B[TS OF MAX CYLINDER =B[TS7--4=0 BITS 3-0 = VALID CMOS DRIVE TYPE ~ 0 '" # DRIVES INSTALLED IVALUE CHECKED) MAX HEAD # = OFFSET OF 0 I SK BASE = SEGMENT OF 0 I SI< BASE '" 0 - = THE ABOVE INFORMATION IS STORED IN THE USERS STACK AT THE LOCATIONS WHERE THE MAIN ROUT[NE WILL POP THEM I NTO THE APPROPR I ATE REG I STERS BEFORE RETURN I NG TO THE CALLER. ---- ~~~~ DI,80H DISK_P2 ---------------------------------------; ; CHECK FOR FIXED MEDIA TYPE REQUEST CONT[NUE [F NOT REQUEST FALL THROUGH F [XED 0 I SK REQUEST FALL THROUGH ERROR MOV MOV AX, S I AH,BAD_CMD ; ; RESTORE AL WITH CALLERS VALUE SET BAD COMMAND ERROR [N I AH) DISKETTE 5-101 IBM Personal Computer MACRO Assembler OSKETTE -- Ob/l0/85 DISKETTE BIOS 5.0 541 5.2 5.3 5 •• 5.5 5.6 547 5 •• 5.9 550 551 552 553 55. 555 556 557 55. 559 560 561 562 563 56. 565 566 567 56. 569 570 571 572 573 57. 575 576 577 57. 579 580 581 582 583 5 •• 5.5 586 017E F9 C3 01B2 01B5 01 B7 01B9 01BB o 1BO 88 46 02 FE C8 00 EO 8A 08 32 FF 2E: 8B SF 0214 R CALL MOV MOV AND MOV eMP JZ XLAT NEW WORD-PTR [8P+2] ,0 AX,G!lEQUIP FLAG AL,I10000018 DL,2 AL,Ol0000018 01 SK_P3 TRANSLATE STATE TO PRESENT ARCH. DRIVE TYPE 0 LOAD EQU I PMENT FLAG FOR # 0 I SKETTES KEEP 0 I SKETTE DR I VE BITS DISKETTE DRIVES 2 2 DRIVES INSTALLED? IF YES .JUMP DEC CMP JNZ DL AL, 0000000 18 DISK_P8 DISKETTE DRIVES = 1 1 DRIVE INSTALLED? IF NO .JUMP MDV CMP JA MOV CALL Je DR JZ CMP .)A [8P+4j ,DL 01,1 DISK P9 BYTE-PTR{BP+5],1 CMOS TYPE DISK-P4 AL,AL DISK P4 AL, (DR PTE-DR DISK_P4 - STORE NUMBER OF DR I VES CHECK FOR VALID DRIVE DRIVE INVALID MAX I MUM HEAD NUMBER 1 RETURN DR I VE TYPE IN AL IF CMOS SAD CHECKSUM ESTABLISHED TEST FOR NO DR I VE TYPE .JUMP IF SO > MAXIMUM IF SO .JUMP MDV DEC SHL MOV XDR MOV (BP+2] ,AL AL AL, I BL.AL BH,BH ; cX,CS;WORD PTR DR_PT{8X]; STORE VALID CMOS DRIVE TYPE MAKE 0 ORIGIN ACCOUNT FOR FIELD WIDTH FINISH MAKING INDEX POINTER CLEAR HIGH ORDER INDEX GET MAX TRACK AND SECTOR MDV TEST JNZ eMP ')Z JMP AL,«tDSK STATE[DI] 8YTE-PTR (BP+2],O DISK P9 SHORT 0 I SK_P6 LOAD STATE FOR THIS DRIVE CHECK FOR ESTABLISHED STATE GO TO CMOS FOR DR I VE CHECK CHECK FOR CMOS 8AD/INVALID CMOS BAO/[NVALID AND UNESTABLISHED CMOS GOOD AND UNEST ABL I SHED; USE CMOS = = DISK_P3: 88 56 04 83 FF 01 TT 66 C6 46 05 01 E8 06B3 R 72 I . OA CO 14 3C 03 ,. TT 10 = pn /2 01 SK_P4: 8A A8 75 80 14 E8 85 0090 R 10 08 7E 02 00 31 IC 0102 0102 24 CO 0104 2E: 88 OE 0216 R 0109 3C 80 o lOB 15 ~~S~E~5DET DISK_P5: " 5.7 5 •• 5.9 590 02C8 R 46 02 0000 0010 R CI 02 41 06 FE CA 3C 01 75 6A 01 C8 01CA 01CE 0100 SET ERROR RETURN CODE 01 SK_P2: 0193 0195 0197 0199 0199 019C 019F 01 A I 01 AS 01 A8 01AA 01 AC 01AE 0180 o lC2 o IC2 o IC6 06-10-85 STC RET o l1F 0180 0180 E8 0183 C1 0188 AI 018824 0180 82 018F 3C 0191 14 1-6 Version 2.00 0IDD2E: 88 OE 0214 R 01 E2 F6 85 0090 R 01 lET 14 05 o AND MOV eMP JNE ~~:=~~~-~~~ AL,RATE MSK I SOLATE STATE GET DR I VE PARAMETERS FOR 1.2 M DR I VE 1.2M DRIVE? 300 OR 500 RATE IS 1.21.1 DRIVE MOV TEST JZ CX,WDRD PTR CS:DR PT ;~~~=~!ATE[DI], TRK_CAPA GET OR I VE PARAMETERS 360K DR I VE 80 TRACK ? MUST BE 360 CS:DR_PT+2 DISK_P6- 591 592 593 59. 595 596 597 59. 599 600 601 602 603 60. 605 606 b07 608 b09 610 bll b12 613 614 615 01E9 01EE 01EE 01Fl 01F5 01 F8 01FA 01FA 01 FC OIFF 0201 0202 2E: 88 OE 0218 R 4E 00 06 0000 E 46 06 C8 CX,WORD PTR CS:DR_PT+4 GET DR I VE PARAMETERS [BP] ,CX AX,DISK BASE [BP+6],AX AX,CS SAVE POINTER IN STACK FOR RETURN ADDRESS OF 0 I SK BASE SAVE I N STACK SEGMENT DISK_BASE ISAME AS THIS ONE) MOV CALL XOR CLC RET ES,AX XLAT OLD AX,AX ES I S SEGMENT OF TABLE TRANSLATE STATE TO COMPATIBLE MODE CLEAR OISK_P1: 8E CO E8 02EE R 33 CO F. C3 NO DR I VE PRE SENT HANDLER 0203 0203 C6 0207 020733 0209 89 020C 88 020F 89 0212 E8 0214 46 04 00 CO 46 00 66 05 46 06 E6 616 DISK P8: MOV DISK P9~ XOR MOV MOV MOV JMP 01 SK_PARMS ; 617 ; 61. 619 620 621 622 MOV MOV LEA MOV MDV DISK_P61 89 80 89 8C 02140921 0216 OF 4F 0218 09 4F 021A = DB DB EQU ON ENTRY ~ ~~ 639 640 641 642 643 644 645 646 641 648 649 650 651 0220 0220 022E 0231 0232 0233 0235 0231 0238 0238 023A 023C 652 653 5-102 02C8 R 85 0090 R CO 13 01 01 02 02 50 E8 02EE R 58 F8 88 DE 8A C3 C3 32 E4 EB Fl ~ ON EXIT: 6 E8 8A OA 74 84 A8 74 84 OFH,04FH 09H, 04FH • DISK_TYPE: ; 021A 021A 0210 0221 0223 0225 0227 0229 022B = t o " 1.21.4 720K - - - - --------- -- - - - - - - - ----- -- - - - - - - - -- - -- - - - --- - - - -- - - -- - - - - - - -- - - - - - - - - - - - - -- 627 630 631 632 633 634 635 636 631 638 CLEAR PARMS I F NO DR I VES OR CMOS BAD TRACKS, SECTORS /TRACK = 0 HEAD = 0 OFFSET TO 0 I SK BASE 0 EXIT - DR I VE PARAMETER TABLE ; 629 CLEAR NUMBER OF DR I VES - - - - ------------ - - - - - --------- - -- - - - - - - - -- - - ------ ---- - - - - - - -- -- - -- --- - - - - -- -- DR_PTE ; 62. [BP+4], 0 AX,AX (BP] ,AX (BP+5] ,AH [BP+6] ,AX DISK PT ENDP- 6;~;~ ---~~ ------~ ~~: ~ ~ ;~- ---------------; -~~; ~ -~;;~;~: -~~~~~~~ I;;;~; -~~~~ -----; 623 62' 625 626 BYTE PTR ;y;~ - THIS ROUTINE RETURNS THE TYPE OF MEDIA 01 AH ------- ;~~~ : ORIVE TYPE, ---- ~~;; CY=O --------------------------------------------------- CALL MOV OR .JZ MOV XLAT NEW AL.G!lDSK STATE[DI] AL,AL NO DRV AH-;NOCHGLN jiST ~~'~~~KCAPA MOV AH-;CHGLN DT BACK: PUSH CALL POP eLC MOV MOV RET INSTALLED. DRIVE # TRANSLATE STATE TO PRESENT ARCH. GET PRESENT STATE INFORMATION CHECK FOR NO DRIVE NO CHANGE LINE FOR 40 TRACK DR 1VE IS THIS DRIVE AN 80 TRACK DRIVE? IF NO JUMP CHANGE LINE FOR 80 TRACK DRIVE AX XLAT OLD AX - SAVE RETURN VALUE TRANSLATE STATE TO COMPATIBLE MODE RESTORE RETURN VALUE NO ERROR GET SAVED AL TO 8L PUT BACK FOR RETURN 8X,SI AL,BL t NO DR I VE PRESENT OR UNKNOWN XOR .JMP 01 SK_TYPE ENDP AH,AH SHORT DT_BACK ;- -------- - - --- - - -- - - - - - - - - - - - - - - - - - - -- - - -- - - - --- -- -- -- - - - - - - - - -- - -- - - -- - - - - - -- ; DISK_CHANGE: THIS ROUTINE RETURNS THE STATE OF THE DISK CHANGE LINE. DISKETTE IBM Person". I Computer MACRO Assembler OSKETTE -- 06/10/85 OISKETTE BIOS 06-10-85 b54 b55 b5b ON ENTRY: 01 b57 ON EXIT: AH : 00 06 - b5B b59 bbO 661 662 663 664 665 666 667 bbB 669 670 511 672 b73 614 675 616 677 678 b79 6S0 681 682 683 6B4 bB5 bBb 6B7 bBB 6B9 690 691 692 693 694 695 696 697 69S 699 700 701 702 703 704 105 ~ ~ ~~ 023C 023C 023F 0243 0245 0247 0249 E8 SA OA 74 A8 74 02C8 R 85 0090 R CO 19 01 05 - ~~;~G~- - CALL MOV OR 0250 C6 06 0041 0255 0258 025B 0250 025F E8 E8 8B 8A C3 R 06 02EE R 0620 R DE C3 ;~O~ Il!IDSKETTE STATUS DISK CHANGE LINE INACTIVE, CY " DISK CHANGE LINE ACTIVE, CY = I ---- ~E;~ 0 ------- -------------------------------------------- jiST ~~fi~K_CAPA TRANSLATE STATE TO PRESENT ARCH. GET MEDIA STATE INFORMATION OR I VE PRESENT ? JUMP IF NO DRIVE CALL JZ READ DSKCHNG FINIS GO CHECK STATE OF 0 I SK CHANGE LINE CHANGE LINE NOT ACTIVE XL AT OLD SETUP END BX,SIAL,BL TRANSLATE STATE TO COMPATIBLE MODE VAR 10US CLEANUPS GET SAVED AL TO BL PUT BACK FOR RETURN SETIT: MOV FINIS: CALL CALL MOV MOV R 80 OR J"? DISK _CHANGE ; ~~ ~~A:\~~~~\~ANGE ; LINE INDICATE MEDIA REMOVED (tDSKETTE STATUS, T I ME OUT SHORT FINIS ENoP ; SET TIMEOUT, NO DRIVE - --- -- - -- - - - - -- - - -- - -- - - - --- - -- - - -- - - - -- - - -- - - - -- -- -- - --- - - - -- - - -- - - -- - - - -- --- ; FORMAT_SET THIS ROUTINE IS USED TO ESTABLISH THE TYPE OF MEDIA TO BE USED FOR THE FOLLOWING FORMAT OPERATION. ON ENTRY: S I LOW : 01 : ON EXIT: Il!IDSKETTE STATUS REFLECTS STATUS AH : IIIDSKETTE STATUS CY = I IF ERROR ~~~~~ ~ E8 56 88 32 8B 80 4E 75 80 EB ---- DRIVE # RET 0260 0260 80 OE 0041 0265 EB EE 0267 0267 0261 026A 0268 0260 026F 0271 0216 0277 0279 021E : XL AT NEW AL,Il!IDSK STATE[DI1 AL, AL DC NON .JZ 024B ES 08E3 R 024E 74 05 1-7 Version 2.00 02C8 R - C6 E4 FO A5 0090 R OF 07 80 0090 R 90 37 ~E~ ------ CALL PUSH MOV XOR Mav ~~O~ OASD TYPE FOR FORMAT DRIVE # ---- ~E~~ --------------------------------------------------- XL AT NEW SI AX,SI AH, AH SI,AX ; ; ; ; ; ~~g ~~SK_STATE [011 JNZ NOT 320 3~p ,NOT TRANSLATE STATE TO PRESENT ARCH. SAVE aASO TYPE AH = ? , AL = DASa TYPE AH : 0 , AL : aAsa TYPE SI = DAsa TYPE MED_D~T~~~~KS;~~+~~ri73~~~ ; MEO AC~E~= I j e~ATE BYPASS IF NOT ~~g~TS~~TE[DI1,MEO_DET+RATE_250; SET TO 320/360 706 707 708 709 110 0280 0280 E8 0416 R 0283 80 3E 0041 02881420 NOT 320: CALL 711 112 713 714 715 028A 4E 028B 15 07 028080800090 R 70 0292 E8 23 R 80 C"? JZ DEC JNZ OR 0294 0294 0295 0297 029C 4£ 75 07 80 80 0090 RIO E8 19 CHECK FOR TIME_OUT IF TIME OUT TELL CALLER CHECK FOR 320/360K IN 1.2M DRIVE , BYPASS IF NOT ~~~~'fS~~TE[DI1 ,MED_DET+DBL_STEP+RATE_300 ; SET STATE NOT 320 12 J"? 716 717 718 719 720 721 MED CHANGE ; @DSKETTE STATUS,TIME OUT SO - NOT 320 12: -DEC JNZ OR JM? 51 ; CHECK FOR 1.2M MEDIA IN 1.2M DRIVE NOT 12 ; BYPASS IF NOT 100000008 (250) -> 01000000B (300) -> OOOOOOOOB :g~~;i~~T~~~~Gs~~ - -; ; ; NO RETRY: CLC ~~~~T 5~T~~~S R~6~ RETRY SET CARRY FOR RETRY RETRY RETURN CLEAR CARRY NO RETRY NO RETRY RETURN RET ; ATTEMPT TO NEXT RATE (250) (300) (500) AH,RATE 500+ I ; SET CY FOR RATE 500 AH, I ; TO NEXT STATE AH.RATE MSK ; KEEP ONLY RATE B[TS @DSK STATE[DIJ,NOT RATE MSK+DBL STEP ; RATE, DBL STEP OFF STC RET RETRY IS UPDATED FOR RETRY. = I FOR RETRY, CY = 0 FOR NO RETRY ~~~~ ENDP - -- -- - - -- - - - - - -- - - - - - -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - -- - - - - - -- - -- - -- - - - - -- ; ; NUM_TRANS: THIS ROUTINE CALCULATES THE NUMBER OF SECTORS THAT WERE ACTUALLY TRANSFERRED TO/FROM THE DISKETTE. ; ; ; ON ENTRY: [BP+l] 51-HI [SP) ON EXIT: AL , ~~~ - ~~~~~ R 00 R R R ------- = TRACK = HEAD = START = NUMBER ~~O~ ---- ~~~~ SECTOR ACTUALLY TRANSFERRED ------- ----------------------------------- XOR CMP JNZ MOV CAI,..L MOV MOV CMP JNZ AL, AL (tDSKETTE STATUS,O NT OUT DL--;4 GET PARM BL,liiNEC STATUS+5 CX, S I CH,PNEC STATUS+4 DIF_HD - CLEAR FOR ERROR CHECK FOR ERROR I F ERROR 0 TRANSFERRED SECTORS !TRACK OFFSET TO DL AH SECTORS !TRACK GET ENOING SECTOR CH HEAD # STARTED GET HEAD ENDED UP ON IF ON SAME HEAD, THEN NO ADJUST MDV CMP JZ CH, 80H - DISK READ THE DESIRED SECTORS INTO MEMORY WRITE THE DESIRED SECTORS FROM MEMORY VERIFY THE DESIRED SECTORS FORMAT THE DESIRED TRACK UNUSED UNUSED RETURN THE CURRENT DRIVE PARAMETERS INITIALIZE DRIVE PAIR CHARACTERISTICS INTERRUPT 41 POINTS TO DATA BLOCK FOR DRIVE 0 INTERRUPT 46 POINTS TO DATA BLOCK FOR DRIVE I READ LONG WRITE LONG (READ & WRITE LONG ENCOMPASS 512 + 4 BYTES ECC) SEEK ALTERNATE DISK RESET (SEE DLl UNUSED UNUSED TEST DRIVE READY RECALIBRATE UNUSED UNUSED CONTROLLER INTERNAL 0 I AGNOST I C READ DASD TYPE 00 67 68 69 70 71 72 REGISTERS USED FOR F[XED DISK OPERATIONS (OLI !CH) (CHI (CL) 73 74 75 76 77 NOTE: 78 79 80 81 82 83 54 85 86 87 88 89 90 91 (80H-81H FOR. DISK, VALUE CHECKED) (0-15 ALLOWED, NOT VALUE CHECKED) (0-1023, NOT VALUE CHECKED) 1SEE CLl (1-17, NOT VALUE CHECKED) HIGH 2 BITS OF, CYL I NDER NUMBER ARE PLACED IN THE HIGH 2 BITS OF THE CL REGISTER (10 BITS TOTAL) (AL) NUMBER OF SECTORS (ES:8X~ ADDRESS OF BUFFER FOR,READS AND WRITES, (NOT REQU I RED FOR VER [FY) FORMAT 1MAXIMUM POSSIBLE RANGE 1-80H, FOR READ/WRITE LONG 1-79HJ (AH=51 ES:BX POINTS TO A 512 BYTE BUFFER. THE F[RST 2· (SECTORS I TRACK) BYTES CONT A I N F ~ N FOR EACH SECTOR. F OOH FOR A GOOD SECTOR 80H FOR A BAD SECTOR N = SECTOR NUMBER FOR AN INTERLEAVE OF 2 AND 17 SECTORS/TRACK THE TABLE SHOULD BE: = 92 93 94 95 96 97 98 5-116 DRIVE NUMBER HEAD NUMBER CYLINDER NUMBER SECTOR NUMBER DB DB DB DISK OOH, 0 1H, OOH, OAH, OOH, 02H, OOH,OSH, OOH, 03H, OOH, OCH OOH, 04H, OOH, ODH. OOH. 05H, OOH, OEH, OOH, 06H, OOH, OFH 00H,07H,OOH,10H,OOH,08H,OOH,IIH,OOH,09H [BM Personal Computer MACRO Assembler DISK ----- 06/10/85 FIXED DISK B[OS 99 100 101 102 103 104 105 1 Db 107 108 109 110 111 112 113 114 115 11. 117 118 119 120 121 122 123 124 125 12. 127 128 129 130 131 132 133 134 135 13. 137 138 139 140 141 142 143 144 145 14. 147 148 149 150 151 152 153 154 155 15. 157 158 159 ,.0 ,., ,.2 ,.3 164 ,.5 .. , ,.7 ,.8 1" 170 171 172 173 174 175 17. 177 178 179 180 181 182 1B3 1B4 185 18. 187 1-2 VersIon 2.00 06-[ 0-85 PAGE I - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - --- ; OUTPUT AH = STATUS OF CURRENT OPERATION STATUS BITS ARE DEFINED IN THE EQUATES BELOW CY = a SUCCESSFUL OPERATION (AH=O ON RETURN) CY = I FAILED OPERATION (AH HAS ERROR REASONI ; I ,, , ,,, ERROR t IH INO[CATES THAT THE DATA READ HAD A RECOVERABLE ERROR WHICH WAS CORRECTED BY THE ECC ALGORITHM. THE DATA IS PROBABLY GOOD, HOWEVER THE BIOS ROUTINE INDICATES AN ERROR TO ALLOW THE CDNTROLLI NG PROGRAM A CHANCE TO DEC I DE FOR ITSELF. THE ERROR MAY NOT RECUR IF THE DATA IS REWR ITTEN. NOTE: ,, IF DRIVE PARAMETERS WERE REQUESTED tDL >= BaH), INPUT: (DL) = DRIVE NUMBER OUTPUT = (DL I = NUMBER OF CONSECUT I VE ACKNOWLEOG I NG OR I VES A TT ACHED (CONTROLLER CARD ZERO TALLY ONLY) (CH) = MAXIMUM USEABLE VALUE FOR HEAD NUMBER (CH) :: MAXIMUM USEABLE VALUE FOR CYLINDER NUMBER (CL) = MAX [MUM USEABLE VALUE FOR SECTOR NUMBER AND CYLINDER NUMBER HIGH BITS ,,, ,,, 1 , ( 1-2) IF READ DASD TYPE WAS REQUESTED, = - NOT PRESENT - 0 I SKETTE - NO CHANGE LINE AVA I LABLE - DISKETTE - CHANGE LINE AVAILABLE - FIXED DISK CX, OX = NUMBER OF 512 BYTE BLOCKS WHEN AH = 3 AH 0 t 2 3 REG I STERS WILL BE PRESERVED EXCEPT WHEN THEY ARE USED TO RETURN INFORMATION. NOTE: ; OOFF OOEO OOCC 008B OOAA 0080 0040 0020 00 I I 00 t 0 OOOB OOOA 0009 0007 0005 0004 0002 000 I I F AN ERROR I S REPORTED BY THE 0 I SK CODE, THE APPROPR I ATE ACTION IS TO RESET THE DISK, THEN RETRY THE OPERATION. - -- - - - -- -- - - -- - - - - - -- - - - - - - - ---- ----- - ---- - - -- -- -- --- -- ----- -- -- - - --- - - - -- ---- SENSE FAIL NO ERR WRTTE FAULT UNDEF-ERR NOT RDY TIME OUT BAD SEEK BAD - CNTLR DATA CORRECTED BAD ECC BAD-TRACK BAD-SECTOR DMA -BOUNDARY INIT FAIL BAD RESET RECORD NOT FND BAD ADDR MARK BAD::::CMD - EQU EQU EQU EQU EQU EQU EQU EQU fQU EQU EQU EQU EQU EQU EQU EQU EQU EQU OFFH OEOH OCCH OBBH OAAH BOH 40H 20H l1H IOH 08H OAH 09H 07H 05H 04H 02H OIH NOT IMPLEMENTED STATUS ERROR/ERROR REGISTER=O WR I TE F AUL T ON SELECTED DR I VE UNDEF I NED ERROR OCCURRED DR I VE NOT READY ATTACHMENT FAILED TO RESPOND SEEK OPERATION FAILED CONTROLLER HAS FAILED ECC CORRECTED DATA ERROR BAD ECC ON 0 I SK READ NOT IMPLEMENTED BAD SECTOR FLAG DETECTED DATA EXTENDS TOO FAR DR I VE PARAMETER ACT I V J TY FA I LED RESET FA I LED REQUESTED SECTOR NOT FOUND ADDRESS MARK NOT FOUND BAD COMMAND PASSED TO DISK I/O FIXED DISK PARAMETER TABLE +0 +2 +3 +5 +7 +8 +9 +12 +14 +t5 THE TABLE (1 (I (1 (I (1 (I 1 S COMPOSED OF A BLOCK DEF I NED AS: MAXIMUM NUMBER OF CYLINDERS MAXIMUM NUMBER OF HEADS NOT USED{SEE PC-XT STARTING WRITE PRECOMPENSATION CYL MAXIMUM ECC DATA BURST LENGTH CONTROL BYTE BIT 7 DISABLE RETRIES -ORBIT 6 OJ SA8LE RETRIES B JT 3 MORE THAN 8 HEADS (3 BYTES)- NOT USEO{SEE PC-XT (1 WORD) -LANDINGZONE (1 BYTE) - NUMBER OF SECTORS/TRACK (1 8YTE) - RESERVED FOR FUTURE USE - WORD) BYTE) WORD) WORD) BYTE) BYTE) - TO DYNAMICALLY DEFINE A SET OF PARAMETERS 8UILD A TABLE FOR UP TO 15 TYPES AND PLACE THE CORRESPOND I NG VECTOR I NTO INTERRUPT 4 t FOR DR [VE a AND INTERRUPT 46 FOR DR I VE 1. DISK 5-117 IBM Personal Computer MACRO Assembler OISK ----- 06/10/85 FIXEO DISK 810S 188 18. ,.0 06-10-85 PAGE ,--- - ---- - ---- - - ---- - -- - - -- -- -- - - - - - - -- - - - -- - - - - - - - - - - -,, ,, ; ,., ; ,.2 '.3 I •• ,.5 I •• HARDWARE SPECIFIC VALUES CONTROLLER 110 PORT I > WHEN READ FROM: ; ,., ,.8 I •• 200 20 I 202 203 20. 205 20. 201 208 20. 210 211 212 213 21. 215 21. 211 218 21. 220 221 222 223 22. 225 22. 227 228 22. 230 231 232 233 23. 235 23. 231 238 23. 2.0 2., 2.2 2'3 2 •• 2.5 24. 2., 2.8 2 •• 250 251 252 253 25. 255 25. 251 258 25. 2.0 261 2.2 2.3 2 •• 2.5 2 •• 2., 268 2 •• 1-3 Version 2.00 HF PORT"O HF-PORT ... I HF-PORT ... 2 HF-PORT"3 HF-PORT"4 HF-PORT ... 5 HF-PORT"'6 HF=PORT .. 7 ; ; , , ; ; - READ DATA (FROM CONTROLLER TO CPU) GET ERROR REGISTER GET SECTOR COUNT GET SECTOR NUMBER GET CYLINDER LOW GET CYLINDER HIGH (2 8ITS) GET SIZE/DR I VE/HEAO GET STATUS REGISTER ; > WHEN WR I TTEN TO: ; , ,, , HF PORT"O HF-PDRT"I HF-PORT"'2 HF-PORT .. 3 HF-PORT"4 HF-PORT ... 5 HF-PORH6 HF=PORT .. 7 ; ; - WRITE DATA (FROM' CPU TO CONTROLLER) SET PRECDMPEN5ATlDN CYLINDER SET SECTOR COUNT SET SECTOR NUMBER SET CYL I NDER LOW SET CYLINDER HIGH (2 8ITS) SET SIZE/DRIVE/HEAD SET COMMAND REG I STER ,--- - ---- - --- - -- - - - - - - - - - - - - - - - - - - --- - - - - - - - - - -- - - -- ---; ; OIFO 03F6 HF PORT HF=REG_PORT EQU EQU = 000 1 = = = = 0004 0008 0010 0020 0040 0080 ST ERROR 5T-INDEX ST-CORRCTO ST-oRQ ST-SEEK COMPL ST-WRT FL T ST-READY ST=eUSY EQU EQU EQU EQU EQU EQU EQU EQU 0001 0002 0004 ERR DAM ERR-TRK 0 ERR=A80RT 01FOH 03FbH ; DISK PORT STATUS REGISTER = 0002 = = ; = = ----- 0010 iRR 0040 0080 iRR DATA ECC ERR=8AD_BLOCK 0010 0020 0030 0040 0050 0060 0070 0090 0091 0001 0002 0008 RECAL CMD READ eMD WRITE CMD VERIFY CMD FMTTRK-CMO INIT cK10 SEEK-CMD DIAG-CMD SET PARM CMD NO RETRIES ECe MODE 8UFFER_MODE EQU EQU EQU EQU EQU EQU EQU EQU EQU EQU EQU EQU 0002 0002 ECC CORRECT I ON SUCCESSFUL SEEK COMPLETE WRITE FAULT ERROR REG ISTER EQU EQU EQU EQU EQU EQU EQU EQU 10 000000018 000000 I 08 00000 1 008 0000 I 0008 000 100008 00 I 000008 010000008 100000008 0000000 18 000000 I 08 00000 I 008 0000 I 0008 000 I 00008 001000008 a I 0000008 100000008 DATA ADDRESS MARK NOT FOUND TRACK 0 NOT FOUND ON RECAL A80RTED COMMAND NOT USED 10 NOT FOUND NOT USED 000 I 00008 001000008 00 [ [00008 010000008 010100008 011000008 011100008 100 1 OOOOB 100100018 0000000 I 8 000000108 000010008 DR [VE RECAL READ WRITE VERIFY FORMAT TRACK INITIALIZE SEEK DIAGNOSTIC DR I VE PARMS CMD MODIFIER CMD MODIFIER CMD MODIFIER 25H (10H) (20H) (30H) (40H) (50H) (60H) (70H) (90H) (9IH) (0 [H) (02H) (08H) MAX FILE S_~'(AX_F I LE EQU EQU = 0025 = 0600 = 0100 DELAY I DELAY-2 OELAY::::3 EQU EQU EQU 0600H OIOOH DELAY FOR OPERATION COMPLETE DELA Y FOR READY DELAY FOR DATA REQUEST = HF_FAIL EQU 08H CMOS FLAG IN BYTE OEH ; ----- COMMAND BLOCK REFERENCE 0008 5-118 EQU DISK 8YTE PTR (BPJ-8 (lCMD BLOCK REFERENCES BLOCK HEAD IN SS (BPT PO I NTS TO COMMAND BLOCK TAl L AS DEFINED BY THE "ENTER" PARMS IBM Personal Computer MACRO Assembler D]SK ----- 06/10185 F]XED D]SK BIOS 1-4 Version 2.00 Ob-IO-85 270 211 272 273 274 215 PAGE ; ----------- --- -- -- - - -- - - - - - ------------ ---- --------------------; FIXED DISK I/O SETUP 278 219 280 281 282 283 284 285 28. 287 288 289 290 291 292 293 294 295 296 297 298 299 300 30 I 302 303 304 305 30. 307 308 309 310 311 312 313 314 315 31. 311 318 319 320 321 322 323 ; ; ; 2" 211 324 325 32. 327 328 329 330 331 332 333 334 335 33. 337 338 339 340 341 342 343 344 345 34. 347 348 349 350 351 352 353 354 355 35. 351 358 359 3.0 3.' 3.2 3.3 364 3.5 3 •• 3.7 3.8 3.9 370 311 312 373 374 375 37. 311 378 379 380 381 382 383 - ESTABLISH TRANSFER VECTORS FOR THE FIXED DISK PERFORM POWER ON 0 I AGNOST [CS SHOULD AN ERROR OCCUR A "1101" MESSAGE [S D]SPLAYED ------- - - -- - --------- - - - ------------------- ---- -------- --------ASSUME 0000 0000 0001 0004 0006 0009 OOOC OOOF 0012 0018 ODIC 0022 0026 002C 0030 0036 0031. 003C 003E 0040 0042 0044 0046 0048 FA B8 8E AI A3 AI 1.3 Cl 8C Cl 8C Cl BC Cl 8C E4 24 EB E6 E4 24 Ea E6 DISK SETUP CLI ---- R D8 004C R DIDO R 004E R 0102 R 06 004C DE 004E 06 0108 OE 0101. 06 0104 DE 0106 06 0118 OE 01 II. AI BF 00 AI 21 FB 00 21 R R R R R R R R 06CD R 0000 E 0000 E 004B 004C 0040 0050 0055 0051. 005F 0061 0064 0066 0068 0061. 0060 0060 0010 0012 0015 0017 0011. Q07F 0081 0084 IE 01 E8 C6 C6 C6 BO E8 81. 24 74 E9 $.2 INTBOI.AL AL,INTAOI AL,OFBH "2 STI ASSUME PUSH OS :OATA, ES: ASSO "OV "OV GET ABSOLUTE SEGMENT SET SEGMENT REG I STER GET 0 I SKETTE VECTOR INTO INT 40H F I XED 0 I SK HANDLER F I XED 0 I SK INTERRUPT PARM TABLE DR I VE 80 PARM TABLE DRIVE 81 SECOND INTERRUPT CH I P LET I NTERRUPTS PASS THRU TO SECOND CHIP J"P OUT POP CALL "OV INTAOI,AL OS ES 005 1II0lSK STATUS I ,0 IPHF NOM,O PCONTROL BYTE. 0 MOVE ABSO PO]NTER TO EXTRA SEGMENT PO INTER ESTABL [SH DATA SEGMENT RESET THE STATUS INDICATOR ZERO NUMBER OF F I XED DISKS "OV CALL ~~o~M~~Agl AG+NM I "OV J"P AH,AL AL,BAD BAT+BAD CKSUM LI POD_DONE ANO "OV CALL AH,NOT HF FAIL AL,CMOS DIAG+NMI CMOS WRITE ALLOW FIXED DISK WRITE IT BACK "OV CALL ~~o~M~~Ag I SK+NM I "OV IIIPORT OFF, 0 BL,AL AX,OOOFOH POD_DONE ZERO CARD OFFSET SAVE FIXED DISK BYTE GET FIRST DRIVE TYPE AS OFFSET NO FIXED DISKS ANO JZ CHECK CMOS VALIDITY SAVE CMOS FLAG CHECK FOR VAL I 0 CMOS CMOS NOT VALID -- NO FIXED DISKS LI: BO E4 F7 BO 8E E8 0000 E BO 92 E8 0000 E C6 06 0071 R 00 81. DB 25 ODFO 14 72 "OV ANO JZ e"p 0086 3C FO 0088 75 10 008A 008C 008F 0091 0093 0095 0091 009A 0091. 009D 001.1 001.6 001.8 OOAB 001.0 J"P OUT IN 0000 E 06 0014 R 00 06 0015 R 00 06 0076 R 00 8E 0000 E EO CO 03 OOFB R NEAR ANO ANO 0041. FB PROC AX,ABSO DS,AX AX, WORD PTR IPORG VECTOR WORD PTR 1110 I SK VECTOR, AX AX,WORD PTR 1II0RG VECTOR+2 WORD PTR IPDISK VECTOR+2,AX WORD PTR 1II0RG VECTOR,OFFSET 0] SK 10 WORD PTR 1II0RG-VECTOR+2,CS WORD PTR IIIHDISK INT ,OFFSET HD INT WORD PTR IIIHDISK-INT+2,CS WORD PTR IIIHF TaL VEC ,OFFSET FO TBL WORD PTR IIIHF-TBL-VEC+2 ,CS WORD PTR IIIHFT TBC VEC, OFFSET FD TBL WORD PTR Il'HF I-TBL-VEC+2. CS AL, I NTBO I ; TURN ON AL,OBFH "OV "OV "OV "OV "OV "OV "OV "OV "OV "OV "OV "OV "OV "OV IN 011.9 R WORK OFF OS REG [STER CS:CODE,DS:ABSO BO E8 3C 74 3C 17 CI 99 0000 E 00 65 2F 61 EO 04 L2 "OV CALL ~~o~M~~Ag I SK_' e"p JE e"p JA SHL CHECK FOR EXTENDED DR I VE TYPE BYTE USE USE DRIVE TYPE I --> 14 IF NOT IN USE AL,OFOH JNE lPL +NM I AL,OFOD DONE AL,41 POD DONE AX,4 GET EXTENDED TYPE FOR OR I VE C: FROM CMOS I S TYPE SET TO ZERO EXIT IF NOT VALID AND NO FIXED DISKS ]S TYPE WITHIN VALID RANGE EXIT WITH NO FIXED DISKS [F NOT VALID ADJUST TYPE TO HIGH NIBBLE L2: 05 FFFO E 26: A3 0104 R C6 06 0075 R 01 8A C3 CO EO 04 74 2A B4 00 AOO "OV "OV "OV SHL JZ MOV AX,OFFSET FD TBL-16D WORD PTR IPHF-TBL VEC, AX !PHFNUM,! AL,8L AL,4 SHORT L4 AH,O COMPUTE OFFSET OF FIRST DRIVE TABLE SAVE IN VECTOR POINTER AT LEAST ONE DRIVE GET SECOND DR I VE TYPE ONLY ONE DRIVE OOAF 3C FO OOBI 75 10 e"p AL,OFOH L3 CHECK FOR EXTENDED DR I VE TYpE BYTE USE USE DRIVE TYPE I --> 14 IF NOT IN USE 00B3 00B5 00B8 0081. OOBC OOBE OOCO 00C3 00C3 00C6 00C8 OOCC OOCE 0002 0007 0007 0009 OOOB 0000 OODF 00E2 00E4 OOEl 00E9 OOEC OOFf 00F3 OaFS 00F8 00F8 BO 9A E8 0000 E 3C 00 MOV CALL ~~o;M~~Ag [SK_2+NM I 14 18 JE eMP JA AL,OL4 AL,47 L4 AX,4 GET EXTENDED TYPE FOR DR I VE 0: FROM CMOS I S TYFE SET TO ZERO SKIP IF SECOND FIXED DISK NOT VALID IS TYPE WITHIN VALID RANGE SKIP IF NOT VALID ADJUST TYPE TO HIGH NIBBLE ~;:~~FSET FD_TBL-16D COMPUTE OFFSET FOR SECOND FIXED DISK JNE e"p 3C 2F 71 17 CI EO 04 as FFFO E 8B 08 2E: 83 3F 00 74 09 26: A3 0 I 18 R C6 06 0075 R 02 SHL L3: AOO MOV eMP JE "OV L4: 82 B4 CD 72 AI 88 05 BB E8 80 76 B2 E8 C3 80 14 f3 fA 006C R 08 0444 C8 0104 R 3E 0075 R 0 f 05 81 0104 R "OV "OV "OV INT Je "OV "OV AOO "OV CALL e"p JBE "OV CALL POD DONE: RET WORD PTR CS:(BX],O ; CHECK FOR ZERO CYLINDERS IN TABLE L4 ; SKIP DRIVE IF NOT A VALID TABLE ENTRY WORD PTR IIIHF I TBL VEC, AX @HF_NUM,2 TWO DRIVES DL,80H AH,14H 13H CTL ERR X AX. 'iTi MER LOW 8X,AX AX,b-182 CX,AX HD RESET I PHF NUM,I FaD-DONE DL.8IH HD_RESET_I CHECK THE 'CONTROLLER USE CONTROLLER DIAGNOSTIC COMMAND CALL BIOS WITH DIAGNOSTIC COMMAND DISFLAY ERROR MESSAGE IF BAD RETURN GET START TIMER COUNTS 60 SECONDS- 18.2 SET UP DRIVE 0 WERE THERE TWO DR I VES? NO-ALL DONE SET UP DRIVE 1 DISK 5-119 IBM Personal Computer MACRO Assembler DISK ----- 06/10/85 FIXED DISK BIOS 384 385 386 381 388 389 390 391 392 393 394 395 396 391 398 399 400 401 402 403 404 405 406 401 408 409 410 411 412 413 414 415 416 411 418 419 420 421 422 423 424 425 426 421 428 429 430 431 432 433 434 435 436 431 438 439 440 441 442 443 444 445 446 441 448 449 450 451 452 453 454 455 456 451 1-5 Version 2.00 Ob-IO-85 ; ----- POD ERROR 00F9 OOF9 OOFC OOFF 0102 8E 0000 E E6 0 I 1C R EB 0000 E E6 F4 0104 0104 53 0105 51 010684 09 0108 CD 13 OIOA 72 06 OIOC 8411 010E CD 13 01101319 0112 E8 018A R 011513EF 0117 BE 0000 E I I A F6 C2 01 o lID 75 51 OIIF 8E 0000 E 0122 E8 0!1C R 0125 E8 4F 01218400 0129 CD 13 012884 08 0120 8A DA 0!2F CD 13 0131 1238 013389 OE 0042 R 0137 8A D3 0139 B8 0401 013C CD 13 013E 13 39 014080 FC OA 01437434 0145 80 FC II 0148 14 2F 014A 80 FC 10 014D 74 2A Ot4F E6 018A R 0152 12 11 0154 88 OE 0042 R 0158 8A CI o 15A 24 3F 015C FE C8 015E 14 C1 016080 EI CO 0163 OA C8 016589 OE 0042 R 0169 E8 CE 0168 BE 0000 E o 16E F6 C2 0 I 0171 15 03 0173 BE 0000 E 0176 0176 E8 0000 E 0179 0119 59 011A 58 o 1T8 C3 o 11C o OITC 011C 011F 0182 0184 0186 0189 018A 88 E8 OC 86 E8 C3 8E8E 0000 E 08 EO 0000 E CTL ERR X ~ MOV CALL CALL JMP HD RESET 1 PUSH PUSH = MOV RES_' 1NT Je Mav 1NT JNe CALL JNe RES_FL: MOV TEST JNZ RES_21 Mav CALL JMP RES_RS: MOV 1NT RES_CK ~ MOV Mav 1NT Je Mav RES_31 MOV MOV 1NT JNe eMP JE eMP JE eMP JE CALL Je MOV MOV AND DEe JZ AND OR RES_ER: MOV JMP MOV TEST JNZ MOV SI,OFFSET FI182 SET FAIL E MSG POD_DONE PRDC 8X CONTROLLER ERROR DO NOT IPL FROM DISK 01 SPLA Y ERROR AND SET (BP) ERROR FLAG NEAR SAVE TIMER LIMITS ex AH,09H 13H RES 2 AH,lIH 13H RES CK POD-TCHK RES-I 51 ,OFFSET FITal DL, I RES EI SI,OFFSET FI180 SET FAIL SHORT RES EI AH,OOH 13H AH,08H BL,DL 13H RES ER WORD PTR IfINEC STATUS,CX DL,8L AX,0401H 13H RES OK AH, SAD SECTOR RES OKAH,OATA CORRECTED RES OK AH,BAD ECC RES OKPOD-TCHK RES-ER CX,WORD PTR @NEC STATUS AL ,CL AL,3FH AL RES RS CL,OCOH CL,AL WORD PTR @NEC STATUS,CX RES 3 51 ,OFFSET FI191 DL,I RES EI 51 ,OFFSET F1T90 SET DR I VE PARAMETERS RECALl BRATE DR I VE DRIVE OK CHECK T I ME OUT INDICATE DISK 1 FAILURE INDICATE OISK 0 FAILURE DO NOT TRY TO IPL DISK 0 RESET THE DR I VE GET MAX CYLI NDER. HEAD, SECTOR SAVE DR I VE CODE SAVE MAX CYLINDER, SECTOR RESTORE DR I VE CODE VERIFY THE LAST SECTOR VERIFY OK OK ALSO IF JUST 10 READ CHECK FOR TIME OUT FAILED GET SECTOR ADDRESS, AND CYLINDER SEPARATE OUT SECTOR NUMBER TRY PRE V I OUS ONE WE'VE TR I EO ALL SECTORS ON TRACK KEEP CYLINDER BITS MERGE SECTOR WITH CYLINDER BITS SAVE CYL I NDER, NEW SECTOR NUMBER TRY AGAIN INDICATE DISK 1 ERROR INDICATE DISK 0 ERROR RES_El : CALL DISPLAY ERROR AND SET (SP) ERROR FLAG RES_OK: POP POP RET HD_RESET_I SET FAIL MOV CALL OR XCHG CALL RET RESTORE TIMER LIMITS ENDP PROC NEAR AX,X·(CMOS DIAG+NMI) CMOS READ AL,HF FAIL AH, ALCMOS_WR I TE SET_FAIL ENDP POD TCHK POP POP PDP PUSH PUSH PUSH MOV PROC NEAR AX GET CMOS ERROR BYTE SET DO NOT I PL FROM 0 I SK FLAG SAVE IT PUT IT OUT 458 459 460 461 402 463 464 465 466 461 468 469 4TO 411 412 413 414 415 416 411 418 419 480 481 482 483 484 485 018A o 18A 0188 o 18C o 18D 018E o 18F 0190 58 59 58 53 51 50 AI 006C R 0193 38 0195 12 019138 0199 T2 0198 E8 0190 3B 019F 12 OIAI 38 01A3 12 01 A5 01 A6 01AT 01 A8 01 A9 D9 06 D8 OC 04 C3 04 CI 02 F9 C3 Fa C3 ,= TCHKNG: TCHKG: AX AX,0TIMER_LOW ex,cx TCHK I eX,AX TCHKG SHORT TCHK2 AX,BX TCHKNG AX,CX TCHKG STC RET DISK AND SAVE THEM AGAIN RESTORE RETURN AX ::: CURRENT T I ME BX START TI ME CX END TIME START < END END < START < CURRENT END, CURRENT < START CURRENT < START < END START < CURRENT < END OR CURRENT < END START CARRY SET I NO I CATES T I ME OUT INDICATE STILL TIME CLC RET 01 A9 5-120 TCHK BX 8X J8 J8 JMP CMP J8 CMP J8 CHECK FOR 30 SECOND TI ME OUT SAVE RETURN GET TIME OUT LIMITS ex eMP eMP TCHK2: ex POD_ TCHK ENDP 01 SK_SETUP ENOP IBM Personal Computer MACRO Assembler DISK ----- 06/10/85 FIXED DISK 8105 486 PAGE 487 488 489 ; 492 493 494 495 49b 497 498 499 500 501 502 503 504 505 SOb 507 508 509 SID 511 512 513 514 515 51 b 517 518 519 520 521 522 523 524 525 52b 527 528 529 530 531 532 533 534 535 53b 537 538 539 540 541 542 543 544 545 54b 547 548 549 550 551 552 553 554 555 55b 557 558 559 5bO 5bl 5b2 5b3 5b4 5.5 5bb 5b7 5b8 569 510 571 572 573 574 575 57b 577 578 579 580 581 582 583 584 585 58. 587 588 589 590 591 592 593 594 595 59b 597 598 599 I-b 06-10-85 .----- ---------- --------------- ---------FIXED DISK BIOS ENTRY POINT ; ------ - - - ------------------- -- ---------- 490 491 Version 2.00 01 A9 DISK - 0lA9 01 AC OIAE OIBO 0190 0193 0lB3 0lB4 0lB6 0lB8 OIBA OIBC OIBF OICI OICI 0lC4 0lC6 0lC9 OICC OICE 0101 0101 a ID5 0106 0101 0108 0109 o IDA OIDB OIOC OIOE OlEO 0lE2 0lE5 0lE8 OIEC OIEF 01FO OIFI 01 F2 0lF3 0lF4 01 F5 01 F6 01 F7 OlF8 OIFB 80 FA 80 13 05 CO 40 CA 0002 10 PROC ASSUME eMP JAE INT FAR OS ;OATA, ES: NOTH I NG DL,eOH TEST FOR FIXED DISK DRIVE YES, HANDLE HERE DISKETTE HANDLER AI 40H BACK TO CALLER RET AI: 5TI FB OA 75 CO 2A 80 77 E4 09 40 E4 FA 81 EF 80 75 E9 80 75 E9 FC 08 03 0393 R FC 15 03 0353 R C8 53 51 52 IE 06 56 51 OA 15 62 E8 E8 8A 80 F5 5F 5E 07 IF 5A 59 56 C9 CA 0008 00 ENABLE OR JNZ I NT SUB CMP JA AH,AH A2 40H AH,AH DL, {80H + S_MAX_FILE RET_2 eMP JNZ JMP eMP JNZ JMP AH,08H A3 GET PARM N AH,T5H A4 READ_DASD_TYPE INTERRUPTS RESET NEC WHEN AH=O II A2: A3: A4: E4 02 80 0225 R 0000 E 26' 0014 R FC 01 0002 OIFB OIFB 02CI OIFD 0315 OIFF 031E 020 I 0325 0203 032C 0205 033E 0207 02B9 0209 02B9 0208 02B9 0200 03FI 020F 0423 0211 042A 0213 0431 0215 02CI 0217 02B9 02 \ 9 0289 0216 044F 0210 0466 021 F 02B9 0221 02B9 0223 048E 002A ENTER PUSH PUSH PUSH PUSH PUSH PUSH PUSH OR JNZ MOY CALL CALL MOY eMP eMe POP POP POP POP POP POP POP LEAVE RET DISK_IO ENDP A5: R R R R R R R R R R R R R R R R R R R R R 0225 0225 E8 0000 E 022880 FC 01 022B 75 03 0220 E9 0315 R 0230 0230 C6 06 0074 R 00 0235 53 0236 8A IE 0075 R 023A 50 023B 80 E2 7F 023E 3A DA 0240 76 15 0242 06 0243 E8 06B7 R 0246 26: 8B 41 05 024A CI E8 02 0240 88 46 F8 0250 26: 8A 47 08 0254 52 0255 BA 03F6 0258 EE 0259 5A 025A 07 025B 8A 26 0016 R 025F 80 E4 CO 0262 OA EO 0264 88 26 0076 R 0268 58 0269 88 46 F9 026C 50 0260 8A CI 026F 24 3F MIL LABEL OW OW OW OW OW OW OW OW OW OW OW OW OW OW OW OW OW OW OW OW OW EQU DISK_IO CONT -CALL eMP JNZ JMP SUO: MOV PUSH MOV PUSH AND CMP JBE PUSH CALL MOV SHR Mav MOV PUSH MOV OUT POP POP MOV AND OR MOV POP MOV PUSH MOV AND 8, GET PARAMETERS I S A SPEC I AL CASE READ DASD TYPE I S ALSO SAVE REGISTERS DURING OPERATION SAVE (BPI AND MAKE ROOM FOR @CMD BLOCK IN THE STACK. THE COMMAND BLOCK-IS: peMD_BLOCK BYTE PTR [BPj-8 a BX == ex ox OS E5 5I 01 AH,AH CHECK FOR RESET AS DL,80H DISK 10 CONT DDS AH,@DISK STATUS I AH,I - 01 51 FORCE OR I VE 80 FOR RESET PERFORM THE OPERATION ESTABL I SH SEGMENT GET STATUS FRaM 'OPERATION SET THE CARRY FLAG TO I NO I CATE SUCCESS OR FAILURE RESTORE REGISTERS E5 OS ox ex BX ADJUST (SP I AND RESTORE THROW AWAY SAVED FLAGS WORD D [SK RESET RETURN STATUS 01 SK READ DISK-WRITE 01 SK-VERF FMT TRK BAD-COMMAND BAD-COMMAND BAD-COMMAND INIT DRV RD LONG WR-LONG DISK 'SEEK 01 SK-RESET BAD COMMAND BAD-COMMAND TST-RDY HDISK RECAL BAD COMMAND BAD-COMMAND CTLR D I AGNOST I C $-MIPROC FUNCT OOOH 00 I H OOZH 003H 004H 005H 006H 001H 008H 009H OOAH OOBH OOCH OODH OOEH OOFH o IOH o IIH OIZH 013H Ol4H (BP) [ON TRANSFER TABLE FORMAT BAD SECTORS FORMAT DR I VE RETURN PARAMETERS READ BUFFER WRITE BUFF~R MEMORY DIAGNOSTIC DRIVE DIAGNOSTIC CONTROLLER D I AGNOST I C NEAR 005 AH,O IH ESTABL I SH SEGMENT RETURN STATUS SUD RETURN_STATUS @DISK STATUSI,O 8X BL,@HF NUM AX OL,1FH BL,DL BAD COMMAND POP ES GET VEC AX,WORD PTR ES:[BX][5] AX,2 (ICMD BLOCK, AL AL,BYTE PTR ES: [BX][81 OX OX, HF REG PORT DX,AL-OX ES AH. PARAMETER BLOCK AL,ES:[BX][2] GET NUMBER OF HEADS AL CONVERT TO 0- INDEX AH,(tCMD BLOCK+5 GET SOH REGI STER AH, OFOHCHANGE HEAD NUMBER AH, AL TO MAX HEAD (tCMD BLOCK + 5, AH AL,ES:[BX][14] MAX SECTOR NUMBER II'CMO BLOCK + I • AL AX,AX (tCMD BLOCK + 3, AL ZERO FLAGS COMMAND TELL CONTROLLER INIT EXIT CONTROLLER BUSY ERROR NOT BUSY WA IT FOR IT TO BE DONE INIT EXIT TIME OUT CHECK_STATUS ENDP ; -------------------------------- -------; READ LONG 0423 RD_LONG 863 864 0423 C6 46 FE 22 0421 E9 04C6 R 042A RD_LONG MOV JMP ; ; (AH = OAH) : PROC NEAR (tCMD BLOCK+6,READ CMD OR ECC MODE COMMAND I' ENDP - -- -- - - - - -------- -- - - - ----------- --- -- -WRITE LONG 042A 042A C6 46 FE 32 042E E9 0505 R 0431 875 (AH = OBH) : NEAR PROC ~g~~A~~gCK+6.WRITE-CMD OR ECC_MODE ENDP ----- - - -SEEK - - - - - - - - - -- -- - - - - - - - - - - - - - - - ---(AH = OCH) : ; ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ---; ; 876 877 878 879 880 881 882 883 884 885 886 881 588 889 890 891 892 893 OPERATION FAILED STC JMP GET_PARM 8602 871 812 813 874 SECTORS HEADS O-N RANGE DRIVE COUNT RE7 SUB SUB SUB EA 857 8S8 8S9 860 861 8605 866 867 868 869 870 ; HIGH TWO BITS OF CYLINDER BX ES INITIALIZE DRIVE 03Fl 03Fl d3F5 03F8 03FC 03FE 0401 0404 0406 0409 0400 0410 0412 0415 0418 041A 0410 041 F 0422 0422 0423 MAX NUMBER OF CYL I NDERS ADJUST FOR O-N G4: C6 84 2A 28 28 F9 E8 834 83S 831 836 639 840 841 842 843 844 845 TEST WITHIN RANGE G5: 58 833 8360 I TBL_ VEC 0431 0431 0435 0438 043A 0430 043F 0442 0441 0449 044E 044E C6 E8 75 E8 75 E8 80 75 C6 46 FE 10 054F R 14 0585 R OF 0623 R 3E 0014 R 40 05 06 0074 R 00 "NZ CALL "NZ CALL eMP "NE MOV PROC NEAR @CMD 8LOCK+6.SEEK CMO COMMAND OS EXiT WATT OS EXIT CHECK STATUS IDOl SK-STATUS I ,BAD SEEK OS EXIT IDDISK_STATUS 1,0 OS EXIT: RET C3 044F 5-124 DISK SEEK MOV CALL DISK_SEEK DISK ENDP CONTROLLER BUSY ERROR T I ME OUT ON SEEK [8M Personal Computer MACRO Assembler o[SK ----- 06/10/85 FIXED DISK 8105 894 895 PAGE 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 911 918 919 920 921 922 923 924 925 926 921 928 929 930 931 932 ; ; 044F 044F 0452 0454 0451 045A 0458 045E 0460 0465 0466 E8 75 8A SA EE E8 75 C6 C3 11 46 FD 01 F6 0635 R 05 06 0014 R 00 ; C6 E8 75 E8 14 E8 75 46 FE 10 054F R 19 0585 R 05 0585 R OF E6 80 15 C6 0623 R 3E 0014 R 40 05 06 0074 R 00 80 3E 0014 R 00 C3 TEST 0' SK READY TST ROY PROC CALL JNZ MOV MOV OUT CALL JNZ MOV TR EX: RET TST_RDY ENDP ; 0466 0466 046A 0460 046F 0412 0474 0477 0479 0419 047C 048[ 0483 0488 0488 0480 048E ----- 1-10 06-10-85 Version 2.00 (AH FA E4 24 E8 E6 E4 24 EB E6 F8 E8 15 8A 80 EE E8 84 15 8A EC A2 84 3C 74 84 AI 8F 00 AI 21 FB 00 21 WA [T FOR CONTROLLER SELECT OR J VE CHECK STATUS ONLY WIPE OUT DATA CORRECTED ERROR --------------------------------RECALl8RATE (AH = [IH) : - - -- -- ------------- -------- ---- - - -- - --- HDISK RECAL MOV CALL JNZ CALL JZ CALL JNZ RECAL X: CALL CMP JNE MOV RECAL EXIT: CMP RET HD[SK_RECAL ; ; 048E 048E 048F 0491 0493 0495 0497 0499 0498 0490 049F 04AO 04A3 04A5 04A8 04AA 04A8 04AE 04BO 0482 0485 0486 0489 0488 0480 04BF 04C 1 04C1 04C5 04C6 : NEAR NOT BUSY TR EX AL -;-Q!lCMD BLOCK -t 5 DX,HF PORT-+6 OX ,ALCHECK ST TR EXQ!lDTsK_STATUS1,O PROC NEAR <:!ICMD 8LOCK-+6,RECAL CMD COMMAND RECAL EX I T WAIT RECAL X WAIT RECAL_EXIT SEEK NOT COMPLETE IS OK Q!lOISK_STATUS1,O ENDP CONTROLLER DIAGNOSTIC (AH -- ---- ---------------- --- - - -- CTLR 0 I AGNDST I C CLI IN ANa JMP OUT IN ANa J"P OUT START THE OPERAT[ON ERROR WA I T FOR COMPLET I ON TIME OUT ONE OK ? WAIT FOR COMPLETION LONGER TIME OUT TWO TIMES IS ERROR CHECK STATUS olIDISK-STATUS1,8AD SEEK RECAL -EX [T @OISK::::STATUS1,O 933 934 935 936 931 938 939 940 941 942 943 944 945 946 941 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 914 975 976 917 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 = 10H) PROC = 14H) : NEAR AL,INTBOI AL.08FH D[SA8LE INTERRUPTS WH[LE CHANGING MASK TURN ON SECOND INTERRUPT CH I P $,2 INT80l,AL AL.INTAOI AL.OF8H ',2 LET I NTERRUPTS PASS THRU TO SECOND CH IP INTAOI,AL 5T I 05E6 R 1A 01 F7 90 CALL JNZ "OV MOV OUT CALL "OV JNZ "OV IN "OV "OV CMP JE MOV 05E6 R 80 OF 0 IF 1 0080 R 00 01 02 20 88 26 0074 R C3 NOT 8USY CD ERR DX-;-HF PORT -+ 7 AL,DIAG CMD OX, AL NOT 8USY AH,TIME OUT CD EXITDX-;-HF PORT -t 1 AL,DX@HF ERROR, AL AH,O AL,I SHORT CD EX I T AH,8AD_CNTLR WA I T FOR CARD 8AD CARD ST ART DIAGNOSE WA I T FOR I T TO COMPLETE TIME OUT ON DIAGNOSTIC GET ERROR REG I STER SAVE IT CHECK FOR ALL OK CD ERR: CD-EX IT: MOV @DISK_STATUSI,AH RET CTLR_DIAGNOSTIC ENOP .-------- - - - - - -- -----------------; 04C6 04C6 04C9 04C8 04CO 0400 0402 0402 0405 0407 040A 0400 04DE 04DF 04El 04E2 04E6 04E8 04E8 04EO 04FO 04F3 04F4 04F1 04F8 04FA 04FO 04FF 0502 0504 0504 0504 COMMAND I REPEATEDL Y J NPUTS OAT A TILL NSECTOR RETURNS ZERO ~;~~~~~~~----E8 72 88 E8 75 0694 R 39 F8 054F R 32 E8 0585 R 75 20 89 0100 8A OIFO FA FC F3/ 60 F8 F6 46 FE 02 14 12 E8 0600 R 72 17 8A 01 FO 89 0004 EC 26: 88 05 47 E2 F9 E8 0623 R 75 05 FE 4E F9 75 CE C3 CALL JC "OV CALL JNZ CHECK DMA CMD ABORT OJ ,BX COMMAND CMD_A80RT CHECK 64K 80UNDARY ERROR CALL JNZ MOV "OV WAIT TM OUT CX-;-256D DX,HF _PORT WA I T FOR DATA REQUEST TIME OUT SECTOR SIZE IN WORDS OUTPUT COMMAND INTERRUPT CLI CLO REP INSW GET THE SECTOR @CMD BLOCK-t6 I ECC MODE CMD 13 WA [T ORQ TM OOT DX-;-HF PORT CX , 4 AL,DX ES:8YTE PTR [01] ,AL 01 CMD [2 CHECK STATUS CMO ABORT DISK PARMS SUB MOV ASSUME TEST JZ LES JMP AX. AX ES,AX ES: A8S0 DL, I GV 0 BX-;-@HFI TBL VEC SHORT GV_ExTT LES BX,@HF_TBL_VEC - ~~~ - ~;~~ - - - -~~~~ - -- - - - - - -- ---- - - - ~ - -- IE 0104 R ; GET 0 I SK PARAMETER ADDRESS ES:BX -> DRIVE PARAMETERS ES: ex -> DR I VE PARAMETERS GV EXiT: RET GET _ VEC ENDP C3 ;--- HARDWARE INT F I XED 0 I SK HD_INT 50 IE E8 0000 E C6 06 008E R FF 80 20 E6 AD E8 00 E6 20 IF FB 889100 CD 15 58 CF 5-128 - - - ~~~; - -- AX AX, 8000H IrtCMo 8LOCK+6,ECC MODE CKDIAX. 1F04H AH,OltCMD BLOCK+ I CKDOKCKDERR AL,BL CKDERR PDP RET CHECK_DMA F6 C2 01 74 01 26: C4 IE 0118 R EB 05 26: PUSH MOV TEST JZ MOV CMP JA J8 CMP JB CLC PDP RET CKDERR: ~~~ 28 CO 8E CO TEST ALL 8 BITS MOVE NEXT ERROR BIT TO CARRY FOUND THE ERROR KEEP TRY I NG COMPUTE ADDRESS OF ERROR CODE GET ERROR CODE SAVE ERROR CODE NO ERR BAD ADDR MARK, BAD SEEK, BAD CMo, UNDEF ERR RECORD NOT FND, UNDEF ERR, BAD ECC. BAD-SECTOR ENDP-- ~~~~~ - ~~~- - - - - - ~~~~ 50 88 FE> 14 88 3A GET THE ERROR REG I STER 30 2F IRQ LEVEL OS ST[ "DV [NT POP IRET ----------- OS OUT PDP ""P 14) NEAR AX OUT INTAOO,AL . '2 AX,9100H I5H AX ALL DONE NON-SPECIFIC END OF FOR CONTROLLER #2 WAIT FOR CONTROLLER # 1 08 RETURN FROM '06/10/85' INTERRUPT RE-ENABLE INTERRUPTS OEV ICE POST INTERRUPT INTERRUPT ENDP ENDS END DISK ( I NTERRUPT ROUT I NE DDS iPHF I NT FLAG, OFFH AL,EOI I NTBOO, AL "DV "DV HD_INT 30 36 2F 31 3835 PROC PUSH PUSH CALL 76H -- RELEASE MARKER OFFSET IBM Persona! Computer MACRO Assembter KY8D ----- 06/10/85 KEY80ARD 810S 0000 .2 .3 •5 46 10 11 12 13 14 15 16 11 1B 19 BO BI B2 B3 54 B5 B6 B1 BB B9 90 91 92 93 9. 95 96 91 9B 99 100 101 102 103 10. 10 5 106 101 lOB 109 110 III 112 113 "' PUBLIC PUBLIC PU8LI C PUBLI C KEYBOARD 10 I KB INT 1- SND_DATA EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN BEEP:NEAR 005 :NEAR START I :NEAR KIO:BYTE KII :BYTE KI2:BYTE KI3:BYTE KI4:BYTE KI5:BYTE K6 :BYTE KbL:A8S K7:8YTE K8:BYTE K9 :BYTE KI6 I NT 16 H ------------------------ -----------------------------------------KEYBOARD I/O THESE ROUT I NES PROV I DE READ KEYBOARD SUPPORT INPUT IAH)= DOH READ THE NEXT ASCII CHARACTER ENTERED FROM THE KEYBOARD, RETURN THE RESULT I N I AL), SCAN CODE I N I AH) • IAH)= SET THE ZERO FLAG TO INDICATE IF AN ASCII CHARACTER IS AVAILABLE TO BE READ FROM THE KEYBOARD BUFFER. Izn= I -- NO CODE AVAILABLE IZF)= 0 -- CODE IS AVAILABLE IAX)= CHARACTER I F I ZF) = 0, THE NEXT CHARACTER I N THE BUFFER TO BE READ IS IN (AX), AND THE ENTRY REMAINS IN THE BUFFER. (AH)= 02H RETURN THE CURRENT SHIFT STATUS IN (AU REGISTER THE BIT SETTINGS FOR THI S CODE ARE INDICATED IN THE THE EQUATES FOR IItKB_FLAG OUTPUT AS NOTED ABOVE, ONLY (AX) AND FLAGS CHANGED ALL REGISTERS RETAINED ., .B .9 50 51 52 53 54 55 56 51 5B 59 60 61 62 63 6' 65 66 61 6B 69 Ob- 10-85 PAGE 118,121 TITLE KY8D ----- 06/10/85 KEY80ARD 8105 .LI ST SEGMENT 8YTE PUBL I C CODE 6 1 B 9 10 II 12 13 I. 15 16 IT IB 19 20 21 22 23 2. 25 26 21 2B 29 30 31 32 33 3. 35 36 31 3B 39 .0 ..., I-I Version 2.00 ASSUME 0000 0000 0001 0002 0003 0006 0008 OOOA OOOC OOOE 0010 0012 0013 0014 KEYBOARD 10 I CS:C~DE,DS:DATA PRoC F8 STI- IE 53 E8 OA 74 FE 74 FE 74 58 IF CF PUSH PUSH CALL OS BX OR AH,AH KIB 0000 E E4 08 CC 45 CC 61 "Z DEC "Z DEC "Z POP POP IRET FAR ;»> ENTRY POINT FOR ORG OE82EH I N1ERRUPTS BACK ON SAVE CURRENT OS SAVE BX TEMPORARILY ESTABLISH POINTER TO DATA REGION CHECK FOR IAHI= OOH ASC I I READ CHECK-FOR IAHI = OIH ASCI I STATUS CHECK-FOR I AHI = 02H SHIFT STATUS RECOVER REGISTER O~S AH K2 AH K3 BX OS INVALID COMMAND EXIT READ THE KEY TO FIGURE OUT WHAT TO DO 00 I 5 88 IE OOIA R 0019 38 IE ODIC R DOlO 15 01 OOIF 0022 0024 0024 0025 0026 0027 0028 002F 0030 0031 0034 003/3 003A 0030 003F 0042 0043 0044 0045 KIB: 88 9002 CD 15 "NE 8X ,Il'BUFFER HEAD BX,Il'BUFFER-TAIL KIC - GET PO I NTER TO HEAD OF BUFFER TEST END OF 8UFFER IF ANYTH I NG IN 8UFFER SK I P INTERRUPT MOV AX,09002H INT I5H MOVE IN WA I T CODE & TYPE PERFORM OTHER FUNCT I ON Ase I I READ I NTERRUPTS BACK ON OUR I NG LOOP ALLOW AN I NTERRUPT TO OCCUR I NTERRUPTS BACK OFF GET PO I NTER TO HEAD OF BUFFER TEST END OF BUFFER SAVE ADDRESS SAVE FLAG GO GET MODE INDICATOR DATA BYTE GET PREV I OUS 81 TS SEE I F ANY DIFFERENT ISOLATE INDICATOR BITS IF NO CHANGE BYPASS UPDATE MOV CMP K I: F8 90 FA 88 38 53 9C E8 8A 32 80 511 NOP K Ie: IE OOIA R IE ODIC R 0587 R IE 0097 R 08 E3 01 74 04 E8 0549 R FA 90 58 74 DO eLI MDV CMP BX ,OPBUFFER HEAD BX ,Il'BUFFER-T A I L PUSH PUSHF CALL BX MOV XDR AND "Z CALL - MAKE LED 8L,Il'K8 FLAG 2 BL,AL BL,KB LEOS KIA SND_LEDI CLI KIA: POPF POP "Z BX KI GO TURN ON MODE INDICATORS D I SA8LE INTERRUPTS RESTORE FLAGS RESTORE ADDRESS LOOP UNT I L SOMETH I NG I N BUFFER 0047 88 01 0049 E8 007F R 004C 89 IE OOIA R MOV K. MOV \!!I8UFFER _HEAD, 8X GET SCAN CODE AND ASC I I CODE MOVE POINTER TO NEXT POSITION STORE VALUE IN VARIABLE 0050 58 0051 IF 0052 CF POP POP BX OS RECOVER REGISTER RECOVER SEGMENT RETURN TO CALLER CALL IRET ASCI I 0053 0053 0054 0058 005C 005E 005F 0060 00b3 00b7 0069 OObC AX, [8X] STATUS K2: FA 88 38 8B 9C 50 E8 8A 32 80 74 CLI IE OOIA R IE OOIC R 01 MOV CMP MDV PUSHF PUSH CALL 0581 R IE 0097 R 08 E3 07 03 006E E8 0549 R 0011 5B MDV XDR AND "Z CALL SK2: POP ex ,Il'BUFFER HEAD 8X,Il'BUFFER-TA JL AX, [BX] - J NTERRUPTS OFF GET HEAD PO INTER I F EQUAL I Z= 1 I THEN NOTH I NG THERE AX MAKE LED 8L,Il'KB FLAG 2 BL,AL 8L ,K8 LEOS SK2 - SAVE FLAGS SAVE CODE GO GET MODE INDICATOR DATA 8YTE GET PREV 10US BITS SEE t F ANY 0 I FFERENT ISOLATE INDICATOR 81TS IF NO CHANGE BYPASS UPDATE SND LEDI AX - GO TURN ON MODE INDICATORS RESTORE CODE KYBD 5-129 I BM Persona I Computer MACRO Assemb I er KYBD ----- 06/10/85 KEYBOARD BIOS 115 116 117 116 119 120 121 122 123 124 125 126 127 126 129 13' 131 132 133 134 135 136 137 136 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 0072 0013 0074 0075 0076 90 FB 56 1-2 06-10-85 ion 2.00 POPF STI POP POP RET IF CA 0002 RESTORE FLAGS I NTERRUPTS BACK ON RECOVER REG I STER RECOVER SEGMENT THROW AWAY FLAGS 8X as 2 SHIFT STATUS 0079 0079 AO 0017 R 007C 5B 0070 IF 007E CF 007F K3: AL,IrtKB_FLAG 8X MOV POP POP KEYBOARD IRET 10 I - GET THE SHIFT STATUS FLAGS RECOVER REG I STER RECOVER REG I STERS RETURN TO CALLER as - ENOF I NCREMENT A BUFFER PO INTER 007F 007F 0080 0081 0085 0087 0089 008B 008C K4 FROC 43 43 3B 1E 0082 R 75 04 8B IE 0080 R NEAR 8X 8X BX, KB FLAG 3, KBX @KS-FLAG-3,SET NUM LK DO EXT -@KB FLAG,NUM STATE SND-lED SHORT EX I T INDICATE KBX WAS FOUND SHOULD WE SET NUM lOCK? EXIT IF NOT FORCE NUM LOCK ON GO SET THE NUM LOCK [ND[CATOR TEST JZ 'PK8 FLAG 3 I LC HC NOT-LC He - WAS THE lAST CHARACTER A HIDDEN CODE JUMP IF NOT OR TEST JZ OR 26 0096 R FD 52 05 C4 80 5B BF 00E8 R B9 OOOA F2/ AE 75 54 F6 06 0018 R 08 7407 80 26 0018 R F7 A HIDDEN CODE IS THIS A BREAK CODE I GNORE BREAK ON REST OF THESE KEYS EB 43 F6 06 0017 R 08 74 DE F6 06 0017 R 04 74 35 3C 53 7531 E9 0300 R TEST JZ TEST JZ eMP JNE JMP @KB FLAG,ALT SHIFT NOT-AL T @KB-FLAG,CTL SH [FT EXJT Al,DEL M EXIT K29 F6 06 0017 R 04 75 15 3C 52 75 OE NOT Al T: TEST JNZ eMP JNE 'PKB FLAG, CTL SH I FT eTL -ON AL,TNS M N_INS - 8A 84 A8 75 E9 SCAN FOR THE KEY GO ON I F NOT FOUND ARE WE [N HOLD STATE? ; EXIT HOLD STATE IGNORE TH I S KEY ;----0180 0182 0184 0186 0188 018B 018B 018E 01 8E 0I9I 0191 0194 0196 INDICATE [T WAS KBX THE LAST CHARACTER WAS 013A 013F 0141 0143 0146 0 I 48 0148 0148 014E 0150 0152 0157 0159 015E 015E 0160 0160 0165 0167 016C 016E 0170 0172 1NT 09H 217 215 218 216 86 21. TABLE OF KEYPAD CURSOR & CONTROL KEYS 28' 285 2% 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 ; IS TH I S AN OVERRUN CHAR ; NO, TEST FOR SH I FT KEY ; BUFFER_FULL_BEEP AL, KB OVER RUN K 16 K62 TH I S CODE CONTA I NS THE KBX SUPPORT FOR 236 237 0009 238 00D7 239 OODA 240 00D8 241 0056 242 0006 2.3 244 0052 245 0053 246 0048 247 0040 248 0048 249 0050 250 0049 251 0051 252 0047 253 004F 25. 255 0085 256 OOEO 257 258 259 260 OOEB 48 50 52 53 4B 40 261 OOF! 49 51 47 4F 262 = OOOA 263 264 00F5 265 00F5 24 266 00F7 OE 267 00F8 07 268 269 00F9 F6 06 0096 R CO 270 OOFE 74 33 271 0100 79 11 272 0102 80 FC AB 273 0105 75 05 274 010780 OE 0096 R 40 275 0 I OC 276 0 I OC 80 26 0096 R 7F 277 0111 EB 48 278 279 0113 280 0113 80 26 0096 R BF 281011880FC41 282 011B 75 41 283 286 287 288 289 290 291 292 293 294 295 1-3 06-10-85 VersIon 2.00 C4 80 80 03 028F R - SPECI AL HANDL I NG FOR [S ALT DOWN? HOW ABOUT CTRL? I GNORE ALL IF ONLY AL T DOWN WAS IT THE DELETE KEY? [GNORE IF NOT GO 00 THE CTL, AL T I DEL RESET IS CTL DOWN? SPEC I AL CASE I F SO IS THIS THE INSERT KEY? INSERT KEY MOV MOV TEST JNZ JMP AL,AH AH,INS_ SH[FT AL,80H B e K22 JMP K24 HANDLE BREAK K,9 HANDLE Cl,5 EX[T K42 WAS [T INS, DEL, UP OR DOWN? IGNORE IF SO GO HANDLE CTRL CASE RECOVER SCAN CODE AH = MASK FOR INSERT WAS TH I S A BREAK CODE? ; GO HANDLE [NSERT SH I FT B e, E9 0202 R E9 0453 R N- INS: & IGNORE NUMLOCK eTL ON: 80 F9 05 TT OD E9 0401 R - eMP JA JMP KYBD 5-131 IBM Pel"'sonel Computel'" MACRO Assemb leI'" KYBO ----- 06/10/8& KEYBOARD BIOS 343 344 345 346 34' 348 34' 350 351 35. 3.3 354 355 356 3.' 358 359 360 361 36' 363 364 365 366 36' 368 369 310 0199 0199 019C a 19E 0lA3 0lA3 0lA6 011.6 0lA9 OIAB 011.0 OlAF OlAF 0lB2 0lB4 0lB6 0lB6 0lB9 OIBB OIBE OICO 0lC5 0lC7 OICC OICE OICE 80 FC EO 75 08 80 OE 0096 R 03 E9 02EE R 80 75 BI EB FC 09 04 85 07 80 14 80 74 F6 FC E8 FC E3 06 74 07 80 26 E8 05 06-10-85 NOT LC HC: - CMP "NE OR EXITI "MP NOT CUR: CMP "NE MOV "MP 80 FC OA 75 43 BI 86 eMP "NE MOV 07 eMP "E eMP 08 ~~ST 0018 R 08 "Z ANa 0018 R F7 1-4 Vt!l"'slon 2. 00 "MP I LAST CHARACTER WAS NOT A HIDDEN CODE I IS THIS CHARACTER A HIDDEN CODE? AH,HC ~~~:~~:G_3ILC_~C+KBX ; SET LAST CHAR WAS A HIDQEN CPDE & KBX ••• ; THROW AWAY THI S CODE ~HF~~ I_M WASITFI11 HANDLE IF SO SET BASE FUNCTION II CLIFUNCII SHORT DO_FN AH,FI2 M T SYS KEY CL,FUiiicll+1 WAS IT F12? GO TEST FOR SYSTEM KEY SET BASE FUNCTION 12 ~~i~II_B IS THIS A BREAK CODE I GNORE BREAK CODES IS THIS A BREAK CODE I GNORE BREAK CODES ARE WE IN HOLD STATE? :~i~12_B ~K~L~~AG_I,HOLD_STATE ;~~~~L~~T+ ,NOT HOLD_STAT~ • EXlT HOLD STATE IGNORE TH I S KEY 8A EI MOV ~HICL F6 06 0017 R 08 74 05 80 C4 06 EB 16 "Z AOO TEST ;K~f[L~G, AL T_ SH I FT I ; CNVT TO ALT FN 11-12 "MP AR,6 SHORT SET _FN F6 74 80 EB "Z AOO 311 31. 313 314 315 316 3TT 318 31. 380 3., 38. 383 384 385 38. 38' 388 38. 3.0 3" 3 •• 3.3 3.4 3.5 3'6 3" 3'8 3" 400 401 40. 403 400 405 40. 40' 408 40. 410 411 41. 4i3 41. 415 416 4IT 418 41. 4.0 .21 4" 4.3 4.4 4~5 ••• 421 4.8 4" 430 431 43. 433 434 43. 436 431 438 43. 440 441 44. 443 444 445 44. ... 44,7 448 450 451 45. 453 454 455 45. 0100 0105 0107 aiDA OIOC OloC aiEl OlEa 011;6 0lE8 0lE8 OlEO OIEF 0lF2 0lF2 OIF'1- 06 0017 R 04 05 C4 04 OA F6 06 0017 R 03 7~ 03 80 C402 2A co E9 04BA R BO E8 88 FB CO E9 ; TEST ;~~_~~AG,LEfT_SHIFT+RIGHT_SHIFT CN~T TO CTRL FN 11-12 ~ IS EITHER SHIFT ON? AH,Z ; CNVT TO SHIFT FN 11-12 SUS AL,AL "MP .51 I FORCE PSEUDO SCAN CODE I PUT I T I NTO BUFFER TEST FOR SYSTEM KEY "NZ TEST "NZ TEST IN:? 0207 80 OE 0018 R 04 020C 80 20 020E E6 20 022A 022C 022F 0232 0233 0235 0238 0238 023B 023E 0240 0242 0244 ; ARE WE IN CTRL AR,4 SHORT SET _FN T SYS KEY, CMP 0200 F6 06 0018 R 04 0205 75 17 BO E8 B8 FB CO E9 ;~~R~LAG,CTL_SH 1FT "Z AOO OIFB F6 C4 80 OIFE 75 21 0210 0212 0215 0218 0219 021B 021E 021E 0221 0221 0226 0228 TEST "MP SET_FNI 1----0lF7 01F7 3C 54 0lF9 75 30 ARE WE IN ALT OR MOV OUT I.E 0595 R 8500 MOV CALL MOV STI INT 15 02F8 R KI6B: E9 02EE R KI6C; 80 26, 0018 R FB BO 20 E6 20 CHECK IF TI-I I S A BREAK CODE 00 NOT TOUCH SYSTEM INDICATOR IF TRUE ~~:BFLAG_I,SYS_SHIFT SEE I FIN SYSTEM KEY HELD DOWN IF Y.ES, DON'T PROCESS SYSTEM INDICATOR IltKB FLAG I,SYS SHIFT ALIEbl INTAOO,AL INDICATE SYSTEM KEY DEPRESSED END' OF I NTERRUPT COMMAND SEND COMMAND TO I NTERRUPT CONTROL PORT I NTERRUPT-RETURN-ND-EO I I NSURE KEYBOARD I S ENABLED EXECUTE ENABLE FUNCTION VALUE FOR MAKE OF SYSTEM KEY MAKE SURE INTERRUPTS ENABl.ED USER INTERRUPT END PROCESS I NG AL.ENA KBD SHIP 1"1' AX,oe500H J~P 15H K27A K2~ AND :~~E~~AG_I.NOT SYS_SHIFTI TURN OFF SHIFT KEY HELD DOWN I GNORE SYSTEM KEy OUT INTAOO,AL MOV ~~i~N~1'KBD CALL 15 02F8 R I SIT THE SYSTEM KEY? CONTINUE IF NOT AH I 080H KI6C "MP MOV AE 0595 R 850 I ~~6!YS_KEY MOV A~.oe50IH STI INT "MP 15H K27A END 'OF INTERRUPT COMMAND SEND COMMAND TO I NTERRUPT CONTROL PORT I NTERRUPT-RETURN-NO-EO I 1NSURE KEYBOARD I S ENABLED EXECUTE ENABLE FUNCTION VALUE FOR BREAK Of SYSTEM KEY MAKE SURE I NTERRUPTS ENABLED USER INTERRUPT IGNORE ·SYST.EM KEY KI6AI BF 0000 E B9 0000 E F21 I.E 81. C4 74 03 E9 020A R MOV MOV REP,NE MOV JE "MP 01 ,OFFSET K6 CX, OFFSET K6L SCASB AL,AH SHIFT KEY TABLE LENGTH LOOK THROUGH THE TABLE FOR A MATCH RECOVER SCAN CODE JUMP I F MATCH FOUND IF NO MATCH, THEN SHIFT NOT FOUND .IT •• 5 SH I FT KEY FOUND 0247 0247 024B 0250 0252 d254 81 EF 0001 E !E I 81. A~ 0000 E 1.8 SO 74 02 EB 50 0256 0256 80 FC 10 0259 73 07 SUS MOV TEST "Z "MP ;----KI7C: eMP 025B 08 26 00 17 R 025F E9 02EE R 0262 0262 F6 06 0017 R 04 0267 75 71 0269 3C 52 5-132 KYBD AH, SCROLL SH I FT KI8 - PLAIN SHIFT KEY, OR "MP 1----- AD,JUST PTR TO SCAN CODE MATCH GET MASK INTO AH TEST FOR BREAK KEY ; BREAK SH I FT FOUND 1 CONTINU~ - DETERMINE SET OR TOGGLE "AE ;----- 01 ,OFFSET K6+1 AH,CSIK7(01 J AL.SOH KI7C SHORT K23 ; I F SCROLL SH I FT OR ABOVE SET SHIFT ON TURN ON SHIFT BIT INTERRUPT_RETURN ~KBJLAG,AH '.5 TOGGLED SHIFT KEY, TEST FOR 1ST t.1AKE OR NOT KI6s TEST "NZ ~~~_FLAG, CTL_SHIFT eMP AL, INS_KEY SHIFT-TOGGLE CHECK CTL SHIFT STATE JUMP IF' CTL· STATE I CHECK FOR INSERT KEY ~ TOGGLE KEY IBM Personal Computer MACRO Assembler KYBO ----- 06/10/85 KEYBOARD BIOS 457 458 459 •• 0 461 462 463 464 •• 5 466 467 468 469 470 471 026B 75 22 0260 F6 06 0017 R 08 0272 75 66 0274 0279 027B 0280 0282 0282 0285 0288 0288 0280 .. , 028F 028F 0293 0295 0297 0297 029B TEST ••• 497 498 499 500 50 I TEST B8 5230 E9 048A R MOV "MP K21, F6 06 0017 R 03 74 F3 TEST "Z 50Z 503 84 26 0018 R 74 02 EB 57 SHIFT TOGGLE KEY HIT; PROCESS IT I S KEY ALREADY DEPRESSED GO IF NOT .JUMP I F KEY ALREADY DEPRESSED OR XOR lIK8 FLAG I, AH OKB::FLAG-;-AH INDICATE THAT THE KEY IS DEPRESSED TOGGLE THE SHIFT STATE ~~2:~B_FLAG_1 TOGGLE LED I F CAPS OR NUM KEY DEPRESSED TEST "Z 50 E8 0536 R 58 AX PUSH CALL POP SND LED CMP AL,INS KEY K26 - AX - SAVE SCAN CODE AND SHIFT MASK GO TURN MODE INDICATORS ON RESTORE SCAN CODE K22BI 3C 75 88 E9 52 41 5200 048A R "NE MOV "MP ~~lINS_KEY'H CMP "AE NOT ANa CMP "NE ;----0019 R 00 26 0019 R 00 74 IF E9 0493 R "E "MP 0202 0202 F6 04 0204 20 26 0018 R 0208 EB 14 K24= 020A 020A 02DC 020E 02E3 02E5 02E7 02E9 K251 51. 51' NOT ANa "MP ;----- AH, SCROLL SH I FT K24 - AH lIKB FLAG,AH AL.AL T KEY+80H K26 - ALTERNATE SHIFT KEY RELEASED, MOV MOV MOV CMP AO B4 88 3C TEST FOR I ST 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 K23= 80 FC 10 73 I A F6 04 20 26 00 I 7 R 3C B8 75 2C 513 514 515 516 517 SHORT K26 K22AO= ;----- 02C2 02C5 02C7 02CB 02CD 02CF "Z "MP TEST 08 26 0018 R 30 26 0017 R 50' 505 50. 507 508 509 510 511 512 I NUMERIC ZERO, NOT INSERT KEY ; PUT OUT AN ASC I I ZERO ; BUFFER FILL ; MIGHT BE NUMERIC lIKB FLAG, LEFT SHIFT+ RIGHT SHIFT K20,JUMP NUMERIC, NOT INSERT AX, 5230H K57 K22: ;----- 02B3 02B3 02B6 02B8 028A OZBE 02CO ,JUMP I F NOT I NSERT KEY CHECK FOR AL TERNA TE SH I FT ,JUMP IF AL TERNA TE SH I FT TEST K20: •• 5 ••• ALT_SHIFT "NZ 029F F6 C4 70 02A2 74 05 02A4 02A5 02A8 02A9 02A9 02AB 02AD 02BO ~~~_FLAG, "Z •• 5 486 487 488 489 490 491 492 493 K22 "NZ F6 06 0017 R 20 75 00 F6 06 0017 R 03 74 00 •• 0 •• 2 483 484 06-10-85 "NZ .,2 473 474 475 476 477 478 479 1-5 Version 2.00 AL,.ALT INPUT AHIO PAL T INPUT ,AH AL,O- K2. K5. AH lIKB FLAG I, AH SHORT K26 BREAK-SHI FT-FOUND IS THI S A TOGGLE KEY YES, HANDLE BREAK TOGGLE INVERT MASK TURN OFF SHIFT BIT IS THIS ALTERNATE SHIFT RELEASE INTERRUPT_RETURN GET THE VALUE INTO BUFFER SCAN CODE OF 0 ZERO OUT THE F I ELO WAS THE I NPUT=O I NTERRUPT RETURN IT WASN'T-;- SO PUT IN BUFFER BREAK-TOGGLE INVERT MASK INDICATE NO LONGER DEPRESSED INTERRUPT_RETURN TEST FOR HOLD STATE 520 521 522 523 524 525 526 527 528 3C 73 F6 74 3C 80 10 06 0018 R 08 IE 45 74 05 80 26 0018 R F7 CMP "AE TEST "Z CMP "E ANa AL,80H K26 NO-SH 1FT-FOUND TEST FOR BREAK KEY NOTH I NG FOR BREAK CHARS FROM HERE ON ~~~_FLAG_I,HOLD_STATE ~~~N~~ ~~O~~~D T~~~T~F NOT AL,NUM KEY K26 I CAN'T END HOLD ON NUM LOCK OKB_FLAG_I,NOT HOLD_STATE ; TURN OFF THE HOLD STATE BIT 52. 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 02EE 02EE 02EF 02FI 02F3 02F3 02F5 02F8 02F8 02F9 02FA 02FB 02FC 02FD 02FE 02FF 0300 0301 0302 0303 0303 F6 06 00 I 7 R 08 0308 75 03 030A E9 03A5 R 5 •• 510 POP POP POP POP POP POP POP POP POP IRET E5 DISABLE INTERRUPTS RESTORE REG I STERS NOT IN HOLD STATE TEST "NZ G!lKB FLAG.ALT SHIFT K29- "MP K3. CLI OS 01 51 OX CX BX AX BP RETURN, K28= 1----- 551 55. 5 •• AL,ENA KBD SHIP_IT K27A= FA 07 IF 5F 5E 5A 59 5B 58 50 CF 1----- 0300 0300 0312 03 I 4 0316 0318 031 A 031 C 031 E MOV CALL INTERRUPT-RETURN TURN OFF INTERRUPTS END OF I NTERRUPT COMMAND SEND COMMAND TO I NTERRUPT CONTROL PORT I NTERRUPT-RETURN-NO-EO I I NSURE KEYBOARD I S ENABLED EXECUTE ENABLE K27= 55. 559 560 561 562 563 564 565 566 567 AL,EOI INTAOO,AL CLI BO AE E8 0595 R 5 •• 550 551 552 553 554 555 MOV OUT K26= FA BO 20 E6 20 TEST OKB FLAG,CTL SHIFT K31AL,NUM KEY K26 - "NE K3I "Z CMP "E CMP "E CMP ;----- NO-HaLO-STATE ARE WE IN ALTERNATE 5H I FT ,JUMP IF ALTERNATE SH I FT .JUMP I F NOT ALTERNATE TEST FOR CONTROL KEY AND RESET KEY SEQUENCE K29= F6 06 0017 R 04 74 39 3C 45 74 06 3C 46 74 02 3C 53 75 20 INTERRUPTS ON WITH FLAG CHANGE ~~6 SCROLL_KEY AL,DEL_KEY (CTL AL T DEL) TEST-RESET ARE WE I N CONTROL 5H I FT ALSO NO RESET CHECK FOR I NV AL I 0 NUM LOCK KEY THROW AWAY IF (ALT-CTL) +NUM LOCK CHECK FOR I NV AL I 0 SCROLL LOCK KEY THROW AWAY IF (ALT-CTL) +SCROLL LOCK CTL-ALT STATE. TEST FOR DELETE-KEY NO_RESET CTL-ALT-DEL HAS BEEN FOUND KYBD 5-133 IBM Personal Computer MACRO Assembler KYBO ----- 06/10/85 KEYBOARD BIOS 571 572 0320 C7 06 0072 R 1234 0326 E9 0000 E 0329 0329 52 4F 50 51 4B 4C 032F 40 47 48 49 57. 579 580 581 582 583 0333 0339 033F 0345 0348 10 16 20 26 3I 11 17 21 2C 32 12 18 22 20 0340 0340 034F 035 I 0353 3C 75 80 E9 39 05 20 048A R 13 19 23 2E 14 IE 24 2F 15 IF 25 30 5 •• 5.5 5 •• 587 588 589 590 591 5'2 5'3 5" ;----- 1----SF 0329 R B9 OOOA F2/ AE 75 13 81 EF 032A R AO 0019 R B4 OA F6 E4 03 C7 A2 0019 R E9 02EE R 610 611 612 613 614 615 616 0373 0373 0378 037B 0370 037F 0381 C6 06 00 I'll R 00 B9 OOIA F2/ AE 75 05 BO 00 E9 048A R 620 621 622 623 62... 625 626 627 .2 • • 2. ••• 651 652 653 654 655 656 .5..5. "NE MOV "MP . .7 • K36; E9 02EE R K371 3C 73 BB E9 47 F9 0000 E O"'E I R .7. .7' 680 681 682 683 68... 01 ,OFFSET K30+ I AL,GlIALT INPUT AH,IO - AH AX,DI ~~~T_INPUT,AL ~~~~6INPUT ,0 SCASB ••• AL,O <57 AL,2 "B CMP .35 "AE •• 5 "AE "MP CMP "AE MOV "Me ADO IN THE LATEST ENTRY STORE IT AWAY THROW AWAY THAT KEYSTROKE NO-AL T-KEYPAD ZERO ANY PREVIOUS ENTRY INTO INPUT (01). (E5) ALREADY POINTING LOOK FOR MATCH I N ALPHABET NOT FOUND, FUNCT I ON KEY OR OTHER ; ASC I I CODE OF ZERO I PUT IT IN THE BUFFER AL,'''' AH,I18 AL,O <.7 AL T-TOP-ROW KEY WITH ' I ' ON IT NOT ONE OF INTERESTING KEYS IS IT IN THE REGION AL T-FUNCT I ON CONVERT PSEUDO SCAN CODE TO RANGE INDICATE AS SUCH BUFFER_FILL AL,59 <., .2. AL,71 ••• BX,OFFSET KI3 <•• AL T-FUNCTION TEST FOR IN TABLE AL T-CONT I NUE CLOSE-RETURN I GNORE THE KEY AL T-CONT I NUE IN KEYPAD REGION IF SO, IGNORE AL T SH I FT PSEUDO SCAN TABLE TRANSLATE THAT NOT IN ALTERNATE SHIFT K381 TEST 1----1----03AC 03AE 03BO 0384 0388 038C 3C 75 88 89 89 C6 46 10 IE IE IE 06 0080 00 I A 001 C 007 I 1----03C I 03C3 03C6 03C8 03CA 80 E8 CD 28 E9 AE 0595 R 18 CO 0 ... 8A R 03CO 03CO 3C 45 03eF 75 26 0301 80 DE 0018 R 08 BO E8 BO E6 AE 0595 R 20 20 030F 03E... 03E6 03E9 03EC 80 74 8A AO EE 3E 0049 R 07 07 03015 0065 R KYBD ; NOT-CTL-SHIFT ~~9 SCROLL_KEY TEST FOR BREAK NO-BREAK RESET BUFFER TO EMPTY OBIOS_BREAK,80H TURN ON .BIOS_BREAK BIT ::~~~~=-~;~~::~ ENABLE KEYBOARD SUB AL,ENA KBo SHIP 1"1' 1BH AX,AX "MP .57 CMP "NE OR ----- I NOT-ALT-SHIFT I ARE IE I N CONTROL SH I FT eX,OBUFFER START K39: ~~;NUM_KEY OKB_FLAG_I,HOLD_STATE ; ENABLE KEYBOARD ; EXECUTE ENABLE BREAK I NTERRUPT VECTOR PUT OUT DUMMY CHARACTER BUFFER_FILL NO-BREAK LOOK FOR PAUSE KEY NO-PAUSE TURN ON THE HOLD FLAG ENABLE KEYBOARD MOV CALL MOV OUT ;----- 5-134 .KB_FLAG,CTL_SHI FT ••• CONTROL SHIFT, TEST SPECIAL CHARACTERS TEST FOR BREAK AND PAUSE KEYS MOV CALL INT ; 0306 0308 030B 0300 "Z CMP "NE MOV MOV MOV MOV R R R R 80 " ." ••• AL T-KEY-PAO ALT-INPUT-TABLE LOOK FOR ENTRY US I NG KEYPAD LOOK FOR MATCH NO AL T KEYPAD Ol-NOW-HAS ENTRY VALUE GET THE CURRENT BYTE MULTIPLY BY 10 LOOK FOR TOP ROW OF ALTERNATE SH I FT CMP .72 673 674 675 676 01 ,OFFSET K30 CX,IO SCASB K351 •• 5 666 667 6615 669 .57 LOOK FOR SUPERSHIFT ENTRY MOV MOV REPNE 3C 3B 73 03 .57 660 661 662 663 66... NO-RESET ; TEST FOR SPACE KEY NOT THERE ; SET SPACE CHAR I BUFFER FILL I , TRANSLATE ALTERNATE SH I FT PSEUDO SCAN CODES 03A5 03A5 F6 06 0017 R 04 03AA 74 62 .5. SUB MOV MOV MUL AOO MOV "MP AOD MOV "MP •• 2 •• 3 6...... 6 ... 5 646 .••••••., A-Z TYPEIR I TER CHARS LOOK FOR KEY PAD ENTRY CMP 0394 0394 0396 0398 0398 039B 039B 0390 039F 03A2 ., AL,' K3"'1 02 OC OE 08 C... 76 00 0 ... 8A R 631 632 633 63'" 635 636 637 638 639 6 ... 0 . AL,57 .32 K331 3C 72 3C 73 80 BO E9 10 NUMBERS ON KEYPAD I I MOV MOV REPNE "NE ;----- I IN ALTERNATE SHIFT, RESET NOT FOUND K321 ;----- 038 ... 0384 0386 0388 038A 038C 038F 0391 ALT-INPUT-TABLE LABEL BYTE 08 82,19,150,151,75,76 DB 77,71,72,73 SUPER-SHIFT-TABLE 08 16,17,18,19,20,21 08 22,23,24,25,30,31 DB 32,33,34,35,36,37 ~ 38,«,45,46,47,415 DB 49,50 CMP "NE MOV "MP 0356 0356 0359 035C 035E 0360 0364 0367 0369 036B 0360 0370 .,.." ,----- ; SET FLAG FOR RESET FUNCT J ON I ..JUMP TO POWER ON 0 I AGNOST I CS K31; 595 596 597 598 599 600 60 I 602 603 604 605 606 •• 7 ••• ••• 1-. 06-10-85 MOV "MP 573 574 575 576 577 Version 2.00 ;~i~N~fKBO AL,Eal INTAOO,AL ENABLE KEYBOARD EXECUTE ENABLE END OF I NTERRUPT TO CONTROL PORT ALLOW FURTHER KEYSTROKE INTERRUPTS DURING PAUSE INTERVAL, TURN COLOR CRT BACK ON CMP ~~~T_MODE, 7 MOV OUT DX,03D8H AL, GlICRT MODE SET DX,AL - "E MOV 15TH I 5 THE MONOCHROME CARD YES, NOTH I NG TO DO PORT FOR COLOR CARD GET THE VALUE OF THE CURRENT MODE SET THE CRT MOOE, SO THAT CRT I 5 ON IBM Personal Computer MACRO Assembler KY8D ----- 06/10/85 KEY80ARO 810S 1-7 Version 2.00 06-10-85 685 686 SUSPEND SYSTEM OPERATION (LOOPl TILL NEXT KEY CLEARS HOLD STATE FLAG 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 03EO 03EO F6 06 0018 R 08 03F2 75 F9 K40: 03F4 E9 02FB R ; 03F7 03F7 03F9 03F8 03FE ----- TEST JNZ PK8 FLAG I ,HOLD STATE K40 - PAUSE-LOOP CHECK HOLD STATE FLAG LOOP UNT I L FLAG TURNED OFF JMP K27A INTERRUPT _RETURN_NO_EO I TEST SPEC I AL CASE KEY 55 NO-PAUSE K41 : 3C 75 88 E9 37 06 7200 048A R CMP JNE MOV JMP AL,55 K42 AX,114·H K57 NOT-KEY-55 START/STOP PRINTING SWITCH BUFFER _F I LL SET UP TO TRANSLATE CONTROL SHIFT 0401 0401 88 0000 E 0404 3C 38 0406 72 7E K42: 0408 88 0000 E 0408 E9 04E 1 R MOV CMP JB ax, OFFSET K8 AL,59 K56 MOV JMP BX,OFFSET K9 K63 NOT-KEY-55 SET UP TO TRANSLATE CTL IS IT IN TABLE YES, GO TRANSLATE CHAR CTL -T A8LE- TRANSLATE CTL TABLE SCAN TRANSLATE_SCAN 711 712 713 714 715 716 717 718 71. NOT I N CONTROL SH I FT 040E 040E 0410 0412 0417 K44: 3C 47 73 33 F6 060017 R 03 74 62 CMP JAE TEST JZ ; ----- 720 AL,11 K48 ; NOT-CTL-SHIFT TEST FOR KEYPAD REG I ON HANDLE KEYPAD REGION ~~:_FLAG,LEFT_SHIFT1-RIGH~_~~~~TFOR SHIFT STATE UPPER CASE, HANDLE SPECIAL CASES 721 722 723 724 725 726 727 728 72. 0419 0418 0410 0420 3C 75 88 E8 OF 05 OFOO 68 0422 0422 3C 37 042475 10 730 735 736 737 738 73. 740 741 742 743 744 745 746 747 748 74. 750 0426 0428 0428 0420 042F 0430 0432 0433 80 E8 80 E6 55 CO 50 E9 AE 0595 R 20 20 0436 0436 0438 043A 0430 3C 72 88 E9 38 06 0000 E 04E 1 R AL,I5 K45 AX,IS·H SHORT K51 BACK TAB KEY NOT-BACK-TAB SET PSEUDO SCAN CODE BUFFER _F I LL CMP JNE AL,55 K46 NOT-BACK-TAB PR I NT SCREEN KEY NOT -PR I NT - SCREEN K45: ; ----- 731 732 733 734 CMP JNE MOV JMP ISSUE INTERRUPT TO MOV CALL MOV OUT PUSH INDICATE PRINT SCREEN FUNCTION AL,ENA KBO SHIP IT AL,EOI INTAOO,AL BP 05 lNT 05H 02F3 R POP JMP BP K27 I NSURE KEYBOARD I S ENABLED EXECUTE ENABLE 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 OCCURRING CMP JB MOV JMP AL,S9 K47 BX,OFFSET K12 K63 NOT-PR I NT-SCREEN FUNCT I ON KEYS NOT-UPPER-FUNCT I ON UPPER CASE PSEUDO SCAN CODES TRANSLATE_SCAN MOV JMP BX,OFFSET K 11 SHORT K56 NOT-UPPER-FUNCT I ON POINT TO UPPER CASE TABLE OK, TRANSLATE THE CHAR K46: 0440 0440 88 0000 E 0443 E8 41 K47: 0445 0445 044A 044C 0451 K48: 751 752 753 754 755 756 757 758 KEYPAD KEYS, F6 75 F6 75 06 0017 R 20 21 06 0017 R 03 21 TEST ...JNZ TEST ...JNZ MUST TEST NUM LOCK FOR DETERMINATION ; KEYPAO-REG I ON @K8_FLAG,NUM_STATE ; ARE WE IN NUM LOCK K52 ; TEST FOR SURE@K8 FLAG,LEFT SHIFT+RIGHT SHIFT; ARE WE IN SHIFT STATE K53-IF SHIFTED, REALLY NUM STATE 75. 760 761 762 763 764 765 766 767 768 76. 770 771 772 773 774 775 776 777 778 77. 780 781 782 783 784 785 786 787 BASE CASE FOR KEYPAD 0453 0453 0455 0457 0459 0458 0450 0460 0463 0463 0466 0466 0466 0468 K49: 3C 74 3C 74 2C 88 E9 4A DC 4E 00 47 0000 E 04E3 R 793 794 795 796 7.7 798 AL,74 SPEC I AL CASE FOR A COUPLE OF KEYS MINUS KSO AL,78 K51 MOV JMP AL,71 8X,OFFSET K15 K64 CONVERT OR I GIN 8ASE CASE TABLE CONVERT TO PSEUDO SCAN MOV JMP AX, 74-H+' -, SHORT K57 MINUS 8UFFER _F I LL MOV JMP AX,78-H+'+' SHORT K57 SUB K50: 88 4A20 E8 22 K51: 88 4E28 E8 10 MIGHT BE NUM LOCK, 0460 0460 Fb 06 0017 R 03 0472 75 OF K52: 0474 0474 2C 46 0476 88 0000 E 0479 E8 08 K53: 0478 0478 0470 047F 0481 K54: 788 78. 7'0 7" 792 8ASE-CASE CMP JE CMP JE SUB MOV JMP ----- 38 04 00 07 0483 0483 88 0000 E ; TEST JNZ ; 3C 72 80 E8 PLUS BUFFER _F I LL TEST SHIFT STATUS ALMOST-NUM-STATE ~~~_FLAG,LEFT_SHIFT+RlCiH~_~~:~iEO AL,70 BX,OFFSET KI4 SHORT K56 TEMP OUT OF NUM STATE REALL Y NUM STATE CONVERT ORTGIN NUM STATE TABLE TRANSLATE_CHAR PLA I N OLD LOWER CASE CMP JB MOV JMP AL,S9 K55 AL,O SHORT K51 NOT-SHIFT TEST FOR FUNCTION KEYS NOT-LOWER-FUNCT I ON SCAN CODE IN AH ALREADY BUFFER _F I LL MOV BX,OFFSET Kl0 NOT-LOWER-FUNCT I ON LC TA8LE K55: KYBD 5-135 IBM Personal Computer MACRO Assembler KY8D ----- 06/10/85 KEY80ARD 8[OS 799 600 60 I 802 0486 803 0486 FE C8 804 0488 2E: 07 605 606 607 808 04811. 809 04811. 3C FF 810 048C 74 IF 811 048E 80 FC FF 812 0491 14 III. 613 614 615 816 0493 6170493F6060011R40 818 0498 7420 619 620 621 822 04911. F6 06 0011 R 03 823 049F 74 OF 624 625 626 827 828 829 830 831 832 633 834 835 636 637 636 839 840 841 842 843 844 645 846 841 848 849 850 851 852 853 854 855 856 851 858 859 860 861 04AI 0411.3 0411.5 0411.1 04A9 0411.6 3C 72 3C 71 04 E8 ;----- 1-6 Version 2.00 06-10-85 TRANSLATE THE CHARACTER TRANSLATE-CHAR CONVERT OR I GIN CONVERT THE SCAN CODE TO ASC I 1 K56: DEC XLAT AL CS:KII PUT CHARACTER CMP JE CMP JE I NTO BUFFER BUFFER-F I LL IS THIS AN IGNORE CHAR YES, DO NOTHING W[TH [T LOOK FOR -I PSEUDO SCAN NEAR_I NTERRUPT _RETURN AL,-I K59 AH,-I K59 HANDLE THE CAPS LOCK PROBLEM K58: TEST JZ ;----- !!IKB FLAG,CAPS STATE K61- BUFFER-F I LL -NOTEST ARE WE IN CAPS LOCK STATE SKIP IF NOT IN CAPS LOCK STATE TEST JZ CONVERT ANY UPPER CASE TO LOWER CASE 41 15 SA II 20 00 0411.0 0411.0 E9 02EE R K59: 0480 0480 0482 0484 0486 0488 K60: CMP JB CMP JA ADD JMP AL, 'A' K6I AL, 'Z' K6I AL,'a'-'A' SHORT K61 JMP K26 FIND OUT IF ALPHABET [C NOT CAPS STATE - - NOT CAPS STATE CONVERT fo LOWER CASE NOT CAPS STATE - - NEAR- INTERRUPT-RETURN INTERRUPT_RETURN CONVERT ANY LOWER CASE TO UPPER CASE 04811. 04811. 048E 04CO 04C3 04C1 04C9 04C8 04CF 0400 0402 0404 0406 0409 040C 040E 3C 12 3C 71 2C 6 I 06 1A 02 20 CMP JB CMP JA SUB LOWER-TO-UPPER F I NO OUT I F ALPHABET I C NOT_CAPS_STATE AL,' a' K6I AL,' z' K6I AL,'a'-'A' NOT CAPS STATE CONVERT 1'0 UPPER CASE NOT-CAPS-STATE GET THE END PO I NTER TO THE BUFFER SAVE THE VALUE ADVANCE THE TAIL HAS THE BUFFER WRAPPED AROUND BUFFER FULL BEEP STORE THE VALUE MOVE THE PO I NTER UP TURN OFF INTERRUPTS END OF [NTERRUPT COMMAND SEND COMMAND TO I NTERRUPT CONTROL PORT I NSURE KEYBOARD I S ENABLED EXECUTE ENABLE MOVE I N POST CODE & TYPE PERFORM OTHER FUNCT [ON INTERRUPT_RETURN K61 : 88 88 E8 38 74 89 89 FA 80 E6 BO E8 88 CO E9 IE OOIC R F3 007F R IE 00111. R 22 04 IE OOIC R MDV MDV CALL CMP JE MDV MDV 20 20 AE 0595 R 9102 15 02F8 R MDV OUT MDV CALL MDV INT JMP BX,~BUFFER TAIL SI,BX K4 BX,@BUFFER HEAD K62 [S I J, AX !!IBUFFER_TA IL,BX CLI AL,EOI I NTAOO, AL AL ,ENA KBD SHIP IT AX,09102H ISH K27A 662 663 664 665 866 867 868 869 870 871 812 673 814 675 816 871 818 879 880 881 882 663 664 665 666 667 666 669 690 691 692 893 894 895 896 897 898 899 900 901 902 903 904 905 906 901 908 909 910 911 912 TRANSLATE SCAN FOR PSEUDO SCAN CODES 04El 04El 04E3 04E3 04E5 04E1 04E9 K63: 2C 3B 04E8 04E8 04E8 04EO 04EF 04F2 04F4 04F7 SUB AL,59 XLAT MDV MDV JMP CS:K9 AH,AL AL,O TRANSLATE-SCAN CONVERT OR I GIN TO FUNCT I ON KEYS TRANSLA TE - SCAN-aRGO elL TABLE SCAN PUT V ALUE INTO AH ZERO ASC I I CODE PUT I T I NTO THE BUFFER K64: 2E: 07 811. EO 80 00 EB 9F KB_INT_I K57 ENDP K62: 80 E6 89 83 E8 E9 20 20 0211.6 04 0000 E 02F3 R MDV OUT MDV MDV CALL JMP ; ; ENABLE AL,EOI [NTAOO,AL CX,618 BL,4 BEEP K27 [NTERRUPT CONTROLLER CH I P DIVISOR FOR 1760 HZ SHORT BEEP COUNT (1/16 + 1/64 DELAYl GO TO COMMON BEEP HANDLER EXIT --- - - - - -------- ----- --- --SND_DATA THIS ROUTINES HANDLES TRANSMISSION OF COMMAND AND DATA BYTES TO THE KEYBOARD AND RECE I PT OF ACKNOWLEDGEMENTS. I T ALSO HANDLES ANY RETR I ES IF REQU I RED 04FA 04FA 04FB 04FC 04FO 04FF 050 I 0501 0502 50 53 51 811. F8 B3 03 FA 80 26 0097 R CF SND OATil. PROC PUSH PUSH PUSH MOV MOV SOD: CL [ AND NEAR AX SAVE REG [STERS ex ex SAVE TRANSM I TTED BYTE FOR RETR [ES LOAD RETRY COUNT SH,AL BL,3 ~KB_FLAG_2.NOT ; 0 [SABLE INTERRUPTS (KB_FE+KB_FAI ; CLEAR ACK AND RESEND FLAGS WA [T FOR ANY PEND I NG COMMAND TO BE ACCEPTED 0501 0509 0509 0508 0500 2B C9 SUB cX,ex MAXIMUM WAIT COUNT IN TEST LOOPNZ AL,STATUS PORT AL, I NPT aUF FULL SO 1 - READ KEYBOARD PROCESSOR STATUS PORT CHECK FOR ANY PEND I NG COMMAND WA I T FOR COMMAND TO BE ACCEPTED MOV OUT AL,8H PORT_A,AL REESTABL I SH BYTE TO TRANSM I T SEND BYTE SOl: E4 64 11.8 02 EO FA 05 OF 811. C7 0511 E6 60 5-136 KYBD IBM PlI'lrsonal Computll'lr MACRO AsslI'lmblll'lr KYBO ----- 06/10/B5 KEYBOARD BIOS 913 914 915 916 917 0513 0514 0517 0517 051C 916 919 051E 920 0520 921 0520 922 0522 923 924 0524 925 0529 926 052B 927 052B 928 0530 929 0532 930 0532 931 0533 932 0534 933 0535 934 0536 935 93. 937 936 939 940 941 942 943 0536 944 0536 945 0537 946 053C 947 948 053E 949 0543 950 0545 951 0547 952 953 0549 954 0549 955 054A 956 054F 957 958 0551 959 0556 960 0556 961 0558 962 055B 963 055C 964 055F 965 0564 966 0568 967 0560 966 969 05bF 970 0572 971 0573 972 0578 973 057A 974 057A 975 057C 976 057F 977 0580 978 0580 979 0585 980 0585 981 0586 982 0587 963 9B4 965 96. 9B7 966 969 990 991 0587 992 0587 993 0588 994 058B 995 0580 996 058F 991 0591 998 0593 999 0594 1000 0595 1001 1002 1003 1004 1005 1006 1007 1008 0595 1009 0595 1010 1011 10120596 10130591 1014 0599 10150599 1016 059B 10170590 1018 1019 059F 1020 05AO 1021 05A2 1022 05,(3 1023 05A4 1024 05A4 1025 FB B9 1-9 Version 2.00 06-10-85 5T1 IAOO ENABLE INTERRUPTS LOAD COUNT FOR 10 ms+ MOV CX,OIAOOH TEST JNZ IfKB_FLAG_2. KB_FE+KB_FA S03: F6 06 0097 R 30 75 00 E2 F7 507 SEE IF EITHER 8[T SET IF SET. SOMETH I NG RECE I VEO GO PROCESS LOOP 503 OTHERW I SE WA I T OEe JNZ BL 500 DECREMENT RETRY COUNT RETRY TRANSM I SSI ON OR JMP PKB_FLAG_2,KB_ERR SHORT SD9 TURN ON TRANSM I T ERROR FLAG RETR 1ES EXHAUSTED FORGET TRANSM [SS I ON TEST JZ IfKB_FLAG_2,KB_FA 505 SEE [F THIS I S AN ACKNOWLEDGE I F NOT. GO RESEND ex RESTORE REG I STERS S05: FE CB 75 DO BO OE 0097 R 80 EB 07 507: F6 06 0097 R 74 EE SD9: 59 5B 5B C3 POP POP POP RET SND_DATA ENDP ; ; BX AX RETURN, GOOD TRANSM I SS I ON SND LED SND::::LEDI , ;~~ THIS ROUTINES TURNS ON THE MODE INDICATORS. - ~~~ -;~~~ - - - -~~;~ - - - - -- - -- - - ------ - - - ----- - -- - - - - - ----- - --- - - - - - - - - - -- CL I TEST JNZ !lIKB FLAG 2,KB PR LED SL9- TURN OFF INTERRUPTS CHECK FOR MODE INDICATOR UPDATE DON'T UPDATE AGAIN IF UPDATE UNOERWAY OR "OV OUT J"P I us < Sus I/O DELAY TO ALLOW FOR L[NE LOADING AND FOR CORRECT PULSE W [oTH SET THE -STROBE H[GH INTERRUPTS 8ACK ON RECOVER THE OUTPUT CHAR POP PRINTER STATUS 0064 006450 0065 0065 8B 0069 42 006A EC 0068 EC 006C 8A OObE 80 007 I OOTI 5A 00T2 8A 0074 80 0077 E8 B50: PUSH AX SAVE MOV INC IN IN MDV AND aX, CURSOR NOT MOVED (ALl= OIH WRITE CHARACTER STRING AND MOVE CURSOR BL ATTRIBUTE STRING IS CURSOR I S MOVED (AL I = 02H WR I TE CHARACTER AND ATTR I BUTE STR I NG (VALID FOR ALPHA MODES ONLY) STRING IS CURSOR I S NOT MOVED (AL I = 03H WR I TE CHARACTER AND ATTR I BUTE STR I NG AND MOVE CURSOR (VALID FOR ALPHA MODES ONLY) STRING IS CURSOR I S MOVED NOTE: CARR I AGE RETURN, LINE FEED, BACKSPACE, AND BELL ARE TREATED AS COMMANDS RATHER THAN PRINTABLE CHARACTERS. BX,CX,DX,SI,DI.BP,SP,DS,ES,SS PRESERVED DURING CALLS EXCEPT FOR BX,CX,DX RETURN VALUES ON FUNCTIONS 03H,04H,ODH AND ODH. ON ALL CALLS AX IS MODIFIED. CS: CODE, OS: OAT A, ES :NOTH I NG 0000 0067 00020137 0004 015C 0006 0184 0008 0771 OOOA 0198 OOOC 0208 OOOE 02A7 DOlO 02F9 0012 0353 00140385 0016 018F 0018 0446 OOIA 0435 OOIC 06EA DOlE 0lE5 0020 012E 0022 012£ 0024 012E 0026 0382 = 0028 R MI R R R R R R R R R R R R R R R R R R R D' D. OW OW OW OW OW OW OW OW OW OW OW OW D. OW D. OW OW OW MIL EOU OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET $-MI ; SET MODE SET-CTYPE SET-CPOS READ CURSOR READ-LPEN ACT 01 SP PAGE SCROLL UP SCROLL-DOWN READ AC CURRENT WR I TE AC CURRENT WRITE-C CURRENT SET COLOR WR IrE DOT READ DOT WRITE TTY VIDEO-STATE V IDEO-RETURN V IDEO-RETURN V IDEO-RETURN WR I TE=:STR I NG PROC NEAR TABLE OF- ROUTINES WITHIN VIDEO RESERVED RESERVED RESERVED CASE 19H. 110 WRITE STRING 201 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 0028 0028 FB 0029 FC 002A 06 002B IE 002C 52 0020 51 002E 53 002F 56 0030 57 0031 55 0032 E8 0035 8E 003888 003C 81 0040 83 0043 75 0045 BE 0048 0048 80 004B 74 5-144 VIDEO_IOsil eLD PUSH PUSH PUSH PUSH PUSH PUSH PUSH PUSH CALL MDV MOV AND eMe 0000 E B800 3E 0010 R E7 0030 FF 30 03 BOOO JNE MOV ENTRY POINT FOR ORG OF065H I NTERRUPTS BACK ON SET 0 I RECT I ON FORWARD E5 D5 SAVE WORK AND PARAMETER REGISTERS OX ex 8X 51 DI 8e "2 S I, OBOOOH POINT OS: TO DATA SEGMENT GET SEGMENT FOR COLOR CARD GET EQU I PMENT FLAGS SETT I NG I SOL ATE CRT SW ITCHES IS SETT I NG FOR BW CARD? SKIP IF NOT BW CARD ELSE GET SEGMENT FOR BW CARD AH,I3H M3 TEST FOR WRITE STRING OPERATION SKIP IF ESlBP VALlO AS PASSED DDS S I, 08800H DI,@EQUIP FLAG DI,30H DI,30H M2: FC 02 13 VIDEO 1 eMe JE IBM Personal Computer MACRO Assembler VIDEOI --- 06/10/85 VIDEO DISPLAY BIDS 229 230 231 232 233 234 235 23. 237 238 239 240 241 242 243 2 •• 2'5 24. 247 248 249 250 251 252 253 254 255 256 257 258 259 2E>0 2E>1 2E>2 263 2E>4 265 266 267 268 269 270 271 272 273 274 275 27b 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 0040 004F' 004F 0051 0054 0056 0059 8E C6 1-3 Version 2.00 06-10-85 MOV ES,S I SET UP TO POINT AT VIDEO MEMORY AREAS FO EE 08 E6 FE 28 09 MOV SHR SAL CMP JNO SI,AX SI,8 S 1,1 S I,MIL M4 MOVE COMMAND TO LOOK UP REG I STER SH I FT COMMAND TO FORM 8YTE OFFSET Ti MES 2 FOR WORD TABLE LOOKUP TEST FOR WITH I N TABLE RANGE BRANCH TO EXIT IF NOT A VALID COMMAND 005B 8A 26 0049 R 005F 2E: FF A4 0000 R MOV JMP AH ,IPCRT MODE ; MOVE CURRENT MODE INTO AH WORD PTR CS: IS !-tOFFSET M I ] ; GO TO SELECTED FUNCT I ON M3: 8B CI 01 83 73 ; COMMAND NOT VALl 0 00E>4 00E>4 E9 012E R 0067 ; 0067 00E>7 006A 0060 006F 0071 0073 0013 0076 007A 007F 0080 0081 0082 0084 0089 008C 008E 008F 0092 0093 - - - - - - - - --- - - -- -- - - - - - - - - - - - - - -- - - --- - - - - - --- -- --------SET MODE THIS ROUTiNE INITIALIZES THE ATTACHMENT TO THE SELECTED MODE. THE SCREEN I S BLANKED. INPUT (ALI:: MODE SELECTED (RANCiE 0-7) OUTPUT NONE ~~~ BA 83 75 BO B2 0304 FF 30 04 07 B4 - ~~~~ - --- - --- ;~~~ - - - - ~~~~ - - - -- - - -- -- - - - - - -- ----------- - 58 B9 3C 72 03 3C 72 03 3C 72 03 00 I 0 02 DE 09 04 08 09 07 02 09 ;----00B2 00B2 50 00B3 88 47 OA 00B6 86 EO 00B8 IE DX,03D4H Dl t 30H M8 AL, 7 DL,084H ADDRESS OF COLOR CARD IS BW CARD INSTALLED OK WITH COLOR I NO I CATE INTERNAL BW CARD MOOE ADDRESS OF 8W (MONOCHROME) CARD MOV MOV MOV PUSH PUSH CO. MOV MOV MOV ANa PUSH AOO OUT POP ASSUME SUO MOV LOS ASSUME POP MOV CMP JC AOO CMP JC AOO CMP JC AOO (tCRT MODE, AL IPAOOR 6845,DX IllROWS-;-25-1 OS AX SAVE MODE IN GLOBAL VARIABLE SAVE ADDRESS OF BASE I N I Ti ALI ZE DEF AUL T ROW COUNT OF 25 SAVE POINTER TO DATA SEGMENT SAVE MODE NUMBER (AL) CLEAR HIGH BYTE OF MODE SET TABLE POINTER, INDEXED BY MODE GET THE MODE SET VALUE FROM TABLE SAVE THE MODE SET VALUE VIDEO OFF, SAVE HIGH RESOLUTION BIT SAVE OUTPUT PORT VALUE POINT TO CONTROL REGISTER RESET VIDEO TO OFF TO SUPPRESS ROLLING BACK TO BASE REGISTER ax SI,AX AL,CS:[SI -t OFFSET M7] PCRT MODE SET, AL AL,037H OX DX,4 DX,AL OX DS:ABSO BX,BX OS,8X 8X ,IPPARM - PTR DS:COOE AX CX,I6 AL,2 M9 BX,CX AL,4 M9 BX,CX AL.7 M9 8X,CX PUSH MOV XCHG PUSH ASSUME CALL MOV ASSUME POP XOR OOBF IF OOCO 32 E4 ;----- SET UP FOR ABSO SEGMENT ESTABLISH VECTOR TABLE ADDRESSING GET PO I NTER TO V IDEO PARMS RECOVER MODE NUMBER IN (AL) LENGTH OF EACH ROW OF TABLE DETERM I NE WH I CH ONE TO USE MODEISOORI NEXT ROW OF INITIALIZATION TABLE MODEIS20R3 MOVE TO GRAPHICS ROW OF INIT_TABLE MODE IS 4,5, OR Eo MOVE TO BW CARD ROW OF ; OUT INIT ; SAVE MODE IN (ALl ; GET THE CURSOR MODE FROM, THE TABLE PUT CURSOR MODE I N CORRECT POSI T I ON SAVE TABLE SEGMENT PO INTER AX AX,[BX-tIO] AH,AL DS DS:DATA 005 PO I NT 05 TO OAT A SEGMENT PLACE INTO BIOS DATA SAVE AREA (iCURSOR MODE,AX OS : COOEOS AH,AH LOOP THROUGH TABLE, RESTORE THE TABLE 'SEGMENt POINTER AH I S REG I STER NUMBER OUR I NG LOOP OUTPUTTING REGISTER ADDRESS, MID: 8A EE 42 FE 8A EE 43 4A E2 58 1F C4 MOV OUT INC INC MOV OUT INC OEC LOOP POP POP ASSUME C4 07 F3 I NIT_TABLE POINTS TO CORRECT ROW OF INITIALIZATION TABLE M9: 00B9 E8 0000 E OOBC A:3 0060 R 00C2 00C2 00C4 DOCS 00C6 00C8 OOCA ooce OOCC OOCD OOCF 0000 MOV CMP JNE MOV MOV Me: A2 0049 R 89 16 0063 R C6 06 0084 R 18 IE 50 98 8B FO 2E: 8A 84 0000 E A2 0065 R 24 37 52 83 C2 04 EE 5A 0094 2B DB 0096 8E DB 0098 C5 IE 0074 R 009C 0090 OOAO 00A2 00A4 OOAo 00A8 OOM OOAC OOAE OOBO ; 00 NOTHING IF NOT IN VALID RANGE V IDEO RETURN ENDP - ; THEN VALUE FROM TABLE INITIALIZATION LOOP GET 6845 REGISTER NUMBER AL,AH DX,Al OX AH AL, [BX] DX,Al OX OX MIO AX OS DS:OATA POINT TO DATA PORT NEXT REGISTER VALUE GET TABLE VALUE OUT TO CHIP NEXT IN TABLE BACK TO PO I NTER REG ISTER DO THE WHOLE TABLE GET MODE BACK INTO (AL I RECOVER SEGMENT VALUE FILL REGEN AREA WITH BLANK 000 I 0003 0007 OOOC OODF ODE 1 00E3 DOES OOEl 00E9 00E8 OOEB OOEO OOEO ODFO OOFO 33 89 C6 B9 3C 72 3C 74 33 E8 FF 3E 004E R 06 0062 R 00 2000 04 OA 07 04 CO as XOR MOV MOV MOV CMP JC CMP JE XOR JMP 01,01 IllCRT_START ,01 iltACTIVE_PAGE,O CX,8192 AL,4 MOV CH,08H SET UP PO I NTER FOR REGEN START ADDRESS SAVED IN GLOBAL SET PAGE VALUE NUMBER OF WORDS I N COLOR CARD TEST FOR GRAPH I CS NO GRAPHICS INIT TEST FOR BW-CARO BW CARD INIT FILL FOR GRAPHICS MODE CLEAR BUFFER BW CARD INIT. BUFFER. SIZE ON BW CARD (20481 NO GRAPHICS INIT FILL CHAR FOR ALPHA -t ATTR I BUTE CLEAR BUFFER FILL THE REGEN BUFFER WITH BLANKS MI2 AL,7 Mil AX,AX SHORT MI3 Mil: B5 08 M12: 88 0720 "OV AX, • REP STOSW '-t7·H M13: F3 f AB ENABLE VIDEO AND CORRECT PORT SETTING 00F2 88 16 0063 R 00F6 83 C2 04 MOV AOO OX ,IltADDR 6845 OX,4 - ; ; PREPARE TO OUTPUT TO V IDEO ENABLE PORT PO I NT TO THE MODE CONTROL REG I STER VIDEO 1 5-145 IBM Per.sonal Computer MACRO Assembler VIDEO! --- 06/ !0/S5 VIDEO DISPLAY BIOS 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 360 381 382 383 384 385 386 387 366 369 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 416 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 436 439 440 441 442 443 444 445 446 447 446 449 450 451 452 453 454 455 456 00F9 AO 0065 R OOFC EE 1-4 06-10-85 Version 2.00 MOV OU7 GET THE MODE SET VALUE SET V I DEO ENABLE PORT ; ; AL,@CRT MODE SET DX,AL - DETERM I NE NUMBER OF COLUMNS, BOTH FOR ENT I RE 0 I SPLA Y AND THE NUMBER TO 8E USED FOR TTY INTERFACE OaFD 2E: SA 84 0000 E O! 02 96 0103 A3 004A R MOV 0106 OIOA OlaF 0112 0115 0118 0119 alIA 011C 61 E6 OOOE 2E: 6B 84 0000 E A3 004C R B9 0008 BF 0050 R IE 07 33 co F3/ A8 AND MOV MOV MOV MOV Si,OOOEH AX,CS:[SI + OFFSET M5] IIICRT LEN,AX CX,801 ,OFFSET .51 CALL ;----0255 0255 0258 02SC 025E 0260 0262 0264 0266 0268 026C 026E b270 0274 0276 0277 02TA 027B 027C 027E 0280 0282 ---;~~~----~~~~ -- ------------------------- - --- - ----------- E8 80 72 80 .51 .55 , OFFSET OF CHAR POSITION IN REGEN BUFFER ASSUME SCROL.L._UP 0208 0208 0208 020E 0210 0213 0215 0218 0218 0219 0218 021E 0220 0222 0224 0226 0226 0229 022B 0220 022F 0231 0231 P232 0234 0234 0237 0239 0238 0230 0230 0240 0245 0247 024A 0240 024E 024E 0251 b251 0253 0255 ROW. COL.UMN POSITION POSITION RET ENOP I - - ----- - ------ - - - - - - - - -- -- --- - - - - ----- - - -, SCROLL UP ; TH I S ROUTI NE MOVES A BL.OCK OF CHARACTERS UP ; ON THE SCREEN I INPUT (AH) =: CU~RENT CRT MODE ; (AU =: NUMBER OF ROWS TO SCROL.L. ; (CX) =: ROW I COL.UMN OF UPPER L.EFT CORNER 1 (OX) =: ROW 1COLUMN OF L:OWER RIGHT CORNER ; (BH) =: ATTRIBUTE TO 8E USED ON BL.ANKEO L.INE 1 ~ OS) =: OAT A SEGMENT ; ; , (ESI = REGEN BUFFER SEGMENT ; OUTPUT NONE -- THE REGEN BUFFER IS MODIFIED ; 5 •• 5'5 ." .,2 ---- , SERVICE ROUTIIIIE CAL.CUL.ATES THE REGEN BUFFER ADDRESS CHARACTER I N THE AL.PHA MODE PUSH MOV MOV MUL. XOR ADD SAL POP 08 C4 26 004A R FF C3 EO 5'3 .. .,. POSITION THIS OF A INPUT ,AX =: OUTPUT AX =: ~~~; ~; ~~- 5.2 ••• •••, ••• ••• ENDP ; -----=- _. . ------------- ----- ---- -- ---- -- -- 512 513 51. 515 51. 581 582 06-10-85 VIDEO STATE: 0lF7 1-. Ver-$Ion 2.00 pROC NEAR POSITION AX,(tCRT START OI,AXSI,AX OX,CX OH OL CH.CH BP. (tCRT COLS BP,SPAL,BL. BYTE pTR OCRT COLS AX,AX AX AL, (tCRT MODE ES OS AL,2 N9 AL , 3 N9 CONVERT TO REGEN PO INTER OFFSET OF ACT I VE PAGE ~~oQD~~~~~s~o~o~c~g~~LL OX = .ROWS. #COLS I N BLOCK INCREMENT POR 0 OR I GIN SET HIGH .BYTE OF COUNT TO ZERO GET NuttiBER OF COLUMNS IN 0 I SPLAY TIMES 2 FOR ATTRIBUTE BYTE GET LINE COUNT DETERMINE,PFFSET TO FROM ADDRESS ·2 FOR ATTR I BUTE BYTE SAVE LINE COUNT GET CURRENT MODE ESTABLISH ADDRESSING TO REGEN BUFFER FOR BOTH PO INTERS TEST FOR COLOR CARD SPEC I AL CASES HERE HAVE TO HANOLE BOX25 SEpARATEL.Y 80X25 COLOR CARD SCROLL PUSH OX MOV OX,3DAH IN AL,DX AL.RVRT N. AL,25H DL,OD8H N8 • TEST Jz MOV MOV GUARANTEED TO 8E COLOR CARD HERE WAiT DI'SP ENABLE GET PORT WAIT FOR VERTICAL. RETRACE WAIT_OI SP _ENABLE ADDRESS CONTROL PORT IBM Personal Computer MACRO Assembler VIDEOI --- 06/10/85 VIDEO DISPLAY BIOS 685 686 681 688 689 690 0291 0292 0293 0293 0294 0296 EE 5A Vt!rsion 2.00 OUT POP 1-7 06-10-85 TURN OFF V IDEO OUR I NG VERT I CAL RETRACE OX,AL OX N9: 58 OA DB C3 691 POF AX OR 8L,BL RET SCROLL_paS! T I ON ENOP RESTORE LINE COUNT o SCROLL MEANS BLANK F [ELD RETURN WITH FLAGS SET 692 693 694 695 696 691 698 699 100 10 I 702 0291 0291 0299 029A 0298 0290 029E 029F 02AO 8A CA 56 51 F31 A5 SF 5E C3 703 104 705 706 707 708 109 710 711 02AO 02AO 02A2 02A3 02A5 02A6 02A7 8A CA 57 F31 AB 5F C3 NIO 764 765 766 767 768 769 770 771 772 173 774 775 776 777 778 779 780 78 r 782 CLEAR ROW PROC NEAR MOV CL,DL PUSH OJ REP STOSW 01 POP RET ENDP GET # OF COLS TO MOVE SAVE START ADDRESS MOVE THAT LiNE ON SCREEN 1 RECOVER ADDRESSES I GET # COLUMNS TO CLEAR STORE THE FILL CHARACTER Nil ; - ------- -------------------------------; SCROLL DOWN ; THIS ROUTINE MOVES THE CHARACTERS WITHIN A DEFINED ; BLOCK DOWN ON THE SCREEN, FILLING THE TOP LINES ; WITH A DEF I NED CHARACTER ; INPUT (AHI ; CURRENT CRT MODE (AL) = NUM8ER OF LI NES TO SCROLL ; (CX) UPPER LEFT CORNER OF REG I ON ; (OX) LOWER RIGHT CORNER OF REG [ON (SH) = FILL CHARACTER ; (OS) = DA T A SEGMENT ; (ES) REGEN SEGMENT ; OUTPUT NONE -- SCREEN IS SCROLLED ; 112 113 114 115 116 117 118 119 720 721 722 723 724 725 726 727 728 729 730 731 732 73:3 734 735 736 737 738 739 740 741 742 743 744 745 746 74 7 748 749 750 751 752 753 754 755 756 757 158 759 760 761 762 763 MOVE ROW PROCNEAR MOV CL,OL PUSH S[ PUSH 0 [ REP MOVSW POP 01 POP SI RET ENDP = = = = 02A1 02A1 02A13 02A8 02AE 0280 02B3 0285 0288 02B8 02B9 02B8 028E 02CO 02C2 02C4 02C6 02C6 02C9 02CB 02CO 02CF 0201 0201 0202 0204 0204 0207 0209 0208 0200 02EO 02EO 02E2 02E4 - ;~;~~~ ~~;~ FO EI3 80 72 80 74 E9 02E4 R FC 04 08 FC 07 03 04FA R ---- - ~;~~ ----~~~; - - - - ----- ---- STD CALL CMP JC CMP ..IE ..IMP 0 I RECTI ON FOR SCROLL DOWN TEST LINE COUNT AH,4NI2 AH, 7 N12 GRAPH ICS_DOWN N12: 53 8B E8 74 2B 8A 2A C2 0255 R 20 FO E6 E3 E8 2B 2B FE 75 0297 R F5 FO CC F5 TEST FOR GRAPHICS TEST FOR 8W CARD CONT I NUE DOWN SAVE ATTRIBUTE IN BH LOWER RIGHT CORNER GET REGEN LOCATION PUSH "OV CALL JZ 5UB "OV SUB BX AX,DX SCROLL_POS I T I ON NI6 SI,AX AH,oH AH,BL CALL SUB SUB OEC JNZ NIO SI,SP OI,BP AH NI3 MOVE ONE ROW POP "OV AX AL, RECOVER ATTRIBUTE CALL SUB DEC JNZ J"P Nil ol,SP BL NI5 N5 CLEAR ONE ROW GO TO NEXT ROW 51 IS FROM ADDRESS GET TOTAL # ROWS COUNT TO MOVE I N SCROLL N13: N14: 58 BO 20 IN AH N15: E8 26 FE 75 E9 02AO R FO CB F7 0230 R SCROLL_END N16: 8A DE E6 ED "OV J"P SCROLL DOWN - ;----- BL,DH NI4 ENDP IF AMOUNT OF LINES TO BE SCROLLED THEN ADJUST AL; ELSE RETURN; = AMOUNT OF LiNES IN WINDOW 02E4 02E4 02E6 02E8 02EA 02E8 02EO 02EF 02Fl 02F3 02F4 02F6 02F8 02F8 02F9 8A OA 74 50 8A 2A FE 3A 58 75 2A C3 08 CO DE C6 C5 CO C3 02 08 "OV OR JZ PUSH "OV SUB INC eMP POP JNE SUB BL,AL AL,AL BL SET AXAL,DH AL,CH AL AL,BL AX BL SET BL-;-BL RET TEST_LiNE_COUNT ENDP SA 'IE LI NE COUNT I N BL TEST IF AL I S ALREADY ZERO IF IT IS THEN RETURN ••• SAVE AX SUBTRACT LOWER RDW FROM UPPER ROW ADJUST DIFFERENCE BY ! LINE COUNT = AMOUNT OF ROWS RESTORE AX I F NOT THEN WE'RE ALL SET OTHERW I SE SET SL TO ZERO IN WINDOW? RETURN VIDE01 5-149 IBM Peraonal Computer MACRO Al!ll!lembler VIDEOI --- 0&/10/85 VIDEO DISPLAY BIOS 18. 1-8 06-10-85 Version 2.00 PAGE ;--------------------------------------------------- - ----- --------- ---- -------; READ AC CURRENT I 7 •• 7 •• 7 •• 7.7 7 •• 7 •• 790 ; INPUT 7" 7'2 THIS ROUTINE READS THE ATTRIBUTE AND CHARACTER AT THE CURRENT CURSOR POSITION AND RETURNS THEM TO THE CALLER (AH 1 ,.. CURRENT CRT MODE (BHI = DISPLAY PAGE I ALPHA MODES ONLY 1 (DSI :: DATA SEGMENT (ES I REGEN SEGMENT = OUTPUT 7" 7 •• 7 •• (AL) IAH) : CHARACTER READ = ATTRIBUTE READ I ; 1------------------------------------------------------------------------------ASSUME DSIDATA.ESIDATA 7'. 7.7 7 •• 799 800 80 I 02F9 02F9 80 FC 04 02FC 72 08 READ AC CURRENT PROC -CMP AH.4 .JC PIO NEAR ; IS THIS GRAPHICS ; IS THIS BW CARD .02 .0. 803 804 02FE 80 FC 07 0301 74 03 80& 807 808 809 810 811 0303 030& 0306 0309 030B 030C .'2 .13 .,, 8US 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 0300 030F 0311 0311 0312 0313 0314 0315 0317 0319 0319 031A 031C 031E 031E 031F 832 0322 835 836 837 838 839 840 841 842 843 844 845 846 0322 0322 0324 0326 0329 032B 0320 032F 0331 0333 0335 0339 848 849 850 851 852 853 854 855 856 857 858 859 •• 0 033B 0330 0330 0341 0342 0344 0344 0347 0349 0340 0350 0352 8&2 0353 .31 ••• ••• .., .., E9 062A R PIa; E8 0322 R 8B F7 0& IF eMP AH.7 "" Pl0 "MP GRAPH ICS_READ CALL MOV FIND POSITION SI.DT PUSH ES POP as READ AC CONT I NUE GET RE'GEN LOCATION AND PORT ADDRESS ESTABLISH ADDRESSING IN 51 GET REGEN SEGMENT FOR QUICK ACCESS 1----- WAIT FOR HORIZONTAL RETRACE OR VERTICAL RETRACE IF COLOR 80 PII; "NZ OA OB 75 00 OR FB 90 FA EC A8 01 75 F8 PI2 CHECK MODE FLAG FOR COLOR CARD IN 80 ELSE SKIP RETRACE WAIT - DO FAST READ WAIT FOR HDRZ RETRACE LOW OR VERTICAL ENABLE INTERRUPTS FIRST ALLOW FOR SMALL INTERRUPT WINDOW BLOCK INTERRUPTS FOR SINGLE LOOP GET STATUS FROM THE ADAPTER IS HOR I ZONT AL RETRACE LOW WAIT UNTIL IT IS NOW WAIT FOR EITHER RETRACE HIGH GET STATUS IS HOR I ZONT AL OR VERT I CAL RETRACE HIGH WAIT UNTIL EITHER IS ACTIVE V IDEO_RETURN GET THE CHARACTER AND ATTR I BUTE EXIT WITH lAX) BL..BL P13 STI Nap eLI IN TEST "NZ AL,DX AL.RHRZ Pl1 P12: IN EC A8 09 74 F8 TEST PI3s AD E9 012E R "Z LODSW .JMP AL,OX AL.RVRT+RHRZ READ_AC_CURRENT ENDP 86 88 80 00 8B 8A 32 88 01 88 E3 E8 E8 02 E8 F3 OF FF FB E7 85 0050 R 74 09 FIND POSITION XCHG MOV SUB SHR MOV MOV XOR MOV SAL MOV "Z PROC NEAR SETUP FOR BUFFER READ OR WR I TE AH,BL SWAP MODE TYPE WITH ATTRIBUTE BP,AX SAVE CHARACTER/ATTR IN (BPI REGISTER BL,2 CONVERT D I SPLAY MODE TYPE TO A BL,I ZERO VALUE FOR COLOR IN 80 COLUMN SI,BX AND SAVE (2 OR 3 --> ZERO) BL,BH MOVE DISPLAY PAGE TO LOW BYTE SH,8H CLEAR HIGH BYTE OF COUNT/BYTE OFFSET OI,BX MOVE DISPLAY PAGE (COUNT! TO WORK REG 01,1 ; TIMES 2 FOR WORD OFFSET AX, [DI+OFFSET .CURSOR_POSN] ; GET ROW/COLUMN OF' THAT PAGE SK IP SUFFER AD.JUSTMENT IF PAGE ZERO P21 33 FF XOR 01,01 ELSE SET BUFFER START ADDRESS TO ZERO 03 3E 004C R 4B 75 F9 AOO OEe ~~ ••CRT_LEN "NZ P20 ADD LENGTH OF BUFFER FOR ONE PAGE DECREMENT PAGE COUNT LOOP TILL PAGE COUNT EXHAUSTED CALL ADD MOV ADD MOV RET POSITION OI,AX OX ,OADOR 6845 DX,6 SX,SI P21; E8 03 8B 83 8B C3 5-150 0 I Fl R F8 16 0063 R C2 06 DE FIND_POSITION VIDEO 1 ENDP DETERMINE LOCATION IN REGEN IN PAGE ADO LOCATION TO START OF REGEN PACiE GET BASE ADDRESS OF ACTIVE DISPLAY POINT AT STATUS PORT RECOVER CONVERTED MODE TYPE IN (BL I BP= ATTRIBUTE/CHARACTER (FROM BLJAL) 01= POSITION (OFFSET IN REGEN BUFFER I OX: STATUS PORT ADDRESS OF ADAPTER SL= MODE FLAG (ZERO FOR 80X25 COLOR I IBM Personal Computer MACRO Assembler VIDEOI --- 06/10/85 VIDEO DISPLAY BIDS 863 864 865 866 867 868 809 870 871 872 873 874 875 876 871 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 901 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 PAGE ; -------- - -- - - --- - - - --------- --------------------------------- -- -- ---------; WR I TE AC CURRENT -THTs ROUTINE WRITES THE ATTRIBUTE AND CHARACTER ; AT THE CURRENT CURSOR POSITION ; INPUT IAHI = CURRENT CRT MODE (BHI = D I SPLA Y PAGE ; (CX) = COUNT OF CHARACTERS TO WRITE (AL) = CHAR TO WR 1TE ; IBLl = ATTR I BUTE OF CHAR TO WR I TE (DSI = DATA SEGMENT ; (ES) = REGEN SEGMENT ; OUTPUT 01 SPLAY REGEN BUFFER UPDATED ; -- 0353 0353 0356 0358 035B 0350 0360 0360 80 12 80 14 E9 FC 04 08 FC 01 03 0582 R E8 0322 R WR I TE AC CURRENT PROC eMP AH,4 Je P30 AH,1 e"p P30 JE GRAPHICS_WRITE J"P P30: CALL FIND_POSITION 0363 OA DB 0365 14 06 OR JZ BL,BL P32 0361 95 0368 F3/ AB 036A EB 16 XCHG REP J"P AX,BP STOSW SHORT ;----036C 036C 0360 0360 036E 036F 0310 0371 0373 0315 0371 0379 0379 037A 031C 037E 031E 037F 0380 0382 0382 BP,AX P32: FB 90 FA EC A8 15 A8 15 5T1 NOP eLI 08 09 0I F4 IN TEST JNZ TEST JNZ AL,DX AL,RVRT P34 AL,RHRZ P32 IN TEST JZ AL,DX AL, RVRT +RHRZ P33 XCHG STOSW LOOP P31 P33: EC A8 09 14 FB NEAR IS THIS GRAPHICS IS THIS BW CARD WR I TE AC CONT I NUE GET REGEN-LOCAT I ON AND PORT ADDRESS ADDRESS IN (01) REGISTER CHECK MODE FLAG FOR COLOR CARD AT 80 SKIP TO RETRACE WAIT IF COLOR AT 80 GET THE ATTR/CHAR SAVED FOR FAST WRITE STRING WRITE THE ATTRIBUTE & CHARACTER EXIT FAST WRITE ROUTINE WAIT FOR HORIZONTAL RETRACE OR VERTICAL RETRACE XCHG GET THE ATTR/CHAR SAVED IN (BP) wRITE THE ATTRIBUTE AND CHARACTER AS MANY TIMES AS REQUESTED - TILL CX=O AX ,BP P35: E9 012E R JMP EXIT WR I TE _ AC _CURRENT ; ; ; 80 12 80 14 E9 FC 04 08 FC 01 03 0582 R E8 0322 R ENDP ----- - - - - - - - -- -- - - - - - - --- -- -- - - - - - - -- - - - - - - ------ - - - - - ------ - -- -- - - - - - - - - - - - --WR I TE C CURRENT -THIS ROUTINE WRITES THE CHARACTER AT THE CURRENT CURSOR POSITION, ATTRIBUTE UNCHANGED INPUT (AH) = CURRENT CRT MODE (BH) = DISPLAY PAGE (CX) = COUNT OF CHARACTERS TO WR I TE (ALl = CHAR TO WRITE (OS) = DATA SEGMENT (ES) :: REGEN SEGMENT OUTPUT 01 SPLA Y REGEN BUFFER UPOA TED - - - - - - - - - - --- ---- - -- -- - - - - - - - - - - - --- - - -- - - - - - --- - -- -- - -- - - - - - - - - - - - - -- - - - -- -- -- WR I TE C CURRENT - -CMP ,JC CMP ,JE ,JMP P40: CALL PROC NEAR AH,4 P40 AH,7 P40 GRAPHICS_WRITE IS THIS GRAPHICS IS THIS BW CARD GET REGEN LOCATION AND PORT ADDRESS ADDRESS OF LOCATION IN (01) WAIT FOR HORIZONTAL RETRACE OR VERTICAL RETRACE 0395 0395 0396 0398 039A 039B 039C 039E 03AO 03A2 03A4 03A4 03A5 03A 7 03A9 03A9 03AB 03AC 03AO P41 : FB OA 75 FA EC A8 15 A8 75 STI OR JNZ DB OF BL,BL P43 eLi 08 09 01 Fl IN TEST JNZ TEST JNZ AL,DX AL,RVRT P43 AL,RHRZ P41 IN TEST JZ AL,DX AL,RVRT+RHRZ P42 "OV STOSB INe LOOP 01 P41 JMP V IDEO_RETURN P42: EC A8 09 14 FB IF COLOR 80 WAIT FOR HDRZ RETRACE LOW OR VERTICAL ENABLE INTERRUPTS FIRST CHECK MODE FLAG FOR COLOR CARD IN 80 ELSE SKIP RETRACE WAIT - DO FAST WRITE BLOCK I NTERRUPTS FOR SINGLE LOOP GET STATUS FROM THE ADAPTER CHECK FOR VERTICAL RETRACE FIRST DO FAST WRITE NOW IF VERTICAL RETRACE IS HOR I ZONT AL RETRACE LOW THEN WAIT UNTIL IT IS WA I T FOR EITHER RETRACE HIGH GET STATUS AGAIN IS HORIZONTAL OR VERTICAL RETRACE HIGH WA I T UNT I LEI THER RETRACE ACT I VE P43: 8B C5 AA 41 E2 E6 03AF E9 012E R 0382 IF COLOR 80 LOOP FOR EACH ATTR/CHAR WRITE PLACE ATTR/CHAR BACK IN SAVE REGISTER WA I T FOR HORZ RETRACE LOW OR VERT I CAL ENABLE INTERRUPTS FIRST ALLOW FOR INTERRUPT WINDOW BLOCK I NTERRUPTS FOR 5 I NGLE LOOP GET STATUS FROM THE ADAPTER CHECK FOR VERTICAL RETRACE FIRST DO FAST WRITE NOW IF VERTICAL RETRACE IS HOR I ZONTAL RETRACE LOW THEN WAIT UNTIL IT IS WAIT FOR EITHER RETRACE HIGH GET STATUS AGAIN IS HORIZONTAL OR VERTICAL RETRACE HIGH WAIT UNTIL EITHER IS ACTIVE P34: 95 AB E2 EA 0385 0385 0385 0388 038A 0380 038F 0392 0392 P35 P31 : 95 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 951 958 959 960 961 962 963 964 965 966 967 968 969 970 911 1-9 06-10-85 Version 2.00 AX,BP GET THE CHARACTER SAVE IN (BP) PUT THE CHARACTER I NTO REGEN BUFFER BUMP POINTER PAST ATTRIBUTE AS MANY TIMES AS REQUESTED WR I TE _ C_CURRENT ENDP VIDEO 1 5-151 IBM Personal Compute!" MACRO Assembler VIDEOI --- 06110/85 VIDEO DISPLAY BIOS 972 973 974 975 97. 5-152 1-10 06-10-85 PAGE WRITE STRING -THIS ROUTINE WRITES A STRING OF CHARACTERS TO THE CRT. INPUT (AL) = WRITE STRING COMMAND 0 - 3 (8H) ;0 DISPLAY PAGE (CX) ;0 COUNT OF CHARACTERS TO WR I TE, IF \ CX I = 0 THEN RETURN (OXI = CURSOR POSITION FOR START OF STRING WRITE (BL) = ATTRIBUTE OF CHARACTER TO WRiTE IF (AU = 0 OR (AL) " (ES) SOURCE STRING SEGMENT ISP) = SOURCE STRING OFFSET OUTPUT NONE 977 978 979 980 981 982 983 98. 985 98. 987 0382 988 0382 989 03B4 990 0386 991 992 0388 993 03BA 994 03BO 995 03BF 996 03C3 991 03C4 998 03C7 999 03C9 t 000 03CA 1001 03CA 1002 03CB 1003 03CC 1004 03CD 1005 03CF 1006 0303 1007 1008 1009 1010 0304 1011 0306 1012 0308 1013 030A 1014 030C 1015 030E 1016 03EO 1011 03E2 1018 03E4 1019 03E4 1020 03E6 1021 03E8 1022 OSEC 1023 03EO 1024 03EE 1025 03EF 1026 03F 1 1027 03FI 1028 03F4 1029 03F7 1030 03F9 1031 03FD 1032 03FE 1033 03FE 10340400 t 035 0402 1036 0403 1037 0404 1038 0405 1039 0407 1040 040B 1041 0400 1042 040F 1043 041 t 1044 0414 1045 1046 0416 1041 0417 1048 041A 1049 041 C 1050 041E 1051 041F 1052 041F 1053 0420 1054 0423 1055 0425 1056 0426 1051 1056 0426 1059 0429 1060 0428 t 061 0420 10620430 1063 0432 1064 0432 1065 1066 0435 Version 2.00 = 1 ~~~~~-~~~~~;----;~~~----~~~;--------------------------------------------------- 3C 04 73 7C E3 7A 88 C! O! FF 50 98 CO 58 - F3 EE 08 E6 B4 0050 R CMP ..INS JCXZ AL,04 P59 P59 TEST FOR INVALID WRITE STRING OPTION IF OPTION [NVALID THEN RETURN IF ZERO LENGTH STRING THEN RETURN MOV sl,ex SHR S 1,8 S [, t ; [SI+OFFSET (IICURSOR POSNj; AX -; AX,0200H ; 10H AX GET CURRENT CURSOR PAGE CLEAR HIGH BYTE CONVERT TO PAGE OFFSET lSI PAGE~ SAVE CURRENT CURSOR POSITION IN STACK SAVE WRITE STRING OPTION SET NEW CURSOR POS I T I ON SAL PUSH PUSH 0200 10 MOV INT POP = RESTORE WR I TE STR [NG OPT [ON P50 : 51 53 50 86 EO 26: 8A 46 00 45 PUSH PUSH PUSH XCHG 3C 74 3C 14 3C 74 3C 15 CMP MOV INC CX BX AX AH,AL AL,ES: IBP] BP PUT THE WRITE STRING OPTION INTO (AH) GET CHARACTER FROM INPUT STRING BUMP PO I NTER TO CHARACTER TEST FOR SPEC I AL CHARACTER'S 08 OC 00 08 OA 04 07 00 JNE AL,06H P51 AL,CR PSI AL,LF P51 AL,07H P52 MOV [NT MOV POP POP POP ..IMP AH, OEH TTY CHARACTER WR I TE 10H j -WR I TE TTY CHARACTER TO THE CRT OX, (SI+OFFSET (IICURSOR POSNj ; GET CURRENT CURSOR POSITION AX - ; RESTORE REG [STERS BX CX SHORT P54 GO SET CURSOR POSITION AND CONTINUE JE CMP JE CMP JE CMP J S IT A BACKSPACE BACK SPACE [S I T CARR I AGE RETURN CAR RET [S IT A LINE FEED LINE FEED IS IT A BELL I F NOT THEN DO WR I TE CHARACTER P51: 84 OE CO 10 88 94 0050 R 58 58 59 E8 2E P52: 89 QOOI 80 FC 02 12 05 26 I SA 5E 00 45 MOV CMP JB CX, j AH,2 P53 INC BL,ESI [BP] BP MOV AH,09H MOV SET CHARACTER WR I TE AMOUNT TO ONE [S THE ATTRIBUTE IN THE STRING IF NOT THEN SKIP ELSE GET NEW ATTR I BUTE BUMP STR I NG PO [NTER P53: 84 CD 58 58 59 FE 3A 12 FE 2A 80 72 09 10 C2 16 004A R 12 C6 02 FE 09 IN7 10H POP AX POP POP BX INC JB OL DL, BYTE PTR (IICRT COLS P54 - INC OH SUB CMP DL,DL DH,25 PS' CMP JB 50 88 OEOA CD 10 FE CE 58 PUSH MOV CX AX AX,OEOAH INT 10H OEC POP DH PUSH AX AX,0200H AX P54: 50 88 0200 CO to 58 E2 A2 MOV LOOP 10H AX PSO POP DX TEST JNZ AL,O IH P59 AX,0200H 10H INT POP 5A A8 01 75 as B8 0200 CD 10 MOV INT P59: E9 012E R JMP WRITE_STR[NG VIDEO 1 GOT CHARACTER WR [TE CHARACTER TO THE CRT RESTORE REG I STERS V I OED_RETURN ENDP I NCREMENT COLUMN COUNTER IF eOLS ARE WITH I N RANGE FOR TH I S MODE THEN GO TO COLUMNS SET BUMP ROW COUNTER BY ONE SET COLUMN COUNTER TO ZERO IF ROWS ARE LESS THAN 25 THEN GO TO ROWS_COLUMNS_SET ELSE SCROLL SCREEN DO SCROLL ONE LINE RESET ROW COUNTER TO 24 RESTORE REGI STERS ROW COLUMNS SET SAVE-WR I TE sTR [NG OPT [ON SET NEW CURSOR POSIT[ON COMMAND ESTABLISH NEW CURSOR POSITION DO IT ONCE MORE UNTIL (CX) = ZERO RESTORE OLD CURSOR COORD [NA TES I F CURSOR WAS NOT TO BE MOVED THEN THEN EX I T WITHOUT RESETT I NG OLD VALUE ELSE RESTORE OLD CURSOR POSITION DONE - EXIT WRITE STRING RETURN TO CALLER IBM P ..... sonal Compute .... MACRO Ass.mble.... VIDEOI --- 06/10/85 VIDEO DISPLAY 8105 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 0435 1086 0435 E8 0469 R 1087 0438 261 8A 04 1088 0438 22 C4 1089 0430 02 EO 1090 043F 8A CE 1091 0441 02 CO 1092 0443 E9 012E R 1093 0446 109,4 ' 1095 0446 1096 0446 50 1097044150 1098 0448 E8 0469 R 1099 0448 02 E8 I I 00 0440 22 C4 1101 044F 26; 8A OC 1102 0452 5B I 1 03 0453 F6 C3 80 1 104 0456 15 00 105 0458 F6 04 106 045A 22 CC 101 045C OA Cl 10e 045E 109 045E 261 88 04 110046158 1" 0462 E9 012E R 112 0465 1 13 0465 32 C 1 114 0467 EB F5 115 0469 ". 117 PAGE ; ----- -------- ------; I-II 06-10-85 -- ---------------------- READ DOT -- WR I TE DOT THESE ROUT I NES WILL WR I TE A DOT, OR ~EAD THE DOT AT THE INDICATED LOCATION ENTRY -OX ROW (0-I99) (THE ACTUAL VALUE DEPENDS ON THE MODE) CX = COLUMN ( 0-639) 1 THE VALUES ARE NOT RANGE CHECKED) AL DOT VALUE TO WRITE 11,2 OR 4 BITS DEPENDING ON MODE, REQUIRED FOR WRITE DOT ONLY, RIGHT ,JU~TIFIEO) BIT 7 OF AL '" I INDICATES XOR THE VALUE INTO THE LOCATION OS = DATA SEGMENT . ES = REGEN SEGMENT = = EXIT AL = DOT VALUE READ, RIGHT .JUSTIFIED, READ ONLY J ------------- ------ - - - - - - - - - - - - ---- ----------ASSUME OS;OATA,ES;DATA READ DOT PROC NEAR CALL R3 OETERM I NE 8YTE POS I T I ON OF DOT MOV AL,ES: [511 GET THE BYTE MASK OFF THE OTHER BITS I N THE BYTE AND ALlAH SHL ALICL LEFT .JUSTIFY THE VALUE MOV CL,OH GET NUMBER OF BITS IN RESULT ROL AL,CL RIGHT .JUST I FY. THE RESULT .JMP V IDEO RETURN RETURN FRON V IDEO 1/0 READ_DOT ENDP WRITE DOT PUSH PUSH CALL SHR AND MDV POP PROC NEAR AX AX R3 TEST AL,CL AL,AH CL,ES: [SI BX BL I 80H "NZ R2 NOT AND DR SAVE DOT VALUE TWICE DETERM I NE BYTE POS I T I ON OF THE DOT SH I FT TO SET UP THE BITS FOR OUTPUT STRIP OFF THE OTHER BITS GET THE CURRENT BYTE RECOVER XOR FLAG IS IT ON YES, XOR THE DOT SET MASK TO REMOVE THE INDICATED BITS J AH CLIAH ALICL OR I N THE NEW VALUE OF THOSE BITS FINISH DOT RESTORE THE BYTE I N MEMORY RI: MOV PDP "MP R2, XOR .JMP WR I TE_OOT ES; [SI] ,AL AX RETURN FROM VIDEO 1/0 XOR DOT EXC[US I VE OR THE DOTS F1NISH UP THE WRIT'ING V IDEO_RETURN AL,CL RI ENOP ; ---- - - - - ------------ -- - - - - - - - ; -- -------------- TH I S SUBROUT I NE DETERM I NES THE REGEN BYTE LOCAT I ON OF THE I NO I CATED ROW COLUMN VALUE I N GRAPH I CS MODE. ENTRY -OX = ROW VALUE (0-199) CX = COLUMN VALUE 10-639) EXIT -S I = OFFSET I NTO 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 = # BITS IN RESULT BX = MODIFIED I - - - --- - - - -----'--- --- -- -- - - - - --- ---- -------- - - -R3 PROC NEAR "e II. 120 1121 122 123 12' 125 12. 127 12e 129 0469 130 131 132 133 134 0469 93 135 046A BO 136 046C F6 1131 046E A8 1138 0410 14 1139 0412 05 1140 0415 1141 0415 96 1142 0416 9a 1143 0477 8B 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 0479 BB 1154 047C 89 1 155 047F 80 I 156 0484 12 1151 0486 88 1158 0489 89 1159 1160 1161 048C 1 162 048C 22 1163 1164 1165 1166 048E 03 1161 0490 03 I I fl8 0~92 8A 1169 1170 1111 I 112 0494 2A 1173 0496 1114 0496 00 1115049802 1116 049A FE I I 77 049C 75 1118 049E 8A I 119 04AO 02 1180 04A2 C3 Ve .... sion 2.00 ;----;----- DETERMINE 1ST BYTE IN INDICATED ROW BY MULTIPLYING ROW VALUE BY 40 1 LOW BIT OF. RO" DETERMINES EVEN/ODD, 80 BYT~S/ROW ) XCHG 28 E2 08 03 IFD8 AX,BX AL,40 WILL SAVE AL AND AH DURING OPERATION MOV MUL DL TESt AL,008H AX= ADDRESS OF START OF INDICATED ROW TEST FOR EVEN/ODO ROW CALCULATED' .JUMP I F EVEN ROW OFFSET TO LOCAT'ION OF ODD ROWS AD.JUST EVEN ROW MOVE-PO I NTER TO S I RECOVER AL AND AH VALUES COLUMN VALUE TO OX "Z ADD R' XCHG XCHG SI,AX AX,BX DX,eX AX,2000H-40 R4= 01 MOV ;----- DETERMINE GRAPHICS MODE CURRENTLY IN EFFECT SET UP THE REGISTERS ACCORDING TO THE MODE CH MASK FOR LOW OF COLUMN ADDRESS ( 1/3 FOR HIGH/MED RES) CL # OF ADDRESS BITS IN COLUMN VALUE 1 3/2 FOR HIM ) BL MASK TO SELECT BITS FROM POINTED BYTE 1 80H/COH FOR HIM) 8H NUMBER OF VALID BITS IN POINTED BYTE ( 1/2 FOR HIM I = = = = 02CO 0302 3E 0049 R 06 06 0180 0103 MOV MDV CMP BX,2COH CX,302H a!lCRT MOOE,6 MOV BX,leOH CX.703H "C MDV RS SET PARMS FOR MED RES - ; HANDLE IF MED RES SET PARMS FOR HIGH ; ----- DETERM I NE BIT OFFSET I N BYTE FROM COLUMN MASK ;----- DETERMINE BYTE OFFSET FOR THIS LOCATJON IN COLUMN Rs, EA AND EA F2 Fl SHR ADD MOV ;----C9 CH,DL ; ; ; ; DX,CL SI,OX DH,BH MULTIPLY BH (VALID BITS IN BYTE) RE~ ADDRESS OF PEL WITI-:IIN BYTE TO CH SH I FT BY CORRECT AMOUNT I NCREMENT THE PO INTER GET THE. OF BITS IN RESULT TO DH BY CH (BIT OFFSETI LO~ATION SUB CL,CL Z!==RO INTO STORAGE RDR AL,I CL,CH BH LEFT ,JU:iTIFY VALUE IN AL (FOR WRITE) ADD IN THE BIT OFFSET VALUE LOOP CONTROL ON EX IT, CL HAS COUNT TO RESTORE BITS GET ~ASK TO AH MOVE THE MASK TO CORRECT LOCATION RETURN WITH EVERYTt"'IN~ SET UP R6: C8 CO CF F8 E3 EC ADD DEC "NZ MOV SHR ~ET R. AH,BL AH,CL VIDEOl 5-l~3 IBM Personal VIDEOI 1181 1162 1163 1164 1165 1166 1167 1188 1189 1190 1191 1192 1193 1194 1195 1 196 1197 I 198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 121 I 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1221 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 12bO 12bl 12b2 12b3 12b4 1265 1266 1267 1266 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1-12 06-[ 0-85 Version 2.00 Computer MACRO Assembler --- 06/10/85 VIDEO DISPLAY 8105 04A3 R3 ENOP ; --------------------------------- ----- - ------ - -------; SCROLL UP ; THIS ROUTINE SCROLLS UP THE INFORMATION ON THE CRT ; ENTRY -; CH,CL = UPPER LEFT CORNER OF REGION TO SCROLL DH,oL = LOWER RIGHT CORNER OF REGION TO SCROLL BOTH OF THE ABOVE ARE 1N CHARACTER pas I T IONS BH = FILL VALUE FOR BLANKED LINES AL = # LI NES TO SCROLL (AL=O MEANS BLANK THE ENTI RE FIELD) DS DATA SEGMENT ES REGEN SEGMENT EX I T -NOTH I NG, THE SCREEN I S SCROLLED = = ~~~~~ ~~; 04A3 04A3 8A 08 04A5 8B C I - ~~ - - - - -~~~~ - - - - ~~~~ - - - - -- - - -- - - - - - - -- - - -- - - - - - -- MOV MDV ;----- BL,AL AX, CX ; ; SAVE LINE COUNT IN BL GET UPPER LEFT POS I TI ON I NTO AX REG USE CHARACTER SUBROUTINE FOR POSITIONING ADDRESS RETURNED IS MULTI PL I EO BY 2 FROM CORRECT VALUE 04A 7 E8 0608 R 04AA 8B F8 CALL "OY GRAPH POSN DI,AX- ; SAVE RESULT AS DESTINATION ADDRESS DETERMINE SIZE OF WINDOW 04AC 2B 0 I 04AE 81 C2 0101 04B2 CO E6 02 SUB ADO SAL DX,CX DX,IOIH DH,2 ADJUST VALUES MULTIPLY ROWS 8Y 4 AT 8 VERT DOTS/CHAR AND EVENIODD ROWS DE TERM I NE CRT MODE 04B5 80 3E 0049 R Db 04BA 73 04 eMF JNe 04BC DO E2 04BE 01 E7 MEO I UM RES UP SAL oL,1 SAL OJ ,I # COLUMNS • 2, SINCE 2 BYTES/CHAR OFFSET ·2 SINCE 2 BYTES/CHAR DETERMINE THE SOURCE ADDRESS 04CO 04CO 04C 1 04C2 04C4 04C7 04C9 04CB 04CD 04CF 040 I 0403 0405 06 1F 2.4. CO 74 8A B4 F6 8B 03 8A 2A E3 02 20 C3 50 E4 F7 FO E6 E3 0407 0407 04DA 040E 04E2 04E4 E8 81 81 FE 75 0558 R EE IFBO EF IFBO CC FI PUSH POP SUB SAL JZ EO ES IN THE BUFFER FIND SOURCE GET SEGMENTS BOTH PO I NT I NG TO REGEN OS CH,CH BL,2 ZERO TO HIGH OF COUNT REGI STER MULTIPLY NUMBER OF LINES BY 4 I F ZERO, THEN BLANK ENT I RE FIELD GET NUMBER OF LI NES IN AL 80 BYTES I ROW DETERMINE OFFSET TO SOURCE SET UP SOURCE ADO I N OFFSET TO IT NUMBER OF ROWS IN FIELD DETERM I NE NUMBER TO MOVE RII "OY "OY "UL AL,BL AH,80 MOY S 1,01 SI.AX AH,DH AH,BL ADO "OY SUB TEST FOR MEDIUM RES FIND_SOURCE iIICRT MOOE,6 R1 - AH MOVING ONE ROW AT A TIME, BOTH EVEN AND 000 FIELDS ROW LOOP MOVE ONE ROW MOVE TO NEXT ROW S I, 2000H-SO 01 ,2000H-80 NUMBER OF ROWS TO MOVE AH CONT I NUE TILL ALL MOVED R8 LOOP THROUGH, R8: CALL SUB SUB DEC JNZ RI1 FILL IN THE VACATED LINE(S) 04Eb 04Eb 04E8 04E8 04E6 04EF 04Fl 04F3 8A C7 MOV AL,BH CLEAR ENTRY ATTRIBUTE TO FILL WITH CALL SUB DEC JNZ RI8 DI,2000H-80 BL RIO v I OED_RETURN CLEAR THAT ROW POINT TO NEXT LINE NUMBER oF' LINES TO FILL CLEAR LOOP EVERYTH I NG DONE RIO : E8 8I FE 75 E9 0571 R EF I FBO C8 F5 012E R 04F6 04F6 8A DE 04F8 EB EC 04FA ""P RII: BLANK FIELD SET BLANK COUNT TO EVERYTH I NG IN FIELD "Oy BL,DH R9 CLEAR THE FIELD J"P GRAPHICS_UP ENoP 1 -- ---------- --- - ------------ - ------------------------I SCROLL DOWN ; TH I S ROUT I NE SCROLLS DOWN THE I NFoRMAT I ON ON THE CRT ; ENTRY -1 CH, CL UPPER LEFT CORNER OF REG I ON TO SCROLL 1 DH, oL = LOWER RIGHT CORNER OF REG I ON TO SCROLL ; BOTH OF THE ABOVE ARE I N CHARACTER POS! T IONS ; BH FILL VALUE FOR BLANKED LINES ; AL = # LINES TO SCROLL (AL=O MEANS BLANK THE ENT I RE FIELD ~ ; OS DATA SEGMENT ES" REGEN SEGMENT : ; EXIT -; NOTH I NG, THE SCREEN I S SCROLLED = = = ; 04FA 04FA FD 04FB 8A 08 04FD 8B C2 - - - -- - - - - - -- --- ---- -- - - - -- ----- - - - - - - - - - - - - - - - - - - - - - - - -- GRAPH I CS DOWN STo MDV MOV ; ;----- 04FF E8 0608 R 0502 88 F8 0504 28 01 0506 81 C20101 050A CO E6 02 NEAR ; SET DIRECTION SAVE LINE COUNT IN BL ; GET LOWER RIGHT POS I T I ON I GRAPH POSN 01, AX- I SAVE RESULT AS DESTINATION ADDRESS DETERMINE SIZE OF WINDOW SUB ADO SAL DX,CX DX,IOIH DH.2 ADJUST VALUES MULTIPLY ROWS BY 4 AT 8 VERT DOTS/CHAR AND EVEN/ODD ROWS DETERM I NE CRT MODE 0500 80 3E 0049 R 06 0512 73 05 5-154 VIDEO 1 I NTO AX REG USE CHARACTER SUBROUT I NE FOR POS I T I ON I NG ADDRESS RETURNED IS MULTIPLIED BY 2 FROM CORRECT VALUE CALL "OY ;----- PROC BL,AL AX,DX eMP JNe PCRT MODE,6 R12 - TEST FOR MED I UM RES F IND_SOURCE_DOWN IBM Personal Computer MACRO Assembler VIOEOI --- 06{10{85 VIDEO DISPLAY BIOS 1295 1296 0514 DO E2 1297 0516 01 E7 1298051847 1299 1300 1301 0519 1302 0519 06 1303 051A IF 1304 051B 2A ED 1305 0510 81 C7 OOFO 1306 0521 CO E3 02 1307 0524 74 2E 1308 0526 8A C3 1309 0528 84 50 1310 052A F6 E4 1311 052C 8B F7 1312 052E 28 FO 1313 0530 8A E6 13140532 2A E3 1315 1316 1317 0534 1318 0534 E8 0558 R 1319 0537 81 EE 2050 1320 0538 81 EF 2050 1321 053F FE CC 1322 0541 75 FI 1323 1324 1325 0543 1326 0543 8A C7 1327 0545 1328 0545 E8 0571 R 1329 0548 81 EF 2050 1330 054C FE C8 1331 054E 75 F5 1332 0550 FC 13330551 E9 012E R 1334 1335 0554 1336 0554 8A DE 1337 0556 EB EB 1338 0558 1339 1340 1341 1342 0558 1343 0558 8A CA 1344 055A 56 1345 055B 57 1346 055C F3{ A4 1347 055E 5F 1348 055F 5E 1349 0560 81 C6 2000 1350 0564 81 C1 2000 1351 0568 56 1352 0569 51 1353 056A 8A CA 1354 056C F3 { A4 1355 056E 5F 1356 056F 5E 1357 0570 C3 1358 0571 1359 1360 1361 1362 0511 1363 0571 8A CA 1364 0573 51 1365 0574 F3{ AA 1366 051& 5F 1361 0577 81 C1 2000 1368051857 t 369 051C 8A CA 1310 051E F3{ AA 1371 0580 5F 13720581 C3 1373 0582 1374 1375 1376 1377 1318 t 379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 0582 1406 0582 84 00 1407 0584 50 1408 Version 2.00 1-13 06-10-85 MED I UM RES DOWN SAL Dl,l SAL DI,I INC DI ; # COLUMNS • 2, SINCE 2 BYTES (CHAR ; OFFSET -2 SINCE 2 BYTES/CHAR ; PO I NT TO LAST BYTE DETERM I NE THE SOURCE ADDRESS ES OS PUSH POP SUB ADO SAL CH,CH Dl,240 BL,2 RI. AL,BL AH,80 JZ "OV "OV ZERO TO HIGH OF COUNT REGISTER PO I NT TO LAST ROW OF PIXELS MULTIPLY NUMBER OF LINES BY 4 I F ZERO I THEN BLANK ENT I RE F lELa GET NUMBER OF L [NES IN AL 80 B'l'TES{ROW DE TERM I NE OFFSET TO SOURCE SET UP SOURCE SUBTRACT THE OFFSET NUMBER OF ROWS IN FIELD DE TERM I NE NUMBER TO MOVE AH SI,DI S 1 ,AX AH,DH AH,BL "UL "OV SUB "OV SUB lOOP THROUGH, RI7 CALL SUB SUB MOV I NG ONE ROW AT A T1 ME I BOTH EVEN AND ODD FIELDS ROW LOOP DOWN MOVE ONE-ROW MDVE TO NEXT RDW SI,2000H+80 DI,2000H+80 DEC AH NUMBER OF ROWS TO MOVE CaNT I NUE TILL ALL MOVED RI3 JNZ FILL I N THE BUFFER FIND SOURCE DOWN BOTH-SEGMENTS TO REGEN IN THE VACATED LiNEIS) MOV AL ,BH CALL SUB DEC ...INZ R 18 DI,2000H+80 BL R15 CLEAR ENTRY DOWN ATTRIBUTE TO FILL WITH CLEAR LOOP DOWN CLEAR-A ROW PO I NT TO NEXT Ll NE NUMBER OF LINES TO FILL CLEAR LOOP DOWN RESET-THE DIRECTION FLAG EVERYTH I NG DONE R15: CLO ...IMP VIDEO_RETURN R16: MOV ...IMP GRAPHICS_DOWN ROUTINE TO MOVE ONE ROW OF RI7 PROG "OV 5J DI REP POP POP ADO ADO MOVSB "OV REP POP POP RET RI7 INFORMATION NEAR Gl,DL PUSH PUSH PUSH PUSH BLANK F [ELD DOWN SET BLANK COUNT TO EVERYTH I NG 1N F [ELD CLEAR THE FIELD BL,DH R 14 ENDP NUMBER OF BYTES IN THE ROW SAVE POINTERS MOVE THE EVEN FIELD DJ 51 SI, 2O OOH DI,2000H 51 POINT TO THE ODD FIELD SAVE THE POINTERS COUNT BACK MOVE THE ODD FIELD DI CL,DL MOVSB DI POINTERS BACK RETURN TO CALLER 51 ENDP CLEAR A SINGLE ROW RIB PROC "OV PUSH REP POP ADD RIB NEAR CL,DL NUMBER OF BYTES IN FIELD SAVE POINTER STORE THE NEW VALUE PO I NTER BACK POINT TO ODD FIELD DI STOSB 01 DI,2000H PUSH DI "OV REP POP RET CL,DL STOSB ; FILL THE ODD FIELD ; RETURN TO CALLER DJ ENDP GRAPHICS WRITE THIS ROUTINE WRITES THE ASCII CHARACTER TO THE CURRENT POS I T I ON ON THE SCREEN. ENTRY -AL :: CHARACTER TO IVR 1 TE BL :: COLOR ATTRIBUTE TO BE USED FOR FOREGROUND COLOR IF BIT 7 IS SET, THE CHAR IS XoR'D INTO THE REGEN BUFFER 10 I S USED FOR THE BACKGROUND COLOR) CX :: NUMBER OF CHARS TO IVR I TE DS :: DATA SEGMENT ES :: REGEN SEGMENT EXIT -NOTH I NG I S RETURNED GRAPHICS READ THIS ROUTINE READS THE ASCI I CHARACTER AT THE CURRENT CURSOR pas I T I ON ON THE SCREEN BY MATCH I NG THE DOTS ON THE SCREEN TO THE CHARACTER GENERATOR CODE POINTS ENTRY -NONE 10 I S ASSUMED AS THE BACKGROUND COLOR) EXIT -AL CHARACTER READ AT THAT POSITION (0 RETURNED IF NONE FOUND) = FOR BOTH ROUTINES, THE IMAGES USED TO FORM CHARS ARE CONTAINED IN ROM FOR THE 1 ST 128 CHARS. TO ACCESS CHARS I N THE SECOND HALF, THE USER MUST INITIALIZE THE VECTOR AT INTERRUPT lFH ILOCATION 0007CH) TO POINT TO THE USER SUPPLIED TABLE OF GRAPHIC IMAGES 18X8 BOXES). FA I LURE TO DO SO WILL CAUSE I N STRANGE RESULTS ASSUME GRAPH I CS WR I TE Mov PUSH DS: DATA, ES ;DATA PROC NEAR AH,O AX ZERO TO HIGH OF CODE PO I NT SAVE CODE PO I NT VALUE VIDEO 1 5-155 II;3M Personal Computer MACRO Assembler VIDEOI --- 06/10165 VIDEO DISPLAY B[OS 1409 1410 141 1 0585 E6 0605 R 1412 0588 6B F8 1413 1414 1415 1416 056A 58 1411 058B 3C 80 1418058073 06 1419 1420 1421 1422 058F BE 0000 E 1423 0592 OE 1424 0593 EB OF 1425 1426 1421 1428 0595 1429 0595 2C 80 1430 0597 IE 1431 0598 2B F6 1432 059A 8E DE 1433 1434 059C C5 36 007C R 1435 05AO 8C DA 1436 1437 05A2 IF 1438 05A3 52 1439 1440 1441 1442 05A4 1443 05A4 Cl EO 03 1444 05A7 03 FO 1445 05A9 80 3E 0049 R 06 1446 05AE IF 1441 05AF 12 2C 1448 1449 1450 0581 1451 05Bl 51 1452 05B2 56 1453 0583 86 04 1454 0585 1455 0585 AC 1456 0586 F6 C3 80 1457 05B9 75 16 1458 05BB AA 1459 058C AC 1460 0580 146 I 05BD 26: 88 85 1FFF 1462 05C2 83 C1 4F 1463 05C5 FE CE 1464 05C7 15 EC 1465 05C9 5E 1466 05CA SF 1461 05Ce 47 1468 05CC E2 E3 1469 05CE E9 012E R 1410 1471 0501 1412 0501 26: 32 as 1413 0504 AA 1474 0505 AC 1475 0506 26: 32 85 IFFF 1416 0508 E8 EO 1477 1478 1419 0500 1480 0500 8A 03 1461 050F 01 E7 1462 1463 05El 80 E3 03 1484 05E4 BO 55 1485 05E6 F6 E3 1486 05E8 8A D8 1487 05EA 8A F8 1488 05EC 1+89 05EC 57 1490 05Eo 56 1491 OSEE B6 04 1492 05FO 1493 05FO AC 1494 05F 1 E8 06AO R 1495 05F4 23 C3 1496 05F6 86 EO 1497 05F8 F6 C2 80 1498 05FS 74 03 1499 05Fo 26; 33 05 1500 0600 ' 1501 0600 26: 89 as 1502 0603 AC 1503 0604 E8 06Ao R 1504 0601 23 C3 1505 0609 86 EO 1506 060B F6 C2 80 1507 060E 74 05 1508 0610 26: 33 85 2000 15090615 1510 0615 26: 89852000 151' 061A 83 C7 50 1512 0610 FE CE 1513 061F 75 CF 15140621 5E 1515 0622 5F 1516 0623 47 1517 062447 1518 0625 E2 C5 1519 0627 E9 012E R 1520 Q62A 1521 1522 5-156 VIDEO 1 ;----- Version 2.00 DETERMINE PoSIT[ON IN REQEN BUFFER TO PUT CODE POINTS CALL "OY ;----- ; ; 52. OI,AX IMAQE IS MOV PUSH ,JMP ; ; ; AX AL,80H 51 IN F[RST HALF, CONTAINED S I ,OFFSET CRT CHAR GEN CS SHORT S 2 IMAQE IS IN SECOND HALF, ; ; ; SUS PUSH SUS "OY ASSUME LOS "OY ASSUME POP PUSH AL, BOH OS SI,SI OS,SI OS:ABSO Sl,olIEXT PTR OX ,OS OS:DATA OS OX I~ ROM OFFSET OF I MAGES SAVE SEGMENT ON STACK DETERM I NE _MODE EXTEND CHAR ZERO ORIGIN FOR SECOND HALF SAVE DATA POINTER ESTABLISH VECTOR ADDRESSINQ GET THE OFFSET OF THE TABLE GET THE SEGMENT OF THE TABLE RECOVER DATA SEGMENT SAVE TABLE SEGMENT ON STACK DETERMINE GRAPHICS MODE IN OPERATION 52: SAL ADO C"P POP JC ~;~--- RECOVER CODE PO I NT [S IT IN SECOND HALF YES IN USER MEMORY S1: ;----- FIND LOCATION [N REQEN BUFFER REQEN PO INTER IN 0 I DETERMINE REQION TO GET CODE POINTS FROM POP C"P JAE :----- 1-14 06-10-85 AX,3 SI,AX IlICRT _MODE, 6 OS 51 DETERM I NE MODE MULTIPLY CODE POINT VALUE BY 8 S I HAS OFFSET OF DES [RED CODES RECOVER TABLE POINTER SEGMENT TEST FOR MED I UM RESOLUT I ON MODE HIGH RESOLUT I ON MODE PUSH PUSH "OY HIGH CHAR SAVE-REGEN PO INTER SAVE CODE PO INTER NUMBER OF TIMES THROUGH LOOP 01 51 OH,4 S4: LODSa TEST JNZ STOSB LODSB QET BYTE FROM CODE PO I NTS SHOULD WE USE THE FUNCT I ON TO PUT CHAR IN STORE I N REGEN BUFFER BL,80H 5. S5; "OY ADO DEC JNZ POP POP INC LOOP J"P ES: 101 +2000H-1] ,AL 01,79 OH STORE I N SECOND HALF MOVE TO NEXT ROW I N REGEN DONE WITH LOOP 5' 51 01 01 53 V [OED_RETURN RECOVER REGEN PO INTER PO I NT TO NEXT CHAR POS I T I ON MORE CHARS TO WRITE S6: XOR STOSS Loose XOR ,JMP AL,ES] [01] EXCLUS I VE OR WITH CURRENT STORE THE CODE PO I NT AGAIN FOR ODD FIELD AL,ES: [01 +2000H-1] 55 BACK TO MA [NSTREAM MEDIUM RESOLUTION WRITE "OY SAL DL,BL DI,I AND "OY MUL "OY "OY BL,3 AL,055H SL SL,AL SH,AL PUSH PUSH "OY OH,4 MED RES WR I TE SAVE-H[GH COLOR BIT QFFSET·2 SINCE 2 BYTES/CHAR EXPAND BL TO FULL WORD OF COLOR I SOLATE THE COLOR B ITS ~ LOW 2 BiTS ) GET BIT CONVERSION MULT[PLIER EXPAND 2 COLOR BITS TO 4 REPLICATIONS PLACE BACK IN WORK REGISTER EXPAND TO 8 REPL I CAT IONS OF COLOR BITS MEO CHAR SAVE-REGE"1 POINTER SAVE THE CODE PO INTER NUMBER OF LOOPS Loose CALL AND XCHG TEST JZ XOR 521 AX,BX AH,AL DL,80H 510 AX,ES: [01 GET CODE POINT DOUBLE UP ALL THE BITS CONVERT TO FOREGROUND COLOR ( 0 BACK SWAP HIGH /LOW BYTES FOR WORD MOVE IS THIS XOR FUNCTION NO, STORE IT IN AS IT [S DO FUNCTION WITH LOWIHIGH "oy ES:[O[],AX LOOSB CALL AND XCHG TEST JZ XOR 521 AX,SX AH,AL DL, BOH 511 AX,ES: [01 +2000H] S8: 01 51 S9: 510: J STORE FIRST BYTE HIGH, GET CODE PO I NT SECOND LOW CONVERT TO COLOR SWAP HIGH/LOW BYTES FOR WORD MOVE AGAIN,' 15 THIS XOR FUNCTION NO, JUST STORE THE VALUES FUNCTION WITH F[RST HALF LOW S 11 : MOV ADD DEC ,JNZ POP POP INC INC LOOP ,JMP GRAPHICS WRITE ES: [0 I +2000H] ,AX Dli80 DH S9 SI DI 01 DI S8 v IDEO RETURN ENDP- ,-------=--- ------------------ -- --- --- --; GRAPHICS READ STORE SECOND PORT I ON H [GH POINT TO NEXT LOCATION KEEP GOING RECOVER CODE PO INTER RECOVER REGEN PO INTER POINT TO NEXT CHAR POS[TION MORE TO WR 1TE ) IBM Personal Computer MACRO Assembler VIDEO! --- 06/10/e5 VIDEO DISPLAY 810S 1523 1524 062A 1525 062A E8 0605 R 1526 0620 88 FO 1527 062F 83 EC 08 1528 0632 88 EC 1529 1530 1531 1532 0634 80 3E 0049 R 06 1533 0639 06 1534 063A IF 1535 063B 72 1536 1537 1538 1539 1540 0630 86 04 1541 063F 1542 063F 8A 04 15430641 884600 1544 0644 45 1545 0645 8A 84 2000 1546 0649 88 46 00 1547 064C 45 1548 0640 83 C6 50 1549 0650 FE CE 1550 0652 75 E8 1551 0654 E8 16 1552 1553 1554 0656 1555 0656 01 E6 1556 0658 86 04 1557 065A 1558 065A E8 06BC R 1559 0650 81 C6 IFFE 1560 0661 E8 06BC R 1561 066481 EE lFB2 1562 0668 FE CE 1563 066A 75 EE 1564 1565 1566 066C 1567 066C SF 0000 E 1568 066F OE 1569 0670 07 15700671 83 ED De 1571 0674 8B F5 1572 0676 FC 1573 0677 80 00 1574 0679 15750679 16 1576 067A IF 1577 0678 BA 0080 1578 067E 1579 067E 56 1580 067F 57 1581 0680 89 0004 1582 0683 F3/ A7 1583 0685 5F 1584 0686 5E 15850687 74 IE 1586 0689 FE CO 1587 0688 83 C7 08 1588 068E 4A 1589 068F 75 ED 1590 1591 1592 15930691 3C 00 15940693 74 12 1595 0695 2B CO 1596 0697 8E 08 1597 1598 0699 C4 3E 007C R 1599 0690 8C CO 1600 069F OB C7 1601 06AI 7404 1602 06A3 BD 80 1603 06A5 E8 02 1604 1605 1606 1607 06A7 1608 06A7 83 C4 08 1609 06AA E9 012E R 161D06AD 161 I 1612 1613 1614 1615 1616 161706AD 1618 06AO 51 1619 06AE 89 0008 1620 0681 1621 0681 DO C8 1622 0683 Dl DO 1623 06B5 01 FD 1624 0687 E2 Fe 1625 1626 0689 95 1627 068A 59 1628 0688 C3 1629 06BC 1630 1631 1632 1633 1634 1635 1636 Version 2.00 ~;~;~~~~- R~~~---;;~~--CALL MOV SUB 1-15 06-10-85 NEAR S26 SI,AX SP,8 BP,SP 1010'1 CONVERTED TO OFFSET I N REGEN SAVE IN 51 ALLOCATE SPACE FOR THE READ COOE POINT PO I NTER TO SAVE AREA DETERM I NE GRAPH I CS MOOES eMP PUSH POP Je «lCRT MOOE,6 E5 as 513 PO I NT TO REGEN SEGMENT MED I UM RESOLUT I ON HIGH RESOLUT I ON READ GET VALUES FROM REGEN BUFFER ANa CONVERT TO CODE PO I NT MOV DH,4 NUMBER OF PASSES S12: AL, [SI 1 [8P] ,AL BP AL,[SI+2000Hj [8P] ,AL BP S 1,80 OH Sl2 SHORT 515 MaY MaY [NC MaY MaY [NC AOO OEC JNZ JMP GET FIRST BYTE SAVE I N STORAGE AREA NEXT LOCAT I ON GET LOWER REG I ON BYTE ADJUST AND STORE PO I NTER I NTO REGEN LOOP CONTROL DO I T SOME MORE GO MATCH THE SAVED CODE POINTS MED 1UM RESOLUT I ON READ 513: MED RES READ OFI"SET"'2" SINCE 2 BYTES/CHAR NUMBER OF PASSES 5AL MaY 5 1,1 DH,4 CALL AOO CALL SUB OEC JNZ 523 5 I, 2000H-2 523 SI,2000H-80+2 OH Sl4 S14: SAVE AREA HAS CHARACTER ;~~~-- GET BYTES FROM REGEN INTO SINGLE SAVE GO TO LOWER REG I ON GET THIS PAIR INTO SAVE ADJUST PO I NTER BACK I NTO UPPER KEEP GO I NG UNT I L ALL 8 DONE [N [T. MATCH IT FIND CHAR ESTABLISH ADDRESSING MaY PUSH POP SUB MaY CLO MaY DI,OFFSET CRT_CHAR_GEN e5 E5 8P,8 SI,ap AL,O ENSURE 0 I RECT I ON CURRENT CODE POINT BEING MATCHED PUSH POP MaY 55 as DX,I28 EST ABL I SH ADDRESS I NG TO STACK FOR THE STR I NG COMPARE NUMBER TO TEST AGA I NST SI SAVE SAVE AREA POINTER SAVE CODE POINTER NUMBER OF WORDS TO MATCH COMPARE THE 8 8YTES AS WORDS RECOVER THE POINTERS CODE POINTS IN CS ADJUST PO I NTER TO START OF SAVE AREA S 16: SI7 : PUSH PUSH MaY REPE POP POP JZ [NC AOO OEC JNZ O[ CX,4 CMPSW O[ SI 518 AL DI,8 I F ZERO FLAG SET, THEN MATCH OCCURRED NO MATCH, MOVE ON TO NEXT NEXT CODE PO I NT LOOP CONTROL 00 ALL OF THEM ox SIT CHAR NOT MATCHED, MIGHT BE CMP JE SUB MaY ASSUME LE5 MaY OR JZ MaY JMP ASSUME ; -~;;~~~- ~~~~ ; ; ; AL<> 0 IF ONLY I ST HALF SCANNED 1F = 0, THEN ALL HAS BEEN SCANNED SIB AX,AX DS,AX OS :ABSO DI,@EXT PTR AX ,ES AX,DI ESTABLISH ADDRESSING TO VECTOR GET PO INTER SEE I F THE PO INTER REALLY EX I STS IF ALL 0, THEN ~OESN'T EXIST NO SENSE LOOK I NG OR I GIN FOR SECOND HALF GO BACK AND TRY FOR IT SIB AL,I28 Sl6 DS:DATA CHARACTER AOO JMP GRAPH I CS _READ IN USER SUPPLIED SECOND HALF AL,O I S FOUND 1 AL=O SP,8 V IDEO RETURN ENDP - I F NOT FOUND 1 ; ; READJUST THE STACK, ALL DONE THROW AWAY SAVE - - - --- - ---------- TH I S ROUT I NE TAKES THE BYTE IN AL AND DOUBLES ALL OF THE BITS, TURNING THE 8 BITS INTO 16 BITS. THE RESULT I S LEFT ! N AX ;; ~ - - - - - ;~;~ - - - - ~~~; PUSH MOV CX CX,8 SAVE REGI STER SH I FT COUNT REG I STER FOR ONE BYTE ROR RCR AL, I BP,! BP, I 522 SHIFT BITS, LOW BIT INTO CARRY FLAG MOVE CARRY FLAG (LOW BIn INTO RESULTS SIGN EXTEND HIGH BIT (DOUBLE IT) REPEAT FOR ALL 8 BITS AX,BP MOVE RESULTS TO PARAMETER REG I STER RECOVER REGI STER ALL DONE S22 : 5AR LOOP 2[ XCHG POP RET ENDP CX MED READ BYTE THIS ROUTINE WILL TAKE 2 BYTES FROM THE REGEN BUFFER, COMPARE AGA I NST THE CURRENT FOREGROUND COLOR, AND PLACE THE CORRESPONDING ON/OFF BIT PATTERN INTO THE CURRENT POSITION IN THE SAVE AREA ENTRY -- VIDEO 1 5-157 IBM Personal Computer MACRO Assembler VIDEOI --- 06/10/85 VIDEO DISPLAY BIOS 1637 1638 1639 I b40 1 b41 1 b42 1643 1644 1645 1646 1 b47 1648 1649 lb50 1 b51 1652 1653 1654 1655 1656 Ib57 1658 1659 1660 I bIOI 1662 1663 I b64 1665 1666 1667 Version 2.00 1-16 06-10-85 ; SI,OS = POINTER TO REGEN AREA OF ; BX = EXPANDED FOREGROUND COLOR BP::: POINTER TO SAVE AREA ; ; EXIT -; SI AND BP ARE INCREMENTED INTEREST ~~~-----;;~~----------------------------------------- 06BC 06BC 06BO 06BF 06C2 06C4 06C4 ObC6 06C8 06C9 06C9 06CB 06CE 0600 0603 0604 0605 AD 86 C4 89 COOO 82 00 LODSW XCHG MOV MOV S24: 85 CI 74 01 F9 TEST JZ STC AX,CX IS THIS SECTION BACKGROUND? IF ZERO, IT IS BACKGROUND (CARRY:::OI WASN' T, SO SET CARRY 525 S25: DO CI 73 8S 45 C3 02 E9 02 F4 56 00 523 ; ----; , ; 1b68 1E>69 16070 16011 06005 Ib12 0605 AI I b13 0608 1614 0608 1675 0609 1616 060B 1617 0600 1618 06EI 1679 06E4 1680 06E6 1681 06E8 1682 06E9 1 b83 06EA 1684 1685 1686 1681 1688 1689 1690 1691 1692 1693 1694 1695 1696 1691 1698 1699 1100 1701 1702 1703 1704 1705 1706 1707 06EA 1708 06EA 1709 06EB 1710 06EC 1 71 I 06EE 1712 06F2 1713 06F4 1714 1115 1116 1717 06F5 1118 06F7 1119 1120 1121 06F9 1122 06F9 1123 06FB 1724 06FE 1725 1726 1727 t 728 0700 1729 0702 1730 0106 1731 0708 1732 070A 1733 0100 1734 1735 1736 010F 1737 070F 11380711 1139 1140 1741 11420713 1743 0716 11440718 1745 071A 1746 071C 1747 071E 1748 0720 1749 0720 1750 0722 GET FIRST BYTE AND SECOND BYTES SWAP FOR COMPARE 2 BIT MASK TO TEST THE ENTRIES RESULT REG I STER AL,AH CX,OCOOOH DL, 0 53 8B 8A F6 Cl 2A 03 5B C3 08 C4 26 004A R EO 02 FF C3 MOVE THAT B IT I NTO THE RESULT MOVE THE MASK TO THE RIGHT BY 2 BITS 00 IT AGAIN IF MASK DIDN'T FALL OUT STORE RESULT IN SAVE AREA ADJUST PO INTER ALL DONE DL,' CX,2 52. [BPJ,OL BP -- - ---------- -- -- --- - ---- ------ - -- -- V4 POSITION THIS ROUTINE TAKES THE CURSOR POSITION CONTAINEO IN THE MEMORY LOCATION, AND CONVERTS IT INTO AN OFFSET INTO THE REGEN BUFFER, ASSUMING ONE BYTE/CHAR. FOR MEDIUM RESOLUTION GRAPHICS, THE NUMBER MUST BE DOUBLED. ENTRY -- NO REGISTERS,MEMORY LOCATION @CURSOR POSN IS USED EXIT-AX CONTAINS OFFSET INTO REGEN BUFFER ~~~ 0050 R RCL SHR JNC MOV INC RET ENDP -- -- - ;;~~ - - - - ~~~; ---- - - - - - - - - - - - ---- - -- MOV AX ,!PCURSOR POSN GET CURRENT CURSOR LABEL NEAR GRAPH PQSN PUSH ex SAVE REGISTER MOV BX,AX SAVE A COPY OF CURRENT CURSOR MOV AL,AH GET ROWS TO AL MUL BYTE PTR !PCRT COLS MULTIPLY BY BYTES/COLUMN SHL AX,2 MULTIPLY· 4 SINCE 4 ROWS/BYTE I SOLATE COLUMN VALUE SUB BH,BH ADD AX ,ex DETERM I NE OFFSET POP BX RECOVER PO INTER RET ALL DONE S26 ENDP : --- WR I TE_ TTY -------- ------------------------ -------------------------------THIS INTERFACE PROVIDES A TELETYPE LIKE INTERFACE TO THE V IDEO CARDS. THE J NPUT CHARACTER IS WR I TTEN TO THE CURRENT CURSOR POSITION, AND THE CURSOR IS MOVED TO THE NEXT POSITION. IF THE CURSOR LEAVES THE LAST COLUMN OF THE FIELD, THE COLUMN IS SET TO ZERO, AND THE ROW VALUE I S INCREMENTED. I F THE ROW ROW VALUE LEAVES THE FIELD, THE CURSOR IS PLACED ON THE LAST ROW, FIRST COLUMN, AND THE ENTIRE SCREEN IS SCROLLED UP ONE LINE. WHEN THE SCREEN I S SCROLLED UP, THE ATTR I BUTE FOR FILL I NG THE NEWL Y BLANKED LINE I S READ FROM THE CURSOR POS I T I ON ON THE PREV I OUS LINE BEFORE THE SCROLL, IN CHARACTER MODE. IN GRAPHICS MODE, THE 0 COLOR IS USED. ENTRY -(AH) CURRENT CRT MODE ( AL J CHARACTER TO BE WR I TTEN NOTE THAT BACK SPACE, CARRIAGE RETURN, BELL AND LINE FEED ARE HANDLED AS COMMANOS RATHER THAN AS DISPLAY GRAPHICS CHARACTERS (BL J FOREGROUND COLOR FOR CHAR WR I TE IF CURRENTLY I N A GRAPH I CS MODE EX I T -ALL REGISTERS SAVED = = = ; 50 50 B4 03 8A 3E 0062 R CD 10 58 ----------- -- - - - - - - - - - -- - -- - - - - - - - - - - - - - - - -- -- -- - - - - - --- - - - - -- - - - -- - - - - - - - - - -- ASSUME WRITE TTY PUSH PUSH MOV MOV INT POP ;----- DS:DATA PROC NEAR AX AX AH,03H ~~H (tACT I VE_PAGE SAVE REGISTERS SAVE CHARACTER TO WR I TE GET CURRENT PAGE SETTI NG READ THE CURRENT CURSOR pas I TI ON RECOVER CHARACTER AX OX NOW HAS THE CURRENT CURSOR POSITION 3C 00 7646 eMP JBE B4 OA B9 000 I CD 10 MOV MOV INT I SIT CARR I AGE RETURN OR CONTROL GO TO CONTROL CHECK S I FIT I S AL,CR U8 WR I TE THE CHAR TO THE SCREEN AH,OAH CX,I 10H WR I TE CHARACTER ONLY COMMAND ONL Y ONE CHARACTER WR I TE THE CHARACTER POS I T I ON THE CURSOR FOR NEXT CHAR FE 3A 75 B2 80 15 C2 1 b 004A R 33 00 FE 18 2A INC CMP JNZ MOV eMP JNZ OL DL, BYTE PTR @CRT COLS U1 DL,O OH,25-1 TEST FOR COLUMN OVERFLOW SET CURSOR COLUMN FOR CURSOR CHECK FOR LAST ROW SET_CURSOR_INC UO SCROLL REQU I RED MOV INT B4 02 CO 10 5-158 ;----AO 3C 12 3C B1 75 0049 R 04 06 07 00 06 AH,02H 10H MOV eMP Je CMP MOV JNE AL,@CRT MODE AL,4 U2 AL,7 SH,O MOV INT AH,08H 10H U3 U2: B4 08 CD 10 VIDEO 1 : SET THE CURSOR DETERMINE VALUE TO FILL WITH DURING SCROLL GET THE CURRENT MODE ; READ-CURSOR FILL WITH BACKGROUND SCROLL-UP READ-CURSOR GET READ CURSOR COMMAND READ CHAR/ATTR AT CURRENT CURSOR IBM Personal Computer MACRO Assembler VIDEOI --- 06/10/85 VIDEO DISPLAY BIOS 1151 1152 1153 1154 1155 1156 0124 0726 0126 0129 012B 0720 1751 0131 8A Fe 1-11 06-10-85 Version 2.00 MOV 8H,AH MOV SUB MOV MOV DEC AX,0601H CX,CX OH,25-1 DL ,8YTE PTR PCRT_COLS OL STORE IN 8H SCROLL-UP SCROLL ONE LINE UPPER LEFT CORNER LOWER RIGHT ROW LOWER RIGHT COLUMN U3: BS 060 I 2B C9 B6 18 8A 16 004A R FE CA 1156 0733 17590733 CO 10 1760 0135 1161 0135 58 1162 0136 E9 0 12E R 1163 1164 0139 1165 0139 FE C6 1166 0138 1161 0138 84 02 1168 0130 E8 F4 \ 169 1170 1711 013F 1112 013F 74 13 11730141 3C OA 17140143 14 13 1715 0745 3C 01 1716 0741 74 16 1771 0149 3C 08 1718 0148 15 AC 1719 1180 1781 1182 0740 OA 02 1183 014F 74 EA 1184 0151 4A 1185 0152 E8 El 1186 \ 187 1188 1189 0154 1190 0154 82 00 1191 0756 E8 E3 1192 1193 1194 t 195 0158 1196015880 FE 18 1191 0158 15 DC 1198 0750 E8 80 1199 1800 1801 1802 075F 1803 015F B9 0533 1804016283 IF 1805 0164 E8 0000 E 180& 07&1 E8 CC 1801 0169 1808 1809 1810 1811 1812 1813 1814 1815 181 & 1811 1818 1819 1820 1821 1822 1823 0169 03 03 05 05 03 03 1824 03 04 1825 1826 1821 0111 182B 0111 84 00 1829011388 160063 R 1830 0111 83 C2 06 1831 011A EC 1832 0118 A8 04 1833 0110 14 03 1834 011F E9 0603 R 1835 INT IDH POP JMP AX V IDEO_RETURN INC DH MDV JMP AH,02H U4 US: U6: SET-CURSOR-I NC NEXT ROW SET-CURSOR Ul: 1----- ESTABLISH THE NEW CURSOR CHECK FOR CONTROL CHARACTERS U8: JE CMP JE CMP JE CMP JNE U9 AL,LF UID AL,07H Ull AL,08H UO WAS I T A CARR I AGE RETURN IS IT A LINE FEED GO TO LINE FEED IS IT A BELL GO TO BELL IS I T A BACKSPACE IF NOT A CONTROL, 01 SPLAY IT 8ACK SPACE FOUND OR ; ----- JE DL,DL U7 DEC JMP U7 IS IT ALREADY AT START OF LINE SET CURSOR NO JUST MOVE IT BACK SET_CURSOR -=-- OX CARR I AGE RETURN FOUND U9: MOV JMP 1----- DL,O U7 MOVE TO FIR S T COLUMN SET_CURSOR LINE FEED FOUND Ul0: CMP JNE JMP 1----- DH,25-1 U6 UI BOTTOM OF SCREEN YES, SCROLL THE SCREEN NO, JUST SET THE CURSOR BELL FOUND Ull : MOV CX,1331 o I V I SOR FOR 896 HZ TONE MOV 8L,31 SET COUNT FOR 31 /64 SECOND FOR BEEP CALL 8EEP SOUND THE POD BELL JMP US TTY_RETURN WRITE_TTY ENDP ; - - - - - - ---- -- -- - - - - - - - - - - - - - - - - - -- -- -- - - - - - - - - - - - ------I LIGHT PEN I THIS ROUTINE TESTS THE LIGHT PEN SWITCH AND THE LIGHT ; PEN TRIGGER. IF BOTH ARE SET, THE LOCATION OF THE LIGHT ; PEN IS DETERMINED. OTHERWISE, A RETURN WITH NO INFORMATION ; IS MADE. I ON EXIT: ; (AHI 0 IF NO LIGHT PEN INFORMATION IS AVAILABLE ; ex, CX, OX ARE DESTROYED ; (AH) = , IF LIGHT PEN IS AVAILABLE (DH.DLl ROW,COLUMN OF CURRENT LIGHT PEN POSITION ; (CH) = RASTER POSITION I (BX) BEST GUESS AT PIXEL HORIZONTAL POSITION : ; - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - -- - - - - --- -- - -- - - - -ASSUME OS :OATA VI DB 3,3,5,5,3,3,3,4 ; SUBTRACT_TA8LE - --- -- -- - ---- --- ---- = = = ---- ;----- -- ---- - WAIT FOR LIGHT PEN TO BE DEPRESSED READ LPEN MOV MOV ADD IN TEST JZ JMP 183b 1831 1838 0182 A8 1839 0184 15 1840 0186 E9 1841 1842 1843 1844 0189 18450189 B4 1846 1841 1848 1849018888 1850 078F 8A 1851 0191 EE 1852 0792 E8 1853 0794 42 1854 0795 EC 1855 0796 8A 1856 0798 4A 1851 0199 FE 1858 019B 8A 1859 0790 EE 1860 019E 42 1861 079F E8 1862 07Al EC 1863 07A2 8A 1864 V IDEO-CALL -RETURN SCROLL UP THE SCREEN TTY-RETURN RESTORE THE CHARACTER RETURN TO CALLER U4: PROC NEAR AH,O OX, ItIADDR 6845 DX,6 AL,DX AL,004H V6 A V6- SET NO LIGHT PEN RETURN CODE CET BASE ADDRESS OF 6845 POINT TO STATUS REGI STER GET STATUS REG I STER TEST LIGHT PEN SWITCH GO IF YES NOT SET. RETURN NOW TEST FOR LIGHT PEN TR I GGER 02 03 0800 R V6_A: ;----- TEST JNZ JMP AL,2 V7A V1 TRIGGER HAS BEEN SET, READ THE TES T LIGHT PEN TR I GGER RETURN WITHOUT RESETT I NG TR I GGER VALUE IN V1A: 10 MDV INPUT REGISTERS POINTED TO BY A,H, AND CONVERT TO ROW COLUMN lb 0063 R C4 MOV MOV OUT JMP INC IN MOV DEC INC MOV OUT INC JMP IN MOV ADDRESS REGI STER FOR 6845 REG I STER TO READ SET IT UP I/O DELAY DATA REGISTER GET THE VALUE SAVE IN CX ADDRESS REC I STER 00 E8 C4 C4 00 E5 AH,16 DX,@ADDR 6845 AL,AH DX,AL '.2 OX AL,DX CH,AL OX AH AL,AH DX,AL OX '.2 AL,DX AH,CH LIGHT PEN REG I STERS ON 6845 IN (OX) SECOND DATA REGI STER POINT TO DATA REGISTER I/O DELAY GET SECOND DATA VALUE AX HAS I NPUT VALUE VIDEO 1 5-159 IBM Personal Computer MACRO Assembler VIDEOI --- 06/10/85 VIDEO DISPLAY BIOS 1865 1866 1867 1868 1669 1810 1811 1612 1813 Version 2.00 AX HAS THE VALUE READ 8A IE 0049 R 2A FF 2E: 6A 9F 0769 R 28 C3 88 IE 004E R 01 EB 28 C3 1674 0789 79 02 1815 018B 28 CO 1816 1677 1816 1819 0180 1660 07ao al 03 '68' 078F 60 3E 0049 R 04 1882 01C4 72 29 1883 07C6 60 3E 0049 R 01 1884 07CB 14 22 1865 1886 1867 1888 01CO 82 28 1889 01CF Flo F2 1890 1891 1892 1893 0101 8A E8 1894 0703 02 ED 1895 0105 8A DC 1896 0101 2A FF 1897 0109 80 3E 0049 R 06 1898 010E 15 04 1899 OlEO 81 04 1900 07E2 DO E4 1901 07E4 1902 01E4 03 E3 1903 1904 01A4 01A8 01AA OlAF 0181 0785 0187 MOV SUB MOV SUB MOV SHR SUB JNS SUB ;----- 1-16 06-10-85 IN FROM THE 6845 ~~::~RT_MODE 8L,CS)VI [eX] AX,ax 8X,OCRT START BX,I AX,8X V2 AX,AX MOV CMP JB CMP JE CL,3 aJCRT MODE,4 V4 (tCRT MODE,7 YO - ALPHA_PEN oL,40 OL DIVISOR FOR GRAPHICS DETERM I NE ROW (AL) AND COLUMN I AH I AL RANGE 0-99, AH RANGE 0-39 DETERMINE GRAPHIC ROW POSITION MOV ADO MOV SUB CMP MOV SAL CH,AL CH,CH BL,AH SH,SH (lCRT _MODE, 6 V3 CL,4 AH,I SHL BX,CL JNE V3; ;----- DETERM I NE MODE SET ·6 SHTFT COUNT DETERMINE IF GRAPHICS OR ALPHA ALPHA_PEN GRAPHICS MODE MOV OIV ;----- CONVERT TO COR~ECT PAGE OR I GIN IF POSITIVE, DETERMINE MODE <0 PLAYS AS 0 DETERMINE MODE OF OPERATION V2. ;----- ; MODE VALUE TO BX ; DETERM I NE AMOUNT TO SUBTRACT ; TAKE IT AWAY SAVE ROW VALUE IN CH ·2 FOR EVEN/ODD FIELD COLUMN VALUE TO SX MULTIPLY BY 8 FOR MEDIUM RES DETERM I NE MED JUM OR HIGH RES NOT HIGH RES SHIFT VALUE FOR HIGH RES COLUMN VALUE TIMES 2 FOR HIGH RES NOT HIGH RES MULTIPLY-·16 FOR HIGH RES DETERMINE ALPHA CHAR POSITION 190~ 1906 1901 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 192a 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 01E6 07E8 07EA OlEO 8A 8A CO EB 04 FO EE 02 12 MOV MOV SHR JMP ;----- 01EF 01EF Flo 01F3 8A 07F5 8A 01F7 02 01F9 8A 07FB 8A 01FD 32 07FF 03 0801 0801 84 0803 0603 52 0804 88 0808 83 0808 EE 080C SA 0800 080050 060E SF 080F 5E 0810 IF 0811 IF 0812 IF 0813 IF 0814 01 0815 CF 0816 0816 5-160 36 004A R FO 04 EO E6 DC FF E3 DL,AH DH,AL DH,2 SHORT V5 ALPHA MODE ON LIGHT PEN OIV MOV MOV SAL MOV MOV XOR SAL BYTE PTR (lCRT COLS DH,AL OL,AH AL,CL CH,AL BL,AH SH,SH aX,CL PUSH MOV ADO OUT POP OX OX, (tADDR 6845 DX,l DX,AL OX V5. 01 AH, I V6. 16 0063 R C2 07 V7. POP POP POP POP POP POP POP POP IRET READ LPEN CODEENDS END VIDEO 1 COLUMN VALUE FOR RETURN ROW VALUE DIVIDE BY 4 FOR VALUE IN 0-24 RANGE LIGHT _PEN_RETURN_SET ALPHA PEN DETERM I NE ROW, COLUMN VALUE ROWS TO OH COLS TO DL MULTIPLY ROWS· 8 GET RASTER VALUE TO RETURN REGISTER COLUMN VALUE TO 8X LIGHT PEN RETURN SET INDICATE EVERY THING SET LIGHT PEN RETURN SAVE RETURN VALUE (IN CASE) ; GET 8ASE ADDRESS PO I NT TO RESET PARM ADDRESS, NOT DATA, IS IMPORTANT RECOVER VALUE RETURN_NO_RESET BP DI 51 DS DS DS DS ES ENDP DISCARD SAVED eX,CX,DX IBM Personal Computer MACRO ASSflmblflr BIOS ----- 06/10/85 BIOS ROUTINES I 2 3 . PAGE 118,121 TITLE BIOS ----- 06/10/85 BIOS ROUTINES .286C .LIST CODE SEGMENT BYTE PUBL I C 4 5 I-I 06-10-85 Vflr'SIOn 2.00 0000 1 8 9 PUBL I C PUBLIC PUBLIC EQU I PMENT 1 MEMORY SIZE DET 1 NMI_INT_I - EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN C8042 :NEAR CMOS READ: NEAR 01 :NEAR D2:NEAR D2A :NEAR DDS :NEAR OBF 42 :NEAR PRT-HEX :NEAR PRT-SEG:NEAR P _tiSG:NEAR ID " 12 13 14 15 I. 11 18 19 20 21 22 : --- I NT 23 ; ; 24 25 2. 21 28 29 30 ; : ; 31 ; ; 32 ; 33 ; 39 40 ; ; 41 ; ; 42 43 44 45 5. ALL INSTALLED MEMORY IS FUNCTIONAL. IF THE MEMORY TEST DURING POST INDICATES LESS, THEN THIS VALUE BECOMES THE DEFAULT. IF NON-VOLATILE MEMORY IS NOT VALID (NOT INITIALIZED OR BATTERY FAILURE) THEN ACTUAL MEMORY DETERMINED BECOMES THE DEFAULT. 3. ALL MEMORY FROM 0 TO 640K MUST BE CONT] GUOUS. OUTPUT ; ; 0000 0000 0001 0002 0005 0008 0009 FB IE E8 0000 E AI 0013 R IF CF OOOA (AX) = NUMBER OF CONT I GUDUS 1K BLOCKS OF MEMORY ---- - - - ASSUME --- -- - - ---- - - - - -- - - - - ----- - - ---- - - - --- - - -- - - - -- - --- - - ---- -- - - - - -- - --CStCOOE,OSIOATA -' MEMORY SIZE OET 1 - STI- PROC FAR PUSH OS CALL ODS Mav AX, OMEMORY SIZE POP OS IRET MEMORY_SIZE_DET_l ENDP I NTERRUPTS BACK ON SAVE SEGMENT EST ABLI SH ADDRESS] NG GET VALUE RECOVER SEGMENT RETURN TO CALLER ;--- INT 11 H ---------------------------------------------------------------EQU I PMENT OETERM I NAT I ON THIS ROUTINE ATTEMPTS TO DETERMINE WHAT OPTIONAL DEVICES ARE ATTACHED TO THE SYSTEM • INPUT NO REGISTERS THE IIIEQUIP FLAG VARIABLE IS SET DURING THE POWER ON 01 AGNOST I CS US I NG THE FOLLOW I NG HARDWARE ASSUMPTI ONS: PORT 03FA INTERRUPT 10 REGISTER OF 8250 (PRIMARY) 02FA = INTERRUPT 10 REGISTER OF 8250 ISECONDARYl 81TS 7-3 ARE ALWAYS 0 PORT 0378 OUTPUT PORT, OF PRINTER IPRIMARY) 0278 OUTPUT PORT OF PRINTER ISECONDARYJ 03BC = OUTPUT PORT OF PRINTER (MONOCHROME-PRINTER) OUTPUT (AX) IS SET, BIT SIGNIFICANT, TO INDICATE ATTACHED I/O BIT 15,14 NUMBER OF PRINTERS ATTACHED BIT 13 INTERNAL MODEM INSTALLED BIT 12 NOT USED BIT 1 1 , 1 0,9 = NUMBER OF RS232 CARDS ATTACHED BIT 8 NOT USED BIT 7,6 = NUMBER OF DISKETTE DRIVES 00=1,01=2 ONLY IF BIT 0 = 1 BIT 5,4 INITIAL VIDEO MODE 00 - UNUSED 01 - 40X25 BW USING COLOR CARD 10 - 80X25 BW US I NG COLOR CARD 1 1 - 80X25 BW US I NG BW CARD 51 58 59 .0 ., ...,•• .2 .3 = •5 .9 = = .8 10 11 12 13 14 15 16 11 18 19 80 81 82 83 84 85 8. = = = = BIT 3 = NOT USED BIT 2 = NOT USED BIT 1 MATH COPROCESSOR BIT 0 = 1 (IPL DISKETTE INSTALLED) NO OTHER REGISTERS AFFECTED 81 = 88 89 90 ; 91 92 93 94 95 96 97 98 99 100 CONFIGURATION RECORD IN NON-VOLATILE MEMORY EQUALS THE ACTUAL MEMORY SIZE INSTALLED. ; 31 38 48 49 50 51 52 53 54 55 I. 2. ; 3. ..., 12 H ---------------- - ---------------------- ------------------------MEMORY S [ZE DETERM I NE THIS ROUTINE RETURNS THE AMOUNT OF MEMORY IN THE SYSTEM AS DETERMINED BY THE POST ROUTINES. (UP TO 640K) NOTE THAT THE SYSTEM MAY NOT BE ABLE TO USE I/O MEMORY UNLESS THERE I S A FULL COMPLEMENT OF 512K BYTES ON THE PLANAR. INPUT NO REGISTERS THE IIIMEMORY SIZE VAR I ABLE I S SET OUR I NG POWER ON 0 I AGNOST I CS ACCORD I NG TO THE FOLLOW I NG ASSUMPT IONS: ; ; 34 35 POST SEND 8042 COMMAND ROUTI NE READ CMOS LOCATION ROUTINE ~PARITY CHECK I" MESSAGE "PARITY CHECK 2" MESSAGE "?7?7?" UNKNOWN ADDRESS MESSAGE LOAD (OSl WITH DATA SEGMENT SELECTOR POST WA I T 8042 RESPONSE ROUT I NE 01 SPLA Y CHARACTER ROUT I NE 01 SPLA Y FIVE CHARACTER ADDRESS ROUT I NE DISPLAY MESSAGE STRING ROUTINE OOOA OOOA FB 00 DB IE 00 DC E8 0000 E OOOF AI ~OlO R 0012 IF 0013 CF 0014 - - - - - ---- - - - - --- - - - - - -- - - - - - -- - - - - - -- - - - - --- - - - - --- - - ---- -- - - - ----- -- ---- -- --- EQU I PMENT 1 PROC FAR STI PUSH as CALL 005 AX.I!!IEQUIP FLAG "OV POP IRET EQU I PMENT_l as - ENTRY POINT FOR ORG OF840H I NTERRUPTS BACK ON SAVE SEGMENT REGISTER ESTABLISH ADDRESSING GET THE CURRENT SETT I NGS RECOVER SEGMENT RETURN TO CALLER ENDP BIOS 5-161 IBM Personal Computer MACRO Assembler 8105 ----- 06/10/85 8105 ROUTINES 101 102 103 104 105 10. 107 108 109 110 111 112 113 114 115 11. 117 1 18 119 120 121 122 123 124 125 12. 127 126 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 ISO 151 f 52 153 154 155 156 157 156 159 160 161 "2 163 164 165 166 167 168 "9 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 20 I 202 203 204 Vers'on 2.00 1-2 06-10-85 PAGE ;-- HARDWARE INT 02 H -- ( NMI LEVEL I ---- ---------------------------------NON-MASKABLE INTERRUPT ROUTINE (REAL MODE) THIS ROUTINE WILL PRINT A "PARITY CHECK 1 OR 2" MESSAGE AND ATTEMPT TO FIND THE STORAGE LOCATION IN BASE 040K CONTAINING THE BAD PARITY. IF FOUND, THE SEGMENT ADDRESS WILL BE PRINTED. IF NO PARITY ERROR ????? WILL BE 0 I SPLA YEO CAN 8E FOUND (I NTERM I TTENT READ PROBLEM I WHERE THE ADDRESS WOULD NORMALLY GO. PAR I TY CHECK 1 PAR I TY CHECK 2 ; 0014 001450 NM1 - 1 PROC 1NT - PUSH 0015 E4 61 00 I 7 A8 CO 0019 75 07 IN TEST 001880 00 0010 E8 0000 E 0020 58 0021 CF 0022 0022 0023 0025 0027 0029 002e 002F 0031 0034 PLANAR BOARD MEMORY FA I LURE. NEAR AX SAVE OR I G I NAL CONTENTS OF AL,PORT_B AL, PAR ITY _ERR READ STATUS PORT PARITY CHECK OR 1/0 CHECK? GO TO ERROR HALTS IF HARDWARE ERROR JNZ NM1 MOY CALL AL,CMOS_REG_O CMOS READ -1 POP AX 80 70 AD 0000 E 0000 E 00 0049 R 10 -" PUSH AX MOY OUT MOY AL,CMOS_REG_D+NMI CMOS _PORT ,AL AL,OIS_KBO C8042 CALL CALL MOY MOY 1NT 0036 0037 003A 003C 58 8E 0000 E A8 80 74 05 003E 003F 0042 0043 0043 0046 0048 004A 50 E8 0000 E 58 POP MOY NM1 8E A8 74 E8 0000 E 40 03 0000 E - HARDWARE ERROR SAVE INITIAL CHECK MASK IN (ALI MASK TRAP (NM I I I NTERRUPTS OFF o I SABLE THE KEYBOARD SEND COMMAND TO ADAPTER ADDRESS OAT A SEGMENT INITIALIZE AND SET MODE FOR VIDEO GET CURRENT MODE CALL VIDEO_IO TO CLEAR SCREEN 005 AH,D AL,'lICRT_MOOE IOH DI SPLAY HPARITY CHECK (AX I ELSE ?? - LEAVE NM I ON TOGGLE NM I US I NG COMMON READ ROUT I NE RESTORE ORIGINAL CONTENTS OF (AXI EX I T NM I HANDLER BACK TO PROGRAM - IRET NM1 50 80 E6 BO E6 E8 84 AO CD = PLANAR BOARD MEMORY FA I LURE. = OFF - -- --- - - - - - - - - - - - - -- - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - -- -- ERROR MESSAGES RECOVER INITIAL CHECK STATUS PLANAR ERROR, ADDRESS "PARITY CHECK CHECK FOR PLANAR ERROR SKIP IF NOT AX TEST SI ,OFFSET D1 AL, PAR I TY _CHECK JZ NM1 PUSH CALL P MSG POP AX SAVE STATUS DISPLAY "PARITY CHECK 1" MESSAGE AND RECOVER STATUS MOY S I ,OFFSET 02 AL,lo_CHECK NM1 3 P _MSG ADDRESS OF "PARITY CHECK 2" MESSAGE I/O PAR I TY CHECK ? SK I P I F CORRECT ERROR 0 I SPLA YEO DISPLAY "PARITY CHECK 2" ERROR - 2 AX I" 2, TEST JZ CALL ;----- TEST FOR HOT NMI 0040 0040 004F 0051 0053 0055 E4 61 DC DC E661 24 F3 Eo 01 IN OR OUT AND OUT 0057 0058 005A 005C 005E 0060 FC 28 2B E4 A8 75 CLO SUB SUB IN 02 F6 61 CO 19 TEST JNZ ON PLANAR PAR ITY LINE AL,PoRT 8 AL, RAM PAR OFF PORT 8~AL AL ,RAM PAR ON PORT_B~AL - TOGGLE PARITY CHECK ENABLES TO CLEAR THE PEND I NG CHECK SET DIRECT I ON FLAG TO INCREMENT POINT (OX) AT START OF REAL MEMORY SET (SII TO START OF (05:1 READ CURRENT PAR I TY CHECK LATCH CHECK FOR HOT NM I SOURCE SKIP IF ERROR NOT RESET (DISPLAY ???I OX,OX SI,SI AL,PORT 8 AL ,PAR (TY ERR NMI_5 - SEE IF LOCATION THAT CAUSED PARITY CHECK CAN BE FOUND IN BASE MEMORY 0062 88 IE 0013 R 0066 0066 8E DA 0068 89 8000 0068 F3/ AD 0060 E4 61 006F A8 CO 00717510 007380 0076 83 0079 77 0078 0078 8E 007E E8 0081 FA 0082 F4 0083 0083 0086 0088 0088 0080 0090 0092 0095 0096 NM1 C6 10 E8 40 EB NM1 0000 E 0000 E - 5, 8X, OlIMEMORY _S I ZE ; GET BASE MEMORY SIZE WORD MOY MOY REP IN ; PO I NT TO 64K SEGMENT SET WORD COUNT FOR 64 KB SCAN READ 64 KB OF MEMORY READ PAR I TY CHECK LATCHES CHECK FOR ANY PARITY ERROR PENDING GO PRINT SEGMENT ADDRESS IF ERROR TEST OS,DX CX,4000H·2 LDDSW AL,PORT_B AL,PARITY_ERR JNZ NM1 ADO SUB JA DH,OIOH 8X,(6D·4 MOY S I • OFFSET D2A P _MSG CALL 0000 28 0000 53 0000 29 0000 E - 6, CALL MOY E CALL MOY E CALL MOY E CALL CL1 HLT 0097 NM1 0091 CODE 5-162 MOY NM1 - . -4 CLI HLT NM1 E8 BO E8 80 E8 80 E8 FA F4 - 4, 1NT - I ENOP ENDS END BIOS PO I NT TO NEXT 64K BLOCK DECREMENT COUNT OF 1024 BYTE SEGMENTS LOOP TI LL ALL 64K SEGMENTS DONE PRINT ROW OF 1???? IF PARITY CHECK COULD NOT BE RE-CREATED HALT SYSTEM PRT SEG AL,T( • PRT HEX AL,'S' PRT HEX AL,'I' PRT_HEX PRINT SEGMENT VALUE PRINT (S) HALT SYSTEM (IN OX) 1-1 06-10-65 IBM Personal Computer MACRO Asselllbler Version 2.00 BIOSI ---- 06110165 INTERRUPT ISH BIOS ROUTINES I 2 3 4 5 6 7 8 • 0000 PAGE 116,121 TITLE BIOSI ---- 06/10/85 INTERRUPT .266C .LIST CODE SEGMENT BYTE PUBLI C PUBLIC PUBLIC PUBL I C CASSETTE 10 1 GATE A20SHUT9 EXTRN EXTRN EXTRN EXTRN EXTRN CMOS READ: NEAR CMOS-WR I TE: NEAR CONF-TBL:NEAR DDS:NEAR PROC _SHUTDOWN I NEAR ISH BIOS ROUTINES 10 II 12 13 14 15 16 17 18 I. 20 21 22 23 24 25 26 27 28 2. 30 31 32 33 34 35 36 37 38 INT 15 H ----------------------------------------------------------------INPUT - CASSETTE I/O FUNCTIONS (AH) :: OOH (AH) = 01H (AH) :: 02H (AHI = 03H RETURNS FOR THESE FUNCTIONS ALWAYS I F CASSETTE PORT NOT PRESENT EXTENSIONS (AH) 60H DEVICE OPEN IBX) :: DEVICE 10 (CX) :: PROCESS 10 (AH) 6tH DEVICE CLOSE (BX) :: DEVICE 10 (CX) :: PROCESS 10 (AH) 62H PROGRAM TERMINATION (BX) :: DEVICE 10 (AH) 83H EVENT WAIT 43 44 45 .7 .8 (AH) = MH. CY = I) INPUT - UNUSED FUNCTIONS (AH) = 04H THROUGH 7FH RETURNS FOR THESE FUNCTIONS ALWAYS (AHI = 66H. CY = II (UNLESS INTERCEPTED BY SYSTEM HANDLERS) NOTE: THE KEYBOARD INTERRUPT HANDLER INTERRUPTS WITH AH=4FH 3' 40 41 42 READ CMOS LOCATION ROUTINE WR I TE CMOS LOCAT I ON ROUT I NE SYSTEM/BIOS CONFIGURATION TABLE LOAD (OS) WITH DATA SEGMENT SELECTOR 60286 HARDWARE RESET ROUTINE 46 (AL) :: OOH SET INTERVAL (ESIBX) POINTER TO A BYTE IN CALLERS MEMORY THAT WILL HAVE THE HIGH ORDER BIT SET AS SOON AS POSSIBLE AFTER THE INTERVAL EXPIRES. (CX,DX) NUMBER OF MICROSECONDS TO ELAPSE BEFORE POSTING. (AL) = OIH CANCEL 4. 50 51 52 53 54 55 56 57 58 5' RETURNS: (AH) :: S4H 60 61 62 63 6. 65 66 67 68 6' 70 .JOYSTICK SUPPORT (OX) = OOH - READ THE RETURNS AL = (OX) :: OIH - READ THE RETURNS AX :: BX = CX :: OX:: = 85H SYSTEM REQUEST KEY PRESSED (ALI :: OOH MAKE OF KEY (AL) = OIH BREAK OF KEY (AH) = 86H WAIT (CX,DXI (AH) = MOVE BLOCK (CX I NUMBER OF WORDS TO MOVE (ES:SI} POINTER TO DESCRIPTOR TABLE (AH) = 88H = 8.H = 'OH EXTENDED MEMORY 5 I ZE DETERM I NE = I NTERRUPT COMPLETE FLAG SET (AL I TYPE CODE OOH -> 7FH SERIALLY REUSABLE DEVICES OPERATING SYSTEM MUST SERIALIZE ACCESS SOH -> BFH REENTRANT DEV I CES I ES: BX I S USED TO DISTINGUISH DIFFERENT CALLS (MULTIPLE I/O CALLS ARE ALLOWED S I MUL T ANEOUSL Y I COH -> FFH WAIT ONLY CALLS -THERE IS NO COMPLEMENTARY 'POST' FOR THESE WAITS • THESE ARE TIMEOUT ONLY. TIMES ARE FUNCT I ON NUMBER DEPENDENT. 73 74 75 76 77 78 7' 80 81 82 (AH) 83 8. 85 86 87 88 8. .,.2 '0 '3 '4 .5 '6 .7 .8 •• 100 101 102 103 104 105 106 107 108 10. 110 CURRENT SWITCH SETTINGS SWITCH SETTINGS IBITS 1-4) RESISTIVE INPUTS A ( x) VALUE A(y) VALUE B(x) VALUE B(y) VALUE (AH) 71 72 CARRY IF AL NOT = OOH OR OIH OR IF FUNCTI ON AL::O ALREADY BUSY (AH) (AH) 87H .,H NUMBER OF MICROSECONDS TO ELAPSE BEFORE RETURN TO CALLER PROCESSOR TO VIRTUAL MODE DEV I CE BUSY LOOP (AL I SEE TYPE CODE TYPE OOH OIH 02H 80H DESCR I PT I ON = = :: :: DISK DISKETTE KEYBOARD NETWORK ESIBX --> NCB FDH '" DISKETTE MOTOR START FEH '" FR I NTER TIMEOUT YES YES NO NO YES YES III BIOSI 5-163 1-2 IBM Personal Computer MACRO Assembler Version 2.00 BIOSI ---- 06/10/85 INTERRUPT 15H BIOS ROUTINES 112 113 114 115 116 111 PAGE (AH) = COH II. 120 121 122 123 124 125 126 121 12. 12. 130 131 132 133 134 135 136 131 13. 13. 140 141 142 143 14. ,.5 146 ,., I •• I •• 150 151 152 153 15. 155 156 151 15. 15. 160 161 162 163 164 165 166 161 16. 169 110 111 112 113 114 115 116 111 116 119 ,.0 06-10-85 RETURN CONF I GURAT I ON PARAMETERS PO INTER RETURNS (AHI = OOH AND ey= 0 (IF PRESENT ELSE 86 AND CY= (ES:8X) = PARAMETER TABLE ADDRESS POINTER ow • DB DB DB DB MODEL BYTE TYPE BYTE BIOS:LEVEL = DB DB DB DB ; ---------------------------ASSUME 0000 0000 0001 0004 0006 0009 0008 OOOE 0010 0012 0014 0016 0018 001A 001(; ODIE 0020 0022 0025 0025 0027 0029 0028 0020 002F 0031 FB 80 Fe 80 12 4E 80 FC CO 14 51 80 Ee 80 OA E4 14 48 FE ce 14 44 FE CC 14 40 FE ce 74 47 FE CC 75 03 E9 0000 R FE 74 FE 14 FE 15 E9 CC 31 CC 07 CC '06 OICA R 0034 E9 016A R LENGTH OF FOLLOW 1NG TABLE SYSTEM MODEL BYTE SYSTEM MODEL TYPE BYTE BIOS REV 151 ON LEVEL 10000000 = OMA CHANNEL 3 USE BY BIOS 01000000 = CASCADED INTERRUPT LEVEL 2 00100000 = REAL TIME CLOCK AVAILABLE 00010000 KEYBOARD SCAN CODE HOOK I AH RESERVED RESERVED RESERVED RESERVED CASSETTE 10 1 STICMP JB CMP JE SUB OR JZ DEC JZ DEC JZ DEC JZ DEC JNZ JMP NOT ..JOYST I CK: DEC JZ DEC JZ DEC JNZ JMP CS: CODE PRoe FAR AH,080H CI AH, OCOH CONF PARMS AH,oaOH AH,AH DEV OPEN AH DEV CLOSE AH PROG TERM AH EVENT WAIT AH NOT ..JOYSTICK ..JOY:STICK ENABLE INTERRUPTS CHECK FOR RANGE RETURN IF 00-7FH CHECK FOR CONFIGURATION PARAMETERS BASE ON a OEV ICE OPEN DEV I CE CLOSE PROGRAM TERMINATION EVENT WAIT ..JOYSTICK BIOS AH SYS REQ AH CI A AHCI B BLDCKMOVE MOVE BLOCK SYSTEM REQUEST KEY WAIT Cl_A: ..JMP WAIT WAIT JNZ JMP CI C EXT_MEMORY GO GET THE EXTENDED MEMORY 003E FE CC 0040 75 03 0042 E9 03FA R Cl_C: DEC JNZ JMP AH CI 0 SET_VMODE 0045 80 EC 07 0048 75 03 004A E9 0483 R Cl_D: SUB JNZ JMP AH,7 CI 'E DEVICE_BUSY CHECK FOR FUNCT I ON 90H GO IF NOT 0040 FE ce 004F 75 03 005,1 E9 0487 R Cl_E: DEC JNZ JMP AH CI I NT_COMPLETE CHECK FOR FUNCT I ON 8BH GO IF NOT ,.2 ,.3 I •• ,.5 '.6 0054 84 86 00S6 F9 0057 0057 CA 0002 CI: MOV 5TC AH,86H I •• 005A DEV_OPEN: ,.9 ,.0 005A DEV_CLOSE: 005A PROG_ TERM: 005A 005A E8 FB Dose SYS REQ: ..JMP CASSETTE_IO_I 005C OOSC DE 0050 07 DOSE BB 0000 E 0061 32 E4 0063 EB F2 0065 eONF PARMS PUSH POP MOV ,., ,., ,., 192 193 I •• 195 19. 191 19. 199 200 201 202 203 20. 205 206 201 20. 209 210 211 212 213 214 215 216 211 21. 219 220 221 222 223 224 225 II WHE~E: 0037 FE CC 0039 75 03 0038 E9 03EE R 0065 0065 0066 0069 006B 0060 006F 0071 0012 0073 IE E8 0000 E OA CO 14 08 FE C8 74 45 IF F9 EB E2 0075 0075 0076 007B 0070 007E 007F 0080 FA F6 06 OOAO R 0 I 74 05 F8 IF F9 E8 05 5-164 BIOS1 CHECK FOR FUNCTI ON 89H SWAP TO V I RTUAL MODE SET BAD COMMAND SET CARRY FLAG ON RET XOR JMP CONF _PARMS EVENT WAIT ASSUME PUSH CALL OR JZ DEC JZ POP 5TC JMP EVENT WAIT 2: eLT TEST JZ FAR RETURN EXIT FROM ROUTiNES NULL HANDLERS CI F ENDP PRoe NEAR DS:DATA OS DOS AL,AL EVENT WAIT 2 AL EVENT WAIT 3 05 - - ORTC WAIT FLAG,OI EVENT_WAlT_I 511 POP 5TC JMP RETURN PRoe NEAR C5 E5 BX, OFFSET eONF TBL AH,AH CI F ENDP GET CODE SEGMENT PLACE I N SELECTOR PO INTER GET OFFSET OF PARAMETER TABLE CLEAR AH AND SET CARRY OFF EX I T THROUGH COMMON RETURN SAVE GO IF ZERO CHECK IF 1 RESTORE OATA SEGMENT SET CARRY EXIT NO I NTERRUPTS ALLOWED CHECK FOR FUNCT I ON ACT I VE ENABLE INTERRUPTS OS SET ERROR RETURN 1-' IBM Personal Computer MACRO Assembler Version 2.00 BIOSI ---- 06/10/65 INTERRUPT ISH 8105 ROUTINES 06-10-85 22. 221 226 229 230 231 232 233 234 235 236 231 236 239 240 241 242 243 244 245 246 241 246 249 0062 0062 0064 0066 0066 006A 008E 0092 0096 009A 009F OOA 1 00A4 00A6 00A6 00A9 00A8 OOAD 0080 0081 0082 0083 0084 E4 E8 24 E6 6C 69 69 69 C6 80 E6 24 OC 50 6A 80 E6 58 IF Fe F8 EB 0086 0086 OOBl 0088 008B 008E OOCO 00C2 00C5 00C6 00C8 OOCC OOCO OOCE 50 FA 88 E6 24 66 E6 56 C6 Fa IF F8 E8 AI 00 FE AI 06 009A IE 0096 DE 009E 16 009C 06 OOAO 08 0000 E lF 40 EVENT WA IT I: INJMP AND OUT R R R R R 01 CALL AND DR PUSH EO 08 0000 E MDV MDV AI I NTERRUPT UNMASKED "2 AL, OFEH IN1801.AL _USER FLAG SECi.ES :~i~R~~~~~~~X I SET UP TRANSFER TABLE IltRTC-LOW.OX :~~g~~~ I ~E~L~G. 0 I CMOS READ AL,07FH AL,040H SET ON FUNC110N ACT I VE S_I TCH ENABLE PIE READ CMOS LOCAT I ON CLEAR SET ENABLE PIE SAVE AH PLACE DATA INTO DATA REGISTER ADDRESS ALARM REG I STER PLACE DATA IN AH INTO ALARM REGISTER RESTORE AH - AX AH,AL CALL ~~o~M~~T~~G_B POP PDP OS AX - STl CLC ENABLE INTERRUPTS CLEAR CARRY JMP 250 251 252 253 254 255 256 251 256 259 260 261 262 263 264 265 266 MOV MDV MDV MDV MOV MDV I ENSURE AL.INTBOI ,----- CANCEL EVENT WAIT 3: PUSH AX 06 OOAO R 00 MDV CALL ~~O~·~~~~_REG_B XCHG CALL AL.OBFH AH,AL CMOS WR ITE PDP MOV (lRTC_WA I T_FLAG , AND AX - a STI PDP OS CLC 81 JMP SAVE INTERRUPTS TURN OFF PIE GET ALARM REGI STER CLEAR PIE PLACE INTO WRITE REGISTER WRITE BACK TO ALARM REGISTER RESTORE AH SET FUNCT I ON ACT I VE FLAG OFF ENA8LE INTERRUPTS I RESTORE DATA SEGMENT ; SET CARRY OFF : RETURN o I SABLE CLI 0808 0000 E BF EO 0000 E CI_F 2.7 266 2.' 270 0000 EVENT WAIT ENOP --- JOY STICK -------------------------------------------------THIS ROUTINE WILL READ THE JOYSTICK PORT 271 272 273 27. 275 27. 277 27. 27. 2.0 INPUT (OX) =0 READ THE CURRENT SW ITCHES RETURNS (AL)= SWITCH SETTINGS IN BITS 1-4 (OX)=1 2.' 2.2 READ THE RESISTIVE INPUTS RETURNS (AX)=A{x) VALUE (BXI=A{yl VALUE lCX)=8(x) VALUE lDX)=B{y) VALUE CY FLAG ON I F NO ADAPTER CARD OR I NVAL I 0 CALL 2.3 2 •• 285 266 261 286 289 290 291 292 293 294 295 296 0000 0000 0001 0003 0006 0006 OOoA OOOC OOoE OOEI OOEI 00E2 FB 6B C2 8A 020 I OA CO 14 08 FE C8 14 OC E9 0054 R F8 E9 0051 R JOY STICK STI MOV MDV OR JZ DEC JZ JMP PRoe NEAR I NTERRUPTS BACK ON GET SU8 FUNCT I ON CODE ADDRESS OF PORT AX,DX DX.20IH AL.AL JOY 2 AL JOY 3 READ SW ITCHES READ RESISTIVE INPUTS GO TO ERROR RETURN CI - STI JMP GO TO COMMON RETURN 2.7 298 299 300 30 I 00E5 00E5 EC 00E6 24 Fa 00E6 EB Fl IN AND JMP AL.DX AL,OFOH JOY_I STRIP UNWANTED BITS OFF FINISHED 302 303 304 305 306 301 306 309 310 31 1 312 313 314 315 316 311 316 319 OOEA OOEA 83 a I OOEC E6 0106 OOEF 51 OOFO 83 02 00F2 E6 0106 00F5 51 00F6 83 04 00F8 E6 0106 OOFB 51 OOFe 83 08 OOFE E8 0108 alaI 8801 0103 59 010458 0105 56 0106 EB 09 MOV R CALL PUSH MOV R CALL PUSH MOV R CALL PUSH "DV R CALL MOV POP POP POP JMP 8L, I TEST CORD CX - SAVE A{X) VALUE I SAVE A(Y) VALUE I SAVE B{X) VALUE 8L,2 TEST CORD CX - 8L , 4 TEST CORD CX - BL,8 TEST CORD oX,CX CX ex AX JOY_I SAVE 8(Y) GET B{X) GET A(Y) GET A(X) FINISHED VALUE VALUE VALUE VALUE - RETURN 320 321 0108 322 0108 52 323 0109 FA 324 a I OA 80 00 325 OIOC E6 43 326 alOE E8 00 3210110E440 326 I 12 EB 00 329 a I 14 6A EO 330 0116 E4 40 331 0118 66 EO 332 a II A 50 333 0118B904FF 334 OIIEEE 335 0 I IF E8 00 336 0121 331 0121 EC 338 a I 22 84 C3 339 a I 24 EO F8 a TEST CORD PUSH PROC NEAR OX CLI MDV OUT JMP IN JMP MOV IN XCHG PUSH MOV OUT J"P TEST CORD I I IN TEST LOOPNZ AL,O TIMER+3,AL '.2 AL,TIMER "2 AH,AL AL,TIMER AH,AL AX CX.4FFH OX,AL '.2 AL,DX AL,BL TEST_CORD_I SAVE 8LOCK INTERRUPTS WH I LE READ I NG SET UP TO LATCH TIMER 0 READ LOW 8YTE OF T I MER 0 READ HIGH 8YTE OF TIMER 0 REARRANGE TO HIGH. LOW SAVE SET COUNT FIRE TIMER READ VALUES HAS PULSE ENDED? BIOS1 5-165 IBM Personal Computer MACRO Assembler Version 2.00 BIOSI ---- 06/10/85 INTERRUPT ISH 8105 ROUTINES 340 341 342 343 344 345 34. 347 348 34' 350 351 352 353 354 355 35. 357 358 35' 3.0 3.1 3.2 3.3 3.4 3.5 3 •• 3.7 3.8 3 •• 370 371 372 373 374 375 37. 377 378 37' 380 381 382 383 384 385 38. 387 388 38' 3.0 3.1 3'2 3'3 394 395 39. 397 398 399 400 401 402 403 404 405 40. 407 408 409 4tO 411 412 413 414 415 41. 417 418 419 420 421 422 423 424 425 42. 427 428 429 430 431 432 433 434 435 43. 437 438 439 0126 83 F9 00 0129 59 012A 75 04 2B C9 012E EB 28 0130 0130 80 00 0132 E6 43 0134 EB 00 0136 E4 40 0138 8A EO 013A EB 00 o 13C E4 40 013E 86 EO eMP pOP "NZ SUB "MP TEST CORD 2: MOV o 12C OUT "MP IN MOY "MP IN XCHG CX,O ex ORIGINAL COUNT SHORT TEST CORD 2 CX,CX SHORT TEST_CORD_3 SET 0 COUNT FOR RETURN EXIT WITH COUNT = 0 AL,O TlMER+3,AL AL,TIMER AH,AL READ HIGH BYTE OF TIMER 0 REARRANGE TO HIGH, LOW CX,AX TEST CORD 4 DX DX,-I CHECK FOR COUNTER WRAP GO IF NO ADJUST FOR WRAP PUSH MOY 0148 014A o 14C 0140 2B DO 03 CA SA EB 02 ADO DX,AX CX,DX POP "MP SHORT TEST_CORO_5 SUB 014F 014F 2B C8 0151 0151 81 EI IFFO 0155 C 1 E9 04 TEST CORD 4: SOB TEST CORD 5: AND 0158 0158 0159 015C 0150 o 15E 0161 0161 0162 0164 TEST CORD 3: SHR - FB 8A 0201 51 50 89 04FF ox CX,AX CX,IFFOH CX,4 0166 58 0167 59 0168 5A POP POP POP 0169 C3 RET ex AX CX,4FFH AX ex OX ENDP ENDP WAIT NEAR OS DDS ORTC WAIT FLAG,O! WAIT-! OS - FA E4 E8 24 E6 8C C7 89 89 C6 50 88 E8 24 OC 86 E8 58 0000 E 06 OOAO R 01 05 "Z POP STe 0057 R IN 009A 0098 009E 009C OOAO R R OOAO R R R R 01 AL,INTBOI o F8 51 52 87 D1 F6 EI 75 83 73 S·2 AL,OFEH INTSOI,AL OUSER FLAG SEG,DS ; SET UP TRANSFER TABLE Q!lUSER-FLAG-;-OFFSET Q!lRTC WA I T FLAG Q!lRTC HIGH,CX -ORTC-LOW, OX ; SET ON FUNCT I ON ACT I VE SW ITCH :~TC:::::WA I T JLAG, 0 1 ; SAVE (AH) AX, X ·CMOS REG B ENABLE PIE CMOS REAOREAD ALARM BYTE AL,01FH CLEAR SIT BIT AL,040H ENABLE PIE BIT AH,AL DATA TO WORK REGISTER CMOS WRITE WR I TE NEW ALARM BYTE AX RESTORE (AH) STI PUSH PUSH XCHG 06 OOAD R 80 F9 05 EA 01 F2 TEST LDOPZ "NZ SUB "Ne C6 06 OOAO R 00 5A 59 IF F8 E9 0057 R OICA 5-166 MOY POP POP POP eLe "MP WAIT BIOS1 NO I NTERRUPTS ALLOWED ENSURE I NTERRUPT UNMASKED AND OUT WAIT TILL RTC TIMEOUT POSTED OIAB 01 AC o I AD OIAE 0180 01 BO 0lB5 0lB7 0lB9 OIBC IBE o IBE a IC3 a IC4 alC5 a IC6 DIC7 TEST FOR FUNCTION ACTIVE "MP MOY MOY MOY MOY MOY PUSH MOY CALL AND OR XCHG CALL POP OBOB 0000 E 7F 40 EO 0000 E SAVE I SET ERROR RETURN "MP eLi AI 00 FE Al IE 06 OE 16 06 SET COUNT RETURN TEST CORD JOY_STICK IE E8 F6 74 IF F9 E9 COUNT AL,OX AL,OFH TEST_CORD_6 o 16A PRDC PUSH CALL TEST I NTERRUPTS BACK ON FLUSH OTHER INPUTS DX,20!H 016A OlbA 016A 0168 016E 0173 0175 0176 0177 a I 7A 017A 0178 alTO 017F 0181 0183 0187 018D 0191 0195 019A 0198 019E OIAI 0lA3 0lA5 0lA7 01 AA ADJUST 51'1 MOY PUSH PUSH MOY TEST CORD 6: IN TEST LOOPNZ EC A8 OF EO FB READ LOW BYTE OF T I MER 0 S·2 AL,TIMER AH,AL 3B C8 73 OB 52 BA FFFF "AE SET UP TO LATCH TIMER 0 S·2 0140 0142 0144 0145 eMP 1-4 06-10-85 ENDP ex (WITH ERROR TIMEOUT! ENABLE INTERRUPTS ox SAVE CALLERS PARAMETERS SWAP COUNT WORK REGISTERS :~i~_~A IT_FLAG. 080H CHECK FOR END OF WA I T - CLEAR CARRY DECREMENT TIMEOUT DELAY TILL WA I TEND EXIT IF RTC TIMER WAIT ENDED FLAG SET DECREMENT ERROR TIMEOUT COUNTER LOOP TILL COUNTERS TIMEOUT DX,CX WAIT-9 DX,IWAIT_2 ORTC WAIT FLAG,O OX - SET FUNCT I ON ex RESTORE CALLERS PARAMETERS I NACT 1VE OS CLEAR CARRY FLAG 1-5 IBM Personal Computer MACRO Assembler Version 2.00 BiaSI ---- 06/10/85 INTERRUPT 15H BIOS ROUTINES 440 441 442 443 444 445 446 441 448 449 450 451 452 453 454 455 456 451 458 459 460 461 462 463 464 465 466 461 468 469 410 411 412 413 414 415 416 411 418 419 480 481 482 483 484 485 486 481 488 409 490 491 492 493 494 495 PAGE ;--- 15 H -- ( FUNCTION 87 H - BLOCK MOVE) ------------------------------ ; THIS BIOS FUNCTION PROVIDES A MEANS FOR A REAL MODE PROGRAM OR SYSTEM TO TRANSFER A BLOCK OF STORAGE TO AND FROM STORAGE ABOVE THE 1 MEG ADDRESS RANGE I N PROTECTED MODE SPACE BY SW I TCH I NG TO PROTECTED MODE. ; ; ; ENTRY: (AH) (CX) ; ; ; = = ES:SI 87H (FUNCTION CALL) - BLOCK MOVE. WORD COUNT OF STORAGE BLOCK TO BE MOVEO. NOTE: MAX COUNT = 8000H FOR 32K WORDS (65K BYTES) = LOCATION OF A GOT TABLE BUILT BY ROUTINE USING THIS FUNCTION. ; (ES:SI) POINTS TO A DESCRIPTOR TABLE (GOT! BUILT BEFORE INTERRUPTING TO TH I S FUNCT I ON. THE OESCR I PTORS ARE USE TO PERFORM THE BLOCK MOVE IN THE PROTECTED MODE. THE SOURCE AND TARGET DESCRIPTORS BUILT BY THE USER MUST HAVE A SEGMENT LENGTH 2 • CX-l OR GREATER. THE DATA ACCESS RIGHTS BYTE MUST BE SET TO CPLO-R/w (93H). THE 24 BIT ADDRESS (BYTE HI, WORD LOW) MUST BE SET TO THE TARGET I SOURCE. = NO I NTERRUPTS ARE ALLOWED OUR I NG TRANSFER. MAY CAUSE LOST INTERRUPTS. LARGE BLOCK MOVES EXIT: (AH) (AH) (AH) (AH) = = = = OOH 01H 02H 03H IF SUCCESSFUL IF MEMORY PARITY (PARITY ERROR REGISTERS ARE CLEARED) IF ANY OTHER EXCEPTION INTERRUPT ERROR OCCURRED IF GATE ADDRESS LINE 20 FAILED ALL REGISTERS ARE RESTORED EXCEPT (AH). I F SUCCESSFUL - CARRY FLAG = 0 IF ERROR ------ CARRY FLAG = 1 DESCRIPTION: I. 2. 3. 4. 5. 6. 7. 8. 9. 10. II. 12. 13. SAVE ENTRY REGISTERS AND SETUP FOR SHUTDOWN EXIT. THE REQUIRED ENTRIES ARE BUILT IN THE GOT AT (ES:Sl). GATE ADDRESS LINE 20 ACTIVE, CLI AND SET SHUTDOWN CODES. THE IDTR IS LOADED AND POINTS TO A ROM RESIDENT TABLE. THE GDTR I S LOADED FROM THE OFFSET PO INTER (ES: S I ) • THE PROCESSOR IS PUT INTO PROTECTED MODE. LOAD IDS) AND (ES) WITH SELECTORS FOR THE SOURCE AND TARGET. DS:SI (SOURCE) (ES:DI) (TARGET) REP MOVSW IS EXECUTED. CHECK MADE FOR PAR I TY ERRORS. REAL MODE RESTORED WHEN SHUTDOWN 09H I S EXECUTED. ERRORS ARE CHECKED FOR AND RETURN CODES ARE SET FOR (AH). ADDRESS LINE 20 GATE IS DISABLED. RETURN WITH REGISTERS RESTORED AND STATUS RETURN CODE. (FOR PC-AT COMPATIBILITY ZF=1 IF SUCCESSFUL, ZF=O IF ERROR.) THE FOLLOWING DIAGRAM DEPICTS THE ORGANIZATION OF A BLOCK MOVE GOT. GOT (ES:SI) \ 496 491 498 499 500 501 502 503 504 505 506 501 508 509 510 511 512 513 514 515 516 511 518 519 520 521 522 523 52. 525 526 521 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 INT 06-10-85 \ i\---------------\i +00 DUMMY +08 I I GOT LOC 1. TABLE AS A DATA SEGMENT. (USER INITIALIZED TO 0 - MODIFIED BY BIOS) THE TH I RD DESCR I PTOR PO I NTS TO THE SOURCE TO BE MOVED. (FROM) (USER INITIALIZED) 4. THE FOURTH DESCR I PTOR PO I NTS TO THE DESTINATION SEGMENT. (TO) (USER INITIALIZED) 5. THE FIFTH [S A DESCRIPTOR THAT BIOS USES TO CREATE THE PROTECTED MODE CODE SEGMENT. (USER INITIALIZED TO 0 - MODIFIED BY BIDS) 6. THE SIXTH DESCR[PTOR IS USED BY BIOS TO CREATE A PROTECTED MODE STACK SEGMENT. (USER INITIALIZED TO 0 - MODIFIED BY BIOS) (POINTS TO USERS STACK) \---------------\ I SOURCE I I GOT I \---------------\ + 18 I TARGET I (CS) I I (SS) I 3. I I GOT I \---------------\ I BIOS I +20 \---------------\ +28 !---------------! SAMPLE OF SOURCE SOURCE _TARGET _ DEF SEG LIMiT LO WORD HI-BYTE DATA ACC RIGHTS RESERVEO- OR 0000 0008 0010 0018 0020 0028 0030 OICA BLOCK MOVE PROC 0 I CA FC OICB 60 OICC 06 01CD IE CLD PUSHA PUSH PUSH DICE E8 0000 E CALL TARGET DESCRIPTOR STRUC OW OW DB DB OW THE GLOBAL DESCRIPTOR TABLE BLOCKMOVE GOT DEF DQ CGDT LOC DQ SOURCE DQ TARGET DQ BIOS_CS DQ TEMP SS DQ BLOCKMOVE _GOT _ DEF THE FIRST DESCR I PTOR I S THE REQU I RED DUMMY. (USER INITIALIZED TO 0) 2. THE SECOND DESCR I PTOR PO I NTS TO THE GOT \ \ +10 J ? 93H o SEGMENT LIM I T (I -65536 BYTES) 24 B[T SEGMENT PHYSICAL ADDRESS (0 TO (16M-I) I ACCESS RIGHTS BYTE (CPLO-R/WI RESERVED WORD (MUST BE ZERO) (ACTUAL LOCAT[ON POINTED TO BY ES:SII , STRUC , FIRST DESCRIPTOR NOT ACCESSIBLE LOCATION OF CALLING ROUTINE GOT SOURCE OESCR I PTOR TARGET DESCR I PTOR B I OS CODE DESCR I PTOR STACK OESCR I PTOR ENDS NEAR ES OS SET 0 I RECT I ON FORWARD SAVE GENERAL PURPOSE REG I STERS SAVE USERS EXTRA SEGMENT SAVE USERS DATA SEGMENT SAVE THE CALLING RDUTINE"S STACK DDS SET OS TO DATA AREA BIOS1 5-167 1-6 IBM Personal Computer MACRO Assembler Version 2.00 8]051 ---- 06/10/85 INTERRUPT 15H 8]05 ROUT]NES 554 555 556 Mav Mav OIDI BC 16 0069 R 0105 89 26 0067 R (t]0 ROM SEG,SS ([iI ]O:=ROM:=INIT, SP ; ; SAVE USERS STACK SEGMENT SAVE USERS STACK POINTER 557 558 SET UP THE PROTECTED MODE DEFINITIONS ==="'= 559 560 MAKE A 24 BIT ADDRESS OUT OF THE ES:SI FOR THE GOT POINTER 5. , 562 563 564 565 566 567 56, 569 570 57 , 572 573 574 575 576 577 57' 579 580 58' 582 583 584 585 586 587 58' 589 590 59' 592 ASSUME 0109 OIDB DIDO OIDF 0lE2 0lE5 0lE7 8C 8E 8A CO CI 03 80 F4 EE 04 EO 04 C6 06 00 OlEA OIEF 0lF2 0lF5 C1 89 88 C1 44 44 74 44 MaV MaV MaV CO 08 5HR 5HL Aaa ADC ; ----- DS:NOTHI NG AX,ES OS,AX OH,AH OH,4 AX,4 AX, S] DH,O 594 595 596 597 SET THE GOT _LOC SET UP THE CODE SEGMENT OESCR I PTOR OIFA C7 44 20 01FF C7 44 22 0204 C6 44 24 020B C6 44 25 020C C7 44 26 FFFF 0000 OF 9B 0000 Mav Mav Mav Mav MDV MAKE A 24 B[T ADDRESS OUT OF THE 0211 0213 0215 021B 8C 8A CO Cl Mav Mav DO F4 EE 04 EO 04 AX, SS DH,AH oH,4 AX,4 5HR SHL SS 0218 0220 0223 0226 C7 89 88 C6 44 44 74 44 [S NOW 602 022A 022C 022F 0231 84 E8 3C 74 OF 03CC R 00 06 603 604 605 606 607 608 609 6" 6" 612 603 604 Mav Mav Mav Mav 28 FFFF 2A 2C 20 93 59, 599 600 60 , j ----- CALL CMP JZ MOV 0233 BO 03 0235 E6 80 0237 E8 51 aUT JMP 618 (SS) ; ; ; i - ( (SPI REMA[NS USER ISP) ) GET THE CURRENT STACK SEGMENT FORM HIGH BYTE OF 24 B[T ADDRESS FORM HIGH BYTE - SHIFT RIGHT 4 STRIP HIGH N]BBLE FROM (AXI [N POS]TlON FOR A 24 B[T ADDRESS SETUP THE I (~: ::::~~~_~~:~;~l~~I~O~~:A~EG_LEN (55) DESCRIPTOR ;~::: :::~~ ~~wS;g~~NT ; LIMIT [S I ] • TEMP-SS. BASE-H [-BYTE, DH ; SET THE HIGH BYTE [SI].TEMP:=SS.DATA:=ACC_RIGHTS,CPLO_DATA_ACCESS ; SET CPL 0 GATE ADDRESS B]T 20 ON Mav (D[SABLE AH,ENA8LE BIT20 GATE_A20 AL,O INTERRUPTS) BL4 GET ENABLE MASK ENABLE A20 AND CLEAR INTERRUPTS WAS THE COMMAND ACCEPTED? GO IF YES AL,03H MFG PORT tAL SHORT SHUT9 EARLY ERROR EX I T SET THE ERROR FLAG I F NOT SET S/-IUTDOWN RETURN ADDRESS AND DISABLE NMI 0239 0239 88 098F Mav 023C E8 0000 E CALL 615 , -6--1_6__ 607 PO I NT IDS) TO USERS CONTROL BLOCK GET THE GOT DATA SEGMENT MOVE THE GOT SEGMENT PO I NTER TO (OS) BUILD HIGH BYTE OF THE 24 BIT ADDRESS USE ONLY HIGH NIBBLE SHIFT - RIGHT 4 STRIP HIGH NIBBLE FROM (AX) ADD THE GDT OFFSET TO DEVELOP LOW WORD ADJUST H [GH BYTE I F CARRY FROM LOW MDV MaV MaV MaV 08 FFFF OA OC OE 0000 593 "-_ 06-10-85 ; SET THE SHUTDOWN BYTE LOCAT I ON 1 TO SHUT DOWN 9 AND OISABLE NM] CLEAR- E5('CEPT] ON ERROR FLAG ~-~!~-1~-~{------------------ SUB OUT AL,AL MFG_PORT. AL SET ERROR FLAG LOCAT I ON TO 0 609 620 621 622 623 624 LOAD THE 0243 BD 02C6 R MOV SF,OFFSET ROM 0246 2E SEGOV DB LlDT LABEL aRG DB aRG CS 02EH [SP] OOFH 8YTE BX,WORD PTR [BP] BYTE OFFSET CS: ??OOO! 001 H OFFSET CS:? ?0002 LGDT DB LABEL MOV LABEL ORG DB ORG [Slj.CGDT LOC ; LOAD GLOBAL DESCRIPTOR TABLE REGISTER OOFH BYTE OX, WORD PTR [S I ] • CGDT LOC BYTE OFFSET CS:??0003 001 H OFFSET cs: ??0004 625 626 627 628 629 630 631 632 633 0247 OF 0248 0248 8B 5E 00 024B 0248 0248 0 I 024B aB ? ?OOO 1 639 640 641 642 024B OF 024C 024C B8 54 08 024F 024C 024C 024F LABEL Mav 710002 634 635 636 637 638 lOT AND GOT ? ?0003 770004 IDT~LOC ; LOAD THE lOT 643 644 645 646 SW [TCH TO V I RTUAL MODE 024F B8 000 I "av 647 64' 649 650 651 652 653 654 655 656 657 658 659 660 660 662 663 0252 0255 0256 0258 025A OF 01 FO EA 025A R 0020 025A 0250 025F 0262 0264 0267 0269 026B B8 8E B8 8E B8 8E 2B 28 LMSW DB aB OW OW AX, V I RTUAL ENABLE AX OOFH,OOIH,OFQH OEAH OFFSET VIRT BIOS_CS MACHINE STATUS WORD NEEOED TO SW I TCH TO V I RTUAL MODE PURGE PRE-FETCH QUEUE WITH FAR JUMP - TO OFFSET - I N SEGMENT -PROTECTED MODE SELECTOR V IRT: ; ----0028 DO 0010 08 0018 CO F6 FF IN PROTECTED MODE Mav Mav Mav Mav MDV Mav AX, TEMP SS SS, AX AX ,SOURCE DS,AX AX, TARGET ES,AX SETUP STACK SELECTOR AND SQURCEITARGET SELECTORS SUB SUB S] • S I 0] ,01 USER'S SS+SP IS NOT A DESCRIPTOR LOAD STACK SELECTOR GET THE SOURCE ENTRY LOAD SOURCE SELECTOR GET THE TARGET ENTRY LOAD TARGET SELECTOR SET SOURCE ] NDEX REG 1 STER TO ZERO SET TARGET ]NDEX REGISTER TO ZERO REP MOVSW MOVE THE BLOCK COUNT PASSED 664 665 0260 F31 A5 666 667 5-168 CHECK FOR MEMORY PAR I TY BEFORE SHUTDOWN BIOS1 IN ICX) 1-7 IBM Personal Computer MACRO Assembler Version 2.00 81051 ---- 06/10/85 INTERRUPT 15H 8105 ROUTINES 66. 669 &70 &71 672 673 .74 675 &7& & 11 678 &79 &80 681 682 &83 026F E4 61 0271 24 CO 0273 74 12 ;----0275 0217 0279 0278 0270 027F 0281 0283 0285 88 59 80 E6 E4 DC E6 24 E& 05 05 0I 80 &1 DC 61 F3 &1 6B. 6 .. 6B6 DONE 1 AX,OS;[OI] OS: [01] ,AX AL,OI MFC PORT ,AL AL,PORT 8 AL.RAM PAR OFF PORT 8-;AL AL, RAM PAR ON PORT_8-;-AL - IN OR OUT AND OUT ;----DONE 1 : &93 6.4 028A SHUT9: 695 &9& 697 698 028A 0280 028F 0293 CET THE PARITY LATCHES STRIP UNWANTED 8ITS CiO IF NO PARITY ERROR ERR - CLEAR PARITY 8EFORE SHUTDOWN MOV MOV MOV OUT 02137 0287 E9 0000 E &87 688 :~: ~~~T f~ IN AND JZ 06-10-85 FETCH CURRENT SOURCE OAT A WRITE IT 8ACK SET PAR I TY CHECK ERROR = 0 t TOCCiLE PAR I TV CHECK LATCHES TO CLEAR THE PENb I NC ERROR AND ENA8LE CHECK I NC CAUSE A SHUTDOWN PROC_SHUTDOWN JMP CiO RESET PROCESSOR AND SHUTDOWN 6B. 6.0 6.' 6.2 ; ======== ============== RESTORE USERS STACK ASSUME 88 ---- R 8E 08 8E ! & 0069 R 88 2& 0067 R MOV MOV MOV MOV DS:DATA AX,DATA DS,AX SS,olIlO ROM SEG SP ,olI I O=ROt(~1 NIT SET OS TO DATA AREA CET USER STACK SECiMENT CET USER STACK POINTER 6 •• 700 70 I 702 703 704 705 706 707 708 709 710 711 712 713 714 115 71 & 717 7IB 719 720 721 722 723 724 125 726 727 728 129 730 731 732 133 734 735 136 737 73. 73. 740 141 742 743 144 745 746 747 148 149 150 751 752 153 754 755 756 157 158 759 GATE ADDRESS 81T 20 OFF 0297 0299 029C 029E 84 E8 3C 74 00 03CC R 00 OA 02AO 02A2 02A4 02A6 02A8 E4 3C 75 80 E6 80 00 04 03 80 MOV CALL eMP JZ IN eMP JNZ MOV OUT ;----02AA 02AA 88 0000 02AO E6 70 02AF 0280 0281 0283 0285 0288 028A 0288 028C 028C 028F IF 07 E4 88 88 3A 61 F8 AH, 0 I SA8LE 81 T20 GATE A20 AL,OOONE3 0lSA8LE MASK CATE ADDRESS 20 LINE OFF COMMAND ACCEPTED? GO IF YES AL,MFG PORT AL,O DONE3 AL,03H MFG_PORT ,AL CHECK FOR ANY OTHER ERROR FIRST WAS THERE AN ERROR? REPORT FIRST ERROR I F YES ELSE SET GATE A20 ERROR FLAG RESTORE THE USERS REGISTERS AND SET RETURN CODES DONE3: MOV OUT POP POP 80 EC 46 OF EO IN MOV MOV eMP AX,CMOS REG 0 CMOS_PORT ,AL CLEAR {AHI ENA8LE NM I OS RESTORE USER DATA SEGMENT RESTORE USER EXTRA SEGMENT CET THE ENDING STATUS RETURN CODE POINT TO REGISTERS IN THE STACK PLACE ERROR CODE INTO STACK AT IAH) SET THE IF & CY FLAGS WITH RETURN CODE RESTORE THE GENERAL PURPOSE REG I STERS TURN 1NTERRUPTS ON ES AL ,MFG PORT 8P, SP [8P+15].AL AH,AL POPA STI DONE4 CA 0002 PROC RET DONE4 FAR 2 MOV OUT JMP ROM 02C6 02C60100 02C8 02CC R 02CA OF 02C8 00 ROM lOT LOC: -OW OW DB DB 02CC 02CC 02CE 0200 0201 0202 ROM 028F 0020 00 87 0000 0204 0206 0208 0209 020A t66 n 7 768 169 770 171 772 773 774 775 776 777 77B 779 180 181 TO DEFAULT 1NTERRUPT HANDLER AL,,02H MFG PORT ,AL PROG_SHUTDOWN CET EXCEPT I ON ERROR CODE SET EXCEPT I ON I NTERRUFT OCCURRED FLAG CAUSE A EARLY SHUTDOWN IDT LOCATION ROM lOT END-ROM lOT ROM-IDTCSEGolI HI o - LENGTH OF ROM lOT T A8LE LOW WORD OF 8ASE ADDRESS HI CH 8YTE OF 8ASE ADDRESS RESERVED THE ROM EXCEPTION INTERRUPT VECTOR GATES FOR BLOCK MOVE R lOT: - OW OW DB DB OW EX INT 8105 CS 028F R 0020 00 81 0000 OW OW DB DB OW EX INT 8105 CS 020C 020E 02EO 02El 02E2 028F R 0020 00 87 0000 OW OW DB DB OW EX INT 8105 CS 02E4 02E6 02E8 02E9 02EA 028F R 0020 00 81 0000 OW olil EX INT 8105 CS DB DB OW TRAP GATE OZEC 02EE 02FO 02Fl 02F2 028F R 0020 00 81 0000 OW OW DB DB OW EX 02F4 028F R 02F6 0020 02F8 '00 OW OW DB EX o o - TRAP GATE o TRAP GATE o - 760 761 762 7&3 7&4 165 (ALI RETURN WITH FLAGS SET,-IAHI= CODE (CY=0.IF=11= OK (CY=I,IF=O)= ERROR ENDP 8LOCK MOVE EXCEPT I ON 028F 028F 80 02 02C 1 E6 80 02C3 E9 0000 E TO ZERo AND INTERRUPTS o o - TRAP GATE o o - INT 8105 CS o - TRAP GATE o - INT 8105 CS o - ,EXCEPTION 00 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS 8YTE RESERVED EXCEPTION .01 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT GAtE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPTION· 02 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS 8YTE RESERVED EXCEPTI ON 03 DESTINATION OFFSET DES T I NAT I ON SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS 8YTE RESERVED EXCEPT I ON 04 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT CATE TYPE - ACCESS RIGHTS 8YTE RESERVED .EXCEPTION 05 DESTINATION OFFSET DEST I NAT I ON SEGMENT SELECTOR WORD COPY COUNT BIOS1 5-169 IBM Personal Computer MACRO Assembler Vers j On 2.00 BIOSI ---- 06/10/85 INTERRUPT ISH BIOS ROUTINES 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 02F9 87 02FA 0000 02FC 02FE 0300 0301 0302 0304 0306 0308 0309 030A 02BF R 00,20 00 87 0000 02BF R 0020 00 " 0000 DB OW TRAP_GATE OW OW DB DB OW EX INT BIOS CS OW OW DB DB OW EX INT BIOS CS EX INT BIOS_CS 0 - 0 TRAP_GATE 0 - 0 TRAP_GATE 0 030C 030E 0310 031 I 0312 02BF R 0020 00 87 0000 ow 0314 0316 0318 0319 031 A 02BF R 0020 OW OW DB DB OW EX INT BIOS CS 87 0000 00 02BF R 0020 OW DB DB OW 0 TRAP_GATE 0 - 0 TRAP GATE 0 031C 031 E 0320 0321 0322 OW OW DB DB OW EX INT BIOS_CS 00 87 0000 0324 0326 0328 0329 032A 02BF R 0020 00 87 0000 OW OW DB DB OW EX INT 810S_CS 032C 032E 0330 033 I 02BF R 0020 OW Ow DB DB OW EX INT BIOS CS 00 87 0332 0000 0334 0336 0338 0339 033A 02BF R 0020 00 87 0000 OW OW DB DB OW EX INT B 10S_CS 033C 033E 0340 0341 OZ8F R 0020 OW OW DB DB Ow EX INT BIOS_CS EX INT BIOS CS 0348 00 0349 87 034A 0000 OW OW DB DB OW 034C 034E 0350 0351 0352 02BF R 0020 00 87 0000 OW Ow DB DB OW EX INT BIOS_CS 0354 0356 0358 0359 035A 02BF R 0020 OW OW DB DB OW EX INT BIOS_CS 87 0000 OW OW DB DB OW EX INT BIOS_CS EX INT BIOS CS 00 87 0342 0000 0344 02BF R 0346 0020 00 0 TRAP _GATE 0 0 TRAP_GATE 0 0 - TRAP _GATE 0 0 TRAP_GATE 0 0 TRAP _GATE 0 0 - TRAP_GATE 0 0 TRAP_GATE 0 0 TRAP_GATE 0 035C 035E 0360 0361 0362 02BF R 0020 0364 0366 0368 0369 036A OZaF R 0020 00 87 0000 OW OW DB DB OW 036C 036E 0370 0371 0372 02aF R 0020 00 87 0000 Ow OW DB DB Ow EX INT BIOS_CS 0374 0376 0378 0379 037A 02BF R 0020 OW OW DB DB OW EX INT BIOS_CS EX INT BIOS_CS 00 87 0000 00 87 0000 02BF R OOZO 0 TRAP_GATE 0 0 - TRAP _GATE 0 0 TRAP ~GATE 0 0 TRAP _GATE 0 037C 037E 0380 0381 0382 00 87 0000 OW OW DB DB OW 0384 0386 0388 0389 038A 02BF R 0020 00 87 0000 OW OW DB DB OW EX INT BIOS CS 038C 02BF R 038E 0020 0390 00 OW OW DB EX INT BIOS CS 0 5-170 BIOSI 0 TRAP_GATE 0 - 0 TRAP_GATE 0 1-8 06-10-85 GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPTION 06 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPT I ON 07 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPT I ON 08 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPTI ON 09 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPT I ON 10 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPT I ON 11 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPTION 12 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORO COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPT I ON 13 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPT ION 14 DESTINATION OFFSET DESTI NAT I ON SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPT I ON IS DESTINATION OFFSET DEST I NAT I ON SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPT I ON 16 DESTINATION OFFSET DESTI NAT I ON SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPTION 17 DESTI NATI ON OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPTION 18 DESTI NAT I ON OFFSET DESTI NAT I ON SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPTION 19 DESTI NAT I ON OFFSET DESTINATION SEGMENT SELECTOR WORO COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPTION 20 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORO COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPT I ON 21 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT GATE TYPE ACCESS RIGHTS BYTE RESERVED EXCEPT I ON 22 DESTINATION OFFSET DEST I NA TI ON SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPT I ON 23 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COpy COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPT I ON 24 DESTINATION OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT [8M Personal Computer MACRO Assembler Version 2. 00 8[051 06/10/85 INTERRUPT ISH 8105 ROUT] NES ---- 896 897 898 899 900 90 I 902 903 904 905 900 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 93S 936 937 938 939 940 941 942 0391 87 0392 0000 DB DW TRAP _GATE 0 0394 0396 0398 0399 039A OW DW DB DB DW EX INT BIOS_CS 0 TRAP_GATE 0 DW DW DB DB DW EX INT BIOS_CS 0 TRAP_GATE OW DW DB DB DW EX INT BIOS CS 0 TRAP_GATE 0 DW DW DB DB DW EX INT 8105 CS 0 TRAP_GATE 0 OW OW DB D8 OW EX INT BIOS CS 0 TRAP_GATE 0 0000 DW OW D8 D8 DW EX INT BIOS CS 0 TRAP _GATE 0 02BF R 0020 00 87 0000 DW OW 08 D8 DW EX INT B IOS_CS 0 TRAP_GATE 0 039C 039E 03AO 03A I 03A2 03A4 03A6 03A8 03A9 03AA 03AC 03AE 0380 0381 03B2 0384 03B6 03B8 03B9 03BA 03BC 038E 03CO 03CI 03C2 03C4 03C6 03C8 03C9 03CA 03CC 03CC 028F R 0020 00 87 0000 028F R 0020 00 87 0000 028F R 0020 00 87 0000 028F R 0020 00 87 0000 02BF R 0020 00 87 0000 02BF R 0020 00 87 0 - 1-9 06-10-85 GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPTI ON 25 DESTINATION OFFSET OESTI NAT 1 ON SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS 8YTE RESERVED EXCEPTION 26 DESTINAT[ON OFFSET DESTINATION SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPTION 27 DESTINATION OFFSET DEST I NAT I ON SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPTION 28 DEST[NAT[ON OFFSET DESTINAT[ON SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPT I ON 29 DESTINATION OFFSET DEST I NAT I ON SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPT 1ON 30 DESTI NAT I ON OFFSET DEST I NAT I ON SEGMENT SELECTOR WORD COPY COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED EXCEPTION 31 DESTlNAT[ON OFFSET DEST 1NAT I ON SEGMENT SELECTOR WORD COpy COUNT GATE TYPE - ACCESS RIGHTS BYTE RESERVED ROM - lOT_END: BLOCK MOVE ENOP BIOS1 5-171 1-10 06-10-85 IBM Personal Computer MACRO Assembler Version 2.00 810S! ---- 06/10/55 INTERRUPT 15H 8105 ROUTINES 94> 944 945 94. 947 948 949 950 951 952 953 954 955 95. 957 955 959 960 961 962 963 964 965 966 961 968 969 970 971 PAGE ; - - - - - - - --- - - - - - - - - - - - -- -- - - ---- - - - - - - - ----; GATE A20 ; - THIS ROUTINE;: CONTROLS A SIGNAL WHICH GATES ADDRESS BIT 20. ; THE GATE AlO SIGNAL 'IS AN OUTPUT OF THE 8042 SLAVE PROCESSOR. ; ADDRESS 81T 20 SHOULD BE QATED ON BEFORE ENTERING PROTECTED MODE. IT SHOULD BE GATED OFF AFTER ENTERING REAL MOOE FROM PROTECTED MODE. INTERRUPTS ARE LEFT 0 I SABLED ON EX IT. INPUT (AH)= ODH ADDRESS BIT 20 GATE OFF. (A20 ALWAYS ZERO) (AH) = DFH ADDRESS BIT 20 GATE ON. (A20 CONTROLLED BY 80286) OUTPUT (AL) = OOH OPERATION SUCCESSFUL. 8042 HAS ACCEPTED COMMAND. (ALl= 02H FAILURE--8042 UNABLE TO ACCEPT COMMAND. -- ~~ ~~ 03CC 03CC 03CO 03CE 0301 0303 0305 0301 03DA 03DC 03DE 03EO 51 FA E5 75 80 E6 E8 15 8A E6 E8 - - -------- ~;~ - -- ---- g~~L -- --- --- -- SAVE USERS (CX) 0 I SABLE INTERRUPTS WH I LE US I NG 8042 INSURE 8042 INPUT BUFFER EMPTY EXIT IF 8042 UNABLE TO ACCEPT COMMAND 8042 COMMAND TO WR I TE OUTPUT PORT ~~~i~S8~~~T ~~T~U;O~O~~:~D ,AL GATE A20 RETURN AL,AH PORT A. AL EMPTY_8042 JNZ ----- - -- -- - - -- -- - - - - - - -- - - - -- - - - - - - - --- --- - - - - - -- - -- ---- - - -- - - -- EMPTY 8042 GATE A20 RETURN AL, 05 tH - MOV OUT CALL ;----- ---- ex PUSH CL I CALL JNZ MOV 03E5 R 10 D1 64 03E5 R 07 C4 60 03E5 R ;~~~ -- - Agg~~T T6° COMMAND EXIT IF 8042 UNABLE TO ACCEPT COMMANO 8042 PORT DATA OUTPUT PORT DATA TO 8042 WAIT FOR 8042 TO ACCEPT PORT DATA 8042 OUTPUT WILL SWITCH WITHIN 20 MICRO SECONDS OF ACCEPTING PORT DATA 972 913 974 975 97. 03E3 03E3 59 03E4 C3 977 978 979 980 98 , 982 983 984 985 986 03E5 981 03E5 988 03E1 989 03E7 990 03E9 991 03E8 992 03ED 993 03EE 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1005 1009 1010 101 I 1012 1013 1014 1015 1016 1017 1018 101903EE 1020 1021 03EE 1022 03F 1 1023 03F4 1024 03F6 1025 03F9 1026 1021 03FA GATE A20 RETURN: POP CX ; RESTORE USERS (CX I RET ; - - - - - - - - - - - - --- -- - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - -- - - -- - ; EMPTY 8042 ; -THIS ROUTINE WAITS FOR THE 8042 INPUT BUFFER TO EMPTY. ; INPUT ; NONE ; OUTPUT ; (ALl = OOH 8042 INPUT BUFFER EMPTY (ZERO FLAG SET) ; (ALl = 02H TI ME OUT, 8042 I NPUT BUFFER FULL (NON-ZERO FLAG SEn (CX) - MODIFIED -- ~~;~; E4 64 24 02 EO FA C3 -- - -- -- - ~~;; ~ --- - - --- - - - - -- - - -- - -- - -- SUB EMPTY L; IN AND LOOPNZ RET GATE_A20 28 C9 - CX,CX (CX)=O, WILL BE USED AS TIME OUT VALUE AL,STATUS PORT AL, I NPT BUF FULL EMPTY_L- READ 8042 STATUS PORT TEST I NPUT BUFFER FULL FLAG (B I T I) LOOP UNTI L BUFFER EMPTY OR TI ME OUT ENDP ;--- INT 15 H -- ( FUNCTION 88 H - I/O MEMORY SIZE DETERMINE) ---------------EXT MEMORY THIS ROUTINE RETURNS THE AMOUNT OF MEMORY IN THE SYSTEM THAT IS LOCATED STARTING AT THE 1024K ADDRESSING RANGE, AS DETERMINED BY THE POST ROUTINES. NOTE THAT THE SYSTEM MAY NOT BE ABLE TO USE I/O MEMORY UNLESS THERE I S A FULL COMPLEMENT OF 512K OR 640 BYTES ON THE PLANAR. TH IS SIZE SIZE IS STORED IN CMOS AT ADDRESS LOCATIONS 30H AND 31H. INPUT AH = 8aH THE I/O MEMORY SIZE VAR I ABLE I S SET OUR I NG POWER ON DIAGNOSTICS ACCORDING TO THE FOLLOWING ASSUMPTIONS: 1. ALL INSTALLED MEMORY IS FUNCTIONAL. 2. ALL MEMORY FROM 0 TO 640K MUST BE CONT I GUDUS. OUTPUT (AX) ; EXT_MEMORY 88 E8 86 E8 CF 5-172 3031 0000 E C4 0000 E "OY CALL XCHG CALL IRET EXT_MEMORY BIOS1 = NUMBER OF CONT I GUOUS I K 8LOCKS OF MEMORY A AVAILABLE STARTING AT ADDRESS 1024K. - - - ----- - -- --- - - - ---- - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - -- - - - - - -- --- - - - - - - - - -PRDC ~~O~M~~A~-M-S-LO.H+CMOS-~-~Ei-~~E; H7g~R~~iE H~~H AL,AH CMOS READ ENDP ; ; ; {7g wM~~6~~ PUT HIGH BYTE IN POSITION ~AH) GET THE LOW BYTE OF I/O MEMORY RETURN TO USER 1-11 06-10-85 IBM Per>:lonill Computer MACRO AS$embler Ver$;on 2.00 BIOSI ---- 06/10/85 INTERRUPT ISH BIOS ROUTINES 1028 1029 1030 1031 \ 032 1033 1034 1035 1036 1037 \ 038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 \ 068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 I 100 1101 1102 1103 1104 1 105 1106 1107 1 108 1109 1110 1111 1 I 12 1113 1114 I I IS 1116 1117 11 18 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 PAGE INT 15 H ( FUNCTION 89 H l ----------------------------------------------PURPOSE: TH I S B I OS FUNCT I ON PROV (DES A MEANS TO THE USER TO SW I TCH INTO V I RTUAL (PROTECTED) MODE. UPON COMPLET 1ON OF TH IS FUNCT I ON THE PROCESSOR WILL BE I N V I RTUAL (PROTECTED) MODE AND CONTROL WILL BE TRANSFERRED TO THE CODE SEGMENT THAT WAS SPECIFIED BY THE USER. (ES:SI) POINTS TO A DESCRIPTOR TABLE (GOT} BUILT BEFORE INTERRUPTING TO THIS FUNCTION. THESE DESCRIPTORS ARE USED BY THIS FUNCTION TO THE I NIT I AL I ZE THE I OTR. THE GDTR AND THE STACK SEGMENT SELECTOR. DATA SEGMENT {OS) SELECTOR AND THE EXTRA SEGMENT (ES) SELECTOR WILL BE INITIALIZE TO DESCRIPTORS BUILT BY THE ROUTINE USING THIS FUNCTION. BH - OFFSET INTO THE INTERRUPT DESCRIPTOR TABLE STATING WHERE THE FIRST EIGHT HARDWARE INTERRUPTS WILL BEGIN. ( INTERRUPT LEVEL 1 1 BL - OFFSET INTO THE INTERRUPT DESCRIPTOR TABLE STATING WHERE THE SECOND EIGHT HARDWARE I NTERRUPTS BEG IN. ( I NTERRUPT LEVEL 2 ) THE DESCRIPTORS ARE DEFINED AS FOLLOWS: 1. 2. 3. 7. 8. NOTE - THE FIRST DESCR I PTOR I S THE REQU I RED DUMMY. WSER INITIALIZED TO OJ THE SECOND DESCRIPTOR POINTS TO THE GOT TABLE AS A DATA SEGMENT. WSER INITIALIZED) THE TH I RD DESCR I PTOR PO I NTS TO THE USER DEF I NED INTERRUPT DESCR I PTOR TABLE (lOT). WSER INITIALIZED) THE FORTH DESCRIPTOR POINTS TO THE USER'S DATA SEGMENT (OS). (USER INITIALIZED) THE FIFTH DESCR I PTOR PO I NTS TO THE USER'S EXTRA SEGMENT I ES) • (USER I NIT (AL I ZED) THE SIXTH DESCRIPTOR POINTS TO THE USER'S STACK SEGMENT (SS). (USER I NIT I AL I ZED) THE SEVENTH DESCR I PTOR PO 1NTS TO THE CODE SEGMENT THAT THIS FUNCTION WILL RETURN TO. (USER I NIT I AL I ZED TO THE USER'S CODE SEGMENT.) THE EIGHTH DESCR I PTOR I S USED BY TH I S FUNCT I ON TO EST ABL I SH A CODE SEGMENT FOR ITSELF. TH I SIS NEEDED SO THAT THIS FUNCTION CAN COMPLETE IT'S EXECUT I ON WH I LE I N PROTECTED MODE. WHEN CONTROL GETS PASSED TO THE USER'S CODE THIS DESCRIPTOR CAN BE USED BY HIM IN ANY WAY HE CHOOSES. EACH DESCRIPTOR MUST CONTAIN ALL THE NECESSARY DATA I.E. THE LIMiT, BASE ADDRESS AND THE ACCESS RIGHTS BYTE. AH= 89H (FUNCTI ON CALL) ES:SI = LOCATION OF THE GOT TABLE BUILD BY ROUTINE USING THIS FUNCTION. AH = 0 I F SUCCESSFUL ALL SEGMENT REGISTERS ARE CHANGED, I. 2. 3. 4. 5. (AX) AND (BP) DESTROYED NO BIOS AVAILABLE TO USER. USER MUST HANOLE ALL I/O COMMANDS. INTERRUPTS - INTERRUPT VECTOR LOCATIONS MUST BE MOVED, DUE TO THE 286 RESERVED AREAS. THE HARDWARE I NTERRUPT CONTROLLERS MUST BE RE I NIT I ALI ZED TO OEFINE LOCATIONS THAT DO NOT RESIDE IN THE 286 RESERVED AREAS. EXCEPTION INTERRUPT TABLE AND HANDLER MUST BE INITIALIZED BY THE USER. THE INTERRUPT DESCR I PTOR TABLE MUST NOT OVERLAP THE REAL MODE B I OS INTERRUPT DESCR I PTaR TABLE. THE FOLLOW I NG GIVES AN IDEA OF WHAT THE USER CODE SHOULD LOOK LIKE WHEN I NVOK I NG TH 1 S FUNCT I ON. REAL MODE ---> VIRTUAL MODE ---> "USER MOV MOV MOV MOV MOV MOV INT "USER CODE" AX, GOT SEGMENT ES,AX S I • GOT OFFSET BH,HARDWARE INT LEVEL I OFFSET BL, HARDWARE I NT LEVEL 2 OFFSET AH,89H 15H CODE" DESCRIPTION: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 12. CL I (NO I NTERRUPTS ALLOWED) WH I LE TH I S FUNCT I ON IS EXECUT I NG. ADDRESS LINE 20 IS GATED ACTIVE. THE CURRENT USER STACK SEGMENT DESCRIPTOR IS INITlALlZEO. THE GOTR I S LOADED WITH THE GOT BASE ADDRESS. THE IDTR I S LOADED WITH THE lOT BASE AODRESS. THE 8259 IS REINITIALIZED WITH THE NEW INTERRUPT OFFSETS. THE PROCESSOR IS PUT IN VIRTUAL MODE WITH THE CODE SEGMENT OES I GNATED FOR TH I S FUNCTI ON. DATA SEGMENT IS LOADED WITH THE USER DEFINED SELECTOR FOR THE OS REGI STER. EXTRA SEGMENT I S LOADED WITH THE USER DEF I NED SELECTOR FOR THE ES REG (STER. STACK SEGMENT IS LOADED WITH THE USER DEFINED SELECTOR FOR THE SS REGISTER. CODE SEGMENT DESCR I PTOR SELECTOR VALUE IS SUBSTI TUTED ON THE STACK FOR RETURN TO USER. WE TRANSFER CONTROL TO THE USER WITH INTERRUPTS 0 I SABLED. BIOS1 5-173 r -12 06-10-B5 IBM Personal Computer MACRO Assembler BIOSI ---- 06/10/B5 1135 1136 1131 113B 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 f 155 1156 1157 1158 1 159 1160 1161 1162 1163 1164 1165 1166 1161 11&B 1169 1170 1171 I r 72 I I 73 1174 1175 1176 1177 0000 117B 0008 r 179 00 I 0 1180001B 1181 0020 1182 0028 I1B3 0030 1184 0038 1185 0040 1186 I1B7 1188 1189 03FA 1190 03FA 1191 1192 1193 119403FAFA 1195 03F8 84 1196 03FD E8 1197 0400 3C I 198 0402 74 I 199 0404 B4 1200 0406 F9 1201 0407 CF 1202 1203 Version 2.00 INTERRUPT 15H BIOS ROUTINES PAGE THE FOLLOWING DIAGRAM DEPICTS THE ORGANIZATION GOT. .-- - - - -- OF - - - -- - - --- - - - - - - - - - - - -- - -- - - - - ---- - - - - - - --- - -- -- - - - --- - - --- - - - - -- - - ----; .---------------- . I DUMMY I IES:SI)--» 1 1 1----------------1 I I GOT 1----------------1 I lOT I I OS I I ES 1 1 1----------------1 1 1 1---- -- ----------1 I 1 1 1---- --- ---------1 I I 55 1 1 1----------------1 I .36 ; ; ; ; I CS 1 1 1----------------1 I TEMP BIOS I I cs r 1----------------1 - - - - -- - - - -- - - - - - - - - - - - - - --- - - - - - -- -- - - - ---- - - - -- - - -- - - - - - - - - - - - - - - - -- - - - - - - - --- - - - - - - - - - - - -- - - - - - - - - - - - - -- - - - - - - - - -- - -- - - - - - - ---- - - --- - - -- - - - --- - - - - -- - - - -- -THE GL08AL DESCRIPTOR TABLE (ACTUAL LOCATION POINTED TO 8Y ES:SI) V I RTUAL ENABLE GOT OEF STRUC - DQGOTPTR DQ 10TPTR oQ oQ USER OS USER-ES DQ USER-55 DQ USER::::CS OQ BlOCS DQ? V [RTUAL_ENABLE _GOT _ DEF ENDS ASSUME X VIRTUAL SET _VMODE: ;----- FAR ENABLE ADDRESS LATCH BIT 20 "OV CALL e"p JZ "OV STe IRET 81T20 ON: PUSH IF POP ; FIRST oESCR I PTOR NOT ACCESS I BLE GOT OESCR I PTOR lOT OEseR I f'TOR USER DATA SEGMENT oESCR I PTOR USER EXTRA SEGMENT DESCR I PTOR USER STACK SEGMENT DESCR I PTOR USER CODE SEGMENT DESCR I PTOR TEMPORARY B I OS OESCR 1PTOR OS:oATA PROC eLi OF 03CC R 00 04 FF 1204 0408 1205 040B 06 1206 0409 1201 1208 1209 1210 1211 1212 040A 1213 040C 1214 040E 1215 0410 12160412 12170414 121B 0416 1219 0418 1220 041 A 1221 041C 1222 041E 1223 0420 1224 0422 12250424 1226 1227 1228 1229 1230 1231 0426 1232 0428 1233 042A 1234 042C 1235 042E 1236 0430 1237 0432 123B 0434 1239 0436 1240 0438 1241 043A 1242 043C 1243 043E 1244 0440 1245 1246 1247 1248 GOT AH,ENA8LE BIT20 GATE A20 AL,O81T20 ON AH,OFFH ES OS NO I NTERRUPTS ALLOWED ENABLE 81T 20 FOR ADDRESS GATE WAS THE COMMAND ACCEPTED? GO IF YES SET THE ERROR FLAG SET CARRY EARLY EXIT MOVE SEGMENT PO INTER TO THE OAT A SEGMENT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - -- - - -- - - - - - - - - - - - - - - - - - - - - - -- - - -- 11 20 00 C7 21 00 04 21 00 01 21 00 FF 21 "OV OUT J"P "OV OUT J"P "OV OUT J"P "OV OUT J"P "OV OUT AL,IIH INTAOO,AL START INITIALIZATION SEQUENCE-ICWI EDGE, [NTERVAL -8, MASTER, I CW4 NEEDED AL,8H INTA01,AL HARDWARE INT'S START AT SEND ICW2 AL,04H INTA01,AL SEND I CW3 - MASTER LEVEL 2 SEND I CW4 - MASTER, 8086 MODE AL,OFFH [NTAOI,AL MASK OFF ALL 11 AO 00 C3 AI 02 00 AI 00 01 E6 A I E8 00 BO FF E6 AI "OV OUT J"P "OV OUT "OV J"P OUT J"P "OV OUT J"P "OV OUT AL,I1H INTBOO ,AL INITIALIZE SEQUENCE-ICWI FOR SLAVE EDGE, INTERVAL -8, MASTER, I CW4 NEEDED 80 E6 EB 8A E6 EB 80 E6 E8 80 E6 E8 80 E6 80 E6 EB 8A E6 80 E8 E6 E8 80 5-174 '.2 '.2 S·2 AL,O IH INTAO 1 ,AL S·2 S·2 AL,8L INT801,AL AL,02H S·2 INT801,AL '.2 AL,OIH INT80 I ,AL AL,OFFH INTBOI,AL SEND ICW4 MASK OFF ALL INT # SLAVE LEVEL 2 SLAVE,8086 MODE S·2 ; ---------------------------- --- - -------- BIOS1 I CW3 - (8H) INTERRUPTS HARDWARE INT'S START AT SEND ICW2 SEND INT # INTERRUPTS (8Ll 1-13 06-10-85 IBM Personal Computer MACRO Assembler Version 2.00 81051 ---- 06/10/85 INTERRUPT ISH 8[05 ROUTINES 1249 1250 0442 1251 0441 1252 0448 1253 0450 1254 0454 1255 1256 1251 1256 1259 1260 0459 1261 045A 1262 04SA 1263 0450 1264 045A 1265 045A 1266 0450 1261 1268 0450 1269 045E 1210 045E 1211 0461 1212 045E 1213 045E 1214 0461 1215 1216 0461 1211 12180464 1219 0461 1260 0468 1281 046A 1282 1283 046C 1284 1285 1286 1281 046C 1288 046F 12890411 1290 0414 1291 0416 1292 0419 1293 1294 1295 1296 1291 0418 1298 041C 1299 041F 13000481 1301 0482 1302 1303 0483 1304 1305 1306 1301 1308 1309 1310 1311 1312 1313 0483 1314 0483 13150484 13160481 1311 13180481 13190481 1320 0488 1321 1322 0488 1323 C1 C6 C1 C6 C1 44 44 44 44 44 38 3C 3A 3D 3E FFFF OF 0000 98 0000 MOV MOV MOV MOV MOV ; ; ; --- - - - - --------- - - - - - - - ------------ - - --PROTECTED MODE ------- ENA8LE - - - - - - - - --------- -- -- - - -- - - - - ---LGDT [S I ) • GDTPTR I 08 OF ??0005 88 54 08 LA8EL MOV n0006 LABEL 0I 08 OF ??0001 LlDT DB LA8EL ORG ORG 88 5C 10 MOV n0008 LABEL ORG 08 01 ORG MOV 88 0001 LMsW 08 08 OW OW OF 01 FO EA 046C R 0038 LOAD GLOBAL OEsCR I PTOR TABLE REG I 5 TER OOFH 8YTE oX,WORD PTR (sl).GDTPTR 8YTE OFFSET CS:??0005 001H OFFSET CS:? ?0006 (51) .IDTPTR OOFH 8YTE BX,WORD PTR [SI].IDTPTR 8YTE OFFSET CS: n0001 001H OFFSET CS: '?0008 INTERRUPT DESCRIPTOR TABLE REGISTER ~~' V I RTUAL_ENABLE MACHINE STATUS WORD NEEDED TO SWITCH TO VIRTUAL MODE OOFH,OOIH,OFOH OEAH OFFSET VMOOE BIO_CS PURGE PRE-FETCH QUEUE WITH FAR ..JUMP - TO OFFSET - I N SEGMENT -PROTECTED MODE SELECTOR VMODE: 88 0018 8E 08 880020 8E CO 88 0028 8E DO ;---------------------------------------; SETUP USER SEGMENT REG I STERS : ; - - - - - - - - - - - - - - ---- - - - - - - - - - ---------- - -AX,USER OS MOV MOV MOV "OV "OV "OV ; ; ; ; 58 63 C4 04 6A 30 53 CB DS,AX AX,USER ES ES,AX AX,USER SS SS, AX - SETUP USER'S OATA SEGMENT TO PROTECTED MODE SELECTORS SETUP USER' S EXTRA SEGMENT SETUP USER'S STACK SEGMENT ---- --- - - - ------ - - - - ---- - - - -- ------- - --PUT TRANSFER ADDRESS ON STACK AND RETURN TO THE USER - - - - - - - - - - - - - - - - - - -- - - - - - -- --- ------- - -POP 8X ADD PUSH PUSH SP,4 USER CS 8X RET X_VIRTUAL GET RETURN IP FROM THE STACK NORM ALI ZE STACK PO INTER SET STACK FOR A RETURN FAR ; RETURN TO USER I N V I RTUAL MODE ENDP ;--- DEVICE BUSY AND INTERRUPT COMPLETE ------------------------- THIS ROUTINE IS A TEMPORARY HANDLER FOR DEVICE 8USY AND I NTERRUPT COMPLETE INPUT DEVICE_BUSY eLe F8 E9 0051 R J"P DEVICE_BUSY CF I NT_COMPLETE IRET I NT_COMPLETE CODE - SEE PROLOGUE PROC NEAR TURN CARRY OFF RETURN WITH CARRY FLAG e1 F ENDP PRoe NEAR I RETURN ENDP ENDS END BIOS1 5-175 [BM Personal Computer MACRO Assembler Version 2.00 B[OS2 ---- 06/10/85 B[OS [NTERRUPT ROUTINES 1 2 3 4 5 6 7 8 1-1 06-10-85 PAGE 118,121 TITLE BIOS2 - -- 06/10/85 BIOS .286C .LIST CODE SEGMENT BYTE PUBL I C 0000 9 10 11 12 13 14 PUBL [C PUBLIC PUBLIC PUBLIC PR I NT SCREEN I RTC [NT T[ME OF DAY I T[MER_[NT_l- EXTRN EXTRN EXTRN CMOS READ: NEAR CMOS-WR I TE: NEAR DDS:NEAR INTERRUPT ROUTINES READ CMOS LOCATION ROUTINE WRITE CMOS LOCATION ROUTINE LOAD IDS) WITH OAT A SEGMENT SELECTOR 15 INT 16 17 18 19 lA H -- n[ME OF DAY) ------------------- --------------TH IS B I OS ROUT [NE ALLOWS THE CLOCKS TO BE SET OR READ PARAMETERS: (AHI OOH = 20 21 22 23 24 25 26 READ THE CURRENT CLOCK SETTING AND RETURN WITH, ICX) = HIGH PORTION OF COUNT lOX) LOW PORT I ON OF COUNT IALl 0 TIMER HAS NOT PASSED 24 HOURS SINCE LAST READ I I F ON ANOTHER DAY. I RESET TO ZERO AFTER READ I = = lAH) 01H SET THE CURRENT CLOCK USING, ICX) HIGH PORTION OF COUNT lOX) = lOW PORT I ON OF COUNT. = 27 28 29 30 NOTE: 31 COUNTS OCCUR AT THE RATE OF 1193180/65536 COUNTS/SECOND lOR ABOUT 18.2 PER SECOND -- SEE EQUATES I 32 33 (AH) 02H READ THE REAL TIME CLOCK AND RETURN W[TH, (CHI = HOURS IN BCD (00-23) (CLI = MINUTES IN BCD 100-591 (DHI = SECONDS IN BCD 100-59) (DLI = DAYLIGHT SAVINGS ENABLE (00-01). (AHI 03H SET THE REAL TIME CLOCK USING, (CHI = HOURS [N BCD (00-23) (CLl = MINUTES IN BCD (DO-59) IDHI = SECONDS IN BCD (DO-59) (DLI = 01 IF DAYLIGHT SAVINGS ENABLE OPTION, 34 35 36 37 38 39 40 41 42 43 ELSE 00. 44 NOTE: 45 46 47 48 49 50 (AH) 04H READ THE DATE FROM THE REAL T I ME CLOCK AND RETURN WITH, (CH) = CENTURY IN BCD (19 OR 20) (CL) = YEAR IN BCD (00-99) (DH) = MONTH IN BCD (01-12) lOLl = DAY IN BCD (01-31). (AH) 05H SET THE DATE INTO THE REAL TIME CLOCK USING, (CHI = CENTURY IN BCD (19 OR 20) (CLl = YEAR IN BCD (00 - 99) (OH) = MONTH IN BCD (01 121 lOLl = DAY IN BCD (01-31). IAH) 06H SET THE ALARM TO INTERRUPT AT SPECIFIED T[ME, (CH) = HOURS IN BCD (00-23 (OR FFH) I ICl) = MINUTES IN BCD (00-59 (OR FFH)) IDH) = SECONDS [N BCD (00-·59 (OR FFH)). (AHl = 07H 51 52 53 54 55 56 57 58 59 (DLl= 00 IF DAYLIGHT SAVINGS TIME ENABLE IS NOT ENABLED. lOLl = 0 I ENABLES TWO SPEC I AL UPDATES THE lAST SUNDAY IN APRIL (I :59:59 --> 3:00:00 AMI AND THE LAST SUNDAY IN OCTOBER (I :59:59 --> 1 :00:00 AM) THE FIRST T[ME. 60 61 62 63 64 65 66 67 68 69 70 NOTES: 71 72 73 74 75 76 77 78 79 80 8[ 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 I II 112 113 ASSUME 0000 0000 0001 0004 0005 0007 IE 0008 £8 0000 E OOOB 56 OOOC CI E8 08 OOOF 03 CO 00118BFO 0013 FA 0014 2E: FF 94 0021 0019 001A 001C 0010 00 I E OOIE TIME OF DAY I -STI- FB 80 FC 08 F5 72 17 CMP CS1CODE,DS:DATA PROC FAR AH,(RTC_TBE-RTC_TB) /2 JC T[ME_9 PUSH CALL PUSH SHR ADD DS DDS MDV 51 AX,8 AX,AX S I ,AX eLI R CALL CA 0002 R R R R R R R R BIOS2 CS: [SI ]+OFFSET RTC_TB 5T1 MDV AH,O POP POP as 51 I NTERRUPTS BACK ON CHECK IF COMMAND IN VALID RANGE 10-7) COMPLEMENT CARRY FOR ERROR EX I T EXIT W[TH CARRY := I [F NOT VALID SAVE USERS IDS) SEGMENT GET OAT A SEGMENT SELECTOR SAVE WORK REGISTER CONVERT FUNCT I ON TO BYTE OFFSET CONVERT FUNCT I ON TO WORD OFFSET I CY=O) PLACE INTO ADDRESSING REGISTER NO I NTERRUPTS OUR I NG T I ME FUNCT IONS VECTOR TO FUNCTION REQUESTED WITH CY=O RETURN W [TH CARRY FLAG SET FOR RESULT I NTERRUPTS BACK ON CLEAR (AH I TO ZERO RECOVER USERS REG I STER RECOVER USERS SEGMENT SELECTOR RETURN WITH CY= 0 IF NO ERROR RET RTC_TB DW OW OW DW DW DW DW DW RTC_ TBE EQU 0031 5-176 INTERRUPT FUNCTION. eMe FB B4 00 5E IF 0021 0031 0023 0042 0025 0050 0027 0075 0029 OOA8 0028 DOCS 0020 0104 002F 0145 = 0031 RESET THE ALARM FOR ALL RETURNS CY= 0 FOR SUCCESSFUL OPERATION. FOR IAHI= 2, 4, 6 - CARRY FLAG SET IF REAL TIME CLOCK NOT OPERATING. FOR I AHl = 6 - CARRY FLAG SET I F ALARM ALREADY ENABLEO. FOR THE ALARM FUNCT I ON (AH = 6) THE USER MUST SUPPLY A ROUT I NE AND INTERCEPT THE CORRECT ADDRESS IN THE VECTOR TABLE FOR INTERRUPT 4AH. USE OFFH FOR ANY "DO NOT CARE" POSITION FOR INTERVAL INTERRUPTS. INTERRUPTS ARE DISABLED DURING DATA MODIF[CATION. AH & AL ARE RETURNED MODIFIED AND NOT DEFINED EXCEPT WHERE IND[CATEo. RTC 00 RTC-IO RTC-ZO RTC-30 RTC-40 RTC-50 RTC-60 RTC-10 $ - ROUTINE VECTOR TABLE (AH) = READ CURRENT CLOCK COUNT SET CLOCK COUNT READ THE REAL T I ME CLOCK T [ME SET REAL T I ME CLOCK T I ME READ THE REAL T I ME CLOCK DATE SET REAL T I ME CLOCK DATE SET THE REAL TI ME CLOCK ALARM RESET ALARM IBM Personal Computer MACRO Assembler Version 2.00 81052 ---- 06/10/85 8105 INTERRUPT ROUTINES 114 115 116 117 118 119 120 121 122 123 124 125 126 121 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 0031 0031 AO 0070 R 0034 C6 06 0070 R 00 0039 88 DE 006E R 003088 16 006C R 0041 C3 0042 0042 0046 004A 004F 89 16 006C R 89 OE 006E R C6 06 0070 R 00 C3 0050 0050 E8 0168 R 0053 72 IF 0055 0057 005A 005C DOSE 0061 0063 0065 0067 006A 006C 006E 0071 0073 0074 0074 80 00 E8 0000 8A FO 80 08 E8 0000 2401 8A DO 80 02 E8 0000 SA C8 80 04 E8 0000 8A E8 F8 E E E E C3 14' 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 0075 0075 E8 0078 73 007A E8 0070 0070 8A 007F 80 0081 E8 0084 8A 0086 80 0088 E8 008B 8A 008080 008F E8 0092 B8 0095 E8 0098 24 009A OC 009C 80 009F OA OOAI 86 00A3 E8 00A6 F8 00A7 C3 113 174 175 176 00A8 00A8 E8 0168 R OOAB 72 10 111 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 20 I 202 203 204 205 206 207 208 209 210 211 212 213 214 2' 5 216 217 218 219 220 221 222 223 224 225 226 221 OOAD OOAF 0082 0084 0086 0089 0088 0080 OOCO 00C2 00C4 00C7 00C9 'OOCA OOCA 80 E8 8A 80 E8 8A 80 E8 8A BO E8 8A F8 016B R 03 0154 R E6 00 0000 E EI 02 0000 E E5 04 0000 E OB08 0000 E 62 02 E2 01 C2 EO 0000 E 07 0000 DO 08 0000 FO 09 0000 C8 32 0000 E8 E E E E PAGE RTC_OO PROC MOV MOV MOV MOV RET NEAR AL,IltTIMER OFL IltTIMER OFL,O CX,IltTIMER HIGH DX,.T I MER:LOW CALL JC UPD I PR RTC:Z9 MOV AL, CMOS SECONDS CMOS READ DH,AL AL, CMOS REG B CMOS READ AL,000000018 DL,AL AL,CMOS MINUTES CMOS READ CL,AL AL,CMOS HOURS CMOS READ CH,AL MOV MOV CALL AND MOV MDV CALL MOV MOV CALL MOV CLC CALL JNC CALL SET RTC TIME CHECK FOR UPDATE IN PROCESS GO AROUND ] F CLOCK OPERAT I NG ELSE TRY INITIALIZING CLOCK MOV MOV CALL MOV MOV CALL "OV "OV CALL "OV CALL AND OR AND OR XCHG CALL CLC RET UPO IPR RTC-35 RTC:STA AH,oH AL, CMOS SECONDS CMOS WRTTE AH,CL ~~o;M~~T~~NUTES AH,CH ~~o;M~~T~~URS AX.XTCMOS REG B CMOS REAoAL,oTIOOOIOB AL, 000000 1 DB OL,000000018 AL.DL AH,AL CMOS_WRITE CALL JC UPO IPR RTC:49 "OV CALL "OV "OV CALL "OV "OV CALL "OV MOV CALL "OV CLC AL.CMOS DAY MONTH CMOS READ DL,AL Al, CMOS MONTH CMOS READ DH,AL AL I CMOS YEAR CMOS READ CL,AL AL, CMOS CENTURY CMOS READ CH,AL C3 RET CALL JNC CALL UPO IPR RTC-55 RTC:STA 88 E8 8A 80 E8 SA BO E8 8A BO E8 8A BO E8 B8 E8 24 86 E8 F8 C3 0006 0000 E2 07 0000 E6 08 0000 EI 09 0000 E5 32 0000 0808 0000 7F EO 0000 "OV CALL "OV "OV CALL "OV "OV CALL "OV "OV CALL "OV "OV CALL "OV CALL AND XCHG CALL CLC RET AX,CMOS DAY WEEK CMOS WRTTE AH,D[ AL, CMOS, DA Y MONTH CMOS WRTTE AH,OH 0104 0104 0 I 06 0109 0108 OIOC 80 E8 A8 F9 75 08 0000 E 20 MOV AL, CMOS REG 8 CMOS READ AL,20H 33 E E E E E E SET ADDRESS OF SECONDS GET SECONDS SAVE ADDRESS ALARM REGI STER READ CURRENT VALUE OF DSE BI T MASK FOR VALID DSE BIT SET (DLI TO ZERO FOR NO DSE 81T SET ADDRESS OF MINUTES GET MINUTES SAVE SET ADDRESS OF HOURS GET HOURS SAVE SET CY= 0 RETURN WITH RESULT E8 0168 R 73 03 E8 0154 R E GET RTC TIME CHECK FOR UPDATE IN PROCESS EXIT IF ERROR (CY= 1) RET CALL TEST 5TC JNZ ~~o;M~~T~~NTH AH,C[ AL, CMOS YEAR CMOS WRTTE AH,CH . ~~o;M~~T~~NTURY AX, X·CMOS REG B CMOS READAL,OlFH AH,AL CMOS_WR I TE I N CARRY FLAG GET TI ME BYTE - SECONDS ADDRESS SECONDS UPDATE SECONDS GET T I ME BYTE - MINUTES ADDRESS M I'NUTES UPDATE MINUTES GET TI ME BYTE - HOURS ADDRESS HOURS UPDATE ADDRESS ADDRESS ALARM REG I STER READ CURRENT VALUE MASK FOR VALID BIT POSITIONS TURN ON 24 HOUR MODE USE ONLY THE DSE BIT GET DAY LIGHT SAVINGS TIME BIT (DSE) PLACE IN WORK REGISTER AND GET ADDRESS SET NEW ALARM 81 TS SET CY= 0 RETURN WITH CY= a GET RTC DATE CHECK FOR UPDATE IN PROCESS EXIT IF ERROR (CY= I) ADDRESS DAY OF MONTH READ DA Y OF MONTH SAVE ADDRESS MONTH READ MONTH SAVE ADDRESS YEAR READ YEAR SAVE ; ADDRESS CENTURY LOCATION ; GET CENTURY BYTE ; SAVE ; SET CY=O RETURN WITH RESULTS ooca DOCS OOCE 0000 0003 0003 0006 0009 0008 DODD ODED 00E2 00E4 00E7 00E9 00E8 OOEE OOFO 00F2 00F5 OOFe OOFB OOFD OOFF 0102 0103 READ T I ME COUNT GET THE OVERFLOW FLAG AND THEN RESET THE OVERFLOW FLAG GET COUNT OF T I ME HIGH WORD GET COUNT OF T I ME LOW WORD RETURN WITH NO CARRY SET T I ME COUNT SET T I ME COUNT LOW WORD SET THE T I ME COUNT HIGH WORD RESET OVERFLOW FLAG RETURN WITH NO CARRY MOV MOV MOV RET CALL 1-2 06-10-e5 I N CARRY FLAG SET RTC DATE CHECK FOR UPDATE IN PROCESS GO AROUND I F NO ERROR ELSE I NIT I ALI ZE CLOCK ADDRESS OF DAY OF WEEK 8YTE LOAD ZEROS TO DAY OF WEEK GET DAY OF MONTH BYTE ADDRESS OA Y OF MONTH BYTE WRITE OF DAY OF MONTH REGISTER GET MONTH ADDRESS MONTH BYTE WR I TE ,MONTH REG I STER GET YEAR eYTE ADDRESS YEAR REG I STER ~~i T~E~~~=Y R~~i~TER ADDRESS CENTURY BYTE WRITE CENTURY LOCATION ADDRESS ALARM REG I STER READ CURRENT SETT I NGS CLEAR 'SET BIT' MOVE TO WORK REG I STER AND START CLOCK UPDATING SET CY= 0 RETURN CY=O SET RTt ALARM ADDRESS ALARM READ ALARM REG! STER CHECK FOR ALARM ALREADY ENABLED SET CARRY I N CASE OF ERROR ERROR EX I T I F ALARM SET BIOS2 5-177 IBM Person.1 Computer MACRO Assembler Version 2.00 81052 ---- 0&110/85 8105 INTERRUPT ROUTINES 228 01 OE E8 01&8 229 0 I I 1 13 03 230 0113 E8 0154 231 0116 23201168AE6 233 0118 BO 01 234 01 1 A E8 0000 23501108AEI 236 011F8003 231 0121 E8 0000 238 0124 8A E5 239 0126 BO 05 240 0128 E8 0000 241 0128 E4 AI 242 0120 24 FE 243 012F E6 AI 244 0131 88 0808 245 0134 E8 0000 246 0131 24 lF 241 0139 OC 20 246 0138 86 EO 249 0130 E8 0000 250 0140 F8 251 0141 252 0141 88 0000 253 0144 C3 25. 255 256 251 258 259 260 261 262 0145 0145 0148 0148 0140 014F 0152 0153 88 E8 24 86 E8 R R E CALL JNe CALL UPD IPR RTC-65 RTC:STA CHECK FOR UPDATE I N PROCESS SKIP INITIALIZATION IF NO ERROR ELSE INITIALIZE CLOCK MOV NOV AH,OH GET SECONDS BYTE AOORESS THE SECONDS ALARM REG I STER INSERT SECONDS GET MINUTES PARAMETER ADDRESS MINUTES ALARM REGISTER INSERT MINUTES GET HOURS PARAMETER AODRESS HOUR ALARM REG I STER I NSERT HOURS READ SECOND INTERRUPT MASK REGISTER ENABLE ALARM TIMER BIT (CY= O) WRITE UPDATED MASK ADDRESS ALARM REGI STER READ CURRENT ALARM REG I STER ENSURE SET BIT TURNED OFF TURN ON ALARM ENABLE MOVE MASK TO OUTPUT REG I STER WR ITE NEW ALARM MASK SET CY= 0 CALL NOV NOV E CALL NOV NOV E CALL IN AH,CC AL, CMOS MIN ALARM CMOS WRTTE AH,CH ~~o;M~~T~~_ALARM XCHG CALL MOV AX,O OR E ~~o;M~~T~~C_ALARM AL,INT80 1 AL,OFEH INT80l,AL AX.X·CMOS REG 8 CMOS READAL,07FH AL,20H AH,AL CMOS_WRITE AND OUT MOV CALL AND E eLe RET 0808 0000 E 51 EO 0000 E NOV CALL AND XCHG CALL eLe Fe C3 1-3 0&-10-85 ~~O~·~~~g_REG_8 AL,57H AH,AL CMOS_WRITE RET CLEAR AX REG I STER RETURN WITH RESULTS I N CARRY FLAG RESET ALARM ADDRESS ALARM REG I STER (TO BOTH AH, AL I READ ALARM REG I STER TURN OFF ALARM ENABLE SAVE DATA AND RECOVER ADDRESS RESTORE NEW VALUE SET CY= a RETURN WITH NO CARRY 263 2&4 205 266 261 268 269 210 211 212 213 214 215 270 211 27. 219 280 261 282 283 284 285 286 287 288 289 290 291 292 293 294 295 0154 RTC_OO 0154 015488 0151 E8 a I 5A B8 also E8 0160 80 0162 E8 0165 BO 0161 E8 016A C3 RTC STA PROC MOV CALL 260A 0000 820B 0000 OC 0000 00 0000 E CALL NOV E CALL NOV E CALL RET RTC_STA ENOP 51 89 0320 80 FA E8 A8 14 F8 E2 33 F9 OA UPO IPR PROC PUSH MOV MOV CALL TEST JZ F3 LOOP CO XOR STe ex CX,800 AL,CMOS_REG_A CMOS READ AL,80H UPD_90 STI 59 FA C3 POP eLi RET 0182 5-178 NEAR eLI 0000 E 80 06 290 297 INITIALIZE REAL TIME CLOCK ADDRESS REGISTER A AND LOAD DATA MASK INITIALIZE STATUS REGISTER A SET ~SET BIT" FOR CLOCK INITIALIZATION AND 24 HOUR MODE TO REGISTER B ADDRESS REG I STER C READ REGISTER C TO INITIALIZE ADDRESS REG I STER 0 READ REGISTER D TO INITIALIZE NOV E 0168 0168 016B 016C 016F a 16F 0171 0112 OilS 0171 0119 all A 01 7C ailE a I1F a 17F 0180 0181 ENOP UPD_IPR ENDP BIOS2 UPD 10 AX,AX ex WAIT TILL UPDATE NOT IN PROGRESS SAVE CALLERS REGISTER SET TIMEOUT LOOP COUNT ADDRESS STATUS REGISTER A NO TIMER INTERRUPTS DURING UPDATES READ UPDATE IN PROCESS FLAG IF UIP BIT IS ON ( CANNOT READ TIME) EX I T WITH CY= 0 I F CAN READ CLOCK NOW ALLOW INTERRUPTS WH I LE WA IT I NG LOOP TILL READY OR TIMEOUT CLEAR RESULTS I F ERROR SET CARRY FOR ERROR RESTORE CALLERS REG I STER I NTERRUPTS OFF OUR I NG SET RETURN WITH CY FLAG SET IBM Personal Computer MACRO Assembler Version 2.00 B[OS2 06/10/85 810S INTERRUPT ROUTINES 29. 299 300 30 I 302 303 304 305 306 307 30. 309 310 311 312 313 314 315 316 317 31. 319 320 321 322 323 324 325 326 327 32. 329 330 331 332 333 334 335 336 337 33. 339 340 341 342 343 344 345 346 347 34. 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 36. 369 370 371 372 373 374 375 376 377 378 379 380 3., 382 3'3 3.4 1-4 06-10-85 PAGE HARDWARE [NT 10 H -- ( IRQ ALARM I NTERRUPT HANDLER (RTC) TH I S ROUT I NE HANDLES THE T I MER. I NPUT FREQUENCY EVERY SECOND FOR THE PER THE INTERRUPT WILL OCCUR LEVEL 8) ----------------------------------- PER I 00 I C AND ALARM [NTERRUPTS FROM THE CMOS lSI. 024 KHZ OR APPROX I MATEL Y 1024 INTERRUPTS 100 I C INTERRUPT. FOR THE ALARM FUNCT I ON, AT THE DES I GNATED T [ME. INTERRUPTS ARE ENABLED WHEN THE EVENT OR ALARM FUNCTION IS ACTIVATED. FOR THE EVENT INTERRUPT, THE HANDLER WILL DECREMENT THE WA [T COUNTER AND WHEN IT EXP I RES WILL SET THE DES [GNATED LOCAT I ON TO 80H. FOR THE ALARM INTERRUPT. THE USER MUST PRO V I DE A ROUT I NE TO INTERCEPT THE CORRECT ADDRESS FROM THE VECTOR TABLE [NVOKED BY INTERRUPT 4AH PR I OR TO SETT I NG THE REAL T I ME CLOCK ALARM (I NT 1 AH, AH= 06HJ. ; 0182 0182 IE 0183 50 0184 51 0185 0185 0188 018A o 18B 0180 018F 88 E6 90 E4 A8 14 0191 0193 0195 0\96 0198 o 19A 0\9C 86 E6 90 E4 22 A8 14 - -- - - - - - - - - - - - - ---------- - -- - - - - - - -- -- -- - - -- - - -- - - - - - -- - - -- - -- - - - - - - - - -- - - ---- RTC - RTC INT PROC PUSH PUSH PUSH I ALARM INTERRUPT LEAVE INTERRUPTS 0 t SABLED SAVE REGI STERS FAR OS AX 01 ; I: 8BBC 70 OOV OUT NOP IN 11 60 40 TEST "Z AL,CMOS DATA AL,OIIOOOOOB RTC I 9 EO 10 XCHG OUT NOP AH.AL CMOS _PORT, AL 1\ C4 40 30 IN AL, CMOS DATA AL ,AH AL, 010000008 RTC_I_5 AND TEST "Z DECREMENT WAlT COUNT BY 019E E8 0000 E 01 AI 2E 009C R 0300 o I A1 83 IE 009E R 00 OIAC 13 20 " CALL 005 SU8 PRTC LOW,0916 PRTC-HIGH,O RTC T 5 588 "NC CHECK FOR SECOND INTERRUPT ~~O~ c~g~'f~~~-B+NM1) ·H+CM~\lj~~~EC;~~~M; F~~~R~A~~O Ag~~~~~ ; ; ; ; I/O DELAY READ AND RESET INTERRUPT REQUEST FLAGS CHECK FOR EITHER INTERRUPT PENDING EXIT IF NOT A VALID RTC INTERRUPT SAVE FLAGS AND GET ENABLE AODRESS WRITE ALARM ENABLE MASK ADDRESS I/O DELAY READ CURRENT ALARM ENABLE MASK ALLOW ONLY SOURCES THAT ARE ENABLED CHECK FOR PER I 00 I C [NTERRUPT SKIP IF NOT A PERIODIC INTERRUPT INTERRUPT ; ; ; ; INTERVAL ESTABLISH DATA SEGMENT ADDRESSAB1LlTY DECREMENT COUNT LOW BY 1/1024 ADJUST HIGH WORD FOR LOW WORD BORROW SKIP TILL 32 BIT WORD LESS THAN ZERO TURN OFF PER I 00 I C I NTERRUPT ENABLE 01 AE OlAF 0lB2 01 B4 0lB5 0lB1 0lB9 OIBB OIBO OIBF 01 C I 01 C6 OICA a 1CO OICE DICE 0100 50 88 E6 90 E4 24 86 E6 86 E6 C6 C5 C6 58 8B8B 10 PUSH OOV OUT NOP AX AX, X· (CMOS REG B+NM I ) CMOS_PORT ,AL - 71 BF C4 10 C4 11 06 OOAO R 3E 0098 R 05 80 IN XCHG OUT XCHG OUT MOV AL,CMOS DATA AL.OBFHAL,AH CMOS PORT, AL AL,AH CMOS DATA,AL OlIRTC-WA I T FLAG, 0 01 ,DWORD PTR ilIIUSER FLAG BYTE PTR [OI],80H AX 0102 0104 0106 0101 0108 01DA 010B OIDC OIDC BO 00 E6 10 FB 52 CO 4A 5A FA LOS MOV POP RTC I 5: A8 20 14 OA "Z AL,OOIOOOOOB RTC I 1 TEST FOR ALARM [NTERRUPT SK [P USER I NTERRUPT CALL MOV OUT AL,CMOS REG 0 CMOS_PORT ,AL POINT TO DEFAULT READ ONLY REGISTER ENABLE NM [ AND CMOS ADDRESS TO DEF AUL T I NTERRUPTS BACK ON NOW TEST STI PUSH 4AH OX CLI EB A1 BO E6 BO E6 E6 SF 58 IF CF 00 10 20 AO 20 - I - 9: MOV OUT MOV OUT OUT POP POP POP [RET TRANSFER TO USER ROUT! NE BLOCK I NTERRUPT FOR RETRY RESTART ROUTINE TO HANDLE DELAYED ENTRY AND SECOND EVENT BEFORE DONE "MP RTC [F NOT ALARM OX INT POP 7, o IDE OIOE OlEO 0lE2 01 E4 0lE6 01E8 01 E9 OlEA 0lE8 AND SAVE INTERRUPT FLAG MASK I NTERRUPT ENABLE REG I STER WR I TE ADDRESS TO CMOS CLOCK I/O DELAY READ CURRENT ENABLES TURN OFF PIE GET CMOS ADDRESS AND SAVE VALUE ADDRESS REGI STER B GET NEW INTERRUPT ENABLE MASK SET MASK IN INTERRUPT ENABLE REGISTER SET FUNCT I ON ACT I VE FLAG OFF SET UP (DS:DI) TO POINT TO USER FLAG TURN ON USERS FLAG GET I NTERRUPT SOURCE BACK AL,CMOS REG 0 CMOS PORT. AL AL,EDI INTBOO,AL INTAOO ,AL 01 AX OS EX I T - NO PEND I NG INTERRUPTS PO I NT TO DEFAULT READ ONLY REG I STER ENABLE NM I AND CMOS ADDRESS TO DEF AUL T END OF INTERRUPT MASK TO 6259 - 2 TO 8259 - 2 TO 8259 - I RESTORE REGI STERS END OF INTERRUPT BIOS2 5-179 1-5 IBM Personal Computer MACRO Assembler Version 2.00 810S2 ---- 06/10/85 8105 INTERRUPT ROUTINES 385 386 381 388 389 390 391 392 393 394 395 396 391 398 399 400 401 402 403 404 405 406 401 408 409 410 411 412 413 414 415 416 411 418 419 420 421 422 423 424 425 426 421 428 429 430 431 432 433 434 435 436 431 438 439 440 441 442 443 444 445 446 PAGE ;--- lNT 05 ~ ----------------------------------------------------------------; PR I NT SCREEN -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 I S INTENDED TO RUN WITH INTERRUPTS ENABLED. IF A SUBSEQUENT PRINT SCREEN KEY IS DEPRESSED WHILE THIS ROUTINE IS PRINTING IT WILL 8E IGNORED. THE BASE PR I NTERS STATUS I S CHECKED FOR NOT BUSY AND NOT OUT OF PAPER. AN INITIAL STATUS ERROR WILL ABEND THE PRINT REQUEST. ADDRESS 0050:0000 CONTAINS THE STATUS OF THE PRINT SCREEN: 50: a = 0 PR I NT FROM PRINT ERROR = 1 = 255 SCREEN HAS NOT BEEN CALLED OR UPON RETURN A CALL THIS INDICATES A SUCCESSFUL OPERATION. SCREEN IS IN PROGRESS - IGNORE THIS REQUEST. ENCOUNTERED DURING PRINTING. 01EC DELAY INTERRUPT ENA8LE TILL FLAG SET 01EC OlEO 01EE 01EF 01 FO 01F1 01F4 0lF9 01F8 0200 0201 0203 IE 50 53 51 52 E8 80 14 C6 F8 84 CD 0000 E 3E 0100 R 01 14 06 0100 R 01 PUSH PUSH PUSH PUSH PUSH CALL CMP JE MOV OF 10 MOV INT 511 0205 8A CC 0201 8A 2E 0084 R 0208 FI:: C5 MOV MOV INC I- - ; ; ; ; ~;~ 0200 020F 021 1 0213 0216 0219 33 84 CD 80 F6 15 02 02 17 F4 80 C4 AD 4E OS SAVE WORK REGISTERS AX BX CX OX USE 0040:0100 FOR STATUS AREA STORAGE GET STATUS 8YTE DATA SEGMENT DDS SEE IF PR I NT ALREADY I N PROGRESS "STATUS BYTE, 1 PRI90 EX I T IF PR I NT ALREADY I N PROGRESS INDICATE PRINT NOW IN PROGRESS" IllSTATUS_BYTE, 1 MUST RUN WITH I NTERRUPTS ENABLED WILL REQUEST THE CURRENT SCREEN MODE AH,OFH (All = MODE 10H (AH)= NUMBER COLUMNS/LINE (BHl= VISUAL PAGE WILL toJAKE USE OF (ex) REG I STER TO CL,AH CONTROL ROWS ON SCREEN " COLUMNS CH,IllROWS CH ADJUST ROWS ON D I SPLA Y COUNT (CL)= NUMBER COLUMNS/LINE (CH) = NUMBER OF ROWS ON D I SPLA Y - -- - - -- - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - -- - - -- - - - - - -- - - - - --AT THIS POINT WE KNOW THE COLUMNS/LINE COUNT IS IN (CLf : AND THE NUMBER OF ROWS ON THE DISPLAY IS IN'(CH). THE PAGE IF APPLICABLE IS IN (BH). THE STACK HAS (OS), (AX), (BX), (CX), (OX) PUSHEO. ---- -~; ~~; ---------------------;;; -;;; ~~ ~~E~ ------------------ MOV INT XOR TEST JNZ AH,02H 17H AH,080H AH, OAOH PRI80 SET PRINTER STATUS REQUEST COMMAND REQUEST CURRENT PRINTER STATUS CHECK FOR PRINTER BUSY (NOT CONNECTED) OR OUT OF PAPER ERROR EXIT IF PRINTER STATUS ERROR 021B E8 0215 R CALL CRLF CARR I AGE RETURN LINE FEED TO PR INTER 021E 021F 0221 0223 0224 0225 SAVE SCREEN SOUNDS PUSH CX MOV NOW READ THE CURRENT CURSOR POS I T I ON AH',03H 10H AND RESTORE AT END OF ROUT I NE INT RECALL SCREEN BOUNDS POP CX PRESERVE THE OR I G I NAL POS I T I ON OX PUSH INITIAL CURSOR (0,0) AND FIRST PRINTER DX,DX XOR ; - - - - - - - - - - - - -- -- - - - -- -- - - -- -- -- -- - - - - - - - - - -- - - - - - - - - - - - - - - -; TH I S LOOP I S. TO READ EACH CURSOR POS I T I ON FROM THE ; SCREEN AND PRINT IT. (BH)= VISUAL PAGE (CH)= ROWS ; - - -- -- -- - - - -- - - - - - - - - - - - - - - - - - - ------ - - - - - - ---- -- - -- --- - -- - - --- 51 B4 03 CD 10 59 52 33 02 - 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 410 411 412 473 474 475 416 411 418 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 06-10-85 0227 0221 0229 022B 0220 022F 0231 0233 0235 0235 0236 0238 023A 023C 0230 0240 0242 0244 0246 0248 024A 024C 0240 0250 0251 0253 0255 52 33 32 CD 5A F6 15 FE 3A 75 32 8A 52 E8 5A FE 3A 75 0251 0258 025A 025C 0250 0262 5A B4 CD FA C6 EB 0264 0264 0265 0267 0269 0269 026A 026F 026F 0270 0271 0272 0273 0214 0215 - -- PRIlO: B4 CD B4 CD OA 75 BO 02 10 08 10 CO 02 20 "OV INT MOV INT OR JNZ MOV AH,02H 10H AH,08H 10H AL,AL PRI20 AL, INDICATE CURSOR SET REQUEST NEW CURSOR POSITION ESTABLISHED INDICATE READ CHARACTER FROM DISPLAY CHARACTER NOW IN, (AL) SEE ,IF VALID CHAR JUMP I F VALl D CHAR ELSE MAKE I T A BLANK OX DX,DX AH,AH C6 EE DO PUSH XOR XOR INT POP TEST JNZ INC CMP JNZ XOR MOV PUSH CALL POP INC CMP JNZ SAVE CURSOR POSITION INDICATE FIRST PRINTER (DX= Ol INDICATE PRINT CHARACTER IN (AL) PR I NT THE CHARACTER RECALL CURSOR POS I T I ON TEST FOR PR I NTER ERROR EX I T I F ERROR DETECTED ADYANCE TO NEXT COLUMN SEE IF AT END OF I-INE I F NOT LOOP FOR NEXT COLUMN BACK TO COLUMN a (AH) =0 SAVE NEW CURSOR POSITION LINE FEED ,CARR I AGE RETURN RECALL CURSOR POS I T I ON ADVANCE TO NEXT LINE FINI SHED? I F NOT LOOP FOR NEXT LI NE 02 10 POP MOV INT OX AH,02H 10H PR120: 02 E4 11 C4 29 22 C2 CA OF 02 E2 0275 R I1H OX AH,29H PRI70 DL CL,DL PRIIO DL,DL AH.DL OX CRLF OX DH CH,DH PRll0 MOV JMP OSTATUS BYTE,O SHORT PRI90 GET CURSOR POSITION INDICATE REQUEST CURSOR SET CURSOR POS I T I ON RESTORED BLOCK INTERRUPTS TILL STACK CLEARED MOVE OK RESULTS FLAG TO STATUS BYTE EXIT PRINTER ROUTINE - POP MOV INT OX AH,02H 10H ERROR EXIT GET CURSOR POSITION INDICATE REQUEST CURSOR SET CURSOR POSITION RESTORED CLI 06 0100 R 00 OB PR170: 5A B4 02 CD 10 PR180: CLI FA C6 06 0100 R FF BLOCK. INTERRUPTS TILL STACK CLEARED SET ERROR FLAG MOV PR190: 5A 59 5B 58 IF CF 5-180 POP POP POP POP POP IRET PRINT_SCREEN_' BIOS2 Ox CX BX AX OS EX IT ROUT I NE RESTORE ALL THE REGISTERS USED RETURN WITH ENOP I NIT I AL I NTERRUPT MASK 1-6 IBM Personal Comput.er MACRO Assembler Version 2.00 BIOS2 ---- 06/10/85 BIOS INTERRUPT ROUTINES 06-10-85 4 •• 500 501 502 0215 ,----- CARRIAGE RETURN. LINE FEED SU8ROUTINE CRLF PROC NEAR OX.OX AX,CR CRLF XOR MOV INT MOV INT RET ENOP SENO CR,LF TO FIRST PRINTER ASSUME FIRST PRINTER lOX: OJ GET THE PRINT CHARACTER COMMAND ANO THE CARR I AGE RETURN CHARACTER NOW GET THE LINE FEED AND SENO I T TO THE B I OS PR I NTER ROUT I NE 503 504 505 506 501 508 509 510 0215 0211 0211. 027C 027F 0281 0282 33 B8 CD B8 CO C3 02 0000 17 OOOA 17 I7H AX,LF I7H 511 512 513 514 515 51. ;-- HARDWARE INT 08 H -- t IRQ LEVEL a ) ------------------------------------I THIS ROUTINE HANDLES THE TIMER INTERRUPT FROM FROM CHANNEL 0 OF ; THE 8254 TIMER. INPUT FREQUENCY IS 1.19318 MHZ AND THE DIVISOR I IS 65536. RESULTING IN APPROXIMATELY 18.2 INTERRUPTS EVERY SECOND. ; 517 518 51' 520 521 522 523 524 525 52. 527 528 52. 530 531 532 533 534 535 536 537 538 539 540 541 542 543 THE INTERRUPT HANDLER MAINTAINS A COUNT t4016C) OF INTERRUPTS SINCE POWER ON TIME. WHICH MAY 8E USED TO ESTA8LISH TIME OF DAY. THE INTERRUPT HANDLER ALSO DECREMENTS THE MOTOR CONTROL COUNT (40140) OF THE 0 I SKETTE. AND WHEN IT EXP I RES. WILL TURN OFF THE a I SKETTE MOTOR ( s I I AND RESET THE MOTOR RUNN I NG FLAGS. THE I NTERRUPT HANDLER WILL ALSO I NVOKE A USER ROUT 1NE THROUGH INTERRUPT 'CH AT EVERY TIME TICK. THE USER MUST CODE A ROUTINE AND PLACE THE CORRECT ADDRESS IN THE VECTOR TA8LE. I - - ----------- --------------------- ----------- - -- -- ------ ---- -- - - - - - - - - - - - ----0282 0282 0283 0284 0285 0286 0289 0280 028F 0293 0293 0298 029A 02AO TIMER F8 IE 50 52 E8 FF 75 FF - 0000 E 06 006C R 04 06 006E R CMF JNZ CMF JNZ 1----02A2 02A4 02A 7 02AA 2B A3 A3 C6 CO 006E R 006C R 06 0070 R 01 02AF 02AF 02B3 02B5 02BA 02BC OZ8F FE 75 80 BO SA EE DE 0040 R OB 26 003F R Fa DC 03F2 551 FAR INTERRUPTS BACK ON OS AX SAVE MACHINE STATE ESTABL I SH AOORESSA81 L I TY 1NCREMENT T I ME GO TO TEST DAY INCREMENT HIGH WORD OF TIME TEST DAY TEST FOR COUNT EQUAL I NG 24 HOURS GO TO 01 SKETTE_CTL OX DDS PTINER LOW T4 IITlMER_HIGH 553 ~~IMER_HIGH. 018H +~IMER_LOWI oeOH I GO TO 01 SKETTE_CTL TIMER HAS GONE 24 HOURS sua MOV MOV MOV 1----- 552 554 555 556 557 558 559 560 PROC T4= 83 3E 006E R 18 75 15 81 3E 006C R OOBO 15 00 544 545 5.6 541 548 549 550 INT 1 STI PUSH PUSH PUSH CALL INC JNZ INC TEST FOR DISKETTE TIME OUT T51 DEC .JNZ AND MOV MOV OUT "MOTOR COUNT T6 "MOTOR STATUS I QFOH AL.OCHOX I 03F2H DX.AL DECREMENT 0 I SKETTE MOTOR CONTROL RETURN I F COUNT NOT OUT TURN OFF MOTOR RUNN I NG BITS FDC CTL PORT TURN OFF THE MOTOR 561 562 563 OlCO 02CO CD IC INT ICH FOF MOV CLI OUT FOF FOF IRET OX AL.EOI 56' 565 566 567 568 569 570 571 02C2 02C3 02C5 02C6 02C8 02C9 02CA SA BO 20 FA E6 20 58 IF CF INTAOO,AL TIMER TICK INTERRUPT TRANSFER CONTROL TO A USER ROUT I NE RESTORE tOX) GET END OF I NTERRUPT MASK DISABLE INTERRUPTS TILL STACK CLEARED END OF J NTERRUPT TO 8259 - I AX 05 RESET MACHINE STATE RETURN FROM 1NTERRUPT 572 573 02C8 TIMER 02CB CODE INT_' ENOP 574 575 57. ENDS END BIOS2 5-181 I-I IBM Personal Computer MACRO AssembLer Version 2.00 ORGS ----- 06/10/85 COMPATIBILITY MODULE I 2 3 4 5 PAGE 118.121 TITLE ORGS ----- 06/10/85 COMPATIBILITY MODULE .LIST CODE SEGMENT BYTE PUBL I C 0000 • PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC T 8 • 10 .. II 12 13 15 I. IT 18 20 " 21 22 23 2. 25 2. 2T 28 2. 30 31 32 33 3. 35 3. 3T 38 3. .,.2 .0 .3 •• .5 •• .T .8 •• 50 51 52 53 5. 55 5. 5T 58 5. ., •0 .2 •3 •• •• .T •• .5 .8 TO TI 12 T3 EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN T. 15 T. 11 T8 T' 80 81 82 83 8. 85 8. 8T 88 8' .0 ".3 •• ••.T •• '2 .S ASSUME '8 100 101 102 103 10. 105 10. lOT 108 10. 5-182 06-10-85 AI CONF TBL CRT CHAR GEN Dl 02 02. DISK BASE DUMMY RETURN EIOI EI02 EI03 EI04 EI05 EI06 EI07 EI08 EI09 EI61 EI62 EI63 E164 E201 E202 E203 E301 £302 E303 E304 E401 E501 E601 E602 FI780 FI781 FI782 F1790 F1791 F3 • F3D F301 FO TeL. FLOPPY HRD KIO KII KI2 KI3 KI. KI' K. K.L K1 K8 K• M' M5 M• M1 NMI INT PR I AT SCREEN PO R- ~E~~~-~ECTOR TUTORVECTOR T ABL.E VloEO_PARMS TABLE BOOT STRAP liNEAR CAssETTE 10 I: NEAR 011 :NEAR- - g:~~-~~~O~:~~~~ DISKETTE 10 I :NEAR DSKETTE SETUP: NEAR EQUIPMENT liNEAR INT 2871NEAR KI6:NEAR KEYBOARD 10 I I NEAR ~~M~~~-~T~~A~ET I: NEAR ~~: R+ N~C~~~~A~ : ~EAR PR I NTER 10 I :NEAR RE OIRECTINEAR RS232 10 I I NEAR RTC INT:REAR SEEKINEAR START liNEAR TIME OF DAY liNEAR TIME" IAT I:NEAR VIDEO:IO_T:NEAR CS:CODE.DSIDATA THIS MODULE HAS BEEN AOOED TO FACILITATE THE EXPANSION OF THIS PROGRAM. IT ALLOWS FOR THE FIXED ORG STATEMENT ENTRY POINTS THAT HAVE TO REMAIN AT THE SAME ADDRESSES. THE USE OF ENTRY POINTS AND TABLES WITHIN THIS MOCULE SHOULD BE AVOIDED AND ARE INCL.UDED ONL.Y TO SUPPORT EXISTING CODE THAT VIOLATE THE STRUCTURE AND DESIGN OF BIOS. ALL BIOS ACCESS SHOULD USE THE DOCUMENTED INTERRUPT VECTOR INTERFACE FOR COMPATIBILITY. ORGS '-2 IBM Personal Computtlr MACRO Assembler Version 2.00 ORGS ----- 06/10/85 COMPATl81LITY MOOULE 110 II. 112 "' II. 115 II. I 17 I IB I 19 1i20 121 122 PAGE ; ; ORG 0000 0000 36 30 2E 31 31 20 34 20 20 39 39 20 38 43 49 3B 38 30 4f" 42 31 35 30 50 40 2C 20 39 52 20 20 20 .2_ ••• ••• ••• ••• '6480090 COPR. IBM 1981, 1985 I 0020 50 20 20 0030 50 20 20 0040 SF s O. 41 43 31 41 43 32 3F 52 49 54 4B 45 43 00 OA 52 49 54 48 45 43 00 OA 3F SF 3F 59 4B O. DB 'PARITY CHECK I ' ,CR,LF PLANAR 80ARD PAR ITY CHECK L.ATCH SET 59 4B 02 DB 'PARITY CHECK 2' ,CR,LF I/O CHANNEL CHECK LATCH SET 00 02. DB '?l1??',CR,LF 'P 0041 n- 005B 005B 005B E9 0000 E RESET: ORG ORG ""P S OE05BH 0005BH START -• RESET START VECTOR ON TO THE MOVED POST CODE 1-------------------------------: ; POST ERROR MESSAGES •• 2 146 147 14B 149 ISO lSI 152 153 154 155 156 157 15B 159 160 161 162 163 164 165 166 167 16B 169 170 171 172 113 174 175 116 177 17B 179 180 181 182 I B3 184 185 IB6 IB7 IB8 1 B9 190 191 192 193 194 195 196 197 198 199 200 20 I 202 203 204 205 206 207 208 209 210 211 212 213 214 2I5 216 2I1 218 219 220 221 222 223 OOOOOH DB ;-------------------- --- ----- ----- - - ---; PAR TTY ERROR MESSAGES ;---------------------------------------- '23 .25 130 13. 132 13. 13. 135 13. 137 138 13_ •• 0 --------------------- -- - - -COPYRIGHT NOTICE : -------------------------------ORG OEOOOH ;---- 11- .2.'2' '27 .28 06-10-85 ; 005E 20 31 30 31 79 73 74 65 42 6F 61 72 45 72 72 6f" OA 0077 20 31 30 32 79 73 74 65 42 6f" 61 72 45 72 72 6f" OA 0090 20 31 30 33 79 73 14 65 42 6f" 61 72 45 72 72 6f" OA 00A9 20 31 30 34 79 73 14 65 42 6f" 61 72 45 72 72 6f" OA 00C2 20 31 30 35 79 73 14 65 42 £If" 61 72 45 72 72 6f" OA 00D8 20 3 I 30 36 79737465 42 6F 6 I 72 457272 £If" OA 00F4 20 31 30 37 79 73 14 65 42 £IF 6 I 72 45 12 12 6F OA 0100 20 31 30 38 79 73 14 65 42 6F 6 I 72 45 72 72 6F OA 0126 20 31 30 39 79 73 14 65 42 £IF £II 12 45 72 72 6F OA 013F 20 31 36 31 79 73 74 65 4F 70 74 69 73 20 4E 6F 53 65 74 20 75 £IE 20 53 55 50 29 00 016B 20 31 36 32 79 73 14 65 4F 10 74 69 73 20 4E £IF 53 65 74 20 75 6E 20 53 55 50 29 00 0191 20 31 36 33 69 6D 65 20 44 61 T4 65 6F 74 20 53 20 28 52 15 53 45 54 55 ODOA 0187 20 31 36 34 65 60 £IF 72 53 69 7A 65 72 72 6F 72 52 75 £IE 20 54 55 50 29 01D8 20 32 30 31 65 60 £IF 72 45 72 72 6F OA OIEE 20 32 30 32 65 6D £IF 72 -------------------------------- 20 60 64 72 53 i20 20 00 EtOI OB , lOI-System Board Error',CR,LF INTERRUPT FAILURE 20 60 64 72 53 20 20 00 El0i2 OB • l02-Syste", Board Error' ,CR,LF ; TIMER FAIL.URE 20 6D 64 72 53 20 20 OD EI03 OB , l03-System Board Error',CR,LF ; TIMER INTERRUPT FAIL.URE 20 6D 64 72 53 20 20 OD Et04 OB • l04-Syste", Board Error',CR,LF ; PROTECTED MODE FAILURE 2D 6D 64 72 53 20 20 OD Et05 OB • lOS-System Board Error·,CR,L.F I LAST B042 COMMAND NOT ACCEPTED 20 6D 64 72 53 20 20 00 EI06 DB , l06-System Board Error',CR,LF I CONVERTING LOGIC TEST 2D 6D 64 12 53 20 20 OD EI07 OB , 10T-Syst.'" Board Error',CR,LF ; HOT NMI 20 60 64 72 53 20 20 00 EI08 OB , lOB-Syatem Board Error',CR.L.F I 20 6D 64 72 53 20 20 OD EI09 OB , 109-System Board Error',CR,L.F ; LOW MEG CHIP SELECT TEST 20 60 6F 74 28 45 OA 2D 60 6F 53 20 6E 20 52 54 E161 DB , 161-System Options Not Set-IRun SETUP) ',CR,LF 53 20 6E EI62 DB • 162-System Options Not Set-(Run SETUP) ',CR,LF ;CHECKSUM/CONFIG TEST TIMER BUS TEST DEAD BATTERY 14 20 2B 52 45 OA 2D 26 20 65 6E 50 54 54 20 4E 74 20 29 EI63 DB , 163-Tillle & Date Not. Set-IRun SETUP)' ,CR,LF ;CLOCK NOT UPDATING 20 79 20 20 53 00 2D 79 72 4D 20 45 28 45 OA 4D 20 OD EI64 DB • 164-Melllory S I ita Error- (Run SETUP)' ,CR,L.F I CMOS DOES NOT MATCH E201 DB 20 40 79 20 E202 OB 20 I -Memory Error' ,CR,LF , 202-Melllory Address Error' ,CR,LF LINE ERROR 00->15 ORGS 5-183 1-3 IBM Personal Computer MACRO Aasembler Version 2.00 ORGS ----- 06/10/85 COMPATIBILITY MODULE 224 225 226 221 228 229 230 231 232 233 234 235 236 231 238 239 240 241 242 243 244 245 246 247 246 249 250 251 252 253 254 255 256 257 258 259 260 0209 0224 0239 0250 = 41 13 12 20 65 41 73 12 20 65 64 12 20 79 55 65 20 63 20 40 46 59 64 20 00 32 60 64 20 00 33 79 20 00 33 64 45 OA 30 6F 64 45 OA 30 62 45 OA 30 72 65 13 72 72 6F 33 72 72 72 20 19 65 72 40 20 211 276 219 280 281 282 283 284 265 286 287 288 289 290 291 292 293 294 295 296 291 298 299 300 301 302 303 304 305 306 , 203-Memory Address Error' ,CR,LF LINE ERROR 301-Keyboard Error' ,CR,LF KEYBOARD ERROR E203 DB 31 20 48 &F 61 12 12 12 6F E301 DB 32 20 53 E302 DB , F3D DB '(RESUME ; ----- NMI 6F 302-System Unit Keylock Is Locked',CR,LF I KEYBOARD LOCK ON 13 14 65 60 20 6E 79 69 6B 28 45 31 29 69 6C 73 65 52 20 22 00 14 &F 20 &4 45 3D 20 OA 20 63 4C 00 53 20 4B 4S 68 6F OA 55 22 45 I. 0273 02C3 02C3 02C3 E9 0000 E = 02C6 20 65 64 79 55 12 33 19 20 13 6E 72 30 62 4F 14 69 6F 33 20 48 bF 61 72 12 20 53 b5 60 20 74 20 45 12 00 OA 02EA 20 65 64 19 55 12 030E 20 52 bF 031E 20 52 6F 032E 20 69 65 12 33 79 20 13 6E 72 34 54 12 30 62 4F 14 69 6F 30 20 00 30 20 00 30 68 45 OA 34 6F 12 65 14 72 31 45 OA 31 45 OA 31 66 12 35 64 72 36 13 20 00 0343 20 69 65 20 64 72 36 13 20 52 30 6B 42 65 20 45 00 OA 0364 31 69 46 65 0379 31 69 46 65 038E 31 69 bE 65 6C 03AC 31 69 45 OA 03eF 31 69 45 OA 37 38 30 73 68 20 61 69 6C 00 OA 37 38 31 73 6B 20 61 69 6C 00 0" 37 38 32 73 68 20 74 72 &F 72 20 46 75 72 &5 37 39 30 73 6B 20 72 72 6F 20 61 20 60 20 00 20 72 4B 72 53 20 45 OA 43 72 11- ORG NMI ORG INT EQU = ~Ft~ KEY) ',CR,LF ENTRY S OE2C3H 002C3H S "". NMI_INT_' E303 DB , ,----E304 KEY80ARD/SYSTEM ERROR DB ' 304-Keyboard Or System Unit Error',CR.LF E401 DB 401-CRT Error',CR,LF I VECTOR ON TO MOVED NM I CODE 303-Keyboard Or System Unit Error',CR,LF KEY80ARD CLOCK HIGH MONOCHROME 20 43 12 12 E501 DB Sal-CRT Error',CR,LF COLOR 20 44 74 14 12 6F E601 DB 601-Dlskette Error',CR,LF DISKETTE ERROR DISKETTE BOOT RECORO I 5 NOT VALID DB ' 602-0iskette Boot Record Error',CR,LF 32 20 44 65 14 74 6F 6F 74 63 6F 72 72 72 6F HARD FILE ERROR MESSAGE DB '1780-Disk 0 Failure',CR,LF 20 44 30 20 75 72 1 Fs I lure' ,CR,LF 20 44 31 20 15 72 FI181 DB '1181-olsk 20 43 bC 61 00 20 30 72 44 6F bC 69 OA 44 20 00 FI782 DB '1782-01 Bk Contra Iler Fat lure',CR,LF FI790 DB '1790-01sk o 37 39 31 20 44 73 6B 20 31 20 72 72 &F 72 00 FI791 DB '1791-01 sk 1 Error' ,CR,LF 4F 40 20 20 45 72 6F 12 20 00 F3A DB 'ROM Error' ,CR,LF 307 308 309 310 3I I 312 313 314 315 316 0302 52 72 OA 03DF 20 6E 53 20 48 68 5-184 16->23 13 261 262 263 264 265 266 267 268 269 210 211 212 213 214 275 216 06- I 0-85 20 6C 79 55 20 6F 73 6E 65 19 20 00 20 20 55 63 68 20 14 65 60 &9 14 20 bC 6F 63 OA ORGS F301 DB Error ,CR,LF -Un [ock System Un i t ROM CHECKSUM Key lock ,CR,LF IBM Personal Computer MACRO Assembler Version 2.00 ORGS ----- Ob/l0/85 COMPATIBILITY MODULE 317 318 319 320 321 322 323 324 325 32. 327 328 329 330 331 332 333 334 335 PAGE ; I - - - - - - - -------- - - - - - - -- - - -- - - -- - -------- ---- -- - - -- - - --IN] TI ALI ZE DR I VE CHARACTER I ST I CS ; ; ; : FIXED DISK PARAMETER TABLE - THE TABLE +0 +2 +3 +5 +1 +8 +9 +12 + 14 + 15 33. 337 338 339 340 341 342 343 344 345 34. 347 348 349 350 351 352 353 354 355 356 357 358 359 3.0 361 3.2 3.3 3.4 3'5 366 367 3.8 3'9 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 38. 387 388 389 390 391 392 393 394 395 39' 397 398 399 400 401 402 403 404 405 406 407 408 409 410 4" 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 1-4 Ob-l0-85 (1 (1 (1 (1 (( (1 WORD~ WORD~ BYTE~ BYTE~ I S COMPOSED OF A BLOCK DEF I NED AS: - (3 BYTES ~ (1 WORD~ (1 BYTE 1 (1 BYTE 1 - 0401 WORD~ BYTE ~ MAXIMUM NUMBER OF CYLINDERS MAX I MUM NUMBER OF HEADS NOT USED/SEE PC-XT STARTING WRITE PRECOMPENSATION CYL NOT USED/SEE PC-XT CONTROL BYTE BIT 1 DISABLE RETRIES -ORBIT b DISABLE RETRIES BIT 3 MORE THAN 8 HEADS NOT USED/ SEE PC-XT LANDING ZONE NUMBER OF SECTORS I TRACK RESERVED FOR FUTURE USE TO DYNAMICALLY DEFINE A SET OF PARAMETERS BU I LD A TABLE FOR UP TO 15 TYPES AND PLACE THE CORRESPOND I NG VECTOR I NTO INTERRUPT 41 FOR OR I VE 0 AND INTERRUPT 4b FOR DR I VE 1. FD_TBl! DRIVE TYPE 01 0401 0132 0403 04 0404 0000 040b 0080 0408 00 0409 00 040A 00 00 00 04000131 040F 0410 00 D. DB D. D. DB DB DB D. DB DB 0411 0413 0414 041b 0418 0419 041A 0410 041F 0420 02b1 04 0000 012C 00 00 00 00 00 02b1 D. DB D. D. DB DB DB D. DB DB 0421 0423 0424 042b 0428 0429 042A 0420 042F 0430 02b1 Ob 0000 012C 00 00 00 00 00 02b1 0431 0433 0434 043b 0438 0439 Q43A 0430 043F 0440 03AC 08 0000 0200 00 00 00 00 00 03AC 0441 0443 0444 044b 0448 0449 044A 0440 044F 0450 03AC Ob 0000 0200 00 00 00 00 00 03AC 0451 0453 0454 045b 0458 0459 045A 0450 045F 04bO 02b1 04 0000 FFFF 00 00 00 00 00 02b1 " 030bD 040 0 01280 0 0 0.0.0 03050 170 0 CYLINDERS HEADS WRITE PRE-COMPENSATION CYLINDER CONTROL BYTE LAND I NG ZONE SECTORS /TRACK DR I VE TYPE 02 " 00 Ob150 040 0 03000 0 0 0.0.0 Ob15D 170 0 CYL I NOERS HEADS WRITE PRE-COMPENSATION CYLINDER CONTROL BYTE LAND I NG ZONE SECTOR S / TRACK DRIVE TYPE 03 " 00 O. Ob150 DB D. D. DB DB DB D. DB DB 060 0 03000 0 0 0.0.0 Ob 150 170 0 CYL INDERS HEADS WR I TE PRE-COMPENSAT I ON CYL I NDER CONTROL BYTE LAND I NG ZONE SECTORS/TRACK DR I VE TYPE 04 " 00 D' DB D. D. DB DB DB D. DB DB 09400 080 0 05120 0 0 0.0.0 09400 170 0 CYL I NOERS HEADS WRITE PRE-COMPENSATION CYLINDER CONTROL BYTE LAND I NG ZONE SECTORS/TRACK OR I VE TYPE 05 " 00 D. DB D. D' DB DB DB D. DB DB 09400 0.0 0 05 (20 0 0 0.0.0 09400 170 0 CYL INDERS HEADS WRITE PRE-COMPENSATION CYLINDER CONTROL BYTE LAND I NG ZONE SECTORS /TRACK OR I VE TYPE Db " 00 D. DB D. D. DB DB DB D. DB OS Ob150 040 0 OFFFFH 0 0 0.0.0 Ob150 170 0 CYLINDERS HEADS NO WRITE PRE-COMPENSATION CONTROL BYTE LAND I NG ZQNE SECTOR S I TRACK DR I VE TYPE 01 04bl DICE 04b3 08 04b4 0000 D. DB D. 04b20 080 0 CYL INDERS HEADS ORGS 5-185 1-5 IBM Persona I Computer MACRO Ass.mb ler Version 2.00 ORGS ----- 06/10/85 COMPATIBILITY MODULE 431 432 433 434 435 43. 431 .38 .3. 440 441 442 .43 44' •• 5 4 •• 441 •• 8 44. '50 .51 '52 453 45. .55 45. 451 '58 .5. •• 0 ....., ..•••••••••, .,. .,, •• 2 0466 0468 0469 046A 0460 046F' 0470 0100 00 00 00 00 00 011'"F' II 00 0471 0473 0474 0476 0476 0479 047A 0470 047F 0480 0200 05 0000 F'FFF 00 00 00 00 00 0200 II 00 0461 0483 0464 0466 0466 0489 048A 0480 048F 0490 0364 OF 0000 F'FF'F' 00 08 00 00 00 0385 II 00 OW DB DB DB OW DB DB ;----- •• 8 .14 "5 .., "2 •• 3 •• 4 "5 ••• '" •• 8 4 •• 500 501 502 503 504 505 50. 501 508 50. 510 511 512 513 514 515 51. SIT 518 51. 520 521 522 523 52. 525 52. 521 528 52' 530 531 532 533 53. 535 53. 531 538 53' 5'0 5" 5.2 5.3 5 •• ; CONTROL BYTE LAND I NG ZONE SECTORS / TRACK ITO 0 07330 CYLINDERS HEADS 050 0 OFFFFH NO WRITE PRE-COMPENSATION 0 0 I 0,0,0 07330 CONTROL BYTE ; LAND I NG ZONE ; SECTORS / TRACK ITO 0 09000 CYLINDERS HEADS 150 0 OFFFFH ; NO WRITE PRE-COMPENSATION 0 008H 0,0,0 09010 CONTROL BYTE LAND I NG ZONE SECTORS / TRACK ITO 0 DRIVE TYPE 10 0491 0493 0494 0496 0498 0499 049A 049D 049F 04AO 0334 03 0000 FFFF 00 00 00 00 00 0334 II 00 04Al 04A3 04A4 04A6 04A8 04A9 04AA 04AO 04AF 04BO 0357 05 0000 FFFF 00 00 00 00 00 0357 II 00 0481 04B3 04B4 0486 04B8 04B9 04BA 04BO 04BF 04CO 0357 07 0000 FFFF 00 00 00 00 00 0357 II 00 04Cl 04C3 04C4 04C6 04C8 04C9 04CA 04CO 04CF 0400 0132 08 0000 0080 00 00 00 00 00 013F II 00 0401 0403 0404 0406 0408 0409 04DA 0400 0401'" 04EO 0200 07 0000 F'FFF 00 00 00 00 00 0200 II 00 04El 04E3 04E4 04E6 04E8 04E9 04EA 04EO 04EF 04FO 0000 00 0000 0000 00 00 00 00 00 0000 00 00 • 11 .,8 .80 .81 .82 .83 .8. .85 .8. .81 '88 '8' •• 0 ; WRITE PRE-COMPENSATION CYLINDER 0 0 DRIVE TYPE 09 OW DB OW OW DB DB DB OW DB DB '.5 .,0 .11 .,2 '13 02560 0,0,0 05110 DRIVE TYPE 08 OW DB OW OW DB DB DB OW DB ;----- 06-10-85 OW DB OW OW DB DB DB OW DB DB ;----- 5-186 ORGS , CONTROL BYTE LAND I NG ZONE SECTORS / TRACK ITO 0 08550 CYLINDERS HEADS 050 0 OFFFFH NO WRITE PRE-COMPENSATION 0 0 CONTROL BYTE 0,0,0 08550 LAND I NG ZONE SECTORS / TRACK ITO 0 08550 CYLINDERS HEADS 010 0 OFFFFH NO WRITE PRE-COMPENSATION 0 0 CONTROL BYTE 0,0,0 08550 LANDING ZONE SECTORS/TRACK ITO 0 03060 CYLINDERS HEADS 080 0 WRITE PRE-COMPENSATION CYLINDER 01280 0 0 I CONTROL BYTE 0,0,0 03190 LAND I NG ZONE SECTORS / TRACK ITO 0 07330 CYLINDERS HEADS 010 0 OF'F'F'FH NO WRITE PRE-COMPENSATION 0 0 ; CONTROL BYTE 0,0,0 07330 LAND I NG ZONE SECTORS/TRACK ITO 0 DRIVE TYPE 15 OW DB OW OW DB DB DB OW DB DB ;----- 0 0 0,0,0 08200 DR I VE TYPE 14 OW DB OW OW DB DB DB OW DB DB ;----- ; NO WRITE PRE-COMPENSATION DRIVE TYPE 13 OW DB OW OW DB DB DB OW DB DB ;----- OFFFFH DRIVE TYPE 12 OW DB OW OW DB DB DB OW DB DB ;----- CYLINDERS HEADS 030 0 DRIVE TYPE II OW DB OW OW DB DB DB OW DB DB ;----- 08200 00000 000 0 00000 0 0 0,0,0 00000 000 0 DR IVE TYPE I. RESERVED .... DO NOT USE···· CYLINDERS HEADS WRITE PRE-COMPENSATION CYLINDER ; CONTROL BYTE LAND I NG ZONE SECTORS / TRACK Vers i on 2.00 IB" Persona I Computer MACRO Assemb I er 06/10/85 COMPATIBILITY MODULE ORGS 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 65. 655 656 657 658 1-6 06-[ 0-85 -~--- 04Fl 0264 D. DB D. D. DB DB DB D. DB DB 04F3 04 04F4 0000 04F6 0000 04F8 00 04F9 00 04FA 00 00 00 04FD 0297 04FF II 0500 00 06120 040 0 00000 0 0 0,0. D. DB D. D. DB DB DB D. DB DB 0504 DODO 0506 o 12C 0508 00 0509 00 050A 00 00 00 0500 0301 050F II 0510 00 03D I 0513 0514 0516 0518 07 0000 D. DB D. D. DB DB DB D. DB DB FFFF 00 00 051A 00 00 00 05\9 0510 0301 051F II 0520 00 0400 07 0531 0533 0534 0536 0538 0539 053A 0530 053F 0540 0200 D. DB D. D. DB DB DB D. DB DB 0000 0200 00 00 00 00 00 03FF II 00 SECTOR 5 I TR ACK 17 CYL [NDERS 09710 050 HEADS a 03000 0 0 0,0.0 WRITE PRE-COMPENSATION CYL CONTROL BYTE 09770 LAND 1 NG ZONE 170 0 SECTORS/TRACK 18 09710 070 0 CYL I NDERS HEADS OFFFFH NO WRITE PRE-COMPENSA T [ON 0 a CONTROL BYTE 0.0,0 09770 170 LAND 1 NG ZONE SECTORS I TRACK a DR I VE TYPE 0521 0523 0524 0526 0528 0529 052A 0520 052F 0530 LAND ING ZONE a DR I VE TYPE 0511 WR I TE PRE-COMPENSATION ALL CYL [NDER CONTROL BYTE a 06630 170 DR I VE TYPE 0501 030 I 0503 05 CYLINDERS HEADS 19 10240 CYLI NOERS HEADS 070 a 05120 WRITE PRE-COMPENSATION CYL I NDER a a CONTROL BYTE 0,0,0 10230 LAND I NG ZONE SECTORS / TRACK 170 0 DR I VE TYPE 20 D. DB D. D. DB DB DB D. DB DB 05 0000 o 12C 00 00 00 00 00 020C II 00 07330 CYLI NOERS HEADS 050 a 03000 WRITE PRE-COMPENSATION CYL 0 0 CONTROL BYTE 0,0,0 0132D LAND I NG ZONE SECTORSITRACK 110 a DR I VE TYPE 21 0541 0543 0544 0546 0548 0549 054A 0540 054F 0550 02DO 0551 0553 0554 0556 0558 0559 055A 0550 055F 0560 0200 0561 0563 0564 0566 0568 0569 056A 0560 056F 0510 0132 D. DB D. D. DB DB DB D. DB DB 07 0000 o 12C 00 00 00 00 00 020C II 00 01330 CYLI NDERS HEADS 070 a 03000 WRITE PRE-COMPENSATION CYL a a CONTROL BYTE 0,0,0 01320 LAND I NG ZONE SECTORS/TRACK 170 a DRIVE TYPE 22 D. DB D. D. DB DB DB D. DB DB 05 0000 o 12C 00 00 00 00 00 0200 II 00 ; ----- A. 0000 0000 00 00 00 00 00 0150 II 00 01330 03000 0000 00 0000 0000 00 00 00 00 00 0000 00 00 WR ITE PRE-COMPENSAT I ON CYL a a CONTROL BYTE 0,0,0 07330 LAND I NG ZONE SECTORS / TRACK 170 a DR I VE TYPE 23 D. DB D. D. DB DB DB OW DB DB 03060 D. DB D. D. DB DB DB D. DB DB CYLINDERS HEADS 040 a 00000 a a WRITE PRE-COMPENSA T I ON ALL CYL CONTROL BYTE 0, 0,0 03360 LANDING ZONE SECTORS / TRACK 170 a DR I VE TYPE 24 0511 0513 0514 0516 0578 0579 051A 0570 051F 0580 CYLI NDERS HEADS 050 a 00000 000 0 00000 a a 0,0,0 00000 000 a ... RESERVED··· CYLINDERS HEADS WRITE PRE-COMPENSAT [ON eYL CONTROL BYTE LANDING ZONE SECTORS/TRACK ORGS 5-187 1-7 IBM Persqnal Computer MACRO Assemble,. Version 2.00 ORGS ----- ObI 1 0165 COMPATIBILITY MODULE 650 6.0 661 662 •• 3 .6. 6.5 6&6 667 6.8 •• 0 .70 671 672 673 67. 675 .7. .77 .7. 670 680 681 682 .83 68. 685 686 687 688 680 .00 .01 602 .03 60. 605 60. .07 608 600 700 701 702 703 70. 705 70. 707 708 700 710 711 712 713 71. 715 716 717 718 710 720 721 722 723 72. 725 726 727 728 720 730 731 732 733 73' 735 736 737 738 730 740 741 7'2 743 74. 7'5 746 7.7 7'8 740 750 751 752 753 754 755 756 757 758 750 760 7., 762 763 764 765 766 767 7.8 760 770 771 772 ; ----0561 0563 0564 0566 0588 0589 058A 0580 058F 0590 0000 00 0000 0000 00 00 00 00 00 0000 00 00 0591 0593 0594 0596 0598 0599 OS9A 0590 059F 05AO 0000 00 0000 0000 00 00 00 00 00 0000 00 00 05Al OSA3 05A4 05A6 05A8 05A9 05AA 05AD 05AF 05BO 0000 00 0000 0000 00 00 00 00 00 0000 00 00 0581 0583 0584 0586 05B8 0589 058A 0580 05BF 05CO 0000 00 0000 0000 00 00 00 00 00 0000 00 00 aSCI OSC3 05C4 05C6 05C6 05C9 05CA 05CD 05CF 0500 0000 00 0000 0000 00 00 00 00 00 0000 00 00 0501 0503 0504 0506 0508 0509 050A 0500 05DF 05EO 0000 00 0000 0000 00 00 00 00 00 0000 00 00 05El 05E3 OSE4 05E6 05E8 05E9 05EA 05EO 05EF 05FO 0000 00 0000 0000 00 00 00 00 00 0000 00 00 05Fl 05F3 05F4 05F6 OSF'6 OSF9 05FA 05FD 05FF 0600 0000 00 0000 0000 00 00 00 00 00 0000 00 00 0601 0603 0604 0606 Ob06 0609 060A 0000 00 0000 0000 00 00 00 00 00 OW 08 g: 08 08 08 ;----- OR I VE TYPE 27 00000 DB DOD 0 ----- OR I VE TYPE 28 OW 00000 08 ODD 0 ODD 0 DR I VE TYPE 29 ow 00000 08 DOD 0 ; ----- WRITE PRE-COMPENSATION CYL CONTROL 8YTE LANDING ZONE SECTORS ITRACK ••• RESERVED-" CYL INOERS HEADS 00000 WRITE PRE-COMPENSATION CYL 0 CONTROL BYTE a Ow 0, 0,0 00000 08 08 ODD 0 OR I VE TYPE 30 LAND I NG ZONE SECTORS/TRACK . . , RESERVED'" 00000 CYL I NoERS HEADS ODD 0 00000 WRITE PRE-COMPENSATION CYL 0 0 Ow 0, a ,a 00000 08 08 ODD 0 DRIVE TYPE 31 OW 00000 08 ODD 0 CONTROL BYTE LAND I NG ZONE SECTORS/TRACK •• , RESERVED'" CYLINDERS HEADS 00000 WRITE PRE-COMPENSATION CYL 0 0 Ow a ,a ,a 00000 08 DB 0 ; OW 00000 08 ODD 0 ••• RESERVED'·' CYI.... INOERS HEADS 00000 WR I TE PRE-COMPENSAT I ON CYL 0 0 OW 0, a ,a 00000 08 08 ODD 0 DR I VE TYPE 33 OW 00000 08 ODD 0 CONTROL BYTE LAND I NG ZONE SECTORS/TRACK ODD DRIVE TYPE 32 08 08 08 CYL INDERS HEADS 0 0, 0,0 00000 Ow OW ••• RESERVED"· a OW 08 08 08 LANDING ZONE SECTORS/TRACK 00000 08 08 OW ow ; ----- WR I TE PRE-COMPENSAT I ON CYL 000 0 DB 08 08 CYL I NoERS HEADS CONTROL BYTE OW 08 ••• RESERVEO'" 0 0 08 08 ow ow LAND I NG ZONE SECTORS /TRACK 00000 0,0,0 00000 OW ; CONTROL BYTE OW 08 08 08 ----- WR ITE PRE-COMPENSATiON CYL 0 0 ODD 0 ow ow CYLINDERS HEADS ODD 0 08 08 08 08 08 ••• RESERVED'" 00000 OW OW OW LANDING ZONE SECTORS / TRACK 00000 0,0,0 00000 08 08 DB ; ORGS DR I VE TYPE 26 Ow Ow ; ----- CONTROL BYTE ODD 0 08 08 08 ; ----- WRITE PRE-COMPENSATiON CYL 0 0 OW ow OW CYLINDERS HEADS ODD 0 00000 08 08 08 ••• RESERVEO'" 00000 0,0,0 00000 ow ;----- 5-188 DRIVE TYPE 25 06-10-65 1 CONTROL BYTE LANDING ZONE SECTORS ITRACK . , ' RESERVED'" CYLINDERS HEADS OW OW 00000 WRITE PRE-COMPENSATION CYL 08 08 08 0 0 CONTROL BYTE 0, 0,0 IBM Persona I Computer MACRO Assembler Vers ORGS 06/10/85 COMPATIBILITY MODULE ----- 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 OW DB DB 0600 0000 060F 00 06 \ 0 00 I 00 06-10-85 00000 DOD 0 DR I VE TYPE 34 0611 06 t 3 06 \ 4 0616 0618 0619 06\A 061 D 061 F 0620 OW DB OW OW DB DB DB OW DB DB 0000 00 0000 0000 00 00 00 00 00 0000 00 00 OW DB OW OW DB DB DB OW DB DB 0000 00 0000 0000 00 00 00 00 00 0000 00 00 ; -0631 0633 0634 0636 0638 0639 063A 0630 063F 0640 0000 00 000 0 00000 0 0 0,0,0 00000 DOD 0 0000 0000 00 00 00 00 00 0000 00 00 OW OW DB DB DB OW DB DB 0000 00 0000 0000 00 00 00 00 00 0000 00 00 OW DB OW OW DB DB DB OW DB DB 0000 00 0000 0000 00 00 00 00 00 0000 00 00 OW DB OW OW DB DB DB OW DB DB 0000 00 0000 0000 00 00 00 00 00 0000 00 00 OW DB OW OW DB DB DB OW DB DB 0673 0674 0676 0678 0679 067A 0670 067F 0680 00 0000 0000 00 00 00 00 00 0000 00 00 OW DB OW OW DB DB DB OW DB DB CYLI NOERS HEADS WR I TE PRE-COMPENSAT I ON CYL CONTROL BYTE ODD 0 ... 0000 0691 0693 0694 0696 0000 00 0000 0000 00 00 00 00 00 0000 00 00 OW DB OW OW DB DB DB OW DB DB 0000 0000 OW DB OW OW RESERVEO-· • CYLINDERS HEADS ODD 0 WR I TE PRE-COMPENSAT I ON CYL 00000 0 0 CONTROL BYTE 0,0,0 00000 ODD 0 ... LAND I NG ZONE SECTORS / TRACK RESERVED·· - 00000 CYL I NDERS HEADS ODD 0 00000 WR I TE PRE-COMPENSATI ON CYL 0 0 CONTROL BYTE 0,0,0 00000 000 0 ... LANDI NG ZONE SECTORS/TRACK RESERVEO-- CYL INOERS HEADS 00000 000 0 00000 WRITE PRE-COMPENSATION CYL 0 0 CONTROL BYTE 0,0,0 00000 000 0 ... LAND ING ZONE SECTORS/TRACK RESERVEo-· - 00000 CYLINDERS HEADS 000 0 WRITE PRE-COMPENSATION CYL 00000 0 0 CONTROL BYTE 0,0,0 00000 000 0 ... LAND ING ZONE SECTORS/TRACK RESERVEO--- 00000 CYLI NOERS HEADS 000 0 00000 WRITE PRE-COMPENSATION CYL 0 0 CONTROL BYTE 0,0,0 00000 LAND I NG ZONE SECTORS/TRACK 000 0 RESERVEO-·- 00000 CYL INOERS HEADS DOD 0 00000 WR I TE PRE-COMPENSAT I ON CYL 0 0 CONTROL BYTE 0,0, a 00000 000 0 DR IVE TYPE 42 00 LAND I NG ZONE SECTORS/TRACK 00000 DRIVE TYPE 41 0681 0683 0684 0686 0688 0689 068A 0680 068F 0690 RESERVEO--- 0 0 DR I VE TYPE 40 0000 ... LAND I NG ZONE SECTORS / TRACK 0,0,0 00000 DR I VE TYPE 39 0661 0663 0664 0666 0668 0669 066A 0660 066F 0670 WR I TE PRE-COMPENSATI ON CYL CONTROL BYTE 00000 DR I VE TYPE 38 0651 0653 0654 0656 0658 0659 065A 0650 065F 0660 CYLINDERS HEADS ODD 0 DR [VE TYPE 37 0641 0643 0644 0646 0648 0649 064A 0640 064F 0650 RESERVEO--- 00000 DR I VE TYPE 36 OW DB ... LAND ING ZONE SECTORS / TRACK 00000 DR I VE TYPE 35 062 \ 0623 0624 0626 0628 0629 062A 0620 062F 0630 1-8 2.00 00000 ODD 0 00000 ... LANDING ZONE SECTORS I TRACK RESERVED·· • CYLI NDERS HEADS WR ITE PRE-COMPENSATI ON CYL ORGS 5-189 1-9 IBM Peraonal Computer MACRO Assembler Veraion 2.00 ORGS ----- 06/10/85 COMPATIBILITY MODULE •• 7 888 889 890 .91 892 89' 89. 895 .9. 897 898 899 900 901 902 903 90. 905 90. 907 908 909 910 911 912 913 91. 915 91. 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 9.2 933 934 935 935 937 938 939 940 941 942 943 944 945 9.5 947 948 949 950 951 952 953 95. 955 955 957 958 959 950 961 962 953 954 965 955 957 958 969 970 971 972 973 974 975 975 0698 0699 069A 0690 069F 061.0 00 00 00 00 00 0000 00 00 DB DB ;----06A I 06A3 06A4 061.6 06A8 06A9 061.1. 06AO 06AF 06BO 0000 00 0000 0000 00 00 00 00 00 0000 00 00 06BI 06B3 0684 0686 0688 0689 06BA 068D 068F 06CO 0000 00 0000 0000 00 00 00 00 00 0000 00 00 06CI 06C3 06C4 06C6 06C8 06C9 06CA 06CD 06CF 0600 0000 00 0000 0000 00 00 00 00 00 0000 00 00 0601 0603 06D4 0606 0608 06D9 06DA 0600 06DF 06EO 0000 00 0000 0000 00 00 00 00 00 0000 00 00 06EI 06E3 06E4 06E6 0&E8 06E9 06EA 06ED 06EF 06FO 0000 00 0000 0000 00 00 00 00 00 0000 00 00 CONTROL BYTE 08 OW DB 0,0,0 00000 000 DB 0 DRIVE TYPE 43 OW DB OW OW CONTROL BYTE DB LAND I NG ZONE SECTORS /TRACK DB 0 ow D8 DB DB OW ow LAND I NG ZONE SECTORS /TRACK ••• RESERVED··· 00000 000 CYL INDERS HEADS 0 00000 WR I TE PRE-COMPENSATI ON CYL 0 0 CONTROL BYTE 08 LAND I NG ZONE SECTORS/TRACK DB 0 DRIVE TYPE 46 ow ow ••• RESERVEO··· OOOOD OOD CYL INDERS HEADS 0 00000 WR I TE PRE-COMPENSATI ON CYL DB DB 0 0 CONTROL BYTE DB DB 0,0,0 00000 OOD LAND I NG ZONE SECTORS/TRACK DB 0 ow DRIVE TYPE 47 DW 08 OW 00000 OOD DW DB DB 00000 DB ow DB DB RESERVED· •• 0 0,0,0 00000 000 0 ORG 06F5 06F5 06F7 06FS 06F9 06FA CONF TBL: OW DB DB DB DB 989 990 991 992 993 994 995 995 997 998 999 1000 = CONF _E = 06FF IF CONF E-CONF TBL-2 MODEL BYTE SUB MODEL BYTE BIOS LEVEL OIIIOOOOB 5-190 ORGS VECTOR ON TO MOVED BOOT CODE AH= OCOH USE INT 15 H CONFIGURATION TABLE FOR THIS SYSTEM LENGTH OF FOLLOW I NG TABLE SYSTEM MODEL BYTE SYSTEM SUB MODEL TYPE BYTE BIOS REVISION LEVEL 10000000 " OMA CHANNEL 3 USE BY BIOS 01000000 = CASCADED INTERRUPT LEVEL 2 00100000 REAL TIME CLOCK AVAILABLE 00010000 KEYBOARD SCAN CODE HOOK 1AH RESERVED RESERVED RESERVED RESERVED RESERVED FOR EX PANS I ON = = DB DB DB DB 0417 0300 0180 OOCO 0060 0030 0018 OOOC LANDING ZONE SECTORS/TRACK INTERRUPT OE6F2H 006F2H EQU • BOOT_STRAP _, EQU BAUD RATE 0729 0729 0128 0720 072F 0731 0733 0735 0737 CONTROL BYTE S DRG 06F8 00 06FC 00 06FD 00 06FE 00 06FF WR I TE PRE-COMPENSAT I ON CYL 0 977 978 979 980 981 982 983 98. 985 985 987 988 CYL INDERS HEADS 0 BOOT LOADER BOOT STRAP ,JMP a CONTROL BYTE 0,0,0 00000 OOD = 0008 FC 00 I 70 WR I TE PRE-CONPENSATI ON CYL I DB DB OW 1106F2 06F2 06F2 E9 0000 E CYLINDERS HEADS 0 OOOOD 0 0 0,0,0 00000 000 0 DB DB ow 'F • •• RESERVEO··· 00000 000 DRIVE TYPE 45 ow ;----- WR I TE PRE-COMPENSATI ON CYL 0 0 0,0,0 00000 000 08 ;----- CYLINDERS HEADS 08 OW DB DB ;----- • •• RESERVED··· DB DB DW 08 OW DW j----- LANDING ZONE SECTORS/TRACK 00000 000 0 00000 OR I VE TYPE 44 = O&FI Ob-10-85 INITIALIZATION TABLE S ; 1- DRG DRG AI OW OW OW OW OW OW OW OW j----- RS232 ; ;- DRG OE729H 00729H 1047 .., 758 192 95 4. 2' 12 OE739H 110 BAUD 150 300 600 1200 2400 4800 9600 TABLE OF VALUES FOR INITIALIZATION IBM Personal Cornputer MACRO Assernbler Version 2.00 ORGS ----- 06110/B5 COMPATI81L1TY MODULE 1001 0739 1002 = 0739 1003 0739 E9 0000 E 1004 1005 1006 1007 1008 082E 1009 = 082E 1010 082E E9 0000 E 1011 1012 1013 1014 1015087E 1016 087E 52 1017 087F 3A 45 46 38 10 10 \ 8 0884 2A 36 1019 = 0008 1020 1021 1022 1023 0886 80 102408874020 100804 1025 088C 02 0 I 1026 1027 1028 1029 088E 18 FF 00 FF FF FF 1030 IE FF FF FF FF IF 1031 089A FF 7F FF I 1 17 05 1032 12 14 I'll 1509 OF 1033 08A6 10 I BID OA FF 0 I 1034 13 04 06 07 08 OA 1035 0882 OB OC F'F FF FF FF 1036 lC IA 1803 1602 1037 088E OE 00 FF FF FF 1"1" 1038 FF FF 20 FF 1039 1040 1041 08Ce 5E SF 60 6 I 62 63 1042 64 65 66 67 FF F'F 1043 0804 77 FF 84 FF 73 FF 1044 74 FF 75 FF 761"1" 1 045 08EO 1"1" 1046 1047 1048 1049 06E 1 18 31 32 33 34 35 1050 3637 38 39 30 20 1051 3D 08 09 1052061"0 71 77 65 72 74 79 1053 75 69 61" 70 58 50 1054 00 FF 61 736466 1055 67 68 6A 68 6C 38 1056 27 1057 0909 60 1"1" 5C 7A 78 63 1058 7662 6E 60 2C 2E 1059 2F FF 2A FF 20 1060 091A FF 1061 1062 1063 t 064 09, 8 18 21 40 23 24 25 1065 SE 26 2A 28 29 SF 1066 280800 1067 092A 51 57 45 52 54 59 1068 55 49 41" 50 78 7D 1069 00 FF 41 534446 1070 47 48 4A 48 4C 3A 1071 22 1072 0943 7E 1"1" 1C SA 58 43 1073 56 42 4E 40 3C 3E 1074 31" 1"1" 00 FF 20 1"1" 1075 1076 1077 0955 54 55 56 57 58 59 1076 0958 5A 58 5C 50 1079 lOBO 1081 095F 68 69 6A 68 6C 1082 0964 60 6E 61" 70 7 I 1083 1084 1085 1086 0969 37 38 39 20 34 35 1067 362831 323330 1088 2E 1089 1090 1091 0976474849 FF 4B 1"1" 1092 097C 40 1"1" 4F 50 51 52 1093 53 1094 1095 1096 1091 10980987 1099 = 0987 1100 0987 E9 0000 E ORO RS232 10 - JMP ; ----- KEY80ARO ;;- ORG ORO 10 'JMP KEYBOARD 1-10 06-10-85 00739H EQU • RS232_10_' VECTOR ON TO MOVED RS232 CODE OE82EH 0082EH EQU • KEYBOARD_I 0_' ; VECTOR ON TO MOVED KEY80ARD CODE TA8LE OF SHIFT KEYS AND MASK VALUES (EARLY PCI ;;- ORO ORO K6 DB DB DB EOU OE87EH 0087EH INS KEY ; I NSERT KEY CAPS KEY,NUM KEY,SCROLL KEY,ALT KEY,CTL KEY LEFT-KEY, RIGHT KEY '-K6- DB DB DB INS SHIFT ; INSERT MODE SHIFT CAPS SH I FT ,NUM SH I FT , SCROLL SH I FT ,AL T SH I FT , CTL SH I FT LEFT:::SHIFT.RIGHT_SHIFT - K6L K7 ;----- SCAN CODE TABLES K8 DB 27,-1.0,-1.-1,-1.30,-1,-1.-1,-1,31 DB -1,127.-1,17.23.5.18.20.25.21.9.15 DB 16,27,29.10.-1,1,19,4,6,7,8,10 DB 11.12,-1.-1.-1,-1,28.26,24.3.22.2 DB 14,13.-1.-1,-1.-1,-1,-1,' ;----- CTL TABLE SCAN K9 DB ',-I 94.95.96,97,98,99.100.101.102.103.-1.-1 08 1 19, -1 , 132, -1 , I 15, - I • I 16, - 1 , I 11. - I • I 18.-1 DB -I ;----- LC TA8LE K 10 DB o18H •• 1234567890-=' • 08H. 09H DB • qwertyu i QP[]' ,DOH. -I,' a$dfgh j k 1;'. 027H 08 60H,-1,5CH, 'zKovbnm, . " . - 1 , ···.-1.· 08 -I ; ----- UC TABLE Kl1 DB 21.' ! .#",37 .05EH.' , . () _ +'. 08H. 0 08 'QWERTYU I OP t 08 07EH,-I. 'lZXCVBNM<>?' ,-1,0,-1,' t •• OOH, -1 ;----- UC TABLE SCAN KI2 08 84,85.66.87.88,69 DB 90,91,92.93 AL T T ABLE SCAN K13 DB DB ;----- NUM STATE TABLE K 14 DB , • ASOFGHJKL: ~ , '.-1 104.105,106,107,108 109. 1 10. 1 1 I • 1 12. 1 13 • 789-456+ 1230.' BASE CASE TABLE K15 DB DB ; ----- KEY80ARO ;;- ORG ORG EQU S "MP KB_INT_l KB_INT 71,72.73,-1.75,-1 77,-1,79,80,81.82,83 INTERRUPT OE987H 00987H VECTOR ON TO MOVED KEYBOARD HANDLER ORGS 5-191 IBM Personal Computer MACRO Assembler Version 2.00 ORGS ----- 06/[0/85 COMPATIBILITY MODULE 101 102 103 10. [05 OC59 [06 = OC59 [01 OC59 E9 0000 E 108 10' 110 III 1120F51 [ [3 = OF51 [[4 OF51 E9 0000 E 115 116 117 118 PAGE ;----- DISKETTE ;;- ORG D]SKETTE [0 JMP ;----- DISKETTE ; 1- ORG JMP 1----- DISKETTE PARAMETERS ; j- ORG ORG 119 OFC1 120 121 122 123 12. 125 126 127 128 .- ------- --; 01 SK BASE ; - OEFC7H OOFC7H -- - ---- - - ----------- ---- -- -- -------- - ----------- - -- DISK_BASE D8 08 D8 D8 D8 08 D8 D8 D8 D8 D8 LABEL 15 OTL GAP LENGTH FOR FORMAT FILL BYTE FOR FORMAT HEAD SETTLE T I ME (M I LL I SECONDS I MOTOR START TIME (1/8 SECONDS I 15 8 [/0 ;;- ORG OEFD2H 00FD2H EQU I PRINTER_IO_I 10 - JMP SRT=D, HD UNLOAD=OF - 1ST SPECIFY BYTE HD LOAD= I, MODE=DMA - 2ND SPEC] FY BYTE WA[T TIME AFTER OPERAT]ON TILL MOTOR OFF 512 BYTES / SECTOR EOT ( LAST SECTOR ON TRACK I GAP LENGTH OIBH OFFH 054H OF6H PRINTER DRG REQUIRED FOR PO I NTED AT BY THE TO MOD[FY THE PARAMETERS, AND POINT AT ]T BYTE 11 O[ 111 18 2 MOTOR WA I T 2 - ;----- PRINTER VECTOR ON TO MOVED D [SKETTE HANDLER THIS IS THE SET OF PARAMETERS 0] SKETTE OPERAT I ON. THEY ARE DATA VARIABLE @DISK POINTER. BUILD ANOTHER PARAMETER BLOCK ; ; ; 1 [29 OFC1 I 130 1131 OFC1 OF [132 OFC8 02 1133 OFC9 25 1134 OFCA 02 1135 OFCB OF 1[360FCe [B I 131 OFCD FF 1138 OFCE 54 1139 OFCF F6 1140 OFDO OF 1141 OFDI 08 1142 [ [43 1144 1[45 1[46 OFD2 1141 = OFD2 1148 OFD2 E9 0000 E [ [49 [ [50 I IS [ [ [52 [1531045 1154 1[55 [ 156 1151 1[58 [ [59 1160 1[61 1162 1163 1164 1165 1 [66 1161 1168 1169 1110 1111 1172 1173 1045 0000 E 1174 1047 0000 E 1175 1049 0000 E 1116 [048 0000 E 1177 1040 0000 E 1178 104F 0000 E 1119 1051 0000 E 1180 1053 0000 E 118[ 1055 0000 E 1182 1051 0000 E 1183 [059 0000 E 1184 105B 0000 £ 1185 1050 0000 E 1186 105F 0000 E 1187 1061 0000 E 1188 1063 0000 E 1189 ::: 0020 1190 1191 1192 1065 1193 = lObS 1194 1065 £9 0000 E 1195 1 196 VECTOR ON TO MOVED 0 I SKETTE CODE INTERRUPT OEF57H 00F51H EQU S DISK_I NT_I ORG INT - I/O OEC59H OOC59H EQU S DISKETTE_la_I ORG 01 SK 1-11 06-10-85 ; VECTOR ON TO MOVED PR [NTER CODE ;----- FOR POSSIBLE COMPATIBILITY ENTRY POINTS ;;- ORG ORG ASSUME OF045H 01045H CS:CODE,OS:DATA EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN SET MODE: NEAR SET-CTYPE: NEAR SET-CPOS: NEAR REAO CURSOR:NEAR REAO-LPEN: NEAR ACT OISP PAGE:NEAR SCROLL UP: NEAR SCROLL-DOWN: NEAR READ AC CURRENT: NEAR WR I TE AC CURRENT: NEAR WR I TE-C CURRENT: NEAR SET COLOR: NEAR WRITE DOT:NEAR READ DOT: NEAR WR I TE TTY: NEAR VIDEO::::STATE:NEAR ow ow ow ow ow ow ow ow ow ow ow ow ow ow ow ow OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET S-MI "'L EQU 11- ORG ORG VIDEO_IO JMF SET MODE SET~CTYPE SET-CPOS READ CURSOR REAO-LPEN ACT OISP PAGE SCROLL UP SCROLL-DOWN READ AC CURRENT WR I TE AC CURRENT WR I TE-C CURRENT SET COLOR WR I TE DOT READ OOT WR I TE TTY VIDEO::)TATE OF065H 01065H EQU S VIOEO_IO_1 VIDEO PARAMETERS --- TABLE OF ROUTINES W[TH[N VIDEO [/0 EXIT STACK VALUES MAY 8E DIFFERENT DEPEND I NG ON THE SYSTEM AND MODEL VECTOR ON TO MOVED V IDEO CODE [NIT_TABLE 1197 1198 1199 1200 120 I 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 12 [3 1214 I; [OA4 10A4 10A4 38 28 20 OA IF 06 19 10AB lC 02 07 06 07 lOBO 00 00 00 00 = 0010 ORG ORG V IDEO PARMS D8 M. DB DB EQU OFOA4H 010A4H LABEL BYTE 38H,28H,2DH,OAH,IFH,6,19H IOB4 7 I 50 SA OA IF 06 19 10BB lC 02 07 06 01 lOCO 00 00 00 00 DB 7 [H, SOH, 5AH. OAH, 1FH, 6, 19H DB DB tCH,2,7,6,7 0,0,0,0 IOC4 38 28 20 OA 7F 06 64 DB 38H, 28H ,2DH, OAH, 7FH, 6, 64H 5-192 ORGS SET UP FOR 40X25 lCH,2,7.6.7 0,0,0.0 I-VIDEO_PARMS SiT UP FOR BOX25 SET UP FOR GRAPH I CS 1-12 06-10-85 IBM Personal Computer MACRO Assembler Vers ion 2.00 ORGS ----- 06/10/85 COMPATIBILITY MODULE 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1221 1228 1229 1230 1231 1232 1233 1234 1235 123& 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1266 1269 1270 1271 1272 1273 1274 1275 1276 1277 1218 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1306 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 10CB 70 02 01 0607 1000 00 00 00 00 DB DB 70H,2,l,6,7 0,0,0,0 10P4 61 DB 61H,50H,52H,OFH,I9H,6,I9H DB 08 19H,2,OOH,OBH,OCH 0,0,0,0 OW OW OW OW 2048 4096 16384 16384 I. 50 52 OF 19 06 1008 19 02 00 08 OC 10EO 00 00 00 00 10E4 0800 10E6 1000 IOE8 4000 10EA 4000 M5 ; SET UP FOR 80X2S B&W CARD TABLE OF REGEN LENGTHS 40X25 80X25 GRAPHI CS COLUMNS 10EC 28 28 50 50 28 28 50 50 IOF4 2C 28 20 29 2A 2E IE 29 ." ., ; ----- 1840 1840 1840 E9 0000 E 2CH,28H,2DH,29H,2AH,2EH,1EH,29H ;;- ORG EQUIPMENT JMP CASSETTE ORG DRG oaoo CASSETTE 10 :iMP E OF541 H 01541H EQU S MEMORY_SIZE_DET_l EQU I PMENT DETERM [NE ;;- ;;- TABLE OF MODE SETS MEMORY S [ZE ; ----- :----- lA6E lA6E 1 A6E 00 00 lA76 7E 81 1 A 7E 7E FF 1 A86 6C 10 1 A8E 10 10 1 A96 38 38 1 A9E 10 38 1 AA6 00 00 lAAE FF FF IAS6 00 3C 1 ABE FF C3 lAC6 OF CC 1 ACE 3C 7E lAD6 3F FO 1 ADE 7F E6 IAE6 99 SA DB ORG = 1859 1859 1859 E9 40,40,80,80,40,40,50,80 ; ;ORG ORG MEMORY S] ZE DET .JMP- 1841 1841 1841 E9 0000 E = = DB ORG VECTOR ON TO MOVED 8 I OS CODE OF84DH o I 840H EQU • EQU I PMENT _I VECTOR ON TO MOVED 8 I as CODE (NO 810S SUPPORT) OF859H o 1859H EQU S CASSETTE_IO_I ; VECTOR ON TO MOVED 810S CODE OFA6EH 01 A6EH LABEL BYTE OOOH. OOOH. OOOH, OOOH. OOOH, OOOH. OOOH, OOOH 0_00 BLANK DB 07EI:i, 081 H, OA5H, 081 H. OBDH, 099H, 081 H, 07EH 0_01 SMILING FACE 08 FF C3 E7 DB 07EH, OFFH, 008H, OFFH, OC3H, OE7H, OFFH, 07EH o_02 SMILING FACE N FE FE 7C 38 DB 06CH, OFEH, OFEH, OFEH, 07CH, 038H, 0 1 OH, OOOH 0_03 HEART DRG 00 00 00 00 00 00 81 AS 81 80 99 CRT CHAR GEN OB 7.E FF 7E FE 00 38 00 7C 1C 10 7C 00 00 FF FF 3C 00 C3 FF 07 78 66 18 33 EO 63 CO SA 99 IAEE 80 EO 80 00 1 AF6 02 DE 02 00 IAFE 18 3C 3C 18 180& 66 b6 66 00 ! 80E 7F DB IB 00 lB16 3E 63 CC 78 IB1E 00 00 7E OQ IB26 18 ac 18 FF 182E 18 3C 18 00 1836 18 18 18 00 lB3E 00 18 00 00 1846 00 30 00 00 lB4E 00 00 0000 185& 00 24 00 00 185E 00 18 00 00 lB66 00 FF 00 00 7C FE 7C 38 DB 01 OH, 038H, 07CH, OFEH, 07CHo 038H, 0 1 OH, OOOH 0_04 DIAMOND 38 FE FE 7C DB 038H, 07CH, 038H. OFEH, OFEH, 07CH, 038H, 07CH 0_05 CLUB 38 1C FE 7C DB 01 OH, 0 I OH, 038H, 07CH, OFEH, 07CH 0 038H, 07CH 0_06 SPADE 18 3C 3C 18 DB OOOH, OOOH, 0 18H, 03CH, 03CH, 0 1 8H, OOOH, OOOH 0_o7 BULLET E7 C3 C3 E7 DB OFFH. OFFH, OE7H, OC3H, OC3H 0 OE7H, OFFH, OFFH 0_08 BULLET NEG 66 42 42 66 DB OOOH, 03CH, 066H, 042H, 042H, 066H. 03CH, OOOH 0_09 CIRCLE 99 80 BD 99 DB OFF!"!, OC3H, 099H, 080H, OBCH, 099H, OC3H, OFFH C_OA CIRCLE NEG OF 70 CC CC DB OOFH, 007H, OOFH, 07DH, OCCH, OCCH 0 OCCH, 01 8H 0_08 MALE 66 66 3C 18 DB 03CH, 066H, 066H, 066H, 03CH, 0 1 8H. 07EH. 0 18H O_OC FEMALE 3F 30 30 70 DB 03FH, 033H, 03FH, 030H, 030H, 07QH, OFOH, OEOH 0_00 EIGHTH NOTE 7F 63 63 61 DB 07FH, 063H, 07FH, 063H, 063H, 06 7H, OE6H, OCOH O_OE TWO 1/16 NOTE 3C E7 E7 3C DB 099H, 05AH, 03CH, OE7H. OE1H, 93CH, 05AH, 099H 0_ OF SUN F8 FE F8 EO DB 080H, OEOH, OF8H. OFEH. OF8H, OEOH, 080H. OOOH 0_' 0 R ARROWHEAD 3E FE 3E OE DB 002H,OOEH,03EH,OFEH,03EH,OOEH,002H,OOOH o_11 L ARROWHEAD 7E 18 18 7E DB o 18H, 03CH, 07EH, 0 18H,O 18H, 07EH,03CH, 0 18H 0_12 ARROW 2 VERT 66 66 66 00 DB 066H, 066H, 066H, 066H, 066H, OOOH, 066H, OOOH o_13 2 EXCLAMATIONS 08 78 pARAGRAPH 1BIB DB 07FH, OOBH, OOBH, 07BH. 0 I BH, 0 I BH, 0 1BH, OOOH 0_14 38 6C 6C 38 DB 03EH, 063H, 038H, 06CH, 06CH, 038H, OCCH 0 078H 0_15 SECTION 00 00 7E 1E DB OOOH, OOOH, OOOH, OOOH, O('EH, 07EH, 07EH, OOOH 0_16 RECTANGLE 7E 0_17 ARROW 2 VRT UP 0_18 ARROW VRT UP ARROW '(R7 DOWN 18 7E 3C DB 7E 18 18 18 DB o 18H, 03CH, 07EH, 0 18H,07EH,03CH,O 18H, OFFH o 18H, 03CH, 07EH, 0 18H, 0 18H, 0 18H oO 18H, OOOH 18 DB o 18H, 0 18H,O 18H, 18H, 07EH, 03CH,O 18H,OOOH o_19 18 DB OOOH, 0 18H, OOCH, OFEH, OOCH, 0 1'8H. OOOH 0 OOOH 0_1 A ARROW RIGHT 60 FE 60 30 DB OOOH, 030H, 060H, OFEH, 060H, 030H, OOOH, OOOH 0_' B ARROW LEFT CO CO CO FE DB OOOH, OOOH, OCOH, OCOH, OCOH, OFEH, OOOH, OOOH 0_1 C NOT INVERTED 6b FF 6& 24 DB OOOH, 024H. 066H, OFFH, 066H, 024H, OOOH, OOOH 0_10 ARROW 2 HQRZ 3C 7E FF FF DB OOOH, 0 \ 8H. 03CH, 07EH, OFFH, OFFH. OOOH. OOOH 0_1 E ARROWHEAD UP FF 7E 3C 18 DB OOOH, OFFHo OFFH o07EH, 03CH, 0 18H, OOOH, OOOH O_'F ARROWHEAD DOWN 18 7E 3C OC FE OC ° ORGS 5-193 IBM Personal Computer MACRO Assembler Version 2.00 oRGS 06/10/85 COMPATIBILITY MODULE ----- 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1371 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 141 I 1412 1413 1414 1415 1416 1417 141 e 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 t 430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 lB6E 00 00 1816 30 30 1B1E 6C 00 lB86 6e 6e lS8E 30 30 1896 00 e6 IB9E 38 76 IBA6 60 00 IBAE 18 18 IBB6 60 60 IB8E 00 00 lBC6 00 00 IBCE 00 30 lBD6 00 00 lBDE 00 30 lBE6 06 80 IBEE 7e 7e 18F6 30 Fe tBFE 78 Fe tC06 78 78 ICOE Ie IE lC16 FC 00 00 00 00 00 78 78 30 30 00 6e 6e 00 00 00 6C FE 6C FE 1 -13 06-10-85 00 DB OOOH. OOOH I OOOH. OOOH. OOOH. OOOH. OOOH, OOOH ; 0 - 20 00 DB 030H. 018H. 018H, 030H, 030H. OOOH, 030H. OOOH 0_21 00 DB 6e 06CH. 06CH, 06CH, OOOH, OOOH. eOOH. OOOH, OOOH 0 - 22 D6CH I 06CH. OFEH, 06CH. OFEH. OoCH. 06CH, OOOH 0_23 00 7C CO 78 DC F8 DB 030H, 0 7CH, OCOH, 078H. OOCH I OF8H, 030H, OOOH 0 OOOH, OC6H, OCCH, 0 18H. 030H I 066H. OC6H, OOOH 0 - 25 X PERCENT DB 038H, 06CH, 038H, 076H, OOCH. OCCH. 0 76H. OOOH 0 - 26 AMPERSAND DB 060H, 060H, OCOH, OOOH. OOOH I OOOH I OOOH, OOOH 0 60 60 60 30 DB o 18H I 03DH I 060H, 060H. 060H. 030H. 0 I 8H, OOOH 18 DB 060H, 030H, 0 18H. 0 18H. 0 18H, 030H, 060H, OOOH 18 30 00 " 6e 38 76 DC ee 00 60 CO 00 00 00 00 18 18 30 3C FF 3C " - 24 - 27 D 28 - PARENTHES [S R. PARENTHES J S OOOH, 066H, 03CH. OFFH. 03CH I 066H, OOOH, OOOH 0 OOOH. 030H. 030H. OFCH. 030H, 030H, OOOH. OOOH 0_2B 00 00 00 30 DB OOOH, OOOH, OOOH. OOOH. OOOH, 030H, 030H. 060H 0 00 Fe 00 00 DB OOOH. OOOH. OOOH. OFCH. OOOH, OOOH. OOOH. OOOH 0_20 00 00 00 30 DB OOOH. OOOH. OOOH. OOOH I OOOH, 030H, 030H. OOOH 0 - 2E 18 30 60 co DB 006H, OOCH, 0 I 8H, 030H. 060H, OCOH, 080H. OOOH 0 2F e6 eE DE F6 E6 DB 07CH. OC6H. OCEH, ODEH. OF6H. OE6H I 0 7CH. a OOH 0 30 DB 030H. 070H. 030H I 030H I 030H, 030H, OFCH. OOOH 00 00 ASTER [SK - 2A PLUS - 2e COMMA - 078H. OCCH, OOCH. 038H, 060H. OCCH, OFCH. OOOH 07 8H. OCCH. OOCH, 038H I OOCH. OCCH, 0 7 8H, OOOH 0_33 3 DB 01 CH. 03CH. 06CH, OCCH, OFEH. OOCH, 0 1EH. OOOH 0 CO F8 oe oe ee DB OFCH, OCOH I OF8H, OOCH, OOCH. OCCH. 07 8H, OOOH o_35 5 78 00 ICIE 38 60 co F8 CC ee 78 00 IC26 FC 30 IC2E 78 78 lC36 78 70 lC3E 00 30 IC46 00 30 IC4E 18 18 1C56 00 00 IC5E 60 SLASH a 0 31 I 0 32 2 - DB ee oe 38 oe ee DASH PER (00 I DB 00 APOSTROPHE 0 - 29 I DB 70 30 30 30 30 00 CC oe 38 60 ee DOLLAR SIGN L. DB 00 $ I 30 FC 30 30 oe · · QUOTATION LB. DB 00 Co CC 30 00 30 00 66 00 30 00 00 60 00 00 00 SPACE EXCLAMA T I ON 00 3e 6e CC FE oe 00 CC oe - ~4 4 DB 038H, 060H. OCOH I OF8H I OCCH, OCCH, 0 7 8H, OOOH 18 30 30 DB OFCH, OCCH, OOCH, 0 18H, 030H, 030H, 030H, OOOH o_37 7 78 ee ee DB 07 8H, OCCH I OCCH, 0 78H, OCCH, OCCH, 078H, OOOH 0_38 8 00 CC CC 00 CC CC 7e oe 18 DB 078H, OCCH, OCCH I 07CH I OOCH, 0 18H, 070H I OOOH 0 39 9 30 00 00 30 DB OOOH, 030H, 030H, OOOH, OOOH. 030H. 03QH, QOOH 0_3A 30 00 00 30 DB OOOH I 030H I 030H, OOOH, OOOH. 030H, 030H, 060H 0 3B ; 60 co 60 30 DB o 18H, 030H, 060H, OCOH, 060H, 030H, 0 18H, OOOH 0_3C < Fe 00 00 Fe DB OOOH, OOOH, OFCH, OOOH, OOOH, OFCH, OOOH, OOOH 0_30 18 oe 18 30 DB 060H. 030H. 0 18H, OOCH, 0 18H, 030H, 060H, OOOH D 3E > GREATER THAN 18 30 00 DB o 78H, OCCH, OOCH, 0 18H. 030H. OOOH, 030H, OOOH 0_3F QUESTION MARK C6 DE DE DE CO 00 78 CC CC FC CC 00 66 7e 66 DB o 7CH, OC6H, OOEH, ODEH, OOEH, OCOH, 078H, OOOH 0_40 DB 030H, 0 7 8H. OCCH. OCCH. OFCH I OCCH, OCCH, 00 OH D 41 DB OFCH, 066H. 066H, 07CH, 066H. 066H. OFCH, OOOH 0_42 B DB 03CH, 066H I OCOH, OCOH, OCOH. 066H. 03CH, OOOH 0_43 e 6e DB OF8H. 06CH. 066H, 066H, 066H I 06CH. OF8H, OOOH Fa 00 lC96 FE 62 68 78 68 62 0_44 0 DB OFEH, 062H, 068H, 0 78H. 068H. 062H. OFEH, OOOH 0_45 E DB OFEH, 062H. 068H. 078H. 068H. 060H. OFOH, 00 OH D 46 F lC6E 7C 78 IC76 30 ee I C7E FC Fe IC86 3e 3e IC8E F8 oe " 00 66 CO CO co 00 6e " " " FE 00 I C9E FE 62 68 Fa 00 ICA6 3e 66 CO 3E 00 lCAE CC CC CC ee 00 ICB6 78 30 30 78 00 lCBE IE oe oe 78 00 1 CC6 E6 66 6e E6 00 I CCE FO 60 60 FE 00 1 CD6 C6 EE FE e6 00 I COE C6 E6 F6 e6 00 lCE6 38 6C C6 38 00 1 CEE FC " " 78 68 60 CO CE " 5-194 - , ~ , · A - DB 03CH, 066H, OCOH, OCOH, OCEH. 066H. 03EH, 00 OH 0_47 G FC CC CC DB OCCH. OCCH. OCCH. OFCH. OCCH, OCCH. OCCH, OOOH D 48 H 30 30 30 08 078H, 030H. 030H. 030H, 030H. 030H. 078H, 00 OH 0_49 OC CC ee DB 01 EH, OOCH. OOCH. OOCH, OCCH, OCCH. 078H, OOOH 0_ 4A J 78 6e 66 DB OE6H, 066H. 06CH. 078H, 06CH. 066H. OE6H, 00 OH D_ 48 K 60 62 DB OFOH, 060H, 060H, 060H, 062H. 066H. OFEH. OOOH 0_ 4C L FE 06 e6 DB OC6H, OEEH, OFEH, OFEH, OD6H. OC6H. OC6H. 00 OH 0_40 M DE CE C6 DB OC6H, OE6H, OF6H, OOEH, OCEH. OC6H, OC6H. OOOH 0_ 4E N 038H, 06CH. OC6H. OC6H. OC6H. 06CH. 038H, OOOH 0_ 4F 0 " C6 C6 6e - I " " 7e 60 60 DB OFCH, 066H, 066H, 0 7CH, 060H. 060H. OFOH. OOOH 0 50 P CC CC CC DC 78 00 7e 6e 00 CC EO 70 tc CC DB o 78H. OCCH. OCCH. OCCH I OOCH, 0 78H, 0 1CH. OOOH 0 " " " DB OFCH. 066H, 066H, 0 7CH, 06CH. 066H, OE6H. OOOH 0 52 R DB 07 8H. OCCH. OEOH. 070H. 0 1CH, OCCH, 0 7 8H. OOOH 30 30 30 30 DB OFCH. OB4H. 030H. 030H. 030H. 030H. 07 8H, OOOH CC CC CC CC DB OCCH. OCCH. OCCH. OCCH. OCCH, OCCH, OFCH, OOOH CC CC CC 78 DB OCCH, OCCH, OCCH, OCCH, OCCH. 078H. 030H. OOOH e6 06 FE EE DB OC6H. OC6H. OC6H. 006H, OFEH, OEEH. OC6H. OOOH Fa 00 tCF6 78 Ie I CFE FC E6 1006 78 78 I DOE FC 78 1016 CC Fe IDlE CC 3D 1026 C6 - 00 30 00 30 60 30 00 00 00 30 60 00 IC66 78 ee 30 00 00 84 00 CC 00 CC 00 e6 ORGS - 51 0 - 53 0 54 D 55 0 56 0_57 Q 5 T U V • COLON SEMICOLON EQUAL AT 1-14 06-10-85 IBM Personal Computer MACRO Assemb I er VersIon 2.00 ORGS 06/10/85 COMPATIBILITY MODULE ----- 1443 1444 1445 1446 1441 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 \ 462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 t 492 1493 1494 1495 1496 1497 1498 1499 1500 150 1 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 ISIS 1516 1511 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 e6 102E C6 e6 1036 ee 78 103E FE FE 1046 78 78 104E CO 02 1056 78 78 lOSE 10 00 1066 00 00 00 e6 6e 38 38 00 ee ee 78 30 00 e6 8e 18 32 00 60 60 60 60 00 60 30 18 oe 00 18 18 18 18 00 38 6e e6 00 00 00 00 00 00 FF I06E 30 00 ID76 00 76 107E EO DC 1086 00 78 108E Ie 30 76 1096 00 78 109E 38 FO IOA6 00 oe I DAE EO E6 1086 30 78 lOBE oe ee 10C6 EO E6 IOCE 70 78 1006 00 C6 lODE 00 CC IOE6 00 78 IDEE 00 60 IOF6 00 DC IOFE 00 FO lE06 00 F8 IEOE 10 18 IEI6 00 76 IEIE 00 30 IE26 00 6C IE2E 00 C6 IE36 00 DC IE3E 00 FC IE46 IC IC tE4E 18 18 I E56 EO EO lESE 76 00 lE66 00 FE 6e 08 OC6H, OC6H, 06CH, 038H, 038H, 06CH, OC6H, OOOH 0 58 X 30 08 OCCH, OCCH. OCCH, 0 18H, 030H, 030H, 0 18H, OOOH 0 Y 66 08 OFEH, OC6H. 08CH, 0 18H, 032H, 066H, OFEH, OOOH 60 08 078H, 060H, 060H, 060H, 060H, 060H, 0 18H, OOOH 06 DB OCOH, 060H, 030H, 0 18H, OOCH, 006H, 002H, OOOH 0 18 08 018H, 0 18H, 0 18H, 0 18H, 0 18H, 0 18H, 078H, OOOH 0_50 00 DB 01 OH, 038H, 06CH, OC6H, OOOH, OOOH, OOOH, OOOH 0 DB OOOH, OOOH, OOOH, OOOH, OOOH, OOOH, OOOH, OFFH D_5F - 59 0 5A 0 58 - Z LEFT BRACKET BACKSLASH 5e - 5E RIGHT BRACKET " . 00 00 00 08 030H, 030H, 0 I 8H, OOOH, OOOH. OOOH, OOOH, OOOH 0_60 78 oe 7e ee 08 OOOH, OOOH, 0 7 8H. OOCH, a 7CH. OCCH. 0 76H, OOOH 0 60 60 7e 66 66 0_62 b 00 00 00 00 00 00 oe 00 00 00 6e 00 00 F8 08 OEOH, 060H, 060H, 0 1CH, 066H, 066H. OOCH, OOOH 78 ee Co ee 08 OOOH, OOOH, 0 7 8H, OCCH, OCOH. OCCH. 0 7 8H, OOOH 0 oe 7e ee ee DB a I CH, OOCH, OOCH, 0 7CH, OCCH, OCCH. 0 76H, OOOH 0_64 d co 08 OOOH, OOOH, 0 78H, OCCH, OFCH, OCOH, 0 7 8H, OOOH 0_65 08 038H, 06CH, 060H, OFOH, 060H. 060H, OFOH, 00 OH 0 OOOH, OOOH, 0 76H, OCCH. OCCH, 07CH, a OCH, OF8H 0 78 ee FC 60 FO 60 76 ee ee 60 6e 76 66 66 00 00 70 00 00 oe 78 60 66 00 30 30 00 00 ec 00 00 F8 00 00 78 00 00 FO 00 IE 00 00 00 00 30 00 00 00 00 00 00 00 00 00 00 F8 00 00 30 00 18 00 30 00 DC 00 10 00 - 61 08 OEOH. 060H, 06CH. 076H. 066H, 066H, OE6H. OOOH 0 30 30 30 DB 030H, OOOH, 0 70H, 030H, 030H, 030H, a 7 8H, OOOH 0 oe OC CC 08 OOCH. OOOH, OOCH, OOCH, OOCH, OCCH, OCCH. 07 8H 6e 78 6e 08 OEOH, 060H, 066H, 06CH, 0 7 8H, 06CH, OE6H, OOOH - 63 - 66 - 67 f , 68 h - 69 0 6A 0 68 0 6e - J k 30 30 30 DB 070H, 030H, 030H, 030H. 030H, 030H, 078H, OOOH 08 OOOH, OOOH, OCCH, OFEH, OFEH, 006H. OC6H. OOOH 0_60 m CC CC CC 08 OOOH. OOOH, OF8H, OCCH. OCCH. OCCH, OCCH. OOOH D_6E " CC CC CC 08 OOOH, OOOH, 078H, OCCH. OCCH. OCCH, 078H. OOOH 0_6F 0 7e 08 OOOH, OOOH. OOCH, 066H. 066H, 0 7CH. 060H. OFOH 0 76 CC CC 7C 08 OOOH. OOOH. 016H, OCCH. OCCH. 0 7CH. OOCH. 0 1EH 0 DC 76 66 60 08 OOOH, OOOH. OOCH, 076H, 066H, 060H. OFOH, OOOH 0 - 71 - 72 7C CO 78 DC 08 OOOH. OOOH, 07CH. OCOH. 0 7 8H. OOCH, OF8H. OOOH 0 - 73 08 01 OH. 030H, 07CH, 030H, 030H, 034H. 0 1 8H, OOOH 0 ee CC CC CC 08 OOOH, OOOH, OCCH. OCCH, OCCH, OCCH, 0 76H, OOOH 0 ce cc CC 78 08 OOOH. OOOH. OCCH, OCCH. OCCH, 078H. 030H, OOOH 08 OOOH. OOOH, OC6H, 006H, OFEH. OFEH. 06CH, OOOH C6 6C 38 6e 08 OOOH, OOOH, OC6H, 06CH, 038H. 06CH, OC6H, OOOH ec CC CC 7C 08 OOOH. OOOH. OCCH, OCCH, OCCH, 0 7CH. OOCH. OF8H Fe 98 30 08 OOOH. OOOH, OFCH, 098H, 030H, 064H, OFCH, OOOH 30 EO 30 30 08 01 CH. 030H. 030H, OEOH, 030H, 030H, 0 I CH, OOOH 18 00 18 08 o 18H, 0 18H, 0 18H, OOOH, 0 18H,O 18H, a 18H, OOOH 30 IC 30 30 08 OEOH. 030H, 030H, 0 I CH, 030H, 030H, OEOH, OOOH 00 00 00 00 08 076H, OOCH, OOOH, OOOH, OOOH, OOOH, OOOH, OOOH 38 6C G6 C6 08 OOOH,O I OH, 038H, 06GH, OC6H, OG6H. OFEH, OOOH I 70 P 7e 30 30 34 C6 06 FE FE APOSTROPHE REV 0 FE FE 06 DC 66 66 CIRCUMFLEX UNDERSCORE q , - 74 - 75 c 0 76 0 77 w 0 78 0 79 Y 0 7A 0 78 0 7C 0 70 0 7E , 0 7F - • LEFT BRACE BROKEN STROKE RIGHT BRACE TILDE OEL TA TIME OF DAY IE6E lE6E I E6E E9 0000 E ORG ORG TIME_OF _DAY JMP : ----lEAS lEAS 1EA5 E9 TIMER ORG DRG TIMER - IN7oMP OFE6EH 01 E6EH EQU TIME_OF _DAY • YECTOR ON TO MOYEO BIOS CODE I INTERRUPT OFEA5H 01 EA5H EQU TIMER INT - •- , , VECTOR ON TO MOYED 810S CODE ORGS 5-195 1-15 06-1 0~85 IBM Personal Computer MACRO Assembler Version 2.00 ORGS ----- 06/10/85 COMPATIBILITY MODULE 1540 1541 1542 1543 1544 1545 1546 1547 1548 ! 549 1550 1551 1552 1553 1554 1555 15?6 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 16 1 1 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 IEF3 IEF3 IEF3 IEF5 1EF7 1EF9 IEFB IEFO IEFF IFO'I PAGE ; ----- VECTOR TABLE ;;- ORG IEA5 0987 0000 0000 0000 0000 OF57 0000 VECTOR TABLE - OW OW OW OW OW OW OW OW R R E E E E R E ;----IF03 I F05 IF07 I F09 IFOB I FOO I FOF lFll IFI3 IFI5 IFI7 IFI9 IFIB IFIO IF1F lF21 1065 1840 1841 OC69 R R R R 073~ R 1859 R 082E R OF02 R 0000 06F2 R lE6E R lF63 R IF53 R 10A4 R OFC7 R SOFTWARE OW OW OW OW OW OW OW OW OW OW Ow OW OW OW OW OW 0000 IF23 IF23 IF25 I F27 lF29 I F2B IF2D I F2F lF31 INTERRUPTS OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OOOOOH OFFSET OFFSET OFFSET OFFSET OFFSET OFFSET OOOOOH E OW OW OW OW OW OW OW OW E E E E E E E DUMMY ;; - ORO ORO IF53 DUMMY_RETURN lF53 CF AT LOCATION OFEF3H VECTOR TABLE VALUES FOR POST TESTS [NT 08H - HARDWARE TI MER 0 IRQ I NT 09H - KEYBOARD IRQ JNT OAH - SLAVE INTERRUPT INPUT tNT OBH IRQ INT OCH IRQ INT ODH IRQ INT OEH - OISKETTE IRQ INT OFH IRQ (BIOS CALLS AND POINTERS) VIDEO 10 EQU I PMENT MEMORY SIZE DET 0 I SKETTE 10RS232 10CASSETTE 10 KEYBOARD-IO PR J NTER To BOOT STRAP TIME-OF DAY DUMMY RETURN DUMMY-RETURN V I DEO-PARMS 0 J SK BASE - SLAVE_VECTOR_ TABLE 0000 0000 0000 0000 0000 0000 0000 0000 IF53 = OFEF3H 01 EF3H LABEL WORD OFFSET T I MER I NT OFFSET KB I NT OFFSET 011 OFFSET 011 OFFSET 011 OFFSET 01 I OFFSET DISK tNT OFFSET 01'- ORO LABEL WORO OFFSET RTC INT OFFSET RE DIRECT OFFSET oTI OFFSET 01 I OFFSET 01 I OFFSET I NT 287 OFFSET olT OFFSET Oil INT IOH -- VIDEO DISPLAY I NT I I H -- GET EQU I PMENT FLAG WORD INT 12H -- GET REAL MODE MEMORY SIZE INT 13H -- DISKETTE INT 14H -- COMMUNICATION ADAPTER INT ISH -- EXPANDED BIOS FUNCTION CALL I NT 1 6H - - KEyeOARD INPUT I NT 17H -- PR I NTER OUTPUT [NT 18H -- OF600H INSERTED FOR BASIC INT 19H -- BOOT FROM SYSTEM MEDIA INT IAH -- nME OF DAY [NT IBH -- KEYBOARD BREAK ADDRESS [NT I CH -- T I MER BREAK ADDRES5 [NT IDH -- V I OED PARAMETERS INT lEH -- DISKETTE PARAMETERS INT IFH -- POINTER TO VIDEO EXTENSION ( ! INTERRUPT 10H THRU 7FH INT [NT INT INT INT INT INT INT 70H 11H 72H 13H 74H 75H 76H 77H - REAL TIME CLOCK REDIRECT TO INT OAH -MATH COPROCESSOR -FIXED DISK IRQ IRQ IRQ IRQ IRQ IRQ IRQ IRQ I NTERRUPT HANDLER OFF53H o IF53H BI EQU as DUMMY (NULL) I NTERRUPT RETURN IRET ;----- PRINT SCREEN ;;- ORG OFF54H ORO o IF54H PR I NT SCREEN EQU S .JMP PRINT_SCREEN_l .LIST ; -- - - - -- -- - IF54 '" I F54 1F54 E9 0000 E -------- ; ; ; ; ----- - ----- - - - - - - - -- VECTOR ON TO MOVED B I TUTOR as CODE POWER ON RESET VECTOR - --- ----- -- ----- - -- -- - -- ---- --- - - - - - - - -- ;;IFFO ORO ORO OFFFOH o IFFOH POWER ON RESET P_O_R IFFO EA IFFI 005B R IFF3 FOOO IFF5 30 36 2F 31 38 35 30 2F IFFE IFFE FC 5-196 DB OW OW OEAH OFFSET OFDOOH DB '06/10/85' ORO o IFFEH MODEL_BYTE DB I FFF' CODE ORGS POWER ON RESTART EXECUTION LOCATION LABEL ENDS END RESET HARD CODE FAR .JUMP TO SET OFFSET SEGMENT RELEASE MARKER THIS PC'S 10 ( MODEL BYTE) CHECKSUM AT LAST LOCATION 8 9 10 11 12 13 14 15 SECTION 6. INSTRUCTION SET Contents 80286 Instruction Set .............................. 6-3 Data Transfer ................................. 6-3 Arithmetic .................................... 6-6 Logic ........................................ 6-9 String Manipulation ............................ 6-11 Control Transfer .............................. 6-13 Processor Control ............................. 6-17 Protection Control ............................ 6-18 80287 Coprocessor Instruction Set ................... Data Transfer ................................ Comparison .................................. Constants ................................... Arithmetic ................................... Transcendental ............................... 6-22 6-22 6-23 6-24 6-25 6-26 Instruction Set 6-1 Notes: 6-2 Instruction Set 80286 Instruction Set Data Transfer MOV = move Register to Register/Memory 1000100w mod reg r/w Register/Memory to Register 1000101w mod reg r/w Immediate to Register/Memory 1100011w mod 000 r/w data data if w Immediate to Register 1011wreg data data if w = 1 Memory to Accumulator 1010000w addr-low addr-high Accumulator to Memory 1010001w addr-low addr-high Register/Memory to Segment Register 10001110 modOreg r/w reg ¢ 01 Segment Register to Register/Memory 10001100 modOreg r/w PUSH = Push Memory 11111111 modll0 r/w Instruction Set 6-3 Register 01010reg Segment Register 000regll0 Immediate 011010s0 PUSHA data data if s = Push All 01100000 POP = POp Memory 10001111 modOOO rim Register 01011reg Segment Register OOOreg 111 reg 'I- 01 POPA = POp All I 01100001 XCHG = Exchange Register/Memory with Register 1000011w mod reg rim Register with Accumulator 10010reg 6-4 Instruction Set o IN = Input From Fixed Port 1110010w port Variable Port 1110110w OUT = Output To Fixed Port 1110011w port Variable Port 1110111w XLAT = Translate Byte to AL 11010111 LEA = Load EA to Register 10001101 I mod reg rim LDS = Load Pointer to DS 11000101 I mod reg rim mod ~ 11 mod ~ 11 LES = Load Pointer to ES 11000100 I mod reg rim LAUF = Load AU with Flags I 10011111 SAHF = Store AU with Flags 10011110 Instruction Set 6-5 PUSHF = Push FIags I 10011100 POPF = POp Flags I 10011101 Arithmetic ADD = Add Register/Memory with Register to Either OOOOOOOw mod reg rim Immediate to Register Memory 100000sw modDOD rim data if sw = 01 data Immediate to Accumulator 0000010w data data if w = 1 ADC = Add with Carry Register/Memory with Register to Either 000100dw mod reg rim Immediate to Register/Memory 100000sw modOOO rim data data if sw = 01 Immediate to Accumulator 0001010w INC = data Increment Register/Memory 1111111w 6-6 modOOO rim Instruction Set data if w =1 Register 01000reg SUB = Subtract Register/Memory with Register to Either 001010dw mod reg rim Immediate from Register/Memory 100000sw mod101 rim data data if sw 01 data if sw 01 Immediate from Accumulator 00101 lOw data data if w SBB = Subtract with Borrow Register/Memory with Register to Either 000110dw mod reg rim Immediate to Register/Memory 100000sw mod011 rim data Immediate to Accumulator 0001110w DEC = data data if w Decrement Register/Memory 1111111w mod001 rim Register 01001 reg CMP = Compare Register/Memory with Register 0011101w mod reg rim Instruction Set 6-7 Register with RegisterlMemory . 00ll100w 1 mod reg rim Immediate with RegisterlMemory 100000sw 1 modll1 rim 1 data data if sw Immediate with Accumulator 0001110w data if w = 1 data NEG = Change Sign 1 1111011w AAA 1 mod011 rim = ASCII Adjust for Add 1 00110111 DEC ::i:: Decimal Adjust for Add I. 00100111 AAS = ASCII Adjust for Subtract 00111111 DAS = Decimal Adjust for Subtract I 00110111 MUL = Multiply (Unsigned) 1 1111011w 1 modl00 rim IMUL = Integer Multiply (Signed) 1 1111011w 6-'8 1 modl0l Instruction Set rim = 01 IIMUL = Integer Immediate Multiply (Signed) 01101051 I mod reg rim Data I Data if 5 = 0 DIV = Divide (Unsigned) 1111011w I modll0 rim IDIV = Integer Divide (Signed) 1111011w I mod111 rim AAM = ASCII Adjust for Multiply 11010100 00001010 AAD = ASCII Adjust for Divide 11010101 00001010 CBW = Convert Byte to Word 10011000 CWD = Convert Word to Double Word 10011001 Logic Shift/Rotate Instructions Register/Memory by 1101000w I mod TTT rim Register/Memory by CL 1101001w mod TTT rim Instruction Set 6-9 Register/Memory by Count 1100000w mod TTT rim T T T Instruction 000 001 010 011 100 101 111 AND count ROL ROR RCL RCR SHL/SAL SHR SAR = And Register/Memory and Register to Either 001000dw mod reg rim Immmediate to Register/Memory 1000000w modOOO rim data data if w Immediate to Accumulator 0010010w data data if w TEST = AND Function to Flags; No Result Register/Memory and Register 1000010w mod reg rim Immediate Data and Register/Memory 1111011w modOOO rim data Immediate to Accumulator 0000110w data data if w Or= Or Register/Memory and Register to Either 0000 Odw 6-10 mod reg rim Instruction Set data if w Immediate to Register/Memory 1000000w modOOl rim data if w data = 1 = 1 Immediate to Accumulator 0000110w data data if w = 1 XOR = Exclusive OR Register/Memory and Register to Either 001100dw mod reg rim Immediate to Register/Memory 1000000w modll0r/m data if w data Immediate to Accumulator 0010010w data data if w = 1 NOT = Invert Register/Memory 1111011w modOlO rim String Manipulation MOVS = Move Byte Word 1010010w CMPS = Compare Byte Word 1010011w SCAS = Scan Byte Word I 1010111w LODS = Load Byte Word to AL/ AX I 1010110w Instruction Set 6-11 STOS = Store Byte Word from ALI AX 1010101w INS = Input Byte from DX Port 0110110w OUTS = Output Byte Word to DX Port 0110111w REPIREPNE, REPZ/REPNZ = Repeat String Repeat Move String 11110011 1010010w Repeat Compare String (z/Not z) 1111001z 1010011w Repeat Scan String (z/Not z) 1111001z 1010111w Repeat Load String 11110011 1010110w Repeat Store String 11110011 1010101w Repeat Input String 11110011 011011 Ow Repeat Output String 11110011 6-12 1010011w Instruction Set Control Transfer CALL = Call Direct Within Segment 11101000 disp-low disp-high Register/Memory Indirect Within Segment 11111111 mod010 rim Direct Intersegment 10011010 Segment Offset Segment Selector Indirect Intersegment 11111111 JMP mod011 rim (mod ~ 11) = Unconditional Jump Short/Long 11101011 disp-low Direct within Segment 11101001 disp-low disp-high Register/Memory Indirect Within Segment 11111111 mod100 rim Direct Intersegment 11101010 Segment Offset Segment Selector Indirect Intersegment 11111111 RET mod101 rim (mod ¢ 11) = Return from Call Within Segment 11000011 Instruction Set 6-13 Within Segment Adding Immediate to SP data-low 11000010 data-high Intersegment 11001011 Intersegment Adding Immediate to SP data-low 11001010 data-high JE/JZ = Jump on Equal/Zero I 01110100 disp JL/JNGE = Jump on Less/Not Greater, or Equal 01111100 JLE/JNG = 01111110 disp Jump on Less, or Equal/Not Greater I disp JB/JNAE = Jump on Below/Not Above, or Equal 01110010 disp JBE/JNA = Jump on Below, or Equal/Not Above 01110110 JP/ JPE I I disp = Jump on Parity/Parity Even 01111010 disp JO = Jump on Overflow 01110000 disp JS = Jump on Sign 01111000 6-14 disp Instruction Set JNE/ JNZ = Jump on Not Equal/Not Zero I 01110101 I disp JNL/JGE = Jump on Not Less/Greater, or Equal I 01111101 I disp JNLE/JG = Jump on Not Less, or Equal/Greater I 01111111 I d i sp JNB/JAE = Jump on Not Below/Above, or Equal I 01110011 I disp JNBE/ JA = Jump on Not Below, or Equal/Above I 01110111 I disp JNP/JPO = Jump on Not Parity/Parity Odd I 01111011 JNO I disp = Jump on Not Overflow 101110001 JNS I I disp = Jump on Not Sign 01111011 LOOP I disp = Loop ex Times 11100010 I disp LOOPZ/LOOPE = Loop while Zero/Equal 11100001 disp Instruction Set 6-15 LOOPNZ/LOOPNE = Loop while Not Zero/Not Equal 11100000 I disp JCXZ = Jump on CX Zero 11100011 I disp ENTER = Enter Procedure 11001000 I data-low data-high LEAVE = Leave Procedure 11001001 INT = Interrupt Type Specified 11001101 Type Type 3 11001100 INTO = Interrupt on Overflow 11001110 IRET = Interrupt Return 110011 i 1 BOUND = Detect Value Out of Range 01100010 6-16 mod reg rim Instruction Set Processor Control CLC = Clear Carry 11111000 CMC = Complement Carry 11110101 STC = Set Carry 11111001 CLD = Clear Direction 11111100 STD = Set Direction 11111101 CLI Clear Interrupt 11111010 STI = Set Interrupt 11111011 HLT = Halt 11110100 WAIT = Wait 10011011 LOCK = Bus Lock Prefix 11110000 Instruction Set 6-17 CTS = Clear Task Switched Flag I 00001111 I 00000110 ESC = Processor Extension Escape 11011TTT modLLL rim Protection Control LGDT = Load Global Descriptor Table Register I 00001111 I 00000001 I modOl0 rim SGDT = Store Global Descriptor Table Register I 00001111 I 00000001 I modOOO rim LIDT = Load Interrupt Descriptor Table Register I 00001111 I 00000001 I modOll rim SIDT = Store Interrupt Descriptor Table Register I 00001111 I 00000001 I modOOl rim LLDT = Load Local Descriptor Table Register from Register/Memory I 00001111 I 00000000 I modOlO rim SLDT = Store Local Descriptor Table Register from Register/Memory I 00001111 I 00000000 I modOOO rim LTR = Load Task Register from Register/Memory 00001111 6-18 00000000 Instruction Set modOll rim STR = Store Task Register to Register/Memory 00001111 LMSW 00000000 mod001 rim = Load Machine Status Word from Register/Memory 00001111 SMSW I 00000001 I mod110r/m = Store Machine Status Word 00001111 I 00000001 I mod100 rim LAR = Load Access Rights from Register/Memory 00001111 I 00000010 I mod reg rim LSL = Load Segment Limit from Register/Memory 00001111 00000011 I mod reg rim ARPL = Adjust Requested Privilege Level from Register/Memory I VERR I mod reg rim = Verify Read Access; Register/Memory 00001111 VERR 01100011 = 00000000 mod100 rim Verify Write Access 00001111 00000000 mod101 rim Instruction Set 6-19 The effective address (EA) of the memory operand is computed according to the mod and rim fields: If mod = 11, then rim is treated as a reg field. If mod = 00, then disp = 0, disp-Iow and disp-high are absent. If mod = 01, then disp = disp-Iow sign-extended to 16 bits, disp-high is absent. If mod = 10, then disp = disp-high:disp-Iow. If rim If rim If rim If rim If rim If rim If rim If rim = = = = = = = = 000, then EA 001, then EA 010, then EA 011, then EA 100, then EA 101, then EA 110, then EA 111, then EA = = = = = = = = (BX) + (SI) + DISP (BX) + (SI) + DISP (BP) + (SI) + DISP (BP) + (DI) + DISP (SI) + DISP (DI) + DISP (BP) + DISP (BX) + DISP DISP follows the second byte of the instruction (before data if required). Note: An exception to the above statements occurs when mod=OO and r/m= 110, in which case EA = disp-high; disp-Iow. Segment Override Prefix 00lregOOl 6-20 Instruction Set The 2-bit and 3-bit reg fields are defined as follows: 2-Bit reg Field reg Segment Register 00 01 ES CS Segment Register reg 10 11 SS OS 3-Bit reg Field 16-bit (w 000 001 010 011 100 101 110 111 = 1) AX CX OX BX SP BP SI 0I 8-bit (w 000 001 010 011 100 101 110 111 = 0) AL CL OL BL AH CH OH BH The physical addresses of all operands addressed by the BP register are computed using the SS segment register. The physical addresses 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. Instruction Set 6-21 80287 Coprocessor Instruction Set The following is an instruction set summary for the 80287 coprocessor. In the following, the bit pattern for escape is 11011. Data Transfer FLD = Load Integer/Real Memory to ST(O) escape MF 1 I mod 000 rim Long Integer Memory to ST(O) escape 111 I mod 101 rim Temporary Real Memory to ST(O) escape 011 I mod 101 rim BCD Memory to ST(O) escape 111 I mod 100 rim ST(i) to ST(O) escape 001 11000ST(i) FST = Store ST(O) to Integer/Real Memory escape MF 1 I mod 010 rim ST(O) to ST( i) escape 101 11010 ST(i) FSTP = Store and Pop ST(O) to Integer/Real Memory escape MF 1 6-22 mod 011 rim Instruction Set ST(O) to Long Integer Memory escape 111 mod 111 rim ST(O) to Temporary Real Memory escape 011 mod 111 rim ST(O) to BCD Memory escape 111 mod 110 rim ST(O) to ST( i ) 11011 ST( i ) escape 101 FXCH = Exchange ST(i) and ST(O) I escape 001 I 11001 STeil Comparison FCOM = Compare IntegerlReal Memory to ST(O) escape MF 0 mod 010 rim STeil to ST(O) escape 000 11010ST(i) FCOMP = Compare and Pop IntegerlReal Memory to ST(O) escape MF 0 mod 011 rim STeil to ST(O) escape 000 11010ST(i) Instruction Set 6-23 FCOMPP = Compare ST(i) to ST(O) and Pop Twice I escape 110 I 11011001 FTST = Test ST(O) I escape 001 FXAM = 11100100 Examine ST(O) escape 001 11100101 Constants FLDZ = Load + 0.0 into ST(O) I escape I 000 FLD1 = Load 11101110 + 1.0 into ST(O) I escape 001 11101000 FLDP1 = Load I escape 001 'TT into ST(O) 11101011 FLDL2T = Load logz 10 into ST(O) I escape 001 I 11101001 FLDLG2 = Load 10glO 2 into ST(O) I escape 001 I 11101100 FLDLN2 = Load loge 2 into ST(O) escape 001 6-24 11101101 Instruction Set Arithmetic FADD = Addition Integer/Real Memory with ST(O) escape MF 0 mod 000 rim ST(i) and ST(O) escape dPO 11000 ST(i) FSUB = Subtraction Integer/Real Memory with ST(O) escape MF 0 mod lOR rim ST(i) and ST(O) escape dPO 1110R rim FMUL = Multiplication Integer/Real Memory with ST(O) escape MF 0 mod 001 rim ST( i) and ST(O) escape dPO 11001 rim FDIV = Division Integer/Real Memory with ST(O) escape MF 0 mod llR rim ST(i) and ST(O) escape dPO FSQRT l111R rim = Square Root of ST(O) escape 001 11111010 Instruction Set 6-25 FSCALE = Scale ST(O) by ST(l) I escape 001 I FPREM = Partial Remainder of ST(O) + ST(1) I escape 001 11111101 11111000 FRNDINT = Round ST(O) to Integer I escape 11111100 001 FXTRACT = Extract Components of ST(O) I escape 11110100 001 FADS = Absolute Value of ST(O) I escape 11100001 001 FCHS = Change Sign of ST(O) I escape 001 I 11100000 Transcendental FPTAN I = Partial Tangent of ST(O) escape 001 I 11110010 FPATAN = Partial Arctangent of ST(O) +- ST(1) I escape 001 I 11110011 F2XM1 = 2 ST(O) -1 I escape 001 I 11110000 FYL2X = ST(1) x Log2 [ST(O)1 I escape 001 6-26 I 11110001 Instruction Set FYL2XP1 = ST(1) x Log 2 [ST(O) I escape 001 I + 1] 11111001 FINIT = Initialize NPX I escape 011 I 11100011 FSETPM = Enter Protected Mode I escape 011 I 11100100 FSTSWAX = Store Control Word escape 111 I 11100000 FLDCW = Load Control Word escape 001 FSTCW = I mod 101 rim Store Control Word escape 001 I mod 111 rim FSTSW = Store Status Word escape 101 I mod 101 rim FCLEX = Clear Exceptions escape 011 I 11100010 FSTENV = Store Environment escape 001 I mod 110 rim FLDENV = Load Environment escape 001 mod 100 rim Instruction Set 6-27 FSAVE = Save State I escape 101 I mod 110 rim FRSTOR = Restore State I escape 101 I mod 100 rim FINCSTP = Increment Stack Pointer escape 001 I 11110111 FDECSTP = Decrement Stack Pointer I escape 001 FFREE I I 111100110 = Free ST(i) escape 101 I 11000ST(i) FNOP = No Operation escape 101 6-28 11010000 Instruction Set MF is assigned as follows: MF Memory Format 00 01 10 11 32-bit Real 32-bit Integer 64-bit Real 16-bit Integer The other abbreviations are as follows: Term Definition Bit = 0 ST Stack top Stack top d P R Destination Pop Reverse* Dest. is ST(O) No pop Dest. (op) source Bit ¥- 0 ( i )= ith register from the top Dest. is ST( i ) Pop Source (op) dest. * When d= 1, reverse the sense of R. Instruction Set 6-29 Notes: 6-30 Instmction Set SECTION 7. CHARACTERS, KEYSTROKES, AND COLORS Contents Character Codes .................................. 7 -3 Quick Reference ................................. 7 -14 Characters, Keystrokes, and Colors 7-1 Notes: 7-2 Characters, Keystrokes, and Colors Character Codes As Text Attributes Value As Characters Color/Graphics Monitor Adapter IBM Monochrome Display Adapter Black Dark Grey Non-Display 09 Black Light Blue High Intensity Underline OA Black Light Green High Intensity Characters, Keystrokes, and Colors 7-3 As Text Attributes Color/Graphics Monitor Adapter As Characters Value Hex Dec Symbol 18 24 t Ctrl X Blue Dark Grey High Intensity 19 25 ! Ctrl Y Blue Light Blue High Intensity Underline 1A 26 -+ Ctrl Z Blue Light Green High Intensity 1B 27 Ctrl [, Esc, Shift Esc, Crtl Esc Blue Light Cyan High Intensity <- Ctrl \ L 1C 28 1D 29 1E 30 1F 31 T 20 32 --... Keystrokes Modes Background Foreground IBM Monochrome Display Adapter Blue Light Red High Intensity Ctrl] Blue Light Magenta High Intensity Ctrl6 Blue Yellow High Intensity Ctrl- Blue White High Intensity Blank Space Space Bar, Shift, Space, Ctrl Space, Alt Space Green Black Normal ! ! Shift Green Blue Underline Green Green Normal 21 33 22 34 " " Shift 23 35 # # Shift Green Cyan Normal 24 36 $ $ Shift Green Red Normal 25 37 % % Shift Green Magenta Normal 26 38 & & Shift Green Brown Normal 27 39 Green Light Grey Normal 28 40 ( ( Shift Green Dark Grey High Intensity 29 41 ) ) Shift Green Light Blue High Intensity Underline 2A 42 Light Green High Intensity 43 * + Note 1 Green 2B * + Shift Green Light Cyan High Intensity 2C 44 Light Red High Intensity 45 , - Green 2D , - Green Light Magenta High Intensity 2E 46 Yellow High Intensity 7 -4 , , Note 2 Green Characters, Keystrokes, and Colors As Text Attributes Value Hex Dec Color/Graphics Monitor Adapter As Characters Symbol Keystrokes o o Modes Background Foreground Green IBM Monochrome Display Adapter White High Intensity Note 3 Cyan Black Normal Note 3 Cyan Blue Underline 2 Note 3 Cyan Green Normal 3 3 Note 3 Cyan Cyan Normal 4 4 Note 3 Cyan Red Normal 5 5 Note 3 Cyan Magenta Normal 6 6 Note 3 Cyan Brown Normal 7 7 Note 3 Cyan Light Grey Normal 8 8 Note 3 Cyan Dark Grey High Intensity 9 9 Note 3 Cyan Light Blue High Intensity Underline Shift Cyan Light Green High Intensity Cyan Light Cyan High Intensity Cyan Light Red H ig h Intensity Cyan Light Magenta High Intensity 2F 47 30 48 31 49 32 50 2 33 51 34 52 35 53 36 54 37 55 38 56 39 57 3A 58 38 59 3C 60 3D 61 3E 62 > 3F 63 40 64 41 65 42 < < Shift > Shift Cyan Yellow High Intensity ? ? Shift Cyan White H ig h Intensity @ @ Shift Red Black Normal A A Note 4 Red Blue Underline 66 B B Note 4 Red Green Normal 43 67 C C Note 4 Red Cyan Normal 44 68 D D Note 4 Red Red Normal 45 69 E E Note 4 Red Magenta Normal 46 70 F F Note 4 Red Brown Normal 47 71 G G Note 4 Red Light Grey Normal 48 72 H H Note 4 Red Dark Grey High Intensity 49 73 Note 4 Red Light Blue High Intensity Underline 4A 74 Note 4 Red Light Green High Intensity J J Characters, Keystrokes, and Colors 7-5 As Text Attributes Value Color/Graphics Monitor Adapter As Characters Modes Background Foreground IBM Monochrome Display Adapter Hex Dec Symbol Keystrokes 4B 75 K K Note 4 Red Light Cyan High Intensity 4C 76 L L Note 4 Red Light Red High Intensity 4D 77 M M Note 4 Red Light Magenta High Intensity 4E 78 N N Note 4 Red Yellow High Intensity 4F 79 0 0 Note 4 Red White H ig h Intensity 50 80 P P Note 4 Magenta Black Normal 51 81 Q Q Note 4 Magenta Blue Underline 52 82 R R Note 4 Magenta Green Normal 53 83 S S Note 4 Magenta Cyan Normal 54 84 T T Note 4 Magenta Red Normal 55 85 U U Note 4 Magenta Magenta Normal 56 86 V V Note 4 Magenta Brown Normal 57 87 W W Note 4 Magenta Light Grey Normal 58 88 X X Note 4 Magenta Dark Grey High Intensity 59 89 Y Y Note 4 Magenta Light Blue High Intensity Underline 5A 90 Z Z Note 4 Magenta Light Green High Intensity 5B 91 [ [ Magenta Light Cyan High Intensity 5C 92 \ \ Magenta Light Red High Intensity Magenta Light Magenta High Intensity I 5D 93 I 5E 94 A A Shift Magenta Yellow High Intensity 5F 95 - - Shilt Magenta White High Intensity Black Normal 60 96 , 61 97 a , Brown a Note 5 Brown Blue Underline 62 98 b b Note 5 Brown Green Normal 63 99 c c Note 5 Brown Cyan Normal 64 100 d d Note 5 Brown Red Normal 65 101 e e Note 5 Brown Magenta Normal 66 102 I I Note 5 Brown Brown Normal 7 -6 Characters, Keystrokes, and Colors As Text Attributes Value Color/Graphics Monitor Adapter As Characters Modes Background Foreground IBM Monochrome Display Adapter Hex Dec Symbol Keystrokes 67 103 g g Note 5 Brown Light Grey Normal 68 104 h h Note 5 Brown Dark Grey High Intensity 69 105 i i Note 5 Brown Light Blue High Intensity Underline 6A 106 j j Note 5 Brown Light Green High Intensity 6B 107 k k Note 5 Brown Light Cyan High Intensity 6C 108 I I Note 5 Brown Light Red High Intensity 6D 109 m m Note 5 Brown Light Magenta High Intensity 6E 110 n n Note 5 Brown Yellow High Intensity 6F 111 0 0 Note 5 Brown White High Intensity 70 112 P P Note 5 Light Grey Black Reverse Video 71 113 q q Note 5 Light Grey Blue Underline 72 114 r r Note 5 Light Grey Green Normal 73 115 s s Note 5 Light Grey Cyan Normal 74 116 t t Note 5 Light Grey Red Normal 75 117 u u Note 5 Light Grey Magenta Normal 76 118 v v Note 5 Light Grey Brown Normal 77 119 w w Note 5 Light Grey Light Grey Normal 78 120 x x Note 5 Light Grey Dark Grey Reverse Video 79 121 Y Y Note 5 Light Grey Light Blue High Intensity Underline 7A 122 z z Note 5 Light Grey Light Green H ig h Intensity 7B 123 I I Shift Light Grey Light Cyan High Intensity 7C 124 I I I I Shift Light Grey Light Red High Intensity 7D 125 I I Shift Light Grey Light Magenta High Intensity 7E 126 - Shift Light Grey Yellow High Intensity 7F 127 /':, Light Grey White High Intensity Ctrl ~ Characters, Keystrokes, and Colors 7-7 As Text Attributes Hex * Dec 11 * Color/Graphics Monitor Adapter As Characters Value 11 Symbol Keystrokes Modes Background Foreground IBM Monochrome Display Adapter 80 to FF Hex are Flashing In both Color & IBM Monochrome '* 11 11 11 80 128 C Alt 128 Note 6 Black Black Non-Display 81 129 U Alt 129 Note 6 Black Blue Underline 82 130 Alt 130 Note 6 Black Green Normal 83 131 e a Alt 131 Note 6 Black Cyan Normal 84 132 ii Alt 132 Note 6 Black Red Normal 85 133 Alt 133 Note 6 Black Magenta Normal 86 134 a a Alt 134 Note 6 Black Brown Normal 87 135 I; Alt 135 Note 6 Black Light Grey Normal 88 136 e Alt 136 Note 6 Black Dark Grey Non-Display 89 137 e Alt 137 Note 6 Black Light Blue High Intensity Underline 8A 138 e Alt 138 Note 6 Black Light Green High Intensity ., 8B 139 Alt 139 Note 6 Black Light Cyan High Intensity 8C 140 I Alt 140 Note 6 Black Light Red High Intensity 80 141 ; Alt 141 Note 6 Black Light Magenta High Intensity 8E 142 A Alt 142 Note 6 Black Yellow High Intensity 8F 143 Note 6 Black White High Intensity 90 A E Alt 143 144 Alt 144 Note 6 Blue Black Normal 91 145 re Alt 145 Note 6 Blue Blue Underline 92 146 A: Alt 146 Note 6 Blue Green Normal 93 147 6 Alt 147 Note 6 Blue Cyan Normal 94 148 6 Alt 148 Note 6 Blue Red Normal 95 149 b Alt 149 Note 6 Blue Magenta Normal 96 150 C. Alt 150 Note 6 Blue Brown Normal 97 151 U Alt 151 Note 6 Blue Light Grey Normal 98 152 Y Alt 152 Note 6 Blue Dark Grey High Intensity 99 153 0 Alt 153 Note 6 Blue Light Blue High Intensity Underline 9A 154 U Alt 154 Note 6 Blue Light Green High Intensity 7 -8 Characters, Keystrokes, and Colors As Text Attributes Value Color/Graphics Monitor Adapter As Characters Modes Background Foreground IBM Monochrome Display Adapter Hex Dec Symbol Keystrokes 9B 155 ¢ Alt 155 Note 6 Blue Light Cyan High Intensity 9C 156 £ Alt 156 Note 6 Blue Light Red H ig h Intensity 9D 157 ¥ Alt 157 Note 6 Blue Light Magenta H ig h Intensity 9E 158 Pt Alt 158 Note 6 Blue Yellow High Intensity High Intensity 9F 159 f Alt 159 Note 6 Blue White AO 160 a Alt 160 Note 6 Green Black Normal A1 161 r Alt 161 Note 6 Green Blue Underline A2 162 6 Alt 162 Note 6 Green Green Normal A3 163 U Alt 163 Note 6 Green Cyan Normal A4 164 ii Alt 164 Note 6 Green Red Normal A5 165 N Alt 165 Note 6 Green Magenta Normal A6 166 ~ Alt 166 Note 6 Green Brown Normal A7 167 ~ Alt 167 Note 6 Green Light Grey Normal A8 168 G Alt 168 Note 6 Green Dark Grey High Intensity A9 169 Alt 169 Note 6 Green Light Blue High Intensity Underline AA 170 Alt 170 Note 6 Green Light Green High Intensity AB 171 'h Alt 171 Note 6 Green Light Cyan High Intensity AC 172 V. Alt 172 Note 6 Green Light Red High Intensity AD 173 i Alt 173 Note 6 Green Light Magenta High Intensity AE 174 Alt 174 Note 6 Green Yellow High Intensity AF 175 Alt 175 Note 6 Green White High Intensity BO 176 « » ...... ..... , Alt 176 Note 6 Cyan Black Normal B1 177 Alt 177 Note 6 Cyan Blue Underline B2 178 I I Alt 178 Note 6 Cyan Green Normal B3 179 Alt 179 Note 6 Cyan Cyan Normal B4 180 r- Alt 180 Note 6 Cyan Red Normal B5 181 ~ Alt 181 Note 6 Cyan Magenta Normal B6 182 r---i Alt 182 Note 6 Cyan Brown Normal I I Characters, Keystrokes, and Colors 7-9 As Text Attributes Value Color/Graphics Monitor Adapter As Characters Hex Dec B7 183 B8 Symbol Keystrokes Modes Background Foreground IBM Monochrome Display Adapter r-n Alt 183 Note 6 Cyan Light Grey Normal 184 ~ Alt 184 Note 6 Cyan Dark Grey High Intensity B9 185 U h Alt 185 Note 6 Cyan Light Blue High Intensity Underline Alt 186 Note 6 Cyan Light Green High Intensity Alt 187 Note 6 Cyan Light Cyan High Intensity Alt 188 Note 6 Cyan Light Red H ig h Intensity Alt 189 Note 6 Cyan Light Magenta High Intensity Alt 190 Note 6 Cyan Yellow High Intensity Alt 191 Note 6 Cyan White High Intensity Alt 192 Note 6 Red Black Normal Alt 193 Note 6 Red Blue Underline Alt 194 Note 6 Red Green Normal BA 186 BB 187 BC 188 BD 189 b 1=11 CO LU 190 B 191 r---, --r=:::: 192 C1 193 BE BF 1 C2 194 C3 195 Ait 195 Note 6 Red Cyan Normal C4 196 Alt 196 Note 6 Red Red Normal C5 197 Alt 197 Note 6 Red Magenta Normal C6 198 Alt 198 Note 6 Red Brown Normal C7 199 Alt 199 Note 6 Red Light Grey Normal C8 200 Alt 200 Note 6 Red Dark Grey H ig h Intensity C9 201 Alt 201 Note 6 Red Light Blue High Intensity Underline CA 202 Alt 202 Note 6 Red Light Green High Intensity CB 203 ~ Alt 203 Note 6 Red Light Cyan High Intensity CC 204 Alt 204 Note 6 Red Light Red High Intensity CD 205 Alt 205 Note 6 Red Light Magenta High Intensity CE 206 Alt 206 Note 6 Red Yellow High Intensity CF 207 Alt 207 Note 6 Red White High Intensity Alt 208 Note 6 Magenta Black Normal DO 7 -10 208 fI ~ ~ II I=ll== .-I~ ~~ 11 Characters, Keystrokes, and Colors As Text Attributes Color/Graphics IBM Characters, Keystrokes, and Colors 7 -11 As Text Attributes Value As Characters Color/Graphics Monitor Adapter Hex Dec Symbol Keystrokes EC 236 = Alt 236 Note 6 Brown Light Red High Intensity ED 237 Alt 237 Note 6 Brown Light Magenta High Intensity EE 238 € Alt 238 Note 6 Brown Yellow High Intensity EF 239 n Alt 239 Note 6 Brown White High Intensity FO 240 - Alt 240 Note 6 Light Grey Black Reverse Video F1 241 ± Alt 241 Note 6 Light Grey Blue Underline F2 242 ::> Alt 242 Note 6 Light Grey Green Normal F3 243 :S Alt 243 Note 6 Light Grey Cyan Normal F4 244 r Alt 244 Note 6 Light Grey Red Normal F5 245 Alt 245 Note 6 Light Grey Magenta Normal F6 246 Alt 246 Note 6 Light Grey Brown Normal F7 247 Alt 247 Note 6 Light Grey Light Grey Normal F8 248 Alt 248 Note 6 Light Grey Dark Grey Reverse Video F9 249 • Alt 249 Note 6 Light Grey Light Blue High Intensity Underline FA 250 • Alt 250 Note 6 Light Grey Light Green High Intensity FB 251 J "'0" r Modes Background Foreground IBM Monochrome Display Adapter Alt 251 Note 6 Light Grey Light Cyan High Intensity FC 252 n Alt 252 Note 6 Light Grey Light Red High Intensity FD 253 2 Alt 253 Note 6 Light Grey Light Magenta High Intensity FE 254 • Alt 254 Note 6 Light Grey Yellow High Intensity FF 255 BLANK Alt 255 Note 6 Light Grey White High Intensity 7 -12 Characters, Keystrokes, and Colors Notes 1. Asterisk (*) can be typed using two methods: press the (*) key or, in the shift mode, press the 8 key. 2. Period (.) can be typed using two methods: press the. key or, in the shift or Num Lock mode, press the Del key. 3. Numeric characters 0-9 can be typed using two methods: press the numeric keys on the top row of the keyboard or, in the shift or Num Lock mode, press the numeric keys in the keypad portion of the keyboard. 4. Uppercase alphabetic characters (A-Z) can be typed in two modes: the shift mode or the Caps Lock mode. 5. Lowercase alphabetic characters (a-z) can be typed in two modes: in the normal mode or in Caps Lock and shift mode combined. 6. The three digits after the Alt key must be typed from the numeric keypad. Character codes 1-255 may be entered in this fashion (with Caps Lock activated, character codes 97-122 will display uppercase). Characters, Keystrokes, and Colors 7 -13 Quick Reference DECIMAL VALUE It 0 16 32 48 64 80 96 112 • HEXA· DECIMAL VALUE 0 1 2 3 4 5 6 0 0 BLANK (NULL) ~ BLANK (SPACE) 1 1 g ..... 2 2 3 3 4 4 -• ,, 5 5 ~ 6 6 7 7 8 8 9 9 10 A 11 B (f +- 12 C 9 L 13 D J ~ 14 E ~ • 15 F ~ 7 -14 + p , P , 01 A Q a @ q b r c s d t e u f v g W h x • 1 y • J z • t II •• # ~ $ § % & , • ~ •- i ( 0 ! ) ....... * .. 7 + , • / B R C S D T E U F V GW H X I Y • J Z • ,• K [ k { I I L < "'- I - M ] m } > N !\ n rv 2 3 4 5 6 7 8 9 ? • 0 Characters, Keystrokes, and Colors - 0 6. DECIMAL VALUE • 128 144 160 176 192 208 224 240 •0 HEXADECIMAL VALUE 1 A 0 C 9 " 1 u re 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 A 8 B ... ./ ::::: ./ ./ 00 II ./ A f-- == 0 ---n e y c• FI e 0 I ~ -I , _L e UI A 00 00 00 00 00 B 1 ¢ 12 c A 13 D 11 ,1 1 ¥ E 15 F , - • ~ w A li « ld II A J » II 00 14 £ ~ ==j ~ d F ex: --- r + -> < 1T - :E F u J A ~ lL ~ 00 , u E {3 ::::: ..... e lE 0 III a 0 u ,.., a 0 n,.., , , a 0 N= a u a -1 A D I ./ E a 00 C ,...- J1 T r 0 0 ~ ~ 0 9 • n • 8 "n 00 ¢ 2 E I n Characters, Keystrokes, and Colors BLANK 'FF' 7 -15 Notes: 7 -16 Characters, Keystrokes, and Colors SECTION 8. COMMUNICATIONS Contents Hardware ..............••.......•.•..•..••••..... 8-3 Establishing a Communications Link .....•.........•...• 8-5 Communications 8-1 Notes: 8-2 CommunicationS Hardware 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 Equipme_n_t___ Data Communications Equipment Communications line ~ Voice line EIA/CCITT Adapter Cable Conforming to EIA or CCITT Standards The EIA/ CCITT adapter allows the data terminal equipment to be connected to the data communications equipment using EIA or CCITT standardized connections. An external modem is shown in the figure; however, other types of data communications equipment also can be connected to the data terminal equipment 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. Communications 8-3 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. 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 ,~'""==----- / , ,, / / / / / "" ,,., ........ Adapter """ Cable Conforming ,," To RS·232C Standards / " " .".",,'" , _ EIAICCITT /-----1' Line Number r- Request to Send 00-®00-- I- Clear to Send ~ CB/l06 I- Data Set Ready . Data Terminal Ready - Protective Ground - Signal Ground r- Transmitted Data I- Data Terminal Equip· ment rr- Received Data Connect Data Set to Line ~ 20 ~ - Received Line Signal Detector 8 " Telephone Co. '" Lead Number r - - - " - , AA/101 AB/102 BAl103 BB/104 CAl105 CC/107 CD/108.2 Modem **/108.1 CF/109 - Speed Select - - - - - - - { - Transmit Signal Element Timing~ DB/114 _ Receive Signal Element Timing ~ 00/115 @- **/116 @-- DE/125 - Select Standby I- Ring Indicator ~ ....Jr- Test L -_ _ **/*** I External Modem Cable Connector 1312111098 765 4 321 0000000000000) \ 000000000000 + 252423222120191817161514 L ___ I Dat~ Terminal ___ _ EqUipment (MOdem)DCE Data Communications--.J EqUiPment-I Pin Number *Not used when business machine clocking is used. **Not standardized by EIA (Electronics Industry Association). *** Not standardized by CCITT 8-4 Communications Establishing a Communications Link The following bar graphs represent normal timing sequences of operation during the establishment of communication for both switched (dial-up) and nonswitched (direct line) networks. Switched Timing Sequence Data Terminal Ready Data Set Ready Request to Send Clear to Send Transmitted Data Nonswitched Timing Sequence Data Terminal Ready Data Set Ready J Request to Send Clear to Send Transmitted Data 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 Establishing a Link on a Nonswitched Point-to-Point Line QO I ~ n Q ~ s. f') ~ Q'. 1. The terminals at both locations activate the 'data terminal ready' lines a and II· II Normally the 'data set ready' lines and from the modems are active whenever the modems are powered on. 3. Terminal A activates the 'request to send' line which causes the modem at terminal A to generate a carrier signal. 4. Modem B detects the carrier, and activates the 'received line signal detector' line (sometimes called data carrier detect) Modem B also activates the 'receiver signal element timing' line (sometimes called receive clock) to send receive clock signals to the terminal. Some modems activate the clock signals whenever the modem is powered on. '" 1m . 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. Modem B deactivates the 'received line Signal detector' line and, if necessary, deactivates the receive clock signals on the 'receiver signal element timing' line 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' line which causes modem B to transmit a carrier to modem A. II, 14. 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' lineD to the modem. 7. The modem modulates the carrier signal with the data and transmits it to the modem B 8. Modem B demodulates the data from the carrier signal and sends it to terminal B on the 'received data' line 9. Terminal B deserializes the data (through the serdes) using the receive clock signals (on the 'receiver signal element timing' line) from the modem. II. After terminal A completes its transmission, it deactivates the 'request to send' line which causes the modem to turn off the carrier and deactivate the 'clear to send' line II ' a. 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' line to indicate that terminal B can begin transmitting its response. II 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' lineD to 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). lEI. III 1m III. a' 6. 10. 12. II ' III 5. 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 transmitti ng modem changed to receive too soon, it cou Id receive a reflection (echo) of the signal it just transmitted. II 2. 8 11. TerminalS Terminal A r;::======llII ir-======::;-]II II II Communications Adapter II Ij II II II D r - II . Data Terminal Ready :C Data Set Ready I Modem A Supply fJ I I Power I Supply I __ -1 L_ I __ -1 II : ~ '----!-~~~~~~~---.-.j : II I I Clear to Send II L_J II --z-.-.' ) (: I ~_-l-=~:c~:~~:.::S;~n::.I:~:.:~:::rmS::.i~g",9n_a_1~ I r I -------, Demodulator '- _______ J ,.------' iii II II ~~~e~7~~t~~t~r fJ II ("') Q ~ Receiver ~ig.nal Element Timing S .., Echo Delay II II ~ r-~;"--L-- ,-----, L_~'~_j-- ~~~e~~ I r-----, r -R-;C~v; ~ 1~~u~slj- I D. S ' - I Modem : C~~ _ - ' r-----IL Transmit I 1 01 Ie I I I Modem ~_C~~_J --, _Demodulator _ _ _ _ _ _ - 'I r Data :I :I :I :I II II -------, L _ ~~ula~~ _ J II II Clear to Send I I I I I lEI III II 'I II Transmitter Signal Element Timing II II II II II II Transmitted Data -, !§ l~F II II ~==== ~======:J 8 NOll:J3S I :I Element Timing Request to Send ,t, r~'J l:: r-----, , __ ~ Carrier Received Data II IC 0 : n It I r 10 I I """,-~;;" II II II I I II II :to .....:a Modem L _ _ _ _ -.J II II ~ _C~c~ _ J II Received II ~. ~:t:smitted I r-~~-i r II QC I Receive Circuits II II II ~ Data Set Ready ~~~~7~~t~~t~r II ,-----, II II II -, II iii II II r I 0 I §. n II Communications Adapter Data Terminal Ready 0 II II .. II r------, r-P~w~r-l I II II II Communicat' VII;:> Line Modem S II II II II II II J II II II :J Establishing a Link on a Nonswitched Multipoint Line QC I QC 1. ~ ~ II . 2. ~. 0". ~ The control station serializes the address for the tributary or secondary station (AA) and sends its address to the modem on the 'transmitted data' line 3. 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. All tributary modems, including the modem for station A, demodulate the address and send it to their terminals on the 'received data' line Only station A responds to the address; the other stations ignore the address and continue monitoring thei~ '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. m 5. After a short delay to allow the control station modem to receive the carrier, the tributary modem activates the 'clear to send' line 7. When station A detects the active 'clear to send' line, it transmits its response. (For this example, assume that station A has no data to send; therefore, it transmits an EaT 8. After transmitting the EaT, station A deactivates the 'request to send' line This causes the modem to deactivate the carrier and the 'clear to send' line 9. 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. D' iii. 4. 6. The control station's modem receives the carrier and activates the 'received line signal detector' line and 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 D fJ . Ill.) m. fJ . II. Tributary or Secondary Station A Host rr======:;-] I II I I Communications Adapter II I Ready' I 10 In I I Data Set Ready1 II Clear to Send 1 II II II II II II r _l: : Transmit ~: I L ___ Element Timing1 AA r }.J I 10 Modem Clock I Transmitted Data I t ~ §. ~ ct. ~ ClC I \C I I I Il Element Timing1 1 _dl :::::: e : I LfJ --, S I II II II II II II II 1 Rece;ve,S;gnal Modem'" - - - - - --, r--.--'" r-----, )-':.-:'~T Modem I IL ____ Clock ....JI IL --, _Demodulator _____ ......JI iii I I I I L_J 0 tSI I o I r-' , I a I g e I I I I II r----' : e I ~e-:---I-";LIT':~;! l~J r----.., I II II II Request to Send B T,ansm;tte,ILnal : i~ Element Timing Modem [_~~~~~=~ EOT II Clear to Send II Received Data ~1 II : II II :: Transmitted Oata II II L.:-=======.1 I Received Oata II t L~e~e~~j r O' .------ I 01 :1'1 t: Element Timingl I I Receiver all II Receiver Signal r f Oetecton 1 I Carner Detector I I _SI :::::: e I _,I ___ 1 !. +----I-L R::v~r_J r-' 1 C: '1 n I Received Line Signa L:~c~_J J 0 : .... r...J Received Line Signal II Data Set Ready 1 I __ Demodulator L _ _ _ _ _ ...JI-t-~.-----+--~ 1111 AA ~: Communications Adapter Data Terminal Ready' ,I r----- r II n AA I I I I I Iial _ _ _ _ ...J I I II M' I Id I r------, I u I L T I I = Power On L- ----, Carrier Ia I II.._J y I Transmitter Signal I I I _~~~~J r----' I r-----, I r, : I liB Li r;:==-=-=-==ll II II Modem .J .--' ~ Request to Send 1• L_J Power On I :t 1'1 10 I Communications r----.., Data Terminal r-' : C Ii Host Modem Terminal 1.AA d L,.~ I I I _J II II II t.=======~ lThese lines are active continuously. B NOI1:l3S Establishing a Link on a Switched Point-to-Point Line QC .... Q I ~ 0 § §. 1. 2. When the terminal A operator lifts the telephone handset, the 'switch hook' line from the coupler is activated 3. Modem A detects the 'switch hook' line and activates the 'off hook' line. ' which causes the coupler to connect the telephone set to the line and activate the 'coupler cut-through' line to the modem. f') .... S· $1:1 = '11 Terminal A is in communications mode; therefore, the 'data terminal ready' line. is active. Terminal B is in communication mode waiting for a call from terminal A. 4. 8. The autoanswer circuits in modem B activate the 'off hook'iine to the coupler 9. The coupler connects modem B to the communications line through the 'data tip' and 'data ring' lines and activates the 'coupler cut-through' line to the modem. Modem B then transmits an answer tone to terminal A. II II. II Modem A activates the 'data modem ready' line II tothe coupler (the The terminal A operator sets the exclusion key or talk/data switch to the talk position to connect the handset to the communications line. The operator then dials the terminal B number. 6. When .the telephone at terminal B rings, the coupler activates the 'ring indicate' line to modem B Modem B indicates that the 'ring indicate' line was activated by activating the 'ring indicator' line to terminal B. 7. Ill. lEI m, Terminal B activates the 'data terminal ready' line to modem B which activates the autoanswer circuits in modem B. (The 'data terminal ready' line might already be active in some terminals.) II 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 11. The coupler at terminal A deactivates the 'switch hook' line This causes modem A to activate the 'data set ready' line indicating to terminal A that the modem is connected to the communications line. II. 'data modem ready' line is on continuously in some modems). 5. II. II II. The sequence of the remaining steps to establish the data link is the same as the sequence required on a nonswitched pOint-to-point line. When the terminals have completed their transmission,they both deactivate the 'data terminal ready' line to disconnect the modems from the line. Terminal B Terminal A r;::======~ II Communications Adapter II II r-, II II III I III II' II II II 'C I0 I In I t I I r I0 I I I L_J II II Modem A II II r-----, II I Data Terminal Ready Data Set I ----r Carrier Generate L r -, , 0 : Ie I I I Ia I IYI II II II II L_~ II II II II II ~ II II §. II ~ II III !') ~. II IlL II OCI I ~ ~ II Id I IU I I I I Ia I I t I r I r I 1 I SI e I r I d I e I sI L J II II II II II II II II II II II II CBS Coupler Coupler II I I I Off Hook IOH) I II Off Hook Coupler II Coupler II ICCD Data Modem ICCT) II Ready (DA) Data Modem r-' r-l Ready (DAJ IRI Ie I I, I I a I Y I sI IRI Ie I " I Ia I Iy ! Is I I Ring I Data Tip (DT) Data Ring (DR) II Cut-Through Cut-Through II I I I L_J L_J r------, I I Answer Tone IA II I u I L_ It I 10 I Ia I In I IsI Iw I Ie I IOH) Data L- r-' ISH) ISH) Communications Adapter Modem B Switch Hook 1 I I I I IM I I 0 I I Transmit Data II II r Switch Hook 101 II ("} I I CBS r;:======llII II Data Terminal Ready Data Set Ready r-' Received Line Signal Detector I I I0 I Ie I Im I I0 I Id I I uI I I I Ia I I t I L_J Indicate (Rl Data Tip (DT) III 1 0r ' Data Data Ring (DR) _JI r--, I CI I E I I : ~ a : 10 m I I P I L __ ..J r----, r----' Modem I I I I L~'oc~_J Modem Clock L_ I I __-' ~ II II Transmit Clock II II II II III r-l CI I n I : t I r I I0 I I I I 0 I L_J II II II .., II 'II III II II II II II Received Data II II II II II II II II II II r ' II II II II ILIS~ II LlJ i~~ Id Ie I s JI I II ::J ! L:: Ring Indic!Tar Receive Clock z 31 ~"~ II I!I - __ J : r : II!! I I II II Communications Line 8 NOIl:J:JS Notes: 8-12 Communications SECTION 9. IBM PERSONAL COMPUTER COMPATIBILITY Contents Hardware Considerations •....••.•...•.•.•.•••••••••• System Board ................................. Fixed Disk Drive ............................... Diskette Drive Compatibility .......... . . . . . . . . . . .. Copy Protection ............................... Bypassing BIOS ............................. Diskette Drive Controls ....................... Write Current Control ........................ 9-3 9-3 9-5 9-5 9-5 9-6 9-6 9-6 Application Guidelines •.••.•.•.•.•.......••...•...•. 9-7' High-Level Language Considerations ............... 9-7 Assembler Language Programming Considerations ..... 9-8 Multitasking Provisions ......................... 9-16 Interfaces ................................. 9-16 Classes ................................... 9-17 Time-Outs ................................ 9-19 Machine-Sensitive Code ........................ 9-19 Compatibility 9-1 Notes: 9-2 Compatibility This section describes the differences among the members of the IBM Personal Computer family. It also contains information necessary to design hardware and programs that will be compatible with all members of the IBM Personal Computer family. Hardware Considerations To design compatible hardware or programs, you must consider hardware differences among the IBM Personal Computers. The following are hardware features of the IBM Personal Computer AT that are not supported by all of the IBM Personal Computer family. System Board The IBM Personal Computer AT system board uses an Intel 80286 Microprocessor. This microprocessor is compatible with the 80287 Math Coprocessor used in the Personal Computer AT, and is generally compatible with the Intel 8088 Microprocessor used in other IBM Personal Computers. Compatibility 9-3 The following table identifies the microprocessor and describes the I/O channel used with each type of IBM Personal Computer. System Name System Unit Microprocessor I/O Channel Description 5 62-Pin Personal Computer 8088 PCjr 8088 Personal Computer XT 8088 8 62-Pin Portable Personal Computer 8088 8 62-Pin Personal Computer AT 80286 Not Compatible 2 62-pin 6 98-Pin (62 Pin + 36 Pin) System Hardware Identification Chart The faster processing capability of the 80286, compared to the 8088, creates special programming considerations, which are discussed later in this section under "Application Guidelines." Some adapters use a 36-pin connector in addition to the 62-pin connector. Adapters designed to use the 36-pin connectors are not compatible with all members of the IBM Personal Computer family. Refer to the "System to Adapter Compatibility Chart" in the Technical Reference Options and Adapters manual, Volume 1, to identify the adapters supported by each system. The IBM Personal Computer AT does not support an expansion unit. On the I/O channel: • The system clock signal should be used only for synchronization and not for applications requiring a fixed frequency. • The 14.31818-MHz oscillator is not synchronous with the system clock. • The ALE signal is activated during DMA cycles. • The -lOW signal is not active during refresh cycles. • Pin B04 supports IRQ 9. 9-4 Compatibility Fixed Disk Drive Reading from and writing to this drive is initiated in the same way as with other IBM Personal Computers; however, the Fixed Disk and Diskette Drive Adapter may be addressed from different BIOS locations. Diskette Drive Compatibility The following chart shows the read, write, and format capabilities for each of the diskette drives used by IBM Personal Computers. Diskette Drive Name 160/18oK Mode 320/36oK Mode 1.2M Mode 5-1/4 In. Diskette Drive: Type 1 Type 2 Type 3 Slimline Diskette Drive Double Sided Diskette Drive High Capacity Diskette Drive R R R R R WF WF WF WF WF R W* --- R R R R WF WF WF WF R W* ----------- R WF R-Read W-Write F-Format W*-If a diskette is formatted in either 160/180K mode or 320/360K mode and written on by a High Capacity Drive, that diskette may be read by only a High Capacity Drive. Diskette Drive Compatibility Chart Note: Diskettes designed for the 1.2M mode may not be used in either a 160/180K or a 320/360K diskette drive. Copy Protection The following methods of copy protection may not work on systems using the High Capacity Diskette Drive: • Bypassing BIOS Compatibility 9-5 • Diskette drive controls • Write current control Bypassing BIOS Copy protection that tries to bypass the following BIOS routines will not work on the High Capacity Diskette Drive: Track Density: The High Capacity Diskette Drive records tracks at a density of 96 TPI (tracks per inch). This drive has to double-step in the 48 TPI mode, which is performed by BIOS. Data Transfer Rate: BIOS selects the proper data transfer rate for the media being used. Disk Base: Copy protection, which creates its own disk base will not work on the High Capacity Diskette Drive. Diskette Drive Controls Copy protection that uses the following will not work on the High Capacity Diskette Drive: Rotational Speed: The time between two events on a diskette is controlled by the Fixed Disk and Diskette Drive Adapter. Access Time: Diskette BIOS routines must set the track-to-track access time for the different types of media used on the IBM Personal Computer AT. Head Geometry: See "Diskette Drive Compatibility" on page 9-5 Diskette Change Signal: Copy protection may not be able to reset this signal. 9-6 Compatibility Write Current Control Copy protection that uses write current control will not work because the Fixed Disk and Diskette Drive Adapter selects the proper write current for the media being used. Application Guidelines The following information should be used to develop application programs for the IBM Personal Computer family. High-Level Language Considerations The IBM-supported languages of BASIC, FORTRAN, COBOL, Pascal, and APL are the best choices for writing compatible programs. If a program uses specific features of the hardware, that program may not be compatible with all IBM Personal Computers. Specifically, the use of assembler language subroutines or hardware-specific commands (In, Out, Peek, Poke, ... ) must follow the assembler language rules (see "Assembler Language Programming Considerations" on page 9-8 ). 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 "Assembler Language Programming Considerations" are available. The use of programming loops may prevent a program from being compatible with other IBM Personal Computers. Compatibility 9-7 Assembler Language Programming Considerations The following OP codes work differently on systems using the 80286 microprocessor than they do on systems using the 8088 microprocessor. • If the system microprocessor executes a POPF instruction in either the real or the virtual address mode with CPL=:;;IOPL, then a pending maskable interrupt (the INTR pin active) may be improperly recognized after executing the POPF instruction even if maskable interrupts were disabled before the POPF instruction and the value popped had IF=O. If the interrupt is improperly recognized, the interrupt is still correctly executed. This errata has no effect when interrupts are enabled in either real or virtual address mode. This errata has no effect in the virtual address mode when CPL>IOPL. The POPF instruction may be simulated with the following code macro: • POPFF Macro EB 01 CF OE E8 FB FF JMP $+3 IRET PUSH CS CALL $-2 use POPFF instead of POPF simulate popping flags using IRET jump around IRET POP CS. I p. flags CALL within segment program will continue here PUSHSP 80286 microprocessor pushes the current stack pointer. 8088 microprocessor pushes the new stack pointer. • Single step interrupt (when TF= 1) on the interrupt instruction (OP code hex CC,CD): 80286 microprocessor does not interrupt on the INT instruction. 9-8 Compatibility 8088 microprocessor does interrupt on the INT instruction. • The divide error exception (interrupt 0): 80286 microprocessor pushes the eS:IP of the instruction, causing the exception. 8088 microprocessor pushes the eS:IP following the instruction, causing the exception. • Shift counts are masked to five bits. Shift counts greater than 31 are treated mod 32. For example, a shift count of 36, shifts the operand four places. The following describes anomalies which may occur in systems which contain 80286 processors with 1983 and 1984 date codes (S40172,S54036,S40093,S54012). In protected mode, the contents of the ex register may be unexpectedly altered under the following conditions: Note: The value in parenthesis indicates the type of error code pushed onto the exception handler's stack. Exception #NPO = Exception #11 = Not-present Fault Exception #880 = Exception #12 = 8tack Fault Exception #GPO = Exception #13 = General Protection Fault • Exception #GP(O) from attempted access to data segment or extra segment when the corresponding segment register holds a null selector. • Exception #GP(O) from attempted data read from code segment when code segment has the "execute only" attribute. • Exception #GP(O) from attempted write to code segment (code segments are not writable in protected mode), or to data segment of extra segment if the data or extra segment has the read only attribute. Compatibility 9-9 • Exception #GP(O) from attempted load of a selector referencing the local descriptor table into CS, DS, ES or SS, when the LDT is not present. • Exception #GP(O) from attempted input or output instruction when CPL > IOPL. • Exception #GP(selector) from attempted access to a descriptor is GDT, LDT, or IDT, beyond the defined limit of the descriptor table. • Exception #GP(O) from attempted read or write (except for "PUSH" onto stack) beyond the defined limit of segment. • Exception #SS(O) from attempted "PUSH" below the defined limit of the stack segment. Restarting applications which generate the above exceptions may result in errors. In the protected mode, when any of the null selector values (OOOOH, 0001H, 0002H, 0003H) are loaded into the DS or ES registers via a MOV or POP instruction or a task switch, the 80286 always loads the null selector OOOOH into the corresponding register. If a coprocessor (80287) operand is read from an "executable and readable" and conforming (ERC) code segment, and the coprocessor operand is sufficiently near the segment's limit that the second or subsequent byte lies outside the limit, no protection exception #9 will be generated. The following correctly describes the operation of all 80286 parts: • Instructions longer than 10 bytes (instructions using multiple redundant prefixes) generate exception #13 (General Purpose Exception) in both the real and protected modes. • If the second operand of an ARPL instruction is a null selector, the instruction generates an exception #13. Assembler language programs should perform all I/O operations through ROM BIOS or DOS function calls. 9-10 Compatibility • 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 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. The power-on-self-test code in the system ROM enables hardware IRQ 13 and sets up its vector to point to a routine in ROM. The ROM routine clears the 'busy' signal latch and then transfers control to the address pointed to by the NMI interrupt vector. This allows code written for any IBM Personal Computer to work on an IBM Personal Computer AT. The NMI interrupt handler should read the coprocessor's status to determine if the NMI was caused by the coprocessor. If the interrupt was not generated by the coprocessor, control should be passed to the original NMI interrupt handler. • Back to back I/O commands to the same I/O ports will not permit enough recovery time for I/O chips. To ensure 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 OUT • AL,AH IO_ADD ,AL In systems using the 80286 microprocessor, IRQ 9 is redirected to INT hex OA (hardware IRQ 2). This insures Compatibility 9-11 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 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. The gap length used during diskette read, write, and verify operations is derived from within diskette BIOS. The gap length for format operations is still obtained from the parameter block. Special considerations are required for formatting operations. See the prolog 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 9-12 Compatibility 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 of 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 media/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. Note: Refer to the DOS Technical Reference manual for the File Allocation Table (FAT) parameters for single- and double-sided diskettes. 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. • 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. Compatibility 9-13 • 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 Segment (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 (hex 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. 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. 9-14 Compatibility 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 on page 9-5 under" Copy Protection" . 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. There are several 80286 instructions that, when executed, lock out external bus signals. DMA requests are not honored during the execution of these instructions. Consecutive instructions of this type prevent DMA activity from the start of the first instruction to the end of the last instruction. To allow for necessary DMA cycles, as required by the diskette controller in a multitasking system, multiple lock-out instructions must be seperated by JMP SHORT $+2. Compatibility 9-15 Multitasking Provisions The IBM Personal Computer AT BIOS contains a feature to assist multitasking implementation. "Hooks" are provided for a multitasking dispatcher. Whenever a busy (wait) loop occurs in the BIOS, a hook is provided for the program to break out of the loop. Also, whenever BIOS services an interrupt, a corresponding wait loop is exited, and another hook is provided. Thus a program may be written that employs the bulk of the device driver code. The following is valid only in the microprocessor's real address mode and must be taken by the code to allow this support. The program is responsible for the serialization of access to the device driver. The BIOS code is not reentrant. The program is responsible for matching corresponding wait and post calls. Interfaces There are four interfaces to be used by the multitasking dispatcher: Startup First, the startup code hooks interrupt hex 15. The dispatcher is responsible to check for function codes of AH= hex 90 or 91. The "Wait" and "Post" sections describe these codes. The dispatcher must pass all other functions to the previous user of interrupt hex 15. This can be done by a JMP or a CALL. If the function code is hex 90 or 91, the dispatcher should do the appropriate processing and return by the IRET instruction. Serialization It is up to the multitasking system to ensure that the device driver code is used serially. Multiple entries into the code can result in serious errors. 9-16 Compatibility Wait (Busy) Whenever the BIOS is about to enter a busy loop, it first issues an interrupt hex 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 an outline of the code that has been added to the BIOS to perform this function. MOV AX, 90XXH INT 15H JC TIMEOUT NORMAL TIMEOUT LOGIC wait code in AH and type code in AL issue call optional: for time-out or if carry is set, time-out occurred normal time-out Post (Interrupt) Whenever the BIOS has set an interrupt flag for a corresponding busy loop, an interrupt 15 occurs with a function code of hex 91 in AH. This signals a post condition. At this point, the dispatcher should set the task status to "ready to run" and return to the interrupt routine. The following is an outline of the code added to BIOS that performs this function. MOV AX, 91XXH INT 15H post code AH and type code AL issue call Classes The following types of wait loops are supported: • The class for hex 0 to 7F 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. Compatibility 9-17 • The class for hex 80 to BF is reentrant. There is no restriction on the number of tasks that may access the device. • The class for hex CO to FF is non-interrupt. There is no corresponding interrupt for the wait loop. Therefore, it is the responsibility of the dispatcher to determine what satisfies this condition to exit the loop. Function Code Classes Type Code (AL) Description 00H->7FH Serially reusable devices; operating system must serialize access 80H->OBFH Reentrant devices; ES:BX is used to distinguish different calls (multiple I/O calls are allowed simultaneously) OCOH->OFH Wait only calls; there is no complementary POST for these waits--these are time-out only. Times are function-number dependent. Function Code Assignments The following are specific assignments for the IBM Personal Computer AT BIOS. Times are approximate. They are grouped according to the classes described under "Function Code Classes" . Type Code (AL) Time-out Description OOH yes (6 second) fixed disk OlH yes (2 second) diskette 02H no keyboard OFDH yes (1 second-write) diskette motor start 9-18 Compatibility (625 ms-read) yes (18 second) OFEH printer The asynchronous support has been omitted. The Serial/Parallel Adapter will generate interrupts, but BIOS does not support it in the interrupt mode. Therefore, the support should be included in the multitasking system code if that device is to be supported. Time-Outs To support time-outs properly, the multitasking dispatcher must 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 time-out occurrs. Machine-Sensitive Code Programs may select machine specific features, but they must test for specific machine type. Location of the specific machine identification codes can be found through interrupt 15 function code AH (See I Configuration Parameters I iIi BIOS Listing). The code is two bytes. The first byte shows the machine type and the second byte shows the series type. They are as follows: First Byte Second Byte FF FE FE FD FC 00 00 00 00 00 Machine Identification IBM IBM IBM IBM IBM Personal Personal Portable PCjr Personal Computer Computer XT Personal COmputer Computer AT Machine Identification Code IBM will define methods for uniquely determining the specific machine type or I/O feature for any new device. Compatibility 9-19 Notes: 9-20 Compatability Glossary This glossary includes definitions developed by the American National Standards Institute (ANSI) and the International Organization for Standardization (ISO). This material is reproduced from the American National Dictionary for Information Processing, copyright 1977 by the Computer and Business Equipment Manufacturers Association, copies of which may be purchased from the American National Standards Institute, 1430 Broadway, New York, New York 10018. fL. Prefix micro; 0.000001. fLS. Microsecond; 0.000 001 second. A. Ampere. ac. Alternating current. accumulator. formed. A register in which the result of an operation is 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. Glossary-l 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. alternating current (ac). direction of flow. A current that periodically reverses its American National Standard Code for Information Interchange (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). A/N. The basic unit of electric current. 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. Glossary-2 AND gate. are 1. A logic gate in which the output is 1 only if all inputs 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 Interchange. assemble. To translate a program expressed in an assembler language into a computer language. 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. Glossary-3 basic input/output system (BIOS). The feature of the IBM Personal Computer that provides the level control of the major I/O 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. 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. Glossary-4 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. 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. BSe. Bits per second. 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. Glossary-5 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) Synonymous with monitor. 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. Glossary-6 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. clipping. In computer graphics, removing parts of a display image that lie outside a window. 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. coding scheme. collector. flows. Synonym for code. An element in a transistor toward which current color cone. An arrangement of the visible colors on the surface of a double-ended cone where lightness varies along the axis of the cone, and hue varies around the circumference. Lightness includes both the intensity and saturation of color. column address strobe (CAS). addresses in a memory chip. A signal that latches the column 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 Glossary-7 than one computer instruction for each symbolic statement, or both, as well as performing the function of an assembler. complement. A number that can be derived from a specified number by subtracting it from a second specified number. 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 human intervention 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. contiguous. adjacent. Synonym for AND operation. Touching or joining at the edge or boundary; 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. Glossary-8 control storage. A portion of storage that contains microcode. coordinate space. In computer graphics, a system of Cartesian coordinates in which an object is defined. cps. Characters per second. cpu. Central processing unit. CRe. Cyclic redundancy check. CRT. Cathode ray tube. CRT display. CTS. Cathode ray tube display. Clear to send. Associated with modem control. cursor. (1) In computer graphics, a movable marker that is used to indicate 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. 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 Glossary-9 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. dB. dBa. dc. Synonym for transmission. Decibel. Adjusted decibels. Direct current. debounce. (1) An electronic means of overcoming the make/break bounce of switches to obtain one smooth change of signal level. (2) The elimination of undesired signal variations caused by mechanically generated signals from contacts. decibel. (1) A unit that expresses the ratio of two power levels on a logarithmic scale. (2) A unit for measuring relative power. decoupling 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 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. Glossary-tO (1) Pertaining to data in the form of digits. (2) Contrast digital. with analog. DIN. Deutsche Industrie Norm. DIN connector. committee. DIP. One of the connectors specified by the DIN 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 110 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. diskette. A thin, flexible magnetic disk and a semirigid protective jacket, in which the disk is permanently enclosed. Synonymous with flexible disk. diskette drive. A device for storing data on and retrieving data from a diskette. 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. Glossary-11 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. display element. In computer graphics, a basic graphic element that can be used to construct a display image; for example, a dot, a line segment, a character. display group. In computer graphics, a collection of display elements that can be manipulated as a unit and that can be further combined to form larger groups. display image. In computer graphics, a collection of display elements or display groups that are represented together at any one time in a display space. display space. In computer graphics, that portion of a display surface available for a display image. The display space may be all or part of a display surface. display surface. In computer graphics, that medium on which display images may appear; for example, the entire screen of a cathode ray tube. 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. drawing primitive. A group of commands that draw defined geometric shapes. Glossary-12 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. 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 using transistors and capacitors as the memory elements. This memory requires a refresh (recharge) cycle every few milliseconds. Contrast with static memory. EBCDIC. ECC. Extended binary-coded decimal interchange code. 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). data. A code that marks the end of a block of Glossary-13 end of fIle (EOF). 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). terminate text. A transmission control character used to 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. 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 Glossary-l 4 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. F. Fahrenheit. Fahrenheit (F). falling edge. A temperature scale. Contrast with Celsius (C). 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. field-programmable logic sequencer (FPLS). An integrated circuit containing a programmable, read-only memory that responds to external inputs and feedback of its own outputs. FIFO (first-in-first out). A queuing technique in which the next item to be retrieved is the item that has been in the queue for the longest time. Glossary-15 fixed disk drive. In the IBM Personal Computer, a unit consisting of nonremovable magnetic disks, and a device for storing data on and retrieving data from the disks. 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. 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. FPLS. The arrangement or layout of data on a data medium. Field-programmable logic sequencer. 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 induding beginning and ending flag sequences. Glossary-16 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. 1,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. 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. Glossary-17 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). hex. A unit of frequency equal to one cycle per second. 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. hither plane. In computer graphics, a plane that is perpendicular to the line joining the viewing reference point and the view point and that lies between these two points. Any part of an object between the hither plane and the view point is not seen. See also yon plane. 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. Glossary-1S 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. input/output (I/O). (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, "input/output" may be used in place of such terms as "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. Glossary-19 intensity. In computer graphics, the amount of light emitted at a display point interface. A device that alters or converts actual electrical signals between distinct devices, programs, or systems. interleave. To arrange parts of one sequence of things or events so that they alternate with parts of one or more other sequences of the same nature and so that each sequence retains its identity. interrupt. (1) A suspension of a process, such as the execution of a computer program, caused by an event external to that process, and performed in such a way that the process can be resumed. (2) In a data transmission, to take an action at a receiving station that causes the transmitting station to terminate a transmission. (3) Synonymous with interruption. I/O. Input/output. I/O area. Synonym for buffer. irrecoverable error. An error that makes recovery impossible without the use of recovery techniques external to the computer program or run. joystick. In computer graphics, a lever that can pivot in all directions and that is used as a locator device. k. Prefix kilo; 1000. K. When referring to storage capacity, 1024. (1024 = 2 to the 10th power.) Kb. 1024 bytes. key lock. A device that deactivates the keyboard and locks the cover on for security. Glossary-20 kg. kHz. Kilogram; 1000 grams. Kilohertz; 1000 hertz. kilo (k). Prefix 1000 kilogram (kg). kilohertz (kHz). 1000 grams. 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. position. LED. The rightmost digit. See also low-order 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. look-up table (LUT). (1) A technique for mapping one set of values into a larger set of values. (2) In computer graphics, a table that assigns a color value (red, green, blue intensities) to a color index. 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. luminance. The luminous intensity per unit projected area of a given surface viewed from a given direction. Glossary-21 LUT. m. Look-up table. (1) Prefix milli; 0.001. (2) Meter. M. (1) Prefix mega; 1,000,000. (2) When referring to computer storage capacity, 1,048,576. (1,048,576 = 2 to the 20th power.) mAe Milliampere; 0.001 ampere. machine code. The machine language used for entering text and program instructions onto the recording medium or into storage and which is subsequently used for processing and printout. machine language. (1) A language that is used directly by a machine. (2) Deprecated term for computer instruction code. magnetic disk. (1) A flat circular plate with a magnetizable surface layer on which data can be stored by magnetic recording. (2) See also diskette. main storage. (1) Program-addressable storage from which instructions and other data can be loaded directly into registers for subsequent execution or processing. (2) Contrast with auxiliary storage. mark. A symbol or symbols that indicate the beginning or the end of a field, of a word, of an item of data, or of a set of data such as a file, a record, or a block. mask. (1) A pattern of characters that is used to control the retention or elimination of portions of another pattern of characters. (2) To use a pattern of characters to control the retention or elimination of portions of another pattern of characters. masked. Synonym for disabled. matrix. (1) A rectangular array of elements, arranged in rows and columns, that may be manipulated according to the rules of Glossary-22 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. Mb. 1,048,576 bytes. mega (M). Prefix 1,000,000. megahertz (MHz). memory. Term for main storage. meter (m). MFM. MHz. 1,000,000 hertz. A unit of length (equivalent to 39.37 inches). Modified frequency modulation. Megahertz; 1,000,000 hertz. micro (p.). Prefix 0.000,001. 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 (p.s). 0.000,001 second. miDi (m). Prefix 0.001. Glossary-23 milliampere (mA). millisecond (ms). 0.001 ampere. 0.001 second. mnemonic. A symbol chosen to assist the human memory; for example, an abbreviation such as "mpy" for "multiply." mode. (1) A method of operation; for example, the binary mode, the interpretive mode, the alphanumeric mode. (2) The most frequent value in the statistical sense. modeling transformation. Operations on the coordinates of an object (usually matrix multiplications) that cause the object to be rotated about any axis, translated (moved without rotating), and/ or scaled (changed in size along any or all dimensions). See also viewing transformation. 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. Glossary-24 (2) A packaged functional hardware unit designed for use with other components. modulo check. A calculation performed on values entered into a system. This calculation is designed to detect errors. modulo-N check. A check in which an operand is divided by a number N (the modulus) to generate a remainder (check digit) that is retained with the operand. For example, in a modulo-7 check, the remainder will be 0, 1,2,3,4,5, or 6. The operand is later checked by again dividing it by the modulus; if the remainder is not equal to the check digit, an error is indicated. modulus. In a modulo-N check, the number by which the operand is divided. monitor. Synonym for cathode ray tube display (CRT display). most-significant digit. high-order position. ms. The leftmost (non-zero) digit. See also 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.000,000,001. 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. are 1. A gate in which the output is 0 only if all inputs Glossary-25 nano (n). Prefix 0.000,000,001. nanosecond (ns). negative true. 0.000,000,001 second. Synonym for active low. negative-going edge. The edge of a pulse or signal changing in a negative direction. Synonymous with falling edge. non-retum-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. 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. input is 1. A gate in which the output is 0 only if at least one 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. ns. Non-return-to-zero change-on-ones recording. Nanosecond; 0.000,000,001 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. Glossary-26 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. open collector. 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. Glossary-27 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. overvoltage. A voltage of higher than specified value. parallel. (1) Pertaining to the concurrent or simultaneous operation of two or more devices, or to the concurrent performance of two or more activities. (2) Pertaining to the concurrent or simultaneous occurrence of two or more related activities in multiple devices or channels. (3) Pertaining to the simultaneity of two or more processes. (4) Pertaining to the simultaneous processing of the individual parts of a whole, such as the bits of a character and the characters of a word, using separate facilities for the various parts. (5) Contrast with serial. parameter. (1) A variable that is given a constant value for a specified application and that may denote the application. (2) A name in a procedure that is used to refer to an argument passed to that procedure. parity bit. A binary digit appended to a group of binary digits to make the sum of all the digits either always odd (odd parity) or always even (even parity). parity check. (1) A redundancy check that uses a parity bit. (2) Synonymous with odd-even check. PEL. Picture element. Glossary-28 personal computer. A small home or business computer that has a processor and keyboard and that can be connected to a television or some other monitor. An optional printer is usually available. phototransistor. A transistor whose switching action is controlled by light shining on it. picture element (PEL). display. The smallest displayable unit on a polling. (1) Interrogation of devices for purposes such as to avoid contention, to determine operational status, or to determine readiness to send or receive data. (2) The process whereby stations are invited, one at a time, to transmit. 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. Glossary-29 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). that can be programmed by the user. A read-only memory 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. Glossary-30 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 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). RAS. Read/write memory. 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. Glossary-31 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. 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. ROM. Synonym for positive-going edge. 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. Glossary-32 row address strobe (RAS). in a memory chip. A signal that latches the row address 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. saturation. In computer graphics, the purity of a particular hue. A color is said to be saturated when at least one primary color (red, blue, or green) is completely absent. scaling. In computer graphics, enlarging or reducing all or part of a display image by multiplying the coordinates of the image by a constant value. 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. Glossary-33 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 sequentiai 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 deserializes 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. 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. SS. Start-stop. Glossary-34 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 (STX). 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 (SS) 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. static memory. RAM 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. Glossary-35 symbol. (1) A conventional representation of a concept. (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 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 Glossary-36 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. typematic key. held pressed. v. A keyboard key that repeats its function when Volt. vector. In computer graphics, a directed line segment. video. Computer data or graphics displayed on a cathode ray tube, monitor, or display. view point. In computer graphics, the origin from which angles and scales are used to map virtual space into display space. viewing reference point. In computer graphics, a point in the modeling coordinate space that is a defined distance from the view point. viewing transformation. Operations on the coordinates of an object (usually matrix multiplications) that cause the view of the object to be rotated about any axis, translated (moved without Glossary-37 rotating), and/or scaled (changed in size along any or all dimensions). Viewing transformation differs from modeling transformation in that perspective is considered. See also modeling transformation. viewpiane. The visible plane of a CRT display screen that completely contains a defined window. viewport. In computer graphics, a predefined part of the CRT display space. 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. window. (1) A predefined part of the virtual space. (2) The visible area of a viewplane. 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. yon plane. In computer graphics, a plane that is perpendicular to the line joining the viewing reference point and the view point, and that lies beyond the viewing reference point. Any part of an object beyond the yon plane is not seen. See also hither plane. Glossary-38 Bibliography • Microprocessor and Peripheral Handbook INTEL Corporation.21 0844. 001 • Introduction to the iAPX 286 INTEL Corporation.21 0308.001 • iAPX 286 Operating Systems Writer's Guide INTEL Corporation. 121960. 001 • iAPX 286 Programmer's Reference Manual INTEL Corporation.21 0498.001 • iAPX 286 Hardware Reference Manual INTEL Corporation.21 0760. 001 • Numeric Processor Extension Data Sheet INTEL Corporation.21 0920 • 80287 Support Library Reference Manual INTEL Corporation. 12 212 9 • National Semiconductor Corporation. NS16450 • Motorola Microprocessor's Data Manual Motorola Inc. Series B BibIiography-l Notes: Bihliograpby-2 Index A B AAA 6-8 AAD 6-9 AAM 6-9 AAS 6-8 access time, track-to-track 9-6 ADC 6-6 ADD 6-6 additional ROM modules 5-13 address generation, DMA 1-9 address latch enable 1-35 address latch enable, buffered 1-32 address mode real 1-4 address space, I/O 1-24 address, segment 1-4 addresses, CMOS RAM 1-56 addresses, page register 1-10 AEN 1-35 ALE 9-4 alternate key 5-20 AND 6-10 APL 9-7 application guidelines 9-7 arithmetic instructions 6-6, 6-25 ARPL 6-19 ASCII characters 7-3 ASCII, extended 5-14 BALE 1-32 bandwidth 1-7 BASIC 9-7 basic assurance test 4-5 BASIC interrupts 5-6 BAT 4-5 battery connector 1-72 BHE 1-9 BIOS quick reference 5-24 BIOS fixed disk parameters 1-63 BIOS memory map 5-10 BIOS programming hints 5-10 block diagram keyboard interface 1-49 system xiv system board 1-6 system timer 1-22 board, system 1-3 BOUND 6-16 break code 4-4,4-11 break key 5-21 buffer, keyboard 4-3 buffered address latch enable 1-32 buffers, video display 9-14 bus controller 1-32 bus cycle 1-7 busy loop 9-17 bypassing BIOS 9-6 byte high enable 1-9 Index-l c CALL 6-13 capacitor, variable 1-41 caps lock key 5-20 CBW 6-9 channel, I/O 1-24 connectors 1-25 pin assignments 1-28 signals 1-31 channels, DMA 1-7, 1-9 character codes 5-14 characters 7-3 classes, wait loop 9-17 CLC 6-17 CLD 6-17 CLEX 6-27 CLI 6-17 CLK 1-31 clock real-time 1-56, 1-57 clock and data signals clock cycle 1-7 clock line,keyboard 1.,.54, 4-5,4-12,4..,13 clock, system 1-7 CMC 6-17 CMOS RAM 1-56 CMOS RAM addresses 1-56 CMOSRAM configuration 1-59 CMOS RAM I/O operations 1-68 CMP 6-7 CMPS 6'-11 COBOL 9-7 code device driver 9-16 machine identification 9-19 machine-sensitive 9-19 Index-2 codes character 5-14 extended 5-18 multitasking function 9-18 color burst signal 1-41 command codes, DMA controller 1-11 commands I/O 9-11 keyboard 4-9 keyboard controller 1-51 keyboard system 4-5 commands from the system commands to the system comparison instructions 6- 23 compatibility, hardware 9-3 condition, wait 9-17 configuration record 1-56 configuration, CMOS RAM 1-59 connectors battery 1-72 I/O channel 1-25 J-l through J-16 1-26 keyboard 1-73,4-3 power LED and key lock 1-72 power supply 1-71 power supply output 3-7 speaker 1-72 system board 1,.71 constants instructions 6-24 control game 9-14 sound 9-1~ control key 5-20 control transfer ~structions 6-13 controller, keyboard 1-42 controllers bus 1-32 DMA 1-7,1-9, 1-10 interrupt 1-12 refresh 1-7 coprocessor controls 1-39 coprocessor programming 2-3 coprocessor, math 2-3 copy protection 9-5,9-14 Ctrl state 5-18 CTS 6-18 CWD 6-9 cycle bus 1-7 clock 1-7 microprocessor 1-7 D DACK 0-3 and 5-7 1-35 DAS 6-8 data area, ROM BIOS 9-14 data communication equipment 8-3 data input, keyboard 4-13 data line, keyboard 1-54,4-5, 4-12,4-13 data output, keyboard 4-13 data stream 4-12 data terminal equipment 8-3 data transfer instructions 6-3, 6-22 data transfer rate, diskette 9-6 DEC 6-7,6-8 decodes, memory 1-11, 1-31 DECSTP 6-28 default segment workspace 5-9 description descriptors 1-5 device driver code 9-16 diagnostic checkpoint port 1-39 direct memory access 1-9 disk pointer 9-12 disk base 9-6, 9-12 diskette change signal 9-6 diskette data transfer rate 9-6 diskette rotational speed 9-6 diskette track density 9-6 diskette write current 9-7 DN 6-9 divide error exception 9-9 DMA address generation 1-9 DMA channels 1-7, 1-9 DMA controller 1-7 DMA controller command codes 1-11 DMA controller 1 1-9 DMA controller 2 1-10 DMA controllers 1-9 DOS 9-7 DOS function calls 9-10 DOS interrupts 5-6 DRQO-DRQ3 1-34 DRQ5-DRQ7 1-34 E EIA/ CCITT 8-3 enable NMI 1-38 encoding, keyboard 5-13 ENTER 6-16 ESC 6-18 exception, divide error 9-9 extended ASCII 5-14 extended codes 5-18 Index-3 F G FABS 6-26 FADO 6-25 FCHS 6-26 FCOM 6-23 FCOMP 6-23 FCOMPP 6-24 FON 6-25 FIFO 4-3 FLO 6-22 FLOLG2 6-24 FLOLN2 6-24 FLOL2T 6-24 FLOP 1 6-24 FLOZ 6-24 FLO 1 6-24 FMUL 6-25 FORTRAN 9-7 FPREM 6-26 FREE 6-28 French keyboard 4-16 FRNDINT 6-26 FSCALE 6-26 FSQRT 6-25 FST 6-22 FSTP 6-22 FSUB 6-25 FTST 6-24 function calls, DOS 9-10 function codes, multitasking 9-18 FXAM 6-24 FXCH 6-23 FXTRACT 6-26 game control 9-14 gap length parameter 9-12 generator,refresh request 1-22 German keyboard 4-17 graphics modes 5-8 guidelines, application 9-7 Index-4 H hard code 5-10 hardware compatibility 9-3 hardware interrupts 5-6 HLT 6-17 hooks 9-16 I I/O address map 1-37 I/O address space 1-24 I/O CH CK 1-32, 1-40 I/O CH ROY 1-33 I/O channel 1-24 connectors 1-25 pin assignments 1-28 signals 1-31 I/O channel check 1-32 I/O channel connectors 1-28 I/O channel ready 1-33 I/O chip select 1-36 I/O commands 9-11 I/O CS16 1-36 I/O ports, keyboard controller 1-54 I/O read 1-33 I/O write 1-33 IDIV 6-9 IIMUL 6-9 IMR 9-14 IMUL 6-8 IN 6-5 INC 6-6 INCSTP 6-28 inhibit keyboard 1-48 input buffer, keyboard controller 1-51 input port, keyboard controller 1-54 input requirements 3-3 inputs, power supply 3-3 INS 6-12 instructions arithmetic 6-6, 6-25 comparison 6-23 constants 6-24 control transfer 6-13 data transfer 6-3, 6-22 logic 6-9 processor control 6-17 protection control 6-18 rotate 6-9 shift 6-9 string manipulation 6-11 INT 6-16,6-27 interface, keyboard 4-3 interfaces, multitasking 9-16 interrupt controller 1-12 interrupt mask register 9-14 interrupt service routine 1-33 interrupt sharing 1-14 interrupt vectors 9-14 interrupt, single step 9-8 interrupts BASIC 5-6 DOS 5-6 hardware 5-6 program 5-3 program interrupt listing (real mode) 5-5 sharing 1-14 system 1-12 interrupts, program (real mode) 5-5 INTO 6-16 lOR 1-33 lOW 1-33 IRET 6-16 IRQ 2 9-11 IRQ 9 9-4,9-11 IRQ3-IRQ15 1-33 Italian keyboard 4-18 J JB/JNAE 6-14 JBE/JNA 6-14 JCXZ 6-16 JE/JZ 6-14 JL/JNGE 6-14 JLE/JNG 6-14 JMP 6-13 JNB/JAE 6-15 JNBE/JA 6-15 JNE/JNZ 6-15 JNL/JGE 6-15 JNLE/JG 6-15 JNO 6-15 JNP/JPO 6-15 JNS 6-15 JO 6-14 joystick support 5-6 JP/JPE 6-14 JS 6-14 jumper, RAM 1-40 Index-5 K key lock 4-3 key scan codes 4-11 keyboard buffer 4-3 clock line 1-54,4-5,4-12, 4-13 commands 4-9 connector 1-73,4-3 controller 1-42 controller commands 1-51 controller I/O ports 1-54 controller input buffer 1-51 controller input port 1-54 controller output buffer 1-51 controller output port 1-54 controller status register 1-49 controller test inputs 1-54 data input 4-13 data line 1-54,4-5,4-12, 4-13 data output 4-13 encoding 5-13 inhibit switch 1-48 interface 4-3 interface block diagram 1-49 layout 1-44,5-15 outputs 4-11 routine 5-23 specifications 4-22 system commands 4-5 keyboard layouts keyboard scan-code outputs keyboard, French 4-16 keyboard, German 4-17 Index-6 keyboard, Italian 4-18 keyboard, Spanish 4-19 keyboard, u.K. English 4-20 keyboard, U.S. English 4-21 keys 4-4 alternate 5-20 break 5-21 caps lock 5-20 combinations 5-21 control 5-20 number lock 5-21 pause 5-22 print screen 5-22 scroll lock 5-20 shift 5-19 system request 5-6, 5-22 keys, typematic 4-4 L LAHF 6-5 LAR 6-19 layout system board 1-74 layout, keyboard 1-44,5-15 LAI7-LA23 1-31 LDCW 6-27 LDENV 6-27 LDS 6-5 LEA 6-5 LEAVE 6-16 LED 4-5 LES 6-5 LGDT 6-18 LIDT 6-18 light emitting diodes 4-5 line contention 4-13 line, multipoint 8-5 line, point-to-point 8-5 LLDT 6-18 LMSW 6-19 load current 3-4 LOCK 6-17 LODS 6-11 logic diagrams logic instructions 6-9 LOOP 6-15 loop, busy 9-17 LOOPNZ/LOOPNE 6-16 loops, program 9-14 LOOPZ/LOOPE 6-15 LSL 6-19 LTR 6-18 MOVS 6-11 MUL 6-8 multi-tasking function codes 9-18 interfaces 9-16 provisions 9-16 serialization 9-16 startup 9-16 multipoint line 8-5 M NEG 6-8 network, nonswitched 8-5 network, switched 8-5 NMI 1-12, 1-38 :po load protection 3-5 non-maskable interrupt 1-38 nonswitched network 8-5 NOP 6-26, 6-28 NOT 6-11 Num Lock state 5-18 number lock key 5.,.21 machine identification code 9-19 machine-sensitive code 9-19 make code 4-4, 4-11 mask on and off 1-39 master 1-35 math coprocessor 2-3,9-11 math coprocessor controls 1-39 MEM chip select 1-36 MEM CS16 1-36 memory 1-4 memory decodes 1-11, 1-31 memory locations, reserved 5-9 memory map, BIOS 5-10 MEMR 1-34 MEMW 1-34 microprocessor 1-4, 1-7 microprocessor cycle 1-7 modes, graphic 5-8 modules, RAM 1-24 modules, ROM/EPROM 1-23 MOV 6-3 N o operations, CMOS RAM I/O 1-68 OR 6-10 OSC 1-36, 1-41 oscillator 1-36 OUT 6-5 output buffer, keyboard controller 1-51 output port, keyboard controller 1-54 output protection 3-4 Index-7 output voltage sense levels 3-6 output voltage sequencing 3-4 outputs, keyboard 4-11 outputs, power supply 3-4 OUTS 6-12 p page register addresses 1-10 parameter gap length 9-12 passing 5-4 tables 9-12 parameters, BIOS fixed disk 1-63 Pascal 9-7 PATAN 6-26 pause key 5-22 performance, system 1-7 point-to-point line 8-5 POP 6-4 paPA 6-4 POPF 6-6, 9-8 paR 4-4 port, diagnostic checkpoint 1-39 post 9-17 power good signal 3-5 power LED and key lock connector 1-72 power on reset 4-4 power supply connectors 1-71 inputs 3-3 output connectors 3-7 outputs 3-4 power-on routine print screen key 5-22 Index-8 priorities, shift key 5-21 processor control instructions 6-17 program interrupts 5-3 program loops 9-14 programming hints, BIOS 5-10 programming, coprocessor 2-3 protected mode 1-5,5-6 protection control instructions 6-18 protection, no load 3-5 provisions, multitasking 9-16 PTAN 6-26 PUSH 6-3 PUSH SP 9-8 PUSHA 6-4 PUSHF 6-6 Q quick reference charts 7-14 R RAM jumper 1-40 RAM modules 1-24 RAM subsystem 1-24 RAM, CMOS 1-56 rate, typematic 4-4, 4-7 real address mode 1-4,2-5 real mode 5-3 real-time clock 1-56, 1-57 record, configuration 1-56 refid=admod.virtual 1-4 REFRESH 1-35 refresh controller 1-7 refresh request generator 1-22 regulation tolerance 3-4 REP/REPNE, REPZ/REPNZ 6-12 requirements, input 3-3 reserved memory locations 5-9 reserved scan codes 1-47 RESET ORV' 1-32 reset, system 5-21 RET 6-13 ROM BIOS 9-10 ROM BIOS data area 9-14 ROM modules, additional 5-13 ROM scan codes 5-13 ROM subsystem 1-23 ROM/EPROM modules 1-23 rotate instructions 6-9 rotational, speed 9-6 routine, interrupt service 1-33 routine, keyboard 5-23 RS-232 8-3 RSTOR 6-28 s SAHF 6-5 SAVE 6-28 SAO-SA19 1-31 SBB 6-7 SBHE 1-35 scan code translation 1-43 scan codes 4-11 scan codes, key 4-11 scan codes, ROM 5-13 SeAS 6-11 scroll lock key 5-20 SOO-S015 1-32 segment address 1-4 segments 1-5 sense levels, output voltage 3-6 sequencing, output voltage 3-4 serialization, multitasking 9-16 SETPM 6-27 SGOT 6-18 shift counts 9-9 shift instructions 6-9 shift key 5-19 shift key priorities 5-21 Shift state 5-18 shift states 5-19 SlOT 6-18 signals diskette change 9-6 I/O channels 1-31 power good 3-5 system clock 9-4 single step interrupt 9-8 SLOT 6-18 SMEMR 1-34 SMEMW 1-34 SMSW 6-19 sound control 9-13 Spanish keyboard 4-19 speaker 1-40 speaker connector 1-72 speaker tone generation 1-22 special vectors 5-6 specifications specifications, keyboard 4-22 startup, multitasking 9-16 states Ctrl 5-18 Num Lock 5-18 Shift 5-18,5-19 Index-9 status register, keyboard controller 1-49 STC 6-17 STCW 6-27 STD 6-17 STENV 6-27 STI 6-17 STOS 6-12 STR 6-19 string manipulation instructions 6-11 STSW 6-27 STSWAX 6-27 SUB 6-7 subsystem, RAM 1-24 subsystem, ROM 1-23 support joystick 5-6 switched network 8-5 switches keyboard inhibit 1-48 type of display 1-41 system BIOS usage 5-3 system block diagram xiv system board 1-3 system board block diagram type 1 1-6 system board block diagram type 2 1-6 system board connectors 1-71 system board layout 1-7 4 system bus high enable 1-35 system clock 1-7 system clock signal 9-4 system interrupts 1-12 system performance 1-7 system request key 5-6, 5-22 system reset 5-21 system timer block diagram 1-22 system timers 1-22 Index-to T T/C 1-35 table, translation 1-45 tables, parameter 9-12 terminal count 1-35 TEST 6-10 test inputs, keyboard controller 1-54 time-outs 9-19 timer/counter 1-22 timer/counters 1-22 timers, system 1-22 tone generation, speaker 1-22 track density, diskette 9-6 track-to-track access time 9-6 translation table 1-45 translation, scan code 1-43 tri-state 1-36 type of display adapter switch 1-41 typematic keys 4-4 typematic rate 4-4, 4-7 u u.K. English keyboard U.S. English keyboard 4-20 4-21 v variable capacitor 1-41 vectors, special 5-6 VERR 6-19 video display buffers 9-14 virtual address mode 1-4, 2-5 y W YL2XP1 WAIT 6-17 wait condition 9-17 wait loop classes 9-17 workspace, default segment 5-9 write current, diskette 9-7 Z 6-27 zero wait state 1-36 Numerals X ows XCHG 6-4 XLAT 6-5 XOR 6-11 1-36 2XM1 6-26 80286 1-4 8042 1-42 82288 1-32 8237A-5 1-9 8254-2 1-22 8259A Interrupt 1-12 Index-ll Notes: Index-12 ---------- ----------------_.- The Personal Computer Hardware Reference Library Reader's Comment Form Technical Reference 6280070 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: NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES BUSINESS REPLY MAIL FIRST CLASS PERMIT NO. 40 ARMONK, NEW YORK POSTAGE WILL BE PAID BY ADDRESSEE IBM PERSONAL COMPUTER READER COMMENT DEPARTMENT P.O. BOX 1328-C BOCA RATON, FLORIDA 33429-9960 I•• 11 ••• II •• 1111111.11. 1•• 1.1 •• 1.111.111111'11.1.111 ....................................................................................... 8J84 PIO:! 81delS IOU op 8se81d 8del ---- ------_.- --- ---- ----- The Personal Computer Hardware Reference Library Reader's Comment Form Technical Reference 6280070 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: NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES BUSINESS REPLY MAIL FIRST CLASS PERMIT NO. 40 ARMONK, NEW YORK POSTAGE WILL BE PAID BY ADDRESSEE IBM PERSONAL COMPUTER READER COMMENT DEPARTMENT P.O. BOX 1328-C BOCA RATON, FLORIDA 33429-9960 11111111111111111111111111111111111111111111111