Upload
luis-tavis
View
213
Download
0
Embed Size (px)
Citation preview
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 1/605
Personal Comjater KjrH ardw are Reference
Library
TechnicalReference
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 2/605
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 hardwareand 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.
Section2: “Base System” describes each functionalpart 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
Sys em.”
iii
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 3/605
Section 4: “Compatibility with the IBM Personal
Computer Family” describes programming concerns for
maintaining compatibility between the IBM PCjr and
the otherIBM Personal Computers.
Section 5: “System BIOS and Usage” describes the
basic input/output system (BIOS) and its use. This
section also contains the software intempt 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 m er a t ion s part number 1502291
Guide to m er a t ion s part number 1502292
Suggested Reading:
I BM PCjr Hands on BA SIC part number 1504702
I BM PCjr BASI C Reference Manual part number6182371
Disk O pra ting System DOS)part number 6024061
Hardware Maintenance and Service Manual part
number 1502294
Macro Assembler part number 6024002
Related publications are listed in.“Bibliography.”
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 4/605
Contents
SECTION 1. NTRODUCTION ............. 1-1 Introduction ......................... 1-3
SECTION 2.BASE S YS lEM ............... 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 64KRAM .......................... 2-17
ROM Subsystem ..................... 2-19
Input/ Output Channel . . . . . . . . . . . . . . . . 2-21
System Board 1/0 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
Lightpen ...................... 2-74
Beeper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-85
Sound Subsystem .................... 2-87
Complex Sound Generator . . . . . . . . . 2-88
Audio Tone Generator . . . . . . . . . . . . 2-89 Infra-Red Link ...................... 2-97
Infra-Red Rekiver . . . . . . . . . . . . . . . . 2-97
IBM PCjr Cordless Keyboard . . . . . . . . . .2-101 Transmitter ..................... 2- 103
CRT/Processor Page Register . . . . . . 2-79
V
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 5/605
Program Cartridge and Interface . . . . . . . 2-107
Program Cartridge Slots . . . . . . . . . . 2-107
Cartridge Storage Allocations . . . . . . 2-108
ROM Module . . . . . . . . . . . . . . . . . . 2-1 14
Games Interface .................... 2-1 19
Interface Description . . . . . . . . . . . . 2-1 19 Input from Address Hex 201 . . . . . . . 2-120
Pushbuttons . . . . . . . . . . . . . . . . . . . 2-12
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-1 30 System Power Supply . . . . . . . . . . . . . . . . 2-135
Operating Characteristics . . . . . . . . . 2-136
Over-Voltage/Over-Current
Protection .................... 2-137
SECTION3 SYSTEMOlPIlONS ............ 3-1
IBM PCjr 64KB Memory and DisplayExpansion .......................... 3-5
IBM PCjr Diskette Drive Adapter . . . . . . 3-13
Functional Description . . . . . . . . . . . . 3-15
System I / o Channel Interface . . . . . . 3-19
Drive Interface . . . . . . . . . . . . . . . . . . 3-22
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 . . . . . . . 340
Status Conditions . . . . . . . . . . . . . . . . 3-60
Dialing and Loss of Carrier . . . . . . . . . 3-60 Default State .................... 3-63
Programming Examples . . . . . . . . . . . 3-63
vi
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 6/605
Modes of Operation .............. 3-68
Interrupts ....................... 3-70 Data Format ..................... 3-70 Interfaces ........................ 3-70
IBM PCjr Attachable Joystick .......... 3-77
Hardware Description ............. 3-77
Functional Description ............ 3-77
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 the IBM Color
IBM Color Display ................... 3-81
IBM PCjr Adapter Cable for Cassette ... 3-91
Display ...: ........................ 3-93
IBM PCjr Parallel Printer Attachment ...
System Interface .................. 3-98
IBM Graphics Printer ................ 3-107
Printer Specifications . . . . . . . . . . . . 3-107
Additional Printer Specifications .. 3- 109 DIP Switch Settings ............. 3- 110
Parallel Interface Description ..... 3-1 12
Printer Modes .................. 3-1 15
Printer Control Codes ............ 3-1 16
IBM PC Compact Printer ............. 3-133
Serial Interface Description . . . . . . . 3-1.39
Print Mode Combinations for the PC
Printer Control Codes and Functions 3- 140
3-95
Description ...................... 3-96
Programming Considerations ...... 3-99
Printer Specifications ............ 3- 135
Compact Printer ............... 3- 140
SECTION 4.COMPATIBILITY WITH TH E IBMP E R S O N A L C O M P U T E R F A M IL Y ....... 4-1
Compatibility Overview ................. 4-3
Timing Dependencies ................... 4-5
Unequal Configurations ................ 4-7
V i i
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 7/605
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 PCjrInternal Modem ................. 4-18
Summary ............................ 4-19
SECTION 5.S Y S T E M BIOS U S A G E ........ 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-AccessibleROM-Modules . . . . . . . . . . . . . . . . . . 5-18
Keyboard Encoding and Usage ......... 5-21
Cordless keyboard Encoding ....... 5-21
Special Handling ................. 5-34
Non-Keyboard Scan-Code Architecture542 BIOS Cassette Logic .................. 5-47
Software Algorithms. nterruptHex 15 ......................... 5-47
Cassette Write ................... 5-48
Cassette Read .................... 5-49
Data Record Architecture ......... 5-50
Error Detection .................. 5-51
Appendix A.R O M BIOS LISTING . . . . . . . . . A-1 Equates and Data Areas ............ A-3
Power-On Self-Test ................ A-7
Boot Strap Loader ................ A-26
Non-Keyboard Scan-Code Table .... A-38
Time-of-Day ..................... A-42
Graphics-Character Generator
(Second 128 Characters) . . . . . . . . . . A-54
viii
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 8/605
110 S u p p o r t ..................... A-97
Sys t e m C onf i gu ra t i on Ana l ys is . . . . . A-97 G ra p h ic s-C h a r a c e r G e n e r a t o r
(F i r s t 128 Ch arac t e r s ) . . . . . . . . . . . A - 103 Pr i n t Sc r e e n .................... A- 108
Appendix B. L OG IC D I A G R A M S . . . . . . . . . . B-1 S y s t e m B o a rd ..................... B-3
P r o g r a m C a r tr id g e . . . . . . . . . . . . . . . . B-20
P o w e r S u p p l y B o a r d . . . . . . . . . . . . . . B-23
E x p a n s i o n ...................... B-25
C o l o r D i s p l a y .................... B-29
Di s ke t t e Dr i ve Ada p t e r . . . . . . . . . . . . B-30
I n te rn a l M o d e m .................. B-36 Pa ra ll e l P r i n t e r A t t a c hm e n t ........ B-37
Inf ra -Red Rece ive r Board .......... B-42
6 4 K B M e m o r y a n d D i s pl ay
G r a p h i c s P r i n t e r .................. B-43 C o m p a c t P r i n te r . . . . . . . . . . . . . . . . . B-47
Appendix C.CH ARA CTE RS. KEYSTROKES. and COLOR ................................ C-1
Appendix D.UNIT SPECIFICATIONS ...... D -1 Sys t e m Un i t ...................... D-1 C ord l e s s Ke yboa rd ................ D-2 Di s ke t t e Dr i ve .................... D-3
C o l o r 'Display .................... D-5 Gra ph i c s P r i n t e r . . . . . . . . . . . . . . . . . . D-6
I n t e r n a l M o d e m .................. D-7
C o m p a c t P r i n te r .................. D -8
Glossary ............................ Glossary-1
Bibliography .................... Bibliography-1
Index ................................ Index-1
ix
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 10/605
TAB INDEX
Sect ion 1: Introduction
Section 2: Base System
...............................
...............................
Section 3: System Options ............................
Section 4: Com patibility With the IBM Personal .........Computer Family
Section 5: System BIOS Usage ........................
II
1 -
Appendix A: R O M BIOS List ing ......................
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 12/605
.........pp en dix C: C haracters, Keystrokes, and Color
Appendix D: Un it Specif icat ions .......................
Glossary ...........................................
Bibliography ........................................
...............................................ndex
X i i i
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 16/605
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:
IBM 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 128KBytes.
IBM PCjr Diskette Drive Adapter
- The IBM PCjr Diskette Drive Adapter permits
the attachment of the IBM PCjr Diskette Driveto the IBM PCjr and resides in a dedicated
connector on the IBM PCjr system board.
IBM PCjr Diskette Drive
- The IBM PCjr Diskette Drive is double-sided
with 40 tracks for each side, is fully
self-contained, and consists of a spindle drivesystem, a read positioning system, and a
read/ write/erase system.
0 IBM PCjr Internal 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 17/605
IBM PCjr Parallel Printer Attachment
- The IBM PCjr Parallel Printer Attachment is
provided to attach various 1/0 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
- IBM 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.
0 IBM Color Display
- The IBM Color Display is a Red/Green/Blue
/Intensity (RGBI) Direct-Drive display, that is
independently housed and powered.
IBM Connector for Television
- The IBM Connector for Television allows a TV
to be connected to the IBM PCjr system.
0 IBM PCjr Keyboard Cord
- The IBM PCjr Keyboard Cord option is used toconnect the IBM PCjr Cordless Keyboard to the
system board.
1-4 Introduction
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 19/605
System Block Diagram (Sheet 1 of 2)
OECWf
&-
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 20/605
InI
1C A S S t l T EOCIC ) ~ C A S S t l l t-
SystemBlockDiagram (Sheet2 f 2)
Introduction 1-7
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 22/605
SECTION 2.BASE SYSTEM
Contents
.............................
.....................
Introduction 2-5
Processor and Support 2-13 Performance 2-13 ........................
8259A nterrupt Controller ................. 2-15 PCjr Hardware Interrupts . . . . . . . . . . . . . . 2-15
8259A Programming Considerations . . . . . . 2-16
64KRAM .............................. 2-17
ROM Subsystem ......................... 2-19
Input/Output Channel ..................... 2-21
Input/Output . . . . . . . . . . . . . . . . . . . . . . . . 2-29
8255 Bit Assignments . . . . . . . . . . . . . . . . . 2-30
8255 Bit Assignment Description . . . . . . 2-31
Port A0 Output Description . . . . . . . . . . .Port A0 Input Operation . . . . . . . . . . . . . 2-36
System Board 1/0 Channel Description . . . . 2-23
2-35
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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 23/605
Video Gate Array .....................
Palette Mask Register . . . . . . . . . . . . . . .Border Color Register . . . . . . . . . . . . . . .Mode Control 2 Register . . . . . . . . . . . . .Reset Register .....................Palette Registers . . . . . . . . . . . . . . . . . . .Status Register .....................
Programming Considerations . . . . . . . . . .
Mode Control 1Register . . . . . . . . . . . . .
LightPen ............................
CRT/Processor Page Register . . . . . . . . . . .
Beeper .................................
Alphanumeric Modes . . . . . . . . . . . . . . . . . .Graphics Mode .......................
Low-Resolution 16-Color Graphics . . . . .Medium-Resolution &Color Graphics . . .Medium-Resolution 16-Color Graphics . .
High-Resolution 4-Color Graphics . . . . .High-Resolution 2-Color Graphics . . . . .
Graphics Storage Organization . . . . . . . .
Sound Subsystem .........................Complex Sound Generator . . . . . . . . . . . . . .Audio Tone Generator . . . . . . . . . . . . . . . . .
Features . . . . . . . . . . . . . . . . . . . . . . . . . .
Infra-RedLink...........................
Functional Description . . . . . . . . . . . . . .Application Notes . . . . . . . . . . . . . . . . . .Programming Considerations . . . . . . . . . .Detectable Error Conditions . . . . . . . . . . .Operational Parameters . . . . . . . . . . . . . .
Infra+& Receiver .....................
IBM PCjr Cordless Keyboard ..............Transmitter ...........................
2-54
2-55
2-56
2-57
2-58
2-58 2-59
2-60
2-63
2-64
2-65
2-66
2-66
2-69
2-71
2-73
2-742-75
2-79
2-85
2-87
2-88
2-89
2-89
2-97
2-97 2-97
2-98
2-99
2-99
2- 100
2-101
2- 103
2-2
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 24/605
Program Cartridge and Interface ............ 2-107 Program Cartridge Slots . . . . . . . . . . . . . . . 2-107
Cartridge Storage Allocations . . . . . . . . . . . 2- 108
ROM Module . . . . . . . . . . . . . . . . . . . . . . . 2-1 14
Games Interface ........................ 2-119 Interface Description . . . . . . . . . . . . . . . . . . 2-1 19
Pushbuttons . . . . . . . . . . . . . . . . . . . . . . . . . 2- 122
Input from Address hex 201 2- 120
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-1 36
DC Outputs . . . . . . . . . . . . . . . . . . . . . 2-136
Over-Voltage/Over-Current Protection . . . 2- 137
Input (Transformer) . . . . . . . . . . . . . . . 2- 137
Output (Power Board) . . . . . . . . . . . . . .
Power Supply Input Requirements . . . . . 2-136
2- 137
2-3
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 26/605
Introduction
The PCjr baseAsystem 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 voltage ac
power enters the power supply adapter, is converted to
dc voltage, and enters the system board through thepower 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 ConnectorInternal Modem Connector
Infi-a-Red (IR) Link Receiver Board Connector
Program Cartridge Connectors (2)
1/0 Channel Expansion Connector
Serial Port (RS232) Connector (with optional
adapter cable)
Direct Drive (RGBI) Video Connector
Composite Video ConnectorIBM Connector for Television Connector (external
FW 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 27/605
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 1 / 0
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 ofstorage). It operates in the minimum mode at 4.77MHz. 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-tit 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 0is 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 1 / 0 channel for use by adapters.
Five levels are used on the system board. Level 0, the
2-6 Introduction
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 28/605
highest priority, is attached to Channel 0 of the
timer/counter and provides a periodic interrupt for the
time-of-day clock; level 3 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. Thenon-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,
1/0 drivers, dot patterns for 2 5 6 characters in graphics
mode, a diskette bootstrap-loader and user-selectable
diagnostic-routines.
Introduction 2-7
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 30/605
.
* +
IR Link or Keyboard Cable
ConnectorL
2 Joysticks
4 Buttons
Power
Supply
Conn.
oscClock
Control
Modem
Adapter
-
Key-
board
lnter-
face
8088
Joystick
9 Level
Interrupt
Video
128K
ROM
Cart.
Conn.
64KROM
on
Board
Audio
and
Audio
Alarm
64K
RAM
Conn.
64KRAM
on
Board
Diskette
Drive
Adapter
Interface
RS232-C
Serial
Interface
l /O
Channel
Conn.
Cassette
Interface
Serial
Printer
Printer
Attach.
Cassettez
kiskette b ri ve
External Amplifier
and Speaker
Television
Composite Video
Monitor
.Light Pen
Telephone
System Board Block Diagram
Introduction 2-9
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 32/605
V
Lc 0 v c 0 w . n L E L .. . . .. . .In
rodon2 1 1
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 33/605
cz P v
C h h
~~ Y .
7 7 ::
If
21Inrodon
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 34/605
Processorand Support
The (R) ntel 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 A L U (arithmatic/logic unit)
Extensive instruction set
D M A and interrupt capabilities
Hardware fixed-point multiply and
and registers
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 8 4 0 ns ROM memory cycle time is achieved.
R A M 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. 1 / 0 eads and writes also
take six clock cycles leading to a bus cycle time ofI .260 ps.
Processorand Support 2-13
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 36/605
8259A Interrupt Controller
Level
Em88 N M I
PCjr Hardware Interrupts
Nine hardware levels of interrupts are available for the
PCjr 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 8259AProgrammable Interrupt Controller, with IRQ 0 as the
highest and IRQ 7 as the lowest. The interrupt level
assignments follow:
Function
K e y b o a r d I n t e r ru p t
~ T i m e r Clock In te r rup t1 / 0 C h a n n e l ( R e s e r v e d )
I jO C h a n n e l
A s y n c h r o n o u s P o r t I n t er r u pt ( R S - 2 3 2 C )
M o d e m I n t e r r u p t
Ver t i ca l Re t r ace In te r rup t (Dis p lay)Dis ke t t e In te r rup t
1 i0 C h a n n e l ( P a r a l l e l P r i n t e r )
~~
8 2 5 9 A8 2 5 9 A
8259A8 2 5 9 A
8 2 5 9 A
8 2 5 9 A
8 2 5 9 A
8 2 5 9 A
I R Q 0I R Q 1
1 R Q 2
I R Q 31 R Q 41 R Q 51 R Q 6
I R Q 7
Hardware Interrupts
Interrupt Controller 2-1 5
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 37/605
8259A Programming Considerations
~~
0 2 6 3 B O 13
The 8259A is set up with the following characteristics:
~~
M O V A L , 13H ; I C W I - Reset edgesense circuit setsingle
: 8259 Chip and I C W 4read
Buffered Mode8086Mode
Edge Triggered Mode
Single Mode Master (No Cascading is Allowed)
0 2 6 7 B O 0 8
The 8259A 1/0 is located at 1/0 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.
M O V A L . 8 ; I C W 2 - Set interruptt>'peX ( 8 - F )
The following figure is an example setup.
0 2 6 B B O O 9 M O V A L . 9
0 2 6 5 E 6 20 I OUT I N T A O 0 ,A L I
0269 E6 21 1 OUT I N T A O I . A L I
;
1CW4 - Set buf'f'crcdti1o d e ni as e
and 80x6 mode
Example Set Up
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 38/605
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 TMS4 164-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 ismapped to the ‘ODD’ memory space within the 128K
byte-reserved space while the system board memory is
mapped to the ’ EVEN ’ 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.
6 4 K R A M 2-17
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 41/605
Basic Program Area
Standard App lication Cartridge
c
~~
Reserved For Future Cartridge
~
Reserved For Future Cartridge
Reserved for
I /O ROM~ ~~~
Video RA M
Reserved
Future
Video
~~
Reserved
Future User
RAM
Expansion RA M
Base RA M
Memory Map
FFFFF
FOOOO
E8 0 0 0
EOOOO
D8OOO
DOOOO
coooo
68000
AOOOO
20000
10000
00000
Cartridge
Chip
Selects
2-20 ROM Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 42/605
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 1/0 channel contains an 8-bit bidirectional bus, 20
address lines, 3 levels of interrupt, control lines for
memory and 1 / 0 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 IjO 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 1/0 bus and passes the bus along for
the next attachment.
A I ready
operation with slow 1 / 0 or memory devices. If the
channel’s I ready ’ line is not activated by an addressed
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-ps/byte.
line is available on the 1/0 Channel to allow
The 1/0 Channel also contains the capability to add
bus masters to the channel. These devices could be
DMA devices or alternate processors.
The 1/0 Channel signals have sufficient drive to
support five 1/0 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.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 43/605
S.ignal Name Signal Name
D1
D 2
0 4
Shield GND
D 7
A 0
A2
Shield GND
A5
A6
A8-DACKO
A11
A12
Shield GND
A15
Shield GND
A17
A19
Shield GND
-MEMR
-MEMW
ALE
Shield GND
IO/-M
READY
-CARDSLCTD -Shield GND
IRQ7
AUDIO IN
61 A1
65 A5
610 A10
615 A15
620 A20
625 A25
630 A30
DO
+12 Vdc
03
0 5
D6
+5 Vdc
A1
A3
A4
GND
A7A9
A10
DRQO
A13
A14
A1 6
GND '
A1 8
-IOR
- low
GND
HDLA
CLK
RESET
+5 Vdc
-HRQ
l R Q l
lRQ2
ReservedI I
I /O Channel Expansion Connector Specifications
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 44/605
System Board I/O Channel Description
70 n s
The following is a description of the 1/0 Channel. All
signals are TTL compatible.
140 n s 70 ns 140 ns
Signal
CLK
7
0
Description
System Clock: It is a
divide-by-three of the 14.3 1818
MHz oscillator and has a period
of 210 ns (4.77 MHz). The
clock has a 33% duty cycle.
RESET 0 This line is used to reset or
initialize system logic upon
power-up. This line is
synchronized to the falling edge
of the clock and is ' active high I .
Its duration upon power upjs
26.5 ps.
AO-A19 1 / 0 Address Bits 0 to 19: These lines
are used to address memory and
1 /0 devices within the system.
The 20 address lines allow access
of up to 1 megabyte of memory.
A0 is the least-significant- bit
(LSB) while A 19 is themost-signif ican -bit (MSB).
These lines are normally driven
by the 8088 microprocessor as
1 / 0 Channel 2-23
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 45/605
outputs, but can become inputs
from an external bus-master by
issuing an HRQ and receiving an
HLDA.
DO-D7 1 / 0 Data Bits 0-7: These linesprovide data-bus bits 0 to 7 for
the processor, memory, and 1/0
devices. DO is the
least-significant-bit (LSB) and
D7 is the mos -signif icant-bit
(MSB). These lines can be
controlled by an external
bus-master by issuing an HRQ
and receiving an HLDA.
ALE 0 Address Latch Enable: This line
is provided to allow the addition
of wait states in memory and 1/0
cycles.
READY I This line, normally I high
( I ready ), is pulled low I ( not
ready I ) by a memory or 1 / 0
device to lengthen 1 / 0 or
memory cycles. It allows slower
devices to attach to the 1 / 0
Channel with a minimum of
difficulty. Any slow devicerequiring this line should drive it
I low I immediately upon
detecting a valid address and
IO/-M signal. Machine cycles
(I/O and memory) are extended
by an integral number of CLK
cycles (210 ns). Any bus master
on the 1 / 0 Channel should also
honor this
pulled I low ' by the system board
ready I line. It is
2-24 1 / 0 Channel
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 46/605
on memory read and write cycles
and outputting to the sound
subsystem.
IRQ1, IRQZ, I Interrupt Request 1, 2, and 7:
IRQ7 These lines are used to signal theprocessor that an 1/0 device
requires attention. They are
prioritized with IRQ1 as the
highest priority and IRQ7 as the
lowest. An Interrupt Request is
generated by raising an IRQ line
( low to I high I ) and holding it
'high' until it is acknowledged
by the processor
(interrupt-service routine).
-1OR
-row
-MEMR
1/0 1/0 Read Command: This
command line instructs an 1 /0
device to drive its data onto the
data bus. This signal may bedriven by the 8088
microprocessor or by an external
bus-master after it has gained
control of the bus. This line is
active I low ' .
1 / 0 1 /0 Write Command: This
command line instructs an 1 /0device 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
Iactive I low
1 / 0 Memory Read Command: This
command line instructs the
I/o Channel 2-25
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 47/605
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 isactive ' low I .
- M E W 1 / 0 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 1 /0 1/0 or Memory Status: This
status line is used to distinguish a
memory access from an I/Oaccess. This line should be
driven by a bus master after it
has gained control of the bus. If
this line is I high I it indicates an
1 / 0 Address is on the Address
Bus; if this line is I 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 I low ). The 8088 will
respond to a ;HRQ by asserting
an HLDA. After receiving an
HLDA, the new bus master may
2-26 1 / 0 Channel
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 48/605
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 D4 during any 'Out '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
A0 port.
DRQ 0 0 This line comes from the floppy
disk controller (FDC) and can be
used by an external DMA to
indicate that a byte should be
transferred to the FDC.
-DACK 0 I This line should come from an
external DMA and should
indicate that a byte is being
transferred from memory to the
FDC.
HLDA 0 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.
1 / 0 Channel 2-27
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 49/605
=CARD I This line should be pulled down
SLCTD by any adapter when it is selected
with address and IO/-M. Thisline 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 thesystem-board sound-subsystem
through this line. It is 1 volt
peak-to-peak, dc biased at 2.5volts above ground.
2-28 I/OChannel
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 50/605
Input /Output
H e x R a n g e
20-27
9 8 7 6 5 4 3 2 1 0 Device
0 0 0 0 1 0 0 X X A 0 P I C 8 2 5 9
FO-FF
200-207
2 F 8 - 2 F F
3DO-3DF
3 F 8 - 3 F F
1/0 Map
0 0 I 1 I I X A 2 A I A 0 Diskette
1 0 0 0 0 0 0 X X X Joystick
I 0 1 1 1 1 1 A 2 A I A 0 Serial P o r t
1 1 1 I 0 1 A 3 A 2 A I A 0 Videosubsystem
1 I I 1 1 1 I A 2 A I A 0 Modem
X = Don't care (that is, not in decode.)
Any 1/0 which is not decoded on the system boardmay be decoded on the 1/0 Channel.
At Power-On time the NMI into the 8088 is masked
'off I . This mask bit can be set by system software
as follows:
Write to Port A0 D7=ENA NMI D6=IR TEST ENA
D5=SELC CLKl INPUT D4=+Disable HRQ
1 / 0 Channel 2-29
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 52/605
2-288255 Bit Assignment Description
P A 0 thru (Output Port A is configured as an output.
P A 7 Lines) The output lines are not used by the
hardware, but are used to storekeystrokes. This is done to maintain
compatibility with the Personal
Computer, and Personal Computer
XT.
PBO (+Timer 2
Gate)
This line is routed to the gate input
of timer 2 on the 8253-5. When this
bit is 'low ' , he counter operation is
halted. This bit and PBl (+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 todisable 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
memory into the Video Gate Array.This bit should be a 1 for all alpha
modes, and a 0 for all graphics
modes.
-Graphics)
I/o Channel 2-31
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 53/605
PB3 (+Cassette
Motor Off)
1 PB4 (+Disable
internal
beeper and
cassette
motor relay)
,
When this bit is a 1, the cassette
relay is 'open ' and the cassette
motor is 'off I . When this bit is a 0,
and PB4 = 0, the cassette motor is
'on' .
When this bit is a 1, the internal
beeper is 'disabled' and the 8253-5timer 2 sound source can only be
heard if it is steered to the audio
output. This bit also disables the
cassette motor when it is a 1. To
'enable ' the cassette motor, this bitmust be a 0. In this case, PBI
should be used to gate 'off ' the
internal beeper and 8253-5 sound
source.
PB5, (Speaker
PB6 switch 0 , l )
These bits steer one of 4 sound
sources. This is available to the R Fmodulator or the external audio jack.
The sound sources selected are
shown below.
PB6 PB5 SoundSouc e
0 0 8253-5 Timer 2
0 1 Cassette Audio Input
1 0 1/0 Channel Audio In1 1 76496
PB7 (Open) Reserved for future use.
2-32 1 / 0 Channel
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 56/605
Port A0 Output Description
D7 (Enable NMI) When this bit is a 1, the NMI is
Ienabled ' .When it is a 0, it is
Idisabled .This bit enables the 8253-5 timer 2output 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.
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
0 output to be used as the Clk inputto timer 1. This is used to catch timer
0 overflows during diskette drive
operations when interrupts are
masked Ioff I . This is then used to
update the time-of-day.
on the system board, but is supported
by the programming. This bit is usedto disable -HRQs from external
bus-masters (DMA, Alternate
Processors, etc.) The logic forthis bit must exist on each
bus-master attachment. A 0should enable ' -HRQ, and a 1
should Idisable I -HRQ.
D6 (IR test ENA)
D 5 (Selc Clkl input)
D4 (+Disable HRQ) This bit is not actually implemented
1 / 0 Channel 2-35
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 57/605
+HRQ from external
bus master
LS74I
LS03
AOCS
0 4
I
Port A 0 Output Description
-HRQ on I /O
-Input should be an open-
Port A0 Input Operation
A read I to 1/0 port A0 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 A0 bit
D7) is 'on I . This latch can also be read on the 8255
PCO. The program can determine if a keystroke
occurred while the NMI was Idisabled by reading thestatus of this latch. This latch must be cleared befove
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 bpard and
can receive data through an IR link. The source of the
keyboard's data is determined by the -Cable Connectedsignal 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 1 / 0 Chamel
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 58/605
serial stream. After de-serialization the NMIservice-routine does a IRead from hex A0 to clear the
^NMI atch.
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 Iset I by any key being pressed and is
Ireset ' by IReading I the NMI port. (No ata is
presented to the microprocessor during this IRead I .)
Keyboard latch data is available to the processor at bit
PCO of the 8255 PPI.
I/OChannel 2-37
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 60/605
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 therear 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
Ienables
’the 7547 relay driver, must be Ilow I 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 Ioff I . See “BIOS Cassette
Logic” in Section 5 for information on data storage and
re trival.
A mechanism is provided that will direct the cassette
input to the audio subsystem. Please see “SoundSubsection” in Section 2.
Circuit block diagrams for the cassette-interface read,
write, and motor control are illustrated in the following
figures.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 61/605
Cassette
GND
1OOOk
Ohm
Resistor
18 Ohm
Resistor
i
Audio
Subsystem
r 1
Data From
Cassette
Recorder
Earphone
Jack
+5v
Cassette
18k Ohm
Resistor
GND
OP A 18k Ohm'Amp Resistor
- .047pF - 8k Ohm - '
LM358apacitor Resistor -
SiliconGND Diode
Data In
Cassette-Interface Read- Hardware Block Diag ram
b I82 53 Timer #2 0 O G
O D DRV
3.9k Ohm
Resistor
r
0.678V to
AUX Inputti-esistor
1.2k Ohm
GND
+
4.7k Ohm
Resistor
0.075V to
MI C Input15 0 Ohm
Resistor
GND
Cassette-Interface Write-Hardware Block Diagram
2-40 Cassette Interface
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 62/605
+5v
I
-LOGIC GND A 01
- ASS AUDIO IN A0 2 c
-MIKE AUDIO OUT A03
CI OTOR CONTROL A04
KEY PLUG BO1
AUX DATA OUT BO2
-MOTOR CONTROL SW BO3
-SHIELD GN D BO4 I
P4LS04
s
System
Board
+5v
SN75475 Relay
- cc N/O
-oil
+5& lamp
1
P83 L In out 0 Coil
Moo NOT , sOn
PB4
Enable
Beeper/CassetteMotor NOT
Relay GND
Com
I
r *
Cassette-Motor Control Block Diagram
Cassette
Cassette
Motor
Cassette Connector Specif ications
Cassette Interface 2-41
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 64/605
Video Color/Graphics Subsystem
The video subsystem is designed so that the IBM Color
Display, composite monitors, a id a home 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 directdrive, and a connector for
an RF modulator to be used with home 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 (APA). Additional modes are available within
the A/N and APA modes.
In the AJN 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 andsixteen background-colors are available for each
character. In addition, blinking on a per-character basis
Video Subsystem 2-43
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 66/605
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 6845CRT 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 67/605
Processor
I -
I R F TelevisionI Modulator I
#
b
64K Expansion Card
1
Processor
64K x 8 Data Latch
A
'DINata Bus<
- Addresq , *rocessor
Address Multiplexer
Processor I + ,
I /O - ddress
Data Bus- 6845 Multiplexer
4t
L64K x 8
RAM*
CRT
Controli
SYNCSVideo
Gate
Array
-
L
ontrol
Latch
T
RAS, CAS, WE
-
rocessor
Data LatchI ti
Character
Data Latch
a
Character
Generator
ROM
b cCG Data
LatchA
Drive
Video
Composite
Video
Logic
Composite
Video Color/Graphic Subsystem Block Diagram
2-46 Video Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 68/605
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-subsystemaccesses 64K
bytes of read/write memory (RAM). A 64KB Memory
and Display Expansion can be added to increase the
amount of systemRAMto 128K bytes. This
memory-storage area serves two functions; as the
video-display buffer and as the system processor is
(8088) main-RAM.
TheRAMis located at address hex 0000 and is either
64K bytes or 128K bytes with the memory expansionoption. The 8088 can access the memory by reading
from and writing to address locations hex 00000 to
lFFFF 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 t h e . These
registers allow the processor to work in one page while
the display is displaying another page. The processorcan switch pages at the vertical-retrace time. This wi l laid animation on the video color/graphics subsystem.
Video Subsystem 2-47
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 69/605
Also, since all 128K bytes of read/write memory areavailable for display purposes, the application can useas little or as much memory as needed for the display.
Processor
Page
Select-
The fo llowing figure is a map of the videocolor/graphics subsystem.
0
0
0
Page7
20000
Memory Map
Video
Processor
Read/Write
OperationsL age6 #
- age5
L Page4 D
- age3 I c
c Page2 r c
age 1 c- age0 IL
0000
Hex
Address
coooo
68000
Video Color/Graphics Subsystem Memo ry Map
- RT Page
Select
2-48 Video Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 70/605
Bandwidth
The video bandwidth is either 3 . 5 , 7 or 14 MHzdepending 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 averageof two wait states will be inserted in a processor RAMread cycle, because the average latency time for the
processor to get a cycle is 560 ns and the cycle time is
processor reads and writes through the B8000 - BFFFFaddress area.
350 ns. There is no performance penalty for redirecting
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
3 5 0 ns access, 3 5 0 ns cycle static operation. The
device is pin compatible with 2 7 1 6 and 27 32 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 thissection.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 71/605
Palette
I
Palette Address Bit
PA0 Function
0 Palette Register 01 Palette Register I
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 todisplay. 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
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 onebit (PAO), with the following logic:
2-50 Video Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 72/605
In four-color modes, the palette is defined by using twobits (PA1 and PAO), with the following logic:
Palette Address Bits
PA 1 P A 0
0 0
0 1
1 0
I 1
Function
Palette Register 0
Palette Register IPalette Register 2Palette Register 3
Palette Logic (2 of 3)
Video Subsystem 2-5 1
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 73/605
In sixteen-color modes, the palette is defined by usingfour bits (PA3, PA2, PA1, and PAO), with the
following logic:
IPalette Address Bits
PA3
00
0
0
0
00
0I
1
1
1
1
1
1
1
PA 2
00
0
0
1
11
1
00001
1
1
1
PA1
0
0
1
1
0
01
1
001
1
001
1
PA0
0
I
0
I
0
I0
I
0I
0
1
01
0
1
Palette Logic (3 f 3)
Function
Palette Register 0
Palette Register I
Palette Register 2Palette Register 3
Palette Register 4
Palette Register 5Palette Register 6Palette Register 7Palette Register 8Palette Register 9
Palette Register 10
Palette Register 1 1
Palette Register 12
Palette Register 13
Palette Register 14
Palette Register 15
2-52 Video Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 74/605
The sixteen colors available to all A / N and APAmodes are selected through combinations of the I
(Intensity), R (Red), G (Green), and B (Blue) bits. Thesecolors are listed in the following figure:
I
0
0
0
0
0
00
0
1
I
I
I
I
1
1
I
R
0
0
0
0
1
II
I
0
0
00
I
1
1
I
G
0
0
1
1
0
01
I
0
0
1
1
0
0
I
I
B
0I
0
I0
1
01
0
I
0I
0
I
0
I
Color
BlackBlueGreenCyanRed
MagentaBrownLight GrayDark GrayLight BlueLight GreenLight Cyan
PinkLight MagentaYellowWhite
Note: The “ I ” bit provides extra luminance(brightness) to each available shade. This results in thelight colors listed above, except for monitors that donot recognize the “ 1 ” bit.
Summary of Available Colors
Video Subsystem 2-53
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 75/605
Alphanumeric Modes
Display Character C ode Byte,
Every display-character position in the alphanumeric
mode is defined by two bytes in the system read/write
memory, using the following format:
Attribute Byte
1 7 6 5 4 3 2 1 0 ( 7 6 5 4 3 2 1 0 1
Display Format
2-54 Video Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 76/605
The functions of the attribute byte are defined by the
following figure:
B
AttributeFunction
0 0 0 1 0 0 0
N or m a l
ReverseVideoN ondisplay
N ondisplay(Off)
(On)
Attribute Byte Definition
7 . 6 5 4 3 2 1 0
Background ForegroundGroundBlink
I Highlighted Fo reg rou nd (Charac ter )B = Blinking Fo reg rou nd (Charac ter )
Att ribu te 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’sROM 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 78/605
7 6 5 4 3 2 1 0
PA3 PA2 PA1 PA0
First
Display
PEL
PA3 PA2 PA1 PA0
Second
Display
PEL
Low-Resolut ion 16-Color GraDhics
PA1 PA0
First
Display
PEL
The medium-resolution mode supports hom e-televisionsets, low-resolution displays, and high-resolutiondisplays. It has the following characteristics:
PA1 PA0 PA1 PA0 PA1 PA0
Second Third Fourth
Display Display Display
PEL PEL PEL
Contains a maximum of 200 rows of 320 PELsSelects one of four colors for each PEL
Requires 16K bytes of read/write memorySupports 4 of 16 possible colorsFormats 4 PELs per byte for each byte in the
following manner:
Video Subsystem 2-57
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 79/605
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 0
PA 3 -PA:EL PA1 PA 0 PA 3 PA 1 PA 0
First Second
Display Display
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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 80/605
Requires 16K bytes of read/write memory.
Formats 8 PELs per byte for each byte in the
following manner:
PA0 PA0 PA0 PA0 PA0 PA0 PA0 PA0
7 6 5 4 3 2 1 0
Eighth Display PEL
Seventh Display PEL
Sixth Display PEL
Fifth Display PEL
Fourth Display PEL
Third Display PEL
Second Display PEL
I -% First Display PEL
High-Resolution 2-Color Graphics
High-Resolution 4-Color GraphicsThe high-resolution mode is used only with
high-resolution monitors. This mode has the following
characteristics:
Requires system configuration of 128K Bytes
read/write memoryRequires 32K bytes of read/write memory
Contains a maximum of 200 rows of 640 PELsSelects one of four colors for each PELSupports 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 81/605
Even Bytes
. 7 6 5 4 3 2 1 0
PA0 PA0 PA0 PA0 PA0 PA0 PA0 PA0
Y
First Second. Third Fourth Fifth Sixth Seventh Eighth
Display Display Display Display Display Display Display Display
PEL PEL PEL PEL PEL PEL PEL PEL
PA1 PA1
7 6
PA1 PA1 PA1 PA1 PA1 PA1
5 4 3 2 1 0 .Odd Bytes
High- Resolution 4-Color Graphics
Graphics Storage Organization
For the low-resolution 16-color graphics, themedium-resolution &color graphics, and the high-resolution 2-color graphics, storage is organized intotwo banks of 8000 bytes each.
The following figure shows the organization of thegraphics storage.
2-60 Video Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 82/605
Memor y Address
OOOOHEven Scans (0.2.4 ...,190)
8000 Bytes
1F3F
Iraphics Storage Organization (Part 1 of 2)
Address 0000 contains PEL information for theupper-left corner of the display area.
For the m edium-resolution 16-color graphics, and the
high-resolution 4-color graphics modes, the graphicsstorage is organized into four banks of 8000 bytes each.
Video Subsystem 2-61
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 83/605
Memo ry Address
(Hex) b-, 160 Bytes40000 00 Scans
(0,4,8....,196)
(8000 Bytes)1 F3F
2000
3F3F
4000
5F3F
6000
7F3F
01 Scans
(1,5,9,.. ,197)
(8000 Bytes)
10 Scans
(2.6,lO ,....198)
(8000 Bytes)
11 Scans
(3,7,11 ...,199)
(8000 Bytes)
Graphics Storage Organization (Part 2 of 2)
Address 0000 contains PEL information for theupper-left corner of the display.
2-62 Video Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 84/605
Video Gate Array
H ex Address
00
01
0203
0410-1F
The Video Gate Array is located at 1/0 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.
Register
Mode Control 1
Palette Mask
Border ColorMode Control 2ResetPalette Registers
Any 1/0 write I -operations to hex address 3DA
continuously toggle an internal address/data flip-flop.
This internal flip-flop can be set to the address state by
issuing an 1/0 Iread I instruction to port hex 3DA. An
1/0 Iread I instruction also Ireads ' the status of the
Video Gate Array. A description of each of the
registers in the Video Gate Array follows.
Video Gate Array Register Addresses
Video Subsystem 2-63
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 85/605
Mode Control 1 Register
~~
Bit 0
Bit 1
Bit 2Bit 3Bit 4
This is a 5-bit 'writel-only register, it cannot be
A description of this register's bit functions follows.
read I . Its address is 0 within the Video Gate Array.
+ H I Bw -LOB w+Graphics -Alp ha
+ B / W+Video Enable
+16 Color Graphics
Mode Control 1 Register
Bit 0
Bit 1
Bit 2
This bit is 'high I (1 for all
high-bandwidth modes. These modes are
all modes which require the 64KB Memory
and Display Expansion for a system totalof 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
l6-color graphics mode. This bit is 'low'
(0) for all low-bandwidth modes.
This bit is ' high (1) for all graphicsmodes and is I low ' (0) for all
alphanumeric modes.
When this bit is ' high' ( l ) , 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 86/605
bit should be set Ihigh 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 I (1 , the video
signal is Ienabled I . The video signal
should be Idisabled I when changing
modes. When the video signal is
Idisabled I , he screen is forced to the
border color.
This bit must be ' high I (1) for all
16-color graphics-modes. These modes
are the 160 by 200 16-color
graphics-mode and the 320 by 200
16-color graphics-mode.
Bit 4
Palette Mask Register
This is a 4-bit write-only registe it cannot be 're
Its address in the Video Gate Array is hex 01. A
description of this register's bit functions follows.
Bit 0 -Pale t te Mask 0
Bit 1 -Pale t te Mask 1
Bit 2 -Pale t te Mask 2
-1it 3 -Pale t te Mask 3
d ' .
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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 87/605
information. This can be used to make some
information in memory a ‘don’t care I condition until it
is requested.
Bit Number
01
2
3
In the 2-color and 4-color modes, the palette addresses
should be 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.
Function
+ B (Blue) Border Color Select+ G (G ree n) Border C olo r Select+ R (R ed ) Border C olo r Select+ I (Int ens ity) Border C olo r Select
Border Color Register
This is a 4-bit I write I -only register, it cannot be
The following is a description of the register’s bit
functions:
read I . Its address in the Video Gate Array is hex 02.
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, i t cannot be
’ read I . Its address inside the Video Gate Array is hex
2-66 Video Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 88/605
03. The following is a description of the register’s bit
functions:
Bit Number Function
- Reserved = 0+ Enable Blink- Reserved = 0
+ 2-Color G raph ics
PA2 PA1 PA0
~
M o d e Control 2 Register
PA3 PA2 PA1 PA0
Bit 0 This bit is reserved, but should always be
programmed as a 0.
Bit 1 When this bit is I high I (1) in the
alphanumeric mode, the attribute byte has
the following definition:
1 b Blinking
Where PA0 o PA3 are palet te addresses.
Att ribute Byte Defin ition (Part 1 of 2)
V i ubsystem 2-67
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 89/605
If the enable-blink bit is 'off ' in the
alphanumeric mode, the attribute byte
takes on the following definition:
7 6 5 4 3 2 1 0
Foreground Color
Background Color
Attr ibute Byte Definit ion (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 2palette 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 0.
2-68 Video Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 90/605
Bit 3 This bit should be high (1) when in the
640 by 200 2-color graphics-mode. It
should be I low I (0) for all other modes.
Bit 0Bit 1
+A synchrono us Reset+Syn chronou s Reset
Reset Register
Bit 0 When high (1 , this bit will issue an
I asynchronous reset I to the Video Gate
Array. This will cause all memory cycles
to stop and all output sigrsals to be
tri-stated. The 'asynchronous reset I
should only be issued once at the system
power-on time. This bit should be 'high'
( l ) , he Video Gate Array and the 6845programmed, and then it should be I low I
(0).
The system read/write memory (RAM)
will not work until this power-on sequence
is finished. After this power-on sequence,
subsequent I resets I should be
synchronous resets I .
Video Subsystem 2-69
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 91/605
Bit 1
Note: Issuing an I asynchronous reset 'can cause the contents of RAMto be
destroyed.
When 'high' ( I ) , this bit will issue a
I synchronous reset I to the Video Gate
Array. This will cause all memory cycles
to stop and all output signals to stop. Bit 1
should be low I (0) before changing
modes.
Before issuing a I synchronous reset , he
program should read 256 locations in
RAMas 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 6845registers.
Next, the 'synchronous reset I should beremoved and the 256 RAM locations
should be 'read ' again as above. This
procedure will ensure systemRAMdata-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. IResets must be done
from code in ROM or EPROM's.
2-70 Video Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 92/605
Palette Registers
There are sixteen 4-bit-wide palette-registers. These
registers are Iwrite I -only, they cannot be I read I .Their addresses in the Video Gate Array are from hex
I O to 1F.
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:
I Bit Number I Function
I o 1 + B l u e I123
+ Green+ R e d+ Intensi ty
Palette Register Format
When loading the palette, the video is I 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, itmust change the hex address to some address less than
hex 10 for video to be ’enabled again.
Video Subsystem 2-7 1
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 93/605
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 areprovided to facilitate this procedure.
2-72 Video Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 94/605
8 Status Register
Bit 0
Bit 1
Bit 2Bit 3Bit 4
This is a 5-bit I read -only egister, it cannot be
'written I. 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 bitfunctions. ollows:
+Display E nable+Light Pe n Trigger S et-Light Pen Switch Made
+Vertical Retrac e+ Video Do t s
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 I low ' (0) pon a system
power-on, and may also be cleared by
performing an 1/0 Out ' command to
address hex 3DB. No specific data isrequired, 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 I.
Bit 3 When 'high ' (1 , this bit indicates thevertical retrace is 'active .
Video S i h y s t e m 2-73
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 96/605
Signal Name Pin Number
+12v A 01
-LIGHT PEN INPUT A02 c
Light +5v A03 SystemBoard
LOGIC GN D 601
-LIGHT PEN SWITCH- 02
UNUSED 603
&
Connector Specifications
Note: The light pen interface is set for RGBI
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, whichare 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 Iwrite I -only register, which is loaded from the
processor by executing an IOut ' instruction to 1/0
address hex 3D4. The five least-significant-bits of the
1/0 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 97/605
placed in the selected register. The Data Register is
loaded from the processor by executing an 'Out 'instruction to 1/0 address hex 3D5.
RO
The following table defines the values that must beloaded into the 6845-CRT-Controller registers to
control the different modes of operation supported by
the attachment:
Horizontal
TotalWrite
Only
38
R 2 HorizontalSync
Position
R 3 Horizontal
Sync
Width
R4 Vertical
Total
Write
Only06
IlphanumericLow/HighBand
WidthGraphics
Register
HexAddr. I / O 14ou25 80x25nits
0 Char. 71 38 /71
~~
R 1 Horizontal
DisplayChar. 50 2 8 / 5 0
2 Char. 5 A
3 Char. ocrFI 06
Write 1F
Only
4 Char.
RowIF 7 F / 3 F
06/06ScanLine
06Total
Adjustment
Vote: All register values are given in hexadecimal.
6845 Register Table (Part 1 o f 3)
2-76 Video Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 98/605
07 01/03
Register Alp hmum er c IBandow’HighHexAddr 40x25nits
6 Char.
R o wWrite
0nly
19erticalDisplayed
19 641 32
1c 70138Vertical
Sync
Posit ion
Char.
RowWrite
Only
8 InterlaceMode
Write0nly
02 021 02O2 I
9 MaximumScan Line
Address
ScanLine
Write
Only
07
26/26
O6
ICursor
StartScanLine
Write
Only
06
~~
Cursor
End
Write
Only
07/07
O7 IScan
Line07
qote: All register values are given in hexademical.
6845 Register Table (Part 2 of 3)
Video Subsystem 2-77
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 99/605
Register
Hexc+F I R l 5I
Start
Addr. ( H )
StartAddr. (L)
Cursor
Addr. (H)
Cursor
Addr. (L)
LightPen ( H )
LightPen L)
I I I
qote: All register values are given in hexadecimal. I6845 Register Table (Part 3 of 3)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 100/605
CRT/Processor Page Register
This register is an %bit 'write '-only register, that
cannot be read. Its address is hex 3DF. The following
is a description of the Register functions.
I Bit Number I Descr p ion
CRT Page 0
CRT Page I
CRT Page 2.Processor Page 1
Processor Page 2
Processor Page 3Video Address Mode 0
Video Address Mode 1
CRT/Processor Page Regis ter (Part 1 of 2)
CRT Page 0-2 These bits select which 16Kbyte memory-page between
00000 to hex lFFFF s being
displayed. If there is no
expansionRAMin the system,
the high- order bit is a 'don't
care I and only 4 pages are
supported. For graphics modes
which require 32K bytes thelow-order bit is a 'don't care I .
Processor Page 0-2 These bits select the 16K byte
memory-page region where
memory cycles to BSOOO are
redirected. If there is no
expansion RAM installed in
' the system, the high-order bitis a 'don't care' and only 4
pages are supported.
Video Subsystem 2-79
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 102/605
M ode Select ion 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:
Mode
40 by 25 Alphanumeric Black-and-white40 by 25 Alphanumeric Color
80 by 25 Alphanumeric Black-and-white
80 by 25 Alphanumeric Color160 by 200 16-Color Graphics
320 by 200 4-Color Graphics320 by 200 4-Shade Black-and-white
320 by 200 l6-Color Graphics
640 by 200 2-Color Graphics640 by 200 4-Color Graphics
Note: All values are given in hexadecimal.
-
00
oc08
OD
09
1A
OAOE1B
OEOB
-
-
Video GateArray Reg.-
01
OFOF
OFOFOF03
03
OF
0103
-
-
-
02
00
0000
0000
00
00
00
0000
-
-
-
03
0202020200
00
00
00
0800
-
-
Mode Summary
Sequence of Events for Changing Mod e s
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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 103/605
Remove gate-array reset
Read 256 bytes of memory
5 . Re-enable video.
Note: The gate array needs to be reset only whenchanging 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 thesystem.
At Standard TTL Levels
A1
A 3
A6
A 9
-VERT SYNC
LOGIC GND
-HORIZ SYNC
BLUE
RED
INTEN
GREEN
COMP SYNC
AUDIO
+VERT SYNC
LOGIC GND
+HORIZ SYNC
RESERVED
LOGIC GND
B6 RESERVED
RESERVED
RESERVED
B9 SHIELD GND
Connector Specifications
The direct-drive signals are standard TTL levels except
the audio output which is a 1V peak-to-peak signal
biased at OV which can drive a 1OK ohm or greater
input-impedence.
2-82 Video Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 104/605
Colo r/ G a phics
Composite Jack
Composite Video Signal
VideoMonito r Chassis Ground
Connector
for
Television
Connector Specifications
r A01
-12V W
RFA02 - Key b
A03 - Composite Video c Modulator
BO2 - udio
r BO3 - hield GND *
BO1 - G N D J
The com posite-video signal is 1V peak to peak biasedat .7Vwith a 75 ohm oad.
Television Connector Specifications
The Connector for Television connector has the
composite-video signal at 1V peak to peak biased at.7Vwith a 75 ohm oad. The connector also has theaudio output which is 1V peak-to-peak signal biased atOV which can drive a 1OK ohm or greater inputimpedence.
Vidw Subsystem 2-83
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 106/605
Beeper
8255A-5 Bit PB1, I/O Address Hex 61
Timer Clock Out 2
The system beeper is a small, piezoelectric- speaker,which can be driven from one or both of two sources.
The tw o sources are:
A N D
The 8255A -5 PPI output-bit PB1
Drive
Select8255 A -5 Bit PB4 I
A timer clock out of an 825 3- 5 timer which has a1.19MHz-clock input. The timer gate is alsocontrolled by an 8 25 5-5 outport bit PBO.
-
Note: The TI76496 Sound Generator cannot bedirected through the beeper.
Beeper30 Ohm Resistor
Beeper Block Diagram
Beeper 2-85
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 108/605
Sound Subsystem
1 Audio --System
Unit 2 GNDI
b
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
with any of the sound sources. The output of the
amplifier is supplied to the IBM Connector for
Television interface and external-amplifier interface. Ifan 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 8253programmable-timer mode.
sound source. This provides a consistent level of output
External
Amp
i
Connector Specifications
The audio output is a 1V peak-to-peak signal biased atOV. It can drive a 10k ohm or greater
input -impedence.
Sound Subsystem 2-87
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 109/605
Source
C om ple x So un d G e ne ra to r (TI 76496)
Programmable Timer (8253)
Casse t te Aud io
1 / 0 C ha nne l A ud io
Sound Sources
Port BitsPB6 PB5
1 1
0 0
0 1
1 0
Complex Sound Generator
The Complex Sound Generator chip (SN76496N) has 3
programmable frequencies which may be mixed to formchords 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 byreferring to Texas Instruments’ data sheets and
application notes.
2-88 Sound Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 110/605
Select PB6
Sound Block Diagram
+
8253 I c
L
L
.Cassette Protection
Diodes -a
External ,
Channel
Audio Tone Generator
Analog
Direct Drive- onitor AudioMPX +
Low R . F. Modulator
FilterAudio
Pass H w
f3dB = - xternal Audio
Amp
Features
0 3 Programmable Tone-Generators0 Programmable White N oise0 Programmable Attenuation0 Simultaneous Sounds
TTL Compatible0 3 . 579 MHz Clock Input
Audio Mixer
Processor to Sound-Generator Interface
The system microprocessor comm unicates with theSN76496N through the 8 data lines and 3 control lines
Sound Subsystem 2-89
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 111/605
(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-sigmfkant 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 112/605
Register Address Field
MSBRO R 1
LSBR 2 Destination Control Register
T o n e 1 FrequencyT o n e 1 Attenuat ionT o n e 2 FrequencyT o n e 2 Attenuat ionT o n e 3 FrequencyT o n e 3 Attenuat ionNoise Cont ro lNoise Attenuat ion
Register Address Field
High Data
RO R 1 R 2 F6 F7 F8 F9
Second Byte
MSB L SB MSB LSB
Frequency (Double or Single Byte Transfer)
Frequency G eneration
Each tone generator consists of a frequency-synthesis
section and an attenuation section. The frequency-
synthesis section requires 10bits 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 113/605
loaded into a 10-stage tone-counter, which is
decremented at an N / 16 rate where N is the inputclock
frequency. When the tone counter decrements to 0, a
borrow signa1,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:
where N = ref c l o c k i n Hz ( 3 . 579 MHz)
n = 10-bit binary-number
Attenuator
Reg. Addr.
Second Bit 7
MSB Byte
Update Attenuation (Sing le By te Transfer)
The output of the frequency flip-flop feeds into afour-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
theoretical attenuation is 28 dB typically.
2-92 Sound Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 114/605
Iit PositionI
Reg. Addr.
RO R1 R 21 1 1 0 X
Attenuator Values
SHIFT
FB NFO NF1
Noise Generator
Update Noise Source (Sing le Byte Transfer)
The noise generator consists of a noise source and anattenuator. The no ise source is a shift register with anexclusive-OR feedback-network. The feedbacknetwork has provisions to protect the shift register frombeing locked in the zero state.
L
Sound Subsystem 2-93
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 115/605
Configuration
Periodic Noise
White Noise
Noise Feedback Cont ro l
Bits
NFO NF1
0 0
0 1
1 0
1 1
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.
Shift Rate
N/512
N /1024
N / 2048
Tone Generator #3 Output
The output of the noise source is connected to aprogrammable attenuator.
Audio Mixer/Output Buffer
The mixer is a conventional operational-amplifier
summingcircuit. It will sum the three tone-generator
2-94 Sound Subsystem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 116/605
outputs, and the noise-generator output. The outputbuffer will generate up to 10mA.
Data Transfer
The sound generator requires approximately 32 clock
cycles to load the data into the register. The open
collectorREADY 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 CE. 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 ps )
for each data transfer.
Warning: Do not attempt to issue an 1/0 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 1/0channel, 1/0 WRITES to the 76496 will increase
the latency time.
Sound Subsystem 2-95
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 118/605
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.
M a - R e d ReceiverThe 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 atthe 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.
I&-Red Link 2-97
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 119/605
2. The data stream is sent using the infra-red-emittingdiodes.
3. Th e receiver amplifies and processes the signal.4. Th e demodulated signal is sent to the system board.
k o u t
Th e signal received consists of an infra-red-lighttransmission modulated at 40 kHz.
An input is available (I/R Test Frequency) to thesystem for receiver-circuit-operational verification.
Infra-Red Receiver Board
First
Amplifier
Stage
f%oto-Diode
infra-wi th
,
Second
Amplifier
with A GC
- tage
Infra-
Red
Test
Circuit
J
temod-
ulator
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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 120/605
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
ps 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 ps. The
processor samples each half-bit-sample 5 times and will
determine the logical level of the sample by majorityrule. 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-serialization of the keyboard data.
See the “Cordless Keyboard” in this section for more
information on the data-transmission protocal.
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.
The received encoded word did not
maintain odd parity.
Parity Errors
Infra-RedLink 2-99
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 121/605
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 willgenerally 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.
I Pin 1 Signal
A0 1
A02A03A04BO 1BO2
BO3BO4
~~ ~ ~
+12 VoltsG r o u n dGr ou nd -S hieldI .R . TEST F R E Q .G R O U N D+5 Volts
-1.R . KB D DA TAG R0U N-D
Infra- Red Connector Specifi cations
Input/ Output
I n p u tI n p u tI n p u tI n p u tI npu tI npu t
I n p u to u t p u t
2-100 Infra-Red Link
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 122/605
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 afunction 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 (IR) 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 keyboardconnector removes the
battery power and the -CABLE CONNECT signal
disables the infra-red-receiver circuit. The disabling ofthe circuit also allows other infrared devices to be used
CordlessKeyboard 2-101
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 123/605
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 maximizesystem-software flexibility in defining keyboard
operations such as shift states of keys, and typematic
operation. This s 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 aretypematic 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 1/0 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 16key-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, andre-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 onjoff switch isneeded.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 124/605
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-keyscan-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 systemunit 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 ps. A biphaselogically-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
0 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- he Infra-Red Linkconsists of a 40 kHz carrier burst at a 50 duty cycle.
Cordless Keyboard 2-1 03
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 125/605
I
Fi rst BitSecond BitTh ird BitFo ur th Bit I D at a Bit 2 IFifth BitSi xt h BitSe ven th BitEig ht BitN inth BitT en th BitElev enth Bit
St ar t BitD at a Bit 0 (Le ast Sig nificant Bit)D at a Bit 1
D at a Bit 3
D at a Bit 4D at a Bit 5
D at a Bit 6D at a Bit 7 (M os t Signif icant Bit)Pa ri ty BitS to p 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 126/605
Eleven Stop
I Bit cells I
\ \Infra-Red Data
Cable IBI-Phase '1 ' I I BI-Phase '0' Ii Bit Cell
440 IS 440 ps
Infra-
Red I BI-Phase '1'
I IBi-Phase 'O'
I40 kHz @ 50%40 kHz @ 50% Duty Cycle
4 402.5s j 22y40 ps f z s
Keyboard Transmission Timing
Cordless Keyboard 2-105
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 127/605
-CLB Data
,-)*ND/-
-1.R. Data
-CBL Con
1 Keyboard Data
- D
- =- 8255 PCOCLK Flip Flop
CLR
ANDNM I Mask -IOR From
Port A 0 Hex
Keyboard Interface Logic
2-106 Cordless Keyboard
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 128/605
Program Cartridge and Interface
The Program Cartridge allows the addition of ROM to
the system without removing the cover by plugging it I
into either of two slots in the front of the machine.
The 4 8 by 7 2 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 isaddressed 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 beinserted. This function is a factory-installed
Program Cartridge 2-107
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 129/605
signal- umper manufactured into particular
program-cartridges that are intended to replace the
system ROM.
0
1
Note: When the cartridge is inserted or removed
with the system turned on, the system will resetand go through a warm power-up. Any data in the
system.RAM will be lost.
055H
OAAH
Cartridge Storage Allocations
2
3 9 4 s
6
Last 2 Addresses
A. The following conventions will be followed for
“Initial Program Loadable” program cartridges:
Length
J u m p to Ini t ia l ize Co de
0
C R C B ytes
ontentsocation
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 representingthe entire address space taken by the ROM on the
cartridge. The algorithm for determining the
2-108 Program Cartr idge
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 131/605
LocationI
I I
Contents
I 0 I 055H - I
1
2
OAAH
Length
3-5
6
Z
I Y I Last Character in Command Name I
Jump to Initialize
Command Name Length (Offset Y-Offset Z)
First Character in Command Name
W
X
Last 2 Addresses
Word Pointing to Routine that isI Jumped to if “Name” is Typed
Next Command Name Length or
“00” f N o More Command Names
CRC Bytes
DOS Conventions
Locations 0 and 1contain 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
code for this ROM. (May just be a ‘Far Return’)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-110 Program Cartridge
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 132/605
containing offset within this segment to the codethat 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 OFBS (offset from start of
segment.that the cartridge is in) that needs to be
executed when ‘test is entered as a DOS command
the entry at location 6 would be hex
04,54,45 ,53,54,BSOF.
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 “CRCCheck”, 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 E0000.When “Cartridge BASIC” is activated, it will check
for a second cartridge program at hex D0000. 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-1 11
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 133/605
_ _ ~ ~ ~~
Location
0
12
I 3 I OCBH
~~ ~ ~
Contents
055H
OAAHLength
4
5
OAAH
055H
7
I6
O F F H if unprotec ted Basic prog ram
I o r OFEH if protected Basic prog ram
0
8
O FFH Pa dd ing t o nex t 2048 bytebounda r y
S t a r t of interpretable Basic code
I Last 2 Addresses I CRC Bytes
Cartr idge 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 configurationdetermination
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 'far return'instruction.
2-1 12 Program Cartridge
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 134/605
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 anunprotected BASIC program, or hex FE to indicate
a protected 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. CRC bytes: The last two locations of the address
space used by the cartridge must be blank. CRCcharacters 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.
7 . Location 8 must be the start of the BASIC program.
Program Cartridge 2-113
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 135/605
ROM Module
The ROM modules used are 250 ns devices. Typical
modules are the Mostek MK37000 and MK38000, the
TMM 23256, the SY23 128, and other compatible
devices.I
csocs1
c s 2c s 3
c s 4c s 5
CS6cs7
HexAddress Space
XX
D0000-D7FFFD8000-DFFFF
E0000-E7FFFE8000-EFFFF
F0000- F7 F F FF8000-FFFFF
Typical Use
.Not UsedNot Used
Optional Cartridge ROM #2Optional Cartridge ROM # 1
Standard Cartridge ROM #2Standard Cartridge ROM I
System Board ROM #2System Board ROM I
ROM Chip Select Table
Signal 1/0 Description
A0 - A14 0 Processor Address lines A0 - A14
DO - D7 I Processor Data lines
2-1 14 Program Cartridge
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 136/605
-cs2T H R U-cs7
0 These chip-select lines are used to
select ROM modules at different
addresses. The addresses for each
chip-select are shown in the ROM-chip
select-table. -CS6 and -CS7 are usedon 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 I
-BASE 1
ROM INCARTRIDGE
I This line when pulled I low I instructs
the system board to de-gate the ROM
module from hex FSOOO - 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 I 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.
ProgramCartr idge 2-1 15
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 138/605
. . . . .A 1 A 2 A 3 A 4 A 5 A 1 8
Top o f Cartridge
Momentary Reset Land
GND
-cs7-cs3A 14
A 12
A 4
A3 B10
A2 __I t
GND
CARTRIDGE RESET TAB
-c55
-BASE 1 R OM I N CARTRIDGE
A 13
A 8A 9
A1 1
-BASE 2 ROM IN CARTRIDGE
A1 0
D 7
A1
A 0
-c52
-CS6 -c54
+ 5 v + 5 v
Connector Specification
Program Cartridge 2-117
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 139/605
6 1 Opposite 618Address Side
FOOOO
Cartridge R O M Locations
A 1 8
ROM Cartridge
Address
E8000
Address
EOOOO
2-1 18 Program Cartridge
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 141/605
2 Resistive Inputs Joystick
2 Resistive Inputs JoystickIC
I/OWrite -
+From Left
t
A N D
2 But ton Inputs From Left Joystick
Convert
Resistance
to Digital
Pulse
Games Interface Block Diagram
c s
110 A N D + Data Bus
Reads Buffer/
Driver
Data Bus 0-74
_1
Any program application must first begin the
conversion by an I OUT to address hex 201. An ' IN 'from address hex 201 will show the digital pulse go
I high and remain I 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.
4
4
-
2-120 Games Interface
2 Button Inputs From Right JoystickA
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 142/605
Input from Address Hex 201
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
fDigital Inputs
Input From Address Hex 201
Joystick B Joystick A Joystick B
Button Button Button Button Coord. Coord.
#2 #I #2 #1 Y X
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2
tResistive Inputs
Joystick A
Coord. Coord.
Y X
Bit 1 Bit 0
Joysticks typically have one or two buttons and twovanable resistances each. The variable resistances aremechanically linked to have a range from 0 to lOOkohms. One variable resistance indicates the Xcoordinate and the other variable resistance indicatesthe Y coordinate. The joysticks are attached to give thefollowing input data:
~~ ~~ ~
Joysti ck Input Data
Games Interface 2-121
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 143/605
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
Paddle Paddle Paddle Paddle
D C B A
Bit 7 Bit 6 Bit 5 Bit 4
Coordinates
Paddle Paddle Paddle Paddle
D C B A
Bit 3 Bit 2 Bit 1 Bit 0
Pushbuttons
The pushbutton inputs are Iread I by an ' IN I from
address hex 201. These values are seen on data bits 7
through 4. These buttons default to an 'open' stateand are I read I as 1. When a button is pressed, it is
'read' as 0.
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
0 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 144/605
will go I true' after the fire pulse and will remain
'high' for varying times depending on where each
potentiometer is set.
These four one-shot outputs are I read by an ' IN '
f rom address hex 201 and are seen o n data bits 3through 0.
Joystick
Signal Name Pin
KeYPllJg
LOGIC GND
t-AX1S R ESISTANC E
p-, +5v
I-,SHIELD GND
Number
A04
BO 1
System
Board
X-AXIS RESISTANCE
SWITCH
SWITCH BO4
Connector Specification
Games Interface 2-1 23
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 146/605
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 panty bits. Aprogrammable 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 simulationFull 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 operationsince all but the Diskette Interrupt are masked 'off I
during diskette operations. If Async receive
Serial Port 2-125
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 147/605
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 IBM 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 1 /0
operations to the 8250A be avoided. A good
Programming Technique would be to insert a short
'jump ' between every consecutive 8250 1/0
instruction. This action will flush the queue and
provide 15 clock periods between 1/0 operations.
I
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 IBM
PCjr has the Internal Modem installed it is logically
C O M l 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:
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 148/605
Address A 0 Through A2
Data Bus
Interrupt
L
4
Baud Clock
1.7895
Cont ro l Signals
I Receivers' A I-
A 0 Through A2
DO Through D7
8250A
Asynchronous
Communications
Element
--I Drivers
b 16-Pin
Connector4
Serial Port Block Diagram
Serial Port 2-127
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 149/605
Modes of Operation
1/0 Decode(in Hex)
The different modes of operation are selected by
programming the 8250A asynchronous communications
element. This is done by selecting the 1 /0 address (hex
2F8 to 2FF) and I writing I data out to the card.
Address bits AO, Al , and A2 select the different
registers that define the modes of operation. Also, the
divisor-latch access-bit (bit 7) of the linexontrol
register is used to select certain registers.
Register Selected
2 F 82 F 82 F 82 F 92 F92 F A
2 F B2 F C2 F D2 F E2 F F
TX BufferR X BufferDivisor Latch LSBDivisor La tch M SBInterrupt Enable RegisterInterrupt Identif icat ion
RegistersLine Co ntro l Regis te rM od em Co nt ro l Regis te rLine S ta tu s Regis te rM ode m Sta tu s Regis te rSc ratch Register
DL AB State
DLAB=O (W ri te )D LA B - 0 ( R e a d)D L A B = lD L A B = lDLAB=O(Don’ t Care )
( D on’ t C a r e )( D on’ t C a r e )(Don’ t Care)(Don’ t Care)(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 regster, affects the selection of certain
8250A registers. The DLAB must be set ’ high ‘ by
the system software to access the
baud-rate-generator divisor latches.
2-128 Serial Port
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 150/605
Interrupts
One interrupt line is provided to the system. This
interrupt is IRQ3 and is 'positive active I . To allow the
serial port to send interrupts to the system, bit 3 of the
modem control register must be set to 1 'high I . Atthis point, any of the following interrupt types
'enabled' by bits in the interruptenable register will
cause an interrupt: Receiver-line status, Received Data
available, Transmitter-Holding-Register empty, or
Modem Status.
Interface DescriptionThe communications adapter provides an EIA RS-232Celectrically-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:
Pin A04Pin A 0 8
Pin A 0 3Pin A07Pin A 0 6
Pin A05
Pin A02Pin BO1
Pin B02-BO8
Transmit Data
Receive Data
Request to Send
Clear to Send
Data Set Ready
Signal Ground
Carrier Detect
Data Terminal Ready
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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 151/605
signals can then be sensed by the system software to
determine the state of the interface or peripheral
device.
Interchange Binary SignalVolt age State Condition
Positive Voltage = Binary (0) = Spacing
Negative Voltage Binary ( 1 ) = Mark ing
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.
Inter faceControlFunction
= O n
= Off
Note: Ring Indicate is not supported on the PCjr .
Voltage Interchange Information
0 Vdc I n v a l i d L e v e ls
Th e signal will be considered in the 'm ar ki ng 'condit ion when the vol tage on the interchange circui t,
measured at the interface point , is more negative than
2-130 Serial Port
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 152/605
-3 Vdc with respect to signal ground. The signal will be
considered in the Ispacing condition when the voltage
is more positive than +? Vdc 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 Vdc will also be
considered an invalid level.
During the transmission of data, the marking I
condition will be used to denote the binary state 1, and
the ‘spacing’ condition will be used to denote the
binary state 0.
For interface control circuits, the function is ’ on I
when the voltage is more positive than + 3 Vdc with
respect to signal ground and is ‘off’ 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 l ) , 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 153/605
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”
INS8250A Programmable Baud RateGenerator
The INS825OA 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) / (baud rate x 16) . Two 8-bit
latches store the divisor in a 16-bitBnary- 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 figur: 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 thedata rate be greater than 4800 baud.
2-132 Serial Port
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 154/605
DesiredBaudRate
~~~
50
75110134.5
150
300
600
1200
1800
20002400
3600
4800
Divisor Used toGenerate 16x Clock(Decimal) (Hex)
2237
14911017
832746
373
186
93
62
5647
31
23
8BD
5D31Al16712c
175
BA
5D
3E
382F1F17
Percent Error Per BitDifference BetweenDesired and Actual
.006
.017
.023
.054-050
.050
.218
.218
.218
.140-855
.218
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 programinitializes 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 155/605
BEGIN PROC
MOV
MOV
OUT
JMP
MOVMOV
OUT
JMP
MOV
MOV
OUT
JMP
MOV
MOV
UNUSED - 1 B1
DTR -RTS -
TRANSMIT DATA - 4 84
CARRIER DETECT -DSR -CTS -
RECEIVE DATA - 8 8 8
OUT
JMP
MOV
IN
- HIELD GN D
- OGICGND
- OGICGND
- OGIC GND
- OGICGND
- OGICGND
- OGICGND
- OGIC GND
NEAR
AL.80H
DX.2 FB H
DX,AL
$+2
DX.2 F8HAL,SDH
DX,AL
$+2
DX.2F9H
AL.0
DX,AL
$+2
DX,2 FBH
AL,OBH
DX,AL
$+2
DX.2 F8H
AL,DX
SET DLAB = 1
To Line Control Register
1/0 DELAY
Point to LSB of Divisor LatchThis is LSB of Divisor
11’0DELAY
Point to MSB of Divisor Latch
This is MSB of Divisor
I / O DELAY
Line Control Register
8 BitsI’Word, 1 Stop Bit,
Odd Parity, DLAB =0
1/0 DELAY
In Case Wri ting to Por t LCR Caused
Data Ready to go high
ENDP
BEGIN
Assembly Language Sample Program
2-134 Serial Port
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 156/605
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 powercord 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 1/0 connector
for a machine that is fully configured with internal
features is 400 mA of +5 Vdc, 0 mA of +12 Vdc and 0
mA 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. Thepower 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 157/605
Operating Characteristics
Power Supply Input Requirements
Voltage (Vac)
Nominal Minimum Maximum
120 104 127
Frequency Current (Am ps)
+.5 Hz Maximum
60 H z .65 at 104 Vac
Voltage ac
D.C Outputs
Nom inal Minimum Maximum
+5 '1.5 3.6+12 .04 1.2-6 0.0 .025
Current (Am ps)
+%
55
16
RegulationTolerance
Voltage dc
* 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 158/605
Over-Voltage/ Over-Current Protection
120 Vac
Input (Transformer)
~
Non-reset ta ble FuseThermal/ Over-Current
5A Slo Blow
The following table describes the transformer input
protection:
outputV oltag es
I Voltage (N ominal) 1 Type Protection I Rating(Amps) 1
Over-Voltage Over-Current
+5 Vdc
12 Vdc
Output (Power Board)
"6.3 k . 7 Vdc
'14.4 2 1.4 Vdc
**3 .9? .25 Amps
2.2 k .9 Amps
The following table describes the Power Board's output
protection:
Protection ConditionI
~~
* Over-Voltage protection is provided by fuse Fl.
**Resettable by removing the fault condition and removingpower for at least 5 seconds and then applying power.
Output Protection
Power Supply 2-137
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 162/605
SECTION 3. YSTEM OPTIONS
Contents
IBM PCjr 64KB Memory and Display Expansion 3-5
IBM PCjr Diskette Drive Adapter ........... 3-13
Digital Output Register . . . . . . . . . . . . . . 3-15
Floppy Disk Controller (FDC) . . . . . . . . 3-16 Programming Summary . . . . . . . . . . . . . . 3-17
System 1/0 Channel Interface . . . . . . . . . . . 3-19
Functional Description . . . . . . . . . . . . . . . . . 3-15
WatchDog Timer . . . . . . . . . . . . . . . . . . . 3-16
Comments . . . . . . . . . . . . . . . . . . . . . . . . 3-16
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 4
Command Format . . . . . . . . . . . . . . . . . . 3 4 0Commands ........................ 3 4 2 Responses ........................ 3-59 Editing/Changing Command Lines . . . . . 3-59
Dialing and Loss of Carrier . . . . . . . . . . . . . . 3-60
Status Conditions ..................... 3-60
3-1
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 163/605
Default State .........................Programming Examples . . . . . . . . . . . . . . . . .Modes of Operation . . . . . . . . . . . . . . . . . . .Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . .Data Format .........................
Interfaces ...........................8250A to Modem Interface . . . . . . . . . . .Telephone Company Interface . . . . . . . . .System 1 / 0Channel . . . . . . . . . . . . . . . . .
3-63
3-63
3-68
3-70
3-70
3-70 3-70
3-74
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 SerialDevices . . 3-89
IBM PCjr Adapter Cable for Cassette . . . . 3-91
IBM PCjr Adapter Cable for the IBM ColorDisplay ................................ 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-107Printer Specifications . . . . . . . . . . . . . . . . . . 3-107
3-2
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 164/605
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 P C Com pact Printer ..................... 3-133 Printer Specifications ..................... 3- 135
Serial Interface Description ................Print Mode Com binations for the P C
Compact Printer ........................ 3-140 Printer Control Co des and Functions . . . . . . . 3-140
3- 139
3-3
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 166/605
IBM PCjr 64KB Memory and DisplayExpansion
The 64KB Memory and Display Expansion option
enables the user to work with the higher density videomodes 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 theadditiona1 memory.
Eight 64K-by-1, 150 ns, dynamic memory modules
provide 64K bytes of storage. The memory modules
are Motorola’s MCM6665AL15, and Texas
Instrument’s TMS4 164- 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.
64KBMemory Expansion 3-5
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 167/605
The following is a block diagram of the IBM PCjr
64KB Memory and Display E xpansion.
64K x 8 R A M CPU LATCH
DO-D7 ’ t Din D o u t ’ t
-
Gating -DISABL E E DATA
-DISABLE CAS0
-LCG
RAS, CAS, -WE,
AO, CPU DLY,
VIDEO MEMR
M E M AO-A7 t DR
CNTL
Memory Expansion Block Diagram
atch
_ G
3-6 64KB Memory Expansion
ACPU LA TCH
D
v
ATR LATCH
c
ATR
LATCH
~tDO-MD7
-+ Latch
G
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 168/605
1 / 0 Descriptionignal
+ U S
+ A 0
I +Row Address Strobe.
This line is inverted and
then becomes the -RAS
for theRAM
modules.I Microprocessor Address
0. This is used to
determine whether the
microprocessor access is
from the system board
RAM (Low) or from the
expansionRAM (High).
-DISABLE EDATA 0 When the expansionRAM 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.
ATR LATCH I This signal indicates thatthe expansionRAMcard
should 'latch' up data
from the expansionRAMinto the attribute latch.
CRT information from
the attribute latch and go
to the Video Gate Array.
DO thru D7 1 / 0 These data lines are from
the microprocessor and
are bidirectional.
address lines for the
dynamic-RAM modules.
These lines aremultiplexed between row
address and column
MDO thru MD7 0 These data lines contain
MEM A0 thru A7 I These are the multiplexed
64KB Memory Expansion 3-7
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 169/605
CPU DLY
address, and also
between microprocessor
and CRT addresses.
high t indicates a
MEMR is accessing thesystem board or
expansionRAMis being
accessed. This line along
with A0 determines if the
expansionRAMmicroprocessor latch
should I gate ' its data
onto the DO thru D7 Bus.
This line when I high
indicat that a
micr0%ocessor RAMcycle is occurring. It is
used to gate 'off I the
expansion RAM CAS or
used with A0 to generatethe -DISABLE CAS 0
signal.
disable the system board
CAS0 when a system
microprocessor I write is
occurring to the
expansionRAM. Thisline keeps the I write
from occurring to the
system board RAM.
I Column Address Strobe.
This line instructs the
expansion RAM to
I latch up the address on
the MEM A0 thru A7
address lines.
VIDEO MEMR I When this signal is
I
-DISABLE CAS 0 0 This line is used to
+CAS
3-8 64KB Memory Expansion
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 170/605
-LCG
GATE
-WE
CPU LATCH
-ATR CD IN
0 This line is used toinstruct the system board
that attributes or ODD
graphics data should be
'read' from the
expansionRAMcard for
use by the Video Gate
Array.
I This line is 'wrapped'
and becomes the -LCG
output.
memory that the cycle is
I This line instructs the
I
0
a microprocessor Iwrite I
cycle.
This line instructs the
exfansion RAM card to
I latch the data from
the expansion RAM into
the microprocessor latch.
This line is a wrap of the
ground line on theexpansion RAM card. It
pulls I down an 8255
input so that the
microprocessor can tell if
this card is installed or
not.
64KBMemory Expansion 3-9
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 171/605
The follow ing is the connector specifications for theIBM PCjr 64KB Memory and Display Expansion.
1System Board
Connector
6 4 K B Memory and Display Expansion
3-10 64KBMemory Expansion
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 172/605
ConnectorPin
A 0 1
A02
A03
A04A05A06A07A08A09A10A1 1
A12A13A14A15A16A17A18
A19A20A 2 1
A22
Signal Name
+ R A SA 0
- D I S A B L EE D A T A
A T R L A T C HM D 4M D 5M D 6M D 7MDOM D lM D 2M D 3G N DvccD 7D 5D 3D l
M E M A 6M E M A 4M E M A 2M E M A 0
Connector Specifications
Signal Name
V I D E O M E M RC P U D LY
C A S 0- D I S A B L E
+ C A S-LCGG A T EG r o u n dG r o u n dG r o u n d
C P U L A TC H-A TR C D ING N DvccD 6D 4D 2DO
M E M A 7M E M A 5M E M A 3M E M A 1
-WE
~~ ~
ConnectorPin
BO 1
b02
b03
b04
b05
b06
b07
b08
b09
BlOB l lB12B13B14B15B16B17B18
B19B20B2 1
B22
64KBMemory Expansion 3-11
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 174/605
IBM P C r 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
doubledensity , Modified Frequency Modulation
(MFMkcoded, diskette drive and uses write
precompensation with an analog phase-lock loop for
clock and data recovery. The adapter uses the NECpPD765 or compatible controller, so the pPD765characteristics 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
1 / 0 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 175/605
a CI E
-
a o 5a P
-00
n
a
a
3 14 iske vAdpe
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 176/605
Functional Description
From a programming point of view, the diskette drive
adapter consists of a 4-5it digital output register (DOR)
in parallel with a NEC pPD765 or equivalent floppy
disk controller (FDC).
Digital Output Register
The digital output register (DOR) is an output-only
register used to control the drive motor and selection.
All bits are cleared by the 1/0 interface-reset line. The
bits have the following functions:
I/O Address Hex F2
Drive Enable
Reserved
Reserved
Reserved
Reserved
Watch Dog Timer Enable
* Watch Dog Timer Trigger
* FDC Reset
Digital Output Register
Bit 0 This bit controls the motor and enable
lines to the drive. When Ihigh' ( l ) , his
bit will turn 'on' the drive motor and
'enable' the drive. When 'low' (0), this
bit will turn 'off I the drive motor and
Idisable I the drive.
These bits are reserved.its 1-4
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 178/605
a particular command. The main status register canonly be read and is used to facilitate the transfer of data
between the system microprocessor and FDC.
FDC Register 1 / 0 Address
Data Register hex F5Main Status Register hex F4
Programming Summary
The FDC is set up with the following Parameters during
system power up:
Parameter
Sector Size
Sec to r Co un t
Head U n load
H e a d S t e p R a t e
H e a d L o a d T i m e
F o r m a t G a p
W r ite G a p
N o n - D M A M o d e
Fil l by te fo r For m at
.~ ~
Power- up Condi t ion
hex 02 fo r 512 Byte Secto rs
9
hex OF - Has n o effect o n systemoperat ion.
hex D
hex 1
hex 50
hex 2A
hex 1
hex F6
Th is gives a s tep ra te of
6 milliseconds.
M in imum head load t ime .
FDC Power-up Parameters Setti ngs
Diskette Drive Adapter 3-17
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 179/605
The IBM 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 theBIOS listing for details of how these commands are
used.
The following FDC hardware functions are not
implemented or supported by the IBM PCjr Diskette
Drive Adapter.
DMA data transfer
FDC interrupt
0 Drive polling and overlapped seek
FM data incoding
Unit select status bits
2 H ead s (1 per side)40 Cylinders (Tr ack s) / Sid e9 Sec to r s / Track512 Bytes /S ec torModi f i ed Frequency Modula t ion (MFM)
Diskette Format
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 180/605
Value IConstant I
Not Applicable2 1 Milliseconds
500 Milliseconds
Head Load
Head Settle
M ot or Start
Drive Constants
Comments
1 .2.
3 .
4.
Head loads when diskette is clamped.Following access, wait Head Settle time before
RD/wR.
Drive motor should be 'off I when not in use. Wait
Motor Start time before RD/wR.
All system interrupts except IRQ6 must be
'disabled I during diskette data transfer in order to
prevent data under-run or over-run conditions from
occurring.
System I/O Channel Interface
All signals are TTL-compatible:
Most-Positive Up-Level + 5.5 VdcLeast-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:
+DO thru 7 (Bidirectional, Load; 1 74LS,
Driver: 74LS 3-state)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 181/605
+ A0 thru 3
-1OW
-1OR
-RESET
+IRQ6
-DISKETTECARDINSTALLED
These eight lines form a bus through
which all commands, status, and data
are transferred. Bit 0 is the
low-order bit.
(Adapter Input, Load: 1 74LS)
These four lines form an address bus
by which a register is selected to
receive or supply the byte
transferred through lines DO-7. Bit 0
is the low-order bit.
(Adapter Input, Load: 1 74LS)
The content of lines DO-7 is stored
in the register addressed by lines
AO-3 at the trailing edge of this
signal.
(Adapter Input, Load: 1 74LS)
The content of the register addressed
by lines AO-3 is I gated onto lines
DO-7 when this line is 'active. I
(Adapter Input, Load: 1 74LS)
A down level I aborts any operation
in process and I clears the digital
output register (DOR).
(Adapter Output, Driver: 74LS3-state)
This line is made I active ' when the
WatchDog timer times out.
(Adapter Output, Driver: Gnd.)
This line is pulled 'up' on'the
System Board and is wired to input
port bit PC2 on port hex 62 of the
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 182/605
8255. This line is used by the
program to determine if the diskette
drive adapter is installed.
-Diskette C S (Adapter Input, Load: 1 74LS)
A9
DRQ 0
DACK 0
This line is shared with the modemCS line and is 'low I whenever the
microprocessor is doing IOR or IOW
to either the diskette adapter or the
modem. This line should be
conditioned with A9 being I low I to
generate a DISKETTE CS.
(Adapter Input, Load: 1 74LS)
This line is the microprocessor
address line 9. When this line is
I low I and -DISKETTE CS is I low I
IOR and IOW are used by the
diskette adapter.(adapter Output, Driver: NEC ppd
765)
This output would indicate to a
DMA device on the external 1/0
Channel that the diskette controller
wants to 'receive' or 'transmit' a
byte of data to or from memory.
(Adapter input, Load: NEC ppd
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.
DisketteDrive Adapter 3-21
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 183/605
Drive Interface
ll signals are TTL-compatible:
Most Positive Up Level
Least Positive Up LevelMost Positive Down Level
+ 5.5 Vdc
+ 2.4 Vdc+ 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
Vcc (except Drive Select which has a 2,000 ohm
resistor to Vcc).
Each attachment input is terminated with a 2,000 ohm
resistor to Vcc.
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)
-Step
The drive must control its spindle
motor to 'start ' when the line
becomes 'active' and 'stop' when
the line becomes ' inactive. '(Driver: MC3487)
The selected drive must move the
read/write head one cylinder in or
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 184/605
-Direction
out as instructed by the Directionline for each pulse present on this
line.
(Driver: MC3487)
For each recognized pulse of thestep 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)
-Write Enable
For each I inactive to I active
transition of this line while Write
Enable is active , he selected
drive must cause a flux change to be
stored on the diskette.
(Driver: MC3487)
The drive must I disable I write
current in the head unless this lineis I active. '
-HEADSELECT 1 (Driver: MC3487)
This interface signal defines which
side of a two-sided diskette is used
for data recording or retrieval. Ahigh 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 ps delay is required before any
I read I or write ' operation can be
initiated.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 185/605
Adapter Inputs
-Index The selected drive must supply
one pulse per diskette
revolution on this line.
The selected drive must make
this line 'active' if a
write-protected diskette is
mounted in the drive.
The selected drive must make
this line 'active if the
read/write head is over track
0.The selected drive must supply
a pulse on this line for each
flux change encountered on the
diskette.
-Write Protect
-Track 0
-Read Data
Voltage and Current RequirementsThe diskette drive adapter requires a voltage supply of
+5 Vdc +/- 5% and draws a nominal current of 525
mA and a maximum current of 700 mA.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 186/605
33
lloiaoooogsrooooan
System Board Opposi te SideConnector
1
Disket te D r ive Adapter
round - Odd Numbers- 1 Through 33
5
nused 2,4.6INDEX 8
c Unused 10
.c--DRIVE SELECT 12- nused 14 8
4 -MOTOR ENABLE 16 .4- -DIRECTION (Stepper Motor)- 18
*
+-, -STEP PULSE 20
4-.-WRITE DATA 224-J -WRITE ENABLE 24
TRACK 0 26---WRITE PROTECT 28 +30
*-------SELECT HEAD 1 32
nused 34-
--READ DATA
Diskette
Drive
(See
Note)
Diskette
Drive
Adapter
*
Note: Pin 5 is missing to match the key plug on the signal cable.
Con nector S pec i f ica t ions (Par t 1 o f 2)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 187/605
Signal Name Diskette Drive Adapter Signal Name
D 7 - + -
D 6 4 = *
D 5 - E-
GND
0 4 4
03-D2-
GND
D 1 - 5-
DO-IRQ6
-+DRQO .Lc
-DACKO +-5v
A 01
A05
A10
BO1
BO5
B10
815
Note: All levels are TTL compatible.
4 + 5 v- DISKETTE CS
-9* A 3
GND- 2
4 A1
+ A0
GND
4 -IOR
* - lowGND
+ CARD INSTL
4 -RESET
-+5V
Connector Specifi cations (Part 2 o f 2)
3-26 Diskette Drive Adapter
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 188/605
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 thediskette. Operator intervention is not required during
normal operation. If the diskette is write-protected, a
write-protect sensor 'disables ' 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,
dif ferentiator,zero-crossing detector, and digitizing
circuits. All data decoding is done by the adapter card.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 189/605
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.
drive’s electronics whenever it senses a
write-protect tab on the diskette.
The write-protect sensor I disables the diskette
The drive requires power within the following
specifications
Specification I+5 Vdc Input I+12 Vdc Input
Nom ina l Supp lyRipple (0 t o 50 k H z )Tolerance ( Including Ripple)S tandby Cur ren t (Nominal )S tan dby Cur ren t (W ors t Case)
Opera t ing Cu r ren t (Nomina l )Opera t ing Cur ren t (W ors t Case)
+5 Vdc100 mV
+5600 m A700 m A
600 m A700 m A
+ I 2 V d c100 mV
+5%400 mA500 m A
900 m A2400 mA
Diskette Drive Power Specifications
For interface information refer to “Diskette Drive
Adapter” in this section.
For mechanical and electrical specifications see
Appendix D .
3-28 Diskette Drive
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 190/605
Key Signal Cable Power
Slot Connector Conne_ ctor Fan Connector
2 34npposi te Side
Diskette Drive Connectors
Connector Specifications (Part I of 2)
Board+12Vdc
3 GND 3an
Connector Specifi cations (Part 2 of 2)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 192/605
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.25 f 0.01 InchOxide Coated
.140 Inch
( 3 .5 6 mm) T (6.30 k 0.25 mm) Mylar Disk
Hole Aperture Index Hole
Recording Medium
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 194/605
IBM PCjr Internal Modem
The IBM PCjr Internal Modem is a 65 mm (2.5 inch)
by 190 mm (7.5 inch) adapter that plugs into the PCjr
system board modem connector. The modem
connector is an extension of the system 1/0 bus. Allsystem control signals and voltage requirements are
provided through a 2 by 15 position card-edge tab with
0.254 cm (0.100-inch) spacing on the modem adapter.
Functional Description
The Internal Modem consists of two major parts: (1)
the INS8250A Asynchronous Communication Element,
and (2) the Smart 103 Modem. Therefore, the
INS8250A communications protocol is a function of
the system ROM BIOS, and is discussed later in this
section. All 'pacing ' of the interface and control-signal
status must be handled by the system software. After
the INS8250A is initialized, the modem is controlled by
ASCII characters transmitted by the INS8250A.
programming must be conside/d in two parts. The
Key features of the INS8250A used in the modem
adapter are:
Adds or deletes start bits, stop bits, and parity bitsto or from- he serial data stream
0 Full double-buffering eliminates the need for precise
synchronization
0 Independently-controlled transmit, receive, line
status, and data-set interrupts
Programmable baud-rate-generator allows division
of the baud clock by 373 (hex 175) for a 300-bpstransmission-speed or 1017 (hex 3F9) for a 110-bps
transmission-speed to generate the internal 16 x
clock
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 195/605
Modem-control functions: Clear to Send (CTS),
Data Set Ready (DSR), Data Terminal Ready
(DTR), Ring Indicator (RI), nd Data Camer
Detect (DCD)
Fully-programmable serial-interf ace
characteristics:
- 7 , or %bit characters
- Even, odd, or no-parity bit generation and
detection
- 1 stop-bit generation
- Baud-rate generation
False-start bit detection
Complete status reporting capabilities
Line-break generation and detection
Internal-diagnostic capabilities
- Loopback controls for communications-link
fault-isolation
- Break, parity, overrun, framing-error simulation
Fully prioritized-interrupt system-controls
Key features of the Smart 103 Modem used on the IBM
PCj-Internal Modem are:
Direct connection to a telephone company line
through an FCC Part-68-approved permissive
connection
Compatible to Bell Series 100 originate/answer for
modulation and handshaking
All functions controlled by ASCII characters and
INS8250A modem-control lines
Uses modular phone-jack (USOC RJ11)
Data rate is either 300 or 110 bits-per-second
Auto/manual originate
Auto/manual answer
Communication mode is full duplex on two-wire,switched-network channels
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 196/605
Auto dialer; either DTMF ([dual-tone
modulated-frequency] touch-tone) or pulse-dialing(rotary dial) by software commandTandem dialingCall-progress reportingDial-tone, ring-back tone, and busy-tone detection
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 197/605
1 0 3 *Demodulator , c
-
J
IBM PCj r Internal Modem Block Diagram
r A
RJ11
Phone I
Jack
.
3-36 Internal Modem
Interface
Circuit
-
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 198/605
Modem Design Parameters
The following tables describe the design parameters of
the Smart 103 Modem.
Dialer Type:
D T M F Dialing:
T w o m o de sI . F orc ed T ouc h-T one (D T M F ) d ia li ng2. For ced pulse dialing
T he AS CI I c ha ra c te r P (hex 50 o r 70 inth e dial s tr ing causes a delay of u p t o 10seconds while th e m od em is searchingfo r anoth er dial tone. A t ime o ut will
c ause t he m ode m to ha ng up a nd posts tatus . Th e ASC II characte r W (hex 57
or 7 7 ) in th e dial s tr ing causes a
5-second de ad wait before contin uing tod ia l . Mul t ip leASCII W’s will causemu ltiple waits.
Rate: 10 + I , -0 pulses per second
D ut y Cycle: 60% make, 40% breakInterdigit Delay: 800 m s I-t 50 ms
T o ne Dura t i on : 85 m s t 10 msIn te r tone Dura t ion : 80 ms I-t 10 m s
Dialer Parameters (Part 1 of 2)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 199/605
1one Pair Frequencies:IASCII Digit Code
0
1
234
5
6
789
#
*
Frequency (Hz)94 1 i336697 1209
697 1336697 1477770 1209770 1336770 1477852 1209852 1336852 1477
941
120994 1 1477
Dialer Parameters (Part 2 of 2)
Time Out Dura t ion : A da ta cal l will t ime out if an answerton e is not detecte d within 45 seconds ofth e last digit d ialed.
~ ~~~ ~ ~
Failed Call Time Out Parameter
Modula t ion : Conforms to Bell 103/ 113 specification usingbinary phase-coherent frequency shift keying( FS K ) .
Modu a on Pa ra meter
3-38 Internal Modem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 200/605
I Mode I Originating End I Answering End
T ra ns m i t 1070 S pa c e 2025 S pa c e1270 M ark 2225 M ark
Receive 2025 H z S pa c e 1070 H z S pa c e1270 H z M a r k225 H z M a r k
i
I Receive S ensitivity I M ore negative o r equal to -42 dBm. IReceive Sensitivity Parameters
Transmit ter Level F ixed a t -10 d B m as per FCC P a r t 68Permissive connect on.
I ITransmitter Level Parameter
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 201/605
Programming Considerations
The modem and the IBM PCjr system can communicate
commands or data between each other. A n y commands
sent to the modem from the IBM PCjr are stripped
from the data stream and executed but are not
transmitted to the receiving station. The data is
transparent to the modem. The modem is capable of
causing hardware interrupts as the result of certain
conditions, and in response to queries for its status.
Commands to the modem are a sequence of characters
preceded by a single command character. Thecommand character tells the modem that the following
character sequence, until a carriage return, is a
command. The carriage return completes the command
sequence and causes the modem to execute the
commands. The command character (represented by
[cc] in thc following text) is programmable (with the
NEW command) to any ASCII character (hex 00 thru
7F). The default for the command character is Ctrl N
(ASCII hex OE).
Commands can occur anywhere in the data stream if
properly formatted but are not to be executed by the
modem until a carriage return is received.
Multiple commands are allowed if separated by commasand preceded by a single command character.
Command Format
The following is the command format that all
commands must follow.
[cc][command word][delimiter][arguments] [,more][CR]
where:
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 202/605
[arguments]
[eel
[command word]
[delimiter]
is the single ASCII commandcharacter.
is the command word or the first
letter of the command word.
is always a space when separating
an argument and command word.Any spaces thereafter are ignored
until the modem sees a comma, an
argument or a camage return.
is a variable that is replaced by any
character allowed by the command
definition.
is any additional commands
preceded by a comma.
is a carriage return that completes
the command sequence and causes
the modeyfo execute the
commands.
The following are two examples of command format.
[cc] COUNT 5 [CR]
sample test [cc] VOICE, D (408)
555-1234,QUERY [CR]
Format Guidelines
1.
2.
3.
Commands can occur anywhere in the data stream if
properly formatted but are not be executed by the
modem until a carriage return is received.
Multiple commands are allowed if separated by
commas and preceded by a single
command-character.
Only the first character of the command word is
significant. All remaining characters are ignored up
to the first space following the command word. In
other words, the DIAL command and DUMMY are
treated identically.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 203/605
4. The modem does not discriminate between
upper-case and lower-case characters.
5 . There are three ways to send the current
command-character as data to a receiving station:
a. Consecutively sending it twice:
rcc1 cc1
This would send the character a single time.
b. Change the command character (with the NEWcommand) to another ASCII character and then
transmit the previous command-character.
c. Place the modem in the Transparent mode and
then transmit the character.
Commands
The commands that are used with the integrated
modem are listed on the following pages in alphabetical
order.
Each of the commands has its syntax described
according to the following conventions:
1. Words in capital letters are keywords. Only the first
letter of the keyword is required, the others are
optional.
2. You must supply any arguments which are inlower-case letters. Valid characters for arguments
are defined as:
m - ASCII decimal digits 0 to 9, *, #, I, P, and W
n - ASCII hexadecimal digits 0 to F
o - ASCII hexadecimal digits 0 to 9
p - any ASCII character
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 204/605
3. All arguments are examined for validity. If extra
characters are used in an argument, the extra
characters are ignored. If the argument is invalid,
the command is ignored.
4. An ellipsis (...) indicates an item may be repeatedasmany times as you wish.
5. All command lines must begin with a command
character. The default command-character is
(CONTROL N).
6. Multiple commands separated by commas can
follow a single command-character.
An example of the DIAL command is given below:
Command format - DIAL m...m
Command line - DIAL 1 800 555 1234
If an invalid argument or no argument is given, the
command is not executed. Also, a question mark (?) is
given as the error response and the command line is
aborted.The commands are as follows:
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 205/605
Format: ANSWER
A
Purpose: To logically take the phone off the hook and forceANSWER mode. This is logically like a manualanswer.
Format: Break n
Purpose: To send a space or break character for a durationequal to a m ultiple of 100 ms (n x 100 ms).
3-44
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 206/605
Format: COUNTn
C n
Where n s the number of complete rings in the rangeof hex 0 to hex F.
When answering an incoming call, the modem
answers the phone after n complete incoming rings,
where n is any value from hex 0 to F.
A value of zero specifies that the modem not answeran incoming call, but still carry out any instructions
from the host.
When dialing, the modem waits n + 3 complete
ringbacks before cancelling the call.
If n exceeds 4, the 45-second abort timer cancels an
outgoing call with an "UNSUCCESSFUL" response
as more than seven ringbacks exceeds 45 seconds.
Purpose: Sets the ring count when the modem is answering an
incoming call or dialing a call.
Default: 0
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 207/605
Format: DIAL m...m
D m...m
Where m...m is a dial string of ASCII decimal digits 0
through 9, *, #, I, P, and W. A maximum of 33
characters are allowed in the dial string. The first
character of the string defaults to P (a 10-second
delay while searching for the dial tone). W causes
the modem to delay five seconds, then continue
dialing.
W or P must start a string, can also occur anywhere
within a ssring, and causes the digits to be tone
dialed.
The characters * and # represent the two extra
buttons on a push-button phone, but may be used for
other things.
I causes the next digits to be pulse dialed. The I
stays in effect until a (P, ) , (W,),or end of command.
The modem then searches for line busy, ringing, or
incoming carriers while posting the status.
Purpose: To cause the modem to dial.
Default: P (10-second timeout). (If this command is used
without an argument, the last number dialed is
redialed once.)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 208/605
Format: FQRMATn
F n
Where n is one of the following:
n Parity Data Length Stop Bit
0 Mark 7 1
1 Space 7 1
2 Odd 7 1
3 Even 7 1
4 None 8 1
5-7 Reserved
The 8250A line control register (LCR) must specify
the same format as defined in the FORMAT ncommand to 'enable data/command
communication.
Do not combine this command with any other
commands except the SPEED command on a single
command line.
Note: If programming in BASIC, this command
must be used in addition to specifying the sameparity and data length in the BASIC 'open
statement.
Purpose: To change the parity and number of stop-bits being
transmitted at either end, to a new format.
Default: 3
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 209/605
Format: HANGUP
H
Purpose: To perform a clean disconnect and go on-hook.Logically the same as manually hanging up.
Format:
Purpose:
INITIALIZE
I
This command is executed in 10 seconds and is thesame as a cold start. An "OK"response is notreturned after execution and the integrity test code inthe QUERY ommand is set.
Places the modem in the power-up default-state.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 210/605
Format: LONG RESPONSE o
L o
Where o is one of the following:
o Mode Responses
0 Verbose"BUSY '
"NO ANSWER''
NODIAL TONE""OK"
CONNECTED
WINGUNSUCCESSFUL
II I t? (Question
Mark)
1 Terse (Hex co de)3 0313 2333 435
3637
Note: The dial string is not echoed in the tersemode.
Purpose: M odifies message feedback. Information is posted inthe status area.
Default: 0 (Verbose mode)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 211/605
Format: MODEM
M
Purpose: Forces the modem into the data state where the
carrier is placed on the telephone line and proper
connection-protocols are followed.
This command is equivalent to ANSWER f the data
state started as autoanswer.
Format: NEWp
where p is any ASCII character.(hex OE)
Purpose: Changes the command character to an ASCII
character.
Default: Ctrl N (ASCII hex OE)
Format: ORIGINATE
0
Purpose: Logically takes the phone off-hook and forces the
ORIGINATE mode. Logically equivalent to manual
originate.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 212/605
Format: PICKUP
P
Purpose: Logically takes the phone off-hook and puts themodem in the voice state.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 213/605
Format: QUERY
Q
Purpose: To query the modem for its status information.
Possible characters returned by the modem are as
follows
Responses Meaning
HO or H1
SO to SF
Hook status: HO = on-hook, H1 =
Current ringcount setting in hex.
off -hook.
B Line busy.
D
L Successful dial and handshake.
N
X
Line dead: no dial-tone found or no
ring/no busy timeout after dialing.
Dial not recorded: dial tone present
after dialing.
No answer: ringcount plus 3
exceeded.
TO Integrity test passed.
T1 Integrity test failed.
The first group of characters is always returned for a
QUERY command. The second group of characters
is returned only after a dialing sequence has been
started or a change has occurred in the dialing status.
The third group of characters is returned when aTEST command has occurred. All characters except
the first group are erased by being read and do not
appear in response to the next QUERY unless the
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 214/605
condition has recurred in the interim. The QUERYresponse overrides any incoming data from thetelephone line.
Format: RETRY
R
Purpose: When placed after a DIAL command, it causes themodem to execute up to 10 redials at a rate of oneper 40 seconds. The redials are triggered by a busy
detection after dialing.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 215/605
Format: SPEED o
so
Where o is one of the following:
o bps
0 - 110
. 1 - 300
2 - Reserved
Note: Do not combine this command with other
commands except the FORMAT command on a
single command line.
The SPEED command must be issued before the
8250A baud rate is changed.
Note: If programming in BASIC, this command
must be used in addition to specifying the same
bps rate in the BASIC ‘open’ statement.
Purpose: Sets the baud rate.
Default: I (300 bps)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 216/605
Format: TRANSPAREN n...n
T n...n
Where n...n is the number of bytes to transmit in therange of hex 0 to hex FFFF.
Purpose: Places the modem in the transparent mode for the
next n...n bytes.
The modem does not look for command sequences
but instead transmits every character it receives.
The argument can be up to four ASCII-coded hex
digits long. This provides a range of 65,536bytes.
If an argument is not included with the
TRANSPARENT ommand, the command is ignored
because it has no default.
The transparent mode is terminated when:
1. n...n characters have been transmitted.
2. Loss of carrier timeout.
3. INS8250A OUT 1 pin goes 'active. I (TheINS8250A -OUT 1 signal should remain
' active I until the transparent mode is
requested again.)
The modem exits the transparent mode before
processing the next complete character from the
host.
To re-enter the transparent mode, the sequence is:
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 217/605
1. The INS8250A -OUT 1 pin changes to, or
remains in the 'inactive' state.
2. The command string containing the
TRANSPARENT ommand is issued.
An argument of 0 causes a permanent
transparent mode which can be exited by the
'INS8250A -OUT 1pin going 'active. '
Format: VOICE
V
Purpose: Forces the modem to the voice state where no tones
or carriers are placed or searched for on the
telephone line.
This state is used for voice communication, when the
modem is an autodialer or answering device only. It
is also necessary to be in the voice state to transmit
DTMF tone-pairs.
This command I disables the autoanswer function.
The status responses are:
1. If a busy signal is detected "BUSY OK".
2. Any other condition "OK ...(16
dots).. CONNECTED .
3-56 Internal Modem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 218/605
Format: WAIT
W
Purpose: Causes the modem to take no action, includingautoanswer, until the next command is received from
the host. All commands following the WAIT
command in a single command-line are ignored.
Format:
Purpose:
XMIT m...m
X m...m
Instructs the modem to transmit the DTMF
tone-pairs found in the argument string m...m. This
is only valid in the voice state. Delays between digits
can be caused by inserting W’s in the string.
Each W causes a five-second delay.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 221/605
Opposite Commands
The command line is scanned after its completion (after
[CR] is entered). Commands which cause an action
during the scan (for example, DIAL) are not candidates
for opposite treatment. Only commands which
'preset I a static condition can be opposites.
They include:
Count (n)Format (n)
New (PISpeed (n)Transparent n..nModem - Voice
two entries, latest are used
two entries, latest are used
two entries, latest are usedtwo entries, latest are used
two entries, latest are used
these are opposites on ly when
on-hook
Note: Answer and originate are not opposites; each
of these causes an action when scanned.
Status Conditions
The modem sends the host messages as defined in the
LONG RESPONSE command for dialing success or
failure. Hardware interrupts for carrier loss and
detecting incoming rings are provided on the 8250A.
Dialing and Loss of Carrier
The dialing process begins with the modem searching
for a dial tone if it is not in the blind dialing mode. If a
dial tone is not detected, the modem hangs up, the
appropriate status characters are posted, and the "NO
DIAL TONE" message is returned to the host.
If a dial tone is found, the modem continues to dial.
When a P is encountered in the dial string, the modem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 222/605
delays for up to 10 seconds to search for another dialtone and returns the "NO DIAL TONE" message to
the host if a dial tone is not detected. When a W is
encountered in the dial string, the modem delays for
five seconds before continuing to dial. Consecutive
W's are allowed in a dial string.
Anytime a P or W is not followed with an I in a dial
string, the next digits are tone-dialed. When an I
follows a P or W, all following digits are pulse-dialed
until a P, W, or end of command ([CR]) s detected.
The modem ignores any character except 0 through 9,
*, #, I, P, or W while dialing. This allows the user to
place parentheses and dashes in the dial string for
greater legibility.
The modem checks the telephone line again after it has
dialed the digits in the dial string. If a dial tone is found
immediately, the dialed digits are not recorded and the
modem posts this to the status characters, hangs up,and sends the "UNSUCCESSFUL" message to the
host. If the line is busy, this is also posted to the status
characters and the modem hangs up and returns the
BUSY message to the host. If the line is ringing, the
modem begins counting the number of rings. If this
count exceeds the value of COUNT + 3, the modem
hangs up and takes the same actions as above. If noanswer tone is detected within 45 seconds after
completion of dialing, the modem hangs up and takes
the same actions as above.
Finally, if the call is answered, the modem either looks
for a carrier and begins the handshake sequence (if it is
in the data or modem state) or remains silent (if it is inthe voice state). In the voice state, the modem looks
for busy, and transmits a response (1) when the line is
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 223/605
found not busy, or (2) if it is found busy, in which case
it also hangs up and possibly dials again. In voice state,
ringback count and abort time out are not used.
If, during the process of establishing the data link after
dialing, the modem receives any character from the host
or - DTR goes 'inactive I , the modem aborts the call
with a clean disconnect, clears the balance of the
command line, and sends an OK message. Also, the
modem does not carry out the instruction sent from the
host, even if the character is a command character.
In the data state, the modem transmits a message aftersuccessful completion of the handshake, or after it has
determined that the handshake failed. An unsuccessful
handshake is evidenced by absence of carrier at the
proper time.
If a carrier drops out for more than two seconds in the
data state, the modem begins a timeout lasting
approximately 17 seconds. At the end of the timeout,
the modem hangs up. Any command received during
the 17 seconds resets the timer.
The modem does not automatically reestablish the
connection if the carrier returns after this dropout
interval. This allows the user or software to intercede
by commanding the modem to go into the voice state,to hang up immediately, or to take some other action.
The data connection may also be terminated by a
HANGUP command while carriers are still present. A
voice connection is always terminated by a HANGUP
command.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 225/605
Example 1:
OK [cc]Dial555-1234 [CR]NO DIAL TONE
O K
In this example, no dial tone is detected within
the time out period.
Example 2:OK[cc]Dial555-1234 [CR]
5551234.....................RING ................................. .CONNECTED OK
In this example, a modem answer tone is detected.
Example 3:
OK[cc]Dial1(301)555-1234 [CR]
13015551234.....BUSYOK
In this example, busy is detected.
3-64 Internal Modem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 226/605
Example 4:
OK[ccJDial 55 5- 1234 [ R ]5551234........RING.........................RING.. ..........................RING...................NO ANSWER
OK
In this exam ple, ring count is exceededbefore ringing stops.
Example 5:OK[cc]Dial555-1234 [ C R ]
5551234.........RING.........................................
......................... UNSUCCESSFUL
OK
............................................
In this exam ple, a failed-call time-out occurred because an
answer tone was not detected w ithin the allotted time.
Internal Modem 3-65
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 227/605
Example 6:OK&]Dial 99PS.55-1234 [C R ]99.. .......................................................................NO DIAL TONE
OK
In this example, the second dial-tone is not detected within the
time out period.
Example 7:OK[cc]Dial99P421-7229 [ C R ]99........... BUSY
OK
In this example, busy is detected within the time-out period.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 228/605
Example 8:
OK[&]Dial 99wW555-1234 [CR]99.. .....................................................................................................................................................................................................
42 17229. . .RING
......................CONNECTED
OK
In this example, the access code is dialed and two dead waits are
performed. Then, the second number is dialed and a modem
answers.
Example 9:
OK[cc]Dial555-1234, Retry [ C R ]5 5 5 1234.................... BUSY555 1234.................BUSY555 1234............ .CONNECTED OK
In this example, the modem dials a number with auto redial.
The first two times, the number is busy.The third time, a modem answers.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 229/605
Modes of Operation
The different modes of operation are selected by
programming the 8250A Asynchronous
Communication Element. This is done by selecting the
1 / 0 address (hex 3F8 to 3FF) and writing data out tothe card.
The 8250A is externally programmed to provide
asynchronous, ASCII, 10 bit character length including
start, stop, and parity on the serial-output pin (SOU”,pin 11). The data rate is 110 or 300 bits-per-second.
The commands can be either upper-case or lower-case
characters. See the command, Format [n],earlier in this
section for additional information.
For further information refer to “Bibliography.”
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 230/605
HexAddress
3 F 8
3 F 83F 83 F 93F9
3 F A
3 F B3 F C
3 F D3 F E3 F F
Register Selected
Transmit Buffer
Receive BufferDivisor Latch LSBDivisor Latch MSBInterrupt EnableInterrupt
1dent ifi cat ionLine Con t ro lM o d e m C o n t r o l
L ine S ta tu sM o d e m S t a t u sScra tch Pad
~~
Input/output
Write
R e a dWriteWri teWri teR e a d
Wri teWri te
R e a dReadWri te
Mode-1
xxxx75
01
OF
xx
1A01
xxxxxx
-
-
-2
xxxxF 903OFxx
0301
xxxxxx
-
-
Notes
*
******
* D L A B = 0 (Bit 7 in line control Register).* * D L A B = I (Bit 7 in line control Register).M o d e 1 - 300 BPS - 7 D at a Bits , 1 Stop Bit, Even Parity.M o d e 2 - 110 B P S - 8 D a ta Bits , 1 S t o p Bit , N o Parity.
8250A Register Description
Internal Modem 3-69
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 231/605
Interrupts
Transmit Start
Data Bit
One interrupt line is provided to the system. This
interrupt is IRQ4 and is 'positive active. I The interrupt
enable register must be properly programmed to allow
interrupts.
Parity Stop
Bit Bit
Data Format
-
The data format is as follows:
DO D1 0 2 D3 D 4 D 5 D6 D7
~~~~~~ ~ ~
Transmitter Outpu t and Receiver Input Data Format
Data bit 0 is the first bit to be transmitted or receiyed.
The attachment automatically inserts the start bit, the
correct parity-bit if programmed to do so, and the stopbit.
Interfaces
8250A to Modem Interface
The following describes the 8250A to 103 modem
interface:
Signal Description
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 232/605
INS8250A OUT 1 The I inactive I state enables
entry into the transparent
mode using the UNLISTEN
command. The 'active' state
Idisables the transparent
mode.
-OUT 2
S O D
-RTS
-DTR
SIN
-RI
-CTS
N o connection.
Serial output from the 8250A.
-Request To Send
No connection.
-Data Terminal Ready
1. To accept a command,
-DTR must be Iactive. I
2 . If -DTR goes 'inactive ,the modem does a clean
disconnect sequence.
3. In auto-answer mode, the
modem does not go
off-hook, but RI on the
8250A will be toggled if
the ringing signal is
present.
Serial input to the 8250A.
The ring indicator pulses with
an incoming ring voltage.
-Clear To Send
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 233/605
-DSR
-RLSD
This line is wired active on
the modem adapter.
-Data Set Ready
This line is wired 'active on<themodem adapter.
-Received Line Signal Detect
When 'low I this line
indicates the data carrier has
been detected. If the carrier
drops out for longer than two
seconds, this line goes
'inactive and starts the
timeout timer.
-RESET, +=SET These lines are used to reset
or initialize the modem logic
upon power-up. These linesare synchronized to the falling
edge of the clock. Its
duration upon power up is
26.5 ms -RESET is active
low I . +=SET is active
high.
AO, I ,A2, 9
- M O D E M CSDISKETTE CS
Address bits 0 to 3 and bit 9.
These bits are used with
-MODEM CS to select a
register on the modem card.
This line is ' active for
addresses hex OF0 thru OFF
and 3F8 thru 3FF. It is gatedwith A9 in the 8250A to
exclusively decode hex 3F8
thru 3FF.
3-72 Internal Modem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 234/605
DO thru D7
-rOR
-1OW
BAUDCLK
Data bits 0 hru 7:
These eight lines form a bus
through which all data is
transferred. Bit 0 is the least
significant bit (LSB).
The content of the register
addresses by line A 0 thru A 2is gated onto lines DO thru D7
when this line is active ,
-MODEM CS is I active , and
A9 is Ihigh.'
The content of lines DO thru
S7 is stored in the register
addressed by A 0 thru A 2 at
the leading edge of this signal
when -MODEM CS is
I active ,and A9 is I high.
This is a 1.7895 MHz clock
signal used to drive the Baud
Rate Generator.
+MODEM INTR This line is connected to the
+IQFW4 on the 8259AInterrupt Controller.
-CARD INSTALL This line indicates to the
system BIOS that an IBM
PCjr Internal Modem is
installed in the feature
location.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 235/605
Telephone Company Interface
The telephone company interface is a 600 Ohm,
balanced, two-wire telephone-interface design that
meets the FCC Part 68 rules. A 2.13 meter (7 foot)
modular, elephone cord is included with the modemadapter.
Line-status detection of dial tone, ringback tone, busy,
and incoming ring is provided along with automated
routines which react to detected conditions.
The modem card has one USOC RJ11 jack.
System 1 / 0 Channel
The following shows pin assignments for the system
board modem connector. Pins AI to A15 are on the
component side.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 236/605
Telephone Cable/ onnector
uu
A 1
Ground ing Pin System Board Opposi te Side
Connector Connector
Internal Modem Connectors
Signal Name Pin Number
TelephoneCable
UNUSED 1
UNUSED 2
RING 3-
TIP 4
UNUSED 5
UNUSED 6
Connector Specifications (Part 1 of 2)
Modem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 237/605
Signal Name Internal Modem Signal Name
+5Vdc +- BO1 A01- 7
-MODEM CS/DISKElTE CS - 6
A9
-5
~
I
-RESET GND
GND 605 A05 C D 4
A2 f - 3
610 A10
GND
-CARD INSTALL
- 2
- ND- 1
C DO
-ODEM INTERRUPl
- ND
- AUDCLK
+XRESET +5 Vdc
+5 Vdc 615 A15 +12Vdc
1 levels are LSTLL compatible.
Con nector Specification s (Part 2 of 2)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 238/605
IBM PCjr Attachable Joystick
The Attachable Joystick is an input device intended to
provide the user with two-dimensional
positioning-control. Two pushbutton switches on the
joystick give the user additional input capability.
Hardware Description
Two modes of operation of the joystick are available.
In the “Spring Return” mode the control stick returns
to the center position when released. The “FreeFloating” mode allows smooth, force free operation
with the control stick remaining in position when
released. Selection of these modes can be made for
each axis independently. Two controls are provided for
individual adjustment to the electrical center of each
axis.
Functional Description
Positional information is derived from two
potentiometers Rx and Ry. The resistance of these
potentiometers will vary from 0 to lOOK ohms
nominally as the position of the control stick moves
from left to right (X-axis) and from top to bottom
(Y-axis). A linear taper is used on the potentiometers
so that a linear relationship exists between angular
displacement of the stick and the resulting resistance.
Electrical centering for each axis is accomplished with.
the controls by mechanically rotating the body of the
potentiometer. Adjustment in this manner has the
effect of varying the minimum and maximum resistance
relative to the extremes of the angular displacement.
The two pushbuttons provided on the joystick are
single-pole, single-throw, normally-open pushbuttons.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 239/605
The following are the logic diagram and specif ica tiomfor the tw o A ttachable Joystick connectors.
64-S10-0Switch 1 * a
0Switch 2
B 3 - S 2 0 41
Attachable Joystick Logic Diagr am
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 240/605
Attachable Joystick Connector
-Eoystick
X-AXIS RESISTANCE
SWITCH
SWITCH BO4
Signal Name Pin Number
Keyplug
A04 System
BO1 Board
LOGIC GND
Y-AXIS RESISTANCE
+5 vSHIELD GND
Connector Specifications
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 242/605
IBM Color Displayd
The IBM Color Display is a Red/Creen/Blue/Intensity(RGB1)-Direct-Drive display, that is independently
housed and powered.
Hardware Description
The IBM Color Display's signal cable is approximately
1.5 meters ( 5 feet) in length. This signal cable must be
attached to the IBM PCjr with the IBM PCjr Adapter
Cable for the IBM Color Display which provides a
direct-drive connection from the IBM PCjr
A second cable provides ac power to the display from a
standard wall outlet. The display has its own power
control and indicator. The displaywill accept either
120-volt 60-Hz power or 220-volt 50-Hz power. The
power supply in the display automatically switches tomatch the applied power.
The display has a 340 mm (13 in.) CRT. The CRT and
analog circuits are packaged in an enclosure so the
display may be placed separately from the system unit.
Front panel controls and indicators include: Power-On
control, Power-On indicator, Brightness and Contrast
controls. Two additional rear-panel controls are theVertical Hold and Vertical-Size controls.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 243/605
Operating Characteristics
Screen
High contrast (black) screen.Displays up to 16 colors.
Characters defined in an 8-high by 8-wide matrix.
Video Signal
Maximum video bandwidth of 14 MHz.Red, green, and blue video-signals, vertical sync,
horizontial sync, and intensity are all independent.
All input signals are TTL compatible.
Vertical Drive
Screen refreshed at 60 Hz with 200 vertical lines of
resolution.
Horizontal Drive
0 The horizontal drive frequency is 15.75 kHz.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 244/605
\
IBM Color
Display
\
Ground 1
Ground 2
Red 3
t lue . 5
Not Used 7
Horizontal Drive 8
I Vertical Drive 9
-- reen 4 9-Pin
-ntensity 6
Connector
A-
Color Direct-
Drive 9-Pin
D-Shell
Connector
Color- Display Connector
Connector Specifications
Color Display 3-83
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 246/605
IBM Connector for Television
The Connector for Television is a sealed Radio
Frequency (RF) Modulator that imposes the composite
video and audio signals onto the RF carrier-wavesupplied by the modulator. The connector unit has two
two-position switches. One switch selects between the
computer’s signal or the standard-TV signal from an
antenna as the input to the TV. The other switch
selects either channel 3’s or channel 4’s carrier-wave
frequency for input to the TV. This allows users to
select the weaker TV channel for their area reducing
the amount of interference with the computer’s input
signal. Signal input from the computer is provided by a
five-conductor cable with a six-pin IBM PCjr-dedicated
connector. Two spade-lug terminals provide for
TV-antenna-cable connection. One twin-lead flat-type
TV-cable provides input to the TV.
The following is the connector specifications for theIBM Connector for Television.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 247/605
Connector fo r TV Connector
System Unit
Connector
+12Volts Logic G N D
Audio
Video A 3 B 3 Shield GN D
Connector Specifications
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 248/605
IBM P C r 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-paircable, with a six-position RJ1 1-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 Ideactivate I the IR transmitter by
removing the power supplied by the keyboard's
batteries. The system unit's infra-red (IR) receivercircuit is 'disabled' 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.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 249/605
Keyboard Cord Connectors
Signa Name Pin Number-eyboard
-onnector Specifications
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 250/605
IBM PCjr Adapter Cable for SerialDevices
The Adapter Cable for Serial Devices is a 72 mm(3-inch) long, nine-conductor cablederminated with a
1&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 IBM PCjr.
The following figures show the connector specifications
for the Adapter Cable for Sehal Devices.
25-Pin D-Shell 1
Connector
Adapter Cable for Serial Devices
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 251/605
System
Connector Cable
a
25-Pin D-Shell
Connector
- 0- 4
- 2
- 8
- 6
- 5
-3
- 1
- 7
No t Used
DATA TERMINAL READYREQUEST TO SEND
TRANSMIT DATA
CARRIER DETECT
DATA SET READY
A 7 CLEAR TO SEND
A 8 RECEIVE DATA
SHIELD GN D
SIGNAL GNDB 3 - 08 No t Used
Connector Specifications
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 252/605
IBM PCjr Adapter Cable for Cassette
This option is an adapter cable that allows connection
of a cassette recorder to the IBM PCjr 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.
Adapter Cable for Cassette Connectors
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 253/605
EARPHONE
MIC REMOTE GND
REMOTE A 4 SHIELD
Aux. (Red)
Gnd
Connector Specifications (System End)
(Part 1 of 2)
A1
Iystem
Connector Pin
Iassette Connector
II [ Signal I 8 2 I
Signal
Ear (Black)
Signal
Gnd
Remote (Gray)
Connector Specif ications (Recorder End)
(Part 2 of 2)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 254/605
IBM PCjr Adapter Cable for the IBMColor Display
This adapter cable allows the IBM Color Display to beconnected to the IBM PCjr.
The following figures show the connector specifications
for the adapter cable for the IBM Color Display.
Color Direct-
Drive 9-Pin
D-Shell
Connector
Adapter Cable for IBM Color Display Connectors
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 255/605
A 1
A2 .A 3
A4
A 5
A 6
A 7
A8
A 9
6162
63 I
64
65
66
67
68 I
69
9-Pin Color
Display Connector
Not Used
Not UsedNot Used
Red
Green
Blue
Intensity
Not Used
Not Used
VerticalNot Used
Horizontal-
Not Used
Ground
Not Used
Not Used
Not Used
Ground
8
2
1
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 256/605
IBM PCjr Parallel Printer Attachment
The Parallel Printer Attachment is provided to attach
various 1/0 devices that accept eight bits of parallel
data at standard TTL-logic levels. The card measures76mm (3 inches) high by 244mm (9.6 inches) long.
The Parallel 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 IBM Personal Computer printer adapter.
The attachment card has 12 TTL buffer-output points
which are latched and can be written I and ‘read
under program control using the processor I IN I orI Out I instructions. The attachment card also has five
steady-state input-points that may be I read I using the
processors’ IN instructions.
In addition, one input can also be used to create a
processor interrupt. This interrupt can be Ienabled ’and I disabled I under program control. Reset I from
the power-on circuit is also ORed with a
program-output point allowing a device to receive a
power-on ‘reset when the processor is ‘reset.
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
’ activated I to I write I data to the printer. Theprogram can then I read I the input ports for printer
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 257/605
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 'read ' 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 1/0 Iread ' or write I with the proper
address selection, data may be Iwritten I to or Iread 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.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 258/605
25-Pin
Connector
A
J
Bus Buffer Data Latch
' 8r
wI CLK
t
c Enable
+
ceiver
8
h
ADRS
-XIO/-M-tRITE DATA
Command
Decoder
Reset
-Enable
Enable
REA D STATUS
P
Bus Control
Buffers Latch Drivers
1 LK
5 5t
-e C L R
J
4
&
Parallel Printer Interface Block Diagram
~
SLCT IN
STROBI
AUTO
FD XTINlT
E R R O R
SLCT
PE
ACK
BUSY
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 259/605
System Interface
The Parallel Printer Attachment reserves addresses hex
378, through hex 37F. IO/-M must also be 'active
high I when addressing the Parallel Printer Attachment.
A card selected signal (-CARD SLCTD) is provided to
the system 1/0 when the above addresses are used, and
the IO/-M bit is 'active high.
Specific commands are decoded from AO, Al, RD, and
WR er the following table. Input A2 is not used.
Addresses (hex) Operation Comments
378 IRead I Read Data Latch
379 IRead Read Status
37A IRead I Read Control
Latch
37B IRead Unused
37B IWrite I Write Data Latch
379 IWrite I Unused
37A IWrite Write Control
Latch
37B IWrite Unused
All data transfers take place over the 8-bit 1/0data-bus with timing provided by the 8088
microprocessor. (IOR, IOW, IO/-M)
An interrupt is provided to the system through the 1/0connector of the Parallel Printer Attachment. This
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 260/605
interrupt is I positive active I , Interrupt Level 7(+IRQ7). Bit 4 of the control latch must be 'written
high' o allow interrupts. When the -ACKnowledge
signal ( I low active ' signal goes Ihigh I ) the 1/0 device
causes a level 7 interrupt. See the following figure.
+ I R Q 7
-ACK Buffer
Control Bit 4-
+ IQ R 7 / - A C K Logic Diagram
Programming Considerations
The Parallel Printer Attachment can serve as a general
purpose peripherial driver. This section describes a
configuration which supports attachment to the IBMGraphics Printer.
Command Definition
For the parallel-printer application, the following bit
definitions apply.
Data Latch - Address hex 378
A 'write I to this address causes data to be latched onto
the printer data bits. 4 'read' from this address
presents the contents of the data latch to the processor.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 262/605
c
Bit
M S B 7
6
5
4
3
2T h r o u g h0 L S B
SignalName
-BUSY
-ACK
-PE
+ S L C T
- E R R O R
Descript ion
W he n this signal is at a low level,
the pr in ter is busy and cann o taccept data . I t can become lowdu rin g d at a entry, off- line print ing,head t ransla t ion, or er ror s ta te .
W h e n p o r t B is read, this bit willrepresent th e current s ta te of theprinter ACK signal. A low levelmeans t ha t a character has been
received an d the printer is ready toaccept ano the r . Normal ly , th issignal will be low fo r approx ima tely5 microseconds before B U S Y goesaway.
A low level indicates t h at th e printerhas detected a n end of for m ,
A high level indicates that theprinter is selected.
A low level indicates th at th e printerhas encounted a n e r ror condi tion .
Unused.
Printer Status
Printer Control - Address hex 3 7A
This port contains printer control signals. A 'write'
latches control bits to the printer; a ' read ' presents the
contents of the latches to the processor. See the
following timing diagram:
ParallelPrinter Attachment 3-101
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 263/605
c .
Parallel Interface Timing Diagram
II
i
The following figure describes the printer control
signals.
r
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 264/605
~
Bit
M S B 7
T h r o u g h5
4
3
2
1
L SB 0
SignalName
+ I N T E R R U P TE N A B L E
S L C T I N
I N I T
A U T O FD X T
S T R O B E
Descr pt on
Unused.
A high level in this bit positionwill a l low a n inte rrup t tooccur when -ACK goes high.
A low level in this bit positionselects th e printer.
A low level will initialize th eprinter (50 microsecondsminimum).
A low level will caus e th epr inter to l ine feed a ny t ime aline is printed.
A 5 microsecond (minimum)
low active pulse clocks da tainto the printer. Val id d at amust be present for 5microseconds (minimum)before an d a ft er t he ST R O B Epulse.
Printer Control Signal
The following are the connector specifications for the
IBM PCjr Parallel Printer Attachment.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 265/605
........................................................\ A B30??0 xpansion C o n n e c t 2 B1
‘Parallel Printer Attachment Connectors
Pin
2T h r o u g h9
10
121314
1516
17
18T h r o u g h25
25-Pin “D ”-Shell Connector
Signal
- S T R O B E
D A T A B IT C
T h r o u g hD A T A B IT 7
-ACK
B U S YP ESLCT
- A U T OF D X T
- E R R O R-1NIT
P R I N T E R
I N P U T- S E L E C T
G N D
I,, Max
14 m a
24 m a
74LS npu t
74LS n p u t74LS n p u t74LS n p u t14 m a
74LS n p u t14 m a
14 m a
N / A
I,, Max
-.6m a
-2.6m a
74LS n p u t
74LS n p u t74LS n p u t74LS n p u t.6m a
74LS n p u t.6m a
.6m a
N / A
Source
Attachment
At tachmentC a r d
C a r d
Printer
PrinterPrinterPrinterAt tachment
C a r dPrinterPrinter
At tachmentC a r d
Connector Specifications (Part 1 of 2)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 266/605
Parallel Printer
Attachment to 1/0
Signal Name Expa n sion Connector Signal Name
D1
D 2
0 4
GND
D 7
A0
A2
GND
A5
A6
A8
-DACKO
A1 1
A1 2
GND
A15
GND
A17
A19GND
-MEMR
-MEMW
ALE
GND
IO/-M
READY
-CARDSLCTD-GND
I R Q 7
AUDIO IN
B1
B5
B10
B15
B20
825
B30
A1
A5
A10
A15
A2 0
A25
A3 0
Connector Specifications (Part 2 of 2)
DO
+12 Vdc
D 3
0 5
D 6
+5 Vdc
A1
A3
A4
GND
A 7
A9
A10
DRQO
A13
A14
A16
GND
A18
- I O R
- lowG N D
HDLA
CLK
RESET
+5 Vdc
l R Q l
1rq2
Reserved
-HRQ
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 268/605
IBM Graphics Printer
The IBM 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. Itprints 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 IBM 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 M ethod : Serial-impact dot matrix
Print Spee d: 80 CPS
Print Direction: Bidirectional with logic seeking
Number of Pins in Head: 9
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 269/605
Line Spacing: 1/16 inch (4.23 mm) or programmable
M atrix Characteristics: 9 by 9
Character Se t: Full 96-character ASCII with
descenders plus 9 international characters/symbols
Graphic Characters: See “Additional Printer
Specifications”
Printing Sizes:
Normal
Double Width
Compressed
10 characters-per-inch with amaximum of 80 characters-per-line
5 characters-per-inch with a
maximum of 40 characters per line
16.5 characters-per-inch with a
maximum of 132 characters per line
Double Width-Compressed
8.25 characters-per-inch with amaximum of 66 characters per line
maximum of 80 characters per line
maximum of 80 characters per line
Subscript 10characters-per-inch with a
Superscript 10characters-per-inch with a
M edia Handling: Adjustable sprocket-pin-feed with
4-inch (101.6 mm) to 10-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 lifeexpectancy of 3 million characters
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 270/605
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 maximumwith 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 S et
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 containmath and extra symbols.
The differences in Set 2 are
ASCII numbers 3,4,5,6, and 21.
ASCII numbers 128 to 175
contain European characters.
Set 2
Graphics There are 20 block characters and
programmable graphics.
Printers 3-109
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 271/605
DIP Switch Settings
There are two Dual-Inline-Package (DIP) switches onthe control circuit-board. In order to satisfy the user’sspecific requirements, desired control m odes are
selected by the DIP switches. The functions of theseswitches and their preset conditions at the time of
shipment are shown in the follow ing figures.
DIP Switch 2 DIP Switch 1
Location of DIP Switches
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 272/605
Number Function On
Buffer Fu ll Prin t nly
1-4 Cancel C od e Invalid
1-5 Not Applicable
1-7 Charac ter Se t 2
1-8 SLCT IN Signal FixedInternally
Switch I I FactoryPositionf
I1-1
INot Applicable -
Pr in t andLine Feed
O n
P r in t a n dLine Feed
Off
Valid OffI II
O n
N o S o u n d O n-6 I E rro r Buzzer I S o u n d
Set I Off
IG e n e r a t o r
Not FixedInternally
On
Functions and Conditions of DIP Switch 1
FactoryPosition
SwitchNumber
2- 1
0 function
F o r m L e ng th
Line Spacing
~~
12 Inches 1 1 Inches Off
2-2 1 / 8 I n c h 1 / 6 In ch 0 f
2-3 A u t o F ee d X TSignal Fixed[nternally Not FixedInternally Off
Valid Invalid Off-4 1 Inch S k ip OverPer fora t ion
Functions and Conditions o f DIP Switch 2
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 273/605
Parallel Interface Description
Specifications
Data Transfer Rate 1000 cycles-per-second
Synchronization By externally-supplied
Signal ExchangeLogic level
(cps)-( maximum)
STROBE pulses
-ACKNLG or BUSY signals
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.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 274/605
4
II
-strobe STROBE pulse to read data in. Pulse
width must be more than 0.5 ps at the
receiving terminal. The signal is
normally Ihigh I ;however read-in of
data is performed at the I Low level
of this signal.
These signals are the first to eight bits
a€ arallel data. Each signal is at a
'high level when data is a logical 1and I low ' when data is a logical 0.
Approximately 0.5 ys pulse (low)indicates that data has been received
and the printer is ready to accept data.
A 'high' signal indicates that theprinter cannot receive data. The
signal is I high ' in the following cases:
During data entry
Data 1-8
-ACKNLG
BUSY
.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 275/605
PE
SLCT
Auto Feed XT
INT
Error
-SLCTIN
During printing operation
In the “off-line” state
0 During printer-error status
A ‘high’ signal indicates that the
printer is out of paper.This signal indicates that the printer is
in the selected state.
When this signal is I low I paper is fed
one line after printing. This signal
level can be fixed low I by DIP
switch pin 2-3.
When this signal is I low I the printercontroller is reset to its initial state
and the print buffer is cleared. This
signal is normally I high and its pulse
width must be more than 50 ps at the
receiving terminal.
This signal is I low I when the printer
is in the “Paper End,” “Off Line,”
and “Error” state.
Data entry to the printer is possible
only when this signal is ’low I . This
signal can be fixed low I 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 ps.
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 orwhen the BUSY signal is low I .
The following figure shows the pin assignment and
direction of each signal.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 276/605
Signal
- S T R O B E
D A T A 1D A T A 2D A T A 3D A T A 4D A T A 5D A T A 6D A T A 7D A T A 8
- A C K N L GBUSYPES L C TA U T O F E E D XT
N Co vC H A S S IS G N D
N CG N DI N TE R R O RG N DN C
- SL C T I N
SignalPin #
1
2345
678
9
1011121314151617
18
313233343536
19-30
ReturnPin # Direction
I n
I nI nI n
I nI nI n
I n
I n
o u to u to u to u t
I n
-
-
-
I no u t-
-
-
I n
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.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 277/605
1 Printer M odes
N o r m a l
CompressedEmphas izedD o u b l e S t r ik eSubsc r ip tSuperscr ip tD o u b l e W i d t hUnder l ine
-
X
X
XX-
-
X
X
XX-
x
x x
X
X
XX-
X
XXX-
XX
XX-
X
X
XX-
X
XXX-
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 printercodes 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 canbe 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 FunctionNUL Null:
Used with ESC B a n d ESC D as a list
terminator. NUL is also used with
other printer.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 278/605
BEL
HT
LF
P
control codes to select options (for example, ESC S).Example:
LPRINT CHR$ (0);
Bell:
Sounds the printer buzzer for 1 second.
Example:LPRINT CHR$(7);
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);
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);
Form Feed:Advances the paper to the top of the next page.
CR
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);
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.)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 279/605
so
SI
DC2
DC4
CAN
ESC
ESC -
Note: IBM Personal Computer BASIC adds a Lin
Feed unless 128 is added [for example
CHR$(141)].
ExampleLPRINT CHR$( 13);
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);
Shift In (Compressed):
Changes the printer to the Compressed-Character
print-mode. Example:
LPFUNT CHR$(15) ;
Device Control 1 (Compressed Off):
Stops printing in the Compressed print-mode.
Example
LPRINT CHR$(18);
Device Control 4 (Double Width
Off):
Stops printing in the Double-Width print-mode.
Example:
LPRINT CHR$(20);Cancel:
Clears the printer buffer. Control codes,
except SO, remain in effect.
Example:
LPRINT CHR$ (24);
Escape:
Lets the printer know that the next data sentis a printer command.
Example:
LPRINT CHR$(27);
Escape Minus (Underline)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 280/605
ESC 0
ESC 1
ESC 2
ESC 3
ESC 6
ESC 7
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);
Escape Zero (1 8-Inch Line Feeding)
Changes paper feeding to 1 %inch.
Example:
LPRINT CHR$(27);CHR$(48);
Escape One (7/72-Inch Line
Feeding)
Changes paper feeding to 7/72-inch.Example:
LPRINT CHR$( 27);CHR$(49);
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);
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 (1/4)-inch. The value of n must be
between 1 and 255.
Example:
LPRINT CHR$ (27);CHR$( 5 1);CHR$( 54);
Escape Six (Select Character Set 2)
Selects Character Set 2. (See “Printer
Character set 2”)
Example:
LPRINT CHR$ (27); CHR$ (54);Escape Seven (Select Character Set 1)
Printers 3-119
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 281/605
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);
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$ 5 6 ) ;
Escape Nine (Cancel Ignore PaperEnd)
Cancels the Ignore Paper End command. ESC 9
is selected when the printer is powered on or
reset.
Example
LPRINT CHR$( 27);CHR$(57);
Escape Less Than (Home Head)
The printer head returns to the leftmargin to print the line following ESC <.This occurs for one line only.
Example:
LPRINT CHR$(27);CHR$(60);
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 ESC2 prints with new line-feed
increments of 24/72-inch. Any increment
between 1/72 and 85/72-inch may be used.
ESC 8
ESC 9
ESC <
ESC A
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 282/605
Example:LPRINT
CHR$( 27);CHR$( 65);CHR$(24);
CHR$(27);CHR$(SO);
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);
ESC C
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 22for m.
Example:
LPRINT CHR$(27);CHR$(67);CHR$(O);CHR$(2);
Escape D (Sets Horizontal Tab Stops)
Format: ESC D;nl;n2;...I&; NUL;
Sets the horizontal-tab stop-positions. The
example that follows shows the horizontal-tabstop-positions set at printer column
positions of 10, 20, and 40. They are
followed by CHR$(O), the NUL ode. 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:
ESC D
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 283/605
ESC E
ESC F
ESC G
ESC H
ESC J
ESC K
LPRINT
CHR$ (27);CHR$ (68) ;CHR$( 10)
;CHR$(20);CHR$ (40);
CHR$(O);
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);
Escape F (Emphasized Off)
Stops printing in the Emphasized-print mode.
Example:LPRINT CHR$ (27);CHR$ (70) ;
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:
LPRINT CHR$ (27);CHR$ (7 1 ;
Escape H (Double Strike Off)
Stops printing in the Double-Strike mode.
Example:
LPRINT CHR$(27);CHR$(72);
Escape J (Sets Variable Line Feeding)
Format: ESC J;n;
When ESC J is sent to the printer, the paperfeeds 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/2 16-inch. ESC J is canceled after the
line feed takes place.
Example:
LPRINT CHR$ (27);CHR$(74);CHR$(50);
Escape K (480 Bit-Image Graphics
Mode)
Format ESC K;nl ;n2;vl;v2;...vk;
Changes from the Text mode to the Bit-Image
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 284/605
Graphics mode. n l and n2 are one byte, which
specify the number of bit-image data bytes to
be transferred. vl through vk are the bytes
of the bit-image data. The number of
bit-image data bytes (k) is equal to n l
+256n2 and cannot exceed 480 bytes. At everyhorizontal 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 n l and n2 as follows:
n l represents values from 0 - 255.
n2 represents values from 0 - 1 x 256.
MSB is most-significant bit and LSB is least
-significant bit.
The following figures show the format.
IMSB LSB I
MSB LSB
Data sent to the printer.
Text (20characters) ESC K n=360 Bit-image data Next data
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 285/605
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.
“1 “2 “ 1 “2
Data C I ESC [ K I n l n21 Data D
Bit-
ILength of
I:{ ;e
:;;; I l.-.x;;th of
1image
data
ESC K 1 nl I n2 I Data B2
480 bit- image dot positionsk;:;data
w
Example: 1 ’OPEN PRINTER IN RANDOM MODE
WITH LENGTH OF 2552 OPEN “LPT1:”AS #1
3 WIDTH “LPT1:”,255
4 PRINT # l CHR$( 13)+CHR$( 10);
5 SLASH$=CHR$(1 +CHR$ (02)
+CHR$(04)+CHR$(08)
6 SLASH$=SLASH$+CHR$(16)+CHR$ (32)
+CHR&(64)+$CHR$( 128)+CHR$(O)
7 GAP$= CHR$(0)+CHR$(O)+CHR$(O)
8 NDOTS=480
9 ’ESC K N1 N2
10 PRINT #11,CHR$(27);“K”;CHR$(NDOTS
MOD 256); CHR$ (FIX(NDOTS/256));
11 ’SEND NDOTS NUMBER OF BIT
IMAGE BYTES
12 FOR I= 1 TO NDOTS/ 12 ’NUMBEROF SLASHES TO
PRINT USING GRAPHICS
13 PRINT #l,SLASH$;GAP$;
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 286/605
14 NEXT I15 CLOSE
16 END
This example gives you a row of slashes
printed in the Bit-Image mode.
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. n l is in the
range of 0 to 255.
Escape N (Set Skip Perforation)
Format ESC N;n;
Sets the Skip Perforation function. The
number following ESC N sets the value for thenumber 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);
Escape 0 (Cancel Skip Perforation)
Cancels the Skip Perforation function.
Example:
LPRINT CHR$( 27);CHR$( 79);
ESC S Escape S (Subscript/Superscript)
Format: ESC S;n;
Changes the printer to the Subscript printmode when ESC S is followed by a 1, as in the
example that follows. When ESC S is followed
by a 0 (zero), the printer prints in the
ESC L Escape L (960-Bit-Image
ESC N
ESC
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 287/605
ESC T
ESC U
ESC W
ESC Y
ESC Z
Superscript print mode.
Example:
LPRINT CHR$ (27) ;CHR$( 83);CHR$(1);
Escape T (Subscript/Superscript Off)
The printer stops printing in the Subscript
or Superscript print mode.
Example:
LPRINT CHR$(27);CHR$(84);
Escape U (Unidirectional Printing)
Format: ESC U;n;
The printer prints from left to right
following the input of ESC U; 1. When ESC U
is followed by a 0 (zero), the left to rightprinting 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);
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
0 (zero).
Example:
LPRINT CHR$( 27);CHR$( 87);CHR$(1);
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 dotposition. The input of data is similar to
ESC L.
Escape Z (1920 Bit-Image Graphics
Mode)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 288/605
Format: ESC 2; nl ;n2;vl v2; ..vk;Changes from the Text mode to the 1920
Bit-Image Graphics mode. The input issimilar to the other Bit-Image G raphicsmodes. ESC Z can print only every third dot
position.
Printers 3-127
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 289/605
D C 4
30 31 32
sp
Printer Character Set 1 (Part 1 of 2)
1
CAN ESC
33 34 35 36 37 38 39
I f # $ % &
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 290/605
CAN ESC
160 161 162 163 164 165 166 167 168 1 6 9 .
a i o u i i K i a o ~ ~-
230
240
-
231 232 233 234 235 236 237 238 239
P T ~ e n s m t n241 242 243 244 245 246 247 248 249
= * > (
Printer Character Set 1 (Part 2 of 2)
- J ~ ~ . S P
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 291/605
0 1 2 3 J 3 t > i i ,r 3
N U L v + + 4 B E L H T
10 1 1 1 2 13 1.1 1 ' 1 ' I 1 1 1 H 1 ' )
I F FF C R SO SI D C 2
2 0 2 1 2 2 7 3 ?J 75 26 ? i ? H 7 : )
D C 4 $ CAN E S C
30 31 32 3 3 34 35 Jb 3 1 38 3 )
s p # % & I
o + ,. / 0 1
2 3 4 5 6 7 8 9 : . ;
< = > ? @ A B C D E
F G H I J K L M N O
P Q R S T U V W X Y
a b c
d e f g h i j k l m
n o p q r s t u v w
c u
40 4 ' 4 2 4 3 4 4 45 ~ .r9
50 5 52 53 51 55 i t , i i 58 5q
GO 61 6 63 64 65 66 67 b8 69
7 o r i 1 2 13 14 75 7b 7 7 78 19
8 H I 8? 8 3 84 85 86 87 88 89
[IO 'I I ( I ? '1.3 9'1 5 96 97 98 99
A
Z C \ I -
10 0 101 1'1.) 1 ' ) i 1 l J . 1 lo > 106 1 0 1 108 1 O c )
; 1 1 I l l 1 1 ) l l i 1 1 . 1 1 1 ' ) 1 1 j J 1 1 1 118 1 1 1
1 . 1 . ' : I , . 1 , ) i I . : 1 ) ' ) I . J l l I . , ] l . H
..X Y Z { I }
Printer Character S e t 2 Part 1 of 2)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 292/605
2 3 0
2 4 0
-
2 5 0
Printer Character Set 2 (Part 2 of 2)
2 3 1 2 3 7 2 3 3 2 3 4 2 3 5 2 3 6 7 3 7 2 3 8 2 3 9
Q W I ~ W ~
2 41 2 4 2 2 4 3 2 4 4 2 4 5 2 4 6 2 4 7 2 4 8 2 4 3
= + > ( J j , o m?51 1 5 2 2 5 3 2 5 4 2 5 5
- J n 2 m s ~
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 294/605
IBM PC Compact Printer
The PC Compact Printer is a stand-alone, tabletop unit
that plugs into 3 standard wall outlet. Using an
eight-wire print head, the printer can print characters
from the standard ASCII, 96-character, uppercase andlowercase 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, 68characters-per-line. The PC Compact Printer can also
underline characters, has an extended character-set for
international languages, 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.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 295/605
P17
P30-3 '
P10-1:
P l t
M PUHD6801v 5
P46
P41
P40-44
P23
P15
++--
-I-
VOLTAGEREG. ANDSAFETYLOGIC
THERMAL
HEAD DRIVERULN2803A
LAM P/MOTORDRIVERULN2013
PULSEMOTOR 1I
lFEY
FROM HOMEPOSITION SWITCH
I
X-TAL
.91 MHz
ADDRESS
SN74LS3732KBSTATICIAMHM6116
HIGH ORDER ADDRESS
DRIVER/RECEIVER
__b CTS
A
+12u -12v
3-134 Printers
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 297/605
.Print Modes:
Standard
Double Width
Compressed
CompressedDouble Width
Paper Feed:
Paper Width:
Copies:
Paper Path:
System Interface:
Print Color:
Characters Maximumper Inch Characters
per Line
10 80
5 40
17.5 136
8.75 68
Friction F eed
216 mm (8 .5 in)
Single sheet on ly
TOP
Serial Data and Control Lines
Black on ly
3-136 Printers
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 299/605
Character Set: ASCII numbers 0 to 31 containcontrol codes and specialcharacters. ASCII numbers 32 to
127 contain the standard printablecharacters. ASCII numbers 128 to
175 conta in E uropean characters.ASCII numbers 224 to 255
contain math and extra symb ols.
3-638 Printers
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 300/605
Serial Interface Description
Received
Data
Specifications
TWO
Stop
_ _ _ _ _ _ _ _ _ _ _ _ _ Bits
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.
Character Period
_____c(
High (Ready)
R D Y
Serial Interface Timing Diagram
I CTSLow (Busy)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 301/605
Print Mode Combinations for the P C CompactPrinter
The following figure shows the print-mode
combinations possible with the PC Compact Printer.
Modes shown in the same column can be combined. Aprint mode can be changed at any time within a line:
however, the double-width mode effects the entire line.
Standard
Compressed
Double-Width
Underline
ModesIxxx
xxx
xxx
xxx
xxx
xxx
xxx
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 B A S I C 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.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 302/605
COD E PRINTER FUNCT ION
CAN CancelClears the printer buffer. Control codes,
except SO, remain in effect. Reinitializes
the printer to the power on defaults.
LPRINT CH R$(24);
CR Carriage ReturnEnds 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: IBM 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 C HR$(18);
DC4 Device Control 4 (Double Width Off)
Stops printing in the Double Width mode.
LPRINT CH R$(20);
ESC EscapeInforms the printer that the following data
is a printer command. (See the followingESC commands.)
LPRINT CH R$(27);
Printers 3-141
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 303/605
ESC B Escape B (S et 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 N U L 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 N U L
cancels tab stops. The form length must beset by the ESC C command prior to setting
tabs.
LPRINT
CHR$( 7);CHR$(66);CHR$( O);CHR$( 0);CHR$(40);CHR$(O);
ESC C Escape C (S et 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 304/605
ESC D 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), theNUL ode. 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$( 1O)CHR$(20)CHR$(4O);CHR$(0);
ESC K Escape K (480 Bit-Image Graphics Mode)
Format: ESC K;nl;n2; v l ; v2;.....vk;
Changes the printer to the Bit-Image
Graphics mode. Dot density is 82.5 by 82 .5dots 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 n l and n2 specify, in binary
form, the number of bit image data bytes to
be transferred. Assign values to n l 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)).
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 305/605
The bit-image data bytes are vl 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 leastsignificant bit LSB) represents the bottom
dot position, and the most significant bit
(MSB) represents the top dot position. For
example, if VX s hex 80, the top dot will
print only in that vertical position; if VX s
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 - - - 30 - - - 2
Bottom 0 - - -
ESC N EscapeN (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 length (ESC C) is
changed. The default for skip perforation is25.4 mm (1 inch).
LPRINT CHR$(27);CHR$(78);CHR$( 2);
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 306/605
ESC 0
ESC R
ESC W
ESC 0
ESC 1
ESC 2
ESC 5
Escape 0 (Cancel Skip Perforation)Cancels the Skip Perforation function.
LPRINT CHR$(27);CHR$(79);
Escape R (Clear Tabs)
Resets all tab stops,both horizontal and
'vertical to the powered-on defaults.
L P W HR$(27);CHR$(82);
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 canceledwhen ESC W is followed by 0 (zero).
LPRINT CHR$(27);CHR$(87);CHR$( 1);
Escape Zero (1/9-Inch Line Feed)
Changes the line feed to 2.82 mm (1/9
inch).
LPRINT CHR$(27);CHR$(48);
Escape One (1 9-inch Line Feed)
Changes the line feed to 2.82 mm (1/9
inch). ESC 1 functions the same as ESC 0.
LPRINT CHR$( 27);CHR$( 49);
EscapeTwo (Start
Variable Line Feeding)
Resets line spacing to 4.23 mm (1/6 inch).
This is the powered-on default for vertical
line spacing.
LPRINT CHR$( 2 7);CHR$(50 ) ;
Escape Five (Sets Automatic Line Feed)
With automatic line feed on, when a CR
code is received, a line feed automatically
follows after the camage return. ESC 5 (1)
sets auto line feed; ESC 5 (0) resets it.
LPRINT CHR$(27);CHR$(53);
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 307/605
E S C - EscapeMinus (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); [orCHR$(O);I
ESC < Escape Less Than (HomeHead)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 FeedAdvances 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 tochange the page length. Always separate
multiple Form Feed commands with spaces.
LPRINT CHR ( 2);
HT Horizontal TabTabs 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 FeedAdvances the paper one line. Line spacing
is 4.23 mm (1/6 inch) unless reset by ESC0, ESC 1 , ESC 2.
LPRINT CH R$(10);
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 308/605
NUL
SI
so
VT
Null
Used with ESC B and ESC D as terminator
for the tab set and clear commands.
LPR INT CHR$(O);
Shift In (Compressed On)
Changes the printer to the CompressedCharacter mode. This command is canceled
by a DC2 code (Compressed Off).
LPRINT CHR $(15);
Shift Out (Double Width)Changes the printer to the Double Width
mode. Note: A Camage Return, Line Feedor DC4 code cancels Double Width mode.
LPRINT CHR $(14);
Vertical TabSpaces the paper to the next vertical tab
position. VT re set by the ESC B
sequence. The VT command is the same as
the LF command, if no tabs are set. Thepaper is advanced one line after printing or
advanced to the next vertical tab stop.
LPRINT CHR$(11);
The following charts list the printer control codes
and characters in ASCII decimal numeric order, (for
example, N U L is 0 and ESC W is 87).
Printers 3-147
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 309/605
Character Set (Part 1 of 2)
3-148 Printers
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 311/605
16 Pin Connector
Transmit Data\
Compact
Printer
Request To Send A03
A04
Carrier Detect A05
Data Set Ready A06
Not Used 603
Ground 604
Not Used 605
Not Used 606
Ground 607
Not Used 608
Data Terminal Ready Looped in Cable to Data Set Ready
Request to Send Looped in Cable to Carrier Detect
Connector Specifications
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 312/605
SECTION 4.COMPATIBILITYW I TH TH E IBM PERSONALCOMPUTER FAMILY
Contents
Compatibility Overview ..................... 4-3
Timing Dependencies ....................... 4-5
Unequal C on fi ia tio n s ..................... 4-7
Hardware Differences ...................... 4-9
User Read/Write Memory . . . . . . . . . . . . . . 4-12
Diskette Capacity/Operation . . . . . . . . . . . . 4-13 IBM PCjr Cordless Keyboard . . . . . . . . . . . 4-14
Black and White Monochrome Display . . . . . 4-18
RS232 Serial Port and IBM PCjr InternalModem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18
Summary ............................... 4-19
Color Graphics Capability . . . . . . . . . . . . . . . 4-15
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 314/605
Compatibility Overview
The IBM PCjr is a different Computer than the IBM
Personal Computer and IBM Personal Computer XT.
Even though it is different, the IBM PCjr has a high
level of programming compatibility with the IBM
Personal Computers. It is possible to create PCjr
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 IBM 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 wouldhave to be re-written entirely in the language of the
other processor. Since the IBM PCjr and the other
IBM Personal Computers use exactly the same
microprocessors (Intel 8088), most assembler language
programs need not be modified.
This alone is not enough, since applications normallytake advantage of a computers device services (BIOS)
and operating system (IBM DOS 2.1). In order to
allow for maximum program compatibility, the IBM
PCjr has maintained all BIOS system interrupts and
utilizes the same IBM DOS. This means that
applications which use the BIOS and the IBM DOS
interrupts on the IBM Personal Computers operate the
same on the IBM PCjr.
Note: The BIO S micro-code of the IBM PCjr is notidentical to that of the IBM Personal Computers. Ifan application bypasses the BIO S interrupt calls and
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 315/605
directly accesses routines and/or storage locations inone system, it may not run in the other system. Som eroutines may be similar and some BIOS storagelocations may be the same. It is stronglyrecommended that applications use only the BIOS andDOS interrupt interfaces in order to achievecompatibility 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:
0 Timing Dependencies
0 Unequal Configurations
Hardware Differences
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 316/605
Co,mpatibility Overview
The IBM PCjr is a different Computer than the IBM
Personal Computer and IBM Personal Computer XT.
Even though it is different, the IBM PCjr has a high
level of programming compatibility with the IBM
Personal Computers. It is possible to create PCjr
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 IBM 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 wouldhave to be re-written entirely in the language of the
other processor. Since the IBM PCjr and the other
IBM Personal Computers use exactly the same
microprocessors (Intel 8088) , most assembler language
programs need not be modified.
This alone is not enough, since applications normallytake advantage of a computers device services (BIOS)
and operating system (IBM DOS 2.1). In order to
allow for maximum program compatibility, the IBM
PCjr has maintained all BIOS system interrupts and
utilizes the same IBM DOS. This means that
applications which use the BIOS and the IBM DOS
interrupts on the IBM Personal Computers operate the
same on the IBM PCjr.
Note: The BIO S micro-code of the IBM PCjr is notidentical to that of the IBM Personal Computers. Ifan application bypasses the BIO S interrupt calls and
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 317/605
directly accesses routines and/or storage locations inone system, it may not run in the other system. Som eroutines may be similar and some BIOS storagelocations may be the same. It is stronglyrecommended that applications use only the BIOS andDOS interrupt interfaces in order to achievecompatibility 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 318/605
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 may or may not
cause a difference depending upon the application.
Most applications are very 1/0 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 oftime.
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 mayneed to be modified.
Note: It is strongly recommended not to depend on
instruction execution speed to 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 1/0 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 1/0 device as a dependency for the
application.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 322/605
Hardware Differences
To be able to run on either computer without change,
an application utilizing a specific 1/0 device must have
access to identical devices (or devices with identical
operating characteristics and interfaces). The IBM
PCjr and the IBM Personal Computers have very
compatible 1/0 device capabilities.
The following table lists the hardware features and 1/0
devices supported by the IBM PCjr and the IBM
Personal Computers and summarizes the differences:
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 323/605
Device
M a x i m u mUser Memory
CordlessKey board
83 KeyKeyboard
Disket teDrive
H ard Di skFile
ParallelPr in ter
RS 232Ser ia l Po r t
G a m eC o n t r o l
Cassette
Internal
M o d e m
I B MM o n o c h r o m eDisplay
C o l o r
Graph ic s andDisplay
Light Pen
PC
640KB
N o
Yes
Yes
N o
Yes
Yes
Yes
Yes
N o
Yes
Yes
Yes
640KB
N o
Yes
Yes
Yes
Yes
Yes
Yes
N O
N o
Yes
Yes
Yes
PCjr
128KB
Yes
N o
Yes
N o
Yes
Yes
Yes
Yes
Yes
N o
Yes
Yes
PCjr Comments
Sha res use r R A Mwith Video Buffer
Sca n codescom pat ib le an d fu ll83 key capability
Compat ib le , butHa rdw are in terfacedifferences
Compat ib le , butdifferent address and
n o D M A s up p or t
Compat ib le
Compat ib le , hex 2F8
address, Interrupt
Level 3 , Baud-Rate-Frequency divisordifference
C om pa ib 1e inter facewith potential t imingdifferences
Compat ib le
C o m p a ti bl e t o P C
Serial Po r t hex 3F8address, InterruptLevel 4, frequencydivisor difference
Compat ib le , with
som e registerdifferences a n denchancements
Compat ib le
PCjr and Personal Computers Comparison (Part 1 o f 2)
4-10 Hardware Differences
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 324/605
Device
AttachableJoyst ick
8253 Tim er( t ime of day)
8259 Interrupt
InternalS o u n d
TI 76496
S o u n dR O MC a r tridgeInterface
F u t u r e 1 / 0
R O MArchitecture
P C
Yes
Yes
Yes
Yes
N o
N o
Yes
PCXT
Yes
Yes
Yes
Yes
N o
N o
Yes
PCjr
Yes
Yes
Yes
Yes
Yes
Yes
Yes
P Cjr Com men s
C o m p a t i b l e
C o m p a t i b l e
S o m e difference ininterrupt levels
Compatible but lessfrequency response
C o m p a t i b l e
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 maintainsan 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 BIOSlevel and directly addresses the hardware, then there
could be an incompatibility.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 325/605
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 80K 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, theneven 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 IBMPersonal Computer Cassette BASIC resides entirely in
the system ROM; taking no user memory. However,
Disk BASIC or Advanced BASIC utilizes
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 326/605
approximately 1OK 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 availablememory 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 amuch larger disk storage capacity. This capacity
difference may or 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 pPD765
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-1 3
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 327/605
cannot overlap diskette 1/0 operations. When diskette
1/0 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 whilediskette 1/0 is active.
Shift screen t o th e lef tShif t screen t o the r ightAud io Feedback (Sys temclicks when a key is pressed.Cu s tom er D iagnos tics
IBM PCjr Cordless Keyboard
Alt + Ct r l + cu rso r leftAlt + Ct r l + curso r r ightAlt + Ct r l + Cap s Lock
Alt + Ct r l + I n s
The Cordless Keyboard is unique to the IBM PCjr.
Even though it does not possess all 83 keys of the IBM
Personal Computers’ keyboards, it does have thecapability to generate all of the scan codes of the
83-key keyboard.
The following shows the additional functions available
on the PCjr.
PCjr Special Functions I Required Key Combinations 1
PCjr Special Functions
For more detail see “Keyboard Encoding and Usage” in
Section 5 .
Since all scan codes can be generated, any specialapplication requirements can be met on the Cordless
Keyboard.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 328/605
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 IBMPersonal 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 330/605
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 1D) and maintains all video calls
(through Interrupt hex 10). Application can still
specify video parameter overrides by modifying
Interrupt hex 1D 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.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 331/605
Black and White Monochrome Display
The IBM PCjr does not support the IBM Personal
Computers black and white monochrome display.
Programs which directly address the IBM PersonalComputers monochrome display are not compatible.
For example, any direct addressing of the B&W video
buffer at hex B8000 is not redirected by the IBM 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 P C j r InternalModem
The IBM PCjr serial port address is hex 2F8 and is
associated with hardware Interrupt level 3. This is
compatible with a second AsynchronousCommunications Adapter on the IBM 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 IBM Personal
Computers. It is important to note that when the IBM
PCjr has the Internal Modem installed it is logicallyCOMl 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. Other
hardware differences on the PCjr serial devices are:
A different frequency divisor is needed to generatebaud rate. This is transparent to applications using
BIOS to initialize the devices (Interrupt Hex 14).No ring indicate capability on the RS232 serial port.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 332/605
Asynchronous communications input cannot be
overlapped with IBM PCjr diskette I/O. Since
diskette 1/0 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 whilereceiving 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 IBM PCjr is a member of the IBM
Personal Computer family by way of its strong
architecture compatibility. The highest degree of
application compatibility can be achieved by using acommon 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
hex FFhex FEhexFD
= the IBM Personal Computer
= the IBM Personal Computer XT
= the IBM PCjr
Once determined, dual paths would handle any
differences.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 334/605
SECTION 5.SYSTEM BIOS USAGE
Contents
R O M B I O S ............................. 5-3
BIOSUsage ............................. 5-5
Vectors with Special Meanings . . . . . . . . . . . . 5-8
Interrupt Hex 1B. eyboard Break Address 5-8 Interrupt Hex 1C . imer Tick . . . . . . . . . 5-8 Interrupt Hex 1D. ideo Parameters . . . . 5-9
Interrupt Hex 1E. iskette Parameters . . 5-9Interrupt Hex 1F and hex 44 . raphics
Character Pointers . . . . . . . . . . . . . . . . . . . 5-9
Interrupt Hex 48 . ordless 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
ROM-Modules . . . . . . . . . . . . . . . . . . . . . . . 5-18 Adapter Cards with System-Accessible
Keyboard Encoding and Usage ............... 5-21
Character Codes . . . . . . . . . . . . . . . . . . . 5-26
Extended Codes .................... 5-30
Cordless Keyboard Encoding 5-21
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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 335/605
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 5 5 ) . . . . . 5-36 Other Characteristics . . . . . . . . . . . . . . . . 5-36
Non-K eyboard Scan-code Architecture . . . . 5-42
BIOS Cassette Logic ...................... 5-47Software Algorithms.nterrupt Hex 15 . . . . 5 4 7
Cassette Write . . . . . . . . . . . . . . . . . . . . . . . . 5-48 Cassette Read . . . . . . . . . . . . . . . . . . . . . . . . 5 4 9 Data Record Architecture . . . . . . . . . . . . . . . 5-50 Error Detection . . . . . . . . . . . . . . . . . . . . . . . 5-51
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 336/605
The basic input/output system (BIOS) resides in ROM
on the system board and provides device-level control
for the major 1/0 devices in the system. AdditionalROM 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-sizedetermination, 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, yetretaining 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.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 338/605
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 ComputerBIOS 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,
INThex 12
invokes the BIOS routine for determining memory size
and returns the value to the caller.
AU 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 thereturn. For the memory size example, no parameters
are passed. The memory size, in 1K byte increments, is
returned in the Ax egister.
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-ofday, thefollowing code is required:
MOV AH,1
MOV CX,HIGH-COUNT ;establish the current
MOV DX,LOW-COUNT
INT 1AH ;set the time.
;function is to set time-of-day.
To read time-of-day:
MOV A H O ;function is to read time of day.
INT 1AH ;read the timer.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 339/605
Generally, the BIOS routines save all registers exceptfor AX and the flags. Other registers are modified onreturn, only if they are returning a value to the caller.The exact register usage can be seen in the prologue of
each BIOS function.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 340/605
0-3
4-78-BC-F
10-1314-17
18-IB
ID-IF
20-23
24-2728-2B2C-2F30-3334-3738-3B
3C-3F
40-4344-4748-4B
4C-4F
50-5 354-57
58-5B
5C-5F60-6364-6768-6B6C-6F70-7374-77
78-7B
7C-7F
InterruplNumber
0
12
345
67
8
9ABCDE
F
1011
12
1314
15
16
1718191A1B1cID
1E
1F
Name
Divide by Zero
Single StepKeyboard NMIBreakpointOverflow
Print ScreenReserved
Reserved
Time of Day
KeyboardReservedCommunicationsCommuni cationsVertical retraceDiskette ErrorHandlerPrinter
VideoEquipment CheckMemory
DisketteCommunications
Cassette
Keyboard
PrinterResident BASIC
Boot strapTime of DayKeyboard BreakTimer TickVideoInitialization
DisketteParameters
Video Graphics
Chars
BIOS Entry
D E 0 1
D E 0 1KBDNMID E 0 1
D E 0 1PR INTSC R EEND E 0 1
D E 0 1TIMERJNT
KBJNTD E 0 1D E 0 1D E 0 1D E 0 1DISKJNT
D E 0 1
VIDEOJOEQUIPMENTMEMORYSIZE-DETERMINEDISKETTEJO
RS232JOCASSETTE10
KEYBOARD10
PRINTER10F600:0000BOOT-STRAPTIME-OFDAYDUMMYRETURN
DUMMYXETURNVIDEOJARMS
DISKBASE
2RT-CHARH
Personal Computer BIOS Interrupt Vectors
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 341/605
Vectors with Special Meanings
The following are vectors with special meanings.
Interrupt Hex 1B = 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 'Break ' may have occurred
during interrupt processing, so that one or more 'End
of Interrupt ' commands.must be issued in case anoperation was underway at that time.
Interrupt H ex 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 I timer interrupt, and control should
be returned through an IRET instruction. The
POWER-ON routines initialize this vector to point to
an IRET instruction, so that nothing occurs unless the
application modifies the pointer. It is the responsibility
of the application to save and restore all registers that
are modified.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 342/605
Interrupt Hex 1D - Video Parameters
This vector points to a data region containing the
parameters required for the initialization of the 6845CRT Controller. Note that there are four separate
tables, and all four must be reproduced if all modes ofoperation 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 RAMand just modify the values
needed for the application.
Interrupt Hex 1E - 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 ROMDISKETTE-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 RAMand just modify the values needed for the application.
The motor start-up-time parameter (parameter 10) is
if the parameter value is less than 04.
overridden by BIOS to force a 500-ms delay (value 04)
Interrupt Hex 1F and hex 44 -.GraphicsCharacter Pointers
When operating in the graphics modes, the
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 343/605
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 128code-points contained in ROM is pointed to by
Interrupt Hex 1F. 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 KeyboardTranslation
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-CodeTranslation-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.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 344/605
Note: It is recommended that a programmer savedefault pointers and restore them to their original
values when the program has. erminated.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 346/605
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-232Cattachments to the system. This includes the optional
IBM PCjr Internal Modem and the standard RS232serial-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.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 347/605
80-8384-8788-8 B8 C -8 F90-9394-9798-9B9C-9F
AO-FF100-115116-1 19120-1 3 1
132-135136-139
140-17F
100-17F180-19F
1AO-1 FF
200-2 172 18-3C3
3 C 4 -3 F F
Interrupt(Hex)
202122
2324252627
28-3 F40-434445-474849
50-5F
40-5 F60-67
68-7F80-8586-FO
F1-FF
Function
D O S P r o g r am T e r m i n at eDOS Func t ion Ca l lDOS Term ina te AddressDOS Ctrl Break Exit A ddressD O S F a ta l E r ro r Vecto rD O S Abso lute Disk ReadD O S A bso lu te Disk W riteD O S Termina te, F ix in S to rage
Reserved for DOSReserved for B IOSFirs t 128 Graph ics Ch arac tersReserves for BIOSC o rd les s-K ey boa r d Tra nsla t io nNon - key boa rd Scan-codeTrans la t ion Tab leReserved fo r BIOS
Reserved f or BIO SReserved for User SoftwareIn te r rup tsReservedReserved for BasicUsed by Basic Interpreter whileBA SIC is runningReserved
BIOS. BASIC. and DOS Reserved Interrupts
The following is a list of reserved memory locations.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 348/605
400-48F490-4EF
500-5FF
500
5045 10-5115 12-5 15
516-519
5 1A-51D
Mod e
R O M BIOS
DOS
DOSBASICBASIC
BASIC
BASIC
Function~~ ~ ~ ~
See BIOS ListingReserved for System UsageCommunication Area for any
application
Reserved for DOS and BASIC,
Print Screen Status Flag Store,
0-Print Screen Not Active or
Successful
Print Screen Operation,1-Print Screen In Progress,255-Error Encountered During
PrintScreen Operation,Single Drive Mode Status Byte
BASIC’s segment Address StoreClock Interrupt Vector Segment:
Offset Store
Break key Interrupt VectorSegment: Offset StoreDisk Error Interrupt Vector
Segment: Offset Store
Reserved Mem ory Loca t ions
The following is a list of the BASIC workspace
variables.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 349/605
If you do D E F SEG (Default workspacesegment):
Line number of current l ine being executedL ine num ber of las t errorOffset into segment of s tar t of pro gra m text
Offset into segment of start of variables(end of prog ram te xt 1-1)Keybo ard buf fer con tents
if 0-no characters in bufferif 1-characters in buffer
. S e t t o 1, 2, o r 3 to get tex t in colors1 t o 3.D o no t set t o 0.
(Defau l t 3)
Ch arac ter color in graphics m ode
E xa m pl e100 Pr in t Peek (&H 2E) + 256 Peek (&H2F)
) L H
2E34730
358
6A
4E
Length
B A SICWorkspace Variables
The following shows the mapping of the BIOS memory
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 350/605
Starting Address in Hex
00000
00400
00500
AOOOO
68000
coooo
DO000
EOOOO
FOOOO
BIOS System Map
BIOSInterrupt
Vectors
BIOS
Data
Area
User
Read/Write
Memory
Reserved
for Future
Video
Reserved *
for Video
Reserved
for Future
I /O ROM
~
Reserved
for
Cartridges
Reserved
for
Cartridges
BIOS/
Diagnostics/
Cassette and
BASIC
Program
Area
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 351/605
BIOS Programming Guidelines
The BIOS code is invoked through software interrupts.
The programmer should not Ihard code I BIOSaddresses into applications.
The internalworkings and
absolute addresses within BIOS are subject to changewithout notice.
If an error is reported by the diskette code, you should
'reset ' the drive adapter and retry the operation. A
specified number of retries should be required on
diskette Ireads 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-AccessibleROM-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), interruptvectors are established for the BIOS calls. After 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 COO00 through hex DOOOOare scanned in 2K-byte blocks in search of a valid
adapter card ROM. A valid ROM is defined as follows:
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 352/605
Byte 0: hex 55
Byte 1: hex AA
Byte 2: length (multiple of 2K bytes) - A length
indicator representing the number of512-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 I far return I .
Other Usage 5-19
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 354/605
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 PCjrCordless Keyboard.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 356/605
The following are charts of the scan co des for the IBMPCjr Cordless Keyboard.
KeyPosit ion
1
2
34
5
67
89
101 1
121314
151617
18
19
202122
2324
2526272829
30
31
KeyboardCharacters
Make
Code(Hex)
1
234
5
67
89AB
CD
E
54F
10
11
12
13
14
15
161718191A1 B1cID
1E
Break
Code(Hex)
818283
84
8586
8788898A8B8C8D
8E
D48F
90919293
9495
969798999A9B9c
9D
9E
Cordless Keyboard Maxt ri x Scan Codes (Part 1 of 2)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 357/605
KeyPosit on
3233343536373839
4041424344454647
4849505152535455
56575859606162-
KeyboardChar act ers
S I sd l Df l F
81Gh l Hj1Jk l K11L
;I71 77
C U R . U PL F .SH I FT
Z I zX I X
c l cV Ivb l Bn/ Nm / MI<
.I>I I?R T . S H I FT
C U R . L F .
C U R . R T .A L T .S P . B A RC A P S L OC KI N S E R TD E L E T EC U R . D W N .
Pha nt om - K e y Sc a n C o de
MakeCode
(Hex)
IF20212223242526
2728482A2 c2 D2E2 F
303132333435364B
4 D38393A525350
55
9 FA 0A IA2A 3A 4A5A6
A 7A8C 8A AA CA DA EA F
BOBIB2B3B4B5B6C B
C DB8B9BAD 2D 3DO
Cordless Keyboard Matr ix Scan Codes (Part 2 of 2)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 358/605
The Cordless Keyboard is unique to the PCjr. Eventhough it does not possess all 83 keys of the IBMPersonal Computer keyboard, it does have a way inwhich 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 Computers83-key Keyboard Function
F l - F l OCtrl Break
Ct r l P r tSc (Echo Pr in t)Shi ft P r tS c (Pr in t Screen)Ct r l Num Lock (Pause)Scro l l LockNu m eric keypad region:Nu m Lo ck (Nu m b e rkeypad 1 t h r o u g h 10
becomes key scan codes.)
PgU P key
P g D n k ey
H o m e key
End key
Num eric keypad - signNum eric keypad + sign\ key’ key
key- ey* wi th Pr tScN u m e ri c k e y p a d .
All 256 extended codes:Alt + num eric valuefro m num er ic keypad
IBM PCjrCordless Keyboard Mapping
Fu nct io n key + 1-0 ( F l - F l O )
Fu nct ion key + B (Break)
Fu nc t ion key + E (Echo)Fun c t ion key + P ( P r t S c )Fu nc t ion key + Q (Pause)Fu nc t ion key + S (ScLock)
Alt + Fun c t ion key + N (1t h r o u g h 0 becomes numeric-keyscan-codes)
Funct ion key + cursor left
Fu nc t ion key + cursor right
Fu nc t ion key + c u rso r u p( Ho m e )Fu nct i on key + c u rso r d o w n
Fu nc t ion key p lus the - signFu nct i on key + = signAlt + /Alt + ’Alt + [Alt + ]Alt + .Shif t + Del
Num Lock then Alt + numer icvalue (1 t h r o u g h 0)
(pgu P)
(P g Dn )
( E n d )
83-key-Keyboard Function to Cordless-Keyboard Mapping
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 359/605
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.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 360/605
KeyNumber
1
23
4
5
6
7
8
9
10I 1
12
13
14
15 F n
16
17
18
19
O
I
Base
Case
Esc
I
2
3
4
5
6
7
8
90
-
Ba cks pace
(008)- I
-3 (009)
9
W
e
r
t
UpperCase
Esc
#
$
%
&
a
Ll-
*
1
t
Backspace
1008)
-1
<- *
2
Af-d
xr
Ctrl
Esc
-1Nul (000)
-1
-1
-1
R S O (030)
- I
- I
-1- 1
U S (031)
-1
D EL (127)
-1
-1
DCI (017)
ETB (023)
ENQ 005)
3 C 2 (018)
3 c 4 (020)
Alt
-1
*,*****
*,*****
* *****7
* *****7
* **** ** *****
7
*,******,*****
*,******,*******
-1
-1
-1
*
k
k
c
I:
Fn
**
( F l ) *,***( F 2 ) *,***( F 3 )(F4) *,***(F5) *,***(F6) *,***( F 7 ) *,***(F8) *,***(F9) *,***(F10) *,*********- 1
-1
-1
**,***( P a u s e
-1
(Echo)
- I
-1
** ***7
- Refer to “Extended Co de s” in this sect ion.:* - Refer to “Special Handling” in this section.
** - Refer to “83-Key Keyboard funct ions to C ord less Keyboard
M a p p i n g C h a r t .”*** - Uppercase for cu rso r keys ca n be selected by press ing left o r
r ight shif t or enter ing the Num lock s tat e (Al t + F n + N).**** - W he n Alt is pressed an d the keyboa rd is in the Numlock
s ta te , the upp er row of dig it s is used t o en ter A SC II codes
fo r genera t ing any chara c t e r f rom the ex tended A SC IIcha racte r se t.
Cord less -Keyboard Charac te r Cod es (Par t 1 of 4)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 361/605
KeyNumber
2223242526
2728
2930 Ct r l3132
3334353637383940
41
BaseCase
YU
1
0
P
[3
C R-1
a
S
df
gh
k1
j
7
9
UpperCase
YUI0P
1
C R-1
AS
D
F
GHJKL
77
Ctrl
E M (025)NA K (021)H T ( 00 9)
SI (015)D L E (016)
Esc (027)G S (029)
L F (010 )-1
S O H (0 01 )D C 3 (019)
E O T (004)
AC K (006)B E L L (007
BS (008)
L F (010)
VT (011)FF (012)-1
-1
Alt
*****
( I ) * * *3**
-1-1**
*******- 1
7 ***
F n
-1-1
- 1
-1**,***(Pr tScreen)-1
-1
-1-1
-1
(Scrol l Lock-1
- 1-1
- 1
- 1
- 1
-1
- 1
-1
** ***7
* - Refer to “Ex tend ed Co des ” in th is section.** - Refer to “Specia l Ha ndl in g” in th is sect ion.
*** - Refer to “83-Key Key board funct ions to CordlessKeyboa rd M app ing Cha r t .”
**** - Up perca se for curs or keys can be selected by pressing
left or right shift or en te r ing the Num lock s ta te (Al t +
F n + N).
Nu m lock s ta te , the u ppe r ro w of d igits is used to enterAS CI I codes fo r genera t ing any charac te r f rom the
ex tended A SC II charac te r se t.
***** - When Alt is pressed and the keyboard is in the
Cordless-Keyboard Character Codes (Part 2 of 4)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 362/605
KeyN umber
42
43 L eftShif t4445464748
495051525 354 RightShif t
55
56
Cordless-Keyboard Character Codes (Part 3 of 4)
Base Upper Alt +
Case Case Ctrl Alt F n Ctrl
Cur .Up* 8 **** -1 * **,***( H o m e )
-1 -1 -1 -1 -1
Z Z S U B ( 0 2 6 ) * -1
X X C A N (024) * -1
C C E X T ( 0 0 3 ) * -1
V V S Y N ( 0 2 2 ) * -1
b B S T X (002) * ** ***
n N S O (014) *,*** ***m M C R (013) * -1
9 < -1 - I -1
> -1 (*) * -1
I ? -1 \ - I
-1 - I -1 - I
C u r . L
*4 * * * *
* * **,*** **
9
(Break)
R e v e r s e ( P N P )W o r d
C u r . R * 6 * * * * * * ** *** **
**dvance ( P b n )
W o r d
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 363/605
~ ~
KeyNumber
57 Alt5859 C a p sLock60
61
62
~ ~ ~~
BaseCase
-1S p a c e-1
Ins .Del . *C u r . D n *
FnUpperCase
-1S p a c e-1
o****
2 ********
-1S p a c e-1
-1
-1**,***E n d
Ctrl Alt
-1 -1S p a c e S p a c e- I -1
-1 *-1 *-1 *
Alt +
Ctrl
**
****
* - Refer to “Extended Co des” in th is sec t ion .** - Refer t o “Spec ia l H andl ing” in th is sec t ion .*** - Refer to “83-Key Keyb oard func t ions to C ord less
K ey b o a rd Ma p p in g C h a r t .”**** - Upp ercase fo r cursor keys can be se lected by pressing
left o r r igh t sh i ft o r en te r ing the Num lock s ta te (Al t +
F n + N ) .
Nu m lock s ta te , the upper row of d ig i ts is used to en te rAS CI I codes fo r gene ra t ing any cha rac te r f rom theex tended A SC II cha rac te r s et .
***** - W he n Alt is pressed a n d the keyb oard is in the
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 samefor both the Cordless Keyboard and 83-key keyboard.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 364/605
Second Code~~~ ~
3
15
16 t h r o u g h 2530 t h r o u g h 38
44 t h r o u g h 5059 t h r o u g h 68
71
72
73
7577
79
80
8182
83
84 t h r o u g h 93
94 t h r o u g h 103
104 t h r o u g h 113
114
15
16
17
1819
20 t h r o u g h 131
132
133 t h r o u g h 149
150 t h r o u g h 190
Function
Nul l Ch a rac te r
A l t Q , W , E , R , T , Y , U , I , O , PA € t A , S , D , F , G , H , J , K , LAlt Z , X , C , V , B, N , MF n + 1 , 2, 3, 4, 5, 6, 7, 8, 9, 0 ( F u n c t i o n s I
t h r o u g h 10)
H o m eU p A r r o w
P a g e U p
Cu rso r Left )LCu r so r R i g h t )
E n dD o w n A r ro wP a g e D o w nIns ( Inser t)De l (Dele te )FI I t h r o u g h F20 ( Up p e r Ca se FI
t h roug h F10)F21 th roug h F30 (Ct r l FI t h roug h F10)F31 t h r o u g h F40 (Al t FI th rough FIO)F n / E o r C t rl / F n / P ( S t a rt / S t o p E c h o t oPr in te r )C t r l1 Reverse Word )C t r l ( Ad v a n c e W o r d )C t r l / E n d [E r ase E n d o f L i ne ( EOL) ]
C t r l / P g D n [ E ra se t o E n d of S c r e en ( E O S ) ]C t r l / H o m e (C l e ar S c r ee n a n d H o m e )AIt / 1 , 2, 3, 4, 5, 6 , 7, 8, 9, 0, -, = (Keys 2t h r o u g h 13)
C t r l / P g U p ( T o p 25 Lines of Text andH o m e C u r . )ReservedReserved fo r Non-Keyboa rd Scan Codes
rl
Cordless Keyboard Extended Functions
Shift States
Most shift states are handled within the KEYBOARD
routine, transparent to the system or application
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 365/605
program. The current set of active shift states is
available by Icalling ’ an entry point in the ROM
KEYBOARD-routine. The following keys result in
altered shift-states:
Shift
This key temporarily shifts keys 2 thru 13,16 thru 28,
3 1 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,55,56, and 60 thru 62.
Ctrl
This key temporarily shifts keys 3,7, 12, 14, 16 thru
28,30 thru 38,42,44 thru 5 0 , 5 5 , and 56 to the Ctrl
state. The Ctrl key is used with the Alt and Del keys to
cause the I System Reset I function, with the Scroll
Lock key to cause the ‘Break’ function, with the Num
Lock key to cause the I Pause I function, with the Alt
and Cursor Left or Right for Iscreen adjustment I with
Alt and Ins to I activate diagnostics , and with Alt and
CapsLock to I activate keyboard clicking . These
functions are described in “Special Handling” on thefollowing pages.
Alt
The Alt key temporarily shifts keys 2 thru 13, 17 thru
26, 3 1 thru 39, and 44 thru 50 to the ’Alternate stateI .
The Alt key is used with the Ctrl and Del keys to cause
the ’ System Reset I function described in “Special
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.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 366/605
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 'Num Lock ' 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 2 5 , 3 1 thru 39, and 44 thru
50 to 'upper case ' . A second press of the Caps Lock
key reverses the action. Caps Lock s handled internalto 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.
2.
Interrupt Hex 48a. Altkey
b. Ctrikey
c. Shiftkey
Interrupt Hex 9
a. Ctrlb. Alt
c. shift
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 367/605
Of the three keys listed, only At 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 Alt, 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 1A. The
extended characters (AL = hex 00, AH = hex 00) arere turned.
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 'Pause I mode is unused
otherwise.
Print Screen
The combination of the Fn and P eys results in an
interrupt, invoking the PRINT SCREEN routine. This
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 368/605
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 Iwindowing over the
text rather than cursor movement. Pressing the 'Scroll
Lock' combination a second time reverses the action.
The KEYBOARD routine simply records the current
shift state of 'Scroll Lock I . It is the responsibility ofthe system or application program to perform the
function.
Functions 1 thru 10
The combination of the Fn key (15) and one of keys 2
thru 11 results in the corresponding IFunction ' with
key2being'Fl 'uptokeyl lbe ing F10'.
Function Lock
Concurrently pressing first the Fn key and Shift key,
and then pressing the Esc key causes keys 2 thru 11 toshift to their IFunction I states and remain there until
the same combination is pressed again.
Screen Adjustment
The combination of the Alt key, Ctrl key, and either theLeft or Right cursor movement key causes the screen to
shift one character in the corresponding direction, up to
a maximum of four.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 369/605
Enable/Disable Keyboard Click
The combination of the Alt, Ctrl, and Caps Lock keys
causes the keyboard audio feedback (click) to shift
between I on I and I off I . The Power-On default isIoff I .
Run Diagnostics
The combination of the At, 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 keyboardbuffer, 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 I is
sounded. A larger buffer can be specified by modifying
words at labels 'Buffer-Start' (hex 480) and
I Buffer-End ' (hex 482) to point to another offset
within segment hex 40.
The KEYBOARD routine suppresses the typematic
action of the following keys: Ctrl, Shift, Alt, CapsLock,Insert,and Function.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 370/605
Function
System Reset
Break
P a u s e
Pr in t Screen
Func t ion Lock
ScreenAdjus tment
Keyboard Cl ick
R u n Diagnos tics
KeyboardAdventureG a m e
Cassette4u t 01 oad
KeyCombinations
Alt + Ctr l + Del
F n + B
F n + Q
F n + P
F n a n d S h if tthen Esc (Held)
con cu r re n t 1y)
Alt + Ctr l +cursor r ight orcursor left
Alt + Ct r l +
C a p s L o c k
Alt + Ct r l + Ins
Esc
Ctrl + Esc
Cordless Keyboard Special Handl ing
Description
Uncon di t iona l sys tem
resetBreaks p rogram execu tio r
Resum able pause inp rog ram execu tion
Locks the numb er keys asFunct ion keys (F -F O)
and B, Q, P, E, S, and thecurso r con t ro l keys tothei r funct ion s ta tes
Al lows the user to ad jus tth e display’s im age left o rr ight
Enables o r d i sab les the
keyboard a ud io feedbackclick
In it ia te s sy st em R O Md a gnos cs
If the first key presse daf te r the sys tem comes u pin Cass et te BAS IC is Esc
(key # 1 ) t hen theKeyboa rd A dven tu reG am e will be ac t ivated.
If this is the first keysequence a f te r the sys temcomes u p in Casse t teBA SIC then the s c reen
will display ‘Lo ad
“CA Sl :” ,R fo llowed by aCar r iage Re tu rn . Th i sa l lows a casset te p rogra mto be au tom at ica l lyloaded.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 373/605
Funct ion I Keys
Stan dard func t ionkeys
W indo w Lef t I Ctr l1
S h if t F n / F1t h roughF n / F l O
Enter insert mo de I Ins
Ext ra funct ionkeys
Exit inser t mode I Ins
Alt keys2 t h rough 13
(1 th rough990)(-9 =)
Iancel cur rentline
Ext ra funct ionteys
Suspend syst em Ct r l Fn
(Pause ) P a u s e
Al t Ath rough 2
Sy stem reset I Alt C trl .Del
T o p o f d o c u m e nt C t r l F n
a n d h o m e c u rs o r I P g U p
Secondaryrunct ion keys
Sh i f t F I -F lOCt r l FI-FIOA lt F l - F l O
Comment
Wh en te xt is too wide to
f i t th e screenLine Ed i tor
Line Edi tor
C o m m a n d en t ry , te x tent ry
~~
S to p list, s to p program,
a n d so on.Resumes o n any key.
Interrupt current process
R e b o o t
Edi tors , word processors
Pr im ary funct ion keys
Ex tra funct ion keys if 10
a r e no t suff icient.
Line Edi to r
Used when funct ion s ta r t swi th th e sam e l e t te r as o n eof th e a lp ha keys.
Keyboard - Commonly Used Functions (Part 3 of 3)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 374/605
Function
Carr iage re tu rnLi ne feed
BellH o m eC u r s o r u pC u r s o r d o w nCu rso r leftCu rsor r ightAdva nc e on e wordReverse on e word
InsertDeleteCle ar screenFreeze ou tpu tT a b a dv an ceS to p E xe c ut ion (b rea k )Delete curren t l ineDele te to end of l ine
Pos i t ion cursor to end of l ine
I (Enter)C t r l LJ (Enter)
C t r l GF n H o m eU p A r ro wD o w n A r r o w1
Ct r lC t r l
In sDelC tr l F n H o m eF n P a us e
F n B re akEscC t rl F n E n d
F n E nd
L
BASIC Screen Editor Special Functions
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 375/605
Function
S u s p e n dE c h o t o p r in t erS to p e ch o t o p r in te rExi t curren t func t ion (break)Backspace
Li ne feedCan ce l l ineC o p y c h a rac t e rC o p y u n t il m a t c h
C o p y r e m a in ing
S k ip c h a ra ct e rSk ip un ti l ma tchEn te r in ser t mo deExi t inse r t modeM ake new l ine the t empla teS t ri n g s e p ar a to r in R E P L A C EEnd of f i le in keyboard input
F n P a us eF n E c ho
F n E c h oF n B re ak+ ey 14C t r l L), (En te r )EscF n F 1 o rF n F 2F n F3DelF n F 4In sIn sF n F 5F n F 6F n F 6
DOS Special Functions
Non-Keyboard Scan-code Architecture
The architecture of the IBM PCjr BIOS 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 or
Imake codes and D6 thru FE for Ibreak ' codes) are
processed by BIOS in the following manner:
1. If the incoming Imake 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
'break I codes above hex D5 are ignored.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 376/605
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-scan-code. The new extended-scan-code
is then placed in the BIOS keyboard buffer with the
character code of OO(null). This utilizes the range
hex 96 thru BE for scan codes hex 56 thru 7Erespectively.
The default translate-table maps scan codes hex 56 thru
6A to existing keyboard-values. Scan codes hex 6Bthru 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 owntranslate table if mapping differences are desired.
The translate table format is:
Description
0 Length - The number of non-keyboard
scan-codes that are mapped within the table(from 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.
1 o n
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 377/605
8-Bits
Hig h Byte - 0 (NUL)
Lo w Byte - Scan Code1
tI
I
Low Byte - Scan Code
Hig h Byte - 0 (NUL)I - 3Lo w Byte - Scan Code
0 0
0
0 0
0 0
0
0 0
I 1 H i g h B y t e - O ( N U L )
II Low Byte - Scan Code
Translate Table Format
With this architecture, all keyboard scan-codes can beintercepted thru Interrupt Hex 9 and al l non-keyboardscan-codes can be intercepted thru Interrupt Hex 48.
The following is a chart showing the default values ofthe translate table in BIOS.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 378/605
Length = 20 mapped values
InputScan Code
8687888990919293949596979899
100
101
I02I03I04105
Mapped KeyboardValue Character
72737781
807975715728171831454443
301615
1
( cu r so r up )
(curso r r igh t )P g D n( c u r so r d o w n )E n d(cu rso r lef t)H o m e
S p a c eE n te rW
ES
XZ\
AQT a bEsc
P g U P
Translate Table Defaul t Values
Scan Codes(Hex)
1 - 5 5
56 - 7E
81 - D 5
D 6 - F E
FF
Type of Scan Code
N o r m a l K e y b o ar d S c a n C o d e ( M a k e )
N o n - K e y b oa r d S c a n C o d e ( M a k e )
N o r m a l K e y b o a rd S c a n C o d e (B r e a k)
N o n - K e y b oa r d S c a n C o d e ( B r ea k )
Keyboard Buffe r Fu l l
Scan-Code Map
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 380/605
BIOS CassetteLogic
Software Algorithms = Interrupt Hex 15The CASSETTE routine is called by the request type in
AH. The address of the bytes to be 'read' from or
Iwritten ' to the tape is specified by DS:BX and the
number of bytes to be 'read I or 'written is specified
by CX. The actual number of bytes 'read ' is returned
in DX. The read block and write block automatically
turn 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
A H = OA H = 1A H = 2
A H = 3
Function
T u r n C a ss ette M o t o r O nT u r n C a ss ett e M o t o r OffRead T ap e BlockRead CX by te s in to memo ry s t a rt ing at
Address D S: BXRetu rn ac tua l num ber of bytes read in D XRetu rn Casset te S ta tus in A H
W rite T ap e BlockW ri te C X bytes on to casse tte s ta r t ing a tAddress DS:BX ,
Retu rn Casset te S ta tus in A H
AH Request Types
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 381/605
CassetteStatus
A H = 0 0A H = O I
A H 1 0 2A H = 0 4
A H - 8 0
INote: T h e ca r ry f lag will be se t on a ny error .
Description
N o ErrorsCyclic Redundan cy Check (CR C) Er ror inRead BlockN o D at a T rans i ti ons
N o LeaderInva lid Com ma nd
~
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
1’s) to the tape, writes I a synchronization bit (0), and
then writes I a synchronization byte (ASCII character
hex 16). Next, the routine ’writes ’ the number of data
bytes specified by CX. After each data block of 256bytes, a 2-byte cyclic redundancy check (CRC) is
I written I . The data bytes are taken from the memory
location pointed at by DS:BX.
‘Ie WRITE-BLOCK routine disassembles and
writes I 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 1O
millisecond for a 1bit and 0.5 millisecond for a 0 bit.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 382/605
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
of data bytes to be I written ' is not an integral multiple
of 256, then, after the last desired data byte frommemory has been 'written ' , he data block is extended
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 I . Finally, the cassette
motor is I turned off I if there are no errors reported by
the routine. ll 8259 interrupts are I disabled I duringcassette-write operations.
-
Zero B i t
-
500 PS t
One B i t
I_ 1000 P S - I
Cassette-Write Timing Chart
Cassette Read
The READ-BLOCK routine turns on ' the cassette
drive motor and then delays for approximately0.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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 383/605
(ASCII character hex 16) is 'read I . 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 eachbyte is 'assembled', it is 'written' into memory at
location DS:BX and BX s incremented by 1.
r
Leader
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
A H 'set ' to hex 01. DX ontains the number of bytes'written' into memory.
Sync Sync Data CRC Data CRC
Bit Byte Block Block
All 8259 interrupts are 'disabled ' during the
cassette- 'read ' operations.
Data Record ArchitectureThe WRITE-BLOCK routine uses the following format
to record a tape block onto a cassette tape:
(CASSETTE TA PE BLOCK)
MotorOn
MotorOff
Cassette Write-Block Format
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 384/605
Component
LeaderSy nc Bit
Sy nc ByteD a t a Blocks
CRC
Data Record Components
Description
256 Bytes (of All 1’s)O n e 0 bit
A SC II Cha rac te r hex 16256 Bytes in Length2 Bytes fo r each D a ta Block
Error Detection
Error detection is handled through software. A CRC is
used to detect errors. The polynomial used is G(X)=
X16 + XI2 + X5 + 1,which is the polynomial used by
the synchronous data l ink control interface.
Essentially, as bits are Iwritten I to or Iread ’ from the
cassette tape they are passed through the CRC registerin software. After a block of data is Iwritten I , the
complemented value of the calculated CRC register is
Iwritten on the tape. Upon reading the cassette data,
the CRC bytes are read I and Icompared to the
generated CRC value. If the read CRC does not equal
the generated CRC, the processor’s carry flag is ‘set
and the status of AH is Iset I to hex 01, which indicatesa CRC error has occurred. Also, the routine is exited
on a CRC error.,
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 386/605
Appendixes
Contents
Appendix A .R O M BIOS LISTING ..........A-3
Appendix B.LOG IC D IA G R A M S ........... B-1
Appendix C.CHARACTERS. KEYSTROKES. and
COLOR ................................ C-1
Appendix D.UNIT SPECIFICATIONS . . . .D-1 System Unit ........................... D-1
Size: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1
Weight: ........................... D-1
Transformer: ....................... D-1
Environment: ....................... D-1 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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 387/605
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
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 388/605
= 0060
= 0038= 0007= 0061
= 0062= 0063= 0089
= 00-
= 0021= 0020
= 0040
= 0043= 0040= 0061
= 0 3 D A= OOAO= OOBO= 03DF= 0060
= 4000= 2000
= OOF2= 0080
= 0020= 0040= 0001
= 00F4
= 0020
= 0040
= OOBO= OOF5
0000
0008
0008
ooocoooc001400 14
0020
00200040
0040
0070
0070
00740074
0060
006000780078
0 0 7 C0 0 7 C0110
0110
0 120
0120
012401240204020402080208
022402240400
04000400
7COO7COO7COO
THE B I O S ROU TIN ES ARE HEANT TO B E ACCESSED THROUGHSOFTUARE INTERR UPTS ONLY ANY ADDRESSES PRESENT I NTHE LI ST IN G S ARE INCLU DED ONLY FOR COHPLETENESS,
A B S OLUT E A DDRES SE S U I T H I N T H I S CODE V I O LA T E T HESTRUCTURE AND D ES IG N OF B I O S
NOT FOR REFERENCE APPLICATIONS u n t c n REFERENCE
...............................................................
.......................................EQUATES---------___------_____________________
~ O R T - A EQU 60H , 8255 PORT A ADDRCPUREC EQU 3BH , H A W FO R C PU REG B I T SC R T R E C E a u 7 , HASK FOR CRT REG B I T SP ORT-B E a u 6111 , 825s PORT B AOORP ORTJ E a u 6 2 ~ , 8 2 5 s PORT c AODRCHD-PORT Ea u 6 3 ~
H.OOE-B255 Ea u IOOOIOO IB
E O 1 ~ a u 2014
T I H E R E a u OHT I H - C T L E a u 4314 , 8253 TIHER CONTROL PORT ADDR
I NTA O O E Q U 20 H , 8259 PORTI NTAO I EQU 2 1 H , 8259 PORT
TIHERO E Q U 40 H , 8 2 5 3 T I H E R l C N T E R 0 PORT ADDRKB-CTL EQU 61H , CONTROL B I T S FOR KEYBOARDVCA-CTL EQU 3D AH , VIDEO GATE ARRAY CONTROL PORTNHI-PORT EQU OAOH , NHI CONTROL PORTPORT-BO Eau o ~ o nPACREG Eau OBOFH , CRT ~CP UPACE REGISTERKBPORT Eau O ~ O H , KEYBOARD PORT
DI A C-T A B LE - PT R E Q U 40 00 HH I N l E QU 2 OO OH.......................................
D I S K E T T E E Q UA T ES.......................................NEC-CTL EQU OF 2H , CONTROL PORT FOR THE D I S K E T T EFDC-RESET E Q U BOH , R E S E T S T H E N EC ( F L O PP Y D I S K
, CONTROLLER) 0 RESETS,, I RELEA SES THE RESET
YO-ENABLE EQU 2 0 H , E N A B L E S U A TC H DO C T I H E R I N N ECUD-STROBE EQU 40 H , STROBES YATCHDOC TIHERDRIVE-ENABLE E a u o i n , SELECTS AND ENABLES D R I V E
NEC-S TA T E a u O F ~ H , STATUS REGISTER FOR THE NECBUSV-Bl T EQU 2OH , B I T = 0 AT END OF EXECUTtON PHASE010 E Q U 4 0 H , I N O l C A T E S D I R E C T I O N O F T R AN S FE RRQH EQU SOH , REQUEST FOR HASTERN EC-DATA EQU OFSH , DAT A PORT FOR THE NEC
.......................................BOB8 I NT E RRUP T LO CA T I O NS.......................................ABSO SEGHENT AT 0
ORC
ORCNWI-PTR
I NT3-PTR
I NT5-PTR
I NT-PTR
V I DE O - I NT
I NTIC-PTR
PARH-PTR
B A S 1C-PTR
DI S K - P O I NT E R
EXT-PTR LABEL
CSET-PTR
KEY62-PTR
E X S T
I N T B I L AB EL
I N T B 2 L A B E L
I N T 8 9 L A B E L
DATA-AREADATA-UORD
BOOT-LOCNABSO ENDS
ORC
ORG
ORC
ORC
ORC
ORC
ORC
ORC
ORC
ORC
ORC
ORC
ORC
ORC
ORC
ORC
2* 4L A B E L3*L A B E L5*4L h B E LB* 4
L A B E LI O H N 4L A B E L
L A B E L1DHN4L A B E L18HN4L A B E L0 1 E H N 4L A B E L0J F HN4DUORO
L A B E L
L A B E L0 4 9 H N 4L A B E L0 8 1 H N 4UORD
UORD
UORD
~ C H M
0 4 4 ~ ~ 4
0 4 8 ~ ~ 4
0 ~ 2 ~ ~ 4
0 8 9 ~ ~ 4
aoon
UORD
UORO
UORD
OUORD
UORD
UORD
DUORD
UORD
DUORD
DUORD
UORD
UORD
..
L A B E L B Y T ELABEL UORD
L A B E L F A R7coon
P O I NT E R TO V I DE O P A RHS
E NT RY P O I NT F O R CA S S E T T E B A S I CINTERRUPT mi
L O C A T I O N O F P O I N T E RP O I NT E R T O E X T E NS I O N
P O I NT E R T O DOT P A T T E RNS
P O I NT E R TO 62 KEY KEYBOARD CODE
P O I NT E R T O E X T . S CA N T A B LE
bBSOLUTE LO CAT ION OF DATA SECHENT
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 389/605
0000
0000 . EO C
0 100
0 100
00000000 04 C
7777
1
7777
0 0 0 8 04 I
1
0010 7777
0 0 1 2 77
0013 7 77
0015 7 ’ ) 7 7
0017 77
= 0 0 4 0
= 0 0 2 0= OOOE= 0004= 0 0 0 2= 0001O O l E 77
= OOEO= 0040
= 0 0 2 0= 0010= 0 0 0 8
0 0 0 4
= 0002
0019 -7
O O I A 7777
O O l C 7777
O O l E 10 c7777
3
= 0 0 4 5= 0046= 0038= O O l D
0 0 3 A0 0 2 A0 0 3 6
= 0 0 5 2= 0053
0 0 3 E ? 7
0 0 3 F 17
0040 7?
= 0025
0 0 4 1 77
= OOEO= 0 0 4 0= 0 0 2 0= 0010= 0009
= OOOE= 0 0 0 4
0003
= 0002= 0001
0 0 4 2
= 0 0 2 0= 012c
5 OOAF
= 0003= 0019
= 0004
77
07 C
I
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _ _ - _ - -- - -, STACK -- USED D U R I N G I N I T I A L I Z A T I O N ON LY
STACK SEGMENT AT 30 HDU 1 2 8 D U P ( 7 )
P R I N T E R - E A S E DU 4 D U P ( 7 ) , A D D R E S S E S O F P R I N T E R S
E Q U I P - F L A G OU 7 , I N S T A L L E D H A R D U A R E
KED-ERR D E , COUNT OF KEYBOARD TRANSMI T ERRORS
MEMORY-SIZE DU , U S A B L E MEM ORY S I Z E I N K B Y T E STRUE-MEM DU 7 , R E A L MEM ORY S I Z E I N K B Y T E S____________________-----_---_-----_---
KEYBOARD DATA AREAS
LE-FLAG DE ?.----- S H I F T F L A G E O U AT E S U I T H I N K E- FL AG
CAPS LOCK STATE HAS BEEN TOGGLED
NUM LOCK STATE HAS BEEN TOGGLED
CAPS-STATE EQU
NUM-STATE EOU
C T L - S H I F T E O UA L T -S H I F T E Q U
L E F T - S H I F T EQUR I G H T - S H I F T E O UKE-FLAG-1 DE
C A P S -S H I F T E O U
S C R O L L - S H I F T E Q UHOLD-STATE EQU
I N S - S H I F T E Q U
NUM-SHI FT EOU
C L I CK-ON EOU
C L I C K - S E O U E N C E E O U
A L T - I N P U T DE
BUFFER-HEAD OU
B U F F E R - T A I L DUKE-BUFFER DU
4 0 H ,2 0 H ,OEH ,04H ,0 2 H ,01H ,
EOH ,4 0 H ,2 0 H ,IO H ,OEH ,0 4 H ,
02H ,
7
7
7
7
16 D U P ( 7 )
A L T E R N A T E S H I F T K E Y D E P R ES S E DC O N T R O L S H I F T K E Y D E P R E S S E DL E F T S H I F T K E Y D E P R E S S E DR I G H T S H I F T K E Y D EP R ES SE DSECOND BYTE OF KEYBOARD STATUSI N S E R T K E Y IS DEPRESSEDCAPS LOCK KEY IS DEPRESSEDNUM LOCK KEY IS DEPRESSEDS C R O L L L O C K K E Y IS DEPRESSEDSUSPEND KEY HAS BEEN TOGGLEDI N D I C A T E S T H AT A U D I O F E E D BA C K ISE N A B L E DOCURRNCE OF ALT-CTRL-C APSLOC K HASOCCUREDSTORAGE FOR ALTERNATE KEYPADE N T R YP O I N T E R T O H E A D O F K E Y B O A R D B U F FP O I N T E R T O T A I L O F K E YB O AR D B U F F, ROOM FOR 15 E N T R I E S
--_--- HEAD = T A I L I N D I C A T E S T H A T TH E BU F F ER IS EMPTYNUPKEY EOU 69 , SCA N CODE FOR NUMBER LOCKSCROLL-KEY EQU 70 , S C R O L L L O C K K E YALT-KEY EOU 56 , A L T E R N A T E S H I F T K E Y SC A N C O DECTL-KEY E OU 2 9 , SCAN CODE FOR CONTROL KEYCAPS-KEV EOU 58 , S C A N CO D E F O R S H I F T L O C K
LEFT-KEY E QU 4 2 , S C AN C OD E F O R L E F T S H I F TR I G H T - K E Y E OU 5 4 , S C A N C OD E F O R R I G H T S H I F T
I NS-KEY E O U E 2 , S C A N C OD E F OR I N S E R T K E Y
D EL-KEY E O U E 3 , S C A N C O D E F O R D E L E T E K E Y.......................................
D I S K E T T E D A T A A R E A S
MOTOR-STATUS DE
MOTOR-COUNT DE
MOTOR-UAI T EQ U
D I S K E T T E - S T A T U S DET I ME-OUT EOUBAD-SEEK EOUEAD-NEC EOUBAD-CRC EOUDMA-EOUNDARV EQU
EAD-DMA EQURECORD-NOT-FND EQUU R I TE-PROTECT EQU
BAD-AODR-MARK EQU
NEC-STATUS DEEAD-CMD EOU
SEEK-END EQUTHRESHOLD EOU
PARMO EQU
PARM 1 EQUPARMS EQUP A R M I O E O U
7
7
7
37
7
EOH
4 0 H2 0 HIOH0 9 H
OEH04HO 3 H
0 2 H0 IH7 DUP ( 7 )
D R I V E R E C A L I B R A T I O N S T A T U S
B I T 0 = D R I V E N E E D S R E C A L B E F O R EN E X T S E E K I F B I T IS = 0
MOTOR STATUSB I T 0 = D R I V E 0 IS CURRENTLY
R U N N I N GT I M E O U T CO U NT ER F O R D R I V ET U R N O F F2 SECS OF COUNTS FOR MOTORTURN OFFR E T U RN C O DE S T A T U S B Y T EA T T AC H M E N T F A I L E D T O R E SP ON DS E EK O P E R A T I O N F A I L E DN E C C O N T R O L L E R H A S F A I L E DB A D C R C O N D I S K E T T E R E A DATTEMPT TO DMA ACROSS 64KBOUNDARYDMA OVERRUN ON OPERATI ONREOUESTED SECTOR NOT FOUNDW R I T E A T T EM P T E D O N W R I T E
P R O T E C T E D D I S KADDRESS MARK NOT FOUNDE A 0 C O M M A N D G I V E N T O D I S K E T T E 110
; STATUS BYTES FROM NEC
20H
300 ; N UM EE R O F T I M E R - 0 T I C K S T I L L
O A F H ; PARAMETER 0 I N T H E O lS K- PA R M; E N A B L E
; T A B L E3 ; PARAMETER I
4 ; PARAMETER 10
25 ; PARAMETER 9
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 390/605
00490 0 4 A0 0 4 C0 0 4 E0050
0060
00620063
0065
??????????????
OB t????
1
????
??????
??
0066 ??
0067 ????0069 ????0068 ??
0 0 6 C ????0 0 6 E ????0070 ??
0071 ??0072 ????
0074 ??0075 ??0076 ??
0077 ??
0 0 7 C 04 t
??1
0080 ????0082 ????0084 ??
OOBS ??OOB6 ??
= OOOF0087 ??
0088 ??= 0004
= 0080= 0040= 0020= 0010= OOOB= 0004= 0 0 0 2= 00010089 7 ?
OOBA ??
OOBS
00000000 ??
0001 ??0002 ????
0004 ? ? .
.--___________--_-__--------------------
V I D E O D I S P L A V D A T A A RE A. .......................................
OB 7 ; CURRENT CRT MOO€RT-MODE
CRT-COLS DU ? ; NUMBER OF COLUMNS ON SCREENCRT-L E N DU ? ; L E N G TH O F R E G EN I N B Y T E SCRTJTART ou ? ; S T A R T I N G A D D RE SS I N R E GE N B U FF E RCURSOR-POSN DU B D U P I ? ) ; CURSOR FOR EACH OF UP TO B P A GE S
CURSOR-MODE D U ? ; CURRE NT CURS OR MODE S E TTINGA CTIV E -P A GE OB ? ; C U RR E NT P A G E B E I N G D I S P L A Y E DADOR-6B45 D U ? ; B A S E AD D RE SS F O R A C T I V E D I S P L A Y
CRT-MODE-SET OB ? ; C U R R E N T S E T T I N G O F T H E
C R T - P A L L E T T E OB ? ; C U R R EN T P A L E T T E M AS K S E T T I N G
; CARD
; CRT MODE RE GIS TE R
.-------______--________________________
C A S S E T T E D A T A A R E A.---------------------------------------~ D C E - C N T D U ? ; TIME COUNT A T DA TA E DGECRC-REG D U ? ; C R C R E G I S T E RL A S T-V A L OB ? ; L A S T I N P U T V A L U E
T I M E R D A T A A R E A.---------__-_-----_--------------------
I MER-LOU DU ? ; L OU UORD OF T IME R COUNTT I M E R - H I G H D U ? ; HI GH UORD OF T IM E R COUNTT I MER-OFL OB ? ; T I M E R H A S R O L L E D O VE R S I N C E L A S T
; READ.-----------___-----____________________
S Y S T E M D A T A A R E A.----------____-----____________________E IOS -E RE A K DE ? ; B I T 7 = 1 I F B R E A K K E Y H A S B E E N H I TRESET-FLAG DU ? ; U O R D = 1 2 3 4 M I F K E Y B OA RD RE S E T
; UNDERUAY.----------____-------------------------
E X T R A D I S K E T T E D A T A A R E AS.---------__--_-------------------------
~ R A C K O OB ?
TRACK 1 OB ?T R A C K 2 D E ?
OB ?.----------_------------------------------------
P R I N T E R AN D R S 2 3 2 T I M E - O U T V A R I A B L E S.---------__--_---------------------------------;RINT-TM-OUT DB 4 DUPI?)
R S 2 3 2 - T IM - O U T O B 4 D U P I ? )
.......................................A O D I T I O N A L K E YB O AR D D A T A A RE A.......................................
EUFFER-START ou 7
BUFFERJND DU 7
I NTR-FLAG OB 7 , F L A G TO I N D I C A T E A N I N T E R R U P T, HAPPENED.......................................
, 62 K E Y K E Y B OA RD DA TA A RE A
iUR-CHAR OB 7 , CURRE NT CHA RA CTE R FOR TY P A MA TICVAR-DELAY OB 7 , D ET ER MIN ES W E N I N I T I A L D E L A Y IS
. . . . . . . . . . . .. . . . . . . . . . . . . .. . . . . . . . . . . . .
, OVERDELAY-RATE E a u OFH , INCREASES INTAL DELAYCUR-FUNC OB 7 , C U R R E N T F U N C T I O N
KB-FLAG-2 OB 7 , OR0 B Y T E O F K E Y B O A R D F L A G SR AN GE E a u 4 , N UM BE R O F P O S I T I O N S T O S M I F T
, D I S P L A Y......................................., B I T A S S I G N M E T S F O R K B -F L AG - 2.......................................~N-FLAG E a u eonFN-BREAK E a u 4011FN-PENDING E a u 2 0 1 4F N L O C K E a u i o nT Y PE -O F F E a u OBHH A LF -R A TE E a u O ~ HINIT-DELAY E a u 0214P UT C HA R E OU O l HHORZ-POS OB 7 , C U R R E N T V A L U E O F H O R I Z O N T A L
PAGDAT OB 7 , I M A G E O F D A T A U R I T T E N T O P AG R E G
D A T A E N D S
, S TA RT P A RM
.......................................E X TRA DA TA A RE A
-------------A T sonOB 7
AREA IS USEDR E S I O E N T )OB 7
D U 7
OB 7
-------
D U R I N G D I A G N O S T I C S
TO CURRE NT P A GE FOR DI A G ME NUCURRE NT ROUlCOL UMN COORDINA TE SF O R D I A G M E N UI N T E R N AL I E XT E R N A L E 2 5 0 URAP
I NO I CATOR
--------------~ ~ D A T AEGMENTS TA TUS -B Y TE, T H E F O L L O U I N G
(POST AND ROM~CP-MENU-PACE
DCP-ROU-COL
URAP-FLAG
-----
ONL Y
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 391/605
ooos ??0006 ????
OOOE ????
OOOA ????
oooc ? 7 ? ?
OOOE ????0010 7 7
0011 ??
0 0 1 2 ????
0 0 1 4 ????
0016 ????O O l E ??
0019 09 C
??1
0 0 2 6 7 ? 7 ?
OOZE 77
0029
ooze 7 7 7 7
OOZD 7 7 7 7
0 0 2 F 7 7 7 7
0031 7 7 7 3
0033 7777
0035 7 7 7 7
0037 7777
0039 7 7 7 7
0038 7 7 7 ?
0 0 3 D
0000
0000 7 7
0001 7
0 0 0 2 77
0003 7 7
0004 7 7
ooos 7 7
0006 7 7
0007 7 7
OOOE 7 7
0009 08 C
00
00
00
00
I
= 0 2 0 00029 0 2 0 0 C
00
1
0 2 2 9 0100 t
6 DOB
1
0 4 2 9 7 7
0 4 2 A 77
0 4 2 8 7 7
0 4 2 C 7 7 ) 7
0 4 2 E 7 V 7 7
0 4 3 0 7 7 7 7
0 4 3 2 7 7 7 7
0 4 3 4 7 7 3 7
0 4 3 6 7 7 7
0 4 3 8 7 7 7 7
0 4 3 A 7 7 7 7
0 4 3 C 7 7 7 7
0 4 3 E 7 7 7 7
0440 7 7 7 7
0 4 4 2 7 7 7 7
HFG-TSTMEW-TOT
HEM-DONES
HEM-DONE0
I T I C 0
I N T I C sMENU-UP
D ON E 1 2 8
KEDONE
DE ?D U ?
DU ?
D U 7
D U 7
D U 7
D E 7
D E 7
D U
I N I T I A L I Z A T I O N F LA GU OR D E O U I V . T O H I G H E S T S EG M EN T I NMEMORYCURRENT SEGMENT VALUE FORBACKGROUND HEM TESTCURRENT OFFSET VALUE FORBACKGROUND HEM TESTS A V E A RE A FO R I N T E R R U P T I CR O U T I N E
F L A G T O I N D I C A T E U HE T H ER M EN U IS
ON SCREEN (FFZ YES , O=NO)COUNTER TO KEEP TRACK OF 1 2 8 BYT E
B L O C K S T E S T E D BY BGMEMTOTAL K OF MEMORY THAT H AS BEENTESTED BY BACKGROUND HEM TEST
.......................................POST DATA AREA
.......................................~O-ROM-INIT D U 7 , P O I N T R TO O PT I O N A L 1 1 0 ROM I N I T
IO-ROM-SEG DU 7 , P O I N T E R T O I O ROM SEGMENTPOST-ERR DE 7 , F L A G T O I N D I C A T E E R R OR O C CU R RE D
MODEM-BUFFER DE 9 D U P ( 7 ) , MODEM RESPONSE BUFFER
, R O U T I N E
, D U R I N G P O S T
, ( M A X 9 C H A R S )MFG-RTN DU 7 , P O I N T E R TO M F G O U T P UT R O U T I N E
DU......................................., S E R I A L P R I N T E R D A T A
&P-FLAG DUSP-CHAR DE 7
.......................................
, T H E F O L L O U IN G S I X E N T R I E S A RE, D A T A P E R T A I N I N G T O N E U S T I C K
NEU-STICK-DATA DU 7 , R I G H T S T I C K D E L A YDU -a , R I G H T B U T T O N A D E L A Y
DU , R I G H T B U T T O N E D E L A YD U 7 , L E F T S T l C K D E L A YDU , L E F T B U T T O N A D E LA YDU , L E F T B U T T O N E D E L A YDU 7 , R I G H T S T I C K L O C A T I O N
D U , UNUSED, UNUSEDU 7
DU 7 , L E F T S T I C K P O S T I T O NXXDATA ENDS
, D I S K E T T E D A T A A R E A
.......................................
DKDAT A SEGMENT AT 60H
NUM-DR I VE DED U A L DEO P E R A T I O N DED R I V E DETRACK DEHEAD DE
SECTOR DE
NUM-SECTOR DESEC DE, F OR MA T I DTK-HD-SC DE
7
7
7
7
7
7
7
7
7
E DUP(O, O, O , O) , TRACK, HEAD, SECTOR, NUH OF
; SECTOR, B U F F E R F O R R E A D A N D W R I T E O P E R A T I O NDK-BUF-LEN EQU 5 1 2 ; 5 1 2 E Y T ES IS E C T ORREAD-EUF DE D K -E U F- LE N D U P ( 0 )
UR I TE-EUF DE ( D K - B U F - L E N 1 2 ) D U P ( 6 D H , OEH)
I N F O F L A G SREQUEST-IN DB 7 , S E L E C T I O N C H A R A C T E RD K - E X I S T E D DE 7
DK-FLAG DE 7
RAN-NUM D U 7
SEEDD U
7
, S P E E D T E S T V A R I A B L E SDK-SPEED DU 7
T I M - 1 DU 7
T I M - L - I D U 7
T I M-2 DU 7
T I M-L-2 DU 7
FRACT-H D U 7
FRACT-L DU 7
PARTJYCLE DU 7
UHOLE-CYCLE DU 7
H A L F - C Y C L E DU 7
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 392/605
0444 ??0445 ??0446 ??0447 77
0448 ??
0449
00000000 4000 I
??1
4000
E RROR P A RA ME TE RS
~K-ER-OCCURED DE 7 ;ERROR HA S OCCURREDO K - E R L 1 DE ? ; C US T O M ER E RR O R L E V E LDK-ER-LP OB ? ; S E R V I C E E RR OR L E V E L
i NG-BYTE OB ? ; P ORT BO TO D E T E R M I N E U H l C H
D K D A T A E N D S
ERJTATUS-BYTE DB ? ;STATUS BYTE RETURN FROM INT ISHL A N G U A G E T A B L E
; L A NGA GE TO US E
.--------___-__-____--------------------V I D E O D I S P L A Y B U FF E R
~IDEO-RAM SEGMENT A T otwoonDB 16384 D U P C ? )
V IDE O-RA M E NDS.----------------------------------------
ROM RE S IDE NT CODE
0000
0000
00 I B00 ID00 I F
002I00230025
00280021
002c002E
0030
0035
00360037
00380039
0 0 3 A0038
0 0 3 C
00300030O O 3 F0041
0041
0041
0042
3 1 35 30 34 30 3336 20 43 4F SO 522E 20 49 42 40 203 1 39 38 3 1 2 C 3 139 38 33
0149 R0157 R0160 R
0186 RO I B A R
20 48 420147 RO A 4 7 R
OABB RO A 8 4 R
45 52 52 4F 524 1424344
45
4647
48
03780278
EFF7
0043
0043 BO 000045 E 6 A 00047 FE C 80049 E6 10
0048 E4 A 00040 F A
O O 4 E BE 108F
0051 8 1 OOCO0054 89 00040017 OA C 40059 E EOOSA 80 C 4 200050 E2 F8005F BO A 0
0061 E6 F20063 B A 0 3 D A0066 E C0067 BO 040069 EE
0 0 6 C EE0061 BO ai
ODE SEGMENT PAGEASSUME
OB '1504036 C O PR . I B M 1981,1983' ; C O P Y R I G H T N O T I C E
CS: CODE, O S : A B S 0 , E S : N O T H I N G , 5 5 : S T A C K
; R E T U R N P O I N T E R S F O R R T N S C A L L E D; B EF OR E S TA CK I N I T I A L I Z E D
ERROR-ERRHEM-ERRKEY-ERRCASS-ERRCOMI-ERRCOM2-ERRROM-ERRCART-ERR
D I SKJRR
;4 L A B E LDUDU
F4E L A B E LI M A S K S L A B E L
DBDB
OB 'ERROR' ; ENERAL ERROR PROMPTOB ' A ,
OB ' 8 '
OB ' C 'OB ' 0 'OB ' E 'DB 'F 'OB ' G '
DE en.
3 7 8 ~278n
UORD
UORDB Y T E
O E F HO F ~ H
; EMORY ERROR;K E Y B OA RD E RROR MS G;CA S S E TTE E RROR ME S S A GE;ON-B OARD S E R IA L P ORT E RR. MS G; S E R I A L P O R T I O N O F M OD EM E RR O R; O P T I O N A L G E N E R I C B I O S ROM ERROR; C A R T R I D G E E R R O R
; D I S K E T T E E R R
; P R I N T E R S O U R C E T A B L E
; I N T E R R U P T M A S K S F O R 8259; I N T E R R U P T C O N T R O L L E R; MODE M INTR MA S K; S E R I A L P R I N T E R I N T R M A SK
; S E T U PD I S A B L E N M I, M A S KA B LE I N T S .S OUND CM IP , A ND V IDE O.T U R N D R I V E 0 MOTOR OFF
A S S UME
.--------___________----------------------
CS: CODE, OS: BSO, E S : N O T H I N G , SS: S T A C KR E S E T L A B E L F A R
S TA RT: MOVOUTD E COUTI NC L I
MOV
MOVMOV
OUTADDL O O PMOV
L I : OR
AL.0'
OAOH, A LA L
AL , OAOHion, L
A X , I O B F H
OX, ooconcx, 4
An. 2014
A L . A HO X , A L
D I S A B L E S N M IS E ND FF TO MFG-TESTER
R E S E T N M I F I FD I S A B L E S M A S KA B LE I N T E R R U P TSD I S A B L E A T T EN U A T IO N I N SOU ND C H I PR EG A DD RE SS I N AH, A TTE NUA TOR OFFI N A L
4 A T T E N UA T O R S T O D I S A B L ECOMB INE RE G A DDRE S S A ND DA TA
P O I N T T O N E X T R E G
ADDRESS OF SOUND CHIP
. ------
OUTMQVI NMOVOUT
wovOUT
--_------
L 1
AL,UD-ENABLE+FDC_RESET , T U R N D R I V E 0 MOTOR OFF,
O F 2 H . A LDX,VGA-CTL , V I D E O G A T E AR R AY CONTROLAL, OX , SYNC VGA TO ACCEPT REGA L , 4 , S E T V GA RE S E T RE GDX, A L , S EL EC T I TA L , 1 , S E T A S V N C R E S E TOX, A L , R E S E T V I D E O G A T E A R R A Y
, E N A B L E T I M E R
.........................., T E S T 1
, D E S C R I P T I O NBOB8 P ROCE S S OR TE S T
V E R I F Y 8088 F L A G S , R E G I S T E R SAND C O N D I T I O N A L J U M P S
, MFC ERROR CODE o o o i n........................................
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 393/605
0 0 6 D 84 D 5006F 9 E0 0 7 0 73 4 C0072 75 4 A
0076 7 9 4 60078 9F0 0 7 9 81 050078 0 2 E C0 0 7 0 73 3F0 0 7 F BO 4 0
0081 D O EO0 0 8 3 7 1 39
0085 3 2 E 40 0 8 7 9 E -0088 76 3 4
0 0 8 A 78 3 20 0 8 C 7 A 30
008F 81 050091 0 2 E C0093 72 290095 D O E 40097 7 0 25
0 07 4 7 8 4 8
ooaE 9~
0099 BE FFFF0 0 9 C F90 0 9 0 8E D 8
009F 8 C D EO O A I B E C 3
O OA 3 8 C C 1O O A 5 B E 01
O OA 7 8 C 0 20019 8 B E 2OOAB 88 E COOAD 88 F5
OOAF 88 F E0081 73 07O OB 3 3 3 C 70085 7 5 0 70087 F B0088 E8 E 3OOBA 08 C 70 0 8 C 7 4 ocU O B E E A 0010O O C l BO 00O O C 3 E EO OC 4 4 2
O O C 5 E EOOC 6 FE C OO O C 8 E EO OC 9 F 4OOCA
OOCA BO F EOOCC E 6 10
OODO E 6 63
0 0 D 2 28 CO0 0 D 4 B A C 40 0 D 6 E 6 60OODB E 4 60
O OD A E 6 6 1O OO C E 4 6 1O OD E 3 A C 4OOEO 7 5 060 0 E 2 F E C 40 0 E 4 75 EE
0 0 E 6 E 8 05
OOCE BO a9
O O E ~ a3 02OOEA ~9 o9ac ROOED 32 COO OE F E 6 60O O F l E 4 6200F3 2 4 08
00F5 BO 18
00F7 75 02O O F 9 BO 3FO O F B E A O 3 0 FO O F E E EO O F F BO 000101 E 6 6 1
---_
i 2
L 3 .
L 4 .
L5
MOVS A H F
J N CJ N ZJ N PJ N SL A H FMOV
SHRJN CM O V
S H LJN O
XORS A H FJ B E
J SJ PL A H FMOV
SHRJ CS H LJ O
AH, ODSH
L 4L 4L 4
L 4
C L , 5
AH , C LL 4A L , 4 0 HAL , 1
L 4
AH, AH
L 4
L 4L 4
CL, 5AH, C LL 4AH, I
L 4
SET SF , C F , ZF , AN D AF FL AG S ON
GO TO ER R R OU TIN E I F C F N O T S E TGO T O E R R R O U T I N E I F Z F N O T S E TGO T O E R R R O U T I N E I F P F N O T S E T
GO T O E R R R O U T I N E I F S F N O T S E T
L O AO F L A G I M A G E T O A HL O AO C N T R E G W I T H S H I F T C N TS H I F T A F I N T O C AR RY B I T P O SG O T O E R R R O U T I N E I F A F N O T S E TS E T T H E O F F L A G O NS E T U P F O R T E S T I N GGO TO ER R R OU TIN E I F OF N OT SET
S E T A H 0C L E A R S F , C F , Z F , A N 0 P FGO T O E R R R O U T I N E I F C F ONGO T O E R R R O U T I N E I F Z F O NGO T O E RR R O U T I N E I F S F O NGO TO E R R R O U T I N E I F P F O NL O AO F L A G I M A G E TO A HL O AD C N T R E G W I T H S H I F T C N T
S H I F T ' A F ' I N T O C ARR Y B I T P OSGO T O E R R R O U T I N E I F ONC H E C K T H A T ' O F ' IS C L EAR
GO T O ER R R O U T I N E I F ONR E A O I W R I T E T H E 8088 G E N E R A L AN D S E G M E N T A T I O N R E G I S T E R S
W I T H A L L O N E ' S A N 0 ZE R O E S ' SM O V
S T CMOV
MOV
MOV
MOVM O V
MOV
MOV
MOV
MOV
MOV
J N CXORJ N ZC L CJM PORJ ZMOV
MOVOUTI NC
OUTI NCOUTH L T
A X , O F F F F H
OS, AXEX, D SES, E X
.cx, ES
ss, cx
SP, oxBP, S PS I , B P
DX, SS
DI,SIL3A X . 0 1L 4
L 2A X , O IL5OX, O O l O H
A L , 0
OX, ALox
O X , A LA L
O X , A L
S E T U P O NE ' S P A T T ER N I N AX
W R I T E P A T T E R N T O A L L R E G S
P A T T E R N M AK E I T T H R U A L L R EG SNO - GO T O E RR R O U T I N E
Z ER O P A T T E R N M A K E I T T H RU ?Y E S - GO T O N E X T T E S TH AN D L E ER R OR
ERROR 0 0 0 1
H A L 1
____________________-----_---------------, T E S T 2
, D E S C R I P T I O N
8255 I N I T I A L I Z A T I O N A N0 TE ST
F I R S T I N I T I A L I Z E 8255 PROGP E R I P H E R A L I N T E R F A C E P O RT S A & BAR E L ATC H ED OU TPU TB U F F E R S C IS I N P U T
, M FG E R R C OD E = 0 0 0 2 H
MOV
OUTM O V
OUT
SU BL6 MOV
OUTI NOUTI NCMPJ N EI NCJ N ZJM P
L7 M O V
JM PL8 XOR
OUTI NAN 0MOV
J N ZMOV
L9 MOVOUTM O V
OUT
AL , OFEHIOH. A LAL, MODE-E255CMD-PORT, A L
AX, AXA L , A HPORT-A, ALAL, PORT-APORT-8 , ALAL, PORT-EAL, AHL7A HL6
E L . 0 2 HE-MSGA L , A LK B P O R T , A LAL, PORT-CAL , 0000 10008AL , 1EH
L9A L . 3 F HDX, PAGREGOX, ALA L , OOOOllOlBPOR T-8 . A L
SHORT La
S E N 0 F E T O M FG
C O N F I G U R E S 110 P O R T S
T E S T P A T T E R N S E E 0 = 0000
W R I T E P A T T E R N T O P O R T AR EA 0 PATT ER N FR OM POR T AU R I T E P A T T E R N T O PO R T 8R EAD OU TPU T POR TD A T A A S E X P E C T E D ?I F N OT, SOM ETH IN G IS WRONGM AKE N EW D ATA PATTER NLO OP T I L L 255 P A T T E R N S D O N EC O N T I N U E I F DONES E T E R RO R F L A G (BH=OO NOW)GO E R R O R R O U T I N E
C L EA R K 8 P O R T
6 4 K C A R 0 P R E S E N T ?P O RT S E T T I N G F OR 6 4 K S V S
P O RT S E T T I N G FO R 1 2 8 K S Y S
I N I T I A L I Z E O U TP UT P O RT S
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 394/605
0103 EO F D
0105 E 6 100107 E A 0304O l O A BE F O A 4 RO l O D E 9 0010 900 1 1 1 32 E 4
0113 E A C 40115 E E
0116 42
0117 F E C 40119 2 E : E A 07O l l C E EO l l D 43O l l E 4 AO l l F E 2 F2
0121 E A 0 3 D A0124 E C
0125 E 9 00050128 32 E 40 1 2 A E A C 40 1 2 C E E0 1 2 D 32 CO012F E E0130 F E C 4
0132 E 2 F6
0134 E O F C
0136 E 6 10
0138 3 3 F6
0 1 3 A B C C BO l 3 C E E D O
0 1 3 E E E D B
0140 E 9 EO000 1 4 3 E C O O l E R
0 1 4 6 E 9 F EE E R
0 1 4 9 7 4 06
0 1 4 8 BE 0003
0 1 4 E E 9 0 9E C R
0151 E 9 BOOO
0 1 5 4 E 9 F E EE R0157 74 06
0159 BE 0 0 0 40 1 5 C E 9 0 9 E C R0 15F
015F EO F E0161 E 6 10
0163 E 9 0 4 0 00166 33 CO
0168 B E C O0 1 6 A E 9 0859 R0 1 6 D 7 5 19016F EO F A
0171 E 6 100173 E 9 0400
0176 E 4 600178 3 C 1E
0 1 7 A 88 OFEO0 1 7 D 7 4 02017F E 4 1F0181 E E C OO l e 3 E 9 O B 5 9 R
0186 7 4 23
-------------------_____________________-----------------------, PART 3
SET U P V I D E O G A T E A R RA Y AN D 6 8 4 5 T O GET MEMORY WORKING
----------______________________________-----------------M O V A L , O F D HO U T I O H , A L
M O V D X . 0 3 D 4 H , S E T A D D R E S S O F 6845M OV B X , O F F S E T V I D E O - P A R H S , P O I N T TO 6 8 4 5 P AR H S
M O V C X , M 0 0 4 0 , S E T P A R H L E NXOR AH, AH , A H IS REG X
O U T D X , A L
I N C D X , P O I N T T O D A T A P OR T
I N C A H , N E X T R E G V A L U EM OV A L , C S [ E X 1 , G E T T A B L E V A L U E
O U T D X , A L , O U T T O C H I PI N C EX , N EX T I N T A BL E
D E C D X , B A C K T O P O I N T E R R E GL OO P L I O
HOV DX, VGA-CTL , S E T A D D R E S S O F V G AI N A L, D X , B E SU R E A D D R I D A T A F L A G IS
H O V C X , 5 , X O F R E G I S T E R SXOR AH, AH , A H IS REG COUNTER
L I l M O V A L , A H , GET REG X
O U T D X , A L , S EL EC T I TX O R A L , A L , S E T Z E R O F O R D A T AO U T D X , A L
I N C A H , N E X T R E GL O O P L l 1
L10 MOV AL , AH , G E T 6 8 4 5 R EG rn
S T A R T V G A U I T H O U T V I D E O E N A B L E D
, I N T H E P RO PE R S T A T E
--_-----___----_________________________--------, T E S T 4
, D E S C R I P T I O NP L A N A R E O A R D R O S C H E C K S U M T E S T
A C H E C K S U M T E S T IS DONE FOR EACH ROSM O D U L E O N T H E P L A N A R E O A R D T O
M F G E R R O R C O D E = 0 0 0 3 H M O D U LE A T A D D R ES SFOOO 0000 ERROR
0 0 0 4 H M O D U L E A T A D D R E S SF B O O 0000 ERROR
................................................M O V A L , O F C HO U T I O H , A L , HFG 0UT:FC
XOR SI,SI , I N D E X O F F S E T U I T H I N S EG ME NT O F
MOV AX,CS , S E T U P S T A C K S E G M E N TMOV SS, AX
MOV DS, AX , L O A D DS U I T H SE G ME N T O F A D D RE S S
M O V C X . E O 0 0 H , N U ME ER O F B Y T E S TO B E T E S T E D , 3 2 KM O V S P , O F F S E T 21 , S E T U P S TA C K P O I N T E R SO T H A T
JMP ROS-CHECKSUM , J U M P T O R O U T I N E U H I C K P E RF O RM S
, CHECK MODULE AT FOOO 0 ( L E N G T H 3 2 K )
, F I R S T B Y T E
, S P A C E O F E I O S / E A S I C
, R E T U R N WILL COME HERE
, CRC CHECK
, OTHER MODULE AT FOOO BOOOL12 J Z L13 , MODULE AT FOOO 0 OK, GO CHECK
M O V E X , 0 0 0 3 H , SET ERROR CODEJMP E-MSG , I N D I C A T E E R R O R
JMP ROS-CHECKSUM , O F N EX T M OD UL E A T T H I S P O I N T I
MOV EX. OOO4H , I N D I C A T E E R R O R
JHP E-MSG
L13 MOV C X , B 0 0 0 H , LOAD COUNT ( 5 1 P O I N T I N G TO S TA R T
L14 J Z L15 , PROCEED I F NO ERROR
L 15. . . . . . . . . . .. . . . . . . . . . . .. . . . . . . . . . . .. . . . . . . . . . . . .
, T E S T 5
, D E S C R I P T I O NE A S E 2 K R E A D I U R I T E S TO RA GE T ES T
U R I T E I R E A D I V E R I F Y D A T A P A T TE R N SA A , 5 5 , A N D 00 T O 1 S T 2 K O F S T O R A G EA ND T H E 2 K J U S T B EL O W 6 4 K ( C R T B U F F E R )V E R I F Y S T O R A G E A D D R E S S A B I L I T YO N E X I T S E T C R T P A G E TO 3 S E TTEMPORARY STACK ALSO
, MFG ERROR CODE 04X X FOR SYSTEM EOARD HEM0 5 X X F O R 6 4 K A T T R l E CD H EM
0 6 X X F O R E RR OR S I N BO T H( X X r E R R O R B I T S 1
. . . . . . . . . . .. . . . . . . . . . . . .. . . . . . . . . . . .. . . . . . . . . . .
L 1 6 .
L I E :
L19.
MOVOUTMOV
XOR
MOVJ M PJ N ZMOVOUTMOV
I NCMPMOVJ EMOVMOVJ M PJ Z
AL , OFEHI O H , A LC X, 0 4 0 0 HAX, AX
ES, AXP O D S T GL20A L , O F A HIO H , A LC X , 4 0 0 H
AL, PORT-AA L , 1BH
AX, OFEOHL 18
AH, I F HES, AXP O D S T G
L23
S E T M F G F L A G Z F BS E T FO R I K UO RD S, 2 K B Y T E S
L O A D E S U l T H 0000 SEGMENT
BAD STORAGE FOUNDMFG OUTZFA
1 0 2 4 U O RD S T O B E T ES T ED I N TH E
R E G E N B U F F E RU H E R E IS T H E R E G E N B U F F E R 7T O P O F 6 4 K 7S E T P O I N T E R TO T H E R E I F I T IS
OR SE T P O I N T E R TO I O P O F l 2 B K
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 395/605
0180 1 7 040 1 8 A E 4 6 2O I B C 2 4 OBO l B E 7 4 060190 B A 0 9
0 1 9 2 OA DO0194 E B 1 20196 BO F C 020199 S A 09O l S B 7 4 OB0190 F E C 7019F OA DO
0 1 A 1 B O F C 0 10 1 A 4 74 02O M 6 F E C ?
0 1 A B E 9 OS BC R
O I A B BO F9O I A D E 6 10O I A F B 9 04000182 88 BBBO
0185 B E CO0187 E 9 OBSS RO I B A 7 4 06O I B C B E 0005O l B F € 9 OSBC R
O I C 2 BB 0030
O l C 5 B E DOO l C 7 B C 0100 RO I C A 33 COO l C C B E 08
0 C E
0104010701090 IDS
0 D 0O l D F0 E 20 E 40 E B
C 7 06 0 4 6 2 R 0007
BB 0040E 4 622 4 08BO IB75 os83 C 3 40BO OF89 I E 041s RA 2 0 4 8 A R
O l E E BE ---- RO l E E B E 08O l F O C 6 06 0005 R F B
O l F S E B E608 RO l F B C 7 06 0 0 2 2 R O A 6 1 RO l F E B C C B0200 A 3 0024 R
02030206
0 2 0 80 2 0 80200020F02 1202 1302 I502 1602 18
02 E0 2 2 I
022202230226
0229
0 2 2 A0 2 2 8022c
BE 0000B E 08
89 OOFF2 E F FB E c788 F B I S RABBC CBABE 2 F7C 7 06 0124 R 1090 R
E F 0040 ROEI FB E F F O 3 Re9 0010
A 5
4 747E 2 F B
0 2 2 E EF 02000231 B E 40000 2 3 4 89 0010
0237 A 5
L20: MOVI NANDJ ZMOVORJMP
L 2 1 . C M PMOVJ EI NCOR
CMPJ EI NC
an, o r nAL, PORT-CA L , 0000 O O O BL2 I
B L , C LBL, cnS HO RT L 2 2AH. 0 2E L . C LL22
'BnBL, cn
AH, 1
L 2 2an
ERROR 04G E T C O N F I G B I T S
T E S T F O R A T T R I B C A R D P R E S E N TU OR RY AB OU T O D D l E V E M I F IT IS
COMBI NE ERROR B I T S I F IT I S N ' T
E V E N B Y T E E R RO R ? E R R 0 4 X X
MAKE I N TO OSXX ERRM O V E A N D P O S S I B L Y C O M B I N EERROR B I T SODD BYTE ERROR
L 2 2 J M P E -M SG*ETEST n i t n 2~ USING BBOOO AD D C ESS P A T H
i 2 i nov AL.OFSH
M U S T H A V E B E E N BOTH- M A KE I N T O 0 6 X XJUMP TO ERROR OUTPUT ROUTI NE
OUT I OM, AL
MOV AX, OBBBOH
MOV ES,AXJMP PODSTC
M O V C X , O ~ O O H
L24 J Z L 2 5MOV ~ x ,o o o s n
i 2 5 nov A X , O O ~ O H
JMP E-MSG----- SETUP STACK SEG AND SP
MOV SS,AXMOV SP,OFFSET TOS ,XOR AX,AXMOV DS.AX
.__
MFG OUT =F9
I K U OR DS
D I R E C T A D D R E S S I N GPOINT TO AREA JUST TESTED w i n
ERROR 0005
G E T S T A C K V A L U E
S T A C K IS READY TO GOS E T U P D A T A SEG
SET THE STACK UP
,----- S E T U P C R T P A G E
, ---- S E T P R E L I M I N A R Y M EM OR Y S I Z E UO RDMOV D A T A - U O R D C A C T I V E - P A G E - D A T A I , 0 7
M O V E X . 6 4I N A L,P OR T -CAND A L , ~ B H , 6 4 K C A R D P R E S E N T 7MOV AL, Ian , P O R T S E T T I N G F O R 6 4 K S Y S T E MJ N Z L26 , S E T T O 6 4 K I F NOTA D D E X . 6 4 , E L S E S E T F O R 1 2 B KMOV AL . 3FH , P O R T S E T T I N G F O R 1 2 B K S Y S T EM
MOV DATA-AREACPAGD AT-DATA] , A LL 2 6 MOV DATA-YOROCTRUE-MEM-DATAI, B X
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ., P A R T 6
, D E S C R I P T I O N
I N T E R R U P T S
3 2 IN T ER R U PT S ARE I N I T I A L I Z E D T O P O I N T T O ADUMMY HAND LER THE BIOS I N T E R R U P T S AR E L O A D EDD I A G N O S T I C I N T E R R U P T S A RE L O AD E DS Y S T E M C O N F I G U R A T I O N U O R D IS P U T I N M EM OR YT H E D UM MY I N T E R R U P T H A N D L E R R E S I D E S H E R E
ASSUME OS XXDATAMOV AX, XXDA TAMOV DS,AXMOV MFG-TST,OFBH , SET UP MFG CHECKPOI NT FROM THIS
C A L L M F G U P U P D A T E MFG C H E C K P O I N T
MOV AX,CSMOV MFC_RTN+2 , AX , SET DOUBLEUORD POI NTER TO MFG
, ERROR OUTPUT ROUTI NE SO D I A G S, D O N ' T H A V E TO D U P L I C A T E C O D E
___-__-____--___________________________---------------
, P O I N T
nov M F C ~ R T N ,OFFSET m i c - 0 ~ ~
ASSUME CS CODE,DS A B S 0MOV AX. 0MOV DS,AX
, ---- S E T U P T H E I N T E R R U P T VE C T O RS T O T EM P I N T E R R U P T
M O V C X . 2 5 5 , FILL A L L I N T E R R U P T SS U B D 1 , D I , F I R S T I N TE R R U PT L O C A T IO N IS 0000MOV ES. 01 , S E T E S = 0 0 0 0 A L S O
STOSUMOV AX,CS , GET ADDR OF I NT R PROC SEGSTOSUL O O P D 3 , V E C T B L OM OV E X S T , O F F S E T E X T A B , S E T U P E X 1 S C A N T A B L E
M OV D 1 , O F F S E T V I D E O - I N 1 , S E T U P V ID E O I N 1
POP OS , P LA CE CS I N D SMOV SI, F F S E T V E C T O R - T A B L E + I 6MOV CX, 16
03 MOV AX, OFFSET D l l , MOVE ADDR OF I NT R PROC TO T B L
, S E T U P BIOS I N T E R R U P T S
P u s n cs
0 4 MOVSU , MOVE I NTER RU PT VECTOR TO L O U, MEMORY
I N C D II N C DI , P O I N T TO NEXT VECTOR ENTRYLO OP 0 4 , R E P E A T F O R A L L 16 BIOS I N T E R R U P T S
, S E T U P D I A G N O S T I C I N T E R R U P T SMOV D1,OZOOH , START u iTn INT eonMOV S1 , DI AG-TABLE-PTR , P O I N T TO E N T R Y P O I N T T A B L EMOV CX, 16 , 16 E N T R I E S
05 MOVSU , MOVE I NTER RU PT VECTOR TO L O U, MEMORY
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 396/605
0239 470239 470 2 3 A E2 F B0 2 3 C 8 E D 9023E C 7 0 6 0 2 0 4 R 1863 R0244 C 7 06 0208 R I A 2 A R0 2 4 A C 7 06 0224 R 1 B A 5 R
0250 88 1118
0253 E4 620255 24 08
0257 75 030259 80 C B 040 2 5 C 89 1E 0410 R
0260 E 8 E 6 0 8 R
0263 BO 13
0265 E 6 200267 BO 08
0269 E6 210268 BO 09
0 2 6 D E 6 2 1
026F B O 00
0271 B A D E0273 E 6 2 10275 E 4 2 10277 OA CO0279 75 180278 80 FF0270 E6 2 1027F E 4 2 1
0281 04 0 1
0283 75 OE
0285 F B
0286 89 0050
0289 E 2 F E0288 E A I E 0 4 8 4 R
028F OA DE
0291 74 05
0293 87 070295 E9 OSBC R0298
0298 80 EO0 2 9 A E 6 F20 2 9 C BO A 0O 29 E E 6 F 2
I N C DI
I N C 01 , P O I N T T O N E X T V E C T O R E N T R YLOOP DS , R E P E A T F O R A L L 16 1105 I N T E R R U P T SMOV DS, CX SET DS TO ZEROMOV I N T B I , O F F S E T L O C A T E 1M OV I N T B 2 , O F F S E T P R N T 3MOV I N T 8 9 , O F F S E T J O V S T I C K
, ---- S E T U P D E F A U L T E O U I P M EN T D E T E R M I N A T I O N U OR D
B I T 15, 14 = N U MB ER O F P R I N T E R S A T T A C H EDB I T 13 1 5 S E R I A L P R I N T E R P R E S E N TB I T 12 = GAME 110 A T T A C H E D8 1 1 11.10.9 = N U MB ER O F R S 2 3 2 C A R D S A T T A C H E D
B I T 7.6 = N UM BE R O F D I S K E T T E D R I V E S
B I T 5 . 4 = I N I T I A L V I D EO M ODE
BT e = DMA (O=DMA PRESENT, NO DM A ON SYSTEM
00=1, 01=2, 10~3, 1=4 ONLY I F B I T 0 = 1
00 - UNUSED0 1 - 4 0 x 2 5 BU US I NG COLOR CARD
11 - 90x25 8U U S I N G 8U CARDio - e o x m BU USNG COLOR CARD
. I BIT 3.2 = P L A N A R R A M S I Z E ( 1 0 = 4 8 K , l l = 6 4 K )B I T 1 NOT USEDB I T 0 = 1 ( I P L D I S K E T T E I N S T AL L ED )
A S S U M E C S C O D E ,D S A B S 0
M OV B X . 1 1 1 8 H , D E F A U L T C A M E IO , 4 0 x 2 5 . N O D MA, 4 B K ON
I N A L,P OR TJ
AND AL , O8H , 6 4 K C A RD P R E S E N TJ N Z D S 5 , NO, JUMPO R B L . 4 , S E T 6 4 K O N P L A N A R
..................................................
, P L A N A R
DFL5 MOV DATA-UORDCEQUIP-FLAG-DATA1,BX
, T E S T 7I N I T I A L I Z E AN D T E S T T H E 8 2 5 9 I N TE R R U P T C ON TR OL LE R C H I P
, M F G E RR C O DE 0 7 X X ( X X= O O, D A T A P A T H OR I N E R N A L F A I L U R E ,X X Z A N V O TW E R B I T S O N =U N EP EC T ED I N T E R R U P T S
...............................................................
CALL MFG-UP , M F G C O D E z F 7ASSUME DS A8SO. CS CODEMOV AL , 13 H , I C U l - R E S E T E D G E S E N S E C I R C U I T ,
, S E T S I N G L E 8 2 5 9 C H I P A ND I C U 4 RE ADOUT I NTAOO, A L
MOV A L , ~ , I C U 2 - S E T I N T E R R U P T T Y P E 8 (8 -F)O U T I N T A O 1 , A LMOV AL , 9 , 1 C U 4 - S E T B U F F E R E D M O D E / S L A V E
O U T I N T A O 1 , A L
T E S T A B t L I T Y TO U R I T E / R € A D T H E M AS K R E G I S T E R
M O V A L . 0 , U R I T E Z ER O ES TO I M RM O V 8 L . A L , P R E S E T E R R O R I N D I C A T O ROUT I NTAO 1, A L , D E V I C E I N T E R R U P T S EN A B LE DI N A L , I N T A O l , R E A D I M RO R A L . A L , I M R = 07
J N Z G E R R O R , NO - GO T O E R R O R R O U T I N EMOV AL , OFFH , D I S A B L E D E V I C E I N T E R R U P T SO U T I N T A O 1 , A L , U R I T E O N E S T O I M RI N A L , I N T A O l , R E A D I M R
ADD AL, 1 , A L L I M R B I T S ON 7
JNZ GERROR , NO - GO T O E R R O R R O U T I N E
C H EC K F O R H O T I N T E R R U P T S
, AND B O 8 6 MODE
...............................................................
...............................................................
, (ADD SHOULD PRODUCE 0 )
...............................................................
I N T E R R U P T S A R E M A S K ED O F F N O I N T E R R U P T S S H O U LD O C CU RST I , E N A B L E E X T E R N A L I N T E R R U P T S
MOV CX,5OH
MOV EL , DATA-AREAC I NT k-FL AG- DA TA1 , DID A N Y I N T E R R U P T S
O R B L , B LJ Z - E ND - TE S T G , NO - GO T O N E X T T E S T
JMP E-MSG
H O T l L OO P H O T l W A I T F OR A NY I N T E R R U P T S
, OCCUR?
GERROR MOV BH , 07H , S E T 07 S E C T I O N O F E R RO R M SG
END-TESTG, F I R E T HE D I S K E T T E U AT CH DO G T I M E R
MOV AL,UD-ENABLE+UD-STROBE+FDC-RESETO U T O F 2 H , A LMOV AL, UD-ENABLE+FDC -RESETO U T O F 2 H , A LASSUME CS CODE, DS A B S 0
8 2 5 3 T I M E R C H EC KO UT
V E R I F Y T H A T T H E T I M E R S ( 0 . I , AND 2) F U N C T I O N P R O P E R L YT H I S I N C L U D E S C H E CK IN G F O R S T UC K B I T S I N A L L T HE T I M E R ST H A T T I M E R 1 R E S P O N D S T O T I M E R 0 O U T P UT S , T H A T T I M E R 0I N T E R R U P T S U H E N I T S HO UL D, A ND T H A T T I M E R 2 ' 5 OUTPUT UORKSA S I T S H OU LDTHERE ARE 7 P O S S I B L E E R R O R S D U R I N G T H I S C H E C K O U TE L V A L U E S F O R T H E C A L L T O E-M SG I N C L U D E0 ) S TU CK B I T S I N T IM E R 0
1) T I M E R I D O E S N O T R E S P O N D T O T I M E R 0 OUTPUT2 ) T IM E R 0 I NTERRUPT DOES NOT OCCUR3) ST UC K B I T S I N T IM E R 1
4 ) T IM E R 2 O UT PU T I N I T I A L VA LU E IS N O T L O U5 ) ST UC K B I T S I N T IM E R 26 ) T I M E R 2 O U T P UT D O E S N OT G O H I G H O N T E R M I N A L C O UN T
..................................................................
, D E S C R I P T I O N
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 397/605
0 2 A O E 8 E 6 D B R0 2 A 3 B e 0 1 7 60 2 A 6 BE F F F F0 2 A 9 E E F F E O R0 2 A C BE 0036
0 2 A F E B F F E O R
0 2 8 2 BO 2 00 2 8 4 E 6 A 0
0 2 8 6 84 000 2 B B E 8 0 3 6 C R0 2 8 8 73 05O2BD 83 000 2 B F E 9 0 3 6 2 R
0 2 c 20 2 C 2 E 4 4 1
0 2 C 4 B A EO0 2 C 6 E 4 4 1O Z CB 3 D F F F FO Z C B 75 05
0 2C D 6 3 0 1
0 2 C F E 9 0 3 6 2 R
0 2 0 20 2 D 20 2 D 30 2 D 50 2 0 70 2 0 80 2 D D0 2 E 00 2 E 0
0 2 E 50 2 E 70 2 E 90 2 E B
0 2 E D0 2 E D
O 2 E E0 2 F I0 2 F 20 2 F 4O 2 F 60 2 F B0 2 F A0 2 F C
0 3 0 2
0 3 0 E0 3 0 A0 3 0 C
F BE 4 2 12 4 F E2 0 0 6 0 4 8 4 RE 6 2 1E 9 F F F F
F6.D6 0 4 8 4 R 0 1
7 5 0 6E 2 F 7E 3 0 2EB 75
F A
B A 0201EC2 4 F O3c 10
7 4 0 4OA CO7 5 I1C 7 06 0020 R 1 8 E D R
C 7 06 0070 R I B B D R
B O F EE 6 2 1F B
030D BO 00O 3O F E 6 A 0
0311 E 4 0 10313 € 8 0 3 6 C R0316 73 040318 83 030 3 1 A E B 4 6
03 I C0 3 1 C BE 0 2 8 60 3 1 F BE F F F F0 3 2 2 E E F F EO R
I N I T I A L I Z E T I M ER I A N D T I M E R 0 F O R T E S T
CALL MFG-UP , M F G C K P O I N T = F 6M O V A X . 0 1 7 6 H ; S E T T t M E R I TO MODE 3 B I N A R YMOV EX, OFF FFH , I N I T I A L COUNT O F F F F FC A L L I N I T - T I M E R , I N I T I A L I Z E T I M ER IM O V A X , 0 0 3 6 H , S E T T I M E R 0 T O MODE 3 B I N A R Y
C A L L I N l T J l M E R , I N I T I A L I Z E T IM E R 0
S E T B I T 5 OF PORT A0 SO T I M E R I C LO CK U I L L B E P U LS E D B Y THE
T I M E R 0 OUTPUT RATHER THAN THE SYSTEM CLOCK.
MDV AL, 00 O O O O O B
O U T 0 A O H . A L
; I N I T I A L COUNT O F F F F F
..................................................................
C HEC K I F A L L EITS GO O N AN D O F F I N T I M E R 0 (CHECK FOR STUCKBITS)
._______________________________________---------------------------
MOV A H , O ; T I M E R 0CALL B I TS-ON-OFF , L E T S U B R O UT IN E C HE CK I TJ N B T I M E R I - N Z ; N O S T UC K B I T S ( C A R R Y F L A G N O T S E T )MOV BL,O ; S T U C K B I T S IN T I M E R 0JM P T I MER-ERROR
S I N C E T I M E R 0 H A S COMPLETED AT LE AS T ONE COMPLETE CYCLE,T I M E R I SHOULD BE N O N -Z E R O. C H EC K T H A T T H I S IS THE CASE.
.___--________-__-__-----------------------------------------------
.____-____--_--__-__-----------------------------------------------
;I M E R ~ - N Z :I N AL, T I M E R + I ; R E AD L S B O F T I M E R I
MOV AH,AL ; S A V E L S BI N A L ,T I M ER + I ; READ MSB O F T I M E R I
CUP AX, OFF FFH ; S T I L L F F F F ?J N E T I M E R O - I N T R ; NO - T I M E R I HAS BEEN BUMPEDnov B L , I ; T I M E R I UAS NOT BUMPED B Y T I M E R 0JMP TIMER-ERROR
C H E C K F O R T I M E R 0 I N T E R R U P T
.___________________-----------------------------------------------
.--__-___________-______________________---------------------------
; IMERO-INTR:S T I ; E N A B L E M A S KA B LE E X 1 I N T E R R U P T SI N A L , I N T A O lAN D A L , O F E H M AS K A L L I N T R S E X C E PT L V L 0
OUT I NTAO I , A L ; U R I T E T H E E 2 5 9 I M RMOV CX, OFF FFH ; SET LOOP COUNT
T E S T D A T A - A R E A t I N T R - F L A G - D A T A 1 , l ' T I M E R 0 I N 1 O CC UR ?
LOOP UAI T- I NTR-LOOP ; U A I T FO R I N T R F OR S P E C I F I E D T I M EMOV BL , 2 ; T I M E R 0 I N T R D I D N ' T O CC URJMP SHORT TIMER-ERROR
H O U S E K E E P I N G F O R T I M E R 0 I N T E R R U P T S
AND DATA-AREA[ I NTR-FLAG-DATA], L ; CLEAR I NT RECEIVED
UAI T- I NTR-LOOP:
JNE RESET-INTRS ; YES - CONTI~UE
._______________________________________---------------------------
.--------_--_--_--_------------------------------------------------
k E S E T - I N T R S :C L I
M O V D X , 2 O I HI N A L,D X ; GET MFG. BITSAND AL,OFOHCUP AL, IOH ; SYS TEST MODE?J E D 6OR AL , AL , OR BURN- I N MODEJ N Z T I M E - I
S E T T I M E R I N T . T O P O I N T T O M FG H E AR T BE A T R O U T IN E I F I N M FG MO O€
D 6 : MOV I NT-PTR, OFFSE T MFG-TICK ; S E T T O P O I N T T O M F G .
; R O U T I N E
; F O R D I A G S . U S EMOV I NTI C -PTR , OFF SET MFG-TICK ; A L SO S ET US ER T I M E R I N 1
MOV AL , OFEHO U T I N T A O 1 , A LST I
R E S E T D 5 O F P O RT A 0 SO T H A T T H E T I M E R I C LO CK U I L L BEP U L S E D B Y T H E S Y S T E M C L OC K .
..................................................................
.-__-_--_---------_------------------------------------------------
T I M E - I : M OV A L , O ; MAKE AL = 00OUT 'OAOH, AL
C HE CK FO R S TU CK E I T S I N T I M E R I
MOV AH, I ; T I M E R IC A L L B I TS-ON-OFFJ N B T I M E R 2 - I N I T ; NO S TU C K B I T SMOV B L 3 . ST UC K B I T S I N T lM E R I
.----_--_--__--_--_______________________--------------------------
.------------------------------------------------------------------
JMP S H ~ R T I E R-E RRO~
.------------------------------------------------------------------I N I T I A L I Z E T IM E R 2
.----_--_--__-__-__-____________________---------------------------
i IM E R 2 - I N I 1:
MOV AX, 02B6H ; S E T T I M E R 2 TO MODE 3 B I N A R YMOV E X , O F F F F H ; I N I T I A L C OUNTC AL L I N I T T I M E R
S E T PB O OF P OR T-B O F E 2 5 5 ( T I M E R 2 G A T E )
I N A L,P O RT J ; C U R R E N T S T A T U SO R A L , 0 0 0 0 0 0 0 1 B ; S ET B I T 0 - L E A V E O T H E R S A L O N EOUT PORT-B, AL
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.----------_--_--_-------------------------------------------------0 3 2 5 E 4 6 10327 OC 0 10329 E 6 6 1
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 398/605
0 3 2 E E 4 02O 3 2 D E 8 0 3 6 C R
0330 73 040332 E 3 050 3 3 4 E E 2 C
0336
0336 E 4 ’ 6 1
0338 24 F E0 3 3 A E 6 6 10 3 3 C BE 0280033F BE OOOA0 3 4 2 E 8 F F EO R
0345 E 4 620347 2 4 200349 7 4 040348 E 3 0 40 3 4 D E E 13
O 3 4 F E 4 6 1
0351 OC 0 1
0353 E 6 6 1
0355 E 9 O OO A0 3 5 8 E 2 F E0 3 5 A E 4 6203% 2 4 200 3 5 E 75 570360 E 3 06
C HE CK F O R S TU CK E I T S I N T IM E R 2
M OV AH .2 , T I M E R 2C A L L E1 TS-ON-OFF
J N E R E I N I T - 1 2 ; NO ST UC K B I T SM O V E L . 5 , S TU C K B I T S I N T IM E R 2JM P SH OR T T IM ER -ER R OR
R E - I N I T I A L I Z E TI M E R 2 U I T H MO DE 0 AND A SHORT COUNT
. ..................................................................
. ..................................................................
k E N I 7-72 :
; D R OP G A T E T O T I M E R 2
I N A L, PO RT -E ; C U R R E N T S T A T U S
AND AL, lllllllOE , R ES ET B I T 0 - L E A V E O T H E R S A L O N EOUT PORT-E, A L
M OV AX,OPEOH ; S E T T I M E R 2 TO MODE 0 B I N A R Y
MOV EX,OOOAH ; I N I T I A L CO UN T OF 10
C A L L
C H E CK P C S O F PO RT -C O F E 2 5 5 T O S E E I F T H E O U T P U T O F T I M E R 2IS L O U
I N A L, PO R T- C ; C U R R E N T S T A T U SA N D A L . 0 0 1 0 0 0 0 0 E ; M AS K O F F O TH ER B I T S
M O V E L . 4 . P C 5 O F P O RT C U AS H I G H U H E N I T
I N I T-T I MER
J Z C K2 -O N ; I T ‘ S L O U
JMP SHORT TIMER-ERRO~ , SHOULD HAVE BEEN LOU; T U R N G A T E B A C K O N
C K 2- ON : I N A L , P O RT -E , C U R R E N T S T A T U SOR AL,OOOOOOO1E ; S ET B I T 0 - L E A V E O T H E R S A L O N E
OU T POR T- E, A L
C H EC K P C 5 OF PORT-C TO SEE I F T H E O U T P U T O F T I M E R 2 GOESH I G H
M O V C X , 0 0 0 A H ; U A I T F O R O U T PU T GO H I G H , S H OU LC
I N A L, PO RT -C ; C U R R E N T S T A T U SAND AL,OO1OOOOOE ; M AS K O FF A L L O T HE R 8 1 1 5
J N Z P O D I 3 - E N D , I T ’ S H I G H - U E ’ R E D O N E ’
M OV EL , 6 ; T I M E R 2 O U TP U T D I D N O T GO H I G H
E 2 5 3 T I M E R E RR OR O C CU R RE D . S E T EH U I T H M A J O R E RR ORI N D I C A T O R A ND C A L L E -M SG T O I N F O R M T H E S Y S T E M O F T H E E R R O R( E L AL R E A D Y C O N T A I N S T H E M I N O R ER RO R I N D I C A T O R T O T E L L
U H I C H P A R T O F T HE T E S T F A I L E D )
C K I I L O : L O OP C K2 -L O ; B E L ON GE R T H A N I N I T I A L C OU NT
03620362 E 7 08
0364 E8 0 9 B C R
0367 E E 4 E
TIMER-ERRORM O V E H . 8 , T I M E R E RR OR I N D I C A T O RC AL L E- M SG
JM P SH OR T POD I3 - EN D
B I T S O N l O F F S U BR O UT IN E - U S E D F O R D E T E R M I N I N G I F AP A R T I C U L A R T I M E R ’ S B I T S GO O N AN D O F F A S T H E Y SH O UL D
T H I S R O U T I N E A SS U ME S T H A T T H E T I M E R IS U S I N G B O T H TH E L S EAND THE MSE
( A H ) = T I M E R N U M B E R ( 0 , 1, OR 2 )
( C F I = I I F F A I L E D( C F ) = 0 I F P A S S E DR E G I S T E R S A X , E X , C X , D X , D I , A ND 51 A R E A L T E R E D
..................................................................
, C A L L I N G P A R A M E T E R
, R E T U R N S
03690369 000 3 6 A 400368 80
0 3 6 C0 3 6 C 33 D E0 3 6 E 33 F60370 E A 0 0 4 0
0373 02 040375 E F 0 3 6 9 R0378 32 CO0 3 7 A E 6 C 40 3 7 C 03 F E
O 3 7 E0 3 7 E E 9 0008038 I
0381 5 1
0382 E 9 FFFF
03850385 2 E E A 050388 E 6 4 30 3 E A 500388 58
0 3 E C E C0 3 8 0 OB F6O 3 E F 7 5 OD0391 OC 0 10393 O A D E0395 E C0396 OA F E
0398 8 1 F E FFFF0 3 9 C E E 0 7
LATCHES ABEL BYTEDE oonD E 4 D HD E E O H
, L A T C H MA S K F O R T I M E R 0
; L A T C H MA S K F O R T I M E R 1
, L A T C H M AS K F O R T I M E R 2
E I TS-ON-OFFXORXORMOVADDMOVXORXCHGADD
, I S 1 P A SS -2 N D P A S S -
~UTER-LOOPMOV
P U S H
MOV
MOV
OUTP U S HPOP
I NOR
J N EORORI NORCMPJ M P
I NNER-LOOP
TST- E1 TS
PR OC N EARE X , E X , I N I T I A L I Z E E X R E GI S TE RS 1 , S I , 151 P A S S - SI I 0
D X , T I M E R , E A S E P O R T A DD R E S S F O R T I M E R SD L , A HD 1 , O F F S E T L A T C H E S , S E L E C T L A T C H M A S K
A L , A L , C L E A R A LA L , A H , A H -> A L
D I , A X , T I M E R L A T C H M AS K I N D E XC H E C K S F O R A L L B I T S TO COME ONC H EC K S F O R A L L B I T S T O GO OFF
CX, E
c xC X , O F F F F H
A L, CS C D I IT I M - C T L , A L
AXAX
A L , D X .
SECONDA L, O I H
EL, A LAL , D XE H , A LE X , O F F F F HSHORT TST-CMP
SI, I
OU TER L OOP C OU N TER
S A V E O U T E R L O O P C O U N T E RI N N E R L O O P C O U N T E R
T I M E R L A T C H M A SKL A T C H T I M E R
P A U S E
R E A D T I M E R LSB
S E C O N D P A S ST U R N L S B I T ONT U RN ‘ O N‘ B I T S O NR E A D T I M E R M S ET U RN ‘ O N ’ E I T S O NA RE A L L T I M E R B I T S O N?D O N ‘ T C H AN G E F L A G S
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 399/605
0 3 9 EO 3 9E 2 2 D E0340 EC0 3 A l 2 2 F E0 3 A 3 OB D E0 3 A 50 3 A 5 74 070 3 A 7 E 2 DC0 3 A 9 590 3 A A E 2 0 50 3A C F 9O 3 A D C 3
0 3 A E0 3 A E 590 3 A F 4 603B O E3 FE 0 20383 75 C 903B5 F E0386 C 303870387
= AOAC
= C 4 6 0
= OOCE
0387 E E E 6 D E R0 3 E A F A03EB EO 70O3BD E6 430 3 B F E 9 90000 3 C 2 E 2 F E0 3 C 4 EO 00
0 3 C 6 E 6 4 10 3 C E 2 E COO3CA CD 100 3 C C B E 05070 3 C F C D 100 3 0 1 E A 0 3D A0304 2 8 C 9
0306 EC0307 AE 080309 75 060 3D E E 2 F 90 3 D D E3 000 3 D F E E 4 C
0 3 E l 3 2 CO03E3 E 6 4 103ES ZE DE
0 3 E 7 33 C 90 3 E 9 E C0 3 E A A E 08
0 3 EC 7 4 06O 3E E E 2 F 903F0 E3 01
0 3 F 2 E E 39
03F4 2 E C 9O 3 F 6 E C0 3 F 7 A E 01
0 3 F 9 75 OA
0 3 F E AE 08
0 3 F D 75 2 20 3 F F E 2 F S0401 83 020403 E E 29
0 4 0 5 A 8 08
0407 7 4 040409 E3 0 30408 E B 2 0
0 4 0 0 2 8 C 9040F EC0 4 1 0 A 8 0 1
0 4 1 2 7 4 060 4 1 4 E 2 F S0 4 1 6 83 040 4 1 8 E E 13
0 4 1 A 430 4 1 8 7 4 0 40 4 1 0 A B 08
0 4 1 F 7 4 0 3
SECOND :
ANDI NANDOR
J ELOOPPOPLOOPS T CR E T
POPI NCCMPJ N EC L CR E T
BITS-ON-OFFPOD l3 -END :
TST-CMP:
CHKJND :
. ___----__- --.
E L , A LAL, OXBH, A LE X , E X
CHKJNDTST-E1 TScxI N E R L O O P
cxSI5 1 . 2O U T E R L O O P
ENDP
_-----__---_-_-CRT ATTACHMENT
; C HE CK F O R A L L B I T S O F F; READ MSB; T UR N OF F B I T S; A L L O F F ?
; YES - S E E I F DONE; K E E P T R Y I N G; RESTORE OUTER LOOP COUNTER; T R V A G A I N; A L L T R I E S E X H A U S T E D - F A I L E D T E S T
; POP FORMER OUTER LOOP COUNTER
; C H EC K F O R A L L B I T S TO GO O F F
; T I M E R B I T S AR E U O R K IN G P R O P ER L Y
; 1. I N I T C RT TO 4 0 x 2 5 - EU
; 2 . C H E C K F O R V E R T I C A L AN D V I D E O E N A B L E S , A N D C H EC K; T I M I N G O F SA ME; 3 . C H EC K V E R T I C A L I N T E R R U P T; 4 . C H E C K R ED , B L U E , G R EE N, A ND I N T E N S I F Y D O T S; 5. I N I T TO 4 0 x 2 5 - COLOR; MFG. ERROR CODE OSXX (XX -SEE COMMENETS I N CODE)
A A V T E a u OAOACH ; M A X IM U M T I M E F O R V E R T l V E R T
MIVT E a u 0 ~ 4 6 0 ~ ; M I N I M U M T I M E F O R V E R T l V E R T
; N O M IN A L T I M E I S B 2 E 6 H F OR 60 hZ .
,___________________------------------------------------
; ( N O M I N A L + 1 O X )
; ( N O M I N A L - 1 0 X )
EPF E a u 2 0 0
CALL MFG-UPC L I
MOVO U T T I M - C T L , A LMOV CX,EOOOH
MOV AL,OOHO U T T I M E R + I , A LS U E A X , A XI N T IOHM O V A X , 0 5 0 7 HI N 1 IOH
MOV DX,OODAHS U E C X , C X
A L , 0 I I lOOOOB
a i : LOW a i
; L O O K F O R V E R T I C A L9 2 : IN AL,DX
T E S T A L , O O O O l O O O BJNE a3LOOP a 2
JMP SHORT a i l sM O V E L . 0 0
; G O T V E R T I C A L - S T A R T T I M E Ra3: XOR AL,AL
O UT T I M E R + l , A LS U E E X , E X
XOR CX,CX
T E S T A L , 0000 O O O E
; U A I T F O R V E R T I C A L T O GO A UA V
a4: IN A L , D X
JZ asLOOP a4
; NUMBER OF ENABLES PER FRAME
; M F G C H E C K P O I N T = F S
; S E T T I M E R I TO MODE 0
; U A I T F O R M OD E S E T T O " T A K E "
; S EN D F I R S T B Y T E T O T I M E R; S E T M O D E 4 0 x 2 5 - BU
; S E T T O V I D E O P A G E 7
; S E T A D D R E S S I N G T O V I D E O A R R A Y
; G E T S T A T U S; V E R T I C A L T H E R E V E T ?; C O N T I N U E I F I T IS; K E E P L O O K I N G T I L L C O UN T E X HA U S T E D
; N O V E R T I C A L = ERROR 0900
; S E N D 2 N D B Y T E T O T I M E R T O S T A R T; I N I T . E N A B L E C OU NT ER
; G E T S T A T U S; V E R T I C A L S T I L L TH ER E?;
C O N T I N U E I F I T ' S GO NE; K E E P L O O K I N G T I L L C O UN T E X H AU S T E DM O V B L , O I HJMP SHORT a i 1 5 ; VERTICAL STUCK ON = ERROR 0901
; N OU S T AR T L O O K I N G F OR E N A B L E T R A N S I T I O N S
a6: IN AL,DX ; G E T S T A T U Sas: SUE cx,cx
TEST AL,OOOOOOO1E ; E N A B L E O N V E T ?JNE a7
JNE a i lLOOP a6
JMP SHORT 0115
JZ ae
T E S T A L , OOOOl OOOE
MOV E L , O Z H
, M A K E S U R E V E R T I C A L U E N T O F F UI07: T E S T A L , OOOOl OOOB
MOV EL , OJHJMP SHORT Q l l S
, N OU U A I T F O R E N A B L E TO GO O F Fa8 SUE c x .c xas: IN
T E S TJ ELOOPMOVJMP
. E N A B L E H A S010 I N C
J ZT E S T
J Z
GO ON I F I T ISV E R T I C A L O N A G A I N ?C O N T I N U E I F I T I SK EE P L O O K IN G I F N O T
E N A B L E S TU C K O F F = E R R O R 0 9 0 2
V E R T I C A L O F F ?GO ON I F I T IS
V E R T I C A L S T U C K O N = ERROR 0903
H E N A B L E G O I N G O N
AL; OX GET STATUSA L , O O O O O O O l E ; E N A B L E O F F V E T ?a i o ; PROCEED I F I T ISas ; K E EP L O O K I N G I F N OT V E T L O UE L , 0 4 HSHORT ai15 . ENABLE STUCK ON = ERROR os04
TOGGLED. BUMP C O U N T ~ RAND TEST FOR NEXT VERTICALE X ; BUMP EN ABL E COUNTERa i 1 ; I F COUNTER URAPS, ERRORAL,OOOO1OOOB ; D I D E N A B L E GO L O U B E C A U S E O F
a5 ; I F NOT, LOOK FOR ANOTHER ENAB LE; V E R T I C A L ?
; TOGGLE
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 400/605
0421 EO 400423 E6 430425 E 1 F E O OC E
0429 74 040428 E 3 050420 E E 74042F E 4 4 10431 E A E O0433 900 4 3 4 E 4 4 10436 E6 EO
0438 F E
0439 900 4 3 A 30 AOAC0 4 3 D 70 04
043F E3 060441 E E 60
0443 30 C 4 6 00446 7 E 04
0448 E 3 070 4 4 A E E 57
0 4 4 C 2 B C 9044E E4 2 10450 24 D F0452 E 6 2 10454 20 06 0484 R0458 F E0419 F6 06 0484 R 2 0
045E 75 060460 E2 F70462 E3 08
0464 E E 30
0466 E 4 2 10468 OC 200 4 6 A E 6 2 1
0 4 6 C BE 0 9 D E046F 98 077F
0472 68 0028
047s co 10
0477 33 CO
0479 2 E C 90478 E E
0 4 7 C E C0 4 7 D A B 10
047F 75 08
0481 E 2 F 90483 E3 100 4 8 5 OA D C0 4 8 7 E E I A
0489 2 E C 90488 E C0 4 E C A B 100 4 E E 74 080490 E 2 F9
0492 E 3 200494 OA DC0496 E B 08
0498 F E C 40 4 9 A EO F C 0 40490 74 09
049F E A C 40 4 A 1 E E D 60 4 A 3 E 7 090 4 A 5 E 9 0 9 BC R
0 4 A E04AE
0 4 A E048004830485
04880 4 E D
E E 1388 RBE 0001
CD 10BE 0507CD 10E 1 3 E 0072 R 1 2 3 47 4 03E E O C 2 1 R
, H A V E H AD CO M P LE T E V E R T I C A L - V E R T I C A L C Y C LE , N OU T E S T R E S U L T S
011 HOV IL~OH , L A T C H T I M E R 1O U T T I M - C T L , A L ,CHP E X ,E P F , NUMEE R OF E NA B L E S E E TUE E N
, V E R T I C A L S 0 K 7
JE a 1 2HOV EL,OSH
a i15 JHP snow a 2 2 , URONG t E NA B L E S E RROR 09050 1 2 I N A L ,T IH E R + l , G E T T I M E R V A L U E L O U
HOV AH,AL , S A VE I TNOPI N A L ,T IH E R + l , G E T T I M E R HIGH
XCHG AH.AL
ST I , I N T E R R U P T S B A C K O N
NOPCHP AX,HAVTJGE 013
JHP . s n o R T a 2 2 , V E R T I C A L S TOO F A R A P A R THOV E L , O ~ H
, = ERROR 0906a n CHP AX,MI~T
JLE a i 4HOV E L , O ~ H
JHP SHORT a22 , V E R T I C A L S T O O C L O S E T O G E T H E R, = ERROR 0907
, T I M I N G S S E E M 0 K . N OU C H EC K V E R T I C A L I N T E R R U P T ( L E V E L 5 )
014: S U EI NANDOUTANDS T I
a i s : TEST
J N ZL O O PHOVJ H P
a i s : I NOR
cx, cx ; S E T T t H E O U T R E GAL, I NTAO 1
A L , l l O l l l l l E ; U N M A S K I N T . L E V E L 5
I N T A O 1 , A LDA TA -A RE A CI NTR-FLA G-DA TA ] , A L
D A T A ~ A R E A ~ I N T R ~ F L A G - D A T A l , O O l O O O O O E S E E IF I N T R
a 16 ; GO ON I F IT D I D0 15 ; K E E P L O O K I N G I F I T D I D N ’T
S HO RT a 2 2 , N O V E R T I C A L I N T E R R U P T
AL, I NTAO 1 ; D I S A B L E I N T E RR U P T S FO R L E V E L 5A L . OOl OOOOOE :
; E N A B L E I N T S .
; 5 HAPPENED YET
EL, o w
; = ERROR 0908
OUT I N T A O l A L; S E E I F R ED , G RE EN , B L U E A ND I N i E N S I F Y D O T S U OR K; F I R S T . S E T A L I N E O F R E VE R SE V ID E O, I N T E N S I F I E D B L A N K S I N T O VI D E O
EUFFERHOV AX,OSDEHHOV e x . 0 7 7 ~ ~
INT i o nMOV CX ,4 0
XOR AX,AX
O U T D X , A L; S E E I F DOT COMES ON018: I N A L,D X
a i 7 : SUB cx,cx
T E S T A L , 000 O O O O EJNZ a i sLOOP a l eHOV EL, i o n
JMP S H O R T a 2 2OR E L ,A H
; S E E I F DOT GOES OFF
020: I N A L,D X019: S UE cx,cx
TE S T A L , O O O l O O O O E
L O O P 0 2 0JE a 2 1
HOV E L , ~ O H
JHP S HO RT a 2 2O R E L , A H
; A D J U S T TO P O I N T TO N E X T D OT9 2 1 : INC A n
CHP AH.4
H O V A L , A HJ H P 017
JE a 2 3
9 2 2 : MOV en . osnJHP E-MSG
ASSUME DS D A T A; D ON E U I T H T E S T R E SE T T O 4 0 x 2 5 -
0 2 3 . C A L L DD SHOV ~ ~ , o o o i nINT i o nHOV A X , O ~ O ~ HI N 1 I O H
U R I T E C HA RS , B L O C K SPAGE 7, R E V E R S E V I D E O ,
HIGH I N T E N S I T Y40 CHARACTERS
STUT u t T n BLUE DOTS
S E T V IDE O A RRA Y A DDRE S S FOR DOTS
G E T S T A T U SDOT THE RE 7GO L OOK FOR DOT TO TURN OFFC O N T I N U E T E S T I N G F O R D O T O N
OR I N D O T B E I N G T E S T E DDOT NOT COMING ON = E R R O R 0 9 1 X( X=O, BLUE, X=l , GREEN;X = 2 , R ED ; X = 3, I N T E N S I T Y )
G E T S T A T U SIS D OT S T I L L O N?GO ON I F DOT OFFE L S E, K E E P U A I T I N G FO R D O T
TO GO OFF
OR I N DO T B E I N G T E ST E D
(X =O, B L UE ; X = l , GREE N;DOT STUCK ON = E R R O R 0 9 2 X
X = 2 , R ED ; X =3 , I N T E N S I T Y )
A L L 4 DOTS DONE ?GO END
GO LOOK FOR ANOTHER DO7S E T HSE OF ERROR CODE
COLOR
I N t T TO 4 0 x 2 5 - COLOR
S E T TO V I D E O P A G E 7
CHP RESETJLAG, 1 23 4 H , UA RM S TA RT?JE a 2 4 , B Y P A S S P U T T I N G U P P O U ER - ON S C R EE NCALL PUT-LOGO , PUT LOGO ON SCREEN
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 401/605
04800 4 C O0 4 C 20 4 C 40 4 C 60 4 C B0 4 C 90 4 C A
0 4 C C0 4 C F040 1
0 4 0 30 4 0 9
0 4 D F04E00 4 E 1
04E40 4 E 70 4 E AO 4 E E04F204F60 4 F 90 4 F D0 4 F F050 1
E8 O C 2 1 RBO 76E 6 43BO 00E 6 4 19090E 6 4 1
E E E 6 D E R33 coE E DE
C 7 06 0008 R O F 7 8 RC 7 06 0120 R F 0 6 E R
OE5E
A 3 0122 R
€8 1388 RBE O O l E RE 9 36 0 0 1 A RE 9 36 O O l C RE 9 36 0080 RE 3 C 6 20E 9 36 0 0 8 2 RE 4 A 0BO EOE 6 A 0
0503 E 8 E 6 D E R0506 EB 00400509 E 4 6 20508 A B 08
0 5 0 0 75 03O 5O F E 3 C 3 400512 530513 E 3 EB 10
0516 89 I E 0013 R0 5 1 A 580518 B A 2000051E 2 8 F F0520 B 9 A A 5 50523 E E C 2
0525 2 6 : 89 OD0 5 2 8 EO OF0 5 2 A 2 6 : E8 050 5 2 0 33 C l0 5 2 F 75 OC
0531 E 1 C 2 10000535 E 3 C 3 40O 5 3 E EO F E A 0OSOB 7 5 E 60530 89 1E 0015 R
0541 BE 00040544 EE 0 5 B C R0 5 4 7 E A 0080
0 5 4 A E9 78000 5 4 0 EE C 2054F 5 1
0550 5 3
0551 500552 E8 0859 R0555 74 030557 E 9 0603 RO 5 5 A 58OSIE 580 5 I C 590550 EO FD 7 80560 9 C0561 OS 0 0 3 C0564 900565 7 4 030567 05 00020 5 6 A EE 0 5 B C R0560 3 8 C 30 5 6 F 75 030571 E 9 0 6 4 0 R
C A L L924: HOV
OUTHOVOUTNOPNOPOUTASSUMEC A L LXORHOV
HOVHOV
P u s nPOPHOVASSUMEC A L LHOVHOVHOVHOVADDHOVI NHOVOUT
P U T L O G O
AL , on
A L . 0 1 1 1 0 1 1 0 8 ;
T I M - C T L , A L ;
T I HER+ 1,A L
T I HER+ 1, A LOS: A B S 0HFG-UPAX, AX
P U T LOGO ON SCREENR E - I N I T T I M E R 1
H F G C H E C K P O I N T = F 4
OS, AX
NHI -PTR,OFFSET KBDNHl ; SET INTERRU PT VECTORKEVBZ_PTR,OFFSET KEY SCAN SAVE . SET VECTOR FOR
csAXKEV62-PTR+2, AXOS: DATADDS ' SET DATA SEGMENT
BUFFER-HEAD, SIBUFFERJAIL, SIBUFFER-START, SISI,32 ; SET DEFAULT BUFFER OF 32 BYTES
BUFFER-END, SIA L ,OAOH , C L E A R N H l F I FAL. eon : E N A B L E N H I
, POL INT -HANDLEk
SI,OFFSET KB BUFSER , SET KEVBOARD PARHS
OAOH, ALI F A K EY IS STUCK, THE BUFFER'SHOU LD F I L L U I T H T H A T K E Y ' S C OD E
T H IS U I L L BE CHECKED LATER
H EH OR V S I Z E D E T E R M I N E AN D T E S TT H I S R O U TI N E U I L L D E T ER M IN E HOW MUCH HEM
AND SET "HEHORV-SI ZE AND "REAL-HEHORV"UORDS I N THE DATA AREA.
AFTER THI S, MEMORY WILL B E E I T H E R T E S TE DOR CLEARED. DEP END ING ON THE CONTENTS OF
IS TTACHED TO THE SYSTEM (UP TO 6 4 0 ~ ~ )
*~RESET-FLAC~~.HFG. ERROR CODES -0A XX PLA NAR BO ERROR
-0BX X 64 K CD ERROR
925:
026:
ASSUMEC A L LHOVI NT E S TJ N EADD
SUEHOVPOPHOVSUBHOVHOV
HOVHOVHOVXORJ N Z
ADDADDCUPJ N E
P u s n
OS: DATAHFG-UP ; H F G C H E C K P O I N T = F 3BX, 64 ; S T AR T U I T H B A S E 6 4 KAL, PORT-C ; G E T C O N F I G B V T EA L , 0 0 0 0 1 0 0 0 B ; SEE I F 6 4 K CARD I N S T AL L E D9 2 5 ; ( B I T 4 WILL B E 0 I F CARD PLUGGED)BX, 64 ; ADD 64KB X ; SAVE K COUNTBX, 16 ; SUBTRACT 16K CRT REFRESH SPACECHEHORV-SI Z E I , BX ; LOAD "CO NTI GUOUS MEMORY" UORDEXO X , 2 0 0 0 HD 1 , D ICX, OAA55HES. OX
E S : C D I I , C XAL, OFHAX, ES: I D 1AX, CX9 2 7
OX, lOOOHB X, 6 4OH, OAOH4 2 6
SET POINTER TO JUST ABOVE'12BKS E T D I T O P O I N T T O B E G I N N I N GLOAD DATA PATTERNSET SEGMENT TO ROINT TO MEMORYSPACES E T D A T A P A T T E R N T O MEMORYSET A L TO ODD VALUEGET DATA PATTE RN BACK FROM HEMS E E I F D A T A HA D E I T B A C KNO? THEN END OF HEM H A S B E E NREACHEDP O I N T T O B E G I N N I N G O F N EX T 6 4 KADJU ST TOT AL HEM. COUNTERP A S T 6 4 0 K V E T ?CHECK FOR ANOTHER BLOCK I F NOT
9 2 7 : HOV CTRUE-HEHl,BX . LOAD "TOTAL MEMORY" UORD: SIZE HAS BEEN DETERMINED, NOU +EST OR CLEAR ALL OF MEMORY
AX, 4 ; 4 KB KNOWN OK AT THIS P O I N TOVC A L LHOV
HOV928: HOV
pusnP u s n
P u s nC A L LJ ZJ H P
929: POPPOPPOPCHPPUSHFADDPOPFJ EADD
CHP930: C A L L
J N EJ H P
935OX, ooeon
CX, 7EOOHES, OXc xE X
AXPODSTG9 2 9939AXB Xcxcn, ~ E H
A X, 6 0
030AX, 2035AX, EX4 3 1
943
; SET POINTER TO JUST ABOVE; LOUER 2K; T E S T 3 0 K U O RD S ( 6 0 K B )
; TEST OR FILL HEM
; JUMP I F ERROR
; RECOVER; U A S T H I S A 60 K P A S S
; BUMP GOOD STORAGE BV 60 K E
;ADD 2 FOR A 62 K PASS
; ARE UE DONE VET?
; ALL DONE, I F SO
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 402/605
O S 7 4 30 OOEO0577 7 4 IE0579 EA OFEO0 5 7 C E9 0400057F EE C 2O S 8 1 500582 530583 520584 E 8 O B 5 9 ROS87 75 7 A0589 5 A0 5 E A 5 8OSEE 58
OSEC 05 0 0 0 2O S E F E A 1000
O S 9 2 89 7COO0595 E E E 60597 E A 20000 5 9 A 3E DE0 5 9 C 7 5 03059E E9 0 6 4 0 RO S A I E9 4 0 0 00 5 A 4 E E C 2O S A 6 500 1 A 7 53
0 5 A E 52
O S A 9 E E 0859 ROSAC 75 55OS A E 5 AO SA F 5 80 5 B O 58
0581 05 0 0 2 00 5 8 4 E8 0 5 B C R0 5 8 7 EO C 6 08
0 5 E A EE D E
0 5 B CO 5 E CO S E FoscsO 5 C 7OSCE0 x 9
0 5 C A0 5 C E
0 5 C D0 5 D O
0502O S 0 405DSO 5 D 60509OSDCOSDEOSEOOSE3O 5 E 40 5 E 6O S E 90 5 E AOSEDO S E FO S F 2
0 5 F SO S F EO S F 9OSFCO S F EO S F F0600
060 1
06020603
E 8 1388 R8 1 3 E 0 0 7 2 R 1 2 3 47 4 38
535 1
52
5 0E 4 0 2
E A 1 4 2 1E 7 07CD 10
5850EB OOOAE9 000333 02
F7 F 3EO CA 3052
E 2 F6E9 000358
E E 1 8 E A RE 2 F AE9 0003EE 0025 R
2 E . E A 0446E E I E E A RE2 F7SES A595Ec3
0 6 0 3 S A
0604 8 1 F A 2000
0 6 0 8 7 C OE0 6 0 A E A 09
0 6 0 C O A DO0 6 0 E E 1 0 4
0 6 1 0 0 2 E E0 6 1 2 8 7 100 6 1 4 OA F E0 6 1 6 EE 200 6 1 8 E 7 OA0 6 1 A E 4 620 6 1 C 2 4 080 6 1 E 74 06
0 6 2 0 E A 0 9
0 6 2 2 O A DO
0 6 2 4 E E 12
a3I
0 3 2a33
a34
CMP
J EMOVMOVMOVP u s npusnP u s nC A L LJ N ZPOPPOPPOP
ADDMOVMOVJ M P
CMPJ N EJ M PMOVMOV
nov
P u s nP u s nP u s nC A L LJ N ZPOPPOPPOPADDC A L LADDJMP
A X , 1 2 8
0 3 2OX, OFEOH
ES, DXAXexDXPODSTG039DXB XAX
AX, 2
cx, 0 4 0 0 ~
O X , loooncx, XOOHazeox, 2 0 0 0 ~
a 3 4
cx, 4 0 0 0 ~
EX, AX
0 4 3
ES, OXAXE XD XPODSTG
OXE XAX
A X, 3 2
a39
a35
Dn, oen033
DONE u i T n I 1 2 ~ ~ 7
GO F I N I S H RE ST O F HEMS ET P O IN T E R TO F I N I S H IS1 6 4 K E
GO T E S T l F I L L
UPDATE GOOD COUNTS E T P O I N T E R TO 2 N D 6 4 K B L O C K6 2 K U O R T HGO TEST ITP O I N T T O B L OC K AB O VE I Z E KCOMPARE GOOD MEM TO TOTAL MEM
E X I T I F A L L D ONES E T F O R 3 2 K B B L O C K
G O T E S T / F I L L
BUMP GOOD MEMORY COUNTDISPLAY CURRENT GOOD MEMS E T P O I N T E R T O N E X T 3 2 KAND MAKE ANOTHER PASS
; S U B R O U T I N E F O R P R I N T I N G T E S T E D
; C A L L PA R M S: A X = K OF GOOD MEMORY; MEMORY OK MSC ON THE CRT
(IN H E X )
b35
036:
0 3 7 :
038:
0 3 5 E :03s
PROCC A L LCMPJ EP u s nP u s nP u s nP u s n
nov
P u s n
MOV
MOV
1N TPOP
MOVMOVXORD I VOR
LOOPMOVPOPC A L LLOOPMOVMOV
MOVI NCC A L LLOOPPOPPOPP O PPOPR E T
P u s n
NEARDDSRESET-FLAG, 1 2 3 4 ~ '0 3 5 ~E XcxDXAXAH, 2
OX, 1 4 2 1 ~en, 7i o nAXAXEX, 10
cx, 3OX, OXE XDL, OHDX0 3 6cx, 3
a37cx, 3
AXPRT-HEX
SI,O F F S E T F 3 E
A L ,CS : I S 1 1SIPRT-HEX
AXOXcxE X
038
ENDP; DN E NTRY TO ME MORY ERROR ROUT INE , CX HA S E RROR B I T S, A H H AS O D D l E V E N I N F O . O T HE R U S E F U L I N F O ON THE S TA CK
039: POP
E S T A B L I S H A D D R E S S I N G
N O P R I N T O N U A R M S T A R T, UA RM S TA RT?
SAVE UORK REGSSET CURSOR TOUARD THE END OF
R OU 2 0 f R O U 2 0 , C O L 33)PAGE 7
S E T UP FOR DE CIMA L CONV E RTOF 3 N I B B L E S
D E V I D E B Y 10
M AKE I N T O A S C I IS I V E
RECOVER A NUMEER
P R I N T K E "
CMPJL
MOVORMOV
SHRMOVORJ M P
I NANDJ ZMOVORJ M P
0 4 0 : MOV
DX, 2OOOW
a40E L . C L
CL , 4
on, CLEM, i o n
s n o w a 4 2
E L , C H
En, OH
En, OAHAL, PORT-CAL, O O O O l O O O Ea4 I
E L , E LEL, cnSHORT 042
P OP S EGMENT P OIN TE R TO OXf H E A D I N G D O Y N H I L L , D O N 'T C A R EA B OUT S TA CK )ABOVE 12EK ( T H E S I M P L E C A S E )GO DO O D D I E V E N - L E S S T H A N 12EK
F OR M E RR OR B I T S ( " X X " )
R O T A TE MO ST S I G N I F I G A N TN I B B L E O F S E G M E TT O L O U N I B B L E O F OH
F OR M V " V A L U E
E R R O R O A . . . .G ET C O N F IG E I T ST E S T F O R A T T R I B C A R D P R E S E N TUORRY A B OUT ODDlE V E N I F I T IS
C OM EIN E ERROR B I T S I F I T I S N ' T
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 403/605
0 6 2 6 eo FC 0 2
0 6 2 8 7 4 oe
0 6 3 1 eo FC 0 1
0 6 2 9 8 A D 9
0 6 2 0 F E C 70 6 2 F O A DD
0634 74 0 20 6 3 6 F E C 7
0 6 3 8 B E 0035 R0638 Ee osec R
0 6 3 E F A0 6 3 F F 40 6 4 0
0 6 4 00 6 4 30 6 4 60 6 4 90 6 4 80 6 4 00 6 4 F065 1
0 6 5 30 6 5 5
E8 E 6 D B R
E e 1 3 8 8 R
BE O O l E R
8 A 0 7OA CO7 4 06
E 7 2 28 A D 8EE OAeo 3~ 0 0 1 2 R 00
0 6 5 A 7 4 I C0 6 5 C BE 2 0 0 00 6 5 F BE 0036 R
0 6 6 2 e 1 3~ 0 0 7 2 R 4 3 2 10 6 6 8 7 4 oe0 6 6 A E l 3 E 0 0 7 2 R 1 2 3 40670 7 4 030 6 7 2 EE 0 9 E C R0 6 7 5 E 9 0 6 F F R
0 6 7 8 E A 02010678 EC0 6 7 C 2 4 F O0 6 7 E 7 4 7 F0 6 8 0 € 4 6 2o m 2 2 4 EO
0684 7 4 79
0 6 8 8 2 4 FC
06ec eo e 6
0 6 8 6 E 4 6 1
0 6 8 A E 6 6 1
0 6 8E E 6 4 30 6 9 0 EO 40
0 6 9 2 E 6 A 00 6 9 4 EO 20
0696 B A 0 0 4 20699 E EO W A 2 e co069c ee CE0 6 9 E EE
069F E 4 6 10 6 A 1 OC 01
0 6 A 3 E 6 6 10 6 A 1 E 4 6 20 6 A 7 2 4 4 00 6 A 9 7 5 0 60 6 AE E 2 F B0 6A D E 3 0 20 6 AF E E 4 90 6 8 1 06
0 6 8 2 2 e co
0684 eE co0 6 8 6 2 6 c7 06 oooe R FEE R0680 A Z 0 0 8 4 R0 6 C O E 4 6 10 6 C 2 O C 300 6 C 4 E 6 6 1
0 6C B E 6 A 00 6 c 6 eo co
O ~ C A e9 0100
a 4 1 CMP A H , O ~ , EVE N BYTE ERROR” ERR OAXXMOV e L , c ~JE 0 4 2I N C EM , MAKE INTO oexx ERR
JE a 4 2
OR e L . w , MOVE AND COMBI NE ERROR B I T SCMP AH, 1 , ODD BYTE ERROR
INC en , MUST HAVE B EEN BOTH- MAKE I N TO OCXX
a 4 2 MOV SI.OFFSET MEM-ERRCALL E-MSG , L E T E R R O R R O U T I N E F I G U R E O U T
C L I
H L T
, UHAT TO DO
a43- -_ -_ -__-___-___________________________- - - - - - - -, KEYSOARD TEST, D E S C R I P T I O N
N M I H A S B E E N E N A BL E D F OR Q U I T E A F E USECONDS NOY CHECK THAT NO SC AN CODESH A V E S HO UN U P I N T H E B U F F E R ( S T U C KK E Y ) I F TH EY H A V E, D I S P L A V T HE M A N0POST ERRORMFG ERR CODE2 0 0 0 S T R A Y N M l I N T E R R U P T S OR K E YB O AR DRECEI VE ERRORS2 1 X X C AR D F A I L U R E
X X = O l , K B D A T A S T UC K H I G HX X r 0 2 , K E D AT A S TU C K L O UX X = 0 3 , N O N M t I N T E R R U P T
2 2 X X S T U CK K E Y ( X X Z S C A N C O D E)
ASSUME DS D A T A
CALL MFG-UP , MFG CODEEF2C A L L D D S , E S T A B L I S H A D D R E S S I N GMOV EX, OFFS ET KB-BUFFERMOV AL,CBXI , CHECK FOR STUCK KEYSOR AL , AL , SCAN CODE = 0-
J E F 6 - Y , YES - C O N T I N U E T E S T I N GMOV BH.22H , 22XX ERROR CODEMOV ~ L , A LJ M P S HO RT F 6
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .----- CHECK FOR STUCK KEYS
F6-Y CMP KED-ERR,OOH , D I D N M I ‘S H A P PE N U l T H NO S C A N, CODE PASSED-
J E F 7 , ( S T R A Y S ) - C O N T IN U E I F N ON EMOV ex 2 0 0 0 ~ S ET ERROR CODE 2 0 0 0
C M P R E S E T J L A C , 4 3 2 l H , U A R M S T A R T T O D I A G SJ E F 6 - 2 , D O NOT PUT UP MESSAGECMP RESETJLAC, 1234H , UARM SYSTEM STARTJ E F 6 - 2 , DO NOT PUT UP MESSAGECALL E-MSG , PRI NT MSG ON SCREEN
F 6 MOV S I OFFSET KEY-ERk , GET MSG ADDR
F6-Z JMP F6-XC HE CK L I N K CA RD I F P R E SE N T
F 7
F7-0
F 7 - 1
MOVI NANDJ ZI NANDJ ZI NANDOUTMOV
OUTMOV
OUTMOV
MOVOUT
MOVOUTI NOROUTI NANDJ N ZLOOPMOVJMPP U S H
MOVMOVMOVI NOROUTMOVOUTMOV
sue
sue
D i , 0 2 0 1 HAL , DXAL, OFOHF6-XAL. PORTJAL, lO O O O O O O EF6-XAL, PORT-EAL, llllllOOEPORT-E, ALAL , OE6HT I M-CTL , LA L, 0 4 0 H
, CHECK FOR BURN- I N MODE
. B Y P AS S C HE CK I N B U R N - I N MODE, G E T C O N F I C P O R T D A T A, KEYBOARD CABLE ATTACHED”, BY PASS T ES T I F I T IS
, DROP SPEAKER DATA
, MODE S E T T I M E R 2
, D I S A B L E N M I
OAOH. ALA L, 3 2 , L S B T O T I M E R 2
DX, T I MER+ZDX, ALAX, AXCX, AXDX. AL , MSB T O T I M E R 2 ( S T A R T T I M E R )AL, PORT-EAL, I
PORT-E, AL , E N A B L E T I M E R 2AL, PORTJ , SEE I F K E Y B O A R D D A T A A C T I V EAL,OlOOOOOOE ,F 7 - 1 , E X I T L OO P I F D A T A SH OV ED U PF 7 - 0E L , 0 2 H , SET NO KEYBOARD DATA ERRORSHORT F6-1
ES , SAVE ES
AX, AX , SET UP SEGMENT REG
ES, AXES CNMl-PTRl.OFF;E: D l l , SET UP NEU NMl VECTORINTRJLAG,AL , R E S ET I N T R F L A GAL, PORT-E , D I S A B L E I N T E R N A L B E E P E R TOAL. 001100008 , PREVENT ERROR BEEPPORT-B. ALAL, OCOHOAOH, AL , E N A B L E N M I
, ( A PP R O X 4 0 K h 2 V A L U E )
cx, O l O O H
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 404/605
0 6 C D
0 6 C F
0 6 D T0603060506080 6 D A0 6 D C06E30 6 E 406E60 6 E B0 6 E A0 6 E C
0 6 E E06F006F20 6 F 4O 6 F 60 6 F BO 6 F A0 6 F C06FF0701
E 2 F E
E 4 6 124 C F
E 6 6 1A 0 0084 ROA COE3 032 6 : C 7 06 0008 R O F 7 8 R
74 14BO 00
E6 A 0E 4 6 124 F E
E6 6 1E 4 6224 407 4 09
E 2 F BE 3 01
87 2 1
E 9 065F RBO 00E 6 A 0
.07
= 0 A 9 A= OBAD
0703 E B € 6 0 8 R0706 E 4 6 10708 OC 090 7 0 A E6 61
0 7 0 C E 4 2 1
0 7 0 E O C 0 10710 E 6 2 10712 EO E 60714 E 6 43'0716 88 04020719 E6 42
0718 B A C 40710 E 6 4 2071F 28 C 90721 E 2 F E
0723 E 4 620725 24 100727 A 2 0068 R0 7 2 A E 8 F96F R0720 E8 F96F R0730 E 3 3 E0732 530733 € 8 F 9 6 F R0736 580737 E 3 370739 03 C 30738 30 O A 9 A0 7 3 E 73 300740 30 OBAD0743 72 280745 B A 0201
0748 EC0749 24 F O0748 3 C 10
0740 74 04
074F 3 C 40
0751 75 26
0753 E 4 6 1
0755 B A D O0757 24 E 50759 E 6 6 10758 33 C 90750 E 2 F E075F € 8 F96F R
0762 E8 F96F R0765 B A C 2
0767 E 6 6 10769 E 3 OE
0768 EB 23FF0 7 6 E E E 0307700770 BB 23000773 B E 0037 R0776 E B 0 9 B C R0779 E 4 2 10778 24 F E0770 E 6 2 1077F E 4 A 00781 BO BO0783 E6 A 0
F 6 - 0 , U A I T A B I T
AL , PORT-E , RE -E NA B L E B E E P E RAL, llOOllllEPORT-E, ALA L , I N T R - F L AG , G ET I N T R F L A G
A L , A L , U I L L B E N O N- ZE RO I F N H I H A P P E N E DEL, OJH S E T P OS S IB L E E RROR CODEE S C N H I - P T R I , O F F ~ E T K B DN H I ,E S , RE S TORE E SF6-1 , JU MP I F NO N H IAL ,oon , D I S A B L E F E E D B A C K C K TOAOH, ALAL, PORT-BA L . l l l l l l l O E . DROP GATE TO T I M E R 2
R E S E T N H I V E C T O R
F 6 - 0 L O O P
I N
ANDOUTHOVORHOVHOVP O PJ ZHOVOUTI NAND
OUT PORT-B, A L
AND AL,OlOOOOOOB ,J Z F 6-X . E X I T L O OP I F D A TA U E NT L O ULOOP F6-2
F 6 - 2 I N A L,P OR T-C , S E E I F K EY BO AR D D A TA A C T I V E
HOV B L , o i n . SET K E Y B OA RD D A T A STUCK niCn ERR~ 6 - 1 HOV E n , 2 1 n , P O S T E RR O R " 2 1 X X "
F6-X MOV AL,OOH , D I S A B L E F E E D B A C K C K T
J H P F6
OUT OAOH,AL
C A S S E T T E I N T E R F A C E T E S T
T U R N C A S S E T T E M O TO R O F F U R I T E A B I T OUT TO THEC A S S E T T E D A T A B U S V E R I F Y T H A T CA S S ET T E D AT AREAD IS U I T H I N A V A L I D R AN GE
........................................................
, D E S C R I P T I O N
, HFC E RROR CODE =2 3 OOH (D A TA P A TH E RROR)
; (AX-PERIOD EOU 0A 9A H , OM + l o %HIN- P E R IOD E OU OB A DH ,NOM -10%,___-_URN T H E CASSETTE MOTOR OFF
23FF ( R EL A Y F A I L E D T O P I C K )
........................................................
CALL MFG-UP , H F G C O D E Z F II N A L, PO RT -BOR A L ,OOOO1 0 0 1 B , S E T T I M E R 2 S P K O J T , A ND C A S S E T T EOUT PORT-B, A L , OUT BITS ON, CA S S E T TE HOT OFF
I N A L .I N T A O1OR AL,~IH , D I S A B L E T I M E R I N T E R R U P T SO U T I N T A O 1 , A LHOV AL,OEOH , S E L T I M 2, LSB, HSB, HD 3O U T T I M E R + 3 , A L , U R I T E E 2 5 3 C H D l H O D E R EGMOV A X, 1 2 3 4 , S E T T I M E R 2 CNT FOR 1000 U S E CO U T T I M E R + Z , A L , U R I T E T I M E R 2 COUNTER REGHOV A L ,A H , U R I T E MSBO U T T I M E R + 2 , A L
S U B cx,cx , CL E A R COUNTE R FOR L ONG DE L A YLOOP I , U A I T FO R C OU NTER TO I N I T
I N A L,P OR T- C , R EA D VA L UE O F C AS S I N B I TAND AL, i o n , I S O L A T E F R O M O T H E R BITSMOV L A S T-V A L , A L
CA L L RE A D-HA L F-BI TJ C X Z F B , CAS-ERRP u s n EX , S A V E H A L F BIT T I M E V A L U ECA L L RE A D-HA L F-B I T
P OP A X , G E T T O T A L T I M EJ C X Z F B , CAS-ERRADD AX,EXCHP AX, MAX-PER1 ODJ N C F B , CAS-ERRCMP AX, HIN - P E e I ODJ C F B
I N A L,D XA ND A L ,OFOH , D E T E R M I N E MODEC H P A L , O O O 1 0 0 0 0 8 , H F G ?J E F9CMP AL, OlOOOOOOB , S E R V I C E ?J N E T l l - E N D GO TO N E X T T E S T I F NOT
, C H E C K T H A T C A S S E T T E R E L A Y IS P i C K I N C ( C A N ' T D O T E S T I N N OR MAL, M OD E B EC A US E OF P O S S I B I L I T Y O F U R I T I N C O N C A SS E T T E I F "RECORD"
B U T T O N IS DEPRESSED )
b9 I N A L, PO R T- E
----- U R I T E A BIT
___-_R E A D C A S S E T T E I N P U T
CALL READ-HALF-BIT , TO SET UP CONDITIONS FOR CHECK
nov DX,~OIH
HOV D L , A L , S A V E P ORT E CONTENTSA N D A L , 1 1 1 0 0 1 0 I E , S E T C A S S E T T E M OT OR O NOUT PORT-B, ALXOR CX,CX
C A L L R E A D - H A L F - B I TCALL READ-HALF-E1 TMOV AL,DL , DROP RE L A Y
OUT PORTJ, ALJ C X Z 1 1 3 - E N D , RE A D-HA L F-B IT S HOUL D T I M E OUT I N
MOV B X .2 3 FFH , E R R O R 2 3 F FJ H P S HO RT F B 1
F91 L O O P F91 , U A I T F O R R E L A Y TO S E T T L E
, THIS SITUATION
F B , CAS-ERRMOV EX 2 3 0 0 ~ ERR CODE 2 3 0 0 ~
FBI HOV SI:OFFSET CASSJ~R , CASSETTE URAP FAILEDCALL E-MSC , GO P R I N T E R R O R MSG
T 13 -E ND I N A L, I N T A O lA ND A L ,OFE H , E N A B L E T I M E R I N T SO UT I N T A O l , A LI N A L, NM I- PO R T , C LE AR N H I F L I P l F L O PHOV A L , B ~ H , E N A B L E N H I I N T E R U PT SOUT NHI -P ORT, A L
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 405/605
0 7 8 5 €8 EGDB R0788 E A 0 2 F 80 7 8 8 EE €E31 R07EE 73 06
0 7 9 3 EE 0 9 B C R0790 BE 0038 R
0 7 9 6 E8 E 6 D E R0799 E 4 6 20 7 9 8 2 4 0 20790 75 OE0 7 9 F 8 A O 3 FE0 7 A 2 E8 E831 R
0 7 A 5 73 060 7 ~ 7 eE 0039 RO ~ A A €8 osnc R0 7 A D
0 7 A D0 7 A F078 I
0 7 8 40785
0786
0 7 B C0 7 E D0 7 B E0 7 E F
0789
0 7 C 1
0 7 C 30 7 C 9
0 7 C F0 7 D 507080 7 D C0 7 D D
2 8 coBE C D
OEas 0008
I FBE F E F 3 RB F 0 0 2 0 RA 5474 7
E 2 F B
EE D 9C 7 06 0014 R F F 5 4 RC 7 06 0 1 2 0 R I O C 6 R
C 7 06 0110 R F A 6 E RC 7 06 0060 R F F C B ROE58A 3 0062 R
..................................................................S E R I A L P R I N T E R A N 0 M OD EM PO UE R ON D I A G N O S T I C
V E R I F I E S T HA T THE S E R I A L P R I N T E R U A R T F U N C T I O N S PR O P E RL YC H E CK S I F T H E M OD EM CA RD I S A T T AC H ED I F IT'S N O T , E X I T SV E R I F I E S T HA T T HE MODEM U A RT F U N C T I O N S P R O P E R L YERROR CODES RETURNED B Y 'U AR T ' R AN GE FR OM 1 TO I F H AN D A R ER EP O RT ED V I A R E G I S T E R E L SEE L I S T I N G O F ' U A RT ' ( P O D 2 7 )FOR POSSIEL E ER R OR SM FG E RR C OD ES 2 3 X X F OR S E R I A L P R I N T E R
, D E S C R I P T I O N
2 4 XX FOR MODEM--------------_-_-______________________------------------------_-ASSUME CS CODE.DS DATA
T E S T S E R I A L P R I N T E R I N S 8 2 5 0 U A RT
CALL HFG-UP , M F G R O U T I N E I N D I C A T O R = F OM OV OX,O2 F8 H , A D DR E S S OF S E R I A L P R I N T E R CA RDC A L L U A R T , ASVNC H COMM AD APTER PODJN C TM , PASSEDM OV SI , OF FS ET C OH I -ER R , C O D E F O R D I S P L A YCALL E-MSG , REPORT ERROR
T E S T M O DE M I N S E 2 5 0 U A RT
---_-_-_________________________________-------------------
. . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..................................................................TM CALL MFG-UP , M FG R O U T I N E I N D I C A T O R = E F
I N A L. PO RT -C , TEST FOR MODEM CARD PRESENTAND AL,OODDOO1OE , ONLY CONCERNED U I T H B I T I
J N E T M l , I T ' S N OT T HE RE - DONE U I T H T E S TM OV D X.0 3 FEH , ADDRESS OF MODEM CARDC A L L U A R T , ASVNC H COMM A DAPTER POD
J N C T M l PASSEDMOV S I , OFFS ET COMZ-EkR MODEM ERRORCALL E-MSG , R ~ P O R T RROR
TH I_-_-_-_-_-___-__________________________-------S E T U P H A R DU A RE I N 1 V EC TO R T A B L E
ASSUME CS CODE,DS AB S0SUB AX,AXMOV ES.AX
- -___ -__________________________________- - - - - - -
F 7 A :
.
-----
MOV cx;oe , GET VECTOR CNTP U S H C S , SETU P D S SEG R EGPOP D SMOV S1,O FFS ET VECTORJABLEMOV DI, FFSET IN T - PTRMOVSUI N C D I ; S K IP OVER SEGMEN TI N C D IL O O P F 7 A
A S S UM E D S : A 8 5 0MOV DS,CXM OV IN T5 - PTR ,OFFSET PR IN T- SC R EEN ; P R I N T S C R E E NM OV KEV6 2 - PTR , OFFSET KEV 6 2 - IN T ; 62 K E Y C O N V E R S I O N
MOV CSET-PTR ,OFFSET CRT-CHAR-GEN ; D O T T A B L EMOV BASIC -PTR,OF FSET BASJNT ; C A S S E T T E B A S I C E N T RYP U S H C SPOP AXM OV U ORD PTR BA SIC - PT R t2 ,AX ; C ODE SEGMEN T FOR C ASS ETTE
SET U P O T H E R I N T E R R U P T S A S N E C E S SA R Y
; R O U T I N E
._-_____________________________________------------------------
; C H EC K FOR OPT ION AL ROM FROM COO00 TO F OO OO I N 2 K B L O CK S( A V A L I D H O OU LE H A S ' 5 5A A ' I N T HE F I R S T 2 L O C A T I O N S ,L E NG T H I N D I C A T O R ( L E N G T H I 5 1 2 ) I N T HE 3 D L O C A T I O N A NDT E S T l I N I T . CODE S T AR T IN G I N THE 4 T H L O C A T I O N . 1
MFC ERR CODE 2 5 x x ( x x =M s B OF SEGMENT THAT HAS CRC CHECK)
0 7 E O BO 01
0 7 E 2 E6 130 7 E 4 E E E 6 D E R07E7 EA C OO00 7 E A0 7 E A E E D A0 7 E C 2 B D B
0 7 F O 53O 7 F l 58
0 7 F 2 3 0 A A 5507F5 75 05
O 7 F7 E 8 € 8 5 1 R0 7 F A E8 04
O ~ E E am 07
0 7 F C0 7 F C E 1 C 2 OOEOO B 0 00800 81 F A FOOO0804 7 C E 4
MOV
OUTC A L LMOV
ROM-SCAN-1 :
HOV
MOVP U S HP O PCMPJ N LC A L LJMP
ADD
CMPJL
sun
NEXT-ROM :
ARE-UE-DONE :
AL, O I H
134, A LMFG-UPDX. OCOOOH
DS, DXax, EXA X , CBX
axaxAX, OAA5 5 HNEXT-ROHROH-CHECKSHORT ARE-UE-
DX, OOEOH
DX, OFOOOHROM-SCAN-I
-DONE
MFG R O U T I N E = E ESET B E G I N N I N G A D D R E S S
SET B x = o o o o
B u s SETTLING
GET 151 UORD FROM NODULE
= TO I D UORO?PROCEED TO NEXT ROM I F NOTGO CHECK OUT MODULE; CHECK FOR END OF ROW S P A C E
P O I N T TO N EXT 2 K AD D R ESS
AT FOOOO VET ?GO CHECK ANOTHER ADD. I F NOT
A-20 R O M B I O S
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 406/605
0 8 0 6 E 8 E 6 D8 R
0 8 0 9 EE 1388 Roeoc eo FF0 8 0 E A 2 0 0 7 4 R0811 A 2 0075 R0 8 1 4 A 2 0076 R0817 E 4 6 20819 2 4 04
O 8 l D E 9 0 8 A 3 R0818 7 4 03
0 8 2 0 eo OE 0010 R 0 1
0 8 2 5 8 3 3 E 0 0 7 2 R 000 8 2 A 75 OE
0 8 2 E E 6 2 00830 E 4 200832 2 4 4 0
0 8 2 c eo OA
0 8 3 4 75 0 40836 83 030838 EE 330 8 3 ~ 80 eo
O W E a4 00
0 8 3 C E 6 F 2
0 8 4 0 8 A 040842 CD I 30 8 4 4 F 6 C 4 F F0 8 4 7 83 0 1
0 8 4 9 75 2 2
0 8 4 8 eo a i
O WF 2 8 c90 8 4 0 E 6 F 2
0851 E 2 F E0 8 5 3 E 2 F E0855 33 D 2
0 8 5 9 88 16 0 0 3 E R
0 8 5 D E 8 E 9 F E R0860 83 02
0 8 5 7 ES 0 1
0 8 6 2 7 2 09
0864 e5 2 2
0 8 6 9 73 O A
0 8 6 8 a3 020 8 6 0 87 2 6O W F BE 003c R
0866 E8 E 9 F B R
0 8 7 2 E 8 0 9 8 C R0 8 7 5 80 8 20 8 7 7 E 6 F 20 8 7 9 E 4 E 20878 2 4 06
0 8 7 ~ 3c 0 2O W F 75 IEo e e i eo a40 8 8 3 E 6 F 2
0885 E 4 E 20 8 8 7 2 4 060 8 8 9 3c 0 4oeae 7 5 1 2
0891 7 4 oc
0 8 9 7 7 4 0 20 8 9 9 8 4 eo0898 oa 2 6 0010 R
0 8 8 D E 4 E 20 8 8 F 2 4 30
0893 3 C 10
0 8 9 5 8 4 4 0
0 8 9 F E D 80
0 8 A 1 E 6 F 2O B I 3 C 6 06 0 0 8 4 R 000 8 A 8 E F 0 0 7 8 R
0 8 A 8 I EOBAC 07OBAD 88 1 4 1 4
0881 A 8
0885 A 80 8 8 6 A 80 8 8 7 E 4 2 10 8 8 9 2 4 F E0888 E 6 2 1
0 8 8 D 1 EOBEE 88 ---- RO K 1 B E D 8
oeeo AE
o e e 2 ea 0101
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .D I S K E T T E A T T AC H M EN T T E S T
CHECK I F I P L D I SK E TT E D R I V E IS ATTACHED TO SYSTEM I F
A T TA C H ED , V E R I F Y S T A T U S O F N E C F D C A F T E R A R E S E T I S S U EA RECAL AND SEEK CMD TO FDC AND CHECK STAT US COMPLETES Y S TE M I N I T I A L I Z A T I O N T H EN P A S S C ON T RO L TO T H E BO OTLOADER PROGRAh
, D E S C R I P T I O N
, M FG E RR C OD ES 2 6 0 1 R E S E T T O D I S K E T T E C O N TR O L LE R CD F A I L E D2 6 0 2 R E C AL IB R AT E TO D I S K E T T E D R I V E F A I L E D2 6 0 3 U ATC HD OC T I M E R F A I L E D
...............................................................ASSUME CS CDDE,DS DATACALL MFG-UP , M F G R O U T I N E = ED
C A L L D D S , P O I N T T O D A T A AR E AMOV A L ,DFFHMDV TR4 CK 0 , A L , I N I T D I S K E T T E S C RA TC H PA DSMOV TRACK 1, A LMOV TRAC K2, ALI N A L, PO R T- C , D I S K E T T E P R E S E N T 7AND AL, 00000I008J Z F 1 0 - 0J MP F 1 5 N O - B Y P A S S D I S K E T T E T E S T
F1 0-0 OR BYT E PTR EQUIP-F;AG,OIH , S E T I P L D IS K E T TE, INDICATOR IN E a u i P F L A G
CMP RESET-FLAG.0 , RUNNING FROM P OUE R-ON S TA TE 7J NE F I O , B Y P A S S UA TCHDOG TE S TM O V A L . 0 0 0 0 1 0 1 0 8 , R E AD I N 1 R E Q U ES T R E G I S T E R CMDOUT INTA OO, A LI N A L. I N T A 0 0
J N Z F I O , PROCEED I F I T H A SM O V E L , 0 3 H , SET ERROR CODEJMP SHORT F13
O U T O F 2 H . A L , D I S A B L E U A T C H D O G T I M E RMOV AH.0 , RESET NEC FDCMOV DL,AH , S E T F O R D R I V E 0I N 1 13H , V E R I F Y S T A T U S A F T ER R E S ET
M O V 8 L . O I H , S E T UP P OS S IE L E E RROR CODEJ N Z F 1 3 , NO - F D C F A I L E D
MOV A L , D R I V E - E N A E L E + F D C - R E S E T , TURN MOTOR ON,DRIV E 0
O U T O F 2 H , A L , U R I T E F D C C O N T R O L R E G
AND AL, O I O O O O O O ~ , HAS UATCHDOG GONE OFF^
F 1 0 M OV A L , F D C -R E SE T
TEST AH,OFFH , STATUS OK'
, ---- T U R N D R I V E 0 MOTOR ON
sue cx ,cxF I I LOOP F I I , U A I T F O R 1 SECONDF 1 2 LOOP F I 2
XOR DX.DX . S E L E C T D R I V E 0MOV CH. I , S E L E CT TRA CK 1
MOV SEEK-STATUS, DL
C A L L S E E K , R E C A L I B R A T E D I S K E T T EMOV e L . 0 2 H , ERROR CODEJ C F 1 3 , GO TO E RR S U B R O U T I N E I F E RRMOV CH.3 4 , S E L E CT TRA CK 34C A L L S E E K , SEEK TO TRACK 34J NC F 1 4 , OK, TURN MOTOR OFF
M O V E L . 0 2 H
MOV S 1 ,OFFS E T DIS K -E RR , GET ADDR OF MSG
C A L L E-MSC , GO P R I N T E R R O R MSGF 1 4 MOV A L , F D C _ R E S E T * 0 2 H
OUT OF2 H.A LI N A L.O E 2HAND AL, OOOOOllO8
J N E F 1 4 - 1MOV A L , FDC _ RE S E T *0 4 HOUT OF2 H,A LI N A L. OE 2HAND AL, 00000 I 108CMP AL, O O O O O lO O 8
J N E F 1 4 - 1I N A L , O E2 H
J Z F 1 4 - 1CMP AL, 000 O O O O 8
MOV AH, O l O O O O O O 8
JE F 1 4 - 2MOV AH, lOOOOOOO8
F 1 3 MOV B H . 2 6 H , D SK -E RR l 2 6 X X )
CMP AL, oooooo loa
AND AL, oo I iooooe
F 1 4 - 2 OR B Y T E P T R E Q U I P - F L A G , A H
F 1 4- 1 MOV AL,FDC-RESET , T U R N D R I V E 0 MOTOR OFF
F I 5 MOV I N T R - F L A G . 0 0 H S E T S TR A Y I N T E R R U P T F L A G I 0
, ----- T U R N D R I V E 0 MOTOR OFF
O U T O F 2 H , A L
MO V DI, OFFSET PRINT-~IM-OUT , S E T D E F A U L T P R T TIMEOUT
P US H DSP OP E S
MOV A X , 1 4 1 4 H , D E F A U L T - 2 0STOSUSTOSUM O V A X . 0 1 0 1 H , R S 2 3 2 D E F A U L T = O ISTOSUSTOSUI N A L . I N TA O 1AND A L , O FE H E N AB L E T I M E R I N 1 ( L V L 0 )
OUT I NTAO 1, A LASSUME DS XXDATA
MOV AX, XXD ATAMOV DS,AX
P U S H D S
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 407/605
O E C 3
OECEO K 9OECEOECDOEDOOEDOO E D 2O E D 4O E D 7OE D9OEDE
OEDD
OEEOO E E 3O E E 50 E E 5O E E 9
OEEEOEECOEEDOEEEOEEFOEF I
O E F 3O E F 7O E F EO E F 9OEFAO E F EO E F E09000 9 0 2090509060908
0 9 0 A09 10
0911
09 1 20918
09 19
EO 3 E O O l E R 00
I F74 10E 2 02E 8 I A O C R
E 4 00CD 16EO F C I C75 F 7E E 05E 2 01
E E I A O C R
ED 0 0 3 D R33 F6
2 E . EE 56 00
EO AA
E EI EE CI F3 C A A75 06E9 9 4 OOOE R4 64 64 54 5E 3 FD 4 17 5 E 53 3 DEE A 0 3 F AE CA 8 F E75 08
C 7 E 7 0000 R 0 3 F E4 3
4 3C 7 E 7 0000 R 0 2 F 84 34 3
0 9 1 A BE C 60 9 1 C E 1 0 30 9 1 E D 2 C E0920 O A C 3
0 9 2 2 08 06 0011 R
0926 BE C E0 9 2 8 E8 0 2 F E0928 E A O 2 F C0 9 2 E 2 A CO0930 E E0931 E E 000933 E 7 030935 E C0936 E E 000938 EO 020 9 3A E 7 0 30 9 3 C E E0 9 3 0 E E 000 9 3 F E 7 D 30 9 4 1 E C
0 9 4 2 AB 080 9 4 4 7 4 230 9 4 6 A 8 0 1
0 9 4 80 9 4 A0 9 4 Cn 9 4 E0 9 4 F095 I0 9 5 30 9 5 40956
0 9 5 80958
0 9 5 E
09600 9 6 3
09690960
0 9 6 F0 9 7 20 9 7 40 9 7 A0 9 7 C0 9 7 00980
09820985
0 9 8 70 9 E A
7 5 I F2A COE 7 0 3E EE E 00E 7 D 3E C2 4 087 4 I1
EO C 9 20F 6 C I CO7 5 0 9
EO C 9 4 0C 7 06 0008 R 0 2 F 8
0 8 OE 0011 R33 D 2F 6 C I 4 07 4 18
E 1 3 E 0000 R 0 2 F 87 4 0 14 2E8 0 0 8 7CO 1 4F 6 C 4 I €7 5 05B E 0118
CO 1 4
POST-ERR, OOH , CHECK FOR "POST-ERR" NON-ZERODS D A T ADSF I 5 A - 0 , C O N T IN U E I F N O E R RO RD L , 2 , 2 S H O R T B E E P S ( E R R O R )ERR-BEEP
AH, 00
1 6 H , W A I T F O R " E N T E R " K E YA H, I C HERR-WAI TS H O R T F I S CD L . I . I S H O R T B E E P ( N O E R R O R S )
C H PASSUMEPOPJ EHOVC A L L
HOVI N TC H PJ N EJ H P
F I S A - 0 H O V
i l 5 C HOV E P, OF FS ET F 4 , PRT-SRC-TEL
F 16 , PRT-EASE
ERR-WA I T
CALL ERR-BEEP----- S E TU P P R I N T E R A ND R S 2 3 2 E A S E A DD R E SS E S I F D E V I C E A T TA C H ED
XOR SI,SI
H OV D X , C S [ B P I , G E T P R I N T E R E A S E A D D RHOV AL , OAAH , W R I T E D A T A T O P O R T AO U T D X , A L
P U S H DS , B U S S E T T L I N GI N A L,D X , READ PORT APOP D SC H P A L , O A A H , D A T A P A T T E R N S A M EJ NE F 1 7 , NO - CHECK NEXT PRT CDH O V P R I N T E R - E A S E t S I 1 , D X , Y E S - S T O R E P R T B A S E A D D RI N C SI , I NCR EMEN T TO NEXT UORDI N C 51
I N C E PC HP E P , O F F S ET F 4 E
,A L L P O S S I B L E A D DR S C H E C KE D ?
J N E F16 , PRT-EASEXOR EX,EX , S E T A D D R E S S E A S EHOV DX, O3FAH , P O I N T TO I N T ID R E G I S T E RI N A L,D X , READ PORTT E S T A L , O F E H , S EE M TO B E A N E 2 5 0J N Z F I EH O V R S 2 3 2 - B A S E C E X 1 . 3 F E H , S E T U P R S 2 3 2 C O IF1 ADDRI N C E X
I N C B X
I N C E X , ( A L W A Y S P R E S E N T )I N C E X
F 1 7 I N C E P , P O I N T T O N E X T E A S E A D D R
F I E HOV R S 2 3 2 - E 4 S E [ B X l , 2 F E H , S E T UP R S 2 3 2 IF 2
,----- S E T U P E Q U I P F L A G TO I N D I C A T E N UH EE R OF P R I N T E R S A ND R S 2 3 2
, C A R D SH O V A X , S I , SI HAS 2+ N U H E E R O F P R I N T E R SH O V C L , 3 , S H I F T C O U N TR O R A L , C L , R O T A T E R I G H T 3 P O S I T I O N SO R A L , E L , OR I N T H E R S 2 3 2 C OU NT
OR B Y T E P T R E Q U I P - F L A G + I , A L , STORE AS SECOND BYTE,----- S E T E Q U I P F L A G TO I N D I C A T E P RE SE N CE OF S E R I A L P R I N T E R
, A T T A C H E D TO ON B O AR D R S 2 3 2 P O R T - - - A S S U M P T I O N - - " R T S " IS T I E D T O, " C A RR I ER D E TE C T'' I N T H E C A BL E P L U G F OR T H I S S P E C I F I C P R I N T E R
HOVHOVHOVSUEOUTJ H PXCHGI NJ H PHOVXCHGOUTJ H PXCHGI N
T E S TJ ZT E S T
J N ZSUEXCHGOUTJ H PXCHGI NAN0J Z
CX, AXE X , 2 F E HD X , 2 F C HA L , A LD X , A L1+2DX, EXAL . DX1+2
A L , 02H
DX, EXD X , A L1+2DX, EXA L , D X
AL , 0000 I O O O EF 19-AA L , 0000000 IE
F 19-AA L , A LDX, EXD X , A L1+2OX, EXA L , D XA L , 0000 I O O O E
F 19-A
S A VE P R I N T E R C O U NT I N CXS E T P O I N T E R T O M O D E M S T A T U S R E GPO I N T TO MODEM CONTROL REG
C LE AR I TD E L A YP O I N T T O M O D E M S T A T U S R E GC LE AR I TD E L A YB R I N G U P R T SPO I N T TO MODEM CONTROL REG
D E L A YP O I N T T O M O D E M S T A T U S R E GGET CONTENTS
H A S C A R R I E R D E T E C T C H A N G E D ?N O, T H E N N O P R I N T E RD I D C T S C H AN G E? ( A S W I T H U R A PC O N N E C T O R I N S T A L L E D )WRAP CONNECTOR ON I F I T D I DS E T R T S O F FPO I N T TO MODEM CONTROL REGDROP RTSD E L A YMODEM STATUS REGG E T S T A T U SH A S C A R R I E R D E T E C T C H A N G E D ?N O . T H E N N O P R I N T E R
, C A R R IE R D E T E C T I S- F OL L O W IN G R T S - I N D I C A T E S E R I A L P R I N T E R A T TA CH E DO R C L . 0 0 1 0 0 0 0 0 E ,T E S T C L , l l O O O O O O E , C H EC K F OR N O P A R A L L E L P R I N T E R SJ N Z F 1 9 - A , D O N O TH IN G I F P A R A L L E L P R IN T E R
OR CL,OIOOOOOOE , I N D I C A T E I P R I N T E R A T T A C H E DH OV P R I N T E R _ E A S E , P F E H S T O RE O N-B OA RD R S 2 3 2 B A S E I N
, ATTACHED
CRINTER EASEFS-A OR BYTE P T R EQUIP-F~AG+I,CL , STORE AS SECOND B Y T E
XOR DX,DX , P O I N T T O F I R S T S E R I A L P O RTT E S T C L , 0 4 0 H , S E R I A L P R I N T E R A TT AC H ED ?J Z F 1 9 - C , NO, S K I P I N I TC M P R S 2 3 2 _ E A S E , O Z F E H , P R IN T E R I N F I R S T S E R I A L P OR TJ E F 1 9 - E , YES, JUMPI N C O X , N O P O I N T T O S EC ON D S E R I A L P O R T
I N 1 1 4HT E S T A H, I E H , ERROR'J N Z F 1 9 - C , YES, JUMPM O V A X , O I I B H , SEND CANCEL COMMAND TOI N 1 1 4 H , S E R I A L P R I N T E R
F l 9 - 8 MOV A X , E 7 H , I N I T S E R I A L P RI NT ER
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 408/605
0 9 B C
0 9 B F
099009920 9 9 40997099909980 9 A I
0 9 A 30 9 A S0 9 A 7
0 9 A D
0 9 A F
0980098209840 9 B A
EA 0201E C
24 F O
75 03E9 0043 R3c 207 4 F9
8 1 3 E 0072 R 4 3 2 174 oc3c 10
7 4 OB
C 7 06 0072 R 1 2 3 4
CD 19
F A
28 CO
B E DEC 7 06 0020 R F E A 5 RCD BO
0 9 B C0 9 B C E A 02010 9 B F E t
0 9 CO 2 4 F O0 9 C 2 7 5 030 9 C 4 E 9 O A 6 1 R0 9 C 7 3 C 100 9 C 9 75 03
0 9 C B E 9 01\61 R0 9 C E E A F O
U9DO BO FF OA
0 9 D 3 7 C 63
0 9 D 6 560 9 0 7 520 9 D B 8 4 020 9 D A E A 15210 9 D D 87 070 9 D F C D 10
0 9 E I B E 0030 R0 9 E 4 89 00050 9 E 7 2 E : E A 040 9 E A 4 6
0 9 E B E 8 I B B A R0 9 E E E 2 F7
OSOS cia
0 9 F O 86 1609F2 84 0209F4 CO 10
09F6 84 OB0 9 F B C D 10
0 9 F A F E C 20 9 F C 3 C 200 9 F E 7 5 F2
O A O O 5 AO A O I 5 E
O A 02 5 BO A 0 3 BO F E 20O A 06 7 4 2 1OAOB BO F E 40OAOB 7 4 I COAOD 2 E E A 0 401\10 E 8 I B B A RO A 1 3 BO F F 20O A l 6 7 0 03O A I B E 9 O AB B R
O A I B I EO A I C 50
01\10 B e ---- R
Q U O BE 08
O A 2 2 B E 3 E O O l B R
O A 2 6 58O A 2 7 I F
O A 2 B C 3
F 1 9 - C M OV O X , 0 2 0 1 H
I N A L,D X , GET MFG I E R V I C E M OD E I N F O
A N D A L . O F O H , IS H I G H O R D E R N I B B L E = 09
J N Z F19-1 , ( B U R N - I N MODE1F19-0 J M P S T A R T , E L S E GO T O B E G I N N I N G OF P O S TF19-1 CMP AL,OO1OOOOOB , S E R V I C E M O D E L O O P ?
J E F19-0 , B R A N C H T O S T A R TC M P R E S E T - F L A G . 4 3 2 1 H , D I A G C O NT R OL PR O GR A M R E S T A R T ?
J E F19-3 , NO, GO BOOTCMP AL,OOO1OOOOB , M F G D C P R U N R E Q U E S TJ E F19-3M O V R E S E T _ F L A C , 1 2 3 4 H , S E T U AR M S T A RT I N D I C A T O R I N C A S E
I N 1 I 9 H , GO TO THE BOOT LOADER
ASSUME D S A B S 0
S U B A X , A X
M OV D S ,A X R E S E T T I M E R I N 1
I N 1 BOH , E N T E R D C P T HR OU GH I N 1 BOH
T H I S S U B R O U T I N E IS T H E G E N E R A L E R R O R H A N D L E R F O R T H E P O S T
, O F C A R T R I D G E R E S E T
F19-3 C L I
MOV INT-PTR, OFFSET T~MER-INT
..................................................................
, E N T R Y R E Q U I R E M E N T S
SI = O F F S E T ( A D D R E S S ) O F M E SS A GE B U F F E REX= ERROR CODE FOR M A N U F A C T U R I N G OR S E R V I C E M O DER E G I S T E R S A R E N O T P R E S ER V E D
L O C A T I O N " P O S T - E R R " IS SET NON-ZERO I F A N ER RO R O CC UR S I NCUSTOMER MODES E R V I C E I M A N U F A C T U R I N G F L A G S A S F O L L D U S (H IGH N I B B L E O FP O R T 2 0 1 1
0000 = M A N U F A C TU R I N G ( B U R N - I N ) M OD E
0001 = M A N U F A C TU R I N G ( S Y S T E M T E S T ) M O D E0010 = S E R V I C E M OD E ( L O O P P O S T 10100 = S E R V I C E MODE ( S Y S T E M T E S T 1
..................................................................E-MSG PROC NEAR
M O V D X , 2 O I HI N A L,D X , G ET M OD E B I T S
AND AL , OFOH , I S O L A T E B I T S O F I N T E R E S TJ N Z E M 0JMP MFG-OUT , M A N U F A C T U R I N G M O D E ( B U R N - I N )
J N E E M 1JMP MFG-OUT , M F G M O DE ( S Y S T E M T E S T )
CMP BH, OAH , ERROR CODE ABOVE OAH (CRT STARTED
JL B E E P S , D O B E E P O U T P U T I F B E L O U I O H
P U S H E X , SAVE ERROR AND MODE F L A G S
P U S H 51P U S H D XM O V A H , 2 , SET CURSORMOV OX, I 5 2 I H , ROU 21, C O L 33MOV BH,? , PAGE 7I N 1 I O HMOV SI, FFSET ERROR-ERRM O V C X , 5 , P R I N T U O RD " E R R O R "
EM-0 M O V A L , C S [ S I 1I N C SICALL PRT-HEXLOOP EM-0
E M 0 C MP A L , 0 0 0 1 0 0 0 0 B ,
E M 1 MO V D H , A L , SAVE MODE
, D I S P L A Y P O S S I B L E 1 7
, L O O K F O R A B L A N K S P A CE T O P O S S I B L Y P U T C U S TO M ER L E V E L E R RO R S ( I N
. C A S E O F M U L T I E R R O R 1MOV
EM-1 MOVI N T
MOV
I N TI NCCMPJ N E
POPPOP
P O PCMPJ ECMP
J EMOV
C A L LCMPJ N LJ M P
ASSUME
EM-2 PUSHP U S HMOV
MOVMOV
POPP O P
ASSUMER E T
OH, 1 6 HAH, 2IOH
AH, 8
I O HD LAL , ' 'EM-1OX51
E XDH, O O l O O O O O BSERV-OUTDH, O l O O O O O O B
SERV-OUTA L , C S [SI1PRT-HEX
BH, 2 0 HEM-2T O T LT P0
D S X X D A T A
D SAXAX, XXDATA
DS . A X
POST-ERR, BH
AX
O SD S N O T H I N G
SET CURSOR
R O U 2 2 , C O L 3 3 ( O R A B O VE , I FM U L T I P L E E R R S 1R EA D CH AR AC TE R T H I S P O S I T I O N
P O I N T T O N E X T P O S T I O NB L A N K ?
GO C H E C K N E X T P O S I T I O N , I F NOT
R E C O V E R E R R O R P O I N T E R S
S E R V I C E M O D E 7
GET ERROR CHARACTERD I S P L A Y I TE RR OR B E L O U 2 0 7 ( H E M T R O U B L E ? l
H A L T S YS TE M I F SO
S E T E R R O R F L A G N O N - Z E R O
, R E T U R N T O C A L L E R
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 409/605
O A 2 9O A 2 9 0 A C 7O A 2 8 53O A2 C E 0 1019 R0 A 2 F 5L)
O A 3 0 B A C 30 1 \3 2 E B 1 0 A 9 R
O A 3 5 E 9 O A 0 B RO A 3 8 F AO A 3 9 B C C BO A 3 B B E D O
O A 3 D 82 02
0 A 3 F B C 0028 RO A 4 2 83 0 1 .0 1 4 4 E 9 F F 3 l RO A 47 E 2 F EO A 4 9 F E C AO A 4B 7 5 F5OA4 D B O FF 05
O A 5 0 75 69O A 5 2 BO F E 20O A 55 7 4 05O A 5 7 80 F E 4 0O A 5 A 75 5 FO A 5 C 83 0 1
0 A 5 E E 9 FF31 RO A 6 I
0161 F AO A 6 2 E 4 6 1
O A 6 4 2 4 F C
O A 6 6 E 6 6 10168 0 A 0011
O A 6 B B A C 7O A 6 D E EO A6 E 4 20 A 6 F 8 1 C 3O A 7 1 E E
O A 7 2 B B ---- R
O A 7 5 B E D 0
0 1 7 7 8 C C 8O A 7 9 BE D O
O A 7 0 0 C 0 0 2 E RO A 7E B A 0 2 F BO A B I E 9 F O B 5 R
O A 8 4 8 B CA
O A 8 6 B A 0 2 F CO A 8 9 2 A C O
O A B 0 E EO A 0C B A 0 2 F EO AB F E tO A 9 0 2 4 10
O A 9 2 7 4 F 0O A 9 4 4 AO A 9 5 87 D 1
O A 9 7 A 0 0005 RO A S A E EO A S B E B 00OASD 87 D I
O A S F E COA AO 2 4 2 0
O A A 2 E B 00
O AA 4 7 4 F9O A A6 8 7 D 1O A A B B A C 7O A A A E EO A A B E B 00OAAD 87 D 1O A A F E CO A 0 0 2 4 20
O AB 2 E 0 00O AB 4 7 4 F9
O A 0 6 B A C 301\88 87 D I
O A 0 A E EO A B 0O A B B F AOABC 2 A C OO AB E E 6 F2O AC O E 6 A 0
O A C2 F 4O A C 3 C 3O A C 4
SERV-OUTMOVP U S HC A L LPOPMOVC A L LJM P
B E EP S C L IMOVMOV
MOV
MOV€ 8 M OVJ M P
E B O L O O PD ECJ N ZCMP
J N ECMPJ ECMPJ N E
€ 8 1 MOV
J M PMFG-OUT
, I N I T
NO I
N O 2
N O 3
N O 4
T O T L T P O
C LI NAND
OUTMOVMOVOUTI NCMOVOUT
A L , B H0xXPC-BYTE0xA L , B LXPC-BYTET O T L T P O
AX, CSSS, AX
D L , 2
S P , O F F S E T E X - 0 ,B L , I
B E E P
E 0 0D LE0
BH, 0 5 H
T O T L T P ODH, 00 I O O O O O B ,E 0 1DH, O l O O O O O O B ,T O T L T P O
0L. I
B E E P
AL , POR T-0AL, OFCH
PORT-B,ALDX, IIH
A L , 0HD X, ALD X
P R I N T M S 0
D I S P L A Y IT
P R I N T L S B
SE T COD E SEG= STAC K SEG( S T A C K IS L O S T , B U T T H I N G S A REOVER, ANYWAY)2 B E E P S
SET DUMMY RETURNSH OR T BEEP
W A I T ( B E E P E R O F F )D O N E Y E T 7L O O P I F N O T6 4 K CARD ERROR’END IF NOT
SER VIC E M OD E’
END I F NOTON E M OR E BEEP FOR 6 4 K ER ROR I F I NS E R V I C E M O D E
SEN D D ATA TO AD D R ESSES 11, 12
SEND HIGH B Y T E
A L , 0L
D X, AL , -ON -BOAR D R S 2 3 2 POR T FOR C OM M U N I C AT ION S W /FIFG M ON ITORA S S U M E D S . X X D A T AMOVMOV
MOVMOVMOVMOVJ M P
MOV
MOVSUB
OUT
MOVI NANDJ ZDECXCHGMOVOUTJM PXCHGI NANDJM P
J ZXCHG
MOVOUTJM PXCHG
I NANDJM PJ ZMOVXCHG
OUT
C LSUBOUTOUT
H L TR E TE-MSG ENDP
AX, XXD ATAD S, AX
AX, CSSS, AXS P , O F F S E T E X ID X . O Z F B H5 8 2 5 0
CX, DX
D X, 0 2 F C HA L , A L
D X , A LD X, O2 FEHA L , D XA L , 000100000
N O 2D XDX, CXAL, MFG-TSTD X, ALL + 2DX, CXAL, OXAL , O O l O O O O O B
L+2
M 0 3DX, CXA L , BH
D X , A LL+2
DX, CXA L , D XA L , 00 1000000L+2M 0 4A L , B LDX, CXD X . A L
A L , A LO F 2 H , A LOAOH, AL
SEND LOW BYTE
P O I N T T O D A T A S E G M E N T C O N T A I N I N GC H E C K P O I N T (t
S E T S T A C K F O R R T N
L I N E C O NT R OL RE G A D DR E S SGO S E T U P F O R 9600, ODD, 2 S T O PB I T S , 0 B I T S
DX CAME BACK W I T H X M I T R E GADDRESS I N I TMODEM CONTROL RCGSET D TR AND R T S LOW SO P O S S I B L EW RAP PL U G W ON’ T C ON FU SE TH IN GS
MODEM STATUS REG
C TS U P YET ’L O O P T I L L I T ISS E T DX:2FD ( L I N E S T A T U S R E G )P O I N T TO X M I T D A T 4 R EGG E T MF G R O U T I N E ER RO R I N D I C A T O R( M AY BE W RONG FOR .EAR L Y ER R OR S)D E L A YP O I N T D X Z 2 F DT R A N S M I T E M P T Y ?
D E L A Y
LO OP T I L L I T IS
GET MSB OF ERROR WORD
D E L A Y
U A I T F O R X M I T E M PT Y
D E L A Y
GET L S 0 OF ERROR WORD
D I S A B L E I N T S
STOP DISKETTE MOTORD I S A B L E N M l
H A L T
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 411/605
O A F 8O A F E E CO A F 9 E B 00O A F E O A C 4O A F D E EO A F E 28 .D1
O B 0 0 5 1O B 0 1 ZB CS
OB03 E CO B 0 4 U 01
O B 0 6 74 Q2O B 0 0 E2 F3
OBOA S30- we70- m '09
0- C M D E0 8 l U 714 0 7O B 1 3 413 D l0815 E CO B 1 6 ' E E 0 2O E l E E O FFO E I A C 308 I E
08 IBOBIBOB C08 I EOB20O B 2 2
O B 2 40826OEZE
0 8 2 A0830
0834
0837O B 3 8O E 3 AOE3 CO E 3 EO B 4 I
0 8 4 30 8 4 5
O B 4 80 8 4 8OE4 D0 E 4 E0850
0852
0 8 5 40859
F B28 COCD 10
28 COE E DE
E 4 622 4 0 475 28
C 7 06 0078 R E F C 7 RE C O E 0 0 7 A R
E9 0004
SIE 4 00CD 137 2 O FE8 020128 D 2E E C 2EB 7COO R
E 9 0001
CD 135973 0 4E 2 E 5
CD 18
E A 7 C O O ---- R
I T
A T 2 I
A T 2 2
A T 2 3A T 2 4I T
PROC
I NJM POROUTSUEP U S HSUEI NT E S TJ EL O O P
POPCMPJ N EORJ EADDI N
JM PMOVR E T
N E A R
A L , D Xs + 2A L , A HD X , A LDX, CXc xcx , cxA L , D XA L . IA T 2 2A T 2 I
c xA L , EHA T 2 3E L , B LA T 2 4D X, C XA L . D XS H O R T A T 2 4 ,A L , O F F H
R E A D S T A T U S R E G I S T E Rl I 0 D E L A YS ET T ES T 8 1 1U R l T E I T T O T HE S T A TU S R E G I ST E RP O I N T T O I N T E RR U P T I D R E G I S T E R
U A I T F OR E 2 5 0 I N T E R R U P T T O OCCURR EA D I N T R I D RE GI N T E R R U P T P E N D I N G ?YES - R ETU R N U I I N T E R R U P T IO I N A LNO - T R Y A G A I N
A L = I I F N O I N T E R R U P T O CC UR RE DI N T E R R U P T UE ' R E L O O K I N G F O R 7NOD ON E U I T H T E S T FO R T H I S I N T ER R U P TR E T U R N U I C O N TE N T S OF I N T R I D R EGR E A D S T A T U S R E G I S T E R T O C L E AR T H EI N T ER R U P T ( U H E N E L = 1 )R E T U R N C O N T E N T S O F S T A T U S R E GS E T ER RO R I N D I C A T O R
, BOOT STR AP L OAD ERTRACK 0, SECTOR I I S RE AD I N T O T H EB O O T L O C A T I O N ( S E G M E N T 0, O F F S E T 7 C O O )A ND C O N T R OL I S T R A N S FE R R E D T H E R E
I F T H E D I S K E T T E I S N OT P RE S EN T O R H A S AP R OB L EM L O A D I N G ( E G N OT R E A D Y ) A N I N 1I B H I S E X EC U IT ED I F A C AR TR ID GE ;C AS VEC TOR EDI N 1 IBH T O I T S E L F , C ON TR OL U I L L B E P AS S E D T OT H E C A R T R I D G E
A S S UM E C S C O D E , D S A B S 0
S T I , E N A B L E I N T E R R U P T SS U B A X , A X , S E T 4 0 x 2 5 BLU MODE ON CRTI N T IOH
SU B AX,AX , E S T A B L I S H A D D R E S S I N GMOV D S . A X
I N A L, PO R T- C , G ET C O N F I G 8 1 1 sAND AL,OOOOO1OOE , IS D I S K E T T E P R ES E NT -J N Z H3 NO THEN ATTEMP T TO GO TO CART
MOV UORD PTR D I S K - P O I N T E R , O F F S E T D I S K - E A SEMOV UORD PTR D I K-POI NTER*2 , CS
- -_ - - L O A D S Y S TE M F RO M D I S K E T T E -- C X H AS R ETR Y C OU N TMOV C X . 4 , SET R ETR Y C OU N T
MOV AH,O , R E S E T T H E D I S K E T T E S Y S T EMI N 1 13H , D I K E T T E - I 0
J C H 2 , I F E RRO R, T R Y A G A I N
M O V A X , 2 0 1 H , R EA D I N TH E S I N G L E S EC TO RSU E D X,D X , T O T H E B O O T L O C A T I O NM OV ES,D XMOV BX, OFFS ET BOOT-LOCN
MOV CX, I , SECTOR 1, TR AC K 0I N 1 I 3 H , D I S K E T T E - I O
H 2 P O P C X , RECOVER RETRY COUNTJ N C H 3 A , C F S E T B Y U N SU C C ESSFU L R EADL O O P HI D O I T F OR R E TR Y T I M E S
________________________________________- - - - - -- - - -- - - -
BOOT-STRAP PROC NEAR
,_-_ - - E E I F D I S K E T T E P R E S E N T
,_ - _ _ _E S E T T H E D I S K P A RA M ET ER i A B L b V EC TO R
H I P U S H C Y , SAVE R ETR Y C OU N T
, D R I V E 0, HEAD 0
,_---- UNABLE TO I P L FROM THE D I ~ K E T T E
H3 I N 1 IBH , G O T O E A S I C OR C A R T R I D G E--_-_ P L U A S S U C CE S S FU L
h 3 A J MP E O O T L O C NBOOT-STRAP ENDP
, T H I S R O U T I N E P E RF OR MS A R E A D I U R I T E T E S T O N A B L O CK O F, S TO R AG E ( M AX S I Z E = 3 2 K E ) I F "UARM START" , F I L L, B LO CK U l T H 0000 AND RETURN, D A T A P A T T E R N S U S E D
___________________-_- -__- - - - - -_ - - - - - -_ - - -_ - - - -_ - - - - - - -
0->FF O N O NE B Y T E T O T E S T D A T A B U SAAAA. 5555, O O F F, F F O O F O R A L L U O RD SF I L L U l T H 0000 B EF OR E E X I T
, O N E N T R Y, ES AD D R ESS OF STOR AGE TO BE TESTED, D S = AD D R ESS OF STOR AGE TO BE TESTE D, C X = UORD COUNT OF STORAGE BLO CK TO BE TES TED
, ON E X I T, Z E R O F L A G = O F F I F STORAGE ERROR, I F Z E R O F L A G = O F F, T H E N C X X O R 'E O B I T P A T T E R N
, O F T H E E X P E C T E D D A T A P A T T E R N VS T H E A C T U A L D A T A, READ ( I E , A B I T "ON" I N A L I S TH E B I T I N E RR O R), A H Z 0 3 I F BOT H BYTES OF U OR D H AVE ER R ORS, A H = 0 2 I F LOU ( E V E N ) B Y T E H A S E RR OR
, A H = 0 1 I F H I ( O D D ) B Y T E H A S E R R O R, AX, EX, CX, DX, D I , S I A R E A L L D E S T R O Y E D
( M AX = E000H ( 3 2 K U O R D S ) )
--______-___-___________________________--_------------
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 412/605
O B 5 9
OB59OBSAOB5C
O B I €0860
O B 6 4O B 6 8OB6A0 8 6 CO B6 EO B 7 0
O B 7 2O B 7 6O B 7 80879O B7 0O B7 F088 1
O B 8 3
F C28 FF28 CO
B E 0888 I E 0472 R
8 1 F B 12348 C czBE D A75 OBF31 ABB E 08
89 1 E 0 4 7 2 RBE D Ac38 1 F B 432174 EF88 05BA 0532 C 4
OB85 74 03O B 8 7 E 9 O CO C R0 8 8 A F E C 4O B 8C B A C 4OBBE 75 E F
0890 8B E 9OB 92 BB AAAAO B 9 5 88 08O B 9 7 B A 5555
OBSA F 3 I AB
O B 9 C 4 F0890 4FO B9 E F DOBSF BB F7O B A 1 BB CDO BA30 8 A 3 A DO BA4 33 C 3O BA6 7 1 64'OBAB BB C 20 8 A A A BO EA B E 2 F6OBAD 88 CDO BAF F COBBO 46O BBl 46
OBBZ 88 FEO B 8 4 88 D A0866 BA OOFF0889 ADOBBA 33 C 3OBBC 75 4 EOBBE BB c2OBCO ABO B C l E 2 F6OBC3 BB CDO BC 5 F DO BC 6 4 EO BC 7 4 EOBC8 88 F EOBCA 88 D AOBCC F7 02OBCE OA 020800 74 E 7
O B 0 2 F CO B 0 3 83 C 6 04O B 0 6 F7 02OB08 88 FEOBDA 88 CDOBDCOBDC ADOBDD 33 C 2OBDF 75 28
O B E l A B
O BE 2 E 2 F 8OBE4 FOO B E S 4 EO BE6 4 E
O BE7 BA 0201OBEA EC
OBEB 24 FOOBEO 3C FOOBEF 74 10O B F l 8 C C 9O B F 3 8 C 03
O BF 5 38 CBO B F 7 74 08O B F 9 BO 18
PODSTG PROC
P 12
P I :
P 2 :
P Y :
P 3 :
P X ;
P 4 :
ASSUMECLDSUBSUB
MOVMOVCMPMOVMOVJ N ER EPMOV
MOVMOVR ETCMPJ EnovMOVXORJ ZJMPI NCMOVJ N Z
MOVMOVMOVMOV
REP
DECDECSTDMOVMOV
LODSUXORJ N ZMOVSTOSULOOPMOVCLD1NCI NC
MOVMOVMOVLODSUXORJ N ZMOVSTOSULOOPMOVSTDDECDECMOVMOVNOTORJ Z
CLDADDNOTMOVMOV
LODSUXORJ N ZSTOSU
LOOPSTDDECDEC
NEAROS: ABS0
D I , D I ; SET DI=OOOO REL . TO START OF SEGAX. AX ; I N I T I A L D AT A P A TT E R N F OR 0 0 - F F
; SET D IR EC T IO N T O IN C R EMEN T
; T ESTDS AX . SET DS TO ABS0BX: DATA-UORD LRE SiT-F LAG -DA TA1 , UARM START?B X , l 2 3 4 H
; T ESTDS AX . SET DS TO ABS0BX: DATA-UORD LRE SiT-F LAG -DA TA1 , UARM START?B X , l 2 3 4 HOX, ESOS, OX ; RESTORE D SP ISTOSU ; S I M P L E FILL U I T H 0 ON UARM-STARTOS, AX
DATA-UORDCRESET-FLAG-DATA1,BXOS, OX ; RESTORE D S
BX, 4 3 2 HP I2
I D I 1 , A LAL, I D 1 1AL, AHP YP BAHAL, AHP2
BP, cxAX, OAAAAHBX, AXO X , 0 5 5 5 5 H
STOSU
D ID I
S I , D Icx, B P
AX, BXP 8AX, OX
P 3cx, B P
SISI
01.51BX, OXOX, OOFFH
AX. BXP BAX, O X
P Xcx, B P
SISIDI,SIEX. OXOXD L , D LPX .
51.4
cx, B P
OXD I , S I
AX, OXP 8
P 4
SI
; A N D E X I T; D IAG . R EST AR T ?; 00 FILL U I T H Z ER OS; U R I T E T E S T D A T A; G ET I T B A CK; COMPARE TO EXPECTED
; E R R O R E X I T I F HISCOMPARE; FORM NEU DATA PATTERN
; LOOP T I L L A L L 256 D AT A PAT T ER N S; DONE; SAVE UORD COUNT; LOAD DATA PATTERN
; LOAD OTHER DAT A PAT TER N
; F I L L UORDS F RO M L O U TO H IG H; U I T H A AA A; P O I N T TO L A S T UORD U R I T T E N
; S E T D I R E C T I O N F L A G TO GO DOUN; SET IND EX REGS. EQUAL; RECOVER UORD COUNT; GO F RO M H I G H T O L O U; GET UORD FROM MEMORY; EQUAL UHAT S I B THERE?; GO E R R O R E X I T I F NOT; GET 55 D AT A PAT T ER N; S TO RE I T I N L O CA T I O N J U S T R EA D; L OO P T I L L A L L B Y T E S DON E; RECOVER UORD COUNT; BACK TO INCREMENT; AD J U ST PT R S
; S I 8 D AT A PAT T ER N T O BX
; DATA FOR CHECKERBOARD PATTERN; GET UORD FROM MEMORY; EQ U AL U H AT 578 THERE?; GO ERROR E X I T I F N OT; GET OTHER PATTERN; STORE I T I N L O C A TI O N J US T REA D; L OO P T I L L A L L B Y T E S D ON E; RECOVER UORD COUNT; DECREMENT; ADJUST PTRS
; S I B DATA PATTER N TO BX; MAKE PA TTERN FFOO; F I R S T P A S S ?
; INCREMENT
; L O U T O H I G H; GET A UORD; SHOULD COMPARE TO OX; GO ERROR I F NOT; U R I T E 0000 BAC K T O L O C AT IO N; JUST READ; L OO P T I L L D ON E; BACK TO DECREMENT; ADJUST POINTER DOUN TO LAST UORD
SI ; U R I T T E NCHECK I F I N S E R V l C E l M F G M OD ES , I F SO, PERFORM REFRESH CHECK
MOV DX,POIHI N AL,DX ; GET O P T I O N B I T S
AND AL,OFOHCMP AL,OFOH ; AL L B I T S H IGH =N O RMAL MOD EJ E P 6MOV CX,CSMOV 8X,SSCMP CX,BX ; SEE I F IN PRE-STACK MODEJ E P 6 ; BYPASS R ET EN T IO N T EST I F SOMOV AL,24 ; SET OUTER LOOP COUNT
; U A I T A B O U T 6-8 SECONDS UITHOUT ACCESSING MEMORY; I F REFRESH IS NOT UORKING PROPERLY, T H IS SHOULD; BE ENOUGH T IM E FOR SOME DATA TO GO SOUR.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 413/605
O BF B E 2 F EO BF D F E C BO B F F 7 5 F A
O C O l EB CDO C 0 3 A DOCO4 OB COO C 0 6 75 04OCOB E2 F9O CO A E B 13OCOC EB C BOCOE 32 E 4O C l O O A EO
oc12 7 4 02O C 1 4 F E C 4O C 1 6 OA C 9O C I B 7 4 03O C I A EO C 4 02O C l D OA E 4
O C l F F Coc20 c3oc2 I
ocz I
o c 2 1 I Eoc22 55
O C 2 3 50OCZO 53O C 2 5 5 1O C 2 6 52O C 2 7 ED O C4A RO C 2 A E A EO00
O C2 D E 3 I F
O C 2 F CD 82O C 3 1 93 00
O C 3 3 82 00O C 3 5 86 94OC 37 BO OCDD RO C 3 A CD E 2O C3 C F E C 3O C 3 E EO F A 20
O C 4 l 7 C F2O C 4 3 S AO C 4 4 59O C 4 5 58O C 4 6 58O C4 7 5 0
O C 4 B I FO C 4 9 C 3O C4AO C4A 03O C 4 B 20 DC= O C 4 0OC4D 28 F BO C 4 F 28 F BO C 5 1 02 07 01 09 0 3 04
09 0 4 01 F BOCSB 02 07 01 OA 02 05
07 05 01 F BO C 6 5 02 07 0 1 OB 0 1 06
05 06 01 F BO C 6 F 04 0 3 05 0 3 03 03
0 3 05 03 05 03 F BO C 7 B 04 0 3 05 03 03 03
0 3 06 01 06 03 F BO CE 7 0 4 03 05 OB 04 OD
0 3 F BO C B F 04 0 3 05 07 05 OD
03 F BO C 9 7 04 03 05 08 04 OD
03 F BO C S F 04 03 05 03 03 0 3
0 3 OD 0 3 F BO CA 9 0 4 0 3 05 0 3 0 3 03
03 0 3 0 1 05 01 0303 F B
O C B 7 02 07 0 1 OB 01 05
02 0 3 02 05 0 1 F BO C C 3 02 07 01 OA 02 05
0 3 0 1 03 05 0 1 F BO C C F 02 07 01 09 0 3 05
07 05 01 F BO C D 9 28 FBOCDE 28 F COCDD 02O CDE DE
OCDF 02 77 02 7 7 02 7702 77 02 F C
= OCDF
P S L OO P P SD E C A LJ N Z P S
P 6 M OV C X , E P , RECOVER UORD COUNTP 7 L O D S U , GET UORD
OR AX,AX , = TO 0000
J N Z P E , ERROR I F NOTL OO P P 7 , L O OP T I L L D ON EJ M P SHORT P I 1 , T HE N E X I T
X O R A H,A HOR cn.cn , H I G H B Y TE E RRO R'
J Z P 9
P B M OV CX .A X , S AV E B I T S I N ERROR
I N C A H , SET nicn B Y T F ERRORP 9 O R C L , CL , L O U B Y T E E R R O R 7
J Z P I 0A DD A H.2
P I 0 OR A H, AH , S E T Z ER O F L A G Z O (E R R OR I N D I C A T I O NP I 1 C L D , S E T D I R F L A G B A C K T O I N C R EM E N T
P O D S T G E N D P, N N N N N N N N N N N N N N N N N N ~ N N N N N N N N N N ~ N ~ ~ N N N N ~ N N N N N N N N N N N ~ N N N ~ *
, PUT-LOGO PROCEDURE
, O U T P U T R O U T I N E SO THA T THE IB M LO GO , A M E S S A GE ,
, A X ,B X , A ND OX A RE DE S TRO Y E D A L L O THE RS A RE S A V E D
R E T , R E T U R N T O C A L L E R
, THIS PROC SETS UP POINTERS AND CA LLS THE SCREEN
, AND A COLOR BAR ARE PUT UP ON T H E SCREEN
N N N N N N N N N N N N N N N ~ ~ N N N N ~ N N * N N * N ~ N N N * N N N ~ N N U N * N N N * N N N N * N * N
P U T L O G 0 P ROCP u s nP u s n
P u s nP u s nP u s nP u s nMOVnovMOV
I N TMOVMOV
A G A I N M O VMOVI N TI NCCUP
JL
P O PP O PP O PP O PP O PP O PR E T
P U T L O G 0 E N DPLOGO OB
DELOGO-E =
D EOB
DE
DB
DE
D E
DE
DE
DE
D E
DE
D E
D E
DB
D E
DED E
C O L O R D BDE
D ECOLORJ =
ASSUME
NEARD SB P
AXE XcxD XB P , O F F S E T L O G O ,
O X. eooon P O I N T DH D L A T R O U . C O L U I l N 0 . 0
EL; 0001 I I I IB
E ~ H
OH, 9411
ezn
EL, OOOOOOOOBD L , 0
B P . O FF S E T CO LO R
8LD L , 32
A T T R I B U T E O F C HA R A CT E R S T O b EUR I T T E NC A L L O U T P U T R O U T I N E
I N I T I A L I Z E A TT R IB UT EI N I T I A L I Z E C OLUM NS ET L I N EO U T P U T G I V E N C O LO R B A R
I N C R E M E N T A T T R I B U T E
P AS T 4 0 7
C A L L O U T P U T R O U T I N E
I S HE COLUMN COUNTER PONTNG
A G A I N , I F NOT, D O I T A GA INDXCXE XAXE P , R E S T O R E B PD S , R E S T O R E D S
LOGOJ - LOGO
S
40, -5
4 0 , -52.7. 1 , 9 , 3 , 4 , 9 , 4 , 1,-5
' ' ,220
2 , 7 , 1 . 1 0 , 2 , 5 , 7 , 5 . l , - 5
2 , 7 , 1 , 1 1 , 1 , 6 , 5 , 6 . 1 , - 5
4 , 3 , 5 , 3 , 3 , 3 , 3 , 5 , 3 . 5 , 3 , - 5
4 , 3 , 5 . 3 , 3 , 3 , 3 , 6 , 1.6.3,-5
4 , 3 , 5 , 8 , 4 . 13.3,-5
4,3,5,7.5, 13,3,-5
4 , 3 . 5 , 8 , 4 . 13,3,-5
4 , 3 , 5 , 3 , 3 , 3 , 3 , 13,3,-5
4 , 3 . 5 , 3 , 3 , 3 , 3 . 3 , 1 , 5 , 1 . 3 , 3 , - 5
2 , 7 , 1 , 1 1 , 1 , 5 , 2 , 3 , 2 , 5 , 1 , - 5
2 , 7 , 1 . 1 0 . 2 , 5 , 3 . I , 3 , 5 , I , - 5
2 . 7 , 1 , 9 , 3 . 5 . 7 , 5 , 1 , - 5
40, -5
4 0 , - 4COLOR-E - COLOR2 19S
2, 121-2.2, 121-2.2, 121-2.2, 121-2.2, - 4
D S , D A T A
I
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 414/605
T H E S E R O U T I N E S P R O V I D E T H E C RT I N T E R F A C ET H E F O L L O U I N G F U N C T I O N S A R E P R O V I D E D :( A H ) = O S E T M O DE ( A L ) C O N T A I N S M OD E V A L U E
( A L) = O 4 0 x 2 5 BY ( PO U E R O N D E F A U L T )( A L ) = l 40x25 COLOR( A L ) = 2 80x21 BU( A L ) = 3 B O X 2 5 C OL ORG R A P H I C S M O D E S( A L ) = 4 320x200 4 COLOR( A L )= 5 3 2 0 x 2 0 0 BU 4 S H A D E S( A L )= 6 6 4 0 x 2 0 0 BU 2 SHADES( A L ) = 7 N OT V A L I D
( A L ) = B 1 6 0 X 2 0 0 16 COLOR( A L ) = 9 320x200 16 COLOR( A L ) = A 640x200 4 COLOR
**** EXTENDED MODES **I
a** NOTE BU MODES OPERATE SAME AS COLOR MODES, BUTCOLOR BURST IS NOT ENABLED
B U F FE R I S N OT C L E A RE D .**a N O T E I F H I G H O RDER B I T I N AL I S S ET , T HE R EG EN
t A H ) = l SET CURSOR TYPE( C H ) = B I T S 4-0 = S T A R T L I N E F O R CU RS O R** H AR DU AR E U I L L A L U A Y S CA U SE B L I N Ka* S E TT IN G B I T 5 OR 6 U I L L C A US E E R R AT I C
** I N G R A PH I CS MO DES, B I T 5 IS FORCED ON TO
( C L ) = B I T S 4-0 = E N D L I N E F O R C UR SO R
(OH, D L ) = ROY, COLUMN ( 0 . 0 ) IS U P P E R L E F T
(BH) = PAGE NUMBER (MUS T BE 0 F O R G R A P H I C S M O D E S )
(OH) = PAGE NUMBER (MUST BE 0 F O R G R A P H I C S M O D E S )O N E X I T ( D H , O L ) = ROU,COLUMN OF CURRENT CURSOR
B L I N K I N G O R NO CU RS OR A T A L L
D I S A B L E T H E C UR SO R
( A H ) = 2 S E T C UR SO R P O S I T I O N
( A H ) = 3 R EA O C UR SO R P O S I T I O N
( C H , C L ) = CURSOR MODE CURRENTLY SET( A H ) = 4 REAO L I G H T P E N P O S I T I O N
ON E X I T( A H ) = 0 -- L I G H T P E N S U I T C M N O T O O U N l NO T T R I G G E R ED(AH) = 1 -- V A L I D L I G H T P E N V AL UE I N R E G IS T E RS
( 0 H . D L ) R OU ,C OL UM N O F C H A RA C TE R L P P O S Nt C M ) = R A S T E R L I N E (0-199)I B X ) = P I X E L C O L U M N (0-319.639)
( A M ) = 5 S E L E C T A C T I V E D I S P L A Y P AG E ( V A L I D O NL Y FO RALPHA MOOES)
M O D E S 2 L 3 )( A L ) = N E U P A G E V A L U E ( 0 - 7 FOR MODES O B I , 0-3 FOR
I F B I T 7 ( E O M ) OF A L = l
( A L ) = EOH R E AD C R T I C P U P AG E R E G I S T E R S( A L ) = BlH S E T C P U PA G E R E G I S T E R
( A L ) = B 2 H S E T C R T P A G E R E G I S T E R
( A L ) = 83M S E T B O T H C R T A ND C P U P A G E R E G I S T E R S
R E A D I U R I T E C R T I C P U P A GE R E G I S T E R S
( E L ) = VALUE TO SET
( E M ) = VALUE TO SET
( E L ) = V A L UE T O S E T I N C P U P A G E R E G I S T E R( E M ) = V A L UE T O S E T I N C R T PA G E R E G I S T E R
I F B I T 7 (80Ml OF A L = lALUAYS RETURNS ( B H ) CONTENTS OF CRT PAGE REG
( E L ) = CONTENTS OF CPU PAGE REG( A H ) = 6 S C R O LL A C T I V E P A G E U P
( A L ) = N UM BE R O F L I N E S , I N P U T L I N E S B LA N K E D A TBOTTOM OF U INDOU, AL = 0 MEANS BLANKE N T I R E U I N D O U
( C H , C L ) = ROU,COLUMN OF UPPER LE FT CORNER OF
( D H , D L ) = ROU,COLUMN OF LOUER RIG MT CORNER OF
(BH) A T T R I B U T E T O B E U SE D ON B L A NK L I N E
( A L ) = N UM BE R O F L I N E S , I N P U T L I N E S B LA N K E D A T T OP
( C H , C L ) = ROU,COLUMN OF UPPER LE FT CORNER OF
( D H . D L ) = ROU.COLUMN OF LOUER R IGHT CORNER OF
S C R O L L
S C R O L L
(AH)=7 S C R O L L A C T I V E P A G E D O U N
O F U I N D O U , A L = O M E AN S B L A N K E N T I R E U I N D O U
S C R O L L
SCROLL(BH) = A T T R I B U T E T O B E U SE D O N B L A N K L I N E
C MA RA CT ER M A N D L I N G R O U T I N E S( A H ) = E R E A D A T T R I B U T E I C M A R A C T E R A T C UR R E NT C UR SO R P O S I T I O N
( E M ) = D I S P L A Y P AG E ( V A L I D F O R A LP H A M OD ES O N L Y )ON E X I T( A L ) = CHAR READ( A H ) = ATTRIBUTE OF CHARACTER READ (ALPHA MODES
ONLY )
( A H ) 9 U R I T E A T T R I B U T E I C H A R A C T E R A T C U R RE N T C UR SO RPOS I T I ON
( E M 1 = D I S P L A Y P A G E ( V A L I D F O R 'A L P H A M OD ES O N L Y )( C X I 5 COUNT OF CHARACTERS TO UR IT E( A L ) = C H A R T O U R I T E( E L ) = A T T R I B U T E O F- C HA R A C TE R ( A L P H A I I C O L O R O F
C H A RA C TE R ( G R A P H I C S ) S E E N O TE O N U R I T E
( A M ) = 10 (O AH I U RI TE CHARACTER ONLY AT CURRENT CURSORDOT FOR BIT 7 OF eL = I
POS I I ON( E M ) = D I S P L A Y P A G E ( V A L I D F O R A L P H A M O D E S O N L Y )( C X ) = COUNT OF CHARACTERS TO URITE( A L ) = C H A R T O U R I T E( E L ) 5 COLOR OF CHAR (GRAPHICS)
S E E NO T E O N U R I T E D O T FO R 8 1 1 7 OF BL 1
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 415/605
F OR R E A D I U R I T E C H AR A CT E R I N T E R F A C E U H l L E I N G R A P H I C S MO DE,THE CHARACTERS ARE FORMED FROM A CHARACTERG EN E RA TO R I M A G E M A I N T A I N E D I N T H E S Y S T EM RO MI N T E R R U P T 4 4 H ( L O C A T I O N 00110Hl IS USED TOP O I N T T O TH E I K B Y T E T A B L E C O N T A I N I N G T HEF I R S T 1 2 8 CH AR S ( 0 - 1 2 7 )I N T E R R U P T I F H ( L O C A T I O N O O O7 C Hl IS USED TOP O I N T T O T H E I K B Y T E T A B L E C O N T A I N I N G T H E SE CO ND1 2 8 C HA RS 1 1 2 8 - 2 5 5 1
R E P L I C A T I O N F AC TO R C ON T AIN ED I N I C X I ON EN T RY U I L LPRODUCE VAL I D RESULTS ONLY FOR CHARACTERS
CONT AI NED ON THE SAME ROU CO NTI N UA TI ON TOS U C C E E D IN G L I N E S U l L L N O T P RO DU CE C O RR E CT LY
F O R U R I T E C H AR A CT E R I N T E R F A C E I N G R A P H I C S MO DE, T H E
G R A P H I C S I N T E R F A C E( A H 1 = I 1 ( O B H ) S E T C O L O R P A L E T T E
I B H I = P A L E T T E C O L O R 1 D B E I N G SE T 1 0 - 1 2 7 1( E L I = C O LO R V A L U E T O B E U S E D U I T H T H A T C O LO R ID
COLOR ID = 0 SELECTS THE BACKGROUNDCOLOR (0-151
COLOR IO = I S E L E C T S T H E P A L E T T E TO B EUSED2 COLOR MOO€
0 = U H I T E F O R C O L O R I
I = BLACK FOR COLOR I
0 = GREEN, RED, BROUN FOR4 COLOR MODES
C O L O R S 1 . 2 . 3I = CYAN, MAGENTA, UHITE FOR
C O L O R S 1 . 2 . 3
16 COLOR MODESA L U A Y S S E T S U P P A L E T T E A SBLUE FOR COLOR I
GREEN FOR COLOR 2CYAN FOR COLOR 3REO FOR COLOR 4MAGENTA FOR COLOR 5
BROUN FOR COLOR 6
DARK GRAY FOR COLOR E
L I G H T B L U E F O R C O L O R 9L I GHT GREEN FOR COLOR 10
L I G H T C Y A N FO R C O LO R I 1
L I G H T R ED FO R C O LO R 1 2L I GHT MAGENTA FOR COLOR 13
YELLOU FOR COLOR 14U H I T E F O R C O L O R 15
L I G H T GRAY FOR COLOR 7
IN 4 0 x 2 5 OR ~ 0 x 2 5 LPHA MODES, THE VALUE SET
F O R P A L E T T E C O L O R 0 I N D I C A T E S T H E B O RD ERC OL OR TO B E U S ED I N G R A P H I C M OD ES , I TI N D I C A T E S T H E B OR D ER C O L OR A N D T H EBACKGROUND COLOR
I A H I I 2 ( O C H I U R I T E D OTI D X I = ROU NUMBERI C X I 2 COLUMN NUMBER( A L I = COLOR VALUE
I F B I T 7 O F A L I I , THEN THE COLOR VALUE ISE X C L U S I V E O R 'D U I T H TH E C UR R E N T C O N T EN T S O FTHE DOT
( A H 1 0 13 ( O D H I READ DOTl D X 1 = ROU NUMBER( C X I = COLUMN NUMBER( A L I R ET U R N S T HE D OT R E AD
, A S C I I T E L E T Y P E R O U T I N E FO R OU T PU T, ( A H 1 = 1 4 ( O E H I U R I T E T E L E T Y P E TO A C T I V E P AG E
( A L I 5 C H A R T O U R I T E
( B L ) = FOREGROUND COLOR I N GRA PH I CS MODEN O T E -- S C R E E N U I O T H IS CONTROLLED BY P R E V I O U S
MODE SET, I A H I = 15 I O F H I C U R R E N T V I D E O S T A T E
R E T U R N S T H E C U R R E N T V I D E O S T A T EI A L I = MODE CURR ENTLY SET (SE E AH=O FOR
I A H I = NUMBER OF CHARACTER COLUMNS ON SCREEN( B H I = C U R R E N T A C T I V E D I S P L A Y P A G E
, ( A H 1 = 16 (IOHI S E T P A L E T T E R E G I S T ER SI A L I 2 0 S E T P A L E T T E R E G I S T E R
E X P L A N A T I O N )
( E L I = P A L E T T E R E G I S T E R T O S E T IOOH - O F H I( B H I = VALUE TO SET
I A L I = I SET BORDER COLOR REGI STERI B H I = VALUE TO SET
C A L I = 2 S E T A L L P A L E T T E R E G I S T E R S A N D BO R DE R
E S OX P O I N T S TO A 1 7 B Y TE L I S TB Y T E S 0 THRU I5 A RE V A L U E S F O R P A L E T T E
R E G I S T E R S 0 THRU 15B Y T E 16 IS THE VALUE FOR THE BORDER
R E G l S TE R
R E G l S T E R
, NOTE, I N M O D E S U S I N G A 3 2 K R E G E N I9 AND A ) , ACCESS THROUGH THE CPU, REGI STER BY USE OF BBOOH SEGMENT VALUE ONLY REACHES THE, F I R S T . 1 6 K B I O S USES THE CONTENTS OF THE CPU PAGE REG, ( B I T S 3 .4 , L 5 O F P AG OA T i N B I O S D A T A A R E A 1 T O D E R I V E T H E, PROPER SEGMENT VALUE
, C S , S S , D S , E S , B X , C X , D X P R E S ER V E D D U R I N G C A L L, ALL OTHERS DESTROYED
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 417/605
F O R R E A D I U R I T E C H AR A CT ER I N T E R F A C E U H I L E I N G R A P H I C S M OD E,THE CHARA CTERS ARE FORMED FROM A CHARACTE RG EN ER A TO R I M A G E M A I N T A I N E D I N TH E S Y S T E M ROMI N TE R R U PT 4 4 H I L O C A T I O N 0011OH) IS USED TOP O I N T T O TH E I K B Y T E T A B LE C O N T A I N I N G TH EF I R S T 1 2 8 C HA RS 1 0 - 1 2 7 )I N TE R R U PT I F H I L O C A TI O N 0 0 0 7 C H l IS USED TOP O I N T TO T H E 1 K B Y T E T A B L E C O N T A I N I N G T H E SE CO N D128 C H A R S 1 1 2 8 - 2 5 5 1
R E P L I C A T I O N FA CT OR C O N TA IN E D I N I C X ) ON E NT RY U l L LPRODUCE VAL I D RESULTS ONLY FOR CHARACTERS
CONTA I NED ON THE SAME ROU CO NT I NU ATI O N TOS U C C E E D IN G L I N E S U l L L N O T P R OD UC E C O RR E CT L Y
F OR U R l T E C H AR A CT ER I N T E R F A C E I N G R A P H I C S M OD E, T H E
G R A P H I C S I N T E R F A C E( A H ) I 1 IOBHI S E T C O L O R P A L E T T E
I B H ) = P A L E T T E C O L O R 7 D B E I N G S E T 10-1271
I B L ) = COLOR VALUE TO BE USED U I T H T H A T C O LO R IDCOLOR ID 0 SELECTS THE EACKGROUND
COLOR I O - I S 1
COLOR ID I S E L E C T S T H E P A L E T T E T O B EUSED2 COLOR MODE
0 U H I T E F O R C O L O R II = BLACK FOR COLOR I
0 3 GREEN, RED, BROUN FOR4 COLOR MODES
C O L O R S 1 , 2 , 3
C O L O R S 1 . 2 . 31 = CYAN, MAGENTA, u n i T E FOR
16 COLOR MODESA L U A Y S S E T S U P P A L E T T E A SBLUE FOR COLOR I
GREEN FOR COLOR 2CYAN FOR COLOR 3RED FOR COLOR 4MAGENTA FOR COLOR S
BROUN FOR COLOR 6L I GHT GRAY FOR COLOR 7DARK GRAY FOR COLOR E
L I G H T B L U E F O R C O L O R 9
L I G H T G R E E N F O R C O L O R 10L I G H T C Y A N F OR C O LO R I 1
L I G H T R E D F O R C O L O R 12L I G H T M A G E N T A F O R C O L O R I 3YELLOU FOR COLOR I4
U H I T E F O R C O L O R ISI N 4 0 x 2 5 OR B O X 2 5 A L P H A MO DE S, T H E V AL U E S E T
FOR PALETTE COLOR 0 I N D I C A T E S T H E B OR DE RC O LO R T O B E U S ED I N G R A P H I C M OD ES , I TI N D I C AT ES THE BORDER COLOR AND THEBACKGROUND COLOR
( A H ) 1 2 I O C H ) U R I T E DO TI D X I = ROU NUMBER
I A L I C OLO R V A LU EI C X I = COLUMN NUMBER
I F B I T 7 O F A L = 1, THEN THE COLOR VALUE IS
THE DOTEXCLUSIVE O R ’ O UITH THE CURRENT CONTENTS OF
( A H 1 13 IODHI READ DOT( D X I R O U N U MB ERI C X I E COLUMN NUMBERI A L I R E T UR N S T HE D O T R E AD
, A S C I I T E L E T Y P E R O U T I N E FO R O U TP U T
I A L I = C H A R T O U R I T E
NOTE - - S C R E E N U I D T H IS CONTROLLED BY P R E V I O U S
, ( A H ) = 14 IOEHI URITE TE L E TY P E T O ACTIVE PAGE
I B L I = FOREGROUND COLOR I N GRAP HI C S MODE
MODE SET, I A H I 2 I5 I O F H ) C U R R E N T V I D E O S T A T E
RE TURNS THE CURRE NT v i m 0 S T A T EI A L ) = M O DE C U R R E NT L Y S E T ( S E E A H - 0 F OR
( A H 1 = NUMBER OF CHARACTER COLUMNS ON SCREENI E H I C U RR E NT A C T I V E D I S P L A Y P A G E
, I A H I I 6 I I O H I S E T P A L E T T E R E G I S T E R SI A L I = 0 S ET P A L E T T E R E G I S T E R
E X P L A N A T I O N 1
I B L I P A L E T T E R E G I S T ER TO S E T I O O H - O F H II B H I = VALUE TO SET
C A L I I SET BORDER COLOR REGI STER( B H I = V A L U E T O S E T
I A L I = 2 S E T A L L P A L E T T E R E G I S T E R S AN D B OR D ER
ES D X PO I N T S TO A 1 7 B Y T E L I S TB Y T E S 0 THRU I5 A RE V A L U E S F O R P A L E T T E
R E G I S T E R S 0 THRU I5B Y T E 16 IS THE VALUE FOR THE BORDER
R E G I S T E R
REG I S T E R
, NOTE, I N M OD ES U S I N G A 3 2 K R E GE N I 9 AND A I , ACCESS THROUGH THE CPU, R E G I S T E R B Y USE OF BBOOH SEGMENT VALUE ONLY REACHES THE, F I R S T 1 6 K BIOS USES THE CONTENTS OF THE CPU PAGE REG, ( B I T S 3 . 4 , L 5 O F P AG DA T I N BIOS D A T A A R E A 1 T O D E R I V E T H E, PROPER SEGMENT VALUE
, CS, SS, D S , E S , B X , C X , D X P R E S E R V ED D U R I N G C A L L, ALL OTHERS DESTROYED
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 418/605
.----------------_------------------------------------; V I DE O G A T E ARRAY RE G I S T E RS
; PORT 3DA OUTPUTREG 0 MODE CONTROL 1 RE G I S T E ROIH +HI B A N D U I D T H I - L O U B A N D U I D T HO2H + G RA P HI CS / - A LP HA0 4 H + B WOBH + V I DE O E NA B LEI O H +16 COLOR GRAPHICS
REG I P A LE T T E M AS K RE I S T E ROIH PALETTE MASK 002H P A L E T T E MASK 1
0 4 H P A L E T T E MASK 2o w PALETTE MASK 3
'OCEOCES + O M R(ICE6 E4SE R
O CE D E 48 8 ROCEF E52 D RO C F l F751 RO C F l E 4 B 3 RO CF S € I D 3 RO C F 7 E S 3 F ROCFS FOE4 RO CF B P I 1 3 ROCFD F I X ROCFF E143 R
O D 0 3 F146 RO D 0 5 1 9 9 2 RO D 0 7 E S B l RO D 0 9 € 6 8 5 R= 0022
ODOBOOOB F B
ODOC FCODOD 06O DO E I EODOF 52
O D l O 5 1O D 1 1 53O D 1 2 56O D 1 3 57O D14 50O D15 B A C4O D17 32 E 4O D1 9 D I EOO D l B BB F OO D lO 3 D 0 0 2 2O D 20 7 2 04
O D O ~ FIW R
O D22 58
O D 2 3 E 9 O F 7 0 RO D 2 6 € 8 1388 R
O D 2 9OD2COD3 1
O D33O D37OD3AOD3COD3EOD3FO D43OD4B
88 BBOOBO 3 E 0049 R 097 2 098 A 2 6 OOBA RBO E 4 3 8DO EC8E coSB8 A 2 6 0049 R2 E : F F A 4 O C ES R
REG 2 BORDER COLOR REGISTER
02H GREEN0 4 H R E D
OIH B L U E
o w INTENSTY
REG0IH02H0 4 HOBH
3 MODE CONTROL 2 R E G I S T E RRESERVED -- MUST BE ZERO+ E N A B L E B L I N KRESERVED -- MUST BE ZERO+2 COLOR GRAPHICS (640x200 2 COLOR ONLY)
REG 4 RE S E T RE G I S T E ROIH +ASYNCHRONOUS RESET02H +SYNCHRONOUS RESET
REGS 10 TO I F P A LE T T E RE G I S T E RSOlH B LUE02H GREEN0 4 H R E DOBH I NT E NS I T Y
; VID EO GATE ARRAY STAT US; PORT 3DA INPUT
OlH + DI S P LA Y E NA B LE02H + L I G HT P E N T RI G G ER S E T0 4 H - L I G H T P E N S U I T C H M AD EOBH + V E RT I CA L RE T RA CE1QH + V I DE O DO T SASSUME CS: CODE, DS . DATA, ES: IDEO-RAM
MOO10 LABEL UORD . T A BL E O F R O U T I NE S U I T H I N V I D E O 110D Y OFFSET ;ET-MODEDU OFFSET SET-CTVPEDU OFFS ET SET-CPOS
DU OFFSET READ-CURSORDU O F F S E T READ-LPENDU OFFSET ACT-DISP-PAGEDU O F F S E T SCROLL-UPDU O F F S E T SCROLL-DOUNDU OFFS ET READ-AC-CURRENTDU O F F S E T URITE-AC-CURRENTDU OFFSET URITE-C-CURRENTDU OFFSET SET-COLORDU OFFSET URITE-DOTDU OFF SET READ-DOTD U O FF SE T U R I T E T T VOU O F F S E T VIDEO-STATEDU OFFSET SET-PALLETTE
MOOlOL EQU 1-MOO10
V I DE O - I OS T I
CLD
PROC NEAR
ESosDXcxB XSID IAXA L , A HAH, AHAX, I
S I , A XAX. MOOIOL
; INTERRUPTS BACK ON
; S E T D I RE CT I O N F ORUARD
; SAVE SEGMENT REGISTERS
; SAVE AX VALUE; G ET I NT O LO U B Y T E; ZERO T O H I G H B Y T E; *2 FOR TABLE LOOKUP; P U T I N T O SI FOR BRANCH; T E ST F OR U I T H I N R AN GE
PUSHPUSHPUSHPUSHPUSHPUSHPUSHPUSHMOVXORS A LMOVCMPJ B C 1 ' , BRANCH AROUND BRANCHPOP AX , THROU AUAY THE PARAMETERJMP VIDEO-RETURN , DO NOTHING I F N OT I N R AN GE
MOV AX, OBBOOH , SEGMENT FOR COLOR CARDCMP CRT MOD E.9 , I N MODE US I NG 32 K RE G ENJ CMOVANDSHR
C 2 MOVPOPMOVJMP
C I C AL L DDS
V I DEO-I 0
, NO, JUMP- .
c2AH, PAGDAT , GET COPY OF PAGE REGSAH, CPUREG , ISOLATE CPU REGAH, I , SH IF T TO MAKF IN TO SEGMENT VALUEES, AX , SET UP TO PO IN T AT V ID EO RAM AREAAX , RECOVER VALUEAH, CRT-MODE GET CURRENT MODE IN T O AHUORD PTR CS CSI+bFFSET MOO101ENDP
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 419/605
O D 4 800480 0 4 A
OD 4 CO D 4 E
O D 5 0O D 5 2
O D 5 4O D 5 6ODSEODSAODSC
ODSEO D 5 E
OED00800
100010004 0 0 04 0 0 0
40000000
4 0 0 0EOOOEOOO
28 28 50 50 28 2850 00 14 28 50
O D 6 9
O D 6 9 O C OF 00 02= 0004
O D 6 0 08 O F 00 02
O D 7 1 O D O F 00 02
O D 7 5 09 O F OD 02
O D 7 9 0 1 03 00 00
OD 7 D OE 0 3 00 00
O D E 1 OE 01 00 08
ODES 00 OD 00 00
ODES I A O F 00 00
OD E0 18 O F 00 00
O D 9 1 OB 03 00 00
O D 9 5O D 9 5 00 O F 00 OD= 0 0 0 4
O D 9 9 O F D O 00 00
ODSDOD 9 0 D O 02 04 06
ODA I
ODA I
O D A 5O D A SO D A 6O D A 8ODAA
ODACODAEOOBOO D 0 2
O D E 4O D E 6O D E EODEAODECO D E €OD C 4OD C 6ODCEODCBODCDO D D 0
ODD4ODD6OD D 9
ODDAODDCODDDO D E 0O D E 2
OD 03 05 O F
50
24 7 F3 C 0774 0 4
3 C 087 2 02EO 003c 0 27 4 083 C 037 4 0 4
3c 097 2 OA
8 1 3 E O D 1 5 R O D E 073 02EO 00E A 0 3 0 4E A EO
A 2 0049 R89 16 0063 RB E F EB A 0 3 D AE C
3 2 COE EA 0 0065 R24 F7E E
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ., SET-MODE
T H I S R O U T I N E I N I T I A L I Z E S T HE A TT AC HM EN T TOTHE SELECTED MODE T H E SCREEN IS BLANKED
, I N P U T( A L ) = M OD E SEL EC TED ( R AN GE 0-E)
NONE, O U T P U T
...........................................M O O 5 0 L A B E L U O R D , T A B L E O F R E G E N L E N G T H S
D U 2 0 4 8 , MODE o 4 0 x 2 5 euD U 2048 , MODE I 4 0 x 2 5 C O L O R
DU 4 0 9 6 , MODE 2 80x25 B UD U 4 0 9 6 , MODE 3 E O X 2 5 C O L O R
DU 1 6 3 8 4 , MODE 4 320x200 4 COLORD U 16384 , MODE 5 720x200 4 COLOR
D U 1 6 3 8 4 , MODE 6 6 4 0 x 2 0 0 B UD U 0 , MODE 7 I N V A L I DD U 1 6 3 8 4 , MODE E 1 6 0 X 2 0 0 16 COLOR
DU 32768 , MODE 9 3 2 0 X 2 0 0 16 COLORDU 32768 , M OD E A 6 4 0 X 2 0 0 4 C O L ORCOLUMNS
D E
------A0060 L A B E L B Y T E
4 0 , 4 0 , EO, EO, 40.40, EO, 0 , 2 0 , 4 0 , E O
------- T A B L E O F G A T E A RR A Y P A R A M A T E R S FO R M OD E S E T T I N G
------ S E T U P F OR 4 0 x 2 5 EU MODE 0
A0070 L A B E L B Y T E
D E O C H , O F H , O , 2 , GATE AR R AY PAR M SM 0 0 7 0 L E Q U 1 - M O O 7 0------ S E T U P F O R 4 0 x 2 5 C O L OR M OD E I
------ S E T U P F O R 80x25 8U ;ODE 2DE OEH, OFW, 0,2 GATE AR R AY PAR M S
DE ODH OFH 0 2 GATE AR R AY PAR M S
DE 09H O F H 0 2 GAT E AR RAY PAR M S------ SE T UP FOR j20X;Ob 4 COLOR MODE 4
D E O A H , 0 3 H , 0 , 0 , GATE AR R AY PAR M SS E T U P F O R 320x200 EU MODE 5
D E O E H . 0 3 H . O . O , GAT E ARR AY PAR M S------ SET U P F O R 640x200 B U M O D E 6
DE O E H , O I H , O , E , G A T E A R R A Y P A R M S------ S E T U P F O R I N V A L I D M ODE 7
DE OOH, OOH, 0 , O G A T E A R R A Y P A R M S
------ S E T U P F O R 160x200 16 C b L D R M OD E 8D E IAH ,OFH ,O,O , GATE AR R AY PAR M S
------ S E T U P F O R 320x200 16 COLOR MODE 9D E IEH, OFH, 0 , O GAT E AR RAY PAR M S
------ S E T U P F OR 640x200 4 CbLOR MODE A
DE OBH, 03H. 0.0 G A T E A R R A Y P A R M S
------ S E T UP FOR 60x2; ~ O L O R AODE 3
------
-------------- TABLES OF P A L E T T ~ COLORS FOR 2 AND 4 COLOR MODES----- 2 COLOR. SET 0
A0072 L A B E L B Y T E
M 0 0 7 2 L E Q U S - MO O 7 2 , E N T R Y L E N G T HDE O,OFH,O,O
----- 2 C OL OR , SET I
----- 4 C OL OR , SE T 0
DE OFH,O,O,O
M O O ~ ~ ABEL e v i E
DE 0 , 2 , 4 , 64 COLOR. SE T I----
M O O 7 5 L A B E L
SET-MODED E
P U S HANDC U PJ E
C U PJ C
c3 novc 4 C U P
J EC U PJ EC U PJ C
c 5 C U PJ N CMOV
C 6 M OVMOVMDVnovaovnovI NXOROUTMOVANDOUT
B Y T E0 , 3 , 5 , O F HPROC NEARA XA L . 7 F HAL, 7c3
A L , OEHc 4A L . 0A L , 2csA L , 3csAL, 09H
C 6TRUE-HEM, 1 2 8C 6A L , 0O X , 0 3 D 4 HAH . ALCRT-MODE, A LA D D R 6 E 4 5 . D XD 1 , A Z .O X , VGA-CTLAL, OXA L , A LD X, ALAL, CRT-MODE-SETA L , O F 7 HD X , A L
, S A V E I N P U T M OD E O N S T A C K, R EM O V E C L E A R R E G E N S U I T C H, C H E C K F O R V A L I D M O D ES,MODE 7 IS I N V A L I D
, G R E A T E R T H A N A IS I N V A L I D,D EF AU L T TO M ODE 0
, C HE C K F O R M O D ES N E E D I N G 1 2 E K
, D O UE H A V E 1 2 8 K 7, Y E S , J U M P,NO, DEF AU LT TO MODE 0, ADDRESS OF COLOR CARD. S A V E MODE I N A H, S AV E I N G LO B AL V A R I A B L E, S A V E A D D R E S S O F E A S E, S A V E WO DE I N D I, P O I N T T O C O N T R O L R E G I S T E R
, SYNC CONTROL REG TO ADDRESS, S E T V G A R E G 0
, G E T L A S T M O D E S E T, T U R N O F F V I D E O, S E T I N G A T E A RR AY
, S EL E CT I T
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 420/605
O D E 3 88 C 7O DE S E 4 10O D E 7 BE O D 9 5 RODE A 3 C 06O DE C 7 4 O FODEE BE O D A l RO D F l 3 C OSO D F 3 74 08O D F S 3 C 04O D F 7 74 0 4O D F 9 3 C O AO D F E 75 11
ODFD E9 0004
O EO O E A C 4O E O 2 E EO E 0 3 2 E B A 07O E 0 6 E EO E 07 F E C 4O E 0 9 43O EO A E 2 F4OE OC E E 08
O EO E E 9 0010
O E l l E A C 4O E 1 3 E EO E 1 4 E EO E l S F E C 4O E 1 7 E 2 F8
O E 1 9 BE C 7O E l E 32 DE
O E l D 3 C 04O E l F 72 08O E 2 l E3 40O E 2 3 3 C 09O E 2 S 72 02O E 2 7 E3 COO E 2 9 E A 0 3 D FOE 2 C A 0 OOEA RO E2 F 2 4 3FO E 3 1 OA C 3O E 3 3 E EO E 3 4 A 2 OO EA R
O E 3 7 EE C 7O E 3 9 32 E 4O E 3B E 9 0004
O E 3 E F7 E lO E 4 0 EE DE
O E 4 2 E 1 C 3 O D 6 9 RO E 4 6 2 E E A 27O E 4 9 2 E B A 47 02O E 4 0 EE FOO E 4 F F AO E 5 0 E 8 E 6 7 5 ROE S 3 B O 10O E 55 E 6 A 0O ES 7 E A 0 3 0 AO E 5 A EO 04OE S C E EOE5D EO 0 2O E S F E E
O E 6 0 EE C 6O E 6 2 EO E 4 F 7O E 6 5 32 COO E 6 7 E EO E 6 E 86 EOO E 6 A E EO E 6 E EO 0 4O E 6 D E EO E 6 E 32 COO E 7 0 E E
O E 7 1 E O EOO E 7 3 E 6 A 0O E 7 5 E E E 6 7 5 RO E 7 E F EO E 79 E E 0 7O E 7 B E A C 4O E 7 D E EO E 7 E 2 E E A 07O E E I E EO E E 2 4 3
O E E3 F E C 4O EE 5 E 2 F 4
O E E 7 E A 0 3 D FOE E A A 0 OOE A ROEED 2 4 COOEEF E 3 3 6
O E 9 1 A 8 EOO E 9 3 75 OCO E 9 5 E 3 3 F
O E 9 7 E 1 3 E 0015 R 0080
OESD 73 02O E 9 F E3 18
, ---- S E T D E F A U L T P A L E T T E S
MOV A X ,DI , GET MODE
MOV AH. lOH , S E T P A L E T T E RE G 0MOV E X ,O FFS E T MOO7 2 , P O I N T T O T A B L E E N T R YC U P A L , 6 , 2 COLOR MODE”J E C 7 , YES, JUMPMOV E X ,OFFS E T MOO7 5 , P O I N T T O T A B L E E N T R YC U P A L . 5 , CHECK FOR 4 COLOR MODEJ E C 7 , YES, JUMPC U P A L . 4 , CHECK FOR 4 COLOR MODEJ E C 7 , YES JUMPCMP A L ,OA H , CHECK FOR 4 COLOR MODEJ N E C 9 , NO, JUMP
c7 wov cx.4 , NUMEER OF REGS TO SET
CE MOV A L ,A H , GET REG NUMEEROUT DX ,A L , S EL EC T I TMOV AL,CS CBX1 , G E T D A T AO U T D X , A L , S E T I TI N C A H , NEXT REGI N C E X , N E X T T A B L E V A L U EL O O P C EJ M P S HO RT C 1 1
,---r- S E T P A L E T T E S F O R D E F A U L T 16 COLORC 9 MOV CX , 16 , NUMEE R OF P A L E TTE S , A H IS REG
C 1 0 M OV A L , AH , GET REG NUMEER, COUNTER
OUT DX ,A L , S EL EC T I TO U T D X , A L , S E T P A L E T T E V A L U EI N C A H , N E X T R E GL O O P C I O
ill MOV A X .0 1 , GET CURRENT MODE----- S E T U P MO I I I N P AG RE G
X O R E L , E L , S E T UP FOR A L P HA MODE
C U P A L . 4 , I N A L P H A M OD EJ C C 1 2 , Y E S . JUMPnov E L , ~ O H , S E T U P F O R 1 6 K R E G E NCUP A L , ~ ~ H , MODE US E 1 6 KJ C C 1 2 , YES, JUMPMOV EL,OCOH , S E T U P F O R 3 2 K R E G E N
C 1 2 MOV DX ,P A GRE G , SET PORT ADDRESS OF PAGREGMOV AL, PAGDAT , G E T L A S T D A T A O U T P U TAND A L . 3 F H , C L E A R 110 & 111 B I T S
OR A L , E L , S E T N EU B I T Sour OX,AL , S T U F F B A C K I N PORTMOV P A GDA T, A L , S A V E CO PY I N R AM
MOV A X ,DI , GET CURRENT MODEXOR AH.AH , I N T O A X R E Gnov cx, M 0 0 7 0 L , S E T T A B L E E N T R Y L E N G T HMUL cx , T I M E S M OD E F OR O F F S E T I N T O T A B L EMOV E X ,A X , T AB LE O FF SE T I N 8 X
A DD E X ,OFFS E T MOO7 0 , A DD TA B L E S TA RT TO OFFS E TMOV AH,CS LEX3 , S A V E MODE S E T A ND P A L E TTEMOV AL,C S CEX + 2 1 , T I L L UE C A N P U T T H EM I N R AM
C L , D I S A B L E I N T E R R U P T SC A L L M O D E - A L I V E , K E E P M E M O R Y D A T A V A L I DMOV AL, i o n , D I S A B L E N M I A N D H O LD R E QU E S TOUT NMI -P ORT,A L ,MOV DX,VGA-CTL ,MOV A L .4 , P O I N T T O R E S E T R E GOUT DX ,A L , SEND TO GATE ARRAYMOV A L .2 , SET SYNCHRONOUS RESETOUT DX ,A L , D O I T
, U H I L E T H E G A T E A R R A Y IS I N R E S E T S T A T E , U E C AN NO T A C C ES S R AMMOV AX,SI , RE S TORE NE U MODE S E TAND A H , O F ~ H , T U R N O F F V I D E O E N A B L EX OR A L ,A L , S E T UP TO S E L E CT V GA RE G 0
OUT DX ,A L , S EL EC T I T
OUT DX ,A L , SET MODEMOV AL.4 , SET UP TO SELECT VGA REG 4O U T D X . A L , S EL EC T I TX OR A L ,A LO U T D X , A L , REMOVE RESET FROM VGA
MOV AL,EOH , E N A B L E N H I A G A I NOUT NMI -P ORT,A L ,C A L L M O D E - A L I V E , K E E P M E M O R Y D A T A V A L I DS T I , E N A B L E I N T E R R U P T SJ M P S H O RT C 1 4
C 1 3 MOV A L , A H , GET VGA REG NUMEEROUT DX ,A L , S E L E C T R E GMOV A L ,CS CB X l , G E T T A B L E V A L U EO U T D X , A L , P U T I N VG A R EG
I N C A H , NE X T RE GL O O P C 1 3 , DO E N T I R E E N T R Y
MOV OX, PAG REG , S E T 10 ADDRESS OF PAGREGMOV AL, PAGDAT , G E T L A S T D A T A O U T P U TAND AL,OCOH , C L E A R R E G B I T SM O V E L . 3 6 H , S E T U P F OR G R A P H I C S M O DE U I T H 3 2 K
, ---- E N A B L E V I D E O A N D C OR RE CT P O R T S E T T I N G
nov S I , A X
XCHG AH,AL , AH IS GA REG COUNTER
, NOU OKAY TO ACCESS RAM AGAIN
C 1 4 I N C E X , N EX T I N T A BL E
, --- SET UP CRT AND CPU PAGE REGS ACCORDING TO MODE & M EM OR Y S I Z E
, REGENT E S T A L , E O H , IN THS MODE^J N Z C 1 5 , YES, JUMPM O V E L , 3 F H , S E T UP FOR 1 6 K RE GE N A ND 12EK
, MEMORYCUP TRUE-HEM, 128 , DO UE HAVE 12EK9
J N C C 1 5 , YES, JUMPMOV BL, I E H , S E T UP FOR 1 6 K RE GE N A ND 6 4 K
, MEMORY
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 421/605
OEA 1
O E A 3O E A 4O E A 7O E A 9OEADO E 0 OO E 0 2O E 0 4OE07.OES9
O E 0 0
OE0 DO E 0 EOECO
O A C 3E EA 2 O O 0 A R00 C 600 26 0065 RA 2 0066 RE 4 6 124 F0F G c 4 0279 02OC 04E 6 6 1
I E33 COOE D O
O E C2 C 5 1 E 0 0 7 4 R
O E C 6 00 C 7O E C 0 89 0010 90OECC 00 F C 02O EC F 7 2 10
O E D 1 03 D 9O E D 3 00 F C 0 4O E D 6 72 09
O E D 0 03 D 9
OEDA 00 F C 09OEDD 72 02O E D F 03 09
O E E 1 50
O E E 2 O A 4 7 02O E E 5 90 7F OAO E E 0 I €
O E E9 E 0 1300 R
O E E C A 2 0009 RO E E F 09 3 E 0060 RO E F 3 50O E F 4 A 0 0086 RO E F 7 2 4 O FO E F S A 2 0086 RO E F C 50
OEFD I FO E F E 32 E 4
O F 0 0 0 A O 3 D 4
O F 0 3 OA C 4O F 0 5 E EO F 06 4 2O F 0 7 F E C 4O F 0 9 0 1 07O F 0 0 E EO FO C 4 3O F 0 0 4 A
OFOE E 2 F 3O F 1 0 50
O F 1 1 I F
O F 12OF 14O F 10O F I D
O F 1 EO F 2 I
O F 2 3O F 2 6O F 2 9O F 2 0OF2 D
O F 2 FO F 3 2O F 3 4O F 3 6O F 3 9O F 3 0OF3 D
O F S FO F 4 2O F 4 4
O F 4 501- '40
3 3 FF09 3 E 0 0 4 E RC 6 06 0062 R5 A
80 E 2 0075 1c0 A 0000
09 20003c 09
72 05D l E l
0 A 1000BE c23 C 0 400 O F 2 07 2 0233 coF 3 I A 0
0 A O 3 D A32 COE E
A 0 0065 REE
00
O F 4 9 32 FFO F 4 0 O A I E 0 0 4 9 RO F 4F 2 E E A 87 OD 5 E RO F 5 4 32 E 4O F 5 6 A 3 0 0 4 A R
C 15: OROUTnovnovMOV
novI NAND
T E S TJ N ZOR
A L , 0LD X , A LP A G D AT , A LAX, SICRT-MODE-SET, AHC R T- PAL L ETTE, ALAL. PORT-EA L , O F 0 HAH, 2C 16
AL, 4
S E T UP 6 0 4 5
C 1 6 O U T P O R T - 0 ,A L- - -- -- -
P U S H D SXORnovASSUMEL D SASSUMEnovnovCMPJ CADDCMPJ CADD
AX, AXDS, A XD S A B S 0EX, PARM-PTR ,D S CODEA X , D ICX, MOO40AH, 2C 1 7
AH, 4C 17
0x. c x
BX, cx
C M P A H . 9J C C 1 7A D D 0 X . C X
C O M B I N E M OD E B I T S A ND R E G V A L U E SS E T P O R TS A V E C OP Y I N RA MP U T M O D E S E T I, P A LE T T E I N R AM
GET C U R R EN T VAL U E OF 0255 PORT E
S E T U P G R A P H I C S M OD EJ U S T S E T A L P H A MO DE I N V G A7YES, JU M PS E T U P A L P H A M OD ES T UF F B AC K I N 0255
S A V E D A T A S E G M E N T V A L U ES E T U P F O R A B S 0 S E G ME N TE S T A B L I S H V EC TO R T A B L E A D D R E S S I N G
G E T P O I N T E R T O V I D E O P A R M S
G E T C U R R E NT M ODE I N A XL E N G T H O F E A C H R OU O F T A B L E
D E T E R M I N E W H I C H T O USEMODE IS 0 OR 1
M OV E TO N E X T ROW OF I N I T T A B L E
MODE IS 2 OR 3MOVE TO GRAPHICS ROW OFI N I T - T A B L E
MODE IS 4, 5, 6, 0, OR 9M OVE TO N EXT GR APH IC S R OW OFI N I T T AB LE~
.----- 0 X P O I N T S T O C O R R EC T R OW bF I N I ~ I A L I Z A T I O N A B L EC l 7 : P US H
MOVnovP U S HC A L LASSUMEnovMOV
P U S HnovANDnovP O PASSUMEP O PXOR
MOV
AX ; S A V E M ODE I N A HA L , D S : C B X + 2 1 ; G E T H O R Z. S Y N C P O S I T I O ND I ,UORD PTR DS: C B X + I O I ; GET C UR SOR T YPED SDDSD S . D A T AHORZ-POS, A L ,CURSOR-MODE, D I ,A XAL, VAR-DELAY ,AL , OFHVAR JEL AV, ALAXD S C OD ED SAH , AH
D X . 0 3 D 4 H
S A V E HO R Z. S Y NC P O S I T I O N V A R I A B L ESAVE CURSOR MODE
S E T D E F A U L T O F F S E T
AH WILL S E R V E A S R E G I S T E R N U M 0 E RD U R I N G L O O P
P O I N T TO 6 0 4 5; L O O P T H RO U G H T A e L E , O U T P U T T I N G R E G A D DR E S S, T H E N V A L U E F RO M T A B L EC 1 0 : M O V A L . A H : G E T 6 0 4 5 R E G I S T E R N UM 0E R
OUT D X ; A L
I N C D X , P O I N T T O D A T A P O RTI N C A H , N E X T R E G I S T E R V A L U EM OV AL .C BX3 , G E T T A B L E V A L U EO U T D X , A L , O U T T O C H I PI N C 0 X , N EX T I N T A BL EOEC D X , B A C K T O P O I N T E R R E G I S T E RL O O P c10 , D O TH E W H OL E TABL EPOP AX , GET MODE BACKPOP D S , R EC OVER SEGM EN T VAL U EASSUME D S D A T AF I L L R E G EN A R EA W I T H B L A N KXORnovnovPOP
ANDJ N ZnovnovCMPJ CS H L
novnovCMPnovJ CXORR E P
D 1 , D ICRT-START, D I ,AC TI VE-PAGE, 0 ,D X
DL, OOHc2 1
D 1 , D ICRT-START, D I ,AC TI VE-PAGE, 0 ,D X
DL, OOHc2 1DX, O00OOHCX, 0192A L , 0 9 Hc 19cx, 1D X , l 0 O O HES. DXAL . 4AX, ' '+15*256 ,c20AX, AXSTOSW
,----- E N A B L E V I D E O
C 2 1 MOV D X,VGA-C TL ,X O R A L , A LO U T D X , A L
MOV AL, CRT-MODE-SET ,O U T D X . A L
S E T U P P O I N T E R F O R RE G E NS T A R T A D DR ES S S A V E D I N G LO B A LS E T P A G E V A L U EG ET O R I G I N A L I N P U T BA C K
NO CLEAR OF REGEN 7
S K I P C L E A R I N G RE G ENS E T U P S E G M EN T F O R 1 6 K R E G E N A R E ANUM0ER OF WORDS TO CLEARR E Q U I R E 3 2 K B Y T E R EG EN ?
NO, JUMPSE T 1 6 K W ORD S TO C L EARSET U P SEGM EN T FOR 3 2 K R EGEN AR EASET R EGEN SEGM EN TT E S T F O R G R A P H I C SF IL L C H A R F O R A L P H A
N O- GR APH IC S- IN ITF I L L FOR GR APH IC S M OD EF I L L T H E R E G E N B U F F E R W I T H B L A N K S
SET POR T AD D R ESS OF VGA
SEL EC T VGA R EG 0
GET M OD E SET VAL U ESET MODE,----- D E T E R M I N E N UM BE R O F C O LU M NS , B O T H F O R E N T I R E D I S P L A Y,-_--- A ND T H E N U M 0E R T O B E U SE D F O R T T Y I N T E R F A C E
XOR 0H,0HMOV B L, CRT-MODEMOV AL, CS C0X + O F F S E T M O O 6 0 1XOR AH,AH
MOV CRT-COLS,AX , N UM 0E R O F C O LU MN S I N T H I S S C R EE N
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 422/605
O F 5 9
O F S BO F 6 0O F 6 4O F 6 7O F 6 AO F 6 6O F 6 CO F 6 E
O F 7 0O F 7 0O F 7 I
O F 7 2O F 7 3O F 7 4OF75O F 7 6O F 7 7O F 7 8
D l E 3
Z E : 88 B F O D 4 8 R89 O E 0 0 4 C R69 0006
B F 0050 R
I E07
F 3 I A B33 co,
5F5 E5659S AI F07C F
O F 7 8
O F 7 6 F A
O F 7 9 56O F 7 A 57O F 7 6 50O F 7 C 53O F 7 0 5 1O F 7E 5 2O F 7 F I EOFBO 06
O F B l B E 0008O F 6 4 32 OB
O F 8 6 32 E 4O F B B 89 0005
O F B B E4 62O F 8 0 AB 4 0O F B F 74 02O F 9 1 F E C 4O F 9 3 E2 F6O F S 5 BO F C 0 3O F S B 73 0 3
O F 9 A E B 50 90
OF90 B 9 0032O FA O E 4 62O F A 2 A B 40O F 1 4 74 05O F 1 6 E2 F8O F A B EB 4F SO
O F A B BO 4 0O FA O E 6 43O F A F 90OFBO 90O F B l E 4 4 1O F B 3 B A E OO F 6 5 E 4 4 1O F 8 7 86 E OO F 8 9 88 F B
O F B B 69 0004OFBE E4 62O FC O A B 4 0O F C 2 75 35
O FC 4 E 2 F B
O F C 6 B A 0220
O F C 9 €8 IO31 ROFCC BA OZOEO F C F 50OFDO E8 1031 RO F 0 3 E A C BO F 0 5 58
O F 0 6 3 A C BOFOB 74 2 A
,----- S E T C UR SO R P O S I T I O N S
snL ex, I , UORD O F F S E T I N T O C L E AR L E N G T H
WOV CX,C S CBX + O F F S k T M OOS0 1 L E N G T H T O C L E A RM O V C R T L E N , C X , S A V E C E N G i H O F C R TNOV CX, B , C L E A R A L L C U R S O R P O S I T I O N SMOV D1 , O FFS ET CURSOR-POSNP u s n os , E S T A B L I S H S EG ME NTPOP ES , A D D R E S S I N GXOR AX,AXR E P S T O S U F I L L U l T H ZEROES
T A B L E
_ - _ _ _O RM AL R E T U R N FR OM A L L V l i E O R E TU R NSb I O E O v R E T U R N
POP Dl
POP SIPOP BX
c 2 2 P O P cxPOP OXPOP osPOP ES , RECOVER SEGMENTSI R E T , A L L D O N E
SET-MODE ENDP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
, K B D N M I - K E YB O AR D N M I I N T E R R U P T R O U T I N E
, T H I S R O U T I N E O B T A I N S C ON TR OL U PO N A N N M I I N T E R R U P T , U H l C H, OCCURS UPON A KEYSTROKE FROM THE KEYBOARD
, T H I S RO U TIN E U I L L D E - S E R I A L IZ E TH E B I T S TR EA M I N ORDER TO, G E T T H E K E YB O AR D S C A N C OD E E N T E R E D I T T H E N I S S U E S I N T 4 1, P A S S I N G T H E S C A N C O DE I N A L T O T H E K E Y PR O C E SS O R U P O N R E T U R N
, I T R E -E N A BL E S NMl A ND R E T U R N S T O S Y S T EM ( ] R E T )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ASSUME CS CODE, DS DATA
D I S A B L E I N T E R R U P T S
SAVE REGS L D I S A B L E N M I
KBDNM I PROC FAR
C L I
----------------------
P u s n S IP u s n 01
P u s n expusn cxP u s n o xP u s n D SP u s n ES
P U S H A X , SAVE REGS
l N l T C OU NT ER S----------MOV S 1 . B , SET U P t O F D A TA B I T SXOR B L B L l N l T P A R I T V COUNTER
XOR AH AH___-___--__A M P L E ’ S T I M E S T O V i L I D A T E S T AR T B I T
MOV1 1 I N
T E S TJ ZI NC
CUPJ N BJMP
12: LOOP
cx: 5AL, PORT-C
1 2AH1 1AH, 3
I 2 518
AL OH
. -------- -- A L I D S T A R T B I T , LOO;
13: I N A L,P O RT -CT E S T A L , WJZ I 5LOOP I 3J M P I B
125: nov cx,so
C A L LMOVP U S HC A L LnovPOPCUPJ E
SET COUNTERG E T S A M P L ET E S T I F IJM P I F 0
KEEP COUNT OF 1 ’ sK E E P S A M P L I N GV A L I D S TA RT B I T ?
JUMP I F OKI N V A L I D ( S Y N C E R RO R ) N O A U D I OOUTPUTF OR T R A I L I N G E D G ES E T U P U A T C H D O G T I M E O U TGET SAMPLET ES T I F 0J M P I F T R A I L I N G E D GE FO UN DK E E P L O O K IN G F O R T R A I L I N G E DG ESYNC ERROR (ST UC K ON 1 ’ s )
----------- E AD C LO C K TO S E T S T A R T O F B I T TIME15 nov A L , ~ O H , READ CLOCK
O U T T l M - C T L , A L ,NOP # *
NOP , *
MOV AH,AL , *
XCHG AH. AL , *
I N A L , T l M ER + I , I
I N A L , T l M ER + I ,
M OV D 1 ,A X S A V E C L OC K T I M E I N Dl
nov cx ,4 , SET COUNTER
T E S T A L , 4 0 H , T E ST I F 0J N Z I B , J M P I F I N V A L I D T R A N S I T IO N ( S Y N C )LOOP 16 , K E E P L O O K I N G FOR V A L I D T R A N S I T I O N
M OV O X 5 4 4 310 USEC AUAV ( 838 U S I T )
----------- E R I F Y V A L I D T R A N S I T i O N
16 I N A L,P OR T -C , G E T S A M P L E
----------- E T U P D I S T A N C E TO M I D D L E O F 1 S T D A T A B I T
-------S T A R T L O O K i N G F O R TIME T b R E AD D A T A B I T S A N 0 A S S E M B LE B Y T Ei 7 I30
O X, 5 2 6AXI30C L , A LAXC L , A L1 9
, S E T N E U D I S T A N C E T O N E X T H A L F B I T; S A V E IS1 H A L F B I T
; P UT 2N D H A LF B I T I N C L; RESTORE IS1 H AL F B I T; A R E T H E Y O P P O S I T E S ?; NO, PHA SE ERROR
R O M B I O S A-35
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 423/605
O F D A D O E FOFDC OA F EO F D E 4EO FD F 7 5 E 8
O F E l E B IO31 RO F E 4 50O F E 5 E 8 IO31 RO F E E E A C EO FE A 5 8O F E E 3 A C EO FE D 7 4 15
O F E F EO E 3 0 1
O F F2 7 4 10
O F F 4 F BO F F 5 E A C 7O F F 7 CD 4 8
O F F 9 07O F F A I FO F F B 5 AO FF C 5 9O F F 0 5 EO FF E E 4 A 01000 5 81001 5 F1 0 0 2 5 E1003 C F
1004 E E 1386 R1007 E3 F E 08I O O A 74 ED
IO OC F 6 0 6 O O l E R 0 1
1011 75 181013 BE 00801 0 1 6 E 9 0 0 4 81019 € 8 E 0 3 5 Rl O l C EO 2 6 0017 R F O
1 0 2 1 EO 2 6 O O l E R OF
1 0 2 610281 0 2 F103103 I
103 I
I0331035I0361037103910381 0 3 0103F104I104310451 0 4 71 0 4 91 0 4 8
1 0 4 0
EO 2 6 0088 R I FF E 06 0 0 1 2 RE E C E
EO 40E 6 4390
90E 4 4 1BA EOE 4 4 1E 6 E OEB C F2 8 CB36 CA7 2 E A2 8 CABE F E0 3 F9
E9 0005
1050 32 E 41052 E 4 6 21054 AE 4 01056 7 4 0 21 0 5 8 F E C 41 0 5 A E 2 F 61 0 5 C EO F C 0 3105F 7 2 OS
1061 BO BO1063 F E C 31065 C 3
1066 32 CO1068 C 31069
V A L I D D AT A B I T , P L AC E I N S CA N B Y T E----------SHR BH. I , S H I F T P R E V IO U S B I T SO R E H , A L , OR I N NEW D A TA B I TDEC SI , D E C R EM E N T D A T A B I T C O UN TE RJ N Z 1 7 C O N T I N U E F OR M ORE D A T A B I T S
C A L L 1 3 0
PUSH AX , S 4V E I S 1 H AL F B I TC A L L 130MOV CL,AL , P UT 2 ND H A L F B I T I N CLPOP AX , R ES TO RE I S 1 H A L F B I TCMP CL , AL , & R E T H E Y O P P O S I T E S 7
J E 1 9 N O, P H A S E E R RO R
AND EL , 1 , CHECK I F O D D P A R I T VJ Z 19 J M P I F P A R I T Y E RR OR
S T 1 , E N A B L E I N T E R R U P T SMOV AL , EH , P L A C E S C AN C OD E I N A LI N 1 4EH CHARACTER PROCESSI NG
WAT FOR TIME TO S A M ~ L EPARITY BT___-_-____
-__----____ALID PARITY BIT, C H ~ K ARITY
----------- VALID CHARACTER, SEN;) TO CHARACTER PROCESSING
----------- RESTORE REGS AND RE-;NABEL NM
18 P O P E S , RESTORE REGSPOP D SPOP OXPOP cxP O P E XI N A L, OA OH , E N A B L E N M IPOP AXPO P D IP O P SII R E T ; RETURN TO SYSTEM
D D S S E T U P A D D R E S S I N G
.----------- P A R I T Y , S V N C H OR P H A S E E R R O R. O U T P UT M I S S E D K EY B E E P
1 9 : C A L LCMPJ E
T E S T
J N ZnovMOVC A L LAND
AND
AND110: I N C
JMPKEDNMI ENDP130 PROC131: MOV
OUTNOPNOPI NMOVI NXCHGMOVS U ECMPJ CS U BMOV
S I , E
I E
KB-FLAG-I, OIH
I10EX, OEOHC X , 0 4 E HKB-NO1 SEKB-FLAG, OFOH
KB-FLAG-I , OFH
KB-FLAG-2, I F HKBDJRRSHORT 18
NEARA L , 4 0 HT I M - C T L , A L
A L , T I M E R + IAH. ALA L , T I M E R + IAH. ALC X , D ICX, AXCX, OX1 3 1CX, OXD I . A X
A RE U E ON T HE F I R S T D A T A B I T ?N O A U D I O F E E D B A C K ( M I G H T B E A. . G L I T C H )CHECK I F T R A N S M I S S I O N E R R O R S. . A R E T O B E R E P O R T E Dl = D O NOT BEEP, OZBEEPD U R A T I O N O F E R RO R B E E PFREPUENCY OF ERROR BEEPA U D I O F E E D B A C KC L E A R A L T , C L R L , L E F T A ND R I G H TS H I F T SC L E A R P O T E N T I A L B R E A K O F I N S , C A P S
C L E A R F U N C T I O N S T A T E SKEEP TRACK OF KEYBOARD ERRORSR E T U R N F R OM I N T E R R U P T
NUM AND SCROLL S H i P T
READ CLOCK*****
*G E T L A S T C LO C K T I M ES U B C U R R E N T T I M EIS I T T I M E TO S A MP LE 7NO, K E E P L O O K I N G A T T I M EU P D A T E 8 OF COUNTS OFFS A V E C U RR E NT T I M E A S L A S T T I M E
AD D D I C X A DD D I F F E R E N C E F O R N E X T T I M E
MOV CX. 5 , SET COUNTER----------- STA R T ;AMPLING D A T A BIT ( 5 SAMPLES)
............................................................, S A M P L E L I N E
, PORT-C IS SAMPLED CX T I MES AND I F THER ARE 3 OR MORE 1"s, THEN EOH IS R E TU R NE D I N A L, E L S E OOH IS R ET UR NE D I N A L, P A R I T Y C O U N T E R IS M A IN T AI NE D I N E S
XOR1 3 2 : I N
T E S TJ ZI NC
CMPJ EMOVI NCR E T
1 3 4 : X O RR E T
I30 ENDP
133 LOOP
AH, AHAL, PORT-CA L , 4 0 H133A HI 3 2AH, 3I 3 4AL, OBOHB L
A L . A L
CLEAR COUNTERG E T S A M P L ET E S T I F 1
JM P I F 0KEE P COUNT OF 1 ' sK E E P S A M P L I N GV A L I D I 1
J MP I F N OT V A L I D 1
RETURN EOH I N A L ( 1 1
I N C R E M E N T P A R I T Y C O U N T E RR E T U R N T O C A L L E R
RETURN 0 I N A L ( 0 )R E T U R N T O C A L L E R
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 424/605
= OOBO= 0 0 5 4= 0055= 0 0 5 6
= OOFFO O l F
= 0030= 0010= 0019
= 0012= O O l F= 0031
=0 0 4 8
= 0050= 0 0 4 8= 0 0 4 D= oooc= OOOD= OOOB
= 0001
= 0002
= 0003= 0004
= 0046= 0045
= 0 0 4 7= 0 0 4 F= 0049= 0 0 5 1= 0 0 4 1= 0 0 4 E
10691069 30 10 12 19 I F 3 1106F 48 S O 4 8 40 OC1074 OD= oooc
1075
1 0 7 5 02 03 0 1 04 4 6 4 51078 4 7 4 F 49 5 1 4 A 4 E
10811081 4 F 50 5 1 4 8 4 C 4 D
4 7 4 8 4 9 5 2
..................................................................,K E Y 6 2 - 1 N T
THE P URP OS E OF T H I S R O U T I N E IS TO TRA NS L A TE S CA N CODE S AND
S C A N C OD E C O M B I N A T I O N S F RO M T HE 6 2 K E Y K E Y B OA R D T O T H E I RE O U I V l L E N T S O N T H E E 3 K E Y K E YB O AR D T H E S C A N C OD E ISP A SS E D I N A L E A C H S C A N C OD E P A S S E D E I T H E R T R I G G E R S O N E ORM OR E C A L L S T O I N T E R R U P T 9 OR S E T S F L A G S T O R E T A I N K E YB O AR DS T A T U S W HE N I N T E R R U P T 9 IS C A L L E D T H E T R A N S L A T E D S C A NC OD ES A R E P A S SE D T O I T I N A L T H E I N T E N T O F T H I S CO DE U A ST O K E E P I N T E R R U P T 9 I N T A CT F ROM I T S O R I G I N I N TH E PC F A M l L YT H I S R O U T I N E IS I N T H E FR O NT E ND O F I N T E R R U P T 9 ANDTRA NS FORMS A 6 2 K E Y K E Y B OA RD TO L OOK A S I F I T U ER E A N E 3K E Y V E R S I O NIT IS A SS UM ED T H A T T H I S R O U T I N E IS C A L L E D F R O M T H E N M IO E S E R I A L I Z A T I O N R O U T I N E AND T H A T A L L R E G I S T E R S U E RE S AV ED
I N T HE C A L L I N G R O U T I N E A S A CO NS EQ UE NC E A L L R E G I S T E R S AR EDESTROYED
..................................................................,E Q U A T E SBREAK-E1 T EQ U BOHF N- KE Y E Q U 5 4 HP H K E O U F N - K E Y + lE XT -S C AN E Q U P H K + I , BASE CODE FOR SCAN CODES
AND-MASK EQU OF FH , U S ED TO S E L E C T I V E L Y R EM OV E B I T SCLEAR-FLAGS EOU AND-MASK - (FN-FLAG+FN-EREAK+FN-PENDINGl
,S CA N CODE SE -K EY E Q U 4 80-KEY EOU 16P -K EY E O U 2 5E -K EY E OU 1 8S-KEY EOU 3 1N-KEY EQU 49
UP-ARROW EQU 7 2DOUN-ARROU EQU EO
L E FT - AR R O U E Q U 7 5RIGHT-ARROW EOU 77M I N U S E OU 1 2E Q U A L S E Q U I 3NUM-0 EOU I 1
,N EW T R A N S L A T M S C AN CO DE S
,N O T E
, E X T E N D I N G BE YO N D 8 3
......................................................
BREAK, PAUSE, ECHO, AND PRT-SCREEN ARE USED AS OF FS ET SI N T O T H E T A B L E ' S C A N ' O F F S E T = T A B L E P O S I T I O N + 1
......................................................;CHO EQ U 0 1
B R EA K E Q U 0 2P A U S E E Q U 03PRT-SCREEN EOU 04SCROLL-LOCK EOU 70NUM-LOCK E Q U 69
HOME EOU 7 1E ND -K EY E Q U 7 9PAGE-UP EQU 73PACE-DOUN EQU 8 1K E Y P A D-MINUS E QU 74KEYPAD-PLUS EQU 78
ASSUME CS CODE,DS DATA,---- A B L E O F V A L I D S C A N C O D ES
K BO L A B E L B Y T EDB E-KEY, 0-KEY, E-KEY, P-KEY, S-KEY, N-KEYDB UP-ARROU, DOUN-ARROW, LEFT-ARROU, RIGHT-ARROU, M IN USD E E Q U A L S
K B O L E N E Q U I - K B O
;(El L AB EL W T EDE BREAK, PAUSE, ECHO, PRT-SCREEN, SCRO LL-LOC K, NUM-LOCKDE HOME, END-KEY, PAGE-UP, PAGE-DDUN. KEY PAD-MIN US, KEYPAD -PLUS
---- A B L E OF N E U S CA N CODE S
............................................
,NOTE THE RE IS A ONE TO ONE CORRESPONDENCE EETUEENT HE S I Z E O F K E O A N0 K B 1
............................................, T A B L E O F N U M E R I C K E Y P A D S C A N C O DE S
THE S E S CA N CODE S UE RE NUME RIC K E Y P AD CODE S ONT H E E 3 K E Y K E Y BO A R D
.................................................~UM-COOE S LABEL BYTE
D B 79 .80 ,81 ,75 .76 ,77 ,71 ,72 ,73 ,82
I O B B108s I D 37 87 9 0I O B F I D 46 C 6 9 D
;T A B L E
.
;CAN
O F S I M U L A T E D K E Y S T R O K E ST H I S T A B L E R E P R E S E N TS A 4 + 2 A R R AY . E A C H R OUCONS IS TS OF A S E OUE NCE OF S CA N CODE S WHICHUOUL D HA V E B E E N GE NE RA TE D ON AN E 3 K E Y K E Y B OA RDT O C A U SE T H E F O L L O U I N G F U N C T I O N S .
R O U I = E C H O C R T O U T P U T T O . T H E P R I N T E R
ROU 2 =B RE A K
THE T A B L E HA S B OTH MAK E AND B RE A K S CA N CODE S .
L A B E L B Y T ED E 29,55, 183. 157 ; C T R L + P R T S COB 29,70, 1 9 8 . 157 ; C T R L + S C R O L L - L O C K
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 425/605
10931093 3 5 28 3 4 I A 1B= 0005
.................................................., T A B L E O F V A L I D A L T S H I F T S C A N C OD ES
T H I S T A B L E C O N T A I N S S C A N C OD ES F O R K E Y S ON T H E6 2 K E Y K E Y BO A R D T H E S E C O DE S A R E U S E D I NC O M B I N A T I O N U I T H T H E A L T K E Y T O PR O DU C E S C AN C OD E SFOR KEYS NOT FOUND ON THE 6 2 KEY KEYBOARD
A L T -T A B L E L A B E L B Y T E
ALT-LEN EQU I - A L T - T A B L E
, T A B L E O F T R A NS L A T ED S C A N C OD ES W I T H A L T S H I F T
DE 5 3 , 4 0 , 5 2 , 2 6 , 2 7
________________________________________---------_
T H I S T A B L E C O N T A I N S T H E S C AN C OD E S F O R T H EK E Y S W H I C H A R E N O T ON T H E 6 2 K E Y K E Y BO A R D AND
WILL B E T R A N S LA T E D W I T H A L T S H I F T T H ER E IS AONE TO ONE CORRESPONDENCE BETWEEN THE S I Z E SOF ALT-T ABLE AND NEW-ALTT H E F O L L O U I N G T R A N S L A T I O N S AR E H AD E
A L T + I \A L T + I *
A L T + C = :A L T + 1 = -.A L T + = Y
1098
1098 2 B 2 9 3 7 2 8 2 9~EU-ALT LABEL BYTE
DE 4 3 , 4 1 , 5 5 , 4 3 , 4 1
1 0 9 D1 0 9 D109E
1082
l O C 6l O C 6l O C 7
l O C 8l O C Bl O C D
I O D O1 0 0 2
l O D 3l O D 5l O D 7l O D 9l O D B
I O D D
l O D El O E O
l O E 2
I O E 6l O E 9
l O E Al O E Cl O E El O F O
1 40 0 4 8 0049 0 0 4 D0050 0 0 4 F 00480039 O O l C0011 0012 O O l F0 0 2 C 0028 O O l EOOOF 0001
FBF C
E B 1388 REA E OE B 1 3 1 E R
73 01
C F
3 C F F7 4 6 C2 4 7F3 C 5 67 C S F
I E33 F 6B E D E
C 4 3 E 0 1 2 4 R
2 6 E A OD
I F
2C 5 6F E C 93 A C 17 F 10
,E X T A BTAB LE OF SCAN CODES FOR MA PPI N G EXTENDED SETOF SCAN CODES (SCAN CODES > 8 5 ) T H I S T A BL EA L L O W S O T H E R D E V I C E S T O U S E T H E K E Y B O A R D I N T E R F A C EI F THE DEVI CE GENERATES A SCAN CODE > 8 5 T H I S T A BL ECAN BE USED TO MAP THE DEV I CE TO THE KEYBOARD THED E V I C E A L SO H A S T H E O P T I O N O F H A V I N G A U N I O U E S C A NC OD E P U T I N TH E K EY B OA R D B U FF E R ( I N S T E A D O F M A P P I N GT O TH E K E Y B O A R D ) T H E E X TE N D E D S C A N C O DE P U T I N T H EB U F FE R U I L L B E C O N TI NU O U S B E G I N N I N G AT 1 5 0 A ZE ROWILL B E U SE D I N P L A C E O F A N A S C I I C OD E ( E G AD E V I C E G E N E R A T IN G S C A N CO DE 8 6 AN D N O T M A P P I N G 8 6T O T HE K E Y BO A RD U l L L H A VE A t 1 5 0 , O l P UT I N TH EK E Y B O A R D B U F F E R )T A B L E F O R M A TT H E F I R S T B V T E IS A L E N G T H I N D I C A T I N G T H E N U H B E RO F SCAN CODES MAPPED TO THE KEYBOARD THE RE MA I NI N GE N T R P E S A R E U O RD S T H E F I R S T B Y T E ( L OW B Y T E ) IS ASCAN CODE AND THE SECOND BYTE ( H I G H B Y T E ) IS ZEROA D E V I C E G E N E R A T I N G N S C A N C O DE S IS ASSUMED TO GENERATE THEF O L L O U I N G S TR E AM B 6 , 8 7 , B B , , B 6 + ( N - 1 ) T H E S C A N C OD E B Y T E SI N T HE T A B L E C OR RE SP ON D T O T H I S S E T U I T H T HE F I R S T D A T AB Y T E M A T C H I N G 86, T H E S E CO N D M A T C H I N G 8 7 E T C
( 1 ) I F A D E V I C E G E NE R A TE S A B R E AK C OD E, N O T H I N G IS
( 2 ) A L E N G T H O F 0 I N D I C A T E S T H A T Z ER O S C A N CO D ES H A V E B E E N
, N O T E S
P U T I N T H E B U FF ER
M A PP ED T O T H E K E Y B O AR D A ND A L L E X T EN D E D S C A N CO D ES U l L LBE USED
( 3 ) A DE VI C E CAN MAP SOME OF I T S SCAN CODES TO THE KEYBOARDA ND H A V E S OM E I T S S C A N CO D ES I N T H E E X TE N D E D S E T- -_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ - -_ - - _ --
~ ~ T A BABEL WTE
DE 2 0 , L E N G T H O F T A B L E0 0 5 1 DW 7 2 , 7 3 , 7 7 , El, BO , 7 9 , 7 5 , 7 1 , 5 7 , 2 B0 0 4 7
0 0 2 D DU 1 7 , l B , 3 1 , 4 5 , 4 4 , 4 3 , 30, 1 6 , 15, I
00 10
K E Y 6 2 - I N T P R OC F A RS T I
C L D , F O R W A R D D I R E C T I O N
C A L L D D S , S E T U P A D D R E S S I N GH O V A H , A L , SAVE SCAN CODEC A L L T P M , ADJUST OUTPUT FOR USER
JNC KBXO , J UM P I F OK T O C O N T I N U EI R E T , R E T UR N F R O H I N T E R R U P T
, M O D I F I C A T I O N
-__-XTENDED SCAN CODE CHECKL E X 0 C MP A L , O F F H , IS THI S AN OVERRUN CHAR?
J E K BO -1 , P A SS I T TO I N T E R R U P T 9
AND AL ,AND-MASK-BREAK-BI T TURN OFF BREAK B I TCMP AL , EXT-SCAN , IS T h I S A S C A N C OD E > 8 3JL K BX O R E P L AC E B R EA K B I T
P U S H DS
XOR S 1 , S l
MOV D S , S IASSUME DS A B S 0L E S D 1,D W OR D P T R E X S T , GET THE POI NT ER TO THE EXTENDED
H O V C L , B Y T E P T R E S [ D I I , G E T L E N G T H B Y T EPOP D SASSUME D S D A T A
, ---- CAN CODE IS I N EXTENDED SE;
, S E T
,---- OES SCAN CODE GET MAPPED TO KEYBOARD OR TO NF U EXTENDED SC AN
, CODES?SUB AL,EXT-SCAN , CONVERT TO BASE OF N EU SETD E C C L , L E N G T H - 1C M P A L , C L , IS C OD E I N T A B L E ?J G K B X l , JUMP I F SCAN CODE IS N OT I N T A B LE
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 426/605
I O F 2 47l O F 3 EE D EIOFS 32 FF
I O F 7 D I E3I O F 9 0 3 FEI O F B 26: E A 05
I O F E 3 C 56
1100 7c 3 A
1102 F6 C 4 EO
1105 74 0 11107 C F1108 EO C 4 401106 32 COllOD BE 1 E O O l C R1111 BE F3I l l 3 E E 144F R1116 3E 1 E O O I A R1 1 1 A 75 19
l l l C BE OOEOI l l F E9 004s1122 E E E 0 3 5 RI125 EO 2 6 0017 R F O
I 1 2 A
I I 2F11341I35I137
I13EI 1 3 CI13F1141
I 1 4 3I145
11471 1 4 CI I 4 EI153I I55I158
EO 2 6 0018 R O F
EO 26 OOEB R I FC FE9 04E9 I E O O lC R
C FEO E 4 EOO A C 4E A E O
3c 4 575 14F 6 06 0017 R 0 474 OAF6 06 0017 R 0875 0 3E9 1 2 E E RE 9 1 2 5C R
1158 3c 37I I S D 75 I1115F F6 06 0017 R 0 3
1164 7 4 F 2
1166 F6 06 0017 R 0 41168 75 E E1160 E 9 1301 R
I17011721174I179
I 178I 1 7 C
11701180
I18311851187I 1 E A
l l E C
1191I1951 1 9 A1 1 9 DI19F
1 1 A 1I 1 A 4I 1 A 6I 1 A EI 1ADI I A F1163
118411861 EE
I IEEl l E D
l l C 21 C 7
I I C EI I C DI I C FI I D 4I I D SI I D A
EA EO24 7FF6 06 0017 R 08
74 39
OE07
E F 1093 RE9 0005
F2/ A E75 2DE9 1094 R28 F9
2E: E A E 5 1098 R
B A 1E 0017 REO 36 0017 R 08
F6 C 4 EO
74 0 2OC EO
E3 F F 0 3
7 C 05
EO OE 0017 R 02E6 60CD 09
BE 1 E 0 0 1 7 RC F
3c 5 475 2 3F 6 C 4 EO
75 08EO 2 6 0088. R I F
EO OE OOEE R A 0C F
F6 06 0088 R 2075 06
EO 26 OOaE R I FC FEO OE OOEE R 4 0C F
----GET SCAN CODE FROM TABL E
I N C D I , P O I N T D I P A S T L E N G T H B Y T EHOV EX, AXXOR EH,EH , P R E P A R E F O R A D D I N G T O 16 B I T
SHL EX , 1
A DD D I B X O F F S E T T O C O RR EC T T A B L E E N T R Y
CHP AL,EXT-SCAN , IS C OD E I N K E YB O AR D S E T 7
JL K E X 4 I N K E Y BO A R D S E T , C H E C K F O R B R E A K
, R E G I S T E R
HOV AL:EYTE PTR ES c 6 1 1 , TRANSLATED SCAN CODE IN AL
----SCAN CODE GETS HAPPED TO E X ~ N D E DSCAN CODES;EX1 TES T AH, EREAK-B I T , IS T H I S A B R E A K CO D E7
J Z K E X Z , H A K E CO DE , P U T I N B U F F E RI R E T , BREAK CODE, RETURN FROM I NTE RR UP T
X O R A L , A L , Z E R O O U T A S C I I V A L U E ( N U L 1H O V E X , E U F F E R - T A I L , G ET T A I L P O I N T ERH O V S I , E X , S A VE P O I N T ER T O T A I LC A LL K 4 , I NC R E M EN T T A I L V A L U ECHP EX,EUFFER-HEAD , IS B U F F E R F U L L 7J N E K E X 3 P U T C O NT E NT S O F A X I N B U F F E R
HOV EX,EOH , FREQUENCY OF BEEPH O V C X . 4 E H , D U R A T I O N O F B E E PCA LL KB-NO1 SE , B U F FE R F U L L B E E PAND KE-FLAG,OFOH , C L E A R A L T , C T R L , L E F T A ND R I G H T
, S H I F T SAND KE-FLAG-I , OFH , CLE AR MAKE OF INS , CAPS-LOCK, NUM
, AND SCROLLAN0 KE-FLAG-2, I F H , C L E A R F U N C T I O N S T A T E SI R E T , D ON E U I T H I N T E R R U P T
K E X 3 H OV C S 1 3 . A X , P U T C O N TE N TS O F A X I N B U FF E RH O V E U F F E R - T A I L , B X , A D VA N CE B U F F E R T A I L
I R E T , R E T U R N F R O M I N T E R R U P T
OR AL , AH , U P D A T E N E U S C A N C O D EH OV A H ,A L S A V E A L I N A H A G A I N
K B X 2 A DD A H . 6 4
,E X T E N D E D S E T C O DE S B E G I N A T 150
,----BUFFER I S FULL, BEEP AND CLCAR FLAGS
K E X 4 A ND A H , E R E A K - B IT , M AS K BR E A K B I T O N O R I G I N A L S C A N
----e3 KEY K E Y B O A R D FUNCTIONS sAr F T + P R T S C AND CTRL+NUHLOCK
;EO-1 CHP AL,NUH-KEY , IS T H I S A N U H L O CK -J N E K E 0 - 3 C H E C K F O R P R T S C
T E S T K E j L A G , A LT -S HIF ; IS A L T K E Y H E L D C O N C U R R E N T L Y 7JNZ KE0-2 , ;ASS I T ONJ M P K B 1 6 - 1 , P U T K E YB O AR D I N H OL D S T A T E
TEST KEJLAG,CTL-SHIF~ IS CTRL KEY BEING HELD D O U N ~J Z K E O 2 ~ U H LO C K WITHOUT CTRL, CONTINUE
K E 0 - 2 J H P CONT-1NT , C O N T I N U E U I T H I N T E R R U P T 4 B H
;EO) C H P A L . 5 5 , IS T H I S A P R T S C K E Y ’----CHECK FOR PRTSC
J N Z K E 1 - 1 N O T A P R T S C K E YTEST KE-FLAG, LEFTSHI;T+RIGHT-SHIFT , EITHER SHIFT
, A C T I V E 7J Z K E 0 - 2 , P RO CE SS S CA N I N I N 1 9
TEST KE-FLAG, CTL-SHI FT IS T H E C T R L K E Y P R E S S E D ?J N Z K E 0 - 2 , A01 A V A L I D P R TS C ( P C C O M P A T I B LE )J H P P R T S C H A N D L E T H E P R I N T S C RE E N F U N C T I O N
----ALTERNATE SHIFT TRANSLATI ONkE1-I HOV AH, AL SAVE CHARACTER
AND AL, AND-MASK - E~EAK-EIT , MASK BREAK BTT E S T K E - F L A G , A L T - S H I F T , IS T H I S A P O T E N T I A L T R A N S L A T IO NJ Z K E 2
P U S H C SPOP ES , I N I T I A L I Z E S EG ME NT F OR T A B L E LO OK
HOV D I , O F F S E T A L T - T A B L EHOV CX, ALT-LEN , GET READY FOR TABLE LOOK UPREPNE SCASE , S E R A C H T A B L EJ N E K E Z J UM P I F H A TC H IS NOT FOUND
S U B D 1 C X U P D A T E D I T O I N D E X S C A N C OD E
, --- A B L E L O O K U P
, up
HOV CX,OFFSET ALT-TA~LE + I
HOV AL:CS NEW-ALTCDI; , TRANSLATE SCAN CODE,----CHECK FOR BREAK CODE
HOV EL , KE-FLAG , S A V E K E -F L AG S T A T U SXOR KE-FLAG, ALT-SHI FT , M A S K O F F A L T S H I F TT E S T A H , E R E A K - B I T , IS T H I S A B R EA K C H A R A C T E R 7J Z K E 1 - 2 , J UM P I F S C AN IS A H A K EOR AL , EREAK-B I T , S E T B RE AK B I T
, ---HAKE CODE, CHECK FOR SH I F T SEQUENCE
K E 1- 2 C HP D I , 3 , IS T H I S A S H I F T S EQ UE NC EJL KE1-3 , JUMP I F N O T S H I F T S E Q U E N C EOR KE-FLAG, LEFT-SHI FT , T U R N O N S H I F T F L A G
I N 1 9H , I S S U E I N 1 TO P R O CE SS S C A N C OD EHOV KE-FLAG, BL , R E ST O RE O R I G I N A L F L A G S T A T E S
I R E T
KE1-3 OUT KEPOR T, AL
---- U N C T I O N K E Y H A N D L E R
k E 2 CHP AL , FN-KEY , C H EC K F O R F U N C T I O N K E YJ N Z K E 4 , J UM P I F N O T F U N C T IO N K E YTES T AH, BREAK-B I T , IS T H I S A F U N C T I O N BR E A K
J N Z K E 3 JUMP I F F U N C T I O N B R E A KAND KE-FLAG-2, C L E A R ~ L A G S CLEAR ALL PREVI ous
, FUNC~IONSOR KB-FLAG-2, FN- FLA G + FN-PENDINGI R E T , R E T U R N FR O M I N T E R R U P T
---- U N C T I O N B R E A K;E3 TEST KB-FLAG-2 , FN-PEND I NG
J N Z K E 3 - 1 , J UM P I F F U N C T IO N IS P E N D I N GAND KE-FLAG-2, CLEAR-FLAGS , C L E A R A L L F L A G SI E T
KE 3-1 OR KE-FLAG-2,FN-BREAK , S E T B R E A K F L A GKE3-2 I R E 1 , R E T U R N F R O M I N T E R R U P T
R O M B I O S A-39
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 427/605
l l D E 3 C 551100 74 F BI l D F F6 06 0088 R 90
l l E 4 75 2 1
l l E 6 F 6 0 6 0 0 1 7 R 2 0l l E B 7 4 1 6l l E D 3 C 08
l l E F 77 - 1 2l l F l F E C Bl l F 3 7 4 OE
l l F 5I I F 7I I F AI l F C
I l F F1 2 0 1
1 2 0 31 2 0 5
1 2 0 71 2 0 91 2 0 81 2 0 D
1 2 O F1 2 1 21 2 1 4
1 2 191 2 I8
1 2 2 0
1 2 2 21 2 2 71 2 2 91 2 2 E1 2 3 3
1 2 3 41 2 3 6
1 2 3 8
F E C BB B 1081 R2 E D 7BO E 4 80
OA C4EB 598 A C 4E 8 5 5
3c OB77 2 0F E C B7 5 2 5
F 6 C 4 BO7 5 3 0F 6 0 6 0088 R 80
7 4 2 9F 6 0 6 0088 R 4 0
7 5 2 2
F 6 0 6 0017 R 0 37 4 1880 3 6 0088 R 10
80 2 6 0088 R 1 FCF
0 4 3 AE B 3 E
OE1 2 3 9 0 71 2 3 A 8 F 1 0 6 9 R
1 2 3 D 89 OOOC1 2 4 0 F 2 / AE1 2 4 2 7 4 I D
1 2 4 4 F 6 0 6 0088 R 4 01 2 4 9 7 4 OF
1 2 4 8 F 6 C 4 B O1 2 4 E 7 5 OA
1 2 5 01 2 5 5
1 2 5 A1 2 5 C1 2 5 C1 2 5 E1260
1 2 6 0
1 2 6 I
1 2 6 31 2 6 51 2 6 A1 2 6 C1 2 6 F
1 2 7 1
B O 2 6 0088 R I FC 6 06 0 0 8 7 R 00
E A C 4
E 6 6 0CD 09
C F
3 C 3 17 5 07F 6 0 6 0 0 1 7 R OB7 4 D 8E9 1 0 6 A R2 8 F 9
2 E E A E5 1 0 7 5 R
1 2 7 6 F 6 C 4 EO1 2 7 9 7 4 3 5
1 2 7 81 2 7 01 2 7 F1 2 8 I
1 2 8 3
12851 2 8 71289
12901 2 9 2
1 2 9 612981 2 9 D12901 2 A 2
1288
3c 4 57 4 0 43 C 4 67 5 08
OC 80
E 6 6 0CD 09
2 4 7 FF 6 0 6 0088 R 4 07 4 I 1
3 A 0 6 0 0 8 7 R
75 C 8E O 2 6 0088 R I F
C 6 0 6 0 0 8 7 R 00C F
._---H EC K I F F U N C T I O N F L A G A LR E A D Y SE Tk B 4 : CM P A L , P H K ; IS T H I S A P HA NT OM K E Y ?
K E 4 - 0 T E S T KE-FLAG-Z,FN-FLAG+FNLOCK , AR E U E I N F U N C T IO NJZ ~ 8 3 - 2 , JUMP I F P HA NTOM SE OUE NCE
. S T A T E ?J N Z K B 5
T E S T
, ---- H EC K I F NUM S T A T E IS A C T I V E
J ZCMPJ ADE CJ Z
DE CMOVX L A TAND
ORJMP
K84-1 . MOVJMP
k 8 5 CMPJ ADECJ N Z
_-_-T R A N S L A T E
---- HECK FOR
KF-FLAG,UM-STATEK B 4 - 1 , J UM P I F N O T I N NU M-S TA TEAL, NUM-0 , A R E WE I N N U M ER I C KE YP AD R E G I O N -K 8 4 - 1 , J UM P I F N OT I N K EY PA DA L , CHECK LOUER BOUND OF RANGEK 8 4 I J UM P I F N OT I N RAN GE ( E S C K E Y )
A L , A L IS O F F S ET I N T O T A B L EBX, OF FSE T NUM-CODESCS NUM-CODES , NEW SCAN CODE IS I N A LA H,B RE A K -B IT , I S O L A T E B RE AK B I T O N O R I G I N A L
AL, AH , UPDATE KEYPAD SCAN CODESHORT CONT-INT , C O N TI NU E U I T H I N T E R RU P TAL, AH , G ET B AC K B RE AK B I T I F S E TSHORT CONT-INT
AL, NUM-0 , CHECK FOR RANGE OF INTEGERSK B 7 , JU MP I F N O T I N R AN GE
A L , CHECK FOR ESC KEY ( = I )K B 6 , NOT E S CA P E K E Y . RA NGE OF INTE G E RS
SCAN-CODE T O NUME~IC K E Y P A D
, SCAN CODE
V A L I D F U N C T I O N K E Y
,----E S C A P E K E Y , L O C K KE Y BO A R D I N F U N C T I O N L O C K
T E S T A H , 8 R E A K _ B I T , IS T H I S A B R EA K C O D E7J NZ K 8 8 , NO P ROCE S S ING FOR E S CA P E B RE A KTE S T K B -FL A G-2,FN-FL A G TOGGL E S ONLY UHE N FN HE L D
J Z K E B , NOT HELD CONCURRENTLYTE S T K B -FL A G-2,FN-B RE A K HA S THE FUN CTIO N K E Y B E E N
, R i L E A S E D 7J N Z K 8 8 , C O N T I N U E I F R E L E A S E D P R O CE S S A S
, ESCT E S T KB-FLAG,LEFT-SHIFT+RIGHT-SHIFT , E I T H E R S H I F T 7J Z K B B , NOT HELD DOUNX O R K B - F L A G - 2 , F N L O C K , T O G G L E S T A T EAND KB-FLAG-2,CLEAR-FLAGS , TURN OFF OTHE R S TA TE SI R E T , RE TURN FROM INTE RUP T
, ;ONCURRENTLY
.---- C A N C O DE I N R A NG E I - > 0
,___-HE CK TA B L E FOR OTHE R V A L ID S CA N CODE S
K 8 6 ADD A L , 5 8 , GENERATE CORRECT SCAN CODEJMP S HORT K B 1 2 , CL E A N-UP B E FORE RE TURN TO K B - INT
K B 7 P U S H C SPOP E S , E S T A B L I S H AD DR ES S O F T A B L EM OV D I , O F F S E T KEO , B A S E O F T A B L E
MOV CX, KBOLEN , L E N G T H O F T A B L EREPNE SCASB , S E A RCH TA B L E FOR A MA TCHJ E K E I O , J UM P I F M A TC H
K 8 8 TE S T K B -FLA G-2 ,FN-E REA K , HAS BREAK OCCUREDV
,___-L L E G A L C H A R A C T E R
J Z K E 9 , F U N C T I O N K E Y H A S N O T B EE N
TE S T A H,E RE A K -B IT , IS T H I S A BR E AK O F A N I L L E G A LJ N Z K B 9 , D O N 'T R E S E T F L A G S ON I L L E G A L
, BREAK
, R E L E A S E D
K B8 5 AND KE-FLAG-2, CLEAR-FLAGS , NORMA L S TA TEMOV CUR-FUNC.0 , R E T R I E V E O R I G I N A L S C A N C O D E
k B 9 MOV AL,AH , R E T R I E V E O R I G I N A L S C A N C O D ECONT-I NT
---- U N C T I O N B R E A K IS NOT SET
OUT KBPORT, ALI N 1 9 H , I S S U E KE Y BO A R D I N T E R R U P T
I R E T
RE T- I NT
,---- E FORE TRA NS L A TIO N CHE CK FOR A L T+FN+N-K EY A S NUM L OCK
K 8 l O C MP A L .N - KE Y , IS T H I S A P O T E N T I A L N U M L O C K 7J N E K B I O - I , NOT A N U MK EY , T R A N S L A T E I TT E S T K B - F L A G ,A L T - S H IF T A L T H E L D D O Y N A L S O 7J Z K E B , +REAT A S ILLEGAL COMBINATION
S UB D I . C X , & DA TE INDEX TO NEU SCAN CODEK E IO - I MOV CX , OFFS E T K 8 O + I GE T OFFS E T TO TA B L E
, T A B L EMOV A L , C S K E I C D I I , M OV N E U S CA N C O DE I N T O R E G I S T E R
,---- RA NS L A TE D CODE I N A L OR AN OFFS E T TO THE TA B L E "S CA N"
,-__-HECK FOR TOGGLE KEY
K 8 l 2 T E S T A H . BR E A K- 8 IT , IS T H I S A B RE A K C H A R 7J Z K E l 3 , J UM P I F M A K E CO DE
CMP AL, NUM-LOCK , IS T H I S A N U M L O C K 7J Z K E 12 - 1 , JUMP I F TOGGL E K E YC M P A L , S C R O L L L O C K , IS T H I S A SCROLL LOCK'J N Z K B 1 2 - 2 , JU MP I F N O T A TOGGL E K E Y
OUT KBPORT, ALI N T 9H TOGGL E S TA TE '
AND AL,AND-MASK2BREAk-81T , T UR N O F F B RE AK B I T
J Z K 8 12 - 3 , J U M P - I F B R E A K H A S N OT O C C UR EDCMP AL,CUR-FUNC , IS T H I S A B R EA K O F O LD V A L I D
J N E R E T - I N T , A L L D U F U R T H E R C U RR EN T F U N C T I O N SAND KE-FLAG-2 , CLEAR -FLAGS
MOV CURJUNC.0 , C L E A R C U R R E N T F U N C T I O NI R E 1 , R E T U R N F RO M I N T E R R U P T
K B 1 2 -1 OR A L ,B OH , T U R N O N B R EA K B I T
K E 1 2 -2 TE S T K E -FL A G-2,FN-E RE A K , HA S FUNC TION B RE A K OCCURE D7
, F U N C T I O N
K E 1 2 - 2 0
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 428/605
I 2 A 3 3 A 06 0 0 8 7 R
1 2 A 9 EO 2 6 OOEE R D F
I 2 A E E E ED ’
l 2 E O F 6 06 O OE 8 R 4 0
l 2 E 5 7 4 OD
1 2 8 7 EO 3 E 0 0 8 7 R 00
1 2E C 7 4 0 61 2B E 3 8 0 6 0 0 8 7 RI 2 C 2 7 5 EC
1 2 ~ 7 7 5 e7
I 2 C 4 A 2 0 0 8 7 RI 2 C 7 3 C 0 4I 2 C 9 7 F 91
l 2 C 8l 2 C D1 2 C F
I 2 D I
1 2 0 31 2 0 51 2 0 7l 2 D E
l 2 D D1 2 D F1 2 E 21 2 E 21 2 E 4I 2 E 61 2 E E1 2 E A
7 4 3 43 C 03
7 4 I A
F E C ED O EODO EO9 82 E ED 3 6 IOEE R
03 F OE 9 0 0 0 4
2 E A CE 6 6 0CD 09E 2 F ECF
1 2 E B
1 2 F O1 2 F 2I 2 F 71 2 F 9l 2 F E
1300
1301
1306
1 3 0 81 3 0 Dl 3 O E1311
1 3 1 213131 3 1 413151 3 1 6131813 A1 3 1 81 3 1 C13 D
l 3 l E
F 6 0 6 0 0 1 8 R 08
7 5 O EEO OE O O l E R 08
E 4 A 0F 6 06 O O l E R OB75 F 9
CF
F 6 0 6 O O l E R 08
7 4 0 6
E O 2 6 O O l E R F 7CFE3 C 4 060 7
I FSA595 BE 4 A 0CD 0 55 85 F5 EC F
1 3 1 E1 3 1 E 531 3 1 F 3 8 0 6 0 0 8 5 R1 3 2 3 7 4 3 1
1 3 2 5 A 8 EO1 3 2 7 7 4 1 21 3 2 9 2 4 7 F1 3 2 8 3 8 0 6 0 0 8 5 R
1 3 2 F E A C 41331 75 051 3 3 3 C 6 0 6 0 0 8 5 R 001 3 3 8 F E1 3 3 9 5 81 3 3 A C 3
K 8 1 2 -3 CMP A L ,CUR-FUNC , IS T H I S B RE AK O F F I R S T F U N C T I D N ?
J N E R E T - I N 1 , I G N O R EAND KB-FLAG-2,AND-MASK-FN-PENDING ~ T U R N O F F P E N D I N G
, F U N C T I O NJ M P K E 1 2 - 2 0 , CL E A R CURRE NT FUNCTION A ND RE TURN
;El3 TEST KE-FLAG-2,FN-BREAK , C HE CK I F F U N C T I O N K E Y H A S B EE NV A L ID MA K E K E Y HA S B E E N P RE S S E D- _ -
, PRESSEDJ Z K E 1 4 1 J UM P I F N OT S E T
CMP CUR-FUNC,O , IS T H I S A N E U F U N C T I ON ?J Z K E 1 4 - 1 , I N I T I A L I Z E N EU FU N CT IO NCMP CUR-FUNC,AL , IS T H I S NO N- CU RR EN T F U N C T I O NJ N Z K E E 5 , JU M P I F NO F U N C T IO N IS P E N D I N G
,_ _ _ -UNCTION B R E A K HAS ALREADY ~ ~ C U R E D
, T O R E T R I E V E O R I G I N A L S C A N C OD E,_--- HECK FOR SCAN CODE GENERATION SEQUENCE
K E 1 4 - 1 MOV CUR-FUNC,AL , I N I T I A L I Z E C UR RENT F NK B 1 6 C M P A L , P R T S C R E E N , IS T H I S A S I M U L A T E D S E Q U E N CE ?
JG C O N T - I N 1 , JU MP I F T H I S IS A S I M P L E
J Z P R T S C , D O T H E P R I N T S C R E E N F U N C T I O NCMP A L ,P A US E , IS T H I S T H E H OL D F U N C T I O N ?J Z K B 1 6 -1 , D O T H E P A U S E F U N C T I O N
D E C A L , P O I N T A T E A S ES HL A L , I
S H L A L , I , M U L T I P L Y B Y 4CEUL E A S 1 , S C A N , A DDRE S S S E QUE NCE OF S IMUL A TE D
A DD S 1 ,A X , UP DA TE TO P O IN T A T CORRECT S E TMOV CX.4 , LOOP COUNTER
L ODS S CA N , GET SCAN CODE FROM TABLEOUT KEPORT, ALI N 1 9 H , P RO CE SS I TLOOP GENERATE , GET NEXTI R E T
, 7 R A N S L A T I O N
,---- REAK OR ECHO
, K E Y S T R O K E S
GENERATE
P U T K E YB OA R D I N H O LD S T A T E_--b 1 6 - 1 TEST KE-FLAG-1,HOLD-STATE , CANNOT GO I N HOL D S TA TE I F
, I T S A C T I VEJ N Z K E 1 6 - 2 , D ON E U I T H I N T E R R U P TOR K E -FL A G- I ,HOL D-S TA TE TURN ON HOL D FL A GIN AL,NMI-PORT , RE& K E Y B OA RD L A T C H
HOLD TEST KE-FLAG-I ,HOLD-STATE , S T I L L I N HO LD S TA TE ’J N Z H O L D , C O N T I N U E L O O P IN G U N T I L K EY IS
, PRESSEDK B l6 - 2 I R E 1 , R E TU R N F RO M I N T E R R U P T 4 E H---- R I N T S C R E E N F U N C T I O N
~ R T S C TEST KE-FLAG-~, HOLD-STATE , I S HOLD STATE IN PROGRESS’
AND KE-F~AG-I, OFFH-H~LD-STATE , TURN OFF FLAG
J Z K E 1 6 3 OK T O C O N T I N U E U I T H PR T S C
I R E TK E I 6 - 3 A D D
POP
POPPOPPOPPOPI NI N TPOPPOPPOPI R E T
K E Y 6 2 - I N T E N D P--------- ----TYPAMAT I C
T P
S P, 3 x 2E S
D SDXcxEXAL, NMI-PORT5 HAXDISI
, G ET R I D O F C A L L T O I N T E R R U P T 4 E H, P OP R E G I S T E R S T H A T A R E N ‘ T, M O D IF IE D I N I N 1 5
, RE S E T K E Y B OA RD L A TCH, I S S U E I N T E R R U P T
, P OP THE RE S 1
T H I S R O U T I N E U I L L C HE CK K EY BO A RD S T A T U S B I T S I N KB -F LA G-2A ND D E TE RM INE UHAT S TA T E THE K E Y BOA RD IS I N A P PR O P RI AT EA C T IO N U I L L B E T A KE N
A L = S CA N CODE OF K E Y UHIC H TRIGGE RE D NON-MA S K A BL E INTE RRU P T, N P U T
,OUTPUTC AR RY B I T = I I F NO A C T I O N IS TO B E T A K E NC AR RY B I T 0 ME ANS S CA N CODE I N A L S HOULD B E P ROCE S S E D
MO DIF ICA TIO NS TO THE V A RIA B L E S CUR-CHAR A ND VA R-DE LA Y A REM AD E A L S O T H E P U TC H A R B I T I N K E -F L AG - 2 IS TOGGLED UHENTHE KEYBOARD IS I N H A L F R A TE MODE
F U R T H E R
________________________________________------------TPM PROC NEAR
P US H E XCMP CUR-CHAR,AL , IS T H I S A N E U CH A R AC T ER ?J Z T P 2 J UM P I F S AM E C H AR A CT ER
T E S T A L , E R E A K - B I T , IS THE NE U K E Y A B RE A K K E Y ?J Z TP O , J UM P I F N OT A B R E A KAND A L 0 7 F H C L E A R B R E AK B I TCMP
MOVJ N ZMOVC L CPOPR E T
,_ - _ - E ~ HARACTER CHECK FOR BREAK SEQUENCES
CUR-CHAR, AL
A L , A HTPCUR-CHAR, 00
E X
, IS NEU CHARACTER THE BREAK OF, L A S T M A K E ?, R E T R I E V E O R I G I N A L C H A R A C T E R, JUMP I F NOT THE S AME CHA RA CTE R, CL E A R CURRE NT CHA RA CTE R, C L E A R C AR R Y B I T
, RETURN
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 429/605
1338133E13431348
1340l 34FI354
I356
13581350
I36 I136413661368
1 3 6 A136F1373
13751 3 7 A1 3 7 C1381
1386I388138813891 3 8 A
1388
A 2 0085 R
BO 26 0086 R F O80 26 0088 R F EF6 06 0088 R 02
74 E9BO OE 0086 R O FE8 E2
F6 06 0088 R 0875 288 A I€ 0086 RBO E3 OFOA 0874 ODFE C B
80 26 0086 R F OOB IE 0086 R
E8 I3
F6 06 0088 R 04
74 B C80 36 0088 R 01F6 06 0088 R 0 175 80
F958
c3
1388I388 SO
l 3 8 C 88 0040
l38F BE 081391 581 3 B 2 C 31 3 B 3
1393I393139413911398l 3 B 81390I39F1 3 A I1 3 A 3I3A5I 3 A S1 3 A 71 3 A 81 3 A BI 3 A C1361
13851389I388l 3 8 Cl 3 C OI 3 C 4I 3 C 9
F BI EEB 1388 R80 F C 8074 2E
OA E 474 07F E C C74 16
F BI FC FF AA 0 0070 RC 6 06 0070 R 00
BB OE 0 0 6 E R
B B 16 0 0 6 C RE 8 EAF A89 16 0 0 6 C R89 O E 0 0 6 E RC 6 06 0070 R 00E B D A
I N I T I A L I Z E A N E U CH AR AC TE R---;PO MOV CU R-C HA R,A L , SAVE NEU CHARACTER
A N 0 VAR-DELAV,OFOH , C L E A R V A R I A B L E D E L A YA ND K BJ LA G-2 ,O FE H I N I T I A L P U TC H AR B I T A S Z E ROTEST
OR
KB-FLAG-2, INIT-D~LAY , ARE UE INCREASING THE
VAR-OELAV,DELAY-~UTE , INCREASE DELAY B Y 2x
, I N I T I A L D EL AY -J Z T P D E F A UL T D E L AY
JMP SHORT TP----C HE CK I F U E A RE I N T V P A M A T IC M O DE AN D I F D E LA Y IS OVER
;PZ TE ST KBJLAG-2, TYPE-OFF IS T V P A M A T I C T U R N E D O F F -J N Z T P 4 , J ~ PF TVPAMATIC RATE I S OFFMOV 8L . VAR-DELAY , GET VAR-DEALY
A N D 8 L . O F H , MASK OFF HIGH O R D E R ( S C R E E N R A N G E )OR 8 L . B L , IS I N I T I A L D E L AY O VER -J Z T P 3 , J U M P I F D E L A Y IS OVERD E C B L , D E C R E A S E D E L A Y U A I T B Y ANOTHER
AND VAR-DELAY, OFOHOR VAR-DELAY, ELJ M P S H OR T T P 4
J Z T P J U h P I F YE ARE I N N O RM A L M O D E
TEST KB-FLAC-Z, PUTCHAR IS I T T I M E T O P U T OUT A CHARJ N Z T P , k O T T I M E T O O U T P U T C H A R A C T E R
S T C , S E T C A R R Y F L A GPOP B XR E T
, CHARACTER
----CHECK I F T I M E T O O U T P U T C H A R;P3 TE ST KB-FLAG-2,HALF-RATE ARE YE I N H A L F R A T E M OD E
XOR KB-FLAG-2. P UT CHA ~, TOGGLE BIT
T P 4 , S K I P T H I S C H AR AC TE R
T P M E N D P
, T H I S S U B R OU T IN E S E T S OS T O P O I N T T O T H E BIOS D A T A AREA, I N P U T N O N E, OUTPUT OS IS S E T
b D S PROC NEAR
...............................................................
_--__--__-__--__-^__________________^___-----------------------
P U S H A XMOV AX. 40HMOV DS,AXP O P A XR E T
DDS ENDP
, TI ME-OF-DAVISOUND SOURCE SEL EC T
--- I N T I L , ....................................................T H I S R O U T I N E A L L O U S T H E C LO C K TO B E S E T I R E A DA N I N T E R F A C E F OR S E T T I N G T H E M U L T I P L E X E R F O RAUDI O SOURCE IS A L S O P R O V I D E D
, I N P U T, ( A H ) = 0 R E A D T H E C U R RE N T C L O C K S E T T I N G
RETURNS CX = HIGH P O R T I O N O F C O UN TO X L O U P O R T I O N O F C O UN TA L = 0 I F T I M E R HAS N O T P A S SE D 2 4 H O U RSS I N C E L A S T R E A D < > 0 I F ON ANOTHER D A Y
, ( A H ) = 1 SET THE CURRENT CLOCKCX = HIGH P O R T I O N O F C O U N TOX = LOU P O R T I O N O F C O U N T
, (AH) = 80H S E T U P S O U N D M U L T I P L E X E RA L = ( S O U R C E O F S O U N D ) - -> " A U D I O O U T " OR RF MODULATOR
00 = 8283 CHANNEL 2
0 1 = C A S S E T T E I N P U T02 = " AU D IO I N " L I N E ON I 1 0 CHANNEL03 = COMPLEX SOUND GENERATOR C H IP
, NOTE COUNTS OCCUR AT THE RATE OF 1193180I65536 C O U N T S I S E C( O R ABOUT 18 2 PER SECOND -- S E E E Q U A T E S B E L O U )________________________________________---------------ASSUME
T I ME-OF-DAYS T IP U S HC A L LCMPJ EOR
J ZOECJ Z
T I : S T IPOPI R E T
T 2 : C L IHOVMOVHOV
MOVJ M PT 3 : C L t
MOVwovMOVJ M P
C S : C O D E . D S : D A T APROC FAR
OSDDSAH, 8OH
T 4 AAH, AHT 2AHT 3
DS
AL, T I HER-OPLT I MER-OFL, 0
C X , T I H E R - H I G H
OX, TIMER-LOWT I
T I M E R L O W , O X
TI HER-HI GH, CXT I MER-OFL ,0
T I
I N T E R R U P T S B A C K O NSAVE SEGMENT
AH=BOMUX-SET-UPAH=OREAD-T I MEAH= 1
SET-T I MEI N T E R R U P T S B AC K O NRECOVER SEGMENTR E T U R N T O C A L L E RNO T I M E R I N T E R RU P T S W I L E R E A D IN G
GET OVERFLOW, AND RESET THE FLAG
TOD-RETURNN O I N T E R R U P T S U H l L E
S E T T H E T I M ER E S E T O V E R F L O UTOO-RETURN
U R I T I N G
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 430/605
13CB 5 113CC 8 1 05
I 3 C E D 2 EOl 3 D O B 6 C 41 3 0 2 E 4 6 1
1304 2 4 9FI 3 D 6 OA C 41306 E 6 6 11301 591308 E E C B1 3 D D
1300
1 3 D D F Bl 3 D E 1 EI 3 D F 53l 3 E O € 6 1388 R1 3 E 3 0 1 E 41 3 E S 74 OA13E7 FE CC13E9 74 I E1 3 E E F E C C
l 3 E D 74 2 81 3 E F E B 2E
13FI13F I F B1 3 F Z 9013F3 F A13F4 88 I E O O IA R1 3 F B 38 1 E O O l C R1 3 FC 7 4 F 31 3 F E BE 071400 E8 1 4 4 F R1403 89 I E O O IA R1407 E B 4 3
1409 F A
1 4 0 E 38 I E O O lC R
1 4 1 2 6 6 071 4 1 4 F B1415 5 61 4 1 6 I F1 4 1 7 C A 0002
1 4 1 A A 0 0017 R1 4 1 D E B 2 D
MOA a8 IE 0011 R
T 4 A P U S H C X
HOV CL, 5S A L A L . C L , S H I F T P A R M BITS L E F T 5 P O S I T I O N SX C H G A L , A H , SAVE PARMI N A L,P O RT -B , GET CURRENT PORT SETTI NGSAND AL, lOOlllllB , I S O L A T E H U X BITSOR AL,AH , C O M B I N E P O R T B I T S I P A R M BITSOUT PORT-6, AL , SET PORT T O N E U V A L U EPOP c xJMP T I , TOD-RETURN
TI ME-OF-DAY ENDP
I KEYBOARD I t 0
, J N P U T
---- I N 7 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
T H E S E R O U T I N E S P R O V I D E K E Y B O A R D S U P P O R T
( A H ) - 0 R E A D T H E N E X T A S C I I C H A R A CT E R S T R U CK F RO M T H EK EY B OA R D, R E T U R N T H E R E S U L T I N ( A L ) , S C A N C OD E I N( A H )
A V A I L A B L E TO B E R E A D( Z F ) = I -- N O C O D E A V A I L A B L E( Z F ) = O -- COOE IS A V A I L A B L EI F Z F = 0, T H E N E X T C HA R A C TE R I N TH E B U F F E R TO B EREAD IS I N A X , AN D T HE E N T R Y R E M A I N S I N TH E B U F FE R
THE BIT S E T T I N G S F O R T H I S C OD E A RE I N D I C A T E D I N T H ETHE EQ UATES FOR KB-FLAG
C H AN G ED U S I N G TH E F O L L O U t N G F U N C T I O N S( A L ) = O R E TU R N TO D E F A U L T R E ST O R ES O R I G I N A L
( A H ) = I S ET T HE Z F L A G TO I N D I C A T E I F A N A S C I I C H A R A C T E R IS
( A H ) = 2 R E T UR N T HE C UR RE NT S H I F T S T A T U S I N A L R E G I S T ER
( A H ) = 3 S E T T Y P A M A T I C R A T E S T H E T Y P A M A T I C R A T E C A N B E
S T A T E I E T Y P A M A T IC ON, N OR MA L I N I T I A LD E L A Y , A ND N OR M AL T Y P A H A T I C R A T E
D E L A Y B E T U E E N T H E F I R S T C H A R A CT E R AN DT H E B U R S T O F T V P A H A T I C C H A R S
BY O N E H A L F
I N I T I A L D E LA Y A ND S L O U S T Y P A M A T ICCHARACTERS B Y O N E H A L F
F I R S T C H A R A C T E R IS HONORED AL L OTHERSARE I GNORED
( A L ) = I I N CR EA SE I N I T I A L D ELA Y T H I S IS THE
( A L ) = 2 H A LF -R A TE S L O U S T V P A M A T I C C H AR A CT ER S
( A L ) = 3 C O M B IN E S A L = l AND A L = 2 I N C R E A S ES
( A L ) = 4 T U RN O F F T Y P A H A T I C C H AR A CT E RS O N LY T H E
A L 15 R AN G E C H EC KE D I F A L < O OR A L > 4 T H E S T A T ER E M A I N S T H E S AM E* ** N O TE * ** E A C H T I M E T H E T Y P A M A T I C R A T E S A R EC H AN G ED A L L P R E V I O U S S T A T E S A RE R EM O VE D I E I FTHE KEYBOARD IS I N T H E H a L F R A T E M O D E A ND Y OU U A N TT O AD D A N I N C R E A S E I N T Y P A H A T I C D E L A Y , Y OU M US TC A L L THIS R O U T I N E U l T H A H =3 AND A L = 3
( A L ) = O T U RN O F F K EY B OA R D C L I C K( A L ) = I T UR N ON K EY BO AR D C L I C KA L 15 RANGE CHECKED THE STA TE IS U N AL TE R ED I FA L < > 1 , 0
( A H ) = 4 A D J U S T K E YB O AR D BY T HE V A L U E I N A L A S F O L L OU S
, OUTPUTAS NOTED ABOVE, ONLY AX AND FLAG S CHANGEDA L L R E G I S T E R S R E T A I N E D________________________________________-- - - - - - - - - - - -
K E Y B O A R D - ~ P R O C FA RASSUME CS CODE.DS DATA
S T I
P U S H D SP U S H E XC A L L D D SOR AH,AHJ Z K IDEC AHJ Z K 2DEC AH
J Z K 3J H P S HO RT K J - I
. --- --- READ THE KEY TO F I G U R E O U T U H A T T O DO
I N T E R R U P T S BA C K O NSAVE CURRENT DSS A V E E X T E M P O R A R I L YP O I N T D S A T BIOS DATA SEGMENTAH-0
AS CI I -READAH= I
AS CI 1 -STATUSA H = 2
S H I F T - S T A T U S
K l :
ST I
NOPC LNOV EX, BUFFER-HEAD ,C MP E X , B U F F E R - T A I L ,
J Z K IH O V A X , [ B X IC A LL K 4HOV BUFFER-HEAD, EXJMP SHORT RET-INTI;~
------ A S C I I S T A T U S
K 2
-----K 3
C L I
MOVCMP
HOVS T I
POPPOPR E T
- S H I F THOVJMP
EX, BUFFER-HEAD ,B X , B U F F E R - T A I L ,
A X , t a x iB XD S2
S T A T U SAL, KB-FLAGSHORT RET-IT 16
A S C I I R E A 0I N T E R R U P T S B AC K O N D U R I N G L O O PA L L O U A N I N T E R R U P T TO OCCURI N T E R R U P T S B A C K O F FG E T P O I N T E R T O HEAO OF BUFFERT E S T E N D O F B U F F E RL OO P U N T I L S O M ET H IN G I N B U F FE RGET SCAN CODE AND A S C I I CODEH O V E P O I N T E R T O N E X T P O S I T I O NS TO RE V A LU E I N V A R I A B L E
I N T E R R U P T S O F FGET HEAD POI NTERI F E QU AL ( Z = 1 ) T H E N N O T H I N G T H E R E
I N T E R R U P T S BA C K O NR E C O V E R R E G I S T E RRECOVER SEGMENTTHROW AUAV FLAGS
G ET T H E S H I F T S T A T U S F L A G S
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 431/605
_-__--_D J U S T K E Y C L I C K
K 3 - 1 D EC A HJZ K 3 3D E C A HJ N Z R E T -I N T 16 , I L L E G A L F U N C T I O N C A L LOR AL, AL , T U R N O F F K E Y B O A R D C L I C K ?J N Z K 3 - 2 J U M P F O R R AN G E C H E C K
J H P S HO RT R E T - I N T I 6
J N E R E T I N T I 6 N OT I N R ANG E, R E TU R N
J H P S HO RT R E T - I N T I 6
AND KE-FLAG-I, AND-HA~K-CLICK-ON , TURN OFF CLCK
KB-FLAG-I,CLICK-~N TURN ON KEYBOARD CLICK
K3-2 CHP AL, 1 , RANGE CHECK
OR
------ S E T T Y P A H A T I Ck3-3 C H P A L . 4 , CHECK FOR CORRECT RANGE
J G R E T - I N T I 6 , I F I L L E G A L V AL UE I N A L IG N OR EAND KE-FLAG-2 , OF lH , M A S K O F F A N Y O L D T Y P A H A T I C S T A T E SS H L A L , 1 , S H I F T T O P RO PE R P O S I T I O NOR KE-FLAG-2, AL
P O P E X , RECOVER REGI STERPOP OS , R E C O V E R R E G I S T E RI R E T , R E T U R N TO C A L L E R
R E T - I N T 16
KEYBOARD 10 ENDP
14 F142I1423142514271429142814301432
FE CC74 L AFE CC75 25.OA CO75 07BO 26 0018 R F EE B I A3c 0 1
1434 75 161436 BO OE 0018 R 04
1438 E E O F
1430 3 C 04143F 7F OB1441 EO 26 0088 R F I1446 DO EO1448 08 06 0088 R
1 4 4 C1 4 4 C 5B
1440 I F144E C F144F
144F144F 431450 431451 38 I E 0082 R1455 75 041417 EE I E 0080 R
1458 C 31 4 5 C
1 4 5 C1 4 5 C 521450 3 A 45 46 38 I D1 4 6 2 2 A 36= OOOE
14641464 EO1465 4 0 20 10 OE 0 41 4 6A 0 2 01
1 4 6 C 1E FF 00 FF FF FFI E F F
1 4 7 4 FF FF FF I F FF 7 FFF I1
1 4 7 C 17 05 I 2 14 19 1509 O F
1484 10 I E I D OA F F 0 1
131488 04 06 07 08 OA OB
OC F F F F1494 FF FF I C I A 18 03
16 0 214 9C OE OD FF FF F F FF
FF F F1 4 A4 2 0 FF
1 4 A 61 4 A 6 5 E I F 60 6 1 6 2 63
6 4 651 4A E 6 6 67 FF F F 77 FF
1486 73 F F 7 4 F F 75 F F
14EE F F
1 4 E F1 4 E F 18 3 1 32 33 34 35
36 37 38 39 30 2 03 0 OE 09
1 4 C E 7 1 77 65 7 2 74 7975 69 6 F 70 5E 5 D00 FF 6 1 73 6 4 6 66 7 68 6 A 68 6 C 38
271 4 E 7 60 F F SC 7 A 7 8 63
76 6 2 6 E 60 2 C 2 E2 F F F 2 A F F 20
E 4 F F
76 FF
1 4 F E F F
14F914F9 I E 2 1 40 23 2 4 2 5
5 E 2 6 2 A 2 8 2 9 5F
28 08 001508 5 1 57 45 52 54 59
S5 49 4 F 50 78 7 DOD F F 4 1 53 4 4 4 64 7 4 8 4 A 4 8 4 C 3 A22
I 5 2 1 7 E F F 7C 5A 58 435 6 4 2 4 E 40 3 C 3E
3F F F 00 F F 2 0 F F
; AH=), ADJUST TYP AHA TI C: RANGE CHECK FOR AH=4
-I N C R EM E N T A B U F F E R P O I N T E RPROC NEARI N C E X , H OV E TO N E XT U OR D I N L I S TI N C E XCHP EX,EUFFERJND ; AT END OF BUFFER?JNE K 5 ; N O , C O N T I N U EHOV BX,EUFFER-START , Y ES , R E S E T T O B U F F E R B E G I N N I N G
R E TENOPT A B L E O F S H I F T K E Y S AN D M AS K V A L U E SL A B E L B Y T ED E I N S - K E Y ; I N S E R T K E YD ED E L E F T - K E Y , R I G H T - K E YE O U I - K 6S H I F T - M A S K - T A B L EL A B E L B Y T E
CAPS-KEY, NUH-KEY, SCROLL-KEY, ALT-KEY, CTL-KE Y
OB I N S S H I F T . I N S E R T M O D E S H I F T
D ED E L E F TJ H IF T , R I G H T - S H I F TSCAN CODE TABLES I
CA PS-S i i I FT . NUH-SHIF ;, SCRO LL-SHI FT, ALT -SH I FT, CTL -SH I FT
OB
DE
D E 23,s. 1 E . 2 0 . 2 5 . 2 1 . 9 , 15
2 7 , - l , O , -1, -1, - I , 30,-1
- 1 , - I , -1,31, -1, 1 2 7 , - 1 , 17
D E
D E
D E - 1 , - 1 , 2 E , 2 6 , 2 4 , 3 , 2 2 , 2
D E 1 4 , 1 3 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1
DE ' ' . - I
1 6 , 2 7 , 2 9 , 10, -1, I , 19
4 , 6 , 7 , E , 10, 11, 12, - l , - l
.~
. -------- C T L T A B L E S C A NK 9 L A B E L B Y T E
D E
D E
DE
D EL C T A B L E--- --- -;lo L A B E L B Y T E
D E
D E
D E
D EU C T A B L E------
KI I L A B E L B Y T ED E
D E
9 4 , 9 5 , 9 6 , 9 7 , 9 8 , 9 9 , 100, 101
1 0 2 , 103 , -1 , -1 , 119,-1, 1 3 2 , - 1
115, -1, 1 1 6 , -1, 117,-1, 118. - I
- 1
OIEH, ' 1 2 3 4 5 6 7 8 9 0 - = ' , OEH, 0 9 H
'que r t y o I o p C 3 ', DH, -1, 1Sd f g hJ k 1; 0 2 7 H
6 0 H , - 1 , 5 C H , z x c v b n n , . / ' , - I , ' * ' , - I , ' '
- I
2 7 , ' E I L ' , 3 7 , 0 5 E H , '&+( ) -* ' ,08H,O
' O U E R T V U I O P < ) ', ODH, -1, ' A S D F G H J K L : I
D E 0 7 E H , - I , ' : Z X C V E N H < > ? ' , - I ,O , - I , ' ' , - I
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 432/605
15331 5 3 3 5 4 5 5 5 6 5 7 5 e 59
5 A1 5 3 A 5 8 5 C 5 D
1 5 3 01 53 D 6 8 6 9 6A 6 E 6 C1 5 4 2 6 D 6 E 6 F 70 7 1
1 5 4 71 5 4 7 37 3 8 39 2 0 3 4 3 5
3 6 2 8 3 1 3 2 33 302 E
1 5 5 41 5 5 4
1558
1 5 6 I156 I
1 5 6 215631 5 6 41 5 6 51 5 6 61 5 6 71 5 6 81569
4 7 4 e 49 FF 413 FF
4DF F 4 F 5 0 5 1 5 2 5 3
F E5 053
5 1
5 25 65 7I E06
1 5 6 A F C1568 E 8 I 3 8 E R1 5 6 E E A E O
1 5 7 01 5 7 21 5 7 41 5 7 7i 5 7 A1 5 7 D
1 5 8 2
1 5 8 71 5 E C
1 5 E F1 5 E F1 5 9 I
3 C F F7 5 ieeo OOEOe9 0 0 4 8E 8 E 0 3 5 REO 2 6 0017 R FO
EO 2 6 o o i e R OF
eo 2 6 ooee R IFE 9 1 6 4 A R
2 4 7 FOE
1 5 9 2 071 5 9 3 E F 14 5 C R
1 5 9 6 ES oooe1599
1 5 9 E1 5 9 D1 5 9 F
1 5 A 21 5 A 61 5 A B1 5 A D
1 5 A F1 5 8 2
15e4
m e
I S B E
1588
1 5 C O1 5 C 21 5 C 4I 5 C 61 5 C E1 5 C D1 5 D 21 5 D 41 5 D 91 5 0 81 5 0 81 5 D E1 5 E 1
1 5 E I1 5 E 6
F 2 / A E
8 A C 47 4 03E 9 1 6 3 A R
e 1 EF 1 4 5 ~
AE eo2 E : 8 A A 5 1 4 6 4 R
7 5 5 1
E O F C 1073 07
08 2 6 0017 RE 9 1 6 4 A R
F6 0 6 0017 R 04
3 C 5 275 2 2F 6 06 0017 R 08
75 6 0F 6 06 0017 R 2 075 ODF 6 0 6 0017 R 037 4 OD
E8 5 2 3 0E 9 1 7 E C R
F 6 06 0017 R 037 4 F 3
75 7e
1 5 E E
1 5 E C 75 5 Cm e 8 4 2 6 oo ie R
I ~ E E oe 2 6 OOIE R
1 5 F 2 3 0 2 6 0017 R1 5 F 6 3 C 5 2
1 5 F A BE 5 2 0 01 5 F D E 9 1 7 E C R
E.F~ 75 5 0
U C T A B L E S C A N-_---K 1 2 L A B E L B Y TE
DE E 4 , 8 5 , 8 6 , 8 7 , 8 8 , 8 9 , S O
DE 9 1 . 3 2 . 9 3A L T T A B L E S C A N__---
k I 3 L A B E L B Y T EDE
DE
1 0 4 , 105, 106, 1 0 7 , 108
109, 110, 111, 1 1 2 , 113N U M S T A T E T A B L E_ _ _ _ _
k14 L A B E L B Y T ED E ‘ 7 8 9 - 4 5 6 + 1 2 3 0 ’
B A S E C A S E T A B L E-----
K 1 5 L A B E L B Y TEDE 7 1 , 7 2 , 7 3 . - I , 7 5 , - 1 . 7 7
DE - I , 79, EO, ~ 1 , e 2 , 3__-___E Y BO A R D I N T E R R U P T R O U T I N E
K B - IN T P ROC FA RS T I , A L L OW FURTHE R INTE RRUP TSP US H A XP U S H E XP U S H c xP US H DXP US H S IP US H D IP U W D SP U S H E SCL D , F O R W A R D D I R E C T I O NC A L L D D SMOV A H , A L S A V E S C A N C OD E I N A H
CMP A L ,OFFH , I S T H I S A N O V ER RU N C H AR ’J N Z K 1 6 , N O, T E S T FO R S H I F T KE YMOV EX,BOH , DUR A TIO N OF E RROR B E E PMOV CX ,4 8 H , FREQUENCY OF TONECA LL KB-NO1 SE , B U F FE R F U L L B E E PAND KB-FLAG , OFOH , C L E A R A L T , C L R L , L E F T A N D R I G H T
, S H I F T SAND KB-FLAG-1,OFH , C L E A R P O T E N T I A L B R E AK O F I N S , C A P S
, ,N UM A ND S C R O L L S H I F TA N D K E - F L A G - 2 , I F H , C L E A R F U N C T I O N S T A T E SJ M P K 2 6 , E N D O F I N T E R R U P T
___---ES T FOR OVERRUN S CAN CObE FROM KEYBOARD
_____-E S T F OR S H I F T K E Y Sk 16 , T E S T - S H I F T
A N D A L . 0 7 F H , T U RN O FF T H E BR EA K B I TP US H CSP OP E S , E S T A B L I S H A D DR ES S O F S H I F T T A B L EMOV D 1 , O F F S E T K 6 , S H I F T K E Y T A B L E
MOV CX ,K 6 L , L E N G T HRE P NE S CA S B , LOOK THROUGH THE TABLE FOR A
MOV A L ,A H , RECOVER SCAN CODEJ E K 1 7 , J U M P I F M A T CH F O UN DJ M P K 2 5 , I F NO MA TC H, T H E N S H I F T N O T F OU NDS H I F T K E Y F O UN D
MOV A H ,C S K 7 C D I l , GE T MAS K I N TO A HT E S T A L , B O H , TE S T FOR B RE A K K E YJ N Z K 2 3 B R EA K S H I F T F OU ND
CMP A H, S CR OL L -S H IFTJ AE K I E , I F S C R O L L S H I F T O R A B OV E , T O G GL E
, MA TCH
------K I ~ sue DI,OFFSET K ~ + I , ADJUST PTR T O SCAN CODE MA TCH
------ SHIFT MA K E FOUND. DE T E RM~NE ET-OR TOGGLE
K E Y------ PLAIN SHIFT KEY, S E T S H I ~ T ON
------ TOGGLED SHIFT KEY, TEST ;OR IS MAKE R NO T
OR KB-FLAG,AH , T UR N ON S H I F T B I TJ MP K 2 6 I N T E R R U P T R ET U RN
K 18 S H I F T - T O G G L ETEST KB-FLAG, CTL-SHI~T , CHECK CTL SHIFT STATE
J N Z K 2 5 , J UM P I F C T L S T A T ECMP AL, INS-KE Y , C H EC K F O R I N S E R T K E YJ N Z K 2 2 J UM P I F N OT I N S E R T K EYT E S T K B -F L AG , A L T - S H I b T , C H EC K F OR A L T E R N A T E S H I F TJ NZ K 2 5 , J UM P I F A L TE R N AT E S H I F TTEST KE-FLAG, NUM-STATE , CHECK FOR E A S E S TA TEJ NZ K 2 1 , J UM P I F N UM L OC K I S O NT E S T K B -F L AG , L E F T - S H I F T + R I G H T - S H I F TJ Z K 2 2 , J UM P I F B A S E ST A T E
MOV A X , 5 2 3 0 H , P U T O UT A N A S C I I Z ER OJ M P K 5 7 , B UFFE R-F I LL
T E S T K E- FL AG , L E F T - S H I F T + R I G H T - S H I F TJ Z K 2 0 , J U M P N U M E R I C , N OT I N S E R T
K 2 2 , S H I F T T OG GL E K E Y H I T , P RO CE SS I TTEST AH,KE-FLAG-1 , I S K E Y A L R E AD Y D E PR ES SE DJ NZ K 2 6 , J U M P I F K E Y A L R E A D Y D E PR E SS E DOR KB-FLAG-I ,AH , I N D I C A T E TH AT T HE K EY I S
XOR K9-FLAG.AH , T O G G L E T H E S H I F T S T A T ECMP AL , INS-KE Y , T E S T F OR I S T MA KE O F I N S E R T KEYJ NE K 2 6 , J UM P I F N OT I N S E R T K E YMOV A X , INS -K E Y r2 5 6 , S E T S CA N CODE IN TO A H, 0 I N T O A L .J M P K 5 7 , P U T I N T O O U T PU T B U F F E R
K 2 0 , NUME R IC ZE RO, NOT INS E R T K E Y
K 2 1 , M I G H T B E N U M E R I C
, DEPRESSED
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 433/605
16001 6 0 016031605160716081 6 0 D
160F1 6 1 216141618161 A16 C161 F16 F1621162316281 6 2 A
162F
16321 6 3 41638
1 6 3 A1 6 3 A1 6 3 C
1 6 3 E1 6 4 31645
1 6 4 A1 6 4 A1 6 4 816dc16401 6 4 E1 6 4 F1 6 5 016511652
80 F C 1073 I AF 6 D 42 0 2 6 0017 R3 C BE75 38
A 0 0019 R3 2 E 4EE 2 6 0019 ROA CO7 4 2 EE 9 1 7 F 5 R
3 C 8 A75 OFF 6 06 001% R 0 274 08
80 2 6 0018 R F D
E 8 19 90
F 6 0420 2 6 0018 RE E 10
3C EO73 oc
F6 06 OOlE R 08
7 4 OEEO 2 6 0018 R F7
0 7I FS F5 ES A59585 ECF
1 6 5 31653 F 6 06 0017 R 08
1658 75 031 6 5A E 9 1749 R
1 6 5 01 6 5 0 F6 06 0017 R 041662 74 6 91664 3 C 531666 75 09
1668 C 7 06 0 0 7 2 R 1 2 3 41 6 6E E 9 0 0 4 3 R1671 3 C 521673 75 09
1675 C 7 06 0 0 7 2 R 4 3 2 11678 E 9 0043 R1 6 7 E 3 C 3 A1680 75 13
1682 F6 06 0018 R 0 21687 75 C l
1689 EO 36 O O l E R 04
1 6 E E EO OE O O l E R 0 21693 E 8 E 51695 3 C 4 01697 75 121699 E E 1 E 6 E R
1 6 9 C 3 C F C
1 6 9 E 7 C A AlOI0 F E O E 0089 R1 6 A 4 F E C El 6 A 6 E E l E 7 A R1 6 A 9 E 8 14
l 6 A E 3 C 4 81 6 A D 75 I E1 6 A F E 8 1 E 6 E R
1682 I C 0 4
1684 7F 9 41686 F E 06 0089 R1 6 E A F E C O
1 6 8 C E E 1 E 7 A R
B R E A K S H I F T F O U N D
CMP AH,SCROLL-SHIFT , I S T H I S A T OG GL E KE YJ A E K 2 4 , YES, HANDLE BREAK TOGGLENOT AH , I NVERT MASKAND KE-FLAG, AH , T UR N O F F S H I F T B I TCMP AL,ALT-KEY+EOH , IS T H I S A L T E R N A T E S H I F T R E L EA S EJ N E K 2 6 I N TE R R U PT - RE T U R N
MOV AL, ALT - I NPUTXOR AH, AH , SCAN CODE OF 0
MOV ALT- INPUT, AH , ZERO O U T T H E F I E L DOR AL,AL
,U A S T H E I N P U T = D ?
J E K 2 6 , INTERRUPT-RETURNJ M P K 5 E , I T U A SN ‘T , SO P U T I N B U FF E R
CMP AL , CAPS-KEV+EREAK-B I T , SPECI AL CASE OF TOGGLE KEYJ N E K 2 4 1 JUMP AROUND PO TE NT I AL UPDATE
J Z K 2 4 - 1 J UM P I F N OT S P E C I A L C AS EAND
J M P K 2 6 , I N T ER R U P T I S O VERBREAK OF NORMAL TOGGLE
AND KB-FLAG-1,AH , I N DI CA TE NO LONGER DEPRESSEDJ M P S HO RT K 2 6 , I NTERRUPT-RETURNT E S T F O R H O L D S T A T E
CMP AL,BOH , TEST FOR BREAK KEYJ A E K 2 6 , NOTHI NG FOR BREAK CHARS FROM HERE
T E S TJ Z U 2 E B RA NC H A RO UN D T E S T I F N OTAND
------k 2 3 , BREAK-SHI FT-FOUND
------ ALTERNATE SHIFT K E Y RELEASED, GET THE VALUE INTO BUFFER
K 2 4 , BREAK-TOGGLE
TEST KE-FLAG-~,L CK-~EOUENCE
KE-FLAG-I, AND-MA kK-CL1 CK-SEOUENCE , MASK OFF MAKE, O F C L I C K
------k24-1 NOT AH , I N V E R T M A S K
------k25 , NO-SHI FT-FOUND
ONKE-FLAG_l,HOLD-S;4TE , ARE WE I N WOLD S TAT E?
KEJLAG- l ,NOT HOLD-STATE , TURN OFF THE HOLD STATE, B I T
K 2 6 , I NTERRUPT-RETURNPOPPOPPOPPOPPOPPOPPOPPOPI E 7
E SD SD IS ID Xcx8 XAX
H O LD S T A T E , T E S l
RESTORE STATER E T UR N , I N T E R R U P T S B A C K O N U I T HFLAG CHANGE
NO-HOLD-STATEF O R S P E C I A L C H A R S
T E S T K B -T L A G, A LT - SH I F A RE U E I N A L TE R N A TE S H I F T
J N Z K 2 9 , ;UMP I F A L T E R N A T E S H I F TJ WP K 3 8 J U M P I F NOT ALTERNATE------ TEST FOR ALT+CTRL KEY SE~UENCES
k29 TEST-RESETTEST KB-FLAG,CTL-SHIF+ , ARE UE IN CONTROL SHIFT ALSOJ Z K 3 1 , NO-RESETCMP AL.DEL-KEY , S H I F T S T A T E I S T H ER E , T E S T K E YJ N E K 2 9 - 1 , NO-RESET
MOV RESETJLAG, 12 34 H SET FLA G FOR RESET FUN CTI O NJMP NEAR PTR RESET , ;UMP TO POUER ON DI AG NO ST IC S
J N E K 2 9 - 2 , CHECK FOR OTHER
------ CTL -ALT-D EL HAS BEEN FOUND, DO 110 C L E A N U P
K29-1 CMP AL , I NS-KEY , C HE CK F O R R E S E T U I T H D I A G N O S T I C S
ALT-CTRL-SEQUENCES------ ALT-CTRL- I S HAS SEEN F O ~ N D
M O V R E S E T _ F L A G , 4 3 2 1 H , S E T F L A G F OR D I A G N O S T I C SJMP NEAR PTR RESET , L E V E L 1 D I A G N O S T I C S
J N E K 2 9 3 , CHECK FOR SCREEN ADJUSTMENT
------ ALT+CTRL*CAPSLOC K HAS SEEN FOUNDT E S T K E F L A G 1 . C L I C K S EQ U EN C E
K29-2 CMP AL,CAPS-KEY , CHECK FOR KEYEORAD CL I CK TOGGLE
J N Z
XOR
ORJ M P
K29-3: CMPJ N EC A L L
CUP
JL
DECOECC A L LJMP
K29-4: CMPJ N EC A L L
CMP
J G1NCI C
C A L L
K 2 6 - . - J U M P I F S E QU EN CE H A S A L R E A D Y
K B - F L AG - l ,C L l C K -O N T O GG L E E I T F O R A U D I O K E Y S T R O K E
KB-FLAG-l,CLICK-SEQUENCE SET CL ICKJEQUENCE STA TE
AL,RIGHT-ARROU , A D J U S T S C R E E N T O T H E R I G H T 7K 2 9 - 4 , L O O K F O R R I G H T A D J U S T M E N TGET-POS , GET THE t OF P O S I T I O N S SC RE EN I S
AL,O-RANGE . I S SC R EE N S H I F T E D A S F AR A S
K 2 6 , OUT OF RANGEHORZ-POS , S H I F T V A L U E TO T H E R I G H T
A L , DECREASE RANGE VALUEPUT-POS , RESTORE STORAGE LOCATI ONSHORT K 2 9 5 , A D J U S T
AL.LEFT-ARROU , A D J U S T S R E E N T O T H E L E F T ?K 31 , NOT AN ALT-CTRL SEQUENCEGET-POS , G ET N UM EE R O F P O S I T I O N S S CR EE N I S
AL, RANGE , IS S C R E E N S H I F T E D A S F A R A S
K 2 6HORZ-POS , S H I F T S CR EE N TO T H E L E F TA L , I N C R E A S E NU M 8E R O F P O S I T I O N S
PUT-POS , P U T P O S T I O N B A C K I N S TO R AG E
, OCCURED
, FLEDBACK
S H O R T K 2 6 , INTERRU~T IS OVER
, S H I F T E D
, P O S S I B L E ?
. S H I F T E D
, P O S S I B L E ’
, S CR EE N I S S H I F T E D
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 434/605
l6EF EO 021 6 C 1 B A 0 3 D 4
1 6 C 4 E EI 6 C 5 A 0 0089 R1 6C E 4 21 6 C 9 EE1 6 C A E 9 1 6 4 A R
1 6 C D1 6 C D 3 C 391 6 C F 75 2 91 6 D 1 BO 2 01 6 D 3 E 9 1 7 EC R
1 6 D 61 6D 6 5 2 4 F 50 5 1 4 8 4 C
401 6 D D 4 7 4 8 4 9
1 6 E O 10 I 1 1 2 13 1 4 I 516 17
1 6 E E 18 19 1E I F 2 0 2 12 2 2 3
1 6F O 2 4 2 5 2 6 2C 2 0 2 E2 F 30
1 6 F E 3 1 3 2
1 6 F A1 6 F A B F 1 6 D 6 R1 6 F D 8 9 OOOA1700 F 2 / A E1 7 0 2 75 13
1 7 0 4 E 1 E F 1 6 D 7 R1 7 0 8 A 0 0019 R1708 E 4 OA1700 F6 E 41 7 0 F 03 C 71711 A 2 0019 R1714 E 9 1 6 4 A R
1717
1717 C 6 06 0019 R 00
1 7 1 C E9 0011
1 7 1 F F 2 / A E1 7 2 1 75 051 7 2 3 32 CO1 7 2 5 E 9 1 7 EC R
1 7 2 8
1 7 2 8 3 C 0 21 7 2 A 7 2 OC1 7 2 C 3 C O E1 7 2 E 73 08
1730 E O C 4 7 6
1733 32 CO1735 E 9 1 7 E C R
1 7 3 81738 3 C 381 7 3 A 73 0 3
1 7 3 C1 7 3 C E 9 1 6 4 A R173F173F 3 C 471741 73 F9
1 7 4 3 E B l S 3 D R1 7 4 6 E 9 1 8 6 3 R
17491749 F6 0 6 0017 R 0 41 7 4 E 7 4 34
175017521 7 5 417581 7 5 D1 7 5 F176 I
17631766
1 7 6 A1 7 6 D
3 C 4 67 5 19EE I E O O IA RC 6 0 6 0 0 7 1 R EOCD 182 E COE 9 07E 8 1 4 4 F RE9 I E O O lC RE9 1 6 4 A R
1 7 6 D 3 C 371 7 6 F 75 061771 B E 7 2 0 0
1 7 7 4 EE 76 90
K 2 9 -5 MOV A L ,2 , A D J U S T
MOV DX ,3 D4 H , ADDRESS TO CRT CONTROLLEROUT DX ,A LMOV AL, HORZ-POS , C O L U M N P O S I T I O NI N C D X , P O I N T A T D A T A R E G I S T E RO U T D X , A L , M O V P O S I T I O NJ M P K 2 6
------ I N AL T E R NA T E S H I F T , R E S ET N O T F OU NDK 3 , NO-RESET
C M P A L . 5 7 , T E S T F O R S P A C E K E YJ N E K 3 2 , NOT THEREMOV A L , ' ' , SET SPACE CHARJ M P K 5 7 , B U F F E R - F I LL----- A L T - I N P U T - T A B L E
K 3 0 L A B E L B Y TED E 8 2 . 7 9 , E O, El, 7 5 , 7 6 , 7 7
D E 7 1 , 7 2 . 7 3 , 10 NUMBERS ON KEYPADS U P E R - S H I F T - T A B L ED E 16, 17, 1 8 , IS, 0 , 2 1 , 2 2 , 2 3 , A - 2 TY P E WRITE R CHA RS
D E 2 4 , 2 5 , 3 0 , 3 1 , 3 2 , 3 3 , 3 4 , 3 5
D E 3 6 , 3 7 , 3 E , 4 4 , 4 5 . 4 6 , 4 7 , 4 8
------
D E 49,50L OOK FOR K E Y P A D E NTRY
MOV D1 ,OFFS E T K 3 O ,MOV CX, 10
RE P NE S CA S EJ NE K 3 3
S U E D 1 ,O F F S ET K 3 O + I ,MOV A L ,A L T- INP UT ,MOV AH, 10
MUL AHADD AX,DIMOV A L T - I N P U T , A L ,J M P K 2 6
------K 3 2
----_- OOK FOR SUPERSHIFT ENTR;
;33MOV A L T- INP UT.0 ,
MOV C X , 2 6RE P NE S CA S EJ NE K 3 4X OR A L .A L
A L T-K E Y -P A DA L T - I N P U T - T A B L EL OOK FOR E NTRY US ING K E Y P A DLOOK FOR MATCHNO-ALT-KEYPAD
D I N O U H A S E N T R Y V A L U EGE T THE CURRE NT B Y TEM U L T I P L Y BY 10
AD D I N TH E L A T E S T E N T R YS TO R E I T A U AYTHROU A UA Y THA T K E Y S TROK E
NO-A L T-K E Y P A DZ E R O A NY P R E V I O U S E N T R Y I N T OI N P U TD 1 , E S A L RE AD Y P O I N T I N GL O O K FO R M A TC H I N A L P H A B E TNOT FOUND, FU NC TIO N KEY OR OTHERA S C I I C OD E OF Z ER O
J M P K 5 7 , P UT I T I N TH E BU FF ER-----_ L O O K F O R T O P R O W O F A L T E R N I T E S H I F T
K 3 4
C M P A L . 2J B K 3 5CMP A L , 1 4J A E K 3 5ADD AH, 118
XOR AL,ALJ M P K 5 7
-__--_R A N S L A T E A L T E R N A T E SHf F;K 3 5
C M P A L . 5 9J A E K 3 7
J M P K 2 6
C M P A L , 7 1J A E K 3 6MOV E X, OF FS ET K I 3 ,J M P K 6 3
K 3 6
K 3 7
----_- N OT I N AL T ER N AT E S H I F TK 3 8
ALT-TOP-ROU
K E Y U I T H' I '
ON I TN OT O NE OF I N T E R E S T I N G K E Y SI S I T I N T HE R EG IO N?A L T - F U N C T I O NCONVERT PSUEDO SCAN CODE TO
I N D I C A T E A S SU C HBUFFER-F 1LL
P S E UDO S CA N CODE SA L T - F U N C T I O NT E ST F O R I N T A B LEA L T - C O N T I N U ECLOSE-RETURNIGNORE THE K E YA L T - C O N T I N U EI N K E YP AD R E G I O NI F SO, I G N O R EA L T S H I F T P S E U D O S C A N T A B L ET R A N S L A T E T H A T
RANGE
N O T - A L T - S H I F T. A RE U E I N CO N TR O L S H I F T ?
_ _TEST KB-FLAG, C T L S H I F ~
J Z K 4 4 NOT-CTL -S HIFT------ CONTROL SHIFT, TEST SPEC; AL C H A R A C T E R S------ TEST FOR BREAK AND PAUSE KEYS
CMPJ N EMOVMOVI TS U BMOVC A L LMOVJMP
T E S T
CMPJ N EMOVJMP
AL, SCROLL-KEY ,K 4 I
EX, BUFFER-HEAD ,B IOS -B RE A K . EOH ,IEH
AX, AXCE X I , A XK 4B U F F E R - T A I L , B X ,K 2 6
S P E C I A L C A S E K E Y 5 5 '
A L , 55K 4 2A X , 1 1 4 U 2 5 6 ,K 5 7
TE S T FOR B RE A KNO-BREAKGE T CURRE NT B UFFE R HE A DT U RN O N E I OS - ER E A K B I TB RE A K INTE RR UP T V E CTORPUT OUT DUMMY CHARACTERPUT DUMMY CHAR AT BUFFER HEADU P D A T E B U F F E R P O I N T E RU P D A T E T A I LD ON E U I T H I N T E R U P TNO-PAUSE
N O T - K E Y - 5 5S T A R T IS T O P P R I N T I N G S U I T C HB U F F E R - F I L L
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 435/605
17771777 8 B 1 4 6 C R1 7 7 A 3 C 38
1 7 7 C 72 6 A
1 7 7 E 86 1 4 A 6 R1 7 6 1 E 9 1 8 6 3 R
1 7 8 41 7 8 4 3 C 4 71 7 8 6 73 I F1 7 6 6 F 6 06 0 0 1 7 R 03
1 7 B D 7 4 4 E
1 7 6 F 3 C O F .1791 75 0 51793 BE O F 0 01796 E B 5 41796
1 7 9 8 3 C 381 79 A 7 2 0 61 7 9 C EB 1533 R1 7 9 F E 9 1 6 6 3 R1 7 A 21 7 A 2 BE 1 4 F 9 R1 7A 5 E 6 4 1
1 7 A 71 7 A7 F 6 06 0 0 1 7 R 2 01 7 A C 75 2 1
1 7 AE F 6 0 6 0017 R 03
1783 75 2 1
17851 7 8 5 3 C 4 A1 7 8 7 7 4 OC1769 3 C 4 E1 7 8 8 7 4 OD
1 7B D 2 C 4 7178F BE 1 5 5 4 R1 7 C 2 E 9 1 8 6 5 R1 7 C 5 86 4 A 2 D1 7 C 8 E6 2 21 7 C A 86 4 E 2 B1 7C D E 6 ID
1 7 C F1 7C F F 6 0 6 0017 R 03
1 7 D 4 75 D F1 7 D 61 7 D 6 2 C 461 7 D 8 B E 1547 R1 7 D 8 E B OB
1 7 D D1 7 D D 3 C 38
1 7D F 7 2 041 7 E I 3 2 CO1 7 E 3 E B 071 7 E 51 7 E 5 BE 1 4 B F R
1 7 E 81 7 E B F E C 61 7 EA 2 E . 0 7
1 7 E C1 7 EC 3 C F F1 7 E E 74 I F1 7 F O 80 F C FF17F3 7 4 1 A
17F51 7 F 5 F 6 0 6 0 0 1 7 R 401 7F A 7 4 2 0
1 7F C F 6 06 D O 1 7 R 03
1801 7 4 O F
le03 3 C 4 11805 7 2 15
1807 3 C 5 A1809 77 I1
l B O B 04 20l 8 O D E B OD
I B O FI B O F E 9 1 6 4 A R
18 1 21 8 1 2 3 C 6 11 8 1 4 7 2 0 61 8 1 6 3 C 7 A1818 77 0 2l 8 l A 2 C 2 0
------ S E T U P T O T R A N S L A T E C O N T R O L S H I F Tk 4 2 . N O T - K E Y - 5 5
MOV BX, OFFSET KB . S E T U P T O T R A N S L A T E C T LC M P A L . 5 9 , I S I T I N T A B L E ?J B K 5 6 , YES, GO TRA NSLA TE CHAR
H OV E X ,O F F S E T K 9 , C T L T A B L E S C A NJ M P K 6 3 , TRANSLATE-SCAN
, C T L - T A B L E - T R A N S L A T E
------ N OT I N C ON TR OL S H I F Tk 4 4 , N O T - C T L - S H I F T
C M P A L . 7 1 , T E S T F O R KE Y P AD R E G I O NJ A E K 4 6 H A N D L E K EY P AD R E G I O N
J Z K 5 4 T E S T F OR S H I F T S T A TE
CMP AL , 1 5 , BACK TAB KEYJ N E K 4 6 . , N O T - B A C K - T A BM OV A X, 1 5 * 2 5 6 , SET PSEUDO SCAN CODEJ M P S HO R T K 5 7 , B U F F E R - F I LL
C M P A L , 5 9 , F U N C T I O N K E Y SJ B K 4 7 , N O T - U P P E R - F U N C T I O NM OV B X , O F F S E T K 1 2 ~ UPPER CASE PSEUDO SCAN CODESJ M P K 6 3 , TRANSLATE-SCAN
MOV B X ,D F FS ET K I I , P O I N T T O U P PE R C AS E T A B L EJMP SHORT K 56 OK, TRANS LATE THE CHAR
k 4 6 K E YP A D -R E G IO NTE ST KB-FLAG, NUM-STATk ARE WE I N NUM-LOCK7JN Z K 5 2 ;EST FOR SURE
TEST KB-FLAG, LEFT-SHI ~ + R IHT-SHI F T
------ UPPER CASE, HANDLE SPECI~L CASES
K 4 6 ~ N O T - P R I N T - S C R E E N
K 4 7 , N O T - U P P E R - F U N C T I O N
--_--- KEYPAD K E Y S , MUST TEST NGM LOCK FOR DETERMINATION
T E S T KB-FLAG, LEFT-SHI ~ + R IHT-SHI FT , ARE WE IN SHIFT. S T A T EJ N Z K 5 3 - ; I F S H I F T E D , R E A L L Y NU M S T A T E
. - ---- - E A S E C A S E F O R K E Y P A Dk 4 9 : ; B A S E - C A S E
C M P A L , 7 4 ; S P E C I A L C A S E F O R A C O U P L E O F K E Y SJ E K 5 0 ; M I N U SCMP AL , 7BJ E . K 5 1S UB A L . 7 1 ; C O N V E R T O R I G I NM OV E X , O F F S E T K 1 5 ; B A S E C A S E T A B L EJ M P K 6 4 ; CONVERT TO PSEUDO SCA N
J H P S HO RT K 5 7 ; B U F F E R - F I LL
J M P S HO R T K 5 7 . B UF FE R F I L L
K 5 0 : H O V A X , 7 4 * 2 5 6 + ' - ' ; M I N U S
K 5 1 : M DV A X , 7 8 * 2 5 6 + ' + ' ; P L U S
.- ---- - MIGHT BE NUM LOCK. TEST &IFT STETUSALMOST-NUM-STATE
TEST KB-FLAG, LEFT-SHI;T+RIGHTSHIFT
J N Z K 4 9 , S H I F T E D T E M P O U T O F N U M S T A T E
S U E A L , 7 0 , C O N V E R T O R I G I NM OV E X , O F F S E T K 1 4 , N U M S T A T E T A B L EJ M P S H OR T K 5 6 , TRANSLATE-CHARP L A I N O LD L OW ER C A S E
C M P A L , 5 S , T E S T F O R F U N C T I O N K E Y SJB K 5 5 , NOT-LOWER-FUNCTIONXOR AL , AL , S C A N C OD E I N A H A L R EA D YJ M P S H OR T K 5 7 , B U F F E R - F I LL
H OV E X , O FF S E T K I O , L C T A B L ETRANSLATE THE CHARACTER
D E C A L , C O N V E R T O R I G I N 'X L A T C S K 1 1 C ON VE RT T H E S C AN C OD E T O A S C I I
, REALLY-NUM-STATE
, N O T - S H I F T
, NOT-LOWER-FUNCTION
, TRANSLATE-CHAR
PUT CHARACTER INTO BUFF&
, B U F F E R - F I LC M P A L , - I , I S T H I S A N I G N O RE CH AR "J E K 5 9 , YES, D O N O TH IN G W I T H I TCMP AH, -1 , LOOK FOR -1 PSEUDO SCANJ E K 5 9 N E A R -I N TE R R U PT - RE T U R NHANDLE THE CAPS LOCK PROBLEM
T E S TB U F F E R - F I L L - N O T E S T
K E -FL A G, CA P S -S TA ~E , ARE WE IN CAPS LOCK S T A T E ?J Z K 6 1 , S K I P I F N OTI N C A PS L O CK S T A T ET E S T K8-FLAG,LEFT-SHIFT+RIGHT-SHIFT , T E S T F O R S H I F T
S T A T EJ Z K 6 0
CONVERT ANY UPPER CASE TbC MP A L , ' A 'J B K 6 1CMP AL , ' Z 'J A K 6 1
ADD A L, ' a ' - < A 'J M P S HO RT K 6 1
J M P K 2 6------ CONVERT ANY LOWER CASE T b
K 6 0CHP AL, ' a 'J B K 6 1CMP AL, ' 2 '
J A K 6 1S U B A L, ' a ' - ' A '
I F NO T S H I F T , C O NV ER T L OW E R T OUPPERLOWER CASEF I N D O U T I F A L P H A B E T I CN O T - C A P S S T A T E
N O T - C A P S S T A T E
CONVERT TO LOWER CASENOT-CAPS-STATEN E A R - I N T E R R U P T - R E T U R NI N T E R R U P T - R E T U R NUPPER CASELOWER-TO-UPPERF I N D OU T I F A L P HA B E TI CNOT-CAPS-STATE
NOT-CAPS-STATECONVERT TO UPPER CASE
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 436/605
ee IE o o i c Ree ~3
38 IE O O I A . R
B e ooeoe9 0 0 4 8
E 8 1 4 4 F R
75 I D53
E 8 E 0 3 5 RB D 2 6 0017 R F O
eo 2 6 o o i e R OF
eo 26 o o m R 'Fse
74 oe
Be 0001
e9 0010
58e9 04e9 IE o o i c R
E 9 1 6 4 A RF 6 06 0018 R 0 4
53
E 8 E 0 3 5 R
E 9 1 6 4 A R
IB~E
I B ~ F IO 0086 R1 87 2 2 4 FO1874 e l 04
1 8 7 8 5sl e79 c3
1 B b E 51
1876 D 2 F B
1 8 7 1
I B ~ AIW 5 1
1878 e 1 041 8 7 0 D Z EO
IBBJ eo EI OFm e 6 OA CIl e e s A Z 0 0 8 6 Ri e e e 5si e e c c3i e m
? 8 7 F B A OE 0 0 8 6 R
i e m1 e e D 50i e e E ZB co
1890 E 6 13
1892 E 4 6 1
1 8 9 4 B A EO1 8 9 6 eo € 4 90
1 8 9 8 2 4 02
1899 F 6 DO
1 B 9 D OA C4
1 B 9 F OC 10
1 B A I E 6 6 1
1 B A 5 E 6 20I B A ~ eo 20
1 8 1 7 58
i e A e CF1 B A 9
K 6 1 .
MOV
MOVC A L LCMPJ N EP U S HMOVMOVC A L LAND
AND
ANDPOPJMP
K 6 1 - 1 T E S TJ ZP U S HMOVMOVC A L L
POPK 6 1-2. MOV
MOVJ M P
E X , B UFFE R-TA I L ,
K 4BX, BUFFER-HEAD ,K 6 1-1
s i , e x
exex, oeoHcx , 4 B HKB-NO1 SEKB-FLAG. OFOH ,
KB-FLAG-I , OFH ,
K B-FL A G-2, I F H ;ex
NOT-CA P S -S TA TE
GET THE E ND P OINTE R TO THE B UFFE R
S A V E T H E V A L U EA D VA NC E TH E T A I LHAS THE BUFFER URAPPED AROUND?BUFFER-FULL-BEEPS A V E B U F F E R - T A I LD U R A T I O N O F E R RO R B E E PFRE QUE NCY OF E RROR B E E P H A L F TONEO U T P U T N O I S EC L E AR A L T , C L R L , L E F T A N D R I G H TS H I F T SC L E A R P O T E N T I A L B R E AK O F I N S , C A P S,N U M A N D S C R O L L S H I F T
C L E A R F U N C T I O N S T A T E SR E T R I E V E B U FF E R T A I L
K 2 6 ' RETURN FROM INTERRUPTK B -FLA G- I. C L I CK-bNK 6 1-2 , N b , J U S T PU T I N B U FF E Rex , S AV E B U F F E R T A I L V A L UEex, IH , D U R A T I O N O F C L I C KC X , I O H , F R E Q U E N C Y O F C L I C KKB-NO1 SE , OUTP UT A UDIO FE E DB A CK OF K E Y
ex , R E T R I E V E B U F F E R - T A I L V A L U EC S I 1 , A X , S TORE THE V A L UEB U F F E R - T A I L , B X , MOV E THE P OINTE R UPK 2 6 . I N T E R R U P T R E T U R N
IS A U D I O F E E D B A C K E N A B L E D ?
, STROKE
------ TRANSLATE SCAN FOR PSEUDO SCAN CODE^K 6 3 . T R A N S L A T E - S C A N
K 6 4 , TRANSLATE-SCAN-ORGDsue AL,SS , C O NV ER T O R I G I N T O F U N C T I O N K E Y S
X L A T C S K 9 , C T L T A B L E S C A NMOV AH,AL , P U T V A L UE I N T O A HX O R A L , A L , Z ER O A S C I I C OD EJ M P K 5 7 , P U T I T I N T O T HE B U FF ER
K B - I N 1 E N D P
; ET-POST H I S R O U TI N E U l L L S H I F T T HE V A LU E S TORED I N TH E H I G H N I B B L EO F T H E V A R I A B L E V A R- D EL A Y T O T H E L O U N I B B L E .
NONE I T IS A SS UM ED T H A T D S P O I N T S A T T H E B I O S DA TA A RE A
A L C O N T A I N S T H E S H I F T E D V A L U E .
; N P U T
;OUTPUT
8ET-POS PROC NEARP U S H cx , S A V E S H I F T R E G I S T E RMOV AL ,BY TE PTR VAR-DELAY , GE T S TORA GE L OCA TIONA ND A L ,OFOH , M AS K O F F L O U N I B B L EMOV CL,4 , S H I F T O F FO UR B I T P O S I T I O N SS A R A L , C L , S H I F T T H E V A LU E S I G N E XT E N D EDPOP cx , RE S TORE THE V A L UER E T
GET-POS ENDP..................................................................
, UT-POST H I S R O U TI N E U l L L T AK E T HE V AL UE I N L O U ORD ER N I B B L E I NA L A N D S T O R E I T I N T HE H I G H O RD ER O F V AR -D EL AY
, N P U TA L C O N T A I N S T H E V A L U E F O R S T O R A G E
,OUTPUTNONE
6UT-POS PROC NEAR
..................................................................
P US H CX , S A V E R E G I S T E RM O V C L , 4 , S H I F T C O U N TS H L A L , C L , P U T I N H I G H O RDER N I B B L EMOV CL ,BY TE PTR VAR-DELAY , G E T D A T A B Y T E
A N D C L , O F H , C L EA R O LD V AL U E I N HIGH N I B B L EOR AL , CL , C O M B I N E HIGH AN D L O U N I B B L E SM OV B Y T E P T R V AR -D EL AY A L P U T I N P O S I T I O N
R E TPOP c x , ~ E S T ~ R EEGISTER
PUT-PO5 ENDP
, M A N UF A CT U RI NG A C T I V I T Y S I G N A L R O U T I N E - INV OK E D THROUGH THE T IME R, T I C K R O U T I N E D U R I N G M A N U F AC T R U IN G A C T I V I T I E S ( A C CE S S ED T HR OU GH, I N 1 I C H )
___________-____________________________----------
________________________________________----------MFG-TI CK
PUSHsue
OUTI N
MOVAND
NOTAND
OR
OROUTMOVOUTPOPI R E 1
MFG-T I CK
PROC FARAXAX, AX
I J H , A LAL , PORT-B
A H, A LAH, iooiiioie ,
AL, oooooo ioe ,AL
AL, AH
AL, ooo i ooooe ,PORT-6, ALA L , 20H
ZOH, A LAX
ENDP
SEND A 00 TO PORT 13 A S AA C T I V I T Y S I G N A L
F L I P SP EA KE R D A T A T O O P P O S IT ES E N S E
S A V E O R I G S E T T I N GMAKE SURE MUX IS - > R I G H T A N DI S O L A T E SP E AK ER B I TFLIP ALL e l i sISOLATE SPEAKER D A T A B I T (NOU IN
O P P O S I T E S E N S E )C O M B IN E U l T H O R I G . D A T A FR OMPORT BAN D D I S A B L E I N T E R N A L S PE A K ER
E O 1 TO I N T R . C H I P
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 437/605
I B A ~I B A ~ so1 B A A E l 0 41BAC 0 2 E E1 BA E E 8 1 8 8 4 R
1 8 8 2 2 4 OFl e e t SE
I B E ~1 8 8 4 04 90
IBE~ 2 7
m a 7 14 40
ma9 2 7
m e a a 4 OE
I B E AI E E A 53
l B BD E 7 00l B 8 F C D 10l B C l 58
l a c 2 c 3l a c 3l a c 3I E C 3
l a c 3
lace 74 0 1
I E C 3 2 8 D 2I B CS F 6 C S 0 4
1 BC A 4 2
I E C B OA E 4I B C D 7 4 4 1I B C F F E CCl B D l 7 4 I D
IBDS 7 5 161803 FE cc
I B D ~ soIEDE a 4 03
1 B D A CD 1 41 8 D C EB 1 9 2 5 R
I B D F 58
l a E O OA F 6
1 E E 4 # A E 6IBE~ 7 4 0 7
I B E ~ eo € 4 FE
1 a ~ 9 EE 0 21 B E B E 4 90
I E E D E 9 F OO D R
I B F O BE F 2I B F 2 A 0 0 0 7 8 R1 E F 5 0 4 OAI B F 7 EB E 4 0 0 7C RI E F B 501 8 F C E O 87
I B F E 2 A E 41900 CD 1 41 9 0 2 E 8 1 9 2 5 R
190s 58
1906 8 A E 61 9 0 8 OA E 4
1 9 0 A 7 4 E l1 9 0 C E 4 A B1 9 0 E E E DO
AL MUST CONTAI N NUMBER TO BE CONVERTEDA X AND ax DE S TRO Y E O_ _ _ - - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ - - - - - _ _ _ _ - - - _ - - - - - _ - _ _ _ _ - - _ - _ - _
~ P C - B Y T EP U S HMOVSHRC A L LPOPAND
XLAT-PR PROCADDDAA
ADC
DAAPRT-HEX PROC
P U S HMOVMOVI NTPOPR E T
PRT-HEX ENOPXLAT-PR ENDP
PROC NEARAXCL. 4A L . C LXLAT-PRAXA L , O F H
NEARA L , 0 9 0 H
A L , 0 4 0 H
NEAR
A H, 1 4BH. 0
I O HE X
ax
S A VE FO R L O U N I B B L E D I S P L A YS H I F T C O U N TN I B B L E S U A PD O THE HIGH N I B B L E D I S P L A YR E C O V E R T H E N I E B L EI S O L A T E T O L O U N I B B L EF A L L I N T O L O U N I E E L E C O N VE R SI ONC O NV ER T 0 0 - O F T O A S C I I C H A R A C TE RA DD F I R S T C O N V E R S I O N F A C T ORADJUST FOR NUMERI C AND ALPHARANGEADO CO NVERSI ON AND ADJUST LOUN I E E L EA D J U S T HIGH N I B B L E T O A S C I I R AN GE
D I S P L A Y C HA RA CT ER I N A L
C A L L V I D E O - I O
x P c-iiv T E
,CONTROL IS P A S S E D H E R E U H E N T H E R E A R E N O P A R A L L E L P R I N T E R S, A TT A C H E D C X H A S E P U I P M E N T F L A G ,D S P O I N T S A T D AT A ( 4 0 H O, D E T E R M I N E U H I C H R S 2 3 2 C AR D ( 0 , l ) TO USER E P R I N T P R O C N E A REl -A SUE DX, DX , ASSUME TO USE CARD 0
ENDP
T E S T C H . 0 0 0 0 0 1 0 0 E , U N L E S S T H ER E A RE T U 0 C A RD SJ E E10-1 , I N U H I C H C AS E,I NC OX , USE CARD I
, O E T E R M IN E U H I C H F U N C T I O N IS B E I N G C A L L E D810-1 OR AH,AH ,T ES T FOR AH = 0
JZ a12 , GO P R I N T C H A RDEC AH , TE ST FOR AH = 1
J Z 811 ,GO D O I N l TDEC AH , TE ST FOR AH 2J N Z S H OR T 8 1 0 - 3 ,IF N O T V A L I D , R E T U RN
,E L S E, G E T S T A T U S FR O M R S 2 3 2 PO R T
P U S H A X . S A V E A LMOV AH .03 H ,US E THE GET COMMO PORT
I N T 0 1 4 H , ST A T U S F U NC T IO N OF I N T I 4C A L L F A K E , F A K E U l L L M A P ER R OR B I T S F RO M
, RS232 TO CORRESPONDI NG ONES, O R T H E P R I N T E R
POP AX , RESTOR E ALOR D H . O H , C H EC K I F A NY F L A G S U ER E S ETJ Z 8 1 0 - 2MOV AH, DH , MOVE FAK E0 ERROR CO ND I TI O N TO AHAND AH,OFEHJMP SHORT 810-3 ,THEN RETURN
e i o - 2 MOV A H . O ~ O H , M OV E I N S T A T U S F OR ' C O R R E C T '
8 1 0 -3 J MP E 1, I N I T COMMO P O R T --- D X H A S U H I C H C AR D T O I N I T, M OV E T I M E O UT V A L U E F RO M P R I N T E R T O R S 2 3 2 T I M E O UT V A L U EE l l MOV S I . D X .SI G E T S O F F S E T I N T O T H E T A B L E
, RETURN
MOVADOMOVP U S HMOV
SUEI N TC A L L
POPMOVOR
J EMOVJMP
AL; PR NT-TI M-OUT'AL, OAH , I N C R E A S E D E L A YR S 2 3 2 - T l M - O U T C S I 1 , A LA X , S A V E A LAL, O B ~ H , S E T I N I T F OR 1 2 0 0 B AU D
8 B I T URD L N GN O P A R I T Y2 ST OP B I T S
AH, AH , AH=O IS COMMO I N I T F U N C T I O N0 1 4 H , 0 0 l N l TF A K E , F A K E W I L L M AP E RR OR B I T S F RO M
, R S 2 3 2 TO CORRESPONDING ONES,F O R T H E P R I N T E R
A X , R E S T O R E A LAH, D H ,IF DH IS RETURNED ZERO, MEAN I NGA H, A H , N O E R RO R S R E T U RN I T F O R T H A T ' S T H E
, ' COR REC T' RETURN FROM AN ERROR, F RE E I N I T
E 10-3AH, OA8HS H OR T 8 1 0 - 3 , T H E N R E T U RN
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 438/605
1910 so1911 84 011913 CD 141915 E B 1925 R
I s l e 58
1919 OA F61918 74 04
1910 B A E 619IF E B C C1921 84 10
1923 E B C B192s
19251921 32 F61927 F6 C 4 1 E
1 9 2 A 74 03
1 9 2 C 86 OB
192E C 3l92F F6 C 4 BO1932 74 021934 BO 091976 C 3
1937
1977
1977 3 C 0 1
1939 74 101938 3 C IO1 9 3 D 74 06193F E B E D l B R
1942 CD 091944 C F19451945 BO OE 0017 R 041 9 4 A C F19481948 F6 06 0017 R 0419so 74 29
195219571958
1959I 9 S A1 9 5 B19sc19SF1962196619671968
1 9 6 A
C 6 06 0017 R 00
I E07I EOEI FBE 1903 RB F O O l E R89 OOOF 90
ACA BE 2 F CI F
1968 C 7 06 O O I A R O O l E R1971 C 7 06 O O l C R 0 0 3 C R
1977 E 8 E O l B R1 9 7 A C F19781978 E B E O l B RI 9 7 E 89 20001981 F F E l
19831983 4 C 4F 4 1 4 4 20 22
43 4 1 53 31 3 A 22
2 c 521991 OD= OOOF1 9 9 2
, P R I N T C HA R TO S E R I A L P O R T
,DX = R S 2 3 2 CARD TO B E USE D A L HA S CHAR TO BE P R I N T E D
812 P U S H A X , S A V E A LM O V A H , O l , I IS S E ND A CHA R DOUN COMMO L I N EI N 1 014H .SEND THE CHARC A L L F A K E , F A K E U I L L M AP ER RO R B I T S FR OM
, R S 2 3 2 T O C O R R E S P O N D IN G O N E S, O R T H E P R I N T E R
P OP A X ,RE S TORE A LOR DH,DH ,S E E I F NO E RRORS UE RE RE TURNE DJ Z 812-1MOV A H,DH , I F THE RE UE RE E RRORS , RE TURN THE MJMP SHORT 810-3 , A N D R E T U R N
812-1 M OV A H , O l O H , P U T ' C OR R E C T' R E T U R N S T A T U S I N A H
JMP SHORT 810-3 , A N D R E T U R NR E P R I N T E N O P
, T O TH OSE ' L I K E T H A T ' O F A N I N T I 7 C A L L, B R E A K , F R A M I N G , P A R I T V . O V E R R U N ERRORS ARE LOGGED AS 110
,E RRORS A ND A T I M E OUT IS M OV ED TO T HE A P P R O P I A T E B I TFA K E P ROC NE A R
,THIS PROC MAPS THE ERRORS RETURNED FROM A B I O S NTM CALL
XOR D H . D H , C L E A R F A K E D S T A T U S F L A G ST E S T A H . O l I I 1 O B , C HE C K F O R B R E A K . F R A M I N G , P A R I T Y
, VERRUNJ Z 813-1 , ER R O R S I F N O T T H E N C HE CK FO R
, T I M E O U TMOV DH, O l O O O B , SE T B I T 3 T O I N D I C A T E ' I 1 0 E R R O R 'R E T , A N D R E T U R N
J Z 813-2 . I F N O T T I M E OU T, R E T U R NMOV DH.0 9 H , I F T I M E O U T
813-1 TE S T A H,OBOH ,TE S T FOR T I M E OUT E RROR RE TURNE D
813-2 R E T
F A K E E N D P
,NE Y - I L IT9. . . . . . . . . . . . .. . . . . . . . . . . . .. . . . . . . . . . . . .. . . . . . . . . . . . . .. . . . . . . . . . . . .
T H I S R O U T I N E IS T H E I N T E R R U P T 9 H A N D L E R U H E N T H E M A C H I N E ISF I R S T P O U ER ED O N AN D C A S S E T T E B A S I C IS G I V E N C ON TR OL I THA NDL E S THE F IRS T K E Y S TROK E S E NTE RE D FROM THE K E Y B OA RD A NDPERFORMS "SPEC I A L " A C T I O N S A S F O L L O U S
I F E S C IS T H E F I R S T K E Y E N E TE R E D M I N I - U E L C D M E ISE X E C U T E D
E X E CU T E D G I V I N G T H E U S E R TH E A B I L I T Y T O BO OTF R O M C A S S E T T E
IF CTRL-ESC I S TH E FIRST SEQU ENCE "LOAD CAS ,R" IS
A FTE R T HE S E K E Y S TROK E S OR A FTE R A NY OTHE R K E Y S TROK E S THEI N T E R R U P T 9 VECTOR 15 C HA NC ED T O P O I N T A T T H E R E A LI N T E R R U P T 9 R O U T I N E
..................................................................LEU-INT-S PROC FAR
CMP AL, 1 , IS T H I S A N E S CA P E K E Y 7
J E ESC-KEY , JUMP I F A L Z E S C A P E K E YC M P A L . 2 9 , E L S E , IS T H I S A C O N T R O L K EY 'J E C T R L K E Y J UM P I F A L =CONTROL K E YCALL REAL~VECTOR-SET& , OTHERUISE, INTALZE REAL. I N 1 9 VECTORI N 1 9 HI R E T
OR K B -FL A G, 0 4 HI R E T
T E S T K B -F L AG , 0 4 HJ E E S C-ONL Y
;CONTROL E S CA P E HA S OCCURED, P U l, L O A D
MOV KB-FLAG, 0P U S H D SP O P ES
P U S H D SP U S H C SP O P D S
CTRL-KEY.
ESC-KEY:
P A S S T H E S CA N CO DE I N A LRETURN T O INTERRUPT 4 8 ~
T U RN O N C T R L S H I F T I N K B- FL AGR E T U R N T O I N T E R R U P T
H A S C O N T R O L S H I F T O C C U R E D ?NO. E S CA P E ONL Y
M E SS AC E I N B U F FE R F O R C A S S E T T E
ZE RO OUT CONTROL S TA TE
I N I T I A L I Z E E S F OR BIOS D A T AS A V E OL D DSP O I N T D S A T C O DE S E G M EN T
MOV S1 ,OF FS ET CAS-LOAD , GET MESSAGEM OV D I , O F F S E T K B -B U F FE R P O I N T A T K E VB O A RD B U F F E RMOV CX,CAS-LENGTH . LELGTH F CASSETTE MESSACE
T L O O P L O DS B , G E T A S C I I C H A RA C T ER F R O M M E S SA G ESTOSU , P U T I N K EY BO A RD B U F F E R
P OP D S R E T R I E V E B I O S DATA SEGMENT------ I N I T I A L I Z E Q UE UE SO M E S S k E U l L L B E R EM OVED F ROM B UF FE R
MOV BUF FER-H EA0,O FFSE T KB-BUFFERM O V B U F F E R - T A I L , O F F S E T KB-BUFFER*CCAS-LENCTHWZ)
LOOP 1-LOOP
.................................................................., *WNOTEW**
I T IS A S SUMED THA T THE L E N GTH OF THE CA S S E T TE ME S S A GE ISL E S S T H A N OR E Q U A L TO T H E L E N G T H OF T H E B U F F E R I F T H I S ISN O T T H E C A S E T H E B U F F E R U I L L E V E N T U A L L Y C ON SU M E M EM O RY
CA L L RE A L -V E CTOR-S E TUPI R E T
CA L L RE A L -V E CTOR-S E TUPM O V C X , M I N IJMP CX ENT ER THE UDRLD OF KEYBOARD CAPER
K E Y S E QUE NCE~ A S - L O A D L A B E L B Y T E
D B ' LO A D " C A S 1 s o , R '
..................................................................
ESC-ONLY
------ MESSAGE FOR OUTPUT UHEN ~ O N T R O L - E S C A P E IS ENTERED A S FIRST
D B 13CA S -L E NGTH E QU I - C A S L D A DNEU-I NT-9 ENDP
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 440/605
I A O CI A O C 9 Cl A O D 53I A O E F Al A O FI A O F 83 01
l A l l EB FF31 R
1 A 1 4 E 2 F El A 1 6 F E CA1 A 1 B 75 F51 A l A E 2 F El A 1 C E 2 F El A 1 E 5El A l F 901 A 2 0 C 31 A 2 1
E O 0 0
EO00 31 35 30 34 30 3337 20 43 4F 50 5 22 E 2 0 49 42 40 2 031 39 3 B 31 2 C 3139 38 33
EO IBEO leEO 1cEO1 0EO 1E
E 0 2 0E 0 2 2E O 2 5
E 0 2 AE 0 2 8E 0 2 C
E 0 2 0E 0 2 EE O 3 1
E 0 3 2E 0 3 3E034E 0 3 5
50
530633 co
BE COBE 0 0 2 426: C 7 07 1561 R
4 34 3OE
58
2 6 : 89 07075858c3
E 0 3 5EO35 F BE 0 3 6 50E 0 3 7 53EO38 5 1
E O 3 9 E 4 6 1
E O J B 50E 0 3 CE 0 3 C 24 F C
E03E E6 6 1E 0 4 0 5 1
E 0 4 1 E 2 F EE 0 4 3 OC 0 2
E 0 4 5 E6 6 1E 0 4 7 59
E 0 4 8 5 1E049 E2 FEE 0 4 E 48E 0 4 C 59E 0 4 0 75 EDE 0 4 F 5 8E O 5 0 E 6 6 1
E O 5 2 59E 0 5 3 58E 0 5 4 58E 0 5 5 C 3E056E O 5 BEO5E E 9 0043 R
T H I S PR OC ED UR E U I L L I S S U E SHORT T ON ES TO I N D I C A T E F A I L U R E S
T H A T I : OCCUR B E FORE THE CRT IS S T A R T E D , 2: TO C A L L T H EOP E RA TORS A T TE NT ION TO A N ERROR A T THE E ND OF P OS T, OR3: T O S I G N A L T H E S U C C E S S FU L C O M P L E T I O N O F P O S T
D L = NUMBE R OF A P P ROX . 1 1 2 SE C TONE S TO S OUND; E N T R Y P A R A M E T E R S :
ERRJEEP PROCP U S H FP U S HC L I
MOVC A L L
64: L OOPDE CJ N Z
G 3 :
G 5 : L O O PG 6 : L O O P
P O PP O P FRET
ERR-EEEPL I S T
ASSUME
NE A R
E X
E L . 1B E E P
G 4D LG 365
G 6B X
E NDP
CS : CODE. 05: D A T A
S A V E F L A G S
D I S A B L E S Y ST E M I N T E R R U P T SSHORT-BEEP:COUNTE R FOR A S HORT B E E PDO THE SOUND
D E L A Y B E T U E E N B E E P SD ON E U I T H S H O R TSDO SOME MOREL O N G D E L A Y B E F O R E R E T U R N
R E S T O R E O R I G C O N T E N T S O F E XR E ST O RE F L A G S T O O R I G S E T T I N G SR E T U R N T O C A L L E R
ORG OEOOOHD E '1504037 C O P R . I B M 1981, 1983' ; C O P Y R I G H T N O T I C E
.................................................................., EAL-VECTOR-SETUP -
T H I S R O U TI NE U I L L I N I T I A L I Z E TH E IN T ER R UP T 9 VECTOR TOP O I N T A T T HE R E A L I N T E R R U P T R O U T I N E
..................................................................kA L -V E CTO R-S E TUP P ROC NE 4 R
PUSH, AX , S A V E THE S C A N CODEP U S H E XP U S H E SXOR AX,AX , I N I T I A L I Z E TO P O I N T A T VECTOR
MOV ES,AXMOV BX,SH*4H , P O I N T AT I N T E R R U P T 9MOV UORD PT R ES C B X 3 , O F F S E T K B - I N 1 , M OV E I N O FF S E T O F
, R O U T I N EI N C E X , ADD 2 TO E XI N C E XP U S H C S , GE T CODE SE GMENT OF B I O S (S E GME NT
P OP A XMOV UORO PTR ES CBX1,AX , M O VE I N S E G ME NT O F R O U T I N EPOP ESP O P E XPOP AXR E T
, S E C T O R ( 0 )
,R E L O C A T E A B L E I
RE A L -V E CTOR-S E TUP E NDP
,KE-NO I SE
..................................................................
T H I S R O U T I N E IS C A L L E D U H E N G E N ER A L B E E P S A R E R E Q U I R E D F RO MT H E S Y S T E M
, N P U TBX=LENGH OF THE TONECX =CONTA INS THE FRE QUE NCY
A L L R E G I S T E R S A R E M A I N T A I N E D
A S C X G E T S L A R G E R T HE T O N E PR O DU C ED G E T S L O U E R I N P I T C H
,O U T P U T
, I N T S
..................................................................KB-NO I SE
S T I
P U S HP U S HI NP U S H
AND
OUT
P u s n
L O O P O l
P u s nL O O P 0 2 : L O O P
OROUTP O P
P u s nL O O P 0 3 : L O O P
DE CPOPJ N ZPOPOUTPOPPOPPOPR E T
ORGJ M P
KB-NO1 SE
PROC NEAR
AXE XcxAL, 06 I H
AX
AL, OFCH
06 H A Lc xL O O P 0 2A L , 2
06 lH,A Lcx
cxL O O P 0 3E X
L O O P 01AX06 lH,A Lcx
c x
E XA X
E NDPo E o s B nNE A R P TR RE S E T
G E T C O N T R O L I N F OS A V E
T U R N O F F T I M E R G A T ED A T AOUTPUT TO CONTROLH A L F C Y C L E T I M E F O RS P E A K E R O F FT U RN ON S P E AK E R B I T0UTPll.T TO CON TROL
A ND S P E A K E R
TONE
R E T R I E V E F R E Q U E N C YA N OT H ER H A L F C Y C L ET O T A L T I M E C O U N TR E T R I E V E F R E Q .D O ANOTHER CYCLERECOVER CONTROLOUTP UT THE CONTROL
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 441/605
E O S EEOSE 78 cc co cc 78 I8
E 0 6 6 00 C C 00 CC CC CC
E 0 6 E I C 00 7 8 C C F C C O
E 0 7 6 7 E C 3 3 C 06 3 E 66
E 0 7 E C C 00 78 O C 7 C C C
E 0 8 6 EO 00 78 O C 7 C C C
EO8E 30 30 7 8 OC 7 C C C
E 0 9 6 00 00 78 C O CO 7 8
E 0 9 E 7 E C 3 3 C 66 7 E 60
E O A 6 C C 00 7 8 C C F C C O
E O A E EO 00 7 8 C C F C CO
E 0 8 6 C C 00 7 0 30 30 3 0
E OB E 7 C C 6 3 8 18 18 I 8
E O C 6 EO 00 70 30 3 0 30
E O C E C 6 38 6 C C 6 F E C 6
E O D 6 30 30 00 7 8 CC F C
oc 78
7 E 00
7 8 00
3F 00
7 E 00
7 E DO
7 E 00
oc 38
3c 00
7 8 00
7 8 00
7 8 OD
3 c 00
7 8 00
C 6 00
cc 00
E O D E IC 00 FC 60 7 a 60F C 00
7 F 00
C E 00
7 8 00
7 8 00
E O E 6 00 00 7 F O C 7 F C C
EOEE 3 E 6 C C C F E C C CC
E O F 6 7 8 CC 00 7 8 C C C C
E O F E 00 CC 00 7 8 CC C C
E 1 0 6 00 EO 00 7 8 C C C C7 8 00
7 E 00
7 E 00
E l O E 78 C C 00 CC CC CC
E 1 1 6 00 E O 00 CC CC CC
E l l E 00 C C 00 C C C C 7 C
E 1 2 6 C 3 I E 3 C 66 66 3 C
E 1 2 E C C 00 CC CC CC CC
E 1 3 6 18 18 7 E C O CO 7 E
E 1 3 E 3 8 6 C 6 4 F O 60 E 6
E 1 4 6 C C CC 7 8 F C 3 0 F C
E 1 4 E F8 CC C C F A C 6 C F
E 1 5 6 OE I B 18 3 C 18 18
OC F8
18 00
7 8 00
18 18
F C 00
3 0 30
C 6 C 7
D 8 7 0
E 1 5 E I C 00 7 8 OC 7 C C C
E 1 6 6 38 00 70 30 3 0 3 0
E 1 6 E 00 I C 00 7 8 C C C C
7 E 00
78 00
78 00
7 E 00
E 1 7 6 00 I C 00 CC CC CC
E 1 7 E
E 186
E I B E
E 196
E 1 9 E
E A 6
E I A E
E 186
E 1 8 E
E I C 6
E I C E
E 1 D 6
00 F8 00 F8 CC CC
c c 00
F C 00 C C E C F C D C
c c 00
3 C 6 C 6 C 3 E 00 7 E00 00
3 8 6 C 6 C 3 8 00 7 C
00 00
3 0 00 30 60 CO CC7 8 00
00 00 00 F C C O CO
00 00
00 00 00 F C O C O C
00 00
C 3 C 6 CC D E 3 3 66
C C O F
C 3 C 6 CC DE 3 7 6 F
C F 0 3I 8 18 00 18 I8 18
18 0000 3 3 6 6 CC 66 3 3
00 0000 CC 66 3 3 6 6 CC
00 00
D 8
DB
DB
DB
D 8
DB
DB
DB
D 8
D 8
D 8
D 8
D 8
DB
DB
D 8
L A B E L B Y T E07811, occn, O C O H , o c a . 0 7 8 ~ . I a n , O O C H , 0 7 8 ~
ooon, OCCH, ooon, OCCH. O C C H , OCCH, O ~ E H , O O H
, D-80
, D-B I
O I C H , 0 0 0 H . 0 7 8 H . O C CH , O F C H , O CO H, 0 7 8 H , O O O H , D - 8 2
O ~ E H , CJ H, O ~ C H . O O ~ H , J E H , O ~ ~ H , ~ F H , O O O H , ~ - 8 3
OCCH, ooon, 0 7 8 1 4 , oocn, 0 7 ~ ~ .ccn , O ~ E H , oon , D - 8 4
~ E ~ ~ , o o o H ,7 8 ~ . OCH, O ~ C H , CCH, O ~ E H , OOH , 0-85
0 3 0 H . 0 3 O H , 0 7 8 H , O O C H , 0 7 C H , O C C H , 0 7 E H ,O O O H , D - 8 6
OOOH, o o o n , o 7 8 ~ , con, OCOH, O ~ B H , ~ ~ ~ H , O ~ B HD - 8 7
O ~ E H , C ~ H , ~ C H , m i , O ~ E H , ~ O H , ~ C H , oon , 0-88
occn, ooon, 07811, O C C H , O F C H , o c o n . 0 7 8 n . 0 0 0 ~ , D-89
O E O H , ~ O ~ H ,7 8 ~ . ccn , OFCH, O C O H , O ~ ~ H ,oon , o - 8 ~
occn, ooon, O ~ O H , O ~ O H ,3 o n , 0 3 o n , 0 7 8 n , OOOH , D - ~ E
O ~ C H , C ~ H , 3 8 ~ . IBH, O I ~ H , mi, ~ C H , OOH , DJC
O EO H , 000H. 0 7 0 H . O J OH , 0 3 0 H , OJ O H , 0 7 8 H , O O O H , D-80
O C 6 H , O J B H , 0 6 C H , O C 6 H , O FE H , O C 6 H . O C 6 H , O O O H , D-8E
03011,O ~ O H , OOH, O ~ B H , C C H , O FC H ,O C C H , O O O H , D - ~ F
0 I C H , O O O H , O FC H, 0 6 0 H , 0 7 8 H , 0 6 0 H , O FC H, O O O H , 0-90
0001.1, OOH, O ~ F H , OCH, O ~ F H , CCH, O ~ F H , oon , D-9 I
O J EH, O ~ C H , CCH, OFEH, OCCH, occn, OC EH , OOOH , 0 - 9 2
0 7 8 H , O C C H , 0 0 0 H . 0 7 8 H . O C C H, OC C H, 0 7 8 H . O O O H , D-93
O OO H, OC CH , O O O H, O ~ E I H , CC H, O C CH , 0 7 8 ~ . O O H , D - 9 4
0001.1, E O H . OOOH, 0 7 8 ~ . C C H , o c c n , o 7 8 ~ , OOH , D-95
0 7 8 ~ . C C H , O O O H , occn , O C C H , occn , O ~ E H . OOH , D-96
OOOH, OEOH, OOOH, O C C H , O C C H , O C C H , o 7 ~ n . 0 0 0 ~ D-97
O O O H , OCCH, O O O H , O C C H , O C C H , 0 7 C H , O O C H , O F 8 H , 0-98
O C3 H, O I B H , O J C H , 0 6 6 H , 0 6 6 H , 0 3 C H , O I B H , O O O H , D-99
O C C H , OOOH, OCCH, o c c n ,o c c n , O C C H , O ~ B H ,oon , 0 - 9 A
o IBH, omi, XH , ocon, OCOH, O ~ E H , m n , o IEIH , D-98
0 3 8 H , 0 6 C H . 0 6 4 H , O FO H, 0 6 0 H , O E 6 H , O F CH ,O O OH , 0-9C
o c c n , ~ ~ ~ ~ ,7 8 ~ . F C H , O ~ O H , F C H , O ~ O H , 3 0 n , D-9D
O F B H , O C C H , O C C H , O F A H , O C 6 H , O C F H , O C 6 H , O C 7 H , D-9E
OOEH, omi, mi, ~ C H , i e n , OIBH, oD8n, O ~ O H , D - ~ F
o mi, OOOH. 0 7 8 ~ . O CH, O ~ C H , ccn, OXH, ooon , D-AO
0 3 8 H . O O O H , 0 7 0 H . O J OH , 0 3 0 H , 0 3 0 H , 0 7 8 H , O O O H , 0 - A I
OOOH, O I C H , OOOH, 0 7 8 H , O C CH , O C C H, 0 7 8 H , O O O H , D-A2
OOOH, 0 I C H , O O O H , O C C H , O C C H, O C C H , 0 7 EH , O O OH , 0-A3
OOOH, OFB H, OOOH, OFB H,OCC H, OCCH, OCCH, O O O H , 0-A4
O F C H , OOOH, OCCH, OECH, OFCH, ODCH, OCCH, O O O H , 0-AS
0 3 C H . 0 6 C H . 0 6 C H . 0 3 E H , O O O H , 0 7 E H , OOOH, O O O H , D-A6
0 3 8 H , 0 6 C H , 0 6 C H . O 3 8 H , O O O H , 0 7 C H , OOOH, OOOH , 0-A7
0 3 0 ~ . OOH, O J O H , O ~ O H , c o n ,
occn,0 7 8 ~ .
oon ,D-AB
OOOH, OOOH, ooon, OFCH, ocon, ocon,ooon, ooon , D-AS
ooon, ooon, OOOH, O F C H , ~ O ~ H ,ocn, OOOH, O O O H , D-AA
O C 3 H . O C 6 H . O C C H, O D E H , 0 3 3 H , 0 6 6 H , O C C H, O O FH , D-AB
O C ~ H , C ~ H , CCH, ODBH, 0 3 7 ~ . ~ F H , w n , 003n , D-AC
O IE IH ,018H ,000H ,018H ,O l8H ,O l8H ,O l8H ,O O O H , 0-AD
ooon, 0 3 3 ~ . 6 6 ~ .ccn, 0 6 6 ~ . ~ H ,oon ,ooon , 0-AE
O O O H , O C CH , 0 6 6 H , O 3 3 H , 0 6 6 H , O C CH , OOOH, OOOH , D-AF
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 442/605
E l DE 2 2 BB 2 2 88 2 2 BB
E X 6 5 5 AA 5 5 AA 5 5 AA
ElEE DB 77 DB EE DB 7 7
22 88
5 5 AA
DB EE
€ 1 ~ 6 18 18 l e i e i e i e
EIFE i e l e i e i e F e 18
€206 18 18 FB i e F e i e
18 i e
i e ia
18 18
E2OE
E2 I 6
E 2 l E
E226
E22E
E236
E23E
E246
E24E
E256
36 36 36 36 F6 36
36 36
00 00 00 00 FE 3636 36
18 1836 36 F6 06 F6 36
36 36
36 36 36 36 36 36
3 6 3 6
00 00 FE 06 F6 36
36 36
3 6 3 6 F6 0 6 FE 00
00 00
36 36 36 36 FE 00
00 00
18 18 FB 18 FB 00
00 00
00 00 FB 18 FB i e
00 00 00 00 FB l ei e 18
E ~ S E ie i e i e i e IF 00
€266 i a i e i e i e FF 00
00 00
00 00
h26E 00 00 00 00 FF 1818 i e
€276 i e i e i e i a IF 18
18 18
00 00
18 18
l e 18
36 36
00 00
36 36
00 00
36 36
36 36
00 00
36 36
00 00
E27E 00 00 00 00 FF 00
€286 l e i e i e l e FF l e
EPEE 18 18 IF i e IF i e
E296 36 36 36 36 37 36
E29E 36 36 37 30 3F 00
E2A6 00 00 3F 30 3 7 36
E2AE 36 36 F 7 00 FF 00
E286 00 00 FF 00 F 7 3 6
E2BE 36 36 3 7 30 3 7 36
E2C6 00 00 FF 00 FF 00
E2CE 36 36 F7 00 F 7 36
E2D6 18 18 FF 00 FF 00
E2DE 36 36 36 36 FF 00
00 00
€ 2 ~ 6 00 00 FF 00 FF i eis i eEPEE 00 00 00 00 FF 36
E2F6 36 36 36 36 3F 00
E2FE 18 18 I F 18 1F 00
36 36
00 00
00 00
€306 00 00 IF i e IF 18i e 18
E30E 00 00 00 00 3F 36
E316 36 36 36 36 FF 3 6
3 6 3 6
36 36
~ 3 1 ~e i e FF 18 FF 18
~ 3 2 6 18 18 i e i e F e 00
€ 3 2 ~ 00 00 00 00 IF i e
i e i e
00 00
i e 18E336 FF FF FF FF FF FF
E37E 00 00 00 00 FF FF
E346 FO FO FO F O FO FO
E34E OF OF OF W OF OF
E356 FF FF FF FF 00 00
FF FF
FF f f
FO FO
OF OF
00 00
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
DB
De
DB
DB
DB
DB
DO
DB
DB
DB
DB
DO
DB
DB
DB
DB
De
022H, OBBH, O22H, OBBH, 022H, OBBH, O22H, OBBH
055H. OAAH, 055H. OAAH, 0S5H. OAAH, 055H. OA&H
ODBH, 077H, ODBH, OEEH, ODBH, 077H, ODBH, OEEH
o i e n . OIBH, o i e w , aim,o i w , o i w , o i e H , o i e H
O I B H , O I B H , OlBH, O I B H , OFBH, OIBH, OIBH, O l B H
O I B H . 01BH,OF8H. OiBH,OFBH, 01BH,018H,O lBH
036H. O36H. O36H. O36H, OF6H, O36H, O36H, O36H
000H. OOOH, OOOH, OOOH, OFEH, 036H, 036H. 036H
OOOH, 000H. OFBH, OIBH, OFBH, OIBH, OIBH, 018H
0 3 6 ~ . 3 6 ~ . F ~ H ,0611, O F ~ H , 3 6 ~ . 3 6 ~ . 3 6 ~
036H. 036H. 036H. 036H. 036H. 036H. 036H, 036H
OOOH, OOOH, OFEH, 006H, OF6H, 036H, 036H. 036H
036H, 036H, OFBH, 006H, OFEH, 000H. 000H. OOOH
0 3 6 ~ . XH, 0 3 6 ~ . 3 6 ~ . FEH, OOOH, ooon, ooon
OIBH, O I B H , OFBH, O I B H , OFBH, OOOH, OOOH, OOOH
OOOH, OOOH, 000H. OOOH, OFBH, O l B H , O I B H , 0 1 8 M
OIBH, OlBH. O I B H , O l B H , OIFH, OOOH, OOOH, OOOH
o i w , O ~ H ,i e n , OIBH, OFFH, OOOH, OOOH, OOOH
OOOH. OOOH, OOOH, OOOH, OFFH, o i m , aim,o i w
OIBH, 018H. OIBH, OIBH. OIFH, O I B H , OlB H, OlBH
OOOH, OOOH, OOOH, OOOH, OFFH, OOOH. ooon, ooon
OIBH, OIBH, O l B H , OIBH, OFFH, OIBH, OIBH, 018H
OIBH, OIBH, OIFH, O I B H , OIFH, 018H. O I B H , OlBH
036H, 036H. 036H. 036H. 037H,036H, 036H. 036H
036H, 036H. O37H. OJOH, 03FH. 000H. 000H. OOOH
OOOH, OOOH, OJFH, 030H, 037H, 036H, 036H, 036H
036H. 036H. OF7H. 000H. OFFH, 000H. OOOH, OOOH
OOOH, OOOH, OFFH, OOOH, OF^, O J ~ H , 3 6 ~ . 3 6 ~
O36H, O36H, 037H, 030H, 037H, 036H. 036H, 036H
OOOH, ooon, OFFH, OOOH, OFFH, ooon, OOOH, OOOH
036H. 036H. OF7H. 000H. OF7H. 036H. O36H. O36H
aim,o i w , OFFH, OOOH, OFFH. OOOH, OOOH, OOOH
0 3 6 ~ . ~ ~ H , O J ~ H ,XH, OFFH, ooon, OOOH, OOOH
000H. OOOH, OFFH, 000H. OFFH, O I B H , OIBH. OlBH
000H. OOOH, OOOH, OOOH, OFFH, 036H. 036H,036H
0 3 6 ~ . m i , 0 3 6 ~ . m i , O ~ F H ,OOOH, OOOH, OOOH
O I B H , OlBH, OIFH. 018H. OlFH, OOOH, 000H. OOOH
000H. OOOH, 0 IFH, 0 IBH, 0 IFH, 0 BH, 0 I B H , 0 1BH
OOOH, 000H. OOOH, 000H. 03FH. 036H. O36H. 036H
0 3 6 ~ 1 , 0 3 6 ~ .3 6 ~ , 0 3 6 H , FFH, 0 3 6 ~ . 36H, 0 3 6 ~
o m n , aim,OFFH, aim,OFFH, O ~ B M , i e n , o i e H
o i e n , OIBH, oien, om^, OFBH, ooon, OOOH. ooon
000H. OOOH, OOOH, OCJOH, OIFH, OIBH, OIEH, OlBH
OFFH, OFFH, OFFH, OFFH, OFFH, OFFH, OFFH, OFFH
; 0-80
; 0-81
; D-B2
; D-B3
; D-84
; 0-BS
; D-B6
; D-07
; D-Be
; D-89
; 0-BA
; D-BB
; D-BC
; D-BD
; 0-BE
; D-BF
ooon,ooon, OOOH, OOOH, OFFH, OFFH, OFFH, OFFH , D-DC
OFOH, OFOH, OFOH, OFOH, OFOH, OFOH, OFOH, OFOH , 0-00
OOFH, OOFW. OOFH, OOFH, OOFH, OOFH, OOFH, OOFH , D-DE
OFFH. OFFH, OFFH. OFFH. OOOH, OOOH, OOOH, OOOH , D-DF
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 443/605
E 3 5 E
E 3 6 6
E 3 6 E
E 3 7 6
E 3 7 E
E 3 8 6
E 3 8 E
E 3 9 6
E 3 9 E
E 3 A 6
E 3 A E
E 3 8 6
E 3 8 E
E 3 C 6
E 3 C E
E 3 D 6
E 3 D E
E 3 E 6
E 3 E E
E 3 F 6
E 3 F E
E 4 0 6
E 4 0 E
E 4 16
E 4 E
E 4 2 6
E 4 2 E
E 4 3 6
E 4 3 E
E 4 4 6
E 4 4 E
E 4 5 6
00 00 7 6 D C C 8 D C7 6 0000 7 8 C C F 8 CC F8co CO00 F C CC CO CO COco 0000 F E 6 C 6 C 6 C 6 C6 C 00
F C C C 60 30 6 0 CCF C 00
00 00 7 E D 8 D 8 DE
70 0000 66 6 6 66 66 7 C
60 CO00 7 6 DC 18 18 18
18 00F C 3 0 7 8 CC CC 7 830 F C38 6 C C 6 F E C 6 6 C38 00
38 6 C C 6 C 6 6 C 6 C
E E 00I C 30 18 7C CC CC
7 8 00
00 00 7 E DB D B 7 E00 0006 O C 7 E D B D B 7 E60 CO38 60 CO F8 CO 6038 0078 cc cc cc cc cc
cc 00
00 F C 00 F C 00 F C00 0030 30 F C 3 0 30 00
F C 0060 30 18 30 60 00
F C 0018 30 60 30 18 00F C 00OE 18 I8 18 18 18
18 I818 18 18 18 I8 D 8
D 8 7030 30 00 F C 00 30
30 0000 76 DC 00 76 DC00 0038 6 C 6 C 3 8 00 00
00 0000 00 00 18 18 00
00 00
00 0 0 0 0 00 18 00
00 00OF OC OC OC EC 6C3c I C78 6 C 6 C 6 C 6 C 0000 00
70 18 30 60 78 0000 00
00 00 3 c 3 c 3c 3c00 0000 00 00 00 00 00
00 00
E 4 5 EE 4 5 E 80 F C 0 4E 4 6 1 72 03E 4 6 3 80 CD 20E 4 6 6 84 OAE 4 6 8 89 OE 0060 RE 4 6 C E 8 E 4 7 2 RE 4 6 F E 9 O F 7 0 R
E 4 7 2 88 16 0063 RE 4 7 6 8 A C 4E 4 7 8 E EE 4 7 9 4 2
E 4 7 A 8 A C 5E 4 7 C EE
E 4 7 D 4 AE 4 7 E EA C 4E 4 8 0 F E COE 4 8 2 E EE 4 8 3 42E 4 8 4 8 A C IE 4 8 6 E EE 4 8 7 c3E 4 8 8
D B
DB
DB
D B
DB
DB
DB
DB
D 8
DB
DB
DB
D 8
D 8
DB
DB
DB
DB
D 8
DB
D 8
DB
D 8
DB
DB
DB
D 8
D 8
DB
D 8
DB
DE
A S S U H E
OOOH, O O O H , 0 7 6 H , OD C H , OC 8 H , OD C H , 0 7 6 H , O O O H
O O O H , 078H, OCCH, OF8H. OCCH, OFBH, OCOH, OCOH
O O O H , OFCH, OCCH, OCOH, OCOH, OCOH, OCOH, OOOH
O O O H , O F E H, 0 6 C H , 0 6 C H , 0 6 C H , 0 6 C H , 0 6 C H . O O O H
OFC H , OC C H , 0 6 0 H , 0 3 0 H , 060H, OCCH, OFCH, O O O H
O O O H , O O O H , 0 7 E H . ODBH, ODEH, ODBH, 0 7 0 H . O O O H
O O O H , 0 6 6 H , 0 6 6 H , 0 6 6 H , 0 6 6 H , 0 7 C H , 0 6 0 H . 3 C OH
O O O H , 0 7 6 H , OD C H , 0 ISH, 0 18H, 0 I EH , 0 I B H , O O O H
O F CH , 0 3 0 H , 0 7 8 H . O C CH , O CC H. 0 7 8 H . 0 3 0 H , O F C H
0 3 8 H , 0 6 C H , OC BH , OFEH , OC 6 H , 0 6 C H , 0 3 8 H , OOOH
0 3 8 H . 0 6 C H , OC 6H . OC 6H . 0 6 C H . 0 6 C H . OEEH, OOOH
O I C H , 0 3 0 H , O18H. 07CH, OCCH, OCCH, 078H, OOOH
OOOH, OOOH, 0 7 E H , ODBH, ODBH, 0 7 E H , OOOH, OOOH
0 0 6 H , O OC H, 0 7 E H . ODBH, OD BH , 0 7 EH , 0 6 0 H , OC OH
0 3 8 H , 0 6 0 H . OC OH , OFEH , OC OH , 0 6 0 H , O3 8 H . OOOH
078H, OCCH, OCCH, OCCH, OCCH, OCCH, OCCH, OOOH
OOOH, OFCH, O O O H , OFCH, OOOH, OFCH, 000H. OOOH
O J O H, 0 3 0 H , O F C H , O 3 0 H . 0 3 0 H , OOOH, OFCH, O O O H
0 6 0 H , 0 3 0 H , O I B H , 030H, 060H, O O O H , OFCH, OOOH
OIBH, OJOH, 060H, 0 3 0 H , 018H, O O O H , OFCH, O O O H
OOEH, 0 IBH, 0 IBH, 0 B H , 0 18H, 0 I B H , 0 18H. 0 I 8 H
018H. O I B H , O I B H , O I B H , OIBH, O D 8 H . ODBH, 0 7 0 H
030H, 0 3 0 H . OOOH, OFCH, OOOH, 030H. O3OH. OOOH
OOOH, 0 7 6 H , OD C H , OOOH, 0 7 6 H , OD C H , O O O H , OOOH
O 3 8 H , 0 6 C H , 0 6 C H . 0 3 8 H , OOOH, OOOH, OOOH, OOOH
OOOH, OOOH, OOOH, O I B H , 018H, 000H. OOOH, OOOH
O O O H , OOOH, OOOH, OOOH, 018H. 000H. 000H. OOOH
OOFH, OOCH, OOCH, OOCH, OECH, 06 CH . OJCH, O IC H
0 7 8 H , 0 6 C H , 0 6 C H , 0 6 C H , 0 6 C H , OOOH, OOOH, OOOH
0 7 0 H . 018H. O 3O H. 0 6 0 H . 0 7 8 H . 000H. 000H. OOOH
OOOH, OOOH, 03CH. O3CH. OJCH, O3CH. 000H. OOOH
OOOH, 000H. 000H. OOOH, OOOH, 000H. 000H. OOOH
C S : C O D E, D S : D A T A...................................................
, SET-CTVPE
, I N P U T
, O U T P U T
;ET-CTVPE PR D C N EAR
T H I S R O U T I N E S E T S T H E C UR SO R V A L U E
( C X ) H A S C UR SO R V A L U E C H -S T A RT L I N E , C L -S T O P L I N E
NONE....................................................
C M P AH .4 , I N G R A P H I C S N OD E?J C C 2 3 X , NO, JUMPOR C H ,2 0 H , YES, D I S A B L E C U R S O R
MOV CURSOR-MODE,CX , S A V E I N D A T A A RE AC A L L C 2 3 , OU TPU T C X R EGJM P VID EO- R ETU R N
C2 3X MOV AH, 10 , 6 8 4 5 R E G I S T E R F O R CU RS OR S E T
T H I S R O U T I N E O U TP U TS T H E C X R E G I S T E R T O T H E 6 8 4 5 R E GS N AH ED I N A Hc23 MOV
novOUTI C
HOVOUTD ECnovI NCOUTI CMDVOUTR E T
SET-CTVPE
D X, AD D R - 6 8 4 5 ,A L , A HD X, A LD X
A L , C HD X A LOXA L , A HA LD X, ALD XA L , C LD X . A L
E N D P
A D D R E S S R E G I S T E RG E T V A L U ER E G I S T E R S E TD A T A R E G I S T E R
D A T A
P O I N T T O O TH E R D A T A R E G I S T E RS E T F O R SE CO ND R E G I S T E R
SEC ON D D ATA VAL U E
A L L D O N E
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 444/605
, SET-CPOS
T H I S R O U T I N E S E T S T H E C U RR E NT C UR SO R P O S I T I O N T O T H E
NEW X-Y VALUES PAS SE0
DX - ROU,COLUMN OF NEU CURSOREH - DI SPLAY PAGE OF CURSOR
CURSOR IS S ET AT 6 8 4 5 I F D I S P L A Y P AG E IS C U R R E N T D I S P L A Y
, I N P U T
, OUTPUT
____-___-__--__-________________________-----SET-CPOS PROC NEAR
MOV CL , EHXOR CH,CH , E S T A B L I S H L O OP C OU NTSAL CX, 1 , UORD OFFSETMOV S I , CX , U S E I N D E X R E G I S T E R
MOV CS I+O FF SE T CURSOR-POSN1,OX , S A V E T H E P O I N T E RCMP ACTI VE-PAGE, EHJ N Z C 2 4 , SET-CPOS-RETURNMOV AX,DX , GET ROUlCOLU MN TO AXC A L L C 2 5 , CURSOR-SET
C 2 4 J M P V ID E O - R E T U R NSET-CPOS ENDP
6 2 5 P RO C N E A R------ S E T C U R SO R P O S I T I O N , A X H A S R O U l C O L U M N F O R C UR SO R
C A L L P O S I T I O N , D E T E R M I N E LO C A T I O N I N R E GE N
MOV CX,AXADD CX,CRT-START , A DD I N TH E S T A R T A D DR E SS F OR T H I S
SAR CX, I , D I V I D E B Y 2 FOR CHAR ONLV COUNTMOV AH, 1 4 , REGI STER NUMEER FOR CURSORC A L L C 2 3 , O U T P UT T H E V A LU E T O TH E 6 8 4 5R E T
, B U F F E R
, P A G E
C 2 5 E N D P
................................................
€ 4 8 8€ 4 8 8 E A C FE 4 E A 3 2 EDE 4 E C D I E lE 4 E E EE F I
E 4 9 0 E 9 9 4 0050 RE 4 9 4 38 3 E D O 6 2 RE 4 9 8 75 05E 4 9 A 88 C 2E 4 9 C E8 E 4 A 2 RE 4 9 F E 9 O F 7 0 RE 4 A 2
E 4 A 2E 4 A 2 E 8 E 5 C 2 R
E 4 A 5 EE C EE 4 A 7 03 OE 0 0 4 E R
E 4 A E D 1 F 9E 4 A D E 4 OEE 4 A F EE E 4 7 2 RE 4 E 2 C 3E 4 8 3
E 4 E 3E 4 E 3 A 8 EO
E 4 E 5 7 5 2 4E 4 E 7 A 2 0062 RE 4 E A E8 O E 0 0 4 C RE 4 E E 98E 4 E F 50E 4 C O F7 E lE 4 C 2 A 3 0 0 4 E R
E 4 C 5 EE CEE 4 C 7 D I F 9E 4 C 9 E 4 OCE 4 C E €8 E 4 7 2 RE 4 C E 58E 4 C F D I E 3E 4 D I EE 8 7 0050 R
E 4 D 5 E 8 E 4 A 2 RE 4D E E 9 O F 7 0 R
E 4 D EE 4 D E E A EOE 4 D D E A 0 3 D AE 4 E O E CE 4 E l 2 4 08E4E3 7 4 FBE 4 E 5 E A D 3 D FE 4 E E A 0 O O BA R
E 4 E E EO F C 80E 4E E 7 4 27E 4 F O EO F C 8 4E 4 F 3 73 22
E 4 F 5 F 6 C 4 0 1E 4 F E 74 OD
E 4 F A DO E3E 4 F C D O E 3E 4 F E DO E3
E500 2 4 C 7E 5 0 2 EO E3 3E
E 5 0 5 OA C 3
, ACT-D I SP-PAGET H I S R O U T I N E S E T S T H E A C T I V E D I S P L A Y P A G E , A L L O U I N GT H E F U L L U S E O F T H E R AM S E T A S I D E F O R T H E V I D E O A T T AC H M E N T
A L H A S T H E N EU A C T I V E D I S P L A Y P A G E
T H E 6 8 4 5 IS R E S E T T O D I S P L A Y T H A T P A G E
, I N P U T
, OUTPUT
.................................................~CT-DISP-PAGE PR OC NEAR
T E S T A L , O E O H , C R T l C P U P A G E R E G F U N C T I O NJNZ SET-CRTCPU , YES, GO H AN DL E I TMOV ACTIVE-PAGE,AL , S A V E A C T I V E P A G E V A L U EMOV CX,CRT-LEN , GET SAVED LENGT H OF REGEN BUFFERCEU , CONVERT AL TO UORDPUSH AX , SAVE PAGE VALUEMUL CX , D I S P L A Y P A G E T I M E S R E G E N L E N G T HMOV CRT-START,AX , S A V E S T A R T A D D R E S S F O R L A T E R U S E
MOV CX,AX , START ADDRESS TO CXSAR CX, I , D I V I D E B Y 2 F O R 6 8 4 5 H A N D L I N GMOV AH, 1 2 , 6 8 4 5 R E G I S T E R F O R S T A R T A D DR E SSC A L L C 2 3POP EX , RECOVER PAGE VALUES A L E X 1 * 2 FOR UORD OFFSETMOV
C A L L C 2 5 , S E T T H E C U R S O R P O S I T I O NJMP VIDEO-RETURN
AX:CEX + OFFSET 6URSOR-POSNI , G E T C UR SO R F OR T H I S, PAGE
......................................................., SETJRTCPU
T H I S R O U T I N E R EA D S OR U R I T E S T H E C R T l C P U P A G E R E G I S T E R S
, I N P U Tf A L ) = E3H SET BO TH CRT AN0 CPU PAGE REGS
( B H ) V A L U E T O S E T I N C R T P A G E R EG( E L ) = V A L U E T O S E T I N C P U PA G E RE G
fE H) = V A L U E T O S E T I N CR T P A G E RE G
( E L ) = V A L U E T O S E T I N C PU P A G E RE G
( A L ) = E2H SET CRT P AGE REG
f A L ) = E I H SET CPU PAGE REG
f A L ) = EOH R E A D C UR R E N T V A L U E O F C R T l C P U P A G E REGS
, OUTPUTA L L F U N C T I O N S R E T U R N
fEH) = CURRENT CONTENTS OF CRT PAGE REG( E L ) = CURRENT CONTENTS OF CPU PAGE REG
........................................................SET-CRTCPU:
MOVMOV
C 2 6 : I NANDJ ZMOVMOV
CMPJ ZCMPJ N CT E S TJ ZS H LS H LS H LANDANDOR
AH, ALDX, VGA-CTLAL, DXA L , 0 E H
C 2 6DX. PAGREGAL, PAGDAT
AH, EOHC 2 9A H , E 4 HC 2 9AH, I
C 2 7E L , IE L , 1
E L , 1
AL, NOT CPUREGEL , CPUREGA L. E L
S A VE R E QU E S T I N A HSET ADDRESS OF GATE ARRAYGET STATUSV E R T I C A L R E T R A C E 7
NO, U A I T FOR I TS E T 10 ADDRESS OF P AGE REGGET DATA LAST OUTPUT TO REG
R E A D F U N C T I O N R E Q U E S T E D ?YES, D O N ' T S E T A N Y T H I N GV A L I D R E Q U E S T ?NO , P R E TE N D I T U A S A R E AD R E Q U E S TSET CPU REG'NO, GO SEE ABOUT CRT REGS H I F T V AL UE T O R I G H T B I T P O S I T I O N
CLEAR OLD CPU VALUEBE S U R E U N R E L A T E D B I T S A RE Z E ROOR I N N EU V A L U E
R O M B I O S A-57
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 445/605
E 5 0 7 F6 C 4 02E 5 0 A 7 4 07E 5 0 C 2 4 F B
E 5 0 E B O E 7 07E 5 1 1 OA C 7E 5 1 3 E E
E 5 1 4 A 2 0 0 8 A RE 5 1 7 B A D 8E 5 1 9 BO E 3 3 8E 5 1 C D O F BE 5 1 E D O F B
E 5 2 0 D O F B
E 5 2 2 B A F8E 5 2 4 80 E 7 0 7
E 5 2 7 5F
E 5 2 8 5 E
E 5 2 9 58E 5 2 A E 9 O F 7 3 R
E 5 2 D
E 5 2 D
E 5 2 D E A D FE 5 2 F 3 2 F FE 5 3 1 D 1 E 3
E 5 3 3 BE 9 7 0050 RE 5 3 7 BB OE 0060 R
E 5 3 8 5 F
E 5 3 C 5 EE 5 3 D 58E 5 3 E 58
E 5 3 F 58E 5 4 0 I FE 5 4 1 07E 5 4 2 C F
E 5 4 3
E 5 4 3E 5 4 3 E A 0 3 DAE 5 4 6 E C
E 5 4 7 A 8 OBE 5 4 9 7 4 F B
E54B OA FFE 5 4 D 7 5 19
C 2 7 T E S lJ ZAND
ANDOR
C 2 8 O U T
MOVC 2 9 M O V
ANDSARSAR
AH, 2 , S E T C R T R E G 7C 2 8 , N O, GO R ETU R N C U R R EN T SE TT IN GS
A L , N O T C R T R E G , C L E A R O L D C R T V A L U EBH, C R TR EG , B E S U RE U N R E L AT E D B I T S A R E Z E ROA L , BH , OR I N NEW V A L U E
D X , A L , S E T N E W V A L U E SP A G D A T , A L , S A V E C OP Y I N RA M
E L , A L , G E T C P U R EG V A L U EE L , C P U RE G , C LE A R EX T R A B I T SE L , I , R I G H T JU S T IF Y I N E L
E L . 1
S A R B L , I
M O V B H , A L , G E T C R T R E G V A L U EAND BH, C R TR EG , C LE AR E X T R A B I T S
POP D I , R ESTOR E SOM E R EGS
POP SIPOP AX , D I S C A R D S A V E D 8 X
J M P C 2 2 , R E T U R N
ACT-D I SP-PAGE ENDP
, READ-CURSOR
______-________________--_--___--- -____--- -__-- -____
T H I S R O U T I N E R E A D S T H E C UR R E N T CU R SO R V A L U E F R O M T H E
6 8 4 5 , F O RM A TS I T , AND S E N DS I T B A C K TO TH E C A LL E R
BH - PAGE OF CURSOR
DX - R OW , C OL U M N OF TH E C U R R EN T C UR SOR P O S IT IO N
CX - CURRENT CURSOR MODE
, I N P U T
, O U T P U T
_______---______-___--- - - -___---___--- - -__-READ-CURSOR PROC NEAR
M O V B L , B HXOR BH,BH
S A L E X , 1 , WORD OFFSETM OV D X , C B X + O F F S E T C U R SO R - PO S N IMOV CX , CURSOR-MODE
POP D I
P O P SIPOP EXPOP AX , D IS C AR D SAVE D CX AND D XPOP AXPOP D SP O P E S
I R E T
READ-CURSOR ENDP
, S E T C O L O R
__--____________________________________---__
T H I S R O U T I N E WILL E S T A B L I S H T H E B A C KG R O U ND C O L OR , T H E
OVER SC AN C OL OR , AND TH E FOR EGROU ND C OL OR SET FOR GR AP H IC S
( B H ) H AS C OL OR I D
, I N P U T
I F B H Z O , T H E B A CK G R O UN D CO L O R V A L U E IS S E TF RO M T H E LO W B I T S O F 8L ( 0 - 3 1 )
I N G R A P H I C M O D ES , B O T H T H E B A CK G R O U ND A NDB O R D ER A R E S E T I N A L P H A M OD ES , O N L Y T H EBOR D ER IS S E T
B A S ED O N T H E L O U B I T O F E LI F B H Z I , T H E P A L E T T E S E L E C T I O N IS M AD E
2 COLOR MODE0 = W H I T E F O R COLOR 1
1 = B L A C K FOR C OL OR I4 COLOR MODES
0 = GR EEN , R ED , YEL L OW FORC O L O R S 1 , 2 , 3
C O L O R S 1 , 2 , 3I = BL U E. C YAN , M AGEN TA FOR
16 C OL OR M OD ESA LW A YS S E T S U P P A L E T T E A S
B L U E F O R C O L O R 1GR EEN FOR C OL OR 2C Y A N F O R C O L O R 3RED FOR COLOR 4M AGEN TA FOR C OL OR 5BROWN FOR COLOR 6L I G H T G R A Y F O R C O L O R 7D AR K GR AY FOR C OL OR 8
L I G H T B L U E F O R C OL OR 9L I G H T G R EE N F O R C OL O R 10
L I G H T C Y A N F O R C O L O R 1 1L I G H T R E D F O R C OL O R 12L I G H T M A G E NT A F O R C O L OR 13Y E L LO W F O R C O L OR 1 4W H I T E F O R C O L O R 15
( E L ) H A S T H E C OL OR V A L U E T O B E US E D
T H E C O L O R S E L E C T I O N IS U P D A T E D, O U T P U T
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ - - _ _ _ _ _ _ _ _ _SET-COLOR PROC NEA R
C 3 0 I N A L, DX , SYN C U P VGA FOR R EG AD D R ESS
M OV D X,VGA- C TL , 110 P O R T F O R P A L E T T E
T E S T A L , B , IS V E R T I C A L R E T R A CE O N?
J Z C 3 0 , NO, W A IT U N T I L I T ISOR BH ,BH , IS T H I S C O L O R 0”
J N Z C 3 1 , OU TPU T C OL OR I
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 446/605
E54FE554E556E558E 5 1 9E 5 5 BE 5 5 CE 5 5 EE15FE 5 6 1E 5 6 2E 5 6 5
E568E 5 6 BE 5 6 EE 5 7 0E 5 7 2E 5 7 4E 5 7 6E 5 7 8E 5 7 AE 1 7 CE 5 7 EE 5 8 1E m 3E585E588E S E AE 5 B B€SEE
E 5 9 0E 5 9 2E 5 9 3E 5 9 6E 5 9 7E 5 9 9E 5 9 AE 5 9 CE 5 9 EESAOE 5 A 3E 5 A 5E 5 A 6E 5 A 7E 5 A 9E 5 A B
E S A DE 5 A EE S B 1
EO 3 E 0049 R 0 472 06BO 10E EE A C 3E EBO 02E EE A C 3E €A 2 0066 RE 9 OF70 R
A 0 0049 RE9 O D 9 5 R3 C 0674 OF3 C 0 474 08
3 C 057 4 043 C O A75 2 089 ODSD RDO CB73 03E 3 C 1 04EB D 943E9 000384 11
E A C 4E E2 E : E A 07
E EF E C 443E 2 F4E ODE 11
E9 OOOFE A C 4E EE EF E C 4E 2 F E32 CO
E EE 9 OF70 R
E 5 B 1
E 5 B l E A 26 0 0 4 A RE S B S A 0 0049 RE 5 8 8 E A 3 E 0062 RE 5 B C 1F
E 5 8 0 B EE S B E 59E 5 B F E 9 O F 7 3 RE 5 C 2
E 5 C 2E S C 2 53E S C 3 EB D EE 5 C 5 E A C 4E 5 C 7 F6 2 6 0 0 4 A RE S C B 32 FFESCD 03 C 3E L C F D l EOE501 58E 5 D 2 C 3E 5 D 3
CMPJ CMOVOUTMOVOUT
C 3 0 5 M O VOUTMOVOUTMOVJMP
H A N D L Ek31 MOVMOVCMPJ ECMPJ ECMPJ ECMPJ N E
C 3 2 M O VC 3 3 R O R
J N CADD
C34 MOVI NCMOVMOV
C 3 5 M O VOUTMOVOUTI NCI N CLOOPJ M P
C36 MOVMOV
C37 MOVOUTOUT1NCLOOP
C3B XOR
OUTJ M P
--_---
SET-COLOR
COLOR 0 B Y SETTI NG THE BACKGROUND COLOR
AND BORDER COLOR
CRT-MODE,4 ; I N A L P H A M OD E?C 3 0 5 ; YES, JUS T SET BORDER REGA L , I O H ; S E T P A L E T T E R E G 0DX, AL ; S E L E C T V G A R E GA L , E L ; GET COLOROX, AL , S ET I TAL, 2 ; SET BORDER REGDX, AL ; SEL ECT VGA BORDER REGA L, E L ; GET COLOR
C R T - P A L L E T T E , A L ; SAVE THE COLOR VALUEVIDEO-RETURN
AL,CRT-MODE ; GET CURRENT MODECX. OFFSET MOO72 : P O I N T T O 2 C O L OR T A B L E E N T R Y
DX, AL ; S E T I T
COLOR 1 B Y C H A N G IN G P A L E T T E R E G I S T E R S
AL, 6c33AL, 4C 3 2AL, 5
C 3 2A L , O A HC 3 6CX, OFFSET MOO74 ,E L , 1c34C X , M 0 0 7 2 L
EX, CXE XC X, M O O 7 2 L - 1 ,AH, IIH
AL, AHOX, ALA L , C S C B X I ,D X , A LA HE Xc35S H O R T C 3 EAH, 11H
CX, 15AL, AHOX, A LOX, ALAHc37A L , A L
D X , A LVIDEO-RETURNENDP
2 COLOR MODE?YES, JUMP4 COLOR MODE?YES, JUMP
YES, JUMP4 COLOR MODE?NO, GO TO 16 COLOR SET UPP O I N T T O 4 C O L O R T A B L E E N T R YS E L E C T A L T E R N A T E S E T ?NO, JUMPP O I N T T O N E X T E N T R YT A B L E A D DR ES S I N E XS K I P OVER BACKGROUND COLORSET NUMBER OF REGS TO F I L LAH IS REGI STER COUNTER
GET REG NUMEERS EL EC T I TGET DATAS ET I TNEXT REGN E X T T A B L E V A L U E
4 COLOR MODE^
AH IS REGI STER COUNTERN U M E E R O F P A L E T T E SGET REG NUMBERS EL EC T I TS E T P A L E T T E V A L U ENEXT REG
S E L E C T L OW R E G TO E N A B L E V I D E OA G A I N
-................................................., V I D E O S T A T E, R E TU R NS T H E C U RR E NT V I D E O S T A T E I N AX, AH NUMBER OF COLUMNS ON THE SCREEN, A L = C U R R E N T V I D E O M O D E, B H = C U R R E N T A C T I V E P A G E_____________________----_--__----_---_----------
~IDEO-STATE PROC NEARMOV AH,BY TE PTR CRT-COLS GET NUMEER OF COLUMNS
MOV BH, ACTI VE-PAGE , G E T C U RR E N T A C T I V E P A G EPO P D I , R E C O V E R R E G I S T E R SPOP SIPOP c x , D I S C A R D S A V E 0 E XJ M P C 2 2 , R E T U R N T O C A L L E R
MOV AL,CRT-MODE , C U R ~ E N T MODE
VI DEO-STATE ENDP
, P O S I T I O N
, - O F A C H A R A C TE R I N T H E A L P H A M O DE, I N P U T
, OUTPUT
60s ON PROC NEARP U S H E X , S A V E R E G I S T E RMOV BX,AXMOV AL , AH , ROWS TO ALMUL BYT E PTR CRT-COLS , DETERMI NE BYTES TO ROWXOR BH,BHADD AX,BX , A DD I N CO LU M N V A L U ESAL AX , I , 0 2 F O R A T T R I B U T E B Y T E S
POP EXR E T
________________--__---------------
T H I S S E R V I C E R O U T I N E C A L C U L A T E S T HE R E G E N B U F F E R A D D RE S S
AX = ROW, COLUMN PO SI T I ON
AX = O F F S E T O F CH AR P O S I T I O N I N R EG E N B U F F E R....................................
P OS I T I ON ENDP
, S C R O L L U P..........................................
T H I S R O U T I N E M O VE S A BL O C K O F C HA R A C TE R S U PON THE SCREEN
( A H ) = CURRENT CRT MODE( A L ) = NUMBER O F ROWS TO SCROLL( C X ) = ROW/COLUMN OF UPPER L EF T CORNER( D X ) = ROWlCOLUMN OF LOUER RI GHT CORNER( E H ) = A T T R I B U T E T O B E US ED O N B L A N K ED L I N E( O S ) = DATA SEGMENT( E S ) = REGEN BUFFER SEGMENT
NONE -- T H E R E G E N B U F F E R IS M O D I F I E D
, I N P U T
, OUTPUT
...........................................
ROM BIOS
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 447/605
E 5 D 3
E 5 D 3
E 5 D 5
E S D E
E 5 D AESD D
ESD D
E S D E
E 5 E OE 5 E 3
E 5 E 5
E 5 E 7
E 5 E 9E 5 E E
E 5 E E
E 5 F O
E 5 F 2E 5 F 4
E 5 F 6
E 5 F 7
E 5 F 9
E S F C
E 5 F E
E 6 0 0
E 6 0 2
E 6 0 5E 6 0 7
E 6 0 9
E 6 0 9
E 6 0 9E 6 0 C
E 6 10
E 6 1 2
E 6 1 4
E 6 16E 6 1 8
E 6 1 A
E 6 1CE 6 2 0
E 6 2 2
E 6 2 4
E 6 2 8
E 6 2 A
E 6 2 8
E 6 2 CE 6 2 E
E 6 2 F
E 6 2 FE 6 2 FE 6 3 1
E 6 3 2
E 6 3 3
E 6 3 5E 6 3 6
E 6 3 7
E 6 3 8
E 6 3 8
E 6 3 8
E 6 3 A
E 6 3 E
E 6 3 D
E 6 3 E
E 6 3 F
E A D E
EO F C 0 47 2 0 3E 9 F259 R
53B E C l
E 8 E 6 0 9 R7 4 200 3 F O
B A E 6
2 A E 3E 8 E 6 2 F R0 3 F5
03 F D
F E C C
7 5 F 558
EO 20E E E 6 3 8 R
0 3 F D
F E C E
7 5 F 7
E 9 O F 7 0 R
E A D EE E E D
E 8 E 5 C 2 R0 3 06 0 0 4 E R
B B F E
B e FO
2 8 0 1
F E C 6F E C 2
3 2 E D
8 B 2 E 0 0 4 A R
03 E DE A C 3
F 6 2 6 0 0 4 A R
0 3 CO
06
IFO A D Ec 3
B A C A
565 7F 3 / A 5
5 F
5 Ec 3
B A C A
5 7
F 3 / A B
5 F
c3
E 6 3 FE 6 3 F F D
E 6 4 0 E A DEE 6 4 2 E O F C 0 4
E 6 4 5 7 2 0 3
E 6 4 7 E 9 F305 R
E 6 4 A 5 3
E 6 4 E EE C 2E 6 4 D E 8 E 6 0 9 R
E 6 5 0 7 4 I F
E 6 5 2 28 F O
E 6 5 4 E A E6E 6 5 6 2 A E 3
ASSU ME
MOVCMP
J C
J M P
P U S HMOVC A L L
J Z
ADD
MDV
S U E
ADD
ADD
DEC
J N ZC 4 1 P O P
MOVC 4 2 C A L L
ADD
DEC
J N Z
C 4 3 J M P
C 4 4 M O V
J M PS C R O L L U P
SC R O L L - U P
c 3 9
C 4 0 C A L L
C S C O D E . D S D A T A . E S D A T APR O C N EAR
B L , A L
AH , 4
c39G R A P H I C S - U P
E XA X , C XS C R O L L - P O S I T I O N ,c 4 4
SI, X
AH, DH
A H, B Lc 4 5
SI, P
D I , E P
AH
C 4 0AX
A L , ' 'C 4 6D I , B P
B L
C 4 2
V I D E O - R E T U R N
E L , O HC 4 1
E N D P
S AV E L I N E C OUNT I N B L
T E S T F O R G R A P H I C S M O DE
H A N D L E S E P A R A T E L Y
U P- C O N T I N U ES AV E F I L L AT T R I B UT E I N EH
U PP ER L E F T P O S I T I O N
D O S E T U P F O R S C R O L L
B L A N K - F I E L D
F R O M AD D R ESS
R O U S T O BE MO VEDMOVE ONE ROU
P O I N T TO N EX T L I N E I N BL OC K
C O UN T O F L I N E S T O M OV E
ROW-LOOPR EC OV E R A T T R I B U T E I N A H
F I L L W I TH B L A NK S
CLEAR THE ROWP O I N T T O NE X T L I N E
C O U NT E R O F L I N E S T O S C R O LL
C L EAR - L O O P
GET ROU COUNT
GO C L E A R T H A T A R E A
n ROUS IN BL O C K
-, ----- H AN D L E C O MMO N SC R O L L SET UP H E R E
S C R O L L - P O S I T I O N P R OC N E A R
C A L L P O S I T I O NAD D AX , C R T - ST AR T ,M O V D 1 , A X
MOV S I , A X
S U E D X , C X
I N C DH
I N C D L
XO R C H , C H
MOV BP,CRT-COLS ,A D D E P , E P
M O V A L , E L
M U L B Y T E P T R C R T- CO LS
AD D AX , AX
P U S H E 5
POP OS
O R B L , E LR E T
S C R O L L - P O S I T I O N E N D P
C 4 5 P R OC N E A R_ _ - _ _ _OVE-ROU
M D V C L , D LP U S H SI
P US H D I
R EP MO VSU
PO P DI
P O P SI
R E T
C 4 5 E N D P
C 4 6 P R D C N E A R
_ _ _ _ _ _ C L EAR - R O U
M O V C L , D L
P US H D IR E P S T D S U
PO P D I
R E T
C 4 6 E N D P
C O N VER T T O R E G E N P O I N T E RO F F S E T O F A C T I V E P A G E
T O AD D R ESS F O R SC R O L L
F R O M AD D R ESS F O R SC R O L LOX = X R OU S, X C O LS I N B L O CK
I N C R E M E N T F O R 0 O R I G I N
S E T HIGH BYT E O F C O U N T T O Z ER O
G E T NU ME ER O F C OL UM N S I N D I S P L A Y
T I M E S 2 F O R A T T R I B U T E B Y T E
G E T L I N E C O UN TD E T E R M I N E O F F S E T T O F RO M
A DDRE S S* 2 F OR A T T R I B U T E B Y T E
E S T A B L I S H A D D R ES S I N G T O RE G E N
B U F F E R
0 S C R O LL M E A NS B L A N K F I E L D
R E T UR N U I T H F L A G S S E T
F O R B O T H P O I N T E R S
G ET X O F C D L S T O MO VE
S A V E S T A R T A D D R E S SM O VE T H A T L I N E ON S C R E E N
R EC O VER AD D R ESSES
G ET X C O L U MN S T O C L EAR
S T O R E T H E F I L L C H AR AC T ER
, SC R O L L - D D U NT H I S R O U T I N E M OV ES T H E C H AR AC TE RS W I T H I N A D E F I N E D
B L O CK D OW N O N T H E S CR EE N, F I L L I N G T H E T OP L I N E S
W I T H A D E F I N E D C H A R A CT E R
( A H ) = CURRENT CRT MODE
, I N P U T
( A L ) N UM E ER O F L I N E S T O S C R O L L( C X ) = U P P E R L E F T C O RN ER O F R E G I O N
( D X ) = L D U E R R I G H T C O R N E R O F R E G I O N
(EH) F I L L C HA RA CT ER
( D S ) = D A T A S E G M E N T
( E S ) = R EG EN SEG MEN T
, O U PU TN O N E - - S C R E E N IS S C R O L L E D
__-__--____-___-___------------------SCROLL-DOUN
ST D
MOVCMP
J C
J M P
C 4 7 P U S H
MOVC A L L
J Z
S U E
MOVS U E
PROC NEAR
E L , A LAH, 4
c 4 7
GRAPH1 CS-DOUN
E X
AX, D XS C R OL L -P O S I T I ON ,C 5 1
S I , A X
AH , D HA H, E L
D I R E C T I O N F O R S C R O LL D DU N
L I N E C OUN T T O E LT E S T F O R G R A P H I C S
S AV E A T T R IB U T E I N EH
L O U E R R I G H T C O R N E RG E T R E G E N L O C A T I O N
51 IS F R O M AD D R ESSG E T T O T A L X R O U S
C O UN T T O M O VE I N S C R O L L
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 448/605
E 6 5 8 E8 E 6 2 F R
E 6 5 8 2 B F5E 6 5 D 28 F D
E 6 5 F F E CCE 6 6 1 75 F 5E 6 6 3 5 8E 6 6 4 BO 20E 6 6 6 E8 E 6 3 8 RE 6 6 9 28 FDE 6 6 8 F E C BE 6 6 D 75 F 7E 6 6 F E 8 9 1E 6 7 1 8 A DE
E 6 7 3 E8 E EE 6 7 5
E 6 7 5E 6 7 5 50E 6 7 6 5 6E 6 7 7 5 1E 6 7 8 33 F 6E 6 7 A E9 0100E 6 7 D A CE 6 7 E 4 6E 6 7 F E 2 F CE 6 8 1 59
E 6 8 2 5 EE 6 8 3 58
E 6 8 4 C 3E 6 8 5
E 6 8 5E 6 8 5 SOE 6 8 6 88 F 4E 6 8 8 3 6 : 89 4 4 OCE 6 8 C BE COE 6 8 E 88 F2E 6 9 0 B A 0 3 D AE 6 9 3 E CE 6 9 4 24 08E 6 9 6 75 F BE 6 9 8 E CE 6 9 9 2 4 08€ 6 9 8 74 F BE 6 9 0 58E 6 9 E O A COE 6 A 0 74 OCE 6 A 2 3 C 02E 6 A 4 74 17E 6 4 6 3 C 0 1E 6 A B 75 2 8E 6 A A EO 02E 6 A C E B 06E 6 A E EA C 3
E680 24 OFE 6 9 2 O C 10
E 6 8 4 E EE 6 B S BA C 7E 6 8 7 E EE 6 8 8 32 COE 6 B A EE
E 6 8 8 €0 18EQBD 84 10
E O B F EA C 4E 6 C I E EE 6 C 2 2 6 : EA 04
E 6 C 5 E EE 6 C 6 46E 6 C 7 F E C 4E 6 C 9 80 F C 2 0E 6 C C 72 F IE 6 C E BO 02
E600 EE€ 6 0 1 2 6 . EA 04E 6 0 4 €E
C 4 8 C A L L C 4 5 , MOVE ONE ROUSUB S I , B P
SUB D I , B P
DEC AHJ N Z C 4 8
MOV AL, ' '
S U B D I , B P , GO TO NEXT ROUD E C E LJ N Z C 5 0J M P C 4 3 , SCROLLJND
J M P C 4 9
C 4 9 P O P A X , R EC OV ER A T T R I B U T E I N AH
C 5 0 C A L L C 4 6 , CLEAR ONE ROU
C 5 1 MOV B L , D H
SCROLL-DOUN ENDP
, MODE -A L IV E- - - - - - -_--_--__----_____________________T H I S R O U T I N E R E A D S 2 5 6 L O C A T I O N S I N MEM OR Y A S E VE R Y O TH ERL O C AT IO N I N 5 1 2 L O CA TI ON S T H I S IS T O I N S U R E T H E D A T AINT E G RIT Y OF MEMORY DUR ING MODE CHA NGE S-____-__________________________________
~ O D E - A L I VE PROC NEARP US H A X ,S A V E US E D RE GS
P US H CXXOR S I , S I
M O V C X . 2 5 6
I N C SIL O O P C 5 2POP CXPOP SIPOP AX
R E TMODE -A L IV E E NDP
, S E T-P A L L E TTE
, I N P U T
P u s t i SI
C 5 2 L O O S E
-_______________________________________----------
T H I S R O U T I N E U R I T E S T H E P A L E T T E R E G IS T E R S
I A L I = 0 S E T P A L E T T E R E Gi eco = VALUE T O SET
(en) VALUE T O S E T
I B L ) = P A L E T T E R E G T O S E TI A L I = I SET BORDER COLOR REG
I A L I = 2 S E T A L L P A L E TT E RE GS A ND B ORDE R RE GN O T E R E G I S T E R S A R E U R I T E ON L Y
........................................................
c53:
c54:
c55:
C 5 6 :
c57:CS B :
novMOVMOV
novnovI NANDJ N ZI NANDJ ZPOPORJ ZCMPJ ECMPJ N EnovJ M PMOV
ANDOROUTnovOUTXOROUTJ M PnovnovOUTMOVOUTI NCI NCCMPJBMOV
OUTMOVOUT
PROC NEARAXSI, PA X , S S [ S 1 * 1 2 1 ,ES. AXSI, xDX,VGA-CTL ,AL, OXAL, oenc53AL, OXAL, o wc 5 4AXA L , A Lc5sAL, 2c57AL, 1c59AL, 2S H O R T C 5 6A L, B L
A L , O F H
OX, A L
O X, A LA L , A LO X, A LS H O R T C 5 9A H. IOM
AL, ion
A L , en
A L; A n
GET SEG FROM STACK
O FF SE T I N SISET VGA CONTROL PORTGE T V GA S TA TUSI N V E R T I C A L R ET RA CE ?Y ES, U A I T F OR I T TO GO AYAYGE T V GA S TA TUSI N V E R I TC A L R ET RA CE ?NO, U A I T F OR I T
S E T P A L E T T E RE G ?
S E T A L L R E G S ?
SET BORDER COLOR REG?NO, DON'T DO A NY THIN GSET BORDER COLOR REG NUMBER
G E T D E S I R E D R E G NU MB ER I N A L
S T R I P UN US ED B I T SMA K E I NT O RE A L RE G NUMBE RS E L E C T R E GG ET D A T A I N A LS E T N E Y D A T AS E T R E G 0 SO D I S P L A Y Y O RK S A G A I N
YES, GO DO I T
A H IS REG COUNTERR E G A DD R ES S I N A L
OX, AL , S EL EC T I TA L , B V T E P T R E S ( S I 1 , G E T D A T AOX, AL , P U T I N VG A R EGSI , N E X T D A T A B Y T EA H , N E X T R E GA H . 2 0 H , L A S T P A L E T T E RE G?C S B , NO, DO NE XT ONEA L , 2 , SET BORDER REG
, P U T I N ' V G A R EG
S EL EC T I TG E T D A T AD X $LAL:BYTE PTR ES r k i iOX, AL
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 449/605
E 6 D 4 E E
E 6 D 5 E 9 O F 7 0 RE 6 D 8
E 6 D 8
E 6 D 8 50E 6 D 9 I E
E 6 D A 8 8 ---- RE 6 D D 8 E D 8
E 6 D F A 0 0005 RE 6 E 2 E 6 10
E 6 E 4 F E C 8
E 6 E 6 A 2 0005 R
E 6 E 9 I FE 6 E A 58E 6 E E C 3
E 6 E C
E 6 F 2
E 6 F 2 E 9 O B I 8 R
E 6 F 5
E 6 F 5 50E 6 F 6 F B
E 6 F 7 2 E 8 A 25E 6 F A 2 0 26 0 0 8 4 R
E 6 F E E 4 2 1E 7 0 0 22 C 4
E 7 0 2 E 6 2 1
E 7 0 4 58
E 7 0 5 C 3
E 7 0 6
E 7 0 6E 7 0 6 5 1
E 7 0 7 28 C 9
E 7 0 9 2 E 8 A 05E 7 0 C 3 4 FF
E 7 0 E 84 06 0 0 8 4 R
E 7 1 2 7 5 03
E 7 1 4 E 2 F B
E 7 1 6 F 9
E 7 1 7 59E 7 1 8 C 3
E 7 19
E 7 1 9
E 7 1 9 5 1E 7 1 A 28 C 9E 7 1 C E C
E 7 1 D 3 C 01
E 7 1 F 7 4 05E 7 2 1 E2 F9E 7 2 3 F9E 7 2 4 E B 0 1E 7 2 6 F8
E 7 2 7 59E 7 2 8 C 3
E 7 2 9
OUT
C 5 9 J M PS ET -P A L L E T T E
MFG-UP PROC
P U S H
P U S H
ASSU ME
MOV
MOV
MOV
OUTD EC
MOV
ASSU MEP O P
P O PR E T
ASSU MEORG
MFG-UP ENDP
D X , A L
V I D E O - R E T U R N ,E N D P
N EAR
AX
D S
D S X X D A T A
A X , X X D A T A
D S, AX
AL , MF G - T ST ,IOH, A LA L
MFG-TST, AL
D S A B S 0DSAX
C S C O DE , D S D A T AO E 6 F 2 H~
J M P N E A R P T R B O O T -S T R A P
P U T I N VG A R EG
A L L D O N E
G E T M F G C H E C K P O I N T
O U T PU T I T T O T E S TE RD RO P I T B Y I F O R T H E N E X T T E S T
, S U B R O U T I N E TO S E T U P C O N D I T I O N S F O R T H E T E S T I N G O F 8 2 5 0 A ND8 2 5 9 IN T E R R U P T S E N A B L E S M A S K AB L E E X T E R N A L I N T E R R U P T S ,
C L E AR S T H E 8 2 5 9 I N T R R E C E I V E D F L A G B I T , A ND E N A B L E S TH E
D E V I C E ' S 8 2 5 9 I N T R ( W HI CH E VE R IS B E I N G T E S T E D)
( D S ) AD D R ESS O F SEG MEN T W HER E I N T R - F L A G IS D E F I N E D
( D I ) O F F S E T OF T H E I N T E R R U P T B I T M A SK
I NT R -F L AG B I T F O R T H E D E V I C E 0
, I T E X P E C T S TO B E P A S SE D
, U P O N R E T U R N
, N O R E G I S T E R S A RE A L T E R E D
S U I P R OC N E A R. . . . . . . . . . . . .. . . . . . . . . . . . . . .. . . . . . . . . . . . . . .. . . . . . . . . . . . . .. . . . . . . . .P U S H A X
S T I , E N A B L E M A S K A B L E E X T E R N A L
M OV A H ,C S C D I I , G E T I N T E R R U P T B I T M AS K
A N D I N T R - F L A G , A H , C L EA R 8 2 5 9 I N T E R R U P T R E C ' D F L A G
I N A L , l N T A O l , C U R R E N T I N T E R R U P T S
A N D A L , A H , E N A B L E T H I S I N T E R R U P T , TO O
, I N T E R R U P T S
, B I T
OUT I N T A O I , A L , WRITE T O a 2 5 9 ( IN TER RU PT
, C O N T R O L L E R )
P O P A X
R E T
S U I E N D P
, S U B R O U T I N E W H IC H C HE CK S I F A 8 2 5 9 I N T E R R U P T IS G EN ER AT ED BY T H E
, I T E X P EC TS TO B E P A SS E D
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8 2 5 0 I N TE R R U PT
( D I ) O F F S E T OF I N T E R R U P T B I T M A SK
( O S ) A D D R E S S O F S E G M E N T U H E R E I N T R - F L A G IS D E F I N E D
( C F ) I I F N O I N T ER R U P T IS G EN ER AT ED
( A L ) C OM P LE M EN T OF T H E I N T E R R U P T M A S K
, I T R ET UR NS
0 I F T H E I N T E R R U P T O CC UR RE D
, N O O T H E R R E G I S T E R S A R E A L T E R E D
i s 0 5 9 PR O C N EAR
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
P U S H C X
S U B cx , cx , SET PR O G R AM L O O P C O U N T
MO V AL , C S C D I 1 , G E T I N T E R R U P T M A S KX O R A L , O F F H , C O M P L E M E N T M A S K S O O N L Y T H E I N T R
, T ES T B I T IS ON
A T 2 5 T ES T I N T R F L A G , A L , 8 2 5 9 I N T E R R U P T O CC UR 7
J N E A T 2 7 - , YES - C O N T I N U E
L O O P A T 2 5 , U A I T S OM E M OR E
S T C , T I M E ' S U P - F A I L E D
A T 2 7 P O P C XR E T
C 5 0 5 9 E N DP
, S U B R O U T I N E T O U A I T F O R A L L E N A BL E D 8 2 5 0 I N T E R R U P T S TO C LE A R ( S ON O I N T R S WILL B E P E N D I N G ) E A C H I N T E R R U P T C O UL D T A K E U P T O
I M I L L I S E C O N D T O C LE A R T HE I N TE R R U P T I D E N T I F I C A T I O NR E G I S T E R WILL B E CH EC K ED U N T I L T HE I N T E R R U P T ( S ) IS C L E A R E D
O R A T I MEO U T O C C U R S
( D X ) = A D DR E S S O F T H E I N T E R R U P T I D R E G I S T E R
( A L ) = C O N T E N T S O F T H E I N T R I D R E G I S T E R
( C F ) = I I F I N TE R R U P TS A RE S T I L L P E N D IN G
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
, E X P E C T S TO B E P A S S E D
, R E T U R N S
0 I F N O I NT E R R U P T S A R E P E N D IN G ( A L L C L E A R ), N O OT H ER R E G I S T E R S A R E A L T E R E D. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
U 8 2 5 0 C P R O CP U S H
S U BA T 2 8 I N
CMP
J EL O O PS T C
J M P
A T 2 9 C L CA T 3 0 P O P
R E T
U 8 2 5 0 C E N D P
N EARC X
cx, c xA L , D X
AL , IA T 2 9
A T 2 8
S H O R T A T 3 0
c x
R E A D I N T R ID R EG
I N T E R R U P T S S T I L L PE N D IN G '
NO - GOOD F I N I S H
K E E P T R Y I N G
T I M E ' S U P - ERROR
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 450/605
E 7 2 9E729
E729 03F9E728 0 2 E AE 7 2 D 0175E72F OOBAE 7 3 1 O O S DE733 002FE735 0017
E737 0017E739
E739 F BE 7 3 A IEE738 52E 7 3 C 56E 7 3 D 17E 7 3 E 11
E73F 53E740 E8 F2
E742 88 F AE744 D I E 6E 7 4 6 E8 1388 RE 7 4 9 BE 94 0000 RE 7 4 D OB D 2E74F 74 13E751 OA E 4E753 74 16
E751 F E C CE757 74 47E759 F E C CE 7 5 B 74 6 CE 7 5 D F E CCE75F 75 03E761 E9 E 7 F 3 R
000 - 110
001 - 150010 - 300011 - 600100 - 1200
101 - 2 4 0 0110 - 4800111 - 4800
XO - NONE 0 - I 10 - 7 B I T S0 1 - ODD I - 2 I1 - 8 B I T SI 1 - E V E N
O N R E T UR N , T H E R S 2 3 2 I N T E R R U P T S A RE D I S A B L E D AN DC O N D I T I O N S AR E S E T AS I N C A L L T O COMMOS T A T U S ( A H = J I
S EN D T H E CH A R AC T E R I N ( A L ) O V E R TH E COMMO L I N E( A L ) R E G I S T E R IS PRESERVEDON E X I T , B I T 7 OF A H IS S E T I F T H E R O U T I N E WAS
UNA B L E TO TRA NS MIT THE B Y TE OF DA TA OV E RTH E L I N E . I F B I T 7 OF AH IS NOT S E T, THERE MA INDE R OF A H IS S E T AS I N A S T AT U SRE OUE S T, RE F E L E CTIN G THE CURRE NT S TA TUS OFT H E L I N E .
R E C E I V E A C H AR A CT ER I N ( A L ) F RO M COMMO L I N E B E F OR ER E T U R N I N G T O C A L L E R
O N E X I T , A H H A S T H E CU R R EN T L I N E S T A T U S , A S SE T B YT H E S T A T U S R O U T I N E . E X C E P T T H A T TH E O N L Y
B I T S L E F T ON, A RE T HE ER RO R B I T S( 7 , 4 , 3 , 2 . 1 ) I N T H I S C AS E, T HE T I M E OUT B I TI N D I C A T E S D A T A S E T R E AD Y U A S N OT R E C E I V E DTHUS , A H I S NON ZE RO ONL Y UHE N A N E RRORO CC UR RED ( N O T E I F TH E T IM E -O U T B I T I S S E T,O TH ER B I T S I N AH M AY N OT B E R E L I A B L E )
( A H ) = 3 R E T U R N T H E COMMO P OR T S T A T U S I N ( A X 1A H C O N T A I N S T H E L I N E C ON T RO L S T A T U SB I T 7 = T I M E O U TB I T 6 = T R A N S S H I F T R E G I S T E R E M P T YB I T 5 T R A N H O L D I N G R E G I S T E R E M P T YB I T 4 B R EA K D E TE C TB I T 3 FRA MING E RRORB I T 2 = P A R I T Y E R R O RB I T 1 OVERRUN ERRORB I T 0 = DA TA RE A DYA L CONTA INS THE MODE M S TA TUSB I T 7 R E C IE V ED L I N E S I G N AL D ET EC TB I T 6 = R I N G I N D I C A T O RB I T 5 = DA TA S E T RE A DYB I T 4 = CLEAR TO SENDB I T 3 = D E L TA R E C E I VE L I N E S I G N A L D ET EC TB I T 2 = T R A I L I N G E D G E R I N G D E TE C TO RB I T 1 = D E L T A D A T A S E T R E A D YB I T 0 = DE L TA CL E A R TO S E ND
( O X ) = P AR AM ET ER I N D I C A T I N G U H I C H R S 2 3 2 C I R D ( 0 . 1 A L L O U E D I, DA TA A REA RS 2 3 2 -B A S E CON TA IN S THE B A S E A DDRE S S OF THE 8250 ON THE, C AR D L O C A T I O N 4 0 0 H C O N T A I N S U P T O 4 R S 2 3 2 A DD R ES SE S P O S S I B L E, D A T A A R E A R S 2 3 2 - T IM - O U T ( B Y T E ) C O N T A I N S O U T ER L O O P C OU N T
V A L U E F O R T I M E O U T ( D E F A U L T = I ), UTPUT
A X M O D I F I E D A C C O R D I N G T O P A RM S O F C A L LA L L OTHE RS UNCHA NGE D
...................................................,ASSUM€ORC
D UD UD UD UD UD UD UD U
VECTORS T I
P U S HP U S HP U S HP U S HP U S HP U S HMOV
MOVS H LC A L LMOVORJ ZORJ ZDECJ ZDECJ ZDE CJ N ZJMP
A I L AB EL
R S 2 3 2 - I 0. ------
CS CODE ,DS DA TAO E 7 2 9 HUORD
1017 , 110 BAUD , T A B L E O F I N I T V AL UE746 , 110
373 , 300186 , 600
47 , 240023 , 480023 , 4800P ROC FA R
93 , 1200
TO A P P R O P R I A T E R O U T I N E, I N T E R R U P T S B A C K O N
os , SAVE SEGMENTOXS ID IcxEXS I , D X , R S 2 3 2 V A LU E TO S I
D1 ,DX , A ND T O D I ( F O R T I M E O U T S )S I , I , U O R D O F F S E T
D D S , P O I N T T O B I O S D A T A S EG ME NTD X . R S 2 3 2 - 8 A S E C S I l G ET B A S E A D DR E SS
DX, DX ,A 3 , R E T U R NAH. AH , T E S T F OR ( A H l = OA 4 , COMMUN I N I TA H , T ES T FOR ( A H l = lA 5 , S E N D A LA H , T E S T F OR ( A H ) = 2A 1 2 , R E C E I V E I N T O A LA H , T E S T F OR ( A H l = 3A 3A 10 , C O M M U N I C A T I O N S T A T U S
+E S T FOR 0 B A S E A DDRE S S
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 451/605
E 7 6 4
E 7 6 4 5E
E 7 6 5 59
E 7 6 6 5FE 7 6 7 5 E
E 7 6 8 5 AE 7 6 9 I FE 7 6 A C F
E 7 6 E E A E OE 7 6 0 83 C 2 03E 7 7 0 EO EOE 7 7 2 E E
E 7 7 3 8 A D 4
E 7 7 5 El 0 4
E 7 7 7 D 2 C 2
E 7 7 9 E 1 E 2 O OO E
E 7 7 D E F E 7 2 9 RE 7 8 0 03 F A
E 7 8 2 B E 94 0000 R
E 7 8 6 4 2E 7 8 7 2E 8 A 4 5 0 1E 7 8 8 E E
E 7 8 C 4 A
E 7 8 D 2E 8 A 05E 7 9 0 E E
E 7 9 1 83 C 2 03
E 7 9 4 E A C 4
E 7 9 6 24 I FE 7 9 8 E E
E 7 9 9 4 A
E 7 9 A 4 AE 7 9 E BO 00E 7 9 D E E
E 7 9 E EE 53
E 7 A O
E 7 A O 50E 7 A 1 83 C 2 0 4E 7 A 4 EO 03
E 7 A 6 E E
E 7 A 7
E 7 A 8E 7 1 9
E 7 A E
E 7 A E
E 7 E O
E 7 E I
E 7 E 3E 7 8 6E 7 8 8E 7 E 8
E 7 E 9
E 7 E E
E 7 E EE 7 C O
E 7 C 3
E 7 C 4
E 7 C 6
E 7 C 7
E 7 C 9
E 7 C C
E 7 C E
E 7 C F
€?DO
E 7 D IE 7 D 3
E 7 D 6
E 7 D E
E 7 D 9
€ 7 0 A
E 7 D C
E 7 D EE 7 E 3
E 7 E 5
E 7 E 7
E 7 E 9E 7 E E
E 7 E FE 7 F O
E 7 F 3E 7 F 7
E 7 F A
E 7 F E
E 7 F D
E 7 F EE 7 F F
4242E 7 30
E8 E 8 0 2 R
74 08
59
E A C I
EO CC 80E E I C
4 AE 7 20E 8 E E 0 2 R75 F O
83 E A 0559E A C I
E E
EE 9 E
E3 C Z 04EO 0 1EE4242
E 7 20E8 E E 0 2 R75 DE4 A
E C
A B 0 1
75 09F6 06 0071 R 80
74 F4
EE C C
2 4 I E
8 A E OEE 94 0000 RE C
E 9 E 7 6 4 R
E8 94 0000 R83 C 2 05E CE A E O
42E CE 9 E 7 6 4 R
, R E T U R N FR O M R S 2 3 23
P O P E X
P O P c xP O P D I
P O P SIP O P D X
P O P DSI R E T , R E T UR N T O C A L L E R , N O A C T I O N- _ _ - _ _N I T I A L I Z E T H E C O MM U NI CA T IO N S PO RT
A 4 M OV A H , A L , S AV E l N l T P AR M S I N A H
A D D D X . 3 , P O I N T T O 8250 C O N T R O L R E G I S T E R
M O V A L . 8 0 HO U T D X , A L , S E T D L A E Z I
M O V D L , A H , G E T P A RM S T O D L
M O V C L . 4
R O L D L , C L
AN D D X, O EH , I S O L A T E T H E M
MOV D I , O FF SE T A I , E A S E O F T A B L EADD D I , D X , P U T I N T O I N D E X R E G I S T E R
M O V D X , R S 2 3 2 - B A S E C S l I , P O I N T T O H I G H O RD ER OF D I V I S O R
I N C D X
MOV A L ,C S C D I l + I , G E T H I G H O R D E R O F D I V I S O RO U T D X , A L , S E T M S OF D I V T O 0
D E C D X
MOV A L , C S C D I I , G E T L O U O RD ER O F D I V I S O RO U T D X , A L , S E T L O U O F D I V I S O R
A D D D X . 3M O V A L , A H , G E T P A R M S B A C K
A N D A L , O I F H , S T R I P O F F TH E E AU D B I T SO U T D X , A L , L I N E C O N TR OL T O 8 B I T S
D E C D X
D E C D X
M O V A L . 0O U T D X , A L , I N T E R R U P T E N A B L E S A L L O F F
J M P S HO RT A 1 8 , C O M- ST AT U S
- _ _ - _ _E T E R M IN E E A UD R A T E D I V I S O R
-__-_-E ND C H A RA C T ER I N ( A L ) O V ER COM MO L I N E
k sP U S H A X , S A V E C H AR T O S E N D
A D D D X . 4 , M O D E M C O N T R O L R E G I S T E R
M O V A L . 3 , D T R AN D R T S
O U T D X , A L , D A T A T E R M I N A L R E A D Y , R E O U E S T T O
I N C D X , M O D E M S T A T U S R E G I S T E R
I N C D XMOV EH,30H , D A T A S E T R E A D Y C L E A R T O SEN D
C A L L U A l T - F O R - S T A T U S , A R E B O T H T R U E 7
J E A 9 , YES, R E A D Y T O T R A N S M I T CH A R
M O V A L , C L , R E L OA D D A T A B Y T E
J M P A 3 , R E T U R N
D E C D X , L I N E S T AT U S R E G I S TE R
MOV EH,ZOH , IS T R A N S M I T T E R R E A D Y
C A L L U A I T - F O R - S T A T U S , T E S T F O R T R A N S M I T T E R R E A DY
S U E D X , 5 , D A T A P O R T
P O P c x , R E CO V ER I N CX T E M P O R A R I L YM O V A L , C L , M O V E C H AR T O A L F O R O U T, S T A T U S
O U T D X , A L , O U T P U T C H A R A C T E R
J M P A 3 , R E T U R N
, SEN D
A 7 P O P C X
A E O R A H . 8 O H , I N D I C A T E T I M E OUT
A 9 , CLEAR-TO-SEND
J N Z A 7 , R E T U R N u i T n TIME OUT SET
, I N A H
__---- E C E I V E C HA R A CT E R F R OM CO MM O L I N E612 A D D D X , 4 , M O D E M C O N T R O L R E G I S T E R
MO V AL , I , D A T A T E R M I N A L R E A D Y
O U T D X , A LI N C D X , M O D E M S T A T U S R E G I S T E R
I N C D X
MOV EH,ZOH , D A T A S E T R E A D YC A L L U A I T - F O R - S T A T U S , T E S T F O R DS RJ N Z A 8 , R E T UR N U l T H E R RO R
D E C D X , L I N E S T AT U S R E G I S TE R
T E S T A L . I , R E C E I V E B U F FE R F U L L
J N Z A 1 7 , T E S T F O R R E C B U F F F U L L
T E S T E I O S - E R E A K , B O H , T E S T F O R B R E A K K E Y
J Z A 1 6 , L O OP I F N O B R E A K KE Y
J M P A 8 , S E T T I M E O U T E RR O R
A 1 6 I N A L , DX
A 1 7 A ND A L , O O O 1 1 1 1 O E , T E S T F O R ER RO R C O N D I T I O N S O N R E C V, C H AR
M O V A H , A LM OV D X , R S 2 3 2 - E A S E C S I l D A T A P O R TI N A L . D X , k E T C H A RA C TE R F RO M L I N E
J M P A 3 R E T UR N
- _ _ - _ _OMMO P O R T S T A T U S ROUT IN^A 1 8 M OV D X , R S 2 3 2 - E A S E C S I 3
A D D D X . 5 , C O N T R O L P O R T
M O V A H , A L , P U T I N AH F O R R ET U RN
I N C D X , P O I N T T O M O DE M S T A T U S R E G I S T E R
I N A L , D X , G E T M O D E M C O N T R O L S T A T U S
J M P A 3 , R E T U R N
U A I T F O R S T AT U S R O U T I N E
, E N TR Y E H = S TA T U S E I T ( S ) T O L O OK F O R,
D X Z A D D R O F S T A T U S R E G
, E X I T Z E RO F L A G ON = S T A T U S F O U N D
Z E RO F L A G O F F = T I M E O U T
A H Z L A S T S T A T U S R E A D
I N A L . DX , G E T LINE CONTROL STATUS
.........................................
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 452/605
E 8 0 2E 8 0 2 E A SD 0 0 7 C R
€E06 28 C SE 8 0 8 E CE 8 0 9 8 A EOE 8 0 8 2 2 C 7E 8 DD 3 A C 7E B O F 74 OBE 8 1 1 E 2 F5E 8 1 3 F E C BE 8 1 5 75 E FE 8 1 7 O A FFE 8 1 9E 8 1 9 C 3E 8 1 AE B A
E 8 1 AE B I A 80 4 0E 8 1 C E 6 4 3E 8 1 E 50 ,
E 8 1 F 58E 8 2 0 E 4 4 1E 8 2 2 8 A EOE 8 2 4 50E 8 2 5 58E 8 2 6 E 4 4 1E 8 2 8 86 C 4E 8 2 A C 3E828E 8 2 E
E E 2 E E 9 1 3 DD R
UAITJORJTATUS PROC NEAR
UFSO S UB CX ,CXU F S l I N A L , D X , G E T S T A T U S
HOV E L , R S 2 3 2 - T I H - O U T C D I l , L O A D O U T ER L O O P C OU NT
HOV A H,A L , HOV E TO A HA N 0 A L , BH , I S O L A T E B I T S T O T E S TC HP A L , B H , E X A C T L Y = TO HA S KJ E U FS JN D , R E T U R N U I T H Z E RO F L A G O NL OO P U F S l , T R Y A G A I ND E C B LJ N Z U F S OOR BH,BH , S E T Z E RO F L A G O F F
UFS-ENDR E T
UAITJORJTATUS ENDPR S 2 3 2 - 1 0 E N D P
, T H I S R O U T IN E U I L L R EA D T I M E R 1 T H E V A L U E R EA D IS R E TU R NE D I N A X
..................................................................
. . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . .~EAD-TIHE PROC NEAR
H O V A L . 4 0 H , L A TC H T I H E R IOUT T IH-CTL , A LP US H A X , U A I T FOR 8 2 5 3 T O I N I T I T S E L FPOP AXI N A L ,T IM E R +I . READ LSBHOV AH,AL , S A V E I T I N H I G H BY TEP U S H A X , U A I T F O R 8253 TO I N I T I T S E L FP OP A XI N A L. T I H E R + I , READ HSBX CHG A L ,A H , P U T B Y T E S I N P R OP ER O R DE RR E T
ORG OE 8 2 E H
JHP NE A R P TR K E Y B OA RD- IO
READJ I HE E NDP
..................................................................,AS YNCHRONOUS COH HU NICA TIDN S A DA P TER P OUE R ON DIA GN OS TIC TE S T, D E S C R I P T I O N, T H I S S U B R O U T I N E P ER FO R HS A T H OR OU GH C HE C K OU T O F A N I N S 8 2 5 0 L S I, C H I P, T H E T E S T I N C L U D E S, 1) I N I T I A L I Z A T I O N O F T H E C H I P T O A SS UM E I T S H A ST E R R E SE T S T A TE, 2 ) R E A D I N G R E G I S T E R S F O R K N O UN P ER H A N EN T Z ER O B I T S, 3 ) T E S T I N G T H E I N S 8 2 5 0 I N T E R R U P T S Y ST E H AN D T H AT T H E 8250, I N T E R R U P T S T R I GG E R A N 8 2 5 9 ( I N T E R R U P T C O N T RO L L E R) I N T E R R U P T, 4 ) P E R F O R H I N G T H E L D O P B A C K T E S T, A ) T E S T I N G U H AT U A S U R I T T E N / R E A O A N D T H A T T H E T R A N S H I T T E R
H O L D I N G R E G E H P T V E I T A N 0 T H E R E C E I V E R I N T E R R U P T U OR KP R O P E R L Y
A R E ‘ L O O PE D B A C K ’ T O T H O SE I N T H E D A T A S E T S T A T U SRE G1 S TE R
T E S T IS F I N I S H E D
, 8) T E S T I N G I F C E R T A I N B I T S O F T H E D A T A S E T C O NT RO L R E G I S T E R
, C ) T E S T I N G T H A T T H E T R A N S H IT T E R IS I D L E U H EN T R A N S H I S S I O N
, T H I S S U B R O U T I N E E X P E C T S TO H A V E T H E F O L L O U I N G P A R A H E T E R P A S S E D, ( D X ) = A D DR E SS O F T H E I N S 8 2 5 0 C A R 0 T O T E S T, N O T E T H E A S S U H P T I O N H A S B E E N H A D E T H A T T H E H O D E H A D A P T E R IS
, I T R ET UR NS, ( C F ) = 1 I F A NY P O R T I O N OF T H E T E S T F A I L E D
, ( 8 x 1 = F A I L U R E K E Y F O R E RR OR H ES S AG E ( O N L Y V A L I D I F T E S T F A I L E D ), (EH) = 2 3 H S E R I A L P R I N T E R A DA PT ER T E S T F A I L U R E
, ( E L ) E 2 P ER H AN E NT Z ER O B I T S I N IN T E R R U P T E N A B L E R E G I ST E R
---- L O CA T ED A T 0 3F B H , T H E S E R I A L P R I N T E R AT 0 2 F 8 H
= 0 I F T E ST P AS SE D
= 2 4 H H O DE H A DA PT ER T E S T F A I L U R E
U E R E I N C O R R E C T
R E G I S T E R U E R E I N C O R R E C T
U E R E I N C O R R E C T
UE RE INCORRE CT
( T H E I N T E R R U P T U A S N O T G E N E R A T E D )
3 P ER H AN EN T Z ER O B I T S I N I N T E RR U P T I D E N T I F I C A T I O N
4 P ER H AN E NT Z ER O B I T S I N D A T A S E T C ON T RO L R E G I S T E R
5 P ER MA NE NT Z ER O B I T S I N T H E L I N E S T A T U S R EG I S T ER
6 R E C E I V E D D A T A A V A I L A B L E I N T E R R U P T T E S T F A I L E D
16H R E C E IV E D D A T A A V A I L A B L E I N T E R RU P T F A I L E D T O C L EA R7 R E SE R V ED F O R R E P O R T I N G T H E T R A N S H I T T E R H O L D I N G
R E G I ST E R E H P TV I N T ER R U P T T E ST F A I L E D( N O T U SE D A T T H I S T I H E B E C A US E OF T H E D I F F E R E N C E SB ET WE EN TH E 8 2 5 0 ’ 5 U H I C H U I L L B E U SE D )
1 7 H T R A N S H IT T E R H O L D I N G R E G E H P T V I N T R F A I L E D TO C L E AR8-8 R E C E I VE R L I N E S T AT U S IN T E R R U P T T E S T F A I L E D
( T H E I N T E R R U P T U A S N O T G E N E RA T E D)8 - OVERRUN ERROR9 - P A R I T Y E R R O RA - FRA MING E RRORE - B RE A K INT E RR UP T ERROR
18-18 R E C E I VE R L I N E S T A T U S I N T E R R U P T F A I L E D T O C L EA RC - F H O DE H S T A T U S I N T E R R U P T T E S T F A I L E D
( T H E I N T E R R U P T U A S N O T G E N E R A T E D )
C - DE L TA CL E A R TO S E ND E RRORD - DE L TA DA TA S E T RE A DY E RRORE - T R A I L I N G E DG E R I N G I N D I C A T O R E RR ORF - D E L T A R E C E I V E L I N E S I G N A L D E T E C T ER RO R
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 453/605
= 0 0 8 4
E 8 3 1
E 8 3 1 1 EE 8 3 2 E 4 2 1E 8 3 4 50E 8 3 5 O C 0 1
E 8 3 7 E 6 2 1E 8 3 9 9 C
E 8 3A 5 2E 8 3 8 E 8 I 3 8 8 R
E 8 3 E E 8 O A C 4 RE 8 4 1 73 03E 8 4 3 E 9 E 9 4 8 R
E 8 4 6 B F 0 0 4 1 RE 8 4 9 33 F 6E 8 4 B 80 F E 0 2E 8 4 E 75 0 2E 8 5 0 4 6E 8 5 1 4 7
E 8 5 2 E 8 E 6 F 5 RE 8 5 5 F E C 3E 8 5 7 4 2
E 8 5 8 B O 0 1
E 8 5 A E EE 8 5 8 53E 8 5 C 8 3 C 2 0 4E 8 5 F 8 4 0 1
E 8 6 1 BE 0 4 0 0
E 8 6 4 E 9 0003E 8 6 7 E 8 OA F8 RE 8 6 A 58E 8 6 8 3 C F FE 86 D 7 4 3 6E 8 6 F E 8 E 7 0 6 RE 0 7 2 72 33E 8 7 4 4 AE 8 7 5 4 AE 0 7 6 E CE 8 7 7 4 2E 8 7 8 4 2E 8 7 9 E B E 7 1 9 RE 8 7C 7 3 03E 8 7 E E 9 E 9 4 8 R
I C - I F1 0 H
1 1 H
1 2 H
13H
1 4 H
1 5 H
. O N E X I T .
M OD EM S T A T U S I N T E R R U P T F A I L E D T O C L E ARA N 8 2 5 0 I N T E R R U P T O CC U RR ED A S E X P E C T E D , B U T NO8 2 5 9 ( I N T R C O N T RO L L E R ) I N T E R R U P T WAS GE N ER A TE DD U R l N G T H E T R A N S M I S S I O N T E S T , T H E T R A N S M I T T E RH O L D I N G R E G I S T E R U A S N O T E M P TY W H EN I T S H OU LDH A V E B E E ND U R I N G TH E T R A N S M I S S I O N T E S T , T H E R E C E I V E D D A T AA V A I L A B L E I N T E R R U P T D I D N ' T O CC URT R A N S M I S S I O N E R R O R - T H E C H A R A C T E R R E C E I V E DDU RIN G LOOP MODE WAS NOT THE SAME AS THE ONET R A N S M I T T E DD U R I N G T R A N S M I S S I O N T E S T , T H E 4 D A T A S E T C O NT R OLOUTPU TS UERE NOT THE SAME AS THE 4 DATA SET
C O N T R O L I N P U T S .T H E T R A N S M I T T E R WAS N O T I D L E A F T E R T H E T R A NS -M I S S I O N T E S T C O M PL ET E D
- T H E MOD EM OR S E R I A L P R I N T E R ' S 8 2 5 9 I N T E R R U P T ( W H IC H E V E R
- T HE 8 2 5 0 I S I N TH E M AS TE R R ES ET S T A T ED E V I C E W AS T E S T E D ) IS D I S A B L E D
, ONLY THE D S R E G I S T E R IS PRESERVED - A L L O T H E R S A R E A L T E R E D________________________________________---------------
~ R A P EQU
ASSUMEUART PROC
P u s nI NP U S HOR
OUTP U S H F
P U S HC A L L
8 4 ~
CS CODE, DS D ATA
D SA L , I N T A O IAXA L , 0000000 1B ,
I NTAO I , A L
NEAR
DXDOS
L O O P B A C K T R A N S M I S S I O N T E S TI NTE RR UPT VECTOR ADDRESS( I N D I AG N O S TI CS )
C U R R E NT E N A B L E D I N T E R R U P T SS A VE FO R E X I TD I S A B L E T I M E R I N T R D U R I N G T H I S
T E S T
S A VE C A L L E R ' S F L A G S ( S A V E I N T RF L A G )SAVE BASE ADDRESS OF ADAPTER CAR0SET UP ' DA TA ' AS DATA SEGMENTADDRESS..................................................................
I N I T I A L I Z E P O R T S F O R M A ST E R R E S E T S T A T E S AN D T E S T P E RM A NE N TZ E RO D A T A B I T S FO R C E R T A I N P O R TS
C A LL 1 8 2 5 0J N C A T 1 , A L L O KJ M P A T 1 4 , A P O R T ' S Z E RO B I T S U E R E L u S ZERO'
I N S 8 2 5 0 I N T E R R U P T SY S TE M T E S TO N LY T H E I N T E R R U P T B E I N G T E S T ED W I L L B E E N A BL E D
S E T DI AND SI F OR C A L L S TO ' S U I '
XOR S 1 , S l , MODEM I NDEXCMP DH, 2 , O R S E R I A L ?J N E A T 2 , NO - I T ' S MODEMI N C SI , I T ' S S E R I A L P R IN T ERI N C DI , S E R I A L P R I N T E R 8 2 5 9 MA SK A D DR E SSR E C E I V E D D AT A A V A I L A B L E I N T E R R U P T T E S T
..................................................................
..................................................................
..................................................................
A T 1 M OV D 1 , O F F S E T I M A S K S , B A S E A D D R ES S O F I N T E R R U P T M A S K S
A T 2 : C A L LI NCI C
MOV
OUTP U S HADDMOVMOVMOVC A L LPOPCMP -J EC A L LJ CDECDECI NI NCI NCC A L LJ N CJMP
sil I
E LD X
A L , I
DX, ALEXD X , 4AH, 1
E X , 0 4 0 0 H
I C TE XAL, OFFHA T 4C 5 0 5 9A T 5DXDXAL, DXD XDXW 8 2 5 0 CA T 3A T 13
cx,3
S E T U P FO R I N T E R R U P T SERR OR R EP OR TE R ( I N I T . I N 1 8 2 5 0 )P O I N T T O I N T E R R U P T E N A B L EREG1 STERE N A B L E R E C E I V ED D A T A A V A I L A B L EI NTR
SAVE ERROR REPORTERP O I N T T O L I N E S T AT U S R E G IS T E RS E T R E C E I V E R D A TA RE AD Y B I TI N T R T O C H EC K, I N T R I D E N T I F I E RI N T E R R U P T I D R E G ' I N D E X 'P E R FO R M T E S T F O R I N T E R R U P TR E S T O R E E R R O R I N D I C A T O RI NTERRUPT ERROR OCCUR?Y E SG E NE R AT E 8 2 5 9 I N T E R R U P T ?NO
R E S E T I N T R BY R E A D I N G R E C R B U F RD O N ' T C A R E A BO U T T H E C O N T E N T S
I N T R ID REGU A I T F OR I N T R T O C L EA ROKD I D N ' T C L E A R________________________________________-----------------
, T R A N S M I T T E R H O L D I N G R E G I S T E R E M PT Y I N T E R R U P T T E S TT H I S T E S T H A S B E EN M O D I F I E D B E CA US E T HE D I F F E R E N T 8 2 5 0 ' 5T H A T M AY B E U S E D I N P R O D U C IN G T H I S P R OD UC T D O N O T F U N C T I O N
T H E SA M E D U R I N G T H E S TA N D A RD T E S T O F T H I S I N T E R R U P T( S T A N D A R D B E I N G T H E S A ME M E T HO D F O R T E S T I N G T H E O T H ERP O S S IB L E 8 2 5 0 I N TE R R U PT S ) I T IS S T I L L V A L I D F OR T E S T IN GI F A N 8 2 5 9 I N T E R R U P T IS G E NE R AT E D I N R ES P ON S E TO T H E 8 2 5 0I N T E R R U P T AN D T H A T T H E 8 2 5 0 I N T E R R U P T C L E A R S A S I T S HO UL D
I F T H E T R A N S M I T T E R H O L D I N G R E G I S T E R E M PT Y I N T E R R U P T IS NOTGENERATED WHEN THAT I NTE RR UPT IS E NA BL ED , I T IS NOT TREATEDA S A N E R RO R H O WE VE R. I F T H E I N T E R R U P T IS G E NE R AT E D, I TM U S T G EN E R A TE A N 8 2 5 9 I N T E R R U P T AN D C L E AR P R O P E R L Y T O P A S ST H I S T E S T
..................................................................
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 454/605
€881 €8 E 6 F 5 RE 6 6 4 F E C 3E B B 6 4 A
E B B 7 BO 0 2
EBBS EEEBBA EB 00E 8 8 C 42E BB 0 2 8 C 9E B B F E CE890 3c 0 2E 8 9 2 74 04E 8 9 4 E 2 F9
E 8 9 6 EB11
E898€898 EB E 7 0 6 REB9B 7 2 OA€ 8 9 0 E 8 E 7 1 9 R
EBAO 73 07E B A 2 E9 E 9 4 8 R€BAS E B 7 EE B A 7 E E 7 A
E B A 9 4 A
€ B A A BO 04E B A C E EEBAD 83 C 2 04E B B 0 89 0003€ 8 8 3 B O 0004
E B B 6 84 02E888 EB E 6 F 5 REBBE F E C 3EOEO 53E B B € E B 0601E B C l E8 OAFS R
E B C 4 58€ I C 5 24 IfE B C 7 3 A C 4E B CS 75 SAE B C B E 8 E706 REBCE 72 I 3€ 8 0 0 83 EA 0 3€ 8 0 3 EB E 7 1 9 RE806 72 70E808 40E809 74 07EBDE DO E4EBDD 83 C 2 03EBEO EB 06
E B E 2 83 C 2 04EBES EC
€ B E 6 EB 00E B E B 83 E A 05
EBEB EO OBEBED EE
E B F l 89 0004E B F 4 E D 0004E B F 7 84 01
E B F 9 E8 E 6 F 5 RE B F C F E C 3E B F E 53E B F F BB 0001
E 9 0 2 E8 O A F 8 RE 9 0 5 SBE 9 0 6 2 4 O F
E90A 75 19E 9 0 C E8 E 7 0 6 RE 9 0F 7 2 1 2E911 83 E A 04
E e E E e3 c2 05
€ 9 0 8 3~ c4
A T 3
A T 3 1
A T 3 2
A T 4A T 5
C A L LI NCDEC
MOV
OUTJMPI NCSUBI NCMPJ ELOOP
JMP
C A ~ L
J CC A L L
J NCJMPJMPJMP
S U IB LOX
AL, 2
OX, AL* *2OX
AL, OXAL, 2A T 3 2A T 3 I
SHORT AT6
cx, c x
c5059A T 5U B 2 5 0 C
A T 6AT 13S H O R T A T 1 1 ;
SHORT AT10
SET UP FOR INTERR UPTSBUMP ERROR REPORTERP O I NT T O I NT E RRUP T E NA B LEREG1 STERENABLE XMITTER HOLDING REG EMPTYI NTR
I10 DE LA YI N T R I D E N T I F I C A T I O N REG
READ I TXMITTER HOLD ING REG EMPTY IN TR?YES
T HE I NT R D I DN ' T O CCUR - TRY NEXTT E S TT HE I NT R D I D O CCURG E NE RA T E 8259 I NT E RRUP T ?NOU A I T F O R THE I NT E RRUP T T O CLE A R( I T S H OU LD A L RE AD Y BE CLEARB E CA U SE ' I C T ' R EA D T H E I N T R I DREG 1I T C LE AR EDERRORAVOID OUT OF RANGE JUMPS
A T 6 : DE C
MOVOUTADDMOVMOVMOV
A T 7 : C A L LI NCPUSHMOVC A L L
POPANDCMPJ N EC A L LJ CSUBC A L LJ CDECJ ESHLADDJMP
OX
AL, 4OX, ALOX, 4cx, 3BP, 4AH, 2suIB LB XBX, 060 1 HI CT
B XAL, 000 I IA L , A HA T 1 1c5059AT 10OX, 3U 8 2 5 0 CAT I 3B PA T 8AH, 1
OX, 3A T 7
P O I NT TO I NT E RRUP T E NA B LERE G I S T E RE N A B L E R E C E I VE R L I N E ST A T U S I N T R
P O I N T TO L I N E S T A T US R E GI S T E RI N T R I D RE G ' I N D E X 'LOOP COUNTERI N I T I A L B I T TO BE TESTEDS E T UP F O R I NT E RRUP T SBUMP ERROR REPORTERSAV E I TI N T R T O C HEC K, I N T R I D E N T I F I E RPERFORM TEST FOR INTERR UPT
MASK OUT B I T S THAT DON'T MATTERT E ST B I T O N?NOG E NE RA T E 8259 I NT E RRUP T ?NOI N T R I D R EGU A I T FO R THE I N T R T O CLE A RI T D ID N ' TA L L F OU R 8 1 7 5 T E S TE D ?YES - GO ON TO NEXT TESTG ET RE ADY FO R NEX T B I TL I N E S T AT U S R E GI S TE RT E ST NE XT B I T
ATE: ADDI N
JMPSUBMOVOUTADDMOVMOVMOV
A T 9 : C A L LI NCPUSHMOVC A L LPOPANDCMPJ N EC A L LJ CSUB
OX, 4
AL, OX
.+2OX, 5AL, B
OX, ALOX, 5
cx, 4BP, 4AH, I
suE LEXBX, 000 1 HI CTB XAL, OOOOllllBAL, AHA T 1 1C S 0 5 9AT 10
DX, 4
MODEM STATUS REGISTERCLE A R DE LT A B I T S T HA T M AY BE ONBECAUSE OF DIFFERENCES AMONG8 2 5 0 ' 5 .I10 DE LA YI NT E RRUP T E NA B LE RE G I S T E RENABLE MODEM STATUS INTERRUPT
POINT TO MODEM STATUS REGISTERI N T R I D REG ' I N D E X 'LOOP COUNTERI N I T I A L B I T TO B E T E S T E D
SET UP FOR INTERR UPTSBUMP ERROR INDICATORSA VE I TI N T R TO C HE CK , I N T R I D E N T I F I E RPERFORM TEST FOR INTERR UPT
MASK OUT B I T S THAT DON'T MATTERT ES T B I T O N?NOG E NE RA T E 8259 I NT E RRUP T ?NOI N T R I D R EG
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 455/605
E 9 1 4 E 8 E 7 1 9 RE 9 1 7 7 2 2 FE 9 1 9 4DE 9 1A 7 4 DE
E 9 1 C DO E 4E 9 1 E 83 C 2 04
E 9 2 1 E E 0 6
E 9 2 3 E3 10
E 9 2 5 E 8 2 4
E 9 2 7 4 2E 9 2 8 E 8 F 0 8 5 R
E 9 2 E E3 C 2 0 4E 9 2 E E CE 9 2 F E E 00
E 9 3 1 OC 10
E 9 3 3 E EE 9 3 4 E E 00E 9 3 6 42E 9 3 7 4 2E 9 3 8 E C
E 9 3 9 E E 00E 9 3 E E3 E A 06E 9 3 E E C
E 9 3 F 4 2E 9 4 0 EO 00
E 9 4 2 CD E 4E 9 4 4 81 00E 9 4 6 73 05E 9 4 8 EO C 3 10
E 9 4 E B 1 01
E 9 4 D 5 AE 9 4 E 53E 9 4 F E 8 O AC 4 RE 9 5 2 5 8E 9 5 3 2 E : 8 A 2 5E 9 5 6 2 0 2 6 0 0 8 4 RE 9 5 A 80 F 4 F FE 9 S D E 4 2 1
E 9 5 F OA C 4E 9 6 1 E 6 2 1E 9 6 3 9 D
E 9 6 4 OA C 9E 9 6 6 7 4 OCE 9 6 8 E 7 2 4E 9 6 A EO F E 0 2E 96 D 7 5 0 2E 9 6 F 87 2 3E 9 7 1 F9E 9 7 2 E E 0 1
E 9 7 4 F 8E 9 7 5 5 8E 9 7 6 E 6 2 1E 9 7 8 I FE 9 7 9 c3E 9 7 AE 9 8 7E 9 8 7 E 9 1 5 6 1 R
, CURRENT STATE, l l 0 D E L A Y, S E T B I T 4 O F D A T A S E T C O NT RO L R E G
, 110 DELAY
, MODEM STATUS REG, C L E AR P O S S I E L E M O DE M S T A T U S, I N T E R R U P T U H I C H C O UL D B E C AU SE D, B Y T H E O U TP U T B I T S B E I N G L O O PE D
, TO TH E IN P U T B I T S, I10 D E L A Y, R E C E I V E R B U F F E R, DUMMY READ TO CLEAR DATA READY, B I T I F I T U EN T H I G H ON U R I T E TO, MCR
_____________--__--_----------------_-T E S T
ADDI NJMPOROUTJMPI NCI NCI N
DX, 4AL, DXs + 2A L , 000 O O O O E
DX, ALs + 2DXDXAL, DX
J M P S + 2S U B D X . 6I N A L,D X
PERFORM THE LOOP BACK
I N C D X ; I N T R E N E L R E GM O V A L . 0 , S E T F OR I N T E R N A L U R A P T E S T
I N T U R A P , 00 L O O P B A C K T R A N S M I S S I O N T E S Tnov C L . 0 ; ASSUME NO ERRORSJ N C A T 1 5 ; URAP TEST PASSED
A T 1 3 : A DD E L , I O H , E R R O R I N D I C A T O R
AN ERROR UAS ENCOUNTERED SOMEWHERE DU RIN G THE TE ST
A T 1 4 : M DV C L , 1 , S ET F A I L I N D I C AT O R
H O US EK EE PIN G R E - I N I T I A L I Z E T HE E 2 5 0 P OR TS ( TH E L OO P B I TU I L L B E R E S E T ) , D I S A B L E T H I S D E V I C E I N T E R R U P T , S E T U PREG I STE R EH I F AN ERROR OCCURRED, AND SET OR RESET THECARRY FLAG.
A T 1 5 P O PP U S HC A L LPOPMOVANDXORI NOROUTP O P F
ORJ EnovCMPJ N EMDV
A T 1 6 S T CJ M P
A T 1 7 C L CA T 1 8 P O P
OUTPOPR E T
ORGJ M P
UART ENDP
DXE XI 2 5 0E XAH,CS C D I I ,I NTR-FLAG, AH ,AH, OFFHA L , I TAO IA L , A HI N T A O I , A L
CL , CLAT 17E H , 2 4 HDH, 2A T 1 6BH, 2 3 H
S H O R T A T 1 8
AXI NTAO 1, A LD S
O E 9 8 7 HNEAR PTR KE- I NT
G ET B A S E A D D R ES S O F 8 2 5 0 A D A P TE RSAVE ERROR CODER E - I N I T I A L I Z E E 2 5 0 PO RTS
G E T D E V I C E I N T E R R U P T MA SKC L EA R D E V I C E ' S I N T E R R U P T F L A G B I TF L I P B I T SG ET C U R R E N T I N T E R R U P T P O RTD I S A B L E T H I S D E V I C E I N TE R R U PT
R E - E S T A B L I S H C A L L E R ' S I N T E R R U P TF L A G
ANY ERRORS?NOASSUME MODEM ERROROR IS I T S ER IA L?I T ' S M ODEMI T ' S S E R I A L P R IN T E RS E T C A RR Y F L A G T O I N D I C A T E E RR O R
R E S E T C A R R Y F L A G - NO ERRORSR E S TO R E E N T R Y E N A B LE D I N T E R R U P T SD E V I C E I N T R S R E - E S T A B LI S H E DR E S T O R E R E G I S T E R
-................................................, NEC-OUTPUT
T H I S R O U T I N E S E N D S A B Y T E T O T H E N E C C O NT R O LL E R
A F T E R T E S T I N G F O R C O RR EC T D I R E C T I O N A ND C O N T R OL L ER R E A D YT H I S R O UT IN E U I L L T I M E OUT I F T HE B Y T E IS NOT ACCEPTEDU I T H I N A R E AS O N A B LE A MO UN T O F T IM E , S E T T I N G T HE D I S K E T T ES T A T U S O N C O M P L E T I O N
( A H ) B Y T E T O B E O U T PU T
CY 0 SUCCESSCY I F A I L U R E -- D I S K E T T E S T A T U S U P D A T E D
, I N P U T
, OUTPUT
I F A F A I L U R E H A S OC CU RR ED , T H E R ET U RN IS MADE ONEL E V E L H I G H E R T H A N T H E C A L L E R O F N E C - O U T P U TT H I S R E M OV ES T H E R E Q U I R E M E N T O F T E S T I N G A F T E R E V E R YCALL OF NEC-OUTPUT
( A L ) D E S T R O Y E D____________________------_--__---_---__---------
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 456/605
E 9 8 A
E S B A
E988E 9 0 CE S B FE 9 9 IE 9 9 2E 9 9 4E 9 9 6E S S EE 9 9 8E 9 9 0E S S EE 9 9 F
E S A OE 9 A 1
E S A 2E 9 A 4E 9 A 5E 9 A 7E S A 9E S A BESADESADE S A F
E 9 8 0E S B 1
E 9 B 2E S B 3E S B 4
E S B 4E S B 4E 9 8 5E 9 8 6E 9 8 8
E S B A
E S B CESCO
E S C ZE S C 3E S C S
E S C 0E S C AESCDE S C FE 9 0 2E 9 0 4E 9 0 7E S D SE S D B
ESDCESDD
E S D EESEOE S E I
525 1B A 0 0 F 433 CSE tA B 4074 ocE 2 F S
00 OE 0 0 4 1 R B O59
SA50
FSc333 CSE CA 0 B O75 04
E2 F9E B E B
OA C442
E E595 Ac3
I E5628 CO32 F F
OE 0 0
CS 36 0070 RD I E B
9cOA 2083 F B 0 1
75 05BO CC 0 1EB OC83 F B OA75 0700 F C 047 0 020 4 0 49 0
5 EI F
7 2 AAc3
NEC-OUTPUT
P U S HP U S H
novXOR
J 2 3 : I NT E S TJ ZLOOP
ORPOPPOPPOP
S T CR E T
J 2 5 . X O RJ 2 6 : I N
J 2 4
T E S TJ N ZLOOPJ M P
novI N C
OUTPOPPOPR E T
J 2 7 :
PROC NEAR
D X
cxOX, NEC-STAT
AL, OXA L , D I OJ 2 5J23
CX, cx
DIS K E TTE JTA TUS ,cxOXAX
CX, cxAL, OXAL, RQMJ27
J 2 6J 2 4
AL, AHOX
OX, ALcxOX
; S A V E R E G I S T E R S
, S T A T U S P O R T, COUNT FOR T IME OUT, G E T S T A T U S, T ES T D I R E C T IO N B I T, D I R E C T I O N O K
TINEJRROR;I ME-OUT
, SET ERROR CODE AND RESTORE REGS, D I S C A R D T H E R E T U R N A D D R E S S
, I N D I C A f E ER RO R TO C A L L E R
, RESET THE COUNT, G E T T H E S T A T U S, IS I T R EA DY ', YES, GO OUT PUT, COUNT DOWN AND TRY AGAIN, E R R O R C O N D I T I O N
, GE T B Y TE TO OUTP UT, D A TA P OR T I S 1 GREATER THAN, S T A T U S P O R T, OUTP UT THE B Y TE, R E C O V E R R E G I S T E R S
, CY = 0 F R O M T E S T I N S T R U C T I O N
, OUTPUT
NEC-OUTPUT ENDP
; GET-PARM; T H I S R O U T I N E F E T C H ES T H E I N D E X E D P O I N T E R F R OM; THE DIS K -B A S E B L OCK P OIN TE D A T B Y THE DA TA; V A R I A B L E D I S K - P O I N T E R; A B Y T E F R O M T H A T T A B L E IS THE N MOV ED I N TO A H,; T H E I N D E X O F T H A T B Y T E B E I N G T H E P A RM I N OX; E N T R Y --; 0L I N D E X ' O F B Y T E TO B E F E T C HE D It 2
.------------------------------------------
I F THE L O U B I T OF E L IS ON, THE BY TE IS I M M E D I A T E L YOUTPUT TO THE NEC CONTROLLER
; E X I T --; A H = THA T B Y TE FROM B L OCK; E X = DESTROYED.___________________-------------------------
G E T - P A R ~P U S HP U S HSUBXOR
novASSUMEL D SSHR
P U S H FnovCMP
J N ZORJMP
J 2 7 - 1 : C M PJ N ECMPJGEnov
POPPOPASSUMEJ CR E T
J 2 7 - 2 : P O P F
GET-PARM
PROC NEAR0 sSIAX, AXBH, BH
OS, AXO S A B S 0SI, I SK-POI NTER ,EX, I
A H , t S I + B X I ;
0x, I
J 2 7 - 1AH, I
S HORT J2 7 -2E X , 10
J 2 7 - 2AH, 4J 2 7 - 2AH, 4
SI0 sOS DA TANEC-OUTPUT ;
ENDP
SAVE SEGMENTS A V E R E G I S T E RZERO TO AXZERO BH
P O I N T T O B L O C KD I V I D E E X B Y 2, A ND S E T F L A G F O RE X I TS A VE OU TP UT B I TGE T THE B Y TEIS T H I S T H E P A R M W I T H D M AI NO I CATOR
TURN ON NO D MA B I T
MOTOR S TA RTUP DE L A Y ?
GREATER THA N OR EQ UA L TO 112 SEC?YES, OKAYNO, FORCE 112 S E COND DE L A YG ET OU T PU T B I T
R E S T O R E R E G I S T E RRESTORE SEGMENT
I F F L A G S E T , O U T PU T T O CO N T RO L L ERR E T U R N TO C A L L E R
...................................................., BOUND-SETUP, T H I S R O U T I N E S ET S U P B U FF E R A DD R ES S IN G F O R R E A D / U R I T E / V E R I F Y, O P E R A T I O N S, I N P U T
E S H A S O R I G I N A L B U F F E R S EG H E NT V A L U E0 P P OI NT S A T B A S E OF S A V ED P A RME TE RS ON S TA CK
E S H A S S EG M EN T W H I C H U I L L A LL OW 6 4 K A C C ES S T H EC O M B I N A T I O N E S D I AND OS SI P O I N T TO T H E B U F F E R T H I S
C A L C U L A T E D A D D R E S S W I L L A L W A Y S A C C E S S 6 4 K OF MEMORYEX DESTOYED
, OUTPUT
....................................................
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 457/605
ESE1
EBE l 5 1E 9 E 2 EE 5E OCE S E 5 53E S E 6 8 1 04E S E E 03 E E
E SE A E C C l
E S E C 03 CEE S E E B E C lE S F O 5E
E S F l E 1 E3 OOOFE S F S EE F3E S F 7 BE FEE S F S 59E S F A C 3E S F E
E S F EE S F E 56E S F C 53ESFD 5 1E S FE B E 0 0 7 4 RE A 0 1 EO 0 1E A 0 3 E A CAE A 0 5 E 1 E1 OOFFE A 0 9 03 F lE A OE 0 2 CO
E A 0 0EAOEE A 1 1E A 1 2E A 1 6
E A 1 8E A I CE A I FE A 2 1
E A 2 3E A 2 6E A 2 8
E A 2 EE A 2 EE A 3 0
E A 3 3E A 3 5E A 3 7E A 3 9E A 3 EE A 3 EE A 4 0E A 4 3E A 4 5E A 4 8
59BE E A 6 6 R53E 4 06 OO3E R75 18
0 8 06 0 0 3 E REO 3c 0074 12
E 4 07E E E S E A RE A E 2E 8 E S E A R
E E E A 6 F R7 2 39C 6 04 00
BA 042 A C S74 2 cE 4 O F€ 8 E S E A RE A E 2E E E S E A RE A E 5E E E S E A RE E E A 6 F R
E A 4 8 S CE A 4 C 5 1E A 40 E 3 1 2E A 4 F E E E S E 4 RE A 5 2E A 5 2 89 0226E A S S OA E 4E A 5 7 74 06E A 5 9 E 2 F EE A S E F E CCE A 5 0 E E F3E A S F 59E A 6 0 S O
E A 6 1 72 06E A 6 3 BE 2 CE A 6 5 58E A 6 6E A 6 6 58E A 6 7 5 EE A 6 8 C 3E A 6 9 C 6 04 FF
E A 6 C 5E
E A 6 0 E E F7E A 6 F
BOUND-SETUPPUSHnovPUSHnovSHR
nov
ADDMOVPOP
ANDMOVMOVPOPRET
BOUNDJETUP
PROC NEARcxE X , C E P + 1 2 1 ,EXCL, 4BX, CL
CX, ES
cx, 0xES, CXEX
EX, OOOOFHS I , E XD I , E Xcx
ENDP
S A V E R E G I S T E R SGET OFFSET OF BUFFER FROM STACKSAVE OFFSET TEMPORARILYS H I F T C O U N TSHIFT OFFSET FOR NEU SEGMENTVALUEP U T E S I N R E G IS T ER S U I T A B L E F ORADDING TOGET NEU VALUE FOR ESUPDATE THE ES REGIST ERR E C O V E R O R I G I N A L O F F S E T
NEU OFFSETD S : S 1 P O I N T AT B U F FE RE S : D I P O I N T A T B UF FE R
POPMOVPUSHT E S TJ N Z
ORCMPJ ZnovC A L Lnov
...................................................; SEEK
T H I S R O U T I N E WILL MOVE THE HEAD ON THE NAMED DRIVETO THE NAMED TRACK, I F THE DRI VE HAS NOT BEEN ACCESSEDS I N C E T H E D R I V E R E S E T C OM MAND U A S I S S U E D , T H E D R I V E U l L L B ER E C A L I E R A T E D .
( D L ) D R I V E TO S E EK ON( C H ) = TRACK TO SEEK TO
CY = 0 SUCCESSCY = 1 F A I L U R E -- DISKETT E-STATUS SET ACCORDINGLY
( A X ) D ESTROVED
; I N P U T
; OUTPUT
.-__--_--_--_------_-----------------------------------hEEK PROC NEAR
P US H S I ; S A V E R E G I S T E RP U S H E X ; S A V E R E G I S T E RPUSH CXMOV SI ,O FFSE T TRACK0 ; E A S E O F C UR RE N T HE A D P O S I T I O N SMOV AL, 1 ; E S T A B L I S H MA SK F O R R E C A LMDV CL,DL ; U S E D R I V E A S A S H I F T C O UN TAND CX,OFFH ; M A SK O F F H I G H B Y T EA D D S l , C X ; P O I N T SI AT CORRECT DRIVER O L A L C L ' GET MASK FOR DRIVE
.------ SI C O N T A I N 6 O F FS E T F OR C bR R E CT D R I V E , A L C O N T A I N S B I T MA SKI N P O S IT I O N 0 , l OR 2
cx ; RESTORE PARAMETER REGISTERE X . O F F S E T J 3 2 : SET UP ERROR RECOVERY ADDRESS
C A L LHEAD ISC A L L
.------J CMOV
, ' D R I V E ISJ 2 E : M O V
SUBJ ZuovC A L LMOV
. -----
ex' ~ ~~ ; NEEDED FOR ROUTINE NEC-OUTPUTSEEK-STATUS,AL ; T E S T D R I V E F O R R E C A LJ28 ; NO-RECAL
SEEK-STATUS,AL ; T UR N ON T HE N O R E CA L B I T I N F LA GB Y T E P T R C S I 1 , O ; LAST REFERENCED TRACKZO?J 2 E ; YES IGNORE RECALAH. 0 7 H ; RECALIERATE COMMANDNEC-buTPUTAH. D L ; R EC A L R E W I R E D O N D R I V E I N D L,NEC OUTPUT . OUTPUT THE DRIVE NUMBERMOVTNG TO CORREC; TRA CKCHK-STAT-2 ; G E T T HE S T A T U S O F R E C A L I E R A T EJ32-2 ; SEEK-ERRORB Y T E P T R C S I 1 , OI N SYNCH U l T H CONTROLLER, SEEK TO TRACKA L , E Y T E P T R C S I I ;
A L . C H~ 3 i - iAH. OFHNEC OUTPUTAH, FL
C A L L ' NEC-OUTPUT
MOV AH.CHC A L L NEC-OUTPUTCALL CHK-STAT-2
;-----U A I T F O R HE AD S E T T L EP U S H FPUSHnovC A L L
MOVORJ Z
D ECJ M P
J31: POPP O P F
J CMOVJ31-I: POPJ32:
POPPOPR E T
J32-2 : MDV
POPJMP
J29:
J30: LOOP
SEEK ENDP
cxB L 18GEi-P ARM
cx, 550AH, AHJ31J30AHJ 2 SC X
J32-2B Y T E P T R C S I 1. CHE X
E X51
GET THE PCNGET SEEK-UAIT VALUEALREADY ON CORRECT TRACKSEEK COMMAND TO NEC
DRIVE NUMEER
TRACK NUMBER
GET E N D I N G I N T E R R U P T A N D ' S E N S ES T A T U S
S A V E S T A T U S F L A G SS A V E R E G I S T E RHEAD SETTLE PARAMETER
HEAD-SE TTLE1 MS LOOPT E S T FO R T I M E E X P I R E D
DELAY FOR 1 MS ,
DECREMENT THE COUNTDO I T SOME MORERESTORE REGISTER
G E T R I D OF DUMMYSEEK-ERRORRESTORE REGISTERUPDATE CORRECT '
; RETURN TO CALLE RB Y T E P T R t S 1 3 , O F F H ; UNKNOUN STATUS
; O P E R A T I O NE X ; GET R I D OF DUMMYS HO RT J 3 2
RETURN
AEOUT SEEK
RETURN
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 458/605
E A 6 F
E A 6 FE A 7 0E A 7 I
E A 7 3
E A 7 6E A 7 7E A 7 9E A 7 CE A 7 F
E A 8 IE A 8 4E A 8 6
E A 8 8E A 8 9
€ 1 8 8E A 9 0
E A 9 I
E A 9 2E A 9 3E A 9 4
E A 9 5
E A 9 9E A S EE A A O
€ 1 9 7
535633 DE
BE E A 8 8 R
56
84 OBE B E 9 8 A RE B E A A O R7 2 10
A 0 O D 4 2 RAB 2075 OD
4875 E C
BOOE 0041 R
BOF9
S E5 E5Bc3
24 CO74 F BBO 06 OO A l R 4 0E B F O
E A A OE A A OE A A IE A A 4E A A 5E A A 6E A A 7
E A A 9E A A SE A A B
E A A EE A A EE A A FE A 8 IE A 8 3E A 8 5E A B AE A B A
E A B BE A B CEABDE A B E
E A B FEACO
E A C 2E A C 4E A C 4E A C S
E A C BE A C BEACCEACDE A C FEADOE A D 3E A D 5E A D 6E A D 7€ A D 9E A D BEADDE A D F
F CB F 0 0 4 2 R5 1
5 25383 07
33 c9E A 00F4
ECA B BO75 ocE 2 F 9BO OE 0041 R BO
F 9
58
5 A59
c3
E CA B 407 5 07
BO OE 0 0 4 1 R 2 0E B E F
42E C
4789 OOOAE 2 F E4 AECA 8 10
74 EOF E C B75 CAE B E 3
Be 05
..................................................., CHK-STAT-2
T H I S R O U T I N E HA N D L ES T HE I N T E R R U P T R E C E I V E D A F T ERA RE C A L IB RA T E , S E E K , OR RE S E T TO THE ADA P TE RT H E I N T E R R U P T IS U A I T E D F O R, T H E I N T E R R U P T S T A T U S SE N SE D ,A ND THE RE S UL T RE TURNE D TO THE CA L L E R
NONE
CY = 0 SUCCESSCY = 1 F A I L U R E -- ERROR IS I N D I SK E TT E -S T AT U S( A X ) D E S T R O Y E D
, I N P U T
, OUTPUT
....................................................kHK-STAT-2 PROC NEAR
P U S H E X , S A V E R E G I S T E R SP U S H SIXOR BX,BX , NUMBE R OF S E NS E INTE RR UP T S TO
HOV S 1 , O F F S E T J33-3 , SET UP DUMMY RETURN FROM
P U S H SI , P U T ON S T A C K
CALL NEC-OUTPUT , I S S U E S E N S E I N T E R U P T S T A T U SC A L L R E S U L T SJ C J35 , N E C T I M E O UT , F L A G S S E T I N
, R E S U L T SHDV AL,NEC-STATUS , GE T S TA TUSTEST AL,SEEK-END , IS S E E K OR RE C A L OP E RA TION DONE 7J N Z J35-I , J U M P I F E X E C U T I O N O F SE E K OR
, I S S U E
, NEC-OUTPUT
J33-2 HOV AH,OBH , S E N S E I N T E R U P T S T A T U S
, RECAL DONEJ33-3 DE C B X , DEC LOOP COUNTER
J N Z J33 2 DO ANOTHER LOOPOR D I
S~TETTE-STATUS,I ME-OUT
J34 S T C , R E T U R N E RR OR I N D I C A T I O N FO R
J35 POP SI , R E S T O R E R E G I S T E R S, C A L L E R
POP SIP OP B XR E T
----- E E K E ND HA S OCCURE D, CHECK FOR NORMAL TE RM INA TIO Nh 5 - 1 AND AL,OCOH , M AS K NO RM AL T E R M I N A T I O N B I T S
J Z J35 , JUMP I F N O R M A L T E R M I N A T I O N
OR D I SKETTE-STATUS, BAD-SEEKJ M P J34
CHK-STAT-2 ENDP
, R E S U L T S
..............................................
T H I S R O U T I N E U l L L R E AD A N Y T H I N G T H A T T H E N EC C O NT RO L LE RH A S T O S A Y F O L L O U I N G A N I N T E R R U P TI T IS ASSUMED THAT THE NEC DATA PORT = N E C S T A T U S P O R T + 1
NONE
CY = 0 S UCCE S S FUL TRA NS FE R
, I N P U T
, OUTPUT
CY = I F A I L U R E -- T I M E O UT I N U A I T I N G F OR S T A TU SN E C -S T AT U S A R EA H A S S T A T U S B Y T E L O A DE D I N T O I T( A H ) D E S T R O Y E D
________________________________________-------~ E S U L T S ROC NEAR
C L DMOV D1 ,OFFS E T NE C-STA TUS P OIN TE R TO DA TA A REAP US H CX , SAV; COUNTERP US H DXP U S H B XMOV B L ,7 MAX S TA TUS B Y T E S
------ UAIT FOR REQUEST FOR M A S ~ RJ 3 B , INPUT-LOOP
XOR CX,CX , COUNTERMOV DX,NEC-STAT , S TA TUS P ORT
J39 , U A I T F O R M A ST ERI N A L,D X , GE T S TA TUST E S T A L . 0 8 O H , MASTER READYJ N Z J 4 0 A , TE S T-DIRL OOP J39 U A I T M A S T E ROR D I SKETTE-STATUS, ~IME-OUT
J40 , RESULTSJRRORS T C , SET ERROR RETURN
------ R E S U L T O P E R A T I O N 15 DONEJ 4 4 P O P B X
POP DXPOP c xR E T
___---E ST T HE D I R E C T I O N B I TJ 4 0 A I N A L,D X , GE T S TA TUS RE G A GA IN
T E S T A L . 0 4 0 H , T ES T D I R E C T I O N B I TJ N Z J 4 2 , OK TO READ STATUS
OR DIS K E TT E -S T A TU S , B A D-NE CJM P J 4 0 , RESULTS-ERROR
J4 I , N E C - F A I L
__---- E AD I N TH E S T A T U SJ 4 2
J43
INP UT-S TA TP O I N T AT D A T A P O R TGET THE DATAS TORE THE B Y TEI N C R E M E N T T H E P O I N T E RL O OP TO K I L L T I M E F OR N EC
P O I N T A T S T A T U S P O R ?G E T S T A T U ST E S T F OR N EC S T I L L B U S YR E S U L T S D O N EDECREMENT THE STATUS COUNTERGO BACK FOR MOREC H I P H A S F A I L E D
I NCI NMOVI NCMOVLOOPD ECI N
T E S TJ ZDECJ N ZJMP
DXA L , DXC D I I , A LD I
J 4 3DXA L , DXA L , O l O H
J 4 4B LJ 3 BJ 4 I
cx, 10
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 459/605
E A € I
E A E I A 0 0 0 4 5 RE A E 4 3 A 4 6 OBE A E 7 A 0 0047 RE A E A 74 07E A E C E 3 08E A E E E E E 9 E 4 RE A F I E A C 4E A F 3 F E COE A F 5 2 A 46 OAE A F B E8 46 OEE A F B C 3E A F CE A F C
E A F CE A F C SO
E A F D E 4 2 1E A F F 89 46 10
E B D 2 BO B F
€eo4 €6 2 1
Eeos SB
Eeoe
€ B O 6 EB €SEI R
E B D A C 3
, NUM-TRANSTH IS ROUTINE CALCUL ATES THE NUMBER OF SECTORS THATUERE ACTUALLY TRANSFERRED TOlFRO M THE D IS KET TE
( C H ) = C Y L I N D E R O F O P E R A T I O N( C L ) 2 START SECTOR OF OPERATION
( A L ) 2 NUMEER ACTUALLY TRANSFERREDNO OTHER REGISTERS MODIF IED
, I N P U T
, OUTPUT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Nun-TRANS
novCMPnovJ ZMOVC A L LMOV
J 4 5 : I N CSUEMOVRET
NUM-TRANSRESULTS ENDP
PROC NEAR
AL, NEC_STATUS+3 ;A L , C E P + l 1 1 .AL, NEC_STATUS+5 IJ 4 5
GET-PARMAL, AHA LA L , C E P I + l O ;
CBP+ 141 , AL
ENDP
E L , 8
GET CYLINDER ENDED UP ONSAME AS YE STARTEDGET ENDING SECTORI F ON SAME CYL, THEN NO ADJUST
GET EOT VALUE
USE E O T + l FOR CALCULAT IONSUBTRACT START FROM EN0
I N T O A L
; D I S A B L ET H I S R O U T I N E U I L L D I S A B L E A L L I N T E RR U P T S E X CE P T FO RI N T E R R U P T 6 SO UATCH DOG TIM E OUT CAN OCCUR I N ERRORCON0 I T I ONS.
NONE
NONEA L L R E G I S T E R S R E M A I N I N T A C T
; I N P U T
; OUTPUT
6 SAB LE PROC NEARPUSH AX
. --__-- I S A B L E A L L I N T E RR U P T S A TI N AL, I N T A O IM O V C B P * l 6 I , A X ;
MOV AL,OBFH
OUT I NTAO 1, A LCALL BOUNDJETUP ;
POP AXR E T
D I SABLE ENDP
THE 8259 L E V E L E X C E P T D I S K E T T EREAD CURRENT MASKSAVE MASK ON THE SPACE ALLOCATEDON THE STACKMASK OFF AL L INTERRU PTS EXCEPTD I S K E T T EOUTPUT MASK TO THE E259SETUP REGISTERS TO ACCESS BUFFER
.--_------__--------------------------------------; E N A B L E
THIS P R DC E N A B L E S A L L I N T E R R U P T S . I T A LS O S E T S T HE E253 TOTHE M O D E R E Q U I R E D F O R K E Y B O A R D D A T A D E S E R I A L I Z A T I O N .BEFORE THE LA TC H FOR KEVBOARD DATA IS RESET, B I T 0 OF THE
Y H I L E THE SYSTEM YAS MASKED OFF .
NONE
A L = l M E AN S A K E V Y A P S TR UC K D U R I N G D I S K E T T E 110. ( O R N O I S E
AL=O MEANS THAT NO KEY U4S PRESSED.AX IS DESTROYED. AL L OTHER REGIS TERS REMAIN INTAC T .
ezss I S READ TO DETERMINE UHETHER ANY KEYSTROKES OCCURED
; I N P U T
; OUTPUT
O N T H E L I N E )
.-------------------------------------------------~NABLE PROC NEAR
PUSH OX ' SAVE DX.------ RETURN TIMERI TO STATE N~EDED OR KEYBOARD 1 1 0
nov AL,DIIIDILD~ ;
OUT T I M-CTL, A LP U S H A XPOP AX , Y A I T F O R 8253 T O I N I T I A L I Z E
MOV AL,OFFH ; I N I T I A L V AL UE FO R 8253OUT T I M E R + I , A L ; L S BPUSH AXPOP AX ; Y A I TOUT T I M E R * I A L . MSE
; I T S E L F
.------ CHECK I F ANY KEkSTROKES bCCURED DURING D IS KET TE TRANSFERMOV
I NA I DPUSH
I NMOVOUTE N A B L EMOVOUTPOPPOPST I
R E T
------ ENABLE
. -__--
E N A B L E
E S , C B P * 1 6 1 , G E T O R I G I N A L ES VALUE FROM THE
AL, 62H , READ PORT C OF 8265AL, 0 I H , B I T = I MEANS KESTROKE HAS OCCUREDAX , S AV E I T ON THE STACK
AL,NMl-PORT , RESET LATCHAL, BOH , MASK TO E N A B L E N M IN M l PORT A L E N A B L E N M l
A X , C B P + 1 6 2 , GET MASK FROM THE STACKI N T A O I , A LAX , PASS EACK KEY STROKE FLA GOX
, STACK
NM1 INTERRUPTS
ALL T N T E R ~ ~ P T SH ~H UERE ENABLED' BEFORE TRANSFER
ENDP
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 460/605
E 8 3 I€ E 3 1 32 COE 8 3 3 E 6 4 3E E 3 5 50
E E 3 6 58
€ E 3 7 E 4 4 0E E 3 9 86 C 4EE3B E 4 4 0
EE3D E 6 C 4
E E 3 F 3 0 0 1 2 CE 8 4 2 72 EDE E 4 4 C 3E E 4 5
E E 4 5E E 4 5 5 1E B 4 6 E A 4 E 00EE49 EO 0 1
E E 4E 0 2 EO
E B 4 D 24 07
E E 4 F 59E 8 5 0 C 3€E5 1
EB5 I
€E51 2 8 F6
E 8 5 3 2 A COE 8 5 5 8 A 67 02€858 D 1 EOE E 5 A 50EE5E 8 1 F A D O 0 0
E E 5 F 9 CE E 6 0 E 1 04E E 6 2 0 3 EEE E 6 4 03 D OE B 6 6 9D
E E 6 7 59E E 6 E 52€ E 6 9 7 C 07
E E 6 E
E E 6 EE E 7 0E E 7 2E 8 7 5E 8 7 7E E 7 AE B 7 C
E E 7 EE B B 0E E E 2
€ 8 8 4
€ 8 8 7
€BE9EEBE
EEEE€E9 I
E893
E E 9 6E 8 9 6
€E99
EESBE W E
E W EE E A OE E A 7
E E A C
E8 F E 7 1 R
74 28
EE 05E E F E E E R74 24E A 1626E 4 02E 7 07CD 10E C D AE A C 6
E8 1 E A 9 RE A DE
E 7 25EO F E D OBE 003E R7 0 03BE 0 0 3 A R
EE 0 9 E C R
EB 16
_ _ _ _ R
BE CO26. C 7 06 0 0 1 4 R 000326. E C IE 0016 R
26. FF IE 0 0 1 4 R
------------------------------------------------,CLOCK-UAI T
T H I S P R O C E D U R E IS C A L L E D W HE N T H E T I M E O F D A Y
IS B E I N G U PD AT ED I T W A I T S I F T l ME R O IS AL M OST
R E AD Y T O WRAP U N T I L I T IS S A F E T O R E A D A N A C C U R A T ET I M E R 1
N ON E
N ON E AX IS D ESTR OYED
, N P U T
,O U T P U T
---------------__-_-____________________--------CLOCK-UAI T PROC NEAR
X O R A L . A L , R E AD MO DE T I M E R 0 F O R E 2 5 3O U T T I M - C T L , A L , O U T P U T T O T H E E 2 5 3P U S H A X
P O P A X , U A I T FOR E 2 5 3 TO I N I T I A L I Z E
I N A L ,T IW E R O , R EA D L E A S T S I G N I F I C A N T B Y T EX C H G A L , A H , S AV E I T
I N A L , TI ME R O , R EA D M OS T S I G N I F I C A N T B Y T EX C H G A L , A H , REARRANGE FOR PROPER ORDERC M P AX,TH R ESH OL D , IS T l M E R O C L O S E T O U R A P P I N G 'J C C L O C K - U A I T , J U M P IF C LO CK I S U I T H I N T HR ES HO LDR E T , O K T O R E AD T I M E R 1
, I T S E L F
C L OC K- U AI T EN D P
, GET- D R I VE
..................................................................
T H I S R O U T I N E U I L L C A LC U LA T E A B I T MA SK F OR T HE D R I V E UHICH
IS S E L E C T E D B Y T H E C UR RE NT I N 1 13 C A L L T H E D R I V E S E LE C TE DC O RR E SP O ND S T O T H E B I T I N TH E M A S K, 1 E D R I V E Z E R O
C O R RE S P O ND S T O B I T Z E R O AN D A 01H IS R ET UR NE D T H E B I T ISC A L C UL A T E D B Y A C C E S S I N G T H E P AR A M E T E RS PA S S E D TO I N 1 13
U H I C H U E R E S A V E D O N T H E S T A CK
B Y T E P T R C B P I M US T P O I N T TO D R I V E F O R S E L E C T I O N
A L C O N T A I N S T H E B I T M AS K A L L OT HE R R E G I S T E R S A R E I N T A C T
, N P U T
, U P T U T
___-____________________________________-------------GET-DR I VE PR OC N EAR
P U S H C X , S A V E R E G I S T E RM OV C L , E Y T E P T R C B P I , G E T D R I V E N U M E E RM OV AL , 1 , I N I T I A L I Z E A L U I T H V AL UE F OR
, S H I F T I N GS H L A L , C L , S H I F T 8 1 1 P OS I T I O N E V D R IV E
, N UM EE R ( D R I V E I N R AN GE 0 - 2 )
A N D A L , 0 7 H , O N L V T H R E E D R I V E S A R E S UP P O R TE D
, R AN GE C H EC KP O P cx , R E S T O R E R E G I S T E R SR E T
G E T - D R I V E E N D P
, T H I S R O U T I N E C H E C K S O P T I O N A L R OM M O DU LE S ( C H E C K SU M, F O R M O DU LE S F RO M C 0 0 0 0 - > D 0 0 0 0 , C R C C H EC K F OR C A R T R I D G E S, ~ D 0 0 0 0 - > F 0 0 0 0 )
, I F C H EC K IS O K, C A L L S I N I T l T E S T C OD E I N M OD UL E, WFG E RR OR C O DE = 2 5 X X t X X = M S E O F S E G M E N T I N E R R O R )
................................................
..................................................ROM-CHECK
S U E
S U EMOVS H L
P U S HCMPP U S H F
MOV
SHRADDP O P F
P O PP U S H
JL
C A L L
J ZJ M P
R O M - I : C A L L
J ZROM-2. MOV
MOVMOV
I TMOVMOV
C A L LMOV
MOVCMP
MOVJ C E
MOVROM-CHECK-0.
C A L LJ M P
ROM-CHECK-1:
MOVMOVMDVMOV
C A L L
PROC NEAR
SI, I
A L , A LA H , C E X + 2 I
AX, I
AX
DX, ODOOOH
C L , 4A X , C L
OX, AX
c xD XROM-1
CRC-CHECKROM-CHECK-I ,SHORT ROM-2 ,ROS-CHECKSUM ,ROM-CHECK-I ,D X , 1 6 2 6 HAH, 2BH, 710H
DX, D SAL , DH
XPC-BYTE
E L , DH
E H . 2 5 H
S E T SI T O P O I N T T O B E G I N N I N G( R E L . T O D S )Z E R O O U T A LG E T L E N G T H I N D I C A T O R
FORM COUNTS A V E C O U N T
S E E I F P O I N T E R IS E E L O U D O 0 0S A V E R E S U L T SA D J U S l
S E T P O I N T E R T O N E X T M O D U L E
R E C OV E R F L A G S F R O M P O I N T E R R A N G EC H EC KR E CO V ER C OU NT I N C X R E G I S T E RS A V E P O I N T E R
D O A R I T H M E T I C C H E C K S U M I F B E L O UD O 0 0 0
D O CRC CHECKPR OC EED I F OKE L S E P O S T E R R O RD O A R I T H M E T I C C H E C K S U MPR OC EED I F OK
P O S I T I O N C UR SO R, R O U 22, C O L 38
R E C O V E R D A T A SEG
D I S P L A Y MSE O F D A T A SEGFOR M XX VAL U E OF ER R OR C OD E
FORM 25 P O R T I O ND H ' O D O H I N C A R T RI D G E S P A C E 7
ROM-CHECK-0
SI OFFSET CART-ECR
S I , FFSET ROM-ERC
E-MSG , GO E R R O R R O U T I N ESH OR T ROM-CHECK-END , AND E X I T
AX, XXD ATA , S E T ES T O P O I N T T O X X D A T A A R EA
ES, A XE S IO-ROM-I N I , O O O 3 H , L O A D O F F S E TES 1 0 ROM SEG D S L OAD SEGM EN TDUORD-PTR-ES i 0-ROM-1 N i T , C A L L I N I / T E S T R OU T1 N E
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 461/605
E B B I
E B B 1 S A
E B B 2 C 3
E B B 3
E C 5 9
E C 5 9E C 6 9 F B
E C 5 A 06E C 5 B 50
E C 5 C 50
E C 5 D 50E C 5 E 53
E C 5 F 51E C 6 0 I E
E C 6 1 56
E C 6 2 57E C 6 3 55
E C 6 4 5 2
E C 6 5 88 E CE C 6 7 E B 1386 RE C 6 A E B E C 9 0 R
E C 6 D 83 04E C 6 F E 8 E 9 6 4 R
E C 7 2 86 2 6 0040 R
E C 7 6 B A 2 6 0 0 4 1 RE C 7 A B B 66 O F
E C 7 D 5 A
E C 7 E 5 D
E C 7 F 5F€ C E O 5 EE C B l I F
E C B 2 59E C 8 3 SB
E C B 4 58E C B 5 83 C 4 04
E C B B 07E C B 9 BO F C DlE C B C F5
E C B D C A 0002
ROW-CHECK-ENDP O P D X , R E C O V E R P O I N T E R
R E T , R E T U R N TO C A L L E R
ROM-CHECK ENDP
, D I S K E T T E I / O
, T H I S I N T E R F A C E P R O V I D E S A CC E SS T O T H E 5 l I 4 " D I S K E T T E D R I V E S, I N P U T
- _ N T 13 - - - - - - - -_----____-_-____________________----- - - - - - - - - - - -
( A H ) = O R E S ET D I S K E T T E S Y S TE M
H AR D R ES ET T O N EC , PR E PA R E C O MMAN D, R EC AL R EQ D O NA L L D R I V E S
D I S K E T T E - S T A T US F RO M L A S T O P ' N IS U S E D
( A H l = I R EA D T HE ST A T US O F T H E S YS TE M I N T O ( A L )
R E G I S T E R S F O R R E A D I U R I T E I V E R I F Y I F O R M A T
( D L ) - D R I V E N U M B E R (0-3 A L LO U E D , V A L U E C H E C K E D )
( D H ) - H EAD N U MBER ( 0 - 1 A L L O U E D , N O T V A L U E C H E C K E D )( C H ) - ? R AC K N U MBER ( 0 - 39 , N O T V A L U E C H E C K E D )
( C L I - SEC T O R N U MBER ( 1 - 8 . N O T V A L U E C H E C K E D , N O T U S E D F O RF O R M A T )
( A L ) - N U MBER O F SEC T O R S ( MAX 8 , N O T V A L U E C H E C K E D , N O T
U S E D F O R F O R M AT , H OU E VE R , C A N NO T B E Z E R O l " )
( E S B X ) - A D D R E S S O F B U F F E R ( N OT R E Q U IR E D F O R V E R I F Y )
R E A D T H E D E S I R E D S E C T OR S I N T O M EM OR Y
U R l T E T H E D E S I R E D S E C TO R S F R OM M EM OR YV E R I F Y T H E D E S I R E D S E C TO R S
F O R M AT T H E D E S I R E D T R A C KF O R T H E F O RM A T O P E R A T I O N , T H E B U F F E R P O I N T E R
( E S , B X ) M US T P O I N T T O T H E C O L L E C T I O N O F D E S I R E DA DD RE SS F I E L D S F OR T H E T RA CK E A C H F I E L D ISC O MPO SED O F 4 BYT ES, i C, H, , N ) , U H ER EC
=T R AC K NU MBER , H Z H EAD N U MBER , R 5 SEC T O R N U MBER ,
N = N U M B ER O F B Y T E S P E R S E C T O R ( 00= 128 , 01=256,0 2 - 5 1 2 , 0 3 : 1 0 2 4 , ) T H E R E M U S T B E O N E E N T R Y F O R
E V E R Y S E CT O R O N T H E T R AC K T H I S I N F O R M A T I O N IS U S E D
T O F I N D T H E R E Q U E S TE D S E CT O R D U R I N G R E A D I U R I T E
A C C E S S
, D A T A V A R I A B L E -- D I S K - P O I N T E R, D O U B L E UO RD P O I N T E R T O T H E C U RR E N T S E T O F D I S K E T T E P A R A ME T E R S
, O U T P U T
A H = S T A T U S O F O P E R A T I O N
S T A TU S B I T S A RE D E F I N E D I N TH E E Q U A T ES FO RD I S K E T TE - S T A T U S V A R I A B L E I N T H E D A T A S EG ME NT O FT H I S M O D U L E
CY = 0 S U C C E S S F U L O P E R A T I O N ( A H = O O N R E T U R N )
CY = I F A I L E D O P E R A T I O N ( A H H A S ER RO R R E A SO N )
F OR R E A D / U R I T E / V E R I F Y
DS, EX, D X , C H, C L P R E S E R V E DA L N U M BE R O F S E C T O R S A C T U A L L Y R E A DU U U U A L M AY N O T B E C O R RE CT I F T I M E O U T E RR OR O C CU RS
N O T E I F AN ER R O R IS R E P O RT E D B Y T H E D I S K E T T E CO DE , T H EA P P R O P R I A T E A C T I O N IS T O R E S E T T H E D I S K E T T E , T H E N
R E T R Y T H E O P E R A T I O N O N R E A D A C C E S S E S , N O M OT OR
S T A R T D E L AY I S T A KE N , S O T H A T T H RE E R E T R I E S A RER E Q U I R E D O N R E A D S T O E NS U R E T H A T T H E P R O B L E M IS N O T
D U E T O M O T O R S T A R T - U P. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A S S UM E C S C O D E D S D A T A E S D A T A
ORGD I S K E T T E - I O
S T I
P U S H
P U S H
P U S H
P U S H
P U S H
P U S H
P u s n
P U S H
P U S HP U S H
P U S H
MOVC A L L
C A L L
MOVC A L L
MOV
MDV
MOVP O P
P O P
P O PP O PP O P
P O PP O P
P O P
ADD
P O PC MP
CMC
R E T
O E C 5 9 HP R O C F A R
E S
AX
AX
AX
B X
cxD S
SI
DIB P
D X
B P . S PDDSJ l
E L , 4
G E T P A R M
I N T E R R U P T S BA C K O N
S A V E E S
A L L O C A T E O N E UO RD O F S T O R A G E F O R
T I M E R 1 I N I T I A L V AL U E
A L L O C A T E O N E UO RD O N S T A C K F O R
U S E I N P RO CS E N A B L E AND D I S A B L E
SAVE COMMAND AND NJECTORSS A V E A D D R E S S
S A V E S EG M EN T R E G I S T E R V A L U E
S A V E A L L R E G I S T E R S D U R I N G
O P E R A T I O N
WILL H O LD 8 2 5 9 M A S K
S E T U P P O I N T E R T O H E A D P A R M
S E T D S = D A T A
C A L L T H E R E S T T O E N S U R E D SR E S T O R E D
G E T T H E M O TO R W A I T P A R A M E T E R
M D T ~ R - C O U N T , A H , SET THE TIMER COUNT FOR THE MO T O R
A H , D I S K E T T E - S T A T U S , G E T S T A T U S O F O P E R A T I O N
[ B P + l S I , A H , R E TU R N ST A TU S I N A L
D X , R E ST O RE A L L R E G I S T E R SB P
DISID Sc xB X
AX
SP, 4
E 5AH, 1
2
, R E C O V E R O F F S E T
, D I S C A R D D UM MY S P A C E F O R 8 2 5 9 M A S K, R EC O VER SEG MEN T
, S E T T H E C AR RY F L A G TO I N D I C A T E
, S U C C E S S O R F A I L U R E, T H R O U A U A Y S A V E D F L A G S
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 463/605
E D 2 7
E D 2 7
E D 2 9E D 2 C
E D 2 E
E D 3 I
E 0 3 3
E D 3 6
E D 3 9E D 3 A
E 0 3 0
E D 3 D
E D 3 DE D 4 2
E D 4 4
E D 4 4E 0 4 4
E D 4 5
E D 4 6
E D 4 7
E D 4 C
E D 4 F
E D 5 3E D 5 5E D 5 AE D 5 E
E D 5 F
E D 6 1
83 07
E 8 E 9 8 4 R63 09E 8 E 9 8 4 R8 3 O FE8 E 9 8 4 R
8 B 001153E 9 E OC D R
80 O E 0 0 3 F R 80
84 4 5
50
5 1F A
C 6 06 0040 R F F
E 8 E 8 4 5 R
8 4 06 0 0 3 F R
75 I F80 2 6 003F R F O
08 06 003F RF B
oc 80
E 6 F2
E 0 6 3 8 3 14
E D 6 5 E 8 E 9 8 4 RE D 6 8 OA E 4
E D 6 A
E 0 6 A 74 08
E D 6C 2 8 C 9
E DG E E 2 F EE D 7 0 F E CC
E D 7 2 E 8 F 6
E D 7 4E D 7 4 F 8
E D 7 5 53
E D 7 6 E8 E 3 F 8 RE D 7 3 58
E D 7 A 8 A F C
E D 7 C 86 00
E D 7 E 73 03
ED80 E 3 E E D 7 RE D 8 3 B E E E D 7 R
E D 8 6 56
E D 8 7 E8 E 9 8 1 RE DB A 8 A 6 6 0 1E D 8 D D O E 4
E D B F D O E 4E D 9 1 80 E 4 04E D 9 4 OA E 2
E D 9 6 E8 E 9 8 A R
E O 9 9 80 FF 4 0
E O 9 C 75 0 2E D S E EB 87
E DA O 8 A E 5E D AP E 8 E 9 8 A R
E D A 5 8 A 6 6 0 1€ D A B E8 E 9 8 A R€ DA B 8 A E lE DA D E 8 E 9 8 A RE O B O 83 07E D B 2 E 8 E 9 8 4 R
E D 8 5 83 08
E D 8 7 E8 E 9 8 4 RE D BA 0 2 4 E O E
E D B D F E C 9E DB F E A E l
E D C l E8 E 3 8 A R
E D C 4 83 08
E D C 6 E8 E 9 8 4 RE D C 3 88 OOOD
E D C C 53
J 10
M O V E L , 7
C A L L G E T - P A R MM O V E L , 9
C AL L G ET - PAR M
M O V E L , 15C AL L G ET - PAR M
MOV EX, 17
P U S H B X
J M P J16
D 1SK- F O R MAT EN D P
-----_ D I S K E T T E U R I T E R O U T I N E
C O N T I N U A T I O N O F R U- OP N F O R F M T
G E T T H E
G E T T H E
G E T T H E
G ET T H E F I L L E R B Y T E
S A V E P A R A M E TE R I N D E X O N S T A CK
T O T H E C O N T R O L L E R
B V T E S / S E C T O R V A L U E T O N E C
S E C T O R S I T R A C K V A L U E T O N E C
G A P L E N G T H V A L U E T O N E C
I N D I C A T E A U R I T E O P E R A TI O N
D 1SK- U R I T E PR O C N EAR
OR MOTOR-STATUS, 8OH ,M O V A H , 0 4 5 H , N E C C OM MA ND T O U R I T E T O D I S K E T T E
D I S K - U R I T E E N O P,_ _ _ - _L LO W U R I T E R O U T I N E T O F A L L I N T O RU -O PN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
, RU-OPN
T H I S R O U T I N E PE RF OR MS T H E R E A O / U R I T E I V E R I F V O P E R A T I O N_----___-___--__--__-------------------
RU-OPN PROC NEAR
P U S H A X , SAVE T H E C O MMAN D
P U S H C X S A V E T H E T / S P A RM S
------ T U R N ON T H E M O TO R AN D S E L E C T T H E D R I V E
J 1 2
J I 3
J 1 4
J 14-1
C L I
MOVC A L L
T E S T
J N ZANDOR
S TOR
OUT
U A I T
, NO I N T E R R U P T S W H I L E D E T E R M I N I N G
, M O T O R S T A T U S
MOTOR-COUNT,OFFH , S E T L A R G E CO UN T D U R I N G O P E R A T I O N
G E T - D R I V E , G E T T H E D R I V E P A RA M E T ER F RO M T H E
MO T O R - ST AT U S, AL , T E S T M O T O R F O R O P E R A T I N G
J 14 , I F RU NN IN G, S K I P T H E U A I TM O T O R - S T A T U S , O F O H , T U RN O F F R U N N IN G D R I V E
MO T O R - STAT U S, AL T U R N O N T H E C U R R EN T MO TO R
AL , F D C - R ESET , N O R ES ET T U R N O N MO TO R
N EC - C T L , AL
, S T A C K
, I N T E R R ~ P T S B A C K ON
F O R M O TO R B O T H R E A 0 A ND U R I T E
G E T M O T O R S T A R T T I M EOV
C A L LOR
J Z
S U B
L O O PD EC
J M P
S T I
P O PD O T H E
C A L L
P O PMOV
MOV
J N C
J M PMOV
P U S H
E L , 2 0GET-PARM
AH, AH
J 14
cx , c xJ I 3
A H
J 12
cx
S E E K
AXB H , A H
OH, 0
J 1 4 - 1
J 17
S I , O F F S E T J17 ,
SI
S E E K O P E R A T I O N
T E S T F OR NO U A I T
T E S T - W A I T - T I M E
E X I T U I T H T I M E E X P I R E D
S E T U P 1/8 S E CO N D L O O P T I M E
U A I T F O R T H E RE Q U I R E 0 T I M E
D E CR E ME N T T I M E V A L U E
AR E WE D O N E VETMOTOR-RUNNING
I N T E R R U P T S B A C K O N FO R B Y P A S S
U A I T
MO VE T O C O R R EC T T R AC K
RECOVER COMMAND
S A V E C OM MA ND I N BH
S E T N O S EC T OR S R E A D I N C A S E O F
ERRORI F N O ER R O R C O N T I N U E, JU M P AR OU N D
J M PC AR RY S E T J U M P T O M O TO R U A I T
D UM M Y R E T U R N O N S T A C K F O R
NEC-OUTPUTSO T H A T I T U l L L R E T U RN T O M OTOR
, O F F L O C A T I O N
_-_-__E N D O U T T H E P A R A M E T E R S T O T H E C O N T R O L L E RC A L L N E C O U T P UT .M O V A H, c 8 P + 11
SAL AH , 1
SAL AH , IA N D A H . 4
OR A H , D L
C A L L N E C - O U T P U T
C M P B H . 0 4 D H
_-_-__EST F O R F O R MAT C O MMAN D
J N EJ M P
J15 MOVC A L LMOV
C A L LMOV
C A L LMOV
C A L L
MOV
C A L L
ADO
D ECMOV
C A L L
MOV
C A L L
MOVP U S H
J 15
J 10
AH, CHNEC-OUTPUT
A H, C B P + l INEC-OUTPUT
A H, C LNEC-OUTPUT
eL, 7GET-PARM
E L , 8GET-PARM
C L , C B P + 1 4 1 ,
C L
A H, C L
NEC-OUTPUT
GET-PARM
E X , 13B X
E L , I 1
O U T P U T T H E O P E R A T I O N C OM M AN D
G ET T H E C U R R EN T H EAD N U MBER
MO VE I T T O B I T 2
I S O L A T E T H A T B I T
OR I N T HE D R I V E N U M8 ER
IS T H I S A F O RM A T O P E R A T IO N ?
NO C O NT I N U E U I T H R l U I V
I F SO, H A N D L E S P E C I A L
C Y L I N D E R N U M B E R
H E A D N U M B E R F R O M S T A C K
SEC T O R N U MBER
B V T E S l S E C T O R P A R M F RO M B L O C K
E O T P A R M F R O M B L O C K
A DD C U R R E N T S E C T O R TO NU M B ER I N
T R A N S F E RCURRENTJECTOR + N-SECTORS - 1
E O T P A R A M E T E R IS T H E C A L C U L A T E D
ONE
G A P L E N G T H P A R M F R O M B L O C K
D T L P A R M F R O M B L O C KS A V E I N D E X T O DISK P A R A M E T E R O N
S T A C K
T O T H E N E C
R ET UR NE D I N A H
T O T H E N E C
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 464/605
E D C D F C
E D C E EO 70
E D D O E6 43
E D D 2 50E D D 3 58
E D D 4 EO FFE D D 6 E6 4 1E D D E 50E D D 9 58
E D D A E6 4 1
E D D C E A 46 O F
E D D F A B 0 1€D E I 74 05EDE3 E9 E E 4 E R
€DE6 EE OCE D E E 3 C 02E D E A 75 05E D EC E 9 E E 3 A R
E D E F EE 03E D F l E9 E E 2 0 R
E D F 4
E D F 4 EO 10
E O F 6 E6 A 0
E D F E EE E E 3 1 R
E D F E EE E E 4 5 R
E D F E E A 00F2E E O l O C E OE E 0 3 E E
E E 0 4 24 A 7EE06 EE
E E 0 7 E A 00F4E E O A EO 20
E E O C E6 A 0
EEOE EE E E I A R€ E l l E 9 46 I 2
€ E 1 4 EE E A F C R
E E 1 7 58EEIE EE E 9 8 4 R
E E l E 518
E E l C 06E E l D I F
E E l E FF E l
E E 2 0€ E 2 0 E CE E 2 1 A 8 20
E E 2 3 74 F E
E E 2 5
E E 2 5 A 8 EOE E 2 7 75 07
E E 2 9 E CE E 2 A A E 2 0E E 2 C 75 F 7
E E Z E E E 35EE30 4 2€E31 E CE E 3 2 46
E E 3 3 E CE E 3 4 A E 20E E 3 6 75 ED
E E 3 E EE 2 8
F O R U A R D D I R E C T I O N
V A L U E O F FFFF
S E L E C T T l M E R 1 , L S E - M S E . MODE 0,B I N A R Y C O U N T E R
I N I T I A L I Z E T HE C OU NTE R
A LL OW E N O UG H T I M E F O R T H E E 2 5 3 T O
I N I T I A L I Z E I T S E L FI N I T I A L C OU NT V A L U E F O R T H E E 2 5 3
O UT PU T L E A S T S I G N I F I C A N T B Y T E
U A I TO U TP U T MO S T S I G N I F A C N T B Y T E
C L D
’- S T A R T
MOV
OUT
P U S HP O P
MOVOUTP U S HP O P
T I M E R I U l T H I N I T I A L
A L , 0 I I IOOOOE ,
T I M - C T L , A L ,AX
AX
A L , O F F HT l M E R + I , A L ,A XA X
OUT T I M E R t I , A L
M OV A L , C E P + 1 5 1 , R E T R I E V E CO M MA ND P A R A M E T E R
T E S T A L , O I H , IS T H I S A N OD D N U M EE R E D F U N C T I O N ?J Z J16-1 , J U M P I F N O T O D D N UM E ER EDM OV CX , O FF S E T URI TE-LOOP
J M P SHORT J16-3
J N Z J16 2 J UM P I F V E R I F Y
J M P S H O R T ,116-3
F I N I S H I N I T I A L I Z A T I O N
, _ _ _ _ _ NITIALIZE c x FOR JUMP A F ~ E R A S T P A R A M E T E R I S P A S S E D T O NEC
J16-1 C M P A L . 2 , IS THIS A READ’
MOV CX , CFFSET R E A D - L ~ O P
J16-2 MOV C X , O F F S E T V E R I F Y - L O O P_-_---16-3___---______-__-________________________-------------
, * * N O T E u * *
, A L L I N T E R R U P T S A R E A B OU T T O B E D I S A B L E D T H ER E IS A P O T E N T I A LT H A T T H I S T I M E P E R I O D U l L L B E LO NG E NO UG H TO MISS T I M E O F
D A Y I N T E R R U P T S F O R THIS RE A S O N, T l M E R l U l L L B E U S E0 T O
K E E P T R AC K O F T H E NU ME ER O F T I M E O F D A Y I N T E R R U P T S U H I C HU l L L B E MISSED T H I S I N F O RM A T I ON IS U S ED A F T ER T H E D I S K E T T E
O P E R A T I O N T O U P D A T E THE T I M E O F D A Y
M O V A L , IOH , D I S A B L E N M lO U T N M I - P O R T , A L , N O K E Y BO A R D I N T E R R U P TC A L L C L O C K - U A I T , U A I T I F T I M E R 0 IS A B O U T T O
___--___________________________________-----------
, I N T E R R U P T------ E N A B L E U A T C H O O G T I M E R. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
, UUNO TE * * U
G I V E N T H E C U RR E NT S Y S T E M C O N F I G U R A T I O N A M ET HO D IS N E E D E D
T O P U L L T H E N E C O UT O F ” F A T A L E R RO R ” S I T U A T I O N S A T I M E RON THE A DA P TE R CA RD IS P R O V ID E D U H I C H U l L L P ER FO RM T H I SF U N C T I O N T H E U AT C H D OG T I M E R O N T H E A D A PT E R C A R D IS E N A B L E DAN D S T RO E ED B E F O R E T H E E 2 5 9 I N T E R R U P T 6 L I N E IS E N A B L E DT H I S IS B E C A U S E O F A G L I T C H O N T H E L I N E L A R G E EN OU GH T OT R I G G E R A N I N T E R R U P T
C A L L G ET D R I V E , G ET B I T M AS K F OR D R I V E
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MOVOR
OUT
ANDOUT
MOV
MOV
OUT
R E A DC A L L
_ _ - _ _ _
D X N E C C T L C O N T RO L P O R T T O N E CA L : FOC~RESETtUD_~NAELE+UD_STROEE
D X , A L , O U T P UT CO N T R OL I N F O
, U A T C H D O G I U O ) E N A B L EAL,FDC-RESETtUO-ENAELEt7HO X , A L , O U T P UT C ON T R O L I N F O
DX ,NE C-S TA T , P O R T T O N E C S T A T U SA L . 2 O H , S E LE C T T I M E R I I N P U T
N M I - P O R T , A LT l M E R l N OU AND S AV E TH E I N I T I A L V A L UE
R EA D T I M E G ET T l M E R l V A L UE
, U A T C H D O G
, O U T P U T
F O R
T O S T R O B E
F R O M T I M E R 0
M O V C E P + T B I , A X 1 S A V E I N I T I A L V A L UE F OR CL OC K
C A L L D I S A B L E D I S A B L E A L L I N T ER R U P T S
P O P E X , G E T P A R A M T E R F R O M S T A C K
C A L L G E T - P A R M , O U T P U T L A S T P A R A M E T E R T O T H E N E C
P O P A X , C A N N OU D I S C A R D T H A T D UM MY R E T U R N, A D D R E S S
P U S H E S
P O P DS , I N I T I A L I Z E D S F O R U R I T EJ M P C X , J UM P T O A P P R O P R I A T E R l U l V L O O P
, U P D A T E I N T EM P OR A Y S T O R A GE
------ NEC BEGINS OPERATION U H E ~ E C RECEIVES LA S T P A RA M E TE R
________________-_______________________- - -- - - -- - - - --, U* * NO TE * * U
D A T A IS T R AN S FE R RE D U S I N G P O L L I N G A L G O R I T HM S T H E S E L O O P S
T R A N S F E R A D A T A B Y T E A T A T I M E U H I L E P O L L I N G T H E N EC F OR
N E X T D A T A B Y T E A N 0 C O M P L E T I O N S T A T U S___-_______-____________________________- -- - - - -- - - - -- -_-_--E R I F Y O P E R A T I O N
~ERIFY-LOOP
I N A L , D XT E S T A L , E U S Y - B I T ,
J Z
T E S TJ N ZI NT E S TJ N Z
J M P
J 2 2 - 4 I N CI N
OECI NT E S T
J N Z
J M P
J 2 2 - 2
V E R I F Y - L O O P ,
A L , RQM
AL, OXA L , B U S Y - E l 1 ,J 2 2 - 2
SHORT OP-EN0 ,OX
A L , O XO X
A L , O XA L . E U S Y - E I T ,J 2 2 - 2SHORT OP-END ,
~ 2 ~ 4
R E A O S T A T U SH A S N E C E N T E R E D E X E C U T I O N P H A S EV E T 7
N O, C O N T I N U € S A M P L I N G
IS DATA. READY’J U MP I F D A T A T R A NS F ER IS R E A D YR E A D S T A T U S P O R TARE YE DONE’
J UM P I F M OR E T R AN S F E R STRA NS FE R DO NE
P O I N T A T N EC D A T A R E G I S T E R
R E A D D A T AP O I N T A T N EC S T A T U S R E G I S T E RR E A D S T A T U S P O R TARE UE DONE’
C O N 1 N U EY E A R E D O N E
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 465/605
E E 3 AE E 3 A E CE E 3B A 8 2 0
E E 3D 7 4 F BE E 3 F E CE E 4 0 AB 2 0
E E 4 2 74 2 1E E 4 4 A B EOE E 4 6 7 4 F 7E E 48 4 2
E E 4 9 E CE E 4 A A AE E 4 B 4 AE E4 C E B F I
E E 4 EE E 4 E E C
E E 4 F AB 20
E E 5 1 7 4 F EE E 53 E 9 2 0 8 0E E 5 6E E 5 6 E CE E 5 7 8 4 C 5
E E 5 9 7 4 OAE E5 B E 4 C 1
E E5 D 7 4 F 7E E 5F 4 2E E 6 0 A CE E 6 1 E EE E 6 2 4 AE E6 3 E B F I
E E 6 5 9 C
E E 6 6 E 8 E 8 4 5 R
EEM oc eo€ E 6 8 B A O O F 2E E 6 E E E
E E 6F E B I 3 8 8 RE E 72 E B E B 3 l R
E E 7 5 E 8 E E l A RE E 7 B BB 5 E 1 2
E E 7 B 2 8 C 3
E E 7D F 7 D EE E 7 F 50
EEEO 0 1 0 6 0 0 6C R
E EB 4 7 3 0 4
E E B6 F F 0 6 00 6 E R
E EE A E 3 3 E 0 0 6 E R 1 8E E BF 7 5 19
E E 9 7 7 C I1
E E 9 9 C 7 0 6 0 0 6 E R 0000E E S F E 1 2 E 0 0 6 C R OOBO
E E A 5 C 6 06 0 0 7 0 R 0 1
EEAD 59
E EA E E 3 2 6
EEBO 1E
E E E l 5 0
EES e 1 3~ 0 0 6 c R ooeo
EEAA EE E e o e R
E EB 2 5 2E E B 3E E B 3 CD I C
E E B 5 E 2 F CE E B 7 5 AE E B B 58
E EB S I F
EE BA OA COE EB C 7 4 l E
E E B E B B 0080
E E C 4 EE E 0 3 5 REEC e9 0 0 4 8
_---- EAD OPE RA TI ON~ E A D L O O P
I N A L,D XTEST AL,B~SV-EIT ,
J Z READ-LOOP
T E S T A L , B U S Y - B I T ,J 2 2- 5 I N A L ,D X
J ZT E S TJ ZI NC
I N
OECJMP
, W R I T E A N DUR I TE-LOOP.
s i o s e
___--
I NT E S T
OPJNDAL, RQMJ 2 2 - 5DX
AL , DX
D XJ 2 2 - 5FORMAT OPERATI
AL , DXA L , B ~ ~ ~ - B I T
ON
R EA D S T A T U S R E G I S T E RH A S N EC S T A RT E D T H E E X E C U T I O NP H A S E ?HAS NQT STATRED YETR E A 0 S T A T U S P O R TH A S N E C C O M P L E T E D E X E C U T I O NPHASE’J UM P I F E X E C U T I O N P H AS E IS OVERIS D A T A R E A D Y 7READ THE DATAPOI NT AT NEC-DATA
READ DATATRANSFER DATAPO I NT AT NEC-STATUSC O N T I N U E W I T H RE AD O P E R A T I O N
READ NEC STATUS PORTH A S T H E N E C E N T E R E D E X E C U T I O N
, P H A S E Y E T 7J Z W R I T E L O O P , N O, C O N T I N U E L O O P I N GMOV CX, BUSYpB1 T*256+RQM
J 2 2 - 7I N A L , D XT E S T A L , C H
J Z OP-ENDT E S T A L , C L
J Z J 2 2 - 7I N C D XL O D S BO U T D X , A LDEC DXJ M P J 2 2 - 7
_ _ _ - _ _RANSFER PROCESS IS OVER~P-EN D PUSHF
C A L L G E T - D R I V EOR AL , FOC-RESETMOV DX, NEC-C TLO U T D X , A LU P D A T E T I M E O F D A YC A L L 0 0 5
CA LL CLOCK-WAI T
__--_-
C A L L R E A D - T I M EM O V ex , CBP+B
sue A X , B ~
NEG AXPUSH AX
ADD TIM ER- LOW . AX
J N C J 1 6 - 4
I N C T I M E R - H I G H
J N Z J 1 6 - 5CMP TI ME R LOW. OBOH
J 1 6 - 4 C MP T I M E R - H I G H , O l B H
J L J l 6 -5 - .
MOV TIMER-HIGH,OSUE TIMER-LOW, OBOH
_---_- I M E R H A S G O NE 2 4 H O UR S
MOV TIMER-OFL, I
POP c x
J C X Z J 1 6 - 7
P U S H D S
PUSH AX
PUSH DX
I N T I C H
J 1 6 - 5 C A L L E N A B L E
J 16 -6
L O O P J 1 6 - 6POP DXPOP AXPOP D S
___-__LOCK IS UPDATED AND USER
READ STATUS PORTIS T HE F E C S T I L L I N TH E E X EC U T IO NP H A S E ?J UM P I F E X E C U T I O N P HA S E IS DONEIS THE DATA PORT READY FOR THETRANSFER’J U M P T O W R I T E D A T AP O I N T A T D A T A R E G I S T E RT R A N S F E R B Y T EW R I T E T H E B Y T E O N T H E D I S K E T T EP O I N T A T T H E S T A T U S R E G I S T E RC O N T I N U E W I T H W R I T E OR FORMAT
S A V E T H E C AR RY B I T S ET I ND I S K - I N TG E T B I T M AS K FO R D R I V E S E L E C T I O NNO R E S E T , K E E P D R I V E S P I N N I N G
D I S A B L E W A T C H D O G
POINT D S A T Bios D A T A SEGMENTU A I T I F T IM E R 0 IS CLOSE TOWRAPPI NG
G ET T HE I N I T I A L VA LU E OF T I M E R 1
U P D A T E N UM B ER O F I N T E R R U P T SM I S S E DP UT I T I N A XS A V E IT F OR R E U SE I N I S S U I N G U SE RT I M E R I N T E R R U P T SADD NUMBER OF T I ME R I NTE RR UPT S TOT I M EJ U M P I F T IM E R- LO W D I D N O T S P I L LOVER TO T I MER-HI
T E S T F O R C O U NT T O T A L I N G 2 4 H O UR SJ UM P I F N OT 2 4 H OU RSLOW VALU E 2 4 HOUR VALUE’N O T 2 4 H O UR V A L U E 7
ZERO OUT T I MER-HI GH VALUEV A L UE R E F L E C T S CO R RE CT T I C K S P A S TOOBOHI N D I C A T E S 2 4 H OU R T H R E SH O L D
E N A B L E A L L I N T E R R U P T SCX =AX, COUNT FOR NUMBER OF USERT I M E I N T E R R U P T SI F ZER O DO NOT I SS UE ANYI N T E R R U P T SS A V E A L L R E G I S T E R S S A V ED P R I O R T OI N T I C C A L L F RO M T I M E R I N TTHIS P R O V I D E S A C O M P A T I B L EI N T E R F AC E TO I C
TRANSFER CONTROL TO USERI N T E R R U P TDO A L L U S ER T I M E R I N T E R R U P T S
R E S T O R E R E G I S T E R SI N T E R R U P T S I C H A V E B E E N I S S U E D .
C H EC K I F K E Y S T R O K E O C C UR EDOR A L , A L , A L W AS S E T D U R I N G C A L L T O E N A B L EJ Z J 1 6- 7 , NO KEY WAS PRESSED WHI LE SYSTEM
MO V e x , o e o H , D U R A T I O N OF TONEM O V C X , O O B H , FREQUNCY OF TONECA LL KB-NO1 SE , N O T I F Y U S E R O F M I S S E D K E Y B O R A D
, I N P U T
, UAS MASKED
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 466/605
E E C 7
EECC
EED I
E E D 6E E D 7E E D 7€ E D 9EEDC
E E D E
E E D FE E E 2E E E 3EEESE E E 7E E E S
EO 2 6 0 0 1 7 R FO
EO 2 6 O O l E R OF
EO 2 6 0088 R I F9 D
7 2 4 0E E E A A O R7 2 38
F C
BE 0 0 4 2 RAC2 4 CO
74 5 83 C 4 07 5 2 5
E E E E A CE E E C 3 C E OE EE E 7 4 2 AE E F O DO EOE E F 2 D O EOE E F 4 DO EOE E F 6 E 4 10
E EF E 7 2 18
E E F A DO EOE E F C E 4 08
E EF E 7 2 1 2EFDO D O EOE F 0 2 DO EOE F 0 4 E4 0 4E F 0 6 72 OAE F O E DO EOE F O A D O EO
EFOC E 4 0 2E FO E 7 2 0 2
E F 10E F I O E 4 2 0E F 1 2E F l 2 08 2 6 0041 R
E F 1 6 EE E A E I RE F 19E F 1 9 C 3
E F AE F l A EA 5 E OE
E F l D EE E A E I R
E F 2 0 3 A DE
E F 2 2 7 4 OC
E F 2 4E F 2 9E F 2 EE F 2 FE F 3 0E F 3 2E F 3 4E F 3 EE F 3 9E F 3 DE F 3 FE F 4 2E F 4 4E F 4 5
EO OE 0 0 4 1 R 0 4C 6 06 0 0 4 3 R EOF 9c333 co3 3 F 6E8 E 4 0 0 4 2 R4 6B E E 4 0 0 4 2 R
E B 03E E E A E I R3 2 E 4c 3
- -- - - - -C L E A R S H I F T S T A T E S D ON T L E A V E P O S S I E I L T Y O F D A N G L I N G S T A T E S
OF M I S S E D B R E A K S
AND KE-FLAG , OFOH , C L E A R A L T , C L R L , L E F T A ND R I G H T
AND KE-FLAG-1,OFH , C L E A R P O T E N T I A L B R E AK O F I N S , C A P S
AND KE-FLAG-2, I F H , C L E AR F U N C T I O N S T A T E S
, S H I F T S
, N U M A N D S C R O L L S H I F T
J 1 6 - 7 P O P F , G E T T H E F L A G SJ 1 7
J C J 2 0C A L L R E S U L T S , GET THE NEC STATUSJ C J 2 0 L OO K F O R E RR OR
CLD , S E T T H E C O R R E C T D I R E C T I O N
MOV S 1 ,O FFS E T NE C S TA TUS , P O I N T T O S T A TU S F I E L D
-_-__-HECK THE RESULTS R E T U R N ~ D EV THE CONTROLLER
-----
THE CURRE NT S Y S TE M CON FIGU RA T ION HA S NO DMA I N ORDE R TOSTOP THE NEC AN EOT MUST BE PASSED TO FORCE THE NEC TO HAL TTHE RE FORE , THE S TA TUS RE TURNE D B Y T H E N EC U I L L A L U A YS S H OUAN € 0 1 ERROR I F T H I S IS THE ONLY ERROR RETURNED AND THENUMBER OF SECTORS TRANSFERRED EQUALS THE NUMEER SECTORSR EO U ES TE D I N T H I S I N T E R R U P T C A L L T H EN T H E O P E R A T I O N H ASC O M PL E TE D S U C C E SS F U L L Y I F AN EO T ER R OR IS RETURNED AND THEREQUESTED NUMEER OF SECTORS IS NOT THE NUMEER OF SECTORSTRANSFERRED THEN THE ERROR IS L E G I T I M A T E U HE N T HE E O 1ERROR IS I N V A L I D T H E S T A T U S B Y T E S R E T UR N E D A R E U PD A T ED T OR E F L E C T T H E S T A T U S O F T H E O P E R A T I O N I F D MA H A D B E E N P R E S E N T
L ODS NE C-S TA TUS , GET S T ICMP AL,EOH , IS T H I S T H E O N L Y E R RO R 7J E J 2 1 - 1 , NORMA L TE R MIN A TIO N, NO E RRORS A L A L . I , NOT E OT ERROR, B Y P A S S ERROR B I T S
S A L A L , I
S A L A L , I , TEST FOR CRC ERRORMOV AH, EAD-CRCJ C J19
S A L A L , I , TEST FOR DMA OVERRUNMOV AH, BAD-D MAJ C J19 , R U - F A I LS A L A L , 1
S A L A L I TEST FOR RECORD NOT FOUND
J C J19 , R U - F A I L
S A L A L , IS A L A L , I , T E S T M I S S I N G A D D R ES S M AR K
MOV AH, BAD-ADDR-M ARKJ C J19 . RU F A I L
...........................................................
, R U - F A I L
M O V AH: RE CO RD-NO T-FN~
-
------ N EC M U ST H A V E F A I L E D, RU-NE C-FA 1 L18
J 19 R U - F A I LMOV AH, BAD-NEC
OR D I S K E T T E - S T A T U S , 6 HCALL NUM-TRANS , HOU MANY WERE REALLY TRANSFERRED
R E T , RETURN TO CALLERJ 2 0 , RU-ERR
- _ - _ _ _PE RA TIO N WAS SUCCESSFULJ 2 1 - 1
M OV E L , t E P + 1 4 1 , GET NUMBER OF SECTORS PASSED
CALL NUM-TRANS , HOU MANY GOT MOVED, AL CO NT AIN S
C M P E L , A L , NUMEER REOUESTEO=NUMEER ACTUALLY
J E J 2 1 - 2 , TRA NS FE R S UCCE S S FUL
A RE A L E RROROR DIS K E TTE -S TA TUS ,RE CORD-NOT-FNDMOV NEC-STATUS+I ,EOH , S T I G ET S C O RR EC T V A L U ES T CRET
XOR S I , S I IND EX TO NEC-STATUS ARRAYMOV NEC -STAT USC SI1 .A; ZERO OUT BYT E STO
MOV NE C-S TA TUS C S I1 .A ; ZERO OUT E UV E , S T IJMP S HORT J2 1 -3 , OPN-OK
, FROM STACK
, NUM OF SECTORS
, TRANSFERRED7
--__-- P E R A T I O N A T TE M P TE D TO A C C ES S D A T A P A S T R E A L E O T T H I S IS
J2 1 -2 XOR A X ,A X , CL E A R A X FOR NE C-S TA TUS UP DA TE
I N C SI ~ O I N T INDEX A T ~ E C O N D Y TE
J 2 2 C A L L N UM -T RA NSJ2 1 -3 XOR A H,A H , NO ERRORS
RU-OPN ENDP
, D I S K - I N T
R E T
____________________----- - - - - -- - - - - -- - - - - - -- - -
T H I S R O U T I N E H A N D L ES T H E D I S K E T T E I N T E R R U P T A N IN T E R R U P TU I L L OC CU R O N L Y U HE N T H E O NE -S H O T T I M E R IS F I R E D T H I SO C CU RS I N A N ERROR S I T U A T I O N T H I S R O U T I NE S E T S E RR OR S I NT H E D I S K E T T E S T A T U S B Y T E A ND D I S A B L E S T H E ON E- SH O T T I M E RTHEN THE RETURN ADDRESS ON THE STACK IS CHANGED TO RETURNTO THE OP-END LA BE L
NONE
NONE DS P O I N T S A T B I O S DATA AREA CARRY FL AG IS S E T SOT H A T ER RO R U I L L B E CA UGHT I N THE E NV IRONME MT RE TURNE D TO
, I N P U T
, OUTPUT
___________________----------------------------
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 467/605
E F 5 7E F 5 7E F 5 7 1 EE F 5 E 5 0E F 5 9 5 2E F 5A 5 5E F 5 E E E 1388 R
E F 5 E 8E ECE F 6 0 O EE F 6 1 5 8
E F 6 2 38 4 6 OAE F 6 5 7 5 4 8E F 6 7 E8 4 6 OEE F 6 A 3 D E E 2 0 R
E F 6 D 7 C 4 0E F 6 F 3 D E E 6 6 RE F 7 2 7 D 3 8
E F 7 4 C 7 4 6 08 E E 6 5 RE F 7 9 8 1 4E OC 0001
E F 7 EE F E I
E F E 2E F E 4E F 8 6E F E EE F E E
E F E EE F S I
E F 9 3E F 9 5E F S A
E F S CE FA I
E F A 6E F A S
E F A AE F A DE F A EE F A FE F E 1
E F E 3E F E 4E F E 5E F E 6E F E 7E F E E
E A OOF4EC2 4 FO3 C DO7 5 1 4E E E A A O RB E 0 0 4 2 R
E A 4 4 0 1
A 8 0 27 4 0 7EO OE 0 0 4 1 R 0 3E E 1 3
EO OE 0 0 4 1 R EOC 6 0 6 0 0 3 E R 00
E A 0 0 F 25 D
E8 E E 4 5 R5 5E EEO 2 0E 6 2 05 D5 A5 8I FCF
E F C 7E F C 7E F C 7 C F
E F C E 03
E FC S 2 5E FC A 0 2E F C E 08
E F C C 2 AE F C D F FE F C E 50E FC F F 6EFDO 19
E F D l 04
ORG OE F5 7 H
P U S H DSPUSH AX
P US H DX , S A V E R E G I S T E RP U S H E P , S A V E T H E E P R E G I S T E RC A L L D D S , S E TUP DS T O P O I N T A T B I O S D A T A
------ C HEC K I F I N T E R RU P T OC CU RE D I N I N T I 3 OR W HE TH ER I T I S AS P U R I O U S I N T E R R U P TMOV EP,SP , P O I N T E P AT S T A C KPUSH CS , WAS I T I N TH E E 1 0 5 AR EAPOP AX
CMP A X ,WORD P T RC B P + IO I , GET INTERRUPTED SEGMENTJ NE 0 1 3 , NOT I N BIOS, E R R O R C O N D I T I O NMOV A X ,UORD P TR CE P +E l GE T I P ON THE S TA CK
D I S K - I NT P ROC FA R
CMP AX,OFFSET VERIFY-L~OP , RANGE CHECK IP FOR DISK, TRANSFER
J L 0 1 3 , BELOW TRANSFER CODECMP A X ,OFFS E T OP -E ND+I , UPPER RANGE OF TRANSFER CODEJG E 0 1 3 , ABOVE RANGE OF WATCHDOG TE RR AI N
P U L L OUT OF L OOPMOV WORD PT RC EP +El ,OF FS ET OP-ENDOR WORD PT RC BP +IP I , 1 , T U R N ON C AR RY F L A G I N F L A G S ON
------- A L ID D IS K E TT E INTE RRU P T CHANGE RE TURN A DDRE S S ON S TA CK TO
, STACK.................................................................
, +++NOTE **+, A U R I T E P R O T E C T E D D I S K E T T E WILL A LW A YS G ET S T U C K I N U R I T E L O O P, W A I T I N G F O R B E G I N N I N G OF E X E C U T I O N P H A S E U H E N T H E W A TC H DO G, F I R E S AN D T H E S T A T U S I N P O R T N E C -S T AT D X H ( X ME AN S D O N ' T C A R E )
,S T A T U S F RO M T H E R E S U L T P H A S E I S A V A I L A B L E T H E S T A T U S IS READ
, AND WRITE PROTECT IS C H E C K E D - F O R
MOV DX, NEC-ST ATI N A L,D X , GE T NE C S TA TUS B Y TEAND AL,OFOH , M ASK H I G H N I B B L ECMP AL,ODOH , I S E X E C U T I O N P H A S E D ON EJ N E D I I , S TU C K I N L OO PC A L L R E S U L T S , GE T S TA TUS OF OP E RA TIONMOV S 1 ,O FFS E T NE C-S TA TUS , ADDRESS OF BYTES RETURNED B Y
, NECMOV A L , CS 1 +1 1 , GET S T IT E S T A L . 0 2 H , W R I T E P R O T E C T S I G N A L A C T I V E ?J Z D I I , TIME OUT E RROROR D I S K E T T E - S T A T U S , U R I T E - P R O T E C TJMP S HORT D 1 3
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
------TIME OUT E RRORDI I OR DISKE TTE-S TATU S, TIME-OUT
MOV SEEK-STATUS, 0 , S E T RE CA L ON DRIV E S
D 1 2 MOV DX,NEC-CTL , ADDRESS TO NEC CONTROL PORT
POP EP , P OINT B P A T E A S E OF S TA CK E D
C A L L G E T - D R I V E , RE S E T A DA P TE R A ND DIS A B L E UDP U S H E P , RE S TORE FOR RE TURNE D CA L LO U T D X , A L
OUT I TAOO, ALPOP EPPOP DXPOP AXPOP D S
I R E T , RE TURN FROM INTE RRU P T
------ RE S E T THE NE C A N0 DI S A B L E WA TCHDOG
, PARAMETERS
D 1 3 MOV A L , E O I , G I V E E D 1 TO 8 2 5 9
D I K-I NT ENDP
, DIS K -E A S E, T H I S I S TH E S E T O F P AR A M ET E R S R E Q U I R E D F OR
, D I S K E T T E O P E R A T I O N T H EY A RE P O I N T E D A T BY THE, D A T A V A R I A B L E D I S K - P O I N T E R T O M O D I F Y T H E P A RA M E TE R S,, B U I L D A NO TH ER P A R A M ET E R B L OC K AN D P O I N T A T I T
.................................................
___-_____________-______________________----------ORG
DE
DE
DEDED BDEDE
DED EDBD E
D I K-EASEO E F C 7 HL A B E L B Y T EllOOl1llE
3
MOTOR-WAIT ,28
0 2 A HO F F H0 5 0 HO F 6 H2 54
SRTZC, HD UNLOAD=OF - I S T S P EC I FYB Y T EHD L O A D ZI , MODEZND DMA - 2NDS P E C I F Y B Y T EW A I T A F T E R O P N T I L M OT OR O F F5 1 2 E Y T E S l S E C T O RE O T ( L A S T S E CTOR ON TRA CK )GA P L E NGTHD T LGA P L E NGTH FOR FORMA TF I L L B Y T E F O R FO RM ATH E A D S E T T L E T'JME ( M I L L I S E C O N D S )MOTOR S TA RT T IME (118 SECONDS)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 468/605
E F D PE F D PE F D P F B
E FD 3 I EE F D 4 52
E FD 5 5 6E F D B 5 1E F D 7 53
E F DB E 8 1 3 8 8 R
E F D B B B OE 0010 RE FD F F 6 C 5 2 0E F E2 7 4 OD
E F E 4 B B 1 E 0008 RE F E B 81 F B 0 2 F BE F E C 75 03E F E E E 9 1 B C 3 R
E F F l B B F 2E F F 3 B A 9 C 0 0 7 8 RE F F 7 D I E 6E F F 9 B B 9 4 0008 R
E F F D OB D 2
E F F F 7 4 OCF O O l O A E 4F003 74 OEF 0 0 5 F E CCF 0 0 7 7 4 4 0F009 F E C CFOOB 7 4 2 8FOODF OO D 5 8FOOE 59F O O F 5 EF O l O 5 AF O l l I FF 0 1 2 C F
F O l 3 50F014 E EF 0 1 5 4 2
F 0 1 6 28 C 9F O l B E CF O 1 9 B A EOF O l B A B BOF O l D 75 OEF O l F E 2 F 7F O 2 l F E C BF D 2 3 7 5 F IF 0 2 5 BO CC 0 1F 0 2 B B O E 4 F 9F 0 2 B E B 1 4F 0 2 DF 0 2 D B O ODF 0 2 F 4 2F 0 3 0 E EF 0 3 l B O OCF033 E EF 0 3 4 5 8
--- I N T 17 --------------__-_-_____________________----------, P R I N T E R - I O
T H I S R O U T I NE P R O V I D E S C O M M U NI CA T IO N U I T H T HE P R I N T E R(AHl=O P R I N T TH E CH AR AC TE R I N ( A L )
ON RETURN, A H = I I F C H A RA CT ER C OU LD N O T B E P R I N T E D( T I M E O U T ) , O TH ER B I T S S E T A S ON N OR MA L S T A T U S C A L L
R ET UR NS U I T H ( A H ) S ET U I T H P R I N T E R S TA T US
2 - 1 0
( A H ) = l I N I T I A L I Z E TH E P R I N TE R PO RT
( A H ) = 2 R E AD T HE P R I N T E R S T A TU S I N T O ( A H )7 6 5 4 3
: T I M E O U T: UNUSED-
: 1 = I / : ERROR
a I = SELECTED1 = OUT OF PAPER' I = A&NoULEDGEI- 1 = N O T B U S Y
( D X I = P R I N T E R TO B E U S E D ( 0 , 1 , 2 1 C O R RE S P ON D IN G TO A C TU A L
, DATA AREA PRINTER-BASE CO NTA INS THE BASE ADDRESS OF THE PR INT ER, C A R D ( S 1 A V A I L A B L E ( LO C A T E D A T B E G I N N I N G OF D A T A S EG ME NT , 4 0 8 H, ABSOLUTE, 3 UORDSI , UNLESS THERE IS O NL Y A S E R I A L P R I N T E R, A T TA C H ED , I N U H I C H C A S E T H E U OR D A T 4 0 B U I L L C O NT AI N A 0 2 F B H, R E G I S T E R S AH IS M O D I F I E D
V A L U E S I N P R I N T E R -B A S E A RE A
ALL OTHERS UNCHANGED--------------__----____________________-----------------------
ASSUME CS CODE,DS DATAORG OEFD2H
S T I , I N T E R R U P T S B A C K O N
P U S H D S , SAVE SEGMENTPUSH DXP U S H SIPUSH CXP U S H B XC A L L DDS
, R E D IR E C T T O S E R I A L ON LY I F, I > S E R I A L P R I N T E R IS ATTACHED,AND, 2 > UO RD A T P R I N T E R B A S E 0 2 F B H, P OUE R O NS U I L L O NL Y P UT A 0 2 F B H I N T HE P R I N T E R B A S E I F T H E R E 'S, N O P A R A L L E L P R I N T E R A T T A C H E D
P R I N T E R - I O P RO C F A R
MOV CX, EQ UIP-F LAG , G ET F L A G I N CXTEST CH, OOlOOOOOB , S E R I A L A T T A C H E D ?J Z BO ,NO -HANDLE NORMALLYMOV B X , PR I NT E R -B A S E , S E E I F T H E R E ' S A N R S 2 3 2CMP B X . 0 2 F B H , B A S E I N T HE P R I N T E R B A SEJ N E BO
BOO J MP B I -A , I F T HE RE IS R E D I R E C T
, C O N T R O L IS P AS SE D T O T H I S P O I N T I F T HE RE IS A PARALLEL OR, T H E R E ' S N O S E R I A L P R I N T E R A TT AC HE DBO MOV S I , D X , G E T P R I N T E R P A R M
, E L S E H A N D L E A S P A R A L L E L
MO V B L , P R I N T - T I M - O U T C S I I L O A 0 T I M E O U T V A L U ES H L SI, I , U OR b O F F S E T I N T O T A B L EM O V D X , P R I N T E R - B A S E [ S I l , GET BASE ADDRESS FOR PRINTER
, CARDOR DX,DX , TEST DX FOR ZERO, IN DI CA T I NG NO
, P R I N T E RJ Z 8 1 , I F NO P A R A L L E L , R E TU RNOR AH,AH , TEST FOR (AHIsOJ Z B 2 , P R I N T - A LDEC AH , T E S T FO R ( A H ) = lJ Z B B , I N I T - P R TDEC AH , T E ST F OR ( A H l = 2J Z 8 5 , P R I N T E R S T A T U S
POP BXPOP cxPOP SI , RECOVER REGISTERSPOP DX , RECOVER REGISTERSPOP D SI RET
B I , RETURN
------ P R I N T TH E CH AR AC TE R I N ( A L )8 2 P U SH A X
OUT DX,ALI N C D X
------U A I T B U S Y
i33 SUB83-1 I N
MOVT E S TJ N ZLOOPDECJ N ZORANDJMP
MOVI NCOUTMOVOUTPOP
84
cx, cxAL, DXAH, A LA L , BOH8 483-1
B L8 3AH, I
A H O F 9 HS HO RT 8 7
AL, ODHDXDX, ALAL, OCHDX, ALAX
S A V E V A L U E TO P R I N TOUTPUT CHAR TO PORTP O I N T T O S T A T U S P O R l
I N N E R L OO P ( 6 4 K )G E T S T A T U SS T A T U S T O AH A L S OIS T H E P R I N T E R C U R R E NT L Y B U S YOUT-STROBEL OO P I F N OTDROP OUTER LOOP COUNTMAKE ANOTHER PASS I F NOT ZEROSET ERROR FLAGT U RN O F F T H E UN U S ED B I T SR E TU R N U I T H ER RO R F L A G S E TOUT-STROBESET THE STROBE HIGH
SET THE STROBE LOU
RECOVER THE OUTPUT CHAR
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 469/605
F 0 3 5F O 3 6F O 3 AF 0 3 EF 0 3 CF 0 3 EF 0 4 1
F04 iF042F044F047
F049F 0 4 AF 0 4 BF 0 4 CF 0 4 EF 0 4 FF052F052F 0 5 3F O S S
F057F O S EF O 5 AF065F065
50BE 9 4 0008 R .4 2E C8 A E O80 E 4 F E
5 AE A C 280 F 4 4 8E E C 4
504 24 2BO 08
E EB 8 O 3 E B
4 875 F DEO OC
E EE B D C
E 9 ODOE R
F 0 6 E
F 0 6 E E 8 1388 RF 0 6 B B E O O l E RF 0 6 E EB 04F070 EB C 4F 0 7 2 EO E 4 EO
F 0 7 S 7 4 ODF077 3 2 COF079 E 6 A 0
F078 BE 2 0 0 0F 0 7 E B E 0036 RF O E 1 E E 0 9 E C RF O B 4 C F
F085
F O B 5F O B SF O E 7F O E EF O E A
FOBDF O E FF 0 9 0F092F093F095F096F 0 9 EF099F O S A
F 0 9 CF 0 9 DF09FF O A 2
F O A 3F O A 4
F O A 4F O A 4
F O A 4
F O A BF O B 0
BO EOE EE E 00E 3 E A 03
EO OCE EE E 00
42EO 00
E EE B 004 24 2EO OF
E EE E 00E 3 E A 03E C
c3
3 8 28 2 C 06 I F 0619
I C 0 2 07 06 0700 00 DO 00
P R I N T E R S T A T U S-----65 PUSH AX SAVE AL REGE 6 M OV D X, P R I N T E R - B A S E C k I I
I N C D X
I N A L, DX , G E T P R I N T E R S T A T U SMOV AH,ALAND AH, OFBH , T UR N O F F UN U SE D B I T S
POP DX , RECOVER AL REGMOV AL,DL , G E T C H AR A C TE R I N T O A LXOR AH, 48H , F L I P A C OU PL E OF B I T SJMP El RETURN FROM ROUTI NE
87 , STATUS-SET
INITIALIZE THE PRINTER P ~ R T-----B B PUSH AX , S A V E A L
I N C D X , PO I N T TO OUTPUT PORTI N C D XMOV AL,B , SE T I N I T L I N E L OUO U T D X , A LMOV AX, 1000
89 , I N I T - L O O P
DEC AX , LOOP FOR RESET TO TAKEJ N Z E 9 , I N I T - L O O PMOV AL,OCH , NO INTER RUP TS, NON AUTO LF, I N I T
O U T D X , A LJ M P 86 , PRTJTATUS-1
O R G O F 0 6 5 HJMP NEAR PTR V I DEO - I O
, HIGH
P R I N T E R - I O E N D P
................................................, SUB ROU TI NE TO SAVE ANY SCAN CODE REC EI VED ,
,EV T HE N M I R O U T I N E ( P AS SE D I N A L )
, D U R I N G P O S T I N T HE K E Y BO A R D B U F F E R, C A L L E D T HR OU GH I N T 4 E H................................................
KEY-SCAN-SAVEASSUMEC A L LnovnovMOVAND
JZXOROUTnovnovC A L L
K S - I : I R E T
KEY-SCAN-SAVE
PROC FARDS: D A T ADDS . P O I N T D S TO DATA AREA
CSI I , A L ; SAVE SCAN CODEAX, SP ; CHECK FOR STACK UNDERFLOWAH,11100000E ; ( T H E S E B I T S WILL B E 111 I F
KS-1A L , A LOAOH, AL ; SHUT OFF NM IB X , 2 0 0 0 H . E R R O R C O D E 2 0 0 0 H
E-MSG ; AND HA LT SYSTEM
ENDP
SI,OFFSET KE-EUF~ER ; POINT T O FIRST L OC . IN BUFFER
; UNDERFLOU HAPPEND)
SI,OFFSET KEY-ERA ; POST MESSAGE
; RETURN TO CALLER
-~
; S U B R O U T I N E T O S E T A N I N S 8 2 5 0 C H I P ’ S B AU D R A T E TO 9600 EPS AND; D E F I N E I T ’ S D A T A WORD AS H A V I N G B E I T S /W O R D , 2 ST O P B I T S , A N D; ODD P A R I T Y .
; EXPECTS TO BE PASSED:( D X ) = L I N E C O NT R OL R E G I S T E R
; UPON RETURN:( D X ) = T R A N S M l T I R E C E I V E B U F F E R A D D R E S S
; A L SO , A L T E R S R E G I S T E R A L . A L L O T H ER S R E M A I N I N T A C T .
5 8 2 5 0 P R O CMOVOUTJMPSUE
novOUTJMPI NCnovOUTJ M PI NC1NCnov
NEARAL, EOH
DX, AL1 + 2DX. 3
A L , 1 2DX, AL1+2D XAL, 0
DX, AL1 + 2D XDXA L , 0 0 0 0 1 1 1 1 E ,
OUT DX, ALJ M P 1 + 2S U B D X . 3I N A L,D X
R E T58250 ENDP. ------ T A B L ES F O R U S E I N S E T T I N G
VI DEO-PARMS LAB EL BYTEORG OFOA4H
S E T D L A B = 1
110 DELAYL S 8 OF D I V I S O R L A T C H
D I V I S O R = 12 PRODUCES 9600 E P SS E T L S E110 DELAYMSB O F D I V I S O R L A T C HHIGH O R D E R O F D I V I S O R SS E T MSBI 1 0 DELAY
L I N E C ON TR O L R E G IS T E R8 B I T S I W O R D , 2 ST O P B I T S , OD DP A R I T V
110 DELAYR E C E I V E R B U F F E RI N C AS E U R I T I N G T O P OR T L C RCAUSED DATA READY TO GO HIGH
OF CRT MODE
-.------ I I T-TABLE
DE 3EH, 2 8 H , 2C H, 0 6 H , l F H , 6, 1 9 H ; SETUP FOR 40x25
DB I C H , 2 , 7 , 6 , 7DE O , O , O , O
A-82 R O M B I O S
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 470/605
= OB10
F O E 4
FODPF O C O
F O C 4
. F O C EF O D O
F O D 4
F O D EF O E 0
F O E 4F O E 4
F O E 7F O E 9
F O E CF O E CF O E F
F O F 1F O F 2F O F 3F O F 4F O F 7F O F 7F O F 7F O F 9
F O F BF O F DF O F F
F103F 105F 107F 107
F IOEF 1 0 DF IODF l l OF112F113
7 1 50 5 A O C if 619I C 02 07 06 0700 00 00 0 0
38 28 28 06 7F 06
6 470 02 0 1 26 0700 00 00 00
71 50 56 OC 3F 0632
38 02 03 26 0700 00 0 0 00
EO F C 0 4
72 03E 9 F531 R
E 8 F O F 7 REE F3
06I FADE 9 O F 7 0 R
B A C F32 EOEE F l
D l E 6BE 84 0050 R
33 DEE3 06
0 3 I E 0 0 4 C R
E 2 F A
E 8 E 5 C 2 R
03 DEc3
F113
F l l 3 80 F C 0 4F116 72 0 3F l l E E 9 F3F1 RF l l EF l l E E A E 3F l l D 50
F l l E 5 1
F l l F E 8 F O F 7 R
F122 8E F EF124 59
F125 58
F126
F126 A BF127 E 2 F DF129 E 9 O F 7 0 R
F 1 2 C
MOO40 EQU 8 -V I DEO-PARMS
OB 71H, SOH, 5AH. OCH, I FH, 6, 1 9 H , S E T U P F O R 80x25
DE I C H , 2 , 7 , 6 , 7OB o , o , o , o
08 3EH, E H , 2E H , 0 6 H , 7 F H , 6 , 6 4 H , S E T U P F OR G R A P H I C S
D f l 70H, , 1, 26H, 7OB o , o , o , o
O f l 71H, OH, 6 H , OC H, 3 F H , 6 , 3 2 H , S E T U P F O R G R A P H I C S
, U S I N G 3 2 K O F M EM OR YB 3 8 H , 2,3, 2 6 H , 7DE 0 . 0 , O . O , (MODES 9 & A )
________r _ _ _______ _ _ __ __ ___
, READ-AC-CURRENTT H I S R O U T I N E R E AD S T HE A T T R I B U T E A N 0 C H A RA C TE R A T T H EC U R R E N T C U R S O R P O S I T I O N A N 0 R E T U R N S T H E M T O T H E C A L L E R
( A H ) = CURRENT CRT MODE(BH) = D I S P L A Y P A G E ( ALPHA MODES ONLY )
( D S ) = DATA SEGMENT(6s) REGEN SEGMENT
( A L ) C H AR R EA D( A H ) = A T T R I B U T E R E A D
ASSUME CS CODE OS D A T A E S D A T A
, I N P U T
, O U T P U T
_____________________---__------__--------
REAO-At -CURRENT PROC NEAR
C M P A H . 4
J C C 6 0J M P G R A P H I C S - R E A 0
C A L L F I N D - P O S I T I O NMOV S1 , EXP U S H E SP O P D SLODSWJ M P V I D E O - R E T U R N
READ-AC-CURRENT ENOPF I N O - P O S I T I O N P RO C N E A R
C 6 0 .
M O V C L , B HXOR CH,CH
M O V S I . C X
I S T H I S G RA PH IC S’
REAO-AC-CONTINUE
E S T A B L I S H AD D RE SS IN G I N S I
G E T S E G M E N T F O R Q U I C K A C C E S SG E T TH E C H A R I A T T R
D I S P L A Y P A G E TO C X
M OV E T O S I F O R I N D E X
S AL S I . 1 , t 2 FOR WORD OFF SE TM OV A X , t S I + O F F S E T C U R SO R -P O S NI , GET ROUlCOLUMN OF
XOR EX,EX , SET ST ART ADDRESS TO ZEROJ C X Z C 6 2 , NO-PAGE
ADD BX,CRT-LEN , L E N G T H O F B U F F E RL O O P C 6 1
C A L L P O S I T I O N , D E T E R M IN E L O C A T I O N I N RE G ENADD EX, AX , ADO TO START OF REGENR E T
F I N O - P O S I T I O N E N D P
, WRITE-ACJURRENT
, T H A T P A G E
C 6 1 , PAGE-LOOP
C 6 2 , NO-PAGE
.........................................
T H I S R O U T I N E W R I T E S T H E A T T R I B U T E AN D C HA R AC T ER A TT H E C UR R E NT C UR SO R P O S I T I O N
(A H) CURRENT CRT MODE(EH) D I S P L A Y P A G E( C X ) = C O U N T O F C H A R A C T E R S T O W R I T E( A L ) = CHAR TO WRI TE( E L ) A T T R I B U T E O F C HA R T O W R I T E
( 0 5 ) = DATA SEGMENT( E S ) R E G EN S E GM E N T
NONE
, I N P U T
, O U T P U T
L R I TE-AC-CURRENT PROC NEAR
CMP AH.4J C C 6 3J M P G R A P H I C S - W R I T E
C 6 3 :M O V A H . E LP U S H A XP U S H cxC A L L F I N D -P O SI T I ONM O V 0 1 , E XPOP c xPOP AX
STOSWL O O P C 6 4J M P V I D E O - R E T U R N
WRITE-At -CURRENT ENOP
C 6 4
I S T H I S G R AP H IC S?
WRITE-AC-CONTINUEG E T A T T R I B U T E T O A HS A V E O N S T A C KS A V E W R I T E C O U N T
ADDRESS TO 0 1 R E G I S T E RW R I T E C O U N TC H AR AC T ER I N A X R E G
WRITE-LOOP
P U T T H E C H A R I A T T RA S M A NY T I M E S A S R E Q U E ST E D
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 471/605
F 1 2 CF 1 2 C 80 F C 04F 1 2 F 7 2 03F131 E 9 F 3 F l RF134 50F135 51F 1 3 6 E 8 F O F7 RF139 88 F BF l 3 B 59F 1 3 C 58F 1 3 DF 1 3 D 8 A C 3F l 3 F AAF 1 4 0 47F 1 4 1 E 2 F AF l 4 3 E 9 O F 7 0 RF 146
F 146F 146F 148F 1 4 DF 150F 153
F 155F 157F 159F 158
F 1 5 EF 1 5 EF161
F 1 6 2F 1 6 3
F 164F168F 1 6 AF 1 6 CF 1 6 EF 170F 1 7 2F 1 7 4F 175F 176F 177F 1 7 AF 1 7 CF 1 7 EF180
F 1 8 2F 184
EO 3 E 0 0 4 9 R O A
7 4 11E 8 F l D 9 R26: E A 042 2 c 4
D 2 E OE A C ED 2 COE 9 O F 7 0 R
E 8 F l D 9 R5 25 150
26: E A 44 0 122 c40 2 EOEA CEF E C 1D 2 C OBE DE5 8595 A2 6 : E A 042 2 c 4D 2 E OEA CED 2 C OOA C3E 9 O F 7 0 R
, WR I TE-C-CURRENTT H I S R O U T I N E W R I T E S T H E C H A RA C TE R A TT H E C U R R E NT CU R SO R P O S I T I O N , A T T R I B U T E U N CH AN G ED
( A H ) = CURRENT CRT MODE(BH) D I S P L A Y P A G E( C X ) = COUNT OF CHARACTERS TO URI TEI A L ) = CHAR TO WRI TE( D S ) = DATA SEGMENT( E S ) = REGEN SEGMENT
NONE
, I N P U T
, OUTPUT
............................................~ R IE-C-CURRENT PROC NEAR
CMP AH. 4 , IS T H I S G R A P H I C S 'J C C 6 5JMP GRAPHI CS-WRI TE
PUSH CX , S A V E U R I T E C O U N T
C A L L F I N D - P O S I T I O NM O V D I . E X , ADDRESS TO D IPOP cx , U R I T E C O U N TPOP ex , EL H A S C H A R T O U R I T E
MOV AL,EL , RECOVER CHAR
S T O S BI N C D I , B UM P P O IN T E R P A S T A T T R I B U T EL O O P C 6 6 , A S M A N Y T I N E S A S R E O U E S T E DJMP VIDEO-RETURN
C 6 5 P U S H A X , SAVE ON STACK
C 6 6 , WRITE-LOOP
, P U T T HE C H A R I A T T R
URITE-C-CURRENT ENDP
............................................READ DOT -- U R I T E D O TT H E S E R O U T I N E S U I L L U R I T E A D OT , OR R E AD T H E
E N T R Y --O T A T TH E I N D I C A T E D L O C A T I O N
DX ROU (0-199) (THE ACTUAL VALUE DEPENDS ON THE MODE)CX = COLUMN ( 0-639) ( THE VALUES ARE NOT RANGE CHECKED 1
A L D O T V A L U E T O W R I T E ( 1 , 2 O R 4 B I T S D E P E N D I N G O N M OD E,R E O 'D F OR U R I T E D OT O NL Y, R I G H T J U S T I F I E D )
B I T 7 O F A L 1 I N D I C A T E S XO R TH E V A L U E I N T O T H E L O C A T I O N
DS = DATA SEGMENTE S = REGEN SEGMENT
E X I TA L = D OT V A L U E R E A D . R I G H T J U S T I F I E D , R E A D O NL Y..............................................ASSUME CS CODE, DS DAT A. ES DATA
CMP CRT-MODE,OAH , 6 4 0 x 2 0 0 4 C O LO R7
J E READ-ODD , YES, HANDL E SEPARAT ELYC A L L C 7 2 , D E T E R M I N E B Y T E P O S I T I O N O F D O TMOV AL,ES CSll , G E T T H E B Y T EA N D A L , A H , M AS K O FF T H E O TH ER B I T S I N TH E
S H L A L , C L , L E F T J U S T l F V T HE VA L U EMOV CL,DH , G ET N U MB ER O F B I T S I N R E S U L TR O L A L , C L , R I G H T J U S T I F Y T H E R E S U L TJMP VIDEO-RETURN - , R E T U R N F R O M V I D E O 10
, I N 6 4 0 x 2 0 0 4 CO LO R MO DE , T H E 2 C O LO R BITS ( C 1 , C O ) A R E D I F F E R E N T, THAN OTHER MODES CO IS I N THE E VE N B YT E, C l IS I N T H E F O L L O U IN G, ODD B Y T E - B OT H A T T H E S AM E B I T P O S I T I O N U I T H I N T H E IR R E S P E C T IV E
READ-DOT PROC NEAR
, B Y T E
B Y T E SR E ~ D - O D D
C A L LP U S HP U S HP U S H
novANDS H LMOVI NCR O LMOVPOPPOPPOPMOVANDS H LMOVR O LORJ M P
C 7 2DXcxAX
A L , E S : CSI+l lAL, AHA L , C LCL , DHC LA L . C LEX, AXAXcxDXA L , E S : CSll
AL, AHA L , C LCL , DHA L , C LA L, E LVIDEO-RETURN
D E T E R M I N ES A V E I N F O
P O S l T I ON OF DOT
G ET C l C OLOR B I T FRO M ODD B Y T EM A SK O F F O T HE R B I T SL E F T J U S T I F Y T H E V A LU EG ET N UM BE R OF B I T S I N R E S U L T
R I G H T J U S T I F Y T H E R E S U L TS AVE I N EX REGR E S T O R E P O S I T I O N I N F O
G E T CO C O LO R B I T F R O M E V E N B Y T EM A SK O F F O TH E R B I T SL E F T J U S T I F Y T HE V A LU EG ET N UM BE R O F B I T S I N R E S U L TR I G H T J U S T I F Y T H E R E S U L TC OM EIN E C l L CO
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 472/605
F I E 7
F 1 8 7F 187F I E 8F I E 9F 1 E AF I EE
F 1 E E
F 190
F 192F 195F 196
F199F 19E
F 1 9 D
F 19FF 1 A 1F 1 A lF 1 A 4F I A SF 1 A 6F I A 7F I A CF A EF A FF 180
F 1 8 2
F 185
F 1 8 7F 1B9
F 1ED
F I B EF l C lF I C 3
F I C 5F I C 7F I C 9F I C 9F C 0F I C EF l D lF l O lF l D 3F I D 5F I D 5F 1 D 7F I D 9
5 15 25050E E F 1 D 9 R
0 2 E E
2 2 c42 6 . E A OC5 8F 6 C 3 E O
75 36F 6 D 4
2 2 ccOA C I
2 6 : E8 0 45 8SA5980 3 E 0 0 4 9 R OA75 2 05050D O E 8E E F I D S R
0 2 E 8
2 2 c 42 6 : E A 4 C 0158
F 6 C 3 EO75 1 2F 6 D 4
2 2 ccOA C I
2 6 : EE 4 4 0 1
5 8E 9 O F 7 0 R
3 2 C IE E CC
3 2 C IE E F O
F I D 9F I D S 53F I D A 50
F 1DE
F 1DDF O EF I E 1F E 6F I E 8F I E E
F I E DF E EF l F lF I F 3F I F 6F I F 6F 1 F EF I F DF 2 0 0
F 2 0 2F 2 0 5F 2 0 7F 2 0 E
EO 2 85 2EO E 2 F EEO 3 E 0 0 4 9 R7 2 0 3EO E 2 F CF6 E 2
5 AF 6 C 2 0 17 4 0 3
05 2000
E O 3 E 0049 R7 2 08
F 6 C 2 0 274 0 3
05 4 0 0 0EE FO5 8E8 D I
09
ENDP
PRDC NEAR
cxDXAXAXC 7 2
A L , C L
AL, AHC L,E S [ S I 1E XE L , EOH
C 7 0AH
CL, AHA L , C L
E S C S I 1 , A LAXDXc xCRT-MODE, OAHC 6 9AXAXA L , I
C 7 2
A L , C L
A L , A HCL ,E S C S 1 + 1 1E XE L , EOHC 7 I
AH
CL, AHA L , C L
E S C S + l I, A LAXVIDEO-RETURN
A L , C LC 6 7
C 7 I , XOR-DOTX OR A L ,CL , E X C L U S I V E OR THE DOTS
J M P C 6 E , F I N I S H UP THE U R I T I N GURITE -DOT E NDP
, T H I S S U B R O U T I N E D E T E R M I N E S TH E R EG E N B Y T E L O C A T I O N O F T H E, I N D I C A T E D R O U CO LU M N V A L U E I N G R A P H I C S M OD E, E N T R Y --, DX I OY V A L UE (0 -199)
, CX = C OL UM N V A L U E ( 0 - 6 3 9 )
, SI I F F S E T I N T O R EG E N B U F F E R F O R B Y T E O F I N T E R E S T, A H = M AS K TO S T R I P O F F T H E B I T S OF I N T E R E S T, C L = B I T S TO S H I F T TO R I G H T J U S T I F Y T HE M AS K I N A H, DH = 8 B I T S I N R ES U LT
;72 PROC NEA R
..............................................
, E X I T --
...............................................
P U S H E X , S A V E E X D U R I N G O P E R A T I O NP US H A X , U I L L S AV E A L D U R I N G O P E R A T IO N
------ D E T ER M IN E I S 1 B YT E I N I D I C A T E D ROU B Y M U L T I P L Y I N G R OU V A LU E
READ-DOT
UR I TE -DOT
P U S HP U S HPUSH
C A L L
SHR
ANDHOVPOPT E S T
J N ZNOT
ANDOR
MOVPOPPOPPOPCMPJ N EP U S HP U S HSHRC A L L
SHR
ANDHOVPOPT E S TJ N ZNOT
ANDOR
MOVPOP
C 6 9 : J M PC 7 0 :
XORJMP
pusn
C 6 7 :
C 6 E :
, S A V E COL, SAVE ROU, S A V E D O T V A L U E, T U l C E, D E T E R M I N E B Y T E P O S I T I O N O F T H E
, DOT, S H I F T TO S E T U P T HE B I T S FO R, OUTPUT, S T R I P O F F TH E OT HE R B I T S, GE T THE CURRE NT B Y TE, RECOVER XOR FLAG, IS I T ON
, YES, XOR TH E DOT, SET THE MASK TO REMOVE THE, I N D IC A T E 0 B I T S
, OR I N TH E N E U V A L U E O F TH O SE B I T S, F I N I S H - D O T, R E ST O R E T H E B Y T E I N M EM OR Y
, RECOVER R O U, RECOVER COL, 6 4 0 x 2 0 0 4 C OL OR 7, N 0 , J U M P, S A V E D O T V A L U E, T U l C E, S H I F T c l B I T I N TO c 0 P O S I T I O N
, DOT
, D E T E R M I N E B Y T E P O S I T I O N O F T H E
, S H I F T T O SE T U P TH E B I T S FO R
, OUTPUT, S T R I P O F F TH E OT HE R B I T S, GE T THE CURRE NT B Y TE, RECOVER XOR FLAG, IS I T ON, YES. XOR THE DOT, SET THE MASK TO REMOVE THE, I N D I C A T E D B I T S
, OR I N T H E N E U V A L U E O F T H OS E B I T S
, F I N I S H - D O T, R E S TO R E T H E B Y T E I N M EM OR Y
, RE TURN FROM V IDE O 10
, XOR-DOT, E X C L U S I V E OR THE DOTS. F I N I S H UP TH E U R I T I N G
c 7 3
c 7 4
c 7 5
B Y 40(MOVP U S HANDCMPJ CANDH U L
POPT E S TJ ZADD
CMPJ CTE S TJ ZADDMOVPOPMOV
L OU B I T O F ROU D E T E R M I N E S E V E N l O D D , EO E Y T E S / R O UA L , 40DX , S A V E ROY V A L UEDL , OFE H , S T R I P O F F O D D lE V EN 8 1 1CRT-MOOE.09H , M O D E U S I N G 3 2 K R E G E N 7c73 , NO, JUMPDL , OFCH , S T R I P O FF LO U 2 B I T SD L , A X H A S A DD R E SS O F I S 1 B Y T E O F
, I N D I C A T E D RO U
DX , R EC OV ER I TOL, 1 , T E S T F O R E V E N l O D Dc 7 4 , JU MP I F E V E N RDUA X , 2 0 0 0 H , O F F S E T T O L O C A T I O N O F ODD ROUS
, EVEN-ROUCRT MODE,OSH , M O D E U S I N G 3 2 K R E G E N 7c 7 5 - , NO, JUMPD L , 2 , TE S T FOR ROU 2 OR ROU 3
c 7 5 , J UM P I F R OU 0 OR I
A X , 4 0 0 0 H , O F F S E T T O L O C A T I O N O F RO U 2 OR 3
SI .*x , HOV E P OINTE R TO SIAX , RECOVER AL VALUEox, c x , COLUMN VALUE TO DX
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 473/605
F 2 0 AF 2 0 DF 2 10
F 2 15
F 2 1 7F 2 CF 2 E
F 2 2 1F 2 2 4F 2 2 9F 2 2 BF 2 3 0F 2 3 2F 2 3 5
F 2 3 8
F 2 3 AF 2 3 CF 2 3 EF243F245F 2 4 7
F 2 4 9
F 2 4 B
F 2 4 D
F 2 4 FF 2 5 1
F 2 5 3F 2 S 5
F257F 2 S 8F 2 S 9
BE 0 2 C OE9 0 3 0 280 3 E 0 0 4 9 R 04
7 4 2 1B O 3 E 0049 R 0 574 1 ABE 0 4 F O
E9 010180 3 E 0049 R OA7 4 0780 3 E 0049 R 067 5 06BE 018089 0703
2 2 E A
D 3 E A03 F 280 3 E 0049 R OA75 0203 F2E A F7
2 A c9
D O C 8
0 2 CDF E C F75 F 8
8 A E 3D 2 E C
5 Bc3
F 2 S 9F 2 5 9 EA D 8F 2 S B 8B C l
F 2 5 0 E 8 F 7 2 C RF 2 6 0 BE F8
F 2 6 2F 2 6 4F 2 6 B
F 2 6 A
F 2 6 CF 2 7 1
F 2 7 3F 2 7 5F 2 7 7F 2 7 CF 2 7 FF 2 8 3F 2 B 6F 2 B A
F 2 8 C
F28E
28 D l81 C 2 0101DO E 6
D O E 6
BO 3 E 0 0 4 9 R 0674 I D
D O E 2D I E 780 3 E 0049 R 0 47 4 12BO 3 E 0049 R 05
74 OB80 3 E 0 0 4 9 R OA74 04
D O E 2
D l E 7
------ D E T E R M I N E G R A P H I C S MO DE C U R RE N TL Y I N E F F E C T, SE T UP THE REG I STE RS ACCORDI NG TO THE MODE, C H = MASK FOR LOW OF COLUMN ADDRESS ( 7 1 3 1 1 F O R H IG H 1M E O IL O W R E S )
,EL = M AS K TO S EL E C T B I T S F RO M P O I N T E D B Y T E ( 8 O H I C O H 1 F O H FO R H I M I L ),BH = N UM BER O F V A L I D B I T S I N P O IN T E D B Y T E ( 1 1 2 1 4 F O R H I M I L )
,CL = x OF A D D R E S S BITS IN COLUMN VALUE ( 31211 FOR HIMIL)
MOV BX. 2COHM O V C X , 3 0 2 H , SET PARMS FOR WED RESCMP CRT-MODE, 4J E C 7 7 , H A N D L E I F ME0 RESCMP CRT-MODE, 5J E C 7 7 , H A N D L E I F ME0 RESMOV BX. 4FOH
MOV CX, lOlH , SET PARMS FOR LOW RESCMP CRT-MODE, OAHJ E C 7 6 . HANDLE MODE A AS HIGH RESCMP CRT-MODE, 6J N E C 7 7 , H A ND LE I F L OU R E S
MOV CX . 70 3H SET PARMS FOR HIGH R E SC76 MOV BX, l 8OH
------ D E T E R M I N E B I T O F F S E T I N B Y T E F RO M CO LU MN M A SK
------ D E T E R M I N E B Y T E O F F SE T F O k T H I S L O C A T IO N I N C OLU MNSHR DX, CL , S H I F T BY CORRECT AMOUNTA D D S I , D X , I N C R E M E N T T H E P O I N T E RCMP CRT MOOE,OAH , 6 4 0 x 2 0 0 4 COLOR7J N E C 7 8 - , NO, JUMPADD S1,DX , I N C R E M E N T TH E P O I N T E R
;77 AND CH, OL ADDRESS OF PE L W I T H I N BYT E TO CH
C7 B MOV DH BH GET THE x OF BITS IN RESULT TO DH
------ M U L T I P L Y B h ( V A L I D B I T S i N BY T E) B Y CH ( B I T O F F SE T)S U B C L , C L , Z ER O I N T O S TO R AG E L O C A T I O N
C 7 9 R O R A L , 1 , L E F T J U S T I F Y T H E V AL UE I N A L, ( F O R W R I T E )ADD CL , CH , AD D I N T HE B I T O F F S E T V A L U EOEC BH , LOOP CONTROLJ N Z C 7 9 . O N E X I T , C L H A S S H I F T CO UN T TO. R ES TO RE B I T SMOV AH,BL , GET MASK TO AHSHR AH,CL , MOVE THE MASK TO CORRECT
POP EX , RECOVER REGR E T , R E TU R N W I T H E V E R Y T H I N G S E T U P
, L O C A T I O N
C 7 2 E N D P
, S C R O L L U P, T H I S R O U T I N E S C R O L L S U P T H E I N F O R M A T I O N ON T HE C R T, E N T R Y --, CH,CL = U P P E R L E F T C O R N E R O F R E G I O N T O S C R O L L, D H , D L = LOWER RI GH T CORNER OF REG I ON TO SCROLL, B O T H OF T H E A B OV E A RE I N C H AR A CT ER P O S I T I O N S
, BH = FILL V A L U E F O R B L A N K E D L I N E S
, D S = DATA SEGMENT, E S = RLGEN SEGMENT
, N O T H I N G , T H E S C R E EN I S S C R O LL E D
......................................................
, AL = x LNES TO SCROLL ( A L = O MEANS BLANK THE ENTIRE FIELD)
, E X I T --........................................................I;RAPHICS-UPROC NEAR
MOV EL , A L , S AV E L I N E C OUNT I N B LM OV A X , C X G E T U P P ER L E F T P O S I T I O N I N T O A X R EG
------ USE CHARACTER SU~ROUTI NE FOR POS T ON NG
------ A D D R ES S RE T U R N ED I S M U L T I P L I E D B Y 2 F R O M C O RR EC T V A L U ECALL GRAPH-POSNMOV D1 , AX
D E T E R M I N E S I Z E O F W IN DO WS U B D X . C X
. ------
ADO OX; IOlHS A L D H . 1
S A L D H . 1.------ D E T E R M I N E C R T M O D E
CMP CRT-MODE, 6J E C E O
.------ M E D I U M R E S U PS A L D L , IS A L 0 1 . 1CMP CRT-MODE, 4J E C EOCMP CRT-MODE, 5
J E C E OCMP CRT-MOOE, OAHJE CEOL O U R E S U PS A L D L , I
S K D I . 1
. ------
S A V E R E S U L T A S D E S T I N A T I O NADDRESS
A D J U S T V A L U E S
O O T S I C H A RMULTIPLY x ROWS BY 4 SINCE E VERT
AND EVENlODD ROWS
T E S T F O R HIGH R E SFIND-SOURCE
x COLUMNS * 2, SNCE 2 BYTESICMARO F F SE T + 2 S I N C E 2 B V T E S I C H A RT E S T F O R M E D I U M R E S
T E S T F O R M E D I U M R E S
T E S T F O R M E D I U M R E S
x COLUMNS + 2 AGAIN, SINCE 4B V T E S I C H A RO F F S E T * 2 A G A IN , S I N C E 4
B Y T E S I C H A R
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 474/605
F290F290 0 6
F291 1FF 2 9 2 2 A EDF294 DO E 3F296 DO E 3F 2 9 E 7 4 67F 2 9 A E A C 3F 2 9 C 84 50
F 2 9 E F 6 E 4F 2 A 0 E8 F 7F 2 A 2 03 F O
F 2 A 4 E A E 6F 2 A 6 2 A E 3
F 2 A EF 2 A EF 2 A BF 2 A CF 2 A FF2E4F2E5F287F 2 B BF 2 B FF 2 C 2F 2 C 6F 2 C AF 2 C C
F 2 D OF 2 D 4F 2 D 6
F 2 D EF 2 D EF 2 D AF 2 D DF 2 D EF 2 E 1F 2 E 6F 2 E 7F 2 E 9
F E DF 2 F OF P F l
F2F6F 2 F A
F 2 F CF 2 F EF301
F 3 O1
F303F305
E E F J C 7 RI EE E 1388 RBO 3 E 0049 R 09I F72 15
E 1 C 6 2 0 0 0E 1 c7 2 0 0 0E 8 F 3 C 7 RE 1 E E 3 F E OE 1 E F 3 F B OF E C C8 1 E E I F E O
E 1 E F l F B OF E C C75 D O
E A C 7E E F 3 E O RI EE E 1388 REO 3 E 0049 R 09I F
72 ODE 1 c7 2 0 0 0
E 8 F K O RE 1 EF 3 F E OFE CBE 1 EF I F B OF E C B
75 DCE 9 O F 7 0 R
E A D E
E B 03
F305F305 F DF306 E A DBF 3 0 E EB C 2
F 3 0 A E 8 F 7 2 C RF 3 0 D EB F E
F 3 0 F 2 8 D lF311 E 1 C 2 0101
F315 D O E 6
F 3 1 7 DO E 6
F319 BO 3 E 0049 R 06F 3 l E 74 2 2
D E T E R M I N E T H E S O UR CE A D DR ES S I N T HE B U F F E R
P U S H E S , GE T S EGME NTS B OTH P O IN TI NG TO, REGEN
POP D S
SUE CH,CH , ZERO TO HIGH OF COUNT REGS A L E L , 1 , M U L T I P L Y N U M E E R O F L I N E S B Y 4S A L B L , I
J Z C E6 , I F ZE RO , T H EN B LA N K E N T IR E F I E L DMOV AL,EL , G ET N U MB ER O F L I N E S I N A LMOV AH,EO , B O B Y TE S IROWMUL AH , DE T E RM INE OFFS E T TO S OURCEMOV S I , D I , SET UP SOURCEA DD S 1 ,A X , ADD I N O FF SE T TO I TMOV AH,DH , N UM BE R OF R OU S I N F I E L DS UB A H,E L , DE T E RM INE NUME E R TO MOV ELOOP THROUGH. MOV ING ONE ROW AT A T IM E BOTH EVEN AND O D D
------CEO , F I ND-SOURCE
------
C E I .
C 8 2
----C B 3
C E 4
C E 5
C E 6 :
--
C A L LP U S HC A L LCMPPOPJ CADDADDC A L LSUES U BDECS U B
S U BDECJ N Z
c95D SDDSCRT-MODE, 9
D SC E 2SI, 0 0 0 HD I , 2 0 0 0 Hc95SI, 0 0 0 H - E 0D I , 4 0 0 0 H - E 0AHSI, 0 0 0 H - E 0
D I , 2 0 0 0 H - E 0A HCE 1
F I E L D SROW-LOOPMOVE ONE ROWS A V E DA TA S E GP O I N T T O BIOS DATA AREAMODE USES 32K REGEN?RE S TORE DA TA S E GNO, JUMPA D J U S T P O I N T E R S
MOVE 2 MORE ROWSB A C K U P P O I N T E R S
ADJUST COUNTMOVE TO NEXT ROW
NUMBER OF ROWS TO MOVEC O N T I N UE T I L L A L L M OV ED
F I L L I N THE V ACATED L I N E i S )
MOVC A L LP U S HC A L LCMPPOPJ CADDC A L LSUEDECS U EDEC
J N ZJMP
MOV
JMP
A L . EH
C 9 6D SDDSCRT-MODE, 9
D SC E 5D I , 2 0 0 0 HC 9 6D 1 , 4 0 0 0 H - E 0EL
D I , 2 0 0 0 H - E 0B L
C E 4VIDEO-RETURN
E L , OH
ce3GRAPHICS-UP ENDP
CLEARJNTRVA T T R IE U T E TO F I L L W I THCLEAR THAT ROWS A V E DA TA S E GP O I N T T O BIOS DA TA A RE AMODE US E S 3 2 K RE GE N?RESTORE DATA SEGNO, JUMP
CLEAR 2 MORE ROWSB A C K U P P O I N T E R SADJUST COUNTP O I N T TO N EX T L I N EN UM EER OF L I N E S T O F I L L
CLEAR-LOOPE V E R Y T H I N G D O N EB L A N K - F I E L DS E T B L A NK C OU NT T O E V E R Y T H IN G I NF I E L DC L E A R T H E F I E L D
......................................................, S CROL L DOUN, T H I S R O U T I N E S C R O L L S DOW N T H E I N F O R M A T I O N ON T H E C RT, E N T R V --, CH,CL = UP P E R L E FT CORNE R OF RE GION TO S CROL L, D H , D L = L OWER RIGH T CORNER OF RE GIO N TO S CRO L L, B O T H O F T H E AB O V E A RE I N C H A RA C T ER P O S I T I O N S, EH = F I L L VA L UE F OR BL A NK ED L I N E S, A L X L I N E S TO S C RO L L ( A L S O M EA NS B LA N K T HE E N T I R E F I E L D ), OS = DATA SEGMENT, E S = REGEN SEGMENT, E X I T --, NOTHING, THE S CRE E N IS SCROLLED
GR AP HIC S DOWN PROC NEAR
........................................................-STD ; S E T D I R E C T I O NM O V E L , A L , S AV E L I N E C OUNT I N B LMOV AX,DX , G ET L OW ER R I G H T P O S I T I O N I N T O AX R E GU S E C H A R A C T E R S U B R O U T I N E F O R P O S I T I O N I N GADDRESS RETURNED IS M U L T I P L I E D B Y 2 FROM CORRECT VALU EC A L L G R A PH P O S NMOV DI ,A X -
DETERMINE SIZE OF UINDOU’
S U B D X . C XADD OX, IOlHS A L D H . 1
S A L DH. I
DE T E RM INE CRT MODE
CMP CRT_MODE,6 ,J Z C E 7
S A V E R E S U L T A S D E S T I N A T I O NADDRESS
AD J U S T V A L U E SM U L T I P L Y 8 ROWS B Y 4 S I N C E E VERTD O T S / C H A R
AND EVE NlO DD ROWS
TEST FOR HIGH RESF I ND-SOURCE-DOWN
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 475/605
------ M E D I U M R E S D O U NS A L D L , I
S A L D I , 1
I N C D ICUP CRT-MODE.4 ,J Z C E 7CUP CRT-MODE.5 ,J Z C E 7CUP CRT-MODE,OAH ,J Z C E7DEC D IS A L D L . 1
8 COLUMNS N 2, S I N C E 2 E Y T E S I C H A R( O F F S E T O K )O F F S E T *2 S I N C E 2 E Y T E S I C H A RP O I N T T O L A S T B Y T ET E S T F O R M E D I U M R E SF I NDSOURCE-DOUNT E S T F O R M E D I U M R E SF INDJOURCE-DOWNT E S T F O R M E D I U M R E SF I ND-SOURCE-DOUN
8 COLUMNS N 2 A G A I N . S I N C E 4B Y T E S I C H A R ( O F F S E T O K )O F F SE T N 2 A G A I N , S I N C E 4E Y T E S I C H A R
F 3 2 0 DO E 2
F 3 2 2 D 1 E 7F324 47F 3 2 5 EO 3E 0049 R 0 4F 3 2 A 7 4 16F 3 2 C EO 3 E 0049 R 05F 3 3 l 74 OFF a 3 3 EO 3s 0049 R OAF 3 3 E 74 OBF 3 3 A 4 FF J J B D O E2
F 3 3 D D I E 7
F 3 3 F E3 C 7 0 3
F 3 4 2F 3 4 2 2 A E D
F 3 4 4 88 OOFO
S A L D I . 1
ADD D I , 3 ; P O I N T TO L A S T B Y T E. ------ D E T E R M I N E TH E S O UR C E A DD R E S S I N TH E B U F F E Rce7:
S U Enov
CUPJ Cnov
F I NDJOURCE-DOUNZERO TO HIGH OF COUNT REGO F F S E T T O L A S T R O U O F P I X E L S I F1 6 K R E G E NU S I N G 3 2 K R E G E N ?NO, JUMPO F F S E T TO L A S T R OU O F P I X E L S I F3 2 K R E G E NP O I N T T O L A S T RO U O F P I X E L SM U L T I P L Y N U ME ER O F L I N E S BY 4
cn. cnAX, 240
CRT-MODE.9 ;
C E 8AX, 160
D I , A XEL, I
E L , 1
c94A L , E L
AH, EOA HS I , D ISI, XAH, DHA H, E LE S
F 3 4 7F 3 4 CF 3 4 E
F35 IF353F 3 5 5F357F 3 5 9
F 3 5 EF 3 5 DF 3 5 F
F36 I
F363F365F367F 3 6 E
EO 3 E 0049 R 097 2 0 3E8 OOAO
0 3 F ED O E 3D O E 37 4 6 AE A C 3
E 4 50F 6 E 4B E F 728 F OE A E 6
C E E : ADDS A LS A LJ ZMOV
MOVMULnovSUEnovS U EP u s n
I F Z ER O, T H EN B L A N K E N T I R E F I E L DG ET N UM EE R O F L I N E S I N A L
EO E Y T E S l R O UD E T E R M I N E O F F S E T T O S O U RC ESET UP SOURCE
N UM EE R OF R OU S I N F I E L DDE TER MI N E NUMEER TO MOVE
SUBTRACT THE OFFSET
coin SEGMENTS TO RECEN2 A E 306I F POP DS
. ------ LOOP THROUGH, MOVI NG ONE ROU AT A T I M E, BOTH EVEN AND OD0F I E L D S
C E 9 ; ; R O U L O O P - D O U NC A L L C 9 5 ; MOVE ONE ROUP u s n D S ; S A V E D A T A S E GC A L L D D S ; P O I N T T O BIOS DATA AREACUP CRT MOD E. 9 : MODE USES 32K REGEN?
F 3 6 9F369 E E F 3 C 7 RF 3 6 C 1 EF 3 6 D E 8 1388 RF370 EO 3 E 0 0 4 9 RF375 I FF376 7 2 15
F 3 7 E E1 C 6 2 0 0 0F 3 7 C 81 C 7 2 0 0 0
F380 E 8 F 3 C 7 RF 3 E 3 E1 E E 4 0 5 0F 3 E 7 E 1 E F 4050F 3 E E F E CCF 3 E D E1 E E 2050F3 9 1 E1 E F 2 0 5 0F395 F E C CF397 75 DO
F399F 3 9 9 E A C 7F39EF 3 9 E E 8 F 3E O RF 3 9 E I EF39F E 8 1388 RF 3 A 2 EO 3 E 0049 RF 3 A 7 I FF 3 AE 7 2 ODF 3 A A
ElC 7 2 0 0 0
F 3 A E €8 F 3 E O RF 3 E l BI E F 4 0 5 0F 3 E 5 F E C EF 3 E 7 BI E F 2050F 3 E E F E C EF 3 E D 75 DCF3EF F CF 3 C O E 9 O F 7 0 RF 3 C 3F 3 C 3 8 A DE
F 3 C 5 E E D 2F 3 C 7
F 3 C 7F 3 C 7 EA CAF 3 C 9 56F 3 C A S 7
F 3 C E F 3 I A 4F 3 C D 5F
F 3 C E 5 EF 3 C F E1 C 6 2000F 3 D 3 E1 C 7 2 0 0 0F 3 D 7 5 6F 3 D E 57F 3 D 9 EA CAF 3D E F 3 I A 4F 3 D D 5FF 3 D E 5 EF 3 D F C 3F 3 E O
09
POPJ CADDADD
C A L LS U ES U EDECS U ESUEDECJ N ZF I L L
; RESTORE DATA SEG- .
D Sc90 ; NO, JUMP5 1 , 00014 ; A D J U S T P O I N T E R S
c 9 5 ; MOVE 2 MORE ROUS
D I , zooon
SI,~OOOH+EO ; BACK UP POINTERSD I , ~ O O O H + E O ;
D I , zooon+8o
A H ; ADJUST COUNTS 1 , 2 O O O H + B O ; MOVE TO NEXT ROW
AH ; NUMEER OF ROUS TOC E 9 ; C O NT IN U E T I L L A L L
I N TH E V AC AT ED L I N E ( S 1
c90:
. -----MOVEMOVED
U I T HCLEAR-ENTRY-DOUNA T T RI BU T E TO F I L LC L E A R L O O P - D O U NCLEAR A ROU
c9 I
c 9 2
MOV
C A L L
C A L LCUPPOPJ CADDC A L LS U EDEC
c93 S U EDECJ N ZC L DJMP
MOV
J M P
P u s n
c94
A L , EH
C 9 6D SDDSCRT-MODE,S ,DSc93D I , 2000H
C 9 6
E L
E Lc 9 2
VIDEO-RETURN ,
D I , ~ O O O H + E O ,
D I , 2 o o o w e o ,
S A V E D A T A S E GP O I N T T O BIOS D A T A A R E AMODE USES 32K REGEN?RESTORE DATA SEGNO, JUMP
09
CLE AR 2 MORE ROUSB A C K U P P O I N T E R SADJUST COUNTP O I N T TO NE XT L I N EN UM EE R O F L I N E S T O F ILL
CLEAR-LOOP-DOUNR E S ET T H E D I R E C T I O N F L A GE V E R Y T H I N G D O N EBLANK-FIELD-DOUNS E T B LA N K C OU NT T O E V E R Y T H I N G I NF I E L DC L E A R T H E F I E L D
E L , DH
c91GRAPHICS-DOUN ENDP. ------ R O U T I N E T O M O V E O NE R O Y O F I N F O R M A T I O NC95 PROC
MOVP u s nP u s n
R E PPOPPOPADDADDP u s nP u s nMOVREPPOPPOPR E T
C 9 5 E N D P
NEARC L , D L51
N UM EE R O F B Y T E S I N T H E R OY
D I
MOVSED I51SI, 0 0 0 ~D I , 200014SID IC L , D LMOVSED tSI
S A V E P O I N T E R S
MOVE THE EVEN F I E L B
P O I N T T O T H E ODD F I E L D
S A V E T H E P O I N T E R SCOUNT BACKM O VE T H E OD D F I E L D
P O I N T E R S B A C KR E T U R N T O C A L L E R
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 476/605
F 3 E O
F 3 E O E A C A
F 3 E 2 57F 3 E 3 F3/ AAF 3 E 5 5FF 3 E 6 6 1 C 7 2000F 3 E A 57F 3 E B E A C AF 3 E D F3/ AA
F 3 E F 5FF 3 F O C 3F3F I
F3F I
F 3 F l 32 E 4F 3 F 3 50
F3F4 € 6 F 7 2 9 RF 3 F 7 BE F B
F3F9 56
F 3 F A B E 0110 RF 3 F D 3 C BOF3FF 7 2 05F 4 0 1 B E 0 0 7 C RF 4 0 4 2 C BOF406F 4 0 6 I EF 4 0 7 33 D 2F 4 0 9 BE D A
F 4 0 B C 5 34F 4 0 D B C D A
F 4 0 F I F
F 4 1 0 52
F 4 1 1 D 1 EOF 4 1 3 D I EO
F 4 1 5 D I EOF 4 1 7 03 F OF 4 1 9 BO 3 E 0 0 4 9 R 0 4F 4 1 E 7 4 4 5
F 4 2 0 80 3 E 0 0 4 9 R 05F 4 2 5 74 3 EF 4 2 7 BO 3 E 0 0 4 9 R OAF 4 2C 7 5 03F 4 2 E E 9 F 4 D 4 RF 4 3 1 BO 3 E 0 0 4 9 R 06F 4 3 6 75 53
F 4 3 B I FF 4 3 9 5 7F 4 3 A 56F 4 3 B 86 0 4F 4 3 0 A C
F 4 3 E F6 C 3 BO
F 4 4 1 7 5 16F 4 4 3 A AF 4 4 4 A CF 4 4 5 26 86 85 IFFFF 4 4 A 83 C 7 4 FF 4 4 D F E C EF 4 4 F 7 5 ECF 4 5 1 5 EF 4 5 2 5FF 4 5 3 4 7F 4 5 4 E 2 E 3
- C L E A R
PROC
MOV
P U S HR E PPOP
ADDP U S HMOV
R E PPOPR E TE N D P
A S I N G L E ROW
NEAR
0 1
S T O S BD I
0 I , 2 0 0 0 HD IC L , D L
S T O S BD I
C L , O L N UM BER O F B Y T E S I N F I E L DS A V E P O I N T E RSTORE THE NEW VALUEP O I N T E R B A C K
P O I N T T O O D D F I E L D
F I L L T H E ODD F I L E L D
R E T U R N T O C A L L E R
G R A P H I C S W R I T ET H I S R O U T I N E W R I T E S T H E A S C I I C H AR AC T ER T O T HE C U RR E NTP O S I T I O N O N T H E S C RE E N
A L = CHARACTER TO WR I TE
E L C O L OR A T T R I B U T E T O B E U S E D F O R F OR EG RO U ND C O LO R
E N T R Y --
I F B I T 7 IS SET, THE CHAR IS X O R ’D I N T O T H E R E C E N B U F F E R( 0 IS USED FOR THE BACKGROUND COLOR)
CX NUMBER OF CHARS TO WR ITED S = DATA SEGMENT
E S = REGEN SEGMENT
N O T H I N G IS RETURNED
E X I T --
G R A P H I C S R E A DT H I S R O U T I N E R E AD S T H E A S C I I C H AR A CT E R A T T H E C U RR EN T C UR SO RP O S I T I O N O N TH E S C R E EN BY M A T C H I N G T H E D O T S O N T H E S C R E E N T OTHE CHARACTER GENERATOR CODE POI NTS
E N T R Y --E X I T --
ONE ( 0 IS ASSUMED AS THE BACKGROUND COLOR)
A L = C H A R AC T E R R EA D A T T H A T P O S I T I O N ( 0 R E TU R NE D I F N O N E F OU N D )
F O R B O T H R O U T I N E S , T H E I M A G E S U S E D T O F O R M C H A R S A R E C O N T A IN E D I NRO M I N T E R R U P T 4 4 H IS U S E 0 T O P O I N T T O T H E T A B L E F OR T H E F I R S T1 2 8 C H AR S I N T E R R U P T 1 7 H IS U S E D TO P O I N T T O T H E T A B L E F O R T H ESECOND 128 CHARS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A S S UM E C S C O D E, D S D A T A , E S D A T A
XOR AH, AH , Z E R O TO H I G H O F COO € P O I N TP U S H A X , S A V E C OD E P O I N T V A L U E
C A L L R 5 9 , F I N D L O C A T I O N I N RE GE N BU F FE RMOV D 1 , A X R EG EN P O I N T E R I N 0 1
POP AX RECOVER CODE PO I N T
C M P A L , B O H , 16 I T I N F I R S T H AL F ’J B R 1 JUMP I F I T IS
S U B A L , B O H , Z E RO O R I G I N F O R SE CO ND H A L F
P U S H D S , S A V E D A T A P O I N T E R
XOR OX,OXMOV DS,DX , E S T A B L I S H V E CT OR A D D R E SS I N G
ASSUME DS A B S 0L D S S 1,D WO RD P T R [ S I ] G E T T H E O F F S E T O F T H E T A B L E
ASSUME DS D A T A
POP D S , RECOVER DATA SEGMENTP U S H D X , S A V E T A B L E S E G M E N T O N S T A C K
S A L A X . I . M U L T I P L Y C O D E P O I N T
GRAPHI CS-W RI TE PROC NEAR
_-_--- E T E R M IN E P O S I T I O N I N R EC E N B U FF E R T O P U T C OD E P O I N T S
___ - - -ETERMINE REGION T O GET ;ODE POINTS FROM
M O V SI,OFFSET C S E T - P ~ R A S S UME FIRST HALF
MOV SI,OFFSET EXT-PTR , SET POINTER FOR SECOND HALF
R 1 , EXTEND-CHAR
MOV DX, DS , ;ET THE SEGMENT OF THE TABLE
__---- E T E R M I N E G R A P H I C S M O DE I N O P E R A T IO N
R 3
____ -
R 5
R 6
SAL AX : I
S A L A X , IA D D S 1 , A XCMP CRT-MODE, 4J E R 9CMP CRT-MODE, 5
J E R 9CMP CRT-MODE, OAH
J N E R 3J M P R 1 6CMP CRT-MODE, 6
J N E R 1 2- H I G H R E S O L U T I O N M O DE
POP D S
P U S H D I
P U S H SIMOV OH. 4L O D S BT E S T B L , B O H
J N Z R 8S T O S BL O D S B
V A L U E BY 6
SI H A S O F F S E T O F D E S I R E D C O D E S
T E S T F O R M E D I U M R E S O L U T I O N M OD E
T E S T F O R M E D I U M R E S O L U T I O N M OD E
T E S T F O R M E D I U M R E S O L U T I O N M O DE
T E S T F OR H I G H R E S O L U T I O N M O DEG O T 0 L O W R E S O L U T I O N I F NOT
R E C OV E R T A B L E P O I N T E R S E G M E N TS A V E R E C E N P O I N T E RS A V E C O D E P O I N T E RNUMBER OF T I MES THROUGH LOOPG E T B Y T E F R OM CO DE P O I N T S
S H O UL D WE U S E T H E F U N C T I O N
S TO R E I N R EG EN B U F F E RTO PUT CHAR I N ’
R7 MOV ES ~ 0 1 + 2 0 0 0 H - 1 1 , A L , S T OR E I N SE CO ND H A L FADD DI, 9 , MOVE TO NEXT R O U I N R EC EN
D E C D H , D O N E W I T H L O O PJ N Z R 6P O P SIPOP DI , R E C O V E R R E G E N P O I N T E RI N C DI , P O I N T T O N E XT C HA R P O S I T I O NL O O P R 5 , M O R E C H A R S T O U R l T E
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 477/605
F 4 5 6F 4 5 9F 4 5 CF 4 S DF 4 5 EF 4 6 3
F 4 6 SF 4 6 5F 4 6 6
F 4 6 AF 4 6 D
F 4 6 DF 4 6 EF 4 6 FF 4 7 IF 4 7 4F 4 7 8F 4 7 BF 4 7 F
F 4 8 3F 4 B 4F 4 B S
F 4 B 7F 4 8 9
~ 4 6 ~
F ~ B
~ 4 ~ 6
E 9 O F 7 0 R2 6 3 2 05AAAC2 6 3 2 85 I F F FEe EO
I F
E A 0 30 1 E 7E B F 6 S 9 R
57S 68 6 0 4Ee ~ 6 2 6e 1 c7 2000E B F 6 2 6 R8 1 E F I F B DF E C E7 5 E ES EI F4 74 7E 2 E 4E B C B
F 4 B 8F 4 8 8 I FF 4 8 C B A 03
F 4 B E D I E 7F 4 9 0 D I E 7F 4 9 2 E8 F 6 6 E RF 4 9 SF 4 9 S 5 7F 4 9 6 56F 4 9 7 86 0 4F 4 9 9 E8 F 6 4 5 RF 4 9 C B I C 7 2 0 0 0F ~ A D Ee ~ 6 4 sF 4 A 3 IEF 4 A 4 E B 1388 RF 4 A 7 BO 3 E 0 0 4 9 R 09F 4A C I FF 4 A D 75 1 4F 4 A F 8 1 C 7 2 0 0 0F 4 B 3 E8 F 6 4 S R
F 4 B A E 8 F 6 4 5 RF O B 0 El E F 3 F E OF O C I F E C EF 4 C 3 8 1 E F I F 8 0F 4 C 7 F E C EF 4 C 9 7 5 CEF 4 C E S EF 4 C C S F
F 4 DO E 2 C 3F 4 D 2 E B 8 2
F 4 D 4 I FF 4 D S B A 0 3
F 4 D 7 D I E 7
~ 4 ~ 61 c 7 2 0 0 0
F ~ C D e3 c7 0 4
F 4 D 9 33 CDF 4D B F 6 C 3 0 1
F I D E 7 4 0 2F 4 EO B 4 F FF 4 E 2 F 6 C 3 0 2F 4 E S 74 0 2F 4 E 7 BO F FF 4 E 9 BE DBF 4 E BF 4 E B 57F 4 EC 5 6F I E 0 E 6 0 2F 4 E F E 8 F 5 1 8 R
F 4 F 6 E E F 5 1 8 RF 4 F 9 8 1 C 7 2 0 0 0F 4 F D EB F S l B R
F 5 0 4 E 8 F S I B R
F 5 0 B F E C E
F S OD 7 5 E OF 5 0 F SEF S l O 5 FF S I I 4 7F 5 1 2 4 7F 5 1 3 E 2 0 6F 5 1 5 E 9 O F 7 0 R
~ 4 ~ 2i c 7 2 0 0 0
FSOO e l c7 2 0 0 0
F S D ~ e 1 EF S F ~ D
R 7 0 5R B
- - - -R 9
R 10
R I I
----k 1 2
R I 3
R 1 4
R IS
--
JMP VIDEO-RETURNXOR AL,ES C D I I , E X C L U S I V E OR U I T H C UR R EN T D A TAS T O S E , STORE THE CODE PO I N TL O O SE A G A I N F OR ODD F I E L D
J M P R 7XOR A L .E S CDI+ZOOOH-~I
M E D IU M R E S O L U T I O N U R I T E
POPMOVS A LC A L L
P U S HP U S HMOVC A L LADDC A L Lsue
0s
D I , IR 4 0
DISI .OH, 4 .R 3 5 ~
D I , 2 0 h HR 3 5D I , 2 0 0 0 H - e 0
DL, eL
DEC DH-J N Z R 1 1POP SIPOP D II N C D II N C DIL O O P R I OJ M P R 7 0 SL O U R E S O L U T I O N U R I T E
POPMDV
S A LS A LC A L L
P U S HP U S HMOVC A L LADDC A L LP U S HC A L LCMPPOPJ N EADDC A L LADDC A L L
DECSUEDECJ N ZPOPPOPADDLOOPJMP
sue
D SD L , E L
D I , ID I , IR 4 2
DlSIDH, 4R 3 9D I , 2 0 0 0 HR 3 9D SDDSCRT-MODE, D9HD SR ISD I , 2 0 0 0 HR 3 9D I , 2 0 0 0 HR 3 9D I , 4 0 0 0 H - E 0OH
DH
R 1 4SIDI0 1 . 4R 13R 7 0 5
D I , 2 0 0 0 ~ - ~ 0
BACK TO MAI NSTREAM
WED-RES-UR I T ER E C O V E R T A B L E P O I N T E R S E G M E N T
O F F S E T * 2 S I N C E 2 B V T E S IC H A REXPAND E L TO FU LL UDRD OF COLORMED-CHAR
S A V E R E C E N P O I N T E RS A V E T H E C O D E P O I N T E RNUMBER OF LOOPSD O F I R S T 2 E V T ESN E X T S PO T I N R EG E N
S A V E HIGH COLOR B I T
DO NEXT 2 B Y T E S
K E E P G O I N GRECOVER CODE PONTERR E C O V E R R E G E N P O I N T E RP O I N T T O N E X T CH AR P O S I T I O N
M O R E T O U R I T E
LOU-RES-URI TERECOVER TABLE POI NTER SEGMENT
D F F S E T N 4 S I N C E 4 B V T E S I C H A R
EXPAND B L TO FU LL UORD OF COLORMED-CHARS A V E R E C E N P O I N T E RS A V E T H E C O D E P O I N T E RNUMBER OF LOOPSE X P AN D D O T R D U I N RE G E NP O I N T T O N E X T R E G EN R D UE X P AN D D O T R O U I N R E G ENS A V E DS
U S I N G 3 2 K R E C E N A R EA ?RECOVER OSJ UM P I F 1 6 K R EG ENP O I N T T O N E X T R E C E N R O UE X P AN D D O T R O U I N R E C ENP O I N T TO N E X T R E C E N R O UE XP A ND D O T R OU I N R E C E NA D J U S T R E G E N P O I N T E R
A DJ US T R E C E N P O I N T E R TO NEXT ROY
S A V E HGH COLOR B I T
POINT TO e I o s D A T A A RE A
K E E P G O I N GRECOVER CODE PONTERRECOVER RECEN POI NTERP O I N T TO N E X T C HA R P O S I T I O NM O R E T O U R I T E
----- 6 4 0 x 2 0 0 4 C OL OR G R A P H IC S U R I T Ek 1 6 PO P OS , RECOVER TABLE SEGMENT POI NTER
M O V D L . B L , S A V E HIGH COLOR B I TS A L D I , I , O F F S E T I t 2 S I N C E 2 E V T E S I C H A R
, E X P A N D LOU 2 COLOR BITS IN eL ( C I C O )
INTO ex ( c o c o c o c o c o c o c o c o c i c i c i c i c i c i c i c i )XDRT E S T
J ZMDV
J ZMOV
R I B MDVR 19
R 1 7 T E S T
P U S HP U S HMOV
R 2 0 C A L LADDC A L LADDC A L LADDC A L LS U EDEC
J N ZPOPPOPI NCI NCLOOPJMP
AX, AX
R 17AH, OFFHE L , 2R 18
A L , O F F HEX, AX
D ISIOH, 2R 2 1
D I , 2 0 0 D HR 2 I
D I , 2OOOHR 2 ID I , 2DOOHR 2 I
D I , 6 0 0 0 H - 1 6 0DH
R 2 051
D I
D IDIR 19VIDEO-RETURN
E L , I c o COLOR B I T ON-
C I COLOR B I T ON?
YES, SET ALL C I e l i s ON
NO, JUMPY E S, S E T A L L C O B I T S ON
NO, JUMP
C O LO R M A SK I N E X
S A V E R E G E N P O I N T E RS A V E C OD E P O I N T P O I N T E RSET LOOP COUNTERD O F I R S T D OT R OUA D J U S T R E C E N P O I N T E RD O NEXT DOT ROUA D J U S T R E C E N P O I N T E RD O NEXT DOT RDUA D J U S T R E C E N P O I N T E RD O NEXT DOT ROUA D J U S T R E G E N P O I N T E R T O N E X T R OU
K E E P G O I N GR E CO V ER C O D E P O I N T P O I N T E RRECOVER REGEN POI NTERP O I N T T O N E X T C H AR A C T ER
M O R E T O U R l T E
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 478/605
F 5 1 E
F 5 1 E A C
F519 EA EOF 5 1 E 2 3 C3'F 5 l D F 6 C 2 EOF 5 2 0 74 0 7F522 2 6 . 32 2 5F 5 2 5 2 6 : 3 2 4 5 0 1
F 5 2 9 2 6 : 88 2 5F 5 2 C 2 6 : BE 45 01F 5 3 0 C 3F53 1
F531
F53IF 5 3 l E E F 7 2 9 RF534 BE F OF 5 3 6 E 3 EC 08
F539 EE EC
F 5 3 EF 5 3 CF 5 3 EF543F545F 5 4 AF 5 4 CF 5 5 1F 5 5 3F 5 5 E
F 1 5 A
F 5 S CF 5 5 DF 5 5 FF S 6 2F 5 6 3F 5 6 7F 5 6 AF 1 6 EF 5 6 EF 5 7 0F 5 7 2
F174F S 7 5F577F 5 7 9
F 5 7 CF 5 E 0
F 5 E 3F584F 5 E 7F S E CF S E DF 5 E FF593
F596F 5 9 A
F 5 9 DF 5 A 1
F 5 A 3
F 5 A 7F 5 A 9F 1 A E
F 5 A DF S A DF S A EF 5 E 0
F 5 E 3F 5 E 7F 5 E AF 5 E EF S B EF 5 C 3F 5 C 4F 5 C 6F S C A
F 5 C DF 5 D 1
F 5 D 4F 5 D EF 5 D AF 1 D AF 5 D EF 5 E O
06E 6 0 480 3E 0 0 4 9 R 0 67 4 17EO 3 E 0 0 4 9 R 0 474 6 1EO 3 E 0 0 4 9 R 057 4 S AEO 3 E 0 0 4 9 R OA74 53
E E 18
1 FE A 0488 4 6 0045E& E 4 2000
88 4 6 004 5E 3 C 6 50F E C E75 E EE E 6 E
I F
D I E 6D l E 6E 8 F 6 F C R
E 1 C 6 2 0 0 0E 8 F 6 F C R
1 EE 8 l 3 E E RE O 3 E 0049 R 09I F75 I 4E 1 C 6 2 0 0 0E 8 F 6 F C R
E 1 C 6 2 0 0 0E E F 6 F C R
E 1 E E 3 F E OF E C EE 1 E E l F E O
F E C E75 CEE E 35
I FD 1 E 6E E F 6 C 3 R
E 1 C 6 2 0 0 0E E F 6 C 3 RI EE E 1 3 E E REO 3 E 0 0 4 9 R OAI F7 5 1 48 1 C 6 2 0 0 0E E F 6 C 3 R
E 1 C 6 2 0 0 0E E F 6 C 3 R
E 1 E E 3 F EOF E C E
E 1 E E l F E OF E C E75 CE
R 2 1 P RO C N EA R
L O D S E , G E T C O D E P O I N T
MOV AH, AL , C O PY I N T O A HAND AX,EX , SET COLORT E S T D L , E O H , X OR FUNCTION?J Z R 2 2 , NO, JUMPXOR A H , E S C D I I , E X C L U S I V E OR W I T H C U R R EN T D A T AXOR A L , ES C D I + I l
MOV E S C D I + l l , A LR E T
R 2 1 E N D PGRA P HICS -WRITE E NDP
, G R A P H I C S R E A D
R 2 2 M O V ES C D I 1 , A H , S TO R E I N R E GE N B U F FE R
.......................................
-___________________------_-------------RAPH HI cs-READ PROC NEAR
C A L L R 5 9 , C O N VE R TE D T O O F F S E T I N R E G ENMOV S1,AX , S AV E I N SISUE S P , E , A L L OCA TE S P A CE TO S A V E THE RE A D
, C O D E P O I N TMOV EP,SP , P OINTE R TO S A V E A RE A
P U S H E SMOV D H , 4 , NUMEER OF PASSESCMP CRT MOD E,6J Z R 2 3- , H I G H R E S O L U T I O NCMP CRT-MOD E, 4
J Z R 2E , M E D I U M R E S O L U T I O NCMP CRT MQD E,5J Z R 2 E - , M E D l U M R E S O L U T I O NCMP CRT-MOD E, OAHJ Z R 2 E , M E D I U M R E S O L U T I O N
J M P S HO RT R 2 5 , LOU R E S O L U T I O NH I G H R E S O L U T I O N R E A D
-_----D E T E R M I N E G R A P H I C S M O D E S
--------_---GET VALUE S FROM REGEN BUFF ER AND CONVERT TO CODE PO IN T
R 2 3R 2 4
------k25
R 2 6
R 2 7
------R 2 E
R 2 9
R 3 0
POP DS
MOV AL, [SI1
MOV CE P 1 ,A LI N C E PMOV AL, CS1 +2OO OHlMOV CE P 1 ,A LI N C E PADD S I , E ODEC DHJ N Z R 2 4J M P S HO RT R 3 1L O U R E S O L U T I O N R E A DPOP DS
S A L SI,S A L SI, 1
C A L L R 5 5
A D D S 1 . 2 0 0 0 HC A L L R 5 5
P U S H D SC A L L DDSCMP CRT-MODE, 9POP D SJ N E R 2 7A D D S I , 2 0 0 0 HC A L L R 5 5
A D D S 1 . 2 0 0 0 HC A L L p55
SUE SI, 0 0 0 H - E 0DEC DHSUE SI, 0 0 0 H - E 0
DEC DHJ N Z R 2 6J M P S HO RT R 3 1M E D I U M R E S O L U T I O N R E A D
POP DS
S A L S 1 , I
C A L L R 5 0
ADDC A L LP U S HC A L LCMPPOPJNEADD
C A L L
SI, 0 0 0 HR 5 0D SDDSCRT-MODE, OAHD SR 3 0
SI, 0 0 0 HR 5 0
A D D 5 1 , 2 0 0 0 HC A L L R 5 0
S U B SI, 0 0 0 H - 8 0DEC D H
SUE SI, 0 0 0 H - E 0DE C DHJ N Z R 2 9
, P OINT TO RE GE N S E GME NT, G ET F I R S T B Y T E, S A V E I N S TO RA GE A R EA, N E X T L O C A T I O N, G E T L O U ER R E G I O N B Y T E, ADJUST AND STORE
, P O I N T E R I N T O R EG EN, LOOP CONTROL, DO I T S OM E M OR E, GO MA TCH THE S A V E D CODE P O INT S
, POINT TO REGEN SEGMENT, O F F S E T S 4 S I N C E 4 E Y T E S l C H A R
, GE T 4 B Y TE S FROM RE GEN IN TO
, S I N G L E S A V E, GOTO L OWE R RE GION, GE T 4 B Y T E S FROM RE GE N INT O, S I N G L E S A V E, S A V E D S, P O I N T T O B I O S DATA AREA, D O WE HAV E A 3 2 K REG EN AREA'
, NO, JUMP, GOTO L OWE R RE GION, G E T 4 B Y T E S F RO M RE G EN I N T O, S I N G L E S A V E, GOTO L OUE R RE GION, GE T 4 B Y TE S FROM RE GE N INT O, S I N G L E S A V E, AD J U S T P O I N T E R
A DJUS T P OINTE R B A CK TO UP P E R
DO I T S OME MOREGO MATCH THE SAVED CODE POINTS
MED-RES-READP OINT TO RE GE N S E GME NTO F F S E T U 2 S I N C E 2 E Y T E S I C H A RG ET P A I R B Y T E S F RO M RE G EN I N T OS I N G L E S A V EGO TO LOWER REGIONG ET T H I S P A I R I N T O S AV ES A V E D SP O I N T T O E105 DATA AREA
, D O WE H A V E A 3 2 K R E GE N A R E A7
, NO, JUMP, GOTO L OUE R RE GION, G ET P A I R B Y T E S FR OM R EG E N I N T O
, S I N G L E S A V E, GOTO L OUE R RE GION, G E T P A I R - B Y T E S FR O M RE G EN I N T O, S I N G L E S A V E, AD J U S T P O I N T E R
, A D J U S T P O I N T E R B A C K I N T O U PP E R
, K E EP G O IN G U N T I L A L L 8 DONE
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 479/605
F S E 2F 5 E 2 33 COF 5 E 4 B E DB
F S E 6 C 4 3 E 0110 RF 5 E A 83 ED OB
F S E D B B F SF S E F F CF S F O 3 2 C DF S F 2 16F 5 F 3 1F
F S F 4 B A 0080F 5 F 7 5 6F 5 FB 5 7F 5 F 9 89 0008F 3 F C F 3 / A 6F 5 F E S FF S F F S EF600 7 4 I E
F 6 0 2 F E COF604 8 3 C 7 OBF 6 0 7 4 AF 6 0 B 75 ED
F 6 0 A O A C OF 6 0 C 7 4 1 2F 6 0 E 2 8 COF 6 1 0 B E DB
F 6 1 2 C 4 3 E 0 0 7 C RF 6 1 6 E C .COF 6 1 8 OB C 7F 6 1 A 7 4 0 4F 6 1 C BO B OF 6 1 E E B 0 2
F 6 2 0 8 3 C 4 OB
F 6 2 3 E 9 O F 70 RF 6 2 6
F 6 2 6F 6 2 6 A CF 6 2 7 € 8 F 6 7 E RF 6 2 A 2 3 C 3
F 6 2 C F 6 C 2 B OF 6 2 F 7 4 0 7F 6 3 1 2 6 3 2 2 5F634 2 6 3 2 4 5 01
F 6 3 8 2 6 BB 2 5F 6 3 B 2 6 88 4 5 0 1
F 6 3 F C 3F 6 4 0
F 6 4 0F 6 4 0 E 8 F 6A O RF 6 4 3 E B E 5F 6 4 5
F 6 4 5F 6 4 5 A CF 6 4 6 50
F 6 4 7 5 1F 6 4 8 B l 0 4F 6 4A D 2 € 8F 6 4 C 59F 6 4 D E8 F 6 4 0 RF 6 5 0 58
F 6 5 1 4 7F 6 5 2 4 7F 6 5 3 € 8 F 6 4 0 RF 6 5 6 4 FF 6 5 7 4 FF 6 5 8 C 3F 6 5 9
-- - - - - - - S A VE AR EA H AS CH AR AC TE R I N I T , M A TC H I TR 3 1 , F I N D - C H A R
XOR AX,AXMOV DS, AX , E S T A B L I S H A D D R E S S I N G T O V E C T O RASSUME D S ABSOLES D1 , CSET-PTR , G ET P O I N T E R T O F I R S T H A L FS U B B P . 8 , A D J U S T P O I N T E R T O B E G I N N I N G O F
MOV S1 , BPC L D , E N S U R E D I R E C T I O NXOR AL , AL , CURRENT CODE POI NT BE I NG MATCHED
POP D S , FOR THE STRI NG COMPARE
MOV DX. 1 2 8 , NUMBER TO TEST A G A I N S TR 3 3 P U S H SI , S A V E AR EA P O I N T E RP U S H D I , S A V E C O D E P O I N T E Rnov C X . 8 , NUMBER O F BYTES TO MATCHREPE CMPSB , COMPARE THE B B Y T E SPOP D I , RECOVER THE POI NTERSPOP SIJ Z R 3 4 , I F Z ER O F L A G S ET , T H EN M A TC H
I N C A L , NO MATCH, MOVE ON TO NEXTADD D 1 . B , N E X T C O D E P O I N TDEC DX , LOOP CONTROLJ N Z R 3 3 , D O A L L O F T H E M
OR AL , AL , A L < > 0 I F O N LY I S 1 H A L F S CA NN EDJ E R 3 4 , I F 0, THEN ALL HAS BEEN SCANNEDSUB AX, AXMOV DS,AX , E S T A B L I S H A D D R E S S I N G T O V E C T O R
ASSUME DS ABSO
L E S D 1 , E X T - P T R , G E T P O I N T E RMOV AX,ES , S E E I F TH E P O IN T E R R E A L L Y E X I S T SOR AX,DI , I F A LL 0, T H EN D O E S N 'T E X I S TJ Z R 3 4 , NO SENSE LOOKI NGMOV AL . 1 28 , O R I G I N F O R S E C O N D H A L FJ M P R 3 2 , GO B A C K A N D T R Y F OR I TASSUME D S D A T A
, SAVE AREA
R 3 2 P U S H SS , E S T A B L I S H A D D RE S SI NG T O STACK
, OCCURRED
------ C H AR N O T MA TC H ED , M I G H T B E I N SE CO N D H A L F
------ CHARACTER IS FOUND ( AL:O I F NOT FOUND )
k 3 4 ADD S P . 8 , REA DJU ST THE STACK, THROU AWAY, WORK AREA
JMP VIDEO-RETURN , A L L D O N EGRAPHICS-READ ENDP
k 3 5 P RO C N E AR
-- - -- - -
L O D S B , G E T C O D E P O I N TC A L L R 4 3 , D OU BL E UP A L L T HE B I T S
R 3 6 A ND A X , B X , CONVERT THEM TO FOREGROUND COLOR, ( 0 BACK )
T E S T D L , B O H , IS T H I S XOR F U N C T I O N 7J Z R 3 7 , NO, S TO RE I T I N AS I T ISXOR AH,ES C D I I , DO F U N C T I O N W I T H H A L FXOR AL,ES [ D 1 + 1 1 , A ND W I T H O T HE R H A L F
R 3 7 MOV E S C D I 1 , A H , S TO RE F I R S T B Y T Enov ES CDI+IAL , STORE SECOND e mR E T
R 3 5 E N D P
k 3 B P RO C N E A R
-- --- - - -
C A L L R 4 5 , Q U A D U P T H E L O W N I B B L EJ M P R 3 6
R 3 8 E N D P
, EXPAND I DOT ROW O F A C HA R I N T O 4 B Y T E S I N TH E R E G EN B U F F E R
k39 PROC NEAR
------------------------
L O D S B , G E T C O D E P O I N TPUSH AX , S A V E
PUSH CXnov C L . 4 , MOV HIGH NI BBLE TO LOWS H R A L , C LPOP c xC A L L R 3 8 , EXPAND TO 2 BYTES E P UT I N R EG ENPOP AX , RECOVER CODE POI NTI N C DI , A D J U S T R E G E N P O I N T E RI N C D IC A L L R 3 8 , E X P A N D L O W N I B B L E E P U T I N R EG ENDEC DI , R E S T O R E R E G E N P O I N T E RDEC D I
R E TR 3 9 E N D P
, EXPAND-MED-COLOR, T H I S R O U T I N E E X P A N D S T H E L O U 2 B I T S I N E L TO, F I L L T HE E N T I R E BX R E G IS T E R, E N T R Y --, EL = COLOR T O BE USED ( LOW 2 B I T S )
, E X I T --, EX = COLOR TO BE USED ( B R E P L I C A T I O N S O F T H E 2 C O L O R B I T S )
...............................................
--------___--___________________________-------
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 480/605
F 6 5 9
F659 E O E 3 0 3
F 6 5 C E A C 3F 6 5 E 5 1F 6 5 F E 9 0003F662 DO EOF664 DO EOF 6 6 6 O A DEF 6 6 E E 2 F BF 6 6 A E A F EF 6 6 C 59
F 6 6 0 C 3F 6 6 E
F 6 6 EF 6 6 E 5 1F 6 6 F BO E 3 O FF 6 7 2 E A F EF 6 7 4 E l 0 4F 6 7 6 D 2 E 7F 6 7 B OA F E
F 6 7 A E A D FF 6 7 C 59F 6 7 D C 3
F 6 7 E
F 6 7 EF 6 7 E 5 2F 6 7 F 5 1F 6 B 0 5 3F 6 E 1 2 8 D 2F 6 B 3 E 9 0001
F 6 B 6 E E D EF 6 B E 2 3 D 9F 6 E A OB D 3F 6 E C D 1 EOF 6 B E D I E l
F 6 9 0 B E D EF 6 9 2 23 D 9F 6 9 4 OB D 3F 6 9 6 D I E l
F 6 9 E 7 3 EC
F 6 9 A B E C 2F 6 9 C 5 EF 6 9 D 59
F 6 9 E 5 AF 6 9 F C 3F 6 A O
F 6 A OF 6A O 5 2F 6 A 1 33 D 2F 6 A 3 A B OBF 6 A 5 7 4 03F 6 A 7 E O C E F OF 6 AA A 8 0 4F 6 AC 7 4 03F6 A E E O CE OFF 6 E 1 A B 0 2F6E3 74 03F 6 E 5 E O C A F OF 6 E B A B 0 1
F 6 E A 7 4 03F6 E C B O CA OFF 6 E F E E C 2F 6 C 1 5 AF 6 C 2 C 3
F 6 C 3
R 4 0 P R O C
AND
novPUSHnov
R 4 1 S A LS A LORLOOPnovPOPR E T
R 4 0 E N D P
NEAR
E L , 3
A L , E Lcxcx, 3A L , I
A L , I
E L , A LR 4 1
BH, E Lc x
I S O L A T E T H E C OL OR B I T SCOPY TO ALS A V E R E G I S T E RNUMEER OF TIMES TO DO T H I S
L E F T S H I F T B Y 2A NOTHER COL OR V E R S ION IN TO E LF I L L A L L OF E LF I L L U P PE R P O R TI ONR E G I S T E R E A C KA L L D O N E
; EXPAND-LOU-COLOR; T H I S R O U T I N E E XP AN D S T H E L O U 4 B I T S I N E L TO, F I L L T HE E N T I R E E X R E G IS T ER; E N T R Y --; E L = COLOR TO BE USED ( L O U 4 B I T S )
, E X = COLOR TO E € US E D ( 4 R E P L I C A T I O N S O F T HE 4 CO LO R B I T S )
; E X I T --
R 4 2 P R O CP U S HANDnovMOVS H LOR
aovPOPR E T
R 4 2 E N D P
NEARc xE L . OFHBH, E L
E H, CLEH, E L
E L , BH
cx
CL , 4
I S O L A T E T H E CO LO R B I T SCOPY TO BHM OV E T O H I G H N I B B L E
MA KE B Y T E FROM H IG H AND L OUN I E E L E S
A L L D O N E
_-_------_-________-------------------------, EXPAND-BYTE, T H I S R O U T I N E T A K E S T HE B Y T E I N A L AN D D OU B LE S A L L, O F T H E B I T S , T U R N I N G T H E E B I T S IN T O 1 6 B I T S, THE RE S UL T IS L E F T I N AX_-__----_________-__------------------------
R 4 3 P R O CPUSHPUSHP U S HSUEMOV
R44 MOVANDOR
S H LS H L
novANDORS H L
J N C
MOVPOPPOPPOPR E T
R 4 3 E N D P
NEARDXc xE XDX, DX
EX, AXEX, CXDX, EXAX, I
cx, I
EX, AXEX, CXDX, EXcx , I
CX, I
R 4 4
AX, DXE Xc xDX
S A V E R E G I S T E R S
R E S U L T R E G I S T E RM A S K R E G I S T E RB A S E INTO TE MPUSE MASK TO EXTRACT A B I TP U T I N T O R E S U LT R E G I S T E R
S H IF T E A S E A ND MA S K B Y I
BASE TO TEMPE X T RA C T TH E S AM E B I TP U T I N T O R E S U L TS H IF T ONL Y MA SK NOU, MOV ING TONE X T B A S EUS E MAS K 8 1 1 COMING OUT TOTERM1 NATER E S U L T T O P A R M R E G I S T E R
RE COV E R RE GIS TE RS
A L L D O N E
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ., E X P A ND-NI E E L €, T H I S R O U T I N E T A K E S T HE L O U N I B E L E I N AL AN D QU A DS A L L, O F T HE B I T S , T U RN IN G TH E 4 B I T S I N T O 1 6 B I T S, T HE R E SU LT I S L E F T I N AX
A 4 5 P ROC NE A R
_-______-_____--____------------------------
P US H DX , S A V E R E G I S T E R SXOR DX,DX , R E S U L T R E G I S T E RT E S T A L . 8J Z R 4 6OR DH.OFOH
J Z R 4 7OR D H , O F H
J Z R 4 BOR D L , O F O H
J Z R 4 9OR D L , O F H
POP DXR E T
R 4 6 T ES T A L . 4
R 4 7 T E ST A L . 2
R 4 E T E S T A L , 1
R 4 9 MOV A X ,DX
R 4 5 E N D P
, RE S UL T TO P A RM RE G IS TE R
, RE COV E R RE GIS TE RS, A L L DONE
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 481/605
F 6 C 3
F 6 C 3 8 A 2 4F 6 C 5 8 A 44 01F 6 C 8 I EF 6 C 9 € 8 1388 RF 6 C C BO 3 E 0049 R OAF 6 D I I FF 6 D 2 75 11
F 6 D 4 53F 6 D 5 89 0008F 6 D B DO F CF 6 D A D l DEF 6 D C DO F 8F 6 D E D l DB
F 6E O E 2 F 6F 6 E 2 8B C 3F 6 E 4 58
F 6 E B 3 2 0 2F 6E A E 5 C IF 6E C 7 4 01F 6 EE F 9F 6 E F DO D 2F 6 F 1 D I E 9F 6 F 3 D 1 E 9
F 6 F 5 7 3 F 3
F 6 F 7 80 56 00F 6 F A 4 5F 6 F B C 3F 6 F C
~ 6 ~ 5s coo0
F 6 F CF 6 F C B A 2 4F 6 F E E A 4 4 01
F701 3 2 D 2F 7 0 3 E B F 7 1 4 RF 7 0 6 B A 6 4 0 2F 7 0 9 E A 4 4 03F 7 0 C E B F 7 1 4 RF70F 86 5 6 00
F 7 1 2 4 5
F 7 1 3 C 3F7 1 4F 7 1 4F 7 1 4 89 FOOO
F719 7 4 01F 7 1 8 F 9F 7 1 C D O D 2F 7 1 E D I E 9F 7 2 0 D I E 3F 7 2 2 D I T 9F 7 2 4 D 1 E 9F 7 2 6 73 E FF 7 2 8 C 3F 7 2 9
~ 7 1 7 e5 CI
, MED-READ-BYTE, T H I S R O U T I N E WILL TAKE 2 BY TES FROM THE REGEN BUFFER ,, COMPARE AGA I NST THE CURRENT FOREGROUND COLOR, AND P LAC E, T H E C O R R ES P ON D IN G O N l O F F B I T P A T T E R N I N T O T H E C U R RE N T, P O S I T I O N I N T H E S AV E A RE A, E N T R Y --, S I , D S I P O I N T E R T O R EG E N A R E A OF I N T E R E S T, B X = EXPANDED FOREGROUND COLOR, B P = POI NTER TO SAVE AREA, E X I T --, B P I S I N C R EM E N T A FT E R S A V E
k50 PROC NEAR
________________________________________------------
M O V A H . C S 1 1 , G ET F I R S T B Y T EMOV A L, C S I + I l , GET SECOND BYTEP U S H DS , S A V E DSC A L L DDS , P O I N T T O B I O S D A T A A R EACMP CRT-MODE,OAH , I N 6 4 0 x 2 0 0 4 C OL OR M ODE'POP DS , RESTORE REGEN SEGJ N E R 5 2 N O , J U M P
,, THE c l B I T S AR E I N TH E N E X T B Y T E H E R E WE C HA NG E T H E M B A C K T O
I N 6 4 0 x 2 0 0 4 C OL OR M ODE, A L L T k E C O B I T S A RE I N O NE B Y TE , AND A L L
NORMAL C l C O A D J A C E N T P A I R SP U S HMOV
R 5 1. SARRCRSARRCRLOOPMOVPOP
R 5 2 MOVXOR
R 5 3 : T E S TJ ZS T C
R 5 4 R C LSHRSHR
J N C
MOVI CR E T
R 5 0 E N D P
B Xcx, 8
AH. Iex, IA L , I
EX. IR 5 I
AX, BXE XCX, OCOOOHD L , D LAX, CXR 5 4
DL , I
cx, 1cx, 1
R 5 3
[ B P I , D LB P
SAVE REGSET LOOP COUNTERc 0 B I T I N T O C AR RY
c I B I T I N T O C AR RY
R E P E A TR E S U L T I N T O A X
A ND I N T O E X
A ND I N T O B X
RESTORE BX2 B I T M AS K T O TE S T T HE E N T R I E SR E S U L T R E G I S T E RI S T H I S S E C T I O N B AC KG RO UN D"I F ZE RO , I T I S BA CKG RO UN DWASN'T, SO SET CARRYM OV E T H A T B I T I N T O T HE R E S U L T
MOVE THE MASK TO THE RI G HT B Y 2B I T SD O I T A G A IN I F M AS K D I D N ' T F A L LOUTS T OR E R E S U L T I N S A V E A RE AA D J U S T P O I N T E RALL DONE
.................................................., LOW-READ-BYTE, T H I S R O U T I N E WILL T A K E 4 BYTES FROM THE REGEN BUFFER,
, COMPARE FOR BACKGROUND COLOR, AND PL AC E, T H E C OR R ES P ON D IN G O N l O F F B I T P A T T E R N . I N T 0 T H E CU R RE N T, P O S I T I O N I N T HE S A V E A RE A, E N T R Y --, S 1 , D S = P O I N T E R T O R E G EN A R EA O F I N T E R E S T, B P = POI NTER TO SAVE AREA
, B P I S I N C R E M EN T AF T E R S A V E, E X I T --....................................................
R 5 5
R S SR 5 6
R 5 7 :
R 5 8 .
R 5 6
PROCnovnovXORC A L LnovMOVC A L LMOVI NC
R E TENDPPROCnovT E S TJ ZS T CR C LSHRSHRSHRSHRJ N CR E TENDP
NEARAH, [SI1A L, C S l + I lO L , D LR 5 6AH, CS1+21A L , C S 1 + 3 1R 5 6[ B P I , D LB P
NEARCX, OFOOOHAX, CXR 5 8
D L , I
cx, I
cx, I
cx, 1
cx, I
R 5 7
; G E T F I R S T 2 B Y T E S
, B U I L D H I G H N I B B L E, G E T S E C O N D 2 B Y T E S
, B U I L D L O W N I B B L E, S TO R E R E S U L T I N S A VE A RE A,A 0 J U S T P O I N T E R
, 4 B I T M AS K TO T E S T T H E E N T R I E S, IS T H I S S E C T I O N B A C K G R O U N D 7, I F Z ER O, I T I S BAC KG RO UN D, WASN' T , SO SET CARRY,M O VE T H A T B I T I N T O R E S U L T.M O VE M A SK R I C H 4 B I T S
, D O I T A G A IN I F M ASK D I D ' T F A L L O UT
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 482/605
----------_--___________________________-, V 4 - P O S I T I O N
, THIS R O U T I N E T A K E S T H E C UR SO R P O S I T I O N C O NT A I N E D I N
, T H E ME MO RY L O C A T I O N , A ND C O N V E RT S I T I N T O A N O F F S E T, I N T O T HE R E G EN B U F F E R , A S S U M IN G O N E B Y T E l C H A R
, F O R M E D I U M R E S O L U T I O N G R A P H I C S , T H E NU M EE R M US T, B E D O U B L E D, E N T R Y -- NO REGI STER S, MEMOR Y LO CA TI ON CURSOR-POSN IS USED, E X I T - -
, A X C O N T A I N S O F F S E T I N T O R E G E N B U F F E R
R 5 9 P RO C N E A R
GRAPH-POSN LA BE L NEAR
-__--______-____________________________-
MOV AX,CURSOR-POSN , GET CURRENT CURSOR
P U S H E X , S A V E R E G I S T E R
MOV BX, AX , SAVE A COPY OF CURRENT CURSORMOV AL , AH , G E T R O U S T O A L
M U L B Y T E P T R C R T- CO LS , M U L T I P L Y BY E Y T E S / C O L U M NCMP CRT MODE, 9 , MODE USI NG 32K REGEN'J N C R 6 0 - , YES, JUMPSHL AX , 1 . M U L T I P L Y 0 4 S I N C E 4 R O U S l E Y T E
S U E EH,EH , I S O L A T E C O L U M N V A L U EADD AX,EX , D E T E R M I N E O F F S E TP O P E X , R E C O V E R P O I N T E R
R E T , A L L D O N E
R 6 0 S H L A X, 1
R 5 9 E N D P
, L I G H T P E N
..................................................................
T H I S R O U T I N E T E ST S T H E L I G H T P E N S U IT C H A ND T H E L I G H TP E N T R I G G E R I F B O T H A R E S E T , T H E L O C A T I O N OF T H E L I G H TP E N IS D E T E R M I N E D O T H E R U IS E , A R E T U R N W I T H NO I N F O R M A T I O NIS MADE
( A H ) = 0 I F NO L I G H T P E N I N F O R M A T IO N IS A V A I L A B L E
( A H ) = I I F L I G H T P E N IS A V A I L A B L E
, ON E X I T
EX, CX, DX ARE DESTROYED
( D H , D L ) = R O U, CO L UM N O F CU R RE N T L I G H T P E N P O S I T I O N( C H ) = R A S T E R P O S I T I O N( E X ) B E S T G UE SS A T P I X E L H O R IZ O N T AL P O S I T I O N
___--_-____-____________________________-----------ASSUME CS CODE, DS DATA
,----- S U B T R A C T - T A B L E
V I L A B E L B YT E
DE 3,3,5,5,3,3,3,0,2,3,4
R E A D L P E N P RO C N EA R, ----- U A I T F OR L I G H T P E N T O E E D E PR E SS ED
XOR AH,AH , S E T N O L I G H T P E N R E T U R N C OD EMOV DX,VGA-CTL ,GE T ADDRESS OF VGA CONTROL REG
I N A L, D X , G ET S T A T U S R E G I S T E RT E S T A L . 4
,T E ST L I G H T P E N S U IT C H
J Z V 7EJ M P V 6 , N O T S E T , R E T U R N
N OU T E S T F O R L I G H T P E N T R I G GE R--_-b 7 E T E ST A L . 2 , T E S T L I G H T P E N T R IG G E R
J N Z V 7 A , R E T U R N W I T H O U T R E S E T T I N G T R I G G E RJ M P V 7
----- T R I G G E R H A S B E E N S E T, R EA D T HE V A LU E I Nb 7 A M OV A H 16 L I G H T P E N R E G IS T E R S ON 6 8 4 5
, ----- INPUT REGS COINTED T O B Y k ~ ,ND CONVERT TO ROU COLUMN IN D X
MOV DX, ADDR-6845 , A DD RE SS R E G I S T E R F O R 6 8 4 5MOV AL , AH , R E G I S T E R T O R E A DO U T D X , A L , S ET I T U PI N C D X , D A T A R E G I S T E RI N A L,D X , G E T T H E V A L U EMOV CH, AL , S AV E I N CXD E C D X , A D D R E S S R E G I S T E R
I N C A HM O V A L , A H , S EC ON D D A T A R E G I S T E RO U T D X , A LI N C D X , P O I N T T O D A T A R E G I S T E R
I N A L, D X , G E T S E C O N D D A T A V A L U EM OV A H C H A X H A S I N P U T V A L U E
MOV EL , CRT-MODES U E EH,EH , MODE VALUE TO EX
M OV E L , C S V I C E X I , D E T E R M I N E A MO U NT T O S U B T R A C TS U E A X . E X , T A KE I T A UAY
C M P A X , 4 0 0 0 , I N T O P O R B O T T O M B O RD E R'J E V I 5 , NO, OKAY
XOR AX,AX , YES, SET TO ZERO
V I 5 M OV E X , C R T -S T A RT
SHR EX, 1
SUE AX, EX , C O N V E R T T O C O R R E C T P A G E O R I G I N
J N S V 2 , I F P O S I T I V E , D E T E R M I N E M OD ES U E A X , A X , ( 0 P L A Y S &S 0
, ---- A X HAS THE ~ A L U EREAD IN ~ R O M HE 6 8 4 5
,----- D E T E R M I N E M O D E O F O P E R A T I O N
v2 . D E T E R M I N E M O D E
M O V C L , 3CMP CRT-MODE, 4J E V 4
M O V D L . 4 0CMP CRT-MODE. 9J B V 2 0MOV DL,EOD I V D L
- G R A P H I C S M O D E
F729F729F 7 2 C
F 7 2 C
F 7 2 DF72FF73 1F735F 7 3 AF 7 3 CF 7 3 E
F740F742F 7 4 4
F 7 4 5F746
F746F746
F75 I
F751F753F756
F757F759F 7 5 E
F 7 5 EF760F762
F765
F767F76EF 7 6 DF 7 6 E
F76FF770F772F773F775F777F 7 7 EF779F 7 7 A
F 7 7 CF780F 7 E 2
F 7 E 7F 7 E 9
F 7 E CF 7 E EF790F794F796F 7 9 EF 7 9 A
F 7 9 CF 7 9 CF 7 9 EF 7 A 3
F 7 A 5F 7 A 7F 7 A C
F 7 A EF7E0
A 1 0050 R
53
EE DEE A C 4
F6 26 0 0 4 A REO 3 E 0 0 4 9 R 09
73 02D 1 E OD I E O2 A FF03 C 3
58c3
0 3 03 05 05 03 0303 00 02 03 0 4
32 E 4E A O 3 D A
E CA B
0474 03E 9 F E O 3 R
AE 0275 03E 9 F EO D R
E 4 10
EE 16 0063 RE A C 4E E42E CE A E E4 A
F E C 4EA C 4
E E42E CE A E 5
E A I E 0 0 4 9 R2 A FF
2 E : E A 9F F 7 4 6 R28 C 3
3 D OFAO72 0233 coEE I E 0 0 4 E R
D I E E28 C 3
79 0228 CO
E 1 03EO 3 E 0 0 4 9 R 0 472 4 A
E 2 28EO 3 E 0 0 4 9 R 09
72 02E 2 50
F6 F 2
----
v20
SET UE SHTFTCOUNT
D E T E R M I N E I F G R A P H I C S O R A L P H AALPHA-PEN
D I V I S O R F O R G R A P H I C SU S I N G 3 2 K R EG EN ?NO, JUMPY ES , S E T R I G H T D I V S D RD E T E R M I N E R O U ( A L ) A N D C O L U M N ( A H )
A L R A N G E 0-99, AH RANGE 0-39
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 483/605
F 7 E 2F 7 E 4F 7 E 6F 7 E EF 7 E DF 7 E FF 7 C 1
F 7 C 3F 7 C 5F 7 C 7F 7 C C
F 7 C EF 7 D O
F 7 D 2F 7 D 4
F 7 D 6F 7 D EF 7 D DF 7 D FF 7 E 1F 7 E 3F 7 E 3
F 7 E 5F 7 E 7F 7 E 9F 7 E EF 7 E D
F 7 E FF 7 E F
F7F3F 7 F 5F 7 F 7F7F9F 7 F EF 7 F DF7FFF E O 1
F E O 1
F E 0 3F E 0 3F E 0 4F E O EF E O EF E O CF E O DFEODF E O EF E O F
F E 1 0F E l l
F E 1 2F E 1 3F E 1 4F E 15
E A E E0 2 EDEO 3 E 0 0 4 9 R 0972 06D O E CD O EO02 EDE A D C2 A FF
EO 3 E 0 0 4 9 R 06
7 2 1577 06
E l 04D O E 4E E OD
EO 3 E 0 0 4 9 R 09
77 F37 4 0 4E l 02D O E C
D 3 E 3
E A D 4E A F ODO E ED O E EE 8 12
F6 3 6 0 0 4 A R
E A F OE A D 4
D 2 E OE A € 8EA D C3 2 FFD 3 E 3
E 4 0 1
52B E 16 0063 RE3 C 2 07E E5 A
5 F5 EI F
I FI F
I F
07C F
F B I 5
F E 1 5 1 EF B I 6 50F B I 7 E E I 3 E E RF E I A BO OBF E 1 C E 6 20F E 1 E 90
F E l F E 4 20F E Z 1 E A E OF E 2 3 O A C 4F E 2 5 75 04F E 2 7 E 4 FFF E 2 9 E E OAF E 2 E E 4 21F E 2 D O A C 4F E 2 F E 6 2 1F E 3 1 BO 20F E 3 3 E 6 20F E 3 5F E 3 5 88 26 0 0 8 4 R
F E 3 9 58F E 3 A I FF E 3 E F EF E 3 CF E 3 C C FF E 3 D
,-__-- E T E R M I N E G R A P H I C R O W P O S I T I O N
MOV CH,AL , S A V E ROW V A L U E I N C HADD CH,CH , 1 2 F O R E V E N lO D D F I E L DCMP CRT-MODE,S , U S I N G 3 2 K R E G E N ?J E V 2 1 , NO, JUMPSHR AH, 1 , ADJUST ROW & COLUMNS H L A L , 1ADD CH,CH , 1 4 FO R 4 S CA N L I N E S
S U E EH,EH , M U L T I P L Y B Y E F O R M E D I U M R E SCMP CRT-MODE.6 , D E T E R M I N E M E D I U M O R HIGH R E SJ E V 3 , MODE 4 OR 5
J A V 2 3 . MODE 8, 9, OR AV 2 2 M O V C L . 4 , S H I F T V A LU E F O R H IG H R E S
SAL AH , I , C O L U M N V A L U E T I M E S 2 F O R HIGH R E SJ M P S H O RT V 3
J A V 2 2 , MODE AJ E V 3 , MODE 9M O V C L . 2 , MODE E S H I F T V A L U E
SHR AH, I
S H L E X , C L , M U L T I P L Y * 16 F O R HIGH R E S
M OV D L AH
V 2 1 MO V E L ,A H , C OL U M N VAL U E TO EX
V 2 3 CMP CRT-MODE,S , CHECK MODE
v 3 , NOT-H I GH-RES
, -__- - E T E R M I N E A LP H A C HA R P O S I T I O N
MOV D H :AL
SHR DH, 1
SHR DH, 1
J M P S H O RT V 5,----- A L P H A M OD E O N L I G H T P E N
v 4D I V B Y T E P T R C RT -C OL S
M OV D H ,ALM OV D L ,AH
S A L A L . C LMOV CH,ALM O V E L , A HXOR EH,EH
S A L E X , C L
MOV AH, 1
P U S HMOVADDOUTPOP
POPPOPPOP
POPPOPP O PP O PI R E T
v5
V 6
V 7
R E A L L P E N
DXD X, AD D R - 6 E4 5 ,DX, 7D X , A LD X
DISID S
D SD SD SE S
E N D P
C OL U M N VAL U E FOR R ETU R NROW VALUED I V I D E B Y 4
LIGHT-PEN-RETURN-SETF O R V A L U E I N 0 - 2 4 R AN GE
ALPHA-PEN
b 0 W S T O D HC O L S T O D L
D ET ER M I N E R OU ,C OL U M N VAL U E
M U L T I P L Y R O W S 1 E
GET R ASTER VAL U E TO R ETU R N R EGCOLUMN VALUE
TO EX
LIGHT-PEN-RETURN-SETI N D I C A T E E V E R Y TH I N G S E TLIGHT-PEN-RETURN
S A VE R E T UR N V A LU E ( I N C A S E )GET EASE AD D R ESSP O I N T T O R E S E T P AR M
AD D R ESS, N OT D ATA, IS IM POR TAN TR EC OVER VAL U ERETURN-NO-RESET
D I S C A R D S A V E D E X , C X , D X
-________________________________________---------------, T EM P OR A RY I N T E R R U P T S E R V I C E R O U T I N E
1 T H I S R O U T I NE IS A LS O L E F T I N P LA C E A FT E R T H EP O W E R O N D I A G N O S T I C S T O S E R V I C E U N U S E DI N T E R R U P T V E C TO R S L O C A T I O N ‘ I N T R - F L A G ‘ WILL
C O N T A I N E I T H E R 1 L E V E L O F H AR DW AR E I N T T H A TCAUSED CODE TO BE EXE C2 ‘ F F ’ FOR N ON - HAR D U ARE IN TE R R U P TS TH AT W ER EE X E C U T E D A C C I D E N T L Y
_-___---__-____--___------------------------------------6 1 1 PROC
ASSUMEP U S HP U S HC A L LMOVOUTNOPI NMOVORJ N ZMOVJM P
H W- IN T I NOROUTMOVOUT
MOV
POPPOPS T I
DUMMY-RETURNI R E T
D I I E N D P
SET- I NTR-FLAG
NEAROS D A T A
D SAX , S A V E R E G A X C O N T E N T S
D D SAL , OEH , R E A D I N - S E R V I C E R E GI N TAOO, AL , ( F I N D O U T W HAT L E V E L B E I N G
, S E R V I C E D )AL , I NTAOO , G E T L E V E LAH , AL , S AV E I TAL, AH , 00’ ( N O HA RD WA RE I S R A C T I V E )HU- I NTA H , O F F HS H O RT S E T - I NT R - F LA G S E T F L A G T O FF I F NON-HDWAREA L , I N T A O 1 GE; M A S K VALUEA L , A HI N T A O l , A LA L , E O 1
I N TAOO, AL
I NTR-FLAG, AH ,
AXD S
M AS K O F F L V L B E I N G S E R V I C E D
S E T F L A G
R ESTOR E R EG AX C ON TE N TS
I N T E R R U P T S B A C K O N
N E ED I R E T F O R V E C TO R T A B L E
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 484/605
F 8 4 1
F B 4 IF 8 4 1 F B
F 8 4 2 I E
F 8 4 3 88 ---- R
F B 4 6 B E D 8F B 4 8 A I 0013 RF B 4 B I F
F B 4 C C F
F 8 4 D
F B 4 D
F 8 4 DF 8 4 D F B
F 8 4 E I EF84F B B ---- R
F852 B E D 8
F 8 5 4 A I 0010 RF857 I FF 8 5 8 C FFa59
F859F859Fa59 F B
F 8 5 A I EF 8 5 B E 8 1 3 8 8 RF 8 5 E B O 2 6 0 0 7 1 R 7 FF863 €8 F 8 6 A RFa66 I FFa67 C A 0002F 8 6 AF 8 6 A
_ _ _ I N T 1 2 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - - - _ _ _ _ _ _ _ _ _ _ _ _ _ _, M E M O RY -S IZE -DE TE RM INE
, I N P U T
N O R E G I S T E R ST H E M E M O RY - S IZ E V A R I A B L E IS S E T D U R I N G PO WE R ON D I A G N O S T I C S
( A X ) N UM BE R O F C O N T I G U O U S I K B L O C K S O F MEMORY
A S SU M E C S C O D E , D S D A T AO R G O F B 4 1 H
S T I , I N T E R R U P T S B A CK O N
P U S H D S , S A V E S E G M E NT
M O V A X , D A T A , E S T A B L I S H A D D R ES S IN G
M O V D S , A XM O V A X ,M E M O RY -S IZE , G E T V A L U E
P O P DS . RE CO V E R S E G M E NT
, O U T P U T
________________--_-____________________-----
M E M O R Y - S I ZE - D E T E R M I N E P R O C F A R
I R E T , R E T U R N TO C A L L E RM E M O R Y - S I Z E - D E T E R M I N E E N D P
, E Q U I P M E N T D E T E R M I N A T I O N
_ -_ N T 11 _ _ _ _ _ - _ _ _ _ _ _ __ _ _ _ - _ - _ _ _ __ _ _ _ _ _ _ _ _ _ _ _
T H I S R O U T I N E A T T E M P T S T O D E T E R M I N E W HAT O P T I O N A L
D E V I C E S AR E A TT A C H ED T O T H E S Y S T E M
N O R E G I S T E R ST H E E Q U I P - FL A G V A R I A B L E IS S E T D U R I N G T H E P O W E R O N
P OR T 6 2 ( 0 - > 3 ) L O W O R D E R B Y T E O F E Q U I P M E N T
P O R T 3 F A = I N T E R R U P T I D R E G I ST E R OF 8 2 5 0
P O RT 3 7 8 O U TP U T P O RT O F P R I N T E R -- 8 2 5 5 P O R T TH A T
, I N P U T
D I A G N O S T I C S U S I N G T H E F O L L O U I N G H A R DU A RE A S S U M P T I ON S
B I T S 7-3 A RE A LW A Y S 0
. O U T P U T
C A N B E R E A D A S W E L L A S W R I T T E N
( A X ) IS S ET , B I T S I G N I F I C A N T , TO I N D I C A T E A TT AC HE D l l 0
B I T 15.14 = N U MB ER O F P R I N T E R S A T T A C H E DB I T 13 I = S E R I A L P R I N T E R A T TA C HE DB I T 1 2 = GAME l l 0 A T T A C H E D
B I T 11.10.9 = N U MB ER O F R S 2 3 2 C A R D S A T T AC H E D
B I T B 0 = D M A C H I P P R E S E N T O N S Y S T E M , I = NO DM A O N S Y S TE MB I T 7 , 6 = N UM BE R OF D I S K E T T E D R I V E S
B I T 5 . 4 I N I T I A L V I DE O MODE
00-1, 0132, 10=3, 1 1 = 4 O N L Y I F B I T 0 I
00 - UNUSED
0 1 - 4 0 x 2 5 B U U S I N G C OL OR C AR DIO - B O X 2 5 B U U S I N G C O L OR C A R DI 1 - B O X 2 5 B U U S I N G B U C AR D
B I T 3 . 2 P LA NA R R A M S I Z E ( I O = 4 B K , l l = 6 4 K )B I T 1 N O T U S E DB I T 0 I ( I P L D I S K E T T E I N S T A L L E D )N O O T H E R R E G I S T E R S A F F E C T E D
A S SU M E C S C O D E , D S D A T AO R G O F 8 4 D H
S T I , I N T E R R U P T S B A C K O NP U S H D S , S A V E S EG ME N T R E G I S T E R
M O V A X , D A T A , E S T A B L I S H A D D R ES S IN GM O V D S , A X
M O V A X , E Q U I P - F L A G , G E T T H E CU R RE N T S E T T I N G SP O P DS , RE CO V E R S E G M E NTI R E T , R E T U R N TO C A L L E R
____-_______-____-___--- - - - - - - - - -_--_-- - - - -~~--__-
E Q U l P M E NT P RO C F A R
E Q U I P M E N T E N D P
, C A S S E T T E I 1 0
_ _ _ I N T 15 ________________________________________
( A H ) = 0 T U R N C A S S E T T E M O T O R O N( A H ) = I T U R N C A S S E T T E M OT OR O F F
( A H ) 2 R E AD I OR M OR E 2 5 6 B Y T E B L O C K S F RO M C A S S E T T E
( E S , B X ) P O I N T E R T O D A T A B U F F E R( C X ) = C O U N T O F B Y T E S T O R E AD
, ON E X I T( E S , B X ) = P O I N T E R T O L A S T B Y T E R EA D + I
( D X ) C OU NT O F B Y T E S A C T U A L L Y R E AD
( C Y ) 0 I F N O E R R OR O C CU R RE D
( A H ) = E R R O R R E T U R N I F ( C Y ) : I1 I F E R R O R O C C UR R ED
01 I F CRC E RRO R W A S DE TE CTE D
0 2 I F D A T A T R A N S I T I O N S A R E L O S T04 I F N O D A T A W A S F OU N D
( A H ) = 3 U R I T E I OR M OR E 2 5 6 B Y T E B L O C K S T O C A S S E T T E( E S , B X ) = P O I N T E R T O D A T A B U F FE R( C X ) = C OU NT O F B Y T E S T O U R I T E
, ON E X I T( E X , B X ) P O I N T E R T O L A S T B Y T E W R I T T E N + I
( C X ) = 0( A H ) = A NY O T H ER T H A N A B O VE V A L U E S C A U S E S ( C Y ) = I
AND ( A H ) = B O TO BE R E TU R NE D ( I N V A L I D C OM MA ND ). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ASSUME D S D A T A , E 5 N O T H I N G , S S N O T H I N G , C S C OD EO R G O F B 5 9 H
S T
P U S H D SC A L L DDS
C A S S E T T E - I 0 P R O C F A R
, I N T E R R U P T S B A C K O N
, E S T A B L I S H A D DR E S SI N G T O D A TA
A ND B I O S - B R E A K , 7 F H , M A K E SU R E B R E A K F L A G IS O F FC A L L W I , C A S S E T T E - I O - C O N 1
P O P D S
R E T 2 , I N T E R R U P T R E T U R N
C A S S E T T E - I 0 E N D PW I P RO C NE A R
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 485/605
F E W o* E 4FBGC 74 13F B G E F E C C
Fa70 7 4 18Fa72 F E C CF B 7 4 74 I AF B 7 6 F E CCFa78 75 03F 8 7 A E 9 F997 RF 8 7 DF 8 7 D 84 BOF B 7 F F9F O B 0 C 3F B B IF B B I
ORJ ZDEC
J ZDECJ ZDECJ N ZJMP
MOVSTCRE T
u 2 :
U I ENDPMOTOR-ON
AH, AHMOTOR-ONAH
MOTOR-OFFAHREAD-BLOCK ;
AHu 2U R I TE-BLOCK ;
AH, OBOH
TURN ON MOTOR?Y ES , DO I TTURN OFF MOTOR?
Y ES , DO I TREAD CASSETTE BLOCK?Y ES , DO I TU R I T E C A S S E T T E B L OC K ?
YES , D O I TCOMMAND NOT DEFINEDERROR, UND EFINED OPERA TIONERROR FLAG
NOT-DEF I NED
PROC NEAR......................................., PURPOSE
TO TURN ON CASSETTE MOTOR
I N A L, PO RT- 8 , READ CASSETTE OUTPUTAND AL,NOT 08H , CLEAR B I T TO TURN ON MOTOR
SUB AH.AH , CLEAR AHRE T
. . . . . . . . . . . . . .. . . . . . . . . . . . .. . . . . . . . . . . .
U 3 OUT PORT-B,AL
.U R I T E I T O UT
MOTOR-ON ENDPMOTOR-OFF PROC NEAR
, PURPOSE
........................................
TO TURN CASSETTE MOTOR OFF
I N A L, PO RT -B . READ CASSETTE OUTPUTOR AL,OBH , S E T B I T T O T UR N O FFJMP U3 , UR I T E I T , CLE AR E RROR, RET URN
........................................
MOTOR-OFF ENDPREAD-BLOCK PROC NEAR
, PURPOSE
. . . . . . . . . . . .. . . . . . . . . . . . .. . . . . . . . . . . . . .. . . . . . . . . . . . .. . . . . . . . . . .
TO READ I OR MORE 2 5 6 BYTE BLOCKS FROM CASSE TTE
, ON ENTRY
E S IS SEGMENT FOR MEMORY BUFF ER (FOR COMPACT CODE)BX PO IN TS TO START OF MEMORY BUFFERCX CONTAINS NUMBER OF BYTES TO READ
B X P O I N T S I B Y T E P A ST L A S T B Y T E P U T I N HEMCX CONTAINS DECREMENTED BYTE COUNTOX CONTAINS NUMBER OF BYTES ACTUALLY READ
CARRY F L A G IS CLEAR I F NO ERROR DETECTEDCARRY F L A G IS SET I F CRC ERROR DETECTED
, O N E X I T
________________________________________-- - - - - - - - - - - -
F e e l E 4 6 1Fa83 24 F7F BB S E 6 6 1F E E7 2 A E 4F E E 9 C 3F B B AF B B A
F B B A E 4 6 1FBBC OC 08F B BE E B F SF B S OF890
PUSHPUSHPUSHMOVC A L L
I N
ANDMOVMOV
T E S T -J N Z
DECJ N ZJMPC A L LJ C X ZMOVMOV
C L I
T E S TJ N ZPUSHC A L LORPOPJ ZCMPJ C X Z
J NC
LOOP
J C
B XcxSI
BEG1N-OP
AL, PORT-C
AL, O l O HLAST-VAL, AL ,O X , 16250
BIOS-BREAK, SOH .U6A
OXu7
SI, 7
SAVE BXSAVE CXSAVE SISET U P RETRY COUNT FOR LEADERB E G I N B Y STARTING MOTORSEARCH FOR LEADERGET I N I T I A L VA LU E
MASK OFF EXTRANEOUS B I T SS A VE I N L O C L A S T- VA L8 OF TRANSIT IONS TO LOOK FORU A I T-FOR-EDGECHECK FOR BREAK KEYJUMP I F NO BREAK KEYJUMP I F B REA K K EY H I T
JUMP I F B E G I NNI NG O F LE A DE RJUMP I F NO LEADER FOUNDI G NO RE F I RS T E DG EJUMP I F NO EDGE DETECTEDCHE CK F O R HA LF B I T SMUST HAVE AT LEAST THIS MANY ONES IZ E PU LSES BEFORE CHCKNG FORSYN C B I T ( 0 )
D I S A B L E I N T E R R U P T SSEARCH-LORCHECK FOR BREAK KEYJUMP I F B RE AK KE Y H I TSAVE REG CXG ET P U L S E U I D T HCHECK FOR TRANSIT IONRESTORE ONE B I T COUNTERJUMP I F N O T R A N S I T I O NC H E C K P U L S E U l D T HI F CX= O T HE N UE CA N LO O KF OR SY NC B I T ( 0 )
J UM P I F Z ERO B I T ( NO T GOODLEADER )
DEC CX AND READ ANOTHER H AL F ONEB I TF I ND- S Y NCJU MP I F ONE B I T ( S T I L L L E AD ER )
535 156B E 0007E B F A 5 0 R
E 4 62
2 4 10A 2 0068 RB A 3 F 7 A
F6 06 0071 R BO75 03
u4:
u5:
Fa90F89 IFa92Fa93Fa96F B 9 9F B 9 9
F B S BFBSDF B A OF B A 3F B A 3F B A B
F B A A 4 AF B A B 75 03F B A D E 9 F92F RF B B O € 8 F96F RF B B 3 E 3 E EF B B 5 B A 0378F B B B 89 0200
U 6 A :u7 :
U 1 7READ-HALF-BI T ,U5
O X , 0 3 7 8 Hcx, 2 0 0 H
F B B BF B B CF B B CF B C I
F B C 3F B C 4F B C 7F B C 9F B CAF B CCF B CE
F A
F 6 06 0071 R BO75 6 C5 1E B F 9 6 F ROB c 95974 CD38 03E 3 04
BIOS-BREAK, BOH ,U 17cxREAD-HALF-BI T ,cx, cxcxu4OX, BXu9
u4
UB
U B
FBDO 73 C 7
F E D 2 E2 E 8
F E D 4F E D 4 72 E 6
us:
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 486/605
F B D 6 E 8 F 9 6 F R
F E D 9 E 8 F 9 4 1 RF B D C 3 C 16
F B D E 75 4 9 ’
F E E 0 5 EF E E 1 59F E E 2 5B
F E E 3F E E 4
F E E 4F B E AF E E DF E E DF B F 2F B F 4F B F 7
F B F 9
F E F BF E F EF E F FF900F900F90 I
F903F 9 0 6F909F S O BF 9 1 1F 9 3
F 9 1 5F 9 1 7
F 9 1 7
F919F 9 19
F 9 1 BF 9 1 BF 9 1 C
F 9 1 EF 9 1 FF 9 2 2F 9 2 4F 9 2 7F 9 2 9F929F 9 2 AF 9 2 C
F 9 2 F
F 9 2 FF930
F93 I
F 9 3 2F 9 3 4F 9 3 6F 9 3 7F 9 3 7F 9 3 BF 9 3 BF 9 3 CF93FF 9 4 0F 9 4 I
5 1
C 7 0 6 0069 R F F F FB A 0100
F 6 0 6 0071 R
7 5 2 3E 8 F 9 4 1 R
7 2 I E
E 3 05
B O
2 6 : 88 0 74 34 9
4 A7F E AE 8 F 9 4 1 RE B \ F 9 4 1 R2 1 E 4E l 3 E 0 0 6 9 R l D O F
7 5 0 6E 3 0 6
EB CD
E 4 0 1
F E C 4
5 A2 8 D 1
50F 6 C 4 907 5 1 3E 8 F 9 4 1 RE B OE
4 E7 4 03E 9 F a 9 9 R
5 E595B
2 8 D 2E 4 0 450
F BE E F 8 B A R58EO F C 0 1F 5c 3
, ----- A S Y NCH B I T HA S B E E N FOUND RE AD S Y N CHA RA CTER
C A L L R E A D - H A L F - B I T , S K I P O TH ER H A L F OF S YN C B I T ( 0 1
CA L L RE A D-B Y TE , RE A D S Y NC B Y TECMP A L , 1 6 H , S Y N C H R O N I Z A T I O N C H A R A C T E RJ N E W 1 6 J U M P I F B A D L E A D E R F OU ND
PO P S I , RESTORE REGSPOP c xP OP B X
,----- GOOD CRC so R E A D D A T A B L O C K ( ~ )
------__________________________________---------------, READ I OR MORE 2 5 6 B Y TE B L OC K S FROM CA S S E TTE, ON E NTRY
E S I S S EGMENT FOR MEMORY B UFFE R (FOR COMPA CT CODE )B X P OINTS TO S TA RT OF ME MORY B UFFE R
CX CONTA INS NUMB E R OF B Y TE S TO RE A D
E X P O I N T S I B Y T E P A S T L A S T B Y T E P U T I N H EMCX CONTA INS DE CRE ME NTE D B Y TE COUNTDX CONT A INS NUMBE R OF B Y TE S A CTUA L L Y RE A D
, O N E X I T
________________________________________----------
W I O :
W 1 1 :
W 1 2 .
U 1 3 :
U 1 4 .
W 15
W 1 6
W 1 7 :
W 18
--
P U S H
MOVMOV
T E S TJ N ZC A L LJ C
J C X Z
MOVI CDEC
DECJ CC A L LC A L LSUBCMPJ N EJ C X Z
JMP
MOV
I C
POPSUB
P U S HT E S TJ N ZC A L LJMP
DECJ ZJMP
cx
CRC-REG, OFFFFH ,D X, 2 5 6
B IDS -B RE A K , B OH ,W I 3READ-BYTEW I 3
W 1 2
E S C B X 1 , A L ,E Xcx. L O O P U N T I L D A T AOXU I 1
READ-BYTEREAD-BYTEAH, AHCRC RE G, IDOFHU 1 4 -W 15
u 10
AH, 0 I H
AH
DXDX, CX
AXAH, SOHW 18
READ-BYTESHORT U1 8
5 1W 1 7w 4
S A V E B Y TE COUNTCOME HE RE B E FORE E A CH2 5 6 B Y T E B L OC K I S R EADI N l T C RC R EGS E T D X T O D A TA B LO C K S I Z ERD-ELKCHECK FOR BREAK KEYJ UM P I F BR EA K KE Y H I TRE A D B Y TE FROM CA S S E TTEC Y S E T I N D I C A T E S NO D AT AT R A N S I T I O N SI F W E’ VE A L R EA D Y R E A CH E D
END OF MEMORY BUFFERS K I P R E S T O F B L O C KS TORE DA TA B Y TE A T B Y TE P TRI N C B U F F E R P T RDEC BYTE COUNTERB L OCK HA S B E E N RE A D FROM CA S S E TTE
, DEC BLOCK CNT, RD-ELK, NOW READ TWO CRC BYTES
, CL E A R A H, I S THE CRC CORRE CT’, I F N OT E Q U AL C RC I S B AD, I F B Y T E C O UN T IS ZERO, THE N WE HA V E RE AD E NOUGH, SO WE WILL E X I T, S T I L L M O R E , SO REA0 ANOTHER BLOCK, M I S S I N G - D A T A, N O D A T A T R A N S I T I O N S SO
, S E T A H = 0 2 TO I N D I C A T E, D A T A T I M E O U T, BAD-CRC, E X I T E A R L Y O N ER RO R, S E T A H 3 0 1 TO I N D I C A T E C R C E RR OR, RD-E L K -E X, CA L CUL A TE COUNT OF, DA TA B Y TE S A CTUA L L Y RE A D, RE TURN COUNT I N REG DX, S A V E A X ( R E T C O D E ), CHECK FOR ERRORS, J U M P I F E RR OR D E T E C T E D, R E A D T R A I L E R, S K IP TO TURN OFF MOTOR, B A D - L E A D E R, C H E C K R E T R I E S, J UM P I F T OO M AN Y R E T R I E S
J U M P I F N OT T OO MA NY R E T R I E S
, NO V A L ID DA TA FOUNDNO DATA FROM CASSETTE ERROR I E T I M E O U T
P OP S IPOPPOPSUBMOVPUSH
S T IC A L LPOPCMPCMC
c xEXDX, DXA H , 0 4 HAX
MOTOR-OFFAXA H, O I H
R E TREAD-BLOCK ENDP
RESTORE REGS
RESTORE REGS
ZERO NUMBER OF BYT ES READT I M E O UT E RR OR ( N O L E A D E R )
MOT-OFFR E E N A B L E I N T E R R U P T STURN OFF MOTORRESTORE RETURN CODES E T CA RR Y I F ER R OR ( A H > O )
F I N I SHED
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 487/605
F 9 4 1
F 9 4 1 53F942 5 1F943 E 1 OBF 9 4 5F 9 4 5 5 1
F946F949
F 9 4 E
F 9 4 CF S Q FF950
F952F 9 5 4F S S EF959F 9 5 A
E E F 9 6 F RE 3 20
53
E 8 F 9 6 F R
58E 3 19
03 OBE 1 F E 06F0F59F59
F 9 5 B D O D S
F 9 5 D 9 EF 9 5 E E B F A 3 C RF961 F E C 9
F963 75 EOF965 E A C SF967 F BF 9 6 EF 9 6 B 59F969 5E
F 9 6 A C 3F96EF96E 59F 9 6 C F9
F 9 6 D E E F 9F96F
C A L LJ C X Z
pusn
C A L LP O PJ C X Z
ADDCUPcncL A H FP OP
R C L
SAHFC A L LDEC
J N ZnovC L C
POPP O PR E T
POPS I CJMP
u20.
u21:
READ-BYTE
READ-HALF-E1 T ,uz 1
B X
READ-HALF-E l T ,AXu2
EX, AXEX, O ~ F O H
cx
cn, 1
CRC-GENC L
u 19AL, cn
cxE X
cx
u 2 0ENDP
RE A D ONE P UL S EI F CX =O T HE N T IME OUTB E C A U S E O F N O D A T A T R A N S I T I O N SS AV E 1 S T H A L F B I T ' SP UL SE U I D TH ( I N E X )RE A D COMP L E ME NTA RY P UL S EC OM PU TE D A T A B I TI F CX=O THEN TIMEOUT DUE TON O D A T A T R A N S I T I O N SP E R I O DCHE CK FOR ZE RO E 1 TCARRY IS S ET I F ONE B I TS A V E CA RR Y I N A HRESTORE CXNOTE :MS B I T O F B Y T E IS R E A D F I R S T
REG CH 15 S H IF T ED L E F T U l T HC AR RY B E I N G I N S E R T E D I N T O L S811 O F C H .A F T E R A L L B B I T S H AV E B EE NREAD, THE MS B I T OF THE DA TAB YT E U l L L B E I N THE MS B I T OF
R O T A T E R EG C H L E F T U I T H C AR RY T O
RE S TORE CA RRY FOR CRC ROUTINEG E N ER A T E C RC FO R B I TLO OP T I L L A L L 8 B I T S O F D AT AA S SE M B LE D I N RE G C HEVTE-ASMR ET U RN D A T A B Y T E I N R EG A L
RD-EVT-EXRESTORE REGS CX,EX
F I N I SHEDNO-DATARESTORE CXI N D I C A T E E R R O RRD-BVT-EX
REG cn
LS BT OF REG cn
...............................................; P URP OS E :
T O CO MP UT E T I M E T I L L N E X T D A TAT R A N S I T I O N ( E D G E )
E DGE -CNT CON TA IN S L A S T E DGE COUNT
A X CO NTA INS OL D L A S T E DGE COUNTE X CO N T AI N S P U L SE U l D T H ( H A L F B I T )
; O N E N T R Y :
; O N E X I T :
F96FF96F 89 0064
F 9 7 2 E A 2 6 0068 RF976F976 E 4 6 2F 9 7 E 2 4 10F 9 7 A 3 A C 4F 9 7 C E l F BF 9 7 E A 2 0068 RF 9 B 1 EO 40F 9 E 3 E 6 4 3F 9 E 5 BE I E 0067 RF 9 E 9 E 4 4 1F S E E E A E OF SE D E 4 4 1F S B F 86 C 4F991 28 DE
F 9 9 3 A 3 0067 RF 9 9 6 C 3F997
;(EAD-HALF-EI TnovMDV
I NANDCUPLOOPEMOVnovOUTnovI NnovI N
S U EnovR E T
u22.
xcnc
READ-HALF-E1 T
PROC NEAR
AH, LAST-VAL ;
cx, 100
AL, PORT-C
AL, AHw22
L A S T-V A L , A L ,
T l M - C T L , A L .EX, EDGE-CNT ,A L , T I M E R + l ,A H , A LA L , T I M E R + l ,A L , A HEX, AXEDGE-CNT, AX .ENDP
AL. o ion
AL, don
S E T T I M E TO U A I T FO R BIT
G E T P R E S E N T I N P U T V A L U ER D - H - B I TI N P U T D AT A B I TMASK OFF EXTRANEOUS B I T SSAME AS BEFORE?L OO P T I L L I T C HA NG ESU P D A TE L A S T- V AL U l T H N E U V A L U EREAD TIM ER 'S COUNTER COMMANDL A TCH COUNTE RB X GE TS L A S T E DGE COUNTG ET L S B Y T ES AV E I N AHGET MS B Y T E
S E T E X E Q U A L T O H A L F 811 P E R I O DUPDATE EDGE COUNT,
xcnc AL,AH
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 488/605
F 9 9 7F997 53F 9 9 E 5 1
F999 E 4 6 1
F 9 9 E 2 4 F DF 9 9 D O C 0 1F 9 9 F E 6 6 1F 9 A I EO E6
F 9 A 3 E 6 43
F 9 A 5 E 8 F A 5 0 RF 9 A E E8 0 4 A O
F 9 A B E E F A 3 5 RF 9 A E E 9 O B 0 0
F 9 B 1
F 9 E 1 F9F 9 E 2 E B F A I F R
F 9 B 5 E 2 F A
F 9 E 7 F AF 9 E 8 FEF 9 E 9 E8 F A I F RF 9 E C 59F 9 E O 5E
F 9 B E EO 16F 9 C O E8 F A 0 8 R
F 9 C 3
F 9 C 3F 9 C 9F 9 C C
F 9 C CF 9 C FF 9 0 2
F 9 0 4
F 9 D 5
F 9 D 6F 9 D 6
F 9 D 7
C 7 06 0069 R FFFF
E A 0100
26 E A 07EE F A O E R
E 3 02
4 349
4 1
7F F3
F 9 0 9 A I 0069 R
F 9D C F 7 D OF 9 D E 50F 9 D F E6 EO
F 9 E 1 E 8 F A O E RF 9 E 4 58
F 9 E 5 E 8 F A 0 8 RF 9 E E OB C 9F 9 E A 75 D 7
F 9 E C 5 1
F 9 E D F EF 9 E E E 9 0 0 2 0F9F I
F 9 F I F 9F 9 F 2 EE F A I F RF 9 F 5 E 2 F A
F 9 F 7 59F 9 F E EO EOF 9 F A E 6 43
F 9 F C E8 0001F9FF E B F A 3 5 RF A 0 2 E E F E E A R
F A 0 5 28 COF A 0 7 C 3
F A 0 8
U R I TE-BLOCK
P U S H
P U S HI N
A N 0OR
OUT
MOVOUT
C A L LMOV
C A L LMOV
S T C
C A L LL O O P
C L
C L CC A L L
P O PP O P
MOVC A L L
U 2 3
P RO C NE A RE Xc xAL, PORT-E
A L ,N O T 0 2 HA L, 0 1 HP O RT-E , A L
A L , OE6HT I M - C T L , A L
BEG N-OPAX, 1184U3 ICX . OEOOH
UR I TE-E1 T
U 2 3
U R I TE-E I T
cxE X
A L , 16HURI TE -B Y TE
D I S A B L E S P E A K E R
E N A B L E T I M E R
S E T U P T I M E R - MODE 3 S Q U A R E U A V E
S T A R T MOTOR A N D D E L A Y
S E T N O R M A L B I T S I Z ES E T - T I M E RS E T C X F O R L E A D E R B Y T E C O UN T
W R I T E L E A D E R
URIT E ONE B I T S
L OO P ' T I L L EA D ER IS U R I T T E ND I S A B L E I N T S
U R I TE S Y N C B I T ( 0 )
R E S T OR E R E G S C X , E X
W R I T E S Y N C C H A R AC T E R
________________________________________-------------, P U R P O S E
, O N E N T R Y
U R I T E I OR M OR E 2 5 6 B Y T E B L O C K S T O C A S S E T T E
E X P O I N T S T O M EM OR Y B U F F E R A D D R E S S
C O N T A I N S NU M EE R O F B Y T E S T O U R l T E
E X P O I N T S 1 B Y T E P A ST L A S T B Y T E U R I T T E N T O C A S S E T T E
C X IS Z E R O
, O N E X I T
________________________________________---------------~ - B L O C K
MOVMOV
MOV
C A L LJ C X Z
I N C
O E C
O E C
J G
U24
U 2 5
CRC-RE G , O FFFFH ,O X, 2 5 6
A L , ES [ E X 1 ,U R I T E - B Y T E ,U 2 5
E Xc x
D X
U 2 4
I N I T CRCFO R 2 5 6 B Y T E SU R - E L KR E A 0 B Y T E F R O M M EM
U R I T E IT TO C A S S E T T EU N L E S S C X Z O , A D V A N C E P T R S D E C
COUNTI N C B U FF E R P O I N T E R
D E C BYTE C O U N T E RS K I P - A O V
D E C B L O C K C N TL OO P T I L L 2 5 6 B Y T E B LO CKIS U R I T T E N T O T A P E
MOV
N O TP U S HXCHG
C A L LP O PC A L L
OR
J N ZP U S H
S T I
MOV
S T CC A L LL O O P
P O PMOV
OUTMOV
C A L L
C A L L
S U ERETU R I TE-BLOCK
U26
AX,CRC-REC- ,
A XAXA H , A L
U R I T E - B Y T E ,AXU R I T E - B Y T E ,
UR-BLOCK
c x
CX, c x
U R I T E - B I T
U 2 6cxA L , O E O HT I M - C T L , A L
A X . I
U3 IMOTOR-OFFA X , A X ,
E N O P
U R I T E THE O N E ' S C O M PL E ME N T O F T H E
F O R 1 ' 5 COMPLEMENTS A V E ITU R I T E MS BYTE F I R S T
U R I T E ITGET IT B A C K
N OU U R I T E L S B Y T EIS B Y T E C O U N T E X H A U S T E D ?
J U M P I F NO T DO NE YETS A V E R E G C XR E - E N A B L E I N T E R U P T S
U R I T E OU T T R A I L E R B I T ST R A I L - L O O P
TU0 B Y T E C R C T O T A P E
U R I T E U N T I L T R A I L E R U R I T T E NR E S T O R E R EG CXT U RN T I M E R 2 O F F
S E T - T I M E RT U R N MOTOR O F F
F I N I S H E D
NO E RR OR S R ~ P O R T E O ON URITE OP
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 489/605
F A 0 8F A 0 8 5 1F A 0 9 50
F AO A B A E 8
FAOC 81 oe
F A O EFAOE DO 05
F A 1 0 9 C
F A 1 1 E 8 F A I F RF A 1 4 90F A 1 5 E8 F A 3 C RF A 1 8 F E C 9F A I A 75 F2F A I C 58F A I D 59F A l E C 3F A F
F A F
F A I F B B 0 4A OF A 2 2 72 03F A 2 4 B B 0250F A 2 7F A 2 7 50
F A 2 8 E 4 62F A 2 A 24 20F A Z C 74 F AF A Z E E4 62
F A 3 0 24 2 0F A 3 2 75 F A
F A 3 4 50
F A 3 5F A 3 5 E6 42F A 3 7 B A C 4F A 3 9 E6 42F A 3 8 C 3F A 3 C
F A 3 C
F A 3 C A I 0069 R
F A 3 F D I D EF A 4 1 D I DOF A 4 3 FaF A 4 4 7 1 0 4
F A 4 6 3 1 0810
F A 4 9 F9
F A 4 A D l DO
F A 4 C A 3 0069 RF A 4 F C 3F A 5 0
MOV CL.8
U 2 7RCL cn, I
PUSHF
C A L L URITE-B I TPOPFCALL CRC-GEND E C C LJ N Z U P 7POP AXPOP cxRET
URI TE-BYTE ENDP
SAVE REGS CX,AX
AL=BYTE TO U R I T E .(115 B I T U R I T T E N F I R S T )
N O T E : TU0 E DG ES PE R B I TFOR 8 D A T A e I T s IN BYTE.
o 1 s A s s E m e L E TnE D A T A BITR O T A T E MS B I T I N T O C AR RY
S A V E F L A G S .
URITE D A T A B I TRESTORE CARRY FOR CRC CALCCOMPUTE CRC ON D A T A B I TLO OP T I L L A L L B B I T S DO NEJUMP I F NOT DONE Y E TRESTORE REGS AX.CX
YE ARE F I N I S H E D
NOTE: D A T A B I T IS I N CA RRY
........................................i n T E - ~ I T PROC NEAR, PURPOSE
, TO URlTE A D A T A B I T TO C A S S E T T E, C A R R Y F L A G C O N T A I N S D A T A B I T, I E I F SET D A T A B I T IS A ONE
I F CLEAR D A T A B I T IS A ZERO
, NOTE TU0 EDGES ARE U R I T T E N P ER B I TONE B I T HAS 500 USEC BETUEEN EDGES
FOR A 1000 USEC PERIOD ( I M I L L I S E C )
ZERO B I T M A S 2 5 0 U S EC B E T U E E N EDGESFOR A 500 USEC PERIOD ( 5 M I L L I S E C I
, CARRY FLAG IS D AT A B I T-_--------_---------____________________---;ASSUME I T ' S A ' I '
M OV AX, l l B 4 ; SET AX TO N O M I N A L O NE S I Z EJ C U 2 B : JUMP I F ONE B I T
AX, 592
AX
AL, PORT-C
U29
AL, PORT-C
AL. O2OHU30
AL, 02014
AX
0 4 2 H . A L
MOVY 2 B :
P u s n
U 29 . I NANDJ Z
U 3 0 . I N
ANDJ N Z
, NO, SET TO N O M I N A L Z E R O S I Z E, UR1T E - B I 1 - A X
, AX, I N P U T TIMER-0 OUTPUT
,URITE B I T u i r n PERIOD Ea TO VALUE
,LOOP TLL nicn,NOM U A I T T I L L TIMER'S OUTPUT IS, L O U
POP
OUTU 3 1 :
;RELOAD TMER u t i n PERIOD; FO R N E XT O A T 4 B I T;RESTORE PERIOD COUNT; SET TIMER; SET L O U B Y T E O F TIMER 2
nov AL. AHOUT 0 4 2 ~ . AL ; SET n i c n BVTE OF TIMER 2R E T
UR I TEJ I T ENDP
~RC-CEN PROC NEAR
; CRC IS USED TO DETECT READ ERRORS; A S S W S DA TA B I T IS I N C AR RY
; REG AX IS M O D I F I E D; F L A G S ARE M O D I F I E D
.-----------------------------------------
; UPDATE CRC REGISTER u i t n NEXT D A T A BIT
MOV AX, CRC-REG
RCR AX, I
RCL AX, I
CLCJ N O U 3 2
XOR A X , O B ~ ~ ~
STCU 3 2 R C L A X , 1
MOV CRC-REG, AXR E T
CRC-GEN ENDP
; i n € FOLLOUING INSTUCTIONS;YILL SET TnE OVERFLOU FLAG; I F CARRY AND M.5 B I T O F C RC;A RE UNEQUAL
,CLEAR CARRY. S K I P I F NO OVERFLOU
. CRC REG B I T I5 IS ONE,THEN XOR CRC REG U I T H
.SET CARRY
.ROTATE CARRY ( D A T A B I T ), I N T O C R C REG
,UPDATE CRC-REG, F I N I S H E D
,IF D A T A B I T XORED uITn
, onion
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 490/605
F A 5 0
F A 50 E 8 F 8 8 l R
FA53 83 4 2
F A5 5 8 9 0 7 0 0
FA58 E2 FE
FASA FE CB
FASC 75 F7
FA5E C3
FASF
FASF
FASF 3 3 D2
F A 6 1 3 2 E 4
FA63 BO OD
F A6 5 CD 1 7
FA67 32 E4
FA63 80 OA
FA 68 CD 17
FA6D C3
FA6E
FA6E
FA6E
FA6E 00 00 00 00 00 00
FA76 7E 8 1 A5 8 1 BD 9 9
FA7E 7E FF DB FF C3 E7
FA 86 6C FE FE FE 7C 38
00 00
8 1 7E
FF 7E
10 00FA8E
FA36
FA9E
FAA6
FAAE
FA86
FABE
FAC6
FACE
FAD6
FADE
FAE6
10 38 7C FE 7C 38
10 0038 7C 38 FE FE 7C
38 7 c
10 10 38 7C FE 7C
38 7 c
00 00 I 8 3 c 3 c 1800 00FF FF E7 C3 C3 E7
FF FF
00 3C 66 42 42 663 c 00
FF C3 99 BD B D 9 9
C3 FF
OF 0 7 OF 7D CC CCcc 7 8
3C 66 66 6 6 3C 19
7E 183F 33 3F 30 30 7 0
FO EO
7 F 6 3 7 F 6 3 6 3 6 7
E6 CO
9 9 5A 3C E7 E7 3C
5A 39
FAEE 80 EO F8 FE F8 EO
FAF6 02 OE 3E FE 3E OE
FAFE 18 3C 7E 18 I9 7E
80 00
0 2 00
3 c 18
6 6 00
F 8 0 6 6 6 6 6 6 6 6 6 6 6 00
FBOE 7F D B DB 7 8 18 18
F81 6 3E 6 3 38 6C 6C 38
F B l E 00 00 00 00 7E 7E
F 8 2 6 18 3C 7E 18 7E 3C
F82E 18 3C 7E 18 18 18
F 8 3 6 18 19 18 18 7E 3C
FB3E 00 18 OC FE OC I 8
F 8 4 6 00 30 6 0 F E 6 0 30
FB4E 00 00 CO CO CO FE
F 8 5 6 00 2 4 6 6 F F 6 6 2 4
FBSE 00 18 3C 7E FF FF
F 8 6 6 00 FF FF 7E 3C 18
I8 00
cc 7 8
7E 00
18 FF
I8 00
18 00
00 00
00 00
00 00
00 00
OD 00
00 00
..................................................................BEG1 N-OP PROC NEAR , START TAPE AND DELAY
CALL MOTOR-ON ,TURN ON MOTOR
HOV BL,42H ,DELAY FOR TAPE DRIVE
,TO GET UP TO SPEED ( l / Z SEC)U3 3 MOV CX,700H ,INN ER LOOP= APPROX 10 UILL ISECw34 LOOP w34
DEC 8 L
JNZ U33
RET
BEG1 N-OP ENDP
CRLF PROC NEAR
------ CARRIAGE RETURN, L I N E FEED SUBROUTINE
XOR DX,DX , PRINTER 0
XOR AH,AH , UI LL NOW SEND IN IT IA L LF,CR TO
HDV AL,ODH , CR
INT 17H , SEND THE LI N E FEED
XOR AH,AH , NOU FOR THE CR
MOV AL,OAH , L FINT 17H , SEND THE CARRIAGE RETURN
RET
, PRINTER
CRLF ENDP-----__________--_______________________------------------
CHARACTER GENERATOR GRAPHICS FOR 32 0 x2 0 0 AND 6 40 x2 0 0
GRAPHICS FOR CHARACTERS O O H THRU 7FH. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ORG
D B
DB
DB
D B
DB
DB
DB
DB
DB
D 8
D 8
D B
D B
DB
D B
D B
CRT-CHAR-GEN
DB
DB
DB
D 8
D 8
D 8
D B
DB
DB
DEI
DB
D 8
DB
D B
DB
DB
OF46EH
LABEL BYTE
OOOH. ooon, OOOH, ooon, OOOH, ooon, OOOH, OOOH , 0-00
07EH. O81H. 0A5H. O81H. OBDH, 093H. O B I H , 07EH , D - 0 1
07EH,OFFH, ODBH, OFFH,OC3H, OE7H, OFFH,07EH , 0-02
06CH. OFEH, OFEH, OFEH, 07CH, 038H, 0 I O H , OOOH , 0-03
O I O H , 038H, 07CH. OFEH, 07CH. 038H. O I O H , OOOH , D-04
038H, 07CH. 039H. OFEH, OFEH, 07CH, 038H. 07CH , D-05
0 IOH, 0 IOH, 038H, 07CH, OFEH, 07CH, 038H, 07CH , D-06
OOOH, OOOH, o i w , O ~ C H , ~ C H , i w , OOOH, OOOH , D - O ~
OFFH, OFFH, OE7H. OC3H, OC3H,OE7H, OFFH, OFFH , D-08
000H . 03CH. 066H. 042H, 042H, 066H, OJCH, OOOH , D-09
OFFH,OCJH, 099H. OBD H , OBDH, 099H,OC3H, OFFH , D-OA
OOFH, 007 H. OOFH, 07DH, OCCH,OCCH, OCCH, 07 8H , 0-06
OJCH, 066H. 066H, 066H, OJCH, 018H, 07EH, O l 8 H , 0-OC
03FH. 033H, 03FH. 030H. 030H. 07OH.OFOH. OEOH , D-OD
07FH, 06 3H. 07FH , 063H,0 63H, 067H, OE6H, OCOH , D-OE
099H . 05AH, 03CH. OE7H, OE7H,03CH, 05AH, 099 H , D-OF
080H. OEOH, OFBH, OFEH, OFBH, OEOH, 080H, OOOH , D - 1 0
o o m , OOEH, OJEH, OFEH, O ~ E H , OEH, O O Z H , O O O H , D-I I
018H,03CH,07EH, O18H, OlBH,07EH, OJCH, O l 8 H , D-12
066H, 066H. 066H, 066H, 066H. O O O H , 066H, O O O H , D-13
07FH. ODBH, ODBH, 078H, OIBH, O I B H , O I B H , OOOH , D-14
OJEH, 063H. O38H. 06CH, 06CH, 038H, OCCH, 078H , D-15
OOOH, 000H. O O O H , O O O H , 07EH, 07EH. 07EH. OOOH , D-16
o I B H , O ~ C H , XH, o I ~ H , ~ E H , ~ C H , mi, FFH , ~ - 1 7
O I ~ H . ~ ~ C H , ~ ~ E H , ~ ~ ~ H , ~ I ~ H , O I E H , O I ~ H , ~ ~ ~ H~ - 1 8
0 18H. 0 I 8 H . 0 IBH , O18H. 07EH. 03CH. 0 18H’,%OOH , D-19
O O O H , o I B H , oocn, OFEH, OOCH, o ien , ooon, ooon , DA
OOOH, 030H. 060H. OFEH, 060H, O J O H , O O O H , OOOH , D - I B
OOOH, OOOH, ocon, OCOH, OCOH, OFEH, 00011,OOOH , D-IC
OOOH, 024H. 066H, OFFH, 066H. 024H. OOOH, OOOH , D - I D
000H,018H, 03CH, 07EH. OFFH, OFFH, OOOH, OOOH , D - I E
O O O H , OFFH, OFFH, 07EH, 03CH. Ol8H ; O O O H , OOOH , D-IF
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 491/605
F E 6 E 00 00 00 00 00 00
F E 7 6 30 7 8 78 30 30 00
F E 7 E 6 C 6 C 6 C 00 00 00
F E E 6 6 C 6 C FE 6 C F E 6 C
F E E E 30 7 C C O 78 O C F E
F896 00 C 6 C C 18 30 66
00 00
30 00
00 00
6 C 00
30 DO
C 6 00
F E 9 E 38 6 C 38 7 6 D C C C76 00
F E A 6 60 60 CO 00 00 00
00 00FEAE ie 30 60 60 60 30
18 00
60 00F E E 6 60 30 1E 18 18 30
F E E € D O 66 3 C FF 3 C 66
F E C 6 00 30 30 F C 30 30
F B C E 00 00 00 00 DO 30
F E D 6 00 00 DO F C 00 00
F E D E 00 00 00 00 00 30
FEE6 06 OC 18 3060
CO
00 00
00 00
30 60
00 00
30 00
eo 00
F E E E 7 C C 6 C E D E F6 E 6
F E F 6 30 70 30 30 30 30
F E F E 78 C C D C 38 60 C C
7c 00
F C 00
F C 00
78 00
1 E 00
78 00
78 00
30 00
78 00
70 00
30 00
30 60
IS 00
00 00
60 00
30 DO
F C O ~ 78 cc oc 38 oc cc
F CO E I C 3 C 6 C C C F E OC
F C 1 6 F C C D F E OC OC CC
F C l E 38 60 C O F E C C C C
F C 2 6 F C C C OC 18 30 30
F C 2 E 78 C C C C 7 8 C C C C
F C 3 6 78 C C C C 7 C O C 18
F C 3 E 00 30 30 00 00 30
F C 4 6 00 30 30 00 00 30
F C 4 E I E 30 60 CO 60 30
F C 5 6 00 00 F C 00 00 F C
F C S E 60 30 18 D C 18 30
F C 6 6 78 CC OC 18 30 00
F C 6 E 7 C C 6 DE DE DE CO
F C 7 6 30 78 C C C C F C C C
F C 7 E F C 66 66 7 C 66 66
F C E6 I C 66 CO CO EO 66
78 00
cc 00
F C 00
F C E E
F C 9 6
F C ¶ E
F C A 6
F C A E
F C B 6
F C E E
F C C 6
3c 00F E 6 C 66 66 66 6 CF E 00F E 62 68 7 8 6 E 62
F E 00F E 62 68 70 68 60
F O DO3 C 66 CO CO CE 66
3E DOC C C C C C F C C C C Ccc 00
7 8 30 30 30 30 30
78 00I E O C D C OC C C C C
7 E DOE 6 66 6 C 78 6 C 66E6 00
F E DO
C 6 00
C 6 00
38 00
F C C E F O 60 60 60 62 66
F C D 6 C 6 E € F E F E 0 6 C 6
F CD E C 6 E 6 F6 D E C E C 6
F C E 6 38 6 C C 6 C 6 C 6 6 C
DE
DE
De
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
D E
DE
D E
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
DE
D B
DE
DE
DE
DE
DE
DE
0 0 0 ~ . 0 0 ~ . 0 0 ~ .oon, 0 0 0 ~ .OOH, OOOH, OOOH , SP 0-20
030H. 0 7 E H . 0 7 8 ~ . ~ O H , ~ O H , OOH, 030~.OOH . I 0-2 I
0 6 C H , 0 6 C H , 0 6 C H . OOOH, 00H. 000H. OOOH,OOOH , *' 0 - 2 2
0 6 C H , 0 6 C H , O F EH . 0 6 C H , O F E H , O 6C H , 0 6 C H . O O O H . 0 D-23
030H. 0 7 C H . O C OH . 0 7 E H , O O C H .O F E H , O I O H , OOOH . 8 0 - 2 4
000H. OC6H. OCCH. O l E H , 0 3 0 H , 0 6 6 H , O C6 H, OOOH ., PER C E N T 0 - 2 5
03EH. 0 6 C H , 038H. 0 7 6 H , OD C H, O C CH , 0 7 6 H ( . OOOH , L 0-26
060H. 0 6 0 H . 0 C 0 H . 0 0 0 H . 0 0 0 H . OOOH. OOOH,OOOH , ' 0 - 2 7
o i w , 030H. 0 6 0 ~ . 6 0 ~ . 6 0 ~ . 30~.IEH. OOOH , t 0-2e
0 6 0 H , 030~.iw, o IEH. o IEH, 30~. 6 0 ~ .OOH , ~ - 2 9
OOOH, 066H, 0 3 C H . O F C H , 0 3 C H , 0 66 H , OO O W , D O O U , 0-2A
OOOH, 030H,030H4, FCH. 030H. 030H.000H.000H , + 0 -2E
000H. OOOH, OOOH, OOOH, OOOH, 03OH.030H. 060H , , 0-2C
OOOH. OOOH, OOOH, O FCH, OOOH, 00H. OOOH. OOOH , 0-20
ODOH, OOOH, OOOH, OOOH, OOOH, 30H,03DH,OOOH , 0 -2E
006H. OOCH. 01EH. 030H. 06DH. OCOH, OEOH, OOOH .I 0-2F
0 7 C H . O C 6 H . O C E H , ODEH. O F 6 H , O E 6 H , 0 7 C H , O O O H , 0 0-30
030H. 0 7 0 H . 030H. 030U. 030H. 030H. O FCH, OODH , 1 0-31
078H. O CCH, O O CH. 03BH. OSOH. DCCH. O FCH. OOOH . 2 0-32
07EH. OCCH, OOCH, 03EU. O O CH, O CCH. 07E H. OOOH , 3 0-33
O I C H , 0 3 C H . 0 6 C H . O CC H. O F EH , OO C H, O I E H . 0 0 0 H , 4 D-34
OFCH, OCOH, OFEH.ODCH.OOCH.OCCH.O7EH, OOOH , 5 0-35
0 3 E H , 0 6 0 H , O CO H, OF E H , O C CH , OC C H, 0 7 E H . OOOH , 6 0-36
OFCH, OCCH. OOCH, OIEH. 030H,030H, O30H. ODOH . 7 0 - 3 7
0 7 E H . O C C H . O C C H , 0 7 B H , O C C H , D C C H , O 7 E H , O O O H , E 0-38
07E H. O CCH, O CCH, 07CH. O OCH. OIEH, 070H. OOOH , 9 0-39
DOOM, 030H. 030H, OOOH, DOOH. 030H, OJOH, OOOH . 0-3A
DOOH, 030H. 030H. 000H. OOOH, D30H. 030H. 060H . . D j E
0 IEH, 030H. O6OH. OCOH, 060H, 030H. 0 IEH. OOOH , < D-3C
000H. OOOH. OFCH,OOOH.OOOH,OFCH.OOOH,OOOH , 5 0-30
0 6 0 ~ . 30~. ien, OOCH, o iw, O ~ O H , 6 0 ~ .OOH , > o - 3 ~
07E H. O CCH, O O CH, 0 IEH, 030H. ODOH, 030H. OODH , 9 D)F
07 CH . O C6H. O DE H. ODEH, O DE H. O CO H. 07E H. OOOH , R D-40
030H. 07 E H . O CCH. O CCH, O FCH, O CCH. DCCH. OOOH .A 0-41
O FC H. 0 6 6 H . 066H. 0 7 C H . 0 6 6 H . 0 6 6 H . O F C H . 0 0 0 H , E 0 - 4 2
0 3 C H . 066H. O CDH, O CO H. O CO H. 066H. 03CH. OOOH , C D-43
O F EH , 0 6 C H . 0 6 6 H . 0 6 6 H . 0 6 6 H . 0 6 C H . O F EH , OOO H , D 0 -44
OFEM. 0 6 2 ~ . ~ W , 7 EH . 0 6 8 1 4 , 0 6 2 ~ . OFEM. OOOH , E 0-45
O F EH . 0 6 2 H . 0 6 E H . 0 7 E H . 068H. 0 6 0 H . O F O H . OODH , F 0-46
0 3 C H . 0 6 6 H . O C OH , O CO H. O C E H , 0 6 6 H . 0 3 E H . O O O H , C 0 - 4 7
OCCH, OCCH. OCCH, OFCH, OCCH,OCCH, OCCH, OODH , H 0-4E
0 7 E H . 030H. 03 0H. 030H. 030H. 030H. 0 7 E H . OOOH , I 0-49
O I E H , OOCH,O O CH , OO C H, OC C H, O CC H , 0 7 W . OOOH , J 0 -4A
O E 6 H. 0 6 6 H , 0 6 C H , 0 7 8 H . 0 6 C H , 0 6 6 H . O E 6 H , O D O H , K D-48
O F OH . 0 6 D H . 060H. 0 6 0 H . 0 6 2 H . 0 6 64 4 , O FE H , OOOH . L D-4C
OC6H. OEEH. OFEH, OFEH. OD6H.OC6 H. OC6H. DOOM , M D-4D
O C 6 H , O E 6 H . O F 6 H . O D E H. O C E H , O C 6 H. D C 6 H . OOOW , N D-4E
03EH. 06 CH . O C6H. O C6H. O C6H. OO CH, 03EH. DOOM , 0 0 -4F
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 492/605
FCEE FC 66 66 7C 60 60
FCF6 78 CC CC CC DC 78FO 00
I C 00
FCFE FC 66 66 7C 6C 66E6 00
FD06 78 C C E O 70 I C C C78 00
FDOE FC 84 30 30 30 30
78 00FD16 CC CC CC CC CC CC
FC 00FDIE CC CC CC CC CC 78
30 00
FD26 C6 E6 C6 D 6 FE hEC6 00
C6 00FD2E C6 C6 6C 38 38 6C
FD36 CC CC CC 78 30 3078 00
FD3E FE C6 8C 18 32 66FE 00
FD46 78 80 60 6.0 60 60
tD4E CO 60 30 18 OC 06J 78 00
02 00
FDS6 78 18 18 18 18 I8
FDSE 10 38 6C C6 00 0078 00
00 00
FD66 00 00 00 00 00 0000 FF
FDSE
FD76
FD7E
FD86
FDBE
FD96
FDSE
FDA6
FDAE
FOB6
FDBE
3 3 18 00 00 0000 0000 00 78 oc 7c cc76 00
EO 60 60 7c 66 66DC 0000 00 78 cc co GC78 00I C OC oc I C cc cc76 0000 00 78 CC FC CO78 00
38 8C 60 FO 60 60FO 00
00 00 76 CC CC 7COC F8E O 60 6C 76 66 68
E6 0030 00 70 30 30 3078 00oc 00 oc oc oc cccc ,78
FDC6 EO 60 66 6C 78 6C, E6 00FDCE 70 30 30 30 30 3
78 00FDD6 00 00 CC FE FE 06
ce 00
FDDE 00 00 F8 CC CC CCcc 00
FOE6 00 00 78 CC CC CC78 00
FDEE 00 00 DC 66 86 7C
FDF6 00 00 76 CC CC 7C
FDFE 00 00 DC 76 66 60
FEO6 00 00 7C CO 78 OC
FEOE 10 30 7C 30 30 34
FEl6 00 00 CC CC CC CC
FElE 00 00 CC CC CC 78
60 FO
OC 1E
F O 00
F8 00
18 00
76 00
30 00
6C 00
FE26 00 00 C6 06 FE FE
FE2E 00 00 C6 6C 38 6C
FE36 00 00 CC CC C C 7C
FE3E 00 00 FC 98 30 64
FE46 I C 30 30 E O 30 30
FE4E 18 18 18 00 18 18
FES6 E O 30 30 I C 30 30
FESE 76 D C 00 00 00 00
C6 00
OC F8
FC 00
I C 00
18 00
EO 00
00 00FE66 00 10 38 6C C6 C6
FE 00
DB
08
08
DB
DB
DB
DB
DB
OB
DB
OB
DB
08
DB
08
DB
DB
08
08
DB
08
DB
DB
DB
08
DB
DB
08
08
DB
08
08
OB
DB
DI)
08
OB
DB
DB
DB
08
De
OB
08
DB
08
DB
De
OFCH, ossn, 066n, o x n , O ~ O H , 60n, oFon, OOOH , P D-SO
078n. occn, occn, occn, oocn, 07an. o i c n . ooon , a D-SI
OFCW, 06 6 ~ . 6 6 ~ . x n , 0 6c n . 0 6 6 ~ . ~ 6 n .oon , R 0 5 2
078n.occn. OEOM, 0 7 0 ~ . i cn , OCCH, 0 7 8 ~ .oon , s O - S ~
OFCH, 0 8 4 ~ .30n. 03011, ~ o n , 30n. 0 7 8 ~ . oon ; T 0-54
occn, occn , occn, occn, occn, occn, oFcn, ooon , v D-ss
occn, OCCH, occn, occn, occn, o n n , 03011,ooon ; v D-ss
oc w , ocsn , ocen, O D ~ H , FEH, oEEn. O C ~ H , O OH ; Y 0-57
ocsn. ocen, oecn, omn, 0 3 8 ~ . ecn, ocen, ooon x D - S ~
occn. occn, occn, 0 7 8 ~ . 3 0 ~ . 3 0 ~ . 7 8 ~ .oon ; v o g s
OFEH, O C ~ H , ~ C H , 1 8 ~ . 3 2 ~ .6611,OFEH, ooon ; z D-SA
ann. oson, 060n. 0 6 0 ~ .COH. oaon, 0 7 8 ~ .OOH ; t D - S ~
ocon. oson. 030n. omn. OOCH, OOSH. O O ~ H , OOH ;
0 7 8 ~ . I ~ H , oian, o h , OIEH, O I ~ H , 0 7 8 ~ .OOH ; 1 DJD
aion, O~EH, scn, ocen, ooon, ooon, OOOH, OOOH ;
‘ 8ACKSLASH 0-SC
; CIRCUMFLEX D-SE
OOOH, OOOH, 000H. OOOH, 000H. 000H. OOOH, OFFH ;
-0-SF
OJOH, 030n. oien, ooon. won, ooon, OOOH, OOOH ; 0-80
ooon, ooo~,o78n,oocn. O ~CH, ccn, O’IW, OOOM ;
OEOH, 0 6 0 ~ . SOH,oicn. 0 6 6 ~ . een. ODG,oon ; LC I ) 0-62. LOYER CASE A 0 61
ooon, ooon, OW OCCH, ocon. OCCH, 078U, o w n ; LC c 0-63
OCH oocn, oocn, oi cn . occn, OCCH, 07m, ooon ; LC D 0-64
ooon. ooon, 0 7 8 ~ . ccn, OFCH. ocon, o7m. ooon ; LC I -6s
0 3 8 ~ . ecn. oeon. oFon, ocon, OIOH, OFOM, OOOM ; LC F D-OS
ooon. ooon. 0 7 6 ~ .ccn, occn, oicn, WCH, OFW ; LC c 0-87
oEon, oeon. oecH.076~,o . w , o . ~ ~ , ~ E ~ H ,OOH ; L C n o g r
OJOH, OOOH, 070n, O ~ O H , ~ O H , 3W.078H. own ; LC I 0-6s
OOCH, ooon, oocn. OOCM, OOCH. occn, OCCH, o n ~LC J o - 6 ~
I -
OEOH, 060H. 066H. OQCH,078H. WCM. OEIH, OOOM ; LC K 0-68
070n, O ~ O H , ion, OJOH, 0 3 0 ~ .ron, 071)~. w n ; LC L 0-ec
000H. OQOH, OCCH, OFEH, OFEH, ODSH, OCIH, OoOn ; LC II 0-60
ooon. ooon. oFnn, occn. occn. OCCH. occn. ooon ; LC n D ~ E
ooon , ooon, 0 7 8 ~ . CCH, occw, occn. 071)~.oon ; LC o D - ~ F
WOH, ooon, oocn, oeen, os m , OICH. oron. OFOM ; LE P 0-70
OOOH, ooon, 0 7 6 ~ . CCH, occn. OCH oocn, O-EH ; C Q 0-71
man.ooon. ODCH, 0 7 6 ~ .een, oron, OFOH, own ; L C R 0-72
OOOH, ooon, o x n , o c w , 078H. OOCH, OFOH, ooon ; LC s 0-73
OIOH, OJOH, otcn, 030n. O ~ O H , 34n. oien, OOOH ; LC T 0-74
OOOH, ooon, occn, occn,~occn, CCH, onin, ooon ; LC u 0-7s
ooon, ooon, occn, occn,~occu, ’IOH, oron, ooon ; L C v 0-76
ooon, ooon, OCSH,ODQH, OFEH, OFEH, oecn, OOOH ; LC Y 0-77
OOOH, ooon, ocan, oecn, OJBH, oecn, oc m , OOOH ; LC x 0-70
ooon, ooon, occn, OCCH, occn, 07cn. oocn, O F ~ H; LC Y 0-79
ooon, ooon, am i , osen, OJOH, omn, OF&, ooon ; LC z 0 - 7 ~
oicn, 0 3 0 ~ .3011,oEon, 030n.030n. oicH, OOOH ; < 0-78
omn, o ien , oien, ooon, omn, o i8n . O I ~ H , ooon ; : D-7c
oEon, 0 3 0 ~ . JOH, OICH, 0 3 0 ~ .30n. OEOH, OOOH ; 1 0-70
0 7 6 ~ . ocn, ooon, ooon, ooon. ooon, ooon, ooon ; - 0 - 7 ~
ooon, o ion , 0 3 8 ~ . ecn, ocsn, OCBH, oFEn, ooon ;
DELTA D-7F
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 493/605
F E 6 EF E 6E E 9 1393 R
FE71
FE71 BE 09FE73 B A FFFFFE76 F CFE77 32 E 4FE79 B I 04F E 7B A C
F E 7 C 32 F OF E 7 E E A C 6FEE0 03 COFEE2 33 DOF E B 4 D I COFE86 86 F2F E B E 33 DOF E E A 03 CBF E B C 24 E OF E E E 33 DOFE90 D I CB
FE92 32 F OFE94 48-95 75 E4F C S 7 OB 02P E S 9 C 3F E 9 A
F E S AF E S A 32 COF E 9 C EEFESD FE C 3FE9F 42F E A O E CF E A I C 3F E A 2
F E A I
F E A 5F E A SF E A 6F E A 7F E A EP E A SF E A CF E B OFEE2FEE6FEE6F E B EF E E DF E C 3
F
I O
I 2E8 138E RFF 06 0 0 6 C R76 04
FF 06 0 0 6 E R
83 3E 006E R 1875 I581 3E 0 0 6 C R OOBO7s OD
ORG OFE6EHJMP NEAR PTR TIME-OF-DAY...........................................................
CRC CHE CK I G E NE RA T I O N RO UT I NERO UTI NE TO CHECK A ROM MODULE USIN G THE POLYNOMIMAL.
CALLING PARAMETERSOS = DAT A SEGMENT OF ROM SPACE TO B E CHECKEDSI = I N D E X O FF S ET I N T O O S P O I N T I N G T O I S T B Y T ECX = LENGTH OF SPACE TO BE CHECKED ( IN CL UD IN G CRC BYT ES)O N E X I TZERO FLAG = S E T = CRC CHECKED OK
A H = 00A L = 7 1
B X = 0000C L = 04OX = 0000 I F CRC CHECKED OK, ELSE, ACCUMULATED CRCSI = ( S I ( E N T R Y ) + E X ( E N T R Y )N O TE . R O U T I N E U I L L R E TU R N I M M E D I A T L Y I F "RESET-FLAG
X I 6 + X I 2 + X 5 + I
I S E Q U A L T O "1 2 3 4 H " ( UA RM S T A R T ).-__-----------___-----------------------------------------
~RC-CHECKASSUMEMOVMOVCLDXORMOV
XORMOVRO LXORRO LXCHGXORRORANDXORROR
XORDECJ N ZORRE T
CRC-I: .LODSB
CRC-CHECK
PROC NEAR0 S : N O T H I N G
OX, OFFFFH
AH. AH
ex, CX
CL, 4
OH, ALAL, OHAX, CLOX, AXAX, IOH, DLOX, AXAX, CLAL, I I IOOOOOBOX, AXAX, I
OH, ALB XCRC- Iox, OX
ENDP
SAVE COUNTI N I T . E NC OD E R E G I S T E RS E T D I R F LA G T O I NCREM E NTI N I T . U O RK R EG HIGHSET ROTATE COUNTGET A BYTE
FORM AJ + C J + 1
SH IF T WORK REG BACK 4ADD IN TO RESULT REGSHIFT WORK REG BACK 1
S UA P P A R T I A L S UM I NT O RE S ULT RE GADD WORK REG IN TO RESU LTSSHIFT UORK REG OVER 4
CLE A R O F F ( E F G H)A DD ( A E CD) I NT O RE S ULT SS H IF T UORK REG ON OVER (AH=O FORNEXT PASS)ADD (AECD IN TO RESULTS LOW)DECREMENT COUNTL OO P T I L L C O UN T = 0000
RETURN TO CALLEROX S I B = 0000 I F O . K .
-.___---__-_--------_-----------------------------------------------; SUBRO UTINE TO READ AN E250 REG ISTE R. MAY ALSO BUMP ERROR
REPORTER (EL) AND/OR REG OX (PORT ADD RESS) D EPE NDI NG ONU H I C H EN T RY P O I N T IS CHOSEN.
DELAYS FOR THE 8250. I T U A S TH E MOST E F F I C I E N T U A Y T OI NCLU DE T HE DE LAY S .
PORT OX )
; T H I S S U B R O U T I N E U A S U R I T T E N T O A V O I D M U L T I P L E U S E O F 110 T I M E
; I N E V E RY CA SE , UPO N RE TURN, RE G A L U I L L CO NT A I N T HE CONT ENT S O F
..................................................................R R I P RO C N E AR
XOR AL,ALOUT DX,AL , D I S A B L E A L L I N T E R R U P T SI N C B L ; BUMP ERROR REPORTER
R R 2 : I N C O X , INCR PORT ADDRR R 3 : I N A L, DX ; READ REGISTER
R R 1 E N D P
; T H I S R O UT I N E HANDLE S THE T I M E R I NT E RRUP T FROM
; AN D TH E D I V I S O R IS 65536, R E S U L T IN G I N A PP RO X. 18.2 I NT E RRUP T S; EVERY SECOND.
; T HE I NT E RRUP T HA NDLER M A I NT A I N S A CO UNT O F I NT E RRUP T S S I N CE P OUER, ON TIME, WHICH M AY B E USE D T O E S T A B L I S H T I M E O F DA Y .; I N T E R R U PT S M I S S ED W I L E I N T S U E RE D I S A B L E D A R E T A K E N C A RE O F; B Y T HE US E O F T I M E R I AS A O VERFLOU COUNTER; THE INT ERR UPT HANDLER ALSO DECREMENTS THE MOTOR CONTROL COUNT; O F T H E D I S K E T T E , A ND WHEN I T EX P I R E S, U I L L T UR N O F F T H E D I S K E T T E; MOTOR, AND RESET THE MOTOR RUN NIN G FLA GS; T HE I NT E RRUP T HA NDLE R U I L L A LS O I NV O K E A US E R RO UT I NE T HROUGH; I NT E RRUP T 1CH A T E V ERY T I M E T I CK . T HE US E R M UST CODE A RO UT I NE; AND P LACE TH E CORRECT ADDRESS I N THE VECTOR TABLE.
RE T
._------------------------------------------------
; CHANNEL o OF THE 8213 TMER INPUT FREQUENCY IS . 1 9 3 1 ~MHZ
._-----------------_--------------------------------DRGASSUME
T I MER-I NT. S T IP US HPUSHPUSHC A L LI NCJ N ZI NC
CMPJ N ZCMPJ N Z
7 4 :
O F E A I HOS: DATA
PROC FAR
D SAXOXDDSTIMER-LOUT 4TIMER-HIGH ;
TIMER-HIGH,OIBH IT ITIMER-LOU, OBOHT 5
INTERRUPTS BACK ON
S A V E M A CHI NE S T A T E
I NCREMENT T IWETEST-DAVINCREMENT HIGH UORD OF T IMETEST-DAVTEST FOR COUNT EQUALLING 24 HOURSDI S K E T T E - CT L
DI S K E T T E - CT L
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 494/605
FECSF E C 7FECAFECD
F E D 2
F E D 2F E D 6F E D @F E D 0FEDFF E E 1
F E E 3F E E SF E E 7F E E #F E E BFEEAFEEE
26 coA 3 OO6E RA 3 0 0 6 C RC 6 01 0070 R 0 1
F E OE 0040 R7s O beo 20 OOOF R FOBO eoE6 F2CD I C
EO 20E6 20SAso1 FC F
F E E BF E E E 02 04
FEED 46FEEE E 2 F BFEFO OA COF E F 2 C 3FEF3
F E F 3f E F 3F E F 3 F E A S RF E F S 1-91 RF E F7 F B I 5 RF E F S F O l S RF E FE F B I 5 RF EF D - F a 1 1 RF E F F EFS7 RF F O l F O l l RF F 03 ODOE RFFOS F040 RF F 0 7 F S 4 1 RFFOB ECSB RFFOE t 73b RFFOD FESB RFFOF 1300 RF F l l E F D 2 RF F 1 3 0000
F F l S OE1B RFF17 1 3 S 3 RF F A b F I X RF F l E F E 3 C R
F F I D F O A4 RF F l F E FC 7 RFF21 EOSE RF F 2 3FF23 2 E : IA 04
F F 2 6 4 6F F 2 7 50F F 2 8 E l 1 0 8 A R
FF2E SS
F F 2 C 3 C ODF F 2 E 75 F3F F 3 O C 3F F 3 I
F F 3 1
F F 3 1 EO E6FF33 E 6 43FF35 81) 0533
F F 3 8 E 6 4 2F F 3 A SA C 4F F J C E 6 42F F 3 E E 4 61F F 4 0 E A EOFF42 OC 03F F 4 4 E 6 6 1F F 4 6 28 CSF F 4 8 E 2 F EF F 4 A F E C BF F 4 C Z5 F AF F 4 E 0 A C 4F F S O E 6 6 1F F S 2 C 3F F S 3
TIMER HAS GONE 24 HOURSSUE AX,AXMOV TIMER-HIGH, AXMOV 1 MER-LOU, AXMOV TIMER-OFL, I
TEST FOR DISKETTE TIME OUT; LOOP T I L L AL L OVERFLOWS TAKEN; CARE OF
DEC MOTOR-COUNTJ N Z 16 . R ET UR N I F COUNT NOT OUT
MOV AL,FDC-RESET ; TURN OFF MOTOR, DO NOT RESET FDCOUT NEC-CTL,AL ; TURN OFF THE MOTORI N 1 I C H ; TRANSFER CONTROL TO A USER
MOV AL,EOI
POP o xPOP A XPOP 0s ; RESET MACHINE STATEI RET ; RETURN FROM INTERRUPT
AND MOTOR-STATUS,OFO;~ ; TURN OFF MOTOR RUNNING e l i s
;ROUTINE
OUT 0 2 0 n . ~ ~ ; END OF INTERRUPT TO e259
1 MER-I NT ENDP
PJSCG12A:
P-MSG
iEEP
G7:
BEEP
DYDYDYDU
DYDYDYDYDYDYD YD YDYDYD YDYDYDUDYDYD YDY
DYD YDYPROCMOVI N C
C A L LPOPCMPJ N ERETENDPROUTPROCnovOUTMOV
OUTMOVOUTI NnOVOROUTSUELOOPDECJ N ZnovOUTRETENDP
P u s n
OFFSET K E - I N 1 ; NTERRUPT 9OFFSET D l 1 ; NTERRUPT AOFFSET D l 1 ; INTERRUPT E
OFFSET D l 1 ; INTERRUPT COFFBET D l 1 ; NTERRUPT 0OFFSET DISK I N 1 ; INTE1IRUPT EOFFSET 011- ; I W T E R R W T FOFFSET VIDEO-IO ; INTE-UP1 l O HOFFSET EQUlmENT . INTERRUPT 1IHOFFSET MEMORV-Sl ZkJETERMINE . INTERRUPT 12H
OFFSET RS2J2-10-; I k T E R R W T 14HCASSETTE IO . IN7ERRUPT ISHOF F S E T K hOA R D - ; O ; NTERRUPT I I HOFFSET PRl l lTER-IO ; INTERRUPT I MOOOOOH ; INTERRUPT I WOFIOOH ; WST DE INSERTED l W f 0 T U L E LATEROFFSET EOOT-STRAP ; INTERRUPT ISHTIME-OF-DAV ; I N T E R R W T 1AM -- TI- O F DAVDUMV-RETURN ; IMTERRUPT IBH -- K M D w*)( ADDR
VIDEO-PARMS . INTERRUPT I D -- V I D E O PAR
CRT-CHARH , INTERRUPT I F -- V I D E O EXTNEARA L , C S : C S I l ; PUT CHAR I N U
OFFSET DSKETTE IO IMTERRUP~ 1311
DUMMV-RETURN ; i n T E m U P T IC -- TIMER W*K ADOR
OFFSET DSK-EASE ; INTERRUPT IE -- DSK
SI ; POINT TO N EXT CHARAX ; * V E P R i m cnmPRT-HEX ; CALL VIDEO-IOAX ; R EC OV ER P R I W C HA RAL, I3 ; WAS I T CARRACE RETURM?G 1 2 A , N O,K EE P P R I N T I N G S T R I N G
TO SOUND EEEPERNEARAL, IOllOllOE ; SEL T I M 2,LSE,MSE,8INARVTIMER+3,AL ; WRITE THE J IM ER MODE REGAX, S33H ; D I V I S O R FOR 1000 HZ
TIMER+2,AL ; WRITE TIMER 2 CNT - L S EAL, AHTIMER+2,AL ;
AL, PORT-EAH, A LAL, 03PORTJ, ALcx, cxG7B L67
AL. AHPORT-B, AL
WRITE T I M E R 2 CNT - WSBGET CURRENT SETTING OF PORTSAVE THAT S E T T I N GTURN SPEAKER ON
SET CNT TO W A I T SO0 NSDELAY BEFORE TURNING OFFDELAY CNT EXPIRED?NO - CONTINUE BEEP ING SPKRECOVER VALUE O F PORT
RETURN TO CALLER
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 495/605
.--------------------------------------
; DUMMV RETURN FOR ADDRESS CO MP AT IB IL IT Y
FF53FF53 C F
ORG OFF53HI R E T-- I N T 5 .........................................................THS LOGC ~ I L L E INVOKED BV INTERRUPT OH TO PRNTT HE S CRE EN T HE CURSO R P O S I T I O N A T T HE T I M E T H I S RO UT I NEIS I NV OK E D U I L L B E S A V ED A ND RE ST O RE D UP ON CO M P LE T I O N T HERO UT I NE IS I NT E NDE D T O RUN U I T H I NT E RRUP T S E NAB LE DI F A SUBSEQUENT 'P RI NT SCREEN KEY IS DEPRESSED DURING THET I M E T H I S R OU T IN E IS P R I N TI N G I T U I L L B E IG NO RED
ADDRESS 50 0 CO NT A I NS T HE S T A T US O F T HE P R I NT S CRE EN
50 0 =o E I T HE R P R I NT S CRE EN HA S NOT B E E N CA LLE DOR UPON RETURN FUW A C AL L T H l S I W O I C I T E SA SUCCESSFUL OPERATION
= I P RI NT S CRE E N IS I N P RO GR ES S
=OFFH ERROR ENCOUNTERED DURIN G PR IN TI NG...........................................................FF54F F S 4FF54F F 5 S
FF56FF57
F F 5 B
FF59F F S AF F S DFF5FFF64FF66F F 6 B
F F I D
F B1 E
50
53
SI
88 ---- RBE OB80 3E 0000 R 0 174 S FC 6 06 0000 R 01
84 OF
CD 10
FF6F BA CCFF71 B5 19FF73 E 8 F A 5 F RFF76 5 1FF77 84 03FF79 CD IOF F 7 B 59F F 7 C 52F F 7 D 33 02
FF7F 84 02FF81 CD 10F F B 3 84 OBF F B 5 C D 10
FF87 OA CO
FF89 75 02F F B B BO 20F F B D 52F F B E 33 02FF90 32 E 4FF92 CD 17FF94 5 AF F 9 S F6 C 4 29FF98 75 2 1F F S A FE C 2F F S C 3A CAF F S E 75 OFF F A O 32 0 2F F A 2 E A E 2F F A 4 52F F A S E 8 F A S F RF F A B 5 AF F A 9 F E C 6
F F A B 3 A E EF F A D 75 DOF F A F 5 AF FB O 8 4 02FFBP CD 10
F F B 4 C 6 06 0000 R 00
F F B S E B OAF F B B S AF F B C 84 02
FFBE CD 10
F F C O C 6 06 0000 R FF
F F C 5 5 AF F C 6 59F F C 7 5 BF F C B 58
F F C S I FF F C A C FF F C B
ASSUMEORG
PRINTJCREENS T IPUSH
PUSHPUSH
PUSH
PUSHMOVMOVCMPJ ZMOVMOV
I NT
CS: CODE, OS: XXDATAO F F 5 4 HPROC FAR
OS
AXB X
cxOXAX. XXDATAOS; AXSTATUS-BVTE, I ;
E X 1 TSTATUS-BVTE, 1 ;
AH, 15
I O H
M UST RUN U I T H I NT E RRUP T S E NA B LE DMUST USE 5 O : O FOR DATA AREASTORAGE
U I L L U S E T H I S L A T E R F OR C UR SO RL I M I T SU I L L HO LD CURRENT CURSO R P O S I T I O UHEX SO
S E E I F P R I N T A L RE AD Y I N P RO GR ES S .JUMP I F P RI NT A LRE A DY I N PROGRESSI N D I C A T E P R I N T N OU I N PR OG RE SSU I L L REQUEST THE CURRENT SCREENMODE
C A L I =MODECAHl=NUMBER COLUMNSILINECB H l = V I S UA L P A G E
; **n*********~*******n****n*******n**********n*****n******nA T T H l S P O I N T U E K NO U T H E C O L U M N S / LI N E A R E I NCAXI AND THE PAGE I F A P P L I C A B L E IS I N C B H I . T HE S TA CKHAS DS,AX,BX,CX,DX PUSHED. C A L I HAS VID EO MODE
MOV CL,AH ; U I L L M AK E U S E O F C C X l R E G I S T E R T OMOV CH.25 ; CONTROL ROU S COLUMNSC A L L C R L F ; C A R R I A G E R E TU R N L I M E F E ED R O U T I N rPUSH CX ; SAVE SCREEN BOUNDSMOV AH.3 ; U I L L NOU READ THE CURSOR.I N 1 I O H ; A ND P RE SE RV E T HE P O S I T I O NPOP cx ; RECALL SCREEN BOUNDSPUSH OX ; RE CA LL CB HI = V I S UA L P A G EXOR DX,DX ; U I L L S E T CU RS OR P O S I T I O N T O C 0 , O I :
; *~n******************nn***************n*****nn******n*****n**n*T HE LO O P F ROM P R I I O TO T HE I N S T RUC T I O N P R I O R TO P R 1 2 0IS THE LOOP TO READ EACH CURSOR PO SI Tl OM FROM THE SCREENA ND P RI NT .
; *****************n*******n****nn***********n*****n****n***
; ********n******nn***********************n**n*n*n*n*nnnn*****n**P R I I O : M O V
I MTMOVI NTOR
J N ZMOV
XORXORI N TPOPT E S TJ N ZI MCCMPJ N ZXORMOVPUSHC A L LPOPI MC
CMPJ N ZPOPMOVI N TMOVJMP
E RRI O : P O PMOVI N TMOV
E X I T : P O PPOPPOPPOPPOPI RET
PRINTJCREEN
P R I I S : PU SH
AH, 2I O HAH, 8
I O HA L , A L
P R I I 5A L , ' 'OXOX, OXAH, AH1 7 HOXA H. 029HERR 10
D LC L, D LP R I 10
D L, D LAH, DLOXC R L FOXD H
CH, DHP R I 10
OXAH, 2I O HSTATUS-BVTE, 0 ,S HO RT E X I T ,OXAH, 2I O H
OXcxB XAXOS
ENDP
STATUS-BYTE, OFFH'
TO I ND IC AT E CURSOR SET REQUESTNE U CURS OR P O S I T I O N E S T A B L I S HE DTO I ND IC AT E READ CHARACTERC HA RA CT ER N OU I N C A L IS E E I F VALID CHAR
JUMP I F V A L I D CHA RMAKE A BLANKSAVE CURSOR POSIT IONI N D I C A T E P R I N T E R I
TO I N D I C A T E P R I N T CHAR I N C A L IPRINT THE CHARACTERRE CA LL CURS O R P O S I T I O NTEST FOR PRINTER ERRORJUMP I F ERROR DETECTEDADVANCE TO NEXT COLUMNS E E I F A T E N D O F L I N EI F NOT PROCEEDBACK TO COLUMN 0CAH1=0SAVE NEU CURSOR POS IT IO NL I N E F E E D CA RRI A G E RE TURNRE CA LL CURS O R P O S I T I O NA DV ANCE TO NEX T L I N E
F I N I S H E D ?I F NOT CONTINUERE CA LL CURS O R P O S I T I O NTO IN DI CA TE CURSOR SET REQUESTCURSOR POSIT ION RESTOREDI N D I C A T E F I N I S H E DE X I T T HE R O U T I N EGET CURSOR POSIT IONTO REQUEST CURSOR SETCURSOR POSIT ION RESTORED
. I ND I CA T E E RRO RRESTOR; ALL THE REGISTERS USED
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 496/605
F F C B
F F C B 28 CO
F F C F C 7 06 0024 R 1937 RFF05 A 3 0060 RF F D B C 7 06 0062 R F600FFOE CD 18
F F EO
FFCD BE oe
F F EOF F E O E 6 43F F E 2 B A 0040F F E S 02 0 4F F E 7 8 A C 3F F E S E EF F E A 52F F EB SAF F E C B A C 7F F E E E EF F E F C 3F F F O
F F F O
F F F O EAF F F l 0043 R
FFF3 FOOO
FFF5 30 36 2F 30 31 2F38 33
F F F D F F
FFFE F D
FFFF
--------------------_______________L____-------
, EASE OF USE REVECTOR ROUTINE - CALLED THROUGH, I N 1 I B H U H E N C A S S E T T E B A S I C IS IN VOKED ( NO D IS KE T T E, NO CARTRIDGES), KEYBOARD VECTOR IS RESET TO POINT TO "NEU-INT-9", BASIC VEC T O R IS SET T O PO IN T T O F600 0................................................~ASJNT PROC FAR
ASSUME OS ABS0SUB AX,AXMOV OS,AX ,SE T ADDRESS INGMOV UORO PTR INT_PTR +4,0FFSE T NEU-INT-9MOV BASIC-PTR,AX SET I N T 18=F600 0
MOV BASIC-PTR+P, OF6ObHI N T IBH , GO T O B A S I C
BAS-ENT ENDP_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ r _ _ - _ _ - - - - - - - - - - - - - - - - - - - - - - -
I N I T I A L I Z E T I M ER S UB RO UT IN E - ASSUMES BOTH THE LSB AND MSB
O F TH E T I M E R U l L L B E U SE D, C AL L IN G PAR AMET ER S
( A H ) = T I M E R 8( A L ) = B I T P A TT ER N O F I N I T I A L I Z A T I O N UORD( E X ) = I N I T I A L C O U N T
(BH) = MSB COUNT( E L ) = LSB COUNT
, AL T ER S R EG IST E R S O X AN D AL
INIT -T IM ER PROC NEAR
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OUT TIM-CTL,AL , O U TPU T I N I T I A L CO NT RO L U OR DMOV D X,T IMER , BASE PORT ADDR FOR T IMERSADO DL,AH , ADD I N T HE T I M E R IMOV AL,BL , L O A D L S BOUT DX,AL
PUSH OX , PAUSEPOP OXMOV AL,BH , L O A 0 MSBOUT DX,ALR ET
IN IT - T IMER EN D P
____________________------------POUER ON RESET VECTOR
ORG OFFFOH
_________________-__-- - - - - - - - - - -
,----- POUER ON RESET
OB OEAHDU OFFSET RESETDU OFOOOH
OB '06f01183'
OB OFFH
OB OFOH
OB O F F H
ENDkODE ENDS
; J U MP F AR
; RELEASE MARKER
; F I L L E R
; S Y S T E M I D E N T I F I E R
; CHECKSUM
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 498/605
Appendix B.LOGIC DIAG RA M S
Program Cartridge ........................ B-20 Power Supply Board ....................... B-23
64KB Memory and Display Expansion ........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
B-25
Logic Diagrams B-1
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 500/605
1 1 1 0 8 7 b 5 4 3 2
UJ I 1
1 1 10 9 8 7 b 5 4 3 2
System Board (Sheet 1 of 17)
System Board B-3
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 501/605
b 5 4 3 I 21 1 0 9 8 1
nUJ0.a.1 8 - l a
DC 1 - 0 . 2 1 A#
-I A1
l bon I - 0 . 2 l
OR 1 - 0 . 2 p = jznrs
I 1
LS2'15
A 0 -K 1 - C O 2 1
x 1 1et 1 - C . 2 1 -l
4 l b ,8 V 1 -C.2 I O2
CA I - C I P I f 15
cs I-C.2 Ib I*
cn t - C O P 11 1 5
cs 1 - c o t 1I 12
t T 1-612
1 1 I 1 0 9 8 1 b I 5 4 3 I 2
System Board (Sheet 2 o f 17)
B-4 System Board
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 502/605
1 1 10 9 8 J b 5 4 3 2
L S 1 5 1
TU 18-Fa2 1 1ART p6
'18 1 V -
'L T 5 - F 0 2 1 . 2 A R A 1 I H S 5-611
I H T 5 - F l t
I MU 5 - f 1 1
I H V 5 - 011RD 1-E 03 I ; ' . 2 8 2 V 4
cpu ''*'
R A '
- 3 A
-3 8 3 V -
- 4 A
- 4 0 4 V -I J A q - 3 1 1U15
- R 4 'I J0 * - A 1 1
6C 2-F a2
HA 2-E82
TU 1.-682
TV 18-Fez
CF Z-FIZ
HC 2 - D O 2
CY 2 - F 0 2
A
System Board (Sheet 3 of 17)
System Board B-5
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 503/605
1 1 10 9 8 J b 5 4 3 2
r L 2 - c 1 31 x D i
FC 2 4 0 3 I
FB 2 - C I J I
'D
'OsI ,
WE
VCC CN
.bl UF.v '
N J l - K02 I ~ o e
NV 1 - J 0 2 1 ' ~ 02
I'
Ne l - K 0 2 I D lD
PA l - J B 2 I . DJ
PF l - J 0 2 I 04IS .D'
AD (-Fa2 I
J A J - J e 2 I
CLK . CLKMsvNc I N
MZ 3 - J e 2 1
eC 1 - 003 I ~
I O UL I D R
.( 1 4 0 3
PIX 3 - J l 2 I
MW J - J 0 2 1
VfvNC
''cN
'
VERT IN
' l o w ,
DE
CURSOR
LM 5-J12 MEM CfVIDEO R A M CS 3
MV b-G.2 I1 "O Cf -
I I O CS
KL S-Ell
KM 5-Ell
KN 5 - E l l
I I L T M
__c CLR1
Z C C C N D
+5v
I1 4 11 - u t 1- D l l
AMEMvcI 14LSS.
2
System Board (Sheet 4 of 17)
B-6 System Board
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 504/605
1 1
24SIO
I5A1 I
10 9 8 J b 5 4 3 2
I -VIDEO RAM CSLM 4 - c l ,d A b DO\
IJJ 1 - 682 I
I I IZ l.-F.21cpu p6 2
.V 1-F.21' * I b
L S I 5 1
. I A
3HS 3-K.21 A 0 DO 18 I Y . I LR s - 81 I
CPU A 1 4L S S l 4 '
@
0 1 . 2A'@
D2 I '
I 4
, D3
D4
D5 - l5
DbI b
D l I
UT 3 - K e 2 l A 1
NU 3-KO2 A2
KE 4-F.2 I A 3
I LS 3 - A 1 ICPU A 1 5
.28 2,-I
I R A 2
lP CPU A l b
A
38 JV I T 1 - K I
Z I l l
- 4 1
-48 4v-
LI
SEL
1 - G
c G A 3
13Z I l .
KJ 4 - €02
AI LTH
II V J-K.2 I 6ND
I 2J
I II
4.C 4 4 . 2 b
I I 1K8 4-f.2 I
KA 4-F.2
J2 4 4 8 2
JY 4-f S2
JX *-F 2
JW 4 - F l l
LJ 4-A.2
.U 1-C.J
F I 2-5.3
r* 2-50>
FC 2-6.J
CY 2-6.3
su 2-I.>
E 2
CL 2 - I D J
CC 2-1(11
II
*V l DCO ME IR
System Board (Sheet 5 of 17)
System Board B-7
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 505/605
b 5 41 10 9
l,-n,2-LPEN INPUT
L f sm
I+LPEM LTR
i 4 F wi iRE 1-E.2 I A V 1
'
Rn 1-€02 I T I 8 Vb
z A 1
3 2
as;n52i
VCC CND
-C A R D SLCTD n*
1 2 - F l l
1 2 - F l l
1 2 - C l l
12-Fll
1 2 4 1 1
1 2 - E l l
I -Dll
12-011
System Board (Sheet 6 of 17)I
B-8 System Board
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 506/605
1 1 1 0 9 8 1 b 5 4 3
3
5
b
1
a
P
’
B L 1 - C 0 2 I 2
BW I - c a 2 I O2
CE I-C.21 D3
cn 1 - c a 2 1 O4
BR l - C B 2 I ”
CN I-CB2 I Os
CT t -8 9 2 1
cv 1-802 I O1 .- -
I I I <*a. I I
ZD 0LS24S
r : Y $-Ellr: e $31
G V E l l< E i - 6 1 1
rl € lr6
1 1 Z D l -1b Z D Z -15 203 -
4 N t l I l - H l 1 4 N L - G I 1 4 N K E- J 1 1
4 N f I m - H I l h N f P- GI1 4 N R E- J 1 1
4 N Y 1 l- J1 1 k N X 1 - G I 1 4 N W E -J 11
4 P D I 1 - J I 1 4 D C -61? 4 P 6 a - J l 1
A 8 - 1 0
I* Z D * -13
12
4 P J 1 0- Jl l 4 D H 9 -F I l b P G # - U t 1
zD s C PK 3-F I I
‘” 4 P0 3 - f I
zD’ : PU 3-G l I
4 P N 1 0 - J l l 4 D M 1 - F I l 4 P L a - l i l l
4 P T 1 0 - J 1 1 4 P S 1 - F I 1 h P R 8 - U I 1‘-4’ 11
~ P Xe - ~ t i P U- F I ~ P V-nil
D I I
b-nB2 -iin ON C*RO
7
5 I \ b
4
DD i - n e 2 1 ’*“
a 18 -S 244
ED I - D #2b - ‘ O R
4AV 1 - E B 2 k - I D w ‘ b -
A14
4€3 s t C 1 1
4 . 6 1 0 - A i i L w - N i t ;I.€-u I i 4 . 0 J - G ~ ;c q-cit 2 -E11- - z l o w - an i - e l i
- Z I O R
4 0 P -E11 4 P N 1 - U l l h 4 M - G I 1 4 Q J 3-G11 4 . K 4-C1l d Q L - J l 1
CC GND
I 8AV l - E B Z P HLDA
BA 1-00211
15
13
BH 1-082 I
NN 1-G#21 A”
I1I( 4-Ce2 1
*lV
12
3 -xMEMR
5
1
XHLDA : . I S - E l l
;Iv-5E : ;I; -011c I w 4 - 6 1 1
;IF g I e ; 1+VERT O U T D R I V E -824
System Board (Sheet 7 of 17)
1 I --- ’
AR 1-602
AS 1-602 ’*I3
AT (-Ea2 P A ’ 2
GA 2-F02 ”’8
I1
System Board B-9
*” ;f D 2 - C 10 I 3 - t l l
1b A l l
”
14
12
3
4 T W d l 1
‘”: R Y b - H 1 1
1s
3
11
I 1
GV 2 4 1 5 I “’A f I - f B 2 I RESET
cc I - M # 2 I
I Z A 1
4sa r e - H I I .4P A 3
4 D , , - PI , ;Isc- E 1 ’XR ESC T
- I S € 1 3 - € 1 1C L K -H 4 1
1 1 1 0 9 8 1 b 5 4 3 2
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 507/605
- C A D L E C O N N E C T E D
- 1 R < O D D A T A
- C @ L C O D Db T Auc , , - Do I
UD , o -oo*
SERIAL I N T R sc
'D2
'NTR. am ------Jx
l . L S l 4
IV B D.~ L A T C U4 SP . - I 1 I_I ___
K v m NIS. .-El
Nn'I S R I-Jll
IR TEST E N L B L EST
C M N L I C L O C I S E L E CT
- C H N L 1 C L O C K SELECT
su ,-F
- E
System Board (Sheet 8 of 17)
B-10 System Board
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 508/605
1 1 10 9 8 -I b 5 3 2
~pU V D O L A T C U
1255A-5Icc
CNO
IIS Y v -011
t i i I
ZH23
Db
01
1-
-1 1-
+
LLS.4
'*sY
I X ( . -GI I
I , .-GI1
sZ I b - r l l
TA ll-F,l
HODCII CD I N S T I L L E D
OISUTE CD INSTALLED
RJ.
A U X D A T A OUTl z - e I I
I . 2u onn
R J Z
@Z* 2
3 onn
r-I II I
N l K E D A T A OUTTc
IR TCST r a c e
System Board (Sheet 9 of 17)
System Board B-1 1
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 509/605
T 1- . - .P I - J W t Dl
PN l - J # * I , 0 2
'' '
I5
I2
PJ 1 -JD 4 1 "? 03 A U D l
CO 1-J.4 04
NV 1-J.41 -0.
k ''"
1K OHM-.- I I
TU
TV
T I
TX
TV
TZ
UA
u.
J O Y S T I C KI N T E R F A C E
C A B L EI N T E R F A C E '
a-c iq
l-C9I
a-u1 I
s -MI I
S-UlI
5 -6 1 1
3-61 I
3 -6 1 I
*
1 1 1 10 I 9 8 I 7 1 b I 5 I 4 I 3 I 2
Systom Beard (Sheet 10 of 171
B- 2 System Board
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 510/605
1 1
*uc 2 - c t t
¶- S I '
l - J t l
I
I I . I 4 I I3 28 7 b1 10
System Board (Shwt 11 o f 17)
System Board B-13
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 511/605
1 1 1 0
nv L - C ~ IOUT Mv
NO b-CIZ I
t ,-~,21
lLUI
+VERT OUT 011VL
N b-DaZI-
GA*b Y '
CAea V 'Is*'' bJ'
NA b-D.2klN'sN
GaCENNC b - C Z *
n~ b-Dazl
R ,-,,*,
-COW SVNC DIV
-T V VCRT O I l V C
-TV @OR D R I V O GA3 J 'b-Ca2
9 8 7
S E R I A LPORT
I I I b
J
5 4 3 1 2
D R E C TDRIVEV I DE0
T E L E V I S I O NM O D U L A T O R
B-14 System Board
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 512/605
I1 1 0 9 8 7 b 5 4
on ( - cas IDo
OS l-C@3&
BX 1-CIJI
CD 1
CJ 1-C.3
CP I-C.3:
D2
O3
D'
DE 1-0.3 I
DJ 1-0.11
ON l-0#3
DS 1-0.31
ox 1-8.2 I
DZ 1-0.21
*'
DV 1-8.2 r A'A5
Ab
PZ 1-Ha21
SS 1-603
LL 1-C.JI
A ' '
* I 5
PP I-c.1;
UU 1 G.31
-2
I T T I.12v
1 1 I 1 0 9 8
.#*-I F1 x 1
Jb
J b
Jb
J b
7 b I 5 4 3 I 2
Jb
I unR a1
VU IS-D # 2 *O .
+ l Z V uN
1 uI
+
AUDIO INPUT u,
System Board (Shoot 13 of 17)
System Board B- 15
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 513/605
1 1 10 9 8 J b 5 4 3
EM 2-H.2
EM 2 - H I 2
Ea 2-He2
EV 2 - H I2
E2 2 4 . 2
FD 2 - G I 2
F J 2 - 6 0 2
FN 2-CM2
JD 3-HM2
2
JF 3 - H M 2 1”
BJ112’ J
*2M >J
B2p Y’A” J7
Y’Y’Y’BJ’
Y1‘I‘ Y’
Y’8 a 2 BJ1
+J1
bJ’
C5V Y’-
<>J
**Y
J H L C M 2
J L 3 - 6 8 2 I”
JN 3-FB2 I“
Je 3-EM2 k
J S 3 4 0 2
, JU 3-EM2 I”
LK * - A 9 2 Icpu L A T C H
KT 4-CM2* la
KP 4-CM2 I-YE
KV 4 4 0 2 I‘RAS
KU 4 - C I Z I
FR 2 - GM2I
LC 4 - 612 I*”’ OL”
+VIDCD MEMR
KV 4-602 IG A T E
p>J’
+
1 1 10 9 8
I U R 4 - C l l
I US 4-611
y+>J7 4 UT 4 4 1 1A 1
J b 5 4 3 2
r / 4UV 4-Fl1D
A I U W 4 4 1 1
A= Iuv 4-fl1
I U X 4 - F l I
i z * - c 11
+ s v
6p>J’ vA , - A , ,DISABLE CAS0
I V I 5-011
B 4 VC 4 - A 1 1
-0 IS A S LE CDAT A
- L C S
System Board (Sheet 14 of 17)
B-16 SystemBoard
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 514/605
1 1 10 9 8 7 b 5 4 3 21 I I I
System Board B-17
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 515/605
1 1 10 9 8 1 b 5 4 3 2
< >la
B-18 System Boaid
q
1 1 10 9 8 1 1 b 5 4 3 2
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 516/605
1 1 1 0 9 8 J b 5 4 3 2
.. .
J 1 9
I J.>I
I
System Board B-19
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 517/605
I I I 7 I b I 5 I 4 I 3 I 21 1 0 9 8
1 1 1 0 9 I ' 8 I -l I b
xx 2-C.21IIAqJ
5 4 3 1 2
PP 2-*e2.. -c.2
RR 2 4 . 2
I l l A 9
I 4 - 4 .
d I . 1
If0 t o e Z - M S l
- 5 v$-ri
0 7 t J
B-20 Program Cartridge
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 518/605
1 1 I 0 9 8 7 b 5 4 3
815BB I - H 0 2 , ‘O’
2
B l bcc 1 - H 0 2 , ‘02
1 1 1 0 9 8
A 1 5DO 1-H02 ’”
7 b 5 4 3 2
A ? qEE 1 -G 0 2 I ‘04
A 1 3FF I - G 0 2 I X D 5
1 1 2 .GG 1 - 6 0 2 I X D b
A 1 1HH I - G 0 Z I ”’
JJ 1 - J l I13 X A #
I K S I - J I I812 XA I
I L L I - J I I11 XAZ
I n n I-HI110 X I 3
I N N I-HI10q XA4
I P P I-HII08 XA5
I 4 4 I-HI1B81 XAb
80 b X A 7
A 0 b XA8
I R R 1 - l t I I
I ss I - I 4 1 I
4 TT I - G I I01 XA9
4 U U 1 - 6 1 1A 18
x A ” I V V I-CII
x A ’ 2 I Y Y I - E l l
‘*I3 I xx I-C?
A 0 8 __
005
A 0 5
I vv I - C I I04 X A I 4
s5v0 478-
c
cs* 422 1 4 1 1IL
A 1 7 CS4I A B I-III
( A D I - F t 1
c s s I A C I - F l l
“’ I A f I -F1 I
803
A03
802
-BASE ROW 1 I N C A R T d---Wb
104
4
+01
Program Cartridge (Shed2 d 3)
Program Cartridge B-21
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 519/605
Iv v v v u v v v u v v v v
n n n n n n n n n n n n n n
znz c
- -v v v u v v v v v v v u v v
DEI
E22 Program Cartridge
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 522/605
1 1 10 9 8 7 b 5 4 3
AR
AS
AT
AU
AV
AW
AX
AY
A L
AM
2
MN 2 -J0 2
LL 2 - J B Z I
I XD 2
’Dl
JJ Z - J B Z I
1 1
Y Y 2-H02I
WW 2-H02 I‘Ob
uu z-n02 ixD5
SS 2 - J 0 2 I‘04
10 9 8 7 b 5 4 3 2
+ 5 v
+5v
1 d w ~ I I
DOUTlI EE 2-MI
I I cc 2 - * 1 1
L I nn ~ - J I
I CC 2-01 I
64KB Memory and Display Expansion (Sheet 1 of 4)
Memory Expansion B-25
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 523/605
1 1 10
I 4 A F 1 - 611o*
9
IOM 1-0.21 4 AC 3-03 1
14LS.4
I
64KB Memory and Disp lay Expansion (Sheet 2 of 4)
B-26 Memory Expansion
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 524/605
I I I I I I I I 3 I 21 10 9 8 7 b 5 4
I
I
1 1 I 10 I 9 1 ' 8 1 7 I b I 5 I 4 I 3 I 2
Memory Expansion B-27
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 526/605
DANGER
HAZA RDOUS VOLTAGES UP TO 450 VOLTS EXIST ON THE
PRINTED CIRCUIT B OARDSi11508 1
IiI , W I I 1 I I 1
m i L
Color Dlsplry
Color Display B-29
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 527/605
I I I 8 I 1 I b 1 5 I 4 I 3 I 21 1 0 9
I A A 1 - C l l
I D 8 1 - C l l
OIsUtC I NT CR D l l
Omb
DmS
W.
om1
UX 1-WLI
AB 1 - W l l -RC
4 C C J-C1l
4 0 0 1 4 1 1
4 c c 3-611
Q
I C C 1 - 0 1 1
Icc 1 4 8
4 m 1 4 1
4 J J I - J l l
02
00 1
D
-RES?
UI
Ul
Ul
1 1 I 1 0 I 9 I 8 I -I I b I 5 I 4 I 3 I 2
D i t k r t a D h dapter shrrt1 of 6)
B-30 Diskette Drive Adapter
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 528/605
1 1 10 9 8 7 b 5 4 3
-DRYCN
-0 I RECT ON
-STKC
-URITE D A T A
zz s-Ew2t
A n a - c w z i
A 9 4- De l l
AE 4 - W l l
AF 4 -D Wt t
-URlTC CNADLC
2
-SCLCCT )(CAD q
A I 4 I
I.2 cf
IJ24-4 T I 4-01 *
1woEx 4
1
1 1 I 10 I 9 I 8 I 7 I b I 5 I 4 I 3 I 2
Diskette Drive Adaptor (Shnt 2 of 6)
Diskette Drive Adaoter B-3
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 530/605
1 1 10I
R l b R I 2 I 1 9
9 8 1 b 5 4 3 2I I
I AD 8-0111
2-61 1
¶ - C I I
¶-Ill 1
I-01
¶-Fl
1 1 I 10 I 9 1 8 I 7 I b I 5 1 4 I 3 I 2
Diskette Drive Adapter B-33
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 531/605
1 1 1 0 9 8 1 b 5 4 3I I
I I
ab
AC 4-J.2 I
2
-READ D A T A 5
*I 1-F.2
1 1 I 1 0 9 I 8 I 1
a 1AJ 4-EO21
71AD 4
b 5 I 4 I 3 I 2
I
I r .1
AL 4-Cll
I I I t 1
r I I
I I Q
A l l 4 - C l l
Diskette Drive Adapter (Sheet 5 of 6)
B-34 Diskette Drive Adapter
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 532/605
1 1
0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 O D
0 0 0 0
1 0 9 8 1 b 5 4 3 2
1 1 I 1 0 9 8 7 I b 5 4 3
Diskette D rive Adapter B-35
2
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 533/605
6WO
51+12
w10102004O
010;
iimimdTA
AlTXAE,
BAUD CL
immlMODEM IN
TXRE
86814A13
813
A11
84
amS OUT
ms N
rniii
CR4IN270
4.7K
Internal Modem
536 Internal Modem
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 534/605
1 1 10
nmn7
I AA J-Et1
I BB 3-E1 I
I CC 3-D1 1J2 I:
9 8 7
DD
E€
FF
ccnn
JJ
KK
LL
nn
NN
PP
a4
RR
55
T l
3 - D 1
J - D I 1
3 4 1 1
J-D4 1
3 - D I 1
3 - K 1 1
J - r t t
3 - K 1 1
J-K 1 1
3 - K t 1
3-61
3-n1 I
3 - J 1 1
3-Gll
J-F 1 1
4 VV 3-Jt1
WW 3-G 1
xI0I-M
RESET
i x J - E l 1
-C A R D S L T D
i I* 4 - 111
l R * l
*WIELD CND
Parallel Printer Attachment (Shea 1 of 5)
Printer Attachment B-37
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 535/605
1 1 10 9 8 1 b 5 4 3 2I 1 I I I I 1 I
1 1 I 10 I 9 I 8 I -I I b I 5 4 I 3 2
Pardld Printer Attachm ent (Sheet 2 of 5)
E 3 8 Printer Attachm ent
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 536/605
1 1 1 0 9 8 1 b 5 4 3 2I 1
ILS155 ,
13
J
D 1
o b I A U 4 - J I I
IS - 5
D
I A T 4 - J f 111
1 14 1s
13I 4 V 4-JIl
? I 7 I
+-MS '*
10 I-C.B I
11
w ( - 8 m s II
IOI
11 1-80s)
-4 IM3 k I I
.SV
A I
AX
AV
A I
BA
BC
D8
sr
BC
BW
.J
B I
.L
*-MI 1
1 - M I 1
+MI I
4-M1 1
.-MI I
4-51
4 4 1 9
4-619
4 - t I 1
4-K 11
4 4 1
4-81 1
4 4 1 9
4 - C I l
1 1 I 1 0 9 8 I 1 b I 5 I 4 1 3 I 2
Plrrlld Printer A.ttrthnmrt (Shoat 3 of 5)
Printer Attachment B-39
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 537/605
1 1
AT 1-J.21
AU 3 - J 0 2 t
7
I
10 9 8 -I b 5 4 3 2
AiV S-J.21 '' . I I
1 1
+sv
A 0 2 - G 0 b
BF & E 0 2
22 2 - G 0 b
AF 2 - F 0 b
BH 3 - 0 0 2
A a 2 4 0 b
AS 2 - D e b
A B 2 - G 0 b
BG 3 - E 0 2
1 2
AR 2 - D 0 b
I 0 9 8 7 b 5 4 3
AH 2 - F 0 b
B J 3 - C 0 2
333 4
AH 2 - F 0 b
B J 3 - C 0 2
333 4
z mA P 2 - E 0 b I
BY 3 - C 0 2 I 14
7a
BL 3 - c 0 2 I F f i I
BM S - C 0 2 C fin rI BN 3-802 C
_] BR 3 - 802 1 I I
BS 3 - 8 0 2 L
BT 3 - 802 I
R n 7
an'
B-40 Printer Attachment
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 538/605
KI I I I I 3 2
1 1 0 9 8 7 b 5 4
-
I
0
. .0
* 0 0 0 .. 0
0
60
0
I
J
.0
0
0
0
.0 .
a
a0 .
0 :0 0
0
0
0 .
1 1 1 10 I 9 I 8 I 7 I b 5 I 4 1 3 I 2
h d k l Riwm Attr tbmant (Shut5 of 5)
Printer Attachment B 4
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 539/605
I 01
A
A3 PH302B
t-..IR TEST DATA
7
+5v
8
p P C I 373Hu 1
+12v
R5 2 0 0 n
+ 5 v
2 2 0 0 PI
3
1
4
-I4LS122
L-IR KBD DATA
680 pf
Infra-Red Receiver Board
B-42 Infra-Red Receiver Board
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 540/605
CY4
CY4
CNS
CY4
c15
I4
13
12
I 1
IO
9
I
1
15
21
6
1
I1
n
I9
I
4
I
5
n.
C I S
cw 20
/ e
2
I
IO
3I4S
I8
\I 1
C l S 1CW I1
ocnr 2’
0 CRO 21
OCRC E
o cnn P
w771I4
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 541/605
IEE c I
134 nm io34.11
I
41
,e5
I I I I I lBB 8155
V l S
nio
.1
6
9
IO
II
I2
IJ
I4
I?
,
cn4
I I
I R I S S E 1 C M
c n 4
:] M
5
1 1 1041
1EA
n cw37 Cdunnr
7
8
6
IO
3 C M
9
II /
0 FI
0 Fk
0 FC
I2
-PSEN b' I I I I I A 1 I
+P24 .
5ROG
RM5
S 3 3K
3
I
4 PI0 D2'^^ R I I 1
PI8
XI
xz
I1
10
I l l I
I I I I '
I 1 I
I I 1 1 1 1 1 I II I I I I
P25
TI
36
39R35121
I A
I
RM5 R15 I
5
1
RED BROWN BLACK Graphics Pr iqttar Control CircuitURPLE GRAY WHITE YELLOW BLUE ORANGE
J
f
3 1
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 543/605
APPENDIX C: CH AR AC TE RS,KEYSTROKES, AND COLOR
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 545/605
Color/Graphics
As Characters Text Att ribu tes
Characters, Keystrokes, and Color C-3
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 546/605
C-4 Characters, Keystrokes, and Color
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 547/605
~~ ~ ~~
Color/Graphics
As Characters Text Attributes
* * * *
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 549/605
IalueIColor/Graphics
As Characters I Text Attributes
1 A l t 215 ( No te 6 I Magenta I Light Grey
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 550/605
C-8 Characters, Keystrokes, and Color
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 551/605
Color/Graphics
FD 253 2 Alt 253 Note 6 White Light Magenta
FE 254 H Alt 254 Note 6 White Yellow
FF 255 B L A N K Alt 255 Note6 White White
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 554/605
Character Set (80-FF) Quick Reference
12t
8
-
-c
144 '16011761192120812241240
9-EO I 0
2 2 A,
16
64
-
-(j
5-
ir8 -
0
uc
D
RF f
C-12 Characters, Keystrokes, and Colors
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 555/605
Appendix D. UNIT SPECIFICATIONS
System Unit
Size:
Length 354 mm (13 .9 in.)Depth 290 mm (1 1.4 in.)Height 97 mm (3.8 in.)
Weight:
3.71 K g (81b 402)2.61 Kg (51b802)
Transformer:
Electrical:Input
Output to System
With Diskette DriveWithout Diskette Drive
1 1 0 Vac 60 HzPin 1 - 17 Vac, Pin 2 - GND, Pin 3 -17 Vac
Power Cords:Input Length 1.86 meters (6.1 4 feet)Type 18 AWG
Output Length 1.22 meters (4 .02 feet)Type 18 AWG
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 556/605
Environment:
Air TemperatureSystem O NSystem Of€
HumiditySystem On 8% to 80
System Off 8 YO o 80%
NoiseLevel 45dB
15.6 to 32.2 degrees C (60 to 90 degrees F)10 to 43 degrees C (50 to 110 degrees F)
Cordless Keyboard
Size:
Length 341.5 mm (13.45 in.)
Depth 168 mm (6.61 in.)
Height 26 mm (1.02in.)
Weight:
With BatteriesWithout Batteries
616 grams (22 ounces)
700 grams (25 ounces)
Optional Cable:
6 feet, flat
Diskette Drive
D-2 Unit Specifications
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 557/605
Size:
Height 41.6 mm (1.6 in.)
Depth 146 mm (5.8 in.)
Width 208 mm (8.3 in.)
Weight:
1.1 kilograms (2.2pounds)
Diskette Drive
Power:
Voltage +5 Vdc Input + 1 2 Vdc InputNominal +5Vdc +12 Vdc
Ripple
+5 Vdc Input + 1 2 Vdc Input
0 to 50 kHz 100 mV 100 mV
Tolerance
+5 Vdc Input +12 Vdc InputIncluding Ripple +/- 5 % +/- 5
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 558/605
Standby Current
+5 Vdc Input +12 Vdc Input
Nominal 600 m A 400 m A
Worst Case 700mA 500 mA
Operating Current
+5 Vdc Input +12 Vdc Input
Nominal 600 mA 900 mAWorst Case 700 mA 2400 m A
Mechanical and Electrical
Media
Media Life (Head Loaded)
Media Life (Insertions)
Tracks Density 48 tracks/inch
Number of Tracks 40
Motor Start Time 500 ms
Instantaneous Speed Variation
Rotational Speed 300 rpm +/- 1.5% (long term)Nominal Transfer Rate (MFM)
250,000 pulses/second
MTBF (25 YOOperating) 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
Industry-compatible 5 1 4 inch
diskette
3,000,000 revolutions/track
30,000
+/- 3.0%
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 559/605
Soft Error 1 per 1,000,000,000
bits maximum
(recoverable within
10 retries)
1,000,000,000,000
bits maximum
(nonrecoverable
within 10 retries)
Access Error 1per 3,000,000
seeks maximum
Hard Error 1per
Temperature (Exclusive of media)
Operating 5 0 to 122 degrees F(10 to 44 degrees
C )
F (-40 to 60 degrees
C )
Non-operating -40 to 140 degrees
Relative Humidity (Exclusive of media)
Operating 20 to 80%
Non-operating 5 to 95%
7,000 feet above sea level
(noncondensing)
(noncondensing)
Operating Altitude
Operating Vibration 5 to500Hz 11G
Color Display
Size:
Height 297 mm (11.7 in.)
Depth 407 mm (15.6 in.)Width 392 mm (15.4 in.)
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 560/605
Weight:
1 1.8 kilograms (26 pounds)
Heat Output:
240 BTU/hour
Power Cables:
Length 1.83 meters (6 feet)
Size 22 AWG
Graphics PrinterSize:
Height 110 mm (4.3 in.)
Depth 370 mm (14.5 in.)
Width 400 mm (15.7 in.)
Weight:
5.9 kilograms (1 2.9 pounds)
Heat Output:
341 BTU/hour
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 561/605
Power Cable:
Length 1.83 meters (6 feet)
Size 18 AWG
Signal Cable:
Length 1.83 meters (6 feet)
Size 22 AWG
Electrical:
Minimum 104Vac
Nominal 120Vac
Maximum 127Vac
Internal Modem
Power:
Parameter + 5 Vdc Voltage + 12 Vdc VoltageTolerance +/- 5% +/- 10%
Ripple 50 mV, P-P 50 mV, P-P
Maximum Current 300 mA 50 mA
CurrentNominal 150 mA 25 mA
Interface
RS232C
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 562/605
Compact Printer
Size:
Height 88.9 m m (3.5 in)
Depth 221 m m (8.7 in)Width 312.4 m m (12.3 in)
Weight:
2.99 kg 6.6 lb)
Heat Output:
54.6 Btu/hr
Power Cable:
Length 1.89 m m (6 ft)
Size 28 AWG
Signal Cable:
Length 1.89 m (6 ft)
Size 3 by 18 A W G
Electrical:
Voltage 110 Vac 60 Hz
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 563/605
Glossary
p Microsecond.
adapter. An auxiliary system or
unit used to extend the
operation of another system.
addressbus. One or more
conductors used to carry the
binary-coded address from the
microprocessor throughout the
rest of the system.
all pointsaddressable (APA). A
mode in which all points on a
including panty check), used
for information interchange
among data processing systems,
data communication systems
and associated equipment. The
ASCII set consists of control
characters and graphic
characters.
A/N. Alphanumeric.
d o g . (1) pertaining to data
in the form of continuously
variable physical quantities.displayable image can be
controlled by the user.
alphanumeric(A/N). Pertaining to a
character set that contains
letters, digits, and usually othercharacters, such as punctuation
marks. Synonymous with
alphameric. statement is false.
(2)Contrast with digital.
AND. A logic operator having
the property that if P s a
statement, Q is a statement, R
is a statement,..., then the ANDof P,Q, R,..s true if all
statements are true, false if any
APA. ll points addressable.
American Standard Code forInformation ASCII. American Standard
Interchange. (ASCII) The
standard code, using a coded
character set consisting of 7-bit
coded characters (8 bits
Code for Information
Interchange.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 564/605
assembler. A computer
program used to assemble.
Synonymous with assembly
program.
asynchronouscommunications. A
communication mode in which
each single byte of data is
synchronized, usually by the
addition of start/stop bits.
BASIC. Beginner’s all-purpose
symbolic instruction code.
basic input/output system(BIOS). Provides the device
level control of the major 1/0
devices in a computer system,
which provides an operational
interface to the system and
relieves the programmer from
concern over hardware device
characteristics.
baud. ( 1 ) A unit of signalingspeed equal to the number of
discrete conditions or signal
events per second. For
example, one baud equals
one-half dot cycle per second
in Morse code, one bit per
second in a train of binary
signals, and one 3-bit value persecond in a train of signals each
of which can assume one of
eight different states. (2) In
asynchronous transmission, the
unit of modulation rate
corresponding to one unit of
interval per second; that is , f
the duration of the unit interval
is 20 milliseconds, the
modulation rate is 50 baud.
BCC. Block-check character.
beginner’s all-purpose symbolicinstruction. code (BASIC) Aprogramming language with a
small repertoire of commands
and a simple syntax, primarily
designed for numerical
application.
binary. ( 1 ) Pertaining to a
selection, choice, or condition
that has two possible values or
states. (2) Pertaining to a fixedradix numeration system having
a radix of two.
binary digit. ( 1 ) In binarynotation, either of the
characters 0 or 1. (2)
Synonymous with bit. binary
notation: Any notation that
uses two different characters,
usually the binary digits 0 and
1.
BIOS. Basic input/output
system.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 565/605
bit. In binary notation, either
of the characters 0 or 1.
bits per second (bps). A unit of
measurement representing the
number of discrete binary digitswhich can be transmitted by a
device in one second.
block-check character
(BCC). In cyclic redundancy
checking, a character that is
transmitted by the sender aftereach message block and is
compared with a block-check
character computed by the
receiver to determine if the
transmission was successful.
Boolean operation. (1 ) Any
operation in which each of the
operands and the result take
one of two values. (2) An
operation that follows the rules
of Boolean algebra.
bootstrap. A technique or
device designed to bring itself
into a desired state by means of
its own action; that is, a
machine routine whose first
few instructions are sufficient
to bring the rest of itself intothe computer from an input
device.
buffer. (1) An area of storage
that is temporarily reserved for
use in performing an
input/output operation, into
which data is read or from
which data is written.Synonymous with 1/0 area.
(2) A portion of storage for
temporarily holding input or
output data.
bus. One or more conductors
used for transmitting signals orpower.
byte. (1 ) A binary character
operated upon as a unit and
usually shorter than a computer
word. (2) The representation of
a character.
CAS. Column address strobe.
cathode ray tube (CRT). A
vacuum tube display in which a
beam of electrons can becontrolled to form
alphanumeric characters or
symbols on a luminescent
screen, for example by use of a
dot matrix.
cathode ray tube display (CRTdisplay). (1) A device that
presents data in visual form by
means of controlled electron
bps. Bits per second.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 566/605
beams. 2) The data display
produced by the device as in
(1 ) .
computer program in a
symbolic form that can be
accepted by a data processor.
column address strobe(CAS). A
signal that latches the column
addresses in a memory chip.
CCIIT. Comite Consultatif
International Telegrafique et
Telephonique.
Comite ConsultatifInternational. Telegrafique et
Teleponique (CCI")
Consultative Committee onInternational Telegraphy and
central processing unit(CPU). A functional unit that
consists of one or moreprocessors and all or part of
internal storage. Telephone.
channel. A path along which
signals can be sent; for
example, data channel or 1/0channel. computation, including
characters per second (cps). A
standard unit of measurement
for printer output.
computer. A functional unit
that can perform substantial
numerous arithmeticoperations, or logic operations,
without intervention by a
human operator during the run.
code. (1) A set of unambiguous
rules specifying the manner in
which data may be representedin a discrete form.
Synonymous with coding
scheme. (2) A set of items,
such as abbreviations,
representing the members of
another set. (3) Loosely, one or
more computer programs, or
part of a computer program.(4) To represent data or a
configuration. (1) The
arrangement of a computer
system or network as definedby the nature, number, and the
chief characteristicsof its
functional units. More
specifically, the term
configuration may refer to a
hardware configuration or a
software configuration. (2) The
devices and programs thatmake up a system, subsystem,
or network.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 567/605
conjunction. (1) The Booleanoperation whose result has the
Boolean value 1 if, and only if,
each operand has the Boolean
value 1. (2) Synonymous with
AND operation.
contiguous. (1) Touching or
joining at the edge or
boundary. (2) Adjacent.
CPS. Characters per second.
CPU. Central processing unit.
CRC. Cyclic redundancy
check.
CRT display. Cathode ray tube
display.
CTS. Clear to send.
Associated with modem
control.
distance from the axis about
which the disk rotates. (2) The
tracks of a disk storage device
that can be accessed without
repositioning the access
mechanism.
daisy-chained cable. A type of
cable that has two or more
connectors attached in series.
data. (1) A representation offacts, concepts, or instructions
in a formalized manner suitable
for communication,
interpretation, or processing by
humans or automatic means.
2) Any representations, such
as characters or analog
quantities, to which meaning is,or might be assigned.
decibel (dB). (1) A unit that
expresses the ratio of two
power levels on a logarithmic
scale. (2) A unit for measuring
relative power. The number ofdecibels is ten times the
cyclic redundancy check(CRC). (1) A redundancy
check in which the check key is
generated by a cyclic algorithm.
(2) A system of error checking
performed at both the sending
and receiving station after a
block-check character has been
accumulated. of the ratio.
logarithm (base 10) of the ratio
of the measured power levels;
if the measured levels are
voltages (across the same or
equal resistance), the number
of decibels is 20 times the log
cylinder. (1) The set of all
tracks with the same nominal
decoupling capacitor. A
capacitor that provides a
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 568/605
low-impedance path to ground
to prevent common coupling
between states of a circuit.
Deutsche IndustrieNorm(DIN). (1 ) German Industrial
Norm. (2) The committee that
sets German dimension
standards.
digit. (1) A graphic character
that represents an integer, for
example, one of the characters
0 to 9. (2) A symbol that
represents one of the
non-negative integers smaller
than the radix. For example, in
decimal notation, a digit is one
of the characters from 0 to 9.
digital. (1) Pertaining to data in
the form of digits. (2) Contrast
with analog.
direct memory access
(DMA). A method of
transferring data between main
storage and 1/0 devices that
does not require processor
intervention.
disk. Loosely, a magnetic disk
unit.
diskette. A thin, flexible
magnetic disk and a semi-rigid
protective jacket, in which the
disk is permanently enclosed.
Synonymous with flexible disk.
DMA. Direct memory access.
DSR. Data set ready.
Associated with modemcontrol.
DTR. Data terminal ready.
Associated with modem
control.
DIN. Deutsche Industrie
Norm.
DIN Connector. One of the
connectors specified by the
DIN standardization
committee.
DIP. Dual in-line package.
dual in-line package (DIP). Awidely used container for an
integrated circuit. DIPSare
pins usually in two parallel
rows. These pins are spaced
1 10 inch apart and come in
different configurations ranging
from 14-pin to 40-pin
configurations.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 569/605
EBCDIC. Extended
binary-coded decimal
interchange code.
ECC. Error checking and
correction.
edge connector. A terminal
block with a number of
contacts attached to the edge
of a printed circuit board to
facilitate plugging into a
foundation circuit.
EM. Electronic Industries
Association.
EIA/CCHT. Electronic
IndustriesAssociation/Consultative
Committee on International
Telegraphy and Telephone.
end-of -text character
(Em).A transmission controlcharacter used to terminate
text.
end-of-transmission character
(EOT). A transmission control
character used to indicate the
conclusion of a transmission,
which may have included oneor more texts and any
assoceated message headings.
EOT. end-of-transmission
character.
EPROM. Erasable
programmable read-only
memory
erasable programmable
read-only. memory (EPROM)
A storage device whose
contents can be erased by
ultraviolet means and new
contents stored by electrical
means. EPROM information is
not destroyed when power is
removed.
error checking and correction
(ECC). The detection and
correction of all single-bit,double-bit, and some
multiple-bit errors.
ETX. End-of-text character.
extended binary-coded decimal
interchange code. (EBCDIC)
A set of 256 characters, each
represented by eight bits.
flexible disk. Synonym for
diskette.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 570/605
T i w a r e . Memory chips with
integrated programs already
incorporated on the chip.
gate. (1 ) A device or circuitthat has no output until it is
triggered into operation by one
or more enable signals, or until
an input signal exceeds a
predetermined threshold
amplitude. (2) A signal that
triggers the passage of other
signals through a circuit.
graphic. A symbol produced by
a process such as handwriting,
drawing, or printing.
Hz. Hertz.
interface. A device that alters
or converts actual electrical
signals between distinctdevices, programs, or systems.
k. An abbreviation for the
prefix kilo;that is, 1,000
decimal notation.
K. When referring to storage
capacity, 2 to the tenth power;
1,024 in decimal notation.
KB Kilobyte). 1,024 bytes.
hertz Hz). unit of frequency
equal to one cycle per second. k byte. 1,024 bytes.
hex. Abbreviation for
hexadecimal. to 1,000hertz.
kHz. A unit of frequency equal
hexadecimal (H ex). Pertaining
to a selection, choice, or
condition that has 16 possible
values or states. These values
or states usually contain 10
digits and 6 letters, A through
F/ Hexadecimal digits are
equivalent to a power of 16.
high-order position. The
leftmost position in a string ofcharacters.
kilo(k). One thousand.
latch. (1) A feedback loop insymmetrical digital circuits
used to maintain astate. (2) Asimple logic-circuit storage
element comprising two gates
as a unit.
LED. Light-emitting diode.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 571/605
light-emitting diode (LED).Asemi-conductor chip that gives
off visible or infrared light
when activated.
low-order position. Therightmost position in a string of
characters.
m. 1) M U , one thousand or
thousandth part. (2) Meter.
M (Mega). 1,000,000 in
decimal notation. When
referring to storage capacity, 2
to the twentieth power;
1,048,576 in decimal notation.
mega M). 10 to the sixth
power, 1,000,000 in decimal
notation. When referring to
storage capacity, 2 to the
twentieth power. 1,048,576 in
decimal notation.
megabyte (MB). 1,048,576
bytes.
megahertz (M Hz). A unit of
measure of frequency. One
megahertz equals 1,000,000
hertz.
MFM. Modified frequency
modulation.
MHz. Megahertz.
mA. Milliampere.
machine language. (1) Alanguage that is used directly
by a machine. (2) Another
term for computer instruction
code.
main storage. A storage device
in which the access time is
effectively independent of the
location of the data.
MB. Megabyte, 1,048,576
bytes.
microprocessor. An integrated
circuit that accepts coded
instructions for execution; the
instructions may be entered,
integrated, or stored internally.
microsecond. (ps) One-mil-
lionth of a second.
milli(m). One thousand or one
thousandth.
dliampere(mA). One
thousandth of *an mpere.
millisecond(ms). One
thousandth of a second.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 572/605
mnemonic. A symbol chosen to
assist the human memory; for
example, an abbreviation such
as “mpy” for “multiply.”
mode. (1) A method ofoperation; for example, the
binary mode, the interpretive
mode, the alphanumeric mode.
(2) The most frequent value in
the statistical sense.
modem(Modulator-Demodulator). A
device that converts serial (bit
by bit) digital signals from a
business machine (or data
terminal equipment) to analog
signals which are suitable for
transmission in a telephone
network. The inverse functionis also performed by the
modem on reception of analog
signals.
modified frequency modulation(MFM). The process of
varying the amplitude and
frequency of the “write”signal. MFM pertains to the
number of bytes of storage that
can be stored on the recording
media. The number of bytes is
twice the number contained in
the same unit area of recording
media at single density.
modulo check. ‘Acalculation
performed on values entered
into a system. This calculation
is designed to detect errors.
monitor. (1) A device thatobserves and verifies the
operation of a data processing
system and indicates any
specific departure from the
norm. (2) A television type
display, such as the IBM
Monochrome Display.
(3) Software or hardware that
observes, supervises, controls,
or verifies the operations of a
system.
ms. Millisecond; one
thousandth of a second.
multiplexer. A device capable
of distributing the events of an
interleaved sequence to the
respective activities.
NAND. A logic operator
having the property that if P isa statement, Q is a statement,
R is a statement, ... , hen the
NAND of P,Q,R,... s true if at
least one statement is false,
false if all statements are true.
nanosecond. (ns) One-billionth
of a second.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 573/605
nonconjunction. (1) The dyadic
Boolean operation the result of
which has the Boolean value 0
if, and only if, each operand
has the Boolean value 1.
non-return-to-zero inverted(NRZI). A transmission
encoding method in which the
data terminal equipment
changes the signal to the
opposite state to send a binary
0 and leaves it in the same state
to send a binary 1.
NOR. A logic operator having
the property that if P is a
statement, Q is a statement, R
is a statement, ..., hen the NORof P,Q,R,... s true if all
statements are false, false if at
least one statement is true.
NOT. A logical operator
having the property that if P is
a statement, then the NOT of Pis true if P is false, false if P is
true.
NRZI. Non-return-to-zero
inverted.
ns. Nanosecond; one-billionth
of a second.
operating system. Software that
controls the execution of
programs; an operating system
may provide services such as
resource allocation, scheduling,input/output control, and data
management.
OR. (1) A logic operator
having the property that if P is
a statement, Q is a statement,
R is a statement, ..., hen the
OR of P,Q,R,... s true if at least
one statement is true, false if all
statements are false.
output. Pertaining to a device,
process, or channel involved inan output process, or to the
data or states involved in an
output process.
output process. (1) The process
that consists of the delivery of
data from a data processingsystem, or from any part of it.
(2) The return of information
from a data processing system
to an end user, including the
translation of data from a
machine language to a language
that the end user can
under stand.
overcurrent. A current of
higher than specified strength.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 574/605
overvoltage. A voltage of
higher than specified value.
parallel. (1) Pertaining to theconcurrent or simultaneous
operation of two or more
devices, or to the concurrent
performance of two or more
activities. (2) Pertaining to the
concurrent or simultaneous
occurrence of two or more
related activities in multipledevices or channels.
(3) Pertaining to the
simultaneity of two or more
processes. (4) Pertaining to the
simultaneous processing of the
individual parts of a whole,
such as the bits of a character
and the characters of a word,
using separate facilities for the
various parts. (5) Contrast with
serial.
PEL. Picture element.
personal computer. A small
home or business computer
that has a processor and
keyboard and that can be
connected to a television or
some other monitor. Anoptional printer is usually
available.
picture element (PEL). (1) The
smallest displayable unit on a
display. (2) Synonymous with
pixel, PEL.
pinout. A diagram of
functioning pins on a pinboard.
pixel. Picture element.
polling. (1) Interrogation of
devices for purposes such as to
avoid contention, to determineoperational status, or to
determine readiness to send or
receive data. (2) The process
whereby stations are invited,
one at a time, to transmit.
port. An access point for data
entry or exit.
printed circuit board. A piece
of material, usually fiberglass,
that contains a layer of
conductive material, usually
metal. Miniature electronic
components on the fiberglasstransmit electronic signals
through the board by way of
the metal layers.
program. (1) A series of actions
designed to achieve a certain
result. (2) A series of
instructions telling the
computer how to handle a
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 575/605
problem or task. (3) To design,
write, and test computer
programs.
programable read-only memory(PROM). Non-erasable
programable memory. PROM
information is not destroyed
when power is removed.
programming language. (1 ) An
artificial language establishedfor expressing computer
programs. (2) A set of
characters and rules, with
meanings assigned prior to their
use, for writing computer
programs.
PROM. Programmable
read-only memory.
propagation delay. The time
necessary for a signal to travel
from one point on a circuit toanother.
radix. (1) In a radix numeration
system, the positive integer by
which the weight of the digit
place is multiplied to obtain the
weight of the digit place with
the next higher weight; for
example, in the decimal
numeration system, the radix of
each digit place is 1.0.
(2) Another term for base.
radix numeration system. Apositional representation
system in which the ratio of the
weight of any one digit place to
the weight of the digit place
with the next lower weight is a
positive integer. The
permissible values of the
character in any digit place
range from zero to one less
than the radix of the digit
place.
U S . Row address strobe.
RGBI. Red-green-blue-intensity.
read-only memory (ROM). A
storage device whose contents
cannot be modified, except by
a particular user, or whenoperating under particular
conditions; for example, a
storage device in which writing
is prevented by a lockout.
read/write memory. A storage
device whose contents can be
modified.
red-green-blueintensity (RGBI).The description of a direct-drive
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 576/605
color monitor which accepts
red, green, blue, and intensity
signal inputs.
register. (1) A storage device,having a specified storage
capacity such as a bit, a byte,
or a computer word, and
usually intended for a special
purpose. (2) On a calculator, a
storage device in which specific
data is stored.
RF modulator. The device used
to convert the composite video
signal to the antenna level input
of a home TV.
ROM. Read-only memory.
ROM/BIOS. The basic
input/output system resident in
ROM, which provides the
device level control of the
major 1/0 devices in the
computer system.
row address strobe (RAS). A
signal that latches the row
addresses in a memory chip.
RS-232C. The standards set
by the EIA for communications
between computers and
external equipment.
RTS. Request to send.
Associated with modem
control.
run. A single continuous
performance of a computer
program or routine.
scan line. The use of a cathode
beam to test the cathode ray
tube of a display used with a
personal computer.
schematic. The description,
usually in diagram form, of the
logical and physical structure of
an entire data base according to
a conceptual model.
sector. That part of a track or
band on a magnetic drum, a
magnetic disk, or a disk pack
that can be accessed by the
magnetic heads in the course of
a predetermined rotational
displacement of the particulardevice.
serdes. Serializer/deserializer.
serial. (1) Pertaining to the
sequential performance of two
or more activities in a single
device. In Enghsh, the
modifiers serial and parallel
usually refer to devices, as
opposed to sequential and
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 577/605
consecutive, which refer to
processes. (2) Pertaining to the
sequential or consecutive
occurrence of two or more
related activities in a single
device or channel.(3) Pertaining to the sequential
processing of the individual
parts of a whole, such as the
bits of a character or the
characters of a word, using the
same facilities for successive
parts. (4) Contrast withparallel.
sink. A device or circuit into
which current drains.
software. (1) Computer
programs, procedures, rules,
and possible associated
documentation concerned with
the operation of a data
processing system. (2) Contrast 1
with hardware.
source. The origin of a signal
or electrical energy.
source circuit. (1) Generator
circuit. 2) Control with sink.
SS. Start-stop transmission.
start bit. Synonym for start
signal.
start-of-text character
(STX). A transmission control
character that precedes a test
and may be used to terminate
the message heading.
star t signal. (1) A signal to areceiving mechanism to get
ready to receive data or
perform a function. (2)In a
start-stop system, a signal
preceding a character or block
that prepares the receivingdevice for the reception of the
code elements. Synonymous
with start bit.
start-stop (SS)
transmission.(1) A synchrmous
transmission such that a group
of signals representing a
character is preceded by a start
signal and followed by a stop
signal. (2) Asynchronous
transmission in which a group
of bits is preceded by a start bit
that prepares the receiving
mechanism for the receptionand registration of a character
and is followed by at least one
stop bit that enables the
receiving mechanism for the
reception and registration of a
character and is followed by at
least one stop bit that enablesthe receiving mechanism to
come to an idle condition
pending the reception of the
next character.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 578/605
stop bit. Synonym for stop
signal.
stop signal. (1) A signal to a
receiving mechanism to wait
for the next signal. (2)In astart-stop system, a signal
'following a character or block
that prepares the receiving
device for the reception of a
subsequent character or block.
Synonymous with stop bit.
strobe. (1) An instrument used
to determine the exact speed of
circular or cyclic movement.
(2) A flashing signal displaying
an exact event.
STX. Start-of-text character.
synchronous transmission. Data
transmission in which the
sending and receiving devices
are operating continuously at
the same frequency and are
maintained, by means of
correction, in a desired phase
relationship.
I
text. In ASCII and data
communication, a sequence of
characters treated as an entityif preceded and terminated by
one STX and one ETX
transmission control,
respectively.
track. The path or one of
the set of paths, parallel to thereference edge on a data
medium, associated with a
single reading or writing
component as the data medium
moves past the component.
(2) The portion of a moving
data medium such as a drum,
tape, or disk, that is accessible
to a given reading head
position.
transistor-transistor logic
('ITL). A circuit in which the
multiple-diode cluster of the
diode-transistor logic circuithas been replaced by a
multiple-emitter transistor.
TIZ. Transistor-transistor
logic.
TX Data. Transmit data.
Associated with modem
control. External connections
of the RS-232C asynchronous
communications adapter
interface.
video. Computer data or
displayed on a cathode ray tube
monitor or display.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 579/605
write precompensation. Thevarying of the timing of thehead current from the outer
tracks to the inner tracks of thediskette to keep a constantwrite signal.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 581/605
Bibliography
Intel Corporation. The 8086
Family User’s Manual This
manual introduces the 8086family of microcomputing
components and serves as a
reference in system design and
implementation.
Intel Corporation.
8086/8087/8088Macro
Assembly Reference Manual fo r8088/8085 Based Development’System This manual describes
the 8086/8087/8088 Macro
Assembly Language, and isintended for use by persons
who are familiar with assenbly
language.
Intel Corporation. ComponentData Catalog This book
describes Intel components and
their technecal specifications.
Motorola, Inc. The CompleteMicrocomputer Data Library.This book describes Motorola
components and their technical
specifications.
National Semiconductor
Corporation. I N S 8250
Asynchronous Communications
Element. This book documentsPhysical and operating
characteristics of the INS 8250.
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 583/605
A
+A0 3-7,3-72 +A0 thru A3 3-20 A0 thru A07, memory signal 3-7A0 thru A 1 9 , I / O signal 2-23 A0 thru A14, program cartridge signal 2-1 14
A1 3-72A2 3-72 A9 3-21,3-72 -ACKNLG, graphics printer signal 3-1 13 adapter
adapter R O M module addresses, valid 5-18 adapter cable
See diskette drive adapter
for serial devices 3-89 connector specifications 3-90 signal cable 3-89
connector specifications 3-9 1
connector specifications 3-93
for cassette
for IBM color display
addresses
F D C (data register) 3-17 FDC (status register) 3-17 parallel printer attachments 5-13 R O M modules, valid 5-18 RS232-C attachments 5-1 3
advanced BASIC, system ROM 4-13ALE, 1 /0 signal 2-24 ANSWER, modem command 3-44
ASCII, extended 5-21 - A T R C D I N 3 - 9 ATRLATCH 3-7
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 584/605
attachable joystickblock diagram 3-78 connector specifications 3-79 electrical centering control 3-77 free floating mode 3-77
spring return m ode3-77
x-axis 3-77 y-axis 3-77
AUDIO IN, 1 / 0 signal 2-28
available options 1-3 AUTO FEED XT 3-114
-BASE 1 ROM IN CARTRIDGE, program cartridge signal 2-1 15 -BASE 2 ROM IN CARTRIDGE, program cartridge signal 2-1 15 BASIC, cartridge 4-13 BASIC screen editor special functions 5 4 1 BASIC workspace variables 5-16
beeperBAUDCLK 3-73
block diagram 2-85input sources 2-85
BEL, graphics printer control code 3-1 17 BIOS
example, interrupt usage 5-5interrupt hex 10 4-17 interrupt hex 14 4-18
interrupt hex 16 4-15 interrupt hex 1D 4-1 7 memory map 5-17power-on initialization stack-area mem ory location 5-1 3 vectors list, interrup t 5-7 vectors with special meanings
interrupt hex 1B - keyboard b reak address 5-8interrupt hex 1C - timer tick 5-89
interrupt hex I D - video parameters 5-9 interrupt hex 1E - diskette parameters 5-9 interrupt hex 1F - graphics character pointers (2nd 128) 5-9 interrupt hex 44 - graphics character po inters ( I st 128) 5-9
Index-2
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 585/605
interrupt hex 48 - cordless keyboard translation 5-10interrupt hex 49 - non-keyboard scan-code translation-table
address 5-10BIOS cassette logic
cassette read 549
cassette write 5-48 tape block components 5-50
tape block format 5-50 timing chart 549
data record architecture 5-50
error detection 5-51 software algorithms - interrupt hex 15 547
cassette status in A H 5 4 8 request types in register A H 547
block diagramsattachable joystick 3-78
beeper 2-85
cassette motor control 241
compact printer 3-I34 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 246 write hardware 240
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, raphics printer signal 3-1 13
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 586/605
cable, adapter
cable, keyboard
cable, power
cable, signal
See adapter cable
See keyboard cord
See power cable
See signal cable-CABLE CONNECT 2-101,3-87 CAN, compact printer control code 3-141 CAN, graphics printer control code 3-1 18
-CARD SLCTD, 1 / 0 signal 2-28 cartridge BASIC 4-13 cartridge, program
CAR TRIDG E RESET TAB, program cartridge signal 2-1 16
cassette BASIC, system ROM 4-12 cassette interface
-CARD INSTALL 3-73
See program cartridge
+CAS 3-8
block diagram, cassette motor controlblock diagram, read hardware 2-40 block diagram, write hardware 2 4 0 connector specifications 2 4 motor control 241 output to audio subsystem 2-39
cassette logic, BIOSSee BIOS cassette logc
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, 1 / 0 signal 2-23 clock crystal frequency, system 2-6
color burst signal frequency 2-6 color displayconnector specifications 3-83 electrical requirements 3-81
horizontal drive frequency 3-82 operating characteristics 3-82
241
4-Index
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 587/605
screen characteristics 3-82
video bandwidth 3-82
all points addressable graphics (APA) mode
color/ graphics
high-resolution 2-color 2-58
high-resolution 4-color 2-59
low-resolution 16-color 2-56medium-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
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 244
composite connector specifications 2-83
CRT page register 2-47 CRT/ 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
memorymap 2-48
mode selection summary 2-81
page register 2-47
programming considerations
register table 2-76
alphanumeric(A/N) mode
sequence for changing modes 2-81
6845 CRT controller 2-75
R F connector specifications 2-83
ROM character generator 2 4 , 2 4 9
sixteen-color mode palette 2-52
storage organization
accessing the RAM 2-47
RAM address 247
summary of available colors 2-53 two-color mode palette 2-50
video bandwidth 2-49
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 588/605
video gate arrayaddress register 2-74 border color register bit functions 2-66 mode control 1 register bit functions 2-64 mode control 2 register bit functions 2-66
attribute byte definition 2-67
mode selection sum mary 2-81palette mask register bit functions 2-65 palette registers 2-7 1
register addresses 2-63 reset register bit functions 2-69 sequence for chang ing modes 2-81 status register bit functions 2-73 vertical retrace interrup t 2-82
format 2-71
video I /0 devices and addresses6845 CRT 2-45,2-47,2-75
register table 2-76 comm and 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-1 33 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
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 Comp uters hardware 4-10 non-D M A operation considerations 4-19screen buffer differences 4- 12 software determination of the com puter 4-19timing dependencies 4-5 unequal configurations 4-7 user available read / write memory 4-12 video hard ware address difference 4- 16
compatibility to Personal Com puters
6-Index
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 589/605
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-1 15
infra-red receiver (system board) 2-100
1 / 0 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-1 16 thru 3-122
control latch, parallel printer attachment 3-101 controller, floppy disk (FDC) 3-16
cordless keyboard
BASIC screen editor special functions 5-41
battery power 2-102
buffer 5-36
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 590/605
-CABLE CONNECT signal 2-101 charac ter codes 5-27 commonly used functions 5-38
.data format 2-104 da ta path 2-102 disabling the infra-red circuits 2-101, 2-103
DOS special functions 5 4 2 extended codes 5-30 function map, 83Lkey keyboard to cordless keyboardinterface 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-33shift states description 5-3 1
5-25
alt key 5-32 caps lock 5-33 ctrl key 5-32 shift key 5-32
break 5-34
enable/ disable keyboard click 5-36 function lock 5-35 functions 1 thru 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 adjustm ent 5-35 -
scroll lock 5-35 system reset 5-34 typematic suppression 5-36
special handling description
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 4 5 C P U D L Y 3-8 CPULATCH 3-9CR, compact printer con trol code 3-141
%Index
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 591/605
CR, graphics printer con trol code 3-1 17 -CS2 thru -CS7, program cartridge signal 2-1 15 -CTS, modem 3-71
D
DO th ru D7 3-7, 3-73 DO thru D7, program cartridge signal 2-1 14 -DACK 0, I /0 signal 2-27
DATA 1 thru DAT A 8, graphics printer signal 3-1 13
da ta latch, parallel printer attachmentDC 2, compact printer con trol code 3-141 DC2, graphics printer con trol code 3-1 18 DC 4, com pact printer con trol code 3-141 DC4, graphics printer con trol cod e 3-1 18 DIAL, modem command 3 4 6 differences, PC jr to Personal Co mputer
addressing of internal modem 4-18
addressing of serial po rt 4-18black an d white monochrom e display 4- 18 color graphics capability differences 4-1 5 color modes available only on PC jr 4-16 compatibility of hardware 4-10 com patibility of configurations 4-7no n-D M A operation considerations 4-19 screen buffer 4- 12
software determ ination of the com puter 4- 19 timing dependencies 4-5user available read/ write mem ory 4-12 video hardw are address difference 4- 17
DACKO 3-21
3-99
-DIRECTION 3-23 -DISABL E CA S0 3-8 -DISABL E ED A TA 3-7diskette 3-3 1
-DISKETTE C A R D INSTALLED 3-20 -DISKET TE C S 3-21 diskette drive differences, PCjr to Personal Co mp uter 4- 13 diskette drive
connector specifications 3-29electrical requ irements 3-28 load lever 3-27
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 592/605
media cooling fan 3-28 sensors 3-28
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 1 / 0channel interface signals 3-19 location 2-10
signal cable 3-13 watchdog timer (WDT) 3-16
diskette drive adapter
0 thru D7,I/O signal 2-24
DOS special functions 5-42 -DRIVE SELECT 3-22 DRQ 0 3-21 DRQ 0, 1/0signal 2-27 -DSR modem 3-72 DTMF (dial-tone modulated-frequency) 3-35
-DTR, modem 3-71
electrical centering control, joystick 3-77electrical requirements
color display 3-82compact printer 3-1 37 diskette drive 3-28 diskette drive adapter 3-24graphics 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-1 18 thru 3-127
extended ASCII 5-21 extended codes, cordless keyboard 5-31
10-Index
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 593/605
F
FF, compact printer control code 3-146 FF, graphics printer control code 3-117FDC floppy disk controller)
See floppy -disk controllerfloppy disk 3-31floppy disk controller FDC) 3-16
commands 3- 18 functions not supported 3- 18 I/0 addresses 3- 17 power-up parameters settings 3-1 7
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 interfaceblock diagram 2-120 connector specifications 2-123 digital input format 2-121 joystick input data 2-1 19 paddle input data 2-122 pushbutton inputs 2-122 resistance range 2-I2 1
resistive input format 2-121 resistive to digital input equation 2-1 19
GATE 3-9 graphics
graphics printerSee color/ graphics
character set 1 3-128 description 3- I09
character set 2 3-130 description 3- 109
control codes 3-1 16 thru 3-127 DIP switch settings 3-1 11 electrical requirements 3-109 environmental conditions 3-109
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 594/605
interface timing d iagram 3-1 13 signal cable 3-107 signal pin assignments 3-1 15
signals, interface 3-1 13 thru 3-1 14 specifications 3-107
H
HA NG U P, modem command 3 4 8 hardware differences, PC jr to P ersonal Co mp uter 4-10
H L D A , 1 / 0 ignal 2-27
horizontal drive frequency, color display 3-82 -HRQ, I /0 signal 2-26
H T, com pact printer control code 3-146
HT, graphics printer control code 3-117
-HEAD SELECT 1 3-23
I
IBM Connector for TelevisionSee connec tor fo r television
IBM P C Compact PrinterSee compact printer
IBM PC jr Adapter C able for CassetteSee ada pter cable for cassette
IBM PC jr Adapter Cable for IBM Color Display
See adapter cable for IBM color displayIBM PC jr Adap ter Cable for Serial Devices
See adapte r cable for serial devicesIBM PC jr Attachable Joystick
See attachable joystickIBM PCjr Diskette Drive
See diskette driveIBM PC jr Diskette Drive Adapter
See diskette drive adapte rIBM PC jr Internal Modem
See internal modemIBM PCjr Parallel Printer Attachment
See parallel printer attachm ent
124ndex
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 595/605
IBM PCjr 64KB Memory and Display ExpansionSee memory and display expansion
IBM Personal Com puter Graphics PrinterSee graphics printer
-INDEX 3-24 infra-red link
block diagram, receiver 2-98 connector specifications 2-100 functional description 2-97 programming considerations
parity errors 2-99 phase errors 2-99
receiver 2-97 trans mitt er 2- I03
test frequency 2-98 INITIALIZE, modem command 3-48 IO/-M, 1 / 0 signal 2-26 1/0channel
expansion connector specifications 2-22 1 / 0 read / write cycle times 2-21 map 2-29 memory read/write cycle times 2-21
port A 0 input description 2-36 port A0 output description 2-35 signals 2-23 thru 2-28
diskette drive adap ter 3-19 memory and display expansion 3-7 modem 3-70,3-73
See 6845 CRT controller
See 80C48See 8088
See INS8250ASee MCM6665ALl5See MK38000See TMM23256PSee TMS4164-15See 8253-5 programmable timer/ counter
See8255A
See 8259ASee 8284A clock chipSee SN76496N
integrated circuits
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 596/605
internal modemaddress, memory location of 5-13 asynchronous com mu nications element 3-68 block diagram 3-36 command
arguments 3-41
com mand character 3-40 delimiter 3-4 1 format 3-40format guidelines 3-40
com mands 3-44 thru 3-58 connector specifications 3-75 dialing 3-60
status 3-60 default state 3-63 editing/ changing com mands 3-59 location 2-10loss of carrier 3-60 modes of operation 3-68 opposite com mands 3-60program ming examples 3-63 signals 3-70 sm art 103 modem 3-37
telephone com pany interface 3-74 transm itter/ receiver da ta format 3-70 8250A 3-68
description of registers 3-69-1OR 3-73 INS8250A 3-68 INS8250A -OUT 1, modem 3-71 IN T, graphics printer signal 3-1 14
interrupt controller, programmable
interrupt setup example 2- 16 interrupt usage exam ple 5-5
inte rrupt vector list 5-7 interrupts, hard ware
See 8259A
IRQ3 2-129+IRQ4 3-70 +IRQ6 3-20
+IRQ7 3-99 priority 2- 15 used by system board 2-6used by 1 / 0 channel 2-6
14-Index
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 597/605
interrupts reserved for BIOS, DOS, and BASIC 5-14 -IOR, 1 / 0 signal 2-25 -1ow 3-73 -IOW, 1 / 0signal 2-25 IRQl, 1 /0signal 2-25 IRQ2,I/O signal 2-25
IRQ7,1/0 signal 2-25
J
joystick, attachableSee attachable joystick
K
keyboard
keyboard click, enable/ disable 5-36 keyboard cord
See cordless keyboard
-CABLE CONNECT 2-101,3-81 connector specifications 3-88
See 80C48
keyboard microprocessor
L
-LCG 3-9 LF, compact printer control code 3-146 LF, graphics printer control code 3-1 17 light pen 2-74 line spacing, graphics printer 3-108 load lever, diskette drive 3-27 location
DIP switches, graphics printerdiskette drive adapter 2-10 internal modem 2-10
memory and display expansion 2-10, 3-5
LONG RESPONSE, modem command 3-49
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 598/605
mapsSee BIOS, memory mapSee cordless keyboard, function m apSee memory mapsSee scan-code mapSee system memory map
matrix scan-codes, cordless keyboard 5-23
MDO thru M D 7 3-7media cooling fan 3-28 M E M A0 thru A7 3-7 memory and display expansion
block diagram 3-6 configuration
connector specifications 3-10 EVEN memory space 3-5 location 2-10 modules used, type 3-5 O D D memory space 3-5
signals 3-7 memory maps
MCM6665AL15 2-17, 3-5
requirements 3-5
BIOS 5-17 BIOS, BA SIC, and D O S reserved interrupts 5-14 graphics st orage 2-6 1 mem ory address map 2-20 reserved memory locations 5- 15 system, memory allocated for 2-20
video color/ graphics subsystem 2-46
See memory and display expansionSee RAM
memory, 64K R A M
mem ory refresh 2-17 mem ory requirements 4- 12 mem ory, user available 4-12 - M E M R , 1 / 0 signal 2-25 - M E M W , 1 / 0 signal 2-26
microprocessor, keyboard
microprocessor, system
minimum mode, 8088 2-6
See 80C48
See 8088
16-Index
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 599/605
MK38000 2-19 -MODEM CS/DISKETTE CS 3-72 MODEM, modem command 3-50 modem
See internal modem
+MODEM INTR 3-73
modified frequency modulation (M FM) 3- 13 modules
motor control, cassette 2-39 See integrated circuits
-MOTOR ENABLE 3-22
NNUL, compact printer control code 3-147
NEW, modem command 3-50 NMI (Non-Maskable Interrupt) 2-7 Noise Generator 2-93
Non-Keyboard Scan-code Architecture 5 4 2
NEC fPDP765 3-13
scan-code map 5 4 5 translate table format 5-44
translate table default values 5-44
ORIGINATE, modem command 3-50 -OUT 2, modem 3-71 options, available 1-3
P
PA0 thm PA7 2-31pause, cordless keyboard 5-34 parallel printer attachment
address, memory location of 5-13
block diagram 3-97
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 600/605
connector specifications 3-104 control latch
reading from 3-101 writing to 3-101
format 3-100
reading from 3-99 writing to 3-99 printer control 3-101
+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-34PE, graphics printer signal 3-1 14 phantom-key detection 2- 103 phantom-key scan-code (hex 59, cordless keyboard 5-36PICKUP, modem command 3-51 port A0 input description 2-36port A0 output description 2-35 power-on initialization stack-area memory location 5-13 power cable
power supply
data latch
color diaplay 3-81
connector specifications 2-1 38 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-1 16 print screen, cordless keyboard 5-34 print sizes, graphics printer 3-108 print speed, graphics printer 3-107 printer
See compact printer
See graphics printerprinter status 3-101
18-Index
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 601/605
program a rtr id geconnector specification 2-1 17 descrip tion 2- 107 mom entary reset land 2-1 16 RO M chip select table 2-114 R O M locations, cartridge 2-1 18
ROM mapping 2-107 signals 2-1 14 slot descrip tion 2-1 07 storage conventions
initial program loadable 2- 108 DO S conventions 2-1 10 cartridge BA SIC 2-1 11
type ROM modules used 2-107
programmable interrupt controllerSee 8259Aprogrammable timer/ counter, 8253-5 2-6
Q
QU ERY, modem command 3-52
RAM, 64K
address space mapped to 2-17 EVEN memory 2-17mem ory refresh 2-17O D D memory 2-17 parity 2-17 read/ write cycle times 2-21 speed 2-17 type modules used 2-17
6845 C R T controller 2- 17 +RAS 3-7-REA D DA TA 3-24 READY, 1 / 0 ignal 2-24 reserved interrupts, BIOS, DOS , nd BASIC 5-14 reserved memory locations 5-15
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 602/605
RESET, 1 / 0 ignal 2-23
-RE SE T, modem 3-72 R ETR Y , modem com ma nd 3-53 -RI, modem 3-71 -RL SD , modem 3-72
R O M subsystem
-RESET 3-20
address space m appe d'to 2-19 memory map . 2-20read /write cycle times 2-21 type modules used 2-19
R O M module code accessed by system 5-18 R O M module addresses , valid 5-19 -RTS , modem 3-71 run diagnostics, cordless keyboard 5-36
S
scan-code map 5-45
scan-codescordless keyboard matrix 5-23 default non-keyboard 5 4 3
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-1 34 control signals 2- 129
diske tte operation s conflict 2-125 interface 2- I29 interrupt IR Q 3 2-129 modes of operation 2-128
1 / 0 decodes 2-128 ou tput signals 2- 131 ring indica te 2-130 use of the divisor-latch access-bit
voltage interchange levels 2- 130 8250A
2-128
accessible registersfeatures 2- 125 initialization program , sam ple 2- 134
2- 13 1
20-Index
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 603/605
programmable baud rate generator 2-1 32. baud rate at 1.7895MHz 2-132 maximum operating frequency 2- I32 output frequency equation 2-1 32
SI, compact printer control code 3-147 SI, graphics printer control code 3-1 18
signal cableadapter 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-1 14 smart 103 modern
SO, compact printer control code 3-147 SO, graphics printer control code 3-1 12 sound subsystem
See internal modem
block diagram 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
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
frequency generation 2-91
connector specifications 2-87 mpx (analog multiplexer) 2-87,2-94
data transfer 2-95output 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-funct ons, cordless keyboard specific 4-14 special functions, cordless keyboard
BASIC screen editor 5-41special functions, DOS 542
8/12/2019 jrtech
http://slidepdf.com/reader/full/jrtech 604/605
SP EE D , modem command 3-54
-STRO BE , graphics printer signal 3-1 13 system-accessible RO M-modules 5-18 system block diagram 1-6 system board
-STEP 3-22
block diagram 2-9clock crystal frequency 2-6connectors specifications an d locations 2-10interrupts used by system board 2-6 major com ponents list 2-8
size 2-5 subsystems list 2-6 8253-5 programm able timer/ coun ter 2-6
RAM,64K 2-17
system memory m ap 5-17 system microprocessor
system reset 5-34 See 8088
T
timers
timing dependencies, compatibility 4-5timing diagrams
timing, key board transmission 2- 105
timing using I/0 devices 4-5
timing using program execution speed 4-5
watchdog timer (W DT) 3-16
parallel printer interface 3-1 13
TMM23256P 2-19 TMS4164-15 2-17, 3-5-TRACK0 3-24 track 00 sensor 3-28 translate table form at, non-keyboard scan-code 5 4 3 transmitter, infra-red 2-103 TR AN SPA RE NT , modem command 3-55 typematic suppression 5-36
22-Index