LIMITED WARRANTY The International Business Machines Corporation warrants this IBM Personal Computer Product to be in good working order for a period of 90 days from the date of purchase from IBM or an authorized IBM Personal Computer dealer. Should this Product fail to be in good working order at any time during this e)Q-day warranty period, IBM will, at its option, repair or replace this Product at no addi tiona! charge except as set forth below. Repair parts and replacemen t Products will be furnished on an exchange basis and will be either reconditioned or new. All replaced parts and Products become the property ofTBM. This IiIlli ted warranty does ilot inc! udc service to repair damage to the Produc t resultiJig from accident, disaster. misuse. abuse, or non-IBM modification ur the Product. Limited Warranty service may be obtained by delivering the Product during the 90-day warranty period to an authorized IBM Personal Computer dealer or IBM Service Center and providing proof of purchase date. If this Product is delivered by mail, you agree to insure the Product or assume the risk of loss or damage in transit, to prepay shipping charges to the warranty service location and to use the original shipping container or equivalent. Contact an au thorized IBM Personal Computer dealer or write to IBM Personal Computer, Sales and Service, P.O. Box 1328-W. Boca Raton, Florida 33432, for further information. ALL EXPRESS AND IMPLIED WARRANTIES FOR THIS PRODUCT INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE LIMITED IN DURATION TO A PERIOD OF 90 DAYS FROM TilE DATE OF PURCHASE, AND NO WARRANTIES, WHETHER EXPRESS OR IMPLIED, WILL APPLY AFTER THIS PERIOD. SOME STATES DO NOT ALLOW LIMITATIONS ON HOW LONG AN IMPLIED WARRANTY LASTS, SO THE ABOVE LIMITATIONS MAY NOT APPLY TO YOU. IF THIS PRODUCT IS NOT IN GOOD WORKING ORDER AS WARRANTED ABOVE. YOUR SOLE REMEDY SHALL BE REPAIR OR REPLACEMENT AS PROVIDED ABOVE. IN NO EVENT WILL IBM BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING ANY LOST PROFITS, LOST SAVINGS OR OTIIER INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF OR INABILITY TO USE SUCH PRODUCT, EVEN IF IBM OR AN AUTHORIZED IBM PERSONAL COMPUTER DEALER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR CONSUMER PRODUCTS, SO THE ABOVE LIMITATIONS OR EXCLUSIONS MAY NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS, AND YOU MAY ALSO HAVE OTHER RIGHTS WHICH MAY VARY FROM STATE TO STATE. --- - ----- -- ---_.- ---- - Personal Computer - ---- - ------ --- Hardware Reference Library Technical Reference FEDERAL COMMUNICATIONS COMMISSION RADIO FREQUENCY INTERFERENCE STATEMENT WARNING: This equipment has been certified to comply with the limits for a Class B computing device, pursuant to Subpart J of Part 15 of FCC rules. Only peripherals (computer input/output devices, terminals, printers, etc.) certified to comply with the Class B limits may be attached to this computer. Operation with non-certified peripherals is likely to result in interference to radio and TV reception. First Edition (August 1981) Changes are periodically made to the information herein; these changes will be incorporated in ncw editions of this publication. Products are not stocked at the address below. Requests for copies of this product and for technical information about the system should be made to your authorized IBM Personal Computer Dealer. A Product Comment Form is provided at the back of this publication. If this form has been removed, address comment to: IBM Corp., Personal Computer, P.O. Box 1328, 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 1981 CONTENTS SECTION 1. HARDWARE OVERVIEW ......... 1-1 System Block Diagram ............................ 1-4 SECTION 2. HARDWARE ...................... 2-1 System Board ................................... 2-3 System Board Data Flow .......................... 2-6 I/O Channel ..................................... 2-8 I/O Channel Diagram ............................ 2-9 System Board I/O Channel Description ............. 2-10 System Board Component Diagram ................. 2-13 Keyboard ........................................ 2-14 Keyboard Interface Block Diagram ................. 2-15 Keyboard Diagram ............................... 2-16 Keyboard Scan Codes ............................. 2-17 Keyboard Interface Connector Specifications ......... 2-18 Cassette User Interface ............................ 2-19 Cassette Jumpers ............................... 2-19 Circuit Block Diagrams ......................... 2-19 Cassette Interface Connector Specifications .......... 2-21 Speaker Interface ................................. 2-22 Speaker Drive System Block Diagram............. 2-22 I/O Address Map ................................. 2-23 System Memory Map ............................. 2-25 System Board And Memory Expansion Switch Settings ... 2-28 5 1/4" Diskette Drives Switch Settings .............. 2-29 Monitor Type Switch Settings ...................... 2-29 System Board Memory Switch Settings .............. 2-30 32/64 KB Memory Expansion Option Switch Settings ... 2-31 Power Supply ................................... 2-33 Power Supply Location ............................ 2-34 Input Requirements ............................... 2-34 DC Output ...................................... 2-34 AC Output ...................................... 2-34 Power Supply Connectors And Pin Assignments ...... 2-35 Important Operating Characteristics ................. 2-36 Over Voltage/Current Protection ................. 2-36 Signal Requirements ............................ 2-36 iii IBM Monochrome Display and Parallel Printer Adapter................................. 2-37 Parallel Interface Description ...................... 2-37 IBM Monochrome Display Adapter Block Diagram ... 2-38 System Channel Interface .......................... 2-39 Lines Used .................................... 2-39 wads ......................................... 2-39 Special Timing ................................. 2-39 Data Rates .................................... 2-39 Interrupt and DMA Response Requirements ....... 2-39 Modes Of Operation .............................. 2-40 Programming Considerations ....................... 2-41 Programming the 6845 CRT Controller ........... 2-41 Sequence of Events ............................. 2-41 Memory Requirements .......................... 2-41 DMA Channel ................................. 2-42 Interrupt Levels ................................ 2-42 I/O Address and Bit Map ....................... 2-42 IBM Monochrome Display ........................ 2-43 Operating Characteristics ........................ 2-43 IBM Monochrome Direct Drive Interface and Pin Assignment ................................. 2-44 Color/Graphics Monitor Adapter ................. 2-45 Color/Graphics Monitor Adapter Block Diagram ..... 2-47 Major Components Definitions ..................... 2-48 Motorola 6845 CRT Controller .................. 2-48 Mode Set and Status Registers ................... 2-48 Display Buffer ................................. 2-48 Character Generator ............................ 2-48 Timing Generator .............................. 2-48 Composite Color Generator...................... 2-48 Modes of Operation ............................... 2-49 Alphanumeric Mode ............................ 2-49 Color TV ...................................... 2-49 Color Monitor ................................. 2-50 mM Monochrome Display Adapter Vs. Color/Graphics .. . Adapter Attribute Relationship ..................... 2-51 Color/Graphics Modes ............................ 2-51 Graphics Storage Map .......................... 2-52 Description of Basic Operations .................. 2-54 Summary of Available Colors .................... 2-55 iv Programming Considerations ....................... 2-55 Programming The 6845 Controller. ............... 2-55 6845 Register Description ....................... 2-56 Programming the Mode Control and Status Register ... 2-57 Color Select Register ........................... 2-57 Mode Select Register ........................... 2-58 Mode Register Summary ........................ 2-58 Status Register ................................. 2-59 Sequence of Events ............................. 2-59 Memory Requirements .......................... 2-60 Interrupt Level ................................. 2-60 I/O Address and Bit Map ....................... 2-61 Color/Graphics Monitor Adapter Direct Drive, and Composite Interface Pin Assignment ............... 2-62 Color/Graphics Monitor Adapter Auxiliary Video Connectors ............................... 2-63 Parallel Printer Adapter .......................... 2-65 Parallel Printer Block Diagram ..................... 2-66 Programming Considerations ....................... 2-67 Parallel Printer Adapter Interface Connector Specifications ................................... 2-69 IBM 80 CPS Matrix Printer ....................... 2-70 Printer Specifications .............................. 2-71 Setting The DIP Switches ......................... 2-72 Functions and Conditions of DIP Switch 1 ........ 2-72 Functions and Conditions of DIP Switch 2 ........ 2-73 Parallel Interface Description ...................... 2-73 Connector Pin Assignment and Descriptions of Interface Signals .............................. 2-74 Parallel Interface Timing Diagram ................ 2-77 ASCII Coding Table ........... < 2-78 •••••••••••••••••• ASCII Control Codes ............................. 2-79 5 1/4" Diskette Drive Adapter .................... 2-89 5 1/4" Diskette Drive Adapter Block Diagram ....... 2-90 Functional Description ............................ 2-91 Digital Output Register .......................... 2-91 Floppy Disk Controller.......................... 2-91 Programming Considerations ....................... 2-94 Symbol Descriptions ............................ 2-94 Command Summary ............................ 2-96 Command Status Registers ...................... 2-100 v Progranuning Summary ............................ 2-103 DPC Registers ................................. 2-103 Drive Constants ................................ 2-104 Comments ..................................... 2-104 System I/O Channel Interface ...................... 2-104 Drive A and B Interface ........................... 2-106 Adapter Outputs ............................... 2-106 Adapter Inputs ................................. 2-107 5 1/4" Diskette Drive Adapter Internal Interface Specifications ................................... 2-108 5 1/4" Diskette Drive Adapter External Interface Specifications ................................... 2-109 5 1/4" Diskette Drive ............................. 2-110 Diskettes ........................................ 2-111 Mechanical and Electrical Specifications ............ 2-112 Memory Expansion Options ...................... 2-113 Operating Characteristics .......................... 2-113 Memory Module Description ....................... 2-114 Memory Module Pin Configuration ................. 2-114 Switch Configurable Start Address .................. 2-115 Game Control Adapter ........................... 2-117 Game Control Adapter Block Diagram .............. 2-117 Functional Description ............................ 2-118 Address Decode ................................ 2-118 Data Buss Buffer/Driver ........................ 2-118 Trigger Buttons ................................. 2-118 Joystick Positions .............................. 2-118 I/O Channel Description .......................... 2-119 Interface Description .............................. 2-119 Joystick Schematic ................................ 2-121 Game Control Adapter (Analog Input) Connector Specifications ................................... 2-122 Asynchronous Communications Adapter .......... 2-123 Asynchronous Communications Adapter Block Diagram ....................................... 2-124 Modes of Operation ............................... 2-125 I/O Decode for Communications Adapter ......... 2-125 Interrupts ...................................... 2-126 Interface Description .............................. 2-126 Current Loop Interface .......................... 2-127 Voltage Interchange Information .................. 2-128 VI INS 8250 Functional Pin Description ............... 2-129 Input Signals ................................... 2-129 Output Signals ................................. 2-132 Input/Output Signals ............................ 2-133 Programming Considerations ....................... 2-13 3 Asynchronous Communications Reset Functions ... 2-133 INS 8250 Accessable Registers .................. 2-134 INS 8250 Line Control Register.................. 2-134 INS 8250 Programmable Baud Rate Generator .... 2-135 Line Status Register ............................ 2-137 Interrupt Identification Register .................. 2-139 Interrupt Enable Register. ....................... 2-141 Modem Control Register ........................ 2-142 Modem Status Register. ......................... 2-143 Receiver Buffer Register. ........................ 2-144 Transmitter Holding Register .................... 2-145 Selecting The Interface Format. .................... 2-146 Asynchronous Communications Adapter Connector Interface Specifications .......................... 2-147 SECTION 3. ROM and SYSTEM USAGE ....... 3-1 ROM BIOS ..................................... 3-2 Use of BIOS ..................................... 3-2 Parameter Passing ................................ 3-2 Interrupt Vector Listing............................ 3-3 Vectors With Special Meaning ..................... 3-5 Interrupt 1CH - Timer Tick...................... 3-5 Interrupt 1DH - Video Parameters ................ 3-5 Interrupt 1EH - Diskette Parameters .............. 3-5 Interrupt 1FH - Graphics Character Extensions .... 3-6 Other Read/Write Memory Usage ................ 3-6 BIOS Programming Tip ........................... 3-6 BIOS Memory Map............................... 3-7 BIOS Cassette Logic ............................. 3-8 Interrupt 15 ...................................... 3-8 Cassette Write ................................... 3-8 Cassette Read .................................... 3-9 Data Record Architecture .......................... 3-10 Error Recovery ................................... 3-10 vii Keyboard Encoding and Usage ................... 3-11 Encoding ........................................ 3-11 Character Codes .................................. 3-11 Extended Codes .................................. 3-13 Extended Functions ............................ 3-13 Shift States .................................... 3-14 Shift Key Priorities ............................. 3-15 Special Handling ................................. 3-15 System Reset .................................. 3-15 Break ......................................... 3-16 Pause ......................................... 3-16 Print Screen ................................... 3-16 Keyboard Usage .................................. 3-17 BASIC Screen Editor Special Functions ............. 3-19 DOS Special Functions ........................... 3-19 Low Memory Maps .............................. 3-21 0-7F Interrupt Vectors ............................ 3-21 BASIC and DOS Reserved Interrupts (80-3FF) •..... 3-22 Reserved Memory Locations (400-5FF) ............. 3-22 BASIC Workspace Variables ...................... 3-23 APPENDICES .................................. A-O Appendix A: ROM BIOS Listing ................. A-I Appendix B: Assembly Instruction Set Reference ... B-1 Appendix C: Of Characters Keystrokes and Color .... C-l Appendix D: Logic Diagrams ..................... D-l Appendix E: Unit Specifications .................. E-l Glossary ........................................ G-l Bibliography .................................... Bib-l Index ................................... , ....... 1-1 viii FIGURE LISTING 1. System Block Diagram ........................ 1-4 2. System Board Data Flow ...................... 2-6, 7 3. I/O Channel Diagram ......................... 2-9 4. System Board Component Diagram ............. 2-13 5. Keyboard Interface Block Diagram.............. 2-15 6. Keyboard Diagram ............................ 2-16 7. Cassette Interface Read Hardware .............. 2-19 8. Cassette Interface Write Hardware .............. 2-20 9. Cassette Motor Control. ....................... 2-20 10. Speaker Drive System Block Diagram ........... 2-22 11. System Memory Map ......................... 2-25 12. System Memory Map (Increments of 16KB) ..... 2-26 13. Power Supply and Connectors .................. 2-35 14. IBM Monochrome Display AdapterBlockDiagram ... 2-38 15. Color/Graphics Monitor Adapter Block Diagram ... 2-47 16. Parallel Printer Adapter Block Diagram ......... 2-66 17. Location of (Printer) DIP Switches ............. 2-72 18. Parallel Interface Timing....................... 2-77 19. 5 1/4" Diskette Drive Adapter Block Diagram ... 2-90 20. Game Control Adapter Block Diagram .......... 2-117 21. Joystick Schematic ............................ 2-121 22. Asynchronous Communications Adapter Block Diagram ............................... 2-124 23. Current Loop Interface ........................ 2-127 24. Selecting The Interface Format. ................ 2-146 25. BIOS Memory Map ........................... 3-7 IX TABLE LISTING 1. J(eyboard Scan Codes ......................... 2-17 2. 6845 Initialization Parameters .................. 2-41 3. Monochrome Vs Color/Graphics Attributes ...... 2-51 4. Color/Graphics Modes ........................ 2-51 5. Summary of Available Colors .................. 2-55 6. 6845 Register Description ..................... 2-56 7. Printer Specifications .......................... 2-71 8. Functions and Conditions of DIP Switch 1 ....... 2-72 9. Functions and Conditions of DIP Switch 2 ....... 2-73 10. Connector Pin Assignment and Description of Interface Signals ................. 2-74 11. ASCII Coding Table .......................... 2-78 12. DCl/DC3 and Data Entry ..................... 2-82 13. Symbol Description ........................... 2-94 14. Status Register O.............................. 2-100 15. Status Register 1.............................. 2-101 16. Status Register 2 .............................. 2-102 17. Status Register 3.............................. 2-103 18. Mechanical and Electrical Specifications ......... 2-112 19. Memory Module Pin Configuration ............. 2-114 20. DIP Module Start Address ..................... 2-115 21. I/O Decodes (3F8 - 3FF) ..................... 2-125 22. Asynchronous Communications Reset Functions ... 2-133 23. BAUD Rate at 1.843 Mhz ..................... 2-137 24. Interrupt Control Functions (Asynchronous) ..... 2-140 25. Character Codes .............................. 3-11 26. J(eyboard Extended Functions .................. 3-14 27. J(eyboard - Commonly Used Functions .......... 3-17 28. Basic Screen Editor Special Functions ........... 3-19 29. DOS Special Functions ........................ 3-19 30. 0-7F Interrupt Vectors ........................ 3-21 31. Basic & DOS Reserved Interrupts (80-3FF) ..... 3-22 32. Reserved Memory Locations (400-5FF) ......... 3-22 x SECTION I. HARDWARE OVERVIEW The IBM Personal Computer has two major elements; a System Unit and a keyboard. In addition, a variety of options are offered including one or two 5-1/4" Diskette Drives with adapter which can be housed inside the System Unit, an IBM Monochrome Display, an 80 CPS Matrix Printer, two display adapters, storage increments to 256 KB, an Asynchronous Communications Adapter, Printer Adapter and a Game Control Adapter. The System Unit is the heart of your IBM Personal Computer system. The System Unit houses the microprocessor, Read-Only Memory (ROM), Read/Write Memory, Power Supply, and System Expansion Slots for the attachment of up to five options. One or two 5-1/4" Diskette Drives can also be mounted in the system Unit providing 160KB of storage each. The System Board is a large board which fits horizontally in the base of the System Unit and includes the microprocessor, 40KB ROM and 16KB memory. The memory can be expanded in 16KB increments to 64KB. The System Board also includes an enhanced version of the Microsoft BASIC-80 Interpreter without diskette functions. The BASIC Interpreter is included in the ROM. The System Board also permits the attachment of an audio cassette recorder for loading or saving programs and data. The System Unit power system is a 63.5 watt, 4 level DC and 120 AC unit. It is a switching regulator design" allowing for light weight and high efficiency. The DC power capacity is designed to support an expanded system. The 5-1/4" Diskette Drive Adapter fits into one of the five System Expansion Slots. This attachment supports two internal drives. The 5-1/4" Diskette Drive Adapter uses write precompensation and a phase lock loop for clock and data recovery. The 5-1/4" Diskette Drive permits the IBM Personal Computer to read, write and store data on 5-1/4" diskettes. Each diskette stores approximately 160KB of data. Two of these drives may be installed internally in the System Unit. The keyboard is attached to the System Unit with a light-weight, coiled cable. The keyboard features 83 keys, and offers commonly used data and word processing functions in a design combining the familiar typewriter and calculator pad layouts. 1-1 A base system requires one of two different display adapters, either a Color/Graphics medium resolution Monitor adapter or a high resolution monochrome alphanumeric adapter with a parallel printer adapter. The Color/Graphics adapter operates at standard television fre- quencies (15,750Hz), allowing attachment to a variety of industry standard monitors, including home TVs with a user supplied RF modulator. The Color/Graphic Monitor adapter supports a variety of modes selected by program control. The adapter supports color or black and white alphanumeric modes with line width of 40 or 80 characters and 25 lines. In the alphanumeric mode there are 256 characters. This adapter provides both a standard composite video and direct drive outputs. In addition, a light pen feature input port is provided. The IBM Monochrome Display is a high resolution green phosphor display offering the personal computer user quality usually found on larger computer systems. The display features an 11-1/2" screen with an anti-glare surface and a variety of highlighting choices. The screen displays 25 lines of 80 characters. It supports 256 different letters, numbers and special characters that are formed in a nine by 14 dot matrix. The IBM Monochrome Display requires the Monochrome Display and Printer Adapter Option. This option installs in one of the System Unit's five System Expansion Slots. The display is powered from the System Unit. The 80 CPS Matrix Printer is a versatile, low cost, quality printer for the IBM Personal Computer. It prints in both directions at a nominal horizontal speed of80 characters per second on continuous-feed, single or mUlti-part paper. The printer features four character sizes (40,66, 80 or 132 characters per line), Power-on Self-test and simple paper loading and ribbon cartridge uppercase and lower case ASCII char- acter set and 64 special graphic characters. The 80 CPS Matrix Printer requires either the Monochrome Display and Printer Adapter or the Printer Adapter. These options install in one of the Systems Unit's five System Expansion Slots. The Printer requires standard 120 volt, 60 Hz power through its own power cord. The printer requires the Printer Cable Option for attachment to the System Unit. 1-2 The 16KB Memory Expansion Kits allow you to increase the memory size of your IBM Personal Computer. The base system comes standard with 16KB of memory. Up to three 16KB Memory Expansion Kits may be installed to increase the memory size to 64 KB. Memory can be further increased to 256KB with additional memory options once these three Expansion Kits are installed. The Expansion Kits plug into the System Board and must be installed sequentially. They do not occupy any of the five System Expansion Slots. The 32KB and 64KB Memory Expansion Options permit you to increase memory capacity beyond 64KB. Multiple 32KB and 64KB Memory Expansion Options may be installed as long as System Expansion Slots are available. A maximum of three 64 KB memory options may be installed for a total of 256KB of memory. The 32KB and 64KB Memory Expansion Options require a System Expansion Slot in the System Unit. The first 64KB on the System Board is required before 32KB and 64KB Memory Expansion Options can be installed. The Asynchronous Communications Adapter provides a channel to data processing or input/output devices outside of your immediate system. These can be connected by telephone using a plug-in modem, or directly by cable when the device is nearby. This option utilizes the RS232C asynchronous (start-stop) interface permitting attachment to a variety of devices including a large "host" computer or another IBM Personal Computer. This option supports 50 to 9600 BPS transmission speeds. One 25 pin "D" shell, male type connector is provided to attach various peripheral devices. A "current loop" interface is located in the same connector, and a jumper block is provided to manually select either the voltage or the current loop interface. The Asynchronous Communications Adapter requires a System Expansion Slot in the System Unit. An external modem is required for telephone line transmission. The Game Control Adapter permits the attachment of user-supplied joysticks or paddles. Two joysticks and up to four paddles may be attached. IBM does not manufacture either the joysticks or the paddles. This option provides connectors for joysticks or paddles and requires a System Expansion Slot in the System Unit. A block diagram of the system is on the following page (1-4). 1-3 System Block Diagram 8088 2081T 3 CH • OSC MAIN • CLK 4 CH 16 BIT PROCESSING • eNTRl OMA TIC UNIT SYSTEM BOARD ROS ROS 16 x 9 READ! 8K x 8 8K x 8 WRITE MEMORY ROS ROS 16KB MEMORY BK x 8 BK x 8 EXPANSION ROS ROS 16KB MEMORY BK x 8 8K x 8 EXPANSION KEYBOARD 16KB MEMORY ATTACHMENT 110 CHANNEL EXPANSION Figure 1. SYSTEM BLOCK OIAGRAM 1-4 SECTION 2. HARDWARE Contents: System Board ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 Power Supply. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-33 IBM Monochrome Display And Printer Adapter. . . 2-37 IBM Monochrome Display. . . . . . . . . . . . . . . . . . . . . . . 2-43 Color/Graphics Monitor Adapter. . . . . . . . . . . . . . . . . 2-45 Printer Adapter and Printer. . . . . . . . . . . . . . . . . . . . . . . 2-65 5-1/4" Diskette Drive Adapter. . . . . . . . . . . . . . . . . . . . 2-89 5-1/4" Diskette Drive.................. ... ....... 2-110 Memory Expansion Options 32KB and 64KB. . . . . . 2-113 Game Control Adapter. . . . . . . . . . . . . . . . . . . . . . . . . . . 2-117 Asynchronous Communications Adapter ... . . . . . . . 2-123 2-1 NOTES 2-2 SYSTEM BOARD The System Board fits horizontally in the base of the System Unit and has dimensions of approximately 8-1/2 inches by 11 inches. The System Board is a multilayer single land-per-channel design, with ground and power internal planes provided. DC power and a signal from the power supply enter the board through two six pin connectors. Other connectors on the board are for attaching the keyboard, audio cassette, and the speaker. Five 62-pin card edge sockets are also mounted on the System Board. The system I/O channel is bussed across these five I/O slots. There are 16 (13 used) Dual In-line Package (DIP) switches mounted on the card which can be read under program control. These switches are used to indicate to the system software what options are installed. They are used to indicate amounts of installed storage, both on the System Board and in the System Expansion slots, type of display adapter installed, and desired operation modes upon power-up; ie, color or black and white and 80- or 40 character lines. Switches are also used to identify when the operating system is to be loaded from diskette, and how many diskette drives are attached. The major elements of the System Board are divided into five major functional areas. They are, the processor subsystem and its support elements, the Read-Only Memory (ROM) subsystem, the Read/Write (R/W) Memory subsystem, integrated I/O adapters, and the I/O channel. All functions are described in detail in this section, except for the I/O channel, which has its own section. Figure 2.0 "System Board Data Flow" page 2-6, illustrates these functional areas. The heart of the System Board is the Intel 8088 microprocessor. This processor is an 8-bit bus version of the 16-bit 8086 processor by Intel. It is software compatible with the 8086 and, thus, supports 16-bit operations including multiply and divide. The processor supports 20 bits of addressing (1 megabyte of storage). The processor is implemented in maximum mode so a co-processor can be added as a feature. The processor is operated at 4.77 Mhz. This frequency is derived from a 14.31818 Mhz crystal which is divided by three for the processor clock and by four to obtain the 3.58 Mhz color burst signal required for color televisions. At the 4.77 Mhz clock rate, the 8088 bus cycles are four clocks of 210 ns or 840 ns. I/O cycles take five 210 ns clocks or 1.05 microsec (m sec). 2-3 The processor is supported by a set of high function support devices providing four channels of 20-bit Direct Memory Access (DMA), three 16-bit timer counter channels, and eight prioritized interrupt levels. Three of the four DMA channels are available on the I/O bus and are provided to support high speed data transfers between I/O devices and memory without processor intervention. The fourth DMA channel is programmed to refresh the system dynamic memory. This is done by programming a channel of the timer counter device to periodically request a dummy DMA transfer. This creates a .memory read cycle which is available to refresh dynamic storage both on the System Board and in the System Expansion slots. All DMA data transfers, except the refresh channel, take five processor clocks of 210 ns or 1.05 ns if the processor ready line is not deactivated. Refresh DMA cycles take four clocks or 840 ns. The three timer/counters are used by the system as follows: Channel 0 is used to time and request refresh cycles from the DMA channel, Channel 2 is used to support the tone generation for the audio speaker, and Channel 1 is used by the system as a general purpose timer providing a constant time base for implementing a time-of-day clock. Each channel has a minimum timing resolution of 1.05 J-tsec. Of the eight prioritized levels of interrupt, six are bussed to the I/O slots for use by feature cards. Two levels are used on the System Board. Level 0, the highest priority, is attached to Channell of the timer counter and provides a periodic interrupt. Level 1 is attached to the keyboard adapter circuits and receives an interrupt for each scan code sent by the keyboard. The Non-Maskable Interrupt (NMI) of the 8088 is used to report memory parity errors. The System Board is designed to support both ROM and ReadIWrite Memory. The System Board contains space for 48K x 8 of ROM or EPROM. Six module sockets are provided, each capable of accepting an 8K x 8 device. Five of the sockets are populated with 40 KB of ROM. This ROM contains the Cassette BASIC interpreter, cassette operating system, Power-on Self-test, I/O drivers, dot patterns for 128 characters inn graphics mode, and a diskette bootstrap loader. The ROM is packaged in 24-pin modules and has an access time of250 ns and a cycle time of 375 ns. The System Board also contains from 16K x 9 to 64K x 9 of Read/ Write Memory. A minimum system would have 16 KB of memory with module sockets for an additional 48 KB. In a cassette version of the system, approximately 4 KB is used by the system leaving approxi- mately 12 KB of user's space for BASIC programs. Additional memory beyond the System Board's maximum of64 KB, is obtained by adding memory cards in the System Expansion slots. 2-4 The memory is dynamic 16K x 1 chips with an access time of 250 ns and a cycle time of 410 ns. All R/W memory is parity checked. The System Board contains circuits for attaching an audio cassette, the serial keyboard, and the speaker. The cassette adapter allows the attachment of any good quality audio cassette via either the microphone or auxiliary inputs. The board has a jumper for either input. This interface also provides a cassette motor control line for transport starting and stopping under program control. This interface reads and writes the audio cassette at a data rate of between 1,000 and 2,000 baud. The baud rate is variable and dependent on data content since a different bit-cell time is used for O's and 1's. For diagnostic purposes, the tape interface can loop read to write to test the board's circuits. The system software blocks cassette data, generates and checks data with a Cyclic Redundancy Check (CRC). The processor also contains the adapter circuits for attaching the serial interface from the keyboard. This generates an interrupt to the processor when a complete scan code is received. This interface can request execution of a diagnostic in the keyboard. Both the keyboard and cassette interfaces are provided via 5-pin DIN connectors, which are right angle mounts on the System Board and extend through the rear panel of the System Unit. The system is provided with a 2-1/4-inch audio speaker mounted inside the System Unit. The System Board contains the control circuits and driver for the speaker. The speaker connects through a 2-wire interface which attaches to a 4-pin header on the System Board. The speaker drive circuit is capable of approximately a 1/2 watt of power. The control circuits allow the speaker to be driven several different ways. First, a direct program control register bit may be toggled to generate a pulse train; second, the output of Channel 2 of the timer counter may be programmed to generate a waveform to the speaker. Third, the clock input to the timer/counter can be modulated with a program controlled I/O Register Bit. All three forms of control may be performed simultaneously. 2-5 System Board Data Flow p , 14,11111 MHZ NPIRO~" H & D rl'~08'----f.~~NM~I~ ~~~~~~~~~~~~~~~~ B2UA READY ~ L~~'~ t------< Jlll "- ~ '- ~ MAIN I--",CL""_--f~~ PROCESSOR B T~~"sZ4' PRESET 74L5144 74LSZ44 A" ADDRESS ADOR BUfFER ~ f---4 BUfFER AUX PROCESSOR SOCKH O-74LS373 ~ AD7 ADDRESS BUFFER i----~it-- DO- 74LS245 ~ AD7 DATA BUfFER ~;ss';ss'§'S~ ~ I-----~ i--.----.;, ~ i-- f- ,..,.,----~ADO- 8259A ~ 110 CS DECODE INTERRUPT CNTRlR ~ r'------------------;, Ir o I 2 ] 4 5 6 7~ LOCAl ADORESS. DATA STATUS, AND CONTROL ~ i--.-----~, f- s------------f J I j.-- f---------i ~ eLK/RESET ~~IlllllIlllll~&l8l~~ij~&l8l~ WAI T ROM cs L -_ _ _ _ _ _ _ _ _ _ WAIT ~_~ --I tb~r~ D[COO( CONTROL EXTERNAL ADDRESS LINES BUSIXAI Figure 2. SYSTEM BOARD DATA flOW (SHEET 1 OF 2) 2-6 System Board Data Flow CONTROL BUS 1 ---j > NL- j.)- ~12V - >- .. 12V- ~ > ---. SPARE 8KX8 ROM SPACE TO '::_{l'- +SV ) > - > > - 'WR SUPPl Y _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _--' PI) > - Figure 2. SYSTEM BOARD DATA FLOW (SHEET 2) 2-7 I/O Channel The I/O channel is an extension of the 8088 microprocessor bus. It is, however, demultiplexed, repowered, and enhanced by the addition of interrupts and Direct Memory Access (DMA) functions. The I/O channel contains an 8-bit bidirectional data bus, 20 address lines, 6 levels of interrupt, control lines for memory and I/O read or write, clock and timing lines, 3 channels ofDMA control lines, memory refresh timing control lines, a channel check line, and power and ground for the adapters. Four voltage levels are provided for I/O card +5 Vdc, - 5 Vdc, + 12 Vdc, and-12 Vdc. These functions are provided in a 62-pin connector with 100 mil card tab spacing. A ready line is available on the I/O channel to allow operation with slow I/O or memory devices. If the channel's Ready line is not activated by an addressed device, all processor generated memory read and write cycles take four 210 ns clock or 840 ns/byte. All processor-generated I/O read and write cycles require five 210 ns clocks or 1.05 m sec/byte. All DMA transfers require five clocks for a cycle time of 1.05 m sec/byte. Refresh cycles are present once every 72 clocks or approximately 15 m sec and require five clocks or approxi- mately 7% of the bus bandwidth. I/O devices are addressed using I/O mapped address space. The channel is designed so that 512 I/O device addresses are available to the I/O channel cards. A channel check line exists for reporting error conditions to the processor. Activating this line results in a NMI to the 8088 processor. Memory Expansion Options use this line to report parity errors. The I/O channel is repowered so there is sufficient drive to power all five System Expansion Slots, assuming two loads per slot. The IBM Option I/O adapters typically use only one load. A graphic illustration of the System I/O Channel and its descriptions are on the following pages. 2-8 I/O Channel Diagram REAR PANEL SIGNAL NAME 1\ SIGN ALNAME GNo - r- Bl Al- roo--- -110 CH CK +RESET ORV i- - +07 +5V i- - +06 -'. +IRDZ r- - +05 -SVoC i- - +04 +oRDZ I- - +03 -lZV I- - +02 RESERVED r- - +01 +lZV I- - +00 GNO I- BID AID - +1/0 CH ROY -MEMW I- - +AEN -MEMR r- - +A19 -lOW I- - +A18 -lOR r- - +A17 -OACK3 r- - +A16 +oRD3 I- - +A15 -oACKl I- - +A14 +oRD1 r- - +A13 -OACKD I- - +A12 CLOCK I- B20 AZD- +All +lAm I- - +A1D +IAD6 I- - +A9 +IAD5 I- - +A8 +IRD4 I- - +A7 +IRD3 I- - +A6 -oACKZ I- - +A5 +T/C r- - +A4 +ALe. I- - +A3 +5V f- - +A2 +OSC I- - +Al NOTE: +GNo - f- B31 A31 - - +AD A description of each signal is on the following pa ges. "- \ COMP ONENT SIDE Figure 3. I/O CHANNEL DIAGRAM 2-9 System Board I/O Channel Description The following is a description of the IBM Personal Computer System Board I/O Channel. All signal lines are TTL compatible. Signal I/O Description OSC 0 Oscillator: This signal is a high speed clock with a 70 nsec. period (14.31818 MHz.) It ha: a 50% duty cycle. CLK 0 Clock: This is the system clock. It is a divide - by - three of the oscillator and has a period of 210 nsec. (4.77 Mhz.) The clock has a 33% duty cycle. RESET DRV 0 Reset Driver: This line is used to reset or initialize system logic upon power-up or during a low line voltage outage. This signal is synch- ronized to the falling edge of clock and is active HIGH. AO-AI9 0 Address Bits 0 to 19: These lines are used to address memory and I/O devices within the system. The 20 address lines allow access of up to 1 megabyte of memory. AO is the Least Significant Bit (LSB) while A19 is the Most Significant Bit (MSB). These lines are gener- ated by either the processor or the DMA Controller. They are active HIGH. DO-D7 I/O Data Bits 0 to 7: These lines provide data bus bits 0 to 7 for the processor, memory, and I/O Devices. DO is the Least Significant Bit (LSB) and D7 is the Most Significant Bit (MSB). These lines are active HIGH. ALE 0 Address Latch Enable: This is provided by the 8288 Bus Controller and is used on the System Board to latch valid addresses from the proces- sor. It is available to the I/O Channel as an indicator of a valid processor address (When used in conjunction with AEN). Processor addresses are latched with the falling edge of ALE. I/O CH CK I -I/O Channei Check: This line provides the CPU with parity (error) information on mem- ory or devices in the I/O Channel. When this signal is active LOW, a parity error is indicated. 2-10 I/OCHRDY I I/O Channel Ready: This line (normally high or "READY") is pulled low ("NOT READY") by a memory or I/O device to lengthen I/O or memory cycles. It allows slower devices to attach to the I/O Channel with a minimum of difficulty. Any slow device using this line should drive it low immediately upon detecting a valid address and a Read or write command. This line should never be held low for any period in excess of 10 clock cycles (2.1 usec.) Machine cycles (I/O or memory) are extended by an integral number of CLK cycles (210 ns). IRQ2-IRQ? I Interrupt Request 2 to ?: These lines are used to signal the processor that an I/O device requires attention. They are prioritized with IRQ2 as the highest priority and IRQ? as the lowest. An Interrupt Request is generated by raising an IRQ line (Low to High) and holding it high until it is acknowledged by the processor (Interrupt Service Routine). lOR 0 -I/O Read Command: This command line in- structs an I/O device to drive its data onto the data bus. It may be driven by the processor or the DMA Controller. This signal is active LOW. lOW 0 -I/O Write Command: This command line instructs an I/O device to read the data on the data bus. It may be driven by the processor or the DMA controller. This signal is active LOW. MEMR -Memory Read Command: This command line instructs the memory to drive its data onto the data bus. It may be driven by the processor or the DMA Controller. This signal is active LOW. MEMW 0 -Memory Write Command: This command line instructs the memory to store the data present on the data bus. It may be driven by the processor or the DMA Controller. This signal is active LOW. 2-11 DRQI-DRQ3 I D MA Request 1 to 3: These lines are asynchro- nous channel requests used by peripheral de- vices to gain DMA service. They are prioritiz- ed with DRQl having highest priority and DRQ3 the lowest. A request is generated by bringing a DRQ line to an active level (HIGH). A DRQ line must be held high until the corresponding DACK line goes active. DACKO- o -DMA Acknowledge 0 to 3: These lines are DACK3 used to acknowledge DMA requests (DRQ1- DRQ3) and to refresh system dynamic mem- ory (DACKO). They are active LOW. AEN o Address Enable: This line is used to degate the processor and other devices from the I/O Channel to allow Direct Memory Access (DMA) transfers to take place. When this line is active (HIGH), the DMA Controller has control of the address bus, data bus, read command lines, (memory and I/O), and the write command lines, (memory and I/O. T/C 0 Terminal Count: This line provides a pulse when the terminal count for any DMA channel is reached. This signal is active HIGH. The following voltages are available on the System Board I/O Channel: +5 Vdc + 5%, Located on 2 connector pins. -5 Vdc + 10%, Located on 1 connector pin. + 12 Vdc + 5%, Located on 1 connector pin. -12 Vdc + 10%, Located on 1 connector pin. GND (Ground), Located on 3 connector pins. 2-12 System Board Component Diagram SYSTEM CASSETTE I/O KEYBOARD I/O EXPANSION I/O SLOTS -_.../' '\ : SYSTEM BOARD POWER O , - J1 J2 J3 J4 J5 , ~ CONNECTION ,, I I P1 ~ p - 0 I - 0 - D - 0 P2 - 0 I :: ~ CLOCK CHIP I - D TRIMMER READ ONLY MEMORY , it1 I~. er:~:CESSOR =2 SOCKET Donun unn :~~1~= :::::~~~~ o00000 00 '''~'''''' UU CONFIGURATION 16-64 KB READ/WRITE o 00000000 DO DO 000 MEMORY" o DDDDDDDDODDDDDD o 00000000 00 DODD D o D~QDD~,~~,~ 00000 SPEAKER OUTPUT MIC OR AUX SElECT Figure 4. SYSTEM BOARD COMPONENT DIAGRAM 2-13 Keyboard The Keyboard is a device separate from the System Unit. It is attached via a serial interface cable approximately 6 feet in length which plugs into the rear of the System Unit. The attaching cable is coiled, like that of a telephone headset, and is a shielded four-wire wire connection. The interface contains power (+ 5 Vdc), ground and two bidirectional signal lines. The cable is permanently attached at the keyboard end and plugs into the System Unit via a DIN connector. The keyboara uses a capacitive technology with a microcomputer (Intel 8048) performing the keyboard scan function. The keyboard is packaged in a low-profile enclosure with a tilt adjustment for 5 degree or 15 degree orientations. The keyboard contains 83 keys laid out in three major groupings. The central portion of the keyboard contains a standard typewriter keyboard layout. On the left side, arranged as a 2x5 block, are 10 function keys. These keys are user-defined by software. On the right is a 16-key, key pad area. This area is, defined by the software but contains legends for the functions of numeric entry, cursor control calculator pad screen edit. The keyboard interface is defined so system software has the maximum flexibility in defining keyboard operations such as shift states of keys, make/break keys, and typematic operation. This is accomplished by having the keyboard return scan codes rather than American National Standard Control Characters (ASCII) codes. In addition, all keys except control keys are typematic and generates both a make and a break-scan code. For example, key 1 produces scan code 01 on make, and code 81 on break. Break codes are formed by adding X '80' to make codes. The keyboard I/O driver can define keyboard keys as shift keys or typematic as required by the application. The microcomputer (Intel 8048) in the keyboard performs several functions including a Power-on Self-test and when requested by the System Unit. This diagnostic CRC checks the microcomputer ROM, tests memory and checks for stuck keys. Additional functions are: keyboard scanning, key debounce, buffering of up to 20 key scan codes, maintaining bidirectional serial communications with the System Unit, and executing the hand shake protocol required by each scan code transfer. A keyboard diagram and table of scan codes are on the following pages. Figure (5) is a block diagram of the keyboard interface on the System Board. 2-14 Keyboard Interface Block Diagram 74LS322 74S74 PAO OH QH 0 PAl OG 0 IROI PA2 OF CLOCK -0 I~ PA3 OE ~ -CLR PM 00 +5V-O -PR PA5 OC PAS OB PA7 OA PB7 --,. -DE -CLR L -6 LSl25 9+5V 4.7KOHM KEYBOARO ~ +5V - 00 ORV OATA -SE GNO- 0 OS SI-P 4 -G ~" "'" .--- 01 LATCH .--- CLOCK CLOCK 0 i 0 CLOCK :J1 LS04 GNO- 0 KEYBOARO CLOCK I. 9 I ORV I r PB 6 r -G LSl25 4.7K OHM +5V PCL K Figure 5. KEYBOARD INTERFACE BLOCK DIAGRAM 2-15 - ~ 0'1 ~ ~ a-o ~ "'1 0.. _.~ ~ 5[EJ1(EJJ I[ 81 DH~J ~ Diu J1 (] i[] J[ DIDiD) []JtJJ[D1DEJO[JEJC[J0u ~ 'i ElIElI U~JDf[]'iEJ'j[]J[]I[]l tJTEJrDI[]rEJIDlu[]~"='i ~T[]r~ID 1 3 TElrElI 'OEl[]EJj fJT[JrDrEJrEJj[lTDTElrDIDl [] fgr~JI[] y[JT~ 6[ElIEl JTu8uIOJ(EJIUI[]IEJIEJtEJ1EJJ[lJIDID llE][DIrJI[]I~JI [] 6[ElIEJJ SOEJuj[ 57 lIOEJDO(]DObJO NOTE 1 NOMENCLATURE IS ON BOTH TOP AND FRONT FACE OF KEYBUTTON AS SHOWN. THE NUMBER TO THE UPPER LEFT DESIGNATES THE BUTTON POSITION. Figure 6. KEYBOARD DIAGRAM Table 1. Keyboard Scan Codes Key Position Scan Code in Hex Key Position Scan Code in Hex 1 01 43 2B 2 02 44 2C 3 03 45 20 4 04 46 2E 5 05 47 2F 6 06 48 30 7 07 49 31 8 08 50 32 9 09 51 33 10 OA 52 34 11 OB 53 35 12 OC 54 36 13 00 55 37 14 OE 56 38 15 OF 57 39 16 10 58 3A 17 11 59 3B 18 12 60 3C 19 13 61 3D 20 14 62 3E 21 15 63 3F 22 16 64 40 23 17 65 41 24 18 66 42 25 19 67 43 26 lA 68 44 27 lB 69 45 28 lC 70 46 29 10 71 47 30 IE 72 48 31 IF 73 49 32 20 74 4A 33 21 75 4B 34 22 76 4C 35 23 77 40 36 24 78 4E 37 25 79 4F 38 26 80 50 39 27 81 51 40 28 82 52 41 29 83 53 42 2A 2-17 Keyboard Interface Connector Specifications REAR PANEl 5 PIN DIN CONNECTOR PIN SIGNAL 1 + Keyboard Clock 2 + Keyboard Data 3 - Keyboard Reset (Not used by keyboard) 4 Ground 5 +5 Volts 2-18 Cassette User Interface The cassette interface control is implemented in software. (See FIRM- WARE Section). An 825 3 timer output is used to control the data to the cassette recorder. This output exits the System Board, at the rear, through pin 5 of a DIN connector. The cassette input data is read by an 8255A-5 Programmable Peripheral Interface (PPI) input port bit. This signal is received through pin 4 of the cassette connector. Software algorithms are used to generate and read cassette data. The casette drive motor is controlled through pins 1 & 3 ofthe cassette connector. The motor on/off is controlled by an 8255A-PPI output port bit. (Port '61H', bit 3). The 8255A address and bit assignments are defined in the I/O Address Map page. On the following pages are read, write, and motor control block diagrams. Cassette Jumpers A 2x2 Berg Pin and Jumper are used on the cassette Data Out line. The jumper will allow the Data Out line to be used as a microphone input (75 mv.) when the jumper is placed across M and C pins. An auxiliary input is available when the jumper is placed across the A and C pins. The auxiliary input provides a .68 volt input to the recorder. Refer to System Board Component Diagram page (2-13) for cassette jumper location. M A M A JUMPER DIAGRAM Mike· 75 Mv. Aux·O.68V Circuit Block Diagrams GND +5V CASSETTE DATA IN -5V 1 DATA FROM CASSETTE GND SI LICON DIODE VIR=.4V CATHODE RECORDER EARPHONE JACK GND Figure 7. CASSETTE INTERFACE READ HARDWARE 2-19 +5V 74LS38 I 3.9K OHM 8253 TIMER #2 L O R OUTPUT OR j. o T 4.7K OHM R j. 0 .678V TO AUX INPUT I 1.2K OHM R 0 .I.. .075V T TO MIC 150 OHM INPUT R I GNO Figure 8. CASSETTE INTERFACE WRITE HARDWARE +5V I 4.7 +5V I KOHM I + 5 V - CLAMP SN75475 RELAY COIL S N/O 74LS38 C ------4 CASSETTE vec - MOTOR OR CONTROL MOTO~O IN OUT COIL ON o ~ VSS COM GNO Figure 9. CASSETTE MOTOR CONTROL 2-20 Cassette Interface Connector Specifications REAR PANEL · _.c~[[[ut ~ q@ ~ (S) CASSETTE 5 PIN DIN CONNECTOR PIN SIGNAL ELECTRICAL CHARACTERISTICS* 1 Motor Control Common from Relay 2 Ground 3 Motor Control 6 VDC; 1A (Relay N.O.! 4 Data In 500nA at ±13V - at 1,000·2,000 Baud 5 Data Out (Mic or Aux) 250 IlA at } .68V or ** 75mv *AII voltages and currents are maximum ratings and should not be exceeded. **Data out can be chosen using a jumper located on planar. (AU X --+ .68V or MIC --+ 75 mV). Interchange of these voltages on the cassette recorder could lead to damage of recorder inputs. 2-21 Speaker Interface The sound system contains a small permanent magnet 2-1/4" speaker. The speaker can be driven from one or both of two sources. The sources are: 1. An 8255A-5 PPI output bit. The address and bit are defined in the I/O Address Map pages 2-23 and 2-24. 2. A timer Channel Clock out where the output is programmable within the functions of the 8253-5 timer with a 1.19 Mhz clock input. The timer gate is also controlled by an 8255A-5 PPloutput port bit. Address and bit assignment are in the I/O Address Map pages 2-23 and 2-24. PPI BIT 1, I/O ADDR x'0061' 1.19 MHz LOW TO AND DRV PASS CLOCK SPEAKER TIMER CLKOUT 2 FILTER IN 2 PPI BIT 0, I/O ADDRESS X'0061' Figure 10. SPEAKER DRIVE SYSTEM BLOCK DIAGRAM Channel 2 (Tone generation for Speaker! GATE 2 - Controlled by 8255A-5 PPI Bit (See I/O Map) ClK IN 2 -1.19318 Mhz OSC ClK OUT 2 - Used to drive Speaker - Used to write data on the Audio Cassette Speaker Connection - 4 Pin Berg Connector, Refer to System Board Diagram page 2-13 for speaker connection. PIN FUNCTION 1 DATA 2 KEY 3 GROUND 4 +5 VOLTS 2-22 I/O Address Map HEX RANGE 9 8 7 6 5 4 3 2 1 0 DEVICE ~O-OF 0 0 0 0 0 Z A3 A2 Al AO DMA CHIP 8237-2 20-21 0 0 0 0 1 Z Z Z Z AO INTERRUPT 8259A .40-43 0 0 0 1 0 Z Z Z Al AO TIMER 8253-5 r60-63 0 0 0 1 1 Z Z Z Al AO PP18255A-5 ·80-83 0 0 1 0 0 Z Z Z Al AO DMA PAGE REGS J AX 0 0 1 0 1 NMI MASK REG CX 0 0 1 1 0 RESERVED EX 0 0 1 1 1 RESERVED 3F8-3FF 1 1 1 1 1 1 1 A2 Al AO TP RS-232-C CD 3FO-3F7 1 1 1 1 1 1 0 A2 Al AO 51/4" DRV ADAPTER 2F8-2FF 1 0 1 1 1 1 1 A2 Al AO RESERVED 378-37F 1 1 0 1 1 1 I Z Al AO PARALLEL PRTR PRT 3DO-3DF I 1 I 1 0 1 A3 A2 Al AO CD LD R/G RAPH I CS ADAPTE R 278-27F 1 0 0 I 1 1 1 Z Al AO RESERVED 200-20F 1 0 0 0 0 0 A3 A2 Al AO GAME I/O ADAPTER .~3BO-3BF 1 1 1 0 1 I A3 A2 Al AO IBM MONOCHROME DISPLAY PARALLEL PRINTER ADAPTER Z = Don't Care, i.e., Not in Decode * At power on time, the Non Mask Interrupt NMI into the SOSS is masked off. This mask bit can be set and reset via system software as follows: Set mask: write X'SO' to I/O Address X'AO' (enable NMI) Clear mask: write X'OO' to I/O Address X'AO' (disable NMI) 2-23 I/O Address Map PAD +KBO SCAN CODE IPL 51/4 DISKETTE DRIVE (SW1-l) I 1 1 RESERVED (SWI-2) N 2 2 SYS. BD. READ/WRITE MEMORY SIZE * (SWI-3) X'0060' P 3 3 SYS. BD. READ/WRITE MEMORY SIZE * (SWI-4) U 4 4 OR +DISPLAY TYPE 1 (SWI-5) T 5 5 +DISPLAY TYPE 2 (SWI-6) 6 6 ND. OF 51/4 DRVS (SWI-71 7 7 NO. OF 5 1/4 DRVS (SW1-S) PBO +TIMER 2 GATE SPEAKER 0 1 +SPEAKER DATA U 2 +(REAO READ/WRITE MEMORY SIZE) OR (READ SPARE KEY) X'0061' T 3 +CASSETTE MOTOR OFF P 4 -ENABLE READ/WRITE MEMORY U 5 -ENABLE I/O CH CK T 6 -HOLD KBD CLK LOW 7 -(ENABLE KBD) DR + (CLR KBD & ENABLE SENSE SW'S) PCO I/O READ/WRITE MEMORY (SW2-llj ] [ SPARE KEY (SW2-5) I 1 I/O REAO/WRITE MEMORY (SW2-2) BINARY OR N 2 I/O READIWRITE MEMORY (SW2-3) VALUE X'0062' P 3 I/O READIWRITE MEMORY (SW2-4) X 32KB U 4 +CASSETTE DATA IN T 5 +TlMER CHANNEL2 OUT 6 +110 CHANNEl CHECK 7 +READIWRITE MEMORY PCK X'0063' eMD/MODE REGISTER MODE REG VALUE 4 3 1 1 X'gg' PA3 PA2 AMOUNT OF MEMORY SWI-4 SWI-3 LOCATED ON SYS. BD. o o 16K BYTES o 32K BYTES 1 4SK BYTES 64K BYTES PA5 PA4 TYPE OF DISPLAY SWI-6 SWI-5 o o RESERVED o 1 COLOR CARD 40X25 (BW MODE) 1 o COLOR CARD SOX25 (BW MODE) 1 1 IBM MONOCHROME DISPLAY (SO X 25) PA7 PA6 NUMBER OF 5-1/4" DRIVES SW1-S SWI-7 IN SYSTEM o o 1 o 1 2 1 o 3 4 8255A - 110 BIT MAP NOTE: PA bit~O implies switch "ON". PA bit~1 implies switch "OFF". 2-24 System Memory Map X'OOOOO' 16 TO 64KB ON SYSTEM 265KB R/W MEMORY BOARD PRESENT SYSTEM I/O CHANNEL MAX MEMORY ADDED MEM MAX 192KB 3/4 MEG MEMORY ADDRESS FUTURE SPACE EXPANSION 384K MEMORY FUTURE EXPANSION 128KB 128KB RESERVED GRAPHIC/DISPLAY BUFFER EXPANSION MEMORY 216KB 256KB ROM ADDRESS SPACE 40KB BASE SYSTEM ROM X'FFFFF' Figure 11. SYSTEM MEMORY MAP 2-25 System Memory Map (Increments of 16KB) START ADDRESS: FUNCTION: DECIMAL HEX 0 00000 16K 04000 16-64 KB READ/WRITE MEMORY 32K 08000 ON SYSTEM BOARD 48K OCOOO 64K 10000 80K 14000 96K 18000 112K 1COOO 128K 20000 UP TO 192 KB 144K 24000 MEMORY IN I/O 160K 28000 CHANNEL 178K 2COOO 192K 30000 208K 34000 224K 38000 240K 3COOO 256K 40000 272K 44000 288K 48000 304K 4COOO 320K 50000 336K 54000 352K 58000 368K 5COOO 384K 60000 400K 64000 416K 68000 384 KB FUTURE 432K 6COOO R/W MEMORY EXPANSION 448K 70000 IN I/O CHANNEL 464K 74000 480K 78000 496K 7COOO 512K 80000 528K 84000 544K 88000 560K 8COOO 576K 90000 592K 94000 608K 98000 624K 9COOO Figure 12. SYSTEM MEMORY MAP (INCREMENTS OF 16KB) (SHEET 1 OF 2) 2-26 System Memory Map Cont. START ADDRESS: FUNCTION: DECIMAL HEX 640K ADOOO RESERVED 656K A4000 672K A8000 688K ACOOO 112 KB 704K BOOOO MONOCHROME GRAPH ICS/DiSPLA Y VIDEO BUFFER 720K B4000 736K B8000 COLOR/GRAPHICS 752K BCOOO 768K COOOO 784K C4000 800K C8000 816K CCOOO 832K 00000 848K 04000 192 KB MEMORY 864K 08000 EXPANSION AREA 880K OCOOO 896K EOOOO 912K E4000 928K E8000 944K ECOOO 960K FOOOO RESERVED 976K F4000 48 KB BASE 992K F8000 SYSTEM ROM 1.008M FCOOO Figure 12. SYSTEM MEMORY MAP (16KB) (SHEET 2) 2-27 System Board and Memory Expansion Switch Settings On the following four pages are graphic illustrations of switch settings. These are necesary for the system to address components attached, and to specify the amount of memory installed both on the System Board and in the System Expansion Slots. Refer to the System Board Component Diagram (page 13) for DIP switch locations. SWITCH 1 o 1 2 3 4 5 6 7 8 "" fDuDDDDDD POSITION FUNCTION \ 1-7-8 NUMBER OF 5%" DISKETTE DRIVES INSTALLED; PAGE 2-29 2 UNUSED-MUST BE ON (RESERVED FOR CO-PROCESSOR) 3-4 AMOUNT OF MEMORY ON SYSTEM BOARD; PAGE 2-30 5-6 TYPE OF MONITOR YOU ARE USING; PAGE 2-29 SWITCH 2 0'2 34 5678 \ fDDDDUUU~ POSITION FUNCTION \ 1-2-3-4 AMOUNT OF MEMORY OPTIONS INSTALLED; PAGE 2-30 5-6-7-8 ALWAYS IN THE OFF POSITION 2-28 5-1/4" Diskette Drives Switch Settings SWITCH 1 0· DRIVES t ~DnDOO~~ 12345678 I - DRIVE r~DDDDD~~ Monitor Type Switch Settings SWITCH 1 '"" t DOOO~~OO (40 x 25)·TELEVISION OR MONITOR no3 D4 rl~rlo8 i~ 0' U ~UU "- COLOR/GRAPHICS MONITOR ADAPTER i~ 0' 000~nD7 2 3 4 (80x25)-HIGH D8 RESOLUTION MONITOR U~ ~1~;L2:~I~~ :~T~O;~:EOSME i~ 0' 000nno7 OF DISPLAY ADAPTERS. 2 ~~ 3 04 8 " NOTE: SOME TELEVISIONS AND MONITORS OPERATED IN (80 x 25) MODE MAY HAVE CHARACTER LOSS. 2-29 System Board Memory Switch Settings SWITCH 1 SWITCH 2 12345678 12345678 32KB f DD~[jnnDD tuu[j[jDDDD 48KB tOD~DOOOO t ~~~~OOOD 64KB f DO~~OOOO t~~~~ODDD 12345678 12345678 fDD~~DDDD f~u[jLJnnDD 96 KB tDU~~DDDD t[j~uuDDDD 12345678 12345678 128 KB 160 KB tDowQOOOO fW~~~OODQ 192KB tOD~~OOOO f~~Q~UOOD 12345678 12345678 224 KB t[JnW~DDnD t~uw~nDDD ' "'" tm~~omo t~[JU~Dm[ 2-30 32/64KB Memory Expansion Option Switch Settings Note: Positions 6-7-8 must always be ON. The sequence shown below must be followed to allow the system to address the memory properly. 32 KB t~u~~~DDD 12345678 96 KB 64 KB 128 K8 t~~~~~ooo 32KB 32KB 64KB 32KB 32 KB 32 KB 32 KB 12345678 12345678 12345678 160 KB t~u[j~uDDD t [j[j[j~QDDD t[j[j~u[jDDD 64KB 64KB 64 KB 32 KB 32 KB 12345678 12345678 12345678 192 KB tu~u~~DDD t[j[j~~[jDDD t[j~~u~DDD 64 KB 64 KB 32 KB 12345678 12345678 12345678 224 KB t[j[ju~[jDDD t[j~~~~DDD t~~~~uDDD 64 KB 64 KB 64 KB 12345678 12345678 12345678 256 KB tu~~~uDDD t[j[j~[j~DDD rn~W~~DUU 2-31 NOTES 2-32 Power Supply The system DC power supply is a 63.5 watt, 4 voltage level switching regulator. It is integrated into the System Unit and supplies power for the System Unit, its options, and the keyboard. The supply provides 7 amps of +5 Vdc, +5% 2 amps of + 12Vdc, +5% 300 rna of -5Vdc, +10% and 250 rna of -12 Vdc, +10%. All power levels are regulated with overvoltage and over current protection. The input is 120 Vac and fused. DC over-load or over-voltage conditions exist, the supply will automatically shut down until the condition is corrected. The supply is designed for continuous operation at 63.5 watts. The System Board takes approximately 3 amps of +5 Vdc thus allowing approximately 4 amps of 5 Vdc for the adapters in the System Expansion Slots. The + 12 Vdc power level is designed to power the two internal 5-1/4" Diskette Drives and the system's dynamic memory. It is assumed that only one drive motor is active at a time. The -5 Vdc level is used for memory bias voltage and analog circuits in the diskette adapter phase lock loop. The + 12 Vdc and -12 Vdc are used for powering the serial interface card EIA drivers and receivers for the Asynchronous Communications Adapter. All four power levels are bussed across the five System Expansion Slots and available for option adapter. The IBM Monochrome Display is self-powered. However, the high resolution display receives its AC power from the System Unit power system. It is switched on and off with the power switch, which saves a wall outlet. The AC output for the display is a nonstandard connector, so only the AC high resolution Display can use this AC port. 2-33 Power Supply Location The Power Supply is located at the right rear area ofthe System Unit. It supplies operating voltages to the System Board, IBM Monochrome Display, annd provides two seperate connections for power to the 5- 1/4" Diskette Drives (if installed). The nominal power requirements and output voltages are listed on the following tables: Input Requirements Voltage VOLTAGE @ 60 Hz NOMINAL MINIMUM MAXIMUM Vac Vac Vac 120 104 127 Frequency 60 Hz +/- .5 Hz Current 2.5 AMPS MAX @ LOW LINE INPUT VOLTAGE OF 120 VAC 60 HZ DC Output VOLTAGE CURRENT REGULATION Vdc AMPS TOLERANCE NOMINAL MIN MAX ±% -% + 5.0 2.3 7.0 5 4 - 5.0 0.0 0.3 10 8 +12.0 0.0 2.0 5 4 -12.0 0.0 0.25 10 9 AC Output VOLTAGE CURRENT VOLTAGE Vac AMPS LIMITS Vac NOMINAL MIN I MAX MIN T MAX 120.0 0.0 I .75 101.0 I 130.0 2-34 §~~ "'0 Q.e: CD 0 0' g.'8 () '0 ~ ('I) ~=~ '"t S'(JQ ~ CIl () = Vl ~ PIN 4, + 5VDC t:l 5%" DISKETTE DRIVE PIN 3, + 5VDC RTN ~ S'o ~ POWER CONNECTORf ~PIN 2, +12 VDC RTN CDS"5 ~ CIlg. CD ~PIN 1,+12VDC 5 CD S '<- ~'O'"I (1 ~~ 00 c::r~t:I g. = 0 = ~ OCllCD ('I) ::E s:: .. '0,< C/.l (") PIN 6, +5VDC '0 CIl ,..... l~ PIN 5, +5VDC -<()!3S" ~ c:Il ,\ : - - - o t:xj :.> o <« --------- / /o aa = 50 o ..... ~CIl C- "'0 . ...... ,..,- = l:J"N ~ o ® o KEY PIN 4, ·12VDC CD '0 :.> PIN 3.+12VDC '0 S· c:Il ~ PIN 2, KEY PIN 1, PWR GOOD ~. !3 .... c:Il (JQ oe, = POWER ON/OFF 120 VAC ·IBM DISPLAY SYSTEM UNIT POWER CONNECTOR POWER CONNECTOR t:I CD (INTERNALLY SWITCHEO) 3 ::tI() ~§ ,..... ('I) s·() = Figure 13. POWER SUPPL Y AND CONNECTORS ~CD t:J ~ t:lS" CIl '"I VI :nntMOHlfH Important Operating Characteristics Over Voltage/Current Protection PRIMARY (INPUT) VOLTAGE NOMINAL RATING TYPE PROTECTION AMPS VAC 120 60 Hz FUSE TYPE 2 SOC SD4 2AMPS Power On/Off Cycle: When the supply is turned off for a maximum of S seconds, and then turned on, the power good signal will be regenerated. Signal Requirements The power good signal indicated that there is adequate power to continue processing. If the power goes below the specified levels, the power good signal triggers a system shut-down. The Power Supply. Provides a power good signal out, to indicate the presence of the + / - SV and + / -12V outputs are above the sense level defmed in the chart below, the power good signal is an up level (2.4V to S.SV), TTL compatible and capable of sourcing 60 VA. When any of the four sensed output voltages is below its sense level voltage as defined in the chart below, the power good signal is down level (OV to O.4V), TTL compatible and capable of sinking 500 VA. The power good signal (after all levels of the output voltage are good) has a tum on delay of 100 MS, but no greater than SOO MS. The sense levels of the +/-SV and +/-12V outputs are: SENSE VOLTAGE OUTPUT MIN NOMINAL MAX +5V +3.7 +4.0 +4.3 -5V -3.7 -4.0 -4.3 +12V +8.5 +9.6 +10.5 -12V -8.5 -9.6 -10.5 2-36 IBM Monochrome Display and Parallel Printer Adapter This adapter has dual functions. The first is to provide the interface to the IBM Monochrome Display. The second function is a parallel interface for the IBM 80 CPS Matrix Printer. The monitor interface is designed around the Motorola 6845 CRT Controller module. There are 4K bytes of static memory on the card which are used for the display buffer. The memory is dual ported and may be accessed directly by the CPU. No parity is provided on the display buffer. A block diagram of the Monochrome Display function in on page 2-38. The characteristics of the design are listed below: • 80x25 Screen • Direct Drive Output • 9x14 Character Box • 7x9 Character • 18 Khz Monitor • Character Attributes The adapter supports 256 character codes. An 8K byte character generator contains the fonts for the character codes. The characters, values, keystrokes and screen characteristics are tabled in Appendix C. Of Characters, Keystrokes and Color. Note: This Adapter when used with a display containing P39 Phospor, will not support a light pen! Parallel Interface Description This topic is discussed in full on pages 2-65 through page 2-69. 2-37 IBM Monochrome Display Adapter Block Diagram (10) (10) • (12) CPUAooR MEMORY 2KMEMORY 2KMEMORY ADDRESS - CHARACTER (11) ,........ MUX CODE ATTRIBUTE (S) , ,~ CPUoATA --.. DATA BUS , (S) GATING (S) CHARACTER ~LOCI ,It BDO-7 MA OCTAL LATCH r -- I OCTAL LATCH 1 ~ ~ I RA CHARACTER GENERATOR ATTRIBUTE DECODE (4) AD MC6S45 CHIP SELECT --- --- CRTC , DOTCLK , TIMING SIGNALS --- SHIFT I 1 REGISTER VIDEO SOOTS PROCESS -. LOGIC r HSYNC. VSYNC. CURSOR. DlSPEN CHARACTER , ~ CLOCK MONITOR DIRECT DRIVE OUTPUTS Figure 14. IBM MONOCHROME DISPLAY ADAPTER BLOCK DIAGRAM 2-38 System Channel Interface Lines Used This card uses the address and data bus, memory and I/O read/write signals, reset, I/O Ready, I/O Clock, and IRQ7. Loads Where possible, only one "LS" load is on the signals present at the I/O slot. Some of the address bus lines have two "LS" loads. No signal has more than two "LS" loads. Special Timing At least one wait state will be inserted on all memory and I/O accesses from the CPU. The duration of the wait-state will vary because the CPU/monitor access is synchronized with the character clock on this adapter. To insure proper initialization of the attachment, the first instruction issued to the card must be to set the high resolution bit of the monitor output Port 1. (OUT PORT 3B8 = OIR). A CPU access to this adapter must never occur if the high resolution bit is not set. System configurations which have two display adapter cards must insure that both adapters are properly initialized after a power on reset. Damage to either display may occur if not properly initialized. Data Rates For the IBM Monochrome Display Adapter, two bytes are fetched from the display buffer in 553 ns providing a data rate of 1.8M bytes/ second. Interrupt and DMA Response Requirements • The display buffer can be written into, or read from using DMA. • The parallel interface uses the +IRQ7 line. Interrupt becomes active when the acknowledge input is low, and interrupts are enabled via the control port. 2-39 Modes of Operation The IBM Monochrome Display and Printer Adapter supports 256 character codes. In the character set are alphanumerics and block graphics. Each character in the display buffer has a corresponding character attribute. The character code must be an even address and the attribute code must be an odd address in the display buffer. 7 6 5 4 3 2 o CHARACTER CODE EVEN ADDRESS (M) 7 6 5 4 3 2 0 ATTRIBUTE CODE BL R G B R G B I I ODD ADDRESS (M+1) I -t:: FOREGROUND INTENSITY BACKGROUND ...~ BLINK The adapter decodes the character attribute byte as defined above. The BLINK and INTENSITY bits may be combined with the FORE- GROUND and BACKGROUND bits to further enhance the char- acter attribute functions listed below. BACKGROUND FOREGROUND FUNCTION R G B R G B 0 0 0 0 o 0 NON DISPLAY 0 0 0 0 0 1 UNDERLINE 0 0 0 1 1 1 WHITE CHARACTER/ BLACK BACKGROUND 1 ;1 1 000 REVERSE VIDEO I If 2-40 Programming Considerations Programming the 6845 CRT Controller The following table summarizes the 6845 Internal Data Registers and their functions and parameters. For the IBM Monochrome Display, the values in the table must be programmed into the 6845 to insure proper initialization of the device. Table 2. 6845 INITIALIZATION PARAMETERS REGISTER REGISTER PROGRAM 80x25 # FILE UNIT MONOCHROME RO HORIZONTAL TOTAL CHARACTERS 61H Rl HORIZONTAL DISPLAYED CHARACTERS 50H R2 HSYNC POSITION CHARACTERS 52H R3 HSYNC WIDTH CHARACTERS FH R4 VERTICAL TOTAL CHAR ROWS 19H R5 VTOTAL ADJUST SCAN LINE 6H R6 VERTICAL DISPLAYED CHAR ROW lSH R7 VSYNC POSITION CHAR ROW 19H R8 INTERLACE MODE --- 02 R9 MAX SCAN LINE ADDRESS SCAN LINE DH Rl0 CURSOR START SCAN LINE BH Rll CURSOR END SCAN LINE CH R12 START ADDRESS (H) --- OOH R13 START ADDRESS (Ll --- OOH R14 CURSOR (H) --- DOH R15 CURSOR (Ll --- DOH R16 RESERVED --- --- R17 RESERVED --- --- Sequence of Events The first command issued to this attachment must be to output to PORT 3B8, hex 01, to set high resolution mode. If the high resolution mode is not set, an infinite CPU wait-state will occur! Memory Requirements The attachment has 4K bytes of memory which is used for the display buffer. The memory supports one screen of 25 rows of 80 characters, plus a character attribute for each display character. No parity is provided on the memory. No system Read/Write memory is required for the monochrome adapter portion. The display buffer starts at address 'BOOOO'. 2·41 DMA Channels The display buffer will support a DMA operation, however CPU wait-states will be inserted during DMA. Interrupt Levels Interrupt Level 7 is used on the parallel interface. Interrupts can be enabled or disabled via the Printer Control Port. The interrupt is a high level active signal. I/O Address and Bit Map The table below breaks down the functions of the I/O Address decode for the card. The I/O address decode is from '3BO' through '3BF'. The bit assignment for each I/O address follows: I/O Address Function 3BO Not Used 3Bl Not Used 3B2 Not Used 3B3 Not Used 3B4 6845 Index Register 3B5 6845 Data Register 3B6 Not Used 3B7 Not Used 3B8 CRT Control Port 1 3B9 Reserved 3BA CRT Status Port 3BB Reserved 3BC Parallel Data Port 3BD Printer Status Port 3BE Printer Control Port 3BF Not Used The 6845 Index and Data Registers are used to program the CRT controller to interface to the high resolution Monochrome Display. • CRT Output Port 1 (I/O Address '3B8') Bit 11= Function o +high resolution mode 1 Not used 2 Not used 3 + video enable 4 Not used 5 + enable blink 6,7 Not used 2-42 • CRT Status Port (I/O Address '3BA') Bit Function o + Horizontal Drive 1 Reserved 2 Reserved 3 +B/W Video IBM Monochrome Display The high resolution IBM Monochrome Display unit attaches to the System Unit via two cables of approximately 3' (914 mm) in length. One cable is a signal cable which contains direct drive interface from the IBM Monochrome Display and Printer Adapter. The second cable provides AC power to the display from the System Unit. This allows the System Unit power ON/OFF switch to also control the display unit. An additional benefit is a reduction in the requirements for wall outlets to power the system. The monitor contains an 12" (305 mm) diagonal 90° deflection CRT. The CRT and analog circuits are packaged in an enclosure so the display may either sit on top of the System Unit or on a nearby table top or desk. The unit has both brightness and contrast adjustment controls on the front available to the operator. Operating Characteristics Screen High persistance green phosphor (P 39) with an etched surface to reduce glare. Unit displays an 80 character by 25 line screen with a 9 dot wide by 14 dot tall character box. Video Signal Maximum video bandwidth of 16.27 Mhz. Vertical Drive Screen refreshed at 50 Hz with 350 vertical lines of resolution and 720 lines of horizontal resolution. Horizontal Drive Positive level TTL compatible frequency, 18.432 Khz. 2-43 IBM Monochrome Direct Drive Interface and Pin Assignment REAR PANEl 9 PIN "0" SHELL CONNECTO o • • • •• •• • o At Standard TTL Levels Ground 1 Ground - 2 Not Used 3 Not Used 4 IBM IBM Monochrome Not Used 5 Monochrome Display and Display ,... + Intensity 6 Parallel Printer Adapter ...., + Video 7 .... + Horizontal 8 ....... - Vertical 9 NOTE: Signal voltages are 0 - .6 Vdc at down level +5 Vdc at high level 2-44 Color/Graphics Monitor Adapter The Color/Graphics Monitor Adapter is designed to attach a wide variety of TV frequency monitors and TV sets (user-supplied RF modulator required for TVs). It is capable of operating in black and white or color, and provides three video interfaces; a composite video port, a direct drive port, and connection interface for driving a user supplied RF modulator. In addition, a light pen interface is provided. The adapter has two basic modes of operation; alphanumeric (NN) and all points addressable graphics (APA). Additional modes are available within NN and APA modes. In A/N mode, the display can be operated in a 40x25 mode for low resolution monitor and TVs or 80x25 mode for high resolution monitors. In both modes, characters are defined in an 8x8 box and are 5x7 with one line of descender for lowercase (both uppercase and lowercase characters are supported in all modes). In black and white mode, the character attributes of Reverse Video, Blinking and Highlighting are available. In color mode, there are 16 foreground colors and 8 background colors available per character. In addition, blinking on a per character basis is available. The adapter card contains 16KB of storage; thus, for a 40x25 screen, 1000 bytes are used to store character information and 1000 bytes are used for attribute/color information. This means that up to 8 pages of screens can be stored in the adapter memory. Similarly, in an 80x25 mode, 4 pages of display screen may be stored in the adapter. The full 16KB storage on the display adapter is directly addressable by the processor allowing maximum software flexibility in managing the screen. In A/N color modes, it is also possible to select the screen border color. One of 16 colors may be selected. 2-45 In APA mode, there are two resolutions available; 320x200 and 640x200. In the 320x200, each (picture element) pel may have one of four colors. The background color (color 0) may be any of the 16 possible colors. The remaining 3 colors come from one of the two software selectable palettes. One palette contains red/green/brown, the other contains cyan/magenta/white. The 640x200 mode is only available in black and white since the full 16KB of storage is used to define the on or off state of the pel. The adapter operates in noninterlace mode at either 7 or 14 megahertz (Mhz) video bandwidth depending on the mode of operation selected. In NN mode, characters are formed from a ROM character generator. The character generator contains dot patterns for 256 characters. The character set contains the following major grouping of characters. Sixteen special characters for game support, 15 characters for support of word processing editing functions, the standard 96 ASCII graphic set, 48 characters to support foreign languages, 48 characters for business block graphics allowing drawing of charts, boxes and tables using single and double lines, 16 of the most often used Greek characters, and 15 of the most often used scientific notation characters. The Color/Graphics Monitor Adapter function is packaged on a single card which fits into one of the five System Expansions Slots on the System Board. The direct drive and composite video ports are right- angle mounted connectors at the rear of the adapter and extend through the rear panel of the System Unit. The display adapter is implemented using a Motorola 6845 CRT controller device. This adapter is highly programmable with respect to raster and character parameters. Thus, many additional modes are possible with clever programming of the adapter. A block diagram of the Color/Graphics Adapter is on the following page. 2-46 () CPU ADDRESS ADDRESS LATCH DISPLAY BUFFER (16K .-- INPUT BUFFER CPU DATA - 0 0 ~ BYTESI 0""'t ~ "0 l 4 OUTPUT LATCH t--- =- ..... (') ADDRESS DATA DATA til ~ CPU DATA ~ 6845 CRTC LATCH f--- LATCH LATCH s: 0 t -,. GRAPHICS SERIALIZER f-----. ::s..... ,--. COLOR 1-+ f""t- ,.. ENCODER r---+ 0 ""'t I CHARACTER ALPHA 1-+ > (l. GEN. RDS ~ SER IALIZER t-- ~ "0 f""t- ttl ~ PALETTE! ""'t OVERSCAN L COMPOSITE HORIZ, VERT - ~ 0 (') :;:;- MODEL TIMING COLOR GENERATOR f-----. -+ --. GENERATOR 0 CONTROL & CONTROL ..... ~ (fQ ""'t ~ N Figure 15. COLOR/GRAPHICS MONITOR ADAPTER BLOCK DIAGRAM 9 J:.. -..J )HYMOHYH Major Components Definitions Motorola 6845 CRT Controller This device provides the necessary interface to drive a raster scan CRT. Mode Set And Status Registers This is a general purpose programmable I/O register. It has I/O points which may be individually programmed. Its function in this attachment is to provide mode selection (page 2-49 and 2-50) and color selection in the medium resolution color graphics mode (page 2-51.) Display Buffer The Display Buffer resides in the CPU address space starting at address X'B8000'. It provides 16K bytes of dynamic read/write memory. A dual-ported implementation allows the CPU and the graphics control unit to access this buffer. The CPU and the CRT control unit have equal access to this buffer during all modes of operation except in high resolution alphanumeric mode. In this mode the CPU should access this buffer during the horizontal retrace intervals. The CPU may however, write to the required buffer at any time, but a small amount of display fetches will result if not during retrace intervals. Character Generator This attachment utilizes a ROM character generator. It consists of 8K bytes of storage which cannot be read/written under software control. This is a general purpose ROM character generator with three different character fonts. Two character fonts are used on this card (a 7x7 double dot and 5x7 single dot), selected by a cardjumper. No jumper gives a 7x7 double dot, with a jumper a single dot font is selected. Timing Generator This block generates the timing signals used by the 6845 CRT controller and by the dynamic memory. It also resolves the CPU/ graphic controller contentions for accessing the Display Buffer. Composite Color Generator The logic in this block generates base band video color information. 2-48 Modes of Operation There are two basic modes of operation, 'Alphanumeric' and 'Graphics'. Each of these modes provide further options in both color and black-and-white. The following text describes each mode of operation. Alphanumeric Mode Alphanumeric Display Architecture Every display character position is defined by two bytes in the regen buffer (part of display adapter, not system memory). Both the color and the black and white display adapter use this 2 byte character/attribute format. DISPLAY CHAR CODE BYTE ATTRIBUTE BYTE 6 4 3 6 4 Attribute Byte Definition ATTRIBUTE BYTE 7 6 5 4 3 2 o B R G B I R G B ATTRIBUTE FUNCTION FG BACKGROUND FOREGROUND NORMAL B 0 0 0 I 1 1 1 REVERSE VIDEO B 1 1 1 I 0 0 0 NON DISPLAY (BLK) B 0 0 0 I 0 0 0 NON DISPLAY (WHITE) B 1 1 1 I 1 1 1 I = HIGH LIGHT FOREGROUND (CHAR) B= BLINK FOREGROUND (CHAR) Color TV • Display up to 25 rows of 40 characters each • Maximum of 256 characters • Requires 2000 bytes of Read/Write Memory (on the adapter) • 8x8 character box • 7x7 double dotted characters (one descender) • Character attributes (one for each character) 2-49 7 6 543 2 1 0 7 6 543 2 1 0 CHARACTER CODE ATTRIBUTE CODE EVEN ADDRESS (M) ODD ADDRESS (M+1) ATTRIBUTE BYTE DEFINITIONS R: Red 76543210 G: Green B: Blue I: Intensity B II R G BI Foreground Color Background Color Blinking Note: The starting address of the display buffer must be an even location. Color Monitor (with Direct Drive input capability) Display up to 25 rows of 80 characters each Requires 4000 bytes of Read/Write Memory (on the adapter) Maximum of 256 character set 8x8 character box 7x7 character with one descender Same format for attributes as for color TV Note: The starting address of the display buffer must be an even location. 2-50 IBM Monochrome Display Adapter Vs. Color/ Graphics Adapter Attribute Relationship Table 3. Monochrome Vs Color/Graphics Attributes ON THE ON THE MONOCHROME COLOR/GRAPHIC 7 6 5 4 3 2 1 0 DISPLAY ADAPTER DISPLAY ADAPTER B R G B I R G B CHAR. BKGD. CHAR. BKGD. COLOR COLOR COLOR COLOR FG BACKGROUND FOREGROUND NORMAL B 0 0 0 I 1 1 1 WHITE BLACK WHITE BL-ACK RVV B 1 1 1 I 0 0 0 BLACK WHITE BLACK WHITE NON DISP (BLK) B 0 0 0 I 0 0 0 BLACK BLACK BLACK BLACK NON DISP (WHT) B 1 1 1 I 1 1 1 WHITE WHITE WHITE WHITE ALL OTHER CODES ALL OTHER ALL OTHER DEFINE FOREGROUND CODES RESU LT CODES CHANGE BACKGROUND COLOR IN WHITE FOREGROUND COMBINATIONS CHAR ON BLACK BACKGROUND BACKGROUND COLOR TO SELECTED VALUE R G • CODE WRITTEN WITH AN UNDERLINE ATTRIBUTE FOR THE IBM MONOCHROME DISPLAY BLACK WHEN EXECUTED ON A COLOR/GRAPHICS ADAPTER BLUE WILL RESULT IN A BLUE CHARACTER GREEN WHERE THE UNDERLINE ATTRIBUTES 1 CYAN ARE ENCOUNTERED. o" RED MAGENTA CODE WRITTEN ON A COLOR/GRAPHICS ADAPTER YELLOW WITH BLUE CHARACTERS, WILL BE WHITE DISPLAYED AS WHITE CHARACTERS ON BLACK BACKGROUND WITH A • AN ADDITIONAL WHITE UNDERLINE ON THE MONOCHROME DISPLAY 8 COLOR (ACTUAL) 01 FFERENT SHADES OF THE ABOVEI ARE SELECTED BY SETTING THE (I) BIT Note: Not all Monitors Recognize the (1) Bit Table 4. Color/Graphics Modes HORIZONTAL VERTICAL NO OF COLORS (INCL. BACKGROUND COLOR) LOW RES 160 100 16 (INCLUDES BLACK AND WHITE) MED RES 320 200 4 COLORS: 1 OF 16 FOR BACKGROUND PLUS GREEN, RED, YELLOW OR CYAN, MAGENTA, WHITE HIGH RES 640 200 B&WONLY 2-51 1. Low resolution color graphics (TV or monitor). (Note: This mode is not supported in ROM). • Up to 100 rows of 160 pels each (2x2) • 1 of 16 colors each pel specified by I, R, G and B • Requires 8000 byte of Read/Write Memory (on the adapter) • Memory mapped graphics (requires special memory map and set up to be defined later) 2. Medium resolution color graphics (TV or monitor) • Up to 200 rows of 320 pels each (lxl) • lout of 4 preselected colors in each box • Requires 16000 bytes of Read/Write Memory (on the adapter) • Memory mapped graphics 4 pels/byte FORMAT: 7 654 3 2 0 C1 CO C1 CO C1 CO C1 CO I First display pel • Graphics storage is organized in two banks of 8000 bytes each. Graphics Storage Map Memory Address #0000 even scans (0, 2, 4, ... , 198) (8000 bytes) #lF3F #2000 odd scans (1,3,5, ... , 199) (8000 bytes) #3F3F Address #0000 contains pel information for upper left comer of display area. 2-52 Color selection is determined by the following logic: Cl and CO will select 4 of 16 preselected colors. This color selection (palette) is preloaded in an I/O port. Cl CO CODE SELECT COLOR FOR DISPLAY POSITION o 0 DOT TAKES ON COLOR OF 1 OF 16 PRESELECTED BACKGROUND COLORS. o 1 SELECT 1ST COLOR OF PRESELECT COLOR SET" 1" OR "2" 1 0 SELECT 2ND COLOR OF PRESELECT COLOR SET" 1" OR "2" 1 1 SELECT 3RD COLOR OF PRESELECT COLOR SET" 1" OR "2" The two color sets are: SET ONE SET TWO COLOR 1 - CYAN COLOR 1 - GREEN COLOR 2 - MAGENTA COLOR 2 - RED COLOR 3 - WHITE COLOR 3- BROWN The background colors are the same basic 8 color as defined for low resolution graphic plus 8 alternate intensities defined by the intensity bit for a total of 16 color including black and white. 3. Black and white high resolution graphics (monitor) • Up to 200 rows of 640 pels each (1 xl) • Black and white only • Requires 16000 bytes of Read/Write Memory (on the adapter) • Addressing and mapping is the same as for medium resolu- tion color graphics, but the data format is different. In this mode each bit in memory is mapped to a pelon the screen. • 8 pels/byte 76543210 I I I I I I I I 2-53 Description of Basic Operations In the alphanumeric mode the adapter fetches character and attribute information from its display buffer. The starting address ofthe display buffer is programmable through the 6845, but it must be an even address. The character codes and attributes are then displayed according to their relative position in the buffer. DISPLAY BUFFER (EVEN) Starting Address CHAR CODE 'A' (Example of a 40x25 screen) ATTRIBUTE A B CHAR CODE '8' ATTRIBUTE X Video Screen CHAR CODE 'X' Last Address 1000 ATTRIBUTE The CPU and the display control unit have equal access to the display buffer during all the operating modes except high resolution alpha- numeric. During this mode, the CPU should access the display buffer during the vertical retrace time (if not, then the display will be affected with random patterns as the CPU is using the display buffer). The characters are displayed from a prestored "character generator" which contains the dot patterns of all the displayable characters. In the graphics mode the displayed dots and colors are also fetched from the display buffer (up to 16K bytes). In the Color/Graphics Mode Section, the bit configuration for each graphics mode is explained. 2-54 Table 5. Summary of Available Colors I R G B COLOR 0 0 0 0 Black 0 0 0 1 Blue 0 0 1 0 Green 0 0 1 1 Cyan 0 1 0 0 Red 0 1 0 1 Magenta 0 1 1 0 Brown 0 1 1 1 Light Gray 1 0 0 0 Dark Gray 1 0 0 1 Light Blue 1 0 1 0 Light Green 1 0 1 1 Light Cyan 1 1 0 0 Light Red 1 1 0 1 Light Magenta 1 1 1 0 Yellow 1 1 1 1 White Note: "I" provides extra luminance (brightness) to each shade available. Resulting in the light colors listed above, except where the "I" bit is not recognized by some monitors. Programming Considerations Programming the 6845 CRT Controller The 6845 has 19 internal registers which are used to define and control a raster scanned CRT display. One of these registers, the Address Register, is actually used as a pointer to the other 18 registers. It is a write only register which is loaded from the CPU by executing an OUT instruction to I/O address 3D4. The five least significant bits ofthe I/O bus are loaded into the Address Register. In order to load any of the other 18 registers, the Address Register is first loaded with the necessary pointer and then the CPU may output a value to I/O address 3D5 in order to load the information in the preselected register. The following table defines the values which must be loaded in 6845 Registers in order to control the different modes of operation supported by the attachment. 2-55 Table 6. 6845 Register Description ADDR REG. REGISTER 4ox25 Box25 GRAPHIC REG. # TYPE UNITS I/O ALPHA ALPHA MODES 0 RO Horizontal Char. Write 38 71 38 Total Only 1 Rl Horizontal Char. Write 28 50 28 Displayed Only 2 R2 Horiz. Sync Char. Write 2D 5A 2D Position Only 3 R3 Horiz. Sync Char. Write OA OA OA Width Only 4 R4 Vertical Total Char. Write IF IF 7F Row Only 5 R5 Vertical Total Scan Write 06 06 06 Adjust Line Only 6 R6 Vertical Char. Write 19 19 64 Displayed Row Only 7 R7 Vert. Sync Char. Write lC lC 70 Position Row Only 8 R8 Interlace Mode - Write 02 02 02 Only 9 R9 Max Scan Scan Write 07 07 01 Line Addr. Line Only A Rl0 Cursor Start Scan Write 06 06 06 Line Only B Rll Cursor End Scan Write 07 07 07 Line Only C R12 Start Addr. (H) - Write 00 00 00 Only D R13 Start Addr. (U - Write 00 00 00 Only E R14 Cursor - Read/ XX XX XX Addr. (H) Write F R15 Cursor - Read/ XX XX XX Addr. (U Write 10 R16 Light Pen (H) - Read XX XX XX Only 11 R17 Light Pen (U - Read XX XX XX Only Note: All register values are given in hexadecimal. 2-56 Programming the Mode Control and Status Register The following I/O devices are defined on the Color/Graphics Adapter. HEX AD DR. A9 A8 A7 A6 A5 A4 A3 A2 Al AD FUNCTION OF REGISTER X'308' I I I I 0 I I 0 0 0 DO REG (MODE CONTROl) X'309' I I I I D I I 0 0 I DO REG (COLOR SELECT) X'30A' I I I I 0 I I 0 I 0 01 REG (STATUS) X'30B' I I I I 0 I I 0 I I CLEAR LIGHT PEN LATCH X'30C' I I I I 0 I I I 0 0 PRE SET LIGHT PEN LATCH X'300' I I I I 0 I 0 Z Z 0 6845 REGISTERS X'301' I I I I 0 I 0 Z Z I 6845 REGISTERS X'300' I I I I 0 I 0 Z Z 0 6845 REGISTERS X'301' I I I I 0 1 0 Z Z I 6845 REGISTERS Z = don't care condition Color Select Register This is a 6 bit output only, register, it can not be read, its address is X'3D9' and can be written using the 8088 I/O OUT command. The following is a description of the Register functions. Bit 0 B (BLUE) Border Color Select ALPHA/BACKGROUND Bit 1 G (GREEN) Border Color Select ALPHA/BACKGROUND Bit 2 R (RED) Border Color Select ALPHA/BACKGROUND Bit 3 I Intensifies Border Color Select ALPHA/BACKGROUND IN 320 X 200 Bit 4 Select Alt Back Color Set For Alpha Color Modes Bit 5 320 x 200 Color Set Select Bit 6 Not Used Bit 7 Not Used Bits 0, 1, 2, 3. Select the screens border color in 40x25 alpha mode. In graphics mode (medium resolution) 320 x 200 color, the screen background color (CO-Cl) is selected by these bit settings. Bit 4. This bit when set will select on alternate, intensified, set of back- ground colors in the alpha mode. Bit 5 is only used in the medium resolution color mode (320 x 200). It is used to select the active set of screen colors for the display. 2-57 When bit 5 is set to a "1" colors are detennined as follows. The Cl CO Set selected are: o 0 Background as defmed by Bit 0-3 of Port '309' o 1 Cyan 1 0 Magenta 1 1 White When bit 5 is set to a "0" Colors are detennined as follows. The CO Cl Set selected are: o 0 Background as defmed by Bit 0-3 of Port '309' o 1 Green 1 0 Red 1 0 Yellow Mode Select Register This is a 6 bit output only register, it can not be read. Its address is X'30S'. It can be written using the 80SS I/O OUT command. The following is a description of the registers functions. Bit 0 Bit 0 so x 25 mode Bit 1 Graphic Select Bit 2 B & W Select Bit 3 Enable Video Signal . Bit 4 High Res 640 x 200 B & W Mode Bit 5 Change BACKGROUNO INTENSITY to Blink Bit Bit 6 Not Used Bit 7 Not Used Bit 0 Selects between 40 x 25 and SO x 25 alpha mode, a "1" sets it to SO x 25 mode. Bit 1 Selects between ALPHA mode and 320 x 200 graphics mode, a "1" select 320 x 200 graphics mode. Bit 2 Selects color or B & W mode, a "I" selects B & W. Bit 3 Enables the video signal at certain times when modes are aeing changed. The video signal should be disabled when changing modes. A "1" enables the video signal. Bit 4 When on, this bit selects the 640 x 200 B & W graphics mode. One color of S can be selected on direct drive sets in this mode by using register 309. 2-58 Bit 5 When on, this bit will change the character background intensity to the blinking attribute function for ALPHA modes. When the high order attribute bit is not selected, 16 background colors (or intensified colors) are available. For normal operation, this bit should be set to "1" to allow the blinking function. Mode Register Summary Bits 0 1 2 3 4 5 0 0 1 1 0 1 40 x 25 ALPHA B & W 0 0 0 1 0 1 40 x 25 ALPHA COLOR 1 0 1 1 0 1 80 x 25 ALPHA B & W 1 0 0 1 0 1 80 x 25 ALPHA CO LO R 0 1 1 1 0 z 320 x 200 B & W GRAPHICS 0 1 0 1 0 z 320 x 200 COLOR GRAPHICS 0 1 1 1 1 z 640 x 200 B & W GRAPHICS j~ J~ .~ .~ .~ n ENABLE BLINK ATTRIBUTE 640 x 200 B & W ENABLE VIDEO SELECT B & W MODE SELECT 320 x 200 GRAPHICS 80 x 25 ALPHA SElECT z = don't care condition * THE LOW RESOLUTION 160 x 100 MODE REQUIRES SPECIAL PROGRAMMING AND IS SET UP AS ALPHA MODE 40 x 25 Status Register The status register is a 4 bit read only register. Its address is X'3DA'. It can be read using the 8088 I/O IN instruction. 2-59 The following is a description of the register functions. Bit 0 Display Enable Bit 1 Light Pen Trigger Set Bit 2 Light Pen SW Made Bit 3 Alpha Dots Bit 4 Not Used Bit 5 Not Used Bit 6 Not Used Bit 7 Not Used Bit 0 This input bit, when active, indicates that a regen buffer memory access can be made without interfering with the Display. Bit 1 This bit, when active, indicates that a positive going edge from the light pen input has set the light pen trigger. This trigger is reset on power on and may also be cleared by doing an I/O OUT command to address X'3DB'. No specific data setting is required, the action is address activated. Bit 2 The light pen switch status is reflected in this status bit. The switch is not latched or debounced. A "0" indicates the switch is on. Bit 3 The ALPHA video output signal is readable in this status bit. Its purpose is to verify that video information is being generated for RAS purposes. Sequence of Events 1. Determine mode of operation 2. Reset Video Enable bit 3. Program 6845 to select mode 4. Program mode/color select registers Memory Requirements The memory used by this adapter is self-contained. It consists of 16k bytes of memory without parity. This memory is used as both a display buffer for alphanumeric data and as a bit map for graphics data. The Regen Buffers address starts at X'B8000'. Interrupt Level (Vertical Retrace) Level 2 2-60 I/O Address and Bit Map Read/Write Memory Address Space 01000 System Read!Write Memory B8000 Display Buffer (16K Bytes) 128K RESERVED REGEN AREA BBFFF Display Buffer (16 K Bytes) C8FFF 2-61 Color/Graphics Monitor Adapter Direct Drive, and Composite Interface Pin Assignment REAR PANEL o • • 6 • •• : • 9 o COLOR DIRECT DRIVE 9 PIN "D" AT STANDARD TTL LEVELS SHELL CONNECTO Ground 1 Ground 2 ........ Red 3 Green 4 Direct ~.... Color/Graph ics Drive ...... Blue 5 Direct Drive Monitor Intensity 6 Adapter ~ .... Reserved· 7 .... ~ Horizontal Drive 8 .... ~ ....... Vertical Drive 9 COMPOSITE PHONO JACK HOOK·UP TO MONITORS Composite Video Signal of approximately 1.5 Volts Video ~ Peak to Peak Amplitude 1 Color/Graphic s Monitor .... . G Composite Jac k ChassIs rou nd 2 2-62 Color/Graphics Monitor Adapter Auxiliary Video Connectors PI-4 PIN BERG STRIP P2-G PIN BERG STRIP FOR RF MODULATOR GOLOR/GRAPHICS ADAPTER RF ... -, +12 Volts 1 Color/Graphics (key) Not Used 2 Modulator Adapter L.IIIl Composite Video Output 3 .... Logic Ground 4 RF Modulator Interface - Light Pen Input 1 ... (key) Not Used 2"- Light - Light Pen Switch 3 .. Color/Graphics Pen Chassis Ground 4"'- Adapter ... + 5 Volts 5 ....... -, +12Volts 6 LIght Pen Interface 2-63 NOTES 2-64 Parallel Printer Adapter The Printer Adapter is specifically designed to attach printers with a parallel port interface, but it can be used as a general input/output port for any device or application which matches its input!output capabili- ties. It has 12 TTL buffer output points which are latched and can be written and read under program control using the processor IN or OUT instructions. The adapter also has five steady state input points that may be read using the processor's IN instructions. In addition, one input can also be used to create a processor interrupt. This interrupt can be enabled and disabled under program control. Reset from the power-on circuit is also "ORed" with a program output point allowing a device to receive a power-on reset when the processor is reset. This function is packaged on an adapter which fits into any of the five System Expansion slots on the System Board. The input!output signals are made available at the back of the adapter via a right angle PCB mounted 25 PIN "D" type connector. This connector protrudes through the rear panel of the System Unit where a cable and shield may be attached. When this adapter is used to attach a printer, data, or printer, commands are loaded into an 8-bit latched output port, and the strobe line is activated writing data to the printer. The program then may read the input ports for printer status indicating when the next character can be written or it may use the interrupt line to indicate "not busy" to the software. The output ports may also be read at the card's interface for diagnostic loop functions. This allows fault isolation determination between the adapter and the attaching device. This same function is also part of the combination IBM Monochrome Display and Printer Adapter. A block diagram of the printer adapter is on the following page. 2-65 Parallel Printer Adapter Block Diagram 25 PIN "0" SHE LL BUS BUFFER DATA LATCH CONNECTOR -----. 8 ... 8 ~ ENABLE ---. CLOCK ~ TRANS- 8 CEIVER r C DIR DlJ E READ ~O DATA AEN M C WRITE DATA M 0 WRITE CONTROL A 0 READ STATUS N E READ R rf-0NTROL D BUS CONTROL O.C. BUFFERS LATCH ORIVERS SLCT IN 4 ENABLE 5 ---. CLOCK .... STROBE AUTO -+- - -~ FD XT 5 INIT ENABLE ... ~ ~ CLR ERROR SLCT PE ACK BUSY RESET Figure 16. PARALLEL PRINTER ADAPTER BLOCK DIAGRAM 2-66 Programming Considerations The Printer Adapter responds to 5 I/O instructions - 2 output and 3 input. The output instructions transfer data into 2 latches whose outputs are presented on pins of a 25 Pin "D" shell connector. Two of the three input instructions allow the CPU to read back the contents of the two latches. The third allows the CPU to -read the real time status of a group of pins on the connector. A description of each instruction follows. IBM Monochrome Display & Printer Adapter Parallel Printer Adapter Output to address 3BCH Output to address 37BH Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 I Bit 2 Bit 1 I Bit 0 Pin 9 I Pin 8 I Pin 7 I Pin 6 Pin 5 Pin 4 Pin 3 Pin 2 This instruction captures data from the data bus and is present on the respective pins. These pins are each capable of sourcing 2.6 rna and sinking 24 rna. lt is essential that the external device not try to pull these lines to ground. IBM Monochrome Display & Printer Adapter Parallel Printer Adapter Output to address 3BEH Output to address 37AH Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 IRQ Pin 17 Pin 16 Pin 14 Pin 1 Enable This instruction causes this latch to capture the five least significant bits of data bus. The four least significant bits present their outputs, or inverted versions of their outputs to the respective pins shown above. If bit 4 is written 1, the card will interrupt the CPU on the condition that Pin 10 transitions high to low. These pins are driven by open collector drivers pulled to +5 V through 4.7K OHM resistors. They can each sink approximately 7 rna and maintain 0.8 volts down level. Note: For pin references, see Parallel Interface Connector Specifications, page 2-69. 2-67 IBM Monochrome Display & Printer Adapter Parallel Printer Adapter Input from address x' '3BC' Input from address 378H This command presents the CPU with data present on the pins associated with the out to x' '3BC'. This should normally reflect the exact value that was last written to x '3BC'. If an external device should be driving data on these pins (in violation of usage ground rules) at the time of an input, this data will be 'or' ed with the latch contents. IBM Monochrome Display & Printer Adapter Parallel Printer Adapter Input from address 3BDH Input from address 379H This command presents real time status to the CPU from the pins as follows. Bit 1 Bit 0 Input from address 3BEH Input from address 37 AH This instruction causes the data present on pins 1, 14, 16, 17 and IRQ bit to be read by the CPU. In the absence of external drive applied to these pins, data read by the CPU will exactly match data last written to x' '3BE' in the same bit positions. Note that data bits 0-2 are not included. If external drivers are dotted to these pins, that data will be 'or'ed with data applied to the pins by the x' '3BE' latch. Bit 7 Bit 6 Bit 5 Bit4 Bit 3 Bit 2 Bit 1 Bit 0 IRQ -- Pin 17 Pin 16 - - - Pin 14 Pin 1 Enable Por=O Por=l Por=O Por=1 Por=1 These pins assume the states shown after a reset from the CPU. Note: For pin references see Parallel Printer Adapter Interface Connector Specifications page 2-69. 2-68 Parallel Printer Adapter Interface Connector Specifications REAR PANEL 25 PIN "D" • • 14· • • • • •• • • •• • • •• • • • • •• • • 25 NOTE: All outputs are software generated, and all inputs are real time signals 0 (not latched). AT STANDARD TTL LEVELS Signal AMP Name Pin No - Strobe 1 ... ~ ......... + Data Bit 0 2 ......... ...... + Data Bit 1 3 + Data Bit 2 4 + Data Bit 3 5 .... .... ... + Data Bit 4 6 ......... + Data Bit 5 7 .... + Data Bit 6 8 .... + Data Bit 7 9 Printer ..... ... .. - Acknowledge 10 Parallel Printe Adapter + Busy . ..."""- ..... + P. End (out of Paper) + Select 11 12 13 - Auto Feed 14 ... po •... - Error 15 ... - Initialize Printer 16 .. po - Select Input 17 .. ~ ~ Ground 18·25 ... po 2-69 IBM 80 CPS Matrix Printer The printer is a self powered, standalone table top unit. It attaches to the System Unit via a parallel signal cable which is 6 feet in length. The unit obtains its AC power from a standard wall outlet (120 Vac). The printer is an 80 Character Per Second (CPS) bidirectional wire matrix device. It has a 9 wire head, allowing it to print characters in a 9x9 dot matrix. It can print in compressed mode 132 characters per line and in standard font, 80 characters per line. A large font also prints in 66 characters per line mode. The printer can print double size characters and double dotted characters. The printer prints the standard ASCII 96 character uppercase and lowercase character sets. In addition, a set of 64 special block graphic characters are available. The printer can also accept commands setting the feed control desired for the application. Setting of 1 to 66 lines per page can be programmed and the lines per inch may be set to 5,8, or 10. This printer attaches to the System Unit via the Parallel Printer Adapter or the combination Monochrome Display Adapter and Parallel Printer Adapter. The cable is a 25 lead shielded cable with a 25 pin "D" type connector at the System Unit end, and a 36 pin connector on the printer end. N ote: You may lose data anytime you are running a program with the printer off and attached to the System Unit. 2-70 Table 7. Printer Specifications (1) PRINT METHOD: Serial impact dot matrix (2) PRINT SPEED: 80 CPS (3) PRINT DIRECTION: Bidirectional with logical seeking (4) NUMBER OF PINS IN HEAD: 9 (5) LINE SPACING: 4.23 mm (1/6") or programmable (6) PRINTING CHARACTERISTICS Matrix: 9x9 Character Set: Full 96-character ASCII with decoders. plus 9 international characters/symbols Graphic Character: 64 block characters (7) PRINTING SIZES Maximum Characters characters per inch per line Normal: 10 80 Enlarged: 5 40 Condensed: 16.5 132 Condensed Enlarged: 8.25 66 (8) MEDIA HANDLING Paper Feed: Adjustable sprocket pin feed Paper Width Range: 101.6 mm (4") to 254 mm (10") Copies: One original plus two carbon copies {total thickness not to exceed 0.3 mm 10.012") Paper Path: Rear (9) INTERFACES Standard: Parallel 8-bit Data & Control Lines (10) INKED RIBBON Color: Black Type: Cartridge Life Expectancy: 3 million characters (11 ) ENVIRONMENTAL CONDITIONS Operating Temperature Range: 5 to 35 0 C (41 to 95 0 F) Operating Humidity: 10 to 80% non-condensing (12) POWER REQUIREMENT Voltage: 120VAG, 60 Hz Current: 1 Amp maximum Power Consumption: 100 VA maximum (13) PHYSICAL CHARACTERISTICS Height: 107 mm (4.2") Width: 374 mm (14.7") Depth: 305 mm (12.0") Weight: 5.5 kg (12 Ibs.) 2-71 Setting The DIP Switches There are two DIP switches on the control circuit board. In order to suit the user's specific requirements, desired control modes are selectable by the DIP switches. The functions of the switches and their preset conditions at the time of shipment are as shown in Table 8 (DIP Switch 1) and Table 9 (DIP Switch 2). Pin No. Function ON OFF Factory-set Condition 1 Not applicable - - ON 2 CR { Print & line Feed Print only Print & ON Print only line feed 3 Buffer full { Print & line Feed Print only Print & ON Print only line feed 4 Cancel code { Valid Invalid Valid OFF Invalid 5 Delete code { Valid Invalid Valid ON Invalid 6 Error Buzzer Sounds Does not ON sound 7 Character generator N.A. Graphic OFF (Graphic pattern select) patterns select 8 SLCT IN signal Fixed Not fixed ON Fixed internally Not fixed internally 2-72 Table 9. Functions and Conditions of DIP Switch 2 Pin No. Function ON OFF Factory-set Condition 1 Not applicable - - ON 2 - - ON 3 AUTO FEED ~ Fixed internally Fixed Not fixed OFF XT signal Not fixed internally 4 Coding table select N.A. Standard OFF Parallel Interface Description (1) Specifications (a) Data transfer rate: 1000 CPS (max.) (b) Synchronization: By externally supplied STROBE pulses. (c) Handshaking: ACKNLG or BUSY signals. (d) Logic level: Input data and all interface control signals are compatible with the TTL level. (2) Connector Plug: 57-30360 (AMPHENOL) (3) Connector pin assignment and descriptions of signals. Connector pin assignment and descriptions of respective interface signals are provided in Table (10) page 2-74. 2-73 Table 10. Connector Pin Assignment and Descriptions of Interface Signals Signal Return Pin No. Pin No. Signal Direction Descriptio n 1 19 STROBE In STROBE pulse to read data in. Pu Ise width must be more than 0.5ps at receiving terminal. The signal level is normally "HIGH"; read·in of data is per· formed at the "LOW" level of th is signal. 2 20 DATA 1 In These signals represent 3 21 DATA 2 In information of the 1st to 8th bits of 4 22 DATA 3 In parallel data respec- 5 23 DATA 4 In tively. Each signal is at "HIGH" level when 6 24 DATA 5 In data is logical "1" and 7 25 DATA 6 In "LOW" when logical 8 26 DATA 7 In "0". 9 27 DATAS In 10 28 ACKNLG Out Approx.. 5ps pulse. "LOW" indicates that data has been received and that the pri nter is ready to accept other data. 11 29 BUSY Out A "HIGH" signal indicates that the printer cannot receive data. The signal becomes "High" in the following cases: 1. During data entry 2. During printing operation 3.ln OFF·L1NE state 4. During printer error status. 2-74 Table 10. Connector Pin Assignment and Descriptions of Interface Signals (cont.) Signal Return Pin No. Pin No. Signal Direction Description 12 30 PE Out A "HIGH" signal indicates that the printer is out of paper. 13 - SLCT Out This signal indicates that the printer is in the selected state. 14 - AUTO In With this signal being FEED XT at "LOW" level, the paper is automatically fed one line after printing. (The signal level can be fixed to "LOW" with DIP SW pin 2·3 provided on the control circuit boardj 15 - NC Not used. 16 - OV Logic GN D level. 17 - CHASSIS-GN D - Printer chassis GN D. In the printer, the chassis GN D and the logic GND are ilOlated from each other. 18 - NC - Not used. 19-30 - GND - TWISTED-PAIR RETU RN signal GND level. 31 - INIT In When the level of this signal becomes" LOW" the printer controller is reset to its initial state and the print buffer is cleared. This signal is normally at "HIGH" level, and its pulse width must be more than 50ps at the receiving terminal. 2-75 Table 10. Connector Pin Assignment and Descriptions of Interface Signals (cont.) Signal Return Pin No. Pin No. Signal Direction Description 32 ERROR Out The level of this signal becomes "LOW" when the printer is in- 1. PAPER END state 2. OFF·LI NE state 3. Error state 33 - GND - Same as with Pin No. 19 to 30. 34 - NG - Not used. 35 Pulled up to t5V through 4.7 KS1 resistance. 36 - SLGTIN In Data entry to the printer is possible only when the level of this signal is "LOW". (Internal fixing can be carried out with DIP SW 1·8. The condition at the time of shipment is set "LOW" for this signal.) NOTES 1: "Direction" refers to the direction of signal flow as viewed from the printer. 2: "Return" denotes "TWISTED PAl R RETU RN" and is to be connected at signal ground level. As to the wiring for the interface, be sure to use a twisted·pair cable for each signal and never fail to complete connection on the Return side. To prevent noise effectively, these cables should be shielded and connected to the chassis of the System Unit and the printer, respectively. 3: All interface conditions are based on TTL level. Both the rise and fall times of each signal must be less than O.2ps. 4: Data transfer must not be carried out by ignoring the ACKN LG or BUSY signal. (Data transfer to this printer can be carried out only after confirming the ACKN lG signal or when the level of the BUSY signal is "LOW".) 2-76 (4) Data transfer sequence Fig. 17 shows the sequence for data transmission. BUSY -----, ACKNLG 0.511<: (MIN.) DATA--~ STROBE 0.511 <; (MIN.) 0.5il' (MIN.) Figure 18. PARALLEL INTERFACE TIMING DIAGRAM 2-77 ASCII Coding Table Table 11 shows all available codes when the Printer is set for operation with standard coding by setting the DIP switch pin 2-4 to the OFF position. This DIP switch pin is factory-set to the OFF position. Table 11. ASCII Coding Table -'" ~ --- - ~-- -.... - - - 0 - LJ.J ;::: - -;; • M D - 0 --- 0 ~. ~I -- N U -- ca --0 • .. 0 - « ;;- 0 en en ;; - 0 -U D N U D M U D ....u D Z « U u '" LJ.J 0 -I -I -- 0 ::> co co 0 LJ.J f- ~ f- ~ ex: Z ca ::r: -I > ~ U 0 CIJ en, ..... ..... - - 0 0.. CT ~ ~ - ::> > S x >- N '-.-' .. (' -I LJ.J D co <.0 - 0 ;; ro .c u "C ~ ~ '" ..c: .- '- ~ - E c::: 0 ;; '" '" ;; 0.. d ex: CIJ f- ::> > ;;: X >- N - /' ~ I 0 .... .... 0 ;; ro « ca U D LJ.J ~ C!) ::r: - ..., ~ -I :;;; Z 0 M M - ;; 0 - N M .... '" <.0 ..... co en .. .. ''i. .\ ". 0 " 0 ;; "- _. - - * - ..... N N 0 '" : *" ." ~ "" + I - - ;; 0 0 - U D N U D M U D ....u D Z « u u '" LJ.J 0 -I 0 -I 0 0 0 ::> LJ.J f- ~ f- ~ ex: 0 Z ca ::r: -I > ~ U ~ en 0 0 - ;; - ;; ;; - - ;; - -;; - -;; - -- 0 0 0 0 0 0 0 0 - - - - - - 0 0 0 0 0 0 0 0 0 0 0 0 0 C; C; 0 0 - .... '" N ..... M « <.0 co en aJ U D LJ.J ~ 2-78 ASCII Control Codes Control Codes Various kinds of control codes are contained in Table 11. These control codes are recognized by the printer and perform specified functions upon receipt of these codes. The following are descriptions of respec- tive control codes. (1) CR (Carriage Return) When the CR code is transmitted to the print buffer, all data stored in the print buffer is printed. (When AUTO FEED XT (Pin No. 14) is at "LOW" level or DIP switch pin 2-2 is ON, the paper is advanced one line automatically after printing.) Note: When 80 columns of print data (including spaces) are continuously received and the following data is valid and printable, the Printer automatically begins to print the data stored in the print buffer. In this case, if AUTO FEED XT is at "LOW" level or DIP switch pin 2-3 is ON, the paper is advanced one line after printing. (2) LF (Line Feed) When the LF code is input, all data in the print buffer is printed and the paper is advanced one line. Note: If no data precedes the LF code, or if all preceding data is "SPACE", only paper feeding is performed. For example, if the data is transferred in the order of DATA-+CR-+LF, DATA will be printed by the CR code, and when the Printer receives the LF code, it only carries out one line feed. (3) VT (Vertical Tab) When the VT code is input, all data preceding this code is printed. And the paper is advanced to the line position set by "ESC B" (described later). If no vertical tab position is set by ESC B, the VT code behaves like the LF code. Therefore, the paper is advanced one line after printing. (4) FF (Form Feed) The FF code carries out the printing of all data stored in the print buffer and advances the paper to the next predetermined Top of Form position. The Top of Form is determined when the POWR switch is turned on or the INIT signal is applied. If the form length per page is not set by "ESC C+n", it is regarded as 66 or 72 lines. 2-79 Note: The form length of 72 lines per page is applicable to only the version marked with identifier code "M72" on the rear side of the lower case of the Printer. This code always initializes the printing of the data stored in the print buffer. (5) SO (Shift Out) When the SO code is input, all data that follows it in the same line will be printed out in enlarged (double width) characters. This code is cancelled by the printing operation or the input of "DC 4" code and can be input at any column position on a line. Therefore, normal size and enlarged characters can be mixed on the same line. 1. [DATA] ABC ISO 1 DEF IDC41 GHI ~ [TI] [PRINT] ABCDEFGHI 2. [DATA ABCD ~ EFGH ~ [gJ IJLK ISO 1 MNOP ~ [!;£J [PRINT ABCDEFGH IJKLMNOP (6) SI (Shift In) When the SI code is input, all data that follows it will be printed out in condensed characters. This code is cancelled by the input of "DC 2" code. The SI code can be input at any column position on a line, but all characters/symbols on the line containing SI code are printed out in condensed characters. When printing condensed characters, the data capacity of the print buffer will become 132 columns per line. When the SO code is received after the input of the SI code, condensed enlarged characters (double width of condensed characters) can be printed. This condition is cancelled by "DC 4" code, and the character size returns to "condensed". 1. [DATA] ~ ABCDEFGHIJKL [§J ~ [PRINT] ABCDEFGHIJKL 2. [DATA] ABC ~ DEF Iso I GHIJKL ~ 0 [PRINT] ABCDEFGHIJKL (7) DC 4 (Device Control 4) The DC 4 code cancels the SO mode. [DATA] ~ ABCDEF ~ GHI IDC 41 JKL ~ [gJ [PRINT] ABCDEFGHIJKL 2-80 (8) DC 2 (Device Control 2) The DC 2 code cancels the SI mode. [DATA] @I ABCDEF Iso I GHI @] @] IDC 21 JKLMN 1CR I ~ [PRINT] ABCDEFGHI JKLMN (9) HT (Horizontal Tab) The HT code carries out the horizontal tabulation. If there is no tab position set, this code is ignored. The tab stop positions are set by "ESC D+n" (described later). (10) CAN (Cancel) Upon the input of the CAN code, all data previously stored in the print buffer is cancelled. Therefore, this code is regarded as the print buffer clear command. This code clears the print buffer, but control codes (Excluding the SO code) are still valid even if the CAN code is transferred. The validity or invalidity of the CAN code is selectable by the DIP switch pin 1-4 on the control circuit board. (11) DEL (Delete) This code functions the same as the CAN code. The validity or invalidity of the DEL code is selectable by the DIP switch pin 1-5 on the control circuit board. (12) DC 1 (Device Cantrall) The DC 1 code places the Printer in the Selected state. With the Printer in the Selected state, if the DC 1 code is input during data transfer, all data stored before the DC 1 code is ignored. (13) DC 3 (Device Control 3) The DC 3 code places the Printer in the Deselected state. In other words, it disables the Printer to receive data. Once the Printer is put in the Deselected state by the DC 3 code, the Printer will not revert to the Selected state unless the DC 1 code is input again. Note: When the DC 1 and DC 3 codes are used, DIP switch pin 1-8 should be in the "OFF" position. 1. [DATA] @DJ AAAAA IDc31 BBBBB IDcll CCCCC ICRI ~ [PRINT] AAAAACCCCC 2. [ DATA] AAAAA ~ BBBBB IDC 31 CCCCC IDC 11 @ID [ill [PRINT] BBBBB 2-81 Relations among the ON LINE switch, SLCT IN signal, DCl/DC3 code and interface signals are shown in Table 12 below. Table 12. DClIDC3 And Data Entry ON LINE -- SLCT IN DC l/DC 3 - - ERRDR BUSY -- ACKNLG SLCT DATA ENTRY SWITCH OFF-LINE HIGH/LOW OC l/DC 3 LOW HIGH Not LOW Impossible Generated DC 1 HIGH LOW/ Generated HIGH Possible HIGH (Normal entry) HIGH DC 3 HIGH LOWI Generated LOW Possible HIGH (See Note 1.) ON-LINE LOW DC l!DC 3 HIGH LOW/ Generated HIGH Possible HIGH (Normal entry) NOTES 1: In Table 12, it is assumed that as soon as the Printer receives data, it sends back the ACKN LG signal, though this data is not stored in the print buffer. In this status, the Printer is waiting for the DC 1 code for normal entry. 2: The DC l/DC 3 code is valid under the condition that the DIP switch pin 1-8 is OFF, namely, the level of SLCT IN at the pin No. 36 of the interface connector is "HIGH". When SLCT IN is "LOW", the DC 1IDC 3 code is not valid. (14) NUL (Null) The NUL code is regarded as the termination for tabulation setting sequence (described in detail later). (15) BEL (Bell) When the BEL code is input, the buzzer sounds for about 3 seconds. (16) Escape (ESC) control (a) Escape numerical control Input of an "E SC" code followed by an ASCII numeric code permits each of the following functions to be performed. 1) ESC 0 (Escape 0) Receipt of an "ESC" followed by ASCII code "0" causes the line spacing to be set at 1/8 inch. Input of the ESC 2 code or INIT signal to the interface connector or turning the power off and on again causes the line spacing to return to 1/6 inch. 2) ESC 1 (Escape 1) Receipt of an "ESC" followed by ASCII code "1" causes the line spacing to be set at 7/72 inch. Input of the ESC 2 code or INIT signal to the interface connector or turning the power off and on again causes the line spacing to return to 1/6 inch. 2-82 3) ESC 2 (Escape 2) Receipt of an "ESC" followed by ASCII code "2" causes the line spacing to be set at 1/6 inch. When the POWER switch is turned on, the line spacing is set at initial 116 inch. The ESC 2 code is also a command to execute "ESC A+n" modes (described later). 4) ESC 8 (Escape 8) The ESC 8 code makes it possible to transmit data even if there is no paper in the Printer. This code should be transmitted before the Printer runs out of paper. After transmitting this code, when the Printer runs out of paper, the PE signal of the interface connector turns to High level; the ERROR signal remains at High level. 5) ESC 9 (Escape 9) This code cancels the ESC 8 condition. When the power is turned on, the Printer is initialized into ESC 9 status. Therefore, the Printer cannot receive data when there is no paper. 6) ESC SI This code functions the same as "SI". 7) ESC SO This code functions the same as "SO". (b) ESC alphabetic control Receipt of an "ESC" code followed by ASCII code "X"(alphabetic code) permits each of the following functions to be performed. Note: "n" represents a 7-bit binary number, and the most significant bit is not treated as data. "+" is inserted for the purpose of legibility only, and should not be input in actual operation. 1) ESC A+n This code specifies the amount of line spacing in the Line Feed 1«n> 10<85 (Decimal): "n" is a binary number. "n"= 1 is equivalent to 1/72 inch paper advancement. Since the distance between any two dot wires of the print head is 1/72 inch, any line spacing in increments proportional to the distance between the dot wires can be established. 2-83 The ESC A code is the command only to store spacing data into the memory. In other words, even if spacing data was transferred into the memory, the Printer does not actually carry out the line spacing in accordance with the spacing data. To execute the line spacing in accordance with the stored data, the ESC 2 code should be followed. Namely, the ESC 2 code is considered as the execution command for the line spacing. [DATA] AAAAAAA JCRI JLFI BBBBBBB JCRI ILFIIESCA+241 CCCCCCC ICRI [!!] DDDDDDD IEsC21 ICRI [IT] EEEEEEE ICR I [ill FFFFFFF I CR I I LF I [PRINT] AAAAAAA} 1/6 inch = 12 steps/72 BBBBBBB CCCCCCC DDDDDDD } 1/3 inch = 24 steps/72 EEEEEEE FFFFFFF Note: When "n" is actually transferred to the Printer as data, it is transferred in the form of a 7-bit binary number. In case of "ESC A+24", actual output to the Printer is performed as H<41>H<18>H in hexadecimal code. 2) ESC B+nl +n2+nk+ NUL (1«n>1O<66, 1H <6>H H INULI AAAAAAA IVTI BBBBBBB IVTI eeeeeee IVTI DDDDDDD [PRINT] AAAAAAA .... 1st line BBBBBBB .... 4th lines eeeeeee .... 6th lines DDDDDDD .... 10th lines 3) ESC C+n (1 «n>1O<66) This code specifies the form length per page. The form length is determined by the number of lines (="n"). The amount of a line spacing at this point is a predetermined numerical value by "ESC A +n". When the form length is not programmed, one page is assumed at 66 or 72 lines. Prior to setting the vertical tab position, the form length should be set. 4) ESC D+n1+n2+ ..... +nk+NUL (1 «n> 1O<127,Ic:;112) This code specifies the horizontal tab stop posi- tions. The first 112 tab stops per line are recognized in the Printer, and subsequent tab stops are ignored. Tab stop numbers must be received in incremental numerical order. If a tab stop position of higher value than 80 is received in normal character printing mode, all horizontal tab functions after 80 columns are ignored. To execute tab stop positions, the HT code should be input. The HT code is ignored when the hori- zontal tab position has not been programmed. 2-85 The NUL code should be input as the command for the termination of the tab set sequence, and the lack of this code will cause incorrect data printout. 1. In case of 5th, 10th and 21st columns. [DATA] IESCDI H H H INULI ABC ([jJ DEF ([jJ GHI [EIJ JKL IQD I1£l [PRINT] ABC DEF GHI JKL 2. In case of lack of stop position. [DATA] IESCDI H H INULI ABC [[iJ DEF !EII GHI [EIJ JKL [f!jJ [ill [PRINT] ABC DEF GHIJKL 3. In case of character data transferring over next tab stop. [DATA] IESCDI H H H INULI ABCDEF [ETI GHI [iIT] JKL @KI ~ [PRINT] ABCDEF GHI JKL 4. In case of transferring two HT codes at a time. [DATA] IESCDI H H H INULI ABCD [EIJ ISPACEI [BIJ EFGH [£F!] [ill [PRINT] ABCD EFGH 5) ESC E The ESC E code causes the Printer to print emphasized characters. Emphasized printing gives the character a stronger impression on the paper. This code can be input in any column position on a line. The speed of the head carriage reduces to 40 CPS while printing emphasized characters. 1. [DATA] I ESC E I ABCDEFGHI ICR I [IT] [PRINT] ABCDEFGHI 2. [DATA] Isol IESC EI ABCDEFGHI ICRI [ill [PRINT] ABCDEFGHI 6) ESC F The ESC F code cancels the emphasized printing mode. 7) ESC G The ESC G code causes the Printer to perform the double printing. Double printing is carried out in the following manner: a) A character is printed. b) The paper is advanced by 1/216 inch. c) The print head prints the same character again. In this way, the character becomes bold. 2-86 [DATA] I ESC G I ABCDEFGHI ICRI ILF I [PRINT] ABCDEFGHI 8) ESC H The ESC H code cancels the double printing mode. 2-87 NOTES 2-88 5 1/4-Inch Diskette Drive Adapter The System Unit has space and power for one or two 5-1/4" Diskette Drives. The drives are soft sectored, single sided, with 40 tracks. They are Modified Frequency Modulation (MFM) coded in 512 byte sectors, giving a formatted capacity of 163,840 bytes per drive. They have a track to track access time of 8 ms and a motor start time of 500 ms. The 5-1/4" Diskette Drive Adapter fits in one of the System Board's five System Expansion Slots. It attaches to the two drives via an internal daisy chained flat cable which connects to one end of the drive adapter. The adapter has a second connector on the other end which extends through the rear panel of the System Unit. This connector contains the signals for two additional external drives, thus the 5-1/4" Diskette Drive Adapter is capable of attaching four 5-1/4" drives, two internal, and two external. The adapter is designed for double density MFM coded drives and uses write precompensation with an analog phase locked loop for clock and data recovery. The adapter is a general purpose device using the NEe ,uPD765 compatible controller. Thus the drive parameters are programmable. In addition, the attachment supports the drive's write protect feature. The adapter is buffered on the I/O bus and uses the System Board direct memory access (DMA) for record data transfers. An interrupt level is also used to indicate operation complete and status condition requiring processor attention. In general, the 5-1/4" Diskette Drive Adapter presents a high-level command interface to software I/O drivers. A block diagram of the 5-1/4" Diskette Drive Adapter is on the following page. 2-89 ~ 1.0 o ,..... CLOCK & TIMING CKT 1 ~ -to WRITE PRECDMP. CKT K WRITE DATA - Ul ............. ~ ...... ~ '---- -to WRITE r _ ~. DATA i'-- .-/I - - - til i:I';"' ('I) VCO SYNC STD. DATA DATA SEPARATOR RO DATA WRITE ENABLE 0.. '--- ~ HEAD SELECT "0 L.. ~ INDEX ''"1"('I)"" I'" - WRITE PROTECT I'" TRACT D ~ o~ i:I';"' l lRESET DIGITAL ~ -B DRIVE A MOTOR ON _. ~ ~ ~ -C CONTROL -V -0 (fQ PORT DECODER DRIVE A SELECT '"1 l,..- IIHR. I 'l -B -c -0 ~ 3 Figure 19. 5%" DISKETTE DRIVE ADAPTER BLOCK DIAGRAM Functional Description From a programming point of view, this attachment consists of an 8-bit digital output register in parallel with a NEC ,uPD765 or equivalent Floppy Disk Controller (FDC). In the following description, drives numbers 0-3 are equivalent to drives A-D respectively. Digital Output Register (DOR) The Digital Output Register (DOR) is an output only register used to control drive motors, drive selection, and feature enable. All bits are cleared by the I/O interface reset line. The bits have the following functions: Bits 0 and 1 These bits are decoded by the hardware to select one drive if its motor is on: Bit 1 0 Drive o 0 0 A o liB 1 0 2 C 1 1 3 D Bit 2 The FDC is held reset when this bit is clear. It must be set by the program to enable the FDC. Bit 3 This bit allows the FDC interrupt and DMA requests to be gated onto the I/O interface. If this bit is cleared, the interrupt and DMA request I/O interface drivers are disabled. Bits 4,5,6, and 7 These bits control respectively the motors of drives 0,1,2,A,B,C, and 3,D. If a bit is clear, the associated motor is off, and the drive cannot be selected. Floppy Disk Controller (FDC) The following is a brief summary of the registers and commands imple- mented by the FDC. The FDC contains two registers which may be accessed by the main system processor; a Status Register and a Data Register. The 8-bit Main Status Register contains the status information of the FDC, and may be accessed at any time. The 8-bit Data Register (actually consisting of several registers in a stack with only one register presented to the data bus at a time) stores data, commands, parameters, and FDD status information. Data bytes are read out of, or written into, the Data 2-91 Register in order to program or obtain the results after a particular command. The Main Status Register may only be read and is used to facilitate the transfer of data between the processor and FDC. The bits in the Main Status Register are defined as follows: Bit Number Name Symbol Description DBOFDD FDD A Busy DAB FDD number is in the Seek mode. DBl FDD B Busy DBB FDD number 1 is in the Seek mode. DB2 FDD C Busy DCB FDD number 2 is in the Seek mode. DB3 FDD D Busy DDB FDD number 3 is in the Seek mode. DB4 FDC Busy CB A read or write command is in process. DBS Non-DMA NDM The FDC is in the non- Mode DMAmode. DB6 Data Input/ DIO Indicates direction of data transfer between FDC and Processor. If DIO = "l", then transfer is from FDC Data Regis- ter to the Processor, If DIO = "0", then transfer is from the Processor to FDC Data Register. DB7 Request for RQM Indicates Data Register is Master ready to send or receive data to or from the Pro- cessor. Both bits DIO and RQM should be used to perform the handshaking functions of "ready" and "direction" to the processor. 2-92 The FDC is capable of perfonning 15 different commands. Each command is initiated by a multi-byte transfer from the processor, and the result after execution of the command may also be a multi-byte transfer back to the processor. Because ofthis multi-byte interchange of infonnation between the FDC and the processor, it is convenient to consider each command as consisting of three phases: Command Phase The FDC receives all information required to perform a particular operation from the processor. Execution Phase The FDC perfonns the operation it was instructed to do. Result Phase After completion of the operation, status and other housekeeping infonnation are made available to the processor. 2-93 Programming Considerations Table 13. Symbol Descriptions The following tables define the symbols used in the command summary which follows. SYMBOL NAME DESCRIPTION AO Address Line 0 AO controls selection of Main Status Register (AO = 0) or Data Register (AO = 1I. C Cylinder Number C stands for the current/selected Cylinder (track) number of the medium. D Data o stands for the data pattern which is going to be written into a Sector. 07-00 Data Bus 8-bit Data Bus, where 07 stands for a most significant bit, and 00 stands for a least significant bit. OTl Data Length When N is defined as 00, OTl stands for the data length which users are going to read out or write into the Sector. EDT End of Track EDT stands for the final Sector number on a Cylinder. GPl Gap length GPl stands for the length of Gap 3 (spacing between Sectors excluding VCD Sync. Field). H Head Address H stands for head number 0 or 1, as specified in 10 field. HO Head H0 stands for a selected head number 0 or 1. (H = H0 in all command words.) HLT Head Load Time HLT stands for the head load time in the FO 0 (4 to 512 ms in 4 ms increments). HUT Head Unload Time HUT stands for the head unload time after a read or write operation has occurred (0 to 480 ms in 32 ms increments.) MF FM or MFM Mode If MF is low, FM mode is selected, and if it is high, MFM mode is selected only if MFM is implemented. MT Multi-Track If MT is high, a multi-track operation is to be performed. (A cylinder under both HOO and H0 1 will be read or written.) N Number N stands for the number of data bytes written in a Sector. NCN New Cylinder NCN stands for a new Cylinder number, which Number is going to be reached as a result of the Seek operation. Desired position of Head. 2-94 Table 13. Symbol Descriptions (continued) SYMBOL NAME OESCRIPTION NO Non-DMA Mode NO stands for operation in the Non-D MA Mode. PCN Present Cylinder PCN stands for Cylinder number at the comple- Number tion of SENSE INTERRUPT STATUS Command, indicating the position of the Head at present time. R Record R stands for the Sector number, which will be read or written. R/W Read/Write R/W stands for either Read (R) or Write (W) signal. SC Sector SC indicates the number of Sectors per Cylinder. SK Skip SK stands for Skip Deleted Data Address Mark. SRT Step Rate Time SRT stands for the Stepping Rate for the FDD. (2 to 32 ms in 2 ms increments.) ST 0 Status 0 ST 0-3 stand for one of four registers which ST 1 Status 1 store the status information after a command ST 2 Status 2 has been executed. This information is available ST3 Status 3 during the result phase after command execu- tion. These registers should not be confused with the main status register (selected by AO = 0). ST 0-3 may be read only after a command has been executed and contain information relevant to that particular command. STP Scan Test During a Scan operation, if STP = 1, the data in contiguous sectors is compared byte by byte with data sent from the processor (or DMA), and if STP = 2, then alternate sectors are read and compared. US~, Unit Select US stands for a selected drive number USl encoded the same as bits 0 and 1 of the digital register (DO R) p 2-91 2-95 Command Summary o indicates 'logical 0' for that bit, 1 means 'logical 1', X means 'don't care'. OATA BUS PHASE RIW 07 06 05 04 03 02 01 00 REMARKS REAO DATA Command W MT MF SK a 0 1 1 a Command Codes W X X X X X HD US1 usa W C Sector 10 W H information prior W R to Command execution W N W EDT W GPl W OTL Execetion Data-transfer between the FDD and main-system Result R ST 0 Status information after R ST 1 Command execution R ST 2 R C Sector 10 information R H after Command execution R R R N READ DELETED DATA Command W MT MF SK a 1 1 0 0 Command Codes W X X X X X HD US1 usa W C Sector 10 information W H prior to Command W R execution W N W EDT W GPl W DTL Execution Data-transfer between the FDD and main-system Result R ST a Status information after R ST 1 command execution R ST 2 R C Sector 10 information R H after command execution R R R N WRITE DATA Command W MT MF a 0 a 1 0 1 Command Codes W X X X X X HD US1 usa W C Sector 10 information W H to command execution W R W N W EDT W GPl W DTl Execution Data-transfer between the main-system and FDD Result R STO Status information after R ST 1 command execution R ST 2 R C Sector 10 information R H after command execution R R R N 2-96 Command Summary (continued) OATA BUS PHASE RIW 07 06 05 04 03 02 01 00 REMARKS WRITE DELETED DATA Command W MT MF 0 0 1 0 0 1 Command Codes W X X X X X HD US1 usn W C Sector 10 information W H prior to command W R execution W N W EDT W GPL W DTl ~ Execution Data-transfer between t:~ ~ F0 D and mai n-system Result R STO Status 10 information R ST 1 after common execution F.: R ST 2 R C Sector 10 information R H after command execution R R R N READ A TRACK Command W 0 MF SK 0 0 0 1 0 Command Codes W X X X X X HD US1 USD W C Sector 10 information W H prior to command W R execution W N W EDT W GPL W DTl Execution Data-transfer between the F0 0 and main-system_ FDC reads all of cylinders contents from index hole to EDT. Result R STO Status information after R ST 1 command execution R ST 2 R C Sector ID information R H after command execution R R R N READID Command W 0 MF 0 0 1 0 1 0 Command Codes W X X X X X HD US1 USD Execution The first correct ID information on the cylinder is stored in data register. Result R ST 0 Status information R ST 1 after command execution R ST 2 R C Sector 10 information R H during execution phase R R R N 2-97 Command Summary (continued) OATA BUS PHASE RIW 07 06 05 04 03 02 01 00 REMARKS FORMAT A TRACK Command W a MF a a 1 1 a a Command Codes W X X X X X HO USl usa W N Bytes/Sector W SC Sector/Track W GPL Gap 3 W 0 filler byte Execution FOC formats an entire cylinder Result R ST a Status information R ST 1 after command R ST 2 execution R C In this case, the ID R H information has no R R meaning R N SCAN EQUAL Command W MT MF SK 1 a a a 1 Command Codes W X X X X X HD US1 usa W C Sector ID information W H prior to command W R execution W N W EDT W GPL W STP Execution Data compared between the FDD and main-system Result R ST a Status information after R ST 1 command execution R ST 2 R C Sector ID information R H R R R N SCAN LOW OR EQUAL Command W MT MF SK 1 1 a a 1 Command Codes W X X X X X HD US1 usa W C Sector ID information W H prior to command W R execution W N W EDT W GPL W STP Execution Data compared between the FDD and main-system Result R STO Status information after R ST 1 command execution R ST 2 R C Sector ID information R H after command execution R R R N 2-98 Command Summary (continued) DATA BUS PHASE R/W 07 06 05 04 03 02 01 DO REMARKS Command W MT , SCAN HIGH OR EQUAL MF SK 1 0 , , Command Codes W X X X X X HO US, USO W C Sector ID information W H prior to command W R execution W N W EDT W GPL W STP Execution Data compared between the F0 D and main-system Result R ST 0 Status information after R ST' command execution R ST 2 R C Sector ID information R H after command execution R R R N Command W 0 0 0 RECALIBRATE 0 0 , , , Command Codes W X X X X X 0 US, usa Execution Head retracted to track 0 No Result Phase SENSE INTERRUPT STATUS Command W 0 0 0 0 1 0 0 0 Command Codes Result R ST 0 Status information at R PCN the end of seek opera- tion about the FOC Command W 0 0 0 SPECIFY 0 0 0 , , Command Codes W -SRT HUT- W --HLT ND No Result Phase SENSE DRIVE STATUS Command W 0 0 0 0 0 1 0 0 Command Codes W X X X X X HO US1 usa Result R ST3 Status information about FO 0 Command W 0 0 0 0 SEEK 1 , , 1 Command Codes W X X X X X HO US1 usa w NCN Execution Head is positioned over proper cylinder on diskette No Result Phase INVALID Command W Inval id Codes Invalid command codes (NoOp - FOC goes into standby statel Result R STO ST 0; 80 2-99 Command Status Registers Table 14. Status Register 0 BIT NO. NAME SYMBOL DESCRIPTION 07 07 = 0 and 06 = 0 Interrupt IC Normal termination of command, (NT), Code Command was completed and properly executed. 06 07 = 0 and 06 =1 Abnormal termination of command, (AT). Execution of command was started, but was not successfully completed. 07 =1 and 06 = 0 Invalid command issue (lC). Command which was issued was never started. 07 = 1 and 06 =1 Abnormal termination because during command execution the ready signal from FOO changed state. 05 Seek End SE When the FOC completes the Seek command, this flag is set to 1 (high). 04 Equipment EC If a fault signal is received from the Check FOO, or if the track 0 signal fails to occur after 77 step pulses (recalibrate command) then this flag is set. 03 Not Ready NR When the FO 0 is in the not-ready state and a read or write command is issued, this flag is set. If a read or write command is issued to side 1 of a single sided drive, then this flag is set. 02 Head Address HO This flag is used to indicate the state of the head at interrupt. 01 Unit Select 1 US 1 These flags are used to indicate a Orive 00 Unit Select 0 US 0 unit Number at interrupt. 2-100 Table 15. Status Register 1 BIT NO. NAME SYMBOL DESCRIPTION 07 End of Cylinder EN When the F0 C tries to access a sector beyond the final sector of a cylinder, this flag is set. 06 05 04 - Data Error Over Run - DE OR Not used. This bit is always 0 (low). When the FOC detects a CRC error in either the 10 field or the data field, this flag is set. If the FOC is not serviced by the main- systems during data transfers within a • ~ E ~ g f:.:. certain time interval, this flag is set. 03 - - Not used. This bit is always 0 (low). 02 No Data NO During Execution of a Read Data, Write Deleted Data, or Scan command, if the FDC cannot find the sector specified in the 10 register, this flag is set. During execution of the Read 10 command, if the FDC cannot read the 10 field without an error, then this flag is set. During the execution of the Read-a- Cylinder command, if the starting sector cannot be found, then this flag is set. 01 Not Writable NW During Execution of a Write Data, Write Deleted Data, or Format a Cylinder command, if the FOC detects a write protect signal from the F0 0, then th is flag is set. DO Missing Address MA If the FDC cannot detect the 10 Address Mark Mark, this flag is set. Also at the same time, the MO (Missing Address Mark in Data Field) of Status Register 2 is set. 2-101 Table 16. Status Register 2 BIT NO. NAME SYMBOL DESCRIPTION D7 - - Not Used. This bit is always 0 {low!. D6 Control Mark CM During execution of the Read Data or Scan command, if the FDC encounters a sector which contains a Deleted Data Address Mark, this flag is set. D5 Data Error in DD If the FDC detects a CRC error in the Data Field data then th is flag is set. D4 Wrong Cylinder WC This bit is related with the ND bit, and when the contents of C on the medium are different from that stored in the ID Register, this flag is set. D3 Scan Equal Hit SH During execution of the Scan command, if the condition of "equal" is satisfied, th is flag is set. D2 Scan Not SN During execution of the Scan command, Satisifed if the FDC cannot find a sector on the cylinder which meets the condition, then th is flag is set. Dl Bad Cylinder BC This bit is related with the ND bit, and when the contents of C on the medium are different from that stored in the ID Register, and the content of C is FF, then this flag is set. DO Missing Address MD When data is read from the medium, if Mark in Data the FDC cannot find a Data Address Field Mark or Deleted Data Address Mark, then this flag is set. 2-102 Table 17. Status Register 3 BIT NO. NAME SYMBOL DESCRIPTION D7 Fault FT This bit is used to indicate the status of the Fault signal from the FDD. D6 Write Protected WP This bit is used to indicate the status of the Write Protected signal from the FDD. D5 Ready RY This bit is used to indicate the status of the Ready signal from the FDD. ~ ~ ~ D4 Track 0 TO This bit is used to indicate the status of the Track 0 signal from the FDD. ~ D3 Two Side TS This bit is used to indicate the status of the Two Side signal from the FDD. D2 Head Address HD This bit is used to indicate the status of Side Select signal to the FDD. D1 Unit Select 1 US 1 This bit is used to indicate the status of the Unit Select 1 signal to the FDD. DO Unit Select 0 US 0 This bit is used to indicate the status of the Unit Select 0 signal to the FDD. Programming Summary DPC Registers (Ports) FDC Data Reg I/O Address 3F5 FDC Main Status Reg I/O Address 3F4 Digital Output Reg I/O Address 3F2 Bit 0 Drive 00: DR #A 10: DR #C 1 Select 01: DR #B 11: DR #D 2 Not FDC Reset 3 Enable INT & DMA Requests 4 Drive A Motor Enable 5 Drive B Motor Enable 6 Drive C Motor Enable 7 Drive D Motor Enable All bits cleared with channel reset. 2-103 Interrupt 6 DMA 2 100 Disk Format 1 Head, 45 cylinders, 8 sectors/TRK, 512 bytes/sector,MFM. FDC Constants N: H'02', SC: 08, HUT: F, SRT: C, GPL FORMAT: H'05', GPL RD/WR: 2A, HLT: 01, (8ms track-track) Drive Constants HD Load 35 ms HD Settle 25 ms Motor Start 500 ms Comments 1. Head loads with drive select, wait HD Load time before RD/WR. 2. Following access, wait HD Settle time before RD/WR. 3. Drive motors should be offwhen not in use. Only A or Band C or: may run simultaneously. Wait Motor Start time before RD/WR. 4. Motor must be on for drive to be selected. 5. Data Errors can occur while using a Home Television as the system display. Locating the TV too close to the diskette area can cause this to occur. To correct the problem, move the TV away from, or to the opposite side of the System Unit. System I/O Channel Interface All signals are TTL compatible: MPUL 5.5 Vdc LPUL 2.7 Vdc MPDLO.5 Vdc LPDL -0.5 Vdc The following lines are used by this adapter. +DO-7 (Bidirectional, Load: 1 74LS; Driver: 74LS 3-state) These eight lines form a bus by which all commands, status, and data are transferred. Bit 0 is the low- order bit. 2-104 + AO-9 (Adapter Input, Load: 1 74LS) These ten lines form an address bus by which a register is selected to receive or supply the byte transferred via lines DO-7. Bit 0 is the low-order bit. +AEN (Adapter Input, Load: 1 74LS) The content of lines AO-9 is ignored if this line is active. -lOW (Adapter Input, Load: 1 74 LS) The content of lines DO-7 is stored in the register addressed by lines AO-9 or DACK2 at the trailing edge of this signal. -lOR (Adapter Input, Load: 1 74LS) The content of the register addressed by lines AO-9 or DACK2 is gated onto lines DO-7 when this line is active. -DACK2 (Adapter Input, Load: 2 74LS) This line active degates output DRQ2, selects the FDC data register as the source/destination of bus DO-7, and indirectly gates T/C to IRQ6. +T/C (Adapter Input, Load: 474LS) This line and DACK2 active indicates that the byte of data for which the DMA count was initialized is now being transferred. +RESET (Adapter Input, Load: 1 74LS) An up level aborts any operation in process and clears the Digital Output Register (DOR). +DRQ2 (Adapter Output, Driver: 74LS 3-state) This line is made active when the attachment is ready to transfer a byte of data to or from main storage. The line is made inactive by DACK2 becoming active or an I/O read of the FDC data register. +IRQ6 (Adapter Output, Driver: 74LS 3-state) This line is made active when the FDC has com- pleted an operation. It results in an interrupt to a routine which should examine the FDC result bytes to reset the line and determine the ending condition. 2-105 Drive A and B Interface All signals are TTL compatible: MPUL 5.5 Vdc LPUL 204 Vdc MPDLOo4 Vdc LPDL -0.5 Vdc All adapter outputs are driven by open-collector gates. The drive(s) must provide termination networks to Vcc (except Motor Enable 1 which has a two kohm resistor to Vcc). Each adapter input is terminated with a 150 ohm resistor to Vcc. Adapter Outputs -Drive Select A&B (Driver: 7438) These two lines are used by drives A&B to degate all drivers to the adapter and receivers from the attachment (except Motor Enable) when the line associated with a drive is not active. -Motor Enable A&B (Driver: 7438) The drive associated with each of these lines must control its spindle motor such that it starts when the line becomes active and stops when the line becomes not active. -Step (Driver: 7438) The selected drive moves the read/write head one cylinder in or out per the direction line for each pulse present on this line. -Direction (Driver: 7438) F or each recognized pulse of the step line the read/write head moves one cylinder toward the spindle if this line is active, and away from the spindle if not-active. -Write Data (Driver: 7438) For each not-active to active transition of this line while Write Enable is active, the selected drive causes a flux change to be stored on the disk. -Write Enable (Driver: 7438) The drive disables write current in the head unless this line is active. 2-106 Adapter Inputs -Index The selected drive supplies one pulse per disk revolution on this line. -Write Protect The selected drive makes this line active if a write protected diskette is mounted in the drive. -Track 0 The selected drive makes this line active if the read/write head is over track O. -Read Data The selected drive supplies a pulse on this line for each flux change encountered on the disk. 2-107 5-1/4" Diskette Drive Adapter Internal Interface Specifications 34 PIN KEYED EDGE CONNECTOR NOTE: LANDS 1-33 ARE ON THE BACKSIDE OF THE BOARD, LANDS 2-34 ARE ON THE FRONT, OR COMPONENT SIDE. COMPONENT SIDE AT STANDARD TTL LEVELS Land No. Graund-Odd Numbers 1-33 Unused 2,4,6 .. -.. Index 8 ... Motor Enable A Drive Select B 10 12 ,~ ... IBM 51/4" ... Drive Select A Motor Enable B 14 16 5 1/4" Diskette , Diskette Direction (Stepper Motor) 18 Drive :... Drives .. "'" Step Pulse 20 Adapter ....... I' Write Data 22 ~ Write Enable 24 .... "'" Track 0 Write Pratect 26 28 ... ..- ~ Read Data Select Head 1 30 32 .. I'" Unused 34 2-108 5-1/4" Diskette Drive Adapter External Interface Specifications REAR PANEL 37 PIN 'D' SHELL CONNECTOR 0 • • 20 • •• • • • • • • • • • • • • • • • • • • • • • • • •• • • • • • 19 • • 37 0 AT STANDARD TTL LEVELS Pin no. Unused 1 ·5 Index 6 ...• I~ Motor Enable C 7 .... ... Drive Select D 8 ""'..." Drive Select C 9 ' .... I~ Motor Enable D 10 ""II" I~ Direction (Stepper Motor) 11 5)1,," Diskette External ""II" Drives .... ~ Step Pulse 12 Drive ....... Select Head 1 13 Adapter I ... Write Enable 14 Track 0 15 . --.. Write Protect Read Data 16 17 ....... . po .... Write Data 18 Ground 20·37 2-109 5-1/4" Diskette Drive The IBM 5-1/4" Diskette Drive is a single sided, double density, 40 track unit. The Diskette Drive has a formatted capacity of 163,840 bytes, and is capable of reading and recording digital data using Modified Frequency Modulation (MFM) methods. User access for diskette loading is provided by way of a slot located at the front of the unit. The Diskette Drive is fully self-contained and requires no operator intervention during normal operation. The Drive consists of a spindle drive system, a head positioning system, and read/write/erase system. When the front latch is opened, access is provided for the insertion of a diskette. The diskette is positioned in place by plastic guides, and the front latch. In/out location is ensured when the diskette is inserted until a back stop is encountered. Closing the front latch activates the cone/clamp system resulting in centering of the diskette and clamping of the diskette to the drive hub. The drive hub is driven at a constant speed of 300 rpm by a servo controlled DC motor. In operation, the magnetic head is loaded into contact with the recording medium whenever the front latch is closed. The magnetic head is positioned over the desired track by means of a 4-phase stepper motor/band assembly and its associated electronics. This positioner employs a one-step rotation to cause a I-track linear movement. When a write-protected diskette is inserted into the Drive, the write-protect sensor disables the write electronics of the Drive and an appropriate signal is applied to the interface. When performing a write operation, a 0.33 mm (O.013-in.) data track is recorded. This track is then tunnel erased to 0.30 mm (0.012 in.). Data recovery electronics include a low-level read amplifier, differen- tiator, zero-crossing detector, and digitizing circuits. All data decoding is provided by the adapter card. The Drive is also supplied with the following sensor systems: (1) A track 00 switch which senses when the Head/Carriage assembly is positioned at Track 00. (2) The index sensor, which consists of a LED light source and phototransistor, is positioned such that when an index hole is detected, a sigital signal is generated. 2-110 (3) The write-protect sensor disables the Diskette Drive electronics whenever a write-protect tab is applied to the diskette. For Interface Information, refer to the Diskette Drive Adapter section. Diskettes The IBM 5-1/4" Diskette Drive uses a standard 133.4 mm (5.25 in.) diskette. For programming considerations, single sided, double density soft sectored diskettes are used. The figure below is a simplified drawing of the diskette used with the Diskette Drive. This recording medium is a flexible magnetic disk enclosed in a protective jacket. The protected disk, free to rotate within the jacket, is continuously cleaned by the soft fabric lining of the jacket during normal operation. Read/Write erase head access is made through an opening in the jacket. Openings for the drive hub and diskette index hole are also provided. 3.56 mm 10.140 INCH) I1 6.30 + 0.25 mm 133.4 mm I - - ~F 10.25 + 0.01 INCH) I" 15.25 INCH) ·1 1 ~~~~~~TIVE~{ /' -- ----- " " m k 1 I - JACKET I -, / ml IOXIOECOATED ""\ -- -- ru-:- @ ~~ ~ 133.4 mm 15.25]'''", (Af5J / MYLAR DISK "''"co I rn or U''"~TV) '-3 :~~:~ I I" :;.;·::~~H) ·1- - ~ O--~~:~TU// I '~ __ /' RECORDING MEDIUM 2-111 Table 18. Mechanical and Electrical Specifications Media Industry-compatible 5Yo-inch diskette Tracks per inch 48 Number of Tracks (40) Dimensions Height 85.85 mm (3.38 inches) Width 149.10 mm (5.87 inches) Depth 203.2 mm (8.0 inches) Weight 2.04 Kg (4.5 Ibs.) Temperature (Exclusive of Media) Operating 100e to 44 0e (50 0 F to 112 0 F) Non-operating -40 0e to BOoe (-40 0 F to 140 0 F) Relative Humidity (Exclusive of Media) Operating 20% to 80% (Non-condensing) Non-operating 5% to 95% (Non-condensing) Seek Time 8 msec track to track Head Setting Time 25 msec (last track addressed) Error Rate 1 per 10 9 (recoverable) 1 per 10 12 (non-recoverable) 1 per 10 6 (seeks) Head Life 20,000 hours (normal use) Media Life 3.0 x 10 6 passes per track Disk Speed 300 rpm ± 1.5% (long term) Instantaneous Speed Variation ±3.0% Start/Stop Time 500 msec (maximum) Transfer Rate 250 K bits/sec Recording Mode MFM Power +12 de ± O.Bv 900 ma AVE. +5v dc ± 0.25 v, BOO ma AVE. 2-112 Memory Expansion Options Two Memory Expansion Options offered for the IBM Personal Computer are the 32K x 9 and the 64K x 9 Memory Expansion Options. These options plug into any of the five System Expansion slots on the System Board. These options are used to extend system memory beyond 64KB. A maximum of 64KB of memory may be installed on the System Board as modules without using any System Expansion Slots or Expansion Options. An expansion option must be configured to reside at sequential 3 2K or 64K memory address boundary within the system address space. This is done by setting dip switches on the option. The expansion options are designed with 250 ns access 16K x I dynamic memory chips. On the 32KB card, 16-pin industry standard parts are used. On the 64KB card, stacked modules are used resulting in a 32K x 1I8-pin module. This allows the 32KB and 64KB to have approximately the same packaging densities. Both expansion options are parity checked and if a parity error is detected, a latch is set and an I/O channel check line is activated, indicating an error to the processor. In addition to the memory modules, the expansion options contain the following circuits: bus buffering, dynamic memory timing generation, address multiplexing, and card select decode logic. Dynamic memory refresh timing and address generation are functions which are not performed on the expansion options but are done once on the System Board and made available in the I/O channel for all devices. To allow the System to address 32KB and 64KB Memory Expansion Options, refer to the system configuration switch settings page 2-28. Operating Characteristics The System Board operates at a frequency of 4.77 Mhz, which results in a clock frequency of 210 ns. Normally, four clock cycles are required for a bus cycle so that an 840 nsec memory cycle time is achieved. Memory write and memory read cycles both take four clock cycles, or 840 ns. 2-113 General specifications for memory used on both cards are: Access - 250 ns Cycle - 410 ns Memory Module Description Each option contains 18 dynamic memory modules. The 32KB Memory Expansion Option utilizes 16K x 1 bit modules and the 64KB Memory Expansion Options utilizes 32K x 1 bit modules. Both memory modules require three voltage levels (+5Vdc, -5Vdc, + 12Vdc) and 128 refresh cycles every 2 msec. Absolute maximum access times are: From RAS: 250 ns From CAS: 165 ns Table 19. Memory Module Pin Configuration PIN 16K X 1 BIT MODULE 32K X 1 BIT MODULE NO. (Used on 32KB Card) (Used on 64KB Card) 1 - 5V - 5V 2 Data In ** Data In ** 3 - Write - Write 4 - RAS - RASO 5 AO - RAS 1 6 A2 AO 7 A1 A2 8 +12V A1 9 +5V +12V 10 A5 +5V 11 A4 A5 12 A3 A4 13 A6 A3 14 Data Out ** A6 15 - CAS Data Out ** 16 GNO - CAS 1 17 -* - CASO 18 - * GNO * 16K X 1 bit module has only 16 pins. ** Data In and Data Out are tied together (three state bus). 2-114 Switch - Configurable Start Address Each card has a small DIP Module which contains eight switches. The switches are used to set the card start address as follows: Table 20. DIP Module Start Address NO. DESCRIPTION 1 ON: A19=Q; OFF: A19=1 2 ON: A18=Q; OFF: A18=1 3 ON: A17=Q; OFF: A17=l 4 ON: A16=Q; OFF: A16=1 5 ON: A15=Q; OFF: A15=1 * 6 Not Used 7 Not Used 8 Used Only In 64KB RAM Card * * Switch No.8 may be set on the 64KB Memory Expansion Option to use only half the memory on the card {i.e., 32KBI. If Switch No.8 is ON, all 64KB is accessible. If Switch No.8is OFF,address bitA15 (asset by Switch No.5) is used to determine which 32KB are accessible and the 64KB option behaves exactly like a 32KB option. 2-115 NOTES 2-116 Game Control Adapter The Game Control Adapter allows the system to attach paddles and joysticks. Up to four paddles or two joysticks may be attached. In addition, four input for switches are provided. Paddle and joystick positions are determined by changing resistive values sent to the adapter. The adapter plus system software converts the present resistive value to a relative paddle or joystick position. On receipt of an output signal, four timing circuits are started. By determining the time required for the circuit to time out (a function of the resistance), the paddle position can be determined. This card could be used as a general purpose I/O card with four analog (resistive) inputs plus four digital input points. This card fits into any of the five System Board I/O slots. The game control interface cable attaches to the rear of the card which protrudes through the rear panel of the System Unit. Game Control Adapter Block Diagram A9 - AD .JI.. • I 10 ...) p AEN .. p INSTRUCTION DECODE CONVERT RESISTANCE TO , A RESISTIVE INPUT 4 I lOW ..... DIGITAL PULSE " lOR .. !--- p - 07-00 ....- TYPICAL FREQUENCY OF 833 H~ A DATA BUS A ... 8 BUFFER! ( 4 DRIVER " DIGITAL INPUTS , ~ .of 4 I " Figure 20. GAME CONTROL ADAPTER BLOCK DIAGRAM 2-117 Functional Description Address Decode The select on the Game Control Adapter is generated by two 74LS138's as an address decoder. AEN must be inactive while the address is 201 in order to generate the select. The select allows a write to fire the one-shots or a read to give the values ofthe trigger buttons and one-shot outputs. Data Bus Buffer/Driver The data bus is buffered by a 74LS244 buffer/driver. For an IN from address X'20 1" the Game Control Adapter will drive the data bus; at all other times the buffer is left in the high impedance state. Trigger Buttons The trigger button inputs are read via an IN from address X'201'. A trigger button is on each joystick/paddle. These values are seen on data bits 7 through 4 (see Software Interface sub-section). These buttons default to an open state and are read as "1". When a button is depressed, it is read as "0". Software should be aware that these buttons are NOT debounced in hardware. Joystick Positions The joystick position is indicated by a potentiometer for each coordinate. Each potentiometer has a range from 0 to 100 K ohms that varies the time constant for each of the four one-shots. As this time constant is set at different values, the output of the one-shot will be of varying durations. All four one-shots are fired at once by an OUT to address X'20 1'. All four one-shot outputs will go true after the fire pulse and will remain high for varying times depending on where each potentiometer is set. These four one-shot outputs are read via an IN from address X'201' and are seen on data bits 3 through O. 2~118 I/O Channel Description A9-AO: Address lines 9 through 0 are used to address the Game Control Adapter. D7-DO: Data lines 7 through 0 are the data bus. lOR, lOW: I/O Read and I/O Write are used when read- ing from or writing to an adapter (IN, OUT). AEN: When active, the adapter must be inactive and the data bus driver inactive. +SV: Power for the Game Control Adapter. GND: Common ground. AI9-AlO: Unused MEMR,MEMW: Unused DACKO-DACK3: Unused IRQ7-IRQ2 Unused DRQ3-DRQI: Unused ALE, TIC: Unused CLK,OSC: Unused I/O CHCK: Unused I/O CHRDY: Unused HRQ I/O CH: Unused RESETDRV: Unused -Sv, +12v, -12v: Unused Interface Description The Game Control Adapter has 8 input lines, 4 of which are digital inputs and 4 of which are resistive inputs. The inputs are read with one IN from address x'20 I '. The 4 digital inputs each have a IK ohm pullup resistor to +SV. With no drive on these inputs, a 'I' is read. For a '0' reading, the inputs must be pulled to ground. The 4 resistive inputs, measured to +SV, will be converted to a digital pulse with a duration proportional to the resistive load, acccording to the following equation: Time = 24.2 J.Lsec + 0.011 (r) J.Lsec 2-119 The user must first begin the conversion by an OUT to address x'20 I'. An IN from address x'201' will show the digital pulse go high and remain high for the duration according to the resistance value. All four bits (Bit 3-Bit 0) function in the same manner, their digital pulse will all go high simultaneously and will reset independently according to the input resistance value. Input from address x'201' Bit 7 , Bit 6 I Bit 5 Bit 4 Bit 3 , Bit 2 Bit 1 Bit 0 --- Digital Inputs J -- Resistive Inputs I The typical input to the Game Control Adapter is a set of joysticks or game paddles. The joysticks will typically have a set of two joysticks (A&B). These will have one or two buttons each with two variable resistances each, with a range from 0 to 100 K ohms. One variable resistance will indicate the X coordinate and the other variable resistance will indicate the Y coordinate. This should be attached to give the following input data: Bit 7 Bit 6 Bit 5 Bit4 Bit 3 Bit 2 Bit 1 Bit 0 B·#l B-#l A·#2 A·#l B·Y B·X A·Y A·X Button Button Button Button Coord. Coord. Coord. Coord. The game paddles will have a set of two (A&B) or four (A,B,C, & D) paddles. These will have one button each and one variable resistance each, with a range from 0 to lOOK ohms. This should be attached to give the following input data: Bit 7 Bit 6 Bit 5 Bit4 Bit3 Bit 2 Bit 1 Bit 0 D C B A 0 C B A Button Button Button Button Coord. Coord. Coord. Coord. A schematic diagram for attaching a set of game controllers is on page 2-121. 2-120 ~ 15 PIN MALE '0' SHELL o CONNECTOR _. "< ~ "" ~ JOYSTICK B _-..... JOYSTICK A ~ ~------------, --- 1 \ r-------------~ CI:I I I /-- • I I ~ I I I 2 I I ::r I I X COORDINATE 9 . I J X COORDINATE I I (1) 3 I I • I L- BUTTON ~ I _. ~ BUTT~J ! ! [' ~ "" , i:~ : :'" 3 ~ Y COORDINATE I I 12 ! 5 • I I I : I I .. I I • 6 : I Y COORDINATE I I 13 • I I ~ I I I I I I II 14 • 7 • I I I I I • 8 I IL _____________ I J" 1 15 • II IL _____________ ...J -- ...... ---- -/ / I NOTE: POTENTIOMETER FOR X & Y COORDINATES HAS A RANGE OF 0 TO 100KS1. -- N BUTTON IS NORMALL V OPEN; CLOSED WHEN DEPRESSED. I N Figure 21. JOYSTICK SCHEMATIC 311VMOIIVH Game Controller Adapter (Analog Input) Connector Specifications REAR PANEL 15 PIN "0" SHEll CONNECTOR 0 · _·C-6 1 • • • • • • • • •• 9 0 ~ 0~ • • • • • 15 0 AT STANDARD TTL LEVELS Voltage AMP Pin No. + 5 Volts 1 ......... Button 4 2 ..... Position 0 Ground 3 4 .... Ground 5 Position 1 6 .. External Devices Button 5 7 ....... Game Control Adapter + 5 Volts 8 ......... ..... .... + 5 Volts 9 Button 6 10 .......... Position 2 Ground 11 12 .. Position 3 13 ..... Button 7 14 ---.. ... ~ + 5 Volts 15 .... 2-122 Asynchronous Communications Adapter The Asynchronous Communications Adapter is a 4"H x 5"W card that plugs into a System Expansion Slot. All system control signals and voltage requirements are provided through a 2 x 31 position card edge tab. Ajumper module is provided to select either RS-232-C or current loop operation. The adapter is fully programmable and supports asynchronous communications only. It will add and remove start bits, stop bits, and parity bits. A programmable baud rate generator allows operation from 50 baud to 9600 baud. Five, six, seven or eight bit characters with 1, 1-1/2, or 2 stop bits are supported. A fully prioritized interrupt system controls transmit, receive, error, line status and data set interrupts. Diagnostic capabilities provide loopback functions oftransmitlreceive and input/output signals. Figure (22) is a block diagram of the Asynchronous Communications Adapter. The heart of the adapter is a INS8250 LSI chip or functional equiva- lent. The following is a summary of the 8250's key features: • Adds or Delete Standard Asynchronous Communication Bits (Start, Stop, and Parity) to or from Serial Data Stream. • Full Double Buffering Eliminates Need for Precise Synchronization. • Independently Controlled Transmit, Receive, Line Status, and Data Set Interrupts. • Programmable Baud Rate Generator Allows Division of Any Input Clock by 1 to (2 16-1) and Generates the Intemal16x Clock. • Independent Receiver Clock Input. • MODEM Control Functions Clear to Send (CTS), Request to Send (RTS), Data Set Ready (DSR), Data Terminal Ready (DTR), Ring Indicator (RI), and Carrier Detect. • Fully Programmable Serial-Interface Characteristics 5-, 6-, 7-, or 8-Bit Characters Even, Odd, or No-Parity Bit Generation and Detection 1-, 1 1/2-, or 2-Stop Bit Generation Baud Rate Generation (DC to 9600 Baud) 2-123 • False Start Bit Detection. • Complete Status Reporting Capabilities. • Line Break Generation and Detection. • Internal Diagnostic Capabilities. Loopback Controls for Communications Link Fault Isolation. Break, Parity, Overrun, Framing Error Simulation. • Full Prioritized Interrupt System Controls. All communications protocol is a function of the system microcode and must be loaded before the adapter is operational. All pacing ofthe interface and control signal status must be handled by the system software. Asynchronous Communications Block Diagram ADDRESS BUSS CHIP SELECT ADDRESS DECODE DATA BUS INTERRUPT 8250 ASYNCHRONOUS COMMUNICATIONS OSCILLATOR ELEMENT 1.8432 Mhz EIA RECEIVERS ~ .. EIA ORIVERS A -1 CURRENT LOOP f- A L J ... 25 PIN "O"SHELLCONNECTOR Figure 22. ASYNCHRONOUS COMMUNICATIONS ADAPTER BLOCK DIAGRAM 2-124 Modes of Operation The different modes of operation are selected by programming the 8250 Asynchronous Communications Element. This is done by selecting the I/O address (3F8 to 3FF) and writing data outtothe card. Address bit AO, Al and A2 select the different registers which define the modes of operation. Also, the Divisor Latch Access Bit (Bit 7) of the line control register is used to select certain registers. I/O Decode for Communications Adapter Table 21. I/O Decodes (3F8 to 3FF) I/O DECODE REGISTER SELECTED DLABSTATE 3F8 TX BUFFER DLAB=O (WRITE) 3F8 RX BUFFER DLAB=O (READ) 3F8 DIVISOR LATCH LSB DLAB=l 3F9 DIVISOR LATCH MSB DLAB=l 3F9 INTERRUPT ENABLE REGISTER DLAB=O 3FA INTERRUPT IDENTIFICATION REGISTERS 3FB LINE CONTROL REGISTER 3FC MODEM CONTROL REGISTER 3FD LINE STATUS REGISTER 3FE MODEM STATUS REGISTER ADDRESS BITS A9 A8 A7 A6 A5 A4 A3 A2 A1 AD DLAB REGISTER 3F8 to 3FF 1 1 1 1 1 1 1 X X X 0 0 0 0 Receive Buffer (read), Transmit Holding Reg. (write) 0 0 1 0 Interrupt Enable 0 1 0 X Interrupt Identification 0 1 1 X Line Control 1 0 0 X Modem Control 1 0 1 X Line Status 1 1 0 X Modem Status 1 1 1 X None 0 0 0 1 Divisor Latch (LSB) 0 0 1 1 Divisor latch (MSB) A2, Al and AO bits are "Don't Cares" and are used to select the different register of the communications chip. 2-125 Interrupts One interrupt line is provided to the system. This interrupt is IRQ4 and will be positive active. To allow the communications card to send interrupts to the system, Bit 3 of the Modem Control Register must be set = 0 (low). At this point, any interrupts allowed by the Interrupt Enable Register will cause an interrupt. The data format will be as follows: TRANSMITTER OUTPUT AND RECEIVER INPUT 00 01 02 03 04 05 06 07 Transmit Oata Marking Data Bit 0 is the first bit to be transmitted or received. The adapter automatically inserts the start bit, the correct parity bit if programmed to do so, and the stop bit (1, 1-1/2 or 2 depending on the command in the Line Control Register). Interface Description The communications adapter provides an EIA RS-232-C like inter- face. One 25 pin "D" shell, male type connector is provided to attach various peripheral devices. In addition, a current loop interface is also located in this same connector. Ajumper block is provided to manually select either the voltage interface, or the current loop interface. The current loop interface is provided to attach certain printers provided by IBM Corporation that use this particular type of interface. Pin 18 + receive current loop data (20Ma) Pin 25 - receive current loop return (20Ma) Pin 9 + transmit current loop return (20Ma) Pin 11 - transmit current loop data (20Ma) 2-126 +5V I TRANSMIT CIRCUIT I ~ 4990 ~o~~ :.PIN9 Tx DATA ---~~VV'l.""-- - - - - - - - -.- . PIN 11 +5V RECEIVE CIRCUIT 5.6Krl OPTO ISOLATOR --+-...., PIN 18 .... : : 0 - - - Rx DATA PIN 25 4 - - - t - - ' +5V Figure 23. CURRENT LOOP INTERFACE The voltage interface is a serial interface. It supports certain data and control signals as listed below. Pin 2 Transmit Data Pin 3 Receive Data Pin 4 Request to Send Pin 5 Clear to Send Pin 6 Data Set Ready Pin 7 Signal Ground Pin 8 Carrier Detect Pin 20 Data Terminal Ready Pin 22 Ring Indicate The adapter converts these signals to/from TTL levels to EIA voltage levels. These signals are sampled or generated by the communication control chip. These signals can then be sensed by the system software to determine the state of the interface or peripheral device. 2-127 Voltage Interchange Information Interface Interchange Voltage Binary State Signal Condition Control Function Positive Voltage = Binary (0) =Spacing =On Negative Voltage = Binary (1) = Marking =Off Invalid Levels +15V----------- On Function +3V - - - - - - - - - - - 0\1 Invalid Levels -3V - - - - - - - - - - - Off Function -15V----------- Invalid Levels The signal will be considered in the "marking" condition when the voltage on the interchange circuit, measured at the interface point, is more negative than minus three volts with respect to signal ground. The signal will be considered in the "spacing" condition when the voltage is more positive than plus three volts with respect to signal ground. The region between plus three volts and minus three volts is defined as the transition region, will be considered in invalid levels. The voltage which is more negative than -15V or more positive than +15V will be considered in invalid levels. During the transmission of data, the "marking" condition will be used to denote the binary state "one" and "spacing" condition will be used to denote the binary state "zero". For interface control circuits, the function is "on" when the voltage is more positive than +3V with respect to signal ground and is "off" when the voltage is more negative than -3V with respect to signal ground. 2-128 INS8250 Functional Pin Description The following describes the function of all INS8250 input/output pins. Some of these descriptions reference internal circuits. Note: In the following descriptions, a low represents a logic 0 (0 volt nominal) and a high represents a logic I (+2.4 volts nominal). Input Signals Chip Select (SCO, CSt, CS2), Pins 12-14: When CSO and CSI are high and CS2 is low, the chip is selected. Chip selection is complete when the decoded chip select signal is latched with an active (low) Address Strobe (ADS) input. This enable comunication between the INS8250 and the CPU. Data Input Strobe (DISTRDISTR) Pins 22 and 21: When DISTR is high or DISTRis low while the chip is selected, allows the CPU to read status information or data from a selected register of the INS8250. Note: Only an active DISTR or DISTR input is required to transfer data from the INS8250 during a read operation. Therefore, tie either the DISTR input permanently low or the DISTR input permanently high, if not used. Data Output Strobe (DOSTR, DOSTR), Pins 19 and 18: When DOSTR is high or DOSTR is low while the chip is selected, allows the CPU to write data or control words into a selected register of the INS8250. Note: Only an active DOSTR or DOSTR input is required to transfer data to the INS8250 during a write operation. Therefore, tie either the D PSTR input permanently low or the DOS TR input permanently high, if not used. Address Strobe (ADS), Pin 25: When low, provides latching for the Register Select (AO, AI, A2) and Chip Select (SOC, CSI, CS2) signals. Note: An active ADS input is required when the Register Select (AO, AI, A2) signals are not stable for the duration of a read or write operation. If not required, the ADS input permanently low. 2-129 Register Select (AO, AI, A2), Pins 26-28: These three inputs are used during a read or write operation to select an INS8250 register to read from or write into as indicated in the table below. Note that the state of the Divisor Latch Access Bit (DLAB), which is the most significant bit of the Line Control Register, affects the selection of certain INS8250 registers. The DLAB must be set high by the system software to access the Baud Generator Divisor Latches. DLAB A2 Al AD Register 0 0 0 0 Receiver Buffer (read), Transmitter Holding Register (write) 0 0 0 1 Interrupt Enable X 0 1 0 Interrupt Identification (read only) X 0 1 1 Line Control X 1 0 0 MODEM Control X 1 0 1 Line Status X 1 1 0 MODEM Status X 1 1 1 None 1 0 0 0 Divisor Latch (least significant byte) 1 0 0 1 Divisor Latch (most significant byte) Master Reset (MR), Pin 35: When high, clears all the registers (except the Receiver Buffer, Transmitter Holding, and Divisor Latches), and the control logic of the INS8250. Also, the state of various output signals (SOUT, INTRPT, OUT 1, OUT 2, RTS, DTR) are affected by an active MR input. (Refer to Table 1.) Receiver Clock (RCLK), Pin 9: This input is the 16x baud rate clock for the receiver section of the chip. Serial Input (SIN), Pin 10: Serial data input from the communi- cations link (peripheral device, MODEM, or data set). Clear to Send (CTS), Pin 36: The CTS signal is a MODEM control function input whose condition can be tested by the CPU by reading Bit 4 (CTS) of the MODEM Status Register. Bit 0 (DCTS) of the MODEM Status Register indicates whether the CTS input has changed state since the previous reading of the MODEM Status Register. Note: Whenever the CTS bit of the MODEM Status Register changes state, an interrupt is generated if the MODEM Status Interrupt is enabled. 2-130 Data Set Ready (DSR), Pin 37: When low, indicates that the MODEM or data set is ready to establish the communications link and transfer data with the INS8250. The DSR signal is a MODEM-control function input whose condition can be tested by the CPU by reading Bit 5 (DSR) of the MODEM Status Register. Bit I (DDSR) of the MODEM Status Register indicates whether the DSR input has changed state since the previous reading of the MODEM Status Register. ~ Whenever the DSR bit ofthe MODEM Status Register changes state, an interrupt is generated if the MODEM Status Interrupt is enabled. Received Line Signal Detect (RLSD), Pin 38: When low, indicates that the data carrier has been detected by the MODEM or data set. The RLSD signal is a MODEM-Control function input whose condition can be tested by the CPU by reading Bit 7 (RLSD) of the MODEM Status Register. Bit 3 (DRLSD) of the MODEM Status Register indicates whether the RLSD input has changed state since the previous reading of the MODEM Status Register. Note: Whenever the RLSD bit of the MODEM Status Register changes state, an interrupt is generated if the MODEM Status Interrupt is enabled. Ring Indicator (RI), Pin 39: When low, indicates that a telephone ringing signal has been received by the MODEM or data set. The Rl signal is a MODEM-control function input whose condition can be tested by the CPU by reading Bit 6 (Rl) of the MODEM Status Register. Bit 2 (TERl) of the MODEM Status Register indicates whether the Rl input has changed from a low to a high state since the previous reading of the MODEM Status Register. Note: Whenever the Rl bit of the MODEM Status Register changes from a high to a low state, an interrupt is generated if the MODEM Status Interrupt is enabled. VCC, Pin 40: +5 volt supply. VSS, Pin 20: Ground (O-volt) reference. 2-131 Output Signals Data Terminal Ready (DTR), Pin 33: When low, informs the MODEM or data set that the INS8250 is ready to communicate. The DTR output signal can be set to an active low by programming Bit 0 (DTR) of the MODEM Control Register to a high level. The DTR signal is set high upon a Master Reset operation. Request to Send(RTS), Pin 32: When low, informs the MODEM or data set that the INS8250 is ready to transmit data. the RTS output signal can be set to an active low by programming Bit 1 (RTS) of the MODEM Control Register. The RTS signal is set high upon a Master Reset operation. Output 1 (OUT 1), Pin 34: User-designated output that can be set to an active low by programming Bit 2 (OUT 1) ofthe MODEM Control Register to a high level. The OUT 1 signal is set high upon a Master Reset operation. Output 2 (OUT 2), Pin 31: User-designated output that can be set to an active low by programming Bit 3 (OUT 2) of the MODEM Control Register to a high level. The OUT 2 signal is set high upon a Master Reset operation. Chip Select Out (CSOUT), Pin 24: When high, indicates that the chip has been selected by active CSO, CS1, and CS2 inputs. No data transfer can be initiated until the CSOUT signal is a logic 1. Driver Disable (DDIS), Pin 23: Goes low whenever the CPU is reading data from the INS8250. A high-level DDIS output can be used to disable an external transceiver (if used between the CPU and INS8250 on the D7-DO Data Bus) at all times, except when the CPU is reading data. Baud Out (BAUDOUT), Pin 15: 16x clock signal for the transmitter section of the INS8250. The clock rate is equal to the main reference oscillator frequency divided by the specified divisor in the Baud Generator Divisor Latches. The BAUD OUT may also be used for the receiver section by typing this output to the RCLK input of the chip. Interrupt (INTRPT), Pin 30: Goes high whenever anyone of the following interrupt types has an active high condition and is enabled via the IER: Receiver Error Flag; Received Data Available; Transmitter Holding Register Empty; and MODEM Status. The INTRPT Signal is reset low upon the appropriate interrupt service or a Master Reset operation. Serial Output (SO UT), Pin 11: Composite serial data output to the communications link (peripheral, MODEM or data set). The SOUT signal is set to the Marking (Logic 1) state upon a Master Reset operation. 2-132 Input/Output Signals Data (07-00) Bus, Pins 1-8: This bus comprises eight TRI-STATE input/output lines. The bus provides bidirectional communications between the INS8250 and the CPU. Data, control words, and status information are transferred via the 07-00 Data Bus. External Clock Input/Output (XTAL1, XTAL2, Pins 16 and 17: These two pins connect the main timing reference (crystal or signal clock) to the INS8250. Programming Considerations Table 22. Asynchronous Communications Reset Functions Register/Signal Reset Control Reset State Interrupt Enable Register Master Reset All Bits Low (0-3 Forced and 4-7 Permanent) Interrupt Identification Master Reset Bit 0 is High, Register Bits 1 and 2 Low Bits 3-7 are Permanently Low Line Control Register Master Reset All Bits Low MODEM Control Register Master Reset All Bits Low Line Status Register Master Reset Except Bits 5 & 6 are High MODEM Status Register Master Reset Bits 0-3 Low Bits 4-7 - Input Signal SOUT Master Reset High INTRPT (RCVR Errs) Read LSR/MR Low INTRPT (RCVR Data Read RBR/MR Low Ready) INTRPT (RCVR Data Read II RlWrite Low Ready) THR/MR INTRPT (MODEM Read MSR/MR Low Status Changes) OUT2 Master Reset High RTS Master Reset High DTR Master Reset High OUT 1 Master Reset High 2-133 INS8250 Accessible Registers The system programmer may access or control any of the INS8250 registers via the CPU. These registers are used to control INS8250 operations and to transmit and receive data. INS8250 Line Control Register The system programmer specifies the format of the asynchronous data communications exchange via the Line Control Register. In addition to controlling the format, the programmer may retrieve the contents of the Line Control Register for inspection. This feature simplifies system programming and eliminates the need for separate storage in system memory of the line characteristics. The contents of the Line Control Register are indicated and described below. Line Control Register (LCR) 3FB BIT 7 6 5 4 3 2 1 0 I I I :wmd l ..gth S,I,,, Bit 0 (WlSOI Word Length Select Bit 1 (W LS1) Number of Stop Bits (STB) '------I~ Parity Enable (PEN) '-------i~ Even Parity Select (EPS) L--------I.Stick Parity L-_ _ _ _ _ _ _ Set Break ~ '-----------I~ Divisor Latch Access Bit (D LAB) Bit 0 and 1: These two bits specify the number of bits in each transmitted or received serial character. The encoding of bits 0 and 1 is as follows: Bit 1 Bit 0 Word Length 0 0 5 Bits 0 1 6 Bits 1 0 7 Bits 1 1 8 Bits Bit 2: This bit specifies the number of Stop bits in each transmitted or received serial character. If bit 2 is a logic 0, 1 Stop bit is generated or checked in the transmit or receive data, respectively. If bit 2 is logic 1 when a 5-bit word length is selected via bits 0 and 1, 1-1/2 Stop bits are generated or checked. Ifbit 2 is logic 1 when either a 6-, 7-, or 8-bit word length is selected, 2 Stop bits are generated or checked. 2-134 Bit 3: This bit is the Parity Enable bit. When bit 3 is a logic 1, a Parity bit is generated (transmit data) or checked (receive data) between the last data word bit and Stop bit of the serial data. (The Parity bit is used to produce an even or odd number of 1's when the data word bits and the Parity bit are summed.) Bit 4: This bit is the Even Parity Select bit. When bit 3 is a logic 1 and bit 4 is a logic 0, an odd number oflogic 1's is transmitted or checked in the data word bits and Parity bit. When bit 3 is a logic 1 and bit 4 is a logic 1, an even number of bits is transmitted or checked. Bit 5: This bit is the Stick Parity bit. When bit 3 is a logic 1 and bit 5 is a logic 1, the Parity bit is transmitted and then detected by the receiver as a logic 0 if bit 4 is a logic 1 or as a logic 1 if bit 4 is a logic O. Bit 6: This bit is the Set Break Control bit. When bit 6 is a logic 1, the serial output (SOUT) is forced to the Spacing (logic 0) state and remains there regardless of other transmitter activity. The set break is disabled by setting bit 6 to a logic O. This feature enables the CPU to alert a terminal in a computer communications system. Bit 7:This bit is the Divisor Latch Access Bit (DLAB). It must be set high (logic 1) to access the Divisor Latches of the Baud Rate Generator during a Read or Write operation. It must be set low (logic 0) to access the Receiver Buffer, the Transmitter Holding Register, or the Interrupt Enable Register. INS8250 Programmable Baud Rate Generator The INS8250 contains a programmable Baud Rate Generator that is capable of taking the clock input (1.8432 MHz) and dividing it by any divisor from 1 to (2 16 -1). The output frequency of the Baud Generator is 16x the Baud rate [divisor =/1== ( frequency input) / (baud rate x 16)]. Two 8-bit latches store the divisor in a 16-bit binary format. These Divisor Latches must be loaded during initialization in order to ensure desired operation of the Baud Rate Generator. Upon loading either of the Divisor Latches, a 16-bit Baud counter is immediately loaded. This prevents long counts on initial load. 2-135 Divisor Latch Least Significant Bit (DLL) 3F8 DLAB=l BIT 7 6 5 4 3 2 BIT 0 BIT 1 BIT 2 BIT 3 BIT4 L...-_ _ _ _ _ _ _ _ _ _ _ _ _ _ BIT 5 BIT 6 BIT 7 Divisor Latch Most Significant Bit (DLM) 3F9 DLAB=l BIT 7 6 5 4 3 2 1 0 I ~BIT9 L. BIT8 L...-_ _ _ _--I. BIT 10 L...-_ _ _ _ _ _ _. . BIT 11 L...-_ _ _ _ _ _ _ _--I. BIT 12 L . . . - - - - - - - - - - - - _ _ a BIT 13 ' - - - - - - - - - - - - - - -__ BIT 14 ' - - - - - - - - - - - - - - - - - - - 1 . BIT 15 Table 23 illustrates the use of the Baud Rate Generator with a frequency of 1.8432 Mhz. For baud rates of 9600 and below, the error obtained is minimal. Note: The maximum operating frequency of the Baud Generator is 3.1 Mhz. In no case should the data rate be greater than 9600 Baud. 2-136 Table 23. BAUD RATE AT 1.843 Mhz Desired Divisor Used Perce nt Erro r Baud to Generate Difference Between Rate 16x Clock Desired & Actual Decimal Hex 50 2304 '900' -- 75 1536 '600' -- 110 1047 '417' 0.026 134.5 857 '359' 0.058 150 768 '300' -- 300 384 '180' -- 600 192 'OCO' -- 1200 96 '060' -- 1800 64 '040' -- 2000 58 '03A' 0.69 2400 48 '030' -- 3600 32 '020' -- 4800 24 '018' -- 7200 16 'OW' -- 9600 12 'OOC' -- Line Status Register This 8-bit register provides status information to the CPU concerning the data transfer. The contents of the Line Status Register are indicated and described below. Line Status Register (LSR) 3FD BIT 7 6 5 4 3 210 Il~ DATA READY (DR) OVERRUN ERROR (OR) PARITY ERROR (PE) FRAMING ERROR (FE) ' - - - - - - - - - - _ _ . BREAK INTERRUPT (BI) TRANSMITTER HOLDING REGISTER EMPTY (THRE) TX SHIFT REGISTER EMPTY (TSRE) =0 2-137 Bit 0: This bit is the receiver Data Ready (DR) indicator. BitO is set to a logic 1 whenever a complete incoming character has been received and transferred into the Receiver Buffer Register. Bit 0 may be reset to a logic 0 either by the CPU reading the data in the Receiver Buffer Register or by writing a logic 0 into it from the CPU. Bit 1: This bit is the Overrun Error (OE) indicator. Bit 1 indicates that data in the Receiver Buffer Register was not read by the CPU before the next character was transferred into the Receiver Buffer Register, thereby destroying the previous character. The OE indicator is reset whenever the CPU reads the contents of the Line Status Register. Bit 2: This bit is the Parity Error (PE) indicator. Bit 2 indicates that the received data character does not have the correct even or odd parity, as selected by the even parity-select bit. the PE bit is set to a logic 1 upon detection of a parity error and is reset to a logic 0 whenever the CPU reads the contents of the Line Status Register. Bit 3:This bit is the Framing Error (FE) indicator. Bit 3 indicates that the received character did not have a valid Stop bit. Bit 3 is set to a logic 1 whenever the Stop bit following the last data bit or parity bit is detected as a zero bit (Spacing level). Bit 4: This bit is the Break Interrupt (BI) indicator. Bit 4 is set to a logic 1 whenever the received data input is held in the Spacing (logic 0) state for longer than a full word transmission time (that is, the total time of Start bit + data bits + Parity + Stop bits). Note: Bits 1 through 4 are the error conditions that produce a Receiver Line Status interrupt whenever any of the corresponding conditions are detected. Bit 5: This bit is the Transmitter Holding Register Empty (THRE) indicator. Bit 5 indicates that the INS8250 is ready to accept a new character for transmission. In addition, this bit causes the INS8250 to issue an interrupt to the CPU when the Transmit Holding Register Empty Interrupt enable is set high. The THRE bit is set to a logic 1 when a character is transferred from the Transmitter Holding Register into the Transmitter Shift Register. The bit is reset to logic 0 concurrently with the loading of the Transmitter Holding Register by the CPU. Bit 6: This bit is the Transmitter Shift Register Empty (TSRE) indicator. Bit 6 is set to a logic 1 whenever the Transmitter Shift Register is idle. It is reset to logic 0 upon a data transfer from the Tranmitter Holding Register to the Transmitter Shift Register. Bit 6 is a read-only bit. Bit 7: This bit is permanently set to logic O. 2-138 Interrupt Identification Register The INS8250 has an on-chip interrupt capability that allows for complete flexibility in interfacing to all the popular microprocessors presently available. In order to provide minimum software overhead during data character transfers, the INS8250 prioritizes interrupts into four levels. The four levels of interrupt conditions are as follows: Receiver Line Status (priority 1); Received Data Ready (priority 2); Transmitter Holding Register Empty (priority 3); and MODEM Status (priority 4). Information indicating that a prioritized interrupt is pending and the type of that interrupt are stored in the Interrupt Identification Register (refer to Table 5). The Interrupt Identification Register (IIR), when addressed during chip-select time, freezes the highest priority interrupt pending and no other interrupts are acknowledged until that particular interrupt is serviced by the CPU. The contents of the IIR are indicated and described below. Interrupt Identification Register (IIR) 3FA 1_: BIT 7 6 5 4 3 2 1 0 I I OIF INTERRUPT PEND'" I I . ~~- INTERRUPTIDBIT(O) INTERRUPT 10 BIT (1) '---------. =0 L -_ _ _ _ _ _ _ _. . =0 L -_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ =0 ~ '---------------------~ =0 L -_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ~ =0 Bit 0: This bit can be used in either a hardwired prioritized or polled environment to indicate whether an interrupt is pending. When bit 0 is a logic 0, an interrupt is pending and the IIR contents may be used as a pointer to the appropriate interrupt service routine. When bitO is a logic 1, no interrupt is pending and polling (if used) continued. Bits 1 and 2: These two bits of the IIR are used to identify the highest priority interrupt pending as indicated in Table 5. Bits 3 through 7:These five bits of the IIR are always logic O. 2-139 Table 24. Interrupt Control Functions Interrupt 10 Register Interrupt Set and Reset Functions Priority Interrupt Interrupt Interrupt Bit 2 Bit 1 Bit 0 level Type Source Reset Control 0 0 1 - None None - Overrun Error or 1 1 0 Highest Receiver Parity Error Reading the Line Status or Line Status Framing Error Register or Break Interrupt 1 0 0 Second Received Receiver Reading the Data Avail- Data Avail- Receiver able able Buffer Register Reading the II R Register Transmitter Transmitter lif source of 0 1 0 Third Holding Reg- Holding Reg- interrupt) ister Empty ister Empty or Writing into the Trans- mitter Hold- ing Register Clear to Send or Data Set Ready 0 0 0 Fourth MODEM Status or Reading the Ring Indicator MODEM Status or Register Received Line Signal Detect 2-140 Interrupt Enable Register This 8-bit register enables the four types of interrupt of the INS8250 to separately activate the chip Interrupt (INTRPT) output signal. It is possible to totally disable the interrupt system by resetting bits 0 through 3 of the Interrupt Enable Register. Similarly, by setting the appropriate bits of this register to a logic 1, selected interrupts can be enabled. Disabling the interrupt system inhibits the Interrupt Identi- fication Register and the active (high) INTRPT output from the chip. All other system functions operate in their normal manner, including the setting of the Line Status and MODEM Status Registers. The contents of the Interrupt Enable Register are indicated and described below. Interrupt Enable Register (IER) 3F9 DLAB=O BIT 7 6 5 4 3 2 1 0 L: 1= ENABLE DATA AVAILABLE INTERRUPT l=ENABLE TX HOLDING REG EMPTY INTERRUPT 1= ENABLE RECEIVE LINE STATUS INTERRUPT l=ENABLE MOOEM STATUS INTERRUPT =0 =0 =0 L -_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _• • =0 Bit 0: This bit enables the Received Data Available Interrupt when set to logic 1. Bit 1: This bit enables the Transmitter Holding Register Empty Interrupt when set to logic 1. Bit 2: This bit enables the Receiver Line Status Interrupt when set to logic 1. Bit 3: This bit enables the MODEM Status Interrupt when set to logic 1. Bits 4 through 7: These four bits are alway logic O. 2-141 MODEM Control Register This 8-bit register controls the interface with the MODEM or data set (or a peripheral device emulating a MODEM). The contents of the MODEM Control Register are indicated and described below. MODEM Control Register (MCR) 3FC BIT 6 43210 I I~I 1--: 1_________ DATA TER"INAl READY IOTRI I ~~ _ ~~~~ESTTO _ SENO (RTS) L -_ _ _ _ _ _ _ _ _ _ - =0 OUT2 ' - - - - - - - - -... LOOP .. = 0 L -_ _ _ _ _ _ _ _ _ _ _-----. L -_ _ _ _ _ _ _ _ _ _ _ _ =0 ~ Bit 0: This bit controls the Data Terminal Ready (DTR) output. When bit 0 is set to a logic 1, the DTR output is forced to a logic O. When bit 0 is reset to a logic 0, the DTR output is forced to a logic 1. Note: The DTR output of the INS8250 may be applied to an EIA inverting line driver (such as the DS 1488) to obtain the proper polarity input at the succeeding MODEM or data set. Bit 1: This bit controls the Request to Send (RTS) output. Bit 1 affects the RTS output in a manner identical to that described above for bit O. Bit 2: This bit controls the Output 1 (OUT 1) signal, which is an auxiliary user-designated output. Bit 2 affects the OUT 1 output in a manner identical to that described above for bit O. Bit 3: This bit controls the Output 2 (OUT 2) signal, which is an auxiliary user-designated output. Bit 3 affects the OUT 2 output in a manner identical to that described above for bit O. Bit 4: This bit provides a loopback feature for diagnostic testing of the INS8250. When bit 4 is set to logic 1, the following occur: the transmitter Serial Output (SO UT) is set to the Marking (logic 1) state; the receiver Serial Input (SIN) is disconnected; the output of the Transmitter Shift Register is "looped back" into the Receiver Shift Register input; the four MODEM Control inputs (CTS,DSR, RLSD, and RI) are disconnected; and the four MODEM Control outputs (DTR, RTS, OUT 1, and OUT 2) are internally connected to the four MODEM Control inputs. In the diagnostic mode, data that is transmitted is immediately received. This feature allows the processor to verify the transmit- and receive-data paths of the INS8250. 2-142 In the diagnostic mode, the receiver and transmitter interrupts are fully operational. The MODEM Control Interrupts are also operational but the interrupts' sources are now the lower four bits of the MODEM Control Register instead of the four MODEM Control inputs. The interrupts are still controlled by the Interrupt Enable Register. The INS8250 interrupt system can be tested by writing into the lower four bits of the MODEM Status Register. Setting any of these bits to a logic 1 generates the appropriate interrupt (if enabled). The resetting of these interrupts is the same as in normal INS8250 operation. To return to normal operation, the registers must be reprogrammed for normal operation and then bit 4 of the MODEM Control Register must be reset to logic O. Bits 5 through 7: These bits are permanently set to logic O. MODEM Status Register This 8-bit register provides the current state of the control lines from the MODEM (or peripheral device) to the CPU. In addition to this current- state information, four bits of the MODEM Status Register provide change information. These bits are set to a logic 1 whenever a control input from the MODEM changes state. They are reset to logic 0 whenever the CPU reads the MODEM Status Register. The content of the MODEM Status Register are indicated and described below. MODEM Status Register (MSR) 3FE BIT 7 6 5 4 3 2 1 0 I L:; I • DElTACLEARTO SEND (DCTS) DELTA DATA SET READY (DDSR) ' - - - - - - . TRAILING EDGE RING INDICATOR (TER!) ' - - - - - - - - - - 1 . DElTA RX LINE SIGNAL DETECT (DRLSD) ' - - - - - - - - - -. . CLEAR TO SEND (CTS) L -_ _ _ _ _ _ _ _ _ _. . DATA SET READY (DSD) ' - - - - - - - - - - - - - - . RING INDICATOR (R!) ' - - - - - - - - - - - - - - - _ _ _ _ . . RECEIVE LINE SIGNAL DETECT (RLSD) 2-143 Bit 0: This bit is the Delta Clear to Send (DCTS) indicator. Bit 0 indicates that the CTS input to the chip has changed state since the last time it was read by the CPU. Bit 1: This bit is the Delta Data Set Ready (DDSR) indicator. Bit 1 indicates that the DSR input to the chip has changed state since the last time it was read by the CPU. Bit 2: This bit is the Trailing Edge of Ring Indicator (TERI) detector. Bit 2 indicates that the RI input to the chip has changed from an On (logic 1) to an Off (logic 0) condition. Bit 3: This bit is the Delta Received Line Signal Detector (DRLSD) indicator. Bit 3 indicates that the RLSD input to the chip has changed state. Note: Whenever bit 0, 1,2, or 3 is set to a logic 1, a MODEM Status interrupt is generated. Bit4: This bit is the complement of the Clear to Send (CTS) input. Ifbit 4 (loop) of the MCR is set to ai, this bit is equivalent to RTS in the MCR. Bit 5: This bit is the complement of the Data Set Ready (DSR) input. If bit 4 of the MCR is set to ai, this bit is equivalent to DTR in the MCR. Bit 6: This bit is the complement of the Ring Indicator (RI) input. Ifbit 4 of the MCR is set to a 1, this bit is equivalent to OUT 1 in the MCR. Bit 7: This bit is the complement of the Received Line Signal Detect (RLSD) input. If bit 4 of the M CR is set to ai, this bit is equivalent to OUT 2 of the MCR. Receiver Buffer Register The Receiver Buffer Register contains the received character as defined below. Receiver Buffer Register (RBR) 3F8 DLAB=O READ DNLY BIT 4 3 0 I I I ~~lmml L ._ _ _ _ _ _ _- . : DATA BIT 4 ' - - - - - - - - - - - - - . DATA BIT 5 ' - - - - - - - - - - - - - - - - - - - 1 > DATA BIT 6 ' - - - - - - - - - - - - - - - - _ _ _ . DATA BIT7 Bit 0 is the least significant bit and is the first bit serially received. 2-144 Transmitter Holding Register The Transmitter Holding Register contains the character to be serially transmitted and is defined below: Transmitter Holding Register (THR) 3F8 DLAB=Q WRITE ONLY BIT 7 6 5 4 3 2 1 Q I I .. DATA BIT Q L-==; DATA BIT 1 ' - - - - - - - . DATABIT2 DATA BIT 3 ' - - - - - - - - - - -___ DATA BIT 4 '--------------------------_ DATABIT5 DATA BIT 6 ~--------------------------------~ DATABIT7 Bit 0 is the least significant bit and is the first bit serially transmitted. 2-145 Selecting The Interface Format The Voltage or Current loop interface is selected by plugging the programmed shunt module, with the locator dot up or down. See the figure below for the two configurations. o D D O!--""""';!!Ir o D ASYNCHRONOUS COMMUNICATIONS ......................u....L...........,,~. . . . . . . . . . . . . . . . . . . . . . ~......................... ADAPTER CURRENT LOOP INTERFACE DOT UP DOT DOWN Figure 23. SELECTING THE INTERFACE FORMAT 2-146 Asynchronous Communications Adapter Connector Interface Specifications REAR PANEL 0 • • 25 • • • o eog • •• • • •• • • •• ~ ~~ • • • • ~ • • • • 14 • 0 AT STANDARD TTL LEVELS Description Pin NC 1 ... ~ Transmit Data 2 Receive Data 3 --.. ... ~ Request to send 4 Clear to send 5 Data set ready Signal ground 6 7 .... ~ Carrier detect 8 .. ... +Transmit current loop return (20 rna) 9 ~ '" NC 10 ... -Transmit current loop data (20 rna) 11 Asynchronous '" NC 12 External Communications Device NC 13 Adapter NC 14 (RS232C) NC 15 NC 16 NC 17 +Receive current loop data (20 rna) NC 18 19 .... .... Data Terminal Ready 20 '" NC 21 Ring Indicate 22 NC 23 ---. NC 24 - Receive current loop return (20 rna) 25 .... NOTE: To avoid inducing voltage surges on interchange circuits, signals from Interchange circuits shall not be used to drive inductive devices, such as relay coils. 2-147 NOTES 2-148 SECTION 3. ROM and SYSTEM USAGE Contents: ROM BIOS. . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . 3-2 BIOS Cassette Logic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 Keyboard Encoding and Usage . . . . . . . . . . . . . . . . . . . 3-11 Low Memory Maps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21 3-1 ROM BIOS The ROM resident Basic I/O System (BIOS) provides the device level control of the major I/O devices in the System Unit. The BIOS routines allow the assembly language programmer to perform block (diskette and cassette) or character (Video, communications, keyboard and printer) level I/O operations without any concern for device address and operating charac- teristics. Additionally, system services such as time of day and memory size determination are provided. The goal is to provide an operational interface to the system and relieve the programmer from concern over hardware device characteristics. Finally the BIOS interface insulates the user from the hardware allowing new devices to be added to the System Unit, yet retaining the BIOS level interface to the device. In this manner, user programs become transparent to hardware modifications and enhancements. A complete listing of the BIOS is provided in Appendix "A". Use of BIOS Access to the BIOS function is through the 8088 software interrupts. Each BIOS entry point is available through its own interrupt, which can be found in the interrupt vector listing. The software interrupts lOH through lAH each access a different BIOS routine. For example, to determine the amount of memory available in the system, INT 12H will invoke the memory size determination routine in BIOS and return the value to the caller. Parameter Passing All parameters passed to and from the BIOS routines go through the 8088 registers. The prologue of each BIOS function indicate the registers used on the call and the return. For the memory size example above, no parameters are passed, and the result, memory size in 1K Byte increments is returned in the AX register. Where a BIOS function has several possible operations, the AH register is used on input to indicate the desired operation. For example, to set the time of day, the following code is required. 3-2 MOV AH,l ;function is to set time of day. MOV CX,HIGH_COUNT ;establish the current time. MOV DX, Low_COUNT INT lAH ;Set the time. While to read the time of day: MOV AH,O ;function is to read the time of day. INT lAH ;read the timer. As a general rule, the BIOS routines preserve 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 prologue of each BIOS function. Interrupt Vector Listing Interrupt Number Name BIOS Initialization 0 Divide by Zero None 1 Single Step None 2 Non Maskable NMUNT (FOOO:E2C3) 3 Breakpoint None 4 Overflow None 5 Print Screen PRINLSCREEN (FOOO:FF54) 6 Unused 7 Unused 8 Time of Day TIMER_INT (FOOO:FEA5) 9 Keyboard KLINT (FOOO:E987) A Unused B 8259 Unused C Interrupt Unused (Reserved Communications) 0 Vectors Unused E Diskette DISK_I NT (FOOO:EF57) F Unused (Reserved Printer) 10 Video VIDEO_I 0 (FOOO:F065) 11 Equipment Check EQUIPMENT (FOOO: F84D) 12 Memory MEMORY_SIZE_OETERMINE (FOOO: F841) 13 Diskette DISKETTE_I 0 (FOOO:EC59) 14 BIOS Communications RS23LI 0 (FOOO:E739) 15 Entry Cassette CASSETTE_I 0 (FOOO:F859) 16 Points Keyboard KEYBOARD_I 0 (FOOO:E82E) 17 Printer PRINTER-I 0 (FOOO:EF02) 18 Cassette BASI C (F600:0000) 19 Bootstrap BOOLSTRAP (FOOO:E6F2) 1A Time of Day TIME_OLDAY (FOOO:FE6E) 1B User Supplied Keyboard Break DUMMY_RETURN (FOOO:FF53) 1C Routines Timer l1ick , DUMMLRETURN (FOOO:FF53) 10 Video Initialization VIDEO_PARMS (FOOO:FOA4) 1E BIOS Diskette Parameters DISK_BASE (FOOO:EFC7) 1F Parameters Video Graphics Chars None 3-3 NOTES 3-4 Vectors With Special Meanings Interrupt I BH - Keyboard Break Address This vector points to the code to be exercised when the CTRL BREAK keys are depressed on the keyboard. The vector is invoked while responding to the keyboard interrupt, and control should be returned via an lRET instruction. The power on routines initialize this vector to point to an lRET instruction, so that nothing happens when CTRL BREAK keys are depressed unless the application program sets a different value. Control may be retained by this routine, with the following problems. The BREAK may have occurred during interrupt processing, so that one or mor End of Interrupt commands must be set to the 8259 controller. Also, all I/O devices should be reset in case an operation was underway at that time. Interrupt I CH - Timer Tick This vector points to the code to be executed on every tick of the system clock. This vector is invoked while responding to the timer interrupt, and control should be returned via an lRET instruction. The power on routines initialize this vector to point to an lRET instruction, so that nothing happens unless the application modifies the pointer. It is the responsibility of the application to save and restore all registers that will be modified. Interrupt IDH - Video Parameters This vector points to a data region containing the parameters required for tJ.\e initialization of the 6845 on the video card. Note that there are four separate tables, and all four must be reproduced if all modes of operation are to be supported. The power on routines initialize this vector to point to the para- meters contained in the ROM video routine. Interrupt I EH - Diskette Parameters This vector points to a data region containing the parameters required for the diskette drive. The power on routines initialize the 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 machine. Changing this parameter block to reflect the specifications of the other drives attached may be necessary. 3-5 Interrupt 1FH - Graphics Character Extensions When operating in the graphics modes of the Color/Graphics Monitor Adapter (320 x 200 or 640 x 200), the read/write character interface will form the character from the ASCII code point, using a set of dot patterns. The dot patterns for the first 128 code points are contained in ROM. To access the other 128 code points, this vector must be established to point at a table of up to 1K bytes, where each code point is represented by 8 bytes of graphic information. At power on this vector is initialized to 0:0, and it is the responsibility of the user to change this vector if the additional code points are required. Other Read/Write Memory Usage The IBM ROM BIOS routines use 256 bytes of memory starting at absolute 400 to 4 FF. Locations 400-407 contain the base addresses of any RS232 cards attached to the system, O's if none attached. These locations, in order, represent the 0 to 3 values used as the parameter to the RS232 BIOS routine. Locations 408-40F provide the same function, but for the PRINTER. Memory locations 300-3FF are used as a stack area during the power on initialization, and the bootstrap, when control passed to it from power on. If the user desires the stack in a different area, it must be set by the application. Note: Use the Interrupt Vector Listing as an aid to locate these topics in the ROM BIOS listing, Appendix "A". BIOS Programming Tip When programming with BIOS you should keep in mind that if an error is reported by the diskette code, to reset the diskette adapter and retry the operation. A specified number ofretrys should be required on reads to ensure the problem is not due to motor start-up. 3-6 BIOS Memory Map STARTING ADDRESS HEX r-------------------~ 00000 BIOS INTERRUPT VECTORS 00080 AVAILABLE INTERRUPT VECTORS 00400 BIOS DATA AREA 00500 USER READ/ WRITE MEMORY ..... r"" ,.,., F4000 USER READ ONLY MEMORY F6000 CASSETTE BASIC INTERPRETER FEOOO BIOS PROGRAM AREA Figure 24. BIOS MEMORY MAP 3-7 BIOS Cassette Logic Software Algorithms Interrupt 15 The cassette routine will be called with the request type in AR and the address of the bytes to be read or written will be specified by (ES):(BX) and the number of bytes to read/write will be specified by (CX). The actual number of bytes read will be returned in (DX). Read block and write block will automatically tum the motor on at the start and off at the end. The requests are as follows: (AR) = 0 Tum the cassette motor on. (AR) = 1 Tum the cassette motor off. (AR) = 2 (Read Block) Read (CX) bytes into memory beginning at address (ES):(BX) and return actual number of bytes read in (DX). Return the cassette status in (AR). (AR) = 3 (Write Block) Write (CX) bytes onto the cassette beginning at address (DS):(BX). Return the cassette status in (AR). STATUS: AR=OO No errors AR=OI CRe-Error (Read Block) AR=02 No data transitions AR=04 No leader AR=80 Invalid command Note: The carry flag will be set on any error. Cassette Write The WRITE BLOCK routine writes a tape block on the cassette. The tape block is described in Data Record Architecture page (3-10). The WRITE BLOCK routine turns on the cassette motor and a syn- chronization bit (0) and then writes 256 bytes of all ones, the leader, to the tape. Next, one or more data blocks are written (depends on number in CX). After each data block of 256 bytes, a two byte CRC is written. The data bytes are taken from the memory location pointed at by ES. The WRITE BYTE routine disassembles the byte and writes it a bit at a time to the cassette. The method used is to set TIMER 2 to the period of the desired data bit. The timer is set to a period of 1.0 millisecond for a one bit and 0.5 millisecond for a zero bit. 3-8 The timer is set mode 3 which means it will output a square wave with period given by its count register. The timer's period is changed on the fly for each data bit to be written to the cassette. If the number of data bytes to be written is not an integral multiple off256, then after the last desired data byte from memory has been written, the data block will be extended to 256 bytes by writing multiples of the last data byte. The last block will be closed with two CRC bytes as usual. After the last data block, a trailer consisting of four bytes of all one bits will be written. Finally, the motor will be turned off. There are no errors reported by this routine. j...- 250 USEe -+I I ZERO BIT ~r---- 500 USEe - - - . . . . ,•.-tl ____________----'1 ONE BIT ~r---------l000 USEe ---------~.I Cassette Read The READ BLOCK routine turns on the cassette motor and then delays for approximately 0.5 secs for it to come up to speed. The READ BLOCK routine then searches for leader and must detect all one bits for approximately 1/4 ofleader length before it can look for the sync byte. If a correct sync byte (X '16') is not found, the routine goes back and searches for leader again. The data is read a bit a a time and assembled into bytes. After each byte is assembled it is written into memory at location ES:BX and then BX is incremented by one. After each multiple of 256 data bytes are read, the CRC is read and compared to the CRC generated. If a CRC error is detected, the routine will exit with the carry flag set to indicate an error and status (AH) - 01 for CRC error. DX will contain the number of bytes written into memory. Note: The Time of Day Interrupt (IRQO) is disabled during the cassette read operation. 3-9 Data Record Architecture MOTOR MOTOR ON OFF 1. Leader 256 bytes (of ones) 2. Sync byte ASCII Sync Char (X'16') 3. Sync byte (X '16') 4. Data Blocks 256 bytes 5. CRC -- 2 bytes - for each data block Error Recovery Error recovery is handled by software. A cyclic redundancy check (CRC) is used to detect errors. The polynomial used is: G(X) - X16 «X12 « X5 X 1 Which is the polynomial used by the SDLC interface. Essen- tially, as bits are written/read from tape, they are passed through the CRC-register in software. After a block of data is written, the complemented value of the calculated CRC-register is written on tape. On reading the cassette data, the CRC bytes are read and compared to the generated CRC value. If the read CRC does not equal the generated one, the processor's carry flag is set and status (AH) is set to X'OI' to indicate a CRC error has occurred. Also, the routine is exited on CRC error. 3-10 Keyboard Encoding and Usage Encoding ['he keyboard routine provided by IBM in ROM BIOS is 'esponsible for converting the keyboard scan codes into what ~i11 be termed "Extended ASCII", ~xtended ASCII encompasses one byte character codes with >os sible values of 0-255, an extended code for certain extended (eyboard functions and functions that are handled within the (eyboard routine or through interrupts. Character Codes ['he following character codes are passed through the BIOS (eyboard routine to the system or application program. A '-1" means the combination is suppressed in the keyboard 'outine. The codes are returned in AL. See Appendix C for exact :odes. Use keyboard Scan Code diagram for reference page 2-17. Table 25. Character Codes KEV# BASE CASE UPPER CASE CTRL ALT 1 ESC ESC ESC -1 2 1 Yo -1 Note 1 3 2 @ NUL (000) Note 1 Note 1 4 3 # -1 Note 1 5 4 $ -1 Note 1 6 5 % -1 Note 1 7 6 /\ RS (030) Note 1 8 7 & -1 Note 1 9 8 * -1 Note 1 10 9 ( -1 Note 1 11 0 ) -1 Note 1 12 - - US (031) Note 1 13 = + -1 Note 1 14 Backspace (008) Backspace (008) DEL(127) -1 15 ---+I (009) ~ (Note 1) -1 -1 16 q Q DCl (017) Note 1 17 w W ETB (023) Note 1 18 e E ENQ (005) Note 1 19 r R DC2 (018) Note 1 20 t T DC4 (020) Note 1 21 y y EM (025) Note 1 22 u U NAK (021) Note 1 23 i 1 HT (009) Note 1 24 0 0 SI (015) Note 1 25 p P OLE (016) Note 1 26 [ { ESC (027) -1 27 ] } GS (029) -1 3-11 Table 25. Character Codes (cont.) KEY# BASE CASE UPPER CASE CTRl AlT 28 CR CR IF (010) -1 29CTRl -1 -1 -1 -1 30 a A SOH (001) Note 1 31 s S DC3 (019) Note 1 32 d 0 EDT (004) Note 1 33 f F ACK (006) Note 1 34 g G BEL (007) Note 1 35 h H BS (008) Note 1 36 j J IF (010) Note 1 37 k K VT (011) Note 1 38 I l FF (012) Note 1 39 , -1 -1 , 40 " -1 -1 41 \ ~ -1 -1 42SHIFT -1 -1 -1 -1 I FS (028) -1 43 \ I 44 z Z SUB (026) Note 1 45 x X CAN (024) Note 1 46 c C ETX (003) Note 1 47 v V SYN (022) Note 1 48 b B STX (002) Note 1 49 n N SO (014) Note 1 50 m M CR (013) Note 1 51 ) < -1 -1 52 > -1 -1 53 / ? -1 -1 54SHIFT -1 -1 -1 -1 55 * (Note 2) (Note 1) -1 56AlT -1 -1 -1 -1 57 SP SP SP SP 58 CAPS -1 -1 -1 -1 LOCK 59 NUL (Note 1) NUL (Note 1) NUL (Note 1) NUL (Note 1) 60 NUL (Note 1) NUL (Note 1) NUL (Note 1) NUL (Note 1) 61 NUL (Note 1) NUL (Note 1) NUL (Note 1) NUL (Note 1) 62 NUL (Note 1) NUL (Note 1) NUL (Note 1) NUL (Note 1) 63 NUL (Note 1) NUL (Note 1) NUL (Note 1) NUL (Note 1) 64 NUL (Note 1) NUL (Note 1) NUL (Note 1) NUL (Note 1) 65 NUL (Note 1) NUL (Note 1) NUL(Note1) NU L (Note 1) 66 NUL (Note 1) NUL (Note 1) NUL (Note 1) NUL (Note 1) 67 NUL (Note 1) NUL (Note 1) NUL(Note1) NUL (Note 1) 68 NUL (Note 1) NUL (Note 1) NUL(Note1) NUL (Note 1) 69NUM -1 -1 Pause -1 LOCK (Note 2) 70SCROLL -1 -1 Break -1 LOCK (Note 2) Note 1: Refer to Extended Codes Page (3-131- Note 2: Refer to Special Handling Page (3-15). 3-12 Keys 71-83 have meaning only in base case, in NUMLOCK (or shifted) states, or in CTRL state. It should be noted that the shift key temporarily reverses the current NUMLOCK state. KEV# NUM LOCK BASE CASE ALl ClRL 71 7 Home (Note 1) Note 1 Clear Screen 72 8 t (Note 1) Note 1 -1 73 9 PageUp (Note 1) Note 1 Top of Text & Home 74 - - -1 -1 75 4 ~ (Note 1) Note 1 Reverse Word (Note 1) 76 5 -1 Note 1 -1 77 6 ~(Note1) Note 1 AdvWord (Note 1) 78 + + -1 -1 79 1 End (Note 1) Note 1 Erase to EO L (Note 1) 80 2 .J. (Note 1) Note 1 -1 81 3 PageDown (Note 1) Note 1 Erase to EOS (Note 1) 82 0 INS Note 1 -1 83 DEL (Notes 1,2) Note 2 Note 2 Note 1: Refer to Extended Codes Page (3·13). Note 2: Refer to Special Handling Page (3-15). Extended Codes A. Extended Functions For certain functions that can not be represented in the standard ASCII code, an extended code is used. A character code of 000 (NUL) is returned in AL. This indicates that the system or application program should examine a second code that 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. 3-13 Table 26. Keyboard Extended Functions SECONO CODE FUNCTION 3 NUL Character 15 -E- 16-25 AL Tn, W, E, R, T, Y, U, 1,0, P 30-38 ALTA, S, D, F, G, H, J, K, L 44-50 AL T Z, X, C, V, B, N, M 59-68 F1-F10 Function Keys Base Case 71 Home 72 l' 73 Page Up & Home Cursor 75 ~ 77 ...,. 79 End 80 -J, 81 Page Down & Home Cursor 82 INS 83 DEL 84-93 F11-F20 (Upper Case F1-F10) 94-103 F21-F30 (CTR L F1-FlO) 104-113 F31-F40 (ALT F1-F10) 114 CTRL PRTSC (Start/Stop Echo to Printer) Key 55 115 CTR L ~ Reverse Word 116 CTR L --7 Advance Word 117 CTRL END Erase EOL 118 CTRL PG DN Erase EOS 119 CTRL HOME Clear Screen and home 120-131 AL T 1, 2, 3,4,5.6.7,8,9,0, -, = (Keys 2-13) 132 CTRL PG UP TOP 25 Lines of Text & Home Cursor B. Shift States Most shift states are handled within the keyboard routine transparently to the system or application program. In any case, the current set of active shift states are available by calling an entry point in the ROM keyboard routine. The following keys result in altered shift states: Shift - Temporarily shifts keys 2-13, 15-27, 30-41,43-53,55, 59-68 to upper case (lower case if in CAPSLOCK state). Temporarily reverses NUMLOCK/NONUMLOCK state of keys 71-73, 75, 77, 79-83. CTRL - Temporarily shifts keys 3, 7, 12, 14, 16-28, 30-38, 43-50,55,59-71, 73, 75, 77, 79, 81 to CTRL state. Used with ALT and DEL to cause "system reset" function described in Section 1.3. Used with SCROLL LOCK to cause "break" function described in Section I.3. Used with NUMLOCK to cause "pause" function described in Section I.3. 3-14 ALT - Temporarily shifts keys 2-13, 16-25, 30-38,44-50, and 59-68 to ALT state. Used with CTRL and DEL to cause system reset function described in Section 1.3. ALT has a special use to allow the user to enter any character code (0-255) into the system from the keyboard. The user holds down the ALT key and types the decimal value of characters using the numeric keyboard (keys 71-73, 75-77, 79-82). The ALT key is then released. If more than three digits are typed, a modulo 256 result is created. These three keys are interpreted as a character code (000-255) and are transmitted through the keyboard routine to the system or application program. ALT is handled internal to keyboard routine. CAPS LOCK - Shifts keys 16-25, 30-38, 44-50 to upper case A second depression of CAPS LOCK reverses the action. Handled internal to keyboard routine. NUM LOCK - Shifts keys 71-73, 75-77, 79-83 to numeric state. A second depression of NUM LOCK reverses the action. Handled internal to keyboard routine. SCROLL LOCK - Interpreted by appropriate application programs as indicating that the use of the cursor control keys should cause windowing over the text rather than cursor movement. A second depression of SCROLL LOCK reverses the action. The keyboard routine simply records the current shift state of SCROLL LOCK. It is up to the system or application program to perform the function. C. Shift Key Priorities and Combinations If combinations of ALT, CTRL and SHIFT are pressed and only one is valid, the precedence is as follows: Highest is ALT, then CTRL, then SHIFT. The only valid combination is ALT CTRL, which is used in system reset. Special Handling A. System Reset The combination of ALT CTRL DEL (Key 83) will result in the keyboard routine initiating the equivalent of a system reset/reboot. Handled internal to keyboard routine. 3-15 B. Break The combination CTRL BREAK will result in the keyboard routine signaling interrupt -1 A. Also, the extended char- acters (AL =OOH, AH = OOH) will be returned. Power up initialization, this interrupt is set up to cause the break sequence to be ignored. It is up to the system or application initialization code to change the interrupt vector in order to support an actual "break" function. C. Pause The combination CTRL NUM-LOCK will cause the key- board interrupt routine to loop, waiting for any key except NUM-LOCK to be pressed. This provides a system/ application transparent method of suspending list/print/ etc. temporarily, and then resuming. The "Unpause" key is thrown away. Handled internal to keyboard routine. D. The -following keys win have their typematic action suppressed by the keyboard routine: CTRL, SHIFT, ALT, NUM-LOCK, SCROLL-LOCK, CAPS LOCK, INS. E. Print Screen The combination SHIFT-PRINT SCREEN (Key 55) will result in an interrupt invoking the print screen routine. This routine works in alpha/graphics mode, with unrecog- nizable characters printing as blanks. The keyboard routine does its own buffering. The buffer is big enough to support a fast typist. If a key is entered when the buffer is full, the key will be ignored and the "bell" will be sounded. 3-16 Keyboard Usage This section is intended to outline a set of guidelines for key usage when performing commonly used functions. Table 27. Keyboard - Commonly Used Functions FUNCTION KEV(S) COMMENT Home Cursor HOME Editors; word processors Return to outermost menu HOME Menu driven applications Move cursor up t Full screen editor, word processor Page up, scroll backwards PG UP Editors; word processors 25 lines & home Move cursor left +- Key 75 Text, command entry Move cursor right --+- Text, command entry Scroll to end of text END Editors; word processors Place cursor at end of line Move cursor down Full screen editor, word ! processor Page down, scroll forwards PG ON Ed itors; word processors 25 lines & home Start/Stop insert text at INS Text, command entry cursor, shift text right in buffer Delete character at cursor DEL Text, command entry Destructive backspace +- Key 14 Text, command entry Tab forward ---+I Text entry Tab reverse ~ Text entry Clear screen and home CTRL HOME Command entry Scroll up t In scroll lock mode Scroll down ! In scroll lock mode Scroll left +- In scroll lock mode Scroll right --+- In scroll lock mode Delete from cursor to CTRL END Text, command entry EOL Exit/Escape ESC Editor, 1 level of menu, etc Start/Stop Echo screen PRTSC Any time to printer CTRL K55 Delete from cursor to CTRL PG Text, command entry EOS ON 3-17 Table 27. Keyboard - Commonly Used Functions (cont.) FUNCTION KEyeS) COMMENT Advance word CTRL -. Text entry Reverse word CTRL ...- Text entry Window Right CTRL -. When text is too wide to fit screen Window Left CTRL ...- When text is too wide to fit screen Enter insert mode INS Line editor Exit insert mode INS Line editor Cancel current line ESC Command entry, text entry Suspend system (pause) CTRL Stop list, stop program, etc. NUMLOCK Resumes on any key Break interrupt CTRL Interrupt current process BREAK System reset ALT CTRL Reboot DEL Top of document and CTRL PG UP Editors, word processors home cursor Standard Function Keys F1-F10 Primary function keys Secondary function keys SHIFT F1-F10 Extra function keys if 10 CTRL F1-F10 are not sufficient ALT F1-Fl0 Extra function keys AL T Keys Used when stickers are 2-13 put along top of keyboard (1-9,0,-,=) Extra function keys ALT A-Z Used when function starts with same letter as one of the alpha keys 3-18 Table 28. BASIC Screen Editor Special Functions FUNCTION KEY Carriage retu rn ...... Line feed CTRl~ Bell CTRl G Home HOME Cursor up Cursor down Cursor left \ +-- Cursor right --+ Advance one word CTRl--+ Reverse one word CTRl+-- Insert INS Delete Del Clear screen CTRl HOME Freeze output CTRl NUMlOCK Tab advance --+I Stop execution (break) CTRl BREAK Delete current line ESC Delete to end of line CTRl END Position cursor to end of line END Table 29. DOS Special Functions FUNCTION KEY Suspend CTRl NUMlOCK Ech 0 to pri nter CTRl-PRTSC (Key 55 any case) Stop echo to printer CTRl-PRTSe (Key 5!1 any case) Exit current function CTRl (break) BREAK Backspace +- Key 14 Line feed CTRl ~ Cancel line ESC Copy character F1 or --+ Copy till match F2 Copy remaining F3 Skip character Del Skip until match F4 Enter insert mode INS Exit insert mode INS Make new line the template F5 String separator in REPLACE F6 End of file in keyboard input F6 3·19 NOTES 3-20 Low Memory Maps (O-'0600'x) Table 30. Interrupt Vectors (O-7F) ADDRESS INTERRUPT HEX HEX FUNCTION 0-3 0 Divide by Zero 4-7 1 Single step 8-B 2 Non-Maskable Interrupt (NMI) C-F 3 Break Point Instruction ('CC'x) 10-13 4 Overflow 14-17 5 Pri nt Screen 18-1F 6,7 Reserved 20-23 8 Timer 08.2 per second) 24-27 9 Keyboard Interrupt 28-37 A,8,C,D Reserved 38-3B E Diskette Interrupt 3C-3F F Reserved 40-43 10 Video I/O Call 44-47 11 Equipment Check Call 48-4B 12 Memory Check Call 4C-4F 13 Diskette I/O Call 50-53 14 RS232 I/O Call 54-57 15 Cassette I/O Call 58-5B 16 Keyboard I/O Call 5C-5F 17 Printer 1/0 Call 60-63 18 ROM Basic Entry Code 64-67 19 Boot Strap Loader 68-68 1A Time of Day Call 6C-6F 1B Get Control on Keyboard Break: Note 1 70-73 1C Get Control on timer interrupt: Note 1 74-77 10 Pointer to video initialization table: Note 2 78-7B lE Pointer to diskette parameter table: Note 2 7C-7F IF Pointer to table (1 KB) for graphics character Generator for ASCII 128-255. Defaults to 0:0 Notes: (1) Initialized at power up to point to an IRET Instruction. (2) Initialized at power up to point to tables in ROM. BASIC and DOS Reserved Interrupts Table 31. (80-3FF) ADDRESS INTERRUPT FUNCTION HEX HEX 80-83 20 DOS Program Terminate 84-87 21 DOS Function Call 88-8B 22 DOS Terminate Address 8C-8F 23 DOS CTRL-BRK Exit Address 90-93 24 DOS Fatal Error Vector 94-97 25 DOS Absolute Disk read 98-9B 26 DOS Absolute Disk write 9C-9F 27 DOS Terminate, Fix in Storage AO-FF 28-3F Reserved for DOS 100-1 FF 40-7F Not Used 200-217 80-85 Reserved By BASIC 218-3C3 86-FO Used by BASIC Interpreter while BASIC is Running. 3C4-3FF F1-FF Not Used Table 32. Reserved Memory Locations (400-SFF) ADDRESS MODE FUNCTION HEX 400-48F ROM BIOS See BIOS Listing 490-4CF DOS Used by DOS Mode Command 400-4EF Reserved 4FO-4FF Reserved as Intra-Application Communication area for any application. 500-5FF Reserved for DOS and BASIC 500 DOS 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. 504 DOS Single drive mode status byte. 510-511 BASIC BASI C's segment address store. 512-515 BASIC Clock interrupt vector segment: offset store. 516-519 BASIC Break key interrupt vector segment: 'offset store. 51A-51D BASIC Disk error interrupt vector segment: offset store. 3-22 BASIC Workspace Variables If you do DEF SEG (Default workspace segment) OFFSET LENGTH Line number of current line being executed X '2E' 2 Line number of last error X '347' 2 Offset into segment of start of program text X '3~' 2 Offset into of start of variables X '358' 2 (end of program text 1-1) Keyboard buffer contents X '6A' 1 if O-no characters in buffer if l-characters in buffer if you POKE & H6A, 0 you flush any characters in buffer Example: 100 Print PEEK (&H2E) + 256*PEEK (&H2F) ) L H 100 I X '64' I X '00' I 3-23 NOTES 3-24 ,1", (\1':': ' '"i,"., 1,'1. :ti APPENDIX A ROM BIOS LISTINGS CONTENTS LINE ITEM NUMBER ADDRESS PAGE Equates and Data Areas 1 A-2 Power-on Self-test 198 E016 A-4 Boot Strap Loader 1355 E6F2 A-20 I/O Support Asynchronous Communications (RS 232) I/O 1410 E729 A-20 Keyboard I/O 1640 E82E A-23 Diskette I/O 2255 EC59 A-32 Printer I/O 3007 EFD2 A-42 Display (VIDEO) I/O 3119 F045 A-43 Cassette I/O 4977 F859 A-68 System Configuration Analysis Memory-Size- Determination 4903 F841 A-67 Equipment- Determination (Options) 4933 F84D A-67 Graphics-Character Generator 5503 FA6E A-75 Time-of-day 5642 FE6E A-77 Print Screen 5817 FF53 A-79 Notes for the BIOS Listing A-81 A-I lOC OBJ LINE SOURCE $fITlEtROtI aIOS fOR IeH PERSDNAL COMPUtER) ; "'- -- ---- --_ _ --_... _--- - ... ... ... J EQUATES 4 i--.. --...... ------------------ 0060 S PORT_A EQU .OH ;8255 P~T A ADDR 006). PORT_9 EQU 61H i 8255 PORT B ADCA 0062 PDRT_C EQU •• H ; 8255 PORT C ADDA 0063 CMO_PORT EQU .3tf 0020 OOZ! 10 • tNl'AOO tNTAOl EQU EQU .OH 21H ;8259 PORT ;82:59 PORT 0020 11 E'% 'QU 20H 0040 12 TIMER EQU 40H 004] 13 TIM_CTL EQU 43tf j 8253 TII'ff:R CONTROL PORT ADOR 0040 14 TIHERO EQU 40H ;8251 TIttER/eNTER 0 PORT ADOR 0001 0008 ,. IS THIHT OMAas EQU EQU 01 08 JTIMER 0 INTR RECVD MAS)( ;OI1A STATUS REG FORT ADOR . ,. 0000 17 DM" EQU 00 IDMA CHANNEL 0 ADDRESS REG PORT ADDR 0540 HA)CPERIOD EQU 540H 0410 HIN_PERIOD eqtJ "OH 0060 0002 •• 21 K8D~IN KBDINT EQU EQU 60H •• ;KEYBOARD DATA IN AnDR PORT j KEYBOARD INTR HASK 0060 0061 •• 03 KB_DATA KB_CTL EQU EQU 6'H blH ; KEYBOARD SCAN CODE PORT ; CONTROL BITS FOR KEYBOARD SENse DATA 24 ; - - -- ------ - - ----- ----- --- -------- -- --- --- --- 25 ; 8OS8 INTERRUPT lOCAnONS 26 ; - -- ---- - - ---- -- - - -- -- ---- --- ------- -- -- -- ---- 0000 .1 ASS. SEGMENT' AT 0 0000 0008 •• ••3. STS_LOto 'RG LABEL '<4 BytE 0008 NHI_PTR LABEL WORD 0014 31 ORG 5" 0014 3. INT5_PTR LABEL WORD 0020 33 OIlG .<4 0020 34 INT.ADDR LABEl WORD 0020 35 INT_PTR LABEL DWORD OD40 3b ORG 10H*4 0040 31 VIDED.INT LABEL WORD 0074- 38 OIlG 10H*4 0074 3' PARM_PTR LABEL DWORD ; POINTER TO VIDEO PARHS 0078 40 OIlG 01EH*4 INTERRUPT 1EH 0078 41 DISK_POINTER LABEL DWORD 007C 4' ORG OlFH*4 LOCATION OF POINTER D07e 7COD 4' 44 EXT_PTR LABEL ORG DWORD 7eDOH ; POINTER TO EXTENSION 7COO 4S BOOT_LOCH LABEL FAll 46 ASSG ENDS 47 48 j --------------------- 49 ; STACK -- USED DURING INITIALIZATION ONLY SO ; ---------------------- 51 STACK SEGMENT AT 30H 0000 (128 1111 J 0100 5' 53 TOS OW LABEL 128 OUP(? ) WORD 54 STACK ENDS 55 0040 . 56 57 s. J - -- - - - -- - ---- -- - - - - ------ ---- -- ------- - - ---- ; ROM BIOS DATA AREAS DATA SEGMENT AT 40H .0 0000 (4 t11t J 0008 (4 ????) ., RS232.BASE PRINTER_BASE OW ow 4 DUPf 11 40UP(?) ; ADDRESSES OF RS232 ADAPTERS j ADDRESSES OF PRINTERS 0010 ???? 0012 11 .,•• EQUIPJLAG MFG_TST DW DB j INSTAllED HARDWARE ; INITIALIZATION FLAG 0013 ???? 0015 ???? •• .5 MEMORY_SIZE IO_RAM_SIZE ow DW ; MEMORY SIZE IN K BYTES j MEMORY IN I/O CHANNEL b. ; -------- ------------- ------ --- -- --- -- ------- 67 ; KEYBOARD DATA AREAS 68 i -------------------------------------------- 0017 ?1 ••7. KBJLAG DB 71 ;------ SHIft FLAG EQUATES WITHIN KBJLAG n 0080 7. INS_STATE EQU 80H j INSERT STATE IS ACTIVE 0040 74 CAPS_STATE EQU 40H ; CAPS lOCK STATE HAS BEEN TOGGLED 0020 7. HUM_STATE EOU .OH j NUN LOCK STATE HAS BEEN TOGGLED 0010 7b SCROLL_STATE EOU 10H ; SCROLL LOCK STATE HAS BEEN TOGGLED 0008 77 ALT_SHIFT EOU 08H ; ALTERNATE SHIFT KEY DEPRESSED A-2 lOC OBJ LINE SOURCE 0004 76 CTL_SHIFT EOU 04H CONTROL SHIFT KEY DEPRESSED 0002 7. lEFT_SHIFT EOU 02H LEFT SHIFT KEY DEPRESSED 0001 80 RIGHT_SHIFT EOU OIH RIGHT SHIFT KEY DEPRESSED 81 0018 :1 8' DB SECOND BYTE OF KEYBOARD STATUS 8' 0080 84 INS_SHIFT EOU 80H INSERT KEY IS DEPRESSED 0040 85 CAPS_SHIFT EOU 40H CAPS LOCK KEY IS DEPRESSED 0020 86 NVH_SHIFT EOU 'OH NUN LOCK KEY IS DEPRESSED ODIO 87 SCROLL_SHIFT EOU 10H SCROll LOCK KEY IS DEPRESSED 0008 86 HOLD_STATE EOU 08H SUSPEND KEY HAS BEEN TOGGLED 8. 0019 1: 90 ALT_INPUT DB STORAGE FOR ALTERNATE KEYPAD ENTRY 001A ???? 91 BUFFER_HEAD OW POINTER TO HEAD OF KEYBOARD BUFFER ODIC ???? 92 BUFFER TAIL DW POINTER TO TAIL OF KEYBOARD BUffER ODIE (16 ????) 9l KB_SUFFER OW 16 DUP(? J ; ROOM FOR 15 ENTRIES 003E 94 KB_BUFFER_END LABEL WORD 95 96 j------ HEAD: TAIL INDICATES THAT THE BUFFER IS EMPTY .7 0045 96 NUMJEY EOU 69 SCAN CODE FOR NUMBER LOCK 0046 99 EOU 70 SCROll LOCK KEY 0038 100 ALTJEY EOU 56 AL HRNATE SHIFT KEY SCAN CODE 0010 101 CTlJEY EOU '9 SCAN CODE FOR CONTROL KEY 003A 10' CAPS_KEY EOU 56 SCAN CODE FOR SHIFT LOCK 002:.0. 103 LEFT_KEY EOU 42 SCAN CODE FOR LEFT SHIFT 0036 104 RIGHT_KEY EOU 54 SCAN CODE FOR RIGHT SHIFT 0052 105 H-IS_KEY EOU 82 SCAN CODE FOR INSERT KEY 0053 106 DEL_KEY EOU 83 SCAN CODE FOR DELETE KEY 107 108 i ---- ---- ------------------------------------ 109 ; DISKETTE DATA AREAS 110 ; -------------------------------------------- 003E ?? III SEEK_STATUS DB ; DRIVE RECALIBRATIOH STATUS 112 BIT 3-0 = DRIVE 3-0 NEEDS RECAL BEFORE In NEXT SEEK IF BIT IS = 0 0060 114 INTJLAG EQU OBOH ; INTERRUPT OCCURRENCE FLAG 003f ?? 115 MOTO~_STATUS DB ; MOTOR STATUS 11_ BIT 3-0 = DRIVE 3-0 IS CURRENTLY RUNNING 117 I BIT 7 ;: CI.JRRENT OPERATION IS A WRITE. REQUIRES DELAY 0040 ?? 118 MOTOR_COUNT DB TIME OUT COUNTER FOR DRIVE TURN OfF 0025 119 MOTOR_WAIT EQU 37 ; TWO SECONDS OF COUNTS FOR MOTOR TURH Off 120 121 I 0041 ?? IZZ DISKETTE_STATUS DB i SINGLE BYTE OF RETURN CODE INfO FOR STATUS 0080 123 TIME_OUT EQU 60H ; ATTACHMENT r'AIlED TO RESPOND 0040 1'4 BAD_SE:EK EQU 40H ; SEEK OPERATION fAILED 0020 les BAD_NEe EQU 'OH i NEe CONTROLLER HAS FAILED 0010 1,6 BAD_CRe EQU 10H ; BAD CRC ON DISKETTE READ 0009 1,7 DMA_BOUNDARY EQU O.H ; ATTEMPT TO DMA. ACROSS 64K BOUNDARY 0008 128 BAD_DMA EQU 06H ; DHA OVERRUN ON OPERATION 0004 129 RECORD_NOT]ND EQU 04H ; REQUESTED SECTOR NOT FOUND 0003 130 WRITE_PROTECT EQU O'H ; WRITE ATTEMPTED ON WRITE PROT DISK OOOZ III 8AD_ADDR_MARK EQU 02H ; ADDRESS HARK NOT FOUND 0001 112 BAD_CND EQU OIH ; BAD COMMAND PASSED TO DISKETTE I/O 113 0042 (7 ??J 134 DB 7 DUP{'!) • STATUS BYTES FROM NEC llS 136 ; -------------------------------------------- 137 ; VIDEO DISPLAY DATA AREA 138 ; -------------------------------------------- 0049 ?! n9 CRT_MOOE DB ; CURRENT CRT MODE 004.4. ???? 140 CRT_COLS OW ; NUl1BER Of COLUMNS ON SCREEN 004C ???? 141 CRT_LEN Ow ; LENGTH OF REGEN IN BYTES 004E ???? 14' CRT_START OW ; STARTING ADDRESS IN REGEN BUFFER 0050 (8 ???? J 14> CURSOR_POSH OW 8DUP!?) ; CURSOR fOR EACH OF UP TO 8 PAGES 0060 ???? 144 CURSOR_MODE OW ; CURRENT CURSOR MODE SETTING 0062 ?1 14S ACTIVE_PAGE DB ; CURRENT PAGE BEING DISPLAYED 0063 ???? 14_ ADDR_6845 OW ; BASE ADDRESS FOR ACTIVE DISPLAY CARD 0065 '?? 147 CRT_HODE_SET DB ; CURRENT SETTING OF THE 3X8 REGISTER 0066 ?? 146 CRT_PALLETTE DB ; CURRENT PALLETTE SETTING COLOR CARD 149 150 ; -------------------------------------------- 151 ; CASSETTE DATA AREA 152 ; ---- ---- ------------------------------------ 0067 ???? IS3 DW ;TIME COUNT AT DATA EDGE 0069 ???? 154 DW ;CRC REGISTER A-3 lOC OBJ LINE SOURCE 006B ?? 155 OB ; LAST INPUT VALUE 156 IS 7 ~ ------------------------ ------------- ______ _ IS8 ; TIMER DATA AREA 159 ; -----------------------------______________ _ 006C n?? 160 TIMER_LOW OW LOW WORD OF TIMER COUNT 006E ???? 161 TINER_HIGH OW HIGH WORD OF TIMER COUNT 0070 n 162 TINER_OFL OB j TIMER HAS ROLLED OVER SINCE LAST READ 16' ; COUNTS_SEC EOU 18 16. iCOUNTS_MIN EOU 1092 16S icownS_HOUR EOU 65543 166 .COUNTS_DAY EOU 1573040 = 1800BOH 167 168 1---------------------------------__________ _ 169 ; SYSTEM DATA AREA 170 ; ------------------------------- ____________ _ 0071 ?? 171 BIOS_BREAK DB BIT 7 = 1 IF BREAK KEY HAS BEEN DEPRESSED 0072 ???? 172 RESETJLAG 0\.1 ; WORO = 1234H IF KEYBOARD RESET UNDERWAY 17' DATA EtlDS 17. 175 ; --------_- '.,--.~------------------ _________ _ 176 ; EXTRA DATA AREA 177 1-------------------------------------------- 0050 178 XXOATA SEGMEHT AT SOH ~OO ?? 17. STATUS_BYTE DB 180 XXOATA ENDS 181 182 ; -------------------------------------------- 181 J VIDEO DISPLAY BUFFER 184 ; ------------------------- ------------------- B800 18S VIDEO_RAM SEGMENT AT OB800H 0000 18b REGEN LABEL BYTf 0000 187 REGENW LABE L WORD 0000 116384 ?? J 188 DB 16384 DUPf '!) 18. VIDEO_RAM ENOS 190 i ------------------------------------------ 191 ; ROM RESIDEHT CODE 192 ; ----- - ---- ----- - --------- ---- ---- ---- - ----- FOOO 19' CODE SEGMENT AT OFOOOH 0000 157344 ?? J 19. DB 57344 DUPf'!) ; FILL LOWEST 56K 195 EOOO 35373030303531 196 DB '5700051 COPR. IBH 1981' ; COPYRIGHT NOTICE 20434FS0522:EZO 4942:402:0313938 Jl 197 198 ; --- - --- - -------- -- - -------- ------- ------ ---- 199 i INITIAL RELIABILITY TESTS -- PHASE 1 200 ; ---- --- ------ ------- -- ------ - ---- -- ---- - ---- 201 ASSUME CS:CDDE,5S:COOE,ES:ABSO,DS:DATA 202 ; --- - --- - ------------ --- ---- ------- ----- - ---- 203 DATA DEFINITImlS 20r~ 1---- --------- ------ - ------- --- ---- ----- - -- -- E016 D8EO 20S Cl OW Cll ; RETURN ADDRESS E018 EDEI 206 C2 OW C24 ; RETURN ADDRESS FOR DUMMY STACK 207 - -- --------- ------- ------- ----------------- 208 THIS SUBROUTINE PERFORMS A READ/WRITE STORAGE TEST ON A 16K BLOCK 209 OF STORGAGE. 210 ,ENTRY REQUIREMEtHS: 211 ES = ADDRESS OF STORAGE SEGMENT BErNG TESTED 212 05 = ADDRESS OF STORAGE SEGMENT BEING TESTED 213 WHEtl EtH(RIHG AT STGTST_CtH. CX MUST BE LOADED WITH TIlE BYTE COUNT. 214 ;EXIT PARAMETERS: 215 ZERO FLAG = 0 IF STORAGE ERROR (DATA COMPARE OR PARITY CHECK. AL:::O 216 DENOTES A PARITY CHECK. ELSE AL=XCR'EO BIT PATTERH Of THE 217 EXPECTED OATA PATTERN VS THE ACTUAL DATA READ. 218 AX,BX.CX,QX.DI. At:o 51 ARE ALL DESrROYED. 219 ; -------------------------------------------- EOIA 2Z0 STGTST PROC NEAR EOlA 890040 221 tl0V CX,4000H JSETUP (NT TO TEST A 16K BLK EOlD 222 STGTST_CNT: EOlD FC 221 CLO ;5ET OIR FlAG TO ItICRENENT EOlE 8B09 22' nov BX.CX ;SAVE BYTE CNT (4K FOR VIDEO OR 16K) E02:0 B8FFFF 225 MOV AX,OFfFFH JGET DATA PATTERN TO ~RITE E023 6A55AA 226 no', DX,OAA55H ,SETUP OTHER DATA PATTERNS TO USE E026 2:BfF 2" SUB DI,or ;D1 " OFFSET 0 RELATIVE TO ES REG E02:8 F3 228 REP SlOSS ;WRITE STORAGE LOCATIONS E029 AA A-4 lOC OBJ LINE SOURCE E024 22' C3: ; STGOI EDa 4F 230 DEC DI ; POINT TO LAST BYTE JUST WRITTEN E028 FD nl STO ;SET DIR flAG TO GO CACKWARDS E02C 8BF7 232 C4: MOV SI,DI f02E 8&8 233 HOY CX,BX ; SETUP BYTE CNT f030 At 234 1:5' LooSB ;READ CHAR FROM STORAGE EOll 32C4 235 }COR Al.AH ;DATA READ AS EXPECTED? E033 7525 E035 £462 236 237 J"' IN C7 Al.PORT_C ; NO - GO TO ERROR ROUTINE ;010 A PARITY ERROR OCCUR? E037 24tO 238 AND AL.OCOH £039 BODO 23. MOV ALtO ;AL=O DATA CDHPARE OK E03B 75lD 240 JNZ C7 f03D 80Feoo 241 CMP AH,. ;READING ZERO PATTERN? E040 7403 242 J' C6 ; CONTINUE READING TILL END E042: 8At2 243 MOV Al.Ol ;GET NEXT DATA PATTERN TO WRITE E044 AA 244 5T058 ;WRITE IN BYTE LOC WE JUST READ E04S 245 C6: ; WRITE_HO_MORE E045 £2£9 246 LOOP C5 ;CONTINUE TIll 16K/4K BLOCK TESTED E047 80FtOO 247 eMP AH,O iZERa PATTERN WRITTEN TO ~TG EOltA. 740E 248 JE C7 ;YES - RETURN TO CALLER E04t BAED 240 HOY AH.AL ;SETUP TO NEW VALUE TO COMPARE E04E 86F2 250 XCHG DH.OL ;MOVE ZERO DATA PATTERN TO DL E050 FC 251 CLD ;SET DIR flAG TO GO FORWARD E051 47 252 INC 01 ;SET POINTER TO BEG LOCATION E052 7408 253 JZ C4 iREAD/URlTE FORWARD IN STG £054 4F 254 DEC 01 f055 BAOIOO 2SS MOV DX,l ;SETUP 01 AND 00 PATTERNS EOSS ESOO 256 JHP SHORT C3 ;READ/WRITE BACKWARD IN STG £05A 2S7 C7: E05A C3 258 RET 259 STGTST ENOP 260 ; -------------------------------------------- 261 ;TEST.Ol 262 8088 PROCESSOR TEST ~63 ;DESCRIPTION 264 VERIFY 8088 FLAGS. REGISTERS AND CONDITIONAL JUMPS 265 ; ----------------- ------ -------------- --- ---- EOSB 266 RESET LABEL NEAR E058 FA 267 START: CLI ;DISABLE INTERRUPTS Eose B4D5 268 MOV AH .OOSH ;SET SF, CF, ZF, AND AF FLAGS ON E05E 9£ 26. SAHF EOSF 734E 270 JNC ERROl i GO TO ERR ROUTINE IF CF NOT SET f061 754C 271 JUZ ERROl ; GO TO ERR ROUTINE IF ZF NOT SET ED63 7B4A. 272 JNP ERROl ; GO TO ERR ROUTINE IF PF NOT SET £065 7948 273 JN5 ERROl ;GO TO ERR ROUTINE IF SF NOT SET E067 9F 274 LAHF ; LOAD flAG IMAGE TO AH £068 8105 275 MOV Cl.S ; LOAD CNT REG WITH SHIFT CNT f06A D2EC 276 SHR AH,CL jSHIFT AF INTO CARRY BIT POS EObC 7341 277 JIlC ERROl ;SO TO ERR ROUTINE IF AF NOT SET E06E B040 278 HOV AL,40H ; SET THE OF F LAG ON £070 ODED 270 SHL AL,l ; SETUP FOR TESTING fon 713B 280 JtlO ERROl ; GO TO ERR ROUTINE IF OF NOT SET £074 32Ft 281 XOR AH.AH iSET AH ;:: 0 E076 9£ 282 SAHF ;CLEAR SF". tF". ZF. ANO PF E077 7236 283 JC ERROl ;GO TO ERR ROUTINE IF CF ON E079 7434 284 JZ ERROl ; GO TO ERR ROUTINE IF ZF ON f078 7832 285 JS ERROl ;GO TO ERR ROUTINE IF SF ON E07D 7A30 286 JP ERROl ; GO TO ERR ROUTINE IF PF ON E07F 9F 287 LAHF .; LOAD FLAG IMAGE TO AH E08D B105 288 HOV (L.s ; LOAD CNT REG WITH SHIFT tNT E082 DZEC 28' SHR AH .Cl ; SHIFT AF' INTO CARRY BIT POS E084 7229 2.0 JC ERROl ;GO TO ERR ROUTINE IF ON EOB6 DOf4 201 SHL AJhl iCHECK 'THAT OF' IS CLEAR E088 7025 202 JO ERROl ;GO TO ERR ROUTINE IF ON 203 2.4 REAOIWRITE THE: 80BS GENERAl AND SEGMENTATION REGISTERS 205 WITH ALL ONE'S AND ZEROES'S. 2.6 E08A BSFFFF 2.7 MOV AX,OFFFFH JSETUP ONE'S PATTERN IN AX E08D F9 2.8 STe E08E 8E08 E090 SCDB "0 300 CS: HOY MOV DS.AX BX.DS IWRITE PATTERN TO ALL REGS E092 8EC3 301 NOV ES.BX E094 8CCt 302 MOV CX.ES £096 8EDl 303 MOY SS.CX E098 8C02 304 MOV DX.SS E09,\ 8BE2 305 MOV SP,DX E09C 6BEt 306 MOV BP,SP A-5 LOC OBJ L1NE sou Ref E09E BBF5 307 NOV Sl tBP EOAO 8BFE 306 HOV 01,51 fOA2 7307 309 JNC C9 ; T511A EOA4 33C7 310 XOR AX,DI jPATTERU MAIRENT ADDRESS AtJD W-OPD CGu~n REGISTERS fOR All 350 CHAt~11ElS. nHTIl',lIZE At;O START OtlA FOR MEtlOPY REFRESH. 351 352 DISABLE DNA CONTROLLER 353 EOOA 9004 35' HOV ;DISABLE DMA CONTROLLER Eooe E608 35S OUT 356 357 VERIFY THAT TIMER I FUNCTIONS OK 356 EOOE 8054 359 HOV AL.54H ;SEl TIMER I.LSB,MOOE Z EOEO £643 360 OUT TIMERt3.AL EOE2 28C9 361 SUB ex.ex EOf4 8AD9 362 HOV Bl.CL fOE6 8ACI 363 HOV AL.CL ,SET INITIAL TIMER CNT TO 0 EOE8 E641 36. OUT TIMERtl.Al EOEA 365 C12: ; TIMERl_BITS_DN EOEA 8040 366 MO'I AL.40H ; LATCH TIMER 1 COUNT EOEC E643 367 OUT TIMERt3.AL fOEE £441 366 IN AL, TIMER-t-l ,READ TIMER 1 COtmT EOFO OA06 36. OR BL,Al jAlL BITS ON IN TIMER EOF2 80FBFF 370 CMP BL.OFFH iYES - SEE IF ALL BITS GO OFF ECFS 7404 371 JE C13 ; TIMERl_BITS_OFF EOF7 E2Ft 372 lOOP ClZ ; TIMERI_BITS_ON EOF9 EBB4 373 JMP SHORT ERROl ;TIMER 1 FAILURE, HALT SYS EOFB 37. C13: , TIMERl_BITS_OFF EOFS 8AC3 375 HOV AL,BL j SET TIMER 1 CNT EOFD 26C9 376 SUB CX,CX EOFF E641 377 OUT TINERtl,AL fl01 378 C14: ; TIMER_lOOP EIOI 6040 379 MOV Al,40H j LATCH TIMER 1 eoUNT fl03 £643 360 OUT TIMERt3.Al EI05 E441 331 IN AL.TIMER+l ,READ TIMER 1 COUNT EI07 2208 382 AND BL.AL EI09 7404 363 JZ CIS WRAP_DNA_REG EIOB E2F4 3. . LOOP CI4 TIMER_LOOP A-6 LaC OBJ LINE SOURCE EIOD EBAD 385 JMP SHORT ERROl 386 307 INITIALIZE TIMER 1 TO REFRESH MEMORY 388 ElOF 389 C15: ; WRAP_DHA_REG flOF 6054 390 MOV AL.54H ;5EL TIM 1, lSB, MODE 2. elll E643 391 OUT TIMER+3,Al il.IRITE TIMER HODE REG E113 B012 392 MOV AL.I8 ,SETUP DIVISOR FOR REFRESH EllS E641 393 OUT TIMER+1.Al jl<:RITE TIMER 1 CNT REG E1l7 E600 394 OUT DMA+ODH.AL JSEND MASlER CLEAR TO DNA 395 396 WRAP DNA CHANNElS ADDRESS ANO COUNT REGISTERS 397 E119 BOFF 398 NOV AL,OFFH il·IRITE PATTERt-I FFH TO All REGS EllB BADS 399 C16: MOV BL.Al iSAVE PATTERN FOR COHPARE EllD 8AFB 400 MOV BH.AL fllf 890800 401 MOV CX.8 iSETUP LOOP tNT E122 BADDOD 402 MOV OX.OMA iSETUP liD PORT AODR OF REG El2.5 EE 403 C17: OUT OX,AL jWRITE PATTERI'{ TO REG, LSB EI26 EE 40t. OUT OX,AL JHSB OF 16 BIT REG E127 B80101 405 110V AX,OIOlH ,.boX TO ANOTHER' PAT BEFORE RD EIU EC 406 III Al.DX iREAD 16-BIT OHA CH REG. lsa EIZB BAED 407 ~lOV AH.Al iSAVE LSB OF 16-BIT REG Elza EC 408 IN Al,OX jREAD MSB OF DHA CH REG EIZE 3B08 409 CtlP BX.AX ;PATT[RN READ AS WRITTEN? EnD 7403 41. JE C18 iYES - CHECK NEXT REG E132 E97AFF 411 JtlP ERROl iNa - HALT THE SYSTEM E135 412 CI8: i NXT_DMA_CH £135 42 413 INC OX iSET liD PORT TO NEXT CH REG E136 EZED 414 LOOP C17 ;~ITE PATTERN TO NEXT REG E138 F6DO 415 NOT Al iSET PATTERN TO ZERO E13A 740F 416 JZ C16 ,WRITE TO CHANUEL REGS 417 418 INITIALIZE AND START OMA FOR MEMORY REFRESH. 419 EBe BOFF 42. MOV Al,OFFH iSH CNT OF 64K FOR RAM REFRESH EBE E601 421 OUT DHA+1.AL E140 E601 422 OUT DHMl,AL E142 B05S 423 ~lOV AL.058H ,SH DMA MODE ,CH 0 ,READ ,AUOTItfT E144 E60B 424 OUT DHA+OSH,AL ;WRITE DHA MODE REG El46 BOOO 425 MOV AL.O ; ENABLE DHA CONTROLLER E148 E608 426 OUT OHAt8.AL ;SETUP DHA COI1MAh'D REG E14A E60A 427 OUT DMA+I0 .AL ; ENABLE CHANNE L 0 FOR REFRESH El4C 6041 428 NOV AL,41H iSET MODE FOR CHANNEL 1 E14E E608 429 OUT DNAtOBH,AL ElSO 6042 43. NOV Al.42H ;SET MODE FOR CHANNEL 2 EI52 E608 431 OUT DMA+OBH,Al E154 8043 432 NOV AL,43H iSET MODE FOR CHANNEl 3 E156 E60B 433 OUT DMA+OBH,AL 434 ; --- ------------ ----------------------------- 435 ; TEST. 04 436 BASE 16K REAOIWRITE STORAGE TEST 437 438 ;DESCRIPTION 439 WRITE/READIVERIFY DATA PATTERNS FF ,55.AA..Ol. AND 00 TO 1ST 16K OF 440 STORAGE. VERIFY STORAGE ADDRESSABILITY. 441 INITIALIZE THE 8259 INTERRUPT CONTROLLER CHIP FOR CHECKING 442 MANUFACTURING TEST 2 MODE. 443 i -------------------------------------------- 444 DETERMINE MEMORY SIZE AND FILL HEMORY WITH DATA 445 Elsa 884.000 446 HOV AX,DATA jPOINT OS TO DATA SEG E156 8E08 447 MOV DS,AX E150 8BlE7Z00 448 MOV 6X,RESET_FLAG ;SAVE RESET_FLAG' IN BX E161 26CO 44. SUB AX,AX ; SET ES AfID OS TO 0 E163 8ECO 450 MOV ES,AX ; SETUP E5 SEGMENT REG E165 8ED8 451 MOV DS,AX E167 ZBFF 452 SUB 01,01 EI69 E460 453 IN AL.PORT_A ,DETERMINE BASE RAM SIZE E168 240e 454 A1ID AL,OCH ; ISOLATE RAM SIZE SW5 E160 0404 455 ADO AL, 4 ; CALCULATE MEMORY SIZE E16F BlOC 456 MOV CL. 12 El71 03EO 457 5HL AX. CL E173 88C8 458 NOV ex. AX E175 BAED 459 MOV AH, AL EI77 Fe 460 CLD ; SET OIR flAG TO meR E178 AA 46, C19: STOSB ,FILL BASE RAM WITH DATA A-7 LOC OBJ LINE SOURCE E179 E2FD 4.2 lOOP C1. lOOP TIL ALL ZERO 4., •• 4 DETERMINE 10 CHANNEl RAM SIZE 4.5 El7B E462 4 •• IN AL.PORT_C E17D 240F 4.7 AND AL.OfH E17F 7418 468 JZ COl E181 BA0010 4., MOV OX.lOOOH ; SEGMENT FOR 110 RAM El84 8AEO 470 MDV AH.AL El86 BODO 471 MOV AL.O El88 47' C20: ; FIll_IO: El88 8ECZ 473 I10V ES,DX EISA 690080 474 MOV CX,BOOOH i fIlL 32K BYTES H8D ZBFF 475 SUB OI.OJ E18F F3 47. REP STOSB El90 AA El91 81C20008 .77 ADD OX.800H ; NEXT SEGMENT VALUE E195 FEee 47& DEC AH E197 75£F 47. JtlZ C'O ; FILl_IO 480 i ----------- ------ -- -------------- -------- --- 481 INITIALIZE THE 82:59 INTERRUPT CONTROLLER CHIP '82 ; C21: --------- ---------- --- ---. -- ------ .-.-. ----- El'99 48. £199 B013 .84 MOV Al.13H ;ltWl - EDGE, SNGl, ICW4 El9B £620 '8S OUT INTAOO,AI.. El9D B008 48. MOV AL.8 ;SETUP lewz - INT TYPE 8 (8-F) E19F E621 487 OUT INTAOl.AL HAl B009 488 MOV AL,9 ;SETUP ICW4 - BUFfRD,8086 MODE ElA3 £621 48. OUT INTAOI,AL EIAS 2Beo 4.0 SL'B AX,AX ; POINT OS AND ES TO BEGIN EIA7 8EtO 4" MOV ES,AX , OF IUW STORAGE ElA9 8E4000 EIAC SEDE ••• 493 MOV MOV SI,DATA 05,51 ;POINT OS TO DATA SEG ElAE 891E72:00 494 MOV RESET]LAG,BX ;RESTORE RESET]L.J.G ElB2: 813E72003412 495 CMP RESETJLAG,1234H ;RESETJLAG SET? EIB8 743B ElBA 8ED8 ••• 4.7 JE MOV C25 DS.AX iYES - SKIP STG TEST ,POUlT OS TO 1ST 16K OF STG 4.8 ; -------- - ---- -- ------- --- ------------------- 4.9 CHECK FDR MANUFACTURING TEST 2. TO LOAD TEST PROGRAMS FROH KEYBOARD. 500 ; -- ------ -- --------- -- - ------ -------- ---- -- -- EIBC BCF03F 501 MOV SP. 3FFOH ; ESTABLISH TEttPORARY STACK EIBF 8EOO 50' MOV 55, AX ElCl 8BF8 50. MOV 01, AX ElC3 882400 504 MOV BX, 24H EIC6 C10186E2 505 MDV WORD PTR [BXJ.OFFSET Dll ;SET UP KB INTERRUPT EICA 43 50. INC BX EICB 43 507 INC BX ElCC 8COF 508 MOV [BXJ,CS EleE E88704 509 CALL KBD_RESET ; READ IN KB RESET COOE TO BL ElDl 80F865 510 CNP BL,065H ; IS TlfIS MANUFACTURING TEST 2? EI04 750E 511 JNZ C2l ; JUMP IF NOT MAN. TEST EID6 B2FF 512 MOV OL.255 ; READ IN TEST PROGRAM EID8 E8BA04 51> C22: CALL SP_TEST EIDB 8AC3 514 MOV AL.BL EIDD AA 515 STOSS ElOE FEeA 51. DEC Dl flED 15F6 517 JNZ C22 ; JUMP IF NOT DONE YET ElE2: CD3E 518 XUT 3EH ;SET INTERUPT TYPE 62: ADDRESS F8H ElE4 51' e2:3: ;CONTINUE IN NORMAL HODE ElE4 DE 520 PUSH CS j PUT 55 BACK ElES 11 521 POP 55 EIE6 FA 52. ell ElE1 Be18EO 523 MOV SP.OFFSET CZ .SETUP RETURN ADDRESS ElEA EnDFE 524 JMP STGTST ;GO TO RDIWRT STS SUBROUTINE EIED 7403 525 C24: JE C25 JGO TO NEXT TEST IF OK ElEF E9BDFE 526 JMP ERROl 527 528 SETUP STACK SES AND SP 529 E1FZ ~30 C25: ElFZ B83000 5>1 MDV AX ,STACK ; GET STACK VALUE EIFS 8EDO 5>2 MOV SS.AX ; SET THE STACK UP ElF7 BCOOOI 5» MDV SP.OFFSET TOS ; STACK IS READY TO GO 534 535 SETUP THE tlMI INTERRUPT VECTOR POINTER 53. A-8 LOC OBJ LINE SOURCE EIFA 26C7060aOaC3EZ R 537 NOV ES:NMI_PTR,OFFSET NMI_INT f201 26C7060AOOOOFO R 538 NOV ES:NHI_PTR+2.CODE f208 EnAOO 539 JNP T5T6 jGO TO NEXT TEST 540 f208 541 ROS_CHECKSUM PROC NEAR ; NEXT_ROS_MODUlE fl08 890020 542 NOV eX.BIn iHUMBER OF BYTES TO AIlD fZOE 32:CO 543 XOR AL,Al E210 544 C,6: E210 2E0207 545 AOO AL,CS:[BX] £213 43 546 INC BX ;POINT TO NEXT BYTE E214 EZFA 547 lOOP C26 JADD All BYTES IN ROS MODULE £216 OACO 546 OR AL,Al ;SUM = O? E218 C3 549 RET 550 ROS_CHECKSUM ENOP 551 ; -------------------------------------- 552 ; INITIAL RELIABILITY TEST -- PHASE Z 553 ;'---- ----------------------------------- 554 ASSUME CS:COOE,ES:.ABSO 555 E219 50415249545920 556 01 De 'PARITY CHECK 2' 43484543482032 DaDE 557 OIL EQU $-01 E227 50415249545~ 556 02 DB 'PARITY CHECK I' 43484543462031 ,/ OOOE 559 Oll EQU 560 ; -- ------ ---------- ------------------ -------- 561 i1E51.06 562 8259 INTERRUPT CONTROLLER TEST 563 ;DESCRIPTION 564 READ.lWRITE THE INTERRUPT MASK REGISTER I IMR J WITH ALL ONES AHO ZEROES. 565 ENABLE SYSTEM INTERRUPTS. MASK DEVICE INTERRUPTS OFF _ CHECK FOR 566 HOT INTERRUPTS (UNEXPECTED). 567 ; -------------- --------------------- --- ------ E235 566 1516: E235 2BCO 569 SUB AX.AX ;SET UP ES REG E237 8ECO 570 MOV ES.AX 571 S7Z j------ SET UP THE INTERRUPT 5 POINTER TO A DUMMY 573 E239 26C706140054FF R 574 NOV ES:INT5_PTR,QFFSET PRINT_SCREEN ; PRINT SCREEN E240 26C706160000FO F! 575 MOV ES: INTS_PTR+2, CODE 576 577 TEST THE IHR REGISTER 576 E247 FA 579 eLI iOIABLE INTERRUPTS E248 BOOO 580 NOV AL,O ; SET INR TO ZERO E24A E621 581 OUT INTAOl.AL E24C E421 582 IN Al.ItHAOl jREAD IMR E24E OACO 583 OR AL.Al ;INR = O? E250 7526 584 JllZ 06 ;60 TO ERR ROUTINE IF NOT 0 E252 BOFF 585 NOV AL.OFFH jDISABLE DEVICE INTERRUPTS E254 E621 586 OUT INTAOI,Al ;\ol~ITE TO IMR E256 £421 587 HI Al.INTAOI jREAO Itm E258 0401 58. AOO Al,! ; ALL INR BIT ON? ElSA. 7521 58. JNZ 06 ; NO - GO TO ERR ROUTINE 590 591 CHECK FOR HOT INTERRUPTS 592 Else Fe 593 CLO iSET OIR FLAG TO GO FORWARD E250 890800 594 MOV eX,8 ; SETUP TEMP IHT RTNE IN PRT TBl H6D BF2000 595 NOV OI,OFFSET 1NT_PTR JGET ADDRESS OF INT PROt TABLE f263 596 03: ; VECTBLO: f2:63 8886E2 597 MOV AX.OFFSET 011 iMQVE ADDR OF INTR PROt TO TSl E266 AS 596 STQSW f267 BBOOFO 599 MOV AX,CODE ;GET AODR OF INTR PROt SEG noA AS 600 STOSW E268 83C304 601 ADD BX.4 ; SET BX TO POINT TO NEXT VAL f26E ElF] 602 lOOP 03 ; VECTBlO 603 604 INTERRUPTS ARE MASKED OFF. CHECK THAT NO INTERRUPTS OCCUR. 605 E270 32E4 606 XOR AH,AH ;ClEAR AH REG E272 fB 607 STI ; ENABLE EXTERNAL INTERRUPTS E273 26C9 608 SUB ex.ex ;WAIT 1 SEC FOR ANY INTRS THAT Ez.75 EZFE 609 04: lOOP 04 ; NIGHT OCCUR E277 ElFE 610 05: lOOP 05 E2:79 OAE4 6" OR AH.AH ;010 ANY INTERRUPTS OCCUR? A-9 LOC OBJ LINE SOURCE EZ7B 7408 612 JZ D7 ; NO - GO TO NEXT TEST E27D BADIOI 613 06: tlOV DX.lOIH ;BEEP SPEAKER IF ERROR E280 EBAD03 61. CALL ERR_BEEP ;GO TO BEEP SUBROUTINE E263 FA 615 eLI E284 F4 61. HlT iHAl T THE SYSTEM 617 ; --------------------- ----------------------- 618 lTEST.7 619 8253 TIMER CHECKOUT 620 ,DESCRIPTION 621 VERIFY THAT THE SYSTEM TIMER (01 DOESN'T COutlT TOO FAST NOR roo 622 SLOW. 623 ; -------------------------------------------- E285 624 07: E265 8400 625 MOV AH.O ;RESET TIMER INTR REevo FLAG E287 32EO 626 XOR CH,CH ;CLEAR THE CH REG E289 BOFE 627 MOV AL.OFEH ;MASK ALL INTRS EXCEPT lVL 0 E288 E621 628 OUT INTAOl,AL ;WRITE THE 8259 IMR E280 BOlO 62' MOV AL,DODIDoooe ;SEL TIM 0, lSB. MODE O. BINARY E26F E643 630 OUT TIM_CTl,Al ;WRITE TIMER CONTROL MODE REG E291 8116 631 tl0V CL,16H ; SET PGM lOOP CNT Ei::93 SACl 632 "OY Al.Cl i SET TIMER a CNT REG EZ95 E640 63> OUT TIMERO.AL ;WRITE TIMER 0 C~H REG EZ97 F6C4FF 634 08: TEST AH.OFFH iDID TIHf.R a INTERRUPT OCCUR? E,9A 7504 635 JtlZ 09 ;. YES - CHECK TINER OP FOR SLOW TIME E,9C E,F9 636 LOOP 08 iWAIT FOR INTR FOR SPECIFIED TIME E,9E EBOD 637 J~\P 06 j TIMER 0 INTR OION T OCCUR - ERR EZAO B112 638 09: HOV CLol6 ;. sn PGH LOOP CNT E2A, BOFF 63' MOV Al.OffH ; loo.'lHTE TIMER 0 CNT REG E,A4 E640 64. OUT TIMEPO,Al E,Ab B400 641 MOV AH.O ,RESET WTR RECEIVED FLAG E2A8 BOFE 642 MOV At,OFEH ;.REENABLE TIMER a ItITERRUTS E2AA E621 643 OUT INTAOl,Al E,AC F6C4FF 644 010: TEST AH .OFFH ;DID TIMER 0 INTERRUPT OCCUR? ElAF 75CC 645 JUZ 06 ;YES - TIMER CNTING TOO FAST, ERR E281 EZF9 646 lOOP 010 iWAIT FOR INTR FOR SPECIFIED TIME E2B3 E93600 647 ..J11P T5T6 ,GO TO NEXT TEsr ROUTINE 648 -- ----- -- ------------------ - ---------------- ;. 649 TEMPORARY INTERRUPT SERVICE ROUTINE 650 ;-------------------------------------------- E,86 651 Dll PROC NEAR HB6 8401 652 MOV AH,l E,B8 50 653 PUSH AX jSAVE REG AX CONTENTS EZB9 BOH 654 MOY Al.OFF" ;MASK ALL INTERRUPTS OFF £2BB E6Z1 655 OUT INTAOl,Al EzaD BOZO 656 MOV AL.EO! E2Bf E6,0 657 OUT INTAOO.AL Elel 58 658 POP AX ;RESTORE REG AX CONTENTS E,CZ CF 659 IRET 660 011 ENDP 661 EZC3 662 NMI_INT PROC NEAR EZC3 50 663 PUSH AX ;. SAVE ORIG CONTENTS OF AX EZC4 E462 66' IN AL,PORT_C EZC6 A840 665 TEST AL.40H ;. 10 CH PARITY CHECK? EZC6 7406 666 JZ 01' ; YES - flAG IS SET TO 0 EZCA. 8El9EZ 667 fl0Y SI ,OffSET 01 ;. AOOR OF ERROR MSG fZCD 690EOO 668 MOV CX.Oll iMSG LENGTH EZDO EeOA 669 JMP SHORT 013 jOISPlAY ERROR HSG fZO, 670 012:: f,OZ A880 671 TEST At.80H iPlANAR RAN P-CHECK? EZ04 7410 672 JZ 014 IND - AUX tNT E2.0& BEZ7EZ 673 "OV 51 • OF FSET DZ ; AODR OF ERROR MSG fl09 MOEDO 674 MOV eX,Oll iMSG LENGTH ElOC 675 013: E20C B80000 676 MOV AX.!) ; nUT AUt) SET MODE FOR VIDEO E,DF COlO 677 INT 10H lCALL VIOEO_to PROCEDURE ElEl £8E603 678 CALL P_NSG ;PRINT ERROR HSG EZE4 FA 679 eLI ElE5 F4 68' HlT ;HALT SYSTEM EZE6 681 014: ElE6 58 682 POP AX ;.RESTORE ORIG CONTENTS Of AX EZE7 CF 683 IRET 68. NMI_INT ENOP A-tO lOC OBJ LINE SOURCE 685 j------------------------------------- 686 687 688 . ; INITIAL RELIABILITY TEST -- PHASE 3 -------------------- ------------------ ASSUME CS :COCE ,DS:DATA 689 f2E8 20323031 69, El DB 201 ' 0004 691 Ell EQU $-E1 6n 693 ESTABLISli 8IOS SUBROUTINE CAll INTERRUPT VECTORS 694 [2Ee 695 T518: f2Ee Fe 696 CLD ; SET DIR flAG TO GO FORWARD E.ZED SF4DOO 697 MDV oI.OFFSET VIDEO_IHT iSETUP AODR TO INTR AREA E2FO DE 698 PUSH CS E2Fl IF 699 POP as ; SETUP A.ODR OF VECTOR TABLE ElF2 BE13FF 700 Mav SI,OFF13H ; OFFSET VECTOR_TABlE+3Z EZFS S92000 701 MOV eX.20H EZF8 F3 702 REP MOVS\.I ;MOVE VECTOR TABLE TO RAM EZF9 AS 703 704 SETUP TIMER 0 TO HODE 3 705 EZfA BOff 706 MOV Al.OFFH ;DISABLE ALL DEVICE INTERRUPTS E2fC E621 707 OUT INTAOt.At EZFE B036 708 MOV Al.3&H iSEl TIM O.lSB.t1SB.HODE 3 BOO [643 709 OUT TIMER+3,AL iWRITE TIMER HODE REG E302 BODO 710 MOV AL.O EJ04 E640 711 OUT TIMER.AL ;WRITE LSB TO TIMER 0 REG n06 E640 712 OUT TIMER,AL ;WRITE M58 TO TIMER 0 REG 713 714 SETUP TUIER 0 TO BLINK LED IF MANUFACTURING TEST HODE 715 71' ASSUME DS:DATA E308 884000 717 MOV AX.DATA ,POINT DS TO DATA SEG nOB 8E08 718 MOV DS,AX nOD E87803 719 CALL KBD_RESET ;SEND SOFTWARE RESET TO KEYBRD E310 80FBAA 7Z0 CM? BL.OAAH ;SCAN CODE AA' RETURNED? E313 7426 7Z1 JE E3 ; YES - CONTINUE (NON MFG MODE) £lIS B03C 7Z2 MOV Al,3CH ;EN KBD. SET KBD CLK LINE LOW £317 E661 7Z3 OUT PORT_B.AL ;"''RITE 8255 PORT B E319 90 7Z4 HOP E3lA 90 7Z5 Nap E31B £460 7Z6 IN AL,PORT_A ;WAS A BIT CLOCKED IN? EllD 24FF 727 AND AL,OFFH E3lf 7516 728 JNZ E. ;YES - CONTINUE (NON MfG MODE) E3l! FE061200 7Z. INC MFG_TST ; ELSE SET SW FOR MFG TEST MODE E325 26C7062000B2£6 R 730 MOV ES:INT_AoDR.OFFSET BLINK_1NT ;SETUP TIMER INTR TO BLINK LED E32C 26C706220000FO R 731 MOV ES: INT_ADDR+2 .CODE E333 BOfE 732 MOV AL,OFEH ; ENABLE TIMER INTERRUPT E33S E621 733 OUT INTAOl.Al E337 734 E2: ; JUMPER_NOT_IN: E337 Boce 735 MOV AL.DCCH ;RESET THE KE'I'BO.lRD E339 E661 736 OUT PORT_B.AL 737 --------------- -- -------------------------- 738 ;TEST.OS 739 ROS CHECKSUN I I 740 ,DESCRIPTION 741 A CHECKSUM IS DONE FOR THE 4 ROS MODULES CONTAINING BASIC COOE 742 i -- ------------------------------------------ EBB 743 E3: E338 8204 744 MOV DL.4 ; NO. OF ROS MODULES TO CHECK £330 BB0060 745 MOV BX.6000H ;SETUP STARTING ROS ADDR El40 74' E4: ; CHECK_ROS: E340 E8C8FE 747 CALL ROS_CHECKSUH £343 7507 748 JNE E5 ;BEEP SPEAKER IF ERROR £345 fECA 749 DEC Ol ;AHY MORE TO DO? E347 7SF7 750 JNZ E4 oYES - CONTINUE £349 E80790 751 JHP E6 ;NO - GO TO NEXT TEST E34C 752 E5: o ROS_ERROR: E34C BAOI0l 753 MOV DX.IOIH E34F E8DE02 754 CAll ERR_BEEP ,BEEP SPEAKER A-II LOC OBJ LINE SOURCE 755 ; ------- ------------------------------------- 756 ;TE51.08 757 INITIALIZE AHO START CRT cmnROllEp. (68451 758 TEST VIDEO READ/WRITE STORAGE. 759 ;DESCRIPTION 760 RESET THE VIDEO EtlABlE SIG~lAL. 761 SELECT ALPHANUMERIC MODE. 40 * ,5. B & W. 762 READ/UIUTE DATA PATl[::tlS TO STG. CHECK STG ADDRESSABlllTY. 763 ; ----------- --- ----- ----- ---- ---------------- E352 76. E6: £352 E460 765 IN AL,PORT_A ;READ SENSE SWITCHES E354 8400 7•• HOV AH,O £356 A31000 767 HOV EQUIPJlAG.AX ;STORE SENSE SW ItlFO E359 2430 7'8 AND Al.3DH ; ISOLATE VIDEO SUS ElS8 7503 7 •• JNZ E7 ;VIDEO SWS SET TO 01 ElSD E99800 770 JMP n. ;SKIP VIDEO TESTS FOR BURN-IN E360 771 £7: ; TEST_VIDEO: E36D 86EO 772 XCHG AH,AL £362 eOFC30 773 eMP AH.30H ;B/W CARD ATTACHED? n6S 7409 77. JE E8 ; YES - SET MODE FOR 8/W CARD 067 FEtD 775 INC AL ;SET COLOR HODE FOR COLOR CO E369 80FC2:0 77. eMP AH.2:0H ;80X25 t10DE SELECTED'? E36C 7502 777 JNE E8 ;NO - SET HODE FOR 40X2:5 E36E BOO] 778 HOV AL.3 ;SET HOOE FOR 80XZ5 E370 77. E8: ; SET_MODE: E370 50 780 PUSH AX iSAVE VIDEO HODE ON STACK E371 2AI:4 781 SUB AH.AH ; INITIALIZE TO ALPHANUMERIC P1D E373 COlO 762 INT 10H JCAll VIDEO_IO E375 58 783 POP AX jRESTORE VIDEO SENSE SWS IN AH E376 50 784 PUSH AX ; RESAVE VALUE £377 B800BO 785 NOV BX,OBQOOH ;BEG VIOEO RAM ADOR B/w CD EllA BA8803 76. HOV OX,3BSH ;HoDE REG FOR B/W E37D MOOIO 787 HOV CX,4096 ;RAH BYTE CNT FOR B/W CD El80 8001 788 HOV AL,I ; SET HODE FOR BW CARD E382: BOFC30 78' CtlP AH,30H ;B/W VIDEO CARD ATTACHED? E3B5 740B 790 JE EO ; YES - GO TEST VIDEO STG E387 8B0088 7'1 HOV BX.OB800H iBEG VIDEO RAM ADOR COLOg CD El8A 8A0803 792 HOV OX,308H jMQOE REG FOR COLOR CD E38D 890040 793 HOV CX,4000H ;RAH BYTE CNT FOR COLOR CO £390 FEce 79. DEC AL ; SET HOOE TO 0 FOR COLOR CD E392 7., £9: ; TEST_VIDEO_STG: E392 EE 79. OUT OX.AL jOISABLE VIDEO FOR COLOR CD £"393 BEC3 797 HOV ES,BX ; POINT ES TO VIDEO RAM STG £395 B84000 796 HOV AX.DATA ;PDINT OS TO DATA SEGMENT E398 8£08 7 •• HOV OS,AX £39A 813E72003412: 600 eMP RESET_FlAG,l2:34H ;POD INITIATED BY KSD RESET? E3AO 7400 801 JE no ; YES - SKIP VIDEO RAM TEST E3A2: BEOB 602 HOV OS.BX ; POINT OS TO VIDEO RAM STG E3A4 E876FC 803 CALL STGTST_CNT .GO TEST VIDEO RI'W STG E3A7 7406 80. JE no ; STG OK - CONTINUE TESTING E3A9 BA02:01 805 HOV DX.I02:H ;SETUP I OF BEEPS E3AC E88102: 8 •• CALL ERR_BEEP ,GO BEEP SPEAKER 807 ; --------- ----------------------------------- 808 j.TEST .09 809 SETUP VIDEO DATA ON SCREEN fOR VIDEO LINE TEST. 810 ;DESCRIPTION 611 EIIABLE VIDEO SIGNAL Aim SET HODE. 812 DISPLAY A HORIZONTAL BAR ON SCREW. 813 ;-------------------------------------------- E3Af 81. ElO: E3Af 58 815 POP AX ;GET VIDEO SENSE SWS (AH) E3BO 50 81' PUSH AX ;SAVE IT E3BI 8400 817 HOV AH,O ; EUABLE VIDEO AND SET MODE E383 COlO 818 INT 10H ; VIDEO E385 882:070 81. MOV AX.702:0H ;WRT BLANKS IN REVERSE VIDEO nBS 2BFF 8" SUB OI,OI ; SETUP STARTING LOC E3BA B92:800 821 HOV CX.40 iNO. OF BLANKS TO DISPLAY nBD FC 6" CLO ;SET OIR flAG TO INCREMENT nSE f3 823 REP ST05W ;WRITE VIDEO STORAGE E3BF AS A-12 LOC OBJ LINE SOURCE 824 ;-------------------------------------------- 825 JTEST .10 8,6 CRT INTERFACE LINES TEST 827 jDESCRIPTION 828 SENSE ON/OFF TRANSITION OF THE VIDEO ENABLE AND HORIZONTAL 829 SYNC LINES. 830 ; ----------- ---- --- --- ------- ---------------- nco 58 831 POP AX ,GET VIDEO SENSE SW INFO nCI 50 832 PUSH AX ;SAVE IT DC2 80FC30 8" eMP AH,30H jB/W CARD ATTACHED? E3C5 BABA03 834 MOV OX,03BAH .SETUP ADDR OF BW STATUS PORT nCB 7403 835 JE Ell ; YES - GO TEST LINES E3eA BAOA03 836 MOV DX,03DAH ;COLOR CARD IS ATTACHED nco 837 Ell: ; LINE_1ST: E3tD 6408 838 MOV AH.8 EXF 83. EI;?:: ; OFLOOP_CNT: nCf 28C9 840 SUB ex.ex n01 EC 841 E13: IN AL.DX ;READ CRT STATUS PORT E302 22C4 842 ANO AL.AH .CHECK VIDEOIHORZ LINE EJDct 750ct 8", JNZ El4 ; ITS ON - CHECK IF IT GOES OFf nOb E2F9 844 LOOP El3 ; LOOP TIll ON OR TIMEOUT E30B EB13 845 JMP SHORT £17 ; GO PRINT ERRO~ MSG nOA 2BC9 846 E14: SUB cx,cx not EC 847 E15: IN AL.DX .READ CRT STA.TUS PORT nOD 22C4 848 ANO AL.AH ;CHECK VIfJEO/HORZ LINE E3DF 7404 84. JZ El6 ; ITS ON - CHECK NEXT LINE nEl ElF9 850 LOOP El5 ; LOOP IF OFF TIll IT GOES ON E3E3 EB06 851 JMP SHORT E17 nE5 852 E16: ; NXT_LINE: nE5 6103 853 MOV CL.3 ;6ET HEXT BIT TO CHECK E3E7 OlEC 854 SHO AH.CL E3E9 75E4 855 JNZ El2 ;GO CHECK HORIZONTAL LINE E3E8 EB06 856 JMP SHORT £18 ;DISPLAY CURSOR ON SCREEN E3ED 857 E17: ; CRT_ERR: nED BA0201 65. MOV OX.I02H E3FO E83002 859 CAll ERR_BEEP ;GO BEEP SPEAKER E3F3 •• 0 E18: ; DISPLAY_CURSOR: E3F3 58 861 POP AX ;GET VIDEO SENSE SWS tAH J E3F4 8400 862 MOV AH.O iSH tlOoE AND DISPLAY CURSOR 'f3F6 COlO 8.3 lin IOH ;CALL VIDEO 1/0 PROCEDURE 864 ; -------------------------------------------- 6.5 ;TEST .11 666 ADDITIONAL READI"WRITE STORAGE TEST ,.7 ;DESCRIPTION 868 WRITE/READ DATA PATTERNS TO ANY READ/WRITE STORAGE AFTER THE BASIC 869 16K. STORAGE ADORESSABIlITY IS CHECKED. 870 ; - - - - - - - - - - - - - ------------------------------- 871 ASSUME DS:DATA BF8 872 E19: E3F8 884000 873 MOV AX.DATA E3FB 8E08 874 MOV OS.AX 875 87. DETERMINE RAM SIZE ON PLANAR BOARD 877 E3FD 8A261000 878 MOV AH .BYTE PTR EQUIP_flAG ; GET SENSE S!.lS INFO E401 80E40C .79 AND AH.OCH ; ISOLATE RAM SIZE SWS E404 B004 880 MOV AL-.4 E406 F6E4 881 HUL AH E408 0410 882 AOO AL.16 ; ADO BASIC 16K £40A 8800 883 MOV DX.AX ;SAVE PLANAR RAM SIZE IN OX E40C 8608 8B4 MOV BX.AX ; AND IN ex 885 . .6 DETERMINE 10 CHAtlNEl RAM SIZE 887 E40E E462 888 IN Al,PORT_C ; READ 10 CH RAM SIZE SWS £410 240F 88' ANO AL,OFH ; ISOLATE FROM OTHER BITS E412 8420 8.0 MOV AH,32 E414 F6£4 891 MUL AH £416 A31500 892 MOV IO_RAM_SIZE,AX ; SAVE 10 CHANNE l RAM SIZE £419 83F840 893 eMP BX,40H ;PLANAR RAM SIZE:: 64K? E41C 7402 894 JE E20 ; YES - ADO 10 CHN RAM SIZE E41E l8CO 895 SUB AX,AX ; NO - DON T ADD ANY 10 RAM E420 89. E20: ; ADD_IO_SIZE: E420 03C3 897 AOO AX.BX ;SUM TOTAL RAM SIZE E422 A31300 898 t10V MEMORY_SIZE,AX ;SETUP MEMORY SIZE PARH E425 813E72003412 899 eMP RESETJLAG.IZ34 t1 ;POO INITIATED BY KBD RESET? A-13 LOC OUJ LINE SOURCE £428 7440 '00 JE E22 i YES - SKIP MEI10RY TEST '01 '0' TEST ANY OTHER READ/WRITE STORAGE AVAILABLE .03 £420 8BOO04 .0' NOV BX.400H £430 891000 .05 NOV eX.16 E433 .0. E21: E433 3801 .07 CMP OX,ex ;ANY tIORE 51G TO BE TESTED? E43!i 7646 .08 JBE En ;NO - GO TO NEXT TEST E437 8ED8 .0. MOV os.ex i SETUP STG ~DR IN OS AND ES E439 8EC3 '10 NOV ES.BK £438 83CnO .11 ADD tX,16 ; INCREMENT srG BYTE COUNTER £43£ 81C30004 '1' ADD BX,400H ; SET POINTER TO NEXT 161<; BLK E442 51 .13 PUSH CX .SAVE REGS E443 53 '1' PUSH BX E444 52 .15 PUSH OX £445 E8D2FB .1. CALL 51G15T ;GO TEST A 16K BLK OF STS E448 SA '17 POP OX E449 5B '18 PDP BX ;RESTORE REGS E44A 59 '1' POP CX £448 74E6 •• 0 JE EZI ;CHECK IF I10RE STG TO TEST 'Z1 OZ • PRINT FAILING ADDRESS AND )(OR'ED PATTERN IF DATA COMPARE ERROR • 23 EltCtD 8CD'" '2' MOV DX.DS ;CONVERT FAILING HIGH-ORDER E44F 8Af8 OZ5 MOV CH.Al ;SAVE FAILING BIT PATTERN E451 SAC6 '2. NOV AL,OH iGET FAILING ADDR (HIGH BYTE) £453 B104 .27 NOV Cl.4 E455 OZES •• 8 SH• AL,CI. ;RIGHT-JUSTIFY HIGH BYTE E457 E83EOO E454 8AC6 ••• 930 CALL MDV XLAT_PRINT_CDDE AL,I)H ;CONVERT AND PRINT CODE E45C 240F 931 AND Al,OFH E4SE E83700 93. CALI. XLAT_PRINT_CDDE ;CONVERT AND PRINT CODE £461 8ACS .33 MOV Al,eH ;GET FAILING BIT PATTERN E463 BI04 93. MOV CL,4 j AND ISOLATE LEFTMOST NIBBLE £465 D2E8 935 SH. Al,Cl E467 E82EOO 93. CALL XLAT_PRINT_CDDE ;CONVERT AND PRINT CODE E46. 8AC5 E46C 240F 937 938 .,,. MOV Al,CH Al,OFH ;GET FAILING BIT PATTERU AND ; ISOLATE RIGHTMOST NIBBLE £46E E82700 93. CALL XLAT_PRINT_CDDE ;CONVERT AND PRINT CODE E471 BEEeH .40 MOV SI,OFFSET £1 .SETUP ADDRESS Of ERROR MS6 £474 690400 941 MOV ex,Ell ;GET M5G BYTE coum E477 E65002- .4. CAll P_MSG ; PRINT ERROR MSG £47... 943 £22: ; GO_TSTlZ: E47J. E94AOO E.7D ••• 945 E23: JMP TST12 ; GO TO NEXT TEST ; STG_TEST_DONE: E47D B84000 £480 8£08 ••• 947 MDV NOV AX,DATA OS.AX ,POINT OS TO DATA SEGMENT 5 CH6 "AD£ 3/2:7/81 ;GET 10 CHANNEl RAM SIZE ... £482 SB161500 948 NOV DX,IO_RAM_SIZE £486 0602 ••• O• DX,DX ;SET fLAG RESULT HID 10 RAM. GO TO NEXT TEST ... 1:488 74fO '50 JZ E48... B90000 '51 MOV ex,o E46D 81FBOOIO CMP BXolOOOH i HAS 10 RAM BEEN TESTED E491 77E7 .53 JA E22 j YES - GO TO NEXT TEST £493 B80010 '54 MDV BX,lDOOH ; SETUP BEG LOe FOR 10 RAI1 Elt96 E898 .55 JMP SHORT E21 ;GO TEST 10 CHANNEL RAM .5. j -- ------ -- ------ - ------ - ---------- --- ------- '57 CONVERT AND PRINT ASCII CODE '58 '5' Al I1UST CONTAIN NUMBER TO BE CONVERTED. •• 0 AX AND ex DESTROYED • 961 ;-- ------ -- ----------------- ------- ---------- E498 £498 IE ••• •• 3 XLAT_PRINT_CODE PUSH P.OC OS HEAR ISAvE DS VAI,.UE £499 OE £49A IF ••• 9.5 PUSH PDP CS OS ; POINT OS TO CODE SEG E49B BBB7Elt E49£ 07 ••• 967 IIDY XLATB BX,OE467H I OffSET ASCII_ T8l-XlAT TABLE E49F ectOE •• 8 MDV AH,lft E4AI 8700 E4A3 CDIO ••• '70 MDV UlT 6H,O 10H .CALL VIDEO_IO E4AS IF '71 PDP OS ;RESTORE ORIG VALUE IN DS E4A6 C3 RET 97. 973 XLAT_PRINT_toDE ...,p A-14 LOC OBJ LINE SOURCE 974 ; --------------------------_.----------- 975 ; INITIAL RELIABILITY TEST --. PHASE 4 97. ; -----------._-------------------------- 977 ASSUME CS :CODE .DS:OATA E4A7 Z0333031 976 Fl DB • 301' 0004 979 FlL EOU $-Fl ; KEYBOARD MESSAGE E4AB 313331 98' FZ DB '131 ' 00-03 96' F2L EOU $-FZ j CASSETTE MESSAGE E4AE 363031 962 F3 DB '601 • 0003 963 F3L EOU $-F3 ; DISKETTE MESSAGE 96' E4Bl 965 F4 LABEL WORD ; PRINTER SOURCE TABLE E481 BC03 96. OW 36CH £483 7803 987 OW 378H E485 780Z 968 OW 2:78H E487 989 '4E LABEL WORD E481 30313Z33343536 99' ASCICT6L DB '0123456 789ABCDEF' 373133941424344 4546 991 ; ----------------------------------- ------._- 992 ITEST.12 993 KEYBOARD TEST 994 ;OESCRIPTION 995 PESET THE KEYBOARD AND CHECK THAT SCAN CODE AA' IS RETURNED 996 TO THE CPU. CHECK FOR STUCK KEYS. 997 ; ---_.---_.-----._- -------------------------- E4C7 998 TSTl2: E4C7 B84000 999 MOV AX,DATA ;POINT os TO DATA SEG E4CA 8ED8 1000 MOV DS.AX E4CC 803El£:0001 1001 CM" tlFG_TST .1 ;MAUUfACTUIUHG TEST MODE? £401 7439 1002 JE '7 ; YES - SKIP KEYBOARD TEST £403 £88201 £406 £32B 1003 1004 CAll JCXZ ,. KBD_RESET J ISSUE SOFTWARE RESET TO KEYBRD ; PRINT ERR HSG IF NO INTERRUPT E4D8 B040 1005 I10V Al.4DH ;ENABLE KEYBOARD E40A £661 1006 OUT PORT_B.Al E40C BOFBAA 1007 eMP BL,OAAH ;SCAN CODE AS EXPECTED? E4DF 7522 1008 JNE F. ;NO - DISPLAY ERROR t1SG 1009 1010 CHECK FOR STUCK KEYS 1011 E4E1 Boce 101Z MDV AL,OCcH ICU! KBD. SET CLK LINE HIGH E4E3 E661 1013 OUT PORT_B.AL E4E5 B04C 1014 MOV AL,4tH ;ENABLE KBO,CLK IN NEXT BYTE E4E7 E661 lOIS OUT PORT_B,AL E4E9 2BC9 1016 SUB cX,ex E4EB 1017 FS: ; KBD_WAIT: E4EB E2FE 1018 lOOP F5 ;DElAY FOR A WHILE E4ED E460 1019 IN AL,KBD_IN ;CHECK fOR STUCK KEYS E4EF 3(00 1020 CMP Al,O ;SCAN CODE ::;. O? E4F1 7419 1021 JE F7 ; YES - tONTINUE TESTING E4F3 SAE8 1022 MOV CH,Al ;SAVE SCAN CODE E4F5 BI04 1023 MOV CL,4 E4F7 02E8 1024 SHR AL,Cl ;RIGHT-JUSTIFY HIGH BYTE E4F9 E89CFf 1025 CAll XLAT_P!;IINT_CODE ;eOHVERT AHD PRINT E4Fe SAC5 1026 HOV Al,eH ;RECOVER SCAN ceDE E4F£ 240F 1027 AND Al,OFH ;ISOLATE lOW ORDER BYTE E500 E89SFF 1028 CALL XLAT_PIUNT_CODE ;CONVERT AND PRINT E503 BEA7E4 R 1029 F6: MOV 5I.OFFSET F1 i GET MSG ADDR ES06 B90400 1030 MOV CX, fIt ; GET t1SG BYTE COUNT E509 E8BEOI 1031 CALL P_I1SG j PRINT MSG ON SCREEN 1032 1033 SETUP INTERRUPT VECTOR TABLE 1034 E50C 1035 F7: ; SETUP_INT_TABlE: ESOC 28CO 1036 SUB AX,AX ESOE SEeD 1037 HDV ES,AX E510 893000 1038 MOV CX,24*2 ;GET VECTOR CNT E513 OE 1039 PUSH CS ;SETUP OS SEG REG ES14 If 1040 POP OS ES15 BEF3FE 1041 HOV SI.OFEF3H ; OffSET VECTOR_TABLE £518 BF20DD 1042 MOV DI.OfFSET INT_PTR ESIB Fe 1043 CLD ESIC F3 1044 REP 110VSW ESID AS A-IS LaC OBJ LINE SOURCE 1045 i --------------- ---------------------------- 1046 ;1E5T.13 1047 CASSETTE DATA WRAP TEST 1048 ;DESCRIPTION 1049 TURN CASSETTE MOTOR OFF. WRITE A BIT OUT TO THE CASSETTE DATA BUS. 1050 VERIfY THAT CASSETTE DATA READ IS WITHIN A VALID RANGE. 1051 ,-- ------ ------ -- --- - - ------ ---- -- -- ------ --- 1052 lOS} TURN THE CASS!::TTE MOTOR OFF 1054 E51E 8840110 1055 MOV AX.OATA ;POINT OS REG TO DATA SEG t:521 6ED8 1056 MOV OS,AX E523 8040 1057 MOV Al.040H ; SET TIMER 2 SPK OUT, AND CASST E525 E661 1058 CUT FORT_B.Al ;OUT BITS ON. CASSETTE MOT OFF 1059 1060 WRITE A BIT 1061 E527 BOFF 1062 MOV Al,OFFH ; DISABLE TIMER INTERRUPTS E529 E621 1063 C'JT INTAOl,Al E528 8086 1064 MOV AL.OB6H jSEL TIM 2. lSB. I1SB. t1D 3 £52:0 £643 1065 OtIT TIMER+3,AL ;WRITE 8253 CMD/MOOE REG E52F 880304 1066 MOV AX,1235 ;SET TINER 2 CNT FOR 1000 USEe E532 E642 1067 OUT TIMER+2.Al ,WRITE TIMER 2 COUNTER REG £534 SAC4 1068 MOV AL.AH ;WRITE M58 E536 E642 1069 OUT TIHER+2.Al 1070 1071 REAO CASSEnE INPUT 1072 E538 E462 1073 IN Al,PORT_C iREAD VALUE OF tASS IN BIT E53A ,410 1074 AND AL.10H ; ISOLATE FROM OTHER BITS ES3C AlbBOO 1075 MOV LAST_VAl,Al E53F £83E14 1076 CAll READ_HALF _BIT E5(t2 E83814 1077 CALL READ_HALF _BIT f545 f30C 1078 JCXZ F8 i CAS_ERR E547 81 FB400S 1079 eMF BX.MAX_PERlOO £548 7306 1080 JNe F8 ; CAS_ERR E54D 81FBI004 1081 eMF BX.NIN_PERIOD E551 7309 1082 JNe F9 iGo TO NEXT TEST IF OK E553 1083 F8; I CAS_ERR: E553 BEABE4 1084 MOV SI.oFFSET F2 ; cASSEnE WRAP FAI LED E556 890300 1085 MOV eX.F2L E559 E66EOI 1086 CALL P_MSG ;GO PRINT ERROR MSG 1087 i -------- - - - ---- - ---- ------------------------ 1088 ; TEST .14 1089 DISKEnE ATTACHMENT TEST 1090 ;DESCRIPTIoN 1091 CHECK IF IPl DISKETTE DRIVE IS ATTACHED TO SYSTEM. IF ATTACHED, 1092 VERIFY STATUS OF NEC FOC AfTER A RESET. ISSUE A RECAl AND SEEK 1093 CMO TO FOC AND CHECK STATUS. COMPLETE SYSTEM INITIALIZATION THEN 1094 PASS CONTROL TO THE BOOT LOADER PROGRAM. 1095 ;----- ------------------------------------ --- Esse 1096 F9: Esse 80Ft 1097 MOV Al,OfCH j ENABLE TIMER AND KBo INTS E55E £621 1098 OUT INTACt,Al E560 AOtOQO 1099 MOV Al.BYTE PTR EQUIP_flAG j GET SENSE SWS INFO E563 ASOI 1100 TEST Al.OIH iIPl DISKETTE DRIVE ATTCH? E565 7503 1101 JNZ FlO ; YES - TEST DISKETTE CONTR £567 E98900 1102 JMF F22 ,NO - SKIP THIS TEST E56A 1103 FlO: i 0 ISK_TEST: E56A BOBC 1104 MOV Al.OBCH ; ENABLE DISKETTE. KEYBOARD, ES6e E621 1105 OUT INTAol.Al ; AND TIMER INTERRUPTS ES6E 8400 1106 MOV AH.O ;RESET t~Ee FOC E570 CD13 1107 INT 13H ,VERIFY STATUS AFTER RESET E57Z F6C4FF 1108 TEST AH ,OFFH iSTATUS OK? £575 7520 1109 JNZ F13 ;NO - FOC FAllED 1110 1111 TURN DRIVE 0 MOTOR ON 1112 £577 BAF203 1113 MOV OX.03F2H jGET ADOR OF Foe CARD E57A BOlt 1114 MOV AL,ICH ; TURN MOTOR ON. EN DMA/INT E57C EE 1115 OUT OX.AL iWRITE FDC CONTROL REG £570 28C9 1116 SUB eX,ex E57F 1117 Fll: ; MOTOR_WAIT: E57F E2FE 1118 LOOP F11 jWAIT FOR 1 SECOND E581 1119 F12 : ; MOTOR_WAIT 1 : E581 E2FE 1120 LOOP F12 E583 3302 1121 XOR OX,OX ; SHECT DRIVE 0 A-16 lOC OBJ LINE SOURCE E585 8501 1HZ MOV ClI,I ; SElECT TRACK 1 E587 88163£00 1123 MOV SEEK_STATUS.DL E588 E8F308 1124 CALL SEEK ;RECALIBRATE DISKETTE ES8E 7207 1125 JC F13 IGO TO ERR SUBROUTINE IF ERR £590 8522 1126 NOV CH,34 ;SElECT TRACK 34 £592 E8ECDe 1127 CAll SEEK ;5EEK TO TRACK l4 £595 7]09 1128 JNC Fl4 ;OK, TURN HOTOR OFF £597 1129 FI3: ; DSK_ERR: £597 BEAEElI 1130 I10V SI,OFFSET F3 iGET ADOA' OF I1SG £59. 890300 lUI MaV CX,F3L ;GET HSG BYTE COUNT £59D E82A01 1132: CALL P_t'lSG iGO PRINT ERROR t'ISG 1133 "34 1135 TURN DRIVE 0 HOTOR OFF £5AO 1136 F14: ; ORO_OFF: ESAO eooc 1137 tIOV Al,OCH jTURN DRIVE 0 MOTOR OFF £5A2 BAF203 1138 MOV DX.03F2H ; FDC CTL ADDRESS [SA5 EE 1139 OUT OX,AL 1140 1141 SETUP PRINTER AND RS232 BASE ADDRESSES IF DEVICE ATTACHED 1142 £5A6 1143 FlS: i JMP_BOOT: £5A6 C7061AOO 1EOD 1144 I10V BUFFER_HEAD,OFFSET KB_BUFFER ;SETUP KEYBOARD PARAHETERS ESAC C7061COOIEOO 1145 MOV BUFFER_TAIL, OFFSET KB_BUFFER E5B2 BDBIU 1146 MOV BP.OFFSET F4 E585 8£0000 1147 MOV 51.0 ESB8 1148 F16: j PRT_BASE: ESSB 2e885600 1149 MOV Dx.cs:lBPJ ;GET PRINTER BASE ADDR ESBC BOAA 1150 MOV Al.OAAH IWRITE DATA TO PORT A Es8E EE 1151 OUT DX.Al £58F 2ACO 1152 SUS Al.AL E5Cl EC 1153 IN AL.ox ;READ PORT A ESC2 3CAA 1154 CMP AL.OAAH ;DATA PATTERN SAHE E5C4 7506 1155 JNE F17 ;NO - CHECK NEXT PRT CD £5C6 89940800 1156 MOV PRINTER_BASEl SI J.DX ;YES - STORE PRT BASE ADDR ESCA 46 1157 INC SI ; INCREMENT TO NEXT WORD £see lt6 llSB INC SI [SCC 1159 F17: j NO_STORE: ESCC "-5 1160 INC BP ; POINT TO NEXT BASE ADoR ESCD 45 1161 INC BP ESCE 81FD87£4- 1162 CM? BP.OFFSET F4E JALL POSSIBLE ADDRS CHECKED? E502 75£4 1163 JHE FlO ;PRT_BASE E5D4 B80000 1164 MOV BX,O jPOINTER TO RSZ3Z TABLE E507 BAFA03 1165 MOV DX.3FAH ;CHECK IF RS232 CD 1 AnCH? ESDA EC 1166 IN AL.OX ;READ INTR 10 REG E5DB ABF8 1167 TEST AL.OFSH ESDD 7S08 1168 JNZ F18 ESDF C7870000F803 1169 MOV RS232_BASEIBX J,3FSH ;5ETUP RS232 CD 11 ADDR E5E5 43 1170 INC BX £5£6 43 1171 INC BX E5E7 SAfAD2 117Z FIB: MOV OX,2FAH ;CHECK IF RS232 CD 2 ATTCH [SEA EC 1173 IN Al.DX .READ INTERRUPT ID REG ESES A6F8 1174 TEST AL,OF8H ESED 7508 1175 JtlZ Fl. :lBASE_ENO ESEF C7870000F802 1176 MOV RS232_BASEl BX J., 2F8H ;SETUP RS232 CD IZ E5F5 43 1177 INC BX £5F6 43 1178 INC BX 1179 1180 i------ SET UP EQUIP FUoG TO INDICATE NUI18ER OF PRINTERS AND RS232 CARDS 1181 ESF7 1182 F19: ; BASE_EN!); E5f7 8BC6 1183 MOV AX,SI ; 51 HAS 2* NUt1BER OF RS232 ESF9 B103 1184 MOV Cl,l j SHIFT COUNT £5f8 D2C8 1I8S OOR Al,CL ; ROTATE RIGHT 3 POSITIONS ESFD OAC] 1186 OR Al,BL i OR IN THE PRINTER COUNT ESFF A21100 1197 MOV BYTE PTR EQUIP_FLAG+l.AL ; STORE AS SECOND BYTE £602 8AOI02 1188 MOV DX,201H £605 EC 1189 IN Al,OX £606 A80F 1190 TEST Al,OFH £608 7505 £60A 800£110010 1191 1192 JNZ "0 BYTE PTR EQUIP_FLAG+l,16 £60F 1193 F20: 1194 1195 ENABlF NMI INTERRUPTS 1196 £60F 8080 1197 MOV ;ENABlE NMI INTERRUPTS £611 £6AO 1198 OUT A-17 LOC OBJ LINE SOURCE £613 803£120001 1199 C"' MFG_TST.l j"FG HODE? E618 7406 1200 JE '21 I LOAD_BOOT_STRAP E61A 8AOI00 1201 "OV DX.l £610 £81000 1202 CALL ERR_BEEP iBEEP 1 SHORT TONE £620 12:03 F21: j LOAD_BOaT_SnAP: E620 E9CFOO 1204 J"' BOOT_STRAP ;GO TO TtlE BOOT LOADER E623 1205 F2:2: • LOOP_POD: £623 803£120001 1206 C"' f1FG_T5T.l ;t1ANUFACTURING TEST HODE? E628 7503 1207 JNE .23 i NO - GO TO BOOT LOADER E62A E92EFA. 1208 J"' START iYES - LOOP POWER-ON-DIAGS £62:D 1209 F23: ; GO_TO_Boon £620 [976FF 1210 J"' FlS j Jr1P_BOOT 1211 1212 ,----- --------------------------------------- ; INITIAL RELIABILITY TEST -- SUBROUTINES 1213 i -- --- - -- - -- ----- - --- --- ---- - -- ----- --------- 1214 ASSUME CS:CODE,DS:DATA 1215 1-------------------------------------------- 1216 SUBROUTINES FOR POWER ON DIAGNOSTICS 1217 1------- - - -------- ---------- -- ------- -------- 1218 TH IS PROCEDURE WILL ISSUE ONE LONG TONE (3 SECS) AND ONE OR 1219 MORE SHORT TONES (I SEC) TO INDICATE A FAILURE ON THE PLANAR 12:2:0 BOARD. A BAD RAM I1ODULE. OR A PROBLEM WITH THE tRT. 1221 jENTRY PARAMETERS: 122:2 OH = NUMBER OF LONG TONES TO BEEP 12:~3 DL = tlUMBER OF SHORT TONES TO BEEP. 12:24 i --------- ----- ------------------------------ E630 1225 ERR_BEiZP PROC NEAR E630 9C 12:2:6 PUSHF iSAVE flAGS E631 FA 1227 CLI ,DISABLE SYSTEI1 INTERRUPTS E632 IE 1228 PUSH OS iSAVE OS REG CONTENTS £633 864000 12:29 MoV AX.DATA jPOlNT bS TO DAYA SEG £636 8ED8 £638 OAF6 1230 1231 "". OR OS,AX CH.DH ; ANY LONG ONES TO BEEP E63A 7418 lZ32 JZ GJ ; NO. DO THE SHORT ONES E63C 1233 G1: ; LONG_BEEP; EUC B306 1234 "OV 8L.6 i COUNTER FOR BEEPS E63E £82S00 1235 CAlL BEEP ; DO THE BEEP £641 E2FE 1236 G2: LOOP G2 j DELAY BETWEEN BEEPS E643 FECE 1237 DEC DH j ANY MORE TO DO E645 75F5 1236 JIIZ GI i DO IT £647 803£12:0001 12:39 C"P t1fG_TST,1 j HFG TEST MODE? E64C 7506 1240 J~{E GJ i YES - CONTINUE BEEPING SPEAKER £64£ BOCD 1241 "OV Al.oeDH ; STOP BLINKING LED £650 E661 1242 OUT PORT_B.AL £652 EBE8 1243 J"' SHORT Gl £654 1244 G3: ; SHORT_BEEP: E654 B301 1245 I10V BL,l I COUNTER FOR A SHORT BEEP £656 £80000 1246 CALL BEEP ; DO THE SOUND E659 E2FE 1247 Gft.: LOOP G4 ; OEUY BETWEEN BEEPS USB F£CA 1246 DEC Dl ; DONE WITH SHORTS E650 75F5 1249 Jt~Z GJ ~ DO SOHE HORE E65F ElFE 1250 G5: LOOP GS ; LONG DELAY BEFORE RETURN E661 E2FE 1251 G6: LOOP G6 E663 IF 1252 'DP OS iRESTORE ORIG CONTENTS OF DS E664 90 12:53 POPF ;RESTORE FUGS TO ORIG SETTINGS £665 C3 1254 RET j RETURN TO CALLER 1255 ERR_BEEP EtIlP 1256 1257 ROUTINE TO SOUND BEEPER 1258 £666 1259 BEEP PROC NEAR E666 BOB6 1260 "OV AL.I0110110B ;SEL TIM 2. L5B,HSB,BlHARY £668 E643 1261 OUT T1I1ER+3.AL ;WRITE THE TIMER HODE REG £66A B83305 1262 "OV AX,S33H jDIVlSOR FOR 1000 HZ E66D £642 1263 OUT TIMER+2.AL JWI'UTE TIHER 2 CHT - LSB E66F eAe4 1264 t1~V .4.L.AH E671 E642 12:65 OUT TIMER+2.AL jWRITE TII'IER 2 tNT - "SB £673 E461 1266 IN AL.PORT_B ;GET CURRENT SETTING OF PORT £675 BAEO 12:67 "OV AH.AL ; SAVE TlIAT SETTINGH E677 OCOl 1266 OR AL.03 ; TURN SPEAKER ON £679 E661 1269 OUT PORT_BtAL E67B 2BC9 1270 SUB CX,CX jSET CNT TO WAIT 500 ns £670 E2FE 1271 G7: LQOP G7 ;OEUY BEFORE TURNING OFF E67F FECB 1272 DEC Bl ;DEUY CtlT EXPIRED? E681 7SFA 1273 JUZ .7 ;NO - CONTINUE BEEPING SPK E683 8AC4 1274 MDV ALlAH J RECOVER VALUE OF PORT A-18 lOC OBJ LINE SOURCE EMS E661 1Z75 OUT E687 c3 1276 RET iRETURN TO CALLER 1277 BEEP ENOP 1278 ; -------------------------------------------- 1279 THIS PROCEDURE WILL SEND A SOFTWARE RESET TO TlIE KEYBOARD. 1280 SCAN CODE AA' SHOULD BE RETURNED TO THE CPU. 1281 ,--- - ---------------------------------------- E688 1262 PROC NEAR E688 BoDe 1283 AL, DCH ;SET KBD eLK LINE LOW £68A E661 1284 OUT PORT_B,Al .WRITE 8255 PORT B £68t 895629 1285 NOV CX,10582 ;HOLD KBD CLK LOW FOR 20 MS E68F E2FE 1286 G8: LOOP G8 ; lOOP FOR 20 MS E691 Boce 1281 MOV AL.DCCH ,SET eLK. ENABLE LINES HIGH £693 E661 1288 OUT PORCB.AL E695 1289 SP_TEST: ; ENTRY FOR MANUFACTURING TEST 2 E695 B04C 12QO MOV AL.4CH ;SET KBD CLK HIBH. ENABLE lOW E697 E661 1291 OUT PORT_B,AL £699 BOFD 1292 MOV Al.OFDH ;ENABlE KEYBOARD INTERRUPTS E698 £621 1293 OUT INTAOl,Al ,WRITE 8259 urn E690 FB 1294 STI .ENABlE SYSTEH INTERRUPTS £69E 6400 1295 MOV AH.O ;RESET INTERRUPT ItIDICATOR £6AO 28C9 1296 SUB ex,cx ;SETUP INTERRUPT TIMEOUT CNT E6A2 F6C4FF 1297 G9: TEST AH. OFFH .010 A KEYBOARD INTR OCCUR? E6A5 7502 1298 "JtIZ GI0 ;YES - READ SCAN CODE RETIJRNED E647 ElF9 1299 LOOP 69 ; NO - LOOP TI II TIMEOUT E649 E460 1300 GI0: ;READ KEYBOARD SCAN CODE EbAS 8A08 1301 MOV BL.AL ;SAVE SCAN CODE JUST READ E6AD BOte 1302 MOV AL.DeCH ;CLEAR KEYBOARD E6AF E661 1303 OUT PORT_B,AL E681 C3 1304 RET ;RETURN TO CALLER 1305 KBD_RESET EHOP 1306 ; --- ------------------------ ------------- ---- 1301 BLINK LED PROCEDURE FOR MFG BURN-IN AND RUN-IN TESTS 1308 {LEO WILL BLINK APPROXIMATELY .Z5 SECOND) 1309 1-------- -- -- --- --- ---- - -- --- - -- -- - -- -- ------ £68l 1310 BLINK_INT PROC NEAR £682 FB 1311 STI E6B3 51 1312 ruSH CX ;SAVE CX REG CONTENTS E664 50 1313 PUSH AX ;SAVE AX REG CONTENTS E6B5 f461 1314 IN AL,PORT_B ;READ CURRENT VAL OF PORT B E687 24Bf 1315 A~m AL.OBFH £669 E661 1316 OUT !"OIH_B.AL ;BLIt« LEO E6BB 28[:9 1317 SUB cx.ex E6BD E2FE 1318 611: LOOP GIl E6BF OC40 1319 OR AL.40H ;STOP BLINKING LEO £6tl E661 1320 OUT PORT_B,AL £6C3 B020 1321 MOV AL.EOI £6e5 E620 1322- OUT INTAOO.AL £6t7 58 1323 POP AX JRESTORE AX REG £6C8 S9 1324 POP ex ;RESTORE CX REG £6e9 CF 1325 IRET 1326 BLINK_INT ENDP 1327 ; -------------------------------------------- 1328 THIS SUBROUTINE WILL PRINT A MESSAGE ON THE DISPLAY 1329 , 1330 ;ENTRY REQUIREMEtUS: 1331 51 = OFFSET(AODRESS) OF MESSAGE BUFfER 1332 CX = MESSAGE BYTE COutU 1333 MAXIMUM MESSAGE LENGTH IS 36 CHARACTERS 1334 ; ------------------ ----------------- --------- E6e.. 1335 P_M5G PROC NEAR EbeA 684000 1336 HOV AX.DATA ;POINT os TO DATA SEG E6eD 8£08 1331 MOV OS,AX E6CF 803£120001 1338 CMP MFG_TST.l ;MFG TEST MODE? E604 7505 1339 JNE GI2 ,NO - DISPLAY ERROR MSG E606 6601 1340 MOV OH,l ; YES - SETUP TO BEEP SPEAKER £608 E955Ff 1341 JMP ERR_BEEP ;YES - BEEP SPEAKER E60B 1342 GIZ: ; WRITE_M5G: £60B 2E8A04 13(.3 MOV Al.CS:[SIJ ; PUT CHAR IN AL E6DE 46 1344 INC 51 ; POINT TO NEXT CHAR E6DF 8701) 1345 MOV SH,O ;SET PAGE U TO ZERO E6E1 840£ 1346 MOV AH.14 ;J..'RITE CHAR (TTY-INTERFACE) E6E3 COlO 1347 un 10H ;CALL VIDEO_IO E6E5 E2F4 1348 LOOP G12 ;CONTINUE TILL MSG WRITTEN E6E7 B8000E 1349 HOV AX.CEODH ;POSITION CURSOR TO NEXT LINE EbEA COlO 1350 niT 10H ;SENO CARRIAGE RETURN AND A-19 LOC OBJ LINE SOURCE E6EC 880AO£ 1351 MOV AX,OEOAH ; LINE FEED CHARS E6EF COlO 1352: WT 10H E6F1 C3 1353 .ET 1354 P_I1SG ENOP 1355 ;--- tNT l'il ----------------------------- 1356 ;BOOT STRAP LOADER 1357 IF A 5 1/4" DISKETTE DRIVE IS AVAIlABLE 1358 ON THE SYSTEM, TRACK 0, SECTOR 1 IS READ INTO THE 1359 BOOT LOCATION (SEGl'lENT 0, OFFSET 7COO) 1360 AHIJ CONTROL IS TRAt~SFERRED THERE. 1361 1362 IF niERE IS NO DISKETTE DRIVE, OR IF THERE IS 1363 IS A HARDWARE ERROR CONTROL IS TRANSFERRED 1364 TO THE CASSETTE BASIC ENTRY POINT. 1365 1366 ; IPI. ASSUHPTIONS 1367 8255 PORT 60H BIT 0 1368 :: 1 IF IPL FRon DISKETTE 1369 J --- ---- - --- ---- --------- ---- - ----------- 1370 ASSUHE CS:CODE.DS:DATA £6F2 1371 BOOT_STRAP PROC NEAR 1372 E6F2 FB 1173 STI ; ENABLE INTERRUPTS E6F3 884000 1374 MOY AX ,DATA ; ESTABLISH ADDRESSING E6F6 8ED8 1375 NOV DS.AX £6f8 A,11000 1376 HOV AX. EQUIP_FUG ; GET THE EQUIPHENT SWITCHES EbFB .l801 1377 TEST AL.I ; ISOLATE IPL SENSE SWITCH UFO 7423 1378 JZ H3 ; GO TO CASSETTE BASIC ENTRY POINT 1379 1380 ; ------ HUST LOAD SYSTEH FRDf1 DISKETTE -- ex HAS RETRY COUNT 1381 E6FF 890400 1382 HDV ex,. ; SET RETRY COUNT E702 1383 HI: i IPL_SYSTEH £702 51 "84 PUSH ex j SAVE RETRY COUNT E703 8400 1385 MOV AH,D j RESET THE DISKETTE SYSTEH E705 COll 1386 INT 1," j DISKETTE_IO £701 7214 1387 Je H2 ; IF ERROR. TRY AGAIN £709 8402 1388 HOY AH.2 ; READ IN THE SINGLE SECTOR E10B B80000 1389 HOY BX,O ; TO THE BOOT LOCI. TlON E70E 8EC] 1390 MDV ES,BX E710 BBD07e 1391 MDV BX,QFFSET BOOT_LOCN E7l3 BAOOOO 1392 MOV OX.O i DRIVE O. HEAD 0 E716 890100 1393 MDV ex .. J SECTOR 1, TRACK 0 E719 BOOl 1394 MOV AL.1 • READ ONE SECTOR E71B CD13 1395 INT "H j DIS1(ETTE_IO E7ID 59 1396 H2: PDP ex ; RECOVER RETRY COUNT E71E 7301t 1397 JNe H. ; CF SET BY UNSUCCESSFUL READ H20 £2EO 1398 LOOP HI j DO IT FOR RETRY TIMES 1399 1400 .------ IJtlABLE TO IPL FRDtI THE DISKEnE 1401 £722 1402 H3: ; CASSETTE_JUMP: £722 COlS 1403 INT 18H ; USE INTERRUPT YECTOR TO GET TO BASIC 1404 1405 ;------ IPL WAS SUCCESSFUL 1406 £724- 1407 H4: £724 EAOO7CODOQ 1408 JMP 1409 1410 ; -----INT 14--------------------------------- 1411 ;R5232_10 1412 THIS ROUTINE PROYIDES BYTE STREAM I/O TO THE COI1MUNICATIDNS 1413 PORT ACCORDING TO TlfE PARAMETERS: 1414 {AH)=O INITIALIZE THE COMMUNICATIONS PORT 1415 tAll HAS PIlRMS FOR INITIAllZA.TION 1416 1417 1416 ----- BAUD RATE -- • -PARITY-- STOPBIT --WORD LENGTH-- 1419 1420 000 - 110 XO - NONE o- 1 10 - 7 BITS 1421 001 - 150 01 - 000 1 - 2 11 - 8 BITS 1422: 010 - 300 11 - EVEN 1423 011 - 600 1424 100 - 1200 1425 101 - 2400 1426 110 - 4800 1427 111 - 9600 A·20 LOC OBJ LINE SOURCE 1428 ON RETURN, CONlITIONS SET AS IN CALL TO CDI1HO STATUS fAH=3J 1429 fAltJ=l SEND THE CHARACTER IN (ALJ OVER THE COI'I1O LINE 1430 (AL) REGISTER IS PRESERVED 1431 ON EXIT. BIT 7 OF AH IS SET IF THE ROUTINE WAS UNABLE TO 1432 TO TRANSMIT 'THE BYTE OF DATA OVER THE LINE. THE 1433 REMAINDER OF AH IS SET AS IN A STAnJS REQUEST, 14'" REFELECTING THE CURRENT STATUS OF THE LINE. 1435 IAH)=2 RECEIVE A CHARACTER IN IAU FROH C0tl10 LINE BEFORE 14" RETlJRNING TO CALLER 1437 ON EXIT, AH HAS THE CURRENT LINE STATUS, AS SET BY THE 1438 TliE STATUS ROUTINE, EXCEPT THAT THE ONLY BITS 1439 LEFT ON ARE THE ERROR BITS 17,4,3,2,1) I ... IN THIS CASE. THE TIME OUT BIT INDICATES DATA SET 1"1 READY WAS NOT RECEIVED. 1442 THUS. AH IS NON ZERO ONLY WHEN AN ERROR OCCURRED. 14'+3 UHI=3 RETURN THE C0l1J10 PORT STATUS IN lAX) 1444 AH CONTAINS THE LINE CONTROL STATUS 1445 BIT 7 = TIME OUT 1446 BIT 6 :;: TRANS SHIFT REGISTER E"PTY 144. BIT 5 = "tRAN- MaUliNG REGISTER EMPTY 1448 BIT 4 = BREAK DETECT 1449 BIT 3 :;: FRAMING ERROR 1450 BIT 2 = PARITY ERROR 1451 BIT 1 = OVERRUN ERROR 1452 BIT 0 = DATA READY 1453 Al CONTAIt~S THE MODEt'! STATUS 1454 BIT 7 = RECEVED LINE SIGNAL DETECT 1455 BIT 6 = RING INDICATOR 1456 BIT 5 = DATA SET READY 1457 BIT 4 = CLEAR TO SEND 14sa BIT 1 :;: DELTA RECEIVE LINE SIGNAL DETECT 1459 BIT 2 = TRAILING EDGE RING DETECTOR 1460 BIT 1 = DELTA DATA SET READY 1461 BIT a ;; DELTA CLEAR TD SEN) 1462 1463 lOX) = PARAMETER INDICATING WHICH RS232 CARD (0,1 ALLOWED) 146. j DATA AREA RS232_BASE CONTAINS THE BASE ADDRESS OF THE 8250 ON THE CARD 1465 LOCATION 400H CONTAINS UP TO 4 RS232 ADDRESSES POSSIBLE 1466 iOUTPUT 1467 AX MODIFIED ACCORDING TO PARHS OF CALL 1468 ALL OTHERS UNCHANGED 1469 J --------------- --- - --- --- ---- ---- ----------- 1470 ASSUHE CS:CODE.DS:DATA E729 1471 AI LABEL WORD E729 1704 1472 OW 1047 ; 110 BAUD ; TABLE OF INIT VAWE E72B 0003 1473 OW 7•• 15. E720 8001 1474 ow 38. J 300 E72F COOO 1475 OW 19. ; 600 E731 6000 1476 OW 9. i 1200 E733 3000 1477 OW .8 i 2400 E735 1800 E737 oeoo 1478 1479 DW OW •• 12 i 4800 i ljI600 1480 E739 1481 RS232_IO PROC FAR 1482 1483 ; ------ VECTOR TO APFi?OPRIATE ROUTINe 1- E739 FB 1485 STI I INTERRUPTS BACK ON E734 IE I_ PUSH OS J SAVE SEGMENT E73B 52 1487 PUSH OX Ene 56 1488 PUSH 51 E73D 57 1489 PUSH 01 E7lE 51 1490 PUSH CX E73F 88F2 1491 MDY SI,DX J RS232 VALUE TO 51 £741 D1E6 1492 SHL 51.1 ; WORD OFFSET E743 814000 1493 I1DY DX.DATA E746 BEDA 1494 I1DY DS,DX i SET UP OUR SEGHENT E748 88940000 E74ft 0$02 E7itE 7416 E7S0 OAE4 E7S2 7418 1495 1496 1497 1498 1499 MDY DR JZ DR JZ .. DX,RS2:32_BASEISIl DX.DX AH.AH A. i GET BASE ADDRESS i TEST FOR 0 BASE ADDRESS ; REnJRN i TEST FOR (AH )=0 i CDtIt1UH INlT E754 FEee 1500 DEC AH i TEST FOR IAH 1=1 £756 74ftE 1501 JZ AS i SEND Al E758 FECC 1502 DEC AH ; TEST FOR (AHJ=2 E7SA 7503 1503 JHZ A. E75C E98900 1504 JMP AI2 ; RECEIVE INTO AI. A-21 LOC OBJ LINE SOURCE £75F 1505 A2: E7SF fEtt 1506 DEC AH I TEST FOR (AH)=3 E761 7503 1507 JHZ A3 £763 £98900 1508 JI1P Al8 , COMt1lJNICAUON STATUS £766 1509 A3: ; RETURN FROt1 RS232 E766 59 1!ilO pop ex E767 SF 1511 POP 01 E768 5£ 1512 pop SI E769 SA 1513 pop DX E76A IF 1514 POP OS E768 CF 1515 IRET ; RETURN TO CALLER. NO ACTION 1516 1517 j------ INITIALIZE THE COI1I1UNICATIONS PORT 1518 E76C 1519 A4: E?bC 8AEO 1520 ttOY AH.AL ; SAVE INIT PARMS IN AH £76£ 83C203 1521 ADD DX.3 ; POINT TO 8250 CONTROL REGISTER E771 B08D 1522 MaY Al,80H E77l EE 1523 OUT OX,Al ; SET DLAB=l 1524 1525 ;------ DETERHINE BAUD RATE DIVISOR 1526 E774 8,lD4 U27 HDY OL.AH ; GET PARMS TO OL E776 DOC2 1528 ROL Ol.l E776 ooe2 1529 ROL Ol.1 ; GET BAUD RATE TERM TO LOW BITS E77. DOCt 1530 ROL OL,I E77e DOC2 1531 ROL OL,I ; liZ FOR WORD TABLE ACCESS E77£ 81E20£00 1532 AIm OX.OEH ; ISOLATE THEM E782 8F29£7 1533 MOY OI.OFFSET Al ; BASE OF TABLE E?8S 03FA 1534 ADD OJ.DX ; PUT INTD INDEX REGISTER E787 88940000 1535 MaY DX,RSZ3Z_BASEESIJ ; POINT TO HIGH ORDER OF DIVISOR E788 42 1536 INC DX E78C ZE8A4S01 1537 MaY Al.CS:IOI]+1 ; GET HIGH ORDER OF DIVISOR E790 EE 1538 OUT OX.AL ; SET I1S OF DIV TO 0 [791 4A 1539 DEC DX E792 2£8A05 154. MOV AL.CS: 101 J j GET LOW ORDER OF DIVISOR E795 EE 1541 OUT OX.AL j SET LOW OF DIVISOR £796 8le203 1542 AOO OX.] E799 64C4 1543 MOV AL,AH ; GET PARHS BACK 1_ E79a 241F [79D EE 1545 '"" OUT ALtOIFH OX.At ; STRIP OFF THE BAUD BITS j LINE CONTROL TO 8 BITS E79£ 83EAOt 1546 SUB OX,2 E7Al 8000 1547 ttOV AL,O E7A3 EE 1548 OUT OX.AL I INTERRUPT ENABLES ALL OFF E7A4 E879 1549 JMP SHORT A18 j CotI_STATUS 1550 1551 J------ SEND CHARACTER IN (All OVER COl'I1O LINE 1552 E7. . 1553 E7A6 50 1554 PUSH AX I SAVE CHAR TO SEND E7A7 63C2G4 1555 ADD OX,4 j MODEn CONTROL REGISTER E7M 8003 1556 HOV AL,3 j. OTR AND RTS E7AC EE 1557 OUT OX.AL J DATA TERI1INAl READY. REQUEST TO SEND HAD 33C9 1558 XOR CX,CX ; INITIALIZE TIME OUT COUNT E7A' 83C202 1559 ADD OX.2 " HODEM STATUS REGISTER E782 1560 A6: I WAIT_DATA_SET_READY E7Bt EC 1561 IN AL,DX j GET nOOEn STATUS E7B3 .l820 1562 TEST AL.20H i DATA SET READY £185 7508 1563 JHZ A7 I TEST_CLEAR_ TO_SEND E7B? E2F9 1564 LOOP A6 j WAIT_DATA_SET_READY E7B9 58 1565 POP AX E7BA 80CC50 1566 OR AH,80 Ii INDICATE TIME OUT E78D EBA? 1567 JMP A3 ; RETURt~ U8F 1568 .7: ; TEST_ClEAR_ TO_SEND E7BF 28C9 1569 SUB CX.CX E7CI 1570 .1.8: ; WAIT_CLEAR_ TO_SEND E7Cl EC 1571 IN AL,DX Ii GET MODEn STATUS E7C2 A810 1572 TEST AL,10H ; TEST CLEAR TO SEND E7C4 7508 1573 JNl A9 E7U E2F9 1574 lOOP A8 ;. WAIT_ClEAR_TO_SEHD E7ea 58 1575 pop AX ; TIME OUT HAS OCCURRED E7C' 80tt80 1576 OR AH.80H E7CC E898 1577 JHP A3 j RETURN E7tE 1578 ...9: j ClEAR_TD_SENO E7CE 4A 157C) DEC DX LINE STATUS REGISTER E7CF 2BC9 1580 SUB CX.CX INITIALIZE WAIT COUNT E7DI 1581 AlO: WAIT_SEND A-22 lOC 08J LINE SOURCE f701 EC 1582 IN Al.DX ; GET STATUS E7D2 A820 1583 TEST AL.20H ; IS TRANSMITTER READY 004 1506 1584 JNZ All ; OUT_CHAR E7Ub E2f9 1565 LOOP AID t GO BACK FOR MORE. AND TEST FOR TIt1E OUT E708 sa 1586 POP AX ; RECOVER ORIGINAL INPUT E7D9 80eC80 1567 OR AH.80H ; SET THE TIHE OUT BIT E70C EBaa 1586 JHP Al I RETURN E70E 1589 All: ; OUT_CHAR E7DE 83EA05 1590 SUB ox,S ; DATA PORT E7El 59 1591 POP CX ; RECOVER IN ex TEHPORARIl Y E7E2 SACl 1592 MOil Al.CL ; GET OUT CHAR TO Al FOR OUT. STATUS IN AH E7E4 EE 1593 OUT DX,AL ; OUTPUT CHARACTER E7E5 E97EFf 1594 JHP Al ; RETURN 1595 1596 1------ RECEIVE CHARACTER FROM COMMO LINE 1597 E7E8 15~8 A12: f7E8 802671007F 1599 ANO BIOS_BREAK.07FH ~ TURH OFF BREAK BIT IN BYTE E7ED 83C204 1600 AOO OX.4 ; MODEM CONTROL REGISTER E7fO BOOI 1601 HOV Al.! ; DATA TERMINAL READY E7F2 EE 1602 OUT DX.AL E7F3 83C202 1603 AOO OX.2 ; MODEM STATUS REGISTER E7F6 28(9 1604 SUB cX.CX ; ESTABlISH TIME OUT cOUNT E7Fe 1605 All: ; WAIT_DSR E1FB EC 1606 IN Al,DX ; ~IOOEM STATUS E7F9 AB20 1607 TEST Al,20H j DATA SET READY E7FB 7507 1606 JNZ A1S i IS IT READY YET E7FO ElF9 1609 LOOP A13 ; WAIT UNTIL IT IS E7FF 1610 A14: ; TIME_OUT_ERR E7FF 6480 1611 HOV AH,80H ; SET TIME OUT ERROR E601 E962FF 1612 JMP A3 ; RETURN WITH ERROR E604 1613 A15: ; ~AIT_DSrCENO 1;::804 4A 1614 OEC OX ; LINE STATUS REGISTER' E805 1615 A16: ; WAIT_RECV f805 fC 1616 IN .Al.DX ; GET STATUS E806 A801 1617 TEST ALd ; RECEIVE BUFFER fUll E80S 7509 1616 JNZ A17 ; GET CHAR E80A F606710Q80 1619 TEST BIOS_BREAK ,80H ; TEST FOR BREAK KEY feoF 74F4 1620 JZ AI. i LOOP IF tlOT E611 E6EC 1621 JMP AI' i SET TINE OUT ERROR Eeu 1622 Al7: ; GET_CHAR feU 241E 1623 ANO Al.OOOllllOB ; TEST FOR ERROR CONDITIONS ON RECV CHAR E815 BAEO 1624 HOV AH.AL ; SAVE THIS PART OF STATUS FOli! LATER OPERATION E817 88940000 1625 HOV OX .RS232_BASE[SI J ; OATA PORT E81B EC 1626 III Al,OX ; GET CHARACTER FROM LINE E81C E947Ff 1627 JMP A3 ; RETURN 1628 1629 ;------ COMMO PORT STATUS ROUTINE 1630 EelF 1631 A16: ESIF 86940000 1632: HOV DX .RSZ32_BASEl 51 J E82:3 83C205 1633 AOD DX,S ; CONTROL PORT E8Z6 EC 1634 IN Al,DX GET lINE CmITROl STATUS E827 BAEO 1635 t'!OV AH,AL i PUT IN AH FOR RETURN E829 4Z 1636 INC OX ; POINT TO MODEM STATUS REGISTER E82A EC 1637 IN Al,DX ; GET 1100EM CONTROL STATUS EBZB E938FF 1638 JHP A3 ; RETURN 1639 R5232:_1O ENOP 1640 ; ---- INT 16 ------------------.. ------------- 1641 j KEYBOARD I/O 1642: THESE ROUTINES PROVIDE f?',-I.O,-I,' '.-1 E949 7C5A58435642:4£ 4D3C3E3FFFOOFF2DFF 1767 ;------ uc TABLE SCAN £959 1768 K12 LABEL BYTE E,959 5455565758595A 1769 DB 84~85,86,67,86.8?,90 E960 56SC5D 1770 08 91.92:.93 1771 ;------ ALT TABLE SCAN E963 1772 KB LABEl BYTE E963 68696A6B6C 1773 DB 104.105.106.107.108 E968 6D6E6F7071 1774 DB 109,110,1110112.113 1775 1776 ;------ NUM STATE TABLE E96D 1777 K14 lABEl BYTE E960 3736392D343536 1778 DB '789-456+1230.' 2:8313233302E 1779 ; ------ BASE CASE TABLE E'97A 1760 K15 LABEl BYTE E'97. 474849FF4BFF4D 1781 DB 71.72.73,-1.75,-1,77 E'961 FF4F50515Z53 1782 DB -1.79,80.81,82.83 1783 1764 ;------ KEYBOARD INTERRUPT ROUTINE 1785 E'967 1786 KB_INT PROt FAR E'967 FB 1787 ST! ; ALLOW FURTHER INTERRUPTS E966 50 1788 PUSH AX E989 53 1789 PUSH BX E96A 51 1790 PUSH ex E'968 52 1791 PUSH OX E98C 56 1792 PUSH 51 E980 57 1793 PUSH 01 E98E IE 1794 PUSH OS E'98F 06 1795 PUSH ES 'E990 FC 1796 ClD ; FORWARD DIRECTION E991 884000 1797 NOV AX , DATA A-25 LOC OBJ LINE SOURCE £994 8£D8 1798 MOV DS.AX ; SET UP ADDRESSING £996 E460 1799 IH AL.KB_DATA ; READ IN THE CHARACTER £998 50 1800 PUSH AX ; SAVE IT E9'9 £461 IIl0! IN AL,KB_CTl ; GET THE CONTROL PORT E99B 8.£0 1802 MOV AH.AL I SAVE VALUE E99D Dceo 1803 DR AL.80H ; RESET BIT FOR KEYBOARD £99f £661 1804 OIIT KB_CTL.AL E9Al 86EO 1805 XCHG AH,AL J GET BACK ORIGINAL CONTROL [9.3 £661 1806 OIIT KB_CTL.AL ; KB HAS BEEN RESET £9AS 58 1607 pop AX ; RECOVER SCAN COOE E9.6 BAED 1808 nov AH.AL J SAVE SCAN CODE IN AM ALSO 1809 uno J------ TEST FOR OVERRUN SCAN CODE FROf1 KEYBOARD 1811 E9A8 3eFF 1812 CMP AL,OFFH i IS THIS AN OVERRUN CHAR E9AA 7503 nAt £97502 1813 1814 JIll .JHP ".6 I NO. TEST FDR SHIFT 'KEY ; BUFFERJULL_BEEP "6Z 1815 1816 J------ TEST FOR SHIFT KEYS 1817 E9AF 1818 K16: E9AF 247f 1819 AND AL.07FH ; TURN OFF THE BREAK BIT E9Bl DE 1820 PUSH CS E9B2 07 POP ES E9B3 BF82E8 nov OX,OFFSET K6 E9B6 190800 MOV CX.K6L E9B. F2 REPHE SCASB E9BA AE nBS SAC4 1825 MOV AL,AH ; RECOVER SCAN CODE E9BD 7403 1826 JE "17 ; JUMP IF MATCH FOUND E'SF E'8S00 1827 JrtP K2' I IF NO MATCH, THEN SHIFT ~ FtUUJ 18Z8 1829 J------ SHIFT KEY FOUND 1830 E9C2 81£F83£8 1831 K17: SUB DI.OFFSET K6.. ; ADJUST PTR TO SCAN CODE HTeH E9C6 2E8AASSAE8 1832 MOV AH,CS:K7(O:[J J GET MASK INTO AN E9C8 A880 1833 TEST AL,80H J TEST FOR BREAK KEY nco 75S4 '834 JNZ K23 j BREAICSHIFTJOUND 1835 1836 J ------ SHIFT HAKE fOUND. DETERMINE SET OR TOGGl.E 1837 E9CF aOFelO 1838 C!1P E9DZ 7307 1639 JAE ; IF SCROLL SHIFT OR ABOVE. TOGGLE KEY 1840 1641 1------ PLAIN SHIFT KEY, SET SHIFT ON .- .842 E904 08261700 R .843 DR ; TURN ON SHIFT BIT E90S [98300 J"P K26 i INTERRUPT_RETURN .84. 1846 1------ TOGGLEO SHIFT KEY, TEST FOR 1ST HAKE OR NOT 1847 E. .B 1848 K18: ; SHIFT-TOGGLE E9DB F606170004 1849 TEST KB_FLAG, CTl..SHIFT ; CHECK CTl SHIFT STATE £9EO 7568 1850 JHZ "2' i JUt1P IF eTl STAn: E9Et 3C52 1851 CMP AL, INS_KEY i CHECK FOR INSERT KEY E9E4 7525 1852 JHZ "22 J JUt'lP IF NOT INSERT KEY £9E6 F606170008 R 1853 TEST KB_FLAG, ALT_SHIfT I CHECK FOR ALTERNATE SHIFT E'fB 7lt03 .854 JZ K •• i JUt1P IF NOT At TERNATE SHIFT nED £B5890 1855 JMP K •• I JUMP IF ALTERNATE SHIFT £9FO F606170020 R .856 K19: TEST KB_fUG, NUll_STATE J CHECK FOR BASE STATE £9F5 7500 1857 JHZ "21 ; JUMP IF NUtI LOCK IS ON E9F7 f606170003 .858 TEST KB_FUG. LEFT_SHIFT+ RIGHT_SHIFT E9FC 740D 1859 JZ K22 ; JUMP I f BASE STATE E'FE E9FE 881052 EA01 £90801 ... .860 1861 , 1863 K2D: MOV J"P AX, S2lOH 1<57 I NUI'IERIC ZERO, NOT INSERT KEY ; PUT OUT AN ASCII ZERO J BUFFER_FILL EA04 1864 K2l: ; HIGHT BE NUHERIC EA04 F606170003 R '86S TEST KB_FLAG. LEFT_SHUT+ RIGHT_SHIFT EA09 74F3 1866 JZ "20 I JIJIP NlI1ERIC I NOT INSERT 1867 EA08 1868 K2Z; ; SHIfT TOGGLE KEY HITI PROCESS IT EAGB 84261800 1869 TEST AH,K.8]lAG_l ; IS KEY ALREADY DEPRESSED EAOF 7540 1870 JHZ "26 ; JUt1P IF KEY ALREADY DEPRESSED EAll 08261800 R 1871 DR KB_fLAG_l.AH ; INDICATE TH4T THE KEY IS DEPRESSED EA15 30261700 R 1872 XOR KB_FLAG.AH i TOGGLE THE SHIFT STATE EAI9 ]CS2 1873 EE07 AC 2567 Laos NEC_STATUS j GET STl EEoe ODED 2568 SAL Al,I ; TEST fOR EaT FOUND EEDA 6404 2569 NOV AH .RECORD_NOTJND EEOC 7224 2570 Je JI' ; RWJAIl fEOE ODED 2571 SAL Al.l EElO ODED 257Z SAL AL.I ; TEST fOR CRC ERROR EE12 8410 2573 NOV AH ,BAD_CRe EE14 72IC 2574 Je JI' ; RW_FAIl EEI6 DOEll 2575 SAL ALol ; TEST FOR DMA OVERRUN EE18 8408 2576 MOV AH,BAD_OMA EEtA 7216 2577 JC JI' HlC ODED 2:578 SAL Al.l EEIE ODED 2579 SAL Al,l i TEST FOR RECORD NOT FOUND EE20 8404 2:580 NOV AH. RECORD _NOTJHO EEZ2- nOE 2561 JC JI' EE24 ODED 2:592 SAL Al.l H26 8403 2583 NOV AH ,IoIIHTE_PROTECT ; TEST FOR WRITE_PROTECT fE,8 7208 2:584 Je JI' ; RWJAIL EEZA ODED 2585 SAL AL.l ; TEST MISSING AOORESS HARK EE2C 8402 2:586 NOV AH .BAD_ADOR_MARK EEZE 7202 2587 Je JI. ; RW_FAIl 25M 2569 ;------ NEe MUST HAVE FAILED Z590 EBO 2591 JI8: EnD 8420 2592 NOV fE32 2593 J19: RW-FAIL EE32 08264100 2594 OR DISKETTE_STATUS ,AH EEl6 f87701 2595 CAll HOW MANY WERE REAllY TRANSFERRED EE39 2596 J20: ; RW_ERR EE39 C3 2597 RET ; RETURN TO CALLER 2596 EE3A 2599 J21 : RW_ERR_RES EElA f62EOI 2600 CALL RESULTS FLUSH THE RESULTS BUFFER EE3D C3 2601 RET 2602 2603 ----- OPERATION WA5 SUCCESSFUL 2604 EBE 2605 J22 : ; OPl-COK EE3f E56Fai 2606 CAU HUH_TRANS ; HOW MANY GOl MDVED EfCc 1 32E4 2607 XOR AH.AH ; NO F.RRORS EE43 C3 2608 RET 2609 RW_OPN EHOP 2:610 ; ---------- -------- ---------------------- ---- 21)11 ; NECOUTPUT 2612 THIS ROUTINE SENDS A BYTE TO THE NEC CONTROLLER 2613 AFTER TESTING FOR CORRECT DIRECTION AND CONTROllER READY 2614 THIS ROUTINE WILL TIME OUT I f THE BYTE IS NOT ACCEPTED 2615 HITHIN A REASONABLE AMOUNT OF TINE, SETTING THE DISKETTE STATUS 2616 ON COMPLETION 2617 INPUT 2618 (AHI BYTE TO BE OUTPUT 2619 ; OUTPUT 2620 CY = 0 SUCCESS 2621 CY :: 1 FAILURE -- DISKETTE STATUS UPDATED 2:62.2 I f A FAILURE HAS OCCURREO. THE RETURN IS MADE ONE lEVEL 2623 HIGHER THAN THE CALLER OF NEC_OUTPUT 2.624 THIS REMOVES THE REQUIREMENT OF TESTING AFTER EVERY CALL 2625 OF NEC_OUTPUT 2626 (AL I DESTROYED 2627 ; -------- ------------ --------------------- --- EE44 2628 NEC_OUTPUT PROC NEAR EE44 52 26Z9 PUSH OX ; SAVE REGISTERS EE45 51 2630 PUSH ex EE46 BAF403 2631 MOV DX,03F4H ; STATUS PORT EE49 33C9 XOR eX,ex ; COUNT FOR TIME OUT EE4B """ 2633 J23: EE4B EC 2634 III Al.DX ; GET STATUS EE4C A840 2635 TEST AL,040H ; TEST DIRECTION BIT EE4E 740C 2636 JZ J25 ; DIRECTION OK EE50 E2F9 2637 lOOP J23 EE52 2638 J24: ; TIME_ERROR A-36 lOC OBJ LINE SOURCE ££52 800£410080 2639 OR DISKETTE_STATUS. TIME_OUT EE57 59 2640 POP CX EE58 5.1. 2641 POP OX i SET ERROR CODE AND RESTORE REGS ££59 58 2642 POP Al( ; DISCARD THE RETURN ADDRESS EESA F9: 2643 STC i INDICATE ERROR TO CAllER EE58 Cl 2644 RET 2645 EESC 2646 J25: EESC 33C9 2647 XOR ex.ex ; RESET THE CO\.tJT EESE 2648 J26: EESE EC 2649 IN At.OX ; GET THE STATUS EESF .1.880 2650 TEST AL.OSDH ; IS IT READY £E61 75(14 2651 JNZ J27 5 YES. GO OUTPUT £E63 E2F9 2652 LOOP J2. ;; COUNT DOWN Aim TRY AGAIN £E65 EBEB 2653 JMP J2' ;. ERROR CONDITIOt~ £E67 2654 J27: ; OUTPUT EE6 7 8AC~ 2655 MOV AL,AH ;. GET BYTE TO OUTPUT fE69 BAFS03 2656 MOV DX,03F5H ;. DATA PORT EE6e EE 2657 OUT OX.AL ;. OUTPUT THE BYTE 'EE6D 59 2658 POP CX J RECOVER REGISTERS EE6E 5A 2659 POP OX EE6F Cl 2660 RET ; CY = 0 FROH TEST INSTRUCTION 2661 NEC_OUTPUT ENDP 2662 ; ------------------------------------------ 2663 ; GET_PARM 2664 THIS ROUTINE FETCHES THE ImEXED POINTER FROM 2665 j THE DISK_BASE BLOCK POINTED AT BY 11iE DATA 2666 ; VARIABLE DISK_POINTER 2667 i A. BYTE FROM THAT TABLE IS THEN MOVED INTO AH. 2668 ; THE INDEX OF THAT BYTE BEING THE PARH IN ex 2669 ENTRY -- 2670 ax = INDEX OF BYTE TO BE FETCHED * 2: 2671 IF THE LOW BIT OF ex IS ON, mE BYTE IS IMMEDJA TEL Y 2672 OUTPUT TO THE NEt CONTROLLER 2673 EXIT -- 2674 AH = THAT BYTE FROM BLOCK 2:675 ; - ------------ -- ------------ -- ----- ---- -- ---- EE70 2676 GET_PARM PROC NEAR EE70 1£ 2677 PUSH OS j SAVE SEGMENT E£71 2BCa 2678 SUB AX.AX i ZERO TO AX EE73 8E08 2:679 MOV DS.AX 2680 ASSUI1E DS:ABSO EE75 C5367800 26B1 LOS SI.DISK_POINTER ;. POINT TO BLOCK £E79 D1EB 2:682: SHR ex.! ; DIVIDE BX BY 2. AND SET FLAG FOR EXIT EE7B 8A20 2683 MOV AH.(SI+BXJ ; GET THE WORD EE7D 1F 2684 POP OS ; RESTORE SEGMENT 2685 ASSlR1E DS:DATA EE7E 72C4 2686 JC NEC_OUTPUT ; I f f UG SET t OUTPUT TO CONTROLLER EE80 t3 2687 RET j RETURN TO CALLER 2688 GET_PARH [NDP 2689 j -------------------------------------------- 2690 ;. SEEK 2691 THIS ROUTINE WILL MOVE THE HEAD ON THE NAMED DRIVE 2692 TO THE NAMED TRACK. IF THE DRIVE HAS NOT BEEN ACCESSED 2693 SINCE THE DRIVE RESET Cottr:'IAHD WAS ISSUED t THE DRIVE WILL BE 2694 RECALIBRATED. 2695 INPUT 2696 (DLJ :; DRIVE TO SEEK ON 2697 (eH) = TRACK TO SEEK TO 2698 ; OUTPUT Z699 CY = 0 SUCCESS 2700 CY = 1 FAILURE -- DISKETTE_STATUS SET ACCORDINGLY 2701 (AX) DESTROYED 2702 ; ------ -- ---- ------ ----- --------------------- EE81 2703 SEEK PROC NEAR EE81· B001 2704 MOV AL.1 j ESTABLISH MASK FOR RECAL TEST EE8351 2705 PUSH CX ;. SAVE INPUT VALUES EE84 8ACA 2706 MOY CL.Ol ; GET DRIVE VALUE INTO CL EE86 D2tO 2707 OOL AL,CL ; SHIFT IT BY THE DRIVE VALUE EE88 59 2708 PUP ex j RECOVER TRACK VALUE EE89 84063EOO 2709 TEST AL.SEEK_STATUS ; TEST FOR RECAL REQUIRED EEBD 7513 2710 JIlZ J2. ; NO_RECAL EE8F 08063[00 2711 OR SEEK_STATUS,AL j TlIRt~ ON THE NO RECAl BIT IN FLAG EE93 8407 2712 MOV AH.07H j REtALIBRATE COMMAND EE95 E8ACFf 2713 CALL NEC_OUTPUT EE98 BAEt 2714 MOV AH,DL EE9A E8A7FF 2715 CALL NEt_OUTPUT ; OUTPUT THE DRIVE NlmSER A-37 LOC OBJ LINE SOURCE EEW E87200 2716 CALL CHK_STAT_Z i GET THE INTERUPT AND SENSE tNT STATUS EEAO 7229 2717 JC J32 ; SEEK_ERP.OR 2718 2719 j----- DRIVE IS IN SYNCH WITH CONTROllER. SEEK TO TRACK 2720 EEA2 2721 J28: EEAZ B40F 2722 MOV AH,OFH i SEEK CotftfAtID TO NEe EEA4 E89DFF 2723 CALL tlEe_OUTPUT EEA7 &AEt 2724 I10V AH.DL ; DRIVE NUt1BER EEA9 E898FF 2725 CALL NEe_OUTPUT EEAC SAES 2726 HOV AH.CH ; TRACK NUl1BER EEAE E893FF 2:727 CALL NEe_OUTPUT EEBI [85£00 272S CALL CHK_STAT_2 I GET EI«JING INTERRUPT AND SENSE STATUS 2729 2730 ; ----- MAIT FOR HEAD SETTLE 2731 EEM 9C 2732 PUSHF i SAVE STATUS FLAGS fEe5 BIUzoO 2733 MOV eX,lo ; GET HEAD SETTLE PARAMETER [EBB E88SfF 2734 CALL GET_PARM EEBB 51 2735 PUSH CX o SAVE REGISTER EEBe 2736 J29: ; HEAD_SETTLE EEBe 892'602 2737 HOV cx.sso i 1 HS LOOP EEBF OAE4 2738 OR AH,AH ; TEST FOR TIHE EXPIRED EECI 7406 2739 JZ J31 EEC3 E2:FE 2740 J30: LOOP J3. ; DELAY FOR 1 tIS EECS FEce 2741 DEC AH ; DECREMENT THE COUNT EEC7 EBFl 2742 JHP J2. J DO IT SOME tfOR E EEC9 2743 J31: EEC9 59 2744 POP CX ; RECOVER STATE EECA 90 274S POPF EECB 2746 J32: ; SEEK_ERROR EEeB C3 2747 OET ; RETURN TO CAllER 2748 SEEK ENOP 2749 2750 ; -------------------------------------------- ; DHA_SETUP 2751 THIS ROUTINE SETS UP THE Df1A FOR READ/WRITEIVERIFY 2752 OPERATIONS. 2753 J INPUT 2754 (AU = f10DE BYTE fOR THE OI1A 2755 fES:BK) - ADDRESS TO READ/WRITE TIfE DATA 2756 , DlITPIIT 2757 (AX J DESTROYED 2758 ; ------------ ---------------- --------- -- ----- EECC 2759 DMA_SETUP PROC NEAR EECC 51 2760 PUSH CX j SAVE THE REGISTER EECD [60t 2761 OUT DMA+12,Al ; SET TIfE FIRST/LAST F/F EECF E60B 2762 OUT DMA+ll,Al ; OUTPUT THE MODE BYTE EEDI actO 2763 HOV AX.ES ; GET THE ES VALUE EED3 BI04- 2764 HOV CL,4 ; SHIFT COUtU EEDS D3eo 276S OOL AX,Cl ; ROTATE lEFT HD7 8AE8 2766 MOV CH,Al ; GET HIGHEST NYBLE OF ES TO CH fED9 24FO 2767 ANO AL.OFOH ; ZERO THE lOW HYeelE FROI'I SEGMENT HOB 03C3 2768 ADD Ax.ex i TEST FOR CARRY FROH ADDITION EEDD 7302 2769 JHe J33 EEDF FECS 277D INC CH , CARRY MEANS HIGH 4 BITS HUST BE INC EEEI 2771 J33: EEEl 50 2772 PUSH AX I SAVE START ADDRESS EEEZ E604 2773 OUT OMA+4,Al , OUTPUT lOW ADDRESS EEEif 8AC4 2.774 MOV AL.AH EEE6 E604 2775 OUT DMA+4,Al , OUTPUT HIGH ADDRESS EEEB BACS 2776 MOV AL.eH ; GET HIGH 4 BITS EEEA 240F 2777 A'l!) AL,OFH EEEe E681 2778 OUT 081H,AL ; OUTPUT THE HIGH 4 BITS TO PAGE REGISTER 2779 2780 ;------ DETERMINE COUNT 2781 EEEE SAE6- EEFO 2ACO 2782 2783 MOV SUB AH.DH Al,Al , ; NUMBER OF SECTORS TIMES 2:56 INTO AX EEF2 01E8 2784 SH. AX.I ; SECTORS * 128 INTO AX EEF4 50 2785 PUSH AX EEF5 880600 2766 MOV BX,6 ; GET THE BYTES/SECTOR rARM EEF8 E875FF 2787 CALL GET_PARt1 EEFB SAce 2788 NOV el,AH ; USE AS SHIFT COUNT (0=128. 1=256 ETC) EEFD 58 2789 POP AX EEFE 03EO 2790 SHL AX,CL l f1ULTIPl Y BY CORRECT AI10UNT EFOO 48 2791 OEC AX i -I FOR DMA VALUE EFOI 50 2792 PUSH AX I SAVE COUNT YALUE A-38 LDC 08J LINE SOURCE EF02 E605 2793 OUT DHA+S.AL ; LOW BYTE Of COUNT EF04- SACft 2794 /UlV AL.AH EF06 E605 2795 OUT DHA+S.AL ; HIGH BYTE OF COUNT EF06 S9 2796 POP ex j RECOVER COUNT VALUE EF09 58 2797 POP AX i RECOVfR ADDRESS VAlUE EFOA 03el 2798 ADD AX.CX j ADD .. TEST fOR 64K OVERfLOW EFoe 59 2799 pop CX ~ RECOVER REGISTER EfOO B002 2600 HOV Al,Z ; HODE fOR 8217 EFOF £60A Z601 OUT DMA+I0,AL ; ItUTIALIZE THE DISKETTE CHANNEL EFU C3 2802 RET ; RETURN TO ULLER. efL SET BY ABOVE IF ERROR 2803 OHA_SETUP ENDP 2604 ; ----. -- -- ----- --- - ---- ----,..--------- -------- 2805 ; CHK_STAT_2 28126 THIS ROUTINE HANDLES THE INTERRUPT RECEIVED AfTER 2807 A RECALIBRATE, SEEK, OR RESET TO THE ADAPTER. 2808 THE INTERRUPT IS WAITED FOR. THE INTERRUPT STATUS SENSED. 28P9 AUD THE RfSUL T RETURNED iO THE CALLER. Z610 ; INPUT 2811 • HONE 2812 I OUTPUT 2813 CV = 0 SUCCESS 2814 CY = 1 fAILURE -- ERROR IS IN DISKETTE_STA.TUS 2815 (AX l DESTROYED 2816 ; -- - - --- -- ----- ----- - -- -- ------- ----- -------- EF12 CHK_STAT_2 EF12 ESIEGO CALL ; WAIT fOR THE INTERRUPT [FIS 7214- JC J34 ; If ERROR. RETURN IT £FI78408 /UlV ; SENSE INTERRUPT STATUS CQHHAt-I) EF19 E828FF CAU EFIC E84COD CALL RESULTS ; READ IN THE RESULTS EFtF 72:0,1, JC J34 ; CHK2_RETURN EF21 ,1,04200 HOV j GET THE FIRST STATUS BYTE EFZ4 2460 AND Al.060H ; ISOLATE THE BITS EF26 3C60 CHP AL.060H ; TEST FOR CORRECT VALUE EF28 7402 JZ J35 ; I f ERROR. GO MARK IT EFtA f8 Cle ; GOOD RETURN EF2B J34: EFtB C3 RET i RETURN TO CALLER EFtC J35: ; CHK2_ERROR EF2C 600£410040 OR DISKETTE_STATUS,BAD_SEEK EFn F9 STC ; ERROR RETURN CODE En2 C3 RET CHK_STAT_2 283~ ; - - - - -- - - -- -- ----- - - -- - - - --- - --- ----- -- ------ 2'637 ; WAIT_IHT 2838 THIS ROUTINE WAITS FOR AN INTERRUPT TO OCCUR 2839 A TIME OUT ROUTINE TAKES PLACE DUiHUG THE WAIT, 50 2a40 TliAT AN ERROR HAY BE RETURtlED I f THE DRIVE IS NOT READY 2841 ; INPUT 2642 NONE 2843 ; OUTPUT 2844 CY = 0 SUCCESS 2845 CV ;: 1 FAILURE -~ DISKETTE_STATUS IS SET ACCORDINGLY 2646 (AX J DESTROYED 2847 J -~ ---- --~ -~- ~-- ~ --- ----- --- ---- ----- -- ------ Ef3] 2:8't8 WAIT_INT PRot NEAR £F33 F8 284' SrI ; TURN ON INTERRUPTS. JUST IN CASE EF34 53 2. . . PUSH 8X £F35 51 2651 PUSH ex i SAVI: REGISTERS £'36 B302 2852 HOV al..2 ; ClJ;AR THE COUNTERS Ef38 33C9 2853 XOR CX,CX ; FOR 2 SECOND WAIT EnA 2854 J36: EF3A F6063£0080 2855 TEST SEEK_STATUS,INTJLA& I TEST FOR INTERRUPT DCCURRING EF3F 750C 2856 JHZ J37 EF41 E2F7 2857 lOOP J36 ; COUNT DOWN WHll.E WAITING Ef43 fECB 2658 DEC BL ; SECOND LEVEL COUNTER £F45 75F3 2:659 JHZ J3. EF47 800E410080 2$60 OR DISKEnE_SlATUS. TIHE_OUT i NOTHING HAPPENED EF4C F9 2861 src ERROR RETURN EF4D 2862 J37: EF4D 9C 2663 PUSHF i SAVE CURRI:NT CARRY Ef4E 802631;007F 2864 AND SEEK_SlATUS.NOT INTJLAG ; TURN OFf INTERRUPT flAG EFS] 9D 2865 POPF j RECOVER CARRY EF54 59 2866 POP CX EF55 58 2867 POP 8X ; RECOV£!;! REGISTERS EfS6 C3 2868 RET j GOOD RETURN CODE COHES FROH TEST INST 2869 WAIT_INT ENDP A-39 LOC OBJ LINE SOURCE 2870 ; - --- - -- - ----- --- -- ----------------- --------- 2871 • DISK_INT 2872 THIS ROUTINE HANDLES THE OISKETTE INTERRUPT 2873 ; INPUT 2874 NONE 2875 ; OUTPUT 2876 THE INTERRUPT FLAG IS SET IS SEEK_STATUS 2877 ; ------------------- - - - - ---- ------- - ----- ---- US7 2878 PROC FAR EFS7 FB 2879 sn ; RE ENABLE INTERRUPTS EF58 IE 2880 PUSH os Ef59 50 2881 PUSH AX EFSA 884000 2:882 MOV AX,DATA EF50 BEDS 2883 MOV DS,AX EFSF 800EJE0080 2:884 OR SEEK_STATUS.INT_FLAG EF64 B020 2885 MOV AL.20H END OF INTERRUPT MARKER EF66 E620 2886 OUT 20H.AL INTERRUPT CONTROL PORT Hb8 58 2:887 POP AX EFb9 IF 2888 PCP OS RECOVER SYSTEM EF6A Cf 2889 IRET RETURN FROM INTERRUPT 2890 HIDP 2891 ; --------- ---- --- -- ------ - --- ---------------- 289Z ; RESULTS 2:893 THIS ROUTlr~E WILL READ ANYTHING THAT THE NEC CONTROLLER 2:894 HAS TO SAY FOLLOWING AN INTERRUPT. 2895 INPUT 2696 ~lONE 2897 ; OUTPUT 2:898 CY :: 0 SUCCESSFUL TRA~lSFER 2899 CY :: 1 fAILURE -- TIME OUT IN WAITING FOR STATUS 2900 NEC_STATUS AREA HAS STATUS BYTE LOADED INTO IT 2901 (AH) DESTROYED 2902 ; ---- - ---- --- --- - -- ------ - ----- --------- ----- £F6B 2903 RESULTS PRoe NEAR EF6B Fe 2904 CLD EF6e BF42DO 2905 MDV OI.OFFSET NEC_STATUS ; POINTER TO DATA AREA EF6f 51 2906 PUSH CX ; SAVE COUNTER EF70 52 2:907 PUSH OX EF71 53 2:908 PUSH ex Ef7:?: 8307 2909 MOV SL.7 ; MAX STATUS BYTES 2910 2:911 ;------ WAIT FOR REQUEST FOR MASTER 291Z EF74 2913 J38: ; INPUT_LOOP EF74 33C9 2914 XOR cx.ex ; COUNTER EF76 BAF403 2915 MOV OX.03F4H ; STATUS PORT EF79 2916 J39: ; WAIT FOR MASTER EF79 EC 2917 'N AL.OX ; GET STATUS EF7A ABBD 2:918 TEST Al.080H ; MASTER READY EF7C 7S0C 2919 )NZ J40A i TEST_DIR EF7E E2F9 2920 LOOP J39 ; WAIT_MASTER HaD 800E410060 2921 OR DISKETTE_STATUS, TIME_OUT EFes 2:92Z J40: ; RESULTS_ERROR HBS F9 2923 STC ; SET ERROR RETURN EFa6 58 2924 POP BX EFS? SA 2925 POP OX EFBB 59 2926 POP ex EFa9 C3 2927 RET 2928 2:929 j------ TEST THE DIRECTION BIT 2930 EFaA EC 2931 J40A: It, AL.DX ; GET STATUS REG AGAIN HBB A640 2932 TEST Al,040H ; TEST DIRECTION BIT fFaO 7507 2933 )NZ )42 ; OK TO READ STATUS EF8F 2934 J41: ; NECJAIL EF8f 800E410020 2935 DR DISKETTE_STATUS. BAO_NEC EF94 EBEf 2936 )MP J40 ; P.ESULTS_ERROR 2937 2938 ;------ READ IN THE STATUS 2939 EF96 2940 J4Z: ; INPUT_STAT EF96 42 2941 'NC OX ; POINT AT DATA PORT EF97 EC 2942 'N AL.DX ; GET TliE DATA EF98 8805 2943 MDV [oIl.AL STORE THE BYTE EF9A 47 2944 INC 0' INCREMENT THE POINTER EF9B B90AOO 2945 MOV ex.to LOOP TO KILL TIME FOR NEC A-40 lOC OBJ LINE SOURCE EF9E E2fE 2946 J43: lOOP J43 EFAO 4A 2947 DEC OX ; POilil AT STATUS PORT EFAl EC 2948 IN AL,DX ; GET STATUS EFAZ ABlO 2949 TEST At,OIOH ; TEST FOR NEe STILL BUSY EFA4 7406 2950 Jl J44 ; RESUl15 DmlE EFA6 FEes 2951 DEC BL ; DECREMENT THE STATUS COUNTER EFA8 75CA 2952 JNl J3. ; GO BACK FOR HORE EFAA EBE3 2953 JHP J41 ; CHIP HAS FAILED 2954 2955 ;------ RESULT OPERATION IS DONE 2956 EFAC 2957 J44: HAC sa 2958 POP BX EfAD 5A 2959 POP ox EFAE 59 2960 POP ex ; RECOVER REGISTERS EFAF C3 2961 RET ; GOOD RETUFm CODE FROM TEST INST 2962 ; ------------------ - --------------- -- ---- ---- 2963 ; NUM_ TRANS 2964 THIS ROUTINE CALCULATES THE NUMBER OF SECTORS THAT 2965 WERE ACTUALLY TRANSFERRED TO/FROM THE DISKETTE 2966 INPUT ,96 7 (CH) = cnIHOER OF OPERATION ,968 (eL) = START SECTOR OF OPERATION ,969 ; OUTPUT 2:970 (AL ) = NUMBER ~CTUALLY TRAt~SFERRED 2971 I~O OTHER REGISTERS MODIFIED 2972 j --------------- ----- ----------------- ------- EFBO 2973 HUH_TRANS PROC NEAR EFBO A04500 ,974 HOV AL .NEC_STATUS+ 3 ; GET CYLINDER HIDED UP ON EFB3 3ACS 2975 CHP AL.CiI SAME AS WE STARTED EFB5 A04700 2:976 HOV AL.UEC_STATUS+5 GET ENDING SECTOR HBB 740A ,977 JZ J45 IF ON SAME cn. THEN NO ADJUST EFBA 8B0800 2:978 HOV BX.8 EFBD f8BOFE 2979 CALL GET_PARM ; GET EDT VALUE EFCO 8A(4 2980 HOV AL.AH ; nHO AL EFez FEeD 2:931 INC AL i USE EOT+l FOR CALCULATION EFC4 2:ACl 2982 J45: SUB AL.CL ; SUBTRACT START FROM END EFe6 C3 2983 RET 2984 NUM_TRANS ENOP ,985 RESULTS ENOP 2986 2987 ; --------------- ----------------------------- 2988 DISK_BASE 2:989 THIS IS THE SET OF PARAMETERS REQUIRED FOR 2990 DISKETTE OPERATION. THEY ARE POIUTED AT BY THE 2991 DATA VARIABLE DISK_POINTER. TO MODIFY THE PARAMETERS. 2:992 BUILD ANOTHER PARAMETER BLOCK AND POINT AT IT 2993 i --- ---- ------------------ -- ----- ---- -- ------ 2994 EFe7 2:995 LABEL BYTE EFe7 CF ,996 110011116 ; SRT=C. HO UNlOAO=OF - 1ST SPECIFY BYTE EFee 02: ,997 DB Z ; HD lOAO=l. HODE=DMA - 2ND SPECIFY BYTE EFC9 25 ,998 DB MOTOR_WAIT ; WAIT AFTER OPN TIL MOTOR OFF EFeA 02 2:999 DB 512 BYTES/SECTOR EFeB 08 3000 DB EDT ( lAST SECTOR ON TRACK) EFCC ZA 3001 DB 02:AH GAP lENGTH EFCD FF 3002 DB OFfH OIL EFeE 50 3003 DB OSOH GAP lENGTH FOR FORHAT EFCF F6 3004 DB OF6H i FIll BYTE FOR FORMAT EFDO 19 3005 DB Z5 ; HEAD SETTLE TIME (MILLISECONDS) EFDl 04 3006, DB 4 ; MOTOR START TIME (118 SECONDS) A-41 LOC OBJ LINE SOURCE 3007 ; --- INT 17 --------------------------------- 3008 ; PRItHER_IO 3009 THIS ROUTINE PROVIDES COMMUNICATION WITH THE PRINTER 3010 (AH)=O PRINT THE CHARACTER IN IALI 3011 ON RETURN, AH=l IF CHARACTER COULD NOT BE PRINTED (TIME OUT) 301Z OTHER BITS SET AS ON NORMAL STATUS CAll 3013 (AH)::l INITIAllZE THE PRImER PORT 3014 RETURNS WITH (AH) SET WITH PRINTER STATUS i '- 1,::':~~:D 3015 'AHI=2 READ THE PRINTER STATUS INTO IAHI 301& 7 · 3017 TIME OUT 3018 3019 51 = 3020 _ 1 :: SElECTED 3021 1 :: OUT OF PAPER 3022 1 = ACKNOWLEDGE 3023 1 = BUSY 3024 302:5 (OX) = PRINTER TO BE USED 10,1,21 CORRESPONDING TO ACTUAL VALUES 3026 IN PRINTER_BASE AREA 302:7 ; DATA AREA PRINTER_BASE COUTAIUS TUE BASE ADDRESS OF lliE PRINTER CAROlS) 3<126 AVAILABLE 1 LOCATED AT BEGIHHIUG OF OATA SEGMENT. 408H ABSOLUTE, 3 NORDS) 3029 ;REGISTERS AH IS MODIFIED 3030 ALL OTHERS UNCHANGED 3031 3032- ASSUME CS:CODE,DS;DATA EFD2 3033 PRINTE.R._l0 PRoe FAR EFOZ FB 3034 SH INTERRUPTS BACK ON EF03 IE 3035 PUSH OS SAVE SEGMENT fF04 52 3036 PUSH OX EFOS 56 3037 PUSH 51 EF06 51 3036 PUSH CX EFD7 53 3039 PUSH BX EFDB 8£4000 3040 MOV SI.DATA EFOB aEDE 3041 MOV OS,SI ESTABLISH PRINTER SEGMENT EFDD SBF2 3042 MOV SI,DX GET Pr:lINTER PARM EFOF DlE6 3043 SHL 51.1 WORD OFFSET INTO TABLE EFEI 86940800 3044 MOV OX. PRINTER_BASE( 51] ; GET BASE ADDRESS FOR PRINTER CARD EFES OB02- 3045 O' DX,DX ; TEST OX FOR ZERO. INDICATING NO PRINTER EFE7 740C 3046 JZ Bl ; RETURN EFE9 OAE4 EFEB 740E 3047 3048 OR JZ ., AH.AH TEST FOR I AH l"'O PRItlT_AL fFED FEee 3049 DEC AH TEST FOR fAH)"'l EFEF 7442 3050 JZ Be INIT_PRT EFFI FEee 3051 DEC AH TEST FOR IAH)=2 ErF3 742A 3052 JZ B5 PRINTER STATUS EFFS 3053 Bl: ; RETURN EFFS 58 3054 POP BX EFF6 59 3055 POP CX Ern 5f 3056 POP 51 RECOVER REGISTERS ErF8 SA 3057 POP OX RECOVER REGISTERS EFF9 If 3056 POP OS EFFA CF 3059 IRET 3060 3061 ; ------ PRINT THE CHARACTER IN {Al) 3062 EFrs 3003 82: EFfS 50 3064 PUSH AX j SAVE VALUE TO PRINT EFFC B30A 3065 MOV BL.IO i TIME OUT VALUE EHE 33C9 3066 XO. CX.CX ; ESTABLISH SHIFT COUNT FOOD EE 3067 OUT OX.At ; OUTPUT CHAR TO PORT FOOl 42- 3066 mc OX I POINT TO STATUS PORT F002 3069 83: ; WAIT_BUSY F002 EC 3070 IN AL,OX ; GET STATUS F003 SAED 3071 tiOV AH,AL ; STATUS TO AH ALSO F005 A88a 307.2 TEST AL.80H ; IS iKE PRItlTER CURRENTLY BUSY F007 750£ 3073 JNl B' j OUT_STROBE F009 EZF7 3074 LOOP BJ j OECRENENT COUNT ON TIME OUT F008 FEee 3075 DEC BL FOOD 7SFl 3076 JNZ BJ ; WAIT FOR NOT BUSY FOOF 60ec01 3077 O. AH.l ; SET ERROR flAG F012 80E4F9 3078 AH,OF9H ; TURN OFF THE OTHER BITS F015 EB14 3079 "" JMP SHORT 87 ; RETURN WITH ERROR FLAG SET F017 3080 84: OUT_STROBE F017 BOOD 3081 MOV Al,OOH SET THE STROBE HIGH FOl9 42 308Z II:C OX STR08E IS BIT 0 OF PORT C OF B255 A-42 LOC OBJ LINE SOURCE FOIA EE 3083 OUT OX,AL FDIB BODC 3... MOV Al~OCH ; SET THE STROBE lON fOlD EE 3085 OUT OX.AL FOlE 58 3086 POP AX ; RECOVER THE OUTPUT CHAR 3087 3088 1------ PRINTER STATUS 3089 FOIF 3090 B5: FOIF 50 3091 PUSH AX ; SAVE At REG F020 3092 86: F02D 88940800 3093 MOV DX, PRINTER_BASE (51 J F024 42 3094 IIIC OX f025 EC 3095 IN AL,DX j GET PRINTER STATUS F026 BAEO 3096 MOV AH,Al F028 80E4F8 3097 AND AH,OFSH ; TURN OFF UNUSED BITS F028 3098 87: j STATUS_SET f028 SA 3099 POP DX ; RECOVER AL REG Foze 8AC:?: 3100 HOV AL.Dl ; GET CHARACTER INTO At F02E 80F448 3101 XO. AH,46H FLIP A COUPLE OF BITS F031 E8C2. 3102 JMP 81 ; RETURN FROM ROUTINE 3103 3104 ;------ INITIALIZE THE PRINTER PORT 3105 F033 3106 88: F033 50 3107 PUSH AX ; SAVE At F034 83C202 3108 ADD DX,2 i POINT TO OUTPUT PORT f037 B008 3109 MOV AL.a j SET INIT LINE LOW F039 EE 3110 OUT DX.At F03A B8E803 3111 MOV AX,1000 F03D 311Z 89: ; INIT_LOOP F03D 48 3113 DEC AX ; LOOP FOR RESET TO TAKE F03E 75FD 3114 JNZ B' ; INIT_LOOP F040 BoDe 3115 MOV AL.OCH ; NO INTERRUPTS, NON AUTO IF. INIT HIGH F042 EE 3116 OUT DX,Al F043 EBDB 3117 JMP 80 S PRT_STATUS_1 3118 PRINTER_IO ENDP 3119 ;--- IHT 10 --------------------------------- 312:0 ; VIDEO_IO 3121 THESE ROUTINES PROVIDE THE CRT INTERFACE 312:2: THE FOllOWltlG FUNCTIONS ARE PROVIDED: 3123 (AH)=O SET HOOE tAU CONTAINS HODE VALUE 3124 tAlJ=O 40X2S BW (POWER ON DEFAULTJ 3125 I AL )=1 40X2:S COLOR 3126 (AU=2 80X2S BW 3127 tAU=] 80X2:5 COLOR 312:8 GRAPHICS HODES 3129 tAU=4 320X200 COLOR 3130 IAU=5 320X2:00 BW 3131 IALJ=6 640X200 BW 3132 CRT MODE = 7 BOX2S B&W CARD (USED INTERNAL TO VIDEO ONLY) 3133 *** NOTE BW MODES OPERATE SAME AS COLOR MODES, aUT COLOR 3134 BURST IS NOT ENASLED 3135 IAH):::l SET CURSOR TYPE 313050 leH) ~ BITS 4-0 ~ START LINE FOR CURSOR 3137 ** HARDWARE WIll ALWAYS CAUSE BLINK 3138 *'If SETTING BIT 5 OR 6 WILL CAUSE ERRATIC BLINKING 3139 OR NO CURSOR AT ALL 3140 ICll = BITS 4-0 = END LINE FOR CURSOR 3141 IAH)=2 SET CURSOR POSITION 3142 IDH.DL) = ROW.COLUMN' 10,0) IS UPPER LEFT 314J 100) = PAGE NU:19ER (MUST BE 0 FOR GRAPHICS MODES) 3144 (AH)~3 REAO CURSOR POSITION 3145 (BH) = PAGE HLlMBER (MUST BE 0 FOR GRAPHICS HOOES) 3146 ON EXIT (DR.Dl) =-'~OW,COLUMN OF CURRENT CURSOR 3147 (CH,CLJ :: CURSOR MODE CURRENTLY SET 3148 fAHl=4 READ LIGHT PEN POSITION 3149 ON EXIT: 3150 (AH) = 0 -- LIGHT PEN SWITCH NOT DDWNINOT TRIGGERED 3151 (AH) = 1 -- VALID LIGHT PEN VALUE IN REGISTERS 3152 (DH,DLJ = ROW,COLUMN OF CHARACTER LP POSH 3153 (CH) = RASTER LINE (0-199) 3154 (ex) = PIXEL COLUMN (0-319,639) 3155 (AH)=5 SELECT ACTIVE DISPLAY PAGE (VAllO ONLY FOR ALPHA troDES) 3156 (AU=NEW PAGE VALUE (0-7 FOR HODES 0&1, 0-3 FOR HOOES 2&3) A-43 LOC OBJ LINE SOURCE 3157 fAH)~6 SCROLL ACTIVE PAGE UP 3158 fAU = HUI1BER OF LINES. INPUT LINES BlANKED AT BOTTOH OF WINDOW 3159 At = 0 MEANS BLANK ENTIRE WINDOW 3160 (CH.tl) = ROW.COLUMN Of UPPER LEFT CORNER OF SCROLL 3161 (OH.Dl) = ROW.COLUMN' OF LOWER RIGHT CORNER OF SCROLL 3162 (BH) = ATTRIBUTE TO BE USED ON BLANK LINE 3163 (AH)=7 SCROLL ACTIVE PAGE DOWN 3164 (AU = HUMBER OF LINES. INPUT LINES BLANKED AT TOP Of WINDOW 3165 At = 0 MEANS BLANK ENTIRE WINDOW 3166 (CH,CLJ = ROW,COLUMN OF UPPER LEFT CORNER OF SCROLL 3167 (OH.DU - ROW.COLUMN OF LOWER RIGHT CORNER OF SCROLL 3168 fBHI = ATTRIBUTE TO BE USED ON BLANK LINE 3169 3170 CHARACTER HAND LING ROUTINES 3171 3172: (AH) = 8 READ ATTRIBUTE/CHARACTER AT CURRENT CURSOR POSITION 3173 (8H) ;;; DISPLAY PAGE (VALID FOR ALPHA MODES ONLY) 3174 ON EXIT: 3175 (AL) = CHAR READ 3176 (AH) ;;; ATTRIBUTE OF CHARACTER READ (ALPHA MODES ONLY) 3177 UH) = 9 WRITE ATTRIBUTEICHARACTER AT CURRENT CURSOR POSITION 3178 (BH) = DISPLAY PAGE (VALID FOR ALPHA HODES ONLY) 3179 (CX) = COUNT OF CHARACTERS TO WRITE 3180 (AL) = CHAR TO WRITE 3181 IBU = ATTRIBUTE OF CHARACTER (ALPHAJ/COLOR OF CHAR (GRAPHICS) 3182 SEE NOTE ON WRITE DOT FOR 8IT 7 OF BL 1.= 3183 UH) = 10 WRITE CHARACTER ONLY AT CURRENT CURSOR POSITION 3164 (BHI ;;; DISPLAY PAGE (VALID fOR ALPHA MODES ONLY) 3185 (CX) = COUNT Of CHARACTERS TO WRITE 3166 (AU = CHAR TO WRITE 3187 FOR REAOIWRITE CHARACTER INTERFACE WHILE IN GRAPHICS HOOE. THE 3188 CHARACTERS ARE FORMED FROM A CHARACTER GENERATOR IMAGE 3189 MAINTAINED IN THE SYSTEM ROM. ONLY THE 1ST 128 CHARS 3190 ARE CONTAINED THERE. TO READIWRITE THE SECOND 128 CHARS, 3191 THE USER MUST INITIALIZE THE POINTER AT ItITERRUPT 1FH 3192 (lOCATION 0007CH) TO POINT TO tHE lK BYTE TABLE CONTAINING 3193 THE COOE POINTS fDA THE SECOND 128 CHARS (128-255L 3194 FOR WRITE CHARACTER INTERFACE IN GRAPHICS MODE. THE REPLICATION FACTOR 3195 CONTAINED IN ICXI ON ENTRY WILL PRODUCE VALID RESULTS ONLY 3196 FOR CHARACTERS CONTAINED ON THE SAME ROW. CONTINUATION TO 3197 SUCCEEDItlG LINES WILL NOT PRODUCE CORRECTLY. 3198 3199 GRAPHICS INTERFACE 32:00 IAHI = 11 SET COLOR PALETTE 3Z01 (BHI = PALLETTE COLOR ID BEING SET (0-127) 3202 (BL I ;;; COLOR VALUE TO BE USED WITH THAT COLOR IU 3203 NOTE: FOR THE CURRENT COLOJ:l CARD. THIS ENTRY POINT HAS 32:04 HEANING ONLY fOR 320X200 GRAPHICS. 3205 COLOR ID = 0 SELECTS THE BACKGROUHD COLOR (0-15) 3206 COLOR ID = 1 SELECTS THE PALLETTE TO BE USED: 3207 o = GREEN( 1 )/RED( 2 )IYELLOW(3) 3208 1 = tYANIl)IHAGENTAIZ)IWHITE(3) 3209 IN 40X25 OR 80X25 ALPHA MODES. THE VALUE SET FOR 3210 PALLETTE COLOR 0 INDICATES THE BORDER COLOR 3211 TO BE USED (VALUES 0-31, WHERE 16-31 SELECT THE 3212 HIGH INTENSITY BACKGROUND SET. 3213 (AHI = 12 WRITE DOT 3214 (OX I = ROW NUMBER 3215 I CX) ;;; COLUMN NUMBER 3216 (All = COLOR VALUE 3217 IF BIT 7 OF AL = 1. THEN THE COLOR VALUE IS EXCLUSIVE 3218 OR'D WITH THE CURRENT CONTENTS Of THE DOT 3219 IAH) = 13 READ DOT 3220 (OX) = ROW NUMBER 3221 (CX) ;;;; COLut1H NUMBER 3222 (AU RETtlRNS THE DOT READ 3223 3224 ; ASCII TELETYPE ROUTINE FOR OUTPUT 3225 3226 I AH) = 14 WRITE TELETYPE 3227 I AL I = CHAR TO WRITE 3228 I BLl = fOREGROUND COLOR IN GRAPHICS MODE 3229 IBH) ;;; DISPLAY PAGE IN ALPHA MODE 3230 NOTE -- SCREEN WIDTH IS CONTROLLED BY PREVIOUS MODE SET 3231 A-44 LaC OBJ LINE SOURCE 3232 (AH) = 15 CURRENT VIDEO STATE 3233 RETURNS TliE CURRENT VIDEO STATE 3234 (AU = MODE CURRENTLY SET ( seE AH=O FOR EXPLANATION) 3235 (AH) ::; NUJ1BER OF CHARACTER COLUMNS ON SCREEN 3236 IBH) ;; CURRENT ACTIVE DISPLAY PAGE 3237 3238 CS,SS,DS,ES.BX,CX,DX PRESERVED DURING CALL 3239 ALL OTHERS DESTROYED 3240 ;-----------------------------------:--------- 3241 ASSUME CS: CODE. OS: DATA. ES: VIDEO.RAM 3242 FOltS 3243 HI LABEL WORD J TABLE OF ROUTINES WITHIN VIDEO I/O F04S FCFO 3244 ow OFFSET SET_MODE F047 CFFl 3245 ow OffSET SET.CTYPE F049 FOFl 3246 DW OFFSET SET.CPOS f04B lAFZ 3247 DW OfFSET READ.CURSOR F04D A9F7 3248 DW OFFSET READ_lPEN F04f 30F2 3249 ow OFFSET ACT.DISP.PAGE FOS1 9CF2 3250 OW OFFSET SCROLl.UP F053 41F3 3251 ow OFFSET SCROLl.DOWN FOSS 7DF3 3252 DW OFFSET RCAO.AC_ClmREUT F057 C3F3 3253 ow OFFSET WRITE_At_CURRENT F059 FbF3 3254 DW OFFSET WRITE_t_CURRENT F059 54F2 3.255 OW OFFSET SET_COLOR F050 38F4 3256 ow OFFSET lo:RITE_DOT FOSF .27F4 3257 ow OFFSET REA.D_DOT f061 2:2F7 32.58 DW OFFSET WRITE_TTY F063 7AF2 32.59 DW OFFSET VIDEO_STATE 0020 3.260 HIL EQU $-111 3261 F06S 32.62 VIDEO_IO rROt tl'EAR F065 FB 3263 STI ; INTERRUPTS BACK ON F066 FC 3264 ClD ; SET DIRECTION FORWARD F067 06 3265 PUSH ES F068 IE 3266 PUSH DS o SAVE SEGMENT REGISTERS F069 52 3267 PUSH OX F06A 51 3268 PUSH CX F068 53 3269 PUSH B' F06C 56 3270 PUSH 51 F060 57 3271 PUSH 01 F06E 50 3272 PUSH AX ; SAVE AX VAlUE F06F 8AC4 3.273 MV AL,AH ; GET INTO LOW BYTE Fon 32E4 3274 XO' AH,AH ; ZERO TO HIGH BYTE F073 DIED 3275 SAL AX,l ; *2 FOR TABLE LOOKUP F075 8BFO 3276 HOV SI,AX i PUT INTO 51 FOR BRANCH F077 302000 3277 CMP AX,Mll i TEST FOR WITHIN RANGE F07l 7204 3278 JB H2 ; BRANCH AROUND BRANCH F07C 58 3279 POP AX ; THROW AWAY THE PARAMETER F07D E94701 3280 JMP VIDEO_REnJRN i DO NOTHING IF NOT IN RANGE F080 684000 3281 112: MDV AX. DATA FDB3 8EDB 3282 MDV OS,AX F085 B600B8 3263 MV AX,OBSOOH ; SEGt1ENT FOR COLOR CARD F068 8831:1000 3284 HOV DI,EQUIP_FLAG ; GET EQUIPMENT SETTING F08C 81E73000 3285 AUD DI.30H ; ISOLATE CRT SWITCHES F090 83FF30 3286 CMP DI,30H j IS SETTING FOR BW CARD? F093 7S03 3287 JHE H' F095 8800eo 3286 HDV AX,OBOOOH ; SEGMENT FOR BW CARD F098 8ECO 3289 M3: MV ES,AX ; SET UP TO POINT AT VIDEO RAM AREAS F09A 58 3290 POP AX ; RECOVER VALUE F098 8A264900 3291 HOV AH ,CRT_HODE ; GET CURRENT MODE INTO AH F09F 2EFfA44SFO 3292 JMP WORD PTR CS:[SI+OFFSET till 3293 VIDEO_ID ENDP 3294 0------------------------------------------ 3295 ; SET_MODE 3296 THIS ROUTINE INITIALIZES THE ATTACHMENT TO 3297 THE SE LEeTED MODE. THE StREEN IS BLANKED. 3298 ; INPUT 3299 (AU = MODE SELECTED (RANGE 0-9) 3300 ; OUTPUT 3301 NONE 3302 ; --------- ------ -- ---- --- -- ----------------- 3303 3304 0------ TABLES FOR USE IN SEnING OF HODE 3305 FOA4 3306 VIDEO_PARNS LABEL BYTE 3307 ;------ INIT_TABLE A-45 LOC OBJ LINE SOURCE FOA4 3828200AIF0619 3308 DB 38H. 28H ,2DH ,OAH, IfH,6 ~ 19H ; SET UP fOR 40X25 FGAB lC02070607 3309 DB lCH.2,7,6.7 FOBO 00000000 3310 DB 0,0.0,0 0010 3311 M4 EQIJ .-VIDEO_PARMS 3312 FOB4 71505AOAIF0619 3313 DB 71H.50H .SAH.OAH, IfH.6 ,19H ; SET UP FOR BOX2S fOBB lC02070607 3314 DB lCH.t,7,6.? FOCO 00000000 3315 DB 0.0,0,0 3316 FOCl't 3828200A7F0664 3317 DB 38H .28H,20H,OAH, 7fH ,6,64H ; SET UP fOR GRAPHICS FOCB 7002010607 3318 DB 70H,2,1,6,7 fOOO 00000000 3319 DB 0,0,0,0 3320 FOD4 6150520F190619 3321 DB 61H .50H ,S2H.OFH,19H,6.19H J SET UP FOR 80X2S B&N CARD FODe 19020D080(; 3:522 DB 19H,2,ODH,OBH.OCtJ FOEO 00000000 332:3 DB 0.0,0.0 332ft fOE4 FOE4 0008 3325 3326 t15 LABEL OW "".0 2048 ; 40X2S ; TABLE OF REGEN LENGTHS FOE6 0010 3327 OW 4096 j BOX2S FOE8 0040 3328 OW 16384 ; GRAPHICS FOE4 0040 3329 OW 16384 3330 3131 ;------ COLut1NS FOEC 3332 J16 LABEL BYTE FOEC 2828505028285050 3333 DB 40,40,80,80,40,40,80,80 333't 3335 ;------ C_RE:G_ToAB FOF4 3336 M7 lASH BYTE ; TABLE OF HODE SETS FOF4 2C282D.292A2EIEt9 3337 DB 2Ctf ,28H,20H. 29H,2AH ,2EH .1£H,29H J 33.)1;1 FOFC 3339 SET_HOOE PROt HEAR FOFC 8A0403 3340 MOV DX,03D4H ; ADDRESS OF COLOR CARD FOFF B3aO 3341 MOV Bl,O ; MODE SET FOR COLOR CARD FlOl 83FFlO 3342 CMP DI,30H I IS Bioi CARD INSTALLED FI04 7507 3343 JHE M" I OK WITH COLOR F106 B007 3344 MOV AL,7 INDICATE Bioi CARD MODE FI08 8A8403 3345 MOV OX.0384H ADDRESS OF aw CARD FlOB FEtl 3346 IHC BL HOOE SET FOR ew CARD F10D 8AEO 3347 M8: HOV AH.Al ; SAVE ttODE IN AH FlOf A24900 3348 MOV CRT_t100E .AL I SAVE IN GLOBAL V,lRIABlE F112 89166300 3349 HOV ADDR_6845,DX ; SAVE ADDRESS OF BASE Fl16 IE 3350 PUSH OS j SAVE POINTER TO DATA SEGMENT FI17 50 3351 PUSH AX ; SAVE MODE F116 52 3352 PUSH OX ; SAVE OUTPUT PORT VALUE FI19 83C204 3353 ADO OX.4 j POUlT TO CONTROL REGISTER File SAC3 3354 MOV AL-,Dl J GET MODE SET FOR CARD FUE EE 3355 OUT OX,AL ; RESET VIDEO FUF 5A 3356 POP OX ; BACK TO BASE REGISTER F120 ZBtD 3357 SUB A)(,AX ; SET UP FOR AB50 SEGMENT F122 8ED8 3358 MOV DS,AX I ESTABLISH VECTOR TABl.E ADDRESSING 3359 ASSUME DS:ABSO F124 C51E7400 3360 lOS BX,PARM_PTR ; GET POINTER TO VIDEO PARMS F128 58 3361 POP AX ; RECOVER PARMS 3362 ASSUME DS:CODE f129 B91000 3361 MOV CX.M4 ; LENGTH OF EAC"" ROW OF TABLE FI2e 80FC02 3364 CMP AH.2 j DETERMItlE WHICH ONE TO USE FI2f 7210 3365 JC M9 i MODE IS 0 OR 1 FUI 0309 3366 ADD ex,tx J MOVE TO NEXT ROW OF INIT T A8lE F133 80FC04 3367 CMP AH.4 FU6 7209 3368 JC M9 ; I10DE IS e OR 3 F138 0309 3369 ADO 8X,CX J MOVE TO GRAPHICS ROW OF INIT_TASlE Fl3A 80FC07 3370 CMP AH,7 FI30 nOl?: 3371 JC M" i MOOE IS 4.S. OR 6 F13F 0309 3372 ADO 8x,ex , MOVE TO BN CARD ROW OF INIT_TABLE 3373 3374 ;------ ex POINTS TO CORRECT RON OF INITIALIZATION TABLE 3375 F14t 3376 M9: ; OUT_INIT f141 50 3377 PUSH AX ; SAVE NODE IN AH f142 32E4 3376 xo. AH,AH i AH ~IlL SERVE AS REGISTER HUttB[R DURING LOOP 3379 3380 ;------ lOOP TltRCUGH TABLE, OUTPUTTTING REG ADDRESS, THEN VALUE FRDt1 TA8LE 3381 Fl44 3362 M10: ; nUT lOOP F144 BAC4 3383 MOV j GET 6845 REGISTER NUMBER A-46 lOC OBJ LINE SOURCE F146 EE 3384 OUT DX,Al F147 42 3385 INC OX POINT TO OAT A PORT F14& FEe4 3386 INC AH NEXT REGISTER VALUE F14A 8AO? 3387 HOV AL,lBX] GET TABLE VALUE Fl4C EE 3388 OUT DX,AL OUT TO CHIP Fl40 43 3389 INC BX ~lEXT IN TABLE F14E 4A 3390 OEC OX ; BACK TO POINTER REGISTER F14F E2f3 3391 LOOP M1. ; 00 THE WHOLE TABLE FIS1 58 3392 POP AX GET MODE BACK F152 IF 3393 POP os ; RECOVER SEGMENT VALUE 3394 ASSUME DS:DATA 3395 3396 ; ------ FILL REGEN AREA WITH BLANK 3397 Fl53 33fF 3398 XOR 01.01 SET UP POINTER FOR REGEN Fl55 893E4EOO 3399 HOV CRT_STA~n ,01 START ADDRESS SAVED IN GLOBAL F 159 C606620000 3400 HOV ACTIVE_PAGE ,0 SET PAGE VALUE F15E 890020 3401 HOV CX.8192 NUMBER OF WORDS IN COLOR CARD Fl61 BOFC04 3402 CMP AH,4 TEST FOR GRAPHICS Flb4 noe 3403 JC M12 NO_GRAPHICS_INIT F 166 80FC07 3404 CHP AH.7 TEST FOR B~ CARD Fl69 7404 3405 JE H11 BW_CARD_INIT Flbe 33CO 3406 XOR AX,AX FIll FOR GRAPHICS MODE Fl6D EB06 3407 JHP SHORT 1113 CLEAR_BUFFER FloF 3406 H11: BW_CARO_INIT FloF 890008 3409 MOV CX.2'048 BUFFER SIZE ON BW CARD FIn 3410 H12: NO_GRAPHICS_INIT FIn 882007 3411 HOV AX •• • +7*256 FILL CHAR FOR AlPHA FI7S 3412 H13: ; ClEAR_BUFFER fl7S F3 3413 REP STOSW ; FIll THE REGEN BUFFER WITH BLANKS FI76 AS 3414 3415 ;------ ENABLE VIDEO AND CORRECT PORT SETTING 3416 FI77 C706bOQ06700 3417 HOV CURSOR_MOOE,67H SET CURRENT CURSOR MODE F17D A04900 3416 MOV AL.CRCMOOE GET THE MODE Flao 32E4 3419 XOR AH, AH INTO AX REGISTER F182 8BFO 3420 MOV SI.AX TABLE POINTER. IHDEXED BY MODE FIB4 88166300 3421 MOV DX.ADDR_6845 PREPARE TO OUTPUT TO VIDEO ENABLE PORT FlBB 83C204 3422 ADD OX.4 FIBB 2E8A84f4FO 3423 NOV Al,cs:lsI+QFFSET H7] F 190 EE 3424 OUT OX.AL SET VIDEO ENABLE PORT FI9l A2bSOO 3425 HOV 3426 3427 ;------ DETERMINE NUMBER OF COLUMNS, BOTH FOR ENTIRE DISPLAY 3428 ;------ AND THE HUMBER TO BE USED FOR TTY INTERFACE 3429 F 194 2:EBA84ECFO 3430 MOV Al.CS:[SI + OFFSET M61 FI99 32E4 3431 XOR AH,AH FI9B A34AOO 3432 NOV ;. NUMBER OF COll.JMl'.fS IN THIS SCREEN 3433 3434 ; ------ SET CURSOR POSITIONS 3435 F19E 81E60EOO 3436- AND SI.OEH j WORD OFFSET INTO ClEAR lENGTH TABLE FlA2 2E8BBCE4FO 3437 MOV CX.CS:[SI + OFFSET M5J ;, LENGTH TO CLEAR FlA7 890E4COO 3433 MOV ; SAVE LENGTH OF CRT -- tWT USED FOR Bioi FlAB 890800 3439 HOV ; ClEAR ALL CURSOR POSITIONS FUE BF5COO 3440 HOV FIBI IE 3441 PUSH OS ESTABLISli SEGMENT FIBl 07 3442 POP ES ADDRESSING FIB3 33CO 3443 XOR AX.AX FIBS F3 3444 REP STaSI.! ; FILL WITH ZEROES FlB6 AS 3445 3446 j------ SET UP OVERSCAN REGISTER 3447 FIB7 42 3448 INC OX SET OVERSCAN PORT TO A OEFAUL T FIBB B030 3449 HOV AL,30H VALUE OF 30H FOR ALL MODES EXCEPT 640X200 F ISA 803E490006 3450 CHP CRT_MODE .6 SEE IF THE MODE IS 640X200 BW FIBf 7502 3451 JNZ M14 IF IT IStH O,,+OX200. THEN GOTO REGULAR FICI S03F 3452 HOV AL,3FH IF IT IS 640X200. THEN PUT IN 3FH FlC] EE 3453 M14: OUT DX.Al OUTPUT THE CORRECT vALUE TO 309 PORT FIC4 Al600D 3454 HoV CRT_PAllETTE .AL ; SAVE THE VALUE FOR FUTURE USE 3455 3456 j------ NORMAL RETURN FROM All VIDEO RETURNS 3457 A-47 LaC OBJ LINE SOURCE FlC7 3458 VIDEO_RETURN: FIC7 SF 3459 POP 01 Flce SE 3460 POP 51 FIC9 56 3461 POP BX FlCA 3462 MIS: j VIDEO_RETURN_C FICA 59 3463 POP CX Flce SA 3464 POP OX Flee IF 3465 POP os FICO 07 3466 POP ES RECOVER SEGMENTS FICE CF 3467 IRET All DONE 3468 SET_MODE ENOP 3469 ; - --- -- ----- - ----------------------- --------- 3470 SET_CTYPE 3471 THIS ROUTINE SETS THE CURSOR VALUE 3472 INPUT 3473 (ex) HAS CURSOR VALUE CH-START LINE, Cl-STOP LINE 3474 ; OUTPUT 3475 NONE 3476 ; - - -- - - -- -------- ------------------- ----- ---- FIeF 3477 PROC NEAR FieF B40A 34"18 AH,10 6845 REGISTER FOR ClmSOR SET fIDl 890E6000 3479 MOV CURS!)R_MOOE,CX SAVE IN DATA AREA FlDS E80200 3480 CAll Hl6 OUTPUT ex REG Fl08 EBED 3481 JMP 3482 3483 ;------ THIS ROUTINE OUTPUTS THE CX REGISTER TO THE 6845 REGS NAMED IN AH 3484 FICA 3485 N16: FIOA 88166300 3486 MOV OX.ADDR_6845 ; ADDRESS REGISTER FIDE 8AC4 3487 MOV Al,AH ; GET VALUE FlED EE 3488 OUT OX,Al ; REGISTER SET FIEI 42 3489 WC OX DATA REGISTER FIE2 MCS 3490 HOV Al.CH ; DATA FlE4 EE 3491 OUT OX,AL FIE5 4A 3492 DEC OX FIE6 BAC4 3493 MOV AL.AH FIE8 FEee 34q4 INC Al POINT TO OTHER DATA REGISTER flEA EE 3495 OUT OX.Al SET FOR SECOND REGISTER FIEB 42 3496 INC OX FlEC BACI 3497 MOV Al,CL SECOND DATA VALUE flEE EE 3498 OUT OX.AL fiEF C3 3499 RET ALL DONE 3500 SET_CTYPE Elmp 3501 -------------------------- - --------------- 3502 SET_CPOS 3503 THIS ROUTINE SETS THE CURRENT CURSOR POSITION TO THE 3504 NEW X- Y VALUES PASSED 350$ INPUT 3506 DX - ROW,COLUMN OF NEW CURSOR 3507 BH - DISPLAY PAGE OF CURSOR 3$08 ; OUTPUT 3509 CURSOR IS SET AT 6845 IF DISPLAY PAGE IS ClmRENT DISPLAY 3510 ; ----- ---- --------- --------------- ----------- FIFO 3511 SET_CPOS PROC NEAR FIFO 8ACF 3512 MOV CL,ElH F IF2 32EO 3513 XOR CH.CH , ESTAElLISH lOOP COUNT FIF4 DlE1 3514 SAl CX.1 ; WORD OFFSET FIF6 88Fl 3515 MOV SI.CX ; USE INDEX REGISTER FIFS 89945000 3516 MOV t ShOFFSET CURSOR_POSH) ,OX ; SAVE THE POINTER Fife 383E6200 3517 CHP ACTIVE_PAGE .BH FlOD 7505 3518 JHZ M17 ; SET_epOS_RETURN Fl02 8BC2 3519 MOV AX,DX ; GET RaW/COLUMN TO AX Fl04 E80200 352:0 CALL M18 CURSOR_SET Fl07 3521 M17: SET_CPOS_RETURN Fl07 EBBE 3522 JMP VIDEO_RETt.mN 3523 SET_CPOS END? 3524 3525 ;------ SET CURSOR POSITION, AX HAS ROW/COLUMN FOR CURSOR 3526 F209 3527 M18 PROC NEAR F209 Ee7FOD 3528 CALL POSITION ; DETERMINE LOCATION IN REGEN BUFFER FlOC 89C8 3529 MOV CX.AX FlOE 030E4EOO 3530 ADO CX,CRr_START ; ADD IN THE START ADDRESS FOR THIS PAGE F212: DIF9 3531 SAR CX,1 DIVIDE BY 2: FOR CHAR ONLY COUNT F214 B40E 3532 MOV AH,14 ; REGISTER NUMBER FOR CURSOR A-48 lOC OBJ LINE SOURCE F216 ESCIFF 3533 CALL Hlb ; OUTPUT THE VALUE TO THE 6845 F219 C3 3534 RET 3535 3536 ",. ENDP i -------------------------------------------- 3537 READ_CURSOR 3538 THIS ROUTINE READS THE CURRENT CURSOR VALUE fROM THE 3539 6845, FORMATS IT, AND SENDS IT BACK TO THE CAllER 3540' INPUT 3541 BH - PAGE OF CURSOR 3542 ; OUTPUT 3543 OX - ROW, COLUMN OF THE CURRENT CURSOR POSITION 3544 ex - CURRENT CURSOR MODE 3545 j -- -- -- ---------- --- - ---- -- - - --- -- -- ---- ---- F214 3546 READ_CURSOR PROC NEAR F2lA 8ADF 3547 "OV BL.BH FZIC 32:FF 3548 XOR BH.BH F21E DIU 3549 SAL BX.l ; WORD OFFSET F220 88975000 3550 HOV OX. [BX+OFFSET CURSOR_POSN) F224 SSOE6000 3551 HOV CX,CURSOR_MODE F228 5F 3552 POP DI F229 5£ 3553 PDP SI F22A 58 3554- PDP BX F22:B 58 3555 PDP AX ; DISCARD SAVED ex AND ox F2tC 58 3556 PDP AX F220 IF 3557 PDP OS F22E 07 3558 POP ES F2:2:F CF 3559 IRET 3560 READ.CURSOR WOP 3561 ; ---- ---------------------------------------- 3562 ; AtT_DISP_PAGi: 3563 THIS ROUTINE SETS THE ACTIVE DISPLAY PAGE, AlLOWING 3564 THE FULL USE OF THE RAM SET ASIDE FOR THE VIDEO ATTACHMENT 3565 INPUT 3566 AL HAS THE NEW ACTIVE DISPLAY PAGE 3567 ; OUTPUT 3568 THE 6845 IS RESET TO DISPLAY THAT PAGE 3569 ; -------------------------------------------- F2:30 3570 ACT_DISP_PAGE PROC NEAR F230 A26200 3571 MOY ACTIVE_PAGE .AL ; SAVE ACTIVE PAGE VALUE F233 8BOE4COO 3572 MOV CX,CRT.LEN I GET SAVED LENGTH OF REGEN BUFFER F237 98 3573 CBW ; CONVERT AL TO WORD F2.38 50 3574 PUSH AX ; SAVE PAGE VALUE F239 F7El 3575 HUL ex j DISPLAY PAGE TIMES REGEN LENGTH F2:38 434£00 3576 MOV CRT_START ,AX ; SAVE START ADDRESS FOR LATER REQUIREMENTS F23E 8BCS 3577 MOV CX,AX ; START ADDRESS TO ex F2:40 DlF9 3578 SAR CX.l ; DIVIDE BY 2 FOR 6845 HANDLING F2:42 B40C 3579 MOV AH.12 ; 6845 REGISTER FOR START ADDRESS F2:44 EM!FF 3580 CALL 1116 F247 sa 3581 POP BX ; RECOVER PAGE VALUE H48 DIE3 3582 SAL eX.l ; *2 FO'R WORD OFFSET F24A 88875000 3583 MOV AX. [ex + OffSET CURSOR_POSN I ; GET CURSOR FOR nus PAGE H4E EBB8FF 3584 CALL 1118 j SET THE CURSOR POSITION F251 £973FF 3585 JMP VIDEO_RETURN 3586 ACT_DISP_PAGE EHOP 3587 j -------------------------------------------- 3588 SET COLOR 3589 THIS ROUTINE WILL ESTABLISH THE BACKGROUND COLOR, THE OVERSCAN COLOR, 3590 AND TIlE FOREGROUND COLOR SET FOR MEDIUM RESOLUTION GRAPHICS 3591 INPUT 3592 (BHJ HAS COLOR 10 3593 IF BH=O, THE BACKGROUND COLOR VALUE IS SET 3594 FROI1 THE LOW BITS OF BL 10-31) 3595 IF BH=I. THE PALLETTE SELECTION IS MADE 3596 BASED ON THE LOW BIT OF BL: 3597 0 = GREEN, RED, YELLOW fOR COLORS 1.2,3 3598 I = BLUE. CYAN, MAGENTA FOR COLORS 1,2.3 3599 (BU HAS THE COLOR VALUE TO BE USED 3600 ; OUTPUT 3601 THE COLOR SELECTION IS UPDATED 3602 ; ------------------ -- ------------ ------------ F2:54 3603 SET_COLOR PROC NEAR F254. 68166300 3604 MDV DX,ADDR_6B45 j I/O PORT FOR PALETTE F2:58 83C205 3605 ADD DX,S ; OVERSCAN PORT F2:58 AQ6600 3606 MDV AL.CRT_PALLETTE j GET THE CURRENT PALLETTE VALUE F2:SE OAFF 3607 OR BH.BH ; IS THIS COLOR O? A-49 LOC QBJ LINE SOURCE F260 750E 360B JHZ M,. ; OUTPUT COLOR 1 3609 3610 ;------ HANDLE COLOR 0 BY SETTING THE BACKGROUND COLOR 3611 F262 24EO 3612 AND AL,OEOH ; TURN OFF LOW 5 BITS OF CURRENT F264 aODIF 3613 AND BL,OlFH ; TURN OFF HIGH 3 BITS OF INPUT VALUE f267 OAC3 3614 OR AL,BL ; pur VALUE INTO REGISTER F269 3615 M19: ; OUTPUT THE PALLETTE F269 EE 3616 OUT OX,AL ;output color selection to 3d9 port F26A A26600 3617 MOV CRT_PAllETTE .Al ; SAVE THE CmOR VAWI: F26D E957FF 3618 JMP VIDEO_RETURN 3619 3620 ; ------ HANDLE COLOR 1 BY SElECTING THE PALLETTE TO BE USED 3621 F270 362:2 M20: F270 240F 3623 AND AL,OOFH ; TURN OFF PAllETTE SElECT BIT F272 DOE6 3624 5"R BL.l TEST THE LOW ORDER BIT OF Bl F274 73F3 3625 JNe M19 ; ALREADY DONE f276 OCZO 3626 OR AL,20H j TURN ON PALlETTE SElECT BIT F278 EBEF 3627 JMP M19 ;GODOn 3626 SET_COLOR ENOP 3629 ; -------------------------------------------- 3630 jVlOEO STATE 3631 RETURNS THE CURRENT VIDEO STATE IN AX 3632 AH = NUMBER OF COLlJt1NS ON THE SCREEN 3633 AL '" CURRENT VIDEO MODE 3634 BH = CURRENT ACTIVE PAGE 3635 ; ---- ---- -------- --- ------------------------- F27A 3636 VIDEO_STATE PROC NEAR F27A 8A264AOO 3637 MOV AH ,BYTE PTR CRT_COLS ; GET NUMBER OF COLUMNS F27E A04900 3638 MOV AL.CRT_MODE j CURRENT MODE F281 8A3E6200 3639 MOV BH,ACTIVE_PAGE ; GET CURRENT ACTIVE PAGE F265 SF 3640 POP or ; RECOVER REGISTERS F286 5E 3641 POP 5r F287 59 3642 POP ex j DISCARD SAVED ex Fl68 E93FFF 3643 JMP M15 ; RETURN TO CAllER 3644 3645 ; ---- --- ---------------------------- 3646 POSITION 3647 THIS SERVICE ROUTINE CALCULATES THE REGEN BUFFER ADDRESS 3648 OF A CHARACTER IN THE ALPHA MODE 3649 ; INPUT 3650 AX = ROW. COLUMN POSITION 3651 ; OUTPUT 3652 AX = OFFSET OF CHAR POSITION IN REGEN BUFFER 3653 j -- ---- ----- --- ----- ------------- ---- FlaB 3654 POSITION PRoe NEAR F28B 53 3655 PUSH BX SAVE REGISTER F28C 8608 3656 MOV aX.AX Fl8E 8AC4 3657 MOV AL.AH ROWS TO AL f290 F6264AOO 3658 MUl ; DETERMINE BYTES TO ROW f294 32fF 3659 XOR BH,BH F296 03C3 3660 AOD AX,BX ; ADD IN COlUT1N VALUE F298 DIED 3661 SAL AX.l • ,. 2 FOR ATTRIBUTE BYTES F29A 56 3662 PDP BX F29B C3 3663 RET 3664 POSITION ENDP 3665 ; ---- ----- --- ------------------------------ 3666 ; SCROLL UP 3667 THIS ROUTINE MOVES A BLOCK OF CHARACTERS UP 3668 ON THE SCREEN 3669 ,INPUT 3670 (AH) = CURRENT CRT MODE 3671 (AL) = HUME·ER OF ROWS TO SCROLL 3672 (CX) = ROW/COLUl1N OF UPPER LEFT CORNER 3673 (OX) = ROW/COLUMN Of LOI--IER RIGHT CORNER 3674 (BH J = ATTRIBUTE TO BE USED ON BLANKED LINE 3675 (OS) = OAT A SEGMENT 3676 (ES) '" REGEN BUFFER SEGMENT 3677 ; OUTPUT 3678 NONE -- THE REGEN BUFFER IS MODIFIED 3679 ; -- ---------- ----- -- - -------------- --- -- ---- 3680 ASSUME CS :CODE ,OS: DATA .ES:DATA F29C 3681 SCROLL_UP PROC NEAR F29C BADB 3682 MOV BL.AL ; SAVE LINE COUNT IN BL F29E 80FC04 3683 eMP AH.4 ; TEST FOR GRAPHICS MODE A-50 LOC OBJ LINE SOURCE HAl 72:08 3684 JC NI ; HANDLE SEPARATELY f243 80FC07 3685 CMP AH,7 ; TEST F OR Bioi CARD F2A6 7403 ""86 JE NI F2A8 E9F301 3687 JMP GRAPHICS_UP f2A8 3688 Nl: j UP_COtHINllE f2AB 53 3669 PUSH BX ; SAVE FILL ATTRIBUTE IN BH FZAC 8BCl 3690 MOV AX,CX ; UPPER LEFT POSITION FZA£ £83900 3691 CALL SCROLL_POSITION ; DO SETUP FOR SCROll F2Bl 7433 3692 JZ ; BLANK_FIELD F283 03FO 3693 ADO ; FROM ADDRESS FlBS 8A£b 3694 MOV ; # ROWS IN BLOCK F2B7 ZAB 3695 SUB ; I ROWS TO BE MOVED F289 3696 ; ROW_LOOP F289 E67500 3697 CAll HI0 ; MOVE ONE ROW FlBC 03F5 3698 ADO SI,BP FlBE 03FO 3699 AOO DI,BP ; POINT TO NEXT LINE IN BLOCK F2eo fEee 3700 DEC AM ; COUNT (IF LINES TO MOVE F2:C2: 75F5 3701 JNZ N2 ; ROJrCLOOP f2:C4 3702 N3: ; CLEAR_ENTRY F2C4 58 3703 POP AX ; RECOVER ATTRIBUTE IN AH F2C5 B020 3704 MOV AL, I ; FILL WlTH BLANKS F2:C7 3705 N4: ; CLEAR_lOOP F2C7 £87000 3706 CALL NIl ; CLEAR THE ROW F2CA 03FO 3707 ADO nI,BP ; POINT TO NEXT LINE Flce FEeB 3708 DEC BL ; COUNTER OF LINES TO SCROLL FleE 75F7 3709 JNZ N4 ; CLEAR_100P FZOO 3710 ; SCROLL_END F2:00 884000 3711 MOV AX,OATA ; GET LOCATION F2D3 8E08 3712 MOV OS,AX F205 803£490'007 3713 CMP CRT_MODE,7 ; IS THIS THE BLACK AND WHITE CARD FlOA 7407 3714 JE N6 ; IF SO. SKIP THE MODE RESET FZOC A06500 3715 MOV AL,CRT_MODE_SET ; GET THE VALUE OF THE MODE SET FZOF 8A0803 3716 MOV OX,030BH ; ALWAYS SET COLOR CARD PORT F2El EE 3717 OUT OX,AL F2E3 3718 N6: F2£3 E9EIFE 3719 JMP F2E6 3720 N7: ; BLANK_FIElD F2E6 BADE 3721 BL,DH ; GET ROW COUNT F2:E8 EBOA 3722 N3 ; GO CLEAR THAT AREA 3723 ENOP 3724 3725 ; ----- HANDLE COMMON SCROLL SET UP HERE 3726 FlEA 372.7 SCROLl.-POSITlON PRoe NEAR F2:EA 803£490002 3728 Ct1P CRT_t10DE,2 ; TEST FOR SPECIAl CASE HERE F2.EF 7219 3729 JB N9 ; HAVE TO HANDLE BOX25 SEPARATELY F2Ft 803£490003 3730 CMP FZF6 7712 3731 JA 3732 3733 ;------ SOX2S COLOR CARD SCROLL 3734 F2F8 52 3735 PUSH ox fZF9 BADA03 3736 MOV nX,30AH ; GUARANTEED TO BE COLOR CARD HERE f2fC 50 3737 PUSH AX F2FD 3738 N8: fZFD EC 3739 IN Al,OX ; GET PORT F2:fE A808 3740 TEST Al,S ; WAIT FOR VERTICAL RETRACE noD 74F8 3741 JZ HB ; WAIT_DISP_ENABLE f302 B025 3742 MOV AL.25H F304 BAD803 3743 MOV DX.03D8H f307 EE 3744 OUT OX.Al ; TURN OFF VIDEO nOB 58 3745 POP AX ; DURING VERTICAL RETRACE F309 5A 3746 POP OX f30A E87EFF 3747 N9: CALL POSITION ; CONVERT TO REGEN POINTER FlOD 03064£00 374S ADD AX , CRT_START ; OFFSET OF ACTIVE PAGE flU 86F8 3749 MOV OI.AX ; TO ADDRESS FOR SCROLL F31l B8FO 3750 MOV 51 ,A)( ; FROM ADDRESS FOR SCROLL F31S 28Dl 37501 SUB OX,CX ; DX :: #ROWS. ICOLS IN BLOCK F3I7 FEC6 3752 INC DH F319 FEe2 3753 INC OL ; INCREMENT FOR 0 ORIGIN F3IB 32£0 3754 XOR CH.CH ; SET HISH BYTE OF COUNT TO ZERO F3ID 882£4AOO 3755 MOV sp,eRT_COlS ; GET NUMBER OF COLUMNS IN DISPLAY F3tl 03EO 3756 ADD BP,SP ; TIMES 2 FOR ATTRIBUTE BYTE F323 8AC3 3757 MOV AL.BL ; GET LINE COUNT F325 F62:64400 3758 MUL SYTE PTR CRT_COLS i DETERMINE OfFSET TO FROM ADDRESS F32:9 03eo 3759 ADD AX,AX ; *2 fOR ATTRIBUTE BYTE A-51 LOC OBJ LINE SOURCE F326 06 3760 PUSH ES ESTABLISH ADDRESSING TO REGEN BUFFER F32C IF 3761 POP as FOR BOTH POINTERS F320 80FBoa 3762 CNP BL,D o SCROll MEANS BLANK FIELD F330 C3 3763 RET ; RETURN WITH f LAGS SET 3764 SCROll_POSITION ENOP 3765 3766 ; ------ HOVE_ROW F331 3767 HID PROC NEAR F331 BACA 3768 NOV el.Ol ; GET • OF COLS TO MOVE F333 56 3769 PUSH sr F334 57 3770 PUSH or ; SAVE START ADDRESS F335 F3 3771 REP MOVSW j MOVE THAT LINE ON SCREEN F336 A5 F337 SF 3772: POP or F338 SE 3773 POP sr ; RECOVER ADDRESSES F339 C3 3774 RET 3775 HI0 ENDP 3776 3777 ; ------ CLEAR_ROW F33A 3778 Hll PROt NEAR F33A BACA 3779 NOV eL,Ol ; GET. COLlJttNS TO CLEAR F33C 57 3780 PUSH or F3JD F3 3781 REP STOSIo! I STORE THE FILL CHARACTER F33E AS F33F SF 3782 POP or F340 C3 3783 RET 3784 Hll ENDP 3785 ; ---- --------- ---- -------- ---------- 3786 ; SCROll_DOWN 3787 THIS ROUTINE MOVES THE CHARACTERS WITHIN A DEFIt-tED 3788 BLOCK DOWN' ON THE SCREEN. FILLING THE TOP LINES 3789 WITH A DEFINED CHARACTER 3790 ;II'!PUT 37'H (AH 1 ;: CURRENT CRT MODE 3792 (AL) ;: NUMBER OF LINES TO SCROLL 3793 (ex) ;: UPPER LEFT CaRtIER OF REGION 3794 {OX, ;: LOWER RIGHT CORNER OF REGIOI'! 3795 (BH) ;: FILL CHARACTER 3796 (OS, ;: DATA SEGMENT 3797 I ES J ;: REGEN SEGMENT 3798 ;OUPUT 3799 NONE -- SCREEN IS SCROLLED 3800 - -- ------ -------------- ---- ---- F341 3801 SCROLl_DOI-JN PROC NEAR F341 FD 3802 STO DIRECTION FOR SCROll DOWN F342 8AM 3803 ~IOV BL,AL LINE coutn TO 8L F344 80FC04 3804 CMP AH.4 TEST FOR GRAPHICS F347 7208 3805 JC H12 F349 80FC07 3806 CNP AH.7 TEST FOR BW CARD F34C 7403 3807 JE H12 F34E E9A601 3808 JNP GRAPHICS_DOWN F351 3809 1'112: ; CONTINUE_DOWN F351 53 3810 PUSH 8X ; SAVE ATTRIBUTE IN BH F352 86C2- 3811 NOV AX,OX LOWER RIGHT CORNER F354 E893FF 3812 CALL SCROLL_POSITION GET REGEN LOCATION F357 7420 3813 JZ H16 F359 2BFO 3814 SUB SI,AX 51 IS FROM ADDRESS F35B 8AE6 3815 MOV AH,DH ; GET TOTAL '* ROWS F3S0 ZAn 3816 SU8 AH,Bl COUNT TO MOVE IN SCROll F3SF 3817 1'113: F35F E8CFFf 3818 CAll HID HOVE ot~E ROW F362 2BF5 3819 SUB SI.BP F364 2BFO 3820 SUB OI.BP F366 FEee 31321 DEC AH F3b8 75F5 3822 JHZ H13 F3bA. 3823 N14: F36A S8 3824 POP AX i RECOVER ATTRIBUTE IN AH F3bB B020 3825 NOV Al. nbD 3826 NlS: F360 E8CAFF 3827 CALL Hll CLEAR OHE ROW F370 2BfD 3828 SUB DI,DP GO TO NEXT ROW F372 fECB 3829 OEC 8L F374 7SF7 3830 JNl N15 F376 E957FF 3831 JNP H5 ; SCROll_END F379 3832 N16: F379 8ADE 3833 NOV BL,DH A-52 LOC OBJ LINE SOURCE Fl7B EBED 3834 JMP N1' 3835 SCROlL_DO\i.:N ENDP 3836 ; ------ ------------- ---- ------------------- 3837 READ_AC_CURRENT 3838 THIS ROUTINE READS THE ATTRIBUTE AND CHARACTER AT THE CURRENT 3839 CURSOR POSITION AND RETURNS THEM TO THE CALLER 3840 ; INPUT 3841 (AH) :; CURRENT CRT HODE 3842 (BH I :; DISPLAY PAGE ( ALPHA HODES ONLY I 3843 (oS I :; DATA SEGMENT 3344 (ES) :; REGEN SEGI1ENT 3845 ; OUTPUT 3846 (Al) :; CHAR READ 3847 (AHI :; ATTRIBUTE READ 3848 ; ----------- ---- ---- - - -- - - -- ------ - - ------- 3849 ASSUME CS :CODE .05: DATA. ES :DATA F37D 3850 READ_At_CURRENT PROt NEAR Fl7D BOFC04 3851 eMP AH.4 ; IS THIS GRAPHICS FloO 7208 3852 Je P1 FlB2 BOFC07 3853 eMP AH.7 ; IS THIS BW CARD F3B5 7403 3854 JE P1 F387 E9A902 3855 JMP GRAPHICS_READ DBA 3e56 PI: ; READ_AC_CDNTlNUE F3aA E8lAOO 3857 CAll FINO_POSITION F3BD BaF3 3856 MOV SI.ax ; ESTABLISH ADDRESSING IN SI 3859 3860 ;------ ~AIT FOR HORIZONTAL RETRACE 3861 F38F B8166300 3862 MOV DX.ADDR_6845 ; GET BASE ADDRESS f393 83C206 3863 ADO DX.6 ; POINT AT STATUS PORT F396 06 3864 PUSH ES F397 IF 3865 POP os ; GET SEGMENT FOR QUICK ACCESS F398 3866 P2: ; WAIT FOR RETRACE lOW F39B EC 3867 IN Al.DX ; GET STATUS F399 ABOI 3868 TEST Al.I ; IS HaRZ RETRACE lOW F39B 75FB 3869 JNZ P' ; WAIT UNTIL IT IS F39D FA 3870 eLI ; NO HORE INTERRUPTS F39E 3871 P3: ; WAIT FOR RETRACE HIGH F39E EC 3872 IN AL.DX ; GET STATUS F39F A801 3873 TEST AL,1 ; IS IT HIGH FlAl 74FB 3874 JZ P' i WAIT UNTIL IT IS FlA3 AD 3875 lOOSW i GET THE CHAR/ATTR F3A4 EnOFE 3876- JMP VIDEO_RETURN 3877 READ_AC_CURRENT ENDP 3878 F3A7 3879 FIND_POSITION PROC NEAR FlA7 BACF 3880 MoV Cl.BH ; DISPLAY PAGE TO ex F3A9 32EO 3881 XOR CH .CH F3AB B8Fl 3882 HOV SI.CX ; HOVE TO 51 FOR INDEX F3AO 01E6 38&3 SAL SI.l ; '* 2 FOR WORD OffSET F3AF 8B845000 3884 MOV AX.[SI+ OFFSET CURSOR_POSH] ; GET ROW/COLUMN OF THAT PAGE F3Bl 310B 3885 XOR eX.BX SET START ADDRESS TO ZERO F3B5 E306 3886 JCXZ P5 NO_PAGE F387 3887 P4: PAGE_LOOP F3B7 031E4COO 3888 ADO LENGTH OF BUFFER nBB EZfA 3889 lOOP F3BD 3890 P5: ; NO_PAGE F3BO EBCBFE 3891 CALL POSITION DETERMINE LOCATION IN REGEN nco D308 3892 AOO aX,AX ; AOD TO START OF REGEN F3CZ C3 3693 RET 3894 FINO_POSITION Et-.'DP 3895 ; - - ------ --------------------------------- 389& i14RITE_AC_CURRENT 3897 THIS ROUTINE WRITES THE ATTRIBUTE AND CHARACTER AT 3898 THE CURRENT CURSOR POSITION 3899 ; INPUT 3900 I AH) ;; CURRENT CRT MODE 3901 (BH) ::; DISPLAY PAGE 3902 {CX I ;; COUNT OF CHARACTERS TO WRITE 3903 (All = CHAR TO WRITE 3904 (Bli ;; ATTRIBUTE OF CHAR TO WRITE 3905 105 I :; DATA SEGMENT 3906 (ES I ;; REGEN SEGMENT 3907 ; OUTPUT 3908 NONE 3909 ; ------- - ~ - -- - -- --------------------- ---- ---- A-53 LOC OBJ LINE SOURCE F3C3 3910 WRITE_AC_CURRENT PROt NEAR F3C3 80FC04 3911 eHP AH.4 IS THIS GRAPHICS F3C6 7208 3912 Je P6 nee 80FC07 3913 eHP AH.7 IS THIS Bioi CARD Flee 7403 3914 JE P6 nco E98101 391~ JHP GRAPHICS_WRITE F30a 3916 P6: ; WRITE_AC_CONTINUE F300 BAn 3917 HOV AH,BL j GET ATTRIBUTE TO AH F302 50 3'118 PUSH AX ; SAVE ON STACK F303 51 3919 PUSH ex ; SAVE WRITE COUNT F304 ESCOFF 3920 CALL FIND_POSITION n07 8BFB 3921 HOV DI.ex j ADDRESS TO or REGISTER F3D9 59 392Z POP ex ; WRITE COUNT F30A 58 3923 POP ex ; CHARACTER IN ex REG F30B 3924 P7: i WRITE_lOOP 3925 3926 ;------ WAIT FOR HORIZONTAL RETRACE 3927 FlOB 88166300 3928 MOV DX,ADDR_6845 ; GET BASE ADDRESS F1DF 83C206 3929 ADO OX.6 ; POINT AT STATUS PORT F3Ez 3930 pe: F3E2 EC 3931 IN Al.OX ; GET STATUS F3E3 A80l 3932 TEST Al,! ; IS IT LOW F3E5 75F6 3933 JNZ P8 ; WAIT UNTIL IT IS F3E7 FA 3934 eLI ; NO MORE INTERRUPTS F3EB 3935 P9: F3EB EC 3936 IN Al.DX ; GET STATUS F3E9 ABOI 3937 TEST Alol ; IS IT HIGH FlEB 74FB 3938 JZ P9 ; WAIT lmTIL IT IS F3ED BBC3 3939 HOV AX,BX ; RECOVER THE CHAIUATTR F3EF AB 3940 STOSW ; PUT THE CHAR/ATTR F3FO FB 3941 STI INTERRUPTS BACK ON F3F1 f2E8 3942 lOOP P7 ; AS MANY TIMES AS REQUESTED F3f3 E9DIFD 3943 JNP VIDEO_RETURN 3944 WRITE_At_CURRENT ENOP 3945 ; ----- ---- ------------ --------- ----------- 3946 iWRlTE_C_CURRENT 3947 THIS ROUTINE WRITES THE CHARACTER AT 3948 THE CURRENT CURSOR POSITION. ATTRIBUTE UNCHANGED 3949 ; INPUT 3950 {AH) = CURRENT CRT MODE 3951 (BH) :; DISPLAY PAGE 3952 (ex J :; COUNT OF CHARACTERS TO WRITE 3953 (AU = CHAR TO WRITE 3954 (OS) = DATA SEGMENT 3955 (ES) :; REGEN SEGMENT 3956 iOUTPUT 3957 NONE 3956 ; -------------------------------------------- FlF6 3959 WRITE_C_CURRENT PROC NEAR F3F6 80FC04 3960 CHP AH.4 ; IS THIS GRAPHICS F3F9 7208 3961 Je Pl. F3FB 80FC07 396Z CNP AH.7 ; IS THIS BW CARD F3FE 7403 3963 JE PI0 F400 E97EOI 3964 JNP GRAPHICS_WRITE F403 3965 PIO: F403 50 3966 PUSH AX ; SAVE ON STACK F404 51 3967 PUSH ex ; SAVE WRITE COUNT F405 E89FFF 3968 CALL FIND_POSITION F408 8BFB 3969 MOV OI.BX ; ADDRESS TO 01 F40A 59 3970 POP CX ; WRITE COUNT F40B 58 3971 POP ex ; Bl HAS CHAR TO WRITE F40C 3972 Pl1: ; WRITE_lOOP 3973 3974 ;------ WAIT FOR HORIZONTAL RETRACE 3975 F40C 88166300 3976 HOV OX.AOOR_6645 ; GET BASE ADORESS F410 83C206 3977 ADO DX.6 ; POINT AT STATUS PORT F413 3978 PIZ: F413 EC 3979 IN fJ.l.DX ; GET STATUS F414 A801 3980 TEST AL.I j IS IT LOW F416 75F8 3981 JNZ P12 ; WAIT UNTIL IT IS F418 FA 398Z eLI ; NO MORE INTERRUPTS F419 3983 P13: F419 EC 3984 IN AL.DX ; GET STATUS F4lA .11.801 3<;185 TEST Al.I ; IS IT HIGH A-54 LaC OBJ LINE SOURCE F41C 74F8 3986 Jl PI3 ; WAIT UNTIL IT IS F41E 8'&'C3 3987 MOV AL,Bl ; RECOVER CHAR F42:0 AA. 3988 SIOSB ; PUT THE CHAR/ATTR F421 47 3989 INC 01 ; BUMP POINTER PAST ATTRIBUTE F422 E2E8 3990 lOOP Plt i AS MANY TIMES AS REQUESTED F424 E9A.OFD 3991 JMP VIDEO_RETURN 3992 WRITE_C_CURRENT ENDP 3993 ; ------------- ------------------------------- 3994 ; READ DOT -- WRITE OOT 3995 THESE ROUTINES WILL WRITE A 001, OR READ THE 3996 DOT AT THE IHOICATEO LOCATION 3997 ENTRY -- 3998 OX = ROW (0-1991 !THE ACTUAL VALUE DEPeNOS ON THE HODEl 3999 CX ;:: COLUMN ( 0-6391 ( THE VALUES ARE NOT RANGE CHECKED I 4000 Al = DOT VALUE TO WRITE (1,2 OR 4 BITS DEPEIICING ON MODE, 4001 REQ'O FOR WRITE DOT ONLY. RIGHT JUSTIFlEOI 4002 BIT 7 OF AL = 1 INDICATES XOR THE VALUE INTO TJ-IE LOCATION 4003 OS ;:: DATA SEGMENT 4004 ES ;:: REGEN SEGMENT 4005 4006 EXIT 4007 AL = DOT VALUE READ, RIGHT JUSTIFIED, READ ONLY 4008 i --------------- -- ------ -- ----------- ----- --- 4009 ASSUME CS :CODE ,DS:DATA,ES:OATA F427 4010 READ_DOT PROC NEAR F427 f83100 4011 CALL R' ; DETERMINE BYTE POSITION OF DOT F42A 268A04 4012 NOV AL,fS:[SIJ ; GET THE;: BYTE F42D 22C4 4013 ANO AL,AH ; MASK OfF THE OTHER BITS IN TJ-IE BYTE F42F OlEO 4014 SHL AL,Cl ; LEFT JUSTIFY THE VALUE F431 8ACE 4015 HOV CL.OH ; GET NUMBER OF BITS IN RESULT F433 02CO 4016 ROL AL,CL ; RIGHT JUSTIFY THE RESULT F435 E98FFD 4017 JMP VIDEO_RETURN ; RETURN FROM VIDEO 10 4018 ENOP 4019 F438 4020 WRITE_DOT PROC NEAR F438 50 4021 PUSH AX SAVE OOT VALUE F439 50 4022 PUSH AX TWICE F43,., E8lEOO 4023 CALL R3 DETERMIHE BYTE POSITION OF THE DOT F43D 02E8 4024 SHR AL,CL ; SHIFT TO SET UP THE BITS FOR OUTPUT f43F 22C4 4025 AND AL,AH ; STRIP OFF THE OTHER BITS F441 Z68AOC 4026 MOV CL,ES:[SII ; GET THE CURRENT BYTE F444 56 4027 POP ex ; RECOVER XOR FLAG F445 F6C380 F448 7500 F44A. F6D4 4028 4029 4030 TEST JNZ NOT .2 BL.80H AH ; IS IT ON ; YES. XOR THE DOT ; SET THE MASK TO REMOVE THE INDICATEO BITS F44C 22CC 4031 ANO (:L.AH F44E OAel 4032 OR AL.Cl ; OR IN THE NEW VALUE OF THOSE BITS F450 4033 Rl: ; FINISH_DOT F450 268804 4034 MOV ES:[SI1,AL ; RESTORE THE BYTE IN MEMORY F4S3 58 4035 POP AX F454 E970FO 4036 JMP VIDEO_RETURN ; RETURN FROM VIDEO 10 F4S7 4037 RZ: ; XOR_D01 F457 32Cl 4038 XO. AL,CL ; EXCLUSIVE OR THE DOTS f459 EBFS 4039 JMP RI ; fINISH UP THE I-IRITING 4040 WRITCDOT [NDP 4041 ; --- ------------------------------------ ----- 4042 THIS SUBROUTINE DETERMINES THE REGEN BYTE LOCATION OF nil:: 4043 INDICATED ROW COLUMN VALUE IN GRAPHICS MODE. 4044 ENTRY ~- 4045 OX = ROW VALUE (0-1991 4046 ex ::: COLUMN VALUE (0-6391 4047 EXIT -- 4048 SI ::: OFFSET INTO REGEN BUFFER FOR BYTE OF INTEREST 4049 AH ::: MASK TO STRIP OFF THE BIT$ OF INTEREST 4050 CL = BITS TO SHIFT TO RIGHT JUSTIFY THE MASK IN AH 4051 DH ::: I BITS IN RESULT 4052 ; ------------------- -- --- --------- ~----- ----- F45B F458 53 4053 4054 R' PROC PUSH NEAR 6X ; SAVE BX DURING OFERATION F45C 50 4055 PUSH AX ; WILL SAVE AL DURING OPERATION 4056 4057 ;------ DETERMINE 1ST BYTE IN IOICATED ROW BY MULTIPLYING ROW VAUJE BY 40 4058 ; -.---. ( LOW BIT OF ROW DETERMINES EVEN/ODD. 80 BYTESIROki 4059 F45D B028 4060 MOV AL.40 F45F 52 4061 PUSH OX SAVE ROW VALUE A-55 LOC OBJ LINE SOURCE F460 80E2FE 4062 AND OL,OFEH ; STRIP OFF ODD/EVEN BIT F463 F6E2 4063 MUL OL ; AX HAS ADDRESS OF 1ST BYTE OF INDICATED ROW F465 SA 4064 POP OX ; RECOVER IT F466 F6CZOl 4065 TEST OL.! ; TEST FOR EVEN/ODD F469 7403 4066 JZ R" • JUMP IF EVEN ROW F46B 050020 4067 ADO AX,20DOH ; OFFSET TO LOCATION OF ODD ROWS F46E 4068 R4: ; EVEN_ROW F46E 8BFO 4069 MOV SI,AX ; MOVE POINTER TO SI F470 58 4070 POP AX j RECOVER AL VALUE F471 8BDl 4071 MOV OX,CX ; COLUMN VALUE TO OX 4072 4073 ;------ DETERMINE GRAPHICS MODE CURRENTLY IN EFFECT 4074 4075 ; SET UP THE REGISTERS ACCORDING TO THE MODE 4076 CH :: MASK FOR LOW OF COLUMN ADDRESS ( 7/3 FOR HIGHIHED RES) 4077 CL :: '" OF ADDRESS BITS IN COLUMN VALUE I 31Z FOR HIM} 4078 BL = MASK TO SELECT BITS FROM POItHED BYTE (80H/COH FOR HIM) 4079 BH :: NUMBER OF VALID BITS IN POINTED BYTE ( 112 FOR H/M) 4080 F473 66C002 4081 MOV BX,2COH F476 890203 4082 NOV CX,302H ; SET PARMS FOR MED RES F479 803E490006 4083 CMP CRT_MODE ,6 F47E n06 4084 JC R5 ; HANDLE IF MED ARES F480 BB8001 4085 MOV BX,leOH F483 890307 4086 MOV CX,703H ; SET PARMS FOR HIGH RES 4087 408e ; ------ DETERMINE BIT OFFSET IN BYTE FROM COLUMN MASK F486 4089 RS: F486 22EA 4090 AND CH,DL ; ADDRESS OF PEL WITHIN BYTE TO CH 4091 4092 ;------ DETERMINE:. BYTE OFFSET FOR THIS LOCATION IN COLUMN 4093 F488 D3EA 4094 SHR DX,CL ; SHIFT BY CORRECT AMOUNT F48A 03F2 4095 ADO SI,OX ; ItICRfHENT THE POINTER F48C 8AF7 4096 MOV DH,BH ; GET THE # OF BITS IN RESULT TO DH 4097 4098 ;------ MULTIPLY BH (VALID BITS IN BYTE) BY CH (BIT OFFSETJ 4099 F4SE 2AC9 4100 SUB CL,CL ZERO INTO STORAGE LOCATION F490 4101 R6: f490 DOC8 4102: ROR AL,1 LEFT JUSTIFY THE VALUE IN At (FOR WRITE) F492 02CD 4103 ADO CL,CH ADD I!" THE BIT OFFSET VALUE F494 HCF 4104 DEC BH LOOP CONTROL F496 75F8 4105 JNZ R6 , ON EXIT I CL HAS SHIFT COUNT TO RESTORE BITS F498 8AE3 4106 MOV AH,BL ; GET MASK TO AH F49A D2EC 4107 SHR AH,CL ; MOVE THE MASK TO CORRECT LOCATION F49C 56 4108 POP BX ; RECOVER REG F490 C3 4109 RET j RETURN WITH EVERYTHING SET UP 4110 R3 ENDP 4111 ; --------------- ----------------------------- 4112 ; SCROLL UP 4113 THIS ROUTINE SCROLLS UP THE INFORMATION ON THE CRT 4114 WTRY -- 4115 CH,CL :: UPPER LEFT CORNER OF REGION TO SCROLL 4116 OH ,OL = LOWER RIGHT CORNER OF REGION TO SCROLL 4117 BOTH OF THE ABOVE ARE IN CHARACTER POSITIONS 4118 BH = FILL VALUE FOR BLANKED LINES 4119 AL :: # LINES TO SCROLL (AL=O MEANS BLANK THE ENTIRE fIELD) 4120 OS = DATA SEGMENT 4121 ES = REGEN SEGMENT 4122 EXIT -- 4123 NOTHHIG, THE SCREEN IS SCROllED 4124 ; -- -------- ----- ------------ --- -------------- F49E 4125 PROC NEAR F49E 8A08 4126 MOV BL,AL ; SAVE LWE COUNT IN BL f4AO 8BCl 4127 MOV AX,CX ; GET UPPER LEFT POSITION INTO AX REG 4128 4129 ;------ USE CHARACTER SUBROUTINE fOR POSITIONING 4130 j------ ADDRESS RETURNED IS MULTIPLIED BY 2: FROM CORRECT VALUE 4131 F4A2 E86A02 4132 CAll GRAPH_POSN F4A5 8BFS 4133 MOV DI,AX SAVE RESULT AS DESTINATION ADDRESS 4134 4135 ;------ DETERMINE SIZE OF WINDOW 4136 A-56 lOC OBJ LINE SOURCE F4A7 ZBDI 4137 SUB DX,CX F4A9 81C20101 4138 ADD DX.I01H ; ADJUST VALUES F4AO 00E6 4139 SAL DHtl ; MULTIPLY' ROWS BY 4 SINCE 8 VERT DOTS/CHAR F4AF 00£6 4140 SAL DH,I j AND EVEN/ODD ROWS 4141 4142 ;------ DETERMINE CRT MODE 4143 F4BI 803E490006 4144 eMP TEST FOR MEDIUM RES F4B6 1304 4145 JNC FIND._SOURCE 4146 4147 ;------ MEDIUM RES UP F4BB 00£2 4148 SAL OL.! ; a'COLUMNS * 2. SINCE 2 BYTES/CHAR F4BA 01£7 4149 SAL 01.1 ; OFFSET *2: SINCE 2 BYTES/CHAR 4150 4151 ;------ DETERMINE THE SOURCE ADDRESS IN THE BUFFER F4BC 4152 R7: ; FIND_SOURCE F4BC 06 4153 PUSH ES ; GET SEGMENTS BOTH POINTING TO REGEN F4BO IF 4154 POP OS F4B£ 2A£O 4155 SUB CH,ett ; ZERO TO HIGH OF COUNT REG F4CO Don 4156 SAL BL,I ; MULTIPLY NUMBER OF LINES BY 4 F4CZ DOE3 4157 SAL BL,1 f4C4 742:0 4158 JZ RlI ; If ZERO, THEN BLANK ENTIRE FIELD F4C6 8AC3 4159 MOV AL,BL ; GET NUMBER OF LINES IN AL F4CB 8450 4160 MOV AH,BO ; 80 BYTES/ROW F4CA F6£4 4161 NUL AH i DETERMINE OFFSET TO SOURCE F4CC 8BF7 4162 MOV 51,01 ; SET UP SOURCE F4C£ 03FO 4163 ADO SI,AX ; ADO IN OFFSET TO IT F400 8AE6 4164 MOV AH,DH ; NUMBER OF ROWS IN FIE LO F402 2AE3 4165 SUB AH,BL ; DETERMINE NUMBER TO MOVE 4166 4167 ;------ LOOP THROUGH, MOVING ONE ROW AT A TIME. BOTH EVEN AND ODD FIELDS F404 4168 R8: ; ROI,C LOOP F4D4 EB8000 4169 CALL Rll i MOVE ONE ROW F4D7 81££BOIF 4170 SUB S!,2000H-80 ; MOVE TO NEXT ROW F40B 81£FBOIF 4171 SUB OI,2000H-80 F4DF FEee 4172' DEC AH ; NUMBER OF ROWS TO MOVE F4El 75Fl 4173 JNZ R. ; CONTINUE TIll ALL MOVED 4174 4175 j------ fILL IN THE VACATED LINECS) F4E3 4176 R9: ; CLEAR_ENTRY F4E3 8AC7 4177 MOV AL.BH ; ATTRIBUTE TO FILL WITH F4E5 4178 RIO: F4E5 EB8800 4179 CALL RIa ; CLEAR THAT ROW F4E8 8lEFBOIF 4180 SUB OI.2000H-80 ; POINT TO NEXT LINE F4EC FEeB 4181 DEC BL j NUMBER OF LINES TO FILL F4EE 75F5 4182 JNZ RIO ; CLEAR_LOOP F4FO E904Ft 4183 JMP VIDEO_RETURN j EVERYTHING DONE 4184 F4F3 4185 Rll: ; BLANK_FIELD F4F3 SADE 4186 MDV BL.CH ; SET BLANK COUNT TO EVERYTHING IN FIELD F4F5 EBEC 4187 JMP R' ; CLEAR THE fIELD 4188 GRAPHICS_UP ENOP 4189 ; -------------------- --------------------- --- 4190 ; SCROLL DOWN 4191 THIS ROUTINE SCROLLS DOWN THE INFORMATION ON THE CRT 4192 ENTRY -- 4193 CH,CL ::: UPPER LEFT CORNER OF REGION TO SCROll 4194 OH,DL::: LOWER RIGHT CORNER OF REGION TO SCROLL 4195 BOTH OF THE ABOVE ARE IN CHARACTER POSITIONS 4196 BH ::: FILL VALUE FOR BLANKED LINES 4197 AL ::: # LINES TO SCROLL IAL:::O MEANS BLANK THE ENTIRE FIELD) 4198 OS ::: DATA SEGMENT 4199 ES ::: REGEN SEGMENT 42:00 EXIT -- 4201 NOTHING. THE SCREEN IS SCROLLED 4202 ; --- ----------------------------------------- 4203 F4F7 42:04 GRAPHICS_DOWN PRDC NEAR F4F7 FD 42:05 STD SET DIRECTION F4F8 8AD8 42:06 MOV Bl.AL SAVE LINE COUNT IN Bl F4FA 88C2 4207 MOV AX,OX GET LOWER RIGHT POSITION INTO AX REG 4208 42:09 j------ USE CHARACTER SUBROUTINE fOR POSITIONING 4210 ;------ ADDRESS RETUR~~ED IS MULTIPLIED BY 2 FROM CORRECT VALUE 4211 F4FC E81002 4212 A-57 LOC OBJ LINE SOURCE F4FF SSFS 4213 MOV DI,AX ; SAVE RESULT AS DESTINATION ADDRESS 42:14 42:15 i------ DETERMINE SIZE OF WINDOW 4216 F501 ZBD! 4217 SUB ox.ex F503 81C20101 4~18 ADD DX,lOlH j ADJUST VALUES F507 00£6 4219 SAL DH,l ; nULTIPLY • ROWS BY '+ SINCE 8 VERT DOTS/CHAR F50' DOE6 4220 SAL DH'] ;: AND EVEN/ODD ROIolS 4221 4222 ;------ DETERI1INE CRT HODE 4223 F508 803E490006 4224 CMP ; TEST FOR HEDtUtt RES F510 7305 4225 JtIC ;: FIND_SOURCE_DOWN 4226 4227 i ------ MEDIUM RES DOWN F512 00E2 4228 SAL j • COLUMNS * 2, SINCE 2 BYTES/CHAR (OFFSET OK) F514 01E7 4229 SAL ;: OFFSET *2 SINCE 2 BYTES/cHAR F516 47 4230 INC j POINT TO LAST BYTE 4231 4232 1------ DETERt1INE THE SOURCE ADDRESS IN THE BUFFER F517 4233 R12: j FIND_SOURCE_DOWN F517 06 4234 PUSH ES ; BOTH SEGMENTS TO REGEN F518 IF 4235 POP OS FS19 UfO lt236 SUB CH,CH i ZERO TO HIGH OF COUNT REG F518 81C7FOOO 4237 ADD 01.240 ; POINT TO UST ROW OF PIXE lS F51F DOn 4218 SAL Bltl ; MULTIPLY NUMBER OF LINES BY 4 F521 DOE3 4Z39 SAL Bld f523 742E 4240 JZ RIO o IF ZERO, THEN BLANK ENTIRE fIELD F525 8AC3 4241 MOV .t.l,BL ; GET NUMBER OF LINES IN Al F527 8450 4242 MOV AH,80 ; 80 BYTESIROW F529 F6£4 4241 MUL All ; DETERMINE OFFSET TO SOURCE 4244 MOV F528 BSF7 F52:0 28FO 4245 SUB SI,DI SI,AX ,j SET UP SOURCE SUBTRACT THE OFFSET F52F 8A£6 4246 Mav AH.DH ; NUMBER DF ROt.5 IN FIELD F531 ZAn 4247 SUB AH,Bl ;: DETERMINE NUMBER TO MOVE 42lt8 4249 ;------ LOOP THROUGH. MOVING ONE ROW AT A TIME. BOTH EVEN AND ODD FIELDS F533 4250 Rll: ; ROW_lOOP_DOIolN F533 £82100 4251 CALL R17 I MOVE atlE ROW F536 81EE5020 4252 SUB 51.2000H"80 i MOVE TO NEXT ROW f53A 8lEFSOZa 4253 SUB OI,2000H .. OO F53£ FEee 4254 DEC AH ; NUMBER OF ROWS TO I10YE F540 7Sf! 4255 JNZ R13 ;: CONTINUE TILL ALL HOVED 4256 4257 j------ FILL IN THE VACATED LINE(S) F542 4258 R14: j CLEAR_ENTRCOOWH F542: 8AC7 4259 Mev Al,BH ; ATTRIBUTE TO FILL WITH FSitlt 4260 RIS: ; CLEAR_LOOP_DOWN F544 E82900 4261 CALL R1S i CLEAR A ROW F547 81 £f502:0 4262 SUB DI.2000H+80 j POINT TO NEXT LINE F548 FEte 4263 DEC BL ; NUMBER OF LINES TO FIll FS4D 75F5 4264 JHZ R15 ; CLEAR_LOOP_DOI,IN F54F FC 4265 CLD ; RESET THE DIRECTION flAG F550 E974Ft 4266 JMP VIDEO_RETURN ; EVERYTHING DONE 4267 F553 4268 R16: ; BLAtlK]IElD_DDWN F553 8ADE 4269 MOV Bl,OH ; SET BLANK COUNT TO EVERYTHING IN FIELD F555 EBES 4270 JMP R14 ; CLEAR THE FIELD 4271 GRAPHICS_DOWN ENOP 4212 4273 ;~----- ROUTINE TO MOVE ONE ROW OF INFORMATION 4274 F557 4275 R17 .. DC NEAR F557 BACA 4276 MOV CL~Dl ; NUMBER OF BYTES IN TItE ROW F559 56 4277 PUSH SI F55.57 42:78 PUSH 01 ; SAVE POINTERS FSS8 F3 42.79 REP MOYSB ; MOVE THE EVEN FIElD F55C 1.4 FS5D SF 4280 POP 01 f55E 5£ 4281 POP SI FSSF 81C6002.0 42.82 ADD SI.2000H F563 81C70020 4263 ADD Dt.2000H ; POINT TO TltE ODD FIELD F567 56 4284- PUSH SI F568 57 4285 PUSH 01 ; SAVE THE POINTERS F569 8ACA 4286 NOV Cl,Dl ; COUNT BACK A-58 LOC OBJ LINE SOURCE FS6B F3 4287 REP Movsa MOVE THE ODD FIELD F56C A4 F560 5F 4288 POP 01 F56E SE 4289 POP S1 ;. POINTERS BACK F56F C3 4290 RET ; RETURN TO CALLER 4291 RI7 ENDP 4292 4293 ; ------ CLEAR A SINGLE ROW 4294 F570 4295 RI8 PROt NEAR F570 BACA 4296 MOV Cl.OL ; NUMBER OF BYTES IN FIElD F572 57 4297 PUSH 01 ; SAVE POINTER F573 F3 4298 REP STose ; STORE THE NEW VALUE F574 AA F575 SF 4299 POP 01 POINTER BACK F576 81C70020 4300 ADD 01. ZODOH ; POINT TO ODD FIElD F57A 57 4301 PUSH 01 F57B BAtA 4302 HOV Cl.Ol FS7D F3 4303 REP STOSS FILL THE 000 FILElD F57E AA F57f SF 4304 POP DI F580 C3 4305 RET ; RETURN TO CALLER 4306 RIB ENDP 4307 ; --------------------------------- ----------- 4308 ; GRAPHICS WRITE 4309 THIS ROUTINE WRITES THE ASCII CHARACTER TO THE CURRENT 4310 POSITION ON THE SCREEN. 4311 ENTRY -- 4312 AL = CHARACTER TO "''RITE 4313 BL = COLOR ATTRIBUTE TO BE USED FOR FOREGROUND COLOR 4314 IF BIT 7 IS SET, THE CHAR IS XOR '0 INTO THE REGEN BUFFER 4315 (0 IS USED FOR THE BACKGROUND COLOR) 4316 CX :: NUMBER OF CHARS TO WRITE 4317 DS::; DATA SEGMENT 4318 ES ::; REGEN SEGNENT 4319 EXIT -- 4320 NOTHING IS RETURNED 4321 4322 GRAPHICS READ 4323 THIS ROUTINE REAOS THE ASCII CHARACTER AT TIlE CURRENT CURSOR 4324 POSITION ON THE SCREEN BY MATCHING THE DOTS ON THE SCREEN TO THE 4325 CHARACTER GENERATOR CODE POINTS 432:6 ENTRY -- 4327 NONE lOIS ASSUMED AS THE BACKGROUND COLOR 4328 EXIT -- 4329 AL = CHARACTER READ AT THAT POSITION (0 RETURNED IF NONE FOlJI'ID) 4330 4331 FOR BOTH ROUTINES. THE INAGES USED TO FORN CHARS ARE CONTAINED IN ROM 4332 FOR THE 1ST 128 CHARS. TO ACCESS CHARS IN THE SECOND HALF. THE USER 4333 MUST INITIALIZE THE VECTOR AT INTERRUPT IfH (LOCATION 0007CH J TO 4334 POWT TO THE USER SUPPLIED TABLE OF GRAPHIC IMAGES (8Xe BOXESI. 4335 FAILURE TO DO SO WILL CAUSE IN STRAtlGE RESULTS 4336 ; ------------ -------------------------------- 4337 ASSUME CS:CODE.DS:DATA,ES:DATA f5Bl 4338 GRAPHICS_a..iRITE PROC NEAR FS81 8400 4339 MOV AH,O ; ZERO TO HIGH OF CODE POINT F583 50 4340 PUSH AX ; SAVE CODE POINT VALUE 4341 4342 ;------ DETERMINE POSITION IN REGEN BUFFER TO PUT CODE POINTS 4343 F584 E86501 4344 CAU 526 ; FINO lOCATION IN REGEN BUFFER F587 88F8 4345 MOV OI.AX ; REGEN POINTER IN 01 4346 4347 i------ DETERMINE REGION TO GET CODE paWlS FROM 4348 F589 5& 4349 POP AX RECOVER CODE POINT F58A 3eBO 4350 CHP AL.80H IS IT IN SECOND HALF Fsec 7306 4351 JAE 51 YES 4352 4353 ;------ IMAGE IS IN FIRST HALF. CONTAINED IN ROM 4354 F58E BE6EFA 4355 HOV SI,OFAbEH ; OFFSET CRT_CHAR_GEN-OffSET Of IMAGES F591 DE 4356 PUSH OS ; SAVE SEGMENT ON STACK f592 ESOF 4357 JHP SHORT S2 ; DETERMINE_MODE 4358 A-59 LOC OBJ LINE SOURCE 4359 ;------ IMAGE IS IN SECOND HALF. IN USER RAM 4360 F594 4361 SI: EXTEND_CHAR F594 2CBO 4362 SUB AL,80H ZERO ORIGIN FOR SECOND HALF F596 IE 4363 PUSH os SAVE DATA POINTER F597 2BF6 4364 SUB SI.SI F599 BEDE 4365 MOV 05.51 ESTABLISH VECTOR ADD~ESSING 4366 ASSUME OS: ABSD F59B C5367COO 4367 LOS SI.EXT_PTR GET THE OFFSET OF THE TABLE F59F 8COA 4368 MOV OX.OS GET THE SEGMENT OF THE TABLE 4369 ASSUME OS:OATA FSAI IF 4370 POP OS ; RECOVER DATA SEGMENT F5AZ 52 4371 PUSH OX j SAVE TABLE SEGNENT ON STACK 4372 4373 j------ DETERNINE GRAPHICS MODE IN OPERATION 4374 FSA3 4375 52: D£TERMINE_MOOE FSA3 OlEO 4376 SAL AX,l MULTIPLY CODE POINT F5AIi OlEO 4377 SAL AX,l VALUE BY 8 FSA7 DIED 4378 SAL AX,1 F5A9 03FO 4379 ADD SI.AX j 51 HAS OFFSET OF DESIRED CODES FSAB 803E490006 4380 CMP F5BO IF 4381 POP OS RECOVER TABLE POINTER SEGMENT F5BI 7:?:2C 4382 JC 57 TEST FOR MEDIUM RESOLUTION MODE 4383 4384 ;------ HIGH RESOLUTION MODE FSB3 43~5 53: ; !,UGH_CHAR FSB3 57 4386 PUSH [II ;. SAVE REGEN POINTER FSB4 56 4387 PUSH SI • SAVE CODE POINTER F5BS 8604 4388 MOV ; NUMBER OF TIMES THROUGH lOOP FSB7 4389 54: FSB7 AC 4390 LOoSB ; GET 'lYTE FROM CODE POINTS F5B6 F6C380 4391 TEST BL,~"'~ ; SHOULD WE USE TilE FUNCTION FSBB 7516 4392 JNZ 56 TO PUT CHAR IN FSBD AA 4393 STOSB STORE IN REGEN BUFFER FSBE AC 4394 lODSB F5SF 4395 FSBF 26888SFFlF 4396 MOV ES:(DI ... 2000H-IJ,AL ; STORE IN SECOND HALF FSC4 83C74F 4397 ADD 01,79 ; MOVE TO NEXT ROW IN REGEN F5C7 FECE 4398 DEC DH ; DONE WITH LOOP F5C9 75EC 4399 JNZ 54 F5CB 5E 4400 POP S! F5CC SF 4401 POP 01 RECOVER REGEN POINTER FSCD 47 4402 INC 01 POINT TO NEXT CHAR POSITION F5CE E2E3 4403 LOOP S3 MORE CHARS TO WRITE FSDO E9F4FB 4404 4405 FSD3 4406 56: F5D3 263205 4407 XOR AL.ES:tDIJ EXCLUSIVE OR WITH CURRENT FSD6 AA 4408 STOSS STORE THE CODE POINT FSD7 AC 4409 loose AGAIN FOR ODD FIElD FSD8 2632BSFFlF 4410 XOR Al.ES:[OI-t2:000H-IJ FSOO EBEO 4411 JMP 55 • BACK TO MAINSTREAM 4412 4413 j------ HEOIUM RESOLUTION WRITE FSOF 4414 57: ; MED_RES_WRITE F5QF 8A03 4415 HOV Ol.Sl SAVE HIGH COLOR BIT FSEI OlE7 4416 SAL 01.1 OfFSET*2 SINCE 2 BYTES/CHAR FSE3 E80100 4"+17 CALL SI9 EXPAND BL TO FUll WORD Of COLOR F5E6 4418 S8: MED_CHAR F5E6 57 "+419 PUSH 01 SAVE REGEN POINTER F5E7 56 4420 PUSH Sl ; SAVE THE CODE POINTER F5EB B604 442:1 MOV DH.4 NUMBER OF lOOPS FSEA 4422 FSEA AC 442:3 LODSS GET CODE POINT F5EB E80EOO 4424 CAll 521 DOUBLE UP All THE BITS F5EE 23C3 4425 AND Ax.ex CONVERT THEM TO FOREGROUND COLOR ( 0 BACK J F5FO F6C2:80 4426 TEST Dl.80H • IS THIS XOR FUNCTION F5F3 7407 4427 JZ 510 ; NO, STORE IT IN AS IT IS FSfS 263Z25 4428 XOR AH,ES:[Qll ;, DO FUNCTION WITH HALF F5F8 26324501 4429 XOR AL,ES: [01+1 ] ; AND WITH OTHER HALF F5FC 4430 510: f5FC 268825 4431 HOV ES:[OI1,AH j STORE FIRST BYTE F5FF 26884501 4"+32 MOV ES:!OI+IJ.Al ;, STORE SECOND BYTE F603 AC 4433 loose ; GET CODE POINT F604 E8C500 4434 CAll S21 A-60 LOC OBJ llNE SOURCE f607 23C3 4435 AND AX,ex ; CONVERT TO COLOR F609 F6C280 4436 TEST Ol,BaH ; AGAIN, IS THIS XOR FUNCTION F60C 740A 4437 JZ Sl1 ; NO. JUST STORE THE VALUES F60E 2632A500Z0 4438 XOR AH, ES: lDI+2000H ] FUNCTION WITH FIRST HALF F613 26328501Z0 4439 XQR A.L.E5:[OI+2001H] ; AND WITH SECOND HALF F618 4440 511: F618 2688A50020 4441 MOV ES: [DI+2000H I,AH F61D 2688850120 4442 MOV E5: [DI+2000H+l J .AL ; STORE IN SECOND PORTION OF BUFFER F6ZZ 83C750 4443 ADO 01,80 ; POINT TO NEXT LOCATION F625 FEeE 4444 DEC DH F627 75tl 4445 JNZ 59 ; KEEP GOING F629 5E 4446 POP SI ; RECOVER CODE PONTER F62A SF 4447 POP 01 ; RECOVER REGEN POINTER F62B 83C702 4448 ADD DI.;?: ; POINT TO NEXT CHAR POSITIOH F62E EZ.B6 4449 lOOP 58 ; HORE TO WRITE F630 E994FB 4450 JHP VIDEO_RETlnm 4451 GRAPHICS_WRITE WOP 4452 ; ------ -------- -- - ---------------- _____ _ 4453 ; GRAPHICS READ 4454 ; -- ---- ----- ---- ------------------------- F633 4455 GRAPHICS_READ PROt NEAR F633 E80600 4456 CALL 526 ; CONVERTED TO OFfSET IN REGEN F636 8BFO 4457 MOV 51.AX j SAVE IN 51 F638 83Ee08 4458 SUB SP.8 ; ALLOCATE SPACE TO SAVE THE READ CODE POINT F63B 8BEt 4459 MOV BP.SP POINTER TO SAVE AREA 4460 4461 ; ------ DETERMINE GRAPHICS MODES 4462 f630 803E490006 4463 CNP CRT_MOOE.6 F642 06 4464 PUSH ES f643 If 4465 POP OS ; POINT TO REGEN SEGHENT F644 721A 4466 JC 513 j MEDIUM RESOLUTION 4467 4468 ;------ HIGH RESOLUTION READ 4469 4470 ;------ GET VALUES fROM REGEN BUffER AND CONVERT TO CODE POINT F646 6604 4471 MOV DH,4 ; NUMBER OF PASSES F648 4472 SIZ: F648 8A04 4473 HOV AL'[SIJ ; GET FIRST BYTE F64A 884600 4474 MOV [BPhAl ; SAVE IN STORAGE AREA F640 45 4475 INC BP j NEXT LOCATION F64E 8A840020 4476 MOV Al.[SI+2000Hl ; GET LOWER REGION BYTE F652 684600 4477 HOV [BP I .AL j ADJUST AND STORE f655 45 4478 INC BP F656 83t650 4479 AOD 51.80 ; POINTER INTO REGEN F659 FECE 4480 DEC DH LOOP CONTROL F65B 75E6 4481 JNZ S12 DO IT SOME MORE F65D E61790 4482 JMP 515 GO MATCH THE SAVED CODE POINTS 4483 4484 ; ------ MEDIUM RESOLUTION READ f660 4485 S13: MED_RES_READ F660 o1E6 4486 SAL 51,1 OFFSETJf2 SWCE .2 BYTES/CHAR F662 B604 4487 MOV DH,4 NUMBER OF PASSES F664 4488 514: F664 E88800 44B9 CALL 523 ; GET PAIR BYTES FROM REGEN INTO SINGLE SAVE f667 81C60020 4490 ADD 51. ZOOOH ; GO TO LOWER REGION F668 E88100 4491 CALL 523 ; GET THIS PAIR INTO 5AVE F66E 8lEEBOIF 449Z SUB SI,2aDOH-BO ; ADJUST POINTER BACK INTO UPPER F672 FECE 4493 DEC QH F674 75EE 4494 JNZ 514 ; KEEP GOING UNTI l ALL 8 DONE 4495 4496 ;-------- SAVE AREA HA.S CHARACTER IN IT. MATCH IT F676 4497 SIS: ; FIND_CHAR F676 BF6EFA 4498 MOV o1.OfA6EH ; OFfSET CRT_CHAR_GEN-ESTA6lISH ADDRESSING F679 DE 4499 PUSH CS F67A 07 4500 POP ES ; CODE POINTS IN C5 F67B 83EDD8 4501 SUB BP.8 ; ADJUST POINTER TO BEGINNING OF SAVE AREA F67E 8BFS 4502 MOV SI.BP F680 FC 4503 CLD ; ENSURE DIRECTION F681 BOOO 4504 MOV A.l.O CURRENT CODE POINT BEING HA.TCHED F683 4505 S16: F683 16 4506 PUSH 5S ESTABLISH ADDRESSING TO STACK F684 IF 4507 POP OS fOR THE STRING COMPARE F685 BA8000 4508 HOV OX,12S ; NUMBER TO TEST AGAINST F688 4509 517: F688 56 4510 PUSti 51 ; SAVE SAVE AREA. POINTER A-61 laC OBJ LINE SOURCE F689 57 4511 PUSH 01 ; SAVE CODE POINTER F68A B90800 4512 MOV CX.8 ; NUMBER OF BYTES TO MATCH F68D f3 4513 REPE CMPSB ; COMPARE THE 8 BYTES F6BE A6 F68F SF 4514 POP 01 ; RECOVER THE POINTERS F690 5E 4515 POP 51 F691 7'tIE 4516 Jl 518 I IF ZERO FLAG SET. THEN MATCH OCCURRED f693 FEeD 4517 INC AL ; NO MATCH. HOVE ON TO NEXT F695 83e708 4518 ADD 01.8 I NEXT CODE POINT F698 4A 4519 DEC OX ; LOOP CONTROL F699 75EO 4520 JNl 517 ; 00 All OF THEM 4521 4522 j------ CHAR NOT MATCHED. MIGHT BE IN USER SUPPLIED SECOND HALF 4523 f69B 3eoo 4524 eM? AL.O ; AlO 0 IF ONLY 1ST HALF SCANNED F690 7412 4525 JE 518 IF = 0, THEN ALL HAS BEEN SCANNED F69F 28eo 4526 SUB AX.AX F6Al 8E08 4527 MOV OS,AX ESTABLISH ADDRESSING TO VECTOR 4528 ASSUME DS:ABSO F6A3 C43E7COO 4529 LES OI,EXT_PTR ; GET POINTER F6A7 Beeo 4530 MOV AX.ES ; SEE IF THE POINTER REALLY EXISTS F6A9 OBC7 4531 OR AX,DI ; IF ALL O. THEN DOESN I T EXIST F6AB 740ct 4532 JZ 518 ; NO SENSE LOOKING F6AD 8080 4533 MOV AL,l2S ; ORIGIN FOR SECOND HALF F6AF EB02: 4534 JMP 516 ; GO BACK AND TRY FOR IT 4535 ASSUME OS:OATA 4536 4537 ;---.-- CHARACTER IS FOUND ( Al=O I f NOT FOUND ) F6Bl 4538 518: F661 83C408 4539 ADD ; READJUST THt STACK. THR~ AWAY SAVE F684 E910FB 4540 JM? ; ALL ~ONE 4541 GRAPHICS_READ ENDP 4542 ; --------- ~----- -- --- ---------------.-------- 4543 EXPAND_MED_COLOR 4544 THIS ROUTINE EXPANDS THE LOW 2 BITS IN BL TO 4545 FIll THE ENTIRE BX REGISTER 4546 ENTRY -- 4547 BL = COLOR TO BE USEQ ( LOW 2 BITS ) 4548 EXIT -- 4549 ex = COLOR TO BE USED ( 8 REPLICATIONS OF THE 2: COLOR BITS I 4550 ;-------------------------------------------- F6B7 4551 519 PROC NEAR F6B7 BOE303 4552 AND BL.3 ; ISOLATE THE COLOR BITS f6BA BAC3 4553 MOV Al.BL , COpy TO Al F6se 51 4554 PUSH ex SAVE REGISTER F6BD B90300 4555 MOV eX.:3- ; NUMBER OF TIMES TO 00 THIS F6eo 4556 S20: F6CO ODED 4557 SAL AL.! F6C2 ODED 4558 SAL AL,l lEFT SHIFT BY 2 F6C4 OADB 4559 OR Bl.Al ANOTHER COLOR VERSION INTO Bl F6C6 E2FB 4560 LOOP 520 FILL ALL OF BL F6tB BAfB 4561 MOV BH.Bl FILL UPPER PORTION F6CA 59 4562 PO? ex ; REGISTER BACK F6CB C3 4563 RET ; ALL DONE 4564 519 EtlOP 4565 ; -- -- - - -------------- -------------- - --------- 4566 EXPAND_BYTE 4567 THIS ROUTIt~E TAKES THE BYTE IN AL AND DOU6LES ALL 4568 OF THE BITS, TURNING THE 8 BITS INTO 16 BITS. 4569 THE RESULT IS LEFT IN AX 4570 ; ----- --- --- --------- --------------_._------- F6tt 4571 521 PROC UEAR F6CC 52: 4572 PUSH OX ; SAVE REGISTERS F6CD 51 4573 PUSH ex F6CE 53 4574 PUSH BX F6CF BAOOOO 4575 MOV DX.O j RESULT REGISTER F602 890100 4576 MOV CX.l • MASK REGISTER F6D5 4577 522: F605 8808 4578 MOV BX.AX ; BASE INTO TEMP F6D7 2309 457'9 AND eX,ex ; USE MASK TO EXTRACT A BIT F609 0803 4580 DR DX,BX ; PUT INTO RESULT REGISTER F608 DIED 4581 5HL AX.l F600 01El 4582 5HL CX,! ; SHIfT BASE AND MASK BY 1 F6DF 880B 4583 MOV BX.AX ; BASE TO TEMP FoE! 2309 4584 AND ax,cx EXTRACT THE SAME BIT F6B OB03 4585 OR OX,BX ; PUT INTO RESULT A-62 lOC OBJ LINE SOURCE F6E5 olEl 4586 SHl ex. 1 SHIFT ONLY MASK NOW. MOVING TO NEXT BASE F6E7 73fC 4587 JNC 522 USE MASK BIT COMING OUT TO TERMINATE f6E9 aBez 4588 HOV AX.OX I RESULT TO PARM REGISTER f6EB 58 4589 POP BX F6EC 59 4590 POP CX ; RECOVER REGISTERS F6EO SA 4591 POP ox F6£E C3 4592 RET ; ALL DONE 4593 S21 EtlDP 4594 I ------ --- ----------------------------------- 4595 ; I1ED_READ_BYTE 4596 THIS ROUTINE WIll TAKE 2: BYTES FROM THE REGEN BUFFER. 4597 COMPARE AGAINST THE CURRENT FOREGROUND COLOR. AND PLACE 4598 THE CORRESpmmlNG ON/OFF BIT PATTERN INTO THE CURRENT 4599 POSITION IN THE SAVE AREA 4600 ENTRY -- 4601 S1,OS = POINTER TO REGEN AREA OF INTEREST 4602 ex = EXPANDED FOREGROUND COLOR 4603 BP = POINTER TO SAVE AREA 4604 EXIT -- 4605 BP IS INCPEMENT AFTER SAVE 4606 ; ------------- ---------- ----------- ---------- F6EF 4607 S21 PROC NEAR F6EF 8A24 4608 HOV AH.[SIJ i GET FIRST BYTE F6Fl BA44Dl 4609 HOV AL.[Shll ; GET SECOND BYTE F6F4 8900CO 4610 HOV CX.OCOOOH ; 2 BIT MASK TO TEST THE ENTRIES F6f7 6200 4611 HOV DL.O ; RESULT REGISTER F6F9 4612 S24: F6F9 85CI 4613 TEST AX,CX ; IS THIS SECTION BACKGROUND? F6FB Fa 4614 elC ; CLEAR CARRY IN HOPES THAT IT IS F6FC 7401 4615 JZ 525 ; IF ZERO, IT IS BACKGROUND F6FE F9 4616 STC ; WASH' T, SO SET CARRY F6FF 0002 4617 525: Rel OLd ; MOVE THAT BIT INTO THE RESULT F70! 01E9 4618 SHR CXol F703 01E9 4619 SHR CX.l ; MOVE THE MASK TO THE RIGHT BY 2 BITS F705 73F2 4620 JNC 52. ; DO IT AGAIN IF MASK DIDN'T FALL OUT F707 885600 4621 HOV (BP),OL ; STORE RESULT IU SAVE AREA f70A 45 4622 mc BP ; ADJUST POINTER nOB C3 4623 RET ; ALL DONE 4624 523 Etmp 4625 ; -- -------- - ---- ---------------------- ---- 4626 V4_POSITIOH 4627 THIS ROUTINE TAKES THE CURSOR POSITION CONTAINED IN 4628 THE MEMORY LOCATION. AND CONVERTS IT INTO AN OFFSET 4629 INTO THE REGEN BUFFER. ASSUMING ONE BYTE/CHAR. 4630 FOR MEDIUM RESOLUTION GRAPHICS. THE NUMBER MUST 4631 BE DOUBLED. 4632 ENTRY -- NO REGISTERS,MEMORY LOCATION CURSOR POSH IS USED 4633 EXIT-- 4634 AX CONTAINS OFFSET INTO REGEN BUFFER 4635 j--------------------------------- -------- F10e 4636 S26 PROC NEAR FlOC A15000 4637 HOV AX,CURSOR_POSN ; GET CURRENT CURSOR F70F 4638 GRAPH_POSN LABEL NEAR F70F 53 4639 PUSH BX ; SAVE REGISTER F710 8808 4640 HOV BX.AX ; SAVE A COPY OF CURRENT CURSOR F712 8AC4 4641 MOV AL.AH ; GET ROWS TO AL F714 F6264AOO 4642 HUl BYTE PTR CRT_COLS truL TIPL Y BY BYTES/COLUMN F7l8 DIED 4643 SHl AX.l NUL TIPl Y * 4 SINCE 4 ROWSIB'l'TE F7lA DIED 4644 SHl AX.l F71C 2AFF 4645 SUB BH.BH ISOLATE COLUMN VALUE f71E 03C3 4646 AOD AX,BX DETERMINE OFfSET fno 58 4647 POP BX RECOVER POINTER F7Z1 C3 4648 RET ALL OONE 4649 S26 ENDP 4650 ; ---- ---------------------------------------- 4651 WRITE_TTY 4652 THIS INTERFACE PROVIDES A TELETYPE LIKE INTERFACE TO THE 4653 VIDEO CARD. THE INPUT CHARACTER IS WRITTEN TO THE CURRENT 4654 CURSOR POSITION, AND THE CURSOR IS MOVED TO THE NEXT POSITION. 4655 IF THE CURSOR LEAVES THE LAST COLUMN OF THE FIELD. THE COLUMN 4656 IS SET TO ZERO, AND THE ROW VALUE IS INCREMENTED. IF THE ROW 4657 ROW VALUE LEAVES THE FIELD, THE CURSOR IS PLACED ON THE LAST ROW. 4656 FIRST COLUMN. AND THE ENTIRE SCREEN IS SCROLLED UP ONE LWE. 4659 WHEN THE SCREEN IS SCROLLED UP. THE ATTRIBUTE FOR fILLING THE 4660 NEWLY BLANKED LINE IS READ FROM THE CURSOR POSITION ON THE PREVIOUS 4661 LINE BEFORE THE SCROLL, IN CHARACTER MODE. IN GRAPHICS HaDE, A-63 LOC OSJ LINE sou RCE 4662 THE 0 COLOR IS USED. 4663 ENTRY -- 4664 I AH ) = CURRENT CRT MODE 4665 (AL) = CHARACTER TO BE WRITTEN 4666 NOTE THAT BACK SPACE. CAR RET. BELL AND LINE FEED ARE HANDLED 4667 AS COMMANDS RATHER THAN AS DISPLAYABLE GRAPHICS 4668 (Bll "" FOREGROUND COLOR FOR CHAR WRITE I f CURRENTLY IN A GRAPHICS MODE 4669 EXIT -- 4670 ALL REGISTERS SAVED 4671 ; ---- ----- ------ - ------------------- -- -- ----- 4672 ASSUME CS:COOE,OS:DATA F722 4673 WRITE_TTY PROC NEAR F722: 50 4674 PUSH AX SAVE REGISTERS F723 50 4675 PUSH AX ; SAVE CHAR TO WRITE F72:4 6403 4676 MOV AH,3 F726 COlO 4677 INT lOH ; READ THE CURRENT CURSOR POSITION F72:6 56 4678 POP AX ; RECOVER CHAR 4679 4680 ;------ OX NOW HAS THE CURRENT CURSOR POSITION 4681 Fn9 3e06 4682 CNP AL.a ; IS IT A BACKSPACE F72B 7459 4683 JE U8 ; BACK_SPACE F72D 3eOD 4684 CNP AL.OOH ; IS IT CARRIAGE RETURN F72F 745E 4685 JE U9 ; CAR_RET F731 3COA 4686 CNP AL,OAH IS IT A LINE FEED F733 745E 4687 JE UI0 LINEJEEO F735 3C07 4686 Cf1P AL.07H IS IT A BELL F737 7461 4689 JE Ull BELL 4690 4691 ;------ WRITE THE CHAR TO THE SCREEN 4692 F739 8A3E6Z00 4693 MOV BH .ACTIVE~PAGE ; GET THE CURRENT ACTIVE PAGE F73D 840A 4694 MOV AH • lO ; I-lR HE CHAR ONLY F73F B90100 4695 Mav eX.l ;: ONLY ONE CHAR f742 COlO 4696 INT lOH ;: WRITE THE CHAR 4697 4698 ; ------ POSITION THe: CURSOR FOR NEXT CHAR 4699 F744 FEel 4700 INC DL F746 3.6oI64AOO 4701 CMP OL.BYTE PTJ( CRT~COLS ; TEST FOR COLUMN OVERFLOW F74A 7536 4702 JNZ U7 ; SET_CURSOR F74C B200 4703 NOV OL.O ; COLUMN FOR CURSOR F74E BOFEIS 4704 CMP DH.24 F751 7520 4705 JNZ U6 4706 4707 ;------ SCROLL REQUIRED F753 4708 U1: 4709 F753 8402 4710 MOV AH.2 F755 8700 4711 MOV BH,O F157 COlO 4712 INT 10" ; SET THE CURSOR 4713 4714 ; ------ DETERMINE VALUE TO FILL WITH DURING SCROLL 4715 F759 ,6,04900 4716 NOV AL,CRT_MODE ; GET THE CURRENT MODE F75C 3(04 4717 CMP AL.4 F75E 7206 4718 JC U2 ;. READ-CURSOR F7bD 3C07 4719 CMP AL,7 F762 B700 4720 MOV BH,O ; FI LL WITH BACKGROUND F764 7506 4721 JHE U3 ; SCROLL-UP 4722 F766 4723 U2: READ-CURSOR F766 8408 4724 NOV AH,8 F76G COlO 4725 INT 10H READ CHAR/ATTR AT CURRENT CURSOR F76A SAFe 4726 NOV BH.AH ; STORE IN BH 4727 F76C 4728 U3: ; SCROLL-UP F76C e80106 4729 NOV AX,60lH ; SCROLL ONE LINE F76F 890000 4730 NOV CX,O ; UPPER LEFT CORNER F772 8618 4731 NOV DH ,24 ; LOWER RIGHT ROW F774 6A164.6oOO 4732 NOV DL,BYTE PTR CRT_COLS ; LOWER RIGHT COLUI1N F778 fECA 4733 OEC OL f77A 4734 U4: ; VIOEO~CALL-RETURH F77A COlO 4735 INT 10H ; SCROlL UP THE SCREEN F77C 4736 us: ; TTY~RETURN F77C 58 4737 POP AX ; RESTORE THE CHARACTER A-64 LOC OBJ LINE SOURCE Fno E947FA Fl8D F7SD FEC6 F782 Fl6Z 8402 F784 EBF4 F7a6 us: F7a6 BOFAOO eMP Dl,O ALREADY AT END OF LINE F7B9 74F7 JE U7 F7BB FECA DEC Ol NO -- JUST NOVE IT BACK F7S0 EBn 4752 JMP U7 {t753 4754 ;~----- CARRIAGE RETURN fOUND 4755 F7BF 4756 U9: F78F B200 4757 MOV Dl.O ; MOVE TO FIRST COLUMN F791 EBEF 4758 JHP U7 SET_CURSOR 4759 4760 j------ LINE fEED FOUND 4761 F793 4762 U10: F793 80FElS 4763 eMP DH.2.4 ; BOTTOM OF SCR E EN F796 75E8 4764 JNE U6 YES. SCROLL THE SCREEN F798 EBB9 4765 JMP Ul j NO. JUST SET THE CURSOR 4766 4767 j------ BELL FOUND 4768 F79A 4769 U11: F79A 8302 4770 MOV SL.G SET UP COUNT FOR BEEP F79C E8C7EE 4771 CALL BEEP SOUND THE POD BE LL F79F EBDB 4772 JMP US TTY]ETURN 4773 ENDP 4774 ; -- - ----- ------------------------ -- --- ------ 4775 LIGHT PEN 4776 THIS ROUTINE TESTS THE LIGHT PEN SWITCH ANn THE LIGHT 4777 PEN TRIGGER. IF BOTH ARE SET, THE LOCATION OF THE LIGHT 4778 PEN IS DETERMINED. OTHERWISE, A RETURN WITH NO INFORMATION 4779 IS MADE. 4760 ON EXIT: 4781 (AH I = 0 IF NO LIGHT PEN INFORMATION IS AVAILABLE 4782 BX,ex,Ox ARE DESTROYED 4763 (AH) 1 IF LIGHT PEN IS AVAILABLE 4784 {DH,OU :; ROw,COLUMN OF CURRENT LIGHT PEN POSITION 4785 {CH , :; RASTER POSITION 4786 (ex) = BEST GUESS AT PIXEL HORIZIDfTAL POSITION 4787 ; -- -- ---- --------- ---- -- ---- -- - -------- -- -- -- 4786 ASSUME es:eOOE,OS:DATA 4789 j------ SUBTRACT_TABLE FlA.I 4790 Vl LABEl BYTE FlAI 0303050503030304 4791 DB 3.3,5.5,3,3,3,4 F7A9 4792 READ_lPEN PROC NEAR 4793 4794 j------ WAIT FOR LIGHT PEN TO BE DEPRESSED 4795 F7A9 8400 47?6 MOV AH,O ; SET NO LIGHT PEN RETURN CODE F7AB 86166300 4797 MOV OX, ADDR_6645 GET BASE ADDRESS OF 6845 F7AF 83C206 4798 ADO DX.6 POINT TO STATUS REGISTER F7B2 EC 4799 IN AL,OX GET STATUS REGISTER F7B3 40804 4800 TEST AL.4 TEST LIGHT PEt~ SWITCH F7BS 7578 4801 JNZ V6 NOT SET, RETURN 4802 4803 j------ NOW TEST FOR LIGHT PEN TRIGGER 4804 F7B7 A802 4805 TEST AL,2 TEST LIGHT PEN TRIGGER F7B9 747E 4806 Jl V7 RETURN WITHOUT RESETTING TRIGGER 4807 4808 ;------ TRIGGER HAS BEEN SET. READ THE VALUE IN 4809 F7BB 8410 4810 NOV AH,16 ; LIGHT PEN REGISTERS ON 6845 4811 4812 j------ INPUT REGS POIUTED TO BY AH, AND CONVERT TO ROW eOLUMN IN ox F7SD 8Bl6630rJ rlov ; JlOORESS REGTSTEP FOR 6845 A-65 LOC OBJ LINE SOU RCE nCI 8AC4 4815 HOV AL.AH I REGISTER TO READ F7C3 EE 4816 OUT OX.AL ; SET IT UP F7C4 42 4817 INC OX ; DATA REGISTER F7C5 EC 4818 IN AL.DX ; GET THE VALUE f7c6 8AE8 4619 MOV CH.AL ; SAVE IN CX F7Ca 4A 4820 DEC OX ; ADDRESS REGISTER F7C9 FEC4 4821 INC AH F7Ca 8AC4 4822 MOV AL,AH ; SECOND DATA REGISTER F7CD EE 4823 OUT DX.AL F7CE 42 4824 INC OX ; POINT TO DATA REGISTER F7CF EC 4825 IN AL,DX ; GET SECOND DATA VALUE F700 8AE5 4826 MOV AH,CH ; AX HAS INPUT VALUE 4827 4828 ; ------ AX HAS THE VALUE READ IN FROM THE 6845 4829 f7D2 6AIE4900 4830 MOV BL,CRT_MODE F706 2AFF 4831 SUB BH.BH ; MODE VALUE TO BX F708 ZE8A9FAIF7 4832 MOV 6L,CS:V1l6Xl ; DETERMINE AMOlMT TO SUBTRACT F70D 26C3 4833 SUB AX,ex ; TAKE IT AWAY f7DF 2B064EOO 4834 SUB Ax.eRT_START ; CONVERT TO CORRECT PAGE ORIGIN F7E3 7903 4835 JNS V2 IF POSITIVE. DETERMINE MODE PES B80000 4636 MOV AX,O ; <0 PLAYS AS 0 4837 4838 ;------ DETERMINE HaDE OF OPERATION 4839 F7Ea 4840 V2: DETERMINE HODE F7EB 8103 4841 MOV CL,3 SET *8 SHIfT COlMT F7EA 603E490004 4842 CMP DETERMINE IF GRAPHICS OR ALPHA F7EF 722.11.. 4843 J8 ; ALPHA_PEN F7Fl 803E490007 4844 CMP F7F6 7423 4845 JE V4 4846 4847 ;------ GRAPHICS MODE 4848 F7F8 BU8 4849 MOV DL,40 I OIVISOR FOR GRAPHICS F7FA F6F2 4850 DIV DL ; DETERMINE ROW(AU AND COLUMN(AH) 4851 ; .6.l RANGE 0-99, AH RANGE 0-39 4852 ;------ DETERMINE GRAPHIC ROW POSITION 4853 F7FC 8AE8 4854 MOV CH.AL SAVE ROW VALUE IN CH F7FE 02EO 4855 ADD CH,CH *2 FOR EVEN/ODD FIElD Faoo BADe 4856 HOV BL.AH COLUMN VALUE TO BX Fe02 2AFF 4857 SUB BH,8H MULTIPLY BY 8 FOR MEDILn1 RES F804 803E490006 4858 eMP CRT_MODE.6 DETERMINE MEDIUM OR HIGH RES F809 7504 4859 JNE V3 NOT_HIGH_RES FaDe 8104 4860 MOV CL,4 SHIFT VALUE FOR HIGH RES FaDO 00E4 4861 SAL AH,l COLUMN VALUE TIMES 2 FOR HIGH RES F80F 4862 V3: ~mT_HIGH_RES FaOF D3E3 4863 SHL 6X,CL MULTIPLY *16 FOR HIGH RES 4864 4865 ; ------ DETERHINE ALPHA CHAR POSITION 4866 F811 8.11..04 4867 MOV OL,AH ; COLUHN VALUE FOR RETURN F813 BAFO 4868 MOV DH.AL ROW VALUE F81S oOEE 4869 SHR OH,l DIVIDE BY 4 F817 DOEE 4870 SHR DH.l FOR VALUE IN 0-24 RANGE F819 Eall 4871 JHP SHORT V5 LIGHT_PEN_RETURN_SET 4872 4873 j------ ALPHA MODE ON LIGHT PEN 4874 F8lS 4875 V4: ; ALPHA_PEN F81e F6364AOO 4876 DIV BYTE PTR CRT_COLS ; DETERMINE ROW,COLUMN VALUE F81F 8AFO 4877 MOV OH,AL ; ROWS TO OH F8Z1 8A04 4878 MOV DL,AH ; COLS TO OL F8Z3 02EO 4879 SAL AL,CL ; NUL TIPl Y ROWS * 8 f8Z5 BAE8 4880 MOV CH,AL ; GET RASTER VAlUE TO RETURN REG F827 8ADC 4881 MOV Bl,AH ; COLUMN VALUE F829 32FF 4882 XOR BH,BH TO BX F8ZB D3E3 4883 SAL BX,CL F82D 4884 V5: LIGHT_PEN_RETURN_SET F8Z0 6401 4885 INDICATE EVERTHING SET F8ZF 4886 V6: LlGHT_PEN_RETURN F82F 52 4887 PUSH OX SAVE RETURN VALUE (IN CASE J Fa30 86166300 4888 MOV DX,ADOR_6645 GET BASE ADDRESS F834 83C207 4889 ADD ox,] POINT TO RESET PARM F8n fE 4890 OUT DX,Al ADDRESS. NOT DATA, IS IMPORTANT A-66 LOC OBJ LINE SOURCE F836 5A 4891 POP DX ; RECOVER VALUE F839 4892 V7: ; RETURN_NO_RESET F639 SF 4893 POP Dl F83A SE 4894 POP Sl F838 IF 4895 POP DS DISCARD SAVED BX.CX,DX F63C IF 4696 POP DS F83D IF 4897 POP DS F83E IF 4898 POP DS F63F 07 4899 POP ES F840 CF 4900 IRET 4901 READ_LPni ENOP 4902 ; --- INT 12 --------------------------------- 4903 ; MEMORY_SIZE_DETERMINE 4904 THIS ROUTINE DETERf1INES THE AMOUNT OF MEMORY IN THE SYSTEM 4905 AS REPRESENTED BY THE SWITCHES ON THE PLANAR. NOTE THAT 4906 THE SYSTEM MAY NOT BE ABLE TO USE I/O HEMORY UNLESS THERE 4907 IS A FUll COMPLEMENT OF 64K BYTES ON THE PLANAR. 4908 INPUT 4909 NO REGISTERS 4910 THE MEMORY_SIZE VARIABLE IS SET DURING POWER ON DIAGNOSTICS 4911 ACCORDING TO THE FOLLOWING HARDWARE ASSUMPTIONS: 4912 PORT 60 BITS 3,2 ;:: 00 - 16K BASE RAN 4913 01 - 32K BASE RAM 4914 10 - 48K BASE RAM 4915 11 - 64K BASE RAM 4916 PORT 62 BITS 3-0 INDICATE AMOUNT OF I/O RAM IN 32K INCREMENTS 4917 E.G •• 0000 - NO RAM IN I/O CHANNEL 491B 0010 - 64K RAM IN I/O CHANNEL, ETC. 4919 ; OUTPUT 4920 {AX) = NUMBER OF CONTIGUOUS lK BLOCKS OF MEMORY 4921 ; -------- ----------------------- --- ---------- 492:2: ASSUME CS:COOE.DS:OATA F641 492:3 MEMORY_SIZE_DETERMINE PROC FAR F841 FB 4924 STI ; INTERRUPTS BACK ON F642 IE 4925 PUSH DS ; SAVE SEGMENT F843 884000 4926 MOV AX.DATA ESTABLISH ADDRESSING F846 8E08 4927 MOV OS.AX F848 1411300 4928 MOV AX,MEMORY_SIZE GET VALUE F848 IF 492:9 POP DS RECOVER SEGMENT F84C CF 4930 !RET i RETURN TO CALLER 4931 MEMORY_SIZCDETERMINE. ENDP 4932: ;--- !NT 11 --------------------------------- 4933 EQUIPMENT OETERMINATlON 4934 THIS ROUTINE ATTEMPTS TO DETERMINE WHAT OPTIONAL 4935 DEVICES ARE ATTACHED TO THE SYSTEM. 4936 INPUT 4937 NO REGISTERS 4938 THE EqUIPJLAG VARIABLE IS SET DURING THE POWER ON DIAGNOSTICS 4939 USING THE FOLLOWING HARDWARE ASSUMPTIONS: 4940 PORT 60 = LOW ORDER BYTE OF EQUPMENT 4941 PORT 3FA = INTERRUPT 10 REGISTER OF 82:50 4942: BITS 7-3 ARE ALWAYS 0 4943 PORT 378 = OUTPUT PORT OF PRINTER -- 82:55 PORT THAT 4944 CAN BE READ AS WELL AS WRITTEN 4945 j OUTPUT 4946 (AX) IS SET. BIT SIGNIFICANT, TO INDICATE ATTACHED 1/0 4947 BIT 15.14 = NUH9ER OF PRINTERS ATTACHED 4948 BIT 13 NOT USED 4949 BIT 12 = GAME I/O ATTACHED 4950 BIT 11.10.9 :;; NUMBER OF R5232 CAROS ATTACHED 4951 BIT 8 UNUSED 4952 BIT 7.6 = NUMBER OF OISKETTE DRIVES 4953 00=1. 01=2. 10=3, 11=4 ONl.Y IF BIT 0 = 1 4954 BIT 5.4 = INITIAL VIDEO MODE 4955 00 - UNUSED 4956 01 - 40X25 BW USING COLOR CARD 4957 10 - 80X25 BW USING COLOR CARO 4958 11 - aOX25 BW USING BW CARD 4959 BIT 3.2: = PLANAR RAM SIZE (OO=16K.Ol=32K,10=48K,Il=64K) 4960 BIT 1 NOT USED 4961 BIT 0 = IPL FROM DISKETTE -- THIS BIT INDICATES THAT THERE ARE DISKETTE 4962 DRIVES ON THE SYSTEM 4963 4964 NO OTHER REGISTERS AffECTED 4965 ; ----------------- --------------------------- 4966 ASSUMF CS:CODE,OS:DATA A-67 LOC OBJ LINE SOURCE F840 4967 EQUIPMENT PROC FAR F840 FB 4968 STI ; INTERRUPTS BACK ON F84E IE 4969 PUSH OS ; SAVE SEGMENT REGISTER F84F 684000 4970 MOV AX.DATA ; ESTABLISH ADDRESSING F852 BED8 4971 MOV oS.AX F854 All000 4972 MOV AX,EQUIPJLAG ; GET THE CURRENT SETTINGS F857 iF 4973 POP OS ; RECOVER SEGMENT F8S8 CF 4974 IRET ; RETURN TO CALLER 4975 EQUIPMENT ENDP 4976 ;--- INT 15 --------------------------------- 4977 j CASSETTE I/O 4976 I AH I =0 TURN CASSETTE MOTOR ON 4979 IAHJ = 1 TURN CASSETTE MOTOR OFF 4980 (AHI = 2 READ 1 OR MORE 256 BYTE BLOCKS FROM CASSETTE 4981 IES,BX) = POINTER TO DATA BUffER 498Z (CX) = COUNT OF BYTES TO READ 4983 ON EXIT: 4984 I ES .BX) = POINTER TO LAST BYTE READ + 1 4985 (OX) = COUNT OF BYTES ACTUALLY READ 4986 (CY I = 0 IF NO ERROR OCCURRED 4987 = 1 IF ERROR OCCURRED 4986 (AH) = ERROR RETURN IF (CY)= 1 4989 = 01 IF CRC ERROR WAS DETECTED 4990 =. 02 IF DATA TRANSITIONS ARE LOST 4991 = 04 IF NO DATA WAS FOUND 4992 I AH) = 3 WRITE 1 OR MORE 256 BYTE BLOCKS TO CASSETTE 4993 (ES,BX) = POUlTER TO DATA BUFFET.. 4994 (CX) = COUNT OF BYTES TO WRITE 4995 ON EXIT: 4996 (EX ,BX) = POINTER TO LAST BYTE WRITTEN + 1 4997 (ex) =a 4998 (AH) = ANY OTHER THAN ABOVE VALUES CAUSES (eYl= 1 4999 AND UH)= 80 TO BE RETURNED (INVALID COMMAND), 5000 ; ---------------- -------- - ------------------- 5001 ASSUME DS:DATA. ES:NOTHING.SS:NOTHING.eS:CODE FB59 500Z CASSETTE_IO PRoe FAR F8S9 FB 5003 STI INTERRUPTS BACK ON FBSA IE 5004 PUSH OS ESTABLISH ADDRESSING TO DATA F85B 50 5005 PUSH AX F8SC B84000 5006 MOV AX, DATA FBSF BE OS 5007 MOV OS. AX F861 802671007F 5008 AND BIOS_BREAK. 7FH ; MAKE SURE BREAK FLAG IS OFF F866 58 5009 POP AX F867 Ea0400 5010 CALL WI Fe6A IF 5011 POP DS F86B CA0200 5012 RET INTERRUPT RETURN 5013 CASSETTE_IO ENOP F86E 5014 1011 PROC NEAR 5015 ; ----------------------------------- --------- 5016 PURPOSE: 5017 TO CALL APPROPRIATE ROUTINE DEPENDING ON REG AH 5018 5019 AN ROUTINE 5020 5021 MOTOR ON 5022 MOTOR OFF 5023 READ CASSETTE BLOCK 5024 WRITE CASSETTE BLOCK 5025 5026 F86E OAE4 5027 OR AH.AH ,TURN ON MOTOR? F870 7413 5026 JZ MOTOR_ON JYES, DO IT Fe72 FEee 5029 DEC AN jTURN OFF MOTOR? FB74 7416 5031) JZ MOTOR_OFF ;YES. 00 IT F876 FEee 5031 DEC AN ;READ CASSETTE BLOCK? Fe78 74lA 5032 JZ READ_BLOCK ;YES, 00 IT Fe7A FEee 5033 DEC AN ;WRITE CASSETTE BLOCK? F87C 7503 5034 JHZ "2 > NOT_DEFINED F87E E92701 5035 JHP WRITE_BLOCK ;YES. DO IT 5036 FB8l 5037 1012: ;COMMAND NOT DEFINED FaBI B4BO 5038 MOV AH.oeOH ;ERROR, UNDEfINED OPERATION F883 F9 5039 STC ;ERROR flAG FB84 C3 5040 RET 5041 WI ENDP 5042 A-68 LaC OBJ LINE SOURCE F88. 5043 PROt NEAR 5044 j --------------------------------- 5045 ; PURPOSE: 5046 ; TO TURN ON CASSETTE MOTOR 5047 i - - -- -- -- ----- ---- -- - - - - - -- -------- F885 £461 5048 IN Al.PORT_B i READ CASSETTE OUTPUT F887 24F7 5049 AND AL.NOT 08H ; ClEAR BIT TO TURN ON MOTOR F889 £661 5050 ;WRITE IT OUT F888 2AE4 5051 ;CLEAR AH FeaD C3 5052. 5053 ENOP 5054 FsaE 5055 MOTOR_OFF PRoe NEAR 5056 ; -- ----------- -- --- --- --- -- ---------- 5057 ; PURPOSE: 5058 ; TO TURN CASSETTE MOTOR OFF 5059 J -- -- -- ---- --- ------ ---- --- ------ - ---- F88E E461 5060 IN AL.PORT_B ;READ CASSETTE OUTPUT F890 DeDa 5061 OR AL.08H ; SET BIT TO TURN OFF F892 EBFS 5062 J"P Wl JWRITE IT, CLEAR ERROR, RETURN 5063 MOTOR_OFF ENOP F894 5064 REA.D_BLOCK PROC NEAR 5065 ; -------------------------------------------- 5066 ; PURPOSE: 5067 ; TO READ 1 OR MORE 256 BYTE BLOCKS fROM CASSETTE 5068 5069 ; ON ENTRY: 5070 ES IS SEGMENT fOR MEt10RY BUFFER «FOR COttPACT CODE I 5071 ; ex POINTS TO START OF MEMORY BUFFER 5072 ; ex CONTAINS NUMBER OF BYTES TO READ 5073 • ON EXIT: 5074 ex POINTS 1 BYTE PAST LAST BYTE PUT IN MEM 5075 CX CONTAINS DECREMENTED BYTE COUNT 5076 DX CONTAINS NUMBER OF BYTES ACTUALLY READ 5077 5078 CARRY FLAG IS CLEAR IF NO ERROR DETECTED 5079 CARRY flAG IS SET IF CRC ERROR DETECTED 5080 J -------------------------------------------- F894 53 5081 PUSH .x ;SAVE BX F895 51 5082 PUSH CX ;SAVE ex F896 56 5083 PUSH SI ; SAVE SI Fe97 8E0700 5084 MOV 51. 7 SET UP RETRY COUNT FOR LEADER F89,A, E8C201 5085 CALL BEGIN_DP ; BEGIN BY STARTING MOTOR F890 5086 W4: i SEARCH FOR LEADER F89D E462 5087 IN AL.PORT_C ;GET INTIAL VALUE fe9F 2410 5088 AND Al~010H ;MASK OFF EXTRANEOUS BITS F8Al A26800 50B9 MOV LAST_VAL.AL ;SAVE IN LOC LAST_VAL F8A4 BA7A3F 5090 MOV DX~16250 ; I OF TRANSITIONS TO LOOK FOR 5091 F8A7 5092 W5: ; WAITJOR_EOGE F8A7 F606710080 5093 TEST BIOS_BREAK. 80H ; CHECK FOR BREAK KEY FeAt 7403 5094 JZ w. JUt1P IF NO BREAK KEY FBAE E9SADa 5095 J"P W17 ; JUMP IF BREAK KEY HIT 5096 FBSI 4A 5097 W6: DEC OX F8B2 7503 5098 JHZ .7 JUMP IF BEGINNING OF LEADER F8B4 E98400 5099 JMP W17 JUMP IF NO LEADER FOUND 5100 F887 E8e600 5101 W7: CALL READ_HALF _BIT ;IGNORE FIRST EDGE F8BA E3ES 5102 JCXZ W. ; JUMP IF NO EDGE DETECTED F8BC BA7803 5103 MOV DX~0378H ; CHECK FOR HALF BITS FaBF 890002 5104 HOV CX.200H ;MUST HAVE AT LEAST THIS MANY ONE SIZE 5105 ; PULSES BEFORE CHECKNG FOR SYNC BIT (0) F8Ct E421 5106 IN AL. 021H INTERRUPT MASK REGISTER Fec4 DeDI 5107 OR AL.1 ; DISABLE TIMER INTERRUPTS FSC6 E621 5108 OUT 021H. AL F8ce 5109 we: ; SEARCH-LDR Fecs F606710080 5110 TEST BIOS_BREAK, 80H ; CHECK FOR BREAK KEY FeCD 756C 5111 JUZ W17 ; Jtr.1P IF BREAK KEY HIT FSCF 51 5112 PUSH CX ;SAVE REG CX F8DO E8AOOO 5113 CALL READ_HALF _BIT ;GET PULSE WIDTH F8Dl 08C9 5114 OR CX~ ex j CHECK FOR TRANSITION F8DS 59 5115 POP CX J RESTORE ONE BIT COUNTER FOO6 74C5 5116 JZ W4 ; JUMP IF NO TRANSITION F8D8 3803 5117 CMP DX.BX j CHECK PULSE WIDTH A-69 LOC OBJ LINE SOURCE FaOA B04 5118 JCXZ W' ; IF C)(::O THEN WE CAN LOOK 5119 ;FOR SYNC BIT 10) FaDe 73BF 5120 JNC W4 i JUMP IF ZERO BIT (NOT GOOD LEADER) F8DE E2E8 5121 lOOP W8 ;DEC ex AND READ ANOTHER HALF ONE BIT F8EO 512.2 W9: FINO-SYNC f8EO 72Eb 5123 JC W8 ; JUMP IF ONE BIT (STIll LEADER) 5124 512:5 A SYNCH BIT HAS BEEN FOUND. READ SYN CHARACTER: 5126 FeEZ E89800 5127 CALL READ_HALF _BIT ; SKIP OTHER HALF OF SYNC BIT (0) F8ES E86AOO 512:8 CAll READ_BYTE ; READ SYN BYTE F8ES 3e16 512:9 CMP AL, 16H ; SYNCHRONIZATION CHARACTER f8EA 7549 5130 JNE Wl. i JUMP IF BAD lEADER FOUND. 5131 5132 ;------ GOOD CRe so READ DATA BLOCK{S) FaEC SE 5133 POP S! ; RESTORE REGS F8ED 59 5134 POP CX FaEE 56 5135 POP BX 5136 ;-------------------------------------------- 5137 , READ 1 OR MORE 256 BYTE BLOCKS FROM CASSETTE 5138 5139 ; ON ENTRY: 5140 ES IS SEGMENT fOR MEMORY BUfFER (FOR COMPACT CODE I 5141 , BX POINTS TO START OF MEMORY BUFfER 5142 , ex CONTAINS NUMBER OF BYTES TO READ 5~43 ; ON EX;:T: 5144 BX POINTS 1 8YTE PAST LAST BYTE PUT IN MEM 5145 , CX CONTAINS DECREMENTED BYTE COUNT 5146 , ox CONTAINS HUMBER OF BYTES ACTUALLY READ 5147 ;-------------------------------------------- F8EF 51 5148 PUSH CX i SAVE BYTE COUNT F8FO 5149 WI0: ;COME HERE BEFORE EACH 5150 ;256 BYTE BLOCK IS READ F8FO C7066900FFFF 5151 MDV CRC_REG,OFFFFH ; INIT CRC REG F8F6 BAOOOI 5152 MDV DX.25b iSET OX TO DATA BLOCK SIZE F8F9 5153 10111: i RD_BLK FeF9 F6067100ao 5154 TEST BIOS_BREAK. aOH i CHECK FOR BREAK KEY FaFE 7523 5155 JNZ WI3 ; JUMP IF BREAK KEY HIT F900 E84FOO 5156 CALL READ_BYTE ;READ BYTE FROM CASSETTE F903 721E 5157 JC W13 iCY SET INDICATES NO DATA TRANSITIONS F905 nos 5158 JCXI W12 ;IF WE 'VE ALREADY REACHED 5159 ;EHD OF MEMORY BUFFER 5160 ;SKIP REST OF BLOCK f907 268807 5Ibl HOV ES:[BX],AL ;STORE DATA. BYTE AT BYTE PTR f90A 43 51b2 INC "X ; INC BUFFER PTR F90B 49 5163 DEC CX ; DEC BYTE COUNTER f90C 5164 10112: lOOP UNTIL DATA BLOCK HAS BEEN READ FROM CASSETTE. F90C 4A 5165 DEC OX JDEC BLOCK CNT F90D 7FEA 516b JG W11 I RD_BLK f90F E84000 5167 CALL READ_BYTE iNOW READ TWO CRe BYTES F912 E83000 5168 CALL READ_BYTE F915 ZAE4 5169 SUB AH,AH ;CLEAR AH F917 813E69000F 10 5170 CMP CRC_REG,lDOFH ; IS Tt-IE CRC CORRECT F91D 750b 5171 JNE w'4 IIF NOT EQUAL CRe IS BAD F91F E30b 5172 JCXZ W15 IIf BHE COUNT IS ZERO 517.3 ; THE~I WE HAVE READ ENOUGH 5174 I SO !-IE WILL EXIT F9l1 EBCD 5175 JHP WI0 iSTIlL MORE. SO READ ANOTHER BLOCK F923 5176 10113: ;MISSING-DATA 5177 iNC DATA TRANSITIONS SO Fn3 8401 5178 MOV AH,OlH ;SET AH;:;02 TO INDICATE 5179 ;DATA TIMEOUT Fn5 5180 W14: I BAO-CRC F925 FEC4 5181 INC AH ,EXIT EARLY ON ERROR 5182. ;SET AH;:;Ol TO INDICATE CRC ERROR Fn7 5183 W15: i RO-BLK-EX F92.7 5A 5184 POP OX ;CALCULATE COUNT OF Fn8 2.BOl 518S SUB OX,CX iDATA BYTES ACTUALLY READ 5186 jRETURN COUNT IN REG ox F92A 50 5187 PUSH AX iSAVE AX (RET CODE) FnB F6C403 5188 TEST AH, OJH j CHECK FOR ERRORS FnE 7513 5189 JNZ Wl" i JUMP IF ERROR DETECTED F930 E8lFOO 5190 CALL READ_BYTE ;READ TRAILER F933 EBOE 5191 JMP SHORT 10118 ;SKIP TO TURN OFF MOTOR F935 5192 W16: i BAD-LEADER f935 4E 51'n o£c 51 ;. CI-!":':If EjI'T!1IES A-70 lOC OBJ LINE SOURCE F936 7403 5194 JZ WI7 ; JUHP IF TOO MANY REnnES F938 E962FF 5195 JMP ; JUMP IF NOT TOO MANY RETRIES F936 5196 10117: ; NO VALID DATA FOUND 5197 j ------ NO DATA FROM CASSETTE ERROR. 1. E. TIMEOUT 5198 F935 SE 5199 POP SI ; RESTORE REGS F93C 59 5200 POP CX ;RESTORE REGS F930 5B 5201 POP BX F93E ZSQZ 5202 SUB OX,OX iZERQ NUMBER OF BYTES READ F940 8404 5203 MOV AH ,Q4H ;TIME OUT ERROR (NO lEADER) F942 50 5204 PUSH AX F943 5205 JoI18: ; MOT-OFf F943 E421 5206 IN AL. 021H ; RE_ENABLE INTERRUPTS F945 24FE 5207 AND AL. OFFH- 1 F947 HZ1 5208 OUT 021H. AL F949 E842FF 5209 CALL MOTOR_OFF ;TURN OFF MOTOR F94C 58 5210 POP AX jRESTORE RETURN CODE F940 80FCOI 5211 CMP AH,OlH j SET CARRY If ERROR (AH>O J f950 F5 5212 CMC F951 C3 5213 RET jf!NISHED 5214 READ_BLOCK ENDP 5215 ; ---- ------------- - ------ --------- -------- F952 5216 PRoe NEAR 5217 PURPOSE: 5218 TO READ A BYTE FROM CASSETTE 5219 ;1:20 ON EXIT REG AL CONTAINS READ DATA BYTE 5221 ; ----- -- ---------- - ---------------- --- -- -.-- F952 53 5222 PUSH ex ;SAVE REGS Bx.ex F953 51 5223 PUSH ex F9546108 5224 HOV el,SH ; SET Bn COUNTER FOR 8 BITS F956 5225 1<.119: ; BYTE-ASH F956 51 5226 PUSH ex ;SAVE ex 5227 ; ----- ----------.------.-------. --.------- 5228 ; READ DATA BIT FROM CASSETTE 5229 ; --- ----- - - - -- --- --- ---.-- ------------.--- F957 1;82600 5230 CALI. READ_HALF _BIT iREAD DUE PULSE F95A nzo 5231 JCXZ W21 j If CX:::O THW TIMEOUT 5232 iBECAUSE OF NO DATA TRANSITIONS f95C 53 5233 PUSH ex ,SAVE 1ST HALF BIT'S 523f+ ; PULSE mOTH (IN BX) F950 E82000 5235 CALL READ_HALF _BIT ;READ COMPLEMENTARY PULSE F960 58 5236 POP AX ;COHPUTE DATA BIT F961 E319 5237 JCXZ W21 ;IF CX=O THEN TIMEOUT OUE TO 5238 ;NO OATA TRANSITIONS F963 0308 5239 ADO BX,AX .PERIOD F965 8lF8F006 5240 CMP ex. 06fOH ; CHECK FOR ZERO BIT F969 FS 5241 CMC ; CARRY IS SET IF ONE BIT F96A 9F 5242 lAHf ;SAVE CARRY IN AH F966 59 5243 POP cx lRESTORE ex 5244 ;NOTE: 5245 i MS BIT OF BYTE IS READ fIRST. 5246 ; REG CH IS SHIFTED LEFT WITH 5247 i CARRY BEING INSERTED WTD LS 5248 BIT OF CH. 5241;1 i AFTER All a BITS HAVE BEEN 5250 READ. THE I1S BIT OF THE DATA BYTE 5251 WIll BE IN THE MS BIT OF REG CH F96C ODDS 5('52 RCL CH.l ;RorATE REG CH lEfT ;·,tITH CARRY TO 5253 lS BIT OF REG 01 F9H 9E 5254 SAHf ;RESTORE CARRY FOR CRC ROUTINE F96F E8D900 5255 CALL CRC_GEN ;GENERATE CRe FOR aIr F9n FEe9 52.56 DEC CL ; LOOP TILL All 8 BITS OF DATA. 5257 i ASSEMBLED IN REG CH F974 75EO 5ZS8 JHZ W19 ; BYTE_ASM F976 SACS 5259 MOV AL.CH ;RETURN O.A.TA BYTE IN REG At F978 f8 5Z60 ClC F979 5261 W20: ; RO-BYT-EX F979 59 5262 POP ex ;RESTORE REGS CX.BX F97A 56 S:Z6-3 pop BX F97~ C3 5264 RET ;FINISHED F97C 5ZH W21: ; NO-DATA F97C 59 5266 POP CX ;RESTORE CX F97D F9 5267 STC ;INDICATE ERROR A-71 LOC OBJ LINE SOURCE F97E EBF9 5268 5269 "" ENOP 5270 ; -------------------------------------------- F980 5271 NEAR 5272 PURPOSE: 5273 TO CONPUTE TINE TILL NEXT DATA 5274 TRANSITION (EDGE) 5275 5276 ; ON ENTRY: 5277 j EDGE_CNT CONTAINS LAST EDGE COUNT 5278 5279 ; ON EXIT: 5280 ; AX CONTAINS OLD LAST EDGE COUNT 5281 ; BX CONTAINS PULSE WIDTH (HALF BIT) 5282 ; -------------- --------------- ----------- F'980 896400 5283 HOV ex. 100 ; SET TIME TO WAIT fOR BIT f983 BA266BOO 5:!84 HOV AH,lAST_VAL ;GET PRESENT INPUT VALUE F987 5285 W22: ; RD-H-BIT F967 E462 5286 IN AL.PORT_C ,INPUT DATA BIT F989 2410 5287 AND AL.OIOH ;MASK OFF EXTRANEOUS BITS f98B 3AC4 5288 eMP AL.AH ;SAME AS BEFORE? F98D EIFS 5289 LOOPE "22 ; LOOP TILL IT CHANGES F98F AlbBDO 5290 MOV LAST_V.A.L,AL ;UPDATE LAST_VAL WITH NEW VALUE F992 BOOO 5291 HOV AL.O ;READ TINER'S COUNTER COMMAND F994 E643 5292 OUT TIM_CTL.At ; LATCH COUNT ER F99b E440 5293 HI At, TIMERO ;GET lS BYTE F998 BAEO 5294 MOV AH.AL ;SAVE IN AH t9'9A f:.440 5295 IN AL. TIMERO ;GET MS BYTE F99C 66C4 5296 XCHG Al.AH ;XCHG AL.AH f99E 6BIE6700 5297 HOV BX.EDGE_CNT ; ex GETS LAST EDGE COUNT F9A2 2806 5298 SUB BX,AX iSH BX EQUAL TO HALF BIT PERIOD F9A4 A36700 5299 MOV EDGE_CNT .AX ;UPDATE EDGE COUNT; F9A7 C3 5300 RET 5301 READ_HAlF _BIT ENDP 5302 ; --------- - ---------------------- --------- F9A8 5303 PRoe NEAR 5304 5305 ; WRITE 1 OR MORE 256 BYTE BLOCKS TO CASSETTE. 5306 THE DATA IS PADDED TO FILL OUT THE LAST 256 BYTE BLOCK. 5307 5308 ON ENTRY: 5309 ex POINTS TO MEHORY BUffER ADDRESS 5310 CX CONTAINS NUMBER OF BYTES TO WRITE 5311 5312 ON EXIT: 5313 BX POUlTS I BYTE PAST lAST BYTE WRITTEN TO CASSETTE 5314 CX IS ZERO 5315 ; -------------------------------------------- F9A8 53 5316 PUSH BX F9A9 51 5317 PUSH ex F9AA E461 5318 IN AL.PORT_B ;DISABLE SPEAKER F9AC 24FO 5319 AND Al.NOT 02H F9AE OCOI 5320 OR AL. OlH ; ENABLE TIMER F9BO E661 5321 OUT PORT_B,Al F9B2 B086 5322 MOV Al.OB6H ; SET UP TIMER -- MODE 3 SQUARE WAVE F9B4 E643 5323 OUT TIM_CTl,AL F9B6 ESA600 5324 CAll BEGIN_OP ; START MOTOR AND DELAY F9B9 B8A004 5325 MOV AX.1184 ; SET NORMAL BIT SIZE F9BC E88500 5326 CALL "31 ; SET_TIMER F9BF 890008 5327 MOV CX.0800H ;SET CX FOR LEADER BYTE COUNT F9C2 5328 W23: ; WRITE LEADER F9C2 F'9 5329 STe ; WRITE ONE BITS F9Cl E86800 5330 CALL WRITE_BIT F9C6 EZFA 5331 lOOP W23 , LOOP 'TIL LEADER IS WRITTEN F9C6 F8 5332 eLe ;WRITE SYNC BIT (0) F9C9 E86200 5333 CAll WRITE_BIT F9CC 59 5334 POP ex iRESTORE REGS CX.BX F9CD 58 5335 POP BX F9CE B016 5336 MOV Al. l6H WRITE SYN CHARACTER F900 E84400 5337 CAll IolRITE_BYTE A-72 lOC OBJ LINE SOURCE 5338 ; --------------- -- --------------------------- 5339 WRITE 1 OR MORE 256 BYTE BLOCKS TO CASSETTE 5340 5341 ON ENTRY: 5342 BX POINTS TO MEMORY BUFFER ADDRESS 5343 ex CONTAINS NUMBER OF BYTES TO WRITE 5344 5345 ON EXIT: 5346 BX POINTS 1 BYTE PAST LAST BYTE WRITTEN TO CASSETTE 5347 CX IS ZERO 5348 ; ------- - ------- ---------- --------- ---- ----- F9DJ 5349 WR_BLOCK: F903 C7066900FFFF 5350 NOV CRC_REG.OFFfFH ;INIT eRe F9D9 BAOOO I 5351 MOV OX,2S6 ; FOR 256 BYTES F9DC 5352 1424: ; Wj:;I-BLK F9DC 268M7 5353 NOV AL.ES: faX) ;READ BYTE FROM MEM F9DF E83500 5354 CALL WRITE_BYTE ; WRITE IT TO CASSETTE F9E2 [302 5355 JCXZ WZ5 ;UNLESS CX=O. ADVANCE PTRS & DEC COUNT F9E4 43 5356 INC BX UNC BUFFER POINTER f9E5 49 5357 DEC ex ;DEC BYTE COUNTER F9E6 5358 W25: ; SKIP-ADV f9E6 4A 5359 DEC DX ;DEC BLOCK CNT F9E7 7FF3 5360 JG W24 ;LOOP TIll 256 BYTE BLOCK 5361 ; IS WRITTEN TO TAPE 5362 j------------------- WRITE CRe -------------- 5363 WRITE l'S COMPLEMENT OF CRe REG TO CASSETTE 5364 ; WHICH IS CHECKED FOR CORRECTNESS IoIHEN THE BLOCK IS READ 5365 5366 ; REG AX IS MODIFIED 5367 ; ----------------- ---- -- -- ----------------- F9E9 Al6900 5368 NOV AX.CRt_REG ;WRITE THE ONE'S COMPLEMENT OF THE 5369 ; TWO BYTE CRC TO TAPE F9EC f700 5370 NOT AX ;; fOR 1'S COMPLEMENT F9EE 50 5371 PUSH AX ;SAVE IT F9EF 86EO 5372 XCHG AH,AL ;WRITE MS BYTE FIRST F9Fl E82300 5373 CALL WRITE_BYTE ;WRITE IT F9F4 58 5374 POP AX ;GET IT BACK F9F5 E81FOO 5375 CALL WRITE_BYTE ;NOW WRITE LS BYTE F9F8 OBC9 5376 OR ex.ex ; IS BYTE COUNT EXHAUSTED? F9FA 7507 5377 JNZ WR_BLOCK ; JUMP IF NOT DONE YET F9FC 51 5378 PUSH ex ;SAVE REG CX f9FD B92000 5379 NOV ex. 32 ;WRITE OUT TRAILER BITS FAOO 5380 1426: ;; TRAIL-LOOP fADO F9 5381 STe FAOI EB2AOO 5382 CALL WRITE_BIT FA04 EZFA 5383 LOOP W2. ;: WRITE UNTIL TRAILER WRITTEN FA06 59 5384 POP ex ;RESTORE REG ex FAD7 BOBO 5385 NOV AL. OBOH ;; TURN TIMER2 OFF FA09 E643 5386 OUT TIN_CTl, AL FAOB B80l00 5367 NOV AX. 1 fADE E83300 5388 CALL W31 ;; SET_TIMER fAll E87AfE 5389 CALL MOTOR_OFF ; TURN NOTOR OFF FA14 2ECO 5390 SUB AX,AX ;NO ERRORS REPORTED ON WRITE OP FAl6 C3 5391 RET ;FINISHED 5392: WRITE_BLOCK ENDP 5393 ; ------------------------------------------ FA17 5394 WRITE_BYTE PROC NEAR 5395 ; WRITE A eYTE TO CASSETTE. 5396 ; BYTE TO WRITE IS IN REG At. 5397 fAl7 51 5398 PUSH ex ;SAVE REGS eX,AX FAl8 50 5399 PUSH AX FAl9 SAE8 5400 NOV CH.AL ;AL=BYTE TO WRITE. 5401 (MS BI r WRITTEN fIRST) FAlB BI08 5402 NOV CL.a ;FOR 8 DATA BITS IN BYTE. 5403 NOTE: TWO EDGES PER BIT FAID 5404 1427: ; DISASSEMBLE THE DATA BIT FAID 0005 5405 RCl CH,1 jROTATE HS BIT INTO CARRY fAH 9C 5406 PUSHf ;SAVE flAGS. 5407 NOTE: DATA BIT IS IN CARRY FA20 E80600 5408 CALL WRITE_BIT ;WRITE DATA BIT FAZ3 90 5409 POPF ; RESTORE CARRY fOR CRe CALC FAZ4 E62400 5410 CALL CRe_GEN ; COMPUTE CRC ON OAT A BIT FA27 FEC9 5411 DEC el ; LOOP TILL ALL 8 BITS DONE fAZ9 7SF2 5412 JHZ W27 ; JUMP IF NOT DONE YET FA2B 56 5413 POP AX jRESTORE REGS AX.eX FA2C 59 5414 POP ex A-73 LaC OBJ LINE SOURCE FAZO C3 5415 i WE ARE FINISHED 5416 ENDP 5417 ;---------------------------------------- FA2E 5418 WRITE_BIT PROC NEAR 5419 PURPOSE: 5420 5421 TO WRITE A DATA BIT TO CASSETTE 5422 CARRY FLAG CONTAINS DATA BIT 54Z3 I.E. IF SET DATA BIT IS A ONE 5424 IF CLEAR DATA BIT IS A ZERO 5425 5426 NOTE: TWO EDGES ARE WRITTEN PER BIT 5427 ONE BIT HAS 500 USEe BETWEEN EDGES 5428 FOR A 1000 USEe PERIOD (1 MILlISEC) 5429 5430 ZERO BIT HAS 250 USEC BETWEEN EDGES 5431 FOR A 500 USEC PERIOD (.5 MIlllSEC) 5432 • CARRY flAG IS DATA BIT 5433 1------------------------------------------- 5434 JASSUME IT'S A ' I ' FAZE B6A004 5435 NOV AX.l184 ; SET AX TO NOMINAL ONE SIZE JutlP IF ONE BIT FAll 7203 FAl3 885002 5436 5<'t37 JC NOV "'" AX.5"n j ; NO, SET TO NOHINAL ZERO SIZE FA36 5438 W28: ; WRITE-BIT-AX FA36 50 5439 PUSH AX ;WRITE BIT WITH PERIOD EQ TO VALUE AX FA37 5440 WZ9: FA37 E462 5441 IN Al,PORT_C JINPUT TIMER_O OUTPUT FA39 242:0 5442 AND AL,020H FA3B 74FA 5443 JZ "29 ; LOOP TILL HIGH FA 3D 5444 W30: fA3D E462 5445 IN AL.PORT_C ;NOW WAIT TILL TIMER'S OUTPUT 1'5 LOW FA3F 2420 5446 AND AL,020H FA41 75FA 5447 JNZ "30 5448 ;RELOAD TIMER WITH PERIOD 5449 ; FOR NEXT DATA BIT FA43 58 5450 POP AX JRESTORE PERIOD COUNT FA44 5451 1431: • SET TIMER FA44 E642 5452 OUT 042H, AL ; '5ET LOW BYTE OF TIMER 2: FA46 8AC4 5453 NOV AL. AH FA46 E642 5454 OUT 042H, AL ; SET HIGH BYTE OF TIMER 2 FA4A Cl 5455 RET 5456 WRITE_BIT ENDP 5457 ; --------- ---- - ------- ------------ -------- FA48 5458 CRC_GEN PROC NEAR 5459 UPDATE CRe REGISTER WITH NEXT DATA BIT 5460 5461 CRC IS USED TO DETECT READ ERRORS 5462 5463 ASSUMES DATA BIT IS IN CARRY 5464 5465 REG AX IS MODIFIED 5466 flAGS ARE MODIFIED 5467 ; --- -- - ------ ---- --- ---------------------- FA48 A16900 5468 NOV 5469 i THE FOLLOWING INSTUCTIONS 5470 ; WILL SET THE OVERFLOW FLAG 5471 ; IF CARRY AND NS BIT OF CRe 5472 ; ARE UNEQUAL FA4E 0108 5473 RCR AX.l FASO DIDO 5474 PCl AX.l FA52 f8 5475 ClC ;CLEAR CARRY FA53 7104 5476 JNo "32 i SKIP IF NO OVERFLOW 5477 ;IF DATA BIT XORED WITH 5476 • CRC REG BIT 15 IS ONE FA55 351008 5479 XOP AX.08IOH ; THEN XOR eRC REG WITH 5480 • 0810H FA58 F9 5481 STO ;SET CARRY FA59 5482 W12: FA59 DIDO 5483 PCl AX,I ;ROTATE CARRY (DATA BITl 5484 ; INTO CRC REG rA5B A36900 5485 NOV CRC_REG,AX .UPDATE CRC_REG FASE C3 5486 RET ,FINISHED 5487 CRC_GEN ENDP 5486 j ---- ------------- ---------- ----------------- FA5F 5489 PROC NEAR ; START TAPE AND DELAY 5490 5491 ; ---------- ------- --------------------------- A-74 LOC OBJ LINE SOURCE FA5F E823FE 5492 CALL MOTOR_ON j TURN 01>1 MOTOR FAbZ 8342 5493 MOV BL.42H ;oELAY FOR TAPE DRIVE 5494 ; TO GET UP TO SPEED (1/2 SEC) FA64 5495 N33: FA64 890007 5496 MOV CX,700H jINNER LOOP= APPROX. 10 HILLISEC FA67 EZFE 5497 N34: LOOP 1.134 FA6'9 FEes 5498 DEC BL fAbS 7SF7 5499 JNZ W33 FA6D CJ 5500 RET 5501 Et5 FCIE 3860COFSCCCC7800 5563 DB 036H.060H.OCOH.OF8H.OCC;H.OCC;H,078H.000H ; 6 o_36 FCZ6 FCCCOC1830303000 5564 DB OFCH.OCCH,OOCH.018H.030H.030H.030H,000H ; 7 0_37 FCZE 78CCCC78CCCC7800 5565 DB 078H.OCCH.OCCH,078H.OCCH.OCCH.078H,OOOH ; 8 o_38 FC36 76CCCC7COC167000 5566 DB 018H.OCCH,OCCH.07CH,OOCH,018H.070H,OOOH 9 0_39 FC3E OQ30300000!.Q'll0~ 5567 DB OOOH.030H.030H,OOOH.OODH.030H.030H.OOOH : 0_3A A-7S lOC OBJ LINE SOURCE FC46 0030300000303060 5568 DB OOOH,030H,030H,OOOH,OOOH,030H,030H,060H ; ; 0_3B FC4E 183060C060301800 5569 DB 018H,030H,060H,OCOH,060H,030H,018H,OOOH ; < D_3C FCS6 OOOOFCOOOOFCOOOO 5570 DB OOOH ,OOOH, OFCH, OOOH, DOOH, OFCH, OOOH, OOOH :; 0_30 FC5E 6030180CI8306000 5571 DB 060H,030H,018H,OOCH,Ol8H,030H,060H,OOOH > D_3E FC66 78CCOC1830003000 5572 DB 078H,OCCH,OOCH,018H,030H,OOOH,030H,OOOH ? O_3F 5573 FC6E 7CC6DEDEDEC07800 5574 DB 07CH.OC6H,ODEH,OOEH,OOEH,OCOH,078H,OOOH ; ~ 0_40 FC76 3078CCCCfeccccoo 5575 DB 030H,078H,OCCH,OCCH,OfCH,OCCH,OCCH,OOOH ; A 0_41 Fe7E FC66667C6666FCOO 5576 DB OFCH,066H,066H.07CH,066H,066H,OFCH.OOOH ; B 0_42 Fce6 3C66COCOC0663COO 5577 DB 03CH,066H,OCOH,OCOH,OCOH,066H,03CH,OOOH ; e 0_43 FceE F86C6666666CF800 5578 DB OFBH,06CH,066H,066H,066H,06CH,OFeH,OOOH ; ° 0_44 FC96 FE6268786862FEOO 5579 DB OFEH.062H.068H.078H,068H,062H,OfEH,OOOH ; E 0_45 Fe9E FE6268786860FOOQ 5580 DB OFEH,06ZH.06BH.078H,068H,060H.OFOH,OOOH ; F 0_46 FeA6 3C66COCOCE663EOO 5581 DB 03CH.066H,OCOH.OCOH.OCEH.066H,03EH,OOOH ; G 0_47 FeAE eceCCCFCCCCCCCOO 5582 DB OCCH,OCCH.OCCH,OFCH,OCCH,OCCH,OCCH,OOOH j H 0_48 FeB6 7830303030307800 5583 DB 07BH,030H,030H,030H,030H.030H,078H,OOOH ; I 0_49 FeBE lEOCOCOCCCCC7800 5584 DB 01EH,OOCH,00CH,00CH,OCCH.OCCH.07BH.OOOH ; J 0_4A Fee6 E6666C786C66E600 5585 DB OE6H,066H,06CH.078H,06CH,066H,OE6H.OOOH ; K 0_48 FeCE F06060606266FEOO 5586 DB OFOH.060H,060H.060H,062H,066H.OFEH.OOOH ; L O_4C FeD6 e6EEFEFE06C6C600 5587 DB OC6H,OEEH,OfEH,OFEH,OD6H,OC6H,OC6H,OOOH ; M 0_40 FeOE C6E6F6DEeEe6C600 5588 DB OC6H,OE6H.OF6H,ODEH.DCEH,OC6H,OC6H.OOOH ; N 0_4E FCEb 386CC6C6C66C3800 5589 DB 038H,06CH,OC6H,OC6H,OC6H,06CH,038H,OOOH ; OO_4F 5590 FeEE FC66667C6060FOOO 5591 DB OFCH,066H.066H,07CH,060H,060H,OfOH,OOOH j PO_50 FCF6 78CCCCCCDC781eoo 5592 DB 078H,OCCH,OCCH,oceH,OOCH,078H.OICH,OOOH ; Q 0_51 FCFE Fe66667(6C66E600 5593 DB OFCH,066H,066fl,07CH,06CH,066H,OE6H.OOOH ; R 0_52 FOUb 78CCE0701CCC7800 5594 DB 07BH,OCCH,OEOH,070H,OlCH,OCCH.078H,OOOH ; SO_53 FOOE FCB43U3U3U307800 5595 DB OFCH,064H,030H,030H.030H,030H,078H,000H ; TO_54 F016 CCCCCCCCCCCCFCOO 5596 DB OCCH.OCCH,OCCH.OCCH,OCCH,OCCH,OfCH,OOOH ; U 0_55 FOIE CCCCCCCCCC783000 5597 DB OCCH.OCCH,OCCH,OCCH.OCCH,078H,030H,OOOH ; V 0_56 F026 C6C6C606FEEEC600 5598 DB OC6H,OC6H.OC6H,006H,OFEH,OEEH,OC6H,OOOH ; W 0_57 F02E C6C66C38366CC6UO 5599 DB OC6H.OC6H,06CH,03BH,03BH,06CH,OC6H,OOOH ; X 0_58 FD36 CCCCCC7830307800 5600 DB OCCH,OCCH,OCCH,07BH,030H,030H,078H,OOOH ; YO_59 FD3E FEe68CI83266FEOO 5601 DB OFEH.OC6H,08CH,OlBH,032:H,066H,OFEH,OOOH ; Z D_5A F046 7860606060607800 5602 DB 078H,060H,060H,060H,060H,060H,07BH,OOOH ; ( 0_5B F04E C06030180C060200 5603 DB OCOH,060H,030H,OI8H,00CH,006H,002H.000H ; BACKSLASH 0_5C FD56 7818181818187800 5604 DB 078H,018H,018H,018H,OI8H,OI8H.078H,OOOH ; I 0_50 F05E 10386CC600000000 5605 DB 010H,038H,06CH,OC6H,OOOH,OOOH,OOOH.OOOH j CIRCUMFLEX 0_5E F066 OOOOOOOOOOOOOOFF 5606 DB OOOH,OOOH,OOOH.OOOH.OOOH,OOOH,OOOH.OFFH ; _ 0_5F 5607 F06E 3030180000000000 5608 DB 030H,030H,OI6H,OOOH.000H,000H,OOOH,OOOH; 0_60 F076 0000780C7CCC7600 5609 DB 000H,OOOH.078H,OOCH,07CH,OCCH,076H.000H ; lOWER CASE A 0_61 F07E E060607C66660COO 5610 DB OEOH,060H,060H.07CH.066H,066H.OOCH.000H L.C. B 0_62 F086 000078CCCOCC7800 5611 DB OOOH,OOOH,078H.OCCH,OCOH,OCCH.078H,OOOH L.e. C 0_63 F08E lCOCOC7CCCCC7600 5612 DB OlCH.OOCH,OOCH,07CH,OCCH,OCCH.076H.000H L.C. D 0_64 FD96 000078CCFCC07800 5613 DB OOOH.OOOH,078H,OCCH,OFCH,OCOH,078H,000H L.C. E 0_65 Fo9E 386C60f06060FOOO 5614 DB 03BH,06CH,060H,OFOH,060H,060H,OFOH,OOOH ; l.C. F 0_66 FoA6 000076ccce7COCF8 5615 DB OOOH,OOOH,076H,OCCH,OCCH.07CH.OOCH.Of8H ; L.C. G 0_67 FOAE E0606C766666E600 5616 DB OEOH,060H.06CH,076H,066H,066H,OE6H,OOOH ; L.C. H 0_6B FOB6 3000703030307800 5617 DB 030H,OOOH,070H.030H,030H,030H.078H.000H ; L.C. I 0_69 FOBE OCOOOCOCOCCCCC78 5618 DB 00CH,OOOH,OOCH,OOCH,OOCH.OCCH.OCCH,078H ; L.C. J 0_6A FOC6 E060666C786CE600 561'9 DB OEOH,060H.066H,06CH,078H,06CH,OE6H.000H ; l.C. K 0_6B FOCE 7030303030307800 5620 DB 070H,030H,030H,030H,030H,030H,078H.OOOH ; l.C. L D_6C F006 OOOOCCFEFE06C600 5621 DB 000H,OOOH,OCCH.OFEH.OFEH,OD6H.OC6H.OOOH ; L.C. M 0_60 FooE OOOOF8CCCCCCCCOO 5622 DB OOOH,OOOH,OF8H,OCCH,OCCH,OCCH.OCCH.OOOH ; L.C. N 0_6E FoE6 000078CCCCCC7BOO 5623 DB OOOH,OOOH,078H,OCCH.OCCH,OCCH.078H,OOOH ; LC. 0 0_6F 5624 FoEE 00000C66667C60FO 5625 DB 000H.000H.ODCH,066H,066H,07CH.060H.OFOH ; L.C. P 0_70 FOF6 000076CCCC7COCIE 5626 DB OOOH,OOOH,076H,OCCH,OCCH.07CH,OOCH,01EH ; L.C. Q 0_71 FOFE OOOOOC766660FOOO 5627 DB OOOH,OOOH.ODCH,076H,066H,060H.OfOH,OOOH ; l.C. R 0_72 FE06 00007CC0780CF800 5628 DB OOOH,OOOH.07CH,OCOH,078H,OOCH,OF8H,OOOH i l.C. 50_73 HOE 10307C3030341800 5629 DB 010H.030H,07CH,030H,030H,034H,OlBH,OOOH ; LC. T 0_74 FEI6 00oocCCCCCCC7600 5630 DB OOOH.OOOH.OCCH,OCCH,OCCH,OCCH,076H,OOOH • l.t. U 0_75 FEIE OOOOCCCCCC783000 5631 DB 000H,OOOH,OCCH,OCCH,OCCH,078H,030H,OOOH I L.C. V 0_76 FE2:6 0000C606FEFE6COO 5632: DB 000H,OOOH,OC6H,006H,OFEH,OfEH,06CH,000H ; LC. W 0_77 FE2E 0000C66C386CC600 5633 DB OOOH,OOOH,OC6H,06CH,038H,06eH,OC6H,OOOH ; L.C. X 0_78 FE36 0000cceCCC7COCF8 5634 DB OOOH,OOOH,OCCH,OCCH,OCCH.07CH,OOCH,Of8H l.C. Y 0_79 FOE OOOOFC983064FCOO 5635 DB 000H,OOOH,OFCH,09BH,030H,064H,OFCH,OOOH ; L.C. Z 0_7A FE46 lC3030E030301COO 5636 DB OlCH, 030H, 0 30H, OEOH, 0 30H, 030H ,OlCH. OOOH; 0_78 FE4E 1818180018181800 5637 DB OI8H.018H.OIBH,000H,018H,018H.OIBH,OOOH; O_7C FE56 E030301C3030EOOO 5638 DB OEOH.030H,0301l,01CH.030H,030H.OEOH.000H; 0_70 FE5E 76OCOOOOOOOOOOOO 5639 DB 076H, ODCH, OOOH, OOOH, OOOH. OOOH, OOOH, OOOH O_7E FE66 0010386CC6C6FEOO 5640 DB OOOH,010H,038H,06CH,OC6H,OC6H,OFEH.000H ; DELTA o_7F A-76 LOC OBJ LINE SOURCE 5641 ;--- 1NT 1A ------------------------------- 5642 TIME_OF _OAY 5643 THIS ROUTINE ALLOWS THE ClOCK TO BE SET/READ 5644 5645 INPUT 5646 IAH) = 0 READ THE CURRENT CLOCK SETTING 5647 RETURNS ex '" HIGH POR rION OF COUNT 5648 OX = LOW PORTION OF COUNT 5649 Al = 0 IF TIMER HAS NOT PASSED 2't HOURS SINCE LAST READ 5650 <>0 IF ON ANOTHER DAY 5651 (AH) ::; 1 SET THE CURRENT ClOCK 5652 ex = HIGH PORTION OF COUtU 5653 ox = LOW PORTIOI'{ OF caUNT 5654 ; NOTE: COUNTS OCCUR AT THE RATE CF 1193180/65536 COUNTS/SEC 5655 (OR ABOUT 18.2 PER SECOND -- SEE EQUATES BElOWI 5656 ; --------------------- -- --------------------- 5657 ASSUME CS: CODE, OS:DATA FE6E 5658 TIME_OF _DAY PROC FAR FE6E FB 5659 STI INTERRUPTS BACK ON FE6F IE 5660 PUSH OS SAVE SEGMENT FE70 50 5661 PUSH AX SAVE PARM FE71 684000 5662 MOV AX,DATA FE74 8ED8 5663 MOV OS.AX ESTABLISH ADDRESSING TO VALUES FE76 58 5664 POP AX GET BACK INPUT PARM FE77 OAE4 5665 OR AH,AH ; AH=O fE79 7407 5666 JZ T2 ; READ_TIME FE7B FECC 5667 OEe AH AH;::l FE7D 7416 5666 JZ n SET_TIME FE7F 5669 Tl: TOO_RETURN FE7F FB 5670 STI INTERRUPTS BACK ON FE80 IF 5671 POP OS ; RECOVER SEGMENT FE81 CF 5672 JRET ; RETURN TO CALLER 5673 FE82 5674 T2: READ_TIME FE82 FA 5675 eLI NO TIMER INTERRUPTS WHILE READING FE83 A07000 5676 MOV AL,TIMER_OFL FE86 C606700000 5677 NOV TIHER_OFl.O ; GET OVERflOW, AND RESET THE FLAG FE8B 860E6EOO 5678 NOV ex, TIMER_HIGH FEaF 86166COO 5679 NOV OX. TIMER_LOW FE93 EBEA 5680 JMP Tl ; TOD_RETlmN 5681 FE95 5682 T3: SET_TIME FE95 FA 5683 eLI NO INTERRUPTS WHILE WRITING FE96 89166COO 5684 NOV TIMER_lOW, OX FE9A 890E6EOO 5665 NOV TIMER_HIGH,eX ; SET THE TIME FE9E C606700000 5686 NOV TIMER_OFL,O i RESET OVERFLOW fEA3 EBOA 5687 JNP Tl ; TOO_RETURN TIME_OF _DAY 5703 ; --------------------- - -- ------- -- ------ ----- FEA5 5704 TIMER_INT PROC fAR FEA5 FB 5705 STI ; INTERRUPTS BACK ON FEA6 IE 5706 PUSH OS FEA7 50 5707 PUSH AX FEA8 52 5708 PUSH OX ; SAVE MACHINE STATE FEA9 684000 5709 NOV AX,DATA FEAC 8ED8 5710 NOV OS.AX ESTABLISH AOORESSABIlITY FEAE FF066COO 5711 INC TIMER_LOW INCREMENT TIME FEBl 7504 5712 JNZ T4 TEST_DAY FEB4 FF066EOO 5713 INC TIMER_HIGH WCREMEtH HIGH WORD Of TIME FEBS 5714 T4: TE~T_OAf A-77 LOC OBJ LINE SOURCE FEes 833E6E0018 5715 CMP TIMER_HIGH.OI6H ; TEST FOR COUNT EQUALLING 24 HOURS FEBD 7519 5716 JHZ T5 I DISKETTE_CTl FEBF 813E6C008000 5717 CMP TIMER_LOW.OBOH FECS 7511 5718 JHZ T5 i DISKETTE_CTL 5719 5720 ;------ TIMER HAS GONE 24 HOURS 572:1 FEC7 C7066EOOOOOO 572:2 MOV TIMER_HIGH.O fEeD C7066COOOOOO 5723 NOV TIMER_lOW. 0 FEDl C606700001 5724 MOV TIMER_OFl.1 5725 5726 j------ TEST FOR DISKETTE TIME OUT 5727 FEDS 5728 T5: J DISKETTE_CTL FEDS fEOE4DOO 5729 DEC HOTOR.COUNT FEDe 7508 5730 JHZ T6 ; RETURN IF COUNT NOT OUT FEDE 80263FOOFO 5731 AHD MOTOR.STATUS,OFOH i TURN OFF MOTOR RtmNING BITS FEEl BODC 5732 NOV AL.OCH FEES SAFZ03 5733 NOV DX,03F2H ; FDC CTL PORT FEE8 EE 5734 OUT DX.AL TlIRN OFF THE f1OTOR 5735 F£E9 5736 T6: ; TIMER.RET: fEE9 COlt 5737 IHT ICH ; TRANSFER CONTROL TO A USER ROUTINE FEES BOZO 5738 NOV AL.EOI FEED E620 5739 OUT 020H.AL ; END OF INTERRUPT TO 8259 FEEr 5A 5740 POP OX FEFO 58 5741 POP AX fEFI IF 5742 POP OS j RESET MACHINE STATE FEF2 Cf 5743 IRET ; RETURN FROM INTERRUPT 5744 TIMER.INT ENOP 5745 ,-------------------------------------------- 5746 ; THESE ARE THE VECTORS WHICH ARE HOVEn INTO 5747 j THE 8086 INTERRUPT AREA DURING POWER ON FEF3 5748 5749 j-------------------------------------------- VECTOR.TABLE LABEL WORD VECTOR TABLE FOR MOVE TO INTERRUPTS 5750 FEF3 AS'E 5751 OW OFFSET TIMER.INT INTERRUPT 8 FEFS Oaf a 5752 OW COOE 5753 FEF7 87E9 5754 OW OFFSET KB.INT INTERRUPT 9 FEF9 DOFO 5755 OW CODE 5756 FEFB OOODOOOO 5757 DO ; INTERRUPT A FEFf 00000000 5758 DO INTERRUPT B FF03 00000000 5759 DO INTERRUPT C FF07 00000000 5760 00 INTERRUPT D 5761 FFOB 57EF 5762 OW OFFSET DISK.INT INTERRUPT E FFOD OOFO 5763 ow CODE 5764 FFOF 00000000 5765 DO INTERRUPT F 5766 FFl3 65FO 5767 DW OFFSET VIDEO.IO ; INTERRUPT 10H HIS OOFO 5768 DW COOE 5769 FFl7 40F8 5770 DW OFFSET EQUIPMENT INTERRUPT IlH FFI9 OOFO 5771 DW COOE 5772 FFlB 41F6 5773 DW OFFSET "EMORY.SIZE.DETERMINE ; tNT 12H HID DOFO 5774 OW COOE 5775 FFlf 59ft 5776 DW OFFSET DISKETTE.IO i INTERRUPT 13H HZ1 OOFO 5177 OW CODE 5778 fFZ3 39E7 5779 DW OFfSET RS232.IO i INTERRUPT 14H FF25 Doro 5780 OW COOE 5781 FFZ7 59F8 5782 DW OffSET CASSETTE.IO ; INTERRUPT ISH FF29 ooro 5783 DW CODE 5784 FF2:B 2EE8 5785 DW OFFSET KEYBDARD.IO ; INTERRUPT 16H FF20 OOFO 5786 DW CODE 5787 FFZf D2EF S7aa DW OFFSET PRINTER_IO INTERRUPT 17H FF31 OOFO 5789 DW CODE 5790 A-78 LOC OBJ LINE SOURCE FF33 0000 5791 DW ODaDaH INTERRUPT 16H FF35 DOF6 5792 DW OfbOOH ROM BASIC ENTRY POINT 5793 FF37 F2E6 5794 DW OfFSET BOOT_STRAP INTERRUPT 19H FF39 DOFO 579S DW CODE / 5796 FI3S '6EfE 5797 DW TIME_OF _DAY INTERRUPT lAH -- TIME OF DAY FF~D OOFO 5796 DW CODE 5799 FF3F 53fF 5800 DW OUNNY_RETURN INTERRUPT IBH -- KEYBOARD BREAK AOOR FF41 OOFO 5801 DW CODE 5802 FF43 53FF 5803 DW DUMMY_RETURN INTERRUPT Ie -- TIMER BREAK ADOR FF45 DOFO 5804 DW CODE 58(1S FF47 A4FO 580b DW VIDEO_PARMS INTERRUPT 10 -- VIDEO PARAMETERS Ff49 aOFO 5807 DW CODE 5808 FF4B C7EF 5809 DW OFFSET DISK_BASE INTERRUPT IE -- DISK PARM5 FF40 aOFO 5610 DW CODE 5811 FF4F 00000000 5812 DD INTERRUPT IF -- POINTER TO VIDEO EXT 5813 ff53 5814 DUMMY_RETURN: FF53 CF 5815 IRET ; DUHHY RETlJ'RN FOR BREAK FROM KEYBOARD 5B16 ,-- INT 5 ----------------------------------- SB17 THIS LOGIC WILL BE INVOKED BY INTERRUPT OSH TO PRINT 5816 THE SCREEN. THE CURSOR POSITION AT THE TIME THIS ROUTINE 5819 IS INVOKED WILL BE SAVED AND RESTORED UPON COMPLETION. THE 5820 ROUTH-IE IS INTENDED TO RUN WITH INTERRUPTS ENABLED. 5621 IF A SUBSEQUENT 'PRINT SCREEN KEY IS DEPRESSED DURING THE 5822 TIME THIS ROUTINE IS PRINTING IT WIll BE IGNORED. 5823 ADDRESS 50:0 CONTAINS THE STATUS OF THE PRINT SCREEN: 5824 582:5 50:0 EITHER PRINT SCREEN HAS NOT BEEN CALLED 5826 OR UPON RETURN FROM A CALL THIS INDICATES 5827 A SUCCESSFUL OPERATION. 5828 582:9 PRINT SCREEN IS IN PROGRESS 5830 5831 =377 ERROR ENCOUNTERED DURING PRINTING 5832: ; ------------~--- ---------------------------- 5633 ASSUME CS:CODE,DS:XXDATA 5834 FF54 5835 PRINT_SCREEN PRDe FAR FF54 F8 5636 ST! ,MUST RUN WITH INTERRUPTS ENASlED FF55 IE 5837 PUSH DS ; MUST USE 50: 0 FOR DATA AREA STORAGE FF56 50 5638 PUSH AX FFS7 53 5839 PUSH 8X FFS851 5840 PUSH ex ;WIlL USE THIS LATER FOR CURSOR lIMITS FF59 52 5841 PUSH DX ;WIlL HOLD CURRENT CURSOR POSITION FF5A B85000 5642: Mav AX.XXDATA ;HEX 50 FHO SEDS 5843 Mav DS.AX fF5F 803EOOOOOI 5844 eMP STATUS_BYTE. 1 ;SEE IF PRINT ALREADY IN PROGRESS FF64 745f 5845 JZ EXIT ; JUHP IF PRINT ALREADY IN PROGRESS H6t. C606000001 5846 MDV STATUS_BYTE. 1 ;INDICATE PRINT NOW IN PROGRESS FF68 B40F 5847 MaV AH,I5 ;WIlL REQUEST THE CURRENT SCREEN MODE FF6D COlO 5646 INT 10H { Al1=HODE 5849 [AH J=NUHBER COLUMNS/LINE 5850 [BH]=VISUAl PAGE 5851 5852 AT THIS POINT WE KNOW THE COLUMNS/LINE ARE IN 5853 {AX I AND THE PAGE IF APPLICABLE IS IN (Bli 1. THE STACK 5654 HAS DS,AX,BX,CX,DX PUSHED. [All HAS VIDEO HODE 58550 5856 ;************************************ FFbF BAce 5857 Mav CL,AH tWIll HAKE USE OF [eXI REGISTER TO FF71 8519 5858 MDV CH,25 ;CONTROL ROW & COLUMNS FF73 E85500 5859 CALL CRLF ;CARRIAGE RETURN LINE FEED ROUTINE ff76 51 5860 PUSH ex ;SAVE SCREEN BOUNDS FF77 8403 5861 Mav AH,3 ;WILL NOW READ THE CURSOR. FF79 COli) 5862 INT 10H ;AND PRESERVE THE POSITION FF7B 59 5863 POP ex ;RECALL SCREEN BOUNDS FF7C 52 5864 PUSH DX ;RECALL IBHJ=VISUAL PAGE FF7D 3302 5865 xaR OX.DX tWILl SET CURSOR POSITION TO [0,0] A-79 LOC OBJ LINE SOURCE 5866 ;******************************************** 5867 THE lOOP FROM PRllO TO THE INSTRUCTION PRIOR TO PRUO 5868 IS THE LOOP TO READ EAtH CURSOR POSITION FROH THE SCREEN 5669 AND PRINT. 5870 ;******************************************** H7F B402: 5671 PRIlO: MOV AH,2 ;TO INDICATE CURSOR SET REQUEST FFS1 COlO 5672 INT lOH ;NEW CURSOR POSITION ESTABLISHED FF83 8406 se73 MOV AH,8 ;TO INDICATE READ CHARACTER Has COlO 5874 INT 10H ;CHARACTER NOW IN (All FFS7 OAtO 5875 OR AL.AL ;SEE IF VALID CHAR FF89 7502: 5876 JHZ PRIIS ;JUMP IF VALID CHAR FF8B B020 5877 MOV AL~ , ,MAKE A BLANK. FF6D 5878 PR1l5: FF8D 52 5879 PUSH OX ;SAVE CURSOR POSITION FFeE 3302 5880 XOR OX,OX ; INDICATE PRINTER 1 FF90 32:E4 S8et XO. AH.AH ;TO INDICATE PRINT CHAR IN [AU FF92 CD17 5882 ~NT 17H ;PRINT THE CHARACTER FF94 5A 5883 pop OX jRECALL CURSOR POSITION Ff9S F6C425 5664 TEST AH, 25H ; TEST FOR PRINTER ERROR FF96 7521 5665 JHZ ERRIO ; JUMP IF ERROR DETECTED FF9A FEel 5866 IHC DL jAOVANCE TO NEXT COLUMN FF9C 3ACA 5867 CMP Cl,Dl iSEE IF AT END OF LINE FF9E 750F 5888 JHZ PRIIO ;IF NOT PROCEED FFAO 3202 5889 XOR Dl,DL j BACK TO COLUMN 0 FFAZ BA!!2 5690 MOV AH.Ol ;[AH]:::O FFA4 52 5691 PUSH ox i5AVE NEW CURSOR POSITION FFAS E82300 5692 CALL CRLF ; LINE FEED CARRIAGE RETURN FFAS SA 5693 POP ox IRECALl CURSOR POSITION FFA9 FEt6 5894 IHC OH ;ADVANCE TO NEXT LINE FFA8 3AEE "95 CMP CH,DH jFINISHED? FFAD 75DO 5696 JHZ PRIIO j IF NOT CONTINUE HAF SA 5897 PRIZO: POP OX JREtALL CURSOR POSITION HBD 8402 5698 MOV AH.:! ;TO INDICATE CURSOR SET REQUEST FFBl ColO 5899 IHT 10H ,CURSOR POSITION RESTORED FFB4 C606000000 5900 MOV STATUS_BYTE.O ;INDICATE FINISHED FFB9 EBOA 5901 JMP SHORT EXIT ;EXIT THE ROUTINE FFBB SA 5902 ERRI0: POP ox ;GET CURSOR POSITION ffBt 840Z 5903 MOV AH.Z ;TO REQUEST CURSOR SET FFBE COlO 5904 IHT 10H ;CURSOR POSITION RESTORED FfCD C606DOOOFf 5905 ERRZO: MOV STATUS_BYTE.OFFH ; INDICATE ERROR 590& fFC5 SA 5907 EXIT: POP ox ;RESTORE ALL THE REGISTERS USED FFC6 59 5908 POP ex HC7 58 5909 POP "X fFC6 58 5910 POP AX fFC9 I f 5911 POP DS FFCA CF 591Z IRET 5913 PRINT_SCREEN ENDP 5914 5915 ; ------ CARRIAGE RETURN. LINE fEED SUBROUTINE 5916 fFCB 5917 CRLf PRoe NEAR ffCB 3302 5918 XOR OX.OX ;PRINTER 0 FFCD 32E4 5919 XOR AH,AH ;WILL NOW SEND INITIAL LF ,eR TO PRINTER HCF BOOA 5920 MOV Al.IZQ ;LF FFOI CD17 5921 INT 17H ;SEND THE LINE FEED fF03 32E4 592Z XOR A.H.A.H INOW FOR TltE CR Ff05 BODO 5923 MOV AL.15Q oCR FF01 COl7 5924 IHT 17H JSEND THE CARRIAGE REruRN FF09 C3 5925 RET 5926 CRLF ENDP 5927 CODE ENDS 5928 5929 ;---------------------------------- 5930 I POWER ON RESET VECTOR 5931 ~---------------------------------- fFFF 5932 VECTOR SEGMENT AT OFFFFH 5933 5934 ; ------ POWER ON RESET 5935 0000 EA580000FO 5936 JMP RESET 5937 0005 3Q34lF32342F38 5938 DB ' 04/24181' ; RELEASE MARKER 31 5939 VECTOR ENDS 5940 END A-SO Notes For The BIOS Listing 1. The wait loop for the printer times out on fonn feed of > 51 lines. - line ref (3069) 2. Mode controls for the 320 x 200 video have Color/BW reversed. - line ref (3338) 3. The RS232 Timeout is 80 decimal, not 80 hexadecimal. - line ref (1566) 4. The Base Pointer register is destroyed by some video calls. 5. D_04 0 character in the character generator has 08 as it's last value, S/80. -line ref (5511) 6. If you hit print screen in the Color/Graphics 80x25 Character Mode, the screen may not display during the print cycle. A-Sl NOTES A-82 Appendix B. Assembly Instruction Set Reference B-1 8088 REGISTER MODEL AX: AH AL ACCUMULATO R BX: BH BL BASE W CX: CH CL COUNT -' LL. OX: DH DL DATA -'~ «W ~I­ SP STACK POINTER W~ BP r---------------------~ SI I BASE POINTER SOURCE INDEX Z(!:J WW (!:J~ I r---------------------~ ~==================~ 0 ESTI NATION INDEX 01 t - - - - - - - - -IP. - - - - - - - - - l l l NSTR UCTI 0 N POINTE R I FLAGSH I FLAGSL . STATUS FLAGS ~========~=======~==~ CODE SEGMENT ~ t CS } OS DATA SEGMENT I- ~ :=====================: SS ES STACK SEGMENT EXTRA SEGMENT ~~ ~~ ~---------------- ~~ Instructions which reference the flag register file as a 16-bit object use the symbol F LAGS to represent the file: 15 7 0 'X , X , X , X , OF , OF 'IF' TF , SF ZF I I X I AF I X I PF I X I CF I X = Don't Care AF: AUXILIARY CARRY - BCD} CF: CARRY FLAG PF: PARITY FLAG 8080 FLAGS SF: SIGN FLAG ZF: ZERO FLAG OF: DIRECTION FLAG (STRINGS)} IF: INTERRUPT ENABLE FLAG 8088 FLAGS OF: OVERFLOW FLAG (CF EB SF) TF: TRAP - SINGLE STEP FLAG B-2 OPERAND SUMMARY "reg" field Bit Assignments: 16-Bit (w=ll 8-Bit (w=O) Segment 000 AX 000 AL 00 ES 001 CX 001 CL 01 CS 010 DX 010 DL 10 SS 011 BX 011 BL 11 DS 100 SP 100 AH 101 BP 101 CH 110 SI 110 DH 111 DI 111 BH SECOND INSTRUCTION BYTE SUMMARY Imod Ixxx Irim I mod Displacement 00 DISP = 0*, disp-Iow and disp-high are absent 01 DISP = disp-Iow sign-extended to 16-bits, disp-high is absent 10 DISP = disp-high: disp-Iow 11 rim is treated as a "reg" field rim Operand Address 000 (BX) + (SI) + DlSP 001 (BX) + (01) + DISP 010 (BP) + (SI) + DISP 011 (BP) + (01)+ DlSP 100 (SI) + DlSP 101 (DI) + DISP 110 (BP) + DISP* 111 (BX)+DISP DlSP follows 2nd byte of instruction (before data if required). *except if mod = 00 and rim = 110 then EA = disp-high: disp-Iow. B-3 MEMORY SEGMENTATION MODEL o :t FFFFFH r LOGICAL ~ MEMORY SPACE 64KB CODE SEGMENT } ~ XXXXOH ~ } STACK SEGMENT DISPlA1EMENT 15 0 OFFSET ADO RES S I DISPLACEMENT r--~ I I I I MSB 15 I 0 I I WORD { SELECTED LSB } DATA SEGMENT SEGMENT CS 0000 f- BYTE REGISTER SS 0000 --I DS 0000 CS, SS, DS, ES ES 0000 OR NONE FOR I/O, INT J I I I I EXTRA DATA 7 } SEGMENT • \j I I I ADDER I I I 1: t OOOOOH 19 , '7 0 PHYSICAL ADD RESS LATCH SEGMENT OVERRIDE PREFIX I0 0 1 reg 1 1 0 I USE OF SEGMENT OVERRIDE OPERAND REGISTER DEFAULT WITH OVERRIDE PREFIX I P (code address) CS Never SP (stack address) SS Never BP (stack address or stack marked SS BP + OS or ES, or CS SI or 0 I (not incl. strings) OS ES, SS, or CS SI (implicit source addr for strings) OS ES, SS, or CS 01 (implicit dest addr for strings) ES Never B-4 DATA TRANSFER MOV = Move Register/memory to/ from register 11 0 0 0 1 0 d w I mod reg rIm Immediate to register/memory 1 1 0 0 0 1 1 w mod 0 0 0 rIm data data if w=l Immediate to register 1 0 1 1 w reg data data if w=l Memory to accumulator 1 0 1 0 0 0 0 w addr-Iow addr-high Accumulator to memory 1 0 1 0 0 0 1 w addr-Iow addr-high Register/memory to segment register 1 0 0 0 1 1 1 0 I mod 0 reg rIm Segment register to register/memory 1 0 0 0 1 1 0 0 mod 0 reg rIm PUSH = Push Register/memory 1 1 1 1 1 1 1 1 mod 1 1 0 rIm Register 0 1 0 1 0 reg Segment register I 0 0 0 reg 1 0 POP = Pop Register/memory 1 0 0 0 1 1 1 1 mod 0 0 0 rIm Register 1 0 1 1 reg 1 0 Segment register 1 0 0 0 reg 1 1 B-5 XCHG = Exchange Register/memory with register 11 0 0 0 0 1 1 w I mod reg rim Register with accumulator 11 0 0 1 0 reg I IN =Input to AL/AX from Fixed port 11 1 1 0 0 lOw port Variable port (OX) 11110110w OUT = Output from AL/AX to Fixed port 11 1 1 0 0 1 1 w port Variable port (OX) 11110111W XLAT = Translate byte to AL 1110101111 LEA = Load EA to register 1 0 0 0 1 1 0 1 I mod reg rim LDS = Load pointer to DS 11 1 0 0 0 1 0 1 mod reg r/m LES = Load pointer to ES 11 1 0 0 0 1 0 0 mod reg rim LAHF = Load AH with flags 1100111111 SAHF = Store AH into flags 1100111101 PUSHF = Push flags 110011100 POPF = Pop flags 110011101 B-6 ARITHMETIC ADD = Add Reg./memory with register to either 1 0 0 0 0 0 0 d w \ mod reg r/m I Immediate to register/memory 11 0 0 0 0 0 s w mod 0 0 0 rim data data if s:w=Ol \ Immediate to accumulator I0 0 0 0 0 lOw data data if w=l ADC = Add with carry Reg./memory with register to either 10 0 0 1 0 0 d w I mod reg rim Immediate to register/memory \1 0 0 0 0 0 s w mod 0 1 0 rim data data if s:w=Oll Immediate to accumulator I0001010w data data if w=l I INC = Increment Register /memory 11111111w mod 0 0 0 rIm Register 1 0 1 0 0 0 reg I AAA = ASCII adjust for add 100110111\ DAA = Decimal adjust for add 1001001111 SU B = Subtract Reg./memory and register to either I 0 0 1 0 1 0 d w I mod reg rim Immediate from register/memory 11 0 0 0 0 0 s w I mod 1 0 1 rIm data data if s:w=Ol \ Immediate from accumulator 0010110w data data if w=l B-7 SBB = Subtract with borrow Reg.!memory and register to either I 0 0 0 1 1 0 d w I mod reg rim Immediate from register/memory 11 0 0 0 0 0 s w I mod 0 1 1 rim data data if s:w=01 Immediate from accumulator 10001110w data data if w=1 DEC = Decrement Register/memory 11111111w mod 0 0 rim Registei" 1 0 1 0 0 1 reg I NEG = Change sign 1 1 111011w mod 0 1 1 rim CMP'" Compare Register/memory and register 10 0 1 1 1 0 d w I mod reg rim Immediate with register/memory 11 0 0 0 0 0 s w 1 mod 1 1 1 rim data data if s:w=Ol Immediate with accumulator I0 0 1 1 1 lOw I data data if w=1 AAS = ASCII adjust for subtract 1001111111 DAS = Decimal adjust for subtract 1001011111 MUL = Multiply (unsigned) 11 1 1 1 0 1 1 w 1 mod 1 0 0 rim IMUL = Integer multiply (signed) 11 1 1 1 0 1 1 w 1 mod 1 0 1 rim B-8 AAM = ASCII adjust for multiply \1 1 0 1 0 1 0 0 10 0 0 0 1 0 1 0 DIY = Divide (unsigned) 11111011w mod o rIm IDlY = Integer divide (signed) 11 1 1 1 0 1 1 w 1 mod rIm AAD =ASCII adjust for divide 111010101100001010 CBW = Convert byte to word 11 00110001 CWO = Convert word to double word 1100110011 lOGIC NOT =Invert 11111011W mod 0 1 0 rim SHl/SAl =Shift logical/arithmetic left 11 1 0 1 0 0 v w 1 mod 1 0 0 rIm SHR = Shift logical right 1 1 10100vW mod 1 0 1 r/m SAR = Shift arithmetic right 11 1 0 1 0 0 v w 1 mod 1 1 1 rIm ROl = Rotate left 1110100vw mod 0 0 0 rim ROR = Rotate right 1 11 0100vw mod 0 0 1 rim RCl = Rotate through carry left 11 1 0 1 0 0 v w 1 mod 0 1 0 rim RCR = Rotate through carry right 11 1 0 1 0 0 v w mod 0 1 1 rim B-9 AND = And Reg./memory and register to either \ 0 0 1 0 0 0 d w \ mod reg rim Immediate to register/memory 11 0 0 0 0 0 0 w 1 mod 1 0 0 rim data data if w=l Immediate to accumulator I 0 0 1 0 0 1 0 w 1 data data if w=l I TEST = And function to flags, no result Register/memory and register \1 0 0 0 0 1 0 w \ mod reg rim Immediate data and register/memory 11 1 1 1 0 1 1 w I mod 0 0 0 rim data data if w=1 Immediate data and accumulator 11 0 1 0 1 0 '-O-w-.--d-a-ta------.----d-a-ta-i-f-w-=1-' OR = Or Reg./memory and register to either I0 0 0 0 1 0 d w \ mod reg rim Immediate to register/memory \1 0 0 0 0 0 0 w I mod 0 0 1 rim data data if w=1 Immediate to accumulator I0000110w data data if w=1 XOR = Exclusive or Reg./memory and register to either 1 0 0 1 1 0 0 d w 1 mod reg rim Immediate to register/memory \1 0 0 0 0 0 0 w I mod 1 1 0 rim data data if w=1 Immediate to accumulator \001 1 0 1 0 w data data if w=1 B-lO STRING MANIPULATION REP = Repeat 111 1 1001 z 1 MOVS = Move String 11010010w CMPS = Compare String 11 0 1 0011w SCAS =Scan String /1010111w LOOS = Load String 11010110w STOS = Store String 11010101W CONTROL TRANSFER CALL = Call Direct within segment 11 1 1 0 1 0 0 0 disp-Iow disp-high Indirect within segment 11 1 1 1 1 1 1 mod 0 1 0 rIm Direct intersegment 11 0 0 1 1 0 1 0 offset-low offset-high seg-Iow seg-high Indirect intersegment 11 1 1 1 1 1 1 mod 0 1 1 rIm JMP = Unconditional Jump Direct within segment 11 1 1 0 1 0 0 1 I disp-Iow disp-high Direct within segment-short 11 1 1 0 1 0 1 1 I disp B-ll Indirect within segment 11111111 mod 1 0 0 rim Direct intersegment 111101010 offset-low offset-high seg-Iow seg-high Indirect intersegment 11111111 mod 1 0 1 rim RET = Return from CALL Within segment 111000011\ Within seg. adding immed to SP 11 1 0 0 0 0 1 0 1 data-low data-high Intersegment 1110 0 1 0 1 1 Intersegment, adding immediate to SP 11 1 0 0 1 0 1 0 I data-low data-high JE/JZ =Jump on equal/zero I 0 1 1 1 0 1 0 0 I disp JL/JNGE = Jump on less/not greater or equal I 0 1 1 1 1 1 0 0 I disp I JLE/JNG = Jump on less or equal/not greater I 0 1 1 1 1 1 1 0 I disp I JB/JNAE = Jump on below/not above or equal I0 1 1 1 0 0 1 0 I disp I JBE/JNA = Jump on below or equal/not above I0 1 1 1 0 1 1 0 I disp I JP/JPE = Jump on parity/parity even 10 1 1 1 1 0 1 0 I disp I JO = Jump on overflow I0 1 1 1 0 0 0 0 disp B-12 JS = Jump on sign 10 1 1 1 1 0 0 0 disp JNE/JNZ = Jump on not equal/not zero 1 0 1 1 1 0 1 0 1 1 disp I JNl/JGE =Jump on not less/greater or equal I0 1 1 1 1 1 0 1 I disp 1 JNLE/JG = Jump on not less or equal/greater I0 1 1 1 1 1 1 1 I disp I JNB/JAE = Jump on not below/above or equal I 0 1 1 1 0 0 1 1 I disp I JNBE/JA = Jump on not below or equal/above I0 1 1 1 0 1 1 1 I disp I JNP/JPO = Jump on not parity/parity odd 1 0 1 1 1 1 0 1 1 1 disp I JNO = Jump on not overflow I0 1 1 1 0 0 0 1 disp I JNS = Jump on not sign I0 1 1 1 1 0 0 1 disp I LOOP = Loop ex times 11 1 1 0 0 0 1 0 disp 1 LOOPZ/LOOPE = Loop while zero/equal 11 1 1 0 0 0 0 1 1 disp I LOOPNZ/LOOPNE = Loop while not zero/not equal 11 1 1 0 0 0 0 0 I disp I JCXZ = Jump on ex zero 11 1 1 0 0 0 1 1 disp B-13 8088 CONDITIONAL TRANSFER OPERATIONS Instruction Condition Interpretation JE or JZ ZF = 1 "equal" or "zero" Jl or JNGE (SF xor OF) = 1 "less" or "not greater or equal" JLE or JNG ((SP xor OF) or "less or equal" or "not greater" ZF) = 1 JB or JNAE CF = 1 "below" or "not above or equal" JBE or JNA (CForZF)= 1 "below or equal" or "not above" JP or JPE PF = 1 "parity" or "parity even" JO OF = 1 "overflow" JS SF = 1 "sign" JNE or JNZ ZF =0 "not equal" or "not zero" JNl or JGE (SF xor OF) = 0 "not less" or "greater or equal" JNlE or JG ((SF xor OF) or "not less or equal" or "greater" ZF) = 0 JNB or JAE CF =0 "not below" or "above or equal" JNBE or JA (CForZF)=O "not below or equal" or "above" JNP or JPO PF = 0 "not parity" or "parity odd" JNO OF =0 "not overflow" JNS SF = 0 "not sign" *"Above" and "below" refer to the relation between two unsigned values, while "greater" and "less" refer to the relation between two signed values. INT = Interrupt Type specified 11 1 0 0 1 1 0 1 type I Type 3 11 1 0 0 1 1 0 1 INTO = Interrupt on overflow \110011101 IRET = Interrupt return 11 1 001 1 1 1 PROCESSOR CONTROL ClC = Clear carry STC = Set carry 11111110001 11111100 CMC = Complement carry NOP = No operation 1111101011 1100100001 B-14 CLD = Clear direction STD = Set direction 1111111001 1 11 1 1 1 1 0 CLI = Clear interrupt STI = Set interrupt 1111110101 111111011 HLT= Halt WAIT = Wait 1111101001 110011011 LOCK = Bus lock prefix ESC = Escape (to external device) 1111100001 11 1 0 1 1 x x x mod x x x rim I Footnotes: if d = 1 then "to"; if d = 0 then "from" if w = 1 then word instruction; if w = 0 then byte instruction if s:w = 01 then 16 bits of immediate data from the operand if s:w = 11 then an immediate data byte is sign extended to form the 16-bit operand if v = 0 then "count" = 1; if v = 1 then "count" in (C U x = don't care z is used for some string primitives to compare with ZF FLAG AL = 8-bit accumulator AX = 16-bit accumulator CX = Count register DS = Data segment DX = Variable port register ES = Extra segment Above/below refers to unsigned value Greater = more positive; Less = less positive (more negative) signed values B-15 8088 INSTRUCTION SET MATRIX LO HI 0 1 2 3 4 5 6 7 0 ADD ADD ADD ADD ADD Add PUSH PDP b.f.r/m w.f.r/m b,t,r/m w,t,r/m b.ia w.ia ES ES 1 ADC ADC ADC ADC ADC ADC PUSH PDP b.f.r/m w.f.r/m b,t,r/m w,t,r/m b.i w.i SS SS 2 AND AND AND AND AND AND SEG DAA b.f.r/m w.f.r/m b,t,r/m w,t,r/m b.i w.i ~ES 3 XDR XDR XOR XOR XOR XOR SEG AAA b.f.r/m w,/,r/m b,t,r/m w,t,r/m b.i w.i ~SS 4 INC INC INC INC INC INC INC INC AX CX OX BX SP BP SI DI 5 PUSH PUSH PUSH PUSH PUSH PUSH PUSH PUSH AX CX OX BX SP BP 51 DI 6 7 JO JNO JBI JNBI JEI JNEI JBEI JNBEI JNAE JAE JZ JNZ JNA JA 8 Immed Immed Immed Immed TEST TEST XCHG XCHG b.r/m w.r/m b.r/m is.r/m b.r/m w.r/m b.r/m w.r/m 9 NOP XCHG XCHG XCHG XCHG XCHG XCHG XCHG CX DX BX 5P BP 51 01 A MOV MOV MOV MOV MOVS MOVS CMPS CMPS m~AL m~AX AL-+m AX"m b w b w B MOV MOV MOV MOV MOV MOV MOV MOV i~AL i+CL i-+DL i~Bl i+AH i+CH i .. DH i .. BH C RET. RET LES LDS MOV MOV (j+SP) b.i.r/m w.i.r/m D Shift Shift Shift Shift AAM AAD XLAT b w b.v w.v E LOOPNZI LOOPZI LOOP JCXZ IN IN OUT OUT LOOPNE LOOPE b w b w F LOCK REP REP HLT CMC Grp 1 Grp 1 Z b.r/m w.r/m b = byte operation m ~ memory d = direct rim = EA is second byte f ~ from CPU reg si = short intrasegment i = immediate sr = segment register ia = immed. to accum. t = to CPU reg id = indirect v = variable is = immed. byte, sign ext. w = word operation I = long ie. intersegment z = zero B-16 BOBBINSTRUCTION SET MATRIX LO 8 9 A B C 0 E F HI 0 OR OR OR OR OR OR PUSH b.f.r/m w.f.r/m b,t,r/m w,t,r/m b.i w.i CS 1 SBB SBB SBB SBB SBB SBB PUSH POP bJ.r/m w.f.r/m b,t.r/m w,t,r/m b.i w.i OS OS 2 SUB SUB SUB SUB SUB SUB SEG OAS b.l.r/m w.f.r/m b,t,r/m w,t,r/m b.i w.i CS 3 CMP CMP CMP CMP CMP CMP SEG AAS b.l.r/m w.l.r/m b,t,r/m w,t,r/m b.i w.i OS 4 DEC DEC DEC DEC DEC DEC DEC DEC AX CX OX BX SP BP SI 01 5 POP POP POP POP POP POP POP POP AX CX OX BX SP BP SI 01 6 7 JS JNS JPI JNPI JLI IN LI JLEI JNLEI JPE JPO JNGE JGE JNG JG 8 MOV MOV MOV MOV MOV LEA MOV POP b.l.r/m w.l.r/m b,t.r/m w,t,r/m sr.t.r/m sr.f.r/m rim 9 CBW CWO CALL WAIT PUSHF POPF SAHF LAHF I.d A TEST TEST STOS STOS LOOS LODS SCAS SeAS b.i w.i b w b w b w B MOV MOV MOV MOV MOV MOV MOV MOV i ... AX i~CX i~OX i",BX i~SP i... BP i... SI i... DI C RET RET INT INT INTO IRET 1,(j+SP) I Type 3 (Any) 0 ESC ESC ESC ESC ESC ESC ESC ESC 0 1 2 3 4 5 6 7 E CALL JMP JMP JMP IN IN OUT OUT d d I.d si.d v.b v.W v.b v.w F CLC STC CLI STI CLD STO Grp 2 Grp 2 b.r/m w.r/m where modO rim 000 001 010 011 100 101 100 III Immed ADD OR ADC SBB AND SUB XOR CMP Shilt ROL ROR RCL RCR SHLISAL SHR SAR Grp 1 TEST NOT NEG MUL IMUL DIV IDIV Grp 2 INC DEC CALL CALL JMP JMP PUSH id I,id id I,id B-17 INSTRUCTION SET INDEX Mnemonic Page Mnemonic Page Mnemonic Page AAA 6 JG 12 MOV 4 AAD 8 JGE 12 MOVS 10 AAM 8 Jl 11 MUl 7 AAS 7 JlE 11 NEG 7 ADC 6 JMP 10 NOP 13 ADD 6 JNA 11 NOT 8 AND 9 JNAE 11 OR 9 CAll 10 JNB 12 OUT 5 CBW 8 JNBE 12 POP 4 ClC 13 JNE 12 POPF 5 CLD 14 JNG 11 PUSH 4 CLI 14 JNGE 11 PUSHF 5 CMC 13 JNL 12 RCL 8 CMP 7 JNLE 12 RCR 8 CMPS 10 JNO 12 REP 10 CWD 8 JNP 12 RET 11 DAA 6 JNS 12 ROL 8 DAS 7 JNZ 12 ROR 8 DEC 7 JO 11 SAHF 5 DIV 8 JP 11 SAL 8 ESC 14 JPE 11 SAR 8 HLT 14 JPO 12 SBB 7 IDIV 8 JS 12 SCAS 10 IMUL 7 JZ 11 SHl 8 IN 5 LAHF 5 SHR 8 INC 6 LDS 5 STC 13 INT 13 LEA 5 S10 14 INTO 13 LES 5 STI 14 IRET 13 LOCK 14 STOS 10 JA 12 LODS 10 SUB 6 JAE 12 LOOP 12 TEST 9 JB 11 LOOPE 12 WAIT 14 JBE 11 LOOPNE 12 XCHG 5 JCXZ 12 LOOPNZ 12 XLAT 5 JE 11 LOOPZ 12 XOR 9 B-18 Appendix C. Of Characters Keystrokes and Color 08 8 BLACK DARK NON-DISPLAY GREY 09 9 BLACK LIGHT HIGH INTENSITY BLUE UNDERLINE BLACK LIGHT HIGH INTENSITY GREEN DB 11 CTRL K BLACK LIGHT HIGH INTENSITY d GREEN DC 12 CTRL L. BLACK LIGHT HIGH INTENSITY ~ REO 00 13 ) CTRL M• ..J BLACK LIGHT MAGENTA HIGH INTENSITY .J SHIFT 17 23 CTRLW LIGHT NORMAL 1 BLUE GREY C-I AS TEXT ATTRIBUTES COLOR/GRAPHICS IBM VALUE AS CHARACTERS MONOCHROME MONITOR AOAPTER OISPLAY HEX DEC SYMBOL KEYSTROKES MODES BACKGROUND FOREGROUND ADAPTER 18 24 CTRL X BLUE DARK HIGH INTENSITY I GREY 19 25 CTRl Y BLUE LIGHT HIGH INTENSITY I BLUE UNDERLINE 26 CTRL Z BLUE LIGHT lA - GREEN HIGH INTENSITY lB 27 CTRL L BLUE LIGHT HIGH INTENSITY - ESC, SHIFT ESC, CTRL CYAN ESC IC 28 CTRL '\ BLUE LIGHT HIGH INTENSITY L REO 10 29 - CTRL 1 BLUE LIGHT MAGENTA HIGH INTENSITY IE 30 ... CTRl6 BLUE YELLOW HIGH INTENSITY IF 31 T CTRL - BLUE WHITE HIGH INTENSITY 20 32 BLANK SPACE BAR, GREEN " BLACK NORMAL (SPACE SHIFT SPACE, CTRL SPACE, ALT SPACE , 21 33 ! ! SHIFT GREEN ~LUE UNDERLINE 22 34 " " SHIFT GREEN GREEN NORMAL 23 35 # :# SHIFT GREEN CYAN • NORMAL 24 36 $ $ SHIFT GREEN RED NORMAL 25 37 % % SHIFT GREEN MAGENTA NORMAL 26 38 & & SHIFT GREEN BROWN NORMAL 27 39 GREEN LIGHT. NORMAL GREY ~ 28 40 ( ( SHIFT GREEN OARK HIGH INTENSITY GREY 29 41 ) ) SHIFT GREEN LIGHT HIGH INTENSITY BLUE UNOERLINE 2A 42 * * NOTE 1 GREEN LIGHT HIGH INTENSITY GREEN 2B 43 + + SHIFT GREEN LIGHT CYAN HIGH INTENSITY 2C 44 GREEN LIGHT HIGH INTENSITY RED 20 45 - - GREEN LIGHT HIGH INTENSITY MAGENTA 2E 46 NOTE 2 GREEN YELLOW HIGH INTENSITY C-2 AS TEXT ATTRIBUTES COLOR/G RAPHICS IBM VALUE AS CHARACTERS MONOCHROME MONITOR AOAPTER OISPLAY HEX DEC SYMBOL IKEYSI HUI\t:) MODES McKG~QUN~ FOREGROUND ADAPTER 2F 47 / / GREEN WHITE IHIGH INTENSITY 30 48 0 0 INOTE 3 CYAN BLACK NOR 31 49 1 1 NOTE 3 E UNDERLINE 32 50 2 2 NOTE 3 CYAN GREEN NORMAL 33 3 NI 3 NO 34 NI 3 RED 35 5 NOTE 3 CY, ENTA l 36 54 6 6 NOTE 3 CYAN BROWN IMAl 37 55 7 7 NOTE 3 CYAN LIGHT NORMAL GREY 38 56 8 8 NOTE 3 CYAN DARK HIGH INTENSITY GREY ~ 39 57 9 9 NOTE 3 CYAN LIGHT HIGH INTENSITY ~ BLUE UNDERLINE ~ Ii 3A 58 : : SHIFT CYAN LIGHT HIGH INTENSITY GREEN 3B 59 ; ; CYAN LIGHT HIGH INTENSITY CYAN 3C 60 < < SHIFT CYAN LIGHT RED HIGH INTENSITY 3D 61 ~ ~ CYAN LIGHT HIGH INTENSITY MAGENTA 3E 62 > > SHIFT CYAN llOW HIGH I ITY 3F 63 ? ? SHIFT CYAN WHITE HIGH INTENSITY 40 64 @ @ SHIFT RED BLACK Al 41 65 A A NOTE 4 42 66 B B NOTE 4 RED GREEN IRMAl 43 67 C C NOTE 4 R CYAN l 44 68 0 0 NOTE 4 R 45 69 E E 4 REO MAG TA RMAl 46 70 F F NOTE 4 RED BROWN NORMAL 47 71 G G NOTE 4 RED LIGHT NORMAL GREY 48 72 H H NOTE 4 RED DARK HIGH INTENSITY GREY 49 73 I I NOTE 4 RED LIGHT HIGH INTENSITY BLUE UNDERLINE 4A 74 J J NOTE 4 REO LIGHT HIGH INTENSITY GREEN C-3 AS TEXT ATTRIBUTES COLOR/GRAPHICS IBM VALUE AS CHARACTERS MONOCHROME MONITOR AOAPTER OISPLAY HEX OEC SYMBOL KEYSTROKES MODES BACKGROUND FOREGROUND ADAPTER 48 75 K K NOTE 4 RED LIGHT HIGH INTENSITY CYAN 4C 76 L L NOTE 4 RED LIGHT HIGH INTENSITY RED 40 77 M M NOTE 4 RED LIGHT HIGH INTE~SITY MAGENTA 4E 78 N N NOTE 4 RED YELLOW HIGH INTENSITY 4F 79 0 0 NOTE 4 RED WHITE HIGH INTENSITY 50 80 P P NOTE 4 MAGENTA BLACK NORMAL 51 81 Q Q NOTE 4 MAGENTA BLUE UNDERLINE 52 82 R R NOTE 4 MAGENTA GREEN NORMAL 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 NORMAL GREY 58 88 X X NOTE 4 MAGENTA DARK HIGH INTENSITY GREY 59 89 Y Y NOTE 4 MAGENTA LIGHT HIGH INTENSITY BLUE UNDERLINE 5A 90 Z Z NOTE 4 MAGENTA LIGHT HIGH INTENSITY GREEN 5B 91 [ [ MAGENTA LIGHT HIGH INTENSITY CYAN 5C 92 MAGENTA LIGHT HIGH INTENSITY \ \ RED 50 93 I I MAGENTA LIGHT HIGH INTENSITY MAGENTA 5E 94 /\ /\ SHIFT MAGENTA YELLOW HIGH INTENSITY 5F 95 ~ - SHIFT MAGENTA WHITE HIGH INTENSITY 60 96 YELLOW BLACK NORMAL 61 97 a a NOTE 5 YELLOW BLUE UNDERLINE 62 98 b b NOTE 5 YELLOW GREEN NORMAL 63 99 c c NOTE 5 YELLOW CYAN NORMAL 64 100 d d NOTE 5 YELLOW RED NORMAL 65 101 e e NOTE 5 YELLOW MAGENTA NORMAL 66 102 f f NOTE 5 YELLOW BROWN NORMAL C-4 AS TEXT ATTRIBUTES I COLOR/GRAPHICS IBM I VALUE AS CHARACTERS MONOCHROME MONITOR ADAPTER I DISPLAY FOREGROUND I HEX DEC SYMBOL KEYSTROKES MODES BACKGROUND ADAPTER I 67 103 g g NOTE 5 YELLOW LIGHT NORMAL GREY I I 68 104 h h NOTE 5 YELLOW OARK HIGH INTENSITY GREY I LIGHT I 69 105 i i NOTE 5 YELLOW HIGH INTENSITY BLUE UNDERLINE I YELLOW LIGHT HIGH INTENSITY I 6A 106 j j NOTE 5 GREEN I NOTE 5 YELLOW LIGHT HIGH INTENSITY I 6B 107 k k CYAN I I I NOTE 5 YELLOW LIGHT HIGH INTENSITY I 6C 108 RED 60 6E 109 110 m n m n NOTE 5 NOTE 5 YELLOW YELLOW LIGHT MAGENTA YELLOW HIGH INTENSITY HIGH INTENSITY I'" ~I ~I 6F 111 0 a NOTE 5 YELLOW WHITE HIGH INTENSITY t= NOTE 5 BLACK REVERSE VIDEO t=1 70 112 p p WHITE I 71 113 q q NOTE 5 WHITE BLUE UNDERLINE -- I I 72 114 r r NOTE 5 WHITE GREEN NORMAL I 73 115 s s NOTE 5 WHITE CYAN NORMAL I 74 116 t t NOTE 5 WHITE RED NORMAL I 75 117 u u NOTE 5 WHITE MAGENTA NORMAL I 118 v v NOTE 5 WHITE BROWN NORMAL I 76 I 77 119 w w NOTE 5 WHITE LIGHT NORMAL GREY I I 78 120 x x NOTE 5 WHITE DARK REVERSE VIDEO GREY I I 79 121 Y Y NOTE 5 WHITE LIGHT HIGH INTENSITY BLUE UNDERLINE I I 'A 122 z z NOTE 5 WHITE LIGHT HIGH INTENSITY GREEN I I B 123 SHIFT WHITE LIGHT HIGH INTENSITY I I CYAN I I : 124 I I SHIFT WHITE LIGHT HIGH INTENSITY I I RED I I 125 I SHIFT WHITE LIGHT HIGH INTENSITY I I MAGENTA I I 126 "-' "-' SHIFT WHITE YELLOW HIGH INTENSITY 127 CTRL- WHITE WHITE HIGH INTENSITY b. C-S ------- AS TEXT ATTRIBUTES COLOR/GRAPHICS IBM VALUE AS CHARACTERS MONOCHROME MONITOR ADAPTER OISPLAY HEX DEC SYMBOL KEYSTROKES MODES BACKGROUND FOREGROUND ADAPTER * * * 80 HEX - FF HEX ARE FLASHING IN BOTH COLOR & IBM MONOCHROME * * * * 80 128 C[ ALT 128 NOTE 6 BLACK BLACK NON-DISPLAY 81 129 'u ALT 129 NOTE 6 BLACK BLUE UNDERLINE 82 130 -i AL T 130 NOTE 6 BLACK GREEN NORMAL 83 131 ~ ALT 131 NOTE 6 BLACK CYAN NORMAL 84 132 ii ALT 132 NOTE 6 BLACK RED NORMAL 85 133 ~ AL T 133 NOTE 6 BLACK MAGENTA NORMAL 86 134 it ALT 134 NOTE 6 BLACK BROWN NORMAL 87 135 AL T 135 NOTE 6 BLACK LIGHT NORMAL <1 GREY 88 136 ~ ALT 136 NOTE 6 BLACK DARK NON-DISPLAY GREY 89 137 e' AL T 137 NOTE 6 BLACK LIGHT HIGH INTENSITY BLUE UNDERLINED 8A 138 ~ AL T 138 NOTE 6 BLACK LIGHT HIGH INTENSITY GREEN 8B 139 i ALT 139 NOTE 6 BLACK LIGHT HIGH INTENSITY CYAN 8C 140 1- ALT 140 NOTE 6 BLACK LIGHT HIGH INTENSITY RED 80 141 l' AL T 141 NOTE 6 BLACK LIGHT HIGH INTENSITY MAGENTA 8E 142 A AL T 142 NOTE 6 BLACK YELLOW HIGH INTENSITY 8F 143 P- ALT 143 NOTE 6 BLACK WHITE HIGH INTENSIT'I' 90 144 "E ALT 144 NOTE 6 BLUE BLACK NORMAL 91 145 ce ALT 145 NOTE 6 BLUE BLUE UNDERLINE 92 146 FE AL T 146 NOTE 6 BLUE GREEN NORMAL 93 147 ~ ALT 147 NOTE 6 BLUE CYAN NORMAL 94 148 '0 ALT 148 NOTE 6 BLUE RED NORMAL 95 149 0'-- ALT 149 NOTE 6 BLUE MAGENTA NORMAL 96 150 'i} ALT 150 NOTE 6 BLUE BROWN NORMAL 97 151 il' ALT 151 NOTE 6 BLUE LIGHT NORMAL GREY 98 152 y AL T 152 NOTE 6 BLUE DARK HIGH INTEN~ GREY 99 153 0 AL T 153 NOTE 6 BLUE LIGHT HIGH INTEN~ BLUE UNDERLINE 9A 154 ij ALT 154 NOTE 6 BLUE LIGHT HIGH INTEN GREEN C-6 AS TEXT ATTRIBUTES COLOR/GRAPHICS IBM VALUE AS CHARACTERS MONOCHROME MONITOR ADAPTER DISPLAY HEX DEC SYMBOL KEYSTROKES MODES BACKGROUND FOREGROUND ADAPTER 9B 155 ¢ ALT 155 NOTE 6 BLUE LIGHT HIGH INTENSITY CYAN 9C 156 AL T 156 NOTE 6 BLUE LIGHT HIGH INTENSITY £ REO 90 157 Y- AL T 157 NOTE 6 BLUE LIGHT HIGH INTENSITY T MAGENTA 9E 158 Pts ALT 158 NOTE 6 BLUE YELLOW HIGH INTENSITY 9F 159 f AL T 159 NOTE 6 BLUE WHITE HIGH INTENSITY AO 160 -1i AL T 160 NOTE 6 GREEN BLACK NORMAL /. Al 161 I ALT 161 NOTE 6 GREEN BLUE UNOERLINE A2 162 "'--0 ALT 162 NOTE 6 GREEN GREEN NORMAL A3 163 --lI AL T 163 NOTE 6 GREEN CYAN NORMAL "v A4 164 n AL T 164 NOTE 6 GREEN REO NORMAL "v A5 165 N ALT 165 NOTE 6 GREEN MAGENTA NORMAL A6 166 ~ ALT 166 NOTE 6 GREEN BROWN NORMAL A7 167 2- Al T 167 NOTE 6 GREEN LIGHT NORMAL GREY A8 168 Al T 168 NOTE 6 GREEN OARK HIGH INTENSITY i, GREY A9 169 Al T 169 NOTE 6 GREEN LIGHT HIGH INTENSITY I BLUE UNDERLINE AA 170 --, AlT 170 NOTE 6 GREEN LIGHT GREEN HIGH INTENSITY AB 171 Y, ALT 171 NOTE 6 GREEN LIGHT HIGH INTENSITY CYAN AC 172 ,. AlT 172 NOTE 6 GREEN LIGHT HIGH INTENSITY RED AO 173 Al T 173 NOTE 6 GREEN LIGHT HIGH INTENSITY I MAGENTA 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 Bl 177 ~~ AL T 177 NOTE 6 CYAN BLUE UNDERLINE B2 178 /y~ ALT 178 NOTE 6 CYAN GREEN NORMAL B3 179 ALT 179 NOTE 6 CYAN CYAN NORMAL B4 180 I - - ALT 180 NOTE 6 CYAN REO NORMAL B5 181 !:::= ALT 181 NOTE 6 CYAN MAGENTA NORMAL B6 182 ..........,1 ALT 182 NOTE 6 CYAN BROWN NORMAL C-7 AS TEXT ATTRIBUTES COLOR/GRAPHICS IBM VALUE AS CHARACTERS MONOCHROME MONITOR ADAPTER DISPLAY HEX DEC SYMBOL KEYSTROKES MODES BACKGROUND FOREGROUND ADAPTER B7 183 ALT 183 NOTE 6 CYAN LIGHT NORMAL III GREY B8 184 ALT 184 NOTE 6 CYAN DARK HIGH INTENSITY I I GREY B9 185 ~ ALT 185 NOTE 6 CYAN LIGHT BLUE HIGH INTENSITY UNDERLINE BA 186 ALT 186 NOTE 6 CYAN LIGHT HIGH INTENSITY GREEN BB 187 ALT 187 NOTE 6 CYAN LIGHT HIGH INTENSITY f=il CYAN BC 188 ~ ALT 188 NOTE 6 CYAN LIGHT RED HIGH INTENSITY BD 189 W ALT 189 NOTE 6 CYAN LIGHT MAGENTA HIGH INTENSITY BE 190 ~ ALT 190 NOTE 6 CYAN YELLOW HIGH INTENSITY BF 191 NOTE 6 CYAN WHITE HIGH INTENSITY II ALT 191 CO 192 L- ALT 192 NOTE 6 REO BLACK NORMAL Cl 193 ALT 193 NOTE 6 REO BLUE UNDERLINE C2 194 ALT 194 NOTE 6 RED GREEN NORMAL I C3 195 ~ ALT 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 r- ALT 199 NOTE 6 RED LIGHT GREY NORMAL C8 200 ....::::: ALT 200 NOTE 6 RED DARK GREY HIGH INTENSITY C9 201 rr= ALT 201 NOTE 6 RED LIGHT BLUE HIGH INTENSITY UNDERLINE CA 202 WL ALT 202 NOTE 6 RED LIGHT GREEN HIGH INTENSITY CB 203 ALT 203 NOTE 6 RED LIGHT HIGH INTENSITY r-r- CYAN CC CD 204 205 P= AL T 204 ALT 205 NOTE 6 NOTE 6 RED RED LIGHT RED LIGHT HIGH INTENSITY HIGH INTENSITY MAGENTA CE 206 I~~ ALT 206 NOTE 6 RED YELLOW HIGH INTENSITY CF 207 ALT 207 NOTE 6 RED WHITE HIGH INTENSITY DO 208 II ALT 208 NOTE 6 MAGENTA BLACK NORMAL C-8 AS TEXT ATTRIBUTES COLOR/GRAPHICS IBM VALUE AS CHARACTERS MONOCHROME MONITOR ADAPTER DISPLAY HEX DEc SYMBOL IKEYSTROKES MODES BACKGROUND FOREGROUND ADAPTER 01 209 AL T 209 NOTE 6 MAGENTA BLUE UNDERLINE 02 210 ILT 210 NOTE 6 MAGENTA GREEN NORMAL 03 211 LL- LT 211 NOTE 6 MAGENTA CYAN NORMAL 04 212 I::::::: ALT 212 NOTE 6 MAGENTA REO NORMAL 05 213 F= AL T 213 NOTE 6 MAGENTA MAGENTA NORMAL 06 214 ~ AL T 214 NOTE 6 MAGENTA BROWN NORMAL 07 215 ALT215 NOTE 6 MAGENTA LIGHT NORMAL GREY 08 216 ALT 216 NOTE 6 MAGENTA DARK HIGH INTENSITY GREY 09 217 I - - AL T 217 NOTE 6 MAGENTA LIGHT HIGH INTENSITY BLUE UNDERLINE OA 218 ALT 218 NOTE 6 MAGENTA LIGHT HIGH INTENSITY ~ GREEN ~ ~ DB ~ 219 AL T 219 NOTE 6 MAGENTA LIGHT CYAN HIGH INTENSITY ; DC 220 AL T 220 NOTE 6 MAGENTA LIGHT HIGH INTENSITY REO 00 221 ALT 221 NOTE 6 MAGENTA LIGHT HIGH INTENSITY MAGENTA DE 222 ALT 222 NOTE 6 MAGENTA YELLOW HIGH INTENSITY OF 223 ALT 223 NOTE 6 MAGENTA WHITE HIGH INTENSITY 224 ex: IN 6 BLACK NORMAL E1 225 {j AL 225 INOTE 6 E2 226 Y 226 INOTE 6 YELLOW GREEN E3 227 1T AL T 227 NOTE 6 YELLOW CYAN NORMAL 228 ~ ALT 228 INOTE 6 YELLOW REO ~MAL E5 229 6"' I AL" 229 NOTE 6 YELLOW NORMAL E6 230 r I AL T 230 INOTE 6 YELLOW BROWN NORMAL E7 231 AL T 231 NOTE 6 YELLOW LIGHT NORMAL 7" GREY E8 232 AL T 232 NOTE 6 YELLOW DARK HIGH INTENSITY GREY E9 233 -e- AL T 233 NOTE 6 YELLOW LIGHT BLUE HIGH INTENSITY UNDERLINE EA 234 n ALT 234 NOTE 6 YELLOW LIGHT GREEN HIGH INTENSITY EB 235 AL T 235 NOTE 6 YELLOW LIGHT HIGH INTENSITY ~ CYAN C-9 AS TEXT ATTRIBUTES COLOR/GRAPHICS IBM VALUE AS CHARACTERS MONOCHROME MONITOR AOAPTER DISPLAY HEX DEC SYMBOL KEYSTROKES MODES BACKGROUND FOREGROUND ADAPTER EC 236 00 ALT 236 NOTE 6 YELLOW LIGHT HIGH INTENSITY RED ED 237 ALT 237 NOTE 6 YELlOW q, LIGHT MAGENTA HIGH INTENSITY EE 238 E ALT 238 NOTE 6 YELLOW YELLOW HIGH INTENSITY EF 239 n ALT 239 NOTE 6 YELLOW WHITE HIGH INTENSITY FO 240 - ALT 240 NOTE 6 WHITE BLACK REVERSE VIDEO F1 241 ± ALT 241 NOTE 6 WHITE BLUE UNDERLINE F2 242 ;:> ALT 242 NOTE 6 WHITE GREEN NORMAL F3 243 .;;;; ALT 243 NOTE 6 WHITE CYAN NORMAL F4 244 (' ALT 244 NOTE 6 WHITE RED NORMAL F5 245 ..J ALT 245 NOTE 6 WHITE MAGENTA NORMAL F6 246 ALT 246 NOTE 6 WHITE BROWN NORMAL F7 247 ALT 247 NOTE 6 WHITE LIGHT NORMAL ~ GREY F8 248 ALT 248 NOTE 6 WHITE DARK REVERSE VIDEO 0 GREY F9 FA 249 250 • ALT 249 ALT 250 NOTE 6 NOTE 6 WHITE WHITE LIGHT BLUE LIGHT HIGH INTENSITY UNDERLINE HIGH INTENSITY • GREEN FB 251 ALT 251 NOTE 6 WHITE LIGHT HIGH INTENSITY ~ CYAN FC 252 n ALT 252 NOTE 6 WHITE LIGHT RED HIGH INTENSITY FD 253 2 ALT 253 NOTE 6 WHITE LIGHT HIGH INTENSITY MAGENTA FE 254 I ALT 254 NOTE 6 WHITE YELLOW HIGH INTENSITY FF 255 BLANK ALT 255 NOTE 6 WHITE WHITE HIGH INTENSITY C-IO NOTE 1 Asterisk (*) can easily be keyed using two methods: I I 1) hit the PRTSC key or 2) in shift mode hit the [;] key. * NOTE 2 Period (.) can easily be keyed using two methods: 1) hit the[8 key or 2) in shift or NUM LOCK I mode hit the d~11 key. NOTE 3 Numeric characters (0-9) can easily be keyed using two methods: 1) hit the numeric keys on the top row of the typewriter portion of the keyboard or 2) in shift or NUM LOCK mode hit the numeric keys in the 10-key pad portion of the keyboard. NOTE 4 Upper case alphabetic characters (A-Z) can easily be keyed in two modes: 1) in shift mode hit the appropriate alphabetic key or 2) in CAPS LOCK mode hit the appropriate alphabetic key. NOTE 5 Lower case alphabetic characters (a-z) can easily be keyed in two modes: 1) in "normal" mode hit the appropriate alphabetic key or 2) in CAPS LOCK combined with shift mode hit the appropriate alphabetic key. NOTE 6 The 3 digits after the ALT key must be typed from the numeric key pad (keys 71-73,75-77,79-82). Character codes 000 through 255 can be entered in this fashion. C-ll Character Set (OO-7F) Quick Reference VALUE • • DECIMAL HEXA· DECIMAL 0 0 16 1 32 48 2 3 64 80 4 5 96 112 6 7 p , P IVALUE , 0 @ BLANK 0 0 (NULL) ~ BLANK (SPACE) 1 1 g ...... . 1 A Q a q 2 3 2 3 -• " ! 2 B R b r II .. 41= 3 C S c s 4 4 + N /\ n 'L, -¢- ... / · 0 - 15 F ? 0 ~ C-12 AS TEXT ATTRIBUTES COLOR/GRAPHICS IBM VALUE AS CHARACTERS MONOCHROME MONITOR AOAPTER OISPLAY HEX OEC SYMBOL KEYSTROKES MODES BACKGROUND FOREGROUND ADAPTER 67 103 9 9 NOTE 5 YELLOW LIGHT NORMAL GREY 68 104 h h NOTE 5 YELLOW DARK HIGH INTENSITY GREY 69 105 i i NOTE 5 YELLOW LIGHT HIGH INTENSITY BLUE UNOERLINE 6A 106 i i NOTE 5 YELLOW LIGHT HIGH INTENSITY GREEN 6B 107 k k NOTE 5 YELLOW LIGHT HIGH INTENSITY CYAN 6C 108 I I NOTE 5 YELLOW LIGHT HIGH INTENSITY REO 60 109 m m NOTE 5 YELLOW LIGHT HIGH INTENSITY MAGENTA ~ 6E 110 n n NOTE 5 YELLOW YELLOW HIGH INTENSITY ~ ;;: 6F 111 0 0 NOTE 5 YELLOW WHITE HIGH INTENSITY :::: 70 112 p p NOTE 5 WHITE BLACK REVERSE VIDEO iii 71 113 q q NOTE 5 WHITE BLUE UNDERLINE 72 114 r r NOTE 5 WHITE GREEN NORMAL 73 115 s s NOTE 5 WHITE CYAN NORMAL 74 116 t t NOTE 5 WHITE REO NORMAL 75 117 u u NOTE 5 WHITE MAGENTA NORMAL 76 118 v v NOTE 5 WHITE BROWN NORMAL 77 119 w w NOTE 5 WHITE LIGHT NORMAL GREY 78 120 x x NOTE 5 WHITE DARK REVERSE VIDEO GREY 79 121 y y NOTE 5 WHITE LIGHT HIGH INTENSITY BLUE UNDERLINE 7A 122 z z NOTE 5 WHITE LIGHT HIGH INTENSITY GREEN 7B 123 I SHIFT WHITE LIGHT HIGH INTENSITY I I CYAN 7C 124 I I SHIFT WHITE LIGHT HIGH INTENSITY I I REO 70 125 SHIFT WHITE LIGHT HIGH INTENSITY I I I MAGENTA 7E 126 ~ ~ SHIFT WHITE YELLOW HIGH INTENSITY 7F 127 b. CTRL- WHITE WHITE HIGH INTENSITY C-5 AS TEXT ATTRIBUTES COLOR/GRAPHICS IBM VALUE AS CHARACTERS MONOCHROME MONITOR AOAPTER DISPLAY HEX DEC SYMBOL KEYSTROKES MOOES BACKGROUND FOREGROUND ADAPTER * * * 80 HEX - FF HEX ARE FLASHING IN BOTH COLOR & IBM MONOCHROME * * * * 80 128 /' /' 2 2 I 3 3 1\ 1\ a 0 u /' lL 1T < t-- - 4 ·. ·. n --'"'./ b L ( 4 a 0 -..; F (J' J '- '- 5 5 a 0 N= 0 1\ a ~ - .. 6 6 a u - --t F= - 7 8 7 8 C; u 0 -n 1\ '- ·. • e ·y. (, 9 r --0 9 9 e·. 0. . I :1 e ~ • 10 A e·. U ---, '- . ¢ ~ UL n • 11 B 1 =, r-Ir 0 -r ~ 12 c £ 14 :::::! 1] , 00 1 ~ '- Y- o 13 D 0 .1. T 0 2 14 E A Pts « d ~. E I 15 F A f »I n BLANK 'FF' C-l3 NOTES C-14 APPENDIX D LOGIC DIAGRAMS Contents: System Board .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-2 Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-12 IBM Monochrome Display And Parallel Printer Adapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-14 IBM Monochrome Display. . . . . . . . . . . . . . . . . . . . . . . D-24 Color/Graphics Monitor Adapter. . . . . . . . . . . . . . . . . D-25 IBM 80 CPS Matrix Printer. . . . . . . . . . . . . . . . . . . . . . D-31 Parallel Printer Adapter. . . . . . . . . . . . . . . . . . . . . . . . . . D-34 5 1/4" Diskette Drive Adapter. . . . . . . . . . . . . . . . . . . . D-35 5 1/4" Diskette Drive. . . . . . . . . . . . . . . . . . . . . . . . . . . . D-39 32 KB Memory Expansion . . . . . . . . . . . . . . . . . . . . . . . D-42 64 KB Memory Expansion . . . . . . . . . . . . . . . . . . . . . . . D-45 Asynchronous Communications Adapter .. . . . . . . . . D-48 Game Control Adapter. . . . . . . . . . . . . . . . . . . . . . . . . . . D-49 D-I SYSTEM BOARD (PROCESSOR AND SUPPORT) 51 ~o ~0 18~ I£I~ --. N M Q '=.... Q 1:: Q eo eo = en "Q .. C c:t Q ..'" ~ Q ~ 'E '" Q /XI E '" 1;; ~ Note: Logics one and two of twelve are not applicable D-2 SYSTEM BOARD (WAIT STATE GENERATOR) - '" ~ [j ~ E 8,; ~ i£ ~- ~- ~ Ii • Ii f' If " ~ I• I~ -+-+-_J I~ I~I~ I~ I","" I~ <0 I! '" V J U ;; ~ f:i: § ~~e6 D·3 SYSTEM BOARD (DEVICE DECODES) ~ ~§§~€ ~~~~ ~~~-~~~~ IIIIII 0~ ~ ~ -..... N .- o In o :~ ~~- ...I ~ -;;; ....... ;' o~ ~-- "'CI o J -, , C .... "i " c I I , -- " ~(, I J . 'J,; I , D-4 SYSTEM BOARD (DMA) ~ "?;;;;:;::;;::; !: ~ ~ ~::::::. II ~~Ii~ N II 111111111 i 11111111 ~~:;~ 1~~~~181~1~1~ ~~O'i) ';: c '" :::I cr::a = 'C en I [ I,I' D-6 SYSTEM BOARD (DYNAMIC MEMORY) ,I \j I ------"l -.... N CI co 's, .....CI ~ CI E . GO :aE 's... c > C ...... "CI CI CCI E !l ~ D-? SYSTEM BOARD (DYNAMIC MEMORY EXTENDED) ... - N co en ... ';;' co ..... :c- CD "CI ~ w i!" CI E CD ::!: ... 's c'" Q > rllllill 11 I~ D-8 SYSTEM BOARD (SPEAKER/CASSETTE/TIMER/COUNTER) -- N Q «:) ... .!:! «:) ..... I~ D-9 SYSTEM BOARD (KEYBOARD/SENSE/CONTROL) - N ~ D-I0 SYSTEM BOARD (I/O CHANNEL) -. N o os C ..... -:;; C = '" .c Co) -- C D-II ;;:: - t=' I N m < Ill:! C l> :::D C POWER -v AOI C~ C3 +f 6.2ul .047""f GND ~ AO~ 2 x: 471lH C6 R2 22 CLOCK OUT 4 LI P21 2.0 1 ~KIl 20.~1:~ C2 ......1. X2 2 U2 I 3 51PF CLOCK 8048 A09 AOI CONNECTOR 20.1 A03 I ? EA UI PI 1 GND To VSS RI R3 C7 C ~ AD? 2.0 KJl 2.0KJl OIPF 01 PI' A09 T b INT A08 POWER+~V 2b VDD PIO 27 -REG IN . II U2 12 ~ VCC ~ A03 CNT b4 18 DBb 810 23 DATA OUT ~ CONNECTOR CNT 32 11 DB~ P22 B09 ~b P2 CNTlb Ib DB4 B08 DATA CNT 8 I~ DB3 BO'+ ~ A07 CNT 4 14 DB2 B03 CNT 2 13 DBI BOI CNT I 12 DBO ~ AO'+ +KEY DEPRESSED 39 TI AID - MATRIX STROBE 21 P20 2B DATA IN 8 U2 9 ADZ PII 4 RES I Keyboard Logic 1 of 2 KEYBOARD - N N Q u ';;' Q ...... . "Q '" Q ..c > '" ~ ~ . 0 ~I ~!I r--r--;-------;-1 11 ~!ej f \l , I I ~ s ~ g ~ ~ = I ~I~I ~ 1 I ~ j r j i r 1 jI =;;;;. ~ iii "~ ~ ~ ~ '3i "~ ~ I ~ ~ ~ ~~~ 0-13 IBM MONOCHROME DISPLAY AND PARALLEL PAINTER ADAPTER , , t ~ i ~ g 00 D ~ ~ S 0 1: !,"1 ~ l ~ if { ~~n ;;; ~ ~ ~ ~ ~ ~.e;i- Note: Logics one and two of twelve are not applicable. D-14 Ill! !: (SHTl) !: c (SI1T1) 2 (5HT 8.12,) C (SHT ~) M (SHT ~) T (SHTB ,1'2.) :::c :1:1 C !: (SHT1) rn (SHT l) CI (SHTll ...sa ~ (SHT1) (SHTE:.:) (SHT '5) (SHTl) T (SI-T8.'O l> 2 CI (;IH,) ." (SHT l) l> :1:1 (SHTl: ...... l> (5HT8) ... rn T (5HT7,6) AT] T (SI-T7.6) ." :1:1 2 (SHT 5) .... rn (SHTl) (SHTEl) AT< Alb An (5HT7,8) T (5HT7,8) = l> CI (SIHl) (5HTl) l> (SHTb) ~ (SHT&) rn (SHT <;i) = (SHT <;i) - 0 I VI IBM Monochrome Display And Parallel Printer Adapter Logic 4 of 12 o XIONldd" IBM MONOCHROME DISPLAY AND PARAllEl PRINTER ADAPTER '" J'~ ~ ; ; ;; ~ ~~ " ~, ~ ~ ~ ~ ~ ~ ~ ~ ~ r I 8 ~ ~ ~ 0 .~ > . v ~~ ~ ':; = ~ (f IJ , . 0 ~~ 8i:? 0; v I < ;ll.~ ~, L-L44-~~~ -. N Q In ';;' .... Q ~ N ,.: ':: i ' l l ' h ;~f~ "ru -I' ]! ~h 1 ~HI' t ~ ~ I "'=~ c 1 ~~ '---1 I ~~~ ~-: i! 8:. "CI C CC 1,1, ~ ,~ s ~ 0 §~~ ~ : ~ • L-~ili+l~,~.d_d ~""N~U -rc- :1 ~: j 5 ~ 'ii. .,. C '" E .. Q I ~~~ .c ~- Q C Q :E :E IlQ ;0: i:j'~!!.: Vi ,<.'> rI ~ ~ v ~ ~ !i ~ ~ ~ " ~ ~ 'i t~ roro ~~ ~ ~ I- I VI 1-1-1- :;;::I::r ",,,,VI ~ u <. ~ ~ ~ ~~ E 3 ~ + " ~ g ~ ~~ i!~ I I i L I I i I i ~ : --. I. i I I I N ! 0 CC I I I ';;' I [ I .. 0 ....I :l Co «'". "C 0 ...'" c .;: - ~ 1 - , a.. ]i 1! '" a.. "C C « > '" is. .~ CI '" E .. f ..c 0 C 0 :E :E a::I o a ~ I I R DLY G(8) ------;;'""1 I'), ATbX ---11. '9 R(B) AT. (SHT'n r- ~ ~I" (5HT4) AT7 AnX " '"'32 2: (5HTc») ..... '01:.0 ~N~\',~t. CI (5HT<;) +(ClK r1E>14<,' -a ------'-q - 18 (LR " '" <=-- 1"1 i _..I (LR eLK . --- . " '0 U2b • 9 '0 .-/}''--o_ __ UIt,'- • ALPHA (SHT9) » :ll (SHH) -RESET DOTS » .JL~ "I (SHT5) -CLRVIDEO r- r- 11 (SHT6) ~ r- I m -~,----- ~ -,-1") ~U27)J" ~.O '~o'----- (Sl-IT5) ~S ~ r- I ~G2A l ,'~,,'5 Cl CL' " -a ."-----i--1~' IYI~ ~ ~G2B - I ,''L502 i .2"-L.i'lL 1-,- -NOOSPLY ---- I i r va 1'5 '--' "m5CZ" ----- ____ ~ ~ +U~1.~~_ U29 20 2Q 1 RVY --- t.W VIDEO 'SK9: :=! 2: -I ,~Y7 2 U't90 12 U27 I 10 lQ m I L.:.-....:..:. __ _ ___ _ :ll r--r-~ G2A ~YD -15 ~B(O) I --- C,"R'''lI'>\I~'l) l> • ~'" ~:Y7 CI "v~:' t ' . -'(7) I I » (Si-IT9) SERDA-TA. L~==========~~~~~~U'~.~ - __~, ~I II m == :J:I (5HT';) +JUMPER --------- ~G2A ') G2B 1~7~OIt12 I (5HTI+) RA, - ~~IY4~~ 2.,", (SHTI.tl ." RAD '~ IBM Monochrome Display And Parallel Printer Adapter Logic 7 of 12 IBM MONOCHROME OISPLAY AND PARALLEL PRINTER ADAPTER 0 - "' ..... .". If'.,o ...... oDonoaOD 11I11I11 - N C) =... ';;' ........ C) ...... II> C. <.. 'C I ... II> C ';;: c... I :! "@ 1_, ) d! 'C < C ... > =.. o _ N '" T If' .,(l r-- s Il> ~~~~~~~~ Lf'.o t- g~~g;;g;;~ ~~~~~~~~ 0000 0000 ~ (0 m m i5 II> ..... I J '. I E [ I C) N' . m- -- .~I~ .. N, • ml= - -- N~ .. .: C) C ~'o ~ J~.-~ H~ <---N C) ~ ,~'~ ~ ::a: r ~"Inlil ';",~ lnl11 > 0 ::a: ~i-y' 'c ~lr - CCI i I ! I! I _ _~I [ I Ii -- - J - I - =.J I - ! I 1------- I i I I II [ I D_N",~l1'.,or-- vvvvvuuv vvvvvvuv ~ ~ ~ ~ ~ ~ ~ ~ ~ D-19 IBM MONOCHROME DISPLAY AND PARALLEL PRINTER ADAPTER ...'S N =. 'So CI ....I .. :l ,5 ct :! 1!... a.. -=c:: c( ...> 15. '" i5 ...E e . .c CI c:: CI ::E ::E 11:1 I ! II ~~~"r- __ ""'''''' Ql .... . " , l L "'''- Ql"- '-''-''''~~~~--' Q a::O::l..!>l..!>rnrn~- .922.=>:0;:;: ;(,'~ ~~ ~~ ~ ~~~ « ee ee D-20 IBM MONOCHROME DISPLAY AND PARALLEL PRINTER ADAPTER r~---A~~I ~ -.- 1111I111 ,... mTIm ~~~f\j:::.l~~?::; I _ II :!:f' - a:Q.Q.Q.a.Q.a.~~~E:~~~~B:a. 0: Q. ~ -... N = Q ~~i--+-+-t-+++-1 Hf--f--+-+--l-H (,I ..... ';;' Q i... "CI c( 111111 D-21 tj 1:1:1 i: I N i: N Q 74L5244 Z { Q DATA i.J 2~18 800 M }"". DATA I Ib BDI :: DATA 2 [)ATA , 14 12 BD2 BD, = Q "",,,", DATA 4 q i: j 804 m :l j""" ,+-- DATA S 7 BOo oATAb BOb C DATA 7 8D7 en"1:1 (:;HEET la, - RPA ~ 1 19 I"'" (SHEET 10) RPB 7'1LSIZS :I> PIN IS ERROR 9~,B -< 74LS04 :I> lb r PIN" + SlC T -} us 8 z J4 C = + PE 9 74 0 8 C 2.:!.!2ill "1:1 ~- r 2SPIN - PIN 12 ------!- G D-SHELL +Sv =ill) US4 8 7LjLS 02 I 2 A V :I> CONNECTOR PINIO~ ~ g U 1)7 4~ 6 . 14 = :I> + BUSY 8 12 I"'" PIN II I"'" -STROBE U .~ I m (SHEET 10) Y 9 I"'" " A "~ i+~ -AUTO FDXT (SHEET 10) "1:1 (SHEET 10) -RPC c, 74lS 12') c (SHEET 10) :I> 74LS 12S "1:1 12 U .. + 1,07 (SHEET "1) -I m (SHEET 10) -I ROE N " = IBM Monochrome Display And Parallel Printer Adapter Logic 11 of 12 IBM MONOCHROME DISPLAY AND PARALLEL PRINTER ADAPTER o •• !!.-:!;!!: ~ ~ I i , 1 I I I I ! ! , I ,I 1 -.. N N 0 "c, 0 ..... ...I ....e- '" .", ....... ';~U~I 0121=1 01, '"en 1 =. I II'!; !'----'~-' .. i5 E ~L~J_1Ltl_'---==- . E .c 0 c §Igo~ 8Z~~~:; I 0 '::10-°" "'l"",,,,,..ODu>2 =~w :E :E co I I 1'1 ~I:" !' I :J I, I ,I< ~~~~~::::::::::;::;~ . . + ~ :; -- -.- --~ ~ ~ v ~ r v ;; ;; v - D-23 IBM MONOCHROME DISPLAY DANGER HAZARDOUS TO 450 VOL VOLTAGES UP PRINTED CI~~~~TIST ON THE ______ BO~ARDS D-24 COLOR/GRAPHICS MONITOR ADAPTER . ';;' co ... ....I :I ... CL "CI c:t ...co ... ·C .. co :E :c - CL t5'" C; "0 '"' I I I II :':H!~I;~ 'G" iI D-25 COLOR/GRAPHICS MONITOR ADAPTER go:;:6 g;:!;;!: ~ ~ +++++++++ IIIIII IF L - -__ _ - - ~---. D-26 COLOR/GRAPHICS MONITOR AOAPTER ,. i ..... "',. .:. ~;,.,. '" ,. ~~~~~~~~ ~ -.. "'o C") ;;, o - - - ..... :!l c:- eil 'C cr: c~ '1'1 I I I D-27 COLOR/GRAPHICS MONITOR ADAPTER '" -.: '" ; - '" '" - ~J'",~~~ ~~~~~ IIII ~---~ D-28 COLOR/GRAPHICS MONITOR ADAPTER CD 1; In .. ';;' co ... .....I :l ...=. "CI f!i MIII1-24 • .c. , ,--- -2!... ~ ,.. • r---- ,,--- . .!!L 4>fe!, ~ , r---- . -!!!.. ~ ~ , r---- '" ~ I I ,: " ~ r---- , r---- ~ " ~ 4>i"" ~ .. "'" (ifI09~~ ... M" .5 tt ~'......, e.. L....o ..... 0 )( .;: T 1.311 Al Fl' 100 2 ii:) "" ZOIl M", I. 150AC. ::!E ···i"~l_ +S 0 ~C4 '''Lp " G~ Goo ,. .1: - . ... Go oC o·~ :N4 ["" .....~ ·s . ,rfj::i ~:' .~:' , l:: .... i:3 .~ > .;: " " , , sr+i*1: s~ 1~ ." R!!7zo ~l ,~ I*r AIJO,-ul - CI co E .r", ~t¥ i, !;i'mo, ~ '20 5W JItl ...l!!co Ei :NA. 20 RM-I~ ..... .... ]~:tMI , en a.. I.~ " ,rPt-il ~ :"-- ,ri'*-t:, 1;1 00 ;~ ~. Oll"" :N5 " ....." ::!E In Io\"~ r AlrPo .... S S "NS , N4 ("". '] ~ .. " " D-33 PARALLEL PRINTER ADAPTER .e. ~~I~§··I~· . I : ~~--------------.t===~ ____~ D-34 5%" DISKETTE DRIVE ADAPTER ~ ~o~ ~~~; + + + + ~~ . -..= co M .s. = ..... ....I .. CI. "a CC .~ ..... Q ... .:.:: C ~ In ~ ". ~~ ~2 00 0 ~* '-',0 ... .,-",,,,-0 '3 . ~~ 5'= ~ 2=-=--=-= ; ~ ~~ "0 W Z ~" g~=':'::'':'~~::':: ~ ~~ .~ ~ i ~~ ~~ ~~ ;::'0 . ~ir 2; ~~ ~~~! ~~ 00 """ :;~ I a '"" "~~ ~. w'" i§~ ~~~~ ~~ - O~ I I I I . . , 3 3aa 0 ~~ w~ 8~ Note: Logics one and two of 8~ ~~ ~~ ~ 'w " 0 ~" w~ six are not applicable. 0 §~ ~~ ~ ;if? ~~ 0 ~ - ~i H 0 D-35 5~" DISKETTE DRIVE ADAPTER ~ ~ ~ ~ , 0 0 ~ -="= o ' 0 ....I w "" <1: -=t ~ cr.., r-. "'t ';:: ~: CI GO ~v =: ~~ GO ~ In Q 0 ~ z In v , , " ~ , D-37 UI ~ w ""o: 00 I CR2 AD7 VCO AO'l AOI CHARGE PUMP ~ en ;0:: AOI COl AOb AD, H02 ODS GOI COO m CR2f '-""'- ,eo 001 H08 JO' AO' A JIJI -t -t ~l +<;~ HOI m J07 ~,(Ib ~ CO'l JOI GOb GO' ~~Q lI'i1°OPF o Njl "'" JOb +'5..!Q.?. ::z:I -'i ..i..Q!. [)\TAZ 1000!,SIOPf .IW J!2K '; ~ II'1W _IS 01 .. <: ,.. AI)'; Y21181l U21 JO' SELl A07 TEST R'+ lell R'l F 4217812 U20 m rBMVCO R2 +'i IBM CHG PUMP l> + READ DATA 1 JO~ DATAl BOB 820 (19 o 1 1 l> 'i: 7')OOPF JJq 820 =+Q~ 020 20 Q'S FO~ Q2 ~" AOl J,~CII ,J, ~2.7K7<00'" ~ lq'OPF :rtOPF 2.7K m ~1'CLKIJb o -=(12 .."R6 _R7 ::z:I GOI QZ FOI , + DATA I.HNDOW , I i1 AO' ,. m I CCR +'i Ib ," Ib CO, 7ttLSl&82K Ib I:t 2K 2K 2K RP-2 898-1 " B"!8-1 RP-2 12 D Q q EOI QI ~""12 11 " 10, 14LSOO , I ~tJ8 COl Qi " UI2 "' +5TAHDARO DATA/CLOCK ~b8 I IlQJ ~"' " Fa7 VFOS'r'NC HOG! STDDATA. 'i'ib'+Z'i2 ~I't ~ 'Gil ~ SPARE ~ 11 L74s'7'+U22 IBMUo\TASEP. U ,q 12 7"LSD2 U21 =i[Y- 74LSOO U'i 1~1l=: ~---i ~ l II ":" I 2 Q2 Ne l;J:.ru. 'q ~ g~rL-~~ '5 , EN U/D zr:7 ET 12 ~o P:E;ET :{~K' ~~N' ~ un I Q b Ne Gi 8 Ne L . I L~ _Il(~_-.J 7"1LS74 +VFOSYN( , 02' 5%" Diskette Drive Adapter Logic 6 of 6 5%" DISKETTE DRIVE -. M 0 'a, 0 II' ....I ~ 'C e II' ... =:... .,. ...: i5 ~ In D-39 5%" DISKETTE DRIVE - CO) N o co ';;' o ...I ~ ''::: C '" t: '" .:.: II> C D-40 c:n PART OF PART OF P21 ,.:: ,......-Jt ~ L1 3.31lH CI +12V L'lt~r- Qt 3 I 3 I + MOTOR POWER en ;111: J Ct R7 R8 tK TIP ItO m ::Im 41 470 + I C2 Rll CI 47 1.1IZW :I 2 I MOTOR RETURN <: GNO 2 1 1 9 1 1 t C4 R12 m ~I+ R9 2.2K 470 n Rto A5 tK A3 A4 tK PDT. tK. t% A2 ~ tM -I R13 At 2.2K 20K I It I ~714INMOTORON -TACK I4I 2 • +TACK -~ 8 / PART OF PART OF P20 P2t C6 .022 NOTES, 1. RESISTORS ARE IN OHMS. ± 5%.114 W. 2. 1% RESISTORS ARE t/8 W. 3. CAPACITORS ARE IN II F. ± 20%.35 V. 5%" Diskette Drive Logic 3 of 3 o - .l:. o XIONlddV ...~ tj :z +SVDC ~ .... 0 R~ I ~ '" I 8,2Kn R PACK DIP I:ICI N _. r- .. 0 " ,,,,14'10112 I 3: m ::J o _. .... n DIP sw (aPOs) 74585 3: Q GO 0 01 L_II ~ 10 AD :::a - "C ::J "C '" AI8 AI7 12 AI I, A2 < ::0 n GO _ 1'5 A, m >< C"o t;"~ U22 :::z (SHT4) I I AIS AI9 AI8 AI7 U,2~----, 9L "BI )IiB2 I 74LSOif '~" CD SEL DEC (SHT~) en Q Z (SHT4) AI6 I B, ~ (SHT31 AI4 (SHT31 CASOI -----CAS (SHT 3) (SHT1) CAS TIMING CD SEL DEC (SHT 1) -------RASO (S~T1) (SHT3) (SHT41 D.CKO 'f>4 ,,§VII 1274S00 32KB Memory Expansion Logic 2 of 4 U20 32 KB MEMORY EXPANSION r>- ~:;;:;;:~~-::;~ ... :: ... ... ~ ~ ~I§ g.;~:;;~~~; I~ I~ I~ I~I~ I; ".~~ , , r ;; i~ ~-- " 77 ~~ 7 ~ ~~-~ " ~ ~~ " D-43 W tj N ;II: ,i.. l:1li ~ i: m AOI-A~I i: SHT3 ~ "0 A29 A2B AD AI A2 ., SHT) = ::D < A27 A4 m A2b >< -a '" " AO ):> "4 A1 Z m ~ = A' A22 A9 I z A2I Ala A20 All ." AI2 '" Al1 AI> SHT,3 ~ Al4 SIH'l. Alb AI, AI' Al4 AI> AI2 A09 A08 Alb Al1 A" Al4 00 I SHT'l. SHT ') 01 AD1 02 I ADb A" " 04 AQ4 AQ, " Db I I AD2 01 • SHT3 '19 DACKO SHT:2. '1'"2 i'iEMW SIH1 '" C2 (4 " m (" CI1 (20 C 2 C24 Cia ao') '5V :r T T T T T T T T T -5 VOC MEMR S HT 3 ='~= 8~1 t t f. (21 '" " '" Gt{) 801 (II (I GNO :r:r T T T T T T T '"T '"T GND ='~= +12 voe C2g(12 " C1 Cl4 (21 C8 SQq "2 '" T T 1'-. ~ N v A < < < t:: C) ON tL~ ~= ~- = W ~ ~ 'in t:: ~ ~(:;; TIII ea 0 " ~~ ~ , " I' , CI. , >< ~ ~ 0 - N ' ~ .. LI.I > C) .; --_._- ~-~ ...E :::!: ~ N ~ IlCI , lie: ,- - ~ o::t CD ~ ~'l 0 ~ ~ U'.T- ~~ l ~,,~ .Tll''O .... o = N f--- 11ft N ~~,' ~ I' , ~I i! ~ w - ~lL~ N v 011l1~ -N~ 3"LI'.o .... w < I ~ 1- ~ ~, (T'3"lI'.or- ro:: ~ _ ':2 0' c; " , 't w i , lk 0 ::> ~ I. .:;; !'::! I. ~!!?r:::~~ 4. Mhz: Megahertz. A unit of frequency equal to one million Hertz. 55. Microprocessor: A processing unit, or part of a processing unit, that consists of microcode. In the IBM Personal Computer, the microprocessor is the Intel-SOSS. 56. Mnemonic: Symbol or symbols used instead of terminology more difficult to remember. Usually a mnemonic has two or three letters. >7. 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. is. Monitor: (1) A device that observes and verifies the operation of a data processing system and indicates any specific depart- ure from the norm. (2) A television type display such as the IBM Monochrome Display. (3) Software or hardware that observes, supervises, controls, or verifies the operations of a system. i9. Multiplexer: A device capable of interleaving the events oftwo or more activities or capable of distributing the events of an interleaved sequence to their respective activities. G-5 70. OR: A logic operator having the property that if P is a statement, Q is a statement, Ris a statement... , then the OR of P,Q,R, is true if at least one statement is true, false if all statements are false. P OR Q is often represented by P+Q, PVQ. The term is synonymous with boolean add; logic add. 71. "ORed": Past tense of OR. 72. OSC: Oscillator. (Refer to System Board I/O Channel Descriptions ). 73. Output: Pertaininng to a device, process, or channel involved in an output process, or to the data or states involved in an output process. 74. Personal Computer: A small home or business computer complete with a System Unit, keyboard, and available with a variety of options such as monochrome display and a dot matrix printer. 75. Pinout: A diagram of functioning pins on a pinboard. 76. Printed Circuit Board: A piece of material, usually fiberglass, which contains a layer of conductive material, usually metal. The metallic layer is then etched and electronic equipment is then attached to the fiberglass. The electronic equipment then has the capacity to transmit electronic signals through the board by way of the etched metal tracks. 77. Program: (1) A series of actions designed to achieve a certain result. (2) To design, write and test computer programs. 78. Read/Write Memory: Random access storage. 79. Reset Drv: Reset Driver. (Refer to System Board I/O Channel Descriptions ). 80. RF Modulator: The device used to convert the composite video signal to the antenna level input of a home TV. 81. ROM: Read-only Memory. 82. ROM BIOS: Read-only Memory/Basic Input Output System. 83. RS 232 Port: Asynchronous Type Communications. 84. RTS: Ready to Send. Associated with modem control. G-6 85. Scan Line: The use of a cathode beam to test the cathode ray tube of a display used with a personal computer. 86. Schematic: The description, usually in diagram form, of the logical structure and physical structure of an entire data base according to a conceptual model. 87. Software: (1) Computer programs, procedures, rules, and possibly associated documentation concerned with the opera- tion of a data processing system. (2) Contrast with hardware. 88. Strobe: (1) An instrument used to determine the exact speed of circular or cyclic movement. (2) A flashing signal displaying an exact event. 89. 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 respectively. 90. TX Data: Transmit Data. External connections ofthe RS 232 Asynchronous Communications Adapter interface. 91. Video: Computer data shown or displayed on a cathode ray tube monitor or display. G-7 NOTES G-8 BIBLIOGRAPHY IBM Publications 1. IBM Personal Computer Guide to Operations- PN 6025000 General information on using the IBM Personal Computer. 2. IBM Personal Computer Hardware and Service- PN 6025072 Information on hardware and steps necessary when servicing this IBM Personal Computer. 3. IBM Personal Computer BASIC-PN 6025010 Information for programmers who are using BASIC. 4. IBM Personal Computer Disk Operating System (DOS)- PN 6024001 Information for programmers who are using DOS. 5. IBM Personal Computer MACRO Assembler- PN 6024002 Information for experienced assembly language programmers using the Macro Assembler. 6. IBM Personal Computer Pascal Compiler-PN 6024010 Information for programmers who are familiar with the Pascal language. Bib-t Other Related Publications 7. NATIONAL SEMICONDUCTOR INS 8250 Asynchronous Communications Element This book documents physical and operating characteristics of the INS 8250. 8. INTEL The 8086 Family Users Manual This manual introduces the 8086 family of microcomputing components and serves as a reference in system design and implementation. 9. INTEL 8086/8087/8088 Macro ASSEMBLY Language Reference Manual for 8088/8085 Based Development System The manual describes the 8086/8087/8088 Macro Assembly Language, and is intended for use by persons who are familiar with assembly language. 10. MOTOROLA The complete Microcomputer Data Library This book can provide additional information on the Motorola 6845 CRT Controller used in the IBM Monochrome Display and Parallel Printer Adapter, and the Color/Graphics Monitor Adapter. Bib-2 INDEX A AO-AI9 (Address Bits 0-19) 2-10 A.c. Output 2-34 Adapters Asynchronous Communications (RS232) 2-123 Color/Graphics 2-45 5 1/4" Diskette Drive 2-89 Game Control 2-117 IBM Monochrome Display and Parallel Printer 2-37 Parallel Printer 2-65 Adapter Attribute Relationship 2-51 Adapter Inputs 2-107 Adapter Outputs 2-106 Address Bits (AO-AI9) 2-10 Address Decode 2-118 Address Enable (AEN) 2-12 Address Latch Enable (ALE) 2-10 Address Strobe (ADS) 2-129 ADS (Address Strobe) 2-129 AEN (Address Enable 2-12 ALE (Address Latch Enable) 2-10 Algorithms 3-8 All Points Addressable (APA) 2-45 Alphanumeric Mode 2-49 American Standard Code for Information Interchange (ASCII) 1-2 Analog Input 2-122 A/N (Alphanumeric) 2-49 Appendices A-O A - ROM BIOS Listing A-I B - Assembly Instruction Set Reference B-1 C - Of Characters, Keystrokes and Color C-l D - Logic Diagrams D-l E - Unit Specifications E-l APA (All Points Addressable) 2-45 ASCII - (See American Standard Code for Information Interchange) 1-2 ASCII Coding Table 2-78 ASCII Control Codes 2-79 ASCII (Extended) 3-11 Assembly Instruction Set Reference Appendix B Assembly Language Reference Guide (See Bibliography) Assessable Registers 2-154 1-1 Asynchronous Communications Adapter Block Diagram 2-124 Current Loop Interface 2-127 Input/Output Decode 2-125 Input/Output Signals 2-133 Input Signals 2-129 Interface Description 2-126 Interface Specifications 2-147 Interrupt 2-126 Interrupt Enable Register 2-141 Interrupt Identification Register 2-139 INS 8250 Accessible Registers 2-134 INS 8250 Functional Pin Description 2-129 INS 8250 Line Control Register 2-134 INS 8250 Programmable Baud Rate Generator 2-135 Line Status Register 2-137 Logic Diagram D-48 Modem Control Register 2-142 Modem Status Register 2-143 Modes of Operation 2-125 Output Signals 2-132 Programming Considerations 2-133 Receiver Buffer Register 2-144 Reset Functions 2-133 Selecting the Interface Format 2-146 Transmitter Holding Register 2-145 B BASIC (Beginner's all-purpose symbolic instruction code) 80 Interpreter 1-1 Reserved Interrupts 3-23 Screen Editor Special Functions 3-19 Workspace Variables 3-23 Baud (See .INS 8250 Programmable Baud Rate Generator) 2-132 Baud Out (BAUDOUT) 2-132 BEL (Bell) 2-82 Bell (BEL) 2-82 Berg Pin Connectors 2-63 BIOS (Basic Input Output System) 3-2 Cassette Logic 3-8 Memory Map 3-7 Interrupt Vector Listing 3-3 Parameter Passing 3-2 1-2 BIOS (continued) Programming Tip 3-2 ROM (Read Only Memory) 3-2 Use of 3-2 Vectors With Special Meaning 3-5 BIT I/O Address 2-42 I/O Bit Map 2-24 Output Port Cassette 2-19 Output Port Speaker 2-22 Status Register 2-59 Block Diagrams Asynchronous Communications Adapter 2-124 Cassette Motor Control 2-20 Cassette Interface Read 2-19 Cassette Interface Write 2-20 Color/Graphics Monitor Adapter 2-47 5 1/4" Diskette Drive Adapter 2-90 Game Control Adapter 2-117 Keyboard Interface 2-15 IBM Monochrome Display Adapter 2-38 Parallel Printer Adapter 2-66 System 1-4 Bootstrap 3-3 Byte: Attribute Definition 2-49 Display Buffer 2-61 c CAN (Cancel) 2-81 Cancel (CAN) 2-81 Carriage Retum(CR) 2-79 Cassette Circuit Block Diagrams 2-19 Data Record Architecture 3-10 Error Recovery 3-10 Interface Connector Specifications 2-21 Interrupt 15 3-8 Jumpers 2-19 Logic (BIOS) 3-8 Read 3-9 Write 3-8 1-3 Character Codes 3-11 Generator 2-48 "Of Characters, Keystrokes and Color Appendix C Set (00-7F) Quick Reference C-12 Set (80-FF) C-13 Chip Select Out (CSOUT) 2-132 Clear To Send (CTS) 2-130 Clock (4.77 mhz) 2-10 CLK (Clock) 2-10 CNTRL (Control) 3-14 Coding Table (ASCII) 2-78 Color/Graphics Monitor Adapter Block Diagram 2-47 Character Generator 2-48 Color/Graphics Mode 2-51 Color Select Register 2-57 Composite Color Generator 2-48 Description of Basic Operations 2-54 Display Buffer 2-48 Graphics Storage Map 2-52 I/O Address and Bit Map 2-61 Interrupt Level 2-60 Logic Diagrams D-25 Major Component Definitions 2-48 Memory Requirements 2-60 Mode Register Summary 2-58 Mode Select Register 2-58 Mode Set and Status Registers 2-48 Modes of Operation 2-49 Monitor Adapter Auxiliary Connectors 2-63 Monitor Adapter Direct Drive and Composite Interface Pin Assignment 2-62 Monochrome Display Adapter Vs. Color/Graphics Adapter Attribute Relationship 2-51 Motorola 6845 CRT Controller 2-48 Programming the 6845 Controller 2-48 Programming the Mode Control and Status Registers 2-57 6845 Register Description 2-56 Sequence of Events 2-59 Timing Generator 2-48 Composite Phone Jack 2-62 Computer (IBM Personal) 1-1 Command Phase 2-93 1-4 Command Status Registers Register 0 2-100 Register 1 2-10 1 Register 2 2-102 Register 3 2-103 Control Codes CPS (Characters Per Second) 2-70 CPU (Central Processing Unit) see System Board, Microprocessor 2-3 CR (Carriage Return) 2-79 CRT: (Cathode Ray Tube) 2-37 Output Port 1 (I/O Address '3B8') 2-42 Status Port (I/O Address '3BA') 2-43 CTS (Clear To Send) 2-130 CSOUT (Chip Select Out) 2-132 Current 2-34 Cursor 2-14 D DO-D7 (Data Bits 0-7) 2-10 DAcKO - DAcK3 (DMA Acknowledge 0 to 3) 2-12 DATA Bit (DO-D7) 2-10 Bus Buffer/Driver 2-118 Input Strobe (DISTR, DISTR) 2-129 Output Strobe (DOSTR, DOSTR) 2-129 Rates 2-39 Record Architecture 3-10 Set Ready (DSR) 2-131 Data Flow (System) 2-6 Data Flow (System) 2-6 DC 1 (Device Control 1) 2-81 DC 2 (Device Control 2) 2-81 DC 3 (Device Control 3) 2-81 DC 4 (Device Control 4) 2-80 DC Output 2-34 DEL (Delete) 2-81 Delete (DEL) 2-81 Device Control 1 (DC 1) 2-81 Device Control 2 (DC 2) 2-81 Device Control 3 (DC 3) 2-81 Device Control 4 (DC 4) 2-80 Digital Output Register (DOR) 2-91 1-5 DIN (Connectors) 2-5 DIP (Dual In-Line Package) 2-28 Diskettes 2-111 Diskette Drive (5 1/4") 2-110 Diskette Drive (5 1/4") Adapter Adapter Inputs 2-106 Adapter Outputs 2-107 Block Diagram 2-90 Command Status Registers 2-100 Command Summary 2-96 Comments (Programming) 2-104 Digital Output Register 2-91 Drive A and B Interface 2-106 Drive Constants 2-104 DPC Registers 2-103 External Interface Specifications 2-109 Floppy Disk Controller 2-91 Functional Description 2-91 Internal Interface Specifications 2-108 Logic Diagrams D-35 Programming Considerations 2-94 Programming Summary 2-103 System I/O Channel Interface 2-104 Display (See IBM Monochrome Display) 2-43 Display Buffer 2-48 DISTR, DISTR (Data Input Strobe) 2-129 Divisor Latch 2-136 DMA (Direct Memory Access) 2-4 Dos Special Functions 3-19 DOSTR, DOSTR (Data Output Strobe) 2-129 Drive Constants 2-104 Drive Disable 2-132 DRQl - DRQ3 (DMA Request 1 to 3) 2-12 DSR (Data Set Ready) 2-131 DTR (Data Terminal Ready) 2-132 Dual In-Line Package Switches (DIP) 2-28 E Edge Connector 2-108 Encoding 3-11 Error Recovery 3-10 ESC (Escape) 2-82 ESC A (Escape A) 2-83 ESC B (Escape B) 2-84 1-6 ESC C (Escape C) 2-85 ESC D (Escape D) 2-85 ESC E (Escape E) 2-86 ESC F (Escape F) 2-86 ESC G (Escape G) 2-86 ESC H (Escape H) 2-87 ESC 0 (Escape 0) 2-82 ESC 1 (Escape 1) 2-82 ESC 2 (Escape 2) 2-83 ESC 8 (Escape 8) 2-83 ESC 9 (Escape 9) 2-83 Escape (ESC) 2-82 Escape A (ESC A) 2-83 Escape B (ESC B) 2-84 Escape C (ESC C) 2-85 Escape D (ESC D) 2-85 Escape E (ESC E) 2-86 Escape F (ESC F) 2-86 Escape G (ESC G) 2-86 Escape H (ESC H) 2-87 Escape 0 (ESC 0) 2-82 Escape 1 (ESC 1) 2-82 Escape 2 (ESC 2) 2-83 Escape 8 (ESC 8) 283 Escape 9 (ESC 9) 2-83 Execution Phase 2-93 Extended Codes 3-13 F FDC (Floppy Disk Controller) 2-91 Floppy Disk Controller (FDC) 2-91 Fonts 2-48 Functions and Conditions of DIP Switch 1 2-72 Functions and Conditions of DIP Switch 2 2-73 Functional Description 5 1/4" Diskette Drive Adapter 2-91 Game Control Adapter 2-118 INS 8250 2-129 G Game Control Adapter Address Decode 2-118 Block Diagram 2-117 1-7 Game Control Adapter (continued) Connector Specifications 2-122 Data Bus Buffer/Driver 2-118 Functional Description 2-118 Interface Description 2-119 Joystick Positions 2-118 Joystick Schematic 2-121 Trigger Buttons 2-118 Glossary G-l GND (Ground) 2-12 Graphics Character Extensions (Interrupt 1FH) 3-6 Graphics Mode (Color) 2-51 Graphics Storage Map 2-52 H Hardware Asynchronous Communications Adapter 2-123 Color/Graphics Monitor Adapter 2-45 5 1/4" Diskette Drive 2-110 5 1/4" Diskette Drive Adapter 2-89 Game Control Adapter 2-117 IBM Monochrome Display 2-43 IBM Monochrome Display and Parallel Printer Adapter 2-37 Memory Expansion Options 32KB and 64KB 2-113 Printer 2-70 Parallel Printer Adapter 2-65 Power Supply 2-33 System Board 2-3 Hardware Overview 1-1 Data Flow 2-6 Hertz (Hz) 1-2 Horizontal Drive 2-43 Horizontal Tab (HT) 2-81 HT (Horizontal Tab) 2-81 I IBM 80 CPS Matrix Printer 2-70 IBM Monochrome Display 2-43 IBM Monochrome Display and Parallel Printer Adapter Block Diagram 2-38 Data Rates 2-39 Direct Drive Interface and Pin Assignment 2-44 1-8 IBM Monochrome Display and Parallel Printer Adapter (continued) DMA Channel 2-42 Interrupt and DMA Response Requirements 2-39 Interrupt Levels 2-42 I/O Address and Bit Map 2-42 Lines Used 2-39 Loads 2-39 Memory Requirements 2-41 Modes of Operation 2-40 Programming the 6845 CRT Controller 2-41 Sequence of Events 2-41 Important Operating Characteristics 2-36 IER (Interrupt Enable Register) 2-141 IIR (Interrupt Identification Register) 2-139 Input/Output Signals: Data (DO, D7) 2-133 External Clock Input/Output (XTAL1, XTAL2) 2-133 Input Requirements (Power Supply) 2-34 Input Signals Address Strobe (ADS) 2-129 Chip Select (SCO, CSl, CS2) 2-129 Clear to Send (CTS) 2-130 Data Input Strobe (DISTR, DISTR) 2-129 Data Output Strobe (DOSTR, DOSTR) 2-129 Data Set Ready (DSR) 2-131 Master Reset (MR) 2-130 Received Line Signal (RCLK) 2-130 Receiver Clock (RCLK) 2-130 Register Select (AO, AI, A2) 2-130 Ring Indicator (RI) 2-131 Serial Input (SIN) 2-130 Interface Diagram Asynchronous Communications Adapter 2-147 Cassette Connector Specifications 2-21 Color/Graphics Monitor Adapter 2-62 5 1/4" Diskette Drive Adapter External 2-109 5 1/4" Diskette Drive Adapter Internal 2-108 Game Control 2-122 IBM Monochrome Display Direct Drive 2-44 Keyboard Connector Specifications 2-18 Parallel Printer 2-69 INTRPT (Interrupt) 2-132 Interrupt Control Functions 2-140 Intel 8048 (Keyboard Microcomputer) 2-14 Intel 8088 (System Unit Microprocessor) 2-3 1-9 I/O (Input/Output) Address Map 2-33 Channel 2-8 Channel Description (System Board) 2-10 Diagram 2-9 I/O CH CK (I/O Channel Check) 2-10 I/O CH RDY (I/O Channel Ready) 2-11 lOR (I/O Read Command) 2-11 lOW (I/O Write Command) 2-11 Interrupts And DMA Response Requirements 2-39 Enable Register 2-141 Identification Register 2-139 Levels (O-XX) 2-42 Vector Listing 3-3 Vectors (0-7F) 3-21 1 CH - Timer Tick 3-5 1 DR - Video Parameters 3-5 1 EH - Diskette Parameters 3-5 1 FH - Graphics Character Extensions 3-6 15 3-8 K KB - Kilobyte (See Memory Expansion Options) Keyboard Break 3-16 Character Codes 3-11 Diagram 2-16 Encoding 3-11 Extended Codes 3-13 Extended Functions 3-13 Interface Block Diagram 2-15 Interface Connector Specifications 2-18 Pause 3-16 Print Screen 3-16 Scan Codes 2-17 Shift States 3-14 Shift Key Priorities 3-15 Special Handling 3-15 System Reset 3-15 Usage 3-17 Kilobyte (KB) (See Memory Expansion Options) 1-10 L LF (Line Feed) 2-79 Light Pen Interface 2-63 Mode Control and Status Register 2-57 Register Description 2-56 Line Control Register (LCR) 2-134 Line Feed 2-79 Line Status Register (LSR) 2-137 Lines Used 2-39 Loads 2-39 Logic Diagrams Appendix D Low Memory Maps BASIC and DOS Reserved Interrupts (80-3FF) 3-22 BASIC Workspace Variables 3-23 Interrupt Vectors (0-7F) 3-21 Reserved Memory Locations (400-5FF) 3-22 M Major Component Definitions 2-48 Matrix Printer (IBM 80 CPS) 2-70 Megabyte 2-3 Memory BIOS Map 3-7 Map (System) 2-25 Module Description 2-114 Module Pin Configuration 2-114 Other ReadIWrite Usage 3-6 Requirements (Color/Graphics) 2-60 Requirements (IBM Monochrome) 2-41 System Board Switch Settings 2-30 32/64 KB Expansion Option Switch settings 2-31 Memory Expansion Options Memory Module Description 2-14 Memory Module Pin Configuration 2-114 Operating Characteristics 2-113 Switch Configurable Starting Address 2-115 MEMR (Memory Read Command) 2-11 MEMW (Memory Write Command) 2-11 MFM (Modified Frequency Modulation) 2-110 Mhz (Megahertz) 2-43 Microprocessor 2-3 1-11 Microsecond 2-3 Mnemonic B-18 Mode Set and Status Register 2-48 Modem Control Register 2-142 Modem Status Register 2-143 Modes of Operation Asynchronous Communications Adapter 2-125 Color/Graphics Monitor Adapter 2-49 IBM Monochrome Display Adapter 2-40 Mode Register Summary 2-58 Mode Select Register 2-58 Monitor Type Switch Settings 2-29 Monochrome Display (IBM) 2-43 Monochrome Display and Parallel Printer Adapter (See IBM) Motorola 6845 CRT Controller 2-48 MR (Master Reset) 2-130 N NMI (Non-Maskable Interrupt) of the 8088 2-4 to the 8088 2-8 NMI Mask. Reg. - (I/O Address Map) 2-23 Nominal Power Requirements 2-24 NUL (Null) 2-82 Null (NUL) 2-82 NUM LOCK 3-14 o Of Characters, Keystrokes and Color C-l OHM Resistors 2-67 Operating Characteristics Memory Expansion Options 2-113 Monochrome Display 2-43 Power Supply 2-36 Options Asynchronous Communications Adapter 2-12 Color/Graphics Monitor Adapter 2-45 5 1/4" Diskette Drive 2-110 5 1/4" Diskette Drive Adapter 2-89 Game Control Adapter 2-117 IBM 80 CPS Matrix Printer 2-70 IBM Monochrome Display 2-43 32/64 KB Memory Expansion Options 2-113 1-12 Options (continued) Parallel Printer Adapter 2-65 "ORed" 2-65 OSC (Oscillator) 2-10 Other Read/Write Memory Usage 3-6 OUT PORT 2-39 Output AC 2-34 Address 2-67 DC 2-34 Port 2-65 OUT 1 2-132 OUT 2 2-132 Output Signals Baud Out (BAUDOUT) 2-132 Chip Select Out (CSOUT) 2-132 Data Terminal Ready (DTR) 2-132 Driver Disable (DDIS) 2-132 Interrupt (INTRPT) 2-132 Output 1 (OUTl) 2-132 Output 2 (OUT2) 2-132 Request to Send (RTS) 2-132 Serial Output (SOUT) 2-132 Overview (Hardware) 1-1 Over Voltage/Current Protection 2-36 p Parallel Printer Adapter ASCII Coding Table 2-78 ASCII Control Codes 2-79 Block Diagram 2-66 Description 2-37 DMA Channel 2-42 IBM 80 CPS Matrix Printer 2-70 I/O Address and Bit Map 2-42 Interrupt Levels 2-42 Logic Diagram D-31 Parallel Interface Description 2-73 Printer Specifications 2-71 Programming Considerations 2-67 Programming the 6845 CRT Controller 2-41 Sequence of Events 2-41 Setting the DIP Switches 2-72 Timing 2-77 1-13 Parameters, 6845 Initialization 2-41 Parameter Passing, ROM BIOS 3-2 Parity Flag, 8080 Flags B-1 Pause, BIOS Cassette Logic Special Handling 3-16 Pin Connectors P2-6 Pin Berg Strip for Light Pen Connector 2-63 Pl-4 Pin Berg Strip for RF Modulator 2-63 9 Pin Connector, Color Direct Drive 2-61 9 Pin Connector, IBM Monochrome Display 2-44 25 Pin Connector, Parallel Printer Adapter Block Diagram 2-66 25 Pin'D' Shell Connector, Asynchronous Adapter Block Diagram 2-124 15 Pin 'D' Shell Connector, Game Controller Adapter (Analog Input Connector Specifications) 2-122 25 Pin 'D' Shell Connector, Parallel Printer Adapter 2-69 5 Pin Din Connector, Keyboard Interface Connector Specifications 2-18 15 Pin Male 'D' Shell Connector, Joystick Schematic 2-121 Planar (See System Board 2-3; Intel 8088 2-3) Power-on Self-Test System Board 2-4 Keyboard 2-14 Power Supply 2-33 AC Output 2-34 DC Output 2-34 Important Operating Characteristics 2-36 Over Voltage/Current Protection 2-36 Signal Requirements 2-36 Input Requirements 2-34 Power Supply Connectors and Pin Assignments 2-35 Power Supply Location 2-34 Preface i Print Screen, Special Handling 3-16 Printer, IBM 80 CPS Matrix 2-70 Printer Specifications 2-71 Programmable Peripheral Interface (PPI) 8255A-5 2-19 Programming Considerations Asynchronous Communications Adapter Asynchronous Communications Reset Functions 2-133 INS 8250 Accessable Registers 2-134 INS 8250 Line Control Register 2-134 INS 8250 Programmable Baud Rate Generator 2-135 Interrupt Identification Register 2-139 Interrupt Enable Register 2-141 Line Status Register 2-137 Modem Control Register 2-142 1-14 Programming Considerations Asynchronous Communications Adapter (continued) Modem Status Register 2-143 Receiver Buffer Register 2-144 Transmitter Holding Register 2-145 Color/Graphics Monitor Adapter Color Select Register 2-57 Control and Status Register 2-57 I/O Address and Bit Map 2-61 Interrupt Level 2-60 Mode Register Summary 2-58 Mode Select Register 2-58 Programming the 6845 Controller 2-55 Programming the Modem Control and Status Register 2-57 6845 Register Descriptions 2-56 Status Register 2-59 Sequence of Events 2-59 5 1/4" Diskette Drive Adapter Command Status Registers 2-100 Command Summary 2-96 Symbol Descriptions 2-94 IBM Monochrome Display and Parallel Printer Adapter DMA Channel 2-42 I/O Address and Bit Map 2-42 Interrupt Levels 2-42 Memory Requirements 2-41 Sequence of Events 2-41 Programming the CRT Controller 2-41 Programming the 6845 CRT Controller 2-41 Comments 2-104 DPC Registers 2-103 Drive Constants 2-104 R RAS 2-114 Rating Amps, Over Voltage/Current Protection 2-36 Ready Line 2-8 Read Block 3-9 ReadData 2-107,2-108 (5 1/4" Diskette Drives. External) 2-109 Read Status (Parallel Printer Adapter Block Diagram) 2-66 Read/Write Memory Color Monitor 2-50 Color TV 2-49 Future Expansion in I/O Channel, 384 KB 2-26 1-15 Read/Write Memory (continued) Graphics Storage Map 2-53 Hardware Overview 1-1 I/O Address Map 2-24 Memory Address Space 2-61 Memory Expansion Options 2-113 User 3-7 Receive Circuit 2-127 Receiver Clock, (RCLK) 2-128 Recording Medium 2-111 Refresh Cycles 2-8 Registers, Address Command Status 2-100 Data 2-9 Initialization Parameters 2-41 INS 8250 Accessible 2-134 INS 8250 Line Control 2-134 Interrupt Enable 2-141 Line Control 2-134 Line Status 2-137 Main Status 2-9 Modem Control 2-142 Modem Status 2-143 Receiver Buffer 2-144 Transmitter Holding 2-145 6845 2-55 Register File Color Select 2-57 6845 Data 2-41 Description 2-56 6845 Index 2-42 6845 Initialization Parameters 2-41 Mode Select 2-58 Status 2-57,2-59 Requirements Input (Power Supply) 2-34 Memory 2-60 Signal (Power Supply) 2-36 RESET DRV (Reset Drive) 2-10 I/O Channel Description 2-119 ROM Address Space, 256 KB 2-25 =RESET 2-105 Reserved Memory Locations (400-5FF) 3-22" Result Phase 2-93 1-16 Response Requirements, Interrupt and DMA 2-39 Reverse Video Modes of Operation 2-40 Color Graphics Monitor Adapter 2-45 RF Modulator Auxiliary Video Connector PI-4 Pin Berg Strip 2-63 Color Graphics Monitor Adapter 2-45 Interface 2-63 Ring Indicator 2-127 ROM Character Generator 2-48 Color Graphics Mode 2-52 Color Graphics Monitor Adapter 2-46 Diagram 2-13 Hardware Overview 1-1 Keyboard 2-14 Memory Expansion Options 2-113 System Board 2-3,2-4 System Board Component Diagram 2-13 System Memory Map 2-27 ROM and System Usage 3-1 ROM BIOS BIOS Cassette Logic 3-8 BIOS Memory Map 3-8 Cassette Read 3-9 Cassette Write 3-9 Data Record Architecture 3-10 Description 3-2 Error Recovery 3-10 Interrupt 15 3-8 Interrupt ICH Timer Tick 3-5 Interrupt IDH Video Parameters 3-5 Interrupt IEH Diskette Parameters 3-5 Interrupt IFH Graphics Character Extensions 3-6 Interrupt Vector Listing 3-3 Other Read/Write Memory Usage 3-7 ROM BIOS Listing Appendix A ROS (Read Only Storage) (See ROM) ROM, Request for Master 2-92 RS232-C (See Asynchronous Communications Adapter) 2-123 RTS (Ready to Send) 2-123 R/W (Read/Write) Symbol Description 2-95 1-17 s Scan Codes 2-17 Screen 2-43 Schematic (See Logic Diagrams) SCROLL LOCK 3-15 Selecting the Interface Format 2-146 Sequence of Events 2-59 Serial Input (SIN) 2-130 Serial Output (SOUT) 2-132 Setting the DIP Switches 2-72 Shift In 2-80 Shift Out 2-80 Shift States 3-14 SI (Shift In) 2-80 Signal Requirements 2-36 SIN (Serial Input) 2-130 SO 2-80 Software Algorithms 3-8 SOUT (Serial Output) 3-132 Speaker Drive System Block Diagram 2-22 Interface 2-22 Special Handling 3-15 Special Timing 2-39 Specifications 5 1/4" Diskette Drive 2-112 Printer 2-71 System Appendix E Status Registers Color/Graphics 2-59 0(5 1/4" Diskette Drive Adapter) 2-100 1 (5 1/4" Diskette Drive Adapter) 2-101 2 (5 1/4" Diskette Drive Adapter) 2-102 3 (5 1/4" Diskette Drive Adapter) 2-103 Storage (See Memory) Strobe Address 2-129 Data Output 2-129 Summary of Available Colors 2-55 Switch Settings Configurable Start Address 2-115 5 1/4" Diskette Drives 2-29 32/64 KB Memory Expansion Option 2-31 Monitor Type 2-29 System Board Memory 2-30 1-18 System Board Cassette Interface Connector Specifications 2-21 Cassette Jumpers 2-19 Cassette User Interface 2-19 Circuit Block Diagrams (Cassette) 2-19 Component Diagram 2-13 Data Flow 2-6 5 1/4" Diskette Drive Switch Settings 2-29 I/O Address Map 2-23 I/O Channel 2-8 I/O Channel Description 2-10 I/O Channel Diagram 2-9 Keyboard 2-14 Keyboard Diagram 2-16 Keyboard Interface Block Diagram 2-15 Keyboard Interface Connector Specifications 2-18 Keyboard Scan Codes 2-17 32/64 KB Memory Expansion Option Switch Settings 2-31 Memory Switch Settings 2-30 Monitor Type Switch Settings 2-29 Speaker Drive System Block Diagram 2-22 Speaker Interface 2-22 System Memory Map 2-25 System Expansion Slots (See I/O Slots) 2-3 System Memory Map 2-25 System Memory Map (16 KB Increments) 2-26 System Unit 1-1 System Unit Power Connector 2-35 System Usage (ROM and) 3-1 T Tab (Vertical) 2-79 T/C (Terminal Count) 2-12 Terminal Count (T/C) 2-12 THR (Transmitter Holding Register) 2-145 Timing Generator 2-48 Transmit Circuit 2-127 Transmit Data (TX) 2-127 Transmitter Holding Register (THR) 2-145 Transmitter Output and Receiver Input 2-126 Trigger Buttons 2-118 TX Data (Transmit Data) 2-127 1-19 u Unit Specifications Appendix E Usage (Keyboard) 3-17 Use of BIOS 3-2 User Interface (Cassette) 2-19 v Vectors (O-7F Interrupt) 3-21 (Interrupt Listing) 3-3 Vectors With Special Meaning Interrupt 1CH Timer Tick 3-5 Interrupt IDH Video Parameters 3-5 Interrupt lEH Diskette Parameters 3-5 Interrupt IFH Graphics Character Extensions 3-6 Other Read/Write Memory Usage 3-6 Vertical Drive 2-43 Video Monitor 2-62 (Reverse) 2-45 Signal 2-43 Voltage Interchange Information 2-128 Voltage Power Supply 2-33 I/O Channel 2-8 System Board I/O Channel Description 2-10 Keyboard Interface Connector Specifications 2-18 Cassette Interface Connector Specifications 2-21 Speaker Interface 2-22 Power Supply 2-33 Power Supply Location 2-34 Important Operating Characteristics 2-36 Color Graphics Monitor Adapter Direct Drive and Composite Interface Pin Assignment 2-62 Color/Graphics Monitor Adapter Auxiliary Video Connectors 2-62 Printer Specifications 2-71 Game Controller Adapter (Analog Input) Connector Specifications 2-122 Voltage Interchange Information, Asynchronous Communications Adapter 2-128 Selecting the Interface Format, Asynchronous Communications Adapter 2-146 1-20 w Workspace (BASIC Variables) 3-23 Write (Cassette) 3-8 Write (Cassette Interface Hardware) 2-20 Write Data 2-106 Write Enable 2-106 Write Protect 2-107 Numerics 5 1/4" Diskette Drive 2-110 5 1/4" Diskette Drive Adapter 2-91 32/64 KB Memory Expansion Options 1-3 80 CPS Matrix Printer, IBM 2-70 80 Interpreter, BASIC 1-1 6845 CRT Controller 2-48 8080 Parity Flags B-1 8088, Intel 2-3 8250 INS Accessible Registers 2-134 RS232C-A Asynchronous Communications Adapter 2-123 1-21 NOTES 1-22 The Personal Computer lfardvvare Library Product Comment Form TEClfNICAL REFERENCE 6025008 Your comments assist us in improving our products. IBM may use and distribute any of the information you supply in anyway it believes appropriate without incurring any obligation whatever. You may, of course, continue to use the information you supply. Comments: If you wish a reply, provide your name and address in this space. ~ame _______________________________________ Address ____________________________________ City ________ State __________________ Zip Code ______ NO POSTAGE NECESSARY 111111 IF MAILED IN THE UNITED STATES BUSINESS REPLY MAIL FIRST CLASS PERMIT NO. 123 BOCA RATON, FLORIDA 33432 POSTAGE WILL BE PAID BY ADDRESSEE IBM PERSONAL COMPUTER SALES & SERVICE P.O. BOX 1328-C BOCA RATON, FLORIDA 33432 8Jil4 PIO::! illdelS lOU Op ilseald ade.l The Personal Computer Hardware Library Product Comment Form TECHNICAL REFERENCE 6025008 Your comments assist us in improving our products. IBM may use and distribute any of the information you supply in anyway it believes appropriate without incurring any obligation whatever. You may, of course, continue to use the information you supply. Comments: If you wish a reply, provide your name and address in this space. ~ame _______________________________________ Address _____________________________________ City ____________ State _________________ Zip Code _ _ _ __ NO POSTAGE NECESSARY 111111 IF MAILED IN THE UNITED STATES BUSINESS REPLY MAIL FIRST CLASS PERMIT NO. 123 BOCA RATON, FLORIDA 33432 POSTAGE WILL BE PAID BY ADDRESSEE IBM PERSONAL COMPUTER SALES & SERVICE P.O. BOX 1328-C BOCA RATON, FLORIDA 33432 BJB4 PIO:l aldelS lOU op aseald adeJ.. The Personal Computer Hardware Library Product Comment Form TECI INICAL REFERENCE 6025008 Your comments assist us in improving our products. IBM may use and distribute any of the information you supply in anyway it believes appropriate without incurring any obligation whatever. You may, of course, continue to use the information you supply. Comments: If you wish a reply, provide your name and address in this space. ~ame _________________________________________ Address ____________________________________ Ci ty _______________ State __________________ Zip Code _ _ _ __ NO POSTAGE NECESSARY 111111 IF MAILEO IN THE UNITED STATES BUSINESS REPLY MAIL FIRST CLASS PERMIT NO. 123 BOCA RATON, FLORIDA 33432 POSTAGE WILL BE PAID BY ADDRESSEE IBM PERSONAL COMPUTER SALES & SERVICE P.O. BOX 1328-C BOCA RATON, FLORIDA 33432 aJa4 PIO::! aldelS lOU Op aseald ade.L -- - - -- - ---- - --- - - --- - - - - - --- ==-=':'=® International Business Machines Corporation P.O. Box 132S-W Boca Raton, Florida 33432 (,025008 Printed in USA