IBM 5150 Technical Reference 6322507 APR84
IBM 5150 (IBM PC)
IBM
IBM 5150 Technical Reference 6322507 APR84
IBM 5150 Technical Reference 6322507 APR84 -------------_---------.-------
Personal Computer Hardware Reference
Library
Technical
Reference
Revised Edition (April 1984)
The foUowing paragraph does not apply to the United Kingdom or any country where such provisions are inconsistent with local law: International Business Machines Corporation provides this manual "as is," without warranty of any kind, either expressed or implied, including, but not limited to the particular purpose. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this manual at any time.
This product could include technical inaccuracies or typographical errors. Changes are made periodically to the information herein; these changes will be incorporated in new editions of the publication.
It is possible that this material may contain reference to, or information about, IBM products (machines or programs), programming, or services that are not announced in your country. Such references or information must not be construed to mean that IBM intends to announce such IBM products, programming, or services in your country.
Products are not stocked at the address below. Requests for copies of this product and for technical information about the system should be made to your authorized IBM Personal Computer dealer.
The foUowing paragraph applies only to the United States and Puerto Rico: A Reader's Comment Form is provided at the back of this publication. If the form has been removed, address comments to: IBM Corp., Personal Computer, P.O. Box 1328-C, Boca Raton, Florida 33432. IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligations whatever.
© Copyright International Business Machines Corporation 1981, 1982, 1983, 1984
Federal Communications Commission Radio Frequency Interference Statement
Warning: The equipment described herein has been certified to comply with the limits for a Class B computing device, pursuant to Subpart J of Part 15 of the FCC rules. Only peripherals (computer input/output devices, terminals printers, etc.) certified to comply with the Class B limits may be attachedto the computer. Operation with non-certified peripherals is likely to result in interference to radio and TV reception. If peripherals not offered by IBM are used with the equipment, it is suggested to use shielded grounded cables with in-line filters if necessary. CAUTION The product described herein is equipped with a grounded plug for the user's safety. It is to be used in conjunction with a properly grounded receptacle to avoid electrical shock.
iii
iv
Preface
r""'\. This publication describes the various units of the IBM Personal Computer; and the interaction of each.
The information in this publication is for reference, and is intended for hardware and program designers, programmers, engineers, and anyone else with a knowledge of electronics and/or programming who needs to understand the design and operation of the IBM Personal Computer.
This publication consists of two parts: a system manual and an options and adapters manual.
The system manual is divided into the followirig sections:
Section 1, "System Board," discusses the component layout, circuitry, and function of the system board.
Section 2, "Coprocessor," describes the Intel 8087 coprocessor and provides programming and hardware interface information.
Section 3, "Power Supply," provides electrical input/output specifications as well as theory of operation for the IBM Personal Computer power supply.
Section 4, "Keyboard," discusses the hardware make up, function, and layout of the IBM Personal Computer keyboard.
Section 5, "System BIOS," describes the basic input/output system and its use. This section also contains the software interrupt listing, a BIOS memory map, descriptions of vectors with special meanings, and a set of low memory maps. In addition, keyboard encoding and usage is discussed.
Section 6, "Instruction Set," provides a quick reference for the 8088 assembly instruction set.
v
Section 7, "Characters, Keystrokes, and Colors," supplies the
decimal and hexadecimal values for characters and text
attributes.
Section 8, "Communications," describes communications
hardware and discusses communications interface standards
and the sequence of events to establish communications.
A glossary, bibliography, and index are also provided.
The options and adapters manual provides information, logic diagrams, and specifications pertaining to the options and adapters available for the IBM Personal Computer family of products. The manual is modular in format, with each module providing information about a specific option or adapter. Modules having a large amount of text contain individual indexes. The modules are grouped by type of device into the following categories:
· Expansion Unit
· Displays
· Printers
· Storage Devices
· Memory Expansion
· Adapters
· Miscellaneous
· Cables and Connectors
Full page length hard tabs with the above category descriptions, separate the groups of modules.
The term" Technical Reference manual" in the option and adapter r"'-. manual, refers to the IBM Personal Computer Technical Reference system manual.
vi
The term "Guide to Operations manual" in the option and adapter manual, refers to the IBM Personal Computer Guide to Operations manual.
vii
Prerequisite Publications · IBM Personal Computer Guide to Operations Suggested Reading · BASIC for the IBM Personal Computer · Disk Operating System (DOS), Version 1.1 · Disk Operating System (DOS), Version 2.1 · IBM Personal Computer Hardware Maintenance and Service · MACRO Assembler for the IBM Personal Computer
viii
Contents
SECTION 1. SYSTEM BOARD ..·.····...........·· 1-1
Description .................................. 1-3
Microprocessor ............................... 1-3
Data Flow Diagrams ........................... 1-5
System Memory Map .......................... 1-8
System Timers .............................. 1-11
System Interrupts ............................ 1-11
ROM ...................................... 1-13
RAM ...................................... 1-13
DMA ..................................... 1-13
I/O Channel ................................ 1-14
System Board Diagram ........................ 1-16
I/O Channel Diagram ......................... 1-18
I/O Channel Description ...................... 1-20
I/O Address Map ............................ 1-24
Other Circuits ............................... 1-25
Speaker Circuit .......................... 1-25
Cassette Interface ........................ 1-27
Cassette Circuit Block Diagrams ............ 1-28
8255A I/O Bit Map ...................... 1-31
System-Board Switch Settings .............. 1-33
Specifications ............................... 1-34
Card Specifications ....................... 1-34
Logic Diagrams .............................. 1-36
SECTION 2. COPROCESSOR ..................... 2-1
Description .................................. 2-3
Programming Interface ......................... 2-3
Hardware Interface ............................ 2-4
SECTION 3. POWER SUPPLY ..................... 3-1
Description .................................. 3-3
~
Input Requirements ........................... 3-4
Outputs ..................................... 3-4
Vdc Output .............................. 3-4
Vac Output .............................. 3-5
Overvoltage/Overcurrent Protection .............. 3-5
ix
Primary (Input) ........................... 3-5
Secondary (Output) ....................... 3-5
Power Good Signal ............................ 3-6
Power Supply Connectors and Pin Assignments ...... 3-6
SECTION 4. KEYBOARD ......................... 4-1
Description .................................. 4-3
Block Diagram ............................... 4-4
Keyboard Diagrams ........................... 4-5
Connector Specifications ...................... 4-12
Keyboard Logic Diagram ...................... 4-13
SECTION 5. SYSTEM BIOS ........·.·.·.......·.. 5-1
System BIOS Usage ........................... 5-3
Keyboard Encoding and Usage .................. 5-14
BIOS Cassette Logic .......................... 5-25
System BIOS Listing .......................... 5-29
Quick Reference ......................... 5-29
SECTION 6. INSTRUCTION SET ................... 6-1
8088 Register Model .......................... 6-3
Operand Summary ............................ 6-4
Second Instruction Byte Summary ................ 6-4
Memory Segmentation Model .................... 6-5
Use of Segment Override ....................... 6-5
Data Transfer ................................ 6-6
Arithmetic ................... . . . . . . . . . . . . . . .. 6-8
Logic ...................................... 6-10
String Manipulation .......................... 6-11
Control Transfer ............................. 6-12
8088 Conditional Transfer Operations ............ 6-15
Processor Control ............................ 6-16
8087 Extensions to the 8088 Instruction Set ....... 6-17
Data Transfer ............................... 6-17
Comparison ................................ 6-19
Arithmetic .................................. 6-19
Transcendental .............................. 6-21
Constants .................................. 6-21
Processor Control ............................ 6-22
8088 Instruction Set Matrix .................... 6-25
Instruction Set Index ................ . . . . . . . . .. 6-27
x
SECTION 7. CHARACTERS, KEYSTROKES, AND
COLORS ...................................... 7-1
SECTION 8. COMMUNICATIONS ................. 8-1
Communications .............................. 8-3
~
Establishing a Communications Link .............. 8-5
Establishing Link on Nonswitched Point-to-Point Line 8-6
Establishing Link on Nonswitched Multipoint Line ... 8-8
Establishing Link on Switched Point-to-Point Line .. 8-10
Glossary ·.·..·.·.....···.·..·..·....·..·.·· Glossary-1
Bibliography .............................. Bibliography-1
Index ........................................ Index-l
xi
xii
INDEX TAB LISTING
Section 1. System Board ............................... .
Section 2. Coprocessor ................................ .
Section 3. Power Supply ............................... .
Section 4. Keyboard .................................. .
Section 5. System BIOS ............................... .
Section 6. Instruction Set
xiii
xiv
Section 7. Characters, Keystrokes, and Colors .............. .
Section 8. Communications Glossary ........................................... .
Bibliography ........................................ .
Index .............................................. .
xv
xvi
System Block Diagram
The following is a system block diagram of the IBM Personal Computer.
System Board
Oscillitor
8088
Cassette Adapter
8 Interrupt Levels
4 Channels Direct Memory Ac....
Memory
Math Coprocessor (Optional)
Spe.ker Adapter
keyboard Adlpttr
Rod-Only Memory
5 Slot I/O Channel
Extender end
Expansion Unit
ExPinsion Board Oscillator
Receivar Card
· Slot Expanded I/O Channel
Note: A "System to Adapter Compatibility Chart," to identify the adapters supported by each system, and an "Option to Adapter Compatibility Chart," to identify the options supported by each adapter, can be found in the front matter of the Technical Reference options and adapters manual, Volume 1.
xvii
xviii
SECTION 1. SYSTEM BOARD
Contents
Description
1-3
Microprocessor ....................··...........·· 1-3
Data Flow Diagrams ····........·.....·............ 1-5
System Memory Map .......·...........·.......... 1-8
System Timers ........................·.......... 1-11
System Interrupts ·.·............··..··.......··.. 1-11
ROM ..............................·.......... 1-13
RAM ..···.··..........·.····...·....··.··.·... 1-13
DMA .......................................... 1-13
110 Channel ...·.··.............··.··..........· 1-14
System Board Diagram ......·.·...........·....... 1-16
1/0 Channel Diagram ·.·.........·····.........·.· 1-18
I/O Channel Description ..........··...·.........·· 1-20
110 Address Map ................................ 1-24
Other Circuits ................................... 1-25
Speaker Circuit ............................... 1-25
Cassette Interface ............................. 1-27
Cassette Circuit Block Diagrams .................. 1-28
8255A I/O Bit Map ........................... 1-31
System-Board Switch Settings .................... 1-33
System Board 1-1
Specifications ..............·....··.............. 1-34
Card Specifications ............................ 1-34
Logic Diagrams ..·..........·..............··.... 1-36
1-2 System Board
Description
The system board fits horizontally in the base of the system unit and is approximately 215.5 mm (8-1/2 in.) x 304.8 mm (12 in.). It is a multilayer, single-land-per-channel design with ground and internal planes provided. Dc power and a signal from the power supply enter the board through two six-pin connectors. Other connectors on the board are for attaching the keyboard, audio cassette and speaker. Five 62-pin card edge-sockets are also mounted on the board. The I/O channel is bussed across these five I/O slots.
Two dual-in-line package (DIP) switches (two eight-switch packs) are mounted on the board and can be read under program control. The DIP switches provide the system software with information about the installed options, how much storage the system board has, what type of display adapter is installed, what operation modes are desired when power is switched on (color or black-and-white, 80 or 40-character lines), and the number of diskette drives attached.
The system board consists of five functional areas: the microprocessor subsystem and its support elements, the read-only memory (ROM) subsystem, the read/write (R/W) memory subsystem, integrated I/O adapters, and the I/O channel. The read/write memory is also referred to as random access memory (RAM). All are described in this section.
Microprocessor
The heart of the system board is the Intel 8088 Microprocessor. This is an 8-bit external-bus version of Intel's 16-bit 8086 Microprocessor, and is software-compatible with the 8086. Thus, ~ the 8088 supports 16-bit operations, including multiply and divide, and supports 20 bits of addressing (1 megabyte of storage). It also operates in maximum mode, so a comicroprocessor can be added as a feature. The microprocessor operates at 4.77-MHz. This frequency, which is derived from a
System Board 1-3
14.31818-MHz crystal, is divided by 3 for the microprocessor clock, and by 4 to obtain the 3.58-MHz color burst signal required for color televisions.
At the 4.77-MHz clock rate, the 8088 bus cycles are four clocks of 21O-ns, or 840-ns. I/O cycles take five 21O-ns clocks or 1.05-lts.
The system board contains circuits for attaching an audio cassette, the keyboard, and the speaker. The cassette adapter allows the attachment of any good quality audio cassette through the earphone output and either the microphone or auxiliary inputs. The system board has a jumper for either input. This interface also provides a cassette motor control for transport starting and stopping under program control. This interface reads and writes the audio cassette at a data rate of between 1,000 and 2,000 baud. The baud rate is variable and depend on data content, because a different bit-cell time is used for O's and l's. For diagnostic purposes, the tape interface can loop read to write for testing the system board's circuits. The ROM cassette software blocks cassette data and generates a cyclic redundancy check (CRC) to check this data.
The system board contains the adapter circuits for attaching the serial interface from the keyboard. These circuits generate an interrupt to the microprocessor when a complete scan code is received. The interface can request execution of a diagnostic test in the keyboard.
Both the keyboard and cassette interfaces on the system board are 5-pin DIN connectors that extends through the rear panel of the system unit.
1-4 System Board
Data Flow Diagrams
The following pages contain the system-board Data Flow Diagrams.
System Board 1-5
825QA Interrupt Controller
CLOCK/RESET
Contr~1
lines
System Board Data Flow (1 of 2)
1-6 System Board
System Board Data Flow (2 of 2)
System Board 1-7
System Memory Map
The following pages contain the System Memory Map.
1-8 System Board
Start Address
Decimal
Hex
0 16K 32K 48K
64K 80K 96K 112K
128K 144K 160K 176K
192K 208K 224K 240K
256K 272K 288K 304K
320K 336K 352K 368K
384K 400K 416K 432K
448K 464K 480K 496K
512K 528K 544K 560K
576K 592K 608K 624K
00000 04000 08000 OCOOO
10000
14000
18000
1COOO
20000
24000
28000
2COOO
30000
34000
38000
3COOO
40000
44000
48000
4COOO
50000
54000
58000
5COOO
60000
64000
68000
6COOO
70000
74000
78000
7COOO
80000
84000
88000
8COOO
90000
94000
98000
9COOO
Function
64 to 256K Read/Write Memory
on System Board
Up to 384K ReadlWrite
Memory in 110 Channel
System Memory Map for 64/256K System Board (Part 1 of 2)
System Board 1-9
Start Address
Decimal
Hex
640K 656K 672K 688K
AOOOO A4000 A8000 ACOOO
704K BOOOO
720K B4000
736K B8000
752K BCOOO
768K 784K
COOOO C4000
800K C8000
816K CCOOO
832K 848K 864K 880K
00000 04000 08000 OCOOO
896K 912K 928K 944K
960K
EOOOO E4000 E8000 ECOOO
FOOOO
976K 992K 1008K
F4000 F8000 FCOOO
Function
128K Reserved Monochrome Color/Graphics
Fixed Disk Control 192K Read Only Memory Expansion and Control
Reserved 48K Base System ROM
System Memory Map for 64/256K System Board (Part 2 of 2)
1-10 System Board
System Timers
Three programmable timer/counters are used by the system as follows: Channel 0 is a general-purpose timer providing a constant time base for implementing a time-of-:day clock, Channel 1 times and requests refresh cycles from the Direct Memory Access (DMA) channel, and Channel 2 supports the tone generation for the speaker. Each channel has a minimum timing resolution of 1.05-,us.
System Interrupts
Of the eight prioritized levels of interrupt, six are bussed to the system expansion slots for use by feature cards. Two levels are used on the system board. Level 0, the highest priority, is attached to Channel 0 of the timer/counter and provides a periodic interrupt for the time-of-day clock. Level 1 is attached to the keyboard adapter circuits and receives an interrupt for each scan code sent by the keyboard. The non-maskable interrupt (NMI) of the 8088 is used to report memory parity errors.
System Board 1-11
Number NMI
0
1 2 3
4
5 6 7
Usage
Parity
8087
Timer Keyboard Reserved Asynchronous Communications (Alternate) SDLC Communications BSC Communications Cluster (Primary) Asynchronous Communications (Primary) SDLC Communications BSC Communications Fixed Disk Diskette Printer Cluster (Alternate)
8088 Hardware Interrupt Listing
1-12 System Board
ROM
~
The system board supports both Read Only Memory (ROM) and Random Access Memory (RAM). It has space for up to 512K of ROM or Eraseable Programmable ROM (EPROM). Six module sockets are provided, each of which can accept an 8K or 8 byte device. Five sockets are populated with 40K of ROM. This ROM contains the cassette BASIC interpreter, cassette operating system, power-on selftest, Input/Output (I/O) drivers, dot patterns for 128 characters in graphics mode, and a diskette bootstrap loader. The ROM is packaged in 28-pin modules and has an access time of 250-ns and a cycle time of 375-ns.
RAM
The RAM on the system board is as shown in the following chart.
System Board Minimum Maximum
Storage
Storage
64/256K
64K
256K
Memory Modules
64K by 1 Bit
Soldered (Bank 0)
1 Bank of 9
Pluggable (Bank 1-3)
3 Banks of 9
Memory greater than the system board's maximum is obtained by adding memory cards in the expansion slots. All memory is parity-checked and consists of dynamic 64K by 1 bit chips with an access time of 250-ns and a cycle time of 410-ns.
DMA
The microprocessor is supported by a set of high-function support devices providing four channels of 20-bit direct-memory access (DMA), three 16-bit timer/counter channels, and eight prioritized interrupt levels.
System Board 1-13
Three of the four DMA channels are available on the I/O bus and
support high-speed data transfers between 1/0 devices and
memory without microprocessor intervention. The fourth DMA channel is programmed to refresh the system dynamic memory. This is done by programming a channel of the timer/counter device to periodically request a dummy DMA transfer. This action creates a memory-read cycle, which is available to refresh dynamic storage both on the system board and in the system expansion slots. All DMA data transfers, except the refresh channel, take five microprocessor clocks of 21O-ns, or 1.05-p,s if the microprocessor ready line is not deactivated. Refresh DMA cycles take four clocks or 840-ns.
The three programmable timer/counter devices are used by the system as follows: Channel 0 is used as a general-purpose timer providing a constant time base for implementing a time-of-day clock; Channel I is used to time and request refresh cycles from the DMA channel; and Channel 2 is used to support the tone generation for the speaker. Each channel has a minimum timing resolution of 1.05-us.
Of the eight prioritized levels of interrupt, six are bussed to the system expansion slots for use by feature cards. Two levels are used on the system board. Level 0, the highest priority, is attached to Channel 0 of the timer/counter device and provides a periodic interrupt for the time-of-day clock. Levell is attached to the keyboard adapter circuits and receives an interrupt for each scan code sent by the keyboard. The non-maskable interrupt (NMI) of the 8088 is used to report memory parity errors.
~
1/0 Channel
The I/O channel is an extension of the 8088 microprocessor bus.
H is, however, demultiplexed, repowered, and enhanced by the
addition of interrupts and direct memory access (DMA)
functions.
~
The I/O channel contains an 8-bit bidirectional data bus, 20
address lines, 6 levels of interrupt, control lines for memory and
I/O read or write, clock and timing lines, 3 channels of DMA
1-14 System Board
control lines, memory refresh timing control lines, a channel-check line, and power and ground for the adapters. Four voltage levels are provided for I/O cards: +5 Vdc, -5 Vdc, + 12 Vdc, and -12 Vdc. These functions are provided in a 62-pin connector with 100-mil card tab spacing. A 'ready' line is available on the I/O channel to allow operation with slow I/O or memory devices. If the channel's ready line is not activated by an addressed device, all microprocessor-generated memory read and write cycles take four 21O-ns clocks or 840-ns/byte. All microprocessor-generated I/O read and write cycles require five clocks for a cycle time of 1.05-.us/byte. All DMA transfers require five clocks for a cycle time of 1.05-.us/byte. Refresh cycles occur once every 72 clocks (approximately 15-.us) and require four clocks or approximately 7% of the bus bandwidth.
I/O devices are addressed using I/O mapped address space. The channel is designed so that 512 I/O device addresses are available to the I/O channel cards. A 'channel check' line exists for reporting error conditions to the ~ microprocessor. Activating this line results in a non-maskable interrupt (NMI) to the 8088 microprocessor. Memory expansion options use this line to report parity errors.
The I/O channel is repowered to provide sufficient drive to power all five system unit expansion slots, assuming two low-power Schottky loads per slot. The IBM I/O adapters typically use only one load.
System Board 1-1 S
System Board Diagram
The following shows the system board's component layout.
1-16 System Board
Cassette I/O System Expansion Slots
J2 J3 J40J5
Read Only Memory
System 0 Board
Power Connections Clock Chip Trimmer
IBM Math Coprocessor
Intel 8088 Microprocessor
D
DIP Switch Block 2
:0- -00000000:0000000
:0 DDDDDDODI:DODOOD~
64 to 256K
Read/Write Memory
DIP Switch Block 1
with Parity
:0 DDDDDDOO:ODODDOD
Checking
""::.~_~~~_~_~_~:aO DOOD
System Board Component Diagram
Cassette Microphone or Auxiliary Select
System Board 1-17
1/0 Channel Diagram
The following page contains the I/O Channel Diagram. Alllines are TTL-compatible.
1-18 System Board
Rear Panel
Signal Name
GND +RESET DRV +5V +IR02 -5VDC +DR02 -12V
Reserved
+12V GND -MEMW
-MEMR
-lOW -lOR
-DACK3 +DR03 -DACKl +DROl -DACKO ClK +IR07 +IR06 +IR05 +IR04 +IR03 -DACK2 +TIC +AlE +5V +OSC +GND
- r--- -Bl Al
1\
-
-
-
-
-
-
-
-
B10 Al0
-
-
r
-
r
-
f
-
r
-
I
-
r
-
r-
-
B20 A20
r
-
r
-
r
-
~
-
r
-
r
-
I
-
f
-
-
-
-
B31 A31 '-
Signal Name
-liD CH CK +D7 +D6 +D5 +D4 +D3 +D2 +D1 +DO +1/0 CH RDY +AEN +A19 +A18 +A17
+A16 +A15 +A14 +A13 +A12 +Al1 +Al0 +A9 +A8 +A7 +A6 +A5 +A4 +A3 +A2 +Al +AO
\
\ Component Side
I/O Channel Diagram
System Board 1-19
1/0 Channel Description
The following is a description of the IBM Personal Computer I/O Channel. All lines are TTL-compatible.
Signal
I/O Description
~
AO-A19
0 Address bits 0 to 19: These lines are used to address memory and I/O devices within the system. The 20 address lines allow access of up to 1M-byte of memory. AO is the least significant bit (LSB) and A19 is the most significant bit (MSB). These lines are generated by either the microprocessor or DMA controller. They are active high.
AEN
0 Address Enable: This line is used to de-gate the microprocessor and other devices from the I/O channel to allow DMA transfers to take place. When this line is active (high), the DMA controller has control of the address bus, data bus, Read command lines (memory and I/O), and the Write command lines (memory and I/O).
ALE eLK
0 Address Latch Enable: This line is
provided by the 8288 Bus Controller
and is used on the system board to latch
valid addresses from the
microprocessor. It is available to the
I/O channel as an indicator of a valid
microprocessor address (when used with
AEN). Microprocessor addresses are
latched with the falling edge of ALE.
,......-......,
0 System clock: It is a divide-by-three of
the oscillator and has a period of 21O-ns
(4.77-MHz) The clock has a 33% duty
cycle.
1-20 System Board
DO-D7
r"'\ -DACKO to -DACK3 DRQ1-DRQ3
~
-I/O CU CK
I/O CURDY
I/O Data Bits 0 to 7: These lines provide
data bus bits 0 to 7 for the microprocessor, memory, and 1/0 devices. DO is the least significant bit (LSB) and D7 is the most significant bit (MSB). These lines are active high.
0 -DMA Acknowledge 0 to 3: These lines are used to acknowledge DMA requests (DRQI-DRQ3) and refresh system dynamic memory (-DACKO). They are active low.
I
DMA Request 1 to 3: These lines are
asynchronous channel requests used by
peripheral devices to gain DMA service.
They are prioritized with DRQ3 being
the lowest and DRQl being the highest.
A request is generated by bringing a
DRQ line to an active level (high). A
DRQ line must be held high until the
corresponding DACK line goes active.
I
-II0 Channel Check: This line
provides the microprocessor with parity
(error) information on memory or
devices in the I/O channel. When this
signal is active low, a parity error is
indicated.
I
I/O Channel Ready: This line,
normally high (ready), is pulled low (not
ready) by a memory or 110 device to
lengthen I/O or memory cycles. It
allows slower devices to attach to the
1/0 channel with a minimum of
difficulty. Any slow device using this
line should drive it low immediately
upon detecting a valid address and a
Read or Write command. This line
should never be held low longer than 10
System Board 1-21
clock cycles. Machine cycles (I/O or memory) are extended by an integral number of clock cycles (210-ns).
-lOR
0 -I/O Read Command: This command
line instructs an I/O device to drive its data onto the data bus. It may be
~
driven by the microprocessor or the
DMA controller. This signal is active
low.
-lOW
0 -I/O Write Command: This command line instructs an I/O device to read the data on the data bus. It may be driven by the microprocessor or the DMA controller. This signal is active low.
IRQ2-IRQ7
I
Interrupt Request 2 to 7: These lines
are used to signal the microprocessor
that an I/O device requires attention.
They are prioritized with IRQ2 as the
highest priority and IRQ7 as the lowest.
An Interrupt Request is generated by
~
raising an IRQ line (low to high) and
holding it high until it is acknowledged
by the microprocessor (interrupt service
routine).
-MEMR
0 -Memory Read Command: This command line instructs the memory to drive its data onto the data bus. It may be driven by the microprocessor or the DMA controller. This signal is active low.
-MEMW
0 -Memory Write Command: This
command line instructs the memory to
store the data present on the data bus.
It may be driven by the microprocessor or the DMA controller. This signal is
r""\
active low.
1..22 System Board
OSC
o Oscillator: High-speed clock with a
70-ns period (14.31818-MHz). It has a
50% duty cycle.
RESETDRV o Reset Drive: This line is used to reset
or initialize system logic upon power-up or during a low line-voltage outage.
This signal is synchronized to the falling edge of CLK and is active high.
TIC
o Terminal Count: This line provides a
pulse when the terminal count for any
DMA channel is reached. This signal is
active high.
System Board 1-23
Hex Ranoa·
OOO-OOF 020-021 040-043 060-063 080-083 OAX** 200-20F 210-217 2F8-2FF 300-31F 320-32F 378-37F 380-38C*** 380-389*** 390-393 3AO-3A9 3BO-3BF 3DO-3DF 3FO-3F7 3F8-3FF 790-793 B90-B93 1390-1393 2390-2393
Usaaa
DMA Chip 8237A-5 Interrupt 8259A Timer 8253-5 PP18255A-5 DMA Page Registers NMI Mask Register Game Control Expansion Unit Asynchronous Communications (Secondary) Prototype Card Fixed Disk Printer SDLC Communications Binary Synchronous Communications (Secondary) Cluster Binary Synchronous Communications (Primary) IBM Monochrome Display/Printer Color/ Graphics
Diskette
Asynchronous Communications (Primary)
Cluster (Adapter 1)
Cluster (Adapter 2)
Cluster (Adapter 3)
Cluster (Adapter 4)
* These are the addresses decoded by the current set of adapter cards. IBM may use any of the unlisted addresses for future use.
** At power-on time. the Non Mask Interrupt into the 8088 is masked off. This mask bit can be set and reset through system software as follows:
Set mask: Write hex 80 to I/O Address hex AO (enable NMI)
Clear mask: Write hex 00 to I/O Address hex AO (disable NMI) *** SDLC Communications and Secondary Binary Synchronous Communications cannot be used together because their hex addresses overlap.
I/O Address Map
1-24 System Board
Other Circuits
,..-...,., Speaker Circuit
The sound system has a small, permanent magnet, 57.15 mm (2-1/4 in.) speaker. The speaker can be driven from one or both of two sources:
· An 8255A-5 programmable peripheral interface (PPI) output bit. The address and bit are defined in the "I/O Address Map".
· A timer clock channel, the output of which is programmable within the functions of the 8253-5 timer when using a 1.19-MHz clock input. The timer gate also is controlled by an 8255A-5 PPI output-port bit. Address and bit assignment are in the "I/O Address Map".
PPI Bit 1. 1/0 Address Hex 0 0 6 1 _
--1.19 MHz
AND
Clock
r---. In2
Timer Clock Out 2
-
Gate 2
PPI Bit O. 1/0 Address Hex 0061
Low To Driver t-- Pass i'-'Speaker
Filter
Speaker Drive System Block Diagram
Channel 2 (Tone generation for speaker)
Gate 2
- Controller by 8255A-5 PPI Bit
(See 1/0 Map)
Clock In 2 - 1.19318 - MHz OSC
Clock Out 2 - Used to drive speaker
,..-...,., Speaker Tone Generation
System Board 1-25
The speaker connection is a 4-pin Berg connector. See "System Board Component Diagram," earlier in this section, for speaker connection or placement.
Pin
Function
1
Data
2
Key
3
Ground
4
+ 5 Volts
Speaker Connector
The speaker drive circuit is capable of about 1/2 watt of power. The control circuits allow the speaker to be driven three ways: (1) a direct program control register bit may be toggled to generate a pulse train; (2) the output from Channel 2 of the timer/counter device may be programmed to generate a waveform to the speaker; (3) the clock input to the timer/counter
device can be modulated with a program-controlled I/O register
bit. All three methods may be performed simultaneously.
1-26 System Board
Cassette Interface
The cassette interface is controlled through software. An output from the 8253 timer controls the data to the cassette recorder through pin 5 of the cassette DIN connector at the rear of the system board. The cassette input data is read by an input port bit of the 8255A-5 PPI. This data is received through pin 4 of the cassette connector. Software algorithms are used to generate and read cassette data. The cassette drive motor is controlled through pins 1 and 3 of the cassette connector. The drive motor on/off switching is controlled by an 8255A-5 PPI output-port bit (hex 61, bit 3). The 8255A-5 address and bit assignments are defined in "I/O Address Map" earlier in this section.
A 2 by 2 Berg pin and a jumper are used on the cassette 'data out' line. The jumper allows use of the 'data out' line as a O.075-Vdc microphone input when placed across the M and C of the Berg Pins. A O.68-Vdc auxiliary input to the cassette recorder is available when the jumper is placed across the A and C of the Berg Pins. The "System Board Component Diagram" shows the location of the cassette Berg pins.
M
A
M
A
c
c
Microphone Input (0.075 Vdc)
c
c
Auxiliary Input (0.68 Vdc)
System Board 1-27
Cassette Circuit Block Diagrams
Circuit block diagrams for the cassette-interface read hardware, write hardware, and motor control are illustrated below.
-5V
Cassette
Data In
Data From Cassette Recorder Earphone Jack
GND
GND
Silicon Diode
VIR=.4V
Cathode
Cassette-Interface Read Hardware Block Diagram
1-28 System Board
74LS38
8253 Timer #2tO
Output
OR
o
+5V
0--------------__
0.678V to AUX Input
0--------------___
0.075V to MIC Input
GND
Cassette Interface Write Hardware Block Diagram
+5V
I
4.7 kOhm
+5V
SN75475
Relay
~8
OR Motor-[O
On
0
"
+5V- Clamp
S C~.
VCC f-
In
Out
r-- VSS
Coil Coil
N/O
Cassette Motor Control
Com
GND
Cassette Motor Control Block Diagram
System Board 1-29
Rear Panel
Cassette Connector
5-Pin DIN Connector
Pin
Signal
1
Motor Control
2
Ground
3
Motor Control
4
Data In
5
Data Out (Microphone or
Auxiliary)
Electrical Characteristics Common from Relay
Relay N.O. (6 Vdc at 1A)
500nA at ± 13V - at 1,000 - 2,000 Baud
250 IlA at
0.68Vdc or ** 0.075Vdc
* All voltages and currents are maximum ratings and should not be exceeded.
* * Data out can be chosen using a jumper located on the system board.
(Auxiliary --0.68 Vdc or Microphone --0.075 Vdc).
Interchange of these voltages on the cassette recorder could lead to damage of recorder inputs.
Cassette Interface Connector Specifications
1-30 System Board
8255A I/O Bit Map
The 8255A I/O Bit Map shows the inputs and outputs for the Command/Mode register on the system board. Also shown are the switch settings for the memory, display, and number of
diskette drives. The following page contains the I/O bit map.
System Board 1-31
Hex
0 PAO + Keyboard Scan Code
r- IPL 5-1/4 Diskette Drive (SW1 -1)
Port
I
1
1
Reserved
(SW1-2)
Number N 2
2
System Board Read/Write * (SW 1 - 3)
0060 P
Memory Size
U 3 T
3
System Board Read/Write *(SW1-4)
Or
Memory Size
4
4
+ Display Type 1
* *(SW1-5)
5
5
+ Display Type 2
* *(SW1-6)
6
6
No. of 5-1/4 Drives * * *(SW1-7)
7
7
No. of 5-1/4 Drives * **(SW1-8)
-
'-
PBO + Timer 2 Gate Speaker
o
1 + Speaker Data
U 2 + (Read Read/Write Memory Size) or (Read Spare Key)
0061
T
3 + Cassette Motor Off
P 4 - Enable Read/Write Memory
U 5 - Enable I/O Channel Check
T
6
7 1-+---;
PCO
I
1
- Hold Keyboard Clock Low - (Enable Keyboard or + (Clear Keyboard and Enable Sense Switches)
I/O Read/Write Memory (SW2-1)]
I/O Read/Write Memory (Sw2-2)
Binary
I/O Read/ Write
N 2 I/O Read/Write Memory (Sw2-3)
Value
0062
P
3 I/O Read/Write Memory (Sw2-4)
X 32K
U 4 + Cassette Data In
Memory (Sw2-5)
T
5 + Timer Channel 2 Out
6 + I/O Channel Check
0063
7 + Read/Write Memory Parity Check '--'---'
Command/Mode Register Mode Register Value
Hex 99
I 3 2 1 0
PA3 Sw1-4
1
PA2 Sw1-3
1
Amount of Memory Located on System Board
64 to 256K
PA5 Sw1-6
0 0 1 1
PA4 Sw1-5
0 1 0 1
Display at Power-Up Mode
Reserved
Color 40 X 25 (BW Mode)
Color 80 X 25 (BW Mode)
IBM Monochrome (80 X 25)
PA7 Sw1-8
0 0 1 1
PA6 Sw1-7
0 1 0 1
Number of 5-1/4" Drives
in System
1 2 3 4
Note:
A plus (+) indicates a bit value of 1 performs the specified function.
A minus (-) indicates a bit value of 0 performs the specified function.
PA Bit =0 implies switch' 'ON." PA bit = 1 implies switch' 'OFF."
8255A I/O Bit Map
1-32 System Board
System-Board Switch Settings
All system board switch settings for total system memory, number of diskette drives, and type of display adapter are described under "Switch Settings" in the IBM Personal Computer Guide to Operations. The diagram showing the system board switch locations follows.
Cassette I/O
System Expansion Slots
System
J 1 0 J2 J3 J4 OJ5
o Board
Power
Read
D
o00 0
Connections
Clock Chip Trimmer
11 IBM Math
000000 ODIDDOIO
Only
Memory Cl
Coprocessor Intel 8088
Microprocessor
DDD"DO D°
ON
DIP Switch
Block 2
:0- -ODOOOODOlOODDDDD DIP
:0 OOOODDDD\DODDDDD 64 to 256K
Read/Write
Switch Block 1
Memory
with Parity
:0 00000000:0000000
Checking
;0 00000000:00 DODD
T \ -0- qP3- --5 -Oap4 ~
-c:>-
·
Cassette
... ~ Microphone
Pin 1 Speaker Output
or Auxiliary
Select
System Board 1-33
Specifications
The following voltages are available on the system-board I/O channel:
+ 5 Vdc ± 5% on 2 connector pins
- 5 Vdc ± 10% on 1 connector pin
+12 Vdc ± 5% on 1 connector pin
-12 Vdc ± 10% on 1 connector pin
GND (Ground) on 3 connector pins
Card Specifications
The specifications for option cards follow.
1-34 System Board
)
I
~ Loc.Hole
0.125 ± .002 (3.175 ± ,05)
I
)
)
Front View (Component Side)
1 18 )
-
Loc. Hole
I
/1
~
0.125 ± .002 (3.175 ± .05)
-
12.8 (325.12)
Mounting Holes
0."" oo"''''''~
I J Position 831 Is on Back
Copper Pad (To Ground)
Jll ~ t: ~ ~
o'"
0 .
~
M-q-
<0
;;
::. 0.;
(Pin Side)
loco Holes
_:)_
a;
~ CD 0
N
"
"
0.125±.002(3.175±.05)
~! I ]OruJ-, 3~ A~___
~
ci ~
t 0.4 (10.16)
,
'0"
3.190 -i' .005 (81.026 ± .127)
0.705 (17.907)
f
13.13 + .020 1333.502 + .50B}
l==
I
Notes:
1. All Card Dimensions
are ± .010 (.254) Tolerance (With Exceptions Indicated on Drawing or in Notes).
2. Max. Card Length is 13.15. (334.01) Smaller Length is Permissible.
3, Loc. and Mounting Holes are
Non-Plated Thru.
4. 31 Gold Tabs Each Side,
0.100 ± .0005 (2.54 ± .0127) Center
to Center, 0.06 ± .0005 (1.524 ± .0127)
Width,
5. Numbers in Parentheses are in Millimeters, All Others .are in Inches.
~
(loc. 3X, Mtg. 2X).
(,II
l UO!paS
Logic Diagrams
The following pages contain the logic diagrams for the system board.
1-36 System Board
)
)
)
F ~~~"1 I ~ +" q,--~-~£L..,~47" tlOl PWAGOOD
~ ~~818;.'-'-H.Z'? rIll--- ~ 12) DiiiWiiT
+5~V~~~,m., .~ · ~ ~ ~_.. ~~'~~ r ·~! -~~~GT) ,A~:.+I' O+~~,. III iiOviWAIT
" ' " 1 1n3, FRiEeS82Bu4nA X'." V5I 30
XTAL
.."f; Ne 15 AESfl
X2
VIC READY 5
READY
3 ROYI elK 8
.CLKS'
· ,,{<:I:\
'Ill)
vee
: . f ' 9
12.
I_K
R1215
· - ' I 40 ,oiGTO G''8D0"20
INTR MNIMX 33
r7 eRLEAKD"Y r-I I
22 .EADYU3 A19 35 -
i;19 ClK 418 36 RESET A17 37
419 4"
A" V
::.:::::
AD3
13 AD2
m ' - AD4
12 '03
·A ADS D ' ,3100 AAADDD7.'
III
A13 3
A13
·'12
AAO
..47' -
-
-
. - A12
AAS9
4.70 10 .N,'
23 0"
Sl 28 Sf
,--"'1 TEST LOCK 29 LOCK
,-
A19 18
J l A187 1,70-/O'iiiiiO0l-1196
A16
0 OlD · 5
m ,. ,=~'" ALE 11j 0
0I.L
A14 . . 0 L5373 · 2
:~E,.A13
AAAl9m1
~: ~ cl, " ." 7 0
· 5
,1,3,,000 UO ··G -1192L
LJD
AU · G
-. DE
- = " PClK 1891
·
'"A19
A18
~·1'.4··m
13.4.10)
'.
"AAA1l'23,
:::
A'
~.1~5.'.1D) 1133."4.,'06.1'01
~~:::~~.'.'.'D)
AS
)'.'.'.10)
~
~
~
-
101
··(Il)
~ _ ··OD
-1R02
~ 8~_~_,~.. _
_
,,"18
,NT "
.'"2D 1R1 GND r,x.::-'
·
_
. . ., "
,"~,,-, (Ill
IRO'
.001 . .I,Ra'
· -
· w
23 IR'
00 n
...,., ' ,2"4"o.IR,O' oO.D1.'''0'
,~CAS2 ,~ .,",'" .· '"" f-lt'1", ''''
{
~1' iii,.. ~
I ' , +" ~C3 ~TI'~I~I / ////// //77
, viii~S'OCCKET~~/? flUf\~ "_'--.' :. ': V
+ 5V
IT ',~ I V
~ ~" ,_.EADY
4D xu, · +5V
, -If.rI i. 34 .WGn ··0
1 · K,'"
_ I"ll, .. __ " " 22
BUSY 23
V
!~D AADD76 183 0 L5373 0 2 0"
0
'0 ·
D
0 15
m , ' · ALE nOD 9
_
9
.,"
"
AD
RESET A17.1L
Al7
~~ ~ ,~ .~~,!.6.~ ~D7 , ·Ar:
w ,AO.D
,
,-,"" ;.o'
"A1,6 , '
m,
.
'
."
"
~ .., , , · a
-~ " . , ..' ~~ O ~ ,. 0G.s.a
" . ,,"' -, ..- ,'. .
.. a' -
254 ROSOOriffii 5S1O 276
8SO'
"-------'
1/ '"<""!''-!,--->--2'{,,A"' LS2,"'"'" "·f8
>SO
¥
-
,",,
.:.
-,
.
." '
+- -, '-OIR
,. ,',,""
~
~n ~ a.. L ~ 52 ;.u. " .,;
19 8288 ~19$1
~~
LOCK 12) RESET 12.4.0)
: .-l.A5
14,5,&,101
A4
.~- ""A2
14.5,6,111)
· · · 14.5.6.10)
·
.....
~,·,
,
'
."
"
,.,...~~' ~
0
155..6'..''01
~ I:: S2
(21
ALE
1101
ao==
· ....
, ,.
jooO
I ~ -..l
~_
18
," m"-' .... 14
2
ISSN12TAMUC 6DEEI0N ~ T18 /NRC ~132~LUS1UB412
t"r-'., 1: 1:+" , 9AEI _AIOWC 12 ~R11~:1 N,.I l~~.Nl
RWI RN14.70
10IDBAMWCB
~ _
~ GND roWC,.J!-NC
15
MWTC
NC
R14
~ 5 1 3 1 4 MEMR
"
(!.In 15,10)
+ 5V e------1!.[;~~ M'~~g ~
R1B
fiii' iS,101
MEMW is,lU)
'18
64/256K System Board (Sheet 1 of 10)
l UO!ptls
...
I ~ QC
00
'I.<.I.I..
e ~
a~=
liD! I/O CH ROY
I~
XIDR
I5J
"'OW
I4l DAel( 0 BRD
15'
XMEMR
151
eLK
111
so
111 111
"S2
111
LOCk
111
RESET
14'
HAD OMA
,.,11)
II.P.NPI
N.PJNSTlSW
161
PCi
'51
X07
131 WRT IIMI REG
1101
110 eH CK
191 ENABLE 110 CI(
111
ClK88
)
+ , ·
4.1Kn~RIlI
, - - - - - - - - - - - - - - - - - RDY/wAIT (1)
lS175
°1~ - 91t~lKQ2
'II
1.8 U~f1 .8
ROY TO OMA (41
'LjO' ..I"
deLR 03
OMAAEN
(4,5)
AEN BRD
n,5)
AEi
(1,3)
OMAWAIT 11)
'" KOlOA
RESET ORV RESET ORV
PU
no)
OM'
111
- - - - 1 - - - - - - - - - - - - - - - - - HOCKel( (9)
LS04
C
CIK
220n~R12
64/256K System Board (Sheet 2 of 10)
5~6
Dell(
(41
)
)
[f
(..I.l.
e ~
-a=~=
I
~
IC
)
)
)
'51
lIAS
151
XA.
151
XA7
lSI
XA'
~I
XA9
I~
Ali
151
XIOW
111
A16
111
AI1
1'1 111
."A19
15)
XMEMW
111
A16
(1)
A17
I~ OAe" 0 BRD
111
A13
'"111
Ale A15
'51
XMEMR
'21 RESET DRV
141
OAeK 0
LSIJH 1~15
2 B VI 14
3 C Y2 13
12
T I Y3 11
U66 Y4
B LS02
V5 5 G2B YO
.~ 10
4
Y7
G2A
Ii Gl
:b lSQ2
1 usa 13
: LS20
,2 U64' 6 .../
~~ ---..!.. A YO 15 ------'-'-c' "YI2>P
y, 7
.48 ::~
-.L: G2B p
P
"~ G2. Y6
.--L~O
1~15
2 B ~~ C
Yl 14
Y2 13 Y3 12
U47 yY4,
~ G2B 'I
t-!<: GZA Y7
6 G'
'---
''-''H\ 28 Yl~·
Y'~ 3
C .46
Y2~
Y Y3 .~ ~
r~G2B YO~,
'il
4 GlA Y7 7 CS7
T 6 G'
5 LSD2
...
6 .50 11
,
13 U51 12
5 SOD
Q.81'"
HAS
I ,I1.':5nM50ED~1E'L0.0"",125;
If I'
I,~~U81 ~
S138
"~LJ ,,]~,. ~, Y'P :I C Y2
if +:! Y3~ ~G' & U65 Y4 11
ill!: ~
10 9
9
SOB
12 ~_S08
13:J'49 11
~t±)L-1.J U49S~D83
I I
5G28Y17
4
~
-
,J.49 ·
II, '11111111 '11'11'11111 1/171111, 'II,
~ I 1 U81 3 REFRESH GATE
CiS
DMACS
141
INTA cs
111
TlteS
~I
PPICS
191
WRTIMIREG
111
WAT OMA PG REG '41 ROM AOOA SEt 151
RAIl ADOR sn 16)
ADORSEL CASO CAS1 CAS2 CAS3
RASO RASI RA52 RA53
-- --
CSO
CSt CS2
- - - -
--
--
ill
CmmS4
ill
161 1&1 16) 111 111
161 161 111 171
} lOT USED
151 '51 ,51
'51
15'
~I
64/256K System Board (Sheet 3 of 10)
l UO!paS
;;; ~ '"' "5~~~
Ii i ~ 1;lil~l~
II
I11111
11
Ii III
Ii
-0.
0
o..:.t.
Q) Q)
.l:.
!!!
".C.. r".
a:I 0 a::I
E
.Q...)
II)
>
VJ ::.=: CD
It)
N
"o":t
CD
1-40 System Board
: ";:;~!ff!!!En3a
IIIIIII
IIIIII
.~
~
l!
0......
0
...It)
Q)
Q) ~
. ~
"C
«I
m 0
~£ ~g
~
.QE..)
(I)
e>n
~
a
~
CD
It)
N
""
'It CD
:.~;~~:!~ E:E:~E:E::==::'
11i11i I~ I~ Iii IS ==;~~~I; U!""
'" '" " " B-B
EE:::E::::!S!i:
g;;Sa8:s:g:;; =E:EEEE:E::
I~ Ii I~III;II
"
=:.:.:::
E
System Board 1-41
-0...
0
C..D..
CD
.CcD
~
't..J.
!
CD
r-...
E
.C..D.
I/)
e>n
~
-CD
It)
N
q-
CD
I~I~ 15CiS~H!dS!S I;
I~
~22=====- § 65
Ii
:~:C~~;::!;
=5=;=~<~~
~
'~'5Ii
II
.. ==-=-=-====
====-=-=-==-6
" 66
"
1-42 System Board
00
~ '.I..l.
n>
a"=:I
...1000
I
~
)
)
)
I~
1,1.86,''
MMMMDODP DD-''--
III'MD3-
III
1~
(8' 1'1
MMMMDDDD574. - --
,3, RAS2
13' CAS2
.~~ 161
I"
I" MA1-
16' MA2 -
16' MAl -
:::-- III MA. -
,I.~,'
r~
~
MMODPD::::::::::::::::::::::==~~~~~
MMMDOD3l' ===----,:,J;~ii!l
\ MD4
VssP-L------- GilD
MD. \ MOS
Mon
VCC~+5V
;,Wl~~U~
~~"'-_ ~~
BAlK 2 ·
{,33,'
. . .3 CASJ
MOP MOD MOl
MD2 MD3
4....JRA"S
Is.... fiS
2.~IUOUT
Z.14~DDUT DII1DOUT VSS~GIID
vcd-~------- +5V
8AIK3 'BANKS 2 & 3 ARE fEATURES.
64/256K System Board (Sheet 7 of 10)
l UO!l:JaS
Ii!
"
r
~~
a
~
i
~~, ~
'--1"
~
a !!
ill
~T~
~
~
I§~
" "
~
~
!
il Ii Ii ff ii is li.iii9.i!ie~i!.i9
I~ iii ~
i ~
. i
" ~
~~ ~· "0~N0O
i.IiI!~; [ ] lit.....:
II O~
~ ON ~ 0_
0
1-44 System Board
I
=~ ~"~i;~
B
...... :Ii ......
~;;~
~ .~-
- -it!!, ~
~
E'" =
- - =1 0 0 0 0 0 I::; ~~: ,
j i
~~!~'~
'"
lei
§" " 0 ' a · ~ga.g~g= I."gl~§.~-~,o
·
~
..·il ·i ~I· -"I,. "
!
~
-lr~~J
~
N
·
~
R;l ,:£11 i:; ~ ....
'"
..
-III
~
!II ~
N
. JI <; !~lS."..
iii ~]i
.!~
u
-y
-.6....
o
e..n.
i sc _ , ;:c; :::
c ;::!i ~
~:~
~:-=g=::::: .-
I
m
-:1'''is tt tttl
_N
~;Ii i! f"f"
rJ- ~
II
':~~11 ~
:::' I'
~:. ~·il
U1'". a "
Q)
.=Q)
~
"'C
oca
In
E $
III
I~~
~
-. --
'-:::-"'~
I:
:!
. N
·
~~Ig~··i'·!'··
~~22 ~::::~::
t;;
- .."';,~~
lSCiSS:!U1USS
'I...... "'~
.,,~
J FI Hi,,",
~'d ~
"It
~
fd.J.·J.L... ,I ~ ~........ ..........It;IS
c
"
- --C-'11
~ i
.. -::~ ::!:!':2!!!
~lnnmtJ
e>n
~ (Q
LO N
~
(Q
TTffm
!i!~;;!!
I'
-"
System Board 1-45
'"I"'" =~-.
fJJ
'.[<.I.I.
a(!>
===~-
111 111 111 111 111 111 111 111
DD O -l .....~ !!!! 02 --....!!!! OJ~
D4~
05 -----.!!!! 06 ---2!!
07~
110
COllECTOR
II: (62 PINI
AOl
Fa
Jll"IJ,1
J4
804
J5 825
111
AO~
111
A1 ---..!!!!.
111 111
A2 ----B! 13 ----.!!!
ii24 8z3
1rmn
111
A4 -B!
11) 11) 111 111 111
AA5 -B.!~ !! A7~ A AI 9 -.M~!
.lB
Bii6 ill
111 111
AAtOl--1--B~.!
111
111 111
A12 --.!!! A13~ A14~
111 111 111
AA151--6--.~ !!!
Al1~
111 111
AA181--9-.!~!!
111 111
iDR ----!!!. iOW -----.!!.!
111 MEMii -.!!!
111 MEMW ---.!!!
~I
111
ClK~ osc~
141
TIC -.!!!
151
AEI.-M!
12) RESETORY ---.!!!!
151 OICKa -----.!!! 141 DACK' -----.!!l I~ DACK2 -----.!!!. 141 OACl3 -----!1!
111
A. .
B2I
110 eM eN: 12) 110 eM ROY (l) RESERVED
II.' 111
tROl
111
IR04
111
IH05
111
IR06
111
IR01
111
ORO 1
141
OR02
141
OR03
141
I/O CONNECTOR FROM BOARD
~SIDE:
HOl~. A" COMPONENT
SIDE Of I/O CARD fACES
B31 All
J1 IS COII.ECTORS TOTAl!
.,
POWER
,C-O--il.,
POWER Goon KEY +12VDC -lZVDC
} .00
-svoc
} +5VOC
--.J
P2
PWRGOOD(11
lorE:
IT] &30Tl: 23 CAPS
64/256K System Board (10 of 10)
)
)
)
SECTION 2. COPROCESSOR
Contents
Description ...................................... 2-3
Programming Interface .....................·....·.. 2-3
Hardware Interface ..·....···............·......... 2-4
Coprocessor 2-1
2-2 Coprocessor
Description
The Math Coprocessor (8087) enables the IBM Personal
Computer to perform high-speed arithmetic, logarithmic
~ functions, and trigonometric operations with extreme accuracy.
The 8087 coprocessor works in parallel with the microprocessor. The parallel operation decreases operating time by allowing the coprocessor to do mathematical calculations while the microprocessor continues to do other functions.
The first five bits of every instruction's operation code for the coprocessor are identical (binary 11011). When the microprocessor and the coprocessor see this operation code, the microprocessor calculates the address of any variables in memory, while the coprocessor checks the instruction. The coprocessor takes the memory address from the microprocessor if necessary. To gain access to locations in memory, the coprocessor takes the local bus from the microprocessor when the microprocessor finishes its current instruction. When the coprocessor is finished with the memory transfer, it returns the local bus to the microprocessor.
The IBM Math Coprocessor works with seven numeric data types divided into the three classes listed below.
· Binary integers (3 types)
· Decimal integers (1 type)
· Real numbers (3 types)
Programming Interface
The coprocessor extends the data types, registers, and instructions to the microprocessor.
Coprocessor 2-3
The coprocessor has eight 80-bit registers, which provide the equivalent capacity of the 40 16-bit registers found in the microprocessor. This register space allows constants and temporary results to be held in registers during calculations, thus reducing memory access and improving speed as well as bus availability. The register space can be used as a stack or as a fixed register set. When used as a stack, only the top two stack elements are operated on. The figure below shows representations of large and small numbers in each data type.
Data Type
Bits
Word Integer
16
Short Integer
32
Long Integer
64
Packed Decimal 80
Short Real*
32
Long Real*
64
Temporary Real 80
Significant Digits (Decimal)
Approximate Range (decimal)
4 9 18 18 6·7 15·16 19
-32,768:5X:5 +32,767
- 2x1 0 9:5 X:5 + 2x109
-9x10 18 :5X:5 +9x10 18
- 99... 99:5 X:5 + 99... 99 (18 digits)
8.43x1 0 37 :5 :X::5 3.37x1 0 38
4.19x10-307:5 :X: :51.67x10308
3.4x 10-4932 :5 :X::5 1.2x104932
*The short and long real data types correspond to the single and double precision data types.
Data Types
Hardware Interface
The coprocessor uses the same clock generator and system bus interface components as the microprocessor. The coprocessor is wired directly into the microprocessor. The microprocessor's queue status lines (QSO and QSl) enable the coprocessor to obtain and decode instructions simultaneously with the microprocessor. The coprocessor's 'busy' signal informs the microprocessor that it is executing; the microprocessor's WAIT instruction forces the microprocessor to wait until the coprocessor is finished executing (WAIT FOR NOT BUSY).
When an incorrect instruction is sent to the coprocessor (for example, divide by 0 or load a full register), the coprocessor can
~
2-4 Coprocessor
signal the microprocessor with an interrupt. There are three conditions that will disable the coprocessor interrupt to the microprocessor:
1. Exception and interrupt-enable bits of the control word are set to l's.
2. System-board switch-block 1, switch 2, set in the On position.
3. Non-maskable interrupt (NMI) register (REG) is set to zero.
At power-on time, the NMI REG is cleared to disable the NMI. Any program using the coprocessor's interrupt capability must ensure that conditions 2 and 3 are never met during the operation of the software or an "Endless WAIT" will occur. An "Endless WAIT" will have the microprocessor waiting for the 'not busy' signal from the coprocessor while the coprocessor is waiting for the microprocessor to interrupt.
Because a memory parity error may also cause an interrupt to the microprocessor NMI line, the program should check the coprocessor status for an exception condition. If a coprocessor ~ exception condition is not found, control should be passed to the normal NMI handler. If an 8087 exception condition is found, the program may clear the exception by executing the FNSAVE or the FNCLEX instruction, and the exception can be identified and acted upon.
The NMI REG and the coprocessor's interrupt are tied to the NMI line through the NMI interrupt logic. Minor modifications to programs designed for use with a coprocessor must be made before the programs will be compatible with the IBM Personal Computer Math Coprocessor.
Coprocessor 2-5
Memory and
System Board
NMII-----.t NMI NMI INT
logic
INT
8284 Clock Generator
ClKI---+-~--.! ClK Math Coprocessor
L----IINT RO/GTI
Coprocessor Interconnection
8088 Family
Bus Interface Components
Multimaster System Bus
Detailed information for the internal functions of the Intel 8087
Coprocessor can be found in the books listed in the Bibliography.
2-6 Coprocessor
SECTION 3. POWER SUPPLY
Contents
Description
3-3
Input Requirements ...........·.................... 3-4
Outputs .··.....·..............··..........·..... 3-4
Vdc Output ................................... 3-4
Vac Output ................................... 3-5
Overvoltage/Overcurrent Protection ................... 3-5
Primary (Input) ................................ 3-5
Secondary (Output) ............................ 3-5
Power Good Signal ........·...··..............·... 3-6
Power Supply Connectors and Pin Assignments ........... 3-6
Power Supply 3-1
3-2 Power Supply
Description
The system power supply is located at the right rear of the system unit. It is an integral part of the system-unit chassis. Its housing provides support for the rear panel, and its fan furnishes cooling for the whole system.
It supplies the power and reset signal necessary for the operation of the system board, installed options, and the keyboard. It also provides a switched ac socket for the IBM Monochrome Display and two separate connectors for power to the 5-1/4 inch diskette drives.
The two different power supplies available are designed for continuous operation at 63.5 Watts. They have a fused 120 Vac or 220/240 Vac input and provide four regulated dc output voltages: 7 A at +5 Vdc, 2 A at + 12 Vdc, 0.3 A at -5 Vdc, and 0.25 A at -12 Vdc. These outputs are overvoltage, overcurrent, open-circuit, and short-circuit protected. If a dc overload or overvoltage condition occurs, all dc outputs are shut down as long as the condition exists.
The + 12 Vdc and -12 Vdc power the EIA drivers and receivers
on the asynchronous communications adapter. The + 12 Vdc also
power's the system's dynamic memory and the two internal 5-1/4 inch diskette drive motors. It is assumed that only one drive is
active at a time. The +5 Vdc powers the logic on the system
board and diskette drives and allows about 4 A of +5 Vdc for the adapters in the system-unit expansion slots. The -5 Vdc is for dynamic memory bias voltage; it tracks the +5 Vdc and + 12 Vdc very quickly at power-on and has a longer decay on power-off than the +5 Vdc and + 12 Vdc outputs. All four power supply dc voltages are bussed across each of the five system-unit expansion slots.
Power Supply 3-3
Input Requirements
The following are the input requirements for the system unit power supply.
Nominal 120
220/240
Voltage (Vac) Minimum 104 180
Maximum 127 259
Frequency (Hz)
+/- 3Hz
60 50
Current (Amps) Maximum
2.5 at 104 Vac 1.0at 180Vac
Outputs
Vdc Output
The following are the de outputs for the system unit power supply.
Voltage (Vdc)
Nominal
+5.0 -5.0 + 12.0 -12.0
Current (Amps)
Minimum
Maximum
2.3
7.0
0.0
0.3
0.4
2.0
0.0
0.25
Regulation (Tolerance)
+%
-%
5
4
10
8
5
4
10
9
3-4 Power Supply
Vac Output
The power supply provides a filtered, fused, ac output that is switched on and off with the main power switch. The maximum current available at this output is 0.75 A. The receptacle provided at the rear of the power supply for this ac output is a nonstandard connector designed to be used only for the IBM Monochrome Display.
Overvoltage/Overcurrent Protection
The system power supply employs the protection features which are described below.
Primary (Input)
The following table describes the primary (input voltage) protection for the system-unit power supply.
Voltage (Nominal Vac) 120
220/240
Type Protection
Fuse Fuse
Rating (Amps) 2 1
Secondary (OUtput)
On overvoltage, the power supply is designed to shut down all
outputs when either the +5 Vdc or the + 12 Vdc output exceeds
200% of its maximum rated voltage. On overcurrent, the supply will turn off if any output exceeds 130% of its nominal value.
Power Supply 3-5
Power Good Signal
When the power supply is turned on after it has been off for a minimum of 5 seconds, it generates a 'power good' signal that indicates there is adequate power for processing. When the four output voltages are above the minimum sense levels, as described below, the signal sequences to a TTL-compatible up level (2.4 Vdc to 5.5 Vdc), is capable of sourcing 60 /LA. When any of the four output voltages is below its minimum sense level or above its maximum sense level, the 'power good' signal will be TTL-compatible down level (0.0 Vdc to 0.4 Vdc) capable of supplying 500 /LA. The 'power good' signal has a turn-on delay of 100-ms after the output voltages have reached their respective minimum sense levels.
r""\
Output Voltage
+5Vdc -5Vdc + 12 Vdc -12 Vdc
Under-Voltage Nominal Sense Level
+4.0Vdc -4.0Vdc +9.6Vdc -9.6Vdc
Over-Voltage
Nominal Sense Level
+ 5.9 Vdc
- 5.9 Vdc
+14.2Vdc
-14.2 Vdc
Power Supply Connectors and Pin Assignments
The power connector on the system board is a 12-pin male connector that plugs into the power-supply connectors. The pin configuration and locations follow.
3-6 Power Supply
)
)
)
'8
:IE
~
~
(J)
c:
'C
'C
<"
I»
~
Co
(")
o
~
~
ng~
~~
~
1/1
e~~. e
5·1/4 Inch Diskette Drive Power Connectors
Pin 4, +5 Vdc
~
Pin 3, Ground Pin 2, Ground
t Pin 1, +12 Vdc Pin 4, +5 Vdc Pin 3, Ground Pin 2, Ground Pin 1, +12 Vdc
Pin 6, +5 Vdc Pin 5, +5 Vdc Pin 4, +5 Vdc Pin 3, -5 Vdc Pin 2, Ground Pin 1, Ground
o
o
o
i \
~
I~l Pin 6, Ground Pin 5, Ground , Pin 4, -12 Vdc Pin 3, +12 Vdc Pin 2, Key Pin 1, Pwr Good
Key
I
Power On/Off
System Unit
IBM Monochrome Display Power Connector
Power Connector
~
I
(Internally Switched)
....,J
E UO!l:J:lS
3-8 Power Supply
SECTION 4. KEYBOARD
Contents
Description
4-3
Block Diagram .....·.......·.·........·......···.. 4-4
Keyboard Diagrams ·......··.....·......··.·....··· 4- 5
Connector Specifications
4-12
Keyboard Logic Diagram
4-13
Keyboard 4-1
4-2 Keyboard
Description
The IBM Personal Computer keyboard has a permanently attached cable that connects to a DIN connector at the rear of the ~ system unit. This shielded 5-wire cable has power (+5 Vdc), ground, two bidirectional signal lines, and one wire used as a 'reset'line. The cable is approximately 182.88 cm (6 ft) long and is coiled, like that of a telephone handset.
The keyboard uses a capacitive technology with a microprocessor (Intel 8048) performing the keyboard scan function. The keyboard has two tilt positions for operator comfort (5- or 15-degree tilt orientation).
The keyboard has 83 keys arranged in three major groupings. The central portion of the keyboard is a standard typewriter keyboard layout. On the left side are 10 function keys. These keys are defined by the software. On the right is a 15-key keypad. These keys are also defined by the software, but have legends for the functions of numeric entry, cursor control, ~ calculator pad, and screen edit.
The keyboard interface is defined so that system software has maximum flexibility in defining certain keyboard operations. This is accomplished by having the keyboard return scan codes rather than American Standard Code for Information Interchange (ASCII) codes. In addition, all keys are typematic (if held down, they will repeat) 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
make codes. The keyboard II0 driver can define keyboard keys
as shift keys or typematic, as required by the application.
The microprocessor (Intel 8048) in the keyboard performs several functions, including a power-on self test when requested by the system unit. This test checks the microprocessor (Intel 8048) ROM, tests memory, and checks for stuck keys. Additional ~ functions are keyboard scanning, buffering of up to 16 key scan codes, maintaining bidirectional serial communications with the system unit, and executing the handshake protocol required by each scan-code transfer.
Keyboard 4-3
Several keyboard arrangements are available. These are illustrated on the following pages. For information about the keyboard routines required to implement non-U.S. keyboards, refer to the Guide to Operations and DOS manuals.
Block Diagram
8255A5
LS322
PAO-------lOH OH'
PA1
OG
PA2
OF
PA3
OE
PA4------I
PA5-------l
PA6------4
PA7------4
PB7
PB6
Keyboard
Clock Keyboard
Data Reset GND
+5V
0 0 0 0 0
1
2 3
4
5
PC LK --'--I---l
IRQ1
Keyboard Interface Block Diagram
4-4 Keyboard
Keyboard Diagrams
The IBM Personal Computer keyboard is available in six layouts: ~ · U.S. English
· U.K. English · French · German · Italian · Spanish
The following pages show all six keyboard layouts.
Keyboard 4-5
.a:..
I
c
'~"
i
· ·00
~
= ~
5[EJ18J IEJi[]i[]i[]i[]i[]1~I[Ji(JIlDi[JiLJi[JjOB01DaiCJ~O ~
,[EJrEJJ 'iDIEJJ
',O(EEllaQEJ"iEEJJjl'["s[J]r1E'EJrJ[l][1)'IE[J]rlEElJIlE[]J1r'EEJJIIE1~lr1011O0ItI[DJJ~'.'J ["]II?d[l][l][l~]1"8~ J
.~
[
r 6[EJIEJJ iuEUICJt~r[]r[]rtJrEJ1~IEJIDn:Jr[]JornlEJI(gr[Jr(Q +
luI lLLu 6if-=-'T6BF1E0JJ 1w 161r:lij[ uu57 l~
Cap.
lock
!r.Wrl~rolOtTT,
a~~.
Note: Nomenclature is on both the top and front face of keybuttons
;
as shown. The number to the upper left designates the button
position.
)
)
)
)
)
)
c
~
·
r~e.
--
i[]i[]i[] TEJIEJJ
6- (EJI- EJJ
g '[811:]
l- EJi- GJ
--
j(J
-
-
- ilJ- I[]- i[], I[]- l[]- lE- JI- []jOBQOE[ID
~~::~
U
',- to[D;E- ]IaJEfJ- EIJErJ- I[[]]l- It[JJI- rU[I]HE- ~JJTr- EEJJIl- E[J]Ir- E[J]IlE- [J]IT[- D]lfO~- ilJ 2- (8~-=L- -[7]1l- ~[r][l]- 1ID~I'- E"J~J
=I""I"I'-
~ ~
.. - -
TEJIEJJ
l- u~I- DrE- JI- EJr- []r- EJr- ~r- ~IE- JIO- T[]- T[J- J[- EJa- DI[- JI[- ]I- [Q
~
~
TEJIBJ 5QEIJj(
57
JE ~:::OlO~OlCEU :
Note: Nomenclature is on both the top and front face of keybuttons as shown. The number to the upper left designates the button
;a!
a~ . ao .
position.
"I "
-...l
17 UO!l:J3S
~ I QC
~
I
~
T- EJr- EJJ
l- EJ{- []I- []i- Ui- []i- []i- lPI- []i- []I[- ]ll- DI- CJ- lujOGOID§OlD~~= ::~= 0
~~ =
~
lEJrEJJ 'lEJlrJj
l'DOE[J;[]]atElJrl[[]JrIE[J]1[I][r)ErJ[rJrlJ'r[EJJrr~[l]DrI[]ErJ~rr[[])r'Oil[O]~~U[b]t(Ig[r][l][l]~I'["J~J
~~
6[EJIEJJ 1UE1Jr[JIEJy[Jr[JrEJrEJrEJr[JIDr[]rDJ(BaBI[gr[Jr~J - ~
6l7CnJ6!8DDJ 57 J58 lLeu il 50EAJllIU I~[ J~
Caps Lo,k
OOfO~ lO~---rr-,
~S·
Note: Nomenclature is on both the top and front face of keybuttons
9
as shown. The number to the upper left designates the button
position.
)
)
)
)
)
)
~
5t- 9FEl J61- 0FE2 JJ ll- QL2Jf- !ll:lfli- 4f.§Jl- 5~fl$l- ~6lf%~-ll7~/&- ll~8lf- 1~l9l- [~(llIO- lfU)llI- I~FllI- ~2fl?'l- 13Dl l0LnJOiJ9Er;.u:rJ~~D~:::~ ::~=!
6(EJ10J IJ(;]aEJIEJI[]I[]I[Jl[]rEJl[]TEJlEJrEJlll~]T ~ 71QI[]I[QIEJJ ~
m1tJl'[]rEJ11'JrEJlrJlEJrr~Jl[]rEJi~1I[]~km~Jl'[]"~ g "iEJIEJJ
a r 6[EJIEJJ
6l7F9816L8J0J
i~ElJl~TEJrEJr[Jr[Jr[]rEJtrJl[]r[]r[JltEIlEJI~I[JH~J
)w(Ir:u,:'Uuj[
57
n il Cap. Lock
BOIto:JlOf!rlT..~I~,
+
~It-j
~
Note: Nomenclature is on both the top and front face of keybuttons as shown. The number to the upper left designates the button
~
position.
a~ .
a Q
,, .
~
17 UO!paS
~ I
= ~
~
t
~.-.
~
i
--
5[EJIEJJ
l-EJi-[]iG-Ji-[Ji-[]it-Oi-[]i-t]i-[]I-[]l-~I-[]I-EJitEOiJ§JO~
=aQ.
6l0rE]
'rEJIEJJ
l'aD;EJ[U1'EEJJIrEEJJrI[E]JI1[0]ETJ[T][I][1]l'r[J]I1[]'l[r]J1I[[)]I1(~]flD[Di[T]~~17D1i~Ir'[JJ1I'~[I]E"J-J
~
;
"tEJ'IEJJ
l 10 67[168 LJJ F9
i5~B0Ei'J!'uID~[liJIEllViEJT57EJltJtJior010r~llECLoacpk.Tal1~E-uJnJ=eIOgt:-JJ-D-Lri-ir~l-Q!, lrl
9
Note: Nomenclature is on both the top and front face of keybuttons as shown. The number to the upper left designates the button position.
)
)
)
)
)
)
5l9FE1 J6l8uJ I'8Esc l2tfii13J/lT~l41fi~T1l5~f1$l~61j%~l17~fT1ll8!f&.lJ91f191Ol[]~"fli-urFll'3CJJ+~l'iJ0ClD9D~ ~: 1O~:::~~
6(EJJEJJ
'IEJIEJJ
,l(KEJIU]EIJ~i]ErJ~Ir[E]JrI[[]]rIE[J]il['][l]ElJ~lI1~[JJrlErlJ1I'[EJJrlp1KJ-I:D2SB~"7[1]gIr[[]]lI[~I]E"J~J
TEJIEJJ 1UELr[]I[JIEJr[Jr[Jr[]ltJIEJrDr[JrDroaEJr[gl[JI~l'·
I lL:JJ il u V 67EJ6S0 F9
[57~S 50EJI~
C··'
All
lock
SOtf:JOlO~t-~--.rl,
-0~ e=0.
~
~
ao
.~.. ~e
Note: Nomenclature is on both the top and front face of keybuttons
~
as shown. The number to the upper left designates the button
l
position.
a.
~
I I-"
I-"
V UO!paS
Connector Specifications
Rear Panel
Keyboard Connector
5-Pin DIN Connector
Pin
TTL Signal
1
+ Keyboard Clock
2
+ Keyboard Data
3
- Keyboard Reset (Not used by keyboard)
Power Supply Voltages
4
Ground
5
+ 5 Volts
Signal Level +5Vdc + 5 Vdc
Voltage 0
+ 5 Vdc
Keyboard Interface Connector Specifications
4-12 Keyboard
Keyboard Logic Diagram
"
~
!3
~
!c:.::
!!
'I'
c
!!:iii:
I
I
~ ~~
c III:!
~
'"
lit
lit
=
.-...0........
CP CP .&:.
.~
"C
~ :!
" ::I
~
g ~
~
!"
f,;; ::I
e
a:s
0
.l>:I
CP
::.=:
e:E
i
I~
~
:I
~~~~~ir--r
L---------jjr-
~!!
L....w---+---~IE-iI'
Keyboard 4-13
4-14 Keyboard
SECTION 5. SYSTEM BIOS
Contents
System BIOS Usage ...·.........·.........·....·.. 5-3
Vectors with Special Meanings ................. 5-6
Other Read/Write Memory Usage .............. 5-8
BIOS Programming Hints .................... 5-13
Adapter Cards with System-Accessible ROM
Modules ......................... '. . . . . . . .. 5-13
Keyboard Encoding and Usage ....................... 5-14
Encoding ................................. 5-14
Extended Codes ............................ 5-18
Shift States ................................ 5-19
Special Handling ........................... 5-20
Extended Functions ......................... 5-21
~
Keyboard Usage ........................... 5-22
BIOS Cassette Logic .............................. 5-25
Software Algorithms - Interrupt Hex 15 ......... 5-25
Cassette Write ............................. 5-25
Cassette Read ............................. 5-26
Data Record Architecture .................... 5-27
Error Recovery ............................ 5-28
System BIOS Listing Quick Reference
5-29
5-29
System BIOS 5-1
5-2 System BIOS
System BIOS Usage
The basic input/output system (BIOS) resides in ROM on the system board and provides device level control for the major I/O devices in the system. Additional ROM modules may be located on option adapters to provide device level control for that option adapter. BIOS routines enable the assembler language programmer to perform block (disk and diskette) or character-level I/O operations without concern for device address and operating characteristics. System services, such as time-of-day and memory size determination, are provided by the BIOS.
The goal is to provide an operational interface to the system and relieve the programmer of the concern about the characteristics of hardware devices. The BIOS interface insulates the user from the hardware, thus allowing new devices to be added to the system, yet retaining the BIOS level interface to the device. In this manner, user programs become transparent to hardware modifications and enhancements.
The IBM Personal Computer MACRO Assembler manual and the IBM Personal Computer Disk Operating System (DOS) manual provide useful programming information related to this section. A complete listing of the BIOS is given in this section.
Access to the BIOS is through the 8088 software interrupts. Each BIOS entry point is available through its own interrupt.
The software interrupts, hex 10 through hex 1A, each access a different BIOS routine. For example, to determine the amount of memory available in the system,
INT 12"
invokes the BIOS routine for determining memory size and returns the value to the caller.
System BIOS 5-3
Parameter Passing
All parameters passed to and from the BIOS routines go through the 8088 registers. The prologue of each BIOS function indicates the registers used on the call and the return. For the memory size example, no parameters are passed. The memory size, in lK-byte ~ increments, is returned in the AX register.
If a BIOS function has several possible operations, the AH register is used at input to indicate the desired operation. For example, to set the time of day, the following code is required:
MOV AU,l
;function is to set time of day.
MOV CX,UIGU_COUNT ;establish the current time.
MOV DX,LOW_COUNT
INT lAU
;set the time.
To read the time of day:
MOV AU,O
;function is to read time of day.
INT lAU
;read the timer.
Generally, the BIOS routines save all registers except for AX and the flags. Other registers are modified on return only if they are returning a value to the caller. The exact register usage is in the prologue of each BIOS function.
5-4 System BIOS
Address (Hex)
Interrupt
Number
Name
0-3
o
4-7
1
8-B
2
C-F
3
10-13
4
14-17
5
18-1 B
6
1D-1F
7
20-23
8
24-27
9
28-2B
A
2C-2F
B
30-33
C
34-37
D
38-3B
E
3C-3F
F
40-43
10
44-47
11
48-4B
12
Divide by Zero Single Step Nonmaskable Breakpoint Overflow Print Screen Reserved Reserved Time of Day Keyboard Reserved Communications Communications Disk Diskette Printer Video Equipment Check Memory
4C-4F 50-53 54-57 58-5B
5C-5F
60-63 64-67 68-6B 6C-6F 70-73 74-77 78-7B 7C-7F 100-103
104-107 168-16B 16C-16F 180-19F
13 14 15 16 17 18 19 1A 1B 1C 1D
1E
1F 40
41
5A
5B 60-67
Diskette/Disk Communications Cassette Keyboard Printer Resident BASIC Bootstrap Time of Day Keyboard Break Timer Tick Video Initialization Diskette Parameters Video Graphics Characters Diskette pointer save area for Fixed Disk
Fixed Disk Parameters Cluster Used by Cluster Program Reserved for User Proarams
8088 Software Interrupt Listing
BIOS Entry
D EOI D-EOI
NMI INT D EOI D-EOI PRINT SCREEN
D EoT
D-EOI TIMER INT KB INT
D EO!
D-EOI D-EOI D EOI DISK INT D EOI VIDEO 10 EQUIPMENT MEMORY SIZE
DETERMINE DISKETTE 10
RS232 10
CASSETTE 10 KEYBOARD 10
PRINTER iO F600:0000
BOOT STRAP TIME-OF DAY DUMMY RETURN DUMMY-RETURN VIDEO PARMS
oDISK BASE
FD TBl
DOOO:XXXX
N/A
N/A
System BIOS 5-5
Vectors with Special Meanings
Interrupt Hex 1B - Keyboard Break Address
This vector points to the code to be used when the Ctrl and Break /"""""\ keys are 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 will occur when the Ctrl and Break keys are pressed unless the application program sets a different value.
Control may be retained by this routine, with the following problems. The Break may have occurred during interrupt processing, so that one or more End of Interrupt commands must be sent to the 8259 Controller. Also, all I/O devices should be reset in case an operation was underway at that time.
Interrupt Hex 1C - Timer Tick
This vector points to the code to be executed on every system-clock tick. This vector is invoked while responding to the timer interrupt, and control should be returned through an IRET instruction. The power-on routines initialize this vector to point to an IRET instruction, so that nothing will occur unless the application modifies the pointer. It is the responsibility of the application to save and restore all registers that will be modified.
Interrupt Hex 1D - Video Parameters
This vector points to a data region containing the parameters
required for the initialization of the 6845 on the video card. Note
that there are four separate tables, and all four must be
reproduced if all modes of operation are to be supported. The
power-on routines initialize this vector to point to the parameters
contained in the ROM video routines.
~
5-6 System BIOS
Interrupt Hex IE - Diskette Parameters
This vector points to a data region containing the parameters required for the diskette drive. The power-on routines initialize the vector to point to the parameters contained in the ROM diskette routine. These default parameters represent the specified values for any IBM drives attached to the system. Changing this parameter block may be necessary to reflect the specifications of the other drives attached.
Interrupt Hex IF - Graphics Character Extensions
When operating in the graphics modes of the IBM Color/Graphics Monitor Adapter (320 by 200 or 640 by 200), the read/write character interface forms the character from the ASCII code point, using a set of dot patterns. The dot patterns for the first 128 code points are contained in ROM. To access the second 128 code points, this vector must be established to point at a table of up to 1K bytes, where each code point is represented by eight bytes of graphic information. At power-on, this vector is initialized to 000:0, and it is the responsibility of the user to change this vector if additional code points are required.
Interrupt Hex 40 - Reserved
When an IBM Fixed Disk Adapter is installed, the BIOS routines use interrupt hex 30 to revector the diskette pointer.
Interrupt Hex 41 - Fixed Disk Parameters
This vector points to a data region containing the parameters required for the fixed disk drive. The power-on routines initialize the vector to point to the parameters contained in the ROM disk routine. These default parameters represent the specified values for any IBM fixed disk drives attached to the system. Changing ~ this parameter block may be necessary to reflect the specifications of the other fixed disk drives attached.
System BIOS 5-7
Other Read/Write Memory Usage
The IBM BIOS routines use 256 bytes of memory from absolute hex 400 to hex 4FF. Locations hex 400 to 407 contain the base addresses of any RS-232C cards attached to the system. Locations hex 408 to 40F contain the base addresses of the Printer Adapter. 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.
5-8 System BIOS
Address (Hex)
80-83 84-87 88-88 8C-8F 90-93 94-97 98-9B 9C-9F AO-FF 100-17F 180-19F 1AO-1 FF 200-217 218-3C3
3C4-3FF
Interrupt (Hex)
20 21
22
23 24 25 26 27 28-3F 40-5F 60-67 68-7F 80-85 86-FO
Fl-FF
Function
DOS Program Terminate DOS Function Call DOS Terminate Address DOS Ctrl Break Exit Address DOS Fatal Error Vector DOS Absolute Disk Read DOS Absolute Disk Write DOS Terminate, Fix In Storage Reserved for DOS Reserved Reserved for User Software Interrupts Not Used Reserved by BASIC Used by BASIC Interpreter while BASIC is running Not Used
BASIC and DOS Reserved Interrupts
System BIOS 5-9
Address (Hex)
400-48F 490-4EF 4FO-4FF
Mode ROM BIOS
500-5FF
500
DOS
504 510-511 512-515 516-519
DOS BASIC BASIC BASIC
51A-51D BASIC
Function
See BIOS Listing Reserved Reserved as Intra-Application Communication Area for any application Reserved for DOS and BASIC Print Screen Status Flag Store O-Print Screen Operation Not Active or Successful Print Screen Operation 1-Print Screen In Progress 255-Error Encountered during Print Screen Operation Single Drive Mode Status Byte BASIC's Segment Address Store Clock Interrupt Vector Segment: Offset Store Break Key Interrupt Vector Segment: Offset Store Disk Error Interrupt Vector Segment: Offset Store
Reserved Memory Locations
5-10 System BIOS
If you do DEF SEG (default workspace segment):
Line number of current line being executed Line number of last error Offset into segment of start of program text Offset into segment of start of variables
(end of program text 1-1 )
Keyboard buffer contents
if O-no characters in buffer if 1-characters in buffer Character color in graphics mode Set to 1, 2, or 3 to get text in colors 1 to 3. Do not set to O. (Default == 3)
Offset (Hex Value)
2E 347 30 358
6A
4E
Example
100 Print PEEK (&H2E) + 256*PEEK (&H2F)
~
L
H
I I I 100
Hex 64
Hex 00
BASIC Workspace Variables
Length 2 2 2 2
1
1
System BIOS 5-11
Starting Address in Hex
00000 00080 00400 00500
caooo
FOOOO FEOOO
BIOS Memory Map
BIOS Interrupt Vectors
Available Interrupt Vectors
BIOS Data Area
User Read/Write Memory
Disk Adapter
Read Only Memory
Bios Program Area
5-12 System BIOS
BIOS Programming Hints
The BIOS code is invoked through software interrupts. The programmer should not "hard code" BIOS addresses into application programs. The internal workings and absolute 1"""""""\ addresses within BIOS are subject to change without notice.
If an error is reported by the disk or diskette code, you should reset the drive adapter and retry the operation. A specified number of retries should be required on diskette reads to ensure the problem is not due to motor start-up.
When altering I/O-port bit values, the programmer should change only those bits that 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 applications.
Adapter Cards with System-Accessible ROM Modules
The ROM BIOS provides a facility to integrate adapter cards with on-board ROM code into the system. During the POST, interrupt vectors 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 C8000 through hex F4000 are scanned in 2K blocks in search of a valid adapter card ROM. A valid ROM is defined as follows:
Byte 0: Byte 1: Byte 2:
Hex 55 HexAA A length indicator representing the number of 512-byte blocks in the ROM (Iength/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.
System BIOS 5-13
When the POST identifies a valid ROM, it does a far call to byte 3 of the ROM (which should be executable code). The adapter card may now perform its power-on initialization tasks. The feature ROM should return control to the BIOS routines by executing a far return.
Keyboard Encoding and Usage
Encoding
The keyboard routine provided by IBM in the ROM BIOS is responsible for converting the keyboard scan codes into what will be termed "Extended ASCII." 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.
5-14 System BIOS
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.
Key Number
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Base Case
UpperCase
Ctrl
Esc
1
2
3
4
5
6
7
8
9
0
-
=
Backspace (008)
-\(009) q w
Esc
!
@
# $
% .
& * ( )
+
Backspace (008) i-(Note 1)
Q
W
Esc -1 Nul (000) Note 1 -1 -1 -1 RS(030) -1 -1 -1 -1 US(031) -1 Del (127) -1 DCl (017) ETB (023)
Alt
-1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
-1
- 1
Note 1
Note 1
Character Codes (Part 1 of 3)
System BIOS 5-15
Key Number
18 19 20 21 22 23 24 25 26 27 28 29 Ctrl 30 31 32 33 34 35 36 37 38 39 40 41 42 Shift 43 44 45 46 47 48 49 50 51 52 53 54 Shift 55 56Alt 57 58 Caps Lock 59 60 61 62 63 64
Base Case
e r t Y u i a P [
1
CR -1 a s d f 9 h
j k I ;
-1 \ z x c v b n m
/ -1 * -1 SP -1 Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1)
UpperCase
E R T Y U I 0 P { } CR -1 A S D F G H J K L :
" -
-1
I I
Z X C V B N M
< >
? -1 (Note 2) -1 SP -1 Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1)
Character Codes (Part 2 of 3)
Ctrl
ENQ (005) DC2 (018) DC4 (020) EM (025) NAK (021) HT (009)
SI (015) DLE (016) Esc (027) GS (029) LF (010)
-1 SOH (001) DC3 (019) EOT(004) ACK (006) BEL (007) BS (008)
LF (010) VT (011) FF (012)
-1 -1 -1 -1 FS (028) SUB (026) CAN (024) ETX (003) SYN (022) STX (002) SO (014) CR (013) -1 -1 -1 -1 (Note 1) -1 SP -1 Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1)
Alt
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
- 1
- 1
- 1
- 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
- 1
- 1
-1
-1
-1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
-1
-1
-1 -1 -1 -1 SP -1 Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1)
5-16 System BIOS
Key Number
65 66 67 68 69 Num Lock 70 Scroll Lock
Base Case
Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1)
-1 -1
Upper Case
Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1)
-1 -1
Ctrl
Nul (Note 1) Nul (Note 1) Nul (Note 1) Nul (Note 1) Pause (Note 2) Break (Note 2)
Alt
Nul (Note 1) Nul (Note 1) Nul (Npte 1) Nul (Note 1)
-1 -1
Notes: 1. Refer to "Extended Codes" in this section. 2. Refer to "Special Handling" in this section.
Character Codes (Part 3 of 3)
Keys 71 through 83 have meaning orily in base case, in Num Lock (or shifted) states, or in Ctrl state. Note that the Shift key temporarily reverses the current Num Lock state.
Key
Num
Number Lock
Base Case
Alt
Ctrl
71
7
Home (Note 1)
72
8
t (Note 1)
-1
Clear Screen
-1
-1
73
9
Page Up (Note 1)
-1
Top of Text and Home
74
-
------------------------
-1
-1
75
4 -(Note 1)
-1
Reverse Word (Note 1)
76
5
-1
-1
-1
77 78 79
6 + 1
,-(Note 1) + End (Note 1)
80
2
(Note 1)
-1
Advance Word (Note 1)
-1
-1
-1
Erase to EOL (Note 1)
-1
-1
81
3
Page Down (Note 1) -1
Erase to EOS (Note 1)
82
0
Ins
-1
-1
83
Del (Notes 1,2)
Note 2
Note 2
Notes: 1. Refer to "Extended Codes" in this section. 2. Refer to "Special Handling" in this section.
System BIOS 5-17
Extended Codes
Extended Functions
For certain functions that cannot be represented in the standard ASCII code, an extended code is used. A character code of 000 (Nul) is returned in AL. This indicates that the system or application program should examine a second code that will indicate the actual function. Usually, but not always, this second code is the scan code of the primary key that was pressed. This code is returned in AH.
Second Code
3 15
16-25 30-38 44-50 59-68 71 72 73 75
77 79 80
81 82 83 84-93 94-103 104-113 114 115 116 117 118 119 120-131 132
Function
-Nul Character
Alt Q, W, E, R, T, Y, U, I, 0, P
AltA, S, D, F, G, H, J, K, l
AltZ, X, C, V, B, N, M
F1 to F10 Function Keys Ba!,e Case
Home
-tPage Up and Home Cursor
End
~
Page Down and Home Cursor
Ins (Insert)
Del (Delete)
F11 to F20 (Uppercase F1 to F10)
F21 to F30 (Ctrl F1 to F1 0)
F31 to F40 (Alt F1 to F10)
Ctrl PrtSc (Start/Stop Echo to Printer)
Ctrl-(Reverse Word)
Ctrl-(Advance Word)
Ctrl End [Erase to End of line (EOl)]
Ctrl PgDn [Erase to End of Screen (EOS)]
Ctrl Home (Clear Screen and Home)
Alt 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, = (Keys 2-13)
Ctrl PgUp (Top 25 Lines of Text and Home Cursor)
Keyboard Extended Functions
5-18 System BIOS
Shift States
Most shift states are handled within the keyboard routine, transparent to the system or application program. In any case, the current set of active shift states is available by calling an entry ~ point in the ROM keyboard routine. The key numbers are shown on the keyboard diagram in Section 4. The following keys result in altered shift states:
Shift
This key temporarily shifts keys 2-13,15-27,30-41,43-53,55, 59-68 to uppercase (base case if in Caps Lock state). Also, the Shift -key temporarily reverses the Num Lock or non-Num-Lock state of keys 71-73, 75, 77, and 79-83.
Ctrl
This key temporarily shifts keys 3, 7, 12, 14, 16-28,30-38, ~ 43-50,55,59-71,73,75,77,79, and 81 to the Ctrl state. Also,
the Ctrl key is used with the Alt and Del keys to cause the system reset function, with the Scroll Lock key to cause the break function, and with the Num Lock key to cause the pause function. The system reset, break, and pause functions are described in "Special Handling" on the following pages.
Alt
This key temporarily shifts keys 2-13, 16-25, 30-38, 44-50, and 59-68 to the Alt state. Also, the Alt key is used with the Ctrl and Del keys to cause the "system reset" function described in "Special Handling" on the following pages.
The Alt key has another use. This key allows the user to enter any ASCII character code from 0 to 255 into the system from the keyboard. The user holds down the Alt key and types the decimal value of the characters desired using the numeric keypad (keys 71-73, 75-77, and 79-82). The Alt key is then released. If more than three digits are typed, a modulo-256 result is created. These
System BIOS 5-19
three digits are interpreted as a character code and are transmitted through the keyboard routine to the system or application program. Alt is handled within the keyboard routine.
Caps Lock
This key shifts keys 16-25,30-38, and 44-50 to uppercase. Pressing the Caps Lock key a second time reverses the action. Caps Lock is handled within the keyboard routine.
ScroD Lock
This key is interpreted by appropriate application programs as indicating that use of the cursor-control keys should cause windowing over the text rather than cursor movement. Pressing the Scroll Lock key a second time reverses the action. The keyboard routine simply records the current shift state of the Scroll Lock key. It is the responsibility of the system or application program to perform the function.
Shift Key Priorities and Combinations
If combinations of the Alt, Ctrl, and Shift keys are pressed and only one is valid, the precedence is as follows: the Alt key is first, the Ctrl key is second, and the Shift key is third. The only valid combination is Alt and Ctrl, which is used in the system reset function.
Special Handling
System Reset
The combination of the Alt, Ctrl, and Del keys will result in the keyboard routine initiating the equivalent of a system reset. System reset is handled within the keyboard routine.
5-20 System BIOS
Break The combination of the Ctrl and Break keys will result in the keyboard routine signaling interrupt hex lA. Also the extended
characters (AL = hex 00, AH = hex 00) will be returned.
Pause The combination of the Ctrl and Num Lock keys will cause the keyboard interrupt routine to loop, waiting for any key except the Num Lock key to be pressed. This provides a system- or application-transparent method of temporarily suspending list, print, and so on, and then resuming the operation. The "unpause" key is thrown away. Pause is handled within the keyboard routine.
Print Screen The combination of the Shift and PrtSc (key 55) keys will result in an interrupt invoking the print screen routine. This routine works in the alphanumeric or graphics mode, with unrecognizable characters printing as blanks.
Extended Functions
The keyboard routine does its own buffering. The keyboard buffer is large enough that few typists will ever fill it. However, if a key is pressed when the buffer is full, the key will be ignored and the "bell" will sound. Also, the keyboard routine suppresses the typematic action of the following keys: Ctrl, Shift, Alt, Num Lock, Scroll Lock, Caps Lock, and Ins.
System BIOS 5-21
Keyboard Usage
This section is intended to outline a set of guidelines of key usage when performing commonly used functions.
Function
Key(s)
Home Cursor
Home
Return to outermost menu Move cursor up Page up, scroll backward 25 lines and home Move cursor left Move cursor right Scroll to end of text Place cursor at end of line
Home
t
PgUp
-
-Key 75 End
Move cursor down
Page down, scroll forward 25 lines and home
+
Pg Dn
Start/Stop insert text at cursor,
Ins
shift text right in buffer
Delete character at cursor
Del
Destructive backspace
_Key 14
Tab forward Tab reverse
-J
I~
Clear screen and home Scroll up Scroll down Scroll left Scroll right
Ctrl Home
t
-+
~
Delete from cursor to EOL
Ctrl End
Exit/Escape
Esc
Start/Stop Echo screen to printer
Ctrl Prt Sc
(Key 55)
Delete from cursor to EOS
Ctrl PgDn
Advance word
Ctrl ~
Reverse word
Ctrl_
Window Right
Ctrl..-
Window Left
Ctrl-
Enter insert mode
Ins
Comment Editors; word processors Menu driven applications Full screen editor, word processor Editors; word processors
Text, command entry Text, command entry Editors; word processors
Full screen editor, word processor Editors; word processors
Text, command entry
Text, command entry Text, command entry Text entry Text entry Command entry In scroll lock mode In scroll lock mode In scroll lock mode In scroll lock mode Text, command entry Editor, 1 level of menu, and so on Anytime
Text, command entry Text entry Text entry When text is too wide to fit screen When text is too wide to fit screen Line editor
Keyboard - Commonly Used Functions (Part 1 of 2)
5-22 System BIOS
Function Exit insert mode Cancel current line Suspend system (pause)
Break interrupt System reset
Top of document and home cursor Standard function keys Secondary function keys
Extra function keys
Extra function keys
Key(s)
Comment
Ins Esc Ctrl Num Lock
Ctrl Break
Alt Ctrl
Del
Ctrl PgUp
Line editor Command entry, text entry Stop list, stop program, and so on Resumes on any key Interrupt current process Reboot
Editors, word processors
° F1 -F1 ° Shift F1 -F1 ° Ctrl F1 -F1
Alt F1-F10
Primary function keys
Extra function keys if 10 are not sufficient
Alt Keys
Used when templates are put
2-13
along top of keyboard
(1 -9,0,-, =)
AltA-Z
Used when function starts with same letter as one of the alpha keys
Keyboard - Commonly Used Functions (Part 2 of 2)
System BIOS 5-23
Function
Carriage return Line feed Bell Home Cursor up Cursor down Cursor left Cursor right Advance one word Reverse one word Insert Delete Clear screen Freeze output Tab advance Stop execution (break) Delete current line Delete to end of line Position cursor to end of line
Key
.....J Ctrl.....,J Ctrl G Home
--~ t
CtrlCtrlIns Del Ctrl Home Ctrl Num Lock --j Ctrl Break Esc Ctrl End End
BASIC Screen Editor Special Functions
Function
Suspend Echo to printer
Stop echo to printer
Exit current function (break)
Backspace Line feed Cancel line Copy character Copy until match Copy remaining Skip character Skip until match Enter insert mode Exit insert mode Make new line the template String separator in REPLACE End of file in keyboard input
Key
Ctrl Num Lock Ctrl PrtSc (Key 55 any case) Ctrl PrtSc (Key 55 any case) Ctrl Break -Key 14 Ctrl--.J Esc F1or_ F2 F3 Del F4 Ins Ins F5 F6 F6
DOS Special Functions
5-24 System BIOS
BIOS Cassette Logic
Software Algorithms - Interrupt Hex 15
The cassette routine is called by the request type in AH. The address of the bytes to be read from or written to the tape is specified ES:BX and the number of bytes to be read or written is
specified by ex. The 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 AH = 0 AH = 1 AH = 2
AH = 3
Function
Turn Cassette Motor On Turn Cassette Motor Off Read Tape Block
Read CX bytes into memory starting at Address ES:BX Return actual number of bytes read in DX Return Cassette Status in AH Write Tape Block Write CX bytes onto cassette starting at Address DS:BX Return Cassette Status in AH
Cassette Status
AH = 00 AH = 01 AH = 02 AH = 04 AH = 80
Description
No Errors Cyclic Redundancy Check (CRC) Error in Read Block No Data Transitions No Leader Invalid Command
Notes: The carry flag will be set on any error.
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 a synchronization bit(O) and then writes the leader(256 bytes of all l's) to the tape. Next, the routine writes the number of data
System BIOS 5-25
blocks specified by ex. After each data block of 256 bytes, a
2-byte cyclic redundancy check (eRe) is written. The data bytes
are taken from the memory location pointed at by ES.
The write-byte routine disassembles and writes the byte a bit at a
time to the cassette. The method used is to set Timer 2 to the
period of the desired data bit. The timer is set to a period of 1.0-ms for a I bit and 0.5-ms for a 0 bit.
,.,-.....,
The timer is set 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 bit written to the
cassette. If the number of data bytes to be written is not an
integral multiple of 256, then, after the last desired data byte from
memory has been written, the data block is extended to 256 bytes
of writing multiples of the last data byte. The last block is closed
with two eRe bytes as usual. After the last data block, a trailer
consisting of four bytes of alII bits is written. Finally, the
cassette motor is turned off, if there are no errors reported by the
routine.
1+--250 fJS ~
Zero Bit
1~4--- 500 fJS ---~.I
'----_----'I .
-
One Bit
~14---------------1000fJs--------------~·1
Cassette Read
The read-block routine turns on the cassette drive motor and then delays for about 0.5 second to allow the motor to come up to speed.
The read-block routine then searches for the leader and must detect alII 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
5-26 System BIOS
sync byte (ASCII character hex 16) is read. If the sync byte is read correctly, the data portion can be read. If a correct sync byte is not found, the routine goes back and searches for the leader again. The data is read a bit at a time and assembled into bytes. After each byte is assembled, it is written into memory at location ES:BX and BX is incremented by 1.
After each multiple of 256 data bytes is read, the CRC is read and compared to the CRC generated. If a CRC error is detected, the routine exits with the carry flag set to indicate an error and the status of AH set to hex 01. DX contains the number of bytes written to memory.
The time of day interrupt(IRQO) is disabled during the cassette-read operation.
Data Record Architecture
The write-block routine uses the following format to record a tape block onto a cassette tape.
Component
Leader Sync Bit Sync Byte Data Blocks CRC
Description
256 Bytes (of All 1's) One 0 Bit ASCII Character Hex 16 256 Bytes in Length 2 Bytes for each Data Block
Data Record Components
System BIOS 5-27
Error Recovery Error recovery is handled through software. A eRe is used to
detect errors. The polynomial used is G(X) = X16+X12+X5+ 1, which is the polynomial used by the synchronous data link control interface. Essentially, as bits are written to or read from the
cassette tape, they are passed through the eRe register in
software. After a block of data is written, the complemented
value of the calculated eRe register is written on the tape. On reading the cassette data, the eRe bytes are read and compared to the generated eRe value. If the read eRe does not equal the generated eRe, the processor's carry flag is set and the status of AH is set to hex 01, which indicates a eRe error has occurred. The routine is exited on a eRe error.
5-28 System BIOS
System BIOS Listing
1"'""'\ Quick Reference
System ROM BIOS
Equates
8088 Interrupt Locations
Stack
Data Areas
Power-On Self-Test
Boot Strap Loader
I/O Support
Asynchronous Communications
(RS-232C)
~
Keyboard
Diskette
Printer
Display
System Configuration Analysis
Memory Size Determination
Equipment Determination
Cassette II0 Support
Graphics Character Generator
Time of Day
Print Screen
Page
Line Number
5-30
12
5-30
34
5-30
66
5-30
74
5-33
229
5-49
1493
5-50 5-54 5-64 5-74 5-75
5-101 5-101 5-102 5-108 5-110 5-112
1551
1818
2426
3201
3327
5177
5208
5253
5769
5903
6077
System BIOS 5-29
LOC OBJ
0060 0061 0062 0063 0020 0021 0020 0040 0043 0040 0001 0008 0000 0540 0410 0060 0002 0060 0061
0000 0008 0008 0014 0014 0020 0020 0020 0040 0040 0074 0074 0060 0060 0078 0078 007C 007C 0100 0100 ???? 0102 0400 0400 0400 7COO 7COO
0000 (128
0100
LINE SOURCE
$TITLEI BIOS FOR IBM PERSONAL COHPUTER)
5---------------------------------------------------------------
THE BIOS ROUTINES ARE MEA.NT TO BE ACCESSED THROUGH
SOFTWARE INTERRUPTS ONLY. ANY ADDRESSES PRESENT IN
THE LISTINGS ARE INCLUDED ONLY FOR COMPLETENESS,
NOT FOR REFERENCE. APPLICATIONS WHICH REFERENCE
ABSOLUTE ADDRESSES WITHIN ntE CODE SEGMENT
VIOLATE THE STRUCTURE AHO DESIGN OF BIOS.
10
; ----- -- ----.------------------------------------ - - -------------
11
12
1------- --------------------------------
13
EQUATES
14
1.15
PORT.A PORT.B
17
PORT.C
18
I'
INT.6.00
20
INTAOI
21
EOl
22
TIMER
21
TItCCTL
24
TINERO
25
THINT
26 aHAoe
27
DM'
28
tlAX.PERlOO
2.
I1IN_PERIOD
10
KBD_IN
II
KBOINT
EOU 6."
EQU
61"
EQU
62"
EQU
61"
EQU
20"
EOU
21"
EOU EQU
""40"
EQU
41"
EOU 4'"
EOU
01
EOU
08
EOU
00
EOU
540H
EOU
410H
EOU
60"
EOU
02
; 8255 PORT A. AD DR I 8255 PORT B AOOR 1 8255 PORT C AOOR
J 8259 PORT I 8259 PORT
; 8253 TIMER CONTROL PORT ADDR ; 8253 TIMER/CNTER 0 PORT ADDR ; TIMER a INTR RECVD MASK 1 DHA STATUS REG PORT ADDR ; DMA CHANNEL 0 ADDR REG PORT ADDR
1 KEYBOARD DATA IN ADOR PORT ; KEYBOARD INTR MASK
12
KB_OAU
II
KB_CTl
EOU
60"
EQU .1"
; KEYBOARD SCAN COOE PORT i CONTROL BITS fOR KB SENSE DATA
34
; ...--------------------------------------
35
8088 INTERRUPT LOCATIONS
3. 1---------------------------------------
31
ABSO
SEGMENT AT 0
18
STG_lOCO
LABEL BYTE
39
ORG
2*4
40
LABEL WORD
41
ORG
5*4
42
LABEL WORD
41
ORG
8*4
44
LABEL WORD
45
LABEL aWORD
46
ORG
10H*4
47
YIDEO_INT
LABE L WORD
48
4.
PARH_PTR
DRG LABE L
10H*4 DWORD
I POINTER TO YIDEO PARHS
50
ORG
18H*4
51
BASIC_PTR
LABE L WORD
ENTRY POINT fOR CASSETTE BASIC
52
ORG
01£H*4
53
DISK_POINTER
LABEL OWORD
INTERRUPT lEH
54
ORG
01FH*4
55
EXT_PTR LABEL DWORD
I LOCATION Of POINTER I POINTER TO EXTENSION
56
OR.
57
IO_ROM_INIT
DW
58
IO_R0M.-SEG
5.
DW
ORG
400H
M
DATA_AREA
L6.BEL BYTE
61
DATA_WORD
LABEL WORD
I ROlTTINE ; OPTIONAL ROM SEGMENT I ABSOLUTE LOCATION OF DATA. SEGMENT
62
.1
64
ABSO
.5
ORG LABEL EHIlS
7caCH FAR
66
1------------------------------------------ - ----------- -
67
STACK -- USED DURING INITIALIZATION ONLY
68
1------- - - -------------------------------- - ------- ------
69
STACK
SEGMENT AT 30H
70
DW
71
TOS
LABEl WORD
72
STACK
ENDS
13
74
,-------------------------- -------- -----
75
ROM BIOS DATA AREAS
76 1---------------------------------------
77
DAU
SEGMENT AT 40H
5-30 System BIOS
LOC OBJ
0000 {4
0008 (4
0010 ???1 0012 ?? 0013 1111 0015 ?11?
0017 ??
0080 0040 0020 0010 0008 0004 0002 0001
0018 ??
0080 0040 0020 0010 0008
0019 11 QOlA 11?1 ODIC ???? ODIE (16
003E
0045 0046
,,3&
0010 003A 002A 0036 0052 0053
003E 1?
0080 G03F 11
0040 ?? 0025
0041 11 0080 0040 0020 0010 0009 0008 0004 0003 0002
LINE SOURCE
7. 7.
ow
4 DUPI!)
4 DUP(?I
I ADDRESSES OF RS232 ADAPTeRS I ADDRESSES OF PRINTERS
.0
e1
e2
e,
84 85
86 e7
ee
..8.,9
n
.,
.94
'5
.7
····
100 101 10. 10' 10. 105 106 107 lOe 10'
"'111
OW
I INSTAlLED HARDWARE
DB
MEMORY_SIZE
OW
IO.RAN.SIZE
OW
I INITIALIZATION FLAG
; MEMORY SIZE IN K BYTES
I MEMORY IN I/O CHANNEL
; - - -------------------------------------
KEYBOARD DATA AREAS
; - --------------------------------------
KBJLAG
DB
;----- SHIFT FLAG EQUATES WITHIN K8.FlAG
INS_STATE
EQU
.OH
CAPS_STATE
EQU
40H
NUM_STA.TE
EQU
,OH
SCROll..STATE
EQU
10H
ALT_SHIFT
EQU
oeH
CTl_SHIFT LEFT_SHIFT
EQU
'4H
EQU
O2H
RIGHT_SHIFT
EQU
OlH
I INSERT STATE IS ACTIVE I C.6.PS LOCK STATE HAS BEEN TOGGLED
; HUH LOCK STATE HAS BEEN TOGGLED
I SCROLL LOCK STATE HAS BEEN TOGGLED
I ALTERNATE SHIFT KEY DEPRESSED
I COKTROL SHIFT KEY DEPRESSED
I lEft SHIFT KEY DEPRESSED
I RIGHT SHIft KEY DEPRESSED
DB
I SECON] BYTE Of KEYBOARD STArus
INS_SHIFT
EQU
e'H
CAPS_SHIFT
EQU
4'H
NUt,-SHIFT
EQU
20H
SCROLI..-SHIFT
EQU
lOH
HOLD_STATE
EQU
,eH
I INSERT KEY IS DEPRESSED I CAPS lOCK KEY IS DEPRESSED I HUt lOCK KEY IS DEPRESSED ; SCrfOll LOCK KEY IS DEPRESSED I SUSPEND KEY HAS BEEN TOGGLED
ALT_INPUT
DB
BUFFER_HEAD
OW
BUFFER_TAll
OW
KB_BUFFER
OW
16 DUPI?J
; STORAGE FOR ALTERNATE KEYPAD EKTRY I POINTER TO HEAD OF KEYBOARD BUFfER I POINTER TO TAIL OF KEYBOARD BUFFER
I ROOM FOR 15 ENTRIES
112
11'
114
J----- HEAD = TAll UIJICATES THAT THE BUFFER IS EMPTY
115
11.
NUM_KEY
117
EQU
6'
EOU
70
; SCAN COOE FOR NUMBER LOCK I SCROLL LOCK KEY
l1e
ALT_KEY
11.
CTL1EY
120
CAPS_KEY
EQU
56
EQU 2.
EOU 5.
I ALTERNATE SHIFT KEY SCAN COOE I SCAN CODE FOR CONTROL KEY I SCAN CODE fOR SHIFT LOCK
121
LEFT_KEY
12.
RIGHT_KEY
123
INS_KEY
124
DEl.-KEY
EOU EQU EQU
.,42
54
EOU
J SCAN CODE FOR LEFT SHIft I SCAN CODE FOR RIGHT SHIFT I SCAN CODE FOR INSERT KEY I SCAN CODE FOR DELETE KEY
125
126 1---------------------------------------
127
DISKETTE DATA AREAS
12. J---------------------------------------
129
SEE~STATUS
DB
..0
131
; DRIVE RECALIBRATION STATUS
BIT 3-0 = DRIVE 3-0 NEEDS RECAL BEF()f;!E NEXT SEEK IF BIT IS = 0
132
INTJLAG
EQU
oeOH
I INTERRUPT OCCURRENCE FLAG
133
MOTOR_STATUS
08
I MOTOR STATUS
134
BIT 3-0 = DRIVE 3-0 IS CURRENTlY RUNNING
135
BIT 7 = CURRENT OP IS A WRITE. REQUIRES DELAY
136
MOT()f;!_COUNT
DB
; TINE OUT COUNTER FOR DRIVE TURN OFF
137
MOTOR_WAIT
13e
EQU '7
; TWO SEe Of COUNT FOR MOTOR TURN OFF
13.
DISKETTE_STATUS DB
I BYTE OF RETURN CODE INFO FOR STATUS
14'
TIME_OUT
141
BAD_SEEK
142
BAD_NEe
EQU "H
EQU
4'H
EQU
20H
; ATTACHMENT FAILED TO RESPOND ; SEEK OPERATION FAILED I NEC CONTROLLER HAS FAILED
14'
BAD_CRe
EQU
10H
144
DNA_BOUNDARY
EQU
ooH
; BAD CRC ON DISKETTE READ ; ATTEMPT TO DHA ACROSS 64K BOUNDARY
145
BAD_DI1A.
EQU
,eH
I DMA oVERRLtI ON OPERATION
146
RECORD_NOTJND EQU
'4H
147
WRITE_PROTECT EQU
03H
I REQUESTED SECTOR HOT FOUND I WRITE ATTEMPTED ON WRITE PROT DISK
14.
BAD_ADDR_HARK EQU
O2H
I ADDRESS HARK HOT FOlNJ
System BIOS 5-31
LaC OBJ 0001
0042 (7
0049 ?? 004A 1111 004C 1111 004E 1111 0050 18 0060 ???? 0062 ?? 0063 1111 0065 11 0066 1?
0067 1111 0069 1111 006B 11
OObC ???? 006E 11?? 0070 11
0071 11 0072 1111
0074 ???? 0076 1??1
0078 {4 D07C (4
0080 1111 0082 ????
0000 ??
LINE SOURCE
149 150 151
EOU
01H
DB
7 aUP!? I
; BAD COI'fWI) PASSED TO DISKETTE I/O I STATUS BYTES FROt1 NEt
15.
153
; ------------ - ------------------------
154
VIDEO DISPLAY DATA AREA
155
; ----- - - --------- ... --------------------
156
CRT_MODE
DB
j CURRENT CRT HOOE
157
CRT_eOLS
ow
158
CRT_LEN
OW
,I NUMBER OF COLUMNS ON SCREEH LENGTH OF REGEN IN BYTES
159
CRT_START
OW
; STARTING ADDRESS IN REGEN BUFFER
160
:URSOR_POSN
ow
8 CUP!?)
I CURSOR FOR EACH OF UP TO 8 PAGES
161
CURSOR_HODE
OW
16'
ACTIVE_PAGE
D.
16'
ADDR_6845
OW
164
CRT_MODE_SET
DB
j CURRENT CURSOR MOOE SETTIHG I CURRENT PAGE BEING DISPLAYED I BASE ADDRESS FOR ACTIVE DISPLAY CARD I CURRENT SETTING OF THE 3X8 REGISTER
16S
CRT_PALETTE
DB
; CURRENT PALETTE SETTING COLOR CARD
166
167
J ----------- ---------------------------
168
CASSETTE DATA AREA
169 ;---------------------------------------
170
EDGE_tNT
ow
; TIME COUNT AT DATA EDGE
171
OW
; CRC REGISTER
17.
DB
In
; LAST INPUT YAWE
174
; ---------------------------------------
175
TIMER DATA AREA
176 1----------------------------------------
177
TIMER_LOW
ow
i LOW WORD OF TIMER COUNT
178
TIMER_HIGH
OW
; HIGH WORD OF TIMER tOUNT
179
TIMER_On
DB
1 TIMER HAS ROLLED OVER SINCE LAST READ
180
;COUNTS_SEC
EQU
I.
181
;COUNTS_MIN
EOU
1092
18'
,COUNTS_HOUR
EOU
65543
183
!COUNTS_DAY
EOU
1573040 = 1800BOH
184
185
; ------ --------------------------------
186
SYSTEM DATA AREA
187
;---- - --------------------------------
188
BIOS_BREAK
DB
I BIT 7 :;: 1 IF BREAK KEY WAS DEPRESSED
189
RESET_FLAG
OW
; WORD:;: 1234H IF KB RESET UNOERWAY
190
; ---------------- ______________________ _
191
FIXED DISK DATA AREA
19. ;---------------------------------------
193
OW
194
OW
195
J---------------------------------------
196
I
PRINTER AHO RS212 TIMEOUT CTPS :
197 J---------------------------------------
19.
PRINT_TIM_OUT DB
4 DUP[?)
; PRINTER TIME OUT COUNTER
199
4 DUPe? I
; RS21Z TIHE OUT COlJIfTER
200
; ---------------------------------- - --
201
EXTRA KEYBOARD DATA AREA
202
; --- -----------------------------------
,OJ
BUFFER_START ow
204
BUFFER_EHO
DW
Z05
DATA
ENDS
206
; - - - - - --------------------------------
207
EXTRA DATA AREA
208
; - - - - --------------------------------
20'
XXDATA
SEGMENT AT SOH
'10
STATUS_BYTE
DB
'11
XXOATA
ENDS
'"211
1------------------ ____________________ _
214
VIDEO DISPLAY BUFFER
215
J-------------------------------- - - ---
216
VIDEO_RAM
SEGMENT AT OBSOOH
5-32 System BIOS
r"\
LOC OBJ
0000 0000 0000 116384
DODO 157344
EOOO 31353031343736 20tt34FS052ZE20 49424020313938
"
£016 DIED
E018 E018 890040 E018 EOIB Fe EOIC 8BD9 £OlE 88AAAA E021 BASSFF E024 2BFF E026 F3 E027 AA E028 E028 4F £029 FD [OlA E02A 8BF7 E02e BBce E02E E02E AC E02F 32C4 E031 752.5 E033 6ACZ E035 AA E036 E2F6 E036 22.E4 E03A 7416 f03e 6AEO £03E 66F2 E040 22£4 E042 7504 £044 6A04 £046 fBEO E048
LINE SOURCE
217
REGEN
218
REGENW
219
LABEL LABEL DB
BYTE WORD 16364 DUPI?)
220
ENDS
2. 21
i ------------------------- -- - - -- -- ------
222
ROM RESIDENT CODE
223 ,-----------------------._--------------
224
CODE
SEGMENT AT OFOOOH
225
08
57344 DUPI?)
226
227
DB
'1501476 COPR. IM 19,r,l'
I FIll LOWEST 56K ; COPYRIGHT NOTICE
228
2. 29
; ---------------------------------------------------------------
230
INITIAL J?HIABIllTY TESTS -- PHASE 1
231
; --------------- - - ------------------------- ---------------------
232
ASSUNE
CS:tODE. SS :CODE.ES;ABSD.DS:DATA
233
; ---------- ----------- - --- -- - -- - -- ------
234
DATA DEFINITIONS
235 1---------------------------------------
236
Cl
OW
Cll
I RETURN ADDRESS
237
2:36 1-----------------------------------------------------------------------
239
THIS SUBROUTINE PERFORMS A REAO/WR'ITE STORAGE TEST ON
240
1
A 16K BLOCK OF STORAGE.
241
; ENTRY REQUIREMENTS:
242
ES = ADDRESS OF STORAGE SEGMENT BEING TESTED
243
OS l: ADDRESS OF STORAGE SEGMENT BEING TESTED
244
WHEN EHTERING AT STGTST_CHT, CX MUST BE LOADED WITH
245
THE BYTE; COUNT.
246
EXIT PARAMETERS:
247
= ZERO FLAG 0 IF STORAGE ERROR IDATA COMPARE OR PARITY CHECK.
2:48
AL = 0 DENOTES A PARITY C!-IECK. ELSE AL=xOR'ED'BIT
2:49
PATTERN OF THE EXPECTED DATA PATTERN 'IS THE
2:50
ACTUAL DATA READ.
251
AX,BX,CX,DX,OI, AND SI ARE ALL DESTROYED.
252 1----------------------------..------------------------------------------
253
254
5TGT5T PROt
NEAR
Z55
MOV
tX.4000H
1 SETUP CNT TO TEST A 16K BLK
256
STGTST_Ctrr:
257
eLD
Z58
MOV
BX,cx
I SET OIR flAG Tn INCREMENT i SAVE BYTE CNT (4K FOR VIDEO OR 16K)
Z59
HOV
AX.DAAAAH
; GET DATA PATTERN TO WRITE
26.
I10V
DX.OFF55H
; SETUP OTHER DATA. PATTERNS TO USE
261
SU>
01,01
1 01 = OFFSET 0 RELATIVE TO ES REG
262
REP
STOSS
; WRITE STORAGE LOCATIONS
Z63
C3:
Z64
DEC
Dr
265
.TD
266
C4:
Z67
HOV
51,01
268
HOV
CX,BX
269
CS:
270
LOOSB
271
XOR
AL,AH
272
JNE
e7
273
HOV
AL,OL
274
STOSB
Z75
LOOP
e5
276
277
AND
AH.AH
278
JZ
e6X
279
HOV
AH,AL
280
XCHG
DH,DL
281
AND
AH,AH
Z82
JNZ
C6
283
HOV
OL.AH
28'
JHP
e3
285
C6:
I STGOI ; POINT TO LAST BYTE JUST WRITTEN ; SET OIR FLAG TO GO BACKWARDS
; SETUP BYTE CNT I INNER TEST LOOP I READ OLD TST BYTE FROM STORAGE (511+ ; DATA READ AS EXPECTED? ; NO - GO TO ERROR ROUTINE ; GET NEXT DATA' PATTERN TO WRITE ; WRITE INTO LOCATIOH JUST READ (011+ I DECREMENT BYTE COUNT AND LOOP CX
HIDING ZERO PATTERN }o.'RITTEN TO STG ? ; YES - RETURN TO CAlLER WITH AL=O ; SETUP NEW VALUE FOR COMPARE ; MOVE NEXT DATA PATTERN TO DL 1 READING ZERO PATTERN THIS PASS? J CONTINUE TEST SEQUENCE TIll ZERO DATA
ELSE SET ZERO FOR END READ PATTERN ; AND MAKE FINAL BACKWARDS PASS
System BIOS 5-33
LaC OBJ
E048 Fe E049 47 E04A 740E E04C 4F E040 8A.0100
E050 E806 E052 E052 £462 E054 24CO E056 BODO EOS8 E058 Fe £059 C3
Eose
E058 E058 E058 FA. EOSC 8405 E05E 9£ E05F 734C f061 754A ED63 7648 E065 7946 E067 9F E066 8105 E06A DlEC E06C 733F E06E 8040 E070 ODED E072 7139 E074 32E4 E076 9E E077 7634
E079 7832 E07B 7A30 f07D 9F E07£ 8105 E080 DlEC E082 7229 E084 00E4 £086 702S
E088 B8FFFf E088 F9 E06C Eoec 8E08 E08E eCDB E090 8EC3 E092 8CCI E094 8EOI £096 8C02 E098 8BE2 E09" 8BEt E09C 8BF5 E09E SBFE EOAO 7307 EOA2 33C7 E0A4 7507 £0.1.6 Fa EOA7 EBEl EOA9 EOA9 OBC7 EOAB 7401 EOAO F4
LINE SOURCE
2··
CLD
2.7
INC
01
; SET DIR FLAG TO 60 FORWARD ; SET POINTER TO BEG LOCATION
2··
JZ
C4
; READIWRITE FORWARD IN STG
2· ·
DEC
01
2.D
HOV
DX,OOOOlH
; ADJUST POINTER I SETUP 01 FOR PARITY BIT
2'1
2'2
J". C3
293
C6X:
; At«) 00 FOR EtI) I READIWRITE BACKWARD IN STG
294
IN
AL,PORT_C
295
AND
AL.OCOH
296
"0" Al,OOOH
297
C7:
; DID A PARITY ERROR OCCUR ?
I ZERO flAG WILL BE Off PARITY ERROR
I Al=O DATA COMPARE OK
29.
CLD
; SET DEFAULT OIRelli flAG BACK TO INC
299
RET
300
51GT5T EHOP
301
1----------------.--------------------------.---- ---------------
302
I
808e PROCESSOR TEST
303
, DESCRIPTION
304
VERIFY 8088 FUGS, REGISTERS AND CONDITIONAL JUMPS
305 1---------------------------------------------------------------
3D6
ASSUME CS: CODE. DS: NOTHING. ES: NOTHING. 55: NOTHING
3D7
ORG
DEOS8H
3D.
RESET LABEl FAR
3D. START:
310
eLI
I DISABLE INTERRUPTS
311
HOY AH,ODSH
; SET SF. CF. ZF I AtIJ AF FLAGS ON
312
SAHF
313
JNC ERROl
31~
JNZ ERROl
I GO TO ERR ROUTINE IF CF NOT SET I GO TO ERR ROUTINE IF ZF NOT SET
315
JNP
ERROl
; GO TO ERR ROUTINE IF PF HOT SET
31.
JNS
ERROl
317
LAHF
31.
HOV eL.S
I GO TO ERR ROUTINE IF SF I«)T SET I LOAD FLAG IMAGE TO AH ; LOAD CNT REG WITH SHIFT CHY
319
SHR AH.CL
~ SHIFT AF INTO CARRY BIT POS
320
JHC ERROl
; GO TO ERR ROUTINE IF AF HOT SET
321
MOV AL.40H
322
SHL AL.I
; SET THE OF FLAG ON , SETUP FOR TESTING
323
Jt.IO ERROl
I GO TO ERR ROUTINE IF OF NOT SET
324
XOR
AH.AH
,SETAH=O
325
SAHF
; CLEAR SF, eF. ZF, AND PF
326
JBE ERROl
""7.
JS
ERROl
329
JP
ERROl
; GO TO ERR ROUTINE IF CF ON j OR TO TO ERR ROUTINE IF ZF ON ; GO TO ERR ROUTINE IF SF ON I GO TO ERR ROUTINE IF PF ON
330
LAHF
, LOAD F LAG IMAGE TO AH
331
MOV CL.S
J LOAD tNT REG WITH SHIFT CNT
332
SHR AH.CL
~ SHIFT 'AF' INTO CARRY BIT POS
333
JC
ERROl
J GO TO ERR ROUTINE IF ON
334
SHL AHoI
J CHECK THAT 'OF' IS CLEAR
335
JO
ERROl
I GO TO ERR ROUTINE IF ON
33.
337
i----- READIWRITE THE 8088 GENERAL AND SEGMENTATION REGISTERS
338
WITH ALL ONE'S AND ZEROES'S.
33.
340
HOV AX,OFFFFH
J SETUP ONE '5 PATTERN IN AX
341
.TC
34.
C8:
343
HOY DS.AX
; WRITE PATTERN TO ALL REGS
344
HOY BX,DS
345
HOY ES.BX
346
MOY CX.ES
347
MOV SS,CX
34.
MOV DX.SS
349
MOV SP.DX
350
MOI/ BP,SP
351
MOI/ SI,ep
352
MOV 01.51
353
JNC C9
; TSTlA
354
XOR AX.DI
355
JHZ ERROl
I PATTERN MAKE IT THRU ALL REGS ; HO - GO TO ERR ROUTINE
356
CLC
357
JMP C8
35.
C9:
; TSTlA
35.
OR
AX,DI
; ZERO PATTERN MAKE IT THRU?
3.D
JZ
CI0
I YES - GO TO NEXT TEST
3.1
ERROl: HLT
J HALT SYSTEM
362
; ------------ - - - - - - - - - ----------------------------------
5-34 System BIOS
LOC OBJ
~
EOAE
EOAE £6AO EOBO E683 E082 BA0803 fOBS EE E086 FEeD fOBS 8288 EOBA EE fOBS 8099 EoeD E663 E06F BOFt fOCI E661 EOC3 8CC8 EatS 8EOO EOC7 8E08
EOC9 B7EO EOCB BC16EO EOCE E97BOB E001 EOOI 750A
~
EOD3 8004 EOD5 E608
~
E007 8054 EOD9 E643 EODB 8ACI EODO E641 EODF EODF B040 EOEI E643 Eon 80F8FF EOE6 7407 EOE8 E441 EOEA OAD8 EOEC E2Ft EOEE F4 EOEF EOEF 8AC3 EOFt 28C9 Eon E641 EOF5 EOFS B040 Eon E643 EOF9 90 EOFA 90 EOFB E441 EOFO 2208 EOFF 7403 EIOI E,F2 EI03 F4
EI04 EI04 BOl, E106 E641 EI08 E60D
LINE SOURCE
3.3
ROS CHECKSUM TEST I
3.4
J DESCRIPTION
3.5
A CHECKSUM IS DOHE FOR THE 8K RDS ttODULE
36.
CONTAINING POO AHI) BIOS.
367 ;-------------------------------------------------------
368
CI0:
369
370
OUT
OAOH,Al
; ZERO IN AL ALREADY ; DISABLE HHI INTERRUPTS
371
OUT
83H,Al
; INITIAlZE DHA PAGE REG
372
MOV
eX , 3DSH
373
OUT
OX.Al
I DISABLE COLOR VIDEO
374
INC
Al
375
I10V
OL,OBSH
37.
OUT
OX,Al
; DISABLE BIW VIDEO, EN HIGH RES
377
MeV
Al.99H
I SET 8255 A,t-INPUT ,S-OUTPUT
378
OUT
CHO_PORT .Al
I WRITE 8255 tHO/MODE REG
379
MeV
AL,OFCH
380
OUT
PORT_B,Al
381
MeV
Ax.es
,; DISABLE PARITY CHECKERS AND GATE SNS S~S.CASS MOTOR OFF I SETUP S5 SEG REG
38.
"OV
55,AX
383
MOV
OS.AX
. .4
· SET UP DATA SEG TO POINT TO I ROH ADDRESS
385
ASSUME SS:COOE
38.
MaV
BH,OEOH
J SETtJP STARTING ROS AODR (EOOOO J
387
MOV
SP,OFFSET Cl
; SETUP RE11.JRN ADDRESS
388
J"P
ROS_CHECKSUM
389
Cll:
390
IN'
ERROl
; HALT SYSTEM IF ERROR
391
1---------------------------------------------------------------
39.
8237 OMA INITIAlIZATION CHANNEl REGISTER TEST
393
I DESCRIPTION
394
DISABLE THE 8237 OMA CONTROLLER. VERIFY THAT TIMER 1
395
FUNCTIONS OK. WRITE/READ THE CUPR'ENT ADDRESS ANO WORD
39.
COl.tIT REGISTERS FOR All CHAWHElS. INITIALIZE AND
397
START OMA FOR MEMORY REFRESH.
398 1---------------------------------------------------------------
399
MOV
AL,04
; DISABLE OHA CONTROllER
400
OUT
OMA08,AL
401
4"
; ----- VERIFY THAT TIMER 1 FlNCTIONS OK
403
404
I10V
AL.54H
I SEL TIMER l,lSB.HOOE 2
405
OUT
TIMER+3,Al
40.
tlDV
AL,CL
I SET INITIAL TIMER CNT TO 0
407
OUT
TIMER+1,AL
408
Cl,:
40.
"OV
AL.40H
410
OUT
TIMER+3,Al
i TIMERl_BITS_ON I LATCH TIMER 1 COlNT
4"
C"P
Bl.OFFH
41.
J'
C13
4"
IN
AL.TIMER+l
...414
415
OR lOOP HlT
Bl,Al CI'
417 en:
418
"OV
Al,Sl
419
SUB
CX,CX
I YES - SEE IF AlL BITS GO OFF ; TIMER I_BITS_OFF I READ TIMER 1 COlNT ; AlL BITS ON IN TIMER I TIMER CBlTS_ON 1 TIMER 1 FAILURE, HALT SYS ; TIMERl_SITS_OFF ; SET TIMER 1 CNT
4'0
OUT
TIMER+l.AL
4.,
C14:
; TIMER_LOOP
4"
MOV
AL,40H
I lATCH TIMER 1 COUNT
4"
OUT
TIMER+3.Al
"4
NOP
425
NOP
I DelAY FOR TIMER
4 ··
IN
Al, TIMER+l
i READ TIMER 1 COUNT
4'7
'NO
BL,Al
428
JZ
CIS
429
lOOP CI4
430
HlT
431
I GO TO WRAP_DHA_REG i TIMER_LOOP ; TIMER ERROR - HALT SYSTEM
432
;----- INITIALIZE TIMER 1 TO REFRESH MEMORY
4"
"4
CIS:
435
NOV
ALol8
436
OUT
TIMER+I.Al
; WRAP_DHA_REG I SETUP DIVISOR FOR REfRESH ; WRITE TIMER 1 CNT REG
4"
OUT
OMA+ODH.AL
438
; SEtil HASTER CLEAR TO OHA
System BIOS 5-35
LaC OBJ
£10A BOFF EIOC EIOC 8A08 ElOE SAF8 E110 890800 £1132.8Oz.
EllS EllS EE E116 50 E1l7 EE E118 B80101 EHB EC Elle 8AEO EllE EC EllF 3808 El2.1 7401 flU F4 £124 £124 42 E125 f2EE Ell7 FEeD E129 74£1
E12B 8EDB E120 8EC3
E12F BOFF E131 E601 El33 50 £134 E601 £136 B20B E138 B056 En... EE E138 8000 E13D £608 E13F 50 E140 E60A £142 8103 El44 B041 £146 E146 EE f147 FEeD E149 E2FB
E14B BAl30Z. E14E B001 E150 EE £151 882£7204 £155 81fD3412 £159 740... Else 8C41F090 E15F E9B6FE E162 £162 7401 £164 F4 £165 £165 2BFF £167 £460 £169 l40C E168 0404 E160 BlOC
LINE
439 440 441 442 443 444 445 446 447 448 449 4SO 451 452 453 454 45. 456 457 458 4.9 460 461 462
"3
464 46. . .6
"7
468 469 47. 471 472 473 474 47. 47. 477 478 479 480 481 482 48' 484 48. 486 487 488 489 490 491 492 493 494 49. 496
4"
498 499 500 .01 S02 503 S04 S05
.06
S07 S08 509 510 511 512
'13
514
SOURCE
J----- WRAP OKA CHA~ElS ADDRESS AND COUNT REGISTERS
C16: C17:
C18:
HOY
AL.OFFH
HOY HOY HOY
SU8
OUT PUSH OUT HOV IN
HOV IN CHP
JE HLT
INC lOOP INC JZ
DX,Al AX DX,AL AX,0101H AL,DX AH,AL AL.DX BX,AX C18
ox
C17 AL C16
; WRITE PATTERN FF TO All REGS
I SAVE PATTERN FDR COMPARE
; SETUP LOOP tNT ; SETUP I/O PORT AOOR OF REG {OOOO,
I WRITE PATTERN TO REG, LSB
I HSB OF 16 BIT REG I AX TO ANOTHER PAT BEFORE RO I READ 16-BIT OMA CH REG. LSB I SAVE LSB OF 16-BIT REG I READ MSB OF OMA CH REG I PATTERN READ AS WRITTEN? I YES - CHECK NEXT REG I NO - HALT THE SYSTEH I NXT_DMA_tH I SET 110 PQRT TO NEXT CH REG ; WRITE PATTERN TO NEXT REG j SET PATTERN TO 0 I WRITE TO CH~El REGS
1----- INITIALIZE AND START OMA FOR MEMORY REFRESH.
HOY HOY ASSUME
DS.BX ES,BX DS:ABSO.ES:ABSO
; SET UP ABSO INTO OS AN) ES
t10V OlTT
AL,OFFH OI1A+l,AL
; SET CNT OF 64K FOR RAtI REFRESH
PUSH
AX
OUT
OI1A+l,.U
HOV HOV OUT
DL.OSH Al,OS8H DX,Al
I OX=OOOB I SET OMA HOOE.CH O.REAO,AUTOINT I WRITE DHA HOOE REG
HOV
AL,O
; ENABLE DHA CONTROllER
OUT PUSH
DI1.6.+8.AL AX
I S~TUP OMA COHHAHD REG
OUT HOY HOY t18A:
DHA+ID,Al
I ENABLE CHANNEl 0 FOR REFRESH I SET HOOE FOR CHAHNEl 1
OUT
aX,AL
INC
AL
I POINT TO NEXT CHAHNEl
lOOP
C18A
1----------- - - - - - - - ------- - - - - - - - - --- --------------------------- BASE 16K READIWRITE STOR.6.GE TEST
I DESCRIPTION ~ITEIREADIVERIFY DATA PATTERNS FF,55,AA,01, AND 00
TO 1ST 16K OF STORAGE. VERIFY STORAGE ADORESSABILITY. INITIALIZE THE 8259 INTERRUPT CONTROllER CHIP FOR
CHECKING MANUFACTURING TEST 2 HODE.
J-.--- - -.---_.---.- - - ----_····------ --_.- -----------------------
1----- DETERMINE MEMORY SIZE AN) FIll MEMORY WITlf DATA
HOY HOY OUT HOV CHP JE HOY J"P C24: JE HLT CISB: SUB IN AM> ADD HOY
DX,021lH
1 ENABLE EXPANSION BOX
AL,OlH
DX,AL
BP,OATA_WORDrOFFSET RESET_FLAG! I SAVE 'RESET.FlAG' IN SP
BP,1234H
; WARM START?
C18B
; BYPASS STG 1ST.
SP,OFFSET C2
STGTST
C188
I PROCEED IF STGTST OK ; HALT IF NOT
DI,DI
AL,OCH AL. 4 CL. 12
I DETERMINE BASE RAtI SIZE I ISOLATE RAM SIZE SWS I CALCULATE HEttoRY SIZE
5-36 System BIOS
LOC OBJ
E16F 03EO E171 8BC8 E173 Fe EI74 E174 AA El7S E2FD f177 892£7204
fl78 BOF8 El7D E661 E17F E462 E181 2401 flS3 BlOC fiBS 03CO E187 80Fe E189 £661 E188 £462 E18D 240F ElaF OAt4 E191 8Aoe E193 8420 E195 F6EIt EI97 A31504 E19. 7418 El9C BAOOI0 E19F 6AEO E!AI BODO ElA3 EtA3 8£C2 ElAS 890080 EIAS 2SFF EIAA F3 flAB AA flAC 81C2:0008 ElBO FEes EIB2 75EF
flB4 EIB4 B013 ElM E620 EIBS B008 ElBA E621 EIBC B009 ElBE E621 EICO 28CO EIC2 8Eeo
Ele4 883000 E1e7 8£00 EIC9 etUDOl Elce 81F03412 ElOO 7425 EI02 2SFF EIOIt 6EOF fl06 862400 El09 C70747FF £100 43 flOE 43 EtOF eCOF ElEl £85F04 EIE4 60F865 Elf7 750E ElU B2FF ElEB El fB £86204 EIEE 8AC3 Elf 0 AA
LINE SOURCE
515
SHL
AX. Cl
516
MOV ex. AX
517
CLO
I SET DIR FLAG TO INCR
518
C19:
51.
STOSB
; FILL BASE RAM WITH DATA
52.
LOOP C19
, LOOP TIL ALL ZERO
521
MOV
522 523
J----- DETERtHNE 10 CHANNEL RAM SIZE
524
525
HOV
AL,OF8H
I ENABLE SWITCH 5
526
OUT
PORT_B,Al
527
'H
AL.PORT_C
; READ SWITCHES
528
AHO
AL,OOOOOOOlB
; ISOLATE SWITCH 5
52.
MOV
CL,l20
53.
ROL
AX,Cl
531
MOV
Al,OFCH
; DISABLE SW. 5
532
OUT
PORT_B,AL
533
'H
AL,PORT_C
534
AlII
Al.OFH
535
OR
AL,AH
i COI18INE SWITCH VALUES
536
NOV
BL,AL
; SAYE
537
MOV
AH,32
538
NUL
AH
J CALC. LENGTH
53.
MOV
DATA.WORDlOFFSET IO.RAM.SIZEJ .AX
1SAYE IT
54.
JZ
C21
541
MOV
DX,lOOOH
I SEGMENT FOR I/O RAM
542
MOV
AM.At
543
MOV
Al.O
544
C20:
545
NOV
ES,OX
546
HOV ex.sooGH
547
sue 01,01
; FILL 32K BYTES
548 54.
...REP
STOSB OX.SOOH
I NEXT SEGMENT VALUE
550
OEC
BL
551
JHZ
C20
55.
553
INITIALIZE THE 8259 INTERRUPT CONTROLLER CHIP
554
; ------------------------.--------------------------------------
555
e21:
556
NOV
AL.13H
I ICWl - EDGE, SNGL. ICW4
557
OUT
INTAOO.AL
558
NOV
Al.8
J SETUP ICW2 - lIfT TYPE 8 (8-F)
55.
OUT
INTA01.Al
560
NOV
AL.9
; SETUP ICW4 - BUFFRO. 8086 HOOE
561
OUT
INTAOl.Al
56.
SUB
AX ....X
~ POINT ES TO BEGIN
563
NOV
ES ....X
; OF RIW STORAGE
564 j--------------------------------------------------------------------------
565
CHECK FOR MANUFACTURING TEST 2 TO LOAD TEST PROGRAHS FROM KEYBOARD.:
566 j--------------------------------------------------------------------------
567
568
i----- SETUP STACK SEG AI'«) SP
56.
570
NOV
"'X.STACK
I GET STACK V...lUE
571
NOV
SS .... X
J SET THE STACK UP
572
MOV
SP,OFFSET TOS
I STACK IS RE"'DY TO GO
573
CMP
BP.1234H
I RESETJ L...G SET?
574
JE
C2S
J YES - SKIP HFG TEST
575
SUB
DI.DI
576
MOV
OS. DI
577
MOV
BX. 24H
578
HOV
WORD PTR [BX),OFfSET 011 J SET UP KB INTERRUPT
57.
'NC BX
580
INC
BX
581
I'1OY
(8XI.CS
582
CALL KBD_RESET
; READ IN KB RESET CODE TO Bl
583
CMP
Bl,065H
I IS THIS MANUF"'CTURIt-aG TEST 2?
584
JNZ
C25
I JUMP IF NOT HAN. TEST
585
tIOV
DL,255
I READ IN TEST PROGR...M
586
C22:
587
CALL SP_TEST
588
HOV
AL.Sl
58'
STOSS
System BIOS 5-37
LOC OBJ
EIFl FECA EIF3 75F6 EIF5 C03E EIF7
EIF7 892000 EIFA 2BFF EIFC EIFe BS47FF
EIFF .I.e E200 seea
E202 AB E203 ElF7
E205 C7060800C3E2 f20B C70b1400S4FF E211 C706620000Fb
E217 BA2l0D E21A BODO EZlt EE E210
EC E21E
OACO E220
7515 E222
BOFf E224
EE E225
EC E226 0401 E228 7500
E22A 32E4 E22C FB E220 28C9 E22F E22F E2FE E231 E231 E2FE E233 OAE4 E235 7406 E237 E237 BAOIOI E23A E69203 E230 FA E23E F4
E23F E23F 80FE E241 EE E242 BOlO E244 E643 E246 891600 E249 8AC1 E248 E640
LINE SOURCE
590 591 59. 593 59. 595 596 597 59.
..50"1"
.,2
..,"4
.,5
606
..,,7.
609 610 611
612 613 614 615 616 617
618 619 620 621
."622
624
.2.625
..27
.,628
....""""
634 635 636 637 638 639 64. 641
64' 643 64_ 645 646 647
6'.
649 650 .51 .52 653 654 655 656
.· 57
65.
.,'59
,bI
66. 663 664 66S
DEC
DL
JNZ
CZ2
1NT
lEH
C25:
; JlR1P IF NOT DONE YET I SET INTERRUPT TYPE 62 ADDRESS F8H
j----- SET UP THE BIOS INTERRUPT VECTORS TO TEMP INTERRUPT
03:
MOV
tX,32
SUB
DI,OI
MOV STOSW MOV STOSW LOOP
AX,OFFSET Dll AX.CS D3
FILL A.LL 32 INTERRUPTS ; FIRST INTERRUPT LOCATOIN , MOVE AD DR OF INTR PROC TO TBL
; GET ADDR OF INTR PROC SEG ; VECTBlO
;----- SET UP OlllER INTERRUPTS AS NECESSARY
MOV
NHI_PTR.OFFSET NMI_INT I NMI INTERRUPT
Hov
INTS_PTR.OFFSET PRINT_SCREEN
I PRINT SCREEN
MOV
8ASIC_PTR+2.0F600H
; SEGMENT FOR CASSETTE BASIC
,---------------------- -- --------------------------------------- 82S'il INTERRUPT CONTROLLER TEST
; DESCRIPTION REAOIWRITE THE INTERRUPT MASK REGISTER fIHRJ WITH ALL ONES AND ZEROES. ENABLE SYSTEM INTERRUPTS. MASK DEVICE ! INTERRUPTS OF F. CHECK FOR HOT INTERRUPTS (~EXPECTED). :
i ---------.------------ -----------------------------------------
1----- TEST THE IMR REGISTER
NOV
OX.0021H
MOV
AL.o
OUT
DX.AL
IN
AL,DX
0'
AL,Al
JNZ
06
HOV
Al.OFFH
OUT
DX.Al
IN
Al.DX
ADD
Al,l
JNZ
06
POIHT INTR. CHIP ADCR 21 I SET IMR TO ZERO
I READ INR
IMR = O?
; GO TO ERR ROUTINE IF NOT 0 I DISABLE DEVICE INTERRUPTS ; WRITE TO IHR i READ IHR
; ALL It1R BIT ON? ; NO - GO TO ERR ROUTINE
;----- CHECK FOR HOT INTERRUPTS
1----- INTERRUPTS ARE MASKED OFF. CHECK THAT NO INTERRUPTS OCClII.
XOR
AH,AH
sn
j CLEAR AH REG ; ENABLE EXTERNAL INTERRUPTS
SUB
CX.CX
; WAIT 1 SEC FOR ANY INTRS THAT
04:
LOOP 04
; MIGHT OCClII!
05:
LOOP 05
OR
AH.AH
I DID ANY INTERRUPTS OCCUR?
JZ
07
NO - GO TO NEXT TEST
D6:
NOV
DX.lOIH
; BEEP SPEAKER IF ERROR
CALL
eLI
ERR_BEEP
i GO TO BEEP SUBROUTINE
HLT
J HALT THE SYSTEM
j-----------------------------------------------
8253 TIMER CHECKOUT
I DESCRIPTION
VERIFY THAT THE SYSTEM TIMER (0)
DOESN'T COUNT TOO FAST OR TOO SLOW ·
; -----------------------------------------------
07:
MOV
Al.OFEH
i MASK ALL INTRS EXCEPT lVl 0
OUT
aX.Al
I WRITE TIlE 825'il IMR
HOV
Al.OOOIOOOOB
i SEl TIM O. LS8, MODE O. BINARY
OUT
TIM.CH.U
; WRITE TIMER CONTROL MODE REG
HOV
CX,16H
; SET PGM lOOP tNT
HOV
Al,CL
I SET TIMER 0 CNT REG
OUT
TIMERO.AL
i WRITE TIMER 0 CNT REG
5-38 System BIOS
~
LOC OBJ
E240 E240 F6C4FF E250 7504 E252 E2F9 E254 EBEI E256 E256 B112 E258 BOFF E2SA £640 Else 88FEOO EZSF EE E260 E260 F6C4FF E263 7502 E265 E2F9
E267 IE £266 8F4000 E268 DE E26C 1F E26D 8E03FF90 E271 MIDOO
~
E274 BOFF E276 EE E277 6036 E279 E643 E27B BODO E27D E640 E27F E27F AS E280 47 E281 47 E282 E2F6 E284 E640 E286 IF
E287 E8B903 ElSA 80FBAA E28D 741E E28F BOlC £291 E661 E293 90 E294 90 E295 E460 E297 24FF E299 750E E298 FE061204 E29F C10620006D£6 f2A5 BOFE EU7 E621 E2A9 E2U BOce ElAB E661
~
E'AD ElAD E460 EUF 8400 E2Bl A31004 E264 E2B4 2430 E266 7529
LINE
···
··7
······
.70 .71 .7' .73 .74 .7. .7. .77 .7. .7.
..."··0
,
.83 .84
.·8··'
··7
.....·8....·..,.·.
··4
··s
···
··7
······
700 701 702 703 704 70S 70.
707 70. 709 710 711 712
7" 714 715 71. 717 718 719 720 721 722 723 7'4 725 7'. 7'7 7'8 729 730 731 73' 733 734
73' 73. 737 738 73. 740 741 74'
SOURCE
08:
D9: 010:
TEST J"Z LOOP JMP
ItDV MDV OUT HOY OUT
TEST J"Z lOOP
AH,OFFH D. D' D.
CL,16 Al,OFFH TlHERO,AL
AX.OFEH
DX,AL
AH,OFFH D. DIO
; DID TIMER 0 INTERRUPT OCCUR?
; YES · CHECK TIMER OP FOR SLOW TIME
I WAIT FOR UITR FOR SPECIFIED TIME I TIMER 0 INTR DION' T OCCUR - ERR
I SET PGM lOOP tNT I WRITE TIMER 0 CNT REG
I DID TIHfR 0 INTERRUPT ocelll(?
; YES - TIMER CHTING TOO FAST, ERR
; WAIT FOR INTR FOR SPECIFIED TIME
j----- ESTABLISH BIOS SUBROUTINE CAll INTERRUPT VECTORS
PUSH I1DV PUSH pop
I1DV HOY
DS
J SAYE POINTER TO DATA AREA
DI,OFFSET VIDEO_INT
I SETUP ADDA TO INTR AREA
CS
DS
J SETUP ADOR OF VECTOR TABLE
SI,OFFSET VECTOR_TABLE+16
I START WITH VIDEO ElmIY
CX.16
;----- SETUP TIMER 0 TO MODE 3
E1A:
MOV
AL,OFFH
OUT
DX,AL
MOV
AL,36H
OUT
TIMER+3.AL
MDV
AL,O
OUT
TIMER ,AL
I1DVSW INC INC LOOP OUT POP
DI DI
EIA
TIMER,Al DS
I DISABLE ALL DEVICE INTERRUPTS
; SEL TUI O.LSB.MSB,MDDE 3 I WRITE TIMER MODE REG
I WRITE LSB TO TIMER 0 REG I HOVE VECTOR TABLE TO RAM I I10VE PAST SEGMENT POINTER
I WRITE "58 TO TIMER 0 REG
j RECOVER DATA SEG POINTER
;----- SETUP TIMER 0 TO BLINK LEO IF MANUFACTURING TEST MODE
CALL
eMP
KBD_RESET BL,OAAH
I SEND SOFTWARE RESET TO KEYBRD I SCAN CODE 'AA' RETURNED?
JE
E.
I YES - CONTINUE (NON MFS MODE)
HOV
AL,3CH
I EN, 1<80. SET KBD CLK LINE LOW
OUT
POIH_B,AL
I WRITE 8255 PORT B
HOP
HOP
IH
AL.PORT_A
I WAS A BIT CLOCI<ED IN?
AND
AL,OFFH
J"Z
E2
I YES - CONTINUE (NOH MFG I1OOE)
INC
DATA_AREAl OFFSET HFG_TST J
; ELSE SET SW FOR MFG TEST !'lODE
HOV
INT_ADDR,OFFSET BLI*-INT
J SETUP TIMER INTR TO BLINK LED
MDV
AL,OFEH
; ENABLE TIMER INTERRUPT
OUT
INTAOl,AL
E2:
1 JI.kIPER_NOT_IN:
MDV
AL,OCCH
; RESET THE KEYBOARD
OUT
PORT_B,AL
;-------------------------------------------------------
INITIALIZE ANO START CRT CONTROLLER (6845)
TEST VIDEO READ/WRITE STORAGE.
; DESCRIPTION
RESET THE VIDEO ENABLE SIGNAL.
SElECT ALPHANUMERIC MOOE, 40 'If ZS, B & W.
READ/WRITE DATA PATTERNS TO STG. CHECK STG
ADDRESSABlLITY.
1------------ ------ - --------------------------- - - - ---- - - E6:
IN
AL,PORT_A
1 READ SENSE SWITCHES
I1DV HOV E6A:
AH.D DATA_WOROIOFFSET EQUIP]LAGJ ,AX I STORE SENSE SW INFO
AND
AL,30H
I ISOLATE VIDEO SWS
J"Z
E7
I VIDEO SWS SET TO 01
System BIOS 5-39
LOC OBJ
ElBa C706400053FF ElBE E9.6.200
E2C3 E2C3 E2C3 50 E2C4 E462 E2(6 A8CO f2ea 7415 f2eA BEDAFF90 E2CE .6.840 f2DO 7504 E202 BE23FF90 E2D6 f206 2BCO f208 COlO f20A E8DD03 f200 FA fZOE F4 E2DF E20F 58 E2EO CF
ElEi E2El 3e30 E2E3 7408 E2E5 FEC4 E2f7 3e20 E2E9 '7502 f2EB 8403 fHO fZED 66EO E2EF 50 E2FO 2.6.E4 E2F2 COlO E2F4 58 E2F5 50 E2F6 8e0080 E2F9 8AB803 E2FC B90010 E2FF BOOI nOl 80FC30 E304 7408 n06 B7B8 E30a 8208 f30A 8540 DOC FEte nOE DOE EE E30F BIFD3412 n13 8EC3 DIS 7407 nl7 8EOB
E319 E8FFFC Dit 7532
DIE E31E 58 E31F 50 E320 B400 E322 COlO E324 B82070 E327 2BFF E329 892600 E32C F3 E32D AB
LINE SOURCE
743 744 74S 746 747 748 7'9 750 751 752 753 7S. 755 756 757 758 759 760 761 76' 763 76' 765 766 767 768 769 770 771 77' 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 79. 791
'"793
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 e09
elo
811 812 813
814 815 816 817
"OV
VIDEO_1NT ,OFFSET Dut1I1Y_RETURN
J"P
E18_1
; SKIP VIDEO TESTS FOR BURN-IN
ORO tI1I_INT ~OC
PUSH IN TEST JZ MOV TEST JNZ MOV 013: SUB INT CALL ClI HlT
OE2C3H NEAR AX Al,PORT_C AL.OCOH 014 SI.OFFSET 01 AL.40H 013 SI.OFFSET 02
AX,AX IOH P_MSG
; SAVE ORIG CONTEHTS OF AX
; PARITY CHECK? I NO. EXIT FROM ROUTINE ; ADDR OF ERROR MSG I 110 PARITY CHECK j DISPLAY ERROR MSG ; MUST BE PLANAR
I INIT AND SET MODE FOR VIDEO ; CALL VIDEO.IO PROCEDURE ; PRINT ERROR MSG
; HALT SYSTEM
pop
AX
I RESTORE ORIG CONTENTS OF AX
IRET
NMI_INT ENOP
£1:
I TEST_VIDEO:
C"P
AL.30H
JE
E8
INC
AH
; B/W CARD ATTACHED? ; YES - SET MODE FDR BIN CARD i SET COLOR HOOE FOR COLOR CD
C"P
AL.20H
JHE
E8
MOV
AH.3
E8:
; 80X25 MODE SE LECTED? ; NO - SET MODE FOR 40X25 ; SET MODE FOR 80X25
XCHG
AH ,AL
; SET.MODE
PUSH
AX
; SAVE VIDEO MODE ON STACK
SUB
AH,AH
; INITIALIZE TO ALPHANUMERIC I1D
INT
10H
POP
AX
I CALL VIDEO.lO I RESTORE VIDEO SENSE SWS IN AH
PUSH
AX
I RESAVE VALUE
MOV
BX,OBOOOH
I BEG VIDEO RAM ADOR BIW CO
MOV
DX,3B8H
; HODE REG FOR BIW
MOV
CX,4096
I RAM BYTE CNT FOR BIW CO
HOV
AL,I
; SET MODE FOR Bioi CARD
CMP
AH,30H
I BIW VIDEO CARD ATTACHED?
JE
E9
J YES - GO TEST VIDEO STG
HOV
BH,OB8H
i BEG VIDEO RAM ADDR COLOR CD
MOV
DL,OD8H
; MODE REG FOR COLOR CD
MOY
CH,40H
1 RAM BYTE CNT FOR COLOR CD
DEC
AL
i SET MODE, TO 0 FOR COLOR CD
E9:
; TEST_VIDEO_STGL
OOT
DX,AL
; DISABLE VIDEO FOR COLOR CD
C"P I10V
ep,1234H ES,ex
POD INITIATED BY KBD RESET? POINT ES TO VIDEO RAM STG
JE
EIO
MOV
Ds.ex
YES - SKIP YIDEO RAM TEST I POINT os TO VIDEO RAM 5TG
ASSUME OS:NOTHING,ES:NOTHING
CALL
5TGTST.CNT
I 60 n:ST VIDEO RIW STG
JNE
E17
; RIN STG FAILURE - BEEP SPI(
1---------------------------------------------------------------
1
SETUP VIDEO DATA ON SCREEN FOR VIDEO LINE TEST.
; DESCRIPTION
ENABLE YIDEO SIGNAL AND SET HODE.
DISPLAY A HORIZONTAL BAR ON SCREEN.
1------- ------------------- ----------- - ------- - -------------
EIO:
POP
AX
; GET VIDEO SENSE SWS I AH J
PUSH
AX
; SAVE IT
MOV
"H,D
i ENABLE VIOEO AND SET MODE
INT
iOH
; VIDEO
MOV
AX. 7020H
SUB
01.01
I WRT BLANKS IN REVERSE VIDEO i SETUP STARTING LaC
MOV
CK.40
; NO. OF BLANKS TO DISPLAY
REP
STOSW
I WRITE VIDEO STORAGE
1----------------- ------------------------------------- CRT INTERFACE LINES TEST
i DESCRIPTION SENSE ONIOFF TRANSITION OF THE VIDEO ENABLE
5-40 System BIOS
LOC OBJ
E32E 58 E32F 50 EHO 80FC30 E333 BABA03 E336 7402 EHe B2DA E33A E33A 8408 E33C E33C 2BC9 E33E E33E EC E33F 22C4 E341 7504 E343 E2F9 E345 E609 E347 £347 28C9 £349 E349 EC E34A 22C4 E!4C 740A E34E ElF9 ElSO ElSO BA0201 E353 f87902 E356 fB06 E358 Else B103 E35A D2ft E1St 750E ElSE E35E 58 nSF 8400 E361 COlO
E363 Db3 BAooeo [366 El66 BEDA E368 ZBDB ElbA 8B07 E36C 53 E36D 58 E36E 3055"A E371 7505 £373 f80E03 E376 £804 E378 E378 81C28000 E!7C E37C 81FAOOC8 E380 7C£4
[382 nBl BAI002 E385 B85555 E388 EE E389 BOOI ElSB EC E3eC 3AC4 ElSE 7534 E390 F7DG n92 EE EJ9l BOOI D9S EC E396 JAC4
LINE SOURCE
818
AND HQRIZOtfTAl SYNC LINES.
819
; -- ----- - -----.----------- - ---------- - - ------------
82.
POP
AX
; GET VIDEO SENSE SW INFO
821
PUSH
AX
822
CMP
AH,30H
823
MOY
DX.03BAH
824
JE
Ell
; SAVE IT ; SIlo' CARD ATTACHED? i SETUP ADDR OF BW STATUS PORT ; YES - GO TEST LINES
825
MOV
DL,ODAH
826
Ell:
827
MOV
AH,8
; COLOR CARD IS ATTACHED ; LINE_TST:
828
829
SUB
cX,ex
83.
E13:
831
IN
Al.DX
832
ANO
AL,AH
833
JNZ
El4
; READ CRT STATUS PORT ; CHECK VIDEO/HORZ LINE J ITS ON - CHECK IF IT GOES OFF
834
lOOP
E13
; LOOP TILL ON OR TIMEOUT
835
JMP
SHORT E17
i GO PRINT ERROR MSG
836
E14:
837
838
El5:
CX,CX
839
IN
AL,OX
I READ CRT STATUS PORT
84.
AND
AL.AH
J CHECK VIOEO/HORZ LINE
841
JZ
£16
ITS ON - CHECK NEXT LINE
842
LOOP
E15
843
E17:
lOOP IF OFF TILL IT GOES ON I CRT_ERR
844
MOV
DX,I02H
845
CAll
ERR_BEEP
; GO BEEP SPEAKER
846
JMP
SHORT E18
847 848 849
... Elb: MOV
CL,3 AH,CL
85.
JHZ
El2
851
El8:
852
pop
AX
; NXT_LINE I GET NEXT BIT TO CHECK
I GO CHECK HORIZONTAL LINE ; DISPLAY_CURSOR: i GET VIOEO SENSE SWS (AH)
853 854
MOV INT
,.NAH,O
; SET MODE AND DISPLAY CURSOR ; CALL VIDEO 110 PROCEDURE
855
856
857
MOV
OX,OCOOOH
858
ElBA:
859 86.
.M.O..V.
DS,DX BX,BX
861
MOV
AX,(BXJ
862
PUSH BX
863
pop
BX
I GET FIRST 2 LOCATIONS I LET BUS SETTLE
864
CMP
AX.OAA55H
I PRESENT?
865
JNZ
E18B
; NO? GO LOOK FOR OTHER MODULES
866
CAll ROM_CHECK
867
JMP
SHORT E18C
J GO SCAN HOOULE
868
E18B:
869
ADD
OX,0080H
87.
EI8C:
I POINT TO NEXT 2K BLOCK
871
eMP
DX,oe800H
; TOP OF VIDEO ROf1 AREA YET?
872
Jl
El8A
I GO SCAN FOR ANOTHER tIOOULE
873 1----------------------------------------------------------
874
; EXPANSION 110 BOX TEST
875
CHECK TO SEE IF EXPANSION BOX PRESENT - IF INSTALLED,
876
TEST DATA ANO AOORESS BUSES TO 110 BOX.
877
; ERROR=' 1801 ,
878
; ------------ - - - ----- - - - - --- - - - ---------------- - - -- - ____
879
880
j----- DETERMINE IF BOX IS PRESENT
881
882
; (CARD WAS ENABLED EARLIER)
883
MDV
OX,02l0H
884
NOV
AX,5555H
I CONTROL PORT ADDRESS I SET DATA PATTERN
885
ruT
DX,AL
886
MOV
AL,OlH
887
IH
AL,OX
; RECOVER DATA
888
eMP
AL.AH
889
JHE
E19
89.
HOT
AX
891
OUT
DX,AL
8..
MOV
AL,OIH
893
IN
AL.DX
894
eMP
AL,AH
I REPLY? 1 NO RESPONSE. GO TO NEXT TEST ; MAKE OATA=AAAA
I RECOYER DATA
System BIOS 5-41
LOC OBJ
E398 752.4.
E39A E39A 8808 E39C 8 ... 1402 E39F 2E8807 ElA2 EE ElA3 90 ElA.4 EC E3AS 3AC7 ElA7 7514 ElA9 42 f3U EC f3AB 3AC4 E3AD 750E E3AF 42 ElBD EC £381 3AC4 US3 7508 ElBS F700 £387 3eAA ElB9 7409 E3BB EBOO f3BD E3BD BEEDFE90 £3el E8F602
E3C4
E3C4 E8771B E3C7 AOIOOO E3CA 240C ncc B404 nCE F6E4 E3DO 0410 E3D2 BBDO E304 8B08
E306 A11500 E3D9 83FB40 E3DC 7402 E3DE 2BCO E3EO E3EO 03C3 E3E2 A31300 E3E5 81FD3412 E3E9 IE E3EA 744F
£JEC. 880004 E3EF 891000 E3F2 E3F2 3801 E3F4 7620 E3F6 BED8 E3F8 BEC3 E3FA B3ell0 E3FO BIC30004 E401 51 E402 53 E403 52 E404 E811FC £407 SA
LINE
..-··5
··7
·········
.".01
.03 '0.
.05
'06 '07 .0. .0.
'10 .11
· 12
'13
.."....11,.,,457...
.21
"·'2·43·
··5
···
...··7
92.
.'3"0
93'
.n
93.
.35
936
.37
.,8
.943.'
94'
...94.
'43
. 945
947 94. 94. .5. '51 .5. '53 .54 .55 .56 .57 .58
'5' '6' .61 .6' .63 .64 .65
._..66
967
96.
.70
'71
SOURCE
JHE
El'
1----- CHECK ADIJRESS AND DATA BUS
I NO ANSWER=NEXT TEST
EXPl:
HOV
BX,AX
MOV
DX,0214H
I LOAD DATA REG ADDRESS
HOV
CS:(SXJ,Al
J WRITE ADDRESS FOOOO+8X
OUT
DX.AL
; WRITE DATA
HOP
IN
AL,DX
; READ DATA
CHP
AL,BH
JHE
EXP_ERR
IHe
OX
; DX=215H IADDR. HI REG)
IH
Al,DX
CHP
AL.AH
J COMPARE TO HI ADDRESS
JHE
EXP_ERR
!HC
OX
I DX-2iI!JH (ADOR . LOW REG)
IH
AL,DX
CHP
AL,AH
I AOCR. lOW OK?
JHE
EXP_ERR
HOT
AX
I INVERT AX
CHP
AL.OAAH
; BACK TO STARTING VALUE IAAAAI YET
JE
El'
JHP
EXPI
I GO ON TO NEXT TEST IF SO ; LOOP BACK THROUGH WITH DATA OF 5555
EXP_ERR:
HOY
SI. OFFSET F3B
CAll P_HSG
,1--------- - - --- - -- - - - - - - - - - - - --------- --- - -------- -------------- ADDITIONAL REAO/WRITE STORAGE TEST
; DESCRIPTION
~lTE/READ DATA. PATTERNS TO ANY READ/WRITE STORAGE
AFTER TItE BASIC 16K. STORAGE ADDRESSABILITY IS CHECKED.
;---------------------------------------------------------------
ASSUME DS:OATA
E19:
; ----- DETERMINE RAM SIZE ON PLANAR BOARD
CAll HOV ANO HOV HUL ADD HOY HOY
DDS AL,8YTE PTR EQUIP_FlAG AL.OCH AH.4 AH AL,I6 OX.AX BX.AX
I GET SENSE SWS INFO I ISOLATE RAM SIZE SWS
I ADD BASIC 16K ; SAVE PLANAR RAM SIZE IN OX I AI'IJ IN BX
1----- DETERMINE 10 CHANNel RAM SIZE
E20;
HOV CHP JE SUI
AOD HOV CHP PUSH JE
AX.IO_RAM_SIZE B><,40H <2. AX,AX
AX,BX MEMORY_SIZE .AX BP,1234H OS TSTl2
I SET 10 CHA~El RAM SIZE
= I PLANAR RAM SIZE 64K?
; YES - ADD 10 CHN RAM SIZE I NO - DON'T ADD ANY 10 RAM ; ADD_la_SIZE: ; SUI't TOTAL RAM SIZE ; SETUP MEHDRY SIZE PARM ; POD INITIATED BY KBD RESET!' ; SAVE DATA SEGMENT ; YES - SKIP MEMORY TEST
1----- TEST ANY OTHER READ/WRITE STORAGE AVAILABLE
E21 :
HOV HOV
CHP JBE MOV MOV ADO ADD PUSH PUSH PUSH CALL pop
ex.400H CX.16
OX.CX <23 DS.ex ES.8X CX.16 8X.400H
cx ax
OX STGTST DX
; ANY MORE STG TO BE TESTED? ; NO - GO TO NEXT TEST ; SETUP STG ADDR IN OS ANO ES
I INCI\EHENT STG BYTE COUNTER ; SET POINTER TO NEXT 16K 8lK I SAVE REGS
I GO TEST A 16K BLK OF STG
5-42 System BIOS
LOC OBJ
£408 58 £409 59 E40A 74f6
E40e BCDA E40E 8Afa E410 aAC6 E412 E61002 £415 8ACS f417 E80B02 f41A BE67FA90 E41E E89902 E421 E421 EB18 E423 E423 IF E424 IE E425 66161500 E429 OB02 E42B 740E E420 890000 E430 81FB0010 E434 7705 £436 BBOOI0 E439 EBB7
E438 E438 1F E43C 603E120001 E441 742" E443 E6FOOl E446 E31E E448 B040 E44A E661 E44C BOFBAA E44F 7515
f451 Boee f453 E661 E4SS B04e f457 E661 £459 28C9 E458 E458 E2FE E450 £460 f45F 3eoo E461 740.1 E463 E88F01 E466 BEHFF90 E46A E64002
£460 E460 ZBca E46F 8EtO f471 890800 E474 IE £475 DE E476 IF E477 BEFlFE90 E478 8F2:000 £47£ E47E AS f47F 47 E460 47
LINE SOURCE
.72 .73
'74 .75
976
'77
.78
'7'
980
'81 'B2 .B3
'B'
9BS
'8'
'87
''BBB. '90
'91 992 993
.94
995
.96
.97 99B 99. 1000 1001 1002 1003 1004 1005
1006 1007 100& 1009 1010 lOll 1012 1013 1014 1015 1016 1017
1018 1019 1020 1021 1022 102]
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048
POP
BX
POP ex
J'
"1
; RESTORE REGS J CHECK I F MOP E STG TO TEST
J----- PRINT FAILING ADDRESS A"" XQR'ED PATTERN IF DATA COt1PAr.!E EIHIOR
MOV
OX.OS
; CONVERT FAILING HIGH-ORDER
HOV
CH.AL
i SAVE FAILING BIT PATTERN
HOV
AL.DH
I GET FAILING ADDR
CALL
XPC_BYTE
; CONVERT AND PRINT CODE
HOV
AL.CH
i GET FAILING BIT PATTERN
CALL
XPC_BYTE
; CONVERT AND PRINT CODE
HOV
SI.OFfSET El
; SETUP ADDRESS OF ERROR HSG
CALL
P_HSG
; PRINT ERROR HSG
E22:
JMP
SHORT TST12
; GO TO NEXT TEST
E23:
POP
OS
j STG_TEST_DOHE
I POINT as TO DATA SEGMENT
PUSH
OS
HOV
OX,IO_RAM_SIZE
i GET 10 CHAHNE L RAM SIZE
OR
DX,OX
i SET flAG RESULT
JZ
TSTl2
i NO 10 RAM. GO TO NEXT TEST
MOV
CX,O
CMP
ex, 1(lOOH
i HAS 10 RAM' BEEN TESTED
JA
TSTl2
I YES - GO TO NEXT TEST
HOV
ex.l OOOH
I SETUP BEG LOC FOR 10 RAM
-- ------- ,--- JMP
"1
---- - --------~- ~ --- -----
i GO TEST 10 CHANNEL RAH
----- --- -- -- ----- --
KEYBOARD TEST
; DESCRIPTION
RESET THE KEYBOARD AND CHECK THAT SCAN CODE
'AA' IS RETURNED TO THE cpu. CHECK FOR STUCK
KEYS. ; ------------------- ____________________________________ _
TSTl2:
ASSUME
POP eMP
J'
OS:DATA F7
JCXZ MOV OUT CMP JNE
F6 AL,40H PORT_B.AL Bl.OAAH F6
; MANUFACTURING TEST MODE? I YES - SKIP KEYBOARD TEST I ISSUE SOFTWARE RESET TO KEYBRD I PRINT ERR MSG IF NO INTERRUPT i ENABLE KEYBOARD
I SCAN CODE AS EXPECTED? , NO - DISPlAY ERROR HSG
i----- CHECK FOR STUCK KEYS
I10V
AL,OCCH
OUT
PORT_B.Al
MOV
AL,4tH
OUT
PORT_B.Al
SUB
CX,CX
F5:
lOOP
F5
IN
AL.KBD_IH
CHP
AL,a
JE
F7
CALL
XPC_BYTE
F6:
MOV
SI.OFFSET F1
CALL
P_HSG
j----- SETUP INTERRUPT VECTOR TABLE
I CLR KBD, SET CLK LIHE HIGH
I ENABLE KBD ,eLK IN NEXT BYTE
I KBD_WAIT ; DELAY fOR A WHILE I CHECK fOR STUCK KEYS
; SCAN CODE = O?
I YES - CONTINUE TESTING ; CONVERT At«) PRINT I GET HSG ADDR ; PRINT HSG ON SCREEN
F7: F7A:
SUB MOV MOV PUSH PUSH POP MOV I10V
AX,AX ES.AX CX,8 Os eS OS SI.OFFSET VECTOR_TABLE Dr .OFFSET INT_PTR
I GET VECTOR CNT ; SAVE DATA SEGt'lENT i SETUP OS SEG REG
MOVSW
INC
01
INC
DX
I SKIP OVER SEGt1ENT
System BIOS 5-43
LOC OBJ
£481 E2FB
E483 E463 IF E484 IE E485 8040 E487 E66l
E489 BOFF E488 f621 E480 B086 E48F E643 E491 880304 E494 E642 E496 8"'C4 E496 E642
E49" E462 E49C 2410 E49E A26800 E4"1 E80514 E4"4 E60214
E4"7 noe
E4A9 81FB4005 E4AD 1306 E4AF 81FBI004 E483 7307 E485 E485 BE39FF90 E489 E8FEOl
E49C E4BC BAooe8 E4BF E4Bf 8ED" E4Cl ZBDB E4C3 8B07 E4CS 3DS5AA E4(8 7505 E4CA f6B701 E4CO E804 E4CF E4CF 81C28000 E403 E403 81FAOOF6 E407 7e£6 [409 E80190
E4DC E4DC E4DC ZBDB E4DE 8EOA E4EO E86907
LINE SOURCE
1049
1050 1051 1052 1053 1054 1055
1056
1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072
Ion
1074 1075 1076 1077 1076 1079 1060 1081 1082 1083 1084 1085 1086 1087 1088 108Q 1090 1091 1092 1093 1094 1095 1096 1097 1096 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1116 1119 1120: 1121 1122 1123 1124
lOOP
F7A
; ------------------------------------------------------- CASSETTE DATA WRAP TEST
I DESCRIPTION
~N CASSETTE HOTOR OFF. WRITE A BIT OUT TO THE
CASSETTE DATA BUS. VERIFY THAT CASSETTE DATA
REAO IS WITHIN A VALID RANGE.
1-------------------------------------------------------
j----- Tt.IRN THE CASSETTE MOTOR OFF
TSTl3:
pop PUSH MOV OUT
OS OS AL,04DH PORT_B,AL
1 SET TIMER 2 SPK OUT, AND CASST lOUT BITS ON, CASSETTE MOT OFF
; ----- WRITE A BIT
MOV OUT MOV OUT MOV OUT MOV OUT
AL,OFFH INTAOl,AL AL,OB6H TIMER+3,AL AX,I23s TIMER+2,AL AL,AH TIMER+2,AL
I DISABLE TIMER INTERRUPTS
1 SEL TIM 2, LSB, MSB, HO 3 ; WRITE 6253 CHOIl10DE REG ; SET TIMER 2 CNT FOR 1000 USEC ; WRITE TIMER 2 COUNTER REG ; WRITE MSB
;----- READ CASSETTE INPUT
IH
AL,PORT_C
AND
AL,lOH
I READ VALUE OF CASS IN BIT j ISOLATE FROM OTHER BITS
MOV
LAST_VAL,AL
CALL
READ_HALF_BIT
CALL
READ_HALF_BIT
JCXZ
Fe
CMP
BX ,MAX_PERIOD
JHC
F8
CMP
BX,MIN_PERIOD
JHe
ROM_SCAN
F8:
I GO TO NEXT TEST IF OK I CAS_ERR
MOV
SI,OFFSET F2
; CASSETTE WRAP FAILED
CALL
P_MSG
; GO PRINT ERROR MSG
1----------------- ---------- --------- ---- ----------- ------- ---------- ---
CHECK FOR OPTIONAL ROM FROM ceOOO->F4000 IN 2K INCREMENTS
fA VALID MODULE HAS 'S5U' IN THE FIRST 2 LOCATIONS, LENGTH
INDICATOR (LENGTH/512) IN THE 3RD LOCATION AND TESTIINIT.
CODE STARTING IN THE 4TH LOCATION.)
;----------------------------------------------------------------------- ROM_SCAN:
NOV ROM_SCAN_1 :
OX,OC800H
1 SET BEGINNING ADDRESS
MOV
DS,DX
SUB
BX,BX
I SET BX=OOOO
MOV CMP
AX,(BXI AX,OAA55H
; GET 1ST WORD FROM MODULE
I = TO 10 WORD?
JHZ CALL
NEXT_ROM ROM_CHECK
I PROCEED TO NEXT RON IF NOT
; GO DO CHECKSUM AND CALL
JMP
SHORT ARE_WE_DONE
; CHECK FOR EtIl OF ROH SPACE
NEXT_RON:
ADO
DX,0060H
I POINT TO NEXT 2K ADDRESS
ARE_WE_DONE:
CMP Jl
DX,OF600H RDH_SCAN_I
; AT F6000 YEn
I GO CHECK ANOTHER ADD. IF NOT
JMP
BASE_RDM_CHK
; GO CHECK BASIC ROM
;-----------------------------------------------
ROS CHECKSUM I I
; DESCRIPTION
A CHECKSUM IS DONE FOR THE 4 ROS
MODULES CONTAINING BASIC CODE
;-----------------------------------------------
E4:
SUB
BX,BX
MOV
DS,OX
CALL
ROS_CHECKSUI'1
I SETUP STARTING ROS AooR I CHECK ROS
5-44 System BIOS
LOC OBJ
f4D 7403 E4E5 £82103 £4E8 £4E8 80C602 E4EB 80FEFE E4EE 75EC E4FO IF
E4F! E4Ft AOI000 E4F4 A601 E4F6 750A E4F8 803£120001 E4FO 7530 E4FF E959FB £502 E502 E421 E504 24BF £506 £621 E50e 8400 ESOA 8A04
ESOC con
E50E 7221
£510 BAF203 E513 52 £514 BOle £516 EE E517 2BC9 £519 £519 E2FE £518 £51B E2FE £510 3302 E51F 8501 £521 66163£00 £525 £85509 £528 7207 £52A 8522 E52C £84E09 E52F 7307 £531 £531 BEEAFF90 £535 £88201
£538 £518 Booe E53A 5A £538 EE
E53C E53C 8£1£00 E53F 8936lADO £543 89361COO £547 89368000 £548 83C620 £54£ 89368200 £552 £421 £554 24FC £556 £621 E558 8030£690 Esse 28F6 ESSE E55E 2£885600
LINE SOURCE
ll25 1126 1127 112:6 1129 1130 1131 1132 ll:n 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 U50 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 117B 1179 UBO 1181 llB2 1183 1184 1185 1186 1187 1188 1189 1190 1191 1112 1193 1194 1195 1196 1197 1198 1199 1200 1201
JE
E5
i CONTINJE IF OK
I POST ERROR
E5:
ADD
OH.02H
· POINT TO NEXT 8K I10CDULE
CMP
DH.OFEH
JHZ
E.
J YES - CONTIJ.lJE
pop
OS
; RECOVER DATA SEG PTR
; -- ---------------------------------- ------- --- ------------ - -- --------
DISKETTE ATTACHMENT TEST
; DESCRIPTION
CHECK IF IPl DISKETTE DRIVE IS ATTACHED TO SYSTEM. IF ATTACHED.
VERIFY STATUS OF NEC FDC AFTER A RESET. ISSUE A RECAl AND SEEK
ctID TO FOC AND CHECK STATUS. COMPLETE SYSTEM INITIALIZATION
THEN PASS CONTROL TO THE BOOT LOADER PROGRAM.
1 - --------------------------------- ---------- - -------------- ------- F9:
MOV
AL.BYTE PTR EQUIP_FLAG I GET SENSE SWS INFO
TEST
AL.OIH
I IPL DISKETTE DRIVE ATICH?
JNZ
FlO
I NO -SKIP THIS TEST
CMP
MFG_TST.l
; MANUFACTURING TEST MODE?
JNE
FlSA
; NO - GO TO BOOT LOADER
JMP flO:
START
I YES - lOOP POWER-ON-DlAGS
IN
AL.INTAOI
J DIS~TEST
ANIl
AL.OBFH
I ENABLE DISKETTE INTERRUPTS
OUT
INTA01,AL
MOV
AH.O
1 RESET NEC FDC
MOV
DL,AH
IHT 13"
JC
Fl3
I (POINT TO DISKETTE) ; VERIFY STATUS AFTER RESET
;----- TURN DRIVE 0 MOTOR ON
F11: F12:
F13:
HOII PUSH MOV OUT
sue
LOOP
LOOP XOR HOV HOV CALL JC MOV CALL JNC
MOV
DX,03F2H DX AL,lCH DX.Al CX,CX
Fll
F12 DX.DX CHol SEEK_STATUS,Dl SEEK F13 CH.34 SEEK F14
51. OFFSET F3
; GET AOOR OF FOC CARD I SAVE IT ; TURN MOTOR ON, EN DMA/INT I WRITE FDC CONTROL REG
I WAIT FOR 1 SECOH!)
; SE LECT DRIVE 0 I SELECT TRACK 1
I RECALIBRATE DISKETTE I GO TO ERR SUBROUTINE IF ERR J SELECT TRACK 34 I SEEK TO TRACK 34 I OK. TURN tlDTOR OFF I DSK_ERR: ; GET ADDR OF MSG I GO PRINT ERROR t1SG
1----- TURN DRIVE 0 MOTOR OFF
F14:
HOV pop
OUT
AL.OCH OX DX.Al
J ORO_OFF: I TURN DRIVE 0 HOTOR OFF I RECOVER FDC CTl ADDRESS
1----- SETUP PRINTER AND RS232 BASE ADDRESSES IF DEVICE ATTACHED
F15A:
NOV MOV HOV MOV ADD MOV IN ANO OUT MOV sua F16: HOV
SI.OFFSET KB_BUFFER BUFFER_HEAD,SI BUFFER_TAIL,SI BUFFER_START ,51 51,32 BUFFER_END.SI AL,INTAOI Al,OFCH INTA01,At BP.OFFSET F4 51.51
DX,CS:[BP)
I SETUP KEYBOARD PARAMETERS I DEFAULT TO STAHOARD BUFFER I (32 BYTES LONG)
I ENABLE TIMER AHO KBD INTS
; PRT_BASE: I GET PRINTER BASE ADOR
System BIOS 5-45
LOC OBJ
E562 BOM E564 EE E565 52 E566 EC E567 SA E568 3eAA E56" 7505 E56C 895408 E56F 46 E570 46 E571 £571 45 E572 4S E573 81FD43E6 £577 75E5 E579 2BDB E57B BAFAOl ES7E EC E57F "aFe E581 7506 E583 C707F803 E587 43 E588 43 E589 E589 8602 E588 EC E58C A8F8 E58E 7506 ES90 C707F802 E594 43 E595 43
£596 ES96 8BC6 E598 BI03 ES9A D2C6 ES9C OAC3 ES9E A21100 ESAI B201 ESA3 EC E5A4 A80F ESA6 7505 ESA8 800E110010 ESAD
E5AO IE E5AE 07 E5AF BF7800 E5B2 B81414 E585 AB E586 AB E5B7 B80101 ESBA AB E5BB AB
E5BC B080 E58E E6AO E5CO 603E120001 E5CS 7406 E5C7 BAOI00 E5CA E80200
EseD EseD CDl9
LINE SOURCE
1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 122:0 1221 1222 1223 1224 IUS 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1236 1239 1240 1241 1242 1243 1244 12:45 1246 1247 1248 1249 1250 1251 1252 12S3 1254 1255 1256 1257 1256 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 12:69 1270 1271 1272 1273 1274 1275 1276 1277 1278
F17: F18!
MOV OUT PUSH IN POP CMP JNE MOV INC INC
INC INC CMP JNE SUB MOV IN TEST JHZ MOV INC INC
t10V IN TEST JHZ MOV INC INC
AL,OAAH OX.AL OX Al,OX OX AL,OA.AH F17 PR INTER_BASE [51 ] · OX 51 51
BP BP BP,OfFSET F4E Fl.
eX,ex
DX,3FAH Al,OX "L,OFaH
Fl.
RS232_BASE[BX J. 3F8H
ex ex
DH.02H AL.DX AL.OF8H F19 RS2:32_8ASEfBX 1.2F8H
ex
BX
J IoiRITE DATA TO PORT A
I READ PORT A
; DATA PATTERN SAME I NO - CHECK NEXT PRJ CD
YES - STORE PRT BASE ADDR ; INCREMENT TO NEXT WORD
J NO_STORE: ; POINT TO NEXT BASE 'u)OR
I ALL POSSIBLE AODRS CHECKED? I PRT_BASE I POINTER TO RS232 TABLE I CHECK IF RS232 CD 1 ATTCH? 1 READ INTR 10 REG
; SETUP R5232 CD I I ADDR
I CHECK IF RS232 CD 2 ATTCH (AT 2FAI ; READ INTERRUPT 10 REG
, BASE_END j SETUP RS232 CO IZ
j----- SET UP EQUIP FLAG TO INDICATE tM1BER OF PRINTERS At-IJ RS232 CARDS
Fl9: f20:
MOV MOV 000 00 MOV MOV IN TEST JNZ 00
i BASE_END:
AX,SI
I 51 HAS 2* tM18ER OF RS232
Cl.3
, SHIFT COUNT
Al,Cl
I ROTATE RIGHT 3 POSITIONS
AL.Bl
I OR IN THE PRINTER COUNT
BYTE PTR EGlUIPJLAG+l ,Al I STORE AS SECOND BYTE
Dl.OIH
; DX::201
Al.OX
AL,OFH
"0
I NO_GAME_CARD
BYTE PR EQUIP_FlAG+l.16
1----- SET DEFAULT TIMEOUT VAlUES FOR PRINTER AND RS232
PUSH POP MOV MOV STOSW STOSW MOV STOSW STOSW
D5
E5
DI.OFFSET PRINT_TIM_OUT
AX,1414H
; PRINTER DEFAULTS ICOUNT::20)
AX,OIOIH
; RS232 DEFAULTS::Ol
;----- ENABLE HHI INTERRUPTS
HOV OUT CMP JE MOV CALL
Al,80H
OAOH .AL MFG_TST,1
"1
DX,l
ERR_BEEP
I ENABLE HHI INTERRUPTS
I MFG MODE? I LOAD_BOaT_STRAP
; BEEP 1 SHORT TONE
F21:
INT
19H
I LOAD_BOOT_STRAP: j BOOTSTRAP
,-------------------------------------------------------
INITIAL RElIABILITY TEST - SUBROUTINES 1----- - ----------- _____________________________________
ASSUME CS:COOE .OS: DATA
;-----------------------------------------------------------------------
; SUBROUTINES FOR POWER ON DIAGNOSTICS
5-46 System BIOS
LOC OBJ
~
ESCF E5CF 9C £500 FA. ESDI IE ES02 £86919 E505 OAFb £507 7418 £509 £5D9 8306 ESOB £62500 ESOE E2FE £5EO FEeE E5E2 75F5 £5£4 803£120001 £5E9 7506 ESEB BOCD £5EO E661 E5EF EBES ESFl ESFl 8301 E5F3 £80000 E5F6 E5F6 ElFE E5F8 FEeA ESFA 75F5 ESFC ESFC ElFE ESFE ESFE E2FE £600 If £601 9D £602 C3
£603 £603 8086 £605 £643 £607 B83305 £60A £642 Eboe 8AC4 EME £642 £610 £461 £612 8AEO £614 oe03 £616 E661 £618 28C9 E6lA E6lA E2FE fbiC FEee £61£ 75FA £620 8AC4 £622 E661 £624 C]
~
£625 £62:5 50 £62:6 8104 £628 02E8 £62A £80300 £620 58 £62£ 240F
LINE SOURCE
1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 130B 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 132B
1329
1330 1331 1332 1333
1334 1335
1336 1337 1338 1339 1340 1341 1342 1343
1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355
THIS PROCEDURE WILL ISSUE ONE LONG TONE (3 SECS) Ate) ONE DR
HORE SHORT TONES (l SEC) TO INDICATE A FAILURE ON THE PLANAR
J
BOARD. A BAD RAM MODULE. OR A PROBLEM WITH THE CRT.
) ENTRY PARAMETERS:
OH ::: HUHBER OF LONG TONES TO BEEP
J
OL = HUMBER OF SHORT TONES TO BEEP
1-----------------------------------------------------------------------
PUSHF
ell
PUSH OS
CALL OR
DDS OH,DH
JZ
G3
Gl:
MOV
BL,6
CALL
BEEP
G2:
LOOP 62
DEC
DH
JHZ Gl
eMP
t1FG.TST,1
JHE
G3
MDV
AL,OCDH
OUT
PORT.B,AL
JMP
SHORT GI
G3:
MOV
BL.I
CALL
BEEP
04'
LOOP
G4
DEC
OL
JNZ
G3
65:
LOOP 65
G6:
lOOP G6
POP
OS
POPf
RET
ENDP
1----- ROUTINE TO SOlH) BEEPER
J SAVE FLAGS I DISABLE SYSTEM INTERRUPTS ; SAVE OS REG CONTENTS
I ANY LONG ONES TO BEEP ; NO, 00 THE SHORT ONES ; LONG.BEEP: J COUNTER FOR BEEPS I DO THE BEEP ; DELAY BETWEEN BEEPS ; ANY MORE TO 00 ; DO IT i MfG TEST MODE? I YES - CONTINUE BEEPING SPEAKER I STOP BLINKING LEO
I COUNTER FOR A SHORT BEEP ; DO THE SoutI)
I DELAY BETWEEN BEEPS I DONE WITH SHORTS J 00 SOME MORE
I LONG DELAY BEFORE RETURN
I RESTORE ORIG CONTENTS OF os
; RESTORE flAGS TO ORIG SETTINGS ; RETURN TO CALLER
BEEP
G7: BEEP
PROC HOY OUT MOV OUT MOV OUT IH MOV OR OUT SUB
LOOP DEC JNZ MOV OUT RET ENDP
NEAR AL,10110110B TIt1ER+3,AL AX,533H TIMER+2,AL AL,AH TlHER+2.AL Al.PORT.B
CX,CX
67 BL 67 Al,AH PORT.B,AL
; SEL TIM 2.lSB.MSB.BINARY ; WRITE THE TIMER MODE REG ; DIVISOR FOR 1000 HZ I WRITE TIMER 2 CNT - lSB
I WRITE TIMER 2 CNT - HSB I GET CURRENT SETTING OF PORT I SAVE THAT SETTING I TURN SPEAKER ON
I SET CNT TO WAIT 500 "S
I DELAY BEFORE TURNING OFF I DELAY CNT EXPIRED! ; NO - CONTltaJE BEEPING SPK I RECOVER VALUE OF PORT
; RETURN TO CALLER
; --------- _____________________________________ _
; CONVERT ANO PRINT ASCII COOE AL MUST CONTAIN NUMBER TO BE CO/'NERTED. :
AX ANO BX DESTROYED.
; -----------------------------------------------
XPC.BYTE
PROC
NEAR
PUSH MOV
AX Cl,4
J RESAVE FOR lOW NIBBLE DISPLAY ; SHIFT COUNT
SHR
Al,Cl
I NIBB LE SWAP
CAll PO. AND
XlAT.PR AX AL,OFH
J DO THE HIGH NIBBLE DISPLAY I RECOVER THE NIBBLE I ISOLATE TO LOW NIBBLE
J FALL INTO LOW NIBBLE CONVERSION
System BIOS 5-47
lOC OBJ
E630 E630 0490 E632 27 E633 1440 E635 27 E636 E636 B40E E638 8700 E63A COlO E63e C3
f630 f630 BC03 Eb3F 7803 E641 7802 E643
E643 E643 BoDe E645 E661 E647 895629 E64"
E64" E2FE
E64C Boce E64E E661 E650 E650 B04C E652 E661 E654 BOFD E656 E621 E656 FB E659 6400 f658 2BC9 E650 E650 F6C4FF f660 7502
f662 E2F9
E664 E664 E460 E666 8A08 E668 Boce E66A E661 f66t C3
E660 f660 FB E66E 50 E66f E461 E67l 8AEO E673 F60D E675 2440 E677 BOE4BF E67" OAC4 E67e E661 E67E BOZO E680 f620 E682 58
Ebe3 CF
E664 E684 884000 E687 BEeo
LINE SOURCE
1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 138" 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410
1411 1412 1413 1414 1415 1416 1417 1416 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432
XlAT_PR PROC ADD DAA ADC DAA
NEAR AL , 090H
AL.040H
~ CONVERT OO-OF TO ASCII CHARACTER ; ADD FIRST cmNERSION FACTOR 5 ADJUST FOR NUMERIC AND ALPHA RANGE ; ADD CONVERSION ANO ADJUST lOW NIBBLE ; ADJUST HI NIBBLE TO ASCII RANGE
HOV HOY INT RET PRT_HEX ENDP XLAT_PR EHOP
AH.14 BH.O 10H
ENDP
'4
LABEL WORD
OW
3BCH
OW
378H
OW
278H
'4E
LABEL WORD
; DISPLAY CHAR. IN AL ; PRINTER SOURCE TABLE
;--------------------.----------------.-------------- ----- ------------
nus PROCEDURE WIll SEND A SOFTWARE RESET TO THE KEYBOARD.
SCAN CODE 'AA' SHOULD BE RETURNED TO THE CPU.
J-----------------------~------------------------------------------------
KBD_RESET
PROC
NEAR
"OV
AL,OCH
OUT
PORT_B,AL
MOV
CX,10562
; SET KBD ClK LINE LOW J WRITE 6255 PORT B ; HOLD KBD CLK LOW FOR 20 HS
LOOP t10V OUT SP_TEST:
MaV OUT
"OV OUT
sn
MOV SUB 69: TEST JNZ lOOP GI0: IN MaV
"OV OUT
RET
KBD_RESET
G6 AL.OCCH PORT_B,AL
Al.4CH PORT_B,AL Al.OFDH INTA01,AL
AH,O cx.CX
AH. OFFH GIO G9
BL,.U
ENDP
; LOOP FOR 20 HS ; SET CLK. ENABLE lINES HIGH
J ENTRY FOR MANUFACTURING TEST 2 J SET KBD ClK HIGH. ENABLE LOW
J ENABLE KEYBOARD INTERRUPTS J WRITE 8259 IHR ~ ENABLE SYSTEM INTERRUPTS I RESET INTERRUPT INDICATOR J SETUP INTERRUPT TIMEOUT CNT
; DID A KEYBOARD INTR OCCUR? ; YES - READ SCAN CODE RETURNED J NO - LOOP TILL TIMEOUT
J READ KEYBOARD SCAN CODE · SAVE SCAN CODE JUST READ ; CLEAR KEYBOARD
; RETURN TO CALLER
; --- ------ - - - -------------------------- - ------- ---- - -----------
BLINK LED PROCEDURE FOR HFG BURN-IN AND RUN-IN TESTS
IF LED IS ON, TURN IT OFf. IF Off. TURN ON.
; - - - - - ------------------------------------- - - ------- - ---- - - ---------
PROC
NEAR
sn
PUSH
AX
; SAVE AX REG CONTENTS
IN
AL,PORT_B
; READ CURRENT VAL Of PORT B
MOV NOT AND AND OR OUT
AH,AL AL AL,01000000B AH,l0l11111B AL,AH PORT_B.AL
I FLIP ALL BITS I ISOLATE CONTROL BIT ; MASK OUT Of ORIGINAL VAL ; OR NEW CONTROL BIT IN
"OV OUT pop
IRET BLIHK_INT
AL,EOI INTAOO,AL AX
ENDP
; RESTORE AX REG
;----- CHECKSUH ANO CALL INIT CODE IN OPTIONAL ROHS
?ROC
NEAR
I10V
AX.DATA
I10V
ES,AX
J SET ES=DATA
5-48 System BIOS
LaC OBJ
E689 2AE4 E688 8.6.4702 E68E BI09 E690 03EO E692 88C8 E694 51 E095 BI04 £697 03E8 E699 0300 £698 59
E69C £88005 E69F 7405 E6Al E86501 E6A4 EBl3 E6A6 E6.o..6 52 HA7 26C70600010300 EbAE 268CIE0201 E6B3 26FFIEOOOI E6B8 5A E6B9 £689 C3
EbBA EbBA £88118 fbeD 803£120001 £6e2 7505 E6C4 MOl EfoC6 E906FF f6C9 E6C9 2E8A04 Ebce 46 E6eD so EbCE E865FF f6P1 58 £602 XOA £604 7SF) f606 C3
E607 20524F4D E60B 00 HOC 0.6.
HOD E60D 50 E6DE B02:0 £6EO f620 £6E2 58 E6El CF
LINE SOURCE
1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483
SUB MOV MOV SHe MOV PUSH MaV SHR ADD pop
AH.AH Al,[BX+2] Cl,09H AX,Cl eX.AX CX Cl,4 AX,CL DX,AX CX
; ZERO OUT AH ; GET LENGTH INDICATOR ; MULTIPLY BY 512 ; SET COUNT
5 SET POINTER TO NEXT MODULE
CALL JZ CAll JHP RON_CHECK_l : PUSH MOV MOV CALL pop RDH_CHECK_EHD : RET ROI1_CHECK
ROS_CHECKSU"CCNT ROM_CHECK_I ROM_ERR SHORT ROM_CHECK_END
J DO CHECKSUM ; PRINT ERROR INFO
OX
I SAVE POINTER
ES: ID_RON_INIT, 0003H
ES: IO_ROM_SEG, os
LOAD OFFSET LOAD SEGMENT
DWORD PTR ES:IO_RDH_INIT
I CALL INIT RTN.
OX
ENDP
; ---------- - ---------------- - ----------- ------------- I THIS SUBROUTINE WILL PRINT A MESSAGE ON TliE DISPLAY
ENTRY REQUIREMENTS:
SI = OFFSET(ADDRESSI OF MESSAGE BUFFER CX = MESSAGE BYTE COUNT
MAXII'1Ut1 MESSAGE LENGTH IS 36 CHARACTERS
J--------------------------------------------------------
P_MS6 PROC
NEAR
CAll
DDS
CHP
MFG_TST ,I
; I1F6 TEST MOOE?
JNE
G12
J NO - DISPLAY ERROR MS6
MOV
DH,I
I YES - SETUP TO BEEP SPEAKER
JHP
ERR_BEEP
I YES - BEEP SPEAKER
G12:
; WRITE_MSG:
MOV
AL,CS:(SIl
1 PUT CHAR IN AL
IHC
51
; POINT TO NEXT CHAR
PUSH
AX
; SAVE PRINT CHAR
CALL
PRT_HEX
i CAll VIDEO_IO
POP
AX
i RECOVER PRINT CHAR
CHP
AL,10
; WAS IT LINE FEED
JHE
G12
; NO,KEEP PRINTING STRING
RET
P_MSG ENDP
nA
DB
' ROM',I3,IO
1484 1485 1486 1487 1488 1489 1490 1491 1492
1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507
D.EOI D_EOI
,,"DC PUSH
MDV OUT POP IRET EtIlP
HEAR AX AL,20H 20H.AL AX
1--- INT, 19 ---------------------------------------------------- ; BOOT STRAP LOADER
IF A 5 114" DISKETTE DRIVE IS AVAIlABLE ON THE SYSTEM, TRACK O. SECTOR 1 IS READ INTO TliE BOOT LOCATION (SEGMENT O. OFFSET 7COO) AND CONTROL IS TRANSFERRED TliERE.
IF THERE IS NO DISKETTE DRIVE, OR IF TliERE IS A HARDWARE ERROR CONTROL IS TRANSFERRED TO TliE RESIDENT BASIC ENTRY POINT. I ; IPL AS$(J1PTIONS:
8255 PORT 60H BIT 0 = 1 IF IPL FROM DISKEnE
1 --------------------------- ------------ - - ------------------ ASSUME CS:CODE,DS:ABSO
System BIOS 5-49
LOC OBJ
E6E4 E6E4 £A007COOOO E6F2 E~F2 E6Ft: FB Eon ZBCO EoF5 8E08
EoF7 C7067800C7EF E6FD 8COE7AOO E701 All004 E704 A801 £106 741E
E708 890400 E70B E70B 51 E70e B40D
E70E con
E710 720F E712 B80102 E715 2802 E717 8EC2 E719 BBDD7C E7IC 890100
E71F con
E721 59
E722 nco
£724 E2:E5
£726 E7t6 COIS
LINE SOURCE
1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 152:4 15" 1526 152:7 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545
15"
1547 1548 154q 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584
1----- IPL MAS SUCCESSFUL
H4: JMP
OIlG eOOT_STRAP
sn
SUB I10V
BOOT_lOCN OE6F2H PROC NEAR
AX.AX DS.AX
I ENABLE INTERRUPTS
1----- RESET DISKETTE PARAMETER TABLE VECTOR
MOV HOV MOV TEST JZ
WORD PTR DISK_POINTER, OFFSET DJ:SK_BASE
WORD PTR DISK_POINTER-t2,CS
AX,DATA_WORO[ OFFSET EQUIP_flAG J 1 GET THE EQUIPMENT SWITCHES
AL,l
I ISOLATE IPL SENSE SWITCH
HJ
; GO TO CASSETTE BASIC EHTRY POINT
1----- MUST LOAD SYSTEM FROf1 DISKETTE - CX HAS RETRY COUNT
MOV
CX,4
HI:
I SET RETRY COUNT ; IP __SYSTEtI
PUSH CX
I SAVE RETRY COUNT
MOV
AH,O
INT
lJH
I RESET THE DISKETTE SYSTEM ; DISKETTE_IO
JC
H2
; IF ERROR., TRY AGAIN
MOV
AX,20iH
I READ IN THE SINGLE SECTOR
SUB
OX,DX
MOV
ES,DX
HOV
BX,OFFSET BOOT_LOCH
MOV
CX ··
INT
lJlt
I SECTOR 1, TRACK a
i DISKETTE_IO
H2 :
POP
CX
I RECOVER RETRY COUNT
JNC
H'
LOOP HI
I CF SET BY UNSUCCESSFUL READ 1 DO IT FOR RETRY TIMES
1----- lR-IABLE TO IPL FROI'1 THE DISKETTE
H3:
INT 18H
1 CASSETTE_JU1P: i USE INTERRUPT VECTOR TO GET TO BASIC
1-----INT 14----- - - - - - ------------------- - - ---- - - - - - - - - - - - --- - - - - --
1 RS232_IO
I
THIS ROUTINE PROVIDES BYTE STREAM 1/0 TO THE COMt1UNICATIONS
PORT ACCORDING TO THE PARAMETER'S:
(AH )=0 INITIALIZE THE COMMUNICATIONS PORT
IAU HAS PARAMETERS FOR INITIALIZATION
----- BAli) RATE -
ODD - no
001 - 150 OlD - 300 011 - 600 100 - 1200
101 - 2400 110 - 4800 III - 9600
-PARITY- XO - HONE 01 - 000 11 - EVEN
2
STOPSIT
a- 1
1- 2
--WORD LENGTH- 10 - 7 BITS 11 - 8 BITS
ON RETURN, COt-lJITIOHS SET AS IN CALL TO COMMO STATUS (AH=3) (AH)=1 SEND THE CHARACTER IN tAL) OVER THE COMMO LINE
(AU REGISTER IS PRESERVED ON EXIT, BIT 7 OF AH IS SET IF THE ROUTINE WAS UNABLE
TO TRAHSI1IT THE BYTE OF DATA OVER THE LINE. IF BIT 7 OF AH IS HOT SET, THE REMAINDER OF AH IS SET AS IN A STATUS REQUEST. REFLECTING THE CURRENT STATUS OF THE LINE. (AHJ=2 RECEIVE A CHARACTER IN (AU FROM COMMO LINE BEFORE RETURNING TO CALLER ON EXIT. AH HAS THE CURRENT LINE STATUS. AS SET BY THE THE STATUS ROUTINE, EXCEPT THAT THE ONLY BITS LEFT ON ARE THE ERROR BITS 17,4,3,2,1) IF AH HAS BIT 7 ON (TIME OUll THE REMAINING BITS ARE NOT PREDICTABLE. THUS, AH IS NOH ZERO ONLY WHEN AN ERROR
5-50 System BIOS
LaC OBJ
,~
"'"
E7Z9 E7U E729 1704 E72B 0003 E72D 8001 E72F COOO Enl 6000 E733 3000 E735 1800 En7 OCOO
E739
"'"
E739 FB E73A IE E73B 52 E73C 56 E73D 57 E73E 51 E73F 53 E740 8BF2 E742 8BFA E744 DIE6 E746 E8FS17 E749 8B14 E748 OBD2 E74D 7413 E74F OAE/'t E751 7416 E753 FECC E755 7445 E757 FEec E759 746A E75B E75B FEte E750 7503 E75F E98300 E762 E762 58 E763 59 E764 5F E76S 5E E766 SA
LINE SOURCE
1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1606 1609 1610 1611 161Z 1613 1614 1615 1616 1617 1618 1619 16Z0 1621 1622 1623 16Z4 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661
(AH)=3
OCCURRED.
RETURN THE caMMO PORT STATUS IN (AX)
AH CONTAINS THE LINE STATUS BIT 7 1: TIME OUT BIT 6 = TRANS SHIFT REGISTER EMPTY BIT 5 = TRAN HOLDING REGISTER EMPTY
BIT 4 = BREAK DETECT BIT 3 = FRAMING ERROR BIT 2 = PARITY ERROR BIT 1 = OVERRUN ERROR BIT 0 = DATA READY
Al CONTAINS THE HeDEH STATUS
BIT 7 1: RECEIVED LINE SIGNAL DETECT
BIT 6 1: RING INDICATOR
BIT 5 1: QATA SET READY
BIT 4 1: CLEAR TO SEND
= BIT 3 DELTA RECEIVE LINE SIGNAL DETECT
BIT 2 = TRAILING EDGE RWG DETECTOR
BIT 1 1: DELTA DATA SET READY
BIT 0 1: DELTA CLEAR TO SEND
,
(OX) ';: PARAMETER INDICATING WHICH RSZ32 CARD (Dol ALLOWED)
1 DATA AREA RS232_BASE CONTAINS THE BASE ADDRESS OF THE 8250 ON THE
CARD LOCATION 400H c:aHTAINS UP TO 4 RSZ32 ADDRESSES POSSIBLE
DATA AREA LABEL RSZ32_TIM_OUT (BYTE) CONTAINS OUTER LOOP COUHT
VALUE FOR TIMEOUT (DEFAULT=I)
; OUTPUT
AX MODIFIED ACCORDING TO PARMS OF CALL
ALL OTHERS UNCHANGED
j-----------------------------------------------------------------------
ASSUtlE CS :CODE ,DS:OATA
OR.
OE729H
Al
LABEL WORD
; TABLE OF INlT VALUE
OW
1047
I 110 BAUD
OW
766
j 150
OW
364
; 300
OW
192
i 600
OW
%
; 1200
OW
46
I 2400
OW
24
j 4800
OW
12
I 9600
RS232_IO
""OC FAR
j----- VECTOR TO APPROPRIATE ROUTINE
sn PUSH OS
PUSH
OX
PUSH
51
PUSH 01
PUSH cx PUSH ex
MOV
SI,OX
HOV
DI,OX
SHL
SI'!
CALL
MOV
DDS OX, RS232_BASE [SI I
OR
OX,OX
JZ
A3
OR
AH,AH
JZ
A4
DEC
AH
JZ
A.
DEC
AH
JZ
A12
A2 :
DEC
AH
JHZ
A3
JHP
A16
A3:
pop
6X
pop
CX
POP
01
POP
51
POP
ox
I INTERRUPTS BACK ON j SAVE SEGMENT
I RS232 VALUE TO 51
I WORD OFFSET
; GET BASE ADDRESS I TEST FOR 0 BASE ADDRESS I RETURN ; TEST FOR I AH 1=0 i COMHUH INIT I TEST FOR (AH )=1 I SEND AL i TEST FOR I AH )=2 ; RECEIVE INTO AL
; TEST FOR (AHI=3
I COl1MUNICATION STAnJS J RETURN FROM RS232
System BIOS 5-51
LOC OBJ
E767 IF E768 CF
E769 E769 8AEO E768 83C203 E76E B080 E770 EE
E771 8A04 E773 BI04 E775 02C2 E777 81E20EOO E77B BF29E7 E77E D3FA E780 8814 E782 42 E783 2E8A4501 E787 EE E788 4A E789 2E8A05 E78C EE E780 83C203 E790 8A.C4 E79Z 241F E794 EE E795 4A E796 4A E797 BODO E799 EE E79A E849
E79C E79C 50 E790 83C204 E7AO B003 E7A2 EE E7A3 42 E7A4 42 E7A5 8730 E7A7 E84800 E7AA 7408 E7AC E7AC 59 E7AD 8ACl E7AF E7AF 80ce80 E782 EBAE E7B4 E784 4A E785 E7B5 8720 E7B7 E83800 E7BA 75FO E7BC E7BC 63EA05 E7BF 59 E7CO 8ACI E7C2 EE E7C3 E890
E7C5 E7C5 83C204 E7C8 8001 E7CA EE E7CB 42 E7ee 42 E7CD E7CD BnD
LINE SOURCE
1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738
pop
OS
IRET
I RETURN TO CALLER. NO ACTION
1----- INITIALIZE THE COtH.tUtATIONS PORT
A4:
MOV
AH,AL
ADD
OX,l
MOV
AL,60H
OUT
aX,AL
; SAVE INIT PARMS IN AH I POINT TO 8250 CONTROL REGISTER
; SET OLAB=1
;----- DETERMINE BAUD RATE DIVISOR
MDV MOV ROL
AND
MDV ADD MDV
INC
MDV OUT DEC MOV
OUT
ADD MOV
AND OUT
DEC DEC MDV OUT JMP
Ol,AH Cl,4 Dl,Cl DX,OEH OI,OFFSET Al OI,DX OX, RS232_BASE [SI 1 OX Al,CS:(DI1+l DX,Al OX Al,CS:(DIl DX,Al DX,3 Al,AH Al,OlFH DX,Al OX OX Al,O DX,Al SHORT Al8
I GET PARMS TO 0 l
; ISOLATE THEM I BASE OF TABLE ; PUT INTO INDEX REGISTER I POINT TO HIGH ORDER OF DIVISOR
; GET HIGH ORDER OF DIVISOR I SET MS OF DIV TO 0
1 GET lOW ORDER OF DIVISOR i SET lOW OF DIVISOR
; GET PARMS BACK ; STRIP OFF THE BAUD BITS ; lINE CONTROL TO 8 BITS
; INTERRUPT ENABLES All OFF I COM_STATUS
1----- SEND CHARACTER IN (All OVER CoMMo lINE
AS:
A7: AS: A9: AID: All:
PUSH ADD MOV OUT INC INC MoV CALL JE
pop MOV
AX DX.4 Al.3 DX.Al OX OX SH,30H WAITJOR_STATUS A9
CX
OR
AH.80H
JMP
Al
DEC
OX
MOV CAll JNZ
BH,20H WAITJOR_STATUS A7
SUB POP MDV OUT JMP
1 SAVE CHAR TO SEND ; MODEM CONTROL REGISTER ; DTR AND RTS ; DATA TERMINAL READY, REQUEST TO SEND ; MODEM STATUS REGISTER
I DATA SET READY & CLEAR TO SEND I ARE BOTH TRUE ; YES, READY TO TRANSMIT CHAR
I RELOAD DATA BYTE
I ItIlICATE TIME OUT ; REnJRN ; ClEAR_TO_SEND ; lINE STATUS REGISTER ; WAIT_SEND I IS TRANSMITTER READY I TEST FOR TRANSMITTER READY I RETURN WITH TIME OUT SET ; OUT_CHAR J DATA PORT ; RECOVER IN CX TEMPORARILY I MOVE CHAR TO Al FOR OUT, STATUS IN AH I OUTPUT CHARACTER I RETURN
1----- RECEIVE CHARACTER FROM CoMMo lINE
A12: ADD MOV OUT
INC INC
A13:
MOV
OX,4 Al,l DX.Al OX OX
BH,20H
I MODEM CONTROL REGISTER I DATA TERMINAL READY
1 MODEM STATUS REGISTER
; WAIT_DSR I DATA SET READY
5-52 System BIOS
LOC OBJ
~
E7CF E8Z000 E70:?: 750B E704 E704 404 E7DS E7D5 8701 E7D7 E81800 E70A 75D3 E?De E7DC 80E41E E7DF 8814 E7fl Ee E7E2 E97DFF
E7f5 E7£5 8814 E7E7 83C2:05 E7EA Ee E7E8 BAED E7ED 42 E7EE EC E7EF E970FF
.~
E7F~ E7FZ 8A5D7C E7FS E7F5 ZBC9 E7F7 E7F7 EC E7F8 8AEO E7FA 22C7 E7FC lAC7 E7FE 7408 E800 E2F5 E802 FECB E804 75EF E806 OAFF ES08 E808 C3
~
E809 E809 52 E80A 50 f80S 8CDA EeoO 81FAOOC8 E8ll 7E13 E813 8AC6 E8l5 E800Ff E818 8AC2 Eau EBoaFE E81D BED7E6 E820 E897FE E823 E823 58 E824 SA Ea2S Cl E826 E826 8.1.0201 E8Z9 E8A3FD E8ZC ESF5
LINE SOURCE
1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 17a6 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815
A15: .6016:
.1.17:
CALL JNZ
WAIT_FOR_STATUS .8
DEC
OX
ItOV
CALL
JHZ
BH.t WAIT_FOR_STATUS .8
AND
AH,OOOl1l10B
ItOV
DX.RS232_BASE[SI I
IN
AL.DX
JMP .3
I TEST FOR DSR I RETURN WUlI ERROR I WAIT_DSR_EHD I lINE STATUS REGISTER J WAIT_RECY , RECEIVE BUFFER FULL j TEST FOR REC. BUFF. FULL I SET TIME OUT ERROR I GET_CHAR I TEST FOR ERR CONDITIONS ON RECY CHAR I DATA PORT ; GET CHARACTER FROt1 LINE f RETURN
1----- C0l1l'10 PORT STATUS ROUTINE
A18:
ItOV
DX.RS232_BASE[ 51 J
ADD
OX.S
I C~OL PORT
IN
AL.DX
I GET LINE CONTROL STATUS
ItOV
AH.AL
J PUT IN AH FOR RETURN
INC
OX
I POINT TO HooEH STATUS REGISTER
IN
AL.DX
I GET MODEM CONTROL STATUS
JMP
A3
; RETURN
1-~- - - ---- --------------------------- 1 WAIT FOR STATUS ROUTINE
I
1 ENTRY:
8H=STATUS SIT(S) TO LOOK FOR.
oX=ADDR. OF STATlJS REG
I EXIT:
I
ZERO FLAG ON = STATUS FOUND
ZERO FLAG OFF = TIMEOUT.
; --------A-H-=-L-AS-T--S-T-A-T-U-S---R-EAD-------------
WAITJOR.STATUS PROC
NEAR
MOV
BL.RS232.TI~OUT[DI J
; LOAD OUTER LOOP COUNT
WFSO:
SlJ!l WFSl:
cx.ex
IN
AL,DX
1 GET STATUS
HOV
AH,.\l
i MOVE TO AH
AND
AL.SH
I ISo .....TE BITS TO TEST
CHP
Al.SH
f EXACTLY = TO MASK
JE
WFS.END
I RETURN WITH ZERO F LAG ON
LOOP
WFSI
; TRY AGAIN
DEC
8L
JHZ
WFSO
OR
BH.SH
1 SET ZERO FLAG OFF
WFS.EHD:
RET
WAITJOR_STATtJS ENDP
RSZ32.IO
ENDP
1--------------------------------------------------------.---------------
I
PRINT ADDRESS AND ERROR MESSAGE FOR ROM CHECKSUM ERRORS
1-----------------------------------------------------------------------.
ROtLERR PRDC
NEAR
PUSH OX
J SAVE POINTER
PUSH AX
MOV
OX.DS
1 GET ADDRESS POINTER
CHP
ox.ocaOOH
JLE
ROM.ERR.SEEP
; SPECIAL ERROR INDICATION
MDV
AL.OH
CALL
XPC.BYTE
I DISPLAY ADDRESS
MOV
AL.OL
CAll
XPC.BYTE
ItOV
SI.OFFSET F3A
1 DISPLAY ERROR HSG
CALL
P.MSG
ROH_ERR.END :
POP
AX
pop
OX
RET
ROM.ERR.BEEP:
HOV
OX.DI02H
; BEEP 1 LONG. 2 SHORT
CALL
ERR.BEEP
JHP
SHORT ROt1.ERR.END
System BIOS 5-53
LOC OBJ
f82E f8ZE f82:E FB EeZF IE E830 53 E831 E80A17 E834 OAE4 E836 740A E838 FEee E83A 741E Eelt FEee £63E 742B E840 EBlt
£842 £842 FB f843 90 E844 FA £845 8BIEl.l.OO £849 381EICOO £840 74F3 E84F 8B07 E651 E8}DOO E8S4 891ElAOO E858 EB14
E85A E85A FA E85B 8BIElAOO E85F 3BlEICOO E863 8B07 E865 FB E866 56 E867 IF E868 tA0200
EMe E86B .6.01700 E66E EabE 58 E86F IF E870 CF
Ee71 £871 43 E872 43
LINE SOURCE
1816 1817 1818 1819 1620 162:1 1822 1823 1824 1825 1826 1827 1826 1629 1830 1811 1832 1833 1834 1835 1836 1837 18. . 1839 1840 1841 1842: 1843 184. 1845 184. 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892
; --- INT 16 ---.------------------- - --------------------------------- I KEYBOARD 110
I
THESE ROUTINES PROVIDE KEYBOARD SUPPORT
I INPUT
(AH )=0 READ THE NEXT ASCII CHARACTER STRUt:K FROM THE KEYBOARD
RETURN THE RESULT IN Uli. SCAN CODE IN (AH)
(AH)= 1 SET THE Z FLAG TO INDICATE IF AN ASCII CH.ARACTER IS
AVAILABLE TO BE READ.
(IF)=l - NO cODE AVAILABLE
(IF )=0 - CODE IS AVAILABLE
IF ZF = 0, THE NEXT CHARACTER IN THE BUFFER TO BE READ
IS IN AX. AND THE ENTRY REMAINS IN THE BUFFER
(AHI=2 RETURN THE CURRENT SHIFT STATUS IN AL REGISTER
THE BIT SETTINGS FOR THIS CODE ARE INDICATED IN THE
THE EQUATES FOR KBJLAG
; OUTPUT
AS NOTED ABOVE I ONLY AX AND flAGS CHANGED
ALL REGISTERS PRESERVED
1----------------------------------------------------------------------.
ASSUME CS:CODE,DS:DATA
OR'
KEYBOARD_IO
sn
oEa2EH
PROC
FAR
; INTERRUPTS BACK ON
PUSH
OS
PUSH ex
I SAVE CURRENT OS I SAVE BX TEMPORARILY
CAll DOS
OR
AH,AH
I AH=O
JZ
01
; ASCII_READ
DEC
AH
; AH=l
JZ
0'
DEe AH
J ASCII_STATUS ; AH=2
JZ
03
; SHIFT_STATUS
JHP
SHORT INTlO_END
; EXIT
;----- READ THE KEY TO FIGURE OUT WHAT TO DO
Kl:
sn
NOP
eLI
HOY
BX,BUFFER_HEAD
CHP
BX,BUFFEICTAIL
JZ
01
HOY
AX,IBX]
CALL 04
HOV
BUFFER_HEAD,ex
JHP
SHORT INTIO_EHD
1----- ASCII STATUS
, ASCII READ ; INTERRUPTS BACK ON DUIHNG LOOP I AllOW AN INTERRUPT TO OCCUR , INTERRUPTS BACK OFF I GET POINTER TO HEAD OF BUFFER ; TEST EI'I) OF BUFFER
; LOOP UNTIL SOMEllHNG IN BUFFER ; GET SCAN CODe 041'1) ASCII CODE ; MOVE POINTER TO NEXT POSITION ; STORE VALUE IN VARIABLE ; RETURN
K2:
ell
I10Y
ex,eUFFER_HEAD
CHP
Bx.eUFFER_TAIL
HOY
Ax.(eX]
sn
POP
ex
POP RET
,OS
I INTERRUPTS OFF ; GET HEAD POINTER ; IF EQUAL (l=l' THEN NOTHING TliERE
; INTERRUPTS BACK ON ; RECOVER REGISTER i RECOVER SEGMENT ; THROW AWAY FLAGS
1----- SHIFT STATUS
pop POP IRET KEYBOARD_IO
AL.KB]LAG BX OS
ENDP
;----- INCREMENT A eUFfER POINTER
04
PROC NEAR
INC
ax
INC
ex
I GET THE SHIFT STATUS FLAGS ; RECOVEIJ REGISTER I RECOVER REGISTERS ; RETlJRN TO CALLER
I MOVE TO NEXT WORD IN LIST
5-54 System BIOS
LOC OBJ
£873 38IEB:!OO f877 7504 f879 881E8000 '870 E870 Cl
/""""'\
f87£ f87E 52 f87F 3" E880 45 f881 46 E882 38 E883 ID E884 2A £885 36
0008
£886 f886 80 E887 40 ESBa 20 E889 10 E88A 08 E8B8 04 ESSC 02 Ee80 01
~
/""""'\
E88E 18 ESSF FF ES90 00 ES91 FF ES9Z FF £S9l FF ES94 IE £895 FF E896 FF ES97 FF E898 FF EM9 IF E89A Ff ES9B 7F ES9C FF ES9D 11 EMf 17 ES9F 05 ESAO 12 ESAI 14 ESA2 19 ESAl 15 ESA4 09 ESA5 Of ESA6 10 E8A7 16 ESA8 10 ESA9 OA ESAA FF ESA6 01 fSAt II ESAO 04 ESAE 06 ESAF 07 ESBO OS E8Bl OA ESB2 08 ESBl DC ESB4 fF E8BS FF E8B6 FF EOO7 FF E888 It
LINE SOURCE
1M3 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904
CHP
eX.BUFFER_EtC)
JH' .S
HOY
eX,BUFFER_START
K5:
RET
·· 'NOP
I AT END OF BUFFER? I HO, CONTIMJE I YES. RESET TO BUFFER BEGINNING
1----- TABLE OF SHIFT KEYS AND HASK VALUES
'6
LABEL BYTE
DB
INS_KEY
I INSERT KEY
DB
CAPS_KEY .~KfY ,SCROLL_KEY .ALl_KEY ,tTl_KEY
1905
1906 1907 1908 1909 1910 1911 1912
DB
lEFT_KEY,RIGHT_KEY
''''' ,6l
$-K6
1----- SHIFT_HASK_TABLE
.7
LABEL BYTE
DB
INS_SHIFT
I INSERT HODE SHIFT
DB
CAPS_SHIfT ,H\A'LSHIFT ,SCROLL_SHIFT .ALT_SHIFT ,CTl_SHIFT
1913
1914 1915 1916 1917
DB
LEFT_SHIFT .RIGHT_SHIFT
1----- SCAN CODE TABLES
.8
DB
2:7,-1,0. -1, -1,·1,30.-1
1915
DB
-1,-1,-1,]1,-1,127,-1, J7
1919
DB
2l.S, 18,20 ,25,21. 9.15
1920 19,1
DB
16.27.29,10,-1,1,19
DB
4,6,7,8,10.11,12,-1,-1
1922
DB
-1, -I, 28,26 ,21t,l,22,2
System BIOS 5-55
LOC OBJ
E8B9 lA E8BA 16 EBBB 03 ESBC 16 E8BD 02 E8BE DE ESBF 00 E8CO FF ESCI FF EBCZ FF E8t3 FF E6C4 FF EatS FF E8C6 20 E8C7 FF
E8C8 E8C8 SE E6C9 SF ESCA. 60 Eacs 61 ESCC 62 ESCD 63 ESCE 64 E6CF 65 ESDO 66 E8Dl 67 E8D2 FF E6D3 FF E8D4 77 E8D5 FF E806 64 E807 FF E6D8 73 E809 FF EBDA 74 E6DB FF ESDC 75 E80D FF ESCE 76 E8DF FF E8EO FF
E8El E8El 18 E8E2 31323334353637
3639302030 ESEE 08 E6EF 09 EBFO 71776572747975
696F705BSD E8Ft 00 ESFD FF EaFE 6173646667686A
6B6C3B E908 27 E909 60 E90A FF E90B 5C E90C 7A786376626E60
2C2E2F E916 FF E9l7 2A E918 FF E9l9 20 E91A FF
E9lB E9lB IB E9le 21402324 Eno 25 E921 5E E922 262A28295F2B En8 08 En9 00 EnA 51574552545955
494F507B70
LINE SOURCE
1923
DB
14.13.-1. -1. -1. -1.-1,-1
1924
1925 1926 1927
DB
0._1
; ---- tTL TABLE SCAN
K9
LABEL BYTE
DB
94 .95. 96 ,97 ,98, 99 .100 ,101
1928
DB
102.103.-1.-1.119. -1,132.-1
1929
DB
115. -1.116.-1 ,117. -1,118.-1
1930 1931 1932 1933
DB
;----- lC TABLE
Kl.
LABEL BYTE
DB
-1 OlBH, I 1234567690-= I ,08H. 09H
19'"
DB
oqwer-tyuiop[ ] I ,DOH. -1. 'lIsdfghjkl; ·· 027H
1935
DB
60H. -1.5CH. 'Z)(cvbnnl ·· /' · -1. '.' .-1 ··
1936 1937 1938 1939
DB
1----- UC TABLE
Kll
LABEL BYTE
DB
-1 27. 0 !i).$' · 37.05EH. 0 &*( )_+ 0 ,08H. 0
1940
DB
o QWERTYUIOPO 0 · DOH ,_1. 0 ASOFGHJKL :'"
5-56 System BIOS
Loe OBJ
~ ~
E9]6 00 E937 FF E936 41534446474844
484C3A22 E943 7E £944 FF E945 7CSA584356424E
4D1C1E1F E950 FF E951 00 E952 FF E953 20 E954 FF
E955 E955 54 E956 55 E957 56 E958 57 E959 58 E95A 59 E958 5.60 E95C 58 E95D SC E95E 50
E95F E95F 68 E960 69 E961 6A E962 68 E961 bC [964 60 E965 6E E966 6F E967 70 E968 71
.96.
E969 373839203435'36 2B31323330ZE
E976 E976 47 E977 48 E978 49 E979 FF E97A 48 E97B FF f97e 40 E970 FF E97E 4f E97F 50 E980 51 E981 52 E982 53
~
E987 E987 n87 F8 E988 50 E989 53 E98A 51 E98B 52 E98C 56 EQ80 57 E98E IE E98F 06 E990 Fe E991 E8AAIS E994 E460 E996 50 E997 E461 E999 BAEO E99B OC80
LINE SOURCE
1941
DB
07EH. -1. ' IlXCYBNM<>? ' ,-1.0. -1.' · ,-1
1942 1943 1944
;----- UC TABLE SCAN
K12
LABEL BYTE
DB
84.85.86,67,88.89.90
1945
DB
91.92:,93
1946 1947 1948
; ---- AlT TABLE SCAN
KI3
LABEL BYTE
DB
104,105,106,107,108
1949
DB
109.110,111,112.113
1950 1951 1952
1953 1954 1955
;----- NU1 STATE TABLE
K14
LABEL BYTE
DB
·769-456+1230. '
· - --- BASE CASE TABLE
K15
LABEL BYTE
DB
71.72,73.-1.75,-1.77
1956
DB
-1.79,80.81,82.83
1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977
l----- KEYBOARD INTERRUPT ROUTINE
KB_INT
DR. PROC STI PUSH PU5H PUSH PU5H PUSH PUSH PUSH PUSH CLO CALL IN PUSH IN MOV dO
OE987H FAR
AX BX
ex ox
SI DI OS ES
005 AL.KB_DATA AX AL.KB_cn AH.Al Al.80H
; ALLOW FLRTHER INTERRUPTS
J FORWARD DIRECTION I READ IN THE CHARACTER ; SAVE IT ; GET THE CONTROL PORT ; SAVE VALUE J RESET BIT FOR KEYBOARD
System BIOS 5-57
LOC OBJ
E99Q E661 E91j1F 66EO E9Al E661 E9A.3 58 E9.604 BAED
E9...6 3eFF E9"8 7503 E9AA. E97"02
E9AD E9AD 247F E9"F DE E980 07 E981 BF7EE8 E964 890800 E987 F2 E988 AE E989 8"C4 E9BB 7403 E9BD E98500
E9CO 81EF7FE8 E9C4 2E8AA586E8 E9C9 A880 E9CB 7551
E9CD 80FCI0 E9DO 7307
E9D2 08261700 E9D6 E98000
E9D9 E9D9 F606170004 E90E 7565 E9EO 3C52 E9E2 7522 E9E4 F606170008 E9E9 755A E9EB F606170020 E9FO 7500 E9F2 F606170003 E9F7 7400
E9F9 E9F9 B83052 E9FC E90601
nFF
E9FF F606170003 EA04 74F3
EA06 EA06 84261800 EAOA 7540 EADC 08261800 EAI0 30261700 EA14 3C52 EA16 7541 EA18 B80052 EAIB E9B701
EAIE
LINE SOURCE
1978 1979 1... 1981 1962 1983 1984 1965 1986 1987 1988 1989 1990 1991 1992 1993 1994 l<;l95 1996 1997 1998
1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2:036 2:037 2:038 2:039 2040 2041 2042 2043 2044 2045 2046 2:047 2048 2049 2050 2051 2052 2053
OUT XCHG OUT pop
Mev
KB_CTL,AL AH,Al KB_CTL,AL AX AH,AL
I GET BACk ORIGINAL CONTROL , KB HAS BEEN RESET , RECOVER SCAN CODE I SAVE SCAN CODE IN AH ALSO
1----- TEST FOR OVERRLN SCAN CODE FROM KEYBOARD
CMP
AL.OFFH
JHZ
016
JMP
062
; IS THIS AN DYE"RRUN CHA.R I NO. TEST FOR SHIFT KEY ; BUFFERJUll_BEEP
1----- TEST FOR SHIFT KEYS
K16:
ANO PUSH POP MOY MOY REPNE
AL,07FH CS ES DI. OFFSET K6 CX,K6L SCAse
I TEST_SHIFT 1 TURN OFF THE BREAK BIT
I ESTABLISH ADDRESS OF SHIFT TABLE I SHIFT KE¥ TABLE I LENGTH , LOOK THROUGH THE TABLE FOR A I1ATCH
tIDy
AL,AH
JE
017
JMP
025
, RECOVER SCAN CODE I JUMP IF HATCH FOlHJ I IF NO MATCH. THEN SHIFT HOT FOUND
I ~---- SHIFT KEY FOlNl
K17=
SUB tIDy TEST JHZ
DI.OFFSET K6+1 AH.CS:K7tDIJ
AL.80H
on
I ADJUST PTA TO SCAN CODE mCH I GET MASK INTO AH ; TEST FOR BREAK KEY i BREAK_SHIFTJOUNl
;----- SHIFT HAKE FOUND, DETERMINE SET OR TOGGLE
CMP JAE
AH.SCROLL_SHIFT 016
IF SCROLL SHIFT OR ABOVE. TOGGLE KEY
; ---- PLAIN SHIFT KEY, SET SHIFT ON
OR
KB_FlAG.AH
JMP
026
; TURN ON SHIFT BIT I INTERRUPT_RETURN
1----- TOGGLED SHIFT KEY. TEST FOR 1ST HAKE OR NOT
K18; K19:
TEST JHZ CMP JHZ TEST JHZ TEST JHZ TEST JZ
I SHIFT-TOGGLE
KB_FlAG. CTl_SHIFT
J CHECK CTl SHIFT STATE
025
; JII1P IF tTl STATE
AL. INS_KEY
J CHECK FOR INSERT KEY
022
I JUMP IF NOT INSERT KEY
KBJLAG. ALT_SHIFT
I CHECK FOR AlTERNATE SHIFT
025
i JUHP IF ALTERNATE SHIFT
KBJLAG. NUJ",-STATE
I CHECK FOR BASE STATE
021
I JUMP IF NUl'1 LOCK IS ON
KBJLAG. LEFT_SHIFT+ IHGHT_SHIFT
K22
i JUMP IF BASE STATE
K20: K2:1 :
MOY JMP
TEST JZ
; NUHERIC ZERO. NOT INSERT KEY
AX. 5UOH
; PUT OUT AN ASCII ZERO
057
; BUFFERJIlL
I HIGHT BE HUMERIC
KB_FlAG. LEFT_SHIFT+ RIGHT_SHIFT
02.
; JUMP NUMERIC. NOT INSERT
K22:
TEST JI~Z OR XOR CMP JHE tIDy JMP
AH.KBJLAG_l 02. KB_FLAG_l.AH KBJLAG.AH Al.INS_KEY 026 AX .IH5_KEV*256 057
; SHIFT TOGGLE KEY HIT. PROCESS IT I IS KEY ALREADY DEPRESSED I JUMP IF KEY ALREADY DEPRESSED ; INDICATE THAT THE KEY IS DEPRESSED I TOGGLE THE SHIFT STATE ; TEST FOR 1ST MAKE OF INSERT KEY · JUMP IF NOT INSERT KEY i SET SCAN CODE INTO AH. 0 INTO Al I PUT INTO OUTPUT BUFFER
I-~--- BREAK SHIFT FOUND
K2:3:
I BREAK-SHIFT-FOlNJ
5-58 System BIOS
~
LOC DBJ
fAIE SOFtiO fA21 73lA EA23 F6D4 EA2520261700 EA29 3ee8 fAZB 752C
EAZC A01900 EA30 8400 EA32 86261900 EA36 3eoo EA38 741F EAJA E9AI01 EAJC EA30 F6D4 EA3F 20261800 fA43 EB14
~
EA4S EA45 3C80 EA47 7310 EA49 F606180008 EA4E 7417 EASO 3C45 EA52 7405 EA54 80261800f7 EA59 EAS9 FA EA5A 8020 EASC E620 EASE EASE 07 EASF IF EA60 SF EA61 5E EA62 SA EA63 59 EA64 58 EA65 58 EA66 CF
EA67 EA67 F60617000e EA6C 7503 EA6E E99100
EA7l EA7l F606170004 EA76 7433 EA78 3C53 EA7A 752F
~
EA7C C70672003412 EA82 EASBEOOOFO
EA87 EA87 52 EA88 4F EA89 50 EA8A 51 EA8B 4B EASC 4C EA8D 40 EABE 47 EA8F 48
LINE SOURCE
2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2012 2073 2074 2075 2076 2077 2078 2079 20BO 2081 20a2 2083 2064 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 ZlOit 2105 2106 2107 210e 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122
eHP
AH,SCROLL_SHIFT
JAE
K24
NOT
AH
AND
KBJlAG-.AH
eHP JNE
.,.AL,A.LT_KEYt-SOH
; IS nns A TOGGLE KEY
; YES. HAHOLE BREAK TOGGLE I INVERT MASK ; TURN OFF SHIFT BIT I IS THIS A.LTERNATE SHIFT RELEASE I IHTERRUPT_RETURN
;----- ALTERNATE SHIFT KEY RELEASED, GET THE VALUE INTO BUFFER
HOV t10V HOV eHP JE JHP K24: NOT AND JHP
Al,ALT_INPUT AH ,0 AlT_INPUT,AH Al,O K2. K5.
AH KBJLAG_l.AH SHORT K26
j----- TEST FOR HOLD STATE
I SCAN CODE OF 0 ; ZERO OUT THE FIElD I WAS THE INPUT=O ; INTERRUPT_RETURN I IT WASN'T, SO PUT IN BUFFER ; BREAK-TOGGLE i INVERT MASK I INDICATE NO LOHG-ER DEPRESSED ; INTERRUPT_RETURN
k25:
K26: K27:
eHP JAE TEST JZ eHP JE AND
eLI I10V OUT
POP POP POP POP POP POP POP POP IRET
; NO-SHIFT-FOlJt«)
AL.eOH K2. KBJLAG_I.HOLO_STATE K28
j TEST FOR BREAk kEY ~ NOTHING FOR BREAK CHARS FROM HERE ON I ARE WE IN HOLD STATE ; BRANCH AROUND TEST I f NOT
AL1HUH_KEY
K2.
; CAN' T END HOLD ON HllH_ LOCk
KB_fLAG_l,NOT HOLD_STATE
; TURN OfF THE HOLD STATE BIT
I INTERRUPT-RETlIRN
I TURN OFF INTERRUPTS
AL. EOI
I END OF INTERRUPT COMMAND
020H.AL
; SEND COMMAND TO INT CONTROL PORT
I INTERRUPT -RETURN-NO-EOI
ES
OS
0'
51
OX
ex
BX
AX
; RESTORE STATE
,; RETURN. INTERRUPTS BACK ON WITH FLAG CHANGE
1----- NOT IN HOLD STATE, TEST FOR SPECIAL CHARS
K28:
TEST JNZ JHP
KBJLAG.ALT_SHIFT K29 K3.
; NO-HaLO-STATE I ARE WE IN ALTERNATE SHIFT , JUMP IF ALTERNATE SHIfT I JUMP I f NOT AlTERNATE
1----- TEST FOR RESET KEY SEQUENCE (CTL ALT DEl)
K29:
TEST JZ CHP JNE
KB_FLAG.CTL_SHIFT Kll AL.DEL_KEY Kll
I TEST-RESET ; ARE WE IN COt{T1;lOL SHIfT AlSO ; NO_RESET I SHIFT STATE IS THERE, TEST KEY ; NO_RESET
1----- CTL-ALT-OEL HAS BEEN FOUND. DO I/O CLEANUP
HOY
RESET_HAG. 1234H
JHP
RESET
i SET fLAG FOR RESET FUNCTION ; JI.I1P TO POWER ON DIAGNOSTICS
1----- ALT-INPUT-TABLE
K30
LABEL BYTE
OB
82.79.80.81.75.76,77
2123
OB
71,72,73
I 10 NUMBERS ON KEYPAD
System BIOS 5-59
LOC OBJ
EA90 49
fA9l 10 fAn 11 E.'o93 12 EA94 13 E.'o95 14 EA,96 15 EA97 16 EA9B 17 E.'o99 18 EA9A 19 EA9B IE EA9C IF EA9D 2:0 EA9E 21 EUf 2:2 EAAD 23 EAAI 24 EAAZ 25 fAA] 26 EAA4 2C fAAS 20 E.'oAEo 2E fAA7 2F E"A8 ]0 EAA9 31 EAAA 32
EUS EAAB 3C39 EAAD 7505 EAAF B020 fABI E92101
EAB4
E.'oB4 BFa7E"
fA87 890.'000 fABA F2 EABS .'of EABt 7512 EABE 81EF88EA EAC2 .'001900 EAtS 840A EAt7 F6E4 EAC9 03e7 EAce A21900 EACE E889
fADO fADO C606190000 fADS B91AOO fADa FZ fAD9 AE fADA 7505 fADC 8000 EADE E9F400
fAEl fAEl 3e02 fAn 7Z0e EAE5 3tOE fAn 7308 EAE9 80C476 fAft BODO EAEE E9E400
LINE SOURCE
2124 2125
1----- SUPER-SHIfT-TABLE
DB
16.17.18,19.20.21,22,23, A-Z TYPEWRITER CHARS
2126
DB
24.25.30,31,32.33.34.35
2127
DB
2128
2129 2130 2131 2132
21:n
2134 2135 2136 2137 2138 2139 2140 2141 2142 2143
2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 01 . .
2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175
DB
J----- IN ALTERNATE SHIFT. RESET NOT FOUND
K31:
CMP JHE MOV JMP
AL,57
0"
AL, '
OS7
;. NO-RESET ; TEST FOR SPACE KEY ; HOT THERE · SET SPACE CHAR ; BUFFERJIlL
LOOK FOR KEY PAD ENTRY
K32:
MOV MOV REPNE
DI.OFFSET K30 eXt 10 StASB
, ALT-KEY-PAD , ALT-INPUT-TABLE J LOOK FOR ENTRY USING KEYPAD ; LOOK FOR MATCH
JHE SUB
"OY
I10Y
HUL
ADO I10V
JMP
033 Dr .OFFSET K30+1 AL.ALT_INPUT AH,IO AH AX,DX ALT_INPUT ,AL <26
J NO_ALTJEYPAD ; DI,'NOW HAS ENTRY VALUE , GET THE CURRENT BYTE J I1ULTIPLY BY 10
J ADD IN THE LATEST ENTRY ;; STORE IT AWAY ; THROW AWAY THAT KEYSTROKE
,----- LOOK FOR SUPERSHIFT ENTRY
K31:
MOV MOV REPHE
CX.26 SCASB
, NO-ALT-KEYPAD I ZERO ANY PREVIOUS ENTRY INTO INPUT ; DI.ES ALREADY POINTING ; LOOK FOR MATCH IN ALPHABET
JHE MOV JMP
034 AL.O OS7
, HOT FOUND. FUNCTION KEY OR OTHER I ASCII CODE OF ZERO ; PUT IT IN THE BUFFER
1----- LOOK FOR TOP ROW OF ALTERNATE SHIFT
K34 :
CMP JB CMP JAE ADO HOY J"P
AL.2 03S AL.14 03S AH,1l8 AL,O 057
; ALT-TOP-ROW ; KEY WIlli 'I' ON IT I NOT ONE OF INTERESTING KEYS ; IS IT IN THE REGION , ALT-FUNCTION ; COHVERT PSUEDO SCAN COOE TO RANGE ; INDICATE AS SUCH ; BUFFERJIlL
,----- TRANSLATE ALTERNATE SHIFT PSElKlO SCAN CODES
5-60 System BIOS
~
LOC OBJ
EAFl EAF 1 3C38 fAF3 7303 EAFS EAFS E96lFF E.Fe EAF8 lC47 EAFA 73F9 EAFC BBSFE9 fAFf E91801
EM2 E602 F606170004 EB07 7458
",-.......,
E809 3C46
feoe 7518
fBOD 881£8000 EBll a91ElAOO EB15 891E1cOO EB19 C6067l0080 EB1E CDIB EB,O 2BCO EB,2 E913000 EB25 E825 3C45 EB,7 752"1 EB,9 800E180008 EB2E B020 Ea30 E620
EB32 803E490007 EB37 7407 EB39 BAD803 EB3C A06500 EB3F EE EB40 EB40 F606180008 EB45 75F9 EB47 E914Ff '54A
EB4A 3C37 EB4C 7506 EB4E B80072 EB51 £98100
",-.......,
EB54 EB54 BB8EE8 'EB57 3e3B
EBS9 7276 EBSB EBSB BBC8E8 EB5E E9BCOO
'B61 Ee6l 3C47 EB63 732C EB65 F606170003 EB6A 745A
LINE SOURCE
2176 2177 2178 2179 2180 2:161 2162 2183 2164 2185 2186 2167 2188 2169 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2,01 2,0, 2,03 ,,04 2205 ,206 ,,07 ,208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2,4, 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252
K35: CHP JAE
K36:
JHP Kn:
CHP JAE HOY JHP
Al.59
...K37
AL.71 K3. BX,OFFSET K13 K.3
J ALT-FUNCTION I TEST FOR IN TABLE i ALT-CONTINUE i CLOSE-RETURN l IGNORE THE KEY J ALl-CONTINUE I IN KEYPAD REGION J IF SO. IGNORE I ALT SHIFT PSEUDO SCAN TABLE I TRANSLATE THAT
1----- HOT IN ALTERNATE SHIFT
K38:
TEST JZ
KBJLAG.CTL_SHIFT K44
I NOT-ALl-SHIFT I ARE WE IN CONTROL SHIFT i NOT-tTl-SHIFT
1----- CONTROL SHIFT. TEST SPECIAL CHARACTERS 1----- TEST FOR BREAK AND PAUSE KEVS
eHP JHE HOY
HOV
HOV HOV nIT SUB JMP K39: CHP JHE
o.
HOV OUT
AL.SCROLL]EY K3'
ex ,BUFFEFCSTART
eUFFER_HEAO,BX BUFFER_TAIl,BX BIOS_BREAK ,80H IBH AX,AX K57
AL.NU",-KEY K41 KBJLAG_l.HOLD_STATE AL.EOI 020H.AL
I TEST FOR BREAK 1 NO-BREAK , RESET BUFFER TO EMPTY
· l1JI;IN ON BIOS_BREAK BIT ; BREAK INTERRUPT VECTOR I PUT OUT DUtI'tY CHARACTER ; BUFFERJILL ; NO-BREAK ; LOOK FOR PAUSE KEY ; NO-PAUSE I TURN ON THE HOLD FLAG ; Ettl OF INTERRUPT TO CONTROL PORT ; ALLOW FURTHER KEYSTROKE IHTS
1----- DURING PAUSE INTERVAL. l1JI;IN CRT BACK ON
K40: K4l;
CHP JE MOV MOV OUT
TEST
JHZ JHP
CRT_HODE,7 K4. OX.03D8H AL.CRT_HOOE_SET DX.AL
KBJLAG_I.HOLO_STATE K4. K27
1 IS THIS BLACK AND WHITE CARD j YES I NOTHING TO DO I PORT FOR COLOR CARD I GET THE VALUE OF THE CURRENT I100E I SET THE CRT HOOE, SO THAT CRT IS ON I PAUSE - LOOP
; LOOP UNTIL FLAG l1JI;INED OFF , INTERRUPT_RETtJRN_ND_EOI I NO-PAUSE
;----- TEST SPECIAL CASE KEY 55
CHP
AL,55
JHE
K42
MOV
AX.114*256
JHP
K57
I NOT-KEY-55 ; START/STOP PRINTING SWITCH I BUFFER_FIll
1----- SET UP TO TRANSLATE CONTROL SHIFT
K42: HOY CHP
JB K43:
HOV JHP
BX. OffSET K8 Al.59
K5.
BX,OFfSET K9 K.3
J NOT-KEY-55 ; SET UP TO TRANSLATE CTL I IS IT IN TABLE ; CTL-TABLE-TRANSLATE o YES. GO TRANSLATE CHAR ; eTL-TABLE-TRANSLATE ; CT L TABLE SCAN i TRANSLATE_SCAN
;----- NOT IN CONTROL SHIFT
K44:
CHP JAE TEST JZ
I NOT-CTL-SHIFT
AL,7l
I TEST FOR KEYPAD REGION
K4a
I HANDLE KEYPAD REGION
KBJ LAG · LEFT_SHIFT+RIGHT_SHIFT
K54
i TEST FOR SHIFT STATE
i----- UPPER CASE. HANDLE SPECIAl CASES
System BIOS 5-61
LOC OBJ
EB6C JeOF EB6E 7505 EB70 B8000F EB73 EB60 E875 E675 3e37 fB77 7509
EB79 B020 EB7B
£620 E670
COOS EB7F E90CH E882 EM2 3e3B E884 72:06 EB86 8855£9 E689 E99100 EBBe EBBe BBIBE9 EBaF E840
EM1 E691 F606170020 E896 7520 E898 F606170003 EB9D 7520
ES9F EB9F 3C4A fBAI 7408 fBAJ 3C4E fBAS 740C fBA7 2C47 EBA9 8876E9 fBAC fB7l fBAE fBAE 88204..6. EBBI E622 EBBJ EBBJ 882B4E EBB6 fBID
EBB8 EBBB F606170003 fBBD 75EO fBBF fBBF 2C46 EBCI 8869E9 EBC4 E60B
fBCb fBCb 3e36 EBce 7204 EseA BODO EBCC EB07 EBCE EBCE BBEIEe
EBDI EBDI FEee EBDl 2ED7
fBDS
LINE SOLIRCE
2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 22% 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329
CHP JHE HOY JHP K45; CHP JHE
AL,IS K45 AX,15*256 SHORT K57
Al,55 K46
I BACK TAB KEY I NOT-SACK-TAB ; SET PSEUDO SCAN caOE ; BUFFER_FILL ; NOT-SACK-TAB ; PRINT SCREEN KEY ; NOT-PRINT-SCREEN
;----- ISSUE INTERRUPT TO IHtlICATE PRINT SCREEN FUHCTION
K46: K47:
HOY OUT
1NT
JHP
CHP JB HOY JHP
HOY JMP
AL,EDI 020H,AL 5H K27
Al,59 K47 BX,OFFSET K12
K63
BX.OFFSET Kll SHORT K56
I END OF CURRENT INTERRUPT I SO FUIHHER THINGS CAN HAPPEN ; ISSUE PRINT SCREEN INTERRUPT ; GO BACK WITHOUT EOI OCCURRING I NOT -PRINT -SCREEN ; FUNCTION KEYS ; NOT-UPPER-FUNCTION ; UPPER CASE PSEUDO SCAN CODES I TRANSLATE_SCAN ; NOT-UPPER-FUNCTION ; POINT TO UPPER CASE TABLE ; OK, TRANSLATE THE CHAR
;----- KEYPAD KEYS, MUST TEST NUM LOCK FOR DETERMINATION
K48:
TEST JNZ TEST JNZ
I KEYPAD-REGION
KBJLAG,HUH_STATE
; ARE WE IN HUH_LOCK
K52
; TEST FOR SURE
KB_FlAG.LEFT_SHIFT+RIGHT_SHIFT; ARE WE IN SHIFT STATE
K53
; IF SHIFTED, REALLY HUM STATE
1----- BASE CASE FOR KEYPAD
K49: CHP JE CHP JE SUB HOY JHP
K50:
HOY JHP
K51:
HOY JHP
AL,74 K50 AL,78 K51 AL,7l BX,OFFSET K15 SHORT Kb4
AX.74*25b+'-' SHORT K57
AX. 78*25b+' +' SHORT K57
I BASE-CASE ; SPECIAL CASE FOR A COUPLE OF KEYS ; MINUS
I CONVERT ORIGIN ; BASE CASE TABLE ; CONVERT TO PSEUOO SCAN
I HUNS I BUFFERJILL
; PLUS ; BUFFER_FILL
;----- MIGHT BE HUH LOCK. TEST SHIFT STATUS
K52: K53:
TEST JHZ
SUB HOY JHP
; Alt10ST-NUM-STATE
KB_FLAG, LEFT_SHIFT+RIGHT_SHIFT
K49
; SHIFTED TEMP OUT OF HUH STATE
; REALLY_HUM_STATE
AL.70
; CONVERT ORIGIN
eX,OFFSET K14
; HUH STATE TABLE
SHORT K56
; TRANSLATE_CHAR
; ----- PLAIN OLD LOWER CASE
K54: CHP JB HOY JHP
K55: HOY
AL,59 K55 AL.O SHORT K57
BX,OFFSET KIO
I NOT-SHIFT ; TEST FOR FUNCTION KEYS ; NOT-LOWER-FUNCTION ; SCAN CODE IN AH ALREADY ; BUFFERJIlL ; NOT-LOWER-FlJt.ICTION ; LC TABLE
;----- TRANSLATE THE CHARACTER
K56:
DEC XLAT
AL CS:Kll
I TRANSLATE-CHAR I CONVERT ORIGIN ; CONVERT THE SCAN CODE TO ASCII
1----- PUT CHARACTER INTO BUFFER
K57:
I BUFFER-FILL
5-62 System BIOS
LaC OBJ
EB05 3eFF ES07 741F EBD9 80FCFF EBOC 741A
~
EeOE EBDE F606170040 EBEl 7420
fBES F606170003 EBEA 740F
fBEC 3C41 EBEE 7215 EBFO 3C5" ESF2 7711 EBF4 0420 E6F6 E800 EBF8 EBF8 E95EFE
~
EBFB EBFB 3C61 EBFD 7206 EBFF le7A ECOI 7702 £C03 2C20 EC05 EC05 8BIEICOO EC09 8BF3 ECOB E863FC ECOE 3B1ElAOO EC12 7413 EC14 8904 EC16 891£1COO ECIA E93tFE
EtlD EC1D 2C38 EClf EelF 2ED7 EC21 8AEO
EC23 BODO EC25 EBAf
~
EC27 EC27 B020 EC29 E620 EC2B 888000 EC2E £461 EC30 50 EC31 EC31 24Ft Et33 E661 EC35 B94800 EC38 EC38 E2FE EC3A OC02 fC3t E661 EC3E 894600 Et41 fC41 f2Ff EC43 4B
LINE SOURCE
2330 2331 2332
,,,.2333
2335 2336 Z337 2338 2339 2340 2341
'34' '343 2344 '345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381
2382 2383 23M 2385 2386 2387 2388 '389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2:400 2401 2402 2403 2404 2405 2406
CMP
At,-I
JE
K59
CMP
AH,-I
JE
K59
I IS THIS AN IG""ORE CHAR I YES. DO HaTH ING WITH IT I LOOK FOR -1 PSEUDO SCAN I NEAR_iNTERRUPT_RETURN
1----- HANDLE THE CAPS LOCK PROBlE"
KS8:
TEST JZ
KB_F LAG. CAPS_S1ATE K61
I BUFFER-FILL-NOTEST I ARE WE IN CAPS LOCK STATE I SKIP IF NOT
1----- IN CAPS LOCK STATE
TEST JZ
KB]LAG. LEFT_SHIFT+RIGHT_SHIFT I TEST FeR SHIFT STATE
060
I IF NOT SHIFT I CONVERT LOWER TO LFPER
1----- CONVERT ANY UPPER CASE TO LOWER CASE
tMP Ja tMP JA ADD JMP K59: JMP
AL. 'A' Kbi AL, 'Z' 0.1
ALt'.'-'.' SHORT K61
K26
I FINO OUT IF ALPHABETIC I HOT_tAPS_STATE
I NOT_tAPS_STATE I CONVERT TO LOWER CASE ; NOT_CAPS_STATE I NEAR-INTERRUPT-RETURN I INTERRUPT_RETURN
1----- CONVERT ANY LOWER CASE TO UPPER CASE
K60: K61:
tMP Ja CMP JA SUB
MOV MDV CALL CMP JE MOV MDV JMP
AL.·.· K61 AL. 'z' K61 Al. 'a'-'A'
BX.BUFFER_TAIL SI,ex
O.
BX,BUFFER_HEAD K6' [SIl.AX BUFFER_TAIL.BX
02.
I LOWER-TO-UPPER I FIND OUT I f AlPHABETIC ; NOT_CAPS_STATE
I NOT_CAPS_STATE I CONVERT TO UPPER CASE I HOT-CAPS-STATE I GET THE END POINTER TO THE BUFFER I SAVE THE VALUE I ADVANCE THE TAll I HAS THE BUFFER WRAPPED AROl.IND I BUFFERJUl~BEEP ; STORE THE VALUE I HOVE THE POINTER UP I INTERRUPT_RETURN
;----- TRANSUTE SCAN FOR PSEUDO SCAN CODES
K63: K64:
SUB
AL,59
XLAT MDV MDV JMP
CS:K9 AH.AL AL,O 057
I TRANSLATE-SCAN ; CONVERT ORIGIN TO FUNCTION KEYS ; TRANSLATE-stAN-ORGO ; CTL TABLE SCAN ; PUT VAWE INTO AH I ZERO ASCll CODE I PUT IT INTO THE BUFFER
KB_INT ENDP
;----- BUFfER IS FULL. SOlH) THE BEEPER
K62: K65: K66: R67:
MDV OUT MOV IN PUSH
AND OUT MOV
LOOP DR OUT MOV
LOOP DEC
AL.EDI 20H,Al BX.080H Al,KB_CTl AX
Al.OFtH KB_CTL,AL CX,48H
K66 Al,2 KB_CTL,Al CX.48H
0'7 ax
I BUFFER-FUlL-BEEP ; END OF INTERRUPT COHtIAND ; SEND COmANO TO INT CONTROL PORT 1 NUMBER OF CYClES FOR 1/12 SECOND TONE ; GET CONTROL INFORMATION I SAVE I BEEP-CVClE I TURN Off TIMER GATE AI'I) SPEAKER DATA I OUTPUT TO CONTROL ; HALF CVCLE TIME FOR TONE
I SPEAKER OFF j TURN ON SPEAKER BIT ; OUTPUT TO CONTROL I SET UP COUNT
j ANOTHER HALF CYCLE I TOTAL TIME Ctun'
System BIOS 5-63
LOC OBJ
EC44 75E8 EC46 58 EC47 E661 EC49 E912FE EC4C EC4C B90020 EC4F EC4F 32CO EC51 ECSI 0207 EC53 43 EC54 EZFB EC56 OACO ECS8 C3
EC59 EC59 EC59 FB
LINE SOLIRCE
2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425
2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483
JHZ
K.5
pop
AX
CXJT
KB_CTl,A.L
JHP
K27
I DO ANOTHER CYCLE I RECOVER CONTROL I OUTPUT THE CONTROL
; ---------------.----------------------- ROS CHECKSUM SUBROUTINE
i --------------------------------------- ; NEXT.RDS.MODULE
HOV
CX.8192
I NUt1BER OF BYTES TO ADO
RDS.CHECKSUM.CNT:
XOR
Al,U
e26:
ADD
Al,OS: lex]
INC
BX
LOOP C2'
OR
AL,Al
RET
RDS.CHECKSUM ENDP
; ENTRY FOR OPTIONAL RDS TEST
I POINT TO NEXT BYTE I ADD All BYTES IN RDS MODULE
J SUM = O?
J-- INT 13 ------------------------------------------------------------- J DISKETTE 110
J
THIS INTERFACE PROVIDES ACCESS TO THE 5 1/4" DISKETTE DRIVES
J INPUT
(AH)=O RESET DISKETTE SYSTEM
HARD RESET TO NEC, PREPARE COtl1Atl), RECAl REQUIRED
ON ALL DRIVES
UH )=1 READ THE STATUS OF THE SYSTEH INTO IAll
DISKETTE_STATUS FROH LAST OPERATION IS USED
J REGISTERS FOR READIWRITEIVERIFYlFORMAT (DU - D~IVE t-n.JHBE~ (0-3 ALLOWED. VA-WE CHECKED) CDH) - HEAD NUMBER (0-1 ALLOWED. NOT VAWE CHECKED) (CH) - TRACK NUHBER (0-39. NOT VALUE CHECKED) (CL) - SECTO~ NUl'IBER 11-8. NOT VALUE CHECKED. NOT USED FOR FORMAlI (AL) - Nl.JMBE~ OF SECTOR'S ( MAX = 8. NOT VALUE CHECKED. HOT USED FOR FORMAT) (ES:BXI - ADDRESS Of BUffER I HOT REQUI~ED FOR VE~IFy)
IAHJ=2 (AH )=3 IAHJ=4 I AH )=5
READ THE DESIRED SECTORS INTO MEMORY WRITE THE DESIRED SECTO~S F~OM MEHORY VERIFY THE DESIRED SECTORS fORHAT THE DESIRED TRACK FOR THE fORHAT OPERATION. THE BUFFER POINTER IES.BX) tlUST POINT TO THE COLLECTION OF DESIRED ADDRESS FIELDS FOR THE TRACK. EACH FIHD IS COMPOSED Of 4 BYTES. (C.H.R.N). WHERE C = TRACK NUMBER. H=HEAD HUf1BER. R = SECTOR NUMBER. N= NUHBER OF BYTES PER SECTOR (00=128. 01=256. 02=512. 03=1024J. THERE tllST BE ONE ENTRY FOR EVERY SECTOR ON THE TRACK. THIS INfORMATION IS USED TO FIND THE REQUESTED SECTOR DlRING READIWRITE ACCESS.
; DATA VARIABLE -- DISK_POINTER
DOlSLE 1ol0RD POINTER TO THE CURRENT SET Of DISKETTE PARAHETERS
J OUTPUT
AH = STATUS OF OPERATION
STATUS BITS ARE DEFINED IN THE EQUATES fOR
DISKETTE_STATUS VARIABLE 1N THE DATA SEGMENT OF TH1S
CY = 0 CY = 1
MDOULE. SUCCESSfUL OPERATION (AH=O ON RETURN) FAILED OPERATION IAH HAS ERROR REASONJ
FOR READ/WRITEIVERIFY
DS.BX.DX.CH,CL PRESERVED
Al = NUMBER OF SECTORS ACTUAllY READ
***** AL MAY NOT BE CORRECT IF TIME OUT ERROR OCCURS
NOTE: IF AN ERROR IS REPORTED BY THE DISKETTE CODE. THE
APPROPRIATE ACTION IS TO RESET THE DISKETTE. THEN ~ETRY
THE OPERATION. ON READ ACCESSES. NO MOTOR START DELAY
so IS TAKEN.
THAT THREE RETRIES ARE REQUIRED ON REAOS
TO ENSURE THAT THE PROBLEt1 IS NOT DUE TO HOTOR
START-UP.
J-----------------------------------------------------------------------
ASSUME CS:COOE,OS:DATA.ES:DATA
ORG
OEC59H
DISKETTE_IO
PROC
fAR
STI
INTERRUPTS BACK ON
5-64 System BIOS
LOC OBJ
feSA S3 EC58 51 Eesc IE Ee50 56 ECSf 57 ECSF 55 Ee60 52 fe6l saEe fe63 f8D812 Ee66 f81COO £C69 880400 ECbe E8FDDI EC6F 88264000 feB 6A26410Q fe77 eo FeD I Ee7A F5 Ee7B SA Ee7t 50 EC70 SF Ee7f 5f Ee7F IF
fceo S9
EC81 58 fC82 CA0200
EC65 EC85 BAFD Ee87 80263F007F
feec OAE4
ECSE 7427 £C90 fEee £C92 7473 EC94 C606410000 £C99 80FA04 EC9C 7313 EC<;IE FEee ECAO 7469 ECAl FEee ECA4 7503 ECAb E99500 ECA9 ECA9 FEee £CAB 7467 ECAD FEee ECAF 7467 ECSI ECBl C606410001 EeM C3
ECB7 feB7 BAF201 ftBA fA ECBB A03FOO fCSE 8104 Eeeo 02EO fCC2 A820 ECC4 750C Eceb A840 Ecce 7506 ECCA A680 Ecce 7406 ECCE FEeD ECDO ECDO FEeD fCD2 fC02 FEeD ECD4
ECD4 ocoe
fC06 EE EC07 C6063£0000 ECOC C606410000 feEl OC04
fcn EE
LINE SOURCE
2464 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2496 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2526 2529 2530 2531 2532 2533 2534 2535 2536 2537 2536 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 255a 2559 2560
PUSH PUSH PUSH PUSH PUSH PUSH PUSH tIDV CAll CAll I10V tALL MOV MOV CMP CMC POP POP pop pop POP POP pop
OET
DISKETTE_IO
BX CX OS SI 01 BP
ox
BP,SP DDS Jl BX,4 GET_PARH HOTOR_COUNT ,AH AH,DISKETTE_STATUS AH,I
OX BP 01 51 OS CX BX 2 ENOP
; SAVE ADDRESS ; SAVE SEGMENT REGISTER VALUE ; SAVE All REGISTERS ~URING OPERATION
J SET UP POINTER TO HEAD PARM J CAll THE REST TO ENSURE OS RESTORED J GET THE MOTOR WAIT PARAMETER , SET THE TIMER COUNT FOR THE MOTOR ; GET STATUS OF OPERATION ; SET THE CARRY FLAG TO INDICATE I SUCCESS OR FAILURE ; RESTORE All REGISTERS
J RECOVER ADDRESS I THROW AWAY SAVED FLAGS
J1
PROC
NEAR
MOV
DH,Al
, SAVE I SECTORS IN DH
AND
MOTOR_STATUS,07FH
I INDICATE A READ OPERATION
OR
AH,AH
; "H=O
JZ
DISK_RESET
DEC
AH
I AH=1
JZ
ttoV
DISKETTE_STATUS,O
I RESET THE STATUS INDICATOR
CMP
Dl.4
I TEST FOR DRIVE IN 0-3 RANGE
JAE
J3
I ERROR IF ABOVE
DEC
AH
; AH=2
JZ
DISK_READ
DEC
AH
JNZ
J,
; AH:03 I TEST_DISK_VERF
JMP
DISK_WRITE
J2:
; TEST_DISK_VERF
DEC
AH
, AH=4
JZ
DISK_VERF
DEC
AH
I AH=5
JZ
DISKJORMAT
J3:
ttoV
DISKETTE_STAnJS.BADStID I ERROR COCE. NO SECTORS TRANSFERRED
RET
I UNDEFINED OPERATION
J1
ENOp
j----- RESET THE DISKETTE SYSTEM
PRot
NEAR
OX,03F2H
CLI
HoY
Cl,4
SAL
Al.Cl
TEST
Al. 20H
JNZ
J5
TEST
Al. 40H
JNZ
J4
TEST
Al, 60H
JZ
J6
INC
AL
J4:
INC
AL
J5:
INC
AL
J6:
00
AL.a
IXJT
DX.Al
MOV
SEEK_STATUS ,0
MOV
DISKETTE_STATUS ,0
OR
Al,4
OUT
DX,At
I ADAPTER COHrnOl PORT ; NO INTERRUPTS ; ....ICH MOTOR IS ON I SHIFT COUNT I MOVE MOTOR VAlUE TO HIGH NYBBlE ; SELECT CORRESPOHDING DRIVE J JUMP IF MOTOR ONE IS ON
; JUMP IF MOTOR TWO IS ON
i JUMP IF MOTOR ZERO IS ON
, T~N ON INTERRUPT ENABLE I RESET THE ADAPTER i SET RECAl REQUIRED ON All DRIVES ; SET OK' STATUS FOR DISKETTE ; TURN OFF RESET ; TURN OFF THE RESET
System BIOS 5-65
LOC OBJ
ECE4 FB feES EB2:AOZ
EtES A04200
ftEe xeo
ECED 7406 ECEF 800E410020 ECF4 C3
ECF5 ECF5 8403 ECF7 E84701 ECfA 8BOI00 ECfD E86eOI fDOO 880300 ED03 £86601 ED06 E006 C3
E007 E007 A04100 EDOA C3
EDOB EDOB 8046 EOOO EOOD E88801 EDI0 B4E6 EDI, E836
ED14 EDl4 B042 E016 EBF5
ED18 E018 800E3F0080 EOI0 B04A EOIF E8A601 EOZZ B440 E02:4 EB24 E026 ED26 BB0700 E029 E84001 ED2C BB0900 E02F E83AOI ED32 BeDFOO E035 E83401 E038 BBII 00 EOlB E9ABOO
£D3E ED3£ 800£3F0080 E043 804A E045 E88001 E048 84C5
LINE SOURCE
2561 2562 2563 2564 2565 2566 2:567 2566 2569 2570 2571 2572 2573 2574 2575 2576 2577 2576 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637
STI CAll
HOV CHP JZ OR RET
; REENABlE THE INTERRUPTS
CHK_STAT_2
I 00 SENSE INTERRUPT STATUS
; FOLLOWING RESET
AL,NEt_STATUS
I IGNORE ERROR RETURN AND DO OWN TEST
AL,otOH
; TEST FOR DRIVE READY TRANSITION
J7
I EVERYTHING OK
DISKETTE_STATUS.BAD_NEC I SET ERROR CODE
1----- SEND SPECIFY COMMAND TO NEt
J7: HOV CALL HOV CALL MOV CALL
J8: RET
DISK..RESET
AH.03H NEC_OUTPUT
ex.!
GET_PARH BX,] GET_PARM
ENDP
I DRIVE_READY I SPECIFY Cott1Af«) ; OUTPUT THE COMI'IAtIJ
,; FIRST BYTE PAR" IN BLOCK TO THE NEe CONTROLLER
,I SECON) aYTE PARH IN BLOCK TO THE NEe CONTROLLER I RESET_RET I RETURN TO CALLER
;----- DISKETTE STATUS ROUTINE
DISK_STATUS HOV RET
DISK_STATUS
PROC
NEAR
AL .DISKETTE_STAl1IS
ENDP
;----- DISKETTE READ
DISK.-REAO HOY
J9: CALL MOV JHP
DISK_READ
PROC
NEAR
AL.046H
DI1A_SETUP AH,OE6H SHORT R~COF'H EtIlP
I READ Cot1t1AND FOR OMA I DISK_READ_CONT ;. SET UP THE DMA ; SET UP RO COt1I1AND FOR NEC COtfTROLLER I GO DO THE OPERATION
1----- DISKETTE VERIFY
DISK..VERF HOV JHP
DISK..YERF
PROC NEAR AL,042H J9 ENDP
I YERIFY COMHAhI) FOR OMA ; DO AS IF DISK READ
,----- DISKETTE FORMAT
DISK_FORMAT OR HOY CALL MOV JMP
JIO: HOY CALL HOY CALL HOY CALL MOV JHP
DISK_FORMAT
PROC NEAR MOTOR_STATUS,80H AL,04AH DMA_SETUP AH.040H SHORT RW_OPN
BX.7 GET_PARM BX,9 GET_PARM BX,15 GET_PARH BX.17 Jl. ENDP
I INDICATE WRITE OPERATION ; WILL WRITE TO THE DISKETTE I SET UP THE OttA I ESTABLISH THE FORMAT Cott"IAtI) ;. DO THE OPERATION I CONTINUATION OF RI,COF'H FOR FttT I GET THE I BYTES/SECTOR VALUE TO NEC
,I GET THE SECTORS/TRACK VALUE TO NEC
,; GET THE GAP LENGTH VALUE TO NEC · GET THE FILLER BYTE I TO THE CONTROLLER
;----- DISKETTE WRITE ROUTINE
DISK_WRITE OR HOY CALL MOV
DISK_WRITE
""OC
NEAR
HOTOR_STATUS, BOH
AL,04AH
DMA_SETUP
AH,OC5H
ENDP
J INDICATE WRITE OPERATION ;. DMA WRITE COMMAND
I NEC CotI1AHD TO WRITE TO DISKETTE
1----- ALLOIol WRITE ROUTINE TO FALL INTO RI'COPN
1---------------------------------------------------------------
5-66 System BIOS
LOC OBJ
~
ED4A ED4A 7308 E04C C606410009 ED51 BODO E053 C3 EDS4 E054 50
E055 51 EO 56 SACA EO 58 BOOI ED5A 02EO ECSC FA
EDSC C6064000fF E062 84063FOQ E066 7531 E068 80263FOOFO ED6D 08063FOO ED71 FB Eon BOlO E074 02EO E076 OAC2 E078 oeoc E07A 52 E07B BAF203 ED7E EE ED7F SA
~
ED80 f6063F0080 ED85 7412 E087 BB1400 ED8.... E80FOO ED8D OAE4 ED8F ED8F 7408 E091 2BC9 ED93 ED93 E2FE E095 FECC ED97 EBF6 ED99 E099 FB ED9A 59
ED9B E8DFOO ED9E 58 ED9F 8AFC EDAI B600 ED....J 724B EOA5 BEFOED90 EDA9 56
~
EDM E89400 EDAD 8A6601 EDBO 00E4 EDB2 DOE4 EDB4 80E404 EDB7 OAE2 EDB9 E88500
EDBC 80FF4D EOBF 7503
LINE SOURCE
2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2646 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 Z677 2678 2679 2680 2681 2682 Z6B3 2684 Z6B5 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2:713 2714
; RI"LOPN
THIS ROUTINE PERFORMS THE READ.lWRITE/vERIFY OPERATION
.---------------------------------------------------------------
RW_OPN PROt NEAR
JNe
J11
; TEST FOR DMA ERROR
"OV
D1 SKETTE_STATUS. DNA_BOUNDARY
, SET ERROR
"OV
.U.O
, NO SECTORS TRANSFERRED
RET
J RETURN TO MAIN ROUTINE
Jll:
I DO_RICOPN
PUSH
AX
I SAVE THE COMMAND
1----- TURN ON THE MOTOR AND SELECT TliE DRIVE
PUSH
"OV
"ev
SAL
eLI
ex CL.Dl Al.l AL,CL
"OV TEST JHZ AHO OR STI "OV SAL DR OR PUSH MOV OUT POP
MOTOR_COUNT.OFFH Al,MOTOR_STATUS J14 MOTOR_STATUS,OFOH HOTOR_STATUS,AL
Al.lOH Al.CL Al,Ol Al.OCH OX OX,03F2H DX,Al OX
I SAVE THE TIS PARMS I GET DRIVE HUMBER AS sHIFT COUNT I MASK FOR DETERMINING MOTOR BIT ; SHIFT THE MASK BIT I NO INTERRUPTS WHILE DETERMINING ; MOTOR STATUS ; SET LARGE COUNT DURING OPERATION I TEST THAT MOTOR FOR OPERATING I IF RUNNING. SKIP THE WAIT I TURN OFF ALL MOTOR BITS I TURN ON THE CURRENT MOTOR I INTERRUPTS BACK ON · MASK BIT · DEVELOP BIT MASK FOR MOTOR ENABLE ; GET DRIVE SELECT BITS IN · NO RESET, ENABLE OMA/INT o SAVE REG ; CONTROL PORT ADDRESS
I RECOVER REGISTERS
J----- WAIT FOR MOTOR IF WRITE OPERATION
J12: J13: J14:
TEST JZ MOV CALL OR
MOTOR_STATUS,80H J14 BX,20 GET_P....RM AH .....H
JZ
J14
SUB
CX.CX
lOOP DEe JHP
J13 AH J12
STI
POP
ex
I IS THIS A WRITE I NO, CONTINUE WITHOUT WAlT ; GET THE MOTOR WAlT ; PARAMETER I TEST FOR NO WAIT I TEST_WAlT_TIME I EXIT WITH TIME EXPIRED I SET UP 1/8 SECOND LOOP TIME
I WAIT FOR THE REQUIRED TIHE ; DECREMENT TIME VALUE ; ARE WE OONE YET ; MOTOJUHJNNING I INTERRUPTS BACK ON FOR BYPASS WAIT
; ---- DO THE SEEK OPER....TION
CALL POP
"OV "OV JC
"OV PUSH
SEEK AX BH,AH DH.O J17 51 ,OFFSET J17 51
I MOVE TO CORRECT TR ....CK ; RECOVER COHHAttJ ; SAVE COMHAND IN BH I SET NO SECTORS READ IN CASE OF ERROR ; IF ERROR. THEN EXIT AFTER MOTOR OFF I DUMttY RETURN ON STACK FOR NEC_OUTPUT
SO THAT IT WIll RETURN TO MOTOR OFF ; LOCATION
1----- SEND OUT THE PARAMETERS TO THE CONTROLLER
CALL MOV SAL SAL ANO DR CALL
NEC_OUTPUT "HdBP+l) AH.l AH.l AH,4 AH.Ol NEC_OUTPUT
; OUTPUT THE OPER....TION COI1I'1AJIJ ; GET ruE CURRENT HEAD NUI1BER I MOVE IT TO BIT 2:
; ISOLATE THAT BIT , OR IN THE DRIVE NUHBER
;----- TEST FOR FORHAT Cott"IANQ
C"P
BH,040H
JH'
J15
, IS THIS A FORMAT OPER....TION , NO. CONTINUE WITH R/WN
System BIOS 5-67
LaC OBJ
EOCI E96ZFF EDC4 EDC4 8AE5 EDC6 E87800 EOC.9 8A6601 EOCC £87200 EOCF 8AEI EODI £86DOO EDOlt 880700 EDD7 [89200 EDDA 880900 EDDD E88COO EDEO 6B0600 Eon E88600 EDE6 6eODOO EDE9 EDE9 E88000 EDEC 5£
EO ED E84301 EDFO EDFO 7245 EDF2 E87401 EDF5 723F
EOF7 FC ED Fa BE4200 EOFB AC EOFC 24CO EDFE 7438 EEOO 3C40 EE02 7529
EE04 AC EE05 OOEO EE07 B404 EE09 7224 EEOB ODED EEOD DOEO EEOF B410 EEll 721C EE13 OOEO EElS B408 EEl7 7216 EE19 OOEO EEIB OOEO EEtO B404 EE IF 720E EE21 OOEO EE23 8403 EE25 7208 EEZ7 ODED EE29 8402 EEtS 7202
EE20 EE20 6420 EE2F EE2F 08264100 EEl3 E87801 EEl6 EE36 C3 EEl7 EEn E82FOl EnA C3
LINE SOURCE
2715 2716 2717 2718 2719 2720 2721 2722 27Z3 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2736 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791
JlS: JI6:
JMP
MOV CAll MOV CALL HOY CAlL HOY CALL HOY
CALL
HOY CAll
HOY
CAll POP
JID
AH,CH NEC_OllTPlIT AH.IBP+l J NEt_OUTPUT AH,CL NEC_OUTPUT BX,7 GET_PARH BX.9 GET_PARM eX.II GET_PARH BX.I!
GET_PAR"
sr
1----- LET THE OPERATION HAPPEN
; IF SO, HANDLE SPECIAL
I CYLINDER tu1BER
l HEAD HUMBER FROH STACK
J SECTOR HLlMBER
I BYTES/SECTOR PARH FRCH BLOCK
.I TO THE NEt
J EDT PAR'" FRCH BlOCK TO THE NEt
I GAP LENGTH PARH FRCH BLOCK ; TO THE NEC
I on PARH FRCH BLOCK
.I RW_OPN_FINISH TO THE NEe , CAN NOW DISCARD THAT DUHMY I RETURN ADDRESS
J17:
CALL
JC CALL JC
WAIT_INT
J21 RESULTS J2D
I WAIT FOR THE INTERRUPT
I HOTOR_OFF
I LOOK FOR ERROR
; GET THE NEC STATUS
; LOOK FOR ERROR
1----- CHECK THE RESULTS RETlmNED BY THE CONTROLLER
CLD HOY LODS AND JZ C!1P JHZ
51 ,OFFSET NEC_STATUS NEC_STATUS AL,OCOH J22 AL.040H JIS
I SET THE CORRECT DIRECTION I POINT TO STATUS FIELD I GET STO I TEST FOR NORM"'L TERMINATION I OPN_OK ; TEST FOR ABNORMAL TERMINATION I NOT ABNORH"'L, BAD NEC
1----- ABNORHAL TERHINATIOt." FIND OUT WHY
LOOS SAL HOY JC SAL SAL HOY JC SAL MOV JC SAL SAL MOV JC SAL HOY JC SAL HOY JC
NEC_STATUS AL,! AH,RECORO_NOTJND JI' AL.l AL,I AH.BAD_CRC
JI' AL.l AH,BAD_DMA
JI' AL,l AL.l AN .RECORD_NOT_FND
JI' AL.l AN .WRITE_PROTECT
JI' AL.l "'H, S"'O_"'DDR_HARK JI,
; GET STl
; TEST FOR EaT FOlHl
I RN_FAIl I TEST FOR CRC ERROR
I Rw..FAIl
I TEST FOR DHA OVERRUN
I RWJAIL
I TEST FOR RECORD NOT FOlN)
I RN.,FAIL
I TEST FOR WRITE_PROTECT
t RWJAIL
; TEST HISSING ADDRESS MARK
I RWJAIL
1----- NEC MUST HAVE F...ILED
J18: J19:
J20: J21:
MOV
OR CALL
RET
CALL RET
AH.B...D_NEC DISKETTE_STATUS ....H NUM_TRANS
RESULTS
1----- OPERATION WAS SUCCESSFUL
; RN-NEC-FAIL
I RN-FAIL
I HOW HANY WERE REALLY TR...NSFERRED J RN_ERR I RETURN TO CALLER I RW_ERR_RES I flUSH THE RESULTS BUFFER
5-68 System BIOS
LOC OBJ
EE3B EnB f87001 EDE 32£4 E£40 C3
~
EE41 EE41 52 EE42 51 E£43 BAF403 EE4b 33C9 EE4a EE4a EC EE49 A840 EE4B 740C EE40 E2F9 EE4F EE4F 800E410080 ££54 59 EE55 SA EE5& 58 EE57 F9 EE58 C3 EE59 EE59 33C9 EEse EESB EC fESC A880 £ESE 7S04 EE60 E2F9 EE62 EBEB EE64 EE64 8AC4 £E66 B2FS £E68 EE EEb9 59 EEbA 5A EE6B C3
~
EE6C EEbC IE EE6D 28co EE6F eED8
£E71 C5367800 EE75 DIEB
EE77 8A20
LINE SOURCE
2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2606 2807 2806 2809 2810 2811 21312 2813 21314 2815 2816 21317 2818 2819 21320 21321 21322 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2563 2864 28b5 2866 286? 2868
J22:
I OPN_OK
CALL Nln1_TRANS
I HOW MANY GOT HOYED
XOR
AH.AH
I NO ERRORS
RET
RW_OPH EtIlP
1-------------------------------------------------------.-----.---------
J NEt_OUTPUT
THIS ROUTINE SENDS A BYTE TO THE NEe COtITROLlER AFTER TESTING
FOR CORRECT DIRECTIOt-l AND CONTROLLER READY THIS ROUTINE WILL
TIME OUT IF THE BYTE IS NOT ACCEPTED WITHIN A REASONABLE
AHOUNT OF TIHE. SETTING THE DISKETTE STATUS ON COMPLETION.
; INPUT
(AH' BYTE TO BE OUTPUT
I OUTPUT
ty = 0 tY = 1
SUCCESS FAILURE - DISKETTE STATUS UPDATED
IF A FAILURE HAS OCCURRED, THE RETIJRN IS HADE ONE LEYEl :
HIGHER THAN THE CALLER OF HEt_OUTPUT.
THIS REMOVES THE REQUIREMENT Of TESTING AFTER EVER'(
CALL Of NEC_OUTPUT.
(A.L) DESTROYED
J-----------------------------------------------------------------------
NEC_OUTPUT
PROC
NEAR
PUSH OX
I SAVE REGISTERS
PUSH
ex
MOV
DX.03f4H
j STATUS PORT
><OR
CX,CX
; COUHT FOR TIME OUT
J23:
IN
AL.DX
I GET STATUS
TEST
Al,040H
I TEST DIRECTION BIT
JZ
JZS
i DIRECTION OK
LOOP J<3
J24:
i TIME.ERROR
OR
DISKETTE_STATUS, TIME_OUT
POP
ex
POP
ox
1 SET ERROR CODE AND RESTORE REGS
PDP
AX
1 DISCARD THE RETURN ADDRESS
STe
; INDICATE ERROR TO CALLER
RET
J25:
XDR
CX.ex
I RESET TME cc:urr
J:!6:
IN
AL.OX
I GET TME STATUS
TEST
AL,080H
i IS IT READY
JHZ
JZ7
1 YES. GO OUTPUT
lOOP
JZ6
1 COUNT DOWN AND TRY AGAIN
JNP
J24
I ERROR CONDITION
J27:
I OUTPUT
t10V
AL.AH
MOV
DL.OFSH
I GET BYTE TO OUTPUT 1 DATA PORT «3FS)
OUT
DX.AL
; OUTPUT TH E BYTE
POP
ex
I RECOVER REGISTERS
POP
ox
RET
; tY = 0 FRott TEST INSTRUCTION
NEC_OlITPUT
ENOP
; -----------------------------------------------------------------------
; GET_PA.RM
I
THIS ROUTINE FETCHES THE INDEXED POItrrER FROH THE DISK_BASE
BLOCK POItrrED AT BY THE DATA VARIABLE DISK_POINTER. A BYTE FROH :
THAT TABLE IS THEN HOVEO INTO AH, THE ItilEX Of THAT BYTE BEING
TM£ PARH IN BX
ENTRY -
* ex = ItI)EX OF BYTE TO BE FETCHED 2
IF THE LOW BIT OF ex IS ON. THE BYTE IS ItltEDIATELY OUTPUT
TO THE NEC CONTROLLER
; EXIT -
= AH THAT BYTE FROJ1 BLOCK
J-----------------------------------------------------------------------
GET_PAIfI'1
PROC NEAIf
PUSH as
J SAVE SEGMENT
SUB
AX,AX
i ZERO TO AX
t10V
DS,AX
ASSlI1E DS:ABSO
LOS
SI.DISK_POINTER
; POINT TO BLOCK
SHR
BX.l
I DIVIDE BX BY 2, At«<) SET FLAG
MOV
AH,IS1+8X]
I FOR EXIT ; GfT THE WORD
System BIOS 5-69
LaC OBJ
EE79 IF EE7.A. 72C5 EE7t C3
EE7D Ef70 8001 EElF 51 EEeo BACA EE82 02eo EE84 59 EE85 64063£00 EE89 7513 EEBB 08063EOO EE8F 8407 ££91 [8ADFF EE94 8AEZ ££96 [BASFF [[99 £87600 EE9C 7Z2:9
EE9E EE9E 840F EEAO E89EFF EEAl SAEZ EEAS £899Ff EEAS 8A£S EEAA £894Ff HAD £86200
EEBO 9C EEBI B81200 EEB4 E6B5FF EEB7 51 EEB8 EEB8 B9Z602 EEBB OAE4 [EBD 7406 fEBF EEBF E2FE EECI FEce EEC3 [Bn EECS Hes 59 EEC6 90 EECl EEe7 C3
EEce EEca 51
LINE SOURCE
2669 2670 2671 2872 2873
2874 2675 2876 2877 2878 2879 2880 2881 2662 2863 2884 2865 2686 2887 2688 2869 2890 2891 2892 2893 2894 2895 2696 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935
2937 2938 2939 2940 2941 2942 2943 2944 2945
POP
oS
, RESTORE SEGMENT
ASSUNE DS :DATA
JC
; IF FlAG SET. OUTPlJT TO CON"mOLLER
RET
; RETURN TO CAllER
ENDP
i-~----------------------------------------------------------------------
I SEEK
THIS ROUTINE WILL HOVE THE HEAO ON THE NAMED DR lYE TO THE
NAMED TRACK. IF THE DRIVE HAS NOT BEEN ACCESSED SINCE THE
DRIVE RESET COMMAND WAS ISSUED, THE DRIVE WIll BE RECAlIBRATED.
INPUT
(Dll = DRIVE TO SEEK ON (CHI = TRACK TO SEEK TO
~ OUTPUT
CY = 0 SUCCESS CY = 1 FAILURE -- DISKETTE.STATUS SET ACCORDINGLY
(AX J DESTROYED
1-----------------------------------------------------------------------
SEEK
PROC
NEAR
HOV PUSH
Al,!
cx
1 ESTABLISH MASK FOR RECAl TEST 1 SAVE INPUT VALUES
HOV
Cl.DL
~ GET DRIVE VALUE INTO CL
ROL
AL,CL
POP
cx
I SHIFT IT BY THE DRIVE VALUE ; RECOVER TRACK VALUE
TEST AL,SEEK.STATUS
1 TEST FOR RECAl REQUIRED
JNZ
J28
OR
SEEK.STATUS,AL
1 NO.RECAl ; TURN ON THE NO RECAL BIT IN flAG
HOV
AH,07H
; RECALIBRATE COMMAND
CAll NEC.OUTPUT
HOV
AH.Dl
CALL NEC.OUTPUT
; OUTPUT THE DRIVE tu1BER
CALL CHK_STAT.2
J GET THE INTERUPT Atm SENSE INT STATUS
JC
J32
; SEEK.ERROR
; ----- DRIVE IS IN SYNCH WITH CONTROLLER, SEEK TO TRACK
J28:
HOV CALL HOV CALL HOV CALL CALL
AH.OFH NEC.OUTPUT AH.OL NEC.OUTPUT AH,CH NEC.OUTPUT CHK.STAT.2
1 SEEK COMMAND TO NEC ; DRIVE NUMBER I TRACK t-U1BER I GET ENDING INTERRUPT AND I SENSE STA!US
;----- NAIT FOR HEAD SETTLE
PUSHF
I SAVE STATUS FLAGS
HOV
eX,16
; GET HEAD SETTLE PARAMETER
J29:
CALL PUSH
GET.PARN
cx
1 SAVE REGISTER J HEAD SETTLE
HOV
CX.SSG
; 1 MS lOOP
OR
AH.AH
I TEST FOR TINE EXPIRED
JZ
J31
J30:
LOOP
J30
; DELAY FOR 1 MS
OEC
Ali
; DECREMENT THE COUNT
JHP
J2,
i DO IT SOME MORE
J3l:
POP
ex
; RECOVER STATE
POPF
J32:
I SEEK.ERROR
RET
; RETURN TO CALLER
SEEK
EHOP
; ------- ------.--- - ------------------ --- -- - -----------------------------
THIS ROUTINE SETS UP THE D~ FOR REAO.IWRITE/vERIFY OPERATIONS. I INPUT
(All = MODE BYTE FOR THE DMA
(ES:BXI - ADDRESS TO READ/WRIlE THE DATA ; QlJTPUT
(AX I DESTROYED
i -------------------- - -------------- ------- - - ---------------------------
PUSH ex
; SAVE THE REGISTER
5-70 System BIOS
LaC OBJ
~
EEC9 FA
EEeA Eboe
EEee 50 EeCD 58 EEeE £60e EEDO 8CCD fEOZ 8104 EED4 03CO fED6 8Af8 EED8 24fO EEDA 03e3 EEOC 7302 EEOE FEes fEED fEED 50 HEl E604 EEE3 8AC4 fEES E604 EE£7 8AC5 EEE9 240F EEEB E681
~
EEED 6AE6 EEEF lACO EEFI DIE8 EEF3 50 EEF4 8B0600 EEF7 E872FF EEFA SAce EEFe 58 EEFD DUO EEFF 48 EFOO 50 HOI E605 EFO] 84C4 EF05 E605 EF07 F8 EF08 59 EF09 58 EFOA 03CI EFOC 59 HOD B002 HOF E60A EFll C3
~
EFI2 H12 £81EOO EFlS 7214 EF17 8408 EF19 E825Ff HIe E84AOO EFIF 720A HU A04200 EF.24 2460 EF26 3C60 EF26 7402 EF2A. F8 EF2B EF2B C3 EF2C
LINE SOURCE
'''9994447..
2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2.972 2973 2.974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2964 .2985 2986 .2987 2988 .2989 2990 2:991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3006 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022
J33:
CLI OUT PUSH POP OIIT MOV MOV ROL I10V AND ADD JHC
INC
PUSH OUT MOV OUT I10V AND OUT
DMA-t12,AL AX AX DI1A+ll,AL AX,ES CL.4 AX,CL CH.A.l Al,OFOH
AX. ox
J33 CH
AX DHA+4,AL AL,AH DMA+4,AL AL.CH AL,OFH D81H.AL
· NO MORE INTERRUPTS l SET THE FIRST/LAST F/F
l OUTPUT THE HOOE BYTE ; GET THE ES VALUE · SH IF T COUNT J ROTATE LEFT ; GET HIGHEST NYBLE OF ES TO eH ; ZERO THE LOW NYBBLE FROM SEGMENT ; TEST FOR CARRY FRON ADDITION
J CARRY MEANS HIGH 4 BITS truST BE INC
; SAVE START ADDRESS ; OUTPUT LOW ADDRESS
; OUTPUT HIGH ADDRESS ; GET HIGH 4 BITS
I Q\JfPUT THE HIGH 4 BITS TO ; THE PAGE REGISTER
;----- DETERMINE COUNT
MDV
AH.DH
f NUMBER OF SECTORS
sua
AL.AL
I TIMES 256 INTO AX
SHR
AX.1
; SECTORS · 128 INTO AX
PUSH AX
MDV
BX.6
I GET THE 8YTES/sECTOR PARM
CALL
GET_PAR"
MOV
CL.AH
; USE AS SHIfT COUHT (O=128. 1=2:56 ETC)
PDP
AX
SHL
AX,CL
; MULTIPLY BY CORRECT AHaUNT
D'C
AX
PUSH
AX
, -1 FOR DHA VALUE I SAVE COUNT VALUE
DIIT
OMA+5.Al
j lOW BYTE OF COUNT
MDV
Al.AH
OUT
DHA+S.Al
sn
l HIGH BYTE OF COUNT l INTERRUPTS BACK ON
POP
CX
I RECOVER COUNT VALUE
PDP
AX
I RECOVER ADDRESS VALUE
ADD
AX.CX
I AOD. TEST FOR 64K OVERflOW
POP
CX
o RECOVER REGISTER
MDV
AL,2:
J. MODE FOR 6237
OUT
DHA+IO.AL
; INITIALIZE THE DISKETTE CHANNEL
RET
J RETURN TO CALLER,
I CF L SET BY ABOYE IF ERROR
DMA.SETUP
'HOP
J-----------------------------------------------------------------------
I OIK_STAT_2
THIS ROUTINE HANDLES THE INTERRUPT RECEIYED AFTER A
RECALIBRATE. SEEK, OR RESET TO THE ADAPTER.
THE INTERRUPT 15 WAITED FOR. THE INTERRUPT STATUS SENSED.
AND THE RESULT RETURNED TO THE CALLER.
I IHI'UT
I HCN'
I OUTPUT
CY = 0 SUCCESS CY = I FAILURE -- ERROR IS IN DISKETTE.STATUS
(AX) DESTROYED
J---- - - - --- - ----- ---- - - - - - - ----------- - - - - ---------- ---- ---- ---- --- -----
CHK_STAT.2
"'DC NEAR
CAll WAIT.INT
l WAIT FOR THE INTERRUPT
JC
J34
I IF ERROR. RETURN IT
HOV
AH .OSH
J SENSE INTERRUPT STATUS COHHAI«I
CAll
NEC_OUTPlTT
CALL
RESULTS
J. READ IN THE RESULTS
JC
J34
I CHK2_RETURN
I10V
Al.NEC_STATUS
I GET THE FIRST STATUS BYTE
AND
Al.060H
J ISOLATE THE BITS
CI1P
Al.060H
I TEST FOR CORRECT VAlue
JZ
J15
; IF ERROR. GO HARK IT
CLC
; GOOD RETURN
J34:
RET J35:
J RETURN TO CALLER I CHK2.ERROR
System BIOS 5-71
LOC OBJ
EF2C 800£410040 Ef31 F9 EF32 C3
EF3! En] FB EF34 53 EF3S 51 EF30 8302 Ef38 33C9 EF3A EF3A F6063Eooeo EF3F 750C EF41 ElF7 EF43 FEee EF45 75F3 EF47 800E410080 EF4C f9 EF4D EF4D 9C EF4E 80263E007F EF53 90 EF54 59 EF55 5B Ef56 C3
EF57 EF57 EF57 FB EF58 IE EF59 50 Ef5A E8EIOF EF5D 800£3E0060 EF62 B020 EF64 E620 EF66 58 EF67 IF EF68 CF
EF69 EF69 FC EF6A BF4200 EF60 51 EF6E 52
LINE
3023 3024 3025 3026 3027
3028 3029 3030 3031 3032 3033 3034 3035 3036 3037
3038
3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 30S5 3056 3057 3058 3059 3060 3061
3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3071 3078 3079 3060 3081 3062 3083 3064 3085 3086 3067 3086 3069 3090 3091 3092 3093 3094 3095 3.96 3097 3096 "iOqq
SOURCE
OR
STe
j; ERROR RETURN COOE
RET
CHK_STAT_2
ENOP
; - ------------------ ____________________________________________________ _
: WAIT INT
THIS ROUTINE WAITS FOR AN INTERRUPT TO OCCUR. A TItlE OUT
ROUTINE TAKES PLACE DURING THE WAIT, SO THAT AN ERROR HAY BE
RETURNED IF THE DRIVE IS HOT READY.
; INPUT
NONE
j OUTPUT
CY = 0 SUCCESS ty = 1 FA.IlURE -- DISKETICSTATUS IS SET ACCORDINGLY
{AX) DESTROYED
1-----------------------------------------------------------------------
WAIT_INT
PROC HEAR
STI
; TURN ON INTE~RUPTS, JUST IN CASE
PUSH
BX
PUSH ex
i SAVE ~EGISTERS
NOV
BL.2
I CLEAR THE COUNTERS
XOR
CX,CX
J FOR 2 SECOND WAIT
J36:
TEST SEEK_STATUS.INTJLAG
, TEST FOR INTERRUPT OCCURRING
JHZ
J17
LOOP J36
I COUNT DOWN WHILE WAITING
DEC
BL
I SECOND LEVEL COUNTER
JHZ
J36
OR
DISKETTE_STATUS, TIME_OUT
; NOTHING HAPPENED
STe
~ ERROR RETURN
J37:
PUSHF
AND
, SAVE CURRENT CARRY
SEEK.STATUS,NOT INTJLAG
; TURN OFF INTERRUPT FLAG
POPF
; RECOVER CARRY
POP
ex
POP
BX
; RECOVER REGISTERS
RET
,I GOOD RETURN COOE COMES
FROM TEST INST
WAIT_INT
EHOP
i-------------------------------------------------------
; DISK.1NT
THIS ROUTINE HANDLES THE DISKETTE INTERRUPT
iINPtJT
NONE
I OUTPUT
THE INTERRUPT FLAG IS SET IS SEEK_STATUS ; ------- -----------------------------------______________
ORG
OEF57H
DISK.INT
PROC
FAR
STI
I'\JSH as
I RE EHABLE INTERRUPTS
PUSH
AX
CALL DDS
OR
SEEK_STATUS. INTJLAG
NOV
AL,20H
J END OF INTERRUPT HARKER
OUT
20H.AL
J INTERRUPT CONTROL PORT
POP
AX
POP
os
j RECOVER SYSTEM
IRET
; RETURN FROM INTERRUPT
DISK_IHT
EtilP
1----------- -------- ------- - --- - - - - - -------------- ------------------- ---. I RESULTS
THIS ROUTINE WIll READ ANYTHING THAT THE NEC COt-'TROLLER HAS
TO SAY FOLLOWING AN INTERRUPT.
INPUT
NONE
; OUTPUT
CY = 0 CY = 1
SUCCESSFUL TRANSFER FAILURE -- TIME OUT IN WAITING FOR STA.TUS
NEC.STATUS AREA HAS STATUS BYTE LOADED INTO IT (AH) DESTROYED
; ----------------- --- -- - - --------------------~---------~------- ---------
RESULTS PROC
NEAR
CLO
MOV
OI.OFFSET NEe_STATUS
I POINTER TO DATA AREA
PUSH
CX
I SAVE COUNTER
PUSH
OX
5-72 System BIOS
LOC OBJ
EF6F 53 EF70 6307
~
EF72
EF72 33C9 EF74 8AF403 EF77 EF77 EC EF78 A880 EF7A 750C Ef7e E2F9 EF7E 800E410080 EF83 EF83 F9 EF84 58 EF85 SA EF86 59 EF87 C3
"88 EF88 EC Ef89 A840 fFBB 7507 EFBD £FeD 800£410020
EF92 EBEF
~
"94
£F94 42: EF95 EC EF96 8805 EF98 47 EF99 890AOO EF9C EZFE EF9E 4A EF9F EC EfAO A810 EFAl 7406 EFA4 FEee EFA6 75CA EFA8 EBD
EFAA EFAA 58 EFAB SA HAC 59 EFAD C3
/"""\
EFAE EFAE A04500 EFBI 3AC5 EFB3 A04700 EFB6 740A EFBS 8B0800 EFBB E6AEFE EFBE 8AC4 EFCO FECO EFC2 EFC2 ZACI
LINE
3100 3101 310l 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132: 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 314S 3149 3150 3151 3152 3153 3154 3155 3156 3157 3156 31.59 3160 3161 3162 3161 3164 3165 316b 1167 3168 3169 3170 3171 3172 3173 3174 3175 3176
SOURCE
PUSH MOV
BX Bl,7
J MAX STATUS BYTES
; ---- WAIT FOR REQUEST FOR MASTER
J38: J39:
J4a:
XOO
MOY
IN TEST JNZ LOOP 00
STC pop pop pop OET
; INPUT_LOOP
CX,CX
; COUNTER
OX , 03F4H
I STATUS PORT
I WAIT FOR HASTER
A.l,DX
i GET STATUS
AL,080H
I MASTER READY
J40A
i TEST_OIR
J39
i I-IAIT_HASTER
OISKETn:_STATUS. TIME_OUT
J RESULTS_ERROR
I SET ERROR RETURN
BX
OX
CX
1----- TEST THE DIRECTION BIT
J40A: J41:
IN TEST JNZ
OR JMP
AL,DX
; GET STATUS REG AGAIN
AL.040H
I TEST DIRECTION BIT
J42
; OK TO READ STATUS
; NEC_FAIL
DISKETTE_STATUS .BAD_NEC
J40
; RESULTS_ERROR
;----- READ IN THE STATUS
J42 : J41;
INC IN MOV INC MeV lOOP DEC IN TEST JZ DEC JH2 JMP
DX AL.DX (DIltAL 01
eX,lo
J43 OX AL,DX AL,OlOH J44 BL J3. J41
j----- RESULT OPERATION IS DONE
; INPUT_STAT ) POINT AT DATA PORT ; GET THE DATA i STORE THE BYTE I INCREMENT THE POINTER I lOOP TO KILL TIME FOR NEC
I POINT AT STAruS PORT ; GET STATUS I TEST FOR NEe STILL BUSY I RESULTS DONE I DECREMENT THE STATUS COUNTER I GO BACK FOR HOR E ; CHIP HAS FAILED
J44:
POP
BX
POP
ox
POP
CX
; RECOYER REGISTERS
OET
1 GOOD RETURN CODE FROM TEST INST
1---------------------------------------------------------------
; NUtCTRAHS
THIS ROUTINE CALCULATES THE HUI1BER OF SECTORS THAT
WERE ACTUALLY TRANSFERRED TO/FRON THE DISKETTE
INPUT
= ICH) CYLINDER OF OPERATION = I CU START SECTOR OF OPERATION
i OUTPUT
= (AU Nl..lHBER ACTUALLY TRANSFERRED
--- NO OTHER REGISTERS MODIFIED
; ---------------------------------------------------_.---
HUH_TRANS
PROC
NEAR
MeV
AL,NEC_STATUS+3
I GET CYLINDER ENDED UP ON
CMP
AL,CH
I SANE AS WE STARTED
MOV
AL,NEC.STATUS+5
I GET ENDING SECTOR
JZ
J4.
J IF ON SANE CYL, THEN NO ADJUST
MOV
BX,8
CALL MeV
GET_PAR" AL.AH
,; GET EOT VALUE INTO AL
INC
AL
; USE EOT+l FOR CALCULATION
J45:
S\JB
AL,CL
I S18TRACT 5T ART FROt1 END
System BIOS 5-73
LaC OSJ
EFC4 C3
EFe7 EFe7 EFe7 CF EFea 02 EFC9 25 EfeA 02 EfCB De
Efee 2A EFea ff
EFeE 50 EFeF F6 HOD 19 EFDI 04
EFDZ EF02 EFOZ FB EF03 IE [F04 52 EFOS 56 EF06 SI EF07 53 EFOB E6630F EFoB 86F2 EFDD eAse7S EFED DIE6 EFEZ 685408 EFE5 OBD2 EFE7 740C EFE9 OAE4 EFEB 740E EFED FEee EFEF 743F
LINE
3177 3178 3179 3180
3181 3182 3183 3184 3185 3166
3187 3188 3169 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253
SOURCE
RET
HUtt_TRANS
EHOP
RESULTS EHOP .-------------------- ___________________________________________________ _
; DISK_BASE
THIS IS THE SET OF PARAHETE~S REQUIRED FOR DISKETTE OPERATION.
THEY ARE POINTED AT BY THE DATA VARIABLE DISK.POINTER. TO
110DIFY THE PARAMETERS. BUILD ANOTHER PARAMETER BLOCK AND POINT DISK.POINTER TO IT. ;-------------------------------------______________________ · ____________
ORG
DB DB DB DB DB DB DB DB DB DB DB
OEFC7H LABel BYTE 11001111B
8 OlAH OFFH 050H OF6H 25
J SRT=C , HD UNLOAD=OF - 1ST SPECIFY eYTE ; HD LOAD::l. NOOE=OHA - 2f.1) SPECIFY AYTF 1 WAIT AFTER opt.! TI L NOTOR OFF ; 512 BYTES/SECTOR 1 EDT ( LAST SECTOR ON TRACK) i GAP LENGTH I DTL I GAP LENGTH FOR FORHAT I FILL BYTE FOR FORHAT ; HEAD SETTLE TINE (NILLISECONDS) ; MOTOR START TIME (1/8 SECONDS)
1--- INT 17 ------------------------------------------------------------
PRINTER.IO
nns ROUTINE PROVIDES CQt1t1l.I-IICAnON WITH THE PRINTER
INPUT
(AHI=O PRINT THE CHARACTER IN (All
ON RETURN I AH::1 IF CHARACTER COULD HOT BE PRINTED
(TINE OUT). OTHER BITS SET AS ON NORNAL STATUS CALL
(AH}=1 INITIALIZE THE PRINTER PORT
RETURNS WITH (AH 1 SET WITH PRINTER STATUS
IAHl=2 READ THE PRINTER STAruS INTO (AHl
7
1
2-1 0
I
I
I
I.TINE OUT :
I
I
I. UNUSED
1 = 110 ERROR
1 = SELECTED I. 1 = OUT OF PAPER
1 = ACKNOWLEDGE
1 ;: NOT BUSY
(OX) ;: PRINTER TO BE USED (0,1,21 CORRESPONDING TO ACTUAL VAlUES IN PRINTER.BASE AREA
I ; DATA AREA PRINTER.BASE CONTAINS THE BASE ADDRESS OF THE PRINTER ; CAROlS) AVAILABLE (LOCATED AT BEGItI'UNG OF DATA SEGMENT, ; 408H ABSOLUTE, 3 WORDS)
; DATA AREA PRINT.TIN.OUT I BYTE I "AY BE CHANGED TO CAUSE DIFFERENT I TIME-OUT WAITS. OEFAULT=20
; REGISTERS
AH IS MODIFIED
A.Ll OTHERS UNCHANGED
;-----------------------------------------------------------------------
ASSln1E
OR"
PRINTER.IO
STI
CS:CODE .05: DATA
OEFDlH
PROC
FAR
; INTERRUPTS BACK ON
PUSH OS PUSH DX
J SAVE SEGMENT
PUSH
SI
PUSH
CX
PUSH
BX
CALL HOV
DDS SI,DX
I GET PRINTER PARI1
HOV
BL,PRINT TII1 OUT[SII
; LOAD TINE-OUT PARM
SHL
SId
I WORD OFFSET INTO TABLE
HOV
OX, PRINTER.BASE I SI I
J GET BASE ADDRESS FOR PRINTER CARD
DR
DX,DX
1 TEST OX FOR ZERO.
JZ
B.
; INJICATING NO PRINTER 1 RETURN
OR
AH,AH
I TEST FOR IAHI::O
JZ
B2
I PRINT.AL
DEC
AM
1 TEST FOR IAHI=1
JZ
Be
5-74 System BIOS
~
LOC OBJ
EHI FEee EFn 7428 EFF5 EFF5 58 £FFb 59 EFn Sf EFF8 5A EFF9 IF EFFA CF
EFFS EFFB 50 EFFC EE EFFO 42 EFFE EFFE 26C9 FOOD FOO~ EC FOOl 8AEO F003 .1.860 FODS 750E FOOl ElF7 F009 FEte Fooe 75FI FOOD 80CC01 F010 80E4F9 FOB EBB F015 F015 BOOD F017 42 F018 EE F019 BoDe FOlB EE FDIC 58
~
fOlD FOlD 50 FOIE FOIE 8B5408 F021 42 F022 EC F023 8AEO F025 80E4F8 F028 F028 SA F029 8...C2 F028 80F448 F02E fBC5
~
F030 F030 50 F031 42 F032 42 F033 BD08 F035 EE F036 B8E803 F039 F039 48 F03A 75FD F03C BOOC
F03E EE F03F EBDD
F041 62El
LINE
3254 32:55 3256 3257 3258 ]259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 ]278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 HIO H11 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330
SOURCE
DEC
AH
JZ
8S
81:
POP
BX
POP
CX
POP
SI
POP
OX
POP
OS
IRET
j------ PRINT TIlE CHARACTER IN (ALI
I TEST fOR (AH)=2 ; PRINTER STATUS ; RETURN
I RECOVER REGISTERS J RECOVER REGISTERS
82: B3: B3_1;
B4:
PUSH OUT INC
SUB
IN HOV TEST JNZ LOOP DEC JHZ OR AND JHP
HOY INC OUT HOV O\JT POP
AX
ax,AL
OX
eX,ex
AL,DX AH,AL "L , 80H 8. 83_1 Bl
.3
AH,I AH.OF9H SHORT 87
AL,OCH OX OX.Al Al,OCH OX,Al AX
I SAVE VALUE TO PRINT ; OUTPUT CHAR TO PORT ; POINT TO 51 ATUS PORT
I WAIT_BUSY
; GET STATUS ; STATUS TO AH ALSO ; IS THE PRINTER CURREHTLY BUSY i OLrCSTROBe ; TRY AGAIN ; DROP LOOP COUNT ; GO TILL TIMEOUT ENDS ; SET ERROR FLAG ; TURN OFF THE OTHER BITS ; RETURN WITH ERROR FLAG SET ; OUT_STROBE ; SET THE STROBE HIGH ; STROBE IS BIT 0 OF PORT C OF 8255
; SET THE STROBE lOW
; RECOVER THE OUTPUT CHAR
;~~---- PRINTER STATUS
85:
PUSH AX
I SAVE At REG
B6:
HOV
OX I ~INTER_eASE [SI J
INC ox
IN
Al.OX
; GET ~INTER STATUS
HOV
AH,AL
AND
AH , OF8H
I TURN OFF UNUSED BITS
87:
; STATUS_SET
POP
OX
; RECOVER AL REG
HOV
Al,Ol
; GET CHARACTER INTO Al
XOR
AH,48H
; flIP A COUPLE OF BITS
JHP
8,
; RETURN FROM ROUTINE
; ~---~- INITIALIZE THE PRINTER PORT
B8: PUSH INC INC HOV OUT HOV
B9: DEC JNZ HOV
OUT JHP PRINTER_IO
AX OX OX Al.8 DX,Al AX,lOOO
AX 8. AL,OCH
DX ··U
.6
ENDP
I SAVE Al I POltfT TO OUTPUT PORT
I SET INIT LINE LOW
i INIT_lOOP ; LOOP FOR RESET TO TAKE I INIT_LOOP
,; NO INTERRUPTS. NON AUTO LF. INIT HIGH
I PRT_STATUS_l
e, Ow c,.
I RETURN ADDRESS FOR DUH'I1Y STACK
;
INT 10
_____________________ _____ __ _______________________
~~~
-----_~
~
~
~
; VIDEO_IO THESE ROUTINES PROVIDE THE CRT INTERFACE THE fOLlOWWG FUNCTIONS ARE PROVIDED:
System BIOS 5-75
lOC OBJ
LINE
3331 3332 3333 3334 3315 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 336. 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385
..3386
3387
"
3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407
SOURCE
(AHl=O
IAHJ=l (AH )=2 (AH 1=3 (AH 1=4 (AHI=5 I AH )=6 (AHI=7
SET HOOE (All CONTAINS I10DE VALUE
(AU=O 40X25 Bioi (POWER ON DEFAULTI
(All=l 40X25 COLOR
(All:::2 80X2S eN
(AlI=3 80X,S COLOR
GRAPHICS MODES
(All=4 320X,OO COLOR
ULJ=5 320X,OD Bill
(ALI=6 640X200 Bioi
CRT 1100E=7 80X2S 8&W CARD {USED INTERNAL TO VIDEO ONLY!
nil' NOTE Bioi MODES OPERATE SAME AS COLOR HODES. BUT
COLOR BURST IS NOT ENABLED SET CURSOR TYPE
I CH):::
BITS 4-0 ::: START LINE FOR CURSOR
** HAROWARE WILL AlWAYS CAUSE BUN ** SETTING BIT 5 OR b WILL CAUSE ERRATIC
BLINKING OR NO CURSOR AT ALL
= (ClI = BITS 4-0 END LINE FOR CURSOR
SET CURSOR POSITION
(DH,Oll = Rm",coLUMN (0,0) IS UPPER LEFT
(BH I = PAGE NlJt1BER (MUST BE 0 FOR GRAPHICS HODES I
READ ClRSOR POSITION
IBH) = PAGE Nltf3ER (l1l/ST BE 0 FOR GRAPHICS HODESI
ON EXIT (DH,OL) = R~"'COLl.It1N OF CURRENT CURSOR
(CH,ClI = CURSOR HODE CURRENTlY SET
REAO LIGHT PEN POSITION
ON EXIT:
= (AH I 0 -- LIGHT PEN SWITCH NOT DOWN/NOT TRIGGERED
(AHl ;;; 1 .- VALID LIGHT PEN VALUE IN REGISTERS (DH,OLl = ROIol,COLl.It1N OF CHARACTER LP POSN
(CHI = RASTER LINE (0-1991
= (BXI PIXEl COLUMN (0-319.639)
SELECT ACTIVE DISPLAY PAGE (VALID ONLY FOR ALPHA HODES)
(ALI=NEW PAGE VAL 10-7 FOR HODES Oll. 0-3 FOR HODES 2&3):
SCROLL ACTIVE PAGE UP
(ALI :: HUMBER OF LINES, INPUT LINES BLANKED AT BOTTOM
OF WINDOW
Al = 0 MEANS BLANK ENTIRE WINDOW
(CH,CLI :; ROW,COLl,J1'1N OF UPPER LEFT CORNER OF SCROLL
(DH,DlI = ROW,COLUNN OF LOWER RIGHT CORNER OF SCROLL {BH I = ATTRIBUTE TO BE USED ON BLANK LINE
SCROLL ACTIVE PAGE DOWN
1All :: HUMBER OF LINES, INPUT LINES BLANKED AT TOP
OF WINDOW
AL = 0 MEANS BLAt-I< ENTIRE WINDOW
(CH.ClI = ROW,COLUMN OF UPPER LEFT CORNER OF SCROLL
(DH,Ot) :; ROW,COLUMN OF LOWER RIGHT CORNER OF SCROLL
I BH' = ATTRIBUTE TO BE USED ON BLANK LINE
CHARACTER HANDLING ROUTINES
(AH) :; 8 READ ATTRIBUTE/CHARACTER AT CURRENT CURSOR POSITION (SHI :; DISPLAY PAGE (VALID FOR ALPHA MODES ONLYI ON EXIT:
I At) = CHAR READ
IAH) :: ATTRIBUTE OF CHARACTER READ (ALPHA MODES ONLY) (AH) :: 9 WRITE ATTRIBUTE/CHARACTER AT CURRENT CURSOR POSITION
(BH) :: DISPLAY PAGE (VALIa FOR ALPHA HODES ONLYJ (CX I = COUNT OF CHARACTERS TO WRITE (Al) :: CHAR TO WRITE
IBt) = ATTRIBUTE OF CHARACTER (ALPHAI/COLOR OF CHAR
(GRAPHICSI
= SEE NOTE ON WRITE DOT FOR BIT 7 OF BL I.
(AHJ :: 10 WRITE CHARACTER ONLY AT CURRENT CURSOR POSITION (BH) = DISPLAY PAGE {VALID FOR ALPHA NODES ONLYI 1CX I = COUNT OF CHARACTERS TO WRITE (AL I = CHAR TO WRITE
FOR REAO/WRITE CHARACTER INTERFACE WHILE IN GRApHICS HOOE. THE CHARACTERS ARE FORHED FROtt A CHARACTER GENERATOR IMAGE MAINTAINED IN THE SYSTEH ROM. ONLY THE 1ST 128 CHARS ARE CONTAINED THERE. TO REAOIWRITE THE SECOND 128 CHARS, THE USER MUST INITIALIZE THE POINTER AT INTERRUPT IFH I LOCATION 0007CH I TO POINT TO THE IK BYTE TABLE CONTAINING THE CODE POINTS FOR THE SECOND lZ8 CHARS (lZ8-2551.
FOR IoRITE CHARACTER INTERFACE IN GRAPHICS MOO!, THE REPLICATION : FACTOR CONTAINED IN (CXl ON ENTRY WIll PRODUCE VALID
5-76 System BIOS
LOC OBJ
F045 F045 F045 FCFO f047 CDFl F049 EEFI F048 39F2 FOItO 9tF7 f04F 17F2: FOSI 96F2: F053 38F3 FOSS 7ltF3 F057 89F3 F059 Ecn FOSB 4EF2 FOSD 2:FF4 F05F 1EF4 FOb! 18F7 FOb3 74f2
0020
~
FObS FObS F06S FB F066 FC F067 Ob F068 IE f069 52: FOb. 51 F06B 53
LINE SOURCE
3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 342. 3425 3426 3427 3428 3429 3430 3431 3432: 3433 3434 3435 3436 3437 3438 3439 3. .0 3441 3442 3443 3444 3445 3446 3447 344& 3449 3450 3451 3452: 3453 3454 3455 3456 3457 3458 3459 346. 3461 34b2 3463 3464 34b5 34bb 3467 34b8 34b9 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3lt82 3483 3484
RESULTS ONLY FOR CHARACTERS CONTAINED ON THE SAtlE ROW. CONTINUATION TO SUCCEEDING LINES WILL NOT PRODUCE CORRECTLY.
GRAPHICS INTERFACE I AH) :: 11 SET COLOR PALEnE
ISH) = PALETTE COLOR 10 BEING SET (0-1271
= (BLI COLOR VALUE TO BE USED WITH THA.T COLOR to
NOTE: FOR THE CURRENT COLOR CARD. THIS ENTRY POINT HAS HEANIHG ONLY FOR 3ZQX20Q GRAPHICS.
COLOR 10 = 0 SElECTS THE BACKGROUND COLOR (0-151: COLOR 10 = 1 SELECTS THE PALETTE TO BE USED:
0= GREEN(11/REO(ZI/YEllOW{31 1 :: CYANI 1 )/I1AGfNTA( 21/WHITE( 3)
IN 40X25 OR 80X25 ALPHA MODES. THE VAlUE SET FOR PALETTE COLOR 0 INDICATES THE BORDER COLOR TO BE USED (VALUES 0-31.
WHERE 16-31 SELECT THE HIGH INTENSITY BACKGROL/tl) seT.
fAH) = 12 WRITE DOT (OX) = R~ NUt1BER «ex) = COLUMN HUMBER CUI = COLOR VALUE = IF BIT 7 OF .l.L 1. THEN THE COLOR VALUE IS
EXCLUSIVE OR' 0 WITH THE CURRENT CONTENTS Of
THE DOT (AH) = 13 READ DOT
COX) = ROW NUMBER
(CX) = COLUMN HUMBER
(AU RETURNS THE DOT READ
I ASCII TELETYPE ROlJTINE FOR OUTPUT
(AM) = 14 WRITE TELETYPE TO ACTIVE PAGE tAU = CHAR TO WRITE (8U = FOREGROUND COLOR IN GRAPHICS HOOE
NOTE - SCREEN WIDTH IS CONTROLLED BY PREVIOUS HOOE SET:
(AH) = IS CURRENT VIDEO STATE
RET1JRNS THE CURRENT VIDEO STATE
= (AU MODE CURRENTLY SET ( SEe AH=O FOR EXPlANATION) = tAH» NUt1BER OF CHARACTER COLlJttiS ON SCREEN = (BH) CURRENT ACTIVE DISPLAY PAGE
CS,SS.DS.ES,BX,CX.DX PRESERVED DURING CALL
;:
~
-~
--
ALL OTHERS
----- ------
---- DESTROYED
- ----
---------
------
--
--
---
-
---------
---------
ASSUi1E CS :CODE ,as: DATA .ES: VIDEO.RAM
OR.
OF04SH
HI
LABEL WORD
I TABLE OF ROUTINES WITHIN VIDEO I/O
OW
OFFSET SETJiODE
OW
OFFSET SET.CTYPE
ow
OFFSET SET.CPOS
OW
OFFSET READ.CU:!SCII
ow
OffSET REAO.LPEN
OW
OffSET ACT.OISP.PAGE
ow
OFFSET SCROLL.UP
ow
OFFSET SCROLL.DOWN
ow
OFFSET READ.AC.CURRENT
ow
OFFSET WRITE.AC.CURRENT
DW
OFFSET WRITE_C.CURRENT
ow
OFFSET SET.COlOR
DW
OFFSET WRITE.DOT
DW
OFFSET READ.DOT
ow
OFFSET WRITE.TTY
ow
OFFSET VIDEO_STATE
HIL
EQU
$-MI
OR.
VIDEO.IO STI CLD PUSH PUSH PUSH PUSH PUSH
OF065H
PROC
NEAR
ES OS
ox
C)(
BX
I INTERRUPTS BACK OH j SET DIRECTION FORWARD
J SAVE SEGMENT REGISTERS
System BIOS 5-77
LOC OBJ
F06C 56 F060 57 F06E 50 F06F 8"C4 F071 32E4 FOn DIED F07S SBFO F077 302:000 F07A 7204 F07e 56 F07D E94501 FoeD FoeD EB6BOE FOBl B80088 F086 8B3EIOOO FOBA BIE73DOD FOSE 6lFF30 F091 7502 FO'll 8480 F095 F095 BEtO F097 58 F098 8A264900 F09C 2EFFA445FO
FOA4 FOA4
FOA4 38 FOA5 28 FOA6 20 FOA7 OA FOA8 IF FOA9 06 FOAA 19 FOAB lC FOAC 02 FOAD 07 FOAE 06 FOAF 07 FOBO 00 FOBI 00 FOB2 00 FOB3 00
0010
FOB4 71 FOBS 50 FOB6 5A FOB7 OA FOB8 IF FOB9 06 FOBA 19 FOBB IC FOBC 02 FOBD 07 FOBE 06 FOBF 07 FOCO 00 FOCI 00 FOC2 00 FOC3 00
FOC4 38 FOCS 28
LINE
3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3496 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525
SOURCE
PUSH
Sl
PUSH
01
flUSH
AX
J SAVE AX VAWE
MOV
AL,AH
I GET INTO lOW BYTE
XOR
AH,AH
; ZERO TO HIGH BYTE
SAL
AX.!
; *2 FOR TABLE LOOKUP
MOV
SI,AX
; PUT INTO 51 FOR BRANCH
tMP
AX.HIL
I TEST FOR WITHIN RANGE
J8
M'
; BRANCH AROUND BRANCH
POP
AX
; THROIol AWAY THE PARAMETER
JMP
VIDEO_RETURN
; DO NOTHING IF NOT IN RANGE
HZ:
CALL DDS
MOV
AX.OBBOOH
; SEGMENT FOR COlOP CARD
MOV
DI.EQUIPJLAG
; GET EQUIPMENT SETTING
ANO
DI,30H
ISOLATE CRT SIHTCHES
tMP
DI.30H
; IS SETTING FOR BW CARD?
JHE
M'
MOV
AH,OBOH
; SEGMENT FOR BW CARD
HJ:
HOV
ES,AX
I SET UP TO POINT AT VIDEO RAM AREAS
POP
AX
I RECOVER VALUE
MOV
AH,CRT_MOOE
; GET CURRENT I100E INTO AH
JMP
WORD PTR CS: [SI+OFFSET HI J
VIDEO_IO
ENDP
;-------------------------------------------------------
, SET_MODE
THIS ROUTINE INITIALIZES THE ATTACHI1EHT TO
THE SELECTED 110DE. THE SCREEN IS BLAt«ED.
I INPUT
(All = MODE SELECTED (RANGE 0-9'
I OUTPUT
I
NOHE
1---- -- ---------------------------------- - -___________
;----- TABLES FOR USE IN SETTING OF HOOE
ORG
OFOA4H
VIDEO_PARMS
LABEL
;----- INIT_TABLE
BYTE
08
38H .28H .2DH .OAH.IFH,6,19H
; SET UP FOR 40X25
3526
08
lCH.2,7,6.7
3527
DB
0.0.0.0
3528
M4
3529
3530
EQIJ DB
$-VIDEO_PARMS 71H .50H .SAH .OAH, IFH.6 ,1911
I SET UP FOR 80X25
3531
3S32
3533 3534
08
ICH.2.7,6,7
08
0.0.0.0
OB
38H. 28H.2DH. OAH, 7FH.6 .64H
I SET UP FOR GRAPHICS
5-78 System BIOS
~ ".....--....,
LOC OBJ
FOC6 2D FOC7 OA FOC8 7F FOC~ 06 FoeA 64 Foce 70 Face 02 FQCD 01 fOCE 06 FOCF 07 FOOD 00 FOOl 00 FOD2: 00 FOD3 00
F004 61
FOOS so
F006 52 FOD7 OF FOD8 19 F009 06 fOD" 19 FODS 19 FOOC 02 FOOD Do FOOE DB FODF DC FOEO 00 FO£l 00 FOE2 00 Fon 00
FDEIt FO£4 0008 FOE6 0010 FOE8 0040 FOE" 0040
FOEt FOEt 28 FOED 28 FOEE 50 FOEF 50 FOFO 28 FOFI 28 FOF2 50 FOF3 50
~
FOF4 FOF4 2C FOF5 28 FOF6 20 FOF7 29 FOF8 2A FOF9 2E Fa FA IE FOFB 29
FOFC FOFC B.o403 FOFF 8300 FlOt 83FF30 FI04 7506 fl06 B007 FI08 B2B4 FI0A FEC3 flOC FlOC 8AEO FlOE A24900 Fill 89166300 FIlS IE FI16 50 F117 52
LINE SOURCE
3535
3536
3537 3538
DB
70H,2,1.6.7
DB
0,0,0.0
DB
6lH,SDH ,52H,OFH ,19M,6, 19M
I SET UP FOR BOXiS B&W CARD
3539
DB
19H,2,ODH. OBH. OCH
3540
DB
0,0,0.0
3541 3542 3543 3544 3545 3546 3547 3546 3549 3550 3551
115
LABEL WORD
DW
2048
DW
4096
DW
16384
DW
1638,.
I TABLE OF REGEN LENGTHS ; 40XiS I SOX2S , GRAPHICS
1----- COlUt1NS
tI6
LABEL BYTE
DB
40,40.60,80,40,40,80.80
3552 3553 '554 3555 3556
,----- C_REG_TAB
"7
ueEL BYTE
I TABLE OF HODE SETS
DB
2tH ,28H.20H .2~. 2AH,2EH t lEH.2~
3557 3558 3559 3560
....,3561
3563 3564 3565 j566
' ...7 3568 3569 3570 3571 3572
SET_HODE ItOY
ttOY
C"P JNE
""V
"DY
INC
H8:
""V
t1DY ttOY PUSH PUSH
PUSH
PRDC NE.. OX.0304H BL,O OI.30H
MO AL,7 DL,084H BL
AH,Al CRT_HOOE, Al ADDR_6845,DX DS AX DX
I ADDRESS OF COLOR CARD I HOOE SET FOR COLOR CARD I IS 8W CARD INSTALLED I OK WITH COLOR I INDICATE 8W CARD HOOE I ADDRESS OF BW CARD (384) I HDDE SET FOR 8W CARD
I SAVE ttODE IN AH I SAVE IN GLOBAL VARIABLE I SAVE ADDRESS OF BASE J SAVE POINTER TO DATA SEGHENT I SAVE HODE J SAVE OUTPUT PORT VALUE
System BIOS 5-79
LOC OBJ
Fila 83C204 FllB BAC) FHD EE FilE 5A FIlF 2BCO FIll BEDS
FI23 C51E7400 Fll7 58
Fll8 891000 FllB aOFC02 FlZE 7210 Fl30 0309 F132 80FC04 F135 7209 F137 0309 F139 80FC07 FBe 7202 F13E 0309
F140 FI40 50 Fl4! 32E4
Fl43 Fl4) 8AC4 Fl4S EE F146 42 Fl47 FECit F149 8A07 Fl48 EE F14C 43 F14D 4A FlltE ElF3 FlSO 58 FIS1 IF
F152 33FF F154 893E4EOO F158 C606620000 FISC 890020 F16D 80FC04 F163 720B F165 SOFCO? FI68 7404 Fl6A 33CO FI6C EB05 Fl6E fl6E 8508 FI70 FI70 B82007 fl73 FI73 f3 F174 AB
FI7S C70660000706 FI78 A04900 FI7E 32£4 Fl8D BBfO Flel 88166300
Fl86 83C204 F189 2E8A84F4FO Fl8E EE FlaF A26500
LINE SOURCE
3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 358. 3585 3586 3587 3588 3589 3590 3591 35n 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634
ADO
MOV
OUT POP
SUB MOV AS~E LOS
POP
ASSUME HOV
eH' Je
ADD
eH'
JC ADD
eH' Je
ADD
OX,4 AL.BL DX.Al DX AX,AX DS,AX D5: A6SQ
ex. PARI1_PTR
AX oS:CODE CX,H4 AH,2 H9 BX,CX AH,4 H9 BX.CX AM.7 H9 BX.CX
; POINT TO CONTROL REGISTER ; GET HoDE SET FOR CARD ; RESET VIDEO I BACK TO BASE REGISTER ; SET UP FOR ABSO SEGI1ENT I ESTABLISH VECTOR TABLE ADDRESSING
; GET POINTER TO VIDEO PARHS ; RECOVER PARHS
; LENGTH OF EACH ROW OF TABLE I DETERMINE WHICH ONE TO USE ; HaDE IS 0 OR 1 ; HOVE TO NEXT ROW OF INIT TABLE
I HOUE IS 2 OR :3 I HOVE TO GRAPHICS ROW OF INIT_TABlE
I HODE IS 4,5, OR 6 , MOVE TO 8W CARD ROW OF INIT_TABlE
ex , - - - - -
POINTS TO CORRECT ROW OF INITIALIZATION TABLE
H9:
PUSH AX
XOR
AH,AH
; SAVE MODE IN AH ; AH WIll SERVE AS REGISTER I tM1BER DURING lOOP
;----- lOOP THROUGH TABLE. OUTPUTTTING REG ADDRESS. THEN VALUE FROM TABLE
MID:
HOV OUT INC INC HOV OUT INC DEC LOOP POP POP ASSUME
Al,AH DX,Al OX AH AL,lex) DX,AL ex OX MID AX OS DS:OATA
I INIT lOOP I GET 6845 REGISTER NUt1BER
I POINT TO DATA PORT I NEXT REGISTER VALUE I GET TABLE VALUE j OUT TO CHIP J "IEXT IN TA.BlE ; BACK TO POINTER REGISTER I DO THE WHOLE TABLE I GET HODE BACK I RECOVER SEGI1ENT VALUE
;----- FIll REGEN AREA WITH BLAtI<
XOR
HOY HOY HOY
CH' JC
eH'
JE XOR
JH' MlI:
HOV H12:
HOV H13:
REP
OI,DI CRT.START.DI ACnVE]AGE,O CX.8192 AH,4 H12 AH,7 H11 AX,AX SHORT H13
CH,08H
AX,' '+7*256
STOSW
I SET UP POINTER FOR REGEN ; START ADDRESS SAVED IN GLOBAL I SET PAGE VALUE ; NUtlBER OF WORDS IN COLOR CARD I TEST FOR GRAPHICS ; NO_GRAPHICS_INIT I TEST FOR BN CARD ; BW_CARD_INIT ; FIll FOR GRAPHICS I10DE ; CLEAR_BUFFER
; BUFFER SIZE ON BW CARD ; NO_GRAPHICS.INIT I FILL CHAR FOR ALPHA
; FILL THE REGEN BUFFER WITH BlANKS
3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648
;----- ENABLE VIDEO AND CORRECT PORT SETTING
HOV
CVRSOR.MOOE .607H
I SET CURRENT CURSOR HaDE
HOV
I GET THE HODE
XOR
AH.AH
I INTO AX REGISTER
HOY
SI.AX
I TABLE POINTER. INDEXED BY MODE
HOY
OX.AooR_6845
I PREPARE TO OUTPUT TO
; VIDEO ENABLE PORT
ADD
DX,4
HOY
Al,CS: ISI+DFFSET li71
OUT
OX,Al
I SET VIDEO ENABLE PORT
HOY
CRT.HODE.SET ,Al
I SAVE THAT YALUE
5-80 System BIOS
LOC OBJ
Fl92: 2E8A84ECFO F197 32E4 F199 A34AOO
~
F19C 81E60£00 FlAO 2E888CE4FO FlAS 890E4COO FIA9 890800 FlAC 8F5000 FlAF IE F180 07 FlBl 33CO f 183 F3 FIB4 AB
FIBS 42 FIB6 B030
FIB8 803E490006 FIBD 7502 FIBF B03F FtCl FICI EE FlC2 A26600
~
FICS FICS SF FlC6 SE F1C7 5B FlC8 F1C8 59 FlC9 SA FlCA IF FICB 07 FlCC CF
FlCD FICO MDA FICF 890E6000 FlD3 E80200 FID6 EBED
~
F106 FID8 8B16631)0 FlOC 8AC4 flOE EE FlOF 42 FlED 8AC5 FIE2 EE FlE3 4A FlEli 8AC4 FlE6 FECD FlE8 EE Fln 42 FlEA 8ACl FIEC EE FlED C3
LINE
3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666
3667 3668 3669 3670 3671 3672 3673 367. 3675 367' 3677 367. 367' 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 36.7 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3706 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724
SOURCE
;----- DETERtlINE Nllt1BEIi! OF COLlIHHS, BOTH FOR ENTIRE DISPLAY ;----- AND THE NUMBER TO BE USED FOR TTY INTERFACE
MOV
ALles: I 51 + OFFSET t'I6 ]
XOR
AH.AH
MOV
CRT_COLS,AX
1 t-nlMBER OF COll.tlNS IN THIS SCREEN
1----- SET CURSOR POSITIONS
AND MOV NOV MOV MOV PUSH pop
XOR REP
5I.OEH CX,es:[SI + OFFSET tiS] CRT_lEN.ex
ex.a
DI.OFFSET CURSOR_POSH DS ES AX.AX 510SW
I WORD OFFSET INTO CLEAR LENGTH TABLE ; LENGTH TO CLEAR
ew i SAVE lENGTH OF CRT - NOT USED FOR
I CLEAR ALL CURSOR POSITIONS
I ESTABLISH SEGMENT ADDRESSING
; FILL WITH ZEROES
1----- SET UP OVERSCAN REGISTER
INC MOV
eMP JNZ MOV H14: OUT MOV
DX AL,30H
CRT_I1ODE.6 M" AL,3FH
OX,AL CRT_PAlETIE.AL
I SET OVERSCAN PORT TO A DEFAULT
,; VAWE OF 30H FOR ALL HODES EXCEPT 640X200 J SEE IF THE HODE IS 640X200 BW I IF IT ISNT 640X200. THEN GOTO REGULAR l IF IT IS 640X200. THEN PUT IN 3FH
· OUTPUT THE CORRECT VALUE TO 309 PORT ; SAVE THE VALUE FOR FL'ruRE USE
i----- NORHAL RETURN FROM ALL VIDEO RETURNS
VIDEO_RETURN:
POP
DI
POP
51
POP
BX
MIS:
J VIDEO_RETURN.C
POP
ex
POP
DX
POP
DS
POP
ES
I RECOVER SEGMENTS
IRET
J ALL DONE
SET_t1OOE
ENIlP
j-------- .. ------------------------------------------------------
J SET.CTYPE
THIS ROUTINE SETS THE CURSOR VALUE I INPUT
(CX) HAS CURSOR VALUE CH-START LINE. CL-STOP LINE , OUTPUT
NONE
; ____________________________________________________ 4 ___________
SET.CHPE MOV MOV CALL JMP
PROC NEAR
AHolO CURSOR_HOOE .CX M'. VIDEO_RETURN
J 6845 REGISTER FOR CURSOR SET 1 SAVE IN DATA AREA i OUTPUT CX REG
1----- THIS ROUTINE OUTPUTS THE CX REGISTER TO THE 6845 REGS NAMED IN AH
H16: MOV MOV OUT INC MOV OUT DEC MOV INC OUT INC MOV OUT RET
SET.CTYPE
OX.ADDR_6645 AL.AH DX,AL DX AL.CH DX,Al DX AL.AH Al DX.AL DX AL,CL ax,AL
ENDP
I ADDRESS REGISTER ; GET VALUE I REGISTER SET ; DATA REGISTER ; DATA
I POINT TO OTHER DATA REGISTER ; SET FOR SECOND REGISTER
j SECOND OATA VALUE
J ALL DONE
System BIOS 5-81
LOC OBJ
FlEE FlEE BACf flFO 3ZED FIF2 DIEI FlF4 88F1 FIF6 895450 FIF9 3&3£6200 FIFO 7505 FlFF 8BC2 F20l £80Z00 FlOIi FlOIi EBBF
FlOb FlOb £87COO F209 B8C8 FlOB 030E4EOO F20F OlF9 F2U MOE F213 ESC2FF F216 C3
F217 F217 A26200 FlU 880£4COO F21E 98 F21F 50 F2:20 F7EI F222 A34EOO F225 88C8 F227 DIF9 F229 B40e FZZB E8AAFF F22E 58 F22F DIn FUI 884750 F234 E6CFFF f237 EB8C
F239 F239 8AOF F23B 32FF F230 DIEl
LINE
3725
3726 3727 3728 3729 3730 3731 3732 3733
33773354
3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761
3762 3763 3764 3765 3766 3767 3768 3769 3710
3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3766
3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801
SOURCE
1---------- - - - - ________________________________
, SET_CPOS
THIS ROUTINE SETS THE CURREHT CWSOR
I
POSITION TO THE HEW X-V VALUES PASSED
l INPUT
DX - ROW. COUJt,~ OF HEW CURSOR
BH - DISPLAY PAGE OF CURSOR
; OUTPUT
C~SOR IS SET AT 6845 IF DISPLAY PAGE
1-------I-S--C-U-R-R-E-N-T--D-I-S-P-L-A-Y------------____________
SET_CPOS
"""XOR
SAL
MOV MOV CHP
JHZ
MOV CALL H17: JHP
PROC
NEAR
CL.BH
CH,CH
, ESTABLISH LOOP COUNT
CX,I
J WORD OFFSET
SI,CX
; USE INDEX REGISTER
[SI+OFFSET CURSOR_POSN1.DX
J SAVE THE POINTER
ACTIVE_PAGE, BH
H'7
I SET_CPOS_RETLIRN
AX,DX
J GET ROW/COLUMN TO AX
H18
J CURSOR_SET
l SET_CPOS_RETtlfN
,~---- SET CURSOR POSITION, AX HAS ROW/COL~ FOR CURSOR
H'8
PROC
HEAR
CALL
POSITION
I DETERMINE LOCATION IN REGEN BUFFER
HOV
CX,AX
ADO
CX,CRT_START
J ADD IN THE START ADDR FOR THIS PAGE
SAR
CX,I
I DIYIDE BY 2 FCR CHAR ONLY COUNT
HOV
AH,14
J REGISTER tl.lHBER FOR CURSOR
CALL H'.
I OUTPUT THE VALUE TO THE 6845
RET
H'8
EHOP
; --------------------______________________ - ------------------
1 ACT_DISP_PAGE
THIS ROUTINE SETS THE ACTIVE DISPLAY PAGE. ALLOWING THE FULL USE OF THE RAM SET ASIDE FOR THE VIDEO ATTACHMENT I INPUT AL HAS THE NEW ACTIVE DISPLAY PAGE ; OUTPUT
THE 6845 IS RESET TO DISPLAY THAT PAGE
; --- --------------------------------- ------------------ ------
HOV MOV C8" PUSH I'fJL MOV
HOV SAR HOV CALL
POP
SAL
"""CALL
JHP
ACTIVE_PAGE, AL
I SAYE ACTIVE PAGE VALUE
CX.CRT_LEN
I GET SAYED LENGTH OF REGEN BUFFER
I CONVERT AL TO WORD
AX
I SAYE PAGE YALUE
CX
I DISPLAY PAGE TIMES RESEN LENGTH
CRT_START. AX
J SAYE START ADDRESS FOR
J LATER REQUIREMENTS
CX,AX
I START ADDRESS TO CX
CX,l
I DIYIDE BY 2 FOR 6845 HANDLING
AH,12
I 6845 REGISTER FOR START ADDRESS
M16
8X
I RECOVER PAGE VALUE
BX, 1
I *2 FOR WORD OFFSET
AX.[BX + OFFSET CURSOR_POSH)
; GET CURSOR FOR THIS PAGE
M18
; SET THE CURSOR POSITION
SHORT VIDEO_RE11.RN
1---------------------------------------------------------------
I READ_CURSOR
THIS ROUTINE READS THE CURRENT CURSOR VALUE FROM THE 6845, FORMATS IT, Attl SEtlJS IT BACK TO THE CAllER
INPUT
BH - PAGE OF CURSOR
I OUTPUT
OX - ROW, COLUHH OF THE ClIRRENT CURSOR POSITION
ex - CURRENT CURSOR MODE
;---------------------------------------------------------------
READ_CURSOR
PROC NEAR
HOV
BL.BH
XOR SAL
BH.SH BXol
J WORD OFFSET
5-82 System BIOS
LOC OBJ
F2:3f 885750 f242 880E6000 f246 SF F247 Sf F246 58 F249 58 f24A 58 F24B IF F24C 07 F2:40 CF
f24E F24E 68166300 F252 83C205 F255 A06600 F25e OAFF F25A 750E
F2:5C 24EO F25E 80E31F F261 OAel F263 F263 EE F264 A2:6600 F267 E956Ff
F26A F26A 240F F26C DOEB F26E 73F3 F270 OC20 f272: fBEF
F274 F274 8"264"00 F276 A04900 F27B 8"3E6200 F27F SF FleD Sf Fl8t 59 F282 E943FF
LINE
3802 3603 3604 3605 3806 3807 3608 3809 3810 3611 3812 3813
3814 3815 3616 3817 3818 3819 3820 38.21 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842
'84'
3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 '867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878
SOURCE
"DV "DV
DX,[BX+OFFSET C~SOR_POSf'U
CX.C~SOR_HODE
PDP
DI
PDP
51
PDP
BX
PDP
AX
J DISCARD SAVED ex ANO ox
POP
AX
POP
DS
POP
ES
IRET
ENOP ; -- ------------- -- - - - __________ --------------___________________________ _
; SET COLOR
THIS ROUTINE WIll ESTABLISH THE BACKGROUND COLOR. THE OVERSCAN
COLOR, AND THE FOREGROUND COLOR SET FOR MECIlft1 RESOLUTION
GRAPHICS ; INPUT
(BH) HAS COLOR 10
IF BH=O. THE BACKGROUND COLOR VALUE IS SET
FROM THE LOW BITS OF BL (0-31)
IF BH=l. THE PALETTE SELECTION IS HAOE
BASED ON THE LOW BIT OF BL:
O=GREEN. REO, YELLOW FOR COLORS 1,2.3 I=BWE. CYAN, I1AGENTA FOR COLORS 1.2.3
(Bl) HAS THE COLOR VALUE TO BE USED
; OUTPUT
THE COLOR SELECTION IS UPOATEO
; ---------------------------------------------.----- --------------------
SET.COLOR
PROC
NEAR
NDV
DX.ADDR.6845
ADD
OX.5
"DV
AL,CRT.PALETTE
D.
BH,BH
JHZ "20
I I/O PORT FOR PALETTE ; OVERSCAN PORT ; GET THE CURRENT PALETTE VALUE ; IS THIS COLOR 01 ; OUTPUT COLOR 1
;----- HANDLE COLOR 0 BY SETTING THE BACKGROUND COLOR
ANO ANO OR 1119: DUT "DV J"P
AL,OEOH BL,OIFH AL,BL
OX,AL CRT_PALETTE ,At VIDEO.RETURN
; TURN OF F lOW 5 BITS OF CURRENT ; TURN OFF HIGH 3 BITS OF INPUT VALUE ; PUT VALUE INTO REGISTER ; OUTPUT THE PALETTE I OUTPUT COLOR SELECTION TO 309 PORT I SAVE THE COLOR VALUE
1----- HANDLE COLOR 1 BY SELECTING THE PALETTE TO BE USED
1120:
ANO
AL,ODFH
5H.
BLd
I TURN OFF PALETTE SELECT BIT 1 TEST THE LOW ORDER BIT OF BL
JNt
"19
OR
AL.20H
I ALREADY DONE ; TURN ON PALETTE SELECT BIT
J"P SET.COLOR
H19 ENOP
; GO DO IT
;----------------------------------------------- I YIDEO STATE
RETURNS THE CURRENT VIDEO STATE IN AX
I AH = NUtlBER OF COUJI1NS ON THE SCREEN
J AL = CURRENT VIDEO HODE
I BH = CURRENT ACTIVE PAGE
1-----------------------------------------------
VIDEO.STATE
PROC
NEAR
MOV
AH.BYTE PTR CRT.COLS
; GET HUMBER OF COLut1NS
HOV
At,CRT.MODE
HOV
I CURRENT HOOE ; GET CURRENT ACTIVE PAGE
PDP
D1
I RECOVER REGISTERS
PDP
51
POP ex
ax I DISCARD SAVED
J"P
"15
; RETURN TO CALLER
;-------------------------------------------------------
; POSITION
THIS SERVICE ROUTINE CALCULATES THE REGEN
BUFFER ADDRESS OF A CHARACTER 11'1 THE ALPHA MODE INPUT
A.X = ROW, COLUt1N POSITION
; OUTPUT
System BIOS 5-83
LOC OBJ
F285 F2:85 53 F286 8608 F288 8AC4 f28A F6264"'00 F28E 32FF F290 03e3 Fl92 OlEO f294 58 f295 C3
'296 FU6 8AD8 F298 80FC04 F2<)B 7208 F2<)o 80FC07 FUO 7403 F2A2 E9FOOl F2A5 F2A5 53 F2A6 8BCI F2A8 E83700 F2AB 7431 F2Ao 03FO F2AF 8AE6 F2Bl 2AE3 FZB3 FZB3 E87200 F2B6 03F5 nB8 03FD F2BA FECC F2BC 75F5 F2BE F2BE 58 F2BF B020 FlCI FZCI E86000 F2C4 03FO F2C6 FECB FlC8 75F7 F2eA HCA E8710C FlCD 803E490007 F202 7407 Fl04 A06500 FlD7 BA0803 FZoA EE F20B FlDB E9E7FE FlOE F2:DE 8ADE F2EO EBDC
F2E2 F2E2 803E4<)0002 F2E7 7218
LINE SOURCE
3679 3880 3881 3882 388'
..8.
3885 3686 3687 3886 3889 3890 . .91 3892
"0' . .94 3895 . .96 "07 1898 3899 3900 3901 3<)02 3<)03 3<)04 3<)05 3<)06 3<)07 3<)08 3909 3910 3<)11 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3<)25 3926 3<)27 3928 392<) 3930 3931 3<)32 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3<)43 3944 3945 3946 '947 3948 3<)49 3950 3951 3952 3953 3954 3955
-- - AX = OFFSET OF CHAR POSITION IN REGEN BUFFER
; ---------------- ----------------------------------
POSITION
PRDC HEAR
PUSH BX
I SAVE REGISTER
HOV
BX,AX
HOV
AL,AH
, ROWS TO AL
HUL
BYTE PTR CRT_COLS
I DETERMINE BYTES TO ROW
XOR
BH,eH
ADD
AX,8X
J ADO IN COlUHH VALUE
SAL
AX.l
I · 2: fOR ATTIUBUTE BYTES
POP
BX
RET
POSITION
ENOP
1-------------------------------------------------------
; SCROLL UP
nus ROUTINE HOVES A BLOCK OF CHARACTERS UP
ON THE SCREEN
INPlJT
(AH) = CURRENT CRT HOOE (All = N1.R1BER OF ROWS TO SCROLL = lex) ROW/COLl..It1N OF UPPER LEFT CORNER (OX) = ROW/COLut1N OF LOWER RIGHT CORNER (BH) = ATTRIBUTE TO BE USED ON BLANKED LINE (OS) = DATA SEGMENT (ES) = REGEN BUFFER SEGMENT
, OUTPUT
NONE - THE REGEN BUFFER IS MODIFIED
1------------------------ ------------------------------ ASSUME CS:CODE.DS:OATA. ES:OATA
SCROLL_UP
PROC NEAR
HOV
BL.AL
I SAVE LINE COUNT IN BL
CMP
AH.4
I TEST FOR GRAPHICS MODE
JC
H'
CHP
AH.7
; HANDLE SEPARATELY I TEST FOR BW CARD
JE
H'
JHP
GRAPHICS_UP
Nl:
PUSH
BX
1 UP_CONTItnJE I SAVE FILL ATTRIBUTE IN eH
HOV CALL JZ
AX.CX SCROLL_POSITION H7
j UPPER LEFT POSITION · DO SETUP FOR SCROLL J BLANKJIELD
ADD
SI.AX
I fROM ADDRESS
HDV
AH,DH
I · ROWS IN BLOCK
SUB
AH,BL
J · ROWS TO BE HOVEo
N2:
I ROW_LOOP
CALL HIO
I HOVE ONE ROW
AOD
SI,BP
AOD
OI.BP
I POINT TO NEXT LINE IN BLOCK
DEC
AH
JNZ
H2
N3:
I COUNT OF LINES TO HOVE ; ROW_LOOP J CLEAR_ENTRY
POP
AX
.... MOV
AL, ,
I RECOVER ATTRIBUTE IN AH I FILL WITH BLANKS I CLEAR_LOOP
CALL Hl1
ADD
DI,8P
... DEC
BL
JHZ
NS.
I CLEAR THE ROW I POINT TO NEXT LINE I COUNTER OF LINES TO SCROLL I CLEAR_LOOP ; SCROLL_END
CALL OOS
CHP
CRT_HODE.7
JE
H.
HOV
"L.CRT_HOOE_SET
MIIV
OX,0308H
.... OUT
OX.AL
I IS THIS THE BLACK AND WHITE CARD I IF SO. SKIP THE HOOE RESET i GET THE VALUE OF THE HOOE SET I ALWAYS SET COLOR CARD PORT
I VIDEO_RET_HERE
JHP
YIOEO_RETUiN
N7:
; BLANKJIELD
HOV JHP SCROLL_UP
BL,DH
H' ENOP
1 GET ROW CDlR'lT I GO CLEAR THAT AREA
;----- HAMJlE COtt1DH SCROLL SET UP HERE
SCROLL_POSITION PROC NEAR
CHP
CRT_HOOE.2
JB
HO
I TEST FOR SPECIAL CASE HERE I HAYE TO HANDLE 80X,S SEPARATELY
5-84 System BIOS
LaC OBJ
F2E9 803E490003 FlEE 7711
~
F2FO 52 F2Fl BADAQ3 F2F4 50 F2F5 F2F5 EC F2F6 "80S F2F6 74F8 F2FA 8025 F2FC B2D8 F2FE EE F2fF 58 FlOD 5A flO I F301 E881FF F304 03064£00 F308 88F8 F3U. 8BFO flOC 2BOl F30E FECb F310 fEC2 F312 32EO F314 882E4AOO F318 03EO F31A 8AC3 F31C F~2~4AOO F320 03CO F322 06 F323 IF F324 80FBOO F327 C3
~
F328 F328 8ACA F32:A 56 F32B 57 F32C F3 F320 A5 F32E SF F32F 5E F330 C3
F331 F331 8ACA F333 57 F334 f3 F335 AB F336 SF F337 C3
"..
LINE SOURCE
3954 3957 3956 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3'86 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999
4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010
4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 40Z8 4029 ... 030
eMP JA
CRT_MODE,3 N9
1----- SOX2S COLOR CARD SCROLL
PUSH
OX
MOV
OX.3DAH
PUSH AX
NO:
IN
Al,OX
TEST JZ MOV
AL.a
"8
AL.25H
MOV
OL.OD8H
OUT
aX,AL
pop
AX
pop
OX
N9:
CALL POSITION
ADO
AX,CRT_STAln
MOV
DI.AX
MOV
SI,AX
SUB oX,ex
INC
DH
INC
DL
XOR
CH,CH
MOV
BP,CRT_COLS
ADO
SP,BP
MOV
AL.SL
"'L
eYTE PTR CRTSOLS
ADD
AX,AX
PUSH
ES
pop
OS
eMP
Bl.O
RET
SCROL,"-POSITlON UIlP
I GUARAHTEED TO BE COLOR CARD HERE
I WAn_DISP_ENABLE I GET PORT I WAIT FOR VERTICAl RETRACE I WAIT_DISP_ENABLE
I DX=3D8 I TURN OFF VIDEO I DlmING VERTICAL RETRACE
I CONVERT TO REGEN POINTER I OFFSET OF ACTIVE PAGE , TO ADDRESS FOR SCROLL I FROH ADDRESS FOR SCROLL
I ox = IROWS, ICOLS IN BLOCK
I INCREMENT FOR 0 ORIGIN I SET HIGH BYTE OF COIAfT TO ZERO I GET l«JteER OF COLIM'IS IN DISPLAY I TIMES 2 FOR ATTRIBUTE BYTE J GET LINE COUNT 1 DETERMINE OFFSET TO FROM ADDRESS J *2 FOR ATTRIBUTE BYTE J ESTABLISH ADDRESSINB TO REGEN BUfFER J FOR BOTtf POINTERS I 0 SCROll MEANS BLANK FIELD I RE~N WITH FLAGS SET
1----- HOYE_ROW
"I'
PROC
NEAR
MOV
CL.DL
PUSH 51
PUSH 01
REP
t10VSW
I GET · OF COLS TO HOYE
J SA.YE START ADDRESS I HOYE THAT LINE ON SCREEN
POP
01
POP
SI
RET
NIO
ENDP
I RECOVER ADDRESSES
J---- CLEAR_ROW
"II
PRoe NEAR
MOV
Cl,Ol
PUSH 01
REP
STOSW
J GET · COllJt1NS TO CLEAR I STORE THE FILL CHARACTER
POP
01
AET
Nil
ENDP
1-------------------------------------------------------
; SCROLL_DQt.I.I
TtfIS ROUTINE HOVES THE CHARACTERS WITHIN A
DEFINED BLOCK DOWN ON THE SCREEN, FILLING THE
J
TOP LIHfS WITH A OEFINI!:O CHARACTER
J INPUT
(AH) = CURRENT CRT HODE
(All = HUMBER OF LINES TO SCROll = (CX) UPPER LEFT CORNER OF REGION = (OXI LOWER RIGHT CORNER OF REGION = (BH I FILL CHARACTER = (051 DATA SEGHENT = (ES) REGEN SEGMENT
; OUTPUT
NONE - SCREEN IS SCROLLED
1-------------------------------------------------------
SCROL~D~
PROC NEAR
System BIOS 5-85
LOC OBJ
F338 FD F339 8A06 f33B 80F(04 FHE n08 F340 60FC07 F343 7403 F345 E9A601 F348 F348 53 F349 8Be2 F34B E894FF F34E 7420 F350 26FO F352 8AE6 F354 2AE3 F356 F356 E8CFFF F359 2BF5 F35B ZBFD F350 FEce nSF 75F5 F361 F361 58 f362 B020 F364 F364 E8CAFF F367 2BFD F369 FECS F36B 75F7 F36D E95AFF F370 f370 8ADE F372 EBED
F374 F374 80FC04 F377 7208 F379 80FC07 F37C 7403 F37E E9A802 FlSl f181 E81AOO F384 8Bn
F386 8B166300 F38A 83C206 f300 06 n8E IF F38F F38F EC F390 A601 F392 75F8 F394 FA n95 F39S EC f396 A801 F398 74FB F39A AD F39B E927FE
LINE SOURCE
4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4056 4059 4060 4061 4062 4063 4064 4065 4066 4067 4066 4069 4070 4071 4072 4073 4074 4075 4076 4077 4076 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092
4093 4094 4095 40% 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107
STD
MOV
BL,AL
CMP
.H,lt
JC
HI2
; DIRECTION FOR SCROLL DOWN I LINE C~T TO BL I TEST FOR GRAPHICS
CMP
"H.7
I TEST FOR BW CARD
JE
HI2
JMP Nil:
GRAPHICS_DO'"'"
, CONTINUE DQIoI.I
PUSH
BX
, SAVE ATTRIBUTE IN BH
MOV
AX.OX
, LOWER RIGHT CORNER
CALL SCROLL_POSITION
; GET REGEN LOCATION
JZ
HI.
SUB
51,AX
, 51 IS FROH ADDRESS
MOV
AH,DH
I GET TOTAL. ROWS
SUB
N13:
AH,BL
, COUHl TO HOVE IN SCROll
CAll HIO
I HOVE ONE ROW
SUB
SI.BP
SUB
CI,SP
DEC
AH
JHZ
H13
H14:
POP
AX
I RECOVER ATTRIBUTE IN AH
MaV
Al,'
HIS:
CAlL HII
~ CLEAR ONE ROW
SUB
DI,BP
; GO TO NEXT ROW
DEC
BL
JHZ
HIS
JMP
HS
N16:
; SCROll_END
MOV
Bl.DH
JMP
HI4
SCROlL..DOWN
ENOP
J ~.-.----------------------------------------------------
, J READ_AC_CURRENT THIS ROUTINE READS THE ATTRIBUTE AND CHARACTER
AT THE CURRENT CURSOR POSITION .IJI) RETURNS THEM:
TO THE CAllER
;INPUT
(AH J = CURRENT CRT HODE
IBH] = DISPLAY PAGE ( AlPHA MODES ONLY)
= IDS] DATA SEGMENT = (ES) REGEN SEGMENT
1OUTPUT
(Al) = CHAR READ
= (AH) ATTRIBUTE READ
;-------..----------------------------------------------
ASSUME CS:CODE IDS:OATA. ES:DATA
READ_AC_CURRENT PROC
NEAR
CMP
AH,4
; IS THIS GRAPHICS
JC
PI
CMP
AH.7
I IS THIS BW CARD
JE
PI
JMP
GRAPHICS_READ
PI:
; READ_AC_CONTINUE
CAll
FIND.POSITION
MOV
SI,BX
J ESTABLISH ADDRESSING IN SI
; ---- WAIT FOR HORIZONTAl RETRACE
MaV
DX, ADDR_6845
ADD
DX.6
PUSH
ES
POP
OS
P2 :
IH
Al.OX
TEST JHZ
Al.l P2
eLI
P3:
IH
AL.Dx
TEST Al.I
JZ
P3
lODSW
JMP
VIDEO_RETURN
READ_AC_CURRENT ENDP
J GET BASE ADDRESS ; POIHT AT STATUS PORT
J GET SEGMENT FOR QUICK ACCESS ; WAIT FOR RETRACE lOW J GET STATUS I IS HaRZ RETRACE lOW I WAIT UHTI l IT IS J NO MORE INTERRUPTS I WAIT FOR RETRACE HIGH I GET STATUS ; IS IT HIGH ; WAIT UNTI l IT IS I GET THE CHAR/ATTR
5-86 System BIOS
LOC OBJ
~
F39E F39E 8ACF FlAO 32£D FlA2 88Fl F3A4 DIE6 flAb 8B4450 F3"9 3308 f3AB flOb F3AD F3AD 031E4COO F381 EZFA f383 F383 ESCFFE f3B6 0308 F38a C3
~
F3B9 F3B9 80FC04 FlBC 7208 F3BE 80FC07 F3Cl 7403 F3Cl E98201 nC6 F3e6 8"'E3 F3C8 50 F3C9 51 FlC... E801FF nco 8BFB nCF 59 noo 5B FlOt
r"'\
FlDl 8B166300 F305 83C206 FlD8 Fl08 EC F309 A801 F3DB 75FB FlDD FA flOE F30E EC nDF "'801 F3El 74FB f3E3 8BC3 F3E5 AB F3E6 F8 f3E7 E2Ee F3E9 E9D9FD
LINE
4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146
4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184
SOURCE
FIND_POSITION I1<JV
PROC CL.BH
HEAR
J DISPLAY PAGE TO ex
XOR I10V SAL I10V XOR JCXZ
CH,CH
SI,ex
1 MOVE TO 51 FOR INDEX
51,1
, * 2 FOR WORD OFFSET
AX,[SI. OFFSET CI..IRSOR_POSNJ
TIt" J GET ROW/COllffi OF
T PAGE
'8X.BX
I SET START ADDRESS TO ZERO
PS
I NO_PAGE
P4:
; PAGE_LOOP
ADD
eX.CRT_LEN
I LENGTH OF BUFFER
LOOP
P'
P5:
J NO_PAGE
CAll POSITION
I DETERMINE LOCATION IN REGEN
ADD
aX,AX
J ADD TO START OF REGEN
RET
FIt-i)_POSITION ENDP
,-----------------------------------------------
I WRITE_At_ClIRRENT
THIS ROUTINE ~ITES THE ATTRIBUTE
ANtI CHARACTER AT THE CURRENT ClIRSOR
POSITION
INPUT
U.H) = CURRENT CRT MODE (BH) = DISPL...Y PAGE
(CX) :: COUNT OF CHAR"'CTERS TO WRITE
(AL) = CHAR TO WRITE (BLI = ",TTRIBUTE OF CHAR TO WRITE
(DS I :: OATA SEGMENT
I ES J :: REGEN SEGMENT
J OUTPUT
NONE
J-----------------------------------------------
.. WRITE.At.CURRENT C"P AN,' JC
PROC
NEAR
I IS nus GR"'PHICS
C"P
AH.7
i IS THIS BW CARD
JE
P'
J"P
GRAPHICS.WRITE
P6:
I10V
.\H.Bt
J WRITE.AC.CONTINlIE
I GET ATTRIBUTE TO AM
PLSH
AX
I SAVE ON STACK
PUSH
CX
; SAVE WRITE COUNT
CALt
FIND_POSITION
I10V
DI.ex
pop
CX
pop
BX
I ADDRESS TO DI REGISTER I WRITE COUNT I CHARACTER IN BX REG
P7:
I WRITE. LOOP
i ---- WAIT FOR HORIZONTAL RETR...CE
t10V
ox ....00R.6845
I GET BASE ADDRESS
ADD
OX.6
I POINT AT STATUS PORT
P8:
IH
AL.OX
I GET STATUS
TEST
ALtl
; IS IT LOW
JHZ
P8
I WAIT UNTIL IT IS
CLI
I NO MORE INTERRUPTS
P9:
IH
AL,DX
I GET STATUS
TEST
At,1
I IS IT HIGH
JZ
P'
I'IOV
AX,BX
I WAIT UNTIL IT IS J RECOVER THE CHAR/ATTR
STOSW
I PUT THE CHAR/ATTR
STI
I INTERRUPTS BACK ON
LOOP
P7
I AS MANY TIMES AS REQUESTED
J"P
VIDEO.RETURN
WRITE_AC.CURRENT
ENDP
;-----------------------------------------------
I WRITE.C.CVRREHT
THIS ROUTINE WRITES THE CHARACTER AT
THE CURRENT CURSOR POSITION. AT'rnIBUTE
UNCHANGED
I INPUT
(AH I :: CURRENT CRT MODE
(BHI :: DISPLAY PAGE
(ex) :: COUNT OF CHARACTERS TO WRITE
System BIOS 5-87
LoC oBJ
F3Ee F3Ee aOFC04 F3EF n08 F3Fl sOFC07 F3F4 7403 F3F6 E97FOI F3F9 F3F9 50 F3FA SI F3F8 E6AOFF F3FE BBFB F400 59 F401 58 F402
F402 88166300 F406 83C206 F409 F409 EC F40A A801 F40C 7SFB F40E FA F40F F4,OF EC F410 A801 F412 74F8 F414 8AC3 F416 AA F417 Fe F418 47 F419 E2f7 F418 E9A7FD
F41E F4lE f83100 F421 2:66A04 F424 22C4 F426 02EO F428 SACE F42A 02eo F42C E996FD
F42F F42F 50 F430 SO F431 ESlEOO F434 02E8 F436 22C4 F438 268A.OC F438 58 f43C F6C380
LINE SOURCE
4165 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 42:00 42:01 4202 4203 4204 4205 42:06 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261
(Al) = CHAR TO WRITE
IDS) == DATA SEGMENT (E5) == REGEN SEGMENT ; OUTPUT NOHE ; --------------------.-------------------------
PIO: PH;
CMP JC CMP JE JMP
PUSH PUSH CALL MOV POP POP
AH,4 Pl. AH,7 Pl. GRAPHICS_WRITE
AX CX FIND_POSITION DI,BX CX
ex
I IS THIS GRAPHICS IS THIS BW CARD
I SAVE ON STACK I SAVE WRITE COUHT
; ADDRESS TO 01 J WRITE COUNT I BL HAS CHAR TO WRITE · WRITE_LOOP
;----- WAIT FOR HORIZONTAL RETRACE
P12: PI3:
MOV
OX , ADOR_6845
ADD
DX,6
IN TEST JNZ Cll
Al,OX Al.! Pl2
IN TEST JZ HOV
STOSB
sn
INC LOOP JMP
Al,OX .U,l P13 Al,Bl
01 PH VIDEO_RETURN
; GET BASE ADDRESS ; POINT AT STATUS PORT
I GET STATUS ; IS IT LOW I WAIT UNTIL IT IS ; NO I10RE INTERRUPTS
; GET STATUS J IS IT HIGH I WAIT UNTIL IT IS ; RECOVER CHAR ; PUT THE CHAR/ATTR J INTERRUPTS BACK ON I BUMP POINTER PAST ATTRIBUTE J AS MANY TIHES AS REQUESTED
; ----- ------------------------------- ------------- ----- ----- ; READ DOT - WRITE DOT
TlfESE ROUTINES WILL WRITE A DOT, OR READ THE DOT AT
THE na::m:ATED LOCATION
J ENTRY -
OX = ROW (0-199)
(THE ACTUAL VALUE DEPENDS ON THE HOOE)
ex = tOLUNN ( 0-6391 1 THE VALUES ARE HOT RANGE CHECKED)
= AL DOT VALUE TO WRITE (1,2 OR 4 BITS DEPENDING ON HODE,
REQ'O FOR WRITE DOT ONLY, RIGHT JUSTIFIED)
BIT 7 OF AL= 1 INDICATES XOR THE VALUE INTO THE LOCATION :
OS = DATA SEGHENT ES = REGEN SEGMENT
l EXIT
AL = DOT VALUE READ, RIGHT JUSTIFIED, READ ONLY
1---------------------------------------------------------------
ASSUNE CS:CODE,DS:DATA,ES:DATA
READ_DOT
PROC
NEAR
CALL
R3
; DETERMINE BYTE POSITION OF DOT
MOV
AL,ES:[SIJ
GET THE BYTE
AND
AL.AH
I HASK OFF THE OTHER BITS IN THE BYTE
SHL
AL,Cl
I LEFT JUSTIFY THE VALUE
MOV
CL,DH
I GET NUMBER OF BITS IN RESULT
.OL
AL.CL
J RIGHT JUSTIFY THE RESUlT
JMP
VIDEO_RETURN
; RETURN FROH VIDEO 10
ENDP
WRITE_DOT PUSH PUSH CALL SHR AND HOV pop TEST
PROt
NEAR
AX
AX
R3
AL,CL
AL.AH Cl.ES:(SI]
BX
Bl.SOH
I SAVE DOT VALUE I TWICE I DETERMINE BYTE POSITION OF THE DOT I SHIFT TO SET UP THE BITS FOR OUTPUT J STRIP OFF THE OTHER BITS ; GET THE CURRENT BYTE I RECOVER XOR FLAG I IS IT ON
5-88 System BIOS
LOC OBJ
1"'""""\
F4!F 7500 F441 F604 F443 22CC F445 DAtI F447 F447 268804 F44.1. 58 F448 E977FD F44£ F44E UtI F450 EBFS
F452 F452 53 F453 50
r""\
F454 B028 F456 52 F457 80E2FE F45A F6E2
F45C SA F45D F6C201 F460 7403 F462 050020 F465 F465 8BFO F467 58 F468 8BDI
F46A BBC002 F46D B90203 F470 803E490006 F475 7206 F477 BB8001 F47A B90307
F47D F47D 22EA
r"'\
F47F 03EA F481 03F2 F483 8AF7
F485 ZAC9 F487
LINE SOURCE
4262 4263 4264 4265 4266 4267 4268 4269 4270 42.71 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 428S 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 431S 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 433& 4337 '3]8
JHZ
R.
; YES. XOR THE DOT
HOT
AH
, SET THE MASK TO REMOVE THE
.HO
CL,AH
; INDICATED BITS
00
Al,CL
; OR IN THE NEW VAlUE OF THOSE BITS
Ill:
I FINISH_DOT
HOV
ES:ISI1.Al
I RESTORE THE BYTE IN MEI'tORY
POP
,X
JHP
VIDEO_RETURN
; RETURN FROI1 VIDEO 10
R2:
I XOR_DOT
XOR
Al,CL
; EXCLUSIVE OR THE DOTS
JHP
0'
I FINISH UP THE WRITING
WRITE_DOT
EHOP
;-------------------------------------------------------
I THIS SUBROUTINE DETERMINES THE REGEN BYTE LOCATION
; OF THE INDICATED ROW COLUMN VALUE IN GRAPHICS MODE.
I ENTRY -
= OX ROW VALUE (0-199) ex = COll.lNH VALUE 10-639)
EXIT -
= 51 OFFSET INTO REGEN BUFFER FOR BYTE OF INTEREST
= I AH MASK TO STRIP OFF THE SITS Of INTEREST
= CL BITS TO SHIfT TO RIGHT JUSTIfY THE MASK IN AH
= · I DH
BITS IN RESULT
1-------------------------------------------------------
03
PROC
NEAR
PUSH
BX
PUSH
AX
1 SAVE BX D~ING OPERATION
.u 1 WILL SAVE
DURING OPERATION
1----- DETERMINE 1ST BYTE IN IDICATED ROW BY HULTIPlYING ROW VALUE BY 40
J----- ( lOW BIT OF ROW DETERMINES EVEN/ODD. SO BYTESIROW
HOV
PUSH
.NO
HUl
Al.40 OX DL.OFEH Ol
POP
OX
TEST
Dl.l
JZ
R'
'00
AX.2000H
R4:
HOV
SI.AX
POP
AX
HOV
OX.CX
, SAVE ROW VALUE J STRIP OFF DOD/EVEN BIT
,J AX HAS ADDRESS Of 1ST BYTE OF It-CICATEO ROW ; RECOVER IT ; TEST FOR EVENIODD I JUMP IF EVEN ROW I OFFSET TO LOCATION OF 000 ROWS J EVEN_ROW 1 MOVE POINTER TO 51 ; RECOVER AL VALUE ; COLUMN VAlUE TO OX
1----- DETERMINE GRAPHICS HaDE CURRENTLY IN EFFECT
1-------------- ---------------- --- --- --------------------------.
; SET UP THE REGISTERS ACCORDING TO THE HOOE
= CH I1ASK FOR LOW OF COLlR1H ADDRESS ( 7/3 FOR HIGH/NED RES)
CL :::: · OF ADDRESS BITS IN COLUMN VALUE ( 312 FOR H/NI
= I BL HASK TO SElECT BITS FROM POINTED BYTE ISOH/COH fOR H/N)
= I BH NUMBER OF VAlID BITS IN POINTED BYTE ( 112 fOR HIH)
1--- ---- - --- --------- ------- --- ------- - ------- --------------- ---
I10V
BX.2tOH
Mev
CX.302H
CHP
CRT.HODE.6
JC
.5
HOV
BX.180H
HOV
CX.703H
; SET PARHS FOR MED RES ; HANOLE I f MED ARES ; SET PARHS fOR HIGH RES
1----- DETERMINE BIT OFFSET IN BYTE FROM COLUHH MASK
RS:
ANI)
CH.DL
1 ADDRESS OF PEL WITHIN BYTE TO CH
J ----- DETERMINE BYTE OFFSET FOR THIS LOCATION IN COlUHN
SHO
DX.CL
.DO
SI,OX
HOY
OH,SH
; SHIFT BY CORRECT AMOUNT I INCREMENT THE POINTER ; GET THE · OF BITS- IN RESULT TO OH
1----- HULTIPL'f BH (VALID BITS IN BYTE) BY CH (BIT OFFSEll
SUB
CL.CL
R6:
; ZERO INTO STORAGE LOCATION
System BIOS 5-89
LaC OBJ
F487 DOC8 f489 02CD F488 FEeF F480 75F8 fitSF SAn F491 D2EC F493 58 F494 C3
F495 F495 8AD8 F497 88Cl
F499 £86902 F49C 88F8
F49£ 2801 F4.4.0 61C20101 F4...4 DOE6 F4A6 OOE6
F4"8 803E490006 F4AD 7304
F4AF oOE2 F481 DIE7
F483 F483 06 F484 IF F4SS 2AED F487 Don F489 Don F488 7420 F480 8AC3 F48F 8450 F4Cl F6E4 F4C3 88F7 F4C5 O3FO F4C7 8AE6 F4C9 ZAB
F4C8 F4CB £88000 F4CE S1EESO!F F402 81£F801F
LINE SOURCE
4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4 350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4.66 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382
4_4383
4384 4385
4. .7
4388
4. . .
4390 4391 4392 4393 4.94 4395 4396 4197 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 44.. 4415
ROR
AL,l
I LEFT JUSTIFY THE VAWE
I IN AL (FOR WRITE)
ADD
CL.CH
1 ADD IN THE BIT OFFSET VAWE
DEC
eH
JHZ R.
J LOOP CONTROL J ON EXIT, CL HAS SHIFT COlHT
I TO RESTORE BITS
I10Y
AH,BL
; GET MASK TO AH
SH.
AH,CL
pop
ex
RET
.3
ENDP
I MOVE THE MASK TO CORRECT LOCATION I RECOVER REG I RETURN WITH EVERYTHING SET UP
~ - --------- ------------------------------------- - - - - - - - - - - - - - - - -
· SCROLL UP
THIS ROUTINE SCROllS UP THE INFORMATION ON THE CRT
ENTRY
CH,CL = UPPER LEFT CORNER OF REGION TO SCROLL DH,Dl = LOWER RIGHT CORNER OF REGION TO SCROLL
BOTH OF THE ABOVE ARE IN CHARACTER POSITIONS
BH = FILL VALUE FOR BLANKED LINES
AL = · LINES TO SCROll (AL=O MEANS BLAt« THE ENTIRE
FIElD)
OS = D.l.TA SEGMENT
= ES REGEN SEGMENT
, EXIT
,--------N-O-T-H-IN--G-. -
THE SCREEN IS SCROLLED
-----------------------
---
-----------
---
--
-----
GRAPHICS_UP
PROC NEAR
HOY
Bl.AL
I SAVE LINE CDlIfT IN BL
I10V
AX.CX
; GET UPPER LEFT POSITION IHTO AX REG
J----- USE CHARACTER SUBROUTINE FOR POSITIONING
1----- ADDRESS RETURNED IS MULTIPLIED BY 2 FROM CORRECT VALUE
MOY
OI,AX
1----- DETERMINE SIZE OF WINDOW
I SAVE RESULT AS DESTINATION AODRESS
SUB
DX,CX
'00
OX,lOlH
SAL
OH,l
SAL
DH,l
1----- DETERMINE CRT HOOE
I ADJUST VALUES I MULTIPLY I ROWS BY 4 J SINCE 8 VERT DOTS/CHAR I AND EVEN/COD ROWS
CMP
JNC
J----- HEDIUH RES UP
I TEST FOR MEDII.I'I RES I FIt«UiOURCE
SAL
Dl,l
SAL
01.1
* J · COlltlNS 2, SINCE 2 BYTES/CHAR
I OFFSET *2 SINCE 2 BYTES/CHAR
J----- DETERHINE THE SOURCE ADDRESS IN THE BUFFER
R7:
PUSH ES
pop
OS
SUB
CH.CH
S'L
Bl,1
SAL
BL,l
JZ
RII
MOY
AL,Bl
I10Y
AH,80
IOJL
AH
I10Y
SI,OI
ADO
SI,AX
MOV
AH,nH
S,",
AH,BL
I FIND_SOURCE J GET SEGMENTS BOTH POINTING TO REGEN
; ZERO TO NIGH OF COUNT REG I MULTIPLY NUMBER OF LINES BY 4
I IF ZERO. THEN BLANK ENTIRE FIELD I GET NUMBER OF LINES IN AL I 80 BYTESIROW I DETERMINE OFFSET TO SOURCE I SET UP SOURCE ; ADD IN OFFSET TO IT I NVMEIER OF ROWS IN FIElD I DETERMINE NUMBER TO HOVE
1----- lOOP THROUGH, HOVING ONE ROW .l.T A TIME. BOTH EVEN AHa COD FIELDS
R8:
CALL R17
SUB
SI, ZOOOH-80
SUB
OI.2000H-80
I I10VE ONE ROW J HOVE TO NEXT ROW
5-90 System BIOS
LOC OBJ
F4D6 FEee F40a 7SFI
~
F40A F4DA 8AC7 F4DC F4ac £88800 F40F 81fF801F
F4E3 fEce
f4E5 75F5 F4E7 E9D8Ft F4EA F4EA 8ADE
F4EC EBEC
r""\
F~EE F4EE FD F4EF 8A.D8 F4Fl 8BC2
F4F3 E80F02 F4F6 8BF8
F4F8 2801 F4FA 81C20101 F4FE 00E6
F500 00E6
F502 803E490006 F507 7305
F509 DOE2
F50B o1E7 FSOD 47
~
F50E F50E 06 F50F IF F510 2AEO F512 81C7FOOO F516 DOn F518 00E3 FSIA 742E F5IC 8ACl F51E B450 F520 F6E4
LINE SOURCE
4416 4417 4416 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448
4~49
4450 4451 4452 4453 4454 4455
4~56
4457 4458 4459 4460 4461 4462 4463 it464 4465 4466 4467 4468 4469 4470 4471 4472: 4473
447~
4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492:
DEC
AH
JHZ o.
I t-ft..IMBER OF ROWS TO t10YE ; COHTItfJE TIll ALL MOVED
;----- FILL IN THE VACATED LINE(S)
R9:
J CLEAR_ENTRY
HDV
Al.,BH
I ATTRIBUTE TO FILL WIlli
RIO:
CALL 0'.
I CLEAR THAT ROW
SUB
OI.2000H-BO
I POINT TO NEXT LINE
DEC
BL
; NUMBER OF LINES TO FILL
JHZ
010
I CLEAR_lOOP
JHP
VIDEO_RETURN
; EVERYTHING DONE
FBI:
; BlAUKJIElD
HOV
BL.DH
O. JHP
,I SET BLANK COUNT TO EVERYTHING IN FIELD ; CLEAR THE FIELD
------ GRAPHICS_UP
ENOP
; ----------------------------
------------------._--
,I SCROll DOWN THIS ROUTINE SCROLLS Dos.ei THE INFORMATION ON THE CRT
I ENTRY
CH.eL ;: UPPER LEFT CORNER OF REGIOH TO SCROLL
DH ,OL = LOWER RIGHT CORNER OF REGION TO SCROll
BOTH OF THE ABOVE ARE IN CHARACTER POSITIONS
BH = FILL VALUE FOR BLANKED LINES
At = · LINES TO SCROLL (Al=O MEANS BLAHI< THE ENTIRE
fIELD I
OS = DATA SEGMENT
ES = REGEN SEGMENT
J EXIT
NOTHING. THE SCREEN IS SCROllED
;---------------------------------------------------------------
GRAPHICS.DOWN P.OC NEAR
STD
; SET DIRECTION
HOY
BL.AL
; SAVE LINE COUNT IN BL
HOV
AX.OX
I GET LOWER RIGHT POSITION INTO AX REG
1----- USE CHARACTER SUBROUTINE FOR POSITIONING
t----- ADDRESS RETURNED IS MULTIPLIED BY 2 FROM CORRECT VAlUE
CALL HOV
GRAPH.POSN DI,AX
I SAVE RESULT AS DESTINATION ADDRESS
J----- DETERMINE SIZE OF WINDOW
SUB
DX,cX
ADD
oX.IOIH
SAl
oH,1
SAL
DH'}
I ADJUST VALUES 1 I'tJLTIPLY · ROWS BY 4
, SINCE 8 VERT DOTs/cHAR , AND EVEN/OOo ROWS
J----- DETERMINE CRT MODE
CHP JHC
."CRT.HOOE .6
;----- HEDIUtt RES DOWN
I TEST FOR MEDIUM RES I FIND.SOURCE.DOWN
SAL
OLd
SAL
01,1
INC
01
,I · COLUMNS * 2, SINCE 2 SYTES/CHAR {OFFSET OK) I OFFSET *2 SINCE 2 BYTES/CHAR ; POINT TO LAST BYTE
1----- DETERMINE THE SOURCE ADDRESS IN THE BUFFER
RI:?::
PUSH POP SUB ADO SAL SAL JZ HOV I10V lOll
ES OS CH,CH 01,240
.,.BL,I
Blol
AL,Bl AH.80 AH
I FItm.SOURCE.DOWN ; BOTH SEGMENTS TO REGEN
I ZERO TO HIGH OF COUNT REG I POINT TO LAST ROW OF PIXELS ; I'tJLTlPLY HUI1BER OF LINES BY 4
i IF ZERO, Tl-tEN BLAHI< ENTIRE FIELD ; GET HUJ1BER OF LINES IN AL I 80 BYTES/ROW I DETERMINE OFFSET TO sotmCE
System BIOS 5-91
LOC OBJ
F522 86F7 F524 26FO F526 8AE6 F526 2AEl
F52A F5lA E82100 FSlO 81E£5020 F531 81£F5020 F535 FEet F537 75Fl
F539 F539 8AC7 F538 F538 £82900 F53£ 81EF5020 F542 FECS F544 75F5 F546 FC F547 E978FC
'54.
F54A SADE
F54c EBEB
F54E F54E eACA F550 56 F551 57 F552 F3 F553 A4 F554 SF F555 5E F556 81C60020 F55A 81C70020 F55E 56 F55F 57 F560 8ACA F562 F3 F563 A4 F564 SF F565 5E F566 C3
F567 F567 eACA F569 57 F56A F3 F56B ...... F56C SF F56D 81C70020 F571 57 F572 SACA F574 F3 F575 AA F576 SF F577 C3
LINE SOURCE
4493 4494 ..95 "96 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530
4531 4532 4533 4534 4535 4536 4537 4538
4539
'54'
4541 4542 4543 4544 4545 4546 4547 4548 4549
4550 4551 4552 4553 .554
4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565
HOY
SI.DI
SUB
SI.AX
HOY
AH.DH
sue
AH,Bl
I SET UP SOURCE I SUBTRACT THE OfFSET I NI.JI1BER OF ROWS IN FIELD I DETERMINE HUMBER TO HOVE
1----- lOOP THROUGH. HOVING ONE RON AT A TIHE, BDTH EYEN AND 000 FIELDS
R13:
CAll Sl8 Sl8 OEC JHZ
.,7 5I.2000H+80 Dr.2000H+80 'H R"
1----- FILL IN THE VACATED LINE(S)
I ROW_LOOP_DOWN I tIOVE ONE ROW I HOVE TO NEXT ROW
; NUHBER OF ROWS TO HOYE I CONTINUE TILL ALL HOVED
R14:
.,.
ItOV
HIS:
Al,8H
CALL
sue
DJ .ZOOOH+80
.15 DEC
8L
JHZ
tLO
JHP
VIDEO_RETURN
R16:
HOY
BL,DH
JHP GRAPHICS_DOWN
Rl' ENDP
; CLEAR_ENTRY_D~ I ATTRIBUTE TO FIll WITH 1 CLEAR_LOOP_DOWN I CLEAR A ROW I POINT TO NEXT LINE I NUttBER OF LINES TO FILL I CLEAR_LOOP_DOWN ; RESET THE DIRECTION FLAG ; EVERYTHING DONE 1 BLANK_FIELD_DOWN ; SET BLANK COUNT TO I EVERYTHING IN FIELD I CLEAR THE FIELD
1----- ROUTINE TO MOYE ONE ROW OF INFORtlATION
R17
PRce NEAR
ItOV
CL,DL
PUSH '1 PUSH 01
REP
HOVS8
I fU1BER OF BYTES IN THE ROW
1 SAVE POINTERS 1 HOVE THE EVEN FIELD
POP pop
ADD ADD PUSH PUSH ItOV .EP
01 Sl SI,ZOOOH DI,200DH $1 01 CL,DL HOYSB
1 POINT TO THE 000 FIELD
I SAVE THE POINTERS 1 COlNT BACK I HOVE THE 000 FIELD
POP
01
POP
Sl
RET
R17
ENOP
.,.1----- CLEAR A SINGLE ROW PRce NEAR
ItOV
CL,DL
PUSH 01
.EP
STOSB
I POINTERS SACK 1 RETURN TO CALLER
I NUteER OF BYTES IN FIELD I SAVE POINTER I STORE THE NEW VALUE
POP .00 PUSH HOY REP
01 DI,ZOOOH 01 CL,DL STOSB
; POINTER BACK I POINT TO ODD FIELD
1 FILL THE ODD FILELD
.,. POP
01
RET
I RElURN TO CALLER
; -------E--ND-P----- ----- ------ ------ ------------- -- -- -------- --- ---
; GRAPHICS WRITE
THIS ROUTINE WRITES THE ASCII CHARACTER TO THE
CURRENT POSITION ON THE 5CREEH.
ENTRY
AL :;" CHARACTER TO WRITE
° BL :;" COLOR ATTRIBUTE TO BE USED FOR FOREGROUND COLOR IF BIT 7 IS SET. THE CHAR IS XOR' INTO THE REGEN
5-92 System BIOS
LOC OBJ
F578 F578 8400 F57A 50
F578 E86401 F57E 8BF8
~
F580 58 FSSI 3C80 F583 7306
FS85 BE6EFA F588 DE F589 EBOF
F58S F58B 2C80 F58D IE F58E 2BF6 F59D 8EDE
FS92 C536 7COO F596 8CDA
F598 IF F599 52
,...-...,
'59A F59A DIED F59C OleO F59E OlEO FSAO 03FO FSA2 803E490006 F5A7 1F F5A8 722C
FSAA
F5A.A 57 F5AB 56 F5AC 8604
LINE SOURCE
4566 4567 4568 4569 4570 4571 4572 4573 1t574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 45M 4590 4591 4592 r.S91 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 46'7 46'8 4609 4610 4611 4612 46" 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4615 4636 4637 4638 4639 4640 4641 4642
BUFFER (Q IS USED FOR THE BACKGROlN.1 COUlR I
ex = NUMBER OF CHARS TO WRITE = OS DATA SEGHENT ES = REGEN SEGMENT
I EXIT NOTHING IS RETURNED
I ~ GRAPHICS READ
THIS ROUTINE READS THE ASCII CHARACTER AT THE CURRENT CURSOR POSITION ON THE SCREEN BY HATCHING THE DOTS ON
THE SCREEN TO THE CHARACTER GENERATOR CODE POINTS
I ENTRY
I I EXIT
NONE lOIS ASSUMED AS THE BACKGROUND COLOR
AL = CHARACTER READ AT THAT POSITION (0 RETURNED IF
HONE FOUND)
I FOR BOTH ROUTINES. THE IMAGES USED TO FORM CHARS ARE
I CONTAINED IN ROH FOR THE 1ST 128 CHARS. TO ACCESS CHARS
IN THE SECOND HALF, THE USER MUST INITIALIZE THE YECTOR AT
INTERRUPT lFH (lOCATION 0007CH) TO POINT TO THE USER
I SUPPLIED TABLE OF GRAPHIC IMAGES (axe BOXES).
;I --F--A-IL-U-R-E--T-O--D-O---SO---W-I-L-L--C-AU--SE---IN---S-TR-A-N-G--E--R-E-S-U-L-T-S---------------
ASSUHE CS:CODE ,DS:DATot.,ES:DATA
GRAPHICS.WRITE I'OOC NEAR
HOV
AH,O
I ZERO TO HIGH OF COOE POINT
PUSH AX
, SAVE CODE POINT VALUE
J ---- DETER"INE POSITION IN REGEN BUFFER TO PUT CODE POINTS
CALL HOV
52. aI,AX
I FIND LOCATION IN REGEN BUFFER ; REGEN POINTER IN 01
1----- oETER"INE REGIOH TO GET CODE POINTS FRO"
pop
AX
CHP
AL,SOH
JA'
51
j RECOVER CODE POINT I IS IT IN SECOND HALF J YES
J----- IMAGE IS IN FIRST HALF, CONTAINED IN Rot1
HOV PUSH JHP
5I,DFA6EH CS SHORT 52
J CRT_CHAR_GEN (OFFSET OF IttAGES) I SAVE SEGHENT ON STACK I DETERMINE_HODE
1----- IH.i.GE IS IN SECOND HAlF J IN USER RAM
.... Sl: Al,aOH
PUSH OS
SUB
51,51
HOV
DS,SI
ASSUHE DS:ABSO
LOS
SI,EXT_PTR
HOV
OX,DS
ASSltIE DS:DATA
POP
OS
PUSH OX
I EXTEND.CHAR 1 ZERO ORIGIN FOR SECOND HALF i SAVE DATA POINTER
i ESTABLISH VECTOR ADDRESSING
I GET THE OFFSET OF THE TABLE 1 GET THE SEGMENT OF THE TABLE
I RECOVER DATA SEGMENT I SAVE TABLE SEGI1ENT ON STACK
1----- DETERI1IHE GRAPHICS ttOOE IN OPERATION
52:
SAL
AX.l
SAL
AX,I
SAL
AX"
ADD
SI,AX
otP
CRT.HOOf ,6
POP
DS
JC
57
J DETERMINE.HOOE 1 HUlTIPtY CODE POINT I VALUE BY 8
1 SI HAS OFFSET OF DESIRED CODES
i RECOVER TABLE POINTER SEGMENT ; TEST FOR MEDIUtI RESOLUTION HOOE
; ---- HIGH RESOLUTION ttDDE
S3:
PUSH
Dl
PUSH I10V
51 DH.4
I HIGH.CHAR I SAVE REGEN POINTER I SAVE CODE POINTER i tM1BER OF TIMES THROUGH lOOP
System BIOS 5-93
LOC OBJ
F5AE F5AE At FSAF F6C380 F582 7516 F584 AA F585 AC F586 F586 26888SFFlF F5BB 83C74F FSBE FEtE F5CO 75ft FSCZ Sf F5C3 SF F5C4 47 F5C5 E2E3 F5C7 E9FBFB FSCA F5CA 261205 FSCD AA FSCE At FSCF 263285FF 1F F504 fBED
F506 F506 8.6003 F508 DIE7 FSDA. f80100 FSOD FSDD 57 FSDE 56 FSDF 8604 F5£1 F5El AC FSE2 E8DEOO F5£5 23C3
FSE7 F6C280 FSEA 7407 FSEC 2:632:25 FSEf 26324501 FSF3 F5F3 26882:5 F5F6 26884501 FSFA At FSF8 £8C500 FSFE 23C3 F600 F6C280 F60l 740A F60S 2632.6.5002:0 F60.6o 2632850120 F60F F60F 2688.6.50020 F614 268885012:0 F619 83C750 F6lC FEtE F61E 75tl F620 5f F621 SF F622 47 F623 47 F624 £287 F626 E99CFB
F629 F629 E80600 F62e 88FO F62E 63Ee08
F631 8BEt
LINE SOURCE
464] 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4656 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4660 4681 4682 4683 4.84 4.85 4.86 4687 4688 4689 4690 4691 4692 4693 4.94 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719
54: lOOSB
TEST
Bl.80H
JNZ
56
ST058
LDOse
S5:
MOY
ES: IDl+2000H-l J··U
ADD
01.79
DEC
DH
JHZ
5.
POP
51
POP
01
lHe
01
lOOP
53
JHP
VIDEO_RETURN
56:
XOR
Al.ES:[DII
STOSB
lOOSB
XOR
Al,ES:(DI+2DODH-l1
JMP
55
J----- MEDIUM RESOLUTION WRITE
57:
tfOV
OL.8L
..'
SAL CAll
DI,! 519
PUSH 01
PUSH
SI
MOV
59:
lODSB
CAll
521
AND
AX,BX
510:
TEST JZ XOR XOR
DL,80H 510 AH,ES:[DI] Al,ES:(DI+l1
HOY HOV LOOse CAll AtI) TEST JZ XOR
ES: [DII,AH ES: [01+1 ],Al
S2. AX.BX Dl,80H 511 AH,ES:[DI+2000H I
XDR S11:
MOY
HOV AOO
AL,ES:[OI+2:00IHI
ES: (OI+2000H I.AH ES:[OI+ZOOOH+ll.AL 01.80
DEC
OH
JNZ
59
POP
SI
POP
Ot
INC
01
INC LOOP JMP GRAPHICS_WRITE
01 58
ENDP
;----------------------- ; GRAPHICS READ
J-----------------------
GRAPHICS_READ MOC
NEAR
CAll 52:6
MOV
SI.AX
SUB
SP.8
MOV
BP,SP
;----- DETERHINE GRAPHICS HODES
I GET BYTE FROH CODE POINTS I SHOULD WE USE THE FUNCTION ; TO PUT CHAR IN I STORE IN REGEN BUFFER
; STORE IN SECOND HALF I HOVE TO NEXT ROW IN REGEN J DONE WITH lOOP
I RECOVER REGEN POINTER I POINT TO NEXT CHAR POSITION J ttORE CHARS TO WRITE
I EXCLUSIVE OR WITH CURRENT J STORE THE CODE POINT ; AGAIN FOR ODD FIELD
J BACK TO HAINSTREAM
I SAVE HIGH COLOR BIT I OFFSET*2 SINCE 2 8YTE5/CHAR ; EXPAND BL TO FULL WORD OF COLOR J HED.CHAR ; SAVE REGEN POINTER I SAVE THE CODE POINTER ; NUMBER OF lOOPS
J GET CDOE POINT I DOUBLE UP ALL THE BITS J CONVERT THEM TO FOREGROlH) I COLOR ( 0 BACK ) I IS THIS XOR FUNCTION ; NO, STORE IT IN AS IT IS ; DO FUNCTION WITH HAU J AN) WITH OTHER HALF
J STORE FIRST BYTE J STORE SECOND BYTE J GET CDOE POINT
J CONVERT TO COLOR J AGAIN. IS THIS XOR FUNCTION ; NO. JUST STORE THE VALUES ; FUNCTION WITH FIRST HALF ; AND WITH SECotI) HALF
I STORE IN SECOND PORTION OF BUFFER ; POINT TO NEXT LOCATION
J KEEP GOING I RECOVER CODE POHTER ; RECOVER REGEN POINTER I POINT TO NEXT CHAR POSITION
; HORE TO WRITE
J CONVERTED TO OFFSET IN REGEN ; SAVE IN SI ; ALLOCATE SPACE TO SAVE THE I READ CODE POINT ; POINTER TO SAVE AREA
5-94 System BIOS
LOC OBJ
F633 803£490006 F638 06 F639 IF Ft.3,A 721A
F63C 8604 F63£ F631: 8A04 F640 884600 F643 45 F644 8A840020 F648 884600 F648 45 F64C 83C650 F64F FEtE F651 75EB F653 E81790
F656 F656 DIE6 F658 8604 F65A F65" £88500
F650 81C60020 F661 £88100 F664 SIEEBOlF F668 FEtE F66,\ 75EE
F66C F66t BF6EFA90 F670 DE F671 07 F672: 83ED08
F675 8BFS F677 FC F678 BODO F67. f67A 16 F678 IF F67C BA8000 F67F F67F 56 F680 57 F681 890800 F6M F3 F685 A6 F686 SF F687 5£ F688 741£ F68. FEeD FMC 8]C708 FbBF 4A F690 75ED
F692 leGO F694 7412 F696 2BCO F698 8E08
F69A C43E7COO F69E aceD F6"0 OBC7 F6A2 7404 F6"4 Boeo
LINE SOURCE
4720 4721 4722 4723 472:4 4125 4726 47Z7 4728 4729 4730 4731 4732 4733
4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4144 4745 4746 4747 4748 4749 4750 4751 4752: 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772: 4773 4774 4715
4776 4771 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795
CHP PUSH pop JC
CRT_I1ODE.6 ES OS 513
i-·--- HIGH RESOLUTION READ
; POINT TO REGEN SEGHENT ; HED 11..11 RESOLUTION
1----- GET VALUES FROM REGEN BUFFER AtIJ CONVERT TO CODE POINT
I10V 512:
I10V I10V INC
I10V MOV INC ADD DEt JNl
"'P
DH,4
.\L,ISI) IBPJ.Al BP Al, (S1+2000H I IBP],Al BP 51,80 DH 512 515
1----- "EDlllt RESOLUTION READ
J tl.leER OF P...SSES
J 6ET FIRST BYTE · S"'VE IN STORAGE AREA I NEXT LOC"'TION I GET LOWER REGION BYTE I ADJUST AND STORE
J POINTER INTO REGEN J LOOP CONTROL J DO IT SOME HeRE I &0 "ATCH THE SAVED COOE POINTS
513: S14:
SAL MOV
CALL
ADD CALL SUB DEC JHZ
SI.l DH.4
52:3
51. 2000H 523 SI,2000H-80 DH S14
I OFFSET*2 SINCE 2: BYTES/CH...R I NUHBER OF P"'SSES
I GET PAIR BYTES FROf1 REGEN I INTO SINGLE S"'VE J GO TO LOWER REGION I 6ET THIS PAIR INTO SAVE I ADJUST POINTER BACK INTO UPPER
i KEEP GOING UNTIL AlL 8 DONE
J----- S...VE "'RE... H...S CH...R"'CTER IN IT. I1A.TCH IT
515:
516: 517:
HOV PUSH POP SlIS
I10V
tLD
I1DV
PUSH POP HOV
PUSH PUSH MO'V REPE
DI.OfFSET CRT_CHAR_GEN CS ES BP,8
SI,BP
"'L.O
I FIND_CHAR J ESTABLISH ...DDRESSING
I COOE POINTS IN CS J ",DJUST POINTER TO BEGI...ING I OF SAVE AREA
I ENSURE DIRECTION I CURRENT COOE POINT BEING I1A.TCHED
SS OS OX.U8
f ESTABLISH ADDRESSING TO STACK I FDR THE STRING COMPARE I tu1BER TO TEST AGAINST
SI 01 eX,8 CMPSS
I SAVE SAVE AREA POINTER ; SAVE CODE POINTER i NJt18ER OF BYTES TO MATCH I COHPARE THE 8 BYTES
pop or
pop
5r
Jl
518
INC AL
ADD
01,8
O,C
DX
JNZ
517
I RECOVER THE POINTERS
I I f ZERO FLAG SET. THEN MATCH OCClllRED I NO "ATtH, HOVE ON TO NEXT I NEXT CODE POINT 1 LOOP CONTROL ; DO ALL OF THEM
1----- CHAR NOT MATCHED. HIGHT BE It-! USER SUPPLIED SECOND HAlF
tMP
JE
5'"'
I10V A$SUI1E LES MOV OR JZ HOV
"'L.O 51. AX ....X DS.AX DS:ABSO 01 ,EXT_PTA AX.ES AX.DI 51. AL.U8
I AL <> 0 IF ONLY 1ST HAlF ~ED
= I IF 0, THE'" "'ll H...S BEEt-! SCAtifED
; ESTABLISH ADDRESSING TO 'VECTOR
I GET POINTER i SEE IF THE POINTER REALLY EXISTS I IF ALL O. THEN DOESN'T EXIST I NO SENSE LOOKING I ORIGIN FOR SECOND HALF
System BIOS 5-95
LOC OBJ
F6A6 EB02
F6A8 F6A8 83C408 F6AB E917F8
F6AE F6AE BOnDl Hel 8AC3 f6B3 51 F684 890]00 F6B7 F6B7 ODED F689 ODED F6BS OA08 FoBD E2F8 F6BF SAFB F6CI 59 F6C2 C3
F6C3 F6C3 52 F6C4 51 F6es 53 F6C6 2B02 F6e8 890100
Foee
F6e8 S808 FocD 2309 f6CF OBD3 F601 OlEO F603 OlEl F6DS 8808 F607 2309 fbD9 OB03 F6DB DIEI
F60D 73Et F6DF 8BC2 F6El 58 F6E2 59 F6E3 5A F6E4 C3
LINE SOURCE
4796 4797 4798 4799 4800 4801 4802 4803 4604
4605 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 482:0 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858
4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872
JMP
516
ASStn1E DS:CATA
I 60 BACK AND TRY FOR IT
.---.... CHARACTER IS FOLItI) ( Al=:O IF NOT fOUND )
518: ADD
sp,a
; READJUST ruE STACK. THROW AWAY SAVE
J"P GRAPHICS.READ
VIDEO_RETIJRN ENDP
; ALL DONE
; ---- --------..----------------------------- ----------- ; EXPAND_MED_COLOR
THIS ROUTINE EXPANDS THE lOW 2: BITS IN BL TO
FILL THE ENTIRE BX REGISTER
ENTRY
BL = COLOR TO BE USED I lOW 2 BITS )
; EXIT
BX :: COLOR TO BE USED ( 8 REPLICATIONS OF THE
2 COLOR BITS I
1-----------------------------------------------------.-
519
PROC NEAR
AND
BL,3
, ISOLATE THE COLOR BITS
MOV PUSH
AL,BL
ex
; COPY TO AL , SAVE REGISTER
MOV S20:
CX,3
I t-M1BER OF UHES TO 00 TIUS
SAL
AL,I
SAL
AL,I
, LEFT SHIFT BY 2:
OR LOOP MOV POP
BL,AL 520 BH.Bl
ex
; ANOTHER COLOR VERSION INTO BL
,I FILL AlL OF el FILL UPPER PORTION j REGISTER BACK
RET
; ALL DONE
519
ENDP
1------------------------- --------------------- --------
; EXPAND.BYTE
THIS ROUTINE TAKES THE BYTE IN Al AND DOUBLES ALL OF THE BITS. TURNING THE 8 eITS INTO
16 eITs. THE RESULT IS LEFT IN AX
; --------------- - ---------------------- - --------------
521
PRoe
NEAR
PUSH ox
I SAVE REGISTERS
PUSH ex
522:
PUSH SUB MOV
MeV ANO OR SML SHL MOV ANO 00 SHL
JHe
MOV
BX DX,OX CX,I
BX,AX eX,ex DX,BX AX'} eX , l BX,AX ax.ex DX.BX ex.1
522 AX,OX
I RESULT REGISTER I MASK REGISTER
I BASE INTO TEMP ; USE MASK TO E~ACT A BIT
PUT INTO RESULT REGISTER
SHIFT BASE AND MASK BY 1 I BASE TO TEMP I EXTRACT THE SAME BIT ; PUT INTO RESULT I SHIFT ONLY HASK. NOW, I HOVING TO NEXT BASE I USE MASK BIT COMING OUT TO TERMINATE ; RESULT TO PARM REGISTER
POP
BX
POP
ex
POP
ox
RET
; RECOVER REGISTERS I ALL DONE
521
ENDP
; ------------- -------------------- -------------------- ; HED_READ_BYTE
THIS RQUTINE WIll TAKE 2: BYTES FROH THE REGEN
8UFFER I COMPARE AGAINST THE CURRENT FOREGROUtl) COLOR, AND PLACE THE CORRESPONDING ON/OFF eIT PATTERN INTO THE CURRENT POSITION IN THE SAVE
AREA
; ENTRY SI.OS :: POINTER TO REGEN AREA OF INTEREST
BX = EXPANDED FOREGROUHO COLOR 8P = POINTER TO SAVE AREA
I EXIT
BP IS INCREMENT AFTER SAVE
; -------- --------- --------- ------------- ------------
5-96 System BIOS
~
LOC OBJ
F6E5 F6ES 8A24 F6E7 8A4401 F6EA 8900CO F6EO 8200 F6EF F6EF 85Cl F6Fl Fa F6F2 7401 F6F4 F9 F6FS 0002 F6F7 01E9 F6F9 01 E9 F6FB 73F2 F6FD 885600 F70D 45 f701 C3
~
f702 f702 1.15000 nos nos 53 n06 8B08 n08 8AC4 F70A F6264AOO nOE OlEO nlO OlEO F712 2AFf n14 03C3 f716 58 F717 C3
,,-......,
nl8 f718 50 F719 50 nlA B403 F7IC 8A3E6200
f720 COlO f722 58
LINE SOURCE
4873 4874 4875 4876 4877 4878 4879 488' 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 48.. 4895 4 8. . 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 492l 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 494S 4946 4947 4 . .8 4949
523 524: 525:
523
PROC HOV HOV HOV HOV
TEST eLe JZ STe ReL SHR SHR JNC HOV INC RET ENDP
NEAR AH,[SIJ AL'(sI+ll eX,DCDODH CL,D
Ax.ex
525
Cl.l
ex.!
CXol 524 [BP),Dl BP
I GET FIRST BYTE ; GET SECOND BYTE I 2 BIT MASK TO TEST THE ENTRIES · RESULT REGISTER
I IS THIS SECTION BACKGROUND? I CLEAR CARRY IN HOPES THAT IT IS ; IF ZERO, IT IS BACKGROUND I WASH' T. SO SET CARRY ; HOVE THAT BIT ItITO THE RESULT
; HOVE THE MASK TO THE RIGHT BY 2 BITS ; 00 IT AGAIN IF MASK DIDN'T FAll OUT I STORE RESULT IN SAVE AFilEA I ADJUST POINTER I ALL DONE
I --------------------------------- ------------ , V4_POSITIOH
THIS ROUTIHE TAKES THE CURSOR POSITION CONTAINED IN THE MEMORY LOCATION, AND
COI'NERTS IT nno AN OF FSET nno THE
REGEN BUFFER, ASSUMING ONE BnE/cHAR. FOR MEOIUH RESOLUTION GRAPHICS,
THE NUMBER MUST BE OOUBLED. ENTRY
I I EXIT
NO REGISTERS, MEMORY LOCATION CURSOR_POSH IS USED
AX CONTAIHS OFFSET INTO REGEN BUFFER
;-----------------------------------------------
52.
PROC NEAR
HOV
AX,CURSOR.POSH
; GET CURRENT CURSOR
GRAPH.POSH
LABEL NEAR
PUSH BX
I SAVE REGISTER
HeV
BX,AX
I SAVE A COPY OF CURRENT CURSOR
HOV
AL,AH
; GET ROWS TO AL
MUL
BHE PTR CRT.COLS
SHL
AX,!
I HULTIPL'1 BY BHES/COLUMN
* I HULTIPL'1 4 SINCE 4 ROWS/8'1TE
SHL
AX,!
SUB
BH,BH
I ISOLATE COLUMN VALUE
ADD
AX,BX
I DETERMINE OFFSET
POP
BX
I RECOVER POUrTER
RET
; ALL DONE
5,-2-. ----
ENDP
---------
-
-
---
-----
------
------------
--------------
----
--
-----
J WRITE.TTY
THIS INTERfACE PROVIDES A TELETYPE LIKE INTERfACE TO THE VIDEO
CARD. THE INPUT CHARACTER IS WRITTEN TO THE CURRENT CURSOR
POSITION, AND THE CURSOR IS MOVED TO THE NEXT POSITION. IF THE
CURSOR LEAVES THE LAST COLIJI'fl OF THE fIELD, THE COLlI"N IS SET TO ZERO, ANO THE ROW VALUE IS INCREMENTED. I f THE ROW VALUE LEAVES THE FIELD, THE CURSOR IS PLACED ON THE LAST ROW, FIRST
COLUMN, ANO THE ENTIRE SCREEN IS SCROLLED UP ONE l.INE. WHEN THE SCREEN IS SCROLLED UP, THE ATTRIBUTE FOR FILLING THE NEWLY BLANKED LINE IS READ fROM THE CURSOR POSITION ON THE PREVIOUS LINE BEfORE THE SCROLL. IN CHARACTER MODE. IN GRAPHICS to)E.
THE 0 COLOR IS USED.
; ENTRY
(AM) = CURRENT CRT MODE (AU = CHARACTER TO BE WRITTEN
NOTE THAT BACK SPACE, CAR RET. BELL ANO LINE fEED ARE HANDLED
AS COHHANDS RATHER THAN AS DISPLAYABLE GRAPHICS
(BU = FOREGROUND COLOR fOR CHAR WRITE IF CURRENTLY IN A
GRAPHICS HODE ; EXIT
ALL REGISTERS SAVED
1-----------------------------------------------------------------------
ASSUME CS:COOE ,OS:OATA
WRITE.TTY
PROC
NEAR
PUSH
AX
; SAVE REGISTERS
P\JSH
AX
, SAVE CHAR TO ~ITE
HOV
AH,3
HOV
BH ,ACTIVE.PAGE
i GET THE CURRENT ACTIVE PAGE
INT
10H
POP
AX
, READ THE CURRENT CURSOR POSITION , RECOVER CHAR .
System BIOS 5-97
LOC OBJ
F723 3e08 F725 7452 F727 3eOD F729 7457 Fna 3CU. F72D 7457 F72F JeD? F731 745.1.
F733 840... F735 890100 F738 COlO
F73A FEtl F73C lA164AOO F740 7533 F742 B200 F744 BOFEla F747 752A
F749 F749 8402 F74B COlO
F740 A04900 F750 3C04 F752 7206 F754 3C07 F756 B700 F758 7506 F7SA F75A M08 F75C COlO F75E SAFC F760 F760 B80106 F763 2BC9 F765 B618 F767 8AI64AOO F76B FECA F760 F76D COlO F76F F76F 58 F770 E952FA F773 F773 FEC6 F775 F775 B402 F777 EBF4
F779 F779 80FAOO F77C 74F7 F77E FEeA F7.50 EBF3
F782 F782 B200 F784 EBEF
LINE SOURCE
4950 4951 4952 4953 4954 4955 4956 4957 49$8 4959
'''0
.......''''
,4962
....· ..5
4967 4966 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983
....4.84
49.55
'987
"88
4989 4990 4991
....4992
4993
4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026
1----- DX NOW HAS THE ClII!RENT CURSOR POSITION
CHP JE eHP JE eMP JE eHP JE
AL.S U8 Al.ODH
U' AL.OAH UIO Al,07H UII
J----- WRITE THE CHAR TO THE SCREEN
J IS IT A BACKSPACE J BACK_SPACE ~ IS IT CARRIAGE RE1l.RN ~ CAR_RET ~ IS IT A LINE FEED ~ lINEJEED J IS IT A BELL ~ BELL
ItOV
AH,IO
ItOV
tX,l
INT
10H
I WRITE CHAR ONLY , OHl'1 ONE CHAR I WRITE THE CHAR
1----- POSITION THE CURSOR FOR NEXT CHAR
INC
OL
CMP
OltBYTE PTR CRT_COlS
I TEST FOR COLlkI-I OVERFLOW
JNZ
U7
HOV
DL,O
J SET_CURSOR I COLlA1H FOR CURSOR
CMP
DH,24
JHZ
U6
J SET_CURSOR_INt
1----- SCROLL REQUIRED
Ul:
MOV
AH,2
INT
10H
I SET THE CURSOR
1·---- DETER"INE VAWE TO FILL WITH DURING SCROLL
ItOV
AL,CRT_tqE
I GET TtlE CURRENT HODE
CHP
AL,4
JC
U2
I REAO-CURSOR
CMP
AL,7
HOV
BH,O
JHE
U,
I FILL WITH BACKGIWUHD I SCROLL-UP
U2:
I REAO-CURSOR
ItOV
AH,e
INT
10H
I READ CHAR/ATTR AT elllRENT C~SOR
HOY
BH,AH
I STORE IN BH
U3;
; SCROLL-UP
ItOV
AX.60lH
I SCROLL ONE LINE
SUB
cX,ex
; UPPER LEFT CORNER
ItOV
OH,24
LOWER RIGHT ROW
ItOV
CL.BnE PTR CRT_COLS
; LOWER RIGHT COL~
DEC
OL
""
INT
10H
I VIDEO-CALL-RETURN I SCROLL UP THE SCREEN
US:
pop
AX
; TTY-RETURN I RESTORE THE CHARACTER
JHP
VIDEO_RETURN
I RETURN TO CALLER
U6'
INC
OH
I SET-CURSOR-IHC I NEXT ROW
U7:
; SET-CURSOR
HOV
AH,2
JMP
U4
I ESTABLISH THE NEW CURSOR
;----- BACK SPACE FOUND
U8:
CMP
DL.O
JE
U7
DEC
OL
JHP
U7
I ALREADY AT END Of LINE I SET_CURSOR I NO -- JUST HOVE IT BACK I SET_CURSOR
1----- CARRIAGE RETURN FOUND
U9:
HOY JMP
OL.O U7
I HOVE TO FIRST COLl..l'f.l
; SET_CURSOR'
5-98 System BIOS
laC OBJ
~
F786 F786 80FEl8 F789 75E8 H8B Eeee
F7eD F7eD B302 F78F E871EE F792 fBDB
~
F794 F794 03 F795 03 F796 05 F797 05 F798 03 F799 03 F79A 03 F79B 04 F79C
F79C 8400 F79E 8B166300 F7A2 83C206 F7A5 Et F7A6 A804 F7A8 757E
F7AA A802 F7At 7503 F7AE E96100
F7ll1 F7BI BitlO
r""\
F783 88166300 F787 8AC4 F7B9 EE F7BA 42 F7BB EC F7BC 8AE8 F7BE 4A F7BF FEC4 nCI 6AC4 F7C3 EE F7C4 42 F7C5 EC F7C6 8AE5
LINE SOURCE
5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055
5056 5057
soss
5059
J ··· _ LINE FEED FOUND
UIO: eMP JHE JMP
DH.24 U6 Ul
I BOTTDH OF SCREEN I YES, SCROLL THE SCREEN ; NO. JUST SET THE CURSOR
J ---- BELL FoutI)
Ull:
NOV CAll JMP
BL,2 BEEP US
J SET UP COUNT FOR BEEP ; Soutl) THE POD BELL ; TTY_RETURN
WJHTE_TTY
ENDP
;---------------------------------------------------------------
LIGHT PEN
THIS ROUTINE TESTS THE LIGHT PEN SWITCH AND THE LIGHT
PEN TRIGGER. IF BOTH ARE SET, THE LOCATION OF THE lIGHT :
PHI IS DETEIlMINED. OTHERWISE. A RETURN WITH NO
IHFDRHATION IS MADE.
; ON EXIT
{AH I = 0 IF NO LIGHT PEN INFORMATION IS AVAILABLE
BX,CX,DX ARE DESTROYED
{AH I = 1 IF LIGHT PEN IS AVAILABLE
(CH,DLl ::: ROW,COLUHH OF CURRENT LIGHT PEN
POSITION
(CH) ::: RASTER POSITION
(BX) ::: BEST GUESS AT PIXEL HORIZONTAL POSITION :
1-------------------------------- - - - --------------------- ----
ASSUtlE CS: CODE ,CS:DATA
;----- SUBTRACT_TABLE
VI
LABEl BYTE
DB
3,3,5.5.3.3.3.4 ·
5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5076 5079 5060 5061 5062 5063 5064 5065 5080 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096
READ_LPEN
PROC
NEAR
;----- WAIT FOR LIGHT PEN TO BE DEPRESSEO
"M"O"V
ADD IH TEST JHZ
AH,O OX, ADDR_ 6845 OX,6 AL,OX AL,4 V.
I SET NO LIGHT PEN RETUlN CODE ; GET BASE ADDRESS OF 6845 ; POINT TO STATUS REGISTER I GET STATUS REGISTER ; TEST LIGHT PEN SWITCH I NOT SET, RETURN
1----- NOW TEST F~ LIGHT PEN TRIGGER
TEST JHZ JMP
AL,2 V7A V7
I TEST LIGHT PEN TRIGGER ; RETURN WITHOUT RESETTING TRIGGER
1----- TRIGGER HAS BEEN SET. READ THE VALUE IN
V7A: NOV
AH,16
; LIl~T PEN REGISTERS ON 6645
;----- INPUT REGS POINTED TO BY Alt. AND CONVERT TO ROW COLUHN IN ox
MOV
OX, ADOR_684S
MOV
AL.AH
OUT
OX,AL
IHC
ox
IH
AL.DX
MOV
CH.AL
DEC Ox
IHe
AH
MOV
AL,AH
OUT
DX,AL
INC
OX
IH
AL,DX
MOV
AH,CH
; ADDRESS REGISTER FOR 6845 ; REGISTER TO READ J SET IT UP J DATA REGISTER i GET THE VALUE ; SAVE IN CX j ADDRESS REGISTER
I SECOND DATA REGISTER
1 POINT TO DATA REGISTER I GET SECOND DATA VALUE I AX HAS INPUT YALUE
System BIOS 5-99
LOC OBJ
F7C8 8"IE4900 F7ee 2AFF F7eE 2E8A9F94F7 F7D3 2BC3 F7DS eBIE4EDO F7D9 DIES F7DB 28C3 F7DC 7902 F70F ZBCO
F7El
F7E! 810]
F7E3 803E490004 F7E8 722A F7EA 603E490007 F7EF 7423
F7Fl 8228 F7F3 F6F2
F7F5 8AE8 F7F7 02EO F7F9 BADt F7F8 tAFF F7FO 803E490006 F802 7504 F804 B104 F806 DOE4 F808 F808 03E3
F80A 8AD4 Feoe 8AFO FeDE DOEE F810 DOEE F812 EB12
F814 F814 F6364AOO F818 8AFO F8U 8A04 Felt 02EO FalE 8AE8 F820 SADe F822 32FF F824 03E3 F826 F826 8401 F828 F&28 52 F829 88166300 f820 8let07 F830 EE F831 5A F832 F832 SF F833 SE F834 IF F835 IF F836 IF
F837 IF F838 07
LINE SOURCE
5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 SllS 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 512:7 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 51,.6 5147 5148 5149 5150 5151 5152 5153 515" 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173
1----- AX HAS THE VALUE READ IN FROM THE 6845
I10V
Bl,eRT_HODE
SUB BH,BH
""V
BL,CS:v1l8X)
SUB
AX.ex
MOV
ex ,CRT_START
SHR
eX.I
SUB
AX,ex
JHS V.
SUB
AX ,AX
1 tIODE VALUE TO ax I DETERHINE AMOUNT TO SOOTh'ACT 1 TAKE IT AWAY
I IF POSITIVE. DETERMINE HODE I <0 PLAYS AS 0
1----- DETERMINE MODE OF OPERATION
'12:
MOV
CMP
CRT_MDDE.4
JB
V4
CKP
CRT_MOOE,7
JE
V4
1----- GRAPHICS MODE
1 DETERMINE_MODE I SET *8 SHIFT COUNT ; DETERMINE IF GRAPHICS OR ALPHA j ALPHA_PEN
MOV
Dl,40
DIV
DL
1----- DETERMINE GRAPHIC ROW POSITION
; DIVISOR FOR GRAPHICS I DETERMINE ROWI AU AND COllftll AH) I Al RANGE 0-99, AH RANGE 0-39
I10V
CH.Al
ADD
CH,CH
MOV
BL.AH
SUB
BH.BH
CMP
CRT_HOOE ,6
JHE
V3
""V Cl.4
SAL
AH.l
'13:
SHL
BX.Cl
1----- DETERMINE ALPHA CHAR POSITION
I SAVE ROW VAWE IN CH I tl2 FOR EVEN/ODD FIELD I COLUI1N VALUE TO BX ; MULTIPLY' BY' 8 FOR MEDIUM RES I DETERMINE MEDIUH OR HIGH RES I HOT_HIGH_RES I SHIFT VALUE FOR HIGH RES I COLUtIN VALUE TIMES 2 FOR HIGH RES ; NOT_HIGH_RES 1 MULTIPLY' *16 FOR HIGH RES
MOV
Dl,AH
MOV
CH,Al
""RR
DH.l DH.l
JMP
SHORT '15
J----- ALPHA HOOE ON lIGHT PEN
i COLUtIN VALUE FOR RETURN I ROW VALUE 1 DIVIDE BY 4 J FOR VALUE IN 0-2:4 RANGE 1 LIGHT_PE~RETUR~SET
DIV
MOY
DH,At
MOV
Dl,AH
SAL
AL,Cl
""V CH.Al
MOV
Bl,AH
XOR
BH.BH
SAL
BX.Cl
'IS:
MOV ",I
'16:
PUSH
DX
MOY
DX,ADDR_6845
ADD
oX.7
OUT
DX.AL
POP
DX
'17:
POP
DI
POP
SI
POP
OS
POP
OS
POP
DS
POP
OS
POP
ES
I DETERMINE ROW,COU."~ VALUE J ROWS TO DH I COlS TO Dl 1 MULTIPLY ROWS tI a J GET RASTER VAWE TO RETURN REG ; COllltlN VAWE
TO ex
I LIGHT_PEH_RETURN_SET ; INDICATE EVERTHING SET ; LIGHT_PEN_RETURN I SAVE RETURN VALUE (IN CASE I I GET BASE ADDRESS I POINT TO RESET PARM ; ADDRESS. HOT DATA. IS IMPORTANT I RECOVER VALUE I RETURN_HO_RESET
I DISCARD SAVED ax,CX,DX
5-100 System BIOS
LOC OBJ
Fen CF
F841 F841 F841 F8 F842 IE F843 E6FMb F846 A11300 F849 IF F84A CF
F84D F84D
F840 FB F84E IE FMF £8£C06 F852 All000 F855 IF F856 CF
LINE SOURCE
5174 5175 5176 5177 S178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 51'14 5195 5196
5197 5198 5199 5200 5201 5202 5203 5204 5205
5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250
ENDP
;--- INT 12 ----------.---------------------------------------.---------
, MEtIORY_SIZE_DET
THIS ROUTINE DETERMINES THE AMOUNT OF HEMORY IN THE SYSTEM
AS REPRESENTED BY THE SWITCHES ON THE PLANAR. NOTE THAT THE
SYSTEM HAY NOT BE ABLE TO USE 110 HEMORY UNLESS THERE IS A FULL;
I
COMPLEMENT OF 64K BYTES ON THE PLANAR.
I INPUT
NO REGISTERS
THE HEHORY_SIZE VARIABLE IS SET DURING POWER ON DIAGNOSTICS
ACCORDING TO THE FOLLOWING HARDWARE ASSUMPTIONS:
PORT 60 BITS 3.2 = 00 - 16K BASE RAM
01 - 32K BASE RAM
10 - 48K BASE RAM
11 - 641< BASE RAM
PORT 62 BITS 3-0 ItI)ICATE AMOUNT OF I/O RAM IN 32K INCREMENTS
E.G ·· 0000 - NO RAM IN 1/0 CHANNEl
0010 - 64K RAM IN I/O CHA.NNEL. ETC.
I OUTPUT
= I AX 1 NlI1BER OF CONTIGUOUS 1K BLOCKS OF MEI10RY
; -------------------- ________ - ____________________ --- __________ ---______ _
A.SSUME CS;CODE.DS:DATA
ORG
OF841H
"EHOAY_SIZE_DET PRot FAR
STI
PUSH
OS
CAll ODS
MOY
PDP
IRET
; INTERRUPTS BACK ON ; SAVE SEGMENT
I GET VALUE I RECOVER SEGMENT j RETURN TO CALLER
;--- INT 11 ---------.---.-------------------------.--------.--- ; EQUIPt1ENT DETERMINATION
THIS ROUTINE ATTEMPTS TO DETERMINE WHAT OPTIONAL
I
DEVICES ARE A.TTACHED TO THE SYSTEM.
J INPUT
NO REGISTERS
THE EQUIPJUG VARIABLE IS SET DURING THE POWER ON
DIAGNOSTICS USING THE FOllOWING HARDWARE ASSUMPTIONS:
PORT 60 = !.OW ORDER BYTE Of EQUPMEHT
PORT 3F. = INTERRUPT 10 REGISTER OF 8250
BITS 7-3 ARE ALWAYS 0
PORT 378 ;: OUTPUT PORT OF PRINTER -- 8255 PORT THAT
CAN BE READ AS WELL A.S WRITTEN
I DlITPUT
lAX) IS SET, BIT SIGNIFICANT, TO INDICATE ATTACHED 110
BIT 15,14 ;: tlJMBER OF PRINTERS ATTACHED
BIT 13 HOT USED
BIT 12 = GAME liD ATTACHED
BIT 11.10,9 = tu1BER OF RS232 CARDS ATTACHED
BIT 8 UNUSED
BIT 7.6 = NUtlBER OF DISKETTE DRIVES
00=1, 01=2, 10=3. 11=4 ONLY IF BIT 0 = 1
BIT 5,4 = INITIAL VIDEO HODE
00 - UtruSED
01 · 40X25 BW USING COLOR CARD
10 - BOX25 BW USING COLOR CARD
11 - 80X25 BW USING BW CARD
BIT 3,2 = PLANAR RAM SIZE (OO=16K,Ol=32K,10=48K,l1=64KJ :
BIT 1 HOT USED
BIT 0 :: IPL FRctI DISKETTE -- THIS BIT INDICATES ntAT
THERE ARE DISKETTE DRIVES ON THE SYSTEM
NO OTHER REGISTERS AFFECTED
J---------------------------------------------------------------
ASSUME CS:CODE,DS:DATA.
DRG
OF84DH
EQUIPMENT
PROC FAR
STI
I INTERRUPTS BACK ON
PUSH
OS
I SAVE SE6I1ENT REGISTER
CAll
DO'
HOY
AX. EQUIP]LAG
PDP
OS
I GET THE CURRENT SETTINGS I RECOVER SEGMENT
IRfT
; RETURN TO CALLER
System BIOS 5-101
LaC OBJ
F859 F859 F859 Fe FaSA IE FaSB E8E006 Fa5E 802671007F F8b] E80400 F666 IF F867 CA0200 FebA
F8bA OAE4 F86C 7413 Fa6E FEce Fa70 7418 Fa72 FEee f874 741.4. Fa76 FEee Fa7S 7503 Fa7A E92401 F670 F670 8460 F67f F9 F8eD C3 FaBI
F8BI E461 FaB3 24F7 F88S Fess £661 FaB7 2.4.E4 F889 C3 Fa8A
LINE SOURCE
5251 5252 5251
5254 5255 5256 52:57 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 ..82 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5121 5324 5325 5326 5327
EQUIPI1ENT
EHOP
~--- INT 15 -------------______________________________________ _
i CASSETTE I/O
= (AH) 0 TURN CASSETTE HOTOR ON = (AH I 1 TURN CASSETTE MOTOR OFF I AH I = 2: READ 1 OR MORE 256 BYTE BLOCKS FROM CASSETTE
(Es.eX) = POINTER TO DATA BUFFER {ex J = COUNT OF BYTES TO READ
; ON EXIT
= (Es.eX) POINTER TO LAST BYTE READ + 1 = (OX) CelmT OF BYTES ACTUALLY READ
= (CYI 0 IF NO ERROR OCCURRED = 1 IF ERROR OCCURRED
I Ali) = ERROR RETURN IF (en= 1
: 01 IF CRC ERROR WAS DETECTED
: 02 IF DATA TRANSITIONS ARE LOST
: 04 IF NO DATA WAS FOUND
(AH) : 3 WRITE 1 DR MORE 256 BYTE BLOCKS TO CASSETTE
(ES,BX) : POINTER TO DATA BUffER (CX) : COUNT Of BYTES TO WRITE , ON EXIT IEX,BX) : POINTER TO LAST BYTE WRITTEN. 1 ICX) : 0 I AH) : ANY OTHER THAN ABOVE VALUES CAUSES I CYl: 1 AND IAHI: 80 TO BE RETURNED (INVALID COtItIAND).
J---------------------------------------------------------------
ASSUME OS : DATA. ES: NOTHING. SS: NOTHING.CS :CODE
DRG
sn
ruSH
OF859H
PROC
FAR
as
, INTERRUPTS BACK ON ~ ESTABLISH ADDRESSING TO DATA
CALL
AND
CALL
POP
RET
CASSETTE_IO
loll
PROC
OOS BIOS_BREAK, 7FH loll
as
ENDP NEAR
; MAKE SURE BREAK fLAG IS OFF ; CASSETTE_IO_CONT
I INTERRUPT RETURN
; ---- ------------------------------------------ - - ----- PURPOSE:
I TO CALL APPROPRIATE ROUTINE DEPENDING ON REG AH
AH
ROUTINE
; --- ------------------------------------ - - - ----- - ---
t1OTDRON
I 1
MOTOR OFF
READ CASSETTE BLOCK
I 3
WRITE CASSETTE BLOCK
1-------------------------------------------------------
OR
AH ,AH
i TURN ON tIOTOR?
JZ
MOTOIUJN
J YES. DO IT
DEC
AH
I TURN OFF t1OTOR?
JZ
MOTOR_OFF
, YES, DO IT
DEC
AH
I READ CASSETTE BLOCK?
JZ
READ_BLOCK
; YES. DO IT
DEC
AH
i WRITE CASSETTE BLOCK?
JHZ
W2
I NOT_DEFINED
J"P
WRITE_BLOCK
, YES. DO IT
1012:
; COMMAND NOT DEFINED
NOV .TC
AH,080H
ERROR. UNDEFINED OPERATION 1 ERROR FLAG
RET
WI
ENDP
PROC
NEAR
1 ------ -------------------------------- ; PU'RPOSE:
TO TURN ON CASSETTE MOTOR
1---------------------------------------
IN
AL,PORT_B
; READ CASSETTE OUTPUT
AN!)
AL.NOT 08H
I CLEAR BIT TO TURN ON MOTOR
1013:
OUT
PORT_B.U
i WRITE IT OUT
SUB
AH,AH
I CLEAR AH
RET
MOTCIIUlH
ENDP
MOTOR_OFF
PROC
NEAR
5-102 System BIOS
LOC OBJ
~
F88A £461 F8& OC08 FUE EBFS
F890
~ ~
FS9Q 53 FS9l 51 F892 56 F893 BE0700 f8% E8BFOI F899 F899 £462 F898 2410 F89D "'26800 F8AO BA7A3F F8A3 F8A3 F606710080 F8A8 7503
F8A" F8A... 4A F8AB 7503
,...F8AD
F8AD £98400
F8BO E8C600 F8B3 ElEE F8B5 BA7603 F8B8 890002
F6BB E421 F88D OCOI F8BF E621 'SCl Facl F606710OBO F8C6 756C F8C8 51 F8C9 E8AoOO FacC OBC9 F6CE 59 F8CF 74C8 F6Dl 3BD3 F8D3 £304
FOO5 73C2 F6D7 E2E8 F6D9 F8D9 72E6
F8DB E89BQQ FOOE E86A00 F8El Xl6 F8E3 7549
LINE SOURCE
5328 5329 53]0 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370, 5371 5372 5373 5374 5375 5376 5377 5378 5179 5380 5381 5382
'la' 5384
5la. 5386 'la7 5366 5389 5390 5391 5392 5393 5394 5395 5396 5397
·n.
5399 5400 5401 5,*02 5403 54··
.---------------------------------------
I PURPOSE:
----- ------ TO TURN cASSEnE MOTOR OFF
; ---------------------- ------
IN
U.PORT_B
; READ CASSETTE OUTP\IT
OR JHP I1OTOR_OFF
Al.OSH
w'
ENDP
i SET BIT TO TLRH OFF i WRITE IT. CLEAR ERROR. RETURH
READ_BLOCK
PRDC NEAR
1--- ----- -------- - -- - -- ------ - - - - - - ----------- - - - ------ J ~POSE:
TO READ 1 OR MORE 256 BYTE BLOCKS FROM CASSETTE
I ON ENTRY:
ES IS SEGMENT FOR MEtIORV BUFFER (FOR COtlPACT CODE)
ex POINTS TO START Of MEHORY BUFFER ex COIiTAINS HUHBER OF BYTES TO READ
, ON EXIT:
ex POINTS 1 BYTE PAST LAST BYTE PUT IN ME" ex CONTAINS DECREMENTED BYTE COUNT
OX CONTAINS NUt1BER OF BYTES ACTUALLY READ
CARRY FlAG IS CLEAR IF NO ERROR DETECTED
CARRY FlAG IS SET IF CRC ERROR DETECTED
;--------'----------------------------------------------.--------
PUS" ox
J S...VE 8X
PUS" ex
, S"'VE CX
PUS" 51
J S",VE 51
I10Il
51. 7
, SET UP RETRY COUNT FOR LEADER
CAlL BEGIN_OP
, BEGIN BY STARTING MOTOR
W4,
, SEARCH FOR LEADER
IN
Al,PORT~C
I GET INTIAL VALUE
ANO
"'L,OlOH
I I1ASK Off EXTRANEOUS BITS
HOV
LAST_V... L .... L
...,
HOV
OX.16250
.... TEST
JHZ
BIOS_BREAK. 80H
I S"'VE IN Loe LAST_VAL ; I OF TRANSITIONS TO LOOK FOR , WAIT]OR_EDGE ; CHECK FOR BREAK KEY I JUttP IF NO BREAK KEY
I JUt1P IF BREAK KEY HIT
NO'
DEC
OX
JNZ
W7
W6A:
I JUHP IF BEGINNING OF LEADER
JHP
M17
..,7:
CALL READ_HALF_BIT
, JUttP IF NO LEADER FOUl) I IGNORE FIRST EDGE
JCXl I10Il HOV
W5 DX.0378H CX,200H
IN
AL, 021H
OR
Al.I
OUT
021H. AL
we,
I JUHP IF NO EDGE DETECTED , CHECK FOR HALF BITS I MUST HAVE AT LEAST THIS ttAHY ONE SIZE I PULSES BEFORE CHCKNG FOR SYNC BIT (Q) I INTERRUPT MASK REGISTER I DISABLE TIMER INTERRUPTS
I SEARCH-LOR
TEST BIOS_BREAK, 80H
I CHECk FOR BREAK. kEY
JNZ
PUS" CALL OR pop
JZ CMP
M17 CX READ_HALF_BIT CX. CX CX W4 DX,BX
I JUHP IF BREAK KEY HIT ; SAYE REG ex I GET PULSE WIDTH , CHECK FOR TRANSITION J RESTORE ONE BIT COUNTER , JUHP IF NO TRANSITION I CHECK PULSE WIDTH
JCXZ M.
I IF CX=O THEN WE CAN LOOK
JNt
W'
LOOP
W8
W9: JC
w.
J FOR SYNC BIT (0) , JI.R1P IF ZERO BIT (NOT GOOD lEADER) I DEC ex At-IJ READ ANOTHER HALF ONE BIT I FIND-SYNC I JU1P IF ONE BIT (STILL LEADER)
;----- A SYNCH BIT HAS BEEN FOUND · READ SYN CHARACTER:
CALL CALL CHP JNE
READ_HAlF_BIT READ_BYTE AL, 16H Wl0
I SKIP OrnER HALF OF SYNC BIT (0' I READ SYH BYTE I SYHCHROHIZA TION CHARACTER i JUMP IF BAD LEADER FotNl.
I-~--- GOOD CRe so READ DATA BLOCK{S'
System BIOS 5-103
LOC OBJ
FeES SE F8E6 59 FeE7 56
FeES 51 F8E9
F8E9 C7066900FFfF F8EF BAOOOI FeF2 F6F2 F606710080 F8F7 7523 F6F9 E64FOO F8FC 721E F6FE nos
F900 268807 F903 43 F904 49 F905
F905 4A F906 '1FEA F906 E84000 F908 E63000 F90E 2AE4 F910 613E69000FlD F916 7506 F916 n06
F9lA EBCO F91C
F91C B401
F91E F91E FEC4
F920 F920 SA F921 2BOI
F923 50 F924 F6C490 F927 7513 F929 E61FOO F92C E80E F92E F92E 4E F92F 7403 F931 E965FF '934
F934 5E F935 59 F936 58 F937 2802 F939 8404 F938 50 F93C
LINE SOURCE
5405 5406 5407 5408 5409 5410 5411 5412 54lJ 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423
54'.
5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5476 5479 5480
POP
51
I RESTORE REGS
POP
CX
POP
BX
1---------------------------------------------------------------
; READ 1 OR MORE 256 BYTE BLOCKS FROM CASSETTE
I ON ENTRY:
ES IS SEGMENT FOR MENORY BUFFER I FOR COMPACT CODE)
BX POINTS TO START OF HEMORY BUFFER
ex CONTAINS NUMBER OF BYTES TO READ
1 ON EXIT:
ex POINTS 1 BYTE PAST LAST BYTE PUT IN MEM ex CONTAINS DECREMENTED BYTE COlIHT
OX CONTAINS NUMBER OF BYTES ACTUALLY READ
1---------------------------------------------------------------
PUSH
CX
I SAVE BYTE COUI'lT
WIO:
; COME HERE BEFORE EACH
I 256 BYTE BLOCK IS READ
NOV
CRC_REG .OFFFFH
, INIT CRe REG
MOV
Nl1:
DX,256
I SET OX TO DATA BLOCK SIZE I RD_BLK
TEST BIOS_BREAK, BOH
; CHECK FOR BREAK KEY
JHZ CALL
""READ_BYTE
; JUHP IF BREAK KEY HIT ; READ BYTE FROM CASSETIE
JC
"""" JCXZ
, CY SET INDICATES NO DATA TRANSITIONS , IF WE'VE ALREADY REACHED I END OF MEMORY BUFFER
I SKIP REST OF BLOCK
I10V
ES:(BX1,AL
I STORE DATA BYTE AT BYTE PTR
INC
BX
J INC BUFFER PTR
DEC
CX
1 DEC BYTE COUNTER
W12:
,I LOOP lNTIl DATA BLOCK HAS BEEN READ FROH CASSETTE.
DEC
OX
; DEC BLOCK CNT
JG CALL
W" READ_BYTE
i RO_BLK I NOW READ TWO CRC BYTES
CALL READ_BYTE
SUB
AH,AH
I CLEAR AH
C"P JHE JCXZ
CRC_REG,100FH
W14
"'5
I IS THE CRC CORRECT ; IF NOT EQUAL CRC IS BAD ; IF BYTE COUNT IS ZERO ; THEN WE HAVE READ ENOUGH
I SO WE WILL EXIT
J""
W'.
10113:
i STILL MORE, SO READ ANOTHER BLOCK I HISSING-DATA
j NO OATA TRANSITIONS SO
I10V
AH,OlH
I SET AH=02 TO INDICATE
I DATA TIMEOUT
W14:
I BAD-CRC
INC
AH
; EXIT EARLY ON ERROR
J SET AH=OI TO INDICATE CRC ERROR
lollS:
J RO-BLK-EX
POP
OX
; CA(CULATE COUNT OF
SUB
OX,CX
I DATA BYTES ACTUALLY READ
; RETl.RN COUNT IN REG OX
PUSH
AX
; SAVE AX UET CODE)
TEST JHZ CALL
",.AH, 90H
READ_BYTE
i CHECK FOR ERRORS i JUMP IF ERROR DETECTED i READ TRAILER
J"P
SHORT 10116
SKIP TO TURN OFF MOTOR
loH6 :
BAD-LEADER
OEC
51
... JZ
W'7
J""
10117:
CHECK RETRIES JUMP IF TOO MANY RETRIES JUMP IF NOT TOO MANY RETRIES ; NO VALID DATA FOUND
1----- NO DATA FROM CASSETTE ERROR. I.E. TIMEOUT
W16:
POP "DP POP SUB I10V PUSH
51 CX BX OX,OX AH,04H AX
I RESTORE REGS ; RESTORE REGS
I ZERO J.l..teER OF BYTES READ ; TIME OUT ERROR (NO LEADER'
I HOT-OFF
5-104 System BIOS
LOC OBJ
f93C E421 F93E 24fE F940 E621 F942 E845FF F945 58 F946 BOFcol F949 FS f94A C3
F94B f94B S3 F94C 51 F94Q BI08 F94F F94F 51
f9S0 E62600 F953 E320 f95S S3 F956 E82000 F959 56 F95A E319 F95C 03D8 f95E 61FBF006 F962 FS F963 9f F964 59
F965 0005 F967 9E f968 E60900 F96B FEe9 F96D 75EO F96F 8ACS F971 Fe F972 f972 59 F973 58 F974 C3 F975 F97S 59 F976 F9 F977 f8F9
F979 f979 896400 F97C 8A266800
LINE SOURCE
5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 551S 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 554. 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5~51 5552 5553
5554 5555 5556 5557
IN
AL, 021H
AND
AL. OFFH 1
; RE_ENABLE INTERRUPTS
OUT CALL pop
021H. AL HOTOR_OFF AX
, TURN OFF MOTOR , RESTORE RETURN CODE
CHP eHe RET READ_BLOCK
AH,OIH ENDP
, SET CARR't IF ERROR IAH>O) ; FINISHED
; - --------------- - - - --------------- - -- ; PURPOSE:
TO READ A BYTE FROM CASSETTE
, ON EXIT
REG AL CONTAINS READ DATA BYTE
i ----- - ------------------ ------------
READ.BYTE
PROC
NEAR
PUSH BX
PUSH cx
; SAVE REGS BX,CX
HOV
CL.8H
, SET BIT COUNTER FOR 8 BITS
PUSH
CX
; eYTE-ASH
; SAVE ex
; ---------. ------------------ -- I READ DATA BIT FROM CASSETTE
; -------------------------------
CALL
READ.HALF.BIT
JCXZ
10121
PUSH ex
CALL POP JCXZ
READ.HALF_BIT AX Wli
ADD eHP eHe LAHF POP
BX,AX BX, 06FOH
CX
; READ ONE PULSE J IF c:X=O THEN TIMEOUT ; BECAUSE OF NO DATA TRANSlTIOHS ; SAVE 1ST HALF BIT'S
; PULSE WIDTH I IN ex)
, READ COMPLEMENTARY PULSE j COMPUTE DATA BIT I IF c:X=O THEN TIMEOUT DUE TO ; NO DATA TRANSITIONS , PERIOD ; CHECK fOR ZERO BIT I CARRY IS SET IF ONE BIT ; SAVE CARRY IN AH ; RESTORE CX j NOTE:
MS BIT OF BYTE IS READ FIRST.
REG CH IS SHIFTED LEFT WITH , CARRY BEING INSERTED INTO LS
BIT OF CH.
Rel
SAMF
CALL DEC
JNZ MOV
CRC.GEN CL
WI9 AL,CH
i AFTER ALL 8 BITS HAVE BEEN REAO, THE HS BIT OF THE DATA BYTE WlLL BE IN THE MS BIT OF REG CH
i ROTATE REG CH LEFT WITH CARRY TO LS BIT OF REG CH
; RESTORE CARRY FOR CRC ROUTINE i GENERATE CRC fOR BIT ; LOOP TILL All 8 BITS OF DATA ; AssrHBLED IN REG CH I BYTE_ASH I RETURN DATA BYTE IN REG Al
ele
10120:
POP
ex
POP ox
; RD-BYT-EX ; RESTORE REGS CX,BX
RET
; FINISHED
N21 :
POP
ex
I NO-OATA ; RESTORE CX
STe
JHP "2.
I INDICATE ERROR I RD_BYT_EX
READ_BYTE
ENOP
; ---------------- -----------------------__ · ___ _
j PURPOSE:
TO COMPUTE TIHE TILL NEXT DATA
TRANSITION (EDGE)
i ON ENTRY:
EDGE_CNT CONTAINS LAST EDGE CCIU'IT ; ON EXIT:
AX CONTAINS OLD LAST EDGE COUNT BX CONTAINS PULSE WIDTIi (HALF BIT)
; ---------------------------------- - - ----------
READ_HALF.BIT PRoe
NEAR
NOV
CX, 100
I SET TIME TO WAIT FOR BIT
HOV
I GET PRESENT INPUT VALUE
System BIOS 5-105
LOC OBJ
F980 F980 E462 F982 2410 F984 3AC4 F986 E1F8 F988 A26BOO F98B BODO F980 E643 F98F 881E6700 F993 E440 F995 8AEO F997 E440 F999 86C4 F99B 2B08 F99D ,436700 F9AO C3
F9Al F9Al 53 F9A2 51 F9A3 E461 F9A5 24FO F9A7 DeDI F9A9 E661 F9AB BOM F9AD E643 F9AF E81600 F982 88...004 F9BS E88500 F9B8 890008 ' ..0 F9BB F9 F9BC E86800 F9BF E2FA F9Cl F8 F9C2 E86200 F9C5 59 F9C6 58 F9C7 B016 F9C9 E84400
F9CC F9CC C7066900FFFF f902 BAOOOI nos F9D5 268A07 F908 E83500 f9DB £302 F90D 43 F90E 49 F90f F9DF 4A F9EO 7FF3
LINE SOURCE
5558 5559 556. 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572: 5573 5574 5575
5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 558& 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 56 ·· 5610 561J 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634
W22:
I RD-H-Bn'
IN
AL,PORT.C
A..,
AL,OIOH
; INPUT DATA BIT J HASK Off EXTRANEOUS BITS
CMP
AL.AH
I SAHE AS BEfORE?
LooPE W22
i LOOP TILL IT CHANGES
"""MOV
LAST_YAL.AL .U,O
I UPDATE LAST_YAL WITH NEW VALUE ; READ TIMER' S COUNTER COHttAND
OUT
TIM_cn.AL
; LATCH COUNTER
HOV
BX,EDGE_CNT
; BX GETS LAST EDGE COUNT
IN
AL,TIMERO
; GET LS BYTE
MOV
AH,AL
J SAYE IN AH
IN
AL,TIMERO
; GET HS BYTE
XCHG
sue
.U,AH BX,AX
J XCHG AL.AH J SET ex EQUAL TO HALF BIT PERIOD
MOV
EDGE_CNT ,AX
; UPDATE EDGE COUNT I
PET
READ.HALF_BIT ENOP ; -------------__________· ________________________________________
I PURPOSE WRITE 1 OR HORE 256 BYTE BLOCKS TO CASSETTE.
THE DATA IS PADDED TO FILL OUT THE LAST 256 BYTE BLOCK.
; ON ENTRY:
ex POINTS TO MEMORY BUFFER ADDRESS
;
ex CONTAINS NUMBER OF eYTES TO WRITE
I ON EXIT:
ax POINTS 1 BYTE PAST LAST BYTE WRITTEN TO CASSETTE
CX IS ZERO
J----------- - - - - - - - - - -------- - - - - - ----------------------------- -
~ITE_BLOCJ(
ppoe
NEAR
PUSH
OX
PUSH cx
IN
AL.PORT_B
I DISABLE SPEAKER
AND
AL.HOT 02H
OR
AL, 01H
I ENABLE TIMER
OUT
PORT_B,AL
MOV
AL,OB6H
I SET UP TIMER - MODE 3 SQUARE WAVE
OUT
TlM_CTL,AL
CALL
BEGIN_OP
START MOTOR AND DELAY
MOV
AX,lla4
; SET NORMAL BIT SIZE
CALL
W31
; SET_TIMER
MOV
cX,oaOOH
I SET CX FOR LEADER BYTE COUNT
W23:
; WRITE LEADER
STC
J WRITE DNE BITS
CALL
WRITE_BIT
LOOP W23
I LOOP 'TIL LEADER IS WRITTEN
CLC
· WRITE SYNC BIT (0)
CALL pop pop
WRITE.BIT CX OX
i RESTORE REGS CX.BX
I'IOV
AL, 16H
I ~ITE SYH CHARACTER
J-------C-A-L-L-----W--R-IT-E-_-B-Y-T-E---------------------------------------
; PURPOSE
i
WRITE 1 OR MORE 256 BYTE BLOCKS TO CASSETTE
I ON ENTRY:
BX POINTS TO MEHORY BUFFER ADDRESS
J
CONTAINS NUMBER OF BYTES TO WRITE
J ON EXIT:
BX POINTS 1 BYTE PAST LAST BYTE WRITTEN TO CASSETTE
CX IS ZERO
; --------------------------------------- ---------------.---- --
WR.BLOCK:
MOV
CRC.REG,OFFFFH
; INIT CRC
MOV
DX.256
I FOR 256 BYTES
1<124:
; WR-BLK
MOV CALL JCXZ INC
AL,ES:[BXJ
.2.WRITE.BYTE
ox
I READ BYTE fROM I1EI1 ; WRITE IT TO CASSETTE I UNLESS CX=O. ADVANCE PTRS , ; INC BUFFER POINTER
OEC
CX
I DEC BYTE COUNTER
W25:
; SKIP-ADV
OEC
.x
.IS "2'
; DEC BLOCK CNT i LOOP TILL 256 BYTE BLOCK I IS ~ITTEN TO TAPE
DEC COUNT
1--------- ------- - - ------ - - - --- - - - -- - ------------------- I WRITE CRC
WRITE l ' S COMPLEMENT OF CRC REG TO CASSETTE
~
5-106 System BIOS
LOC OBJ
1'9E2 1.16900
F~E5 f700 Fc)E7 50 1'9E8 86£0 F9EA £82300 F9ED 58 F9EE £81FOO F9FI OBC9 F9F3 7507 F91'5 51 F'9F6 892000 F91'9 F91'9 F9 F9FA £82AOO F9FD E2FA F9FF 59 FAOO 80BO FA02 £643 FA04 860100 FA07 £83300 fAOA E870FE FAOO 28C0 FAaF C3
FAI0 FAIO 51 FAll 50 FA12 SAEe
HIlt B108
FA16 FAl6 0005 FA18 9C
FA19 £80BOO FAit 90 FAID £82400 FA20 FEC9 FAZ2 75F2 1'.24 58 FA25 59 F.6.26 C3
FA27
FA27 88A004 FA2A n03 FAze B85002 FA2F FAll' 50 FA30 FA30 £462 FA32 2420
LINE SOURCE
5635 5636 5637 5636 5639 5640 5641 5642 5643 5644 5645 5646 5647 5646 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 ..59
."60
5661
"
5663 5664 5665 5666 5667 5666 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5661 5682 5683 5664 5685 5686 5667 5686 5669 5690 5691 5692 5693 5694 5695 5696 5697
5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5706 5709 5710 5711
WHICH IS CHECKED FOR CORRECTNESS WHEN THE BLOCK IS READ
; REG AX IS MODIFIED
1---------------------------------------- --- ------------ ------
MOV
AX,CRC_REG
; WRITE THE ONE'S COMPLEMENT OF THE
I TWO BYTE CRC TO TAPE
WZ6:
HOT PUSH XCHG
POP CALL OR JNZ PUSH HOV
AX AX AH,AL
AX WRITE_BYTE CX,CX WR_BLDCK CX
ex, 32
; FOR 1'5 COMPLEMENT ; SAVE IT ; WRITE MS BYTE FIRST I WRITE IT I GET IT BACK I NOW WR ITE LS Il YTE ; IS BYTE COUNT EXHAUSTED? ; JUMP IF NOT DONE YET , SAVE REG CX ; WRITE OUT TRAILER BITS I TRAIL-LOOP
STC CALL LOOP POP MOV OUT HOV CALL CALL SUB
RET
WRITE_BIT WZ6 CX At. OBOH TIM_CTL, AL AX, 1 10131 MOTOR_OFF AX,AX
,HOP
I WRITE UNTIL TRAILER WRInEN ; RESTORE REG CX I TURN TIMER2 OFF
; SET_TIMER I TURN MOTOR OF F I NO ERRORS REPORTED ON WRITE OP ; FINISHED
; ----.-------------------------- ; WRITE A BYTE TO CASSEnE. ; BYTE TO WRITE IS IN REG AL.
; --------------- - ---- - ----------
WRITE_BYTE
MOC
NEAR
PUSH
CX
PUSH
AX
MOV
CH,Al
HOV
CL.6
10127:
RCL PUSHf
CH,I
POPF CALL DEC JNZ POP POP
RET
WRITE_BYTE
CRC_GEN CL 10127 AX CX
ENOp
J SAVE REGS CX,AX
i AL::BYTE TO WRITE. I (MS BIT WRITTEN FIRST) ; FOR 6 DATA BITS IN BYTE. I NOTE: TWO EDGES PER BIT ; DISASSEHBLE THE DATA BIT ; ROTATE MS BIT INTO CARRY I SAVE FLAGS.
NOTE: DATA BIT IS IN CARRY I WRITE DATA BIT I RESTORE CARRY FOR CRC CALC ; COMPUTE CRC ON DATA BIT I LOOP TILL ALL 6 BITS DONE I JUMP IF NOT DONE YET ; RESTORE REGS AX,CX
I WE ARE FINISHED
1--------------- - --------------------------------------- ; PURPOSE:
TO WRITE A DATA BIT TO CASSETTE CARRY FLAG CONTAINS DATA BIT
I.E. IF SET DATA BIT IS A ONE IF CLEAR DATA BIT IS A ZERO
NOTE: TWO EDGES ARE WRITTEN PER BIT ONE BIT HAS 500 USEC BETWEEN EDGES FOR A 1000 USEC PERIOD (1 I1IllISEC)
ZERO BIT HAS 250 USEC BETWEEN EDGES FOR A 500 USEe PERIOD (.5 I1ILLISEC J
1I -C-A-R-R-Y---F-LA-G- -I-S--D-A-T-A--B--IT------___________________________ _
WRITE_BIT
W28: WZ9:
HOV
JC HOV
PUSh
IN
A..,
PROC
NEAR
AX. 1184 WZ8 AX. 592
AX
AL,PORT_C AL.020H
J ASSUME IT'S A ' I ' i SET AX TO NOMINAL ONE SIZE I Jut1P IF ONE BIT ; NO. SET TO NOMINAL ZERO SIZE ; IolRITE-BIT-AX ; WRITE BIT WITH PERIOD EQ TO VALUE AX
I INPUT TlMER_0 OUTPUT
System BIOS 5-107
LOC OBJ
FA34 74FA FA36 FA36 E462 FA38 242:0 FA3A 75FA
'A3e 58 FA30 fA3D E64::! FA3F 6AC4 FA41 E642 FA43 C3
,.44
FA44 A16900
FA47 0108 FA49 DIDO FA48 F8 FA4C 7104
FA4E 351008 FA51 F9 FA52 FA52: DIDO
FA54 "36900 FA57 C3
FA58 FA58 E82:6FE FASB B342
FASO FASO 890007 FA60 ElFE FA62: FEce FA64 75F7 FA66 C3
FA67 2:0323031 FA68 00 FA6C 0...
FA6E FA6E FA6E 0000000000000000 FA76 7E8USS1BD99817E FA 7E 7EFFDBFFC3E7FF7E FA86 6CFEFEFE7C3810ao FASE l0387CFE7C381000 FA96 387C38FEFE7C387C FA9E lOl0387CFE7C387C FAA6 0000183C3C180000 FAAE FFFFE7C3C3E7FFFF FAS6 003C664242:663COO FASE FFC399BDBD99C3FF FAC6 OF070F7DCCCCCC78 FACE 3C0666663C187E18
LINE SOURCE
5712 5713 5714 57lS 5716 5717 5718 5719 5720 5721 5722 572:3 5724 5725 5726
5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754
5755 57.. 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767
JZ "2'
W30:
, LOOP TILi.. HIGH
IH
AL,PORT.C
AND
AL.020H
I NOW WAIT TILL TINER'S OUTPUT IS LOW
JHZ
W30
I RELOAD TIttER WInt PERIOD
pop
AX
~ FOR NEXT DATA BIT ~ RESTORE PERIOD COUNT
1431:
; SET TIMER
OUT
042H. AL
HOV
Al. AH
~ SET LOW BYTE OF TIttER 2
OUT
042H. AL
I SET HIGH BYTE OF TIttER 2
RET
WRITE.BIT
ENDP
; -- --------------------- _________ ~ - ______________
UPDATE CRC REGISTER WITH NEXT DATA BIT CRC IS USED TO DETECT READ ERRORS ASSUHES DATA BIT IS IN CARRY
REG AX IS MODIFIED
FLAGS ARE HODIFIED
~------------------------------------------------
CRC_GEN
PROC
NEAR
HOV
I THE FOLLOWING INST\JCTlONS
; WILL SET ntE OVERFLOW FlAG
; IF CARRY AtIJ HS BIT OF CRC
RCR
AX'!
RCl
AX')
ClC
JNO
W3.
I ARE ~QUAL
I CLEAR CARRY ; SKIP IF NO OVERFLOW
~ IF DATA BIT XORED WITH
XOR
AX,0810H
STC
I CRC REG BIT 15 IS ONE I THEN XOR CRC REG WITH 0801H I SET CARRY
1432:
RCl
AX,)
I ROTATE CARRY (DATA BIll
MOV
CRC.REG,AX
RET
; INTO CRC REG I UPDATE CRC.REG I FINISHED
CRC.GEN
ENDP
BEGIN_OP CAll
HOV
PROC HEAR HOTOR.ON Bl,42H
1433: HOV
1434: lOOP DEC JNZ RET
BEGIN..OP
CX.700H W34 Bl W33
EIIIP
~ START TAPE AHO DE LAY ; TURN ON HOTOR ;DELAY FOR TAPE DRIVE ; TO GET UP TO SPEED (l/2 SEC I
IIht-lER looP= APPROX. 10 ttILLISEC
EI
DB
· 201' ,13,10
5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786
1----------------------------------------------------------------------
CHARACTER GENERATOR GRAPHICS FOR 320X200 AND 640X200 GRAPHICS
1----------------------------------------------------------------------
ORS
OFA6EH
CRT_CHAR.GEN LABEl BYTE
DB
OOOH,OOOH,OOOH,OOOH,OOOH,OOOH,OOOH,OOOH I 0_00
DB
07EH,081H,OA5H,081H,OBOH,099H,OSIH,07EH I 0.01
DB
07EH,OFFH,ODBH,OFFH.OClH.OE7H,OFFH.07EH I 0.02
DB
06CH.OFEH,OFEH,OFEH,07CH,038H,OlOH.OOOH I 0.03
08
010H,038H,07CH,OFEH,07CH,038H.OIOH,OOOH 10.04
08
038H.07CH,03SH,OFEH,OFEH,07CH,038H,07CH ; 0.05
D.
010H.OIOH,038H,07CH,OFEH,07CH,038H,07CH I D.06
08
OOOH,000H.018H,03CH,03CH.0ISH,OOOH,OOOH I 0.07
DB
OFFH.OFFH,OE7H,OC3H.OC3H.OE7H,OFFH,OFFH j 0.08
DB
000H,03CH,066H,042H,042H,066H,03CH.OOOH ; 0_09
DB
OFFH,OC3H,099H,OBDH,OBDH.099H,OC3H,OFFH ; 0.0'"
DB
OOFH,007H,00FH,070H,OCCH,OCCH,OCCH,07SH I D.OB
DB
03CH,066H,066H,066H,03CH,018H,07EH,OI8H. I D.OC
5-108 System BIOS
LOC OBJ
F.6.D6 3F333F303D70FOEO FADE 7F637F636367E6CO FAE6 995A3CE7E73CSA99 FAEE eOEOF8FEFBEOeOOO FAF6 020E3EFEJEOE0200 FAFE 163C7E18187E3Cle FB06 6666666666006600 FBDE 7FDBDB7BIBIBIBOO fB16 3E63386C6C38CC78 FelE 000000007£7£7£00 FB26 183C7E187E3C18FF FBZE 183C7£1816181800 FB36 181818187EX1800 FB3E 00180CFEQCl80000 FB46 a03060FE60300000 FB4E OQOQCOCOCDFEOOOO FB56 OQ2466FF66240000 FB5E 00183C7EFFFFOOOO FB66 OOFFFF7E3C180000 FBbE 0000000000000000 FB76 3078783030003000 Fe7E 6C6C6COOOOOOOOOO FeM 6C6CFE6CFE6C6COO FB8E 307CC0780CF63000 FB96 OOC6CC183066C600 FB9E 386C38760CCC7600 FBA6 6060COOOOOOOOOOO FBAE 1830606060301800 FBB6 6030181818306000 FBBE 00663CFF3C660000 FBC6 OOlD10FC30300000 FeCE 0000000000303060 FBD6 OOOOOOFCOOOOOOOO FBDE 0000000000303000 FBE6 060C183060C08000 FeEE 7CC6CEDEF6E67COO FeF6 307030303030FCOO FBFE 78ccoe3860CCFCOO FC06 78eCOC360CCC7800 FCOE le3e6CCCFEOClE00 FC 16 FCCOF80COCCC7800 Fel E 3860COF8CCCC7800 FCl6 Fcccoe1630303000 FC2E 78CCCC76CCCC7800 FC36 78CCCC7COCI67000 FC3E 0030300000303000 FC46 0030300000303060 FC4E 183060e060301600 FC56 OOOOFeoOOOFCOOOO FC5E 6030160CI8306000 FC66 78CCOC1630003000 FC6E 7CC60EOEOEC07600 FC76 3078CCCCFCCCCCOO FC7E FC66667C6666FCOO FC86 3C66COCOC0663C00 FC8E F86C6666666CF800 FC96 FE6268786862FEOO FC9E FE6268786860FOOO FCM 3C66cocoeE663EOO FCAE cceeeCFCCCCCCCOO FCB6 7830303030307800 FeBE lEOCOCOCCCCC7800 Fee6 E6666C786C66E600 FeeE F06060606266FEOO Fe06 C6EEFEFE06C6C600 FCOE C6E6F60ECEe6C600 FCE6 386ce6e6C66C3800 FeEE FC66667C6060FOOO FCF6 78CCCCCCOC781COO FCFE FC66667'C6C66E600 F006 78CCE070 lCCC7800 FOOE Fce4303030307800 FO 16 CCCCCCCCCCCCFCOO FOIE CCCCCCCCCC783000 F026 C6C6C606FEEEC600 F02E C6C66C38386CC600 F036 ':CCCCC76301c"aoo
LINE SOURCE
5787
DB
5788
DB
5789
DB
5790
DB
5791
DB
5792
DB
5793
DB
5794
DB
5795
DB
5796
DB
5797
DB
5798
DB
5799
DB
5600
DB
5601
DB
5802
DB
5603
DB
5604
DB
5605
DB
5606
DB
5607
DB
5808
DB
5809
DB
5810
DB
5611
DB
5812
DB
5613
DB
5814
DB
5615
DB
5616
DB
5817
DB
5816
DB
5619
DB
5820
DB
5821
DB
5622
DB
5623
DB
5624
DB
5825
DB
5826
DB
5827
DB
5628
DB
5829
DB
5830
DB
5631
DB
5832
DB
5833
DB
5634
DB
5835
DB
5836
DB
5837
DB
5836
DB
5839
DB
5640
DB
5841
DB
5842
DB
5843
DB
5844
DB
5645
DB
5846
DB
5647
DB
5648
DB
584'
DB
5850
DB
5651
DB
5652
DB
5853
DB
5854
DB
5855
DB
5856
DB
5857
DB
5656
DB
5859
DB
5860
DB
5661
DB
5862
DB
DB
03FH,031H,OlFH,030H,030H,070H,OFOH,OEOH I 0_00 07FH,063H,07FH,061H,063H,067H,OE6H,oeOH ; O_OE 099H.05AH,03CH,OE7H,OE7H.03CH,05AH,099H ; O_OF 080H,OEOH,OFBH,OFEH,OF8H,OEOH,080H,000H ; 0_10 002H.00EH,03EH,OFEH,03EH,00EH.002H,OOOH ; 0_11 OI6H.03CH,07EH.Ol8H,018H.07EH,OlCH,018H j 0_12 066H,066H,066H,066H,066H,OOOH,066H,000H I 0_13 07FH,OOBH,ODBH,07BH,0IBH.OIBH.OIBH.000H ; 0_14 01EH,063H.018H,06CH.06CH.038H.OCCH.078H j 0_15 000H.OOOH,OOOH.OOOH,07EH.07EH,07EH,ODOH I 0_16 018H.01CH,07EH,018H,07EH,03CH.016H.OFFH j 0_17 016H.03CH.07EH,018H.018H.Ot8H.018H.000H I 0_18 OI6H,018H,018H,OI8H,07EH.01CH,OI8H.OOOH ; 0_19 000H,018H,OOCH,OFEH.OOCH.016H,000H.000H ; O_lA 000H,030H,060H.OFEH,060H.030H,000H,OOOH ~ 0_18
OOOH.OOOH,OCOH.OCOH.OCOH.OFEH,OOOH.OOOH 10_Ie 000H.024H,066H,OFFH,066H,024H.OOOH.000H ; 0_10 000H,OI6H,OlCH,07EH.OFFH.OFFH.OOOH.OOOH ; D_IE 000H,OFFH,OFFH,07EH.01cH,OI8H,OOOH,DOOH 10_IF OOOH.OOOH,OOOH,OOOH,OOOH,OOOH,ODOH.OOOH ; SP 0_20 030H.078H.078H,030H,OlOH,OOOH.030H.DOOH ~ ! 0_21 06CH,06CH,06CH.000H,OOOH.000H,OOOH,OOOH I .. 0_22 06CH,06CH,OFEH,06CH,OFEH.06CH,06CH.ODOH ; · D_23 030H.07CH,OCOH,078H,OOCH.OF8H,OlOH.000H J $ 0_24 000H.oC6H,oceH,OIBH,030H,066H,OC6H,000H PER CENT 0_25 018H.06eH.038H,076H,OOCH,OCCH.076H,OOOH & 0_26 060H,060H,OCOH.OOOH,OOOH.OOOH,OOOH,OOOH '0_27 018H,030H,060H,060H,060H.010H,018H,OOOH I ( 0_28 060H.030H.OIBH,018H.018H,030H.060H.OOOH I ) 039
* 000H,066H.03CH,OFFH,03CH.066H,OOOH,OOOH I 0_211.
ODOH.030H,030H.OFCH.030H.010H,OOOH.OOOH ; + 0_2B OOOH. OOOH .OOOH, OOOH. OOOH .030H, 030H ,060H i , 0_2C OOOH,OOOH,OOOH,OFCH.OOOH.OOOH,ODOH,OOOH I - 0_20 000H.OOOH,OOOH,OOOH,OOOH.010H.030H,000H ; · 0_2E 006H.00CH,016H,OlOH,ObOH.oeOH.080H,OOOH I /0_2F 07CH.OC6H.OCEH,OOEH,OF6H.OE6H,07CH,OOOH ; 0 0_10 030H,070H,030H,OlOH,030H,OlOH,oFCH.OOOH I 1 0_31 078H,OCCH,OOCH,038H,060H.OCCH,OFCH,OOOH i 20_32 076H,OCCH.00CH,036H,OOCH,OCCH,078H.000H I 3 0_33 0ICH,03CH,ObCH,OCCH,OFEH,00CH,01EH.000H I 4 0_34 OFCH,OCOH,OF8H.00CH.OOCH.OCCH,078H,OOOH i 5 0_35 018H,060H.OCOH,OF8H.OCCH.OCCH,078H.OOOH ; 6 0_16 OFCH,OCCH.ooeH,018H,030H.030H,030H,OOOH j 70_37 076H.OCCH,OCCH,078H,OCCH,OCCH.078H,OOOH J 80_38 078H,OCCH,OCCH.07CH,00CH,018H.070H,OOOH 1 90_39 OOOH.030H.030H.000H,OOOH,030H,030H,OOOH 1 : 0_3Ao 000H,030H.030H,000H.000H,030H,030H,060H ; ; 0_38 018H.010H.060H.OCOH,060H,030H,OIBH,OOOH ; < O_X OOOH,OOOH.OfCH,OOOH,I)OOH,OFCH,OOOH,OOOH f ;:; 0_30 060H,030H,OI8H,OOCH,016H.030H,060H,000H I > 0_3E 078H.OCCH,OOCH.016H,030H,000H,030H,OOOH ; ? 0_3F 07CH.OC6H,00EH,OOEH,OOEH.OCOH,078H,000H i .:. 0_40 010H,078H.OCCH,OCCH,OFCH.OCCH,OCCH,000H ~ .0_41 OFCH.066H,066H.07CH.066H.066H,OFCH,000H ; 80_42
° 03CH,066H,OCOH,OCOH,OCOH.066H,03CH,OOOH I C 0_43
OF8H.06CH,066H,066H.066H,06CH,OF8H,OOOH ; 0_44 OFEH.062H.066H,076H.068H,062H,OFEH.000H ~ E 0_45 OFEH.062H,066H.076H.068H.060H,OFOH,OOOH ; F 0_46 03CH.066H.OCOH.OCOH.OCEH,066H,03EH.OOOH ; G 0_47 OCCH,OCCH,OCCH,OFCH,OCCH.OCCH,OCCH,OOOH ; H 0_48 078H,030H,030H,030H,030H,OlOH,078H,OOOH ; 10_49 01EH.OOCH,00CH,00CH.OCCH.OCCH,078H,OOOH ; J 0_4A OE6H.066H.D6CH,078H,06CH,066H,OE6H.000H ; K 0_4B OFOH,060H,060H.060H,062H,066H,OFEH.000H ; l D_4C OC6H,OEEH.OFEH,OFEH.OD6H.OC6H.OC6H,OOOH ; M 0_40 OC6H,OE6H.OF6H,OOEH,OCEH.OC6H.OC6H.000H ; N 0_4E 036H.06CH.OC6H.OC6H.OC6H,06CH,038H.000H ; OO_4F OFCH,066H,066H,07CH,060H,060H,OFOH,OOOH ; PO_50 078H,OCCH.OCCH.OCCH,OOCH,078H,0ICH,OOOH ~ Q 0_51 OFCH.066H,066H,07CH,C6CH,066H.OE6H,00CH ; R 0_52 078H,OCCH,OEOH.070H,0ICH.OCCH,078H,OOOH ; SO_53 OFCH.064H.030H.030H,030H,030H,076H.OOOH ; TO_54
OCCH.oeCH.OCCH.OCCH.OCCH,OCCH,OFCH.OOOH ; u 0_55 OCCH,OCCH.OCCH.OCCH,OCCH.078H,010H,OOOH I V 0_56 OC6H ·.OC6H,OC6H.006H.OFEH.OEEH,OC6H,OOOH ; W 0_57 OC6H.OC6H.06CH,038H.038H,06CH,OC6H.000H ; X 0_56
OCtH.OCCH.OCct-''07SH,030H,rr!.Cf-I,C78H,OOOH I Y l'>_Sq
System BIOS 5-109
LaC OBJ
LINE SOURCE
F03E FEC68C183266FEOO FD46 7860606060607800 F04E C06030180C060200 FDS6 7818181818187800 FOSE 10386(C600000000 F066 OOOOOOOOOQOOOOFF FD6E 3030180000000000 FD76 0000760C7CCC7600 F07E £060607C66660COO f086 000078CCCOCC7800 F08E lCOCOC7CCCCC7600 FD96 aOOQ78CCFCC07800 FD9E 386C60F06D60FOOO FDA6 OOOQ76CCCC7COCF8 FOAE £0606C766666£600 FDS6 3000703030307800 FOBE DCOOOCOCOCCCCC78 FOCo E060666C786CE600 FOCE 7030303030307800 FODb OOOOCCFEFE06C600 FODE OOOOF8CCCCCCCCOO FOE6 000078CCCCCC7800 FOEE 00000C66667C60FO FDF6 OOQ076CCCC7COCIE FOFE OOODDC766660FOOO FE06 00001CC0780CF800 FEOE 10307C3030341800 FEIo OOOOCCCCCCCC7600 FEIE 0000CCCCCC783000 FE26 QOOOC6D6FEFE6COO FE2E 0000C66C386CC600 FE36 0000CCCCCC7COCF8 FE3E 0000FC983064FCOO FE46 lC3030E030301COO FE4E 1818180018181800 FE56 E030301C3030EOOO FE5E 760COOOOOOOOOOOO FE66 0010386CC6C6FEOO
FE6E FE6E FE6E FS FE6F 1E FE70 E8CBOO FE73 OAE4 FE75 7407 FE77 FEce fE79 7416 FE7B FE7B F6 FE7C IF FE7D CF FE7E FE7E FA FE7F .0.07000 FE82 C606700000 FE87 SBOE6EOO FE8S 86166COO
5864 5865 5866 5867 5868 5869 5870 5871 5872: 5873 5874 5875 587. 5877 5878 5879 5880 5881 588Z 5883
....5884
5885
5887 5888 5889 5890 5891 589Z 5893 5894 5895 5896 5897 5898 5899 5900 5901 590Z 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912: 5913 5914 5915 5916 5917 StH8 5919 5920
5921 592Z 59Z3 59Z4 59Z5 59Z6 59Z7 5928 59Z9 5930 5931 5932: 5933 5934 5935 5936 5937 5936 5939 5940
DB
OFEH,OC6H,08CH,OI8H,03ZH,066H.OFEH,OOOH j Z O_5A
DB
078H,D60H,060H.060H.06OH,060H,078H,000H j [ 0_5B
DB
OCOH,060H.030H.018H,00CH,006H,00ZH,OOOH I BACKSlASH 0_5C
DB
078H,018H,OI8H,018H,018H,OI8H,078H,OOOH I I 0_50
DB
010H,038H.06CH,OC6H.000H,000H.000H,000H I CIRCUMFLEX 0_5E
D8
OOOH.OOOH, OOOH, OOOH .OOOH .OOOH, OOOH .OFFH I _ 0_5F
DB
030H.030H.018H,000H,000H.000H,000H,000H I · 0_6D
DB
000H.00DH,078H,OOCH,07CH.oCCH,076H,OoOcH 1 LOWER CASE A o_61
DB
OEOH,060H,060H.07CH,066H,066H,00CH,000H I L.C. B 0_62
D8
000H,000H,078H.OCCH,OCOH.OCCH.078H,000H I L.C. C 0_61
DB
OiCH,00CH.OOCH.07CH.OCCH,OCCH,076H,000H I L.C. 0 o_64
D.
000H.000H,078H,OCCH,OFCH,OCOH.078H.000H j L.C. E 0_65
DB
038H,06CH,060H.OFOH,060H,060H.OFOH.000H I l.C. F o_66
DB
000H,000H,076H,OCCH,OCCH,07CH,00CH,OF8H I L.C. G 0_67
DB
OEOH,060H,06CH.076H.066H,066H,OE6H.000H I L.C. H 0_68
DB
030H,OOOH,070H.030H.030H,030H,078H,000H ; l.C. I 0_69
DB
00CH.000H.00CH,00CH,OOCH.OCCH.OCCH.078H ; l.C. J 0_6A
DB
OEDH,060H.066H,06CH.07SH,06CH,OE6H,000H I l.C. K 0_6B
DB
070H,030H,030H.030H.030H,03-0H,07SH,000H i l.C. L 0_6C
DB
000H,OOOH,OCCH,OFEH,OFEH,006H,OC6H,000H ; L.C. M o_60
DB
000H.000H.OF8H,oCCH,OCCH.OCCH,OCCH,000H ; L.C. N 0_6E
DB
OOOH,OOOH.078H.OCCH.OCCH,OCCH.078H.000H I L.C. OO_6F
DB
000H,OOOH,OOCH.066H,066H,07CH.060H.OFOH I L.C. P o_70
DB
000H,OOOH,076H,OCCH,OCCH,07CH,OOCH,OlEH I L.C. Q 0_71
DB
000H,OOOH,00CH,D76H,066H,060H,OFOH,000H I L.C. R 0_72
DB
000H,OOOH,07CH,ocDH,07SH,OOCH,OFSH,OOOH I l.C. S 0_73
DB
010H,030H,07CH,030H.030H,034H,018H,oOOH I l.C. T 0_74
DB
000H,OOOH,OCCH,OCCH,OCCH.OCCH,076H,000H ; l.C. U 0_75
DB
v 000H,000H.OCCH,OCCH,OCCH,078H,030H,OOOH I L,e. 0_76
DB
DDOH,000H,OC6H.D06H,OFEH,OFEH.06CH,000H i L.C. W o_77
DB
000H,OOOH,DC6H,D6CH,0l8H.06CH.OC6H,OODH ; l.C. X 0_78
DB
OOOH,OOOH.OCCH,OCCH,DCCH.07CH,OOCH,OFSH ; L.C. Y 0_79
DB
000H.000H,OFCH,098H.030H,064H,OFCH,OOOH J L.C. Z 0_7A
DB
OlCH.030H,a30H,OEOH,03DH.030H,01CH,OOOH {0_76
DB
018H.018H,OI8H,OOOH,018H,0ISH,018H,00DH ; I 0_7C
DB
OEOH.030H,030H.OICH,030H,030H,OEOH,000H I } 0_70
DB
076H,ODCH.000H.000H.000H,000H,OOOH,OOOH I TILDE 0_7E
DB
000H,OI0H.036H.06CH.OC6H,OC6H.OFEH,OOOH I DELTA D_7F
; --- INT lA -------------------------------------------- ; TIME_OF _DAY
I THIS ROUTINE ALLOWS THE CLOCK TO BE SET/READ
INPUT
(AH) = 0
READ THE CURRENT CLOCK SETTING
RETURNS CX = HIGH PORTION OF COUNT
ox :: LOW PORTION OF COUNT
AL = 0 IF TIMER' HAS NOT PASSEO 24 H~S SINCE lAST READ
<>0 IF ON AHaTHER DAY
(AH) = 1
SET THE CURRENT CLOCK
CX = HIGH PORTION OF COUNT
ox ::; lOW PORTION OF COUNT
j NOTE: COUNTS OCCUR AT THE RATE OF
1193160/65536 COUNTS/SEC
lOR ABOUT 18.2 PER SECOND -- SEE EQUATES BELOW) ; ----- - _________________________________________________ _
ASSUHE DR. TIME_OF _DAY SH PUSH CALL D. JZ DEC JZ T1: STI PDP IRET T2: CLI MDV
Mev
MOV HOV
CS:COOE .DS:oATA
OFE6EH
PROC
FAR
DS DDS AH,AH T2 AH T3
DS
Al, TII1ER_OFL TIMER_OFl.O CX. TIMER_HIGH OX, TIMER_LOW
I INTERRUPTS BACK ON ; SAVE SEGMENT
; AH=O ; READ_TIME ; AH=1 I SET_TIME I TOO_RETURN ; INTERRUPTS BACK ON ; RECOVER SEGMENT ; RETURN TO CALLER I READ_TIME i NO TIMER INTERRUPTS WHILE RfAon~
, GET OVERFLOW, AtI) RESET THE FLAG
5-110 System BIOS
LaC OBJ
!"'"'""\
FE8F EBEA FE91 FE91 FA FE92 89166COO FE96 890E6[00 FE9A C606700000 FE9F EBOA
,...-.....
FEAS FEA5 FEA5 FB FEA6 IE FEA7 50 FEA6 52 FEA9 E69200 FEAC ff066COO FEBO 7504 FEB2 ff066EOO HB6 FEB6 833E6£0016 FEBB 7515 FEBD 613E6COOBOOO FEC3 7500
FEes 2BCO FEC7 A36EOO FECA A36COO FECD C606700001
~
FED2 FED2 FEOE4000 FED6 750B FED6 60263FOOFO FEDD BOOC FEDF BAF203 FEE2 EE FEf3 FEE3 CD1C fEES B020 fEE7 E620 FEE9 SA FEEA 56 FEEB IF FEEC CF
FEED 31363031 FEFI 00 FEF2 OA
LINE SOURCE
5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5903
5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5976 5979 5960 5961 5962 5983 5984 5965 5966 5967 5966 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6006 6009 6010
J"P T3:
Cll t10V I10V
"OV J"P lIt'E_OF_DAY
T1
TIMER_lOW.OX
TIMER_HIGH. ex
TIMER_OFl,O T1 ENDP
; TOO_RETURN ; SET_TIME ; NO INTERRUPTS WHILE WRITING
1 SET THE TIME ; RESET OVERFLOW ; TOO_RETURN
1-----------------------------------------------------.-
; THIS ROUTINE HANDLES THE TINER INTERRUPT FROtt
CHANNEL 0 OF THE 8253 TIMER. INPUT FREQUENCY IS 1.19318 MHZ AND THE DIVISOR IS 65536, RESULTIHG
I IN APPROX. 18.2 INTERRUPTS EVERY SECOND.
j THE INTERRUPT HANDLER MAINTAINS A COUNT OF INTERRUPTS: ; SINCE POWER ON TItlE. WHICH MAY BE USED TO ESTABLISH ; TIME OF DAY. I THE INTERRUPT HANDLER ALSO DECREMENTS THE MOTOR
CONTROL COUNT OF THE DISKETTE. AND WHEN IT EXPIRES. ; WILL TURN Off THE DISKETTE MOTOR f AND RESET THE ; MOTOR RUNNING FLAGS. ; THE INTERRUPT HANDLER WILL ALSO INVOKE A USER ROUTINE:
, I THROUGH INTERRUPT 1 CH AT EVERY TIME TICK. THE USER
J I'lJST CODE A ROUTINE AND PLACE THE CORRECT ADDRESS IN : ; THE VECTOR TABLE.
i --------------- ------------- ------- ---------- - -----
ORG
OFEA5H
TIMER_INT STI
"OC
FAR
INTERRUPTS BACK ON
PUSH
OS
PUSH AX
PUSH
OX
J SAVE MACHINE STATE
CAll
DDS
INC
TIMER_LOW
; INCREMENT TIME
JNZ
T4
j TEST_DAY
INC
TIMER_HIGH
; INCREMENT HIGH WORD OF TIME
T4:
; TEST_DAY
CMP
TIMER_HIGH.016H
JNZ
T5
C"P
TIMER_LOW.OBOH
JNZ
T5
; TEST FOR COlINT EQUALING 24 HIXJRS J DISKETTE_CTl
; DISKETTE_CTl
1------ TIMER HAS GONE 24 HOURS
SUB
AX,AX
MOV
TIMER_HIGH .AX
"OV
TIMER_LOW.. AX
"OV
TIMER_OFL .1
;------ TEST FOR DISKETTE TIME OUT
TS: DEC JHZ AND I10V MOV OUT
T6: INT "OV OUT POP POP POP IRET
TIMER_INT
MOTOR_COUNT T6 MOTOR_STATlJS.OFOH AL.OCH OX,03F2H DX.AL
IC" Al,EOI 020H .Al OX AX OS
ENDP
· DISKETTE_CTl
J RETURN IF COUNT NOT OUT J TURN OFF MOTOR RUNNING BITS
; FDC CTl PORT , TURN OfF THE MOTOR ; TIMER_RET: I TRANSFER CONTROL TO A USER ROUTINE
; ENO OF INTERRUPT TO 8259
j RESET MACH INE STATE , RETI..IRN FROM INTERRUPT
"0
OB
'1601' .13.10
6011
6012 ; ------------------------------------------------------------
6013
THESE ARE THE VECTORS WHICH ARE MOVED INTO
6014
THE 6086 INTERRUPT AREA DURING POIolER ON.
6015
ONLY THE OFFSETS ARE DISPLAYED HERE. CODE SEGMENT
System BIOS 5-111
LaC OBJ
FEF3 FEF3 FEF3 A5fE FEF5 87E9 FEF7 DDE6 FEF9 DDE6 FEFB DDE6 FEFD DDE6 FEFF 57EF FFOI DDE6 FF03 65FO FF05 4DFe. FF07 41F8 FF09 59EC FFOB 39E7 FFOD 59F6 FFOF ZEES FFll ClEF
FF13 0000
FF15 F2E6 FFl7 6EFE FF19 53FF FFlB 53FF FFlD A4FO FFIF C7EF FF21 0000
FF23 50415249545920 43464543482031
Ff31 00 FF32 OA FF33 20333031 FF37 00 FF38 OA FF39 313331 FF3C 00 FF3D OA
FF3E FF3E 50 FF3F 684000 FF42 SEDS FF44 56 FF45 C3
FF41 FF47 FF47 8401 FF49 50 Ff4A BOFF FF4C E621 FF4E B020 FF50 E620 FF52 58 FF53 FfS3 CF
LINE SOURCE
6016 6017 6016 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049
WILL BE ADDED FOR ALL OF THEN. EXCEPT WHERE NOTED
,---------------------------------------------------------------
ASSUME CS:CODE
OR.
OFEF3H
VECTOR_TABLE
LABEL WORD
; VECTOR TABLE FOR HOVE TO INTERRUPTS
OW
OFFSET TINER_1NT
I INTERRUPT 6
OW
OFFSET KB_INT
INTERRUPT 9
OW
OFFSET D_EOI
INTERRUPT A
OW
OffSET D_EOI
INTERRUPT B
OW
OffSET D_EOI
INTERRUPT C
OW
OFFSET D_EOI
ow
OFFSET DISK_INT
ow
OFFSET D_EOI
· INTERRUPT 0 · INTERRUPT E ; INTERRUPT F
ow
OFFSET VIDEO_IO
ow
OFFSET EQUIPMENT
· INTERRUPT 10H ; INTERRUPT 11H
ow
OFFSET MEMORY_SIZE_DET · INTERRUPT 12H
ow
OFFSET DISKETTE_IO
I INTERRUPT 13H
ow
OFFSET RS232_IO
· INTERRUPT 14H
ow
OFFSET CASSETTE_IO
; INTERRUPT ISH
ow
OFFSET KEYBOARD_IO
; INTERRUPT 16H
ow
OFFSET PRINTER_IO
; INTERRUPT 17H
ow
OOOOOH
ow
OF600H
,I INTERRUPT 18H MUST BE INSERTED INTO TABLE LATER
ow
OFFSET BOOT_STRAP
ow
TIME_OF _DAY
ow
DUMMY_RETURN
ow
DUMMY_RETURN
ow
VIDEO_PARMS
ow
OFFSET DISK_BASE
ow
0
I INTERRUPT 19H · INTERRUPT lAH -- TIME OF DAY ; INTERRUPT IBH -- KEYBOARD BREAK ADDR · INTERRUPT lC -- TIMER BREAK ADDR I INTERRUPT ID -- VIDEO PARAMETERS · INTERRUPT IE -- DISK PARMS ; INTERRUPT IF -- POINTER TO VIDEO EXT
OZ
OB
'PARITY CHECK 1',13.10
6050
FI
OB
301' ,13.10
6051
FZ
DB
'131' .13,10
6052 6053 6054 6055 6056 6057 6058 6059 6060 6061
6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085
005
PROC NEAR
PUSH HOV
~X AX.DATA
HOV
DS,AX
POP
AX
RET
DDS
'HOP
; SAVE AX
; SET DATA SEGMENT 1 RESTORE AX
;-------------- _________________________________________ _
TEMPORARY INTERRUPT SERVICE ROUTINE
1-------------------------------------------------------
ORG
OFF47H
all
PROC
NEAR
HOV
AH.l
PUSH
AX
1 SAVE REG AX CONTENTS
HOV
AL.OFFH
alIT
INTAOl,AL
1 HASK All UUERRUPTS OFF
HOV
AL,EOI
OUT
INTAOO,AL
POP
AX
; RESTORE REG AX CONTENTS
DUHMY_RETURN:
I NEED IRET FOR VECTOR TABLE
IRET
all
ENDP
.-- INT 5 -------------------------------------------------------------- THIS LOGIC WILL BE INVOKED BY INTERRUPT 05H TO PRINT THE SCREEN. THE CURSOR POSITION AT THE TIME THIS ROUTINE IS INVOKED: WILL BE SAVED AND RESTORED UPON COMPLETION. THE ROUTINE IS INTENDED TO RUN WITH INTERRUPTS ENABLED. IF A SUBSEQUENT 'PRINT SCREEN' KEY IS DEPRESSED DURING THE TIME THIS ROUTINE IS PRINTING IT WILL BE IGNORED. ADDRESS 50:0 CONTAINS THE STATUS OF THE PRINT SCREEN:
1'-""
5-112 System BIOS
LOC OBJ
FF54
"54
FF54 FB FF55 IE FF56 50 FFS7 53 FF58 51 FFS9 52 FFSA B65000 FF50 SEDe FrSF 803EOOOOOl FF64 745F fF66 (;606000001 FF6B 840F FF6D COlO
FF6F 8Ace FF71 8519 FF73 E85500 FF76 51 FF77 8403 FF79 COlO fF78 59 FF7C 52 FF7D 3302
FF7F FF7F 6402 Ff61 COlO FF83 8408 FF85 COlO Ff87 OACO FF&9 7502 FF8B B020 FfeD FFeD 52 FFeE 3302 Ff90 32E4 FF92 CD17 FF94 SA FF95 F6C425 Ff98 7521 FF9A FEe, FF<~C 3ACA FF9E 750F FFAn 3202 FFA2 8AE2 FFA4 52 FFA5 E82300 FFA8 SA FfA9 FEC6 HAS lAEE FFAD 7500 FF.F FFAF SA FFBD 8402 FFB2 COlO FFB4 C606000000 FFS9 ESDA FFBB
LINE SOURCE
6086 6087 6088 6089 6090
6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6106 6109 6110 6111 6112 6113
6114 6115 6116 6117 6118 6119 6120 6121 6122 612.3 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6156 6159 6160 6161 6162
50: 0 =0
EITHER PRINT SCREEN HAS NOT BEEN CALLED
OR UPON RETURN fROM A CALL THIS INDICATES
A SUCCESSFUL OPERATION.
=1 =255
PRINT SCREEN IS IN PROGRESS ERROR ENCOUNTERED DURING PRINTING
,-----------------------------------------------------------------------
ASSUHE CS:COOE,OS:XXDATA
ORG
OFF54H
PRINT_SCREEN PROC FAR STl PUSH OS PUSH AX
; MUST RUN WITH INTERRUPTS ENABLED ; MUST USE 50:0 FOR DATA AREA STORAGE
PUSH ex
PUSH PUSH MOV HOV CMP
CX OX AX,XXOATA Os,AX STATUS_BYTE, 1
I WILL USE THIS LATER FOR CURSOR LIMITS , WILL HOLD CURRENT CURSOR POSITION I HEX 50
; SEE IF PRINT ALREADY IN PROGRESS
JZ
EXIT
MOV
STATUS_BYTE ,I
I JUHP IF PRINT ALREADY IN PROGRESS ; INDICATE PRINT NOW IN PROGRESS
MOV
AH.IS
I WILL REQUEST THE CURRENT SCREEN MOOE
INT
10H
lALJ=HOOE (AHl=HUt1BER COLf..H.lS/LINE lBHJ=VISUAL PAGE
1------ - - -------------------------- -------- - - -------------- AT THIS POINT WE KHQW THE COlut1NS/lINE ARE IN I AX I ANO THE PAGE IF APPLICABLE IS IN l BH 1. THE STACK HAS OS,AX,BX,CX,OX PUSHED. [All HAS VIDEO MODE
; --------------------------------------- - ----------------------
MOV
CL,AH
; WILL HAKE USE OF [CX) REGISTER TO
MOV
CH,25
; CONTROL ROW & COLUNNS
CALL PUSH
CRlF
ex
I CARRIAGE RETURN LINE FEED ROUTINE ; SAVE SCREEN BOUNDS
MOV
AH,3
; WILL NOW READ THE CURSOR.
INT
10H
, AND PRESERVE THE POSITION
POP
CX
; RECALL SCREEN BOUNDS
PUSH
OX
i RECALL [BH1=VISUAL PAGE
xoo
OX,OX
I WILL SET CURSOR POSITION TO (0,01
J---------------------------------------------------------------
THE LOOP FROM PRIlO TO THE INSTRUCTION PRIOR TO PRIzo
IS THE lOOP TO READ EACH CURSOR POSITION FROM THE SCREEN AND PRINT.
;---------------------------------------------------------------
?RIlO:
HOV IHT I10V IHT 00
JHZ
HOV PRIl5:
AH,2 IOH AH,8 IOH AL,AL PRIl5 AL,'
; TO INDICATE ClRSOR SET REQUEST ; NEW CURSOR POSITION ESTABLISHED ; TO INDICATE REAO CHARACTER ; CHARACTER NOW IN (All j SEE IF VALID CHAR ; JUMP IF VALID CHAR ; HAKE A BLAi'I<.
PUSH XOR XOR
OX OX,OX AH,AH
; SAVE CURSOR POSITION J IM)ICATE PRINTER 1 J TO IHOICATE PRINT CHAR IN [AU
INT POP TEST
17H OX AH, 25H
I PRINT THE CHARACTER ; RECALL CURSOR POSITION ; TEST FOR PRINTER ERROR
JNZ
ERRIO
INC
Dl
CMP
Cl,Ol
i JUNP IF ERROR DETECTED ; AOVANCE TO NEXT COlUt1N ; SEE IF AT END OF LINE
JNZ
PRIIO
XOR
Dl,Ol
MOV
AH ,OL
; I F NOT PROCEED ; BACK TO COlllt1N 0 ; (AH)=O
PRI20: ERR 10:
PUSH CALL POP IHC CHP JHZ
POP HOV IHT HOV JHP
OX CRLF oX OH CH,OH PRIIO
ox
AH,2 10H STATUS_BYTE ,0 SHORT EXIT
; SAVE NEW CURSOR POSITION ; LINE FEED CARRIAGE RETVRN , RECALL CURSOR POSITION ; AOVANCE TO NEXT LINE I FINISHED? I IF NOT CONTINUE
; RECALL CURSOR POSITION I TO INOICATE CURSOR SET REQUEST 1 CURSOR POSITION RESTORED J INDICATE FINISHED J EXIT THE ROUTINE
System BIOS 5-113
LOC OBJ
HBB SA HBC 8402 HBE COlO FFeD FFCO C6D60000FF FFC5 FFC5 5A FFC6 59 FFe7 58 FFee 58 FFC9 IF FFCA CF
FFeB FFee 3302 FFeD 32E4
FFCF BOOA FFDI CD17 FF03 32E4 FFD5 BODO FF07 C017 FFD9 C3
FFQA 50415249545920 414845434B2032
FFE8 OD FFE9 OA FFEA 363031 FFED 00 FFEE OA
0000 EA5BEOOOFO
0005 31302F32372F38 3Z
LINE SOURCE
6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191
pop
HDV
INT ERRZO:
HOV EXIT:
PDP PDP POP POP POP IRET PRINT_SCREEN
OX AH,2 lDH
STATUS_BYTE.OFFH
OX CX BX AX OS
EHOP
J GET CURSQP POSITION I TO REQUEST CURSOR SET J CURSOR POSITION RESTORED
; INDICATE ERROR
I RESTORE ALL THE REGISTERS USED
j------ CARRIAGE RETURN. LINE FEED SUBROUTINE
CRLF
PRoe XO. XO.
NEAR OX,OX AH,AH
CRlF
HOV
INT
XOR HOV
INT
RET ENDP
Al,lZq l1H AH,AH AL.lSQ 17H
I PRINTER 0
,; WILL NOW SEND INITIAL LF ,CR TO PRINTER I LF ; SEND THE LINE FEED ; NOW FOR THE CR ; CR ; SEND THE CARRIAGE RETURN
01
DB
'PARITY CHECK 2',13,10
6192
F3
DB
'601'.13,10
6193
6194
COOE
ENDS
6195 6196
; -----------------------------
6197
POWER ON RESET VECTOR
6196 ; -------------------------------
6199
VECTOR SEGMENT AT OFFFFH
6200
6201
;----- POWER ON RESET
6202
6203
JHP
RESET
6204
6205
DB
'10/27182'
6206 6207
VECTOR ENIlS 'HO
I RELEASE MARKER
5-114 System BIOS
SECTION 6. INSTRUCTION SET
Contents
8088 Register Model
6-3
Operand Summary ..........·...................... 6-4
Second Instruction Byte Summary ...··.....·.··..··.·. 6-4
Memory Segmentation Model ....·.·...·.·....·.·...· 6-5
Use of Segment Override ...................·.....·.. 6-5
Data Transfer ...·.....·.·...·..............·..... 6-6
Arithmetic ·....···....·.·...·..............·..... 6-8
Logic .·...........·.....·.·.....·.....·........ 6-10
String Manipulation ·......·...·.·.....·........... 6-11
Control Transfer ...·............................. 6-12
8088 Conditional Transfer Operations ..·.....·.·...·.· 6-15
Processor Control ···...··.....·......·.....···... 6-16
8087 Extensions to the 8088 Instruction Set ..·.·.....·. 6-17
Data Transfer .....·..·.·.......·...·.·.....·.... 6-17
Comparison ·.....·........................···... 6-19
Arithmetic ..........·.................·......... 6-19
Transcendental ....·...........·............·.... 6-21
Instruction Set 6-1
Constants ...................................... 6-21
Processor Control ...............·............·... 6-22
8088 Instruction Set Matrix ..........··............ 6-25
Instruction Set Index ··...··.....................·· 6-27
6-2 Instruction Set
8088 Register Model
AX:
AH
BX:
BH
CX:
CH
OX:
DH
AL
Accumulator
BL
Base
CL
Count
DL
Data
SP
Stack Pointer
I BP
Base Pointer
r-----------S~I ----------~ Source Index
r'---_ --_--_--_-_ --_-0-_ 1--_-_ --_--_--_----~-' Destination Index
General Register File
IP
FLAGSH
I FLAGSL
CS
Code Segment
OS
Data Segment
SS
Stack Segment
~----------E~S----------~ Extra Segment
}
Segment Register File
Instructions which reference the flag register file as a 16-bit object use the symbol FLAGS to represent the file:
15
7
0
, X 'X X X, OF , OF 'IF 'TF , SF , ZF , X 'AF' X 'PF , X 'CF'
= x Don't Care
AF: Auxiliary Carry - BCD CF: Carry Flag PF: Parity Flag SF: Sign Flag ZF: Zero Flag
OF: Direction Flag (Strings) IF: Interrupt Enable Flag
OF: Overflow Flag (CF $ SF)
TF: Trap - Single Step Flag
}8080 Flags
} 8088 Flags
Instruction Set 6-3
Operand Summary
"reg field Bit Assignments:
16-Bit[w= 1J
8-Bit [w=OJ
000 AX 001 CX 010 OX 011 BX 100 SP 101 BP 110 SI 111 01
000 AL 001 CL 010 OL 011 BL 100 AH
101 CH
110 OH
111 BH
Segment
00 ES
01 CS
10 SS
11 OS
Second Instruction Byte Summary
I I mod xxx rim
mod
00 01 10 11
Displacement
OISP = 0*, disp-Iow and disp-high are absent
= OISP disp-Iow sign-extended to 15-bits, disp-high is absent
DISP = disp-high: disp-Iow
rim is treated as a "reg" field
MF = Memory format
00 01 10 11 -
32-bit Real 32-bit Integer 54-bit Real 54-bit Integer
rim
000 001 010 011 100 101 110 111
Operand Address
(BX) + (SI) + OISP (BX) + (01) + OISP (BP) + (SI) + OISP (BP) + (01) + OISP (SI) + OISP (01) + DISP (BP) + OISP* (BX) + OISP
OISP follows 2nd byte of instruction (before data if required).
*except if mod =00 and rim = 110 then EA =disp-high: disp-Iow.
6-4 Instruction Set
Memory Segmentation Modal
Logical Memory Space
f
1 J7..,..-......0.1.. FFFFFH
6!B
Code Segment
XXXXOH
"' ~
DisPlac~me;
_mo.' } ,,",k
15
0
I .....
I - Offset I
r---: , Address ,
15 '
}o"..o.mo., Selected
CS
Segment
55
... Register
OS
I
:1:
~i::
I
0
I I
Word {
0000 ~
0000 ~
10000
MSB
LSB BYTE
CS. 5S. OS. ES
ES 00
:
~
or none for I/O.INT
.1 f
-
-
-
-
-
,'I
I
~
I
,.., I
: Adder
I
I
, I
..
or;;
"t
I
19 -: 7
0 Physical
L
Address
Extra Data } Segment
r OOOOOH
Latch
Segment Override Prefix
I I 0 0 1 reg 1 1 0
Use of Segment Override
Operand Register
IP (Code Address) SP (Stack Address) BP (Stack Address or Stack Marker) SI or DI (not including strings) SI (implicit Source Address for Strings) DI (Implicit Destination Address for Strings)
Default
CS SS SS DS DS ES
With Override Prefix
Never Never
BP + DS or ES, or CS
ES, SS, or CS ES, SS, or CS Never
Instruction Set 6-5
MOV = Move
Register/memory to/from register
100010dw
mod reg rIm
Immediate to register/memory 1100011w mod 0 0 0 rIm
data Idata if w = 11
Immediate to register
o 1
w reg
data
Idata if w = 1 1
Memory to accumulator 1010000w
addr-Iow
addr-high
Accumulator to memory
1010001w
addr-Iow
addr-high
Register/memory to segment register
I 1 0 0 0 1 1 1 0 mod 0 reg rIm
Segment register to register/memory
1 0 0 0 1 1 0 0 1 mod 0 reg rIm
PUSH = Push
Register/memory
mod 1 1 0 rIm
Register
1 0 1 0 1 0 reg
Segment register
1 0 0 0 reg
01
Pop = Pop Register/memory
1000 1
mod 0 0 0 rIm
Register
10 1 0 1 1 reg
Segment register
10 0 0 reg 1 1 1
6-6 Instruction Set
~ ~ ~
XCHG = Exchange
Registerlmemory with register
I 1 0 0 0 0 1 1 w mod reg rim
Register with accumulator
I 1 0 0 1 0 reg
IN = Input to ALIAX from
Fixed port
1 1 1 0 o 1 0 w port
Variable port (OX)
1110 110 w
OUT = Output from ALIAX to
Fixed port 1 1 1 0 0 1 1 w port
Variable port (OX)
1110 110 w
XLAT = Translate byte to AL
I 1 1 0 1 0 1 1 1
LEA = Load EA to register
I 1 0 0 0 1 1 0 1 mod reg rim
LOS = Load pointer to OS
I 1 1 0 0 0 1 0 1 mod reg rim
LES = Load pointer to ES
I 1 1 0 0 0 1 0 0 mod reg rim
LAHF = Load AH with flags
I 1 0 0 1 1 1 1 1
SAHF = Store AH into flags
10 0 11110
PUSHF = Push flags
10 0 1110 0
POPF = Pop flags
10 0 1110 1
Instruction Set 6-7
Arithmetic
ADD = Add Register/memory with register to either
o 0 0 0 0 0 d w 1 mod reg rim
Immediate to register/memory 1 0 0 0 0 0 s w 1 mod 0 0 0 rim
data
dataifs:w=01
Immediate to accumulator 0000010wl
data
data if w = 1
ADC = Add with carry
Register/memory with register to either
I o 0 0 1 0 0 d w
mod reg rim
Immediate to register/memory 1 0 0 0 0 0 s w 1 mod 0 1 0 rim
data
data if s:w = 01
Immediate to accumulator 0001010w
data
data if w = 1
INC = Increment Register /Memory
1 1 1 1 1 1 1w
mod 0 0 0 rim
Register
o 1 0 0 0 reg
AAA = ASCII adjust for add 001101111
DAA = Decimal adjust for add 001001111
SUB = Subtract
Register/memory and register to either
I o 0 1 0 1 0 d w
mod reg rim
Immediate from register/memory
I 1 0 0 0 0 0 s w mod 1 0 1 rim data dataifs:w=01
Immediate from accumulator 0010110w
data
data ifw= 1
6-8 Instruction Set
SBB = Subtract with borrow Register/memory and register to either
o 0 0 1 1 0 d w 1 mod reg r/m
Immediate from register/memory 1 0 0 0 0 0 s w 1 mod 0 1 1 rIm
data
dataifs:w=01
Immediate from accumulator 0001110w
data
data if w = 1
DEC = Decrement Register/memory
1111111w
mod 0 0 1 rIm
Register
o 1 0 0 1 reg
NEG = Change sign
1 1 1 101
w
mod 0 1 1 rIm
CMP = Compare Register/memory and register
o 0 1 1 1 0 d w 1 mod reg rIm
Immediate with register/memory
1 0 0 0 0 0 s w 1 mod 1 1 1 rIm
data
data if s:w = 01
Immediate with accumulator
0011110wl
data
data if w = 1
AAS = ASCII adjust for subtact
001111111
DAS = Decimal adjust for subtact
001011111
MUL = Multiply (unsigned)
1 1 1 1 0 1 1 w 1 mod 1 0 0 rIm
IMUL = Integer multiply (signed)
1 1 1 1 0 1 1 w 1 mod 1 0 1 rIm
AAM = ASCII adjust for multiply
1101010000001010
DIV = Divide (unsigned)
1 1 1 1 0 1 1 w mod 1 1 0 r/m
Instruction Set 6-9
IDIV = Integer divide (signed) 1 1 1 1 0 1 1 w 1 mod 1 1 1 rIm
AAD = ASCII adjust for divide 11010101100001010
CBW = Convert byte to word 100110001
cwo = Convert word to double word
10011001
NOT = Invert 11 110 11w
Logic
mod 0 1 0 rIm
SHL/SAL = Shift logicallarithmetic left 1 1 0 1 0 0 v w mod 1 0 0 rIm
SHR = Shift logical right 1 10 10 0 v w
mod 1 0 1 rIm
SAR = Shift arithmetic right 1 1 0 1 0 0 v w mod 1 1 1 rIm
ROL = Rotate left 1 10 10 0 vw
mod 0 0 0 rIm
ROR = Rotate right 110 10 0 v w
mod 0 0 1 rIm
RCL = Rotate through carry left 1 1 0 1 0 0 v w 1 mod 0 1 0 rIm
RCR = Rotate through carry right 1 1 0 1 0 0 v w 1 mod 0 1 1 rIm
AND = And Registerlmemory and register to either
o 0 1 0 0 0 d w 1 mod reg rIm
Immediate to registerlmemory
I 1 0 0 0 0 0 0 w mod 1 0 0 rIm data
data if w = 1
Immediate to accumulator
I 0 0 1 0 0 1 0 w
data
data if w= 1
6-10 Instruction Set
TEST = And function to flags, no result
Register/memory and register
I 1 0 0 0 0 1 0 W
mod reg rIm
Immediate data and register/memory
I 1 1 1 1 0 1 1 W mod 0 0 0 rIm
data
data if W= 1
Immediate data and accumulator
I 1 0 1 0 1 0 0 W
data
data if W = 1
OR = Or
Register/memory and register to either
I o 0 0 0 1 0 d w
mod reg rIm
Immediate to register/memory
I 1 0 0 0 0 0 0 w mod 0 0 1 rIm
data
data if W= 1
Immediate to accumulator
I 0 0 0 0 1 1 0 w
data
data if W= 1
XOR = Exclusive or
Register/memory and register to either
I o 0 1 1 0 0 d w
mod reg rIm
Immediate to register/memory
I 1 0 0 0 0 0 0 w mod 1 1 0 rIm
data
data if W= 1
Immediate to accumulator 0011010w
data
data if W= 1
REP = Repeat 1111001z
String Manipulation
MOVS = Move String 1010010w
= CMPS Compare String
1010011w
SCAS = Scan String 1010111w
Instruction Set 6-11
LODS = Load String 1010110w
STOS = Store String 1010101w
CALL = Call
Direct within segment
11101000
Control Transfer
disp-Iow
disp-high
Indirect within segment
mod 0 1 0 rIm
Direct intersegment 10011010
offset-low
offset-high
seg-Iow
seg-high
Indirect intersegment 1111111
mod 0 1 1 rIm
JMP = Unconditional Jump Direct within segment
I 1 1 1 0 1 0 0 1
disp-Iow
disp-high
Direct within segment-short
1 110 10 1 1
disp
Indirect within segment 1111111
mod 1 0 0 rIm
Direct intersegment 11101010
offset-low
offset-high
seg-Iow
seg-high
Indirect intersegment 1111111
mod 1 0 1 rIm
6-12 Instruction Set
RET = Return frorn CALL Within segment
110000111
Within segment adding immediate to SP
11000010
data-low
data-high
Intersegment 11001011
Intersegment, adding immediate to SP 1 1 0 0 0 0 1 0 1 data-low
data-high
JE/JZ = Jump on equal/zero
o 1 1 1 0 1 0 0 1 disp
JL/JNGE = Jump on less/not greater or equal
o 1 1 1 1 1 0 0 1 disp
JLE/JNG = Jump on less or equal/not greater
o 1 1 1 1 1 1 0 1 disp
JB/JNAE = Jump on below/not above or equal 011100101 disp
JBEfJNA = Jump on below or equal/not above
o 1 1 1 0 1 1 0 1 disp
JPfJPE = Jump on parity/parity even
0 1 1 1 10 10
disp
JO = Jump on overflow 0 111000 0
disp
JS = Jump on sign
0 1 1 1 10 0 0
disp
JNE/JNZ = Jump on not equal/not zero
o 1 1 1 0 1 0 11 disp
= JNL/JGE Jump on not less/greater or equal
01111101
disp
Instruction Set 6-13
JNLEfJG = Jump on not less or equal/greater
I o 1 1 1 1 1 1 1
disp
JNBfJAE = Jump on not below/above or equal
I 0·1 1 1 0 0 1 1
disp
JNBEfJA = Jump on not below or equal/above
I o 1 1 1 0 1 1 1
disp
JNPfJPO = Jump on not parity/parity odd
I o .1 1 1 1 0 1 1
disp
JNO = Jump on not overflow
o1 1 10 0 0 1
disp
JNS = Jump on not sign
o1 1 1 10 0 1
disp
LOOP = Loop ex times
111000 10
disp
= LOOPZ/LOOPE Loop while zero/equal
I 1 1 1 0 0 0 0 1
disp
LOOPNZ/LOOPNE = Loop while not zero/not equal
I 1 1 1 0 0 0 0 0
disp
JCXZ = Jump on ex zero
111000 11
disp
6-14 Instruction Set
8088 Conditional Transfer Operations
Instruction
Condition
JE or JZ JLor JNGE JLE or JNG
JB or JNAE or JC JBE or JNA JP or JPE JO JS JNE orJNZ JNLorJGE JNLE or JG
JNB or JAE or JNC JNBE orJA JNPor JPO .INO JNS
ZF = 1 (SF xor OF) = 1 ((SF xor OF) or ZF) = 1
CF = 1 (CF or ZF) = 1 PF = 1 OF = 1 SF = 1 ZF = 0 (SF xor OF) = 0 ((SF xor OF) or ZF) = 0
CF = 0
(CForZF) = 0 PF = 0 OF = 0
SF = 0
Interpretation
"equal" or "zero"
"less" or "not greater or equal"
"less or equal" or "not greater"
"below" or "not above or equal"
"below or equal" or "not above"
"parity" or "parity even"
"overflow"
"sign"
"not equal" or "not zero"
"not less" or "greater or equal"
"not less or equal" or "greater"
"not below" or "above or equal"
"not less or equal" or "above"
"not parity" or "parity odd"
"not overflow"
"not sign"
*"Above" and "below" refer to the relation between two unsigned values, while "greater" and "less" refer to the relation between two signed values.
INT = Interrupt
Type specified
10 0 1
o 1
type
Type 3 11001100
INTO = Interrupt on overflow 11001110
IRET = Interrupt return 11001111
Instruction Set 6-15
CLC = Clear carry
11111000
CMC = Complement carry 1111010
CLD = Clear direction 11111100 CLI = Clear interrupt 11111010 HLT = Halt 11110100 LOCK = Bus lock prefix 11110000
Processor Control
STC = Set carry 1111100
NOP = No operation 100 1 0 000 STD = Set direction
1 1 1 1 0 STI = Set interrupt
11 1 o1
WAIT = Wait 10011011 ESC = Escape (to external device)
1011xxx mod x x x rim
Footnotes:
if d = 1then "to"; if d = 0 then "from" if w = 1then word instruction; if w = 0 then byte instruction
if s:w = 01 then 16 bits of immediate data from the operand if s:w = 11 then an immediate data byte is signed extended to form the 16-bit operand if v = Othen "count" = 1; if v = 1 then "count" in (Cl) x = don't care z is used for some string primitives to compare with ZF FLAG
= AL 8-bit accumulator
AX = 16-bit accumulator CX = Count register DS = Data segment DX = Variable port register ES = Extra segment Above/below refers to unsigned value Greater = more positive; less = less positive (more negative) signed values
6-16 Instruction Set
8087 Extensions to the 8088 Instruction Set
Data Transfer
FLO = Load
Integer/Real Memory to ST(O)
Escape MF
I mod 0 0 0 rIm
disp-Iow
Long Integer Memory to ST(O)
Escape 1
I 1 mod 1 0 1 rIm
disp-Iow
Temporary Real Memory to ST(O)
I Escape 0 1 1 mod 1 0 1 rIm
disp-Iow
BCD Memory to ST(O)
Escape 1
mod 1 0 0 rIm
disp-Iow
ST(i) to ST(O) Escape 0 0
1 1 0 0 0 ST(i)
FST = Store ST(O) to Integer/Real Memory
Escape MF
mod 0 1 0 rIm
disp-Iow
ST(O) to ST(i) Escape 1 0
1 1 0 1 0 ST(i)
disp-high disp-high disp-high disp-high
disp-high
Instruction Set 6-17
FSTP ; STORE AND POP
ST(O) to IntegerlReal Memory
Escape MF
I mod 0 1 1 rIm
ST(O) to Long Integer Memory
Escape 1
I 1 mod 1
1 rIm
ST(O) to Temporary Real Memory
I Escape 0 1 1 mod 1 1 1 rIm
ST(O) to BCD Memory
I Escape 1 1 1 mod 1 1 0 rIm
ST(O) to STm
Escape 1 0
1 1 0 1 1 STO)
= FXCH Exchange ST(i) and ST(O)
Escape 0 0 1 1 1 0 0 1 STm
disp-Iow disp-Iow disp-Iow disp-Iow
disp-high disp-high disp-high disp-high
6-18 Instruction Set
Comparison
FCOM = Compare
Integer/Real Memory to ST(O)
Escape MF 0 mod 0 1 0 rim
disp-Iow
~
ST(i) to ST(O) Escape 0 0 0
1 1 0 1 o ST(i)
FCOMP == Compare and Pop
Integer/Real Memory to ST(O)
I. Escape MF 0 mod 0 1 1 rim
disp-Iow
ST(i) to ST(O)
Escape 0 0 0
1 1 0 1 1 ST(i)
FCOMPP = Compare ST(1) to ST(O) and Pop twice
Escape 1 1 0 1 1 1 0 1 1 0 0 1
FTST == Test ST(O)
Escape 0 0 1 1 1
1001001
FXAM == Examine ST(O)
Escape 0 0 1 1 1
00101
Arithmetic
FADD == Addition
Integer/Real Memory with ST(O)
Escape MF 0 mod 0 0 0 rim
disp-Iow
ST(i) to ST(O)
Escape d P 0
1 1 0 0 0 ST(i)
FSUB == Subtraction
Integer/Real Memory with ST(O)
Escape MF 0 mod 1 0 R rim
disp-Iow
ST(i) to ST(O)
Escape d P 0
1 1 1 0 R rim
disp-high disp-high
disp-high disp-high
Instruction Set 6-19
Arithmetic (Continued)
FMUL = Multiplication Integer/Real Memory to ST(O)
Escape MF 0 mod 0 0 1 rim
disp-Iow
ST(i) and ST(O) Escape d P 0
1 1 0 0 1 rim
FDIV = Division Integer/Real Memory with ST(O)
Escape MF 0 mod 1 1 R rim
disp-Iow
ST(i) and ST(O) Escape d P 0
1 1 0 0 1 rim
FSQRT = Square Root of ST(O)
I Escape 0 0 1 1 1 1 1 1 0 1 0
FSCALE = Scale ST(O) by ST(1)
I Escape 0 0 1 1 1 1 1 1 1 0
= FPREM Partial Remainder of ST(O) .;- ST(1)
I Escape 0 0 1 1 1 1 1 1 0 0 0
FRNDINT = Round ST(O) to Integer
I Escape 0 0 1 1 1 1 1 1 1 0 0
= FXTRACT Extract Components of ST(O)
I Escape 0 0 1 1 1 1 1 0 1 0 0
FABS = Absolute Value of ST(O)
I Escape 0 0 1 1 1 1 0 0 0 0 1
FCHS = Change Sign of ST(O)
Escape 0 0 1 1 1 1 0 0 0 0 0
disp-high disp-high
6-20 Instruction Set
Transcendental
FPTAN = Partial Tangent of ST(O)
I Escape 0 0 1 1 1 1 1 0 0 1 0
FPATAN = Partial Arctangent of ST(O) .;- ST(1)
Escape 0 0 1 1 1 1 1 0 0 1 1
F2XM1 = 2ST(0)_1
Escape 0 0 1
11110000
FYL2X = ST(1) . LOG 2[ ST(O)I
I Escape 0 0 1 1 1 1 1 0 0 0 1
FYL2XP1 = ST(1) . LOG 2 [ ST(O) + 11
I Escape 0 0 1 1 1 1 1 1 0 0 1
Constants
FLOZ = Load + 0.0 into ST(O)
I Escape 0 0 1 1 1 1 0 1 1 1 0
FL01 = Load + 1.0 into ST(O)
I Escape 0 0 1 1 1 1 0 1 0 0 0
FLOPI = Load IT into ST(O)
I Escape 0 0 1 1 1 1 0 1 0 1 1
FLOL2T = Load log210 into ST(O)
I Escape 0 0 1 1 1 1 0 1 0 0 1
FLOL2E = Load IOg2e into ST(O)
I Escape 0 0 1 1 1 1 0 1 0 1 0
= FLOLG2 Load log102 into ST(O)
I Esca pe 0 0 1 1 1 1 0 1 1 0 0
FLOLN2 = Load log.2 into ST(O)
Escape 0 0 1 1 1 1 0 1 1 0 1
Instruction Set 6-21
Processor Control
= FINIT Initialize NDP
I Escape 0 1 1 1 1 1 0 0 0 1 1
FENI = Enable Interrupts
I Escape 0 1 1 1
1 000 0 0
FDISI = Disable Interrupts
I Escape O. 1 1 1 1
o0 0 0 1
FLDCW = Load Control Word
I Escape 0 0 1 mod 1 0 1 rim
FSTCW = Store Control Word
I Escape 0 0 1 mod 1 1 1 rim
disp-Iow disp-Iow
FSTSW = Store Status Word
I Escape 1 0 1 mod
1 1 rim
disp-Iow
FCLEX = Clear Exceptions
I Escape 0 1 1 1 1
000 10
FSTENV = Store Environment
Escape 0 0 1 mod 1 1 0 rim
disp-Iow
disp-high disp-high disp-high
disp-high
6-22 Instruction Set
~
Processor Control (Continued)
FLDENV = Load Enviroment
I Escape 0 0 1 mod 1 0 0 rIm
disp-Iow
FSAVE = Save State
I Escape 1 0 1 mod 1 1 0 rIm
disp-Iow
FRSTOR = Restore State
I Escape 1 0 1 mod 1 0 0 rIm
disp-Iow
FINCSTP = Increment Stack Pointer
I Escape 0 0 1 1 1 1 1 0 1 1 1
FDECSTP = Decrement Stack Pointer
Escape 0 0 1 1 1 1 1 0 1 1 0
FFREE = Free ST(i)
Escape 0 0 1
1 0 0 0 ST(i)
FNOP = No Operation
I Escape 0 0 1 1
0 100 00
= FWAIT CPU Wait for NDP
10011011
disp-high disp-high disp-high
Instruction Set 6-23
Footnotes: STIO) = Current Stack top STIiI = i'h register below stack top d = Destination
o - Destination is ST(O)
1 - Destination is STIiI P= POP
0- No pop 1 - PopST(O) R= Reverse
o - Destination (op) Source
1 - Source (op) Destination For FSQRT: -O:5ST(O):5 + 00 For FSCAlE: - 2'5 :5ST(1)< + 2'5 and ST(1) integer For F2XM1: 0:5ST(0):52- 1 For FYL2X: O<ST(O)<oo
- 00 < ST( 1) < + 00 For FYL2XP1: 0< IST(O)I < (2 - ../2)/2
-00<ST(1)<00 For FPTAN: OsST(0)<n/4 For FPATAN: 0:5ST(0)<ST(1)< +00
6-24 Instruction Set
8088 Instruction Set Matrix
LO o
ADD b,f,r/m
ADC b,f,r/m
AND b,f,r/m
XOR b,f,r/m
INC AX
PUSH AX
ADD w,f,r/m
ADC w,f,r/m
AND w,f,r/m
XOR w,f,r/m
INC CX
PUSH CX
2
ADD b,t,r/m
ADC b,t,r/m
AND b,t,r/m
XOR b,t,r/m
INC OX
PUSH DX
3
ADD w,t,r/m
ADC w,t,r/m
AND w,t,r/m
XOR w,t,r/m
INC BX
PUSH BX
4
ADD b,ia
ADC b,i
AND b,i
XOR b,i
INC SP
PUSH SP
5
ADD w,ia
ADC w,i
AND w,i
XOR w,i
INC BP
PUSH BP
6
PUSH ES
PUSH SS
SEG =ES
SEG =SS
INC SI
PUSH SI
7 POP ES POP SS DAA
AAA
INC 01 PUSH D1
JO
JNO
JB/
JNAE
Immed Immed Immed
b,r/m
w,r/m b,r/m
NOP
XCHG CX
XCHG DX
MOV mAL
MOV mAL
MOV ALm
MOV iAL
MOV iCL
MOV iDL
RET (i+SP)
Shift b
Shift
W
Shift b,v
LOOPNZ/ LOOPZ/ LOOP LOOPNE LOOPE
LOCK
REP
JNB/ JAE Immed is,r/m XCHG BX MOV ALm MOV i BL RET
Shift w,v JCXZ
REP z
JE/ JZ TEST b,r/m XCHG SP MOVS b MOV iAH LES
AAM
JNE/ JNZ
JBE/ JNA
TEST XCHG w,r/m b,r/m
XCHG XCHG
BP
SI
MOVS CMPS
W
b
MOV MOV iCH iDH
LOS MOV b,i,r/m
AAD
IN
IN
OUT
b
W
b
HLT
CMC Grp 1
b,r/m
JNBE/ JA XCHG w,r/m XCHG DI CMPS
W
MOV iBH MOV w,i,r/m XLAT
OUT
W
Grp 1 w,r/m
b = byte operation
d = direct f = from CPU reg i = immediate ia = immed. to accum. id = indirect is = immed. byte, sign ext. I = long ie. intersegment
m = memory rim = EA is second byte si = short intrasegment sr = segment register t = to CPU reg v = variable W = word operation z = zero
Instruction Set 6-25
8088 Instruction Set Matrix
LO 8
HIo OR
b,f,r/m
SBB b,f,r/m
2 SUB b,f,r/m
3 CMP b,f,r/m
4 DEC AX
5 POP AX
6
9
A
OR w,f,r/m b,t,r/m
SBB
SBB
w,f,r/m b,t,r/m
SUB
SUB
w,f,r/m b,t,r/m
CMP CMP w,f,r/m b,t,r/m
DEC
DEC
CX
DX
POP
POP
CX
DX
B
C
OR
OR
w,t,r/m b,i
SBB
SBB
w,t,r/m b,i
SUB
SUB
w,t,r/m b,i
CMP CMP w,t,r/m b,i
DEC
DEC
BX
SP
POP
POP
BX
SP
D
OR w,i
SBB w,i
SUB w,i
CMP w,i
DEC BP
POP BP
E
PUSH CS
PUSH DS
SEG= CS
SEG= CS
DEC 51
POP SI
F
POP DS DAS
AAS
DEC DI POP DI
7 JS
8 MOV b,f,r/m
9 CBW
A TEST b,i
B MOV iAX
C
D ESC 0
E CALL d
F CLC
JNS
JP/
JPE
JNP/ JPO
JU JNGE
JNU JGE
MOV MOV MOV MOV LEA w,f,r/m b,t,r/m w,t,r/m sr,t,r/m
CWD
CALL I,d
WAIT
PUSHF POPF
TEST w,i
STOS b
STOS w
LODS b
LODS w
MOV iCX
MOV iDX
MOV iBX
MOV i SP
MOV iBP
RET
RET
1,(i+SP) I
INT
INT
Type 3 (Any)
ESC
ESC
ESC
ESC
ESC
1
2
3
4
5
JMP
JMP
JMP
IN
IN
d
I,d
si,d
v,b
v,w
STC
CLI
STI
CLD
STD
JLE/ JNG
JNLE/ JG
MOV POP sr, f,r/m rIm
SAHF LAHF
SCAS b
MOV iSI
INTO
SCAS w
MOV iDI
IRET
ESC 6
OUT v,b
Grp 2 b,r/m
ESC 7
OUT v,w
Grp 2 w,r/m
where:
mod rIm 000 001
Immed
ADD OR
Shift
ROL ROR
Grp 1
TEST -
Grp 2
INC DEC
010
ADC RCL NOT CALL id
011
SBB RCR NEG CALL I,id
100
AND SHL/SAL MUL JMP id
101
SUB SHR IMUL JMP I,id
110
XOR
-
DIV PUSH
111
CMP SAR IDIV
6-26 Instruction Set
~ ~ ~
Mnemonic
AAA AAD AAM AAS ADC ADD AND CALI CBW CLC CLD CLI CMC CMP CMPS CWD DAA DAS DEC DIV ESC F2XM1 FABS FADD FCHS FCLEX FCOM FCOMP FCOMPP FDECSTP FDISI FDIV FENI FFREE FINCSTP FINIT FLD FLD1 FLDCW FLDENV FLDL2E FLD2T FLDLG2 FLDLN2 FLDPI FLDZ FMUL FNOP FPATAN FPREM FPTAN
Instruction Set Index
Page
6-8 6-10
6-9 6-9 6-8 6-8 6-10 6-12 6-10 6-16 6-16 6-16 6-16 6-9 6-11 6-10 6-8 6-9 6-9 6-9 6-16 6-21 6-20 6-19 6-20 6-22 6-19 6-19 6-19 6-23 6-22 6-20 6-22 6-23 6-23 6-22 6-17 6-21 6-22 6-23 6-21 6-21 6-21 6-21 6-21 6-21 6-20 6-23 6-21 6-20 6-21
Mnemonic
FRNDINT FRSTOR FSAVE FSCALE FSQRT FST FSTCW FSTENV FSTP FSTSW FSUB FTST FWAIT FXAM FXCH FXTRACT FYL2X FYL2XP1 HLT IDIV IMUI IN INC INT INTO IRET JA JAE JB JBE JCXZ JE JG JGE JL JLE JMP JNA JNAE JNB JNBE JNE JNG JNGE JNL JNLE JNO JNP JNS JNZ JO
Page
6-20 6-23 6-23 6-20 6-20 6-17 6-22 6-22 6-18 6-22 6-19 6-19 6-23 6-19 6-18 6-20 6-21 6-21 6-16 6-10
6-9 6-7 6-8 6-15 6-15 6-15 6-14 6-14 6-13 6-13 6-14 6-13 6-14 6-13 6-13 6-13 6-12 6-13 6-13 6-14 6-14 6-13 6-13 6-13 6-13 6-14 6-14 6-14 6-14 6-13 6-13
Mnemonic
JP JPE JPO JS JZ LAHF LDS LEA LES LOCK LODS LOOP LOOPE LOOPNE LOOPNZ LOOPZ MOV MOVS MUL NEG NOP NOT OR OUT POP POPF PUSH PUSHF RCL RCR REP RET ROL ROR SAHF SAL SAR SBB SCAS SHL SHR STC STD STI STOS SUB TEST WAIT XCHG XLAT XOR
Page
6-13
6-13
6-14
6-13
6-13
6-7
6-7
6-7
6-7
6-16
6-12
6-14
6-14
6-14
6-14
6-14
6-6
6-11
6-9
6-9
6-16
6-10
6-11
6-7
6-6
6-7
6-6
6-7
6-10
6-10
6-11
6-13
6-10
6-10
6-7
6-10
6-10
6-9
6-11
6-10
6-10
6-16
6-16
6-16
6-12
6-8
6-11
6-16
6-7
6-7
6-11
Instruction Set 6-27
Notes:
6-28 Instruction Set
SECTION7. CHARACTERS, KEYSTROKES, AND COLORS
As Text Attributes
Value
As Characters
Color/Graphics Monitor Adapter
Hex Dec . Symbol Ke,,,,,"u,,,,,,, Modes Background Foreground
IBM Monochrome
Display Adapter
00 0 Blank (Null)
Ctrl2
02 2 03 3 04 4 05 06 6 07 7
··c;J
Ctrl B Ctrl C
·.+..
·
Ctrl D
Ctrl F Ctrl G
08 8
Ctrl H, Backspace,
Shift
Backspace
Black IlCk I
Black Black
Black Black
Black lue
Non-Display
Underline
Cyan Red Magel Brown Light Grey Dark Grey
Normal
Normal
Normal Non-Display
0 09 9
etrl I
Black
Light Blue
High Intensity Underline
OA 10
Ctrl J,
Ctrl~
cJ OB 11 I
OC 12 Q
Ctrl K Ctrl L,
00 13 )\
OE 14
~
V OF 15
Ctrl M·.-J.
Shift.-.J
etrl N
ClrlO
10 16
~
Ctrl P
.... 11 17
etrl Q
12 18 13 19 14 20 15 21 16 17 23
! !!
-crT
§
-1
elrl R Ctrl S Ctrl T etrl U etrl V Ctrl W
Black
Black Black Black
Black Black Blue Blue Blue Blue Blue
Blue Blue
Light Green High Intensity
Light Green High Intensity
Light Red High Intensity
Light Magenta
High Intensity
Yellow
High Intensity
White
High Intensity
Black
Normal
Blue
Underline
Green
Normal
Cyan
Normal
Normal
Magenta
Normal
Brown
Normal
Light Grey Normal
Characters, Keystrokes, and Colors 7-1
As Text Attributes
Value Hex Dec
As Characters Symbol Keystrokes Modes
Color/Graphics Monitor Adapter
Background Foreground
IBM Monochrome
Display Adapter
18 24
I
CtrlX
Blue
Dark Grey High Intensity
19 25
j
Ctrl Y
1A 26
-
Ctrl Z
Blue Blue
Light Blue
High Intensity Underline
Light Green High Intensity
1B 27
Ctrl [,
-
Esc, Shift
Esc, Ctrl
Esc
1C 28
L
Ctrl \
Blue
Light Cyan High Intensity
Blue
Light Red High Intensity
1D 29
Ctrlj
1E 30
.+---+
Ctrl6
Blue Blue
Light Magenta
Yellow
High Intensity High Intensity
1 F 31
~
Ctrl-
Blue
White
High Intensity
20 32 Blank Space
Space Bar, Shift,
Space,
Ctrl Space,
Alt Space
Green
Black
Normal
21 33
!
!
Shift Green
Blue
Underline
22 34
"
"
Shift Green
Green
Normal
23 35
#
#
Shift Green
Cyan
Normal
24 36
$
$
Shift Green
Red
Normal
25 37
%
%
Shift Green
Magenta
Normal
26 38
&
&
Shift Green
Brown
Normal
27 39
Green
Light Grey Normal
28 40
(
(
Shift Green
Dark Grey High Intensity
29 41
)
)
Shift Green
Light Blue High Intensity
Underline
2A 42
Note 1 Green
Light Green High Intensity
28 43
+
+
Shift Green
Light Cyan High Intensity
2C 44 2D 45
Green
Light Red High Intensity
-
Green
Light
High Intensity
Magenta
2E 46
Note 2 Green
Yellow
High Intensity
7-2 Characters, Keystrokes, and Colors
As Text Attributes
Value Hex Dec
As Cha racters Symbol Keystrokes
Modes
Color /Graphics Monitor Adapter
Background Foreground
IBM Monochrome
Display Adapter
2F 47
/
/
Green
White
High Intensity
30 48
0
0
Note 3 Cyan
Black
Normal
31 49
1
1
Note 3 Cyan
Blue
Underline
32 50
2
2
Note 3 Cyan
Green
Normal
33 51
3
3
Note 3 Cyan
Cyan
Normal
34 52
4
4
Note 3 Cyan
Red
Normal
35 53
5
5
Note 3 Cyan
Magenta
Normal
36 54
6
6
Note 3 Cyan
Brown
Normal
37 55
7
7
Note 3 Cyan
Light Grey Normal
38 56
8
8
Note 3 Cyan
Dark Grey High Intensity
39 57
9
9
Note 3 Cyan
Light Blue
High Intensity Underline
3A 58
Shift Cyan
Light Green High Intensity
3B 59
3C 60
<
;
Cyan
<
Shift Cyan
Light Cyan Light Red
High Intensity High Intensity
3D 61
=
3E 62
>
3F 63
?
=
Cyan
>
Shift Cyan
?
Shift Cyan
Light Magenta
Yellow
White
High Intensity
High Intensity High Intensity
40 64
@
@
Shift Red
Black
Normal
41 65
A
A
Note 4 Red
Blue
Underline
42 66
B
B
Note 4 Red
Green
Normal
43 67
C
C
Note 4 Red
Cyan
Normal
44 68
D
D
Note 4 Red
Red
Normal
45 69
E
E
Note 4 Red
Magenta
Normal
46 70
F
F
Note 4 Red
Brown
Normal
47 71
G
G
Note 4 Red
Light Grey Normal
48 72
H
H
Note 4 Red
Dark Grey High Intensity
49 73
I
I
Note 4 Red
Light Blue
High Intensity Underline
4A 74
J
J
Note 4 Red
Light Green High Intensity
Characters, Keystrokes, and Colors 7-3
As Text Attributes
Value Hex Dec
As Characters
Color/Graphics Monitor Adapter
Symbol Keystrokes Modes Background Foreground
IBM Monochrome
Display Adapter
4B 75
K
K
Note 4 Red
Light Cyan High Intensity
4C 76
L
L
Note 4 Red
Light Red High Intensity
4D 77
M
M
Note 4 Red
Light Magenta
High Intensity
4E 78
N
N
Note 4 Red
Yellow
High Intensity
4F 79
0
0
Note 4 Red
White
High Intensity
50 80
P
P
Note 4 Magenta Black
Normal
51 81
Q
Q
Note 4 Magenta Blue
Underline
52 82
R
R
Note 4 Magenta Green
Normal
53 83
S
S
Note 4 Magenta Cyan
Normal
54 84
T
T
Note 4 Magenta Red
Normal
55 85
U
U
Note 4 Magenta Magenta Normal
56 86
V
V
Note 4 Magenta Brown
Normal
57 87
W
W
Note 4 Magenta Light Grey Normal
58 88
X
X
Note 4 Magenta Dark Grey High Intensity
59 89
Y
Y
Note 4 Magenta Light Blue High Intensity
Underline
5A 90
Z
Z
Note 4 Magenta Light Green High Intensity
5B 91
[
[
Magenta Light Cyan High Intensity
5C 92
\
\
Magenta Light Red High Intensity
5D 93
1
1
Magenta
Light Magenta
High Intensity
5E 94
A
A
Shift Magenta Yellow
High Intensity
5F 95
-
-
Shift Magenta White
High Intensity
60 96
Yellow
Black
Normal
61 97
a
a
Note 5 Yellow
Blue
Underline
62 98
b
b
Note 5 Yellow
Green
Normal
63 99
c
c
Note 5 Yellow
Cyan
Normal
64 100 d
d
Note 5 Yellow
Red
Normal
65 101
e
e
Note 5 Yellow
Magenta Normal
66 102
f
f
Note 5 Yellow
Brown
Normal
7-4 Characters, Keystrokes, and Colors
As Text Attributes
Value Hex Dec
As Characters Symbol Keystrokes Modes
Color/ Graphics Monitor Adapter
Background Foreground
IBM Monochrome
Display Adapter
67 103
g
g
Note 5 Yellow
Light Grey Normal
68 104
h
h
Note 5 Yellow
Dark Grey High Intensity
69 105
i
i
Note 5 Yellow
Light Blue High Intensity
Underline
6A 106
j
j
Note 5 Yellow
Light Green High Intensity
6B 107
k
k
Note 5 Yellow
Light Cyan High Intensity
6C 108
I
I
Note 5 Yellow
Light Red High Intensity
6D 109 m
m
Note 5 Yellow
Light
High Intensity
Magenta
6E 110
n
n
Note 5 Yellow
Yellow
High Intensity
6F 111
0
0
Note 5 Yellow
White
High Intensity
70 112
p
p
Note 5 White
Black
Reverse Video
71 113
q
q
Note 5 White
Blue
Underline
72 114
r
r
Note 5 White
Green
Normal
73 115
s
s
Note 5 White
Cyan
Normal
74 116
f
f
Note 5 White
Red
Normal
75 117
u
u
Note 5 White
Magenta Normal
76 118
v
v
Note 5 White
Brown
Normal
77 119 w
w
Note 5 White
Light Grey Normal
78 120
x
x
Note 5 White
Dark Grey Reverse Video
79 121
y
y
Note 5 White
Light Blue High Intensity Underline
7A 122
z
z
Note 5 White
Light Green High Intensity
7B 123
{
7C 124
I I
7D 125
I
- 7E 126
{
Shift White
I I
Shift White
I
Shift White
-
Shift White
Light Cyan Light Red Light Magenta Yellow
High Intensity High Intensity High Intensity
Hig h Intensity
7F 127
/:;.
Ctrl -
White
White
High Intensity
Characters, Keystrokes, and Colors 7-5
As Text Attributes
Value Hex Dec
As Characters Symbol Keystrokes
Modes
ColorIGraphics Monitor Adapter
Background Foreground
IBM Monochrome
Display Adapter
* * * * 80 128
80 to FF Hex are Flashing in both Color & IBM Monochrome * * * *
<;
All 128
Note 6 Black
Black
Non-Display
81 129
U
82 130 e
83 131
a
84 132 a
Alt 129 Alt 130 Alt 131 All 132
Note 6 Note 6 Note 6 Note 6
Black Black Black Black
Blue Green Cyan Red
Underline Normal Normal Normal
85 133
II
86 134 a
Alt 133 Alt 134
Note 6 Note 6
Black Black
Magenta Brown
Normal Normal
87 135
C
88 136 e
89 137 e
8A 138 e
Alt 135 Alt 136 Alt 137
Note 6 Note 6 Note 6
Black Black Black
Alt 138
Note 6 Black
Light Grey Normal Dark Grey Non-Display Light Blue High Intensity
Underline Light Green High Intensity
8B 139
i
Alt 139
Note 6 Black
Light Cyan High Intensity
8C 140
i
Alt 140
Note 6 Black
Light Red High Intensity
80 141
i
Alt 141
Note 6 Black
Light Magenta
High Intensity
8E 142 A
Alt 142
Note 6 Black
Yellow
High Intensity
8F 143 A 90 144 E
Alt 143 Alt 144
Note 6 Note 6
Black Blue
White Black
High Intensity Normal
91 145 ae
Alt 145
Note 6 Blue
Blue
Underline
92 146 t>E.
Alt 146
Note 6 Blue
Green
Normal
93 147 ii
Alt 147
Note 6 Blue
Cyan
Normal
94 148 ii
Alt 148
Note 6 Blue
Red
Normal
95 149 b
Alt 149
Note 6 Blue
Magenta Normal
96 150
U
Alt 150
Note 6 Blue
Brown
Normal
97 151
U
Alt 151
Note 6 Blue
Light Grey Normal
98 152
Y
99 153 ii
Alt 152 Alt 153
Note 6 Note 6
Blue Blue
Dark Grey Light Blue
High Intensity
High Intensity Underline
9A 154 U
Alt 154
Note 6 Blue
Light Green High Intensity
7-6 Characters, Keystrokes, and Colors
As Text Attributes
Value Hex Dec
As Characters Symbol Keystrokes Modes
Color/Graphics Monitor Adapter
Background Foreground
IBM Monochrome
Display Adapter
9B 155
¢
Alt 155
Note 6 Blue
Light Cyan High Intensity
9C 156 £
AI! 156
Note 6 Blue
Light Red High Intensity
9D 157 V-
Alt 157
Note 6 Blue
Light Magenta
High Intensity
9E 158 Pt
Alt 158
Note 6 Blue
Yellow
High Intensity
f SF 159 AO 160 a
Alt 159 Alt 160
Note 6 Note 6
Blue Green
White Black
High Intensity Normal
Al 161
f
Alt 161
Note 6 Green
Blue
Underline
A2 162 6
Alt 162
Note 6 Green
Green
Normal
A3 163 U
A4 164 n A5 165 N
Alt 163 Alt 164 Alt 165
Note 6 Note 6 Note 6
Green Green Green
Cyan Red Magenta
Normal Normal Normal
A6 166 .2.
A7 167 2
A8 168
(.
Alt 166 Alt 167 Alt 168
Note 6 Note 6 Note 6
Green Green Green
Brown Light Grey Dark Grey
Normal Normal High Intensity
AS 169
r-
Alt 169
Note 6 Green
Light Blue High Intensity Underline
AA 170 -,
Alt 170
Note 6 Green
Light Green High Intensity
AB 171
'/2
Alt 171
Note 6 Green
Light Cyan High Intensity
AC 172 V.
Alt 172
Note 6 Green
Light Red High Intensity
AD 173
i
AE 174 « AF 175 »
Alt 173
Note 6 Green
Alt 174 Alt 175
Note 6 Note 6
Green Green
Light Magenta
Yellow
White
High Intensity
High Intensity High Intensity
BO 176 Bl 177 B2 178 B3 179
m
I
Alt 176 Alt 177 Alt 178 Alt 179
Note 6 Note 6 Note 6 Note 6
Cyan Cyan Cyan Cyan
Black Blue Green Cyan
Normal Underline Normal Normal
84 180 rB5 181 ~ B6 182 -ll
Alt 180 Alt 181 Alt 182
Note 6 Note 6 Note 6
Cyan Cyan Cyan
Red Magenta Brown
Normal Normal Normal
Characters, Keystrokes, and Colors 7-7
As Text Attributes
Value Hex Dec
As Characters
Color/Graphics Monitor Adapter
Symbol Keystrokes Modes Background Foreground
IBM Monochrome
Display Adapter
B7 183 "-"Il
p - B8 184 ===I
B9 185
h
BA 186
BB 187 ~
P I BC 188
OJ BD 189
Alt 183 Alt 184 Alt 185
Alt 186 Alt 187 Alt 188 Alt 189
B BE 190
Alt 190
BF 191
h -c= CO 192
Alt 191 Alt 192
Note 6 Cyan Note 6 Cyan Note 6 Cyan
Note 6 Cyan Note 6 Cyan Note 6 Cyan Note 6 Cyan
Note 6 Cyan Note 6 Cyan Note 6 Red
Light Grey Normal
Dark Grey High Intensity
Light Blue High Intensity Underline
Light Green High Intensity
Light Cyan High Intensity
Light Red High Intensity
Light Magenta
High Intensity
Yellow
High Intensity
White
High Intensity
Black
Normal
C1 193
Alt 193
Note 6 Red
Blue
Underline
C2 194
F C3 195
C4 196
Alt 194 Alt 195 Alt 196
Note 6 Red Note 6 Red Note 6 Red
Green Cyan Red
Normal Normal Normal
C5 197
Alt 197
Note 6 Red
Magenta
Normal
C6 198 C7 199 C8 200
I
I~
1.=
Alt 198 Alt 199 Alt 200
Note 6 Red Note 6 Red Note 6 Red
Brown Light Grey Dark Grey
Normal Normal High Intensity
rr== C9 201
Alt 201
CA 202 I-JL Alt 202
Note 6 Red Note 6 Red
Light Blue High Intensity Underline
Light Green High Intensity
CB 203 F=lt==
TS CC 204
CD 205
Alt 203 Alt 204 Alt 205
CE 206 ~~
CF 207
T DO 208
Alt 206 Alt 207 Alt 208
Note 6 Red Note 6 Red Note 6 Red
Note 6 Red Note 6 Red Note 6 Magenta
Light Cyan Light Red Light Magenta Yellow White Black
High Intensity High Intensity High Intensity
High Intensity High Intensity Normal
7-8 Characters, Keystrokes, and Colors
As Text Attributes
Value Hex IDee D1 1209
As Characters
Symbol
,.... Modes
Alt 209
Note 6
ColorIGraphics Monitor Adapter
.
Background Foreground ,alj",,,a Blue
IBM Monochrome
Display Adapter
Undel
D2 210 D3 211
D4 [212
~
E:
Alt 210 Alt 211 Alt 212
Note 6 Magenta Note 6 Magenta Not;6 ~ ,alj'" "a
Green Cyan Red
Normal
Normal
Normal
D5 213 D6 1214 D7 215
F=
rT
Alt 213 214
Alt 215
Note 6 Magenta 6 Magel
Note 6 Magenta
Magenta Light Grey
Normal I
Normal
D8 216
Alt 216
Note 6 Magenta
Dark Grey High Intensity
D9 217
f-
Alt 217
Note 6 Magenta
Light Blue High Intensity Underline
DA 218
Alt 218
Note 6 Magenta
Light Green High Intensity
DB 219
219
Note 6 Magenta
Light
High Intensity
DC 220
Alt 2
,6
High nsity
DD 221
Alt 221
Note 6 Magenta
Light Magenta
High Intensity
DE 222
Alt 222
Note 6 Magenta
Yellow
High Intensity
DF 223
Alt 223
Note 6 Magenta White
High Intensity
EO 1224
Alt 224
6
Norma
E1 225 f3 E2 226 r
Alt 225 Alt 226
Note 6 Yellow Note 6 Yellow
Blue Green
Underline Normal
E3 1227
7T
227
Note 6 Yellow
Cya
Normal
E4 1228
~
E5 229
(J
Alt 228
Ail 229
Note 6 Yellow Note 6 Yellow
Red Magenta
Normal
Normal
1230
11
E7 [231
Alt 230 1231
Note 6 Yellow ,6
Brown
Normal
E8 232
<I>
1232
Note 6 Yellow
Dark Grey High Intensity
E9 233
(J
Alt 233
Note 6 Yellow
Light Blue High Intensity Underline
EA 234
fl
234
Note 6 Yellow
Light Green High Intensity
EB 235
f,
Alt 235
Note 6 Yellow
Light Cyan High Intensity
Characters, Keystrokes, and Colors 7-9
As Text Attributes
Value Hex Dec
As Characters Symbol Keystrokes
Modes
Color/ Graphics Monitor Adapter
Background Foreground
IBM Monochrome
Display Adapter
EC 236
00
Alt 236
Note 6 Yellow
Light Red High Intensity
ED 237
<I>
Alt 237
Note 6 Yellow
Light Magenta
High Intensity
EE 238
·
EF 239 n
Alt 238 Alt 239
Note 6 Yellow Note 6 Yellow
Yellow White
High Intensity High Intensity
FO 240 -
Alt 240
Note 6 White
Black
Reverse Video
F1 241
±
Alt 241
Note 6 White
Blue
Underline
F2 242 2-
F3 243 :s
F4 244
r
J F5 245
Alt 242 Alt 243 Alt 244 Alt 245
Note 6 White Note 6 White Note 6 White Note 6 White
Green Cyan Red Magenta
Normal Normal Normal Normal
F6 246
Alt 246
Note 6 White
Brown
Normal
F7 247 =
Alt 247
Note 6 White
Light Grey Normal
F8 248
0
· F9 249
FA 250
·
FB 251
r
Alt 248 Alt 249
Alt 250 Alt 251
Note 6 White Note 6 White
Note 6 White Note 6 White
Dark Grey Reverse Video
Light Blue
High Intensity Underline
Light Green High Intensity
Light Cyan High Intensity
FC 252
'7
FD 253
2
Alt 252 Alt 253
· FE 254
FF 255 BLANK
Alt 254 Alt 255
Note 6 White Note 6 White
Note 6 White Note 6 White
Light Red Light Magenta Yellow White
High Intensity High Intensity
High Intensity High Intensity
7-10 Characters, Keystrokes, and Colors
NOTE 1
I I Asterisk (*) can easily be keyed using two methods:
1) hit the Prt. Sc key or 2) in shift mode hit the
~key.
~
NOTE 2
Period (.) can easily be keyed using two methods:
1) hit theW key or 2) in shift or Num Lock
I mode hit the Dell key.
NOTE 3
Numeric characters (0-9) can easily be keyed using two methods: 1) hit the numeric keys on the top row of the typewriter portion of the keyboard or 2) in shift or Num Lock mode hit the numeric keys in the 1O-key pad portion of the keyboard.
NOTE 4
Upper case alphabetic characters (A-Z) can easily be keyed in two modes: 1) in shift mode the appropriate alphabetic key or 2) in Caps Lock mode hit the appropriate alphabetic key.
NOTE 5
Lower case alphabetic characters (a-z) can easily be keyed in two modes: 1) in "normal" mode hit the appropriate key or 2) in Caps Lock combined with shift mode hit the appropriate alphabetic key.
NOTE 6
The 3 digits after the Alt key must be typed from the numeric key pad (keys 71-73. 75-77,79-82). Character codes 000 through 255 can be entered in this fashion. (With Caps Lock activated, Character codes 97 through 122 will display upper case rather than lower case alphabetic characters.)
Characters, Keystrokes, and Colors 7-11
Character Set (OO-7F) Quick Reference
· lvD,ECIMAL
0
16 32 48 64 80 96 112
·
HEXA DECIMAL VALUE
0
0
0
BLANK (NULL)
...1 2 BLANK (SPACE)
3 4
0 @
5
p
6
,
7
P
1
1 g
.....
I
·
1AQa q
·+ " 2 2 @) t I I 2 B R b r
3 3
.. =#= 3 C S c s
4 4 crT $ 4 D T d t
· - 5 5 ~ § <JIo 5 E U e u
6 7
6 7
·
t
& ,
6 FV 7 GW
f g
v
W
8 8
i ( 8HX h x
9
9 0
1
)
9
I
Y
·
1 .
Y
10 A
---+
+* I I B d' +-
·
·
J Z J
z
,· K [ k {
" 12 C Q L , < L
1 I I
13 D } - +---+ - M ] m }
14 E ~ ~ · > N /\ n rv
15 F -¢ T /
?
·
0
-
0 6
7-12 Characters, Keystrokes, and Colors
Character Set (80-FF) Quick Reference
It DECIMAL
VALUE
128 144 160 176 192 208 224 240
·
0
HEXA DECIMAL VALUE
0
8
c;
E9 A,
a ,
I
2 3
I
2 3
··
U ,
e
~
.E
IE
A
0
1 , 0 ,
U
BC0 E
······..........
I ex::
n..:·.::...:.:.:.-..:
fJ
I ! r-'
r-- lL 1T
F
+ -> -<
4 4 5 5
6 6
7 7 8 8
9 9
10 A
N , , a··
··
0
n~ -
a 0
=
bL (
F a J
0
1\
I
a a --t I
u,
. Y F= -
-0
~ U 0 =n
T
-..." -..."
e y A
··
0
(, ='1
Q 0
e·,·
e
0··
··
U
I bJ
----,
r 1L
e ·
n ·
II B
12 c
13 0
·1· ¢
1, £
1 ¥
Y2 =r f--
,~ 2
· ----1J
0 -r
n 00
cP 2
14 E A R « d ~
E I
A 15 F
f' » II
n
BLANK 'FF'
Characters, Keystrokes, and Colors 7-13
Notes:
7-14 Characters, Keystrokes, and Colors
SECTION 8. COMMUNICATIONS
Contents
Communications
8-3
Establishing a Communications Link ....·...........·... 8-5
Establishing Link. on Nonswitched Point-to-Point Line ...... 8-6
Establishing Link on Nonswitched Multipoint Line ......... 8-8
Establishing Link on Switched Point-to-Point Line ......· 8-10
Communications 8-1
8-2 Communications
Information processing equipment used for communications is called data terminal equipment (DTE). Equipment used to connect the DTE to the communications line is called data communications equipment (DCE).
An adapter is used to connect the data terminal equipment to the data communications line as shown in the following illustration:
Data Terminal Equipment
Data Communications Equipment
Communications Line
EIA/CCITT Adapter
Cable Conforming to EIA or CCITT Standards
Z
Voice Line
Modem Clock
The EIAI CCITT adapter allows data terminal equipment to be connected to data communications equipment using EIA or CCITT standardized connections. An external modem is shown in this example; however, other types of data communications equipment can also be connected to data terminal equipment using EIA or CCITT standardized connections.
EIA standards are labeled RS-x (Recommended Standards-x) and CCITT standards are labeled V.x or X.x, where x is the number of the standard.
The EIA RS-232 interface standard defines the connector type, pin numbers, line names, and signal levels used to connect data terminal equipment to data communications equipment for the purpose of transmitting and receiving data. Since the RS-232 standard was developed, it has been revised three times. The three revised standards are the RS-232A, the RS-232B, and the presently used RS-232C.
The CCITT V.24 interface standard is equivalent to the RS-232C standard; therefore, the descriptions of the EIA standards also apply to the CCITT standards.
Communications 8-3
The following is an illustration of data terminal equipment connected to an external modem using connections defined by the RS-232C interface standard:
Data
Terminal
Equipment
Communications
Line
/ //
/"/
---:;;::''''''==-------
..........
" ' ......
// Adapter /// Cable Conforming '"
/ / ,/. / /
, To RS-232C Standards ....................".......
/
,
"
"'" ,
/
/EIA/CCITT
Telephone Co.
"
Line Number
Lead Number
Protective Ground
0-AA/101
Signal Ground
@-AB/102
Transmitted Data
@--BA/103
Received Data Request to Send Clear to Send
®--BB/104
0 - CAl 105 ®- CB/1 06
Data
Terminal
Equip
ment
Data Set Ready
@-CC/107
Data Terminal Ready
&-CD/10B.2
------&- .. Connect Data Set to Line
11 OB.1
Received Line Signal Detector 8 CF 1109
Modem
Speed Select
Transmit Signal Element Timing ~ DB/114
Receive Signal Element Timing ~ 00/115
Select Standby
@- H 1116
Ring Indicator
@- DE/125
Test
~**/H'
I External Modem Cable Connector
°I 131211109 8 7 6 5 4 3 2 1
rOO 0 0 0 0 0 0 0 0 0 o.
\,ooooooooooooj
2524 232221 20 1918 171615 14
L _ _ _ .Data Termi.nal . _ _ _ +(MOdDeatm a CIoDmCmEunications----l
I
EqUIpment
Equipment
'I
Pin Number
* Not used when business machine clocking is used_ * * Not standardized by EIA (Electronic Industries Association)_
* * * Not standardized by CCITT
8-4 Communications
Establishing a Communications Link
The following bar graphs represent normal timing sequences of operation during the establishment of communications for both switched (dial-up) and nonswitched (direct line) networks.
Switched Timing Sequence
Data Terminal Ready
~r--------------------------------
Data Set Ready
Request to Send Clear to Send
---------'------------~~
Transmitted Data
Nonswitched Timing Sequence
Data Terminal Ready
~r--------------------------------
Data Set Ready Request to Send Clear to Send
~r-----------------------------
------~----------------~~
______~-------------.L
Transmitted Data
The following examples show how a link is established on a nonswitched point-to-point line, a nonswitched multipoint line, and a switched point-to-point line.
Communications 8-5
CIC I
~
~
~
S.
&$
~
§
[Il
Establishing a link on a Nonswitched Point-to-Point line
1. The terminals at both locations activate the 'data terminal ready'
D. lineslland I I 2. Normally the 'data set ready' lines. and from the modems are
active whenever the modems are powered on.
3. Terminal A activates the 'request to send' line, which causes the
modem at terminal A to generate a carrier signal.
l1li. 4. Modem B detects the carrier, and activates the 'received line signal detector' line (sometimes called data carrier detect) Modem B
also activates the 'receiver signal element timing' line (sometimes
lito called receive clock)
send receive clock signals to the terminal.
Some modems activate the clock signals whenever the modem is
powered on.
S. After a specified delay, modem A activates the 'clear to send' line. which indicates to terminal A that the modem is ready to
transmit data.
6. Terminal A serializes the data to be transmitted (through the serdes)
and transmits the data one bit at a time (synchronized by the
lito transmit clock) onto the 'transmitted data' line
the modem.
7. The modem modulates the carrier signal with the data and transmits
II. it to the modem B
lEI. 8. Modem B demodulates the data from the carrier signal and sends it to terminal B on the 'received data' line
9. Terminal B deserializes the data (through the serdes) using the receive clock signals (on the 'receiver signal element timing'
I I line) from the modem.
10. After terminal A completes its transmission, it deactivates the
II, 'request to send' line which causes the modem to turn off the II. carrier and deactivate the 'clear to send' line
11. Terminal A and modem A now become receivers and wait for a response from terminal B, indicating that all data has reached terminal B. Modem A begins an echo delay (SO to 1S0 milliseconds) to ensure that all echoes on the line have diminished before it begins receiving. An echo is a reflection of the transmitted signal. If the transmitting modem changed to receive too soon, it could receive a reflection (echo) of the signal it just transmitted.
12. Modem B deactivates the 'received line signal detector' linelland,
II. if necessary, deactivates the receive clock signals on the 'receiver
signal element timing, line
13. Terminal B now becomes the transmitter to respond to the request from terminal A. To transmit data, terminal B activates the 'request to send' line., which causes modem B to transmit a carrier to modemA.
14. Modem B begins a delay that is longer than the echo delay at modem A before turning on the 'clear to send' line. The longer delay (called request-to-send delay) ensures that modem A is ready to receive when terminal B begins transmitting data. After the delay, modem B activates the 'clear to send' line lito indicate that terminal B can begin transmitting its response.
1S. After the echo delay at modem A, modem A senses the carrier from modem B (the carrier was activated in step 13 when terminal B activated the 'request to send' line) and activates the 'received line signal detector; lineD to terminal A.
16. Modem A and terminal A are ready to receive the response from termianl B. Remember, the response was not transmitted until after the request-to-send to clear-to-send delay at modem B (step 14).
)
)
)
n
~
ess.·
~
QC I -..I
)
)
Tre,r:m.i=nal=A====:::;-]
II
II Communications
I I Adapte,
II
Modem A
II
r
I I
iC I
II
II IS
II
I0 I
I n
1t I
Ir I 01
II
: I
L J
II
-
II
I'
, :
I II
IIII
III
r,
I, _~' I
I I 1 I
Se II
"I=~:
1I1--~==1el
1_
s I
-r IIL_ LJ
II
II
D r-----,
Data Terminal Ready
Data Set Readv II II
Request to Send
I Power I
~_5~~,,- J r - - --, Carrier I
III
Clear to Send
II
r~. iI -Ge-nera_te---1I
, r-----,
a 0 I I Transmit
I e I I Circuits
i I --:r,J I
L_
II II Transmitt~r~ignal
Ia I
Iyl'
L_J
I 0 III
Id '
r------,: u :
ElementTlmmg
Modem I II I
Transmitted Data
I Clock I I a I
L _ _ _ _ ...J I t I
D
I~~ 0 J:
II II
R~ceived Line
t-- r - - - - -,
I Echo
I L
-;:== Delav
__
__
-,
I I S.gnal Detector II
r Receive i"4
~_C~c~its
1III
Receiver Signal Element Timing
r -;'.:de1 ~l ]
I L
Clock ____
~ I
II
r----- --,
I I
I Demodulato, I
L ___ ----'
II Ii
II
Received Data
II
II
t.::======~
)
Communications line
~
Tre;rm:in=al B=====ll
II
II Communications
Modem B
Adapter
II I
II
L_, __ iii r-----,
I Power I
II IOata Terminal Read
I Supply I
J
Data Set ReadyD
II
~-; :rC-:'
J0 I
In I
it: 5 I
]____ r--R~-c-ei.:v.e., i CirCUits I I .J
Received Line
I
Signal DetectorllD
1'1 10 I II :
· I o I , II
Receive, Si~~al
L_J
a I
g I
J rlo-dM-em -,
I Clock
Element TimingDJ
II
e I
I I
L____ IBReceived
i ;~:_d~;O~-' Data
I
I
L _ _ _ _ _ _ _ ..J
11
_____,
Echo I
II
L
Delav ____
..JI
I I ret
Request to Send_
I ___:rD, e I I' I
L ___ -1 I a i
r '=-':J Modem'"
Clear to Send
II I I
T'ansmitte, Signal Element Timing
I Clock I
II
r~-'
L ____ -'
I I
r ------,
I Modulato, I
L ___ ----'
IIII
II II II
Transmitted Data
:5 I
II ,e
ill II II
Id
III
,e
III
I s
I
LJ _JII
II
II
II
t..===== :J
BUO!l:Jas
QC I
Establishing a link on a Nonswitched Multipoint line
QC
~
1. The control station serializes the address for the tributary or
6. After a short delay to allow the control station modem to receive
~
secondary station (AA) and sends its address to the modem on the 'transmitted data'lineD.
II. the carrier, the tributary modem activates the 'clear to send'
line
S.
:.s~...;·.
6l
II, 2. Since the 'request to send' line and, therefore, the modem carrier, is active continuously the modem immediately modulates the carrier with the address, and, thus, the address is transmitted to all modems on the line.
3. All tributary modems, including the modem for station A,
7. When station A detects the active 'clear to send' line, it transmits
II.) its response. (For this example, assume that station A has no data
to send; therefore, it transmits an EaT
8. After transmitting the EaT, station A deactivates the 'request to
II. send' line This causes the modem to deactivate the carrier and
demodulate the address and send it to their terminals on the
II. the 'clear to send' line
'received data' linell. 4. Only station A responds to the address; the other stations ignore
9. When the modem at the control station (host) detects the absence of the carrier, it deactivates the 'received line Signal detector'
the address and continue monitoring their 'received data'line. To
II, respond to the poll, station A activates its 'request to send' line
which causes the modem to begin transmitting a carrier signal.
lineEl·
10. Tributary station A is now in receive mode waiting for the next poll or select transmission from the control station.
5. The control station's modem receives the carrier and activates the
I I 'received line signal detector' line Eland the 'receiver signal
element timing' line (to send clock signals to the control station).
Some modems activate the clock signals as soon as they are
powered on.
)
)
)
)
)
)
rH;o:st.=======j]
Tributary or Secondary Station A
Tre;rm:=inal=-====ll
I
II Communications
I
Adapter
r-
II
I
r-'
Data Terminal Ready 1
Host Modem
r- - - -..,
I Power I
I
: C I Data Set Ready'
L_~ __J
I IIrS II ,
1I
0
"
I
:'r I
10:
D
Request to Send'
II II
r -C-arr-ier- - 'I
I I I _G_o_no_,._'e ....J , ____
I1I '0
LI I I
Clear to Send1 I I
r0 I r
..,
I e I : Transmit
II 0
19
-"
II
II 0
II
II I II L----IJ
Ia I
,VI
Ml
I
II
L_"
:0 :
Communications line
AA
~
Modem
r----'
I Power I
I On
I
L-T--.J
1----"_____
r
1
Receiver I
L
L 1 rlo-d M-e-m -,
:,,:~c:'_J
II
II Communications
II
Adapter
Data Terminal
Ready' II II
Data Set Ready 1
IIII
Received Line Signa Detector 1
" Receiver Signal
Element Timingl
1r-c:'
I0 I lII ,n III 1I '0I1II
L_JI
r'SI t I o, II a I I9 I e
III II
I I
Md --, I Transmitter Signal
Element Timingl
Id I
rI CI~c:m
::I ~UI
r - - - - - -..., Received Data
I
I Demodulator L _______ .J
II
I
I
liD AA ' - - - - - - ' I, I
II
II II
Transmitted Data
II
I0 : ~-f.J
r--:--'
I Carrier ,. ..
...
II
.:.
Requo.lto Send I
~
1111
Received Line Signal Detector
o !!
Receiver Signal Element Timing1
-' r-----,
.:i _L_~_:i:J'
1 r Modem
~
.I~--G-e-n-e-,-at_-e..
!" .,J
r~'
I I
0 ~
I
: LIT'~ :r~mM~oJd_e'=m.._~.'1I!
D
II
Cle t S nd ar 0 e
I:
Transmitter Signal
Element Timing
~
AI~t,I
II
S I
II
IL _C_lo_ck_ ..JI
,------ -,
IL _C_loc_k _.JI r ------,
II
II
+ r ......,AA
I I
I I
IS
II : I
51.
~
i
I,
II , I : IL_ I
~:
II
: :
II
s :
II
L J
II
[Received Data
L_~~od~~r_J
L_~~u~~_J
II
II ,·
: I
II
Id
: I
II
D
II
: 0
I Ls f
: I
_J II
EOT
Transmitted Data
II
QO I
I.C
-= =-=::J 1:_-_--=
II
'These lines are active continuously.
II
II
~=======..!
B UO!paS
=Q.I.C..
~
~
§.
Establishing a Link on a Switched Point-To-Point Line
1.
.is Terminal A is in communications mode; therefore, the 'data
terminal ready' line
active. Terminal B is in communication
a. 8. The autoanswer circuits in modem B activate the 'off hook' line to the coupler
mode waiting for a call from terminal A.
II. 2. When the terminal A operator lifts the telephone handset, the 'switch hook' line from the coupler is activated
9. The coupler connects modem B to the communications line through
III the 'data tip' and 'data ring' lines and activates the 'coupler cut
lito through' line
the modem. Modem B then transmits an
g../~.')..
3 . Modem A detects the 'switch hook' line and activates the 'off hook' line., which causes the coupler to connect the telephone
answer tone to terminal A. 10. The terminal A operator hears the tone and sets the exclusion key
(I.l
8to set to the line and activate the' coupler cut-through' line
the
or talk/data switch to the data position (or performs an equivalent
modem.
lito 4. Modem A activates the 'data modem ready' line
the coupler
(the 'data modem ready' line is on continuously in some modems).
II. operation) to connect modem A to the communications line
through the 'data tip' and 'data ring' lines
II. 11. The coupler at terminal A deactivates the 'switch hook' line
5. The terminal A operator sets the exclusion key or talk/data switch
to the talk position to connect the handset to the communications line. The operator then dials the terminal B number.
This causes modem A to activate the 'data set ready' lineD indicating to terminal A that the modem is connected to the communications line.
6. When the telephone at terminal B rings, the coupler activates the
1m . 'ring indicate' line to modem B Modem B indicates that the
'ring indicate' line was activated by activating the 'ring indicator'
lito line
terminal B.
7. Terminal B activates the' data terminal ready' line to modem Bill
The sequence of the remaining steps to establish the data link is the same as the sequence required on a nonswitched point·to point line. When the terminals have completed their transmission, they both deactivate the 'data terminal ready' line to disconnect the modems from the line.
which activates the autoanswer circuits in modem B. (The 'data
terminal ready' line might already be active in some terminals.)
)
)
)
)
)
)
rTe;r:m=in=al A=====il
II
II
Communications II
. - - Adapter
II
Modem A
II II II
rt:l--- Ie' II
D
Data Terminal
I: 0 I lDIfeaatadSy et
fJ
i c;r;Je7-i -It~ I Generate I
II: 5
n Ready I t 1 Request to Send
r-, 0 I
r , I MI
III t III 0
I,
III a
r
1T
: 0 I Clear to Send
I
LJ
II
Ie I " :
I'0 I d I
Ia I I I y I I)
.. CBS Coupler ..-- Switch Hook
ISH I
..
Coupler ..
Cut-Through
ICCT)
iii
Data Modem
CBS Coupler
Modem B
Tre;rm:=ina=l B===="
II
Communications II
II Adapte,
II
Switch Hook
(SH)
Off Hook D
IOH)
__ , _
I II
Cut-Through
ICCT) Data Modem
m rAl r-An-;;;;rl
II
Iu II Tone I Data Terminal
IL- ___ J -Ready
:t I
D.t. Set Ready
I0 I Ia I
! I n I
: S
r ' Received Line
!1. I 0 I 5i nal Detector
I I I m I Ring Indicate"
IWI
10 I
lei
Id l
II
rC1
II II
I _ I
I 0
II
j I
n I ti
III S I
I ' I I II
I 0 I
0 : II
LIJ
' I
-
alii
III 9 III e
II
II
II II
II
II II
Transmit Data
1/ II
L_J
I I Re.dy IDA)
r-'
I I
I R:
: I
:e I
I I I:
IJ
Data Tip lOT)
I II I
I a
I r
Data
y I
L.r Data Ring fOR)
L:J
r-l Ready IDA)
I, I
:I ~RII
II
a I
Ring
lID
IndiealelR) III
Data Tip lOT)
L_J
IL~yJ
Data Data Ring lOR)
I:
II
: I
II
II II 10
. II
ReceIved Data
' I
II
_J
II
gill
1
Ie : II II IIII II
II
II
II
1/
1/
1/
II
II
,..--,
IE CI
Ic I I I
) h a
I1L0__mpJil
II
II
II
I"
II
III
"II
IIIIII
n o
§
§.
e.
Jr-, !: , I d I e I LLs I
L_
II
II
II
II II II
II
Transmit Clock
..
II
l!:======~
r-Mod;mj
IL _C_lo_ck_ .JI
i
r~"~d;;'l
IL _ Clo_ck_ .....J,
"
II
r '
II
I SI
II
I ~
II
Id
II
I e
II
L· J
Receive Clock
:11
III III
III
: II
_JIII
II
II
II
II
~======:!J
~.
Communications Line
..QI..O
..
B UO!l:J3S
Notes:
8-12 Communications
Glossary
fL. Prefix micro; 0.000001. fLS. Microsecond; 0.000 001 second. A. Ampere.
ac. Alternating current. accumulator. A register in which the result of an operation is formed. active high. Designates a signal that has to go high to produce an effect. Synonymous with positive true. active low. Designates a signal that has to go low to produce an ~ effect. Synonymous with negative true. adapter. An auxiliary device or unit used to extend the operation of another system. address bus. One or more conductors used to carry the binary-coded address from the processor throughout the rest of the system. algorithm. A finite set of well-defined rules for the solution of a problem in a finite number of steps. aU points addressable (APA). A mode in which all points of a displayable image can be controlled by the user. alphameric. Synonym for alphanumeric. alphanumeric (A/N). Pertaining to a character set that contains letters, digits, and usually other characters, such as punctuation marks. Synonymous with alphameric.
Glossary-l
alternating current (ac). A current that periodically reverses its direction of flow.
American National Standard Code for Information Exchange
(ASCII). The standard code, using a coded character set
consisting of 7-bit coded characters (8 bits including parity
~
check), used for information exchange between data processing
systems, data communication systems, and associated equipment.
The ASCII set consists of control characters and graphic
characters.
ampere (A). The basic unit of electric current.
A/N. Alphanumeric
analog. (1) Pertaining to data in the form of continuously variable physical quantities. (2) Contrast with digital.
AND. A logic operator having the property that if P is a statement, Q is a statement, R is a statement,... , then the AND of P, Q, R, ...is true if all statements are true, false if any statement is false.
AND gate. A logic gate in which the output is 1 only if all inputs are 1.
AND operation. The boolean operation whose result has the boolean value 1, if and only if, each operand has the boolean value 1. Synonymous with conjunction.
APA. All points addressable.
ASCII. American National Standard Code for Information Exchange.
assemble. To translate a program expressed in an assembler language into a computer language.
Glossary-2
assembler. A computer program used to assemble.
assembler language. A computer-oriented language whose instructions are usually in one-to-one correspondence with computer instructions.
/"""""'\ asynchronous transmission. (1) Transmission in which the time of occurrence of the start of each character, or block of characters, is arbitrary; once started, the time of occurrence of each signal representing a bit within a character, or block, has the same relationship to significant instants of a fixed time frame. (2) Transmission in which each information character is individually transmitted (usually timed by the use of start elements and stop elements).
audio frequencies. Frequencies that can be heard by the human ear (approximately 15 hertz to 20000 hertz).
auxiliary storage. (1) A storage device that is not main storage. (2) Data storage other than main storage; for example, storage on magnetic disk. (3) Contrast with main storage.
BASIC. Beginner's all-purpose symbolic instruction code.
basic input/output system (BIOS). The feature of the IBM Personal Computer that provides the level control of the major I/O devices, and relieves the programmer from concern about hardware device characteristics.
"...-..."
baud. (1) A unit of signaling speed equal to the number of discrete conditions or signal events per second. For example, one baud equals one bit per second in a train of binary signals, one-half dot cycle per second in Morse code, and one 3-bit value per second in a train of signals each of which can assume one of eight different states. (2) In asynchronous transmission, the unit of modulation rate corresponding to one unit of interval per second; that is, if the duration of the unit interval is 20 milliseconds, the modulation rate is 50 baud.
BCC. Block-check character.
Glossary-3
beginner's all-purpose symbolic instruction code (BASIC). A programming language with a small repertoire of commands and a simple syntax, primarily designed for numeric applications.
binary. (1) Pertaining to a selection, choice, or condition that has
two possible values or states. (2) Pertaining to a fixed radix
numeration system having a radix of 2.
~
binary digit. (1) In binary notation, either of the characters 0 or 1. (2) Synonymous with bit.
binary notation. Any notation that uses two different characters, usually the binary digits 0 and 1.
binary synchronous communications (BSC). A uniform procedure, using a standardized set of control characters and control character sequences for synchronous transmission of binary-coded data between stations.
BIOS. Basic input/output system.
bit. Synonym for binary digit
bits per second (bps). A unit of measurement representing the number of discrete binary digits transmitted by a device in one second.
block. (1) A string of records, a string of words, or a character string formed for technical or logic reasons to be treated as an entity. (2) A set of things, such as words, characters, or digits, treated as a unit.
block-check character (BCC). In cyclic redundancy checking, a character that is transmitted by the sender after each message block and is compared with a block-check character computed by the receiver to determine if the transmission was successful.
boolean operation. (1) Any operation in which each of the
~
operands and the result take one of two values. (2) An operation
that follows the rules of boolean algebra.
Glossary-4
bootstrap. A technique or device designed to bring itself into a desired state by means of its own action; for example, a machine routine whose first few instructions are sufficient to bring the rest of itself into the computer from an input device.
bps. Bits per second.
~
BSC. Binary synchronous communications.
buffer. (1) An area of storage that is temporarily reserved for use in performing an input/output operation, into which data is read or from which data is written. Synonymous with I/O area. (2) A portion of storage for temporarily holding input or output data.
bus. One or more conductors used for transmitting signals or power.
byte. (1) A sequence of eight adjacent binary digits that are operated upon as a unit. (2) A binary character operated upon as a unit. (3) The representation of a character.
C. Celsius.
capacitor. An electronic circuit component that stores an electric charge.
CAS. Column address strobe.
cathode ray tube (CRT). A vacuum tube in which a stream of electrons is projected onto a fluorescent screen producing a luminous spot. The location of the spot can be controlled. cathode ray tube display (CRT display). (1) A CRT used for displaying data. For example, the electron beam can be controlled to form alphanumeric data by use of a dot matrix. (2) The data display produced by the device as in (1).
Glossary-S
CCITT. International Telegraph and Telephone Consultative Committee.
Celsius (C). A temperature scale. Contrast with Fahrenheit (F).
central processing unit (CPU). Term for processing unit.
channel. A path along which signals can be sent; for example, data channel, output channel.
character generator. (1) In computer graphics, a functional unit that converts the coded representation of a graphic character into the shape of the character for display. (2) In word processing, the means within equipment for generating visual characters or symbols from coded data.
character set. (1) A finite set of different characters upon which agreement has been reached and that is considered complete for some purpose. (2) A set of unique representations called characters. (3) A defined collection of characters.
characters per second (cps). A standard unit of measurement for r"., the speed at which a printer prints.
check key. A group of characters, derived from and appended to a data item, that can be used to detect errors in the data item during processing.
closed circuit. A continuous unbroken circuit; that is, one in which current can flow. Contrast with open circuit.
CMOS. Complementary metal oxide semiconductor.
code. (1) A set of unambiguous rules specifying the manner in which data may be represented in a discrete form. Synonymous with coding scheme. (2) A set of items, such as abbreviations, representing the members of another set. (3) To represent data or a computer program in a symbolic form that can be accepted by a data processor. (4) Loosely, one or more computer programs, or part of a computer program.
Glossary-6
coding scheme. Synonym for code.
collector. An element in a transistor toward which current flows.
column address strobe (CAS). A signal that latches the column addresses in a memory chip.
compile. (1) To translate a computer program expressed in a problem-oriented language into a computer-oriented language. (2) To prepare a machine-language program from a computer program written in another programming language by making use of the overall logic structure of the program, or generating more than one computer instruction for each symbolic statement, or both, as well as performing the function of an assembler.
complementary metal oxide semiconductor (CMOS). A logic circuit family that uses very little power. It works with a wide . range of power supply voltages.
computer. A functional unit that can perform substantial computation, including numerous arithmetic operations or logic operations, without intervention by a human operator during a run.
computer instruction code. A code used to represent the instructions in an instruction set. Synonymous with machine code.
computer program. A sequence of instructions suitable for processing by a computer.
computer word. A word stored in one computer location and capable of being treated as a unit.
configuration. (1) The arrangement of a computer system or network as defined by the nature, number, and the chief characteristics of its functional units. More specifically, the term configuration may refer to a hardware configuration or a software configuration. (2) The devices and programs that make up a system, subsystem, or network.
conjunction. Synonym for AND operation.
Glossary-7
contiguous. Touching or joining at the edge or boundary; adjacent.
control character. A character whose occurrence in a particular context initiates, modifies, or stops a control operation.
control operation. An action that affects the recording, processing, transmission, or interpretation of data; for example, starting or stopping a process, carriage return, font change, rewind, and end of transmission.
control storage. A portion of storage that contains microcode.
cps. Characters per second.
cpu. Central processing unit.
CRC. Cyclic redundancy check.
CRT. Cathode ray tube.
CRT display. Cathode ray tube display.
CTS. Clear to send. Associated with modem control.
cursor. (1) In computer graphics, a movable marker that is used to indicate a position on a display. (2) A displayed symbol that acts as a marker to help the user locate a point in text, in a system command, or in storage. (3) A movable spot of light on the screen of a display device, usually indicating where the next character is to be entered, replaced, or deleted.
cyclic redundancy check (CRC). (1) A redundancy check in which the check key is generated by a cyclic algorithm. (2) A system of error checking performed at both the sending and receiving station after a block-check character has been accumulated.
cylinder. (1) The set of all tracks with the same nominal distance from the axis about which the disk rotates. (2) The tracks of a disk storage device that can be accessed without repositioning the access mechanism.
Glossary-8
daisy-chained cable. A type of cable that has two or more connectors attached in series.
data. (1) A representation of facts, concepts, or instructions in a formalized manner suitable for communication, interpretation, or processing by human or automatic means. (2) Any representations, such as characters or analog quantities, to which meaning is, or might be assigned.
data base. A collection of data that can be immediately accessed and operated upon by a data processing system for a specific purpose.
data processing system. A system that performs input, processing, storage, output, and control functions to accomplish a sequence of operations on data.
data transmission. Synonym for transmission.
dB. Decibel.
dBa. Adjusted decibels.
dc. Direct current.
debounce. An electronic means of overcoming the make/break bounce of switches to obtain one smooth change of signal level.
decibel. (1) A unit that expresses the ratio of two power levels on a logarithmic scale. (2) A unit for measuring relative power.
decoupliog capacitor. A capacitor that provides a low impedance path to ground to prevent common coupling between circuits.
Deutsche Industrie Norm (DIN). (1) German Industrial Norm. (2) The committee that sets German dimension standards.
digit. (1) A graphic character that represents an integer; for example, one of the characters 0 to 9. (2) A symbol that
Glossary-9
represents one of the non-negative integers smaller than the radix. For example, in decimal notation, a digit is one of the characters 0 to 9. digital. (1) Pertaining to data in the form of digits. (2) Contrast with analog.
DIN. Deutsche Industrie Norm. DIN connector. One of the connectors specified by the DIN committee. DIP. Dual in-line package. DIP switch. One of a set of small switches mounted in a dual in-line package.
direct current (de). A current that always flows in one direction. direct memory access (DMA). A method of transferring data between main storage and I/O devices that does not require processor intervention. disable. To stop the operation of a circuit or device. disabled. Pertaining to a state of a processing unit that prevents the occurrence of certain types of interruptions. Synonymous with masked. disk. Loosely, a magnetic disk. diskette. A thin, flexible magnetic disk and a semirigid protective jacket, in which the disk is permanently enclosed. Synonymous with flexible disk. diskette drive. A device for storing data on and retrieving data from a diskette.
Glossary-10
display. (1) A visual presentation of data. (2) A device for visual presentation of information on any temporary character imaging device. (3) To present data visually. (4) See cathode ray tube display.
display attribute. In computer graphics, a particular property that is assigned to all or part of a display; for example, low intensity, green color, blinking status.
DMA. Direct memory access.
dot matrix. (1) In computer graphics, a two-dimensional pattern of dots used for constructing a display image. This type of matrix can be used to represent characters by dots. (2) In word processing, a pattern of dots used to form characters. This term normally refers to a small section of a set of addressable points; for example, a representation of characters by dots.
dot printer. Synonym for matrix printer. ~ dot-matrix character generator. In computer graphics, a character
generator that generates character images composed of dots.
DSR. Data set ready. Associated with modem control.
DTR. In the IBM Personal Computer, data terminal ready. Associated with modem control.
dual in-line package (DIP). A widely used container for an integrated circuit. DIPs have pins in two parallel rows. The pins are spaced 1/10 inch apart. See also DIP switch.
duplex. (1) In data communication, pertaining to a simultaneous two-way independent transmission in both directions. (2) ~ Contrast with half-duplex.
duty cycle. In the operation of a device, the ratio of on time to idle time. Duty cycle is expressed as a decimal or percentage.
Glossary-tt
dynamic memory. RAM using transistors and capacitors as the memory elements. This memory requires a refresh (recharge) cycle every few milliseconds. Contrast with static memory.
EBCDIC. Extended binary-coded decimal interchange code. ECC. Error checking and correction.
edge connector. A terminal block with a number of contacts attached to the edge of a printed-circuit board to facilitate plugging into a foundation circuit.
EIA. Electronic Industries Association.
electromagnet. Any device that exhibits magnetism only while an electric current flows through it. enable. To initiate the operation of a circuit or device. end of block (EOB). A code that marks the end of a block of data. end of file (EOF). An internal label, immediately following the last record of a file, signaling the end of that file. It may include control totals for comparison with counts accumulated during processing.
end-of-text (ETX). A transmission control character used to terminate text. end-of-transmission (EOT). A transmission control character used to indicate the conclusion of a transmission, which may have included one or more texts and any associated message headings.
end-of-transmission-block (ETB). A transmission control character used to indicate the end of a transmission block of data when data is divided into such blocks for transmission purposes.
Glossary-12
EOB. End of block. EOF. End of file. EOT. End-of-transmission. EPROM. Erasable programmable read-only memory.
erasable programmable read-only memory (EPROM). A PROM in which the user can erase old information and enter new information. error checking and correction (ECC). The detection and correction of all single-bit errors, plus the detection of double-bit and some multiple-bit errors.
ESC. The escape character.
escape character (ESC). A code extension character used, in ~ some cases, with one or more succeeding characters to indicate by
some convention or agreement that the coded representations following the character or the group of characters are to be interpreted according to a different code or according to a different coded character set.
ETB. End-of-transmission-block. ETX. End-of-text.
extended binary-coded decimal interchange code (EBCDIC). A set of 256 characters, each represented by eight bits.
F. Fahrenheit. Fahrenheit (F). A temperature scale. Contrast with Celsius (C).
Glossary-13
falling edge. Synonym for negative-going edge.
FCC. Federal Communications Commission.
fetch. To locate and load a quantity of data from storage.
FF. The form feed character.
field. (1) In a record, a specified area used for a particular
category of data. (2) In a data base, the smallest unit of data that
can be referred to.
fixed disk drive. In the IBM Personal Computer, a unit consisting
of nonremovable magnetic disks, and a device for storing data on
and retrieving data from the disks.
flag. (1) Any of various types of indicators used for
identification. (2) A character that signals the occurrence of
some condition, such as the end of a word. (3) Deprecated term for mark.
~
flexible disk. Synonym for diskette.
flip-flop. A circuit or device containing active elements, capable
of assuming either one of two stable states at a given time.
font. A family or assortment of characters of a given size and
style; for example, 10 point Press Roman medium.
foreground. (1) In multiprogramming, the environment in which
high-priority programs are executed. (2) On a color display
screen, the characters as opposed to the background.
form feed. (1) Paper movement used to bring an assigned part of
a form to the printing position. (2) In word processing, a
function that advances the typing position to the same character
position on a predetermined line of the next form or page.
Glossary-14
form feed character. A control character that causes the print or display position to move to the next predetermined first line on the next form, the next page, or the equivalent. format. The arrangement or layout of data on a data medium.
frame. (1) In SDLC, the vehicle for every command, every response, and all information that is transmitted using SDLC procedures. Each frame begins and ends with a flag. (2) In data transmission, the sequence of contiguous bits bracketed by and including beginning and ending flag sequences.
g. Gram.
G. (1) Prefix giga; 1 000000000. (2) When referring to computer storage capacity, 1073741 824. (1 073 741 824 = 2 to the 30th power.)
gate. (1) A combinational logic circuit having one output channel and one or more input channels, such that the output channel state is completely determined by the input channel states. (2) A signal that enables the passage of other signals through a circuit.
Gb. 1 073741 824 bytes.
general-purpose register. A register, usually explicitly addressable within a set of registers, that can be used for different purposes; for example, as an accumulator, as an index register, or as a special handler of data.
giga (G). Prefix 1 000000000. gram (g). A unit of weight (equivalent to 0.035 ounces). graphic. A symbol produced by a process such as handwriting, drawing, or printing.
Glossary-15
graphic character. A character, other than a control character, that is normally represented by a graphic.
half-duplex. (1) In data communication, pertaining to an alternate, one way at a time, independent transmission. (2) Contrast with duplex.
hardware. (1) Physical equipment used in data processing, as opposed to programs, procedures, rules, and associated documentation. (2) Contrast with software.
head. A device that reads, writes, or erases data on a storage medium; for example, a small electromagnet used to read, write, or erase data on a magnetic disk.
hertz (Hz). A unit of frequency equal to one cycle per second.
hex. Common abbreviation for hexadecimal.
hexadecimal. (1) Pertaining to a selection, choice, or condition that has 16 possible different values or states. These values or states are usually symbolized by the ten digits 0 through 9 and the six letters A through F. (2) Pertaining to a fixed radix numeration system having a radix of 16.
~
high impedance state. A state in which the output of a device is effectively isolated from the circuit.
highlighting. In computer graphics, emphasizing a given display group by changing its attributes relative to other display groups in the same display field.
high-order position. The leftmost position in a string of characters. See also most-significant digit.
honsekeeping. Operations or routines that do not contribute directly to the solution of the problem but do contribute directly to the operation of the computer.
Hz. Hertz
Glossary-16
image. A fully processed unit of operational data that is ready to be transmitted to a remote unit; when loaded into control storage in the remote unit, the image determines the operations of the unit.
immediate instruction. An instruction that contains within itself an operand for the operation specified, rather than an address of the operand.
index register. A register whose contents may be used to modify an operand address during the execution of computer instructions.
indicator. (1) A device that may be set into a prescribed state, usually according to the result of a previous process or on the occurrence of a specified condition in the equipment, and that usually gives a visual or other indication of the existence of the prescribed state, and that may in some cases be used to determine the selection among alternative processes; for example, an overflow indicator. (2) An item of data that may be interrogated to determine whether a particular condition has been satisfied in the execution of a computer program; for example, a switch indicator, an overflow indicator.
inhibited. (1) Pertaining to a state of a processing unit in which certain types of interruptions are not allowed to occur. (2) Pertaining to the state in which a transmission control unit or an audio response unit cannot accept incoming calls on a line.
initialize. To set counters, switches, addresses, or contents of storage to 0 or other starting values at the beginning of, or at prescribed points in, the operation of a computer routine.
input/output (I/O). (1) Pertaining to a device or to a channel that may be involved in an input process, and, at a different time, in an output process. In the English language, "input/output" may be used in place of such terms as "input/output, data" "input/output signal," and "input/output terminals," when such usage is clear in a given context. (2) Pertaining to a device whose parts can be performing an input process and an output process at the same time. (3) Pertaining to either input or output, or both.
instruction. In a programming language, a meaningful expression that specifies one operation and identifies its operands, if any.
Glossary-17
instruction set. The set of instructions of a computer, of a programming language, or of the programming languages in a programming system.
interface. A device that alters or converts actual electrical signals between distinct devices, programs, or systems.
interleave. To arrange parts of one sequence of things or events so that they alternate with parts of one or more other sequences of the same nature and so that each sequence retains its identity. interrupt. (1) A suspension of a process, such as the execution of a computer program, caused by an event external to that process, and performed in such a way that the process can be resumed. (2) In a data transmission, to take an action at a receiving station that causes the transmitting station to terminate a transmission. (3) Synonymous with interruption.
I/O. Input/output.
I/O area. Synonym for buffer.
irrecoverable error. An error that makes recovery impossible without the use of recovery techniques external to the computer program or run.
joystick. In computer graphics, a lever that can pivot in all directions and that is used as a locator device.
k. Prefix kilo; 1000.
K. When referring to storage capacity, 1024. (1024 = 2 to the 10th power.) Kb. 1024 bytes.
kg. Kilogram; 1000 grams.
Glossary-18
kHz. Kilohertz; 1000 hertz. kilo (k). Prefix 1000 kilogram (kg). 1000 grams.
~ kilohertz (kHz). 1000 hertz
latch. (1) A simple logic-circuit storage element. (2) A feedback loop in sequential digital circuits used to maintain a state. least-significant digit. The rightmost digit. See also low-order position.
LED. Light-emitting diode.
light-emitting diode (LED). A semiconductor device that gives off visible or infrared light when activated. ~ load. In programming, to enter data into storage or working registers. low power Schottky TIL. A version (LS series) of TTL giving a good compromise between low power and high speed. See also transistor-transistor logic and Schottky TTL. low-order position. The rightmost position in a string of characters. See also least-significant digit.
m. (1) Prefix milli; 0.001. (2) Meter.
M. (1) Prefix mega; 1 000 000. (2) When referring to computer
storage capacity, 1 048 576. (1 048 576 = 2 to the 20th power.)
rnA. Milliampere; 0.001 ampere.
Glossary-19
machine code. The machine language used for entering text and program instructions onto the recording medium or into storage and which is subsequently used for processing and printout.
machine language. (1) A language that is used directly by a machine. (2) Deprecated term for computer instruction code.
magnetic disk. (1) A flat circular plate with a magnetizable surface layer on which data can be stored by magnetic recording. (2) See also diskette.
main storage. (1) Program-addressable storage from which instructions and other data can be loaded directly into registers for subsequent execution or processing. (2) Contrast with auxiliary storage.
mark. A symbol or symbols that indicate the beginning or the end of a field, of a word, of an item of data, or of a set of data such as a file, a record, or a block.
mask. (1) A pattern of characters that is used to control the retention or elimination of portions of another pattern of characters. (2) To use a pattern of characters to control the retention or elimination of portions of another pattern of characters.
masked. Synonym for disabled.
matrix. (1) A rectangular array of elements, arranged in rows and columns, that may be manipulated according to the rules of matrix algebra. (2) In computers, a logic network in the form of an array of input leads and output leads with logic elements connected at some of their intersections.
matrix printer. A printer in which each character is represented by a pattern of dots; for example, a stylus printer, a wire printer. Synonymous with dot printer.
Mb. 1 048 576 bytes.
mega (M). Prefix 1 000 000.
Glossary-20
megahertz (MHz). 1 000 000 hertz.
memory. Term for main storage.
meter (m). A unit of length (equivalent to 39.37 inches).
MFM. Modified frequency modulation.
MHz. Megahertz; 1 000 000 hertz.
micro (p.). Prefix 0.000 001.
microcode. (1) One or more microinstructions. (2) A code, representing the instructions of an instruction set, implemented in a part of storage that is not program-addressable. microinstruction. (1) An instruction of microcode. (2) A basic or elementary machine instruction. microprocessor. An integrated circuit that accepts coded ~ instructions for execution; the instructions may be entered, integrated, or stored internally. microsecond (p.s). 0.000001 second. milli (m). Prefix 0.001. milliampere (rnA). 0.001 ampere. millisecond (ms). 0.001 second.
mnemonic. A symbol chosen to assist the human memory; for
example, an abbreviation such as "mpy" for "multiply".
mode. (1) A method of operation; for example, the binary mode, the interpretive mode, the alphanumeric mode. (2) The most ~ frequent value in the statistical sense. modem (modulator-demodulator). A device that converts serial (bit by bit) digital signals from a business machine (or data
Glossary-21
communication equipment) to analog signals that are suitable for transmission in a telephone network. The inverse function is also performed by the modem on reception of analog signals.
modified frequency modulation (MFM). The process of varying the amplitude and frequency of the 'write' signal. MFM pertains to the number of bytes of storage that can be stored on the recording media. The number of bytes is twice the number contained in the same unit area of recording media at single density.
modulation. The process by which some characteristic of one wave (usually high frequency) is varied in accordance with another wave or signal (usually low frequency). This technique is used in modems to make business-machine signals compatible with communication facilities.
modulation rate. The reciprocal of the measure of the shortest nominal time interval between successive significant instants of the modulated signal. If this measure is expressed in seconds, the modulation rate is expressed in baud.
module. (1) A program unit that is discrete and identifiable with r--.....
respect to compiling, combining with other units, and loading. (2) A packaged functional hardware unit designed for use with other components.
modulo check. A calculation performed on values entered into a system. This calculation is designed to detect errors.
monitor. (1) A device that observes and verifies the operation of a data processing system and indicates any significant departure from the norm. (2) Software or hardware that observes, supervises, controls, or verifies the operations of a system.
most-significant digit. The leftmost (non-zero) digit. See also high-order position.
ms. Millisecond; 0.001 second.
multiplexer. A device capable of interleaving the events of two or more activities, or capable of distributing the events of an interleaved sequence to the respective activities.
Glossary-22
multiprogramming. (1) Pertaining to the concurrent execution of two or more computer programs by a computer. (2) A mode of operation that provides for the interleaved execution of two or more computer programs by a single processor.
~ n. Prefix nano; 0.000000001.
NAND. A logic operator having the property that if P is a statement, Q is a statement, R is a statement,... , then the NAND of P, Q ,R,... is true if at least one statement is false, false if all statements are true.
NAND gate. A gate in which the output is 0 only if all inputs are 1.
nano (n). Prefix 0.000 000 001.
nanosecond (ns). 0.000000001 second.
~ negative true. Synonym for active low.
negative-going edge. The edge of a pulse or signal changing in a negative direction. Synonymous with falling edge.
non-return-to-zero change-on-ones recording (NRZI). A transmission encoding method in which the data terminal equipment changes the signal to the opposite state to send a
binary 1 and leaves it in the same state to send a binary o.
non-return-to-zero (inverted) recording (NRZI). Deprecated term for non-return-to-zero change-on-ones recording.
NOR. A logic operator having the property that if P is a statement, Q is a statement, R is a statement,... , then the NOR of P, Q, R, ... is true if all statements are false, false if at least one statement is true.
NOR gate. A gate in which the output is 0 only if at least one input is 1.
Glossary-23
NOT. A logical operator having the property that if P is a statement, then the NOT of P is true if P is false, false if P is true.
NRZI. Non-return-to-zero change-on-ones recording.
ns. Nanosecond; 0.000 000 001 second.
NUL. The null character.
null character (NUL). A control character that is used to accomplish media-fill or time-fill, and that may be inserted into or removed from, a sequence of characters without affecting the meaning of the sequence; however, the control of the equipment or the format may be affected by this character.
odd-even check. Synonym for parity check.
offline. Pertaining to the operation of a functional unit without the continual control of a computer.
one-shot. A circuit that delivers one output pulse of desired duration for each input (trigger) pulse.
open circuit. (1) A discontinuous circuit; that is, one that is broken at one or more points and, consequently, cannot conduct current. Contrast with closed circuit. (2) Pertaining to a no-load condition; for example, the open-circuit voltage of a power supply.
open coUector. A switching transistor without an internal connection between its collector and the voltage supply. A connection from the collector to the voltage supply is made through an external (pull-up) resistor.
operand. (1) An entity to which an operation is applied. (2) That ~ which is operated upon. An operand is usually identified by an address part of an instruction.
Glossary-24
operating system. Software that controls the execution of programs; an operating system may provide services such as resource allocation, scheduling, input/output control, and data management.
OR. A logic operator having the property that if P is a statement, Q is a statement, R is a statement,..., then the OR of P, Q, R,...is true if at least one statement is true, false if all statements are false.
OR gate. A gate in which the output is 1 only if at least one input is 1.
output. Pertaining to a device, process, or channel involved in an output process, or to the data or states involved in an output process.
output process. ( 1) The process that consists of the delivery of data from a data processing system, or from any part of it. (2) The return of information from a data processing system to an ~ end user, including the translation of data from a machine language to a language that the end user can understand.
overcurrent. A current of higher than specified strength.
overflow indicator. (1) An indicator that signifies when the last line on a page has been printed or passed. (2) An indicator that is set on if the result of an arithmetic operation exceeds the capacity of the accumulator.
overrun. Loss of data because a receiving device is unable to accept data at the rate it is transmitted.
overvoltage. A voltage of higher than specified value.
parallel. ( 1) Pertaining to the concurrent or simultaneous operation of two or more devices, or to the concurrent performance of two or more activities. (2) Pertaining to the concurrent or simultaneous occurrence of two or more related activities in multiple devices or channels. (3) Pertaining to the
Glossary-2S
simultaneity of two or more processes. (4) Pertaining to the simultaneous processing of the individual parts of a whole, such as the bits of a character and the characters of a word, using separate facilities for the various parts. (5) Contrast with serial.
parameter. (1) A variable that is given a constant value for a specified application and that may denote the application. (2) A name in a procedure that is used to refer to an argument passed to that procedure.
parity bit. A binary digit appended to a group of binary digits to make the sum of all the digits either always odd (odd parity) or always even (even parity).
parity check. (1) A redundancy check that uses a parity bit. (2) Synonymous with odd-even check.
PEL. Picture element.
personal computer. A small home or business computer that has a processor and keyboard and that can be connected to a television or some other monitor. An optional printer is usually available.
phototransistor. A transistor whose switching action is controlled by light shining on it.
picture element (PEL). The smallest displayable unit on a display.
polling. (1) Interrogation of devices for purposes such as to avoid contention, to determine operational status, or to determine readiness to send or receive data. (2) The process whereby stations are invited, one at a time, to transmit.
port. An access point for data entry or exit.
positive true. Synonym for active high.
positive-going edge. The edge of a pulse or signal changing in a positive direction. Synonymous with rising edge.
Glossary-16
potentiometer. A variable resistor with three terminals, one at each end and one on a slider (wiper).
power supply. A device that produces the power needed to operate electronic equipment.
,,-....., printed circuit. A pattern of conductors (corresponding to the wiring of an electronic circuit) formed on a board of insulating material.
printed-circuit board. A usually copper-clad plastic board used to make a printed circuit.
priority. A rank assigned to a task that determines its precedence in receiving system resources.
processing program. A program that performs such functions as compiling, assembling, or translating for a particular programming language.
processing unit. A functional unit that consists of one or more processors and all or part of internal storage.
processor. (1) In a computer, a functional unit that interprets and executes instructions. (2) A functional unit, a part of another unit such as a terminal or a processing unit, that interprets and executes instructions. (3) Deprecated term for processing program. (4) See microprocessor.
program. ( 1) A series of actions designed to achieve a certain result. (2) A series of instructions telling the computer how to handle a problem or task. (3) To design, write, and test computer programs.
programmable read-only memory (PROM). A read-only memory that can be programmed by the user.
programming language. (1) An artificial language established for expressing computer programs. (2) A set of characters and rules with meanings assigned prior to their use, for writing computer programs.
Glossary-27
programming system. One or more programming languages and the necessary software for using these languages with particular automatic data-processing equipment.
PROM. Programmable read-only memory.
propagation delay. (1) The time necessary for a signal to travel from one point on a circuit to another. (2) The time delay between a signal change at an input and the corresponding change at an output.
protocol. (1) A specification for the format and relative timing of information exchanged between communicating parties. (2) The set of rules governing the operation of functional units of a communication system that must be followed if communication is to be achieved.
pulse. A variation in the value of a quantity, short in relation to the time schedule of interest, the final value being the same as the initial value.
radio frequency (RF). An ac frequency that is higher than the highest audio frequency. So called because of the application to radio communication.
radix. (1) In a radix numeration system, the positive integer by which the weight of the digit place is multiplied to obtain the weight of the digit place with the next higher weight; for example, in the decimal numeration system the radix of each digit place is 10. (2) Another term for base.
radix numeration system. A positional representation system in which the ratio of the weight of anyone digit place to the weight of the digit place with the next lower weight is a positive integer (the radix). The permissible values of the character in any digit
place range from a to one less than the radix.
RAM. Random access memory. Read/write memory.
Glossary-28
random access memory (RAM). Read/write memory.
RAS. In the IBM Personal Computer, row address strobe.
raster. In computer graphics, a predetermined pattern of lines that provides uniform coverage of a display space.
read. To acquire or interpret data from a storage device, from a data medium, or from another source.
read-only memory (ROM). A storage device whose contents cannot be modified. The memory is retained when power is removed.
read/write memory. A storage device whose contents can be modified. Also called RAM.
recoverable error. An error condition that allows continued execution of a program.
red-green-blue-intensity (RGBI). The description of a direct-drive color monitor that accepts input signals of red, green, blue, and intensity.
redundancy check. A check that depends on extra characters attached to data for the detection of errors. See cyclic redundancy check.
register. (1) A storage device, having a specified storage capacity such as a bit, a byte, or a computer word, and usually intended for a special purpose. (2) A storage device in which specific data is stored.
retry. To resend the current block of data (from the last EOB or ETB) a prescribed number of times, or until it is entered correctly or accepted.
reverse video. A form of highlighting a character, field, or cursor by reversing the color of the character, field, or cursor with its background; for example, changing a red character on a black background to a black character on a red background.
Glossary-29
RF. Radio frequency.
RF modulator. The device used to convert the composite video signal to the antenna level input of a home TV.
RGBI. Red-green-blue-intensity.
rising edge. Synonym for positive-going edge.
ROM. Read-only memory.
ROM/BIOS. The ROM resident basic input/output system, which provides the level control of the major I/O devices in the computer system.
row address strobe (RAS). A signal that latches the row address in a memory chip.
RS-232C. A standard by the EIA for communication between computers and external equipment.
RTS. Request to send. Associated with modem control.
run. A single continuous performance of a computer program or routine.
schematic. The representation, usually in a drawing or diagram form, of a logical or physical structure.
Schottky TTL. A version (S series) of TTL with faster switching
speed, but requiring more power. See also transistor-transistor
logic and low power Schottky TTL.
~
SDLC. Synchronous Data Link Control
Glossary-30
sector. That part of a track or band on a magnetic drum, a magnetic disk, or a disk pack that can be accessed by the magnetic heads in the course of a predetermined rotational displacement of the particular device.
~ SERDES. Serializer/deserializer.
serial. (1) Pertaining to the sequential performance of two or more activities in a single device. In English, the modifiers serial and parallel usually refer to devices, as opposed to sequential and consecutive, which refer to processes. (2) Pertaining to the sequential or consecutive occurrence of two or more related activities in a single device or channel. (3) Pertaining to the sequential processing of the individual parts of a whole, such as the bits of a character or the characters of a word, using the same facilities for successive parts. (4) Contrast with parallel.
serializer/deserializer (SERDES). A device that serializes output from, and deserializes input to, a business machine.
~
setup. (1) In a computer that consists of an assembly of individual computing units, the arrangement of interconnections between the units, and the adjustments needed for the computer to operate. (2) The preparation of a computing system to perform a job or job step. Setup is usually performed by an operator and often involves performing routine functions, such as mounting tape reels. (3) The preparation of the system for normal operation.
short circuit. A low-resistance path through which current flows, rather than through a component or circuit.
signal. A variation of a physical quantity, used to convey data.
sink. A device or circuit into which current drains.
~
software. (1) Computer programs, procedures, and rules concerned with the operation of a data processing system. (2)
Contrast with hardware.
source. The origin of a signal or electrical energy.
Glossary-31
square wave. An alternating or pulsating current or voltage whose waveshape is square.
square wave generator. A signal generator delivering an output signal having a square waveform.
SS. Start-stop.
start bit. (1) A signal to a receiving mechanism to get ready to receive data or perform a function. (2) In a start-stop system, a signal preceding a character or block that prepares the receiving device for the reception of the code elements.
start-of-text (STX). A transmission control character that precedes a text and may be used to terminate the message heading.
start-stop system. A data transmission system in which each character is preceded by a start bit and is followed by a stop bit.
start-stop (SS) transmission. (1) Asynchronous transmission such that a group of signals representing a character is preceded by a start bit and followed by a stop bit. (2) Asynchronous transmission in which a group of bits is preceded by a start bit that prepares the receiving mechanism for the reception and registration of a character and is followed by at least one stop bit that enables the receiving mechanism to come to an idle condition pending the reception of the next character.
~
static memory. RAM using flip-flops as the memory elements. Data is retained as long as power is applied to the flip-flops. Contrast with dynamic memory.
stop bit. (1) A signal to a receiving mechanism to wait for the
next signal. (2) In a start-stop system, a signal following a
character or block that prepares the receiving device for the
reception of a subsequent character or block.
~
storage. (1) A storage device. (2) A device, or part of a device, that can retain data. (3) The retention of data in a storage device. (4) The placement of data into a storage device.
Glossary-32
strobe. An instrument that emits adjustable-rate flashes of light. Used to measure the speed of rotating or vibrating objects.
STX. Start-of-text.
symbol. (1) A conventional representation of a concept. (2) A representation of something by reason of relationship, association, or convention.
synchronization. The process of adjusting the corresponding significant instants of two signals to obtain the desired phase relationship between these instants.
Synchronous Data Link Control (SDLC). A protocol for management of data transfer over a data link.
synchronous transmission. (1) Data transmission in which the time of occurrence of each signal representing a bit is related to a fixed time frame. (2) Data transmission in which the sending and receiving devices are operating continuously at substantially the same frequency and are maintained, by means of correction, in a desired phase relationship.
syntax. (1) The relationship among characters or groups of characters, independent of their meanings or the manner of their interpretation and use. (2) The structure of expressions in a language. (3) The rules governing the structure of a language. (4) The relationships among symbols.
text. In ASCII and data communication, a sequence of characters treated as an entity if preceded and terminated by one STX and one ETX transmission control character, respectively.
time-out. (1) A parameter related to an enforced event designed to occur at the conclusion of a predetermined elapsed time. A time-out condition can be cancelled by the receipt of an appropriate time-out cancellation signal. (2) A time interval
Glossary-33
allotted for certain operations to occur; for example, response to polling or addressing before system operation is interrupted and must be restarted.
track. (1) The path or one of the set of paths, parallel to the reference edge on a data medium, associated with a single reading or writing component as the data medium moves past the component. (2) The portion of a moving data medium such as a drum, or disk, that is accessible to a given reading head position.
~
transistor-transistor logic (TIL). A popular logic circuit family that uses multiple-emitter transistors.
translate. To transform data from one language to another.
transmission. (1) The sending of data from one place for reception elsewhere. (2) In ASCII and data communication, a series of characters including headings and text. (3) The dispatching of a signal, message, or other form of intelligence by wire, radio, telephone, or other means. (4) One or more blocks or messages. For BSC and start-stop devices, a transmission is terminated by an EOT character. (5) Synonymous with data transmission.
~
TIL. Transistor-transistor logic.
V. Volt.
video. Computer data or graphics displayed on a cathode ray tube, monitor, or display.
volt. The basic practical unit of electric pressure. The potential that causes electrons to flow through a circuit.
W. Watt.
watt. The practical unit of electric power.
Glossary-34
word. (1) A character string or a bit string considered as an entity. (2) See computer word. write. To make a permanent or transient recording of data in a storage device or on a data medium. write precompensation. The varying of the timing of the head current from the outer tracks to the inner tracks of the diskette to keep a constant 'write' signal.
Glossary-35
Glossary-36
Bibliography
Intel Corporation. The 8086 Family User's Manual. This manual introduces the 8086 family of microcomputing components and serves as a reference in system design and implementation. Intel Corporation. 8086/8087/8088 Macro Assembly Reference Manual for 8088/8085 Based Development System. This manual describes the 8086/8087/8088 Macro Assembly Language and is intended for persons who are familiar with assembly language. Intel Corporation. Component Data Catalog. This book describes Intel components and their technical specifications. Motorola, Inc. The Complete Microcomputer Data Libary.. This book describes Motorola components and their technical specifications. National Semiconductor Corporation. 250 Asynchronous Communications Element. This book documents physical and operating characteristics of the INS 8250.
Bibliography-l
Bihliography-2
Index
Special Characters
-MEMR (memory read command) 1-22
-MEMW (memory write command) 1-22
A
adapter card with ROM 5-13
address
bits 0 to 19 (AO-A19), I/O channel 1-20
enable (AEN), I/O channel 1-20
latch enable (ALE), I/O channel 1-20
map, I/O 1-24
AEN (address enable), I/O channel 1-20
ALE (address latch enable), I/O channel 1-20
B
BASIC reserved interrupts 5-8,5-9 BASIC,
DEF SEG 5-11 reserved interrupt 5-8, 5-9 binary integers (coprocessor) 2-3,2-4 ~ BIOS, parameter passing 5-4 quick reference 5-29 software interrupt 5-6 system ROM 5-29
Index-l
use of 5-3 bit map, I/O 8255A 1-31 block diagram (coprocessor) 2-6 break (keyboard extended code) 5-21
c
CCITT 8-3 standards 8-3
CH CK,negative (-channel check), I/O channel 1-21 channel check, negative (-CH CK), I/O channel 1-21 character codes (keyboard) 5-15,5-17 character set
quick reference 7-12 clock (CLK), I/O channel 1-20 communications 8-3 component diagram, system board 1-16
D
data bits 0 to 7 (DO-D7) 1-21 flow, system board diagram 1-5
decimal integers (coprocessor) 2-3,2-4 description I/O channel 1-20 diagram system board 1-16 diagram, 110 channel 1-18 DMA request 1 to 3 (DRQI-DRQ3) 1-21 DOS,
keyboard function 5-8,5-14,5-22 keyboard functions 5-24
Index-2
E
EIA 8-3
standards 8-3
~ establishing a communications link 8-5
establish a link 8-5
I
I/O channel
address map 1-24
ALE (address latch enable) 1-20
bit map 8255A 1-31
CH CK (-I/O channel check) 1-21
CH RDY (I/O Channel Ready), I/O channel 1-21
check (-CH CK) 1-21
CLK 1-20
description 1-20
I/O channel diagram 1-18
oscillator (OSC) 1-23
read command (-lOR) 1-22
reset drive (RESET DRV) 1-23
terminal count (T/C) 1-23
write command (-lOW) 1-22
Intel 8048 4-3
Intel 8088 microprocessor, 6-17,.instuction set extensions
arithmetic 6-8,6-19
comparison 6-19
conditional transfer operations 6-15
constants 6-21
control transfer 6-12
data transfer 6-6, 6-17
instruction set index 6-27
instruction set matrix 6-25
logic 6-10
memory segmentation model 6-5
operand summary 6-4
processor control 6-16,6-22
Index-3
register model 6-3
second instruction byte summary 6-4
string manipulation 6-11
transcendental 6-21
use of segment override 6-5
interrupt request 2 to 7 (IRQ2-IRQ7) 1-22
K
keyboard 4-3
block diagram 4-4
connector 4-12
interface 4-4
keyboard scan 4-3
power-on self-test 4-3
keyboard extended codes,
alt 5-19
break 5-21
caps lock 5-20
ctrl 5-19
encoding 5-14
pause 5-21
print screen 5-21
scroll lock 5-20
shift 5-19
system reset 5-20
L
logic diagrams, system-board 1-36
Index-4
M
math coprocessor
binary integers 2-3, 2-4
~
block diagram 2-6
control word 2-5
decimal integers 2-3,2-4
hardware interface 2-4
NMI 2-5
QSO 2-4
QS1 2-4
real numbers 2-3,2-4
memory locations,
reserved 5-9
memory map,
BIOS 5-13
memory read command (-MEMR) 1-22
memory write command (-MEMW) 1-22
N
NMI (coprocessor) 2-5
o
OSC (oscillator), I/O channel 1-23 oscillator (OSC), I/O channel 1-23
Index-5
p
parameter passing (ROM BIOS) 5-4
software interrupt listing 5-6
pause (keyboard extended code) 5-21
Q
QSO (coprocessor) 2-4
QS 1 (coprocessor) 2-4
R
read command I/O channel 1-22
read memory command (-MEMR) 1-22
ready (RDY), I/O channel 1-21
real numbers (coprocessor) 2-3,2-4
request interrupt 2 to 7 (IRQ2-IRQ7) 1-22
reserved interrupts,
BASIC and DOS 5-8, 5-9
RESET DRV, I/O channel 1-23
s
screen editor keyboard function 5-24
scroll lock (keyboard extended code) 5-20
shift (key priorities (keyboard code) 5-20
shift (keyboard extended code) 5-17,5-19
shift states (keyboard code) 5-19
signals (1/0) ,
-DACKO-DACK3 1-21
Index-6
-I/O CH CK 1-21
-lOR 1-22
-lOW 1-22
-MEMR 1-22
-MEMW 1-22
AEN 1-20
ALE 1-20
AO-A19 1-20
CLK 1-20
DRQ1-DRQ3 1-21
DO-D7 1-21
I/O CH RDY 1-21
IRQ2-IRQ7 1-22
OSC 1-23
RESET DRV 1-23
T/C 1-23
software interrupt listing (8088) 5-6
speaker circuit 1-25
speaker drive system 1-25
system board
data flow diagrams 1-5
diagram 1-16
logic diagrams 1-36
system clock (CLK), I/O channel 1-20
system reset 5-20
system ROM BIOS 5-29
T
terminal count (T/C), I/O channel 1-23
typematic 4-3
v
vectors with special meanings 5-6
Index-7
w
write command (-lOW), I/O channel 1-22
write memory command (-MEMW) 1-22
Numerals
8088, (see Intel 8088 microprocessor) 1-3
8255A bit map 1-31
specifications I/O channel 1-34
Index-8
----- ------_---------.---------
The Personal Computer Hardware Library
Reader's Comment Form
Technical Reference IBM Personal Computer
6361453
Your comments assist us in improving the usefulness of our publication; they are an important part of the input used for revisions.
IBM may use and distribute any of the information you supply in any way it believes appropriate without incurring any obligation whatever. You may, of course, continue to use the information you supply.
Please do not use this form for technical questions regarding the IBM Personal Computer or programs for the IBM Personal Computer, or for requests for additional publications; this only delays the response. Instead, direct your inquiries or request to your authorized IBM Personal Computer dealer.
Comments:
\."...,/
111111
NO POSTAGE
NECESSARY
IF MAILED
IN THE
UNITED STATES
BUSINESS REPLY MAIL
FIRST CLASS PERMIT NO. 321 BOCA RATON. FLORIDA 33432
POSTAGE WILL BE PAID BY ADDRESSEE
IBM PERSONAL COMPUTER
SALES & SERVICE
P.O. BOX 1328-C
BOCA RATON, FLORIDA 33432
'-.,/
aJa4 PIO:l
"-"
adel.
alde~s ~ou op aseald
adel.
Adobe Acrobat Pro Extended 9.5.5