Update to the IBM PCjr Technical Reference This update contains information that is pertinent to the IBM PC Compact Printer. Insert the pages contained in this package into your IBM PCjr Technical Reference. The following pages replace existing pages in your Technical Reference. • Table of Contents (vii, viii, ix, and x) • 3-3 and 3-4 • AI and A2 • BI and B2 • 0-7 and 0-8 • Index-\ through Index-24 Add the following pages to your Technical Reference. • Tab Index xi, xii, xiii, xiv • 3-133 through 3-150 • B-47 6322971 ---- -- ----- Personal Computer PCjr - - -- - ___--- 0- -- --- Hardware Reference Library Technical Reference First Edition Revised (November 1983) Changes are periodically made to the information herein; these changes will be incorporated in new 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 Reader's Comment Form is provided at the back of this publication. If this form has been removed, address comments to IBM Corporation, Personal Computer, P.O. Box 1328-C, Boca Raton, Florida 33432. IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligations whatever. © Copyright International Business Machines Corporation 1983 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. INSTRUCTIONS TO USER This equipment generates and uses radio frequency energy and if not installed and used properly, i.e., in strict accordance with the operating instructions, reference manuals, and the service manual, may cause interference to radio or television reception. It has been tested and found to comply with the limits for a Class B computing device pursuant to Subpart J of Part 15 of FCC Rules, which are designed to provide reasonable protection against such interference when operated in a residential installation. If this equipment does cause interference to radio or television reception, which can be determined by turning the equipment off and on, the user is encouraged to try to correct the interference by one or more of the following measures: • Reorient the receiving antenna. • Relocate the equipment with respect to the receiver. • Move the equipment away from the receiver. • Plug the equipment into a different outlet so that equipment and receiver are on different branch circuits. • Ensure that side option mounting screws, attachment connector screws, and ground wires are tightly secured. • If peripherals not offered by mM are used with this equipment, it is suggested that you use shielded, grounded cables with in-line filters, if necessary. If necessary, consult your dealer service representative for additional suggestions. The manufacturer is not responsible for any radio or TV interference caused by unauthorized modifications to this equipment. It is the responsibility of the user to correct such interference. CAUTION This product is equipped with a UL listed and CSA-certified plug for the user's safety. It is to be used in conjunction with a properly grounded 115 Vac receptacle to avoid electrical shock. Preface The IBM PCjr Technical Reference manual describes the hardware design and provides interface information for the IBM PCjr. This publication also has information about the basic input/output system (BIOS) and programming support. The information in this publication is both descriptive and reference oriented, and is intended for hardware and software designers, programmers, engineers, and interested persons who need to understand the design and operation of the IBM PCjr computer. You should be familiar with the use of the IBM PCjr, and understand the concepts of computer architecture and programming. This manual has five sections: Section 1: "Introduction" is an overview of the basic system and available options. Section 2: "Base System" describes each functional part of the base system. This section also has specifications for power, timing, and interfaces. Programming considerations are supported by coding tables, command codes, and registers. Section 3: "System Options" describes each available option using the same format as Section 2: "Base System." iii Section 4: "Compatibility with the mM Personal Computer Family" describes programming concerns for maintaining compatibility between the mM PCjr and the other mM Personal Computers. Section 5: "System BIOS and Usage" describes the basic input/output system (BIOS) and its use. This section also contains the software interrupt listing, a system memory map, descriptions of vectors with special meanings, and a set of low-storage maps. In addition, keyboard encoding and usage is discussed. This publication has four appendixes: Appendix A: "ROM BIOS Listing" Appendix B: "Logic Diagrams" Appendix C: "Characters, Keystrokes, and Color" Appendix D: "Unit Specifications" Prerequisite Publication: Guide to Operations part number 1502291 Guide to Operations part number 1502292 Suggested Reading: IBM PCjr Hands on BASIC part number 1504702 IBM PCjr BASIC Reference Manual part number 6182371 Disk Operating System (DOS) part number 6024061 Hardware Maintenance and Service Manual part number 1502294 Macro Assembler part number 6024002 Related publications are listed in "Bibliography." iv Contents SECTION 1. INTRODUCTION ............. 1-1 Introduction ......................... 1-3 SECTION 2. BASE SYSTEM ............... 2-1 Introduction ......................... 2-5 Processor and Support ................ 2-13 Performance .................... 2-13 8259A Interrupt Controller ............ 2-15 PCjr Hardware Interrupts ......... 2-15 8259A Programming Considerations . 2-16 64K RAM .......................... 2-17 ROM Subsystem ..................... 2-19 Input/Output Channel ................ 2-21 System Board I/O Channel Description 2-23 Input/Output ................... 2-29 8255 Bit Assignments ............. 2-30 Cassette Interface .................... 2-39 Video Color Graphics Subsystem ....... 2-43 Major Components Definitions ..... 2-47 Palette ......................... 2-50 Alphanumeric Modes ............. 2-54 Graphics Mode .................. 2-55 Video Gate Array ................ 2-63 Light Pen ...................... 2-74 CRT/Processor Page Register ...... 2-79 Beeper .. . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-85 Sound Subsystem .................... 2-87 Complex Sound Generator ......... 2-88 Audio Tone Generator ............ 2-89 Infra-Red Link. . . . . . . . . . . . . . . . . . . . .. 2-97 Infra-Red Receiver. . . . . . . . . . . . . . .. 2-97 IBM PCjr Cordless Keyboard .......... 2-101 Transmitter ..................... 2-103 v Program Cartridge and Interface ....... 2-107 Program Cartridge Slots .......... 2-107 Cartridge Storage Allocations ...... 2-108 ROM Module .................. 2-114 Games Interface .................... 2-119 Interface Description ............ 2-119 Input from Address Hex 201 ....... 2-120 Pushbuttons ................... 2-122 Joystick Positions ............... 2-122 Serial Port (RS232) .................. 2-125 Modes of Operation ............. 2-128 Interrupts ..................... 2-129 Interface Description ............ 2-129 Voltage Interchange Information ... 2-130 System Power Supply ................ 2-135 Operating Characteristics ......... 2- I 36 Over-Voltage/Over-Current Protection .................... 2-137 SECTION 3. SYSTEM OPTIONS ......... ~ .. 3-1 IBM PC}r 64KB Memory and Display Expansion .......................... 3-5 IBM PC}r Diskette Drive Adapter ...... 3-13 Functional Description ............ 3-15 System I/O Channel Interface ...... 3-19 Drive Interface .................. 3-22 Voltage and CurrenfRequirements .. 3-24 IBM PC}r Diskette Drive ............. 3-27 Functional Description ............ 3-27 Diskette ........................... 3-31 IBM PC}r Internal Modem ............ 3-33 Functional Description ............ 3-34 Modem Design Parameters ......... 3-37 Programming Considerations ....... 3-40 Status Conditions ................ 3-60 Dialing and Loss of Carrier ... . . . . .. 3-60 Default State .................... 3-63 Programming Examples ........... 3-63 vi Modes of Operation .............. 3-68 Interrupts ....................... 3-70 Data Format ..... . . . . . . . . . . . . . . .. 3-70 Interfaces . . . . . . . . . . . . . . . . . . . . . . .. 3-70 IBM PC}r Attachable Joystick .......... 3-77 Hardware Description ............. 3-77 Functional Description ............ 3-77 IBM Color Display ................... 3-81 Hardware Description. . . . . . . . . . . .. 3-81 Operating Characteristics .......... 3-82 IBM Connector for Television .......... 3-85 IBM PC}r Keyboard Cord ............. 3-87 IBM PC}r Adapter Cable for Serial Devices 3-89 IBM PC}r Adapter Cable for Cassette ... 3-91 IBM PC}r Adapter Cable for the IBM Color Display . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 3-93 IBM PC}r Parallel Printer Attachment ... 3-95 Description ...................... 3-96 System Interface .. . . . . . . . . . . . . . . .. 3-98 Programming Considerations ...... 3-99 IBM Graphics Printer ................ 3-107 Printer Specifications ............ 3-107 Additional Printer Specifications .. 3-109 DIP Switch Settings ............. 3-110 Parallel Interface Description ..... 3-112 Printer Modes .................. 3-115 Printer Control Codes ............ 3-116 IBM PC Compact Printer . . . . . . . . . . . .. 3-133 Printer Specifications ............ 3-135 Serial Interface Description ....... 3-139 Print Mode Combinations for the PC Compact Printer ............... 3-140 Printer Control Codes and Functions 3-140 SECTION 4. COMPATIBILITY WITH THE IBM PERSONAL COMPUTER FAMILY ....... 4-1 Compatibility Overview .. . . . . . . . . . . . . . .. 4-3 Timing Dependencies. . . .. . . . . . . . . . . . . .. 4-5 Unequal Configurations ................ 4-7 vii Hardware Differences .................. 4-9 User Ready/Write Memory ........ 4-12 Diskette Capacity/Operation ....... 4-13 IBM PCjr Cordless Keyboard ...... 4-14 Color Graphics Capability ......... 4-15 Black and White Monochrome Display 4-18 RS232 Serial Port and IBM PCjr Internal Modem ................. 4-18 Summary ............................ 4-19 SECTION 5. SYSTEM BIOS USAGE. . . . .. .. 5-1 ROM BIOS ........................... 5-3 BIOS Usage. . . . . . . . . . . . . . . . . . . . . . . . . .. 5-5 Vectors with Special Means ......... 5-8 Other Read/Write Memory Usage. . . . . .. 5-13 BIOS Programming Guidelines ..... 5-18 Adapter Cards with System-Accessible ROM-Modules. . . . . . . . . . . . . . . . .. 5-18 Keyboard Encoding and Usage ......... 5-21 Cordless keyboard Encoding ....... 5-21 • Special Handling ................. 5-34 Non-Keyboard Scan-Code Architecture5-42 BIOS Cassette Logic .................. 5-47 Software Algorithms - Interrupt Hex 15 ......................... 5-47 Cassette Write ................... 5-48 Cassette Read .................... 5-49 Data Record Architecture ......... 5-50 Error Detection .................. 5-51 Appendix A. ROM BIOS LISTING ......... A-I Equates and Data Areas ............ A-3 Power-On Self-Test ................ A-7 Boot Strap Loader ................ A-26 N on-Keyboard Scan-Code Table .... A-38 Time-of-Day ..................... A-42 Graphics-Character Generator (Second 128 Characters) .......... A-54 • viii I I 0 Support ..................... A-97 System Configuration Analysis ..... A-97 Graphics-Character Generator (First 128 Characters) ........... A-103 Print Screen .................... A-I08 Appendix B. LOGIC DIAGRAMS .......... B-1 System Board ..................... B-3 Program Cartridge . . . . . . . . . . . . . . .. B-20 Power Supply Board .............. B-23 64KB Memory and Display Expansion ...................... B-25 Color Display .................... B-29 Diskette Drive Adapter ............ B-30 Internal Modem .................. B-36 Parallel Printer Attachment ........ B-37 Infra-Red Receiver Board .......... B-42 Graphics Printer . . . . . . . . . . . . . . . . .. B-43 Compact Printer ................. B-47 Appendix C. CHARACTERS, KEYSTROKES, and COLOR ................................ C-l Appendix D. UNIT SPECIFICATIONS ...... D-l System Unit ...................... D-I Cordless Keyboard ................ D-2 Diskette Drive .................... D-3 Color Display .................... D-5 Graphics Printer .................. D-6 Internal Modem .................. D-7 Compact Printer .................. D-8 Glossary ............................ Glossary-l Bibliography .................... Bibliography-l Index ................................ Index-l ix Notes: x TAB INDEX Section 1: Introduction ............................... Section 2: Base System .............................. . Section 3: System Options ........................... . Section 4: Compatibility With the IBM Personal Computer Family Section 5: System BIOS Usage ....................... . Appendix A: ROM BIOS Listing ..................... . xi Notes: xii Appendix B: Logic Diagram ......................... . Appendix C: Characters, Keystrokes, and Color ........ . Appendix D: Unit Specifications ...................... . Glossary .......................................... . Bibliography ....................................... . Index ............................................. . xiii Notes: xiv SECTION 1. INTRODUCTION Contents Introduction . . . . . . . . • . . . . . . . . . . . . . . . . . . •. 1-3 1-1 Notes: 1-2 Introduction The system unit, a desk top transformer, and a cordless keyboard make up the hardware for the PCjr base system. The following options are available for the base system: • mM PCjr 64KB Memory and Display Expansion The 64KB Memory and Display Expansion enables the user to work with the higher density video modes while increasing the system's memory size by 64K Bytes to a total of 128K Bytes. • mM PCjr Diskette Drive Adapter The mM PCjr Diskette Drive Adapter permits the attachment of the mM PCjr Diskette Drive to the IBM PCjr and resides in a dedicated connector on the mM PCjr system board. • mM PCjr Diskette Drive The mM PCjr Diskette Drive is double-sided with 40 tracks for each side, is fully self-contained, and consists of a spindle drive system, a read positioning system, and a read/write/ erase system. • mM PCjrInternal Modem - The IBM PCjr Internal Modem is an adapter that plugs into the PCjr system board modem connector and allows communications over standard telephone lines. Introduction 1-3 • mM PCjr Parallel Printer Attachment The mM PCjr Parallel Printer Attachment is provided to attach various I/O devices that accept eight bits. of parallel data at standard TTL logic levels. It attaches as a feature to the right side of the system unit. • IBM Personal Computer Graphics Printer mM Graphics Printer is an 80 cps (characters-per-second), self-powered, stand-alone, tabletop unit. • IBM PCjr Joystick - The IBM PCjr Joystick is an input device to provide the user with two-dimensional positioning-control. Two pushbutton switches on the joystick give the user additional input capability. • mM Color Display The IBM Color Display is a Red/Green/Blue /Intensity (RGBI) Direct-Drive display, that is independently housed and powered. • mM Connector for Television The mM Connector for Television allows a TV to be connected to the mM PCjr system. • IBM PCjr Keyboard Cord The mM PCjr Keyboard Cord option is used to connect the mM PCjr Cordless Keyboard to the system board. 1-4 Introduction • IBM PClr Adapter Cable for Serial Devices - This option is an adapter cable that allows connection of serial devices to the IBM PClr system board. • IBMPClr Adapter Cable for Cassette This option is an adapter cable that allows a cassette recorder to be connected to the IBM PClr. • IBM PClr Adapter Cable for Color Display This adapter cable allows the IBM Color Display to be connected to the IBM PClr. The following is a block diagram of the IBM PClr system. Introduction 1-5 IlATAour 1!F---<:<--------+-f H ,,,,. IRQ< ". Thuecom/lonenll .. reconlainedonlhe641(8mlmoryanddlspl,y up~n$.ionclflL Thew areincludeu herB lOf cDmplllenel~ IR(l5 System Block Diagram (Sheet 1 of 2) 1-6 Introduction fiOPIN I/OCONIII 1-------~~>_--------c!l6 .mCHED ~-------?~~----""""b JOYSTICKS I - - - - - - - - - - - - - - { [ AUIIIOII.lARM H--------7~EXT ,. ~ LJ..jSPEAKER ~-----7.?----EJCII.SSETTE ~------7.~ ~~~f~~~~N ~----------~ __ lIGIiTPEN .\ These camconenls are cont~me~ on I~e 64KB memory and di~play npansluncard. They are included 1Iere lor I:ompleteness System Block Diagram (Sheet 2 of 2) Introduction 1-7 Notes: 1-8 Introduction SECTION 2. BASE SYSTEM Contents Introduction .....•. . . • . • . • • . . . . . . . . . . • . .. 2-5 Processor and Support ..................••. 2-13 Performance ......................... 2-13 8259A Interrupt ControUer •.......•...•...• 2-15 PCjr Hardware Interrupts .............. 2-15 8259A Programming Considerations ...... 2-16 64K RAM ••.•...•••.••..•.•.•••.•••••.• 2-17 R OM Subsystem .......•............•..•• 2-19 Input/Output Channel .•.............•..... 2-21 System Board I/O Channel Description .... 2-23 Input/Output ........................ 2-29 8255 Bit Assignments ................. 2-30 8255 Bit Assignment Description ...... 2-31 Port AO Output Description. . . . . . . . . .. 2-35 Port AO Input Operation ............. 2-36 Cassette Interface •...••.......•...•...•.. 2-39 Video Color/Graphics Subsystem ....•....•..• 2-43 Major Components Definitions ........... 2-47 Motorola 6845 CRT Controller ........ 2-47 Storage Organization ................ 2-47 Bandwidth ........................ 2-49 Character Generator ................ 2-49 Video Gate Array .................. 2-49 Palette .............................. 2-50 2-1 Alphanumeric Modes .................. 2-54 Graphics Mode ....................... 2-55 Low-Resolution 16-Color Graphics ..... 2-56 Medium-Resolution 4-Color Graphics ... 2-57 Medium-Resolution 16-Color Graphics .. 2-58 High-Resolution 2-Color Graphics ..... 2-58 High-Resolution 4-Color Graphics ..... 2-59 Graphics Storage Organization ........ 2-60 Video Gate Array ..................... 2-63 Mode Control 1 Register ............. 2-64 Palette Mask Register ............... 2-65 Border Color Register ............... 2-66 Mode Control 2 Register ............. 2-66 Reset Register ..................... 2-69 Palette Registers ................... 2-71 Status Register ..................... 2-73 Light Pen ............................ 2-74 Programming Considerations .......... 2-75 CRT jProcessor Page Register ........... 2-79 Beeper ......•.......................... 2-85 Sound Subsystem ........................ . 2-87 Complex Sound Generator ............. . 2-88 Audio Tone Generator ................ . 2-89 Features ......................... . 2-89 Infra-Red Link . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-97 Infra-Red Receiver .................... . 2-97 Functional Description ............. . 2-97 Application Notes ................. . 2-98 Programming Considerations ......... . 2-99 Detectable Error Conditions ......... . 2-99 Operational Parameters 2-100 mM PCjr Cordless Keyboard .............. 2-101 Transmitter .......................... 2-103 2-2 Program Cartridge and Interface .•••...•.•.. 2-107 Program Cartridge Slots ............... 2-107 Cartridge Storage Allocations ........... 2-108 ROM Module ....................... 2-114 Games Interface •.......••.•......••.•.• 2-119 Interface Description .................. 2-119 Input from Address hex 201 ............ 2-120 Pushbuttons ......................... 2-122 Joystick Positions .................... 2-122 Serial Port (RS232) ...••..•••••••.•••.•. 2-125 Modes of Operation .................. 2-128 Interrupts .......................... 2-129 Interface Description .................. 2-129 Voltage Interchange Information ........ 2-130 Output Signals .................... 2-131 Accessible Registers ............... 2-131 INS8250A Programmable Baud Rate Generator ....................... 2-132 System Power Supply .•.••..•.....•.••.... 2-135 Operating Characteristics .............. 2-136 Power Supply Input Requirements ..... 2-136 DC Outputs ..................... 2-136 Over-Voltage/Over-Current Protection ... 2-137 Input (Transformer) ............... 2-137 Output (Power Board) .............. 2-137 2-3 Notes: 2-4 Introduction The PCjr base-system hardware consists of the system unit, a 62-key cordless-keyboard, and a power transformer. The PCjr system board is the center of the PCjr system unit. The system board fits horizontally in the base of the system unit and is approximately 255 mm by 350 mm (10 inches by 13.8 inches). It is double-sided, with an internal-power/ground plane. Low voltageac power enters the power supply adapter, is converted to dc voltage, and enters the system board through the power supply adapter edge-connector. Other system board connectors provide interfaces for a variety of input/ output (I/O) devices and are individually keyed to prevent improper installation. The following is a list of these connectors: • 64KB Memory and Display Expansion Connector • Diskette Drive Adapter Connector • Internal Modem Connector • Infra-Red (IR) Link Receiver Board Connector • Program Cartridge Connectors (2) • I/O Channel Expansion Connector • Serial Port (RS232) Connector (with optional adapter cable) • Direct Drive (RGBI) Video Connector • Composite Video Connector • IBM Connector for Television Connector (external RF modulator) • Light Pen Connector • External Audio Connector • IBM PCjr Keyboard Cord Connector • Cassette Connector (with optional adapter cable) • IBM PCjr Attachable Joystick Connectors (2) Introduction 2-5 The system board consists of seven functional subsystems: the processor subsystem and its support elements, the read-only (ROM) subsystem, the read/write (R/W) subsystem, the audio subsystem, the video subsystem, the games subsystem, and the II0 channel. All are described in this section. The nucleus of the system board is the Intel 8088 microprocessor. This processor is an 8-bit external bus version of Intel's 16-bit 8086 processor, and is software-compatible with the 8086. The 8088 supports 16-bit operations, including multiplication and division, and supports 20 bits of addressing (1 megabyte of storage). It operates in the minimum mode at 4.77 MHz. This frequency, which is derived from a 14.31818-MHz crystal, is divided by 3 for the processor clock, and by 4 to obtain the 3.58-MHz color-burst signal required for color televisions. For additional information about the 8088, refer to the publications listed in "Bibliography". The processor is supported by a set of high-function support-devices providing three 16-bit timer-counter channels, and nine prioritized-interrupt levels. The three programmable timer/counters are provided by an Intel 8253-5 programmable interval-timer and are used by the system in the following manner: Channel 0 is used as a general-purpose timer providing a constant time-base for implementing a time-of-day clock; Channel 1 is used to deserialize the keyboard data and for time-of-day overflow during diskette operations. Channel 2 is used to support the tone generation for the audio speaker and to write data to the cassette. Of the nine prioritized levels of interrupt, three are bused to the system's 110 channel for use by adapters. Five levels are used on the system board. Level 0, the 2-6 Introduction highest priority, is attached to Channel 0 of the timer/ counter and provides a periodic interrupt for the time-of-day clock; leve13 is the serial-port-access interrupt; level 4 is the modem-access interrupt; level 5 is the vertical-retrace interrupt for the video; and level six is the diskette drive adapter-access interrupt. The non-maskable interrupt (NMI) of the 8088 is attached to the keyboard-interface circuits and receives an interrupt for each scan code sent by the keyboard. The system board supports both read-only memory (ROM) and R/W memory (RAM). It has space for 64K bytes by 8 bits of ROM. There are two module sockets that accept a 32K byte by 8 bit ROM module. ROM is aligned at the top of the 8088's address space. This ROM contains the Power-On Self-Test, cassette-BASIC interpreter, cassette-operating system, I/O drivers, dot patterns for 256 characters in graphics mode, a diskette bootstrap-loader and user-selectable diagnostic-routines. Introduction 2-7 The system board contains the following major functional components: • 8088 Microprocessor • 64KROM • 128K ROM Cartridge Interface • 64K Dynamic RAM • 64KB Memory and Display Expansion Interface • Serial Port (RS232) • Audio Alarm (Beeper) • Sound Subsystem • Cassette Interface • Joystick Interface • Keyboard Interface • Modem Interface • Diskette Interface • Video/Graphics Subsystem • Light Pen Interface • I/O Expansion Bus • 9-Level Interrupt The following is a block diagram of the System Board. 2-8 Introduction IR Link or Keyboard Cable ~ Connector 2 Joysticks 4 Buttons Key- 128K Power 64K RS232-C Serial board ROM Supply Joystick RAM Serial ~ Printer Inter- Cart. Conn. Conn. Interface face Conn. 64K 64K 1/0 Parallel OSC 9 Level 8088 ROM RAM Channel Printer Clock Interrupt on on Conn. Attach. Control Board Board Audio Diskette Modem Adapter Video and Audio Drive Adapter Cassette Interface ...- Cassette Deck Alarm Interface - RF Mod. r- ~ Diskette Drive External Amplifier and Speaker - Home Television I I Composite Video I RGBI Monitor r I Light Pen I Telephone System Board Block Diagram Introduction 2-9 , - - - - - - - Diskette Drive Adapter Connector Infra- Red Receiver - - - - - - - Internal Modem Connector - - - - - 64KB Memory Expansion Connector Power Board Connector Left Side Internal Modem Grounding Pins If B15 Rear Right Side System Board Connector Specifications (Part 1 of 3) Front View ro T v :J::::::::::::::::::I::: ::mmnmri::::::nnmmm::::::mmmrrn::::::i::: 1/0 Expansion Connector Right Side View System Board Connector Specifications (Part 2 of 3) Letter Letter Designation Connector Use Designation Connector Use J Left Joystick V Composite Video J Right Joystick D Direct Drive Video L Spare S Serial Device K Keyboard C Cassette LP Light Pen A Audio T Television System Board Connector Specifications (Part 3 of 3) Processor and Support The (R) Intel 8088 Microprocessor is used as the system's central processor. Some of its characteristics are: • 4.77 MHz clock • 20 bit address bus • 8-bit memory interface • 16-bit ALU (arithmatic/logic unit) and registers • Extensive instruction set • DMA and interrupt capabilities • Hardware fixed-point multiply and divide The system clock is provided by one Intel 8284A clock chip. The 8088 is operated in the minimum mode. Performance The 8088 is operated at 4.77 MHz which results in a clock cycle-time of 210 ns. Normally four clock cycles are required for a bus cycle so that an 840 ns ROM memory cycle time is achieved. RAM write and read cycles will incur an average of two wait states because of sharing with video, leading to an average of six clock cycles. I/O reads and writes also take six clock cycles leading to a bus cycle time of 1.260 f.J.s. Processor and Support 2-13 Notes: 2-14 Processor and Support 8259A Interrupt Controller PCjr Hardware Interrupts Nine hardware levels of interrupts are available for the PC}r system. The highest-priority interrupt is the NMI interrupt in the 8088. The NMI is followed by eight prioritized interrupt-levels (0-7) in the 8259A Programmable Interrupt Controller, with IRQ 0 as the highest and IRQ 7 as the lowest. The interrupt level assignments follow: Level Function 8088 NMI Keyboard Interrupt 8259A IRQ 0 Timer Clock Interrupt 8259A IRQ 1 I/O Channel (Reserved) 8259A IRQ 2 I/O Channel 8259A IRQ 3 Asynchronous Port Interrupt (RS-232C) 8259A IRQ 4 Modem Interrupt 8259A IRQ 5 Vertical Retrace Interrupt (Display) 8259A IRQ 6 Diskette Interrupt 8259A IRQ 7 I/O Channel (Parallel Printer) Hardware Interrupts Interrupt Controller 2-15 8259A Programming Considerations The 8259A is set up with the following characteristics: • Buffered Mode • 8086 Mode • Edge Triggered Mode • Single Mode Master (No Cascading is Allowed) The 8259A I/O is located at I/O address hex 20 and hex 21. The 8259A is set up to issue interrupt types hex 8 to hex F which use pointers to point to memory address hex 20 to hex 3F. The following figure is an example setup. 0263 BO 13 MaY AL,13H ; ICW I - Reset edge sense circuit set single ; 8259 Chip and ICW4 read 0265 E6 20 OUT INTAOO,AL 0267 B008 MaY AL,8 ; ICW2 - Set interrupt type 8 (8-F) 0269 E6 21 OUT INTAOI,AL 026B B009 MaY AL,9 ; ICW4 - Set buffered model master and 8086 mode 0260 E6 21 OUT INTAOI,AL Example Set Up 2-16 Interrupt Controller 64KRAM The 64K bytes of R/W memory reside on the system board and require no user configuration. Eight 64K byte by 1,150 ns, dynamic memory modules are used to provide 64K byte of storage. The RAM has no parity. Sources of these memory modules include the Motorola MCM6665AL15 and the Texas Instruments TMS4164-15 or equivalent. The system board 64K RAM is mapped at the bottom of the 1 MEG address space. The system board 64K RAM is mapped to the next 64K bytes of address space if the 64KB Memory and Display Expansion option is not installed. If read or written to, this higher block of address space will look just like the low-order 64K-byte block. This means the bottom 128K bytes of address space is always reserved for RAM. If the 64KB Memory and Display Expansion option is installed, it is mapped to the I ODD I memory space within the 128K byte-reserved space while the system board memory is mapped to the I EVEN I space. Memory refresh is provided by the 6845 CRT Controller and gate array. The gate array cycles the RAM and resolves contention between the CRT and processor cycles. See "IBM PCjr 64KB Memory and Display Expansion" in Section 3 for a detailed description. 64K RAM 2-17 Notes: 2-1864KRAM ROM Subsystem The ROM subsystem is made up of 64K bytes of ROM aligned at the top of the 1 MEG address space. The ROM is built using 32K byte by 8 ROM-modules. The ROM has no parity. The general memory specifications for the ROM are: Access Time - 250 ns Cycle Time - 375ns ROM modules Mk 38000 from Mostek, TMM23256P or equivelent are used. Address A 14 is wired to both pin 1 and pin 27. The following figure is a map of the sections of memory allocated for use by the system: ROM Subsystem 2-19 FFFFF BIOSI Diagnosticl Cassette Basic Program Area FOOOO Standard Application €artridge Cartridge E8000 Chip Standard Application Cartridge Selects EOOOO Reserved For Future Cartridge 08000 Reserved For Future Cartridge 00000 Reserved for 1/0 ROM COOOO Video RAM B8000 Reserved Future Video AOOOO Reserved Future User RAM 20000 Expansion RAM 10000 Base RAM 00000 Memory Map 2-20 ROM Subsystem Input Output Channel The Input/Out channel (I/O) is an extension of the 8088 microprocessor bus. It is however, demultiplexed, repowered, and enhanced by the addition of interrupts. The I/O channel contains an 8-bit bidirectional bus, 20 address lines, 3 levels of interrupt, control lines for memory and I/O read or write, clock and timing lines, and power and ground for the adapters. Voltages of +5 dc and + 12 dc are provided for external adapters. Any additional power needs will require a separate power-module. All 1/ 0 Channel functions are bused to the right-hand side of the system unit and are provided by a right-angle, 60-pin connector. Each external adapter connects to the I/O bus and passes the bus along for the next attachment. A ready line is available on the I/O Channel to allow I I operation with slow I/O or memory devices. If the channel's ready line is not activated by an addressed I I device, all processor-generated memory-read and write cycles take four 210-ns clocks or 840-ns/byte. All processor-generated I/O-read or write cycles require six clocks for a cycle time of 1.26-/Ls/byte. The I/O Channel also contains the capability to add bus masters to the channel. These devices could be DMA devices or alternate processors. The I/O Channel signals have sufficient drive to support five I/O Channel expansion-adapters and the internal modem and diskette drive adapter, assuming one standard TTL load per attachment. For information on power available for external adapters, see "System Power Supply", later in this Section. I/O Channel 2-21 Signal Name Signal Name D1 81 A1 DO D2 +12 Vdc D4 D3 Shield GND - D5 D7 85 A5 D6 AO +5 Vdc A2 A1 Shield GND - A3 A5 A4 A6 810 A10 GND A8 A7 -DAC KO A9 A11 A10 A12 DROO Shield GND - 815 A15 A13 A15 A14 Shield GND - A16 A17 GND A19 A18 Shield GND - 820 A20 -lOR -MEM R -lOW -MEM W GND ALE HDlA Shield GND - ClK IO/-M 825 A25 RESET READ Y +5 Vdc -CAR D SlCTD - -HRO Shield GND - IR01 IR07 IR02 AUDI OIN 830 A30 Reserved liD Channel Expansion Connector Specifications 2-22 I/O Channel System Board 110 Channel Description The following is a description of the I/O Channel. All signals are TTL compatible. Signal 110 Description CLK o System Clock: It is a divide-by-three of the 14.31818 MHz oscillator and has a period of 210 ns (4.77 MHz). The clock has a 33% duty cycle. 70 ns 140 ns 70 ns 140 ns Duty Cycle RESET o This line is used to reset or initialize system logic upon power-up. This line is synchronized to the failing edge of the clock and is active high I I • Its duration upon power up is 26.5 p.s. AO-A19 1/0 Address Bits 0 to 19: These lines are used to address memory and 110 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 normally driven by the 8088 microprocessor as I/O Channel 2-23 outputs, but can become inputs from an external bus-master by issuing an HRQ and receiving an HLDA. DO-D7 I/O Data Bits 0-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 can be controlled by an external bus-master by issuing an HRQ and receiving an HLDA. ALE o Address Latch Enable: This line is provided to allow the addition of wait states in memory and I/O cycles. READY I This line, normally 'high' ( '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 requiring this line should drive it 'low' immediately upon detecting a valid address and 10/-M signal. Machine cycles (I/O and memory) are extended by an integral number of CLK cycles (210 ns). Any bus master on the I/O Channel should also honor this 'ready' line. It is pulled 'low' by the system board 2-24 I/O Channel on memory read and write cycles and outputting to the sound subsystem. IRQ1,IRQ2, I Interrupt Request 1,2, and 7: IRQ7 These lines are used to signal the processor that an I/O device requires attention. They are prioritized with IRQ 1 as the highest priority and IRQ7 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 I/O I/O Read Command: This command line instructs an II0 device to drive its data onto the data bus. This signal may be driven by the 8088 microprocessor or by an external bus-master after it has gained control of the bus. This line is active 'low'. -lOW I/O I/O Write Command: This command line instructs an II0 device to read the data on the data bus. This signal may be driven by the 8088 microprocessor or by an external bus-master after it has gained control of the bus. This line is active 'low'. -MEMR I/O Memory Read Command: This command line instructs the I/O Channel 2-25 memory to drive its data onto the data bus. This signal may be driven by the 8088 microprocessor or by an external bus-master after it has gained control of the bus. This line is active 'low'. -MEMW I/O Memory Write Command: This command line instructs the memory to store the data present on the data bus. This signal may be driven by the 8088 microprocessor or by an external bus-master after it has gained control of the bus. This line is active low. IO/-M 110 110 or Memory Status: This status line is used to distinguish a memory access from an 1/0 access. This line should be driven by a bus master after it has gained control of the bus. If this line is 'high' it indicates an II0 Address is on the Address Bus; if this line is 'low', it indicates a memory address is on the Address Bus. -HRQ I Hold Request: This line indicates that another bus master is requesting the 1/0 Channel. To gain bus-master status, a device on the channel must assert -HRQ (active 'low'). The 8088 will respond to a -HRQ by asserting an HLDA. After receiving an HLDA, the new bus master may 2-26 I/O Channel control the bus, and must continue to assert the -HRQ until it is ready to relinquish the bus. A -HRQ is not an asynchronous signal and should be synchronized to the system clock. All channel devices with bus-master capabilities must latch data-bit 04 during any 'Out I instruction to AO-A7. The resulting signal should be used to qualify -HRQ as follows: Latched value = 1--> -HRQ is inhibited. Latched value =0 -- > -HRQ is allowed. For more detail, see the explanation of the AO port. DRQO o This line comes from the floppy disk controller (FOe) and can be used by an external DMA to indicate that a byte should be transferred to the FOC. -DACKO I This line should come from an external OMA and should indicate that a byte is being transferred from memory to the FDC. HLDA o Hold Acknowledge: This line indicates to a bus master on the channel that -HRQ has been honored and that the 8088 has floated its bus and control lines. I/O Channel 2-27 -CARD I This line should be pulled down SLCTD by any adapter when it is selected with address and IO/-M. This line will be used for bus expansion. It is pulled up with a resistor and should be pulled down with an open collector device. AUDIOIN I Channel devices may provide sound sources to the system-board sound-subsystem through this line. It is 1 volt peak-to-peak, dc biased at 2.5 volts above ground. 2-28 I/O Channel Input/ Output Hex Range 9 8 7 6 5 4 3 2 1 0 Device 20-27 o0 o0 1 0 0 X X AO PIC 8259 o0 0 1 0 0 0 II 40-47 0 Al AO Timer 8253-5 60-67 o0 0 1 1 0 0 X Al AO PPI8255-5 AO-A7 o0 1 0 I 0 0 X X X NMI Mask Reg. ~ CO-C7 o0 1 1 0 0 0 X X X Sound ~ SN76496N 1111 FO-FF o0 1 1 1 I X A2 Al AO Diskette 200-207 1 0 000 0 0 X X X Joystick 2F8-2FF 1 0 1 1 I I 1 A2 AI AO Serial Port 3DO-3DF I I I I 0 I A3 A2 Al AO Video Subsystem 3F8-3FF 1 I I I I I I A2 Al AO Modem 1/0 Map x = Don't care (that is, not in decode.) • Any 1/ a which is not decoded on the system board may be decoded on the I/O Channel. • At Power-On time the NMI into the 8088 is masked I off I . This mask bit can be set by system software as follows: Write to Port AO D7 =ENA NMI D6=IR TEST ENA D5=SELC CLK! INPUT D4=+Disable HRQ I/O Channel 2-29 8255 Bit Assignments PA Output P AO Reserved for Keystroke Storage PAl Reserved for Keystroke Storage PA2 Reserved for Keystroke Storage PA3 Reserved for Keystroke Storage PA4 Reserved for Keystroke Storage PA5 Reserved for Keystroke Storage PA6 Reserved for Keystroke Storage PA7 Reserved for Keystroke Storage PB Output PBO + Timer2 Gate (Speaker) PB I + Speaker Data PB2 +Alpha (-Graphics) PB3 + Cassette Motor Off PB4 + Disable Internal Beeper and Cassette Motor Relay PB5 SPKR Switch a PB6 SPKR Switch I PB7 Reserved PC Input pca Keyboard Latched PCI -Internal MODEM Card Installed PC2 -Diskette Drive Card Installed PC3 -64KB Memory and Display Expansion Installed PC4 Cassette Data In PC5 Timer Channel 2 Output PC6 + Keyboard Data PC7 -Keyboard Cable Connected 2-30 I/O Channel 2-28 8255 Bit Assignment Description PAO tbm (Output Port A is configured as an output. PA7 Lines) The output lines are not used by the hardware, but are used to store keystrokes. This is done to maintain compatibility with the Personal Computer, and Personal Computer XT. PBO (+Timer 2 This line is routed to the gate input Gate) of timer 2 on the 8253-5. When this bit is 'low', the counter operation is halted. This bit and PBI (+Speaker Data) controls the operation of the 8253-5 sound source. PB1 (+Speaker This bit ANDS 'off' the output of Data) the 8253-5 timer 2. It can be used to disable the 8253-5 sound source, or modify its output. When this bit is a 1, it enables the output, a 0 forces the output to zero. PB2 (+Alpha This bit is used to steer data from the -Graphics) memory into the Video Gate Array. This bit should be a 1 for all alpha modes, and a 0 for all graphics modes. I/O Channel 2-31 PB3 (+Cassette When this bit is aI, the cassette Motor Off) relay is 'open' and the cassette motor is 'off'. When this bit is a 0, and PB4 = 0, the cassette motor is 'on'. PB4 (+Disable When this bit is aI, the internal internal beeper is 'disabled' and the 8253-5 beeper and timer 2 sound source can only be cassette heard if it is steered to the audio motor relay) output. This bit also disables the cassette motor when it is a 1. To , enable the cassette motor, this bit I must be a O. In this case, PBI should be used to gate 'off' the internal beeper and 8253-5 sound source. PBS, (Speaker These bits steer one of 4 sound PB6 switch 0,1) sources. This is available to the RF modulator or the external audio jack. The sound sources selected are shown below. PB6 PBS Sound Source 0 0 8253-5 Timer 2 0 1 Cassette Audio Input 1 0 I/O Channel Audio In 1 1 76496 PB7 (Open) Reserved for future use. 2-32 I/O Channel PCO (Keyboard This input comes from a latch which latched) is set to a 1 on the first rising edge of the Keyboard Data stream. The output of this latch also causes the NMI to occur. This latch is cleared by doing a dummy I Read I operation to port AO. This input is provided so that a program can tell if a keystroke occurred during a time when the NMI was masked I off I and a keystroke has been missed. The program will then be able to give an error indication of the missed keystroke. PCI (-Modem When this bit is a 0, it indicates that card the Internal Modem card is installed. installed) PC2 (-Diskette When this bit is a zero, it indicates card that the Diskette Drive Adapter is installed) installed. PC3 (-64KB When this bit is a 0, it indicates that Memory and the 64KB Memory and Display Display Expansion is installed. Expansion installed) 1/0 Channel 2-33 PC4 (Cassette If the cassette-motor relay is data in) , closed' , and the cassette motor is , on ' , this pin will contain data which has been wave shaped from the cassette. If the cassette-motor relay is 'off', this pin will contain the same data as the 8253-5 timer 2 output. PC5 (Timer This input is wired to the timer channel 2 channel 2 output of the 8253-5. output) PC6 (+Keyboard This input contains keyboard data. data) The keyboard data comes from the cable if attached, or from the IR Receiver if the cable is not attached. PC7 (-Keyboard If this bit is 'low', it indicates that cable the keyboard cable is connected. connected) 2-34 I/O Channel Port AO Output Description D7 (Enable NMI) When this bit is ai, the NMI is I enabled When it is a 0, it is I • I disabled I • D6 (IR test ENA) This bit enables the 8253-5 timer 2 output into an IR diode on the IR Receiver board. This information is then wrapped back to the keyboard input. If the cable is not connected, timer 2 should be set for 40 kHz which is the IR-modulation frequency. This feature is used only for a diagnostic test of the IR Receiver board. D5 (Selc CUd input) This bit selects one of two input Clks to the 8253-5 timer 1. A 0 selects a 1.1925 MHz Clk input used to 'assist the program in de-serializing the keyboard data. A 1 selects the timer o output to be used as the Clk input to timer 1. This is used to catch timer o overflows during diskette drive operations when interrupts are masked I off I . This is then used to update the time-of-day. D4 (+Disable HRQ) This bit is not actually implemented on the system board, but is supported by the programming. This bit is used to disable -HRQs from external bus-masters (D MA, Alternate Processors, etc.) The logic for this bit must exist on each bus-master attachment. A 0 should enable -HRQ, and a 1 I I should disable -HRQ. I I I/O Channel 2-35 +HRO from external bus master I lS74 l~3 04 - HROon 1/0 AOCS ~Input should be an open --- collector type device Port AO Output Description Port AO Input Operation A Iread I to II0 port AO will clear the keyboard NMI latch. This latch causes an NMI on the first rising edge of the keyboard data if the enable NMI bit (port AO bit D7) is Ion I. This latch can also be read on the 8255 PCO. The program can determine if a keystroke occurred while the NMI was Idisabled I by reading the status of this latch. This latch must be cleared before another NMI can be received. The System board provides for selection of keyboard data from either a cable or the IR-receiver board. The IR-receiver board is mounted on the system board and can receive data through an IR link. The source of the keyboard's data is determined by the -Cable Connected signal at the keyboard cable connector. Keyboard serial data is available to the 8088 at bit PC6 of the 8255 PPI. The system board is responsible for the de-serialization of keyboard data. The start bit in the serial stream causes an NMI to be generated. The 8088 then reads the 8253 timer to determine when to interrogate the 2-36 I/O Channel serial stream. After de-serialization the NMI service-routine does a 'Read' from hex AO to clear the NMI latch. During certain time-critical operations, such as diskette I/O, the processor will mask 'off' the NMI interrupt. Keyboard inputs during this time cannot be serviced. A keyboard latch is provided so that at the end of such operations the processor will determine whether any keys were pressed and take appropriate actions. The keyboard latch is 'set' by any key being pressed and is 'reset' by 'Reading' the NMI port. (No data is presented to the microprocessor during this 'Read'.) Keyboard latch data is available to the processor at bit peo of the 8255 PPI. I/O Channel 2-37 Notes: 2-38 I/O Channel Cassette Interface The cassette interface is controlled through software. An output from the 8253 timer controls the data to the cassette recorder through the cassette connector at the rear of the system board. The cassette-input data is read by an input-port bit of the 8255A-5 programmable-peripheral-interface (PPI) (8255A-5 PC4). Software algorithms are used to generate and read cassette-data. The cassette drive- motor is controlled by Bit PB3 of the 8255. Bit PB4, which 'enables' the 7547 relay driver, must be 'low' when the motor is to be turned on. The cassette interface has a wrap feature which connects the output to the input when the motor control is 'off'. See "BIOS Cassette Logic" in Section 5 for information on data storage and retrival. A mechanism is provided that will direct the cassette input to the audio subsystem. Please see "Sound Subsection" in Section 2. Circuit block diagrams for the cassette-interface read, write, and motor control are illustrated in the following figures. Cassette Interface 2-39 1000k Cassette 18 Ohm GND Resistor ~ .... Ohm t-- Resistor +5V I Cassette roo- 0.047/-1F to- 18k Ohm .... OP Amp 18k Ohm Data In Capacitor Resistor ....... ~ Resistor LM358 -sl Audio Subsystem 18k Ohm Silicon Data From GND- Diode ~ Cassette Resistor Vir .4V Cathode Recorder Earphone Jack I GND Cassette-Interface Read-Hardware Block Diagram +5V ~ 74LS125 3.9k Ohm 8253 Timer #2 1'G Resistor D DRV 1 1 4.7k Ohm G ND Resistor 1 T 0.S78Vto AUX Inpu 1.2k Ohm Resistor 1 T - 0.075V to MIC Input 150 Ohm Resistor I GND Cassette-Interface Write-Hardware Block Diagram 2-40 Cassette Interface +5V +5V SN75475 Relay Coil +5 Clamp Cassette 74LS04 Motor Control PB3 In Out Coil Motor S NOT On Com PB4 VSS Enable Beeper/ Cassette Motor NOT Relay GND Cassette-Motor Control Block Diagram Signal Name Pin Number LOGIC GND A01 CASS AUDIO IN A02 MIKE AUDIO OUT A03 Cassette MOTOR CONTROL A04 System KEY PLUG B01 Board AUX DATA OUT B02 MOTOR CONTROL SW B03 SHIELD GND B04 Cassette Connector Specifications Cassette Interface 2-41 Notes: 2-42 Cassette Interface Video Color/Graphics Subsystem The video subsystem is designed so that the IBM Color Display, composite monitors, and a horne television set can be attached. It is capable of operating in black- and-white or color. It provides three video ports: a composite-video, a direct-drive, and a connector for an RF modulator to be used with horne televisions. In addition, it contains a light pen interface. Note: The IBM Personal Computer Monochrome Display cannot be used with the PCjr system. Note: An IBM Connector for Television option must be obtained to attach a home TV. The subsystem has two basic modes of operation: alphanumeric (A/N) and all points addressable graphics (AP A). Additional modes are available within the A/N and AP A modes. In the A/N mode, the display can be operated in either a 40-column by 25-row mode for a low-resolution display home television, or an 80-column by 25-row mode for high-resolution monitors. In both modes, characters are defined in an 8-wide by 8-high character box and are 7-wide by 7-high, with one line of descender. Both A/N modes can operate in either color or black-and-white. In the A/N black-and-white mode, the character attributes of reverse video, blinking, highlighting and gray shades are available. In the A/N color mode, sixteen foreground-colors and sixteen background-colors are available for each character. In addition, blinking on a per-character basis Video Subsystem 2-43 is available. When blinking is used, only eight background-colors are available. One of 16 colors, or gray shades can be selected for the screen's border in all A/N modes. In both A/N modes, characters are formed from a ROM character-generator. The character generator contains dot patterns for 256 different characters. The character set contains the following major groupings of characters: • 16 special characters for game support • 15 characters for word-processing editing support • 96 characters for the standard-ASCII-graphics set • 48 characters for foreign-language support • 48 characters for business block-graphics (allowing drawing of charts, boxes, and tables using single or double lines) • 16 selected Greek symbols • 15 selected scientific-notation characters In the APA mode, there are three resolutions available: a low-resolution mode (160 PELs [Picture ELements] by 200 rows), a medium-resolution mode (320 PELs by 200 rows), and a high-resolution mode (640 PELs by 200 rows). Different color modes exist within each of the AP A resolutions. Two, four, or sixteen colors are available in AP A color, and two, four, or sixteen gray shades are available in AP A black-and-white. 2-44 Video Subsystem One of sixteen colors, or grey shades can be selected for the screen's border in all APA modes. The direct drive, composite video and RF Modulator connector are right-angle-mounted connectors extending through the rear of the system unit. The video color/graphics subsystem is implemented using a Motorola 6845 CRT controller device and a Video Gate Array (VGA) (LSI5220). The video subsystem is highly programmable with respect to raster and character parameters. Thus many additional modes are possible with the proper programming. The following figure shows a block diagram of the video color/graphics subsystem. Video Subsystem 2-45 ,- - - - - - - - - - - - - 64K Expansion Card -, I I - Processor Data Latch f- I I I -- 64Kx8 I RAM I DIN I I I ~ I CRT Data ~ I Processo r I Latch I Memory Data Bus l. ------ 1------- ~ DIN Processo r IAddress Address 1 Multiplexer L. Processor Data Latch ~ 64Kx8 Processo r RAM 1/0 HAddress , Data Bus .~ 6845 Multiplexer CRT ... Character Control SYNCS Video f Data Latch RAS. CAS. WE Gate , Control Character Array ~ Generator ROM CRT Data CG Data Latch Latch I J RGBI Television Direct Drive Syncs Video Composite L. Video ~~ Composite logic Video r--------l I RF ~ I I Television I Modulator -1 I I External L ______ ..J I Video Color/Graphic Subsystem Block Diagram 2-46 Video Subsystem Major Components Definitions Motorola 6845 CRT Controller This device provides the necessary interface to drive a raster-scan CRT. Additional information about this component is provided in publications listed in "Bibliography" . Storage Organization The base video-color / graphics-subsystem accesses 64K bytes of read/write memory (RAM). A 64KB Memory and Display Expansion can be added to increase the amount of system RAM to 128K bytes. This memory-storage area serves two functions; as the video-display buffer and as the system processor is (8088) main-RAM. The RAM is located at address hex 0000 and is either 64K bytes or 128K bytes with the memory expansion option. The 8088 can access the memory by reading from and writing to address locations hex 00000 to IFFFF or by reading from or writing to the 16K-byte region starting at address hex B8000. The page affected by a read or write operation is determined by the processor's page register. The processor can access the RAM at any time in all modes with no adverse effect to the video information. The page that the video information is taken from is determined by the CRT page register. The processor and CRT page registers are write only registers and can be changed at any time. These registers allow the processor to work in one page while the display is displaying another page. The processor can switch pages at the vertical-retrace time. This will aid animation on the video color/graphics subsystem. Video Subsystem 2-47 Also, since all 128K bytes of read/write memory are available for display purposes, the application can use as little or as much memory as needed for the display. The following figure is a map of the video color/ graphics subsystem. Hex Memory Map Address Pro cess or COOOO Rea d/Write Video Ope rations 88000 I ·· Pro cessor Pag e ·· Sele ct 20000 Page 7 CRT Page Select ~ Page 6 Page 5 Page 4 10000 Page 3 Page 2 Page 1 Page 0 00000 Video Color/Graphics Subsystem Memory Map 2-48 Video Subsystem Bandwidth The video bandwidth is either 3.5, 7 or 14 MHz depending on the mode of operation. The processor bandwidth is the same for all modes. The processor is allowed one cycle every 1.1 microseconds. An average of two wait states will be inserted in a processor RAM read cycle, because the average latency time for the processor to get a cycle is 560 ns and the cycle time is 350 ns. There is no performance penalty for redirecting processor reads and writes through the B8000 - BFFFF address area. I' Character Generator The ROM character-generator consists of 2K bytes of storage which cannot be read from, or written to under software control. It is implemented with a MCM68A316E or equivalent. Its specifications are 350 ns access, 350 ns cycle static operation. The device is pin compatible with 2716 and 2732 EPROMS. Video Gate Array A CMOS gate array is used to generate storage-timing (RAS, CAS, WE), direct-drive, composite-color and status signals. See "Video Gate Array" later in this section. Video Subsystem 2-49 Palette The video color/graphics subsystem contains a 16-word by 4-bit palette in the Video Gate Array which takes PEL (Picture ELement) information from the read/write memory and uses it to select the color to display. This palette is used in all A/N and APA modes. Any input to the palette can be individually masked off if a mode does not support the full I I complement of 16 colors. This masking allows the user to select a unique palette of colors whenever any mode does not support all 16 colors. In two-color modes, the palette is defined by using one bit (PAO), with the following logic: Palette Address Bit PAO Function 0 Palette Register 0 I Palette Register I Palette Logic (1 of 3) 2-50 Video Subsystem In four-color modes, the palette is defined by using two bits (PAl and PAO), with the following logic: Palette Address Bits PAl PAO Function 0 0 Palette Register 0 0 I Palette Register I 1 0 Palette Register 2 1 I Palette Register 3 Palette Logic (2 of 3) Video Subsystem 2-51 In sixteen-color modes, the palette is defined by using four bits (PA3, PA2, PAl, and PAO), with the following logic: Palette Address Bits PA3 PA2 PAl PAO Function 0 0 0 0 Palette Register 0 0 0 0 1 Palette Register 1 0 0 1 0 Palette Register 2 0 0 1 1 Palette Register 3 0 1 0 0 Palette Register 4 0 1 0 1 Palette Register 5 0 1 1 0 Palette Register 6 0 1 1 1 Palette Register 7 1 0 0 0 Palette Register 8 1 0 0 1 Palette Register 9 1 0 1 0 Palette Register 10 1 0 1 1 Palette Register 11 1 1 0 0 Palette Register 12 1 1 0 1 Palette Register 13 1 1 1 0 Palette Register 14 1 1 1 1 Palette Register 15 Palette logic (3 of 3) 2-52 Video Subsystem The sixteen colors available to all AjN and APA modes are selected through combinations of the I (Intensity), R (Red), G (Green), and B (Blue) bits. These colors are listed in the following figure: 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 Rcd 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 I I Light Cyan 1 1 0 0 Pink 1 1 0 1 Light Magenta 1 1 1 0 Yellow 1 1 1 1 White Note: The "1" bit provides extra luminance (brightness) to each available shade. This results in the light colors listed above, except for monitors that do not recognize the "I" bit. Summary of Available Colors Video Subsystem 2-53 Alphanumeric Modes . . Every display-character position in the alphanumeric mode is defined by two bytes in the system read/write memory, using the following format: Display Character Code Byte Attribute Byte 7 6 5 4 3 2 I 0 7 6 5 4 3 2 1 0 Display Format 2-54 Video Subsystem The functions of the attribute byte are defined by the following figure: Attribute Function Attribute Byte Definition 7 6 5 4 3 2 I 0 Fore- PA2 PAl PAO PA3 PA2 PAl PAO Ground Blink Background Foreground Normal B 0 0 0 I I I I Reverse B 1 1 1 I 0 0 0 Video N ondisplay B 0 0 0 I 0 0 0 (Off) N ondisplay B I 1 1 I 1 I 1 (On) I =Highlighted Foreground (Character) B =Blinking Foreground (Character) Attribute Functions Graphics Mode The Video Color/Graphics Subsystem can be programmed for a wide variety of modes within the graphics mode. Five graphics-modes are supported by the system's ROM BIOS. They are low-resolution 16-color graphics, medium-resolution 4-color graphics, medium-resolution 16-color graphics, high-resolution 2-color graphics, and high-resolution 4-color graphics. The table in the following figure summarizes the five modes: Video Subsystem 2-55 Number of Colors Graphics Horiz. Vert. A vailable (Includes Mode (PELs) (Rows) Background Color) Low-Resolution 160 200 16 (Includes b-and-w) l6-Color Medium-Resolution 320 200 4 Colors of 16 4-Color Available Medium-Resolution 320 200 16 (Includes b-and-w) 16-Color High-Resolution 640 200 2 Colors of 16 2-Color Available High-Resolution 640 200 4 Colors of 16 4-Color Available Note: The screen's border color in all modes can be set to any 1 of the 16 possible colors. This border color is independent of the screen's work area colors. In Black and White each color maps to a distinct gray shade. Graphics Modes Low-Resolution 16-Color Graphics The low-resolution mode supports home-television sets, low-resolution displays, and high-resolution displays. It has the following characteristics: • Contains a maximum of 200 rows of 160 PELs • Specifies 1 of 16 colors for each PEL by the I, R, G, and B bits • Requires 16K bytes of read/write memory • Formats 2 PELs per byte for each byte in the following manner: 2-56 Video Subsystem 7 6 5 4 3 2 o PA3 PA2 PA1 PAO PA3 PA2 PA1 PAO First Second Display Display PEL PEL Low-Resolution 16-Color Graphics Medium-Resolution 4-Color Graphics The medium-resolution mode supports home-television sets, low-resolution displays, and high-resolution displays. It has the following characteristics: • Contains a maximum of 200 rows of 320 PELs • Selects one of four colors for each PEL • Requires 16K bytes of read/write memory • Supports 4 of 16 possible colors • Formats 4 PELs per byte for each byte in the following manner: 7 6 5 4 3 2 o PA1 PAO PA1 PAO PA1 PAO PA1 PAO First Second Third Fourth Display Display Display Display PEL PEL PEL PEL Medium-Resolution 4-Color Graphics Video Subsystem 2-57 Medium-Resolution 16-Color Graphics The medium-resolution 16-color graphics mode supports home television sets, low-resolution displays, and high-resolution displays. It has the following characteristics: • Requires system configuration of 128K bytes of read/write memory • Requires 32K bytes of read/write memory • Contains a maximum of 200 rows of 320 PELs. • Specifies 1 of 16 colors for each PEL • Formats 2 PELs per byte for each byte in the following manner. 7 6 5 4 3 2 1 o PA3 PA2 PA1 PAO PA3 PA2 PA1 PAO First Second Display Display PEL PEL Medium-Resolution 16-Color Graphics High-Resolution 2-Color Graphics The high-resolution 2-color mode supports high-resolution monitors only. This mode has the following characteristics: • Contains a maximum of 200 rows of 640 PELs • Supports 2 of 16 possible colors. 2-58 Video Subsystem • Requires 16K bytes of read/write memory. • Formats 8 PELs per byte for each byte in the following manner: 7 6 5 4 3 2 1 o IPAOlpAOlpAOlpAOlpAOI PAOlpAOI PAOI I l Eighth Display PEL Seventh Display PEL Sixth Display PEL Fifth Display PEL Fourth Display PEL Third Display PEL Second Display PEL First Display PEL High-Resolution 2-Color Graphics High-Resolution 4-Color Graphics The high-resolution mode is used only with high-resolution monitors. This mode has the following characteristics: • Requires system configuration of 128K Bytes read/write memory • Requires 32K bytes of read/write memory • Contains a maximum of 200 rows of 640 PELs • Selects one of four colors for each PEL • Supports 4 out of 16 colors • Formats 8 PELs per two bytes (consisting of one even-byte and one odd-byte) in the following manner: Video Subsystem 2-59 Even Bytes 7 6 5 4 3 2 1 0 PAO PAO PAO PAO PAO PAO PAO PAO t t First Second t t Third Fourth Fifth t t Sixth t t Seventh Eighth Display Display Display Display Display Display Display Display PEL PEL PEL PEL PEL PEL PEL PEL l PA1 PA1 PA1 PA1 PA1 1 PA1 PA1 PA1 7 6 5 4 3 2 1 0 Odd Bytes High-Resolution 4-Color Graphics Graphics Storage Organization For the low-resolution 16-color graphics, the medium-resolution 4-color graphics, and the high- resolution 2-color graphics, storage is organized into two banks of 8000 bytes each. The following figure shows the organization of the graphics storage. 2-60 Video Subsystem Memory Address (Hex) 1-80Bytes~ OOOOH Even Scans (0.2.4 ..... 190) 8000 Bytes 1F3F 2000 Odd Scans (1.3.5 •...• 199) 8000 Bytes 3F3F Graphics Storage Organization (Part 1 of 2) Address 0000 contains PEL information for the upper-left comer of the display area. For the medium-resolution 16-color graphics, and the high-resolution 4-color graphics modes, the graphics storage is organized into four banks of 8000 bytes each. Video Subsystem 2-61 Memory Address (Hex) 1"""._- 160 Bytes -I 0000 00 Scans (OA8 ..... 196) (8000 Bytes) 1F3F 2000 01 Scans (1.5.9 •...• 197) (8000 Bytes) 3F3F 4000 10 Scans (2.6.10 •...• 198) (8000 Bytes) 5F3F 6000 11 Scans (3.7.11 •...• 199) (8000 Bytes) 7F3F Graphics Storage Organization (Part 2 of 2) Address 0000 contains PEL infonnation for the upper-left corner of the display. 2-62 Video Subsystem Video Gate Array The Video Gate Array is located at 110 address hex 3DA, and is programmed by first writing a register address to port hex 3DA and then writing the data to port hex 3DA. Any 1/0 'write' -operations to hex address 3DA continuously toggle an internal addressl data flip-flop. This internal flip-flop can be set to the address state by issuing an I/O 'read' instruction to port hex 3DA. An 1/0 'read' instruction also 'reads' the status of the Video Gate Array. A description of each of the registers in the Video Gate Array follows. Hex Address Register 00 Mode Control I 01 Palette Mask 02 Border Color 03 Mode Control 2 04 Reset 10-IF Palette Registers Video Gate Array Register Addresses Video Subsystem 2-63 Mode Control 1 Register This is a 5-bit 'write' -only register, it cannot be 'read'. Its address is 0 within the Video Gate Array. A description of this register's bit functions follows. Bit 0 +HIBW j -LOBW Bit 1 +Graphicsj -Alpha Bit 2 +BjW Bit 3 +Video Enable Bit 4 +16 Color Graphics Mode Control 1 Register Bit 0 This bit is 'high' (1) for all high-bandwidth modes. These modes are all modes which require the 64KB Memory and Display Expansion for a system total of 128K bytes of read/write memory. The high bandwidth modes are the 80 by 25 alphanumeric mode, the 640 by 200 4-color graphics mode, and the 320 by 200 16-color graphics mode. This bit is 'low' (0) for all low-bandwidth modes. Bit 1 This bit is 'high' (1) for all graphics modes and is 'low' (0) for all alphanumeric modes. Bit 2 When this bit is 'high' (1), the composite-video color-burst and chrominance are disabled, leaving only the composite intensity-levels for gray shades. When this bit is 'low' (0), the composite-video color is 'enabled'. This 2-64 Video Subsystem bit should be set I high I for high- resolution black-and-white display applications. Note: This bit has no effect on direct-drive colors. Bit 3 When this bit is high (1), the video I I signal is enabled The video signal I I. should be disabled when changing I I modes. When the video signal is Idisabled the screen is forced to the I , border color. Bit 4 This bit must be high (1) for all I I 16-color graphics-modes. These modes are the 160 by 200 16-color graphics-mode and the 320 by 200 16-color graphics-mode. Palette Mask Register This is a 4-bit write-only register, it cannot be read I I • Its address in the Video Gate Array is hex 01. A description of this register's bit functions follows. Bit 0 -Palette Mask 0 Bit 1 -Palette Mask I Bit 2 -Palette Mask 2 Bit 3 -Palette Mask 3 Palette Mask Register When bits 0-3 are 0, they force the appropriate palette address to be 0 regardless of the incoming color Video Subsystem 2-65 information. This can be used to make some information in memory a I don't care I condition until it is requested. In the 2-color and 4-color modes, the palette addresses should be I masked I because only 1 or 2 color-lines contain valid information. For 4-color modes, the palette mask register should contain a hex 03 and, for 2-color modes, it should contain a hex 01. Border Color Register This is a 4-bit write -only register, it cannot be I I read Its address in the Video Gate Array is hex 02. I I. The following is a description of the register's bit functions: Bit Number Function 0 + B (Blue) Border Color Select I + G (Green) Border Color Select 2 + R (Red) Border Color Select 3 + I (Intensity) Border Color Select Border Color Register A combination of bits 0-3 selects the screen-border color as one of 16 colors, as listed in the "Summary of Available Colors" table in this section. Mode Control 2 Register This is a 4-bit, I write I -only register, it cannot be read Its address inside the Video Gate Array is hex I I. 2-66 Video Subsystem 03. The following is a description of the register's bit functions: Bit Number Function 0 - Reserved =0 1 + Enable Blink 2 - Reserved =0 3 + 2-Color Graphics Mode Control 2 Register Bit 0 This bit is reserved, but should always be programmed as a O. Bit 1 When this bit is high (1) in the I I alphanumeric mode, the attribute byte has the following definition: 7 6 5 4 3 2 1 o I I B PA2 PAl PAO I PA3 PA2 PAl PAO I I L..._ _ _ _ _ Foreground Color L..._ _ _ _ _ _ _ _ _ _ _ _... Background Color ' " - - - - - - - - - - - - - - - - - - - Blinking Where PAO to PA3 are palette addresses. Attribute Byte Definition (Part 1 of 2) Video Subsystem 2-67 If the enable-blink bit is off in the I I alphanumeric mode, the attribute byte takes on the following definition: 7 6 5 4 3 2 1 o PA3 PA2 PA1 PAO PA1 PAO .....- - - - - Foreground Color .....- - - - - - - - - - - - -... Background Color Attribute Byte Definition (Part 2 of 2) If the enable-blink bit is on in a graphics mode, the high-order address of the palette (PA3) is replaced with the character-blink rate. This causes displayed colors to switch between two sets of colors. If the colors in the lower half of the palette are the same as in the upper half of the palette, no color changes will occur. If the colors in the upper half of the palette are different from the lower half of the palette, the colors will alternately change between the 2 palette colors at the blink rate. Only eight colors are available in the 16-color modes when using this feature. Bit 3 of the palette mask has no effect on this mode. Bit 2 This bit is reserved, but should always be programmed as a O. 2-68 Video Subsystem Bit 3 This bit should be 'high' (1) when in the 640 by 200 2-color graphics-mode. It should be 'low' (0) for all other modes. Reset Register This is a 2-bit 'write' -only register, it cannot be , read'. Its address inside the Video Gate Array is hex 04. The following is a description of the register's bit functions: Bit 0 +Asynchronous Reset Bit 1 +Synchronous Reset Reset Register Bit 0 When 'high' (1), this bit will issue an , asynchronous reset' to the Video Gate Array. This will cause all memory cycles to stop and all output signals to be tri-stated. The 'asynchronous reset' should only be issued once at the system power-on time. This bit should be 'high' (1), the Video Gate Array and the 6845 programmed, and then it should be ' low' (0). The system read/write memory (RAM) will not work until this power-on sequence is finished. After this power-on sequence, subsequent 'resets' should be 'synchronous resets' . Video Subsystem 2-69 Note: Issuing an 'asynchronous reset' can cause the contents of RAM to be destroyed. Bit 1 When 'high' (1), this bit will issue a 'synchronous reset' to the Video Gate Array. This will cause all memory cycles to stop and all output signals to stop. Bit 1 should be 'low' (0) before changing modes. Before issuing a ' synchronous reset' , the program should read 256 locations in RAM as every other location in 512 locations. The program should then issue the 'synchronous reset' and change the mode. This changes the Video Gate Array mode-control registers and the 6845 registers. Next, the 'synchronous reset' should be removed and the 256 RAM locations should be 'read' again as above. This procedure will ensure system RAM data-integrity during mode changes. , Synchronous resets' need only be issued when changing between high-bandwidth, and low- bandwidth modes. (Bit 0 in mode control 1 register) Note: No accesses to RAM can be made while the video gate array is in a , reset' state. 'Resets' must be done from code in ROM or EPROM's. 2-70 Video Subsystem }Jalette Il~sters There are sixteen 4-bit-wide palette-registers. These registers are 'write' -only, they cannot be 'read'. Their addresses in the Video Gate Array are from hex 10 to IF. Palette address hex 10 is accessed whenever the color code from memory is a hex 0, address hex 11 is accessed whenever the color code from memory is a hex 1, and so forth. A description of the color codes is in "Summary of Available Colors" in this section. Note: The palette address can be 'masked' by using the palette mask register. The following is a description of the register's bit functions: Bit Number Function 0 + Blue 1 + Green 2 + Red 3 + Intensity Palette Register Format When loading the palette, the video is 'disabled' and the color viewed on the screen is the data contained in the register being addressed by the processor. When the program has completed loading the palette, it must change the hex address to some address less than hex 10 for video to be 'enabled' again. Video Subsystem 2-71 If a programmer does not wish a user to see the adverse effects of loading the palette, the palette should be loaded during the vertical-retrace time. The program must modify the palette and change the video gate array address to less than hex 10 within the vertical-retrace time. A vertical-retrace interrupt and a status bit are provided to facilitate this procedure. 2-72 Video Subsystem Status Register This is a 5-bit 'read' -only register, it cannot be , written'. The internal address of the video gate array is a 'don't care' condition for the status-register read-operation. A description of the register's bit functions follows: Bit 0 +Display Enable Bit I +Light Pen Trigger Set Bit 2 -Light Pen Switch Made Bit 3 +Vertical Retrace Bit 4 +Video Dots Status Register Bit 0 When 'high' (1), this bit indicates video is being displayed. Bit 1 When 'high' (1), this bit indicates that a positive- going edge from the light pen input has set the light pen trigger. This trigger is 'low' (0) upon a system power-on, and may also be cleared by performing an I/O 'Out' command to address hex 3DB. No specific data is required, this action is address-activated. Bit 2 This bit indicates the status of the light pen switch. The switch is not latched or debounced. When this bit is 'low' (0), the light pen switch is 'on' . Bit 3 When 'high' (1), this bit indicates the vertical retrace is 'active'. Video Subsystem 2-73 Bit 4 When I high I (1), this bit indicates that video-dot information is available. The two low-order bits of the address register determine the video-dot information presented through the following logic: Video Dot Address Register Address Register Information Bit 1 Bit 0 Selected 0 0 Blue 0 1 Green 1 0 Red 1 1 Intensity Address Register This bit is provided for testing purposes. It verifies that video is occurring properly, and that the palette registers and all other write -only registers are I I operating correctly. Light Pen A light pen can be used on the PCjr by connecting it to the six-pin connector for light pens on the back of the system board. 2-74 Video Subsystem Signal Name Pin Number +12V A01 -LIGHT PEN INPUT A02 Light +5V A03 System Pen Board LOGIC GND B01 -LIGHT PEN SWITCH B02 UNUSED B03 Connector Specifications Note: The light pen interface is set for RGBI (Red, Green, Blue, Intensity). Due to timing differences between different displays (Different phosphors take longer to turn on, and different circuits take longer to accomplish their task.) the row, column value returned from the CRT can vary. This difference must be compensated for through software. Programming Considerations Programming the 6845 CRT Controller The 6845 has 19 accessible, internal registers, which are used to define and control a raster-scanned CRT display. One of these registers, the Index Register, is actually used as a pointer to the other 18 registers. It is a write -only register, which is loaded from the I I processor by executing an 'Out I instruction to I/O address hex 3D4. The five least-significant-bits of the I/O bus are loaded into the Index Register. In order to load any of the other 18 registers, the Index Register is first loaded with the necessary pointer; then the Data Register is loaded with the information to be Video Subsystem 2-75 placed in the selected register. The Data Register is loaded from the processor by executing an 'Out I instruction to I/O address hex 3D5. The following table defines the values that must be loaded into the 6845-CRT-Controller registers to control the different modes of operation supported by the attachment: Low/High Register Alphanumeric Band Hex Width Addr. # Type Units I/O 40x25 80x25 Graphics 0 RO Horizontal Char. Write 38 71 38/71 Total Only 1 Rl Horizontal Char. Write 28 50 28/50 Display Only 2 R2 Horizontal Char. Write 2C 5A 2B/56 Sync Only Position 3 R3 Horizontal Char. Write 06 OC 06/0C Sync Only Width 4 R4 Vertical Char. Write IF IF 7F/3F Total Row Only 5 R5 Vertical Scan Write 06 06 06/06 Total Line Only Adjustment Note: All register values are given in hexadecimal. 6845 Register Table (Part 1 of 3) 2-76 Video Subsystem Low/High Register Alphanumeric Band Hex Width Addr. # Type Units I/O 40x25 80x25 Graphics 6 R6 Vertical Char. Write 19 19 64/32 Displayed Row Only 7 R7 Vertical Char. Write lC lC 70/38 Sync Row Only Position 8 R8 Interlace Write 02 02 02/02 Mode Only 9 R9 Maximum Scan Write 07 07 01/03 Scan Line Line Only Address A RIO Cursor Scan Write 06 06 26/26 Start Line Only B Rll Cursor Scan Write 07 07 07/07 End Line Only Note: All register values are given in hexademical. 6845 Register Table (Part 2 of 3) Video Subsystem 2-77 Low/High Register Alphanumeric Band Hex Width Addr. # Type Units I/O 40x25 80x25 Graphics C RI2 Start - Write 00 00 00/00 Addr. (H) Only D RI3 Start - Write 00 00 00/00 Addr. (L) Only E R14 Cursor - Read/ 00 00 00/00 Addr. (H) Write F R15 Cursor - Read/ 00 00 00/00 Addr. (L) Write 10 R16 Light - Read NA NA NAjNA Pen (H) Only 11 R17 Light - Read NA NA NA/NA Pen (L) Only N ate: All register values are given in hexadecimal. 6845 Register Table (Part 3 of 3) 2-78 Video Subsystem CRT /Processor Page Register This register is an 8-bit I write I -only register, that cannot be read. Its address is hex 3DF. The following is a description of the Register functions. Bit Number Description 0 CRT Page 0 1 CRT Page 1 2 CRT Page 2 3 Processor Page 1 4 Processor Page 2 5 Processor Page 3 6 Video Address Mode 0 7 Video Address Mode 1 CRT/Processor Page Register (Part 1 of 2) CRT Page 0-2 These bits select which 16K byte memory-page between 00000 to hex IFFFF is being displayed. If there is no expansion RAM in the system, the high- order bit is a I don't care and only 4 pages are I , supported. For graphics modes which require 32K bytes the low-order bit is a don't care I I • Processor Page 0-2 These bits select the 16K byte memory-page region where memory cycles to B8000 are redirected. If there is no expansion RAM installed in the system, the high-order bit is a I don't care I and only 4 pages are supported. Video Subsystem 2-79 Video Adr Mode 0-1 These bits control whether the row scan addresses are used as part of the memory address. These should be programmed as follows: Video Address Mode 1 (Bit 7) o (Bit 6) Resulting Modes 0 0 All Alpha Modes 0 I Low-Resolution-Graphics Modes 1 1 High-Resolution-Graphics Modes I 0 Unused, Reserved CRT/Processor Page Register (Part 2 of 2) The following I/O devices are defined on the video color / graphics subsystem: Hex Function of Address A9A8A7A6A5A4A3A2AIAO Register 30A I I I I 0 I I 0 I 0 Gate Array Address and Status Register 30B I 1 I I 0 I I 0 I I Clear Light Pen Latch 30C I 1 I 1 0 I I I 0 0 Preset Light Pen Latch 300,304 1 1 1 I 0 I 0 x x 0 6845 Index Register 301,305 I I I 1 0 1 0 x x 1 6845 Data Register 30F I 1 1 I 0 1 1 I I 1 CRT, Processor Page Register x = "don't care" condition Video I/O Devices 2-80 Video Subsystem Mode Selection Summary Four registers of the Video Gate Array allow the user to access all the alphanumeric and graphics modes supported by the system ROM BIOS. The following table summarizes the modes and their register settings: Video Gate Array Reg. Mode 00 01 02 03 40 by 25 Alphanumeric Black-and-White OC OF 00 02 40 by 25 Alphanumeric Color 08 OF 00 02 80 by 25 Alphanumeric Black-and-White OD OF 00 02 80 by 25 Alphanumeric Color 09 OF 00 02 160 by 200 16-Color Graphics 1A OF 00 00 320 by 200 4-Color Graphics OA 03 00 00 320 by 200 4-Shade Black-and-White OE 03 00 00 320 by 200 16-Color Graphics IB OF 00 00 640 by 200 2-Color Graphics OE 01 00 08 640 by 200 4-Color Graphics OB 03 00 00 Note: All values are given in hexadecimal. Mode Summary Sequence of Events for Changing Modes 1. Determine the mode of operation. 2. Reset the 'video enable' bit in the Video Gate Array to disable video. 3. Program the 6845 CRT Controller to select the mode. Read 256 bytes of memory Reset gate array 4. Program the Video Gate Array registers. Video Subsystem 2-81 Remove gate-array reset Read 256 bytes of memory 5. Re-enable video. Note: The gate array needs to be reset only when changing the high-bandwidth/low-bandwidth register. Interrupt Information The Video Gate Array uses interrupt level 5 of the Intel 8259 to provide the vertical retrace interrupt to the system. At Standard TTL Levels -VERT SYNC A1 B1 +VERT SYNC LOGIC GND LOGIC GND -HORIZ SYNC A3 B3 +HORIZ SYNC BLUE RESERVED RED LOGIC GND INTEN A6 B6 RESERVED GREEN RESERVED COMP SYNC RESERVED AUDIO A9 B9 SHIELD GND Connector Specifications The direct-drive signals are standard TTL levels except the audio output which is a IV peak-to-peak signal biased at OV which can drive a 10K ohm or greater input-impedence. 2-82 Video Subsystem Composite Video Signal Video Color/Graphics Monitor Chassis Ground Composite Jack ~------------------2 Connector Specifications The composite-video signal is IV peak to peak biased at .7V with a 75 ohm load. Connector 1----- A01 - +12 V RF 1-___ A02 - Key for 1----- A03 - Com posite Video _ Modulator 1---- 801 - GND / - - - - 802 - Aud io • Television 1 - - - 803 - ShieIdGND • Television Connector Specifications The Connector for Television connector has the composite-video signal at 1V peak to peak biased at .7V with a 75 ohm load. The connector also has the audio output which is 1V peak-to-peak signal biased at OV which can drive a 10K ohm or greater input impedence. Video Subsystem 2-83 Notes: 2-84 Video Subsystem Beeper The system beeper is a small, piezoelectric- speaker, which can be driven from one or both of two sources. The two sources are: • The 8255A-5 PPI output-bit PB1 • A timer clock out of an 8253-5 timer which has a 1.19 MHz-clock input. The timer gate is also controlled by an 8255-5 outport bit PBO. Note: The TI76496 Sound Generator cannot be directed through the beeper. AND 8255A-5 Bit PB1 .110 Address Hex 61 Timer Clock Out 2 '"" Drive Select I-- 8255A-5 Bit PB4 30 Ohm Resistor Beeper Beeper Block Diagram Beeper 2-85 Notes: 2-86 Beeper Sound Subsystem The nucleus of the sound subsystem is an analog multiplexer (mpx) which allows 1 of 4 different sound sources to be selected, amplified, and sent to the audio outputs. The mpx and amplifier are configured so the amplifier's gain is unique to and consistent with each sound source. This provides a consistent level of output with any of the sound sources. The output of the amplifier is supplied to the IBM Connector for Television interface and external-amplifier interface. If an external speaker is used, an external amplifier must be used to drive it. The amplifier is configured as a single-pole low pass filter with a 3 dB cut-off frequency of 4.8 kHz. This filter is used to "round" off the corners of the square-wave signals. BIOS Power-on will initialize the sound subsystem to use the 8253 programmable-timer mode. 1 Audio System External Unit 2 GND Amp Connector Specifications The audio output is a IV peak-to-peak signal biased at OV. It can drive a 10k ohm or greater input-impedence. Sound Subsystem 2-87 Port Bits Source PB6 PBS Complex Sound Generator (TI 76496) 1 1 Programmable Timer (8253) 0 0 Cassette Audio 0 1 I/O Channel Audio 1 0 Port bits PB5 and PB6, of the 8255, control which source is selected. Sound Sources Complex Sound Generator The Complex Sound Generator chip (SN76496N) has 3 programmable frequencies which may be mixed to form chords and a white noise generator which may also be mixed for special effects. Each of the 3 channels as well as the white noise generator can be independently attenuated. The processor controls the sound chip by writing to port hex CO. The Sound Generator is described in greater detail later in this section. More information can be obtained by referring to Texas Instruments' data sheets and application notes. 2-88 Sound Subsystem Sound Mpx PB5 Select PB6 (8255) l Analog 8253 Cassette r Protection Diodes f-+ Mpx I- Low Pass Direct Drive ~ Monitor Audio R.F. Modulator Audio Filter External f3dB = ~ External Audio Channel 4.8 kHz Amp T.I. 76496 Sound Block Diagram Audio Tone Generator Features • 3 Programmable Tone-Generators • Programmable White Noise • Programmable Attenuation • Simultaneous Sounds • TTL Compatible • 3.579 MHz Clock Input • Audio Mixer Processor to Sound-Generator Interface The system microprocessor communicates with the SN76496N through the 8 data lines and 3 control lines Sound Subsystem 2-89 (WE, CE and READY). Each tone generator requires 10 bits of information to select the frequency and 4 bits of information to select the attenuation. A frequency update requires a double-byte transfer, while an attenuator update requires a single-byte transfer. If no other control registers on the chip are accessed, a tone generator may be rapidly updated by initially sending both types of frequency and register data, followed by just the second byte of data for succeeding values. The register address is latched on the chip, so the data will continue going into the same register. This allows the 6 most-significant bits to be quickly modified for frequency sweeps. Control Registers The sound generator has 8 internal registers which are used to control the 3 tone generators and the noise source. During all data transfers to the sound generator, the first byte contains a 3-bit field which determines the destination control register. The register address codes are as follows: 2-90 Sound Subsystem Register Address Field MSB LSB RO Rl R2 Destination Control Register 0 0 0 Tone 1 Frequency 0 0 1 Tone 1 Attenuation 0 1 0 Tone 2 Frequency 0 1 1 Tone 2 Attenuation } 0 0 Tone 3 Frequency } 0 } Tone 3 Attenuation } 1 0 Noise Control 1 } } Noise Attenuation Register Address Field Reg. Addr. Low Data High Data 1 RO R1 R2 F6 F7 Fa F9 0 X FO F1 F2 F3 F4 F5 I I ~ I I I I I I I I Bit First Byte Bit Bit Second Byte Bit 0 7 0 7 MSB LSB MSB LSB Frequency (Double or Single Byte Transfer) Frequency Generation Each tone generator consists of a frequency-synthesis section and an attenuation section. The frequency- synthesis section requires 10 bits of information (hex FO-F9) to define half the period of the desired frequency (n). Hex FO is the most-significant bit and hex F9 is the least-significant bit. This information is Sound Subsystem 2-91 loaded into a to-stage tone-counter, which is decremented at an N /16 rate where N is the input-clock frequency. When the tone counter decrements to 0, a borrow signal is produced. This borrow signal toggles the frequency flip-flop and also reloads the tone counter. Thus, the period of the desired frequency is twice the value of the period register. The frequency can be calculated by the following: f = N 3in where N ref clock in Hz (3.579 MHz) n = lO-bit binary-number Attenuator Reg. Addr. Data 1 RO I Rl I R2 AO 1 A l l A2 I A3 Bit 0 Second Bit 7 MSB Byte LSB Update Attenuation (Single Byte Transfer) The output of the frequency flip-flop feeds into a four-stage attenuator. The attenuator values, along with their bit position in the data word, are shown in the following figure. Multiple-attenuation control-bits may be true simultaneously. Thus, the maximum I I theoretical attenuation is 28 dB typically. 2-92 Sound Subsystem Bit Position MSB LSB AO At A2 A3 Weight 0 0 0 1 2dB 0 0 1 0 4dB 0 1 0 0 8dB 1 0 0 0 16db 1 1 1 1 OFF Attenuator Values Noise Generator Reg. Addr. RO R1 R2 SHIFT 1 1 I 1 I 0 X FB NFO I NF1 MSB LSB Update Noise Source (Single Byte Transfer) The noise generator consists of a noise source and an attenuator. The noise source is a shift register with an exclusive-OR feedback-network. The feedback network has provisions to protect the shift register from being locked in the zero state. Sound Subsystem 2-93 FB Configuration 0 Periodic Noise 1 White Noise Noise Feedback Control Whenever the noise-control register is changed, the shift register is cleared. The shift register will shift at one of four rates as determined by the two NF bits. The fixed 'shift-rates are derived from the input clock. Bits NFO NFl Shift Rate 0 0 N/512 0 1 N/1024 1 0 N/2048 1 1 T one Generator #3 Output Noise Generator Frequency Control The output of the noise source is connected to a programmable attenuator. Audio Mixer/Output Buffer The mixer is a conventional operational-amplifier summing-circuit. It will sum the three tone-generator 2-94 Sound Subsystem outputs, and the noise-generator output. The output buffer will generate up to 10 rnA. Data Transfer The sound generator requires approximately 32 clock cycles to load the data into the register. The open collector READY output is used to synchronize the microprocessor to this transfer and is pulled to the false state (low voltage) immediately following the leading edge of CEo It is released to go to the true state (external pull-up) when the data transfer is completed. This will insert approximately 42 wait states (8.9 f.Ls) for each data transfer. Warning: Do not attempt to issue an I/O read operation to the TI76496 port (COH). Such an operation will cause the system to hang indefinitely. Note: If DMA is added to the system on the I/O channel, I/O WRITES to the 76496 will increase the latency time. Sound Subsystem 2-95 Notes: 2-96 Sound Subsystem Infra-Red Link The infra-red link provides cordless communications between the keyboard and the system unit. Two infra-red-emitting diodes, mounted in the keyboard, transmit coded information to the system unit. The keyboard transmitter is fully discussed in "Cordless Keyboard" in this section. The infra-red receiver, which is located in the system unit, has an infra-red-sensitive device that demodulates the signal transmitted from the keyboard and sends it to the system. Infra-Red Receiver The receiver card measures 57.15 mm wide by 63 mm (2.25 in. by 2.50 in.) long. The infra-red receiver is mounted on the system board, component-side down, with two snap-in-type standoffs. Signal output and power input is through an 8-pin connector, located at the rear of the infra-red receiver. The infra-red-sensitive device is located on the front of the board and receives its input through an opening in the front of the system unit's cover. There is also an infra-red transmitter mounted on the receiver board for diagnostic purposes. Functional Description The following figure is the Infra-Red Receiver Block Diagram. During keyboard operation, the emitted light is modulated, transmitted, and received in the following sequence: 1. A key is pushed. Infra-Red Link 2-97 2. The data stream is sent using the infra-red-emitting diodes. 3. The receiver amplifies and processes the signal. 4. The demodulated signal is sent to the system board. The signal received consists of an infra-red-light transmission modulated at 40 kHz. An input is available (I/R Test Frequency) to the system for receiver-circuit-operational verification. Infra-Red Receiver Board Keyboard A?' First Amplifier Second Amplifier Demod- with Encoder Infra- Red Stage r-- Stage r- ulator ~I- Out ~ Photo-Diode with AGC J Infra- Ry Test Circuit Infra-Red Test Frequency From System Board Infra-Red Receiver Block Diagram Application Notes The Infra-Red Receiver Board can serve as a general-purpose infra-red-receiver, however, the 2-98 Infra-Red Link demodulator timings are tailored to the needs of the system. Programming Considerations The serially-encoded word is software de-serialized by the 8088 processor on the system unit. The leading edge of the start bit will generate a non-maskable interrupt (NMI). Once the processor enters the NMI routine to handle the deserialization, the keyboard-data line is sampled and the processor waits to sample the trailing edge of the start bit. When the trailing edge of the start bit is sampled, the processor will wait for 310 JLS and sample the first half of the first data bit. This delay causes the processor to sample in the nominal center of the first half of the first data bit. The processor then samples the keyboard data every half- bit cell-time. The sampling interval is 220 JLS. The processor samples eacrr:half-bit-sample 5 times and will determine the logical level of the sample by majority rule. This enables the processor to discriminate against transient glitches and to filter out noise. The 8088 processor utilizes one 8255 PPI bit (PORT C BIT 6) and shares one 8253 timer channel (CHANNEL 1) to do the software de-serializationwf the keyboard data. See the "Cordless Keyboard" in this section for more information on the data-transmission proto cal. Detectable Error Conditions Errors Cause Phase Errors The 1st half of the bit-cell sample is not equal to the inverse of the 2nd half of the bit-cell sample. Parity Errors The received encoded word did not maintain odd parity. Infra-Red Link 2-99 Note: Errors will be signaled by the processor with a short tone from the audio alarm or external speaker. Operational Parameters The operational distance from infra-red devices to the system should not exceed 6.1 meters (20 feet) (line-of-sight). Operational efficiency can be impaired by outside sources. These sources are, excessively-bright lights, and high-voltage lines, which include some TV sets. High-energy sources will generally cause an audible alarm within the system unit. These sources may downgrade the operational distance from the keyboard to the system. A keyboard cable is recommended if the above interference conditions are not controllable. Pin Signal Input/Output AOI +12 Volts Input A02 Ground Input A03 Ground-Shield Input A04 I.R. TEST FREQ. Input BOI GROUND Input B02 +5 Volts Input B03 -I.R. KBD DATA Output B04 GROUND Input Infra-Red Connector Specifications 2-100 Infra-Red Link IBM PCjr Cordless Keyboard The keyboard is a low-profile, 62-key, detached keyboard with full-travel keys. The keys are arranged in a standard typewriter layout with the addition of a function key and cursor-control keys. The keybuttons are unmarked; however, an overlay is used to provide the keys' functional descriptions. The following figure shows the layout of the cordless keyboard. The keyboard is battery powered and communicates to the system unit with an infra-red (rR) link. The infra-red link makes the remote keyboard a truly portable hand-held device. An optional-cord connection to the system unit is available. Power is sent to the keyboard and serially-encoded data received by the system unit through the optional cord. When connected, the cord's keyboard-connector removes the battery power and the -CABLE CONNECT signal disables the infra-red-receiver circuit. The disabling of the circuit also allows other infrared devices to be used Cordless Keyboard 2-101 without interfering with the system. The data which is received through the IR link or by the cord, have the same format. The keyboard interface is designed to maximize system-software flexibility in defining keyboard operations such as shift states of keys, and typematic operation. This is accomplished by having the keyboard return scan codes rather than American National Standard Code for Information Interchange (ASCII) codes. The scan codes are compatible with Personal Computer and Personal Computer XT scan codes at the BIOS interface level. All of the keys are typematic and generate both a make and a break scan- code. For example, key 1 produces scan code hex 01 on make and code hex 81 on break. Break codes are formed by adding hex 80 to the make codes. The keyboard 110 driver can define keyboard keys as shift keys or typematic, as required by the application. The microprocessor in the keyboard performs keyboard scanning, phantom-key detection, key debounce, buffering of up to 16 key-scan-codes, and transfer of serially-encoded data to the system unit. The keyboard microprocessor is normally in a standby power-down mode until a key is pressed. This causes the microprocessor to scan the keyboard. The microprocessor then transmits the scan code, and re-enters the power-down mode if its buffer is empty and no keys are pressed. The keyboard electronics is designed with low-power CMOS integrated-circuitry for battery power operation. Four AA-size batteries are required. Because the keyboard is normally in the standby power-down mode, which uses very little power, no onloff switch is needed. 2-102 Cordless Keyboard Unlike other keyboards in the IBM Personal Computer family, the IBM PCjr Cordless Keyboard has phantom-key detection. Phantom-key detection occurs when invalid combinations of three or more keys are pressed simultaneously, causing a hex 55 scan-code to be sent to the keyboard's processor. The phantom-key scan-code instructs the keyboard's processor to ignore all of the keys that were pressed at that time. BIOS ignores the resulting scan-code that is sent to it. The keyboard-cord connector provides a battery- disconnect function and also disables the infra-red- transmission circuitry when the mating plug for the modular jack is connected. Note: See "Keyboard Encoding and Usage" in Section 5, for scan codes and further information. Transmitter Serially encoded words are transmitted to the system unit using the Infra-Red Link or the cable link. Encoded words are sent to the system unit with odd parity. Both the Infra-Red Link and the cable link use biphase serial-encoding and each is a simplex link. The 80C48 microprocessor does the biphase serial encoding with a bit cell of 440 f.Ls. A biphase logically-encoded 1 is transmitted as logical 1 for the first half of the bit cell time and as a logical 0 for the second half of the bit cell. A biphase logically-encoded o is transmitted as a logical 0 for the first half of the bit cell time and as a logical 1 for the second half of the bit cell. Each logical 1 transmission for the Infra-Red Link consists of a 40 kHz carrier burst at a 50% duty cycle. Cordless Keyboard 2-103 First Bit Start Bit Second Bit Data Bit 0 (Least Significant Bit) Third Bit Data Bit 1 Fourth Bit Data Bit 2 Fifth Bit Data Bit 3 Sixth Bit Data Bit 4 Seventh Bit Data Bit 5 Eight Bit Data Bit 6 Ninth Bit Data Bit 7 (Most Significant Bit) Tenth Bit Parity Bit Eleventh Bit Stop Bit Data Stream Sequence Eleven stop bits are inserted after every scan-code transmission. This is to allow some processor bandwidth between keystrokes to honor other types of interrupts, such as serial and time-of-day. 2-104 Cordless Keyboard Eleven Stop I Bit Cells --~-..-r-'--r~--.-~-r~-'----------~)~)r-'--r~-' 1 S 1001011021031041051061071 pi l\ 1 S 1001011021 -I j.- Bit Cell Example: OATA = "2EH" PARITY = '" Cable Oata tu------ 1'1'1'0'1"'1'1'1'1'1'0'1'1'1'0'1'0'1'1'1 Infra-Red Oata r------- Cable 1 BI-Phase '1'1 I BI-Phase '0'1 LJ LJr--- -J22:~:r: -l 440l1s L J ~::~l1sL 440l1s I=-- Infra- Red I BI-Phase '1'1 I BI-Phase '0' 1 I 40 kHz@50% Outy Cycle------......,lI~4-0-k-Hz-@-5-00-Yo l1 j I- l-- 1 out~y =I.1 l- I1sL 220 s Cycle 62.5 ~ 62.5115 44011 5 440 115 Keyboard Transmission Timing Cordless Keyboard 2-105 -ClB Data r-- AND ,-- Keyboard Data -loR. Data """"""- 8255 PC6 AND NOR I -CBl Con Inverter r-J +5_ D Q 8255 PCO elK Flip Flop ClR "-- NMI AND NMI Mask -lOR From Port AO Hex - Keyboard Interface Logic 2-106 Cordless Keyboard Program Cartridge and Interface The Program Cartridge allows the addition of ROM to the system without removing the cover by plugging it , into either of two slots in the front of the machine. The 48 by 72 mm (2 by 3 inch) cartridge can hold one or two 32K byte by 8 ROMS (64K bytes total) of program storage. Smaller ROMS such as the 8K byte by 8 modules can be used in the cartridge. When a smaller module is used, the higher address lines are not used. To allow two smaller modules to be mapped to adjacent memory segments, each module's contents is addressed to multiple adjacent-memory segments, within the addressable range of the module's socket (32k). Program Cartridge Slots The Program Cartridge is designed to plug into either of two identical slots in the front of the machine. Each slot has 15 address signals, 8 data signals, 6 chip selects, 2 control signals, and power. Cartridge selection is accomplished by the chip selects, each of which addresses one of the high 32K memory-blocks. Each cartridge uses up to two of the six chip selects. Selection is determined on the basis of the intended use of the cartridge. This is done at the factory. Two of the chip selects are used by the internal system-ROM. These two signals can be used to allow the internal ROM to be replaced by a Program Cartridge. This allows the machine to assume a different personality from the standard machine. To use this option of mapping the internal-ROM space to a cartridge, the Base-ROM-in-Cartridge function must be inserted. This function is a factory-installed Program Cartridge 2-107 signal-jumper manufactured into particular program-cartridges that are intended to replace the system ROM. Note: When the cartridge is inserted or removed with the system turned on, the system will I reset I and go through a warm power-up. Any data in the system RAM will be lost. Cartridge Storage Allocations A. The following conventions will be followed for "Initial Program Loadable" program cartridges: Location Contents 0 055H 1 OAAH 2 Length 3,4,5 Jump to Initialize Code 6 0 Last 2 Addresses CRC Bytes Storage Conventions • Locations 0 and 1 contain the word hex 55AA. This is used as a test for the presence of the cartridge during the configuration- determination portion of the power-on routines. • Location 2 contains a length indicator representing the entire address space taken by the ROM on the cartridge. The algorithm for determining the 2-108 Program Cartridge contents of this byte is (length/512). The contents of this byte is used by the CRC (cyclic-redundancy-check) routine to determine how much ROM to check. • Location 3 contains the beginning of an initialization routine that is reached by a Long I I call during the power-on sequence. For cartridges that are I IPL-able I (BASIC or assembler program) this routine should set the INT hex 18 vector to point to their entry points. Other types of cartridges (BASIC or whatever) should merely return to the caller. Setting the INT hex 18 I I vector will enable transfer of control to the cartridge program by the IPL routine. • This location 6 should be 00. • CRC bytes: The last two locations of the address space used by the cartridge must be blank. CRC characters will be placed in these bytes when the cartridge is built. See the routine at label "CRC Check", in the BIOS listing for the CRC algorithm. B. The following conventions will be followed for cartridges that wish to be recognized by DOS 2.1 as containing code associated with DOS command words: Program Cartridge 2-109 Location Contents 0 055H I OAAH 2 Length 3-5 Jump to Initialize 6 Command Name Length (Offset Y- Offset Z) Z First Character in Command Name y Last Character in Command Name W Word Pointing to Routine that is Jumped to if "Name" is Typed X N ext Command Name Length or "00" if No More Command Names Last 2 Addresses CRC Bytes DOS Conventions • Locations 0 and I contain the word hex 55AA. This is used as a test for the presence of the cartridge during the configuration- determination portion of the power-on routines. • Location 2 contains a length indicator representing the entire address space taken by the ROM on the cartridge. The algorithm for determining the contents of this byte is (length/512). The contents of this byte is used by the CRC routine to determine how much ROM to check. • Location 3 contains a jump to the initialization I I code for this ROM. (May just be a I Far Return I ) • Starting at location 6 may be a sequence of command name pointers consisting of 1: Count of length name, 2: Name in ASCII, and 3: Word 2-11 0 Program Cartridge containing offset within this segment to the code that is entered when this name is called. There can be as many names as desired, providing that a hex 00 is placed in the count field following the last name pointer. If a cartridge has a routine called TEST at location hex OFB5 (offset from start of I I segment that the cartridge is in) that needs to be executed when I test I is entered as a DOS command the entry at location 6 would be hex 04,54,45,53,54,B5,OF. • CRC bytes: The last two locations of the address space used by the cartridge must be blank. CRC characters will be placed in these bytes when the cartridge is built. See the routine at label "CRC Check", in the BIOS listing for the CRC algorithm. C. The following conventions will be followed for cartridges that wish to be recognized by "Cartridge BASIC" as containing interpretable-BASIC Code: • The cartridge-chip selects must address hex DOOOO since the BASIC cartridge addresses hex EOOOO. When "Cartridge BASIC" is activated, it will check for a second cartridge program at hex DOOOO. If the second cartridge is present and formatted properly, then the BASIC code is loaded into RAM and run. • The format for this interpretable-BASIC code must be as follows: Program Cartridge 2-111 Location Contents 0 055H 1 OAAH 2 Length 3 OCBH 4 OAAH 5 055H 6 0 7 OFFH if unprotected Basic program or OFEH if protected Basic program 8 Start of interpretable Basic code n OFFH Padding to next 2048 byte boundary Last 2 Addresses CRC Bytes Cartridge Format 1. Locations 0 and 1 contain the word hex 55AA. This is used as a test for the presence of the cartridge during the configuration-deterrnination portion of the power-on routines. 2. Location 2 contains a length indicator representing the entire address space taken by the ROM on the cartridge. The algorithm for determining the contents of this byte is (length/512). The contents of this byte is used by the CRC routine to determine how much ROM to check. 3. Location 3 must be hex OCB for a I far return I instruction. 2-112 Program Cartridge 4. Locations 4 and 5 contain the word hex AA55. This is used as a test for the presence of the second cartridge by "Cartridge Basic". 5. Location 6 must be a 0 to follow the DOS conventions. 6. Location 7 can be either hex FF to indicate an unprotected BASIC program, or hex FE to indicate a protected program. 7. Location 8 must be the start of the BASIC program. It must be interpretable Basic and not compiled. Also, at the end of the program PAD to the next 2048 byte boundary with hex OFF. 8. eRC bytes: The last two locations of the address space used by the cartridge must be blank. CRC characters will be placed in these bytes when the cartridge is built. See the routine at label "CRC Check", in the BIOS listing for the CRC algorithm. Program Cartridge 2-113 ROM Module The ROM modules used are 250 ns devices. Typical modules are the Mostek MK37000 and MK38000, the TMM 23256, the SY23128, and other compatible devices. ROM Hex Chip Select Address Space Typical Use CSO X Not Used CSI X Not Used CS2 DOOOO-D7FFF Optional Cartridge ROM #2 CS3 D8000-DFFFF Optional Cartridge ROM #1 CS4 EOOOO-E7FFF Standard Cartridge ROM #2 CS5 E8000-EFFFF Standard Cartridge ROM #1 CS6 FOOOO-F7FFF System Board ROM #2 CS7 F8000-FFFFF System Board ROM #1 ROM Chip Select Table Signal 1/0 Description AO - A14 o Processor Address lines AO - A14 DO-D7 I Processor Data lines 2-114 Program Cartridge -CS2 0 These chip-select lines are used to THRU select ROM modules at different -CS7 addresses. The addresses for each chip-select are shown in the ROM-chip select-table. -CS6 and -CS7 are used on the system board for BIOS, Power-On-Self-Test (POST) and cassette-basic ROMs. In order to use these chip selects on a cartridge, -BASE 1 ROM IN CARTRIDGE or -BASE 2 ROM IN CARTRIDGE must be pulled 'low' -BASE I I This line when pulled 'low' instructs ROM IN the system board to de-gate the ROM CARTRIDGE module from hex F8000 - FFFFF on the system board. This ROM module can then be replaced by a ROM module on the cartridge by using -CS7. -BASE 2 ROM I This line when pulled 'low' instructs IN the system board to de-gate the ROM CARTRIDGE module from hex FOOOO - F7FFF on the system board. This ROM module can then be replaced by a ROM module on the cartridge by using -CS6. Program Cartridge 2-115 Cartridge Reset I This input when low causes a reset I I I I Tab to the system. The system will remain I reset until this line is brought back I I high I . This tab is usually wired with an L shaped land pattern to the GND at A02 which provides a momentary I reset when a cartridge is inserted or I removed. 2-116 Program Cartridge • • • • • A1 A2 A3 A4 A5 • • • • • A18 Top of Cartridge Momentary Reset Land GND 801 A01 GND -CS7 CARTRIDGE RESET TAB -CS3 -CS5 A14 -BASE 1 ROM IN CARTRIDGE A12 B05 A05 A13 A7 A8 A6 A9 A5 A11 A4 -BASE 2 ROM IN CARTRIDGE A3 B10 A10 A10 A2 D7 A1 D6 AD D5 DO D4 D1 B15 A15 D3 D2 -CS2 -CS6 -CS4 +5V B18 A18 +5V Connector Specification Program Cartridge 2-117 System ROM 2 81 Opposite 818 Address Side FOOOO A1 ROM Cartridge Address E8000 Address EOOOO Cartridge ROM Locations 2-118 Program Cartridge Games Interface Interface Description The Game Interface has two connectors located at the rear of the System unit for four paddles (two per connector) or two joysticks. Each connector has four input lines: two digital inputs and two resistive inputs. All the inputs are read with one IN from address I I I I hex 201. The interface, 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 or joystick position can be determined. The four digital inputs each have a lK ohm resistor to pull the voltage up to +5V. With no drive on these inputs, a 1 is read. For a 0 reading, the inputs must be pulled to ground. The four resistive inputs are converted to a digital pulse with a duration proportional to the resistive load, according to the following equation: Time = 24.2 MS + 0.011 (r) MS Where r is the resistance in ohms Games Interface 2-119 From Right 2 Resistive Inputs Joystick From Left Convert 2 Resistive Inputs Joystick Resistance to Digital 1/0 Pulse Write I Games ~ AND I CS - 1/0 ~ AND II Data Bus Bufferl Reads Driver Data Bus 0-7 2 Button Inputs From Right Joystick I 2 Button Inputs From Left Joystick Games Interface Block Diagram Any program application must first begin the conversion by an 'OUT' to address hex 201. An 'IN' from address hex 201 will show the digital pulse go , high' and remain 'high' for the duration according to the resistance value. All four bits (Bit 3 through Bit 0) function in the same manner. Each bits digital pulse goes high simultaneously and resets independently according to the input resistance value. 2-120 Games Interface Input from Address Hex 201 Digital Inputs Resistive Inputs Input From Address Hex 201 Joysticks typically have one or two buttons and two variable resistances each. The variable resistances are mechanically linked to have a range from 0 to lOOk ohms. One variable resistance indicates the X coordinate and the other variable resistance indicates the Y coordinate. The joysticks are attached to give the following input data: Joystick B Joystick A Joystick B Joystick A Button Button Button Button Coord. Coord. Coord. Coord. #2 #1 #2 #1 Y X Y X Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Joystick Input Data Games Interface 2-121 The game paddles have one button each and one variable resistance each. The variable resistance is mechanically linked to have a range from 0 to lOOk ohms. The paddles are attached to give the following input data. Buttons Coordinates Paddle Paddle Paddle Paddle Paddle Paddle Paddle Paddle 0 C B A 0 C B A Bit 7 Bit 6 BitS Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Paddle Input Data Pushbuttons The pushbutton inputs are 'read' by an 'IN' from address hex 201. These values are seen on data bits 7 through 4. These buttons default to an 'open' state and are 'read' as 1. When a button is pressed, it is 'read' as O. Note: 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 o to lOOk 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 simultaneously by an 'OUT' to address hex 201. All four one-shot outputs 2-122 Games Interface will go I true I after the fire pulse and will remain Ihigh I for varying times depending on where each potentiometer is set. These four one-shot outputs are I read I by an I IN I from address hex 201 and are seen on data bits 3 through o. Signal N.ame Pin Number Keyplug A01 LOGIC GND A02 V·AXIS RESISTANCE A03 +5V A04 System Joystick Bo.ard SHIELD GND 801 X-AXIS RESISTANCE 802 SWITCH 803 SWITCH 804 Connector Specification Games Interface 2-123 Notes: 2-124 Games Interface Serial Port (RS232) The PCjr serial port 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 4800 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, line status and data-set interrupts. Diagnostic capabilities provide loopback functions of transmit/ receive and input/output signals. The nucleus of the adapter is a 8250A LSI chip or functional equivalent. Features in addition to those previously listed are: • Full double-buffering eliminates the need for precise synchronization • Independent receiver clock input • Modem control functions: clear to send (CTS), request to send (RTS), data set ready (DSR), data terminal ready (DTR) • Even, odd, or no-parity-bit generation and detection • False start bit detection • Complete status reporting capabilities • Line-break generation and detection • Break, parity, overrun, and framing error simulation • Full prioritized interrupt system controls All communications protocol is a function of the system ROM and must be loaded before the adapter is operational. All pacing of the interface and control- signal status must be handled by the system software. It should be noted that Asynchronous (Async) receive operations cannot overlap diskette operation since all but the Diskette Interrupt are masked off I I during diskette operations. If Async receive Serial Port 2-125 operations are going to be overlapped with keyboard receive operations, the Async Receiver rate cannot exceed 1200 baud. This is due to the processor deserialization of the keyboard. See mM PCjr Cordless Keyboard in this section for more information. Programming Note: Due to the read/write cycle-time of the 8250A, it is recommended that back-to-back I/O operations to the 8250A be avoided. A good Programming Technique would be to insert a short Ijump between every consecutive 8250 I/O I instruction. This action will flush the queue and provide 15 clock periods between I/O operations. Note: This note only applies to programmers using the 8250A directly. It is STRONGLY suggested that the user not communicate directly with the physical hardware, but use the system BIOS instead. Note: It is important to note that when the mM PCjr has the Internal Modem installed it is logically COMI and the RS232 serial port is logically COM2 in BIOS, DOS, and BASIC. Without the Internal Modem installed the RS232 serial port is logically addressed as COMl in BIOS, DOS ,and BASIC even though its address is still hex 2F8 using Interrupt level 3. The following figure is a Serial Port Block Diagram: 2-126 Serial Port Address AO Through A2 AO Through A2 Data Bus DO Through D7 Interrupt Baud Clock 8250A 1.7895 Asynchronous MHz Communications Element Control Signals EIA EIA Receivers Drivers I 16-Pin 1 I Connector J Serial Port Block Diagram Serial Port 2-127 Modes of Operation The different modes of operation are selected by programming the 8250A asynchronous communications element. This is done by selecting the I/O address (hex 2F8 to 2FF) and I writing I data out to the card. Address bits AO, At, and A2 select the different registers that 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 (in Hex) Register Selected DI.. AB State 2F8 TX Buffer DLAB=O (Write) 2F8 RX Buffer DLAB=O (Read) 2F8 Divisor Latch LSB DLAB=l 2F9 Divisor Latch MSB DLAB=l 2F9 Interrupt Enable Register DLAB=O 2FA Interrupt Identification (Don't Care) Registers 2FB Line Control Register (Don't Care) 2FC Modem Control Register (Don't Care) 2FD Line Status Register (Don't Care) 2FE Modem Status Register (Don't Care) 2FF Scratch Register (Don't Care) 1/0 Decodes Address Range hex 2F8 - 2FF Note: 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 8250A registers. The DLAB must be set I high I by the system software to access the baud-rate-generator divisor latches. 2-128 Serial Port Interrupts One interrupt line is provided to the system. This interrupt is IRQ3 and is positive active To allow the I I. serial port to send interrupts to the system, bit 3 of the modem control register must be set to 1 high At I I. this point, any of the following interrupt types I enabled I by bits in the interrupt-enable register will cause an interrupt: Receiver-line status, Received Data available, Transmitter-Holding-Register empty, or Modem Status. Interface Description The communications adapter provides an EIA RS-232C electrically-compatible interface. One 2 by 8-pin Berg connector is provided to attach to various peripheral devices. The voltage interface is a serial interface. It supports data and control signals as follows: PinA04 Transmit Data PinA08 Receive Data PinA03 Request to Send PinA07 Clear to Send Pin A06 Data Set Ready Pin B02-B08 Signal Ground Pin A05 Carrier Detect PinA02 Data Terminal Ready Pin BOl Shield Ground The adapter converts these signals to/from TTL levels to EIA voltage levels. These signals are sampled or generated by the communications-control chip. These Serial Port 2-129 signals can then be sensed by the system software to determine the state of the interface or peripheral device. Note: The above nomenclature describes the communications adapter as a DTE (Data Terminal Equipment) device. Suitable adapters must be used to attach other devices such as serial printers. Note: Ring Indicate is not supported on the PCjr. Voltage Interchange Information Interface Interchange Binary Signal Control Voltage State Condition Function Positive Voltage = Binary (0) =Spacing =On Negative Voltage = Binary (1) =Marking =Off Voltage Interchange Information Invalid Levels +15 Vdc On Function +3 Vdc o Vdc Invalid Levels -3 Vdc Off Function -15 Vdc Invalid Levels The signal will be considered in the I marking I condition when the voltage on the interchange circuit, measured at the interface point, is more negative than 2-130 Serial Port -3 Vdc with respect to signal ground. The signal will be considered in the Ispacing I condition when the voltage is more positive than + 3 V dc with respect to signal ground. The region between +3 Vdc and -3 Vdc is defined as the transition region, and considered an invalid level. The voltage which is more negative than -15 Vdc or more positive than + 15 V dc will also be considered an invalid level. During the transmission of data, the Imarking I condition will be used to denote the binary state 1, and the Ispacing I condition will be used to denote the binary state O. For interface control circuits, the function is Ion I when the voltage is more positive than +3 Vdc with respect to signal ground and is Ioff I when the voltage is more negative than -3 Vdc with respect to signal ground. For detailed information regarding the INS8250A Communications Controller, refer to "Bibliography" . Output Signals Output 1 (OUT 1), Pin 34: Output 1 of the 8250A is not supported in PCjr hardware. Output 2 (OUT 2), Pin 31: Output 2 of the 8250A is not supported in PCjr hardware. Accessible Registers The INS8250A has a number of accessible registers. The system programmer may access or control any of Serial Port 2-131 the INS8250A registers through the processor. These registers are used to control INS8250A operations and to transmit and receive data. For further information regarding accessible registers, refer to "Bibliography" . INS82S0A Programmable Baud Rate Generator The INS8250A contains a programmable baud rate generator that is capable of taking the clock input (1.7895 MHz) and dividing it by any divisor from 1 to (65535). The output frequency of the Baud Rate Generator is 16 x the baud rate [divisor number = (frequency input) I (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. The following figure illustrates the use of the baud rate generator with a frequency of 1.7895 MHz. For baud rates of 4800 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 4800 baud. 2-132 Serial Port Desired Divisor Used to Percent Error Per Bit Baud Generate 16x Clock Difference Between Rate (Decimal) (Hex) Desired and Actual 50 2237 8BO .006 75 1491 503 .017 110 1017 lAI .023 134.5 832 167 .054 150 746 12C .050 300 373 175 .050 600 186 BA .218 1200 93 50 .218 1800 62 3E .218 2000 56 38 .140 2400 47 2F .855 3600 31 IF .218 4800 23 17 1.291 Baud Rate at 1 .7895 MHz Note: These divisions are different than that used in the IBM Personal Computer. For portability, all initialization should be done through the system BIOS. Note: Receive rates should not exceed 1200 baud if the receive operation is overlapped with keyboard keystrokes. The following Assembly language sample program initializes the 8250. The baud rate is set to 1200 baud. It's data word is defined: 8 bits long with 1 stop bit odd parity. Serial Port 2-133 BEGIN PROC NEAR MOV AL,SOH SET DLAB = 1 MOV DX,2FBH To Line Control Register OUT DX,AL JMP $+2 110 DELAY MOV DX,2FSH Point to LSB of Divisor Latch MOV AL,5DH This is LSB of Divisor OUT DX,AL JMP $+2 I/O DELAY MOV DX,2F9H Point to MSB of Divisor Latch MOV AL,O This is MSB of Divisor OUT DX,AL JMP $+2 I/O DELAY MOV DX,2FBH Line Control Register MOV AL,OBH S Bits/Word, 1 Stop Bit, Odd Parity, DLAB = 0 OUT DX,AL JMP $+2 I/O DELAY MOV DX,2FSH IN AL,DX In Case Writing to Port LCR Caused Data Ready to go high ENDP BEGIN Assembly Language Sample Program UNUSED A1 B1 SHIELD GND DTR LOGIC GND RTS LOGIC GND TRANSMIT DATA A4 B4 LOGIC GND CARRIER DETECT LOGIC GND DSR LOGIC GND CTS LOGIC GND RECEIVE DATA AS BS LOGIC GND Connector Specifications 2-134 Serial Port System Power Supply The system power supply is a 33 Watt, three voltage-level, two-stage supply. The first stage is an external power transformer that provides a single-fuse protected, extra low, ac-voltage output. The power cord is 3.08 meters (10.16 feet) long. The second stage is an internal, printed-circuit board, which is vertically mounted into the system board. The second stage converts the transformer's ac-output into three dc-output levels. The amount of power available on the I/O connector for a machine that is fully configured with internal features is 400 rnA of +5 Vdc, 0 rnA of +12 Vdc and 0 rnA of -6 Vdc. Power is supplied to the system board through a printed-circuit-board edge-connector. The diskette drive is powered through a separate four-pin connector mounted on the front edge of the Power Board. The power for the diskette drive fan is provided by a three-pin Berg-type connector mounted directly below the diskette-drive connector. Power is removed from the system board and diskette drive by a switch mounted on the rear of the Power Board. Both the switch and the transformer connector are accessible from the rear of the system. Power Supply 2-135 Operating Characteristics Power Supply Input Requirements Voltage (Vac) Frequency Current (Amps) Nominal Minimum Maximum ±.5 Hz Maximum 120 104 127 60 Hz .65 at 104 Vac Voltage ae D.C Outputs Vdc Regulation Voltage Current (Amps) Tolerance Nominal Minimum Maximum ±% +5 *1.5 3.6 5 +12 .04 1.2 5 6 0.0 .025 16 Voltage de * There must be a minimum of a 1.5 Amp load on the +5 Vdc output for the -6 Vdc to be present. 2-136 Power Supply Over-Voltage/ Over-Current Protection Input (Transformer) The following table describes the transformer input protection: Voltage (Nominal) Type Protection Rating (Amps) 120 Vac Non-resettable Fuse 5A Slo Blow Thermal/ Over-Current Input Protection Output (Power Board) The following table describes the Power Board's output protection: Protection Condition Output Voltages Over-Voltage Over-Current +5 Vdc *6.3 ±.7 Vdc **3.9 ± .25 Amps 12 Vdc *14.4 ± 1.4 Vdc 2.2 ±.9 Amps * Over-Voltage protection is provided by fuse FI. **Resettable by removing the fault condition and removing power for at least 5 seconds and then applying power. Output Protection Power Supply 2-137 Power Board (Component Side) o :0 1 ~ m 2 Supply to o ~~ 33 4 Diskette Drive 1 2 Fan Plug Input From 1 Transformer ~ L---r-_......-J Grounding Pin '~_~:L~L-_________-r-WL.Uu....L..LLLU Connector A 10 A1 Connector Specifications 1------+1 2 2 ------GND 3 ------GND 4 ------+5 Power 5 -----+5 System Board 6 ------+5 Board 7 ------+5 8 -----GND 9 -----GND 10 - - - - - + 1 2 Connector Specifications ' - - - 1 - - - - - 17 Vac ---~ Power 1---- 2 GND---~ Transformer Board '--- 3 17 Vac - - - - I Connector Specifications 1 +12Vdc - 1 Diskette 2 GNO 2 Power Orive 3 GNO 3 Board 4 +5Vdc 4 Connector Specifications 2-138 Power Supply Fan 1 1 - - - - - GND ----~ 1 Power 21----+12Vdc-----I 2 Board 3 GND----~ 3 Fan Connector Specifications Power Supply 2-139 Notes: 2-140 Power Supply SECTION 3. SYSTEM OPTIONS Contents IBM PCjr 64KB Memory and Display Expansion 3-5 IBM PCjr Diskette Drive Adapter ........... 3-13 Functional Description ................. 3-15 Digital Output Register .............. 3-15 WatchDog Timer ................... 3-16 Floppy Disk Controller (FDC) ........ 3-16 Programming Summary .............. 3-17 Comments ........................ 3-16 System I/O Channel Interface ........... 3-19 Drive Interface ....................... 3-22 Adapter Outputs ................... 3-22 Adapter Inputs ..................... 3-24 Voltage and Current Requirements ........ 3-24 IBM PCjr Diskette Drive 3-27 Functional Description 3-27 Diskette ................................ 3-31 IBM PCjr Internal Modem ...........•.... 3-33 Functional Description ................. 3-34 Modem Design Parameters .............. 3-37 Programming Considerations ............ 3-40 Command Format .................. 3-40 Commands ........................ 3-42 Responses ........................ 3-59 Editing/Changing Command Lines ..... 3-59 Status Conditions ..................... 3-60 Dialing and Loss of Carrier .............. 3-60 3-1 Default State ......................... 3-63 Programming Examples ................. 3-63 Modes of Operation ................... 3-68 Interrupts ........................... 3-70 Data Format ......................... 3-70 Interfaces ........................... 3-70 8250A to Modem Interface ........... 3-70 Telephone Company Interface ......... 3-74 System I/O Channel. . . . . . . . . . . . . . . .. 3-74 IBM PCjr Attachable Joystick •..•.•...•...• 3-77 Hardware Description .................. 3-77 Functional Description ................. 3-77 IBM Color Display •......••.•............ 3-81 Hardware Description .................. 3-81 Operating Characteristics ............... 3-82 IBM Connector for Television 3-85 IBM PCjr Keyboard Cord ......•.....•.... 3-87 IBM PCjr Adapter Cable for Serial Devices ... 3-89 IBM PCjr Adapter Cable for Cassette .....•.. 3-91 IBM PCjr Adapter Cable for the IBM Color Display ...••.••...............•.•...•.. 3-93 IBM PCjr Parallel Printer Attachment ........ 3-95 Description .......................... 3-96 System Interface ...................... 3-98 Programming Considerations ............ 3-99 Command Definition ................ 3-99 IBM Graphics Printer ....•.•...•......... 3-107 Printer Specifications ................. 3-107 3-2 DIP Switch Settings ........................... 3-101 Parallel Interface Description ................... 3-103 Data Transfer Sequence ..................... 3-103 Interface Signals .......................... 3-104 Printer Modes ............................... 3-106 Printer Control Codes ......................... 3-107 IBM PC Compact Printer ..................... 3-133 Printer Specifications .................. ... 3-135 Serial Interface Description ............. . .. 3-139 Print Mode Combinations for the PC Compact Printer ........................ 3-140 Printer Control Codes and Functions ....... 3-140 3-3 Notes: 3-4 IBM PCjr 64KB Memory and Display Expansion The 64KB Memory and Display Expansion option enables the user to work with the higher density video modes while increasing the system's memory size by 64K bytes to a total of 128K bytes. The memory expansion option plugs into the 44-pin memory expansion connector on the system board. Only one memory expansion is supported. The Memory Expansion Option does not require the user to reconfigure the system to recognize the additional memory. Eight 64K-by-l, 150 ns, dynamic memory modules provide 64K bytes of storage. The memory modules are Motorola's MCM6665AL15, and Texas Instrument's TMS4164-15, or equivalent. When inserted, the memory expansion option uses the ODD memory space, while the system memory is decoded as the EVEN memory. Thus, when used as video memory, the memory expansion option has the video attributes while the on-board system memory has the video characters. This arrangement provides a higher bandwidth of video characters. In addition to the eight memory modules, the expansion card has logic to do the EVEN/ODD address decoding, video data multiplexing, and a CARD PRESENT wrap. Dynamic-refresh timing and address generation are done on the system board and used by the memory expansion option. 64KB Memory Expansion 3-5 The following is a block diagram of the IDM PCjr 64KB Memory and Display Expansion. 64Kx8 RAM CPU LATCH DO-D7 Din D out MEMA O-A7 ADR CNTL r LatGh I-- CPU LA TCH T ATR LATCH ATR LATCH Latch G T -- MDO-MD7 Odd/Even Gating .. -DI SABLE E DATA RAS.C AS. -WE. -DI SABLE CASO AO.CPU DLY. -LC G VIDEO MEMR - - - - " -ATR CD IN -!- Memory Expansion Block Diagram 3-6 64KB Memory Expansion Signal I/O Description +RAS I + Row Address Strobe. This line is inverted and then becomes the -RAS for the RAM modules. +AO I Microprocessor Address O. This is used to determine whether the microprocessor access is from the system board RAM (Low) or from the expansion RAM (High). -DISABLE EDATA 0 When the expansion RAM card is in and the microprocessor is reading an ODD byte of data the expansion card tri-states the latch for EVEN data on the system board using this line. ATRLATCH I This signal indicates that the expansion RAM card should 'latch' up data from the expansion RAM into the attribute latch. MDOthruMD7 0 These data lines contain CRT information from the attribute latch and go to the Video Gate Array. DO thru D7 I/O These data lines are from the microprocessor and are bidirectional. MEM AO thru A7 I These are the multiplexed address lines for the dynamic-RAM modules. These lines are multiplexed between row address and column 64KB Memory Expansion 3-7 address, and also between microprocessor and CRT addresses. VIDEOMEMR I When this signal is , high' it indicates a MEMR is accessing the system board or expansion RAM is being accessed. This line along with AO determines if the expansion RAM microprocessor latch should 'gate' its data onto the DO thru D7 Bus. CPUDLY I This line when 'high' indicates that a microprocessor RAM cycle is occurring. It is used to gate 'off' the expansion RAM CAS or used with AO to generate the -DISABLE CAS 0 signal. -DISABLE CAS 0 0 This line is used to disable the system board CASO when a system microprocessor 'write' is occurring to the expansion RAM. This line keeps the 'write' from occurring to the system board RAM. +CAS I Column Address Strobe. This line instructs the expansion RAM to 'latch' up the address on the MEM AO thru A 7 address lines. 3-8 64KB Memory Expansion -LCG 0 This line is used to instruct the system board that attributes or ODD graphics data should be , read' from the expansion RAM card for use by the Video Gate Array. GATE I This line is 'wrapped' and becomes the -LeG output. -WE I This line instructs the memory that the cycle is a microprocessor 'write' cycle. CPU LATCH I This line instructs the expansion RAM card to 'latch' the data from the expansion RAM into the microprocessor latch. -ATRCDIN 0 This line is a wrap of the ground line on the expansion RAM card. It pulls 'down' an 8255 input so that the microprocessor can tell if this card is installed or not. 64KB Memory Expansion 3-9 The following is the connector specifications for the IBM PC}r 64KB Memory and Display Expansion. I ,I~UUU~~~~~~~~UU~~~UU~UU ~~B1 B22 System 8~",/ loppo,;" S;de ' Connector A1 A22 64KB Memory and Display Expansion 3-10 64KB Memory Expansion Connector Connector Pin Signal Name Signal Name Pin AOI +RAS VIDEO MEMR BOI A02 AO CPU DLY B02 A03 -DISABLE -DISABLE B03 EDATA CAS 0 A04 ATR LATCH +CAS B04 A05 MD4 -LCG B05 A06 MD5 GATE B06 A07 MD6 Ground B07 A08 MD7 Ground B08 A09 MOO Ground B09 AIO MDI -WE BIO All MD2 CPU LATCH BII AI2 MD3 -ATR CD IN BI2 AI3 GND GND B13 AI4 VCC VCC BI4 AI5 D7 06 BI5 AI6 05 D4 BI6 Al7 03 02 BI7 AI8 01 DO BI8 AI9 MEMA6 MEMA7 BI9 A20 MEMA4 MEMA5 B20 A21 MEMA2 MEMA3 B21 A22 MEMAO MEMAI B22 Connector Specifications 64KB Memory Expansion 3-11 Notes: 3-12 64KB Memory Expansion IBM PCjr Diskette Drive Adapter The diskette drive adapter resides in a dedicated connector on the IBM PCjr system board. It is attached to the single diskette drive through a flat, internal, 60-conductor, signal cable. The general purpose adapter is designed for a double-density, Modified Frequency Modulation (MFM)-coded, diskette drive and uses write precompensation with an analog phase-lock loop for clock and data recovery. The adapter uses the NEC JLPD765 or compatible controller, so the JLPD765 characteristics of the diskette drive can be programmed. In addition, the attachment supports the diskette drive's write-protect feature. The adapter is buffered on the I/O bus and uses the system ROM BIOS for transferring record data. An interrupt level is also used to indicate an error status condition that requires processor attention. A block diagram of the diskette drive adapter follows. Diskette Drive Adapter 3-13 ... Clock Write Write Data and Timing Circuit .... Precompensate Circuit ---{> 1 f Write Data Read Data "-- ../ r-- VCO SYNC Data ~ i- Separator STD DATA . . . r---. Data Window ...... NEC Step ~ Buffer '\r- r-./ -" Floppy Disk " - -v- Direction Write Enable Controller v- f'.... Head Select 'I - Index A Write Protect ....., -"'" Track 0 t Reset Digital Watch .- Drive A Motor On Dog ~ Control Port Timer _ Drive A Select (3 Sec) J INTR r-j 1 Diskette Drive Adapter Block Diagram Functional Description From a programming point of view, the diskette drive adapter consists of a 4-bit digital output register (DOR) in parallel with a NEC JLPD765 or equivalent floppy disk controller (FDC). Digital Output Register The digital output register (DOR) is an output-only register used to control the dri~e motor and selection. All bits are cleared by the I/O interface reset line. The bits have the following functions: i L: En.b~ 1/0 Address Hex F2 Bit 7 6 543 'I~Reserved O,;w Reserved ' - - - - - - -... Reserved '--_ _ _ _ _ _ _ _ Reserved ' - - - - -_ _ _ _--1... Watch Dog Timer Enable ' - - - - - - - - - - -...... Watch Dog Timer Trigger ' - - - - - - - - - - - - - . . - F D C Reset Note: All bits are cleared with channel reset. Digital Output Register Bit 0 This bit controls the motor and enable lines to the drive. When 'high' (1), this bit will turn 'on' the drive motor and 'enable' the drive. When 'low' (0), this bit will turn 'off' the drive motor and , disable' the drive. Bits 1-4 These bits are reserved. Diskette Drive Adapter 3-15 Bit 5 When 'high' (1), this bit 'enables' the WatchDog Timer function and interrupt. When 'low' (0), this bit' disables' the WatchDog Timer and interrupt. Bit 6 This bit controls the start of a watchdog timer cycle. Two output commands are required to operate the trigger. A 1 and then a 0 must be written in succession to 'strobe' the trigger. Bit 7 This bit is the hardware 'reset' for the floppy diskette controller chip. When 'low' (0), this bit holds the FDC in its 'reset' state. When' high' (1), this bit releases the 'reset' state on the FDC. WatchDog Timer The WatchDog Timer (WDT) is a one to three-second timer connected to interrupt request line 6 (IRQ6) of the 8259. This timer breaks the program out of data transfer loops in the event of a hardware malfunction. The WatchDog Timer starts its cycle when 'triggered.' Floppy Disk Controller (FDC) The floppy disk controller (FDC) contains two registers that can be accessed by the system microprocessor: a status register and a data register. The 8-bit main-status register contains the status information of the FDC and can be accessed at any time. The 8-bit data register consists of several registers in a stack with only one register presented to the data bus at a time. The data register stores data, commands, parameters, and provides floppy disk drive (FDD) status information. Data bytes are read from or written to the data register in order to program or obtain results after 3-16 Diskette Drive Adapter a particular command. The main status register can only be read and is used to facilitate the transfer of data between the system microprocessor and FDC. FDC Register I/O Address Data Register hexF5 Main Status Register hexF4 Programming Summary The FDC is set up with the following Parameters during system power up: Parameter Power-up Condition ~ ~ ;~ Sector Size hex 02 for 512 Byte Sectors .... Sector Count 9 ~ Head Unload hex OF - Has no effect on system operation. • Head Step Rate hex D - This gives a step rate of 6 milliseconds. Head Load Time hex 1 Minimum head load time. Format Gap hex 50 Write Gap hex 2A Non-DMA Mode hex 1 Fill byte for Format hex F6 Foe Power-up Parameters Settings Diskette Drive Adapter 3-17 The mM PCjr Diskette Drive Adapter and BIOS use and support the following FDC commands: • Specify • Recalibrate • Seek • Sense interrupt status • Sense Drive status • Read data • Write data • Format a track Note: Please refer to the Diskette section of the BIOS listing for details of how these commands are used. The following FDC hardware functions are not implemented or supported by the mM pejr Diskette Drive Adapter. • DMA data transfer • FDC interrupt • Drive polling and overlapped seek • FM data incoding • Unit select status bits 2 Heads (1 per side) 40 Cylinders (Tracks) / Side 9 Sectors/Track 512 Bytes/ Sector Modified Frequency Modulation (MFM) Diskette Format 3-18 Diskette Drive Adapter Constant Value Head Load Not Applicable Head Settle 21 Milliseconds Motor Start 500 Milliseconds Drive Constants Comments 1. Head loads when diskette is clamped. 2. Following access, wait Head Settle time before RD/WR. 3. Drive motor should be off when not in use. Wait I I Motor Start time before RD/WR. 4. All system interrupts except IRQ6 must be I disabled I during diskette data transfer in order to prevent data under-run or over-run conditions from occurring. System 110 Channel Interface All signals are TTL-compatible: Most-Positive Up-Level + 5.5 Vdc Least-Positive Up-Level + 2.7 Vdc Most-Positive Down-Level + 0.5 Vdc Least-Positive Down-Level - 0.5 Vdc The following lines are used by this adapter: +DOthru 7 (Bidirectional, Load: 174LS, Driver: 74LS 3-state) Diskette Drive Adapter 3-19 These eight lines form a bus through which all commands, status, and data are transferred. Bit 0 is the low-order bit. +AO tbm3 (Adapter Input, Load: 174LS) These four lines form an address bus by which a register is selected to receive or supply the byte transferred through lines 00-7. Bit 0 is the low-order bit. -lOW (Adapter Input, Load: 174LS) The content of lines 00-7 is stored in the register addressed by lines AO-3 at the trailing edge of this signal. -lOR (Adapter Input, Load: 174LS) The content of the register addressed by lines AO-3 is I gated I onto lines 00-7 when this line is I active. I -RESET (Adapter Input, Load: 174LS) A down level I aborts I any operation in process and I clears I the digital output register (DOR). +IRQ6 (Adapter Output, Driver: 74LS 3-state) This line is made I active I when the WatchDog timer times out. -DISKETTE CARD INSTALLED (Adapter Output, Driver: Gnd.) This line is pulled up on the I I System Board and is wired to input port bit PC2 on port hex 62 of the 3-20 Diskette Drive Adapter 8255. This line is used by the program to determine if the diskette drive adapter is installed. -Diskette CS (Adapter Input, Load: 174LS) This line is shared with the modem CS line and is 'low' whenever the microprocessor is doing lOR or lOW to either the diskette adapter or the modem. This line should be conditioned with A9 being 'low' to generate a DISKETTE CS. A9 (Adapter Input, Load: 174LS) This line is the microprocessor address line 9. When this line is 'low' and -DISKETTE CS is 'low', lOR and lOW are used by the diskette adapter. DRQO (adapter Output, Driver: NEC ILpd 765) This output would indicate to a DMA device on the external I/O Channel that the diskette controller wants to 'receive' or 'transmit' a byte of data to or from memory. DACKO (Adapter input, Load: NEC ILpd 765) This line should come from an external DMA and should indicate that a byte is being transferred from/to the Floppy Disk Controller to/from memory. Diskette Drive Adapter 3-21 Drive Interface All signals are TTL-compatible: Most Positive Up Level + 5.5 Vdc Least Positive Up Level + 2.4 Vdc Most Positive Down Level + 0.4 Vdc Least Positive Down Level - 0.5 Vdc All adapter outputs are driven by active collector gates. The drive should not provide termination networks to V cc (except Drive Select which has a 2,000 ohm resistor to V cc). Each attachment input is terminated with a 2,000 ohm resistor to V cc. Adapter Outputs -Drive Select (Driver: MC3487) This line is used to 'degate , all drivers to the adapter and receivers from the adapter (except Motor Enable) when the line is not 'active. ' -Motor Enable (Driver: 74LS04) The drive must control its spindle motor to 'start' when the line becomes 'active' and 'stop' when the line becomes 'inactive.' -Step (Driver: MC3487) The selected drive must move the read/write head one cylinder in or 3-22 Diskette Drive Adapter out as instructed by the Direction line for each pulse present on this line. -Direction (Driver: MC3487) For each recognized pulse of the step line the read/write head should move one cylinder toward the spindle if this line is active, and away from the spindle if not-active. -Write Data (Driver: 74LS04) For each inactive to active I I I I transition of this line while Write Enable is active the selected I I , drive must cause a flux change to be stored on the diskette. -Write Enable (Driver: MC3487) The drive must disable write I I current in the head unless this line is active. I I -HEAD SELECT 1 (Driver: MC3487) This interface signal defines which side of a two-sided diskette is used for data recording or retrievaL A I high I level on this line selects the R/W head on the side 1 surface of the diskette. When switching from side 0 to side 1 and conversely, a 100 /LS delay is required before any I read or write operation can be " I I I initiated. Diskette Drive Adapter 3-23 Adapter Inputs -Index The selected drive must supply one pulse per diskette revolution on this line. - Write Protect The selected drive must make this line active if a I I write-protected diskette is mounted in the drive. -Track 0 The selected drive must make this line I active I if the read/write head is over track o. -Read Data The selected drive must supply a pulse on this line for each flux change encountered on the diskette. Voltage and Current Requirements The diskette drive adapter requires a voltage supply of +5 Vdc +/- 5% and draws a nominal current of 525 rnA and a maximum current of 700 mAo 3-24 Diskette Drive Adapter Signal Cable Connector Keyed (Pin 5 Missing) 33 1 ::::::::::::::.:: 2 34c=J .CJ c::=J c=J c:J r=:J c:::::J c=J c:J c=J c:::::J c:::::J c::J CJ r=:J CJ r=::J System Board Connector Diskette Drive Adapter Pin At Standard TTL Levels Number ~-- Ground - Odd Numbers - 1 Through 33 5 (See Unused 2,4,6 Note) -INDEX 8 Unused 10 -DRIVE SElECT 12 Diskette Unused 14 Diskette Drive -MOTOR ENABLE 16 Drive -DIRECTION (Stepper Motor}---18 Adapter -STEP PULSE 20 -WRITE DATA 22 -WRITE ENABLE 24 -TRACK 0 26 -WRITE PROTECT 28 -READ DATA 30 -SElECT HEAD 1 32 Unused 34 Note: Pin 5 is missing to match the key plug on the signal cable. Connector Specifications (Part 1 of 2) Diskette Drive Adapter 3-25 Signal Name Diskette Drive Adapter Signal Name 07 A01 B01 +5V 06 . -DISKETTE CS 05 . A9 GND A3 04 A05 B05 GND 03 . A2 02 A1 GND AO 01 GND DO A10 B10 -lOR IRQ6 -lOW +DRQO GND -DACKO -CARD INSTL -5V -RESET N/C A15 B15 .. +5V System Board System Board Note: All levels are TTL compatible. Connector Specifications (Part 2 of 2) 3-26 Diskette Drive Adapter IBM PCjr Diskette Drive The system unit has space and power for one diskette drive. The drive is double-sided with 40 tracks for each side, is fully self-contained, and consists of a spindle-drive system, a read- positioning system, and a read/write/ erase system. Functional Description The diskette drive uses modified frequency modulation (MFM) to read and write digital-data, with a track-to-track access time of 6 milliseconds. To load a diskette, the operator rotates the load lever at the front of the diskette drive clockwise and inserts the diskette into the slot. Plastic guides in the slot ensure the diskette is in the correct position. Closing the load lever centers the diskette and clamps it to the drive hub. This same action also loads the Read/Write heads against the surfaces of the diskette. The load lever is mechanically interlocked to prevent closing of the lever if a diskette is not installed. The head-positioning system moves the magnetic head to come in contact with the desired track of the diskette. Operator intervention is not required during normal operation. If the diskette is write-protected, a write-protect sensor I disables I the drive's circuitry, and an appropriate signal is sent to the interface. Data is read from the diskette by the data-recovery circuitry, which consists of a low-level read-amplifier, differentiator, zero-crossing detector, and digitizing circuits. All data decoding is done by the adapter card. Diskette Drive 3-27 The IBM PCjr Diskette Drive is equipped with a media cooling fan, which gets its power from the power supply board. The diskette drive also has the following sensor systems: • The track 00 sensor, senses when the head/carriage assembly is at track 00. • The index sensor, which consists of an LED light source and phototransistor. This sensor is positioned so that when an index hole is detected, a digital signal is generated. • The write-protect sensor disables the diskette I I drive's electronics whenever it senses a write-protect tab on the diskette. The drive requires power within the following specifications: S pecifieation +5 Vde Input +12 Vde Input Nominal Supply +5 Vdc +12 Vdc Ripple (0 to 50 kHz) lOOmV lOOmV Tolerance (Including Ripple) ±5% ±5% Standby Current (N aminal) 600 rnA 400 rnA Standby Current (Worst Case) 700 rnA 500 rnA Operating Current (N ominal) 600 rnA 900 rnA Operating Current (Worst Case) 700 rnA 2400 rnA Diskette Drive Power Specifications For interface information refer to "Diskette Drive Adapter" in this section. F or mechanical and electrical specifications see Appendix D. 3-28 Diskette Drive Key Signal Cable Power Slot Connector Connector Fan Connector Opposite Side 1 33 Diskette Drive Connectors 1 1 - - - - ; +12 Vdc - - - - - I 1 Diskette 2 GND-----\ 2 Power Drive GND-----I 3 Board 3 4 +5Vdc - - - - I 4 Connector Specifications (Part 1 of 2) Diskette 1 I-----GND - - - - - I Drive 2 1----+12Vdc----I 2 Power Fan Board 3 GND - - - - - \ 3 Connector Specifications (Part 2 of 2) Diskette Drive 3-29 Notes: 3-30 Diskette Drive Diskette The IBM PCjr Diskette Drive uses a standard 133.4 mm (5.25 in.) diskette. For programming considerations, single-sided, double-density, soft-sectored diskettes are used for single-sided drives. Double-sided drives use double-sided, double-density, soft-sectored diskettes. 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 through an opening in the jacket. Openings for the drive hub and diskette index hole are also provided. 0.140 Inch (3.56 mm) r--------I-----fil - I I ± ~ 0.25 ± 0.01 Inch (6.30 ± 0.25 mm) Sealed Protective Jacket Oxide Coated Mylar Disk "' \ ", ii E --ffi ~@ -; o o +1 +1 ~ 5.25 Inch "! (133.4 mm) 0 . / \ J I o LO (Xl , ......., ~ Connector for TV Connector SYstem Unit Connector +12 VOlts A1 81 No Pin logic GND A2 82 Video AUdio A3 83 Shield GND Connector Specifications 3-86 Connector for Television IBM PCjr Keyboard Cord The IBM PCjr Cordless Keyboard can be attached to the PCjr using the optional Keyboard Cord. The Keyboard Cord is a 1.8 meter (6 foot), two twisted-pair cable, with a six-position RJll-type connector for the keyboard and a six-position Berg-type connector for the system unit. The Keyboard Cord option should be used in an environment that is unfavorable for use of the infra-red link. For instance, brightly lit high-intensity light areas, or multiple IBM PCjr areas where keyboards can conflict with one another. Insertion of the cord's keyboard connector into the keyboard actuates switches internal to the keyboard. The switches I deactivate I the IR transmitter by removing the power supplied by the keyboard's batteries. The system unit's infra-red (lR) receiver circuit is I disabled I by the -CABLE CONNECT signal, supplied when the system-unit end of the cord is connected. The following figures show the connector specifications for the Keyboard Cord. Keyboard Cord 3-87 Keyboard Cord Connectors Signal Name Pin Number A01 Keyplug 2 -CBL KEYBD DATA A02 5 +5 V A03 System Keyboard B01 Board -CABLE CONNECT - - B02 3 LOGIC GND B03 Connector Specifications 3-88 Keyboard Cord IBM PCjr Adapter Cable for Serial Devices The Adapter Cable for Serial Dewces is a 72 nun (3-inch) long, nine-cond:uctor cable terminated with a 16-position Berg-type connector and a 25-pin "D"-shell connector. This cable allows serial devices that terminate with a standard EIA-RS232C 25-pin "D"-shell connector to be connected to the mM PCjr. The following figures show the connector specifications for the Adapter Cable for Serial Devices. Adapter Cable for Serial Devices Serial Devices Cable 3-89 System 25-Pin D-Shell Connector Cable Connector A1 Not Used A2 DATA TERMINAL READY 20 A3 REQUEST TO SEND 4 A4 TRANSMIT DATA 2 A5 CARRIER DETECT 8 A6 DATA SET READY 6 A7 CLEAR TO SEND 5 A8 RECEIVE DATA 3 B1 SHIELD GND B2 SIGNALGND 7 B3 - B8 Not Used Connector Specifications 3-90 Serial Devices Cable IBM PCjr Adapter Cable for Cassette This option is an adapter cable that allows connection of a cassette recorder to the mM PCjT cassette connector. The cassette recorder to be connected must use the following type connectors: • Belden Style-51 miniture phone-plug (Auxiliary) • Belden Style-51 miniture phone-plug (Earphone) • Belden Style-56 subminiture phone-plug (Remote) The following figures show the connector specifications for the Adapter Cable for Cassette. 1111111111111 II III 1111 Ijl ~ III "" I" ,(00)' ~ Q) ',', ' ," ~ ~~ ~ Adapter Cable for Cassette Connectors Cassette Adapter Cable 3-91 GND A1 B1 Keyplug EARPHONE A2 B2 AUX. MIC A3 B3 REMOTE GND REMOTE A4 B4 SHIELD Connector Specifications (System End) (Part 1 of 2) System Cassette Connector Connector Pin Signal B2 Aux. (Red) Gnd A1 Signal A2 Ear (Black) Gnd A1 Signal A4 Remote (Gray) Gnd B3 Connector Specifications (Recorder End) (Part 2 of 2) 3-92 Cassette Adapter Cable IBM PCjr Adapter Cable for the IBM Color Display This adapter cable allows the IBM Color Display to be connected to the IBM PCjr. The following figures show the connector specifications for the adapter cable for the IBM Color Display. 111111111[1[1[[1]11111 ~ Ij~!!,[]~, ':',", ":' ~ Color Direct- Drive 9-Pin D-Shell Connector Adapter Cable for IBM Color Display Connectors Color Display Connector 3-93 System 9-Pin Color Connector Cable Display Connector A1 Not Used A2 Not Used A3 Not Used A4 Red 5 A5 Green 3 A6 Blue 6 A7 Intensity 4 A8 Not Used A9 Not Used B1 Vertical 9 B2 Not Used B3 Horizontal 8 B4 Not Used B5 Ground 2 B6 Not Used B7 Not Used B8 Not Used B9 Ground 1 Connector Specifications 3-94 Color Display Connector IBM PCjr Parallel Printer Attachment The Parallel Printer Attachment is provided to attach various II0 devices that accept eight bits of parallel data at standard TTL-logic levels. The card measures 76mm (3 inches) high by 244mm (9.6 inches) long. The P-arallel Printer Attachment attaches as a feature to the right-hand side of the system unit. It connects to the 60-pin Input/Output (I/O) connector where power and system-input signals are received. A parallel printer attaches to the Parallel Printer Attachment through a 25-pin female "D" -shell connector located on the rear edge of the attachment, where a cable and shield can be attached. The logic design is compatible with the mM Personal Computer printer adapter. The attachment card has 12 TTL buffer-output points which are latched and can be I written I and I read I under program control using the processor IN or I I 'Out I instructions. The attachment card also has five steady-state input-points that may be I read I using the processors' I IN I instructions. In addition, one input can also be used to create a processor interrupt. This interrupt can be I enabled I and I disabled I under program control. I Reset I from the power-on circuit is also ORed with a program-output point allowing a device to receive a power-on I reset I when the processor is I reset. I When the Parallel Printer Attachment is used to attach a printer, data or printer commands are loaded into an 8-bit latched output-port, then the strobe line is I activated I to I write I data to the printer. The program can then I read I the input ports for printer Parallel Printer Attachment 3-95 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 can also be I read I at the card's interface for diagnostic-loop functions. This allows fault-isolation determination between the printer. attachment and the attached printer. Description During a system II0 I read I or I write I , with the proper address selection, data may be I written I to or I read I from the Parallel Printer Attachment. The data and Control Registers must be manipulated by the system software to be consistent with the attaching hardware. The following is a block diagram of the Parallel Printer Attachment card. 3-96 Parallel Printer Attachment 25-Pin 3 Connector Bus Buffer Data Latch 8 Enable CLK 8 8 ---·1 8 Trans- ~--+-- ceiver ..-~ ADRS READ DATA WRITE DATA XIOI-M WRITE CONTROL READ STATUS Command Control Decoder Latch Drivers SLCTIN STROBE CLK AUTO FDXT INIT ERROR CLR SLCT PE ACK ~----------------t_--------------~ Reset ___________________ -I BUSY Parallel Printer Interface Block Diagram Parallel Printer Attachment 3-97 System Interface The Parallel Printer Attachment reserves addresses hex 378, through hex 37F. IO/-M must also be 'active high' when addressing the Parallel Printer Attachment. A card selected signal (-CARD SLCTD) is provided to the system I/O when the above addresses are used, and the 10/-M bit is 'active high. ' Specific commands are decoded from AO, At, RD, and WR per the following table. Input A2 is not used. Addresses (hex) Operation Comments 378 'Read' Read Data Latch 379 'Read' Read Status 37A 'Read' Read Control Latch 37B 'Read' Unused 37B 'Write' Write Data Latch 379 'Write' Unused 37A 'Write' Write Control Latch 37B 'Write' Unused All data transfers take place over the 8-bit I/O data-bus with timing provided by the 8088 microprocessor. (lOR, lOW, 10/-M) An interrupt is provided to the system through the I/O connector of the Parallel Printer Attachment. This 3-98 Parallel Printer Attachment interrupt is 'positive active' , Interrupt Level 7 (+IRQ7). Bit 4 of the control latch must be 'written high' to allow interrupts. When the -ACKnowledge signal ( 'low active' signal goes ' high ') the I/O device causes a level 7 interrupt. See the following figure. 3-State +IRQ7 -ACK----- Buffer Control .0' - EJ-I +IQR7 / -ACK Logic Diagram C G Programming Considerations The Parallel Printer Attachment can serve as a general purpose peripherial driver. This section describes a configuration which supports attachment to the mM Graphics Printer. Command Definition For the parallel-printer application, the following bit definitions apply. Data Latch - Address hex 378 A 'write' to this address causes data to be latched onto the printer data bits. A 'read' from this address presents the contents of the data latch to the processor. Parallel Printer Attachment 3-99 MSB 7 6 5 4 3 2 1 o lSB Data Data Data Data Data Data Data Data Bit Bit Bit Bit Bit Bit Bit Bit 7 6 543 2 1 0 Data Latch Format Printer Status - Address hex 379, hex 7D, Input Only This port provides real-time feedback and status to the system from the printer. 3-100 ParaDel Printer Attachment Signal Bit Name Description MSB7 -BUSY When this signal is at a low level, the printer is busy and cannot accept data. It can become low during data entry, off-line printing, head translation, or error state. 6 -ACK When port B is read, this bit will represent the current state of the printer ACK signal. A low level means that a character has been received and the printer is ready to accept another. Normally, this signal will be low for approximately 5 microseconds before BUSY goes away. 5 -PE A low level indicates that the printer has detected an end of form. 4 +SLCT A high level indicates that the printer is selected. 3 -ERROR A low level indicates that the printer has encounted an error condition. 2 Unused. Through OLSB Printer Status Printer Control - Address hex 37A This port contains printer control signals. A I write I latches control bits to the printer; a read presents the I I contents of the latches to the processor. See the following timing diagram: Parallel Printer Attachment 3-101 Busv-----------------,I I -ACKNLG ----, ;. '----=--------------- !'------IllII: ~~;m"mI ::rOXimateIY " 4 ~ t DATA_~II~­ - STROBE ---:-----.1 I Parallel Interface Timing Diagram The following figure describes the printer control signals. 3-102 Parallel Printer Attachment Signal Bit Name Description MSB7 Unused. Through 5 4 +INTERRUPT A high level in this bit position ENABLE will allow an interrupt to occur when -ACK goes high. 3 SLCTIN A low level in this bit position selects the printer. 2 INIT A low level will initialize the printer (50 microseconds minimum). ~ I AUTO FDXT A low level will cause the ~ printer to line feed anytime a ~ line is printed. ~ I"' LSB 0 STROBE ~ A 5 microsecond (minimum) low active pulse clocks data into the printer. Valid data i must be present for 5 microseconds (minimum) before and after the STROBE pulse. Printer Control Signal The following are the connector specifications for the IBM PCjr Parallel Printer Attachment. Parallel Printer Attachment 3-103 o~o ~ ",,,,,"'/1""111'" 'l'~!!e[1]Q/ OJ A30 A1 ............................ ............................ 630 1/0 Expansion Connector 61 .,...,••L ~'"'"--1 4 Parallel Printer Attachment Connectors 25-Pin "D"-Shell Connector Pin Signal IOL Max IOH Max Source I -STROBE 14 rna -.6 rna Attachment Card 2 DATA BIT 0 24 rna -2.6 rna Attachment Through Through Card 9 DATA BIT 7 10 -ACK 74LS Input 74LS Input Printer 11 BUSY 74LS Input Printer 74LS Input 12 PE 74LS Input 74LS Input Printer 13 SLCT 74LS Input Printer 74LS Input 14 -AUTO 14 rna Attachment .6 rna FDXT Card 15 -ERROR 74LS Input 74LS Input Printer 16 -INIT 14 rna .6 rna Printer PRINTER 17 -SELECT 14 rna .6 rna Attachment INPUT Card 18 GND NjA NjA Through 25 Connector Specifications (Part 1 of 2) 3-104 Parallel Printer Attachment Parallel Printer Attachment to I/O Signal Name Expansion Connector Signal Name 01 B1 A1 DO 02 +12 Vdc 04 03 GND 05 07 B5 A5 06 AO +5 Vdc A2 A1 GND A3 A5 A4 A6 B10 A10 GND A8 A7 -DACKO A9 A11 A10 A12 DRQO GND B15 A15 A13 A15 A14 GND A16 A17 GND A19 A18 GND B20 A20 -lOR -MEMR -lOW -MEMW GND ALE HDLA GND CLK 10/-M B25 A25 RESET READY +5 Vdc -CARD SLCTD -HRQ GND IRQ1 IRQ7 IRQ2 AUDIO IN B30 A30 Reserved Connector Specifications (Part 2 of 2) Parallel Printer Attachment 3-105 Notes: 3-106 Parallel Printer Attachment IBM Graphics Printer The mM Graphics Printer is a self-powered, stand-alone, tabletop unit which attaches to the system unit through a 6-foot parallel-signal cable, and obtains 120 Vac power from a standard wall outlet through a seperate cable. It is an 80 CPS (characters per second), bidirectional, wire-matrix device that can print in a compressed mode of 132 characters per line, in a standard mode of 80 characters per line, in a double width-compressed mode of 66 characters per line, and in a double width mode of 40 characters per line. It can also print double-size and double-strike characters. It prints the standard ASCII, 96-character, uppercase and lowercase character sets and also has a set of 64 special block characters. It has an extended character set for international languages, subscript, superscript, an underline mode, and programmable graphics. The Graphics printer accepts commands that set the line-feed control desired for the application. It attaches to the system unit through the mM PCjr Parallel Printer Attachment. The cable is a 25-conducter, shielded cable with a 25-pin "D"-shell connector at the system unit end, and a 36-pin connector at the printer end. Printer Specifications Print Method: Serial-impact dot matrix Print Speed: 80 CPS Print Direction: Bidirectional with logic seeking Number of Pins in Head: 9 Printers 3-107 Line Spacing: 1/16 inch (4.23 mm) or programmable Matrix Characteristics: 9 by 9 Character Set: Full 96-character ASCII with descenders plus 9 international characters/symbols Graphic Characters: See" Additional Printer Specifications" Printing Sizes: Normal 10 characters-per-inch with a maximum of 80 characters-per-line Double Width 5 characters-per-inch with a maximum of 40 characters per line Compressed 16.5 characters-per-inch with a maximum of 132 characters per line Double Width-Compressed 8.25 characters-per-inch with a maximum of 66 characters per line Subscript 10 characters-per-inch with a maximum of 80 characters per line Superscript 10 characters-per-inch with a maximum of 80 characters per line Media Handling: Adjustable sprocket-pin-feed with 4-inch (101.6 mm) to lO-inch (254 mm) width paper, one original plus two carbon copies (total thickness not to exceed 0.012 inch (0.3 mm)), minimum paper thickness of 0.0025 inch (0.064 mm) Interface: Parallel 8-bit data and control lines Inked Ribbon: Black, cartridge type with a life expectancy of 3 million characters 3-108 Printers Environmental Conditions: Operating temperature is 5 to 35 degrees centigrade (41 to 95 degrees Fahrenheit), operating humidity is 10 to 80% non-condensing Power Requirements: 120 Vac, 60 Hz, 1 A maximum with a power consumption of 100 VA maximum Physical Characteristics: Height 107 mm (4.2 inches) Width 374 mm (14.7 inches Depth 305 mm (12 inches) Weight 5.5 kg (12 pounds) Additional Printer Specifications Printing Characteristics Extra Character Set Set 1 Additional ASCII numbers 160 to 175 contain European characters. Numbers 176 to 223 contain graphic characters. Numbers 224 to 239 contain selected Greek-characters. Numbers 240 to 255 contain math and extra symbols. Set 2 The differences in Set 2 are ASCII numbers 3,4,5,6, and 21. ASCII numbers 128 to 175 contain European characters. Graphics There are 20 block characters and programmable graphics. Printers 3-109 DIP Switch Settings There are two Dual-Inline-Package (DIP) switches on the control circuit-board. In order to satisfy the user's specific requirements, desired control modes are selected by the DIP switches. The functions of these switches and their preset conditions at the time of shipment are shown in the following figures. DIP Switch 2 DIP Switch 1 DOD DaOO o o o D Location of DIP Switches 3-110 Printers Switch Factory Number Function On Off Position 1-1 Not Applicable - - On 1-2 CR Print Print and On Only Line Feed 1-3 Buffer Full Print Print and Off Only Line Feed 1-4 Cancel Code Invalid Valid Off 1-5 Not Applicable - - On 1-6 Error Buzzer Sound No Sound On e~ 1-7 Character Set 2 Set 1 Off ~ ~ ~ Generator 1-8 SLCT IN Signal Fixed Internally Not Fixed Internally On • Functions and Conditions of DIP Switch 1 Switch Factory Number Function On Off Position 2-1 Form Length 12 Inches 11 Inches Off 2-2 Line Spacing 1/8 Inch 1/6 Inch Off 2-3 Auto Feed XT Fixed Not Fixed Off Signal Internally Internally 2-4 1 Inch Skip Over Valid Invalid Off Perforation Functions and Conditions of DIP Switch 2 Printers 3-111 Parallel Interface Description Specifications Data Transfer Rate 1000 cycles-per-second (cps)-(maximum) Synchronization By externally-supplied STROBE pulses Signal Exchange -ACKNLG or BUSY signals Logic level Input data and all interface-control signals are compatible with the Transistor-Transistor Logic (TTL) level. Connector Plug 57-30360 (Amphenol) Connector-pin assignments and descriptions of respective interface-signals are provided in the following figures. Data Transfer Sequence The following figure shows the Parallel Interface Timing. 3-112 Printers BUSY-------------~ ,- ACKNlG - - - - - , ;.-'- - . . . . : - - - - - - - - - - - - - - '--___.....1 i 0.5"~ IM;";mumj Approximately :. 5jJ.s • i . ;·~··I ~ I i I II DATA _ _ _ _ _ _ _- - J I ~------- I - STROBE Parallel Interface Timing Diagram Interface Signals -Strobe STROBE pulse to read data in. Pulse width must be more than 0.5 ILS at the receiving terminal. The signal is normally 'high'; however read-in of data is performed at the 'Low' level of this signal. Data 1-8 These signals are the first to eight bits of parallel data. Each signal is at a , high' level when data is a logical 1 and 'low' when data is a logical O. -ACKNLG Approximately 0.5 J.LS pulse (low) indicates that data has been received and the printer is ready to accept data. BUSY A 'high I signal indicates that the printer cannot receive data. The signal is high in the following cases: I I • During data entry Printers 3-113 • During printing operation • In the "off-line" state • During printer-error status PE A 'high' signal indicates that the printer is out of paper. SLCT This signal indicates that the printer is in the selected state. Auto Feed XT When this signal is 'low' paper is fed one line after printing. This signal level can be fixed 'low' by DIP switch pin 2-3. INT When this signal is 'low' the printer controller is reset to its initial state and the print buffer is cleared. This signal is normally 'high' and its pulse width must be more than 50 p.s at the receiving terminal. Error This signal is 'low' when the printer is in the "Paper End," "Off Line," and "Error" state. -SLCTIN Data entry to the printer is possible only when this signal is 'low'. This signal can be fixed 'low' by DIP switch 1-8. Notes: 1. All interface conditions are based on TTL level. Both the rise and fall times of each signal must be less than 0.2 p.s. 2. Data transfer must not be carried out by ignoring the -ACKNLG or BUSY signal. Data transfer can only occur after confirming the -ACKNLG signal or when the BUSY signal is 'low'. The following figure shows the pin assignment and direction of each signal. 3-114 Printers Signal Return Signal Pin # Pin # Direction -STROBE 1 19 In DATA 1 2 20 In DATA 2 3 21 In DATA 3 4 22 In DATA 4 5 23 In DATA 5 6 24 In DATA 6 7 25 In DATA 7 8 26 In DATA 8 9 27 In -ACKNLG 10 28 Out BUSY 11 29 Out PE 12 30 Out SLCT 13 Out ~~ ~ AUTO FEED XT 14 ~ In NC 15 ~ ~ ~ OV CHASSIS GND 16 17 ~ ~ = ~ • ~ ~ ~ NC 18 ~ ~ GND 19-30 ~ ~ INT 31 ~ In ERROR 32 ~ Out GND 33 ~ ~ NC 34 ~ ~ 35 ~ ~ -SLCT IN 36 ~ In Pin Assignments Printer Modes The IBM Graphics Printer can use any of the combinations listed in the following table and the print mode can be changed at any place within the line. Modes can be selected and combined if they are in the same vertical column. Printers 3-115 Printer Modes Normal X X X Compressed X X X Emphasized X X X Double Strike X X X Subscript X X X Superscript X X X Double Width X X X X X X X X X Underline X X X X X X X X X Printer Modes Printer Control Codes On the following pages are complete codes for printer characters, controls, and graphics. You may want to keep them handy for future reference. The printer codes are listed in ASCII-decimal numeric-order (from NUL which is 0 to DEL, which is 127). The examples given in the Printer-Function descriptions are written in the BASIC language. The "input" description is given when more information is needed for programming considerations. ASCII decimal values for the printer control codes can be found under "Printer Character Sets." The Descriptions that follow assume that the printer DIP switches have not been changed from their factory settings. Printer code Printer Function NUL Null: Used with ESC B and ESC D as a list terminator. NUL is also used with other printer. 3-116 Printers control codes to select options (for example, ESC S). Example: LPRINT CHR$ (0); BEL Bell: Sounds the printer buzzer for 1 second. Example: LPRINT CHR$(7); HT Horizontal Tab: Tabs to the next horizontal tab stop. Tab stops are set with ESC D. Tab stops are set every 8 columns when the printer is powered on. Example: LPRINT CHR$(9); LF Line Feed: Spaces the paper up one line. Line spacing is 1/16-inch unless reset by ESC A, ESC 0, ESC 1, ESC 2, or ESC 3. Example: LPRINT CHR$(10); FF Form Feed: Advances the paper to the top of the next page. Note: The location of the paper, when the printer is powered on, determines the top of the page. The next top of page is 11 inches from that position. ESC C can be used to change the page length. Example: LPRINT CHR$(12); CR Carriage Return: Ends the line that the printer is on and prints the data remaining in the printer buffer. (No Line Feed operation takes place.) Printers 3-117 Note: mM Personal Computer BASIC adds a Line Feed unless 128 is added [for example CHR$(141)]. Example: LPRINT CHR$( 13); so Shift Out (Double Width): Changes the printer to the Double-Width print-mode. Note: A Carriage Return, Line Feed or DC4 cancels Double-Width print-mode. Example: LPRINT CHR$(14); SI Shift In (Compressed): Changes the printer to the Compressed-Character print-mode. Example: LPRINT CHR$(15); DC2 Device Control 1 (Compressed Off): Stops printing in the Compressed print-mode. Example: LPRINT CHR$(18); DC4 Device Control 4 (Double Width Off): Stops printing in the Double-Width print-mode. Example: LPRINT CHR$(20); CAN Cancel: Clears the printer buffer. Control codes, except SO, remain in effect. Example: LPRINT CHR$(24); ESC Escape: Lets the printer know that the next data sent is a printer command. Example: LPRINT CHR$(27); ESC- Escape Minus (Underline) 3-118 Printers Format: ESC -;n; ESC - followed by a 1, prints all of the following data with an underline. ESC - followed by a 0 (zero), cancels the Underline print-mode. Example: LPRINT CHR$(27);CHR$(45);CHR$(1); ESC 0 Escape Zero (l/8-Inch Line Feeding) Changes paper feeding to 1/8-inch. Example: LPRINT CHR$(27);CHR$(48); ESC 1 Escape One (7/72-Inch Line Feeding) Changes paper feeding to 7/72-inch. Example: LPRINT CHR$(27);CHR$(49); ESC 2 Escape Two (Starts Variable Line-Feeding) ESC 2 is an execution command for ESC A. If no ESC A command has been given, line feeding returns to 1/6-inch. Example: LPRINT CHR$(27);CHR$(50); ESC 3 Escape Three (Variable Line-Feeding) Format: ESC 3;n; Changes the paper feeding to n/216-inch. The example that follows sets the paper feeding to 54/216 (l/4)-inch. The value of n must be between 1 and 255. Example: LPRINT CHR$(27);CHR$(51);CHR$(54); ESC 6 Escape Six (Select Character Set 2) Selects Character Set 2. (See "Printer Character set 2") Example: LPRINT CHR$(27);CHR$(54); ESC 7 Escape Seven (Select Character Set 1) Printers 3-119 Selects character set 1. (See "Printer Character Set 1") Character set 1 is selected when the printer is powered on or reset. Example: LPRINT CHR$(27);CHR$(55); ESC 8 Escape Eight (Ignore Paper End) Allows the printer to print to the end of the paper. The printer ignores the Paper End switch. Example: LPRINT CHR$(27);CHR$(56); ESC 9 Escape Nine (Cancel Ignore Paper End) Cancels the Ignore Paper End command. ESC 9 is selected when the printer is powered on or reset. Example: LPRINT CHR$(27);CHR$(57); ESC < Escape Less Than (Home Head) The printer head returns to the left margin to print the line following ESC <. This occurs for one line only. Example: LPRINT CHR$(27);CHR$(60); ESC A Escape A (Sets Variable Line Feeding) Format: ESC A;n; Escape A sets the line-feed to n/72-inch. The example that follows tells the printer to set line feeding to 24/72-inch. ESC 2 must be sent to the printer before the line feeding changes. For example, ESC A;24 (text) ESC 2 (text). The text following ESC A;24 spaces at the previously set line-feed increments. The text following ESC 2 prints with new line-feed increments of 24/72-inch. Any increment between 1/72 and 85/72-inch may be used. 3-120 Printers Example: LPRINT CHR$(27);CHR$(65);CHR$(24); CHR$(27);CHR$(50); ESCC Escape C (Set Lines-per-Page) Format: ESC C;n; Sets the page length. The ESC C command must have a value following it to specify the length of page desired. (Maximum form length for the printer is 127 lines.) The example below sets the page length to 55 lines. The printer defaults to 66 lines-per-page when powered on or reset. Example: LPRINT CHR$(27);CHR$(67);CHR$(55); Escape C (Set Inches-per-Page) Format: ESC C;n;m; Escape C sets the length of the page in inches. This command requires a value of 0 (zero) for n, and a value between 1 and 22 form. Example: LPRINT CHR$(27);CHR$(67);CHR$(0);CHR$(12); ESCD Escape D (Sets Horizontal Tab Stops) Format: ESC D;nl ;n2; ... nk;NUL; Sets the horizontal-tab stop-positions. The example that follows shows the horizontal-tab stop-positions set at printer column positions of 10, 20, and 40. They are followed by CHR$(O), the NUL code. They must also be in ascending numeric order as shown. Tab stops can be set between 1 and 80. When in the Compressed-print mode, tab stops can be set up to 132. The Graphics Printer can have a maximum of 28 tab stops. The HT (CHR$(9» is used to execute a tab operation. Example: Printers 3-121 LPRINT CHR$(27);CHR$( 68) ;CHR$( 10) ;CHR$(20);CHR$( 40); CHR$(O); ESCE Escape E (Emphasized) Changes the printer to the Emphasized-print mode. The speed of the printer is reduced to half speed during the Emphasized-print mode. Example: LPRINT CHR$(27);CHR$(69); ESCF Escape F (Emphasized Off) Stops printing in the Emphasized-print mode. Example: LPRINT CHR$(27);CHR$(70); ESCG Escape G (Double Strike) Changes the printer to the Double-Strike print-mode. The paper is spaced 1/216 of an inch before the second pass of the print head. Example: LPRlNT CHR$(27);CHR$(71); ESCH Escape H (Double Strike Off) Stops printing in the Double-Strike mode. Example: LPRINT CHR$(27);CHR$(72); ESCJ Escape J (Sets Variable Line Feeding) Format: ESC J;n; When ESC J is sent to the printer, the paper feeds in increments of n/216 of an inch. The value of n must be between 1 and 255. The example that follows gives a line feed of 50/216-inch. ESC J is canceled after the line feed takes place. Example: LPRINT CHR$(27);CHR$(74);CHR$(50); ESCK Escape K (480 Bit-Image Graphics Mode) Format ESC K;nl ;n2;vl ;v2; ... vk; Changes from the Text mode to the Bit-Image 3-122 Printers Graphics mode. nl and n2 are one byte, which specify the number of bit-image data bytes to be transferred. vI through vk are the bytes of the bit-image data. The number of bit-image data bytes (k) is equal to nl +256n2 and cannot exceed 480 bytes. At every horizontal position, each byte can print up to 8 vertical dots. Bit-image data may be mixed with text data on the same line. Note: Assign values to nl and n2 as follows: nl represents values from 0 - 255. n2 represents values from 0 - I x 256. MSB is most-significant bit and LSB is least -significant bit. The following figures show the format. Data sent to the printer. Text (20 characters) ESC K n=360 Bit-image data Next data Printers 3-123 In text mode, 20 characters in text mode correspond to 120 bit-image positions (20 x 6 = 120). The printable portion left in Bit-Image mode is 360 dot positions (480 - 120 = 360). Data sent to the printer. Data A ESC K I n 1 I n2 Data B Data C ESC I K 1n 1 1 n21 Data 0 Bit- Bit- Text Length of image Text Length of image data data data data data data 480 bit-image dot positions Example: 1 'OPEN PRINTER IN RANDOM MODE WITH LENGTH OF 255 2 OPEN "LPTl:"AS #1 3 WIDTH "LPTl:",255 4 PRINT #1,CHR$(13)+CHR$(1O); 5 SLASH$=CHR$(1)+CHR$(02) +CHR$(04) +CHR$(08) 6 SLASH$=SLASH$+CHR$(16)+CHR$(32) +CHR&(64)+$CHR$(128)+CHR$(0) 7 GAP$=CHR$(O)+CHR$(O)+CHR$(O) 8 NDOTS=480 9 'ESCKNI N2 10 PRINT #1,CHR$(27);"K";CHR$(NDOTS MOD 256);CHR$ (FIX(NDOTS/256»; 11 'SEND NDOTS NUMBER OF BIT IMAGE BYTES 12 FOR 1=1 TO NDOTS/12 'NUMBER OF SLASHES TO PRINT USING GRAPHICS 13 PRINT #1,SLASH$;GAP$; 3-124 Printers 14 NEXT I 15 CLOSE 16 END This example gives you a row of slashes printed in the Bit-Image mode. ESCL Escape L (960-Bit-Image Graphics-Mode) Format: ESC L;nl;n2;vl;v2; ... vk; Changes from the Text mode to the Bit-Image Graphics mode. The input is similar to ESC K. The 960 Bit-Image mode prints at half the speed of the 480 Bit-Image Graphics mode, but can produce a denser graphic image. The number of bytes of bit-image Data (k) is nl +256n2 but cannot exceed 960. nl is in the range of 0 to 255. ESCN Escape N (Set Skip Perforation) Format ESC N;n; Sets the Skip Perforation function. The number following ESC N sets the value for the number of lines of Skip Perforation. The example shows a 12-line skip perforation. This prints 54 lines and feeds the paper 12 lines. The value of n must be between 1 and 127. ESC N must be reset anytime the page length (ESC C) is changed. Example: LPRINT CHR$(27);CHR$(78);CHR$(12); ESC 0 Escape 0 (Cancel Skip Perforation) Cancels the Skip Perforation function. Example: LPRINT CHR$(27);CHR$(79); ESCS Escape S (Subscript/Superscript) Format: ESC S;n; Changes the printer to the Subscript print mode when ESC S is followed by aI, as in the example that follows. When ESC S is followed by a 0 (zero), the printer prints in the Printers 3-125 Superscript print mode. Example: LPRINT CHR$(27);CHR$(83);CHR$(1); ESCT Escape T (Subscript/Superscript Off) The printer stops printing in the Subscript or Superscript print mode. Example: LPRINT CHR$(27);CHR$(84); ESCU Escape U (Unidirectional Printing) Format: ESC U;n; The printer prints from left to right following the input of ESC U;l. When ESC U is followed by a 0 (zero), the left to right printing operation is canceled. The Unidirectional print-mode (ESC U) ensures a more accurate print-start position for better print quality. Example: LPRINT CHR$(27);CHR$(85);CHR$(1); ESCW Escape W (Double Width) Format: ESC W;n; Changes the printer to the Double-Width print mode when ESC W is followed by a 1. This mode is not canceled by a line-feed operation and must be canceled with ESC W followed by a o (zero). Example: LPRINT CHR$(27);CHR$(87);CHR$(1); ESCY Escape Y (960 Bit-Image Graphics Mode Normal Speed) Format: ESC Y nl;n2;vl;v2; ... vk; Changes from the Text mode to the 960 Bit-Image Graphics mode. The printer prints at normal speed during this operation and cannot print dots on consecutive dot position. The input of data is similar to ESCL. ESCZ Escape Z (1920 Bit-Image Graphics Mode) 3-126 Printers Format: ESC Z;n1;n2;v1;v2; ... vk; Changes from the Text mode to the 1920 Bit-Image Graphics mode. The input is similar to the other Bit-Image Graphics modes. ESC Z can print only every third dot position. Printers 3-127 ·:'l 'I' 1' 1'1'1' ,:, "I H~ 1 ~: ~: :: 1" 1;: 1 1 1:1 1 '" " ~~11 '" 0';41 " 1 n 1 n 1C:'. 1" 1 '" E~C " 1 '" " I" 1S: 1;' H;1$;. ~ ': ;1;1: :1: I:I~I; ~ ; ; -I ; 1~ ~ ~ I; I; ~ ;" "; I~I:I; ; ; ~I; ~ ~ ~ I;I~I~ ; ~ ; ~ ; ~ ~ I;I~I~ ;; ~ ~ ~~ ~ I;I~I~ ; : ~ ~ : ~ : :F 1'~ 1 I: I~ ';" ';" '~ ';" I~ I 1~ 1~ I '~I ~ 1'; I'~ '~" '~ ~ 1:1 I': I'~ 1: 1'I' I';"1;" I'~ '" ~~:I I Ho Printer Character Set 1 (Part 1 of 2) 3-128 Printers ... 170171172 1/2 1/4 1731711 I I « » ••• ••• 175176 ::: •• •••• 177178179 ~ ~ '""""' r- " ~':- Printer Character Set 1 (Part 2 of 2) Printers 3-129 .:, I ' I ' 1~ I. B;' " H: 1 H. H ~oF 1" ~+: 1:1 1'" " ~;1 " 1 ~ 1 1" 1C:'. 1'" I" E~C '" "I 0:41 n WI" I:; I ;' I :: $ ~ ~ ': I 1; 1 1;1;'1:1:1': H~" ; ~I~ I; ;1;1;1;1;1; ;I~I: I; :1; ; ~I; ; ~ ~I; I; ~I ~ '; ~ ~ ~ I~ ~ ~ ; ~ 1~ ; ; ~ ~ I~ ; ~ I ; ~I~ i : ~ : I: ~ ~ 100 101 102 103 104 105 106 107 108 109 delf9h i ilk1m 110 111 112 113 114 115 116 117 118 119 n olp q r 5 tlu V w IlO III 127 173 124 125 126 127 128 129 xlylz {I: }I~I C ii Printer Character Set 2 (part 1 of 2) 3-130 Printers .., 112 1/4 170 171 172 173 I I « » ... 174 175 . ::: . 176 , •• • 1. 177 178 -'179r- :::. : -'- Printer Character Set 2 (Part 2 of 2) Printers 3-131 Notes: 3-132 Printers IBM PC Compact Printer The PC Compact Printer is a stand-alone, tabletop unit that plugs into a standard wall outlet. Using an eight-wire print head, the printer can print characters from the standard ASCn, 96-character, uppercase and lowercase character sets, and prints the characters in a 5-by-7 dot matrix at 56 characters-per-second (cps). It prints in one direction (left-to-right) and has four print modes. In the standard mode, the printer prints 80 characters-per-line; in the compressed mode, 136 characters; in the double-width mode, 40 characters, and in the compressed double-width mode, 68 characters-per-line. The PC Compact Printer can also underline characters, has an extended character-set for intemationallanguages, and can accept special characters programmed by the user. The printer has a 1.89 meter (6-foot), 16-lead, printer cable that connects, through an Amphenol connector, to the serial port (RS-232-C) at the rear of the system unit. Printers 3-133 +VH_____. VOLTAGE REG. AND ... P17 .... SAFm LOGIC THERMAL HEAD tl A ..... P30·37 ~ ADR/DATA BUS ) DATA LATCH SN74LS273 HEAD DRIVER ULN2803A =) ~ PULSE LAMP/MOTOR MOTOR DRIVER Pl0'13 P16 " ,/ ULN2013 MPU HD6801 ~TOLED V5 P46 1... FROM IF KEY P47 Lo ,.. FROM HOME POSITION SWITCH v-t ~~ I ~ ~ ADDRESS LATCH ~ h"TAI v' i SN74lS373 v / I ' 4.91 MHz 2KB STATIC'RAM I P40·44 HIGH ORDER ADDRESS "- HM6116 ,/ ,.. P23 I... ~RD} DRIVER/ TO IBM PCjr P15 .. RECEIVER ~CTS rI +12V -12V 3-134 Printers Printer Specifications Print Method: Thermal, non-impact, Dot-matrix Print Speed: 56 cps Print Direction: Left to right only Number of Pins in 8 Print Head: Line Spacing: 4.23 mm (1/6 in) Matrix Pattern: 5 by 7 Dots Character Set: Full 96-character ASCII with descenders, plus international characters / symbols Graphics: None Printers 3-135 Print Modes: Characters Maximum per Inch Characters per Line Standard 10 80 Double Width 5 40 Compressed 17.5 l36 Compressed/ 8.75 68 Double Width Paper Feed: Friction Feed Paper Width: 216 mm (8.5 in) Copies: Single sheet only Paper Path: Top System Interface: Serial Data and Control Lines Print Color: Black only 3-136 Printers Environmental Conditions Temperature: 5°C (+41°F) to 40°C (l04°F) Humidity: 10 to 80% non-condensing Power Requirement Voltage: 110 Vac 60 Hz Current: 245 rnA Power Consumption: 36 watts Heat Output: 57.6 kJ (54.6 BTU)/hr (maximum) Physical Characteristics Height: 88.9 mm (3.5 in) Width: 312.4 mm(12.3 in) Depth: 221 mm (8.7 in) Weight: 2.99 kg (6.6 lb) Power Cable Length: 1.98 m (6.5 ft) Size: 28 AWG Printer Cable Length: 1.83 m (6 ft) Size: 3 by 18 AWG Printers 3-137 Character Set: ASCII numbers 0 to 31 contain control codes and special characters. ASCII numbers 32 to 127 contain the standard printable characters. ASCII numbers 128 to 175 contain European characters. ASCII numbers 224 to 255 contain math and extra symbols. 3-138 Printers Serial Interface Description Specifications: Data Transfer Rate: 1200 bps (maximum) Synchronization: internal clocking Handshaking: CTS (Clear to Send) Pacing Logic Level: Input data and all interface control- signals are EIA Levels Connector Plug: 9804 (Amphenol) The following figure shows the timing of the Serial Interface . 1....- - - - - Character Period - - - -....~~I Received Data I ~ I __ I Two Stop Bits One Start Bit Ti "I High (Ready) ROY Low (Busy) I CTS Serial Interface Timing Diagram Printers 3-139 Print Mode Combinations for the PC Compact Printer The following figure shows the print-mode combinations possible with the PC Compact Printer. Modes shown in the same column can be combined. A print mode can be changed at any time within a line: however, the double-width mode effects the entire line. Modes Standard XXX Compressed XXX XXX XXX Double-Width XXX XXX XXX Underline XXX XXX XXX XXX Printer Control Codes and Functions On the following pages you will find a detailed list of the printer control codes and functions. This list also includes descriptions of the functions and examples of the printer control codes. The examples (LPRINT statements) given in the detailed descriptions of the printer control codes and functions list, are written in BASIC. Some knowledge of BASIC programming is needed to understand these codes. Some of the printer control codes also show a "Format" description when more information is needed for programming considerations. 3-140 Printers CODE PRINTER FUNCTION CAN Cancel Clears the printer buffer. Control codes, except SO, remain in effect. Reinitializes the printer to the power on defaults. LPRINT CHR$(24); CR Carriage Return Ends the line the printer is on and prints any data remaining in the printer buffer. The logical character position is moved to the left margin. (No Line Feed operation takes place.) Note: mM Personal Computer BASIC adds a Line Feed unless 128 is added. LPRINT CHR$(13); DC2 Device Control 2 (Compressed Off) Stops printing in the Compressed mode. LPRINT CHR$(18); DC4 Device Control 4 (Double Width Off) Stops printing in the Double Width mode. LPRINT CHR$(20); ESC Escape Informs the printer that the following data is a printer command. (See the following ESC commands.) LPRINT CHR$(27); Printers 3-141 ESCB Escape B (Set Vertical Tabs) Sets vertical tab stop positions. Up to 64 vertical tab stop positions are recognized by the printer. Tab stop positions must be received in ascending numeric order. The tab stop numbers do not become valid until you type the NUL code. Once vertical tab stops are established, they are valid until new tab stops are specified. (If the printer is reset or switched Off, set tab stops are cleared.) If no tab stop is set, the Vertical Tab command acts as a Line Feed command. ESC B followed only by NUL cancels tab stops. The form length must be set by the ESC C command prior to setting tabs. LPRINT CHR$(27);CHR$(66);CHR$(10);CHR$(20); CHR$(40);CHR$(O); ESCC Escape C (Set lines per page) Format: ESC C;n; Sets the page length. The ESC C command must be followed by a value to specify the length of page desired. (Maximum form length for the printer is 127 lines.) The following example sets the page length to 55 lines. The printer default is 66 lines per page when switched On or reset. LPRINT CHR$(27);CHR$(67);CHR$(55); 3-142 Printers ESCD Escape D (Set Horizontal Tab Stops) Sets the horizontal tab stop positions. The following example shows the horizontal tab stop positions set at printer column positions of 10, 20 and 40. The horizontal tab stops are followed by CHR$(O), the NUL code. They must also be in ascending numeric order as shown. You can set tab stops between 1 and 80. When in the Compressed print mode, you can set tabs up to column 136. The maximum number of tabs that can be set is 112. HT (CHR$(9» is used to execute a tab operation. LPRINT CHR$(27);CHR$(68);CHR$(10)CHR$(20) CHR$(40);CHR$(0); ESCK Escape K (480 Bit-Image Graphics Mode) Format: ESC K;nl;n2; vI; v2; ..... vk; Changes the printer to the Bit-Image Graphics mode. Dot density is 82.5 by 82.5 dots per inch. If the graphics data exceeds the space remaining on the line, the printer ignores the excess data. Only the excess data is lost. The numbers n1 and n2 specify, in binary form, the number of bit image data bytes to be transferred. Assign values to nl to represent values from zero to 255 and assign values to n2 to represent values from 0-1 x 256. The total number of bit image data bytes cannot exceed 480. (nl + (n2 X 256». Printers 3-143 The bit-image data bytes are vI through vk. All eight of the print head wires are used to print Bit-image graphics. Each bit of a bit-image data byte represents a dot position within a vertical line. The least significant bit (LSB) represents the bottom dot position, and the most significant bit (MSB) represents the top dot position. For example, if vX is hex 80, the top dot will print only in that vertical position; if vX is hex 01, the bottom dot will print; and if vX is hex FF, all eight dots will print. Dot Bit Number Top 0 - - - 8 0- --7 0- - - 6 0- - - 5 0- - - 4 0- - - 3 0- - - 2 Bottom 0 - - - 1 LPRINT CHR$(27);CHR$(75);nl ;n2 ESCN Escape N (Set Skip Perforation) Format: ESC N;n; Sets the Skip Perforation function. The number following ESC N sets the number of lines to be skipped. The example shows a 12-line skip perforation. This command will print 54 lines and feed the paper 12 lines. The value of n must be between 1 and 127. ESC N must be reset anytime the page iength (ESC C) is changed. The default for skip perforation is 25.4 mm (1 inch). LPRINT CHR$(27);CHR$(78);CHR$(12); 3-144 Printers ESC 0 Escape 0 (Cancel Skip Perforation) Cancels the Skip Perforation function. LPRINT CHR$(27);CHR$(79); ESC R Escape R (Clear Tabs) Resets all tab stops,both horizontal and vertical to the powered-on defaults. LPRINT CHR$(27);CHR$(82); ESC W Escape W (Double Width) Format: ESC W;n; Changes the printer to the Double Width mode when ESC W is followed by 1. This mode is not canceled by a line feed operation. It is canceled when ESC W is followed by 0 (zero). LPRINT CHR$(27);CHR$(87);CHR$(l); ESC 0 Escape Zero (l/9-Inch Line Feed) Changes the line feed to 2.82 mm (1/9 inch). LPRINT CHR$(27);CHR$(48); ESC 1 Escape One (l/9-inchLine Feed) Changes the line feed to 2.82 mm 0/9 inch). ESC 1 functions the same as ESC O. LPRINT CHR$(27);CHR$(49); ESC 2 Escape Two (Start Variable Line Feeding) Resets line spacing to 4.23 mm 0/6 inch). This is the powered-on default for vertical line spacing. LPRINT CHR$(27);CHR$(50); ESC 5 Escape Five (Sets Automatic Line Feed) With automatic line feed on, when a CR code is received, a line feed automatically follows after the carriage return. ESC 5 (1) sets auto line feed; ESC 5 (0) resets it. LPRINT CHR$(27);CHR$(53); Printers 3-145 ESC- Escape Minus (Underline) Format: ESC -;n; ESC - followed by 1, prints all of the following data with an underline. ESC - followed by 0 (zero), cancels the Underline print mode. LPRINT CHR$(27);CHR(45);CHR$(1); [or CHR$(O);] ESC < Escape Less Than (Home Head) The print head returns to the left margin to print the line following ESC <. This occurs for one line only. LPRINT CHR$(27);CHR$(60); FF Form Feed Advances the paper to the top of the next page. Note: The location of the paper, when the printer power switch is set to the On position, determines the top of the page. The next top-of-page is 279 mm (11 inches) from that position. ESC C can be used to change the page length. Always separate multiple Form Feed commands with spaces. LPRINT CHR$(12); HT Horizontal Tab Tabs to the next horizontal tab stop. Tab stops are set with ESC D. (Tab stops are automatically set at every 8 columns when the printer power switch is set to the On position.) LPRINT CHR$(9); LF Line Feed Advances the paper one line. Line spacing is 4.23 mm (1/6 inch) unless reset by ESC 0, ESC 1, ESC 2. LPRINT CHR$(10); 3-146 Printers NUL Null Used with ESC B and ESC D as terminator for the tab set and clear commands. LPRINT CHR$(O); SI Shift In (Compressed On) Changes the printer to the Compressed Character mode. This command is canceled by a DC2 code (Compressed Off). LPRINT CHR$(15); SO Shift Out (Double Width) Changes the printer to the Double Width mode. Note: A Carriage Return, Line Feed or DC4 code cancels Double Width mode. LPRINT CHR$(14); VT Vertical Tab Spaces the paper to the next vertical tab position. VT are set by the ESC B sequence. The VT command is the same as the LF command, if no tabs are set. The paper is advanced one line after printing or advanced to the next vertical tab stop. LPRINT CHR$(1l); The following charts list the printer control codes and characters in ASCII decimal numeric order, (for example, NUL is 0 and ESC W is 87). Printers 3-147 Character Set (Part 1 of 2) 3-148 Printers Character Set (Part 2 of 2) Printers 3-149 I IIII!!!!! !!b~!!:[ll<»' AoaATTT=;=:;::==:=d BOa 16 Pin C S' onnector Ignal Nam e - Description N ot Used Data Terminal Ready R equest To Send Carrier Dete=c:::t:---=-'" Data Set Ready Clear To Send NotUsed -------------- Not Used B01 Not Used B02 B03 Ground B04 Not Used Not Used Ground Not Used Data Terminal R ~ Request to SendeLad Y Looped ooped . in Cable t 0 Oat S Connec.or S .. on Cable 10 Co..er .1 Re ••, peclflcations etect 3-150 P rinters SECTION 4. COMPATIBILITY WITH THE IBM PERSONAL COMPUTER FAMILY Contents Compatibility Overview ..................... 4-3 Timing Dependencies ....................... 4-5 Unequal Configurations ..................... 4-7 Hardware Differences ...................... 4-9 User Read/Write Memory .............. 4-12 Diskette Capacity/Operation ............ 4-13 IBM PCjr Cordless Keyboard ........... 4-14 Color Graphics Capability ... . . . . . . . . . . .. 4-15 Black and White Monochrome Display ..... 4-18 RS232 Serial Port and IBM PCjr Internal Modem ............................. 4-18 Summary ............................... 4-19 4-1 Notes: 4-2 Compatibility Overview The IDM PC}r is a different Computer than the IDM Personal Computer and IBM Personal Computer XT. Even though it is different, the IDM PC}r has a high level of programming compatibility with the IBM Personal Computers. It is possible to create PC}r software applications that can run without modification on other IBM Personal Computers. In order to create such programs or to assess if a current program is compatible, you must understand the differences between the Personal Computers in the IDM family and know the proper way to communicate with them. Normally, it would be impossible for a program written for one computer to run on a different computer since the microprocessors would be different; and the language of the application could not be executed by different processors. In this case, the application would have to be re-written entirely in the language of the other processor. Since the IDM PC}r and the other IBM Personal Computers use exactly the same microprocessors (lnte18088), most assembler language programs need not be modified. This alone is not enough, since applications normally take advantage of a computers device services (BIOS) and operating system (IBM DOS 2.1). In order to allow for maximum program compatibility, the IDM PC}r has maintained all BIOS system interrupts and utilizes the same IDM DOS. This means that applications which use the BIOS and the IBM DOS interrupts on the IDM Personal Computers operate the same on the IDM PC}r. Note: The BIOS micro-code of the IBM PC}r is not identical to that of the IBM Personal Computers. If an application bypasses the BIOS interrupt calls and Overview 4-3 directly accesses routines and/or storage locations in one system, it may not run in the other system. Some routines may be similar and some BIOS storage locations may be the same. It is strongly recommended that applications use only the BIOS and DOS interrupt interfaces in order to achieve compatibility in the IBM Personal Computer family. Using the same language and the BIOS and DOS interfaces go a long way in achieving application compatibility. However, there are still several factors which need to be taken into consideration: • Timing Dependencies • Unequal Configurations • Hardware Differences 4-4 Overview Timing Dependencies Programs running in user read/write memory normally run slower on the PCjr than on the IBM Personal Computers. Programs running in read-only memory (ROM) normally run a little faster on the PCjr than on the IBM Personal Computers. This mayor may not cause a difference depending upon the application. Most applications are very I/O dependent in which case the execution time is not the critical factor and may not be noticeable. In other cases, the application runs the same but merely take a different amount of time. If an application has very critical timing dependencies, any timing differences (faster or slower) may adversely affect its usability. Using an application's program execution speed to achieve a desired timing can effect the application. In these cases, the application may need to be modified. Note: It is strongly recommended not to depend on instruction execution speed 00 achieve specific application timing. The system timer can provide short interval timing for assembly language programs. Similar timing functions are available in BASIC. Performance of specific I/O devices (such as diskette or printer) may also differ between the PCjr and the other IBM Personal Computers. You should· also avoid using timing of any I/O device as a dependency for the application. Timing Dependencies 4-5 Notes: 4-6 Timing Dependencies Unequal Configurations In designing an application to run on both the IBM PC}r and the IBM Personal Computers, you need to make sure that the required hardware configuration is available on all machines. This means the application's minimum requirements are met by all IBM Personal Computers. Unequal Configurations 4-7 Notes: 4-8 Unequal Configurations Hardware Differences To be able to run on either computer without change, an application utilizing a specific I/O device must have access to identical devices (or devices with identical operating characteristics and interfaces). The mM PCjr and the mM Personal Computers have very compatible I/O device capabilities. The following table lists the hardware features and I/O devices supported by the mM PCjr and the mM Personal Computers and summarizes the differences: Hardware Differences 4-9 Device PC PCXT PCjr PCjr Comments Maximum 640KB 640KB 128KB Shares user RAM User Memory with Video Buffer Cordless No No Yes Scan codes Keyboard compatible and full 83 key capability 83 Key Yes Yes No Compatible, but Keyboard Hardware interface differences Diskette Yes Yes Yes Compatible, but Drive different address and no DMA support Hard Disk No Yes No File Parallel Yes Yes Yes Compatible Printer RS 232 Yes Yes Yes Compatible, hex 2F8 Serial Port address, Interrupt Level 3, Baud-Rate- Frequency divisor difference Game Yes Yes Yes Compatible interface Control with potential timing differences Cassette Yes No Yes Compatible Internal No No Yes Compatible to PC Modem Serial Port hex 3F8 address, Interrupt Level 4, frequency divisor difference IBM Yes Yes No Monochrome Display Color Yes Yes Yes Compatible, with Graphics and some register Display differences and enchancements Light Pen Yes Yes Yes Compatible PCjr and Personal Computers Comparison (Part 1 of 2) 4-10 Hardware Differences Device PC PCXT PCjr PCjr Comments Attachable Yes Yes Yes Compatible Joystick 8253 Timer Yes Yes Yes Compatible (time of day) 8259 Interrupt Yes Yes Yes Some difference in interrupt levels Internal Yes Yes Yes Compatible but less Sound frequency response TI 76496 No No Yes Sound ROM No No Yes Cartridge Interface Future I/O Yes Yes Yes Compatible ROM Architecture PCjr and Personal Computers Comparison (Part 2 of 2) The hardware differences between the IBM PCjr and the IBM Personal Computers may lead to incompatibilities depending upon the specific application. Once again; if your application maintains an interface to the Personal Computer Family at the BIOS and DOS interrupt levels, then all hardware differences are handled transparently to your application. If your application goes below the BIOS level and directly addresses the hardware, then there could be an incompatibility. Hardware Differences 4-11 User Read/Write Memory Memory difference can be a problem even with programs written for the same computer, if the available memory is not the same from one machine to the next. Thus, the deciding factor is to state what the minimum memory requirement is for the application, and require that amount on the computer in question. It is important to understand the memory aspects of the IBM PCjr in relationship to that of the IBM Personal Computers. The IBM PCjr can be configured for 64K bytes or 128K bytes (with memory expansion). However, this user memory is not all available to the application. The IBM PCjr video architecture utilizes a minimum of 16K bytes (in graphic mode) and 2K bytes (in alpha numeric mode) for the screen buffer. Therefore (in graphics mode), the IBM PCjr really has 48K bytes or 112K bytes (with memory expansion) available for system software. This is not the case with the IBM Personal Computers, since the color graphics adapter contains a separate 16K byte screen buffer. Thus, a 64K bytes Personal Computer with color graphics (extra 16K bytes) is an 8DK byte system compared to a 64K byte IBM PCjr. The IBM PCjr also has graphic enhancements which allow more than the 16K bytes to be utilized for video screen buffers. If these enhanced features are used in an application, then even less is available for user memory. Another aspect of available memory is the amount taken away by operating systems and language interpreters. In the case of the IBM DOS, both the IBM PCjr and the IBM Personal Computers support the same DOS. If your application requires the BASIC interpreter, then there may be a difference. The IBM Personal Computer Cassette BASIC resides entirely in the system ROM; taking no user memory. However, Disk BASIC or Advanced BASIC utilizes 4-12 Hardware Differences approximately 10K bytes and 14K bytes respectively from user memory. In the IBM PCjr, Advanced BASIC capabilities (cartridge BASIC) reside in ROM, taking no user memory. As you can see, many items factor into user available memory requirements. The most frequent comparison is for the assembler language or compiled application using a 16K-byte screen buffer operating under DOS 2.1. In this case, an application requiring 64K bytes of user memory on an IBM Personal Computer cannot run on the IBM PCjr without its expansion memory (128K byte capability). This is because of the IBM PCjr video usage of 16K bytes. Also, any application requiring more than 112K bytes of user memory with DOS 2.1 on the IBM Personal Computers cannot run on an IBM PCjr. Diskette Capacity/Operation Since the IBM PCjr maximum stand-alone configuration is one diskette drive with a maximum capacity of 360K bytes diskette storage, an IBM PCjr application is either limited by this diskette capacity or is impacted by the user having to change diskettes more frequently. The IBM Personal Computers can have multiple diskette drives with a capacity of 360K bytes diskette storage each or even possess hard files with a much larger disk storage capacity. This capacity difference mayor may not be a concern depending upon the specific application. In terms of diskette interfacing, the IBM PCjr and the IBM Personal Computers both utilize the NEC p,PD765 floppy diskette controller, but with different hardware addresses, and the IBM PCjr does not operate through direct memory access (DMA). Since the IBM PCjr does not have DMA capability, application programs Hardware Differences 4-13 cannot overlap diskette I/O operations. When diskette I/O takes place, the entire system is masked (operator keystrokes and asynchronous communications cannot take place). Therefore, the application must insure that asynchronous operations do not take place while diskette I/O is active. IBM PCjr Cordless Keyboard The Cordless Keyboard is unique to the mM PCjr. Even though it does not possess all 83 keys of the mM Personal Computers' keyboards, it does have the capability to generate all of the scan codes of the 83-key keyboard. The following shows the additional functions available on thePCjr. PCjr Special Functions Required Key Combinations Shift screen to the left Alt + Ctrl + cursor left Shift screen to the right Alt + Ctrl + cursor right Audio Feedback (System Alt + Ctrl + Caps Lock clicks when a key is pressed. Customer Diagnostics Alt + Ctrl + Ins PCjr Special Functions For more detail see "Keyboard Encoding and Usage" in Section 5. Since all scan codes can be generated, any special application requirements can be met on the Cordless Keyboard. 4-14 Hardware Differences The highest level of compatibility to interface to keyboards is through BIOS Interrupt hex 16 (read keystroke). Below that level is risky since there are hardware differences between the PCjr keyboard and the IBM Personal Computers' keyboards. The PCjr system utilizes the non-maskable (NMI) Interrupt to deserialize the scan codes and pass it to Interrupt hex 48 for compatible mapping to 83-key format. Interrupt level 9 remains a compatible interface for 83-key scan-code handling. It is not recommended to replace Interrupt level 9 even though a high degree of compatibility is maintained. If necessary, analyze this architecture carefully. Color Graphics Capability The IBM PCjr color graphic architecture is quite different from that of the IBM Personal Computers. The main difference (as previously discussed) is that the video buffer is taken from main user memory rather than having separate memory for video (as in the IBM Personal Computers). Normally, this would be an incompatibility since applications directly address the color graphics buffer at hex B8000. However, the IBM PCjr has special hardware to redirect hex B8000 addressing to any specific 16K-byte block of its user memory. The IBM PCjr defaults the video buffer to the high end 16K-byte block of user memory and applications can continue to address the video buffer at hex B8000. In addition all IBM Personal Computers' color graphics adapter modes are BIOS compatible and memory structure (bit map) compatible. These modes are: Hardware Differences 4-15 Modes Requirements Alphanumeric: 40x25 BW None 40x25 Color None 80x25 Color Note 80x25 BW None Graphics: 320x200 4 Color None 320x200 BW None 640x200 BW None Note: PCjr requires the 64KB Memory and Display Expansion. Modes Available on the IBM Personal Computers and PCjr In addition the IBM PCjr provides some new enhanced graphic modes which are not available to the IBM Personal Computers. Modes Requirements Graphics: 320x200 16 Color Note 640x200 4 Color Note 160x200 16 Color None Note: PCjr requires the 64KB Memory and Display Expansion. Modes Available Only on PCjr The IBM PCjr and IBM Personal Computers utilize the 6845 controller, but the hardware interface is not completely the same. Hardware addresses hex 3D8 and 4-16 Hardware Differences hex 3D9 are not supported by the IBM PCjr video interface. Requests using these two addresses are not honored. Also there are differences in the actual video used by the hardware. BIOS maintains compatibility by using the appropriate PCjr video parameters (addressed through Interrupt hex ID) and maintains all video calls (through Interrupt hex 10). Application can still specify video parameter overrides by modifying Interrupt hex ID to address their own parameters; however, since there are hardware differences the recommended approach is as follows: 1. Copy the original parameters from the BIOS of the system. 2. Change only those parameters desired. 3. Consider the specific video differences between systems. Other differences to be aware of are: • The IBM PCjr defaults the colorburst mode to be off, whereas the IBM Personal Computers default colorburst to on. Thus applications should not assume either default but set colorburst mode (through BIOS call) to the desired setting. • The IBM PCjr video supports a full gray scale capability which the IBM Personal Computers do not. • There can be some color differences between the IBM Personal Computers and the IBM PCjr; especially when color mixing techniques are used. Hardware Differences 4-17 Black and White Monochrome Display The IBM PCjr does not support the mM Personal Computers black and white monochrome display. Programs which directly address the mM Personal Computers monochrome display are not compatible. For example, any direct addressing of the B&W video buffer at hex B8000 is not redirected by the mM PCjr. Applications should support Personal Computer video capabilities through BIOS, and the video buffer address is either transparent to the application or the address is provided indirectly in the BIOS data area. RS232 Serial Port and IBM PCjr Internal Modem The IBM PCjr serial port address is hex 2F8 and is associated with hardware Interrupt level 3. This is compatible with a second Asynchronous Communications Adapter on the mM Personal Computers. The Internal Modem address is hex 3F8 and is associated with Interrupt level 4. This is compatible with the first Asynchronous Communications Adapter on the mM Personal Computers. It is important to note that when the mM PCjr has the Internal Modem installed it is logically COM1 and the RS232 serial port is logically COM2 in BIOS, DOS, and BASIC. Without the Internal Modem installed the RS232 serial port is logically addressed as COM1 in BIOS, DOS, and BASIC even though its address is still hex 2F8 using Interrupt level 3. Other hardware differences on the PCjr serial devices are: • A different frequency divisor is needed to generate baud rate. This is transparent to applications using BIOS to initialize the devices (Interrupt Hex 14). • No ring indicate capability on the RS232 serial port. 4-18 Hardware Differences • Asynchronous communications input cannot be overlapped with IDM PCjr diskette I/O. Since diskette I/O operates in a non-DMA mode any asynchronous data received during diskette activity may be overrun (and lost). Thus, applications must insure that no diskette activity is active while receiving asynchronous communication data. This can be done by pacing the asynchronous device (tell it to hold from sending). The ASCII characters XOFF and XON are frequently used by some host computers for this purpose. Summary In summary, the IDM PCjr is a member of the IDM Personal Computer family by way of its strong architecture compatibility. The highest degree of application compatibility can be achieved by using a common high level language, and/ or accessing the system only through BIOS and DOS interrupts. It's not recommended to go below the BIOS level even though there are other hardware compatibilities. When it is necessary to design for particular computer differences, the application should determine at execution time which particular computer it is running on. This can be done by inspecting the ROM memory location at segment address hex FOOO and offset hex FFFE for the following values hexFF = the IDM Personal Computer hex FE = the IDM Personal Computer XT hexFD = theIDMPCjr Once determined, dual paths would handle any differences. Hardware Differences 4-19 Notes: 4-20 Hardware Differences SECTION 5. SYSTEM BIOS USAGE Contents ROM BIOS 5-3 BIOS Usage ............................. 5-5 Vectors with Special Meanings ............ 5-8 Interrupt Hex IB - Keyboard Break Address 5-8 Interrupt Hex I C - Timer Tick ......... 5-8 Interrupt Hex I D - Video Parameters .... 5-9 Interrupt Hex IE - Diskette Parameters .. 5-9 Interrupt Hex IF and hex 44 - Graphics Character Pointers ................... 5-9 Interrupt Hex 48 - Cordless Keyboard Translation . . . . . . . . . . . . . . . . . . . . . . . . . 5-10 Interrupt Hex 49 - Non-Keyboard Scan-Code Translation-Table Address ... 5-10 Other Read Write Memory Usage ........... 5-13 BIOS Programming Guidelines ........... 5-18 Adapter Cards with System-Accessible ROM-Modules ....................... 5-18 Keyboard Encoding and Usage ...•........... 5-21 Cordless Keyboard Encoding ............ 5-21 Character Codes ................... 5-26 Extended Codes. . . . . . . . . . . . . . . . . . .. 5-30 Shift States ........................ 5-31 Special Handling ...................... 5-34 System Reset ...................... 5-34 Break ............................ 5-34 Pause ............................ 5-34 Print Screen ....................... 5-34 Scroll Lock . . . . . . . . . . . . . . . . . . . . . . .. 5-35 5-1 Functions 1 thru 10 ................. 5-35 Function Lock ..................... 5-35 Screen Adjustment .................. 5-35 Enable/Disable Keyboard Click ....... 5-36 Run Diagnostics .................... 5-36 Phantom-Key Scan-Code (Hex 55) ..... 5-36 Other Characteristics ................ 5-36 Non-Keyboard Scan-code Architecture .... 5-42 BIOS Cassette Logic ...................... 5-47 Software Algorithms - Interrupt Hex 15 .... 5-47 Cassette Write ........................ 5-48 Cassette Read ........................ 5-49 Data Record Architecture ............... 5-50 Error Detection ....................... 5-51 5-2 ROM BIOS The basic input/output system (BIOS) resides in ROM on the system board and provides device-level control for the major I/O devices in the system. Additional ROM modules may be located on option adapters to provide device level control for that option adapter. BIOS routines enable the assembly-language programmer to perform block (diskette) or character-level I/O-operations without concern for device address and operating characteristics. System services, such as time-of-day and memory-size determination, are provided by the BIOS. The goal is to provide an operational interface to the system and relieve the programmer of the concern about the characteristics of hardware devices. The BIOS interface insulates the user from the hardware, allowing new devices to be added to the system, yet retaining the BIOS-level interface to the device. In this manner, user programs become transparent to hardware modifications and enhancements. The IBM Personal Computer Macro Assembler manual and the IBM Personal Computer Disk Operating System (DOS) manual provide useful programming information related to this section. ROMBIOS 5-3 Notes: 5-4 ROMBIOS BIOS Usage Access to BIOS is through the software interrupts. Each BIOS entry-point is available through its own interrupt, which can be found in "Personal Computer BIOS Interrupt Vectors", later in this section. The software interrupts, hex 10 through hex lA, each access a different BIOS-routine. For example, to determine the amount of memory available in the system, INT hex 12 invokes the BIOS routine for determining memory size and returns the value to the caller. All parameters passed to and from the BIOS routines go through the 8088 registers. The prologue of each BIOS function indicates the registers used on the call and the return. For the memory size example, no parameters are passed. The memory size, in lK byte increments, is returned in the AX register. If a BIOS function has several possible operations, the AH register is used at input to indicate the desired operation. For example, to set the time-of-day, the following code is required: MOV AH,l ;function is to set time-of-day. MOV CX,HIGH_COUNT ;establish the current MOV DX,LOW_COUNT INT lAH ;set the time. To read time-of-day: MOV AH,O ;function is to read time of day. INT lAH ;read the timer. BIOS USAGE 5-5 Generally, the BIOS routines save all registers except for AX and the flags. Other registers are modified on return, only if they are returning a value to the caller. The exact register usage can be seen in the prologue of each BIOS function. 5-6 BIOS USAGE Address . Interrupt (Hex) Number Name BIOS Entry 0-3 0 Divide by Zero D~OI 4-7 I Single Step D~OI 8-B 2 Keyboard NMI KBDNMI C-F 3 Breakpoint D~OI 10-13 4 Overflow D~OI 14-17 5 Print Screen PRINT ~CREEN 18-IB 6 Reserved D~OI ID-IF 7 Reserved D~OI 20-23 8 Time of Day TIMER-INT 24-27 9 Keyboard KB-INT 28-2B A Reserved D~OI 2C-2F B Communications D~OI 30-33 C Communications D~OI 34-37 0 Vertical retrace D~OI 38-3B E Diskette Error DISK-INT Handler 3C-3F F Printer D~OI 40-43 10 Video VIDEO-IO 44-47 II Equipment Check EQUIPMENT 48-4B 12 Memory MEMOR Y~IZE_ DETERMINE 4C-4F 13 Diskette DISKETTE-IO 50-53 14 Communications RS232-IO 54-57 15 Cassette CASSETTE-IO 58-5B 16 Keyboard KEYBOARD-IO 5C-5F 17 Printer PRINTER-IO 60-63 18 Resident BASIC F600:0000 64-67 19 Bootstrap BOOT~TRAP 68-6B lA Time of Day TIME_OFJ)AY 6C-6F IB Keyboard Break DUMMY-RETURN 70-73 IC Timer Tick DUMMY-RETURN 74-77 ID Video VIDEO--P ARMS Initialization 78-7B IE Diskette DISKjJASE Parameters 7C-7F IF Video Graphics CRT_CHARH Chars Personal Computer BIOS Interrupt Vectors BIOS USAGE 5-7 Vectors with Special Meanings The following are vectors with special meanings. Interrupt Hex IB - Keyboard Break Address This vector points to the code to be executed when Break is pressed on the keyboard. The vector is invoked while responding to the keyboard interrupt, and control should be returned through an IRET instruction. The POWER-ON routines initialize this vector to an IRET instruction, so that nothing occurs when Break is pressed unless the application program sets a different value. Control may be retained by this routine, with the following problem. The I Break I may have occurred during interrupt processing, so that one or more End I of Interrupt commands must be issued in case an I operation was underway at that time. Interrupt Hex 1C - Timer Tick This vector points to the code to be executed on every system-clock tick. This vector is invoked while responding to the timer interrupt, and control should I I be returned through an IRET instruction. The POWER-ON routines initialize this vector to point to an IRET instruction, so that nothing occurs unless the application modifies the pointer. It is the responsibility of the application to save and restore all registers that are modified. 5-8 BIOS USAGE Interrupt Hex ID - Video Parameters This vector points to a data region containing the parameters required for the initialization of the 6845 CRT Controller. 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 parameters contained in the ROM video-routines. It is recommended that if a programmer wishes to use a different parameter table, that the table contained in ROM be copied to RAM and just modify the values needed for the application. Interrupt Hex IE - 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 may be necessary to reflect the specifications of the other drives attached. It is recommended that if a programmer wishes to use a different parameter table, that the table contained in ROM be copied to RAM and just modify the values needed for the application. The motor start-up-time parameter (parameter to) is overridden by BIOS to force a 500-ms delay (value 04) if the parameter value is less than 04. Interrupt Hex IF and hex 44 - Graphics Character Pointers When operating in the graphics modes, the BIOS USAGE 5-9 read/write-character interface forms the character from the ASCII code-point, using a table of dot patterns where each code point is comprised of 8 bytes of graphics information. The table of dot patterns for the first 128 code-points contained in ROM is pointed to by Interrupt Hex 44 and the second table of 128 code-points contained in ROM is pointed to by Interrupt Hex IF. The user can change this vector to point to his own table of dot patterns. It is the responsibility of the user to restore these vectors to point to the default code-point-tables at the termination of the program. Interrupt Hex 48 - Cordless Keyboard Translation This vector points to the code responsible for translating keyboard scan-codes that are specific to the Cordless Keyboard. The translated scan-codes are then passed to the code pointed to by Interrupt Hex 9 which then handles the 83-key Keyboard scan codes. Interrupt Hex 49 - Non-Keyboard Scan-Code Translation-Table Address This interrupt contains the address of a table used to translate non-keyboard scan-codes (scan codes greater than 85 excluding 255.) If Interrupt hex 48 detects a scan code greater than 85 (excluding 255) it translates it using the table pointed to by Interrupt Hex 49. The address that Interrupt Hex 49 points to can be changed by users to point to their own table if different translations are required. 5-10 BIOS USAGE Note: It is recommended that a programmer save default pointers and restore them to their original values when the program has terminated. BIOS USAGE 5-11 Notes: 5-12 BIOS USAGE Other Read Write Memory Usage The IBM BIOS routines use 256 bytes of memory starting at absolute hex 400 to hex 4FF. Locations hex 400 to 407 contain the base addresses of any RS-232C attachments to the system. This includes the optional IBM PCjr Internal Modem and the standard RS232 serial-port. Locations hex 408 to 40F contain the base addresses of any parallel printer attachments. Memory locations hex 300 to 3FF are used as a stack area during the power-on initialization, and bootstrap, when control is passed to it from power-on. If the user desires the stack in a different area, the area must be set by the application. The following is a list of the interrupts reserved for BIOS, DOS, and BASIC. Other Memory Usage 5-13 Address Interrupt (Hex) (Hex) Function 80-83 20 DOS Program Terminate 84-87 21 DOS Function Call 88-8B 22 DOS Terminate Address 8C-8F 23 DOS Ctrl Break 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-ll5 40-43 Reserved for BIOS 116-ll9 44 First 128 Graphics Characters 120-131 45-47 Reserves for BIOS 132-135 48 Cordless-Keyboard Translation 136-139 49 N on- key board Scan-code Translation Table 140-17F 50-5F Reserved for BIOS 100-17F 40-5F Reserved for BIOS 180-19F 60-67 Reserved for User Software Interrupts lAO-l FF 68-7F Reserved 200-217 80-85 Reserved for Basic 218-3C3 86-FO U sed by Basic Interpreter while BASIC is running 3C4-3FF FI-FF Reserved BIOS, BASIC, and DOS Reserved Interrupts The following is a list of reserved memory locations. 5-14 Other Memory Usage Address (Hex) Mode Function 400-48F ROM BIOS See BIOS Listing 490-4EF Reserved for System Usage 500-5FF Communication Area for any application 500 DOS Reserved for DOS and BASIC, Print Screen Status Flag Store, O-Print Screen Not Active or Successful Print Screen Operation, I-Print Screen In Progress, 255-Error Encountered During Print Screen Operation, 504 DOS Single Drive Mode Status Byte 510-511 BASIC BASIC'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 Reserved Memory locations The following is a list of the BASIC workspace variables. Other Memory Usage 5-15 If you do DEF SEG (Default workspace Offset· segment): (Hex) Length Line number of current line being executed 2E 2 Line number of last error 347 2 Offset into segment of start of program text 30 2 Offset into segment of start of variables 358 2 (end of program text 1-1) Keyboard buffer contents 6A I if O-no characters in buffer if I-characters in buffer Character color in graphics mode 4E I Set to I, 2, or 3 to get text in colors I to 3. Do not set to O. (Default =3) Example 100 Print Peek (&H2E) + 256*Peek (&H2F) ) L H ( 100 I hex 64 I hex 00 I BASIC Workspace Variables The following shows the mapping of the BIOS memory 5-16 Other Memory Usage Starting Address in Hex 00000 BIOS Interrupt Vectors 00400 BIOS Data Area 00500 User ReadlWrite Memory AOOOO Reserved for Future Video B8000 Reserved for Video COOOO Reserved for Future 1/0 ROM 00000 Reserved for Cartridges EOOOO Reserved for Cartridges FOOOO BIOSI Diagnosticsl Cassette and BASIC Program Area BIOS System Map Other Memory Usage 5-17 BIOS Programming Guidelines The BIOS code is invoked through software interrupts. The programmer should not I hard code I BIOS addresses into applications. The internal workings and absolute addresses within BIOS are subject to change without notice. If an error is reported by the diskette code, you should I reset I the drive adapter and retry the operation. A specified number of retries should be required on diskette I reads I to insure the problem is not due to motor start-up. When altering I/O-port bit-values, the programmer should change only those bits which are necessary to the current task. Upon completion, the programmer should restore the original environment. 'Failure to adhere to this practice may be incompatible with present and future systems. Adapter Cards with System-Accessible ROM-Modules The ROM BIOS provides a facility to integrate adapter cards with on-board ROM-code into the system. During the Power-On Self-Test (POST), interrupt vectors are established for the BIOS calls. Mter the default vectors are in place, a scan for additional ROM modules takes place. At this point, a ROM routine on the adapter card may gain control. The routine may establish or intercept interrupt vectors to hook themselves into the system. The absolute addresses hex COOOO through hex DOOOO are scanned in 2K-byte blocks in search of a valid adapter card ROM. A valid ROM is defined as follows: 5-18 Other Memory Usage Byte 0: hex 55 Byte 1: hexAA Byte 2: length (multiple of 2K bytes) - A length indicator representing the number of 512-byte blocks in the ROM (length/512). A checksum is also done to test the integrity of the ROM module. Each byte in the defined ROM is summed modulo hex 100. This sum must be 0 for the module to be deemed valid. When the POST identifies a valid ROM, it does a 'far call' to byte 3 of the ROM (which should be executable code). The adapter card may now perform its power-on initialization-tasks. The feature ROM should return control to the BIOS routines by executing a 'far return' . Other Memory Usage 5-19 Notes: 5-20 Other Memory Usage Keyboard Encoding and Usage The following explains how the keyboard interacts with BIOS and how 83-key-keyboard functions are accomplished on the Cordless Keyboard. Cordless Keyboard Encoding The KEYBOARD routine provided by IBM in the ROM BIOS is responsible for converting the keyboard scan-codes into what is termed "Extended ASCII. " Extended ASCII encompasses one-byte character-codes with possible values of 0 to 255, an extended code for certain extended keyboard-functions, and functions handled within the KEYBOARD routine or through interrupts. The following is the physical layout of the IBM PCjr Cordiess Keyboard. Keyboard Encoding 5-21 Fn --- - ---- -- ---- 58 ----- --_.-- --- --- IBM PCjr Cordless Keyboard Diagram The following are charts of the scan codes for the IBM PC}r Cordless Keyboard. Make Break Key Keyboard Code Code Position Characters (Hex) (Hex) 1 ESC 1 81 2 If! 2 82 3 2/a 3 83 4 3/# 4 84 5 4/$ 5 85 6 5/% 6 86 7 6/ A 7 87 8 7/& 8 88 9 8/* 9 89 10 9/( A 8A 11 OJ) B 8B 12 -/- C 8C 13 =/+ 0 8D 14 BS<_ E 8E 15 FN 54 04 16 TAB F 8F 17 q/Q 10 90 18 w/W 11 91 19 e/E 12 92 20 r/R 13 93 21 tiT 14 94 22 y/y 15 95 23 u/U 16 96 24 i/ I 17 97 25 0/0 18 98 26 piP 19 99 27 [I{ lA 9A 28 ]j} IB 9B 29 ENTER Ie 9C 30 CTRL 10 90 31 a/A IE 9E Cordless Keyboard Maxtrix Scan Codes (Part 1 of 2) Keyboard Encoding 5-23 Make Break Key Keyboard Code Code Position Characters (Hex) (Hex) 32 siS IF 9F 33 djO 20 AO 34 fjF 21 Al 35 gjG 22 A2 36 hjH 23 A3 37 jl J 24 A4 38 k/K 25 A5 39 1/ L 26 A6 40 ,.;-. 27 A7 41 '/ " 28 A8 42 CUR.UP 48 C8 43 LF.SHIFT 2A AA 44 z/Z 2C AC 45 x/X 20 AD 46 c/C 2E AE 47 v/V 2F AF 48 biB 30 BO 49 n/N 31 BI 50 m/M 32 B2 51 ,1< 33 B3 52 ·1> 34 B4 53 //? 35 B5 54 RT.SHIFT 36 B6 55 CUR.LF. 4B CB 56 CUR.RT. 40 CO 57 ALT. 38 B8 58 SP.BAR 39 B9 59 CAPS LOCK 3A BA 60 INSERT 52 02 61 DELETE 53 03 62 CUR.DWN. 50 DO Phantom-Key Scan Code 55 Cordless Keyboard Matrix Scan Codes (Part 2 of 2) 5-24 Keyboard Encoding The Cordless Keyboard is unique to the PCjr. Even though it does not possess all 83 keys of the IBM Personal Computer keyboard, it does have a way in which you can cause all of the scan codes of the 83-key keyboard. The following chart shows the mapping of functions between both keyboards: IBM Personal Computers IBM PCjr 83-key Keyboard Function Cordless Keyboard Mapping FI-FIO Function key + 1-0 (FI-FIO) Ctrl Break Function key + B (Break) Ctrl PrtSc (Echo Print) Function key + E (Echo) Shift PrtSc (Print Screen) Function key + P (PrtSc) Ctrl NumLock (Pause) Function key + Q (Pause) Scroll Lock Function key + S (ScLock) Numeric keypad region: Num Lock (Number Alt + Function key + N (I keypad I through 10 through 0 becomes numeric-key becomes key scan codes.) scan-codes) PgUpkey Function key + cursor left (PgUp) PgDn key Function key + cursor right (PgDn) Home key Function key + cursor up (Home) End key Function key + cursor down (End) Numeric keypad - sign Function key plus the - sign Numeric keypad + sign Function key + = sign \ key Alt + / , key Alt + ' ! key Alt + [ ~ key Alt + ] * with PrtSc Alt + . Numeric keypad. Shift + Del All 256 extended codes: NumLock then Alt + numeric Alt + numeric value value (I through 0) from numeric keypad 83-key-Keyboard Function to Cordless-Keyboard Mapping Keyboard Encoding 5-25 Character Codes The following character codes are passed through the BIOS KEYBOARD-routine to the system or application program. A -1 means the combination is suppressed in the KEYBOARD routine. The codes are returned in AL. See Appendix C, "Characters, Keystrokes,and Color" for the exact codes. 5-26 Keyboard Encoding Key Base Upper Number Case Case Ctrl Alt Fn I Esc Esc Esc -I ** 2 I ! -I *,***** (FI) *,*** 3 2 a Nul (000) *,***** (F2) *, *** 4 3 # -1 *,***** (F3) 5 4 $ -1 *,***** (F4) *, *** 6 5 % -1 *,***** (F5) *,*** 7 6 ~ RSO (030) *,***** (F6) *, *** 8 7 & -1 *,***** (F7) *, *** 9 8 * -1 *,***** (F8) *,*** 10 9 ( -I *,***** (F9) *, *** II 0 ) -I *,***** (FlO) *,*** 12 - - US (03 I) * *** 13 = + -1 * *** 14 Backspace Backspace DEL (127) -I -I (008) (008) 15 Fn -I -I -1 -I -I 16 ->/ (009) 1<-* -I -I -I 17 q Q DCI (017) * ** ,*** (Pause) 18 w W ETB (023) * -I 19 e E ENQ (005) * ** ,*** (Echo) 20 r R DC2 (018) * -I 21 t T DC4 (020) * -I * - Refer to "Extended Codes" in this section. ** - Refer to "Special Handling" in this section. *** - Refer to "83-Key Keyboard functions to Cordless Keyboard Mapping Chart. " **** - Uppercase for cursor keys can be selected by pressing left or right shift or entering the NumIock state (Alt + Fn + N). ***** - When AIt is pressed and the keyboard is in the Numlock state, the upper row of digits is used to enter ASCII codes for generating any character from the extended ASCII character set. Cordless-Keyboard Character Codes (Part 1 of 4) Keyboard Encoding 5-27 Key Base Upper Number Case Case Ctrl Ait Fn 22 y y EM (025) * -I 23 u U NAK (021) * -I 24 I I HT (009) * -I 25 0 0 SI (015) * -I 26 P P DLE (016) * ** ,*** (PrtScreen) 27 [ { Esc (027) (I) *** -I 28 ] } GS (029) (~) *** -1 29 CR CR LF (010) -1 -1 30 Ctrl -1 -1 -1 -I -1 31 a A SOH (001) * -I 32 s S DC3 (019) * ** ,*** (Scroll Lock) 33 d D EOT (004) * -1 34 f F ACK (006) * -1 35 g G BELL (007) * -1 36 h H BS (008) * -1 37 J J LF (010) * -1 38 k K VT(Oll) * -1 39 1 L FF (012) * -1 40 , -1 -1 -1 , 41 " -1 (') *** 1 * - Refer to "Extended Codes" in this section. ** - Refer to "Special Handling" in this section. *** - Refer to "83-Key Keyboard functions to Cordless Keyboard Mapping Chart." **** Uppercase for cursor keys can be selected by pressing - left or right shift or entering the Num10ck state (Alt + Fn + N). ***** - When A1t is pressed and the keyboard is in the Numlock state, the upper row of digits is used to enter ASCII codes for generating any character from the extended ASCII character set. Cordless-Keyboard Character Codes (Part 2 of 4) 5-28 Keyboard Encoding Key Base Upper Alt + Number Case Case Ctrl AU Fn Ctrl 42 Cur.Up* 8 **** -I * ** ,*** (Home) 43 Left -1 -1 -1 -I -1 Shift 44 z z SUB (026) * -I 45 x X CAN (024) * -1 46 c C EXT (003) * -1 47 v V SYN (022) * -1 48 b B STX (002) * ** ,*** (Break) 49 n N SO (014) * ,*** *** 50 m M CR (013) * -1 51 < -1 -I -1 52 > -1 (*) * -1 53 / ? -1 \ -1 54 Right -I -I -1 -I Shift 55 Cur.L * 4 **** * * ** , *** ** Reverse (PgUp) Word 56 Cur.R * 6 **** * * ** ,*** ** Advance (PgOn) Word ** * - Refer to "Extended Codes" in this section. ** - Refer to "Special Handling" in this section. *** Refer to "83-Key Keyboard functions to Cordless Keyboard Mapping Chart." **** - Uppercase for cursor keys can be selected by pressing left or right shift or entering the Numlock state (Alt + Fn + N). ***** - When Alt is pressed and the keyboard is in the Numlock state, the upper row of digits is used to enter ASCII codes for generating any character from the extended ASCII character set. Cordless-Keyboard Character Codes (Part 3 of 4) Keyboard Encoding 5-29 Key Base Upper Alt + Number Case Case Ctr) Ait Fn Ctr) 57 Alt -1 -1 -1 -1 -1 58 Space Space Space Space Space 59 Caps -1 -1 -1 -1 -1 ** Lock 60 Ins. 0**** -1 * -1 ** 61 Del. * **** -1 * -I ** 62 Cur.Dn * 2 **** -1 * ** ,*** End * - Refer to "Extended Codes" in this section. ** - Refer to "Special Handling" in this section. *** - Refer to "83-Key Keyboard functions to Cordless Keyboard Mapping Chart." **** - Uppercase for cursor keys can be selected by pressing left or right shift or entering the Numlock state (Alt + Fn + N). ***** - When Alt is pressed and the keyboard is in the Numlock state, the upper row of digits is used to enter ASCII codes for generating any character from the extended ASCII character set. Cordless-Keyboard Character Codes (Part 4 of 4) Extended Codes An extended code is used for certain functions that cannot be represented in the standard ASCII code. A character code of 000 (Nul) is returned in AL. This indicates that the system or application program should examine a second code that indicates the actual function. This code is returned in AH. This is the same for both the Cordless Keyboard and 83-key keyboard. 5-30 Keyboard Encoding Second Code Function 3 Nilll Character 15 ~ 16 through 25 Alt Q, W, E, R, T, Y, U, I, 0, P 30 through 38 Alt A, S, D, F, G, H, J, K, L 44 through 50 Alt Z, X, C, V, B, N, M 59 through 68 Fn + 1,2,3,4,5,6, 7, 8,9,0 (Functions I through 10) 71 Home 72 Up Arrow 73 Page Up 75 ~ (Cursor Left) 77 ~ (Cursor Right) 79 End 80 Down Arrow 81 Page Down 82 Ins (Insert) 83 Del (Delete) 84 through 93 F11 through F20 (Upper Case Fl through FlO) 94 through 103 F21 through F30 (Ctrl Fl through FlO) 104 through 113 F31 through F40 (Alt Fl through FlO) 114 FnjE or CtrljFnjP (StartjStop Echo to Printer) 115 Ctrl...r.- (Reverse Word) 116 Ctrl ~ (Advance Word) 117 Ctrlj End [Erase End of Line (EOL)] 118 Ctrlj PgDn [Erase to End of Screen (EOS)] 119 Ctrlj Home (Clear Screen and Home) 120 through 131 Altj 1,2,3,4,5,6, 7, 8, 9, 0, -, = (Keys 2 through 13) 132 CtrljPgUp (Top 25 Lines of Text and Home Cur.) 133 through 149 Reserved 150 through 190 Reserved for Non-Keyboard Scan Codes Cordless Keyboard Extended Functions Shift States Most shift states are handled within the KEYBOARD routine, transparent to the system or application Keyboard Encoding 5-31 program. The current set of active shift states is available by calling an entry point in the ROM I I KEYBOARD-routine. The following keys result in altered shift-states: Shift This key temporarily shifts keys 2 thru 13, 16 thru 28, 31 thru 41, and 44 thru 53 to upper case (base case if in Caps Lock state). The Shift key temporarily reverses the Num Lock or non-Num-Lock state of keys 42, I I I I 55,56, and 60 thru 62. etr) This key temporarily shifts keys 3, 7, 12, 14, 16 thru 28, 30 thru 38, 42, 44 thru 50, 55, and 56 to the Ctrl state. The Ctri key is used with the Alt and Del keys to cause the System Reset function, with the Scroll I I Lock key to cause the Break function, with the Num I I Lock key to cause the Pause function, with the Alt I I and Cursor Left or Right for screen adjustment withI I , Alt and Ins to activate diagnostics and with Alt and I I , CapsLock to activate keyboard clicking These I I. functions are described in "Special Handling" on the following pages. Alt The Alt key temporarily shifts keys 2 thru 13, 17 thru 26, 31 thru 39, and 44 thru 50 to the Alternate state I I • The Alt key is used with the Ctrl and Del keys to cause the System Reset function described in "Special I I Handling" on the following pages.· The Alt key is also used with keys 27, 28, 41, and 53 to produce the characters under the key. 5-32 Keyboard Encoding The Alt key has another use. This key allows the user to enter any character code from 0 to 255 into the system from the keyboard. The user must first put the keyboard in the I Num Lock I state (concurrently press, first Alt then Fn + n). Then while holding down the Alt key type the decimal value of the character desired using keys 2 thru 11. The Alt key is then released. If more than three digits are typed, a modulo-256 result is created. These three digits are interpreted as a character code and are transmitted through the KEYBOARD routine to the system or application program. Alt is handled internal to the KEYBOARD routine. Caps Lock This key shifts keys 17 thru 25,31 thru 39, and 44 thru 50 to I upper case I . A second press of the Caps Lock key reverses the action. Caps Lock is handled internal to the KEYBOARD routine. Shift-Key Priorities and Combinations The following keys are listed in descending priority for translation in Interrupt Hex 48 and Interrupt hex 9 respectively: 1. Interrupt Hex 48- a. Alt key b. Ctrl key c. Shift key 2. Interrupt Hex 9 a. Ctrl b. Alt c. Shift Keyboard Encoding S-33 Of the three keys listed, only Alt and Ctrl are a valid combination. If any other combination of the three keys is used, only the key with the higher priority is recognized by the system. Special Handling System Reset The combination of the All, Ctrl, and Del keys causes the KEYBOARD routine to initiate the equivalent of a I System Reset I • Break The combination of the Fn and B keys results in the KEYBOARD routine signaling Interrupt Hex lA. The extended characters (AL = hex 00, AH = hex 00) are returned. Pause The combination of the Fn and Q keys causes the KEYBOARD-interrupt routine to loop, waiting for any key to be pressed. This provides a system or application-transparent method of temporarily suspending an operation such as list or print and then resuming the operation by pressing any other key. The key pressed to exit the I Pause I mode is unused otherwise. Print Screen The combination of the Fn and P keys results in an interrupt, invoking the PRINT SCREEN routine. This 5-34 Keyboard Encoding routine works in the alphanumeric or graphics mode, with unrecognizable characters printing as blanks. Scroll Lock The combination of the Fn and S key is interpreted by appropriate application programs to indicate that the cursor-control keys should cause windowing 'over the I text rather than cursor movement. Pressing the I Scroll Lock combination a second time reverses the action. I The KEYBOARD routine simply records the current shift state of Scroll Lock It is the responsibility of I I. the system or application program to perform the function. Functions 1 tbm 10 The combination of the Fn key (15) and one of keys 2 thru 11 results in the corresponding Function with I I key 2 being 'F 1 I up to key 11 being I F 10 I • Function Lock Concurrently pressing first the Fn key and Shift key, and then pressing the Esc key causes keys 2 thru 11 to shift to their Function states and remain there until I I the same combination is pressed again. Screen Adjustment The combination of the Alt key, etrl key, and either the Left or Right cursor movement key causes the screen to shift one character in the corresponding direction, up to a maximum of four. Keyboard Encoding 5-35 Enable/Disable Keyboard Click The combination of the Alt, Ctrl, and Caps Lock keys causes the keyboard audio feedback (click) to shift between 'on' and 'off'. The Power-On default is 'off'. Run Diagnostics The combination of the Alt, Ctrl, and Ins keys causes the system diagnostics stored in ROM to be initiated. Phantom-Key Scan-Code (Hex 55) The Phantom-Key scan-code is generated by the keyboard when an invalid combination of three or more keys is pressed. The keys pressed that caused the Phantom-Key scan-code are not put into the keyboard buffer, and are ignored by the keyboard microprocessor. The Phantom-Key scan-code is transmitted to BIOS where it is ignored. Other Characteristics The keyboard buffer is large enough to support a fast typist. If a key is pressed when the buffer is full, the character generated is ignored and the 'bell' is sounded. A larger buffer can be specified by modifying words at labels 'Buffer-Start' (hex 480) and 'Buffer-End' (hex 482) to point to another offset within segment hex 40. The KEYBOARD routine suppresses the typematic action of the following keys: CtrI, Shift, Alt, Caps Lock, Insert, and Function. 5-36 Keyboard Encoding Key Function Combinations Description System Reset Alt + Ctrl + Del Unconditional system reset Break Fn + B Breaks program execution Pause Fn+Q Resumable pause in program execution Print Screen Fn + P Function Lock Fn and Shift Locks the number keys as then Esc (Held) Function keys (FI-FIO) concurrently) and B, Q, P, E, S, and the cursor control keys to their function states Screen Alt + Ctrl + Allows the user to adjust Adjustment cursor right or the display's image left or cursor left right Keyboard Click Alt + Ctrl + Enables or disables the CapsLock keyboard audio feedback click Run Diagnostics Alt + Ctrl + Ins Initiates system ROM diagnostics Keyboard Esc If the first key pressed Adventure after the system comes up Game in Cassette BASIC is Esc (key #1) then the Keyboard Adventure Game will be activated. Cassette Ctrl + Esc If this is the first key Autoload sequence after the system comes up in Cassette BASIC then the screen will display 'Load "CAS1:",R followed by a Carriage Return. This allows a cassette program to be automatically loaded. Cordless Keyboard Special Handling Keyboard Encoding 5-37 Keyboard Usage "Keyboard Usage" is a set of guidelines of key-usage when performing commonly-used functions. Function Keys Comment Home Cursor Fn Home Editors; word processors Return to Fn Home Menu driven applications outermost menu Move cursor up Up Arrow Full screen editor, word processor Page up, scroll Fn PgUp Editors; word processors backwards 25 lines Move cursor left 6-.. Text, command entry Move cursor right -.... Text, command entry Scroll to end of text Fn End Editors; word processors place cursor at end of line Move cursor down Down Arrow Full screen editor, word processor Page down, scroll Fn PgDn Editors; word processors forwards 25 lines and home Start/ Stop insert Ins Text, command entry text at cursor, shift text right in buffer Keyboard - Commonly Used Functions (Part 1 of 3) 5-38 Keyboard Encoding Function Keys Comment Delete character at Del Text, command entry cursor Destructive 4 - Key 14 Text, command entry backspace Tab forward ~ Text entry Tab reverse ,......- Text entry Clear screen and Ctrl Fn home Home Scroll up Up Arrow In scroll lock mode Scroll down Down Arrow In scroll lock mode Scroll left ....&-... In scroll lock mode Scroll right ---... In scroll lock mode Delete from cursor Ctrl Fn Text, command entry to EOL (end of line) End Exit/ Escape Esc Editor, I level of menu and so on Start/Stop Echo Fn PrtSc Any time screen to printer Delete from cursor Ctrl Fn Text, command entry to EOS (end of PgDn screen) Advance word Ctrl~ Text entry Reverse word Ctrl ~ Text entry Window Right Ctrl ---... When text is too wide to fit the screen Keyboard - Commonly Used Functions (Part 2 of 3) Keyboard Encoding 5-39 Function Keys Comment Window Left C t r I <011&..- When text is too wide to fit the screen Enter insert mode Ins Line Editor Exit insert mode Ins Line Editor Cancel current Esc Command entry, text line entry Suspend system Ctrl Fn Stop list, stop program, (Pause) Pause and so on. Resumes on any key. Break interrupt Fn Break Interrupt current process System reset Alt Ctrl Del Reboot Top of document Ctrl Fn Editors, word processors and home cursor PgUp Standard function Shift Fnl FI Primary function keys keys through Fnl FlO Secondary Shift FI-FIO Extra function keys if 10 function keys Ctrl FI-FIO are not sufficient. Alt FI-FIO Extra function Alt keys Line Editor keys 2 through 13 (I through 9,0) (~, =) Extra function Alt A Used when function starts keys through Z with the same letter as one of the alpha keys. Keyboard - Commonly Used Functions (Part 3 of 3) 5-40 Keyboard Encoding Function Key Carriage return ....J (Enter) Line feed Ctrl ....J (Enter) Bell Ctrl G Home Fn Home Cursor up Up Arrow Cursor down Down Arrow Cursor left ~ Cursor right ~ Advance one word Ctrl A - - Reverse one word Ctrl ----A. Insert Ins Delete Del Clear screen Ctrl Fn Home Freeze output Fn Pause Tab advance ~ Stop Execution (break) Fn Break Delete current line Esc Delete to end of line Ctrl Fn End Position cursor to end of line Fn End BASIC Screen Editor Special Functions Keyboard Encoding 5-41 Function Key Suspend Fn Pause Echo to printer Fn Echo Stop echo to printer Fn Echo Exit current function (break) Fn Break Backspace, +-- Key 14 Line feed Ctrl AJ (Enter) Cancel line Esc Copy character Fn FI o r - Copy until match Fn F2 Copy remaining Fn F3 Skip character Del Skip until match Fn F4 Enter insert mode Ins Exit insert mode Ins Make new line the template Fn F5 String separator in REPLACE Fn F6 End of file in keyboard input Fn F6 DOS Special Functions Non-Keyboard Scan-code Architecture The architecture of the IBM PCjrBIOS is designed to also receive scan codes above those generated by the keyboard to accommodate any future device. The keyboard generates scan codes from hex 1 to 55 and FF. Any scan codes above hex 55 (56 thru 7E for Imake codes and D6 thru FE for break codes) are I I I processed by BIOS in the following manner: 1. If the incoming I make I scan code falls within the range of the translate table, whose address is pointed to by BIOS Interrupt Hex 49, it is translated into the corresponding scan code. Any incoming Ibreak codes above hex D5 are ignored. I 5-42 Keyboard Encoding 2. If the new translated scan code is less than hex 56, it is processed by BIOS as a keyboard scan-code and the same data is placed in the BIOS keyboard buffer. 3. If the translated scan-code is greater than hex 55 or the incoming scan-code is outside the range of the translate table, hex 40 is added, creating a new extended-sean-code. The new extended-sean-code is then placed in the BIOS keyboard buffer with the character code of OO(null). This utilizes the range hex 96 th..--u BE for scan codes hex 56 thru 7E respectively. The default translate-table maps scan codes hex 56 thru 6A to existing keyboard-values. Scan codes hex 6B thru BE are mapped (by adding hex 40) to extended codes of hex AB thru FE, since these are out side the range of the default translate-table. Users can modify Interrupt Hex 49 to address their own translate table if mapping differences are desired. The translate table format is: Description o Length - The number of non-keyboard scan-codes that are mapped within the table (from 1 to n). 1 to n Word with low-order byte representing the scan-code-mapped values relative to the input values in the range of hex 56 thru 7E. Keyboard Encoding 5-43 ---8-Bits--- r 1 Length =1 to n I High Byte - 0 (NUL) Low Byte - Scan Code High Byte - 0 (NUL) 2 Low Byte - Scan Code High Byte - 0 (NUL) 3 Low Byte - Scan Code • • • • • • • • • • High Byte - 0 (NUL) n Low Byte - Scan Code Translate Table Format With this architecture, all keyboard scan-codes can be intercepted thru Interrupt Hex 9 and all non-keyboard scan-codes can be intercepted thru Interrupt Hex 48. The following is a chart showing the default values of the translate table in BIOS. 5-44 Keyboard Encoding Length = 20 mapped values Input Mapped Keyboard Scan Code Value Character 86 72 (cursor up) 87 73 PgUp 88 77 (cursor right) 89 81 PgOn 90 80 (cursor down) 91 79 End 92 75 (cursor left) 93 71 Home 94 57 Space 95 28 Enter 96 17 W 97 18 E 98 31 S 99 45 X 100 44 Z 101 43 \ 102 30 A 103 16 Q 104 15 Tab 105 1 Esc Translate Table Default Values Scan Codes (Hex) Type of Scan Code 1 - 55 Normal Keyboard Scan Code (Make) 56 -7E N on-Keyboard Scan Code (Make) 81 - 05 Normal Keyboard Scan Code (Break) 06-FE N on-Keyboard Scan Code (Break) FF Keyboard Buffer Full Scan-Code Map Keyboard Encoding 5-45 Notes: 5-46 Keyboard Encoding BIOS Cassette Logic Software Algorithms - Interrupt Hex 15 The CASSETTE routine is called by the request type in AH. The address of the bytes to be I read I from or I written I to the tape is specified by DS:BX and the number of bytes to be I read I or I written I is specified by CX. The actual number of bytes I read I is returned in DX. The read block and write block automatically tum the cassette motor on at the start and off at the end. The request types in AH and the cassette status descriptions follow: Request Type Function AH =0 Turn Cassette Motor On AH = 1 Turn Cassette Motor Off AH =2 Read Tape Block Read CX bytes into memory starting at Address DS:BX Return actual number of bytes read in DX Return Cassette Status in AH AH = 3 Write Tape Block Write CX bytes onto cassette starting at Address DS: BX Return Cassette Status in AH AH Request Types BIOS Cassette Logic 5-47 Cassette Status Description AH =00 No Errors AH = 01 Cyclic Redundancy Check (CRC) Error in Read Block AH =02 No Data Transitions AH =04 No Leader AH = 80 Invalid Command Note: The carry flag will be set on any error. AH Cassette Status Cassette Write The WRITE-BLOCK routine 'writes' a tape block onto the cassette tape. The :tape block is described in "Data Record Architecture" later in this section. The WRITE-BLOCK routine 'turns on' the cassette drive motor and' writes' the leader (256 bytes of all l's) to the tape, 'writes' a synchronization bit (0), and then 'writes' a synchronization byte (ASCII character hex 16). Next, the routine 'writes' the number of data bytes specified by CX. After each data block of 256 bytes, a 2-byte cyclic redundancy check (CRC) is , written'. The data bytes are taken from the memory location 'pointed' at by DS:BX. The WRITE-BLOCK routine 'disassembles' and 'writes' the byte 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 1 bit and 0.5 millisecond for a 0 bit. 5-48 BIOS Cassette Logic The timer is I set I to mode 3, which means the timer outputs a square wave with a period given by its count register. The timer's period is changed on the fly for each data byte written to the cassette. If the number I I of data bytes to be I written I is not an integral multiple of 256, then, after the last desired data byte from memory has been written the data block is extended I I , to 256 bytes of writing multiples of the last data byte. The last block is closed with two CRC bytes as usual. After the last data-block, a trailer consisting of four bytes of all 1 bits is written Finally, the cassette I I. motor is turned off if there are no errors reported by I I , the routine. All 8259 interrupts are I disabled I during cassette-write operations. j-250/15 -j J I I Zero Bit ~500/15-1 JI.. --lone L . . . - - I 1 0 0 0 / 1 5 - - - - - - - -__1 Bit Cassette-Write Timing Chart Cassette Read The READ-BLOCK routine I turns on I the cassette drive motor and then delays for approximately 0.5 second to allow the motor to come up to speed. The READ-BLOCK routine then searches for the leader and must detect all 1 bits for approximately 1/4 of the leader length before it can look for the sync (0) bit. After the sync bit is detected, the sync byte BIOS Cassette Logic 5-49 (ASCII character hex 16) is 'read'. If the sync byte is , read' correctly, the data portion can be 'read'. If a correct sync byte is not found, the routine goes back and searches for the leader again. The data is 'read' a bit-at-a-time and 'assembled' into bytes. After each byte is 'assembled', it is 'written' into memory at location DS:BX and BX is incremented by 1. After each multiple of 256 data bytes is 'read', the CRC is 'read' and 'compared' to the CRC generated. If a CRC error is detected, the routine exits with the carry flag 'set' to indicate an error and the status of AH 'set' to hex 01. DX contains the number of bytes 'written' into memory. All 8259 interrupts are 'disabled' during the cassette- ' read' operations. Data Record Architecture The WRITE-BLOCK routine uses the following format to record a tape block onto a cassette tape: (CASSETTE TAPE BLOCK) Leader Sync Sync Data CRC Data CRC Bit Byte Block Block I Motor I Motor On Off Cassette Write- Block Format 5-50 BIOS Cassette Logic Component Description Leader 256 Bytes (of All 1's) Sync Bit One 0 bit Sync Byte ASCII Character hex 16 Data Blocks 256 Bytes in Length CRC 2 Bytes for each Data Block Data Record Components Error Detection Error detection is handled through software. A eRe is used to detect errors. The polynomial used is G(X) = X16 + X12 + X5 + 1, which is the polynomial used by the synchronous data link: control interface. Essentially, as bits are I written I to or I read I from the cassette tape they are passed through the eRe register in software. After a block of data is I written I , the complemented value of the calculated eRe register is I written I on the tape. Upon reading the cassette data, the eRe bytes are I read I and I compared I to the generated eRe value. If the read eRe does not equal the generated eRe, the processor's carry flag is setI I and the status of AH is set to hex 01, which indicates I I a eRe error has occurred. Also, the routine is exited on a eRe error. BIOS Cassette Logic 5-51 Notes: 5-52 BIOS Cassette Logic Appendixes Contents Appendix A. ROM BIOS LISTING ......•..• A-3 Appendix B. LOGIC DIAGRAMS ....•.....• B-1 Appendix C. CHARACTERS, KEYSTROKES, and COLOR ................................ C-l Appendix D. UNIT SPECIFICAnONS ........ D-l System Unit ........................... D-l Size: .............................. D-l Weight: ........................... D-l Transformer: ....................... D-l Environment: ....................... D-l Cordless Keyboard ..................... D-2 Size: .............................. D-2 Weight: ........................... D-2 Optional Cable: ..................... D-2 Diskette Drive ....................... D-3 Size: ............................ D-3 Weight: ........................... D-3 Power: ............................ D-3 Mechanical and Electrical ............. D-4 Color Display ......................... D-5 Size: .............................. D-5 Weight: ........................... D-5 Heat Output: ....................... D-5 Power Cables: ...................... D-5 Graphics Printer ....................... D-6 Size: .............................. D-6 Weight: ........................... D-6 A-I Heat Output: ....................... D-6 Power Cable: ....................... D-6 Signal Cable: ....................... D-6 Electrical: ......................... D-6 Internal Modem ........................ D-7 Power: ............................ D-7 Interface .......................... D-7 Compact Printer ..................... .. D-8 Size .............................. D-8 Weight ........................... D-8 Heat Output ......•............... D-8 Power Cable ...................... D-8 Signal Cable ...................... D-8 Electrical ......................... D-8 A-2 0157 74 06 L14: "Z LIS PROCEED I F NO ERROR 0159 BS 0004 MOV BX,0004H INDICATE ERROR 015C E9 ogse R ""P E_MSG 015F L15: TEST 5 BASE 2K READ/WRITE STORAGE TEST DESCRIPTION WRITE/READ/VERIFY DATA PATTERNS AA,55, AND 00 TO 1ST 2K OF STORAGE AND THE 2K JUST BELOW 64K (CRT BUFFER) VERI FV STORAGE ADDRESSABILI TV. ON EXIT SET CRT PAGE TO 3. SET TEMPORARY STACK ALSO. MFG. ERROR CODE 04XX FOR SYSTEM BOARD MEM. 05XX FOR 64K AlTRIB. CD. MEM 06XX FOR ERRORS I N BOTH (XX:::: ERROR BITS) 015F 80 Fe "OV AL,OFBH 0161 E6 10 OUT 10H, AL SET MFG FLAG=FB 0163 89 0400 MOV CX,0400H SET FOR 1K WORDS, 2K BYTES 0166 :33 CO XOR AX, AX 016B BE CO MOV E5, AX LOAD ES WI TH 0000 SEGMENT 016A £9 0959 R ""P PODSTG 0160 75 19 LIG: "NZ L20 BAD STORAGE FOUNO 016F BO FA MOV AL,OFAH MFG OUT=FA 0171 £6 10 OUT 10H, AL 0173 89 0400 MOV CX,400H 1024 WORDS TO BE TESTED IN THE REGEN BUFFER 0176 E4 SO IN AL, PORT_A WHERE I S THE REGEN BUFFER? 0178 3C IS eMP AL, ISH TOP OF 64K? 017A 88 OFao MOV AX, DF80H SET POINTER TO THERE IF IT IS 0170 74 02 "E LIB AH,lFH OR SET POI NTER TO TOP OF 128K 017F 84 IF "OV 0181 BE CO LIS: MOV ES, AX 0183 E9 OB59 R "MP POOSTG 01B6 74 23 L19: "Z L23 ROM BIOS A-9 0188 87 04 L20: MOV BH,04H ERROR 04 018A E4 62 IN AL, PORT_C GET CONFIG BI T5 018C 24 08 .ND AL, 0000 1000B TEST FOR ATTRIB CARD PRESENT 018E 74 06 JZ L21 WORRY ABOUT ODD/EVEN IF IT 15 0190 SA 09 HOY 8L,CL 0192 OA DD OR BL, CH COI1BINE ERROR BITS IF IT ISN'T 0194 EB 12 JHP SHORT L22 0196 80 FC 02 L2l; eMP AH,02 EVEN BYTE ERROR? ERR 04X)( 0199 SA 09 HOY BL, CL 0198 74 08 JE L22 0190 FE C7 INC BH MAKE INTO 05XX ERR 019F OA DD OR BL, CH MOVE AND POSS I BL Y COM8 I NE ERROR BITS alAI 80 Fe 01 CHP AH,l 000 BYTE ERROR 01A4 74 02 JE L22 01A6 FE C7 INC BH MUST HAVE SEEN BOTH - MAKE INTO OGXX 01A8 E9 09BC R L22: JMP E I1SG ; JUMP TO ERROR OUTPUT ROUTI NE , RETEST HI GH 2K USING B8000 ADDRESS PATH 01AB 80 F9 L23: MOV AL, OF9H MFG OUT =F9 01AD E6 10 OUT 10H, AL OlAF 99 0400 HOY CX, 0400H lK WORDS 0182 98 BB80 HOY AX,OBS80H POINT TO AREA JUST TESTED WITH 01 REeT ADDRESSI NG 01B5 BE co MOV ES, AX 01B7 E9 OB59 R JMP PODSTG 018A 74 06 L24: JZ L25 01BC BB 0005 MOV BX, 0005H ERROR 0005 01BF E9 09BC R JMP E MSG SETUP STACK SEG AND SP 01C2 BB 0030 MOV AX, 0030H GET STACK VALUE 01C5 8E 00 MaY SS, AX SET THE STACK UP 01C7 BC 0100 R MaY SP, OFFSET TOS STACK IS READV TO GO 01CA 33 CO XOR AX, AX SET UP DATA SEC 01CC 8E 08 HOV OS, AX SETUP CRT PAGE DICE C1 06 0462 R 0007 MOY oATA_WORD[ACTIVE_PAGE-DATA1,07 SET PREL I M I NARY I1EI10RY 5 I ZE WORD 0104 BS 0040 MOV BX,64 0107 E4 62 IN AL, PORT_C 0109 24 08 AND AL, 08H 64K CARD PRESENT? aiDS 80 18 MaY AL, IBH PORT SETTI NG FOR 64K SYSTEM DIDO 75 05 .JNZ L26 SET TO 64K J F NOT 01DF 83 C3 40 ADD ex, 64 ELSE SET FOR 128K 01E2 BO 3F HOV AL,3FH • PORT SETTING FOR 128K SYSTEM 01E4 89 IE 0415 R L2S: MOV DATA_WORD [TRUE_MEM-DAT Al, BX 01E8 A2 048A R MOY DATA_AREA[PAGOAT-DATA1, AL PART 6 INTERRUPTS OEseR I PTI ON 32 INTERRUPTS ARE INITIALIZED TO POINT TO A DUMMV HANDLER. THE 810S I NTERRUPTS ARE LOADED 01 AGNOSTI C I NTERRUPTS ARE LOADED SVSTEI1 CONFIGURATION WORD IS PUT IN MEMORY. THE DUMMY INTERRUPT HANDLER RESIDES HERE. ASSUME OS: XXDATA 01E8 BB ---- R HOY AX, XXOAT'A alEE BE DB HOV OS,AX 01FO CS 06 0005 R FB HOV MFG_TST,OF8H • SET UP MFC CHECKPOINT FROM THIS ; POINT 01F5 E8 E608 R CALL MFG_UP ; UPDATE HFC CHECKPO I NT 01F8 C7 06 0022 R OA61 R HOY MFC_RTN, OFFSET MFG_OUT OlFE BC CB HOY AX,CS 0200 A3 0024 R HOV HFG_RTN+2, AX SET OOUBLEWORD POI NTER TO MFG. ERROR OUTPUT ROUTl NE SO 0 lAGS. DON'T HAVE TO DUPLICATE CODE ASSUME CS: CODE, OS: ABSO 0203 88 0000 HOY AX,O 0206 8E 08 HOY OS, AX SET UP THE INTERRUPT VECTORS TO TEMP INTERRUPT 0208 89 OOFF HOY CX,255 FILL ALL INTERRUPTS 020B 28 FF SUB 01,01 FIRSt IN1ERRUPT LOCATION IS 0000 0200 BE C7 HOY ES,DI SET ES=OOOO ALSO 020F B8 F815 R 03: HOY AX, OFFSET 011 HOYE ADDR OF I NTR PROC TO TSL 0212 .B STOSW 0213 BC CB HOY AX, CS GET ADOR OF INTR PROC SEG 0215 .B STOSW 0216 E2 F7 LOOP 03 ; VECTBLO 0219 C7 06 0124 R 1090 R HOY EXST, OFFSET EXT AS • SET UP EXT. seAN TABLE , SET UP BIOS INTERRUPTS 021E OF 0040 R HOY DI,OFFSET YIDEO_INT ; SET UP VIDEO INT 0221 OE PUSH CS 0222 lF POP DS i PLACE CS IN OS 0223 BE FF03 R HOV SI, OFFSET YECTOR_TABLE+16 0226 89 0010 HOV ex, 16 0229 .5 04: MOVSW MOVE I NTERRUPT VECTOR TO LOW MEMORV 022A .7 INC 01 022S .7 INC 0I POI NT TO NEXT YECTOR ENTRY 022C E2 FS LOOP 04 REPEAT FOR ALL 16 BIOS INTERRUPTS ; SET UP 0 I AGNOSTI C INTERRUPTS 022E SF 0200 MOY DI,0200H , START WITH INT. 80H 0231 BE 4000 MOV SI,DIAG_TA8LE_PTR; POINT TO ENTRY POINT TABLE 0234 89 0010 MOY ex, 16 16 ENTRI ES 0237 .5 05: MOYSW ; "OYE I NTERRUPT VECTOR TO LOW i MEMORV A-tO ROM BIOS 0238 47 01 0239 47 01 ; PO I NT TO NEXT VECTOR ENTRY 023A E2 Fe D5 ; R£PEAT FOR ALL 16 BIOS INTERRUPTS 023C 8£ 09 DS, CX ; SET OS TO ZERO 023E C7 06 .0204 R 1863 R INT81, OFFSET LOCATE I 0244 C7 06 0208 R lA2A R INT82, OFFSET PRNT3 024A C7 0& 0224.R 18A5 R I NTB9, OFFSET .JOVST I CK ----- SET UP DEFAULT EQUIPMENT DETERMINATION WORD BIT 15,14 = NUMBER OF PRINTERS ATTACHED BIT 13 = 1 = SERIAL PRINTER PRESENT BIT 12 = GAME 110 ATTACHED BI T i l , 10,9 = NUMBER OF RS232 CARDS ATTACHED BI T 8 = OMA (O=DMA PRESENT, l:NQ OMA ON SVSTEM BIT 7,6 = NUMBER OF DISKETTE DRIVES 00=1, 01=2, 10'=3, 11=4 ONLV IF BIT 0 = 1 BIT 5,4 = INITIAL vrDEO MODE 00 - UNUSED 01 - 40X25 aw us I NG COLOR CARD 10 - aOX2!5 aw USING CDL-oR CARD 11 - 80X25 BW US I NG BW CARD BIT 3, 2 = PLANAR RAM SIZE (10=48K, 11=64K) BIT 1 NOT USED 81T 0 = 1 CIPL DISKETTE INSTALLED) ASSUME CS:CODE,DS:ABSO 0250 BS 1118 MOY BX,l118H ; DEFAULT GAMEIO, 40X25. NO DMA,4SK ON PLANAR 0253 £4 62 IN AL,PORT_C 0255 24 ~~~;~---;;~~----~~;;----------------------------------------------- 09BC 09Be BA 0201 MOY OX,201H 09aF EC IN AL, OX GET MODE 81 TS 09CO 24 FO AND AL,OFOH ISOLATE BITS OF INTEREST 09C2 75 03 JNZ EHO 09C4 £9 OA61 R .JMP MFG_OUT MANUFACTURING MODE (BURN-IN) 09C7 3C 10 EMO: CMP AL,000100008 09C9 75 03 JNE EM 1 0ge9 E9 OA61 R ,JMP MFG OUT MFG. MODE (SYSTEM TEST) 09CE 8A FO EMl: HOV DH, AL SAVE MODE 0900 80 FF OA CMP BH,OAH ERROR CODE ABOVE OAH (CRT 5T ARTEO DISPLAY POSSIBLE)? 0903 7C 63 JL BEEPS DO BEEP OUTPUT IF BELOW 101-1 0905 53 PUSH BX SAYE ERROR AND MODE FLAGS 0906 56 PUSH SI 09D7 52 PUSH OX 0908 B4 02 HOV AH,2 SET CURSOR 09DA BA 1521 MOV OX, 1521H ROW 21, COL.33 0900 B7 07 MOV BH,7 PAGE 7 09DF CD 10 tNT 10H 09El BE 0030 R MOV SI, OFFSET ERROR ERR 09E4 99 0005 MOV CX,5 -; PRINT WORD "ERROR" 09E7 2E· 8A 04 EM_O: MOV AL.CS:(SIl 09EA 4. INC SI 09EB EB ISBA R CALL PRT _HEX 09EE E2 F7 LOOP EM 0 LOOK FOR A BLANK-SPACE TO POSSIBLY PUT CUSTOMER LEVEL ERRORS (IN CASE OF MULTI ERROR) 09FO 86 16 MOY CH, ISH 09F2 84 02 EM_I: MOV AH,2 SET CURSOR 09F4 CD 10 INT 10H ROW 22, COL33 (OR ABOVE, IF MULTIPLE ERRS) 09FS 94 09 MOV AH,8 READ CHARACTER THIS POSITION 09F8 CD 10 INT 10H 09FA FE C2 INC DL PO I NT TO NEXT POST ION 09FC 3C 20 eMP AL, BLANK? oaFE 75 F2 JNE EM 1 GO CHECK NEXT POSITION, IF NOT OAOD 5A POP DX- RECOVER ERROR PO INTERS OAOI 5E POP 51 OA02 58 POP BX OA03 BO FE 20 eMP OH, 001000008 SERVICE MODE? OA06 74 21 JE SERV_OUT OA08 80 FE 40 eMP OH,010000008 OA08 74 lC JE SERV_OUT OAOD 2E: 8A 04 MOV AL, CS; [51) GET ERROR CHARACTER OA 10 E8 18BA R CALL PRT HEX DISPLAY IT OA13 80 FF 20 eMP BH,20H ERROR BELOW 207 (MEM TROUBLE?) OA16 70 03 JNL EM_2 OA 18 E9 OABS R JMP TOTLTPO HALT SYSTEM IF SO. ASSUME os: XXDATA OAIB IE PUSH DS OAIC 50 PUSH AX OA 10 98 ---- R MOV AX. XXDATA OA20 8E 08 MOV as, AX OA22 88 3£ 0018 R MOV POST_ERR, BH SET ERROR FLAG NON-ZERO OA26 58 POP AX OA27 IF POP OS ASSUME os: NOTHING OA28 C3 RET ; RETURN TO CALLER ROM BIOS A-23 OA29 SERV_OUT: OA29 8A C7 MOV AL, BH PRINT M5B OA28 53 PUSH BX OA2C EB 18A9 R CALL XPC_BYTE 01 SPLAY Ir OA2F 5B POP BX OA30 BA C3 MOV Al,8l PRINT lSB OA32 EB 18A9 R CALL XPC 8YTE OA35 E. OABB R JMP TOTLTPO OA38 FA BEEPS: CLI OA39 8C CB MOV AX, CS SET CODE 5EG; STACK SEG OA3B 8E DO MOV 55, AX (STACK IS LOST, BUT THI NGS ARE OVER, ANYWAY) OA30 B2 02 MOV Dl,2 2 BEEPS OA3F BC 0028 R MOV SP, OFFSET EX_O SET DUMMY RETURN OA42 B3 01 EB: MOV Bl,l SHORT BEEP OA44 E9 FF31 R JMP BEEP OA47 E2 FE EBO· lOOP EBO WAIT (BEEPER OFF) OA49 FE eA DEC DL DONE VET? OA48 75 F5 JNZ EB LOOP IF NOT OA40 80 FF 05 CMP BH, aSH 64K CARD ERROR? OA50 75 6' JNE TOTL TPO END IF NOT OA52 BO FE 20 CMP DH, 00 1000008 SERVICE MODE? OA55 7. 05 JE EBI OA57 aD FE 40 CMP OH,01000000B OA5A 75 5F JNE TOTL TPO END IF NOT OA5e B3 01 E81: MOV Bl,1 ONE MORE BEEP FOR 64K ERROR IF IN SERV I CE MODE OA5E E. FF31 R JMP BEEP OA61 MFG_OUT: OAG1 FA CLI OA62 E. 61 IN AL, PORT_B OA64 24 Fe AND AL, aFCH OA66 E6 61 OUT PORT_B, Al OA68 BA 0011 MOV OX,11H SENO DATA TO ADDRESSES II, 12 OA68 8A C7 MOV AL, BH OA60 EE OUT DX, AL SEND HIGH BYTE OA6E .2 INC ox OA6F 8A C3 MOV AL, BL OA71 EE OUT OX, AL ; SEND LOW BYTE ; INIT. ON-BOARD RS232 PORT FOR COMMUNICATIONS W/MFG MONITOR ASSUME OS: XXOATA OA72 Ba ---- R MOV AX, XXOATA OA75 8E DB MOV OS, AX POI NT TO DATA SEGMENT CONTAINING CHECKPOI NT # OA77 BC C8 MOV AX, CS OA79 SE DO MOV SS, AX SET STACK FOR RTN OA7B BC 002E R MOV SP, OFFSET EXI OA7E BA 02FB MOV OX,02FBH LINE CONTROL REG. ADDRESS OA81 E. FOSS R JMP S82S0 GO SET UP FOR 9600, ODD, 2 STOP BITS, 8 BI TS OA84 BB CA MOl: MOV CX, OX OX CAME BACK WITH XMIT REG ADDRESS IN IT OAB6 BA 02FC MOV OX,02FCH MODEM CONTROL REG OA89 2A CO SUB AL, AL SET OTR AND RTS LOW SO POSSIBLE WRAP PLUG WON'T CONFUSE THI NGS OA8B EE OUT OX, AL OASC SA 02FE MOV OX,02FEH MODEM STATUS REG OASF EC M02: IN AL, OX OA90 2. 10 AND AL,000100008 CTS UP YEP' OA92 74 FB JZ M02 LOOP TILL IT IS OA94 .A DEC ox SET OX;2FO (LINE STATUS REG) OA95 87 01 XCHG OX, CX POINT TO XMIT. DATA REG OA97 AD 0005 R MOV AL, HFG_TST GET MFG ROUT I NE ERROR INDICATOR OA9A EE OUT OX, AL (MAY BE WRONG FOR EARLV ERRORS) OA9B EB 00 JMP 5+2 DELAY OA90 B7 01 XCHG OX, CX POI NT DX=2FO OA9F EC M03; IN AL, ox TRANSMI T EMPTV? OAAO 24 20 AND AL, 00 100000B OAA2 EB 00 JMP $'2 DELAY OAA4 74 F9 JZ M03 LOOP TILL IT IS OAA6 87 01 XCHG OX, CX OAA8 8A C7 MOV AL, BH GET MS8 OF ERROR WORD OAAA EE OUT OX, AL OAAB EB 00 JMP $'2 DELAY OAAO 87 01 XCHG OX, CX OAAF EC MO. IN AL, OX WAI T FOR XMI T EMPTY OABO 24 20 AND AL,00100000B OA82 EB 00 JMP $'2 DELAY OA84 74 F9 JZ MO. OAB6 8A C3 MOV AL, BL GET LS8 OF ERROR WORD OABS S7 01 XCHG ox, CX OABA EE OUT OX, AL OABB TOlL lPO: OABS FA CLI o I SABLE INlS. OASC 2A CO SUB AL, AL OASE ES F2 OUT OF2H, AL SlOP 0 I SKETlE MOTOR OACO E6 AO OUT OAOH, AL DISABLE NMI OAC2 F. HLT HALl OAC3 C3 RET OAc4 E_MSG ENOP A-24 ROM BIOS SUBROUTINE TO INITIALIZE INSB250 PORTS TO THE MASTER RESET STATUS. THI S ROUT! NE ALSO TESTS THE PORTS' PERMANENT ZERO 81 TS EXPECTS TO BE PASSED: (OX) = ADDRESS OF THE 8250 TRANSMIT/RECEIVE BUFFER UPON RETURN: (CF) = 1 I F ONE OF THE PORTS' PERMANENT ZERO BITS WAS NOT ZERO (ERR) (OX) = PORT ADDRESS THAT FAILED TEST (AU :;; MEAN I NGlESS (au =2 I NTR ENBl REG B ITS NOT 0 3 INTR [0 REG BITS NOT 0 4 MODEM CTRl REG BI TS NOT 0 5 LINE STAT REG BITS NOT 0 o I F ALL PORTS' PERMANENT ZERO 91 TS WERE ZERO (OX) = TRANSMI T /REeEl VE BUFFER ADDRESS ( Al) :; LAST VALUE READ FROM RECE I VER BUFFER (BU :; 5 (MEANINGLESS) PORTS SET UP AS FOLLOWS ON ERROR-FREE RETURN: XF9 - I NTR ENBl REG = 0 ALL INTERRUPTS DISABLED XFA - INTR 10 REG = 000000019 NO INTERRUPTS PENDING XFB - LINE CTRl REG :::: ALL BITS LOW XFC - MODEM CTRL REG = ALL BITS LOW XFD - LINE STAT REG = 011000009 TRANSMITTER HOLDING REGI STER AND TRANSMITTER EMPTY ON XFE - HODEM STAT REG = XXXXOOOOB wHERE X '5 REPRESENT J NPUT 51 GNALS REGISTERS OX, AL, AND BL ARE ALTERED. NO OTHER REGISTERS USED. OAC4 B250 PRoe NEAR OAC4 EC IN Al, ox READ RECVR BUFFER BUT IGNORE CONTENTS OACS B3 02 MOV 8l,2 ERROR INDICATOR OAC7 EB FE9F R CALL 002 READ 1 NTR EN8L REG OACA 24 FO AND Al,11110000B BI TS 4-7 OFF'? OACC 75 2B JNE AT20 NO - ERROR OACE E8 FE9A R CAll OR1 READ I NTR 10 REG DAD 1 24 Fa AND AL,11111000B BI TS 3-7 OFF? OAD3 75 21 JNE AT20 NO OAD5 42 INC DX LI NE CTRL REG OAD6 EB FEBA R CALL R01 READ MODEM CTRL REG OAD9 24 EO AND AL, 111000008 BI TS 5-7 OFF"? OADB 75 13 JNE AT20 NO OADD E8 FESA R CALL RR1 READ LINE STAT REG OAEO 24 BO AND AL, 10000000B BIT 7 OFF? OAE2 75 12 JNE AT20 NO OAE4 BO 60 MOV AL,60H OAE6 EE OUT OX, Al OAE7 EB 00 JMP $+2 I/O DELAV OAE9 42 INC DX MODEM STAT REG OAEA 32 CO XOR Al, AL OAEe EE OUT 0)(, AL WI RED BITS WI LL BE HI GH OAED EB FEAO R CALL 003 CLEAR 8 I TS 0-3 I N CASE THEY'RE ON AFTER WRITING TO STATUS REG OAFO 83 EA OS SUB OX,6 RECEI VER BUFFER OAF3 EC IN Al, OX I N CASE Wft IT I NG TO PORTS CAUSED DATA READY TO GO HIGH! OAF4 FB CLe OAF5 C3 RET OAF6 FS AT20: STC ERROR RETURN OAF7 C3 RET OAFB 8250 ENDP SUBROUTI NE TO TEST A PARTl CULAR 8250 I NTERRUPT. PASS IT THE (BIT' + 1) OF THE STATUS REGISTER THAT IS TO BE TESTED THIS ROUTINE SETS THAT BIT AND CHECKS TO SEE IF THE CORRECT 8250 INTERRUPT IS GENERATED. I T EXPECTS TO BE PASSED· (AH) = BIT • TO BE TESTED (BU = INTERRUPT IDENTIFIER (0) = RECEIVED DATA AVAILABLE OR TRANSMITTER HOLDING REGISTER EMPTY I NTERRUPT TEST (1) = RECEIVER LINE STATUS OR MODEM STATUS INTERRUPT TEST (BH) :::: BITS WHICH DETERMINE WHICH INTERRUPT IS TO BE CHECKED (0) :::: HODEM STATUS (2) = TRANSMITTER HOLDING REGISTER EMPTY (4) = RECEIVED DATA AVAILABLE (6) = RECEIVER LINE STATUS (CX) :::: VALUE TO SUBTRACT AND ADO I N ORDER TO REFERENCE THE INTERRUPT IDENTIFICATION REGISTER (3) = RECEIVED DATA AVAILABLE, TRANSMITTER HOLDING REGISTER AND RECEIVER LINE STATUS INTERRUPTS (4) = MODEM STATUS INTERRUPT (OX) = ADDRESS OF THE LINE STATUS OR MODEM STATUS REGISTER I T RETURNS: (AU OFFH IF TEST FAILS - EITHER NO INTERRUPT OCCURRED OR THE WRONG I NTERRUPT OCCURRED OR (AU CONTENTS OF THE INTERRUPT ID REGISTER FOR RECEIVED DATA AVAILABLE AND TRANSMITTER HOLDING REGISTER EMPTY INTERRUPTS -OR- CONTENTS OF THE LINE STATUS OR MODEM STATUS REGISTER DEPENDING ON WHICH ONE WAS TESTED. lOX) = ADDRESS OF INTERRUPT 10 REGISTER FOR RECEIVED DATA AVA I LABlE OR TRANSM I TTER HOLD I NG REG I STER EMPTY INTERRUPTS OR (OX) = ADDRESS OF THE LINE STATUS OR DATA SET STATUS REGISTER (DEPENDING ON WHICH INTERRUPT WAS TESTED) NO OTHER REGISTERS ARE ALTERED ROM BIOS A-25 OAFS ieT PRoe NEAR OAFB EC IN AL,DX READ STATUS REGISTER OAF9 EB 00 JMP 0+2 110 DELAY OAFB OA C4 OR AL,AH SET TEST BIT OAFO EE OUT DX,AL WRITE IT TO THE STATUS REGISTER OAFE 2B Dl SUB OX,CX PO I NT TO I NTERRUPT 10 REG I STER OBOO 51 PUSH CX 0801 2B C9 SUB CX,CX WA I T FOR 9250 I NTERRUPT TO OCCUR OB03 EC AT21: IN AL,DX READ I NTR I DREG OB04 AB 01 TEST AL,l I NTERRUPT PEND I NG? OB06 74 02 JE AT22 '1ES -RETURN WI I NTERRUPT 10 IN AL OBOS E2 F9 LOOP AT21 NO - TRY AGAIN OBOA S9 AT22: POP CX AL = 1 I F NO I NTERRUPT OCCURRED 0808 3A C7 CMP AL,BH INTERRUPT WE'RE LOOKING FOR? 0800 75 09 JNE AT23 NO OBOF OA DB OR BL,BL DONE WITH TEST FOR THIS INTERRUPT 0811 74 07 JE AT24 RETURN WI CONTENTS OF I NTR 10 REG OB13 03 Dl ADD DX, CX READ STATUS REGISTER TO CLEAR THE 0815 EC IN AL.OX INTERRUPT (WHEN BL= 1) 081& EB 02 JMP SHORT AT24 RETURN CONTENTS OF STATUS REG OB18 80 FF AT23: MOV AL,OFFH SET ERROR I ND 1 CATOR 081A C3 AT24: RET 081B ICT ENDP ; --- I NT 19 -------------------------------------------- BOOT STRAP LOADER TRACK 0, SECTOR 1 IS READ I NTO THE BOOT LOCATION (SEGMENT O. OFFSET 7COO) AND CONTROL I S TRANSFERRED THERE. I F THE DISKETTE I S NOT PRESENT OR HAS A PROBLEM LOADING (E. G .• NOT READY), AN INT. 18H IS EXECUITEO. IF A CARTRIDGE HAS VECTORED I NT. 18H TO ITSELF. CONTROL WI LL BE PASSED TO THE CARTRIDGE. ASSUME CS: CODE, OS: ABSO OB18 BOOT_STRAP PROC NEAR OBIB FB STI ENABLE INTERRUPTS OBIC 2B CO SUB AX.AX SET 40X25 elw MODE ON CRT OB1E CD 10 tNT 10H 0820 28 CO SUB AX,AX ESTABLI SH ADDRESS I NG OB22 BE 08 MOY OS.AX • ----- SEE IF DISKETTE PRESENT 0824 E4 62 IN AL,PORT_C GET CONFIG BITS OB2& 24 04 AND AL.OOOOOI00B IS DISKETTE PRESENT? 0828 75 28 JNZ H3 ; NO. THEN ATTEMPT TO GO TO CART. ; ----- RESET THE DISK PARAMETER TABLE VECTOR OB2A C7 06 0078 R EFC7 R MOY WORD PTR DISK_POINTER, OFFSET DISK_BASE OB30 8t DE DD7A R MOV WORD PTR DISK_PO I NTER"'2, CS LOAD SYSTEM FROM DISKETTE -- CX HAS RETRY COUNT OB34 88 0004 MOV CX, 4 SET RETRY COUNT 0837 51 HI: PUSH CX SAVE RETRV COUNT OB38 84 00 MOV AH.O RESET THE DISKETTE SYSTEM OB3A CD 13 INT 13H DISKETTE 10 083C 72 OF JC H2 IF ERROR:- TRY AGAIN OB3E 88 0201 MOV AX,201H READ IN THE SINGLE SECTOR OB41 28 02 SUB OX. OX TO THE BOOT LOCATI ON OB43 8E C2 MOV ES,DX OB45 88 7COO R MOV BX, OFFSET BOOT_LOCH DRIVE D. HEAD 0 0848 88 0001 MOV eX.l SECTOR 1, TRACK 0 0949 CD 13 INT 13H DISKETTE 10 084D 59 H2: POP CX RECOVER RETRV COUNT 084E 73 04 JNe H3A CF SET BY UNSUCCESSFUL READ 0850 E2 £5 LOOP HI ; 00 IT FOR RETRY TI MES ; ----- UNABLE TO I PL FROM THE DISKETTE 0852 CD 18 H3: INT IBH ; GO TO BASIC OR CARTRIDGE ; ----- I PL WAS SUCCESSFUL OB54 EA 7COO ---- R H3A: JMP BOOT_LOCN 0859 BOOT_STRAP ENDP THIS ROUTINE PERfORMS A READIWRITE TEST ON A BLOCK OF STORAGE (MAX. SIZE = 32KB>. IF "WARM START". FILL BLOCK WITH 0000 AND RETURN. DATA PATTERNS USED: O-)FF ON ONE BYTE TO TEST DATA BUS AAAA. 5555, DOFF, FFOO FOR ALL WORDS FILL WITH 0000 BEFORE EXIT ON ENTRY: ES = ADDRESS OF STORAGE TO BE TESTED OS = ADDRESS OF STORAGE TO BE TESTED ex = WORD COUNT OF STORAGE BLOCK TO BE TESTED (MAX. = BOOOH (32K WORDS») ON EXIT: ZERO FLAG :; OFF I F STORAGE ERROR IF ZERO FLAG = OFF. THEN CX = XOR'ED BIT PATTERN OF THE EXPECTED DATA PATTERN VS. THE ACTUAL DATA READ. (I.E .• A BIT "ON" IN AL IS THE BIT IN ERROR) AH=03 IF BOTH BYTES OF WORD HAYE ERRORS AH=02 I FLOW (EVEN) BYTE HAS ERROR AH=Ol IF HI (ODD) BYTE HAS ERROR AX,BX,CX,DX,Dl,Sl ARE ALL DESTROYED. A-26 ROM BIOS 0959 POOSTG PROt NEAR ASSUME OS: ASSO 0859 Fe CLD SET DIRECTION TO INCREMENT 085A 28 FF SUB OI, OJ SET 0 I =0000 REL. TO START OF SEG 085e 28 co SUB AX,AX INITIAL DATA PATTERN FOR OO-FF TEST 085E 8E D8 HOY OS, AX , SET DS TO ABSO 0860 89 1E 0472 R HOY BX,DATA_WORD[RESET_FLAG-DATAl ; WARM START? 0864 B 1 FB 1234 CHP ax, 1234H 0968 8e C2 HOY DX,ES OB6A 8E DA HOY OS, OX RESTORE .os OB6C 75 08 JNE PI OB6E F31 AS P 12· REP STOSW SIMPLE FILL WITH 0 ON WARM-START 0870 BE DB HOY OS, AX 0872 89 1E 0472 R HOY DATA_WORD [RESET_FLAG-DATA], ex 0876 BE DA HOY OS, ox RESTORE OS 0878 C3 RET AND EXIT 0879 Bl FB 4321 P 1: eMP ex, 4321H DlAG. RESTART? 0870 74 EF JE P12 00 FILL WITH ZEROS 087F 88 05 P2: MOV [01], AL WRI TE TEST DATA OSBI SA 05 HOY AL, [01] GET IT BACK OB83 32 C4 'OR AL, AH COMPARE TO EXPECTED 08B5 74 03 JZ py 08S7 E9 OCOC R JHP P8 ERROR EXIT IF MISCOMPARE OB8A 088C FE C4 BA C4 PY, INC HOY A" AL,AH FORM NEW DATA PATTERN aBBE 75 EF JNZ P2 LOOP TILL ALL 256 DATA PATTERNS DONE 0890 88 E9 HOY SP, CX SAVE WORD COUNT 0892 BB AAAA HOY AX,OAAAAH LOAD DATA PATTERN OB95 88 08 HOY eX,AX 0897 8A 5555 HOY DX,05555H LOAD OTHER DATA PATTERN OB9A F31 AS REP 5TOSW FI LL WORDS FRO" LOW TO HI GH WITH AAAA 089C 4F DEC DI POI NT TO LAST WORD WRITTEN 0890 4F DEC DI 089E FD STO SET 0 I RECT I ON FLAG TO GO DOWN OB9F 89 F7 HOY 51,DI SET INDEX REGS. EQUAL OBAI 88 CD HOY CX, BP RECOVER WORD COUNT OBA3 P3: GO FROM HI GH TO LOW 08A3 AD LODSW GET WORD FROM MEMORY 08A4 33 C3 'OR AX,ex EQUAL WHAT SIS THERE? 08A6 75 64 JNZ P8 GO ERROR EXl T I F NOT 08A8 B8 C2 HOY AX, OX GET 55 DATA PATTERN OBAA A8 STOSW STORE. IT IN LOCATION .JUST READ OBAS E2 F6 LOOP P3 LOOP TI LL ALL 8YTES DONE OBAD 88 CD HOY ex, SP RECOVER WORD COUNT 08AF FC CLD BACK TO INCREMENT 0880 46 INC 51 ADJUST PTRS OB81 46 INC 51 0892 Ba FE HOY DI,51 OB84 BB DA HOY BX, OX SIB DATA PATTERN TO BX OB96 SA OOFF HOV OX, OOFFH DATA FOR CHECKERBOARD PATTERN OS89 AD PX; LODSW GET WORD FROM MEMORY Os8A 33 C3 'OR AX, ex EQUAL WHAT SIB THERE? osee 75 4E JNZ P8 G.O ERROR EXIT I F NOT 088E BB C2 HOV AX, OX GET OTHER PATTERN aBeD OSCI AB E2 F6 STOSW LOOP P, STORE IT IN LOCATION JUST READ LOOP TI LL ALL BVTES DONE 08e3 88 CD HOV ex, SP RECOVER WORD COUNT OBe5 FD STD DECREMENT OS'C6 4E DEC 51 ADJUST PTRS OBC7 4E DEC SI oses 88 FE HOV 01, SI OBCA 88 DA HOY BX, ox SIB DATA PATTERN TO SX OBCC F7 02 NOT D. MAKE PATTERN FFOO oaCE OA 02 OR DL,OL F"I"RST PASS? OSDO 74 E7 JZ P. OBD2 Fe CLD INCREMENT OBD3 83 C6 04 ADO SI,4 OS06 F7 02 NOT O. OB08 88 FE HOV OJ,51 oaDA 88 CD HOY CX,BP OBDC P4: LOW TO HIGH osnc AD LODSW GET A WORD 0900 33 t2 'OR AX, ox SHOULD COMPARE TO OX oaDF 75 2S JNZ P8 GO ERROR I F NOT aBEl AB STOSW WRITE 0000 BACK TO LOCATION JUST READ OB£2 E2 FB LOOP P4 LOOP TI Ll DONE 09E4 FD STO BACK TO DECRE"ENT OBE5 4E DEC 51 AD.JUST POI NTER DOWN TO LAST WORD OSE6 4E DEC SI ; WRITTEN CHECK IF IN SERVICE/MFG MODES, IF SO, PERFORM REFRESH CHECK 08E7 BA 0201 HOV DX,20tH OBEA EC IN AL,DX GET OPTION BITS OBEB 24 FO AND AL,OFOH aBED 3C Fa CMP AL,OFOH ALL BITS HIGH=NORMAL MODE oaEF 74 10 .JE P6 OSF 1 BC C9 MOV CX, CS OBF3 BC D3 "OV ax, SS OBF5 3B CO C"P ex, ex ; SEE IF IN PRE-STACK MODE OBF7 74 08 JE PG ; BYPASS RETENTJ ON TEST I F SO OBF9 80 18 "OV AL,24 ; SET OUTER LOOP COUNT WAIT ABOUT G-B SECONDS WITHOUT ACCESSING ME"ORY I F REFRESH I S NOT WORKI NG PROPERLY, THI S SHOULD 8E ENOUGH TJ"E FOR SOME DATA TO GO SOUR. ROM BIOS A-27 OBFS E2 FE P5: LOOP P5 OBFO FE C8 DEC AL OOFF 75 FA JNZ P5 OCOI BS eo P6: HOV CX,BP RECOVER WORD COUNT oe03 AD P7: LODSW GET WORD oe04 DB co OR AX, AX = TO 0000 oe06 75 04 JNZ P8 ERROR IF NOT oe08 E2 F9 LOOP P7 lOOP Tl LL DONE oeOA EB 13 JHP SHORT Pl1 THEN EXIT oeoc 88 co P8: HOV CX, AX SAVE Bl TS I N ERROR oeOE 32 E4 XOR AH,AH OCI0 OA ED OR CH,CH HI GH BVTE ERROR? oe12 74 02 JZ P9 OC14 FE e4 INC AH SET HIGH BYTE ERROR oe16 OA C9 P9: OR Cl, Cl LOW BYTE ERROR? oe18 74 03 JZ PI0 DelA 80 e4 02 ADD AH,2 oel0 OA E4 PI0; OR AH.AH SET ZERO FlAG=O (ERROR INDICATION oelF FC P11· CLD SET D I R FLAG BACK TO INCREMENT OC20 C3 RET RETURN TO CALLER oe21 PODSTG ENDP ; ******************************************************* PUT_LOGO PROCEDURE TH I S PRoe SETS UP PO I NTERS AND CALLS THE SCREEN OUTPUT ROUTINE SO THAT THE IBM LOGO, A MESSAGE, AND A COLOR BAR ARE PUT UP ON THE SCREEN. , AX, BX, AND OX ARE DESTROYED. ALL OTHERS ARE SAVED oe21 ; ***************** PUT_LOGO PROC •• ****-******************************* NEAR OC21 IE PUSH OS oe22 55 PUSH BP OC23 50 PUSH AX oe24 53 PUSH 8X oe25 51 PUSH CX OC26 52 PUSH OX OC27 80 OC4A R MOV BP, OFFSET LOGO OC2A 8A 8000 HOV OX, BOOOH ~ POI NT DH Dl AT ROW, COLUMN 0, a oe20 83 IF HOV Bl,00011111B ; ATTRIBUTE OF CHARACTERS TO BE ; WRITTEN oe2F CD 82 INT 82H ; CALL OUTPUT Roun NE oe31 B3 00 HOV Bl.000000008 ; INITIALIZE ATTRIBUTE OC33 82 00 HOV OL,O ; I N I TI ALI ZE COLUMN Oe35 B6 94 AGAIN: HOV DH,94H ; SET LINE OC37 80 OCDD R HOV 8P, OFFSET COLOR i OUTPUT G I YEN COLOR BAR oe3A CD 82 INT 82H ; CALL OUTPUT ROUT! NE OC3e FE e3 INC 8L INCREMENT ATTRIBUTE oe3E 80 FA 20 CHP DL,32 IS THE COLUMN COUNTER POINTING PAST 407 OC41 7e F2 JL AGAIN IF NOT, DO IT AGAIN OC43 SA POP OX oe44 59 POP CX OC45 58 POP 8X OC46 58 POP AX oe47 50 POP BP RESTORE BP OC48 IF POP OS RESTORE OS oe49 C3 RET oe4A PUT LOGO ENDP OC4A 03 LOGO DB LOGO E - lOGO OC49 20 De 08 , ',220 = OC40 S OC4D 28 FB DB 40,-5 OC4F 28 F8 DB 40, -s oe51 02 07 01 09 03 04 DB 2,7,1,9,3,4,9,4,1,-5 09 04 01 FB oe58 02 07 01 OA 02 05 DB 2,7,1,10,2,5,7,5,1,-5 07 05 01 FB oe65 02 07 01 OB 01 06 DB 2,7,1,11,1,6,5,6,1,-5 05 06 a 1 Fa OC6F 04 03 05 03 03 03 DB 4,3,5,3,3,3,3,5,3,5,3,-5 03 05 03 05 03 FB OC78 04 03 05 03 03 03 DB 4,3,5,3,3,3,3,6,1,6,3,-5 03 06 01 06 03 F8 OC87 04 03 05 08 04 00 DB 4,3,5,8,4,13,3,-5 03 FB OC8F D4 03 05 07 05 00 DB 4,3,5,7,5,13,3,-5 03 Fa OC97 04 03 05 08 04 00 DB 4,3,5,8,4,13,3,-5 03 FB oe9F 04 03 05 03 03 03 DB 4,3,5,3,3,3,3,13,3, -5 03 00 03 FB DCA9 04 03 05 03 03 03 DB 4,3,5,3,3,3,3,3,1,5, 1,3,3,-5 03 03 01 05 01 03 03 FB OCB7 02 07 01 OB 01 05 DB 2,7, I, II, 1,5,2,3,2,5, 1,-5 02 03 02 05 01 FB oeC3 02 07 01 OA 02 05 DB 2,7,1,10,2,5,3,1,3,5,1,-5 03 01 03 05 01 FB oeeF 02 07 01 09 03 05 08 2,7,1,9,3,5,7,5,1,-5 01 05 01 FB OC09 28 F8 DB 40, -5 oeDe 28 FC DB 40, -4 OCOD 02 COLOR DB COLOR_E - COLOR OCDE DB 08 21. = OCDF S ocaF 02 77 02 77 02 77 DB 2, 121-2,2, 121-2,2, 121-2,2, 121-2,2,-4 02 77 02 Fe ASSUME OS; DATA A-28 ROM BIOS --- I NT 10 ------------------------------------------------------- VIDEO_IO THESE ROUTINES PROVIDE THE CRT INTERFACE THE FOLLOWING FUNCTIONS ARE PROVIDED; (AH)=O SET MODE CAU CONTAINS MODE VALUE (AL)=O 40X25 BW (POWER ON DEFAULT) (AU=1 40X25 COLOR (AU;;;2 80)(25 BW (AL ) =3 80)(25 COLOR GRAPHICS MODES (AL)=4 320X200 04 COLOR (AU=5 320)(200 BW 4 SHADES _... EXTENDED MOOES .*. (AL);;;6 640X200 BW 2 SHADES CAl)=7 NOT VALID eAL) =S 160X200 16 COLOR (Al) =9 320X200 16 COLOR (AL) =A 640X200 4 COLOR *** NOTE BW MODES OPERATE SAME AS COLOR MODES. BUT COLOR BURST I S NOT ENABLED *.* NOTE IF HIGH ORDER BIT IN AL IS SET, THE REGEN BUFFER t 5 NOT CLEARED. (AH) = 1 SET CURSOR TVPE CCH} = BITS 4-0 = START LI NE FOR CURSOR if. HARDWARE WILL ALWAVS CAUSE BLINK ** SETTING BIT 5 OR 6 WILL CAUSE ERRATIC BLINKING OR NO CURSOR AT ALL IN GRAPHICS MODES, BIT 5 IS FORCED ON TO oI SABLE THE CURSOR (CL) = BITS 4-0 = END LINE FOR CURSOR CAH}=2 SET CURSOR POSITION (DH,DL};;; ROW,COLUMN (0,0) IS UPPER LEFT CBH) = PAGE NUMBER (MUST BE 0 FOR GRAPHICS MODES) ( AH};;:3 READ CURSOR POS I TI ON CBH) = PAGE NUMBER (MUST BE 0 FOR GRAPHICS MODES) ON EXIT (DH,DL) = ROW. COLUMN OF CURRENT CURSOR (CH, Cl) = CURSOR MODE CURRENTLV SET (AH):4 READ LIGHT PEN POSITION ON EXIT: (AH) : 0 -- LIGHT PEN SWITCH NOT DOWN/NOT TRIGGERED CAH) = 1 -- VALID LIGHT PEN VALUE IN REGISTERS CDH,DL) = ROW,COLUMN OF CHARACTER LP POSN (CH) : RASTER LINE CO-199) CHAR TO WRITE (Bl) = ATTRIBUTE OF CHARACTER (ALPHA) /COLOR OF CHARACTER (GRAPHICS). SEE NOTE ON WRITE DOT FOR BIT 7 OF BL = 1. (AH) 10 (DAH) WRITE CHARACTER ONLY AT CURRENT CURSOR POSITION (BHJ DISPLAV PAGE (VALID FOR ALPHA MODES ONLY) (CX) COUNT OF CHARACTERS TO WRITE (AL) CHAR TO WRITE (Bl) COLOR OF CHAR (GRAPHI CS) SEE NOTE ON WRITE DOT FOR BI T 7 OF BL = 1. ROM BIOS A-29 FOR READlWRITE CHARACTER INTERFACE WHILE IN GRAPHICS MODE, THE CHARACTERS ARE FORMED FROM A CHARACTER GENERATOR I MAGE MA I NT AI NED I N THE SYSTEM ROM. INtERRUPT -44H (LOCATION 00110H) IS USED TO POINT TO THE lK ByrE TABLE CONTAINING THE FIRST 128 CHARS (0-127). ·INTERRUPT lFH (LOCATION 0007CH) 1·5 USED TO POUlT TO THE lK BVTE TABLE CONTAINING THE SECOND 128 CHARS C 128-255) . FOR WRI TE CHARACTER '·NlERFACE IN GRAPH I c.s MODE, THE REPLI CATION FACTOR CaNT A I NED IN (ex) ON ENTRY WilL PRODUCE VAll 0 RESULTS ONL V FOR CHARACTERS CONTAINED ON THE SAME ROW. CONTINUATION TO SUCCEEDING LINES WILL NOT PRODUCE CORRECTLY. GRAPHICS INTERFACE (AH) = 11 (OSH) SET COLOR PALETTE (BH) PALETTE COLOR 10 BEING SET (0-127) CBl) ;:: COLOR VALUE TO BE USED W·ITH THAT COLOR tD COLOR I D 0 SELECTS THE BACKGROUND COLOR (0-1!!) COLOR J 0 = 1 SELECTS THE PALETTE TO BE USED: 2 COLOR MODE: o = WHITE FOR COLOR 1 1 = BLACK FOR COLOR 1 4 COLOR MOOES, o = GREEN, RED, BROWN FOR COLORS 1,2,3 1 = CVAN, MAGENTA, WHI TE FOR COLORS 1,2,3 16 COLOR MODES: ALWAYS SETS UP PALETTE AS: BLUE FOR COLOR 1 GREEN FOR COLOR 2 CYAN FOR COLOR 3 RED FOR COLOR 4 MAGENTA FOR COLOR 5 BROWN FOR COLOR 6 LIGHT GRAY FOR COLOR 7 DARK GRAY FOR COLOR B LIGHT BLUE FOR COLOR 9 LIGHT GREEN FOR COLOR 10 LI GHT CYAN FOR COLOR 11 .L I GHT RED FOR COLOR 12 LIGHT MAGENTA FOR COLOR 13 YELLOW FOR COLOR 14 WHI TE FOR COLOR 15 IN 40X25 OR 80X25 ALPHA MODES, THE VALUE SET FOR PALETTE COLOR a I ND1CATES THE BORDER COLOR TO 8E USED. IN GRAPHIC MODES, IT INDICATES THE BORDER COLOR AND THE BACKGROUND COLOR. CAH) 12 (OCH) WRITE DOT (OX) = ROW NUMBER Cex) = COLUMN NUMBER (Al) = COLOR VALUE IF BIT 7 OF AL = 1, THEN THE COLOR VALUE IS EXCLUSIVE OR '0 WITH THE CURRENT CONTENTS OF THE DOT (AH) 13 (DOH) READ DOT (OX) = ROW NUMBER (CX) = COLUMN NUMBER (AL) RETURNS ·THE DOT READ ASCI I TELETYPE ROUTINE FOR OUTPUT (AH) = 14 COEH) WRITE TELETYPE TO ACTIVE PAGE (AL) = CHAR TO WRITE CBL) = FOREGROUND COLOR IN GRAPHI CS MODE NOTE -- SCREEN WIDTH IS CONTROLLED BV PREVIOUS MODE SET (AH) 15 (OFH) CURRENT VIDEO STATE RETURNS THE CURRENT VIDEO STATE CAL) =: MODE CURRENTL V SET (SEE AH=O FOR EXPLANATION) (AH) = NUMBER OF CHARACTER COLUMNS ON SCREEN (BH) = CURRENT ACTI VE 0 I SPLAY PAGE (AH) 16 (10H) SET PALETTE REGISTERS CAL) 0 SET PALETTE REGISTER CBU = PALETTE REGISTER TO SET (OOH - OFH) (BH) = VALUE TO SET (Al) 1 SET BORDER COLOR REGISTER (8H) ::: VALUE TO SET CAL) 2 SET ALL PALETTE REGISTERS AND BORDER REGISTER ES:OX POINTS TO A 17 BYTE LIST BYTES 0 THRU 15 ARE VALUES ,FOR PALETTE REGI STERS 0 THRU 15 BYTE 16 I S THE VALUE FOR THE BORDER REGISTER NOTE: IN MODES USING A 32K REGEN (9 AND A), ACCESS THROUGH THE CPU REGISTER BY USE OF BBOOH SEGMENT VALUE ONLY REACHES THE FIRST 16K. BIOS USES THE CONTENTS OF THE CPU PAGE REG CBITS 3,4, a 5 OF PAGDAT IN BIOS DATA AREA) TO DERIVE THE PROPER SEGMENT VALUE. CS, 55, OS, ES, BX, CX, OX PRESERVED DURING CALL ALL OTHERS DESTROYED A-30 ROM BIOS VIDEO GATE ARRAY REGISTERS PORT 3DA OUTPUT REG 0 MODE CONTROL 1 REGI STER OIH +HI BANDWIDTH/-LOW BANDWIDTH 02H +GRAPHICS/-ALPHA 04H +B8W OSH +VIOEO ENABLE 10H +16 COLOR GRAPH! CS REG 1 PALETTE MASK REI STER o IH PALETTE MASK 0 02H PALETTE MASK 1 04H PALETTE MASK 2 OSH PALETTE MASK 3 REG 2 BORDER COLOR REGISTER 01H BLUE 02H GREEN 04H RED OSH I NTENS I TV REG 3 MODE CONTROL 2 REGI STER o IH RESERVED -- MUST BE ZERO 02H +ENABLE BL I NK 04H RESERVED -- MUST BE ZERO OSH +2 COLOR GRAPH I CS (640X200 2 COLOR ONL V) REG 4 RESET REGISTER 01H +ASYNCHRONOUS RESET 02H +SYNCHRONOUS RESET REGS 10 TO IF PALETTE REGI STERS 01H BLUE 02H GREEN 04H RED 08H I NTENSI TV VIDEO GATE ARRAY STATUS PORT 3DA INPUT o IH +0 t SPLAY ENABLE 02H +L I GHT PEN TR [GGER SET 04H -LIGHT PEN SWITCH MADE OSH +VERT I CAL RETRACE 10H +VIOEO DOTS ASSUME CS: CODE, DS: DATA, ES: VIDEO_RAM OCE9 HOOI0 LABEL WORD ; TABLE OF ROUTINES WITHIN VIDEO 110 OCE9 ODA5 OW OFFSET SET MODE OCEe E45E ow OFFSET SET=CTYPE OCED E488 OW OFFSET SET CPOS OCEr E520 OW OFFSET READ_CURSOR OCF 1 F751 OW OFFSET READ_LPEN ocr3 E483 OW OFFSET ACT 0 I SP PAGE OCF5 E503 ow OFFSET SCROLL UP OCF7 E63F ow OFFSET SCROLL-OOWN OCF9 FOE4 OW OFFSET READ AC CURRENT OCFe F 113 OW OFFSET WRITE_At_CURRENT OCFO F 12C DW OFFSET WRITE C CURRENT OCFF E543 OW OFFSET SET COd:i'R 0001 F IB7 OW OFFSET WRITE_DOT 0003 F146 R ow OFFSET READ DOT 0005 1992 OW OFFSET WRITE_TTY 0007 E581 OW OFFSET VIDEO STATE 0009 E6B5 OW OFFSET SET _PALLETTE = 0022 MOO 10L EQU $-MOO 10 0008 VIDEO_IO PROC NEAR 0008 FB STI I NTERRUPTS BACK ON ODOC FC CLD SET DIRECTION FORWARD 0000 06 PUSH ES ODOE 1E PUSH OS SAVE SEGMENT REGI STERS OOOF 52 PUSH OX 0010 51 PUSH CX 0011 53 PUSH BX 0012 56 PUSH SI 0013 57 PUSH 01 OD14 50 PUSH AX SAVE AX VALUE 0015 BA C4 MOV AL, AH GET I NTO lOW BYTE OD17 32 E4 XOR AH, AH ZERO TO HIGH BVTE 0019 01 EO SAL AX,I *2 FOR TABLE LOOKUP ODIB BB Fa MOV 51 ,AX PUT INTO S I FOR BRANCH 0010 3D 0022 CMP AX, MOOlOl TEST FOR WITHIN RANGE 0020 72 04 JB CI BRANCH AROUND BRANCH OD22 58 POP AX THROW AWAV THE PARAMETER 0023 E. OF70 JMP V IDEO_RETURN DO NOTHING IF NOT IN RANGE 0026 E8 1388 Cl: CALL DDS 0029 BB 8800 MOV AX, OBBOOH SEGMENT FOR COLOR CARD 002C BO 3E 0049 R D. CMP CRT_MODE, 9 I N MODE US I NG 32K REGEN 0031 72 D. JC C2 NO, ..JUMP 0033 BA 26 OOSA R MOV AH, PAGDAT GET COPY OF PAGE REGS 0037 80 E4 3B AND AH, CPUREG I SOlATE CPU REG OD3A 00 EC SHR AH, 1 SH I FT TO HAKE I NTO SEGMENT VALUE ODlC 8E CO C2, MOV ES,AX SET UP TO POINT AT VIDEO RAM AREA OD3E 58 POP AX RECOVER VALUE 003F BA 26 0049 R :~R~R~T:O~~: [SI+bF~~~T C~~~~~~ HODE INTO AH MOV 0043 2E: FF A4 OCE9 R JMP OD48 VIDEO_IO ENDP ROM BIOS A-31 SET MODE - THIS ROUTINE INITIALIZES THE ATTACHMENT TO THE SELECTED MODE. THE SCREEN IS BLANKED. INPUT (AL) = MODE SELECTED CRANGE O-B) OUTPUT NONE ; ------------------------------------------- 0048 M0050 LABEL WORD TABLE OF REGEN LENGTHS 0048 0800 OW 2048 MODE 0 40X25 BW 004A 0800 OW 2048 MODE 1 40)(25 COLOR OD4C 1000 OW 4096 MODE 2 80X25 OW 004E 1000 OW 4096 MODE 3 80X25 COLOR 0050 4000 OW 16384 MODE 4 320X200 4 COL.OR 0052 4000 OW 16384 MODE 5 320)(200 4 COLOR 0054 4000 OW 16384 MODE 6 640)(200 9W 0056 0000 OW 0 MODE 7 I NVALI 0 0058 4000 OW 163B4 MODE S 160)(200 16 COLOR OD5A 8000 OW 32768 MODE 9 320)(200 16 COLOR 005C 8000 OW 32768 MODE A 640X200 4 COLOR ; COLUMNS DOSE M0060 LABEL BYTE 005E 28 28 50 50 28 28 DB 40,40,80,80,40,40, BO, 0, 20, 40, BO 50 00 14 2B 50 ; ------- TABLE OF GATE ARRAY PARAMATERS FOR MODE SETTING 0069 M0070 LABEL BYTE ; ------ SET UP FOR 40)(25 OW MODE 0 0069 OC OF 00 02 DB OCH,OFH,O,2 ; GATE ARRAY PARMS = 0004 M0070L Eau S-M0070 ; ------ SET UP FOR 40X25 COLOR MODE 1 0060 08 OF 00 02 DB OSH, OFH, 0, 2 ; GATE ARRAY PARMS ; ------ SET UP FOR 80X25 BW MODE 2 0071 00 OF 00 02 DB DOH, OFH, 0, 2 ; GATE ARRAY PARMS ; ------ SET UP FOR 80><25 COLOR MODE 3 0075 09 OF 00 02 DB 09H, OFH, 0, 2 ; GATE ARRAY PARMS ; ------ SET UP FOR 320X200 4 COLOR MODE 4 0079 OA 03 00 00 DB OAH, 03H, 0, 0 GATE ARRAY PARMS ; ------ SET UP FOR 320X200 BW MODE 5 0070 OE 03 00 00 DB OEH, 03H, 0, 0 GATE ARRAY PARMS ; ------ SET UP FOR 640)(200 8W MODE 6 0081 OE 01 00 DB DB OEH, OlH, 0, 8 GATE ARRAY PARMS ; ------ SET UP FOR I NVALI 0 MODE 7 0085 00 00 00 00 DB OOH, OOH, 0, a ; GATE ARRAY PARMS ; ------ SET UP FOR 160X200 16 COLOR MODE 8 0089 lA OF 0000 DB lAH, OFH, 0, a ; GATE ARRAY PARMS ; ------ SET UP FOR 320X200 16 COLOR MODE 9 0080 18 OF 00 00 DB IBH, OFH, 0, a ; GATE ARRAY PARMS ; ------ SET UP FOR 640X200 4 COLOR MODE A 0091 OB 03 00 00 DB OBH, 03H, 0, a ; GATE ARRAY PARKS ; -------------- TABLES Of PALETTE COLORS FOR 2 AND 4 COLOR MODES 2 COLOR, SET 0 0095 M0072 LABEL BYTE 0095 00 OF 00 00 DB O,OFH,O,O = 0004 M0072L EQU $-M0072 ; ENTRY LENGTH 2 COLOR, SET 1 0099 OF 00 00 00 DB OFH,O,O,O 4 COLOR, SET 0 0090 M0074 LA8EL BYTE 0090 00 02 04 06 DB 0,2,4,6 4 COLOR, SET 1 OOAI M0075 LABEL BYTE ODA1 00 03 05 OF DB 0,3,5,OFH ODAS SET MODE PROC NEAR 00A5 50 - PUSH AX ; SAYE I NPUT MODE ON STACK 00A6 24 7F AND AL,7FH ; REMOVE CLEAR REGEN SWI TCH ODA8 3C 07 CMP AL,7 ; CHECK FOR VAll 0 MODES ODAA 74 04 .JE C3 j MODE 7 IS INVALID OOAC ac 08 CMP AL,OSH OOAE 72 02 JC C4 ;GREATER THAN A IS INVALID OOBO 00B2 90 00 3C 02 C3: C4; MOV CMP AL, AL,2 ° j DEFAULT TO MODE 0 ; CHECK FOR MODES NEEDI NG 128K OD84 74 08 JE C5 OOB6 3C 03 CMP AL,3 00B8 74 04 JE C5 OOSA 3C 09 CMP AL, 09H ODBC 72 OA JC C6 DOSE 81 3E 0015 R 0080 C5: CMP TRUE_MEM, 12B DO WE HAYE l28K? 00C4 73 02 JNC C6 YES, JUMP 00C6 BO 00 MOV AL,O NO, DEFAULT TO MODE a OOCS SA 0304 C6; MOV DX,0304H ADDRESS OF COLOR CARD 00C8 8A EO MOY AH, AL SAVE MODE IN AH OOCD A2 0049 R MOY CRT_MODE, Al SAVE I N GLOBAL VAR I A8LE 0000 89 16 0063 R MOY AOOR_6845, OX SAVE ADDRESS OF BASE 0004 8B FB MOV DI,AX SAVE MODE IN 01 0006 BA 03DA MOV OX, VGA_CTL POI NT TO CONTROL REGI STER 0009 EC IN AL,OX SYNC CONTROL REG TO ADDRESS OOOA 32 CO XOR AL, AL SET VGA REG 0 OOOC EE OUT OX, AL SELECT IT 0000 AO 0065 R HOV AL, CRT_MODE_SET GET LAST MODE SET OOEO 24 F7 AND AL, OF7H TURN OFF VIDEO ODE2 EE OUT OX, AL SET IN GATE ARRAY A-32 ROM BIOS SET DEFAULT PALETTES ODE3 8B C7 MOV AX, 0 I GET MODE ODE5 B. 10 MOV AH, 10H SET PALETTE REG 0 ODE7 BB 0095 R MOV ax, OFFSET M0072 POINT TO TABLE ENTRY ODEA 3C OS CMP AL,6 2 COLOR MODE? ODEe 74 OF JE C7 YES, JUMP ODEE BB ODA1 R MOV BX, OFFSET MOO7S PO I NT TO TABLE ENTRY ODF1 3C 05 CMP AL,5 CHECK FOR 4 COLOR MODE ODF3 74 08 JE C7 YES, JUMP ODF5 3C O. CMP AL,4 CHECK FOR 4 COLOR MODE ODF7 7. O. JE C7 YES .JUMP ODF9 3C OA CMP AL,OAH CHECK FOR 4 COLOR MODE ODFB 75 11 JNE C. NO, ,JUMP ODFD B9 0004 C7· MOV eX,4 NUMBER OF REGS TO SET OEOO 8A C4 CS: MOV AL, AH GET REG NUMBER OE02 EE OUT OX, AL SELECT 1 T OE03 2E 8A 07 MOV AL,CS: [BX] GET DATA OE06 EE OUT ox, AL SET IT OE07 FE C. INC AH NEXT REG OE09 43 INC BX NEXT TABLE VALUE OEOA E2 F4 LOOP CB OEOC EB OB JMP SHORT C11 SET PALETTES FOR DEFAULT 16 COLOR OEOE B. 0010 ~9: MOV CX,16 NUMBER OF PALETTES, AH IS REG COUNTER OEll BA C4 C10: MOV AL,AH GET REG NUMBER OE13 EE OUT ox, AL SELECT IT OE14 EE OUT ox, AL SET PALETTE VALUE OE15 FE Cd INC AH NEXT REG OE17 E2 F8 LOOP Cl0 SET UP MO & M1 IN PAGREG OE19 8B C7 MOV AX,DI GET CURRENT MODE OE1B 32 DB XOR BL,BL SET UP FOR ALPHA MODE OE10 3C O. eM? AL,4 I N ALPHA MODE OE1F 72 OB Je C12 YES, JUMP OE21 83 40 MOV BL,40H SET UP FOR 16K REGEN OE23 3C O' CMP AL,09H MODE USE 16K 0£25 72 02 JC C12 YES, JUMP OE27 B3 CO MOV aL,OCOH SET UP FOR 32K REGEN OE29 BA 030F C12· MOV ox, PAGREG SET PORT ADDRESS OF PAGREG OE2C AO 009A R MOV AL, PAGOAT GET LAST DATA OUTPUT DE2F 2. 3F AND AL,3FH CLEAR MO & H 1 BITS OE31 OA C3 OR AL, BL SET NEW BITS OE33 EE OUT ox, AL STUFF BACK I N PORT OE34 A2 008A R MOV PAGDAT, AL i SAVE COPY I N RAM ENABLE VIDEO AND CORRECT PORT SETTING OE37 BB C7 MOV AX,OI GET CURRENT MODE OE39 32 E4 XOR AH, AH I NTO AX REG OE3B B. 0004 MOV ex, M0070L SET TABLE ENTRY LENGTH OE3E F7 El MUL CX T! MES MODE FOR OFFSET INTO TABLE OE40 BB 08 MOV BX, AX T ABLE OFFSET I N ax OE42 81 C3 OD69 R ADD BX, OFFSET H0070 ADO TABLE START TO OFFSET OE46 2E: 8A 27 MOV AH,es, [BX] SAVE MODE SET AND PALETTE OE49 2E: 8A 47 02 MOV AL,es: rax + 2] Tl LL WE CAN PUT THEM IN RAM OE40 8B FO MOV 51, AX OE4F FA CLI o I SABLE INTERRUPTS OE50 EB E675 R CALL MODE_ALI VE KEEP MEMORY DATA VALID OE53 80 10 MOV AL,10H o I SABLE NMI AND HOLD REQUEST OE55 E. AO OUT NMI_PORT, AL OE57 8A 030A MOV OX, VGA_CTL OE5A 80 04 MOV AL,4 PO 1 NT TO RESET REG OESC EE OUT DX, AL SEND TO GATE ARRAY OESO BO 02 MOV AL,2 SET SYNCHRONOUS RESET OE5F EE OUT OX, AL , 00 IT i WHILE THE GATE ARRAY IS I N RESET STATE, WE CANNOT ACCESS RAM OESO 8B C6 MOV AX,51 RESTORE NEW MODE SET OE62 80 E4 F7 AND AH,OF7H TURN OFF VIDEO ENABLE OE6S 32 CO XOR AL, AL SET UP TO SELECT VGA REG 0 OE67 EE OUT OX, AL SELECT IT OE68 86 EO XCHG AH, AL AH IS VGA REG COUNTER OE6A EE OUT OX, AL SET MODE OE68 80 04 MOV AL,4 SET UP TO SELECT VGA REG 4 OE6o EE OUT OX, AL SELECT IT OE6E 32 CO XOR AL, AL OE70 EE OUT OX, AL REMOVE RESET FROM VGA NOW OKAY TO ACCESS RAM AGA I N OE71 BO 80 MOV AL, SOH ENABLE NMI AGAIN OE73 E6 AO OUT NHt _PORT, AL OE75 E8 E675 R CALL MODE_ALIVE KEEP MEMORY DATA VALID OE78 FB 5TI ENABLE J NTERRUPTS OE79 EB 07 JMP SHORT C 14 OE78 BA C4 e13 MOV AL, AH GET VGA REG NUMBER OE70 EE OUT ox, AL SELECT REG OE7E 2E: .A 07 MOV AL, CS· [BX] GET TABLE VALUE OEB1 EE OUT OX, AL PUT IN VGA REG OEB2 .3 C14, I NC ex NEXT I N TABLE OE83 FE C4 INC AH NEXT REG OEB5 E2 F4 LOOP C 13 ; DO ENT I RE ENTRY SET UP CRT AND CPU PAGE REGS ACCORD I NG TO MODE 8. MEMORY SIZE OEB7 BA 03DF HOV OX, PAGREG SET 10 ADDRESS OF PAGREG OE8A AD 008A R MOV AL, PAGDAT GET LAST DATA OUTPUT OE8D 24 CO AND AL, OCOH CLEAR REG BITS DEaF B3 3. MOV BL,36H SET UP FOR GRAPHICS MODE WITH 321< REGEN OE91 AB 80 TEST AL, BOH IN THI S MODE? OE93 75 DC JNZ C15 VES, JUMP OE95 83 3F MOV BL,3FH SET UP FOR 16K REGEN AND 12SK MEMORY OE97 81 3E 0015 R 0080 CMP TRUE_MEM, 128 DO WE HAVE 128K? OE90 73 02 JNC C15 YES, JUMP OE9F B3 lB MOV BL, lSH SET UP FOR 16K REGEN AND 64K MEMORY ROM BIOS A-33 OEAl OA C3 C15: OR AL, BL COHBINE MODE BITS AND REG VALUES OEA3 EE OUT OX, AL SET PORT OEA4 A2 008A R Mav PAGoAT, AL SAVE COpy 1 N RAM OEA7 8S CG Mav AX,SI PUT MODE 6ET & PALETTE I N RAM OEA9 88 26 0065 R Mav CRT_MaDE_SET, AH OEAD A2 0066 R Mav CRT PALLETTE, AL OEBO E4 61 IN AL, PORT_B GET CURRENT VALUE OF 8255 PORT B OEB2 24 FB ANa AL,OFBH SET UP GRAPHICS HODE OE84 F6 C4 02 TEST AH,2 JUST SET ALPHA MODE IN VGA? OEB7 75 02 JNZ C16 YES, JUMP OEB9 OC 04 OR AL,4 SET UP ALPHA MODE OEBS E6 61 C16; OUT PORT B, AL STUFF BACK 1 N 8255 ; ------- SET UP 6845- OE8D lE PUSH OS SAVE DATA SEGMENT VALUE OE8E 33 CO XOR AX, AX SET UP FOR ASSO SEGMENT OECO BE 08 MOV OS, AX ESTABLISH VECTOR TABLE ADDRESSING ASSUME OS: AS SO OEC2 C5 IE 0074 R LOS BX, PARK_PTR GET POINTER TO VIDEO PARMS ASSUME OS: CODE OEC6 88 C7 MOV AX,DI GET CURRENT MODE I N AX OEca 89 0010 90 MOV CX, M0040 LENGTH OF EACH ROW OF TABLE OECC 80 Fe 02 CMP AH,2 DETERMINE WHICH TO USE OECF 72 10 ,JC C17 HOoE ISO OR 1 OEDI 03 09 ADD BX, CX MOVE TO NEXT ROW OF INIT TABLE OED3 80 Fe 04 eMP AH,4 OEDS 72 09 JC C17 MODE IS 2 OR 3 OED8 03 09 ADD 8X, ex MOVE TO GRAPH I CS ROW OF INIT_TABLE OEDA 80 FC 09 CMP AH,9 OEDO 72 02 JC C17 MODE 15 4, 5, 6, 8, OR 9 OEDF 03 09 AOO BX, CX MOVE TO NEXT GRAPH I CS ROW OF I NI T TABLE ; BX POINTS TO CORRECT ROW OF INITIALIZATION TABLE OEE 1 50 C17: PUSH AX SAVE MODE IN AH OEE2 8A 47 02 MOV AL, os: [BX+21 ; GET HORZ. SYNC POSITION OEES 88 7F OA MOV DI,WORD PTR os: [9X+I0] GET CURSOR TYPE OEES IE PUSH OS OEE9 E8 1388 R CALL DDS ASSUME os; DATA OEEe A2 0089 R HOV HORZ_POS, AL SAVE HORZ. SYNC POSITION VARIABLE OEEF 89 3E OOSO R HOV CURSOR_MODE, 01 SAVE CURSOR MODE OEF3 50 PUSH AX OEF4 AO 00B6 R MOV AL, VAR_DELAY SET DEFAULT OFFSET OEF7 24 OF AND AL,OFH OEF9 A2 00B6 R MOV VAR_DELAY, AL OEFe 58 POP AX ASSUME OS: CODE OEFD IF POP as OEFE 32 E4 XDR AH, AH i AH WILL SERVE AS REG I STER NUMBER ; DURING LOOP OFOO SA 03D4 Mav oX,0304H i POI NT TO 6845 i LOOP THROUGH TA9LE, OUTPUTTING REG ADDRESS, THEN VALUE FROM TABLE OF03 8A C4 CIB: MOV AL, AH GET 6845 REG I STER NUMBER OF05 EE OUT OX, AL OF06 42 INC ox POI NT TO DATA PORT OF07 FE C4 INC AH NEXT REGISTER VALUE OF09 SA 07 MDV AL, [aX] GET TABLE VALUE OFOB EE OUT OX, AL OUT TO CHIP OFoe 43 INC BX NEXT IN TABLE OFOD 4A OEC ox BACK TO POINTER REGISTER OFOE E2 F3 LOOP C1B DO THE WHOLE TABLE OF 10 5B POP AX GET MODE BACK OF 11 IF POP as RECOVER SEGMENT VALUE ASSUME DS:OATA FILL REGEN AREA WITH BLANK OF 12 33 FF XOR 01,01 SET UP PO I NTER FOR REGEN OF 14 89 3E 004E R MOV CRT START, 0 I START ADDRESS SAVED IN GLOBAL OF 18 C6 06 0062 R 00 HOV ACTIVE_PAGE, 0 SET PAGE VALUE OF 10 SA POP OX GET ORIGINAL INPUT BACK OF IE 80 E2 90 AND OL, BOH NO CLEAR OF REGEN ? OF21 75 lC JNZ C21 SKIP CLEARING REGEN OF23 BA BBOO MOV oX,OB800H SET UP SEGMENT FOR 16K REGEN AREA OF26 B9 2000 MOV CX,8192 NUMBER OF WORDS TO CLEAR OF29 3C 09 CMP AL,09H REQUI RE 321< BYTE REGEN ? OF2B 72 05 JC C19 NO, JlJMP OF2D Dl El SHL CX, 1 SET 16K WORD S TO CLEAR OF2F SA IBOO MOV OX, 1800H SET UP SEGMENT FOR 32K REGEN AREA OF32 8E C2 C19· MOV ES,DX SET REGEN SEGMENT OF34 3C 04 CMP AL,4 TEST FOR GRAPHl CS OF36 89 OF20 MOV AX," + 15*256 FILL CHAR FOR ALPHA OF39 72 02 JC C20 NO GRAPH I CS INIT OF3B 33 CO XOR AX, AX FILL FOR GRAPHICS MODE OF 3D F31 AB C20: REP STOSW FILL THE REGEN BUFFER WITH BLANKS ENABLE V I OEO OF3F 8A 03DA C21: MOV OX, VGA_eTL SET PORT ADDRESS OF VGA OF42 32 CO XOR AL, AL OF44 EE OUT OX, AL SELECT VGA REG 0 OF45 AO 0065 R MOV AL, CRT _MODE_SET GET MODE SET VALUE OF48 EE OUT OX, AL SET MODE i - - - - - oETERMI NE NUMBER OF COLUMNS, BOTH FOR ENT! RE o I SPLAY AND THE NUMBER TO BE USED FOR TTY INTERFACE OF49 32 FF XOR BH, BH OF48 SA IE 0049 R MOV Bl, CRT_MODE OF4F 2E: 8A 87 OD5E R MOV AL, es: [ax + OFFSET M0060) OF54 32 E4 XOR AH, AH OF56 A3 004A R MOV CRT_COLs, AX NUMBER OF COLUMNS IN TH I S SCREEN A-34 ROM BIOS SET CURSOR POSITIONS OF59 01 E3 SHL BX, 1 ; WORD OFFSET I NTO CLEAR lENGTH ; TABLE OF5B 2E: 88 8F 0048 R "OVCX,CS:[BX + OFFSET H0050] i lENGTH TO CLEAR OF60 B9 OE 004C R "OVCRT_lEN, cx. i SAVE lENGTH OF CRT OF64 89 0008 MOV CX,8 ; CLEAR All CURSOR pas I TI ONS OF67 8F 0050 R MOV D I, OFFSET CURSOR_POSN OFEA IE PUSH OS ESTABLISH SEGMENT OFGS 07 POP ES ADDRESSING oFse 33 CO XOR AX, AX OF6E F31 A8 REP STOSW , FILL WITH ZEROES ; NOR HAL RETURN FROM ALL VIDEO RETURNS OF70 VIDEO RETURN: OF70 SF - POP DI OF71 5E POP 51 OF72 58 POP BX OF73 59 C22· POP CX OF74 5A POP OX OF75 1F POP DS OF76 07 POP ES ; RECOVER SEGMENTS OF77 CF IRET i ALL DONE OF7B SET_MODE ENDP KBONMI - KEYBOARD NMI INTERRUPT ROUTINE THIS ROUTINE OBTAINS CONTROL UPON AN NMI INTERRUPT, WHICH OCCURS UPON A KEYSTROKE FROM THE KEYBOARD. THIS ROUTINE WILL DE-SERIALIZE THE BIT STREAM IN ORDER TO GET THE KEYBOARD SCAN CODE ENTERED IT THEN I SSUES I NT 41 PASSING THE SCAN CODE IN Al TO THE KEV PROCESSOR. UPON RETURN IT RE-ENABLES NMI AND RETURNS TO SYSTEM (J RET) ASSUME C5:CODE,DS:DATA OF78 KBDNMJ PROC FAR i -----------0 I SABLE 1 NTERRUPTS OF78 FA CLI ; -----------SAVE REGS & 01 SABLE NMI OF79 5. PUSH 51 OF7A 57 PUSH OJ OF7B 50 PUSH AX ; SAVE REGS OF7C 53 PUSH BX OF7D 51 PUSH C)( OF7E 52 PUSH OX OF7F 1E PUSH OS OFSO O. PUSH ES i -----------lNIT COUNTERS OFBl BE 0008 MOV Sl,8 ; SET UP # OF DATA 8ITS OFB4 32 DB )(OR Bl, Bl ; INIT. PARITY COUNTER ; -----------SAMPlE 5 TI MES TO VALIDATE START BIT OF86 32 E4 XOR AH, AH OF88 B9 0005 MOV C)(,5 SET COUNTER OFBB E4 62 IN AL,PORT_C GET SAMPLE OFBO A8 40 TEST AL,40H TEST IF 1 OFBF 74 02 .JZ [2 JMP IF 0 OF91 FE C4 INC AH KEEP COUNT Of 1 'S OF93 E2 Fe 12: lOOP 11 KEEP SAMPl I NG OF95 80 Fe 03 CMP AH,3 VALID START BIT? OF98 73 03 JNB 125 JUMP IF OK OF9A EB 50 90 JMP 18 INVALID (SVNC ERROR) NO AUDIO ; OUTPUT i -----------VAlI 0 START BI T I LOOK FOR TRAILING EDGE OF90 B9 0032 125: MOV C)(,50 SET UP WATCHDOG T1 MEOUT OFAO E462 13: IN Al, PORT_C GET SAMPLE OFA2 AS 40 TEST Al,40H TEST IF a OFA4 74 05 JZ 15 JMP IF TRAILING EDGE FOUND OFA6 E2 F8 lOOP 13 KEEP lOOKING FOR TRAILING EDGE OFAB EB 4F 90 JMP 18 ; SYNC ERROR (STUCK ON 1 'S) . -----------READ CLOCK TO SET START OF BIT TI ME OFAB BO 40 15· MOV Al,40H READ CLOCK OFAD E6 43 OUT TIM_CTl, AL OFAF 90 NOP OFSD 90 NOP OFSI E4 41 IN Al, TlMER+l OFBl 8A EO MOV AH, AL OFB5 £-4 41 IN AL, T1MER+l OFB7 86 EO XCHG AH, AL OFBS 8B FB MOV 01, A)( , SAVE CLOCK TIME IN 01 i -----------VERIFY VALID TRANS 1 TI ON OFaB 89 0004 MOV CX,4 SET COUNTER OFBE E4 62 IN Al, PORT_C , GET SAMPLE OFCO AB 40 TEST AL,40H ; TEST IF 0 OFC2 75 35 JNZ IB ; JMP IF INVALID TRANSITION (SVNC) OFC4 E2 FB lOOP 16 ; KEEP lOOKING FOR VALID TRANSITION ; -----------SET UP DISTANCE TO MIDDLE OF 1ST DATA BIT OFC6 SA 0220 MOV DX,544 ; 310 USEC AWAV (. 83B US I CTl ; -------START lOOKING FOR TIME TO READ DATA BITS AND ASSEMBLE BYTE OFC9 EB 1031 R 17· CALL 130 OFec SA 020E MOV OX,526 SET NEW DISTANCE TO NEXT HALF BIT OfCF 50 PUSH AX SAVE 1ST HALF BIT OFDO EB 1031 R CALL 130 OFOl SA CB MOV Cl, AL PUT 2ND HALF BIT IN CL OFD5 58 POP AX RESTORE 1ST HALF BIT OF06 3A C8 CMP el, Al ARE THEY OPPOSITES? OFDB 74 2A JE 19 NO, PHASE ERROR ROM BIOS A-35 ,-----------VALID DATA BIT, PLACE I N SCAN BYTE OFDA DO EF SHR BM, 1 SHIFT PREVIOUS BITS OFOC OA F8 OR BH, AL OR IN NEW DATA BIT OFOE .E DEC 51 DECREMENT DATA BIT COUNTER OFOF 75 E8 JNZ 17 ; CONTINUE FOR MORE DATA BITS ,-----------WAI T FOR TIME TO SAMPLE PARI TY BIT OFEI E8 1031 R CALL 130 OFE4 50 PUSH AX SAVE 1ST HALF BI T OFES E8 1031 R CALL 130 OFE8 8A C8 MOV CL, AL PUT 2ND HALF BIT IN CL OFEA 5B POP AX RESTORE 1ST HALF 8 IT OFES 3A C8 CMP CL, AL ARE THEY OPPOS ITES ? OFEO 74 IS JE I. , NO, PHASE ERROR ; -----------VALID PARITY BIT, CHECK PARITY OFEF 80 E3 01 AND BL, 1 CHECK I F ODD PAR I TY OFF2 74 10 JZ 19 JMP I F PARITY ERROR ; -----------VAL I 0 CHARACTER, SEND TO CHARACTER PROCESSING OFF4 FB STI ENABLE INTERRUPTS OFFS BA C7 MOV AL,8H PLACE SCAN CODE IN AL OFF7 CD .B INT 4BH ; CHARACTER PROCESS I NG ; -----------RESTORE REGS AND RE-ENABEL NMI OFF9 07 18: POP ES ; RESTORE REGS OFFA IF POP OS orrs SA POP OX orFe 59 POP ex aFro 5B POP BX OFFE E4 AO IN AL,OAOH ; ENABLE NMI 1000 5B POP AX 1001 SF POP 01 1002 5E POP 51 1003 CF IRET ; RETURN TO SYSTEM ; -----------PAR I TY, SYNCH OR PHASE ERROR. OUTPUT MISSED KEY BEEP 1004 EB 1399 R 19: CALL DOS SETUP ADDRESSI NG 1007 B3 FE OB CMP SI, B ARE WE ON THE FI RST DATA Bl T? 100A 7. ED JE 18 NO AUD 1 0 FEEDBACK (MI GHT BE A · . GLITCH) lOOC F6 06 001B R 01 TEST KB_FLAG _l,OlH CHECK J F TRANSMI 551 ON ERRORS · . ARE TO BE REPORTED 1011 75 19 JNZ 110 1=00 NOT BEEP, O=8EEP 1013 BS 0080 HOV BX,oaOH DURATION OF ERROR BEEP 1016 B9 0049 HOV CX,048H FREQUENCY OF ERROR BEEP 1019 E9 E035 R CALL KB NOISE AUD I 0 FEEDBACK laIC 80 26 0017 R Fa AND KB:FLAG,OFOH CLEAR AL T , CLRL, LEFT AND RIGHT SHJ FTS 1021 BO 26 0018 R OF AND KB_FLAG _l,OFH CLEAR POTENTIAL BREAK OF INS,CAPS NUH AND SCROLL SHI FT 1026 BO 26 OOB8 R IF AND KB_FLAG_2, IFH CLEAR FUNCTI ON STATES 1028 FE 06 0012 R 110: INC KBD ERR KEEP TRACK OF KEYBOARD ERRORS 102F EB CB JHP SHORT IB RETURN FROM INTERRUPT 1031 KBONMI ENOP 1031 130 PROC NEAR 1031 BO .0 131 HOV AL,40H READ CLOCK 1033 E6 OJ OUT TI M_CTL, AL 1035 90 NOP 1036 90 NOP 1037 E4 41 IN AL, T1MER+l 1039 BA EO MaY AH, AL · 103B E4 41 IN AL, T1MER+1 1030 86 EO XCHG AH, AL 103F 88 CF MOV CX,OI GET LAST CLOCK T I ME 1041 28 C8 SUB CX, AX SUB CURRENT T I ME 1043 38 CA CMP ex, OX IS IT TIME TO SAMPLE? 1045 72 EA JC 131 NO, KEEP LOOKING AT TIME 1047 2B CA SUB CX, OX UPDATE. OF COUNTS OFF 1049 BB FB MOV 0 I, AX SAVE CURRENT TI ME AS LAST TI ME 104B 03 F. ADD DI,CX , ADD DIFFERENCE FOR NEXT TIME ; -----------START SAMPLING DATA BIT (5 SAMPLES) 1040 B. 0005 MOV CX,5 ; SET COUNTER SAMPLE LI NE PORT CIS SAMPLED CX TIMES AND IF THER ARE 3 OR MORE 1 "S THEN-SOH 15 RETURNED IN AL, ELSE OOH IS RETURNED IN AL. PARITY COUNTER IS MAINTAINED IN ES 1050 32 E4 XOR AH, AH CLEAR COUNTER 1052 E4 62 132: IN AL, PORT_C GET SAMPLE 1054 AB 40 TEST AL,40H TEST IF 1 1056 74 02 JZ 133 J"P IF 0 1058 FE C4 INC AH KEEP COUNT OF 1 'S 105A E2 F6 133 LOOP 132 KEEP SAMPL I NG 10SC BO FC 03 CHP AH,3 VALID 1 ? 105F 72 05 JB 134 JHP IF NOT VALID 1 1061 BO BO HOV AL,oaOH RETURN BOH IN AL ") 1063 FE C3 INC BL I NCREMENT PARI TY COUNTER 1065 C3 RET RETURN TO CALLER 1066 32 CO 134: XOR AL, AL RETURN 0 IN AL (0) 1068 C3 RET RETURN TO CALLER 1069 130 ENDP A-36 ROM BIOS ~ ;~;;;=~~~-~~------------------------------------------------------ THE PURPOSE OF THIS ROUTINE IS TO TRANSLATE SCAN CODES AND SCAN CODE COMBINATIONS FROM THE 62 KEY KEYBOARD TO THEIR EQUIVILENTS ON THE 83 KEY KEVBOARD. THE SCAN CODE IS PASSED 1 N AL. EACH SCAN CODE PASSED EITHER TR I GGERS ONE OR MORE CALLS TO INTERRUPT 9 OR SETS FLAGS TO RETAIN KEYBOARD STATUS. WHEN INTERRUPT 9 IS CALLED THE TRANSLATED SCAN CODES ARE PASSED TO IT IN AL THE INTENT OF THIS CODE WAS TO KEEP INTERRUPT 9 INTACT FROM ITS ORIGIN IN THE PC FAMILV THIS ROUTINE IS IN THE FRONT END OF INTERRUPT 9 AND TRANSFORMS A 62 KEY KEYBOARD TO LOOK AS I FIT WERE AN B3 KEY VERSION IT IS ASSUMED THAT THIS ROUTINE IS CALLED FROM THE NHI DESERIALlZATION ROUTINE AND THAT ALL REGISTERS WERE SAVED IN THE CALLING ROUTINE AS A CONSEQUENCE ALL REGISTERS ARE DESTROYED. ; EQUATES 0080 BREAK_BIT EOU 80H 0054 FN KEY EOU 54H 0055 PHi< EQU FN_KEY+ 1 0056 EXT_SCAN EOU PHK+1 BASE CODE FOR SCAN CODES EXTEND I NG BEVOND 93 COFF AND MASK EOU OFFH ; USED TO SELECTlVELV REMOVE BITS 001F CLEAR FLAGS EOU AND _MASK (FN_FLAG+FN_BREAK+FN_PEND I NG) • SCAN-CODES 0030 B KEY EOU 48 0010 Q-KEV EOU I. 0019 P-KEY EOU 25 0012 E=KEV EOU 18 001F S KEV EOU 31 0031 N=KEV EOU 49 0048 UP ARROW EOU 72 0050 DOWN_ARROW EOU 80 0048 LEFT ARROW EOU 75 0040 RIGHT_ARROW EOU 77 oooe MINUS EOU 12 0000 EQUALS EOU 13 OOOB NUM_O EOU 11 : j NEW TRANSLATED SCAN CODES ~~~~-------------------------------------------------- BREAK, PAUSE, ECHO, AND PRT_SCREEN ARE USED AS OFFSETS INTO THE TABLE 'SCAN' _ OFFSET = TABLE POSITION + 1. ~~~~------------~~~-----~~----------------------------- = 0001 = 0002 BREAK EQU 02 = 0003 PAUSE EQU 03 0004 PRT SCREEN EQU 04 = 0046 SCROLL_LOCK EQU 70 = 0045 NUH LOCK EQU 69 = 0047 HOME EGU 71 = OC4F END KEY EQU 79 0049 PAGE UP EQU 73 0051 PAGE-DOWN EGU a1 c04A KEVPAD MINUS EQU 74 004E KEYPAD=PLUS EGU 7B I. ASSUME CS; CODE, 05; DATA i ----TABLE OF VALID SCAN CODES 1069 KBO LABEL BYTE 1069 30 10 12 1F 31 DB B_KEV, Q_KEV, E_KEY, P_KEY, S_KEV, N_KEV 106F 48 50 4B 4D DC DB UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, MINUS 1074 00 DB EQUALS = oooe K80LEN EQU $ - KBD ; ----TABLE OF NEW SCAN CODES 1075 KB 1 LABEL BVTE 1075 02 03 01 04 46 45 DB BREAK, PAUSE, ECHO, PRT_SCREEN, SCROLL_LOCK, NUM_LOCK 1078 47 4F 49 51 4A 4E DB HOME, END_KEY, PAGE_UP, PAGE_DOWN, KEYPAD_MI NUS, KEYPAD_PLUS ; NOTE: THERE IS A ONE TO ONE CORRESPONDENCE BETWEEN THE SIZE OF KBO AND KB! :~~;~~-~;-~~~~;~~-~~;;~~-~~~~-~~~~~---------- THESE SCAN CODES WERE NUHERI C KEYPAD CODES ON THE 83 KEY KEVBOARD. ~~~-~~~~;-~~;~~-;;~~------------------------------ 1081 10B1 4F 50 51 48 4e 40 - DB 79,80, B1, 75, 76, 77, 71, 72, 73, 82 47 4B 49 52 ~ ~~;~~-~;-;~~~~~~;~-;~;;~;~;~~--------------------- THIS TABLE REPRESENTS A 4*2 ARRAY. EACH ROW CONSI STS OF A SEQUENCE OF SCAN CODES WHI CH WOULD HAVE BEEN GENERATED ON AN 83 KEY KEYBOARD TO CAUSE THE FOLLOW I NG FUNCTI ONS; ROW l=ECHO CRT OUTPUT TO THE PR INTER ROW 2=BREAK THE TABLE HAS BOTH MAKE AND BREAK SCAN CODES. 1088 SCAN LABEL BYTE 1098 10 37 B7 90 08 29,55,183,157 i CTRL + PRTSC 10eF 10 46 C6 90 DB 29,70,198,157 i CTRL + SCROLL-LOCK ROM BIOS A·37 ;TABLE OF VALID ALT SHIFT SCAN CODES THIS TABLE CONTAINS SCAN CODES FOR KEYS ON THE 62 KEY KEYBOARD. THESE CODES ARE USED IN COMBINATION WITH THE ALT KEY TO PRODUCE SCAN CODES FOR KEYS NOT FOUND ON THE 62 KEY KEyBOARD. ~~~:~;;~~-------~;;~~---;;~~----------------------- 1093 1093 35 29 34 lA 18 DB 53,40,52,26,27 = 0005 ALT_LEN EQU S - ALT_TABLE ;TABLE OF TRANSLATED SCAN CODES WITH ALT SHIFT THIS TABLE CONTAINS THE SCAN CODES FOR THE KEYS WHI CH ARE NOT ON THE 62 KEY KEYBOARD AND WILL BE TRANSLATED WITH AL T SH I FT . THERE I S A ONE TO ONE CORRESPONDENCE BETWEEN THE 51 ZES OF ALT_TABLE AND· NEW_ALT. THE FOLLOWING TRANSLATIONS ARE MADE: ALT+ I = \ AlT+ ALT+ [ = : ALT+ ] = ... AlT+ ~~~~;~;-~;;~~-;;;~--------------------------------- 1098 1098 2B 29 37 2B 29 DB 43,41,aS,43,41 ~ ~;~;;--------------------------------------------- TABLE OF SCAN CODES FOR MAPPING EXTENDED SET OF SCAN CODES (SCAN CODES) 85). THIS TABLE ALLOWS OTHER DEVICES TO USE THE KEYBOARO INTERFACE. IF THE DEVICE GENERATES A SCAN CODE) S5 THIS TABLE CAN BE USED TO MAP THE DEVI CE TO THE KEYBOARD. THE DEYICE ALSO HAS THE OPTION OF HAYING A UNIQUE SCAN CODE PUT IN THE KEYBOA.RD BUFFER (INSTEAD OF MAPPING TO THE KEVBOARD), THE EXTENDED SCAN CODE PUT I N THE BUFFER WILL BE CONT I NUOUS BEG I NN I NG AT 150. A ZERO WILL 8E USED IN PLACE OF AN ASCI I CODE. (E. G. A DEVICE GENERATING SCAN CODE B6 AND NOT MAPPING 86 TO THE KEY80ARD WILL HAVE A [150,0] PUT IN THE KEYBOARD BUFFER) TASLE FORMAT: THE FIRST SYTE 15 A LENGTH INDICATING THE NUMBER OF SCAN CODES MAPPED TO THE KEYBOARD. THE REMAI NI NG ENTRIES ARE WORDS. THE FIRST BVTE (LOW BYTE) IS A SCAN CODE AND THE SECOND BYTE (HIGH SYTE) IS ZERO. A DEVICE GENERATING N SCAN CODES IS ASSUMED TO GENERATE THE FOLLOWING STREAM 86,81,S8, ... ,86+(N-1)' THE SCAN CODE BYTES IN THE TABLE CORRESPOND TO THIS SET WITH THE FIRST I).ATA BYTE MATCHING B6, THE SECOND MATCHING 81 ETC. NOTES: (1) IF A DEYICE GENERATES A BREAK CODE, NOTHING IS PUT I N THE BUFFER. (2) A LENGTH OF 0 INDICATES THAT ZERO SCAN CODES HAYE BEEN. MAPPED TO THE KEYBOARD AND ALL EXTENDED SCAN CODES WILL BE USED. (3) A DEV I CE CAN MAP SOME OF ITS SCAN CODES TO THE KEYBOARD AND HAYE SOME I TS SCAN CODES I N THE EXTENDED SET. 1090 E>CTAB LABEL BYTE 1090 14 DB 20 ; LENGTH OF TABLE 109E 0048 0049 0040 0051 DW 72,73,11,81,80,79,75,11,51.28' 0050 004F 0048 0047 0039 001C 1082 0011 0012 00 IF 0020 OW 17,18,31,45,44.43,30,16,15,1 002C 0028 DOlE 0010 OOOF 0001 10C6 KEY62_INT PROC FAR 10C6 Fa STl 10C7 FC CLO FORWARD DIRECT I ON 10CB EB 1388 R CALL DDS SET UP ADDRESSING loeB 8A EO MOV AH, AL SAVE SCAN CODE lOCO £8 131E R CALL TPM ADJUST OUTPUT FOR USER MODIFICATION 1000 73 01 JNC KBXO JUMP I F OK TO CONT 1NUE 1002 CF tRET RETURN FROM INTERRUPT. ; ----EXTENDED SCAN CODE CHECK 1003 3C FF KSXO: CMP AL,OFFH IS THIS AN OVERRUN CHAR? 1005 74 6C JE KBO_l ; PASS IT TO INTERRUPT 9 1007 24 7F AND AL,AND_MASK-SREAK_BIT ; TURN OFF BREAK SIT 1009 3C 56 CfIIP AL, EXT_SCAN ; IS THIS A SCAN CODE) 83 10DB 7C 5F JL KSX4 ; REPLACE 8REAK BIT ; ----SCAN CODE IS IN EXTENDED SET 1000 IE PUSH OS lODE 33 F6 XOR SI,SI IDEO BE DE MOV OS, SI ASSUME OS: ABSO 10E2 C4 3E 0124 R LES DI.DWORD PTR EXST ; GET THE POINTER TO THE EXTENDED ; SET 10E6 26: SA 00 MOV CL, BYTE PTR ES: [0 I) ; GET LENGTH BYTE 10E9 IF POP OS ASSUME OS: DATA ; ----ODES SCAN CODE GET MAPPED TO KEVBOARD OR TO NEW EXTENDED SCAN COo.ES? IDEA 2C 56 SUB AL, EXT_SCAN CONVERT TO BASE OF NEW SET 10EC FE C9 DEC CL LENGTH - 1 IDEE 3. Cl CMP AL,CL IS CODE IN TABLE? 10FO 7F 10 JG KBX1 JUMP IF SCAN CODE IS NOT IN TABLE A-38 ROM BIOS ; ----GET SCAN CODE FROM TABLE 10F2 47 INC 01 POINT 01 PAST LENGTH BYTE 10F3 BS DB HOV 8X, AX lars 32 FF XOR BH, BH PREPARE FOR ADDING TO 16 BIT REGISTER 10F7 01 E3 SHL aX,l 10F9 03 FB ADD 0 I, BX , OFFSET TO CORRECT TABLE ENTRY 10FS 26: BA 05 MOV AL,BYTE PTR ES: [OIl, TRANSLATED SCAN CODE IN AL 10FE 3C 56 CMP AL,EXT_SCAN ; IS CODE IN KEYBOARD SET? 1100 7C 3A -JL KBX4 ; I N KEYBOARD SET, CHECK FOR BREAK ; ----SCAN CODE GETS MAPPED TO EXTENDED SCAN CODES 1102 F6 e4 80 KBX1; TEST AH, BREAK_SI T IS THIS A BREAK CODE? 1105 74 01 -JZ KBX2 MAKE CODE, PUT IN BUFFER I !~~~ ~~ C4 40 IRET BREAK CODE, RETURN FROM INTERRUPT KBX2· ADD AH, &4 EXTENDED SET CODES BEGIN AT 150 110S 32 CO XOR AL, AL ZERO OUT ASCII VALUE (NULl 110D 88 IE ODIC R MOV BX,BUFFER_TAIL GET TAIL POINTER 1111 88 F3 MOV SI,BX SAVE POINTER TO TAIL 1113 E8 144F R CALL K4 INCREMENT TAJ l VALUE 1116 38 IE OOlA R eMP ex, BUFFER_HEAD I S BUFFER FULL? 111A 75 19 -JNE KBX3 ; PUT CONTENTS OF AX IN BUFFER i ----BUFFER IS FULL, BEEP AND CLEAR FLAGS 111C B8 0080 MOV BX, SOH FREQUENCY OF BEEP 111F 89 0048 MOV CX,4BH DURATION OF BEEP 1122 EB E035 R CALL KB NO I SE BUFFER FULL BEEP 1125 80 26 0017 R Fa AND KB:FLAG, OFOH CLEAR ALT, CTRL, LEFT AND RIGHT SHI FTS 112A 80 26 0018 R OF AND CLEAR MAKE OF INS, CAPS_LOCK, NUM AND SCROLL 112F 90 26 0088 R IF AND CLEAR FUNCTION STATES 1134 CF IRET DONE WI TH INTERRUPT 1135 89 04 K8X3; HOV [51], AX PUT CONTENTS OF AX IN BUFFER 1137 89 IE ODIC R HOV BUFFER_TAIL, ex ADVANCE BUFFER TAl l 1138 CF IRET RETURN FROM INTERRUPT l13C 80 E4 80 K8X4 AND AH, BREAK BIT MASK BREAK BIT ON ORIGINAL SCAN 113F OA C4 OR AL, AH - UPDATE NEW SCAN CODE HOV KEYB~~R:L s~ ~~~~R~~C ~N:H C~~~~~UMLOCK 1141 BA EO i ----83 KEY FUNCT I ONS I I 1143 3C 45 K80_1: CMP AL, NUM_KEY I S THIS A NUHLOCK? 1145 75 14 JNE KBO_3 i CHECK FOR PRTse 1147 F6 06 0017 R 04 TEST KB_FLAG, CTl_SHIFT ; IS CTRL KEY BEING HELD DOWN? 114C 74 OA JZ K80_2 , NUMLOCK WITHOUT CTRL, CONTINUE 114E F6 06 0017 R 08 TEST KB_FLAG,ALT_SHIFT ; IS ALT KEY HELD CONCURRENTLV? 1153 75 03 JNZ I 08 0088 R 04 TP3: TEST KB_FLAG_2, HALF_RATE; ARE WE IN HALF RATE MODE 137A 74 BC J2 TP ; JUMP I F WE ARE I N NORMAL MODE 137C 90 36 0098 R 01 XOR KB_FLAG_2, PUTCHAR ; TOGGLE BIT 1381 F6 06 0088 R 01 TEST KB_FLAG_2, PUTCHAR ; I SIT TIME TO PUT OUT A CHAR 1386 75 80 JNZ TP NOT TI ME TO OUTPUT CHARACTER 138B TP4: SKI P THI S CHARACTER 1389 F. STC SET CARRY FLAG 1399 58 POP 8X 138A C3 RET 13B8 TPM ENOP : ; -~~~;-;~;;~~~~~~-~~~~-~~-~~-;~~~;-~~-~~~-;;~~-~~;~-~;~~-------- INPUT, NONE i OUTPUT, OS IS SET j --------------------------------------------------------------- 13BS DDS PROC NEAR 1388 50 PUSH AX 13SC 88 0040 HOV AX,40H 13BF BE 08 HOV OS, AX 1391 58 POP AX 1392 C3 RET 1393 DDS ENDP INT lA ---------------------------------------------------- TIME OF DAY/SOUND SOURCE SELECT - THIS ROUTI NE ALLOWS THE CLOCK TO BE SET IREAD AN INTERFACE FOR SETTING THE MULTIPLEXER FOR AUO I 0 SOURCE I S ALSO PROVIDED INPUT (AH) = 0 READ THE CURRENT CLOCK SETT] NG RETURNS ex = HI GH PORTI ON OF COUNT OX = LOW PORTI ON OF COUNT AL = 0 1FT I MER HAS NOT PASSED 24 HOURS SINCE LAST READ. () 0 IF ON ANOTHER DAY (AH) = 1 SET THE CURRENT CLOCK CX HIGH PORT I ON OF COUNT OX LOW PORTI ON OF COUNT (AH) ;;; 90H SET UP SOUND MULTIPLEXER AL =(SOURCE OF SOUND) --) "AUDIO OUT" OR RF MODULATOR 00 8253 CHANNEL 2 01 CASSETTE INPUT 02 = "AUDIO IN" LINE ON I/O CHANNEL 03 "" COMPLEX SOUND GENERATOR CH I P NOTE: COUNTS OCCUR AT THE RATE OF 1193180/65536 COUNTS/SEC (OR ABOUT 18. 2 PER SECOND -- SEE EQUATES BELOW) --------------------------------------------------------------- ASSUME CS: CODE, OS: DATA 1393 TI ME_OF _DAY PROC FAR 1393 F8 STI I NTERRUPTS BACK ON 1394 IE PUSH DS SAVE SEGMENT 139~ E8 138B R CALL DDS 139B 80 FC 90 CHP AH, BOH AH=80 139B 74 2E JE T4A MUX SET-UP 1390 OA E4 OR AH, AH AH;;;O 139F 7. 07 JZ T2 READ _TIME 13Al FE CC DEC AH AH=l 13A3 7. I. J2 T3 SET TIME 13A5 FB T1: STI I NTERRUPTS BACK ON 13A6 IF POP DS RECOVER SEGMENT 13A7 CF IRET RETURN TO CALLER 13A8 FA T2: CLI NO TIMER INTERRUPTS WHILE READING 13A9 AO 0070 R MOV AL, Tl MER_OFL 13AC C6 06 0070 R 00 MOV TI MER_OFL, 0 GET OVERFLOW, AND RESET THE FLAG 13Bl BB OE DOGE R HOV ex, TI MER_HI GH 1385 8B I . 006C R HOV OX, TI MER_LOW 1389 E8 EA JHP T1 TOD RETURN 1388 FA T3: CLI NO INTERRUPTS WHILE WRITING 13BC 8. I . OOSC R HOV TI MER_LOW, OX 13CO 8. DE 006E R MOV TIMER_HIGH, ex SET THE TIME 13C4 CS O. 0070 R 00 HOV TI MER_OFL, 0 RESET OVERFLOW 13C9 EB DA JHP T1 TOO _RETURN A-42 ROM BIOS 13CS 51 T4A: PUSH ex 13CC 91 05 MOV CL,5 13CE D2 EO SAL AL,CL SHIFT PAR" BllS LEFT 5 POSITIONS 1300 S6 C4 XCHG AL,AH SAVE PARM 1302 E04 61 IN AL, PORT_B GET CURRENT PORT SETT I NGS 130-4 204 9F AND AL,100111118 ISOLATE MUX BITS 1306 OA C04 OR AL, AH COMBINE PORT BrTS/PAR" BITS 1308 E6 61 OUT PORT_B, AL 5ET PORT TO NEW VALUE 13DA 59 POP ex 1308 EB C8 JMP Tl 1300 ENDP ; ---- tNT 16 ------------------------------------------------------ KEVBOARD 1/0 THESE ROUT! NES PROVI DE KEYBOARD SUPPORT INPUT (AH)::O READ THE NEXT Ase I I CHARACTER STRUCK FROM THE KEYBOARD, RETURN THE RESULT IN (AL), SCAN CODE IN (AH) (AH)::l SET THE Z FLAG TO INDICATE IF AN ASCII CHARACTER IS AVA-J LABLE TO BE READ. (Z·Fl=-l -- NO CODE AVAILABLE (ZF)=O -- CODE IS AVAILABLE IF 'ZF c::: 0, THE NEXT CHARACTER I N THE BUFFER TO BE READ IS IN AX, AND T-HE ENTRY REMAINS IN THE BUFFER (AH)::2 RETURN THE CURRENT SHIFT STATUS IN AL REGISTER THE BIT SETTI-NGS FOR THIS CODE ARE INDICATED IN THE THE EQUATES FOR KB FU~G (AH)::3 SET TVPAMATIC RATES. THE TVPA-MATIC RATE CAN 8E CHANGED USING THE FOLLOWING FUNCTIONS: (AL )::::0 RETURN TO DEF AUL T. RESTORES OR I G I NAL STATE. I. E. TVPAMATIC ON. NORMAL INITIAL "DELAV, AND NORMAL TVPAMATIC RATE. (AU=l INCREASE INITIAL DELAY. THIS IS THE DELAY BETWEEN THE FIRST CHARACTER AND THE BURST OF lVPAHATIC -CHARS. (AL )::2 HALF_RATE. SLOWS TYPAHATI C CHARACTERS -BY ONE HALF. (ALI::::3 COHBINES AL=l-AND AL=2. INCREASES INITIAL DELAV AND SLOWS TYPAMATIC CHARACTERS BY ONE HALF. (AU=4 TURN OFF TVPA'MATIC CHARACTERS. ONLY t.HE FIRST CHARACTER IS HONORED. ALL OTHERS ARE IGNORED. AL IS RANGE CHECKED. IF AL(O OR AL>4 THE STATE REMAI NS THE SAME. ***NOTE*** EACH TIME THE TYPAMATIC RATES ARE CHANGED ALL PREVIOUS STATES ARE REMOVED. I. E. IF THE KEVBOARD IS IN THE HALF RATE MODE AND YOU WANT TO ADD AN INCREASE IN TYPAHATIC DELAY, YOU MUST CALL THIS ROUTINE WITH AH=3 AND AL::3. (AH)::4 ADJUST KEYBOARD By THE YALUE-IN AL AS FOLLOWS; (AL)::O TURN OFF KEYBOARD CLICK. (AL):: 1 TURN ON KEYBOARD CL I CK. AL IS RANGE CHECKED. THE STATE IS UNALTERED IF AL <> 1,0. OUTPUT AS NOTED ABOVE, ONL V AX AND FLAGS CHANGED ALL REGISTERS RETAINED k~~~~~~~-~~-----;;~~----~~~--------------------------- ------------- 1300 ASSUME Cs: CODE, os· DATA 1300 FB sn 1 NTERRUPTS BACK ON 13DE 1£ PUSH OS SAVE CURRENT OS 13DF 53 PUSH BX SAVE BX TEMPORARILY 13EO E8 1388 R CALL DDS POINT tiS AT BIOS DATA SEGMENT 13E3 OA .E04 OR AH, AH AH::O 13£5 704 OA JZ Kl ASCII READ 13E7 FE CC DEC AH AH::1 - 13£9 704 IE JZ K2 ASCII STATUS 13Es FE CC DEC AH AH::2 - 13EO 74 28 .JZ K3 SHIFT_STATUS 13EF EB 2E JMP SHORT K3 1 READ THE KEY TO FIGURE OUT WHAT TO DO 13Fl K1: ASCI I READ 13F 1 FB sn I NTERRUPTS BACK ON DURI NG LOOP 13F2 90 NOP ALLOW _AN I NTERRUPT TO OCCUR 13Fa FA ell .1 NTERRUPTS BACK OFF 13F04 aa IE aOlA R HOV ax, BUFFER_HEAD GET POINTER TO HEAD OF SUFFER 13rs 38 IE ODIC R CMP BX, BUFFER_TAl L TEST END OF BUFFER 13FC 704 FJ JZ 01 LOOP UNTI L SOHETH I NG I N BUFFER 13rE se 07 HOV A)(, [ex] GET SCAN CODE AND ASCI I CODE 10400 E8 1044F R CALL 04 MOVE POINTER TO NEXT POSITION 1403 S9 IE 001A R HOV BUFFER_HEAD I ex ; STORE VALUE IN VARI ABLE 1407 EB 43 JHP SHORT RET J NT 16 ; ------ ASCI J STATUS - 1409 FA K2: CLl I NTERRUPTS OFF 140A 88 IE 001A R MOV BX, BUFFER_HEAD GET HEAD POt NTER 140E 38 1£ DOle R CMP B)(, BUFFER TAIL IF EQUAL (Z=1I THEN NOTHING THERE 1412 88 07 MOV AX, (BX] - 1414 FB ST! I NTERRUPTS BACK ON 1415 sa POP ex RECOVER REGI STER 1416 1F POP os RECOVER SEGMENT 1417 CA 0002 RET 2 THROW AWAY FLAGS ; SHIFT STATUS 141A AO 0017 R K3: MOV AL, KB_FLAG I GET THE SHIFT STATUS FLAGS 1410 EB 20 JMP SHORT RET _I NT 16 A-ROM BIOS A-43 ; ------- ADJUST KEV CLI CK 141F FE CC K3_1: DEC AH 1421 74 lA .JZ K3_3 AH=3, ADJUST TVPAMATIC 1423 FE CC DEC AH RANGE CHECK FOR AH=4 1425 75 25 .JNZ RET_I NT 16 ILLEGAL FUNCT I ON CALL 1427 OA CO OR Al, Al TURN OFF KEVBOARD CLICK'? 1429 75 07 .JNZ K3_2 ; .JUMP FOR RANGE CHECK 1428 80 26 0018 R FB AND KB_FLAG_l,AND_MASK-CLICK_ON ; TURN OFF CLICK 1430 E8 lA ..IMP SHORT RET I NT 16 1432 3C 01 K3_2: CMP AL, 1 - ; RANGE CHECK 1434 75 16 .JNE RET_I NT 16 ; NOT I N RANGE, RETURN 1436 80 OE 0018 R 04 OR KB_FLAG_l,Cl1CK_ON • TURN ON KEYBOARD CLICK 1438 ES OF JMP SHORT RET_I NT 16 1430 3C 04 K3_3: ~~~ TVPA:~~!C CHECK FOR CORRECT RANGE 143F 7F DB .JG RET_I NT 16 I F I LlEGAl VALUE IN Al 1 GNORE 1441 80 26 0088 R Fl AND KB_FLAG_2, OF IH MASK OFF ANV OLD TVPAMATIC STATES 1446 DO EO SHL Al,1 SHI FT TO PROPER POSITION 144B OB 06 008B R OR KB_FLAG_2, AL 144C RET_I NT 16; 144C 58 POP BX RECOVER REG] STER 144D IF POP OS RECOVER REGISTER 144E CF IRET RETURN TO CALLER 144F KEYBOARD_I a ENOP ; ------ INCREMENT A BUFFER POINTER 144F K4 PROC NEAR 144F 43 INC 8)( MOVE TO NEMT WORD ] N 11 ST 1450 43 INC 8M 1451 38 IE 0082 R CMP ax,8UFFER_END AT END OF BUFFER? 1455 75 04 .JHE K5 NO, CONTI HUE 1457 88 IE 0080 R MOV BM,BUFFER_START YES, RESET TO BUFFER BEGINNING 1458 C3 K5: RET 145C K4 EHOP ; ------ TABLE OF SHI FT KEVS AND MASK VALUES 145C K6 LABEL BVTE 145C 52 DB I NS_KEV ; INSERT KEV 1450 3A 45 46 3B 10 DB CAPS_KEV, NUM_KEV, SCROLL_KEV, ALl_KEV, CTL_KEV 14&2 2A 36 DB lEFT _KEV, RI GHT_KEV = 0008 K6L EQU .-K6 ; ------ SHIFT_MASK_TABLE 1464 K7 LABEL BVTE 1464 80 08 INS_SHIFT ; INSERT MODE SHIFT 1465 40 20 10 08 04 DB CAPS_SHIFT, NUH_SHI FT, SCROLL_SHIFT, Al T_SHI FT, CTL_SHIFT 146. 02 01 DB LEFT_SHIFT, RIGHT_SHIFT 146C IB FF 00 FF FF FF K8 SCAN COD~BTABlES27,_1,O,_I,_I,_1,30,_1 IE FF 1474 FF FF FF IF FF 7F DB -1,-1,-1,31,-1,127,-1,17 FF 11 147C 17 05 12 14 19 15 DB 23,5,18,20,25,2.1.,9,15 09 OF 1484 10 18 10 0. FF 01 OS 16,27.29,10, -1,1,19 13 1488 04 06 07 08 OA OB DB 4,6,7,8,10,11,12,-1,-1 OC FF FF 1494 FF FF Ie lA 18 03 DB -1, -1, 28, 26, 24, 3, 22, 2 16 02 149C OE OD FF FF FF FF DB 14,13, -1, -1, -1, -1, -1,-1 FF FF 14A4 20 FF DB ' ',-1 ; -------- eTl TABLE SCAN 14A6 Kg LABEL 8VTE 14A6 5E 5F 60 61 62 63 DB 94,95,96,97,98,99,100,101 64 65 14AE 66 67 FF FF 77 FF 08 102,103, -1, -1,119, -1,132,-1 84 FF 14B6 73 FF 74 FF 75 FF DB 115,-1,116,-1,117,-1,118,-1 76 FF 148E FF DB -1 ; ------- lC TA8LE 14BF KID LABEL BVTE 148F 18 31 32 33 34 35 DB DISH, , 1234567890-=', DSH, OSH 36 37 38 39 30 20 3D 08 09 14CE 71 77 65 72 74 79 DB 'qwertyulop[]',ODH,-I, 'asdfghJkl; ',027H 75 69 6F 70 58 5D aD FF 61 73 64 66 67 68 6A 6B 6C 38 27 14E7 60 FF 5C 7. 78 63 DB 60H,-I,5CH, 'zlIcYbnm,.I',-l, '.',-1,' , 76 62 6E 6D 2C 2E 2F FF 2A FF 20 14F8 FF DB -1 • ------ UC TABLE K 11 LABEL BVTE 14F9 14F9 18 5E 21 26 40 2A 23· 24 25 2B 29 SF DB 27, '! N$', 37, 05EH, 'I.' )_+', 08H, 0 28 08 00 1508 51 57 45 52 54 59 DB 'QWERTVUIOP{}', DOH, -I, 'ASDFGH.JKL;'" 55 49 4F 50 79 7D 00 FF 41 53 44 46 47 4S 4A 4B 4C 3A 22 1521 7E FF 7C 5A 58 43 DB 07EH, -1,' :ZMCYBNM(>?', -1, 0, -1,' ',-1 56 42 4£ 4D 3C 3E 3F FF 00 FF 20 FF A-44 ROM BIOS ; ------ UC TABLE SCAN 1533 K 12 LABEL BVTE 1533 54 55 56 57 58 59 D8 84,85,86,87, B8, 89,'0 5A 153A 58 5e 50 08 91,92,93 ; ------ AL T TABLE SCAN 1530 K 13 LABEL BYTE 1530 68 69 6A 69 6e DB 104, 105, 106, 107, 108 1542 6D BE SF 70 71 DB 109, 110,111,112,113 ; ------ NUM STATE TABLE 1547 K 14 LABEL BYTE 1547 37 38 39 2D 34 35 DB '789-456+1230. ' 3628313233'30 2E BASE CASE TABLE 1S54 LABEL BYTE 1554 47 48 49 FF 48 FF DB 71,72,73,-1,75,-1,77 40 1558 FF 4F 50 51 52 53 DB -1,79, SO, 81, 82, 83 ; ------ KEYBOARD I NTERRUPT ROUT I NE 1561 teB INT PRoe FAR 1561 Fa - STI ; ALLOW FURTHER INTERRUPTS 1562 50 PUSH AX 1563 53 PUSH ex 1564 51 PUSH cx 1565 52 PUSH OX US6B 56 PUSH SI 1567 57 PUSH 01 1568 IE PUSH OS 1569 06 PUSH ES 156A Fe CLO i FORWARD 0 I RECTI ON 156B £8 1388 R CALL DDS 156E 8A EO MOY AH, AL i SAVE SCAN CODE IN AH TEST fOR OVERRUN SCAN CODE FROM KEYBOARD 1570 3t FF CMP AL,OFFH IS TH I S AN OVERRUN CHAR? 1572 75 19 JNZ K16 NO, TEST FOR SHIFT KEY 1514 BS 0080 MOY SK, BOH DURATION OF ERROR BEEP 1577 ss 0048 MOV CK,48H FREQUENCY OF TONE 151 A £8 E035 R CALL KB_NOISE BUFFER FULL BEEP 1570 80 26 0017 R Fa AND KB_FLAG,OFOH CLEAR AL T , CLRL, LEFT AND RIGHT SHIFTS 1582 80 26 0018 R OF AND CLEAR POTENTI AL BREAK OF INS j CAPS ,NUM AND SCROLL SH I FT 1587 80 26 0088 R IF AND KB_FLAG_2, IFH CLEAR FUNCTION STATES 15Be £9 164A R ..IMP K2& END OF INTERRUPT ; ------ TEST FOR SHI FT KEYS IsaF K16: TEST_SHIFT IsaF 24 7F AND AL,07FH TURN OFF THE BREAK BIT 1591 DE PUSH CS 1592 07 POP ES ESTABLISH ADDRESS OF SHIFT· TABLE 1593 SF 14!5C R MOV D I, OFFSET K6 SHI FT KEY TA8lE 1596 89 0009 HOV CK, K6L LENGTH 1599 F21 AE REPNE SCASB LOOK THROUGH THE TABLE FOR A MATCH 159B 8A C4 MOV AL,AH RECOVER SCAN CODE 1590 74 03 JE K17 JUMP I F MATCH FOUND 159F £9 163A R JMP K25 I~ NO MATCH, THEN SHIFT NOT FOUND ; ------ SHIFT KEY FOUND 15A2 81 EF 1450 R K17: SUB DI,OFFSET K6+1 ADJUST PTR TO SCAN tODE MATCH 15A6 2£: 8A A5 1464 R MOV AH,CS:K7[Dll GET MASK INTO AH 15A8 A8 80 TEST AL,80H TEST FOR BREAK KEY 15AD 75 51 JNZ K23 ; BREAK_SHIFT_FOUND ;------ sHIFT MAKE FOUND, DETERMINE SET OR TOGGLE 15AF 80 Fe 10 CMP AH,SCROLL_SHIFT 1582 73 07 JAE K18 ; IF SCROLL SHIFT OR ABOVE, TOGGLE ; KEY ;------ PLAIN SHIFT KEY, SET SHIFT ON 15B4 08 26 0017 R OR KB_FLAG, AH ; TURN ON SHI FT SIT 15B8 £9 164A R JMP K26 i INTERRUPT_RETURN i - - - - - - TOGGLED SHI FT KEY, TEST FOR 1ST MAKE OR NOT 1598 K18: ; SHIFT-TOGGLE I!5BB F6 06 0017 R 04 TEST KB_FlAG, tTL_SHIFT i CHECK CTL SHIFT STATE 15cO 75 78 JNZ K25 i JUMP I F eTl STATE 15C2 3C 52 CMP AL, INS_KEY i CHECK FOR I NSERT KEY 15C4 75 22 JNZ K22 ; JUMP I F Nor I NSERT KEY 15C6 F6 06 0017 R 08 TEST KB_FLAG, ALT_SHIFT ; CHECK FOR ALTERNATE SHIFT 15C8 75 60 JNZ K25 i JUMP IF ALTERNATE SHIFT 15CD Fa 06 0017 R 20 TEST KS_FLAG, NUM_STATE ; CHECK FOR BASE STATE 15D2 75 00 JNZ K21 ; JUMP IF NUM LOCK IS ON 15D4 F6 06 0017 R 03 TEST KB_FLAG, LEFT_SHIFT+ RIGHT_SHIFT 1509 74 00 JZ K22 JUMP I F BASE STATE 160B K20: ; NUMERIC ZERO, NOT INSERT KEY 15DB 98 5230 HOV AX, 5230H ; PUT OUT AN ASCI I ZERO I!5DE E9 17EC R JHP K57 ; BUFFER_FILL 15£1 K21: ; MIGHT 8E NUMERIC 15£1 F6 06 0017 R 03 TEST KS_FLAG, LEFT_SHIFT+ RIGHT_SHIFT 15E6 74 F3 JZ K20 JUMP NUMERIC, NOT INSERT 15£8 K22: SHIFT TOGGLE KEY HIT; PROCESS IT 15£8 84 26 0018 R TEST AH, KB_FLAG_l IS· KEY· ALREADY DEPRESSED 15Ee 75 5e JHZ K26 JUMP I F KEY ALREAOY OEPRESSED 15EE os 2S 0018 R OR KB_FLAG_l, AH INDICATE THAT THE KEY IS DEPRESSED 15F2 30 2& 0017 R XOR KB_FlAG, AH TOGGLE THE SHIFT STATE l!iF6 3C 52 CHP AL, INS_KEY TEST FOR 1ST MAKE OF I NSERT KEY 15F8 75 50 JHE K26 JUMP~ 'iF NOT I NSERT KEY 15FA 88 5200 HOV AX,INS_KEY.2S6 SET SCAN CODE INTO AH, 0 INTO AL 15FD £9 17EC R JHP K57 PUT J NTO OUTPUT BUFFER ROM BIOS A-45 ; ------ BREAK SHIFT FOUND 1600 K23: BREAK-Stil FT-FOUND 1600 80 FC 10 CMP AH. SCROLL_SHIFT IS THIS· A TOGGLE KEV 1603 13 lA ..JAE K24 YES, HANDLE BREAK TOGGLE 1605 F6 D4 NOT AH I NYERT MASK 1601 20 26 0011 R AND KB_FLAG, AH TURN OFF SHIFT BIT 160B 3C B8 tt1P AL,ALT_KEV+BOH IS THIS ALTERNATE SHIFT RELEASE 160D 153S JNE K26 ; INTERRUPT_RETURN .------ ALTERNATE SHIFT KEV RELEASED, GET THE VALUE INTO BUFFER 160F AO 0019 R MOV AL. AL T _I NPUT 1612 32 E4 )COR AH, AH SCAN CODE OF 0 1614 88 26 0019 R MOY ALT_INPUT, AH ZERO OUT THE FIELD 1618 OA CO OR AL, AL WAS THE 1 NPUT=O? 161A 74 2E JE K26 I NTERRUPT RETURN 161C E9 l1F5 R JMP KS8 IT WASN'r:- SO PUT I N BUFFER 161F K24: ; BREAK-TOGGLE 161F 3C oA CMP AL, CAPS_KEV+BREAK_BIT ; SPEC·IAL CASE OF TOGGLE KEV 1621 75 OF JNE K24_1 ; JUMP ARDUND POTENTIAL UPDATE 1623 F6 06 0010 R 02 TEST KB_FLAG_l, CllCK_SEQUENCE 1828 14 08 JZ K24_1 ; ,JUMP IF NOT SPECIAL CASE 162A 80 26 0018 R FD AND KB_F"LAG_l, AND_MASK-CLICK_SEQUENCE ; MASK OFF MAKE OF CLICK 162F E8 19 90 JMP K26 INTERRUPT J S OVER ; ------ BREAK Of' NORMAL TOGGLE 1632 F6 D4 K24 1: 'NOT AH INVERT MASK 1634 20 26 0018 R - AND KB_FLAG_l, AH I NO I CATE NO LONGER DEPRESSED 1638 EB 10 JMP SHORT K26 INTERRUPT_RETURN ; ------ TEST FOR HOLD STATE 163A K25: NO-SHIFT-FOUND 163A ac 80 CMP Al.80H TEST FOR BREAK KEV 163C 73 OC JAE K26 NOTHI NG FOR BREAK CHARS FROM HERE ; ON 163E F6 06 0018 R 08 TEST KB_FLAG_l, HOLD_STATE; ARE WE IN HOLD STATE? 1643 14 OE JZ K2B ; BRANCH AROUND TEST I F NOT 1645 80 26 0018 R F7 AND KB_FLAG_l, NOT HOLD_STATE ; TURN OFF THE HOLD STATE ; BIT 164A K26: ; INTERRUPT-RETURN 164A D7 POP E5 1649 IF POP OS 184C 5F POP 01 164D BE PDP 51 164E SA POP OX 164F 59 POP CX 16150 5B POP BX 1651 58 POP AX ; RESTORE STATE 1652 CF IRET ; RETURN, INTERRUPTS BACK ON WITH i FLAG CHANGE ;------·NOT IN HOLD STATE, TEST FOR SPECIAL CHARS 1653 K28: ; NO-HOLD-STATE 1653 F6 06 0017 R OB TEST KB_FLAG.ALT_SHIFT; ARE WE I.N ALTERNATE SHIFT 1658 15 03 JNZ K29 ; JUMP IF Al TERNATE SH I FT 165A E9 1149 R JMP K3B ; JUMP IF NOT ALTERNATE ; ------ TEST FOR AL T+CTRL KEY SEQUENCES 165D 1<29: ; TEST-RESET 165D FS 06 0011 R 04 TEST KB_FLAG, CTL_SHIFT ; ARE WE IN CONTROL SHIFT ALSO 1662 14 69 JZ K31 ; NO_RESET 1664 3C 53 CMP AL, DEL_KEY ; SHIFT STATE IS THERE. TEST KEV 1666 15 09 JNE K29_1 ; NO_RESET ;------ tTl-ALT-DEL HAS SEEN FOUND, DO 1/0 CLEANUP 1668 C7 06 0072 R 1234 MOV RESET_FLAG, 1234H ; SET FLAG FOR RESET FUNCTION 166E E9 0043 R JMP NEAR PTR RESET ; JUMP TO 'POWER ON 0 I AGNOSTI CS 1611 3C 52 K29_1: CMP AL,INS_KEY ; CHECK FDR RESET WiTH DIAGNOSTICS 1673 75 09 JNE K29_2 ; CHECK FOR OTHER ; AL T -CTRL -SEQUENCES ;------ ALT-CTRl-INS HAS BEEN FOUND f675 C7 06 0072 R 4321 HOY RESET_FLAG, 4321H ; SET FLAG FOR D I AGNOSTI CS 1678 E9 0043 R JMP NEAR PTR RESET • LEVEL 1 DIAGNOSTICS 161£ 3C 3A K29_2: CMP AL, CAPS_KEY ; CHECK FOR K£VBORAO CLICK TOGGLE 1680 75 13 JNE K29_3 ; CHECK FOR SCREEN ADJUSTMENT ; ------ ALT+CTRL+CAPSLOCK HAS BEEN FOUND 1682 F6 0.6 0018 R 02 TEST KB_FLAG_l, Cll eK_SEQUENCE 1687 75 C1 JNZ K26 ; JUMP I F SEQUENCE HAS ALREADY ; OCCURED 1689 80 36 0018 R 04 XOR KS_FLAG_l, CLICK_ON; TOGGLE BIT FOR AUDIO KEVSTROKE ; FEEDBACK 168£ 90 O£ 0018 R 02 OR KB_FLAG_l. CLICK_SEQUENCE; SET CLICK_SEQUENCE STATE 1693 EO 05 JMP SHORT K26 1 NTE-RRUPT I S OVER 1695 ac 4D CMP AL, RIGHT _ARROW AD,",UST SCREEN TO THE RIGHT'? 1697 75 12 JNE K29_4 LOOK FOR RIGHT ADJUSTMENT 1699 £8 186E R CALL GET _POS GET THE • OF POSI TI ONS SCREEN IS SHIFTED 169C 3C FC CMP AL,O-RANGE IS SCREEN SHIFTED AS FAR AS POSSIBLE'? 169E 7C AA JL K26 OUT OF RANGE 16AO FE OE 0089 R DEC HORZ_POS SHIFT VALUE TO THE RIGHT 16M FE C8 DEC AL DECREASE RANGE VALUE 16A6 E8 187. R CALL PUT_POS RESTORE STORAGE LOCATION 16A9 EO 14 JMP SHORT K29_S ADJUST 16AB 3C 4B CMP AL. LEFT_ARROW ADJUST SREEN TO THE LEFT'? 16AD 15 1£ JNE K31 NOT AN Al T CTRL SEQUENCE ISAF EB IS6E R CALL GET_POS GET NUMBER-OF POSITIONS SCREEN IS SHIFTED 1882 3C 04 CMP AL, RANGE IS SCREEN SHIFTED AS FAR AS POSSIBL.E? 1694 7F 94 JC K2. 18B6 FE 06 0089 R INC HORZ POS SHIFT SCREEN TO THE LEFT 18BA FE CO INC AL - INCREASE NUMBER OF POSITIONS SCREEN IS SH I FTED 16BC E8 187A R CALL PUT POSTION SACK IN STORAGE A-46 ROM BIOS 168F BO 02 K29_6: NOY AL,2 ADJUST 16Cl SA 0304 NaY OX,304H ADDRESS TO CRT CONTROLLER lSC4 EE OUT DK,AL IICS AO 0089 R NaY AL, HORZ_POS COLUMN pas 1 T1 ON 16C8 42 INC OX POINT AT DATA REGISTER ISCS EE OUT OX,Al MOY POSITION ISCA E9 164A R JNP 026 i------ IN ALTERNATE SHIFT, RESET NOT FOUND leCD K31: NO-RESET 16CO 3C 39 eMP AL, 57 TEST FOR SPACE KEY IBCF 75 29 .JNE K32 NOT THERE 1601 BO 20 HOV AL," SET SPACE CHAR 1603 E9 17EC R .J"P te57 BUFFER_FILL j----- ALl-INPUT-TABLE 1606 K30 LABEL BYTE 1606 52 4F 50 51 48 4C DB 82,79,80,81,75,76,77 40 16DO 47 48 49 DB 71, 72, 73 ; 10 NUMBERS ON KEYPAD ; ------ SUPER-SHIFT-TABLE 16EO 10 11 12 13 14 15 DB 16,17,18,19,20,21,22,23; A-Z TYPEWRITER CHARS 16 17 16E8 18 19 IE IF 20 21 DB 24,25,30,31,32,33,34,35 22 23 lIFO 24 2!5 26 2C 20 2E DB 36,37. 3B, 44, 45, 46, 47.48 2F 30 18FS 31 32 DB 49,50 ; ------ LOOK FOR KEY PAD ENTRY laFA K32: AL T-KEY-PAD IIFA SF 1606 R HOY 0 I ,OFFSET 1<30 ALl-INPUT-TABLE 16FD 89 OOOA MOV ex, 10 LOOK FOR ENTRY USI NG KEYPAD 1700 F2J AE REPNE SCASB lOOK FOR MAICH 1702 75 13 .JNE K33 NO_AL T _KEYPAD 1704 81 EF 1607 R SUB 0 I ,OFFSET K30+ 1 oI NOW HAS ENTRV VALUE 1708 AD 0019 R MOV AL, AL T_I NPUT GET THE CURRENT BYTE 1708 840A MOV AH,10 MUL TIPLV BY 10 1700 F6 E4 MUL AH 170F 03 C7 ADD AX,DI ADD IN THE LATEST ENTRY 1711 A2 0019 R MOV AL T _I NPUT, AL STORE IT AWAY 1714 E9 164A R .JMP K26 ; THROW AWAY THAT KEYSTROKE ; ------ LOOK FOR SUPERSHI FT ENTRY 1717 K33: NO-AL T -KEYPAD 1717 C6 06 0019 R 00 HOY ALT_INPUT, a ZERO ANV PREY I DUS ENTRV INTO INPUT 17le 89 001A MaY C)(,26 Di,ES ALREADY POINTING 171F F2J AE REPNE SCASB LOOK FOR MATCH I N ALPHABET 1721 7505 .JNE K34 NOT FOUND, FUNen ON KEY OR OTHER 1723 32 CO XOR AL, AL ASC I I CODE OF ZERO 1725 E9 17EC R .JMP K57 ; PUT I TIN THE BUFFER LOOK FOR TOP ROW OF ALTERNATE SHIFT 1728 AL T-TOP-ROW 1728 3C 02 CHP AL.,2 KEY WITH' I' ON IT 172A 72 OC JB 035 NOT ONE OF I NTEREST I NG KEYS 172C 3C OE CHP AL,14 IS IT IN THE REGION? 172E 73 0. JAE 035 ALT-FUNCTION 1730 80 C' 76 AOD AH, lIB CONVERT PSUEDO SCAN CODE TO RANGE 1733 32 CO XOR AL,AL INDICATE AS SUCH 1735 E9 17Ee R .JMP KS7 ; BUFFER_FILL TRANSLATE ALTERNATE SHIFT PSEUDO SCAN CODES 1738 ALT-FUNCTION 1738 3C 38 CHP AL,59 TEST FOR IN TABLE 173A 73 03 JAE K37 AL T -CONT I NUE 173C K36: CLOSE-RETURN 173C £9 164A R JHP 026 I GNORE THE KEV 173F K37: AL T-CONTINUE 173F 3C 47 CHP AL,71 I N KEYPAD REG I ON 1741 73 F9 JAE 036 IF so, IGNORE 1743 B8 U53D HOY SX, OFFSET KI3 ALT SHIFT PSEUDO SCAN TABL.E 1746 E9 1863 JHP 063 TRANSLATE THAT ; ------ NOT IN ALTERNATE SHIFT 1749 K3B: , NOT-ALT-SHIFT 1749 F6 06 0017 R O' TEST KB_FLAG,CTL._SHIFT; ARE WE IN CONTROL SHIFT? 174E 74 3. JZ K44 , NOT-eTL-SHIFT i------ CONTROL. SHIFT, TEST SPECIAL. CHARACTERS ; ------ TEST FOR BREAK AND PAUSE KEVS 1750 3C '6 CMP AL, SCROLL_KEY TEST FOR BREAK 1752 75 19 JNE K41 , NO-BREAK 1754 88 IE 001A R MOV BX, BUFFER_HEAD GET CURRENT BUFFER HEAD 1758 C6 06 0071 R 80 MaY BIOS_BREAK, BOH TURN ON BIOS_BREAK BIT 1750 CO 1B I NT IBH BREAK I NTERRUPT VECTOR 175F 28 CO SUB AX, AX PUT OUT DUMMY CHARACTER 1761 89 07 MOY [BX], AX PUT DUMMV CHAR AT BUFFER HEAD 1763 E8 144F R CALL K4 UPDATE BUFFER POINTER 1766 89 IE OOIC R MOV BUFFER_TAll, BX UPDATE TAIL 176A E9 164A R JMP K26 DONE WITH INTERUPT 176D K41: NO-PAUSE ; ------ TEST SPECIAL CASE KEY 55' 1760 3C 37 CHP AL,55 176F 76 06 JNE 042 NOT-KEY-55 1771 BS 7200 NOY AX. 114*256 START/STOP PRINTING SWITCH 1774 EB 76 90 JNP 057 BUFFER_FILL ROM BIOS A-47 SET UP TO TRANSLATE CONTROL SHIFT 1777 NOT-KEY-55 1777 B8 USC R MOV ax, OFFSET KB SET UP TO TRANSLATE CTl 177A 3C 3B eMP AL,59 I S IT IN TABLE? 177C 72 6A JB K56 YES, GO TRANSLATE CHAR CTL-TABLE- TRANSLATE 177E BS 14A6 R MOV ex, OFFSET Kg CTL TABLE SCA.N 1781 E9 1863 R .JMP K63 TRANSLATE_SCAN NOT IN CONTROL SHIFT 1784 NOT-CTL -SH I FT 1794 3C 47 eMP AL,71 TEST FOR KEYPAD REGION 1786 73 IF JAE K4B ; HANDLE KEYPAD REGlON 1788 F6 06 0017 R 03 TEST KB FLAG, LEFT SHIFT+RIGHT SHIFT 1790 74 4E JZ K54 - ; TEST FOR SHIFT STATE UPPER CASE, HANDLE SPECIAL CASES 178F 3C OF eMP AL,15 BACK TAB KEY 1791 75 05 JNE K46 NOT-BACK-TAB 1793 88 OFOO MOV AX, 15*256 SET PSEUDO SCAN CODE 1796 EB 54 JMP SHORT KS7 BUFFER FILL 1798 K4S: NOT-PR TNT -SCREEN 1798 3C 3B eMP AL,59 FUNCTI ON KEVS 179A 72 06 JB K.7 NOT-UPPER-FUNCT I ON 179C B8 1533 R MOV BX, OFFSET K12 UPPER CASE PSEUDO SCAN CODES 179F E9 IB63 R JMP K63 TRANSLATE SCAN 17A2 K47: NOT-UPPER=FUNCT I ON 17 A2 BB 14F9 R MOV BX, OFFSET Kll POINT TO UPPER CASE TABLE 17A5 EB 41 JMP SHORT K56 ; OK, TRANSLATE THE CHAR KEYPAD KEYS, MUST TEST NUM LOCK FOR DETERMINATION 17A7 KEYPAD-REGION 17A7 FS 06 0017 R 20 TEST KB_FLAG, NUM_STATE ; ARE WE IN NUt1_LOCK? 17AC 75 21 JNZ K52 TEST FOR SURE 17AE F6 06 0017 R 03 TEST KB_FLAG,LEFT_SHIFT+RIGHT_SHIFT ; ARE WE IN SHIFT STATE 1783 75 21 JNZ K53 IF SHIFTED, REALLV NUM STATE BASE CASE FOR KEYPAD 1785 BASE-CASE 1785 3C 4A eMP AL,74 SPECIAL CASE FOR A COUPLE OF KEVS 1787 74 OC JE K50 MINUS 1789 3C 4E eMP AL,78 178B 74 00 JE K51 1780 2C 47 SUB AL,71 CONVERT ORIGIN 17BF BS 1554 R MOV BX, OFFSET K15 BASE CASE TABLE 17C2 E9 1865 R JMP K6. CONVERT TO PSEUDO SCAN 17C5 S8 4A2D K50: MOV AX, 74*256+'-' MINUS 17C8 EB 22 JMP SHORT K57 BUFFER FI LL 17CA BS 4E28 K51· MOV AX, 78*256+ ,+, PLUS - 17CO E8 10 JMP SHORT K57 , eUFFER_F I LL MIGHT BE NUM LOCK, TEST SHIFT STATUS 17CF ALMOST-NUM-ST ATE l7CF F6 06 0017 R 03 TEST KB_FLAG, LEFT_SHJFT+RIGHT_SHIFT 1704 75 OF .)NZ K.!I9 SHIFTEO TEMP OUT OF NUM STATE 1706 K53: REALLY NUM STATE 1706 2C 46 sus AL,70 CONVERT ORIGIN 1708 BB 1547 R MOV ex, OFFSET K14 NUM STATE TABLE 170B EB oe .)MP SHORT K56 TRANSLATE_CHAR PLAI N OLD LOWER CASE 1700 K5. NOT-SHIFT l70D 3C 38 eMP AL,59 TEST FOR FUNCT I ON KEYS 170F 72 04 JB K55 NOT -LOWER-FUNCT I ON 17El 32 CO XOR AL, AL SCAN CODE IN AH ALREADY 17E3 EB 07 ')MP SHORT K57 BUFFER FILL 17E5 K55· NOT -LOWER-FUNCT I ON 17E5 BB 14BF R MOV BX, OFFSET KID LC TABLE TRANSLATE THE CHARACTER 17E8 ~56 TRANSLATE-CHAR 17E8 FE C8 DEC AL CONVERT ORIGIN 17EA 2E: 07 XLAT CS: Kll i CONVERT THE SCAN CODE TO ASCII PUT CHARACTER I NTO BUFFER 17EC BUFFER-F I LL 17EC 3C FF eMP AL, -1 IS THIS AN IGNORE CHAR? 17EE 74 IF JE K59 YES, DO NOTHING WITH IT 17FO 80 FC FF eMP AH, -1 LOOK FOR -1 PSEUOO SCAN 17F3 74 1A JE K59 , NEAR_I NTERRUPT_RETURN HANDLE THE CAPS LOCK PROBLEM 17F5 K58: BUFFER-F I LL -NOTEST 17F5 F6 06 0017 R 40 TEST KB_FLAG, CAPS_STATE; ARE WE IN CAPS LOCK STATE"? 17FA 74 20 .)2 KGl SKIP IF NOT 1N CAPS LOCK STATE 17FC F6 06 0017 R 03 TEST KB_FLAG, LEFT_SHIFT+RIGHT_SHIFT ; TEST FOR SHIFT STATE 1801 74 OF JZ K60 IF NOT SHIFT, CONVERT LOWER TO UPPER CONVERT ANY UPPER CASE TO LOWER CASE 1803 3C 41 CMP AL, 'A' FIND OUT IF ALPHABETIC 1805 72 15 .JB K61 NOT _CAPS_STATE IB07 3C SA CMP AL, '2' 1809 77 11 .JA K61 NOT _CAPS_ST ATE 180B 04 20 ADD AL, 'a'-'A' CONVERT TO LOWER CASE 1BOD EB 00 JMP SHORT K6! NOT CAPS STATE 180F K59 NEAR-I NTERRUPT-RETURN 180F E9 164A R ')MP K26 , INTERRUPT_RETURN CONVE:RT ANY LOWER CASE TO UPPER CASE 1812 K60· LOWER- TO-UPPER 1812 3C 61 eMP AL, 'a' F I NO OUT I F ALPHABET I C 1814 72 06 J8 K61 NOT _CAPS_STATE 1816 3C 7A eMP JA ~~l 'z' NOT_CAPS_STATE 1818 77 02 181A 2C 20 SUB AL, 'a'-'A' CONVERT TO UPPER CASE A-48 ROM BIOS 18lC K61: NOT-CAPS-STATE 181C 88 IE 001C R MOV BX,BUFFER_TAIL GET THE END POI NTER TO THE BUFFER 1820 88 F3 MOV 51, BX SAVE THE VALUE 1822 E8 144F R CALL K4 ADVANCE THE TAl L 1825 38 IE 001A R eMP BX, BUFFER_HEAD HAS THE BUFFER WRAPPED AROUND? 1829 75 10 JNE KSl_1 BUFFER_FULL_BEEP 182B 53 PUSH BX SAVE BUFFER_TAIL 182C BB OOBO MOV BX, 080H DURATI ON OF ERROR BEEP 182F B9 0048 MOV CX,48H FREQUENCV OF ERROR BEEP HALF TONE 1832 E8 E035 R CALL K8_NOISE OUTPUT NOI SE 1935 SO 26 0017 R FO ANO CLEAR AL T, CLRL, LEFT AND RIGHT SHI FTS IS3A 80 26 0018 R OF AND CLEAR POTENTIAL BREAK OF INS,CAPS ,NUM AND SCROLL SH I FT I03F 80 26 0088 R IF AND KB_FLAG_2,lFH CLEAR FUNCTION STATES 1844 58 POP BX RETRIEVE BUFFER TAil 1845 E9 164A R JMP K26 , RETURN FROM INTERRUPT 1848 F6 06 0018 R 04 K61_1 TEST KB_FLAG_l, CL I CK_ON IS AUO I 0 FEEDBACK ENABLED? 1840 74 DB JZ KSl_2 NO, JUST PUT I N BUFFER 184F 53 PUSH BX SAVE BUFFER_TAIL VALUE 1850 BS 0001 MOV BX,lH DURAll ON OF CLICK 1853 89 00 10 MOV CX, 10H FREQUENCV OF CLl CK 1856 E8 E035 R CALL KB_NOISE OUTPUT AUDIO FEEDBACK OF KEV STROKE 1859 58 POP BX RETRIEVE BUFFER_TAIL VALUE 185A 89 04 K61_2· HOV [SIl,AX STORE THE VALUE 185e B9 IE ODIC R MOV BUFFER_TAIL, BX MOvE THE PO I NTER UP ~::NSlAT~2~CAN 1860 E9 164A R I NTERRUPT RETURN ; ------ FOR PSEUDO SCAN CODES 1863 KS3: TRANSLATE-SCAN 1863 2C 38 SUB AL,59 CONVERT ORI GI N TO FUNCTI ON KEVS 1865 K64: TRANSLATE-SCAN-ORGD 1865 2E: 07 XLAT CS: K9 CTL TABLE SCAN 1867 SA EO MOV AH,AL PUT VALUE INTO AH 1869 32 CO XOR AL, AL ZERO ASC I I CODE 18GB E9 17EC R JMP K57 PUT I T I NTO THE BUFFER 18SE KB_I NT ENDP j GET_POS THIS ROUTINE WILL SHIFT THE VALUE STORED IN THE HIGH NIBBLE : INPUT OF THE VARIABLE VAR_DELAV TO THE LOW NIBBLE. NONE IT IS ASSUMED THAT DS POINTS AT THE BIOS DATA AREA j OUTPUT AL CONTAINS THE SHIFTED VALUE. ~~~=;;;-;~;~----~~~;----------------------------------------------- lOGE IBGE 51 PUSH CX SAVE SHIFT REGISTER 186F AO 0096 R MOV AL, BVTE PTR VAR DELAV GET STORAGE LOCATI ON 1072 24 FO AND AL, aFOH - MASK OFF LOW NIBBLE 1874 81 04 HOV Cl,4 SHIFT OF FOUR 81T POSITIONS 1876 02 F8 SAR AL, CL SHI FT THE VALUE 51 GN EXTENDED 1878 59 POP CX RESTORE THE VALUE 1879 C3 RET 187A ~ ;~~=;~;----------------------------------------------------------­ THIS ROUTINE WILL TAKE THE VALUE IN LOW ORDER NIBBLE IN ; INPUT Al AND STORE IT IN THE HIGH ORDER OF VAR_DELAV ; OUTPUT AL CONTAINS THE VALUE FOR STORAGE NONE. 187A PUT _POS PRoe NEAR 187A 51 PUSH CX SAVE REGISTER 187B Bl 04 MOV CL,4 SHI FT COUNT 1870 02 EO SHL AL, CL ; PUT IN HIGH ORDER NIBBLE 187F BA OE 0086 R MOV CL, BVTE PTR VAR_DELAV j GET DATA BVTE 1883 80 E1 OF AND CL,OFH j CLEAR OLD VALUE I N HI GH Nl BBLE 1886 OA C1 O. AL, CL ; COMBINE HIGH AND LOW NIBBLES 1888 A2 0086 R MOV BVTE PTR VAR_OELAV, AL j PUT IN POSITION 1888 5' POP CX ; RESTORE REGISTER 188C C3 RET 1880 PUT _POS ENDP ~ -~~~~~~~~~;~~~-~~~~~~~~-;~~~~~-;~~~;~~-=-;~~~~~~-;~;;~~~-~~~-;;~~; ; TICK ROUTINE DURING MANUFACTRUING ACTIVITIES (ACCESSED THROUGH j INT lCH) 1880 MFG_TI CK PROC FAR 1880 50 PUSH AX 188E 2B CO SUB AX, AX SEND A 00 TO PORT 13 AS A ACTIVITV SIGNAL 1890 E6 13 OUT 13H, AL 1892 E4 61 IN AL, PORT_B FLIP SPEAKER DATA TO OPPOSITE SENSE 1894 BA EO MOV AH, Al SAvE ORI G SETll NG 1896 BO E4 .0 AND AH,10011101B MAKE SURE MUX IS -) RIGHT AND I SOL ATE SPEAKER BI T 1899 F6 DO NOT AL FLIP ALL BITS 189B 24 02 AND AL, 000000 lOB ISOLATE SPEAKER DATA BIT (NOW IN OPPOSI TE SENSE) 1890 OA C4 OR AL,AH COMBINE WITH ORIG DATA FROM PORT B 189F DC 10 OR AL, 000 10000B AND 01 SABLE INTERNAL SPEAKER 18A1 E6 61 OUT PORT_B, AL 18A3 BO 20 MOV AL,20H EOI TO INTR. CHIP 18A5 E6 20 OUT 20H, AL 19A7 5B POP AX 18A8 CF IRET 18A9 MFG_TICK ENDP ROM BIOS A-49 CONVERT AND PRI NT ASCII CODE AL MUST CONTAIN NUMBER TO BE CONVERTED. AX AND ax DESTROYED. ~;~~;;~;--------;;~~----~;~;--------------------------------------- 18A9 18A9 50 PUSH AX SAVE FOR LOW NIBBLE DISPLAY IBAA 81 04 MOV CL,4 SHI FT COUNT 18AC 02 E8 SHR Al, CL NIBBLE SWAP 18AE E8 1884 R CALL XLAT PR DO THE HIGH NIBBLE DISPLAY 1881 58 POP AX - RECOVER THE NIBBLE IB82 24 OF AND AL,OFH ISOLATE TO LOW NIBBLE FALL INTO LOW NIBBLE CONVERSION 1884 XlAT_PR PROC NEAR CONVERT DO-OF TO ASCII CHARACTER 1884 04 90 ADD Al,090H ADD FIRST CONVERSION FACTOR 1886 27 DAA ADJUST FOR NUMERIC AND ALPHA RANGE 18B7 14 40 ADC AL,040H ADD CONVERSION AND ADJUST LOW NIBBLE 19B9 27 DAA ADJUST HIGH NIBBLE TO ASCI I RANGE 18BA PRT HEX PRoe NEAR ISBA 53 - PUSH BX 18S8 B4 DE MOY AH,14 DISPLAY CHARACTER IN AL. 18BD B7 00 MOY BH,O 18BF CD 10 INT 10H 18Cl 58 POP BX IBC2 C3 RET 18e3 PRT _HEX ENDP 18C3 XLAT_PR EMDP 18C3 XPC BYTE ENDP i CONTROL IS PASSED HERE WHEN THERE ARE NO PARALLEL PRINTERS ; ATTACHED. CX HAS EQUIPMENT FlAG,DS POINTS AT DATA (40H' i DETERMINE WHICH RS232 CARD (0,1) TO USE 18e3 REPRI NT PRoe NEAR 18e3 28 02 B1_A: SUB DX, DX i ASSUME TO USE CARD 0 18CS F6 C5 o. TEST CH, 00000100B i UNLESS THERE ARE TWO CARD S 18C9 74 01 JE BI0_1 ; IN WHI CH CASE, 18CA 42 INC DX iUSE CARD 1 i DETERMINE WHICH FUNCTION I S BE I NG CALLED 18C8 OA E4 B 10_1: OR AH, AH ; TEST FOR AH = 0 18CD 74 41 JZ B12 i GO PRINT CHAR IBCF FE CC DEC AH i TEST FOR AH = 1 1801 74 10 JZ 811 ; GO DO INIT 1803 FE CC DEC AH i TEST FOR AH = 2 1805 75 16 JNZ SHORT B 10_3 .IF NOT YALID, RETURN i ElSE . i GET STATUS FROM RS232 PORT 1807 50 PUSH AX i SAVE AL 1808 84 03 MOY AH.03H i USE THE GET COMMO PORT 180A CD I. INT 014H iSTATUS FUNCTION OF JNT14 IBDe E8 1925 R CALL FAKE ; FAKE WILL MAP ERROR BITS FROM i RS232 TO CORRESPOND I NG ONES i FOR THE PRI NTER 18DF 59 POP AX i RESTORE AL IBEO OA F6 OR DH,DH ; CHECK I F ANY FLAGS WERE SET IBE2 74 07 J2 BID 2 18E4 8A E6 HOY AH,DH ;HOYE FAKED ERROR CONDITION TO AH 18E6 80 E4 FE AND AH,OFEH 18E9 EB 02 JMP SHORT BI0_3 ; THEN RETURN 18E8 B4 90 BI0_2: MOY AH,090H ;MOVE IN STATUS FOR 'CORRECT' i RETURN 18ED E9 FOOD R BI0_3: JMP Bl i INIT COMMO PORT DX HAS WHICH CARD TO INIT. ; MOVE TI ME OUT VALUE FROM PR I NTER TO RS232 T I ME OUT VALUE 18FO 88 F2 Bll: MOY SI,DX ;51 GETS OFFSET INTO THE TABLE 18F2 AD 0078 R MOV Al,PRINT_TIM_OUT IBF5 04 OA ADD AL,OAH ; INCREASE DELAY 18F7 88 84 007C R MOY RS232_TIM_OUTCSI 1, Al 18FB 50 PUSH AX i SAVE Al 19FC BO 97 MOY AL.OB7H ;SET INJT FOR: 1200 BAUD 8 BIT WRD lNG NO PARI TV IBFE 2A E4 SUB AH,AH ~ AH=O IS COMMO ~N~;O~u:~i~ON 1900 CD 14 INT 014H iDa INIT 1902 £8 1925 R CALL FAKE i FAKE WILL MAP ERROR BITS FROM ; RS232 TO CORRESPOND I NG ONES ; FOR THE PR INTER 1905 58 POP AX i RESTORE AL 1906 SA E6 MOY AH,DH ; IF DH IS RETURNED ZERO, MEANING 1908 OA E4 OR AH,AH ; NO ERRORS RETURN I T FOR THAT'S THE ; 'CORRECT' RETURN FROM AN ERROR i FREE INIT 190A 74 El JE 810 3 190e B4 A8 MOY AH.OABH 190E EB DO JMP SHORT BI0_3 ; THEN RETURN A-50 ROM BIOS ; PRINT CHAR TO SERIAL PORT ; OX = RS232 CARD TO 8E USED: AL HAS CHAR TO BE PRINTED 1910 50 812: PUSH AX ; SAVE AL 1911 B4 01 MOY AH,Ol ; 1 IS SEND A CHAR DOWN COMMO LI NE 1913 CD 14 INT 014H ; SEND THE CHAR 1915 EB 1925 R CALL FAKE ; FAKE WILL MAP ERROR BITS FROM ; RS232 TO CORRESPOND I NG ONES ; FOR THE PR INTER 191B 58 POP AX ; RESTORE AL 1919 OA F6 OR DH,DH ; SEE I F NO ERRORS WERE RETURNED 191B 74 04 JZ B12_1 1910 SA E6 MOV AH,DH i IF THERE WERE ERRORS, RETURN THEM 191F EB CC JMP SHORT 810_3 i AND RETURN 1921 84 10 812_1: MOV AH,OI0H i PUT 'CORRECT' RETURN STATUS IN AH 1923 EB ca JMP SHORT 810_3 • AND RETURN 1925 REPRINT ENDP ; THIS PROC MAPS THE ERRORS RETURNED FROM A BIOS INT14 CALL ;TO THOSE 'LIKE THAT' OF AN INT17 CALL ; BREAK, FRAMING, PAR lTV • OVERRUN ERRORS ARE LOGGED AS I/O ;ERRORS AND A TIME OUT IS MOYED TO THE APPROPIATE BIT 1925 FAKE PROC NEAR 1925 32 F6 XOR DH.DH ; CLEAR F AKED STATUS FLAGS 1927 F6 C4 1E TEST AH,0l11108 ; CHECK FOR BREAK, FRAMING, PARITV ; OVERRUN 192A 74 03 JZ 913 1 - ; ERRORS. IF NOT THEN CHECK FOR • TJJ1E OUT. 192C B6 OB MOV DH,01000B ;S£T BIT 3 TO INDICATE 'I/O ERROR' 192£ C3 RET ; AND RETURN 192F F6 C4 90 B13_ L TEST AH,oaOH ; TEST FOR T I ME OUT ERROR RETURNED 1932 74 02 JZ 913 2 i IF NOT TIME OUT, RETURN 1934 86 09 MOV DH,09H ; IF TIME OUT 1936 C3 813_2: RET 1937 FAKE ENDP ;~~~=~;;;---------------------------------------------------------- THI S ROUTINE IS THE INTERRUPT 9 HANDLER WHEN THE MACHI NE IS FIRST POWERED ON AND CASSETTE BASIC IS GIVEN CONTROl. IT HANDLES THE F J RST KEYSTROKES ENTERED FROM THE KEYBOARD AND PERFORMS "SPECIAL" ACTIONS AS FOLLOWS: IF ESC 15 THE FIRST KEV ENETERED MINI-WELCOME IS EXECUTED IF CTRL-ESC IS THE FIRST SEQUENCE "LOAD CASl; ,R" IS EXECUTED GIVING THE USER THE ABILITV TO BOOT FROM CASSETTE AFTER THESE KEVSTROKES OR AFTER ANV OTHER KEVSTROKES THE INTERRUPT 9 VECTOR IS CHANGED TO POINT AT THE REAL INTERRUPT 9. ROUT I NE. ~;~=;~;=;--;;~~-;~;------------------------------------------------ 1937 1937 3C 01 CMP AL, 1 IS THI S AN ESCAPE KEV? 1939 74 10 .JE ESC_KEY .JUMP IF AL=ESCAPE KEV 1938 3C 10 CMP AL,29 ELSE, IS THIS A CONTROL KEV? 1930 74 06 ..IE CTRL_KEV ; .JUMP 1 F AL=CONTROL KEY 193F EB EOIB R CALL REAL_VECTOR_SETUP i OTHERWISE, INITIALIZE REAL INT 9 VECTOR 1942 CO 09 INT 9H PASS THE SCAN CODE 1 N AL 1944 CF IRET RETURN TO INTERRUPT 4BH 1945 CTRL_KEV: 1945 80 OE 0017 R 04 OR TURN" ON CTRL SHIFT IN KB FLAG 194A CF IRET RETURN TO INTERRUPT - 1948 ESC_KEY: 1948 F6 06 0017 R 04 TEST KB_FLAG,04H HAS CONTROL SHIFT OCCURED? 1950 74 29 JE ESC_ONL V ; NO. ESCAPE ONLY ; CONTROL ESCAPE HAS OCCURED, PUT MESSAGE I N BUFFER FOR CASSETTE ; LOAD 1952 C6 06 0017 R 00 MOV KB_FLAG,O ZERO OUT CONTROL STATE 1957 IE PUSH OS 19!58 07 POP ES INITIALIZE ES FOR 8105 DATA 1959 IE PUSH os SAVE OLD OS 195A OE PUSH CS POI NT OS AT CODE SEGMENT 1ge8 1F POP os 195C 9E 1983 R MaY S I, OFFSET CAS_LOAD ; GET MESSAGE 195F 9F 00 lE R MOV 01, OFFSET KB_BUFFER • POINT AT KEVBOARD BUFFER 1962 B9 OOOF 90 MaY Cle, CAS_LENGTH LENGTH OF CASSETTE MESSAGE 1966 AC T _LOOP: LODSB ; GET ASC I I CHARACTER FROM MESSAGE 1967 AS STOSW ; PUT IN kEYBOARD BUFFER 1968 E2 FC LOOP T_LOOP 196A IF POP OS ; RETRIEVE BIOS DATA SEGMENT ; ------ INITIALIZE QUEUE SO MESSAGE WILL BE RE·MOVED FROM BUFFER 1968 C7 06 001A R 001E R MOV BUFFER_HEAD. OFFSET KB_BUFFER 1971 C7 06 001C R 003C R MOV BUFFER_TAIL, OFFSET KB_BUFFER+ (CAS_LENGTH* 2 ) i ------------------------------------------------------------------ • ***NOTE*** IT IS ASSUMED THAT THE LENGTH OF THE CASSETTE MESSAGE IS LESS THAN OR EQUAL TO THE LENGTH OF THE BUFFER. IF THIS IS NOT THE CASE THE BUFFER WILL EVENTUALLY CONSUME MEMORY. 1977 EB E01B R CALL REAL_VECTOR_SETUP 197A CF IRET 197B ESC ONLY: 197B EB E01B R - CALL REAL_VECTOR_SETUP 197E B9 2000 MOV C>C, MINI 19B1 FF £1 JMP CX ; ENTER THE WORLD OF KEYBOARD CAPER ; ------ MESSAGE FOR OUTPUT IoIHEN CONTROL-ESCAPE IS ENTERED AS FIRST ; KEV SEQUENCE 1983 CAS_LOAD LABEL BVTE 1983 4C 4F 41 44 20 22 DB 'LOAD "CAS1:",R' 43 41 53 31 3A 22 2C 52 1991 00 DB 13 = OOOF CAS LENGTH EGU S - CAS LOAD 1992 NEW:. NT_9 ENDP - ROM BIOS A-51 WRI TE TTY THIS INTERFACE PROVIDES A TELETYPE LIKE INTERFACE TO THE VIDEO CARD. THE INPUT CHARACTER IS WRITTEN TO THE CURRENT CURSOR POSITION, AND THE CURSOR IS MOVED TO THE NEXT POSITION. I F THE CURSOR lEAVES THE LAST COLUMN OF THE FIELD, THE COLUMN IS SET TO ZERO, AND THE ROW VALUE IS INCREMENTED. IF THE ROW ROW VALUE LEAVES THE F I ELO, THE CURSOR IS PLACED ON THE lAST ROW, FIRST COLUMN, AND THE ENTIRE SCREEN IS SCROLLED UP ONE lINE. WHEN THE SCREEN IS SCROllED UP, THE ATTRIBUTE FOR FILLING THE NEWLY BLANKED LINE IS READ FROM THE CURSOR POSITION ON THE PREVIOUS LINE BEFORE THE SCROLL, IN CHARACTER MODE. IN GRAPHICS MODE, THE a COLOR IS USED ENTRY -- (AH) :;; CURRENT CRT MODE (Al) :;; CHARACTER TO BE WR I TTEN NOTE THAT BACK SPACE, CAR RET, BELL AND LINE FEED ARE HANDLED AS COMMANDS RATHER THAN AS DISPLAYABLE GRAPHICS (BLl :;; FOREGROUND COLOR FOR CHAR WRITE IF CURRENTLY IN A GRAPHICS MODE EXIT -- All REG I STERS SAVED ASSUME CS:CODE,DS:DATA 1992 WRITE TTV PROC NEAR 1992 50 - PUSH AX SAVE REG I STERS 1993 50 PUSH AX SAVE CHAR TO WRI TE 1994 8A 3E 0062 R MOV SH, ACTI VE_PAGE GET CURRENT PAGE SETTI NG 1998 53 PUSH BX SAVE IT 1999 8A OF MOV Bl, BH IN Bl 199B 32 FF XOR SH,BH 199D 01 E3 SAL BX,l i CONVERT TO WORD OFFSET 199F 8B .7 0050 R MOV OX, [BX+OFFSET CURSOR_POSN] ; GET CURSOR POSITION 19A3 5B POP BX i RECOVER CURRENT PAGE 19A4 58 POP AX ; RECOVER CHAR OX NOW HAS THE CURRENT CURSOR pas I TI ON 19A5 3C 08 CMP Al,a I SIT A BACKSPACE? 19A7 7. 50 JE UB BACK SPACE 19A9 3C 00 CMP AL, 00 ... IS IT A CARRIAGE RETURN? 19AB 7. 5' JE U9 CAR_RET 19AD 3C OA CMP Al,OAH IS IT A lINE FEED 19AF 7. 15 JE Ul0 LINE_FEED 19B1 3C 07 CMP AL, 07H IS IT A BELL 1983 7. 50 ..IE Ull ; BELL WRITE THE CHAR TO THE SCREEN 1985 B' OA MOY AH, 10 ; WRf TE CHAR ONL V 1987 B. 0001 MOV CX, 1 i ONl V ONE CHAR 19BA CD 10 lNT lOH ; WRITE THE CHAR POSI TI ON THE CURSOR FOR NEXT CHAR 198e FE C2 INC DL 19BE 3A 16 004A R CMP Dl, BYTE PTR CRT_COlS i TEST FOR COLUMN OVERFLOW 1ge2 75 31 ..INZ U7 ; SET_CURSOR 19C4 32 02 XOR Dl, Dl ; COLUMN FOR CURSOR ; LINE FEED 1ge6 UI0· 1ge6 so FE 18 CMP DH,24 1ge9 75 28 JNZ U6 SCROll REQU I RED 19C8 B4 02 MOY AH,2 19CO CO 10 I NT 10H ; SET THE CURSOR DETERMINE VALUE TO FilL WITH DURING SCROLL 19CF AO 0049 R MOV Al, CRT_MODE GET THE CURRENT MODE 1902 3C 04 CMP Al,4 1904 72 O. JC U2 READ-CURSOR 1906 32 FF XOR SH, BH Fl lL WITH BACKGROUND 1905 E8,06 JMP SHORT U3 SCROll-UP 19DA 84 08 U2: MOV AH,8 19De CD 10 INT 10H READ CHAR/ATTR AT CURRENT CURSOR 19DE 8A Fe MOV BH,AH STORE IN BH 19EO B8 0601 U3 MOV AX,601H SCROLL ONE liNE 19[3 2B C9 SUB CX,CX UPPER LEFT CORNER 19E5 B. lB MOV OH,24 • LOWER RIGHT ROW 8A MOV Dl, BYTE PTR CRT _COlS ; lOWER RIGHT COLUMN 19E7 19E8 FE CA"004A R DEC DL 19ED lSEF CD 10 5. U' US: INT POP 10H AX SCROll UP THE- SCREEN RESTORE THE CHARACTER 19FO E. OF70 R JMP VIDEO_RETURN RETURN TO CALLER 19F3 FE C. U6 INC DH NEXT ROW 19F5 B4 02 U7: MOV AH,2 19F7 E8 F. ..IMP U4 ESTABLISH THE NEW CURSOR ; -----. BACK SPACE FOUND 19F9 OA 02 UB· OR DL,Dl ALREADY AT END OF LINE 19F5 7. FB ..IE U7 SET_CURSOR t9FD FE CA DEC Dl NO -- JUST MOVE I T BACK t9FF EB F. ..IMP U7 SET_CURSOR CARR I AGE RETURN FOUND lAOl 32 02 XOR DL,DL MOVE TO FIRST COLUMN lA03 EB FO ..IMP U7 SET_CURSOR ; ----- BEll FOUND lAOS B3 02 Ull: MOV BL,2 SET UP COUNT FOR BEEP lA07 EB FF3l K: CALL BEEP SOUND THE POD BELL lAOA EB E3 ..IMP US TTY_RETURN lAOC A-52 ROM BIOS THIS PROCEDURE WILL ISSUE SHORT TONES TO INDICATE FAilURES THAT 1: OCCUR BEFORE THE CRT IS STARTED, 2: TO CALL THE OPERATORS ATTENTION TO AN ERROR AT THE END OF POST, OR 3: TO SIGNAL THE SUCCESSFUL COMPlET ION OF POST ENTRY PARAMETERS: Dl = NUMBER OF APPROX. 112 SEC TONES TO SOUND ~;;~~~~~--~;~~--~~~~----------------------------------------------- IAOC IAOC 9C PUSHF SAVE FLAGS IAOD 53 PUSH BX IAOE FA CLI o I SABLE SYSTEM 1 NTERRUPTS IAOF G3· SHORT_BEEP: IAOF .3 01 MOV BL,l COUNTER FOR A SHORT BEEP IAII Ee FF31 R CALL BEEP DO THE SOuND IAi4 E2 FE G4· LOOP G4 DELAY BETWEEN BEEPS IAl6 FE CA DEC Dl oONE WITH SHORTS IAl8 75 F5 "NZ G3 DO SOME MORE IAIA E2 FE G5: lOOP G5 LONG DELAY BEFORE RETURN lAIC E2 FE G6· lOOP G6 IAIE OB POP BX RESTORE OR I G CONTENTS OF BX IAiF 90 POPF RESTORE FLAGS TO OR I G SETTI NGS lA20 C3 RET RETURN TO CALLER IA21 ERR BEEP ENDP LIST ASSUME CS: CODE, os: DATA EOOO ORG OEaoaH EOOO 31 35 30 34 30 33 DB , 1504037 caPR. IBM 1981,1983' ; COPYR I GHT NOT I CE 37 20 43 4F 50 52 2E 20 49 42 4D 20 31 39 38 31 2C 31 39 3B 33 ; REAL_VECTOR_SETUP THIS ROUTINE WILL INITIALIZE THE INTERRUPT 9 VECTOR TO PO 1 NT AT THE REAL INTERRUPT ROUTI NE ; ------------------------------------------------------------------ EOIB REAL VECTOR SETUP PROC NEAR EOIB 50 - PUSH AX SAVE THE SCAN CODE EOIC 53 PUSH BX EO 10 06 PUSH ES EOIE 33 CO XOR AX,AX INITIALIZE TO POINT AT VECTOR SECTOR( 0) E020 BE CO MOV ES, AX ~~R:H:~~ ES: [ex]: O~~~~~ ~~_~:~E~R~~~E 9 IN OFFSET OF E022 SS 0024 MOV E025 26: C7 07 1561 R MDV ROUTINE E02A 43 INC BX ADD 2 TO BX E028 43 INC BX E02C OE PUSH CS GET CODE SEGMENT OF BIOS (SEGMENT RELOCATEA8LE I E020 58 POP AX E02E 26: 89 07 MOV WORD PTR ES: [BXl, A)( ; MOVE IN -SEGMENT OF ROUTINE E031 07 POP ES [032 58 POP BX EOJ3 58 POP AX E034 C3 RET EOJ5 REAL_VECTOR_SETUP ENDP ~ ~~~~~~~~---------------------------------------------------------- THIS ROUTINE IS CALL EO WHEN GENERAL BEEPS ARE REQUIRED FROM ~ I NPlJT THE SYSTEM. BX=LENGH OF THE TONE ; CX=CONTAINS THE FREQUENCY ; OUTPUT ALL REGISTERS ARE MAINTAINED. : HINTS AS CX GETS LARGER THE TONE PRODUCED GETS LOWER I N PITCH E035 KB_NOISE PROC NEAR E035 Fe STI E036 50 PUSH AX E037 53 PUSH ex EOJ8 51 PUSH CX EO]9 E4 61 IN AL,061H GET CONTROL 1 NFO E038 50 PUSH AX SAVE E03e LOOPO 1: E03e 24 Fe AND AL, aFCH TURN OFF TIMER GATE AND SPEAKER DATA E03E E6 61 OUT 061H, AL OUTPUT TO CONTROL E040 51 PUSH CX HALF CYCLE T I HE FOR TONE E041 E2 FE LOOP02: LOOP LOOP02 SPEAKER OFF E043 OC 02 OR AL,2 TURN ON SPEAKER SI T E045 E6 61 OUT 061H, AL OUTPUT TO CONTROL E047 59 POP CX E048 51 PUSH CX RETR I EVE FREQUENCY E049 E2 FE LOOP03: LOOP LOOP03 ANOTHER HALF CYCLE E048 4B DEC BX TOTAL TIME COUNT E04C 59 POP CX RETRIEVE FREQ. E04D 75 ED "NZ LOOPOI DO ANOTHER CYCLE E04F 5B POP AX RECOVER CONTROL E050 E6 61 OUT 061H, AL OUTPUT THE CONTROL E052 59 POP CX E053 58 POP BX E054 58 POP AX E055 C3 RET E056 KB _NOISE ENDP E058 ORG OE05BH E058 E9 0043 R "MP NEAR PTR RESET ROM BIOS A-53 CHARACTER GENERATOR GRAPHICS FOR 320X200 AND 640X200 GRAPH I CS FOR CHARACTERS 80H THROUGH FFH E05E CRT_CHARH LA8EL BYTE E05E 78 CC CO CC 78 18 DB 078H, oeeH, oeOH, oeeH, 078H, 0 18H, OOCH, 078H ac 78 E066 00 CC 00 CC CC CC DB OOOH, oeCH, OOOH, oeCH, DeCH, DceH, 07EH, OOOH 7E 00 E06E Ie 00 78 CC Fe co DB 01CH, OOOH, 078H, oeCH, orCH, DCOH, 07BH, OOOH 78 00 E076 7E C3 3C as 3E 66 DB 07EH, oe3H, 03CH, 006H, 03EH, OSSH, 03FH, OOOH 3F 00 E07E CC 00 78 OC 7e ee DB OCCH, OOOH, 07BH, OOCH, 07eH, OCCH, 07EH, OOOH 7E 00 E086 EO 00 78 OC 7C CC DB OEOH, OOOH, a78H, OOCH, 07eH, OCCH, 07EH, OOOH 7E 00 E08E 30 30 78 OC 7e CC DB 030H, 030H, 078H, ooeH, 07CH, OCCH, 07EH, aOOH 7E 00 E096 00 00 78 CO CO 78 DB OOCH, DODH, 07BH, aCOH, OCOH, 07aH, OOCH, 03BH DC 38 E09E 7E C3 3e 66 7E 60 DB 07EH, OC3H, 03CH, 066H, 07EH, 060H, 03CH, OOOH 3C 00 EOA6 CC 00 78 CC FC CO DB OCCH, DOOH, 07eH, oceH, OFCH, OCOH, 07SH, OOOH 78 00 EOAE EO 00 78 ce FC co DB OEOH, OOOH, 07SH, oceH, OFCH, DeOH, 07SH, OOCH 78 00 EOB6 CC 00 70 30 30 30 DB oeCH, OOOH, 070H, 030H, 030H, 030H, 078H, OOOH 78 00 EOBE 7C C6 38 18 18 18 DB 07eH, OC6H, 03SH, DISH, 018H, DISH, 03CH, OOOH 3C 00 Eoe6 EO 00 70 30 30 30 DB OEOH, OOOH, 070H, 030H, 030H, 030H, 078H, OOOH 78 00 EOCE C6 38 6C C6 FE C6 DB OC6H, 03SH, OEieH, oe6H, OFEH, OC6H, OC6H, OOOH e6 00 EODS 30 30 00 78 ec Fe DB 030H, 030H, DOOH, 078H, OCCH, OFCH, DeCH, DOOH CC 00 EODE 1e 00 Fe 60 7a 60 DB OleH, OOOH, OFCH, OSOH, 07SH, 060H, OFCH, OOOH Fe 00 EOE6 00 00 7F oe 7F cc DB OOCH, DODH, 07FH, OOCH, 07FH, OCCH, 07FH, OOOH 7F 00 EOEE 3E 6e ec FE ce ec DB 03EH, 06CH, oeCH, OFEH, OCCH, oeCH, OCEH, aOOH CE 00 EOF6 78 CC 00 78 ce ec DB 078H, OCCH, eOOH, 078H, OCCH, oeCH, 07SH, OOOH 78 00 EorE 00 ec 00 78 CC ec DB OOOH, oeeH, OOOH, 07SH, OCCH, OCCH, 07SH, OOOH 78 00 E106 00 EO 00 78 CC CC DB OOOH, OEOH, OOOH, 078H, OCCH, eCCH, 07SH, OOOH 78 00 E10E 78 ec 00 cc CC CC DB 07SH, oeCH, OOOH, oeCH, OCCH, OCCH, 07EH. OOOH 7E 00 E116 00 EO 00 ee ce cc DB OOOH, OEOH, OOOH, OCCH, oeCH, oeCH, 07EH, OOOH 7E 00 EliE 00 ce 00 ec ee 7e DB OOOH, OCCH, OOOH, oeCH, oeeH, 07CH, OOCH, OFSH oc FB E126 e3 18 3e 66 66 3C DB oe3H, OlSH, 03eH, OGGH, OG6H, 03eH, 018H, OOOH 18 00 E12E ec 00 cc ec ce cc DB OCCH, DOOH, oeeH, oeCH, DeCH, OCCH, 078H, OOOH 78 00 E136 18 18 7E CO CO 7E DB 01SH, OlSH, 07EH, oeOH, oeOH, 07EH, 018H, OISH 18 18 E13E 38 Be 64 FO 60 £6 DB 038H, 06CH, OS4H, OFOH, OSOH, OEGH, OFCH, OOOH Fe 00 E146 ec CC 78 Fe 30 FC DB OCCH, OCCH, 07BH, OFCH, 030H, OFCH, 030H, 030H 30 30 E14E F8 CC ec FA e6 CF DB OFSH, oeCH, OCCH, OFAH, OC6H, oeFH, oe6H, De7H C6 C7 E156 OE 18 18 3e 18 18 DB OOEH, 0 IBH, a 18H, 03CH, a ISH, DISH, ODSH, 070H D8 70 E15E lC 00 78 DC 7C CC DB OlCH, OOOH, 07BH, OOCH, 07CH, oeCH, 07EH, OOOH 7E 00 E16S 38 00 70 30 30 30 DB 038H, OOOH, 070H, 030H, 030H, 030H, 078H, OOOH 78 00 E16E 00 Ie 00 78 ee ee DB OOOH, 0 leH, OOOH, 07BH, OCCH, oeCH, 078H, OOOH 78 00 E176 00 Ie 00 ce CC ec DB OOOH, OICH, OOOH, oceH, oeCH, OCCH, 07EH, OOOH 7E 00 El7E 00 Fa 00 Fe cc CC DB OOOH, OFSH, ooaH, OFBH, OCCH, oeCH, oeeH, aOOH CC 00 E186 FC 00 CC EC FC DC DB OFCH, OOOH, OCCH, OEeH, OFCH, ODCH, OCCH, OOOH CC 00 E18E 3C SC 6e 3E 00 7E DB 03CH, 06eH, 06CH, 03EH, OOOH, 07EH, OOOH, OOOH 00 00 £196 38 SC se 3S 00 7C DB 038H, 06CH, 06CH, 038H, OOOH, 07CH, OOOH, OOOH 00 00 E19E 30 00 30 60 CO CC DB 030H, OOOH, 030H, 060H, OCOH, OCCH, 078H, OOOH 78 00 EIA6 00 00 00 Fe co co OB OOOH, OOOH, OOOH, OFCH, OCOH, OCOH, OOOH, OOOH 00 00 ElAE 00 00 00 Fe DC OC DB OOOH, OOOH, OOOH, OFeH, OOCH, OOCH, OOOH, OOOH 00 00 E186 e3 C6 ec DE 33 66 DB OC3H, OCSH, OCCH, ODEH, 033H, 06GH, oeCH, OOFH ec OF EIBE C3 C6 ce DB 37 6F DB oe3H, OCSH, oeCH, DDSH, 037H, 06FH, oeFH, 003H eF 03 EIC6 18 1S 00 18 18 18 DB 01BH, 01SH, DOOH, OISH, OlSH, OlSH, 018H, OOOH 18 00 EICE 00 33 66 ce S6 33 DB OOOH, 033H, 06SH, OCCH, OS6H, 033H, OOOH, OOOH 00 00 E106 00 CC 66 33 S6 ec OB OOOH, OCCH, 066H, 033H, 066H, oeeH, OOOH, OOOH 00 00 A-54 ROM BIOS El0E 22 88 22 BB 22 BB DB 022H, OSSH, 022H, oaSH, 022H, D8SH, 022H, OBSH 22 88 EIE6 55 AA 55 AA 55 AA DB 055H, OAAH, 055H, OAAH, 055H, OAAH, 055H, OAAH 55 AA EIEE DB 77 DB EE DB 77 DB ODSH, 077H, OD8H, OEEH, OOSH, 077H, OOSH, OEEH DB EE EIFS 19 19 19 18 18 18 DB o lSH, DISH, DISH, a ISH, 0 iSH, OlSH, OlSH, DISH 18 18 EIFE 18 18 IB 18 F8 18 DB o ISH, DISH, OlSH, OISH, OFSH, 01SH, Ol8H, 01SH 18 18 E206 18 18 FB 18 F8 18 DB OISH, 0 lSH, OFSH, 0 ISH, OFSH, 018H, OI8H, OISH 18 18 E20E 36 36 36 36 F6 36 DB 036H, 03SH, 036H, 036H, OF6H, 036H, 036H, 036H 36 36 E216 00 00 00 00 FE 36 DB OOOH, OOOH, OOOH, OOOH, OFEH, 036H, 036H, 03SH 36 36 E21E 00 00 Fe 18 F8 18 DB OOOH, OOOH, OFBH, 0ISH, OFSH, OISH, OISH, 01SH IS IS E226 36 36 F6 06 F6 36 DB 036H, 03SH, OF6H, OOSH, OF6H, 036H, 036H, C36H 36 36 E22£ 36 36 36 36 36 36 DB 036H, 03SH, 036H, 036H, 036H, 036H, 03SH, 03SH 36 36 E236 00 00 FE 06 F6 36 DB OOOH, OOOH, OFEH, OOSH, OF6H, 03SH, 03SH, 036H 36 36 E23E 36 36 F6 06 FE 00 DB 036H, 03SH, OFSH, 006H, OFEH, OOOH, OOOH, OOOH 00 00 E246 36 36 36 36 FE 00 DB D3SH, 036H, 036H, 036H, OFEH, OOOH, OOCH, OOOH 00 00 E24E 18 18 Fa 18 FS 00 DB DISH, OISH, OFaH, 0ISH, OFSH, OOOH, OOOH, OOOH 00 00 E256 00 00 00 00 Fa 18 DB OOOH, OOOH, OOOH, ooaH, OF8H, 0ISH, a 18H, 0 ISH 18 IS E25E 18 IS 18 18 IF 00 DB OISH, 0ISH, 0ISH, OISH, OIFH, OOOH, OOOH, OOOH 00 00 E266 18 18 18 18 FF 00 DB a ISH, 0 ISH, 0 ISH, OISH, OFFH, ooaH, oaOH, OOOH 00 00 E26E 00 00 00 00 FF IB DB OOOH, OOOH, OOOH, OOOH, OFFH, DISH, DISH, OlSH 18 18 E276 18 19 18 18 IF 18 DB 0ISH, 0ISH, 0ISH, 0ISH, OlFH, OISH, DISH, OISH 18 18 E27E 00 00 00 00 FF 00 DB OOCH, OOOH, OOOH, OOOH, OF'FH, ooaH, OOOH, OOOH 00 00 E286 18 18 18 18 FF 18 DB DISH, OISH, 01SH, OISH, OFFH, DISH, OIBH, 01SH 19 19 E28E 18 18 IF 18 IF IS DB a ISH, 0 ISH, 0IFH, 018H, OlFH, OISH, 0 ISH, 0 ISH IS IS E296 36 36 36 36 37 3S DB 03SH, 03SH, C3SH, 036H, 037H, 03SH, 036H, 036H 36 36 E29E 36 36 37 30 3F 00 DB 036H, 036H, 037H, 030H, 03FH, OOOH, OOOH, OOOH 00 00 E2A6 00 00 3F 30 37 36 DB OOOH, OOOH, 03FH, 030H, 037H, 03SH, 03SH, 036H 36 36 E2AE 36 38 F7 00 FF 00 DB 03SH, 036H, OF7H, aoaH, OFFH, oaOH, OOOH, OOOH 00 00 E286 00 00 FF 00 F7 36 DB OOOH, oaOH, OFFH, OOCH, OF7H, 03SH, 03SH, C3SH 36 36 E28E 36 36 37 30 37 36 DB 03SH, 036H, 037H, 030H, 037H, 03SH, 036H, 03SH 36 36 E2C6 00 00 FF 00 FF 00 DB OOCH, OOOH, OFFH, OOOH, OFFH, OOOH, OOOH, OOOH 00 DO E2CE 36 36 F7 00 F7 36 DB 036H, 036H, OF7H, OOOH, OF7H, 036H, 036H, 036H 3S 3S E206 18 18 FF 00 FF 00 DB o ISH, 0 ISH, OFFH, OOOH, OFFH, OOOH, OOOH, OOOH 00 00 E20E 36 3S 36 36 Ff 00 DB 03SH, 03SH, 036H, 03SH, OFFH, OOOH, OOOH, OOOH 00 00 E2E6 00 00 FF 00 FF 18 DB ~O~H, OOOH, OFFH, OOOH, OFFH, 01SH, OI8H, 01SH IS 18 E2EE 00 00 00 00 fF 3S DB OOOH, OOCH, OOOH, OOOH, OFFH, C36H, 036H, 03SH 36 36 E2f6 36 36 36 36 3F 00 DB 036H, 03SH, 036H, 036H, 03FH, OOOH, OOOH, OOOH 00 00 E2FE 18 19 IF 18 IF 00 DB DISH, OISH, OIFH, OISH, 0IFH, OOOH, OOOH, OOOH 00 00 E306 00 00 IF IS IF 18 DB OOOH, OOOH, 0 IFH, OISH, 01FH, OISH, 0 ISH, 0 ISH 18 18 E30E 00 00 00 00 3F 36 DB OOOH, OOOH, OOOH, OOOH, 03FH, 036H, 03SH, 036H 36 36 E316 36 36 36 3S FF 36 DB 036H, 03SH, 03SH, C36H, OFFH, 03SH, 036H, 036H 36 36 E3IE 18 18 FF 18 FF IS DB 01SH, DISH, OFFH, OISH, OFFH, OlSH, OISH, 01SH 18 IS E326 18 18 IS 18 FB 00 DB o ISH, 0 ISH, OISH, 0ISH, OFaH, OOOH, OOOH, OOOH 00 00 E32E 00 00 00 00 IF IS DB OOOH, OOOH, OOOH, OOOH, 0IFH, 0 ISH, 0 ISH, 0 lSH IS IS E33S FF FF FF FF FF FF DB OFFH, OFFH, OFFH, OFFH, OFFH, OFFH, OFFH, OFFH FF FF E33E 00 00 00 00 FF FF DB OOOH, OOOH, OOOH, OOOH, OFFH, OFFH, OFFH, OFFH FF FF E346 FO FO FO FO FO FO DB OFOH, OFOH, OFOH, OFOH, OFOH, OfOH, OFOH, OFOH Fa FO E34E OF OF OF OF OF OF DB OOFH, OOFH, OOFH, OOFH, OOFH, OOFH, OOFH, OOF'H OF OF E356 FF FF FF FF 00 00 DB OFFH, OFFH, OFFH, OFFH, OOQl.-', OOOH, OOOH, OOOH 00 00 ROM BIOS A-55 E35E 00 00 76 DC C8 DC DB OOOH, OOOH, 076H, ODeH, oeBH, OOCH, 076H, OOOH D_EO 76 00 E366 00 78 CC F8 ce Fa DB OOOH, 078H, OCCH, OF8H, OCCH, OFBH, oeOH, oeOH D_E1 co CO E36E 00 FC ce co co CO DB OOOH, OFCH, oeCH, OCOH, OCOH, OCOH, OCOH, OOOH D_E2 CO 00 E376 00 FE 6e 6C 6C 6C DB OOOH, OFEH, 06CH, 06eH, 06CH, 06CH, 06CH, OOOH 0_E3 6C 00 E37E Fe cc 60 30 60 CC DB OFCH, OCCH, 060H, 030H, 060H, OCCH, OFCH, OOOH 0_E4 FC 00 E386 00 00 7E DB 08 08 DB OOOH, OOOH, 07EH, 008H, OD8H, OD8H, 070H, OOOH D_E5 70 00 E38E 00 66 66 66 66 7C DB OOOH, 066H, 066H, 066H, 066H, 07CH, 060H, OCOH 0_E6 60 CO E396 00 76 DC lB 18 18 DB OOOH, 076H, OOCH, 018H, a IBH, 01BH, 018H, OOOH D_E7 18 00 E39E FC 30 78 CC CC 78 DB OFCH, 030H, 078H, OCCH, OCCH, 078H, 030H, OFCH 0_E8 30 FC E3AS 38 SC CS FE CS Be DB 038H, 06CH, OC6H, OFEH, OC6H, 06CH, 038H, OOOH D_E9 38 00 E3AE 38 6C e6 e6 6e 6e D8 038H, 06CH, OC6H, oe6H, 06eH, 06CH, OEEH, OOOH O_EA EE 00 E3B6 lC 30 18 7C CC CC DB 01eH, 030H, 018H, 01CH, oeeH, oeCH, 018H, OOOH D_EB 78 00 E3SE 00 00 7E DB DB 7E DB OOOH, OOOH, 07EH, ODBH, ODBH, 07EH. OOOH, OOOH D_EC 00 00 E3C6 06 DC 7E OS DB 7E DB OOSH, ooeH, 07EH, ODBH, ODBH, 07EH, 060H, oeOH D_ED 60 CO ElCE 38 60 CO FB CO 60 DB 038H, 060H, OCOH, OF8H, OCOH, 060H, 038H, OOOH D_EE 38 00 E3D6 78 ec CC CC CC CC DB 078H, OCCH, oeCH, OCCH, OCCH, oeCH, OCCH, OOOH D_EF CC 00 EJDE 00 FC 00 FC 00 FC D8 OOOH, OFCH, OOOH, OFCH, OOOH, OFCH, OOOH, OOOH D_FO 00 00 £3E6 30 30 Fe 30 30 00 DB 030H, 030H, OFCH, 030H, 030H, OOOH, OFCH, OOOH D_F1 FC 00 E3EE 60 30 18 30 60 00 DB 060H, 030H, 018H, 030H, 060H, OOOH, OFCH, OOOH D_F2 Fe 00 E3F6 IB 30 60 30 18 00 DB 018H, 030H, 060H, 030H, 01BH, OOOH, OFCH, OOOH D_F3 Fe 00 E3FE OE lB lS lS 18 18 D8 OOEH, 01BH, 018H, 018H, 018H, 0 18H, 018H, 018H D_F<4 18 18 E406 lS lB lS lS 18 08 DB 018H, 018H, 01BH, 018H, 018H, OD8H, ODBH, 070H O_F5 08 70 E40E 30 30 00 Fe 00 30 DB 030H, 030H, OOOH, OFCH, OOOH, 030H, 030H, OOOH D_F6 30 00 E0416 00 76 DC 00 76 DC DB OOOH, 076H, ODCH, OOOH, 076H, ODCH, OOOH, OOOH DJ7 00 00 E41E 38 6e 6C 38 00 00 DB 038H, 06CH, 06CH, 038H, OOOH, OOOH, OOOH, OOOH D_F8 00 00 E426 00 00 00 lS 18 00 DB OOOH, OOOH, OOOH, 018H, 018H, OOOH, OOOH, OOOH D_F9 00 00 E42E 00 00 00 00 18 00 DB OOOH, OOOH, OOOH, OOOH, 01BH, OOOH, OOOH, OOOH D_FA 00 00 E436 OF De DC DC Ee 6C DB OOFH, OOCH, OOCH, OOCH, OEeH, 06CH, 03CH, 01eH D_FB 3C lC E43E 78 6C 6C 6C 6C 00 DB 078H, 06CH, 06eH, 06CH, 06CH, OOOH, OOOH, OOOH D_FC 00 00 E446 70 18 30 60 78 00 D8 070H, 018H, 030H, 060H, 078H, OOOH, OOOH, OOOH D_FD 00 00 E44E 00 00 3C 3C ac 3C D8 OOOH, OOOH, 03CH, 03eH, 03eH, 03CH, OOOH, OOOH D_FE 00 00 E456 00 00 00 00 00 00 D8 OOOH, OOOH, OOOH, OOOH, OOOH, OOOH, OOOH, OOOH D_FF 00 00 ASSUME cs: CODE, 05: DATA --------------------------------------------------- SET_CTVPE TH I S ROUT I NE SETS THE CURSOR VALUE INPUT (CX. HAS CURSOR VALUE eH-START 1I NE, Cl-STOP LINE OUTPUT NONE ---------------------------------------------------- E45E SET_CTYPE PRoe NEAR E45£ 80 FC 04 CMP AH,4 IN GRAPHICS HODE? E461 72 03 JC C23X NO, JUMP E463 80 CD 20 OR CH,20H YES, a I SABLE CURSOR £466 B4 OA C23X: MOV AH,10 6845 REG I STER FOR CURSOR SET E468 89 DE 0060 R MOV CURSOR_MODE, ex SAVE IN DATA AREA E46C E8 E472 R CAll C23 OUTPUT CX REG E46F E9 OF10 R JHP VIDEO_RETURN ; THIS ROUTINE OUTPUTS THE CX REGISTER TO THE 6845 REGS NAMED IN AH E472 88 16 0063 R C23: "OV DX, ADDR_6845 ADDRESS REGI STER E476 8A C4 "OV AL,AH GET VALUE E478 EE OUT DX,Al REG I STER SET £479 42 INC DX DATA REGISTER E47A SA C5 .DV AL,CH DATA E47C EE OUT DX,Al E47D 4A DEC DX E47E SA C4 HOV AL,AH E480 FE CO INC AL POINT TO OTHER DATA REGISTER E482 EE OUT DX,Al SET FOR SECOND REGI STER £483 42 INC DX E484 SA Cl MOV AL,CL SECOND DATA VALUE E486 EE OUT OX,Al E487 C3 RET ALL DONE E488 5ET_CTVPE ENDP A-56 ROM BIOS SET_CPOS THIS ROUTINE SETS THE CURRENT CURSOR POSITION TO THE NEW X-Y VALUES PASSED INPUT DX - ROW, COLUMN OF NEW CURSOR BH - DISPLAY PAGE OF CURSOR OUTPUT CURSOR IS SET AT 6845 IF DISPLAY PAGE IS CURRENT DISPLAY ~~~-~;~~--------;;~~----~;;;------------------ E488 E488 8A CF - MOY Cl, BH E48A 32 ED XOR CH,CH ; ESTABLISH lOOP COUNT E48C D1 E1 SAL C)(, 1 ; WORD OFFSET E48E 88 F1 MOV SI,CX ; USE INDEX REGISTER E490 89 94 0050 R MOV [51 +OFFSET CUR50R_POSN1, OX ; SAVE THE POI NTER E494 38 3E 0062 R CMP ACTI VE_PAGE, BH E498 75 05 JNZ C24 SET CPOS RETURN E49A 88 C2 MOV AX, OX GET-ROW/COLUMN TO AX E49C E8 E4A2 R CALL C25 CURSOR_SET E49F E9 OF70 R C24: JMP VIDEO_RETURN E4A2 SET _CPOS ENDP SET CURSOR POSITION, AX HAS ROW/COLUMN FOR CURSOR E4A2 C25 PROC NEAR E4A2 E9 E5C2 R CALL POSITION DETERMINE LOCATION IN REGEN BUFFER E4A5 88 C8 HOV CX, AX E4A7 03 OE 004E R ADD ex, CRT_START ADD I N THE START ADDRESS FOR THIS PAGE E4AB D1 F9 SAR CX,l DIVIDE BY 2 FOR CHAR ONLY COUNT E4AD 94 DE HOV AH,14 REG I STER NUMBER FOR CURSOR E4AF ES E472 R CALL C23 OUTPUT THE VALUE TO THE 6845 E482 C3 RET E483 C25 ENDP ACT 0 I SP PAGE - THIS ROUTINE SETS THE ACTIVE DISPLAY PAGE, ALLOWING THE FULL USE OF THE RAM SET ASIDE FOR THE VIDEO ATTACHMENT INPUT AL HAS THE NEW ACTIVE DISPLAY PAGE OUTPUT THE 6845 I S RESET TO 0 I SPLAY THAT PAGE ~~~:~~~~~~;~~---;~~~----~;~;---------------------- E483 E483 AS 80 TEST AL / 080H CRT/CPU PAGE REG FUNCTION E485 75 24 .JNZ SET CRTCPU YES, GO HANDLE IT E487 A2 0062 R MOY ACTIVE_PAGE, AL SAVE ACTIVE PAGE VALUE E46A 88 OE 004C R MOV CX, CRT_LEN GET SAVED LENGTH OF REGEN BUFFER E4BE 98 CBW CONVERT Al TO WORD E48F 50 PUSH AX SAVE PAGE VALUE E4CO F7 E1 MUL CX DISPLAY PAGE TIMES REGEN lENGTH E4C2 A3 004E R MOY CRT_START, AX SAVE START ADDRESS FOR LATER USE E4C5 88 CS MOV CX, AX START ADDRESS TO ex E4C7 D1 F9 SAR CX,l DIVIDE BY 2 FOR 6845 HANDLING E4C9 84 ac MOV AH,12 6B45 REGISTER FOR START ADDRESS E4C8 E8 E472 R CALL C23 E4CE 58 POP ex RECOVER PAGE VALUE E4CF D1 £3 SAL ex, 1 ; *2 FOR WORD OFFSET £4D1 89 87 0050 R MOV AX, [BX + OFFSET CURSOR_POSNl ; GET CURSOR FOR THIS ; PAGE E4D5 EB E4A2 R CAll C25 ; SET THE CURSOR POS I T I ON E409 £9 OF70 R JMP VIDEO_RETURN ------------------------------------------------------- SET_CRTCPU THI S ROUTI NE READS OR WRITES THE CRT /CPU PAGE REGI STERS INPUT (AU B3H SET BOTH CRT AND CPU PAGE REGS (BH) VALUE TO SET I N CRT PAGE REG I all VALUE TO SET J N CPU PAGE REG (Al) B2H SET CRT PAGE REG (BH) VALUE TO SET I N CRT PAGE REG (AU = 81H SET CPU PAGE REG (BL> VALUE TO SET I N CPU PAGE REG (AU ;;; SOH READ CURRENT VALUE OF CRT/CPU PAGE REGS OUTPUT ALL FUNCT IONS RETURN (BH) ;;; CURRENT CONTENTS OF CRT PAGE REG (BU ;;; CURRENT CONTENTS OF CPU PAGE REG ~~~-~;~~;~~---------------------------------------------- E4D8 E40B 8A EO - MOV AH, Al SAVE REQUEST IN AH E4DD SA 03DA MOV OX, YGA_CTl SET ADDRESS OF GATE ARRAY E4EO EC C26, IN Al, ox GET STATUS E4E1 24 08 AND Al,OSH VERTI CAL RETRACE? E4E3 74 F8 JZ C26 NO, WAI T FOR IT E4E5 SA 03DF HOV DX, PAGREG SET 10 ADDRESS OF PAGE REG E4E8 AD OOSA R HOV Al, PAGDAT GET DATA LAST OUTPUT TO REG E4EB SO FC BO CHP AH, SOH READ FUNCTION REQUESTED? E4EE 74 27 JZ C29 YES. DON'T SET ANVTHING E4FO 80 FC B. CHP AH,84H VAll D REQUEST? E4F3 73 22 JNC C29 NO, PRETEND I T WAS A READ REQUEST E4F5 F6 C4 01 TEST AH, 1 SET CPU REG? E4F8 74 00 JZ C27 NO, GO SEE ABOUT CRT REG E4FA DO E3 SHe Bl,l SHIFT VALUE TO RIGHT BIT POSITION E4FC DO E3 SHe BL,l E4FE 00 E3 SHe BL,l E500 24 C7 AND AL, NOT CPUREG CLEAR OLD CPU VALUE £502 80 E3 38 AND Bl, CPUREG BE SURE UNRELATED BITS ARE ZERO ES05 OA C3 OR AL, BL OR I N NEW VALUE ROM BIOS A-57 E507 F6 C4 02 C27: TEST AH,2 SET CRT REG? E50A 74 07 JZ C2B NO, GO RETURN CURRENT SETT 1 NGS E50C 24 F8 AND Al, NOT CRTREG CLEAR OLD CRT VALUE E50E 80 £7 07 AND BH, CRTREG BE SURE UNRE:LATED 81 T5 ARE ZERO E511 OA C7 OR Al, BH OR I N NEW VALUE E513 EE C28 OUT OX, Al SET NEW VALUES E514 A2 008A R MOV PAGDAT, Al SAVE COPY I N RAM E517 8A 08 C29 MOV el, Al GET CPU REG VALUE E519 80 E3 3B AND Bl, CPUREG CLEAR EXTRA 8 ITS E51C DO FB SAR Bl,1 RIGHT JUSTIFY IN Bl E5IE DO FB SAR BL,l E520 DO FB SAR Bl,l E522 aA Fa MOV BH, Al GET CRT REG VALUE E524 80 E7 07 AND BH, CRTREG CLEAR EXTRA SI TS E527 SF POP 01 RESTORE SOME REGS E528 5£ POP 51 E529 58 POP AX DISCARD SAVED BX E52A £9 OF73 R JMP C22 RETURN E520 ACT _0 I SP _PAGE ENOP READ CURSOR - THIS ROUTINE READS THE CURRENT CURSOR VALUE FROM THE 6845, FORMATS IT, AND SENDS IT BACK TO THE CALLER INPUT BH - PAGE OF CURSOR OUTPUT OX - ROW, COLUMN OF THE CURRENT CURSOR POSITION CX - CURRENT CURSOR MODE E520 READ_CURSOR PROC NEAR E520 8A OF MOV BL, BH E52F 32 FF XOR BH, BH E531 01 E3 SAL ex, 1 WORD OFFSET E533 8B 97 0050 R MOV ox, EBX+OFFSET CURSOR_POSN] E537 88 DE 0060 R MOV CX, CURSOR_MODE £53B SF POP 01 E53C 5E POP 51 E530 5B POP BX E53E 58 POP AX DISCARD SAVED ex AND OX E53F 58 POP AX E540 IF POP OS E541 07 POP ES E542 CF IRET £543 READ_CURSOR ENDP SET COLOR THIS ROUTINE Will ESTABLISH THE BACKGROUND COLOR, THE OVERSCAN COLOR, AND THE FOREGROUND COLOR SET FOR GRAPHICS INPUT . I T EXPECTS TO BE PASSED: (OS) :: ADDRESS OF SEGMENT WHERE INTR FLAG IS DEFINED COl) = OFFSET OF THE INTERRUPT BIT MASK UPON RETURN; INTR FLAG BIT FOR THE DEVICE = 0 NO REGISTERS ARE ALTERED E6F5 SUI PROC NEAR E6F5 50 PUSH AX ESFG FB 5T1 ENABLE MASKABLE EXTERNAL INTERRUPTS ESF7 2E: BA 25 MOV AH, CS· [01 ] GET INTERRUPT 8 I T MASK ESFA 20 26 00B4 R AND I NTR_FLAG, AH CLEAR 8259 INTERRUPT REC' 0 FLAG BIT ESFE E. 21 IN AL, I NTAO 1 CURRENT INTERRUPTS E700 22 c. AND AL, AH ENABLE THIS INTERRUPT, TOO E702 E6 21 OUT I NTA01, AL WRI TE TO 8259 (I NTERRUPT CONTROLLER' £704 58 POP AX E705 C3 RET E70S SUI ENDP SUBROUTINE WHICH CHECKS IF A 8259 INTERRUPT IS GENERATED BY THE 8250 INTERRUPT. I T EXPECTS TO BE PASSED: (01) ;; OFFSET OF INTERRUPT BIT MASK (OS) :: ADDRESS OF SEGMENT WHERE INTR_FLAG IS DEFINED IT RETURNS: (CF) :: 1 IF NO INTERRUPT IS GENERATED o I F THE I NTERRUPT OCCURRED (AU ;; COMPLEMENT OF THE I NTERRUPT MASK NO OTHER REG I STERS ARE AL TERED E706 C5059 PROC NEAR E706 51 PUSH ex E707 28 C9 SUB ex. ex SET PROGRAM LOOP COUNT E709 2£: 8A 05 MOV AL, CS: [OIl GET I NTERRUPT MASK E70C 34 FF XOR AL, OFFH COMPLEMENT MASK SO ONLY THE INTR TEST Bl T IS ON E70E B4 OS 0084 R AT25: TEST I NTR_FLAG, AL 8259 I NTERRUPT OCCUR? E712 75 03 JNE AT27 YES - CaNT I NUE E714 E2 F8 LOOP AT25 WA IT SOME MORE E716 F9 5TC TIME'S UP - FAILED E717 59 AT27: POP ex E718 C3 RET E719 C5059 ENDP SUBROUTINE TO WAIT FOR ALL ENABLED 8250 INTERRUPTS TO CLEAR (50 NO INTRS WILL BE PENDING). EACH INTERRUPT COULD TAKE UP TO 1 MILLISECOND TO CLEAR. THE INTERRUPT IDENTIFICATION REGISTER: WILL BE CHECKED UNTIL THE INTERRUPT(S) IS CLEARED OR A TIMEOUT OCCURS EXPECTS TO BE PASSED: (OX) ADDRESS OF THE INTERRUPT 10 REGISTER RETURNS: (AU CONTENTS OF THE I NTR 10 REGI STER (CF) 1 I F I NTERRUPTS ARE sTI LL PEND I NG o I F NO I NTERRUPTS ARE PEND I NG (ALL CLEAR) NO OTHER REG I STERS ARE AL TEREO. ; ------------------------------------------------------------------ E719 W8250C PROC NEAR E719 51 PUSH ex E71A 28 C. SU8 CX, CX E71C EC AT28: IN AL, DX READ INTR 10 REG E71D 3C 01 eMP AL,I INTERRUPTS STILL PENDING? E71F 7. 05 JE AT29 AT28 NO -GOOD FINISH KEEP TRY I NG £721 E2 F' LOOP E723 F. STC TIME'S UP - ERROR E724 EB 01 JMP SHORT AT30 E726 F8 AT29: eLC £727 5. AT30: POP CX E728 C3 RET E729 W8250C ENDP A-62 ROM BIOS ----- I NT 14-------------------------------------------- RS232_IO THIS ROUTINE PROVIDES BVTE STREAM I/O TO THE COMMUNICATIONS PORT ACCORD I NG TO THE PARAMETERS; (AH)=O INITIALIZE THE COMMUNICATIONS PORT (AL) HAS PARMS FOR INITIALIZATION - - - 7 -------6------ -5---- ---4-- -----3-------2------- -- 1-------0---- -------- BAUD RATE ---.: ----PARITV---- -STOPBIT-:: --WORD LENGTH-- 000 - 110 XO - NONE o - 1 10 - 7 SI T5 001 - 150 01 - ODD 1 - 2 11-8BIT5 010 - 300 11 - EVEN all - 600 100 - 1200 101 - 2400 110 - 4800 111 - 4800 ON RETURN, THE RS232 I NTERRUPTS ARE DISABLED AND COND 1 T IONS ARE SET AS I N CALL TO COMMa STATUS (AI-I=3) (AH) = 1 SEND THE CHARACTER IN (AL) OVER THE COMMa LINE (AL) REG I STER I S PRESERVED ON EXIT, BIT 7 OF AH IS SET IF THE ROUTINE WAS UNABLE TO TRANSMIT THE BYTE OF DATA OVER THE LINE. IF 8IT 7 OF AH 15 NOT SET, THE REMAINDER OF AH IS SET AS IN A STATUS RE:QUEST, REFELECTING THE CURRENT STATUS OF THE LINE. (AH):;2 RECE I 'IE A CHARACTER IN (AL) FROM COMMO LINE BEFORE RETURNING TO CALLER ON EXIT, AH HAS THE CURRENT LINE STATUS, AS SET BV THE STATUS ROUTINE, EXCEPT THAT THE ONLY 81TS LEFT ON, ARE THE ERROR BITS <7,4,3,2,1). IN THIS CASE, THE TIME OUT BIT I NO 1 CATES DATA SET READY WAS NOT RECE I VED. THUS, AH I S NON ZERO ONLY WHEN AN ERROR OCCURRED. (NOTE: IF THE TIME-OUT BIT IS SET, OTHER BITS IN AH MAY NOT BE RELIABLE. ) (AH):;3 RETURN THE COMMO PORT STATUS IN (AX) AH CONTAINS THE LINE CONTROL STATUS BIT 7 :; TIME OUT BIT 6 = TRANS SHIFT REG I STER EMPTV BIT 5 = TRAN HOLD I NG REG I STER EMPTV BIT 4 :; BREAK DETECT BIT 3 :; FRAM I NG ERROR BIT 2 :; PARtTY ERROR BIT 1 :; OVERRUN ERROR BIT 0 :; DATA READV AL CONTAINS THE MODEM STATUS BIT 7 ~ RECIEVED LINE SIGNAL DETECT BIT 6 :; RING INDICATOR BIT 5 :; DATA SET REAOY BI T 4 :: CLEAR TO SEND BIT 3 :; DELTA RECEIVE LINE SIGNAL DETECT BIT 2 :;:: TRAILING EDGE RING DETECTOR BIT 1 :; DELTA DATA SET READY BIT a :; DELTA CLEAR TO SEND (OX) :; PARAMETER INDICATING WHICH RS232 CARD (0,1 ALLOWED) DATA AREA RS232 BASE CONTAINS THE BASE ADDRESS OF THE 8250 ON THE CARD. LOCATION 400H CONTAINS UP TO 4 RS232 ADDRESSES POSSIBLE DATA AREA RS232 TIM OUT (BYTE) CONTAINS OUTER LOOP COUNT VALUE FOR - TIMEOUT (DEF AUL T:; 1 ) OUTPUT AX MOD J FLED ACCORD I NG TO PARMS OF CALL ALL OTHERS UNCHANGED ASSUME CS: CODE, OS, DATA £729 ORG OE729H E729 Al LABELWORD E729 03F9 OW 1017 110 BAUD j TABLE OF INIT VALUE E72B 02EA OW 746 150 £720 0175 OW 373 300 E72F OOSA OW 188 600 E731 0050 OW 93 1200 E733 002F OW 47 2400 E735 0017 OW 23 4800 E737 0017 OW 23 j 4800 E739 RS232_IO PROC FAR VECTOR TO APPROPRIATE ROUTINE E739 FB STI ; I NTERRUPTS BACK ON E73A lE PUSH OS ; SAVE SEGMENT E73B 52 PUSH OX £73C 56 PUSH 51 £730 57 PUSH 01 £73E 51 PUSH ex £73F 53 PUSH BX E740 SB F2 MOV 51, OX RS232 VALUE TO 51 E742 BB FA HOV 01, ox AND TO 01 (FOR TI"EOUTS) E744 01 E6 SHL 51,1 WORD OFFSET E746 E8 13SB R CALL DDS j POI NT TO BIOS DATA SEGMENT E749 BB 94 0000 R MOV OX, RS232_BASECSI] • GET BASE ADDRESS E740 08 02 OR DX, OX TEST FOR a BASE ADDRESS E74F 74 13 JZ A3 RETURN £751 OA E4 OR AH. AH TEST FOR cAH):;O £753 74 16 JZ A4 COMMUN INIT E755 FE CC DEC AH TEST FOR (AH)=l E757 74 47 JZ A5 SEND AL E759 FE CC DEC AH TEST FOR (AH):;2 E75B 74 BC JZ A12 RECEIVE INTO AL £750 FE CC DEC AH TEST FOR (AH)=3 E75F 75 03 JNZ A3 £761 E9 E7F3 R JMP AlB COMMUNICATION STATUS A-ROM BIOS A-63 E764 11.3: i RETURN FROM RS232 E764 58 POP 8X £765 59 POP CX £766 SF POP 01 E767 5E POP SI E768 SA POP OX E769 IF POP OS E76A CF IRET ; RETURN TO CALLER, NO ACTI ON INITIALIZE THE COMMUNICATIONS PORT E76B SA EO A4: HOV AH, AL ; SAVE I NI T PARMS IN AH E76D 83 C2 03 AOD OX,3 ; POINT TO 8250 CONTROL REGISTER E770 80 80 HOV AL, BOH E772 EE OUT OX, AL ; SET OLAB= 1 DETERMINE BAUD RATE DIVISOR E773 8A 04 HOV OL, AH GET PARMS TO OL E775 Bl 04 MOV CL,04 E777 02 C2 ROL OL, CL E779 81 E2 OOOE AND OX, OEH I SOlATE THEM E770 BF E729 R MOV 0 I ,OFFSET 11.1 BASE OF TABLE E780 03 FA ADD 01, OX ; PUT INTO INDEX REGISTER E782 88 94 0000 R MOV OX, RS232_BASE[SI] ; POINT TO HIGH ORDER OF DIVISOR E78G .2 INC OX E787 2E: SA 45 01 MOV AL,CS:[DIl+l GET HIGH ORDER OF DIVISOR E7aB EE OUT OX, AL SET MS OF DIV TO 0 E78C 4A DEC OX E780 2E: SA 05 MOV AL,CS·[DI] GET LOW ORDER OF DIVISOR E790 EE OUT OX, AL SET LOW OF DIVISOR E791 83 C2 03 ADD OX,3 E794 8A C. MOV AL,AH GET PARMS BACK E79G 2. lF AND AL, OlFH STRIP OFF THE 8AUD BITS E798 EE OUT OX,AL LI NE CONTROL TO B BITS E799 4A DEC OX E79A .A DEC OX E798 80 00 HOV AL,O E790 EE OUT OX, AL I NTERRUPT ENABLES ALL OFF E79E Ee 53 ....IMP SHORT A18 ; COM_STATUS SEND CHARACTER IN (AL) OVER COMMO LINE E7AO ~5: E7AO 50 PUSH AX SAVE CHAR TO SEND E7Al 83 C2 04 ADD DX,4 MODEM CONTROL REG 1 STER E7A4 BO 03 MOV AL,3 DTR AND RTS E7AG EE OUT OX, AL DATA TERMINAL READY, REQUEST TO SEND E7A7 42 INC OX MODEM STATUS REGISTER E7A8 42 INC OX E7AS 87 30 MOV 8H,30H DATA SET READY & CLEAR TO SEND E7AB E8 E802 R CALL WAJ T _FOR_STATUS ARE BOTH TRUE? E7AE 74 08 JE A9 YES, READY TO TRANSMIT CHAR E780 59 11.7: POP CX E791 SA Cl MOV AL,CL RELOAD DATA BYTE E783 80 CC 90 AS- OR AH,80H INDICATE TIME our E7BG E8 AC J"P A3 RETURN E788 11.9: CLEAR TO SEND E798 4A DEC OX LI NE STATUS REGI STER E799 B7 20 MDV BH,20H IS TRANSMI TTER READY E79B E8 E802 R CALL WAI T_FOR_STATUS TEST FOR TRANSMI TTER READY E7BE 75 FO JNZ A7 RETURN WI TH TI ME OUT SET E7CO 83 Ell. 05 SUB DX,5 DATA PORT E7C3 59 PDP CX RECOVER IN CX TEMPORAR I L Y E7C4 811. Cl MOV AL, CL MOVE CHAR TO AL FOR OUT, STATUS IN AH E7C6 EE OUT OX,AL OUTPUT CHARACTER E7C7 EB 98 JMP A3 ; RETURN RECEIVE CHARACTER FROM COMMO LINE E7C9 83 C2 04 ~12: ADD OX,o4 MODEM CONTROL REG I STER E7CC BO 01 MOV AL,l DATA TERMI NAL REAOY E7CE EE OUT OX, AL E7CF 42 INC OX MODEM STATUS REGI STER E700 42 INC OX E701 B7 20 MOV BH,20H DATA SET READV E703 ES E802 R CALL WAIT FOR STATUS TEST FOR DSR £706 75 DB JNZ A8 - - RETURN WJTH ERROR E70S 4A DEC OX LINE STATUS REGISTER E709 EC 11.16: IN AL, OX E70A AS 01 TEST AL,l RECE I VE BUFFER FULL E70C 75 09 JNZ A17 TEST FOR REC. BUFF. FULL E70E F6 06 0071 R 80 TEST BIOS_BREAK, SOH TEST FOR BREAK KEY E7E3 74 F4 JZ A16 LOOP 1 F NO 8REAK KEY E7E5 EB CC J"P A8 SET TIME OUT ERROR E7E7 24 IE A17: AND AL,00011110B TEST FOR ERROR CO NO J T IONS ON RECV CHAR E7E9 SA EO MOV AH,AL E7E8 88 94 0000 R HOV OX, RS232_8ASE[SI] DATA PORT E7EF EC IN AL, OX GET CHARACTER FROM LI NE E7FO E9 E764 R JMP A3 ; RETURN COHMO PORT STATUS ROUTINE E7F3 SB 94 0000 R ~18: MOV OX, RS232_BASE[SI] E7F7 B3 C2 05 ADD OX,5 CONTROL PORT E7FA EC IN AL,OX GET LINE CONTROL STATUS E7FB BA EO MOV AH, AL PUT IN AH FOR RETURN E7FD 42 INC ox POINT TO MODEH STATUS REGISTER E7FE EC IN AL,OX GET HODEM CONTROL STATUS E7FF E9 E764 R ....IMP A3 RETURN --------------------------------------'--- WAlT FOR STATUS ROUTl NE ENTRY: BH=STATUS BITeS) TO LOOK FOR, DX=ADDR. OF STATUS REG EXIT· ZERO FL,t\G ON = STATUS FOUND ZERO FLAG OFF = Tl MEOUT AH=LAST STATUS READ A-64 ROM BIOS E802 WAIT FOR STATUS PRoe NEAR E802 SA 90 007C R - HOV Bl, RS232_TIM_OUTCOI J iLOAO OUTER LOOP COUNT E806 28 C9 WFSO: SUB ex, ex E808 EC WFSl; IN AL, ox ; GET STATUS E809 8A EO MOV AH, AL ; MOVE TO AH E808 22 C7 AND AL,8H ; ISOLATE BI TS TO TEST £800 3A C7 CMP AL, BH ; EXACTL Y = TO MASK EBOF 74 DB JE WFS_ENO ; RETURN WITH ZERO FLAG ON EBll E2 F5 LOOP WF51 iTRY AGAIN E813 FE CB OEC 8L E815 75 EF JNZ WFSO E817 OA FF OR BH, BH j SET ZERO FLAG OFF E819 E819 C3 RET E81A WAIT FOR STATUS ENDP E8lA RS232_1 0- ENDP ; THIS ROUTINE WILL READ T1MERl. THE VALUE READ IS RETURNED IN AX. ------------------------------------------------------------------ E81A READ_TIME PROC NEAR E81A 80 40 MOV AL,40H LATCH TIMERI EBlC E6 43 OUT TIM_CTL, AL EB1E 50 PUSH AX WAIT FOR 8253 TO INIT ITSELF EalF 58 POP AX E820 E4 41 IN AL, TIMER+l READ LSB E822 8A EO MOV AH, AL SAVE IT IN HIGH BYTE EB24 50 PUSH AX WAI T FOR 8253 TO 1 NI T ITSELF EB25 58 POP AX EB26 E4 41 IN AL, TIMER+l REA.D MS8 E828 86 C4 XCHG AL, AH PUT BYTES I N PROPER ORDER E82A C3 RET E82B READ_TIME ENDP E82E ORG OEB2EH E82E E9 1300 R JMP NEAR PTR KEYBOARD _10 ASYNCHRONOUS COMMUNICATIONS ADAPTER POWER ON DIAGNOSTIC TEST DESCR I PTI ON: THIS SUBROUTINE PERFORMS A THOROUGH CHECK OUT OF AN INS8250 LSI CHIP. THE TEST INCLUDES: 1) INITIALIZATION OF THE CHIP TO ASSUME ITS MASTER RESET STATE. 2) READING REGISTERS FOR KNOWN PERMANENT ZERO BITS. 3) TESTING THE INS8250 INTERRUPT SYSTEM AND THAT THE 8250 INTERRUPTS TRIGGER AN 8259 (INTERRUPT CONTROLLER) INTERRUPT. 4) PERFORMING THE LOOP BACK TEST: A) TESTING WHAT WAS WRITTEN/READ AND THAT THE TRANSMITTER HOLD I NG REG EMPTY B IT AND THE RECE I VER I NTERRUPT WORK PROPERLY. 8) TESTING IF CERTAIN BITS OF THE DATA SET CONTROL REGISTER ARE 'LOOPED BACK' TO THOSE IN THE DATA SET STATUS REGISTER. C) TESTING THAT THE TRANSMITTER IS IDLE WHEN TRANSMISSION TEST IS FINISHED. THIS SUBROUTINE EXPECTS TO HAVE THE FOLLOWING PARAMETER PASSED: (DX)= ADDRESS OF THE INS8250 CARD TO TEST. NOTE: THE ASSUMPTION HAS BEEN MADE THAT THE MODEM ADAPTER IS LOCATED AT 03F8H; THE SERIAL PRINTER AT 02FBH. I T RETURNS: (CF) = 1 IF ANY PORTION OF THE TEST FAILED = 0 I F TEST PASSED (ex) = FAILURE KEV FOR ERROR MESSAGE = 2 PERMANENT ZERO BITS IN INTERRUPT ENABLE REGISTER WERE INCORRECT PERMANENT ZERO BITS IN INTERRUPT IDENTIFICATION REGISTER WERE INCORRECT PERMANENT ZERO BITS IN DATA SET CONTROL REGISTER WERE 1 NCORRECT PERMANENT ZERO BITS IN THE LINE STATUS REGISTER WERE INCORRECT RECEIVED DATA AVAILABLE INTERRUPT TEST FAILED (THE INTERRUPT WAS NOT GENERATED) 16H RECEIVED DATA AVAILABLE INTERRUPT FAILED TO CLEAR 7 RESERVED FOR REPORTING THE TRANSMITTER HOLDING REGISTER EMPTY INTERRUPT TEST FAILED (NOT USED AT THIS TIME BECAUSE OF THE DIFFERENCES BETWEEN THE 8250 '5 WHI CH WI LL BE USED) 17H TRANSMITTER HOLD I NG REG EMPTY 1 NTR FAI LED TO CLEAR 8-8 RECEIVER LINE STATUS INTERRUPT TEST FAILED (THE INTERRUPT WAS NOT GENERATED) 8 - OVERRUN ERROR 9 - PARITY ERROR A - FRAMING ERROR B - BREAK 1 NTERRUPT ERROR 18-1B RECEIVER LINE STATUS INTERRUPT FAILED TO CLEAR C-F MODEM STATUS INTERRUPT TEST FAILED (THE INTERRUPT WAS NOT GENERATED) C - DELTA CLEAR TO SEND ERROR o - DELTA DATA SET READY ERROR E - TRAILING EDGE RING INDICATOR ERROR F - DELTA RECEIVE LINE SIGNAL DETECT ERROR ROM BIOS A-65 lC-lF MODEM STATUS INTERRUPT FAILEO TO CLEAR 10H AN B250 I NTERRUPT OCCURRED AS E)(PECTED, BUT NO 8259 (I NTR CONTROLL.ER) INTERRUPT WAS GENERATED llH DURING THE TRANSMISSION TEST, THE TRANSMITTER HOLDING REGISTER WAS NOT EMPTV WHEN IT SHOULD HAVE BEEN. 12H DURING THE TRANSMISSION TEST, THE RECEIVED DATA AVAILABLE INTERRUPT DIDN'T OCCUR. 13H TRANSMISSION ERROR - THE CHARACTER RECEIVED DURI NG LOOP MODE WAS NOT THE SAME AS THE ONE TRANSM I TTED 14H DURING TRANSMISSION TEST, THE 4 DATA SET CONTROL OUTPUTS WERE NOT THE SAME AS THE 4 DATA SET CONTROL INPUTS. ISH THE TRANSMITTER WAS NOT IDLE AFTER THE TRANS- MISSION TEST COMPLETED. ON EKIT: - THE MODEM OR SERI AL PRI NTER 'S 8259 INTERRUPT (WHI CHEYER DEVICE WAS TESTED) IS DISABLED. - THE B250 IS I N THE MASTER RESET STATE. ONLV THE OS REGISTER IS PRESERVED - ALL OTHERS ARE ALTERED. ~;~;----~~~-----;~~---------------~~~;-;~~~-~;~~;;;~;;~~-~~;~------ = 0084 ; I NTERRUPT VECTOR ADDRESS ; (IN DIAGNOSTICS) ASSUME CS; CODE, os: DATA E831 UART PROC NEAR E831 1E PUSH DS E832 E4 21 IN AL,INTA01 CURRENT ENABLED INTERRUPTS E834 50 PUSH AX SAVE FOR EXIT E835 OC 01 OR AL, 00000001B DISABLE TIMER INTR DURING THIS TEST E837 E6 21 OUT INTA01, AL E839 9C PUSHF SAVE CALLER'S FLAGS (SAVE INTR FLAG) E83A 52 PUSH OX SAVE BASE ADDRESS OF ADAPTER CARD E83B E8 138B R CALL DDS SET UP 'DATA' AS DATA SEGMENT ADDRESS INITIALIZE PORTS FOR MASTER RESET STATES AND TEST PERMANENT ZERO DATA BITS FOR CERTAIN PORTS. E83E £8 OAC4 R CALL 182150 E841 73 03 JNC AT1 j ALL OK E843 E9 E948 R JHP AT14 ; A PORT'S ZERO BITS WERE NOT ZERO! I NS8250 J NTERRUPT SVSTEM TEST ONLY THE INTERRUPT BEING TESTED WILL BE ENABLED. SET 01 AND 51 FOR CALLS TO 'SUI' E846 BF 0041 R ~T1; MOY 0 I , OFFSET IMASKS ; BASE ADDRESS OF INTERRUPT MASKS E849 33 F6 )(OR 51,51 HOOEM INDEX E84B 80 FE 02 CMP DH,2 ; OR SERIAL? ~~.; ~~~ ~ A~O~~~ E84E 75 02 JNE AT2 E850 46 INC SI : NTER E851 47 INC 01 ; SERIAL PRINTER 8259 MASK ADDRESS RECEIVED DATA AVAI LABLE I NTERRUPT TEST E852 E8 E6F5 R ;'T2: CALL SUI SET UP FOR INTERRUPTS E855 FE C3 INC SL ERROR REPORTER (I NIT. IN 18250) ES57 42 INC D)( POI NT TO I NTERRUPT ENABLE REGISTER ES5S 80 01 HOV AL,1 ENABLE RECEIVED DATA AVAILABLE INTR E85A EE OUT DX,AL EOSB 53 PUSH ax SAYE ERROR REPORTER E85C S3 C2 04 ADO 0)(,4 POINT TO LINE STATUS REGISTER E85F B4 01 HOV AH,l SET RECEIVER DATA READ V BIT E861 BB 0400 HOV BX,0400H INTR TO CHECK, INTR IDENTIFIER E864 B9 0003 HOV C)(,3 INTERRUPT 10 REG 'INDE)(' E867 E8 OAFS R CALL ICT PERFORM TEST FOR 1 NTERRUPT E86A 58 POP ax RESTORE ERROR INDICATOR EB6B 3C FF CHP AL,OFFH I NTERRUPT ERROR OCCUR? E860 74 36 JE AT4 VE5 EB6F E8 E706 R CALL C5059 GENERATE 8259 INTERRUPT? E872 72 33 JC AT5 NO E874 4A DEC DX E875 .A DEC OX RESET I NTA BY READ I NG RECA BUFR E876 EC IN AL,DX DON'T CARE ABOUT THE CONTENTS! E877 42 INC DX E878 42 INC OX INTR ID REG E879 E8 E719 R CALL W8250C WAIT FOR I NTR TO CLEAR E87C 73 03 JNC AT3 OK E87E E9 E948 R JHP AT13 DIDN'T CLEAR TRANSMITTER HOLDING REGISTER EMPTV INTERRUPT TEST THIS TEST HAS BEEN MODIFIED BECAUSE THE DIFFERENT B250'S THAT MAV BE USED IN PRODUCING THIS PRODUCT DO NOT FUNCTION THE SAME DURING THE STANDARD TEST OF THIS INTERRUPT (STANDARD BEING THE SAME METHOD FOR TESTING THE OTHER POSSIBLE 8250 INTERRUPTS)' IT IS STILL VALID FOR TESTING IF AN 8259 INTERRUPT IS GENERATED IN RESPONSE TO THE 8250 INTERRUPT AND THAT THE 9250 INTERRUPT CLEARS AS IT SHOULD. IF THE TRANSMITTER HOLDING REGISTER EMPTY INTERRUPT IS NOT GENERATED WHEN THAT INTERRUPT IS ENABLED, IT IS NOT TREATED AS AN ERROR. HOWEYER, IF" THE INTERRUPT IS GENERATED, IT MUST GENERATE AN 8259 INTERRUPT AND CLEAR PROPERLV TO PASS THIS TEST. A-66 ROM BIOS E881 EB E6F5 R AT3: CALL SUI SET UP FOR INTERRUPTS E884 FE C3 INC BL BUMP ERROR REPORTER EBBS 4A DEC D. PO J NT TO I NTERRUPT ENABLE REGISTER E887 BO 02 MDV AL,2 ENABLE XMI TTER HOLD I NG REG EMPTY INTR E889 EE OUT OX, AL E8BA EB 00 JMP 5+2 1/0 DELAV E88C 42 INC D. INTR IDENTIFICATION REG EBBD 2B C. SUB ex, ex E8BF EC AT31: IN AL, DX READ IT E890 3C 02 CMP AL,2 XM I HER HOLD I NG REG EMPTY I NTR? E892 74 04 JE AT32 YES EB94 E2 F. LOOP AT31 E896 EB 11 JMP SHORT ATS THE I NTR D I DN 'T OCCUR - TRV NEXT TEST E898 AT32: THE I NTR DID OCCUR E89B EB E706 R CALL C5059 GENERATE 8259 INTERRUPT? E89B 72 OA JC AT5 NO E99D EB E719 R CALL W8250C WA I T FOR THE I NTERRUPT TO CLEAR (IT SHOULD ALREADV BE CLEAR BECAUSE 'I CT' READ THE I NTR 10 REGl ESAO 73 07 JNC ATS IT CLEARED ESA2 E9 E948 R JMP AT13 ERROR EBA5 EB 7E AT4: JMP SHORT AT 11 AVOID OUT OF RANGE JUMPS E8A7 EB 7A 4T5: JMP SHORT AT 10 RECEIVER LINE STATUS INTERRUPT TEST THERE ARE 4 BITS WHICH COULD GENERATE THIS INTERRUPT. EACH ONE IS TESTED INDIVIDUALLY WHEN· AH TESTING OVERRUN PARI TV 8 FRAMING 10H BREAK INTR ~~~~----~~~-----~~----------------;~;~;-~~-;~~~;~~;~-~~~~~~-------- EBA9 4A REGISTER EBAA BO 04 MOV AL,04 ENABLE RECEIVER LINE STATUS INTR ESAC EE OUT OX, AL EBAD B3 C2 04 ADD OX,4 POINT TO LINE STATUS REGISTER EBBO B. 0003 MOV CX,3 INTR 10 REG 'INDEX' ESB3 BD 0004 MOV BP,o4 LOOP COUNTER EBB6 B4 02 MOV AH,2 INITIAL BIT TO BE TESTED EBBB E8 E6F5 R AT7: CALL SUI SET UP FOR INTERRUPTS EBBB FE C3 INC BL BUMP ERROR REPORTER EBBO 53 PUSH B. SAVE IT E88E BB 0601 MOV eX,oaolH INTR TO CHECK, INTR IDENTIFIER E8Cl E8 OAF8 R CALL ICT PERFORM TEST FOR INTERRUPT E8C4 58 POP B. E8C5 24 lE ANO AL,OOOl11lOB MASK OUT BITS THAT DON'T MATTER E8C7 3A C4 CMP AL,AH TEST BIT ON? E8C9 75 SA JNE AT 11 NO EBCe EB E706 R CALL C5059 GENERATE 8259 INTERRUPT? EaCE 72 53 JC ATI0 NO E8DO 83 EA 03 SUB DX,3 INTR 10 REG EBD3 £B E719 R CALL WB250C WA I T FOR THE I NTR TO CLEAR E806 72 70 JC AT 13 IT DIDN'T E808 40 DEC BP ALL FOUR 81 TS TESTED? £809 74 07 JE ATB YES - GO ON TO NEXT TEST E80B DO E4 SHL AH,l GET READV FOR NEXT BI T ESDD 83 C2 03 ADD DX,3 LI NE STATUS REGI STER ESEO E8 06 JMP AT7 TEST NEXT BIT MOOEM STATUS INTERRUPT TEST THERE ARE 4 BITS WHICH COULD GENERATE THIS INTERRUPT. THEY ARE TESTED INDIVIDUALLV WHEN AH TEST I NG DELTA CLEAR TO SEND DELTA DATA SET READV TRAILING EDGE RING INDICATOR DELTA RECEIVE LINE SIGNAL DETECT EBE2 83 C2 04 ATB: ADD OX,o4 MODEM STATUS REGISTER E8E5 EC IN AL, OX CLEAR DELTA BITS THAT MAY BE ON BECAUSE OF 0 I FFERENCES AMONG B250 '5. E8E6 EB 00 JMP $+2 110 DELAV E8E8 83 EA 05 SUB OX,S I NTERRUPT ENABLE REGISTER EBEB 80 08 MOV AL, B ENABLE MODEM STATUS INTERRUPT E8ED EE OUT OX, AL EBEE 93 C2 05 ADD OX,5 POINT TO MODEM STATUS REGISTER ESF 1 89 0004 MOV eX,4 INTR 10 REG 'INDEX' EBF4 BD 0004 MOV BP,4 LOOP COUNTER E8F7 84 01 MOV AH,l INITIAL BIT TO BE TESTED E9F9 E9 ESF'5 R AT9: CALL SUI SET UP FOR INTERRUPTS E8FC FE C3 INC BL BUMP ERROR INDICATOR E8FE 53 PUSH BX SAVE IT E8F'F BB 0001 MOV 8X,OOOlH INTR TO CHECK, INTR IDENTIFIER E902 E8 OAFS R CALL ICT PERFORM TEST FOR INTERRUPT E905 58 POP B. E90S 24 OF AND AL,000011118 MASK OUT BITS THAT OON'T MATTER E908 E90A E90C 3A 75 E8 ,. C. E706 R CMP JNE CALL Al, AH AT 11 C5059 TEST BIT ON? NO GENERATE B259 INTERRUPT? E:90F 72 12 JC ATI0 NO E911 B3 EA 04 SUB DX,4 INTR 10 REG ROM BIOS A-67 E914 £8 E719 R CALL W8250C WAIT FOR I NTERRUPT TO CLEAR E917 72 2F JC AT 13 IT DIDN'T E919 40 DEC, BP E91A 74 OB JE AT 12 ALL FOUR 8 I TS TESTED - GO ON E9lC 00 E4 SHL AH,l GET READ V FOR NEXT BIT E91E B3 C2 04 ADD DX,4 MODEM STATUS REGISTER E921 EB 06 JMP AT9 TEST NEXT BIT POSS I OLE 8259 I NTERRUPT CONTROLLER PROBLEM E923 B3 10 ATIO; MOV 8l, 10H i SET ERROR REPORTER E925 EB 24 ATll; JHP SHORT AT 14 SET 9600 BAUD RATE AND DEFINE DATA WORD AS HAVING B BITS/WORD, 2 STOP BITS, AND ODD PARITY. ~~~;;---;~~-----~~--------------~-~;~~-~~~~~~~-~~~;~~~~------------ E927 42 £92B E8 FOB5 R CAll S8250 SET DATA SET CONTROL WORD TO BE IN LOOP MODE E929 B3 C2 O' ADD OX,4 E92E EC IN Al, OX CURRENT ST ATE E92F EB 00 JMP $+2 I/O DElAV E931 OC 10 OR AL,00010000B SET BIT 4 OF DATA SET CONTROL REG E933 EE OUT OX, AL E934 EO 00 JMP $+2 1/0 DElAV E936 42 INC OX E937 42 INC OX HOD EM STATUS REG E938 EC IN AL, OX CLEAR POSSIBLE HOD EM STATUS INTERRUPT WHICH COULD BE CAUSED BV THE OUTPUT Bl TS BEl NG lOOPED TO THE INPUT BITS E939 EB 00 JMP 5+2 110 DELAY E93B 83 EA OS SUB DX,6 RECE} VER BUFFER E93E EC IN AL, OX DUMMY READ TO CLEAR DATA READY BIT IF IT WENT HIGH ON WRITE TO HCR PERFORM THE lOOP BACK TEST E93F .2 INC OX I NTR ENBl REG E940 BO 00 MOV Al,O SET FOR I NTERNAL WRAP TEST E942 E944 CO 81 •• 00 INT MOV WRAP Cl,O 00 LOOP BACK TRANSMISSION TEST ASSUME NO ERRORS E946 73 05 JNC AT 15 WRAP TEST PASSED E948 80 C3 10 AT13; ADD Bl, 10H ERROR INDICATOR AN ERROR WAS ENCOUNTERED SOMEWHERE OURI NG THE TEST ------------------------------------------------------------------ E948 BIOI ATI4; MOV Cl,l ; SET FAil INDICATOR HOUSEKEEPING: RE-INITIALIZE THE 8250 PORTS , DISABLE THIS DEVICE INTERRUPT, SET UP REGISTER BH IF AN ERROR OCCURRED, AND SET OR RESET THE CARRY FLAG. ~~~~~---;~;-----~~----------------~~~-;~~~-~~~~~~~-~;-;;~~-~~~;~~;- E94D SA E94£ 53 PUSH ax SAVE ERROR CODE E94F EB OAC4 R CALL IB250 RE-INITIALIZE 8250 PORTS E952 58 POP ex E953 2E; 8A 25 MOV AH,CS; [OIl GET DEVICE INTERRUPT MASK E956 20 26 0084 R AND I NTR_FLAG, AH CLEAR DEVICE'S INTERRUPT FLAG BIT E95A 80 F4 FF' XOR AH,OFFH FLIP BITS E95D E4 21 IN AL,INTA01 GET CURRENT I NTERRUPT PORT E95F OA C4 OR Al, AH DISABLE THIS DEVICE INTERRUPT E961 E6 21 OUT INTAOl,AL E963 90 POPF RE-ESTABLISH CALLER'S INTERRUPT FLAG E964 OA C9 OR Cl, Cl ANV ERRORS? E966 74 OC JE AT17 NO E968 B7 24 MOV BH,24H ASSUME MODEM ERROR E96A 90 FE 02 CMP DH,2 OR IS IT SERIAL? E960 715 02 JNE AT16 IT'S MODEM E96F B7 23 MOY SH,23H IT'S SERIAL PRINTER E971 F9 AT 16· sTC SET CARRY FLAG TO I NO I CATE ERROR E972 EB 01 JMP SHORT AT 18 E974 FB AT 17: CLC RESET CARRV FLAG - NO ERRORS E975 58 ATlB; POP AX RESTORE ENTRY ENABLED INTERRUPTS E976 E6 21 OUT I NTA01, AL DEVI CE INTRS RE-ESTABLISHEO £978 IF POP OS RESTORE REGI STER E979 C3 RET E97A UART ENDP E987 ORG OE987H E987 E9 156 1 R JHP NEAR PTR KB_I NT NEC_OUTPUT THI S ROUTI NE SENDS A BVTE TO THE NEC CONTROLLER AFTER TESTI NG FOR CORRECT D I RECTI ON AND CONTROllER READY THIS ROUTINE WILL TIME OUT IF THE BYTE IS NOT ACCEPTED WITHIN A REASONABLE AMOUNT OF TIME, SETTING THE DISKETTE STATUS ON COMPLETION INPUT (AH) 8YTE TO BE OUTPUT OUTPUT CV ::; 0 SUCCESS CV = 1 FAILURE -- DISKETTE STATUS UPDATED . IF A FAILURE HAS OCCURRED, THE RETURN IS MADE ONE LEVEL HI GHER THAN THE CALLER OF NEC OUTPUT THIS REMOVES THE REQUIREMENT OF TESTING AFTER EVERV CALL OF NEC OUTPUT (All DESTROVED - A-68 ROM BIOS E98A NEC_OUTPUT PROC NEAR EBBA 52 PUSH OX SAVE REGISTERS E98B 51 PUSH CX E9SC BA 00F4 MO. OX, NEC_STAT STATUS PORT E98F 33 C9 XOR CX,CX COUNT FOR TI ME OUT E991 EC ..123: IN AL,OX GET STATUS E992 A8 40 TEST AL,DIO TEST DIRECTION BIT E994 74 OC ~z ~25 DIRECTION OK E996 E2 F9 LOOP ~23 E99S ..124: j TIME_ERROR E998 80 DE 0041 R 80 OR DISKETTE_STATUS, TIME_OUT E990 59 POP CX E99E 5A POP OX ; SET ERROR CODE AND RESTORE REGS EB9F 58 POP AX ; 0 I SCARD THE RETURN ADDRESS E9AO F9 STC ; INDICATE ERROR TO CALLER E9Al C3 RET £9A2 33 C9 ..125: XOR CX,CX RESET THE COUNT E9A4 EC ..126: IN AL,OX GET THE STATUS E9A5 AS 80 TEST AL. RQM IS IT READ V? E9A7 75 04 ~NZ ~27 VES, GO OUTPUT E9A9 E2 FB LOOP ~26 COUNT DOWN AND TRV AGAIN E9AB E8 E8 ~MP ~24 ERROR COND I T 1 ON EBAO ..127: OUTPUT E9AD 8A C4 MO. AL,AH GET BYTE TO OUTPUT E9AF 42 INC DX DATA PORT IS 1 GREATER THAN STATUS PORT £9BO EE OUT DX,AL OUTPUT THE BVTE E981 59 POP CX RECOVER REGI STERS E982 5A POP OX E9B3 C3 RET CV = 0 FROM TEST INSTRUCTION E9B4 NEC_OUTPUT ENDP GET_PARM THIS ROUTINE FETCHES THE INDEXED POINTER FROM THE DISK_BASE BLOCK POINTED AT BV THE DATA VAR 1 ABLE 0 15K_PO INTER A BVTE FROM THAT TA8LE IS THEN MOVED INTO AH, THE INDEX OF THAT BYTE BEING THE PARM IN BX ENTRV -- BL = J NDEX OF BVTE TO BE FETCHED 2* IF THE LOW BIT OF BL IS ON, THE BVTE IS IMMEDIATELV OUTPUT TO THE NEC CONTROLLER EXIT -- AH ;::: THAT BVTE FROM BLOCK BX = DESTROVED -------------------------------------------- E9B4 GET_PARM PROC NEAR E9B4 IE PUSH DS SAVE SEGMENT E9B5 56 PUSH 51 SAVE REGISTER E9B6 28 CO sus AX, AX ZERO TO AX EBBB 32 FF XOR 8H,SH ZERO BH EBBA 8E 08 MO. DS,AX ASSUME OS: ABSO E9SC C!5 36 0078 R LOS 51, DISK_POINTER POINT TO BLOCK E9CO 01 EB SHR BX,I DIVIDE BX BV 2, AND SET FLAG FOR EXIT E9C2 9C PUSHF SAVE OUTPUT 81T E9C3 8A 20 MO. AH, [SI+BX) GET THE BVTE E9C5 83 F8 01 CMP eX,l IS THIS THE PARM WITH DMA INDICATOR E9C8 75 05 ~NZ J21_1 E9CA 80 CC 01 OR AH,I TURN ON NO DMA BIT E9CD £8 De ~MP SHORT ..121_2 E9CF 83 FB .A J27_1: CMP 8X,10 MOTOR STARTUP DELAV? £9D2 78 07 ~NE J27_2 E904 80 Fe O. CMP AH,4 GREATER THAN OR EQUAL TO 112 SEC'? E9D7 70 02 ~GE J21_2 YES, OKAY E9D9 84 04 MO. AH,4 NO, FORCE 1/2 SECOND DELAV E9DB 90 J27_2: POPF GET OUTPUT BI T EBDC 5E POP 51 RESTORE REGISTER ESOD IF POP OS RESTORE SEGMENT ASSUME OS: DATA E9DE 7. AA ~C NEC_OUTPUT I F FLAG SET, OUTPUT TO CONTROLLER E9EO C3 RET RETURN TO CALLER EBEI GET_PAR" ENDP BOUND _SETUP THIS ROUTINE SETS UP BUFFER ADDRESSING FOR READ/WRITE/VERIFV OPERAT IONS. INPUT ES HAS ORIGINAL BUFFER SEGMENT VALUE BP POINTS AT BASE" OF SAVED PARMETERS ON STACK OUTPUT ES HAS SEGMENT WHICH WILL ALLOW 64K ACCESS. THE COMBINATION ES:DI AND 05:51 POINT TO THE BUFFER. THIS CALCULATED ADDRESS WILL ALWAYS ACCESS 14K OF MEMORY. BX DESTOVED ROM BIOS A-69 E9El BOUND_SETUP PROC NEAR E9El 51 PUSH CX SAVE REG I STERS E9E2 89 5E DC HOY BX, [BP+12] GET OFFSET OF BUFFER FROM STACK E9E5 53 PUSH BX SAVE OFFSET TEMPORAR I L Y E9E6 81 D4 HOY CL,4 SHIFT COUNT E9EB 03 EB SHR BX, CL SHIFT OFFSET FOR NEW SEGMENT VALUE E9EA 8C Cl HOY CX,ES PUT E5 IN REGISTER SUITABLE FOR ADDING TO E9EC 03 CB ADD ex, BX GET NEW VALUE FOR ES ESEE BE Cl HOY ES, CX UPDATE THE ES REGISTER E9FO 59 POP BX RECOYER ORIGINAL OFFSET E9F 1 B1 f3 OOOF AND eX,OOOOFH NEW OFFSET E9F5 BB F3 HOY SI,BX OS· 51 POINT AT BUFFER ESF7 BB FB HOY 01, ex ES: 01 POINT AT BUFFER E9F9 59 POP CX E9FA C3 RET ESFB BOUND _SETUP ENDP SEEK THIS ROUTINE WILL MOVE THE HEAD ON THE NAMED DRIVE TO TIiE NAMED TRACK. I F THE DR I YE HAS NOT SEEN ACCESSED SINCE THE DRIYE RESET COMMAND WAS ISSUED, THE DRIVE WILL BE RECAL 1 BRATED INPUT (DU DRIYE TO SEEK ON (CH) TRACK TO SEEK TO OUTPUT CY =: 0 SUCCESS CY =: 1 FAILURE -- DISKETTE_STATUS SET ACCORDINGLY (AX) DESTROYED E9FB SEEK PROC NEAR E9FB 56 PUSH 51 SAVE REG I STER ESFC 53 PUSH BX ; SAVE REGISTER E9FD 51 PUSH CX E9FE BE 0074 R MOV S I , OFFSET TRACKO ; BASE OF CURRENT HEAD POSITIONS £AOI BO 01 MOV AL,I ESTABLI SH MASK FOR RECAL EA03 8A CA MOV CL,DL ; USE DRIYE AS A SHIFT COUNT EA05 81 El DOFF AND CX,OFFH i MASK OFF HIGH BYTE £A09 03 F1 ADD 51, CX ; POINT SI AT CORRECT DRIVE EAOS 02 CO ROL AL, CL ; GET MASK FOR DRIVE 51 CONTAI NS OFFSET FOR CORRECT DRIVE, AL CONTAINS BIT MASK IN POSITION 0,1 OR 2 EAOD 59 POP ex RESTORE PARAMETER REGISTER EAOE B9 EA6S R HOY BX, OFFSET J32 SET UP ERROR RECOVERY ADDRESS EAll 53 PUSH BX NEEDED FOR ROUTINE NEC_OUTPUT EA 12 84 06 003E R TEST SEEK STATUS, AL TEST DRIYE FOR RECAL EA16 75 18 "NZ J28 - NO_REeAL EA 18 DB 06 003E R OR SEEK_ST ATUS, AL TURN ON THE NO RECAL BIT I N FLAG EAIC 80 3C 00 CHP BYTE PTR[SI], 0 LAST REFERENCED TRACK=O" EAIF EA21 74 94 12 07 "Z HOY "2B AH,07H YES IGNORE RECAL RECAll BRATE COMMAND EA23 E8 ES8A R CALL NEC OUTPUT EA26 8A E2 HOY AH,DL RECAl REQUIRED ON DRIYE IN DL EA28 E8 E98A R CALL NEC OUTPUT , OUTPUT THE DR I VE NUMBER HEAD IS MOVING TO CORRECT TRACK EA2B EB EA6F R CALL CHK STAT 2 GET THE STATUS OF RECALIBRATE EA2E EA30 72 39 C6 04 00 "C HOY .J32 - 2 - BYTE PTR[Sl], 0 SEEK_ERROR DRIVE 15 IN SYNCH WITH CONTROLLER, SEEK TO TRACK EA33 8A 04 J2B: HOY AL, BYTE PTR[SI] GET THE PCN EA35 2A C5 SUB AL, CH GET SEEK_WAI T VALUE EA37 EA39 74 84 2C OF "Z HOY .J31 1 AH,OFH ALREADY ON CORRECT TRACK SEEK COMMAND TO NEC EA3B EB E98A R CALL NEC OUTPUT EA3E SA E2 HOY AH,DL DR I YE NUMBER EA40 EB E98A R CALL NEC OUTPUT EA43 BA E5 HOY AH,CH TRACK NUMBER EA45 E8 E9BA R CALL NEC OUTPUT EA4B EB EA6F R CALL CHK:STAT_2 GET END I NG I NTERRUPT AND SENSE STATUS WAIT FOR HEAD SETTLE EA4B 9C PUSHF SAVE STATUS FLAGS EA4C 51 PUSH CX SAVE REGISTER EA4D 83 12 MOV BL, 18 HEAD SETTLE PARAMETER EA4F E8 E984 R CALL GET _PARM EA52 J29, HEAD SETTLE EA52 B9 0226 HOY CX,550 1 MS-LOOP EA55 OA EO OR AH,AH TEST FOR T I ME EXP I RED EAS7 74 OS "Z "31 EA59 E2 FE J30; LOOP "30 DELAY FOR I MS EASS FE CC DEC AH DECREMENT THE COUNT EA5D EB F3 "HP "29 DO I T SOME MORE EASF 59 J31: POP CX RESTORE REG I 5TER EA60 90 POPF EA61 EA63 72 06 88 2C "C HOY .J32 2 BYTE PTR[SIJ,CH EA65 59 POP 9X GET RID OF DUMMY RETURN EA66 SEEK ERROR EA66 58 POP BX RESTORE REG I STER EA67 5E POP 51 UPDATE CORRECT EA6S C3 RET ; RETURN TO CALLER EA69 C6 04 FF HOY BYTE PTR[SI J, OFFH ; UNKNOWN STATUS ABOUT SEEK ; OPERATION EA6C 58 POP ax GET RJ D OF DUMMY RETURN EA6D EB F7 "HP SHORT .J32 EA6F SEEK ENOP A-70 ROM BIOS CHK_STAT_2 THIS ROUTINE HANDL.ES THE INTERRUPT RECEIVED AFTER A RECALIBRATE, SEEK, OR RESET TO THE ADAPTER. THE INTERRUPT IS WAITED FOR, THE INTERRUPT STATUS SENSED, AND THE RESULT RETURNED TO THE CALLER. INPUT NONE OUTPUT CY = 0 SUCCESS CY = 1 FAILURE -- ERROR IS IN DISKETTE_STATUS CAX) DESTROYED b~~-;~;~-;------;;~~----~~;;------------------------- EASF EASF 53 - PUSH 8X SAVE REGISTERS EA70 56 PUSH 51 EA71 33 DB XOR BX, ax NUMBER OF SENSE I NTERRVPTS TO ISSUE EA73 BE EASS R MOV SI , OFFSET J33_3 SET UP DUMMY RETURN FROM NEC_OUTPUT EA76 56 PUSH 51 PUT ON STACK EA77 B4 OS HOV AH,08H SENSE 1 NTERUPT STATUS EA79 E8 E98A R CALL NEC_OUTPUT ISSVE SENSE I NTERUPT STATUS EA7C E8 EAAe R CALL RESULTS EA7F 72 10 JC J35 NEC TI ME OUT, FLAGS SET IN RESULTS EAS1 AO 0042 R HOV AL, NEC_STATUS GET STATUS EAS4 A8 20 TEST AL, SEEK_END I S SEEK OR RECAL OPERAT I ON DONE? EAS6 75 00 JNZ J3!s_1 JUMP IF EXECUTION OF SEEK OR RECAL DONE EASB 4B DEC ax DEC LOOP COUNTER EAB9 75 EC JNZ J33_2 ; DO ANOTHER LOOP EA8B SO OE 0041 R BO OR DISKETTE_STATUS, TIME_OUT EA90 F9 J34: STC RETURN ERROR INDICATION FOR ; CALLER EA91 5E J35: POP SI ; RESTORE REGISTERS EA92 5E POP 51 EA93 5B POP BX EA94 C3 RET ; -----SEEK END HAS OCCURED, CHECK FOR NORMAL TERM I NAT I ON EA95 24 CO J3S_1: AND AL, OCOH ; MASK NORMAL TERM I NAT I ON BITS EA97 74 FS JZ J35 ; JUMP I F NORMAL TERM I NAT I ON EA99 80 DE 0041 R 40 OR 01 SKETTE_STATUS, BAD_SEEk EA9E EB FO JMP J34 EAAO CHK_STAT_2 EHDP RESULTS THIS ROUTINE WILL READ ANYTHING THAT THE NEC CONTROLL.ER HAS TO SAY FOLLOWING AN INTERRUPT. IT IS ASSUMED THAT THE NEC DATA PORT:::: NEC STATUS PORT -t 1. INPUT NONE OUTPUT CY :::: 0 SUCCESSFUL TRANSFER CY = 1 FAILURE -- TIME OUT IN WAITING FOR STATUS NEC_STATUS AREA HAS STATUS BVTE LOADED INTO IT «AH) DESTROVED ~;;~~;;-;;~~----~~;;---------------------------- EAAD EAAO FC CLD EAAI BF 0042 R MOV 01, OFFSET NEC_STATUS ; POINTER TO DATA AREA EAA4 51 PUSH CX SAVE COUNTER EAA5 52 PUSH DX EAA6 53 PUSH BX EAA7 B3 07 MOV BL,7 ; MAX STATUS BYTES ; ------ WAIT FOR REQUEST FOR MASTER EAAB J3B: INPUT_LOOP EAA9 33 CB XOR cX,ex COUNTER EAAB BA 00F4 HOV OX, NEe_STAT STATUS PORT EAAE J39: WA I T FOR MASTER EAAE EC IN AL, OX GET STATUS EAAF A8 80 TEST AL,oaOH MASTER READY EABI 75 OC JNZ J40A TEST _D 1 R EAB3 E2 F9 LOOP J39 ; WA IT_MASTER EAB!5 BO OE 0041 R 80 OR DISKETTE_STATUS, TIME_OUT EABA J40: RESULTS_ERROR EABA F9 5TC I S DONE' SET ERROR RETURN ; ------ RESULT OPERAT I ON EABB 5B ..144: POP B)( EABC 5A POP OX EABD 59 POP CX EABE C3 RET ;------ lEST THE DIRECTION BIT EASF EC J40A: IN AL,DX GET STATUS REG AGAI N EACO AB 40 TEST Al, 040H TEST DIRECTION BIT EAC2 75 07 .JNZ ..142 OK TO READ STATUS EAC4 J41: ; NEC_FAIL EAC4 80 OE 0041 R 20 OR DISKETTE_STATUS, BAD_NEe EAC9 EB EF JHP J40 RESULTS_ERROR ; ------ READ I N THE STATUS EACR J42: INPUT_STAT EACB 42 INC OX POINT AT DATA PORT EACC EC IN AL, OX GET THE DATA EACD B. 05 MOV t:on,AL STORE THE SYTE EAeF 47 INC 01 I NCREMENT THE PO INTER EADO 89 OOOA MOV CX,10 LOOP TO KILL TIME FOR NEC EAD3 E2 FE J4J: L.OOP J43 EADS 4. DEC OX POINT AT STAtUS PORT EAD6 EC IN AL, OX GET STATUS EAD7 AB 10 TEST AL,010H TEST FOR NEC STI LL BUSY EAD9 74 EO JZ J44 RESULTS DONE EADS FE C8 DEC BL DECREMENT THE STATUS COUNTER EADD 75 C. JNZ J3. GO BACt( FOR MORE EADF ES E3 JHP J4t CHIP HAS FAIL.ED ROM BIOS A-71 THIS ROUTINE CALCULATES THE NUMBER OF SECTORS THAT WERE ACTUALLY TRANSFERRED TO/FROM THE DISKETTE INPUT (CH) = CYLINDER OF OPERATION (CL) = START SECTOR OF OPERATION OUTPUT (AL) = NUMBER ACTUALLY TRANSFERRED NO OTHER REGISTERS MODIFIED EAEl NUM TRANS PROC NEAR EAE 1 AO 0045 R - MOV AL. NEC STATU5+3 GET CYLI NOER ENDED UP ON EAE4 3A 46 OB CMP AL, [BP+ll1 SAME AS WE STARTEO EAE7 AO 0047 R MOV AL, NEC_STATUS+5 GET END I NG SECTOR EAEA 74 07 JZ J45 IF ON SAME CYL. THEN NO ADJUST EAEC B3 08 MOV Bl,8 EAEE E8 E984 R CALL GET PARM GET EOT VALUE EAFl SA C4 MOV AL. AH INTO AL EAF3 FE CO J45: INC AL USE EOT+l FOR CALCULATION EAFS 2A 46 OA SU8 AL. [BP1+I0 SUBTRACT START FROM END EAFS 88 46 OE MOV [BP+ 141, Al EAFB C3 RET EAFC NUM TRANS ENDP EAFC RESUL TS ENOP D I SABLE THIS ROUTINE WILL DISABLE ALL INTERRUPTS EXCEPT FOR INTERRUPT 6 SO WATCH DOG TIME OUT CAN OCCUR IN ERROR COND IT IONS. INPUT NONE OUTPUT NONE ALL REGISTERS REMAIN INTACT EAFC 01 SABLE PROC NEAR EAFC 50 PUSH AX D I SABLE ALL I NTERRUPTS AT THE B253 LEVEL EXCEPT DISKETTE EAFD E4 21 IN AL,lNTAOl READ CURRENT MASK EAFF 89 46 10 MOV [BP+lS], AX SAVE MASK ON THE SPACE ALLOCATED ON THE STACK E802 80 8F MOV AL,OBFH MASK OFF ALL I NTERRUPTS EXCEPT DISKETTE EB04 E6 21 OUT INTA01.AL OUTPUT MASK TO THE 8259 EB06 £B E9El R CALL BOUND SETUP SETUP REGI STERS TO ACCESS BUFFER EB09 58 POP AX- EBOA C3 RET E90B D I SABLE END P ENABLE THIS PROC ENABLES ALL INTERRUPTS. IT ALSO SETS THE 8253 TO THE MODE REQUIRED FOR KEYBOARD DATA DESERIALtZATtON. BEFORE THE LATCH FOR KEYBOARD DATA 15 RESET. BIT 0 OF THE 8255 I S READ TO DETERHI NE WHETHER ANV KEVSTROKES OCCURED WHI LE THE SYSTEM WAS MASKED OFF INPUT NONE OUTPUT AL=l MEANS A KEY WAS STRUCK DURING DISKETTE I/O. (OR NOISE ON THE LINE) AL=O MEANS THAT NO KEV WAS PRESSED. AX IS DESTROYED. ALL OTHER REGISTERS REMAIN INTACT. ~~~;~;----------;~~~----~~~;---------------------- EeOB E808 52 PUSH OX i SAVE OX RETURN TIHERl TO STATE NEEDED FOR KEYBOARD t /0 E80C BO 76 HOV AL , Oll10110B EBOE E6 43 OUT Tt M_eTL, AL EBI0 50 PUSH AX EBll 58 POP AX WAIT FOR 8253 TO INITIALIZE I T5ELF £B12 80 FF HOV AL.OFFH INITIAL VALUE FOR 8253 EB14 E6 41 OUT TlMER+l, AL LSB EB16 50 PUSH AX EB17 58 POP AX WAIT EB18 E6 41 OUT TI MER+ 1, AL • M5B CHECK I F ANY KEVSTROKES OCCURED DURING DISKETTE TRANSFER EelA BE 46 10 MOV E5. [BP+161 GET OR I G I NAL ES VALUE FROM THE STACK EBID E4 62 IN AL,62H READ PORT C OF 8255 EIUF 24 01 AND AL. 0 lH BIT=l MEANS KESTROKE HAS OCCUR ED EB21 50 PUSH AX SAVE I T ON THE STACK ENABLE NM I INTERRUPTS EB22 E4 AO IN AL, NMI_PORT RESET LATCH E824 BO 80 MOV AL. BOH MASK TO ENABLE NMI E826 E6 AO OUT NM J _PORT, AL ; ENABLE NM I ENABLE ALL INTERRUPTS WHICH WERE ENABLED BEFORE TRANSFER EB28 BB 46 10 MOV AX, [BP+161 GET MASK FROM THE STACK EB28 E6 21 OUT INTAOl, AL EB2D 58 POP AX ; PASS BACK KEY STROKE FLAG EB2E SA POP OX EB2F F8 STI E930 C3 RET EB31 ENABLE ENDP A-72 ROM BIOS ; ~~~~;~~;;;-------------------------------------- THIS PROCEDURE IS CALLED WHEN THE TIME OF DAV IS BEING UPDATED. IT WAlTS IF TIMERO IS ALMOST READV TO WRAP UNTI L IT I S SAFE TO READ AN ACCURATE TI MERl ; INPUT ~ OUTPUT NONE NONE. AX IS DESTROVED. E831 CLOCK_WAIT PROC NEAR E831 32 CO XOR AL, AL READ MODE TIMERO FOR 8253 EBJ3 E6 43 OUT TIM_CTL, AL OUTPUT TO THE 8253 EB35 50 PUSH AX EB36 58 POP AX WAlT FOR 8253 TO INITIALIZE ITSELF E837 E4 40 IN AL, TI MERO READ LEAST SIGNIFICANT BVTE EB39 86 C4 XCHG AL, AH SAVE IT EB38 E4 40 IN AL, T1 HERO READ HOST SIGNIFICANT BVTE EBJD 8S C4 XCHG AL. AH REARRANGE FOR PROPER ORDER EB3F 3D 012C CHP AX, THRESHOLD IS TI MERO CLOSE TO WRAPPI NG? EB42 72 ED Je CLOCK_WAIT JUMP IF CLOCK IS WITHIN THRESHOLD EB44 C3 RET OK TO READ TIMERl E845 CLOCK_WAIT ENDP ------------------------------------------------------------------ i GET_DRIVE THIS ROUTINE WILL CALCULATE A BIT MASK FOR THE DRIVE WHICH IS SELECTED BV THE CURRENT I NT 13 CALL. THE DR I VE SELECTED CORRESPONDS TO THE BIT IN THE MASK, I.E. DRIVE ZERO CORRESPONDS TO BIT ZERO AND A 01H IS RETURNED. THE 8IT IS CALCULATED BV ACCESSING THE PARAMETERS PASSED TO INT 13 WHI CH WERE SAVED ON THE STACK. ; INPUT ~OUPTUT BVTE PTR[BP] MUST POINT TO DRIVE FOR SELECTION AL CONTAINS THE BIT MASK. ALL OTHER REGISTERS ARE INTACT E845 GET_DRIVE PROC NEAR E845 51 PUSH ex SAVE REGI STER. E846 8A 4E 00 MOV eL, BVTE PTR[BPJ GET OR 1 VE NUMBER E849 BO 01 MOV AL,l INITIALIZE AL WITH VALUE FOR SHIFTI NG EB48 02 EO SHL AL, CL SHIFT BIT POSITION BV DRIVE NUMBER (DRIVE IN RANGE 0-2) EB4D 24 07 AND AL,07H ONLY THREE DRIVES ARE SUPPORTED RANGE CHECK EB4F 5. POP ex RESTORE REGI STERS EB50 C3 RET EB51 GET_DRIVE ENDP THIS ROUTINE CHECKS OPTIONAL ROM MODULES (CHECKSUM ; FOR MODULES FROM COOOO-)DOOOO, CRe CHECK FOR CARTRIDGES ; (00000- )FOOOO) ; IF CHECK 15 OK, CALLS INIT/TEST CODE IN MODULE MFG ERROR CODE= 25XX (XX=MSB OF SEGMENT IN ERROR) k~~-~~~~~-------;;~~----~~;;----------------------- E851 E851 2B F6 - SUB 51,51 SET SI TO POINT TO BEGINNING (REL TO OS) E953 2A CO SU8 AL, AL ZERO OUT AL EB55 8A 67 02 MOV AH, [8X+2] GET LENGTH I NO I CATOR E85B OlEO SHL AX,l FORM COUNT EeSA 50 PUSH AX SAVE COUNT E8SB 81 FA 0000 CHP OX,ODOOOH SEE IF POINTER IS BELOW 0000 E85F 9C PUSHF SAVE RESULTS EB60 81 04 MOV CL,4 ADJUST £862 03 EB SHR AX, CL E864 03 DO .00 OX, AX SET PO I NTER TO NEXT MODULE E966 90 POPF RECOVER FLAGS FROM POINTER RANGE CHECK E867 59 POP RECOVER COUNT IN CX REGI STER EB68 52 PUSH SAVE POINTER EB69 7C 07 JL DO ARI THMETI C CHECKSUM I F BELOW 00000 EBSB £8 FE71 R CALL CRC_CHECK DO CRe CHECK ES6E 74 28 JZ ROM_CHECK_l PROCEED I F OK EB70 E8 OS JHP SHORT ROM 2 ELSE POST ERROR E872 £8 FEEB R CALL ROS CHECKSUM DO ARI THMETI C CHECKSUM E875 74 24 JZ ROM-CHECK 1 PROCEED 1 F OK E877 BA 1626 MOV OX,1626H - POSITION CURSOR, ROW 22, COL 39 fB7A 94 02 MOV AH,2 EB7C B7 07 MOV BH,7 £87E CD 10 INT 10H EB80 BC DA MOV OX, OS RECOVER DATA SEG EBS2 8A C6 MOV AL,DH EB84 EB 18.0.9 R CALL XPC BVTE DISPLAY MSB OF DATA SEG EB87 SA DE MOV BL, DH FORM XX VALUE OF ERROR CODE EBSS 97 25 MOV BH,25H FORM 25 PORTION EBBB 80 FE DO CHP DH,ODOH , IN CARTRIDGE SPACE? EBSE 8E 0038 R MOV 51 , OFFSET CART_ERR E891 70 03 JGE ROM_CHECK_O , E893 BE 003A R MOV 51, OFFSET ROM_ERR E996 ROM CHECK o· E996 EB 09BC R - CALL E_MSG ; GO ERROR ROUT I NE E899 EB 16 JMP SHORT ROM_CHECK_END ; AND EXIT E99B ROM_CHECK_I: E89B Be ---- R MOV AX, XXDATA ; SET ES TO POINT TO XXDATA AREA EB9E 8E CO MOV ES, AX ; E8AO 26: C7 06 0014 R 0003 MOV ES: I O_ROM_INI T, 0003H ; LOAD OFFSET EBA7 26, ac IE 0016 R MOV ES: 10_ROM_SEG, OS ; LOAD SEGMENT EBAC 26, FF IE 0014 R CALL DWORD PTR ES: I O_ROM_INlT ; CALL INtT. /TEST ROUTINE ROM BIOS A-73 EBBl ROM CHECK END EBB 1 5A - POP OX ; RECOVER POINTER EBB2 C3 RET ; RETURN TO CALLER EBB3 ROM CHECK ENDP i - - -INT 13 -------------------------------------------------------- DISKETTE I/O THIS INTERFACE PROVIDES ACCESS TO THE 5 1/4" DISKETTE DRIVES INPUT (AH)=O RESET DISKETTE SYSTEM HARD RESET TO NEe, PREPARE COMMAND, RECAL REQO ON ALL DRIVES (AH)=l READ THE STATUS OF THE SYSTEM INTO (AL) DISKETTE_STATUS FROM LAST OP'N IS USED REGI STERS FOR READ/WRI TE/VERI FY /FORMAT (DLl - DRI \IE NUMBER (0-3 ALLOWED, VALUE CHECKED) COH) - HEAD NUMBER (0-1 ALLOWED, NOT VALUE CHECKED) (CHI - TRACK NUMBER (0-39, NOT VALUE CHECKED) (CLl - SECTOR NUMBER (1-8, NOT VALUE CHECKED, NOT USED FOR FORMAT) CAL) - NUMBER OF SECTORS ( MAX = B, NOT VALUE CHECKED, NOT USED FOR FORMAT, HOWEVER, CANNOT BE ZERO!!!) (ES:BX) - ADDRESS OF BUFFER ( NOT REQUIRED FOR VERIFY> (AH);;;2 READ THE DESIRED SECTORS INTO MEMORY (AHI;;;3 WRITE THE DESIRED SECTORS FROM MEMORY (AH1=4 VERIFY THE DESIRED SECTORS (AH)=5 FORMAT THE DESIRED TRACK FOR THE FORMAT OPERATION, THE BUFFER POINTER (ES,BX) MUST POINT TO THE COLLECTION OF DESIRED ADDRESS FIELDS FOR THE TRACK. EACH FIELD IS COMPOSED OF 4 BYTES, (C,H,R,Nl, WHERE C = TRACK NUMBER, H=HEAD NUMBER, R = SECTOR NUMBER, N= NUMBER OF BYTES PER SECTOR (00= 12B, 01=256, 02=512, 03=1024,). THERE MUST BE ONE ENTRY FOR EVERY SECTOR ON THE TRACK. THIS INFORMATION IS USED TO FIND THE REQUESTED SECTOR DURING READ/WRITE ACCESS. DATA VARIABLE -- DISK_POINTER DOUBLE WORD POINTER TO THE CURRENT SET OF DISKETTE PARAMETERS OUTPUT AH = STATUS OF OPERATION STATUS BITS ARE DEFINED IN THE EQUATES FOR DISKETTE STATUS VARIABLE IN THE DATA SEGMENT OF THIS MODULE CY = 0 SUCCESSFUL OPERATION (AH=O ON RETURN> CY = 1 FAILED OPERATION (AH HAS ERROR REASON) FOR READ/WRITE/VERIFY DS, BX, OX, CH, CL PRESERVED AL ;;; NUMBER OF SECTORS ACTUALLY READ *It** AL MAY NOT BE CORRECT [F TI ME OUT ERROR OCCURS NOTE: I F AN ERROR I S REPORTED BY THE 0 ISKETTE CODE, THE APPROPRIATE ACTION IS TO RESET THE DISKETTE, THEN RETRY THE OPERATION. ON READ ACCESSES, NO MOTOR START DELAY IS TAKEN, SO THAT THREE RETRIES ARE REQUIRED ON READS TO ENSURE THAT THE PROBLEM IS NOT DUE TO MOTOR START-UP ASSUME CS: CODE, 05: DATA, ES: DATA EC59 ORG OEC59H EC59 DISKETTE 10 PROC FAR EC59 FB STI I NTERRUPTS BACK ON ECSA 06 PUSH ES SAVE ES EC5B 50 PUSH AX ALLOCATE ONE WORD OF STORAGE FOR TIMER1 INITIAL VALUE EC5C 50 PUSH AX ALLOCATE ONE WORD ON STACK FOR USE IN PROCS ENABLE AND 0 I SABLE. WI LL HOLD B259 MASK. ECSD 50 PUSH AX SAVE COMMAND AND N_SECTORS EC5E 53 PUSH BX SAVE ADDRESS ECSF 51 PUSH ex EC60 lE PUSH os SAVE SEGMENT REG I STER VALUE EC61 56 PUSH 51 SAVE ALL REGISTERS DURING OPERATI ON £C62 57 PUSH 01 EC63 55 PUSH BP EC64 52 PUSH OX EC65 BB EC MOV BP, SP SET UP PO 1 NTER TO HEAD PARM EC67 E8 1388 CALL DDS SET DS=DATA ECSA E8 EC90 CALL JI CALL THE REST TO ENSURE OS RESTORED £C60 B3 04 MOV BL,4 GET THE MOTOR WAIT PARAMETER EC6F EB E984 R CALL GET PARM EC72 88 26 0040 R MOV MOTOR_COUNT, AH ; SET THE TI MER COUNT FOR THE MOTOR Ee76 8A 26 0041 R MOV AH, DISKETTE_STATUS GET STATUS OF OPERAT ION EC7A B8 66 OF MOV [BP+15J, AH ; RETURN STATUS IN AL EC7D 5A POP OX RESTORE ALL REGISTERS EC7E 50 POP BP EC7F 5F POP 01 ECBO 5E POP 51 EC81 IF POP OS EC82 59 POP CX ECB3 58 POP BX RECOVER OFFSET EC84 58 POP AX ECBS 83 C4 04 ADD SP,4 DISCARD DUMMY SPACE FOR B259 MASK ECa8 07 POP ES RECOVER SEGMENT ECag 80 Fe 01 CMP AH,l SET THE CARRV FLAG TO I ND 1 CATE EC8C F5 CMC SUCCESS OR FAt LURE EcaD CA 0002 RET THROW AWAY SAVED FLAGS A-74 ROM BIOS EC90 DISKETTE 10 ENDP EC90 Jl PROC NEAR EC90 BA FO NOV DH, AL ; SAVE. SECTORS IN DH EC92 BO 26 003F R 7F AND MOTOR_STATUS,07FH i INDICATE A READ OPERATION EC97 OA E4 OR AH, AH AH=O EC99 74 .7 JZ DISK_RESET EC9B FE CC DEC AH ; AH=l EC9D 7. 74 JZ 01 SK_ST ATUS EC9F C6 06 0041 R 00 NOV DISKETTE_STATUS,O ; RESET THE STATUS INDICATOR ECA4 BO FA 02 CMP DL,2 TEST FOR DRIVE IN 0-2 RANGE ECA7 77 13 JA J3 ERROR I F ABOVE ECA9 FE CC DEC AH AH=2 ECAB 74 60 JZ DISK READ ECAD FE CC DEC AH - AH=3 ECAF 75 03 JNZ J2 TEST_DISK_VERF ECB1 E9 ED 3D R JMP DISK_WRITE ECB4 J2: TEST_DI SK_VERF ECB4 FE CC DEC AH AH=4 ECBS 74 62 JZ 01 SK_VERF ECBa FE CC DEC AH AH=5 ECBA 74 62 JZ DISK_FORMAT ECBC J3: ; BAD_COMMAND ECBC C6 06 0041 R 01 MOV DJ SKETTE_STATUS, BAD_CHO ; ERROR CODE, NO SECTORS ; TRANSFERRED EeCl C3 RET ; UNDEFINED OPERATION ECC2 J1 ENOP ; ------ RESET THE 0 I SKETTE SYSTEM ECC2 DISK_RESET PROC NEAR ECC2 SA 00F2 MOV OX, NEC_CTL ADAPTER CONTROL PORT ECC5 FA CLl NO INTERRUPTS ECC6 AD D03F R MOV Al, MOTOR_STATUS FIND OUT I F MOTOR IS RUNNI NG Ece9 24 07 AND AL,07H DRIVE BITS Ecca EE OUT DX, AL RESET THE ADAPTER ECCC C6 06 003E R 00 MOV SEEK_STATUS, 0 ; SET RECAL REQUIRED ON ALL DRIVES ECD1 C6 06 0041 R 00 MOV DISKETTE_STATUS,O ; SET OK STATUS FOR DISKETTE ECDS OC 80 OR AL, FDC_RESET TURN OFF RESET ECDS EE OUT DX, AL TURN OFF THE RESET ECD9 FB 5TJ REENABLE THE INTERRUPTS ECDA BE ECFA R MOV DUMMY RETURN FOR ECOD 56 PUSH PUSH RETURN I F ERROR IN NEC_OUTPUT ECDE B9 0010 MOV eX,lOH NUMBER OF SENSE I NTERRUPTS TO ISSUE ECE1 B4 08 COMMAND FOR SENSE INTERRUPT STATUS ECE3 E8 E98A R OUTPUT THE SENSE INTERRUPT STATUS ECEG E8 EAAO R CALL RESUL TS GET STATUS FOLLOW I NG COMPLET I ON OF RESET ECE9 AD 0042 R MOV AL, NEC_STATUS IGNORE ERROR RETURN AND DO OWN TEST ECEC 3C CO CMP AL,OCOH TEST FOR DRIVE READY TRANSITION ECEE 7. 12 JZ .J7 EVERYTH 1 NG OK ECFO E. EF LOOP .J4_0 ; RETRY THE COMMAND ECF2 BO DE 0041 R 20 J4_1: OR DISKETTE_STATUS,BAD_NEC i SET ERROR CODE ECF7 SE POP 51 EeF8 EB 18 JMP SHORT .JB ECFA BE ECFA R J4_2: MOV NEC_OUTPUT FAI LED, RETRV THE SENSE INTERRUPT [CFD 56 PUSH 51 OFFSET OF BAD RETURN t N NEC OUTPUT ECFE E2 E1 LOOP .J4_0 RETRY EDOO EB FO JMP SHORT J4_1 SEND SPEC I FY COMMAND TO NEC ED02 SE ~7: POP 51 GET RID OF DUMMY ARGUMENT ED03 B4 03 MOV AH,03H SPEC I FY COMMAND E005 E8 E98A R CALL NEC OUTPUT OUTPUT THE COMMAND E008 93 01 MOV BL, l' STEP RATE TIME AND HEAD UNLOAD EDOA E8 E9B4 R CALL GET_PARM OUTPUT TO THE NEC CONTROLLER EDOD B3 03 MOV BL.3 PARM 1 HEAD LOAD AND NO DMA EDOF EB E9B4 R CALL GET_PARM TO THE NEC CONTROLLER E012 J8: RESET_RET ED12 C3 RET RETURN TO CALLER E013 DISK_RESET ENDP ;------ DISKETTE STATUS ROUTINE ED13 01 SK_ST AlUS PRoe NEAR E013 AD 0041 R MOV AL, 0 I SKETTE_STATUS ED16 a8 46 DE MOV BYTE PTR[BP+141. AL i PUT STATUS ON STACK, IT WILL ; POP IN AL ED 19 C3 RET EDIA DISK_STATUS ENOP ; ------ DISKETTE YER I FY ED 1A 01 SK_VERF LABEL NEAR ; ------ 0 I SKETTE READ EDIA DISK_READ PROC NEAR EDIA J9: DISK READ CONT ED lA 94 46 MOV AH,046H SET UP READ COMMAND FOR NEC CONTROLLER EDIC EB 26 JMP SHORT RW OPN GO DO THE OPERATJON ED IE DISK_READ ENDP- ; ------ DISKETTE FORMAT EDIE DISK_FORMAT PROC NEAR EDIE 80 DE DoaF R 80 OR MOTOR_STATUS,80H j INDICATE A WRITE OPERATION ED23 B4 40 MOV AH.04DH ; ESTABLI SH THE FORMAT COMMAND E025 EB 10 .JMP SHORT RW_OPN ; 00 THE OPERATION ROM BIOS A-75 ED27 JI0: CONTI NUATI ON OF RW_OPN FOR FMT ED27 83 07 MaY BL,7 GET THE ED29 E8 E984 R CAll GET PARM BVTES/SECTOR VALUE TO NEC ED2C 83 09 MOY eL, i GET THE ED2E E8 E984 R CALL GET _PARM SECTORS/TRACK VALUE TO NEC ED31 83 OF MOV Bl, 15 GET THE ED33 E8 E984 R CAll GET_PARM GAP LENGTH VALUE TO NEC ED36 BB 0011 MOV BX,17 GET THE FI LLER BVTE ED39 53 PUSH ax SAVE PARAMETER INDEX ON STACK ED3A E9 EDCD R JMP JIG TO THE CONTROLLER ED3D DISK_FORMAT ENDP j - - - - - - DISKETTE WRITE ROUTI NE ED 3D DISK_WRITE PROC NEAR ED3D 80 OE 003F R 80 OR MOTOR_STATUS, BaH; INDICATE A WRITE OPERATION ED42 84 45 MOY AH,045H i NEC COMMAND TO WRITE TO DISKETTE ED44 DISK_WRITE ENOP ; ----- ALLOW WRITE ROUTINE TO FALL INTO RW_OPN ~ -~~:~;~-------------------------------- THIS ROUTINE PERFORMS THE READ/WRITE/VERIFV OPERATION ; --------------------------------------- ED44 RW OPN PROC NEAR ED44 50 - PUSH AX ; SAVE THE COMMAND ; ------ TURN ON THE MOTOR AND SELECT THE DRI VE ED45 51 PUSH CX ; SAVE THE T /S PARMS ED46 FA CLI ; NO INTERRUPTS WHILE DETERMINING ; MOTOR STATUS ED47 C6 06 0040 R FF HOY MOTOR_COUNT,OFFH i SET LARGE COUNT DURING OPERATION ED4C E8 EB45 R CALL GET_DRIVE ; GET THE DRIVE PARAMETER FROM THE ; STACK ED4F 84 06 003F R TEST MOTOR_STATUS, AL ; TEST MOTOR FOR OPERATING ED53 75 IF JNZ J14 ; IF RUNNING, SKIP THE WAIT EDS5 80 26 003F R FO AND MDTOR_STATUS,OFOH i TURN OFF RUNNING DRIVE EDSA 08 06 003F R OR MOTOR_STATUS, AL ; TURN ON THE CURRENT MOTOR ED5E FB STI ; I NTERRUPTS BACK ON ED5F OC 80 OR AL, FOC_RESET ; NO RESET. TURN ON MOTOR ED61 E6 F2 OUT NEC_CTl, AL ; ------ WAIT FOR MOTOR BOTH READ AND WRITE £063 83 14 MOV BL, 20 GET MOTOR START TIME ED65 E8 E9B4 R CALL GET _PARM EDS8 OA E4 OR AH, AH TEST FOR NO WAIT EDGA J12: TEST WAIT TI ME EDSA 74 DB JZ Jl. EXIT-WITH-TIME EXPIRED ED6C 28 C9 SUB CX,CX SET UP 1/8 SECOND LOOP TIME EDSE E2 FE J13: lOOP J13 WAIT FOR THE REQUIRED TIME E070 FE CC DEC AH DECREMENT TI ME YALUE ED72 EB FG JMP J12 ARE WE DONE VET ED74 J14: MOTOR RUNNING ED74 FB STI I NTERRUPTS BACK ON FOR BYPASS WAIT ED7!5 59 POP CX ;------ DO THE SEEK OPERATION E076 E8 E9FB R CALL SEEK MOVE TO CORRECT TRACK ED79 5B POP AX RECOVER COMMAND ED7A SA FC MaY BH, AH SAVE COMMAND IN BH EDJC 86 00 MOY DH. a SET NO SECTORS READ I N CASE OF ERROR ED7E 73 03 JNC I F NO ERROR CONTI NUE, JUMP AROUND JHP ED80 E9 EE07 JMP J17 CARRY SET JUMP TO MOTOR WA IT ED83 8E EED7 HOY SI,OFFSET J17 DUMMY RETURN ON STACK FOR NEC_OUTPUT E086 56 PUSH 51 SO THAT I T WILL RETURN TO MOTOR ; OFF LOCATION i - - - - - - SEND OUT THE PARAMETERS TO THE CONTROLLER ED87 EB E98A R CALL NEC_OUTPUT OUTPUT THE OPERATION COMMAND ED8A 8A 6& 01 MOV AH, [BP+ 11 GET THE CURRENT HEAD NUMBER EDaD DO E4 SAL AH,I MOVE IT TO BIT 2 EoaF DO E4 SAL AH.l ED91 SO E4 04 AND AH,4 I SOlATE THAT BIT ED94 OA E2 OR AH, DL OR IN THE DRIYE NUMBER E096 E8 ES8A R CALL NEC_OUTPUT ; ------ TEST FOR FORMAT COMMAND ED99 80 FF .0 eMP BH,04DH IS THI S A FORMAT OPERATI ON? ED9C 75 02 JNE J15 NO. CONTINUE WITH R/W/V ED9E E8 87 JMP JI0 IF SO, HANDLE SPECIAL EOAO 8A E6 J15: HOY AH, CH CYlI NOER NUMBER EDA2 EB E98A R CALL NEC_OUTPUT ED AS 8A 68 01 HOY AH, [BP+11 HEAD NUMBER FROM STACK EDAB EB E98A R CALL NEC_OUTPUT EDAB 8A El MOV AH, CL SECTOR NUMBER ED AD £8 ESBA R CALL NEC_OUTPUT EDBO 83 07 MOY Bl,7 BYTES/SECTOR PARM FROM BLOCK EDB2 EB E9B4 R CALL GET _PARM TO THE NEC EDB5 B3 DB MOY Bl, B EDT PARM FROM BLOCK EDB7 EB E984 R CALL GET PARM RETURNED IN AH EDBA 02 4E DE ADD CL. [BP+141 ADD CURRENT SECTOR TO NUMBER IN TRANSFER EDBD FE C9 DEC CC CURRENT SECTOR + N SECTORS - 1 E08F 8A El HOY AH, CL EDT PARAMETER IS THE CALCULATED ONE EDCl Ea E9BA R CALL NEe OUTPUT EDC4 83 OB HOY BL,11 GAP LENGTH PARM FROM BLOCK EDC6 EB E9B4 R CALL GET PARM TO THE NEC EDC9 98 0000 HOY 8X,13 DTL PARM FRO" BLOCK EDCC .3 PUSH BX SAVE I NDEX TO DISK PARAMETER ON STACK A-76 ROM BIOS ED CD FC J16: CLO ; FORWARD DIRECTION ; ------ START TIMER1 WITH INITIAL VALUE OF FFFF EDCE 80 70 HOY AL,01110000B SELECT TIMER1,LS8-MSB, MODE 0, BI NARY COUNTER EDDO E6 43 OUT INITIALIZE THE COUNTER EDD2 50 PUSH EDD3 58 POP ALLOW ENOUGH T I ME FOR THE 8253 TO I N IT I ALI ZE ITSELF EDD4 80 FF MOV AL,OFFH I NITI AL COUNT VALUE FOR THE 8253 EDD6 E6 41 OUT TI MER+ I, AL OUTPUT LEAST SIGNIFICANT BVTE EDDB 50 PUSH AX EDD9 58 POP AX WAIT EODA E6 41 OUT TIMER+l, AL ; OUTPUT MOST SIGNIFACNT BVTE ; ------INITIALIZE CX FOR JUMP AFTER LAST PARAMETER IS PASSED TO NEC EDDC 8A 46 OF MOV AL, [BP+151 ; RETRI EVE COMMAND PARAMETER EDOF A801 TEST AL, 01H ; IS THIS AN ODD NUMBERED FUNCTI ON? EOE1 74 05 JZ J 16_1 i JUMP I F NOT ODD NUMBERED EDE3 89 EE4E R MOV CX, OFFSET WRITE_LOOP EDE6 EB DC .JMP SHORT J 16_3 EDE8 3C 02 J16_1: CMP AL,2 ; IS THIS A READ? EDEA 75 05 JNZ J16_2 ; JUMP IF VERIFY EDEC 89 EE3A R MOY ex, OFFSET READ_LOOP EOEF EB 03 JMP SHORT J 16 3 EDF1 B9 EE20 R J16_2: MOV CX,OFFSET-VERIFY_LOOP ; ------FlNISH INITIALIZATION EDF4 J16_3: ~ ;;;~~~~;;;------------------------------------------------------- ; ALL I NTERRUPTS ARE ABOUT TO BE 0 I SABLED. THERE I S A POTENTI AL THAT THIS TIME PERIOD WILL BE LONG ENOUGH TO MISS TIME OF DAY INTERRUPTS. FOR THIS REASON, TIMERI WILL BE USED TO KEEP TRACK OF THE NUMBER OF TIME OF DAY INTERRUPTS WHICH WILL BE MISSED. THIS INFORMATION IS USED AFTER THE DISKETTE OPERATION TO UPDATE THE 11 ME OF DAY. EDF4 80 10 HOY AL,10H DISABLE NMI EDF6 E6 AD OUT NM I _PORT, AL i NO KEVBOARD INTERRUPT EDFS E8 EB31 R CALL CLOCK_WAIT ; WAIT IF TlMERO IS ABOUT TO i INTERRUPT ; ------ ENABLE WATCHDOG TIMER ;;;;~~~~;;;-----------------------------------------------------­ GIVEN THE CURRENT SYSTEM CONFIGURATION A METHOD IS NEEDED TO PULL THE NEC OUT OF "FATAL ERROR" SITUATIONS. A TIMER ON THE ADAPTER CARD IS PROVIDED WHICH WILL PERFORM THIS FUNCTION. THE WATCHDOG TIMER ON THE ADAPTER CARD IS ENABLED AND STROBED BEFORE THE 8259 INTERRUPT 6 LI HE I S ENABLED. THIS IS BECAUSE OF A GLITCH ON THE LINE LARGE ENOUGH TO TRIGGER AN INTERRUPT. EDFB EB EB45 R CALL GET_DRIVE ; GET BIT MASI< FOR DRIVE EDFE BA 00F2 MOV ox, NEC_CTL i ceNTROL PORT TO NEC EE01 OC EO OR AL, FDC_RESET+WD_ENABLE+WD_STROBE EE03 EE OUT ox, AL ; OUTPUT CONTROL INFO FOR ; WATCHDOG(WD) ENABLE EE04 24 A7 AND AL, FDC_RESET+WD_ENABLE+7H £E06 EE OUT OX, AL OUTPUT CONTROL INFO TO STROBE WATCHDOG EE07 BA 00F4 MOV OX, NEC_STAT PORT TO NEC STATUS EEOA BO 20 MOV AL, 20H SELECT TI MER 1 I NPUT FROM T I MERO OUTPUT EEOC E6 AO OUT NMI_PORT, AL ; ------ READ TIMERl NOW AND SAVE THE INITIAL VALUE ££0£ £8 £81A R CALL READ_TIME ; GET TIMERI VALUE EEll B9 46 12 MaY [BP+IB1, AX ; SAVE INITIAL VALUE FOR CLOCK i UPDATE IN TEMPORAV STORAGE E£14 E8 EAFC R CALL 0 I SABLE ; DISABLE ALL INTERRUPTS ; ------ NEC BEGINS OPERATION WHEN NEe RECEIVES LAST PARAMETER EE17 58 POP BX GET PARAMTER FROM STACK EEIB E8 E9B4 R CALL GET _PARM OUTPUT LAST PARAMETER TO THE NEC EEIB 58 POP AX CAN NOW DISCARD THAT DUMMV RETURN ADDRESS EEIC 06 PUSH ES EEID 1F POP DS INITIALIZE OS FOR WRITE EEIE FF El JHP CX JUMP TO APPROPRIATE R/W/V LOOP ~ ;;;~~;;;;;-------------------------------------------------------- DATA IS TRANSFERRED USING POLLING ALGORITHMS. THESE LOOPS TRANSFER A DATA BYTE AT A TIME WHILE POl..LING THE NEC FOR NEXT DATA BVTE AND COMPLETION STATUS. ; :::::~;;;;;-~;;;~~;~~--------------------------------------------- E£20 VERIFY_LOOP: EE20 EC IN AL, ox READ STATUS EE21 AS 20 TEST AL,BUSY_BIT HAS NEC ENTERED EXECUTION PHASE YET? £E23 74 Fa JZ VERIFY_LOOP NO, CONTINUE SAMPLING EE25 EE25 A8 80 TEST AL, RQH IS DATA READY? EE27 75 07 JNZ J22 4 JUMP IF DATA TRANSFER IS READY E£29 EC IN AL,DX READ STATUS PORT EE2A AB 20 TEST AL, BUSY_BI T ARE WE DONE? EE2C 75 F7 JNZ J22_2 JUMP I F MORE TRANSFERS EE2E EB 35 JHP SHORT OP _END TRANSFER DONE E£30 42 INC DX POINT AT NEe DATA REGISTER EE31 EC IN AL, OX READ DATA EE32 4A DEC DX POINT AT NEe STATUS REGISTER E£33 EC IN AL,DX READ STATUS PORT EE34 AS 2Q TEST AL, BUSY_BIT ARE WE DONE? ££36 75 EO JNZ J22_2 CONTINUE EE38 EB 28 JHP SHORT OP_END WE ARE DONE ROM BIOS A-77 ; -----REAO OPERATION EE3A READ_LOOP: EE3A EC IN AL,OX READ STATUS REGISTER EE3B AS 20 TEST AL, BUSY _BI T HAS NEC STARTED THE EXECUTION PHASE? EE3D 74 FB JZ READ LOOP HAS NOT STATRED YET EE3F EC J22_5: IN AL,DX READ STATUS PORT EE40 A8 20 TEST AL, BUSY_BI T HAS NEC COMPLETED EXECUT I ON PHASE? ££42 74 21 JZ OP _END JUMP IF EXECUT ION PHASE I S OVER EE44 A8 80 TEST AL, RQM I S DATA READY? EE46 74 F7 JZ J22_5 READ THE DATA EE48 .2 INe ox f'OINT AT NEC DATA EE49 Ee IN AL, OX READ DATA - EE4A AA STOSB TRANSFER DATA EE4B .A DEe DX POINT AT NEC STATUS EE4C fB F 1 JHP J22 5 CONTINUE WITH READ OPERATION ; -----WR I TE AND FORMAT OPERATION EE4E WR I TE_LOOP: EE4E Ee IN AL, ox READ NEC STATUS PORT EE4F AS 20 TEST AL,9USY_BIT HAS THE NEC ENTERED EXECUTION PHASE YET? EE51 74 FB JZ WRITE_LOOP , NO, CONTINUE LOOPING EE53 89 2080 HDV ex, BUSY_Bt T*256+RQM EE56 EE56 Ee IN AL, ox READ STATUS PORT EE57 84 C5 TEST AL, CH I S THE FEC ST I LL I N THE EXECUT I ON PHASE? EE59 74 OA JZ OP _END JUMP IF EXECUTION PHASE IS DONE. EE58 84 Cl TEST AL, CL IS THE DATA PORT READ V FOR THE TRANSFER? EE50 74 F7 JZ J22_7 JUMP TO WRITE DATA EE5F 42 INC OX POINT AT DATA REGISTER EESO AC Loose TRANSFER BYTE EE61 EE OUT ox, AL WR I TE THE BYTE ON THE 0 I SKETTE EE62 4A DEC OX POINT AT THE STATUS REGISTER EE63 EB F 1 JMP J22_7 CONTINUE WITH WRITE OR FORMAT i ------TRANSFER PROCESS I SaVER EE65 SC OP _END: PUSHF SAVE THE CARRY BI T SET IN DISK_INT EE66 E8 E845 R CALL GET DR I VE GET BIT MASK FOR DRIVE SELECTION EE69 OC 80 OR AL, FDC_RESET NO RESET, KEEP DRIVE SPINNING EE6B SA OOF2 MOV OX, NEe CTL EE6E EE OUT OX, AL - D I SABLE WATCHDOG UPDATE TIME OF DAY EE6F E8 1388 R CALL DDS POINT OS AT BIOS DATA SEGMENT EE72 ES EB31 R CALL CLOCK_WA I T WAIT IF TIMERO IS CLOSE TO WRAPPI NG EE75 ES ES lA R CALL READ TIME EE78 88 5E 12 MOV BX, [BP+181 GET THE INITIAL VALUE OF TIMERI EE78 28 C3 SUB AX,BX UPDATE NUMBER OF INTERRUPTS MISSED EE7D F7 08 NEG AX PUT IT IN AX EE7F 50 PUSH AX SAVE I T FOR REUSE I N I SSU I NG USER Tl MER INTERRUPTS EE80 01 06 OOSC R ADD ADD NUMBER OF TIMER INTERRUPTS TO TI ME EE84 73 04 JNe JUMP IF TI MER LOW 0 I D NOT SPI LL OVER TO TI MER=H I EEBS FF 06 006E R INe TIMER_HIGH EEBA 83 3E 006E R 18 J16_4: eMf' T1MER_HIGH,OIBH TEST FOR COUNT TOTAL I NG 24 HOURS EESF 75 19 JNZ ...116 5 JUMP I F NOT 24 HOURS EE91 81 3E COSC R OOBO eHP TI MER_LOW, OBOH LOW VALUE = 24 HOUR VALUE? EES7 7C 11 JL JIB 5 NOT 24 HOUR VALUE? ; ------ TI MER HAS GONE 24 HOURS EE99 C7 06 006E R 0000 MDV TlMER_HIGH,O ZERO OUT TI MER_HI GH VALUE EESF 81 2E aosc R 0080 SUB TI MER_LOW, OBOH VALUE REFLECTS CORRECT TICKS PAST ooaOH EEA5 C6 06 0070 R 01 HOV TI MER_OFL, 1 J NO I CATES 24 HOUR THRESHOLD EEAA E8 EBOB R J16_5: CALL ENABLE ENABLE ALL INTERRUPTS EEAO 59 PDP ex CX: ::AX, COUNT FOR NUMBER OF USER T I ME 1 NTERRUPTS EEAE E3 26 JCXZ I F ZERO DO NOT ISSUE ANY INTERRUPTS EEBO IE PUSH SAVE ALL REGl STERS SAVED PRIOR TO INT lC CALL FROM TIMERINT EEBI 50 PUSH AX THIS PROVIDES A COMPATIBLE I NTERF ACE TO IC EEB2 52 PUSH DX EEB3 EEB3 CD lC INT le" TRANSFER CONTROL TO USER INTERRUPT EEBS E2 FC LOOP J16_B DO ALL USER TIMER INTERRUPTS EEB7 5A POP OX EEBB 58 POP AX EEB9 IF POP OS RESTORE REGISTERS , ------ CLOCK IS UPDATED AND USER INTERRUPTS lC HAVE BEEN ISSUED. CHECK I F KEYSTROKE OCCURED EEBA OA CO OR AL,AL AL WAS SET DURING CALL TO ENABLE EEBC 74 18 JZ ...11.6_7 NO KEY WAS PRESSED WHILE SYSTEM WAS MASKED EEBE B8 0080 HOV BX,oaOH DURATION OF TONE EECI 89 0049 HDV CX, 04BH FREQUNCY OF TONE EEC4 E8 £035 R CALL K8_NOISE NOlI FY USER OF MI SSED KEYBORAD INPUT A-78 ROM BIOS i-------CLEAR SHIFT STATES DONT LEAVE POSSIBILTY OF DANGLING STATES OF MI SSEO BREAKS EEC7 80 2. 0017 R FO AND KS_FLAG, orOH CLEAR AL T , CLRL, LEFT AND RIGHT SHI FTS EEce 80 2. 0018 R OF AND CLEAR POTENTIAL BREAK OF INS, CAPS NUM AND SCROLL SH I FT EEOI 80 26 0088 R IF AND CLEAR FUNeT 1 ON STATES EED6 .0 ,JlG 1· POPF GET THE FLAGS EED7 J17~ EE07 72 .0 JC J20 EEDS E8 EAAO R CALL RESUL TS GET THE NEC STATUS EEOC 72 38 JC J20 i LOOK FOR ERROR CHECK THE RESULTS RETURNED BY THE CONTROLLER EEDE FC CLD i SET THE CORRECT D I RECTI ON EEDF BE 0042 R MOV SI,OFFSET NEC_STATUS i POINT TO STATUS FIELD EEE2 AC LODS NEC STATUS GET STO EEE3 24 CO AND AL,OCOH i TEST FOR NORMAL TERMINATION EEE5 74 58 JZ J22 ; OPN_OK EEE7 3C 40 CMP AL,040H ; TEST FOR ABNORMAL TERMINATION EEE9 75 25 JNZ JIB ; NOT ABNORMAL, BAD NEC ***NOTE*** THE CURRENT SYSTEM CONFIGURATION HA5 NO DMA. IN ORDER TO STOP THE NEC AN EDT MUST BE PASSED TO FORCE THE NEC TO HALT THEREFORE. THE STATUS RETURNED BV THE NEC WI LL ALWAVS SHOW AN EDT ERROR IF THIS I S THE ONL V ERROR RETURNED AND THE NUMBER OF SECTORS TRANSFERRED EQUALS THE NUMBER SECTORS REQUESTED IN THI S I NTERRUPT CALL THEN THE OPERATI ON HAS COMPLETED SUCCESSFULLY. IF AN EDT ERROR IS RETURNED AND THE REQUESTED NUMBER OF SECTORS I S NOT THE NUMBER OF SECTORS TRANSFERRED THEN THE ERROR I S LEG I T I MATE. WHEN THE EaT ERROR IS INVALID THE STATUS BYTES RETURNED ARE UPDATED TO REFLECT THE STATUS OF THE OPERATION IF DMA HAD BEEN PRESENT EEEB AC LODS NEC STATUS GET ST 1 EEEC 3C 80 CMP AL, SOH IS THIS THE ONLY ERROR? EEEE 7. 2A JE J21_1 NORMAL TERMINATION, NO ERROR EEFO 00 EO SAL AL, 1 NOT EDT ERROR, BYPASS ERROR SITS EEF2 00 EO SAL AL,l EEF4 00 EO SAL AL,l TEST FOR CRC ERROR EEFS 8. 10 MOV AH, BAD_CRC EEFS 72 18 JC Jl' RW FAI L EEFA 00 EO SAL AL,l TEST FOR DHA OVERRUN EEFC 8. 08 MOV AH, BAD_DMA EEFE 72 12 JC Jl' EFOO 00 EO SAL AL,l EF02 00 EO SAL AL,l TEST FOR RECORD NOT FOUND EF04 8. O. MOV AH, RECORO_NOT_FND EFOS 72 OA JC Jl. EFOS 00 EO SAL AL, 1 EFOA DO EO SAL AL, 1 TEST M I SSI NG ADDRESS MARK EFOC B4 02 MOV AH, BAD_ADDR_MARK EFOE 72 02 JC J19 RW_FAI L NEC MUST HAVE FAILED EFIO JIB: RW-NEC-FAI L EF10 8. 20 EF12 J19: RW-FAI L EF12 08 26 0041 R OR DISKETTE_STATUS, AH EF1G E8 EAE1 R CALL NUM TRANS HOW MANV WERE REALL V TRANSFERRED EF1S J20: - RW_ERR EF1S C3 RET RETURN TO CALLER OPERATION WAS SUCCESSFUL EF1A EF IA 8A 5E DE MOV BL, [BP+14J GET NUMBER OF SECTORS PASSED FROM STACK EF 10 E8 EAEI R CALL NUM_TRANS HOW MANY GOT MOVED, AL CONTAINS NUM OF SECTORS EF20 3A 08 CMP BL, AL NUMBER REQUESTEO=NUMBER ACTUALLY TRANSFERRED? EF22 7. DC JE .121_2 ; TRANSFER SUCCESSFUL OPERAT I ON ATTEMPTED TO ACCESS DATA PAST REAL EOT. THIS IS A REAL ERROR EF24 80 OE 0041 R O. OR DISKETTE_STATUS, RECORD_NOT_FND EF29 C6 06 0043 R 80 MOV NEC_STATUS+1,80H ; STI GETS CORRECT VALUE EF2E F. STe EF2F C3 RET EF30 33 CO J21_2: XOR AX, AX CLEAR AX FOR NEC_STATUS UPDATE EF32 33 F. XOR SI,5J , INDEX TO NEC_STATUS ARRAY EF34 88 8. 0042 R MOV NEC_STATUS[SI J, AL ; ZERO OUT BYTE, STO EF38 EF39 •• 88 8. 0042 R INC MOV 51 • POI NT I NDEX AT srCOND BYTE NEC_STATUS[S I J, AL ; ZERO OUT BUYE, ST 1 EF3D EB 03 JMP SHORT J21 3 OPN_DK EF3F E8 EAE1 R J22: CALL NUH TRANS- EF42 32 E4 J21_3· XOR AH,AH ; NO ERRORS EF44 C3 RET EF45 RW_OPN ENDP DISK INT - THIS ROUTINE HANDLES THE DISKETTE INTERRUPT. AN INTERRUPT WILL OCCUR ONLY WHEN THE ONE-SHOT TIMER IS FIRED. THIS OCCURS IN AN ERROR SITUATION. THIS ROUTINE SETS ERROR5 IN THE DI5KETTE STATUS BVTE AND DISABLES THE ONE-SHOT TIMER THEN THE RETURN ADDRESS ON THE 5TACK I S CHANGED TO RETURN TO THE OP _END LABEL. INPUT NONE OUTPUT NONE OS POINTS AT BIOS OATA AREA. CARRY FLAG IS SET SO THAT ERROR WILL BE CAUGHT IN THE ENVIRONMEMT RETURNED TO. ROM BIOS A-79 EF57 ORG OEF57H EF57 DISK_I NT PROC FAR EF!57 IE PUSH DS EF58 50 PUSH AX EF59 52 PUSH OX ; SAVE REGISTER EF5A 55 PUSH SP ; SAVE THE SP REGISTER EF5B E8 13Ba R CALL DDS ; SETUP OS TO POINT AT BIOS DATA CHECK I F INTERRUPT OCCURED I N I NT 13 OR WHETHER IT I S A SPUR I OUS INTERRUPT EF5E 8S EC MOV BP,SP ; POINT SP AT STACK EF&O OE PUSH CS ; WAS IT I N THE B I OS AREA EF61 58 POP AX EF62 38 46 OA CMP AX, WORD PTR[BP+IO] ; GET INTERRUPTED SEGMENT EF65 75 48 JNE 013 ; NOT IN BIOS, ERROR CONDITION EF67 BB 46 OB MOV AX, WORD PTR[BP+Bl ; GET IP ON THE STACK EF6A 3D £E20 R CMP AX, OFFSET YERIFY_LOOP ; RANGE CHECK IP FOR DISK ; TRANSFER EFGD 7C 40 JL DI 3 ; BELOW TRANSFER CODE EF6F 3D EE66 R CMP AX, OFFSET OP _END+l ; UPPER RANGE OF TRANSFER CODE EF72 70 3B JGE 013 ; ABOVE RANGE OF WATCHDOG TERRAIN ; -------VALID DISKETTE INTERRUPT CHANGE RETURN AODRESS ON STACK TO PULL OUT OF LOOP EF74 C7 46 OB EE65 R MOY WORD PTR[BP+81, OFFSET OP _END EF79 81 4E Ot 0001 OR WORD PTR[BP+121,1 ; TURN ON CARRY FLAG IN FLAGS ON ; STACK ; ***NOTE*** A WRITE PROTECTED DISKETTE WILL ALWAVS GET STUCK IN WRITE LOOP ; WAITING FOR BEGINNING OF EXECUTION PHASE. WHEN THE WATCHDOG ; FIRES AND THE STATUS IN PORT NEC_STAT = DXH (X MEANS DON'T CARE) ; STATUS FROM THE RESULT PHASE IS AVAILABLE. THE STATUS IS READ ; AND WRITE PROTECT IS CHECKED FOR. EF7E BA OOF4 MOY OX, NEC_STAT EFBI EC IN AL, OK GET NEC STATUS BYTE EF82 24 FO AND AL,OFOH MASK HIGH NIBBLE EF84 3C DO eMP AL,ODOH IS EXECUTION PHASE DONE EFBS 75 14 JNE 011 STUCK IN LOOP EFOB EB EAAO R CALL RESUL TS i GET STATUS OF OPERATION EF8S BE 0042 R MOY SI, OFFSET NEC_STATUS ; ADDRESS OF BYTES RETURNED BY ; NEC EFOE 8110 44 01 MOV AL, [51+1] ; GET STI EF91 1108 02 TEST AL,02H ; WRITE PROTECT SIGNAL ACTlYE? EF93 74 07 JZ 011 i TIME OUT ERROR EF95 eo OE 0041 R 03 OR 01 SKETTE_STATUS, WRI TE_PROTECT EF9A EB 13 JMP SHORT 0 I 3 i ------TI ME OUT ERROR EFge 80 DE 0041 R 80 011: OR DISKETTE_STATUS, TIME_OUT EFAI C6 06 003E R 00 MOV SEEK_STATUS, 0 , SET RECAL ON DRI YES RESET THE NEC AND DISABLE WATCHDOG EFAS BA 00F2 MOV DX, NEC_CTL ADDRESS TO NEC CONTROL PORT EFAS 50 POP BP POINT BP AT BASE OF STACKED PARAMETERS EF AA EB E845 R CALL GET DRIYE RESET ADAPTER AND 0 I SABLE WD EFAD 55 PUSH BP - RESTORE FOR RETURNED CALL EFAE EE OUT OX, AL EFAF BO 20 D13: MOY AL,EOI GIVE EOI TO 8259 EFBI E6 20 OUT INTAOO, AL EFB3 50 POP BP EFB4 SA POP ox EF85 58 POP AX EFB6 IF POP OS EF87 CF IRET ; RETURN FROM INTERRUPT EFB8 DISK_INT ENDP DISK_BASE THIS IS THE SET OF PARAMETERS REQUIRED FOR DISKETTE OPERATION. THEY ARE POINTED AT BY THE DATA VARIABLE DISK_POINTER. TO MODIFY THE PARAMETERS, BUILD ANOTHER PARAMETER BLOCK AND POINT AT IT EFC7 ORG OEFC7H EFC7 DISK_BASE LABEL BYTE EFC7 CF DB 11001111B SRT=C, HD UNLOAD=OF - 1ST SPECIFY BYTE EFCB 03 DB HD LOAD=l, MOOE=NO DMA - 2ND SPECIFY BYTE [FC9 25 DB MOTOR_WAIT WAIT AFTER OPN TIL MOTOR OFF EFCA 02 DB 2 512 BVTES/SECTOR EFce DB DB B EaT ( LAST SECTOR ON TRACK) EFCC 2A DB 02AH GAP LENGTH EFCO FF DB OFFH DTL EFeE 50 DB 050H GAP LENGTH FOR FORMAT EFCF F6 DB OFSH FJ LL BVTE FOR FORMAT EFDO 19 DB 25 HEAD SETTLE TIME (MILLISECONDS) EFD 1 04 DB • MOTOR START TIME (1/8 SECONDS) A-80 ROM BIOS --- I NT 17 ---------------------------------------------------- PRINTER_I 0 THIS ROUTINE PROVIDES COMMUNICATION WITH THE PRINTER ( AH) =0 PR I NT THE CHARACTER IN (AL) ON RETURN, AH=1 IF CHARACTER COULD NOT BE PRINTED tTl ME oun, OTHER SITS SET AS ON NORMAL STATUS CALL CAH)=1 INITIALIZE THE PRINTER PORT RETURNS WITH (AH) SET WITH PRINTER STATUS (AH)=2 READ THE PRINTER STATUS INTO (AH) 7 6 5 J 2-1 0 TIME OUT _ UNUSED- _ 1 ::: I/O ERROR _ 1 ::: SELECTED _ 1 = OUT OF PAPER _ 1 ::: ACKNOWLEDGE 1 = NOT BUSV (DX) = PRINTER TO BE USED (0,1,2) CORRESPONDING TO ACTUAL VALUES IN PRINTER_BASE AREA DATA AREA PRINTER_BASE CONTAINS THE BASE ADDRESS OF THE PRINTER CARDeS} AVAILABLE (LOCATED AT BEGINNING OF DATA SEGMENT, 408H ABSOLUTE, 3 WORDS), UNLESS THERE IS ONLY A SERIAL PRINTER ATTACHED, IN WHICH CASE THE WORD AT 40: 8 WILL CONTAIN A 02F8H. REGISTERS AH IS MODIFIED ALL OTHERS UNCHANGED ASSUME CS; CODE, os: DATA EFD2 ORG OEFD2H EFD2 PRINTER_I0 PROC FAR EFD2 FB 511 I NTERRUPTS SACK ON EFD3 1E PUSH 05 SAVE SEGMENT EFD4 52 PUSH OX EFDS 56 PUSH 51 EFDS 51 PUSH CX EFD7 53 PUSH 8)( EFDB EB 138B R CALL DDS ; REDIRECT TO SERIAL ONLY IF; 1> SERIAL PRINTER IS ATTACHED, AND. 2) WORD AT PRINTER BASE = 02F8H. POWER ONS WI LL ONL V PUT A 02FBH I N THE PRINTER BASE IF THERE'S NO PARALLEL PRINTER ATTACHED. EFDB BB DE 0010 R MOV CX, EQUIP_FLAG ; GET FLAG IN CX EFDF Fe C5 20 TEST CH, 00100000S ; SERI AL ATTACHED? EFE2 74 00 JZ 80 ; NO -HANDLE NORHALL V EFE4 88 IE 0008 R MaY BX, PRINTER_BASE ; SEE I F THERE' 5 AN RS232 EFES 81 FB 02F8 CMP BX.02F8H ; BASE I N THE PR I NTER BASE. EFEe 75 03 JNE SO EFEE E9 18C3 R BOO: JMP Bl_A ; IF THERE IS REDIRECT ; ELSE. HANDLE AS PARALLEL ;CONTROL IS PASSED TO THIS POINT IF THERE IS A PARALLEL OR ; THERE'S NO SER J AL PR INTER ATTACHED. EFFI 8B F2 80: MOV 51, OX ; GET PRINTER PARM EFF3 8A 9C 0078 R MOV BL,PRINT_TlM_OUT[Sll; LOAD TIMEOUT VALUE EFF7 Dl E6 SHL Sl,l ; WORD OFFSET INTO TABLE EFF9 SB 94 0008 R MOV OX, PRINTER_RASECSI] ; GET BASE ADDRESS FOR PRINTER CARD EFFD DB 02 OR OX, ox TEST OX FOR ZERO. INDICATING NO PRINTER EFFF 74 OC JZ 81 IF NO PARALLEL, RETURN FOOl OA £4 OR AH, AH TEST FOR (AH)=O F003 740E JZ B2 PRINT_AL F005 FE CC DEC AH TEST FOR (AH)=l F007 74 40 JZ B8 INIT_PRT F009 FE CC DEC AH TEST FOR (AH)=2 F008 74 28 JZ 85 PRINTER STATUS FOOD B1: RETURN FOOD 5B POP BX FOOE 59 POP CX FOOF 5E POP 51 RECOVER REG I STERS FOI0 5A POP DX RECOVER REG I STERS FOIl 1F POP D5 F012 CF IRET PRINT THE CHARACTER IN (AU F013 50 ~2: PUSH AX SAVE VALUE TO PRINT F014 EE OUT OX, AL ; OUTPUT CHAR TO PORT F015 42 INC DX j POINT TO STATUS PORT ~ ------WAIT BUSV F016 28 C9 5UB CX, CX I NHER LOOP (64K) F018 EC IN AL.DX GET STATUS F019 SA EO HOY AH,AL STATUS TO AH ALSO F018 AB BO TEST AL.80H IS THE PRINTER CURRENTLV BUSV FOlD 75 OE JNZ B4 OUT_STROBE FOIF E2 F7 LOOP B3_1 LOOP IF NOT F021 FE C8 DEC BL DROP OUTER LOOP COUNT F023 75 Fl JNZ 83 MAKE ANOTHER PASS I F NOT ZERO F025 80 CC 01 OR AH,l SET ERROR FLAG F028 80 £4 F9 AND AH,OF9H TURN OFF THE UNUSED BITS F02B EB 14 JHP SHORT 87 RETURN WI TH ERROR FLAG SET F020 B4: OUT_STROBE F020 80 00 HOY AL,ODH SET THE STROBE HIGH F02F 42 INC DX F030 EE OUT OX, AL F031 80 DC MOY AL,OCH SET THE STROBE L.OW F033 EE OUT D)(,AL F034 58 POP AX RECOVER THE OUTPUT CHAR ROM BIOS A-Sl ; ------ PRINTER STATUS F035 50 B5; PUSH AX • SAVE AL REG F036 BB 94 0008 R B6: MOV OX, PRINTER_BASE[SI J F03A 42 INC OX F03B EC IN AL, OX GET PRINTER STATUS F03C BA EO MOV AH, AL F03E BO E4 F8 AND AH,OFBH TURN OFF UNUSED BITS F041 87: STATUS_SET FO.l SA POP OX RECOVER AL REG F042 BA C2 MOV Al,DL GET CHARACTER INTO Al F044 F047 BO F4 EB C4 •• )COR JMP AH,4SH 81 FLI P A COUPLE OF BITS ; RETURN FROM ROUTI NE ; ------ INITIALIZE THE PRINTER PORT F049 50 8S: PUSH AX SAVE Al F04A .2 INC OX POINT TO OUTPUT PORT F04B .2 INC ox F04C 90 08 MOY Al , 8 SET INIT LINE lOW F04E EE OUT OX, Al FQ4F B8 03EB MOV AX, 1000 F052 89: INIT_lOOP F052 .a DEC AX LOOP FOR RESET TO TAKE FOS3 75 FD JNZ .9 INIT_lOOP FOSS BO DC "OV AL,OCH NO INTERRUPTS, NON AUTO IF, IN]T HIGH F057 EE OUT OX, AL FOSS EB DC J"P 96 PRT_STATUS_l F05A PRINTER_IO ENOP FOGS ORG OFOG5H FOGS ES ODOB R J"P NEAR PTR VIDEO_IO SUBROUTINE TO SAVE ANY SCAN CODE RECEIVED BY THE NMI ROUTINE (PASSED IN Al) DURING POST IN THE KEYBOARD BUFFER CALLED THROUGH I NT. 48H FOGS KEV_SCAN_SAVE PROC FAR ASSUME OS: DATA FOGS E8 1388 R CAll DDS , POINT OS TO DATA AREA FOSS BE 00 IE R "OV SI, OFFSET KB_BUFFER ; POINT TO FIRST LOC. IN BUFFER FOSE B8 04 "OV [51 J. AL SAVE SCAN CODE F070 BS C4 "OV AX, SP CHECK FOR STACK UNDERFLOW F072 BO E4 EO AND AH,11100000B (THESE BITS WILL BE 111 IF UNDERFLOW HAPPEND) F07S 7400 JZ KS_l F077 32 CO XOR AL,AL F079 E6 AO OUT OAOH, Al SHUT OFF NMI F07B BB 2000 MOV BX,2000H • ERROR CODE 2000H F07E 8E 0036 R NOV SI, OFFSET KEY _ERR ; POST MESSAGE Foal E8 09Be R CAll E_MSG • AND HALT SYSTEM FOB4 CF K5_1: IRET ; RETURN TO CALLER FOBS KEY _SCAN_SAVE ENDP SUBROUT I NE TO SET AN I NS8250 CH I P • 5 BAUD RATE TO 9600 BPS AND DEFINE IT'S DATA WORD AS HAYING 8 BITS/WORD, 2 STOP BITS, AND ODD PARITY. EXPECTS TO BE PASSED: (OX) = LINE CONTROL REGISTER UPON RETURN: (OX) = TRANSMIT/RECEIVE BUFFER ADDRESS ALSO, ALTERS REGISTER AL. ALL OTHERS REMAIN INTACT. F085 58250 PRoe NEAR FOBS 8080 "OV Al, BOH SET DlAS = 1 FOB7 EE OUT DX,Al F088 EB 00 J"P 5+2 J /0 DELAY FOBA 83 EA 03 sua DX,3 LSB OF DIVISOR LATCH FoeD eo DC MOV AL,12 DIVISOR = 12 PRODUCES 9600 BPS FOBF EE OUT DX,Al SET LSB F090 E900 JMP S+2 110 DELAY F092 42 INC OX "S8 OF DIVISOR lATCH F093 8000 MOV AL,O HIGH ORDER OF DIVISORS F09S EE OUT DX,Al SET MSB FOSS Ea 00 JHP 0+2 I/O DELAY FOBS 42 INC DX F09S 42 INC DX LI NE CONTROL REGISTER F09A BO OF HOV AL,OOOOl1l1a 8 BITS/WORD, 2 STOP BITS, ODD PARITY F09C EE OUT DX,AL FOgO EB 00 JMP '+2 110 DELAY F09F 83 EA 03 SU. OX,3 RECEIVER BUFFER FOA2 EC IN Al,DX IN CASE WRITING TO PORT LeR CAUSED DATA READY TO GO HIGH! FOA3 C3 RET FOA4!I 58250 ENDP TABLES FOR USE IN SETTING OF CRT MODE FDA4 ORG OFOA4H FOA4 VI o EO_PARMS lABEL BYTE INIT_TABlE FOA4!I 38 28 2C 06 IF 06 DB 3SH, 2BH, 2CH, 06H, IFH, 6, 19H • SETUP FOR 40X2!5 19 FOAB lC 02 07 06 07 DB lCH, 2, 7,6,7 FOBO 00 00 00 00 DB 0,0,0,0 A-82 ROM BIOS :;: 0010 M0040 EOU S-V I DEO_PARMS FOB4 71 50 5A DC lF OS DB 71H, SOH, SAH, OCH, 1FH, S, 19H ; SETUP FOR SOX25 is FOBB lC 02 07 OS 07 DB 1CH, 2, 7,6,7 FOCO 00 00 00 00 DB 0,0, a, 0 Foe4 38 28 28 06 7F OS DB 3SH, 28H, 2BH, 06H, 7FH, 6, 64H ; SET UP FOR GRAPHICS S4 FOCB 70 02 01 26 07 DB 70H, 2,1, 26H, 7 FOOO 00 00 00 00 DB 0,0,0,0 FOD4 71 50 56 ac 3F 06 DB 71H, SOH, 56H, OCH, 3FH, 6, 32H SET UP FOR GRAPHI CS 32 FODe 38 02 03 26 07 DB 38H,2, 3, 26H, 7 USI NG 32K OF MEMORY FOEO 00 00 00 00 DB 0, 0, 0, a (MODES 9 81 A) READ_AC_CURRENT THIS ROUTINE READS THE ATTRIBUTE AND CHARACTER AT TI-!E CURRENT CURSOR paS I T ION AND RETURNS THEM TO THE CALLER INPUT (AH) CURRENT CRT MODE (BH) DISPLAY PAGE ( ALPHA MODES ONLY ) (OS) DATA SEGMENT (E5) REGEN SEGMENT OUTPUT ( Al) :;: CHAR READ (AI-!) :;: ATTRI BUTE READ ASSUME CS: CODE, os: DATA, ES: DATA FOE4 READ_AC_CURRENT PROC NEAR FOE4 80 Fe 04 CMP AH,4 IS THIS GRAPHICS? FOE7 72 03 JC C60 FOES E9 F531 R JMP FOEC C60: READ _AC_CONT r NUE FOEC E8 FOF7 R CALL FIND_POSITION FOEF 8B F3 MOV SI,BX ESTABLISH ADDRESSING IN 51 FOF 1 06 PUSH ES FOF2 IF POP 05 GET SEGMENT FOR QU I CK ACCESS FOF3 AD lOOSW GET THE CHAR/ATTR FOF4 E9 OF70 R JMP VIDEO_RETURN FOF7 READ AC CURRENT ENDP FOF7 FIND:POSITION PROC NEAR FOF7 8A CF MOV el, BH D I SPLAY PAGE TO CX FOF9 32 ED XOR CH,CH FOF8 S9 Fl MOV 51, cx MOVE TO 51 FOR INDEX FOFD 01 E6 SAL 51,1 * 2 FOR WORD OfFSET FOFF 88 84 0050 R MOV AX, [61+ OFFSET CURSOR POSNl GET ROW/COLUMN OF THAT PAGE F103 33 DB XOR BX, ax SET START ADDRESS TO ZERO FI0S E3 06 JCXZ CS2 NO PAGE F 107 C61: PAGE_LOOP F 107 03 IE 004C R ADD LENGTH OF BUFFER F10B E2 FA LOOP FlOD C62: NO PAGE F 100 E8 E5C2 R CALL POSITION DETERMINE LOCATION IN REGEN F110 03 08 ADD BX, AX ADD TO START OF REGEN F 112 C3 RET F113 FIND_POSITION ENDP WRI TE_AC_CURRENT THIS ROUTINE WRITES THE ATTRIBUTE AND CHARACTER AT THE CURRENT CURSOR POSITION INPUT (AH) :;: CURRENT CRT MODE (BH) :;: DISPLAV PAGE (ex) :;: COUNT OF CHARACTERS TO WR ITE CAU = CHAR TO WRITE esu = ATTRIBUTE OF CHAR TO WRI TE (OS) :;: DATA SEGMENT (ES) :;: REGEN SEGMENT OUTPUT NONE ~~~~~=~~=~~;;~~~--------;;~~----~~~;--------- F113 FU3 BO FC 04 CMP AH,4 IS THIS GRAPHICS? F116 72 03 JC C63 F 118 E9 F3F 1 R ..IMP GRAPHICS_WRITE F11a C63: WRI TE_AC_CONTINUE FUB BA E3 MOV AH,BL GET ATTRIBUTE TO AH F 110 50 PUSH AX SAVE ON STACK FIlE 51 PUSH ex SAVE WRI TE COUNT F llF E8 FOF7 R CAll FIND_POSITION F122 8B FB MOV DI,BX ADDRESS TO 01 REGISTER F 124 59 POP ex WRITE COUNT F125 58 POP AX CHARACTER I N AX REG F126 C64: WRITE lOOP F 126 AS STOSW PUT THE CHAR/ATTR F127 E2 FD lOOP C64 AS MANY TIMES AS REQUESTED F 129 E9 OF70 R JMP V IDEO RETURN F12C WRITE_AC_CURRENT - ENDP ROM BIOS A-83 WRITE_C_CURRENT TH I 5 ROUT I NE WR I TES· THE CHARACTER AT THE CURRENT CURSOR POSITION, ATTRIBUTE UNCHANGED INPUT (AH) :::: CURRENT CRT HODE (8H) :::: DISPLAY PAGE (CX) = COUNT OF CHARACTERS TO WRITE CAL) :::: CHAR TO WRITE (OS) = DATA SEGMENT CES) :::: REGEN SEGMENT OUTPUT NONE ~;;~~~~~~~;;~~;-;;~~----~;;;----------------- F12C F12C 80 Fe 04 eMP AH,4 IS THIS GRAPHICS? F12F 72 03 JC CSIS F 131 E9 F3Fl R JMP GRAPH I es WR I TE F134 50 C65: PUSH AX - SAVE ON STACK F13!5 151 PUSH CX SAVE WRI TE COUNT F 136 E8 FOF7 R CALL FIND_POSITION F139 88 F8 MOV Dl,ax ADDRESS TO D I F13B 59 POP CX WRITE COUNT F13C 58 POP ax BL HAS CHAR TO WRI TE F13D C66: WRITE_LOOP F13D SA C3 MOY Al,BL RECOVER CHAR F13F AA STOSB PUT THE CHARI ATTR F140 47 INC 01 BUMP POINTER PAST ATTRIBUTE F141 E2 FA LOOP C66 AS MANY TIMES AS REQUESTED F 1-43 £9 OF10 R "MP VIDEO_RETURN F146 WRITE_C_CURRENT EHOP READ DOT -- WRITE DOT THESE ROUTINES WILL WRITE A DOT, OR READ THE DOT AT THE INDICATED LOCATION ENTRY -- DX :::: ROW· (0-199) (THE ACTUAL VALUE DEPENDS ON THE MODE) ex :::: COLUMN ( 0-639) ( THE VALUES ARE NOT RANGE CHECKED ) AL = DOT VALUE TO WRITE (1,2 OR 4 BITS DEPEND ING ON MODE, REQ'D FOR WRITE DOT ONLY. RIGHT JUSTIFIED) BIT 7 OF AL = 1 INDICATES XOR THE VALUE INTO THE LOCATION OS = DATA SEGMENT Es :::: REGEN SEGMENT EXIT AL = DOT VALUE READ, RIGHT JUSTIFIED, READ ONLY ASSUME C5: CODE, OS: DATA, ES: DATA F146 READ DOT PROC NEAR F 146 80 3E 0049 R OA - CMP CRT_MODE, OAH 640)(200 4 COLOR? .F14B F140 7-4 11 E8 FlOg R "E CAL.L READ_ODD C72 YES, HANDLE SEPARATELY DETERMINE BYTE POSITION OF DOT F1S0 26: 8A 04 MOY AL, ES: [51] GET THE BYTE F 153 22 C4 ANO AL,AH MASK OFF THE OTHER BITS IN THE BYTE F15S 02 EO SHL AL, CL LEFT JUsTI FY THE VALUE F157 8A CE MOV Cl,DH GET NUMBER OF BITS IN RESULT F159 02 CO ROl Al, CL RIGHT JUSTIFY THE RESULT F 158 E9 OF10 R JMP VIDEO_RETURN ; RETURN FROM VIDEO 10 IN 640X200 4 COLOR MODE, THE 2 COLOR BITS eCl, CO) ARE DIFFERENT THAN OTHER MODES. CO IS IN THE EVEN BYTE, C1 IS IN THE FOLLOWING ODD BYTE - BOTH AT THE SAME 8IT POSITrON WITHIN THEIR RESPECTIVE ; BYTES. FISE READ_ODD: F15E EB FIDS R CALL C72 DETERMINE POSITION OF DOT F 161 52 PUSH ox SAVE INFO F162 51 PUSH CX F163 50 PUSH AX F 164 26: 9A 44 01 MOY AL, ES: [51+11 GET Cl COLOR BIT FROM ODD BYTE Fl6B 22 C4 AND AL, AH MASK OFF OTHER BITS Fl6A 02 EO SHL AL. CL LEFT JUSTI FY THE VALUE Fl6C 8A CE MOY CL,DH GET NUMBER OF BITS IN RESULT F16E FE Cl INC CL F170 D2 CO ROL Al, CL RIGHT JUSTIFY THE RESULT F172 8B 08 MOV 8)(, AX SAVE I N ax REG F174 58 POP AX RESTORE POSI T I ON INFO F175 59 POP CX Fl76 5A POP OX F177 26: 8A 04 MOY AL, Es: [51] GET CO COLOR BI T FROM EVEN BYTE Fl7A 22 C4 AND Al, AH MASK OFF OTHER BI15 F17C 02 EO SHL AL, CL LEFT JUSTI FY THE VALUE F17E 8A CE MOY CL,DH GET NUMBER OF B I T5 IN RESUL T Fl80 02 CO ROL Al, CL RIGHT JUSTIFV THE RESULT Fl82 OA C3 OR AL,BL COMBINE Cl Ie CO F 184 E9 OF10 R "MP VIDEO_RETURN A-84 ROM BIOS F 187 READ DOT ENDP F 187 WRITE_DOT PROC NEAR F 187 51 PUSH CX SAVE COL F 188 52 PUSH OX SAVE ROW F 189 50 PUSH AX SAVE DOT VALUE F 18A 50 PUSH AX TWICE Fl8S E8 FlOg R CALL C72 DETERMINE BYTE POSITION OF THE DOT F18E 02 Ea SHR AL,CL SHIFT TO SET UP THE BITS FOR OUTPUT Fl90 22 C4 AND Al, AH STRIP OFF THE OTHER BITS F 192 26, 8A DC HOV CL, ES: [SI 1 GET THE CURRENT BYTE FI9S 58 POP BX RECOVER XOR FLAG FI96 F6 C3 80 TEST Bl, eOH IS IT ON Fl99 75 36 JNZ C70 YES, XOR THE DOT Fl9B F6 04 NOT AH SET THE MASK TO REMOVE THE INDICATED BITS F19C 22 CC AND CL, AH F19F OA C1 OR AL, CL OR I N THE NEW VALUE OF THOSE BITS FIAI C67: FINISH DOT FIA1 26: 88 04 HOV ES: [SI1,Al RESTORE THE BYTE I N MEMORY F lA4 58 POP AX F lA5 SA POP OX RECOVER ROW F IA6 59 POP CX RECOVER COL F lA7 80 3E 0049 R OA CMP CRT_MODE,OAH 640X200 4 COLOR? FIAC 75 20 JNE C6' NO, JUMP F IAE 50 PUSH AX SAVE DOT VALUE F IAF 50 PUSH AX TWICE F 180 DO E8 SHR AL,l SHIFT cl BIT INTO cO POSITION Fl82 E8 F109 R CALL C72 DETERMINE BYTE POSITION OF THE DOT F 185 02 E8 SHR AL, CL SHIFT TO SET UP THE BITS FOR OUTPUT F 187 22 C4 AND AL, AH STRIP OFF THE OTHER BITS F 189 26; SA 4C O! HOV Cl, E5; [SI+U GET THE CURRENT BYTE F 180 58 POP BX RECOVER XOR FLAG F IBE F6 C3 80 TEST eL, BOH IS IT ON FIC! 75 !2 JNZ C71 YES, XOR THE DOT F lC3 F6 04 NOT AH SET THE MASK TO REMOVE THE I NO I CATED BITS F lC5 22 CC AND eL, AH F IC7 OA Cl OR AL,CL OR I N THE NEW VALUE OF THOSE BITS F lC9 C68- FINISH DOT F lC9 28: 88 44 01 HOV ES;[SI+1J,AL RESTORE THE BYTE I N MEMORY FICO 58 POP AX F ICE E9 OF70 R C69: JMP V IDEO_RETURN RETURN FROM VIDEO 10 FI01 C70; > F20A BB 02CO MOV BX,2COH F20D 89 0302 MOV CX,302H SET PARMS FOR MED RES F210 80 3E 0049 R 04 eMP CRT_MO'DE,4 F215 74 21 JE C77 HANDLE IF MED RES F217 80 3E 0049 R 05 CMP CRT_MODE,5 F21C 74 lA JE C77 HANDLE IF MED RES F21E B8 04FO MOV eX,4FOH F221 89 0101 MOV CX,101H ; SET PARMS FOR lOW RES F224 80 3E 0049 R OA CMP CRT_MODE,OAH F229 74 07 JE C76 HANDLE MODE A AS HI GH RES F22B 80 3E 0049 R 06 CMP CRT_MODE,6 F230 75 06 JNE C77 HANDLE I F LOW RES F232 BS 0180 C76: MaY ex, laOH F235 89 0703 MOV CX,703H i SET PARMS FOR HI GH RES DETERMINE BIT OFFSET IN BYTE FROM COLUMN MASK ~~~ERMIN~HB~~E *~~~E~~C~~I~~\~I~~~~M~YTE CH~ F238 22 EA OFFSET FOR TO F23A 03 EA SHR ox,CL SHIFT BY CORRECT AMOUNT F23C 03 F2 ADD 51, OX INCREMENT THE POINTER F23E 80 3E 0049 R 011 CMP CRT_MODE,OAH 640X200 4 COLOR? F243 75 02 JNE C78 NO, JUMP F245 03 F2 ADD SI,DX INCREMENT THE POINTER F247 8A F7 C78: MOV OH, BH GET THE # OF BI TS IN RESULT TO DH MULTIPLY 8H (VALID BITS IN BYTE) BY CH F249 2A C9 SUB CL, CL ZERO INTO STORAGE LOCATION F24B DO C8 C79: ROR AL,l LEFT JUSTIFY THE VALUE IN AL (FOR WRITE> F24D 02 CD ADD CL, CH ADD IN THE BIT OFFSET VALUE F24F FE CF DEC BH LOOP CONTROL F251 75 Fe JNZ C79 ON EXIT, CL HAS SHIFT COUNT TO RESTORE BITS F253 8A E3 MOV AH, BL GET MASK TO AH F255 02 EC 5HR AH, CL MOVE THE MASK TO CORRECT LOCATION F257 58 POP BX RECOVER REG F25B C3 RET RETURN WITH EVERVTHING SET UP F259 C72 ENDP SCROLL UP THIS ROUTINE SCROLLS UP THE INFORMATION ON THE CRT ENTRY -- CH, CL = UPPER LEFT CORNER OF REGION TO SCROLL OH,DL = LOWER RIGHT CORNER OF REGION TO SCROLL BOTH OF THE ABOVE ARE IN CHARACTER POSITIONS BH = FI LL VALUE FOR BLANKED LI NES AL = " LINES TO SCROLL (AL=O MEANS BLANK THE ENTIRE FIELD> OS = OATA SEGMENT ES = REGEN SEGMENT EXI T - - NOTHI NG, THE SCREEN 1 S SCROLLED b~~;~~~~-~;-----;~~~----~~~;-------------------------- --- F259 F259 8A DB MOV BL, AL ; SAVE Ll NE COUNT IN BL F25B 88 Cl MOV AX, ex ; GET UPPER LEFT POSITION INTO AX REG USE CHARACTER SUBROUTINE FOR POSITIONING ADDRESS RETURNED IS MULTIPLIED BY 2 FROM CORRECT VALUE F250 E8 F72C R CALL GRAPH_POSN F260 88 F8 MOV OI,AX SAVE RESULT AS DESTINATION ADDRESS DETERMINE SIZE OF WINDO'W F262 28 01 SUB OX, CX F264 81 C2 0101 ADD OX,10lH ADJUST VALUES F26B DO E6 SAL DH, 1 MULTIPLY # ROWS BY 4 SINCE a VERT DOTS/CHAR F26A DO E6 SAL OH,l AND EVEN/Oo-O ROWS DETERMI NE CRT MODE F26C 80 3E 0049 R 06 CMP CRT_MODE, 6 TEST FOR HIGH RES F271 7. ID JE cao F I NO _SOURCE MED I UM RES UP F273 DO E2 SAL Dl,l # COLUMNS * 2, SINCE 2 BYTES/CHAR F275 Dl E7 SAL 01,1 OFFSET *2 SINCE 2 BYTES/CHAR F277 80 3E 0049 R a. CMP CRT_MODE,04 TEST FOR MEO I UM RES F27C 7. 12 JE CBO F27E 80 3E 0049 R 05 OtP CRT_MODE,5 TEST FOR MED I UM RES F283 74 OB JE CBO F285 80 3E 004,9 R OA CI'IP CRT_MODE,OAH TEST FOR MED I UM RES F28A 74 04 .JE C80 LOW RES UP F2ec DO E2 SAL DL,l # COLUMNS * 2 AGAIN, SINCE 4 BYTES/CHAR F28E 01 E7 SAL 01,1 OFFSET *2 AGAIN! SINCE 4 BYTES/CHAR A-86 ROM BIOS DETER") NE THE SOURCE AODRESS 1 N THE BUFFER F2S0 ceo: FIN~_SOURCE F290 OS PUSH ES GET SEGMENTS BOTH PO I NT I NG TO REGEN F291 IF POP OS F292 2A ED SUB CH, CH ZERO TO HIGH OF COUNT REG F294 DO E3 SAL BL,l MUL Tt PL V NUMBER OF L1 NES BV 4 F296 DO E3 SAL BL,1 F29B 74 67 JZ ceG IF ZERO, THEN BLANK ENTIRE FIELD F29A BA C3 HOV AL, BL GET NUMBER OF Ll NES IN Al F2SC 94 50 HOV AH,80 80 BVTES/ROW F29E F6 E4 HUL AH DETERMINE OFFSET TO SOURCE F2AO 88 F7 HOV 51,01 SET UP SOURCE F2A2 03 FO ADD 51, AX AOD I N OFFSET TO IT F2A4 8A E6 HOV AH,DH NUMBER OF ROWS IN F I ELO F2A6 2A E3 SUB AH, BL , DETERMJ NE NUMBER TO MOYE ; ------ LOOP THROUGH, MOVI NG ONE ROW AT A TI ME, BOTH EYEN AND ODD Fl ELOS F2A8 C8l: ROW_LOOP F2A8 EB F3C7 R CALL c.S MOVE ONE ROW F2AB IE PUSH OS SAYE DATA SEG F2AC EB 1389 R CAll ODS POINT TO BIOS DATA AREA F2AF 80 3E 0049 R 09 CMP CRT_MOOE,9 MODE USES 32K REGEN? F284 IF POP D5 RESTORE DATA SEG F2B5 72 15 JC C82 NO, JUMP F2B7 81 C6 2000 ADD S) , 200DH ADJUST POI NTERS F2BB 81 C7 2000 ADD 01, 20DOH F2BF E8 F3C7 R CALL C95 MOYE 2 HORE ROWS F2C2 81 EE 3FBO SUB SI, 4000H-SO BACK UP PO INTERS F2CS B1 EF 3FBO SUB 0 I , 4000H-SO F2CA FE CC DEC AH ADJUST COUNT F2CC 81 EE IFBO C82: SUB S I, 2aODH-SO MOVE TO NEXT ROW F2DO 81 EF 1FOO SUB 0 I , 2aDDH-BO F2D4 FE CC DEC AH NUMBER OF ROWS TO MOYE F2DS 75 DO JNZ CB 1 , CONTI NUE TI LL ALL MOYED ; FILL IN THE VACATED LlNECS) F2DB CS3· CLEAR_ENTRV F2DB SA C7 HOV AL, BH ATTRIBUTE TO FILL WITH F2DA EB F3EO R CB4: CALL C9G CLEAR THAT ROW F2DD IE PUSH OS SAVE DATA SEG F2DE E8 138B R CALL DDS POINT TO BIOS DATA AREA F2E 1 80 3E 0049 R 09 CHP CRT_MODE, 9 MODE USES 32K REGEN? F2E6 IF POP OS RESTORE DATA SEC F2E7 72 00 JC CB5 NO, JUMP F2E9 B 1 C7 2000 ADD DI,2000H F2ED E8 F3EO R CALL C• • CLEAR 2 MORE ROWS F2FO 81 EF 3FBO SUB 01, 4000H-8D BACK UP POINTERS F2F4 FE CB DEC BL AD JUST COUNT F2F6 81 EF IF eo C85: SUB D I , 2000H-80 POI NT TO NEXT LI NE F2FA FE CB DEC BL NUMBER OF LI NES TO FI LL F2FC 75 DC JNZ CB. CLEAR_LOOP F2FE E9 OF70 R JMP YIDEO_RETURN EVERYTHING DONE F301 CBS: BLANK FIELD F301 SA DE HOV BL, DH SET BLANK COUNT TO EYERVTHI NG IN FIELD F303 EB 03 JMP CB3 CLEAR THE FIELD F305 ENDP SCROLL DOWN THIS ROUTINE SCROLLS DOWN THE INFORMATION ON THE CRT ENTRV -- CH, CL = UPPER LEFT CORNER OF REGION TO SCROLL DH,DL ::::: LOWER RIGHT CORNER OF REGION TO SCROLL BOTH OF THE ABOYE ARE IN CHARACTER POSI TIONS 8H = FILL VALUE FOR BLANKED LI NES AL = # LINES TO SCROLL (AL=O MEANS BLANK THE ENTIRE FIELD) OS = DATA SEGMENT ES = REGEN SEGMENT EXIT -- NOTHI NG, THE SCREEN I S SCROLLED F305 GRAPHICS_DOWN PROC NEAR FaD5 FD STO ; SET DIRECTION FlOS 8A DB MOY BL, AL ; SAYE LINE COUNT IN 8L F30B 88 C2 MOV AX, OX ; GET LOWER RIGHT POSITION INTO AX REG ; ------ USE CHARACTER SUBROUTINE FOR POSITIONING ADDRESS RETURNED IS MUL Tt PL I ED BV 2 FROM CORRECT YALUE FlOA E8 F72C R CALL GRAPH_POSN F30D se F8 MOV OI,AX SAVE RESULT AS DESTINATION ADDRESS DETERMINE SIZE OF WINDOW F30F 28 Dl SUB DX, CX F3ll 81 C2 0101 ADD DX,10lH ADJUST YALUES F31S DO E6 SAL OH,l MULTIPLV • ROWS BV 4 SINCE 8 VERT OOTS/CI-(AR F317 DO E6 SAL DH, 1 AND EVEN/ODD ROWS DETERMI NE CRT MODE F319 80 3£ 0049 R 06 CMP CRT_MODE,6 TEST FOR HI GH RES F31E 74 22 JZ CB7 F I NO _SOURCE_D OWN ROM BIOS A-87 MED I UM RES DOWN F320 DO E2 SAL Dl,1 # COLUMNS * 2, SINCE 2 BVTES/CHAR (OFFSET OK) F322 01 E7 SAL 01,1 OFFSET *2 SINCE 2 BVTES/CHAR F324 47 INC 01 PO I NT TO LAST BYTE F325 80 3E 0049 R 04 CMP CRT_MODE,4 TEST FOR MED J UM RES F32A 74 16 JZ C87 F I NO _SOURCE_DOWN F32C 80 3E 0049 R 05 CMP CRT_MODE,5 TEST FOR MED I UM RES F331 74 OF JZ C87 FIND SOURCE DOWN F333 80 3E 0049 R OA CMP CRT_MODE,OAH TEST-FOR MEDIUM RES F338 74 08 JZ CB7 FI ND_SOURCE~OOWN F33A 4F DEC DI F338 DO E2 SAL Dl,l * # COLUMNS 2 AGAIN, SINCE 4 BYTES/CHAR: (OFFSET OK) F330 01 E7 SAL 01, 1 OFFSET *2 AGAIN, SINCE 4 BYTES/CHAR F33F 83 C7 03 ADD 01,3 ; POI NT TO lAST BVTE i - - - - - - OETERM r NE THE SOURCE ADDRESS IN THE BUFFER F342 CB7 F I NO SOURCE DOWN F342 2A ED SUB CH, CH ZERO ~ TO HIGH OF COUNT REG F344 B8 OOFO HOV AX, 240 OFFSET TO lAST ROW OF PIXELS IF 16K REGEN F347 80 3E 0049 R 09 CHP CRT_MODE,9 US I NG 32K REGEN? F34C 72 03 JC CBB NO, JUMP F34E 88 OOAO HOV AX, 160 OFFSET TO lAST ROW OF PIXELS IF 32K REGEN F351 03 F8 CBB: ADD DI,AX POINT TO lAST ROW OF PIXELS F353 DO E3 SAL Bl,l MULTIPLY NUMBER OF liNES BY 4 F355 DO E3 SAL Bl, 1 F357 74 GA .JZ C94 IF ZERO, THEN BLANK ENTIRE FIELD F359 SA C3 MOY Al, Bl GET NUMBER OF LINES IN Al F358 Boll 50 MOV AH, BO 80 BYTES/ROW F35D F6 E4 MUl AH DETERMINE OFFSET TO SOURCE F35F 8B F7 MOY SI,Dl SET UP SOURCE F3Gl 28 Fa SUB SI,AX SUBTRACT THE OFFSET F3G3 8A E6 MOY AH,DH NUMBER OF ROWS IN F I ElO F36S 2A E3 SUB AH, Bl DETERMINE NUMBER TO MOYE F3G7 06 PUSH ES BOTH SEGMENTS TO REGEN F3GB IF POP OS i - - - - - - LOOP THROUGH, MOYING ONE ROW AT A TIME, BOTH EVEN AND ODD ; FIELDS F369 CB9: ROW lOOP DOWN F3&9 Ea F3C7 R CAll C95 MOVE ONE-ROW F3se IE PUSH DS SAYE DATA SEG F3SD E8 138B R CAll DDS POINT TO BIOS OATA AREA F370 80 3£ 0049 R 09 CMP CRT MOOE,9 MODE USES 32K REGEN? F375 IF POP DS - RESTORE OAT A SEG F376 72 15 JC C90 NO, JUMP F378 B1 CG 2000 ADD SI,2000H AD JUST PO INTERS Fa7C 81 C7 2000 ADD DI,2000H F3S0 E8 F3e7 R CALL C95 MOVE 2 MORE ROWS F3S3 81 EE 4050 SUB SI.4000H+80 BACK UP PO INTERS F387 81 EF 4050 SUB 01 ,4000H+80 Fa88 FE CC DEC AH ADJUST COUNT FaSD 81 EE 2050 C90: SUB 51,2000H+80 MOVE TO NEXT ROW F391 Bl EF 2050 SUB 01, 2000H+BO F39S FE CC DEC AH NUMBER OF ROWS TO MOYE Fa97 75 DO .JNZ CBS CONTI NUE TILL ALL MOVED FILL IN THE VACATED LINE(S) F399 C91; CLEAR ENTRV DOWN F399 BA C7 MOV AL, BH ATTRIBUTE TO F i l l WITH F398 C92: CLEAR lOOP DOWN Fa98 E8 F3EO R CAll e9. CLEAR-A ROW F39E IE PUSH DS SAVE OAT A SEG Fa9F E8 138B R CAll DDS POINT TO 810S DATA AREA FaA2 80 3E 0049 R 09 CMP CRT_MODE,9 MODE USES 32K REGEN? F3A7 IF PDP DS RESTORE DATA SEG F3AB 72 00 JC C93 NO, .JUMP F3AA 81 C7 2000 ADD DI,20DDH F3AE E8 F3EO R CAll C9. CLEAR 2 MORE ROWS F3S1 81 EF 4050 SUB 01 ,4000H+80 8ACK UP PO INTERS F38S FE CS DEC BL AD,JUST COUNT F397 81 EF 2050 C93: SUB 01 ,2000H+SO POINT TO NEXT LINE F3a8 FE ca DEC BL NUM8ER OF liNES TO FIll F3BD 75 DC JNZ C92 CLEAR lOOP DOWN F3aF FC CLD RESET-THE DIRECTION FLAG F3eo E9 OF70 R JHP EVERVTHI NG DONE F3e3 C94: BLANK FI ElD DOWN F3ea BA DE HOV BL,DH SET BLANK COUNT TO EVERVTHI NG IN FIELD F3CS EB 02 JMP C91 CLEAR THE FIELD F3C7 GRAPH I C5 DOWN ENDP j - - - - - - ROUT I NE TO MOVE ONE ROW OF I NFORMAT r ON F3C7 C95 PROC NEAR Fae7 BA CA HOV Cl,DL NUMBER OF BVTES 1 N THE ROW F3e9 56 PUSH 51 F3eA 57 PUSH DI SAVE PO INTERS F3CB F3/ A4 REP MOVSB MOYE THE EVEN FIELD FacD SF POP DI FaCE 5E POP 51 F3CF B 1 C6 2000 ADD 51, ZOOOH F3D3 Bl C7 2000 ADD OI,2000H POINT TO THE ODD FIELD F3D7 56 PUSH 51 F3DS 57 PUSH DI SAYE THE POI NTERS F3D9 SA CA HOV CL, Dl COUNT BACK F3DB Fa/ A4 REP MOV5B MOVE THE ODD FIELD F3DD SF POP DI FaDE 5E PDP 51 PO I NTERS BACK F3DF C3 RET RETURN TO CALLER F3EO C95 ENDP A-88 ROM BIOS CLEAR A 51 NGLE ROW F3ED C96 PROC NEAR F3ED BA CA MOV eL,DL NUMBER OF BYTES IN FIELD F3E2 57 PUSH 01 SAVE PO INTER F3E3 F3! AA REP STOSB STORE THE NEW VALUE F3E5 5F POP 01 PO I NTER BACK F3E6 81 C7 2000 ADD D I, 2000H POINT TO ODD FIELD F3EA 57 PUSH 01 F3EB 8A CA MOV Cl,OL F3ED F3! AA REP STOSB FILL THE ODD FILELD F3EF 5F POP DI F3FO C3 RET RETURN TO CALLER F3Fl C96 ENDP GRAPHICS WRITE THIS ROUTINE WRITES THE ASCI I CHARACTER TO THE CURRENT POSITION ON THE SCREEN. ENTRY -- AL ::: CHARACTER TO WRITE BL COLOR ATTRIBUTE TO BE USED FOR FOREGROUND COLOR IF BIT 7 IS SET, THE CHAR IS XOR'D INTO THE REGEN BUFFER (0 I S USED FOR THE BACKGROUND COLOR) CX NUMBER OF CHARS TO WR I TE OS DATA SEGMENT ES REGEN SEGMENT EXIT -- NOTH I NG I S RETURNED GRAPH I CS READ THIS ROUTINE READS THE ASCI I CHARACTER AT THE CURRENT CURSOR POSITION ON THE SCREEN BY MATCHING THE DOTS ON THE SCREEN TO THE CHARACTER GENERATOR CODE POINTS ENTRY -- NONE (0 15 ASSUMED AS THE BACKGROUND COLOR) EXI T -- AL ::: CHARACTER READ AT THAT POSITION (0 RETURNED IF NONE FOUND) FOR BOTH ROUTINES, THE IMAGES USED TO FORM CHARS ARE CONTAINED IN ROM. INTERRUPT 44H IS USED TO POINT TO THE TABLE FOR THE FIRST 128 CHARS. INTERRUPT 17H IS USEO TO POINT TO THE TABLE FOR THE SECOND 12B CHARS ASSUME CS: CODE, OS: DATA, ES' DATA F3F 1 GRAPH I CS WR I TE PROC NEAR F3F 1 32 £4 XOR AH, AH ; ZERO TO HIGH OF CODE POINT F3F3 50 PUSH AX ; SAVE CODE POI NT VALUE DETERMINE POSITION IN REGEN BUFFER TO PUT CODE POINTS F3F4 EB F729 R CALL R59 ; FIND LOCATION IN REGEN BUFFER F3F7 BB FB MOV 0 I , AX ; REGEN PO I NTER IN 0 I DETERMINE REGION TO GET CODE POINTS FROM F3F9 5B POP AX i RECOVER CODE POINT F3FA BE 0110 R MOV 51, OFFSET CSET_PTR , ASSUME FIRST HALF F3FD 3C 80 eMP AL, BOH IS IT IN FIRST HALF? F3FF 72 05 JB Rl JUMP IF IT IS F401 BE 007C R MOV SI,OFFSET EXT_PTR i SET POINTER FOR SECOND HALF F404 2C 80 SUB AL,80H ZERO ORIGIN FOR SECOND HALF F406 Rl: EXTEND_CHAR F40G IE PUSH OS SAVE DATA POINTER F407 33 D2 XOR OX, OX F409 8E OA MOV OS, OX ESTABLISH VECTOR ADDRESSING ASSUME OS: ABSO F40B C5 34 LOS 51,DWORD PTR {51] i GET THE OFFSET OF THE TABLE F400 BC DA MOV OX, OS GET THE SEGMENT OF THE TABLE ASSUME OS: DATA F40F IF POP 05 RECOVER DATA SEGMENT F410 52 PUSH OX , SAVE TABLE SEGMENT ON STACK DETERMINE GRAPHICS MODE IN OPERATION F411 01 EO SAL AX, 1 MULTIPLY CODE POINT F413 DIED SAL AX, 1 VALUE BY 8 F415 DIED SAL AX,l F417 03 FO ADD SI J AX 51 HAS OFFSET OF DESIRED CODES F419 80 3E 0049 R 04 CMP CRT_MODE,4 F41E 74 45 JE R9 TEST FOR MEDIUM RESOLUTION MODE F420 80 3E 0049 R 05 CMP CRT_MODE,5 F425 F427 74 3E 80 3E 0049 R OA JE CMP R' CRT_MODE,OAH TEST FOR MEDIUM RESOLUTION MODE F42C F42E 75 03 £9 F4D4 R JNE JMP .,6 R3 TEST FOR MED I UM RESOLUT I ON MODE F431 80 3E 0049 R 06 R3· CMP CRT_MODE, S TEST FOR HI GH REsOLUTI ON MODE F436 75 53 JNE R12 GOTO LOW RESOLUTION IF NOT HIGH RESOLUT I ON MODE F43B IF POP D5 RECOVER TABLE POINTER SEGMENT F439 57 R5 PUSH 01 SAVE REGEN POINTER F43A 56 PUSH 51 SAVE CODE POINTER F438 B6 04 "OV DH,4 NUMBER OF TI MES THROUGH LOOP F43D AC R6: LODSB GET BYTE FROM CODE POINTS F43E F6 C3 BO TEST eL, BOH SHOULD WE USE THE FUNCTl ON F441 75 16 JNZ .8 TO PUT CHAR IN? F443 AA STOSB STORE I N REGEN BUFFER F444 AC Loose F445 26, BB 85 IFFF .7 MOV ES: (0 I +2000H-l), AL i STORE I N SECOND HALF F44A B3 C7 4F ADD 01, 79 MOVE TO NEXT ROW I N REGEN F44D FE CE OEC DH DONE WITH LOOP F44F 75 EC JNZ R6 F451 5E POP 51 F452 5F POP DI RECOVER REGEN POINTER F453 .7 INC 01 PO I NT TO NEXT CHAR POS I T I ON F4S4 E2 E3 LOOP R5 MORE CHARS TO WRI TE ROM BIOS A-89 F456 E9 OF70 R R705: JMP Y IDEO_RETURN F459 26, 32 05 R8: XOR AL, ES: [D I] .; E)(CLUSI YE OR WI TH CURRENT DATA F45C AA STOs8 .; STORE THE CODE POINT F45D AC lODSB ; AGAIN FOR ODD FIELD F45E 26: 32 85 IFFF XOR AL, ES: [D I +2000H-ll F463 EB EO JMP R7 BACK TO MAINSTREAM ,------ MEDIUM RESOLUTION WRITE F465 R9: MED_RES_WRITE F465 IF POP DS RECOYER TABLE POINTER SEGMENT F466 8A D3 "OY Dl,Bl SAYE HIGH COLOR BIT F46B D1 E7 SAL 01,1 OFFSET*2 SINCE 2 BVTES/CHAR F46A E8 F659 R CAll R40 EXPAND BL TO FULL WORD OF COLOR F46D RIO: MED_CHAR F46D 57 PUSH DI SAVE REGEN POINTER F46E 56 PUSH 51 SAVE THE CODE POINTER F46F 86 04 "OY OH,4 NUMBER OF lOOPS F471 EB F626 R Rll: CAll Rl5 DO FIRST 2 BVTES F474 81 C7 2000 ADD 01,2000H NEXT SPOT IN REGEN F478 E8 F626 R CAll R35 DO NEXT 2 BYTES F47B 81 EF 1FBO SUB 01 , 2000H-80 F47F FE CE DEC DH F481 75 EE JNZ Rll KEEP GOING F483 5E POP 51 RECOYER CODE paNTER F484 5F POP DI RECOVER REGEN POINTER F485 47 INC DI PO I NT TO NEKT CHAR POS I T I ON F486 47 INC 01 F487 E2 E4 LOOP RIO MORE TO WRITE F489 EB C8 J"P R705 ,------ LOW RESOLUT I ON WR I TE F48B R12: lOW_RE5_WRI TE F48B IF POP OS RECOVER TABLE POINTER SEGMENT F48C 8A D3 "OY Ol,BL SAVE HI GH COLOR BIT F48E 01 E7 SAL 01,1 OFFSET*4 SINCE 4 BYTES/CHAR F490 01 E7 SAL 01,1 F492 E8 F66E R CALL R42 EKPAND Bl TO FULL WORD OF COLOR F495 Rll: MED_CHAR F49!5 57 PUSH 01 SAVE REGEN POINTER F496 56 PUSH 51 SAVE THE CODE POINTER F497 8604 MOY DH,o4 NUMBER OF lOOPS F499 E8 F&45 R R14: CALL R39 EXPAND DOT ROW I N REGEN F49C 81 C7 2000 ADO 0 I , 2000H POI NT TO NEXT REGEN ROW F4AO EB F&45 R CALL R3S EXPAND DOT ROW I N REGEN F4A3 IE PUSH OS SAVE OS F4A4 E8 1388 R CALL DDS POINT TO BIOS DATA AREA F4A7 80 3E 0049 R 09 CHP CRT_MODE,09H USI NG 32K REGEN AREA? F4AC IF POP OS RECOVER OS F4AD 75 14 JNE R15 JUMP I F 16K REGEN F4AF 81 C7 2000 ADD D I , 2000H POINT TO NEXT REGEN ROW F483 E8 F645 R CALL R39 E)(PAND DOT ROW I N REGEN F48S B1 C7 2000 ADD DI,2000H POI NT TO NEXT REGEN ROW F4BA E8 F645 R CALL R39 EXPAND DOT ROW I N REGEN F4BD 81 EF 3FBO SUB 0 I, 4000H-80 ADJUST REGEN POINTER F4C1 F£ CE DEC DH F4C3 81 EF IFBO R15: SUB 0 I, 2000H-SO ADJUST REGEN POINTER TO NEXT ROW F4C7 FE CE DEC DH F4C9 75 CE JNZ A104 KEEP GOING F4C8 5E POP 51 RECOYER CODE PONTER F4CC 5F POP DI RECOVER REGEN PO INTER F4CO 83 C7 04 ADD DI,4 POINT TO NEXT CHAR POSITION F4DO E2 C3 LOOP Rll MORE TO WR I TE F4D2 EB 82 JMP R705 ; ----- 640X200 4 COLOR GRAPH I CS WRITE F404 IF RIG: POP OS .; RECOVER TABLE SEGMENT POINTER F405 8A D3 MOY DL,BL .; SAYE HIGH COLOR BIT F407 Dl E7 SAL 01,1 , OFFSET*2 SINCE 2 BYTES/CHAR EXPAND LOW 2 COLOR BITS IN BL (clcO) INTO BX (cOeOeOcOcOeOcOeOc le le le le Ie Ie le 1) F4D9 33 CO XOR AX, AX F4DB Fa C3 01 TEST BL,l eO COLOR BIT ON? F4DE 74 02 JZ R17 NO, JUMP F4EO B4 FF MOY AH,OFFH VES, SET ALL eO 81 TS ON F4E2 Fa C3 00 R17: TEST Bl,2 el COLOR BIT ON? F4E5 74 02 JZ RIB NO, JUMP F4E7 80 FF MOY AL,OFFH YES, SET ALL e 1 BI TS ON F4E9 88 D8 RIB: MOY 8X, AX COLOR MASK IN BX F4EB R19: F4EB 57 PUSH 01 SAVE REGEN POI NTER F4EC 56 PUSH 51 SAVE CODE POINT POINTER F4ED 86 02 "OY DH,2 SET LOOP COUNTER F4EF E8 F518 R R20: CALL R21 DO FIRST DOT ROW F4F2 81 C7 2000 ADD DI,2000H ADJUST REGEN POINTER F4F6 EB F518 R CAll R21 DO NEXT DOT ROW F4F9 81 C7 2000 ADD DJ,2000H ADJUST REGEN POI NTER F4Fo £8 FS18 R CAll R21 DO NEXT DOT ROW F!500 81 C7 2000 ADD DI,2000H ADJUST REGEN POINTER F504 E8 F518 R CAll R21 DO NEXT DOT ROW F507 81 EF 5F60 SUB o I , GOOOH-160 ADJUST REGEN POINTER TO NEXT ROW FSOB FE CE DEC OH F500 75 EO JNZ R20 KEEP GOING F50f 5E POP 51 RECOVER CODE POINT POINTER F510 5F POP DI RECOYER REGEN POI NTER F!Hl 47 INC DI PO (NT TO NEXT CHARACTER F512 47 INC DI FBll E2 06 LOOP Rl. MORE TO WRI TE F515 E9 OF70 R JMP YIDEO_RETURN A-90 ROM BIOS FS18 R21 PROC NEAR F518 AC LODsS GET CODE POINT F519 SA EO MOV AH, AL COPV INTO AH FSIB 23 C3 AND AX, BX SET COLOR F510 "F6 C2 80 TEST DL, SOH XOR FUNCT ION? F520 74-07 JZ R22 NO, JUMP FS22 26 32 25 XOR AH, Es: [01] EXCLUSIVE OR WITH CURRENT DATA FS25 26 32 45 01 XOR AL,Es: [01+1] FS29 26 88 2S R22: MOV ES·[OI], AH STORE IN REGEN 8UFFER F52C 26 89 45 01 MOV ES:[DI+U,AL F530 C3 RET F~31 R21 ENDP F531 GRAPHI CS_WRI TE ENOP ; GRAPH I CS READ ---------------------------------------- F531 GRAPH I CS READ PRO·C NEAR F531 E8 F729 R CALL R5' CONVERTED TO OFFSET I N REGEN . FS34 88 FO MOV 51 I AX SAVE IN 51 F536 83 EC 08 SUB SP, e ALLOCATE SPACE TO SAVE THE READ CODE POINT FS39 SB EC MOV BP, SP PO INTER TO SAVE AREA DETERMINE GRAPHICS MODES FS38 06 PUSH ES FS3C B6 04 MOV CH,4 NUMBER OF PASSES F53E 80 3E 0049 R 06 CMP CRT_MODE, 6 F543 74 17 JZ R23 HIGH RESOLUTION F545 80 3E 0049 R 04 CMP CRT_MODE,4 F54A 74 61 JZ R28 MED I UM RESOLUT I ON F54C 80 3E 0049 R 05 CMP CRT_MODE,5 FS51 74 5A JZ R28 MED r UM RESOLUT 1 ON F553 80 3E 0049 R OA CMP CRT_MODE, OAH F558 74 53 JZ R28 MEDIUM RESOLUTION FS5A EB 18 JMP SHORT R25 LOW RESOLUT I ON HIGH RES-GLUTtON READ GET VALUES FROM REGEN BUFFER AND CONVERT TO CODE POI NT F55C IF R23, POP OS PO 1NT TO REGEN SEGMENT F550 8A 04 R24 MOV AL,[Sll GET FIRST BYTE F55F 88 46 00 MOV [BP], AL SAVE I N STORAGE AREA F562 45 1NC 8P NEXT LOCAT I ON F563 8A 84 2000 MOV AL, [SI+2()'()OH] GET LOWER REGION BYTE FS67 88 46 00 MOV [BP], AL ADJUST AND STORE F56A 45 INC BP F56B 83 C6 50 ADD 51,80 PO I NTER I NTO REGEN F56E FE CE DEC DH LOOP CONTROL F570 75 EB JNZ R24 00 J T SOME HORE F572 EB 6E JMP SHORT R31 GO MATCH THE SAVED CODE POINTS i LOW RESOLUTI ON READ F574 IF R2S, POP OS PO I NT TO REGEN SEGMENT F575 01 E6 SAL 51,1 OFFSET*4 SINCE 4 BYTES/CHAR FS77 01 E6 SAL SI,l FS79 E8 F6FC R R26: CALL R55 GET 4 BYTES FROM REGEN INTO 51 NGLE SAVE F57C 81 C6 2000 ADD SI,2000H GOTO LOWER REG ION FS80 E8 F6FC R CALL RSS GET 4 BYTES FROM REGEN INTO SINGLE SAVE F583 IE PUSH OS SAVE OS FS84 E8 138B R CALL DOS POINT TO BIOS DATA AREA FSB7 80 3E 0049 R 09 CMP CRT MODE, S DO WE HAVE A 32K REGEN AREA? F58C IF POP OS - FSSD 75 14 JNE R27 NO, JUMP FS'BF 81 C6 2000 ADD 51, 2000H GOTO LOWER REGION F593 E8 F6FC R CALL R55 GET 4 BYTES FROM REGEN INTO 51 NGLE SAVE F596 B 1 C6 2000 ADO 51 , 2000H GOTO LOWER ,REGION FS9A E8 F6FC R CALL R5S GET 4 BYTES FROM REGEN INTO SINGLE SAVE FS9D alEE 3FBO SUB S I , 4000H-SO ADJUST POINTER F5Al FE CE DEC OH FSA3 81 EE 1Feo .27 SUB SI, 2000H-BO ADJUST POINTER BACK TO UPPER FSA7 FE CE DEC DH FSA9 75 CE JNZ R26 ; DO IT SOME MORE FSAB EB 35 JMP SHORT R31 GO MATCH THE SAVED CODE PO I NTs MED I UM RESOLUT I ON READ F5AD ~28. MED _RES_READ FSAD IF POP OS POi"NT TO REGEN SEGMENT FSAE 01 E6 SAL 51,1 OFFSET*2 SI NCE 2 BYTES/CHAR F5BO EB F6C3 R R29 CALL R50 GET PAl R' BYTES FROM 'REGEN INTO 51 NGLE SAVE F5B3 81 C6 2000 ADD SI, 2000H GO TO LOWER REGlON FS97 EB F6e3 R CALL R50 GET THIS PAIR INTO SAVE F5BA IE PUSH OS SAVE OS FSBB E8 1389 R CALL DDS POINT TO BIOS OATA AREA F5BE 80 3E 0049 R OA CMF CRT_MOOE,OAH DO WE HAVE A 32K REGEN AREA? FSC3 IF POP OS F5C4 75 14 JNE R30 NO, .JUMP F5C6 81 C6 2000 ADD SI,2000H GOTO LOWER REGION F5CA E8 F6C3 R CALL R50 GET PAIR BYTES FROM REGEN INTO 51 NGLE SAVE FSCD e 1 C6 2000 ADD 51, 2000H GOTO LOWER REGION FSD 1 E8 F6C3 R CALL R50 GET PAIR BYTES FROM REGEN INTO SINGLE SAVE FSD4 81 EE 3F80 SUB S I , 4000H-80 ADJUST POINTER F5DS FE CE DEC DH FSDA R30 FSDA 81 EE 1FBO SUB 51, ZOOOH-BO ADJUST POINTER BACK INTO UPPER FSDE FE CE DEC DH F.5EO 7S CE JNZ R2. KEEP GOING 'UNTIL ALL BOONE ROM BIOS A-91 ; -------- SAVE AREA HAS CHARACTER IN IT, MATCH IT F!5E2 Rll; FIND_CHAR FSE2 33 CO .OR AX,AX F5E4 8£ 08 MOV DS,AX ESTA8L1SH ADDRESSING TO VECTOR ASSUME os: A850 FSES C4 3E 0110 R eES 01, CSET_PTR GET POINTER TO FIRST HALF FSEA 83 ED 08 SUB BP,a ADJUST POINTER TO BEGINNING OF SAVE AREA FSEo 88 F5 MOV SI,SP F5EF FC ceo ENSURE 0 I RECT I ON F5FO 32 CO .OR AL,AL CURRENT CODE POINT BEING MATCHED F5F2 16 R32: PUSH 55 ESTABLISH ADDRESSING TO STACK F5F3 iF POP DS FOR THE STRING COMPARE F!5F4 8A OOBO MOV OX, 128 NUMBER TO TEST AGAINST FSF7 56 R33: PUSH 51 SAVE AREA POINTER F5F8 57 PUSH DI SAVE CODE POI NTER F5F9 89 ODDS MOV CX,B NUMBER OF 8YTES TO MATCH F5FC F31 A6 REPE CMPSS COMPARE THE 8 BYTES F5FE 6F POP DI RECOVER THE POINTERS FSFF 5E POP 51 F600 74 IE JZ R34 JF ZERO FLAG SET, THEN MATCH OCCURRED F602 FE eo INC AL NO MATCH, MOVE ON TO NEXT F604 83 C7 08 AOD 01,8 NEXT CODE POINT F607 4A DEC OX LOOP CONTROL F60S 75 ED ~NZ R33 ; DO ALL OF THEM ; ------ CHAR NOT MATCHED, MIGHT BE I N SECOND HALF F60A OA CO OR AL, AL AL <) 0 I F ONL V 1ST HALF SCANNED F60e 74 12 ~E R34 IF = 0, THEN ALL HAS BEEN SCANNED F60E 28 eo SUB AX, AX F610 8E OS MOV OS, AX ESTABLI SH ADDRESSI NG TO VECTOR ASSUME os; ABSO F612 C4 3E 007C R LES 01, EXT_PTR GET POINTER F616 8C co MOY AX,ES SEE I F THE PO INTER REALL V EX I STS F61S DB e7 OR AX,DI IF ALL 0, THEN DOESN'T EXIST F61A 74 04 JZ R34 NO SENSE LOOK I NG F61C 80 SO MOV AL,12B ORIGIN FOR SECOND HALF F61E EB 02 JMP R32 GO 8ACK AND TRY FOR I T ASSUME os: DATA ; ------ CHARACTER IS FOUND ( AL=O I F NOT FOUND ) F620 S3 C4 08 R34; ADD SP,S READJUST THE STACK, THROW AWAY F623 F626 E9 OF70 R JMP GRAPH I CS_READ VIDEO_RETURN ENDP ; :~~K D~:~A F626 R3S PRDe NEAR F626 AC LODSB GET CODE POINT F627 £8 F67E R CALL R43 DOUBLE UP ALL THE BITS F62A 23 C3 R3G: AND AX,BX CONVERT THEM TO FOREGROUND COLOR (OBACK) F62C F6 C2 80 TEST DL, SOH IS THIS XOR FUNCTION? F62F 74 07 JZ R37 NO, STORE IT IN AS IT IS F631 26 32 25 .OR AH,ES [DIl DO FUNCTI ON WI TH HALF FS34 26 32 45 01 .OR AL, ES [01 +1] AND WI TH OTHER HALF F639 26 88 25 R37: MOV ES: [0 1,AH STORE FIRST BVTE F63B 26 88 45 01 MOV ES:[D +11,AL STORE SECOND BYTE F63F C3 RET F640 R35 ENOP F640 R3S PROC NEAR F640 £8 F6AO R CALL R45 ; QUAD UP THE LOW NIBBLE F643 E8 E5 JMP R3. F645 R38 ENOP ; EXPAND 1 DOT ROW OF A CHAR INTO 4 BYTES I N THE REGEN BUFFER F645 R39 PROC NEAR F645 AC LODSS GET CODE POINT F646 50 PUSH A. SAVE F647 51 PUSH C. F64S 81 04 MOV CL,4 MOV HJGH NIBBLE TO LOW F64A 02 EB SH" AL, CL F64C 59 POP C. F64D EB F640 R CALL "3. EXPAND TO 2 BVTES It PUT IN REGEN F650 58 POP A. RECOVER CODE POINT F651 47 INC 01 ADJUST REGEN POI NTER F652 47 INC DI F653 EB F640 R CALL R3. EXPAND LOW NI BBLE It PUT IN REGEN F6S6 4F DEC 01 RESTORE REGEN POINTER F657 4F DEC DI F65S C3 RET F659 R3. ENDP EXPAND_MED_COLOR THIS ROUTINE EXPANDS THE LOW 2 BITS IN BL TO FILL THE ENTIRE BX REGISTER ENTRY -- BL = COLOR TO BE USED ( LOW 2 BITS ) EXIT -- BX = COLOR TO BE USED ( 8 REPLICATIONS OF THE 2 COLOR BITS) A-92 ROM BIOS F659 R40 PROC NEAR F659 80 E3 03 AND Bl,3 ISOLATE THE COLOR BITS F65C 8A C3 HOV Al, Bl COPY TO Al F65E 51 PUSH ex SAVE REGISTER F65F 89 0003 HOV CX,3 NUMBER OF TIMES TO DO THIS F662 DO EO R41: SAL Al,l F664 DO EO SAL Al,l lEFT SHIFT BY 2 F666 OA 08 OR Bl, Al ANOTHER COLOR VERSION INTO Bl F668 E2 F8 lOOP R41 F I l l All OF Bl F66A SA F8 HOV BH, Bl F I l l UPPER PORT I ON F66C 59 POP ex REGISTER BACK F660 C3 RET ALL DONE F66E R40 ENOP EXPAND lOW COLOR THIS ROUTINE EXPANDS THE lOW 4 BITS IN Bl TO F i l l THE ENT I RE BX REG I STER ENTRV -- Bl = COLOR TO BE USED ( lOW 4 BITS J EXI T -- ex = COLOR TO BE USED ( 4 REPLI CAli ONS OF THE 4 COLOR BITS ) F66E R42 PROC NEAR F66E 51 PUSH ex F66F SO E3 OF AND Bl,OFH ISOLATE THE COLOR BITS F672 SA FB HOV SH,Sl COPV TO BH F674 B1 04 HOV Cl,4 MOVE TO HIGH NI8BlE F676 D2 E7 SHL BH, Cl FS78 OA FB OR BH, Bl MAKE BYTE FROM HI GH AND lOW NIBBLES F67A SA OF HOV Bl,SH F67C 59 POP ex F67D C3 RET All DONE F67E R42 ENOP EXPAND_BYTE THIS ROUTINE TAKES THE BYTE IN Al AND DOUBLES ALL OF THE BllS, TURNING THE 8 BITS INTO 16 BITS THE RESULT 1 S lEFT I N AX -- - -- ---- -- - ---- --- - ------- -- - -- - ---- -- ---- ; - F67E R43 PROC NEAR FS7E 52 PUSH OX SAVE REG I STERS F67F 51 PUSH ex F6BO 53 PUSH ax F6Bl 28 02 SUB DX, OX RESUL T REG 1 STER F683 99 0001 MOV ex, 1 MASK REGISTER F6e6 BB DB R44: MOV ex, AX BASE 1 NTO TEMP FS88 23 09 AND BX,CX USE MASK TO EXTRACT A BIT F6SA 08 03 OR DX,BX PUT INTO RESULT REG I STER F6BC 01 EO SHl AX, 1 FSBE 01 El sHl CX,l SHI FT BASE AND MASK BY 1 F690 BB 08 MOV ex, AX SASE TO TEMP FS92 23 09 AND BX, CX EXTRACT THE SAME BIT F694 OB 03 OR OX, ax PUT INTO RESULT F696 01 E1 SHl ex, 1 SHIFT ONLY MASK NOW, MOVING TO NEXT BASE F69S 73 EC R44 USE MASK BIT COMING OUT TO TERMINATE F69A BB C2 MOV AX, ox RESULT TO PARM REGISTER F6ge 5B POP ex F69D 59 POP ex RECOVER REGI STERS F69E 5A POP ox F69F C3 RET All DONE F6AO R43 ENOP EXPAND_NIBBLE THIS ROUTINE TAKES THE lOW NIBBLE IN Al AND QUADS ALL OF THE BITS, TURNING THE 4 BITS INTO Hi BITS. THE RESULT IS lEFT IN AX F6AO R45 PRoe NEAR F6AO 52 PUSH ox ; SAVE REGISTERS F6Al 33 02 XOR OX, OX ; RESUL T REG I STER FSA3 AS 08 TEST Al,8 FSA5 74 03 JZ R4. F6A7 80 CE FO OR DH,OFOH FSAA AS 04 R46; TEST Al,4 F6AC 74 03 JZ R47 F6AE BO CE OF OR DH, OFH FGB1 A8 02 R47 TEST Al,2 FSB3 74 03 JZ R48 FGB5 80 eA FO OR Dl,OFOH FGBS A8 01 R4B; TEST AL,l F6BA 74 03 JZ R4' F6BC 80 CA OF OR Dl, OFH FS8F 88 C2 R4S: MOV AX, DX RESUL T TO PARM REG I STER F6Cl 5A POP ox RECOVER REG I STERS F6C2 C3 RET All DONE F6C3 R4S ENDP ROM BIOS A-93 HED_READ_BYTE THIS ROUTINE WILL TAKE 2 SYTES FROM THE REGEN BUFFER, COMPARE AGAI NST THE CURRENT FOREGROUND COLOR, AND 'PLACE THE CORRESPONDING ON/OFF BIT PATTERN INTO THE CURRENT POSt TI ON I N THE SAVE AREA ENTRY -- SI, OS= 'POINTER TO REGEN AREA OF INTEREST ex = EXPANDED FOREGROUND COLOR BP = POINTER TO SAVE AREA EXI T -- BP 15 I NCREMENT AFTER SAVE F6e3 R50 PROC NEAR F6C3 SA 24 MOV AH,[Sl) GET FIRST BYTE F6es SA 44 01 MOV AL, [SI+1) GET SECOND BYTE FSCS IE PUSH OS SAVE OS F6e9 E8 138B R CALL DDS POINT TO BIOS DATA AREA F6ec 80 3E 0049 R OA CMP eRT_MODE,OAH IN 640X200 4 COLOR MODE? F6D1 IF POP OS RESTORE REGEN SEG F6D2 75 11 JNE R52 , NO, JUMP IN 640X200 4 COLOR MODE, ALL THE cO BI TS ARE 'IN ONE BYTE I AND ALL THE el BITS ARE IN THE NEXT BYTE. HERE WE CHANGE THEM BACK TO NORMAL cleO ADJA.cENT PAIRS_ F604 53 PUSH ex SAVE REG FSDS B" OOOS MOV CX, B SET LOOP COUNTER F6nS DO FC R5l: SAR AH, 1 cO -BIT J NTO CARRY F6DA 01 DB ReR BX, 1 AND INTO ax F6De DO FB SAR AL, 1 e 1 BIT J NTO CARRY F6DE 01 DB ReR BX, 1 AND INTO ex F6EO E2 F6 LOOP RS1 REPEAT F6E2 8B C3 MOV AX,eX RESUL T I NTO AX F6E4 5B POP BX RESTORE ex F6ES B9 cooo R52: MOV ex, aeaDOH 2 BIT MASK TO TEST THE ENTRIES F6EB 32 02 XOR DL, D_L RESULT REGISTER F6EA 85 C1 R53: TEST AX,CX 15 TH-IS SECTION BACKGROUND? F6EC 74 01 JZ 054 IF ZERO I IT 15 BACKGROUND F6EE F" STC WASN '-T I SO SET CARRY F6EF DO 02 R54- OCL DL, 1 MOVE: THAT BIT INTO THE RESULT F6F1 01 E9 SHR eX,1 F6F3 o 1 £9 SHR CX,1 MOVE THE MASK TO THE RIGHT BY 2 BITS F6F5 73 F3 JNC R53 DO IT AGAIN IF MASK -DIDN'T FALL OUT FSF7 aa 56 00 MOV [BP1,DL STORE RESULT I N SAVE AREA F6FA 45 INC BP ADJUST POI NTER F6FS C3 RET ALL DONE F6'FC R50 ENOP LOW READ BYTE THIS ROUTINE WILL TAKE 4 BYTES FROM THE REGEN BUFFER, COMPARE FOR BACKGROUND COLOR, AND PLACE THE CORRESPONDI,NG ON/OFF BIT PATTERN INTO THE CURRENT POSI TI ON IN THE SAVE AREA ENTRY -- SI,DS = POINTER TO REGEN AREA OF INTEREST BP ::: PO I-NTER TO SAVE AREA EXI T -- BP 15 I NCREMENT AFTER SAVE F6FC PROC NEAR FSFC 811, 24 MOV AH, [SI) ; GET FIRST 2 BVTES F6FE 811, 44 01 MOV AL, [51+1) F701 32 02 XOR Dt, DL F703 E8 F714 R CALL R56 ;BUILD HIGH NIBBLE F706 SA 64 02 MOV AH. CSI+.21 ; GET SECOND .2 BYTES F709 SA 44 03 MOV AL, [51 +3] F70C E8 F714 R CALL R56 ;BUILD LOW NIBBLE F70F 88 56 00 MOV CBP], DL j STORE RESULT I N SAVE AREA F712 45 INC BP ;ADJUST POINTER F713 C3 RET F714 R55 ENDP F714 R56 PROC NEAR F714 89 FOOO MOV CXIOFOOOH 4 81 T -MASK TO TEST THE ENTRI ES F717 B5 C1 R57: -TEST AX, CX I.S THI S SECTJ ON BACKGROUND? F719 74 01 JZ R5B IF ZERO, IT IS BACKGROUND F7lB F9 STC ; WASN'T, SO SET CARRY F71C DO 02 R5B: RCL DL, 1 iMOVE THAT BIT INTO RESULT F7lE D 1 E9 SHR ex, 1 jMOVE MASK RIGH 4 BITS F720 D 1 E9 SHR eX,1 F722 01 E9 SHR eX,1 F724 D 1 E9 SHR CX, I F72G 73 EF JNC R57 ; DO IT AGAIN IF MASK DID'T FALL OUT F728 C3 RET F729 R56 ENDP A-94 ROM BIOS V4_POSI TI ON THIS ROUTINE TAKES THE CURSOR POSITION CONTAINED IN THE MEMORY LOCATION, AND CONVERTS IT INTO AN OFFSET INTO THE REGEN BUFFER, ASSUMING ONE BYTE/CHAR. FOR MEDI UM RESOLUTION GRAPHICS, THE NUMBER MUST BE DOUBLED. ENTRV -- NO REG I STERS, MEMORY LOCATI ON CURSOR_POSN I S USED EXIT-- AX CONTAINS OFFSET INTO REGEN BUFFER ~~;-----;;~~----~~;;---------------------- F729 F729 Al 0050 R MOV AX, CURSOR_POSN GET CURRENT CURSOR F72C GRAPH_POSN LABEL NEAR F72C 53 PUSH BX SAVE REGISTER F720 88 08 MOV BX, AX SAVE A COpy OF CURRENT CURSOR F72F aA C4 MOY AL, AH ; GET ROWS TO AL F731 F6 26 004A R MUL BVTE PTR CRT _COLS ; MULTI PL V BV aYTES/COLUMN F735 ao 3E 0049 R 09 CMP CRT_MODE,9 MODE USING 32K REGEN? F73A 73 02 JNC R&O YES, .JUMP F73C 01 EO SHL AX,l MULTIPLV * 4 SINCE 4 ROWS/BYTE F73E Dl EO R60: SHL AX,I F740 2A FF SUB 8H,8H ISOLATE COLUMN VALUE F742 03 C3 ADD AX,BX DETER""I NE OFFSET F744 5B POP BX RECOVER PO I MTER F745 C3 RET ALL DONE F746 059 ENDP LIGHT PEN TH! S ROUTI NE TESTS THE LIGHT PEN SWI TCH AND THE LI GHT PEN TRIGGER. IF BOTH ARE SET, THE LOCATION OF THE LIGHT PEN IS DETERMINED. OTHERWISE, A RETURN WITH NO INFORMATION IS MADE. ON EXIT: (AH) ;;; a IF NO LIGHT PEN INFORMATION IS AVAILABLE SX, CX, DX ARE DESTROVED (AH) 1 IF LIGHT PEN IS AVAILABLE (DH,DU ;;; ROW, COLUMN OF CURRENT LIGHT PEN POSITION (CH) ;;; RASTER POSITION (8X) ;;; BEST GUESS AT PIXEL HORIZONTAL POSITION ASSUME CS: CODE, DS: DATA ; ----- SUBTRACT_TABLE F746 Y1 LABEL BYTE F746 03 03 05 05 03 03 DB 3,3,5,5,3,3,3,0,2,3,4 03 00 02 03 04 F751 READ_LPEN PROC NEAR ; ----- WAIT FOR LI GHT PEN TO BE DEPRESSED F751 32 E4 XOR AH, AH ; SET NO LI GHT PEN RETURN CODE F753 SA 03DA MOV OX, VGA_CTL ; GET ADDRESS OF VGA CONTROL REG F756 EC IN AL, OX ; GET STATUS REGISTER F757 AS 04 TEST AL,4 ; TEST LIGHT PEN SWITCH F7159 74 03 JZ V7B F75B E9 F803 R JMP V6 ; NOT SET, RETURN ; ----- NOW TEST FOR LIGHT PEN TRIGGER F7SE A8 02 V7S: TEST AL,2 TEST L t GHT PEN TR J CGER F760 75 03 JNZ Y7A RETURN WI THOUT RESETTI NG TRI GGER F762 E9 F80D R JMP '17 ; ----- TR I GGER HAS BEEN SET, READ THE VALUE t N F765 B4 10 V7A: MOV AH,16 ; LIGHT PEN REGISTERS ON 6845 INPUT REGS POINTED TO BV AH, AND CONYERT TO ROW COLUMN IN OX F767 BB 16 0063 R MOV OX, ADDR_6S45 ADDRESS REGISTER FOR 6845 F76B SA C4 HOY AL, AH REGISTER TO READ F76D EE OUT OX, AL SET IT UP F76E 42 INC Ox DATA REGISTER F76F EC IN AL,DX GET THE VALUE F770 8A E8 MOV CH, AL SAVE IN CX F772 4A DEC ox ADDRESS REGISTER F773 FE C4 INC AH F775 SA C4 MOY AL, AH SECOND DATA REGI STER F777 EE OUT DX.AL F778 42 INC ox POINT TO DATA REGISTER F779 EC IN AL,DX GET SECOND DATA VALUE F77A 814 E5 MOV AH, CH • AX HAS I NPUT VALUE ; ----- AX HAS THE YALUE READ I N FROM THE 6945 F'77C aA IE 0049 R MOV BL, CRT_MODE F780 2A FF SUB BH, BH MODE VALUE TO BX F782 2E: 8A 9F F746 R MOV BL,CS:VHBX) DETERMI NE AMOUNT TO SUBTRACT F787 2B C3 SUB AX, BX TAKE IT AWAV F789 3D OFAO CNP AX, 4000 IN TOP OR BOTTOM BORDER? F7aC 72 02 JB '115 NO, OKAY F'78E 33 CO )CDR AX, AX VES, SET TO ZERO F790 88 IE 004E R Y15: NOV BX, CRT_START F794 01 E9 SHR BX,I F796 29 C3 SUB AX, BX CONYERT TO CORRECT PAGE ORI GIN F798 79 02 JNS '12 IF POSITIVE, DETERMINE MODE F79A 28 CO SUB AX, AX ; (0 PLAYS AS 0 ; ----- DETERMINE MODE OF OPERATION F79C Y2: DETERMINE MODE F7eC 81 03 MOV CL,3 SET _8 SHIFT COUNT F79E 80 3E 0049 R 04 CMP CRT_MODE,4 DETERMINE IF GRAPHICS OR ALPHA F7A3 72 414 JB '14 ALPHA_PEN ; ----- GRAPH I CS MODE F'7A5 B2 28 MOY OL,40 DIVISOR FOR GRAPHICS F7A7 80 3E 0049 R 09 CNP CRT_MODE,9 US I NG 32K REGEN? F7At 72 02 JB V20 NO, JUMP F7AE B2 50 MOV DL, SO YES, SET RIGHT DIYSOR F7BO F6 F2 V20: 01'1 DL DETERMINE ROW(AU AND COLUMN(AH) AL RANGE 0-99, AH RANGE 0-39 ROM BIOS A-95 DETERMINE GRAPHIC ROW pos TION F7B2 BA ES MOV CH, AL SAVE ROW VALUE INCH F784 02 ED ADD CH, CH *2 FOR EVEN/ODD FI ELD F706 80 JE 0049 R 09 CMP CRT_MODE, 9 USI NG 32K REGEN? F7eB 72 06 ,J8 V21 NO, JUMP F7eD 00 EC SHR AH, 1 AD,JUST ROW Be COLUMN F7BF 00 EO SHl AL, 1 F7Cl 02 EO ADD CH, CH *4 FOR 4 SCAN LI NES F7e3 SA DC V2l MOV eL, AH COLUMN VALUE TO BX F7C5 2A FF SUB BH, BH MUL TI PL V BY S FOR MED I UM RES F7C7 80 3E 0049 R 06 eMP CRT MODE, S DETERMINE MEDIUM OR HIGH RES F7ec 72 15 JB V3 - MODE 4 OR 5 F7eE 77 06 V23 MODE 8, 9, OR A FlDO Bl 04 V22· MOV CL,04 SH I FT VALUE FOR HIGH RES F702 DO E4 SAL AH,l COLUMN VALUE TIMES 2 FOR HIGH RES F704 EB 00 ~MP SHORT V3 FlD6 80 3E 0049 R 09 V23: eMP CRT_MODE,9 CHECK MODE F70S 77 F3 ~A V22 MODE A F70D 74 04 ~E V3 MODE 9 F7DF 81 02 MOV CL,2 MODE 8 SHIFT VALUE F7El DO EC SHR AH,l F7E3 V3: NOT_HI GH_RES F7E3 03 E3 SHL BX,CL MULTIPLY *16 FOR HIGH RES DETERMINE ALPHA CHAR POSITION F7E5 SA 04 MOV DL, AH COLUMN VALUE FOR RETURN F7E7 SA FO MOV DH, AL ROW VALUE F7E9 DO EE SHR DH, 1 DIVIDE BY 4 F7EB DO EE SHR DH, 1 FOR VALUE IN 0-24 RANGE F7EO EB 12 ...IMP SHORT V5 LIGHT _PEN_RETURN_SET ; ALPHA MODE ON LI GHT PEN F7EF V4: ; ALPHA_PEN F7EF F6 36 004A R DIV BYTE PTR CRT_eOLS DETERMINE ROW, COLUMN VALUE F7F3 8A FO MOV OH, AL ROWS TO DH F7F5 SA 04 MOV Dl, AH COlS TO DL F7F7 02 EO SAL AL, CL MULTIPLY ROWS * B FlF9 a4 ES MOV CH, AL GET RASTER VALUE TO RETURN REG F7FB BA DC MOV BL, AH COLUMN VALUE F7FD 32 FF )(OR BH, eH TO ex F7FF 03 E3 SAL ex, CL FaOl V5 LIGHT _PEN_RETURN_SET FaOl 84 01 MOV AH,l INDICATE EVERYTHING SET FB03 V6 LIGHT _PEN_RETURN F803 52 PUSH DX SAVE RETURN VALUE (I N CASE) FS04 S8 16 0063 R MOV ox, AODR_6Bo45 GET BASE ADDRESS Faoa 83 C2 07 ADD OX,7 POI NT TO RESET PARM Fa08 EE OUT ox,AL ADDRESS, NOT DATA, IS IMPORTANT FBOC 5A POP OX RECOVER VALUE FeOD V7: RETURN_NO_RESET F80D 5F POP DI FBOE 5E POP 51 FSOF IF POP D5 DISCARD SAVED BX, CX,DX FBtO IF POP D5 FSll IF POP D5 FB12 IF POP D5 FB 13 07 POP ES FB 14 CF I RET FB15 READ_LPEN ENDP TEMPORARY INTERRUPT SERVI CE ROUTI NE 1 THIS ROUTINE IS ALSO LEFT IN PLACE AFTER THE POWER ON DIAGNOSTICS TO SERVICE UNUSED I NTERRUPT VECTORS LOCAT I ON I I NTR_FLAG' WI LL CONTAIN EITHER: 1. LEVEL OF HARDWARE INT. THAT CAUSED CODE TO BE EXEC 2 'FF' FOR NON-HARDWARE INTERRUPTS THAT WERE EXECUTED ACC I DENTL Y. ; -------------------------------------------------------- FBtS o 11 PROC NEAR ASSUME 05: DATA FBt5 IE PUSH OS FBlS 50 PUSH AX SAVE REG AX CONTENTS FBll E8 1388 R CALL DDS FatA 80 08 MOV AL,OSH READ I N-SERV J CE REG F8lC E6 20 OUT INTAOO, AL (FINO OUT WHAT LEVEL BEING Fe tE 90 NOP SERVI C£D) FatF E4 20 IN AL,INTAOO GET LEVEL F821 SA EO MOV AH, AL SAVE IT FB23 OA C4 OR AL, AH OO? (NO HARDWARE ISR ACTIVE) F825 75 04 ~NZ HW INT FB27 B4 FF MOV AH:-OFFH FS29 Ea OA JMP SHORT SET I NTR FLAG SET FLAG TO FF IF NON-HDWARE F82B E4 21 AL,INTAOl- - GET MASK VALUE FB2D OA C4 OR AL,AH ; MASK OFF LVL BEING SERVICED F82F ES 21 OUT INTAOl, AL F831 80 20 MOV AL, EOI F833 E6 20 OUT INTAOO, AL F835 FB35 BB 26 0084 R MOV I NTR_FLAG I AH SET FLAG F839 58 POP AX RESTORE REG AX CONTENTS FS3A IF POP OS FB3a FB STI I NTERRUPTS BACK ON FB3C DUMMY RETURN NEED I RET FOR VECTOR TABLE F83C CF - IRET FS3D D 11 ENDP A-96 ROM BIOS --- I NT 12 --------------------------------- MEMORY SIZE DETERMINE INPUT - - NO REG I STERS THE MEMORY SIZE VARIABLE IS SET DURING POWER ON DIAGNOSTICS OUTPUT - (A)() = NUMBER OF CONTI GUOUS 1K BLOCKS OF MEMORY ASSUME CS: CODE, OS: DATA FB41 ORG OF841H FB41 MEMORY_SIZE_DETERMINE PROC FAR FB41 FB STl I NTERRUPTS BACK ON FB42 IE PUSH DS SAVE SEGMENT FB43 B8 ---- R MOV AX, DATA ESTABLISH ADDRESSING F846 BE DB MOV DS,AX F848 Al 0013 R MOV AX, MEMORY_51 ZE GET VALUE FB4B IF POP DS RECOVER SEGMENT FS4C CF IRET RETURN TO CALLER FB4D MEMORY_51 ZE_DETERMI NE ENDP ; --- I NT 11 ------------------------------------ EQUIPMENT DETERMINATION THIS ROUTINE ATTEMPTS TO DETERMINE WHAT OPTIONAL DEVICES ARE ATTACHED TO THE SYSTEM. INPUT NO REGISTERS THE EQUIP_FLAG VARIABLE IS SET DURING THE POWER ON DIAGNOSTICS USING THE FOLLOWING HARDWARE ASSUMPTIONS: PORT 62 (0-)3) = LOW ORDER BYTE OF EQUIPMENT PORT 3FA :;: I NTERRUPT I D REGI STER OF 8250 SITS 7-3 ARE ALWAYS a PORT 379 = OUTPUT PORT OF PRINTER -- 8255 PORT THAT CAN BE READ AS WELL AS WRI TTEN OUTPUT (AX) IS SET, BIT SIGNIFICANT, TO INDICATE ATTACHED 1/0 BIT 15,14 = NUMBER OF PRINTERS ATTACHED BIT 13 = 1 = SERIAL PRINTER ATTACHED BIT 12 = GAME 1/0 ATTACHED BIT 11,10,9 = NUMBER OF R5232 CARDS ATTACHED BIT 8 0 = OMA CHI P PRESENT ON SYSTEM, 1 = NO DMA ON SVSTEM BIT 7,6 = NUMBER OF DISKETTE DRIVES 00=1, 01=2, 10=3. 11=4 ONLY IF BIT 0 = I BIT 5,4 = INITIAL VIDEO MODE 00 - UNUSED 01 - 40X25 BW USING COLOR CARD 10 - 80X25 BW US I NG COLOR CARD 11 - 80X25 OW USING BW CARD BIT 3,2 = PLANAR RAM 51 ZE (10=48K, 11=64K) BIT 1 NOT USED BIT 0 = 1 (IPL DISKETTE INSTALLED) NO OTHER REG ISTERS AFFECTED ASSUME CS; CODE, OS: DATA FS4D ORG OF84DH FS4D EQUIPMENT PRoe FAR FB4D FB STl 1 NTERRUPTS BACK ON F84E lE PUSH DS SAVE SEGMENT REGISTER FB4F aB ---- R MOV AK, DATA ESTABLISH ADDRESSING FS52 8E DB MOV OS,AX F854 Ai 0010 R MOV AX, EQUIP_FLAG GET THE CURRENT SETTI NGS FBS7 iF POP DS RECOVER SEGMENT FSSS CF IRET RETURN TO CAllER FBS9 EQUIPMENT ENDP ; --- I NT 15 ---------------------------------------------------- CASSETTE 1/0 (AH) o TURN CASSETTE MOTOR ON (AH) 1 TURN CASSETTE MOTOR OFF (AH) 2 READ 1 OR MORE 256 BYTE BLOCKS FROM CASSETTE (E5, ax) ;; POINTER TO DATA BUFFER (ex) = COUNT OF BYTES TO READ ON EXIT (ES, BX) = PO I NTER TO lAST BYTE READ + 1 (OX) COUNT OF BYTES ACTUALL V READ (CV) 0 [F NO ERROR OCCURRED 1 I F ERROR OCCURRED (AH) ERROR RETURN IF (CY)= 1 = 01 IF CRe ERROR WAS DETECTED ;; 02 IF DATA TRANSITIONS ARE lOST = 04 IF NO DATA WAS FOUND (AH) 3 WRI TE I OR MORE 256 BYTE BLOCKS TO CASSETTE (£5, ax) = POINTER TO DATA BUFFER (CX) = COUNT OF BYTES TO WRITE ON EXIT (EX,BX) = POINTER TO LAST BYTE WRITTEN + 1 (C)() = 0 (AH) = ANV OTHER THAN ABOVE VALUES CAUSES (CY) = 1 AND (AH) = BO TO BE RETURNED (I NVALI 0 COMMAND L ASSUME OS: DATA, ES; NOTHING, 55; NOTHI NG, CS: CODE F8S9 ORG OF859H F859 CASSETTE_I 0 PROC FAR FS!59 FB STI I NTERRUPTS BACK ON FSSA lE PUSH OS ESTABLISH ADDRESSING TO DATA Fess EB 1389 R CALL DDS FS5E BO 26 0071 R 7F AND BIOS_BREAK, 7FH MAKE SURE BREAK FLAG IS OFF F86l EB FS6A R CALL WI CASSETTE_IO_CONT FB66 iF POP DS FSS7 CA 0002 RET 2 I NTERRUPT RETURN FB6A CASSETTE_I 0 ENDP F86A W1 PROC NEAR ROM BIOS A-97 PURPOSE; TO CALL APPROPRIATE ROUTINE DEPENDING ON REG AH AH ROUTINE MOTOR ON MOTOR OFF READ CASSETTE BLOCK WRITE CASSETTE BLOCK F8GA OA E4 OR AH,AH TURN ON MOTOR? FSSe: 74 13 JZ MOTOR_ON YES, DO IT F86E FE CC DEC AH TURN OFF MOTOR? F870 74 18 JZ MOTOR OFF YES, DO IT FB72 FE e:C DEC AH - READ CASSETTE BLOCK? F874 74 lA JZ READ_BLOCK YES, DO IT F87S FE CC DEC AH WRI TE CASSETTE BLOCK? FS7S 75 03 JNZ W2 NOT_DEFI NED FS7A E9 F997 R JMP WRITE_BLOCK YES, DO IT F87D W2: COMMAND NOT OEFI NED FS7D 84 80 MOV AH,OBOH ERROR, UNDEFINED OPERATION F87F F9 STC ERROR FLAG F8BO C3 RET FH81 WI ENDP FBSI MOTOR_ON PRoe NEAR ~ -;~;;~~~~------------------------------ TO TURN ON CASSETTE MOTOR FBBI E4 61 IN AL,PORT_B READ CASSETTE OUTPUT F883 24 F7 AND AL, NOT OBH CL.EAR BIT TO TURN ON MOTOR FB8S E6 61 W3: OUT PORT_B. AL WRITE IT OUT FS87 2A E4 SUB AH, AH CLEAR AH F889 C3 RET FOBA MOTOR_ON ENDP FBBA MOTOR_OFF PROC NEAR ~ -;~~;~;~~------------------------------- TO TURN CASSETTE MOTOR OFF FSBA E4 61 IN AL, PORT_B READ CASSETTE OUTPUT F8BC De: DB OR AL,OBH ; SET BIT TO TURN OFF FaDE EO F5 JMP W3 ; WR ITE IT, CLEAR ERROR, RETURN F890 MOTOR OFF ENDP FOgO READ_BLOCK PROC NEAR PURPOSE: TO READ 1 OR MORE 256 BYTE BLOCKS FROM CASSETTE ON ENTRY; ES J S SEGMENT FOR MEMORY BUFFER (FOR COMPACT CODE) BX POINTS TO START OF MEMORY BUFFER CK CONTAINS NUMBER OF BYTES TO READ ON EXIT: BX POINTS 1 BYTE PAST LAST BYTE PUT IN MEM C)( CONTAINS DECREMENTED BYTE COUNT DX CONTAINS NUMBER OF BYTES ACTUALLY READ CARRY FLAG I S CLEAR I F NO ERROR DETECTED CARRY FLAG I S SET IF CRC ERROR DETECTED Fe90 53 PUSH 8X SAVE BX F891 51 PUSH CX SAVE CX FS92 56 PUSH SI SAVE 51 F893 BE 0007 MOV 51, 7 SET UP RETRY COUNT FOR LEADER FS9S E8 FA50 R CALL BEGIN_OP BEGIN BY STARTING MOTOR FS9S W4: SEARCH FOR LEADER FB99 E4 62 IN AL, PORT_C GET INITIAL VALUE FB9S 24 10 AND AL,010H MASK OFF EXTRANEOUS SITS Fa9D A2 006B R MOV LAST_VAL, AL SAVE IN LOC LAST_VAL F8AO SA 3F7A MOV OX, 16250 • OF TRANS I TI ONS TO LOOK FOR FBA3 W5: WA I T_FOR_EDGE FBA3 F6 0& 0071 R 80 TEST BIOS_BREAK, 80H CHECK FOR BREAK KEY F8AB 75 03 JNZ W6A JUMP I F NO BREAK KEY .JUMP I F BREAK KEY HIT FOAA 4A DEC DX FBAS 75 03 JNZ W7 JUMP tF BEGINNING OF LEADER FBAD E9 F92F R W6A: JMP W17 .JUMP I F NO LEADER FOUND FB90 EO F96F R W7: CALL READ _HALF _9 I T IGNORE FIRST EDGE FOB3 E3 EE JCXZ W5 .JUMP IF NO EDGE DETECTED F8B5 BA 0378 MOV DX,0378H CHECK FOR HALF BI TS FOSB 99 0200 MOV CK,200H MUST HAVE AT LEAST THIS MANY ONE 51 ZE PULSES BEFORE CHCtcNG FOR SYNC BIT (0) FBBS FA CLI o I SABLE INTERRUPTS FBBC WO: SEARCH-LOR FOSC F6 06 0071 • SD TEST BIOS_BREAK, 80H CHECK FOR BREAK KEY F8CI 75 SC JHZ W17 JUMP I F BREAK KEY HI T FBC3 51 PUSH CX SAVE REG ex F8C4 EB F96F R CALL READ _HALF _8 I T GET PULSE WIDTH Foe7 00 C9 OR CX, ex CHECK FOR TRANSITION F8C9 59 POP CX RESTORE ONE B IT COUNTER FBCA 74 CD JZ W4 JUMP IF NO TRANSITION FBCC 3B D3 CMP DX,BK CHECK PULSE WID TH F8CE E3 04 JCXZ W9 IF ex=o THEN WE CAN LOOK FOR SYNC BIT (0) FBDO 73 C7 JNe W4 JUMP IF ZERO BIT CNOT GOOD LEADER) FSD2 E2 E8 LOOP W8 DEC ex AND READ ANOTHER HALF ONE SIT FBD4 W9: FIND-SYNC F8D4 72 £6 JC W8 JUMP IF ONE BIT (STILL LEADER) A-98 ROM BIOS A SYNCH BIT HAS BEEN FOUND READ SVN CHARACTER· FBDS EB F96F R CALL READ _HALF _B IT SKIP OTHER HALF OF SYNC BIT (0) FeD9 EB F941 R CALL READ_BYTE READ SYNC BYTE F8DC 3C 16 CMP AL, ISH SYNCHRON I ZAT I ON CHARACTER F8D"E 75 49 JNE W!S ; JUMP I F BAD LEADER FOUND. GOOD CRC 50 READ DATA BLOCK( 5) FeED 5E POP 51 RESTORE REGS FaEl 59 POP CX FBE2 59 POP BX READ ! OR MORE 256 BYTE BLOCKS FROM CASSETTE ON ENTRY: ES IS SEGMENT FOR MEMORV BUFFER (FOR COMPACT CODE) 8)( POINTS TO START OF MEMORY BUFFER CX CONTAINS NUMBER OF BYTES TO READ ON EXIT: BX POI NTS 1 BVTE PAST LAST BYTE PUT IN MEM CX CONT A I NS DECREMENTED BYTE COUNT OX CONTAINS NUMBER OF BvTES ACTUALLY REAO FBE3 51 PUSH CX SAVE BYTE COUNT FSE4 WlO: COME HERE BEFORE EACH 256 BYTE BLOCK 1 S READ FBE4 C7 06 0069 R FFFF MOV CRC_REG,OFFFFH INIT CRC REG FBEA SA 0100 MOV DX,256 SET OX TO DATA BLOCK SIZE FBED Wl!: RD BLK FaED F6 06 0071 R 80 TEST BIOS_BREAK, aOH CHECK FOR BREAK KEV FBF2 75 23 JNZ W13 JUMP IF BREAK KEY HIT F8F4 E8 F941 R CALL READ_BYTE READ BYTE FROM CASSETTE FeF7 72 lE JC W13 CY SET INDICATES NO DATA TRANSITIONS FBFS E3 05 JCXZ W12 IF WE'VE ALREADY REACHED END OF MEMORY BUFFER SK I P REST OF BLOCK F8FB 2S: 88 07 MOV ES: rBX], AL STORE DATA B·VTE AT BYTE PTR F8FE .3 INC BX I NC BUFFER PTR FeFF 4. DEC CX , DEC BYTE COUNTER FSOO W12: ; LOOP UNTIL DATA BLOCK HAS BEEN READ FROM CASSETTE F900 4A DEC DX DEC BLOCK CNT F901 7F EA JG W11 RD BLK F903 E8 F941 R CALL READ_BYTE NOW READ TWO CRC BYTES F90S Ea F941 R CALL READ BYTE FSOS 2A E4 SUB AH,AH CLEAR AH F9DS 81 3E 0069 R lOOF CMP CRe_REG, lDOFH 1.5 THE CRe CORRECT? F9ll 75 06 JNE WI. I F NOT EQUAL CRC I S BAD F913 E3 06 JCXZ W15 J F BYTE COUNT I S ZERO THEN WE HAVE READ ENOUGH SO WE WILL EXI T F915 EB CD JMP WI0 STI LL HORE, SO READ ANOTHER BLOCk F917 Wl3: MISSING-DATA NO DI\TA TRANSITIONS SO F917 84 01 MOV AH,OIH SET AH=02 TO INDICATE DATA TIMEOUT FSl9 W14: BAD-CRC FSI9 FE C4 INC AH EXI T EARLY ON ERROR SET AH=Ol TO INDlCATE CRe ERROR F918 Wl5: RD-BlK-EX F9lB 5A POP DX CALCULATE COUNT OF F9lC 28" 01 SUB ox, cx OATA BYTES ACTUALLY READ RETURN COUNT I N REG OX FS1E 50 PUSH AX SAVE Ax (RET CODE) F9IF F6 C4 SO TEST AH, 90H CHECK FOR ERRORS F922 75 13 JNZ WIB JUMP IF ERROR DETECTED F924 EB F941 R CALL READ BYTE REAO TRAI LER F927 EB OE JMP SHORT W18 SK I P TO TURN OFF HOTOR F929 WIS· BAD-LEADER F92S 4E DEC 51 CHECK RETR I ES F92A 74 03 JZ W17 JUMP I F TOO MANY RETR I ES F92C E9 FB99 R JMP W4 JUMP IF NOT TOO MANY RETRIES F92F Wl7: ; NO VALl 0 DATA FOUND ; ----- NO DATA FROM CASSETTE ERROR, I. E. Tl MEOUT F92F 5E POP 51 RESTORE REGS F930 59 POP ex RESTORE REGS F931 59 pap BX F932 2B 02 SUB ox, OX ZERO NUMBER OF BYTES READ F934 84 04 MOV AH,04H TIME OUT ERROR (NO LEADERl F936 50 PUSH AX F937 W!8: MOT-OFF F937 FB 5Tl REENABLE INTERRUPTS F93B E8 FaaA R CALL TURN OFF MOTOR F93B 58 POP AX RESTORE RETURN CODE F93C BO FC 01 CHP AH, O!H SET CARR V IF ERROR (AH>OI F93F F5 CMC F940 C3 RET FINISHED F94! READ_BLOCK ENDP ROM BIOS A-99 PURPOSE: TO READ A BYTE FROM CASSETTE ; ON EXIT REG AL CONTAINS READ DATA BYTE --------------------------------------- F94! READ BYTE PROC NEAR FS41 53 - PUSH BX SAVE REGS BX, CX F942 51 PUSH CX F943 81 08 MOV CL,8H SET BIT COUNTER FOR a BITS F945 1.119; BVTE-AsM F945 51 PUSH CX SAVE CX ; ------------------------------- ; READ DATA 8IT FROM CASSETTE F946 EB F96F R CALL READ _HALF _81 T READ ONE PULSE F949 E3 20 JCXZ W21 IF CX=O THEN TI MEOUT BECAUSE OF NO OAT A TRANS I T IONS F948 53 PUSH BX SAVE 1ST HALF BIT is PULSE WIDTH 0_3E 60 00 FC66 78 ce oe 18 30 00 DB 078H, OCCH, OOCH, 0 18H, 030H, OOOH, 030H, OOOH ? 0_3F 30 00 FC6E 7C e6 OE DE OE CO DB 07eH, OC6H, OOEH, OOEH, OOEH, oeOH, 078H, OOOH (!I o_40 78 00 FC76 30 78 CC CC Fe ce DB 030H, 078H, oceH, oeCH, OFCH, oeCH, OCCH, OOOH A 0_41 CC 00 FC7E FC 66 66 7C 66 66 DB OFCH, 066H, OS6H, 07CH, 066H, OS6H, OFCH, OOOH 8 D_42 FC 00 Fe86 3e 66 CO CO CO 66 DB 03CH, 06SH, OCOH, oeOH, OCOH, 06SH, 03eH, OOOH C D_43 3C 00 FC8E F8 6C 66 66 66 6C DB OFSH, 06CH, 06SH, 066H, OSSH, 06CH, OFBH, OOOH 0 D_44 F8 00 FC96 FE 62 68 78 68 62 DB OFEH, 062H, 068H, 07BH, OSSH, 062H, OFEH, OOOH E D_ 45 FE 00 Fe9E FE 62 68 78 68 60 DB OFEH, 062H, 068H, 078H, 06SH, 060H, OFOH, OOOH F D_46 Fa 00 FCA6 3C 66 CO co CE 66 DB 03CH, OSGH, oeOH, OCOH, OCEH, 066H, 03EH, OODH G ()~47 3£ 00 FeAE ee ce CC FC CC ec DB oceH, OCCH, OCCH, OFCH, OCCH, OCCH, OCCH, OOOH H D_48 ee 00 Fe86 78 30 30 30 30 30 DB 078H, 030H, 030H, 030H, 030H, 030H, 07SH, OOOH I 0_49 78 00 FceE lE oe OC oe ec cc DB DIEH, OOCH, OOCH, OOCH, OCCH, eeCH, 078H, OOOH ..J 0_4A 7S 00 fce6 E6 66 6e 78 6e 66 DB DEGH, 06SH, 06CH, 078H, 06eH, 06SH, OE6H, OOOH K o_48 £6 00 FeeE FO 60 60 60 62 66 DB OFOH, OSOH, OSOH, 060H, 062H, 066H, OFEH, OOOH L D_4C FE 00 Feos C6 EE FE FE D6 C6 DB OC6H, OEEH, OFEH, OFEH, 006H, OCSH, OCSH, OOOH M 0_40 e6 00 FCDE C6 E6 1="6 DE CE C6 DB OC6H, OEGH, OF6H, ODEH, OCEH, oe6H, OCSH, OOOH N 0_4E C6 00 FCE6 38 se C6 C6 C6 6e DB 03BH, OSCH, OC6H, OC6H, OC6H, 06CH, 03SH, OOOH a D_4F 3S 00 A-I04 ROM BIOS FCEE FC 66 66 7C 60 60 DB OFCH, 066H, OS6H, 07CH, 060H, 060H, OFOH, OOOH P D_50 FO 00 FeF6 78 CC CC CC DC 78 DB 079H, OCCH, OCCH, OCCH, OOCH, 078H, 01CH, OOOH Q 0_51 Ie 00 FCFE FC 66 66 7C 6C 66 DB OFCH, 066H, 066H, 07CH, 06CH, 066H, OESH, OOOH R 0_52 E6 00 F006 78 CC EO 70 lC CC DB 078H, OCCH, OEOH, 070H, 01CH, OCCH, 078H, OOOH SO_53 78 00 FDOE Fe 84 30 30 30 30 DB OFCH, 084H, 030H, 030H, 030H, 030H, 078H, OOOH T D_54 78 00 FD IS ce ec cc cc CC CC DB OCCH, oceH, oeCH, OCCH, OCCH, OCCH, OFCH, OOOH U 0_55 Fe 00 FDIE ec ee ce cc CC 78 DB OCCH, OCCH, OCCH, OCCH, OCCH, 078H, 030H, OOOH v 0_56 30 00 FD26 C6 C6 C6 06 FE EE DB oeSH, OC6H, aeSH, OOSH, OFEH, OEEH, OCSH, OOOH W 0_57 C6 00 F02E C6 C6 GC 38 38 6C DB OC6H, OCSH, 06CH, 038H, 038H, 06eH, OC6H, OOOH X D_58 C6 00 F036 CC CC CC 78 30 30 DB OCCH, OCCH, oceH, 078H, 030H, 030H, 078H, OOOH V o_59 7a 00 F03E FE C6 ae 18 32 66 DB OFEH, OC6H, 08CH, a 18H, 032H, 066H, OFEH, OOOH Z D_SA FE 00 F046 78 60 60 60 SO 60 DB 078H, 060H, 060H, 060H, 060H, OSOH, 078H, 0001-1 [0_58 78 00 FD4E CO 60 30 18 DC 06 DB OCOH, 060H, 030H, a 18H, OOCH, 006H, 002H, OOOH 02 00 FOS6 78 18 18 18 18 18 DB i BACKS LASH _5C ° 078H,018H,018H,018H,018H,018H,078H,000H ) o_50 78 00 FD5E 10 38 SC C6 00 00 DB o 10H, 038H, 06CH, OC6H, OOOH, aOOH, OOOH, OOOH 00 00 j CIRCUMFLEX 0_5E FOG6 00 00 00 00 00 00 DB OOOH, OOOH, OOOH, OOOH, OOOH, OOOH, OOOH, OFFH _ D_5F 00 FF FOSE 30 30 18 00 00 00 DB 030H, 030H, 018H, OOOH, OOOH, OOOH, OOOH, OOOH 0_60 00 00 F076 00 00 78 DC 7C CC DB OOOH, OOOH, 078H, OOCH, 07CH, oceH, 076H, OOOH 76 00 j LOWER CASE A 0_61 F07E EO SO 60 7C 66 66 DB OEOH, 060H, 060H, 07CH, 066H, 066H, ODCH, OOOH LC 8 0_62 DC 00 FOS6 00 00 78 cc co ce 08 OOOH, OOOH, 078H, OCCH, OCOH, OCCH, 078H, OOOH LC C 0_63 78 00 FOBE lC OC DC 7e ce ec DB OlCH, OOCH, OOCH, 07CH, OCCH, oeCH, 076H, OOOH LC 0 0_64 76 00 F09S 00 00 78 ee Fe co 08 OOOH, OOOH, 078H, OCCH, OFCH, OCOH, 078H, OOOH LC E 0_S5 78 00 F09E 38 6e 60 FO 60 60 08 03BH, 06CH, 060H, orOH, 060H, 060H, OFOH, OOOH LC F o_66 FO 00 FOA6 00 00 76 ec ec 7C DB OOOH, OOOH, 076H, OCCH, OCCH, 07eH, OOCH, OFSH LC G 0_67 OC FB FOAE EO 60 6e 76 66 66 DB OEOH, 060H, 06CH, 076H, 066H, 066H, OESH, OOOH LC H 0_S8 E6 00 FOB6 30 00 70 30 30 30 DB 030H, OOOH, 070H, 030H, 030H, 030H, 078H, OOOH LC I 0_69 79 00 FOBE OC 00 oe oc DC CC 08 OOCH, OOOH, OOCH, OOCH, OOCH, OCCH, oceH, 078H LC J 0_6A CC 79 FDes EO 60 66 6e 78 6e 08 OEOH, 060H, 066H, 06CH, 07BH, 06eH, OE6H, OOOH LC K o_68 E6 00 FOCE 70 30 30 30 30 30 DB 070H, 030H, 030H, 030H, 030H, 030H, 07BH, OOOH LC L D_6C 78 00 FODS 00 00 CC FE FE OS DB OOOH, OOOH, OCO-l, OFEH, OFEH, 006H, OC6H, OOOH LC M o_60 CS 00 FOOE 00 00 F8 CC ec ce 08 OOOH, OOOH, OF8H, OCCH, OCCH, OCCH, OCCH, OOOH LC N 0_6E cc 00 FOE6 00 00 79 CC CC CC DB OOOH, OOOH, 078H, OCCH, OCCH, OCCH, 078H, OOOH LC a 0_6F 79 00 FOEE 00 00 DC 66 66 7C DB OOOH, OOOH, OOCH, 066H, 066H, 07CH, 060H, OFOH LC P 0_70 SO FO FDF6 00 00 76 CC CC 7C DB OOOH, OOOH, 076H, OCCH, OCCH, 07CH, OOCH, 01EH LC Q 0_71 DC IE FDFE 00 00 oe 76 66 60 DB OOOH, OOOH, ODCH, 076H, 066H, 060H, OFOH, OOOH LC R 0_72 FO 00 FE06 00 00 7C CO 78 OC 08 OOOH, OOOH, 07CH, OCOH, 078H, OOCH, OF8H, OOOH LC 5 0_73 F8 00 FEOE 10 30 7C 30 30 34 08 010H, OJOH, 07CH, 030H, 030H, 034H, 01BH, OOOH LC T 0_74 19 00 FE16 00 00 CC CC CC CC DB OOOH, OOOH, OCCH, OCCH, OCCH, OCCH, 076H, OOOH LC U 0_75 76 00 FE1E 00 00 Cc CC CC 78 DB OOOH, OOOH, OCCH, OCCH, OCCH, 078H, 030H, OOOH LC V 0_76 30 00 FE26 00 aD C6 06 FE FE DB OOOH, OOOH, OC6H, 006H, OFEH, OFEH, OBCH, OOOH LC W o_77 Be 00 FE2E 00 00 C6 6C 38 6C DB OOOH, OOOH, oe6H, 06CH, 039H, 06CH, OC6H, OOOH LC X 0_78 C6 00 FE36 00 00 CC CC CC 7C DB OOOH, OOOH, OCCH, OCCH, OCCH, 07CH, OOCH, OFSH LC V 0_79 OC F9 FE3E 00 00 FC 98 30 S4 08 OOOH, OOOH, OFCH, 09BH, 030H, 064H, OFCH, OOOH LC Z 0_7A FC 00 FE46 1C 30 30 EO 30 30 08 01eH, 030H, 030H, OEOH, 030H, 030H, 0 lCH, OOOH {0_7B Ie 00 FE4E 18 18 18 00 IS 18 DB 018H, 018H, OlSH, OOOH, 01SH, 018H, DISH, OOOH D_7C IS 00 FE56 EO 30 30 1C 30 30 08 OEOH, 030H, 030H, 01CH, 030H, 030H, OEOH, OOOH } D_70 EO 00 FE5E 76 DC 00 00 00 00 DB 076H, OOCH, OOOH, OOOH, OOOH, OOOH, OOOH, OOOH - 0_7E 00 00 FE66 00 10 38 6C CS C6 DB OOOH, 010H, 038H, 06CH, OC6H, OC6H, OFEH, OOOH FE 00 ROM BIOS A-lOS FESE ORG OFE6EH FESE E9 1393 R JMP NEAR PTR TIME_OF _DAY CRC CHECK/GENERATI ON ROUTI NE ROUTINE TO CHECK A ROM MODULE USING THE POLYNOMIMAL X 16 + X 12 + X5 + 1 CALLI NG PARAMETERS: OS:; OAT A SEGMENT OF ROM SPACE TO BE CHECKED 51 :; INDEX OFFSET INTO OS POINTING TO 1ST BYTE ex = LENGTH OF SPACE TO BE CHECKED (I NCLUD I NG CRe BYTES) ON EXI T· ZERO FLAG :; SET :; CRC CHECKED OK AH 00 AL .,..., ax :; 0000 CL = 04 ox = 0000 IF CRC CHECKED OK, ELSE, ACCUMULATED CRC 51:; (SI(ENTRY)+BX(ENTRV) NOTE: ROUTINE WILL RETURN JMMEDIATLY IF "RESET_FLAG IS EQUAL TO "1234H" (WARM START) FE71 ~RC_CHECK PROC NEAR ASSUME OS: NOTHING FE?l BB 09 MOV ex, CX SAVE COUNT FE73 BA FFFF MOV OX,OFFFFH INIT. ENCODE REGISTER fE76 FC CLD SET DIR FLAG TO INCREMENT FE77 32 E4 XOR AH, AH I NIT. WORK REG HI GH fE79 Bl 04 MOV CL,4 SET ROTATE COUNT FE7B FE7C AC 32 FO CRC - to LOOSB XOR DH, AL GET A BVTE FORM AJ + CJ + 1 FE7E 8A C6 MOV AL,DH FEBO 03 CO ROL AX, CL SHI FT WORK REG BACK 4 FEB2 33 DO XOR DX,AX ADD INTO RESULT REG FES4 01 CO ROL AX,l SHIFT WORK REG BACK 1 FEBS 86 F2 XCHG DH.DL SWAP PART I AL SUM INTO RESULT REG FE8S 33 DO XOR ox. AX ADD WORK REG INTO RESULTS FEBA 03 C8 ROR AX,CL S~IFT WORK REG OVER 4 FEse 2. EO AND AL, 11100000B CLEAR OFF (EFGH) FE8E 33 DO XOR ox, AX ADO (ABCD) I NTO RESULTS FE90 01 C8 ROR AX, 1 SHIFT WORK REG ON OVER (AH:;O FOR NEXT PASS) FE92 32 FO XOR DH,AL ADO (ABCO INTO RESULTS LOW) FE94 48 DEC 8X DECREMENT COUNT FE9S 75 E4 JNZ CRC 1 LOOP TI LL COUNT = 0000 FE97 DB 02 OR ox, DX OX SIB:; 0000 IF o. K FE99 C3 RET RETURN TO CALLER FESA CRC_CHECK ENDP SUBROUTINE TO READ AN 8250 REGISTER. MAY ALSO BUMP ERROR REPORTER (BU AND lOR REG OX (PORT ADDRESS) DEPENDING ON WHICH ENTRY POINT 15 CHOSEN. THIS SUBROUTINE WAS WRITTEN TO AVOID MULTlPLE USE OF 110 TIME DELAYS FOR THE 8250 IT WAS THE MOST EFFICIENT WAY TO I NCLUDE THE DELAVS. I N EVERY CASE, UPON RETURN, REG AL WI LL CONTAI N THE CONTENTS OF PORT< OX I FE9A RR1 PROC NEAR FE9A 32 CO XOR AL, AL FE9C EE OUT OX, AL D J SABLE ALL INTERRUPTS FE9D FE C3 INC BL BUMP ERROR REPORTER FESF '2 RR2: INC DX J NCR PORT ADDR FEAO EC RR3: IN AL, OX READ REG I STER FEAl C3 RET FEA2 RR1 ENDP TH 15 ROUTI NE HANDLES THE TI MER I NTERRUPT FROM CHANNEL 0 OF THE 9253 TIMER. INPUT FREQUENCY IS 1.19318 MHZ AND THE DIVISOR IS 65536, RESULTING IN APPROX IB.2 INTERRUPTS EVERV SECOND THE INTERRUPT HANDLER MAINTAINS A COUNT OF INTERRUPTS SINCE POWER ON TIME, WHICH MAY BE USED TO ESTABLISH TIME OF DAY. INTERRUPTS MISSED WHILE INTS. WERE DISABLED ARE TAKEN CARE OF BY THE USE OF T I MER 1 AS A OVERFLOW COUNTER THE INTERRUPT HANDLER ALSO DECREMENTS THE MOTOR CONTROL COUNT OF THE DISKETTE, AND WHEN IT EXPIRES, WILL TURN OFF THE DISKETTE MOTOR, AND RESET THE MOTOR RUNNING FLAGS THE INTERRUPT HANDLER WILL ALSO INVOKE A USER ROUTINE THROUGH INTERRUPT lCH AT EVERV TIME TICK. THE USER MUST CODE A ROUTINE AND PLACE THE CORRECT ADDRESS IN THE VECTOR TABLE. FEA5 ORG OFEA5H ASSUME OS: DATA FEA5 FEA5 F8 - TIMER INT ST! PROC FAR I NTERRUPTS BACK ON FEA6 1E PUSH OS FEA7 50 PUSH AX FEA8 52 PUSH DX SAVE MACHI NE STATE FEA9 E8 1388 R CALL DDS FEAC FF 06 DOGe R INC TIMER_LOW INCREMENT TIME ,. FEBO 75 04 4NZ T" TEST DAY FEB2 FF 06 006E R INC TIMER_HIGH INCREMENT HIGH WORD OF TIME FEB6 T4. TEST _DAV FEB6 83 3E 006E R CMP TIMER_HIGH,018H TEST FOR COUNT EQUALLI NG 24 HOURS FEBB 7. 4NZ OISKETTE_CTL FEBD " 81 3E OOSC R OOBO CMP T' TI HER_LOW, oaOH 01 SKETTE_CTL FEe3 7. DO 4NZ T' A-106 ROM BIOS T I MER HAS GONE 24 HOURS FEes 2. CO SUB AX, AX FEe7 .3 006E R MOY TIMER_HIGH, AX FECA .3 a06e R MOV TI MER_LOW, AX FECO C6 06 0070 R 01 MOY TIMER_OFL,1 j TE5T FOR DI'SKETTE TIME OUT FED2 T5, LOOP TILL ALL OYERFlOWS TAKEN CARE OF FED2 FE OE 0040 R DEC FEDS 75 OS JNZ RETURN I F COUNT NOT OUT FEDB 80 26 003F R FO AND ~~TOR_STATUS, oroH j TURN OFF MOTOR RUNN I NG BITS FEDD 80 80 MOV AL, FOC_RESET TURN OFF MOTOR, 00 NOT RESET FDC FEDF E6 F2 OUT NEC_CTL, AL TURN OFF THE MOTOR FEEl CO lC T6- INT lCH TRANSFER CONTROL TO A USER ROUT I NE FEE3 80 20 MOV -AL, EOJ FEES E6 20 OUT 020H, AL END OF I NTERRUPT TO 8259 FEE7 5. POP OX FEES 58 POP AX FEES 1F POP OS RESET MACHI NE STATE FEEA CF IRET RETURN FROM INTERRUPT FEEB TIKER_INT ENDP ARITHMETl C CHECKSUM ROUTI NE ENTRY; DS ::: DATA SEGMENT OF ROM SPACE TO aE CHECKED 51 ::: INDEX OFFSET INTO OS POINTING TO 1ST BYTE C)( :::: LENGTH OF SPACE TO BE ,CHECKED EXIT: ZERO FLAG OFF:ERROR, ON::: SPACE CHECKED OK ~~~-~~~~;;~~----;;~~----~~~~------------------------------~----- FEES FEES 02 O. RC o· ADD AL, DS: [51] FEEO .6 - INC 51 FEEE E2 FB LOOP FEro OA co OR FEF2 C3 RET FEF3 ROS_CHECKSUM ENDP THESE ·ARE THE VECTORS WHI CH ARE MOYED INTO ; THE -8086 I Nl"ERRUPT AREA OUR I NG PQWER ON. ; ONLY THE OFFSETS ARE DISPLAVED HERE, CODE i SEGMENT WILL BE AD-OED FOR ALL OF THEM, EXCEPT , WHERE NOTED ASSUME CS: CODE FEF3 ORG OFEF3H FEF3 VECTOR TABLE LABEL W.oRD. YECTOR TABLE FOR MOVE TO 1 NTERRUPTS FEF3 FEA5 R - ow OFFSET TI MER_I NT ; I,NTERRUPT S FEFS 1561-R ow OFFSET KB- I NT INTERRUPT 9 FEF7 F815 R ow OFFSET 011 I NTERRUPT -A FEFS FalS R ow OFFSET 011 INTERRUPT B FEFS FBlS R ow OFFSET D 11 INTERRUPT C FEFD Fe 15 R ow OFFSET 011 INTERRUPT 0 FEFF EF57 R ow OFFSET DISK I NT INTERRUPT E FrOl FelS R ow OFFSET D 11- INTERRUPT F FF03 aDOS R ow OFFSET VIDEO_IO • INTERRUPT 10H FF05 F84D R ow OFFSET EQU I PMENT i INTERRUPT llH FF07 F-S41 R ow OFFSET MEMORY_51 ZE_DETERMI NE , INTERRUPT 12H fF09 EC59 R ow OFFSET 0 I SKETTE_I a i INTERRUPT 13H FFOB E739 R ow OFFSET RS232_I-O ; INTERRUPT 14H FfOD FSS9 R ow CASSETTE_I 0 ; INTERRUPT 15H FFOF 1300 R ow OFFSET KEVBOARD_IO ; INTERRUPT 16H Ff 11 EFD2 R ow ·OFFSET P.R I NTER_I a i INTERRUPT 17H FF 13 0000 ow ODOOOH I NTERRUPT ISH ow OF600H , MUST BE I NSERTED I NTO TABLE .LATER FFlS OBIS R ow OFFSET BOOT _STRAP , INTERRUPT 19H FF 17 1393 R ow TIME OF DAV INTERRUPT 1AH -- TIME OF DAV FF 19 Fe3C R ow DUMMV_RETURN I NTERRUPT ISH -- KEVBD BREAK ADDR FFIB FS3C R ow DUMMV RETURN INTERRUPT Ie -- ·TIMER BREAK ADOR FF 10 FOA4 R ow YID_EO=PARMS I INTERRUPT 10 -- YIDEO PARAMETERS FF IF EFC7 R ow OFFSET 0 15K_BASE ; I NTERRUPT IE -- 0 I SK PARMS FF21 EaSE R ow CRT CHARH INTERRUPT IF -- YIOEO EXT FF23 P MSG PRoe NEAR FF23 2E: SA 04 G12A· MOV AL, CS: [51] PUT CHAR IN AL FF26 46 lNC SI POI NT TO NEXT CHAR FF27 50 PUSH AX SAVE PRINT CHAR FF2S E8 ISBA R CALL PRT_HEX CALL VI DEO 10 FF2B 58 POP AX RECOVER PR"INT CHAR FF2C 3C OD CMP AL,13 WAS 1 T -CkRRAGE RETURN? FF2E 75 F3 JNE G12A NO, KEEP PRINTING STRING FF30 C3 RET FF31 ENDP "ROUTI NE TO SOUN~ BEEPER FFal BEEP PROC NEAR FF31 80 86 MOY AL, 1.01101108 SEL TIM 2, LSB, MSB, BINARV FF33 E6 43 OUT TIMER+3, AL WR ITE THE TI MER MODE REG FF35 B8 0533 HOY AX, 533H oI VI 50R FOR 1000 HZ FF3B E6 42 OUT TlMER+2, AL WRITE TIMER 2 CNT - Lse FF3A SA C4 MOV AL, AH FF3C E6 42 OUT TIMER.+2, AL WRITE TIMER 2 CNT - MS8 FF3£ £4 61 IN AL, PORT_8 GET CURRENT SETTI NG OF PORT FF40 SA EO MaY AH, AL SAVE THAT SETTING FF42 OC 03 OR AL,03 TURN SPEAKER ON FF44 E6 61 OUT PORT _B, AL FF-46 28 C9 SUB ex, ex SET CNT TO W'AIT ,500 MS FF4S E2 FE G7: LOOP G7 DELAV BEfORE TURNING OFF FF4A FE C8 DEC BL DELAV CNT EXPIRED? FF4C 75 FA JNZ G7 NO - CONTI'NUE BEEP I NG SPK FF4E SA C4 MOY AL, AH RECOYER - VALUE OF PORT FF50 E6 61 OUT PORT_8, AL FF52 C3 RET RETURN TO CALLER FF53 BEEP ENDP ROM BIOS A-t07 FF53 ORG OFF53H FF53 CF IRET tNT 5 --------------------------------------------------------- THIS LOGIC WILL BE INVOKED BY INTERRUPT QSH TO PRINT THE SCREEN. THE CURSOR POS I T I ON AT THE T I ME TH IS ROUT I NE IS INVOKED WILL BE SAVED AND RESTORED UPON COMPLETION. THE ROUTINE IS INTENDED TO RUN WITH INTERRUPTS ENABLED. IF A SUBSEQUENT 'PRINT SCREEN KEV I S DEPRESSED DURING THE TIME THIS ROUTINE IS PRINTING IT WILL BE IGNORED. ADDRESS 50: 0 CONTAINS THE STATUS OF THE PRINT SCREEN: 50: 0 =0 EITHER PRI NT SCREEN HAS NOT BEEN CALLED OR UPON RETURN FROM A CALL THI SIND I CATES A SUCCESSFUL OPERATION. =1 PR 1 NT SCREEN I SIN PROGRESS =OFFH ERROR ENCOUNTERED DURING PRINTING ASSUME CS; CODE, DS: XXDATA FF54 ORG OFF!54H FF54 PRINT SCREEN PROC FAR FF54 FB - STI MUST RUN WI TH I NTERRUPTS ENABLED FFS5 lE PUSH DS MUST USE 50; 0 FOR DATA AREA STORAGE FF56 50 PUSH AX FFS7 53 PUSH BX FF58 51 PUSH CX WILL USE THIS LATER FOR ·CURSOR LIMITS FF59 52 PUSH OX WILL HOLD CURRENT CURSOR POSITION FF5A B8 ---- R MOV AX, XXDATA HEX 50 FF5D BE 08 MOV DS,AX FF5F 80 3E 0000 R 01 CMP STATUS_BVTE, 1 SEE IF PRINT ALREADV IN PROGRESS FF64 74 SF JZ EXIT ..lUMP IF PRI NT ALREADV 1 N PROGRESS FF66 C6 06 0000 R 01 MOV STATUS_BVTE, 1 I ND I CATE PR I NT NOW I N PROGRESS FF6B 84 OF MOV AH,15 WI LL REQUEST THE CURRENT SCREEN MODE FF6D CD 10 INT 10H [AL]=MODE [AH]=NUMBER COLUMNS/LINE i [BH]=VISUAL PAGE ** •• ** •••• *.************ •••• ** •• *.* •••• *.tI.**.**.******tI** AT THIS POINT WE KNOW THE COLUMNS/LINE ARE IN [AX] AND THE PAGE IF APPLICABLE IS IN [BH]. THE STACK HAS DS,AX,BX,CX,DX PUSHED. [All HAS VIDEO MODE ftH*** •• _H* •••••••• _••• **_ ••• **.** __ •• *****.*_***.******_** FF6F SA CC MOV CL, AH WI LL MAKE USE OF [CX] REG I STER TO FF71 85 19 MOV CH,25 CONTROL ROW. COLUMNS FF73 E8 FA5F R CALL CRLF CARRIAGE RETURN LINE FEED ROUTINE FF16 51 PUSH CX SAVE SCREEN BOUNDS FF77 84 03 MOV AH,3 WiLL NOW READ THE CURSOR. FF79 CD 10 INT 10H AND PRESERVE THE POSITION FF7B 59 POP CX RECALL SCREEN BOUNDS FF7C 52 PUSH DX RECALL [BH]=VISUAL PAGE FF7D 33 02 XOR DX,DX ; WILL SET CURSOR POSITION TO [0,0] *******-**--**._*._._*****.**** •••• *.*****.***._*********••• **. THE LOOP FROM PRl10 TO THE INSTRUCTION PRIOR TO PRI20 IS THE LOOP TO READ EACH CURSOR POSITION FROM THE SCREEN AND PRINT. FF7F 84 02 ; •••• fI* ••• PRJ 10; HOY _*fI_**_****_.**.*****fI************** AH,2 •• ***H •• **fI"****** TO INDICATE CURSOR SET REQUEST FFBI CD 10 INT 10H NEW CURSOR POSITION ESTABLISHED FFS3 84 08 MOV AH, B TO I ND I CATE READ CHARACTER FFB5 CD 10 INT 10H CHARACTER NOW IN [AL] FFS7 OA CO OR AL, AL SEE IF VALID CHAR FF89 75 02 ..INZ PRIIS ,JUMP IF VALID CHAR FF8B SO 20 HOY AL ' , HAKE A BLANK FF8D 52 PRllS; PUSH DX' SAVE CURSOR POSITION FF8E 33 D2 XOR DX,DX INDICATE PRINTER 1 FF90 32 E4 XOR AH,AH TO INDICATE PRINT CHAR IN [All FF92 CD 17 I NT 17H PR I NT THE CHARACTER FF94 5A POP DX RECALL CURSOR POSITION FF9S F6 C4 29 TEST AH,029H TEST FOR PRINTER ERROR FF98 75 21 ..INZ ERR 10 ..lUMP I F ERROR DETECTED FF9A FE C2 INC DL ADVANCE TO NEXT COLUMN FF9C 3A CA CMP CL,DL SEE IF AT END OF LINE FF9E 75 DF ..INZ PRII0 IF NOT PROCEED FFAO 32 D2 XOR DL, DL BACK TO COLUMN 0 FFA2 SA E2 HOY AH,DL [AH]=O FFA4 52 PUSH DX SAVE NEW CURSOR POSITION FFA5 EB FA5F R CALL CRLF LINE FEED CARRIAGE RETURN FFAB .A POP OX RECALL CURSOR POSITION FFA9 FE C6 J Ne DH ADVANCE TO NEXT LINE FFAB 3A EE CMP CH,DH FINISHED'? FFAD 75 DO JNZ PRII0 IF NOT CONTINUE FFAF 5A POP OX RECALL CURSOR POSITION FFBO 84 02 MOV AH,2 TO I ND I CATE CURSOR SET REQUEST FFB2 CD 10 INT 10H CURSOR POSITION RESTORED FFB4 C6 06 0000 R 00 MOV STATUS_BVTE,O INDICATE FINISHED FF09 EB OA ..IMP SHORT EX I T EX I T THE ROUT I NE FFBB 5A ERRI0: POP DX GET CURSOR POSITION FFBt 84 02 HOY AH,2 TO REQUEST CURSOR SET FFeE CD 10 INT 10H ; CURSOR POSITION RESTORED Freo C6 06 0000 R FF HOV STATUS_BVTE,OFFH i INDICATE ERROR FFe5 5A EXIT; POP DX RESTORE ALL THE REGISTERS USED FFe6 59 POP CX FFC7 5B POP ax FFee 5B POP AX FFC9 IF POP DS FFCA CF IRET FFee PRINT_SCREEN ENDP A-I08 ROM BIOS EASE OF USE REYECTOR ROUTI NE - CALLED THROUGH INT IBH WHEN CASSETTE BASIC IS INVOKED (NO DISKETTE NO CARTRIDGES) KEVBOARD VECTOR IS RESET TO POINT TO "NEW INT 9" BASIC YECTOR IS SET TO POINT TO F600:0 - - FFCB BAS_ENT PROC FAR ASSUME OS: ABSO FFeB 2B co 5UB AX,AX FFCD BE D8 "OV OS, AX ; SET ADDRESSING FFCF C7 06 0024 R 1937 R "OY WORD PTR INT_PTR+4, OFFSET NEW_INT_9 FFD5 A3 0060 R "OY BASIC_PTR,AX ; SET INT 18=F600;O FFD8 C7 06 0062 R F600 "OV BASIC_PTR+2,OF600H FFDE CD 18 INT I8H ; GO TO BASI C FfEO BAS_ENT ENDP INITIALIZE TIMER SUBROUTINE - ASSUMES BOTH THE LSB AND MSB OF THE TIMER WILL BE USED. CALLING PARAMETERS; (AH) = TIMER. CAL) = BIT PATTERN OF INITIALIZATiON WORD (BX) = INITIAL COUNT CBH) = M58 COUNT CBL) = LSB COUNT ALTERS REGI STERS OX AND AL. FFEO i NIT_TI MER PROC NEAR FFEO E6 43 OUT TIM_CTl, AL. OUTPUT I NI TI AL CONTROL. WORD FFE2 BA 0040 "OY OX, TIMER BASE PORT AODR FOR TI "ERS FFE5 02 D4 ADD Ol,AH ADD IN THE TIMER. FFE7 SA C3 "OY Al, BL LOAD LSB FFE9 EE OUT OX, AL FFEA 52 PUSH OX PAUSE FFEB 5A POP OX FfEe SA C7 MOY AL, BH LOAO MSB FFEE EE OUT OX, AL FFEF C3 RET FFFO INIT_TIMER ENOP POWER ON RESET YECTOR FFFO ORG OFFFOH ; ----- POWER ON RESET FFFO EA DB OEAH ; ,JUMP FAR FFFl 0043 R OW OFFSET RESET FFF3 FOOO OW OFOOOH FFF5 30 36 2F 30 31 2F DB '06/01/83 • REL.EASE MARKER 38 33 FFFD FF DB OFFH FilLER FFFE FD DB OFDH SYSTEM IDENTIFIER DB OFFH CHECKSUM FFFF ~ODE ENDS END ROM BIOS A-109 Notes: A-110 ROM BIOS Appendix B. LOGIC DIAGRAMS Contents System Board ............................ . B-3 Program Cartridge ........................ B-20 Power Supply Board. . . . . . . . . . . . . . . . . . . . . .. B-23 64KB Memory and Display Expansion ........ B-25 Color Display ............................ B-29 Diskette Drive Adapter. . . . . . . . . . . . . . . . . . . .. B-30 Internal Modem .......................... B-36 Parallel Printer Attachment ................. B-37 Infra-Red Receiver Board ................... B-42 Graphics Printer .......................... B-43 Compact Printer .......................... B-47 Logic Diagrams 8-1 Notes: B-2 Logic Diagrams 11 10 8 l b 5 4 2 K , --(')+5V K UL 13-D02 ..-.=-",H"",,_ _ _ .,_,_ n--'-~-"-'--"~H.,;,:o-------------=-"'---IHOLD '-" 1Q11( OHM SR 8-C02 >-"'''-H'L-_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _'-'----iNH! ,,--< TEST r -_ _-""'s-----j INTR ~I -CARTRIDGE: RESET J ~v HVU- % ," I J r-t---~'..'_____I"" , +5V~ rt------"C"---I 'L< fii OHM 10K OHM 82i"i'A ' 610 OHM ~AO" 2 ,''1LS81> ~~"~~U'F ~RES Xlf-'-"'--+~'Cj'W'~''-, ~ :2 tM 0. 3. 13 FIe X2r''''-4=-'',"!I''f:'-'-d-t 51" OHM· ~_ ~AD' f----!!- AD:2 AI' f---"'''-'tt-++tt---"-'--i H [:--CSYNC .....- ~AD3 A" f---';"-;tt--I!-+H--'--;--i H ~~ASYNtl'l8 '" f----'-'-tt--"r-tH-'---I RDYf--2'---'------1 J~ N.C·_SF'I rH-H+-"-'-'---I '" A 15 18 .,. OHM ROY! CLKf---"---'------#I rtt-I+t!---">cO--1' D , 'I ~RDY2 RSTf---!''''-------t r-t---"-'---IAENl osc ~ 1,14---2- AI3----2-.., Al1~ ~ G ~AE:N2 PCLI(f----"~+_----, Al1~ G vee GNO " Ol-~'-+H+h ~ ;.qL.SI25 • s ,. ZMt3 F F +5'V~-,'1un-'! I ''i~Tb5 . CLR , :2 ZMl , L- A 2-- ~ ~ Bf---''''----, ~ ~ E I -"-- i----'-'--- ~ ~ ~ D r--"-' D 14LS12 L.!.--OIR >---"-"",.',,"--",,'T'-'"'--_1'8'----I'", T&: 'I-DIlI:2 UN 1 3-002 >---""'"',,'----1""---j,", a'f---"-'--'_ _ +~-Z-M-"~~'~~~~~!-''-''---"'-""'-"-"'""-"'"'-1T","_-l''--'--I'"' SF 8-JI---"",,,,,,N~'----r''---I'"' D'f---"'----f------++++ I I' YF 15-G02 .-"D"""""-E1,-,T___ '--O,,,NT'-'"'-1""----I'" D'f----"''----f-----+-t-tl UP 13-C02 r-l''''"''-''----1'''-_j,R> D'f-2S'----f----+-t D'f--"'----f---4 B B A A 11 10 8 1 b 5 4 2 System Board (Sheet 1 of 17) System Board B-3 11 I 10 I I 8 I l I b I 5 I 4 I I 2 K K - J r-~'~--------------~~~'~A' r-~'--------------~~~~'~" o.'-----'-'-~--~ D'~ D2L---!.L r------'-''''-~,. MK3Sl1l00 J r-----------H+H+H+~,s~~" D3~ ,------"'--1" r---------ftHtHt~'~'~A' ,-----"-'---1 A ' - - . - - - - - - , - A3 ,--------~+H+H+HI_"o.e'____I". "f----"-,-'-t+fttf I ,--------4+tt+tt+tt+H',,'~, " N f----" ,,-'-t+H+t+ ,-----"'---j" H A8 1-FI1l2 ~AA..-----"'___j r--------ffi-tH+HI+tI+-=-'-1'" "r---"2-'-t+H+Hf Dl •••• 1.~ H ~ r------~++I-tHH+I+tf"""'___jA " ,----"'--j" ~"''''--------'''--1 f---'- ,---=-'---1" WW 1 -G0:2 ,------4tttttttHtH'ft-"-jA" ,-_-",,,,5-1" RS '-C02 ~""""-----"'____I ~ tH++I+H+H+HI_"o.e'____I' " RP '-C02 >---"''',,'----,,'___j r--"'-- ,-----+tt++l+H+H+HI_"c'-'_____qo, ~A--"-",,'----',,'___j ~ ~A10 ,--_++tt+tt++l++l-tH'''''---"",,'-----"""___j r---'-- ~Al1 G py l-HQl2 >--,,"~'----"~'____I f------2------ ~A12 RR 1-<3"'2 >--,,",,5_ _ _-",,'____1 , ~A13 F F: : ~ vee GND r--+--ttttH+H'ft'ftI+_---------~'ftHtI+_-~+tt+tt+ttttt~2'~OE <+--~~+tt+tt+tt+_---------_++tt+tt+_-+H+H+HH+H+~2~._____q" ~A14 ~A14 F D D c c 611 l-C02 >---"02"--_ _ _ _ _ _ _ _ _ _ _ _ _ _---"-1 B CG l-C02 >--->"0''--_ _ _ _ _ _ _ _ _ _ _ _ _ _ --'''-1 '-------------------------"''''--''--'~ HR It-Hl1 B eM l-C02 ~---_ _ _ _ _ _ _ _ _ _ _''___I C$ l-C02 ~"'o''-----------------'-'---j ex 1-602 >---"0-'-'- ______________ -"'-j QT l-G1/l2 t _-~.~M'~M~R_ _ _ _ _ _ _ _ _ _ _ _ _ _ _''___IDIR Li=' 5-H02 e---'-"'M."'M-'O"",,',,''''RD'-_ _ _ _ _ _ _ _ _ _ _~',,'_____qG A IICC GND A 11 I 10 I I 8 I l I b I I 4 I 3 I 2 System Board (Sheet 2 of 17) B-4 System Board 2 11 I 10 I 'I I 8 I l I b I " I 'i I 3 1 , K r", le-Fl!2 CRT PG :2 J , " ~ " " . ... K L. T 5-F02 RD "l-E0J. CPU .... 10 ZA. , 2A 2. tV --2..... .s, .".".n HS 5-GII HTS-Fl1 MUS-FI1 - ->A Q CURSOR MV 5-011 - . 1'1\1 "I-ell o [SF> EN -J. nr- V$YNC HX "I-ell - HY I-ell J -ATR CO 11'1 ,- '18 2!'115 "IV ~ ." 10K OHM HSVNC ~ HZ '1-011 JA 4-011 J YO \41-E132 '-L ., .'~: :~ 14LS0'1 In't ~cl1 I . -0 \111 2' -- os J 4 MEM ... " +SV '10 8 M" , , ~8 14~811 I . L-j H 88 1-1'102 R/-DT I L-L- RI!:::SIi:T 22 "'V , M" MAl ., , II 2A 2. " , MEM AI Y J~ 1,," I, H cs I 2J MA< ",. 3A , ,. -08-'15 MU I.-Gel - KZ "'-802 -eeLIt " 'L< '0; J. " HEM .1.2 JG 4-Jl1 - .. +LP6f11 STR L...j JI-I 14-Hl1 ME Io-J"'2 J _DEN 1'lLS12I0 LPE::N '" " 4A G AA l-Je2 -z lOR ~ ,- '" " " ZM28 " " MEN AJ L-i ~E 1 15 2G c ..,. CRT PG 1 TV '''-FlU: I'1LS". voc ON' 'AS 2 -.::smr , 2 - III GF 2_F02 .. H' ::;1 " XII '2 J ZM.q5 y ~ , ." He 2-002 GK 2-FI!I2 '" XA 13 JV l-E1' ,. B HI< 2-DI!I:2 2. B ION 2-~I!I2 '" CPU AI" " J. L!'Ii 5_""2 J. JV - >A. " " ~ ~ GR 2-EI!I2 Z"" LS S-FI!I2 CPU A 15 .. MUX ADR ", "8 .. V LB --,0'2.'",,,,-,,,,,,---,"'0'--1 OC CCG ' --"",U,,,-,,,"O,,-' /l.CG IS >b"!,"I"W-i+-+-____=l''-'!HOR ,- ATR w ~~ !:~ ~ i L~ KT ''t-Fl1 -v OED RAM co;; J. HEM ts VRDV~ - MV (,-G02 f-p-,,,,.~,'.C,,,0-,,,~,-,,-5-11/0 Cs GND~ -~~~ ~::;i~ l~ KW 6-H 1 t R~ ~~ ~ .. ~J1, B G~ B B~ -!-CPU DL y ~& iJU LC '4-E.l1 - Eg i:!:: -DISABLE CAS" L~ ::R 1] VA ''I-F02 >-----11 '---~"~'---------_I---------------------------------------------~--"~Ab 1S ~'~.~ I 00~-"~'--~-----------------L--~V~'0~E~O~'~'~H~'~S~ >--~"~8 __________I--------------------------------------------~'~,S J >--~"~'__________I-----------------------------------------------23~" J >--~"~.__________I-------------------------------------------~4~'3 >--~"~S_________I------------------------------------------------"~'2 02~-"~·---_I----------------~-R~O~H~S~E~'~ ~Al :2 CHAR LATCH P- . . 0 DJ.f_-"'-----t----------------=-!!!""""'-'O"-'"'--'""'-"''10y'::j t~ ;:~ II ~Sl Zl151> H ~S2 H XA15 CPU PG 2 G ----- G ~ L-_ _ _ _ _ _ _ _ _ _ _ _ _~-----~'~" ~ ~R~'.~--------f_-------~8~~,. o.~~'-~--~'~ ,-----2-- L -_ _ _ _ _ _ _ _ _ _ __I----~3~'B ~R~"L-------~--------'~~" O,~~'~·-t--L-4~ r---'-- L--------------t__-----·'--~2' L-_ _ _ _ _ _ _ _ _ _ _ _ _~---~.~,. o'~-"-'.'-t---'~ '-'-- ~''''G''''3------+----------'S'--~'3 O,~-,'~3-t--~B~ f-----!- L-_ _ _ _ _ _ _ _ _ _ _ __I-----'~'~'A F KE 4-F02 F ~''''G'~'---------+------------'4~~'4 04 ~-",,-4_t-_--"'B~ ~ L-----------------f_---2'·~~'B 3Yt__~'-------"C""U'-"-',,"'-< ,~''''G'~S-------+----------~3'--~,S f---!-"- - 'I" ZM3t ~''''GA~.---------+----------~2~~,. 0,~~'~'-t--~'4~ i--'-' -'1B 4'1'- ,~''''''~'-------+--------~'-I'' ZM'0 r-- 1 ~''''G'~B--------+----------~'''--~,. L -_ -I LTH _"-'.' p---se OHi'! ." "'5 10 OHM I I INT'EN ,CD , 1:2-Fl1 D ,." I B G 10 OHM GREEN ", ,,. c " 21'112 . HI OHM 10 OHM BLUE c ~ ''lLSSb -TV HOR DRIVE 14LS8b ~8 +5V ~ , G +V.,RT OUT DRIVE 1'lLS04 ,. 13 2Mb " G ." 150 OHM ." 3.31:: OHM "3 .'" 1. lK OHM 2.2K OHM " F'RB 1-", 2M1 b +sv REGULA TEO ~~ '''0- .108 UF B +12\10 , LM340T VRl 2 +5V REG LATED • jo" 1 1 1'120:2 COMP VIO€O B lW i~\~ 20 OHM 1 3bl1l OHM 2NJ'U"'!e , ,n 1 R18:2 1'" UF m 121 LJF OF 1"0 OHM 15 OHM ~ 1'52 ~ 100 PI'" " - A A 11 110 8 1 b 5 2 System Board (Sheet 6 of 17) B-8 System Board 11 10 8 b 3 2 K ~ K ~-~---------------------------------t~~"M~'.~H~"~~~NC~'-~G~'~'~~~"~'~.--J~,7,------2Z~'.~~tj~~ ~:fll BR l-C02~~----------------------------------------------------------~~ ~~--~-----------------------------~L""~"'~'.~-~H~"~~Y~N'~'_~'~'~'~ Y~N~R~.--J~,7,------~Z~"~tc;~~t ~:~ll ~-~~~-----------------------------~Y~N'~'.~-~J~"~~Y~N'~'-~'~'~'~ Y~N~W~.-_J~,7,------~Z~'2~tc;y~~ ~:~ll r-~-+~-----------------------------Y~P~D~'.~_~"'~'-Y~P~'~'_~'~"~~'-<~P.~._~"~,~,------~ZD~'~y~~~ ~:bll r-~-+~ ____________________________-t~~~~~~~~~~~~------~ZD~'~~~ ~:bll J J L-jPN 10-Jl1 '--I PM -,,'''-2__________________________'''=~ RN 1 "-A 11 I VZM1b C c ~~--------------------------------------------------~----------------------------------~::~:~~~~~ 1j~Gl1 AR 1-£02 r-~------------------------------------------------t_------------------------------~~~¥ f,".I, AS l-E02 ~~--------------------------------------------------~----------------------------------.~,:~:~~~~~ t".I, ., ~~--------------------------------------------------~----------------------------------~"~,~~~~~ ~~~~:1 1-E:02 B ,., B A r .. G vee GND A 11 10 8 l b 5 4 2 System Board (Sheet 7 of 17) System Board B-9 11 I 10 I 'l I 8 I I I b I 5 I I 3 I 2 .5V K K 0.. 0,. 10K OHM 18" OHM - ~ OUT1 J oUT2 J SERIAL. JNTR P8 "'-JIII3 - PL 1-J"J . ~"'88 ~ r- H RTS +SVo-~e ' f!--B . - A eNT\., V~ Y~ H - 6iSi'R 65§i'R ~B ,.- CNTL Y~ r- ZA. -,. Yf>- - CNTL G Z" +VCC- GN ~ .. ZM. yr--L!- G - CNTL vee GND ... CS2 -- ZA' r- TM '1-11.82 eSOUT r- ~ GN' DDIS l- F 2. A:os NCI- $6 12-H" F 2. DESTR SH 12-Hl1 - " DOSTR GtA. CARRI&:R D&T $J 12-J', - ~.... es. SK 12-J" XTAL2 SL. 12-ICII +6V - vee E ,. Rl E » RLSO 14L$,4 ~ DSR ,~ - ZM. - ~ CTS ~5' .. +5V 2 QPR ll 5 H"OIl ~2 ' ." • IEI~:~:" DU' ZMUI D CLO D ""ZM33 - - -CA.BLE CONNECTED -1ft ,1(80 DATA UC -C8L KBD OATil. C C ~ U' q z~8 1"1L$32 ~ 5 ZN1 0 NMl - .1_ ~ r- i R TEST ENABLE ST 111'-,.,11 iz_ B ,. CHNL 1 CLOCK SEL.ECT B ij -CHNL 1 CLOCK SELECT $V ~-El1 ,,- - ,. '''lS3~ i4 - r- ZNU ------..l~ 11 eL" A A +sv ,:rt U. 8 11 I 10 I I 8 I I I b I 5 I 4 I 3 I 2 System Board (Sheet 8 of 17) B-I0 System Board q 11 I 10 I I 8 I 1 I b I 5 I lj I 3 I 2 "VBD LATCH SP 8-002 I K SotS,A 5 K PAO - '" C- - PAt r-- r-- +sv~ vee '" r-- J t- GND '" PA, r-- I-- J PA' I-- ,., r-- - .. '"~ t----'-!- , " I-- H elF "'l-GIOlI4 -ZIOR -210101 · .. " .D 'ot '" " " ,., I SW ii-OIl H · Q;N "'J-G0"+ -82105 CS " ,· ,. MP b-He2 es 'B' >A, SPKFI: SW II - RK ;-E'2I3 " 'BS " SX 10-Gll >A, sw I-- ,.,r--" SPKR 1 RG ;-100'1 '0-Gt' ,. 'B. $V AH I-FeJ RE::>E:T ZD. ." ,c. ~ I MODEM co 0[5KTE co [NST ALLED SZ 1 b-F\ 1 ,. NL ""1-K0'1 " e. INSTALLED 15-F11 G II G "~I ze, H NS 1-1(0 .. ze, ,. e, ,e, " +-51,1 0- 1 R2~ V""' OHM NX l-J04 Ot 'e, " 3.,,1( OHM + ~" , ze, , - PC i-Jil'! ZD' ,." 0'" '" f---'-2- ec, " 14LSiII'I 12 II ZM13 , +Sv ( ) "-" 1'""18 ,IIK OHM r-- PH l-J04 I , , "1.1" OHM PM l-J12I4 ZDS ,." DS 'os " .30 I ~'"'Ds . 2Mlb m~ AUX DATA OUT F PS '-J!il"l ZD' D' , T. 12-811 F .~. 21'122 PW l-J"'1 I---~-- CHNL 1 CLOCK SELECT " "' PCI_,e ''''LSS! 2M31f , ." 1.21:: OHM e, - SU 8-B"2 K'fBD ,. IM3J , .1111 UF I'HIC.E DATA OUT Te 12-8 I' r-- ii~'u, ~~Ht-LC012 LOCK SELECT ~ZHllll SlV 8-B02 ,. .32 " , "1-,"1112 -AlRo CO , 150 OHM [F/: TEST FREel TO 11&-.01. 11 E UF HIJ_riiaCl'BLr;. CONNr;.CTr;.O 8253-5 . I E ,. bG G,.TE:0 'SVj~ ~2 GATE1 ~V lb - +5V 1 I>ft Zl'U4 q , GAT!;;2 CLK0 , R28 2 f-- AI" .. l-F02 PCU::: 9tJ :2 k: ec. i r ~ CLK2 " CU:::1 ""iq,, ,.:t~M ~, J" OHM D 1-F02 -Rli:SET " 22 ,. .D OUT0 ,. "" TIMER TIMIOR AUDIO INTR TE 1-011 D - " OUTI - 14LS08 " 1111-1(1 I r-- ,. ~v , j, Q ., ~ MH b-H02 -TIMER CS ZI CS OUT2 " ,. 8 CASS A,UD I 0 ~ IVp--2-- OG , 2-Cl1 ,." . ~2A Il " 7lfLSI!l"l Z< c " .s. ~. , s c . D. 18K OHM ZMH. 'HZ , +SV~ e - D' e2 e", e ' Z vee 8 OND , +5V ( ) , J, f-- .,' I FilSS:2 1 Fil'!>1 2 ," MOTOR eNTL , TH 12-811 ."'OHM,~ ~ E , "' LM3!!u1 ~ CASS HTR eTL SW I TCHO TJ 12-8n r J ZM2b B , D' 2 ' I-N.c . +sv 1 RIo~:2 1 R10 2 B ' VI a"K OHM , DE , , LQ-bV , filS'! :2 e30 - 1111111<: OHM.... , "e, ZM23 181( OHM .04, UF C32 CASS AUO 10 to MUX TK IIII_Kll I . . RS3 0.1 WF - ,ec GND '8. DHM :L5,'t 11HZ BAUD CLK TL 10-Kl1 - ,-d~ '_ell, A AE l-F02 1411MZ eLK I~ _~~MZ~B 1... • 12 S"'01e: OHM 'I " LM358 J PJ i-J1Il4 " OJ AUOIO i------2-- 11!l1ll1( OHM .os 5 X2 , eJ5 "1- ~ --f+>.. ZM2," PO l-J"'''' ZDJ " "05 XJ Z AUOJ 0 1 "'-0-" Te 12-011 NY I-J0"1 ZD2 " , 411( OHM 10 UF eJ. - " - '" ~Y0" ZD' . NT '-K0'1 Db 112 OHM 330 PF NM "l-K'''t Z00 1"fLS3Z " 0' 2 I .52 HK b-H1!I2 -SERIAL, ZA' SOUND CS '--"'. :2 ZM3 J eE Hel-- -nil .... :2 Y2 1111011:: OHM n ~ EO., o +12V H SB 1-803 5 ZM211 "vee CHD flO ..- 0. 1 UF , YJ wI-- n q"., 0+ 5 \1 H , ,5V " ." +svo--t= LIGHT PEN n q ... 2 -LPEN INPUT I TR o-Kl1 ., ,, STRBX - .oo INTERFACE n q J 12: UC 8-C l ' ., ,, ('IX I ~ +5V V - JOYSTICK q ~ 2 TIMER A 1. R"'l 2 2 , "'5 J I-- ., . INTERFACE "' q TINER 8 , 2 , , ., 5 14LS!ZI1!I ~1'2 C q 02 02 ~~ , 1 R1" '2 Rl1 '2 ,. " , 0 .0 " " " 2r'l1~ , , ~ 1 ! cs~ 132M' 1 11 IF! TEST h8e1 PF DATA A0<1 A03~J''2 t>J 12 I R CARD INTERFACE C ~ ~G "2 2Ml"1 A"2 ~J12 ,. .~ I: J , G TA - " , P . " , UF f-- RST~+SV !'" ["·1·"~ vee KEYBOARD 02 (J12 rJ~ , Te CABLE n ,5V - . ONVncJl' A12 ~J'" 1"1( 2-GI/l2 f' ~" All ~J10 H H -BAS&: 1 ROM IN CART M J11 ~A"4 ~J10 lUG 2-Fl1 r'2 ~'1 BIIIZ ~J.10 f' ~" 811 ~.J10 f':S ~Jl' "03 ~'1!1 G f' ~J" A" ~JHII G r.:s ~Jl1 803 ~JH' f" ~Jl1 ~Jl" f3 ~Jl1 813 ~JUI F f2 }>Jll F r' t>.Jl1 ell::! ." ~'0 Gs 2-F03 I rill }>Jl1 BH!l ~J'I!I ).110 t"' ~" ~J10 GJ 2-F1lI2 res }>Jl1 Bes }J10 E E f'" !>Jl1 ~.J10 r b ~J" 81!1' 8010 ~Jt0 GT 2-'ii1!l2 I f'H ~'1 Alii'" ~J10 Gx 2-E02 I t'" !>J 11 A", }JI" D f,e }.Jl1 A10 1>.110 D XA11 fa ~/" Al!lfI ~.J'0 fillS ~" r j/'I s B05 ~J10 C r" ~Jl1 AlliS 804 ~'0 }.I10 -8'-'$£ 2 ROM I H CAJtT C M J11 I A0q ~Jll!l M -CARTRIDGE RESET (' r" J1 I UJ 1-.11' ' ~"02 ~JH!J B . . SVQ .1.18 ~'1 t:!"" 11.18 t>JI" B .., (' f' ,1,0\ ~Jl1 Q"" .1.01 ~JH!l A A 11 1121 8 b 5 3 2 System Board (Sheet 11 of 17) System Board B-13 11 10 q 8 l b <=;; 2 K K ~J' 1'1.4.02 pJ1 He02 ~Jl H""J ~Jl H803 ~J 1 SM B-E!i!2 I J 1'1""" t>Jl _!:I_~~_~J' J SERIAL EI'" CARRl!;R DET HA0~' HBI!I5 ~J\ PORT Ii""'!> ~Jl HBlllb ~Jl ~Jl"1 HAl'" ~J' HB01 ?>J 1 @ ~J14 HAIlI8 ~Jl HBIIIB ~Jl H J 13 @ ~J13 G603 ~Jl ~Jl ... HOFi: OUT OR ... @ G GAlli"! t>J 1 G .. VERT OUT DFHV!:': GB-01 ~Jl GA02 ~J I GZ l-F1!I2 GAI2IS ~J' BGIII2 ~Jl Nt>. b-D1II2 I INTEN GAl2lb ?>J 1 GBIII'! t>J 1 DIRECT F GREEN GAlli, ~J 1 GBIIIS ?>J 1 DRIVE F Ll t>.J 1 VIDEO ~ _COMP SYNC DRY GAI/IS G80f:, ~Jl NZ 1>-002 I -TV VERT DRIVE GA.'" ?>Jl GB:1II1 ~Jl -TV HOR DRIVE GA03 }>J 1 G808 ?>J 1 r:"' E E AUDIO ; {)~JJ 1mo C1S ". I UF '" COMP VIDEO COMPOS I TE V IDeO ; _~J 4 D e?S~gSJI~1( D ~2 ~~ .... 111.1 , C2. UF FB"2 ~J2 +'2V~J2 TELEVISION MDDULATOR . . FBii'll }J2 C C ~12 JA02 ~J' s;~:~J2 MIKE DATA OUT JAIIIJ ?>Jl MOTOR CNTL ..1.&.,,'+ ?>J 1 s~::~-1>J2 B TH q-B1II2 I B CASS MTR eTL SWITCHO JB03 }>J 1 CASSETTE s~:=~f2 TJ Q-B"2 I 110 s~:=~--tJ2 fB ~~F"2 ~A aUT ~J1 ... CB02 }J2 ~J1 A is JBIZI'I }J1 A 11 10 8 l b <=;; 2 System Board (Sheet 12 of 17) B-14 System Board 11 1 121 '1 8 b 5 4 3 2 K K ~ "'0' 1 U:.,,,1.., UF O+l2:V aM l-C03 I P. 04.01 ~J'li 9'" }J5 1 1es, 4~ r'r 1'0 J ISS l_c,n B!X l-C"'3 r BI2I2 ~J5 C38 UF J B0J ~s A~5 A. ~"'" UF .... CJ l-cr,u. Cf> l-CCH I AIilI'I ~J5 ~ ,6,0'1 AIZI5 ~J5 4 A. .. CU 1 -B03 I 80S ~J5 .12I'n UF" Ie UF ., B0b }J5 A01 J:;>J5 ('Xl (lOX) , H A2 Bin ~J5 H A08 t>JS A0'! ~J5 8\0 t>JS ~' }"' Ae 1 -F03 A' Bll ;t>J5 G ZZ \-F02 " A_'0 Atl ~JS ,1.,12 }>J5 FlT '-C02 t- RQ ;-C02 ." 813 ~J5 q ... O-toY G 61'1 t>JS AD A15 ~J5 RV ,-8'112 I Ib ;>J5 PZ ,-H02 ss 1-(;;l:'J3 II au, pJS All }:>JS F FF BE I-GIlI3 1-002 I -lOR ... AI'I J>J5 04.20 J?J5 B~J5 8FI n, ~s F S21 ~J5 ~' 11..23 t>J5 822 tis GS '-G02 I XALEi: B21 ?>J5 'iR '-G02 I XCLK ... ;2:'1 j>J5 E SC '-8e2 "'25 t;>J5 E uu 82S ?>J5 1 -G03 QJ5 +-sva +5V~:.t=J 110: OH_"_ _ t:r A2b 812 pJ5 ~J5 ~J5 82, ~JS +RiAI)Y D [~JS D Al"1 J:>JS ~J5 10.02 ~J5 + 12V O F---f>JS IRll:2: IRQ, ... ;"' I-C, I ,.- r18 ~s A22 ~J5 c 80"1 t>J5 C B~JS SIS ~J5 81i t>JS 820 ,J5 82'1 ~JS 82B ~s B RESERVEO f 5 C+ J6 AUDIO INPUT B A A 11 1121 '1 8 l b 5 2 System Board (Sheet 13 of 17) System Board B-I5 10 9 8 1 b 5 4 3 2 K K Bla }J' J ,0,18 ~' J ER 2-H1!I2 I 811 ~J' EV 2-H02 I An ~Jl '0' 81/0 ~J' 'D. 'Db B~JI All. ~' FN 2-G02 I AIS ~' :S_H02~0 A2~J' H JO B22 ~Jl C?n MO' H ,1,21 ~J"1 B21 j>Jl IN 3-F02~ ... 20 ~J' G B2!!! }/1 G ~~~--------------------------------------------------~~~' M05 '" >-,., --"-""--"-'-----------------------------------------------------=-):i' r' ~~~~----------------------------------------~~~' ATR LATCH ... 04 ~/' F F ~~--------------------------------------------------------_____ ~Jl "'01 ~Jl B34 ~J'" A02 j/1 E E 8"2 p:.J' B01 }Jl B0b ~r' An § D ~5V 0 ~Jl D B" ~"' 808 ~J' a0' ~Jl c 913 ~Jl c ,0,13 pJl B B A A 11 10 8 1 b 5 2 System Board (Sheet 14 of 17) B-16 System Board 11 10 8 l b 5 4 2 K K o. ,4,10 ~tl J A'" ~J'I J 401 ~J,! AI'" }/" .4.05 }J,! l-C0J~~--------------------------------------------------------- A·~Lt.J,! H H .4.02 ~tl .4.01 ~j'l 1-803 I ~ OI'SICIOTTE INTR ~'! ------------------------------------------------------------~~~~~~ B09 l-B02 I G G ~~----------------------------------------------------~~y' ~~--------------------------------------------------------~~y' ~~----------------------------------------------~~y' ~~----------------------------------------------------~~y' F F INSTALLED 613 »J'I -RESET 81<; }:tl 810 f>,>J't a'1 ~{'t E MJ" E P-~-~/'I ~---~~------------------------------------------------------------------~~~~IVG 13-011 ~J't S'" ORe" ~---~~------------------------------------------------------------------~~~~IVH 13~0I1 Sl>:~~_+J'I D J>" D c . . svO '§" 8:01 SlS A08 B0e; ~J,! ~J' J>" t>J'I ,J'I c Be' ~J'I 812 ~J,! B B A A 11 10 8 l b 5 4 2 System Board (Sheet 15 of 17) System Board B-17 11 10 q 8 b 5 2 K K A10 ~J8 ~~_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ~_~J8 J J 1\", ~J8 Alilb ~J8 1\05 }JS 1\03 ~8 H H 111112 }J8 CV 1-130'1 1 A01 ~S OJ8 B008 ~8 G G B0"l J>~S A2 BOlo t>J8 ~~~----------------------------------------------------~~8 ~~------------------------------------------------------~~8 F ________________________________ ~~~8 F ~~~----------------------------------------------------~~' ~~------------------------------------------------------~~8 ~-~IO~'~----------------------------------------------------------~~~8 ~~~~~~~----------------------------------------------~=-~8 ~~~~--------------------------------------------------~~' _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _~~~8 '§" /\14 ~J8 D ~~, D ~5VO~--------------------------------------------------------------+~""Bl~~J8 ~8 1108 j>J8 ~J8 c 1\12 c 605 ~J8 130'1 ~J8 812 ~J8 B B A A q 8 l b 5 Lf 3 2 System Board (Sheet 16 of 17) B-18 System Board 11 10 8 l b 5 ,3 2 K K J J H H G G F F E D D c c B B 11111111111111111111111111111111111111111I111111111111111111111111111111111111111111111111111111111111111 A S~~3~~~~~;~~~~~~~~~~~~~~~;~~~~~~~~~~G~~~~~~~~~~~~~~~~~~~~~Q~~~~~~~~~~~C~~i8~~~~~~~~~~;~~~~!~ A 11 10 8 l b 5 4 ,3 2 System Board (Sheet 17 of 17) System Board B-19 11 10 q 8 b 5 3 2 K K MKJ81!100 J x•• J XDO H H XDO CC 2-Hl1 $S 2-G02 ." OC 2-Hll IOI:i. 2-Hl1 XD" OS G (;c; 2-(;111 G xD, ." F ~-;~~ 6-:-;~ ~O~ . .. c, F ..,o-J.. AF 2-802 I 1· E E D D c c L -______________________________ ~--~". ~A14 ~~----.--~---4~~~ ~DI:O: V 20 - CE B B r-~----------~6~;~ A A 11 10 8 l b 5 4 3 2 Program Cartridge (Sheet 1 of 3) B-20 Program Cartridge 11 10 q 8 1 b 5 3 2 K K J J ::- B 12 B1b .. ILL I-Jl1 ,US ,. ::- 81121 XAl H H A~ , ." XAS ~ Se:S ) 80""1 A1l ) G G , Aeo ., XAB .....---.-; ss I-tOIl F F ) , ... AI2IS E E ." 0 fa . L I.0"Jl L UF 110 UF 818 : ~ '0' ) D D ) ,It, 11> CS> ! ZZ \-811 cs. C ::- 6121.3- cs> C cs. , .. •• 2 l5:;;e ... ::- "1214 -SASE ROM 1 IN CART 8 , -SASE ROM 2 I N CART Fj-;;-o B A A 11 10 8 b 5 3 2 Program Cartridge (Sheat 2 of 3) Program Cartridge B-21 11 10 8 1 b 5 '+ 3 2 K K J J H H G G F F E E D D @],@] @]@ c @]{2] @]@ c @]@ @]@ @]@ 0 0 @]@ B B A A 11 10 8 1 b 5 '+ :; 2 Program Cartridge (Sheet 3 of 3) B-22 Program Cartridge 11 10 8 1 b 5 2 K K J CR< U.V r~, ., 1 I )..l12 H C'S . 041 HHIV UF A CR'I JA C SO -,- , , ">A U-- .",. 1 OHM '" 15 OHM .25101 C' +12 RE:G ~LJ_J " 3 H" C' + ' K .26 .... " . ~J2 1 H ~MLJ C A ~ 22 UF 22 UF ';V CR, 3A ~:5 ~G " , : : H' , '" CO, . Hl UF 100 V~ GNO ~ '" I HH'lV ~ ~ ". CO, ,, '18 ", " ", , " ~ G r:I HHII UP I A CR 10 3 .... C 240 1 WATT OHM 15d'"'' UF '" • 25w s U; CR1 " ,+ .25101 ~4- ~_A " " 100 V ~ bd' r, eRH 3A H'2 C", +12 ~ cs '"' .041 Uf SA - ., F ~. HI"''' 11i c '" le0e PF 300 OHM ~ L_ -:!:-I_ 1(12 • :2501 -~D"RL RS R12 R" ., .050 OHM NeD' Z2 ,, ,3.'110 OHM 'S ', -" F~ ,~ t- "NO R" :2.15 K ." ., .25101 ." E ,~ liZ b VREF , M OHM .2'i1i ~ R" 43.0 OHM .25101 I :: 1:2 V+ ::)~l : V 3. CS -~ ~ J L-- EAt---- .s 08 -II, PF 13 CDMP 1. CL '" "s., 1001!! PF s., ,------- 1'1 NC f-- ~c '" ,, " '" t..:2 V .s 220P .1 UF " D " , I R?I- .:25'01 - RlS '" '"' 28. '1 I( +" '" 2.15 K 4.'1't I( .H'IIr' 1000 UF " .2510' . " ." '" .S c i=r~8 - "~ _ : q"L b RO ." I( ~",. ,,. ~ "NO ." lIb H' c B B A A 11 10 g 8 b 5 4 2 Power Supply Board (Sheet 1 of 2) Power Board B-23 11 10 '1 8 1 b 5 4 3 2 K K J J H H G G 8 + F G G "' 0 F G E "'~ ~ GJ "0 o~ D ~ D ~ ~ c c B B A A 11 10 8 1 b 5 2 Power Supply Board (Sheet 2 of 2) B-24 Power Board 11 10 ,2 I0 rI>''1,)0'" ,{><'"'1)010Ji::>c.9 pooral'J 0531 11206 0531 0532 D535a7~~."""" J: "'5W c/O 11544 'llK ... ' ~'lSC458C ~5;51 ~7' 'l,wl12W "03 100 R261 '00 R563 '00 . 8533 100 1 , I' 4 5 6 17 182016 330 28C1514 18207 :$-I ~ !!! 0541 ~ LS31 IOtA! l...t::P 10 111W C539 ~534 '"""l 4700r e536 ':' 15C~37 ~ _ £ 0537 ~~:5 I _ u''--'~;;r4~h , ~~S:!'lW I J.....J'----'-' ~"t-Pl: I J - 11540 2S0 51C/O 1 rl-..-.J--..!:=::;:~=;=E=;~_t\l18' 11569 rt filll ~ 1~~~6 ~ ~~ R~7 C?I f'V 533 053 ~7ODP/500221250 ~ .J *~ VII9C ..I. OS4O r- t-- I/2W P:: I V901 370RKB2 ~~2I6 011 0253 H074805 ~501l~ 11257 330 "I a:!: ~~I I R534 330 '20 l'~w ~ '58' R536 IK8 0536 2SA844E '54' 680 ",m! 11 "" 1sCI9oo vooc 76 ~ '54:vl ..J- ~~ '!\~ 56 IDK2W 1J ~g TVD6C _~ ~ ·!C539 R5!11~ .~ 'jjg,5 ~'!2W), 1"1 ~: i 'i' • .J 2-TC14 f~~:t-:..a6-9-.....--O-l~ID~52--t-i--t-1-+--+--+-='-·D-Rl-VE-----1 0562 ~i~~' 1~~J~\f5W !~i" Q~, iii; :~?L :~hlt-- '1 1\ : nr 14 13 12 II 10 9 8t-- ILF.,-+rl';:-h-tr-+'''''7 r£;» ~rex P>Jt:< I L.J' ~:9 I{>o' ' 5 6 l! I 11216 330 ,,0091~!02tJ6 ,,2SC458C 1~~~}6 ~f~3 2s~5J'~c R570 ~SC1514 ~~ ;;; c~~' 'S'016 ==,... 1r.J, ~''"~ 0564 250757CIO ,......, 4700 C566...L. 't~~ '®::;_. :~~41!l~2W,,75 ~ :~~ 5,. R951 3!2W A OE)'J:: .. C95: , .,!" tlI "303'0 220 ~ 0564 RS61 '?.I.. 056 47O(JP/50DU!l5 II2W R953 JiJ,3.,3O,,' 11~O.'/50 C20~:!: .-+_.....-+.L= I -= 9 }j ~ t 182076 56 ¥563 V06C 1.+ S70 550' C217 'BOpI' R520 150.I1W r-nii2----;:::::::;::=t==l=l=:::;;;;;::::1"a ""' R566 0566 "71 0562 "'\S20 SCI906 '56' J- R57~1± iii!! V06C f----o ~h. C951 1000 R952 330K mID R"70" 2S~2f~C '---~--1J-,-,,-~[-'i~s~\'ac R218 2SA844E 680 76 56 IOK2W Q> + C569 R577 : I !;+ ;.~j~50 PilK . ~56'W '.DRlVE C565.0547 1m" -1"'50 ~~I!.1- 71 ~ 'r=',., !! ~O of""~~210 C205 IJ~~'" RnD 100 azp '50 cm 50~",",..... -.6K mi R223 "" lK 500B ~ f""'rnC'\ Q203 "10K04 ~in 3 ° 1 0202 2SC458C R3,05' 7 0 ' J .S2076 .... c/o = ·'nlO'l .... 101 J. . ~ ~o E06 lOS ~ r.;;;;;--.'-""'-' IA. r.:;>r '...! .. R311 0'09 152076 11115 BC "" ...... 6ao. t n'D~R1'6 44E 5.6 'R1J1 50 "" ~'i 470 "33 390 . () I 0 83., . L . C212 :l: HA178OS' I ..SP'~, 0201 "03 lS2016 IK oCillD I OZD2 IS2016 0211 "." 82'14 Rii3 2.2112W r-=-' 0205 V06e I rm V·Ol H·DY _ ""' ,..... ClliD 1 J __ r~~~I5~V~~3~.9:'::t::::::::::::::::::::~':::CO:':T':'S:T::::::t=::~!~~~~~~~::~_1O_0/_50 v. HOLD ______ t-~~-t:::~:::...L.::::::::::;:~~'.'~'~I2~W::::~:::::i~ ~----------~-----------t~~r.·~ -')~~ '06 ~ ~ ~rr ~~~~ ...L i@D ,....!!L., RlOB R333 3.3K L.. ;: P.S .323104.1 R322 01 raj S301 j .•• bJ .L C321 j 11325 910 1i2W II2W r'\.... ~ ::~9 R,3,,14 b~~~ ~3"1.J .!>l'~.. ~"O 11304 I9 .,« tI rv (,.r- (II[) 11303 n- I..L. R306 SOOB ca04 J!-~L~6K~~~~;=$=E~~~~~ 270 1~I00P C303 ~ 580r Ir\r-fciri.lt:"pq :Tc;NI~~ml~nf 1* CWD,I'-"z 3~504 5~;~H~ 715080~8 16 HlOS B.2K r~ -.~ ~lo 11302' h C3.06 6,2'K R307 R310 15K 1201lZW cm R312 -l1A 11313 9,IK R315 1.2K 1/2W 0306 voo, 0304 v09C Lj-- ,OID 1'RJro' 1100/50 + -CJl6 :!C31O 101l2W ID/W 1I1E; 470/16 rl!==-+-.4.o'''3'''''''--' l302 T402 TPC·2009 ~ '-_'_'_F.9_'09"-_.-i-i_~ 1.2~_2J1 A335 6.8K2W .--i--..."V.., .C .~ R336 c::!~Ii.J!a ~=p -8201W ~l403 •• TWH·104 H.WIOTH CmD O=~ia',J 1 _. r 0402 115 14 13 HA11235 12 II 10 9 Jr~l .,.,- 47/Hl 1/50 11403 6a, C405 O.Qlap,S ~~~~ R406 5.6K ".01 .•-!C4D2 Ti15O ~~~f .,;; 11407 5.£iK "08 68k3W I ud 2.4K Color Display Color Display B-29 11 10 q 8 b 5 4 2 K K J J ~D~IS='~TE~I~NT~'~R____________________________________________________________~~}UI UI ~~A'~'----------------------------------------------~~rAA J-FII H UI UI ~ "" G UI ~_A~'~' ______________________________________________~~ Ul ~_A~'~' ______________________________________________~~IHH 3-611 -RES!:;.Y Ul { B14 I JJ J-Jll UI 4 81J. F ~ :t!,.CARO INSTALL U, {_Ao-''-''S________________________________________________ -D_"-jAA,C:/C 'I-A 11 h Blil" ~ 898 .A. ~ Bin ~ 890 .., .AI , E f- ... D C8 .., ~ 803 ~ S:Hlt -MODt;.M.FLOPP'I' CS -lOR D RR 3-811 -lOW ~ 811 ~ c f- c ~ 812 ~ 1014 Y f-!!!-- B U' ~ ... 08 B ~ AI'I4 UI ~ ••s A A 11 10 8 b 4 3 2 Diskette Drive Adapter (Sheet 1 of 6) B-30 Diskette Drive Adapter 11 10 q 8 l b 5 4 2 K K J J 10 ~U2 Y'f 3-FIlI2 I 4- 4- H 12 ~U2 "2 1- H 18 ~U2 4, • ITT 4-011 -STEP 20 ~2 "'" 'I-H1lI2 I 22 ~U2 4- G AF _IIR I TIO: ENABLE 4-DIi52 1------"'-- "---,---- ________ ~U2 4- G -SEU::CT HEAD 1 32 ~U2 AI!:: 'I-C02 I {" 1 UU "I-ell -"R I n: PROTecT ~U2 4,20 I VV "I-CII F 1 ~U2 { ,. -ItEAO DATA !; F 3 ~2 I; ~U2 '1 ~U2 E E 'f ~2 1\ ~U2 13 ~U2 IS ~2 D 1""1~:2 D ~U2 r2 '" :21 23 ~U2 C 25 ~U2 C 2, ~U2 2' ~U2 31 ~U2 33 ~U:2 B B A A 11 10 8 l b 4 3 2 '" Diskette Drive Adapter (Sheet 2 of 6) Diskette Drive Adapter B-31 11 10 8 1 b 5 2 K K .. rlt~ -RESET J ~ , J " ," '"' ~ +, H 2 +-:: D~:e=. ,: 1 J '~T 2 TRIG " I> , H r , ~O:J:Q , ., ~ ~ ' " eK 1.1 1--. eli! ~ 1"1 '"' r-~ " 8 ~' , "2 8. " '"' , ". GT ~ "H , "1& , " ,. G A' " O/SKTE: INTER G '"D.' , AO A' " " o 5 ZN'I 0 II .. . DO> 5 ,., 8." " ...... , A> , D" " .., A4 ZI1:21 11> , , "., " ... . A5 F AO " ~ F AO ,.----!- DI' ,. veo ,N. E 20 ,, ~ UPQ,&5 'N' " . " -DRVEN E ____+_ ~~ . .. L - ____ 0 : 02 , 0' " " ., o. " ~ +A' D :: '~' " Do D r NC " +OHAREII: I ; ~Y--- +A, .!'5 'M5 _MODEM. FLOPPY CS '--,- c c -lOW re: ZM2 0 " ~a I ,, 'ow B RR 1-0"'2 " +A. ... -lOR ,: ZM2 , --" I ~~ , 'DR C' B , A A 11 10 8 1 b 5 2 Diskette Drive Adapter (Sheet 3 of 6) B-32 Diskette Drive Adapter 11 10 8 l b 3 2 '" K K a, I I.e $-Hll J AD 5-011 J " 3-G0" .. .. Z" . ," a -WRIT" DATA AE 2-G11 ~ .. ZMa H - H ,. . ':)~'. . ., ZM1 ---:-~~ 11 ZN, - B• ~"R2 61 PR~S£T LSI0-. " " ,., 28 "B~ G R4 ~,. ~:ZMn fHZr!- , *~ .. F " VI "J, . .. , ., vee .NO .. F I.e , ., " a , E .. , . . " ,." , .u E _~ Vfr·:t 1"4- . '------ .5 , , , ", , 12 11 , , , UPDlt.5 ZN 11 2MI! 15 ~ 12 - a a , ';;1 " lor' 2-GII ,." ,." ,." IiIDA+=..J ZM21 ," -WRITE ENABLE . , .5 D ZNS PSI!l 3;2 D ." 1e ,. 31 1 ZN1! DEX .. " PSI 25 a ., " WE " '--?!- Va q ,...!! 2M22 , " I '-*- ,. WCK F/ --H-----o ZN1I .,. 10j 211' a " AG 2-101 t ,. CU'SEE Z"21 a -STEP \IV 2-F02 -WRITE P ROTECT 14 . 2M22 " I n 34 ROY lOX .'T HDL US ,- US - - " Z.," , a 9 ~' S AH :t-Hl1 c H -,. -DIRECTION ," . . -TRACk: e " 2M22 , FIT MF - C """ .0. o~ ~4 I L ACK L/ 54 ROD ve H~ a, .. 8 ZM11 r .a I Z0 ..- ;-r -$£u;:cr HEAD 1 ~- 21'121 B , .. , B -DHAACt::: A A 11 10 8 b 4 2 '" Diskette Drive Adapter (Sheet 4 of 6) Diskette Drive Adapter B-33 11 10 8 b 5 4 3 2 K K J J H H -READ DATA S G WW 2 - F I i ! I 2 1 - - - - - - · · - - · · - - - - - - - . + - - - - j - ! ' - j G F F E .. E AJ 4-C02 . . . . . . : " - - - - - - - j - - - - - - - { ~~-----~---~~~-+~" D lA D ZM22 1 '02 '0 c 39 Z111& c EO B B A A 11 10 q 8 b 5 4 3 2 Diskette Drive Adapter (Sheet 5 of 6) B-34 Diskette Drive Adapter 11 10 8 1 b 4 :> 2 K K J J H H G G F F E E D D c c B B A A 11 10 8 b :> 2 Diskette Drive Adapter (Sheet 6 of 6) Diskette Drive Adapter B-35 +12 [n3~4 22K RPI r--=t~-+6 YI ., I [~5 --.l011@79MHZ C:;cJ6 R5 .1 CLL 10 :J RPI R7 Cl{jo+I.2 III JI I + 1 1.2M V ~ 6 22K 68K ~i + 28 +12 r JI TI C2 + RE:'oF'"".C----. r=--'.:;.:;.1--'-'-'---;:- C8 ~7 LlLJ3~ r - ' ,--. 10 ~ [~!2RPI TIP 4 -':::: CI8 I-'--+----~--'----..:....._::_--_=_J RCVI27 .. if--+-wR6~_-+~6 LM358 24!L--=.2'--_-"3"-, "" 22K PHONE LINE ] ; 27DDpllKV CI9 121 P II -:4~CRIID ~[,_ CR2 R2 560 C21 R20 ~.I 43K~ 51z4 + 7 9 Z2"- ;[5 I RING 3 -r RI CI ~~IN4148121 ...-__..----_--l/--....6-8-K_-.:!j4 LINE HI 447 20 4 3 4 138400 20 T 6".8k. 4~7/ 250V R16.~Ol RJ':7: IIC ~ ~'7 10 ~~~'r~ T -C20 =[;110 15K RI9 68K ---.51~ Z1 KHZ 6 -'r"'"il: q./~ 5 L...,:.;.;,.J47 22 103 ~ Al DEMODULATOR +5 ~12 IK KIG~+5 'J..:l_-+-l-li ~7 7 ~.l J?I RP2 4.7K 8 I • CR3 IN4148 Lfl1 R911r;;;F 138440 103RXDpI9"--_ _ _V _ _ _--<....... 103ANSpI3"------------r~ I 23 AD A2 A3 -'--< 71 81~IP~D:III1~8 ~ ~ u ~ r---- 8 267K +12 1% 1 ,--__R""I,...0_ _..:2.,1 103 XMT 806K I " '" i,!;J1j~--<--'IIIRI,...I--..--=2=i2 OAC INTERFACE CIRCUIT RXO 16 TXD 1-8"--_--. RX DEN &-- CI4 A4 A8 I----< Z4 - LM35iJl .01 82.5K 1% LN STAT r1L GNO AI2 r---< 4 +13 +6 ANS 103 TST r-L 85 I----< 4/05/16/21/3 CCT I 2 03 EN CR4 B9 I----< 23 24 25 26 12 6 10 9 11 IN27D B12~ 01 RI5 RI4 r---- 0-+5 2N4124 4.7K +5 { BI I----< +5 +5 37 36 35 34 9 11 23 25 30 B15e--- +5 ~011.·lpI6 i 40 103 TST ~ +12 AI5i---+12 ~~ CI7.L~1 LNSTAT~ RXOEN~ 201 0.1 V' 101 . 20 21 Z3 138503 TXO pI0,,--_--, +5 00 A10 1--_-.;2;-1 I-il"*~------.....,:nl DO 9 OFF HK L -_ _ _ _--'2:::i 3.5 MHz 1-'2'--____+--____-+___________________--' RI4 D1 A9 4 Z5 16 3 0I 02 A7 03 A6 5 15 4 02 03 N.C.~ 4.7K Oiffl f.=3..:..4_ _ _ _1'-'-17 TMO 103CARrI3"-----+-----+--------------4~ 04 A5 6 LS245 I~ ~ 04 11 15 KBD D5 A3 05 INT 38 06 A2 8 12 8 06 S OUT 33 16 OTR 212CAR~ 07 AI Q G OIR 11 07 ~ 108m Ri OlS EN.!.- 191 1 1\ +~~ CSI ~~50A RESO 38 31 RLSO 212EN~ A9 83 I MOOEM CS B2 1 - - - - - - - - - - - - - - - - - - i n H C S 2 lOR BIO CSO DTrni 4.7K 23 OOiS Ril! 32 39 21 ~'7 lOW BII I !iOS'fR Ne AO 88 27 AD Al B7 Al A2 B6 A2 DSRR- TXRES BI4 MR BAUO CLK AI3 XTALl N.C. --, XT AL2 CTS~ .r--' ADS ~'7 CARD INST BI3 r--:L. -0 I OISTR [ V v - DOSTR MDDEM INT A I I I - - - - - - - - - - - - - - - - - - - ' ' ' i O ! INTRPT CJ~ TXRES B4 L--. ~----------------------~============----------------~ Internal Modem B-36 Internal Modem 11 10 q 8 l b 5 4 3 2 K K ..12 h Bill I A;' 3-El1 J ..12 4: "''''1 '{ DI/I J J2 ~ ..1:2 i )<>_'-',,'-<>',-----------------.....::.'.:-'-< 0. ~ I--- ' 1b 1 1-_0'_____________+-'-''--'-1 ZM18 ~ vee ~):'<>-~,.~-R-2-+,~,------------------------'-'~ c L-..!.- Pitt G vee raND GNO ,. c 20 10 B L~==========================================================================~~~BN - ~-Bl1 - L__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _~80:..:'~BG 4-811 8D' B L -_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _8D' _ ~BT "I-All A A 11 10 8 b 3 2 '" Parallel Printer Attachment (Sheet 3 of 5) Printer Attachment B-39 11 10 8 l b 5 4 3 2 K K , .. - AU 3-J12I2 J AV 3-J02 ." J , ~ , ~ , AC 2-G0b >-----t , " H ~i I-F0b -G12I2 "" i:~S~ r----. ~, 2-FliHr----. r----. HA " " ,.,. , H ~-G02 ", ,. ~~ i:~~~ c - - , I, l:m , '" " ~8 l:~~~ I • 0"," I~ l:m c - - , ., , ~ G G VO< 'NO G ,. ,. , 3 2M, 14 ,., - F ~ ,. F " -'---- ,. ,. ZZ 2-G0b AF BH ~ 2-Fl2lb 3-002 ~ ,. " , ,. ~ 11 L-...!..'..- " 3 E AQ 2-001> J!I '"' , " . , 8 , , , E ~ " 13 ,. [:>0 12 ,I m, . , "r< '" " , LM8 vee ,"0 D ,. ,. D - ~ "V " .-'-{)' . c B :~, BOb I I - 1 ZM8 I 46 I '"' ,. c B I 803 I BS 3-802 602 I I A I A 11 10 8 l b 2 '" Parallel Printer Attachment (Sheet 4 of 5) B-40 Printer Attachment 11 10 8 b 5 4 3 2 K K J J H H G G -0111 8 -0"" -c't" -CS8 -C." F G -C5£1 F -C30 0 0 0 -Cl" 0 0 -C00 0 -8'10 0° -B80 0 0 0 ~~ 0 0 -8SI21 -a40 E -B.lIIl 0 -82.0 0° -BH!I 0 ~ 0 -Bill" -A-~ .MI P38 31 8 7 f--".8___-'2'-lAO D4 14 4 4 3 lS273 )--'-2_ _-"1 03 P37 3D 7 • r=-B---...:I,17 05 15 5 5 4 1--"-5_ _ 8-"1 13 I ' .. >-....-*-.-::-:-:-<~-----, lD3 D4 ~ I.2K 38 4 RI8 II ..........-r~9-IC3 >,-I-+~_,------, ..-! iiQ ,..!I! P22 ....! P21 31 21 *~~. NO ~~~~=8~)---~~------"2~3 AI '----- SCI f-"',..-"(A,,So..)'--,~I,:!I~CI DC m t>l, DO II HM8118 D7 17 8 8 7 7 7 8 .!.! CI 8 1--"'1---"1 7 • 12 11 10 7 I • HI2 2. /R28 L :i 'I.... 'ceST '41 ~~~~~~~------~---__--...:2~2 U 28 --f~ • P 27 (AI 0) .. AID I 221 4 lOOK P42 ~~~(.~1~1)~--~----4-.......:~" Wi H .-w;.:.... ~J: .~C4 ~~5 -- T~~DO',,, P20 P43 28 25 P44 r_",(1",15ri1!N::::I.,C,;ID.-++-.-._.,3 40 IIV 10 let I 18 21);20 nC21 -;J; lDODD, lD4 E w.. HI9 l R17 5.lK ~>,-7_-, IK 8 _ _ _ RES~ se2 (H/w) ~9~_ ~ ~ 12 -~ICB 5~·~u~ L _____ ~----+---+-"! 393 8 HII (HEI~ IK P17 1VZ- VIc...:I-=.CII.:.;OO,--1I1!~11 ' -______ ~- ICID r. HII IC4 'i!-"I 1.3K ~ yr... . C5 50_ II' ·'EE • IClI lIR' 10 2.41, If _ CIO 0.471' 7.5K ft" Q4 ~ C451 R22 UK ~:5I r6' 1 123 47DK VII II 12. 30IIK ~ 124 UK 10K In ~ 1125 I'IN2DI3 UK ID5 PC Compact Printer Compact Printer B-47/B-48 Bibliography Intel Corporation. The 8086 Intel Corporation. Component Family User's Manual This Data Catalog This book manual introduces the 8086 describes Intel components and family of microcomputing their technecal specifications. components and serves as a reference in system design and Motorola, Inc. The Complete implementation. Microcomputer Data Library. This book describes Motorola Intel Corporation. components and their technical 8086/8087/8088 Macro specifications. Assembly Reference Manual for 8088/8085 Based Development' National Semiconductor System This manual describes Corporation. INS 8250 the 8086/8087/8088 Macro Asynchronous Communications Assembly Language, and is Element. This book documents intended for use by persons Physical and operating who are familiar with assenbly characteristics of the INS 8250. language. BibHography-l Notes: 8ib6ography-l APPENDIX C: CHARACTERS, KEYSTROKES, AND COLOR Color/Graphics Value As Characters Text Attributes Black Dark Grey Blue Black Light Green Black Light Green Ctrl L Black Light Red Ctrl M,.-J Black Light Magenta Shift ,.J Black Yellow 17 23 Ctrl W Blue Light Grey Characters, Keystrokes, and Color C-l Color/Graphics Value As Characters Text Attributes Hex Dec Symbol Keystrokes Modes Background Foreground 18 24 t Ctrl X Blue Dark Grey 19 25 j Ctrl Y Blue Light Blue 1A 26 - Ctrl Z Blue Light Green 1B 27 Ctrl [. Blue Light Cyan - Esc, Shift Esc, Ctrl Esc 1C 1D 1E 1F 28 29 30 31 -. L A Ctrl \ Ctrl] Ctrl6 Ctrl- Blue Blue Blue Blue Light Red Light Magenta Yellow White 20 32 Blank Space Bar, Green Black Space Shift, Space, Ctrl Space, Alt Space 21 33 ! ! Shift Green Blue 22 34 .. .. Shift Green Green 23 35 # # Shift Green Cyan 24 36 $ $ Shift Green Red 25 37 % % Shift Green Magenta 26 38 & & Shift Green Brown 27 39 Green Light Grey 28 40 ( ( Shift Green Dark Grey 29 41 ) ) Shift Green Light Blue 2A 42 * * Note 1 Green Light Green 28 43 + + Shift Green Light Cyan 2C 44 Green Light Red 2D 45 - - Green Light Magenta 2E 46 Note 2 Green Yellow 2F 47 / / Green White 30 48 0 0 Note 3 Cyan Black 31 49 1 1 Note 3 Cyan Blue 32 50 2 2 Note 3 Cyan Green 33 51 3 3 Note 3 Cyan Cyan C-2 Characters, Keystrokes, and Color Color/Graphics Value As Characters Text Attributes Hex Dec Symbol Keystrokes Modes Background Foreground 34 52 4 4 Note 3 Cyan Red 35 53 5 5 Note 3 Cyan Magenta 36 54 6 6 Note 3 Cyan Brown 37 55 7 7 Note 3 Cyan Light Grey 38 56 8 8 Note 3 Cyan Dark Grey 39 57 9 9 Note 3 Cyan Light Blue 3A 58 Shift Cyan Light Green I Cyan Light Cyan 3B 59 3C 60 < < Shift Cyan Light Red 3D 61 = = Cyan Light Magenta 3E 62 > > Shift Cyan Yellow 3F 63 ? ? Shift Cyan White 40 64 @ @ Shift Red Black 41 65 A A Note 4 Red Blue 42 66 B B Note 4 Red Green 43 67 C C Note 4 Red Cyan 44 68 0 0 Note 4 Red Red 45 69 E E Note 4 Red Magenta 46 70 F F Note 4 Red Brown 47 71 G G Note 4 Red Light Grey 48 72 H H Note 4 Red Dark Grey 49 73 I I Note 4 Red Light Blue 4A 74 J J Note 4 Red Light Green 4B 75 K K Note 4 Red Light Cyan 4C 76 L L Note 4 Red Light Red 40 77 M M Note 4 Red Light Magenta 4E 78 N N Note 4 Red Yellow 4F 79 0 0 Note 4 Red White 50 80 P P Note 4 Magenta Black 51 81 Q Q Note 4 Magenta Blue 52 82 R R Note 4 Magenta Green 53 83 S S Note 4 Magenta Cyan 54 84 T T Note 4 Magenta Red Characters, Keystrokes, and Color C-3 Color/Graphics Value As Characters Text Attributes Hex Dec Symbol Keystrokes Modes Background Foreground 55 85 U U Note 4 Magenta Magenta 56 86 V V Note 4 Magenta Brown 57 57 W W Note 4 Magenta Light Grey 58 88 X X Note 4 Magenta Dark Grey 59 89 Y Y Note 4 Magenta Light Blue 5A 90 Z Z Note 4 Magenta Light Green 5B 91 [ [ Magenta Light Cyan 5C 92 \ \ Magenta _ Light Red 5D 93 1 1 Magenta Light Magenta 5E 94 A A Shift Magenta Ye[low 5F 95 - - Shift Magenta White 60 96 . . Yellow Black 61 97 a a Note 5 Yellow Blue_ 62 98 b b Note 5 Yellow Green 63 99 c c Note 5 Yellow Cyan 64 100 d d Note 5 Yellow Red 65 101 e e Note 5 Yellow Magenta 66 102 f f Note 5 Yellow Brown 67 103 g g Note 5 Yellow Light Grey 68 104 h h Note 5 Yellow Dark Grey 69 105 i i Note 5 Yellow Light Blue 6A 106 j j Note 5 Yellow Light Green 6B 107 k k Note 5 Yellow Light Cyan 6C 108 I I Note 5 Yellow Light Red 6D 109 m m Note 5 Yellow Light Magenta 6E 110 n n Note 5 Yellow Yellow 6F 111 a a Note 5 Yellow White 70 112 p p Note 5 White Black 71 113 q q Note 5 White Blue 72 114 r r Note 5 White Green 73 115 s s Note 5 White Cyan 74 116 f f Note 5 White Red 75 117 u u Note 5 White Magenta 76 118 v v Note 5 White Brown C-4 Characters, Keystrokes, and Color Color /Graphics Value As Characters Text Attributes Hex Dec Symbol Keystrokes Modes Background Foreground 77 119 w w Note 5 White Light Grey 78 120 x x Note 5 White Dark Grey 79 121 y y Note 5 White Light Blue 7A 122 z z Note 5 White Light Green 7B 123 { { Shift White Light Cyan 7C 124 I I Shift White Light Red I I 70 125 I I Shift White Light Magenta 7E 126 ~ ~ Shift White Yellow 7F 127 {j. Ctrl- White White * * * * 80 to FF Hex are Flashing if Blink is Enabled * * * * 80 128 c: Alt 128 Note 6 Black Black 81 129 ii Alt 129 Note 6 Black Blue 82 130 e Alt 130 Note 6 Black Green 83 131 a Alt 131 Note 6 Black Cyan 84 132 a Alt 132 Note 6 Black Red 85 133 11 Alt 133 Note 6 Black Magenta 86 134 a Alt 134 Note 6 Black Brown 87 135 <; Alt 135 Note 6 Black Light Grey 88 136 Eo Alt 136 Note 6 Black Dark Grey 89 137 e Alt 137 Note 6 Black Light Blue 8A 138 e Alt 138 Note 6 Black Light Green 8B 139 "j Alt 139 Note 6 Black Light Cyan 8C 140 I Alt 140 Note 6 Black Light Red 80 141 I Alt 141 Note 6 Black Light Magenta 8E 142 A Alt 142 Note 6 Black Yellow 8F 143 A Alt 143 Note 6 Black White 90 144 E Alt 144 Note 6 Blue Black 91 145 z Alt 145 Note 6 Blue Blue 92 146 j( Alt 146 Note 6 Blue Green 93 147 6 Alt 147 Note 6 Blue Cyan 94 148 i:i Alt 148 Note 6 Blue Red 95 149 0 Alt 149 Note 6 Blue Magenta Characters, Keystrokes, and Color C-5 Color/Graphics Value As Characters Text Attributes Hex Dec Symbol Keystrokes Modes Background Foreground 96 150 U Alt 150 Note 6 Blue Brown 97 151 U Ait 151 Note 6 Blue Light Grey 98 152 Y Alt 152 Note 6 Blue Dark Grey 99 153 6 Alt 153 Note 6 Blue Light Blue 9A 154 U Alt 154 Note 6 Blue Light Green 9B 155 q; Alt 155 Note 6 Blue Light Cyan 9C 156 £ Alt 156 Note 6 Blue Light Red 90 157 ¥ Ait 157 Note 6 Blue Light Magenta 9E 158 Pt Alt 158 Note 6 Blue Yellow 9F 159 J Alt 159 Note 6 Blue White AO 160 a Alt 160 Note 6 Green Black Al 161 i Alt 161 Note 6 Green Blue A2 162 6 Alt 162 Note 6 Green Green A3 163 U Alt 163 Note 6 Green Cyan A4 164 ii Alt 164 Note 6 Green Red A5 165 N Alt 165 Note 6 Green Magenta A6 166 a Alt 166 Note 6 Green Brown A7 167 a Alt 167 Note 6 Green Light Grey A8 168 l Alt 168 Note 6 Green Dark Grey A9 169 r- Alt 169 Note 6 Green Light Blue AA 170 --, Alt 170 Note 6 Green Light Green AB 171 'h Alt 171 Note 6 Green Light Cyan AC 172 V- Alt 172 Note 6 Green Light Red AD 173 i Alt 173 Note 6 Green Light Magenta AE 174 « Alt 174 Note 6 Green Yellow AF 175 » Alt 175 Note 6 Green White BO 176 ... Alt 176 Note 6 Cyan Black Bl 177 I Alt 177 Note 6 Cyan Blue B2 178 I Alt 178 Note 6 Cyan Green B3 179 Alt 179 Note 6 Cyan Cyan B4 180 f...-- Alt 180 Note 6 Cyan Red B5 181 I Alt 181 Note 6 Cyan Magenta B6 182 ~T Alt 182 Note 6 Cyan Brown C-6 Characters, Keystrokes, and Color Color/Graphics Value As Characters Text Attributes Hex Dec Symbol Keystrokes Modes Background Foreground B7 183 r-------n Alt 183 Note 6 Cyan Light Grey B8 184 1====1 Alt 184 Note 6 Cyan Dark Grey B9 185 F==:I Alt 185 Note 6 Cyan Light Blue BA 186 I Alt 186 Note 6 Cyan Light Green BB 187 hl Alt 187 Note 6 Cyan Light Cyan ~ BC 188 ~ Alt 188 Note 6 Cyan Light Red ~ E BD 189 f------lJ Alt 189 Note 6 Cyan Light Magenta BE BF 190 191 ==l ---, Alt 190 Alt 191 Note 6 Note 6 Cyan Cyan Yellow White I CO 192 L- Alt 192 Note 6 Red Black Cl 193 Alt 193 Note 6 Red Blue C2 194 Alt 194 Note 6 Red Green C3 195 ~ Alt 195 Note 6 Red Cyan C4 196 Alt 196 Note 6 Red Red C5 C6 197 198 , Alt 197 Alt 198 Note 6 Note 6 Red Red Magenta Brown C7 199 t--- Alt 199 Note 6 Red Light Grey C8 200 ....'::::::::: Ait 200 Note 6 Red Dark Grey C9 201 ---11- rr== Alt 201 Note 6 Red Light Blue CA 202 Alt 202 Note 6 Red Light Green CB 203 ----, .---- Alt 203 Note 6 Red Light Cyan CC 204 1:== Alt 204 Note 6 Red Light Red CD 205 Alt 205 Note 6 Red Light Magenta CE 206 ~~ Alt 206 Note 6 Red Yellow CF 207 Alt 207 Note 6 Red White DO 208 Alt 208 Note 6 Magenta Black Dl 209 Alt 209 Note 6 Magenta Blue D2 210 Alt 210 Note 6 Magenta Green D3 211 LL- Alt 211 Note 6 Magenta Cyan D4 212 1:::::= Alt 212 Note 6 Magenta Red D5 213 1== Alt 213 Note 6 Magenta Magenta D6 214 rr--- Alt 214 Note 6 Magenta Brown D7 215 Alt 215 Note 6 Magenta Light Grey Characters, Keystrokes, and Color C-7 Color/Graphics Value As Characters Text Attributes Hex Dec Symbol Keystrokes Modes Background Foreground C-8 Characters, Keystrokes, and Color Color/Graphics Value As Characters Text Attributes Hex Dec Symbol Keystrokes Modes Background Foreground F9 FA 249 250 •• Alt 249 Alt 250 Note 6 Note 6 White White Light Blue Light Green FB 251 r Alt 251 Note 6 White Light Cyan FC 252 1/ Alt 252 Note 6 White Light Red FD 253 2 Alt 2'53 ·Note 6 White Light Magenta FE FF 254 255 • BLANK Alt 254 Alt 255 Note 6 Note 6 White White Yellow White Characters, Keystrokes, and Color C-9 NOTE 1 On the 62-key keyboard the Asterisk (*) can be keyed using two methods: 1) in the shift mode hit the ~ key or 2) hold Alt key and press the LJ key. On the 83-key keyboard the Asterisk (*) can be keyed using two methods: I I 1) hit the Pr: Sc key or 2) in the shift mode hit the [;] key. NOTE 2 Period (.) can easily be keyed using two methods: 1) hit the 0 key or 2) in shift or Num Lock mode hit the I D~II 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) on the 83-key keyboard in shift or Num Lock mode hit the numeric keys in the 1 a-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 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 key or 2) In Caps Lock combined with shift mode hit the appropriate alphabetic key. NOTE 5 On the 52-key keyboard set Num Lock state using Alt/Fn/N then 3 digits after the Alt key must be typed from the numeric keys on the top row of the typematic portion of the keyboard. Character codes 000 through 255 can be entered in this fashion. (With Caps Lock activated, character codes 97 through 122 will display upper case rather than lower case alphabetic characters.) On the 83-key keyboard the 3 digits after the Alt key must be typed from the numeric key pad (keys 71-73, 75-77, 79-82). C-IO Characters, Keystrokes, and Colors Character Set (OO-7F) Quick Reference DECIMAL VALUE • ..- 1~~~~~Al 0 IVAI 0 16 1 32 48 64 80 96 112 2 3 4 5 6 7 0 @ P BLANK BLANK I 0 0 ~ (NULL) (SPACE) P 1 1 ~ ...... I• 1 A Q a q 2 3 2 3 - t " 2 B R b II # 3 C 5 c ~ •• r s 4 4 + 9T $ 4 D T dt + § % 5 E U e u - 5 5 6 6 ~ & 6 F V f v , 7 7 • t 7 G W 9 W 8 8 t ( 8 H X h x 9 9 0 ! ) 9 I Y I• y 10 ----. * •• J Z . z A J 11 B cJ +-- + ,• K [ k { I 12 C 9 L , < L \ I I 13 D .P .-.... - -- M ] m } 14 E -b • • > N /\ n rv 15 F ¢- . / ?• 0 - 0 d Characters, Keystrokes, and Colors C-ll Character Set (80-FF) Quick Reference .. • C DECIMAL VALUE 0 I~~~~.:., [VALUE 0 128 144 160 176 192 208 224 240 8 9 ... E a ••• ••• ••• A , B C D I E ex: --- F .I~ , :; 1 1 U , •• ce I , : {3 + 2 2 e J£ 0 I = r >- a-.. 0- I , lL 3 3 u f-- rr < - 4 4 .. a 0 n - - b I r 5 5 a" 0" N == - F a J • a u a --1 0 ,A. 6 6 ~ - J.L - • " 7 7 t; U 0 11 T ~ 8 8 - •• e y.. l ~ 0 9 9 .. e 0.. I ~ -.JL .-- 0 • 10 A e" u -, n • •• ¢ =t - 0 11 12 B C I -I £ 1/2 1/4 d 00 "" n ¥ I .JJ • 13 D "I ¢ 2 14 E w A R « bd II E I 15 F A f »n n BLANK 'FF' C-12 Characters, Keystrokes, and Colors Appendix D. UNIT SPECIFICATIONS System Unit Size: Length 354 mm (13.9 in.) Depth 290 mm (11.4 in.) Height 97 mm (3.8 in.) Weight: 3.71 Kg (81b 40z) With Diskette Drive 2.61 Kg (Sib 80z) Without Diskette Drive Transformer: Electrical: Input 110 Vac 60 Hz Output to System Pin 1 - 17 Vac, Pin 2 - GND, Pin 3 - 17 Vac Power Cords: Input Length 1.86 meters (6.14 feet) Type 18AWG Output Length 1.22 meters (4.02 feet) Type 18AWG Unit Specifications D-l Environment: Air Temperature System ON 15.6 to 32.2 degrees C (60 to 90 degrees F) System Off 10 to 43 degrees C (50 to 110 degrees F) Humidity System On 8% to 80% System Off 8% to 80% Noise Level 45 dB Cordless Keyboard Size: Length 341.5 nun (13.45 in.) Depth 168 nun (6.61 in.) Height 26 nun (1.02 in.) Weight: With Batteries 616 grams (22 ounces) Without Batteries 700 grams (25 ounces) Optional Cable: 6 feet, flat Diskette Drive D-2 Unit Specifications Size: Height 41.6 mm (1.6 in.) Depth 146 mm (5.S in.) Width 20S mm (S.3 in.) Weight: 1.1 kilograms (2.2 pounds) Diskette Drive Power: Supply Voltage +5 Vdc Input +12 Vdc Input Nominal +5 Vdc +12 Vdc Ripple +5 Vdc Input + 12 Vdc Input o to 50 kHz 100mV 100mV Tolerance +5 Vdc Input + 12 Vdc Input Including Ripple +/- 5% +/- 5% Unit Specifications D-3 Standby Current +5 Vdc Input +12 Vdc Input Nominal 600mA 400mA Worst Case 700 rnA 500 rnA Operating Current +5 Vdc Input + 12 Vdc Input Nominal 600mA 900mA Worst Case 700mA 2400mA Mechanical and Electrical Media Industry-compatible 5 1/4 inch diskette Media Life (Head Loaded) 3,000,000 revolutions/track Media Life (Insertions) 30,000 Tracks Density 48 tracks/inch Number of Tracks 40 Motor Start Time 500 ms Instantaneous Speed Variation +/- 3.0% Rotational Speed 300 rpm +/- 1.5% (long term) Nominal Transfer Rate (MFM) 250,000 pulses/second MTBF (25% Operating) 8,000 POH Read Bit Shift + / - 800 ns maximum Seek Time 6 ms track-to-track maximum Head Life 20,000 hours (normal use) Head Load Time Not Applicable Head Settling Time 21 ms maximum (from last step pulse) Error Rate D-4 Unit Specifications Soft Error 1 per 1,000,000,000 bits maximum (recoverable within 10 retries) Hard Error 1 per 1,000,000,000,000 bits maximum (nonrecoverable within 10 retries) Access Error 1 per 3,000,000 seeks maximum Temperature (Exclusive of media) Operating 50 to 122 degrees F (10 to 44 degrees C) Non-operating -40 to 140 degrees F (-40 to 60 degrees C) Relative Humidity (Exclusive of media) Operating 20 to 80% (noncondensing) Non-operating 5 to 95% (noncondensing) Operating Altitude 7,000 feet above sea level Operating Vibration 5 to 500 Hz IIG Color Display Size: Height 297 mm (11.7 in.) Depth 407 mm (15.6 in.) Width 392 mm (15.4 in.) Unit Specifications D-S Weight: 11.8 kilograms (26 pounds) Heat Output: 240 BTU/hour Power Cables: Length 1.83 meters (6 feet) Size 22AWG Graphics Printer Size: Height 110 mm (4.3 in.) Depth 370 mm (14.5 in.) Width 400 mm (15.7 in.) Weight: 5.9 kilograms (12.9 pounds) Heat Output: 341 BTU/hour D-6 Unit Specifications Power Cable: Length 1.83 meters (6 feet) Size 18AWG Signal Cable: Length 1.83 meters (6 feet) Size 22AWG Electrical: Minimum 104 Vac Nominal 120 Vac Maximum 127 Vac Internal Modem Power: Parameter + 5 Vdc Voltage + 12 Vdc Voltage Tolerance +/-5% +/-10% Ripple 50 mY, P-P 50 mY, P-P Maximum Current 300mA 50mA Current Nominal 150mA 25mA Interface RS232C Unit Specifications D-7 Compact Printer Size: Height 88.9 mm (3.5 in) Depth 221 mm (8.7 in) Width 312.4 mm (12.3 in) Weight: 2.99 kg (6.6 lb) Heat Output: 54.6 Btujhr Power Cable: Length 1.89 mm (6 ft) Size 28 AWG Signal Cable: Length 1.89 m (6 ft) Size 3 by 18 AWG Electrical: Voltage 110 Vac 60 Hz D-8 Unit Specifications Glossary /1s Microsecond. including parity check), used for information interchange among data processing systems, adapter. An auxiliary system or data communication systems unit used to extend the and associated equipment. The operation of another system. ASCII set consists of control characters and graphic address bus. One or more characters. conductors used to carry the binary-coded address from the A/N. Alphanumeric. microprocessor throughout the rest of the system. analog. (1) pertaining to data aU points addressable (APA). A in the form of continuously mode in which all points on a variable physical quantities. displayable image can be (2) Contrast with digital. controlled by the user. alphanumeric AND. A logic operator having (A/N). Pertaining to a the property that if P is a character set that contains statement, Q is a statement, R letters, digits, and usually other is a statement, ... , then the AND characters, such as punctuation of P, Q, R, .. .is true if all marks. Synonymous with statements are true, false if any alphameric. statement is false. APA. All points addressable. American Standard Code for Information ASCII. American Standard Interchange. (ASCII) The Code for Information standard code, using a coded Interchange. character set consisting of 7-bit coded characters (8 bits Glossary-l assembler. A computer asynchronous transmission, the program used to assemble. unit of modulation rate Synonymous with assembly corresponding to one unit of program. interval per second; that is , if the duration of the unit interval asynchronous is 20 milliseconds, the communications. A modulation rate is 50 baud. communication mode in which each single byte of data is synchronized, usually by the Bec. Block-check character. addition of start/stop bits. beginner's all-purpose symbolic BASIC. Beginner's all-purpose instruction. code (BASIC) A symbolic instruction code. programming language with a small repertoire of commands and a simple syntax, primarily basic input/output system designed for numerical (BIOS). Provides the device application. level control of the major I/O devices in a computer system, binary. ( 1) Pertaining to a which provides an operational selection, choice, or condition interface to the system and that has two possible values or relieves the programmer from states. (2) Pertaining to a fIxed concern over hardware device radix numeration system having characteristics. a radix of two. baud. (1) A unit of signaling binary digit. ( 1) In binary speed equal to the number of notation, either of the discrete conditions or signal characters 0 or 1. (2) events per second. For Synonymous with bit. binary example, one baud equals notation: Any notation that one-half dot cycle per second uses two different characters, in Morse code, one bit per usually the binary digits 0 and second in a train of binary 1. signals, and one 3-bit value per second in a train of signals each of which can assume one of BIOS. Basic input/output eight different states. (2) In system. Glossary-2 bit. In binary notation, either buffer. (1) An area of storage of the characters 0 or 1. that is temporarily reserved for use in performing an bits per second (bps). A unit of input/ output operation, into measurement representing the which data is read or from number of discrete binary digits which data is written. which can be transmitted by a Synonymous with I/O area. device in one second. (2) A portion of storage for temporarily holding input or block-check character output data. (BCC). In cyclic redundancy checking, a character that is bus. One or more conductors transmitted by the sender after used for transmitting signals or each message block and is power. compared with a block-check character computed by the byte. (1) A binary character receiver to determine if the operated upon as a unit and transmission was successful. usually shorter than a computer word. (2) The representation of a character. Boolean operation. (1) Any operation in which each of the operands and the result take CAS. Column address strobe. one of two values. (2) An operation that follows the rules of Boolean algebra. cathode ray tube (CRT). A vacuum tube display in which a beam of electrons can be bootstrap. A technique or controlled to form device designed to bring itself alphanumeric characters or into a desired state by means of symbols on a luminescent its own action; that is, a screen, for example by use of a machine routine whose first dot matrix. few instructions are sufficient to bring the rest of itself into cathode ray tube display (CRT the computer from an input display). (1) A device that device. presents data in visual form by means of controlled electron bps. Bits per second. Glossary-3 beams. (2) The data display computer program in a produced by the device as in symbolic form that can be (1). accepted by a data processor. column address strobe( CAS). A CCITf. Comite Consultatif signal that latches the column International Telegrafique et addresses in a memory chip. Telephonique. Comite Consultatif central processing unit International. Telegrafique et (CPU). A functional unit that Teleponique (CCITT) consists of one or more Consultative Committee on processors and all or part of International Telegraphy and internal storage. Telephone. channel. A path along which signals can be sent; for computer. A functional unit example, data channel or I/O that can perform substantial channel. computation, including numerous arithmetic characters per second (cps). A operations, or logic operations, standard unit of measurement without intervention by a for printer output. human operator during the run. code. (1) A set of unambiguous configuration. (1) The rules specifying the manner in arrangement of a computer which data may be represented system or network as defined in a discrete form. by the nature, number, and the Synonymous with coding chief characteristics of its scheme. (2) A set of items, functional units. More such as abbreviations, specifically, the term representing the members of configuration may refer to a another set. (3) Loosely, one or hardware configuration or a more computer programs, or software configuration. (2) The part of a computer program. devices and programs that (4) To represent data or a make up a system, subsystem, or network. Glossary-4 conjunction. (I) The Boolean distance from the axis about operation whose result has the which the disk rotates. (2) The Boolean value 1 if, and only if, tracks of a disk storage device each operand has the Boolean that can be accessed without value 1. (2) Synonymous with repositioning the access AND operation. mechanism. contiguous. (1) Touching or joining at the edge or daisy-chained cable. A type of boundary. (2) Adjacent. cable that has two or more connectors attached in series. cps. Characters per second. data. (I) A representation of facts, concepts, or instructions cpu. Central processing unit. in a formalized manner suitable for communication, CRe. Cyclic redundancy interpretation, or processing by check. humans or automatic means. (2) Any representations, such CRT display. Cathode ray tube as characters or analog display. quantities, to which meaning is, or might be assigned. CTS. Clear to send. Associated with modem decibel (dB). (1) A unit that control. expresses the ratio of two power levels on a logarithmic scale. (2) A unit for measuring cyclic redundancy check relative power. The number of (CRC). (1) A redundancy decibels is ten times the check in which the check key is logarithm (base 10) of the ratio generated by a cyclic algorithm. of the measured power levels; (2) A system of error checking if the measured levels are performed at both the sending voltages (across the same or and receiving station after a equal resistance), the number block-check character has been of decibels is 20 times the log accumulated. of the ratio. cylinder. (1) The set of all decoupling capacitor. A tracks with the same nominal capacitor that provides a Glossary-S low-impedance path to ground direct memory access to prevent common coupling (DMA). A method of between states of a circuit. transferring data between main storage and 110 devices that does not require processor Deutsche Industrie Norm intervention. (DIN). (1) German Industrial Norm. (2) The committee that disk. Loosely, a magnetic disk sets German dimension unit: standards. diskette. A thin, flexible magnetic disk and a semi-rigid digit. (1) A graphic character protective jacket, in which the that represents an integer, for disk is permanently enclosed. example, one of the characters Synonymous with flexible disk. o to 9. (2) A symbol that represents one of the . non-negative integers smaller DMA. Direct memory access. than the radix. For example, in decimal notation, a digit is one DSR. Data set ready. of the characters from 0 to 9. Associated with modem control. digital. (1) Pertaining to data in the form of digits. (2) Contrast DTR. Data terminal ready. with analog. Associated with modem control. DIN. Deutsche Industrie Norm. dual in-line package (DIP). A widely used container for an DIN Connector. One of the integrated circuit. DIPs are connectors specified by the pins usually in two parallel DIN standardization rows. These pins are spaced committee. 1/ 10 inch apart and come in different configurations ranging DIP. Dual in-line package. from 14-pin to 40-pin configurations. Glossary-6 EBCDIC. Extended EOT. end-of-transmission binary-coded decimal character. interchange code. EPROM. Erasable ECC. Error checking and programmable read-only correction. memory edge connector. A terminal erasable pr~ble block with a number of read-only. memory (EPROM) contacts attached to the edge A storage device whose of a printed circuit board to contents can be erased by facilitate plugging into a ultraviolet means and new foundation circuit. contents stored by electrical means. EPROM information is not destroyed when power is EIA. Electronic Industries removed. Association. error checking and correction EIA/CCITf. Electronic (ECC). The detection and Industries correction of all single-bit, Association/ Consultative double-bit, and some Committee on International multiple-bit errors. Telegraphy and Telephone. ETX. End-of-text character. end-of-text character (ETX). A transmission control character used to terminate extended binary-coded decimal text. interchange code. (EBCDIC) A set of 256 characters, each end-of-transmission character represented by eight bits. (EOT). A transmission control character used to indicate the conclusion of a transmission, flexible disk. Synonym for which may have included one diskette. or more texts and any assoceated message headings. Glossary-7 firmware. Memory chips with Hz. Hertz. integrated programs already incorporated on the chip. interface. A device that alters or converts actual electrical gate. (1) A device or circuit signals between distinct that has no output until it is devices, programs, or systems. triggered into operation by one or more enable signals, or until an input signal exceeds a k. An abbreviation for the predetermined threshold prefix kilo;that is, 1,000 amplitude. (2) A signal that decimal notation. triggers the passage of other signals through a circuit. K. When referring to storage graphic. A symbol produced by capacity, 2 to the tenth power; a process such as handwriting, 1,024 in decimal notation. drawing, or printing. KB (Kilobyte). 1,024 bytes. hertz (Hz). A unit of frequency equal to one cycle per second. k byte. 1,024 bytes. hex. Abbreviation for kHz. A unit of frequency equal hexadecimal. to 1,000 hertz. hexadecimal (Hex). Pertaining kilo(k). One thousand. to a selection, choice, or condition that has 16 possible values or states. These values latch. (l) A feedback loop in or states usually contain 10 symmetrical digital circuits digits and 6 letters, A through used to maintain a state. (2) A F / Hexadecimal digits are simple logic-circuit storage equivalent to a power of 16. element comprising two gates as a unit. high-order position. The leftmost position in a string of characters. LED. Light-emitting diode. Glossary-8 light-emitting diode (LED). A mega (M). 10 to the sixth semi-conductor chip that gives power, 1,000,000 in decimal off visible or infrared light notation. When referring to when activated. storage capacity, 2 to the twentieth power. 1,048,576 in low-order position. The decimal notation. rightmost position in a string of characters. megabyte (MB). 1,048,576 bytes. m. (1) Milli; one thousand or megahertz (MHz). A unit of thousandth part. (2) Meter. measure of frequency. One megahertz equals 1,000,000 hertz. M (Mega). 1,000,000 in decimal notation. When referring to storage capacity, 2 MFM. Modified frequency to the twentieth power; modulation. 1,048,576 in decimal notation. MHz. Megahertz. mAo Milliampere. microprocessor. An integrated machine language. (I) A circuit that accepts coded language that is used directly instructions for execution; the by a machine. (2) Another instructions may be entered, term for computer instruction integrated, or stored internally. code. microsecond. (ps) One-mil- main storage. A storage device lionth of a second. in which the access time is effectively independent of the milli(m). One thousand or one location of the data. thousandth. miJIiampere(mA). One MB. Megabyte, 1,048,576 thousandth of an ampere. bytes. millisecond(ms). One thousandth of a second. Glossary-9 mnemonic. A symbol chosen to modulo check. A calculation assist the human memory; for performed on values entered example, an abbreviation such into a system. This calculation as "mpy" for "multiply." is designed to detect errors. mode. (1) A method of monitor. (l) A device that operation; for example, the observes and verifies the binary mode, the interpretive operation of a data processing mode, the alphanumeric mode. system and indicates any (2) The most frequent value in specific departure from the the statistical sense. norm. (2) A television type display, such as the IBM modem Monochrome Display. (Modulator-Demodulator). A (3) Software or hardware that device that converts serial (bit observes, supervises, controls, by bit) digital signals from a or verifies the operations of a business machine (or data system. terminal equipment) to analog signals which are suitable for ms. Millisecond; one transmission in a telephone thousandth of a second. network. The inverse function is also performed by the multiplexer. A device capable modem on reception of analog of distributing the events of an signals. interleaved sequence to the respective activities. modified frequency modulation (MFM). The process of varying the amplitude and NAND. A logic operator frequency of the "write" having the property that if P is signal. MFM pertains to the a statement, Q is a statement, number of bytes of storage that R is a statement, ... , then the can be stored on the recording NAND of P,Q,R, .. .is true if at media. The number of bytes is least one statement is false, twice the number contained in false if all statements are true. the same unit area of recording media at single density. nanosecond. (ns) One-billionth of a second. Glossary-tO nonconjunction. (I) The dyadic operating system. Software that Boolean operation the result of controls the execution of which has the Boolean value 0 programs; an operating system if, and only if, each operand may provide services such as has the Boolean value 1. resource allocation, scheduling, input/ output control, and data non-retum-to-zero inverted management. (NRZI). A transmission encoding method in which the data terminal equipment OR. (1) A logic operator changes the signal to the having the property that if P is opposite state to send a binary a statement, Q is a statement, o and leaves it in the same state R is a statement, ... ,then the to send a binary 1. OR of P,Q,R, .. .is true if at least one statement is true, false if all statements are false. NOR. A logic operator having the property that if P is a statement, Q is a statement, R output. Pertaining to a device, is a statement, ... ,then the NOR process, or channel involved in of P,Q,R, .. .is true if all an output process, or to the statements are false, false if at data or states involved in an least one statement is true. output process. NOT. A logical operator output process. (I) The process having the property that if P is that consists of the delivery of a statement, then the NOT of P data from a data processing is true if P is false, false if P is system, or from any part of it. true. (2) The return of information from a data processing system NRZI. Non-return-to-zero to an end user, including the inverted. translation of data from a machine language to a language that the end user can os. Nanosecond; one-billionth understand. of a second. overcurrent. A current of higher than specified strength. Glossary-II ove"oltage. A voltage of picture element (PEL). (1) The higher than specified value. smallest displayable unit on a display. (2) Synonymous with pixel, PEL. parallel. (1) Pertaining to the concurrent or simultaneous pinout. A diagram of operation of two or more functioning pins on a pinboard. devices, or to the concurrent performance of two or more pixel. Picture element. activities. (2) Pertaining to the concurrent or simultaneous polling. (1) Interrogation of occurrence of two or more devices for purposes such as to related activities in multiple avoid contention, to determine devices or channels. operational status, or to (3) Pertaining to the determine readiness to send or simultaneity of two or more receive data. (2) The process processes. (4) Pertaining to the whereby stations are invited, simultaneous processing of the one at a time, to transmit. individual parts of a whole, such as the bits of a character port. An access point for data and the characters of a word, entry or exit. using separate facilities for the various parts. (5) Contrast with printed circuit board. A piece serial. of material, usually fiberglass, that contains a layer of conductive material, usually PEL. Picture element. metal. Miniature electronic components on the fiberglass transmit electronic signals personal computer. A small through the board by way of home or business computer the metal layers. that has a processor and keyboard and that can be program. (1) A series of actions connected to a television or designed to achieve a certain some other monitor. An result. (2) A series of optional printer is usually instructions telling the available. computer how to handle a Glossary-12 problem or task. (3) To design, numeration system, the radix of write, and test computer each digit place is 1.0. programs. (2) Another term for base. programable read-only memory radix numeration system. A (PROM). Non-erasable positional representation programable memory. PROM system in which the ratio of the information is not destroyed weight of anyone digit place to when power is removed. the weight of the digit place with the next lower weight is a programming language. (1) An positive integer. The artificial language established permissible values of the for expressing computer character in any digit place programs. (2) A set of range from zero to one less characters and rules, with than the radix of the digit meanings assigned prior to their place. use, for writing computer programs. RAS. Row address strobe. PROM. Programmable RGBI. Red-green-blue-intensity. read-only memory. read-only memory (ROM). A propagation delay. The time storage device whose contents necessary for a signal to travel cannot be modified, except by from one point on a circuit to a particular user, or when another. operating under particular conditions; for example, a storage device in which writing radix. (1) In a radix numeration is prevented by a lockout. system, the positive integer by which the weight of the digit read/write memory. A storage place is multiplied to obtain the device whose contents can be weight of the digit place with modified. the next higher weight; for example, in the decimal red-green-blue-intensity (R GBI). The description of a direct-drive Glossary-13 color monitor which accepts RTS. Request to send. red, green, blue, and intensity Associated with modem signal inputs. control. register. (1) A storage device, having a specified storage run. A single continuous capacity such as a bit, a byte, performance of a computer or a computer word, and program or routine. usually intended for a special purpose. (2) On a calculator, a storage device in which specific scan One. The use of a cathode data is stored. beam to test the cathode ray tube of a display used with a personal computer. RF modulator. The device used to convert the composite video schematic. The description, signal to the antenna level input usually in diagram form, of the of a home TV. logical and physical structure of an entire data base according to ROM. Read-only memory. a conceptual model. ROM/BIOS. The basic sector. That part of a track or input/ output system resident in band on a magnetic drum,a ROM, which provides the magnetic disk, or a disk pack device level control of the that can be accessed by the major I/O devices in the magnetic heads in the course of computer system. a predetermined rotational displacement of the particular device. ',. row address strobe (RAS). A signal that latches the row serdes. Serializer/ deserializer. a addresses in memory chip. serial. (l) Pertaining to the sequential performance of two RS-232C. The standards set or more activities in a single by the EIA for communications device. In English, the between computers and modifiers serial and parallel external equipment. usually refer to devices, as opposed to sequential and Glossary-14 consecutive, which refer to start-of-text character processes. (2) Pertaining to the (STX). A transmission control sequential or consecutive character that precedes a test occurrence of two or more and may be used to terminate related activities in a single the message heading. device or channel. (3) Pertaining to the sequential start signal. (1) A signal to a processing of the individual receiving mechanism to get parts of a whole, such as the ready to receive data or bits of a character or the perform a function. (2)In a characters of a word, using the start-stop system, a signal· same facilities for successive preceding a character or block parts. (4)Contrast with that prepares the receiving parallel. device for the reception of the code elements. Synonymous sink. A device or circuit into with start bit. which current drains. start-stop (SS) software. (I) Computer transmission. (I) A synchronous programs, procedures, rules, transmission such that a group and possible associated of signals representing a documentation concerned with character is preceded by a start the operation of a data signal and followed by a stop processing system. (2) Contrast, signal. (2) Asynchronous with hardware. transmission in which a group of bits is preceded by a start bit source. The origin of a signal that prepares the receiving or electrical energy. mechanism for the reception and registration of a character source circuit. (I) Generator and is followed by at least one circuit. (2) Control with sink. stop bit that enables the receiving mechanism for the reception and registration of a SSe Start-stop transmission. character and is followed by at least one stop bit that enables the receiving mechanism to start bit. Synonym for start come to an idle condition signal. pending the reception of the next character. Glossary-IS stop bit. Synonym for stop one STX and one ETX signal. transmission control, respectively. stop signal. (1) A signal to a receiving mechanism to wait track. The path or one of for the next signal. (2)In a the set of paths, parallel to the start-stop system, a signal reference edge on a data following a character or block medium, associated with a that prepares the receiving single reading or writing device for the reception of a component as the data medium subsequent character or block. moves past the component. Synonymous with stop bit. (2) The portion of a moving data medium such as a drum, strobe. (I) An instrument used tape, or disk, that is accessible to determine the exact speed of to a given reading head circular or cyclic movement. position. (2) A flashing signal displaying an exact event. transistor-transistor logic (TIL). A circuit in which the multiple-diode cluster of the STX. Start-of-text character. diode-transistor logic circuit has been replaced by a multiple-emitter transistor. synchronous transmission. Data transmission in which the sending and receiving devices TIL. Transistor-transistor are operating continuously at logic. the same frequency and are maintained, by means of TX Data. Transmit data. correction, in a desired phase Associated with modem relationship. control. External connections of the RS-232C asynchronous communications adapter text. In ASCII and data interface. communication, a sequence of characters treated as an entity if preceded and terminated by video. Computer data or displayed on a cathode ray tube monitor or display. Glossary-16 write precompensation. The tracks to the inner tracks of the varying of the timing of the diskette to keep a constant head current from the outer write signal. Glossary-I 7 Notes: Glossary-I 8 Index A +AO 3-7,3-72 +AO thru A3 3-20 AO thru A07, memory signal 3-7 AO thru A19, I/O signal 2-23 AO thru A14, program cartridge signal 2-114 Al 3-72 A2 3-72 A9 3-21,3-72 -ACKNLG, graphics printer signal 3-113 adapter See diskette drive adapter adapter ROM module addresses, valid 5-18 adapter cable for serial devices 3-89 connector specifications 3-90 signal cable 3-89 for cassette connector specifications 3-91 for IBM color display connector specifications 3-93 addresses FDC (data register) 3-17 FDC (status register) 3-17 parallel printer attachments 5-13 ROM modules, valid 5-18 RS232-C attachments 5-13 advanced BASIC, system ROM 4-13 ALE, I/O signal 2-24 ANSWER, modem command 3-44 ASCII, extended 5-21 -ATR CD IN 3-9 ATR LATCH 3-7 Index-l attachable joystick block diagram 3-78 connector specifications 3-79 electrical centering control 3-77 free floating mode 3-77 spring return mode 3-77 x-axis 3-77 y-axis 3-77 AUDIO IN, I/O signal 2-28 AUTO FEED XT 3-114 available options 1-3 B -BASE 1 ROM IN CARTRIDGE, program cartridge signal 2-115 -BASE 2 ROM IN CARTRIDGE, program cartridge signal 2-115 BASIC, cartridge 4-13 BASIC screen editor special functions 5-41 BASIC workspace variables 5-16 BAUDCLK 3-73 beeper block diagram 2-85 input sources 2-85 BEL, graphics printer control code 3-117 BIOS example, interrupt usage 5-5 interrupt hex 10 4-17 interrupt hex 14 4-18 interrupt hex 16 4-15 interrupt hex 1D 4-17 memory map 5-17 power-on initialization stack-area memory location 5-13 vectors list, interrupt 5-7 vectors with special meanings interrupt hex 1B - keyboard break address 5-8 interrupt hex 1C - timer tick 5-8 interrupt hex 1D - video parameters 5-9 interrupt hex 1E - diskette parameters 5-9 interrupt hex IF - graphics character pointers (2nd 128) 5-9 interrupt hex 44 - graphics character pointers (lst 128) 5-9 Index-2 interrupt hex 48 - cordless keyboard translation 5-10 interrupt hex 49 - non-keyboard scan-code translation-table address 5-10 BIOS cassette logic cassette read 5-49 cassette write 5-48 tape block components 5-50 tape block format 5-50 timing chart 5-49 data record architecture 5-50 error detection 5-51 software algorithms - interrupt hex 15 5-47 cassette status in AH 5-48 request types in register AH 5-47 block diagrams attachable joystick 3-78 beeper 2-85 cassette motor control 2-41 compact printer 3-134 diskette drive adapter 3-14 infra-red receiver 2-98 keyboard interface 2-106 memory and display expansion 3-6 modem 3-36 parallel printer attachment 3-97 read hardware 2-40 serial port (RS232) 2-127 sound subsystem 2-89 system 1-6 system board 2-9 video color/graphics subsystem 2-46 write hardware 2-40 bootstrap stack-area memory location 5-13 break, cordless keyboard 5-34 BREAK, modem command 3-44 buffer, cordless keyboard 5-36 bus cycle time 2-13 BUSY, graphics printer signal 3-113 Index-3 c cable, adapter See adapter cable cable, keyboard See keyboard cord cable, power See power cable cable, signal See signal cable -CABLE CONNECT 2-101,3-87 CAN, compact printer control code 3-141 CAN, graphics printer control code 3-118 -CARD INSTALL 3-73 -CARD SLCTD, I/O signal 2-28 cartridge BASIC 4-13 cartridge, program See program cartridge CARTRIDGE RESET TAB, program cartridge signal 2-116 +CAS 3-8 cassette BASIC, system ROM 4-12 cassette interface block diagram, cassette motor control 2-41 block diagram, read hardware 2-40 block diagram, write hardware 2-40 connector specifications 2-41 motor control 2-41 output to audio subsystem 2-39 cassette logic, BIOS See BIOS cassette logic character codes, cordless keyboard 5-27 character set, compact printer 3-148, 3-149 character set 1 3-128 description 3-109 character set 2 3-130 description 3-109 CLK, I/O signal 2-23 clock crystal frequency, system 2-6 color burst signal frequency 2-6 color display connector specifications 3-83 electrical requirements 3-81 horizontal drive frequency 3-82 operating characteristics 3-82 4-Index screen characteristics 3-82 video bandwidth 3-82 color / graphics all points addressable graphics (APA) mode high-resolution 2-color 2-58 high-resolution 4-color 2-59 low-resolution 16-color 2-56 medium-resolution 4-color 2-57 medium-resolution 16-color 2-58 modes available 2-56 screen border colors 2-45 storage organization memory map 2-61 alphanumeric (AjN) mode attribute byte definition 2-55 attributes 2-43 display character format 2-54 block diagram 2-46 character size and description 2-43 characters available 2-44 composite connector specifications 2-83 CRT page register 2-47 CRT j processor page register CRT page 0 thru 2 2-79 processor page 0 thru 2 2-79 video adr mode 0 and 1 2-80 direct drive connector specifications 2-82 four-color mode palette 2-50 light pen connector specifications 2-75 memory map 2-48 mode selection summary 2-81 sequence for changing modes 2-81 page register 2-47 programming considerations 6845 CRT controller 2-75 register table 2-76 RF connector specifications 2-83 ROM character generator· 2-44, 2-49 sixteen-color mode palette 2-52 storage organization accessing the RAM 2-47 RAM address 2-47 summary of available colors 2-53 two-color mode palette 2-50 video bandwidth 2-49 Index-5 video gate array address register 2-74 border color register bit functions 2-66 mode control I register bit functions 2-64 mode control 2 register bit functions 2-66 attribute byte definition 2-67 mode selection summary 2-81 palette mask register bit functions 2-65 palette registers 2-71 format 2-71 register addresses 2-63 reset register bit functions 2-69 sequence for changing modes 2-81 status register bit functions 2-73 vertical retrace interrupt 2-82 video I/O devices and addresses 6845 CRT 2-45,2-47,2-75 register table 2-76 command character, modem 3-40 commonly used functions, cordless keyboard 5-38 compact printer block diagram 3-134 character set 3-148, 3-149 connector specifications 3-150 control codes 3-140 thru 3-141 thru 3-147 description 3-133 print mode combinations, allowable 3-140 serial interface description 3-139 timing diagram 3-139 signal cable 3-133 specifications, general 3-135 thru 3-138 compatibility to Personal Computers black and white monochrome display 4-18 color graphics capability differences 4-15 color modes available only on PCjr 4-16 comparison, PCjr to Personal Computers hardware 4-10 non-DMA operation considerations 4-19 screen buffer differences 4-12 software determination of the computer 4-19 timing dependencies 4-5 unequal configurations 4-7 user available read/write memory 4-12 video hardware address difference 4-16 6-Index complex sound generator See SN76496N See sound subsystem connector for television channel selector switch 3-85 computer / television selector switch 3-85 connector specifications 3-86 signal cable 3-85 connector locations, system board 2-10 connector specifications adapter cable for cassette 3-91 adapter cable for color display 3-93 adapter cable for serial devices 3-89 attachable joystick 3-79 audio 2-87 cassette (system board) 2-41 color display 3-83 compact printer 3-150 composite video (system board) 2-83 connector for television 3-85 direct drive (system board) 2-82 diskette drive 3-29 diskette drive adapter 3-25 games interface (system board) 2-123 graphics printer 3-115 infra-red receiver (system board) 2-100 I/O expansion 2-22 keyboard cord 3-88 light pen (system board) 2-75 memory and display expansion 3-10 modem 3-75 parallel printer attachment 3-104 power board 2-136 program cartridge 2-117 RF modulator (system board) 2-83 system board 2-10 control codes, compact printer 3-140 thru 3-147 control codes, graphics printer 3-116 thru 3-122 control latch, parallel printer attachment 3-10 1 controller, floppy disk (FDC) 3-16 cordless keyboard BASIC screen editor special functions 5-41 battery power 2-102 buffer 5-36 Index-7 -CABLE CONNECT signal 2-101 character codes 5-27 commonly used functions 5-38 data format 2-104 data path 2-102 disabling the infra-red circuits 2-10 1, 2-103 DOS special functions 5-42 extended codes 5-30 function map, 83-key keyboard to cordless keyboard 5-25 interface block diagram 2-106 layout and keybutton numbering 5-22 parity bit 2-104 phantom-key detection 2-103 scan-codes, matrix 5-23 shift keys combinations, allowable shift keys priorities 5-33 shift states description 5-31 alt key 5-32 caps lock 5-33 ctrl key 5-32 shift key 5-32 special handling description break 5-34 enable/disable keyboard click 5-36 function lock 5-35 functions 1 thm 10 5-35 other characteristics 5-36 pause 5-34 phantom-key scan-code (hex 55) 5-36 print screen 5-34 run diagnostics 5-36 screen adjustment 5-35 scroll lock 5-35 system reset 5-34 typematic suppression 5-36 start bit 2-104 stop bit 2-104 transmission timing 2-105 transmitter, infra-red 2-103 80C48, keyboard microprocessor 2-103 COUNT, modem command 4-45 CPU DLY 3-8 CPU LATCH 3-9 CR, compact printer control code 3-141 8-Index CR, graphics printer control code 3-117 -CS2 thru -CS7, program cartridge signal 2-115 -CTS, modem 3-71 D DO thru D7 3-7,3-73 DO thru D7, program cartridge signal 2-114 -DACK 0, I/O signal 2-27 DACK 0 3-21 DATA 1 thru DATA 8, graphics printer signal 3-113 data latch, parallel printer attachment 3-99 DC2, compact printer control code 3-141 DC2, graphics printer control code 3-118 DC4, compact printer control code 3-141 DC4, graphics printer control code 3-118 DIAL, modem command 3-46 differences, PCjr to Personal Computer addressing of internal modem 4-18 addressing of serial port 4-18 black and white monochrome display 4-18 color graphics capability differences 4-15 color modes available only on PCjr 4-16 compatibility of hardware 4-10 compatibility of configurations 4-7 non-DMA operation considerations 4-19 screen buffer 4-12 software determination ofthe computer 4-19 timing dependencies 4-5 user available read/write memory 4-12 video hardware address difference 4-17 -DIRECTION 3-23 -DISABLE CASO 3-8 -DISABLE EDATA 3-7 diskette 3-31 -DISKETTE CARD INSTALLED 3-20 -DISKETTE CS 3-21 diskette drive differences, PCjr to Personal Computer 4-13 diskette drive connector specifications 3-29 electrical requirements 3-28 load lever 3-27 Index-9 media cooling fan 3-28 sensors 3-28 diskette drive adapter additional comments 3-19 block diagram 3-14 connector specifications 3-25 digital output register (DOR) 3-15 diskette drive constants 3-19 diskette drive interface signals 3-22 diskette format 3-18 electrical requirements 3-24 floppy disk controller (FDC) 3-16 I/O channel interface signals 3-19 location 2-10 signal cable 3-13 watchdog timer (WDn 3-16 othru D7, I/O signal 2-24 DOS special functions 5-42 -DRIVE SELECT 3-22 DRQ 0 3-21 DRQ 0, I/O signal 2-27 -DSR modem 3-72 DTMF (dial-tone modulated-frequency) 3-35 -DTR, modem 3-71 E electrical centering control, joystick 3-77 electrical requirements color display 3-82 compact printer 3-137 diskette drive 3-28 diskette drive adapter 3-24 graphics printer 3-109 enable/disable keyboard click 5-36 ESC control codes, compact printer 3-141 thru 3-146 ESC control codes, graphics printer 3-118 thru 3-127 extended ASCII 5-21 extended codes, cordless keyboard 5-31 to-Index F FF, compact printer control code 3-146 FF, graphics printer control code 3-117 FDC (floppy disk controller) See floppy disk controller floppy disk 3-31 floppy disk controller (FDC) 3-16 commands 3-18 functions not supported 3-18 I/O addresses 3-17 power-up parameters settings 3-17 floppy disk drive (FDD) 3-16 FORMAT, modem command 3-47 function lock, cordless keyboard 5-35 functions 1 thru 10, cordless keyboard 5-35 G games interface block diagram 2-120 connector specifications 2-123 digital input format 2-121 joystick input data 2-119 paddle input data 2-122 pushbutton inputs 2-122 resistance range 2-121 resistive input format 2-121 resistive to digital input equation 2-119 GATE 3-9 graphics See color/graphics graphics printer character set 1 3-128 description 3-109 character set 2 3-130 description 3-109 control codes 3-116 thru 3-127 DIP switch settings 3-111 electrical requirements 3-109 environmental conditions 3-109 Index-ll interface timing diagram 3-113 signal cable 3-107 signal pin assignments 3-115 . signals, interface 3-113 thru 3-114 specifications 3-107 H HANGUP, modem command 3-48 hardware differences, PC}r to Personal Computer 4-10 -HEAD SELECT I 3-23 HLDA, I/O signal 2-27 horizontal drive frequency, color display 3-82 -HRQ, I/O signal 2-26 HT, compact printer control code 3-146 HT, graphics printer control code 3-117 I IBM Connector for Television See connector for television IBM PC Compact Printer . See compact printer IBM PC}r Adapter Cable for Cassette See adapter cable for cassette IBM PC}r Adapter Cable for IBM Color Display See adapter cable for IBM color display IBM PC}r Adapter Cable for Serial Devices See adapter cable for serial devices IBM PC}r Attachable Joystick See attachable joystick IBM PC}r Diskette Drive See diskette drive IBM PC}r Diskette Drive Adapter See diskette drive adapter IBM PC}r Internal Modem See internal modem IBM PC}r Parallel Printer Attachment See parallel printer attachment 12-lndex IBM PCjr 64KB Memory and Display Expansion See memory and display expansion IBM Personal Computer Graphics Printer See graphics printer -INDEX 3-24 infra-red link block diagram, receiver 2-98 connector specifications 2-1 ()() functional description 2-97 programming considerations parity errors 2-99 phase errors 2-99 receiver 2-97 transmitter 2-103 test frequency 2-98 INITIALIZE, modem command 3-48 IO/-M, I/O signal 2-26 I/O channel expansion connector specifications 2-22 I/O read/write cycle times 2-21 map 2-29 memory read/write cycle times 2-21 port AO input description 2-36 port AO output description 2-35 signals 2-23 thru 2-28 diskette drive adapter 3-19 memory and display expansion 3-7 modem 3-70, 3-73 integrated circuits See 6845 CRT controller See 80C48 See 8088 See INS8250A See MCM6665ALl5 See MK38000 See TMM23256P See TMS4164-15 See 8253-5 programmable timer/counter See 8255A See 8259A See 8284A clock chip See SN76496N Index-13 internal modem address, memory location of 5-13 asynchronous communications element 3-68 block diagram 3-36 command arguments 3-41 command character 3-40 delimiter 3-41 format 3-40 format guidelines 3-40 commands 3-44 thru 3-58 connector specifications 3-75 dialing 3-60 status 3-60 default state 3-63 editing/ changing commands 3-59 location 2-10 loss of carrier 3-60 modes of operation 3-68 opposite commands 3-60 programming examples 3-63 signals 3-70 smart 103 modem 3-37 telephone company interface 3-74 transmitter / receiver data format 3-70 8250A 3-68 description of registers 3-69 -lOR 3-73 INS8250A 3-68 INS8250A -OUT 1, modem 3-71 INT, graphics printer signal 3-114 interrupt controller, programmable See 8259A interrupt setup example 2-16 interrupt usage example 5-5 interrupt vector list 5-7 interrupts, hardware IRQ3 2-129 +IRQ4 3-70 +IRQ6 3-20 +IRQ7 3-99 priority 2-15 used by system board 2-6 used by I/O channel 2-6 14-Index interrupts reserved for BIOS, DOS, and BASIC 5-14 -lOR, I/O signal 2-25 -lOW 3-73 -lOW, I/O signal 2-25 IRQ1, I/O signal 2-25 IRQ2, I/O signal 2-25 IRQ7, I/O signal 2-25 J joystick, attachable See attachable joystick K keyboard See cordless keyboard keyboard click, enable/ disable 5-36 keyboard cord -CABLE CONNECT 2-101,3-81 connector specifications 3-88 keyboard microprocessor See 80C48 L -LCG 3-9 LF, compact printer control code 3-146 LF, graphics printer control code 3-117 light pen 2-74 line spacing, graphics printer 3-108 load lever, diskette drive 3-27 location DIP switches, graphics printer diskette drive adapter 2-10 internal modem 2-10 memory and display expansion 2-10,3-5 LONG RESPONSE, modem command 3-49 Index-IS M maps See BIOS, memory map See cordless keyboard, function map See memory maps See scan-code map See system memory map matrix scan-codes, cordless keyboard 5-23 MCM6665AL15 2-17,3-5 MDO thru MD7 3-7 media cooling fan 3-28 MEM AO thru A7 3-7 memory and display expansion block diagram 3-6 configuration requirements 3-5 connector specifications 3-10 EVEN memory space 3-5 location 2-10 modules used, type 3-5 ODD memory space 3-5 signals 3-7 memory maps BIOS 5-17 BIOS, BASIC, and DOS reserved interrupts 5-14 graphics storage 2-61 memory address map 2-20 reserved memory locations 5-15 system, memory allocated for 2-20 video color/graphics subsystem 2-46 memory, 64K RAM See memory and display expansion See RAM memory refresh 2-17 memory requirements 4-12 memory, user available 4-12 -MEMR, I/O signal 2-25 -MEMW, I/O signal 2-26 microprocessor, keyboard See 80C48 microprocessor, system See 8088 minimum mode, 8088 2-6 16-Index MK38000 2-19 -MODEM CS/DISKETIE CS 3-72 MODEM, modem command 3-50 modem See internal modem +MODEM INTR 3-73 modified frequency modulation (MFM) 3-13 modules See integrated circuits motor control, cassette 2-39 -MOTOR ENABLE 3-22 N NUL, compact printer control code 3-147 NEC fPDP765 3-13 NEW, modem command 3-50 NMI (Non-Maskable Interrupt) 2-7 Noise Generator 2-93 N on-Keyboard Scan-code Architecture 5-42 scan-code map 5-45 translate table format 5-44 translate table default values 5-44 o ORIGINATE, modem command 3-50 -OUT 2, modem 3-71 options, available 1-3 p PAO thru PA7 2-31 pause, cordless keyboard 5-34 parallel printer attachment address, memory location of 5-13 block diagram 3-97 Index-I 7 connector specifications 3-104 control latch reading from 3-101 writing to 3-10 1 data latch format 3-100 reading from 3-99 writing to 3-99 printer control 3-10 1 +IRQ7 logic diagram 3-99 printer status signals descriptions 3-101 PBO thru PB7 2-31 thru 2-32 PCO thru PC7 2-33 thru 2-34 PE, graphics printer signal 3-114 phantom-key detection 2-103 phantom-key scan-code (hex 55), cordless keyboard 5-36 PICKUP, modem command 3-51 port AO input description 2-36 port AO output description 2-35 power-on initialization stack-area memory location 5-13 power cable color diaplay 3-81 power supply connector specifications 2-138 power available 2-135 power board over-voltage over-current protection 2-137 Vdc outputs 2-136 transformer 2-134 over-voltage over-current protection 2-137 Vac input 2-135 Vac output 2-135 pulse dialing 3-35 print method, graphics printer 3-107 print modes, graphics printer 3-116 print screen, cordless keyboard 5-34 print sizes, graphics printer 3-108 print speed, graphics printer 3-107 printer See compact printer See graphics printer printer status 3-10 1 I8-Index program cartridge connector specification 2-117 description 2-107 momentary reset land 2-116 ROM chip select table 2-114 ROM locations, cartridge 2-118 ROM mapping 2-107 signals 2-114 slot description 2-107 storage conventions initial program loadable 2-108 DOS conventions 2-110 cartridge BASIC 2-111 type ROM modules used 2-107 programmable interrupt controller See 8259A programmable timer/counter, 8253-5 2-6 Q QUERY, modem command 3-52 R RAM,64K address space mapped to 2-17 EVEN memory 2-17 memory refresh 2-17 ODD memory 2-17 parity 2-17 read/write cycle times 2-21 speed 2-17 type modules used 2-17 6845 CRT controller 2-17 +RAS 3-7 -READ DATA 3-24 READY, I/O signal 2-24 reserved interrupts, BIOS, DOS, and BASIC 5-14 reserved memory locations 5-15 Index-19 RESET, I/O signal 2-23 -RESET 3-20 -RESET, modem 3-72 RETRY, modem command 3-53 -RI, modem 3-71 -RLSD, modem 3-72 ROM subsystem address space mapped to 2-19 memory map 2-20 read/ write cycle times 2-21 type modules used 2-19 ROM module code accessed by system 5-18 ROM module addresses, valid 5-19 -RTS, modem 3-71 run diagnostics, cordless keyboard 5-36 s scan-code map 5-45 scan-codes cordless keyboard matrix 5-23 default non-keyboard 5-43 screen adjustment, cordless keyboard 5-35 scroll lock, cordless keyboard 5-35 serial port address, memory location of 5-13 block diagram 2-127 connector specifications 2-134 control signals 2-129 diskette operations conflict 2-125 interface 2-129 interrupt IRQ3 2-129 modes of operation 2-128 I/O decodes 2-128 output signals 2-131 ring indicate 2-130 use of the divisor-latch access-bit 2-128 voltage interchange levels 2-130 8250A accessible registers 2-131 features 2-125 initialization program, sample 2-134 10-Index programmable baud rate generator 2-132 baud rate at 1.7895 MHz 2-132 maximum operating frequency 2-132 output frequency equation 2-132 SI, compact printer control code 3-147 SI, graphics printer control code 3-118 signal cable adapter cable for cassette 3-91 adapter cable for serial devices 3-89 diskette drive 3-13 color display 3-81 connector for television 3-85 graphics printer 3-107 SIN, modem 3-71 SLCT, graphics printer signal 3-114 smart 103 modem See internal modem SO, compact printer control code 3-147 SO, graphics printer control code 3-112 sound subsystem block dia~lam 2-89 complex sound generator (SN76496N) 2-88 audio tone generator features 2-89 audio tone generator register address field" 2-91 audio tone generator frequency 2-91 frequency generation 2-91 audio tone generator attenuator 2-92 audio tone generator noise generator 2-93 audio tone generator noise feedback control 2-93 control registers 2-90 interface 2-89 connector specifications 2-87 mpx{analog multiplexer) 2-87,2-94 data transfer 2-95 output buffer amperage 2-95 signal description 2-87 signal destinations 2-87 sound sources 2-88 use of an external speaker 2-87 SOUT, modem 3-71 special-functions, cordless keyboard specific 4-14 special functions, cordless keyboard BASIC screen editor 5-41 special functions, DOS 5-42 Index-21 SPEED, modem command 3-54 -STEP 3-22 -STROBE, graphics printer signal 3-113 system-accessible ROM-modules 5-18 system block diagram 1-6 system board block diagram 2-9 clock crystal frequency 2-6 connectors specifications and locations 2-10 interrupts used by system board 2-6 major components list 2-8 RAM, 64K 2-17 size 2-5 subsystems list 2-6 8253-5 programmable timer/counter 2-6 system memory map 5-17 system microprocessor See 8088 system reset 5-34 T timers watchdog timer (WDT) 3-16 timing dependencies, compatibility 4-5 timing diagrams parallel printer interface 3-113 timing, keyboard transmission 2-105 timing using I/O devices 4-5 timing using program execution speed 4-5 TMM23256P 2-19 TMS4164-15 2-17,3-5 -TRACK 0 3-24 track 00 sensor 3-28 translate table format, non-keyboard scan-code 5-43 transmitter, infra-red 2-103 TRANSPARENT, modem command 3-55 typematic suppression 5-36 22-Index u usage of BIOS 5-5 usage of keyboard 5-21 v vectors list, interrupt 5-7 vertical refresh, color display 3-82 video bandwidth, color display 3-82 video color/graphics subsystem See color/graphics video gate array register addresses 2-63 VIDEO MEMR 3-8 VOICE, modem command 3-56 VT, compact printer control code 3-147 w WAIT, modem command 3-57 -WE 3-9 work space variables, BASIC 5-16 -WRITE DATA 3-23 -WRITE ENABLE 3-23 write precompensation 3-13 -WRITE PROTECT 3-24 write protect sensor 3-28 x ~-coordinate 2-121,3-77 ~MIT, modem command 3-57 +XRESET, modem 3-72 Index-23 y y-coordinate 2-121,3-77 z ZTEST, modem command 3-58 Numerals 64KB memory and display expansion See memory and display expansion 6845 CRT 2-45,2-47,2-75 register table 2-76 80C48 2-103 8088 addressable range 2-6 clock frequency 2-6, 2-13 clock cycle time 2-13 minimum mode 2-6 NMI interrupt 2-15 operating frequency 2-13 8253-5 programmable timer/counter 2-6, 2-85 cassette data to cassette control 2-39 8255A-5 2-85 audio input 2-85 bit assignments 2-31 cassette data from cassette control 2-39 cassette motor control 2-39 8259A (programmable interrupt controller) characteristics as set up 2-16 hex types of interrupts issued 2-16 interrupt assignments 2-15 I/O addresses 2-16 priority of interrupts 2-15 setup example 2-16 8284A clock chip 2-13 SN76496N 2-88 24-Index The Personal Computer IIardvvare Library Reader's Comment Form TECHNICAL REFERENCE 6322963 Your comments assist us in improving the usefulness of our publication; they are an important part of the input used for revisions. IBM may use and distribute any of the information you supply in any vvay it believes appropriate vvithout incurring any obligation vvhatever. You may, of course, continue to use the information you supply. Please do not use this form for technical questions regarding the IBM Personal Computer or programs for the IBM Personal Computer, or for requests for additional publications; this only delays the response. Instead, direct your inquiries or request to your authorized IBM Personal Computer dealer. Comments: NO POSTAGE NECESSARY 111111 IF MAILED IN THE UNITED STATES BUSINESS REPLY MAIL PERMIT NO. 321 BOCA RATON, FLORIDA 33432 AGE WILL BE PAID BY ADDRESSEE IBM PERSONAL COMPUTER SALES & SERVICE P.O. BOX 1328-C BOCA RATON, FLORIDA 33432 eldBIS IOU op eSBeld ---- --- - - --- - - ---- - --- -- ------ ---_.- - - ® International Business Machines Corporation P.O. Box 1328-W Boac Raton, Florida 33432 6322963 Printed in United States of America