Osborne_16 Bit_Microprocessor_Handbook_1981 Osborne 16 Bit Microprocessor Handbook 1981

Osborne_16-Bit_Microprocessor_Handbook_1981 Osborne_16-Bit_Microprocessor_Handbook_1981

User Manual: Osborne_16-Bit_Microprocessor_Handbook_1981

Open the PDF directly: View PDF PDF.
Page Count: 803

DownloadOsborne_16-Bit_Microprocessor_Handbook_1981 Osborne 16-Bit Microprocessor Handbook 1981
Open PDF In BrowserView PDF
OSBORNE

16-Bit
Microprocessor
Handbook

OSBORNE

16-Bit
Microprocessor
Handbook

OSBORNE/McGraw-Hili
Berkeley, California

Copyright © 1981, 1979, 1978, 1976, 1975 by
McGraw-Hili, Inc. All rights reserved.
Printed in the United States of America. No part of
this publication may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording or
Otherwise without the prior written permission of
the publishers.
Published by
OSBORNE/McGraw-Hili
630 Bancroft Way
Berkeley, California 94710
U.S.A.

For information on translations and book distributors
outside of the U. S. A. , please write
OSBORNE/McGraw-Hili at the above address.
123456789 KPKP 8987654321
ISBN 0-931988-43-8
Cover design by Marc Miyashiro.

Contributing Authors

The following persons have contributed
to the writing of sections of this book
in addition to its principal authors.
Bob Abramovitz
Janice K. Enger
Curtis A. Ingraham
Susanna Jacobson
Patrick L. McGuire

Contents
1.

2.

The National Semiconductor PACE and INS8900 1-1
PACE and INS8900 Microcomputer System Overviews 1-2
INS8900 and PACE Timing and Instruction Execution 1-11
The INS8900 and PACE Instruction Set 1-11
The PACE DP8302 System Timing Element (STE) 1-35
The PACE Bidirectional Transceiver Element (BTE) 1-36
Using Other Microcomputer Support Devices with the PACE and INS8900
Data Sheets 1-D1
The General Instrument CP1600 2-1
CP1600 Instruction Timing and Execution 2-10
The CP1600 Instruction Set 2-16
Support Devices that may be used with the CP1600
The CP1680 Input/Output Buffer (lOB) 2-30
Data Sheets 2-01

1-38

2-27

3.

The Texas Instruments TMS 9900, TMS 9980, and TMS 9440 Products
The TMS 9900 Microprocessor 3-2
TMS 9900 Timing and Instruction Execution 3-15
The TMS 9900 Instruction Set 3-35
The TMS 9980A and the TMS 9981 Microprocessors 3-44
The TMS 9940 Single-Chip Microcomputers 3-52
The TIM 9904 Four-Phase Clock Generator/Driver 3-67
The TMS 9901 Programmable System Interface (PSI) 3-70
The TMS 9902 Asynchronous Communications Controller 3-82
The TMS 9903 Synchronous Communications Controller 3-95
Data Sheets 3-D 1

4.

Single Chip Nova Minicomputer Central Processing Units
A Product Overview 4-2
CPU Logic and Instruction Execution 4-18
9440 Timing and Instruction Execution 4-24
The MicroNova and 9440 Instruction Sets 4-35
9440-Nova Bus Interface 4-77
Data Sheets 4-01

5.

The Intel 8086 5-1
The 8086 CPU 5-4
8086 Timing and Instruction Execution 5-30
The 8086 Instruction Set 5-47
The 8088 CPU 5-87
The Intel 8284 Clock Generator/Driver 5-91
The Intel 8288 Bus Controller 5-98
The 8282/8283 8-Bit Input/Output Latch 5-102
The 8286/8287 8-Bit Bidirectional Bus Transceivers 5-104
Some 8086 Microprocessor Bus Configurations 5-105
Data Sheets 5-D1

6.

The Zilog Z8000 Series 6-1
The Z8001 and Z8002 CPUs 6-3
Z8001 and Z8002 Timing and Instruction Execution
The Z8000 Instruction Set 6-36
Data Sheets 6-D1

ix

6-23

4-1

3-1

7.

The Motorola MC68000 7-1
MC68000 Pins and Signals 7-9
The MC68000 Instruction Set 7-38
Interfacing the MC68000 with 6800 Peripherals 7-44
Data Sheets 7-01

8.

2900 Series Chip Slice Products 8-1
The 2901. 2901 A. and 2901 B Microprocessor Slice 8-2
The 2903 Microprocessor Slice 8-40
The 2902 Carry Look-Ahead Device 8-87
The 2909 and 2911 Microprogram Sequencers 8-92
The 2910 Microprogram Sequencer 8-110
The 2930 and 2932 Program Control Units 22-125
Data Sheets 8-01

x

INTRODUCTION
This is one o'f two books that replace An Introduction to Microcomputers: Volume 2 - Some Real Microprocessors. That
volume went through several printings and in 1978 was printed loose-leaf. Six bimonthly updates to the loose-leaf version were published in 1979 and early 1980 to provide information on newly introduced microcomputer devices. The
loose-leaf version proved, however, to be quite unpopular with bookstores because of packaging and handling considerations. It also became more and more difficult to maintain a timely flow-of the bimonthly updates. For these
reasons, Volume 2 is being replaced by two bound paperback books: the Osborne 4 & 8-Bit Microprocessor Handbook
and the Osborne 16-Bit Microprocessor Handbook. Together these handbooks include all of the information that was
contained in Volume 2 and the six updates. All known errors have been corrected and new data sheets have been
added to the two handbooks. We have divided Volume 2 into two separate handbooks because the single-volume version would be over 1800 pages in length and rather difficult to bind. In addition, the devices lend themselves to this
grouping since the 16-bit microprocessors are generally much more powerful than the four- and eight-bit
microprocessors, and thus are directed toward different applications.

Volume 2 was part of a four-volume Introduction to Microcomputers series:
Volume 0 - The Beginner's Book was written for readers who know nothing about computers.
Volume 1 - Basic Concepts provides a detailed explanation of microprocessor concepts including number
systems, addressing modes, typical instruction sets, input/output techniques, and so on. The device descriptions in the 4 & 8-Bit Microprocessor Handbook and the 16-Bit Microprocessor Handbook assume that you
have a working knowledge of the general concepts presented in Volume 1, and we will occasionally make
references to material presented in Volume 1.
Volume 2 - Some Real Microprocessors, which is being replaced by these handbooks.
Volume 3 - Some Real Support Devices, which describes general support devices that may be used with
any microprocessor. Some dedicated support devices are the 4 & 8-Bit Microprocessor Handbook and the
16-Bit Microprocessor Handbook. We define a "dedicated" support device as one best used with its parent
microprocessor. We define a "general" support device as one that can be used with any microprocessor. We
will occasionally make reference in this book to some of the general support devices in Volume 3. When
designing a system based on one of the microprocessors described in this handbook, you should not automatically assume that the dedicated support devices described in this book are the only ones or the best
ones to use with a particular microprocessor: you should always check the functionally equivalent parts described in Volume 3
In addition to this Introduction to Microcomputers series, we have begun publishing other individual handbooks. The
first two handbooks of this series are: The 8089110 Processor Handbook, which includes the 8289 bus arbiter, and the
CRT Controller Handbook, which describes five LSI CRT controller devices. This individual handbook approach w'ill be
used in the future to maintain a convenient flow of detailed, objective information on new microprocessors and related
support devices.

SIGNAL CONVENTIONS
Signals may be active high, active low or active in two states. An active high signal is one Which, in the high
state, causes events to occur, while in the low state has no significance. A signal that is active low causes
events to occur when in the low state, but has no significance in the high state. A signal that has two active
states will cause two different types of events to occur, depending upon whether the signal is high or low; this
signal has no inactive state. Within this book a signal that is active low has a bar placed over the signal name.
For example, WR identifies a "write strobe" signal which is pulsed low when data is ready for external logic to
receive. A signal that is active high or has two active states has no bar over the signal name.

xi

TIMING DIAGRAM CONVENTIONS
Timing diagrams play an important part in the description of any microprocessor or support device. Timing
diagrams are therefore used extensively in this book. All timing diagrams observe the following conventions:
1)

A low signal level is equivalent to no voltage. A high signal level is equivalent to voltage present:

No voltage

2)

A single signal making a low-to-high transition like this:

A single signal making a high-to-Iow transition is illustrated like this:
high

4)

high

I

low

3)

Voltage present

I

\

low

When using two or more parallel signals exist. the notation:

r=

signals change

I
states that one or more of the parallel signals change level. but the transition (high-to low or low-to-high) is
unspecified).
5)

A three-state single signal is shown floating thus:

~-------~
Signal
floating

6)

A three-state bus containing two or more signals is shown floating thus:

_______r---~~---4~-----floating

7)

When one signal condition triggers other signal changes. an arrow indicates the relationship as follows:
Cond'bon ~

J

h".

Causes
change
here

xii

Thus a signal making a low-to-high transition would be illustrated triggering another signal making a high-to-Iow
transition as follows:

-~----A signal making a high-to-Iow transition triggering a bus change of state would be illustrated as follows:

c::::..x

8)

When two or more conditions must exist in order to trigger another logic event. the following illustration is used:

The,.

~

cond;tio",

)

cause
change
here

Thus a low-to-high transition of one signal occurring while another signal is low would be illustrated triggering a
third event as follows:

9)

When a single triggering condition causes two or more events to occur, the following illustration is used:

condition
This

~

causes
these
changes

xiii

Thus a low-to-high transition of one signal triggering changes in two other signal levels would be illustrated as
follows:

10)

All signal level changes are shown as square waves. Thus rise and fall times are ignored. These times are given in
the data sheets which appear at the end of every chapter.

INSTRUCTION SET CONVENTIONS
Every microcomputer instruction set is described with two tables. One table identifies the operations which
occur when the instruction set is executed, while the second table defines object codes and instruction times.
Because of the wide differences that exist between one instruction set and another, we have elected not to
use a single set of codes and symbols to describe the operations for all instructions in all instruction sets. We
believe any type of universal convention is like to confuse rather than clarify; therefore each instruction set
table is preceded by a list of symbols as used within the table alone.
A short benchmark program is given to illustrate each instruction set. Some comments regarding benchmark
programs in general are, however, in order. We are not attempting to highlight strengths or weaknesses of
different devices, nor does this book make any attempt to comparative analyses, since the criteria which make
one microcomputer better than another are simply too dependent on the application.
Consider an application which requires relatively high speed processing. The only important criterion will be program execution speed, which may limit the choice to just one of the microcomputers we are describing.

COMPARATIVE
ANALYSIS

Execution speeds of all of the microcomputers may, on the other hand, be quite adequate for a second application; in
this case, price may be the only overriding factor. In a third application, a manufacturer may have already invested in a
great deal of engineering development expense, using one particular microcomputer that was available in quantity earlier than any others; the advantages or disadvantages of using a different microcomputer, based on minor cost of performance advantages, will likely be overwhelmed by the extra expense and time delays involved with switching in
midstream.

And what about benchmark programs 7
There have been a number of benchmark programs in the literature, purporting to show the
strengths or weaknesses of one microcomputer versus another; individual manufacturers
have added to the confusion by putting out their own competing benchmarks, aimed at showing their product to
be superior to an immediate rival.
Benchmark programs are misleading, irrelevant and worthless for these reasons:
1)

In a majority of microcomputer applications, program execution speed, and minor variations in program
length, are simply overwhelmed by pricing considerations.

2)

Even assuming that for some specific application, program length and execution speed are important, trivial
changes in the benchmark program definition can profoundly alter the results that are obtained. This is one
point we will demonstrate in this book, while describing individual instruction sets.

3)

Benchmark programs are invariable written by the smartest programmers in an organization, and they take
an enormous amount of time to ensure programming accuracy and excellence. This is not the level at which
any user should anticipate "run of the mill" programmers working; indeed, a far more realistic evaluation of
a microcomputer's instruction set could be generated by giving an average programmer too little time in
which to implement an incompletely defined benchmark. This will more closely approximate the working
conditions under which real products are developed. Of course, defining the "average programmer," "too
little time" and an "incomplete specification" are all sufficiently subjective that they defy resolution.
xiv

We will demonstrate the capriciousness of benchmark programs via the following benchmark program:
Raw data has been input to a general purpose input buffer. beginning at IOBUF. This raw data is to be moved to
a permanent table. which may be partially filled; the raw data is to be stored in the data table starting with the
first unfilled byte. The benchmark may be illustrated as follows:

r-----....

TABLE

HOW THIS BOOK HAS BEEN PRINTED
Notice that text in this book has been printed in boldface type and lightface type. This has been done to help you
skip those parts of the book that cover subject matter with which you are familiar. You can be sure that
lightface type only expands on information presented in the previous boldface type. Therefore. only read boldface
type until you reach a subject about which you want to know more. at which point start reading the lightface type.

xv

Chapter 1
THE NATIONAL SEMICONDUCTOR
PACE AND INS8900
PACE was developed by National Semiconductor as a single-chip implementation of its multi-chip IMP-16.
Since it was the first 16-bit. single-chip microprocessor. PACE is the first 16-bit microprocessor described in
this book.
As might be expected of an early entry product. PACE had a number of problems - both in design and fabrication
technology - which limited its acceptance. Therefore the INS8900 was recently introduced by National Semiconductor. The INS8900 is a redesigned. NMOS PACE. with internal logic problems resolved.

In this chapter we will describe both PACE and the INS8900. Specifically. we will identify the problems faced by a
PACE user. which have been eliminated in the INS8900.
PACE and the INS8900 are 16-bit microprocessors because they handle data in 16-bit units. In many ways. however.
the internal architecture of PACE and the INS8900 have an 8-bit orientation; this is something you should keep in mind
while reading this chapter. because it does result in PACE and the INS8900 having program execution speeds that are
comparable to. rather than being significantly faster than. the 8-bit microprocessors we have described in earlier chapters.
The only current manufacturer for PACE and the INS8900 is:
NATIONAL SEMICONDUCTOR. INC.
2900 Semiconductor Drive
Santa Clara. CA 95050
There are agreements between Rockwell International and National Semiconductor and between Signetics and
National Semiconductor to exchange microcomputer technical information and to produce each other's products. At
the present time, neither Signetics nor Rockwell International has elected to second source PACE or the INS8900, and it
is extremely unlikely that they will since both PACE and the INS8900 are products with limited futures. The amount of
support that National Semiconductor provides is rapidly declining as newer, more powerful 16-bit microprocessors
enter the marketplace.
As shown in Figure 1-1, a typical PACE microcomputer will consist of a mixture of special-purpose PACE support
devices and standard devices. The PACE microcomputer devices described in this chapter consist of:

• The PACE CPU
• The System Timing Element (STE). which generates clock signals for PACE and the system.
• The Bidirectional Transceiver Element (BTE). which converts the MOS-Ievel PACE signals to TTL-level signals
for other devices. The BTE is 8 bits wide.
The INS8900 needs a clock generator; a 2 MHz crystal and a 74C04 inverter are recommended. Otherwise. there are no
special INS8900 support devices; in fact. you can easily use any NMOS support devices described in Volume 3
with the INS8900. Specifically. the STE and BTE devices cannot be used with the INS8900. because they provide
MOS-to-TTL signal level conversions for PACE
PACE requires +5V. +8V and -12V power supplies. The +8V is a substrate vcltage requirement of the CPU and can be derived from the +5V power using a few discrete components.
Therefore, a system can be implemented using only two primary power supplies: +5V and
-12V. The INS8900 also uses three power supplies: +12V. +5V and -8V.

PACE/INS8900
POWER SU PPL Y
EXECUTION
SPEED

The INS8900 uses a 500 nanosecond clock to provide typical instruction execution times in the range of 8 to 20
microseconds. PACE (tPC-16A/520D) uses a 750 nanosecond clock to provide typical instruction execution times in
the range of 12 to 30 microseconds.

1 ·1

Before making direct comparisons of these instruction execution times with those of other devices. however. note
carefully that because of the 16-bit architecture of PACE and the INS8900. it may take many instructions on another
microcomputer to perform the same operations as a single INS8900/PACE instruction.
MOS level signals are input and output by PACE. TTL level signals are input and output by the
INS8900.

PACE/INS8900
LOGIC LEVEL

P-channel silicon gate. MOS/lSI technology is used with PACE. N-channel MOS technology is
used by the INS8900.

PACE AND INS8900 MICROCOMPUTER SYSTEM OVERVIEWS
Figure 1-1

conceptually illustrates a PACE system. Figure 1-2 conceptually illustrates an INS8900 system.

As with any mini- or microcomputer system, the CPU outputs data, address, and control signals. In the case of
PACE and the INS8900, the data and address signals use the same bus lines; therefore, they are said to be
multiplexed.
Timing signals needed by PACE are generated by the System Timing Element (STE).
PACE signals are all MOS level; the STE therefore generates two sets of timing signals;
one set are MOS level for PACE, the other set are TTL level for external logic.

SYSTEM TIMING
ELEMENT (STE)
BIDIRECTIONAL

Since PACE signals are MOS level, Bidirectional Transceiver Elements (BTEs) must be
TRANSCEIVER
present to translate outgoing signals from MOS to TTL levels, and to translate incoming
ELEMENT (BTE)
signals from TTL to MOS levels. BTEs are quite indiscriminating in the signals they translate:
in either direction. any signal arriving at an input pin is faithfully reproduced at the corresponding output pin. Control signal options allow a BTE to operate bidirectionally. to drive output Signals only. or to
place both the MOS and TTL outputs in a high-impedance mode. Since the BTE is 8 bits wide. two BTEs operating
bidirectionally provide buffering for the 16-bit Address/Data Bus. A third BTE. operating in the drive-only mode. provides buffering for the PACE control signals (NADS. ODS. IDS. and Flags).
A complete TTL level bus is created by combining BTE outputs with the TTL level timing
signals output by the STE. Remember. though. that the 16 address/data lines are multiplexed.
External logic that can demultiplex these lines and that can respond to the PACE timing and control signal logic can connect directly to the TTL level address/data lines. For example. National Semiconductor provides
ROM and RAM devices with on-chip address latches: these devices can interface directly to the TTL level bus.
ADDRESS
If memory devices or I/O ports are used that cannot demultiplex the address/data lines. you must
LATCHES
provide separate logic to perform this function. No special PACE family devices are available for
AND
this purpose: however. standard logic devices can be used. For example. two hex flip-flop devices
and a quad flip-flop device would provide a latched 16-bit Address Bus. Two 8212 I/O ports could
DECODERS
also be used to latch the 16 bits of address information. The PACE Address Data Strobe (NADS)
signal can be used as the ClK input to the flip-flops or as the STB input to the 8212s. The PACE Address Data Strobe
(NADS) signal can be used as the ClK input to the flip-flops. In many systems this is the most effective approach since
a latched Address Bus allows you to use simpler address decoding techniques to generate memory chip enable and I/O
port select Signals.
Figure 1-2 illustrates an INS8900 microcomputer system. logic is quite elementary - and equivalent to that
which you would expect with any other microcomputer. Control Bus. Data Bus. and Address Bus lines are buffered
using INS8208 bidirectional buffers. These are National Semiconductor standard catalog devices. recommended by
National Semiconductor and illustrated in their literature: however. any other buffer would do equally well. The
Data/Address Bus is shown being demultiplexed by 8212s to create separate Data and Address Busses. This again is
straightforward logic.

1-2

INTERRUPT
AND JUMP

-

CONDITIONS

STE

PACE

()

"

ADDR/DATA

~

CONTROL

'4-.../

BTE
(2)

BTE

TTL LEVEL TIMING/CONTROL

:;:;

If

..

RAM WITH

ROM WITH

ADDRESS

ADDRESS

LATCHES

LATCHES

TTL LEVEL
ADDRESS/DATA

ADDRESS
LATCHES
AND/OR
DECODERS

I/O PORT
•••••• , ••4)

:i :.--"..

···· ...
~

8212,

8255

:

·: .:
: !

: i

"
MEMORY
WITHOUT
ADDRESS
LATCHES
TTL LEVEL
ADDRESS

DATA

~V,

~V,
DATA

SENSE

CONTROL

ADDRESS

LINES

LINES

LINES

LINES

IN

OUT

OUT

IN/OUT

Figure 1-1. A National Semiconductor PACE Microcomputer System

1-3

SENSE LINES IN

CONTROL BUS

INS8900

TWO
INS8208s

nnOi

74C04

TWO

INVERTER

INS8212s

ROM

RAM

PERIPHERAL

Figure 1-2. A National Semiconductor INS8900 Microcomputer System

INS8900 PROGRAMMABLE REGISTERS
The INS8900 (and PACE) has four 16-bit Accumulators and a 16-bit Program Counter; these registers may be illustrated as follows:
ACO
AC1

Secondary Accumulator

AC2

Secondary Accumulators

AC3
PC

and Index Registers
Program Counter

Primary Accumulator

Accumulator ACO may be likened to a primary Accumulator as described for our hypothetical microcomputer in
Volume 1.
Accumulator AC1 is a secondary Accumulator.
Accumulators AC2 and AC3 are equivalent to a combination of secondary Accumulators and Index registers.
Recall from Volume 1, Chapter 6 that an Index register differs from a Data Counter in that the Index register contents
are added to a displacement (which is provided by a memory reference instruction) in order to determine the effective
memory address.

The Program Counter serves the same function in an INS8900 system as it does in our hypothetical microcomputer described in Volume 1.
Figure 1-3 illustrates that part of our general microcomputer system logic which has been implemented in the
INS8900 microprocessor.

1-4

Clock Logic

Interface Logic

Interface Logic

Programmable
Timers

Read Only
Memory

I/O Ports

Figure 1-3. Logic of the INS8900 Microprocessor

INS8900 STACK
A Stack is provided on the INS8900 (and PACE) chip. The Stack is 16 bits wide and 10 words deep. The Stack is
not a cascade stack. as described in Volume 1. Chapter 6; rather. chip logic maintains its own Stack Pointer to identify
the next free Stack word. The Stack Pointer is automatically incremented and decremented in response to Push and
Pull operations. Stack Push and Pull operations are initiated by CPU logic during execution of Jump-to-Subroutine
(JSR) and Return-from-Subroutine (RTS) instructions. and during interrupt processing. to automatically save and
restore the Program Counter.
In addition. the Stack can be used for temporary storage of data or status information. There are instructions
which allow you to transfer words between the Stack and any Accumulator. or the Status and Control Flag register.
This capability can significantly reduce the number of memory accesses required (thus increasing system speed) and
can also reduce read/write memory requirements since intermediate values can be stored on trh-.e.S..t.a-.c..k_ _ _..
Whenever the Stack becomes completely filled or emptied. an Interrupt Request is
generated on the INS8900 chip. If you have enabled Stack Interrupts. program execution will
be suspended. allowing you to deal with the situation. A Stack Fu II condition will indicate that
it is time to dump data accumulated on the Stack out to read/write memory.

1-5

INS8900 AND
PACE STACK
INTERRUPTS

INS8900 AND PACE ADDRESSING MODES
Most INS8900 (and PACE) memory reference instructions use either direct or direct, indexed addressing. A few
instructions also offer indirect addressing and pre-indexed, indirect addressing. Refer to Volume 1, Chapter 6 for a
description of these addressing modes.
All memory reference instructions have the following object code format:

15 14 13 12 11 10 9 8

II I I I

f

7 6

5 4 3 2 1 0 ~ Bit No.

IxlRf I I I I I

-

f

l

II

-

....~.~,.
........~~r-~-y~~~....___
..~~......~/

'~

' - - - - - - - - - Address displacement
{ Addressing mode selection

J 00 = Base Page address

--------------- 11

PROCESSOR
DURATION
CYCLES

-:_
",:..
_ . - - - DRIVEN LOW EXTERNALLY

APPROX. 4 CYCLES

STALL

I

RESUME NORMAL OPN

~~f~I--~mm~

.. ~

.. ""'"

..._ _ _ _ _ _ _ _ _ _ _ _ _....J DRIVEN HIGH EXTERNALLY

NHALT

(OR USING INTL. PULLUP)

1-----::::

o

3 ClK CYCLES

~ 5+te

CYCLES

....I
....I

2: 4

CYCLES

~

CO NT

CONTINUE DRIVEN
EXTERNALLY
.....f - -.........--CONTINUE DRIVEN BY PACE - - - - -__........----~
(EXTERNAL CIRCUITS HIGH IMPEDANCE)

CONTINUE
DRIVEN
EXTERNAUY

~:

1. EXTERNAUY GENERATED TTL INPUTS
OVERRIDE PACE MOS OUTPUTS.
2, ~ CROSSHATCH INDICATES "DON'T

~

CARE" INPUT STATE.

3. te = DURATION OF EXTEND DURING
PACE I/O CYCLES. TIMING ASSUMES
NO OTHER EXTENDS AND NO SUSPENDS.

Figure 1-10. Timing Diagram for Processor Stall USing
NHALT and CONTIN Signals
But we must have a way of determining whether the CPU is going to be using the System Busses. There are
several methods of making this determination; we will conceptually examine each of them within the context of three
different DMA schemes:
1)

DMA block data transfers initiated by the CPU

2)

DMA block data transfers initiated by external logic

3)

Cycle-stealing DMA transfers

From a hardware point of view, the simplest method of implementing DMA in a PACE or
CPU
INITIATED
INS8900 system is to have the CPU initiate block transfers of data. Consider the following
DMA BLOCK
approach. The CPU will treat an external DMA controller as a peripheral device and will estabDATA TRANSFERS
lish initial conditions such as starting address, word count. and direction (memory read or
write). This information can be passed to the controller by treating its registers as memory
locations and using Store instructions to write into the registers. When the required information has been passed, the
CPU simply executes a Halt instruction. As we described earlier, when a Halt instruction is executed, the NHAL T
control output line from the CPU is driven low (7/8 duty cycle). This signal could thus be used by the DMA controller as an indication that the CPU will not be using the System Bus and the DMA transfer can begin. When the
transfer is completed, the DMA controller will use the CONTIN input to the CPU, as shown in Figure 1-9 , to
terminate the Halt instruction. Normal CPU operation will then resume.

1-16

DMA BLOCK
DATA TRANSFERS
INITIATED BY
EXTERNAL LOGIC
IN PACE AND
INS8900
SYSTEMS

Most microprocessor.s have a Bus Request input signal that can be used by external logic to request access to the System Busses. In a PACE or INS8900 system. the NHAL T input signal
can be used to force the CPU into a Processor Stall. as described earlier. and thus free
the System Busses for DMA operations. The Acknowledge Interrupt (ACK INT) pulse on
the CONTIN output line shown in Figure 1-10 is then equivalent to a Bus Grant signal.
and the DMA controller may begin the data transfer. When the transfer is complete. the
CONTIN line is used as a control input line to the CPU to terminate the Processor Stall.

CYCLE-STEALING
Cycle-stealing DMA operations typically transfer a single word via the System Busses during a
DMA IN PACE
brief interval when the CPU is not using the busses. With this method. CPU operations need
AND INS8900
not be stopped; instead. they are only slowed down slightly. or in some cases not affected at
all. In order to implement cycle-stealing DMA. external logic must have a way of detectSYSTEMS
ing those time intervals when the CPU will not be using the System Busses. There are' ' - - - - - - - -...
two ways that this can be accomplished with the INS8900 or PACE CPU. The first method involves the use of the EXTEND input signal to the CPU to suppress or suspend input/output operations; the second method uses a special technique to sense when the CPU is beginning an internal (non-I/O) machine cycle.
Earlier we described how to use the EXTEND input signal to lengthen the CPU input/output cycles. The EXTEND signal can also be used to prevent the CPU from beginning an I/O cycle. and
thus ensure that the System Busses will be available to external devices for DMA operations.

EXTEND USED
TO SUSPEND
INS8900 AND
PACE I/O
DURING DMA
OPERATIONS

Figure 1-11 illustrates both uses of the EXTEND signal. The CPU looks at the EXTEND input signal at internal clock phases T1 and T6. Notice that during I/O cycles the IDS or ODS signal goes
high at the beginning of T6 and low at the beginning of T1. If EXTEND is high during T6. then extra clock cycles are inserted after T8; this is the method that would be used to lengthen an I/O cycle. If EXTEND is high during T1. then extra clock cycles are inserted between T3 and T4; this is the method we would
use for DMA operations.
The trailing edge of IDS/ODS indicates that the CPU has just completed an I/O cycle and is therefore not using the
System Busses at this instant. By setting EXTEND high at this time. we suppress the beginning of another I/O cycle
while we use the busses for a DMA transfer.
Notice that we are merely lengthening the beginning of the machine cycle. and thus delaying that part of the machine
cycle where the CPU might begin I/O activity. We do not know whether the current machine cycle will be an internal
machine cycle or an I/O cycle. and we do not care. We have merely stolen the busses by slowing down the CPU.

I

.

I

750 nsec

~

1.5 j1.sec

I..

~

Internal
I
Clock Phase :T1 T2 T3 T4 T5 T6 T7 T8 EEl T1 T2 T3 E E T4 T5 T6 T7 T81T1 T2 T3 E

,
IDS/ODS

I

I

j...---""

CPU I/O CYCLE

CPU I/O CYCLE

CPU I/O CYCLE

EXTENDED ONE CLOCK

DELAYED ONE CLOCK
PERIOD

DELAYED TWO CLOCK
PERIODS

I

!.. .1
1.5 j1.sec

C .l
2.25 j1.Sec

Figure 1-11. Using PACE EXTEND Signal for Cycle-Stealing DMA

1-17

I

I

I

PERIOD
BUS
AVAILABLE

~I

E E E T4 T5 T61

There are two draw\Jacks inherent in the EXTEND method of cycle-stealing DMA. First. whenever we use the System
Busses for a DMA transfer. we slow down the operation of the CPU. Second. we must wait until the CPU has just completed an input/output cycle before we can perform the cycle steal. Since only about one-third of the CPU machine cycles are used for 110. this means that bus access for DMA will be quite limited. Both of these drawbacks can be eliminated if we can find some technique for determining when the CPU is performing an internal (non-I/O) machine cycle.
We could then use the System Busses any time that the CPU is not using them (which is more than 60% of the
time) and we could perform the 'DMA transfer without slowing down CPU operations. We shall now describe
just such a technique.
CYCLE-STEALING
We stated earlier in this chapter that the internal clock phases (T1 through T8) are not availaDMA DURING
ble to external logic. However. National Semiconductor data sheets include a figure that shows
INS8900 AND
circuits for internal drivers and receivers. A detailed examination of this figure reveals a very
PACE INTERNAL
interesting and useful fact: the JC13 (Jump Condition 13) pin on the CPU is intended as an input signal: but because of the way in which the receiver for this signal is designed. it also proMACHINE CYCLES
duces an output pulse on the JC13 pin during every machine cycle. The output pulse occurs
during T4 of each machine cycle. and we can use this fact to design a very efficient cycle-stealing DMA arrangement.

~~-------------------------------------------------- BUS REQUEST
(From DMA Device)

NADS

D

Q

~----------------------~~~BUsGRANT

(To DMA Device)

CLR

CLK

DIVIDE-BY -FOUR

CLR
NINIT

-----------------1........-------------'

TCLK--------------------------------------------------~

(From

STE)
Figure 1-12. Idealized Circuit for Cycle-Stealing DMA During INS8900 and
PACE Internal Machine Cycles

Figure 1-12 shows a circuit that uses the output pulse provided by JC13 to implement cycle-stealing DMA. Recall
that the CPU sends out a negative-going NADS pu Ise at T4 of every input/output cycle. This NADS signal is ANDed in
our circuit with an external device's DMA Bus Request and applied to the D input of a flip-flop. The JC13 output pulse.
which also occurs at T4. is inverted via a transistor and applied to the clock input of the flip-flop. Thus. if NADS is high
at T4 (indicating that the current CPU machine cycle is not an I/O cycle) the flip-flop will be set if there is a Bus Request
present. The output of this flip-flop is then used by external logic as a Bus Grant signal and the DMA transfer can be in-

1-18

itiated. Since we do not know whether or not the next cycle will be a CPU I/O cycle. we must terminate DMA activity on
the bus prior to the next T4 time. In Figure 1-12. this is accomplished using a divide-by-four counter.
The ClK input to the counter is a combination of the Bus Grant signal and the TClK signal which is available from the
PACE STE. This results in the timing shown in Figure 1-13. Notice that this scheme makes the bus available for about
7/8 of a machine cycle. or approximately 2.25 microseconds. If you refer back to Figure 14-10 you will notice that this
is about the same length of time as was obtained by using the maximum du ration of EXTEND. So. we have not increased the maximum time available for a DMA transfer. But. we have made two significant gains: DMA transfers can
occur more frequently. and these transfers do not slow down CPU operations.
We must add a final note of caution to the description of this otherwise straightforward DMA technique. There are
several critical timing paths in the idealized circuit shown in Figure 1-12. Both the JC 13 pulse and the NADS signal
occur at T4. although the trailing edge of NADS does occur slightly after the trailing edge of JC13. Therefore. the components used to provide ClK and D inputs to the flip-flop must be selected carefully to ensure that there is not a race
condition. Additionally. we have shown the Bus Grant signal being reset at the end of T3. Since the leading edge of
NADS occurs at T4. this timing relationship can be critical. However. if external devices such as address latches and
decoders use the trailing edge of NADS. this timing should present no problems.
T3

T4 T5 T6 T7

TB T1

T2 T3

T4 T5 T6 T7 TB

T1

T2 T3

T4 T5

NClK
(TClK*)
ClK
(TClK)
JC13

~~ ____________~r-\~

______________________

T1

NADS

BUS REO

BUS GRANT

~

2.25 fLsec for DMA Transfer

Figure 1-13. Timing for Cycle-Stealing DMA During INS8900 and PACE Internal Machine Cycle

THE INS8900 AND PACE INTERRUPT SYSTEM
The INS8900 and PACE CPUs have complete on-chip interrupt systems. Six separate levels of interrupts are
provided: one internal and five external interrupt request inputs. including a non-maskable input. Priority logic is
provided on the CPU. and all interrupts are vectored. thus eliminating any polling requirements. Because of the
various ways in which interrupts can be initiated. and also because of a few problems that exist in the PACE interrupt system. we will divide our description of the system into three parts:
1)
2)
3)

Low priority external interrupts
Internal (Stack) interrupts
Non-maskable (Level 0) interrupts

But first. let us take an overview of the INS8900 and PACE interrupt system.

1-19

IRO
INT
ENABLE

lEN

INTERRUPT
LEVEL 0
INTERRUPT
NHALT

"

(TO CPU'S INTERNAL
CONTROL CIRCUIT)

REQUEST

(lRO)

.-.

""

J

STACK FULL OR
EMPTY INT REQ
(INTERNAL TO PACE)

,
s
IR1

f-

t-H

R

i'""

~

IE1

4

~

NIR2

)-[>0.....
.-

IR2
R
~

IE2

(

NIR3

....
~

}[>0i'""

j

S

.f

PRIORITY
ENCODER
~

....

-

)

S
IR3
R

IE3

NIR4

)-£>0....

S
IR4
R

IE4

(

NIR5

)-1>0i'""

S
IR5
R

IE5

Figure 1-14. Internal View of INS8900 and PACE Interrupt System

1-20

INTERRUPT

POINTEA
ADDRESS

Figu re 1-14 depicts the interrupt log ic that is contained on the CPU. The highest priority in-·
terrupt request is the non-maskable Level 0 interrupt request, which is initiated using
the NHALT control input to the CPU. The lowest priority interrupt request is NIR5.

I NS8900
AND PACE
INTERRUPT
PR.IORITIES

The Stack Interrupt and each of the four lower-priority external interrupt requests can be
ENABLING AND
individually enabled or disabled by setting or clearing associated bits (lE1 - IE5) in the
DISABLING
Status and Control Flag register. Notice in Figure 1-14 that these bits are shown as providINS8900 AND
ing the 'R' input to a latch. The'S' input to each of these latches is the actual interrupt request
PACE INTERRUPTS
line. The significance of this is rather subtle. It means that an interrupt request need not supply
a continuous low level until it is acknowledged. Instead, any pulse exceeding one PACE clock
period will set the associated interrupt request latch: this allows narrow timing or control
pulses to be used as interrupt request inputs. Note, however, that the 'R' input to the latches overrides the'S' input.
Therefore, if the individual Interrupt Enable flag is reset. it not only prevents the latch from being set by interrupt requests, it will also clear a previously latched request that mayor may not have been serviced. If this logic is not clear to
you, you shou Id study the characteristics of the RS flip-flop.
A master interrupt enable (lEN) flag is also provided in the Status and Control Flag register. lEN must be set true
to allow any of the latched interrupt requests to be recognized by the CPU.
The CPU checks for interrupts at the beginning of every instruction fetch. If an interrupt request is
present (and enabled!. the instruction fetch is aborted, the contents of the Program Counter are
pushed onto the Stack, and the master interrupt enable (lEN) is set low. The CPU then loads the
Program Counter with the address vector for your interrupt service routine and executes the instruction contained at that address. (We'll describe the address vectors in the next paragraph.)
The interrupt request just described requires a total of 28 clock cycles from the time the interrupt is
CPU until the time when the first instruction of your interrupt service routine begins execution.

Memory locations 000216 through 000816 are used as pointer locations or address vectors.
You load each of these locations with the starting address of the interrupt service routine for each
interrupt as follows:
MEMORY LOCATION

2
3
4

5
6
7

8

INTERRUPT POINTER FOR
Stack Interrupt
NIR2
NIR3
NIR4
NIR5
Level 0 Program Counter Pointer
Level 0 Interrupt Origin

l

r

INS8900 AND
PACE
INTERRUPT
RESPONSE
recognized by the

INS8900
AND PACE
INTERRUPT
POINTERS

Special
case

The level 0 interrupt is a special case which we will describe on its own. But first let us look at interrupts in
general.
When the CPU responds to an interrupt. it loads the Program Counter with the contents of memory locations 2 through
6, depending on the specific level of interrupt that is being acknowledged. Control is thus vectored to the proper service routine. Suppose, for example, memory location 4 contains the value 2A3016. If an interrupt request occurring at
pin NIR3 is acknowledged, then during the acknowledge process the contents of the Program Counter are saved on the
Stack, following which the value 2A3016 is loaded into the Program Counter. Had the value 472816 been in memory
location 4, then 472816 would have been loaded into the Program Counter instead of 2A3016. Thus. whatever memory address is stored in the memory location associated with the interrupt being acknowledged. this address will be
loaded into the Program Counter, becoming the starting address for the specific interrupt service routine to be executed.

INS8900
As part of the interrupt response we've just described. the CPU sends out a low-going pulse on
AND PACE
the CONTIN line. Refer back to Figure 1-10 and associated text for a description of the ACK
INTERRUPT
INT pulse. The last instruction executed by your interrupt service routine must be a Returnfrom-Interrupt (RT!) instruction. This instruction sets lEN high to re-enable interrupts. then
ACKNOWLEDGE
AND RETURN
pulls the top of the Stack into the Program Counter. This returns program control to the point
FROM INTERRUPT
where it was interrupted. The RTI instruction does not clear the internal Interrupt Request
latch; therefore your interrupt service routine must reset the latch (using a Pulse Flag instruction), or the same interrupt request will still be present after the RTI instruction has been executed. Once the latch has
been cleared. it can then be re-enabled for subsequent interrupt requests.

1-21

The interrupt sequence does not save the contents of any registers except the Program Counter. If
the program that was interrupted requires that the contents of CPU registers be saved and then
restored. your interrupt service routine must perform these operations.
The CPU's response to a Stack interrupt is as described for external interrupts. However. the interrupt request is generated internally by the CPU chip; it can be caused either by a Stack Full or a
Stack Empty condition. Remember that the 10-word Stack is part of the CPU chip. It consists of an
internal RAM and a pointer that can address Stack words 0 through 9. A Stack Empty interrupt request is generated whenever the pointer is at 0 and a Pull instruction is executed. A Stack Full interrupt request occurs when the pointer is at 7 (eight entries on the Stack) and a Push instruction
is executed to fill the ninth word. The tenth word of the Stack will then be used as part of the interrupt response to store the Program Counter contents. Unless you intend to extend the Stack out
into main memory. your application program will not require a Stack Empty or Full interrupt. These
error conditions and can be avoided by careful programming.

SAVING
INS8900 AND
PACE CPU
REGISTERS
DURING
INTERRUPTS
INS8900 AND
PACE STACK
INTERRUPTS

interrupts become

If your program is treating the Stack Empty and Stack Fu II interrupts as error conditions. then you can disable Stack interrupts. in which case the full ten words of the Stack are available for nested interrupts and subroutines. Of course.
this means that a Stack Full or Empty condition. should it occur. will become an undetected error. with unpredictable
consequences.

PACE
When using PACE. but not the INS8900. there is an additional reason for not using the Stack interrupt capability unless you really need it. PACE has an internal circuit problem that can cause
STACK
improper interrupt response. If a Stack interrupt request occurs at the same time as an NIR3
INTERRUPT
or NIR5 interrupt request, the Stack interrupt address vector will be incorrectly accessed
PROBLEMS
from location 0 instead of location 2. The solution recommended in PACE literature is to load
both of these locations with the Stack interrupt vector. This apparently straightforward solution is complicated by the
fact that location 0 also happens to be the initialization address; whenever the CPU is initialized. the first instruction executed is the one that is contained in location O. Thus. the word in location 0 must serve a dual purpose:
1)

It serves as an instruction whenever the CPU is initialized.

2)

It serves as an address vector if a Stack interrupt occurs at the same time as NIR3 or NIR4.

Here's an example. The object code for a Copy Flags to Register (CFR) instruction is 040016. So. if locations 0 and 2
both contain a value of 040016 the problem is solved. Your Stack interrupt service routine would have to begin at
memory address 040016. but you would be correctly vectored to that address regardless of whether or not the interrupt error we've just described occurs. On initialization. the first instruction executed would be the CFR instruction: this
is not a very useful initialization instruction. but at least no damage is done.

For a fuller discussion of this interrupt problem and the solution. refer to PACE literature. Also keep in mind that
the problem has been fixed in the INS8900.
The non-maskable (Level 0) interrupt cannot be disabled and differs from the other interrupt levels both in the
way it is initiated and in the way the CPU responds to it.
The Level 0 interrupt request is initiated using the NHALT control input signal in comINS8900
bination with the CONTIN input line. Figure 1-15 shows the timing relationships betAND PACE
ween NHAL T and CONTIN that are required to initiate the non-maskable interrupt. If you
NON-MASKABLE
(LEVEL 0)
compare this figure with Figure 1-10. you will notice that the Level 0 interrupt request and
the Processor Stall begin in exactly the same way; NHAL T is driven low by external logic and
INTERRUPT
held low for some time after a low-going pulse (ACK INT) has been sent out on the CONTIN
line. The only difference between the two operations is towards the end of the timing sequence. For a Processor Stall.
NHALT is allowed to return high whi.le CONTIN is still high; for a Level 0 interrupt. the CONTIN line must be driven low
by external logic before the NHAL T line is allowed to go high. This critical timing sequence is the only way that the CPU
has to differentiate between a Processor Stall and a Level 0 interrupt. Notice that this Level 0 interrupt timing sequence
never requires external logic to drive CONTIN high. Therefore. if you're using the CONTIN line for any of its other multiple functions (including the ACK INT output pulse) you can merely tie CONTIN to ground and Use NHALT to initiate the
Level 0 interrupt.
The response of the CPU to the Level 0 interrupt is subtly different from its response to
INS8900
other interrupts. These subtle differences are related to the slightly different purpose of a nonAND PACE
maskable interrupt versus a normal program interrupt request. A non-maskable interrupt is
LEVEL 0
typically used only when there is a catastrophic error or failure (such as loss of power) or to impleINTERRUPT
ment a control panel for program development or debug purposes. Both of these uses require that
RESPONSE
an asynchronous. unplanned program termination have a minimum effect upon system status;
that is. you want to leave behind a picture of the system as it looked immediately before the program termination occurred.

1-22

o

I--- >

11

+'e

cycusi®

CYCUS1

~ 8 +'e

~DRIVENLOWEXTERNALLY

~U

.,-

NHALT

DRIVEN HIGH EXTERNALLY
(OR USING INTERNAL PULLUP)

I
I

5 CLOCK CYCLE MIN.

..J
W

~

$.

3 CLK

CYCLES

~

~

~

EXTERNALLY

~

-

I

~
CONTINUE DRIVEN EXTERNALLY

I

I

J

CONT

I

CONTINUE DRIVEN BY PACE

- I

5 + 1e CYCLES

\

~

EXECUTION

-

I

• ACK .•

APPROX.2 1/2+te0~

I

>

.. So 15 + 21e CYCLES0
__ J

CLOCK CYCLES
CONTINUE
DRIVEN

0)

INTERRUPT RESP. TIME

o

I

-

EXECUTION SUSPENDED

I

- I

INTERRUPT SERVICE STARTS

-

NOTES:
1. EXTERNALLY GENERATED TTL INPUTS
OVERRIDE PACE MOS OUTPUTS
2. ~ CROSSHATCH INDICATES "DON'T

~ CARF'INPUT STATE.
3. te = DURATION OF EXTEND DURING PACE
I/O CYCLES. TIMING ASSUMES NO OTHER
EXTENDS AND NO SUSPENDS

Figure 1-15. Initiating INS8900 and PACE Level 0 Interrupt
Using NHALT and CONTIN Signals
Remember that other levels of interrupts store the contents of the Program Counter or the Stack and reset the lEN flag
in the Status and Control Flag register. This sequence obviously alters the "picture" of the CPU, since both Stack contents and Status and Control Flag register contents are changed. To avoid this, the Level 0 interrupt response by the
CPU uses an external memory location to store the contents of the Program Counter. Memory location 000716 holds
the address of the memory word where the Program Counter will be stored. The contents of the Status and Control Flag
register are unaltered. CPU internal circuitry resets an "IRO INT ENABLE flag to prevent another interrupt from being
recognized (refer to Figure 1-16). but this is not discernible to you. After the Program Counter has been saved in the
designated memory location, the instruction contained in memory location 000816 is executed: this is the first instruction of your Level 0 interrupt service routine. Suppose, for example, that memory location 000716 contains the value
FF0016. Following a Level 0 interrupt request. the Program Counter contents will be stored in location FFO016. Following the Level 0 interrupt acknowledge, the actual instruction stored in memory location 000816 is executed.
Note that the Level 0 interrupt acknowledge sequence has not altered anything within the CPU that is discernible to
you or to a program: the Stack, Accumulators, and Status and Control Flag register are all unchanged. Additionally,
avoiding use of the Stack ensures that there will not be a Stack overflow - and in consequence a Stack interrupt will
not be generated by this interrupt response sequence.

RETURN FROM
The normal Return-from-Interrupt (RTIl instruction that must be executed at the end of your interrupt service routine causes the Program Counter to be restored from the Stack Since the Level 0
PACE LEVEL 0
interrupt sequence does not utilize the Stack to store the Program Counter, a different techINTERRUPT
nique must be used to return control to the interrupted program. First you must execute a Set
Flag (SFLG) or Pulse Flag (PFLG) instruction, referencing bit 15 in the Status and Control Flag register. This bit always
appears to be set to a '1', but must be referenced in this case to enable lower levels of interrupts. Next you must ex-

1-23

ecute a Jump Indirect (JMP@) through the location pointed to by the contents of memory location 000716 to restore
the original Program Counter contents.

PACE
LEVEL 0
If a Level 0 interrupt occurs within the 12-clock-cycle period following the recognition of
INTERRUPT
any other interrupt, PACE will either perform a Processor Stall (which we described earlier)
PROBLEMS
or PACE will execute the Level 0 interrupt - but using the wrong pointer address. In short.
you don't know what might happen under these circumstances. There is a solution for this problem. It requires that external logic allow NHALT to be applied to the PACE CPU only while the NADS signal is present.
provided no Acknowledge Interrupt (ACK INT) has occurred since the last NADS pulse. ACK INT is accompanied by a
negative-going pulse on the CONTIN line. Sound complicated? It is.
PACE. but not the INS8900. has some Level 0 interrupt circuit problems.

The circuit shown in Figure 1-16 is reproduced from PACE literature and solves the problem we've just described. We
won't attempt to describe here how this circuit solves the problem. Note that this circuit only takes care of Level 0 interrupt problems; if you also want to use NHAL T and CONTIN to cause a Processor Stall. you must design additional external logic.

Once again, we must advise that these interrupt system problems exist in PACE CPU chips. The INS8900 has
none of these problems.

THE INS8900 AND PACE INSTRUCTION SET
Table 1-1 summarizes the INS8900 and PACE instruction set.
The primary memory reference instructions have typical minicomputer addressing modes. These instructions will also
be used as I/O instructions. since external devices are identified via selected memory addresses . ...._ _ _ _ _'"
In Table 1-1 . "direct addressing options" means the instruction can reference memory using any
of the direct or direct indexed addressing options described earlier.
"Indirect addressing options" similarly specifies any of the indirect addressing options described
earlier.

INS8900
AND PACE
DIRECT
ADDRESSING
OPTIONS

Both Branch and Skip instructions are provided. and each differs significantly from the philosophies described in Volume 1, Chapter 6.
There are 16 conditions that can cause a Branch, as shown in Table 1-3 . Notice that three of the conditions are determined by external inputs JC 13. 14. and 15. If a Branch-on-Condition is true. then the displacement which is added to
the Program Counter is an 8-bit signed binary number as described in Volume 1. Chapter 6.
There are three varieties of Skip-on-Condition instructions. SKNE. SKG and SKAZ compare the contents of an Accumulator to a memory location which is addressed using direct or direct indexed addressing. Based on the results of
the comparison. the instruction following the Skip mayor may not be executed. These three instructions are therefore
combined Skip and Memory Reference instructions.
ISZ and DSZ identify a memory location using direct or direct indexed addressing; the contents of the addressed
memory location are incremented (ISZ) or decremented (for DSZ); if after the increment or decrement operation the
memory location contains a 0 value. then the Skip is performed.
The AISZ instruction adds an 8-bit. signed binary number to the contents of an Accumulator; if the result is 0, a Skip is
performed.
These Skip instructions will be very familiar to minicomputer programmers. and on most microcomputers are
equivalent to a secondary Memory Reference or Immediate Operate instruction. followed by a Branch-on-Condition instruction.

1-24

v

LEVEL 0 INTERRUPT REQUEST

NOTE: If the Level 0 Interrupt request has not
already been reset to a logic '1' level
before lACK goes to a logic T, then
lACK should be used to reset the request signal.

'/27476
FFl

10S----0I
Q ....- - - - - -...

8094
NHALT

-

lK

CLR

0
'/27476
7404

'/.74L74
FF3

FF2

NAOS

Q

CP

Q

CP

PACE

K

-

CLR

SET

'V'/V-O
lK

+5

CLR

0
'/274L74
FF4
lACK (normally '0')
Q
74L08
CONTIN

ODS·
INIT·

Figure 1-16. Circuit to Prevent Conflicts Between PACE Level 0
Interrupts and Lower Priority Interrupts

1-25

The following symbols are used in Table 1-1 :
ACO

Accumulator 0

C

Carry status

CC

4-bit Condition Code described in Table 15-3

D

Any Destination register

DATA8

8-bit binary data unit

DISP(X)

Direct or indexed addressing operands as explained in the text.

@DISP(X)

Indirect addressing operands as explained in the text.

EA

The effective address generated by the specified operands.

f

4-bit quantity selecting a bit in the Flag Word.

FW

Flag Word described in the text.

lEN

Interrupt Enable status

I

A 1-bit unit determining whether LINK is included in the shift/rotate.

L

Link status

n

Seven bits determining how many single bit shift/rotates are performed.

o

Overflow status

PC

Program Counter

S

Any Source register

ST

Top word of on-chip Stack.

Any register of the Accumu lator: ACO. AC 1. AC2 or AC3

x < y.z >

Bits y through z of the quantity x. For example. r< 7.0> is the low-order byte of the specified register.

[ ]

Contents of location enclosed within brackets. If a register designation is enclosed within the brackets.
then the designated register's contents are specified. If a memory address is enclosed within the brackets.
then the contents of the addressed memory location are specified.

£[ ]]

Implied memory addressing; the contents of the memory location designated by the contents of a register.

A

Logical AND

V

Logical OR

.:v-

Logical Exclusive-OR
Data is transferred in the direction of the arrow.
Data is exchanged between the two locations designated on either side of the arrow.

Under the heading of STATUSES in Table 1-1 . an X indicates statuses which are modified in the course of the instruction's execution. If there is no X. it means that the status maintains the value it had before the instruction was executed.

1-26

Table 1-1. INS8900 and PACE Instruction Set Summary
STATUSES
TYPE

MNEMONIC

zw

>

II:

c(

~ --

II:

::;

W

~

0

;;

ii: > Z

Q.

II:

c(

OPERAnON PERFORMED

BYTES

c

0

r.DISP(X)

2

[rl-[EA]

LD

O,@DISP(X)

2

Load any Accumulator, direct addressing options.
[ACO]-[EA]

ST

r,DISP(X)

2

Load Primary Accumulator, indirect addressing options.
[EA]-[rl

ST

O,@IDISP(X)

2

Store any Accumulator. direct addressing options.
[ EA]-[ACO]

LSEX

O,DISP(X)

2

Store Primary Accumulator, indirect addressing options.
[ACO]-[ EA](sign extended)

0

:!:
W
:!:

Load a signed byte into Primary Accumulator; extend sign bit into high order byte. Direct
addressing options.

w _

N
-..J
>

II:
c(

o

oz
W

ADD

r.DISP(X)

2

X

X

[r]-[r]+[EA]

DEC A

O,DISP(X)

2

X

X

Add to any Accumulator. direct addressing options.
[ACO]-[ ACO]-:-l EA]-.- [C)

SUBB

O,DISP(X)

2

X

X

AND

O,DISP(X)

2

OR

O,DISP(X)

2

r,DATA8

2

W

I-

c(

II: II:

~ ~
W

Z II:

o >
o II:

~ ~

L

LD

w

0

OPERAND(SI

0

>
II:

0

!
w:!:

:!:-

_LI

Add decimal with Carry to any Accumulator, direct addressing options.
[ACO]-[ACO] - [EA].+lC]
Subtract from Primary Accumulator with borrow, direct addressing options.
[ACO]-[ACO]/\ [EA]
AND with Primary Accumulator, direct addressing options.
[ACO]-[ ACO] V [EA]
OR with Primary Accumulator, direct addressing options.

[r< 7,0>]- DATA8 (sign extended)
Load immediate into any Accumulator. DATA8 is an 8-bit signed binary value. The sign bit

W

I-

C
W

JMP

DISP(X)

2

is propagated through 8 high order bits.
[PC]-EA

:!:
~

JMP

@DISP(X)

2

Jump by loading the effective difect address into the Program Counter.
[PC]-EA

e(

Jump by loading the effective indirect address into the Program Counter.
...

-_._--

------

---------

- - - - - - _ . _ - --

Table 1-1. INS8900 and PACE Instruction Set Summary (Continued)
STATUSES
TYPE

MNEMONIC

OPERAND(SI

OPERATION PERFORMED

BYTES

C
JSR

DISP(XI

JSR

@OISP(X)

2

I&IQ

1-1&1

~i
~~

2

~O

-g

1&1

CAl

r.DATAB

2

1-1&1

co

L
[STl-[ PCl
[PC]-EA
Jump to subroutine direct. As JMP direct. but push old Program Counter contents onto
Stack.
[STJ-[ PC]
[PC]-EA
Jump to subroutine indirect. As JMP indirect. but push old Program Counter contents onto
Stack.

[rl-[ r] +DATAB (sign extended)

Complement contents of any register. then add immediate data.

c( .....

~

0

Q~

1&11&1
~o.

~O

SOC

CC.DISP

2

If CC true: then [PCJ- EA
Branch on CC true. as defined in Table 14-3.

SKNE

r.DISP(X)

2

~i2~

SKG

O.DISP(X)

2

>01&1

SKAZ

O.DISP(X)

2

If [rl " [EA]: then [PC]-[ PC] + 1
Skip if any Accumulator not equal.
If [ACO] > [EA]: then [PC]-[PC]+ 1
Skip if Primary Accumulator greater.
If ([ ACO] /\ (EA]) = 0: then [PC]-[ PC] + 1
Skip if AND with Primary Accumulator is zero.

Zz

00

iSE

ZQ
c(Z
a:0

II:IU

1&1

U

Z

1&1

a:o.i=

~U) .....

a:ZI&I
Oc(5!l
~

1&1

~

Table 1-1. 'INS8900 and PACE Instruction Set Summary (Continued)
STATUSES
TYPE

MNEMONIC

OPERAND(S)

BYTES

C

o

OPERATION PERFORMED

L

2

ISZ

DISP(X)

DSZ

DISP(X)

AISZ

r.DATA8

[rl-[ r]+DATA8
If [r] =0; then [PC]-[PC]+l
Add immediate to any Accumulator. Skip if zero. DATA8 is an 8·bit signed binary immediate data value.

a:www
a:

RCPY

S.D

[D]-[S]

SS~
ww

RXCH

S.D

Move contents of any Accumulator (S) to any Accumulator (D).
[D]--[S]

>~w!!:

[EA]-[ EA]+,
If [EA] = 0; then [PC]-[ PC]+ 1
Increment memory. skip if zero.
[EA]-[ EA] - ,
If [EA] = 0; then [PC]-[ PC] + 1
Decrement memory. skip if zero.

a:21-~

OWc(U)
::!ia:a: O

~~~~
a:
~~!!:
Q~~

wwO
::!ia.Z
~Oc(

...,
~

CD

1-1->

Exchange contents of any Accumulators.

a: a:

w

RADD

S.D

a:w
wa.

RADC

S.D

RAND

S.D

RXOR

S.D

SHL
SHR
ROL

r.n.1
r.n.1

~
.a:

1-0
~a:
~w

2

x

x

x

x

[D]-[S]+[D]
Binary add any Accumulator to any Accumulator.
[D]-[S1+[D]+[C]
Binary add with Carry any Accumulator to any Accumulator.
[D]-[S] 1\ [D)
AND any Accumulator with any Accumulator.
[D]-[S] ¥[D]
Exclusive-OR any Accumulator with any Accumulator.

WI-

a:U)
(;

w

a:
a:w

~~

U)a:
(;~
~O

ROR

r.n.'
r.n.1

2

x

2
2

X
X
X

Shift any Accumulator left n bits. Simple if 1
Shift any Accumulator left n bits. Simple if 1
As SHL. but rotate.
As SHR. but rotate.

= 0; through Link if

= O.

1

through Link if ,

=

1.

= 1.

Table 1-1. INS8900 and PACE Instruction Set Summary (Continued)
STATUSES
TYPE

MNEMONIC

OPERAND(S)

OPERATION PERFORMED

BYTES

C
PUSH

r

L
[ST]-[r]

2

Push any Accumulator contents onto Stack.
[ST1-[FW]
Push flags onto Stack.
[r1-[ST]

2

PUSHF
PULL

0

r

2

~

u

~

PULLF

2

X

X

X

en

XCHRS

....

RTS

Pull top of Stack into any Accumulator.
[FW]-[ST1

r

2

Pull top of Stack into flags.
[ST1--[r]

DISP

2

Exchange contents of any Accumulator with top of Stack.
[PC]-[ ST1 + DISP
Return from subroutine. Move sum of DISP and top of Stack to PC. DISP is an a-bit signed
binary number.

iN
o
I~

:I

RTI

DISP

2

[PC]-[ ST]+ DISP
[IEN]-1

II:
II:

w

Return from interrupt. Like RTS. but enable interrupts.

I-

~

en

:::I
Ic(

CFR

r

2

CRF

r

2

SFLG

f

2

PFLG

f

2

I-

en

HALT

2

[r1-[FWI
X

X

X

Copy flags to any Accumulator.
[FW]-Er1
Move any Accumulator contents to flags.
[FW1-1
Set flag I to 1. (f= 0 to 15).
[ FW < f>]- 1 for lour clock periods
Pulse flag f (invert flag status for four clock periods). (f = 0 to 15).

Halt

The following symbols are used in Table 1-2:
aa

Two bits choosing the destination register.

bb

Two bits choosing the Index register

cccc

Four bits choosing the Condition Code. See Table 1-3.

ee

Two bits choosing the source register.

ffff

Four bits selecting a bit in the Flag Word.
One bit determining whether Link is included in a shift or rotate.

nnnnnnn

Seven bits determining how many single bit shifts or rotates are performed.

pp

8-bit signed displacement

00

Eight bits of immediate data

x

A "don't care" bit

xx

A "don't care" byte

Table 1-2. INS8900 and PACE Instruction Set Object Codes
INSTRUCTION

OBJECT CODE

ADD

r,DISP(X)

1110aabb

AISZ

r,DATA8

0111"108a

MACHINE CYCLES

BYTES
TOTAL

INTERNAL

INPUT

2

4

2

2

2

5/6

4/5

1

2

4

2

2

2

5/6

4/5

1

2

5

4

1

2

4

3

1

2

4

3

1

2

7

5

2

2

7/8

4/5

2

-

1

OUTPUT

pp

GG
AND

O,DISP(X)

101010bb

pp

BOC

CC,DISP

0100cccc

pp
CAl

r,DATA8

011100aa

GO
CFR

f

CRF

f

DECA

O,DISP(X)

DSZ

DISP(X)

000001aa

XX
000010aa
XX
100010bb
pp
101011bb

1

pp
HALT

()()()()()()xx

2

ISZ

DISP(X)

XX
100011bb
pp

2

7/8

4/5

2

JMP

DISP(X)

000110bb

2

4

3

1

2

4

2

2

2

5

4

1

2

5

3

2

2

4

2

2

2

5

2

3

2

4

3

1

2

4

2

2

2

4

2

2

pp
JMP

((/lOISP(X)

100110bb

pp
JSR

DISP(X)

000101bb

pp
JSR

~IJOISP(X)

100101bb

pp
LD

r,DISP(X)

1tOOaabb

pp
LD

O,OOISP(X)

101000bb

pp
LI

r,DATA8

010100aa

00
LSEX

O,DISP(X)

101111bb

pp
OR

O,DISP(X)

10100tbb

pp

1-31

1

Table 1-2. INS8900 and PACE Instruction Set Object Codes (Continued)
MACHINE CYCLES
INSTRUCTION

OBJECT CODE

BYTES

TOTAL

INTERNAL

INf:»UT

2

6

5

1

PFLG

f

oollffff

PULL

r

01100laa
XX

2

4

3

1

000looxx
XX
011000aa

2

4

3

1

2

4

3

1

2

4

3

1

OUTPUT

Oxxxxxxx

PULLF
PUSH

r

XX

S,D

0000llxx
XX
0011101aa

2

4

3

1

S,D

eexxxxxx
011010aa

2

4

3

1

S,D

eexxxxxx
010101aa

2

4

3

1

2

4

3

1

2

5+3n

4+3n

1

PUSHF
RADC
RADD
RAND
RCPY

S,D

ROL

r,n,1

eexxxxxx
010111aa
eexxxxxx
ool000aa

r,n,1

nnnnnnni
00loolaa

2

5 + 3n

4+3n

1

RTI

nnnnnnni
011111xx
pp

2

6

5

1

RTS

100000xx

2

5

4

1

RXCH

PP
011011aa

2

6

5

1

2

4

3

1

2

5

4

1

ROR

S,D

eexxxxxx
010110aa
eexxxxxx

RXOR

S,D

SFLG

f

SHL

r,n,1

oollffff
1xxxxxxx
oo1010aa

2

5+ 3n

4+3n

1

r,n,1

nnnnnnni
oo1011aa

2

5+3n

4+3n

1

O,DISP(X)

nnnnnnni
101110bb

2

5/6

3/4

2

2

7/8

5/6

2

SHR
SKAZ
SKG

O,DISP(X)

PP
100lllbb
pp

"

SKNE

r,DISP(X)

1111aabb
PP

2

5/6

3/4

2

ST

r,DISP(X)

1101aabb
PP

2

4

2

1

1

ST

O,@\DISP (X)

101100bb
pp

2

4

1

2

1

SUBB

O,DISP(X)

1ool00bb

2

4

2

2

2

6

5

1

PP
XCHRS

r

000lllaa
XX

·AII instructions may take additional cycles if Extend Read and Extend Write are implemented.

1-32

Table 1-3. Branch Conditions for INS8900 and PACE BOC Instruction
Condition
Code (CC)

Mnemonic

0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111

STFL
REOO
PSIGN
BITO
BIT1
NREOO
BIT2
CONTIN
LINK
lEN
CARRY
NSIGN
OVF
JC13
JC14
JC15

Condition
Stack Full (contains nine or more words).
(ACO) equal to zero (see Note 1).
(ACO) has positive sign (see Note 2).
Bit 0 of ACO true.
Bit 1 of ACO true.
(ACO) is nonzero (see Note 1).
Bit 2 of ACO is true.
CONTIN (continue) input is true.
LINK is true.
lEN is true.
CARRY is true.
(ACO) has negative sign (see Note 2).
OVF is true.
JC 13 input is true (see Note 3).
JC 14 input is true.
JC15 input is true.

NOTES:
1.

If selected data length is 8 bits, only bits 0 through 7 of ACO are tested.

2.

Bit 7 is sign bit (instead of bit 15) if selected data length is 8 bits.

3.

JC13 is used by INS8900 and PACE Microprocessor Development System and is not accessible
during prototyping.

THE BENCHMARK PROGRAM
For PACE, our standard benchmark program adopts this modified form:

LOOP

LD
LD
RCPY
LD
ST
AISZ
AISZ
DSZ
JMP
RCPY
ST

2,IOBUF
O,@TABLE
0,3
0,0(2)
0,0(3)
2,1
3,1
10CNT
LOOP
3,0
O,@TABLE

LOAD I/O BUFFER ADDRESS INTO AC2
LOAD ADDRESS OF FIRST FREE TABLE BYTE
MOVE TO AC3
LOAD NEXT BYTE FROM I/O BUFFER
STORE IN NEXT TABLE BYTE
INCREMENT AC2
INCREMENT AC3
DECREMENT I/O BUFFER LENGTH. SKIP IF ZERO
RETURN FOR MORE BYTES
MOVE AC3 CONTENTS TO ACO
RESTORE ADDRESS OF FIRST FREE TABLE BYTE

In order to take advantage of INS8900 and PACE indirect addressing, three memory locations are reserved on page 0 as
follows:
10BUF

holds the beginning address of the I/O buffer.

TABLE

holds the address of the first free byte in the permanent data table.

10CNT

holds the number of data words in the I/O buffer.

1-33

Memory, as organized for the benchmark program will look like this:

-; :::~ I~;; I}
Memory

Data on Base Page

IOCNT - - -.
~
. 0012
0013

' ' S-Start
i

0014 =

;

I

I

•

I

•

~Start
I

YYYV

of I/O .....

of

Data Table

I

~"'t .......... T_
of Data

Suppose the benchmark program rules arbitrarily require that a displacement be stored in the first word of the data table, and that this displacement be added to the address of the first word of the data table in order to compute the address of the first free data table word:

~
DISP

~

Fnt data table

Rm .... data

wom

tab~

Now the instructions:

LD
RCPY

O,@TABLE
0,3

LOAD ADDRESS OF FIRST FREE TABLE BYTE
MOVE TO AC3

must be replaced by these instructions:

LD
LD
RADD

3,TABLE
0,0(3)
0,3

LOAD BEGINNING ADDRESS OF DATA TABLE
LOAD DISPLACEMENT TO FIRST FREE TABLE WORD
ADD DISPLACEMENT TO AC3

The new displacement must be restored to the first data table word. The instructions:

RCPY
ST

3,0

O,@TABLE

MOVE AC3 CONTENTS TO ACO
RESTORE ADDRESS OF FIRST FREE TABLE BYTE

1-34

won!

.

must be replaced by these instructions:
LD
CAl
RADD
RCPY
LD
ST

O,TABLE
0,1
0,3
3,0
3,TABLE
0,0(3)

LOAD BEGINNING ADDRESS OF DATA TABLE IN ACO
FORM TWOS COMPLEMENT
SUBTRACT ACO FROM AC3 TO FORM DISPLACEMENT
MOVE DISPLACEMENT TO ACO
LOAD BEGINNING ADDRESS OF DATA TABLE IN AC3
SAVE DISPLACEMENT IN FIRST FREE TABLE WORD

Forcing an INS8900/PACE programmer to conform to programming logic suited to some other microcomputer's instruction set only proves that the two microcomputers have different instruction sets.

THE PACE DP8302 SYSTEM TIMING ELEMENT (STE)
The STE is a very elementary clock device used with PACE, but not with the INS8900; it accepts inputs from an
external crystal and generates the MOS clock signals for PACE, plus a pair of TTL-level clock outputs that can
be used for synchronizing system operations. Figure 1-17 illustrates the pin assignments of the STE.

1
Xl
X2
EXTC
TCLK
TCLK*
GND

PIN NAME

-

-

16
15

2
3
4

7

14
13
12
11
10

8

9

5

STE
DP8302

6

VCC
CK
CLK
NCLK

-

DESCRIPTION

Xl. X2

External crystal connections

CLK. NCLK
CK.NCK
TCLK. TCLK*
EXTC

Damped MOS clocks to PACE
Undamped MOS clocks to PACE

LCK. LCK*

TTL clocks to microcomputer system
Extemal oscillator option
Non-overlap capacitor connection

VCC·VGG

Power and Ground

VGG
NCK
LCK
LCK*

TYPE
Input
Output
Output
Output
Input

Figure 1-17. DP8302 System Timing Element (STE) Pins and Signals

The frequency of the MOS clocks output by the STE is one-half the input crystal frequency. The
STE is designed to operate with a 2.6667 MHz crystal. The MOS clock frequency is thus 1.3333
MHz which results in a clock period (tp) of 750 nanoseconds (tp = 1/f); this is the optimal clock
period for the PACE CPU.

Two pairs of MOS clock outputs are generated by the STE; NCLK/NCLK* and NCK/NCK*. The first pair of outputs
contain a 25 n series of damping resistor; typically, these outputs will be used in circuit board layouts where the STEto-PACE interconnect lines are less than two inches. The other MOS outputs, NCK and NCK*, are undamped. and you
can select some other value of series damping resistors that might be better suited for your particular board layout.
In addition to the +5V and -12V power supplies typically needed with MOS devices, the
PACE CPU has a third power supply requirement: a substrate bias voltage (Vaa) of +8V
must be applied to the CPU chip. Since it is unlikely that any other devices in your microcomputer system would require this voltage level. the need for a third external system power source
can be eliminated by providing a voltage converter circuit. Figure 1-18 shows a circuit that
generates the required Vaa voltage level; the circuit requires only a few components and uses
one of the STE's TTL clock outputs as a 'charge pump' for the circuit.

1-35

GENERATING
THE PACE
SuaSTRATE
BIAS
VOLTAGE

PACE

23

(+8V)
STE

VBB

..

O.lf1-F
TCLK-

7

lN914

....r.

I

-:::~

lN914

1-

t:; ~ LM103

0

3V

'"'

.

C)
+5V

Figure 1-18. Circuit to Generate Substrate Bias Voltage (VBB) for PACE CPU

THE PACE BIDIRECTIONAL TRANSCEIVER ELEMENT (BTE)
The DP8300 BTE is an 8-bit device that provides an interface between the PACE MOS-Ievel signals and the
TTL-level signals required by other devices in a microcomputer system (the BTE is not used in INS8900
systems). If you refer to Figure 1-1 at the beginning of this chapter. you will see that a typical PACE microcomputer
system requires three BTEs: two are used to buffer the CPU's 16 address/data lines. and the third is used as a TTL
driver for the CPU's control signal outputs (NADS. ODS. IDS. F11 - F14).
Figure 1-19 shows the pin assignments for the BTE.

MBI/O 00
MBI/O 01

..

MBI/O 02
MBI/O 03
MBI/004
MBI/O 05

..

1

24

2

23

3
4

22
21

5

20
19

6
7

BTE

18

MBI/O 06

8

17

MBI/O 07

9
10

16

WBO-

11
12

GNO

PIN NAME

15
14
13

- -

--

..

-

--'"

-

--

VCC
BOI/O 00
BOI/O 01
BOI/O 02
BOI/O 03
BOI/O 04
BOI/O 05
BOI/0 06
BOI/O 07
CEl
CE2-

STR-

DESCRIPTION

TYPE

MBIIO 00 - 07

MOS Bus Data Lines

Input/Output
Input/Output
Input

BOI/O 00 - 07

TTL Bus Data Lines

CE1. CE2-.
STR-. WBO-

Mode Control Signals

VCC·GNO

+ 5V Power. and Ground

Figure 1-19

BTE Signals and Pin Assignments

1-36

Table 1-4 summarizes the operating modes of the BTE.

BTE MODE

WBD* is the main mode control signal; when this signal is low, the other control signals are ig~~~T:~L
nored and the BTE simply converts the MOS signals from the CPU into TTL-level output signals.
The TTL outputs have a high fan-out capability and can service up to thirty 50 milliampere loads.
The BTE used to buffer the PACE control signals normally operates continuously in this 'drive-only' mode (Mode
1) and is kept in this mode by simply connecting the WBD* signal to ground.
The BTEs used to buffer bidirectional (address/data) lines must be switched back and forth between Modes 1
and 2; Mode 1 is used for CPU data output and Mode 2 for CPU data input. The simplest way of accomplishing this
is to continuously enable the CE1, CE2*, and STR* controls by connecting them to appropriate logic levels (+5V or
ground) and then use the WBD* signal for directional control. For example, in a PACE system, the IDS signal from the
CPU could be used as the input to WBD*. During a PACE data input cycle, IDS will go high at the appropriate portion of
the cycle and place the BTE in Mode 2; IDS is low at all other times and the BTE will operate in Mode 1.
Table 1-4. PACE BTE Truth Table
CONTROL INPUTS

MODE

MODE DESCRIPTION

#

CE1

CE2*

STR*

WBD*

1

X

X

X

0

Receive MOS signals and
drive TTL signals

2

1

0

0

1

Receive TTL signals and
drive MOS signals

0

0

0

1

0

1

0

1

1

1

0

1

3

4

X

X

1

1

Outputs in
high-impedance
state
On positive-edge transition
of STR*, latch into Mode 2
or 3 as determined by state
of CE1 and CE2*

X = don't care

+5V

15

CEl t - - -...

BTE

105-----"'

BUS GRANT _ _ _..._ _ _ _~l-4_t CE2*

STR*

13

t---~

Figure 1-20. Signal Connections to Control BTE in a DMA System

1-37

In a DMA or multiprocessor we will need to use BTE Mode 3 to place the BTE outputs in a high-impedance state
and thus free the System Busses for use by other devices. In such a system an externally generated Bus Grant signal could be used to place the BTE in Mode 3. Figure 1-20 illustrates one method of doing this: whenever the BUS
GRANT signal is high. the BTE is in Mode 3. At other times the IDS signal operates as we've just described to switch the
BTE back and forth between Modes 1 and 2.
The fourth BTE mode uses a negative-to-positive transition on the STR* input to latch the state of CE1 and
CE2*, and then places the BTE in either Mode 2 or Mode 3. This latch mode function might be useful when the BTE
is used as a simple input buffer. For example. in a system with multiplexed address/data lines (such as PACE). address
outputs could be applied to CEl and CE2*. and an address strobe signal (such as NADS) connected to STR*. Then.
when the BTE is selected by the appropriate address bits. the trailing edge of the strobe signal will gate TTL data
through the BTE and apply the data to the MOS lines of the CPU. When the BTE is not selected (addressed). its outputs
will be in the high impedance state (Mode 3).

USING OTHER MICROCOMPUTER SUPPORT DEVICES
WITH THE PACE AND INS8900
The INS8900 CPU has numerous control signals which allow general purpose microcomputer support devices to
be included in an INS8900system.
Let us see how 8080A support devices might be used with the INS8900 CPU. First, we'll take an overview of
the general CPU-to-device interface that all the 8080A family of devices expect.
All of the 8080A family devices require that address information (or enabling/select signals derived from the address lines) be valid during the data transfer (read/write) portion of an input/output cycle. Recall that the INS8900
data lines are multiplexed: at the beginning of an input/output cycle. the data lines are used to output address information; the address information is then removed and the data lines are used for the actual input or output of data during
the latter portion of the I/O cycle.
Thus, the first thing we must do to interface the INS8900 to an 8080A family device is
to demultiplex the INS8900 address/data lines. There are several different approaches
that we can use to accomplish the required demultiplexing.

DEMULTIPLEXING
THEINS8900
ADDRESS/DATA
LINES

The most obvious way is to use D-type flip-flops or data registers with the INS8900
NADS signal as the clock pulse. Here are some of the standard 7400 family devices that might be used:
·7475 Double 2-Bit Gated Latches with Q and Q Outputs
·7477 Double 2-Bit Gated Latches with Q Output Only
• 74100 Double 4-Bit Gated Latches
·74166 Dual 4-Bit Gated Latches with Clear
·74174 Hex D-Type Flip-Flops with Common Clock and Clear
·74175 Quad D-Type Flip-Flops with Common Clock and Clear

Some of these devices require that the NADS signal be inverted to provide the necessary clocking Signal. Remember.
though. that PACE address information is valid during both the leading edge (high-to-Iow transition) and trailing edge
(Iow-to-high transition) of NADS; this generally simplifies the demultiplexing operation.

In many systems you will not need to latch all16 bits of address information since it would be an unusual application that required all of the 64K of address space that this provides. There will usually be some tradeoff between system
address requirements (how many system devices require a latched Address Bus) and the type and amount of address
decoding required. When a fully latched Address Bus is provided. then simpler nonlatched address decoders can be
used. In fact. often address bits can then be used directly as device select signals. or simple AND/OR gate combinations can perform the decoding.
The alternative method of demultiplexing the address/data lines is to use address decoding devices that are
clocked by the NADS signal and provide latched outputs. These latched outputs can then be used as the
device/chip select Signals during I/O cycles.
Many systems will use some combination of a fully latched Address Bus and simple or latched address
decoders. In the discussions that follow, we will not generally describe in detail the method used to obtain the
required addressing or select/enabling signals, since the method used is so dependent on the particular system
that you are designing.

1-38

Once the INS8900 address/data lines have been demultiplexed, the only major conINS8900 CONTROL
siderations we are left with are to ensure that the input/output control signals are of
SIGNAL POLARITY
the proper polarity, and to verify that there are no timing problems. We will see that
CONSIDERATIONS
generally the INS8900 I/O control signals must be inverted to operate with the 8080A
family of devices. although the 8212 offers us a choice of using the IDS and ODS signals. in either their original or inverted form.
Now we will provide a few specific examples of how devices from the 8080A family can be used with the
INS8900 CPU.
In our first example the 8212 I/O Port is used as a simple input port by the INS8900 CPU.
The interconnections required are shown in the following figure:

DOO

THE 8212 USED
AS A SIMPLE
INPUT PORT IN
AN INS8900
SYSTEM

DIO

Data to
INS8900 CPU

Data from
external logic

(System Bus)
D07

a Ds1

Derived from - - - -. .
Address Lines

DI7

8212

1 0 S - - - -......... DS2
(from INS89(0)

Tie MD to Ground. Now STB clocks
latches and

NADS
(from INS89(0)

STB

DSi.

DS2 enable buffers.

MD

cur

--

NINIT-------~

Here, the INS8900 Address Strobe signal (NADS) is inverted and used as the STB input to the 8212. Since MD
is tied to ground, the STB signal clocks the data into the 8212: this will occur every time the INS8900 performs
an input/output cycle, but the latched data will only be placed on the System Bus when the 8212 is selected.
We accomplish device selection by applying a negative-true decoded address signal to the OS 1 input and then
using the INS8900 IDS strobe signal as the DS2 input. Now, whenever the proper address is decoded, the IDS
signal will cause the data that was previously latched by NADS to be placed on the System Bus for input to the
INS8900. The timing would look like this:
NADS

STB

DIO - DI7

OS2 (IDS)

r----,

000- 007

Latched data output
onto System Bus

1-39

Notice that the data from external logic will be latched whenever NADS occurs. The actual selection of the 8212 and
input of the latched data to the INS8900 might not occur for quite some time. Frequently, this arrangement will be
completely acceptable. If not. then an input-with-handshaking arrangement. which we will describe next. might provide a better solution.

Before we proceed to our next example. let us make one more general comment about interfacing devices to
the INS8900 CPU.
The INS8900 is a 16-bit microcomputer: it can transfer 16 bits of parallel data in a single input or output cycle.
All of the other devices that we will be discussing are 8-bit devices. Frequently. you may not need the full
width of the 16-bit Data Bus when transferring data between the CPU and external logic. In these cases, you
can simply connect the data lines to/from the support device to the less significant data lines (DO - 07) of the
INS8900 System Bus, as we have shown in our first example. Masking of the unused, more significant data bits
would then be handled under program control.
When you are going to utilize the full 16 bits of the Data Bus. you merely connect two 8-bit devices in parallel.
as described in more detail for the CP1600 in Chapter 2. One device would be connected as we've already described; the data lines of the other device would then be connected to the more significant bits (08 - 015) of
the System Bus. All other connections to the two devices (device select signals. strobe signals. etc.) would be
identical.
In this example. we will use the 8212 interrupt request signal INT to establish an input
port with handshaking. The connection diagram is very similar to our first exam.ple:

000

010

Data to
INS8900 CPU

··
·

(System Bus)

Derived from

IDS

-'"

-

,... Dsi

8212

STB

e xternal logic

External logic strobes
d ata into latches

OS2

(from INS8900)

toINS8900
Interrupt or

0 ata from

017

007

Address Lines

THE 8212 USED
IN AN INS8900
SYSTEM FOR
INPUT WITH
HANDSHAKING

Tie MO to Ground. Now STB clocks
latches and 'i5s'l OS2 enable buffers
MO

INT

Jump Condition

1

Input Pin

Here. the device select signals are the same as in our first example. However, instead of using the INS8900
NADS signal to clock data into the latches, we will require external logic to input the STB signal when it has
data ready. When the data has been latched. the 8212 will output the INT signal. which will be used as the input to one of the INS8900 CPU interrupt request lines (NIR2 - NIR5) or Jump Condition inputs (JC13 - JC15).
The CPU,will then execute a service routine program that will include an instruction to read the data from the input
port. This instruction will send out the input port's address, thus generating the DS 1 signal. and then gate the latched

1-40

data onto the System Bus when the IDS signal is generated. When the latched data is read out of the 8212. the INT signal returns high to complete the transaction. This sequence is summarized by the following timing diagram
Data latched by
external logic
010 - 017

STB

----'

OS2 (lOSl

DOO - 007

..

..------------

--------..~~

............--....

Interrupt request or
Jump condition input

.. ..........-

~~--

,

~

onto System Bus

to INS8900 CPU

Using the 8212 as an output port in an INS8900 system requires a simple reversal of the
connections we have described in the two preceding examples. and we will now use the
ODS (Output Data Strobe) signal from the INS8900 instead of the IDS signal.

010

THE 8212 USED
AS AN OUTPUT
PORT IN AN
INS8900 SYSTEM

000

Data from

Data to external
logic

INS8900 CPU
(System Busl
017

007

DsT

8212
STB

OS2

Select Signal

MO

M

derived from
Address Lines

-

~

ODS
(from INS8900)

to INS8900
interrupt lines
or JC inputs

1-41

••
•
:
______J•

Select signals generated
by external logic

To external logic

When the output port's address is sent out and decoded from the Address Bus, one input to the AND gate is enabled.
The ODS signal then goes high to generate the STB signal and latch the contents of the system Data Bus into the 8212.
This will cause the INT signal to go low and inform external logic that data has been loaded into the output port. The
external logic will then generate the DS1 and DS2 signals to gate the data out of the latches. When the data has been
gated out. the TNT signal will return high. This low-to-high transition could be used as an interrupt request or jump condition input to an INS8900 to enable output of new data. Notice that if we continuously enable the 8212 outputs
by tying CST to ground and DS2 to +5V, then whenever the INS8900 loads a new data word into the latch, it
will be immediately output to external logic. This approach may be more advantageous in some applications.

Although the 8255 Programmable Peripheral Interface (PPl) is a more complicated
device than the 8212, interfacing the 8255 to an INS8900 CPU is no more complicated
(from a hardware point of view) than the INS8900-to-8212 interfaces we've described.
This is due to the programmability of the 8255; mode control is performed by your program instead of by hardwired signals. Let us look at an example to illustrate this point:

8255 PPI
DEVICES
USED IN
AN INS8900
SYSTEM

DO
To/From
INS8900 CPU
(System Bus)

07

Decoded Select - - - - -....,..;;.11
signal derived

CS

from Address Bus

8255

From latched {
Address Bus

From
INS8900
CPU

------1

l

To/From
Extemal Logic

AO
A1

iDS

AD

ODS

WR
RESET

NINIT

The CS signal selects the 8255 and this signal would typically be the output of an address decoder. The AO and
A 1 inputs select one of the three I/O ports (A, B or C) or the 8255 Control registers. The RD and WR control signals are obtained by simply inverting the IDS and ODS signals from PACE. A generalized timing diagram for input/output operations would look like this:

NADS
CS·AO·A1

~
_ _ _ _ _.. Select Device and Port Select

~

IDS (ODS) _ _ _ _ _ _ _ _ _ _

m~

?

~
Data transferred

1-42

If two· 8255s are used in parallel to provide 16-bit I/O ports. there is one special consideration beyond the general rules that we discussed earlier. Recall that mode control of
the 8255 is accomplished by writing data into one 8-bit Control register within the
device. When wired in parallel. one 8255 would be connected to bits 0 - 7 of the system
Data Bus. and the other 8255 would be connected to bits 8 - 15. Therefore. when we
send out a 16-bit control word from the INS8900 CPU to establish the desired mode of
operation. the upper and lower bytes of the word must be identical.
From a hardware point of view. interfacing either of these devices to an INS8900 CPU is
no different than interfacing an 8255 PPI to the INS8900. All we need to do is invert the
IDS and ODS signals from the CPU to obtain RD and WR (or lOR and lOW) signals. and
provide chip select and latched address bits for input to the devices. All other interfacing
and usage considerations are software functions and are described in Chapter 4. We will
not describe them here since those portions of the device descriptions apply regardless
of the CPUbeilig used.

TWO 8255
DEVICES USED
FOR 16-BIT
I/O PORTS
WITH INS8900
THE 8251
USART AND 8253
PROGRAMMABLE
COUNTERITIMER
USED IN INS8900
SYSTEMS

We will conclude our discussion of the use of 8080A devices in INS8900 systems by
INS8900 AND
comparing INS8900 System Bus signals with those of 8080A systems. This comparison
8080A SYSTEM
BUSSES
will be a useful guide for interfacing any 8080A device to an INS8900 system. Table
COMPARED
1-5 is a summary of INS8900 System Bus signals and the corresponding signals available in 8080A systems. Two separate columns are provided for 8080A signals: the first applies strictly to the 8080A CPU; the right-hand column refers to the Signals present in a typical three-chip 8080A
system consisting of the CPU, a~ 8228 System Controller, and an 8224 Clock Generator and Driver.
Since we have already discussed these signals in preceding paragraphs, we won't perform an item-by-item analysis of
the table. Nonetheless, there are a few signals in this table that do need additional explanation.

We have included the INS8900 BPS signal in the I/O Control Signal group although it is not the type of signal you
would normally classify within this group. However. you will recall that when the BPS input is high. the INS8900
operates in a Base-Page-Split mode; base page then consists of the top 128 words of memory and the bottom 128
words of memory. In our earlier discussion of the BPS Signal. we described how this mode can be used to simplify addressing of I/O devices. If you refer back to that discussion, you will see that by doing a little address decoding we
can come up with a signal that will tell us when the INS8900 is addressing an I/O device (as opposed to memory).
Let us call this decoded signal '1/0 Device' (100). Now, we can combine this decoded signal with IDS and ODS as
shown below to generate signals equivalent to the 8080A liaR and tlow signals.
IDS

-----------~--""

~--------------------VOR

1/00 - - - - - - - - - - _

OOS----------------~---L

__~

K>----------------------I/OW

And if we invert the 1/00 signal we can generate the 8080A MEMR.and MEMW signals.

10S-...;....---------,.--""""

K>-----------------------~
1 / 0 0 - - -.....

OOS~-----------------_1L-

1-43

__~

~---------------MEMW

One other portion of Table 1-5 requires some explanation. Notice that we have not drawn a line to separate the
I/O control signals from the DMA-Related Signals. We've done this intentionally because there is some overlapping of functions with some of these signal,. For example, the INS8900 EXTEND 'signal can be used either to extend
I/O cycles or to suspend I/O to allow DMA operations. We've also compared the INS8900 NHAl T output signal to the
8080A WAIT signal. This comparison is valid if limited to the CPU Halt state initiated in either system by a Halt instruction. However, in 8080A systems the WAIT signal is also an acknowledgement to the READY or RDYIN input signals.
There is no comparable EXTEND acknowledgement signal in PACE systems.

6800 SUPPORT
The 6800 family includes many devices that might be useful in INS8900 systems, UnforDEVICES NOT
tunately. all of these devices have one common requirement which effectively makes them
COMPATIBLE
incompatible for use in an INS8900 system. That requirement is enabling input signal E which
WITH INS8900
should more accurately be described as a synchronizing signal. In 6800 systems. E is usually
generated by ANDing one of the primary system clock signals (<1>2) with the Valid Memory
Address signal (VMA) from the 6800 CPU. The clock period of the resulting E signal can be no less than one microsecond. The clock signals (ClK and NClK) used in PACE systems. however. cannot have a clock period greater than 850
nanoseconds. and therefore cannot be used to simulate the 6800  2 signal. Therefore. we cannot recommend using
6800 family devices in an INS8900 system.
Table 1-5. Comparing INS8900 System Busses to 8080A System Busses
INS8900
SYSTEM
SIGNALS

SYSTEM BUS

8080A
CPU
SIGNALS

8080A SYSTEM
(CPU. 8228. 8224)
SIGNALS

Bidirectional
Data Bus

000 - 015
(16 Bits)

00- 07
(8 Bits)

DBO - DB7
(8 Bits)

Address Bus

000 - 015
Address information
must be demultiplexed
from Data Bus

AO-A15

AO-A15

Control Bus

I/O
Control
Signals

NADS
Strobe signal used
by external logic
to demultiplex
add'ress from
Data Bus

-

-

IDS

DBIN

MEMR and 1I0R

ODS

WR

M"EMW 'and iiOw

EXTEND

READY

NHALT (output)

WAIT

RDYIN
WAIT

NHALT and
CONTIN il"lputs
CONTIN
tACi<: INT o~tput)

HOLD

HOLD

HLDA

HLDA

NIR2 - NIR5
CONTIN
(ACK INT output)

INT
DO and SYNC

-

BPS.

DMARelated
Signals

-

-

Interrupt
Signals

-

INTE

Non-maskable
Interrupt
(CONTIN and
NHALT inputs)

BUS EN
INT.
INTA
INTE

-

RESIN

Initialize

NINIT

RESET

Jump Condition
Inputs

JC13-JC15

-

-

Control Flag
Outputs

F11 - F14

-

-

1-44

DATA SHEETS
This section contains specific electrical and timing data for the following devices:

PACE CPU
INS8900
PACE STE
PACE BTE

1-01

PACE CPU

r - -;;,;;;.;- -- - - - - ;;;;v;;'--'

~~

v.

v..

~

~.~

.. ,,:'·1~

""~~

~ .......

v.

-r-r

'DS

I

I

I
I

.,.IT
(un.ol

v.

-L

~

'.

FI1-Fl.

l
,I

v..

4leu:

Y rl

IV..

'.

~

l
I

~

:

:v..-f

:::i~r-l

.'M

I

~

L _____

~'!!·~~

III·'"·,,,·,,CT''''

r . ,• •

_____ ..J

i f

FIGURE 4. PACE Driver and Receiver Equivalent Circuits

external clock timing
PACE requires non·overlapping true and complemented
clock inputs as shown in Figure 5. Refer to Electrical
Characteristics for timing specifications.

where:
tp' CLOCK PERIOD
'NOVA' 'NOVB' CLOCK NONOVERLAP
'WCLK • 'WNCLK = CLOCK WIDTH

FIGURE 5. External Clock Timing

We reprint data sheets on pages 1-02 through 1-017 by permission of National Semiconductor Corporation.

1-D2

PACE CPU
In DMA or multiprocessor systems it may be desirable
to prevent I/O operations by PACE when the bus is in
use by another device. This may be done by using the
EXTEND signal immediately following an IDS or ODS
as shown in Figure 10. Alternatively. the extend timing
of Figure 9 may be used. as the extend function occurs
independent of whether there is an I/O operation. that
is. whenever the internal clock phase 6 occurs.

For systems utilizing memories with access times greater
than 2 clock periods it may be desirable to use the
EXTEND input to lengthen the I/O cycle by multiples
of the clock period. Timing for this is shown in Figure 9.
In the case of either input or output operations. the
extend. should be brought true prior to the end of
internal phase 6. The timing shown in Figure 9 will
provide the minimum extend of one clock period. Holding EXTEND true for n additional clock periods
longer will cause an extension of n + 1 clock periods.

CLOC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __
00::.. ~POWE".OCLOC'SST"LE
~

.'.IT~~
~'~l_____ll~.========~,,~cL~o~c'~'E~R,~oo~s========~.1

L

••os~

~~~'~2--------------------FIGURE 6. Initialization Timing

.OOREa
DATA

~~

,~~

'ACE _____....;O!.!!uT!!:.u!!!TS!.!.~CT~'VE~____~F=t~~oDiiuy;TPuiiTTSS;HiiG'GHiH'Mi"'~EO~••~CE~=======ti.=_

--.+1 I-toc
TRANSISTOR ON
-h. __ 1;:1

OUTPUT

1_1DC

TRA::~::

TRANSISTOR Off

_-'-IN'UT'UffEADISA'LED~MOA'AVAll~

I::;!

-41

- i ~'oo

'os ...,,'-...._

....,"" .... _............

TRANSISTOR OFF

~~...d?@&J

I~

1@J"'f:J:J...+,1=.0..,..--------

1...... cI. . , . . . .....""' .... ,.,trtftCl ••1y.tMy".nDlftlllai.... IIf...Hy

·vl. . . . . . . . .

·V.-2.lSVlttlmt.... d'IIIIC"''',nput

Figure 7. Address Output and

Data Input Timing

AOOR£SS
OATA

au::;!

:-100

~:~

OOS V'UO

....._________~

OATAVAlIO--~~----

--:11-_.00_ _ _ _ _ _ __

FIGURE 8. Data Output Timing

1-03

PACE CPU
EXTRA CLOCK

CYCLEISIOUE

I

I
ClOCKP:;lS:~~~
INTERNAL

TO EXTEND

ClK_~~~~\ADOO"::: -+_.......JI%1t:.:1
HADS
PACE
OUTPUTS

PACE PUllU'
TRANSISTOR
INPUT
DATA

ACTIVE

E%t

a

HIGH IMPEDANCE

1.:21

OFF

~

ON

DATA

DISAIIlED

VALID

OUTPUT
DATA

I?I

ODS/IDS

I?I

t::a.

DATA VALID

~

EXTEND

I-IEH

1%1-

---j __ tes

~~

-I-'ES
FIGURE 9. Extend I/O Signal Timing

absolute maximum ratings
All Input or Output Voltages with
Respect to Most Positive Supply
Voltage (VaB)
Operating Temperature Range

electrical characteristics

+0.3V to -21.5V

(TA = o°c to +70°C, vss = +5V ±5%, vGG

PARAMETER

I

_65°C to +150°C
300°C

Storage Temperature Range
Lead Temperature (Soldering, 10
seconds)

CONDITIONS

= -12V

I

±5%, vaa

MIN

I

= vss

MAX

I

+ 3V ±0.5V)
UNITS

OUTPUT SPECIFICATIONS
000-015, F11-F14, OOS, lOS, NAOS (These are
open drain outputs which may be used to drive
OS3608 sense amplifiers, or may be used with pulldown resistors to provide a voltage output.)
Logic "1" Output Current (Except F11-F14)
Logic "1" Output Current, F11-F14 (Note 7)
Logic "0" Output Current

VOUT = 204V
VOUT = 204V
VGG"';; VOUT:« VSS

NHALT, CONTIN (Low Power TTL Output.)
Logic "1" Output Voltage
Logic "0" Output Voltage

lOUT
lOUT

= -650p.A
= 300p.A

-1.0
-0.7

-5.0
-5.0
±10

rnA
rnA
p.A

004

V
V

2.4

INPUT SPECIFICATIONS
000-015, NIR2-NIR5, EXTENO, JC13-JC15,
CONTIN, NINIT, NHALT (These are TTL
compatible inputs.) (Note 2)
Logic "1" Input Voltage
Logic "0" Input Voltage
Pullup Transistor "ON" Resistance
(000-015) (Note 3)
Pullup Transistor "ON" Resistance
(all others)
Logic "0" Input Current (000-015)
Logic "0" Input Current (NHAL T, CONTIN)
Logic "0" Input Current (all others)
Capacitance, Input and Output (except clocks)
BPS (This is a MOS Level Input.) (Note 4)
Logic "1" Input Voltage
Logic "0" Input Voltage
Logic "1" Input Current
CLK, NCLK (These are MOS Clock Inputs)
Clock "1" Voltage (Note 5)
Clock "0" Voltage
Input Capacitance (Note 6)
Bias Supply Current
VGG Supply Current
VSS Supply Current

VSS-1
VSS-7
VIN = VSS-1V
VIN

= VSS-1V

kD

-1.8
-12
-3.6
20

rnA
rnA
rnA
pF

VSS-1
VGG

VSS+0.3
VSS-7
100

V
V
JJ.A

VSS-1
VGG
30

VSS+0.3
VGG+ 1
150
100
40
85

V
V
pF
JJ.A
rnA
rnA

VIN = VSS-1V

1-D4

V
V
kD

5

VIN=Oo4
VIN=Oo4
VIN=Oo4
VIN = VSS, fT = 500 kHz

VBB = VSS +3.0V
tp = .65p.s, T A = 25°C
tp = .65p.s, T A = 25°C

VSS+0.3
VSS-4
7

PACE CPU
EXTRA CLOCK

CYCLE!SIDUE

l--~
,
,

INTERNAL
CLOCK PHASE

FIGURE 10. Suspend I/O Signal Timing

TIMING SPECIFICATIONS (See Figures 5 to 10 for additional timing information.)
ClK, NClK (See Figure 5) (Referenced to
10% and 90% Amplitude)
Rise and Fall Time (t r , tf)
Clock Width (tw ClK tw NClK)
Clock Non-Overlap (tNOVA, tNOVS)
Clock Period (t p )
EXTEND
Individual Extend Duration
Extend Setup Time (tES) (Note 10)
Extend Hold Time (tEH) (Note 13)
Propagation Delay (tOO)
NHAlT, CONTIN (Note 9)
NADS, IDS, ODS, 000-015 (Note 8)
000-015
Input Setup Time (tOS) (Note 11)
Hold Time (tOH) (Note 12)
Turn-on or Turn-off Time of Pullup
Transistor (toe) (Note 13)
Fll-F14 Pulse Flag (PFlG) Pulse Width
NINIT Initialization Pulse Width
NIR2-NIR5 Input Pulse Width to Set latch

10
300
5
.65

50
375

.8
2

ps
ns
ns

200
100

ns
ns

100
20
Cl = 20 pF
VOUT= 2.4V
200

ns
ns
ns

o
150
4tp -300

8
1

ns
ns
ns
ps

4tp +300

ns
clock periods
clock periods

Note 1: Maximum ratings indicate limits beyond which permanent damage may occur. Continuous operation at these limits is not intended
and should be limited to those conditions specified under de electrical characteristics.
Note 2: Pullup transistor provided on chip (See Figure 4.)
Note 3: Pullup transistors on JC13, JC14, JC15 are turned on one out of 8 clock intervals. Pullup transistors on 000-015 are turned on
during last clock period of Input Data Strobe (IDS). Other pullup transistors are on continuously when in data input mode.
Note 4: Pulldown transistor provided on chip.
Note 5: Clamp diodes and series damping resistors may be required to prevent clock overshoot.
Note 6: Capacitance is not constant and varies with clock voltage and internal state of processor.
Note 7: For VSS ;;. VOUT ;;. 2.0V output current is a linear function of VOUT.
Note 8: Delay measured from valid logic level on clock edge initiating change to valid current output level
Note 9: Delay measured from valid logic leilel on clock edge initiating change to valid voltage output level.
Note 10: With respect to rising edge of NClK. (See Figure 9 and 10.)
Note 11: With respect to falling edge of elK. (See Figure 7.)
Note 12: With respect to the valid "0" level on the falling edge of Input Data Strobe (IDS). (See Figure 7.)
Note 13: With respect to valid logic level of appropriate clock.

1-05

INS8900

Absolute Maximwn Ratings
Voltage at Any Pin with Resepct to
Most Negative Supply (VSS) . . . . . . . . . . . . . . . . -0.3 V to +20V
Operating Temperature Range . . . . . . . . . . . . . . . . O°C to +70°C
Storage Temperature Range. . . . . . . . . . . . . . . . -65°C to +150°C
Lead Temperature (soldering, 10 seconds) . . . . . . . . . . . . +300°C

Electrical Characteristics
(TA = o°c to +70°C, VSS=

ov, Voo = +12V ± 5%,

VCC = +5V ± 5%, VSS

Conditions

Parameter

Symbol

= -8V ± 5%)
Min

Max

Units

OUTPUT SPECIFICATIONS

VOH
VOL

000-015, Fll-F14, OOS, IDS, NAOS
(These are low-power Schottky·compatible push-pull outputs.)
Logic "1" Output Voltage
Logic "0" Output Voltage

lOUT = -500}JA
lOUT = 900}JA

2.4

VOH
VOL

NHAL T, CONTIN (low-power Schottky outputs)
Logic "1" Output Voltage
Logic "0" Output Voltage

lOUT = -250}JA
lOUT = 600}JA

2.4

0.4

V
V

0.4

V
V

INPUT SPECIFICATIONS

VIH
VIL
IL
IlL
IlL

000-015, NIR2-NIR5, EXTENO, JC13-JC15, NINIT,
CaNTIN, NHALT (low-power Schottky inputs)
Logic ''1'' Input Voltage
Logic "0" Input Voltage
Input Leakage Current (except NHAL T, CaNTIN, JC13-JC15)
Logic "0" Input Current, NHALT, CONTIN (Note 2)
Logic "0" Input Current, JC13-JC15 (Note 2)

VIH
VIL
IIH

SPS (This is an MOS level input.)
Logic "1" Input Voltage
Logic "0" Input Voltage
Logic "1" Input Current (Note 3)

VCIL
VCIH
CIN

CLKX (This is an MaS level input.)
Clock "0" Voltage
Clock "1" Voltage
Input Capacitance

100

Average Supply Current (VOO) (Note 4)

tp = 500 ns, T A = 25°C

100

ICC

Average Supply Current (Vec) (Note 4)

tp = 500 ns, T A = 25°C

10

mA

IBB

Average Supply Current (VBB)

VSB=-8V

-200

}JA

2.4
-1.0
VSS ~ VIN ~ VCC + 1
VIN=0.4V
VIN = 0.4V

VIN = 13.6V

1-06

VCC+ 1
+0.8
40
-7.0
-3.0

V
V.
}JA
mA
mA

VOO-l
VOO+ 1
-1.0
+0.8
750

V
V
}JA

-1.0
+0.8
VOO-l
VOO+ 1
20

V
V
pF
mA

INS8900
Tining Specifications
Symbol

Parameter

Conditions

Min

Max

Units

5

30

ns

tCLK, tNCLK

CLKX
Rise and Fall Times (Note 5)
(Referenced to 10% and 90% amplitude)
Clock Period
Pulse Width (Referenced to 50% amplitude)

500
tp/2 - 5%

650
tp/2 + 5%

ns
ns

2

tES
tEH

EXTENO
Individual Extend Duration
Extend Setup Time (Note 6)
Extend Hold Time (Note 6)

70
120

ps
ns
ns

tOOl

Propagation Oelay
NHALT, CONTIN (Note 7)

200

ns

200

ns

t r , tf
tp

NAOS, IDS, ODS, 000-015 (Note 7)

tD02

CL = 40pF,
1 low-power Schottky load
CL=40pF,1INS820810ad

000-015
Input Setup Time (Note 6)
Hold Time (Note 8)

50
0

tFW

Fll-F14 Pulse Flag (PFLG) Pulse Width

4tp - 300

tNW

NINIT Initialization Pulse Width

8

tp

tlRW

NIR2-NIR5 Input Pulse Width to Set Latch

1

tp

tDS
tOH

ns
ns
4tp + 300

Note 1: Maximum ratings indicate limits beyond which permanent damage may occur. Continuous operation at these limits is not
intended and should be limited to those conditions specified under DC electrical characteristics.
Note 2: NHAL T, CONTIN, and JC13-JC15 logic "0" input currents specified when the internal chip loads are putting out a logic "1."
Note 3: Pull-down transistor provided on chip.
Note 4: Supply currents measured with 40 pF and I NS8208 loads.
Note 5: Clamp diode and series damping resistor may be required to prevent clock overshoot.
Note 6: Measured with respect to appropriate valid logic level of CLKX.
Note 7: Delay measured from valid logic level on CLKX edge initiating change to valid output voltage level.
Note 8: With respect to the valid "0" level on the falling edge of Input Data Strobe (I DS>'
Note 9: Typical load circuit:
INS8900

RL = 3.6k (3.3k for testing)
CL=40pF
VREF = 1.72V

_ VREF

Note 10: Typical output delay versus load capacitance CL
for load circuit in Note 9:

Note 11: Typical VDD supply current versus temperature.

125.0

250 ~

100.0 ~

200

~

C

oS

150

'"'"

I!> 25'C

50.0 ~

100 ~
50

-~

75.0

r-

-

I
I

I

120

140

I

I

25.0

I

lI

160
180
100 (ns)

200

0

220

25

I

50

TEMP I'C)

1-07

.

75

100

ns

INS8900
Tming Waveforms

~
jJ:tNCLK:f.!l-tCLK-!

J

ttl- -ltrl-

Figure 1. External Clock Timing (CLKXI

POWER
AID
CLDCICS

POWER AND CLDCK$STABLE

I-

IIIIT

I

INW
• CLOCK PE'1!,DS MINIMUM~

I-

~--u

16-24 CLOCK PERIODS

L

IADS~

~: ~~~----------------------------------------------Figure 2. Initialization Timing

IITERIAL
CLOCKPNASE
CLKX

ADDIIE.
DATA
IADI
j--tDD

'=

'ACE _________
DUTPUT

I--tDD

~o~u~~~U~n~A~~~IV!E·~________~~::::::::::::~~~~~~~;:::::::::::=t~__~____
II

_ I I P u r IUFFER DIUILED
~~7-_t~DD~________________~~

IDI ______________________________

..

~

·VII MUST IE AT THE CORRECT LOGIC LEVEL AT THIS TIME.
10TE: .. IOU ARE REFEREICED TO VALID LOGIC LEVELS ON CLOCK IIPUT. IITERNAL CLOCK PHASES ARE SHOWW
FOR REFEREICE OILY; THEY ARE lOT AVAILAILE EXTERIALL Y.

Figure 3. Add.... Output and Data Input Timing

1-08

IDD

INS8900

lining Wavefonns

(continued)

INTERNAL
CLOCK PHASE

M':~~~~_\'-----'_I~t~
t§j

NADS

OU~!~! ~~ ~~

~

\---1
~@J----++-~~-tDD---++--11-----t-FI

\

-J§__f.::::::::::::::::~DruAUTiAVVAlAL~ID~::::::::::::::=ta~~~

______________________

m

~

-Ii

I-toD
VALID
ODS _ _ _ _ _ _ _ _ _ _ _ _ _....I:l§Jo;:.]

I-tDD

Figure 4. Data Output Timing

i

INTERNAL
CLOCK PHASE

EXTRA CLOCK,
CYCLES DUE
TO EXTEND

E

E

CLKX
ADDRESS
DATA-1_ _ _

~

NADS
PACE
OUTPUTS

-I__________.....;.;:AC:.;T.;.;IV.;.E_________....:.:JI

INPUT_~-----~~~L------~~~~~~~~~~~~~~~~~~~~~~-DATA

OUTPUT
DATA

DISABLED

-1_----------------------........:4

ODS/IDS _1-_____________________........:4

Figure 5. Extend I/O Signal Timing

INTERNAL
CLOCK PHASE
CLKX

DATA

NADS

IDS/ODS

EXTEND __

~~~~~~~~~ri~~~~~~~~------------------------Figure 6. Suspend I/O Signal Timing

1-09

_____

INS8900

Tming Wavefonns (continued)

r->II+leCYCLES~1
...

••

1-----DR1VEN LOW EXTERNALL Y - - - - - - 1 1 - - ,,:,.;':;~.~,::,"n:::.:.'<";;',,: 'n::.:-::L.~:

NHALT
.. 3 CLK
CYCLES

=1

1-

5 CLOCK CYCLES MIN
INTERRUPT RE5I' TIME

I--- .. 15 + 2 Ie

I---

CYCLES~I
~

CONTIN

NOTES:
1. EXTERNAllY GENERATED TIL INPUTS OVERRIDE PACE OUTPUTS.
2.
CROSSHATCH INDICATES "DON'T CARE"INPUT STATE.
@Ie' DURATION OF EXTEND DURING PACE 110 CYCLES TIMING ASSUMES NO OTHER EXTENDS AND NO SUSPENDS.

III

Figure 7. Relative Timing for Level-O Interrupt Generation

I

--t- PROCESSOR STAll DURATIDN-l- RESUME NORMAL O P N ~
I---- APPROX 4 CYCLES
.

EXECUTION -I--EXECUTION SUSPENDED
> 11 + Ie CYCLES-=----l

@

L.._ _ _ _ _ _ _ _ _ _::::::::::::::~t--- D(~I:~~I:~~N~~~t~~~~~

NHALT

1-;.

5 + Ie CYCLES@..!--;' 4 CYCLES---l

CONTIN

~

--1

@

I

I

!--APPRDX 2% + Ie CLOCK CYCLES
CONTINUE DRIVEN ......._ - - - - CONTINUE DRIVEN BY PACE _ _ _ _ _ _ -CDNTINUE DRIVEN_
EXTERNAll Y
(EXTERNAL CIRCUITS HIGH IMPEDANCE)
,
EXTERNALL Y

I

NOTES:
1. EXTERNAllY GENERATED TIL INPUTS OVERRIDE PACE OUTPUTS.
2. ~ CROSSHATCH INDICATES "DON'T CARE"INPUT STATE.
@Ie+ DURATION OF EXTEND DURING PACE 110 CYCLES TIMING ASSUMES NO OTHER EXTENDS AND NO SUSPENDS.

Figure 8. Relative Timing for Processor Stall

The architecture of the INS8900 (shown in Figure 9)
features a number of resources to minimize system program and read/write storage, increase throughput, and
reduce the amount and cost of external support hardware. Principal resources that allow these efficiencies to
be achieved include:
Four 16-bit general purpose working registers available
to the user reduce the number of memory load and store
operations associated with saving temporary and intermediate results in system memory.
An independent 16-bit status and control flag register
automatically and continuously preserves system status.
The user may operate on its contents as data, allowing
masking, testing, and modification of several bit fields
simultaneously.
A ten-word U6-bid last-in, first-out (LIFO) stack
inherently decreases response time to interrupts while
eliminating both program and read/write system storage
overhead associated with storing stack information
outside the microprocessor chip.

Stack full/stack empty interrupts are provided to facilitate off-chip stack storage in those applications where
additional stack capacity is desirable.
A six-level vectored priority interrupt system internal to
the chip provides automatic interrupt identification,
eliminating both program storage overhead and the time
normally required to poll peripherals in order to identify
the interrupting device.
Three sense inputs and four control flag outputs allow
the user to respond directly to specific combinations of
status present in the microprocessor-based system, thus
eliminating costly hardware, program overhead, and
throughput associated with implementing these functions over the system data bus.
A comprehensive set of input/output control signals
provided by the internal control logic simplifies interfaces to memory and peripherals and allows flexible
control of I NS8900 operations.
Single-phase 2.0 MHz clock input is easily generated with
a minimum of external components.

1-010

PACE STE
recommended crystal specifications
• AT-cut crystal
•

2.6667 MHz ± 0.1%, fundamental
mode

• 5 mW maximum
• 150 n maximum series resistance

timing diagram
tTDz

TClKO

TClK
tPll

-tPHZ

911%

NClK
OR
NCK
ClK
OR
CK

90%

911%

-tpw

TIMES FOR NCLK, NCK, ClK, AND CK MEASURED AT 111% AND 911%

Figure 2.

1-011

PACE STE
absolute maximum ratings [1]

operating conditions

Supply Voltage (Vee) . . . . . . . . . . . . . . . . . . . 7.0 V
(VGG) . . . . . . . . . . . . . . . . . -15.0 V
Input Voltage . . . . . . . . . . . . . . . . . . . . . . . . . 5.5 V
Storage Temperature . . . . . . . . . . . . -65°C to +150°C
lead Temperature (soldering, 10 seconds) ..... 300°C

dc electrical characteristics

Min.
Max.
4.75
5.25
-11.40 -12.6
+70
0

Supply Voltage (Vee!
(VGG)
Temperature

Units
V
V
°c

(Notes 2 and 3)
Conditions

Parameter

Min.

Typ.

Max.

Units

OUTPUT SPECIFICATIONS:
T ClK, T ClK* (TTL Clocks)
VOH logic "1" Output Voltage

Vee =4.75V

IOH=-1mA

VOL logic "0" Output Voltage
los Output Short Circuit Current

Vee = 4.75V

10L = 32mA

3.65

4.25

V
0.4

V

-55

mA

0.25

(Note 4), Vee = 5.25 V, Vo = 0

-33

-10

CK, NCK, ClK, NClK
-100~A

VOH logic "1" Output Voltage

IOH =

VOL logic "0" Output Voltage

Vee= 4.75V
VGG=-11.4V

Vee = 5.25V

4.5

Vee - 0.9

I

V

10L = 100~

VGG + 0.1

VGG+ 0.25

I

10L = 5mA

VGG + 0.2

VGG

I

V IN=2.4V

+0.5

V
V

INPUT SPECIFICATIONS:
EXTC
V IH

logic "1" Input Voltage

IIH

logic "1" Input Current

V IL

logic "0" Input Voltage

IlL

logic "0" Input Current

VeLAMP

Input Clamp Diode

2.0

I

V
40

~

1.0

mA

VIN = 5.5V

0.8

V

Vee = 5.25V

V IL = 0.4V

-0.9

-1.6

mA

Vee = 4.75V

IlL = -12mA

-0.8

-1.5

V

20

30

mA

-40

-55

mA

POWER SUPPLY CURRENT
lee

Supply Current from Vee

IGG Supply Current from VGG

ac electrical characteristics
Symbol

Vee = 5.25V
VGG = -12.6V
Crystal Freauency at 2.6667 MHz

I

A = O°C to +70°C, Vec - VGG = +17V ± 5%
Limits

Parameter

Min. Typ. Max.

tNOV1' tNov2
tpw

Non-Overlap Time

5

MOS Clocks Pulse Width (NClK, ClK, NCK, CK)

300 320

tR

MOS Clocks Rise Time (NClK, ClK, NCK, CK)

tF

MOS Clocks Fall Time (NCLK, ClK, NCK, CK)

tPH1' tPH2

TTL Clocks to MOS Clocks High Level Delay

tPL1' tPL2

TTL Clocks to MOS Clocks Low Level Delay

tTD1' tTD2

TTL Clock to TTL Clock Delay

tSTART

Time Delay from Last Power Applied to MOS Clocks Stabilized

-40
-25

12

Units

Test
Conditions

ns

See Note 5

ns

See Note 5

40

ns

See Note 5

40

ns

See Note 5

40

ns

See Note 5

80

ns

See Note 5

25

ns

See Note 5

100

ms

See Figure 7

Not..:
1. "Absolute Maximum Ratings" are those values beyond which the safety of the device cannot be guaranteed. They are not meant to imply
that the devices should be operated at these limits. The table of "Electrical Characteristics" provides conditions for actual device operation.
2. Unless otherwise specified, minImax limits apply across the O°C to +70°C temperature range and VCC = 4.75 V to 5.25 V, VGG = -11.4 V
to -12.6 V power supply range. All typical, are given for Vce = 5.0V, VGG = -12V, and TA = +25°C.
3. All currents into device pins are shown as positive; currents out of davice pins are shown as negative. All voltages are references to ground
unless otherwise noted.
4. Only one output at a time should be shorted.
5. The test conditions for measuring AC parameters are shown in Figures 2 and 3, with C1 = C2 = 60 pF, C3 = 80 pF, CNOV = 60 pF. Load
conditions for MOS clocks and TTL clocks are shown in Figures 4 and 5. Including probe and jig capacitance, CL 1 = 20 to 80 pF, and
CL2 =40pF.

1-012

PACE STE
test conditions
TCLK*, TCLK LOAD

NCLK, NCK, CLK, CK LOAD
OUTPUT UNDER

TEST
VCC

L".

OUTPUT
UNDER

TEST

RL = 390n

r'u"
Cl = C2 = 60pF, C3 = 80pF, CNOV = 60pF*
* ALL CAPACITD RS ARE ±5%

Figure 5.

Figure 4.

Figure 3.

typical characteristics
TYPICAL NON·OVERLAP TIME VS.
NON-OVERLAP CAPACITOR
80

VC~=5 J

VGG=-12V
CLI = 80pF
TA=25°

./V

0

/

0
0
0
0

V
25

V
50

V
75

VCC
VGG

l/
NCLK,
CLK,
NCK,
OR CK
100

125 150 175 200

..--ISTART_

CNOV(Pf)
NDN·OVERLAP CAPACITANCE

Figure 7.

Figure 6.

1-013

PACE BTE/S
absolute maximum ratings (Note 1)
Supply Voltage
7V
Input Voltage (All Inputs Except MBIIO Input Active)
5.5V
Output Voltage
5.5V
±10mA
MaS Bus Input Current
--65°C to +150°C
Storage Temperature
Lead Temperature (Soldering, 10 seconds)
300°C
dc electrical characteristics

recommended operating conditions
MIN
4.75
0

Supply Voltage (VCC)
Temperature (T A)

UNITS
V
°c

MAX
5.25
+70

(Notes 2 and 3)

PARAMETER
TTL BUS PORT (BDI/O 00-07)

I

CONDITIONS

I

MIN

I

TYP

I

MAX

VIH

Logical "1" Input Voltage

VIL

Logical "0" Input Voltage

VOH

Logical "1" Output Voltage

WBO* = O.SV,
MBI/O = 0.5 mA

10H = -5.2 mA

VOL

Logical "0" Output Voltage

WBO* = O.BV,

10l = 20 mA

0.25

0.4

MBI/O = 100pA

10L = 50 mA

0.4

0.5

2.0

VCC-l.l
2.4

UNITS

V
O.S

10H=-1 mA

I

V
V

VCc-O·S
3.7

V
V
V

lOS

Output Short Circuit Current

WBO* = O.BV, MBI/O = 0.5 mA,

IIH

Logical "1" Input Current

WBO* = 2V, VIH = 2.4V

SO

pA

II

Input Current at Maximum

WBO* = 2V, VIH = 5.5V,

1

mA

/J. A

-10

-35

-75

mA

VOUT = OV, VCC = 5.25V, (Note 4)

Input Voltage

VCC = 5.25V

IlL

Logical "0" Input Current

WBO* = 2V, VIL = 0.4V

-10

-250

VCLAMP

Input Clamp Voltage

WBO* = 2V, liN = -12 mA

--0.2

-1.5

100

Outputllnput Bus Oisable Current

WBO* = STR* = 2V, BOliO = 0.4V

V

-BO

SO

/J. A

-5.0

0.10

mA

5.0

mA

O.S

V

to 4V, VCC = 5.25V
MOS BUS PORT (MBI/O 00-07)
10

Logical "0" Input Current

WBO* = O.BV, 10L(TTL) = 50 rnA,
VOL::; 0.5V, (Note 5)

11

Logical "1" Input Current

WBO* = O.BV, 10H(TTL) = -1 rnA,

0.50

VOH ~VCC-l.1V, (Notes 5 and 6)
Vo

Logical "0" Input Voltage

WBO* = O.BV, 10L(TTL) = 50 rnA,
VOL ::;0.5V

Vl

Logical "1" Input Voltage

WBO* = O.BV, 10H(TTL) = -1 rnA,

2.0

1.5

V

2.4

3.3

V

VOH ~ VCC - 1.1V
VOH

Logical "1" Output Voltage

WBO* = CEl = BOliO = 2V,
IOH(MOS) = -1 mA, CE2* =
STR* = O.BV

VOL

Logical "0" Output Voltage

WBO* = CEl = 2V, 10L(MOS) =
5 rnA, CE2* = STR* = BOliO = O.BV

lOS

Output Short Circuit Current

WBO* = CEl = BOliO = 2V,

0.2B

-7

-15

0.5

V

-45

mA

VCC = 5.25V, VOUT = OV,
STR* = CE2* = O.BV, (Note 4)
VCLAMP

Input Clamp Voltage

liN = -12 rnA

100

Outputllnput Bus Oisable Current

MBI/O = O.4V to 4V, VCC = 5.25V

-BO

-1.5

V

BO

/J.A

CONTROL INPUTS (WBD*, CE1, CE2*, STR*)
VIH

Logical "1" Input Voltage

VIL

Logical "0" Input Voltage

2.0

V

IIH

logical "1" Input Current

VIN = 2.4V

20

pA

11

Input Current at Maximum

VIN = 5.5V

1.0

mA

O.S

Input Voltage

1-014

V

r

PACE BTE/S

--

dc electrical characteristics
PARAMETER

(Continued)

(Notes 2 and 3)

I

CONTROL INPUTS (WBD*, CE1, CE2*, STR*)

I

CONDITIONS

MIN

I

TYP

I

MAX

I

UNITS

(continued)

IlL

Logical "0" Input Current

V,N

VCLAMP

Input Clamp Voltage

liN

= O.4V

-250

-400

JiA

= -12 rnA

--0.85

-1.5

V

= 5.25V

70

110

rnA

POWER SUPPLY CURRENT
ICC

Power Supply Current

VCC

Note 1: "Absolute Maximum Ratings" are those values beyond which the safety of the device cannot be guaranteed. They are not meant to
imply that the devices should be operated at these limits. The table of "Electrical Characteristics" provides conditions for actual device operation.
Note 2: Unless otherwise specified, minImax limits apply across the O°C to +70°C temperature range and the 4.75V to 5.25V power supply range.
All typicals are given for VCC = 5V and T A = 25°C.
Note 3: All currents into device pins are shown as positive, out of device pins are negative. All voltages are referenced to ground unless otherwise
noted.
Note 4: Only one output at a time should be shorted.
Note 5: The MBI/O Input Characteristic Graph illustrates this parameter and defines the regions of guaranteed logical "0" and logical ", .. outputs. See equivalent input structure for clarification. When the MBI/O input is loaded with a high impedance source (open), the TTL output will
be in the logic "0" state.
Note 6: The maximum MOS bus positive input current specification is intended to define the upper limit on guaranteed input clamp operation.
At higher input currents (up to the absolute maximum rating) clamp operation is not guaranteed but TTL bus logic state is valid and no device
damage will occur.
Note 7: In most applications the MOS bus data lines are higher impedance and more sensitive to noise coupling than TTL bus lines. Conservative
design practice would dictate routing MOS bus lines away from high speed, low impedance TTL lines and MOS clock lines or providing a ground
shield when they are adjacent.

ac electrical cha racteristics

VCC

= 5V

±5%, T A

PARAMETER

= o°c to

+70°C

CONDITIONS

MIN

TYP

MAX

UNITS

DATA TRANSFER SPECIFICATIONS
Receiving Mode (BOliO Bus to MBIIO Bus)

WBD*

= 3V,

RL = 1

kn,

= 15 pF,

CL

(Figures 4 and 6)

= CEl = OV,
STR* = CE2* = 3V,
CL = 50 pF, R L = 100 n,

Driving Mode (MBI/O Bus to

WBD*

BOliO Bus)

tpdO

17

40

tpd1

20

40

ns

tpdO

40

60

ns

tpd1

40

60

ns

ns

(Figures 3 and 5)
TRANSCEIVE~

MODE SPECIFICATIONS

Select Bus
tDS

Chip Enable Data Set-Up

(Figure 1)

45

tDH

Chip Enable Data Hold

(Figure 1)

0

ns

tES

Set-Up

(Figure 1)

0

ns

23

ns

TTL Data Bus (BOlIO 00-07)

= 100 n, (Figure

tBO 00

Bus Data Output Disable

CL

=5

tBO OE

Bus Data Output Enable

CL

= 50 pF,

tBO IE

Bus Data Input Enable

(Figure 1)

30

ns

tBO 10

Bus Data Input Disable

(Figure 1)

30

ns

pF, RL

RL

1)

= 100 n, (Figure

5

1)

20

50

ns

25

80

ns

MOS Data Bus (MBI/O 00-07)
tMB 00

MOS Bus Output Disable

CL

= 15 pF,

RL

= 1 kn.

(Figure 1)

tMB OE

MOS Bus Output Enable

CL

= 15 pF.

RL

= 1 kn.

(Figure 1)

tMB 10

MOS Bus Input Disable

(Figure 1)

55

ns

tMB IE

MOS Bus Input Enable

(Figure 1)

20

ns

15

50

100

ns

50

100

ns

Select Bus
tCLR

Clear Previous Chip Enable

I

I

(Figure 2)

1-015

I

25

I

50

I

ns

PACE STE/S
switching' time waveforms and ac test circuits

STR*

C E Z · - - - - -.......
CEI-------'

WID'

TTL DATA
IUS

--------------+-

.MOS DATA
BUS

FIGURE 1

STR'~1I%
CEZ' 3V
CEIOV----------------~-----------------------------------------

t.L.:---1
WID'

TTL DATA
BUS

----------+~

MUS OATA

BUS

----------~

FIGURE 2
VCC=SV

INPUTIOV~
SV
SV

WAVEFORM
(NOTE I)

O.'PF

OV

INPUT

PdltpdO

VOH
OUTPUT

~
1.5V

VOL

100

T

OUTPUT

I.SV

ALL DIODES
ARE IN31114

FIGURE 3. BOlIO Bus

*This input network simulates the actual drive characteristic of the PACE outputs
FIGURE 5. MBIIO to BOlIO ac Loads
VCC =sv

INPUT3V~
1.5V
I.SV

WAVEFORM
(NOTE 1)

OV

'tpdO

VOH
~UTPUT

~
1.5V

VOL

I.SV

ALL DIODES
ARE IN3064

FIGURE 4. MBIIO Bus
FIGURE 6. BOlIO to MBIIO ae Loads
Note 1: Freq = 1 MHz, duty cycle = 50%, tR = tF :s:. 10 ns (refer to Figures 5 and 6).
Note 2: All capacitance values include probe and jig capacitance (refer to Figures 5 and 6).

1-016

PACE BTE/S
typical performance characteristics
MOS Bus Input Characteristic

MOS Bus Input Characteristic

MOS Bus Voltagl! Threshold

0.8
0.6

C

Vee = 5V
STANDARD
OUTPUT
LOAj'NG

C

oS

oS
I-

z

0.4

IZ

02

u

IC
IC

IC
IC

=
u
l...=

,

---

TA =1 70'e

=
...=

I-

TA = ode

z

z

f-TA ~ 25'e

'I

I

I

I

I

o L-...l-.....~::t:::=:L____L-...J

-0.2
0.5

1.5

1.0

2.0

2.5

3.0

o

0.5

1.0

INPUT VOLTAGE (VI
MOS BUS

1.5

2.0

2.5

MOS Bus Current Threshold

2.0

:::>

I-

1.8

'"

I

0.5

1.1

220

1.2

1.3

1.4

30 1--1--1r--~f-H'----!---l

TA =25'e
20

1.0

:::>

I

Vee 15V
STANDARD
OUTPUT
LOADING
1.5

1.6

OL--J.L.oCLI...-_I...----'I....----I
o 0.1 02 0.3 0.4 0.5

1.7

INPUT VOLTAGE (V)
ITLBUS

INPUT CURRENT (IlA)
MOS BUS

High-Level Output Voltage
vs Output Current TTL Bus

lOW·lEVEl OUTPUT VOLTAGE (V)
TIL BUS

Output Current vs Output Voltage
High Impedance State TTL Bus

Vee = 5V
TA = 25'C

1.7

40 r--r--1i--1i---J'Hi----l

I

-

1.5

I-

!'I..

1.6

2.5

~

200

1.5

50

I

TA = 70'e

to

lBO

1.4

Low-Lavel Output Voltage
vs Output Current TTL Bus

TA = o'e

~

160

1.3

INPUT VOLTAGE (VI
MOS BUS

3.0

140

1.2

TTL Bus Threshold Characteristic
3.5

120

3.0

INPUT VOLTAGE (V)
MOS BUS

Low-Lavel Output Voltage
vs Output Current MOS Bus

10

c

oS
IZ

'"I'\.r-...

en

:::>

II:
II:

=
U

I:::>

~

'\
I\.
o

-5
-10

O'--_ILU._L...----'L...----'L...----I

o

-10

-3~

-20

-40

-1

HIGH LEVEL OUTPUT CURRENT (rnA)
TTL BUS

4.0
3.5

to

~
...=

3.0

>

2.5

I-

2.0

'"

1.5

r""\.

""

I-

Output Current vs Output
Voltage High Impedance
State MOS Bus

:::>

;
%

to

i:

Vee ~ 5V
TA=25'C-

,

10

c

oS
IZ
IC
IC

:::>

I\.

I:::>

'\.

1.0

'"=

I-

r\.

0.5

o

0.1

-5

'\.

o

-4

-8

-12

-16

-20

-2

HIGH LEVEL OUTPUT CURRENT (rnA)
MOS BUS

OUTPUT VOL TAGE (V)
MOS BUS

1-017

0.2

0.3

0.4

lOW lEVEL OUTPUT VOLTAGE (V)
MOS BUS

OUTPUT VOLTAGE (V)
ITlBUS

High-Level Output Voltage
vs Output Current MOS Bus
~

o

10

0

0.5

Chapter 2
THE GENERAL INSTRUMENT CP1600
The CP1600 and the TMS 9900 were the first two NMOS 16-bit microprocessors commercially available. Even
a superficial inspection of the CP1600 shows it to be more powerful than the National Semiconductor PACE (or 8900).
yet the CP1600 is not widely used. This is because General Instrument does not support the CP1600 tothe extent
that National Semiconductor originally supported PACE. or most manufacturers support their 8-bit microprocessors.

General Instrument's marketing philosophy has been to seek out very high-volume customers; General Instrument supports low-volume customers only to the extent that this support would not require substantial investment on
the part of General Instrument.
From the viewpoint of the low-volume microprocessor user. General Instrument's marketing philosophy is unfortunate.
The CP1600 is an ideal microprocessor for the more sophisticated video games that are appearing. and its rich instruction set and capable architecture make it an ideal choice for data processing terminals and home computer systems.
However. due to its limited support. potential low-volume CP1600 customers are likely to choose another equally capable product.

Three CP1600 parts are available, differentiated only by the clock speeds for which they have been designed.
The CP1600 requires a 3.3 MHz. two-phase clock and generates a 600 nanosecond machine cycle time.
The CP1600 requires a 4 MHz. two-phase clock and generates a 500 nanosecond machine cycle time.
The CP161 0 requires a 2 MHz. two-phase clock and generates a 1 microsecond cycle time.

In addition to the CP1600 microprocessors themselves, the CP1680 Input/Output Buffer (lOB) is described in
this chapter. Additional support devices for the CP1600 may be found in An Introduction to Microcomputers:
Volume 3 - Some Real Support Devices.
The sole sou rce for the CP 1600 is:
GENERAL INSTRUMENT
Microelectronics Division
600 West John Street
Hicksville. New York 11802

There is no second source for the CP1600. General Instrument has a policy of discouraging second sources for its
product line.
The CP1600 is fabricated using NMOS ion implant LSI technology; the device is packaged as a 40-pin DIP.
Three power supplies are required: +12V. +5V and -3V.

THE CP1600 MICROCOMPUTER SYSTEM OVERVIEW
Logic of our general microcomputer system which has been implemented by the CP1600 CPU is illustrated in
Figure 2-1.
Observe that the CP1600 requires external logic to create its various timing and clock signals.
Some bus interface logic is shown as absent because a number of devices must surround the CP1600; these include:
1)

An address buffer. since data and addresses are multiplexed on a single 16-bit bus.

2)

Buffer amplifiers to provide the power required by the type of memory and I/O devices that will normally be connected to a CP1600 CPU.

3)
4)

A one-of-eight decoder chip to create eight individual control Signals out of three controls output by the CP 1600.
A one-of-sixteen multiplex chip to funnel sixteen external status Signals into the CP1600 if using external
branches.

2-1

Were you to compare Figure 2-1 with an equivalent figure for a low-end microprocessor such as the SC/MP (which is
described in Chapter 3 of the Osborne 4 & 8-Bit Microprocessor Handbook{Osborne/McGraw-Hill, 1980), the CP1600
might appear to offer fewer logic functions; but within the functions it does provide, the CP1600 provides considerably
more logic and program execution capabilities. Where low-end microprocessors choose to condense, onto a single
chip, simple implementations of different logic functions, high-end products such as the CP1600 choose to provide
more devices - with greater capabilities on each device.

Clock Logic

o

Interface Logic

Programmable
Timers

I/O Ports

Figure 2 -1. Logic of the CP 1600 CPU and CP 1680 1/0 Buffer

2-2

CP 1600 CPU

CP1680 I/O Buffer

CP1600 PROGRAMMABLE REGISTERS
The CP1600 has eight 16-bit programmable registers. which may be illustrated as follows:
RO
R1
R2 } Deta Counters
R3
R4 } Data Counters with
auto-increment
R5
Stack Pointer
R6
Program Counter
R7

General Purpose registers

The way in which the registers illustrated above are used is unusual when compared to other microcomputers described in this book. All eight 16-bit registers can be addressed as though they were general purpose registers;
however. only Register RO has no other assigned function. We may therefore look upon Register RO as the Primary Accumulator for this CPU.
Registers R1. R2. and R3 serve as general purpose registers. but may also be used as Data Counters.
In addition to serving as general purpose registers. R4 and R5 may be used as auto-incrementing Data Counters.
Memory reference instructions that identify Register R4 or R5 as holding the implied memory address will cause the
contents of Register R4 or R5 to be incremented - after the memory reference instructions have completed execution.
Registers R6 and R7. in addition to being accessible as general purpose registers. also serve as a Stack Pointer and a
Program Counter. respectively.
Having the Stack Pointer accessible as a general purpose register makes it quite simple to maintain more than one
Stack in external memory; also. you can easily address the Stack as data memory using the Stack Pointer as a Data
Counter.
Having the Program Counter accessible as a general purpose register can be useful when executing various types of
conditional branch logic.
While having the Stack Pointer and the Program Counter accessible as though they were general purpose registers
may appear strange. this is a feature of the PDP-11 minicomputer - and is a very powerful programming tool.

CP1600 MEMORY ADDRESSING MODE
The CP1600 addresses memory and 1/0 devices within a single address space.
When referencing external memory. you can use direct addressing. implied addressing. or implied addressing
with auto-increment.
Direct addressing instructions are all two or more words long. where the second or last
word of the instruction object code provides a 16-bit direct address.

CP1600 DIRECT
ADDRESSING

CP 1600 direct addressing instructions are complicated by the fact that CP 1600 program
memory is frequently only 10 bits wide. That is to say. even though the CP1600 is a 16-bit microprocessor. its instruction object codes are only 10 bits wide. If program memory is only 10 bits wide. then direct addresses will only be 10
bits wide. A 1O-bit direct address will access the first 1024 words of memory only.

2-3

Were you to implement a 16-bit wide program memory. then you could directly address up to 65.536 words of memory; however. six bits of the first object program word for every instruction in program memory would be wasted. This
may be illustrated as follows:
Program
Memory

15

o

10-9

~

Bit Number

Three memory
....1------"'"'7"- reference

instructions
that specify
direct addressing

Six unused
bits in each·
of these
memory locations
Two single
word instructions

Instructions that reference memory using implied addressing identify general purpose
Register R1, R2, or R3 as containing the implied address.
A memory reference instruction which identifies Register R4 or R5 as providing the external
memory address will always cause Register R4 or R5 contents to be incremented following the
memory access; thus you have implied memory addressing with auto-increment.

CP1600
IMPLIED
ADDRESSING

Memory reference instructions that specify implied memory addressing via Register 1, 2, 3, 4, or 5 can access
8-bit memory. An SDBD instruction executed directly before a valid memory reference instruction forces the memory
reference instruction to access memory one byte at a time. If implied memory addressing via Register 1. 2. or 3 is
specified. then the same byte of memory will be accessed twice. For an instruction that loads the contents of data
memory into Register RO. this may be illustrated as follows:
Memory

}

SOBD

Rol

Program memory

MVI R1.RO

yy

PPQQ

2-4

XXYY

}

Data memory

If Register R4 or R5 provides the implied memory address for the instruction which follows an SDBD instruction. then
the implied memory address is incremented twice. and two sequential low-order bytes of data are accessed. For an instruction which loads data into Register RD. this may be illustrated as follows:
Memory

RO

R5

Program memory

...

~--~---

I

PP

Data memory

"

The SDBD instruction may also precede an immediate instruction. Now the immediate data will be fetched from the
low-order byte of the next two sequential program memory locations. This may be illustrated as follows:
Memory

MVII XXYY.RO

Without the preceding SDBD instruction. an immediate instruction will access the next single program memory word
to find the required immediate data. Ten or more bits of immediate data will be accessed. depending on the width of
program memory words.

The CP1600 has no Stack reference instructions such as a Push or Pull; rather, a variety of
CP1600
STACK
memory reference instructions can identify Register R6 as providing the implied address.
When Register R6 provides the implied address. it is treated as an upward migrating Stack
ADDRESSING
Pointer. When a memory write operation specifies Register R6 as providing the implied memory
address. Register R6 contents will be incremented following the memory write. A memory read instruction that
specifies Register R6 as providing the implied memory address will cause the contents of Register R6 to be decremented before the read operation occu rs.
An unusual feature of the CP1600 is the fact that a variety of secondary memory reference instructions can also
reference memory via the Stack Pointer. When these instructions are executed. Register R6 contents are decremented before the memory access occurs - as though a Pull operation from the Stack were being executed.
Logically. Register R6. the Stack Pointer. is being handled as though it were a Data Counter with post-increment and
pre-decrement.

2-5

Jump instructions use direct memory addressing. Jump instructions are all three words long. The direct address is
computed from the second and third memory words as follows:
98765432
0

0

0

0

0

x

X

A

A

A

B

B

B

B

B

0
A
B

0

0

1

0

0

A

A

y

y

B

B

B

B

--

--

-

~

JR or JSR
Word 2
Word 3

AAAAAABBBBBBBBBB Jump address (binary)
are enable/disable bits for interrupts
xx identify the register where the return address will be stored for JSR
xx and yy are described in detail in Table 2-4.

yy

You can enable or disable interrupts whenever you execute a Jump or Jump-to-Subroutine instruction.
The only difference between a Jump instruction and a Jump-to-Subroutine instruction is that the Jump-to-Subroutine
instruction saves the Program Counter contents in Register 4, 5, or 6. The two high-order bits (xx) or the second Jumpto-Subroutine object code word specifies which of the three registers will be used to hold the return address.
Jump-to-Subroutine instructions, like the Jump instruction, allow direct memory addressing only.

CP1600 STATUS AND CONTROL FLAGS
The CP1600 CPU has four of the standard status flags; in addition, it has some unusual control signals.
These are the four standard status flags:
Sign (5), This status is set equal to the high-order bit of any arithmetic operation result.
Zero (Z). This status is set to 1 when any instruction's execution creates a zero result. The status is set to 0 for a nonzero
result.
The Carry (C) and Overflow (0) statuses are standard carry and overflow, as described in Volume 1.

Four control signals (EBCAO - EVCA3) are output during a Branch-on-External (BEXT) instruction. The'se four signals are output to reflect the low-order four bits of the SEXT instruction's object code. External logic receives these four
signals and (depending on their state), mayor may not return a high input via ESC!. If ESC I is returned high, then the
SEXT instruction will perform a branch: if ESCI is returned low. then the SEXT instruction will cause the next sequential
instruction to be executed. The four control signals ESCAO - EBCA3 therefore provide the CP1600 with a means of testing 16 external conditions.

CP1600 CPU PINS AND SIGNALS
CP1600 CPU pins and signals are illustrated in Figure 2-2.
DO - 015 is a multiplexed Address and Data Bus. Given a total of 40 pins in a package, CP1600 designers have been
forced to share 16 pins between addresses and data. Three control signals, BDIR, BC1, and BC2, identify the traffic
on the Address/Data Bus. External logic (one MSI chip) must decode these three signals to create eight control
signals, as summarized in Table 2-1.
Remaining signals may be divided into four groups: timing, status/control, interrupt, and OMA.
Two timing clock signals are required: <1>1 and <1>2. These are complementary clock signals which may be illustrated
as follows:

<1>1

--1

\

I

\

I

<1>2

\ " , , _ _~I

\

I

\~_.,Jr

2-6

L

ESCI

1

MSYNc'

2

BCl
BC2

3
4

BDIR

5
6

015
014
013
012

9
10

011

40
39

CPl600

11
12
13
14

010
09

OS
00
01
07

15
16

D6

17

06

04

18
19

03

20

CPU

PCiT
GNO

«111
«112

38
37
36

YeO

35
34
33

VBB
VCC
BOROY

32
31

STPST

30
29

HALT,

28
27
26
25
24
23
22
21

BUsRQ
BUSAK

iNiR
iNTRM
TCI
EBCAO
EBCAl
EBCA2
EBCA3
02

Pin Name

Description

Type

00-015

Data and Address Bus
Bus control signals
Clock signals
Master Synchronization
External branch condition address lines

Tristate. Bidirectional

BDIR. BCl. BC2

cl»1. «112

MSYNC
EBCAO - EBCA3
ESCI

PCiT

External branch condition input
Program Counter inhibit/software
interrupt signal

BDROY

WAiT

STPST

CPU stop or stan on high-to-Iow transition
Halt state signal
Interrupt request lines
Terminate current interrupt

HALT

iNTR. iNTRM
TCI

ijSiiQ

Bus request
External bus control acknowtedge

"BUSAK
VB8.VCC.VOO.GNO

Output
Input
Input
Output
Input
Input
Input
Input
Output
Input
Output
Input
Output

Power and Ground

Figure 2-2. CP1600 CPU Signals and Pin Assignments

MiYNC is a somewhat unusual signal. as compared to other microcomputer clock signals in this book. Following
powerup. MSYNC must be held low for at least 10 milliseconds. On the subsequent riSing edge of MSYNC. logic internal to the CP1600 CPU will synchronize the <1>1 and <1>2 clock signals to start a new machine cycle. Most of the CPU
devices we have described in this book use a reset signal. or have internal powerup logic which performs this clock
synchronization.
Now consider the status and control signals.
First of all. there are the four control outputs which we have already described: EBCAO - EBCA3. There is one conditional Branch instruction (BEXT) which will only branch if a high signal is input via EBCI. When the BEXT instruction is executed. the low-order four BEXT instruction object code bits are output via EBCAO - EBCA3. External
logic is supposed to decode these four signals by whatever means are appropriate - and thence determine whether
ESCI should be input high or low. A high input. as we have just stated. will result in a branch: a lowinput will cause the
next sequential instruction to be executed.
In reality. there is no connection within CP1600 CPU logic between the EBCI input and the four EBCAO - EBCA3 outputs. So far as external logic is concerned. the execution of a BEXT instruction is identified by signal levels output and
maintained on the EBCAO - EBCA3 outputs. while the EBCI input determines whether a branch will or will not occur.
How external logic chooses to determine whether EBCI will be set high or low is entirely up to external logic. The only
vital function served by ESCAO - EBCA3 is to identify the instant at which a BEXT instruction is executed.
Another unusual control signal provided by the CP1600 is PCIT; this is a bidirectional Signal. When input low. this
Signal prevents the Program Counter from being incremented following an instruction fetch. This Signal is also output
as a low pulse following execution of a software interrupt instruction. Instruction timing separates the active input and

2-7

active output of this signal: providing external logic adheres to timing requirements, a conflict between input and output logic will never arise.

BDRDY is equivalent to the WAIT signal we have described for a number of other microcomputers. BDRDY is input low by any external logic which requires more time in order to respond to an 1/0 access. Recall that the CP1600
uses a single address space to reference memory or I/O devices. The 'SDR]jy signal causes the CPU to enter a Wait
state for as long as B"i5'RI)V is being input low: however, during the Wait state CPU logic is not refreshed. Thus a Wait
state cannot last for more than 40 microseconds, or the contents of internal CPU locations will be lost.
STPST, a Halt/Reset input, is an edge-triggered signal. When external logic inputs a high-to-Iow transition via STPST,
the CPU will complete execution of any interrupt instruction, then will enter a Halt state and output HALT high. If a
non-interruptable instruction is being executed, then the Halt state will not being until completion of next interruptable
instruction's execution. The Halt state will last until external logic inputs another high-to-Iow STPST transition, at
which time the Halt output will be returned low and normal programming execution will continue. Execution of the
HL T instruction also causes the CP1600 to enter a Halt state, as described above.
Let us now look at interrupt signals.
The CP1600 has two interrupt request inputs -INTR and INTRM. INTR has higher priority than INTRM. INTR cannot be disabled. Typically, TNiI1 will be used to trigger an interrupt upon power failure or other catastrophes.
The interrupt acknowledge signal is created by external logic which must decode the BC1, BC2, and BDIR signals, as shown in Table 2 -1. Observe that there are, in fact. two interrupt acknowledge signals: the first (I NT AK)
acknowledges the interrupt itself, while the second (DAB) is used as a strobe for external logic to return an interrupt address vector. The interrupt sequence is described later in this chapter.
The CP1600 has two additional interrupt-related signals which are unusual when compared to other microcomputers
described in this book.
TCI is output high when an End-of-Interrupt instruction is executed. This signal makes it easy for external log ic to
generate interrupt priorities which extend across the execution of an interrupt service routine.

Table 2-1. CP1600 Bus Control Signals
BC1

BC2

BDIR

SIGNAL

FUNCTION

0

0

0

NACT

The CPU is inactive and the Datal Address Bus is in a high impedance state.

0

0

1

BAR

A memory address must be input to the CPU via the DatalAddress
Bus.

0

1

0

lAB

Acknowledged external interrupt requesting logic must place the
starting address for the interrupt service routine on the Address Bus.

0

1

1

DWS

Data write strobe for external memory.

1

0

0

ADAR

This signal identifies a time interval during which the DatalAddress
Bus is floated, while data input on the Data Bus is being interpreted
as the effective memory address during a direct memory addressing
operation.

1

0

1

DW

The CPU is writing data into external memory. DW will precede
DWS by one machine cycle.

1

1

0

DTB

This is a read strobe which external memory or I/O logic can use in
order to place data on the Datal Address Bus.

1

1

1

INTAK

This is an interrupt acknowledge signal. It is followed by lAD which
is a strobe telling the external logic which is being acknowledged to
identify itself by placing an address vector on the DatalAddress Bus.

2-8

MC
T1

T2

MC

T3

T4

T2

T1

T3

T4

BC 1,BC2,BDIR

OO-D15

---51~-+-----l~-

Undefined
state
preceding
data output

Data
Output

Data
Input

Figure 2-3. CP1600 Machine Cycles and Bus Timing

BAR

NACT
MC2

MC1

T3

T2

T1

T4

T1

T2

T3

DTB

MC3
T4

T1

T2

T3

<1>1

BC1

BC2

~

____ __ __________-+______________J
~

~

BDIR

DO-D15---~

Instruction
address out

Instruction
object code in

Figure 2-4. CP1600 Instruction Fetch Timing

2-9

T4

INSTRUCTION FETCH

,

BAR
MCl

I

I

MEMORY READ

NACT
MC
I

I

DTB
M~

I

I

I

Tl: T2 :T3:-T4 Tl: T2 :T3: T4 T1\ T21T3
I

I

I

Instruction
address out

I

I

I

"

BAR
MCl

NACT

lT4 Tl\ T2: T3; T4 Tl,:T21:T31'T4

I

I

I

I

I

I

Instruction
object code in

I

I

I

I

NACT
MC2
I

DTB
MC3

I

I

I

I

I

I

I

I
I
I
I I
I
Tli T2, T3, T4 Tl'T2, T3 ,T4
,

'"

Data address out

Data in

Figure 2-5. CP 1600 Timing for Memory Read I nstruction with Implied Memory Addressing

CP1600 INSTRUCTION TIMING AND EXECUTION
CP1600 instructions are executed as a sequence of machine cycles. Each machine cycle has four clock periods,
as illustrated in Figure 2-3. Machine cycles are identified by their cycle number and by the levels of the BC1. BC2.
and BDIR signals. Each of the eight level combinations is given a name. taken from Table 2-1. This name becomes the
name of the machine cycle. Thus in Figure 2-4. and in subsequent instruction timing illustrations. each machine cycle is identified by a signal name from Table 2-1.
Figure 2-3 shows general case timing for data output or input on the Data/Address Bus. In between data input or output operations the bus is floated.

CP1600 MEMORY ACCESS TIMING
Figure 2-4 illustrates instruction fetch timing for a CP1600 instruction's execution. Three machine cycles are required. During the first mac.hine cycle an address is output. Nothing happens during the second machine cycle: it is a
"time spacing" machine cycle that routinely separates two CP1600 Bus access machine cycles. The object code for the
accessed instruction is returned during the third machine cycle.
Figure 2-5 illustrates timing for the simplest memory read instruction's execution. In this .case the data memory
address is taken from one of the CPU registers. There is no difference between timing for the three machine cycles of an
instruction fetch or a data memory read. As illustrated in Figure 2-5. a simple memory read instruction's execution
consists of two three-machine cycle memory read operations. separated by a spacing no operation machine cycle.

2-10

MEMORY WRITE

INSTRUCTION FETCH
BAR
MCl

I

I

DTB
MC3

NACT
MC2

,

I

I

I

I,

BAR
MCl

NACT

I

I

1

I

I

I.

NACT
MC2
I

I

DWS
MC4

DW
MC3
I

I

I

I

I

I

I

I
.,
I
I
I
"
I
I
I
I
,I I I ,I
I I
I
Tl :T2:T3:T4 Tli T2,T3.T4 Tl, T2, T3. T4 Tl, T2, T3,T4 Tl,T21 T3 1T4 Tl, T2, T3, T4 Tl, T2. T3, T4 Tl, T21 T3.T4
,
,.
I
I
I
I
I
'I
•
I
I'
I I
I
I
I
I

Data out

Data address out

Instruction
object code in

Instruction
address out

Figure 2-6. CP1600 Timing for Memory Write Instruction with Implied Memory Addressing

Figure 2-6 illustrates timing for a simple CP1600 memory write instruction execution. Data is output for two
machine cycles. giving external logic ample time to respond to the data output. External logic uses the DWS machine
cycle as a write strobe.
Any memory reference instruction that specifies direct memory addressing will require one three-clock-period machine
cycle to fetch each word of the instruction object code: an NACT clock period will separate each machine cycle. After
the first instruction fetch machine cycle. an ADAR-NACT clock period combination will be inserted in the second (and
third. if present) instruction fetch machine cycle. During an ADAR clock period. BC1 is high. while BC2 and BDIR are
low. No other control signals are active. Thus. for a two-word memory read or memory write instruction that
specifies direct addressing, the following clock periods and machine cycles will be required for instruction execution:
Direct Addressing
Memory Read
Machine Cycles

Direct Addressing
Memory Write
Machine Cycle

BAR }
Fetch first instruction
{ BAR
NACT "~-------object code word ------t.~ NACT
DTB
DTB
~NACT
NACT ..4.-----Spacing machine c y c l e - - - - - -...

~~~~}

NACT
DTB

instruction------t.~{ ~~~~

..'4.----Fetch second
object code word

NACT .......- - - - - Spacing machine
BAR }
Memory read
NACT .....---machine cycle
DTB

cycle------.~

NACT
DTB

NACT

Memory write
{ BAR
machine cycle---__
.~ NACT
DW
DWS

2-11

BAR

NACT

NACT

<1>2

BC1

-----------------+------------

BC2

BOIR

BOROY

Figure 2-7. CP1600 Wait State Timing

THE CP1600 WAIT STATE
The CP1600 has a Wait state equivalent to those described for other microcomputers in this book. External logic that
requires more time to respond to an access must input BDRDY low before the end of the BAR machine cycle. during
which an address is output and the device is selected. Timing is illustrated in Figure 2-7.
If you examine Figures 2-4, 2-5 and 2-6. you will see that an address is output during a BAR machine cycle to initiate any external device access. The BAR machine cycle is always followed by an NACT machine cycle; in the middle of
T1 during this NACT machine cycle, the CP1600 samples BDRDY. If ~ is low. then a sequence of NACT machine
cycles occurs. In the middle of T4 for every NACT machine cycle, the CP1600 samples BDRDY again. Upon detecting
BDRDY high, the CP1600 resumes instruction execution with a DTB machine cycle.

A Wait state must last for less than 40 microseconds, since the CP1600 is a dynamic device.

THE CP1600 HALT STATE
The CP1600 has a Halt state which may follow execution of the Halt instruction, or may be initiated by external
logic.
When the Halt instruction is executed. then. following the instruction fetch machine cycle, the HALT signal is output
high and a sequence of NACT machine cycles is executed.
External logic initiates a Halt state by making the STPST input undergo a high-to-Iow transition. Following execution of
the next interruptable instruction. a Halt state begins. The HALT signal is output high and a sequence of NACT
machine cycles is executed.
A Halt state, whether it is initiated by execution of a Halt instruction or by a high-to-Iow transition of STPST. must be
terminated by a high-to-Iow transition of STPST. This will cause the Halt state to end at the conclusion of the next
NACT machine cycle. Timing for a Halt state which is initiated and terminated by STPST may be illustrated as follows:

STPST{L-_ _l
HALT

~

~~-------------------------------------------~~--------

Next interruptable
instruction's /
execution
ends here

~ \.

y

)

1
\

HALT STATE

2-12

Next NACT machine
cycle ends here

ThePerFsignal as an input inhibits CP1600 Program Counter increment logic. Thus. external
logic can input PCIT low - in which case the same instruction will be continuously re-executed
until PC IT goes high again. However. PCIT should only change levels while the CPU has been
halted. Thus. PCIT and STPST should be used together as follows:

CP1600
PCIT
SIGNAL

PCIT REQUEST

STPST

PCIT

CP1600 INITIALIZATION SEQUENCE
The CP1600 is initialized by inputting the MSYNC signal low for a minimum of 10 milliseconds after power is
first applied to the CPU. '
MSYNC must make a low-to-high transition. marking the end of the initialization. on a rising edge of the «1>1 clock signal. On the next rising edge of «1>1. instruction execution will begin. This may be illustrated as follows:

I

I

Ii:

I T1 : T2 I T3 I T4 I

<1>,

MSYNC

When instruction execution begins. interrupts are disabled. The following sequence of machine cycles is executed:
NACT

lAB -4--- Read Datal Address Bus and load into Program Counter
NACT
NACT
NACT

BAR-4-- Output Program Counter contents to fetch first instruction
NACT
DTB

etc

During the lAB machine cycle. external logic must supply a 16-bit address at DO - 015. Your external logic must provide this address. which in the simplest case may be 0000 by grounding the bus. or FFFF16 by tying it to +5V following
a startup.
The address which is input at lAB is output at BAR. initiating program execution.

CP1600 DMA LOGIC
CP1600 DMA logic is quite standard. When external logic wishes to transfer data under DMA control, it inputs
BUSRQ low. At the conclusion of the next interruptable instruction's execution, the CPU floats the
Data/Address Bus and enters a Wait state, during which a sequence of NACT machine cycles is executed.
BUSAK is output low at the beginning of the first NACT machine cycle.
The NACT machine cycles that occur during a DMA operation refresh the CPU. NACT machine cycles that occur
during a'Wait state do not refresh the CPU. This means that any number of NACTmachine cycles can occur during a
DMA break. while a Wait state must be shorter than 40 microseconds.
The DMA break ends when external logic inputs BUSRO high again. BUSRO is sampled during T1 of every DMA NACT
machine cycle. When BUSRO is sampled high. two additional NACT machine cycles are executed. then BUSAK is output high and normal program execution resumes.

DMA timing is illustrated in Figure 2-8.

2-13

Last machine cycle
of an interruptable
instruction's
execution

I

I

I

I T4
I

T11
I

NACT

NACT
n

I

I

I T2 I T3 I T4
,I
I

NACT

I
n I

I

T3 I T4

I

I

I

I

I

I

I

NACT
I

I

T11 T2 I T3 I T4

I

1

n

I

I

I

T2 I T3

I

I

BAR
I

I T4
1

BC 1,BC2,BOIR

-------------i~~~~----------~~------~~~~------------~--BUSRQ

BUSAK

Figure 2-8. CP1600 DMA Timing

INTAK

I
I

ow

NACT

I

I
I

I

I
I

I
I

I
I

I

I

OWS

I

'I
I
I.

I

NACT
I
I

I
"

I

NACT X 4

lAB
I

I

I

I

I
I

I
I

I

I

I

I

BAR

T1, T2: T31 T4 T11 T2 I T31T4 nIT2 I T31T4 TlI T2 JT3 1T4 T11 T21 T31T4 TlI T21 T31T4 T11 T2 I T4
1 I
I
I
I
I
1 I
I
I
I
I
I
I
I
I
I
1
I
<1>1

<1>2

\

BC1)

BC2

J

\
\

BOIR}

~~--a

\

I

t

Output
Stack
Pointer

\

I

,

I

0

t

Current Program
Counter contents
written to memory
stack

II

External
logic inputs
starting
address
for interrupt
service routine

Figure 2-9. CP1600 Interrupt Service Routine Initialization

2-14

Start executing
interrupt
service routine

INSTRUCTION EXECUTE/FETCH

INSTRUCTION FETCH
BAR
MCl

DTB
MC3

NACT
MC2

,

I

I

"

I

I'

I

I

I

I

I

I

t

NACT
MC2

BAR
MCl

NACT
I

I

I

I

I

DTB
MC3

I

I

I

I

I

I

I

Tl :T2: T31T4 Tll T2: T3:T4 T11 T21 T3:T4
Tl:T2:T3:T4 T1:T2:T3:T4 Tll, T2 ~I T3:T4 Tl:I T2 lT3 ;T4
I
I
I
I
I
I
I

Instruction
address out

I

I

I

I

Next instruction
address out

TCI instruction
object code in

Next instruction
object code in

Figure 2-10. CP1600Timing for TCllnstruction's Execution

THE CP1600 INTERRUPT LOGIC
The CP1600 uses a vectored interrupt processing system.
External logic requests an interrupt by inputting a low signal at either the INTR or INTRM pins.
Following the execution of the next interruptable instruction. the CP1600 acknowledges the interrupt by pushing
Register R7 contents (the Program Counter) onto the Stack; then the CP1600 outputs 111. followed by 010 at BC1.
BC2. and BOIR. External logic must respond by placing 16 bits of data on the Data/Address Bus. These 16 bits of data
will be loaded into Register R7. the Program Counter. thus causing program execution to branch to an interrupt service
routine dedicated to the interrupt. Timing is illustrated in Figure 2-9.
The PCIT signal is output low following execution of a software interrupt instruction (SIN). This is the only microcomputer described in this book which allows external logic to respond to a software interrupt in this fashion. Allowing external logic to respond to a software interrupt only makes sense when you anticipate your product being used in a
minicomputer-like environment. Typically. the software interrupt will interface to logic of a front panel or console.
When an SIN instruction is executed. a one-machine cycle low PC IT pulse is output.
You may. if you wish. end an interrupt service routine by executing a Terminate Current Interrupt (TCI) instruction. in
which case the TCI signal will be output high.

Timing for TCI is given in Figure 2-10.
Following an interrupt acknowledge. the interrupt service routine must execute instructions in order to disable interrupts and save the contents of registers on the Stack. The exception is Register R7. the Program Counter. which is automatically pushed onto the Stack following an interrupt acknowledge.
External logic is entirely responsible for any type of interrupt priority arbitration which may occur. and for the generation of the interrupt vector address which must be input following an interrupt acknowledge.

2-15

It is quite easy to generate signals equ iva lent to other microcomputer system busses from the CP1600 System Bus.
Therefore, you can use parts described in Volume 3 to handle CP1600 interrupt requirements.

THE CP1600 INSTRUCTION SET
The CP1600 instruction set is relatively straightforward. Addressing modes, which we have already described, are simple, and instructions are typical of those we have seen and described for other microcomputers. Unusual features relating to addressing modes available with individual instructions are summarized in Table 2-2, which describes the
CP1600 instruction set.

If you have never programmed a PDP-11 minicomputer, then you should pay particular attention to programming techniques that result from the Stack Pointer and Program Counter being accessed as general purpose
registers.
A wide variety of Register Operate instructions allow you to compute data and load the result directly into Register R7,
the Program Counter. In effect these become computed Jump instructions.
The ability to manipulate Register R6, the Stack Pointer, as though it were a general purpose register means that it is
easy to maintain a number of different Stacks in external read/write memory.
The Jump-to-Subroutine instruction has a minicomputer flavor to it. Rather than saving the return address on the
Stack, Register R7 contents are moved to General Purpose Register R4 or R5. A number of minicomputers will save a
subroutine return address in a general purpose register in this fashion. The problem with this logic is that you must execute an additional instruction within the subroutine to save the return address on the Stack if you are going to use
nesting subroutines. If you are passing subroutine parameters, however, this is an excellent arrangement for the Jumpto-Subroutine instruction places the address of the parameter list directly in a Data Counter with auto-increment. We
have described the concept of parameter passing in Volume 1, Chapter 7.
Note that the CP 1600 instruction set lacks a logical OR.
In Tables 2-2 and 2-4, instruction length is given in terms of "words" rather than "bytes", as we have done in previous chapters. Since only the lower 10 bits of the CP1600 object code are presently used, system configurations need
not have the full 16-bit word size. Hence a "word" may be 10 to 16 bits wide, depending on the implementation.
The following notation is used in Table 2-2:
ADDR
One word of direct address
condCondition on which a branch may be taken. Table 1-3 lists all 14 branch conditions.
One word of immediate data.
DATA
DISP
One word displacement. See Table 2-4 for location of sign bit.
External branch condition.
E
EBCAO-3
The external branch condition address lines: EBCAO, EBCA 1, EBCA2, and EBCA3.
EBCI
The external branch condition input line.
LABEL
A 16-bit direct address, target of a Jump instruction. See Table 2-4 for the bit format.
PC IT
The software interrupt output line.
RB
General Purpose Register R4, R5, or R6.
RD
One of the general purpose registers, used as a destination for operation results.
RM
One of the general purpose registers used as a Data Counter, R4 or R5, if specified, is auto-incremented
after the memory access. R6 is incremented after a write, and decremented before a read.
RR
General Purpose Register RO, R1, R2, or R3.
RS
One of the general purpose registers, used as the source of an operand.
Statuses:
S the Sign status
C the Carry status
Z the Zero status
o the Overflow status
The following symbols are used in the STATUSES column:
X the status flag is affected by the operation
a blank means the status flag is not affected
the operation clears the status flag
1 the operation sets the flag
2 the Overflow flag is affected only on 2-bit shifts or rotates

°

2-16

SW

The Status Word. whose bits correspond to the condition of the status flags in the following way:
3 2 1 0 ....

IsI z laic I

Bit No

Status Word

When the status word is copied into a register. it goes to the upper half of each byte:

[SW]

When the status word is loaded from a register. it comes from the upper half of the lower byte:

~11-5----------------8·1-7--~::::rr~-4~3------~ol ~~3~~---o~1
[RS]

x
(.2)

[SW]

Bits y through z of the Register x. For example. R7 < 15.8 > represents the upper byte of the Program
Counter
Indicates that the operand ".2" is optional

[[ ]]

A low pulse
Contents of location enclosed within brackets. If a register designation is enclosed within the brackets.
then the designated register's contents are specified. If a memory address is enclosed within the brackets.
then the contents of the addressed memory location are specified.
Implied memory addressing: the contents of the memory location designated by the contents of a register.

A

Logical AND

-¥±

Logical Exclusive-OR

[ ]

Addition or subtraction of a displacement. depending on the sign bit in the object code.
Data is transferred in the direction of the arrow.

2-17

Table 2-2. CP1600 Instruction Set Summary
sTAtuses
WORDS

MVI

ADDR,RD

2

MVI@

RM,RD

1

[RD]-[ADDR]
Load register from memory, using direct addressing.
[RD]-[[RM))

~~ffi

MVO

RS,ADDR

2

Load register from memory, using implied addressing.
[ADDR]-[RS]

a::Za::

MVO@

RSJIM

1

O~II.I

MNEMONIC

S Z

C

0

::::0(,)
>~z

~Q~

ILc(

~
....

co

OPERATION PE~FORMED

OPERAND(S)

TYPE

Store register to memory, using direct addressing.
[[RM))-[RS]
Stbre register to memory, using implied addressing. If RS=R4, R5, R6 or R7, then RS=RM Is not
supported.

2

X X

X

X

[RD]-[RD)+ [ADDR]

RM,Rt)

1

X X

X

X

Add memory contents to register, using direct addressing.
[RD]-[RD]+ [[RM))

SUB

ADDR,RD

2

X X

X

X

SUB@

RM,RD

1

X X

X

X

Add memory contents to register, using implied addressing.
[RD]-[RD] - [ADDR]
Subtract memory tontents from registEir, using direct addressing.
[RD]-[RD] - [[RM]]

CMP

ADDR,RS

2

X X

X

X

Subtract memory contents from register, using implied addressing.
[RS] - [ADDR]

CMP@

RM,RS

1

X X

X

X

>

AND

ADDR,RO

2

X X

Compare memory contents with registers, u$ing direct addressing. Only the status flags are
affected.
[RS] - [(RM))
Compare memory contents with register's, using implied addressing. Only the status flags are
affected.
[RD]-[RD] A [AOOR]

Q

AND@

RM;RD

1

X X

AND memory contents with those of register, using direct addressing.
tRD]-[RD) A [[RM))

XOR

ADDR,RD

2

X X

AND memory contents with those of register, using implied addressing.
[RD]-[RD]-¥- [ADDR]

XOR@

RM,RD

1

X X

Exclusive-OR memory contents with those of register, using direct addressing.
[RD]-[ RO].y. [[ RM))

ADD

ADDR,RD

11.1
(,)

ADD@

11.1

Z
11.1
a::
u.

11.1

a::

>
a::

0
~

11.1

:E
Q
Z

c(

g
II!
c(

z

0

(,)

w

en

Exclusive-OR memory contents with those of register, using implied addressing.

Table 2-2. CP1600 Instruction Set Summary (Continued)
STATUSES

S Z C

OPERATION PERFORMED

TYPE

MNEMONIC

OPERAND(S)

WORDS

w

MVII

DATA,RD

2

[RD]~DATA

MVOI

RS,DATA

2

Load immediate to specified register.
[[R7] + l1~[AS]

~

0

0(

Q
w

~

Store contents of specified register in immediate field of MVOI instruction, This is only possible if
program memory is reed/write memory (rather than ROM).

~

ADDI

w

DATA,RD

2

X X

X

X

[RD]~[RD]

~

a:
w

SUBI

DATA,RD

2

X X

X

X

CMPI

DATA,RS

2

X X

X

X

Subtract immediate data froni specified register.
[RD]-DATA

ANDI

DATA,RD

2

X X

[RD]~[RD] A DATA

XORI

DATA,RD

2

X X

[RD]~[RDl¥DATA

A.

0

w

~

Compare immediate data with contents of specified register. Only the status flags are affected.

0(

t;-J

is

CD

~

!

+ DATA

Add immediate to specified register.
[RD]~[RD] - DATA

0(

I

w

~

AND immediate data with contents of specified register.

I

Exclusive-OR immediate data wit., contents of specified register.
J

LABEL

3

A.

JR

AS

1

...,

JSR

RB,LABEL

3

[RB]~[R7l; [R7]~LABEL

B

DISP

2

[R71~[R7] + 2±DISP

Bcond

DISP

BEXT

DISP,E

[R7]~LABEL

Jump to given address.

:i!

X X

I

[R7]~[RS]

Jump to address contained in specified register.

:;)

Jump to given address, saving Program Counter in A4, R5, or AS.
Branch relative to Program Counter contents.

z Z

o

2

If cond is true, [A7]~[ A71 + 2±DISP

2

Branch relative on given condition; otherwise, execute next sequential instruction.
EBCAO-3 ~E;

0

~ E
Z Q
0( Z

a: 0

III 0

If EBCI=l, [R7]~[R7]+2±DISP
Branch relative if external condition is true.

I

Table 2-2. CP1600 Instruction Set Summary (Continued)
STATUSES
TYPE

MNEMONIC

OPERAND(S)

WORDS

S Z

C

MOVR

RS,RD

1

X x

a:'"
",'"
... C
en a:

ADDR

RS,RD

1

XX X

X

c,,1L

SUBR

RS,RD

1

X

X

X

X

CMPR

RS,RD

1

X X

X

X

ANDR

RS,RD

1

X X

XORR

RS,RD

1

X X

-'"

"'0

lIFe
a:Z

~C
!!~

&!o
a::I

OPERATION PERFORMED

0
[RD]-[RS]

Move contents of source register to destination register.
[RD]-[RS]+ [RD]
Add contents of specified registers.
[RD]-[ RD] - [RS]
Subtract contents of source register from those of destination register.
[RD]- [RS]
Compera registera' contents. Only the status flags ara affected.
[RD]-[RD] A [RS]
AND contents of specified registers.
[RD]-[RD].y.[RS]
Exclu,ive-OR contents of specified registera.

II-)

N
o

CLRR

RD

1

0

1

[RD]-[RD] V [RD]

TSTR

RS

1

X

X

Clear specified register.
[RS]-[RS]

INCR

RD

1

X X

DECR

RD

1

X X

Test contents of specified register.
[RD]-[RD]+l
Incremant contents of specified register.
[RD]-[RD] - 1

a:

COMR

RD

1

X X

Decrement contants of specified ragister.
[RD]-[RD]

C;
a:

NEGR

RD

1

X X

X

X

ADCR

RD

1

X X

X

X

SLL

RR(.2)

1

X X

'"~
'"0

IL

'"en...
'"

Complement contents of specified ragister (ones complement).
[RD]-[RD] + 1
Nagate contents of specified register (twOI complement).
[RD]-[RD]+ [e)
Add Carry bit to lpecified regilter contentl.

115 + - - 01+-0
[RR]
Shift logical left one or two bitl, clearing bit 0 (and bit 1 if Ihifting twice).

Table 2-2. CP1600 Instruction Set Summary (Continued)
STATUSES
TYPE

MNEMONIC

OPERAND lSi

WORDS

RLC

RRI.2)

1

S Z

C

0

x

X

2

X

OPERATION PERFORMED

L(D:(@]H15 -

oiJ

[RR]
Rotate left one bit through Carry, or rotate 2 bits left through Overflow and Carry.

SLLC

RRI.2)

1

X X

X

2

~[[JH15'-

0 .... 0

[RR]

Shift logical left one bit into Carry, clearing bit 0, or shift left two bits into Overflow and Carry,

Q
w

clearing bits 0 and 1.

:;)

N

N
.....

z
i=
z

SLR

RRI.2)

1

x x

~ a'

0 ..... 15

[RR]
Shift logical right.one or two bits, clearing bit 15 (and bit 14 if shifting twice).

0

9
w

~

00(

SAR

RRI.2)

1

a:
w
"0
a:

X X

dj

Shift arithmetic right one or two bits, copying high order bit.

w

~

II)

C;
w
a:

.0'
[RR]

RRC

RRI.2)

1

X X

X

2

4ciirm~15

..

o~

[RR]
Rotate right one bit through Carry, or rotate. two bits right through Overflow and Carry.

SARC

RRI.2)

1

X X

X

2

oK(2]M:D
dE
11,g D.
[RR]

Shift arithmetic 'right one bit into Carry,. or two bits into Overflow and Carry.

SlNAP

RRI.2)

1

X X

[RR]

Swap bytes of register once, or twice.

Table 2-2. CP1600 Instruction Set Summary (Continued)
STATUSES
TYPE

MNEMONIC

:.t

y

c(

I-

m

llL
::I

a:
a:
w

I-

~

':"
N

N

CI)

::I

S Z

C

WORDS

PSHR

RS

1

Separate mnemonics for MVO@ RS,R6.

PULR

RD

1

Separate mne~nics for MVI@R6,RD.

SIN

(2)

1

PCiT'- lS
Software interrupt.
Enable interrupt syetem.
Disable interrupt system.
Terminate current interrupt.
Jump to given address and enable interrupt system.
Jump to given address and disable interrupt system.
Jump to given address, saving Program Counter in R4, R5 or R6, and enable interrupt system.
Jump to given address, saving Program Counter in R4, R5 or R6, and disable interrupt system.

1
1

EIS
DIS
TCI

1

JE
JD

LABEL
LABEL

3
3

JSRE
JSRD

RB,LABEL
RB,LABEL

3
3

GSWD

RD

1

RSWD

RS

1

X X

X

I-

m

X

[RD<15,12»-[SW); [RD<7.4»-[SW)
Place Status Word in upper half of each byte of the specified register. RD may be RO, Rl, R2 or
R3.
[SW]-[RS<7,4»

CLRC

1

0

Load Status Word from bits 7 through 4 of the specified register.
[C)-O

SETC

1

1

Clear Carry.
[C)-I

NOPP
NOP
HLT
SDBD

2
1
1
1

c(

I-

OPERATION PERFORMED

0

OPERAND IS)

Set Carry.
(2)

No Operation.
Halt after executing next instruction.
Set double byte data mode for next instruction, which must be of one of the following types;
Primary or sacondary I/O or memory reference
Immediate or immediate operate
If implied addressing through R I, R2, or R3 is used, the same byte will be accessad twice; addressing through R4, R5, or R7 will give bytes from the addressed location and that addressed after
auto-increment. Direct addressing and Stack addressing are not allowed in double byte mode.

Table 2-3. CP1600 Branch Conditions and Corresponding Codes

MNEMONIC
C
LGT

BRANCH CONDITION

OBJECT CODE
DESIGNATION

C= 1
Carry
(logical greater than)
c=o
No Carry
(logical less than)

0001

OV

0= 1

0010

NOV

0=0

PI..

s=o
Plus
5 = 1

NC
liT

1001

Overflow

1010

No overflow

MI

0011
1011

Minus

ZE

EO
NZE
NEQ
LT

GE

LE
GT

USC

ESC

Z = 1
Zero (equal)
Z =0
Nonzero (not equal)
5VO=1
Less than
5 .... 0=0
Greater than or equal
ZV(5 .... 0) = 1
Less than or equal
ZV(5 .... 0) =0
Greater than
C.... S = 1
Unequal sign and cany
C .... 5 =0
Equal sign and cany

0100
1100
0101
1101
0110
1110
0111
1111

The following notation is used in Table 2-4:
Where ten digits are shown. they are the ten low-order bits of a 10 to 16-bit word. (Word size depends on the system
implementation.) Where four digits are shown. they represent the hexadecimal notation for an entire word (10 to 16
bits).
bb

Two bits indicating one of the first three general purpose registers:
00 = RO
01 = R1
10 = R2

cccc
ddd

Four bits giving the branch condition. as shown in Table 2-3.
Three bits indicating a destination register. RD:
000 = RO
001 = R1
010 = R2
011 = R3
100 = R4
101 = R5
110 = R6
111 = R7
Four bits giving the external branch condition. E. Control signals EBCAO-EBCA3 reflect the state of these four
bits.
One word of immediate data (10 or 16 bits)

eeee
1111

2-23

mmm

Three bits indicating a Data Counter Register RM:
000 = RO
001 = Rl
010 = R2
all = R3
100 = R4
101 = R5
110 = R6
111 = R7

m

One bit indicating the number of rotates or shifts:
one bit position
1 two bit positions

p

One bit of immediate address

a

P

One hexadecimal digit (4 bits) of immediate address

rr

Two bits indicating one of the first four general purpose registers:
00 = RO
01 = Rl
10 = R2
11 = R3

sss

Three bits indicating a source register. RS:
000 = RO
001 = Rl
010 = R2
011 = R3
100 = R4
101 = R5
110 = R6
111 = R7

z

Sign of the displacement:
add the displacement to PC contents
1 subtract the displacement from PC contents

a

In the "Machine Cycles" column. when two numbers are given with one slash between them (e.g .. 7/9). execution time
depends on whether or not a branch is taken. When two numbers are given. separated by two slashes (such as 81/11).
execution time depends on which register contains the implied address.

THE BENCHMARK PROGRAM
For the CP1600 our benchmark program may be illustrated as follows:

LOOP

MVII
MVII
MVI@
MVII
MVI@
MVO@
DECR
BNZE
MVO@

IOBUF.R4
TABLE.Rl
Rl.R5
CNT.R2
R4.RO
RO.R5
R2
LOOP
R5.Rl

LOAD THE I/O BUFFER STARTING ADDRESS INTO R4
LOAD THE TABLE STARTING ADDRESS INTO Rl
LOAD ADDRESS OF FIRST FREE TABLE WORD INTO R5
LOAD WORD COUNT INTO R2
LOAD NEXT DATA WORD FROM 10BUF
STORE IN NEXT TABLE WORD
DECREMENT WORD COUNT
RETURN IF NOT END
RETURN ADDRESS OF NEXT FREE TABLE BYTE

This benchmark program makes very few assumptions. The input table IOBUF and the data table TABLE can have any
length. and can reside anywhere in memory. The address of the first free word in TABLE is stored in the first word of the
TABLE.

2-24

Table 2-4. CP1600 Instruction Set Object Codes

INSTRUCTION

OBJECT CODE

WORDS

MACHINE
CYCLES

ADCR RD
ADD ADDR.RD

000010lddd
1011000ddd

1
2

10

ADD@ RM.RD
ADDI DATA.RD

PPPP
1011mmmddd
1011111ddd

1
2

8/ /11
8

MOVR RS.RD
MVI ADDR.RD

PPPP
oo10sssddd
10 1OOOOddd

ADDR RS.RD
AND ADDR.RD

1111
oo11sssddd
lll0000ddd

1
2

6

MVI', RM.RD

10

..

AND@ RM.RD

6

1

ANDI DATARD

1110111ddd

2

ANDR RS.RD
B DISP

1111
0110sssddd
l000z00000

1

6

2

7/9

2

7/9

2

7/9

BEXT DISP.E
CLRC

PPPP
looozOcccc
PPPP
looozleeee
PPPP

CLRR'RD
CMP ADDR.RS

0006
0111dddddd
1101000sss

6
10

CMP@ RM.RS
CMPI DATA.RS

PPPP
1101mmmsss
1101111sss

1
2

8//11
8

CMPR RS.RD
COMR RD

1111
0101sssddd
00000llddd

1
1

DECR RD

00000IOddd

1

6
6
6

0003
0002
0000lloorr

1
1

INCR RD
J LABEL

0004

MVOI RS.DATA
NEGR RD
NOP (2)
NOPP

4

0000
000000lddd

MVO RS.ADDR
MVO@ RS.RM

1

GSWD RR
HLT

MVII DATA.RD

8/ /11
8

1
2

DIS
EIS

JSRE RB.LABEL

pppp
IllOmmmddd

Beond DISP

INSTRUCTION

1
1

PSHR RS
PULR RD
RLC RRI.2)
RRC RRI.2)
RSWD RS
SAR RRI.2)
SARC RRI.2)
SDBD
SETC
SIN (2)

4

SLL RRI.2)
SLLC RRI.2)

4

SLR RRI.2)

6

JD LABEL

0004

JE LABEL

0004
PPPP

JR RS
JSR RB.LABEL

1

0004
bbppppppOO

3

7
12

3

12

PPPP
JSRD RB.LABEL

0004
bbppppppl0
PPPP

2-25

8/ /11

2

8

2

11

1
2

9
9

1111
loolooosss
PPPP
lOOlmmmsss
lOO1111sss
1111
0000 1OOddd
000011010m
l000z0 1000
PPPP
loolllOsss
1010110ddd
0001 0 IOmrr
ooo1110mrr
0000111sss
ooo1101mrr
ooo1111mrr
0001
0007
000011011m
0001 00 1mrr

1

6

1

6

2

7

1

9
11

1
1
1
1
1
1
1
1
1

6/8
6/8

6
6/8.
6/8
4

4
6

1

8/ /11

lloolllddd
1111
0100sssddd

2

8

1

6

ooolOOOnrr

1
1

6/8

1

6//7
10

0005
00 1Ossssss
llll000ddd
PPPP
llllmmmddd

2

XORI DATA.RD

l111111ddd

2

8/ /11
8

XORR RSiRD

1111
0111sssddd

1

6

XOR@ RM.RD

oo10sss111

1

1010111ddd

PPPP
lloommmddd

XOR ADDR.RD

l1ppppppOl

PPPP
1010mmmddd

6/8
10

SUBR RS.RD
SWAP RRI.2)
TCI
TSTR RS

12

6/ /7
10

1

SUBT DATA.RD

3

1
2

2

SUB@ RM.RD

PPPP

12

ooollOOmrr
l100000ddd

6

12

3

SUB ADDR.RD

12

3

0004
bbppppppOl

ooo1011mrr

1

l1ppppppl0

MACHINE
CYCLES

6/8
6/8

3

PPPP

WORDS

1
1

4

llppppppOO

OBJECT CODE

1

4

8080A

CP1600
System Bus
Signals

DO

015

System Bus
Signals

-· ---

..

..-

-

-.

···
··· ..
-· -

...-

4

MUX

--

-

.-..

Latched
Address
Buffer

Latched
Data
Buffer

- --

4
BAR

.~

.
~

-==
--

OTB

.,...
..,

OWS

......
....,

.

----

BC1

-

BC2

-..

BOIR

lAB

1 of 8 Decoder

-

INTAK

"""

AOAR
ON
NACT

INTR
INTRM

--

--

-

;;t
-

40

-

~

STSTP

,....

L?r
---'

4

TCI
EBCAO

EBCI

...
Figure 2-11. CP1600 to 8080A Bus Conversion

2-26

A15

DO

07

!

High-order
Low-order

07

byte

-INT

..

-

.--

INT

BUSEN
HOLD

-

ROYIN

-..

byte

DO

.-.-

-----------------------------------------------------------------~~--------...

HALT

EBCA3

--

: ::

,....

BUSRQ

MSYNC

..
:=

AO

WAIT
RESET

SUPPORT DEVICES THAT MAY BE USED WITH THE CP1600
A CP1600 microcomputer system with any significant capabilities will use support devices of some other
microprocessor. Parallel 110 capability is available with the CP1680, (described next!. but priority interrupt logic, DMA
logic, and serial I/O logic, to mention just a few common options, may need additional support devices. Fortunately, it
is quite easy to generate an 8080A-compatible system bus from the CP1600 system bus. Logic is illustrated in
Figure 2-11.
The CP1600A is the fastest version of the CP1600 CPU; it runs with a 500 nanosecond machine cycle. The CP1600
machine cycle is equivalent to an 8080A clock period. Since the standard 8080A clock period is also 500 nanoseconds,
no speed conflicts will arise.
The bus-to-bus interface logic illustrated in Figure 2 -11 is self-evident with the exception of bus demultiplexing logic.
The CP1600 Data/Address Bus is shown buffered by a demultiplexing buffer that is connected to two latched buffers.
One of the latched buffers accepts the demultiplexer outputs only when a valid address is being output as identified by
BAR high. The second latched buffer may be a bidirectional latched buffer. or it may be two unidirectional latched
buffers. Three latching strobes are required: DTS, lAB, and DWS.
DTB and lAB are data input strobes. DTB strobes data input that is to be interpreted as data, while lAB stroves data input that is to be interpreted as an address. So far as external logic is concerned, both of these signals are simple data input strobes. We could therefor~ generate a single data input strobe as the OR of DTB and lAB. When this data input
strobe is high, information on the 8080A System Bus side of the latched data buffer must be input to the buffer; this
data must simultaneously be transmitted to the multiplexer.
DWS is the data output strobe. When high, this signal must strobe data from the multiplexer to the latched data buffer;
this latched data must immediately appear at the 8080A System Bus side of the latched data buffer.
Since the CP1600 uses a 16-bit Data Bus, you will probably have to generate two external device data busses; a highorder byte bus and a low-order byte bus. All external devices that transmit or receive parallel data must be present in
duplicate. For example, were 8255 parallel interface devices to be present the following connections would be required:

.-

---:
-=
-=
--

DO

PB high

PC high

--- -

- ..-- -

07
08

I~

~

015

•

AO

A1
A2

-

I,
60

-- ..
-- --

-. AD
·.....
·.--..
-:..
·.--

h

-

PA high

WR

..

Device
Select
Logic

I'

,.. ,

07

WR
8255
PPI

-

t

RD
AO
A1

CE

DO

--

..-

--

-

-

----

-

2-27

WR

1m
AO
A1

CE

8255
PPI

A15

07

-- .-

-- -....
-- ..--

-

--- -..

PA low

PBlow

PC low

The CP1600 and MC6800 system busses are singularly incompatible. You should not attempt to use MC6800 support
devices with the CP1600.

ro
IMSKO
00
01
02
03
04
05
06
07

CKi
PCLR
PDO
PD1
P02
P03
P04
PD5
PD6
PD7

1
2
3
4
5
6
7

40
39
38
37
36
35
34

8
9
10
11
12
13
14
15
16
17
18
19
20

33
32
31
30
29
28
27
26
25
24

CP1680
lOB

INTRQ
IMSKI
BC1
BC2
BOIR

CE
ERROR
VCC
GNO
VOD
PE
AR
PD15
PD14
PD13
P012
PD11
PD10
PD9
PD8

23
22
21

Pin Name

Description

Type

DO - 07
PDO - P015
BOlA. BC 1, BC2
CK1

CPU Data/Address Bus
Peripheral I/O Port
Bus Control signals
Clock signal
Chip Enable
I/O handshake control
I/O handshake control
Interrupt request
Terminate current interrupt
Daisy chain priority
Daisy chain priority
Error interrupt request
Reset
Power, Ground

Bidirectional, tristate
Bidirectional
Input
Input
Input
Output
Input
Output
Input
Input
Output
Input
Input

"IT
PE
AR
INTRQ
Tel
IMSKI
IMSKO
ERROR
PCLR
VCC, VDO' GND

Figure 2-12. CP1680 lOB Signals and Pin Assignments

2-28

=rt-01~~1

, I II I - . ,

..J

.. DATA READ

,

:~~S

EBCI~

.~DO

EBCAO....-EBCA 1""4--EBCA2........EBCA3........PCIT ..........
BDRDY~
STPST~

N
I

N

co

BUSRO----.,
BUSAK""4--HALT........INTRM~

.,

T

,

T

•

••

D7

"D8
I

.1 1

11

liT

••

11

liT,

11

liT

:~~~

1:.,dIII II III .!lIfh II III .!lIftT II III~ic
[
o~I•• "I
~

DEVICE
SELECT

]

uw

CKI

Ta--

IINTR:

B&!~~
Bel
PCLR

PC 1680

-

lOB

-

IMSKI

IMSKO

t·; ii +
o

LO

0..

~

o

Figure 2-13. A CP1600-CP1680 Microcomputer Configuration

~

a:a:w
04:0..
a:

ffi

--

THE CP1680 INPUT/OUTPUT BUFFER (lOB)
The CP1680 lOB is a parallel I/O device designed specifically for the CP1600 CPU. This device provides a single
16-bit parallel I/O port, which may optionally be configured as two 8-bit I/O ports. Primitive handshaking control
signals are available with the parallel I/O logic. Elementary interval timer and prioritized interrupt logic is also
provided.
Figure 2-1 also illustrates that part of our general microcomputer system logic which has been implemented on
the CP1680 lOB.
The CP1600 lOB is packaged as a 40-pin DIP. It requires two power supplies. +5V and +12V. All inputs are TTL compatible. The device is implemented using N-channel MOS technology.
Figure 2-13 illustrates a CP1600 microcomputer system with three CP1680 lOB devices in the configuration.

CP1680 lOB PINS AND SIGNALS
The CP1680 lOB pins and signals are illustrated in Figure 2-12. We will summarize these signals and the functions they serve before examining device operations in detail.
Let us begin by looking at the interface between the CP1680 lOB and the CP1600 CPU.
DO - 07 provide an 8-bitparallel Data/Address Bus via which all communications between the CPU and lOB occur. This bus must connect to the low-order eight bits of the 16-bit CPU Datal Address Bus.
The three bus control signals, BC1, BC2, and BDIR, connect the CP1680 to the CP1600 as illustrated in Figure
2-13. The CP1680 lOB decodes these three bus control signals internally.
A clock input is required by the CP1680. This clock input (CK1) is used by internal logic to determine when BC1,
BC2, and BDIR are valid. CK1 must have the following wave form:

,

I

I

I'

T1 I T2 I T3 I T4
I
I'

T1

I

I T2 I T3 I T4
I
I
I

CK 1 must be derived from the CP1600 clock signals by external logic.
Let us now look at the interface between external logic and the CP1680 lOB.
POO - PD15 provide a 16-bit parallel I/O port which can optionally be configured as
CP1600 I/O
two 8-bit I/O ports. While POO - P015 are in theory bidirectional. these pins are more acPORT PIN
curately described as pseudo-bidirectional. This is because when a zero has been written
CHARACTERISTICS
to one of these pins. the output can sink 1.6 mA for an output voltage of +O.5V. External
logic will have a hard time overcoming this sink in order to pull the pin high. In contrast. when a 1 is written to one of
these pins. the output sources just 1OOJ.J.A at +5V. External logic will have little problem sinking 100J.J.A in order to pull
a pin low. Therefore. you should output a 1 to any pin that is subsequently to receive input data. External logic will then
leave the pin high when inputting 1. while pulling the pin low to input O.
The handshaking control signals which link the CP1680 lOB with external logic are PE and AR. PE is a control signal
which is output by the CP1680. and AR is a control signal which is input to the CP1680.
Now consider CP1680 interrupt signals.
An interrupt request is transmitted to the CP1600 CPU via INTRQ. The CPU acknowledges the interrupt via the
INTAK combination of BOIR, BC1, and BC2. TCI must be output low by the CPU at the end of the interrupt service routine. This signal is required by CP1680 interrupt logic. which uses the low TCI pulse in its priority arbitration.
as described later in this chapter.

2-30

Interrupts may be generated by conditions internal to the CP 1680. or by a low input at ERROR. The ERROR input is
reserved for error conditions detected by external logic.
IMSKI and IMSKO are interrupt priority input and interrupt priority output signals, respectively. These signals are
used to generate daisy chain interrupt priorities between CP1680 lOB devices. as illustrated in Figure 2 -13. We will
describe CP1680 interrupt priorities in more detail later in this chapter.

'MCLR is the master reset control input for the CP1680. This Signal

must be input low for at least 10 milliseconds in

order to reset the CP1680 lOB.

CP1680 ADDRESSABLE REGISTERS
The CP1680 has eight addressable locations, which may be illustrated as follows:

Control

Data. low

PDO - PD15

Data. high

DO - 07

Timer. low

Timer, high

I/O interrupt
vector
Timer interrupt
vector
Error interrupt
vector

These eight addressable locations are all 8-bit registers; they are addressed using the first eight addresses in a 256-address block. as follows:
Register

Address

Control
Data buffer. low-order byte
Data buffer. high-order byte
Timer. low-order byte
Timer. high-order byte
I/O interrupt vector
Timer interrupt vector
Error interrupt vector

2-31

o
1

2
3
4

5
6
7

The actual 256 addresses will be identified by the eight high-order CP1600 Data/Address Bus lines. which will be used
to create CP1680 device select logic. This device select logic creates CE(the chip enable signal); it may be illustrated
as follows:

---

-..:.
.-

-::

---

,.

,.

I

XXXXXXXX

causes CE
low

D~

•

07
08

·•

015

r

DO - - - 07 at CP1680
~

xxxxxxxx

OOOOOY Y Y

Valid CP1680 addresses

T

T

' " - - - - - May be 000,001,010,011, 100, 101, 110, 111

{May have any 8-bit pattern that device select logic
has been designed to create CE low in response to.

THE CP1680 CONTROL REGISTER
We will summarize the individual bits of the CP1680 control register before describing the operations they control.

Here are CP1680 Control register bit assignments:

6

5

4

o

3

11111 fT I
j

j

I

j

j

j

J' ,

~BitNo.

1

r-

CP 1680 Control register
Parallel I/O active }
{01 _ Parallel I/O inactive

This is called the
Ready bit.
PE=Ready

ERROR input signal level held here
0- PDO-PD15 configured as two 8-bit ports
1 - PDO-PD15 configured as one 16-bit port

{

parallel I/O and Error interrupts
{o1 -- Disable
Enable parallel I/O and Error interrupts
timer interrupts
{o1 -- Disable
Enable timer interrupts
Disable clock logic
{o1 -- Enable
clock logic
Parity of 08-015 byte} 0 = even parity
Parity of 00-07 byte

2-32

1 = odd parity

Bit 0 is always the complement of the PE control output. This bit may be interrogated by the CPU. If parallel data
transfer interrupts are disabled. this allows the CPU to poll on status when monitoring parallel data transfers. PE signal
levels are illustrated in Figures 2-14 and 2-15.
Bit 1 reflects the level of the ERROR input. If parallel data transfer interrupt logic is disabled. then the Error interrupt
logic is also disabled. thus. the CPU must also examine the Error status bit when polling the CP 1680.
Bit 2 determines whether PDO - PD15 will act as a single 16-bit I/O port. or as two 8-bit I/O ports. This is only important
when outputting data.
Control register bits 3 and 4 are used to enable and disable parallel data transfer and Error interrupt logic. and timer interrupt logic.
Control register bit 5 is used .to enable and disable CP1680 interval timer logic. If this bit is O. the interval timer will not
decrement.
Bits 6 and 7 report the parity of the high-order byte and low-order byte for data that is input or output via PD~ - PD15. 0
indicates even parity while 1 indicates odd parity.
All Control register bits may be written into or read. You should be very careful when setting or resetting individual bits
not to simultaneously modify other Control register bits. This means you should use a three-instruction sequence with
an AND or OR mask to set or reset any Control register bit. For details see Volume 1. Basic Concepts.

CP1680 DATA TRANSFER OPERATIONS
The CPU inputs and outputs data via the CP1680 lOB by executing MVI and MVO instructions, respectively.
The CPU must access the CP1680 in byte mode. since an 8-bit Data/Address Bus (DO - 07) connects the CPU and the
CP1680 lOB. Whether the I/O port PD~ - PD15 is configured as a single 16-bit port or as two 8-bit ports has no bearing
on the fact that the CPU must access the CP1680 in byte mode.

The most efficient way of accessing the CP1680 is by using the SDBD instruction with implied memory addressing. Consider data input. If PD~ - PD15 is configured as two 8-bit I/O ports and you wish to access just one of
these I/O ports. then you can use implied memory addressing via R1. R2. or R3. We may illustrate input from the highorder byte of I/O Port PD8 - PD15 as follows:

Register 01
RO

4F

DO - 07
R1

2E

---.--

02

Register 02

CP1600
CPU
CE

2-33

PDQ - P07

If PDO - PD15 are configured as two 8-bit I/O ports or ·as a single 16-bit I/O port. and you want to read both I/O ports.
then you should use the SDBD instruction with implied memory addressing via R4 or R5. This may be illustrated as
follows:

PDO - PD7

RO
R4

CP1600
CPU

CE
2E
generates

CE=O
Control register bit 2 configures PDO - PD15 as a single 16-bit I/O port or as two 8-bit I/O ports.
Given the fact that MVI and MVO instructions (in byte mode) should be used to access the CP1680. when should these
accesses occur?
The answer is that the PE and

AR signals

control event sequences.

Consider parallel data input, as illustrated in Figure 2-14.

When the CPU is ready to input data in resets the
Control register READY bit low. This forces the PE
output high - - - -_ _ _ _ _ _ _ __.

Extemal logic uses PE high to trigger data transfer
to the PD1680. Extemal logic signals the end of
data input by inputting AR low - - - - -

PE

INTAK

Figure 2-14. PD1680 Handshaking with Data Input

2-34

When the CPU is ready to receive data. it resets Control register bit 0 to 0; this forces the PE control signal high.
When external logic senses PE high. it must transmit data to the PD~ - PD15 I/O port. At this point it makes no
difference whether pins have been configured as two 8-bit ports or as a single 16-bit port. External logic will pu II to
ground selected high pins. while leaving other high pins alone. When external logic has completed data input. it signals the fact by inputting AR low. It is the high-to-Iow transition of the AR control input which indicates the presence of
new data for the CPU to read. When Ali makes its high-to-Iow transition. PE also makes a high-ta-Iow transition. and
Control register bit 0 is set to 1. If interrupts have been enabled. then an interrupt is requested via INTRO. Figure 2-14
assumes that interrupts have been enabled; therefore INTRQ is shown making a high-to-Iow transition.
The CPU will acknowledge the interrupt request. as described earlier in this chapter. by outputting INTAK via BC1.
8C2. and BOIR. Logic internal to the CP1680 uses INTAK to reset INTRO high again.
There are many ways in which external logic can determine when to set AR high again. In Figure 2-14 we show external logic using PE to set A11 high. Clearly. when PE makes a low-to-high transition. the CPU must have acknowledged
AR low; therefore external logic can now set AR high. Now that AR is high again. external logic can input new data. An
alternative scheme would be for external logic to constantly hold AR low. using the level of the PE output to determine
when new data could be transmitted. When PE is high. external logic will transmit new data to the CP1680 once. As
soon as it transmits new data. external logic will strobe the data with a short. high AR pulse. then wait for PE to go low
and high again before inputting more data. This may be illustrated as follows:

CPU ready
for input

CPU is
ready
again
for input

Extemal
logic inputs
data

Extemal
logic inputs
data

Data output handshaking is illustrated in Figure 2 -15.

DO - 07

L

:hen CPU outputs data, PE is automatically set

.~.nal.

Extemallogic uses PE high as a "valid data ready"

Aft., """,;,. th;, / ' "

Ali low

\

PE

INTAk

Figure 2-15. P01680 Handshaking for Data Output

2-35

The most important point to note is that there is no control bit which specifies data input mode or data output
mode. Thus, the signal sequences we described for data input and those we are about to describe for data output occur automatically; the input or output mode is purely a function of CPU and external logic interpretation.
Whenever the CPU outputs data to the PD 1680, the arrival of data forces PE output high. If PDO - PD 15 has been configured as two 8-bit ports, then the arrival of a single data byte to either port will cause PE to be output high. If PDO PD15 is configured as a single 16-bit 1/0 port then PD will not be output high until two bytes of data have been
received from the CPU by the PD1680.
Once PE is output high, nothing more happens until external logic responds. External logic cannot tell by the simple inspection of any control signals whether a data input operation or a data output operation is in progress. It is up to you,
when designing your system, to dedicate CP1680 devices to input or output: or you must generate your own identification logic in the event that a CP1680 lOB is bidirectional. In Figure 2-15 we simply assume that external logic knows
data is to be read, and knows whether the data is 16 bits or 8 bits wide. Furthermore, if the data is 8 bits wide, external
logic must know which 8 bits to read. In any event. when external logic has completed its undefined operations, it must
input AR low. The high-to-Iow transition of AA forces PE low again. and if interrupts are enabled, an interrupt will be requested via INTRO. When the CPU acknowledges the interrupt by outputting INT AK via BC 1, BC2. and BDIA. the
PD1680 uses the INTAK pulse to reset INTRQ high.
The method used by external logic to reset AR high again is undefined. In Figure 2-15, we show PE going high as the
trigger which external logic uses to reset AJ1 high. This is clearly a viable scheme; PE will not go high again until fresh
data has been output at which point it is safe to assume that the CPU knows prior data has been read by external logic.
It would be equally viable for external logic to hold AR continuously low, transmitting a short high pulse whenever it
reads data. This may be illustrated as follows:
PE

CPU has
output
data

CPU has
output
more data

logic has
read data

Because there are no control signals which identify the PD1680 operating in input mode or output mode, there
is no straightforward scheme for handling bidirectional data transfers with a single PD1680 device.

THE CP1680 INTERVAL TIMER
The CP1680 has very elementary interval timer logic. A 16-bit Timer register, addressed as two separate 8-bit locations, decrements once every eight CK1 pulses, providing the timer has been enabled. You enable and disable timer
logic via Control register bit 5. As a separate event timer interrupts may be disabled via Control register bit 4. If timer
interrupts are enabled, then when the timer decrements to 0, an interrupt request will occur. (Timer interrupt logic is
described with other CP1680 interrupt logic later in this chapter.) If timer interrupts are not enabled, then the timer itself is effectively disabled, since you cannot test any timer status flag to see if the timer timed out: nor can you accurately read the contents of the Timer registers on the fly, since there is no protection against reading timer contents
while it is in the process of being decremented.
The only timer programmable option you have is to load an initial value before the timer is enabled. The timer
has no buffer; therefore, once it times out it begins decrementing again, if still enabled, beginning with the
value FFFF16. This may be illustrated as follows:

f

~XXXX*S*CKl

t

Load TImer
starting
value XXXX
and start
TImer

,

~I"

Time intervals

t
FFFF*S*CKl

Time out.
Restart

,

~I"

Time out.
Restart

2-36

t

FFFF*S*CKl ~

t

TIme out.
Restart

The only accurate long time intervals you can compute are exact multiples of FFFF16 • 8 • CK 1.
The CP1600A uses a 4MHz two-phase clock. which generates a 500 nanosecond cycle time. Thus. CK1 equals 500
nanoseconds. and long CP1600A time intervals must be an exact multiple of 262.144 milliseconds - the time it will
take for the cou nter to decrement from FFFF16 to 0000.
The CP1600 uses a 3.3MHz two-phase clock. which generates a 600 nanosecond cycle time; therefore. long time.intervals must be exact multiples of 314.572 milliseconds.
The CP161 O. which runs on a 2MHz two-phase clock and has a one microsecond cycle time. will compute long time intervals that are exact multiples of 524.288 milliseconds.
You cannot attempt to generate clock periods that are multiples of shorter time intervals by loading some initial value
into the timer following each time out an unknown amount of time will elapse between the interval timer interrupt occurring and being acknowledged. The length of this unknown period of time will depend on the number of non-interruptable instructions which may be executing in sequence when the interrupt request first occurs. plus any higher
priority interrupts which may exist. Therefore. if you load an initial value into the timer. it should be to compute an isolated time interval only. Here is an appropriate instruction sequence:
MVI
ANDI
MVO
MVII
MVO
MVII
MVO
MVI
ADDI
MVO

10B.RO
CFH.RO
RO.IOB
2AH.RO
RO.IOB+3
34H.RO
RO.JOB+4
10B.RO
30H.RO
RO.IOB

;INPUT CONTROL REGISTER CONTENTS
;ZERO BITS 4 AND 5
;RETURN TO CONTROL REGISTER
;TRANSMIT LOW-ORDER TIMER
;INITIAL BYTE
;TRANSMIT HIGH-ORDER TIMER
;INITIAL BYTE
;LOAD PRIOR CONTROL REGISTER CONTENTS
; SET BITS 4 AND 5
;START TIMER

The instruction sequence above begins with three instructions that load the CP1680 Control register contents into
Register RO. Bits 4 and 5 are zeroed. then the result is returned to the Control register. Thus. the timer and timer interrupts are disabled. We do not bother with an SDBD instruction. Since the data source is eight bits wide. only the loworder byte of Register RO will be significant. This being the case. we can use an 8-bit immediate AND mask to modify
Register RO contents before returning the low-order byte to the Control register.
Next. we load the initial timer value. one byte at a time. into Register RO. Each byte is written out to the appropriate half
of the Control register. Once again we do not need to use the SDBD instruction. Since an 8-bit data path connects the
CPU to the 1680 lOB. only the low-order byte of Register RO will be significant during the data output.
Finally. we start the timer by loading Control register contents into Register RO. setting bits 4 and 5 to 1 and writing
back the resu It.
When you write into the Timer registers. you clear any timer interrupt requests which may at that time be pending.

CP1680 INTERRUPT LOGIC
A CP1680 lOB will generate an interrupt request by outputting a low signal at 1NiliQ if anyone of these three
conditions occurs:
1)

A low input at ERROR. External logic can request an interrupt via the CP1680 using the ERROR input.

2)

The AR handshaking control input makes a high-to-Iow transition. This is illustrated in Figures 2-14 and 2-15.

3)

The Interval Timer decrements from 1 to O.

Recall that there are two separate interrupt enable/disable control bits in the Control register. One control bit applies to
the Interval Timer. while the other control bit applies to both the AR handshaking and ~ interrupts.

Interrupt priorities among the three sources within a single CP1680 lOB are as follows:
ERROR highest
handshaking
Timer lowest

AR

When more than one CP1680 lOB is present In a CP1600 microcomputer system, then daisy chain priority is implemented using the MSKI input signal and the MSKO output signal. Signal connections are illustrated in Figure
2 -13. The manner in which interrupt priorities are handled by the CP1680 is a little unusual.
Two or more CP1680 devices may combine their interrupt request signals. which are wired ORed and input to the
CP1600 via INTRO. The CP1600 acknowledges an interrupt via the INTAK combination of BC1. BC2. and BDIR. We de-

2-37

scribed this process earlier in the chapter. All CP1680 devices simultaneously receive the INTAK combination;
however. a CP1680 which is acknowledged raises its IMSKO signal high. causing it to become the IMSKI input to the
next CP1680 in the daisy chain. Any device that receives a high IMSKI input ignores the interrupt acknowledge. Thus.
only the highest priority. interrupt requesting CP1680 device in the daisy chain will process the interrupt acknowledge.
However. it takes a finite amount of time for IMSKO high signals to propagate as IMSKI signals. and thus ripple through
the daisy chain. Consequently. a maximum of eight CP1680 devices may be present in the daisy chain. A ninth device
will receive its IMSKI high signal too late and will respond to an interrupt acknowledge.
CP1680 lOB devices maintain their interrupt priority status until they receive a high TCI pulse. At that time. prior interrupt priorities are reset at all devices. and new priority arbitration begins. Thus. when using CP1680 lOB devices. you
are required to end all interrupt service routines by executing a TCi instruction.
Note that if one CP1680 lOB has more than one active interrupt request (for example. an ERROR interrupt request and a
timer interrupt request), then this internal interrupt priority will take precedence over the daisy chain interrupt priority.
That is to say. the ERROR interrupt request will be acknowledged and serviced first. After the next TCI instruction is executed. the timer interrupt request will be serviced before any interrupt request from a lower priority CP1680 device is
acknowledged.

Every CP1680 device has three 8-bit Interrupt Vector registers. one dedicated to each of the three interrupt
sources. These three Interrupt Vector registers were illustrated earlier in the chapter. Following an interrupt
acknowledge. when the lAB combination appears at BC1, BC2. and BDIR, the contents of the Interrupt Vector
register for the highest priority active interrupt will be returned to the CPU. Interrupt acknowledge timing is illustrated in Figure 2-9. At the interrupt service location a Jump-to-Subroutine instruction will probably be stored.
Since the Jump-to-Subroutine object code is three words long. a maximum of 85 interrupts can be origined in the first
256 words of memory. This is more than sufficient. since only eight CP1680 devices with 24 interrupts can be supported in a single daisy chain.

2-38

DATA SHEETS
This section contains specific electrical and timing data for the following devices:
• CP1600 CPU
• CP1600A CPU
·CP1610CPU
• lOB 1680 I/O Buffer

2-01

CP1600·CP1600A·CP1610
IUS TIMING DIAGRAM

JS CONTROL

DO-DI5

1m

BAR

@

NACT

~

@

FlOAT

+--+

UNDEFINED

x::x

IIACT

@

@

BAR

-=x

FLOAT

+--+

OUTPUT PC+I TO
FETCH DISPLACEMENT

INPUT
IEXT INSTRUCTION

~STABLE AS LONG AS ADDRESS IS STMILE ;
I

EBCI: •

@

....

OUTPUT
PROGRAM COUNTER

E3~3A!XXXXXXX

DTB

DON'T CARE

I---tAI

~
•

O-DOth CARE-;

.......

VWD INPUT
THROUGHOUT TSI

TYPICAL INSTRUCTION SEQUENCE

~IJlCYCLE~

~~A~A~~~A~R~~
tcv----t

I

tBI-l

~ -i

I 1

00-015 :

~

CHANGING FROM
FLOAT IIOOE TO
OUTPUT IIODE

B~

~s

OUTPUT CHAHGING FROM
VALID OUTPUT IIOOE TO
FLOAT IIOOE

I

t-tB2
1

,...-------i

~-----~
W
INPUT
INSTRUCTION
OR DATA

OPERANO

BRANCH ON EXTERNAL CONDITION INSTRUCTION

Data sheets on pages 2-02 through 2-06 reprinted by permission of General Instrument Corporation,

2-02

CP1600
ELECTRICAL CHARACTERISTICS (CP1600)
Maximum Rating.·

"Exceeding these ratings could cause
permanent damage to these devices.
Functional operation at these conditions is
not implied-operating conditions are
specified below.

Vo o, Vce, GNO and all other input/output voltages
with respect to Vaa . . . . . . . . . . . . -0.3V to +18.0V
Storage Temperature . . . . . . . . . . . . -55 0 C to +150 0 C
Operating Temperature . . . . . . . . . . . . . O°C to +70°C

Standard Condition.: (unless otherwise noted)
VBa= -3V±10%, 0.2mA(typ) ,2mA(max.)
Operating Temperature (T A)=O° C to +70° C

Voo=+12V±5%, 70mA(typ), 110mA(max.)
Vce=+5V±5%, 12mA(typ) , 2SmA(max.)
Characterlltlc
DC CHARACTERISTICS
Clock Inputl
High
Low
Logic Inputs
Low
High (All Lines except BOROY)
High (Bus Data Ready Line
See Note)
Logic Outputl
High
Low (Data Bus Lines 00-015)
Low (Bus Control Lines,
BC1,BC2,BOIR)
Low (All Others)

Sym

Min

Typ··

Max

Units

VIHC
VILC

10.4
0

-

Voo
0.6

V
V

VIL
VIH

0
2.4

-

0.65
Vcc

V
V

VIHa

3.0

-

Vee

V

VOH
VOL

2.4

Vee

-

-

-

0.5

V
V

IOH = 1oo~
IOL = 1.6mA

VOL
VOL

-

-

-

-

0.45
0.45

V
V

IOL = 2.0mA
IOL = 1.6mA

t1/>2, tl/>2

120

-

Condltlonl

AC CHARACTERISTICS
Clock Pulse Inputs, 1/>1 or 1/>2
Pulse Width

-

ns

-

ns

t12, t21

0

Clock Period

tcy

0.3

-

2.0

",s

Rise & Fall Times

tr,tf

-

-

15

ns

tms

-

-

30

ns

tBO

-

-

120

ns

t BF
t B1
tB2

-

50

0
10

-

-

ns
ns
ns

t

DC

-

-

120

ns

t BU
tro
trw

-

150
200
300

tOE
tAl

-

-

-

-

150
400

ns
ns

C1/>1,C1/>2

-

20

30

pF

CIN

-

-

-

6
5

12
10

pF
pF

Co

-

8

15

pF

Skew (1/>1, 1/>2 delay)

Malter SYNC:
Delay from I/>
DO-D15 BUI Signall
Output delay from 1/>1
(float to output)
Output delay from 1/>2
(output to float)
Input setup time before 1/>1
Input hold time after 1/>1
Bu. Control Signall
BC1,BC2,BDIR
Output delay from 1/>1
BUSAK Output delay from 1/>1
TCI Output delay from 4>1
TCI Pulse Width
EBCA output delay from BEXT
input
EBCA wait time for EBCI input

-

-

-

ns
ns
ns

CAPACITANCE
1/>1, 1/>2 Clock Input capacitance
Input CapaCitance
00-015
All Other
Output CapaCitance
00-015 in high impedance state

1 TTL Load & 25 pF

TA=+25°C; Voo=+12V; Vee = +5V;
VBB =-3V; tl/>1 t ct>2 = 120ns

'"Typical values are at +25°C and nominal Voltages.
NOTE:
The Bus Data ReaOY(BOROY) line is sampled during time period TSI after a BAR or AOAR bus control signal. BOROY must
go low requesting a wait state 50 ns before the end of TS1 and remain low for 50 ns minimum. BOROY may go high
asynchronously. In response to BOROY, the CPU will extend bus cycles by adding additional microcycles up to a maximum
of 40 ",sec duration.

2-03

CP1600A
ELECTRICAL CHARACTERISTICS (CP1600A)
Maximum Ratings·

"Exceeding these ratings could cause
permanent damage to these devices.
Functional operation at these conditions is
not implied-operating conditions are
specified below.

Voo, Vee, GNO and all other inpuVoutput voltages
with respect to Vaa . . . . . . . . . . . . -0.3V to +18.0V
Storage Temperature . . . . . . . . . . . . -55°C to +150°C
Operating Temperature . . . . . . . . . . . . . O°C to +70°C

Standard Conditions: (unless otherwise noted)
Voo=+12V±5%, 70mA(typ) ,14OmA(max.)
Vee=+5V±5%, 12mA(typ) ,25mA(max.)
Characteristic
OC CHARACTERISTICS
Clock Inputs
High
Low
Logic Inputs
Low
High (All Lines except BDROY)
High (Bus Oata Ready Line
See Note)
Logic Outputs
High
Low (Oata Bus Lines 00-015)
Low (Bus Control Lines,
BC1,BC2,BDIR)
Low (All Others)

VBa= -3V±10%, 0.2mA(typ) , 2mA(max.)
Operating Temperature (TA)=O°C to +70°C
Sym

Min

Typ·"

Max

Units

VIHe
VILe

10.4
0

-

Voo
0.6

V
V

VIL
VIH

0
2.4

-

0.65
Vee

V
V

VIHB

3.0

-

Vee

V

VOH
VOL

2.4
-

Vee

-

0.5

V
V

10H = l001lA
10l= 1.6mA

VOL
VOL

-

-

0.45
0.45

V
V

10l= 2.0mA
10l= 1.6mA

t.p2, t.p2

95

t12, t21

0
0.25

-

-

-

Condillons

AC CHARACTERISTICS
Clock Pul.. Inputs, .p1 or .p2
Pulse Width
Skew (411, 412 delay)

-

ns

-

-

ns

Clock Period

tcy

-

2.0

~s

Rise & Fall Times
MMterSYNC:
Delay from 41
00-015 Bus Signals
Output delay from 411
(float to output)
Output delay from .p2
(output to float)
Input setup time before 411
Input hold time after 4>1
Bus Control Signals
BC1,BC2,BDIR
Output delay from 411

tr, tf

-

-

15

ns

tms

-

-

30

ns

BUSAK Output delay from 411
TCI Output delay from 4>1
TCI Pulse Width
EBCA output delay from BEXT
input
EBCA wait time for EBCI input

tBO

-

-

95

ns

t BF
t B1
tB2

-

50

0
10

-

-

-

-

ns
ns
ns

t

DC

-

-

t BU
tTO
tTW

-

-

150
200
300

tOE
tAl

-

-

150
400

ns
ns

C4>l,C4I~

-

20

30

pF

CIN

-

-

-

6
5

12
10

pF
pF

Co

-

8

15

pF

-

200
-

-

ns
ns
ns
ns

CAPACITANCE

.pl, .p2 Clock I nput capacitance
Input Capacitance
00-015
All Other
Output Capacitance
00-015 in high impedance state

1 TTL Load & 25 pF

TA=+25°C; Voo=+12V; V ec =+5V;
VBB=-3V; t'4>l t tP2 = 120ns

""Typical values are at +25°C and nominal voltages.
NOTE:
The Bus Oata ReaOY(BOROY) line is sampled during time period TSI after a BAR or ADAR bus control signal. BOROY must
go low requesting a wait state 50 ns before the end of TSl and remain low for 50 ns minimum. BDROY may go high
asynchronously. In response to BDRDY, the CPU will extend bus cycles by adding additional microcycles up to a maximum
of 40 ~sec duration.

2-04

CP1610
ELECTRICAL CHARACTERISTICS (CP1610)
Maximum Ratings·

·Exceeding these ratings could cause
permanent damage to these devices.
Functional operation at these conditions is
not implied-operating conditions are
specified below.

Vo D , Vee, GNO and all other input/output voltages
with respect to VBB • • • • • • • • • • • • -0.3V to +18.0V
Storage Temperature . . . . . . . . . . . . -55° C to +150° C
Operating Temperature . . . . . . . . . . . . . O°C to +70°C

Standard Conditions: (unless otherwise noted)
Voo=+11V±5%. 70mA(typ). 110mA(max.)
Vee=+5V±5%. 12mA(typ) .25mA(max.)
Characteristic
DC CHARACTERISTICS
Clock Inputs
High
Low
Input current
Logic Inputs
Low
High (All Lines except BOROY)
High (Bus Data Ready Line
See Note)
Logic Outputs
High
Low (Data Bus Lines 00-015)
Low (Bus Control Lines.
BC1.BC2,BOIR)
Low (All Others)

VBB= -3V±10%. 0.2mA(tYPI .2mA(max.)
Operating Temperature (TA)=O°C to +70°C
Sym

Min

Typ·'

Max

Units

VlHe
VILe

10.0
0

-

-

V
V
mA

Conditions

-

-

Voo
0.6
15

VIL
VIH

0
2.4

-

0.65
Vee

V
V

VIHB

3.0

-

Vee

V

VOH
VOL

2.4
-

Vee
-

0.5

V
V

10H = 1001tA
10L= 1.6mA

VOL
VOL

-

-

-

-

0.45
0.45

V
V

10L= 2.0mA
10L= 1.6mA

VIHC

= Voo-1

AC CHARACTERISTICS
Clock Pulse Inputs, eIl1 or eIl2

-

ns

-

-

ns

0.5

-

.2.0

p's

-

-

15

ns

tms

-

-

30

ns

tBO

-

-

200

ns

t BF
t B1
tB2

-

0
10

50
-

-

ns
ns
ns

t

DC

-

-

200

ns

t BU
tTO
tTw

-

150
200
300

-

ns
ns
ns

tOE
tAl

-

-

150
400

ns
ns

Cq>1, C4>2

-

20

30

pF

-

Pulse Width

tell2. tell2

250

Skew (eIl1. eIl2 delay)

t12, t21

0

Clock Period

tcy

Rise & Fall Times
Master SYNC:
Delay from ell
00-015 Bus Signals
Output delay from .p1
(float to output)
Output delay from .p2
(output to float)
Input setup time before eIl1
Input hold time after eIl1
Bus Control Signals
BC1,BC2,BOIR
Output delay from .p1

tr, tf

BUSAK Output delay from .p1
TCI Output delay from eIl1
TCI Pulse Width
EBCA output delay from BEXT
input
EBCA wait time for EBCI input

-

-

CAPACITANCE
eIl1, eIl2 Clock Input capacitance
Input capacitance
00-015
All Other
Output CapaCitance
00-015 in high impedance state

1 TTL Load & 25 pF

,
TA=+25°C; Voo=+12V; Vee = +5V;
VBB =-3V; t'4>1 t eIl2 = 120ns

-

-

6
5

12
10

pF
pF

Co

-

8

15

pF

CIN

·'Typical values are at +25°C and nominal voltages.
NOTE:
The Bus Data ReaOY(BDROY) line is sampled during time period TSI after a BAR or ADAR bus control signal. BDRDY must
go low requesting a wait state 50 ns before the end of TS1 and remain low for 50 ns minimum. BOROY may go high
asynchronously. In response to BDROY, the CPU will extend bus cycles by adding additional microcycles up to a maximum
of 40 p'sec duration.

2-05

1081680
ELECTRICAL CHARACTERISTICS
Maximum Ratings·
Voo and Vee and all other input/output voltages
with respect to GNO ........................................... -0.3Vto+18V
Storage Temperature ..................................... -55° C to +150° C
Operati ng Tem peratu re ....................................... 0° C to +70° C

'Exceeding these ratings could cause
permanent damage. Functional operation of
this device at these conditions is not
implied-operating ranges are specified
below.

Standard Conditions (unless otherwise noted)
All voltages referenced to GNO
Voo = +12V ± 5%
Vee = +5V ±5%
Operating Temperature (T A) = 0° C to +70° C
Symbol

Min

Typ··

Max

Unit

High

Vihc

2.4

-

Voo

V

Low

Vilc

0

-

.5

V

High

Vih
Vii

2.4

-

Vee
.65

V

Voh
Vol

2.4

Vce
-

-

V

loh

-

.5

V

101

tpc
tcl
tcr,tcf

0.4
70

-

4.0
-

I1S

-

-

-

10

ns

-

6

12

pF

Yin

5

10

pF

Yin

-

8

15

pF

Characteristic

Condition

DC CHARACTERISTICS

Clock Input:

Logic Inputs:

Low
High

Logic Outputs:

Low

0

V

= 100pA
= 1.SmA

AC CHARACTERISTICS
Clock Inputs

CK1

Clock period
Clock width
Rise & Fall times

ns

= 25°C,
Voo = +12V,
Vee = +5V)

CAPACITANCE (TA

Input Capacitance: 00-07

Cin

All others
Output Capacitance:

Cout

=OV
= OV

"Typical values are at +25° C and nominal voltages.

TIMING DIAGRAM

H~
/

wo

-U
-'J
tef

BOIR
BC2.BC1

..

H

H H

~
t~e

----ll+:----ll--- ter
I tel

..

/

u

U

I
/

-+l

'"-_ _ _ _ _ __

toe

Note: CK1' not drawn to scale.

I+-

CIRCUIT DESCRIPTION
This circuit is designed to provide all the data buffering and
control functions required when interfacing the Series 1600
Microprocessor System to a simple peripheral device. Data is
transferred to and from the peripheral on 16 bidirectional lines.
each of which can be considered to be an input or output. The
transfer of information with the CP1600 is accomplished via an 8bit highway, the 16-bits being transferred as two 8-bit bytes. the
register addresses are assigned CP1600 memory locations. as
follows (N is an arbitrary starting address):

Register Address
N
N+1
N+2
N+3
N+4
N+5
N+6
N+7

2-06

Description
Control Register
Data Register Low Order 8-bits
Data Register High Order 8-bits
Timer Low Order 8-bits
Timer High Order 8-bits
Peripheral Interrupt Address Vector
Timer Interrupt Address Vector
Error Interrupt Address Vector

Chapter 3
THE TEXAS INSTRUMENTS TMS 9900,
TMS 9980, AND TMS 9940 PRODUCTS
The TMS 9900 was the first 16-bit microprocessor that could compete effectively in the minicomputer market. In fact.
the TMS 9900 is a one-chip implementation of the TM 990 series minicomputer Central Processing Units.

The TMS 9900 is packaged as a 64-pin DIP; it generates signals for a 15-bit Address Bus and a separate 16-bit Data
Bus, whereas other 16-bit microprocessors multiplex their Data and Address Busses. The TMS 9980 series
microprocessors are 40-pin DIP versions of the TMS 9900; in order to reduce pin counts, the TMS 9980 series
microprocessors access external memory via an 8-bit Data Bus and 14-bit Address Bus. The TMS 9940 is a one-chip
microcomputer containing a subset of the TMS 9900 Central Processing Unit. together with on-chip memory and realtime clock logic.
The TMS 9900 product line has for some time been one of the enigmas of the microprocessor industry. Even a
casual examination of the TMS 9900 instruction set shows that from the programmer's viewpoint. this microprocessor
was at least two years ahead of its time. While it may have had problems competing in high-volume, simple applications, it was certainly the microprocessor of choice for data processing-type, program-intensive applications, yet it was
not widely used in these markets.
The reason for this lack of acceptance has been poor support from Texas Instruments.
Texas I nstru ments initially offered little support for the TMS 9900 because this microprocessor was designed as a lowend product of the TM 990 minicomputer series. That is to say, customers were expected to develop products around
the TM 990 minicomputers; then, if they chose to, they could build production models around the TMS 9900
microprocessor. This development path did not call for extensive TMS 9900 support. In all probability, Texas Instruments was caught by surprise by the buoyancy of the microprocessor market - as a market in its own right. Certainly,
if Texas Instruments had given the TMS 9900 the same level of support that Intel gave the 8080A. we would see entirely different microprocessor product distributions today. But the TMS 9900 and its derivative products are powerful
enough that the belated support they are now receiving from Texas Instruments will give the product line a reasonable
share of future markets.

Texas Instruments now provides full support for the TMS 9900 microprocessor line.
TMS 9900 support devices are designed specifically for the TMS 9900 and can be used with the TMS 9900,
'TMS 9980, or TMS 9940 products. The following devices are described:
The
The
The
The

TIM 9904 Clock Generator
TMS 9901 Programmable System Interface
TMS 9902 Asynchronous Communications Controller
TMS 9903 Synchronous Communications Controller

Texas Instruments is the primary manufacturer for all of the TMS 9900 series products. TMS 9900 series products are handled out of the following Texas Instruments office:
TEXAS INSTRUMENTS, INC.
P.O. Box 1443
Houston. Texas 77001
Second sources for the TMS 9900 family are:
AMERICAN MICROSYSTEMS, INC.
3800 Homestead Road
Santa Clara. California 95051
SMC MICROSYSTEMS CORP. (TMS 9980 series only)
35 Marcus Blvd.
Hauppage, N.Y. 11787

3-1

THE TMS 9900 MICROPROCESSOR
The TMS 9900 is manufactured using N-channel silicon gate MOS technology. It is packaged as a 64-pin DIP. Three
power supplies are required: -5V. +5V. and +12V.
Using a 3 MHz clock. instruction execution times range between 3 and 10 microseconds.

A TMS 9900 FUNCTIONAL OVERVIEW
Figure 3-1 illustrates that part of our general microcomputer system logic which is implemented by the TMS 9900
CPU.
The most important features of Figure 3-1 are:
• The absence of programmable registers
• The presence of significant interrupt handling logic
• The presence of serial-to-parallel data conversion logic
• The absence of I/O port interface logic

Clock Logie

Accumulator
Registerlsl

Programmable
Timers

I/O Ports

Figure 3-1. Logic of the TMS 9900 CPU

3-2

Let us first consider the manner in which the TMS 9900 handles programmable registers.

TMS 9900 PROGRAMMABLE REGISTERS
Within the logic of the TMS 9900 itself. there are just three 16-bit programmable registers: a Program Counter. a
Workspace register. and a Status register.

The Program Counter and Status register are straightforward. The Program Counter contains the address of the
next instruction to be executed. The Status register maintains various statuses. which we describe later in this chapter.
The Workspace register is a unique and powerful programming feature of the TMS 9900. This register identifies
the first of sixteen 16-bit memory locations which act as .16 General Purpose registers. This may be illustrated
as follows:
lS-BIT MEMORY

Special Functions

LOCATION
Any memory
addresses

HIGHORDER
BYTE
~~

xxxx
WP

.,

I

xxxx

~~--------~~~------~,

LOWORDER
BYTE

I

--...IIi!.

l'

RO

xxx x + 2
xxxx + 4

Rl

xxx x + 6
xxx x + 8

R3
R4

xxx x + A
xxxx + C
xxxx+ E

R2
I

:

R5
RS
R7
R8

I

J

xxxx+ 10
xxxx + 12

I

xxx x + 14

I

R9
Rl0

:

Rll

I

i

•

R12
R13
R14

I

R15

xxx x +
xxxx +
xxxx +
xxxx +

16
18
lA
lC

xxxx + lE

RO cannot be an Index register .
Shift instruction will seek shift
count in low-order four RO bits if
instruction object code specifies
o shifts.

:

Subroutine return address or XOP eftective
address
CRU Bit address
Save old WP
Save old PC
Save old ST

Some of the 16 registers serve special functions, as defined by the text on the right-hand side of the illustration
above. For the moment. do not attempt to understand these special functions. They are described later in the chapter.
In TMS 9900 microcomputer systems, external memory consists of 16-bit memory words.
Each 16-bit memory word has its own memory address. Within the TMS 9900 CPU,
however, memory is addressed as a sequence of 8-bit locations. For this to occu r. the CPU

3-3

TMS 9900
MEMORY
ADDRESSES

generates an internal 16-bit memory address; the high-order 15 bits of the internal memory address create the external memory addresses. This may be illustrated as follows:
This 16-bit address is created
by program logic to address 65536 bytes

(

................ ..............

~

~~~

~

These 15 address bits are output
to access 32768 external, 16-bit memory words

I

I
j~

13 12 11

I
j ~

I

A ......_ _ _ _ _ _ _ _ _)__

~SB
~5 14

I
j

I
~~

.

~

10
.

I

9

-.

I
~

8

I
•

- -

7

6

11

j, .
~

5

I
~

4

2

.-

1

Byte Discrimination Bit

.Y 0 = Even Byte
Lts!1 1 = Odd Byte

I-0

Bit No.

I I I 1 J Memory Address I nside the CPU

1
j~

3

~

j

tL

AO

(LSB)

A1
A2
A3
A4
A5
A6
A7

External Address Bus

A8
A9
A10
A11
A12
A13
A 14 (MSB)

When designing hardware around the TMS 9900. you will implement external memory as 16-bit words. which are addressed by a 15-line Address Bus. That is to say. 32.768 16-bit words may be addressed.
But when you are programming the TMS 9900 you will visualize memory as 65.536 bytes. addressed by a 16-bit address. An even byte address will access the low-order byte of an external 16-bit memory word, while an odd
memory address will access the high-order byte of an external 16-bit memory word.

Any 16 contiguous words of read/write memory may serve as the current 16 general purpose registers for the
TMS 9900.
You may have as many sets of 16-bit registers as you wish, limited only by the size of implemented memory.
If you are using more than one set of 16-bit registers, then at any time just one set of 16-bit registers can be
selected. The WP register identifies the first of the 16 contiguous memory locations serving as the current 16
general purpose registers.
Each of the 16 general purpose registers may be used to store data or addresses. Thus. each general purpose register
may serve as an Accumulator or as a Data Counter.

Registers R11 through R15 are used as special Pointer storage buffers; we will be describing the way in which
these registers are used as the chapter proceeds.
Having 16 general purpose registers in read/write memory, rather than in the CPU, is the single most important
feature of TMS 9900 architecture. The advantage of having 16 general purpose registers located anywhere in
read/write memory is that you can have many sets of 16 general pu rpose registers. For example. following an interrupt
acknowledge. you no longer need to save the contents of general purpose registers - all you need to do is save the
contents of the Program Counter. the Workspace register and the Status register. and that is done automatically by
TMS 9900 interrupt handling logic. By loading new values into the Program Counter and the Workspace register. you

3-4

can begin executing a new program. accessing 16 new memory words general purpose registers.

which will be treated as a new set of 16

The disadvantage of having 16 general purpose registers in read/write memory is that no TMS 9900 microcomputer system can be configured without read/write memory; and if you are going to use many different sets of 16bit registers. then you are going to require a significant amount of read/write memory. Furthermore. you lose the speed
associated with executing register-to-register operations; there are no source and destination locations left in the CPU.
Every register access becomes a memory access.
TMS 9900 literature refers to the process of switching from one set of general purpose
registers to another as a context switch. This terminology reflects the complete change of program environment that results from the switch.

TMS 9900
CONTEXT
SWITCH

Special instructions allow you to perfqrm a forward context switch or a backward context switch.
During a forward context switch. you load new values into the Workspace register and Program Counter. while
simultaneously saving the old Workspace register. Program Counter. and Status register contents in the new General
Purpose Registers R13. R14. and R15.
A backward. or reverse context switch loads the current contents of General Purpose Registers R13. R14. and R15 into
the Workspace register. Program Counter. and Status register. respectively. thus returning you to your previous set of
general purpose registers.
You can perform context switches as often as you like and whenever you like. For example. a very effective way of
using context switching is to group data into contiguous memory words which you can identify as a register set. Upon
entering a subroutine. you can perform a context switch which automatically creates all necessary initial data and address values in appropriate general purpose registers. This may be illustrated as follows:
MEMORY
WORDS

RO
Rl
R2

R3

R12

R13
R14

R15
Data and parameters
used by subroutine are
stored here by the calling
program before calling
the subroutine

RO
~

Rl
R2

R3
R4

Rl0

3-5

Arbitrary
Memory

As illustrated above. when you perform a forward context switch, the current Program Counter
contents. Status register contents. and WP register contents are saved in what will become the
new Registers R13. R14 and R15 .. respectively. Here is the exact sequence in which events occur:

TMS 9900
FORWARD
CONTEXT
SWITCH

1)

The new WP register contents are loaded into the CPU and held in temporary storage.

2)

The current Status register contents are written out to the memory location which will become the new Register
R15.

3)

The current Program Counter contents are written out to the memory location which will become the new Register
R14.

4)

The current WP register contents are written out to the memory location which will become the new Register R13.

5)

The new WP register contents. which were held in temporary storage. are moved into the WP register.

6)

The new value is loaded into the Program Counter

Thus. when a forward context switch is performed. an audit trail ensures that program logic knows the exact machine
state at the instant of the forward context switch.

When a backward context switch occurs, the contents of the current General Purpose
registers R13, R14, and R15 are loaded into the WP register, the Program Counter, and the
Status register, respectively. Thus. program logic returns to the location of the forward context
switch

TMS 9900
BACKWARD
CONTEXT
SWITCH

TMS 9900 MEMORY ADDRESSING MODES
The TMS 9900 provides these four methods of addressing memory:
1)
2)
3)
4)

Direct memory addressing
Direct, indexed memory addressing
Implied memory addressing
Implied memory addressing with auto-increment

The way in which the TMS 9900 implements these four memory addressing modes is exactly as described in Volume 1.
Chapter 6. The important point to note is that the TMS 9900 looks upon its address space as consisting of 32.768 16bit memory words which are addressed using 15. rather than 16. Address Bus lines: yet programs compute all addresses as 16-bit words. This logic was described earlier.

Direct memory addressing instructions provide the memory address in the second word
of an instruction's object code:

MSB
15

TMS 9900
DIRECT
ADDRESSING

LSB
14

13

12

11

10

9

8

6

5

4

2

o

'--BitNo.

I I I II I I II I I I III I I
\.------JL
f

Instruction Object Code

Byte ;dontme,

""og~,ed

by CPU logl,

....
- - - - - - - - - - - - - - - - - Direct address output via Address Bus

Direct, indexed memory addressing instructions provide a base address in the second
object code word, but they also identify a general purpose register whose contents are
to be added, as a signed binary number, to the base address. Again. the low-order bit of the
computed address is not output via the Address Bus. but is interpreted by CPU logic as a byte
identifier.

TMS 9900
INDEXED
ADDRESSING

General Purpose Register RO cannot be specified as an index register.
Direct. indexed addressing is very useful in a TMS 9900 microcomputer system. It allows you to address the previous
set of general purpose registers. following a context switch. without knowing where the previous registers were. Suppose you want to access the contents of the memory word which was being used as General Purpose Register R5

3-6

before you switched to your current set of general purpose registers. Recall that the previous Workspace register contents are stored in your current General Purpose Register R13. You could thus address the previous General Purpose
Register R5. without knowing where this general purpose register may have been. by using direct. indexed addressing
as follows:
Instruction
Base Address

Read/Write
Memory

ARBITRARY
MEMORY
ADDRESSES

~
HighOrder
Byte

LowOrder
Byte

(

RO

I

XXXX

Rl

I

XXXX

R2

!

XXXX

+4

R3

1

XXXX

+6

R4

+2

I

XXXX

R5

I

XXXX

+S
+A

R6
R7

j

XXXX

+C

Previous

:

XXXX

+E

General

RS

!

XXXX

+ 10

Purpose

R9
Rl0
Rll

I

XXXX

registers

i

XXXX

+ 12
+ 14

I

XXX X

R12

i

XXXI(

+ 16
+ 18

R13

I

XXXX

+ lA

R14

i

XXXX

R15

I

XQX

+ lC
+ lE

I

I
1

RO

yyyy
yvyy + 2

Rl
R2

I

"R3
R4

I

YVYV + 4
yyvy + 6

yvyy +8

~

R5

I

yyyy+A

R6

i

yvyy +C

Current
General

I

yyyy + E
yyyy + 10
yvyy+ 1'2
vyyy + 14
yyyy + 16
yyyy + 18
yvyy+ lA
yvyy + lC

i

YVYY + lE

:

R7

RS

I

R9
Rl0

I

Rll

I

I

R12

R13
R14
R15

I

Xl.;

I

xx

Purpose
registers

I

An implied memory addressing instruction will specify one of the 16 current general purpose registers as providing the effective memory address.

TMS 9900
IMPLIED

If you specify implied memory addressing with auto-increment, then the contents of the
ADDRESSING
identified general purpose register will be incremented after the memory access has
been performed. If the instruction specifies a byte operation. the register contents will be incremented by one; the
register contents will be incremented by two after a full-word operation.

3-7

Six object code bits identify the data memory addressjng option selected by any TMS 9900 instruction that accesses
data memory. The six object code bits are interpreted as follows:
T

R

~~

'-v--'~

L {

0000 through 1111 select the general purpose register to be accessed during the memory address computation

00 - Not a memory reference instruction. The selected register is
accessed directly.
01 - Implied memory addressing
10 - Direct addressing if register RO is selected.
Direct, indexed addressing otherwise.
{
11 - Implied memory addressing with auto-increment

Two-address instructions will include 12 memory addressing option bits:

MSBr--p__~~~~~~~~~~~~~~~~~~__~-.LSB

I

I

.1

Two-address instruction object code

'"-v-' ~ '"-v-' ~
TO
RD
TS
RS

~~
Destination
address

Source
address

Some instructions allow a source to be anywhere in memory. but the destination must be a general purpose register.
These object codes include TS. RS. and RD. but not TO.
TMS 9900 Jump instructions use program relative. direct addressing. These are one-word
instructions. where the low-order byte of the instruction object code provides an 8-bit. Signed
binary value. which is added to the incremented contents of the Program Counter. This is
straightforward program relative. direct addressing.

TMS 9900
PROGRAM
MEMORY
ADDRESSING

TMS 9900 I/O ADDRESSING
As compared to other microcomputers described in this book. the TMS 9900 has unusual I/O logic. In addition to addressing I/O devices as memory locations. you can address a separate I/O field of up to 4096 bits. Texas Instruments' literature refers to this field as the "Communications Register Unit" (CRU).lf you are programming a TMS
9900 microcomputer system that has already been configured by Texas Instruments. then it is justifiable to look upon
the Communications Register Unit as a form of I/O port. If you are building your own interface to a TMS 9900 CPU. then
instructions that are supposed to access the Communications Register Unit in reality Simply make alternative use of
part of the Address Bus in conjunction with three control signals: CRUCLK. CRUIN. and CRUOUT
There are two classes of TMS 9900 CRU instructions. The first class accesses individual bits (or signals). while
the second class accesses bit fields that may be between 1 and 16 bits wide.
There are three single-bit CRU instructions; they set. reset. or test the identified CRU bit. This is equivalent to setting. resetting. or testing an external signal or single I/O port bit. When a bit is to be set or reset. the new level is output
via CRUOUT. and a CRUCLK pulse indicates that valid data is on the CRUOUT line. When the condition of a bit is to be
input or tested. then external logic is required to return the level of the tested bit via CRUIN.

3-8

A CRU bit instruction outputs a 12-bit address which is computed as follows:
Instruction Object Code.

r-----------------~~--------------~\
MSB 15 14 13 12 11 10 9

8

II

7

6

5

4

3

o

2

LSB

I II I I I IX I y Iy I y Iy I y I y Iy I
General Purpose Register R12
~~--~~~'=~~~~~~-----------~----------~
r \
MSB 15 14 13 12 11 10 9 8

II

7

6

5

4

3

2

o

LSB

I Izlzlzlzlzlzlzlzlzlzlzlzi

x
+

X X X X Y Y Y Y Y Y y
Z Z Z Z Z Z Z Z Z Z Z Z

L S u m "",,om .. effec.;'. CRU "jd""

X, Y and Z represent any binary digits

The 12-bit address is output on the 12 lower-order address lines; the three higher-order address .lines are all 0 to
designate a CRU address.
Now during the execution of a CRU bit instruction, the address which is output is supposed to be a bit address - that
is, an address identifying one bit in a possible 4096-bit fieJd. So far as external interface logic is concerned. the address
can be interpreted in any way. However. data output will' occur via CRUOUT only; data is input via CRUIN, and
stored in the Equal bit of the Status register.

There are two multi-bit CRU instructions: one. LDCR. transfers data from an addressed memory location to any addressed CRU bit field. The other. STCR. transfers data from an addressed CRU bit field to any addressed memory location. Anywhere from 1 to 16 bits of data may be transferred by the LDCR and STCR instructions Instruction object
codes are interpreted as follows:
MSB
8

7

II I III III
......

R

T

15 14 13 12 11 10 9

-

~

~

6

LSB

.-A-.~

5

4

3

2

1

o·

I I I I I I I

Bit No,

Multi-bit CRU Instruction

-~

~~

L{These four bits identify the general purpose register which is to be
used in the memory address computation 0000 = RO to 1111 =
R15,

/ 00 - Register is the memory location
01 - Implied memory addressing via address in the register
10 - If Register RO is selected, then direct memory addressing is
I
specified; the direct address is in the next program memory
'------.<
word. If any register other than RO is selected, then direct, inI
dexed addressing is specified. The contents of the selected
register are added to the contents of the next program memory word.
11 - Implied memory addressing with auto-increment
L . . - - - - - - - - - - C R U bit field length (0 is interpreted as 16)
L -_ _ _ _ _ _ _ _ _ _ _ _ jOOll00 = LDCR
1001101 = STCR

3-9

The source/destination memory location is identified as it would be for any memory reference instruction.
The address of the first CRU bit is specified by Register R12. For a multi-bit CRU instruction, the CRU bit address is incremented for each succeeding bit access, but the incremented address is held in a temporary storage location. The
contents of Reg ister R12 are not incremented
Thus, mUlti-bit CRU instructions may transfer anywhere from 1 to 16 bits between any memory location and any CRU
bit field. Note that memory must be divided into 16-bit words, each of which has identified bit boundaries, but
there are no equivalent bit boundaries in the CRU bit field. That is to say, any CRU bit may be identified via Register
R12 as the first bit in a multi-bit field, while the length of the multi-bit field is identified by the instruction object code.
This may be illustrated as follows:

CRU

MSB
15 14 13

LSB
12 11

10

9

8

7

6

5

4

3

2

0

1

Ixlxlxlxlxlxlxlxlxlxlxlxl
R12

r

MSB
15 14 13 12

Start of CRU
Bit Field

LSB
11

10

9

8

7

6

5

4

3

2

t, I
y

0

<

y

I

t

t

I

CRU Instruction
Object Code

,

If YYYY is 0000, the CRU bit field is assumed to be 16 bits in length.

3-10

End of CRU
Bit Field

When bits are transferred from a memory location to a CRU bit field. the contents of the memory location are not
actually modified. but the transfer occurs as though bits had been right shifted out of the memory location. Bits
arriving within the addressed CRU bit field are stored in sequential CRU bit locations with ascending addresses. This
may be illustrated as follows:
CRU

Data Memory

/

~

~

a

1

Lowest CRU Bit
Address

a

xlxlxlxlxl1 11101011101111101110

1
1

\
\

a

1

"~

a
0

--

1
1

Highest CRU Bit
Address

Eleven bits have been transferred in the illustration above. If eight or fewer bits are transferred from a general purpose
register. only the more significant byte is accessed:
MSB

LSB

15 14 13 12 11 10 9 8 7 6 5 4 3 2
a
I x 1x 1X 11 1a 1a 11 11 1y 1y 1y 1y 1y 1y 1y 1y I

General Purpose Register

CRU

Lowest CRU Bit Address

a
a
Highest CRU Bit Address

Our illustration shows a transfer of five bits.

3-11

If eight or fewer bits are transferred from a memory location, then the memory address will be considered a byte address rather than a word address; that is, the transfer will be from the low-order bits of the addressed byte, which may
be either the upper or lower byte of a 16-bit memory word. Thus you can access the lower byte of a general purpose
register by addressing it as a memory location.

A data transfer from the CRU to data memory occurs as the exact logical reverse of the illustration above, except
that high-order bits of the destination data memory word are zeroed if unfilled. This may be illustrated as follows:
CRU

Data Memory
Lowest CRU Bit Address

o
o

o

Unused, Therefore Reset
Highest CRU Bit Address

As with data transfers from memory to the CRU, if eight or fewer bits are transferred, only a byte will be affected. This
will be either the addressed memory byte:
CRU

Data Memory

_ _- - - - - 1 0

Lowest CRU Bit Address

o
o
Highest CRU Bit Address

These Bits Reset to 0

3-12

or the high-order byte of a general purpose register:
LSB

MSB

15 14 13 12 11 10 9 8 7 6 5 4 3 2 0
I 0 1010 11 11 101 I 01X I X 1X 1X I X 1X 1x'ix I General Purpose Register
~j

•

These Bits.
Reset to

0

-

"--

V
This Byte Unaffected

./

CRU

--

0
1
0
1
1

Lowest CRU Bit Address

Highest CRU Bit Address

TMS 9900 STATUS FLAGS
The TMS 9900 CPU has a 16-bit Status register which may be illustrated as follows:

o

6

7

15 14 13 12 11 10 9

2

3

4

5

8

8

9

6

10 11 12 13 14 15 .....--TMS 9900 Bit Number

4

3

o . - Our Bit Number
Status register

L-.._ _ _ _ _ _ _

Unused

' - - - - - - - - - - - - - XOP instruction executed
' - - - - - - - - - - - - - - Parity status
- - - - - - - - - - - - - - Overflow status
- - - - - - - - - - - - - - - Carry status
' - - - - - - - - - - - - - - - - - - Equal condition
.....- - - - - - - - - - -_ _ _ _ _ _ Arithmetic Greater Than condition
- - - - - - - - - - - - - - - - - - - Logical Greater Than condition

The low-order four bits of the Status register represent an interrrupt mask which identifies the level of interrupt
which is currently enabled. As the 4-bit interrupt mask would imply. 16 levels of interrupt are allowed. We will describe
interrupt processing later in this chapter.
The X status is set to 1 while an XOP instruction is being executed. This instruction allows you to perform a software interrupt - as described later in this chapter.
The P, 0, and C are standard Parity, Overflow and Carry statuses.
The Equal status (=) identifies a condition that currently exists, as the result of the execution of a previous instruction, that will cause a Branch-if-Equal instruction to branch. A CRU bit to be tested also gets stored in the
Equal status.
The Logical Greater Than and Arithmetic Greater Than statuses are set or reset following arithmetic. logical. or data
move operations. A Logical Greater Than treats the source data as simple, unsigned binary numbers. An
Arithmetic Greater Than interprets the operand as signed binary numbers.

TMS 9900 CPU PINS AND SIGNALS
Figure 3-2 illustrates the pins and signals of the TMS 9900 CPU.
Being a 64-pin DIP. the TMS 9900 can afford to have separate Address and Data Busses.

3-13

VBB

HOLD

VCC
WAIT

MeMEN

mAo

We

READY
CRUCLK

HOLDA

REsET

VCC

IAQ
4>1
A14
A13

013

A12

012

A11

011

A10

010

A9

09

A8

08
07

A7
A6

06
05

A5

(MSB)

(LSB)

015
014

4>2
(LSB)

A4
A3
A2

04
03

A1
AO

01

cI>4

Vss

02

00

(MSB)

Vss
VOO
4>3
DBIN

ICO

CRUOUT
CRUIN

IC1
IC2

iNTREa

IC3

Pin Name

Description

Type

AO - A14
DO - 015
4>1.4>2.4>3. <1>4

Address Bus
Data Bus
Clock Signals
Memory Enable
Instruction Fetch
Data Bus In
Write Enable
Memory Ready
Wait State Indicator
I/O Clock
Serial I/O Out
Serial I/O In
Interrupt Request
Interrupt Code
DMA Request
Hold Acknowledge
Load Interrupt
Reset
Power and Ground reference

Tristate.
Tristate.
Input
Tristate.
Output
Tristate.
Tristate.
Input
Output
Output
Output
Input
Input
Input
Input
Output
Input
Input

MEMEN
IAQ
DBIN
WE
READY
WAIT
CRUCLK
CRUOUT
CRUIN

iN'i'Rffi
ICO - IC3
HOLD
HOLDA

LOAD
RESET
VBB. Vee. VDD. Vss

(MSB)

(LSB)

output
bidirectional
output
output
output

Figure 3-2. TMS 9900 Signals and Pin Assignments

3-14

Pins AO - A 14 provide the 15-bit Address Bus. Note that Texas Instruments' literature numbers bits and pins
from left to right; therefore, address line AO represents the most significant address bit, where as address line
A 14 represents the least significant address bit.
DO - 015 provide a 16-bit bidirectional Data Bus. Once again. DO represents the most significant data bit in Texas
Instruments' literature.
Remaining signals may be divided into bus control, interrupt control, and timing.

External logic must provide four clock signals, cp1, <1>2, cp3, and <1>4. These are provided by the TIM 9904. described
later in this chapter.
Any memory access operation begins with an address being output via the Address Bus. The TMS 9900 CPU identifies a stable address on the Address Bus by outputting MEMEN low.

If the memory access operation is an instruction fetch, the IAQ is output high.
If the memory access is a read, then the TMS 9900 outputs a high level via DBIN. Memory interface logic must interpret the high DBIN level as a signal to place data on the Data Bus.
If the memory access is a memory write, then the TMS 9900 CPU outputs a low pulse via WE. Memory interface
logic must use the low WE pulse to signal that valid data is on the Data Bus. and to store it in the addressed memory
location. WE low does not last as long as DBIN high.
When external logic cannot respond to a memory access in the available time, it requests a Wait state by inputting READY low. The CPU acknowledges by outputting WAIT high.
CRUCLK, CRUIN, and CRUOUT are three signals used to implement single-bit or serial data transfers via the
CRU interface.
CRUOUT is used to output bits of data to the I/O devices. and CRUIN is used to retrieve input data from the I/O devices.
CRUCLK is active during output operations only. and defines when data bits on CRUOUT are valid.

Let us now look at interrupt control signals.
There is a single interrupt request input, INTREQ, which must be held low by any external device requesting an
interrupt. External devices identify themselves via control signals ICO - IC3. Thus. an interrupt request must be
accompanied by the appropriate input at ICO - IC3.
Observe that there is no interrupt acknowledge signal.

For DMA operations, external logic requests access to the System Bus by inputting HOLD low. The CPU
acknowledges the Hold request by outputting HOL'DA high.
LOAD is a nonmaskable interrupt.
RESET is a typical system Reset signal. However. TMS 9900 Reset logic uses the device's interrupt capabilities;
therefore. we will describe the Reset operation in detail when discussing TMS 9900 interrupt capabilities in general.

TMS 9900 TIMING AND INSTRUCTION EXECUTION
TMS instructions execute as a sequence of machine cycles, each of which contains two clock periods. Clock
periods are timed by four clock signals, cp1, cp2, <1>3, and cp4, as illustrated in Figure 3-3. Note that <1>2 is the first
phase of each clock period. and that <1>1 is the last phase.
The simplest instruction execution machine cycle is an internal operations cycle. No external
bus signals are active during this machine cycle. and no memory or I/O access occurs. Timing for
an internal operations machine cycle will consist of two clock periods, as illustrated in
Figure 3-3.

TMS 9900
INTERNAL
OPERATIONS
MACHINE
CYCLE

MEMORY ACCESS OPERATIONS
TMS 9900 memory access operations may consist of a memory read or a memory write. An instruction fetch is
a minor variation of a memory read.
Figure 3-4 illustrates memory read machine cycle timing.
MEMEN goes low at the beginning of any memory access machine cycle and stays low for the entire machine cycle.

3-15

a..~"'---CLOCK

I

I.....

PERIOD 1 - - -.......... t-----CLOCK PERIOD 2 - - -.....1

OSC

cf>2

cf>3

--------------~

cf>4

Figure 3-3. TMS 9900 Clock Periods and Timing Signals as
Generated by the TIM 9904

ONE MACHINE CYCLE

I

CLOCK PERIOD 1

~

CLOCK PERIOD 2

I

cf>1

cp3

---tt-

oJ

CP4

--+I+----.J

MEMEN

DBIN

AO-A14

00-015

ADDRESS OUT

INPUT MODE

INPUT MODE
CPU READS DATA

Figure 3-4. A TMS 9900 Memory Read Machine Cycle

3-16

DBIN goes high at the beginning of the memory read machine cycle and stays high for the entire machine cycle. External logic can therefore use fVi'E'MEiij low as a memory address indicator while DBIN high identifies the read operation.
A memory address is output stable on the Address Bus for the entire machine cycle.

a

The Data Bus operations during memory read machine cycle represent the only unusual characteristics of the
machine cycle. Input data needs to be stable during the <1>1 high pulse of the second clock period. However. the Data
Bus is connected to input logic for the entire memory read machine cycle and for a portion of the next machine cycle.
Thus. during a memory read machine cycle. external logic cannot access the Data Bus to perform direct memory access. or any other operations. on the assumption that the Data Bus is free until Data I n becomes stable. Moreover. since
the Data Busis held by data input logic of the CPU during the next machine cycle. a memory read machine cycle cannot be followed by a memory write machine cycle. A memory read machine cycle must be followed by an internal
operations machine cycle. or by another memory read machine cycle,
The only difference between an instruction fetch machine cycle and a memory read machine cycle is the fact that during an instruction fetch machine cycle. IAQ is output high. along with DBIN. for the duration of the machine cycle .

....I - - - - - - - - - O N E MACH I NE CYCLE --------~

CLOCK PERIOD 1

CLOCK PERIOO 2

cp1

cp2

CP3 ___-+_.1
cp4

____

~--------J

MEMEN

WE

AO-A14

ADDRESS OUT

00-015

OATA OUT

----~--------------------------------------------~~----~
Figure 3-5.

A TMS 9900 Memory Write Machine Cycle

Memory write machine cycle timing is illustrated in Figure 3-6, In this illustration. we see that data is output stable on the Data Bus for the entire duration of the memory write machine cycle. The Data Bus is not held by output logic
beyond this single machine cycle. Thus. no restrictions are placed on the type of machine cycle which can follow a
memory write machine cycle. Even though data output is stable for the entire memory write machine cycle. the write

3-17

enable strobe WE does not go low until close to the end of the first clock period. In many cases it is easier to use NOT
DBIN as a write control signal. Here is the necessary logic:
WRITE

DBIN

READ

TMS 9900 instruction execution machine cycle sequences are not always self-evident; therefore, let us look at
some memory reference examples.
Memory address computations make machine cycle sequences quite complex. particularly for two-operand instructions. Fortunately. the exact machine cycle sequences are rarely of any consequence to you as a programmer or logic
designer. The eventual number of machine cycles required to execute an instruction (and therefore its execution time)
is important.
Generally stated. instruction execution proceeds as follows:
1)

The instruction object code is fetched.

2)
3)

The first operand address is computed.
The second operand address (if there is one) is computed.

4)
5)

Any operation that may be required is performed.
If a result is generated. it is returned to the second operand address.

TMS 9900
INSTRUCTION
EXECUTION
SEQUENCES

Let us look at operand address computations using the ADD instruction (A) as a general example. First consider the instruction in its simplest form - where the contents of one reg ister are added to the contents of another register:
A
Cycle
1
2
3
4

5
6

7

Type
MEMORY
ALU
MEMORY
ALU
MEMORY
ALU
MEMORY

READ
READ
READ
WRITE

Figure
3-4
3-3
3-4
3-3
3-4
3-3
3-9

R1.R2
Function
Fetch instruction object code
Decode instruction
Fetch R1 contents
Fetch R2 contents
Add R1 and R2 contents
Store sum in R2

Now consider the same instruction's execution. but using implied memory addressing for the first operand:
A
Cycle
1

2
3
4

5
6

7
8

9

Type
MEMORY
ALU
MEMORY
ALU
MEMORY
ALU
MEMORY
ALU
MEMORY

READ
READ
READ
READ

Figure
3-4
3-3
3-4
3-3
3-4
3-3
3-4

3-3
WRITE

3-5

*R1.R2
Function
Fetch instruction object code
Decode instruction
Fetch R1 contents
Use R1 contents as a memory address (implied addressing)
Fetch contents of implied address location
Fetch R2 contents
Add data fetched in cycles 5 and 7
Store sum in R2

3-18

If the second (destination) operand uses direct addressing. here is the machine cycle sequence:
A
Cycle
1
2
3

4
5
6.7.8
9
10
11
12
13

Type
MEMORY
ALU
MEMORY
ALU
MEMORY
ALU
MEMORY
ALU
MEMORY
ALU
MEMORY

Figure
READ
3-4
3-3
READ
3-4
3-3
READ
3-4
3-3
READ
3-4
3-3
READ
3-4
3-3
WRITE 3-5

*R1.@LABEL
Function
Fetch instruction object code
Decode instruction
Fetch R1 contents
Use R1 contents as a memory address
Fetch contents of implied address location
Fetch the second instruction object code word; it holds the direct address
Fetch contents of directly addressed memory word
Add words fetched in cycles 5 and 11
Store sum in directly addressed memory word

Indexed. direct addressing results in the following sequence:
A
Cycle
1
2
3

4
5

6
7
8
9
10
11
12
13

Type
MEMORY
ALU
MEMORY
ALU
MEMORY
ALU
MEMORY
ALU
MEMORY
ALU
MEMORY
ALU
MEMORY

READ

Figure
3-4
3-3

READ

3-4

READ

3-3
3-4

READ

3-4

*R1.@LABEL(5)
Function
Fetch instruction object code
Decode instruction
Fetch R1 contents
Use R1 contents as a memory address
Fetch contents of implied address location

3-3
Fetch the second instruction object code word; it holds the direct address

3-3
READ

3-4

3-3
READ

3-4

3-3
WRITE

3-5

Fetch R5. the Index register contents
Add direct address and index
Fetch contents of memory word addressed by cycle 10 addition
Add memory words fetched in cycles 5 and 11
Store sum in memory word addressed by cycle 10 addition

If the first operand-implied address specified an auto-increment. we must add one more machine cycle:
A
Cycle

1
2
3
4

5
6
7

8
9
10
11
12
13
14

Type
MEMORY
ALU
MEMORY
ALU
MEMORY
MEMORY
ALU
MEMORY
ALU
MEMORY
ALU
MEMORY
ALU
MEMORY

READ
READ

Figure
3-4
3-3
3-4

3-3
WRITE
READ
READ

3-5
3-4
3-3
3-4

*R1 +.@LABEL(5)
Function
Fetch instruction object code
Decode instruction
Fetch R1 contents
Increment fetched R1 contents
Write incremented R1 contents back to R1
Fetch contents of implied address location
Fetch the second instruction object code word; it holds the direct address

3-3
READ

3-4
3-3

READ

3-4
3-3

WRITE

3-5

Fetch R5. the Index register contents
Add direct address and index
Fetch contents of memory word addressed by cycle 11 addition
Add memory words fetched in cycles 5 and 12
Store sum in memory word addressed by cycle 11 addition

MEMORY SELECT LOGIC
MEMEN discriminates between memory and 1/0 accesses. It is therefore very important that MEMEN low be a
necessary component for any memory select.
You can map 1/0 into the memory space of the TMS 9900. This is true of any microprocessor. Memory addresses that
select 1/0 devices will. of course. also require l\ii'E'MEN low as a contributor to I/O device select logic.

3-19

MEMEN as a contributor to select logic may be illustrated as follows:

1__

-

~
~

CRU
SELECT
LOGIC

~~

..

··
·-..

j~

..
·• --

,
0_

SELECT TRUE ONLY IF
MEMEN IS HIGH AND
A12-A14 ARE 000

..-

MEMEN
AO

(LSB)

A11
A12

11.14

(MSB)

r

MEMORY
AND
MEMORY
MAPPED
I/O SELECT
LOGIC

··--··
··..

SELECT TRUE
ONLY IF

MEMEN
IS LOW

The three high-order address lines. A 12. A 13. and A 14. are not used to address CRU bits. When addressing a CRU bit.
these lines are all low. They are not low during execution of externally defined I/O instructions; therefore. A 12. A 13.
and A 14 low must be a prerequisite for any CRU bit select.

TMS 9900 I/O INSTRUCTION TIMING
All TMS 9900 I/O instructions transfer serial data via the Communication Register Unit (CRU). (This excludes I/O which
is addressed as TMS 9900 memory space.)

There are four types of TMS 9900 I/O instructions. They are:
1)

Data input. Anywhere from 1 to 16 bits of data may be transferred from the CRU bit field to memory.

2)

Data output. This is the simple reverse of data input. Anywhere from 1 to 16 bits of data may be output from
.
memory to the CRU bit field.

3)

Bit test. Any bit in the CRU bit field may be tested. The tested bit is input and stored in the Equal bit of the Status
register. Thence. condition branch instructions can be used to test the bit level.

4)

Externally defined I/O in8tructions~ These instructions generate I/O control signals. but they transfer no data.

Timing for CRU output and input machine cycles is illustrated in Figures 3-6 and 3-7, respectively. Each of
these figures shows two bits of data being transferred. (You should not attach any special significance to this fact; depending on the instruction being executed. anywhere from 1 to 16 bits may be transferred.) CRU machine cycles are
executed contiguously. one per bit.

Every CRU 1/0 instruction will require a memory reference machine cycle. together with one or more CRU machine cycles. For example. when an STCR instruction is executed to input data from the CRU to the CPU. the following
machine cycle sequence will occur:
Cycle

Type

2

Figure

Function

MEMORY READ

3-4

Fetch I nstruction Code

ALU

3-3

Decode Instruction

}

a Cycles, where 0 ~ a ~ 4

Obtain Destination Address

3+a

MEMORY READ

3-4

4+a

ALU

3-3

5+a

MEMORY READ

3-4

Fetch R12

6+a
7+a

ALU
ALU

3-3

Compute CRU Starting Address and Prepare
Control Signals

i Cycles

CRU IN

3-7

8+a + i
9+a + i

ALU
ALU

3-3

Fetch Destination Memory Word Contents

}

Load CRU Bits in Tempprary Register

}

r Cycles

Input i CRU Bits

Fill Upper Bits of Byte or Word With Zeroes
If i >8, r = 15 - i; if i ~ 8, r = 7 - i

10 + a + i + r to
12+a+i+r

ALU

3-3

Prepare to Store Memory Word

13+a+i+i'

MEMORY WRITE

3-5

Output Assembled Word to Memory Location Whose
Contents Were Fetched in Machine Cycle 3 + a

r M A C H I N E CYCLE'

1CLOCK PERIOD

'I

CLOCK PERIOO 2

MACHINE CYCLE 2 - - 1

CLOCK PERIOO ,

1CLOCK.PERIOD21

1 cJ>2 cJ>3 ---to-' cJ>4 AO-A14 CRUIN CRU READS BIT CRU READS BIT Figure 3-7. Two TMS 9900 Input-from-CRU Machine Cycles An LDCR instruction outputs a sequence of 1 to 16 data bits to a CRU bit field. Here is the LDCR instruction machine cycle sequence: Cycle 1 2 Type MEMORY READ ALU a Cycles where 0~a~4 3+a MEMORY READ 4+a to ALU 7+a 8+a MEMORY READ 9+a ALU i Cycles CRU OUT 10+a+i ALU Figure 3-4 3-3 3-4 Function Fetch instruction object code Decode instruction Obtain sou rce address Fetch source memory word contents 3-3 Prepare for data transmission 3-4 3-3 3-6} 3-3 Fetch R12 Compute CRU starting address Output i bits to CRU Machine cycle to conclude instruction } The SBO and SBZ instructions set or reset an addressed CRU bit; in essence. these instructions output one data bit. Here is the machine cycle sequence via which the bit output occurs: Cycle 1 2 3 4 5 6 Type MEMORY READ ALU ALU MEMORY READ ALU CRU OUT Figure 3-4 3-3 3-3 3-4 3-3 3-6 Function Fetch instruction object code Decode instruction Decode instruction Fetch R12 Compute CRU address Output to addressed CRU bit The TB instruction inputs one CRU bit; its timing is identical to the SBO and SBZ instructions. except that machine cycle 6 is a CRU IN machine cycle. 3-22 The Address Bus is used in an unusual way during a CRU machine cycle. As we have already stated, the CRU bit field is 4096 bits wide - addressed by 12 of the 15 Address Bus lines. The three high-order Address Bus lines are used to identify I/O control instructions, as defined in Table 3-1. We can conclude from Table 3-1 that when MEMEN is high and the three high-order Address Bus lines are all low, an I/O transfer is occurring. Otherwise, one of five externally defined I/O control instructions is being executed. There are dedicated functions for these five I/O controls in TM 990 minicomputer systems; these are shown in Table 3-1. But to anyone who is simply building a microcomputer system around a TMS 9900, these five I/O states are undefined. Thus, Figure 3-8 illustrates TMS 9900 systems' bus utilization during both CRU operations and externally defined 1/0 operations. If CRU SEL and MEMEN are high, CRU Select logic will be active. Externally defined instructions output 0 on the 12 low-order Address Bus lines, AO - A 11; in addition, CRUCLK pulses are output as part of the instruction executions. CRUCLK is an active CRU output strobe only. This Signal pulses high whenever a valid level is present on the CRUOUT Signal line. There is no pulse for CRUIN. External logic must generate its own strobe if it is needed, by combining MEMEN high with a valid bit pattern on the Address Bus. CRU instructions that test the level of a bit are, to external logic. no different from CRU input instructions. External logic is required to return. via CRUIN the level of the selected bit The fact that the CPU interprets this input as status, rather than data, is immaterial to external logic. THE WAIT STATE Additional Wait State clock periods may be inserted between clock periods 1 and 2 of any memory access machine cycle. Timing is illustrated in Figure 3-9. At the rising edge of <1>1 of clock period 1, the CPU samples the READY input signal. If this signal is low, then the next clock period is a Wait clock period. During a Wait cycle, the WAIT output signal is high; all other output signals hold the levels they had during clock period 1. A Wait State can last for any number of clock periods. During the ct>1 high pulse of every Wait clock period, the CPU samples the level of the READY input As soon as READY is sampled high, the Wait State ends. The next clock period becomes clock period 2 of the machine cycle, and the memory operation is completed. Table 3-1. High-Order Address Bus Line Used by TMS 9900 I/O Instructions Instruction Mnemonic LDCR SBO SBZ STCR TB IDLE RSET CKOF CKON LREX Instruction Type Output Output Output Input Test (Input) Control Control Control Control Control A14 0 0 0 0 0 0 0 1 1 1 (MSB) A13 A12 0 0 0 0 0 1 1 0 1 1 3-23 0 0 0 0 0 0 1 1 0 1 Function Output data to CRU Set CRU bit to 1 Reset CRU bit to 0 Input data from CRU Input CRU bit to Equal status bit Enter HALT condition Reset the Interrupt mask Real time clock on These are Real time clock off TM 990 uses. Execute bootstrap Instructions are undefined in a TMS 9900 system. I I -.. .. -- . :: - - 7 6 ~ :: 5 4 3 2 -- ~ ~ - 1 01""- A14 A13 A12 A11 AO CRUCL.K CRUOUT CRUIN MEMEN LREX CKON CKOF UNUSED RSET HALT UNUSED CRU SEL t --• ••• CRU SELECT LOGIC CRU SELECT SIGNALS ... - If CRU SEL and "M'EiVi'EN are high, CRU Select logic will be active. Figure 3-8. TMS 9900 System Bus Utilization During I/O Operations ....t----------- ONE MACHINE CYCLE CLOCK PERIOD 1 I WAIT CLOCK PERIOD I WAIT CLOCK PERIOD ¢1 ¢2 ¢3 _ _ _-, ¢4 _ _ _ _....J READY WAIT Figure 3-9. The TMS 9900 Wait State 3-24 -------------t~ CLOCK PERIOD 2 THE HOLD STATE The TMS 9900 has a typical microcomputer Hold State, used to enable direct memory access operations. External logic initiates a Hold State by inputting FK>m low. At the beginning of the next non-memory reference machine cycle. the CPU floats its Address and Data Busses. together with the DBIN. 'M"tMm and wt control signals. HOLDA is output high as a Hold Acknowledge. Timing is illustrated in Figure 3-10. (NON-MEMORY ICLO~~~~~IOD 'I q,1 \ HOLO n. ._- HOLO I CLOCK PERIOO' I rill}..oJ q,3 --+~ HOLOA ---~~------ 00-015 AO-A14, WE, MEMEN,DBIN } _-"_'" --- -------~~--------- ~------------~ Figure 3-10. TMS 9900 Hold State Timing The Hold State lasts until external logic raises HOLD high again. It is up to external logic to perform all operations associated with a DMA transfer. The CPU simply floats the System Bus in response to a Hold request. The only nonobvious aspect of Figure 3-10 is the fact that Data Bus timing, during normal instruction execution. differs from other System Bus signal timing. Figure 3-10 highlights this fact by showing the Data Bus floating at the beginning of the first HOLD clock period. while other signals float earlier in the preceding clock period. This is not a particularly significant event. The entire System Bus is floating once the HOLD clock period has begun. However. the actual tristate condition for any signal begins at that point in the preceding clock period when the signal is no longer being driven by current operations. THE HALT STATE The TMS 9900 IDLE I/O instruction generates a Halt State. When this instruction is executed. the CPU suspends all program ~ion and internal operations. You must terminate the Idle condition with an interrupt request or a low LOAD or RESET input. (['(5Ai) and RESET are treated as interrupts as we will describe soon.) The TMS 9900 CPU does not relinquish the System Bus while halted. That is to say. after an IDLE instruction has been executed. no System Bus lines are floated. 3-25 The IDLE instruction is usually executed when program logic requires that the CPU wait for an interrupt. or when external logic is computing a real-time interval - which will be terminated with an interrupt request. You can, if you wish, initiate a DMA transfer by executing an IDLE instruction. In order to do this, you must create a HOLD request from the Address Bus output characteristic of the IDLE instruction's execution. This may be illustrated as follows: --.. A14 A13 A12 A14 (MSB) ~13 A12 :: CRUCLK - CRUCLK C) + 5V .~ :~ I PRE - ---0 D "-- i'""\ Q ~ Q ~ CK "~ 7474 HOLD erR t HOLD END HOLD - ~ HOLDA ------------------------------------------------------~~.. HOLDA As illustrated above, the combination of 010 on the three high-order Address Bus lines, along with the CRUCLK pulse, identifies the IDLE instruction. Since the process of floating the System Bus will remove the conditions which generated a Hold request. these conditions are used to clock a flip-flop. Thus, external logic which receives the Hold acknowledge signal and takes control of the System Bus must subsequently reset the Hold request flip-flop in order to remove the Hold condition. That is to say, program logic can begin a Hold state within a Halt state, but it cannot end this combination. Two steps are needed to terminate a Hold within a Halt. The Hold request must be removed, then an interrupt request must follow to terminate the Halt. TMS 9900 INTERRUPT PROCESSING LOGIC The TMS 9900 has complex and capable interrupt processing logic. Sixteen levels of external interrupt are available. Sixteen software interrupts are also available. Fifteen of the sixteen external interrupts are maskable; the nonmaskable interrupt has highest priority and is the system Reset interrupt. There is, in addition, a non-maskable Load interrupt. External interrupts may be summarized as follows: Lc5AD RESET Maskable Levels of External Interrupt Priority Priority Priority Priority Priority Priority Priority Priority Priority Priority Priority Priority Priority Priority Priority Priority 0 } Non-maskable, Equal Highest Priority Interrupts 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3-26 Lowest Priority Interrupt External logic identifies the priority of its interrupt request via the ICO. IC1. IC2. and IC3 inputs. as follows: ICO IC1 IC2 IC3 o o o o o o o o 0 0 0 0 1 1 1 1 o o 0 1 1 0 1 3 0 4 1 0 1 5 1 1 1 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 1 o o 1 1 1 1 1 1 1 o o o o 1 0 1 0 1 Priority Should not be input by external logic - highest external 1 2 6 7 8 9 10 11 12 13 14 15 lowest external Software interrupts are executed via the XOP instruction. There are, in addition, instructions that parallel the RESET and LOAD interrupts. We will describe these instructions in due course. Each one of the external interrupts has two dedicated memory words via which vectoring is TMS 9900 enabled following an interrupt acknowledge. Figure 3-11 illustrates the memory map assoINTERRUPT ciated with interrupt vectoring. The memory addresses in Figure 3-11 are byte addresses as VECTOR MAP seen by the programmer. Remember. the low-order bit of the address shown in Figure 3-11 is not output on the Address Bus; therefore. you must divide the memory addresses shown in Figure 3-11 by 2 in order to generate the address which will be seen by external memory. The memory words dedicated to interrupt vectoring. as illustrated in Figure 3-11 . can be read-only memory. read/write memory, or any combination of the two. Obviously, read-only memory will be used in applications that have dedicated interrupt service routines for specific interrupt requests. Read/write memory might be used in minicomputer-type applications where the interrupt response will depend on the application being serviced. Interrupt masking and priorities apply only to external interrupt requests. Interrupt masking priorities cannot be applied to software interrupts (the XOP instruction). Since program logic must generate the software interrupt program logic can equally be relied on to know which software interrupt is to be executed, and whether the software interrupt is allowed by current program logic. That is to say, from the programmer's viewpoint a software interrupt is simply the consequence of an XOP instruction's execution; you, as a programmer. can include an XOP instruction anywhere in a program. within or outside an interrupt service routine. XOP instructions might be used in response to error conditions, or to call any frequently used subroutines. Let us begin by looking at the way in which external interrupts are processed. Any external device wishing to request an interrupt must pull the INTREQ input low while simultaneously placing a 4-bit code at the ICO - IC3 inputs. The CPU will acknowledge the interrupt, provided that its priority, as identified by the ICO - IC3 inputs, is enabled. The interrupt will be acknowledged at the conclusion of the currently executing instruction. The BLWP and XOP instructions are exceptions; for the integrity of program logic, they demand that the next sequential instruction be executed. Therefore, ifan interrupt request occurs while either of these two instructions is being executed, the interrupt will not be acknowledged until this instruction and the next instruction have been executed. 3-27 MEMORY MEMORY WORD CONTENT ADDRESS,. AREA DEFlNmoN 0000 WP LEVEL 0 INTERRUPT 0002 PC LEVEL 0 INTERRUPT 0004 WP LEVEL 1 INTERRUPT 0006 PC 003C WP LEVEL 15 INTERRUPT 003E PC LEVEL 15 INTERRUPT 0040 WP XOPO 0042 PC XOP 0 LEVE~ 1 INTERRUPT NTERRUPT VECTORS XOP SOFTWARE TRAP VECTORS I 007C WP XOP 15 007E PC XOP 15 0080 ·•• GENERAL MEMORY AREA MAY BE ANY GENERAL MEMORY FOR COMBINATION OF ~.DATA.AND PROGRAM SPACE OR WORKSPACE WORKSPACE REGISTERS •• • FFFC WP LOAD FUNCTION FFFE PC LOAD FUNCTION Figure 3-11. TMS 9900 Memory Map When an Interrupt Is acknowledged, the following machine cycles are executed: Cycle 1 2 3 4 5 6 7 8 9 10 11 Type ALU MEMORY ALU MEMORY ALU MEMORY ALU MEMORY ALU MEMORY ALU Figure 3-3 READ 3-4 3-3 WRITE 3-5 3-3 WRITE 3-5 3-3 WRITE 3-5 3-3 READ 3-4 3-3 Function Move new WP register contents from vector word to temporary storage Store status in new R15 Store ICO - IC3 levels in four low-order Status bits Store incremented PC in new R14 Store old WP register contents in new R13 Fetch new PC contents from vector word Fetch new WP contents from temporary storage Vector words are illustrated in Figure 3-11. 3-28 TMS 9900 At the conclusion of the interrupt acknowledge sequence listed above. the priority of the NESTED acknowledged interrupt request. less one. is recorded in the four low-order Status register bits. INTERRUPT Thus. subsequent interrupt requests will be acknowledged only if their priority is higher than that PRIORITIES of the interrupt being serviced. That is to say. whenever an interrupt request occurs. CPU logic compares the levels input at ICO - IC3 with the levels present in the four low-order Status register bits. If ICO - IC3 is not greater than the mask. then the interrupt request will be acknowledged. If ICO - IC3 is higher. then the interrupt request will not be acknowledged. Thus. In the normal course of events. TMS 9900 interrupt priority logic disables all interrupts of equal or lower priority than an acknowledged interrupt. while leaving higher priority interrupts enabled. Priorities are maintained for the duration of the interru~t service routine. This is illustrated in the following figure. which you should read in the sequence @- ® -® -© - o Int."upts whh ~ 5 ® -® -® : 11 priorities 5,8 and 11~~ / - - , occur simultaneously / \1(3\ ® ., Interru!'t ~Ith, PriOrity 5 , acknowledged / // / / \\:::Y Interrupt 7. having highest priority of three pending interrupts (7,8 and 11) will immediately be acknowledged Main Program @ Interrupt with priority 7 occurs and is denied Interrupt service routine 5 completes execution @ I nterrupt service routine 2 executes The interrupt priority arbitration logic of the TMS 9900 is exceptional among microcomputers. Most microcomputers arbitrate priorities at the instant interrupts are being acknowledged. and once an interrupt has been acknowledged. all interrupts are disabled. That is to say. interrupt priorities apply only during the acknowledge process. In contrast. the TMS 9900 maintains interrupt priorities for the duration of the interrupt service routine. as illustrated above. The net effect of the interrupt response steps illustrated above is to perform a context switch while disabling all interrupts that have the same priority as the acknowledged interrupt. or that have a lower priority.' There are some very important and nonobvious advantages to initiating an interrupt service routine with a context switch. Since the 16 new memory locations that will be used as general purpose registers may lie anywhere in read/write memory. you can store parameters that will be used by the interrupt service routine. in advance of the interrupt. in those memory locations that are ultimately to serve as general purpose registers for the duration of the interrupt service routine. You can. if you wish. modify the interrupt priority scheme that will control nested interrupts. As we have already stated. if you do nothing about interrupt priorities. then any interrupt service routine may be interrupted by a higher priority external interrupt. but not by an external interrupt that has the same priority or a lower priority. If you wish to eliminate nested interrupts entirely. then the first instruction executed within an interrupt service routine must be an LlMI 0 instruction (Load Interrupt Mask Immediate). which clears the four low-order Status register bits. thus disabling all maskable interrupts. A RESET or LOAD interrupt - or a level a external interrupt request - will still be acknowledged; these should be alarm conditions and not part of the normal interrupt logiC of any microcomputer. You can execute variations of the LlMI instruction to increase or decrease the levels of priority that will be masked for the duration of any interrupt service routine (or for that matter. any subsequent instruction within the interrupt service routine) can load appropriate data into the four low-order bits of the Status register. thus changing the priority level at which all subsequent interrupt requests will be disabled. 3-29 All interrupt service routines should end with an RTWP (Return Workspace Pointer) instruction. The RTWP instruction performs a reverse context switch. which puts the central processing unit back to the logical environment which was interrupted. Observe that since the Status register is also saved during a forward context switch. the return instruction will restore whatever level of interrupt priorities existed at the instant the interrupt was acknowledged. You can. of course. modify the contents of General Purpose Registers R13. R14. and R15 in the course of an interrupt service routine's execution. This allows program logic to alter the conditions that will be restored when the return instruction executes a reverse context switch. The TMS 9901 PSI, which we describe later in this chapter, provides multiple interrupt handling for TMS 9900 series CPUs. If your system does not include a TMS 9901, then external hardware required to support multiple interrupts in a TMS 9900 microcomputer system will not be as straightforward as the software response. First of all. we must cope with the fact that if more than one interrupt request occurs TMS 9900 simultaneously. then there will be competition on the INTREO input. but there will also be MULTIPLE competition at the four priority inputs. ICO - IC3. Resolving competition on the·INTREQ input is INTERRUPT no problem; you can wire-OR interrupt requests from many devices to create the CPU input. HARDWARE But your external logic must make sure that only the highest priority combination of ICO - IC3 CONSIDERATIONS appears at the TMS 9900 inputs. One method of doing this is to use latched decoders that create a 4-bit output corresponding to the highest level input. provided that the decoder is enabled by a latching signal. This may be illustrated functionally as follows: ( +5V 9900 - INTREQ I, TMS - _ACO ENABLE - - *u .... - i i i<1) *n .... - ~) if (HI GHEST PRIORITY) INT 1 -::. AC1 AC2 ~~ > -: DECODER _AC3 -= -- INT 15 (L OWEST PRIORITY) In the illustration above. 15 external interrupt requests are input to a decoder. These interrupt requests are high true. The 15 interrupt requests are buffered. inverted. and wire-ORed to create the master interrupt request INTREO. which is input to the CPU. This master interrupt request also enables the decoder. That is to say. when the enable input to the 3-30 decoder is high, the four outputs, ICO - IC3 will be low. When the enable input to the decoder is low, ICO - IC3 will output a 4-bit value as follows: o .... U U C"I (") U U ~ o 0 0 0 o o o 0 o 000 o 0 o o o o o W ~ 00 o .... m.... N (") It) ~ ~ ~ ~ ~ ~ ~ ~ * * * * * * * * * * * * * * * 0 T * * * * * * * * * * * * * * * * * * * * * o 0 * * 000 * 0 o o 'It ~ o o 0 (") ~ ~ ~ .... 'It It) ~ ~ z z z z z z z z z z z z z z z o 0 0 0 0 0 0 0 0 0 0 0 0 0 0 000 o o o C"I 0 o o o 0 0 0 0 000 o o o o o o 0 0 0 0 0 0 0 000 0 0 000 000 0 0 0 0 0 0 0 0 000 0 ~ 0 0 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 000 0 000 * REPRESENTS A "DON'T CARE" BIT * * * * * * * * * * * * * * * * * * * * * * * * 0 0 * * * * * * * * * * * * * * * * 0 0 0 * * * * * * * 000 * * 0 0 0 0 * 0 0 0 000 0 0 0 0 0 * * * * * * * * * * * 0 * * * * * 0 If you do not use the TMS 9901, Texas Instruments suggests the following circuit to accomplish priority encoding: +5V u -- ..L ~ - ..- ,.. EI GS A2 7 ..... 6 ..... 74148 Ioiio.. __ (TIM A1 --- 9907) .... ~ .: iNTi • (HIGHEST PRIORITY) • • - AO EO , TMS ICO 9900 ) EI ~ GS IC1 IC2 7 ~ ~ "'" ~.- (TIM ~ Ica A2 =-- - • • INT 15 (LOWEST PRIORITY) External logic must maintain its interrupt request until it receives its own specific interrupt acknowledge. This need is obvious, since an interrupt request may be denied for a long time while higher priority interrupts are being serviced. The problem is that the TMS 9900 has no interrupt acknowledge signals. Interrupt acknowledge signals can be generated in one of two ways: 1) By using CRU bit instructions to set and reset external flip-flops that create interrupt acknowledge signals. 2) By decoding appropriate addresses on the Address Bus Figure 3-12 illustrates two possible configurations that will allow CRU bit set and reset instructions to generate interrupt acknowledge signals. The logic in Figure 3-12A generates a short interrupt acknowledge pulse. CRUOUT becomes the input to a flip-flop which is decoded to generate CRU select signals. The CRU bit select and "M'E'M'E'N are gated to the flip-flop's Clear input. Therefore, when CRU bit "n" is selected, CLR is removed and CRUOUT can be clocked through. A set bit (SBO) instruction switches the flip-flop on. As soon as the flip-flop address is removed at the end of the CRU I/O machine cycle, the flip-flop is cleared, thus terminating the interrupt acknowledge pulse. The logic illustrated in Figure 3-12A requires that you execute an SBO instruction at the beginning of every interrupt service routine in order to generate an interrupt acknowledge. You could require every interrupt service routine to control the length of the interrupt acknowledge pulse by executing an SBZ instruction to terminate the pulse. Figure 3-12B shows logic to implement this scheme. When the flip-flop is selected by the appropriate CRU address, CRUCLK will clock CRUOUT to INT ACK n. At other times, CRUCLK will merely clock the flip-flop's output through, thus making no change. In this way, only SBO and SBZ instructions which address INT ACK n can set or reset the flip-flop. Figure 3-13 illustrates generation of an interrupt acknowledge signal by identifying specific addresses on the Address Bus. Following any interrupt acknowledge, specific memory locations will be accessed, as identified in Figure 3-11 ,in order to fetch the new values for the Program Counter and WP register. Figure 3-13 shows a very simple scheme whereby Address Bus lines are combined with MEMEN low to generate high pulses for the duration of a valid address. That is to say, the interrupt acknowledge signal will last for one machine cycle - the time that the valid address exists on the Address Bus. External logic which requested an interrupt removes its interrupt request and priority signals upon receiving an interrupt acknowledge. 3-32 .. .. A14 A13 A12 A11 : AD - ;;., AO (LSB) T 'M"EMEN CRU ADDR .... ~ ~ · .... t CRUBIT ADDRESS DECODE A14 (MSB) A13 A12 A~1 i\.1'EM'"Erij 9 + 5V .. ~ n SELECT :: ..- PRE - CRUOUT . CRUCLK 0 D INT ACK n CK. 7474 Q CLR bJ A) Logic to create a short I NT ACK n pulse -a n SE LECT - - - 4..... r---------t-~ D Ot-....- _.. INT ACK n r-------~~>CK +5V. CRUOUT CRUCLK B) Logic to have a programmed INT ACK n pulse length' Figure 3-12. A14 A5 A4 A1 MEi\iiEN A TMS 9900 Interrupt Acknowledge Pulse Generated Using an SSO Instruction ·•·•-l- ···· · • .- I, .... r .. A5 A4 A1 i\.1'EM'"Erij .............. Y .00000000 INTERRUPT n SELECT LOGIC I A14 INTERRUPT ADDRESS n SELECT !...J -.. INT ACK n Figure 3-13. TMS 9900 Interrupt Acknowledge Generated by Decoding Valid Addresses 3-33 THE TMS 9900 RESET You reset the 9900 microcomputer system by inputting a low RESET signal. This signal must remain low for at least 3 clock periods. When the low RESET signal is removed, the following machine cycle sequence is executed: Cycle 1 2 3 4 5 6 7 8 9 10 11 12 13 Type ALU ALU ALU MEMORY READ ALU MEMORY ALU MEMORY ALU MEMORY ALU MEMORY ALU Figure 3-3 3-3 3-3 3-4 3-3 3-5 3-3 3-5 3-3 3-5 3-3 3-4 3-3 WRITE WRITE WRITE READ Function Prepare for Level a interrupt Fetch new WP register contents from memory word 000016 to temporary storage Store Status register contents in new R15 Store Program Counter contents in new R14 Store old WP register contents in new R13 Fetch new Program Counter contents from memory word 000'16 Load WP register from temporary storage Thus. program execution begins with a program whose starting address is stored in memory word 1. The starting address for the 16 general purpose registers is stored in memory word O. The TMS 9900 has a Reset instruction (RSET). In reality. this instruction resets only the interrupt mask in the Status register; it also outputs a code on the Address Bus. as identified in Table 3-1 and illustrated in Figure 3-8. TM 990 minicomputer systems use this signal to generate a program-initiated Reset. If you are designing your own TMS 9900based microcomputer system. you are free to use the RSET instruction in any way. THE TMS 9900 LOAD OPERATION The LOAD input to the TMS 9900 is a non-maskable, highest priority interrupt. Load must be input low for at least one instruction's duration. Since the length of an instruction can vary, you must use the IAQ signal to control the LOAD input pulse width. Texas Instruments' literature recommends the following circuit: +5V C) .. ~ ~ 0 lAO . PRE PRE 0 CK 7474 Q TMS CLR 9900 __ i:O'AD "'- - J ~ D Q t-- ~CK 7474 a CLR I EXTERNAL LOAD - 3-34 The CPU checks LOAD at the end of each instruction's execution. After a valid LOAD input has been acknowledged. the following machine cycle sequence is executed: Cycle 1 2 3 4 5 6 7 8 9 10 11 Type ALU MEMORY READ ALU MEMORY ALU MEMORY ALU MEMORY ALU MEMORY ALU WRITE WRITE WRITE READ Figure 3-3 3-4 3-3 3-5 3-3 3-5 3-3 3-5 3-3 3-4 3-3 Function Input new WP register contents from memory word 7FFE 16 to temporary storage Store in new R15 Store incremented Program Counter contents in new R14 Store old WP register contents in new R13 Input new Program Counter contents from word 7FFF16 Load WP register from temporary storage There are two differences between Reset and Load. First. the RESET input provides a true hardware reset. synchronizing internal operations. as well as a level 0 interrupt; LOAD provides only a non-maskable interrupt. Second. the Reset vector in bytes 0 through 3. while the Load vector is in bytes FFFC16 through FFFF 16. In TM 990 minicomputer systems. the LREX instruction is frequently used as a software load. Output due to LREX is identified in Table 3-1 and Figure 3-8. In a TMS 9900 microcomputer system. you can use the LREX signal in any way. THE TMS 9900 INSTRUCTION SET The TMS 9900 instruction set is extremely powerful when compared to any 16-bit microprocessor described in this book. When you consider that the TMS 9900 was first manufactured in 1976•. the power of this instruction set becomes more impressive. With regard to instructions described in Table 3-2 • some explanations are required. The ABS instruction converts the contents of a memory location to their absolute value. That is to say. this instruction assumes that the memory location contains a signed binary number. If the number is positive. nothing happens. If the number is negative. the twos complement of the number is taken. A number of instructions act on specific bits within source and destination memory words. These include the SOC. SOCB. SZC. SZCB. COCo and CZC instructions. In the OPERATION PERFORMED column of Table 3-2. the word "corresponding" means that the source word bits are affected only if selected by the destination word bit pattern. For example. the SOC instruction will be interpreted as follows: Source: Destination: Here are the new destination contents. After SOC: This is equivalent to an OR operation. The SOCB instruction is identical to the SOC instruction. except that only one byte is affected. This may be any memory byte or the high-order byte of a general purpose register. TheSZC instruction may be illustrated as follows: Source: Destination: After SZC: 3-35 This is equivalent to complementing the source operand and then ANDing the two operands. The SZCB instruction is identical to the SZC instruction. except that only one byte is affected. The cac instruction compares Source Register 1 bits with general purpose register bits that happen to be in the same bit positions. If all corresponding general purpose register bits are also 1. then the Equal status is set. Matches are not significant in bit positions if the source register bit is O. The CZC instruction operates in the same fashion as the cac instruction. except that those source memory word bits that are 0 become significant. That is to say. if every source memory worcf 0 bit has a corresponding Workspace register 0 bit. then the Equal status is set. Matches are not significant in bit positions if the source register bit is 1. The BLWP instruction is a subroutine call accompanied by a context switch. The operand memory address identifies the first of two memory words within which the new WP register and Program Counter contents will be stored. The BLWP instruction is remarkably powerful. The subroutine call and passing parameters to the subroutine become a single operation. The memory words that are to serve as subroutine general purpose registers can be used as general data memory locations prior to the subroutine call. Thus. the subroutine finds its registers pre-loaded with data when it starts executing. The RTWP instruction should be used to return from a subroutine that is called by the BLWP instruction. One-bit position arithmetic shifts may be illustrated as follows: Right Shift Left Shift 1011010110100110 1011010110100110 ~"""""""~ """""""" Lost 0 1 1 0 1 0 1 1 0 1 0 0 110 O~ 1 1 0 1 1 0 1 0 1 1 0 1 0 0 1 1 Lost Inserted A one-bit-position logical right shift may be illustrated as follows: 1011010110100110 ,~"""""'", o10 I nserted '!I 1 1 0 1 0 1 1 0 1 0 0 1 1 Lost A one-bit right rotate (Shift Right Circular) may be illustrated as follows: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 You can specify any number of bits. from 1 to 15. as the number of bit positions for any TMS 9900 shift or rotate instruction. If you specify 0 for the bit count. then the actual bit count is taken from the four low-order bits of general purpose Register RO. If these four low-order bits are 0000. then the bit count is assumed to be 16. 3-36 The following symbols are used in Table 3-2: AG C CNT CRUA d DATA4 DATA16 DISP EQ G LG OP OV PC R Rxx S ST WP x [ ) / A V -¥- Arithmetic Greater Than status Carry status 4-bit count field CRU base address from R12 Destination memory word. There are five possible options for the destination memory word. They are represented by these combinations of addressing modes: Workspace Register D Implied through Workspace Register D Direct address Direct. indexed address Implied through Workspace Register D. auto-increment Workspace Register D 4-bit data unit 16-bit data unit 8-bit signed displacement Equal status bit of Status register Both the AG and LG statuses Logical Greater Than status Odd Parity status Overflow status Program Counter Any of the 16 Workspace registers Workspace register. For example. R15 is Workspace Register 15 Source memory location. Addressing options identical to destination memory location Status register Workspace Pointer register Bits y through z of the quantity x. For example. ([ S) * [R)) < 31.16> represents the high-order word of the product of the contents of the Source Register S and the Workspace Register R. Contents of location enclosed within brackets. If a register designation is enclosed within the brackets. then the designated register's contents are specified. If a memory address is enclosed within the brackets. then the contents of the addressed memory location are specified. Mu Itiplication Division Logical AND Logical OR Logical Exclusive-OR Data is transferred in the direction of the arrow Under the heading of STATUSES in Table 3 -2. an X indicates statuses which are modified in the course of the instruction's execution. If there is no X. it means that the status maintains the value it had before the instruction was executed. Byte-operand instructions will affect half of a 16-bit memory word. If the word is accessed as a general purpose register, then only the high-order byte will be affected. If the word is accessed as non-register memory, then the byte affected is determined by the least significant bit of the 16-bit address: 0 selects the high-order byte; 1 selects the low-order byte. 3-37 Table 3-2. TMS 9900 Instruction Set Summary STATUSES TYPE MNEMONIC OPERAND(S) BYTES OPERATION PERFORMED G g EQ C OV OP LDCR S,CNT 2 X X X* STCR O,CNT 2 X X X* SBO DISP 2 SBZ DISP 2 TB OISP 2 X [CRUA]-[ S ] Transfer the specified number of bits from source memory word to the CRU. [D ] - [ CRUA] Transfer the specified number of bits from the CRU to destination memory word. [CRUA + OISP]- 1 Set bit in CRU to 1. [CRUA + DISP] - 0 Set bit in CRU to O. If [CRUA+DISP] =0, then [EQ]=l;orelse [EQ]=O Test bit in CRU. w »(J a:a:z MOV S,D 2 X X MOVB S,O 2 X X COw ~~a: -ww g:~~ Co) fA 00 C a: w A0 A S,D 2 X X X X AB S,O 2 X X X X X X X X X X S S,D 2 SB S,O 2 X X S,D S,O 2 2 X X X w C CB w XOR S,R 2 X X MPY S,R 2 > a: 0 ::E a: ~ w I X 16-bit add contents of source memory word to contents of destination memory word. [O]-[S]+ [0] a-bit add contents of source memory byte to contents of destination memory byte. [D]-[D]- [S] X i a-bit subtract contents of source memory byte from contents of destination memory byte. Set status flags based on 16-bit comparison of source and destination memory word contents. Set status flags based on a-bit comparison of source memory byte contents and destination memory byte contents. [R]-[S]¥ [R] 2 INC 0 2 X X X X INCT 0 2 X X X X Increment contents of memory word by 1. [0]-[0]+2 DEC 0 2 X X X X Increment contents of memory word by 2. [0]-[0]-1 X > a: 0 z (/J Decrement contents of memory word by 1. *OP status is affected only if between 1 and a bits are transferred. I I 16-bit subtract contents of source memory from contents of destination memory word. [D]-[D]- [S] S,R C 0 w 16-bit move contents of source memory word to destination memory word. [D]-[S] DIV ::E (J i I Multiply the contents of source memory word by contents of Workspace Register R. Store most significant word of result in R. Store least significant word of result in Workspace Register R + 1. [R]-([R,R + 11/ [S]Xquotient) [R + 11-( [R,R + 111 [S]Xremainder) Divide the 32-bit quantity represented by R (high-order word) concatenated with R + 1 (low order) by the contents of the source memory word. Store the quotient in R, the remainder in R + 1 and set overflow if quotient will exceed 16 bits. [O]-[D]+ 1 > a: 0 i I [O]-[S] Exclusive-OR contents of source memory word with Workspace Register R. [R]-[([S]* [R])<31,16 >] [R+ 1l-[([S]*[R])<15,O>] Z w a: w II. w ! [D]-[S]+ [D] X X ~ (J I a-bit move contents of source memory byte to destination memory byte. iii ~ X I I Table 3-2. TMS 9900 Instruction Set Summary (Continued) STATUSES TYPE OPERAND(S) MNEMONIC OPERATION PERFORMED BYTES G EQ X X C OV DECT D 2 CLR D 2 SETO D 2 INV D 2 X X NEG D 2 X X X X ABS D 2 X X X X 0 ~ SWPB D 2 - SOC S,D 2 X X saCB S,O 2 X X SZC S,D 2 X X SZCB S,D 2 X X COC S,R CZC S,R 2 LI R,DATA16 4 LWPI DATA 16 4 is X OP [D]-[D]-2 X Decrement contents of memory word by 2. [D]-OOOO Clear the ~~stination memory word. [D]-FFFF Set all bii~ of memory word. [D]-(O] 1&1 =:) Z i= Z 0 9 W ~ c( Ones complement the destination memory word. ,[D]-['D.J+l Twos complement the destination memory word. [D]-I [D]I Take the absolute (unsigned) value of the destination memory word's contents. a: 1&1 A. 0 > a: [D<15,8>]--[0<7,O>] Exchange the high and low bytes of the memory word. If [S]=l,then [D]-l Set the bits in the destination memory word that correspond to ls in the source memory word 1&1 ~ Col W co 1&1 CJ Z 1&1 a: 1&1 u.. 1&1 a: > a: 0 ~ X for 8 bits. If [S]=l, then [D]-P Clear the bits in the destination memory word that correspond to ls in the source memory word 1&1 ~ > a: c( Q Z 0 U 1&1 X CI) X for all 16 bits. If [S]="l, then [O]-l Set the bits in the destination memory word that correspond to ls in the source memory word X for all 16 bits. If [S]=l, then [D]-O Clear the bits in the destination memory word that correspond to ls in the source memory word for 8 bits. If for all [S]=l, [R]=l,then [EQ]-l If the bits in the Workspace Register R that correspond to the set bits in the source memory word are all ls, set the EQUAL status. If for all [S]=l, [R]=O, then [EO]=l If the bits in the Workspace Register ~t correspond to set bits in the source memory word are all Os, set the EQUAL status. 1&1 ~ c( is 1&1 :::E ~ -~-- - -- - X X [R]-DATA16 Load immediate to Workspace Register R. [WR]-DATA16 Load immediate to Workspace Pointer Register, WR. Table 3-2. TMS 9900 Instruction Set Summary (Continued) STATUSES TYPE w MNEMONIC OPERAND(S) BYTES OPERATION PERFORMED G EO C OV OP Set the status flags based on 16-bit comparison between contents of Workspace Register Rand CI R,DATA16 4 X X 11- AI R,DATA16 4 X X I- ANDI R.DATA 16 4 X X ORI R,DATA16 4 X X B S 2 [PC]+-[S] JMP D(SP 2 Branch unconditional to address in Source memory word. [PC]+-[ PC] + DISP Branch unconditional. BL S 2 BLWP S 2 le( immediate data. [R]-[R] + DATA 16 II: w 0 w e( 0w ~ X X Add immediate to Workspace Register R contents. [R]+-[R] A DATA 16 AND immediate with Workspace Register R contents. [R]+-[ R] V DATA 16 OR immediate with Workspace Register R contents. ;:! 11- ~ .., ::;) 2 II: [R111-[PC]+1 [PC]-[S] Branch to subroutine at address in source memory word. [R13]-[WP] [R14]+-[ PC] [R15]+-[ST] [WP]+-[S] W::;) 21Col ~ ~~ ::;)Q ~2 ...... 1IIe( ::;) 0 e( (,) 2 RTWP X X X X X [PC]-[S+2] Branch to subroutine whose address is stored in source memory word + 1. Perform context switch to RD address contained in source memory word. [WP]-[R13] [PC]+-[R14] [ST]-[R15] Perform a backward context switch. JEQ DISP 2 JNE DISP 2 JGT DISP 2 JlT DISP 2 2 JHE DISP 2 Branch on arithmetic greater than. If [AG]=O and [EO]=O; then [PC]+-[PC] +DISP Branch on arithmetic less than. If [lG]=1 or [EO]=1; then [PC]+-[PC] +DISP :z: (,) JH DISP 2 Branch on logical greater than or equal. If [LG]=1 and [EO]=O; then [PC]+-[PC]+DISP Jl DISP 2 JLE DISP 2 2 0 ~ is 2 0 (,) 0 2 ~ III If [EO]=1; then [PC]+-[PC] +DISP Branch if equal. If [EO]=O; then [PC]-[PC] +DISP Branch if not equal. If [AG]=1; then [PC]-[PC] + DISP Branch on logical greater than. If [lG]=O and [EO]=O; then [PC]-[PC] +DISP Branch on logical less than. If [EO]=1 or [LG]=O; then [PC]+-[PC]+DISP Branch on less than or equal. Table 3-2. TMS 9900 Instruction Set Summary (Continued) STATUSES TYPE MNEMONIC OPERAND(S) OPERATION PERFORMED BYTES G EQ C OV OP JNC DISP 2 If [C]=O; then [PC]-[PC]+DISP ZZe OOw JNO DISP 2 Branch on carry reset. If [OV]=O;then [PC]-[PC]+DISP z°j:: JOC DISP 2 JOP DISP 2 ~Ei ~ZZ 00 m U !:! Branch on overflow reset. If [C]=l;then [PC]-[PC]+DISP Branch on carry set. If [OP]=l;then [PC]-[PC]+DISP Branch on odd parity set. a: W W l- I- 0( ~ ~ ~ 0 SLA SRA 2 X X X X X X X X 2 SRL R,CNT R,CNT R,CNT SRC R,CNT 2 2 STST R 2 STWP R 2 L1MI DATA4 4 XOP S,R 2 X X X X Arithmetic shift the Workspace Register R left the specified number of bits. Arithmetic shift the Workspace Register R right the specified number of bits. Logical shift the Workspace Register R right the specified number of bits. Rotate the Workspace Register R right the specified number of bits. X [R]-[ST] . Store the Status register into Workspace Register R. [RJ-[WP] . Store the Workspace Pointer into Workspace Register R. w ~ 01ZA. 0(;:) 0a: ;:)IZ: I-w 0(1I-Z 0- [SR<3,O>] -oATA4 Load immediate data into the interrupt mask bits of the Status register. X [R13]-[WP] [R14]-[PC] [R15]-[ST] [Rll]-[S] [WP]-[40,. +(4*[R))) [PC]-[41,. +(4* [R))) Perform a context switch. This is the software interrupt. W I- X S 2 Execute the instruction represented by the data in the source location. If that instruction has immediate operand words, those words must be located directly after the X instruction. The instruction [S] will affect the status flags but its fetch will not cause IAQ to go high. 2 CPU enters Halt state. CPU clears interrupt mask and outputs 001 on three high-order Address Bus lines. 011 on three high-order Address Bus lines. ;:) U W )( W IDLE > :le o(w ZZ a:jL WW t<0 W RSET CKOF CKON LREX 110 out on three high-order Address Bus lines. 101 out on three high-order Address Bus lines. 111 out on three high-order Address Bus lines. THE BENCHMARK PROGRAM For the TMS 9900, our benchmark program may be illustrated as follows: LOOP BLWP MOVE CONTEXT SWITCH TO APPROPRIATE REGISTERS MOV DEC JNE RTWP @IOBUF(R11.*R2+ R1 LOOP LOAD NEXT INPUT WORD IN NEXT TABLE WORD DECREMENT COUNT RETURN FOR MORE RETURN FROM SUBROUTINE Let us look at how our benchmark program can collapse to just five instructions. We assume that there is some set of 16 General Purpose registers within which we store the word count and the address of the first free word in TABLE. We illustrated this idea when describing context switching earlier in the chapter. Observe that Register R1 contains the word count and is therefore used as an Index register. while Register R2 addresses the first free word in TABLE. Note that the contents of Register R2 are incremented automatically when the next byte is loaded into the table. The BLWP instruction will branch to the program which performs the required data move. but simultaneously it loads the Workspace register with the appropriate initial address. We do not need to load any initial addresses or word counts into registers. since we have adopted the memory space where this data is stored to serve as our General Purpose registers. After the move has been completed. we do not have to update any counters or pointers. because they were updated "in situ". All we have to do upon completing the move is store the contents of the current General Purpose Registers 13 and 14 to the Workspace register and Program Counter. The following notation is used in Table 3-3: aa bb Two bits determining the addressing mode for the destination memory word Two bits determining the addressing mode for the source memory word cccccccc dddd 8-bit Signed address displacement Four bits used with aa to determine the destination memory word eeee rrrr 4-bit count field Four bits choosing the Workspace register Four bits used with bb to determine the source memory word 16 bits of immediate data ssss xx If either aa or bb is 1°2. and the corresponding register specified is 02. then an additional 16-bit direct memory address word. used in computing the effective memory address of the operand. will follow the instruction. If aa and bb are 1°2. and both corresponding register specifications are 0. then two additional 16-bit direct memory addreSSing words will follow the instruction: the first will be used in computing the source address; the second will be used in computing the destination address. 3-42 Table 3-3. INSTRUCTION TMS 9900 Instruction Set Object Codes OBJECT CODE BYTES CLOCK INSTRUCTION PERIODS· OBJECT CODE BYTES CLOCK PERIODS· A S,D 1010aaddddbbssss 2 DISP 000lll00cccccccc 2 S,D 1011aaddddbbssss 2 14-30 (1) 14-30 (1) JOP AB LDCR S,CNT 00ll00eeeebbssss 2 8/10(15) 22-52 (11) ABS 0 0000011101aadddd 2 12-20 (6) LI R,DATA16 000000100000mr 4 12 (19) AI R,DATA16 00000o 1000 lOrrrr 4 14(17) 0000001100000000 4 16(21) ANDI R,DATA16 00000o 100 100rrrr 4 14(17) XX 0000001111100000 2 6(14) B S 2 8-16 (7) 0000001011100000 4 10(20) BL XX LlMI XX 00000 1000 1bbssss XX DATA4 LREX LWPI DATA 16 MOV S,D l100aaddddbbssss 2 14-30 (1) 1101aaddddbbssss 2 14-30 (1) 00lllOrmbbssss 2 0000010100aadddd 2 52-60 (2) 12-20 (5) S 0000011010bbssss 2 12-20 (9) BLWP S 00000 1OOOObbssss 2 26-34 (10) C S,D l000aaddddbbssss 2 14-30 (1) MOVB S,D CB S,D 100 1aaddddbbssss 2 S,R S,D 000000101000mr 4 14-30 (1) 14 (18) MPY CI NEG 0 ORI R,DATA16 0000001111000000 2 6 (14) XX CKON CKOF CLR 0 COC S,R CZC S,R DEC 0 DECT 0 DIV S,R IDLE 0000001110100000 2 6(14) 2 10-18 (5) RSET RlWP 00 1OOOrmbbssss 2 10-18 (1) 5 00l00lrrrrbbssss 2 14-22 (1l 00000ll000aadddd 2 14-22 (5) 00000ll00laadddd 2 10-18 (5) 00 1111 rrrrbbssss 2 10-18 (3) 0000001101000000 2 0000010110aadddd INV JEQ JGT 14(17) 000000100110mr XX 00000l00llaadddd 0 0 0 INC XX 6 (14) 0000001101100000 2 0000001110000000 2 14 (8) 5,0 0110aaddddbbssss 2 14-30(1) SB S,D 0111 aaddddbbssss 2 14-30 (1) SBO DISP 00011101cccccccc 2 12 (13) SBZ DISP 00011110cccccccc 2 12(13) SETO 0 00000lll00aadddd 2 10-18 (5) 6 (14) SLA R,CNT 0000 10 1Oeeeerrrr 2 14-52 (16) 16-124 (5) SOC S,D l110aaddddbbssss 2 14-30(1) 0000010111 aadddd 2 10-18 (5) 50CB S,D 1111 aaddddbbssss 2 14-30 (1) 0000010101 aadddd 2 10-18 (5) SRA R,CNT 00001000eeeerrrr 2 14-52 (16) DISP 00010011cccccccc 2 10-18 (15) SRC R,CNT 00001011eeeemr 00010101cccccccc 2 8/10 (15) SRL R,CNT 0000100 leeeemr 2 2 14-52 (16) DISP JH DISP 00011011cccccccc 2 8/10 (15) STCR D,CNT 001101eeeeaadddd 2 42-60 (12) JHE DISP 00010100cccccccc 2 8/10 (15) STST R 000000101100mr 2 8(23) JL DISP 000 11010cccccccc 2 8/10 (15) STWP R 000000101010mr 2 8 (22) JLE JLT DISP 000 100 1Occcccccc 2 8/10 (15) SWPB 0 0000011011aadddd 2 10-18 (23) DISP 000l000lcccccccc 2 8/10 (15) SZC S,D ol00aaddddbbssss 2 14-30 (1) JMP DISP 000l0000cccccccc 2 10(15) SZCB 5,0 0101aaddddbbssss 2 14-30(1) JNC DISP 00010111cccccccc 2 8/10(15) TB DISP 00011111cccccccc 2 12(8) JNE DISP 00010110cccccccc 2 8/10(15) x 5 00000100 lObbssss 2 8-16 (7) JNO DISP 000ll00lcccccccc 2 8/10 (15) XOP S,R 00 10 11 rrrrbbssss 2 44-52 (4) JOC DISP 000ll000cccccccc 2 8/10 (15) XOR S,R 001010rmbbssss 2 14-22 (1) INCT • The number in brackets identifies the instruction's machine cycle sequence, as defined in the preceding text. 3-43 14-52 (16) The minimum and maximum number of clock periods for the execution of each instruction are shown in the CLOCK PERIODS column of Table 3-3. Remember that a machine cycle consists of two clock periods. The bracketed number after the number of clock periods identifies the machine cycle sequence. Machine cycle sequences associated with each bracketed number are listed below. In the machine cycle list below, the follow:ing abbreviations are used: R represents a memory read machine cycle as identified in Figure 3-4. A represents an ALU machine cycle as illustrated in Figure 3-3. W represents a memory write machine cycle as illustrated in Figure 3-5. C represents a CRU machine cycle as illustrated in Figures 3-6 and 3-7. A subscript associated with any machine cycle notation identifies that machine cycle repeated a number of times. Thus A3 is equivalent to -A-A-A-. M represents memory address computation machine cycles. Memory address computations were described earlier in this chapter. In su mmary. here are the various possibilities for M: Register addressing: R Implied memory addressing: R-A-R Implied memory addressing with auto-increment (for byte operand): R-A-W-R Implied memory addressing with auto-increment (for word operand): R-A-A-W-R Direct addressing: A-A-R-A-R Direct. indexed addressing: R-A-R-A-R (1) (2) (3) (4) (5) (6) (7) ~) (9) (10) (11) (12) (13) (14) (15) (16) (17) (18) (19) (20) (21) (22) (23) R-A-M-A-M-A-W R-A-M-A-R-A18-W-A-W R-A-M-A-R-A-A-R-Ax-W-A-W (51 ~ x :::; 35) R-A-M-A3-R-A-W-A-W-A-W-A-W-A-R-A R-A-M-A-W R-A-M-A3-W-A R-A-M-A R-A-A-R-R-R-A R-A-M-A-A-W R-A-M-A-A-W-A-W-A-W-A-R-A R-A-M-A4-R-A-C x-A (16 ~ x ~ 1) R-A-M-A-R-A-A-Cx-Ay-W (16 ~ x ~ 1. 11 ~ y ~ 5) R-A-A-R-A-C R-A-A-C-A-A R-Ax (x=3 or 4) R-A-R-A-A-R-Ax-W-A (18 ~ x ~ 3) R-A-A-R-R-A-W R-A-R-A-R-A-A R-A-A-R-A-W R-A-A-R-A R-A-A-R-A3 R-A-A-W R-A-M-A-R-A4-W THE TMS 9980A AND THE TMS 9981 MICROPROCESSORS The TMS 9980A and the TMS 9981 are low-cost variations of the TMS 9900. The principal differences between the TMS 9900 series and TMS 9980 series microprocessors are summarized in Table 3-4. Differences between the TMS 9980A and the TMS 9981 are summarized in Table 3-5. This discussion of the TMS 9980 series microprocessors covers only differences as compared to the TMS 9900. The TMS 9980 series microprocessors are manufactured using N-channel silicon gate MOS technology. They are packaged as 40-pin DIPs. The TMS 9980A uses three power supplies: -5V. +5V. and +12V. The TMS 9981 useS two power supplies: +5V and +12V. Typically. a c'lock cycle time of 400 nanoseconds will be used with TMS 9980 series microprocessors. This generates instruction execution times ranging between 4 and 14 microseconds. 3-44 Figure 3-14 illustrates that part of general microcomputer system logic which is implemented by the TMS 9980 series microprocessors. This figure is identical to Figure 3~ 1. with the exception of clock logic. which is now shown present. Programmable registers are implemented and used in exactly the same way the TMS 9900 and TMS 9980 series microprocessors. Note. however. that the TMS 9980 series microprocessors address a 2048-bit CRU; therefore. bits 1 through 11 of Register R12 identify the origin of any CRU bit field. The TMS 9900 uses bits 1 through 12 of Register R12 to identify the CRU origin within a 4096-bit CRU. Table 3-4. A Summary of Differences Between the TMS 9900 and TMS 9980 Series Microprocessors FUNCTION Addressable external memory DIP pins Data Bus Address Bus External interrupt priorities CRU field width Clock logic TMS 9900 TMS 9980AITMS 9981 32.768 x 16-bit words 64 16 bits 16.384 x 8-bit words 40 8 bits 13 bits 4 15 bits 15 4096 bits 2048 bits Four external inputs One external input or internal (TMS 9981 only) Table 3-5. A Summary of Differences Between the TMS 9980A and TMS 9981 Microprocessors FUNCTION Power supplies Clock logic Pin incompatibility ties TMS 9980A TMS 9981 -5V. +5V. +12V One external input +5V. +12V One external input or crystal only DO - 07. INTO - INT2. cJ>3 The TMS 9980 series microprocessors have a 14-line Address. Bus, used to address up to 16,384 bytes of memory. In contrast. the TMS 9900 addresses up to 32.768 16-bit words of external memory. Thus. TMS 9980 programs address memory as bytes. while externally generated addresses also select bytes. The TMS 9900. by way of contrast. addresses memory as bytes within the CPU. but as 16-bit words externally. The TMS 9980 series microprocessors use exactly the same memory and CRU addressing techniques as the TMS 9900. General-purpose registers are used in the same way. and instruction object codes are identical. The Status register and Status flags used by the TMS 9980 series microprocessors are identical to those which we have already described for the TMS 9900. TMS 9980 SERIES MICROPROCESSOR PINS AND SIGNALS Figure 3-15 illustrates pins and signals for the TMS 9980A. Figure 3-16 provides the same information for the TMS 9981. In both of these illustrations. signal names conform to Texas Instruments nomenclature. For the Data and Address Busses. our notation is given in brackets. Differences result from the fact that we number bits from right to left (0 being the low-order bit). while Texas Instruments numbers bits from left to right (0 becomes the high-order bit). TMS 9980AITMS 9981 pin-out differences are shaded in Figures 3-15 and 3-16 so that you can identify them quickly. For descriptions of the individual signals, refer to the earlier TMS 9900 discussion. 3-45 Accumulator Registens) Data Countens) Programmable Timers Figure 3-14. I/O Ports Memory Logic of the TMS 9980A and TMS 9981 Microprocessors 3-46 HOLD HLDA IAQ (LSB) (AO) CRUOUT/A13 (A1) A12 (A2) A11 (A3) A10 (A4) A9 (A5) A8 (A6) A7 (A7) A6 (A8) A5 (A9) A4 (A10) A3 (A11) A2 (A12) A1 (MSB) (A13) AO DBIN CRUIN (+5V) VCC 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 TMS 9980A 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 (LSB) (MSB) Type Description Pin Name AO-A13 Address Bus Tristate, output 00-07 Data Bus Tristate, bidirectional CKIN Clock signal in Input cJ>3 Synchronizing clock Output Memory Enable Tristate, qutput IAQ I nstruction Fetch Output DBIN Data Bus in Tristate, output WE Write Enable Tristate, output READY Memory Ready Input WAIT Wait State indicator Output CRUCLK I/O clock Output CRUOUT Serial I/O out Output CRUIN Serial I/O in Input INTO, INT1, INT2 I nterrupt request and priority Input HOLD DMA request Input HOLDA Hold acknowledge Output Power and Ground reference Figure 3-15. TMS 9980A Signals and Pin Assignments 3-47 HOLD-~" 1 2 IAQ .....1----1 3 (LSB) (AO) CRUOUT/A13~~--I 4 (A1) A12 ~---I 5 (A2) A 11 ....1----1 6 (A3) A10 ....- - - 1 7 (A4) A9 .....1----I 8 (A5) A8 ....- - - 1 9 ( A6) A 7 .....'""----1 10 (A7) A6 ~I----I 11 (A8) A5 ....-----1 12 (A9) A4 ....- - f 13 (A 1 0) A3 ....1----1 14 (A11) A2 ....1----4 15 (A12) A1 ....1----1 16 (MSB) (A 13) AO ...1----1 17 OBI N ....I----t 18 CRUIN 19 (+5V) VCC - - - - I 20 HLDA~---I TMS 9981 33 32 31 30 29 28 27 26 25 24 23 22 21 (LSB) (MSB) Type Description Pin Name AO-A13 Address Bus Tristate, output 00-07 Data Bus Tristate, bidirectional CKIN Clock or crystal connection InptAt OSCOUT Crystal connection Output Synchronizing clock Output MEMEN Memory Enable Tristate, output IAQ I nstruction Fetch Output DBIN Data Bus in Tristate, output WE Write Enable Tristate, output READY Memory Ready Input WAIT Wait State indicator Output CRUCLK I/O clock Output CRUOUT Serial I/O out Output CRUIN Serial I/O in Input INTO, INT1, INT2 I nterrupt request and priority Input HOLD DMA request Input HOLDA Hold acknowledge Output v CC' Power and G round reference V DO' V SS Figure 3-16. TMS 9981 Signals and Pin Assignments 3-48 TMS 9980 SERIES MICROPROCESSOR TIMING AND INSTRUCTION EXECUTION The TMS 9980A and TMS 9981 microprocessors have the same signal relationships and instruction execution sequences as the TMS 9900. The few minor waveform differences are identified in the data sheets at the end of this chapter. The only significant difference between the TMS 9900 and TMS 9980 series is in clock logic. The TMS 9900 re e quires four clock inputs. as identified in Figure 3-3. The TMS 9980A requires a single clock signal. input via CKIN. The frequency of this clock input must be four times the desired clock frequency. That is to say. CKIN will be divided by four in order to create one clock period. The TMS 9981 can operate with the same CKIN input as the TMS 9980A; however. you can also connect a crystal across CKIN and OSCOUT. This may be illustrated as follows: TMS 9980 SERIES CLOCK LOGIC CKIN ~------~------------____~ D OSCOUT t-------....---------. C1 and C2 must have values between 10pf and 25pf. typically 15pf. - The crystal must be of the fundamental frequency type. The frequency will be divided by four in order to create the internal clock frequency. Both the TMS 9980A and the TMS 9981 output <1>3. a synchronizing clock Signal. <1>3 is the inverse of the <1>3 clock signal shown in Figure 3-3 and in subsequent timing diagrams for the TMS 9900. Thus you can create the timing diagram for any TMS 9980 operation by looking at the equivalent timing diagram for the TMS 9900 and replacing the four TMS 9900 clock signals by a single timing pulse which will be the complement of <1>3. The following operations are identical within TMS 9900 and TMS 9980 systems: • Memory references. However. note that memory reference will consist of two memory access cycles. as a 16-bit word is handled as two bytes. ·CRU I/O operations (remember that the TMS 9980 series CRU is only 2048 bits wide). ·CRU control operations ·The Wait state •The Hold state and direct memory access operations •The Halt state •The interaction of Hold and Halt states Refer to the TMS 9900 discussion for any of the above topics. TMS 9980 SERIES INTERRUPT LOGIC The TMS 9980A and TMS 9981 microprocessors support four levels of external interrupt. together with a Reset and a Load. Reset and Load are non-maskable interrupts. In contrast. the TMS 9900 supports 15 levels of external interrupt. along with Reset. The TMS 9980 series microprocessors identify external interrupts via the INTO, INT1, and INT2 inputs as shown in Table 3-6. Figure 3-17 shows the interrupt vector map. 3-49 Table 3-6. TMS 9980 Interrupts I nterrupt Decoded INTO INT1 INT2 0 0 0 Reset 0 0 1 Reset 0 1 0 Load 0 1 1 Level 1 (Highest Priority) 1 0 0 Level 2 1 0 1 Level 3 1 1 0 Level 4 (Lowest Priority) 1 1 1 No Interrupts Observe that the TMS 9980A and the TMS 9981 have no iNTRffi input. Also. the Reset and Load non-maskable interrupts are decoded from the INTO - INT2 inputs. Figure 3-18 shows some pin connections for various levels of interrupt complexity in a TMS9980 series microcomputer system. The three illustrations shown are self-evident; they simply implement the INTO - INT2 codes defined above. The TMS 9980 series microprocessors provide all 16 XOP software interrupts available with a TMS 9900. Observe that Figure 3-17 shows memory as 8-bit units in contrast to Figure 3-11, which shows memory as 16-bit units. This reflects the fact that external memory is addressed as bytes by the TMS 9980A and the TMS 9981. 3-50 Memory Address Reset ~ ~ (' External Interrupt. < Una..'oned Memo", for Programs or Data tt Memory Byte Content 0000 WP HI 0001 WP La 0002 PC HI - 0003 PC La 0004 WP HI 0005 WP La 0006 PC HI ... t WP Reset Vector ). PC - < ). WP , 0007 PC - > ~C t La 0008 WP HI 0009 WP La OOOA 'PC HI OOOB PC La OOOC WP HI 0000 WP La OOOE PC HI OOOF PC La 0010 WP HI 0011 WP La 0012 PC HI 0013 PC La Leve.! 1 Vector ~ >WP } Level 2 Vector ). PC ~ >WP } Level 3 Vector ; PC 1WP 1 } Leve' 4 Veeto' J PC L 0040 WP HI 0041 WP La 0042 PC HI 0043 PC } } WP La } PC }wp } xap 0 Vector xap Vectors, Use Same Memory Space as the TMS 9900 Unassigned Memory , . 007C WP HI 0070 WP La 007E PC HI 007F PC 3FFC WP HI 3FFO WP LO LO } xap 15 Vector PC t Loed { 3FFE. PC HI PC La 3FFF ~wp PC } Figure 3-17. TMS 9980 Memory Map 3-51 Load Vector LEVEl.. 1 RES'ET r INTO I r--f......}- INTO TMS 9980AI TMS 9981 INT1 LEVEl.. 4 INT2 TMS 9980A/ TMS 9981 A) Using Reset and One External Interrupt RESET INT1 ['5Ai5 INT2 B) Using. Reset, I..oad and One External Interrupt Vee ) ! ~H RESET ... Lc5A5 I..EVEI..1 LEVEL 2 LEVEL 3 LEVEL 4 ... ... ~ --/P13 CRUCLK/P10 CRUOUT/P9 CRUIN/P8 INT1/TST "R'ST'iPE --- -- -..-.. - .. ~- --- --.. - -- ..-- .. -- ..---- -..-.. - - .. ~ -- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 TMS 9940 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 ------ -.. ....- ---- --..---- -....-- -f4-... ---- -.... -- -- ..--- - VSS (GND) P31 P30 INT2/P·ROG P29 P28 P27 P26 P25 P24 P7/A8 (LSB) P6/A7 P5/A6 P4/A5 P3/A4 P2/A3 P1/A2 PO/A1 (MSB) XTAL2 XTAL1 Pin Name Description Type PO - P31 CRU I/O pins Extemal interrupt and Test select External interrupt and EPROM programmer System reset and EPROM programmer enable External CRU bit address External CRU clock External serial I/O output External serial I/O input Multiprocessor data I/O clock Multiprocessor data I/O Event counter input Idle state indicator Hold request Hold acknowledge Synchronizing clock External crystal connections Standby + 5V power Normal + 5V power Ground reference Bidirectional Input Input Input Output Output Output Input Bidirectional Bidirectional Input Output Input Output Output INT1/TST INT2/PROG RST/PE AO - A7 CRUCLK CRUOUT CRUIN TC TO EC IDLE HLD HLDA XTAL2, XTAL1 VCC1 VCC2 Vss (In this figure, Pn and An numbering conforms to Texas Instruments' policy of beginning with N=O for the high-order bit. We use N=O for the low-order bit.) Figure 3-21. TMS 9940 Microcomputer Signals and Pin Assignments 3-58 Table 3-7 shows how the TMS 9940 interprets its 512 available bit addresses. Table 3-7. TMS 9940 CRU Bit Address Assignments CRU Address Read Function Write Function 000 to OFF External CRU bits; the address is output via A 1-A8. Data is transferred via CRUIN, CRUOUT } and CRUCLK 100 to 17F } Unused Unused 180 INTl state Unused 181 Decrementer interrupt level Clear decrementer interrupt 182 INT2 state Unused 183 Unused Configuration bit 0 (CBO) 184 Unused Configuration bit 1 (CB 1) 185 Unused Configuration bit 2 (CB2) 186 Unused Configuratiol7l bit 3 (CB3) 190 to 190 } Decrementer register. 190 is the least significant bit and 190 is the most significant bit 19E Unused Timer (high) or Counter (low) select 19F Unused Unused lAO to lAF t Multiprocessor System Interface buffer register f 1 AO is the least significant bit and 1 AF is the most significant bit lBO to lBF } General purpose flag bits lCO to 10F } Unused lEO to lFF } local CRU pins (PO = lEO, P3l Identify direction for PO (via lCO) through P31 (via 1DF). 1 specifies output. 0 specifies input = lFF I The place to begin looking at Table 3-7 is at CRU bits 183, 184, 185, and 186. These four CRU bits represent write-only locations which determine how the 32 CRU pins illustrated in Figure 3-21 will be used. TMS 9940 CRU BIT UTILIZATION If you look again at Figure 3-21. you will see that PO through P17 have shared functions. P18 through P31 are simple I/O pins without other programmable options. CRU addresses 183, 184, 185 and 186 control the functions of PO through P16, as illustrated in Table 3-8. P17 options depend on real-time clock logic. which we will describe later. Let us look at the programmable options available with CRU pins PO through P31. It does not matter what options you have selected: you will actually access the 32 CRU pins PO - P31 via CRU addresses 1 E016 through 1 FF 16. In the simplest case, all 32 pins, PO - P31, will be used for input or output. We call this SimTMS 9940 ple I/O mode. In order to use all 32 pins for data input or output. (that is. in Simple 1/0 mode). all SIMPLE four of the configuration bits. CBO. CB1. CB2. and CB3. must be O. At any time. a CRU bit can CRU I/O either input data or output data. but it cannot be used for bidirectional data transfer. You must MODE identify the direction for each pin by outputting appropriate data to CRU addresses 1C016 through 1 DF16. As shown in Table 3-7. each pin has a dedicated CRU address. beginning with pin PO controlled by 3-59 1C016 and ending with pin P31 controlled by CRU address 1DF16. A 1 written to any Direction CRU bit causes the associated pin to output data only. A 0 written to any CRU Direction bit causes the associated pin to input data only. Of course. you can at any time change a pin from input to output or from output to input. under program control. by rewriting control information to Direction CRU bits 1C016 through 1 DF16. Table 3-8. TMS 9940 CRU Bits Whose Functions are Determined Under Program Control CRU Function as Configured Bit Address Pin CBO=O CBO = 1 CB1, CB2, CB3 0-7 1 EO-1 E7 23-30 PO-P7 A1-A8 No Effect 8 1E8 18 P8 CRUIN No Effect 9 1E9 17 P9 CRUOUT No Effect 10 1EA 16 P10 CRUCLK No Effect CB1 = 0 CB1 = 1 CBO, CB2, CB3 11 1EB 14 P11 TC No Effect 12 1EC 11 P12 TO No Effect CB2 =0 CB2 = 1 CBO, CB1, CB3 P13 4> No Effect CB3 = 0 CB3 = 1 CBO, CB1, CB2 13 1ED 15 14 1EE 10 P14 HLO No Effect 15 1EF 9 P15 HLOA No Effect 16 1FO 8 P16 i'i5'i:'E No Effect You will always have to define the direction of data transfer for pins P18 through P31 - assuming that you are using these pins. When pins PO through P17 are being used in any of the special ways which we are about to describe. then the data direction associated with the special operation will apply. and it makes no difference what you output to the associated Direction CRU bit. If you wish to use 266 external CRU bits, then you must set CRU bit 183 (CBO) to 1. This is called I/O expansion mode. I/O expansion mode modifies the functions of pins PO through P10. TMS 9940 CRU I/O When you use CRU addresses 00 through FF16 in I/O expansion mode. the address is output via EXPANSION pins PO - P7. which now function as CRU address lines A 1 - A8. P8. P9. and P10 serve as the stanMODE dard CRU data transfer lines: CRUIN. CRUOUT. and CRUCLK. Timing for data input and output via these three lines has been described for the TMS 9900. Refer to the TMS 9900 description for details. In order to illustrate the use of external CRU, consider execution of the instructions: LI LI LDCR R3.>OO R12.>140 R3.4 LOAD 1010 BINARY INTO UPPER BYTE OF R3 LOAD A BASE ADDRESS OF 82 HEX INTO R12 OUTPUT FOUR LOW-ORDER BITS OF R3 TO CRU Note that R12 contains 014016 to represent the address 08216. since R12 bit 0 is unused; therefore the internal address is. in effect. doubled. This instruction outputs 1010 to CRU bit 08216 (0). 08316 (1). 08416 (0), and 08516(1). Since fewer than eight bits will be transferred. they will come from the upper byte of the general purpose register. This is the event sequence which occurs: 1) The address 8216 is output via A 1 - A8. Remember. Texas Instruments' literature uses 0 to represent the highorder bit therefore A 1 represents the high-order address bit. and A8 represents the low-order address bit. CRUIN is inactive. but CRUOUT is low to represent 0 while CRUCLK is pulsed high to time the 0 bit on CRUOUT. 3-60 2) The address output on A 1 3) The address on A1 - A8 increments to 8416. CRUOUT goes low again. and CRUCLK pulses high. 4) The address on A 1 - A8 increments to 8516. and CRUOUT goes high. and CRUCLK pulses high. 1- A8 increments to 8316. and CRUOUT goes high. then CRUCLK pulses high. 1010 has now been transmitted to four external CRU bits. Note that it is up to external logic to decode the CRU address output however. the Parallel System interface (which we will describe in later editions) will connect directly to the TMS 9940 Address and CRU outputs that we have just described. When you write 1 to CRU bit 18416 (CB1), pins P11 and P12 function as serial data transfer pins. The purpose of this logic is to allow the TMS 9940 to operate in multi-CPU configurations. This logic is very simple. You output data by writing the data to CRU bits 1A016 through 1AF16. This data is immediately transmitted via TD (P12) as a serial data stream which is clocked by TC (P11). In keeping with normal bit sequence protocol. data is transmitted low-order bit first. Thus. 16 bits of data being output may be illustrated as follows: II: TMS 9940 MULTIPROCESSOR SYSTEM INTERFACE II: w w II: II: o o o o o .J ± -~ CJ I I-U ::»- a. CJ 1- 0 ... ... ~tO o « ::».J O.J 1-« u. « Cl)Z II: II: -w 11 10 11 10 11 11 11 10 11 10 11 11 1 u.1- wX IW 1-> ~Dl Cl)Z -w Iw I-CI) TC TO o o o o o When a TMS 9940 has a 1 written to CB1. it can also receive data via TD. Data input is again clocked by TC. Input logic is the reverse of the output logic illustrated above; that is say. as a data stream is input. the first input bit is loaded into CRU bit 1AF16. and the sixteenth input bit is loaded into CRU bit 1A016. TMS 9940 multiprocessor system interface logic is used to transfer data from a memory location in one TMS 9940 to a memory location in another TMS 9940. You will not normally use this logic to transfer data between a TMS 9940 and external logic; the CRU serves that purpose better. There are three reasons why you may want to use the TMS 9940 multiprocessor system interface; they are: 1) To transmit status information. For example. one TMS 9940 cou Id tell another how far it has progressed through various phases of a task by transmitting a status word whose bits have some predefined interpretation. 2) To transmit data. One TMS 9940 may generate data which another TMS 9940 needs in order to execute its programs. 3) To transmit instruction sequences. Instructions could be transmitted from the read-only memory (or the read/write memory) of one TMS 9940 to the read/write memory of another TMS 9940. The receiving TMS 9940 could then execute the instruction sequence out of its read/write memory. 3-61 - -- .... --...... - . P31 P30 ;., P29 P28 --..- - -- . ;. 10 ~ 11 12 74148 .. t --.. -- 13 00 ~. ,. 01 02 , 17 16 15 14 .~ .~ I~ - - -.. -- ..:. ..:. TO TC P31 P30 P29 P28 TO TC P31 P30 P29 P28 TO =rc ~ TO P28 P:i9 :. 1'30 - - -- ....:. ~ i. - -- - TC - - I TO :. - - --- 1 P31 P30 P29 P28 .... -.... ---.... 0 'It m m;:en- ~ I- INTi. P27 P26 P25 -- - ... - - 0 'It INTJ P27 en- P26 ~ P25 ~t- ~N I- 0 'It -- ~ INT1 P27 P26 P25 ~ ~ 0 'It INT1 m mM en- I- m mv en- ~ I- P27 0 vm mLn en- ~ TC TO P28 P29 P30 P31 m mU) en- - - P26 P2-S ~;- 0 'It P25 ~U P2S P27 il\il"1 - - INT~ iC TO 0 P28 P29 P30 P31 en" P25 ~ P26 P27 INTi l- v ~~ I- 0 'It m mCXl en- ~ l- -- P25 ~. 1P26 P27 ~ P28 P29 ;., P30 P31 -- - 1 03 02 01 00 11 10 I- TC 1- 4~ 12 P31 TO - -- P25 P26 P27 INT1 74138 04 05 06 07 -... I I- r- l- "'-- -- Figure 3-22. Handshaking Logic in a TMS 9940 Multi-Microcomputer Network Communicating via the TD Data Line 3-62 You could use the CRU to perform any of the three data transfers described above. but the multiprocessor system interface is somewhat easier to use. We say that data transfer via the multiprocessor system interface is "somewhat" easier to use because many problems still remain when you use the multiprocessor system interface. These problems arise from the fact that there is absolutely no handshaking protocol associated with the multiprocessor system interface. For example. there is absolutely no protection against two TMS 9940s simultaneously trying to output data via TO and TC. There is no predefined protocol whereby a transmitting TMS 9940 identifies the receiving TMS 9940 or the instant data has been transmitted and should be read. Any protocol is your responsibility - to be provided by logic external to the TMS 9940s. Fortunately. this protocol is easy to implement. Figure 3-22' shows how eight TMS 9940s can communicate with each other, such that each TMS 9940 may transmit data to, or receive data from, any other TMS 9940. The logic illustrated in Figure 3-22 is more complex than the logic you would need for a small system - for example. a two-microcomputer system. or a system where there are dedicated transmitters and receivers. While Figure 3-22 shows TMS 9940s communicating with each other. you will in fact use TMS 9940s just as frequently with other microprocessors - such as a TMS 9900. Nevertheless. the concepts embodied in Figure 3-22 would apply. from the viewpoint of the TMS 9940. in any other configuration. Let us look at how the logic in Figure 3-22 works. The first problem we must resolve is the problem of transmission contentions. How will we make sure that one TMS 9940 does not try to transmit data while another TMS 9940 is already transmitting data? A simple scheme wou Id be to set aside a particular CRU pin to serve' as a "Busy" line. For example. every TMS 9940 could use P31 as a "Busy" output pin and P30 as a "Sense" input pin. We could wire-OR together all P31 Busy outputs and input this wire-OR to all P30 Sense inputs. Now any TMS 9940 that wishes to transmit data will read its P30 CRU bit. If this bit is O. then it will output 1 to P31. Outputting 1 to P31 causes all otherTMS 9940s to receive 1 at their P30 inputs. Thus. no other TMS 9940 will begin transmitting data if another TMS 9940 was in the process of transmitting data. This logic may be illustrated as follows: P31 P30 All TMS 9940s now receive a high P30 Another TMS 9940 senses pao high - so does not try to output The problem with the logic illustrated above is that two TMS 9940s could simultaneously read P30. find it was O. output 1 to P31. then output competing data on TO. While the chances of two microcomputers executing identical instructions at exactly the same time are very small. a well-designed microcomputer system must account for every potential error. In Figure 3-22 we resolve our problem by using a 74148 8-to-3 decoder. The P31 output from every TMS 9940 is connected to a different 74148 input. The 74148 outputs. via 00.01. and 02. the line number for the highest priority active input. This three-line output is connected to the P28. P29. and P30 pins of every TMS 9940; we assume that these three pins are inputs at every TMS 9940. Now every TMS 9940 that wishes to transmit data via TO must output a 1 to P31. It must then input the contents of P30. P29. and P28. Upon detecting its own 10 on these three inputs. it begins data transmission. If a TMS 9940 outputs 1 via P31 and then reads in some other 10 via P30. P29. and P28. then it must wait. Here is an appropriate instruction sequence: LOOP LI SBO STCR CI JNE LI LDCR R12.>3F8 3 R2.3 R2.ID LOOP R12.>340 R3.16 LOAD P28 ADDRESS. X2. INTO R12 SET P31 ON INPUT P28. P29. AND P30 COMPARE INPUT WITH DEVICE 10 RETURN AND RE-ENTER CODE IF NOT .CORRECT 10 LOAD MPSI OUTPUT DATA BASE ADDRESS X2 OUTPUT CONTENTS OF R3 VIA TO 3-63 Assuming that a TMS 9940 has output 1 to P31 and has received back its own 10 via P28. P29. and P30. the TMS 9940 is ready to transmit data. However. in addition to simply transmitting the data. the TMS 9940 must tell the intended recipient that the data has been transmitted. In Figure 3-22 we use a 74138 3-to-8 demu Itiplexer for this purpose. Pins P25. P26. and P27 of every TMS 9940 are outputs that connect to the 10. 11. and 12 inputs of the 74138. The transmitting TMS 9940 outputs data which will be received by every other TMS 9940; however. the transmitting TMS 9940 follows up by outputting a 3-bit code via P25. P26. and P27; this 3-bit code identifies the intended recipient. The 3-bit code is input to the 74138. which generates one of eight possible outputs. These eight outputs become external interrupt request inputs to the eight TMS 9940s. Only the single TMS 9940 will receive the data which was transmitted by the eighth TMS 9940. only one TMS 9940 will receive an interrupt request signal; this is the TMS 9940 for which the transmitted data was intended. The TMS 9940 which receives data simply executes an STRCR instruction to move the data from CRU bits 1A016 through 1AF16 to the appropriate general purpose register. CRU bit 18516. the CB2 bit. serves the very limited purpose of outputting a synchronizing signal. When you output 1 to CB2. P13 ceases to be an I/O pin and instead outputs the internal TMS 9940 clock signal. TMS 9940 SYNC MODE CRU bit 18616 (CB3) controls idle and hold logic for the TMS 9940. When you write a 1 to CRU bit 18616. pins P14 and P15 act as hold request input (HLD) and hold acknowledge output (HLDA) signals. respectively. P16 generates an IDLE output. The Hold request/acknowledge logic of the TMS 9940 is quite standard. The purpose of this TMS 9940 logic is to remove the TMS 9940 from any shared busses when some other microprocessor or HOLD LOGIC microcomputer is bus master. If CB3 is 1. then a low signal arriving at the TMS 9940 HIT5 input will cause the TMS 9940 to enter a Hold state at the conclusion of the current instruction's execution. A 10w"RiJ5A output marks the beginning of the Hold state. The IDLE signal is output low when an IDLE instruction is executed and CB3 is 1. The only way in which you can terminate an Idle state is by requesting an interrupt via iN"fT or INT2. The TMS 9940 three-state signals are not floated in the Idle state. You must additionally enter the Hold state for this. The purpose of the IDLE instruction and signal is to enable standby power logic. This may be illustrated as follows: +5V ~------~------------------~.. V CC 1 IOLE LOW OPENS SWIT'CH I Under normal circumstances. the power supply will input power to VCC1 and VCC2. When IDLE goes low. the power input to VCC2 is switched off. While VCC1 only is receiving power. the TMS 9940 read/write memory and interrupt logic is active. but all other logic is inactive. since the interrupt logic is active. any arriving interrupt request will be acknowledged. The process of acknowledging an interrupt request sets IDLE high again. This closes the switch and restores power to VCC2. which allows the TMS 9940 to resume normal execution In the illustration above. note that IDLE is connected to"HiJ). 3-64 TMS 9940 GENERAL PURPOSE FLAGS If you look again at Table 3-7 • you will see that CRU addresses 1 BO 16 through 1 BF 16 address 16 general purpose flags. These general purpose flags have no special hardware functions. They are programming aids and that is all. You can write data out to these flags. and you can read back the data. How you use this data is entirely up to program logic. TMS 9940 TIMER/EVENT COUNTER LOGIC The TMS 9940 has a timer which can also be used as an event counter. CRU bit 19E16 determines whether this logic will function as a timer or as an event counter. If CRU bit 19E16 is high. then this logic serves as a Timer. If CRU bit 19E16 is low. then this logic serves as an event counter. Timer and Event Counter logic both use CRU bits 19016 through 19016 as a 14-bit register whose contents are decremented by Timer or Event Counter logic. This 14-bit register is buffered. That is to say. the initial value which you output to CRU bits 19016 through 19016 is stored in a buffer. in addition to being loaded into CRU bits 19016 through 19016. Subsequently. CRU bits 19016 through 19016 are decremented. but the buffer contents remain unaltered. When CRU bits 19016 through 19016 decrement to O. they are reloaded from the buffer. Thus Timer/Event Counter logic runs continuously. An interrupt request is generated internally when CRU bits 19016 through 19016 decrement to O. Remember. CRU bit 19016 is the low-order bit. and CRU 19016 is the high-order bit. This is the reverse of normal Texas Instruments bit numbering. where the high-order bit has the lowest bit number. However. this is consistent with the fact that Texas Instruments outputs data to the CRU low-order bit first. and addresses CRU bits in numerically ascending address sequence. When you write 0 to CRU bits 19016 through 19D16. you disable Timer/Event Counter logic. When the Timer/Event Counter is operating as a timer. the 14-bit register represented by CRU bits 19016 through 19016 are decremented once every 30 internal clock oscillations. The crystal connected across XTAL 1 and XT AL2 determines clock oscillation frequency. When CRU bits 19016 through 19016 time out to zero. an interrupt request is generated. When Timer/Event Counter logic is operating as an event counter. pin P17 serves as an input. receiving the event sequence to be counted. Every low-ta-high transition of the signal input at P17 decrements the counter. Once again. when the counter counts out to O. an interrupt request occurs and the counter is reloaded from its buffer register. TMS 9940 INTERRUPT LOGIC The TMS 9940 has four external interrupts and twelve internal software interrupts. These are the four external interrupts: 1) Reset. This has highest priority. 2) A level 1 interrupt occurring at the INT1 pin. This has second highest priority. 3) A Oecrementer/Event Counter interrupt. This has third highest priority. 4) A level 2 interrupt occurring at the INT2 pin. This has lowest priority. As described for the TMS 9900. you execute XOP instructions to generate software interrupts. XOP4 through XOP15 are active. XOPO through XOP3 do not exist on the TMS 9940. TMS 9940 interrupt vectors. together with a complete TMS 9940 memory map. are illustrated in Figure 3-20. The actual interrupt acknowledge sequence for a TMS 9940 is identical to that which we have described for the TMS 9900. TMS 9940 RESET You Reset the TMS 9940 by inputting a low signal at RST/PE (pin 20). This low signal must last for at least five clock cycles. A Reset resets to 0 the contents of all pointer registers and all CRU configuration bits. Following a Reset level 0 interrupt response beg ins - which means that read-only memory bytes 0 through 3 provide the initial Program Counter and Word Pointer register contents. and therefore the address of the program which will be executed following the Reset. 3-65 Note that the TMS 9940, being a smaller and simpler system than the TMS 9900, can use elementary logic to generate an interrupt acknowledge. For the TMS 9900 we suggested an Address Bus decoding technique in order to create an interrupt acknowledge signal. For the TMS 9940 a CRU bit will do just fine. The following circuit is recommended by Texas Instruments: o INT REa a CLK 7474 Q CLR INT ACK A simple O-type flip-flop has its 0 input connected to +5V. Every time an interrupt request pulse is input to the clock pin, the Q output will go low - generating a valid interrupt request at the TMS 9940. In order to acknowledge the interrupt and remove the interrupt request signal. you can output a low pulse via any of the P pins. This low pulse clears the D-type flip-flop and forces Q high again. PROGRAMMING A TMS 9940E ERASABLE, PROGRAMMABLE READ-ONLY MEMORY The TMS 9940E has a transparent quartz lid over the device in its dual in-line package. In order to erase the TMS 9940E EPROM, you should expose it to a high-intensity ultraviolet light with a wavelength of 2537 angstroms. An intensity of 10 watt-seconds per square centimeter is recommended. After the TMS 9940E EPROM has been erased, all EPROM memory bits will be O. These are the steps required in order to program a TMS 9940E EPROM: 1) Reset the device. 2) Apply the first data byte - to be stored in memory location 0000 to pins P24 through P31. Remember. P24 represents the most significant bit of the byte, and P31 represents the least significant bit of the byte. 3) Apply a 26-volt level to pin 20, the RST /PE pin. This being the first programming pulse, it resets the internal program memory address point at 0000 and writes the data byte at P24 through P31 into memory location O. 4) After at least 80 clock cycles, apply 26 volts to pin 37, INT2/PROG, for 50 milliseconds while changing the data byte (step 5). 5) Apply the next data byte to P24 through P31. At the high-to-Iow transition of PROG, the data will be written into the next location. 6) Remove the 26 volts from pin 37 for a minimum of 50 clock cycles. Then apply 26V to pin 37 for 50 milliseconds. 7) Return to Step 5 until all of program memory has been programmed. LOADING A PROGRAM INTO TMS 9940 READIWRITE MEMORY You can load a program directly into TMS 9940 read/write memory via pins P24(MSB) through P31 (LSB) for either the TMS 9940E or the TMS 9940M. Typically, this is done in order to load a small test program. The procedure for loading data into the TMS 9940 read/write memory is exactly as described in the previous section for loading data into EPROM. except: the 26-volt level is applied to pin 19, the TST pin, after the device has been reset by inputting a low signal to pin 20, the RST /PE pin; and the high pulses at PROG are logic '1' level rather than 26 volts. When you input data to a TMS 9940 read/write memory using the TEST pin and P24 through P31, the address pointer is initialized to address 830016. The address keeps incrementing the high-to-Iow transition of each 50 millisecond programming pulse applied at pin 37. When you finally stop applying programming pulses, the last 16 bits of data input are interpreted as the beginning address for the program to be executed. This address may point to a read/write memory location, or to a read/write memory location. That is to say, the test program may be in read/write memory, in readonly memory, or in both areas. THE TMS 9940 INSTRUCTION SET The TMS 9940 instruction set is identical to the TMS 9900 instruction set, with these exceptions: 1) The RSET, CKOF, CKON and LREX instructions have been deleted. That is, all the external instructions except IDLE. 3-66 2) The XOP instructions will not work with operands 0, 1, 2, or 3. 3) There are new DCA and DCS instructions that enable 8-bit binary-coded decimal arithmetic. Assuming that you start with two valid 8-bit binary-coded decimal operands, you can add these two 8-bit operands using normal binary addition. The result will be a meaningless 8-bit number; however, if you immediately execute the DCA instruction, this meaningless 8-bit number will be converted to a meaningful 8-bit 2-BCD-digit number. DCS, likewise, allows you to perform 8-bit binary-coded decimal subtraction. Assuming that the subtrahend and minuend are both valid 8-bit binary-coded decimal numbers, you perform a subtraction using binary arithmetic and you generate a meaningless 8-bit result. By executing the DCS instruction, you convert this meaningless 8-bit result into a valid 8-bit 2-BCD-digit binary-coded decimal difference. The DCA and DCS instructions both generate in the low-order eight bits of the 16-bit word. For a discussion of decimal adjust logic in BCD addition or subtraction, see Volume 1, Chapter 3. The LlIM instruction loads a 2-bit interrupt mask into the two low-order bits of the Status register. Here are the instruction object codes used by the DCA. DCS, and LlIM instructions: Instruction DCA r DCS r LlIM n Object Code Bytes Clock Periods 0010110000bbssss 0010110001 bbssss 001011001xxxxxnn 2 2 2 7 7 10 The object code notation above conforms to that which we have described for Table 3-3. For the LlIM instruction, x represents "don't care" bits and n represents the two binary digits that get loaded into the two low-order Status register bits. THE TIM 9904 FOUR-PHASE CLOCK GENERATOR/DRIVER This part is also given the generic TTL name: the SN74LS362. The TIM 9904 provides TMS 9900 microprocessors with the four clock signals: <1>1, <1>2, «1>3, and «1>4. These are +12V MOS driver signals. In addition, four complementary +5V clock signals, «1>1, <1>2, <1>3, and «1>4, are generated for use elsewhere in a TMS 9900 microcomputer system. The TIM 9904 device may be driven by an external crystal, an external LC circuit, or a single external clock signal. The TIM 9904 is manufactured using low-power Schottky technology; hence the 74LS part number It is packaged as a 20-pin DIP. All signals, other than the four MaS level clocks, are TTL-compatible. The TIM 9904 allows one asynchronous input Signal to be synchronized, via a D flip-flop, with the «1>3 signal. The synchronized Signal is output frequently to be used as a RESET input to the TMS 9900. Figure 3-23 illustrates TIM 9904 pins and signal assignments. The four clock signals, <1>1,<1>2, <1>3, and «1>4, conform to Figure 3-3 . «1>1, «1>2, <1>3, and ct>4 are complements of <1>1, ct>2, «1>3, and «1>4. A logic level input at D will be output at Q on the high-to-Iow transition of «1>3: cf>3 ---....I o Q 3-67 TANK 1 TANK2 GNDl Q o «1>4 ct>3 ct>3 «1>4 GND 1 2 -- .-. ---- 3 4 5 6 7 8 9 10 TIM 9904 20 19 18 17 16 15 14 13 12 -- - .-. 11 Pin Name -- --.. -:.. VCC1 (+5V) XTAL2 XTALl OSCIN OSCOUT <1>2 ct>1 VCC2 (+ 12V) <1>1 <1>2 Description ct>l, ct>2, ct>3, «1>4 <1>1, ~ ct>3, Power, Ground Type Output Output Input Output Input Output Figure 3-23. TIM 9904 Signals and Pin Assignments OSCOUT provides a clock frequency four times that of the 1 _ _...-./ \~------------------~/ 4>2 ______________~1 \~ \ ________________ 4>3 ______________________~/ \ 4>4~~______________________________~/ 3·68 \ ~r_ When an external quartz crystal is used to drive the TIM 9904, the following connections are required: TANK 1 0.47 J.LH ......_ .......~_--1 2 TANK 2 19 XTAL 1 D ·TIM 9904 17 20 ohm to. 75 ohm crystal, 2 mw power dissipation. (May substitute a 0.1 J.LF capaciton) OSCIN OSCIN must be tied to a high logic level for the internal clock logic to work properly. Required capacitor and inductance values are shown in the illustration above for a TMS 9900 microprocessor operating with its standard 3 MHz frequency. The crystal must have a resonant frequency of 48 MHz. For 48 MHz operation. a third overtone crystal is used. For less precise timing. the quartz crystal may be replaced with a 0.1 JLf capacitor. The LC-tuned circuit now establishes the clock frequency according to the following equation: fosc = 1/(2",$) where L is the inductance. with units of Henries. and C is the capacitance with units of Farads. This includes the capacitance of the circuit into which the components are mounted. If an external clock signal is input, it must occur at OSCIN. The crystal connections XTAL 1 and XTAL2 should be connected to VCC as follows: + 5V NOT {TANK 1 CONNECTED TANK 2 20 2 19 TIM 9904 18 17 3-69 XTAL2 XTAL1 OSCIN } TIED TO LOGIC '1' CLOCK INPUT The clock input OSCIN must have a frequency which is four times the clock period frequency and has a 25% duty cycle. Thus. for a 3 MHz frequency, a 12 MHz signal must be input via OSCIN: 1..........- - OSCIN "1 83.3ns --Jr---\,__________--.',..--, ______ \~ ~20.8ns~ I In TMS 9900 microcomputer systems, the 0 input is used for an asynchronous reset; Q is output as a synchronous reset. This may be illustrated as follows: Vee ) . 10Kn: 100.0 .AAA 1 ! - TIM TMS 9904 9900 a 0 ..- RESET 1}LF --- I- The illustration above shows recommended resistor and capacitor values. THE TMS 9901 PROGRAMMABLE SYSTEM INTERFACE (PSI) The TMS 9901 Programmable System Interface (PSI) is a special support part designed for the TMS 9900 series of microprocessors. This relatively primitive device uses 32 bits of the TMS 9900 CRU bit field to support parallel I/O and interrupt request logic. Programmable timer logic is also available. Figure 3-24 illustrates that part of general microcomputer system logic which has been implemented on the TMS 9901 PSI. The TMS 9901 PSI is packaged as a 40-pin DIP. It uses a single +5V power supply. All inputs and outputs are TTL-compatible. The device is implemented using N-channel silicon gate MOS technology. 3-70 Clock Logic Accumulator Registensl Arithmetic and Logic Unit Data Countens) Stack Pointer Program Counter Read Only Memory Figure 3-24. Logic of the TMS 9901 Programmable System Interface 3-71 -- --.... RS'fi CRUOUT CRUCLK CRUIN iN'i'6 iN'f5 -- .-. INT4 iNT3 Cii INTREQ (LSB) IC3 IC2 IC1 (MSB) ICO Vss wn INT2 P6 P5 --- .. -- ---- - ... : - ---- .... Pin Name CRUIN CRUOUT CRUCLK PO - P15 iNTT -INT15 INTREQ ICO - IC3 CE SO - S4 RSTf 4l VCC' Vss 1 2 3 4 5 6 7 . 8 9 10 11 12 13 14 15 16 17 18 19 40 39 38 37 36 35 34 TMS 9901 -20 33 32 31 30 29 28 27 26 25 24 23 22 21 --- -.. -- .. ... ----- ---.-. -- ..... -- ..-.. --- ---- .. ---- --..... -. -- - Description CRU data output CRU data input CRU data input strobe I/O data External interrupt requests Interrupt request to CPU Interrupt priority designation Chip Enable CRU bit select Chip reset Synchronizing clock signal Power, Ground reference VCC (+5V) SO (MSB) PO P1 S1 S2 INT7/P15 INT8/P14 INT9/P13 INT10/P12 INT11/P11 iN'fi2/P10 INT13/PS INT14/P8 P2 S3 S4 (LSB) INT15/P7 P3 P4 Type Output Input Input Input or Output Input Output Output Input Input Input Input Figure 3-25. TMS 9901 Programmable System Interface Signals and Pin Assignments In the illustration above, Address lines have been numbered using our standard notation, whereby A 14 is the highestorder address line and AO is the lowest-order address line. This is the opposite of Texas Instruments' notation. The CRU select lines are numbered according to Texas Instruments' notation and Figure 3-25. Therefore, S4 is connected to AO, and SO is connected to A4. 3-72 TMS 9901 PSI PINS AND SIGNALS The TMS 9901 pins and signals are illustrated in Figure 3-25. The signals which connect the TMS 9901 to a TMS 9900 series microprocessor are quite straightforward; they consist of the CRU and interrupt signals. The CRU signals include CRUIN. CRUOUT. and CRUCLK. The interrupt signals consist of INTREQ. ICO, IC1, IC2, and IC3. For a description of CRU and interrupt signals, refer back to our TMS 9900 discussion. Device select logic includes a chip enable input, CE, together with five CRU bit select pins, SO - S4.a and SO S4 will connect to the Address Bus as follows: ..--:.- ·· - - .6.3 .;: AD -. 1 A5 A4 - .': .r •••• r A14 A2 Ai S4 DEVICE S3 _ SELECT S2 .. .~ S1 • TMS 9901 SO .. CE. In the illustration above, Address lines have been numbered using our standard notation. whereby A 14 is the highestorder address line and AO is the lowest-order address line. This is the opposite of Texas Instruments' notation. The CRU select lines are numbered according to Texas Instruments' notation and Figure 3-25. Therefore, S4 is connected to AO. and SO is connected to A4. 3-73 Device select logic determines the CRU address space that will be reserved for the TMS 9901 PSI. This may be illustrated as follows: = .. ;, ~ ··· ·•... ':, ... :-= - A14 A13 A12 A11 A5 A4 A3 A2 A1 AO r ...... l) --.. CRU ACCESS I, M"E'M'EN DEVICE SELECT 1, I 000 n n n n EE SO II n n n x ,r S1 x S2 S3 S4 x r •• x x ~ '---....- - -.....v-...---",?"~ These three bits zero and MEMEN inactive (high) indicate a CRU address These seven bits identify the TMS 9901 address space. These five bits select a CRU bit in the TMS 9901 PSI The high-order three address lines. which we call A 14. A 13. and A 12. are all zero during a CRU access. at which time MEMEN is inactive (high). Thus we decode address lines A 11 through A5 to select a particular TMS 9901 device. . Since the TMS 9980 uses the Address Bus differently during a CRU operation. TMS 9901 device select logic would connect to the Address Bus in a different way. The CRU bit select lines SO - S4 would be tied to lines A5 - A 1; device select logic would decode lines A11 - A6; and lines A13 and A12. along with MEMEN. would indicate a CRU access. We illustrate this as follows: MSB A13 o LSB A12 0 A11 A10 A9 AS A7 A6 A5 n n n n n n x A4 x A3 x A2 x A1 x AO . - Address Bus ~ ~,------..--~v-~----------~~ ~'----"--~~~-------'~ These six bits identify the TMS 9901 address space These five bits select a CRU bit CRUOUT These two bits zero, along with MEi\ii"Ei\i inactive, indicate a CRU address is the complement of <1>3. For the TMS 9900. <1>3 is generated by the TMS 9904. The TMS 9980 outputs <1>3 directly. The best way of understanding the interface between a TMS 9901 and external logic is to look at functions performed. as illustrated in Figure 3-26. 3-74 INTERRUPT MASK BITS o SELECT BIT ICO ~--.r---, IC2 .....~-....... INTERRUPT PRIORITY ENCODER IC3 _ _......J IC1.---I ~--L INTREQ .....- - - ( CLOCK LOAD BUFFER CRUOUT - -__... CRU CRUCLK ----t. . INTERFACE~----------' CAUIN ....I---~ SO S1 S2 'S3 ~ PO-P6 CRU BIT SELECT LOGIC S4 CE Figure 3-26. TMS 9901 PSI General Data Flows and CRU Bit Assignments 3-75 From the programmer's viewpoint. a TMS 9901 looks like 32 contiguous CRU bits. Thus. you will access any part of a TMS 9901 device's logic using CRU input and output instructions. As you read through the TMS 9901 description that follows, you should bear in mind the power of multi-bit CRU load and store instructions as they apply to TMS 9901 architecture. A single instruction transferring an appropriate bit pattern can frequently perform mu Itiple control and data transfer operations. The manner in which CRU bits are used by the TMS 9901 is not straightforward. This is because CRU bits share functions and pins. Functions and pins are shared in different ways. Let us first look at pin connections. CRU bits 1-6 connect to pins TNiT - INT6; thus. in interrupt mode each of these CRU bits has its own dedicated input pin. .- CRU bits 7-15 share nine input or output pins with CRU bits 23-31. CRU bits share pins as follows: 31 30 29 7 8 28 27 26 25 24 10 11 12 13 14 23 15 t 9 4 4 ,. ...,. ~ ~ ~ ~ ~ .. ~ . 34 33 32 31 ~ ~O ~ 29 28 27 4 ~ ~ --I t Device Pins 23 I These CRU bits support interrupt logic These CRU bits are dedicated to data I/O Each of the CRU bits shown above shares a pin with another CRU bit. That is to say. within the illustrated CRU address range. there are two CRU bits which will access the same pin. although each CRU bit performs a different operation. Thus you use the same pin in one of two different ways. using a bit address to select one operation. This may be illustrated as follows: If you select CRU bit 27. Pin 30 supports data I/O If you select CRU bit 11, and interrupt mode, Pin 30 serves as an interrupt request input 27 ') I 30 .--11-....' CRU bits 16-22 connect to parallel I/O pins. These bit addresses are not shared with any other TMS 9901 functions. CRU bit 0 is a select bit that is not connected to any pin. A 1 written into this bit causes bits 1-15 to support realtime clock logic. A 0 written into CRU bit 0 selects interrupt logic. When CRU clock logic is selected. bits 1-14 function as two 14-bit real-time Clock Buffer registers -: one a read-only register. the other write-only. Real-time clock logic is separate from. and operates simultaneously with. and/or parallel 110 logic. That is to say. the process of selecting realtime clock logic does not disable any other logic. The select bit merely chooses which registers CRU addresses will access. rather than enabling or disabling any operations. TMS 9901 PSI INTERRUPT LOGIC The easiest place to start understanding the TMS 9901 is at its interrupt logic. External logic can input data to CRU bits 1-15 via their connected pins. These input data signals will be interpreted as interrupt requests if interrupts are enabled. If interrupts are disabled, then these CRU bits act simply as data input. 3-76 You access interrupt logic through the CRU when the select bit, CRU bit 0, contains a O. CRU bit addresses 1-15 each access separate read-only and write-only locations. The read-only location stores the signal level input at the attached pin. The write-only location accesses an interrupt mask bit. This may be illustrated as follows: WriteOnly Mask Bit ReadOnly Data Bit -- N NT 1 { CRU Bit N + 1 { +1 } From Pins I I I I I CRU Bit N - f4I I - N N I -- Signals arriving at pins connected to CRU bits 1-15 are immediately reflected by CRU bit contents: ReadOnly Data Bit 0 I I ~ Low High A low level (that is. a 0 bit) is interpreted as an interrupt request. The interrupt request is passed on to the mask bit. If the mask bit contains 1. the interrupt is enabled and the interrupt request is passed on: WriteOnly Mask Bit Interrupt Request ReadOnly Data Bit I I I· -4 0 I I I: Low High If the mask bit is O. the interrupt request is disabled and therefore denied: WriteOnly Mask Bit 0 ReadOnly LJata Bit I I I· 0 3-77 I I I: Low High Quite apart from interrupt logic. the CPU can at any time read the contents of one or more CRU bits in the address range 1-15. Here are some instructions that may access CRU bits 1-15 in various ways: LDCR R12.PSI+1 R1.MASK R1.15 LOAD CRU BASE ADDRESS INTO R12 LOAD INTERRUPT MASK BITS INTO R1 OUTPUT TO WRITE-ONLY MASK LOCATIONS STCR R2.15 INPUT CRU BITS 1 THROUGH 15 AS DATA TO R2 LI LI For some randomly selected data levels. CRU bits 1-15 may be illustrated as follows: Interrupt Mask Bits CRU Bits 1 Bits Pass on Interrupt Reque sts 1/ - 2 1 2 3 0 3 1 4 1 4 0 5 1 5 1 6 0 6 0 7 0 7 0 8 0 8 1 9 1 1 10 0 '\- t *- 1 1 - 11 12 1 - 14 1 13 0 15 0 1 -- ... ... - 0 1 9 1 10 0 11 0 12 0 13 1 --- 14 0 15 1 ~Bit Number~CRU Data to CPU o Bits Generate Interrupt Requests . ..-.. .. ----··.. ----- --. ... ... · - - If one or more CRU bit's interrupt requests are low. and the corresponding mask bit is 1. then interrupt priority encoder logic outputs INTREQ low. Simultaneously. the level of the active interrupt request which has highest priority is identified via ICO - IC3. ""iNTf. input to CRU bit 1. has highest priority; INT15. input to CRU bit 15. has lowest priority. The levels at ICO - IC3 are maintained until the interrupt request signal is removed at the external pin. or the interrupt mask bit for the level is reset to O. TMS 9901 PSI DATA INPUT AND OUTPUT You can use CRU 1/0 instructions to input, output, or test external data at CRU bits 16-31. Data is output from the CPU to the TMS 9901 via CRUOUT; it is input from the TMS 9901 to the CPU via CRUIN. Bits are addressed via SOS4. as we have already described. Following a reset, pins connected to CRU bits 16-31 are in input mode. In this mode. external logic can assert high or low levels at connected pins. in which case one or two CRU bits will be affected: a signal input to PO - P6 will generate data in CRU bits 16-22; if interrupt mode is selected (by a 0 in CRU bit OJ. a signal input to INT?IP15-INT15/P? will 3-78 generate data in two CRU bits, one in the CRU bit range 7-15, the other in CRU bit range 31-23. In interrupt mode. if the CPU inputs data from CRU bits 7-15 or 31-23. then it will input the same data. but in reverse order. This may be illustrated as follows: CRU Bits R12,PSI + 7 Rl,9 LI STCR 0196 16 Loaded into R1 7 9 10 LI STCR 0003 R12,PSI + 23 Rl,9 16 Loaded into R1 0 8 11 0 1 12 0 13 0 Pins 34 4--0 14 33 ~1 15 32 ~1 31 4--0 23 24 1 25 0 26 27 0 28 0 30 ~1 29 28 ..--0 .--0 27 23 4--1 .--1 29 30 31 0 Note that. as in all CRU transfers, the first CRU bit transferred goes to the least significant bit position of the destination register. As soon as the CPU outputs data to any bit capable of supporting data output. the I/O logic associated with this bit is put into output mode. In this mode, a pin will output a voltage level reflecting data in the corresponding CRU bit. External logic cannot input data to a CRU bit that is in output mode; in fact. driving input currents into an output pin may damage the TMS 9901. Once a CRU bit has been placed in output mode. it remains in output mode until the TMS 9901 is reset. That is to say, you cannot selectively return CRU bits from output mode to input mode. However, you can always read output bits back to the CPU; that is, although external logic must never attempt to input to a pin that is in output mode. the CPU can always read the contents of any 1/0 bit. whether it is an input or an output. You cannot output data via CRU bits 7-15, even though these bits are connected to the same pins as CRU bits 31-23. When you output data to CRU bits 7-15, the data is routed to one of two write-only locations, depending on the contents of CRU bit 0: if the select bit is 0, the data goes to interrupt mask bits 7-15; if clock mode is selected (CRU bit contains 1). the data goes to the Clock Load Buffer register (bits 7-14) and RST2 (bit 15). ° In interrupt mode you can input external data from CRU bits 1-6. Once again. you cannot output data via these CRU bit addresses, since any data output will be routed to corresponding interrupt mask bits or Clock Load Buffer bits. 3-79 TMS 9901 REAL-TIME CLOCK LOGIC If you write a 1 into CRU bit 0 of a TMS 9901 device, then CRU bits 1-14 are used as two 14-bit Clock buffers, which may be illustrated as follows: 234 CRUOUT 5678910111213 ---.1........._........._........._........_. . . . . _. . . .....11........._ MSB CRUIN 14"-CRUBitNumber Clock Load Buffer ....."'" LSB ~ I.... . . ._.a..-............._ ....................._ .................._ ......-...... Clock Read Buffer Besides these two buffers. real-time Clock logic contains a decrementing r,gister which we call the Clock Counter register. The CPU loads the Clock Counter register via the Clock Load Buffer. and reads the Counter contents via the Clock Read Buffer. We illustrate this in the following way: .... - CRUOUT ....~ CLOCK BUFFER REGISTER '< ~ CLOCK COUNTER REGISTE(R CRU INTERFACE "< >' CRUIN - A. ... I I CLOCK READ BUFFER The Clock Counter register decrements continuously as long as the TMS 9901 is powered up. This will cause no problems as long as the clock interrupt is disabled. When you write any non-zero value into the Clock Load Buffer (CRU bits 1-14), the Clock Counter register starts decrementing from that value. A decrement occurs once every 64 clock pulses. Thus. with a 3 MHz clock. a decrement occurs once every 21.3 microseconds. When the CRU Clock Counter register decrements to 0, an interrupt request is generated, the previously output starting value is reloaded, and the clock starts to decrement again. Thus. with a 21.3-microsecond time interval between decrements. the maximum time interval between interrupt requests will be 249 milliseconds. pulse which causes the Clock Counter to decrement. • An exit from clock mode. Thus, the Clock Read Buffer register is updated whenever the TMS 9901 leaves clock mode, and every time the Clock Counter decrements outside of clock mode. Beware - even if CRU bit 0 contains a 1, the TMS 9901 will exit clock mode for as long as it sees a 1 on select line SO; this will happen whether or not CE is active. Thus the Clock Read Buffer will not hold the same value indefinitely just because the TMS 9901 select bit is set. The PSI will leave clock mode whenever the CPU reads to or writes from CRU bits 16-31, or if any device accesses a memory address with a 1 on the address line connected to SO (A4 in a TMS 9900 system). The logic c'ontrolling clock mode and the Clock Read Buffer may be illustrated .as follows: 7$-----1 DECREMENT CLOCK COUNTER +64 SELECT BIT (CRU BIT 0) UPDATE CLOCK READ BUFFER SO This logic summarizes our discussion above. There are two important things to note about clock mode and Clock Read Buffer update. First. you cannot inadvertently exit clock mode while you are reading the Clock Read Buffer, since you access it as CRU bits 1-14. Second, you cannot enter clock mode solely by accessing CRU bits 0-15; SO changes clock mode only when the select bit is 1 (clock mode selected). In order to read the most recent Clock Counter value, you must do two things: • Exit clock mode so the Clock Read Buffer will receive the current Clock Counter contents. • Enter clock mode so the Clock Read Buffer will be stable during the read itself. Here is the appropriate instruction sequence: LI SBZ SBO STCR R12,PSI+1 -1 -1 R1,14 LOAD PSI CRU BASE ADDRESS EXIT CLOCK MODE TO UPDATE READ BUFFER ENTER CLOCK MODE TO STABILIZE READ BUFFER READ 14-BIT CLOCK READ BUFFER TMS 9901 RESET LOGIC You can reset a TMS 9901 in one of two ways: 1) 2) By inputting a low signal at RSf"i. By using a programmed reset via RST2, a CRU bit. In order to use RST1, a low level must be input at 'this pin for at least two clock periods. You can reset the TMS 9901 under program control only when clock mode is selected (CRU bit 0 is 0). At this time, writing a 0 to CRU bit 15 (RST2) causes the device to be reset. Thus, the following instruction sequence causes a TMS 9901 device reset: LI SBO SBZ R12,PSI o 15 LOAD PSI CRU BASE ADDRESS ENTER CLOCK MODE RESET PSI When the TMS 9901 is reset. the INTREQ signal is output high, ICO through IC3 are output low, all interrupt requests are disabled, and all I/O CRU bits are placed in input mode. 3-81 THE TMS9902 ASYNCHRONOUS COMMUNICATIONS CONTROLLER The TMS9902 microprocessor family includes two serial I/O parts. The TMS9902 is a simple, asynchronous communications device; the TMS9903 is a more powerful, recently introduced multifunction device. Both of these parts are peculiar to the TMS9900 since they communicate with the CPU via its CRU logic. The two parts are also pin-compatible; that is, the same 20-pin socket can hold either the TMS9902 (an 18-pin part) or the TMS9903. The TMS9902, which we are about to describe, offers asynchronous I/O capabilities comparable with those of parts which we describe in Volume 3. The TMS9902 lacks some features which other parts offer: 1) There are no external clocking signals for received or transmitted data. Receive and transmit rates are computed by logic internal to the TMS9902. 2) There is a single interrupt request which has no accompanying status output lines. Thus interrupt service routines must interrogate status in order to correctly service the interrupt. 3) The TMS9902 has only three Modem control lines and no other lines for handshaking with peripheral logic. One advantage of the TMS9902 is that it occupies very little board space. It is an 18-pin part the smallest serial I/O controller on the market. It requires less surrounding logic because it uses the system clock for its time base, and because it provides almost no external status or handshake lines. Another advantage of the TMS9902, when compared to other serial I/O parts, is the presence of real-time clock logic. Anyone who has worked with serial I/O logic will appreciate the ability to generate interrupt requests at fixed time intervals. The TMS9902 is fabricated using NMOS technology. It is packaged as an 18-pin DIP and requires a single +5V power supply. All Signals are TTL-level compatible. TMS9902 ACC PINS AND SIGNAL ASSIGNMENTS TMS9902 pins and signal assignments are illustrated in Figure 3-27. These signal assignments are the same as those of pins 1 through 9 and 12 through 20 of the TMS9903. INT TxD RxD CRUIN RTS CTS DSR CRUOUT VSS (GND) 1 2 3 4 5 6 7 TMS9902 18 17 16 15 14 13 12 11 8 9 10 VCC (+5V) CE ~ CRUCLK SO (MSB) S1 S2 S3 S4 (LSB) Pin Name Description Type CRUIN CRUOUT CRUCLK CRU data output to CPU CRU data input from CPU CRU data strobe Device select CRU bit address Synchronizing clock Data set ready indicator Request to send indicator Clear to send indicator Serial data in Serial data out Interrupt request to CPU Power, Ground reference Output Input Input Input Input Input Input Output Input Input Output Output CE SO-S4 iii DSR m CTS RxD TxD iNT VCC' VSS Figure 3-27. TMS9902 Asynchronous Communications Controller Pins and Signal Assignments 3-82 Table 3-9, 'TMS9902 Control and Status Register Bit Interpretations CRU!REGISTER BIT NUMBER CONTROL REGISTER (WRITE) Device Reset (write 1 or 0) STATUS REGISTER (READ) 31 Any interrupt pending' 30 One or more of control bits 17, 14, 13, 12, or 11 set to l' 29 DSR or CTS input level change detected, Reset by writing 1 or 0 to CRU bit 21 , 28 27 Complement of CTS input level Complement of DSR input level 26 Complement of RTS output level Timer time out', Reset by writing 1 or 0 to CRU bit 20, 25 24 Timer overrun error', Reset by writing 10r 0 to CRU bit 20, 23 Transmit Shift register empty', Automatic reset, 22 Transmit buffer empty', Reset by writing to high-order Transmit buffer bit. Enable interrupts on DSR or CTS input level change (1 = enable, 0 = disable) 21 Receive buffer loaded', Reset by writing 1 or 0 to CRU bit 18, Enable timer interrupts (1 = enable, 0 = disable) 20 DSR or CTS input level change interrupt pending', Reset by writing 1 or 0 to CRU bit 21, Enable transmitter interrupts (1 = enable, 0 = disable) Enable receive interrupts (1 = enable, 0 = disable) 19 Timer interrupt pending', Reset by writing 1 or 0 to CRU bit 20, Transmit Break (1 = enable, 0 = disable) 17 Transmit interrupt pending', Reset either by writing 0 to CRU bit 19 or by writing to high-order Transmit buffer. bit, Enable transmit I~ (Complement of RTS output) 16 Receive interrupt pending', Reset by writing 1 or 0 to CRU bit 18. Test mode select (1 = Test mode, 0 = normal operation) 15 RxD input level Write to Parameter register 14 Receive start bit detected', Reset automatically at end of received character, Write to Timer register 13 Receive first data bit detected'. Reset automatically at end of received character, Write to Receive Data Rate register 12 Receive framing error detected', Reset automatically by error free received character. Write to Transmit Data Rate register 11 Receive overrun error detected', Reset automatically by error-free received character, 10 Receive parity error detected." Reset automatically by error-free received character, 9 Any receive error detected." Reset automatically when Status register bits 12, 11, and 10 are all 0, 18 / Receive Data Rate register or Transmit Data Rate register ~ I I Parameter register, Timer register, or Transmit buffer I = "true" condition, 0 = "false" 1'1 I I 4 t , '1 8 7 6 5 3 2 1 o condition, 3-83 ~ > I Signals that connect the TMS9902 to a TMS9900 series microprocessor include the three CRU signals CRUIN. CRUOUT. and CRUCLK. together with device select logic signals CE and SO-S4. The TMS9902 uses these signals exactly as described for the TMS9901. CE must be low for the TMS9902 to be selected; if the TMS9902 is selected. then data transfers occu r via the CRUIN or CRUOUT lines. SO-S4 identify the CRU bit within the selected TMS9902. Table 3-9 summarizes the way in which the TMS9902 assigns its 32 CRU bit addresses for read and write operations. DSR. RTS. and CTS are standard handshaking control signals for communications devices. DSR is a general purpose input signal; its level is reported in Status register bit 27. You can program DSR to generate an interrupt request when it makes a high-to-Iow or low-to-high transition. However. DSR plays no part in enabling either transmit or receive logic. The TMS9902 outputs RTS low while tranSmit logic is enabled. But the transmitter will not actually start transmitting data until CTS is input low. In a standard asynchronous protocol system. TMS9902 transmit logic will output Ri'S low and sometime later receive a low CTS input - at which time it will actually start transmitting data. But if TMS9902 transmit logic finds CTS low when it outputs RTS low. it will start transmitting immediately. For a discussion of Modem handshaking control signals. see Volume 1. Chapter 5. Serial data is input via RxD and output via TxD. External logic does not provide signals that clock the serial input or output data. Instead. the CP synchronizing clock input signal is used to derive data transmit or receive rates. Usually. 3 (the complement of CPU clock <1>3). However. you may use any clock signal that satisfies the timing requirements given in the TMS9902 data sheet at the end of this chapter. TMS9902 DATA TRANSFER AND CONTROL The various addressable locations within the TMS9902 are summarized in Figure 3-28. When you write to CRU bits 31 through 11 you will always access the Control register; when you read these bits you will access the Status register. CRU bits 10 and 9 are also read-only status flags. CRU bits 0 through 7. on a read. always access the Receive buffer; but via CRU bits 0 through 10 you can send data to a variety of write-only locations. The Control register contains four address bits. each of which corresponds to one of the write-only TMS9902 locations. When an address bit is set to 1. the associated write-only register will receive REGISTER data output via CRU bits 0 through 10. If more than one write-only location is selected. then ADDRESSING the select priorities shown in Table 3-10 apply. The Transmit Buffer is selected when all four address bits contain O. If any address bit is set to 1. Status register bit 30 will also contain 1. When you write to the high-order (highest numbered) bit of the Parameter register. the Timer register. or the Receive Rate register. you automatically reset that location's address bit in the Control register. Table 3-10. TMS9902 Write-Only Register Select Scheme CRU Output Bit CRU Bits in Location Addressed Location 14 13 12 11 1 0 0 0 0 X 1 0 0 0 X X 1 X· 0 X X X· 1 0 Parameter register Timer register Receive Rate register Transmit Rate register Transmit buffer 7-0 7-0 10-0 10-0 7-0 "X" means "does not matter" • If both bits 11 and 1 2 are set to 1, data will be written to both Rate registers at the same time. ----- - Following a device reset. all write-only location address bits in the Control register are set to 1. This allows you to write data to registers in the priority order shown in Table 3-10 during the device initialization process. without having to reset individual address bits. Thus the initialization process will consist of these steps: 1) Reset the TMS9902 by writing to Control register bit 31. 2) Write to the Parameter register. 3-84 TMS9902 DEVICE INITIALIZATION 3) Write to the Interval Timer register. 4) Write to the Receive Data Rate and Transmit Data Rate registers. 5) Write to the Control register and Transmit buffer. Transmit Logic CRUOUT CRUIN CRUCLK INT CE SO S1 S2 S3 S4 Transmit Buffer CPU Interface Logic TxD Transmit Rate Register· Status Register Control Register Parameter Register· Receive Rate Register Receive Buffer RxD Receive Logic Timer Logic Figure 3-28. TMS9902 Functional Logic Texas Instruments' literature suggests an initialization instruction sequence such as the following: LI SBO LDCR LDCR LDCR LDCR R12.CRUBS 31 @CNTRL.8 @INTVL.8 @RDR.11 @XDR.12 INITIALIZE CRU BASE ADDRESS IN R12 RESET COMMAND LOAD PARAMETER AND RESET BIT 14 LOAD INTERVAL AND RESET BIT 13 LOAD RECEIVE RATE AND RESET BIT 12 LOAD TRANSMIT RATE AND RESET BIT 11 3-85 In the sequence above, CRUBS represents the base address for the 32 CRU bits in the TMS9902. Fou r memory locations -labeled CNTRL. INTVL. RDR. and XDR - hold the values to be loaded into the write-only locations. Since CRU bit 11 is not reset automatically. the instruction which writes to the Transmit Data Rate register writes 12 bits. the highorder bit being a 0 for CRU bit 11. Let us now examine Control register bits in detail. Control register bits may be divided into interrupt enable/disable bits. write-only location address bits. the reset control. and the test mode control. TMS9902 CONTROL REGISTER The test mode control (bit 15) is usually left at 0: this causes normal operations to occur. When TMS9902 you set the test mode control bit to 1, RTS is internally connected to CTS and RxD is interTEST MODE nally connected to TxD. Also. DSR is held low internally and the interval timer operates at 32 times its normal rate. You will operate the TMS9902 in this condition only when testing its logic. You reset the TMS9902 by writing either a 0 or a 1 to Control register bit 31. You will usually begin every event sequence with a Reset. The following instructions constitute TMS9902 resets: LI SBO R12.ACC 31 or LI SBZ R12.ACC 31 ACC is a label identifying CRU bit 0 (the CRU base address) for the TMS9902. When the TMS9902 is reset, the following events occur: 1) All interrupts are disabled. 2) RTS is output high: this is the inactive state for RTS. 3) Control register bits 11. 12. 13. and 14 are set to 1. All other Control register bits are reset to O. The TMS9902 should not be accessed for a minimum of eleven clock cycles following the reset command. There are four interrupt enable control bits. They enable interrupts when set to 1 and disable interrupts when reset to O. TMS9902 INTERRUPT Control bit 21 enables CTS and DSR input signal level change interrupt requests. ENABLE Control bit 20 enables timer time out interrupt requests. Control bit 19 enables Transmit buffer empty interrupt requests. Control bit 18 enables Receive buffer full interrupt requests. In each case a Status register bit is set to identify the condition that can generate an interrupt request. But the interrupt will not actually be requested unless the associated interrupt enable control bit has been set to 1. r------.. . . You acknowledge any interrupt other than a transmitter interrupt by writing to the interrupt's TMS9902 enable control bit. To acknowledge an interrupt and leave it enabled. rewrite a 1 to the interINTERRUPT rupt enable control bit. To acknowledge an interrupt and then disable it. write a 0 to the interACKNOWLEDGE rupt enable control bit. But remember. you must write either a 0 or a 1 to the interrupt enable control bit. since this is the mechanism used to reset the status flags that identify the interrupting condition. You acknowledge a transmitter interrupt by writing to bit 7 of the Transmit buffer. If you write a 0 to CRU bit 19. you will disable the interrupt. but you will not reset the status flag which was set by the emptying of the Transmit buffer. Control register bits 16 and 17 directly control two TMS9902 operations. Control register bit 16 is the complement of the RTS output. You must write a 1 to this bit in order to set RTS low. In order to enable transmit logic. RfS must be output low while CTS is being input low. You must leave RTS low while the transmitter is active. To disable the transmitter you raise RTS high again by writing 0 to Control register bit 16: if transmit logic is part way through transmitting a character when you write a 0 to Control register bit 16, then it will complete transmitting the character - and the character in the Transmit buffer. if the buffer is full- before outputting RTS high. Transmit break logic is controlled via Control register bit 17. When you set this bit to 1, a TMS9902 break (continuous low output) will be transmitted following the next underrun (that is, when both BREAK the Transmit register and Transmit buffer are empty). You must end the break by writing a 0 to LOGIC Control register bit 17 before you can restart transmitting by writing new data to the Transmit buffer. If you leave Control register bit 17 reset to 0, then following an underrun the transmitter will mark (output a continuously high signal). You can end the mark at any time. and start transmitting a new message. by writing fresh data to the Transmit buffer. 3-86 When the break control bit is set to 1. Status register bit 30 will also contain a 1. Let us now examine Status register bits; they may be grouped as follows: 1) 2) Signal level indicators Transmit operation status 3) 4) 5) Receive operation status Timer logic Interrupt logic TMS9902 STATUS REGISTER Status register bits 27 and 28 report the complement of the DSR and CTS input signal levels. Bit 26 reports the complement of the RTS output signal level. When the DSR or CTS input changes level, bit 29 is set. You reset bit 29 by writing to Control register bit 21. There are three transmit logic status bits. Bit 22 is set when the Transmit buffer is empty. The bit is reset when you next write data to the Transmit buffer. Bit 23 is set when the Transmit Shift register is empty; this is an underrun condition. Following an underrun. a break or a mark will be transmitted. depending on the level of Control register bit 17. Bit 30 of the Status register contains a 1 if any of the following Control register bits are set to 1: TMS9902 TRANSMITTER STATUS • Bit 17. the break control bit • Bits 14. 13. 12. and 11. the write-only. location address bits Thus Status register bit 30 will be set to 1 whenever Transmit buffer loading is disabled. For receive logic. bit 21 is set when the Receive buffer is full. The CPU resets this bit by writing to bit 18 of the Control register: usually the program will read the contents of the Receive buffer before resetting the flag bit. TMS9902 RECEIVER STATUS RxD, the serial data input line level. is reported at Status register bit 15. The start of each received character is identified by Status register bits 14 and 13. When the start bit has been detected, Status register bit 14 is set. One bit time later, when the first data bit is being detected, Status register bit 13 is set. These two bits remain set until the end of the character. They are reset when the last stop bit has been detected. Framing, overrun, and parity errors are reported by Status register bits 12, 11, and 10, respectively. These error status bits. once set. remain set until an error-free character is loaded into the Receive buffer. If one or more of the three receive error conditions exist, then Status register bit 9 is set. There are two timer status bits. Whenever the timer times out, Status register bit 25 is set to 1. This bit must be reset by writing 0 or 1 to Control register bit 20. If you do not do so before the next time out. then Status register bit 24 will be set, indicating a timer error. The timer error is also cleared by writing 0 or 1 to Control register bit 20. TMS9902 TIMER STATUS The four interrupt generating conditions have associated status bits which are set following an interrupt request. If the DSR or CTS input signal changes level, and the interrupt logic has been enabled, then Status register bit 20 is set at the time that an interrupt request is generated. If a time out occurs and timer interrupts have been enabled, then Status register bit 19 is set at the time an interrupt request occurs. TMS9902 INTERRUPT STATUS When the Transmit buffer becomes empty, if transmitter interrupts have been enabled, then Status register bit 17 is set at the time an interrupt request occurs. When the Receive buffer is full, if receive interrupts have been enabled, then Status register bit 16 is set at the time a receiver interrupt request is generated. If one or more of these interrupt requests are active, then Status register bit 31 is set. Interrupt status bits remain set until you reset either the status bit for the interrupting condition. or its interrupt enable bit in the Control register. In most cases. writing to the enable bit resets the status bit. For a Modem signal interrupt you must write to Control register bit 21 in order to acknowledge the interrupt. thus resetting the two Status register bits. For a timer interrupt you must write to Control register bit 20 to reset the interrupt. For a Transmit buffer empty interrupt you must write new data to the Transmit buffer in order to acknowledge the interrupt: specifically. you must write to bit 7 of the Transmit buffer. 3-87 For a Receive buffer full interrupt. you must write to Control register bit 18 in order to acknowledge the interrupt. Let us now examine Parameter register contents. After resetting the TMS9902, the next step is to identify subsequent operations by loading appropriate data into the Parameter register. Parameter register bits are interpreted as follows: 6 5 432 o TMS9902 PARAMETER REGISTER ~BitNo. X Parameter register ~--~--~~~--~~--~~ L{ OO 01 10 11 L-_ _ _ _ _ _ _ j 0 11 00 01 10 11 - 5-bit data words - 6-bit data words - 7 -bit data words - 8-bit data words - Divide! by 3 to generate ClK - Divide by 4 to generate ClK - No parity bit - No parity bit - Even parity bit - Odd parity bit 00 - Select 01 - Select 10 - Select 11 - Select 11/2 stop bits 2 stop bits 1 stop bit 1 stop bit The options presented by the Parameter register, as illustrated above, are self-evident. with the exception of Parameter register bit 3. This bit is used to generate an internal clock sig!l81. CL~Depending on the setting of Parameter register bit 3, the ClK frequency will be ~/3 or <1>/4. ClK is then used to specify the time interval between bit sampling for serial data input or output. as well as the interval timer rate. The frequency of ClK should not be greater than 1.1 MHz; therefore if is faster than 3.3 MHz, Parameter register bit 3 should be set to 1. TMS9902 INTERNAL CLOCK SIGNAL TRANSMIT AND RECEIVE DATA RATE REGISTERS After loading appropriate data into the Parameter register, you must load the Transmit and Receive Data Rate registers in order to specify the time interval that will separate bit sampling. Data Rate register contents are interpreted as follows: 10 9 8 6 5 4 3 o 4--BitNo. Transmit or Receive Data Rate register - - - - - - - - - - - Second scale factor (S). Can have any value in the range 1 (000000001) through 1023 (111111111) L - - - - - - - - - - - - - - - - - - - F i r s t scale factor (F). Can be 0 or 1. If F = 0, S should be 3-88 ~ 4 The time interval separating serial bits transmitted or received is given by the equation: tClK x 2 x 8 F x S For example. suppose the Receive Data Rate register contains 11000111000. S = 56810 and F = 1: 11000111000 ~ L23816 ~ ~ 56810 S '---------- 1 = F If ClK = $/3. and = 3 MHz. + (2 (1 x 106 ) If F = then the serial data transfer rate will be: x 8 x 568) = 110.04 bits per second O. then the serial data transfer rate becomes: (1 x 106 ) + (2 x 8 x 568) = 880.28 bits per second Table 3-11 shows sample Data Rate register values for standard Baud rates. The assumed frequency produces very precise Baud rates; it is also within the recommended operating range of TMS9900 series parts. Table 3-11. Example of Data Rate Register Contents for Standard Baud Rates Frequency = 3. '!,!8 MHz Frequency ClK = + 3 = 1.066 MHz Data Rate Register Contents Data Rate in Bits per Second Decimal F S 0 0 0 0 0 1 1 1 1 55 110 220 440 880 220 440 600 880 Hexadecimal 9600 4800 2400 1200 600 300 150 110 75 037 06E ODC 1B8 370 4DC 588 658 770 Date Rate = ClK + (2 x 8 F x S) It is not strictly necessary to have data rates as precise as those we have shown in Table 3-11. The devices which receive data from the TMS9902 will determine how precise the transmit rate must be. TMS9902 Receive logic resynchronizes itself with the beginning of each incoming character. It does this by starting its bit-time count at a high-to-Iow transition of RxD. When the TMS9902 has counted half a bit-time. it samples RxD; if the line is still low. Receive logic assumes a valid start bit is present. It then samples the. line at single-bit-time intervals after the first sample point. until a full character has been received: Start bit RxD Middle of start bit is one-half bit time from this falling edge Character ~+ + Stop bit 'f TMS9902 samples RxD at the middle of each bit 3-89 Because of this resynchronization. no skew errors will occur as long as the transmitted bit rate is within 4% of the TMS9902 Receive data rate. TMS9902 TRANSMIT OPERATIONS Let us now examine a serial data transmit event sequence as illustrated in Figure 3-29. ~ .!!! Q) .... ~ a: .~ c: !!! g>:o ~~~ ~~ °~Q.·B~::: c: 0.: o3l OE3l U ~ ~ .s~]!~ VI ~ 1CJ)a:~ 8 8 ~.~ 81 8 ~ ~ IE .0.... "l:I ~£~ ~~ Q).... ~ :!: ..Q:!:..Q ClIO) ~~ 0) 1.1 -b I,{-__~----c::::::7+-~\~--L .LI .. .L.. :a;;data .,-_ _. " A r Idle or Break .t= 0 .. .. Tran:::it Buf:: empty:Transmit Register empty, _ Break control bit = 0 ~ _______ ~ ~ II ____ ~ 11-~~ .g ~ en u5 One data \ character Move Transmit Buffer contents to Transmit register \ Output data to Transmit Buffer o 1/ ~ ____ ____ ~ ~~ B .~ ~_CJ).o~ ______ ____ ____ ~ ~ ~ START BIT ........ 0 .... 1/ II C')N NN 'V' ." u .... :.c ....c: CII .g '2 '2 .... :.c ....c: Data Character CII 0+: 0) 0) 'iii 'iii .... ....VI VI CII 0 E ~ "l:I CD 0+: '0 CD -.... C. VI :.c ~ .t;: en .... :Ell .eC') S~ en:.c VI .a en CII CII 0.... Figure 3-29. TMS9902 Character Transmit Event Sequence In this example. all operations will begin with a Reset. Remember. you reset the TMS9902 by writing a 0 or 1 to CRU bit 31. Next. output appropriate codes to the Control and Parameter registers and enable appropriate interrupts. Output Data Rate register settings. Output the first character to the Transmit Buffer register. 3-90 TMS9902 SERIAL TRANSMIT EVENT SEQUENCE Transmit logic has now been initialized. You begin actual data transmission by setting RTS low. An appropriate initialization instruction sequence was given earlier. Setting Ri'S low enables transmit logic within the TMS9902. but actual data transmission does not begin until external logic inputs CTS low. If CTS is already low when RTS is reset low. then data transmission will begin as soon as RTS is output low. When a character is transmitted. the Transmit buffer contents are moved to the Transmit register. at which time Status register bit 22 is set. If transmit interrupt logic has been enabled. an interrupt request will occur at this time and Status register bit 17 will be set. The character is transmitted as illustrated in Figure 3-29; options are specified in the Parameter register. As soon as the character's stop bit (or bits) has been transmitted. transmission of the next data character begins. provided the CPU has by this time loaded the next data character into the Transmit buffer. The CPU will normally have plenty of time to reload the Transmit buffer. since it takes a long time. in terms of instruction execution times. to transmit a character. Note that you must write to bit 7 of the Transmit buffer in order to reset the Transmit buffer empty flag. Thus even though the character length is less than 8 bits. you will always write 8 bits to the Transmit buffer. You right-adjust Transmit buffer characters; that is. bit 0 of the Transmit buffer is always the least Significant bit of the character. If transmit interrupts have been enabled. an interrupt request will occur when Status register bit 22 is set. The CPU will respond to the interrupt request by interrogating Status register bits to identify the nature of the interrupt. Upon detecting a 1 in bit 17. the CPU will output another data character. If transmit interrupt logic has not been enabled. then the CPU must periodically poll the Status register and output the next data character upon detecting bit 22 set to 1. If the Transmit buffer is empty at the end of a data character transfer, then the TMS9902 may transmit a Break (if Control register bit 17 is 1), or it may terminate operations and go into an idle state (if Control register bit 17 is 0). The TMS9902 will transmit a Break if CTS is still low and Control register bit 17 is high. A Break is a continuous low level output via TxD. External logic interprets a Break as a signal indicating temporary suspension of data transfer. Break logic inhibits data transfers to the Transmit buffer. You must terminate a Break by resetting Control register bit 17 to O. then loading the next data character into the Transmit buffer. TMS9902 transmit logic will enter an idle state if CTS is input high by external logic or if CTS is input low. but no new data is ready to transmit and break logic is off. During this idle state TxD will be held high (marking). The level of the RTS output is not affected by a change in the m input level. If CTS goes high during a transmit operation a~ou leave RTS output low. then as soon as CTS goes low again the transmitter will be re-enabled; but if you output RTS high by writing 0 to Control register bit 16. then the CTS input will be ignored. In order to re-enable transmit logic you must output 1 to Control register bit 16. again setting RTS low. If CTS is low at this time. transmission will begin immediately; otherwise. transmission will begin as soon as CTS is input low - after RTS has again been output low. This may be illustrated as follows: Start transmitting Disable transmit logic Disable transmit logic; stop transmitting at end of character. --~-Enable transmit logic; start transmitting again Stop transmitting at end of character 3-91 r- ! e UI ::I ~ 0o ::-:' Status register bits 21. 14. and 13 all = 0 \ .." \ cO· t: ro w W 9 Status register bit 13 = 1 Least significant bit -i en (0 \ (0 otv w ~ po.) () :J" Ql (") ~ L CD 00 '3"::;, ~ CD CD II) a. ~ Q) (") <. ~~ Parity bit, if specified m < CD ~ en .0 t: CD :::J (") CD / ~StoPbUISI CD Status register _ 0 bits 14 and . 13 both - C/) aJ --i -» --i:1] --i :l] ~ ~ CD iii. 0 ~~" o;-~ ~ I.-< / !!!. • Status bit 21 = 1 0:1] CD 0 CD ~ ~!. ~~(i / / RESET CD <" CD Output Control register and Interrupt Enable register settings Ou~put 0?S" CQ ." c" e (; W fA o cUI ;.... CD \ Most significant bit :JJ CD (; n (Send "Receive logic . . Ready" signal) \ Q) II) both. Data Rate . - register settmgs \ ~ r :r 1____ .... til .... ~ ~ -- :l] CD 0 CD (; !!!. < CD a. Q) 2 i» CD ~" < CD ::I .... til !e a: CD CD ::I n !II Q !:tI Q r-::aooot Om~ G)(")fI) C:;!!!U) t__ I ..... 1 _ _ _ _ _ _..... 1.... 11 ---.. ~..... -, Transmit Buffer Parameter Register Sync1 Register Sync2 Register Timer register Receive CRC Transmit CRC 3-95 .........- - TxC Transmit Logic ~-~ RTS 14o--m Transmit CRC CRUOUT CRUIN CRUCLK INT iP CE SO 51 52 53 54 Transmit Buffer CPU Interface Logic TxO Status Register Control Register Parameter Register Sync1 Register Sync2 Register RxO Receive Buffer Received SOLC Check Character Receive CRC ....1 - - - RxC Receive Logic Timer Logic Figure 3-31. TMS9903 Synchronous Communications Controller -Functional Logic As illustrated above, there are three cyclical redundancy check characters which can be read from the TMS9903. Transmit and receive logic each compute a cyclical redundancy character (under program con troll for transmitted and received messages. In SOLe mode only, the cyclical redundancy character for a received frame is isolated by receive logic and held in a register out of which it can be read. 3-96 We will describe programming aspects of cyclical redundancy characters in more detail as the discussion of the TMS9903 proceeds. Transmit and receive logic are each buffered. Data is m9ved from the Transmit buffer to the Transmit Shift register, whence it is output serially via TxD. You have one character transmit time within which to write another character to the Transmit buffer, otherwise an underrun will occur. Characters are assembled by receive logic in the Receive Shift register: when assembled, they are transferred to the Receive buffer. You have one character receive time within which to read the contents of the Receive buffer, or else a receive overrun will occur. Data buffers within the TMS9903 are all nine bits wide; this gives you the option of appending a parity bit to any 8-bit character. The Status register is 23 bits wide, the Control register is 20 bits wide, and the Parameter register is 12 bits wide: these odd bit lengths cause no problems due to the nature of the CRU interface between the TMS9903 and the TMS9900 series microprocessor. The Sync1 and Sync2 registers hold Sync characters; in certain protocols these two registers may hold special control characters. Transmit logic may output the contents of one or both of these registers at the beginning of a message and following an underrun. Receive logic uses the contents of the Syncl register to detect Sync characters in a received data stream. You specify the number of data bits per character for received data via Parameter register bit settings. When receive logic is assembling characters in the Receive Shift register, it uses the bits-per-character specification that was in effect when the current character started to be assembled. If you change the bits-per-character specification, the change will be recognized on the next receive character boundary. The bits-per-character specification that you make in the Parameter register does not apply to transmit logic or the Sync1 and Sync2 registers. For these three registers the number of data bits you write into the register defines the number of data bits which will be transmitted. The most recently loaded Sync register determines the character length for transmission of both Sync characters. For example, if you output 6-bit characters to these three registers, then 6-bit characters are assumed by transmit logic. Likewise, if you output 9-bit characters, then transmit logic will subsequently assume 9-bit Syncl and Sync2 characters. Sync1 and Sync2 registers should have the same bits-per-character specifications. However, you could, for example, output a 7-bit character to Syncl and then a 5-bit character to Sync2. If you did, the device would transmit just the lower five bits of Syncl and Sync2. You could still specify 7-bit characters to receive logic: each received character would be compared to all seven bits of Sync1. The Sync character bit length need not be the same as the bits-per'character specification in the Parameter register or even the number of bits specified by loading the Transmit buffer. As with the Receiver, you can change the Transmit character length from character to character. As each character is shifted from the Transmit buffer to the Transmit Shift register, transmit logic attaches the bits-per-character specification to the data in the Transmit Shift register. Therefore if you subsequently change the number of bits per transmit character - namely, by loading a different-sized word into the Transmit buffer - it has no effect on the character already in the Transmit Shift register. Although Texas Instruments literature describes the TMS9903 as supporting six different modes, in fact it supports three: Asynchronous, Synchronous, and SOLC/HOLC. Asynchronous and Synchronous mode capabilities are quite standard. In Synchronous mode you can approximate IBM standard Monosync or Bisync protocols. Asynchronous mode is well suited to RS-232C and RS-449 EIA standard protocols. The TMS9903 can be operated in a point-to-point SDLC or HDLC system: also, SDLC loop mode is supported. The TMS9903, like the TMS9902, has on-chip timer logic. TMS9903 PINS AND SIGNALS TMS9903 pins and signals are illustrated in Figure 3-32. Pins 1 through 9 and 12 through 20 are functionally equivalent to TMS9902 pins 1 through 18. On its CPU interface the TMS9903 has the same standard TMS9900 Signals as the TMS9901 and the TMS9902. These include: 1) 2) The threestandard CRU signals: CRUIN, CRUOUT. and CRUCLK. Five select lines (SO-S4) that address a 32-bit CRU field. 3-97 TMS9903 CPU INTERFACE SIGNALS 3) 4) CEo an enable signal which must be low for the CPU interface to be enabled. An input clock signal. normally connected to the TIM9904 ~3 clock. Refer to our earlier discussion of the TMS9901 for a description of CPU interfacing logic. INT TxD RxD CRUIN RTS CTS DSR CRUOUT (GND) VSS TxC 1 2 3 4 5 6 7 8 9 10 TMS 9903 20 19 18 17 16 15 14 13 12 11 VCC (+5V) et iNf Vce. VSS Figure 3-32. TMS9903 Synchronous Communications Controller Pins and Signal Assignments Let us now examine transmit and receive logic signals. TMS9903 Serial data is output by transmit logic via TxD, as clocked by TxC. Data is transmitted on high-to-Iow transitions of"f'X'C. SERIAL 1/0 SIGNALS RTS and CTS are two Modem control signals associated with transmit logic. In order to transmit data you must input CTS low while transmit logic is enabled. You have the option of connecting Ri'S to transmit enable logic. If you do. RTS will be output low while transmit logic is enabled and it will be output high while transmit logic is disabled. You also have the option of selecting the RTS output level under program control. in which case RTS is disconnected from transmit enable logic. Receive logic receives data via RxD as clocked by RxC. Data is sampled on low-to-high transitions of RxC. DSR is shown in Figure 3-31 as a receive logic Modem input signal; in reality it is an unassigned input control signal. The DSR signal level is reported in a Status register bit. and can generate an interrupt whenever it changes state. DSR does not contribute to receive enable logic. TMS9903 PROGRAMMABLE REGISTERS The two principal programmable registers of the TMS9903 are the Control and Status registers. We refer to these as "principal" registers because they are automatically accessed by high numbered CRU bits on any CRU access. Low numbered CRU bits transfer data to or from a variety of addressable locations. as specified by Control register bit settings. 3-98 Table 3-12. TMS9903 Synchronous Communications Controller CRU Bit Assignments When Writing to the TMS9903 MODE ... a:: iii~ =>~ a::=> c.)z 31 30 29 28 C.) z > U) c( X X X C.) Z > U) X X X X X 27 26 C.) ..J Q U) X X X X X X X Cf 25 X X X 24 23 X X X X X (C (C 22 X X X X X 21 X X X 20 X X X 19 X X X 18 X X X 17 16 X X X X X X 15 14 13 X X X X X X X X X 12 X X X FUNCTION 1 or 0 = Reset device. 1 = Clear transmitter. 0 = Clear receiver. (In each case interrupts are disabled!' 1 = Clear transmit CRC register. 0 = Clear receive CRC register. (CRC register is reset to 0). 1 = Delete received Syncl characters (in Bisync mode only). 1 = Inhibit transmit logic's zero bit insertion. 1 = Load data at CRU bits 0 - 9 into Sync2 register. 1 = Load data at CRU bits 0 - 9 into Sync1 register (only for versions of Synchronous mode that use Sync1 register). 1 = Read received check character via CRU bits 0 - 1 5. 0= Reset Status register CRU bits 13 (Check Character Buffer full), 12 (Check Character overrun) and 10 (Zero insert detect error). 1 = Load data output to CRU bits 0 - 8 into Transmit buffer, and update the transmit CRC. Select the transmit eRC to be read via CRU bits 0 - 15. 0= Reset Status register bits 22 and 17 .. 1 = Update the transmit CRC with the next output to CRU bits 0 - 9. Read transmit CRC at CRU bits 0 - 15. 1 = Transmit break (low level output) during underrun. Reset this bit to 0 before loading new data into Transmit buffer to end underrun. Specify synchronous modes' underrun options. (See text)(General and Bisync only). 1 = Transmit Sync2 register contents following an underrun. (Typically 7F16 for an HDlC abort). 0= Abort transmit following an underrun and set Status register bit 23. (General only). 1 = Enable abort interrupt and reset Status register bits 23 and 18. (General only!. o = Disable abort interrupt and reset Status register bits 23 and 18. (General only). 1 = Enable data set change interrupts and reset Status register bits 29 and 20. o = Disable data set change interrupts and reset Status register bits 29 and 20. 1 = Enable timer interrupts and reset Status register bits 25, 24 and 19. o = Disable timer interrupts and reset Status register bits 25, 24 and 19. 1 = Enable Transmit buffer empty interrupts. o = Disable Transmit buffer empty interrupts. 1 = Enable Receive buffer full interrupts and reset Status register bits 21 and 11. o = Disable Receive buffer full interrupts and reset Status register bits 21 and 11. 1 = Enable Receive buffer full, Received Check Character buffer full and received abort interrupts. Reset Status register bits 21, 14, 11 and 9. 0= Disable interrupts listed abov!J:!.eset Status register bits22.: 14, 11 and 9. o or 1 = Output complement via RTS and disable automatic RTS control logic. 1 = Enable transmitter logic. o = Disable transmitter logic after transmitting available data. 1 = Test mode. 0 = Normal operation. 1 = load data at CRU bits 0 - 11 into Control register. 1 = Load data at CRU bits 0 - 7 into Timer register. o = Move Timer register contents to timer and start timer. 1 = Update the Receive CRC with the next output to CRU bits 0 - 9. Read Receive CRC at CRU bits 0 - 15. Let us begin by examining the Control register; bit interpretations are defined in Table 3-12. When you write to a TMS9903, CRU bits 31 through 12 will always access the Control register. TMS9903 CONTROL REGISTER Control register bits may be divided into the following groups: Device reset Register select Variations within mode specifications Interrupt enable/disable Direct device control • which are made in the Parameter register In most cases. when you set or reset a TMS9903 Control register bit. this bit setting - and its associated logic - remains in effect until you specifically change the bit setting. When setting a bit to select a data register. be sure to reset any select bits that were previously set. If two or more register select bits are set simultaneously. you will receive no error message. but the device will probably malfunction. TMS9903 REGISTER SELECT Let us now examine Control register bits by group. There are three device reset CPU bits: 31. 30. and 29. When you write a 0 or a 1 to CRU bit 31. the entire device is reset; all interrupts are disabled and all flags and register select bits are reset to 0 (with the exception of Control register bit 14 and Status register bit 22. which are set to 1). This causes the first data to be loaded into the Parameter register, while a transmit buffer empty condition is reported in the Status register. TMS9903 DEVICE RESET After resetting the TMS9903 by writing a 1 or 0 to CRU bit 31 and loading the Parameter register (CRU bits 0 to 11). you must next clear the transmitter and receiver by writing a 1 and then a 0 to CRU bit 30. (It does not matter whether you clear transmitter or receiver logic first so long as you do clear each set of logic before attempting to use it.) You must also initialize CRC accumulation logic at the transmitter and the receiver by writing 1 and then 0 to CRU bit 29. TMS9903 INITIALIZE TRANSMIT/ RECEIVE INITIALIZE CRC In summary. the following steps are required to reset and initialize a TMS9903: 1) 2) 3) 4) Write 1 or 0 to CRU bit 31. This resets the entire device and enables loading of the Parameter register. Load the Parameter register (CRU bits 0-11l. establishing the operating mode and configuration. Write 11 to CRU bits 30 and 29. This initializes the transmitter and transmitter CRC logic. Write 00 to CRUbits 30 and 29. This resets the receiver and receive CRC logic. (Note that when you write to CRU bits 31, 30, and 29, you will always access Control register bits 30, 31, and 29; only CRU bits 0-11 have multiple destinations within the TMS9903.l After resetting the TMS9903 and initializing transmit/receive logic, you will next select addressable locations to read from or write to. Selecting the data location from which you will read is straightforward. Normally, CRU bits 0-8 will contain the Receive buffer contents, while CRU bits 9-31 are taken from the Status register. But you can also read one of three 16-bit CRC characters. We may illustrate TMS9903 register addressing during a CPU read as follows: ,._---------_- TMS9903 READ REGISTER ADDRESSING , . - - - - - - - - - - - - - - - - - - - - - - - - - - - From Status register Computed CRC for received message (Control register bit 12 = 1) /..-___-'A....._ ....- -....., " , . - - - - - _...~ .....-------~ Received CRC for received ·17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 SOLC frame (Control register 3130· • ! IIIIIIIII IIIIIIIIII '1 ~--T IIIII .. . .T ,,/ ~------- 3-100 ~i:~:u~e~)CRC for transmitted message (Control register bit 24 or 25 = 1) Otherwise: From Receive buffer From Status register Note carefully that in SDLC mode you can read two receive cyclical redundancy check characters: the first is computed under program control by receive logic for the received frame; the second is received at the end of the frame. The final 16 bits of the information field are the received 'cyclical redundancy character. To read the received cyclical redundancy character. set Control register bit 26 to 1. To read the cyclical redundancy character computed by receive logic for the received frame. set Control register bit 12 to 1. These two cyclical redundancy characters will be identical if a valid message was received. In Synchronous and Asynchronous modes there is no defined end-of-message. Rather. a control character in the received data stream is interpreted as an end-of-message indicator. in which case two previously received data characters are interpreted as the received cyclical redundancy character. Your program logic must compare the two data characters which are being interpreted as the received CRC character with the computed check character. read from receive logic after setting Control register bit 12 to 1. When the CPU reads from the TMS9903. if Control register bits 12. 24. 25. and 26 are all reset to O. then as the default case CRU bits 0-8 are taken from the Receive buffer; higher numbered CRU bits are taken from the Status register. as always. When writing to the TMS9903. Control register address bits used to select a data location for the low numbered CRU bits may be illustrated as follows: 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 Ixlxlxlxl Ixlxlxl 8 7 6 5 4 TMS9903 WRITE REGISTER ADDRESSING 3 2 1 0 II 1 T t Control Register Bits Control Register Sync2 register (up to 1 0 bits) Sync 1 register (up to 10 bits) Transmit buffer (9 bits) (also default location) Transmit CRC register (up to 10 bits) Parameter register (12 bits) Timer register (8 bits) Receive CRC register (up to 10 bits) High numbered CRU bits always go to the Control register. Low numbered bits go to the write location whose register select bit within the Control register is 1. Following a reset. Control register bit 14 is set to 1. therefore data written to CRU bits 0-11 loads the Parameter register. When you write into the high-order Parameter register bit (bit 11). Control register bit 14 is automatically reset. But this is an exception. When you set any other register select bit in the Control register it remains set until you specifically reset it. If the Parameter register select bit (Control register bit 14) is set and you want to write to another addressable location. then you must reset Control register bit 14 to 0 when setting another select bit to 1. If all select bits in the Control register are O. then as a default case data will be written to the Transmit buffer. 3-101 You can only write into the Sync2 register in Synchronous or SOLC modes. You can only write into the Sync1 register in Synchronous mode - and only in those variations of Synchronous mode that use the Sync1 register. Variations of Synchronous mode are described later. There are two Control register bits, 28 and 23, which you use to specify variations of mode specifications. We wi" describe these two bits together with Parameter register bit settings, since Control register bits 23 and 28 are logica"y extensions of the Parameter register. TMS9903 Five conditions capable of requesting interrupts have separate enable bits; these are Control register bits 22 through 18. When you write a 1 to any of these Control register bits. the INTERRUPT associated interrupt logic is enabled; when you write a 0 to that Control register bit. interrupt ENABLE/DISABLE logic is disabled. In most cases. when you write a 0 or a 1 to an enable/disable bit. you reset any associated Status register bits. Exceptions are the Transmit buffer empty status and the Received CRC register full. We will discuss individual interrupts in more detail later when looking at TMS9903 interrupt logic in general. Direct device control bits consist of transmitter control and receiver controls. Looking first at the transmitter. you must enable transmit logic, after clearing it, by setting Control register bit 16 to 1; transmit logic remains enabled until you reset this bit to O. Transmit logic will not disable itself in the middle of transmitting a character; if you write a 0 to Control register bit 16 part way through a character's transmission. the character will be transmitted and transmit logic will then be disabled. TMS9903 TRANSMIT CONTROLS If you never write to Control register bit 17 following a reset, then the RTS output signal level is automatically controlled by transmitter logic. As soon as you enable transmitter logic by writing a 1 to Control register bit 16. RTS is output low; RTS remains low until you disable transmitter logic by writing a 0 to Contro~ister bit 16. But if you !!!! write to Control register bit 17, you immediately disable the automatic control of the RTS output level. Now the RTS output level becomes the reciprocal of Control register bit 17. There are two ways in which you can include transmitted characters in any cyclical redundancy character computation. If you select the Transmit buffer by setting Control register bit 25 to 1. then the character which you write to the Transmit buffer is also included in the transmit cyclical redundancy character computation. If you select the Transmit buffer as the default write location (j.e .. no address bits in the Control register are set to 1). then the character which you write to the Transmit buffer will not be included in the transmit cyclical redundancy character computation unless you set Control register bit 24 to 1 and then output the character to Transmit CRC logic. That is. using bit 24 of the Control register you can write to either the Transmit buffer or to Transmit CRC logic. but not to both at the same time. When a large sequence of contiguous characters is to be included in the transmit cyclical redundancy character computation, use Control register bit 25. When characters are to be selectively included and excluded in the transmit cyclical redundancy character computation, use Control register bit 24. There is no receiver enable control equivalent to the transmitter enable (Control register bit 16). As TMS9903 soon as you clear receive logic. it is enabled and will begin to sample data arriving via RxO. As RECEIVE CRC each character is assembled. it is transferred to the Receive buffer. If a received character is to be included in the computed receive cyclical redundancy character. program logic must output that character to Receive CRC logic after reading it from the Receive buffer. When you set Control register bit 12. data output to CRU bits 0-9 will go to Receive CRC logic. Note that CRC logic is not necessarily connected to the transmitter or receiver. The cyclical redundancy calculation registers may be used independently of transmit or receive logic. The Test mode bit (Control register bit 15) is normally left reset to O. When you set this bit to 1 the following connections occur: TMS9903 TEST MODE 1) 2) TxD is connected to RxO. RTS is connected to CTS. and DSR is held low. 3) TxC and RxC are both connected to the timer logic clock. which operates at 32 times its normal rate. This is similar to TMS9902 Test mode. with the exception that. in the TMS9903. the timer determines Receive and Transmit data rates in Test mode. 3-102 We will next describe the Parameter register. You will normally write into this register once during any operation in order to define operating modes and options within these modes. TMS9903 PARAMETER After resetting the TMS9903 by writing to CRU bit 31. you simply output the parameter code to REGISTER CRU bits 0-11. Resetting the device automatically selects the Parameter register as the write location for the data at CRU bits 0-11. You could also select the Parameter register by writing Os to CRU bits 27. 26. 25. 24. 13. and 12. and writing a 1 to CRU bit 14. Parameter register contents are interpreted as follows: 11 10 9 8 65432 o 4 - - CRU Bit ~~~~~Io......._ ...I_. . . . . . .Io...""~""'''''''_'''''''''''1..-- Parameter register ~~~L{ o0 0 - 5 o0 1 - 6 o10 -7 o1 1-8 bits/character bits/character bits/character bits/character 1 0 0 - 9 bits/character .....- - - - - - - - - - { 0 - Divide (j) by 3 to generate timer clock 1 - Divide by 4 to generate timer clock Non-SOLC "-------------- { 0 0 o1 10 1 1 - No parity - No parity - Even parity - Odd parity o0 0 001 o10 o1 1 10 0 10 1 1 10 1 1 1 L-___________________ { .....- - - - - - - - - - - - - - - - - - - - - - - { SOLC Point-to-point Loop master Loop slave - inactive Loop slave - active - Synchronous - general - SOLC - Monosync - Bisync - Unassigned - Asynchronous with two stop bits - Asynchronous with one stop bit - Unassigned 0 0 - CRC-16 (X 16 + X 15 + X2 + 1) 01 -CRCC-12 (X12 + X11 + X3 + X2 + X + 1) 1 0 - Revised CRCC-16 (X16 + X14 + X + 1) 11 -CRC-CCIT (X16 + x12 + X5 + 1) 0 - Transmit/receive at input clock rate 1 - Transmit/receive at input clock rate -7- 32. and use zero-complementing NRZI encoding. Parameter register bits 6, 7, and 8 determine the operating mode for transmit and receive logic, and some options within the selected mode. When you select Asynchronous mode, you also select either one or two stop bits. In Asynchronous mode, when you set Control register bit 23 to 1, then as soon as an underrun occurs transmit logic will output a continuous low level (break) on TxO. But note carefully that setting Control register bit 23 to 1 does nothing until an underrun occurs. Once an underrun does occur. you cannot load new data into the Transmit buffer until you reset Control register bit 23 to 0 to end the break. TMS9903 ASYNCHRONOUS BREAK LOGIC If Control register bit 23 is reset to O. then following an underrun a continuous high signal is output via TxD. You can at any time r'estart transmission by loading data into the Transmit buffer - in which case the high level output at TxD ends and the next character is transmitted according to the Asynchronous protocol options specified in the Parameter register. There are three Synchronous mode options and one SOLC mode option. These four options share Sync character logic, as shown in Table 3-13. This table applies to transmit and receive logic. Let us first consider SOLC transmit logic. 3-103 Table 3-13. Parameter Register CRU Bit TMS9903 Synchronous and SOLC Mode Sync Character and Underrun Options Underrun Fill Character MODE SYNC Character Control Register CRU Bit 23 = 0 Control Register CRU Bit 23 = 1 Abort [SYNC2] 8 7 6 0 0 0 0 0 1 SDLC 7E16 Abort [SYNC2] 0 1 0 SynchronousMonosync [SYNC1] [SYNC2] [SYNC2] 0 1 1 SynchronousBisync [SYNC 11 - [SYNC2] [SYNC 1] - [SYNC 11 [SYNC21 - [SYNC 11 [] SynchronousGeneral None Means: "contents of register named within brackets" Every frame must begin with a flag character, therefore 7E 16 is always output as the leading Sync TMS9903 character. You will subsequently reset Control register bit 23 to 0, since underruns are not allowed SOLC within an SOLC frame. Should an underrun occur, the transmitter will abort. outputting a conTRANSMIT OPERATION tinuous high signal and setting appropriate status bits. In order to transmit a valid end-ofmessage, you must read the computed transmit check character (selected via Control register bit 24 or 25). set Control register bit 23 to 1, load a flag (7E 16) character into the Sync2 register, and output the computed transmit check character as two data bytes. Now allow an underrun to occur; the contents will be output when the underrun occurs. Since Sync2 contains a flag character, you will have terminated the frame by transmitting the message check character and closing flag, as required by SOLC protocol. There is another way of ending a frame's transmission. Instead of allowing an underrun and outputting the frame's closing flag from the Sync2 register, you can suppress SOLe 0 insertion by writing a 1 to Control register bit 28, then outputting the clOSing flag (or flags) as a simple sequence of 8-bit data characters. If you are operating the TMS9903 using HOLC protocol. then you must output 7F16 as your TMS9903 abort character. To obtain a valid HOLC abort following a transmit underrun you should write HOLC ABORT the HOLC abort character to the Sync2 register, then leave Control register bit 23 set to 1 while the frame is being transmitted. Now if an underrun occurs, an HOLC abort character will be output from the Sync2 register. When detecting a new frame, SDLC receive logic synchronizes itself on flag character 7E16, which is also the specified Sync character. Consequently the setting of Control register bit 23 and the underrun fill character options shown in Table 3-13 do not apply. When receive logic detects another flag character, it assumes it has received the frame's closing flag. SOLC receive logic can a Iso detect an abort. SOLC receive logic sets appropriate status flags and generates an interrupt request. if enabled. TMS9903 SOLC RECEIVE LOGIC The three Synchronous modes shown in Table· 3-13, together with their underrun fill character options, allow you (under program control) to emulate any of the synchronous protocol options commonly encountered. External synchronization uses no leading Sync characters at the head of a message. You can emulate this protocol by choosing the general synchronous option. ForTMS9903 transmit logic, make sure that CTS is low before you enable the transmitter; then as soon as RTS goes low, message transmission begins. A station that receives this transmitted message can use the low RTS output as its external Sync input. TMS9103 EXTERNAL SYNC LOGIC TMS9903 receive logic will use the OSR Modem input as its external synchronization signal. The station which transmits the signal to the TMS9903 must generate a low OSR input just before it starts transmitting a message. The program controlling TMS9903 receive logic must detect the low '[5'S'R' input by interrogating the appropriate Status register bit. and upon detecting OSR active should start receiving. 3-104 In Monosync mode a single Sync character occurs at the head of a new message. In Bisync mode two Sync characters occur at the head of a new message. Both of these options are allowed. The Monosync mode outputs the contents of the Sync1 register at the head of a transmitted message and synchronizes on a received message by matching received characters against the contents of the Sync1 register. TMS9903 MONOSYNC lOGIC In Bisync mode Sync1 contents are output twice at the head of a transmitted message. Receive logic assumes that a new message has been detected when two contiguous characters match the contents of the Sync1 register. BISYNC lOGIC By loading appropriate data into the Sync1 and Sync2 registers you can transmit and detect ASCII. EBCDIC. or any other Sync characters. When an underrun occurs in Monosync mode. a single Sync character is output. By loading the appropriate character into the Sync2 register you can transmit and detect any underrun fill character. In the Bisync option greater underrun flexibility is needed. In some cases. following any underrun two Sync characters are transmitted; but in standard Bisync protocol DLE-SYN character combinations are output following an underrun. When Control register bit 23 equals 0 the TMS9903 will output two Sync characters from the Sync1 register. To meet the requirements of Bisync protocol you load the DLE character into the Sync2 register. load the SYN character into the Sync1 register. and leave Control register bit 23 set to 1. Other bisync logic (in particular. the generation and detection of special control character combinations) must be handled by a supervisory program. Control register bit 28 adds some flexibility to the options shown in Table 3-13. However. this control bit applies only to SOLC and Bisync modes. In SDLC mode, when Control register bit 28 is reset to O. TMS9903 transmitter logic will insert a 0 after every five consecutive 1s transmitted. Setting Control bit 28 to 1 inhibits this zero bit insertion in SOLC mode. In Bisync mode. when Control register bit 28 is set to 1 any received character that matches the contents of the Sync1 register is discarded. This allows you to strip received underrun Sync characters. TMS9903 SYNC STRIP Parameter register bits 5 and 4 serve different functions in Synchronous and SOlC modes. ,..-----, In Synchronous and Asynchronous modes Parameter register bits 5 and 4 are used to TMS9903 specify odd parity, even parity, or no parity. When parity is specified. parity bits will automatPARITY ically be generated for data characters that are transmitted and will be tested for data characters OPTIONS received. But parity does not apply to the contents of the Sync1 or Sync2 registers. You must add your own parity bit to the contents of these registers if you want to transmit Sync characters with parity. The Sync registers are each ten bits wide so that you can add one parity bit to the longest specifiable character (nine bits). Receive logic will automatically check the parity of received Sync characters. since received logic treats all receive characters as data. InSOlC mode, Parameter register bits 5 and 4 specify Loop or Non-loop mode; in fact. they specify the way in which an EOP character (7F 16) is handled. TMS9903 SOlC CONFIGURATIONS In a point-to-point configuration the EOP character has no significance. and is ignored. As a loop master. transmit logic pays no attention to the EOP character; however. receive logic treats the EOP character as a frame's closing flag. This is necessary. since the polling EOP character which a loop master transmits around the loop will eventually be received as the closing flag for the last frame transmitted by a loop secondary. The loop slave inactive mode is selected for an SOlC loop secondary that is not transmitting data, but may be receiving data. The loop slave active mode, in contrast, is selected for a secondary station in the SOlC loop that wishes to transmit to the primary station. In loop slave inactive mode, a TMS9903 will initially retransmit received data without delay. But. upon detecting an EOP character in the received stream, the TMS9903 will introduce one bit delay before retransmitting received data. So long as you never electrically disconnect a secondary station in an SOLC loop. the inactive slave mode will take care of timing and protocol requirements of a secondary loop station coming on-line. But if you wish to electrically disconnect 3-105 a TMS9903 secondary station in an SOLC loop. you will require external logic which detours upstream data around the electrically disconnected secondary. while breaking the detour and including the secondary when it is electrically connected. Here is the appropriate logic: -------------------1 Up-loop data ----.... RxD Down-loop data IN LOOP - - - - - -.....-cJI TxD------------------------~ You will normally leave a TMS9903 operating in loop slave active mode if it is functioning as a secondary station in an SOLC loop. You will only switch to loop slave inactive mode when the secondary station has just entered the loop and is not yet synchronized (has not received EOP). In the loop slave active mode. TMS9903 receive logic will seek the next EOP character. Upon receiving an EOP character it will convert this character to a flag. which becomes the opening flag for the frame which the station wishes to transmit to the primary. So long as a TMS9903 is left operating in loop slave active mode, it will continue to trap receive EOP characters and transmit frames behind them. When a TMS9903 has no further frames to transmit. you should leave it in loop slave active mode. but turn off the transmitter by resetting Control register bit 16 to O. For a discussion of SDLC loop secondary station logic see Chapter C1 in Volume 3. Parameter register bits 0, 1, and 2 allow you to specify 5,6, 7, 8, or 9 data bits per received character. Note that if parity is enabled. the parity bit is not counted in this specification. TMS9903 RECEIVED CHARACTER SIZE If Sync and control characters are eight bits wide, then you cannot specify less than 8-bit characters in Synchronous mode. This is because receive logic does not automatically switch from the specified bits per character to eight bits per character when receiving Sync or control characters. Moreover. a program controlling receive logic cannot make this switch. since it does not know it has received a Sync or special control character until the character is in the Receive buffer - by which time it is too late to make a change. Parameter register bit 11 allows you to transmit and receive data at the transmit and receive clock rates, or at these clock rates divided by 32. This is normally a standard Synchronous mode option. With the TMS9903 it is available in all modes: Synchronous. SOLC. and Asynchronous. This bit should be reset to 0 during operation as an SDLC loop slave. TMS9903 CLOCK RATE OPTION NRZI SELECT During synchronous or SDLC operation, if data is being sampled on every 32nd clock pulse (Parameter register bit 11 is 1) then NRZI encoding and decoding of serial data is assumed; that is. the data signal changes state to transmit a 0 or remains in the same state to represent a 1. Parameter register bits 9 and 10 are used to specify the cyclical redundancy character algorithm which will be used by transmit and receive logic. TMS9903 eRC OPTIONS CRC-16 is the normal algorithm used by synchronous and asynchronous protocols. CRCC-12 is the algorithm used in synchronous and asynchronous protocols with 6-bit characters. Revised CRCC-16 is the protocol frequently used in standard Bisync protocol. CRC-CCIT is the standard SDLC algorithm. Parameter register bit 3 is used by interval timer logic. This bit will be discussed later when we describe the interval timer. We will now examine TMS9903 Status register bit settings, which are summarized in Table 3-14. Status register bits may be divided into the following groups: • Interru pt status • Input signal levels • Transmit logic status • Receive logic status • Timer logic status 3-106 TMS9903 STATUS REGISTER Table 3-14. TMS9903 Synchronous Communications Controller CRU Bit Assignments when Reading from the TMS9903 MODE !::ffi mm u Z u U Z (I) ...I Q c( (I) 31 X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X :::):E > CZ::::) 30 29 28 27 26 25 24 23 22 21 20 19 Cf o -...I 18 17 16 X X X X X X X X X X X X X x 15 IX IX I X 14 X X 13 IX X 12 I X 11 IX 10 X I X X IX X X 9 IX IX x Function 1 = Any interrupt pending 1 = One or more Register Load Control flags set. or automatic RTS signal level change occurred 1 = 55ft or Complement of ffi input Complement of DSR input RTS level under automatic control. Transmitter active state if"RTS is under program control 1 = Timer decremented to 0 1 = Timer error. Bit 25 was already 1 when timer decremented to 0 1 = Abort followed an underrun (General only) 1 = Transmit buffer empty 1 = Receiver buffer full 1 = Interrupt request accompanying RTS, DSR, or CTS signal level change (Bit 29 = 1) 1 = Interrupt request accompanying timer time out (Bit 25 = 1) 1 = Interrupt request accompanying an abort (Bit 23 = 1)(General only) 1 = Interrupt request accompanying a Transmit buffer empty 1 = Interrupt request accompanying Receiver buffer full (Bit 21 = 1) only 1 = Interrupt request accompanying Receiver buffer full (Bit 21 = 1) 1 = Interrupt request accompanying Receiver buffer full (Bit 21 = 1) or abort received (Bit 14 = 1) or Closing flag received and received check character ready to be read (Bit 13 = 1) RxD input level 1 = Start bit detected 1 = Abort received 1 = First character data bit received 1 = Closing flag has been received and check character may be read 1 = Receive framing error detected 1 = Overrun error detected - receive data overrunning previous frame's check character 1 = Receive overrun error detected 1 = Receive parity error detected 1 = Zero insert error detected 1 = Any receive error in most recently received character 1 = Flag detected m Reset Condition No interrupt pending No Control flag set Output to CRU bit 21 Output to CRU bit 20 Output to CRU bit 20 Output to CRU bit 22 Output 0 to CRU bit 25 Output to CRU bit 18 Bit 29 = 0 or Output to bit 21 Bit 25 = 0 or Output to bit 20 Bit 23 = 0 or Output to bit 22 Output 0 to CRU bit 25 ~ No active interrupting ~ condition Stopbit(s) received Output to CRU bit 18 Stop bit(s) received Output 0 to bit 26 Error free character received Output 0 to bit 26 Output to bit 18 Valid character received Output 0 to bit 26 Valid character received Output to bit 18 The interrupt status bits include CRU bit 31, which reports any active interrupt request. and CRU bits 20 through 16, which identify individual interrupts. These status bits are self-evident. In non-vectored interrupt configurations you will test CRU bit 31 to find out if this particular TMS9903 has any active interrupt requests. In a vectored interrupt configuration you can ignore CRU bit 31, since the interrupt acknowledge process will identify the TMS9903 as the device with the active interrupt request. I n each case, the interrupt service routine must examine CRU bits 20 through 16 in order to determine which interrupt requests are active. The interrupt service routine must resolve its own interrupt priorities. Input Modem signals OSR and CTS modify Status register bits 27 and 28, respectively. The camp lement of the input signal level is reported. Status bit 29 is set to 1 when either ~, CTS, or automatic RTS signal level changes. This signal level change can cause an interrupt request, in which case Status register bit 20 is set. In many serial I/O devices, CTS going high in the middle of a transmit operation forces a transmit abort. while DSR going high in the middle of a receive operation disables receive logic. The TMS9903 does not make such critical decisions; the supervisory program must respond appropriately. When RTS output level is being controlled automatically, the complement of RT$ is reported in Status register bit 26. But as soon as you start controlling RTS level by writing to Control register bit 17, Status register bit 26 reports the active state of the transmitter. The serial data input signal RxO has its level reported in Status register bit 15. There are two status bits associated with transmitter logic: bit 22 reports Transmit buffer empty and bit 23 reports a transmitter abort (in those modes that can generate an abort). If interrupt logic for these conditions has been enabled, then Status register bits 18 andlor 17 will also be set. There are a number of Status register bit settings associated with receive logic, but there is only one interrupt status bit associated with receive logic - bit 16. Therefore you must use the various receive status bits in order to identify active error or non-error conditions within receive logic. In all modes Status register bit 21 is set when the Receive buffer is full time. and should be read within one character In Synchronous mode, Status register bit 11 reports a receive overrun error, while Status register bit 10 reports a receive parity error. Either of these errors causes Status register bit 9 to be set. In Asynchronous mode, a receive framing error, overrun error, or parity error is reported in status bits 12, 11, and 10, respectively. Status bit 9 reports one or more of these error conditions. In Asynchronous mode, two status bits are also set at the beginning of each received character. Status bit 14 is set when a valid start bit has been detected for the character, while status bit 13 is set when the first valid data bit has been detected. In SOLC mode, a receive overrun is reported in status bit 11 and a receive zero insert error is reported in status bit 10. The receive zero insert error means that five contiguous 1 bits were received, followed by a flag character. without the expected zero inserted between them. Thus, status bit 10 will be set when the sequence 01111110111112 is received. While a frame is being received, Status register bit 14 is set when an abort is detected and Status register bit 9 is set when any flag character is detected. An unusual and interesting error reported in SOLC mode is the receive CRC overrun error. If a new frame's data is received before you read the previous frame's cyclical redundancy check character, then status bit 12 is set. There are two timer logic status bits; bit 25 is set to 1 whenever the timer decrements to zero. If timer interrupts have been enabled, then status bit 19 is also set. You must acknowledge a time-out before another time-out occurs. You acknowledge a time-out by outputting to Control register bit 20. If you do not do so, then on the next time-out Status register bit 24 is set. You can examine Status register bit 30 at any time to see if one or more write location select bits are set in the Control register. 3-108 TMS9903 INTERRUPT LOGIC There are seven conditions that can generate interrupt requests within the TMS9903. Three of the seven conditions combine to generate a single interrupt request status. Therefore, there are five interrupt request statuses for the seven interrupt generating conditions. This may be illustrated as follows: Status Register Condition Bit No. Receive buffer full End of SOlC frame Receive abort Control Register Interrupt Enable Bit No. Status Register Interrupt Bit No. 29 - - 21 - - 20 25 - - 20 - - 19 22 - - 19 - - 17 23 - - 22 - - 18 21 13 7 1 8 - - 1 6 14 Interrupt DSR. CTS, or automatic RTS level change Timer time out Transmit buffer empty Transmit abort Receive interrupt The TMS9903 has no internal interrupt priority arbitration logic. When one or more conditions capable of requesting an interrupt occur, if the interrupt has been enabled, then INT is output low and Status register bit 31 is set to 1. An interrupt service routine responding to the TMS9903 interrupt request must now interrogate Status register bits in order to determine which interrupt requests are active. Program logic is responsible for all interrupt priority arbitration. These are the interrupt priorities which normally apply in serial I/O devices: 1) HIGHEST PRIORITY. Receive buffer full (Status register bits 16 and 21 set) 2) 3) 4) 5) 6) 7) Transmit buffer empty (Status register bits 17 and 22 set) Modem Signal level change (Status register bits 20 and 29 set) Receive abort detected (Status register bits 16 and 14 set) Transmitter abort (Status register bits 18 and 23 set) End of SDLC frame detected (Status register bits 16 and 13 set) LOWEST PRIORITY. Timer interrupt (Status register bits 19 and 25 set) TMS9903 INITIALIZATION PROGRAM LOGIC The first step in any TMS9903 operation is usually to initialize the device. Here are the necessary steps: 1) Reset the device by writing 0 or 1 to Control register bit 31. 2) Now output appropriate Parameter register settings. ~-....;...----- TMS9903 DEVICE INITIALIZATION 3) Output data to Control register bits 18 through 22 to enable appropriate interrupts. 4) In Synchronous and SDLC modes, load appropriate codes into the Sync2 and/or Sync1 registers. These two registers are not used in Asynchronous mode. 5) To initialize receive logic, write 0 to Control register bit 30. If cyclical redundancy is being used, initialize receive CRC logic by writing 0 to Control register bit 29. As soon as this step is complete. receive logic becomes active and starts to assemble received data. 6) To initialize transmit logic, write 1 to Control register bit 30. If cyclical redundancy is being used, initialize transmit CRC logic by writing 1 to Control register bit 29. Transmit logic is now initialized, but it is not yet enabled. 7) Transmit logic will not become active until you enable the transmitter by writing 1 to Control register bit 16. When you enable the transmitter, you should also load data into the Transmit buffer. Refer to our earlier discussion of Control register bits 25 and 24, where data output to the Transmit buffer is described, with or without associated CRC accumulation. TMS9903 ASYNCHRONOUS OPERATIONS When you select Asynchronous mode, data will be transmitted with a parity bit if selected, TMS9903 plus one or two stop bits, as specified by the Parameter register. Whenever the Transmit buffer ASYNCHRONOUS becomes empty. an interrupt request will be generated if the Transmit buffer empty interrupt TRANSMIT has been enabled, and appropriate status bits will be set - as described earlier. You have one character time within which to respond by outputting another character, or else an underrun will occur. Following an 3-109 underrun, a continuous high (marking) signal or a continuous low (break) signal will be output. depending on the setting of Control register bit 23. See the break discussion given earlier for details. When beginning a receive operation, sample the start bit detected status (Status register bit TMS9903 14) to identify the beginning of a new received message. This status cannot generate an interASYNCHRONOUS ru pt request. To process received characters, use Receive buffer fu II interrupt request logic. As RECEIVE characters are received, program logic must read characters out of the Receive buffer within - - - - - - - -..... one character time, and check for any of the asynchronous receive error conditions by reading error Status register bits at the same time. Received data and status can be read together by reading CRU bits 0 through 15 from the TMS9903. There are no other special programming considerations associated with asynchronous operation of the TMS9903. Conversely, any other protocol requirements must be met by the supervisory program's logic. TMS9903 SYNCHRONOUS OPERATIONS Most of the logic associated with Monosync and Bisync protocols must be provided by the supervisory program that controls TMS9903 transmit and receive operations. The only logic capabilities provided by the TMS9903 itself are the various Sync register programmable options, the error and normal operation statuses reported, and the character length definition. For a discussion of the Sync character options, refer to our earlier description of the Parameter register. For a description of the statuses reported, see the Status register discussion and interrupt logic summary. TMS9903 SOLC OPERATIONS When discussing the Parameter register we explained how you will use the Sync2 register in order to transmit and receive frames; but there are additional SOLC protocol requirements and some common protocol variations which need to be discussed. SDLC and HOLC protocols are described in Chapter C1 of Volume 3. In SOLC protocol. the first byte of every frame is the address field, while the second byte is a control field. In HOLC protocol the address field can have any length, while the control field can be either one or two bytes long. Some variations of SOLC protocol insert a logical control field after the control field; the logical control field can have any length. Address field. control field. and logical control field characters are all eight bits wide. Information field characters can have any data bit width. The number of bytes in a multibyte address or logical control field is determined by examining a specific character bit. For example, a protocol may specify that the last byte of an address field will have a 1 in the low-order bit. while all prior bytes have a 0 in the low-order bit. The TMS9903 has no on-chip logic designed to handle address, control, or logical control fields. Device programming can specify the number of bits per character - and this specification may change from character to characterand that is all. Moreover, the supervisory program must take into account primary or secondary station logic. A supervisory program at a primary station must transmit secondary station addresses and must interpret received addresses as identifying a frame's source. At a secondary station, the supervisory program must always transmit its own address at the head of a frame and must examine the address at the head of a received frame to see if the rest of the frame should be read or ignored. When the last byte of the control field (or logical control field) has been received, program logic must change the bitsper-character specification in the Parameter register before processing the first character of the information field should the information field use a different character length. Remember, the bits-per-character specification in the Parameter register applies only to receiver logic; you specify transmit character size by the number of bits you output to the Transmit buffer. Thus it is a simple matter to change character size from character to character as protocol may require. It is also possible for a received character to have a different number of bits than a simultaneously transmitted character. TMS9903 receive logic in SOLC mode does have one very useful end-of-frame capability: the received check character (which must be the 16 data bits preceding the frame's closing flag) is automatically loaded into a received CRC register. The microprocessor can read this received check character and compare it with a computed check character. But there are some additional uses for this received CRC logic. A valid SOLC frame must have at least 32 bits between the beginning and closing flags; these bits include an 8-bit control field, and a 16-bit cyclical redundancy check character. Frequently, 32-bit frames are transmitted and received to pass a command or response with no associated data. An error occurring within such a short frame can cause complex logic problems; it may be difficult to identify beginning and ending flags for subsequent frames, since the ending flag 3-110 for the short frame may go undetected. But you can use the TMS9903 receive CRC logic to identify short received frames. If you do not get a valid status indicator telling you that the received check character is available. then you know you have received a short frame. SOLe protocols allow frames to be separated by a single flag character. which serves as the closing flag for one frame and the opening flag for the next frame. Alternatively. a number of flag characters may separate two frames. Either case can be handled by the TMS9903. When describing the Parameter register. we explained how you can generate a frame's closing flag out of the Sync2 register. after allowing an underrun. or inhibit zero insertion and transmit flag characters as data. Since you can individually specify characters that will or will not be included in cyclical redundancy check accumulations. processing non-data characters as though they are data characters presents no difficulties to a TMS9903. You can use either method of ending a frame to separate frames with one or more flag characters. If you have generated an end-of-frame using underrun logic. then loading the next frame's first address field byte while a single flag character is being transmitted will cause a single flag to separate the two frames. If you let the underrun last longer. then flag characters will continue to be output until you begin the next frame by writing the frame's first address field byte as data to the Transmit buffer. If you are transmitting flags as data without zero insertion. then the number of flags separating frames is strictly a function of program control - but you must make certain that an underrun does not occur. Let us now examine programming requirements within an SOLC loop. There are no special programming requirements for the primary station in an SOLC loop. If you generate an abort at the end of a transmitted frame's closing flag. then the flag's trailing 0 bit. together with the first seven 1 bits of the abort. constitute an EOP character - which is transmitted around the loop in order to poll secondaries. When this EOP character returns to the primary station's receive logic. it is treated as a closing flag. (Refer to our discussion of the TMS9903 Parameter register for details.) Secondary stations within the SOLC loop should be run in the SOLC loop slave inactive mode until the secondary station has become synchronized with the loop - that is. has received the EOP character and begun retransmitting with a one-bit delay. At this time. change the secondary station mode to SOLC loop slave active. In the active condition. the secondary station will seek the next EOP character arriving at RxO. If the transmitter has been enabled. the TMS9903 will convert this received EOP character to the opening flag character for the frame which it wishes to transmit. The program controlling the secondary SOLC can end the transmission with a closing flag and then an abort. or with an EOP character. The closing flag and following abort generate an EOP character for the next downstream secondary and multiple flags between frames. A closing EOP character will be converted by the next downstream secondary to a flag or will be passed on to the primary. which interprets EOP characters at receive logic as closing flags. A closing EOP character. therefore. generates a single flag separating two transmitted frames. For a discussion of normal status and error status that may occur during transmit and receive operations. refer to our earlier description of the Status register. Also. refer to our earlier description of the Parameter register for logic which you will use to abort a mistransmitted frame. or to detect an abort in a received frame. But remember. it is entirely up to the supervisory program to interpret status bits and to handle aborts as required by the local system logic. TMS9903 INTERVAL TIMER LOGIC The TMS9903 has an interval timer. You initialize the interval timer by loading a timer count into the Timer register. Remember. you set Control register bit 13 to 1 in order to select the Timer register as the destination for data output via CRU bits 0 through 7. As soon as you reset Control register bit 13 to 0 you enable the timer. which starts to decrement. The rate at which the timer decrements depends on Parameter register bit 3 and Control register bit 15. Parameter register bit 3 allows you to divide the 1.4>2.4>3.4>4 -100 All others -400 IlA IlA 4>1.4>2.4>3.4>4 4 mA All others 8 rnA 54 MHz 48 Internal oscillator frequency. fosc External oscillator pulse width. tw(osc) 25 ns Setup time. FFO input (with respect to falling edge of 413). tsu 50 ns Hold time. F F 0 input (with respect to falling edge of 4>3). th -30 Operating free·air temperature. T A 0 3-07 ns 70 'c TIM9904 Electrical Characteristics Over Recommended Operating Free-Air Temperature Range (Unless Otherwise Noted) TEST CONDITIONS PARAMETER MIN H'gh·level input voltage VIH VIL VT~ - VT_ 0.5 Input voltage OSCIN 0.8 HysteresIs FFO 0.4 II Other outputs 4 Low-level VOL output voltage Other outputs Input current at FFO maxImum input voltage OSCIN IIH IlL lOS =4.75 V, VOO = 11.4 V, Vce =4.75 V, V DO = 11 .4 V to 12.6 V VCC 1, 4 outPut voltage UNIT V FFO High-level VOH MAX Low-level Input clamp voltage VIK TYP+ 2 High·level FFO Input curren t OSCIN Low·level FFO Input current OSCIN Short·circult All except output current+ 1, 2, 2L, cp3H trJ>3L cp4H Delay time, CP3 low' to 1/>4 h,gh tcp4L,cplH Delay time, 4 low to .pl h'gh tcp1H,4>2H Delay time, cpl high to ,p2 h,gh t.p2H,cp3H DeillY time, 1/>2 high to 'PJ high tr/>3H, tP4H Delay time, tP3 high to ,p4 hiqh tcp4H,H,CPTL MAX 12 330 UNIT MHz 3 MHz 340 ns 20 ns 14 20 40 55 70 Oelay time, cp I low to <1>2 high 0 5 15 Oelay time, <1>2 low to <1>3 high 0 5 15 ns ns ns ns 0 5 15 ns 0 5 15 ns rJ>l,cp3,cp4: 100pF toGND 73 83 96 ns tP2: 200 pF to GND 73 83 96 ns Others: RL = 2 kH, 73 83 96 ns CL "15 pF 73 83 96 ns Delay time, 4>n high to n TTL low -14 -4 6 ns tC>L,<1>TH Delay time, CPn low to r/>n TTl. high -29 -19 -9 ns tcp3L,OH Delay time, tP3 low to FFQ output high -18 -8 2 ns ttP3L,QL Delay time, cp310w to FFQ output low -19 -9 1 ns ttPL,OSOH Delay time, cp low to OSCOUT high -30 -20 -10 ns tcpH,OSOL Delay time, FFQ high to OSCOUT low -27 -17 -7 ns OutPllt loads: 0.7'll . I ~-t¢4l'¢IH ~2 f1 ~--4-~t¢-3'H-.-O-4H--~~.----~:--------------~ a4V I I I I ~ tq,H, ¢TL ---I I-- I I I :~----------------------I 1 ~ u t-tol,¢TH: I I U I 1.3V i I I Lf-1 I I I \JJ --------------------~Wll i3 u I OSCOUT I : ____________________ 1._3Jvf ...- -.I ~~N~F~~U~T of; ; .~.; .~.;.;p;. ;U_T:. . . tq,H,bsOl-l1'OL.OSOLh I I -+f tsu to3l, QH _____________________ th L.. \~_.::.0.~7..:.V_______________..;...--~----....f--....... I lr------~I------------------------~\ 13V 0.7 V 0.7 V I t¢3l,4~RI\ I I -1 0.7 V I 333 v t-- II \L'_3_V____________ I ~/ \~__~__~/ 4+--+t_----------------------------------.....!I:::;;:;;;;;, I ----~l1.3 v 13 SWITCHING CHARACTERISTICS, VOLTAGE WAVEFORMS 3-09 t o 3l. QL v \"'_________ TIM9904 EQUIVALENT OF D INPUT EQUIVALENT OF OSCIN INPUT Vee ----4_-- EQUIVALENT QF XTAL 1 AND XTAL 2 INPUTS vee-......._vee---....- - 20 kU NOM INPUT INPUT ' - - - -..... GNDt GNDt EQUIVALENT OF TANK INPUTS TYPICAL OF 1/)1, 1/)2,1/)3 AND 414 OUTPUTS GND1 TYPICAL OF OSCOUT, Q, AND ALL ~TTL OUTPUTS - - - -.......--Vee vee---....- -1~---,--,--VDD - -.......,..,.........-OUTPUT I NPUT-.....- l . . - - t - - OUTPUT .... GNDt SCHEMATICS OF INPUTS AND OUTPUTS TMS9901 TMS 9901 ELECTRICAL SPECIFICATIONS Absolute Maximum Ratings Over Operating Free Air Temperature Range (Unless Otherwise Noted)· Supply voltage, Vee ................. · ........................................... -0.3Vto 10V All inputs and output voltages ..................................................... -0.3 V to 10 V Continuous power dissipation ........................................................... 0.85 W Operating free-air temperature range ................................................. ooe to 700 e Storage temperature range .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. -65°C to 15Q"C "Stress. beyond those listed under '"Absolute Maximum Ratings'" may cause permanent damage to the device. This is a strMS rating only and functional operation of the device at IMM or any other conditions beyond those indicated in the '"ReoomrnencIed Operating Conditions'" section of this specification is not implied. Exposure to absolute maximum rated conditions for extended periods may affect device reliability. Recommended Operating Conditions· PARAMETER Supply voltage. Vee Supply voltage. Vss High-level input voltage. VIH Low-level input voltage. VIL Operating free-air temperature. TA MIN NOM 4.75 5.0 0 2.0 VSS-·3 0 3-D10 MAX UNIT V 5.25 V V Vee V 0.8 70 °e TMS9901 Electrical Characteristics Over Full Range of Recommended Operating Conditions (Un.... 0therwI.. Noted)· PARAMETER VOH High level output voltage Low level output voltage Input current (any input) II ICC(avl Average supply current from Vcc VOL CI Small signal input capacitance, any input TEST CONDmONS MIN TVP MAX UNIT IOH- -100pA 2.4 Vcc V IOH - -200pA 2.2 Vcc 0.4 V ±100 pA 150 rnA 15 pF IOL= 3.2mA Vss VI=OVtoVCC te(4)1 = 330 ns. TA=70·C f= 1 MHz V Timing Requirements Over Full Range of Operating Conditions PARAMETER MIN 300 fe(4)) Clock cycle time tr<4» tMi Clock rise time tw~ Clock pulse width (high level) 225 tw(4)>L) Clock pulse width (~ level) tw(CC) CRUCLK pulse width tsu1 Setup time for CE, 50-S4, or CRUOUT before CRUCLK Setup time for interrupt before if> low Setup time for inputs before valid CRUIN Hold time for CE, 50-54, or CRUOUT after CRUCLK 45 100 100 tsu2 tsu3 ttl TVP 333 5 10 Clock fall time MAX UNIT 2000 40 40 ns ns ns ns 300 185 ns ns ns 60 200 60 ns ns ns ·NOTE: All voltage values are referenced to Vss. Switching Characteristics Over Full Range of Recommended Operating Conditions PARAMETER tpd1 tod2 tod3 tpd MAX UNIT CL = 100pF 300 ns Propagation delay, 50-S4 to valid CRUIN CL - 100pF 320 ns Propagation delay, if; low to valid DiITREO, ICO-IC3 CL = 100pF 110 ns Propagation delay, ~ to valid data out (PO-P15) CL = 100pF 300 ns TEST CONDITION 3-011 MIN TVP Propagation delay, ~ to valid CRUIN TMS9901 twltPU -l '- tr(t/» -I !.--II- tf(rp) ~,..----':i'-f~ - - - - - - 1... ' - - - Ic(C cou,. {XX)(X)(X)(XXt&soDO ~-"'-e---B-0"R-C 11,",1 .£oj ''"' TIMING DIAGRAM 3-017 Chapter 4 SINGLE CHIP NOVA MINICOMPUTER CENTRAL PROCESSING UNITS In this chapter we are going to look at two microprocessors which are the world's first single chip reproductions of established 16-bit minicomputers. We are going to describe two products which reproduce, on a single chip, the logic of a Nova Central Processina Unit. Nova minicomputers are built by Data General Corporation. Data General Corporation offer a set of LSI chips centered on the MicroNova microprocessor. These chips are described quite superficially in this chapter since Data General is not actively marketing them as LSI devices. Rather, Data General favor the sale of MicroNova microcomputer systems. Fairchild manufacture the 9440 microprocessor, which is sold primarily as an LSI device. The 9440 is therefore described in some detail, together with standard Nova 1/0 bus and typical memory bus interface bus logic. The Nova minicomputer was designed as a next generation enhancement of the PDP-8. The IM6100, which is described in Chapter 13 of the Osborne 4 & 8-Bit Microprocessor Handbook is a single chip implementation of the PDP-B Central Processing Unit. If you compare the Nova architectures, which we describe in this chapter, with the IM1600, the two products will indeed look very different. But conceptually they are similar. Both the Nova and the PDP-8 Central Processing Units have few addressable registers; for computing power they rely upon instructions which may perform complex sequences of operations. Similarities between the Nova and the PDP-B will become more apparent if you compare these two devices with the CP1600 and the TMS990 - which we have described in Chapters 2 and 3, respectively. What is interesting about the Nova minicomputer is that it is one of the most popular in the world; and Data General Corporation is the second largest minicomputer manufacturer in the world. despite the fact that many aspects of the Nova Central Processing Unit may. on first inspection. appear to be very restricting. . The MicroNova is manufactured by: OAT A GENERAL CORPORATION Mail Stop 6-58 Southborough. MA 01772 The 9440 is manufactured by: FAIRCHILD SEMICONDUCTOR 464 Ellis Street Mountain View, CA 94040 The MicroNova and the 9440 are not the same; differences, however, are small. The MicroNova is equivalent to the Nova 3 minicomputer. The Nova 3 is a low-end minicomputer recently introduced by Data General. Although it is a low-end product it includes a number of features not found in the basic Nova arch itectu reo The 9440 reproduces basic Nova architecture - that is, the lowest common denominator of architectural features found in any Nova Central Processing Unit. As such, the 9440 lacks a number of logic features provided by the MicroNova. The 9440, however. has higher instruction execution speeds. Because the MicroNova and the 9440 are very similar. we are going to describe them together in this chapter. The MicroNova is manufactured using NMOS LSI technology. The 9440 is manufactured using Isoplanar integrated injection logic (l3U technology. Both products are packaged as 40-pin DIPs. The MicroNova requires four power supplies: -4.25V, +5V, +10V and +14V. The 9440 requires two power supplies: +5V and +350 mA. 4-1 Using a 240 nanosecond clock. the MicroNova executes instructions in 2.4 to 10 microseconds. Using a 100 nanosecond clock. 9440 instructions will execute in 1 to 2.5 microseconds. A PRODUCT OVERVIEW Figure 4-1 illustrates that part of our general microcomputer system logic which has been implemented by the MicroNova and the 9440. Note that only the MicroNova has a Stack Pointer, and DMA logic. Most Nova minicomputers do not have a Stack; the 9440 is a reproduction of.the basic Nova architecture. which is why the 9440 lacks a Stack. The MicroNova and Nova 3 do contain Stacks. because the addition of the Stack is technologically straightforward. while the lack of a Stack had been one of the most distressing features of earlier Nova minicomputers. Both the 9440 and the MicroNova have DMA request and DMA acknowledge signals; however. in response to a DMA request. the 9440 does nothing except float the System Bus. It is up to you to provide any and all external logic needed to actually perform a data transfer via direct memory access. The MicroNova. on the other hand. executes the required sequence of I/O operations to actually perform the DMA transfer. That is why in Figure 4-1 DMA logic is shown as being present on the MicroNova but not the 9440. What about I/O ports? I/O ports interface logic is shown as absent in Figure 4-1 . The 1/0 port is a microcomputer concept. In any microcomputer configuration. you will look upon I/O ports as the ultimate interface between the microcomputer system and external logic. You need a conduit via which data bits or signals can be transferred to. or received from logic beyond the microcomputer system. Each conduit becomes an I/O port and an I/O port becomes a set of pins. which can be addressed as a unit on a support device. Minicomputers take a conceptually different approach to 110 operations. To begin with. data is generally transferred to or from the CPU - not signals. The data finishes up on a System Bus. Therefore a minicomputer's interface with the outside world consists of an I/O System Bus and a memory System Bus. In some cases the two busses are one; in other cases. such as the Nova minicomputers. these two are separate and distinct busses. Conceptually. what is important is the fact that the minicomputer anticipates transferring data via its I/O System Bus to line printers. disk units. or other substantial devices each of which is capable of having a Significant amount of local logic. Thus the System Bus is as far as the minicomputer attempts to go when defining its interface to the outside world. Figure 4-1 , including bus interface logic within the logic of the Central Processing U nit, needs some clarification. As we have just stated. the Nova minicomputer creates two separate System Busses: one for memory. the other for I/O devices. All the signals of these two busses originate at card edge pins. There is nothing very expensive about adding more pins to the edge of a card. as there is to adding more pins to a DIP. Therefore the Nova System Bus has 47 Signals. Since neither the MicroNova nor the 9440 can have 47 signals. neither of these two devices creates standard Nova System Busses; but each device creates its own System Bus which could be used to drive external logic. That is why interface logic is shown as being present in Figure 4-1. 4-2 Clock Logic MicroNova anc:f~ r:':'::::::::::::::::::::) . ::::::::.:.:.:.:.:.:.:.:::: MIt;:roNova only :::~::::::::::::::::*.:. ' Logic to Handle Interrupt Requests from Extemal Devices ~ w Figure 4-1. Logic of the Data General MicroNova and the Fairchild 9440 There is one further major difference between the MicroNova and the 9440 which is not evident from Figure 4-1. The MicroNova provides transparent dynamic memory refresh logic. The 9440 has no dynamic memory refresh logic. The MicroNova, but not the 9440, contains an elementary interval timer capability. Providing interrupt timer logic is enabled, the MicroNova will generate an interrupt request every 20,000 instruction cycles. Using a standard 8.333 MHz clock, this translates to an interrupt request occurring every 2.4 msec. Note that the MicroNova and the Nova 3 interval timer logic differ. The Nova 3 provides four programmable interval timer options; the MicroNova provides just one. NOVA PROGRAMMABLE REGISTERS These are the programmable registers of the MicroNova and the 9440: o lS ACO } Primary Accumulator AC1 AC2 Accumulator and Index register AC3 Accumulator, Index register and I Stack Pointer J Frame Pointer 14 Subroutine Return Address register } MicroNova Only o Data General literature numbers registers and memory words from left to right. rather than as illustrated above, from right to left. Also Data General is one of the few minicomputer manufacturers that uses octal numbering. In order to remain consistent with the rest of this book, we will use hexadecimal numbers, and we will number registers from right to left; where confusions may arise, we will show both our standard numbers and Data General equivalents. ACO and AC1 are typical primary Accumulators. AC2 and AC3 may be used as Accumulators or as Index registers. The Jump-to-Subroutine instruction automatically stores the return address in AC3. If one subroutine is going to call another (j.e., you are nesting subroutines). then the calling subroutine must save the contents of AC3 before itself calling another subroutine. Only the MicroNova has a Stack Pointer. The only instructions that access the Stack Pointer are "Push" and "Pop" instructions. The MicroNova, but not the 9440, also contains a Frame Pointer register. The Frame Pointer register is an address buffer used to access the Stack. This may be illustrated as follows: MEMORY Stack Pointer identifies current top of Stack Use Fram e Pointer to hold important Stack ad dresses The Frame Pointer is a buffer register; it is not a Data Counter. There are no instructions that access the memory location addressed by the Frame Pointer. Observe that we show no programmable registers identified as Data Counters, even though in Figure 4-1 we show Data Counter logic as being present. This is because the Data Counter is another microcomputer concept - in effect. a subset of the Index register. If a memory reference instruction specifies direct. indexed addressing with a zero displacement. then Index Registers AC2 and AC3 are equivalent to Data Counters. 4-4 NOVA MEMORY ADDRESSING MODES Both the MicroNova and the 9440 offer the following standard Nova memory addressing modes: 1) 2) 3) 4) 5) 6) 7) Base page, direct addressing Program relative, paged, direct addressing Indirect addressing Indirect addressing with auto-increment Indirect addressing with auto-decrement Direct, indexed addressing Pre-indexed, indirect addressing These addressing modes have been described in Volume 1. Chapter 6. Nova memory addressing modes are heavily influenced by the fact that every Nova instruction generates a single 16bit object code - just as the predecessor PDP-8 instructions each generated a single 12-bit object code. Even memory reference instructions are confined to 16 bits of object code; therefore the memory reference instruction can only provide a short address displacement. Whereas PDP-8 memory reference instructions provide a 7-bit address displacement. the Nova provides an.8-bit address displacement. which is handled in a much more intelligent fashion. Nova instructions that use simple, direct addressing treat the 8-bit displacements as a direct, page zero address, or as a signed binary, program relative displacement. Thus you can directly address the first 256 words of memory. or you can address any location within +127 to -128 words of the memory reference instruction itself: . ~ MEMORY yy can directly address base page i I yy can be added, as a signed binary number, to xxxx, to address program relative page ~" I OOFF 0100 I (xxxx) + FFSO (FFSO = -SO) (xxxx) + FF81 (FF81 = -7F) (xxxx) + FF82 (FF82 = -7E) Address displacement equals vy I I 0001 0002 0003 1000E §§ Memory reference instruction 0000 ,, ,-"-~ IVY )O(x-1 xxXx xxxx+ 1 (xxxx) + 70 (xxxx) + 7E (xxxx) + 7F Remember. in microcomputer applications. program relative direct addressing is fine for Jump instructions. but is of limited value when accessing data memory. When a microcomputer program is stored in read-only memory. program relative. direct addressing can be used to read constant data only. Nova instructions that specify direct, indexed addressing, compute the effective memory address as the contents of either AC2 or AC3, plus the 8-bit displacement provided by the instruction object code. The 8-bit dis- 4-5 placement is treated as a signed binary number. Since the Index registers are 16 bits ·wide, direct indexed addressing allows you to address any memory word. This may be illustrated as follows: Accumulator AC2 or AC3 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ~Bit No. Ixlxlxlxlxlxlx~xlxlxlxlxlxlxlxlxl Instruction Code 9 8 7 6 e x x x x x x x x x x x x x x x x z z z z z z z z y y y y y y y y Sum is the effective memory.address ' - - - - - - - -..... 0 selects AC2 1 selects AC3 Indirect addressing may be superimposed on any of the memory addressing options described thus far. Indirect addressing is identified by a "1" in bit 10 of the Memory Reference instruction's object code. When indirect addressing is specified, the effective memory address is the contents of the directly addressed memory word. NOVA DIRECT MEMORY ADDRESSING Let us examine the various indirect addressing options. First there is page zero indirect addressing: NOVA INDIRECT PAGE ZERO ADDRESSING 8 5 2 O~BitNo. ~~~~~~~~~~~~~~ ~----~----------P~Z«o '--------+-------- Indirect addressing Arbitrary Memory I~I:0001 0002 0003 i I 0024 1------1 0025 1236 0026 .....~----..... 0027 t - - - - - t 0030 1235 1 - - - - - 1 1236 1 - - - -....... 1237 1240 In the illustration above. arbitrary, real memory addresses have been selected to make the illustration easier to understand. 4-6 Program relative, indirect addressing may be illustrated as follows: NOVA INDIRECT PROGRAM RELATIVE ADDRESSING 1216 ~----------__~____ ~·55 This instruction 126B fetched from this ~------------- Program relative memory location ----------------Indirect Arbitrary Memory MEMORY Address 1215 1216 1217 1220 1221 1222 126A 736~ 126B 126C 1260 126E 12GF 1270 7362 7363 7364 7365 7366 7367 7370 7371 7372 4-7 NOVA INDIRECT INDEXED ADDRESSING Indirect. indexed addressing may be illustrated as follows: Accumulator AC2 15 1<4 13 12 11 10 9 8 7 6 5 <4 3 2 1 0 10101010101011101110101011111111' ~ Bit No. Instruction Code 6 5 <4 3 2 028F - - - - - -.....-0020 02BC .....- - - - - - - - - - - - Index via AC2 .....- - - - - - - - - - - - - - I n d i r e c t MEMORY Arbitrary Memory Address 02~ 736" 0288 02BC 0280 02BE 02BF 7362 7363 7364 7365 7366 7370 The illustration above arbitrarily uses indexed addressing via Accumulator AC2. Also the computed effective memory address is identical to that which was obtained in the indirect. program relative addressing illustration. Observe that Nova indirect addressing logic results in pre-indexed indirect addressing. As described in Volume 1. Chapter 6. this is less desirable than post-indexed indirect addressing. 4-8 If. and only if indirect addressing has been specified by a "1" in bit 10 of a Memory Reference instruction's object code. then the contents of the data fetched from memory are treated as a direct address. providing the high-order bit of the direct address is O. If the high-order bit of the address is 1. then the address is treated as another indirect address pointer. This may be illustrated as follows: Interpret NOVA MULTIPLE INDIRECT ADDRESSING as. last memory adciIr.a Note carefully that multilevel indirect addressing will occur only when indirect addressing is specified in the first place. If you execute a direct memory reference instruction. data will never be interpreted as an address. The Nova indirect addr~ssing logic means that. given a 16-bit indirect address. only 15 bits actually address memory; therefore you are limited to a 32.768 word memory address space: l' 14 13 12 11 10 9 8 7 6 .5 4 3 i I I II I I I I I I I 1 0 ~.No. g--1ncInIc:t MIiNIry ~ 1 The Nova minicomputers and microcomputers also provide indirect addressing with auto-increment and autodecrement addressing. If you indirectly address one of the eight memory locations. 001016 through 001716. then the contents of the addressed memory location are incremented at the beginning of the memory access. Thus you have indirect addressing with auto-increment. If you indirectly address anyone of the locations. 001816 through 001 F16 then the contents of the addressed memory location will be decremented at the beginning of the memory access. Thus you have indirect addressing with autodecrement. Neither the MicroNova nor the 9440 provide memory mapping logic. Memory mapping is a technique whereby more than 32.768 words of addressable memory may be accessed. The Nova 3 minicomputer is capable of supporting memory mapping as an option. Nova minicomputers have separate memory and I/O device spaces. I/O instructions include six bits which identify one of 64 I/O devices. Because Nova minicomputers and microcomputers treat I/O devices in a manner that differs significantly from the typical microcomputer. we will defer our discussion of I/O addressing until we have looked at pins. Signals and System Busses. 4-9 NOVA I/O DEVICE ADDRESSING NOVA STATUS FLAGS Nova minicomputers contain just one status flag, as we would define it, and that is the Carry status. Instructions are able to test for a zero or nonzero condition occurring at the conclusion of an instruction's execution, but no permanent zero status flag exists. MicroNova also has these interrupt related status flags: • • • • Interrupt Enable Real Time Clock Enable Real Time Clock Request Stack Overflow Request } MicroNova Only The interrupt related status flags do not occur as addressable locations in any Status register; rather they represent flipflops which are set or reset during the course of interrupt handling. The interrupt enable bit is a master enable which is set to 1 in order to enable all interrupts. Specific instructions allow all interrupts to be enabled or disabled. The MicroNova has a Real Time Clock interrupt enable bit and a Real Time Clock request bit. The Real Time Clock enable bit must be set to 1 in order to enable Real Time Clock interrupts; as soon as a Real Time Clock interrupt occurs. the Real Time Clock enable bit and the Real Time Clock request bit are reset to O. The Stack Overflow request bit is only present in the MicroNova. since only the MicroNova has a Stack. A Stack overflow condition occurs if. following a push operation. the incremented contents of the Stack register have zeros in the eight low-order bits. What this implies is that the Stack must reside within a 256-word memory page: Arbitrary Memory I~RYI:~ 0801 : §· . · 0802 0803 . :08FD 08FE 08FF~ '0900 0901 • • = . ~ 09FD Pushes that increment Stack Pointer from XXFF to XYOO will cause a Stack Overflow interrupt 09FE / 09FF~ OAOO~ OA01 OA02 When a Stack overflow occurs. the Stack Overflow request bit is set to 1 and an interrupt is requested. MICRONOVA AND 9440 CPU PINS AND SIGNALS As we stated earlier in this chapter, minicomputer Central Processing Units are implemented on cards, not DIPs; therefore they usually have System Busses containing more than 40 signals. The standard Nova System 1/0 Bus contains 47 signals; furthermore, the Nova System Bus is, in effect, two busses: one communicating with memory, while a separate and distinct bus communicates with 1/0 devices: NOVA MEMORY BUS I/OBUS CPU I/O DEVICES AND EXTERNAL LOGIC MEMORY 4-10 Table 4-1 briefly defines the functions of bus signals. The I/O Bus is standard for ali Nova line computers, while the Memory Bus is different for each model. We give the Memory Bus signals of the Nova 2 in Table 4-1. Table 4-1. Nova System Bus Signals STANDARD NOVA SYSTEM I/O BUS SIGNAL DIRECTION DsO-DS5 DATAo - i5Ai'Ai5 To Device Bidirectional To Device To Device To Device DATOA DAnA DATOB DATIB DATOC DATIC STRT CLR 10PLS Sllii SELi5 RciENB iNTR iNi'P INTA MSKO 50iR OCHP OCHA DcHMo,DcHMi To To To To Device Device Device Device To Device To Device To Processor To Processor To Device To Processor To Device To Device To Device To Processor To Device To Device To Processor FUNCTION OR INDICATION Device selection Data and address lines Data out to device's A buffer Data in from device's A buffer Data out to device's B buffer Data in from device's B buffer Data out to device's C buffer Data in from device's t: buffer Start device-clear Done flag, set Busy flag and clear devi.ce's INT REO flip-flop Oear device's Busy and Done flags and INT REO flip-flop I/O Pulse - user-defined function Selected device's Busy flag is set Selected device's Done flag is set Enable interrupt or DMA requests Interrupt request Interrupt priority Interrupt acknowledge Interrupt mask out Data channel request (DMA request) Data channel priority Data channel acknowledge Data channel mode: l5CHMo H H L L DCHI OCHO OVFLO 10RST To To To To Device Device Device Device DCHMI H L H L Data out Increment memory Data in Add to memory Data channel in Data channel out Overflow: result of memory increment or add exceeds FFFF II Clear all I/O devices THE NOVA 2 MEMORY BUS SIGNAL DIRECTION AO-A14 DATAO - DATA15 INHIBIT SELECT BMEMEN WRITE BRMW WE SYNC ENABLE RELOAD DISABLE WAIT MEM CLOCK EXTERNAL SELECT EXTERNAL MBLD To Memory Bidirectional To Memory To Memory To Memory To Memory To Memory To Processor To Memory To CPU To Memory To Memory To Memory FUNCTION OR INDICATION Memory address lines Memory data lines Inhibits selection of memory module Starts memory cycle Memory write Causes pause between read and write Enable write after pause in read-pause-write cycle CPU hold control Inhibits loading of memory buffer Disables other memory modules during write portion of memory cycle Memory Clock Allows module to be selected despite contents of address lines Allows data to be stored in memory buffer without starting a memory cycle If you are using the MicroNova or 9440 in a new product. then there is no reason why you should create the standard Nova System Busses. Providing the signals generated by the MicroNova or the 9440 are adequate for your needs, you can interface external logic directly to these two devices. Let us first look at the MicroNova pins and signals, which are illustrated in Figure 4-2. Two clock signals, <1>1 and <1>2, must be input to synchronize all MicroNova logic. 4-11 The Memory Bus consists of a 16-bit Address/Data Bus, plus three control signals: SAE, P and WE. MICRONOVA MEMORY BUS The Address/Data Bus connects to pins MBO - MB 15. P is a synchronization signal. SAE is a read enable and WE is a write enable. The I/O Bus consists of just four signals: MICRONOVA I/O BUS I/O CLOCK synchronizes I/O transfers. I/O DATA1 and I/O DATA2 are bidirectional data and control signals. I/O INPUT identifies the direction of data transfers occurring via-:"I/~0~D-:"A~T~A~1 and I/O DATA2. As compared to other microcomputers described in this book. the MicroNova I/O interface is very unusual. Only the TMS 9900 I/O logic is at all similar. A 16-bit I/O data transfer occurs as two 8-bit serial units. This may be illustrated as follows: I/O CLOCK ~~~__~I_B_IT_O~I~~_T_1~I~B_IT__2~I_B_rr_3~I_B_rr_4~I_BI_T_5~I_B_rr_6~1_~_T_7JI \ ~ 0 I ~ 1 I ~T 2 I ~T 3 1 ~ 41 ~ 5 1 ~ 6 1~T 7 I Eight serial bits are input in less than one microsecond: therefore this method of handling I/O is as fast as the parallel data input operations described for other microcomputers. Each data transfer is preceded by one of four_codes generated by levels output via I/O DATA 1 and I/O DATA2. These are the four codes: 1/0 DATA1 I/O DATA2 1 o o o o 1 INTERPRETATION Accompanying I/O low pu Ise may be used to synchronize interrupt requests and DMA requests. DMA request acknowledge. I/O data transfer. The transfer direction is specified by I/O INPUT. I/O command out. Thus every I/O operation will begin with I/O DATA 1 and I/O DATA2 being output during a low I/O CLOCK pulse. I/O INPUT will be low at this time since data is being output via I/O DATA1 and 110 DATA2. Providing 110 DATA1 andl70 DATA2 specify a data transfer to follow. the actual data transfer will occur via I/O DATA 1 and I/O DATA2 with I/O INPUT identifying the data transfer direction. 4-12 VBB P 40 39 nc WE 38 37 VDD HALT 36 35 CLAMP SAE 4 DCH INT 5 'OOiNT 6 7 VGG VSS(GRO~ MOO Mii1 Mii2 MB3 8 9 10 11 12 MICRONOVA Vss (GROUND) nc 34 nc 33 32 31 PAUSE 11>1 30 29 I/O DATA1 I/O DATA2 i70iNPUT MB4 Ma5 MB6 MB7 13 14 28 27 15 16 26 25 VCC MB8 17 18 MB9 MiiO 19 24 23 22 20 21 11>2 I/O CLOCK Vss (GROUND) MiT5 Mei4 Ma1'3 Me12 Mi1i' PIN NAME DESCRIPTION TYPE 11>1. cJI2 Clock Signals Input MeO-'MBi5 Address/Data Bus Memory Synchronization Memory Read Enable Output Output Memory Write Enable Output I/O Synchronization Data and Control Transfer Direction P SAE WE I/O CLOCK I/O DATA1. I/O DATA2 Bidirectional HALT Power-On Reset CPU Halted Bidirectional Bidirectional Output Input Output i5CHiNT 00iNf DMA Request External Interrupt Request Input Input PAUsE Memory Bus Grant Output VBB VDD. VGG. Vss Power and Ground i70iNfiijT Ci:AMP Figure 4-2. MicroNova CPU Signals and Pin Assignments There are two CPU control signals which are not part of either the Memory Bus or the I/O Bus. Following power-up, the MicroNova CPU will not perform any operation until a high input occurs at CLAMP. When CLAMP goes high. interrupts are enabled. Real Time Clock and Stack Overflow interrupt requests are cleared. and the CPU is halted. Once CLAMP has been input high. it is ignored until the MicroNova is powered down and then powered up again. The HALT signal is output by the MicroNova as a high pulse while the MicroNova CPU has been halted response to execution of a Halt instruction. or following CCAi\iiP going high. either in There are two MicroNova signals associated with interrupt logic. DMA requests are made via DCH INT while any external interrupt is requested via EXT INT. Both the DMA request and the interrupt request must be. synchronized with instruction execution timing. This synchronization is provided by I/O DATA1 and I/O DATA2. as we have already described. The DMA acknowledge occurs via 1/0 DATA1 and I/O DATA2. There is no external interrupt acknowledge signal; however. such a signal can be derived from the Memory Bus. as we will describe later in this chapter. PAUSE is output low by the CPU when devices other than the CPU· are permitted to access memory. Now look at 9440 pins and signals, which are illustrated in Figure 4-3. These pins and signals create a single System Bus. No attempt is made to create separate Memory and I/O Busses. You may connect a crystal across CP and XTL in order to create a master clock signal, or you may input a clock signal via CPO 4-13 C3 C2 C1 CO DCH REO 00 40 39 M1 38 37 36 CLK OUT 6 35 34 01 8 INTON GND 33 32 31 RUN 9 10 11 IINJ CARRY 12 13 (high-order bit) 180 14 iB1 15 16 i'Nf'REa. iB2 IB3 184 iSs iB6 MO 1 2 3 4 9440 17 18 30 M2 CP XTL MA SYN MBUSY VCC GND 29 28 27 iBf5 (low-order bit) 26 25 24 IB12 IB11 19 23 22 20 21 iii14 iii13 IB10 iB9 iBii iB7 PIN NAME DESCRIPTION TYPE xn.cP Cock Signals Synchronization Signal Output SYN iBO -iBiS MO-Mi System Cock Data/ Address Bus Memory Controls MBUSY Memory Busy 00.01 I/O Control Interrupt Request ClK OUT iNiiiEQ Input Output Bidirectional Output! Input Input Output OCHREQ Interrupt Enable DMA Request Input Output Input RUN CARRY CO-C3 CPU Running Carry Status Front Panel/Console Control Signals Output Input MR Master Reset Input IINJ. vcc. GND Power and Ground INTON Output Figure 4-3. 9440 CPU Signals and Pin Assignments The 9440 generates a single synchronizing output (SYN). The CPU clock is output to the system via ClK OUT. IBO - IB15 provides the 9440 with a multiplexed 16-bit Data and Address Bus. This bus carries addresses to memory and I/O devices. and it carries bidirectional data between the CPU and memory or I/O devices. IBO - IB 15 are low true; a low signal level represents a 1 bit. 9440 SYSTEM BUS IBO is the high-order bus line while IB15 is the low-order bus line. This agrees with Nova conventions. This chapter, and this whole book describe the low-order bit as bit 0 - exactly the reverse of IBO - IB15. There are three control signals on the 9440 CPU-memory interface. MO is output low to identify a memory read. M1 is output low to identify a memory write. M2 is output low to identify a memory address being output. MO - M2 have open-collector outputs; you can use these lines as inputs to make the timing of a non-memory machine cycle conform to the timing of a memory cycle. We will discuss this further when we discuss 9440 timing and instruction execution. External memory interface logic inputs MBUSY low while it is responding to any memory access. MBUSY is similar to the WAIT signals that we have described for other microcomputers; it can be used to make the CPU wait for slow memory to respond to a CPU access request. 4-14 The 9440 has two I/O control signals 00 and 01. These two control signals define I/O and memory accesses as follows: o o 01 01 01 01 00 00 1 00 1 00 o Instruction Fetch 1 Data Channel Access o Execute I/O Operation 1 No I/O There are two signals associated with 9440 interrupt logic. An external interrupt is requested by inputting INT REO low. INT ON indicates whether or not interrupts are enabled. This signal is high when interrupts are enabled: if this signal is low. interrupts are disabled. A DMA request is made by inputting DCH REQ low. The DMA request is acknowledged by 01 and 00 being output low and high. respectively. There are seven signals provided by the 9440 specifically to support a front panel or console. Two of the front panel or console signals are outputs; these are the RUN and CARRY signals. RUN is output high while the CPU is executing programs: it is output low while the CPU is halted. RUN is used to generate an appropriate front-panel display light: it is also equivalent to a Halt acknowledge. as described in this book for many other microcomputers. CARRY represents the condition of the Carry status. This signal is output specifically to drive a front-panel light. Five input control signals are provided for switches on a front-panel. Four of these signals are CO. C1. C2 and C3; they perform the following operations: C3 C2 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 C1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 CO 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 FUNCTION Display ACO contents at console Display AC 1 contents at console Display AC2 contents at console Display AC3 contents at console Increment Program Counter and then display contents of addressed memory word Display contents of addressed memory word Load memory from console switches Halt Deposit switches into ACO Deposit switches into AC1 Deposit switches into AC2 Deposit switches into AC3 Load Program Counter from console switches Continue/Run Increment Program Counter and then load memory from console switches No Operation The first 9440 devices decoded the C lines in a slightly different manner. The following combinations were different operations: C3 o o 1 1 C2 C1 0 1 0 1 CO FUNCTION o o Load Program Counter from console switches Not used 1 Load memory from console switches o Continue/Run MR is the Reset input to the 9440. When this line is pulled low: the 9440 halts immediately and clears the Interrupt Enable flip-flop. Once MR goes high. the CPU will remain in the Halt state until it receives the "Run" command from lines C3 - CO. Reset has no further effect on the 9440. It is up to your hardware to load the Program Counter by manipulating lines C3- CO and the Information Bus. 4-15 The following sequence is sufficient to start operation of a 9440 system with a "bootstrap" program in non-volatile memory: 9440 INITIALIZATION SYN C3 - CO iBO -1815 NO OP I LOAD PC I ( STARTING ADDRESS ) NOOP X I RUN NO OP ( I RUN The hardware must provide the program starting address while issuing the "Load Program Counter" command via the Clines. C line codes other than "No Operation" are held for two machine cycles to ensure that the CPU reads them. The "No Operation" code between "Load PC" and "Run" gives the CPU time to finish executing the C line command. See the data sheets at the end of this chapter for more detailed timing information. 4-16 r-Da-ta-D-u-tP-ut-T-o-~-s-tin-a-tio-n---------------------------------------------------------------------, ~ Inhibit data output option Second source and destination Jo. _ - - - -..... ACO Arithmetic ~ ACI First source .... ~1~~A~C~2~~~---~~-J~ I AC3 1 and Boolean Logic Data output • . I I Shifter and Byte Swap Logic r Test Data for Skip .-... ,.....__ I Program Counter Test Carry I :~ ~ h~lc-~~--_J 1514 13 12 11 10 8 7 6 5 4 3 2 1 0 ___ Bit No. 'II I I I I I I I I I I I I I I I It._________________________________ Arithmetic And Logic Instruction Code Figure 4-4. The Nova Arithmetic and Logic Unit 1514 13 12 1110 9 8 7 6 5 " 3 2 1 0 IllS SID DITITITIH Hie elLlKIKIK ~Bit No. Arithmetic/Logic instruction LoooNo,"' 001 Always skip 010 Skip if Carry is Zero 011 Skip if Carry is One 100 Skip on Zero result 101 Skip on nonzero result 110 Skip on either Carry or result zero 111 Skip on Carry and result both nonzero oStore result in destination Accumulator 1 Discard result ' - - - - - - - - - - 00 Preserve current Carry status 01 Zero Carry 10 Set Carry to 1 11 Complement current Carry Thase operations are performed on Carry before entering the ALU ' - - - - - - - - - - 00 No operation 01 Left rotate one bit position 10 Right rotate one bit position 11 Swap bytes These operations are performed pn the ALU output ' - - - - - - - - - - - - - 000 Complement 001 Twos Complement (Negate) 010 Move 011 Increment 100 Add Complement 101 Subtract 110 Add 111 AND OOACO Destination ACCUmUlator} 01 AC1 ' - - - - - - - - - - - - - - - - - - - - - - - - - Source Accumulator 10 AC2 11 AC3 Figure 4-5. Arithmetic/Logic Instruction Object Code Interpretation 4-17 ~ r--:=:--l-..J·~D~.t~a~ou~tpu~t....~--.......L - -... ~T~~=l--------J i t Carry for Skip -ttll Carry Status I CPU LOGIC AND INSTRUCTION EXECUTION The manner in which the Nova CPU executes instructions differs markedly from microcomputers described earlier in this book. We will therefore begin our discussion of CPU operations by looking at overall CPU architecture. Our discussion of Nova CPU logic is tied to instruction object code bit patterns; this happens to be the simplest way of describing the Nova CPU. We will look at instructions from a programmer's perspective when we eX'amine the Nova instruction set. Nova instructions may be divided into these three groups: 1) 2) Arithmetic. Boolean and logical operations which are essentially internal to the CPU. Memory reference instructions which offer a variety of memory addressing modes and very little else. 3) I/O instructions which are designed to allow a considerable amount of intelligence in I/O devices. Let us examine each group of instructions and associated CPU logic. ARITHMETIC/LOGIC INSTRUCTIONS The power of the Nova CPU lies in the fact that many logic functions are implemented sequentially along a single data path through the CPU. This is illustrated in Figure 4-4. This figure shows how individual bits of arithmetic and logic instruction object codes directly identify the many options available as data makes a single tour through the CPU. Figure 4-5 provides specific arithmetic and logic instruction object code interpretations. Data to be operated on is always fetched from the Accumulators. Results are always returned to an Accumulator. For two-operand instructions. such as binary addition. the Destination Accumulator also serves as the second Source Accumulator. For one-operand instructions. such as a complement. there will be one Source Accumulator and one Destination Accumulator; the same Accumulator may serve as source and destination. As the source and destination definitions would imply. the Nova has no Secondary Memory Reference (or Memory Operate) instructions as we define them; for example. you cannot directly add the contents of a memory word to the contents of an Accumulator. In addition to one or two 16-bit data words. the Carry status is input to the Arithmetic and Boolean logic unit. You may input the Carry status as is. or you may complement it. reset it to 0 or set it to 1. If you modify the Carry status. then the modified Carry status becomes the new input to the Arithmetic and Boolean logic. You may specify one of eight Arithmetic and Logic operations. The Move operation serves both as a Move and a No Operation. By specifying the same Accumulator as the source and destination for a Move. Arithmetic and Boolean logic is bypassed. Notice that only one Boolean operation. the AND. is provided. This is an inconvenience rather than a problem. As discussed in Volume 1. Chapter 2. you can combine the AND and complement operations to generate an OR or an Exclusive-OR. The following Nova instruction sequences substitute for the OR and Exclusive-OR: ;OR the contents of ACX with COM ACX.ACX AND ACX.ACY ADC ACX.ACY ;Exclusive-OR ACX with ACY. ;ACZ is needed for temporary MOV ACY,ACZ ANDZL ACX.ACZ ADD ACX.ACY SUB ACZ,ACY ACY. Leave the result in ACY Complement ACX AND ACX with ACY. Result to ACY Add original ACX. Result to ACY Leave the result in ACY. data storage Save ACY in ACZ Store twice ACX AND ACY in ACZ Add ACX to ACY Subtract twice ACX AND ACY The 16-bit output from the Arithmetic and Boolean logic. together with the Carry status. passes to the Shifter and Byte Swap logic; here the 17-bit data unit may be rotated left or right. high and low-order bytes of the 16-bit data unit may be swapped. or this logic may be bypassed. The Shifter and Byte Swap logic outputs 16 bits of data. plus the Carry status. The data and the Carry status may be tested separately. and based on one of eight identifiable conditions. the Program Counter contents may be incremented; this provides conditional skip logic. Figure 4-5 defines the eight conditions that may cause a skip. Finally you have the option of preventing results from being stored in the Destination register; this enables conditional branch logic without modifying the contents of any Accumulator. 4-18 In summary, the five operations that can be specified by a single arithmetic/logic instruction may be illustrated as follows: [ ] [[]] A A 3-bit skip-on-condition field which is used by the Register-Register Operate instructions. Coded Character Result Bits Operation option omitted 000 No operation SKP 001 Always skip SZC 010 Skip if Carry = 0 SNZ 011 Skip if Carry = 1 SZR 100 Skip if result = 0 SNR 101 Skip if result =1= 0 SEZ 110 Skip if either carry or resu It = 0 SBN 111 Skip if both carry and result =#= 0 Generates the address EA @ is the indirect bit. If @=1 then indirection is specified. DISP is an 8-bit address value. (IX) is a 2-bit field which indicates the addressing Mode: Bits are Mode 00 Zero page addressing. DISP is an unsigned address between 0 and 256. EA = DISP 01 PC relative addressing. DISP is a signed two's complement address displacement. EA = DISP+ [ PC] 10 Indexed addressing via AC2. DISP is a signed two's complement address displacement. EA = DISP+ [ AC2] 11 Indexed addressing via AC3. DISP is a signed two's complement address displacement. EA = DISP+ [ AC3] A 2-bit 1/0 test field whose meaning depends on whether the CPU or another device is referenced. CPU t Device Test for lr;te';TUpt On=1 00 'TeStTor Busy=1 Test for Interrupt On=O 01 Test for Busy=O Never skip 10 Test for Done= 1 Always skip 11 Test for Done=O Bits y through z of the quantity x. [AC] <5,0> is the low six bits of the specified Accumulator. Contents of location enclosed within brackets. If a register designation is enclosed within the brackets, then the designated register's contents are specified. If a memory address is enclosed within the brackets, then the contents of the addressed memory location are specified. Implied memory addressing; the contents of the memory location designated by the contents of a register. Logical AND Data is transferred in the direction of the arrow. Under the heading of STATUS in Table 4-2, an X indicates statuses which are modified in the course of the instruction's execution. If there is no X, it means that the status maintains the value it had before the instruction was executed. 4-37 Table 4-2. MicroNova and 9440 Instruction Set Summary STATUS TYPE MNEMONIC OPERAND(S) OPERATION PERFORMED 9440 BYTES C NIOIfl DEV 2 X [DEVBD) - f DIA(f) AC,DEV 2 X Set the device's Busy and Done flags according to I/O command. [AC) - [DEVA) [DEVBD) - f DIB(f) AC,DEV 2 X Read device's A buffer into Accumulator, Set the device Busy arid Done fla9s, [AC) - [DEVB] [DEVBD] - f DIC(f) AC,DEV 2 X DOA(f} AC,DEV 2 X DOB(f) AC,DEV 2 X DOC If) AC,DEV 2 X SKP(t) DEV 2 X ~ w g CD 10RST ~ _L-- X Read device's B buffer into Accumulator, Set the device Busy arid Done. flags, [AC] - [DEVC] [DEVBD) - f Read device's C buffer into Accumulator, Set the device Busy and Done flags, [DEVA) - [AC) [DEVBD) - f Write Accumulator into device's A buffer. Set the device Busy and Done flags, [DEVB) - [AC) [DEVBD) - f Write Accumulator into device's B buffer. Set the device Busy and Done flags. [DEVC) - [AC) [DEVBD] - f Write the Accumulator into device's C buff~r. Set the Busy and Done flags. If T is true for DEV, [pc) - [pc) + 1 Skip if I/O test true, [PM]-O liON) -102 The Busy and Done flags in all I/O devices are set to interrupts are turned on. O. The Priority Mask is set to 0 and Table 4-2. MicroNova and 9440 Instruction Set Summary (Continued) STATUS tyPE MNEMONIC OPERAND(S) 9440 BYTES OPERATION PERFORMED I C w »u ex:ex:z ::!:::!:II: LOA AC,( ",) DISP (.IX) 2 X [AC]- [EA] STA AC,( Ii) OISP (,IX) 2 X Load contents of memory to Accumulator. [EA]- [AC] «Ow f~~II: Store contents of Accumulator into memory. ADD(CS#) SUB (CS#) .J:o W CD w ~ « ex: w a. NEG (CStJ) S,D(SKCND) S,OtSKCNO) S,DtSKCND) 2 2 2 X X X X [0]- [0]+ [S] X Add contents of Source register to contents of Destination register. Perform the specified options. [0]-[0]- [5] X Subtract contents of Source register from contents of Destination register. Perform the specified options. [0] - [Si + 1 (twos complement) X Place twos complement of the Source register contents in the Destination register. Perform the specified options. [0]- [0]+ [5] 0 ex: w ~ III C; ADC(CSti) S,OI.SKCNO) 2 X w ex: ci: w ~ MOV(CS") 5,0 (.SKCND) 2 X X Add the ones complement of the Source tegister contents to contents of Destination register. Perform the specified option. [0]-[5] INC (CS fI) 5,0 (.SKCND) 2 X X Move contents of Source register to Destination register. Perforj'Tl the specified options. [0]-[5]+1 COM (CStt) S,Oi.SKCNO) 2 X X Place incremented Source register contents into Destination register. Perform specified options. [0]-[5] X Complement the Source register contents, then move to Destination register. Perform specified options. [0]- [0] A [5] III C; w II: AND (CS fI) S,OtSKCNO) 2 X AND the Source register contents with the Destination register contents. Perform specified options. Table 4-2. MicroNova and 9440 Instruction Set Summary (Continued) STATl,IS TYPE MNEMONIC OPERANDIS) BYTES OPERATION PERFORMED 9440 C a: w I- MUL 2 DIV 2 [ACO] -(( [ACl] [Acll-l( [ACl] sw~ wI-;:) a: [AC2])+ [ACO}) < 15,0> Multiply contents of AC 1 by contents of AC2 and add contents of ACO to result. [ACll-( [ACOJ.[ACll)/[AC2] (quotient) [ACO] - ( [ACOl,[ACl])/ [AC2] Iremainder) Divide the 32-bit quantity contained in ACO (high order) and AC1 (low order) by the contents of AC2. [SP] - [SP] + 1; [[SP)) - [AC) Push the Accumulator onto the Stack. [AC] - [[SP]; [SP] - [SP] - 1 Pop the top of the Stack to the Accumulator. [(SP] + 1]- [ACO] [(SP] +2] - [ACll [(SP]+3] - [AC2] [(SP] +4] - [AC3] ([SP]+5] <14,0> - [PC] [(SP] +5] <15> - [C) [SP] - [Spj + 5 [FP] - [SP] Save a return block in the Stack. [SP] - [AC1<14,0> Move the low 15 bits of the Accumulator to the Stack Pointer. [FP] - [AC] <14,0> Move the low 15 bits of the Accumulator to the Frame Pointer. Table 4-2. MicroNova and 9440 Instruction Set Summary (Continued) STATUS TYPE MNEMONIC OPERAND(S) 9440 BYTES OPERATION PERFORMED C Q w MFSP AC 2 MFFP AC 2 JMP (u)DISP(,IX) 2 X JSR (u)DISP(,IX) 2 X [AC] <14,0> - [SP] [AC] <15>-0 MOve the Steck Pointer to low 15 bite of Accumulator. [AC] <14,0> - [FP] [AC] <15>-0 Move the Frame Pointer to the Accumulator. ~~ Uz :!i= cn Z 0 y f" ~ Q, [PC]-[EA] Branch unconditIoneI. [AC3]-[PC]+1 [PC] ...... [EA] Branch to subroutine. [SP] - [FP] [C) - [[SP)) <15> [PC] - [[SP)) <14,0> [AC3] - [(SP] - 11 [AC2] - HSP] - 21 [ACl] - HSP] - 31 [AC2] - HSP] - 4] [SP] - [SP] - 5 Return from subroutine end pop e retum block off the Stick. RET 2 RTCEN(f) 2 X [ION] - f RTCDS(f) 2 X Eneble Reel Time Clock then let ION vie I/O commend. [ION] - f DiAbIe R_I Time Clock then let ION vii I/O commend. X :E ~ "') w 2~ i=g ,J,J ~u a: Table 4-2. MicroNova and 9440 Instruction Set Summary (Continued) STATUS TYPE MNEMONIC OPERAND(S) 9440 BYTES OPERATION PERFORMED C c ~~z~ owO!- ISZ (II)DISPI.IX) 2 x ~!-ci.Q wc(-z ~~~8 DSZ (II)DISPI.IX) 2 X 1 N INTEN 2 X [lON]-1 INTDS 2 X Enable interrupts. Same as NIOS CPU. [lON]-O 2 X INTA(f) AC !a. :;) I:£: a: w !- :!!: [PC] + 1 Increment memory contents and skip if zero. [EA]- [EA]- 1 If [EA] = 0 then [PC] - [PC] + 1 Decrement memory contents and skip if zero. 0 ~ [EA] - [EA] + 1 If [EA] =0 then [PC] - MSKO(f) AC X Disable interrupts. Same as NIOC CPU. [AC] <5,0> -DEV [lON]-f The 6-bit device code of the device closest to the CPU that is requesting an interrupt is loaded into the low six bits of the Accumulator. Set ION via I/O command. [PM]- [AC] [ION]-f Move contents of Accumulator to Priority Mask. Set ION via I/O command. TRAP SKPIt) 2 CPU 2 [26,.] - [PC] X [PC]- [27,.] Performs a software interrupt. If t is true. [PC]- [PC] + 1 If interrupt or power fail condition satisfied. skip next instruction. I HALT(fI 2 X [lON]-f Set ION via I/O command. then halt. I Table 4-3. MicroNova and 9440 Instruction Set Object Codes INSTRUCTION ADC(CS#) ADDlCS#) ANDlCS#) COMICS#) OlAf DIBf DICf DIV DOAf DOBf DOCf DSZ HALTf INC(CS#) INTAf S,DI.SKCND) S,DI.SKCND) S,DI.SKCND) S,DI.SKCND) AC,DEV AC,DEV AC,DEV AC,DEV AC,DEV AC,DEV (f1:)DISPI,IX) S,DI.SKCND) AC INTDS INTEN IORST ISZ JMP JSR LOA MFFP MFSP MOV(CSIf) MSKOf MTFP MTSP MUL NEG(CS11) NIOf POPA PSHA RET RTCDSf OBJECT CODE 1ssdd 1OOrrccnwww 1ssdd 110rrccnwww 1ssdd 111 rrccnwww 1ssddOOOrrccnwww 011 aaOO1 ffpppppp 011aaOllffpppppp 011aal0lffpppppp 7641 011aa01Offpppppp 011aa l00ffpppppp 011aallOffpppppp 000llixxbbbbbbbb 011aallOffllllll lssddOllrrccnwww 011aaOllffllllll 60BF 607F ( f1i)DISPI,IX) ('f1;) DISP I,IX) ( f1i)DISPI,IX) AC (· f1i),DISP (,IX) AC AC S,DI.SKCND) AC AC AC S,DI.SKCND) DEV AC AC RTCENf SAY SKPt SKPT DEV STA SUB(CS#) CPU AC,( ,,) DISP (,IX) TRAP S,DI.SKCND) 011aa01Offllllll 000 10ixxbbbbbbbb OOOOOixxbbbbbbbb 00001 ixxbbbbbbbb 011aaixxbbbbbbbb 011 aaOOO 100000o 1 011aaOl010000001 lssddOl0rrccnwww 011aal00ffll1111 011aaOOOOOOOOOOl 011aaOl000000001 76Cl 1ssddOO 1rrccnwww 01100000ffpppppp 011aaOl110000001 011aaOl100000001 6581 0110101Offl11111 011100lOffllllll 6501 01100111ttpppppp 01100111ttllllll 010aaixxbbbbbbbb 1ssdd 101 rrccnwww 1ssddqqqqqqq 1000 CLOCK PERIODS 9440 2 2 2 2 2 2 5/7 5/7 5/7 X X X 5/7 15 15 2 15 123 10 X X X X BYTES 2 2 2 2 2 2 2 2 2 2 2 10 10 8/10" 10 5/7 15 10 10 10 2 2 2 8/10" 6/8· 2 2 2 6/8* 8 7 2 2 5/7 10 2 2 6 2 2 2 2 2 2 2 2 2 2 2 2 2 2 7/9* X X X X X X X X X X X X X X X X 6 86 5/7 10 7 7 15 10 10 16 15/17 15/17 6/8* 5/7 9 X X X X X X X X *Direct addressing. For indirect addressing, add two clock periods for each level of indirection. For autoincrement or auto- decrement locations, add three clock periods, plus two for each level of indirection. The following symbols are used in Table 4-3: aa bbbbbbbb cc dd ff n pppppp rr ss Two bits selecting an Accumulator 8-bit signed two's complement address displacement Two bits selecting the carry option Two bits selecting the destination Accumulator Two bits selecting the I/O command One bit selecting indirect addressing One bit choosing the no load option Six-bit device number Two bits determining the shift option Two bits choosing the source Accumulator 4-43 tt www xx Two bits choosing the I/O test Three bits selecting the skip-an-condition option Two bits selecting the index option Execution times shown are for MicroNova. Where two execution times are shown (for example. 5/7). the second is the instruction time if the skip or branch is taken. See Table 4-4 for 9440 execution times. Table 4-4 shows the sequences of machine cycles by which the 9440 executes instructions, interrupt and data channel requests, and commands received via lines C3 - CO. 4-44 Table 4-4.9440 Instruction Execution NO. INSTRUCTION OR OPERATION CYCl E TYPE AND SEQUENCE·· EXECUTION TIME" FETCH READ WRITE LD MAR I/O OUT I/O IN WAIT DCH 1 Jump 1 2 Jump Indirect 3 3 Jump to Subroutine 1 4 JSR Indirect 3 (/JS) 1.5 1 2 4.5 1 2 4.5 1.5 5 Increment and Skip if Zero 3 1 2 4.5 6 ISZ Indirect 5 1,3 2,4 7.5 7 Decrement and Skip if Zero 3 1 2 4.5 8 DSZ Indirect 5 1,3 2,4 7.5 2 6.0 9 Load Accumulator 10 LOA Indirect 2 1 4 1.3 3.0 11 Store Accumulator 3 1 2 4.5 12 STA Indirect 5 1,3 2,4 7.5 13 Complement 1 14 Negate 1 1.5 .;A~!I{ 1.5 15 Move 1 1.5 16 Increment 1 1.5 17 Add Complement 1 1.5 18 Subtract 1 1.5 19 Add 1 1.5 20 AND 1 1.5 1,2 3.0 21 ALU with Skip 22 I/O Data In 2 23 1.0 Data Out 2 24 Skip on Busy or Done 2 25 Interrupt 5 1 2.5 1 2.5 2.5 1 3 2.4 1 7.5 26 Data Channel 1 1 27 Wait 1.0 1.0 2.0 28 Examine Accumulator 2 1 .29 Deposit Accumulator 2 1 2.0 30 Load PC 2 1 2.5 31 Examine Memory 2 1 2.5 32 Examine Next 2 33 Deposit Memory 34 Deposit Next 35 Continue 1 2.5 3 2 1 4.0 3 2 1 4.0 1 2.5 2 2nd cycle - WRITE ··e.g., No.6, ISZ Indirect: ·For 9440 System using 3rd cycle - READ 1st cycle - READ a 10 MHz oscillator. Reprinted by permission of Fairchild Camera and Instrument Corporation. 4-45 4th cycle - WRITE 5th cycle - FETCH !"""- () +5V I . iBi -187 ~ G .- Ai ... ..> -A7 ) ... I PRE IB8 - 'iB'i5 Q '--- 0 LS74 LS377 G . AS - A15 CK ) ... -- ~CK "V r LS377 ~ ~ MBUSY 01 ;::J 00 . ~ - 1 A .. iBO - iB7 I(' A A B r '" A Mi50 - MD7 G DIR IB8 - IB15 G A , r LS245 ~ MD4 - I ..) Mi59 G I L MD8 - Mi51'5 ... '" ... iR4 -IR9 CK .. LS378 G ... ~ ) ~ r iR10 - iRT5 ... ) .. LS378 ,J~ .- 01 00 iR7 . IBO - iB7 , . Instruction Register (12 bits) 1 --.. DSO - 055 ". G DIR A A B r i5ATAO - DAi'A7 . LS245 A ~ IB8 - iBi5 .. .. , iiffi -IB15 G DIR A ..L DATA8 - DA'i'A15 Figure 4-18. 9440 Information Bus Demultiplexing Logic 4-46 .. ... ) " I/O Address Bus .. B LS245 Memory Data Bus B1~ ~ r iiii'i5'1O-MD15 .. ~ , LS245 DIR I Memory Address Bus r 1/0 Data Bus 1 9440 - NOVA BUS INTERFACE We will now examine logic which expands the 9440 pins and signals to the standard Nova 1/0 bus and to a typical microcomputer memory bus. Table 4-1 identifies the Nova 1/0 bus that is created. We will also illustrate that part of 1/0 device interface logic which is common to any 1/0 device associated with Busy, Done and Interrupt flags. that is, logic Our discussion of logic needed to create a memory bus is quite general. reflecting the fact that there is no standard Nova memory bus. We will therefore limit ourselves to demonstrating. in general. how typical memory bus signals may be created from 9440 signals. But we will be specific in describing logic that expands the 9440 interface to a standard Nova I/O bus. The 9440-Nova bus interface description is divided into three parts: 1) ExpanSion of the Information Bus into various Address and Data Busses required by the I/O and memory references. 2) Creation of I/O interface control signals. 3) Creation of memory interface control signals. We will examine each of the three logic expansions in turn. 9440 INFORMATION BUS EXPANSION These four busses must be created out of the bidirectional 16-bit Information Bus: 1) A bidirectional. 16-bit Memory Data Bus. 2) An output only. 15-bit Memory Address Bus. 3) A bidirectional. 16-bit I/O Data Bus. 4) An output only. 6-bit I/O Device Address Bus. We must also latch I/O instruction object codes into a buffer out of which I/O instruction code bits can be read by I/O control signal logic. The 9440 Information Bus is low true; this means a low signal level represents a binary 1, while a high signal level represents a binary O. Standard Nova 1/0 Data and Address Busses are also low true; we therefore do not need to invert signals during multiplexing and demultiplexing. There are many ways in which the 9440 Information Bus may be multiplexed to create the four required busses. We illustrate one possibility in Figure 4-18. This logic uses LS245 8-bit bidirectional tristate buffers to generate the two bidirectional Data Busses. while 8-bit and 6-bit gated. edge-triggered flip-flops create the Address Busses and the Instruction Object Code register. The Data Bus buffers each have a gate (output enable) input and a data direction input. The gate inputs are low true. Logic shown in Figure 4-18 selects the LS245 buffers while valid memory data or valid I/O data can exist. Within these select periods a data direction control signal is created to ensure that data flows in the correct direction. For the Memory Data Bus. MDO - MD15. the LS245 buffers must be selected either during a read or a write operation. as identified by MO or M1. But these two signals span addr~ and data occurring on the Information Bus. Valid data exists on the Information Bus when MBUSY is high while SYN is low: valid data from memory or CPU CPU drives address here 4-47 This timing is also illustrated in Figures 4-12 and 4-13. The logic of Figure'4-18 uses an LS74 flip-flop clocked by the low-to-high transition of MBUSY. This ensures that data is not driven in the time shaded in the preceding illustration - between the high-to-Iow transition of SYN and the high-to-Iow transition of MBUSY. MO is used as the Memory Data Bus data direction control. The I/O Data Bus buffer logic is somewhat simpler. The Information Bus is dedicated to transferring I/O data for the entire duration of a data input or data output machine cycle, as defined by 01 high and 00 low: these two signals are therefore used to create gate (output enable) logic. The direction of the I/O data transfer is taken from IR7: this bit of the I/O instruction object code defines the direction of an I/O data transfer, as illustrated in Figure 4-18. For the Address Busses we do not use buffers: rather. we use gated-clock, edge-triggered flip-flops. This allows the address being output to be held stable on the Memory Address Bus, or the I/O Address Bus, after it is no longer on the Information Bus. In the case of the Memory Address Bus, the gate inputs are tied to M2, which will be low whenever a memory address is being output on the Information Bus. The high-to-Iow transition of SYN is intended to act as a memory address strobe: therefore it is inverted to clock the Memory Address Bus flip-flops when M2 is low. Observe that there are only fifteen lines on the Memory Address Bus: the high-order bit of a 16-bit memory address is reserved to indicated an indirect address. Note also that the LS377 outputs are not tristate: therefore the Memory Address Bus will always hold the address of the most recently accessed memory location. Two LS378 6-bit gated-clock flip-flops are used to latch the lower 12 bits of instruction object codes off the Memory Data Bus, c~ati~ the I/O Address Bus and the Instruction register. The six low-order output lines provide the I/O Address Bus, SO - S5. As you can see in Figure 19-8, only the low-order 11 bits of the I/O instruction need to be decoded by I/O logic: therefore we use the 16-pin LS378 parts, rather than the 20-pin LS377s which we used for the Memory Address Bus. Like the Memory Address Bus, the Instruction register and I/O Address Bus will always hold the most recently latched data. The Instruction register flip-flops are clocked by the low-to-high transition of M'imSY whenever an instruction object code is on the Memory Data Bus. This condition is guaranteed by logic which enables the clock only when 01 and 00 are both low, signifying an Instruction Fetch machine cycle. If we wished to latch only I/O instructions, we could change the gate logic as follows: P MDT ------~ ~---..... ~ to G of each LS378 ; MOO Mg~ Latching the instruction object code only when its upper three bits are 011 (MOO high, MD1 and MD2 low) means that the I nstruction register will only hold I/O instructions. Latching all instructions is sufficient since an I/O execution machine cycle (01 high and 00 low) follows the fetch of an I/O instruction. Our logic will use lines 01 and 00 to indicate execution of an I/O instruction. Let us now examine I/O bus control signal logic. 9440-NOVA I/O BUS INTERRUPT SIGNALS Three signals on the standard Nova I/O bus are used by interrupt logic: INTR. INTA and INTP. INTR is the standard interrupt request signal. This signal can be tied directly to the9440 INT REO input. The interrupt acknowledge signal INTA is created in response to execution of the interrupt acknowledge instruction. We will describe logic which creates INTA along with other I/O bus control signals when we discuss Figure 4-19. INTP is the initial input to the highest priority device in an interrupt daisy chain. This may be illustrated as follows: INTA I T T Device Device Device 1 2 3 4 j "PQij'f PiN = Priority In POUT = Priority Out 4-48 4 atc. INTP may be connected to the complement of the 9440 output INT ON. in which case priorities within a daisy chain will not be resolved while interrupts are disabled. Frequently the initial j5jj\j'input to a daisy chain will be tied to ground and INTP will not be used. Now interrupt priorities will be arbitrated whether or not interrupts have been enabled. As you will see. it takes very little logic to expand the 9440 interrupt signals to standard Nova I/O bus interrupt lines. But a considerable amount of interrupt-related logic must be present at external device controllers -logic which we will describe later in this chapter. 9440-NOV A DMA CONTROL SIGNALS The only DMA logic provided by the 9440 consists of a DMA request signal. DCH REO. When input low. this signal causes the 9440 to complete the instruction currently being executed. then to disable interrupts and wait. The DMA request is acknowledged by outputting 01 low and 00 high. All logic which actually implements any DMA transfer must be implemented external to the 9440. We will discuss briefly what logic would be required. The Request Enable line. ROENB. goes true to permit both interrupt and DMA requests. Central DMA control logic would contain an Enable flip-flop. analogous to the CPU's Interrupt Enable flip-flop. The output of this flip-flop. ANDed with INT ON from the 9440. would I\)rovide ROENB as follows: DMAenable INT ON D ---------1 - - - - - - RciENB The DMA request line DCHR may be connected to the 9440 DCH REO input. Thus requests will be accepted and granted by the 9440 CPU. DCHA. the acknowledgment signal. is simply decoded from lines 01 and 00: g~--------9C::)o------~ DCHP is a priority line just like INTP. DMA daisy chain priorities would be implemented similarly to interrupt priorities. The 9440 surrenders control of the System Bus when it acknowledges a DMA request; therefore external logic must perform all signal manipulations and data transfers. DCHI and DCHO. which indicate the direction of data transfer. are signals output by external DMA control logic. The DMA control logic will input DeHMO and DCHM1 from the device requesting memory access. Of the four encoded modes shown in Table 4-1. "Data Out" and "Data In" can be handled with relative ease. especially if you use an LSI chip designed for DMA control. Implementing the other two functions. "Increment Memory" and" Add to Memory". requires much more logic since some arithmetic is required. Indeed. a one-chip microcomputer might supply this logic. Since OVFLO is true when an "Increment Memory" or an "Add to Memory" operation produces a result greater than FFFF16. this signal would be produced by the logic which performs those operations. Figure 4-19 shows 3-to-8 and 2-to-4 decoders creating Ndva I/O Bus control signals. The signal logic directly interprets I/O instruction object code bits illustrated in Figures 4-8, 4-9, and 4-10. Note that the Instruction register bits from Figure 4-18 are low true. and that Instruction register lines are numbered according to Nova conven~ tion. where the low-order line is IR15. 4-49 iBO SELB iBi SELD SKJ5' YO C iR'5 iR6 DATOC 5iC Y2 B iR7 DCre Yi DATIe DOB Y3 A DATOB LS13S Y4 G1 01 00 om ffi Y5 (ffij Va Y7 OATIS DOA DATOA i5IA DATIA REffi iiITO iim 1R12 m 10RST CPU OP iR14 iRT5 DoB MSKo DiS INTA YO B iR9 1/2 A SKP Vi LS139 Y2 Y3 G 01 00 iOP 10PLS cr. CLR ST STRT +5V CPUOP SYN PRE Q 0 CK LS74 Ci Prs CIA 01 00 Figure 4-19. Creation of Nova I/O Bus Control Signals from 9440 Signals 4-50 an - Instruction object code bits are continuously read out of the Instruction register IR15), but I/O control signals are created only during an I/O Execute machine cycle (when 01 is high and 00 is low). The logic of Figure 4-19 may be divided into these four sections: 1) Creation of simple data transfer control signals 2) Creation of I/O skip logic. 3) Creation of interrupt control signals. 4) Creation of control signals STRT, CLR and 10PLS. Let us first consider simple data transfer control signals. There are six signals: DATIA, DATIB, DATIC. DATOA. DATOB. and DATOC. These are created by the LS138 3-to-8 decode.r in Figure 4-19. and enabled when the I/O device address is other than 3F 16. If you look at Figure 4-8 you will see that instruction bits 10 and 9 (iR5 and iR'6) select one of the three registers that may exist at an I/O device, while bit 8 (iR7) differentiates between I/O data input and I/O data output. These three bits are input to the LS138 decoder so that the six data transfer signals and the Skip signal are decoded at the outputs. The decoder is enabled only during an I/O Execute machine cycle - that is. when 01 is high and 00 is low. However. if the I/O device address is 3F16. thef\ CPU OP will be true and no data transfer signal will go true. It is not strictly necessary to disable the signals with CPU OP; sirrce none of the I/O devices will be assigned the address 3F16. none of them will respond to I/O instructions with that address. ma The Skip control. SKP. output from the LS138 decoder. is used to enable and SELD onto Information Bus lines IBO and IB1. This is done using three-state buffers enabled by SKP low; the buffers in Figure 4-19 might be part of an LS 125 or an LS367 chip. SELB and SELD are inputs to the buffers. while the outputs are connected to Information Bus lines IBO and iBi'. We assume that as soon as any I/O deviCe is selected. it immediately connects its Busy and Done statuses to the SELB and SELD control lines of the I/O bus. However. SELB and SELD will not appear on Information Bus lines IBO and iBi unless a Skip I/O instruction has been executed. When an I/O instruction is executed specifying device 3F16. a set of interrupt-related I/O instructions is executed. as illustrated in Figure 4-10. Most of the instructions illl;lstrated in this figure specify events internal to the CPU. For example. "enable interrupts" and "disable interrupts" apply to CPU interrupt logic; moreover. the Skip instructions interrogate interrupt request status and power fail status within the CPU. "Acknowledge Interrupt" (lNTA). "Output Interrupt Mask" (MSKO) and "Clear All I/O Devices" (lORST) are the only instructions which require control signals to be generated on the I/O bus. These control signals are generated by qualifying the decoder of the instruction bits with a device 3F16 select code. The device 3F 16 select code. CPU OP. is created by ANDing the loworder six instruction bits (lR10 through.IR15). Thus the gates producing INTA. MSKO. and 10RST are effectively switched on and off by CPU OP Note that 10RST is generated either by execution ofa "Clear I/O Devices" instruction. or by the master system Reset signal. RESET. Let us next consider logic needed to create STRT. CLR. and 10PLS. These control signals should be activated after the appropriate I/O transfer has taken place. Thus the logic in Figure 4-19 provides a gating signal. PLS. which goes low on the low-to-high transition of SYN. PLS is the IT output of the LS74 flip-flop in Figure 4-19. The timing for STRT, CLR. or. 10PLS results as follows: 10PlS. STRT. or ClR 01 00 I Instruction Fetch ~~4"'----------1/0 Execute----~I-------_tl... CPU or 1/0 Device reads data here· 4-51 The LS 139 2-to-4 decoder decodes instruction object code bits 7 and 6 (iFrn and imil. providing that the I/O instruction being executed is not an I/O Skip instruction. (The other half of the LS139 chip could be used to decode lines 01 and 00. instead of the gating logic shown in Figures 4-18 and 4-19.1 DSO Address Logic DS5 STRT rue Q BUSY CK LD74 Q ffii I/O COMPLETE +5V 10RST SELD Q CLR DONE SELECT CK LS74 Q ffii STRT SELECT 10RST PRE i5ATAii D MsKo Q iN'fR CK §YN LS74 Q +5V Figure 4-20. Busy. Done. and Interrupt Status Logic Required by I/O Device Controllers on the Nova I/O Bus NOVA I/O DEVICE CONTROLLER LOGIC Interface logic which an external device needs in order to connect to the standard Nova I/O bus depends on the nature of the external device. A minicomputer device controller may be very complex, even costing more than the minicomputer itself; that is because minicomputer devices that connect to the I/O bus are peripherals, such as printers, disks. etc. When we reduce the Nova to microprocessor terms. however. external devices connected to the I/O bus reduce to such primitive elements as parallel I/O ports or serial data lines. Within this 4-52 reduced context we can synthesize the minimum necessary elements of an I/O interface as consisting of three status flags: Busy, Done, and an Interrupt request. We can implement these three status flags using three LS74 flip-flops, as illustrated in Figure 4-20. Device select logic in this figure is limited to showing a select signal which will be generated true when the appropriate device code appears on the I/O device Address Bus. We have discussed I/O device select logic at various points earlier in this chapter. Let us look at the BUSY and the DONE status logic. These are the operations which may affect the condition of the BUSY and DONE statuses: 1) At the start of an I/O operation BUSY must be set while DONE is clear. This condition is identified by 01 in bits 7 and 6 (lR8 and iR9) of the I/O instruction object code, which generates the STRT control signal of the I/O bus. 2) At the completion of an operation BUSY is cleared and DONE is set. This change in status setting must be implemented automatically by I/O device interface logic: it alone knows when the I/O operation has been completed. 3) BUSY and DONE may be cleared by the CPU. This is specified by 10 in bits 7 and 6 (lR8 andl"R9) of the I/O instruction, which generates the CLR control signal on the I/O bus. 4) There is a "Clear All I/O Devices" instruction. This instruction generates 10RST on the I/O bus: it clears BUSY and DONE statuses at all I/O devices. 5) A Master Reset must also clear the BUSY and DONE statuses. This Master Reset signal can also create 10RST, as illustrated in Figure 4-19. Two D-type flip-flops implement the BUSY and DONE status logic. These two D-type flip-flops are clocked by an "I/O Complete" signal which local device logic must generate. The BUSY and DONE statuses are generated by the flipflop Q outputs which must connect to SELB and SELD, as required by I/O skip logic, which we have already described. The BUSY flip-flop uses its Set and Clear logic to control the BUSY status. The BUSY status is set by STRT and SELECT both true. This combination of STRT and SELECT sets the device BUSY status while it resets the DONE status. Either CLR and SELECT both true or 10RST true will activate the Clear input of the BUSY flip-flop. Neither of these conditions will be present when BUSY is set by the STRT pulse. Subsequently, when STRT or SELECT goes false, BUSY will stay true until it is reset by "I/O Complete" or by an active Clear input. which will occur when either 10RST or both CLR and SELECT are true. 10RST CLR STRT The DONE status is set by the "I/O Complete" pulse after BUSY has been set. Once DONE is set. it will remain true until the flip-flop is cleared. These conditions are provided by OR logic at the D input to the DONE flip-flop. The Clear input is Clctivated by anyone of the following conditions being true: 1) STRT and SELECT both true: thus the DONE status is reset at the same time as the BUSY status is set. 2) The master Reset. 10RST. 3) CLR and SELECT both true. The device interrupt may be individually disabled by a Mask Out instruction's execution: this creates the MSKO control signal used to permit the clocking of the interrupt mask flip-flops. Accompanying execution of the Mask Out instruction, a 16-bit data value is output on the I/O Data Bus. An I/O Device's interrupt logic is controlled by one bit of this mask, the bit transmitted via I/O Data Bus line DATAn. Therefore DATAn becomes the D input to the interrupt mask flip-flop. A 1 in the mask bit (DATAn low) disables interrupts from the I/O device. In Figure 4-20, the Q output of the flip-flop becomes the interrupt enable signal. INT ENABLE. which gates the device's interrupt request onto INTR. The bottom flip-flop in Figure 4-20 implements interrupt logic for the I/O interface. Let us summarize the conditions that can affect I/O interface interrupt logic. Providing interrupts are enabled at the I/O interface, an interrupt will be requested whenever an I/O operation is completed, as identified by the DONE status going true. If INT ENABLE is true, INTR will go low as soon as the DONE status is set. Interrupt logic may be enabled by a master I/O reset therefore 10RST is connected to the flip-flop Preset input. 9440 MEMORY BUS There being no standard Nova Memory Bus, we will look at the signals available to you when you interface memory to the 9440. First return to Figure 4-18. This figure shows how stable Data and Memory Busses may be demultiplexed off the 9440 Information Bus. In order to create a Memory Bus of any type, all you need is control signals to accompany the Memory Data Bus and the Memory Address Bus. Figure 4-21 presents an example of memory control signals derived from 9440 signals, and Figure 4-22 shows the timing for these signals. The four D-type flip-flops of an S175 chip, along with some combinatorial logic. constitute a state machine to generate Signals required by memory and the 9440 CPU. The four flip-flops are triggered 4-53 by MEMORY CLOCK. In order that all worst-case delay times be satisfied. the frequency of MEMORY CLOCK should not exceed 23.8 MHz; if LS parts are used. the maximum worst-case MEMORY CLOCK frequency is 10.8 MHz. The common clear of the four flip-flops will be activated if none of the lines MO. M1. or M2 is true. SYN MEM ENABLE ------e_---------------c. MEMORY CLOCK -----+--------------e_~ CK 1/4 S175 J----------+---t D Q t - - - - - - ADDRESS VALID CK )--------+---ID 114 S175 Q CK a t-----1~- MBtiSY 114 S175 ~~~D Qt----~ CK ENABLE ot-------, M2 MT ---------~~ -------4~_t Mo--~.....- .....WRITE READ Figure 4-21. Memory Controls Derived from 9440 Signals Using State Machine Logic 4-54 Figure 4-22. Timing for 9440-Based Memory Controls Provided that either Mi. M1 or MO is low (signifying a memory access machine cycle) the MEM ENABLE signals will go true on the first MEMORY CLOCK after SYN goes low. MEM ENABLE will stay on until the first MEMORY CLOCK after SYN goes high again. On the rising edge of MEMORY CLOCK after MEM ENABLE goes on, MBUSY and ADDRESS VALID will go true. Memory control logic must return MBUSY to the CPU. since the 9440 requires interaction of the MBUSY and SYN signals in order to complete memory access cycles. We discussed this earlier in this chapter. in the text accompanying Figures 4-12 and 4-13. A more complex memory interface could use MBUSY to lock out CPU memory accesses while the memory is busy -for example. while memory is responding to a direct memory access. The memory logic itself may require some signal to be true as long as a valid address is on the Memory Address Bus. Thus. our logic provides the signal ADDRESS VALID. which goes on after the contents of the Memory Address register (shown in Figure 4-18) have had time to settle. and remains until the end of the memory cycle. In Figure 4-18. the Memory Address register is clocked by the high-to-Iow transition of SYN. but a system might use the leading edge of ADDRESS VALID to clock the Memory Address register. On the MEMORY CLOCK after MBUSY goes on. the ENABLE flip-flop clocks on. If MO or Ml is low at this time, then READ or WRITE will go on and stay on until the MEMORY CLOCK after MEM ENABLE goes off. The signals READ and WRITE tell the memory chips the direction of the data transfer. Of course. different system signal and timing specifications would require different implementations of memory Signals. A memory system might use one-shots or delay lines to create pulsed Signals. and simple combinatorial logic for signal levels. A state machine implementation could use a Counter or Shift register. or perhaps a field-programmable logic sequencer such as the Signetics 82S105. 4-55 DATA SHEETS This section contains specific electrical and timing data for the following devices: • MicroNova ·9440 4-01 MICRONOVA ABSOLUTE MAXIMUM RATINGS· Supply Voltage Range Vaa -2 to -7 Volts Supply Voltage Range V CC -0.3 to + 7 Volts Supply Voltage Range VDD -0.3 to ~Volts Supply Voltage Range VGG -0.3 to + 17 Volts Input Voltage Range VI -0.3 to Input Current Range II o Operating Temperature Range T A o to Storage Temperature Range T stg Average Power Dissipation + 7 Volts to _6_mAmps +70 °c -55 to + 125°C 1 Watt NOTES All voltage8 in this document are referenced to V 88 (ground). *Subjecting a circuit to conditions either outside these limits or at these limits for an extended period of time may cause irreparable damage to the circuit. As such, these ratings are not intended to be u-sed during the operation of the circuit. Operating specifications are given in the DC (STATIC) CHARACTERISTICS ,TABLE. Data sheets on pages 4-02 through 4-03 reprinted by permission of Data General Corporation. 4-D2 MICRONOVA D. C. (STATIC) CHARACTERISTICS mN601 OPERATING SPECIFICATIONS TA Vee range_O_to~C 5,0.25 Volts Voo = 10 • 1.0 Volts VGG =14.1.0Volts ICC ~mAmps Average IBB V BB = -4.25 100 ~mAmps Average ISS Vss = 0 - 0.0 Volts ~mAmps Average CHARACTE R1STIC INPUT L(YN VOLTAGE INPUT CURRENT FOR L(YN STATE INPUT HIGH VOLTAGE INPUT CURRENT FOR HIGH STATE t .25 Vol!s SYMBOL VIL IlL VIH IIH PINS UNITS Volts mAOlps Volts mAmps ~mAmps LIMITS MIN. MAX. .0.5 121,3 and 122,4 -2.0 MB 0-1> , CLAMP EXTINT. DCH INT -1.0 +1.0 10 CLOCK. I 0 DATA I, I o DATA 2 al,3 and 122,4 MB 0-1. EXTINT. 0CIflN't, CLAMP I 0 CLOCK. I 0 DATA I, I o DATA 2 -1.0 .0.5 -2.0 -4.0 01,3 and '02,4 +13.0 +15.0 MB 0-1. EXTINT, , co;m; IlClr'lNT I 0 CLOCK. I 0 DATA I, I o DATA 2 al,3 and 02,4 MB 0-1. 10 CLOCK. 10 DATA I, I 0 DATA 2 EXTIN' . OCR INC +.01 -2.0 -2.0 -4.0 +4.25 +5.8 +2.5 +5.8 -.01 -.06 -1.0 -.02 +.001 co;m; +3.0 OUTPUT LOW VOLTAGE VOL Volts MB 0-1. I 0 INPUT: PAUSE, SAEG. WEG. PG 1/0 CLOCK JlO DATA 1 1/0 DATA 2 PG. I 0 INPUT OUTPUT CURRENT FOR LOW STATE 10L mAntps OUTPUT HIGH VOLTAGE VOH Volts OUTPUT CURRENT FOR HIGH STATE 10H mAnl~ .0.4 +0.5 +4.0 MB 0-1. . 1 o CLOCK I o DATA I,. o DATA 2 ~. SAEG. PG. HALT +2.0 MB 0-1. I 0 CLOCK. I 0 DATA 1, 10 DATA 2 I 0 INPUT. PAUSE. SAEG. WEG. PG +4.25 HALT C -0. M80-1. I o INPUT. PG 10 CLOCK. I 0 DATA 1, I 0 DATA 2, PAUSE SAEG. WEG 01,3 and .2,4 -.01 -.06 -.02 -.01 100 CLAm> INPUT CAPACIT ANCE CI pF MB 0-1. ,I o CLOCK I 0 DATA 1, I 0 DATA 2 Eiffiij'f. 0CIflIrr NOTE Logic "I" is defined as the more positive voltage as are the maximum figures given under voltage limits. Logic "0" is defined as the more negative voltage as are the minimum figures given under voltage limits. Positive current, in the conventional sense, is defined as flo'wing into t,he pin. On power-up. VBB must be within its specified operating range (with respect to Vss) before any of the other power supply voltages are applied to the circuit. 4-03 10 Average 9440 ABSOLUTE MAXIMUM RATINGS (beyond which the useful life of the device may be impaired) Storage Temperature Ambient Temperature Under Bias Vee Pin Potential to Ground Pin Input Voltage (de) Input Current (de) Output Voltage (Output HIGH) Output Current (de) (Output LOW) Injector Current (IINJ) Injector Voltage (VINJ ) _65° to 15O"C -55 to +125°C -0.5 to +6.0 V -0.5 to +5.5 V -20 to +5 mA -0.5 to +5.5 V +20 rnA +500 rnA -0.5 to +1.5 V DC CHARACTERISTICS OVER OPERATING TEMPERATURE RANGE (0 to 75°C) hNJ(min) = 300 rnA. hNJ(max) = 400 rnA. Vee(min) = 4.75 V. Vee(max) = 5.25 V LIMITS CHARACTERISTIC SYMBOL VIH Input HIGH Voltage MIN TYP MAX 2.0 VIL Input lOW Voltage Vco Input Clamp Diode Voltage VOH Output HIGH Voltage RUN. CARRY. INT ON. SYN. ClK OUT. 0 0 • 0 1 2.4 Q.utput.!'IGH Voltage IBo - IB15 2.4 UNITS TEST CONDITIONS V Guaranteed Input HIGH Voltage 0.8 V Guaranteed Input lOW Voltage -1.5 V Vee = 4.75 V. liN = -18 rnA IINJ = 300 mA 3.4 V Vee = 4.75 V. IOH IINJ = 300 mA = -4OO,.,.A 3.4 V Vee = 4.75 V.IOH IINJ = 300mA = -1.0 rnA 1.0 mA Vee = 4.75 V. VO H IINJ = 300mA = 5.25 V 0.25 0.5 V Vee = 4.75 V. 10L IINJ = 300 mA = 8.0 mA -0.9 ICEX Output leakage Mo. M1• M2 VOL Output lOW Voltage IIH Input HIGH Current _ _ _ _ _ _ _ Co-C3. DCH REO, INT REO, MBSY, MR 1.0 20 ,.,.A Vee = 5.25 V. VIN IINJ = 300 mA = 2.7 V Input HIGH Current CP 2.0 40 ,.,.A Vee = 5.25 V. VIN IINJ = 300mA = 2.7 V !!!put H..!.GH Current IBo - IB15 (3-State) 5.0 100 ,.,.A Vee = 4.75 V. VIN IINJ = 300 mA = 2.7 V 1.0 mA Vee = 4.75 V. VIN IINJ = 300mA = 5.5 V Input HIGH Current All Inputs IlL Input lOW Current All inputs except CP -0.21 -0.36 mA Vee = 5.25V. VIN = 0.4 V IINJ = 300 mA Input lOW Current CP -0.42 -0.72 mA Vee = 5.25 V. VIN IINJ = 300 mA 100 ,.,.A Vee = 5.25 V. VO UT IINJ = 300mA = 2.4 V -0.36 mA Vee = 5.25 V. VOUT IINJ = 300 mA = 0.4 V -100 mA Vee = 5.25 V. VOUT IINJ = 300 mA = 0.0 V 200 mA Vee V IINJ 10ZH OFF State (Hig.!!.lmp~ance) Output Current IBo - IB15 10ZL OFF State (Hig~lmp~ance) Output Current IBo - IB15 los Output Short CircuiLCu~nt_ All Outputs Except Mo. M1• M2 Icc Supply Current 150 VINJ Injector Voltage 1.0 -0.21 -15 = 0.4 V = 5.25 V = 300 mA Data sheets on pages 4-04 through 4-010 reprinted by permission of Fairchild Camera and Instrument Corporation. 4-04 9440 AC CHARACTERISTICS: T A = 0 to 75° C - Figures 8 & 9 LlMITS-ns SYMBOL CHARACTERISTIC tCPSYL Propagation Delay, CLOCK to SYN going LOW 150 tCPSYH Propagation Delay, CLOCK to SYN going HIGH 160 MIN TYP MAX NOTE 70 tMBSYL Propagation Delay, MBSY going HIGH to SYN gOing LOW tMBw MBSY Min Pulse Width (HIGH) tMBS Set-up Time, MBSY HIGH to CLOCK tMBHO Hold Time, MBSY HIGH after CLOCK tCPMH Propagation Delay, CLOCK to M2, M1, Mo going HIGH 160 tCPML Propagation Delay, CLOCK to M2, M1, Mo going LOW 170 tCPOH Propagation Delay, CLOCK to 01, 00 going HIGH 160 Fig.90nly tCPOL Propagation Delay, CLOCK to 01, 00 going LOW 170 Fig. 8 Only tCPAH Propagation Delay, CLOCK to ADDRESS 180-15 going HIGH 170 30 -40 60 tCPAL Propagation Delay, CLOCK to ADDRESS 180-15 going LOW 180 tMBAF Propagation Delay, CLOCK toADDRESS 180-15 gOing 3-state 110 tos Set-up Time, DATA 180-15 to CLOCK tOHO Hold Time, DATA 180-15 after CLOCK 130 tcs Set-up Time, C3, C2, C1, Co to CLOCK -110 tCHO Hold Time, C3, C2, C1, Co after CLOCK 130 tCPRH Propagation Delay, CLOCK to RUN HIGH 160 tCPRL Propagation Delay, CLOCK to RUN LOW tocs Set-up Time, DCH REO to CLOCK -110 170 -110 tOCHO Hold Time, DCH REO after CLOCK tiS Set-up Time, INT REO to CLOCK tlHO Hold Time, INT REO after CLOCK 120 tCPCYH Propagation Delay, CLOCK to CARRY HIGH 160 tCPCYL Propagation Delay, CLOCK to CARRY LOW 150 tCPIOH Propagation Delay, CLOCK to INT ON HIGH 200 tCPIOL Propagation Delay, CLOCK to INT ON LOW 190 130 -100 NOTES: 1. The Information Bus is driven as a result of the previous cycle. 2. The Fetch and Read cycles will be stretched out for slower memories. 3. Applies to console operation using this cycle type. 4-05 Fig. 8 Only 9440 I ... ·-----------------FETCHCYCLE-----------------~.I CLKOUT ~ " tcPSYL~ ~ -+l "'BSYL 14- ....\\\\lil MBSY k- I...w~ " ,. I -l __ I...S , I4--tcPSYH---l 1-1- " " "'.HO ~ ..... --- " "I- LrL'n..1-t.ru-t- -~ ~tcP"H~ -lk- I--- tcPML----.J " '- JL " i 00 " I4--ICPOL -...j 0, '- iio-15 \.G) _lcjAH_1 ..J _IC~AL---t 4-tDHD~ X " _ICPRH~ -- DATAIN --ilcs :: ---+-l ,lit RUN -+I IV/, DATAl/,( JL CO-3 i-ICPRL los tMBAF:i ADDRESS OUT "" X i--ICHO-+l ------------ - - - - - - -4~- ---- '=-t~~ - - - - - - -- DCHREQ ..... 'ocs 14- :",,""-ICPCYH----.j -\::E CARRY ....-ICPCYL --J - ~~ ~ " ~ ~IIHO_ " INTON MEMORY BUSY tiME Fig. 8 <» I4--ICPIOL ""'lit --+-I ~tCP10H-----" I Fetch Cycle ' " " r . - - - - - - - - - - - - - - - - - - R E A D CYCLE CLK OUT liS -----------------~.I ~ -+l ~ IMBSYL 1- ,. unh.h..1l..JL .j " " ~\\\\lil IMBw-+l 4-1 ... 51 '4--tCPSVH 1 ~I -I- 1-4= 1_ IMBHO' """" -f~lcPMH--+l ~ " f4--ICPML~ MO '.- -f- 00 _lcPOH_1 0, " / ......-......tCPAH~ i'io-15 b.4 BAF ADDRESS OUT - 4 - - tCPAL--... :i ~loHD_1 -+lIDS I-- J ~DATA~ -lIes JL DATA IN 1-. ® Co-3' MEMORY BUSY TIME RUN, DCH REO, INT REO, CARRY, INT ON unaffected durlnS! this cycle. Fig. 9 Read Cycle 4-06 - 9440 AC CHARACTERISTICS: TA = 0 to 75°C- Figures 12. 13. 14. 15 LlMITS-ns SYMBOL CHARACTERISTIC tCPSYL Propagation Delay, CLOCK to SYN going LOW 150 tCPSYH Propagation Delay, CLOCK to SYN going HIGH 160 tCPMH Propagation Delay. CLOCK to M2, M" Mo going HIGH 160 tCPML Propagation Delay, CLOCK to M2. M" Mo going LOW 170 tCPOH Propagation Delay, CLOCK to 0,,00 going HIGH ~O tCPOL Propagation Delay, CLOCK to 0,,00 going LOW 170 170 MIN TYP tCPOH Propagation Delay, CLOCK to DATA IBo-15 going HIGH tCPOL Propagation Delay, CLOCK to DATA IBo-15 going LOW 180 tCPOF Propagation Delay, CLOCK to DATA IBo-15 going 3-state 110 tos Set-up Time, DATA IBo-15 to CLOCK -110 tOHO Hold Time, DATA IBo-15 after CLOCK 130 tcs Set-up Time, C3, C2, C" Co to CLOCK -110 tCHO Hold Time, C3, C2, C" Co after CLOCK 130 MAX NOTE Fig. 12 Only Fig. 13 Only Fig. 14 Only NOTES: 6. DUring DCH, the 94~ IS not driving the M lines An external device can control the memory when a LOW IS applied to the appropriate Milne. 7. The 9440 floats the 180-15. The Information Bus is available to the I/O devices and the memory as needed. - - - - - - - - - - - - ItO IN ------------I.~I PLA CLKOUT SYN _ _ _ _ _ of M, ---------+------~ ij,-----+-----' MO _____+-___-' OO-----+___ --tc-P-ML-~-~---------------~-----O'-----+~--t-cP-M-H~~1 ~o,~-----------------------~~~~~ co") RUN _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ ."i5CHiiEci iNTiiEa CARRY _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ____ INTON _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ Fig. 13 1/0 In Cycle 4-09 9440 t-.-----------WAIT----------_ CLK OUT 8YN ---------of Ml __________+_-------'. M' _________+_------' ~---------+--------' Oo _________~------~ 0, _ _ _ _ _ _ _ _ _ _ _ _ _- ' RUN __________________________________________________________ CARRy _________________________________________________________ INTON ______________________________________________________ Flg.14 Walt Cycle I- ~-----------DCH----------~·~I PLA CLK OUT 8YN iiiii Ml (i) ii, ilo 00 o 01 __________ ~--------~---------------------------------------- iiio-15 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ~-3 _____________________________________________________________ RUN __________________________________________________________ CARRy _________________________________________________ INTON ______________________________________________________ Flg.15 Data Channel Request Cycle 4-010 Chapter 5 THE INTEL 8086 The 8086 is Intel's first 16-bit microprocessor. It is significantly more powerful than any prior microprocessor. The 8086 assembly language instruction set is upward compatible with 8080A - but at the source program level only. That is to say. every 8080A assembly language instruction can be converted into one or more 8086 assembly language instructions. There is no reason why anyone would try to convert 8086 assembly language instructions. one at a time. into one or more 808~A assembly language instructions. but if you did. you would soon become hopelessly tangled in conflicting memory allocations and special translation rules. That is why we say that the 8086 and 8080A assembly language instruction sets are "upward" compatible. The 8086 and 8080A assembly language instruction sets are not compatible at the object code level. which means that 8080A programs stored in read-only memory are useless in an 8086 system. The 8085 and 8080A assembly language instruction sets are identical. with the exception of the 8085 RIM and SIM instructions. The 8085 RIM and SIM instructions cannot be translated into 8086 instructions. This is because the RIM and SIM instructions use the serial 110 logic of the 8085. which has no 8086 counterpart. Without the RIM and SIM instructions. the 8085 and 8080A assembly language instruction sets are identical; therefore the 8086 assembly language instruction set must also be upward compatible with the 8086 assembly language instruction set - apart from the RIM and 81M Instructions. The 8085 and 8080A assembly language instruction sets are object code compatible - with the exception of the 8085 RIM and SIM instructions. That is to say. a program existing in read-only memory could be used with one microprocessor or the other. The 8080A assembly language instruction set is a subset of the l80 assembly language instruction set. That is to say. the l80 will execute an 8080A object program - but the reverse is not true. The 8080A cannot execute l80 programs when the full l80 instruction set is used. The 8086 assembly language instruction set is not upward compatible with the Z80 assembly language instruction set. As a historical note. it is worth mentioning that the 8008 microprocessor. which preceded the 8080A. was also compatible only at the source program level. That is to say. there is an 8080A assembly language instruction for every 8008 assembly language instruction. but the two microprocessor object code sets are not the same. The various instruction set compatibilities that we have described may be illustrated as follows: -.. (Excluding RIM and SIM instructions) 8086 • ~ 8085 + IL ______ ..JI _______ 8080A - - Source program of lower microprocessor can be assembled to generate upper microprocessor object program + - - - Lower microprocessor instruction set is a subset of upper microprocessor instruction set at the object program level 8008 5-1 ~ These are the most interesting innovations to be found in 8086 hardware design: 1) 8086 Central Processing Unit logic has been divided into an Execution Unit (EU) and a Bus Interface Unit (BIU). These two halves operate asynchronously. The Bus Interface Unit handles all interfaces with the external bus; it generates external memory and I/O addresses and has a 6-byte instruction object code queue. Whenever the EU needs to access memory or an I/O device, it makes a bus access request to the Bus Interface Unit. Providing the Bus Interface Unit is not currently busy, it acknowledges the bus access request from the EU. When the Bus Interface Unit has no active pending bus access requests from the EU, it performs instruction fetch machine cycles to fill the 6-byte instruction object code queue. The CPU takes its instruction object codes from the front of the queue. Thus instruction fetch time is largely eliminated. 2) The 8086 has been designed to work in a wide range of microcomputer system configurations, ranging from a simple one-CPU system to a multiple-CPU network. To support this wide flexibility, a number of 8086 pins output alternate Signals. This may be illustrated as follows: Maximum Configurations Minimum Configurations These signals do not change These Signals do not change +5 V 8086 8086 MN/MX Simple control output for use in one-CPU system MN/MX Complex control signals useful in multi-CPU networks The same pins output these two sets of signals, based on a level of MN/MX. This wholesale re-allocation of Signals is a highly imaginative and innovative first for the microprocessor industry. 3) The 8086 has built-in logic to handle bus access priorities in multi-CPU configurations. (This is not a new concept National Semiconductor's SCIMP has had it for years.) 4) In mUlti-CPU configurations, each 8086 CPU can have its own local memory, while simultaneously sharing common memory. The common memory may be shared by all CPUs, or by selected CPUs. 5) The 8086 has been designed to compete effectively in program intensive applications that have been the domain of the minicomputer. Up to a million bytes of external memory can be addressed directly. All memory addressing is base relative; this memory addressing technique naturally generates relocatable object programs. (Relocatable object programs can be moved from one memory address space to another and re-executed without modification.) Also, since the 8086 utilizes stack-relative addressing, re-entrant programs are easily written. (Re-entrant programs can be interrupted in mid-execution and re-executed. For example, a subroutine which calls itself is re-entrant a program which can be interrupted in mid-execution by an external interrupt, and then re-executed within the interrupt service routine, is also re-entrant. 6) The 8086 uses prefix instructions that modify the interpretation of the next instruction's object code. The 8086. like its predecessor. the 8080A. is really one component of a multiple-chip microprocessor configuration. In addition to the 8086 microprocessor itself. you must have an 8284 Clock Generator/Driver. Yau cau Id create the required clock Signal using alternative logic, but it would be neither practical nor economical to do so. The third device necessary in some 8086 microprocessor configurations is the 8288 Bus Controller. You will usually have an 8288 Bus Controller between an 8086 and its System Bus (or busses), just as you will usually have an 8288 System Bus controller between an 8080A and its System Bus. In the case of the 8086, however, you can dispense with the 8288 Bus Controller in Single-bus configurations - and pay no penalty for it. 5-2 The 8086 has a large family of support devices. In this chapter we describe the following support devices: • The • The • The • The 8284 Clock Generator/Driver 8288 Bus Controller 8282/8283 8-bit input/output latches 8286/8287 8-bit parallel bidirectional bus drivers The 8088. an 8-bit version of the 8086. is also described. The primary manufacturer of the 8086 is: INTEL CORPORATION 3065 Bowers Avenue Santa Clara. California 95051 Second sources are: MOSTEK CORPORATION 1215 West Crosby Road Carrollton. TX 75006 NEC MICROCOMPUTERS INC. Five Militia Drive Lexington. MA 02173 SIEMENS AG Components Group Balanstrasse 73. D8000 Munich-80. West Germany The 8086 is manufactured using N-channel depletion load. silicon gate technology. It is packaged in a 40-pin DIP. A single +5 V power supply is required. All signals. with the exception of the clock input. are TTL-level compatible. The clock input must be an MOS level signal: it is generated by the 8284 Clock Generator/Driver device. which is described later in this chapter. Instruction execution times will vary depending on how effectively instruction queuing is used. Typically. between 2 and 30 clock cycles are required to execute an instruction. Multiplication and division instructions require more execution time. Clock cycles may be as short as 125 nanoseconds. An 8 MHz version of the 8086 has been announced: it is identified as the 8086-2. The 4 MHz version is called the 8086-4. The standard 5 MHz 8086 is referred to without a suffix. There is no difference between the three versions other than maximum allowed clock speeds. 5-3 8086 8086-2 8086-4 THE 8086 CPU Functions implemented on the 8086 microprocessor chip are illustrated in Figure 5-1. Interrupt priority arbitration logic is shown as only half present external logic. such as an 8259A. must provide a device code identifying an interrupt. but all arbitration and vectoring logic is subsequently handled by logic within the CPU. It is worth noting that bus interface logic. which is shown as present in Figure 5-1. is much more extensive than other microprocessors provide. One could rightfully demand that bus interface logic therefore be shown as absent in equivalent figures for other microprocessors. Clock Logic Interface Logic Programmable Timers I/O Ports Figure 5-1. Logic of the Intel 8086 CPU 5-4 Memory 8086 PROGRAMMABLE REGISTERS AND ADDRESSING MODES We describe 8086 programmable registers in conjunction with 8086 addressing modes, since many 8086 programmable registers are there only to support memory addressing logic. 8086 programmable registers are illustrated in Figure 5-2. Shaded registers are 8086 equivalents for 8080A registers. 8080A register names are shown in the left margin. Let us first examine the general purpose registers, AX, BX, ex, and OX. These locations are treated as four 16-bit registers or eight 8-bit registers; they also reproduce the 8080A general purpose registers as follows: AH has no 8080A equivalent. Do not confuse it with the 8080A PSW. 8086 AND 8080A REGISTERS' COMPATIBILITY AL is equivalent to the 8080A A register. BH is equivalent to the 8080A H register. BL is equivalent to the 8080A L register. CH is equivalent to the 8080A B register. CL is equivalent to the 8080A C register. DH is equivalent to the 8080A D register. DL is equivalent to the 8080A E register. Consistent with 8080A register utilization. register AX serves as a primary Accumulator. Input and output instructions pass data through AX (or AU in preference to other general purpose registers; also. selected instruction access AX (or AU contents only. In addition to serving as a general purpose Accumulator, register BX can serve as a base register when computing data memory addresses. 8086 BX REGISTER Register ex serves as an Accumulator; it is also used as a counter by multi-iteration instructions; these instructions terminate execution when register CX contents increment or decrement to O. 8086 ex REGISTER Some 1/0 instructions move data between an identified 1/0 port and the memory location addressed by Register OX. Register DX may also serve as an Accumulator. When looking at general purpose registers AX. BX, Cx. and Ox. there is plenty of opportunity to be confused by terminology. Intel literature identifies the four 16-bit registers via the labels AX, BX, CX, and DX. Each of these 16-bit registers is subdivided by Intel literature into two 8-bit registers, as follows: o +- AX bit numbers o +- AH, AL bit numbers 15 7 07 AH I AL ~ AX 15 7 I I o +- BX bit numbers o +- BH, BL bit numbers 07 BH 1 B7 BX 15 7 I CL --.,CX 15 7 1 ox I o +- OX bit numbers o +- OH, OL bit numbers 07 OH I o +- CX bit numbers o +- CH, CL bit numbers 07 CH I OL I The 8080A Accumu lator must be reproduced by AL since selected 8080A and 8086 instructions access this register and none other. BH and BL must reproduce the 8080A Hand L registers, since only BX can contribute to an 8086 data memory address. On the surface this would appear to present a problem, since the 8080A has a limited number of instructions that use the BC and DE registers to provide 16-bit memory addresses. When 8080A source programs are reassembled to execute on an 8086 microprocessor, 8080A instructions that seek memory addresses out of the BC or OE registers become 8086 instructions that use Index registers. 5-5 15 7 A 07 .------ o o +- One 16-bit register +- Two 8-bit registers AX (= AH, AL) Primary Accumulator(s) H,L BX (= BH, BL) Accumulator(s). and Base register B,C CX (= CH, eL) Accumulator(s) and Counter register 0, F OX (= DH, DL) Accumulatorisl and I/O Data Counter ~ These names apply to 16-bit registers ' - - - - - - - 4 t - - - - - - - These names apply to 8-bit registers 15 Sf' o +- Bit number Stack Pointer (SP) Base Pointer (BP) } r-.::c._ _ _ _ _ _ _ _....,0 +- Bit number I ndex registers Source Index (Si) :=================:IDestination Index (01) r-:~~~~-""~~~"" +- Bit number PC '--'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-'-""""1 Program Counter (PC) 15 8 15 0 +- Bit n·umber Code Segment (CS) } Data Segment (OS) Stack Segment (SS) Segment registers Extra Segment (ES) 0 +- Bit number Ir ~------"'I Status Shaded registers are 8086 equivalents for 8080A registers. 8080A register names are shown in the left margin. Figure 5-2. 8086 Programmable Registers 5-6 All 8086 memory addresses are computed by summing the contents of a Segment register and an effective memory address. The effective memory address is computed via a variety of addressing modes, as it would be for any other microprocessor. The selected Segment register contents are left-shifted four bits, then added to the effective memory address to generate the actual address output as follows: Segment Register contents: Effective memory address: Actual address output: 8086 SEGMENT REGISTERS xxxxxxxxxxxxxxxxoooo + OOOOyyyyyyyyyyyyyyyy XXXZZZZZZZZZZZZZyyyy x, Y and Z represent any binary digits. Thus a 20-bit memory address is computed dressed directly. which allows 1.048.576 bytes of external memory to be ad- The Segment registers of the 8086 are unlike any other microprocessor registers described in this book. They act as base registers which can point to any memory location that lies on an address boundary that is an even multiple of 16 bytes. Using arbitrary memory addresses, this may be illustrated as follows: Memory Address 334DF16 CS Segment register - - - - . contains 234E'6 234E016 ES Segment register --+contains OA3216 OA320;6 OS Segment register - + ~:":"":":"":":""'""-:":""'""-'""-.0....1 021 FO 16 contains 021F'6 As illustrated above, each Segment register identifies the beginning of a 65,536-byte memory segment. Since the 8086 has four Segment registers, there will at any time be four selected 65,536-byte memory segments. The actual address output will always select a memory location within one of these four segments. For example, if an actual address output is the sum of the OS Segment register and an effective memory address, then the actual address output must select a memory location within the OS segment: that is to say, within the address range 021 F016 through 121 EF16 in the illustration above. Likewise, an actual address output. which is the sum of the CS Segment register and an effective memory address, must select a memory location within the CS segment. which in the illustration above will lie in the address range 234E016 through 3340F16. No restrictions are placed on the contents of Segment registers. Therefore, 8086 memory is not divided into 65,536byte pages, nor do the four Segment registers have to specify non-overlapping memory spaces. Each Segment register identifies the origin of a 65,536-byte memory segment that may lie anywhere within addressable memory and mayor may not overlap with one or more other segments. Even though Segment registers can create overlapping or non-overlapping segments, they do have dedicated addressing functions. That is to say, different types of memory accesses compute memory address within specific segments. 5-7 During an instruction fetch, the Program Counter contents are added to the Code Segment register (CS) contents in order to compute the memory address for the instruction to be fetched. This may be illustrated as follows: i5 7 o o 07 8086 CODe SEGMENT REGISTER AND PROGRAM COUNTER AX = AH+AL BX = BH+BL CX = CH+CL OX = DH+OL o 15 5P BP 51 01 M M M M PC o 15 C5 N N N N 05 -- 55 E5 M, N, and P represent any hexadecimal digits. 5-8 OMMMM NNNNO PPPPM Actual program memory address output. Any Stack instruction such as a Push. Pop. Call. or Return adds the Stack Pointer contents to the Stack Segment register (55) contents in order to compute the address of the Stack location to be accessed. This may be illustrated as follows: 15 7 AX 0 0 07 = AH+Al BX = BH+Bl CX = CH+Cl OX = OH+Ol 15 SP 0 M M M M N N N N BP 51 DI PC 15 CS OS S5 OMMMM E5 NNNNO PPPPM Once again. M. N. and P represent any hexadecimal digits. 5-9 Actual Stack operation address output. 8086 STACK SEGMENT AND STACK POINTER REGISTERS Instructions that process data strings use the SI and 01 Index registers. together with the Data Segment register (OS) and the Extra Segment register (ES), in order to identify string source and destination addresses. This may be illustrated as follows: 15 7 AX = AH+AL BX = BH+BL CX = CH+CL DX = DH+DL o o 07 8086 EXTRA SEGMENT. SOURCE INDEX AND DESTINATION INDEX REGISTERS o 15 SP BP SI J J J J DI K K K K ~ ..- PC Destination string address. OKKKK NNNNO RRRRK .......- - 15 0 CS DS j M M M M SS ~ ES \ N N N N l/ Actual data string address output. Source string address. - OJJJJ MMMMO SSSSJ .........- - Actual data string address output. J. K. M. R. and S all represent any hexadecimal digits. As the above illustration would imply. instructions that process strings require that the source and destination strings reside within a single 65.536-byte address range but not necessarily the same 65.536-byte range. 5-10 Instructions that access data memory add an effective memory address to the Data Segment register (OS) or the Stack Segment register (55). This may be illustrated as follows: Program Memory. as addressed by PC and CS 15 7 8086 DATA SEGMENT AND STACK SEGMENT REGISTERS o 07 o AX =AH+Al BX = BH+Bl ~ CX = CH+Cl OX = OH+Ol 15 0 SP i, - BP SI 01 PC OXXXX y y Y Y0 ZZZZ 15 .....- - - Effective address segment base. X" Actual data address output. o CS OS ~------------~ SS ES x, y, and Z represent any hexadecimal digits. When a data memory address is created, as illustrated above, the BX, BP, SI. and DI registers' contents, plus a displacement coming from the instruction object code, may contribute to the effective memory address. There are, however, very specific register and displacement combinations that can create an active memory address, as summarized in Table 5-1. Each case specifies either the DS or SS register as the default source for the segment base address. 5-11 Table 5-1. A Summary of Intel 8086 Memory Addressing Options Possible Displacements Memory Reference Segment Register Base Register Index Register 16-Bit Unsigned 8-Bit. High-Order Bit Extended None 51 X X X None OS (Alternate": CS, 55 or ES) BX Normal Data Memory Reference 01 X X X 51 X X X 01 X X X None X X X None X 51 X X X 01 X X X None X X OS None 55 (Alternate" : CS, OS, or ES) BP Stack 55 SP None String Data OS None 51 ES None 01 Instruction Fetch CS PC None Branch CS PC None I/O Data OS OX None X " The segment override allows OS or 55 to be replaced by one of the other segment registers X These are displacements that can be used to compute memory addresses. When creating any data memory address. you can add a prefix to an instruction to select a Segment register other than the default Segment register. You can only select a Segment register other than the default Segment register when addressing data memory. You must live with the default Segment register when creating program memory addresses. Stack addresses. or string instruction addresses. It is very important to note that the 8086 has a whole set of data memory addressing options aimed at accessing the Stack as though it were a data area. That is to say. in addition to the normal "Push" and "Pop" type Stack instructions. the 8086 allows normal data memory access instructions to address the Stack. Many assembly language programmers use the Stack to store addresses. and as a general depository for data that must be transmitted between program modules. Anyone favoring this assembly language programming philosophy will be delighted with 8086 data memory addressing options. 5-12 Let us now examine the various data memory addressing options in detail. Refer to Table 5-1. In the simplest case. we have straightforward direct memory addressing. A 16":bit displacement provided by two instruction object code bytes is added to the Data Segment register in order to create the actual memory address. This may be illustrated as follows: 15 7 AX = AH+AL r-----. ... 8086 DIRECT MEMORY ADDRESSING o o 07 1 - - - - - + - -........ BX = BH+BL CX = CH+CL OX = OH+OL o 15 5P BP 1----------1 51 ,0 M M M M 01 PC 1---------1 M M M ,NNNNO M PPPPM .\ 15 C5 N N N N OS R R R R 55 E5 o HHLL"'-{ RRRRO Actual data memory address output for direct memory addressing. - -...... ~.. 5 5 5 5 L Program Memory PPPPM L L PPPPM+1 H H PPPPM+2 H. L. M. N. P. R. and S all represent any hexadecimal digits. Note that a 16-bit address displacement. when stored in program memory. has the low-order byte preceding the highorder byte. This is consistent with the way the 8080A stores addresses in program memory. DS must provide the Segment base address when addressing data memory directly. as illustrated above. 5-13 Direct, indexed addressing is also provided. The SI or 01 register may be selected as the Index register. You have the option of adding a displacement to the contents of the selected Index register in order to generate the effective address. If you do not add a displacement. then you have, in effect, implied memory addressing via the SI or DI register. This may be illustrated as follows: o 15 7 8086 IMPLIED MEMORY ADDRESSING o 07 AX = AH+AL BX = BH+BL CX = CH+CL OX = OH+OL o 15 5P BP 51 01 PC 15 C5 05 R R R R 55 -- OXXXX RRRRO 5 S S 5 X 4 - - Actual data memory address output for implied memory addressing E5 (You may substitute CS, S5 or E5 for 05 by executing a 1-byte instruction prefix.) X, R. and S represent any hexad~cimal digits. If a displacement is added to the contents of the selected Index register, then you may 8086 DIRECT. specify an 8-bit displacement or a 16-bit displacement. A 16-bit displacement is stored in two INDEXED object code bytes; the low-order byte of the displacement precedes the high-order byte of the disADDRESSING placement as illustrated for direct memory addressing. Wan a-bit displacement is specified. then the high-order bit of the low-order byte is propagated into the high-order byte to create a 16-bit displacement. This may be illustrated as follows: Displacements: Sign extended: 5-14 We may now illustrate direct, indexed addressing as follows: o o 15 7 AX = AH+AL 07 t----+----t BX = BH+BL CX = CH+CL t----+---......... OX = OH+OL 15 0 SP BP SI 01 PC M M M M OMMMM NNNNO P P PPM 15 CS N N N N OS R R R R SS ES Program MemorY C Oyyyy_{ OXXXX PPPPM PPPPM+1 PPPPM+2 PPPPM+3 Actual data memory address output for - - - . . Z Z Z Z Z direct, indexed memory addressing. (You may substitute CS, SS or ES for OS by executing a 1-byte instruction prefix.) M. N, p, R, X, y, and Z all represent any hexadecimal digits. YYYY is the 16-bit or 8-bit displacement taken from program memory. XXXX is the index taken from either the 01 or the SI register. The effective memory address can be computed using base relative addressing. You have two sets of base relative addressing ~ptions: 1) Data memory base relative addressing, which is within the DS segment (data memory). 2) Stack base relative addressing, which is in the SS segment (Stack memory). 5-15 '8086 BASE RELATIVE, INDEXED ADDRESSING Data memory base relative addressing uses the BX register contents to provide the base for the effective address. All of the data memory addressing options thus far described are available with base relative data memory addressing. In effect, base relative data memory addressing merely adds the contents of the BX register to the effective memory address which could otherwise have been generated. Here. for example. is an illustration of base relative direct addressing: 8086 DATA MEMORY BASE RELATIVE ADDRESSING o 15 7 o 07 AX = AH+AL K BX = BH+BL K K K ~ CX = CH+CL OX = OH+OL 0 15 SP BP SI 01 PC M M M M -- OMMMM ~ PPPPM . ~ NNNNO 0 15 CS N N N N OS R R R R SS ES Program Memory ~I-------I ~OKKKK V ~---I OHHLL R R R R 0 . . . -{ PPPPM PPPPM+1 PPPPM+2 Actual data memory address output for base relative. direct. indexed memory - - . S S S S S addressing. (You may substitute CS. ES or SS for OS by executing a 1-byte instruction prefix.) Simple. direct addressing. which we described earlier. always generated a l6-bit displacement. Base relative. direct addressing allows the displacement. illustrated above as HHLL. to be a l6-bit displacement. an 8-bit displacement with sign extended. or no displacement at all. 5-16 Base relative implied data memory addressing simply adds the contents of the BX register to the selected Index register in order to compute the effective memory address. This may be illustrated as follows: 15 7 AX = AH+AL = BH+BL CX = CH+CL BX OX 0 0 07 K K K K = OH+OL 15 SP BP SI 01 PC 15 OKKKK CS OS SS R R R R .. OXXXX RRRRO SSSSS ..... __- - Actual data memory address output for base relative, implied memory addre'ssing. ES (You may substitute CS, SS or ES for OS by executing a 1-byte instruction prefix.) 5-17 Base relative. direct. indexed data memory addressing may appear to be complicated. but in fact it is not. We simply add the contents of the BX register to the effective memory address. as computed for normal direct. indexed addressing. Thus. base relative. direct. indexed data memory addressing may be illustrated as follows: 15 7 BX = BH+BL CX = CH+CL OX = OH+OL 0 0 07 K K K K 15 SP BP SI 01 PC M M M M OMMMM NNNNO PPPPM 15 CS N N N N OS R R R R SS ES OKKKK \ Program Memory { PPPPM PPPPM+1 OYYYY~ OXXXX Actual data memory address output for base relative. direct. indexed memory ~ Z Z ZZ Z addressing. (You may substitute CS. S5 or ES for OS by executing a 1-byte instruction prefix.) 5-18 PPPPM+2 PPPPM+3 The 8086 also has Stack memory addressing variations of the base relative, data memory addressing options just described. Here, for example, is base relative, direct Stack memory addressing: 15 7 AX = AH+AL BX = BH+BL CX = CH+CL OX = OH+OL 0 0 07 15 0 SP BP K K K K M M M M SI 01 PC I---+-~ 0 MM MM NNNNO P P PPM ~ 15 CS N N N N OS SS R R R R Program Memory 1-------1 PPPPM OKKKK { PPPPM+1 o H H L L . - - 1-----1 R R R R0 PPPPM+2 ES Actual Stack memory address output for ~~SSSSS base relative, direct memory addressing. - -.. (You may substitute CS, ES or SS for OS by executing a 1-byte instruction prefix.! In the illustration above, the displacement HHLL must be present either as a 16-bit displacement or as an 8-bit displacement with sign extended. Remember, base relative, direct data memory addressing also allows no displacement. However, base relative, direct Stack memory addressing requires a displacement. These options are summarized in Table 5-1. 5-19 Here is an illustration of base relative, implied Stack memory addressing: 0 0 15 07 7 AX = AH+AL BX = BH+BL ex = OX CH+CL = OH+OL 0 15 SP BP K K K K R R R R SI 01 PC 15 CS OS SS RRRRO SSSSS ES '4 Actual Stack memory address output for base relative, implied memory addressing. (You may substitute CS, OS or ES for SS by executing a 1-byte instruction prefix.) X, R, and S represent any hexadecimal digits. 5-20 Here is an illustration of base relative. direct. indexed Stack memory addressing: 15 7 AX = AH+AL BX = BH+BL CX = CH+CL OX = OH+OL 0 0 07 15 0 SP BP K K K K 51 01 PC M M M M 1---+---+-11" -------~ NNNN0 PPPPM 15 CS 0 MMMM N N N N Program Memory t-------t OS 55 A A A \ A PPPPM t----tPPPPM + 1 ES ~ { PPPPM + 2 1------41 Actual Stack memory address output for base relative, direct, indexed memory addressing. PPPPM + 3 (You may substitute CS, OS or ES for 55 by executing a 1-byte instruction prefix.! There is one anomolous 8086 addressing mode that can cause confusion. One variation of I/O in8086 1/0 structions addresses an 1/0 port via the OX register. The OX register contents are output on PORT the Address Bus, to be interpreted as an liD port address. This means you can have up to 65.536 ADDRESSING I/O port addresses. Since the DX register contents are being output as an I/O port address. it is not added to any Segment register contents. Thus. the DX register outputs an address in the range 000016 through FFFF16. This is the only case in which a register's contents are output directly as an address on the Address Bus. without first passing through segmentation logic. All 8086 Branch-on-Condition instructions use program relative addressing. This feature allows dynamically relocatable code. The Branch-on-Condition instruction provides an 8-bit. signed binary displacement that is added to the contents of the Program Counter. Thus. Branchon-Condition instructions have an addressing range of -128 through + 127 bytes from the location of the Branch-on-Condition. The queuing of instruction object codes has no impact on Branch-an-Condition logic, or the branch addressing range. 5-21 8086 PROGRAM RELATIVE ADDRESSING 8086 Jump and Subroutine Call instructions offer these addressing options: 1) Program relative addressing. An 8-bit or 16-bit displacement is added to the contents of the Program Counter. 2) Direct addressing. New 16-bit addresses provided by the instruction are loaded into the Program Counter and the CS Segment register. 3) Indirect addressing. Any of the data memory addressing options may be used to read data 8086 from data memory. However. the data input is interpreted as a memory address. You have two INDIRECT indirect addressing options. A single 16-bit data word may be read. in which case it is loaded ADDRESSING into the Program Counter and the Jump or Call references a memory location within the current CS segment. You can also read two 16-bit data words; the first is loaded into the Program Counter and the second is loaded into the CS Segment register. Thus you can Jump or Call indirectly any addressable memory location. 8086 STATUS The 8086 has a 16-bit Stack register with the following satus bit assignments: 15141312 11 10 9 1-1-1-1-1 I I I I 8 7 0 I D II I Tis I 6 5 4 3 2 1 0 +- Bit No. z I-I A I-I pi-I C I I I I t L Status register Reserved bits. normally 0 Carry Parity Auxiliary Carry Zero Sign Trap Interrupt enable/disable Direction Overflow The Carry, Auxiliary Carry, Overflow, and Sign statuses are quite standard; see Volume 1 for a description of these statuses. The Auxiliary Carry status is identical to the 8080A status with the same name. It represents carries out of bit 3 in an 8-bit data unit as described in Volume 1. Chapter 2. Subtract instructions use twos complement arithmetic in order to subtract the minuend from the subtrahend. However, the Carry status is inverted. That is to say, following a subtract operation, the Carry status is set to 1 if there was no carry out of the high-order bit, and the Carry status is reset to 0 if there was a carry out of the high-order bit. The Carry Status therefore indicates a borrow. The Parity status is set to 1 when there is an even number of 1 bits in the result of a data operation; an odd number of 1 bits causes the Parity status to be reset to O. The Zero status is completely standard. It is set to 1 when the resu It of a data operation is zero; it is set to 0 when the result of a data operation is not zero. The Direction status determines whether string operations will auto-increment or auto-decrement the contents of I ndex registers. If the Direction status is 1. then the SI and Dllndex registers' contents will be decremented; that is to say. strings will be accessed from the highest memory address down to the lowest memory address. If the Direction status is O. th.en the SI and Dllndex register contents will be incremented; that is to say. strings will be accessed beginning with the lowest memory address. The Interrupt status is a master interrupt enable/disable. This status must be 1 in order to enable interrupts within the 8086. If this status is O. then all interrupts except the NMI (Non-Maskable Interrupt) will be disabled. The Trap status is a special debugging aid that puts the 8086 into a "single step" mode. The single step mode is described in detail together with 8086 interrupt logic. since it depends on this interrupt logic for its existence. The Carry, Auxiliary Carry, Parity, Sign, and Zero statuses are also found in the 8080A. The Overflow, Direction, Interrupt, and Trap statuses are new in the 8086. 5-22 8086 CPU PINS AND SIGNALS 8086 CPU pins and signals are illustrated in Figure 5-3. GND AD14 AD13 AD12 AD11 AD10 AD9 AD8 AD7 AD6 AD5 AD4 AD3 AD2 AD1 ADO NMI INTR ClK GND ·.. - - -- ... --- ·.. --... ..· -- ·.. - .-.. 8086 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 .. ----. · - --- VCC AD15 A16/S3 A17/S4 A18/S5 A19/S6 B'FfE"/S7 MN!MX RD RO/GTO, HOLD 'FfCi/GTf, HLDA LOCK, WR 52, M/iO ---- ---.. .. · --·.. Sf, DT/R' --· - ---- SO, DEN OSO, ALE OS1,INTA TEST READY RESET Pin Name Description Type Data/Address Bus Address/Segment Identifier Address/Interrupt Enable Status Address/Status High-order Byte/Status Read Control Wait State Request Wait for Test Control Interrupt Request Non-maskable Interrupt Request System Reset System Clock = GND for a Maximum System Machine Cycle Status Local Bus Priority Control Instruction Oueue Status Bus Hold Control = VCC for a Minimum System Memory or I/O Access Write Control Address latch Enable Data Transmit/Receive Data Enable Interrupt Acknowledge Hold Request Holr;! Acknowledge Power, Ground Bidirectional, Tristate Output, Tristate Output, Tristate Output, Tristate Output. Tristate Output, Tristate Input Input Input Input Input Input READY TEST INTR NMI RESET ClK MN/MX SO, 5152 Jm/G'rn, m/GTi OSO, aS1 IOCK Minimum System Signals - - 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ADO-AD15 A 16/S3, A17/S4 A18/S5 A19/S6 BHE/S7 Ri5 Maximum { System Signals -- -.. -- ·....... MN/MX M/IO WR ALE DTiR om INTA HOLD HlDA VCC,GND Output. Tristate Bidirectional Output, Tristate Output, Tristate Output, .Output, Output. Output, Output, Output Input Output Tristate Tristate Tristate Tristate Tristate Figure 5-3. 8086 Pins and Signal Assignments 5-23 The 8086 outputs a 20-bit memory address. Data is accessed as 16-bit words. subdivided into a low-order byte and a high-order byte. Therefore the 8086 needs a 20-line Address Bus and a 16-line Data Bus. In order to have a 40-pin package. the low-order 16 Address Bus lines are multiplexed with the Data Bus. i'H'E may be looked upon as an additional Address Bus line, since it is used to identify the high-order byte of a memory word. while ADO identifies the low-order byte of the memory word. The four high-order Address Bus lines. together with 8HE. are multiplexed with five status I.ines. thus. we can illustrate Address Bus line multiplexing as follows: Data/Status Address Status 16-bit data word S7 BRt High-order byte of selected word DO AO Low-order byte of selected word { D1 .... 015 Status S3 - S6 A1 - A15 } A16 - A19 Address of a 16-bit word 8086 EXTERNAL MEMORY ADDRESSING It is easy to become confused when looking at how the Address Bus, together with BHE, is used to access memory. As seen by external memory. Address Bus lines are interpreted as follows: Select Memory select logic .... AO ADO AD1 AD7 AD8 j~ • 07 ... , .=. -. _. ::: · -. _.· .. :. ADO AD1 ··-. .. ~ -._.· SHE - AD15 DO A18 ... • Low-order byte memory bank ~ j j A19 ~ AO Select ..- ... ... ~ ~ DO A18 Memory select logic .. - 5-24 ·.-. ··: ~ ~~ 07 High-order byte memory bank AD7 AD8 AD15 A19 '8HE In the previous illustration you will see that memory is indeed organized as bytes. The data pins of the low-order byte memory bank connect to ADO-AD7. The high-order byte memory bank data pins connect to AD8-AD15. The low-order and high-order byte memory banks each have memory select logic that decodes AD1-A 19. These 19 address lines become inputs AO-A 18 at the illustrated memory select logic. Since each memory bank receives 19 address lines. select logic can address up to 524.288 (512K) bytes of memory. These two memory banks. taken together. constitute the advertised one million bytes of directly add ressable memory. Now. you may well ask why one should bother dividing memory into separate low-order and high-order byte banks. If a sixteen-bit word lies on an even-byte address boundary. then we could ignore the memory select logic connections to ADO and BHE. The address on AD 1-A 19 becomes an address identifying a 16-bit word. which just happens to be implemented as two separate 8-bit memory banks. If an 8086 16-bit memory word does lie on an even-byte address boundary. then the low-order byte address is. in fact. the only address output. BHE is pulsed low while the low-order byte address is being output. and both memory banks consider themselves selected even though (in theory) the high-order memory bank's address has not been output. To illustrate what happens. consider the memory addresses 02A4016 and 02A4116. One would normally expect the two addresses to be output sequentially in order to access the low-order byte and then the high-order byte of the 16-bit word. This may be illustrated as follows: ADO-AD7 AD8-AD15 AD16-AD19 Input data from byte Output address 02A40 16 02A4016 Output address 02A41 16 Input data from byte 02A41 16 But we could just as easily output the low-order byte address only. using BHE as an extra address line to substitute for the odd-byte address - which is never output. This may be illustrated as follows: ADO-AD7 AD8-AD15 AD16-AD19 Output address 02A4016 Assume address 02A4116 has been output 5-25 If a word lies on an odd-byte address boundary, then two byte addresses must be output to access the two halves of the 16-bit word. This may be illustrated as follows: First memory access is to a byte in the highorder byte memory bank. i.e. an odd byte address. with ADO high Return lowcrder byte of 16-bit word via AD8-AD15 Second memory access is to a byte in the low-order byte memory bank. i.e. an even byte address. with ADO low Return highorder byte of 16-bit word via ADO-AD7 When a 16-bit word lies on an odd-byte address boundary. as illustrated above. the low-order byte is input first via AD8-AD15. then the high-order byte is input via ADO-AD7. Logic internal to the 8086 switches the data bytes into their correction locations. Intel could have elected to implement external memory as 16-bit words, which would eliminate BHE along with the Address Bus complexities we have just described. But this would have forced all instruction object codes, and data, to be accessed as 16-bit units. Why not do it? One of the most interesting hindsight discoveries that 8080A users have made is the fact that the 8080A is extremely efficient in its use of memory. By having a large number of 8-bit object codes. the 8080A generates object programs as compact as the most powerful minicomputers on the market. But if the 8086 is to keep 8-bit object codes. and therefore the efficient memory utilization of the 8080A. then it can no longer guarantee that data will lie on even-byte address boundaries. The first 8-bit object code will force the next instruction or data entity to begin on an odd-byte boundary. By including BHE and the extra logic needed to access 16-bit data units origined at odd-byte boundaries. the 8086 has allowed instructions to generate 1-byte. 3-byte or other odd-byte object codes. rather than 2-byte. 4-byte. and evenbyte object codes only. Simply stated, this is the trade-off: simplify memory addressing so that external memory is accessed only as 16-bit data units and you will use memory less efficiently. Intel elected to make memory addressing logic more complex and memory utilization more efficient. Moving on from the Data/Address Bus, 8086 signals may be grouped into those that do not change with system complexity, and those that do. let us first look at the unchanging signals. elK is the single clock signal output by the 8284 clock generator to synchronize all 8086 logic. READY is the Wait state request which slow external logic inputs if it requires more time to respond to an access. A high READY input occurring at the proper time early in a machine cycle causes the 8086 to extend the machine cycle by inserting Wait state clock periods. 5-26 RD is a single bus control signal that does not change with system configuration. This signal is output low when the CPU is inputting data from any external source. Even though RD is output by the same physical pin under all circumstances. this signal is functionally part of the group that changes its nature depending on signal complexity. We will therefore refer again to RD when describing the signals that are a function of system complexity. There are four interrupt and interrupt-related signals. INTR is a normal interrupt request input. NMI is a non-maskable interrupt request input. RESET is a system reset signal; it must be input high to the 8284 clock generator for at least four ClK clock periods. The 8284 transmits a synchronized RESET signal to the CPU. When the 8086 is reset, the following events occur: 1) The Status register is cleared. This disables external interrupts. 2) The Program Counter and the three Segment registers. DS. SS. and ES. are cleared. 3) The CS Segment register is set to FFFF16. Following a Reset. program execution therefore restarts with the instruction located at memory byte FFFF016· These reset operations take approximately 10 clock periods to occur should occur. during which time no other operations Following power-up. at least 60 microseconds shou Id elapse before the 8086 is reset. An interrupt request via INTR should not occur sooner than 9 clock periods after the end of the 8086 device reset. An earlier interrupt request will cause one entire instruction to be executed before the interrupt request is recognized or acknowledged. A nonmaskable interrupt request should not be made during the first clock period following the end of a reset. TEST is not really an interrupt input. but it is used by program logic that otherwise would rely upon an interrupt. The 8086 has a special "Wait-for-Test" instruction that puts the CPU into an Idle state; this Idle state ends when the TEST input goes low. An 8080A (and other microprocessors) will duplicate the logic of the 8086 "Wait-for-Test" instruction by executing a "no operation" loop. which is terminated by an interrupt request: SELF ENI Enable interrupts JMP SELF Only an interrupt will terminate loop execution 5-27 There are eight pins that can output one of two signals. depending on whether MN/Mx is tied to power or ground. By having two sets of signals. the 8086 can be used in simple configurations. best served by elementary control signals. or in complex configurations. where control signals must provide sufficient information to resolve the contentions and access conflicts that complex microcomputer systems may encounter. 8086 DUAL BUS COMPLEXITY The two sets of signals may be illustrated as follows: Minimum Maximum Systems Systems MN/MX = Vee MN/MX = GND M/TIS DT/R - - - DEN S2 51 SO H· 0 [.·.;.g.·.P . . . . . .•. .•. :. . 0.·. •. . ;.:.:.·:•·. .• .1 O ' :0;:;::":)::1'::: 1.. :il:> 0 1 I I I N 0 0 T R IN A INTA OS1 0 ALE OSO 0 0 1 0 1 N a Q Q 0 0 P 8 E B WR HOLD HLDA 1 S LOCK RO/GTO RO/GTl Let us first look at the simple set of control signals that are output when MN/MX is connected to +6 V. These are completely standard microprocessor control signals. 8086 SIMPLE CONTROL Since data and addresses are multiplexed on a single bus. ALE is output high to identify a valid memory address. SIGNALS When data are being transmitted or received via the Data/Address Bus. WR is pulsed low to identify data output. while RD is pulsed low as a request for external logic to place data on the Data/Address Bus. We have already described RD. It is not one of the changing signals: nevertheless. it is used by both simple and complex system busses. For a read or write operation. M/IO indicates whether memory (M/IO high) or an I/O port (M/IO low) is being accessed. DTIR and DEN are two new control Signals not found in earlier Intel microprocessors. These two control signals have been designed specifically to control 8286/8287-type bidirectional transceivers. DTIff identifies the data direction. while DEN is the output enable. The 8286 and 8287 transceivers are described later in this chapter. HOLD and HLDA are standard hold request!8cknowledge signals. When external logic inputs HOLD high. the 8086 CPU enters a Hold state upon completing the current instruction's execution: the 8086 acknowledges the Hold State by outputting HLDA high. We will describe the Hold state in more detail later in the chapter. Let us now look at the complex System Bus that is generated when MN/MX is tied to ground. Control signals are output as a three-signal combination. decoded by a 3-to-8 decoder. and a two-signal combination. decoded by a 2-to-4 decoder. Complex System Bus signals have been designed to act as inputs to an 8288 Bus Controller. 8086 COMPLEX CONTROL SIGNALS S2. ST. and SO are decoded to provide eight separate control signals. However. the simple system signals M/IO. DT/R and DEN represent a subset of the eight S2. ST. and SO combinations. In our earlier illustration. we identify this simple system subset by shading the applicable complex system S2. ST. and SO levels. 5-28 The eight combinations of 52. 51. and SO generate the following control signals: S2 51 so 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 INTA lOR lOW HALT IFETCH MEMR MEMW NONE Interrupt acknowledge I/O device read I/O device write CPU has executed a HALT instruction and is in the Halt state The CPU is fetching an instruction object code byte Memory read Memory write The System Bus is inactive The control signal descriptions above use the words "read" and "write" as seen by the CPU. That is to say, a .. read" operation moves data from a memory device or 1/0 port to the CPU, while a "write" operation moves data from the CPU to a memory location or I/O port. 050 and 051 combine to identify conditions within the 8086 instruction object code queue soon. The QSO and QS1 combinations are interpreted as follows: QSO 051 o o o 1 1 1 o 1 NOOP OB1 OE OBS which we will describe No operation. This is the default case The first instruction object code in the queue is being executed The queue is empty An instruction object code other than the first one in the queue is being executed Observe that the simple bus signals INTA and ALE do not correspond to any combination of OSO and 051. This is in contrast to MilO, DT IR and DEN, which constitute a subset of 52, ST, and SO. LOCK, RO/GTO, and RO/GT1 are not related to their simple system equivalent signals: WR. HOLD, and HLDA. LOCK. iiO/GTO. and RQ/GT1 provide the 8086 with its System Bus priority and control logic in complex configurations. LOCK is output high to prevent the 8086 from losing bus control while executing a sequence of machine cycles that must not be interrupted. Typically these will be a memory access combination of read-modify-write machine cycles. where an error could result if the CPU lost bus control after the read and before the write. RO/GW and RQ/GT1 are two-bus priority, bidirectional type signals. They are used to determine which CPU in a multiCPU configuration will at any time have control of a shared bus. We will discuss these signals in more detail later in the chapter when looking at the capabilities of the 8086 in mUlti-CPU shared bus configurations. 5-29 8086 TIMING AND INSTRUCTION EXECUTION The most important concept to understand when looking at 8086 instruction execution tim8086 ing is the fact the 8086 bus control logic has been separated from the 8086 instruction exEXECUTION ecution logic. That is to say, the 8086 has an Execution Unit (EU), and a Bus Interface Unit UNIT (EU) (BIU). - - - - -.. The Execution Unit (EU) contains Data and Address registers, the Arithmetic and Logic Unit, plus the Control Unit. The Bus Interface Unit (BIU) contains bus interface logic, Segment registers, memory addressing logic, and a six-byte instruction object code queue. This may be illustrated as follows: 8086 BUS INTERFACE UNIT (BIU) ---, I AH AL I BH BL CS 0000 CH CL I I OS 0000 OH OL I 55 0000 I I I I I ES 0000 SP BP 51 01 ~ n I :1 I I Arithmetic and Logic Unit (ALU) --=> I I Control Unit (CU) I I Status -- I Instruction Reg. ~ ~ I I I L __________ --L 1 PC I I 1 I I .oj I I , 18086 ). .oj Bus Control Logic I Bus ~ II' I 1 2 3 4 5 6 Instruction object code queue I I I I I I I 1 __ ....JI The Execution Unit (EU) and the Bus Interface Unit (BIU) operate asynchronously. Whenever 8086 the Execution Unit is ready to execute a new instruction. it fetches the instruction object code INSTRUCTION from the front of the Bus Interface Unit instruction queue. then it executes the instruction in some QUEUE number of clock periods that have nothing to do with machine cycles. If the instruction object code queue is empty. then the Bus Interface Unit (BIU) executes an instruction fetch machine cycle - and the CPU waits for the instruction object code to be fetched. But the queue will rarely be empty. for reasons that will soon become apparent; therefore. the EU will usually not have to wait while an instruction fetch is executed. 5-30 If memory or an I/O device must be accessed in the course of executing an instruction, then the EU informs the BIU of its needs. The BIU executes an appropriate external access machine cycle in response to the EU demand . _-... ..--_....... The Bus Interface Unit (BIU). for its part. is independent of the Execution Unit (EU). and attempts to 8086 keep the six-byte queue filled with instruction object codes. If two or more of these six bytes are INSTRUCTION empty, then the Bus Interface Unit (BIU) executes instruction fetch machine cycles - providing QUEUE the EU does not have an active request for bus access pending. If the EU issues a request for bus - - - - - -..... access while the BIU is in the middle of an instruction fetch machine cycle, then the BIU will complete the instruction fetch machine cycle before honoring the EU bus access request. 8086 BUS CYCLES If we look at the way clock logic is used by the 8086, the term "machine cycle" no longer applies. The EU does not use machine cycles; it executes instructions in some number of clock periods that are not subject to any type of machine cycle grouping. The only time clock periods are grouped is when the bus control logic wishes to access memory or I/O devices. Each access requires four clock periods. This is the minimum amount of time required to handle the normal bus protocol that accompanies any transfer of information between a microprocessor and logic beyond the microprocessor. Since this is the only time the 8086 groups clock periods, it is more accurate to talk about 8086 bus cycles, rather than machine cycles. Figure 5-4 illustrates two 8086 bus cycles executed back-to-back. In common with machine cycles, 8086 bus cycles, as illustrated in Figure 5-4 assign individual clock periods to time specific events. Memory and I/O device addresses are output on the Data/Address Bus during T1. Data is transferred between the 8086 and memory or I/O devices during T3 and T4. If these two clock periods provide external logic with insufficient time to respond to an access, then Wait state clock periods (TW) may be inserted between T3 and T 4· T2 is a buffer clock period during which the Data/Address Bus stops outputting an address and starts outputting or inputting data. During T4 the CPU identifies the status of the next bus cycle or clock period. In simple configurations when MN/MX is tied to +5 V, DT /A is the only external signal that changes state during T4. When MN/MX is tied to ground, SO, S 1, and S2 change state during T4. Thus, by examining these three status outputs, external logic knows whether to expect another bus cycle. and, if so, what type of bus cycle. Now if you look at Figure 5-4, there is very little about it that differentiates an 8086 bus cycle from any other microprocessor's machine cycle. The characteristic of the bus cycle that differentiates it from standard machine cycles is the fact that bus cycles occur only on demand. :,... ... . . - - - - - BUS CYCLE : T1 T2 ---------i~ ....: .. 4 J - - - - - - - BUS CYCLE ------I~ . .,: T3 V//////A V///////1 ~ ~ T4 i T1 T2 T3 T4 i r//////A r///////1 ~ VlllmllllllJ/j ~ t'lll/7lllllJll V/I/I/III//IIII VI//I/I///////A Output address duringT1 Turn Bus around duringT2 Perform memory accesses during T3 +L----------------~' W a i t state clock •..__-----periods In complex systems, status output in T4 identifies subsequent operations. Figure 5-4. Two 8086 Bus Cycles 5-31 8086 INSTRUCTION QUEUE Consider what happens when an instruction is executed. Beginning with the simplest case, the instruction object code queue within the Bus Interface Unit will be empty. When the EU requests an object code byte there is none, so the BIU executes a bus cycle that fetches the first byte of the instruction object code: Tl CLK I I I I ~ Bus cycle fetches first object code byte Let us assume that this particular instruction requires two bytes of object code: keeping things simple. we will illustrate another instruction cycle executed immediately to fetch the next instruction byte: i T3 IT4 Tl CLK Tl : T2 : T3 : T4 I I I I I I I I ~~ Bus cycle fetches first object code byte Bus cycle fetches second object code byte Let us suppose that this instruction reads a word of data from memory. then performs an arithmetic operation using this data. The instruction is going to require some number of clock periods to compute the effective address for the data memory location to be accessed (we will assume seven clock periods are needed). Some additional number of clock periods will also be needed to perform the arithmetic operation (we will assume nine clock periods). In a normal microprocessor. this instruction might be executed as the following sequence of machine cycles: Machine Cycle 1 Tl : T2 I i T3 : T4 I I Machine Cycle 2 Tl I T2 I T3 I T4 I I Machine Cycle 3 Tl I T2 I 1 T3 : T4 Machine Cycle 4 Tl: T2 : T3 : T4 I: I Machine Cycle 5 Tl: T2 I T3 : T4 I 1 CLK Fetch first object code byte Machine Cycle 6 Tl : T2 I : T4 1 I Fetch second object code byte Compute data memory address Long Machine Cycle 7 Tl Compute data memory address Machine Cycle 8 i T3 i T41 T5 1 I Tl 1 ClK Execute arithmetic operation in a standard machine cycle and a long machine cycle Start executing next instruction by fetching object code byte I 5-32 I Fetch data from memory But the 8086. having asynchronous CPU and Bus Control Unit logic. will use clock periods to execute the instruction illustrated above as follows: Bus Cycle 1 Tl I T2 : T3 I Bus Cycle 2 Bus Cycle 3 Tl I T2 I T3 I T4 I I i Tl I T2 I T3 I T4 I : Bus Cycle 4 Tl : T2 : T3 : T4 I I Bus Cycle 4 T1 I ClK EU EU asks for an object code byte. There is none. so the BIU fetches one. The EU needs a second object code byte. The EU computes a data memory address in 7 clock periods. At the end of the 7th clock period the CPU requests bus access. The EU waits for the requested data to be fetched by the BIU BIU BIU fetches a byte of object code in one bus cycle. BIU fetches a second byte of object code in one bus cycle. Since the EU is not demanding bus access. the BIU fetches the next two object code bytes and stores them in the queue. At the end of bus cycle 4 the EU is requesting bus access. so the BIU services the EU. BIU fetches data from memory location addressed by the CPU. Bus Cycle 5 Tl Bus Cycle 6 Tl I T2 i T3 Bus Cycle 7 : T4 Tl: T2 I I I T3 : T4 I ClK I Ti EU Ti Ti Ti Ti Ti : Ti , I etc. Ti: Ti The EU uses nine clock periods to execute : The EU takes the etc. I next object code the required arithmetic operation. , byte from the BI U queue and , starts executing the ! next instruction. I BIU The BIU continues executing bus cycles to etc. I fill the instruction object code queue. 5-33 Now. the illustration above is not accurate because. you will recall. the 8086 fetches data in 16-bit increments. provided the data address lies on an even-byte boundary. Also. the BIU fetches instruction bytes and loads them into the queue only when there are at least two free bytes in the queue. Let us assume that all data does lie on even-byte boundaries. This is how our timing will now look: Bus Cycle 1 Tl Bus Cycle 2 Tl : T2 : T3 : T4 I I I Bus Cycle 3 I T4 Bus Cycle 4 Tl : T2 : T3 : T4 Tl: T2 I I I : T4 I Bus Cycle 4 T1: T2 : T3 I i T4 Ti Ti Ti I ClK EU BIU EU asks for an object code byte. There are none. so the BI U executes a bus cycle. The EU computes a data memory address in 7 clock periods. At the end of the 7th clock period the EU requests bus access. BI U fetches two bytes of object code in one bus cycle. The CPU takes both of them. so the queue is immediately emptied. Ti Ti I I Ti The EU waits for the requested data to be fetched by the BI U. BI U fetches four bytes of object code in two bus cycles and stores them in the queue. which has two empty bytes left. I BI U fetches data from memory location addressed by the EU. I The EU uses 9 clock periods to execute the arithmetic operation. The BIU fetches two more bytes of object code and stores them in the queue which is now full. I The BIU is idle. Ti I ClK etc. I I EU BI U Ti t The EU ends instruction execution and fetches one byte of object code from queue to execute next instruction. The BI U remains idle since only one byte of queue is empty. There are some important points to note regarding 8086 bus cycle timing. Bus cycles are a Bus Interface Unit (BIU) phenomenon. So far as the EU logic is concerned. bus cycles do not exist. The EU experiences periods of activity while executing instructions. and periods of inactivity while waiting for instruction object codes or data that the BIU must process via bus cycles. Periods of EU activity are timed by a sequence of clock periods. The EU makes no attempt to group clock periods into machine cycles. nor do EU clock periods have to occur in any special numeric combinations. The EU asks for memory operands before it needs them. so unless the BIU cannot get immediate bus access the maximum EU wait time is one clock cycle for bus access. So far as the BIU is concerned. clock periods are grouped into bus cycles only when data must be transferred to or from the 8086. First priority is given to a bus access request coming from the EU. If the EU is not requesting bus access. then the BIU executes instruction fetch bus cycles until the queue is full. These are the prerequisites for the BIU to execute an instruction fetch bus cycle: 1) The clock period that initiates the bus cycle would otherwise be an idle clock period. 2) The EU does not have an active bus access request pending. 3) There are at least two bytes empty in the queue. If the queue is full. then the BIU ceases to execute bus cycles; as illustrated above. a sequence of idle clock periods occurs. 5-34 Note that the CPU may have to wait for bus access. In the illustrations above, the EU requires seven clock periods in order to compute a data memory address. At the end of the seventh clock period, the EU issues a bus access request to the BIU. But at this time the BIU is part way through executing an instruction fetch bus cycle. The BIU completes the instruction fetch bus cycle, then honors the EU bus access request. In the final illustration above, no bus cycle accompanies the beginning of a new instruction's execution. We are assuming that the next instruction executed has one byte of object code. This object code byte is fetched from the front of the queue - which then has just one empty byte. No bus cycle is executed to fetch the instruction object code, since it is taken out of the queue. Subsequently, the BIU does not execute an instruction fetch bus cycle since there is only one empty byte; there must be at least two empty bytes in the queue before the BIU will execute an instruction fetch bus cycle. Based on the foregoing discussion of 8086 instruction fetch queuing, we can see that the 8086 has essentially eliminated instruction fetch time. The only time the EU will have to wait while the BIU fetches instruction object codes is when a Branch-on-Condition instruction causes execution to branch out of the queue sequence, or when (for any reason) the memory accesses accompanying an instruction's execution are so dense that the BIU has insufficient idle clock periods within which to insert instruction fetch bus cycles. 8086 MEMORY AND 1/0 DEVICE READ BUS CYCLE FOR MINIMUM MODE Figure 5-5 shows timing for an 8086 memory read bus cycle when MNiMX equals +5 V; that is to say, for the minimum mode bus configuration. I~ One Bus Cycle T1 T2 I T3 T4 ClK ADO-AD15 A16-A19 BHE ALE MilO RD DT/R DEN Trailing edge of ALE latches address Figure 5-5. 8086 Memory Read Bus Cycle for a Minimum Mode System (MN/MX 5-35 = +5 V) ·1 The memory or I/O device address is output via the Address Bus BHE during clock period T 1. ADO-AD15 starts floating in T2 while turning around internal pin logic so that data can be input during T3 and T4. Address lines A 16 through A 19 are all low when an I/O device address is being output. These address lines output status during T2. T3. and T4. Close to the end of T4. A 16 through A 19 start to float. BHE timing follows Address lines A 16-A 19; that is to say. BHE is output low for the time that A 16 through A 19 is outputting an address. The trailing edge of the high ALE pulse should be used as the "valid address" strobe. If your 8086 configuration demultiplexes the Data and Address Busses. then the Address Bus demultiplexing buffers should be the "pass through" type and use the high-to-Iow transition of ALE as their latching strobe. Remaining control signals consist of M/i5 and RD. which are directed at external memory or 1/0 devices. plus DTIAand DEN. which are directed at bus buffers. M/iO differentiates between a memory access and an I/O device access. M/IO will be high for a memory access bus cycle; it will be low for an 1/0 device access bus cycle. M/i5 will contribute to memory and I/O device select logic when memory and I/O devices have similar addresses. RD is pulsed low as a memory or I/O device read strobe. The addressed memory device must use this low signal to place data on ADO - AD 15. DT /R and DEN are control signals designed to control bidirectional latched buffers on the Data Bus. DT IR is output low for the entire memory or I/O device read bus cycle; it should be used to turn the latched buffers around so that they will transmit data to the CPU. DEN subsequently acts as a latching strobe. These two signals have been designed specifically to work with the 8286 and 8287 Data Bus transceivers; however. their logic is quite general. There is no difference between external timing for an instruction fetch or memory read bus cycle. Given the pipelining instruction fetch logic of the 8086. this makes sense. The only timing difference between a memory read bus cycle and an I/O device input bus cycle occurs at the M/ffi signal. This signal will be low for the duration of an I/O input bus cycle. whereas in Figure 5-5 it is shown high for the duration of a memory read bus cycle. Except for this difference, Figure 5-5 also illustrates I/O input bus cycle timing for a simple 8086 configuration. During any simple configuration memory access operation, the following status is output on address lines A 16 through A 19: A 19/56 A 18/S5 - Always 0 Interrupt enable status A17/S4- 0 A 16/S3 - 0 0 1 1 0 1I t 1 L- Data segment access cOde segment access or no access Stack segment access ~------- Extra segment access _____ L... The interrupt enable status appearing on A 18 may be used to illuminate an indicator on a control panel. should there be one. This indicator will show whether interrupts are enabled or disabled at any time. This status has no other value. S3 and 54 together identify the memory segment which is being accessed. This is not very useful information. Even a code segment access cannot be interpreted as an instruction fetch. since data can be addressed out of the program segment. 8086 MEMORY OR I/O DEVICE WRITE BUS CYCLE FOR MINIMUM MODE Figure 5-6 illustrates timing for an 8086 memory or I/O device write bus cycle when the 8086 is operating in a minimum mode with MN/MX tied to +5 V. Address output logic is identical in read and write bus cycles. As was the case for a read bus cycle. the address is output on the Address Bus. together with BHE. during T 1. External logic should use the high-to-Iow transition of the ALE pulse in order to latch a valid address. During T2. ADO - AD15 switches to outputting data. while A16 - A19 outputs status. The same status is output in read and write bus cycles. M/iO is output high for the duration of a memory write bus cycle; it is output low for the dUration of an I/O device write bus cycle. WR is output low beginning early in T2 and ending shortly after T3. Note that RD does not go low for a read bus cycle until halfway through T2. 5-36 For an 8286 or 8287 Bus Transceiver, or any similar device, DT/A" is output high for the entire duration of the write bus cycle. This conditions the device to transmit data from the CPU to external logic. DEN is the chip enable signal provided for the bus transceiver. DEN is output high from the end of T1 until the end of T4. Note that this high pulse is longer than the DEN pulse accompanying a read bus cycle. \- .\ One Bus Cycle T2 T1 I I T3 T4 ClK ADO-AD15 Data Out Status Out A16-A19 BHE ALE MIlO WR DT/R DEN Trailing edge of ALE latches address Figure 5-6. 8086 Memory Write Bus Cycle for a Minimum Mode System (MN/MX = +5 V) An I/O write bus cycle has timing identical to Figure 5-6, except that the M1i5 Signal will be low for the duration of the bus cycle, rather than high as shown in Figure 5-6. Wherever a memory word and an I/O port may have the same address, M1i5 must contribute to device select logic in order to discriminate between memory and I/O devices. The status output on A 16-A 19 is no more usefu I in a write bus cycle than it is in a read bus cycle. 8086 READ AND WRITE BUS CYCLES FOR MAXIMUM MODE It is not very rewarding looking at maximum mode memory or I/O access bus cycle timing, if we look at timing for an 8086 device on its own. This is because in maximum mode, with MN/MX tied to ground, the 8086 has been designed to operate with the 8288 Bus Controller. Figure 5-7 and 5-8 provide maximum mode timing for the 8086 on its own when executing read or write bus cycles. Only the status signal levels differentiate memory or I/O access bus cycles. Timing for the Address/Data Bus is identical in minimum and maximum modes. The read strobe RD does not change. However, remaining control Signals become control inputs to the 8288 Bus Controller. 5-37 Observe that OSO and OS1 change levels on a clock period by clock period basis in order to identify events for individual clock periods. SO, Sf, and S2 hold their levels from shortly before T 1 until shortly after the end of T2· li-oI•. . . . - - - - - - - - - - - - o n e T1 Bus c y c l e - - - - - - - - - - - - - o . , j l T3 T2 T4 CLK ADO-AD15 _ _......J....._ _... A 16-A 19 ---...o+---C QSO,QS1 SO,S1,S2 Figure 5-7. 8086 Memory or I/O Read Bus Cycle for a Maximum Mode System (MN/MX = 0 V) li-oI•. . . . . - - - - - - - - - - - - - o n e T1 T2 Bus C y c l e - - - - - - - - - - - - . J I T3 T4 ,.---",,1 CLK -"""---4 Address Out Data Out A16-A19 - - t - - - 1 Address Out Status Out ADO-AD 15 QSO,QSl Figure 5-8. 8086 Memory or liD Write Bus Cycle for a Maximum Mode System (MN/MX = 0 V) 5-38 The 8288 Bus Controller. described later in this chapter. decodes SO. 51. and S2 in order to generate control signals that are comparable to those illustrated in Figures 5-5 and 5-6. For a complete discussion of bus cycle timing in complex 8086 microcomputer configurations. see the discussion of 8288 Bus Controller. THE 8086 WAIT STATE 8086 Wait state logic is independent of the MN/MX pin connection and the external access bus cycle being executed.ln any bus cycle it is possible to insert one or more Wait clock periods (Twl between T3 and T4. In order to extend a bus cycle with Wait clock periods. external logic must input a low READY signal during T2 of the bus cycle which is to be extended. The READY input to the 8086 must be synchronized with the falling edge of ClK at the end of T2; this synchronized READY input is created by the 8284 clock generator. External logic will normally input an asynchronous READY to the 8284 clock device. which outputs a synchronous READY for the 8086. Wait clock periods will continue to be inserted to the bus cycle until READY goes high again. Timing is illustrated in Figure 5-9. All output signal levels are maintained for the duration of the Wait state. THE 8086 HOLD STATE The 8086 can be forced into a Hold state, at which time all three-state signals are floated. The 8086 Hold state is used to enable direct memory access logic, and in addition to disable inactive 8086 devices when more than one CPU accesses the same System Bus in a mUlti-CPU configuration. In a minimum mode configuration, when MN/MX is tied to +5 V, the 8086 has a traditional Hold request input (HOLD) and a Hold Acknowledge output (HLDA). Upon receiving a high HOLD input. the 8086 will complete execution of its current instruction bus cycle before entering the Hold sate and outputting HlDA high. Timing may be illustrated as follows: 8086 HOLD IN MINIMUM MODE SYSTEM T40rTi elK HOLD HlDA The 8086 samples the HOLD input on the low-to-high transition of ClK. Therefore. HOLD must make its transitions away from this sampling point that is to say. HOLD must be stable when ClK is making its low-to-high transition. The 8086 will acknowledge the Hold request by making HlDA high during any idle clock period. or at the end of a bus cycle. If a bus cycle is being executed when a Hold request occurs. the Hold request will not be acknowledged until the end of T4 for the currently executing bus cycle. The Hold state will last until the HOLD input goes low again. The 8086 continues to sample the HOLD input on all lowto-high transitions of ClK; therefore. HOLD must make its high-to-Iow transition away from the rising edge of ClK. When HOLD goes low. the Hold state will immediately end and HlDA will be forced low again. In 8086 maximum mode configurations where MN/MX is tied to ground. the HOLD and HlDA pins convert to bidirectional type control signals. There are two bidirectional signals; RO/GTO and RO/GT1. RO/GTO has higher priority than RO/GT1. 5-39 8086 HOLD IN MAXIMUM MODE SYSTEM T1 T2 TW T3 T4 elK RDY READY ROY comes from external logic to the 8284 clock. READY comes from the 8284 clock, goes to the 8086. Figure 5-9. The 8086 READY Input and Wait States Any external logic that wishes to put an 8086 CPU into the Hold state transmits a low pulse to RO/GTO or RO/GT1, The 8086 CPU will acknowledge this Hold request immediately. if a bus cycle is not being executed. or at the conclusion of a currently executing bus cycle. The 8086 acknowledges the Hold request transmitting by a low pulse via the same ROI GT line; simultaneously the 8086 floats its three-state bus lines. External logic must allow atl~~t~~ clock period to elpase following the Hold Acknowledge pulse. before attempting to input via the same pin. External logic terminates the Hold state by inputting another low pulse. Timing may be illustrated as follows: : T4 or Ti I-- Hold State---j I I I eLK RQ/GT 0 @ ® In the illustration above. ® identifies the instant at which external logic requests a Hold state by transmitting a low pulse via either RO/GT line. The 8086 samples RO/GT on the rising edge of ClK; therefore. all signal transitions on RO/GT must occur away from the ClK low-to-high transitions. The 8086 will now acknowledge a Hold request during a bus cycle, If a bus cycle is in progress. then the Hold acknowledge will occur at the end of the bus cycle - that is to say. at the end of T4. If a bus cycle is not in progress. then the Hold request will be acknowledged immediately. In the illustration above. @ identifies the low pulse the 8086 will output as its Hold acknowledge, The Hold state will last until external logic again transmits a low pulse via RO/GT. This is identified above as Once again the 8086 samples RO/GT on the rising edge of ClK; therefore. RO/GT should be stable at this time, © When the 8086 enters the Hold state. it continues executing instructions it takes out of the pipeline. until a bus access is required. When the EU requires a bus access. it stops operating until the end of the Hold state - at which time its bus access request will be honored by the Bus Interface Unit In the event that Hold requests occur simultaneously on RQ/GTO and RQ/GT1. the acknowledge pulse will be output on RQ/GTO. RO/GT1 will not be acknowledged until the Hold state initiated via RO/GTO has ended. When one Hold state ends. another Hold state can begin immediately for either of these reasons: 1) RO/GT1 was active when RO/GTO was acknowledged; the RO/GT1 Hold request. being of lower priority. was denied and is pending, 2) While the 8086 was in a Hold state. a new hold request occurs on the other RO/GT line. If a new hold request occurs while the 8086 is in Hold state. priorities no longer apply. For example. if the CPU has acknowledged a Hold request occurring at RO/GT1 and is in a Hold state. then it will deny a new Hold request arriving via RO/GfO until the current Hold state has ended, 5-40 If there is an active Hold request when the CPU ends a Hold state. then the CPU will immediately acknowledge the pending Hold request. This may be illustrated as follows: Hold for RQ/GT1 in progress Hold for RQ/GTO in progress Low pulse input at RQ/GTO and immediately stand RQ/GTO Hold When a Hold state ends. if the CPU has a bus access request pending. then the CPU bus access request will be denied until all active Hold requests have been acknowledged. Note that there are no 8086 instructions that specifically affect the level of RO/GTO or RO/GT1. That is to say. external logic is entirely responsible for the interfaces to these two signals. We will discuss RO/GTO and RO/GT1 in more detail later in this chapter when we look at some multiple CPU 8086 configurations. THE 8086 HALT STATE The 8086 enters a Halt state after a HALT instruction is executed. In the Halt state no signals are floated, and undefined data is output on the Data/Address Bus. No bus cycles can be executed while the 8086 is in the Halt state. . When a Halt instruction is executed. a bus cycle initiates the Halt state. This Halt state initializing bus cycle has nothing to do with instruction fetch logic. If the Halt instruction object code is fetched by the CPU from the queue. then there will be no preceding instruction fetch bus cycle. If the Halt instruction must be fetched from memory because the queue is empty. or is at the conditional end of a Branch-on-Condition. then the Halt initializing bus cycle will be preceded by an instruction fetch bus cycle. For a simple system, the HALT initialization bus cycle is given by Figure 5-5, except that RD, M/IO, DT/R and DEN are not active. ALE is active, although the address output has no meaning. For a complex system, the HALT initializing bus cycle is illustrated in Figure 5-10. The Halt state combination occurring at SO. ST. and 52 causes the 8288 Bus Controller to issue an ALE pulse before entering the Halt state: however. the occurrence of ALE could not be deduced simply by looking at 8086 timing. 5-41 CLK-\ so,51 52 I , , I I I I I T3 ~ '\ I J \ I I \ T4 I I I L Undefined Data \ \ \ \ "" \ \~ T2 ?- I ) OSO, OS1 I I T1 \ A16-A19 -I One Bus Cycle I -., ADO-AD15 SHE I· \ t I Undefined Data / " \ J Figure 5-10. 8086 HALT Instruction and Bus Cycle Timing for a Complex Bus Configuration The Halt state is terminated by an interrupt request or a Reset. You can freely enter and leave a Hold state within an 8086 Halt state via any of the means that we have just described. The fact that the 8086 is in the Halt state in no way modifies Hold logic. THE 8086 LOCK A potential for serious error exists in the Hold request/acknowledge logic of the 8086. The 8086 will acknowledge a Hold request occurring on the RQ/GTO or RQ/GT1 lines at the end of the current bus cycle, if one is being executed. or at the next idle clock period. if a bus cycle is not being executed. The 8086 does not wait until the conclusion of the current instruction's execution before acknowledging the Hold request. Therefore, if an instruction reads the contents of a memory location (or I/O port), modifies these contents, then writes it back, a Hold state may separate the read bus cycle from the write bus cycle: I Read from memory location X Modify data I Write back to location X I HOLD STATE This can cause unexpected errors. If the 8086 enters a Hold state after reading memory location X contents and before writing these contents back. then it is possible for external logic - either direct memory access logic or another Central Processing Unit - to modify the contents of memory location X while the 8086 is in the Hold state. Now when the 8086 writes back the modified word. it may destroy data that should have been preserved. 5-42 If a 16-bit data word lies on an odd-byte boundary. it will require two bus cycles to access the data word. Under normal circumstances. a Hold request could be acknowledged between the first and second memory access bus cycles. But what if the word being accessed gets modified during the Hold state? If the Hold state splits two memory read bus cycles. this is what the CPU is going to read: o 7 7 .... .. '~,-- o ----~~~--------~~,-- High-order byte was read after Hold and is modified --,~ Low-order byte was read before Hold and is not modified If a Hold state splits two memory write bus cycles. this is what ultimately gets written: o 7 7 ~L, I '-,----v High-order byte is written after Hold and is not modified o ___-.~___. . ._"J Low-order byte was written before Hold and gets modified You use the 8086 LOCK instruction in order to prevent the types of errors described above. When a LOCK instruction is executed, the LOCK signal is low for the duration of the next sequential instruction's execution. Also, while the next sequential instruction is being executed, a Hold request will not be acknowledged. You cannot extend protection against a Hold acknowledge beyond a single instruction's execution. For example. suppose you have two instructions. each of which is preceded by a Lock: LOCK AND LOCK OR MEMX.AX MEMX. BX In the instruction sequence above. MEMX is a label which represents the address of a memory location. The contents of this memory location are ANDed with a mask stored in AX. then ORed with a mask stored in BX. The contents of MEMX are read. modified. and written back at each step. Now. you may wish to inhibit Hold logic for both the AND and the OR operation. You cannot do so using the LOCK instruction. The first LOCK instruction will protect the following AND instruction from being interrupted by a Hold state: however. any pending Hold state will be acknowledged before the second LOCK instruction is executed. Each LOCK instruction extends protection against a Hold Acknowledge for the duration of the next sequential instruction only. The fact that the following instruction is also a LOCK is irrelevant. The second LOCK instruction will be the first instruction executed following the Hold state. and it will guarantee that no new Hold state begins until it. and the OR instruction. have both been executed. You can use the LOCK instruction and signal to identify individual instruction execution times. If for any reason external logic needs to know the execution time for certain instructions. then by preceding these instructions with a LOCK instruction you will generate a high pulse on the LOCK output. The width of this high pulse exactly equals the execution time of the instruction which follows the LOCK. 8086 SINGLE INSTRUCTION TIME IDENTIFIED THE 8086 PROCESSOR WAIT FOR TEST STATE The 8086 has a program-initiated Wait state that external logic must terminate via the TEST input signal. The WAIT instruction initiates this Wait state. After the WAIT instruction is executed. the 8086 generates an endless sequence of idle clock periods. This sequence lasts until external logic inputs a low signal at the TEST input. TEST must be high for at least four clock periods. While the endless sequence of idle clock pulses is being executed. the System Bus is not floated and the Bus Interface Unit may execute memory read bus cycles in order to fill up the instruction object code queue. 5-43 The processor Wait state can be used to synchronize an 8086 with any external time sequence. For example, you could start two programs, executing in two separate 8086 systems, at exactly the same time, by preceding each program with a Wait instruction. If both 8086's receive low TEST inputs simultaneously, then both microprocessors will start executing their programs at the same instant. THE 8086 PROCESSOR ESCAPE The 8086 has a special escape instruction (ESC) intended for use in mUlti-CPU configurations. When the ESC instruction is executed. the contents of an addressed memory location are input to the CPU. but the input data is not stored anywhere. The purpose of the ESC instruction is to place the addressed data on the Data/Address Bus so that any other microprocessor (or external logic) connected to the Data/Address Bus can receive the data. We will examine the value of the ESC instruction later in the chapter when looking at the 8086 in multiple CPU configurations. THE 8086 RESET OPERATION The 8086 has an asynchronous RESET input. This signal can be forced high at any time in order to reset the 8086. The high RESET must be at .least four clock cycles long. The 8086 terminates all current operations as soon as the RESET input makes a low-to-high transition. Nothing more happens until the RESET signal subsequently makes a high-to-Iow transition. It then takes approximately ten clock periods in order to execute the following operations: 1) The Status register is cleared. Among other things. this resets the interrupt enable flag to 0, thus disabling interrupts. 2) The CS Segment register is set to FFFF16. 3) The OS, SS, and ES Segment registers and the Program Counter are all reset to O. 4) Program execution begins. Since the CS Segment register contains FFFF16 and the Program Counter contains 0, the first instruction executed is taken from memory location FFFF016. 8086 INTERRUPT PROCESSING The 8086 allows interrupts to originate in one of three ways: 1) From software or within program logic. 2) From external logic as a nonmaskable interrupt. 3) From external logic as a maskable interrupt. There is, in addition, a special "single step" condition that makes use of interrupt logic. We will describe single stepping after our discussion of interrupt logic. In the event that two or more of the three interrupt types occur simultaneously, software generated interrupts have the highest priority and maskable interrupts have the lowest priority. These are the ways in which a software interrupt request may occur: 1) Following an attempt to divide by O. A special divide by 0 interrupt request will occur any time the divide instruction is executed with a 0 dividend. 2) Following execution of an Interrupt instruction (lNT). 3) Following execution of an Interrupt-on-Overflow instruction (INTO) - 8086 SOFTWARE INTERRUPTS if the Overflow status is set. A nonmaskable interrupt request is initiated when external logic transmits a low-to-high transition to the NMI pin. This is an edge-triggered Signal. A nonmaskable interrupt has lower priority than a software interrupt. but higher priority than a maskable interrupt. 8086 NONMASKABLE INTERRUPT A maskableinterrupt request will be generated when external logic transmits a high level to the INTR pin. This input is level sensitive; it is the high level at INTR that causes the interrupt requests to occur. 8086 MASKABLE INTERRUPT Central to all 8086 interrupt processing is a Vector table that can be up to 1024 bytes in length, occupying absolute memory addresses 00000 through 003FF 16. This Vector table consists of up to 256 four-byte entries. Each entry contains two 16-bit addresses that get loaded into the CS Segment register and the Program Counter. 8086 INTERRUPT VECTOR TABLE Figure 5-11 illustrates the 8086 Interrupt Vector table. 5-44 A number of the Vector table entries serve specific interrupts. Other entries are reserved by Intel and should be avoided if compatibility with Intel software is desired. These entries are identified in Figure 5-11. As illustrated in Figure 5-11, 32 of the 256 interrupt vectors are not available to external logic; that leaves 224 vectors available to maskable external interrupts - which is plenty. Taking each of the three interrupt types in turn, let us examine the interrupt acknowledge p...r_o_c_e_s_s._ _ __ When any of the software interrupts are acknowledged, the following steps occur: 8086 SOFTWARE INTERRUPT 1) The Status register contents are pushed onto the Stack; Stack Pointer contents. in consequence. are decremented by two. 2) The Interrupt and Test status flags are cleared; this disables maskable interrupts and single step logic (which we describe after our discussion of interrupt logic). 3) The CS Segment register contents are pushed onto the Stack; Stack Pointer contents. in consequence. are decremented by two. 4) The new CS Segment register contents are taken from the appropriate interrupt vector location. With the exception of the INT instruction. software-generated interrupts have dedicated vector locations as illustrated in Figure 5-11. The INT instruction allows anyone of the 256 vector locations to be selected; a default option selects Vec• tor 3. 5) The Program Counter contents are pushed onto the Stack; Stack Pointer contents are decremented by two. 6) The new Program Counter contents are taken from the interrupt vector. When a nonmaskable interrupt is acknowledged, the following events occur: 8086 NONMASKABLE INTERRUPT 1) The Status register contents are pushed onto the Stack. The Stack Pointer contents are decremented by two. 2) The Interrupt and Test statuses are reset to 0; this disables nonmaskable interrupts and single stepping mode. 3) The CS Segment register and Program Counter are reloaded from Interrupt Vector 2. See Figure 5-11. ------.... When a maskable interrupt is acknowledged, the following steps occur: 1) 8086 Two interrupt acknowledge bus cycles are executed by the Bus Interface Unit of the 8086. An MASKABLE interrupt acknowledge bus cycle is identical to the memory read bus cycles. as illustrated in INTERRUPT Figures 5-5 and 5-7. with the exception that an interrupt acknowledge low pulse replaces the memory read low pulse. For a minimum mode system. INTA will provide the low RD pulse shown in Figure 5-5. Figure 5-7 accura.tely illustrates timing for an interrupt acknowledge bus cycle in a maximum mode system; however. SO. ST. and S2 will all be low. identifying an interrupt acknowledge. whereas a read I/O port or read memory status combination would be output otherwise. LOCK is low beginning at T2 of the first interrupt acknowledge bus cycle and ending at T2 of the second interrupt acknowledge bus cycle. This may be illustrated as follows: I. I ClK I Bus Cycle 1 T1 , I T2 , I T3 .. , I T4 I.. I I ·1 Bus Cycle 2 Tl I I T2 I I T3 I I T4 I I LOCK 2) The acknowledged external device must send back a byte of data on lines ADO-AD7 in response to the second interrupt acknowledge bus cycle. This data byte is interpreted as a pointer into the interrupt vector. Multiplying this 8-bit value by 4 creates the correct beginning address for the interrupt vector. 3) The Status register contents are pushed onto the Stack. 4) The Interrupt and Test flags in the Status register are cleared. This disables further maskable interrupts and single step logic. 5) The CS Segment register contents are pushed onto the Stack. 6) The next CS Segment register contents are taken from the interrupt vector location identified in Step 2. 7) The Program Counter contents are pushed onto the Stack. 5-45 Memory Interrupt Addresses Vector Table 00000 CSO 00002 PCO 00004 CSl 00006 PCl 00008 CS2 OOOOA PC2 OOOOC CS3 OOOOE PC3 00010 CS4 00012 PC4 00014 CS5 00016 PC5 I 00078 CS30 0007A PC30 0007C CS31 0007E PC31 00080 CS32 00082 PC32 00084 CS33 00086 PC33 Vector 1 } Vector 2 - Single step mode ~onmaskable Interrupt } Vector 3 -INT software interrupt (default option) } Vector 4 - ~NTO software Interrupt I } Vector 5 I Reserved by Intel } Vector 3010 f Veeto, 3 t 10 Vector 3210 } Vector 3310 I I I User vectors I 003F8 CS254 003FA PC254 003FC CS255 003FE PC255 I - - > Vector 25410 Vector 25510 I I I @ VeeW 0 - D;v;de by 0 I I • ® t , Interrupt acknowledge sequence of events is (D-@-@-@ CSN PCN ~ Shaded row applies to EA and LABEL. X These are displacements that can be used to compute memory addresses. 5-56 The following abbreviations are used in Tables 5-4 and 5-5: AH AL AL7 AX AX15 BD BH BL BRANCH BS BX C CH CL CS CX DADDR DATA8 DATA 16 DH DI DISP DISP8 DL DS DX EA ES I I/D LABEL N o OEA PC PDX PORT RB RBD RBS RW RWD RWS SEGM SFR SI SP SR SS Accumulator. high-order byte Accumulator. low-order byte The value of register AL high-order bit (0 or 1) extended to a byte (0016 or FF16) Accumulator. both bytes The value of register AH high-order bit (0 or 1) extended to a 16-bit word (000016 or FFFF16) The destination is a byte operand (used only by the Assembler) B register. high-order byte B register. low-order byte Program memory direct address. used in Branch addressing option shown in Tables 5-1 and 5-2 The source is a byte operand (used only by the Assembler) B register. both bytes Carry status C register. high-order byte C register. low-order byte Code Segment register C register. both bytes Da\a memory address operands identified in Table 5-3 Eight bits of immediate data 16 bits of immediate data D register. high-order byte Destination Index register An 8-bit or 16-bit signed displacement An 8-bit signed displacement D register. low-order byte Data Segment register D register. both bytes Effective data memory address using any of the memory addressing options identified in Table 5-2 Extra Segment register Status flag set to 1 Increment/decrement selector for string operations; increment if D is O. decrement if D is 1 Direct data memory address. as identified in Table 5-2 A number between 0 and 7 Status flag reset to 0 Offset data memory address used to compute EA: EA =OEA + [DS] * 16 Program Counter I/O port addressed by OX register contents; port number can range from 0 through 65.536 A label identifying an I/O port number in the range 0 through 25510 Anyone of the eight byte registers: AH. AL. BH. BL. CH. CL. DH. or OL Any RB register as a destination Any RB register as a source Anyone of the eight 16-bit registers: AX. BX. CX. DX. SP. SP. SI. or DI Any RW register as a destination Any RW register as a source Label identifying a 16-bit value loaded into the CS Segment register to execute a segment jump Status Flags register Source Index register Stack Pointer Anyone of the Segment registers CS. DS. ES. or SS Stack Segment register 5-57 U V X WD WS [[ ]] [] 1= Status flag modified. but undefined Any number in the range a through 25510 Status flag modified to reflect resu It The destination is a word operand (used only by the Assembled The source is a word operand (used only by the Assembler) Contents of the memory location addressed by the contents of the location enclosed in the double brackets The contents of the location enclosed in the brackets Data on the right-hand side of the arrow is moved to the location on the left-hand side of the arrow Contents of locations on each side of < - - are exchanged The twos complement of the value under the Not equal to INSTRUCTION EXECUTION TIMES AND CODES Table 5-5 lists instructions in alphabetical order. showing object codes and execution times. for the 8086 and the 8088. expressed in whole clock cycles. Execution time is the time required from beginning execution of an instruction that is in the queue to beginning execution of the next instruction in the queue. The time required to place an instruction from memory into the queue (instruction fetch time) is not shown in the table; because of queuing. instruction fetch time occurs concurrently with instruction execution time and thus has no effect on overall timing. except as specifically noted in the table. Instruction object codes are represented as two hexadecimal digits for instruction bytes without variations. Instruction object codes are represented as eight binary digits for instruction bytes with variations for the instruction. The following notation is used in Tables 5-4 and 5-5: [] a aa bbb DISP ddd rr reg indicate an optional object code byte one bit choosing length: in bit position a=O specifies 1 data byte; a= 1 specifies 2 data bytes in bit position 1 a=O specifies 2 data bytes: a=1 specifies 1 data byte two bits choosing address length: no DISP = 00 one DISP byte = 01 two DISP bytes = 10. or 00 with bbb = 110 11 causes bbb to select a register. using the 3-bit code given below for reg. three bits choosing addressing mode: 000 EA = (BX) + (SI) + DISP 001 EA = (BX) + (DI) + DISP 010 EA = (BP) + (SI) + DISP 011 EA = (BP) + (DI) + DISP 100 EA = (SI) + DISP 101 EA = (DI) + DISP 110 EA = (BP) + DISP 111 EA = (BX) + DISP represents two hexadecimal digit memory displacement represents three binary digits identifying a destination register (see reg.) two binary digits identifying a segment register: 00 = ES 01 = CS 10 = SS 11 = DS three binary digits identifying a register: a 000 001 010 011 100 101 110 111 = = = = = = = = 16-bit AX CX DX BX SP BP SI DI 8-bit AL CL DL BL AH CH DH BH 5-58 sss PPOO v x yy yyyy represents three binary digits identifying a source register (see reg) represents four hexadecimal digit memory address one bit choosing shift length: o count = 1 1 count = (eU "don't care" bit represents two hexadecimal data digits represents four hexadecimal data digits one bit where z XOR (ZF) = 1 terminates loop Execution time is less than or equal to instruction fetch time. Includes up to eight clock cycles of overhead on each transfer due to queue maintenance. For conditional jumps, the lesser figure is when the test fails (no jump taken). Effective Address calculation and extra clock cycles: Extra Clock Periods bbb 8086(1) EA 000 000 000 001 001 001 010 010 010 011 011 011 100 101 110 111 (BX) + (SI) (BX) + (SI) + 0lSP8 (BX) + (SI) + OISP 16 (BX) + (01) (BX) + (01) + 0lSP8 (BX) + (01) + OISP 16 (BP) + (SI) (BP) + (SI) + olspa (BP) + (SI) + OISP 1 6 (BP) + (01) (BP) + (01) + olspa (BP) + (01) + OISP 16 (SI) ir (01) or (BO) or (BX) + olspa + 0lSP16 a-bit immediate 1 6-bit immediate (1 ) Add another 4 clock cycles for each 1 6-bit operand or an odd address boundary. (2) Add anoter 4 clock cycles for each 1 6-bit operand. 8088(2) 7 7 11 11 a 12 12 a 12 12 11 15 a 12 16 8 12 16 7 7 11 11 5 11 15 5 9 9 6 6 9 13 6 10 Substitute the clock cycles shown above wherever EA appears in Tables 5-4 and 5-5. 5-59 Table 5-4. A Summary of 8086 and 8088 Instructions Statuses GI a. > Mnemonid Operand Is) Object Code Clock Cycles t- g U1 m IN AL,PORT E4 YY 10 IN AL.[OX) EC 1 8 IN AX,PORT E5 YY 10 IN AX,[OX) ED 8 OUT AL,PORT E6 YY 10 OUT AL,[OX) EE 1 8 OUT AX,PORT E7 YY 10 OUT AX,[OX) EF 8 LOS RW,OAOOR C5 aasssbbb [OISPJ[OISP) 16+EA LEA RW,OAOOR 80 aasssbbb [OISP)[OISP) 2+EA LES RW,OAOOR C4 aasssbbb [DISP][DISP) 16+EA MOV RB,OAOOR 8A aadddbbb [OISP)[OISP) 8+EA o GI Col c f .; II: ~ 0 E GI ~ ~ III .5 A: Operation Performed O D I T S Z APe [AL) - [PORT) Load one byte of data from 1/0 port PORT into AL [AL)- [POX) Load into AL one byte of data from 1/0 port whose address is held in the OX register [ALI - [PORT). [AH) - [PORT + 1) Load 16 bits of data into AX, AL receives data from 1/0 port PORT, AH receives data from 1/0 port PORT + 1 [AL) - [POX), [AH) - [POX+ 1) Load 16 bits of data into AX, AL receives data from 1/0 port whose address is held in the OX register. AH receives data from the 1/0 port whose address is one higher [PORT) - [AL) Output one byte of data from register AL to 1/0 port PORT [POX)- [ALI Output one byte of data from register AL to the 1/0 port whose address is held in the OX register [PORT) - [ALI. [PORT + 1) - [AH) Output 16 bits of data. The AL register contents are output to 1/0 port PORT. The AH register contents are output to 1/0 port PORT + 1 [PORT) - [POXI. [PORT + 1) - [POX+ 1) Output 16 bits of data. The AL register contents are output to the 1/0 port whose address is held in the OX register. The AH register contents is output to the 1/0 port whose address is one higher [RW)- [EAI. [OS)- [EA+2) Load 16 bits of data from the memory word addressed by OAOOR into register RW. Load 16 bits of data from the next sequential memory word into the OS register [RW)-OEA Load into RW the 1 6-bit address displacement which, when added to the segment register contents, creates the effective data memory address [RW)- [EAI. [ES)- [EA+2) Load 16 bits of data from the memory word addressed by DADDR into register RW. Load 16 bits of data from the next sequential memory word into the ES register [RBI- [EAI Load one byte of data from the data memory location addressed by OAOOR to register RB Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) • D. ~ :a., Statuses ~nemonic Operandls) Object Code Clock Cycles MOV RW,DADDR 8B aadddbbb [DISP][DISP) 8+EA MOV DADDR,RB 9+EA MOV DADDR,RW 88 aasssbbb [DISP][DISP] 89 aasssbbb [DISP][DISP] MOV AL,LABEL AO PPQQ 10 MOV AX,LABEL A1 PPQQ 10 MOV LABEL,AL A2 PPQQ 10 MOV LABEL,AX A3 PPQQ 10 MOV SR,DADDR 8E aaOrrbbb [DISP][DISP] 8+EA MOV DADDR,SR 8C aaOrrbbb [DISP][DISP] 9+EA XCHG RB,DADDR 86 aaregbbb [DISP][DISP) 17+EA XCHG RW,DADDR 87 aaregbbb [DISP][DISP] 17+EA D7 11 9+EA ~ c:: U1 ~ ~0 2 ., Co) c:: ! ., of II: > 0 .,E :E > l& 'E A. XLAT o Operation Performed D I T, S; Z A P C [RW] -[EA) Load 16 bits of data from the data memory word addressed by DADDR to register RW [EA] - [RBJ Store the data byte from register RB in the memory byte addressed by DADDR .[EA] -[RW] Store the 16-bit data word from register RW in the memory word addressed by DAD DR [AL] - [EA] Load the data memory byte directly addressed by LABEL into register AL [AX] - [EA] Load the 16-bit data memory word directly addressed by LABEL into register AX [EA] - [AL] Store the 8-bit contents of register AL into the data memory byte directly addressed by LABEL [EA] - [AX] Store the 16-bit contents of register AX into the data memory word directly addressed by LABEL [SR] - [EA] Load into Segment register. SR the contents of the 1 6-bit memory word addressed by DADDR [EA]- [SR] Store the contents of Segment register SR in the 16-bit memory location addresed by DADDR [RB] - - [EA) Exchange a byte of data between register RB and the data memory location addressed by DADDR [RW]-[EA] Exchange 16 bits of data between register RW and the data memory location addressed by DADDR [AL] - [[AL] + [BX)) Load into AL the data byte stored in the memory location addressed by summing initial AL contents with ex contents Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) Statuses GI Q. > ~ Mnemonic Operand(s) Object Code Clock Cycles Operation Performed 0 D I T 5 Z A P C ADC RB,DADDR 12 aadddbbb [DISPJ[DISP] 9+EA X X X X X ADC RW,DADDR 13 aadddbbb [DISPJ[DISP] 9+EA X X X ADC DADDR,RB 10 aasssbbb [DISP][DISP] 16+EA X X ADC DADDR,RW 11 aasssbbb [DISP][DISP] 16+EA X X X ADD RB,DADDR 9+EA X X ADD RW,DADDR 9+EA X X X ADD DADDR,RB 02 aadddbbb [DISP)[DISP] 03 aadddbbb [DISPJ[DISP] 00 aasssbbb [DISP)[DISP] 16+EA X X X ADD DADDR,RW 01 aasssbbb [DISP][DISP] 16+EA X X X AND RB,DADDR 22 aadddbbb [DISP][DISP] 9+EA 0 X X AND RW,DADDR 23 aadddbbb [DISP)[DISP] 9+EA 0 X X AND DADDR,RB 20 aasssbbb [DISP)[DISP] 16+EA 0 X X AND DADDR,RW 21 aasssbbb [DISP)[DISP] 16+EA 0 X X CMP RB,DADDR 3A aadddbbb [DISP][DISP] 9+EA X X X CMP RW,DADDR 38 aadddbbb [DISP][DISP] 9+EA X X X X '$ I!GI Q. 0 ~ 0 E GI U1 m ~ ~ GI X u c !!! .!GI a: ~ E GI ~ ~ IV "uc 0 GI (I) [RB] - [EA] + [RB] + [C] Add the contents of the data byte addressed by DAD DR, plus the Carry status, to register RB X X X [RW] - [EA] + [RW] + [C] Add the contents of the 16-bit data word addressed by DADDR, plus the Carry status, to register RW X X X [EA] - [EA] + [RB] + [C] Add the 8-bit contents of register RB, plus the Carry status, to the data memory byte addressed by DADDR X X X [EA] - [EA] + [RW] + [C] Add the 16-bit contents of register RW, plus the Carry status, to the data word addressed by DADDR X X X [RB] - [EA] + [RB] Add the contents of the data byte addressed by DADDR to register RB X X X [RW] - [EA] + [RW] Add the contents of the 16-bit word addressed by DADDR to register RW X X X [EA] - [EA] + [RB] Add the a-bit contents of register RB to the data memory byte addressed by DADDR X X X [EA] - [EA] + [RW] Add the 16-bit contents of register RW to the data memory word addressed by DADDR U X 0 [RB] - [EA] AND [RB] AND the 8-bit contents of register RB with the data memory byte addressed by DADDR. Store the result in RB U X 0 [RW] - [EA) AND [RW] AND the 1 6-bit contents of register RW with the data memory word addressed by DADDR. Store the result in RW U X 0 [EA] - [EA) AND [RB) AND the 8-bit contents of register RB with the data memory byte addressed by DADDR. Store the result in the addressed data memory byte U X 0 [EA] - [EA] AND [RW] AND the 1 6-bit contents of register RW with the data memory word addressed by DADDR. Store the result in the addressed data memory word X X' X [RB] - [EA] Subtract the contents of the data memory byte addressed by DADDR from the contents of register RB. Discard the result, but adjust status flags X X X [RW] - [EA] Subtract the 1 6-bit contents of the data memory word addressed by DADDR from the contents of register RW. Discard the result, but adjust status flags X Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) Statuses Q) a. > Mnemonic Operand(s) ~ Object Code Operation Performed Clock Cycles 0 D I T S Z A P C CMP DADDR.RB 38 aasssbbb [DISP][DISP] 9+EA X X X X X X CMP DADDR.RW 39 aasssbbb [DISP][DISP] 9+EA X X DEC DADDR 1111111a aa001bbb [DISP][DISP] 15+EA X X X X X DIV AX.DADDR F6 aa110bbb [DISP][DISP] (S6-96 )+EA U U U U U U DIV OX. DAD DR F7 aa110bbb [DISP][DISP] (150-16S)+EA U U U U U U IDIV AX.DADDR F6 aa111bbb [DISP][DISP] (107-11S)8+EA U U U U U U IDIV DX.DADDR F7 aa111bbb [DISP][DISP] (171)-190)+EA U U U U U U IMUL ALDADDR F6 aa101bbb [DISP][DISP] IMUL AX.DADDR F7 aa101bbb [DISP][DISP] X X X X ;; CD ·Sc= 0 ~ '! f CD a. C11 0, W C > ~ E CD ~ CD u c G) .!CD II: ~ 0 E G) ~ ~ III "a c 0 u G) CI) X U U U U )( (134-160)+EA X U U U U X (S6-104)+EA [EA] - [RB] Subtract the 8-bit contents of register RB from the data memory byte addressed by DADDR. Discard the result, but adjust status flags [EA] - [RW] Subtract the 16-bit contents of register RW from the data memory word addressed by DADDR. Discard the result. but adjust status flags rEA] - [EA] - 1 Decrement the contents of the memory location addressed by DADDR. Depending on the prior definition of DADDR. an 8-bit or a 16-bit memory location may be decremented [AX] - [AX]/[EA] Divide the 16-bit contents of register AX by the S-bit contents of the memory byte addressed by DADDR. Store the integer quotient in AL and the remainder in AH. If the quotient is greater than FF16. execute a "divide by 0" interrupt [OX] [AX] - [OX] [AX]/[EA] Divide the 32-bit contents of registers OX (high-order) and AX !low-order) by the 16-bit contents of the memory word addressed by DADDR. Store the integer quotient in AX and the remainder in OX. If the quotient is greater than FFFF 16. execute a "divide by 0" interrupt [AX] - [AX]/[EA] Divide the 16-bit contents of register AX by the 8-bit contents of the memory byte addressed by DAD DR. treating both contents as signed binary numbers. Store the quotient, as a signed binary number. in AL. Store the remainder. as an unsigned binary number. in AH. If the quotient is greater than 7F 16. or less than -S016. execute a "divide by 0" interrupt [OX] [AX] - [OX] [AXl![EA] Divide the 32-bit contents of register OX (high-order) and AX !low-order) by the 16-bit contents of the memory word addressed by DADDR. Treat both contents as signed binary numbers. Store the quotient. as a signed binary number. in AX. Store the remainder. as an unsigned binary number. in AH. If the quotient is greater than 7FFF16. or less than -S00016. execute a "divide by 0" interrupt [AX] - [AL] • [EA] Multiply the S-bit contents of register AL by the contents of the memory byte addressed by DADDR. Treat both numbers as signed binary numbers. Store the 16-bit product in AX [OX] [AX] - [AX] • [EA] Multiply the 16-bit contents of register AX by the 16-bit contents of the memory word addressed by DADDR. Treat both numbers as signed binary numbers. Store the 32-bit product in DX (high-order word) and AX !low-order word) Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) & >- Mnemonic Operand(.) Statuses Object Code Clock Cycle. ~ o D I T S· Z Operation Performed A P C: INC DADDR 1111111a a8000bb [DISP}(DISP] 15+EA X X X X X MUL AL.DADDR FS a8100bbb [DISP][DISP] (7S-831+EA 'X U U U U X MUL F7 F7 aa100bbb [DISP][DISP] (124-1391+EA X U U U U X NEG DADDR 1111011a aa011bb [DISP][DISP] 16+EA NOT DADDR 1111011a aa010bbb [DISP][DISP] 16+EA OR RB.DADDR OA aadddbbb [DISP)[DISP] OR RW.DADDR OR OR ~ Gl ~ c c +: ..; 0 ~ X X X X X X 9+EA X X X U X X OB aadddbbb [DISP][DISP] 9+EA X X X U X X DADDR.RB 08 aasssbbb [DISP][DISP) 1S+EA X X DADDR.RW 09 aasssbbb [DISP][DISP) 16+EA X X X U X X Q. (J1 I m -1=0 0 >~ E Gl ! Gl u c ~ II: ~ 0 E Gl ~ ~ III "uc X U X X 0 Gl en [EA] +- [EA] + 1 Increment the contents of the memory location addressed by DADDR. Depending on the prior definition of DAD DR. an 8-bit or a 16-bit memory location may be incremented [AX] +- [All • [EA] Multiply the 8-bit contents of register AL by the contents of the m~mory byte addressed by DADDR. Treat both numbers as unsigned binary numbers. Store the 1S-bit product in AX [OX) [AX) +- [AX) • [EA) Multiply the 16-bit contents of register AX by the 16-bit contents of the memory word addressed by DADDR. Treat both numbers as unsigned binary numbers. Store the 32-bit product in DX (high-order word) and AX (low-order word) [EA) +- rEAl Twos complement the contents of the addressed memory location. Depending on the prior definition of DADDR. an 8-bit or 16-bit memory location may be twos complemented [EA] +- NOT [EA] Ones complement the contents of the addressed memory location. Depending on the prior definition of DADDR. an 8-bit or 16-bit memory location may be ones complemented [RB] +- [EA] OR [RB] OR the 8-bit contents of register RB with the data memory byte addressed by DADDR. Store the result in RB [RW) +- [EA) OR [RW) OR the 1S-bit contents of register RW with the data memory word addressed by DADDR. Store the result in RW [EA) +- [EA) OR [RB) OR the 8-bit contents of register RB with the data memory byte addressed by DADDR. Store the result in the data memory byte [EA] +- [EA) OR [RW) OR the 16-bit contents of register RW with the data memory word addressed by DADDR. Store the result in the data memory word ---- Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) t>- I- ~nemonic Operand(s) Statu.e. Object Code RCL DADDR.N 110100va aa011bbb [DISP](DISP] ROL DADDR.N 110100va aaOOObbb Clock Cycles N=1 15+EA; N>1 4N+20+EA o X Operation Performed D I T S Z A P C X I IT~ I ~ • rg 0 9 i ;a. 0 m (J1 ~ E • Jj [EA] or DADDR may address a word: ~ .!c (J1 Rotate the contents of the data memory location addressed by DADDR left through the Carry status. If N = 1. then rotate one bit position. If N =CL. then register CL contents provide the number of bit positions. Depending on prior definition. DADDR may address a byte: 6 [EA) [EA+1] RCR DADDR.N 110100va aaOO1bbb [DISP](DISP] N=1 15+EA X X As RCL. but rotate right ROL DADDR.N 110100va aaOOObbb [DISP](DISP] N>1 4N+20+EA X X Rotate the contents of the data memory location addressed by DAD DR left. Move the left most bit.into the Carry status. If N = 1. then rotate one bit position. If N = CL. then register CL contents provides the number of bit positions. Depending on prior definition. DAD DR may address a byte: ! •c Co) i ~ ~ 0 E :e• ~ all 'a C EJ... 0 Co) • (I) + I [EA] b or DADDR may address a word: EJ4 !~ [EAI [EA+1] 6 Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) Statuses G ~ Mnemonic Operand(s) Object Code Clock Cycles t- DADDR.N Operation Performed O D I T S Z A P C 110100va aaOO1bbb [DISP][DISP] N=1 15+EA X X SAL As ROl. but rotate right Shift the contents of the data memory location addressed by DADDR left. Move the left most bit into the Carry status. If N = 1. then shift one bit position. If N = Cl. then register Cl contents provides the number of bit positions. Depending on prior definition. DADDR may address a byte: &-I ;; G -!= [EA] 1-- 0 or DADDR may address a word:. ~ 0 g ~ i ; Q. 0 Cf m m ~ E G ~ G SAR DADDR.N u ~ ! .!G 110100va aa111bbb [DISPJ[DISP] N=1 15+EA; N>1 .4N+20+EA X X X U X X [EA] [EA+1] As SAL. but shift right and propagate sign: -.J CC ~ 2 [EA] ~ or q E G :E ~ III 'tI ~ 0 u G (/) SBB SBB RB,DADDR RW,DADDR 1A aaddd bbb [DISPJ[DISP] 9+EA 1B aadddbbb [DISPJ[DISP] 9+EA X X [EA] [EA+1] ~ X X X X X [RB] - [RB] - [EA] - [C] X X X X Subtract the contents of the data byte addressed by DAD DR from the contents of a-bit register RB, using twos complement arithmetic. Decrement the result in RB if the Carry status was initially set X [AW) - [RW) - [EA) - [e) Subtract the contents of the 16-bit data word addressed by DAD DR from the contents of the 16-bit register RW, using twos complement arithmetic. Decrement the result in RW if the Carry status was initially set Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) Statuses G) Q. ~ Mnemonic Operand(s) SBB ~ CD DADDA,AB SBB DADDA,AW SHL DADDA,N SHA DADDA,N ~ ·Sc 0 Object Code Clock Cycles 18 aasssbbb [DISP][DISP] 16+EA 19 aasssbbb [DISP][DISP] 16+EA 110100va aa1p1bb [DISP][DISP] N=1 15+EA; N>1 4N+20+EA o D X X I Operation Performed I T S Z A P C X X X X X X X X X X X X X U X X X X X U X X 1 q Q. 0 -.,j ~ E G) ~ G) u c ...! CD SUB AB,DADDA 2A aadddbbb [DISP][DISP] 9+EA X X SUB AW,DADDA 2B aadddbbb [DISP][DISP] 9+EA X X X X X X SUB DADDR,AB 28 aasssbbb [DISP][DISP] l6+EA X X X X X X SUB DADDR,RW 29 aasssbbb [DISP][DISP) l6+EA X X X X X X TEST DADDR,RB 84 aaregbbb [DISP][DISP] 9+EA 0 X X U X 0 G) a: X X X X ~ 0 E CD ~ ~ III "a [EA] f---.E] or 1!! G) a, As SAL, but shift right: O~ g U'1 [EA] - [EA] - [AB] - [C] Subtract the contents of 8-bit register AB from the data byte addressed by DADDA, using twos complement arithmetic. Decrement the result in data memory if the Carry status was initially set [EA]- [EA] - [AW] - [C] Subtract the contents of 16-bit register AW from the 16-bit data word addressed by DADDA, using twos complement arithmetic. Decrement the result in data memory if the Carry status was initially set This is an alternate mnemonic for SAL c o u G) (/) [EA] [EA+1] ~ [RB] - [RB] - [EA] Subtract the contents of the data memory byte addressed by DADDR from the contents of a-bit register AB, using twos complement arithmetic [AW] - [AW] - [EA] Subtract the contents of the 1 6-bit data memory word addressed by DADDA from the contents of l6-bit register AW, using twos complement arithmetic [EA] - [EA] - [AB] Subtract the contents of 8-bit register AB from the data memory byte addressed by DADDA, using twos complement arithmetic [EA) - [EA) - [AW] Subtract the contents of l6-bit register AW from the l6-bit data memory word addressed by DADDA, using twos complement arithmetic [EA) AND [RB) AND the 8-bit contents of the data memory location addressed by DADDR with the contents of 8-bit register RB. Discard the result, but adjust status flags appropriately ---- I ! I I Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) Statuses G Q. > Mnemonic Operand(s) Object Code Clock Cycles ~ o Operation Performed 0 I T S Z A P C TEST DADDR,RW 85 aareg bbb [DISP][DISP] 9+EA 0 X X U X 0 CDu'a c G CD= .. C CD'CDC XOR RB,DADDR 32 aadddbbb [DISP][DISP] 9+EA 0 X X U X o ~"i e .... XOR RW,DADDR 33 aadddbbb [DISP][DISP] 9+EA 0 X X U X o XOR DADDR.RB 30 aasssbbb [DISP][DISP] 16+EA 0 X X U X 0 XOR DADDR,RW 31 aasssbbb [DISP][DISP] 16+EA 0 X X U X 0 MOV DADDR, DATA8 C6 aaOOObbb [DISP][DISP] yy 10+EA MOV DADDR, DATA16 C7 aaOOObbb [DISP][DISP] YYYY 10+EA MOV RB,DATA8 10110ddd YY 4* MOV RW,DATA16 10111ddd YYYY 4* JMP BRANCH 111010a1 DISP [DISP] 15** JMP BRANCH, SEGM EA PPOO PPOO 15*· JMP DADDR FF aa100bbb [DISP][DISP] 18+EA** _.... a: o >y GI! ~~ ~O ~~ 5e U'CD CD'~ 0 _ C1I c'n 00 ! II :sCD E oS Q. E :s .., [EA] AND [RW] AND the 16-bit contents of the data memory word addressed by DAD DR with the contents of 16-bit register RW. Discard the result, but adjust status flags appropriately [RB] ....... [RB] XOR [EA] Exclusive OR the 8-bit contents of register RB with the data memory byte addressed by DADDR. Store the result in RB [RW] ....... [RW] XOR [EA] Exclusive OR the 16-bit contents of register RW with the 16-bit data memory word addressed by DADDR. Store the result in RW [EA] ....... [RB] XOR [EA] Exclusive OR the 8-bit contents of register RB with the data memory byte addressed by DADDR. Store the result in the addressed data memory byte [EA] ....... [RW] XOR [EA] Exclusive OR the 16-bit contents of register RW with the data memory word addressed by DADDR. Store the result in the addressed data memory word [EA] ....... DATA8 Load the immediate data byte OAT A8 into the data memory byte addressed by DADDR [EA] ....... DATA16 Load the immediate 1 6-bit data word OAT A 16 into the data memory word addressed by DADDR [RB] ....... DATA8 Load the immediate data byte DAT A8 into 8-bit register RB [RW] ....... DATA16 Load the immediate 16-bit data word DATA 16 into 16-bit register RW [PC] ....... [PC] + DISP Jump direct to program memory location identified by label BRANCH. The displacement DISP which must be added to the Program Counter will be computed as an 8-bit or 16-bit signed binary number, as needed, by the assembler [PC] - DATA16, [CS] - DATA16 Jump direct into a new segment. BRANCH is a label which becomes a 16-bit unsigned data value which is loaded into PC. SEGM is a label which becomes another 16-bit unsigned data value that is loaded into the CS segment register [PC] ....... [EA] Jump indirect in current segment. The 16~bit contents of the data memory word addressed by DAD DR is loaded into PC Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) "D. ~ iMnemonic Operandls) Statuses Object Code Clock Cycles JMP DADDR.CS FF aa101bbb [DISP] [DISP] 24+EA" JMP RW FF 11100reg 11 CALL BRANCH E8 DISP DISP 1S"" CALL BRANCH. SEGM SA PPQQ PPQQ 28"" CALL DADDR FF aa010bbb [DISP][DISP] 21 +EA"" CALL DADDR.CS FF aa011bbb [DISP][DISP] 37+EA"" '"S:;, CALL RW FF 11010reg 16"" .&:I RET C3 8"" ...c 0 g a. ..,E:;, c.n m co ~ II: " 'a c ca ii Co) e :;, en RET CS CB 12"" RET DATA16 C2 YYYY 17"" RET CS.DATA16 CA YYYY 18"" o D I TS Operation Performed Z A P C [PC) - [EAI. [CS) - [EA+2) Jump indirect into a new segment. The 16-bit contents of the data memory word addressed by DADDRis loaded into PC. The next sequential 16-bit data memory word's contents is loaded into the CS segment register [PC]- [RW] Jump to memory location whose address is contained in register RW. liSP]] - [PCI. [SP] - [SP] - 2. [PC] - [PC] + DISP Call a subroutine in the current program segment using direct addressing liSP]] - [CSI. [SP] - [SP] -2. liSP]] - [PC]. [SP] - [SP] -2. [PC] DATA16. [CS] - DATA 16 Call a subroutine in another program segment using direct addressing. BRANCH and SEGM are labels that become different 16-bit data words; they are loaded into PC and CS. respectively liSP)) ..... [PC). [SP) - [SP) -2. [PC)- [EA) Call a subroutine in the current program segment using indirect addressing. The address of the subroutine called is stored in the 16-bit data memory word addressed by DADDR IISP]]- [CSI. [SP] - [S2] -2. liSP]] - [PC]. [SP]- [SP] -2. [PC] - [EAI. [CS]- [EA+2] Call a subroutine in a different program segment using indirect addressing. The addre~s of the subroutine called is stored in the 16-bit data memory word addressed by DADDR. The new CS register contents is stored in the next sequential program memory word [SP] - [PC].[SP] - [SP-21. [PC] ..... [RW] Call a subroutine whose address is contained in register RW. [PC] - [[SP]]. [SP] ..... [SP] + 2 Return from a subroutine in the current segment [PC]- [[SP]1. [SP] ..... [SP] +2. [CS]- liSP]]. [SP] ..... [SP] +2 Return from a subroutine in another segment [PC]"'" IISP]]. [SP]- [SP] +2 +DATA16 Return from a subroutine in the current segment and add an immediate displacement to SP [PC]- [[SP)1. [SP) - [SP) +2. [CS)- liSP]]. [SP) ..... [SP) +2 +DATA16 Return from a subroutine in another segment and add an immediate displacement to SP Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) Statuses II a. Mnemonic Operand(s) > Object Code Clock Cycles t- o I T S Z A P C X X X X ADD AL,DATAS 04 yy 4· X X ADD AX,DATA16 05 YYYY 4· X X ADD RB,DATAS SO 11 OOOddd YY 4· X X ADD RW,DATA16 4· X X ADD 17+EA X X 17+EA X X ADe DADDR, DATAS DADDR, DATA16 AL,DATAS S1 11000ddd YYYY SO aaOOObbb [DISP][DISP] YY S1 aaOOObbb [DISP][DISP) YYYY 14 YY 4· X X ADe AX,DATA16 15 YYYY 4· X X ADD ?' ...., Operation Performed O D ADe B,DATAS SO 11010ddd YY 4· X X f G a. ADe RW,DATA16 X X ADe DADDR, DATA8 S1 11010ddd YYYY SO aa010bbb [DISP][DISP] YY 4· !l1li 17+EA X X ADe DADDR, DATA16 S1 aa010bbb [DISP][DISP] YYYY 17+EA X X AND AL,DATAS 24 YY 4· 0 X AND AX,DATA16 25 YYYY 4· 0 X AND RB,DATAS SO 11100ddd YY 4· 0 X AND RW,DATA16 4· 0 X AND DADDR,8 S1 11100ddd YYYY 80 aa100bbb [DISP][DISP] YY 17+EA 0 X AND DADDR, DATA16 17+EA 0 X ! 0 :sG E -E 81 aa100bbb [DISP][DISP] YYYY [AL] - [All + DAT AS Add S-bit immediate data to the AL register X X X X [AX)- [AX) + DATA16 Add 16-bit immediate data to the AX register X X X X [RB) - [RB] + DAT AS Add S-bit immediate data to the RB register X X X X [RW]- [RW] + DATA16 Add 16-bit immediate data to the RW register X X X X [EA] - [EA] + DAT AS Add S-bit immediate data to the data memory byte addressed by DADDR X X X X [EA] - [EA] + DATA16 Add 16-bit immediate data to the data memory word addressed by DADDR X X X X [AL] - [AL] + DAT AS + [e] Add S-bit immediate data, plus carry, to the AL register X X X X [AX]- [AX] + DATA16 + [e] Add 16-bit immediate data, plus carry, to the AX register X X X X [RB] - [RB] + DAT AS + [e] Add S-bit immediate data, plus carry, to the RB register X X X X [RW]- [RW] + DATA16 + [e] Add 16-bit immediate data, plus carry, to the RW register X X X X [EA] - [EA] + DATA8 + [e] Add 8-bit immediate data, plus carry, to the data memory byte addressed by DADDR X X X [EA] - [EA] + DATA16 + [e] Add 16-bit immediate data, plus carry, to the data memory word addressed by DADDR X U X 0 [ALI - [ALI AND DAT AS AND S-bit immediate data with AL register contents X U X 0 [AX]- [AX] AND DATA16 AND 16-bit immediate data with AX register contents X U X 0 [RB] - [RB] AND DAT AS AND 8-bit immediate data with RB register contents X U X 0 [RW]- [RW] AND DATA16 AND 16-bit immediate data with RW register contents X U X 0 [EA] - [EA] AND DAT A8 AND 8-bit immediate data with contents of data memory byte addressed by DADDR X U X 0 [EA]- [EA] AND DATA16 AND 1 6-bit immediate data with contents of 1 6-bit data memory word addressed by DADDR Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) Statuses G) CL >- Mnemonic Operand(s). Object Code Clock Cycles ~ ;:; G) :I cr """ ~ I T S Z Al,DATA8 3C YY 4· X X X CMP AX,DATA16. 3D YYYY 4· X X X CMP RB,DATA8 80 11111 ddd YY 4· X X CMP RW,DATA16t 4· X X X CMP DADDR, DATA8 100000a1 1111ddd YY [YY) 80 aa111bbb [DISP)[DISP] YY 10+EA X X X CMP DADDR, DATA16 10+EA X X X OR Al,DATA8 100000a1 aa111bbb [DISP)[DISPI'YY\[YY] OC YY 4· 0 X OR AX,DATA16· 00 YYYY 4· 0 X X OR RB,DATA8 80 11001ddd YY 4· 0 X OR RW,DATA16 81 11001ddd YYYY 4· 0 X X OR DADDR, DATAS 80 aa001bbb [DISP)[DISP] YY 17+EA 0 X OR DADDR, DATA16 17+EA 0 X X SBB Al.DATAS 81 aa001bbb [DISP)[DISP) YYYY 1C YY 4· X X X SBB AX,DATA16: 10 YYYY 4· X. X X, 0 CL D CMP 'Sc g ! I! G) 0 X X 0 !III X :s G) e .5 X Operation Performed A P C X X X [All - DATA8 Subtract 8-bit immediate data from Al register contents. Discard result, but adjust status flags X X X [AX] - DATA16 Subtract 16-bit immediate data from AX register contents. Discard result, but adjust status flags X X X [RB] - DATA8 Subtract S-bit immediate data from RB register contents. Discard result, but adjust status flags X X X [RW] - DATA16 Subtract 16-bit immediate data from RW register contents. Discard result, but adjust status flags X X X [EA] - DATA8 Subtract 8-bit immediate data from contents of data memory byte addressed by DADDR. Discard result, but adjust status flags X X x. [EA] - DATA16 Subtract 16-bit immediate data from contents of 16-bit data memory word addressed by DADDR. Discard result, but adjust status flags U X o [All - [All OR OAT A8 OR 8-bit immediate data with Al register contents U X 0 [AX] - [AX] OR DATA16 OR 16-bit immediate data with AX register contents U X 0 [RB] - [RB] OR OAT A8 OR 8-bit immediate data with RB register contents U X 0 [RW]- [RW] OR DATA 16 OR 16-bit immediate data with RW register contents U' X 0 [EA] - [EA] OR DATA S OR S-bit immediate ata with contents of data memory byte addressed by DADDR U X 0 [EA] - [EA] OR DATA16 OR 16-bit immediate data with contents of 16-bit data memory word addressed by DADDR X X X [Al] - [Al] - OAT A8 - [e] Subtract S-bit immediate signed binary data from Al register contents using twos complement arithmetic. If the Carry status was originally 1 decrement the result X X X [AX) - [AX) - OATA16 - [C) Subtract 16-bit immediate signed binary data from AX register contents using twos complement arithmetic. If the Carry status was originally 1 decrement the result I I Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) Statuses II Q. > Mnemonic Operand(s) ... Object Code Clock Cycles Operation Performed 0 I D T S Z A P C X X SBB RB,DATA8 80 11011ddd YY 4' X X X X SBB RW,DATA16 100000al 11011ddd yy [YY] 4' X X X X X SBB DAD DR, DATA8 80 aaOllbbb [DISP)[DISP] YY 17+EA X X SBB DAD DR, DATA16 100000al aaOl1bbb [DISP)[DISP)YY [YY) 17+EA X X X X X SUB AL,DATA8 2C YY 4' X X X X X SUB AX,DATA16 2D YYYY 4' X X X X X SUB RB,DATA8 80 lll01ddd YY 4" X X X X X SUB RW,DATA16 81 11101ddd YYYY 4' X X X X X SUB DADDR, DATA8 80 aal0lbbb [DISP)[DISP] YY 17+EA X X X X X SUB DADDR, DATA16 100000al aal 01 bbb [OISP][DISP]YY [YY] 17+EA X X A8 YY 4' ~ X X X G) :I 'Sc Cf' -..J y '" $ fG) 0 Q. 0 $ III :s G) E .5 TEST AL,DATA8 X X X 0 X X U X [RB) +- [RB) - DAT A8 - [C) Subtract 8-bit immediate signed binary data from RB register contents using twos complement arithmetic. If the Carry status was originally 1 decrement the result X [RW] +- [RW] - DATA 16 - [C] Subtract 16-bit immediate signed binary data from RW register contents using twos complement arithmetic. If the Carry status was originally 1 decrement the result X [EA] +- [EA] - DATA8 - [e] Subtract 8-bit immediate signed binary data from contents of data memory byte addressed by DAD DR using twos complement arithmetic. If the Carry status was originally 1 decrement the result X [EA] +- [EA] - DATA 16 - [e] Subtract 16-bit immediate signed binary data from contents of l6-bit data memory word addressed by DADDR using twos complement arithmetic. If the Carry status was originally 1 decrement the result X [ALI +- [ALI - DA T A8 Subtract the 8-bit immediate signed binary data from AL register contents using twos complement arithmetic X [AX] +- [AX] - DATA16 Subtract the 16-bit immediate signed binary data from AX register contents using twos complement arithmetic X [RB] +- [RB] - DA T A8 Subtract the 8-bit immediate signed binary data from RB register contents using twos complement arithmetic X [RW] +- [RW] - DATA16 Subtract the 16-bit immediate signed binary data from RW register contents using twos complement arithmetic X [EA] +- [EA] - DA T A8 Subtract the 8-bit immediate signed binary data from the contents of the data memory byte addressed by DADDR using twos complement arithmetic X [EA] +- [EA] - DATA 16 Subtract the 16-bit immediate Signed binary data from the contents of the 16-bit data memory word addressed by DADDR using twos complement arithmetic 0 [All AND DAT A8 AND the 8-bit immediate data and AL register contents. Discard the result but adjust status s -- Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) ! Statuse, Mnemonic Operand(s) . Object Code, Clock Cycles ~ ;:; Q) ~ 0 Operation Performed D I T S Z A P C· TEST AX,DATA16 AS YYYY 4- 0 X X U X 0 TEST RB,DATAS F6 11 OOOddd YY 5- 0 X 0 TEST RW,DATA16 F7 11000ddd YYYY 5- 0 X X U X 0 TEST DADDR, DATAS F6 aaOOObbb [DISP][DISP] YY 11+EA 0 X X U X 0 TEST DADDR, DATA16 F7 aaOOObbb [DISP][DISP] YYYY 11+EA 0 X X U X 0 XOR AL,DATA8 34 YY 4- 0 X X U X 0 XOR AX,DATA16 35 YYYY 4- 0 X. X U X 0 XOR RB,DATAS SO 1111 Oddd YY 4- 0 X X U X 0 XOR RW,DATA16 4- 0 X X U X XOR DADDR, DATAS S1 11110ddd YYYY SO aa010bbb [DlsP][DISP] YY 17+EA 0 X X U X 0 XOR DADDR, DATA16 81 aa010bbb [DISP][DISP] YYYY 17+EA 0 X X U X 0 LOOP DISPS E2 DISP 5 or 17-- LOOPE DISP8 E1 DISP 6 or 1S-- LOOPNE DlsPS EO DlsP 5 or 1S-- LOOPNZ LOOPZ JA DIsP8 DlsPS DISP8 77 DISP 4 or 16-- ..;c g o $ X U X IV Ii~ c.n ..:... w 0 $ IV :s Q) E .E c ~ :sc 0 (.) c 0 ~ u c I! ID 0 [AX] AND DATA16 AND the 16-bit immediate data and AX register contents. Discard the result but adjust status flags [RB] AND OAT AS AND the S-bit immediate data and RB register contents. Discard the result but adjust status flags [RW] AND DATA16 AND the 16-bit immediate data and RW register contents. Discard the result but adjust status flags [EA] AND OAT AS AND the 8-bit immediate data and the contents of the data memory location addressed by DADDR. Discard the result but adjust status flags [EA] AND DATA16 AND the 16-bit immediate data and the contents of the 16-bit data memory word addressed by DADDR. Discard the result but adjust status flags [All - [All XOR OAT A8 Exclusive OR 8-bit immediate data with AL register contents [AX] - [AX] XOR DATA16 Exclusive OR 16-bit immediate data with AX register contents [REt] - [RB] XOR OAT AS Exclusive OR 8-bit immediate data with RB register contents {RW]- [RW] XOR DATA16 Exclusive OR 16-bit immediate data with RW register contents [EA] - [EA] XOR OAT AS Exclusive OR S-bit immediate data with contents of the data memory byte addressed by DADDR [EA] - [EA] XOR DATA16 Exclusive OR 16-bit immediate data with contents of the 16-bit data memory word addressed by DADDR [eX] - [CX] -1 If [CX] i= 0 then [PC] - [PC] + DISPS Decrement CX register and branch if CX contents are not 0 [CX] - [CX] -1 If [CX] i= 0 and [Z] = 1 then [PC] + DlsPS Decrement eX register and branch if CX contents is not 0 and Z status is 1 [CX] - [CX] -1 If [CX] i= 0 and [Z] = 0 then [PC] - [PC] + DISP8 Decrement CX register and branch if CX contents is not 0 and Z status is 0 See LOOPNE See LOOPE [PC] - [PC] + DISPS Branch if C or Z is 0 Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) Statuses CD a. > Mnemonic Operand(s) Object Code Clock Cycles ~ -:aCD .. :::s c c C11 I -.,j ~ JAE DISPB 73 DISP 4 or 16" JB DISPB 72 DISP 4 or 16" JBE DISPB 76 DISP 4 or 16" JCXZ DISPB E3 DISP 6 or lS" JE DISP8 74 DISP 4 or 16" JG DISPS 7F DISP 4 or 16" JGE DISPB 7D DISP 4 or 16" JL DISPB 7C DISP 4 or 16" JLE DISPB 7E DISP 4 or 16" JNA JNAE JNB JNBE JNE DISPB DISP8 DISP8 DISP8 DISP8 75 DISP 4 or 16" JNG JNGE JNL jnle JNO DISP8 DISP8 DISPS disp8 DISP8 71 DISP 4 or 16" JNP DISP8 7B DISP 4 or 16" JNS DISP8 79 DISP 4 or 16" JNZ JO DISPS DISP8 70 DISP 4 or 16"" JP DISP8 7A DISP 4 or 16" JPE DISP8 0 g c ~ :ac 0 u c 0 s:u c f l1li Operation Performed 0 0 I T S Z A P C [PC] +- [PC] + DISPS Branch if C is 0 [PC] + - [PC] + DISP8 Branch if C is 1 [PC] +- [PC] + DISPS Branch if C or Z is 1 [PC] + - [PC] + DISP8 Branch if the CX register contents is 0 [PC] + - [PC] + DISPS Branch if Z is 1 [PC] + - [PC] + DISPS Branch if Z is 0 or the Sand 0 statuses are the same [PC] + - [PC] + DISPS Branch if the Sand 0 statuses are the same [PC] + - [PC] + DISPB Branch if the Sand 0 statuses differ [PC] + - [PC] + DISPS Branch if Z is 1 or the Sand 0 statuses differ See JBE See JB See JAE See JA [PC] + - [PC] + DISP8 Branch if Z is 0 See JLE See JL See JGE See JG [PC] + - [PC] + DISP8 Branch if 0 is 0 [PC] + - [PC] + DISP8 Branch if P is 0 [PC] +- [PC] + DISP8 Branch if S is 0 See JNE [PC] +- [PC] + DISPS Branch if 0 is 1 [PC] + - [PC] + DISP8 Branch if P is 1 See JP -- Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) Statuses CD a. > Mnemonic Operand Is) Object Code Clock Cycles ~ ..,l JPO 0lSP8 0 JS 0lSP8 JZ DlSP8 MOV CD .. c Operation Performed 0 D I T S Z A P C See JNP [PC] ...... IPC] + 0lSP8 Branch if S is 1 See JE 780lSP 4 or 16" RBO.RBS 8A11dddsss 2' MOV RWO.RWS 8B 11dddsss 2' 2 ! MOV SR.RW 8E 11 Orrsss 2' '61 MOV RW.SR 8C 110rrddd 2' XCHG AX.RW 10010reg 3' XCHG RB.RB 86 11 regreg 4' XCHG RW.RW 87 11regreg 4' CMPS BO.BS A6 22 X I/O X CMPS WO.WS A7 22 X /0 X X X X LOOS BO.BS AC 12 I/O . LOOS WO.WS AO 12 I/O I! MOVS BO.BS A4 18 I/O MOVS WO.WS A5 18 I/O 9 (,) 0 ID > 0 II) CD [RBO] ...... [RBS] Move the contents of any RB register to any RB register [RWO] ...... [RWS] Move the contents of any RW register to any RW register [SR] ...... [RWS] Move the contents of any RW register to any Segment register [RWO] ...... [SR] Move the contents of any Segment register to any RW register [AX] ...... - [RW] Exchange the contents of AX and any RW register [RB] ...... - [RB] Exchange the contents of any two RB registers [RW] ...... - [RW] Exchange the contents of any two RW registers a:: . I ! II) '61 CD a:: CTI ~ CTI ~ ~ II II CI) "tI c II -!c ~ ~ u 0 iii [[SI11 - [[01]]. [SIl ...... [SIl ± 1. [Oil ...... [Oil ± 1 Compare the data bytes addressed by the SI and 01 Index registers using string data addressing' X [[5111 - [[01]1. [SIl ...... [SIl ± 2. [01] ...... [Oil ± 2 Compare the 16-bit data words addressed by the 51 and 01 Index registers using string data addressing' [All ...... [[5111. [SIl ...... [SIl ± 1 Move a data byte from the location addressed by the 51 Index register to the AL register using string data addressing [AX] ...... [[5111. [SIl ...... [SIl ± 1 Move a data word from the 16-bit location addressed by the 51 Index register to the AX register using string data addressing [[0111 ...... [[51]]. [SIl ...... [SIl ± 1. [01]""" [Oil ± 1 Move a data byte from the location addressed by the 51 Index register to the extra segment location addressed by the 01 register using string data addressing' [[Olll ...... [[5111. [SIl ...... [51] ± 2. [01] ...... [Oil ± 2 Move a 1 6-bit data word from the location addressed by the 51 Index register to the extra segment location addressed by the 01 Index register using string data addressing' • For these instructions. the default destination segment register cannot be overri,den. X X X X Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) CD ...~ Statuses Mnemonic Operand(s) Object Code Clock Cycles Operation Performed 0 0 I T S Z A P C REP N 1111001z +2 per loop SCAS BO,BS AE 15 X I/O X SCAS WO,WS AF 15 X I/O X X X X X STOS BO,BS AA 11 X I/O X X X X X STOS WO,WS AB 11 X I/O X X X X X AOC RBO,RBS 12 11dddsss 3' X X X X X X AOC RWO,RWS 13 11 dddsss . 3' X X X X X X . ADD RBO.RBS 02 11dddsss 3' X X X X X X ADD RWO.RWS 03 11dddsss 3' X X X X X X & 0 ... AND RBO.RBS 22 11dddsss 3' 0 X X U o '51 AND RWO.RWS 23 11dddsss 3' 0 X X U X 0 98 2' X X I/O ;; CD ~ ~c 0 .g .c X X X X 2 a! CD en 'a C a! • '; c ! ~ ~ u 0 iii cr en """ CD ! !1ft CD X a: I ! CBW 1ft '51 CD X CMP RBO.RBS 3A 11dddsss 3' X X X eMP RWO.RWS 3B 11dddsss 3' X X X X X X 99 5 a: CWO Repeat the next sequential instruction (which must be a Block Transfer and Search instruction) until CX contents decrements to O. Decrement CX contents on each repeat. If the next instruction is CMPB, CMPW, SCAB, or SCAW then repeat until CX contents decrements to 0 or Z status does not equal N [AL] - [[Dill, [Oil - [Oil ± 1 Compare AL register contents with the extra segment data byte addressed by the 01 Index register using string data addressing [AX] - [[Dill, [Oil - [Oil ± 2 Compare AX register contents with the extra segment 1 6-bit data ord addressed by the 01 Index register using string data addressing [[0111 - [AL), [Oil - [Oil ± 1 Store the AL register contents in the extra segment data memory byte addressed by the 01 Index register using string data addressing [[0111 - [AXI. [Oil - [Oil ± 2 Store the AX register contents in the extra segment 16-bit data memory word addressed by the 01 Index register using string data addressing [RBO) - [RBO] + [RBS) + [C] Add the 8-bit contents of register RBS, plus the Carry status, to register RBO [RWO) - [RWO] + [RWS] + [C] Add the 16-bit contents of register RWS. plus the Carry status. to register RWO [RBO) - [RBO] + [RBS) Add the 8-bit contents of register RBS to register RBO [RWO) - [RWO) + [RWS) Add the 16-bit contents of register RWS to register RWO [RBO] - [RBO] AND [RBS] AND the 8-bit contents of register RBS with register RBO [RWO] - [RWO] AND [RWS) AND the 1 6-bit contents of register RWS with register RWO [AH]- [AL7) Extend AL sign bit into AH [RBO] - {RBS] Subtract the contents of register RBO from register RBS. Discard the result. but adjust status flags [RWO] - [RWS] Subtract the contents of register RWO from register RWS. Discard the result, but adjust status flags [OX) - [AX15) Extend AX sign bit into OX - - Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) • ...> ~ Statu.e. !Mnemonic Operand(.) Object Code Clock Cycle. o Operation Performed D I T S Z A P C OIV RBS F6 11110555 80-90 U U U U U u DIV RWS F7 1111 Osss 144-162 U U U U U u IDIV RBS F6 11111 sss 101-112 U U U U U U IOIV RWS F7 11111 sss 165-184 U U U U U U IMUL RBS F6 11101 sss 80-98 X U U U U X IMUL RWS F7 11101 sss 128-154 X U U U U X, MUL RBS F6 11100sss 70-17 X U U U U MUL RWS F7 11100sss 118-133 X U. U UU X OR RBD.RBS OA 11dddsss 3" 0 X X U X 0 OR RWD.RWS OB l1dddsss 3" 0 X X U X 0\ ~ • ~ 'Sc 0 cr "" g ! \!! • CL .. 0 ! II) '81 • II: .. ! I II) '81 • II: X [AX] +- [AX]/[RBS] Divide the 16-bit contents of AX by the 8-bit contents of RBS. Store the integer quotient in AL and the remainder in AH. If the quotient is greater than FF16. execute a "divide by 0" interrupt [DX) [AX) +- [DX) [AX)/[RWS] Divide the 32-bit contents of registers DX (high-order) and AX (low-order) by the 16-bit contents of RWS. Store the integer quotient in AX and the remainder in DX. If the quotient is greater than FFFF16. execute a "divide by 0" interrupt [AX] +- [AX]/[RBS] Divide the 16-bit contents of register AX by the 8-bit contents of RBS. treating both contents as signed binary numbers. Store the quotient. as a signed binary number. in AL. Store the remainder. as an unsigned binary number. in AX. Store the remainder. as an unsigned binary number. in AH. If the quotient is greater than 7F16. or less than -8016. execute a "divide by 0" interrupt [OX] [AX] +- [OX] [AXlI[RWS] Divide the 32-bit contents of registerl>X (high-order) and AX (low-order) by the 16-bit contents of RWS. Treat both contents as signed binary numbers. Store the quotient. as a signed binary number. in AX. Store the remainder. as an unsigned binary number. in AH. If the quotient is greater than 7FFF16. or less than -800016. execute a "divide by 0" interrupt [AX) +- [AL) " [RBS) Multiply the 8-bit contents of register AL by the contents of RBS. Treat both numbers as signed binary numbers. Store the 16-bit product in AX [DX) [AX) +- [AX)" [RWS) Multiply the 16-bit contents of register AX by the 16-bit contents of RWS. Treat both numbers as signed binary numbers. Store the 32-bit product in DX (high-order word) and AX (low-order word) [AX] - [AL] " [RBS] Multiply the 8-bit contents of register AL by the contents of RBS. Treat both numbers as unsigned binary numbers. Store the 16-bit product in AX [DX) [AX) - [AX] .. [RWS) Multiply the l6-bit contents of register AX by the 16-bit contents of RWS. Treat both numbers as unsigned binary numbers. Store th,e 32-bit product in DX (high-order word) and AX (low-order word) [RBD] - [RBD] OR [RBS] OR the 8-bit contents of register RBS with register RBD [RWD]- [RWD] OR [RWS] OR the l6-bit contents of register RWS with register RWD Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) t> t- ~ Statuses Mnemonic Operand(s) Object Code Clock Cycles Operation Performed O 0 I T S Z A P C SBB RBD.RBS lA lldddsss 3' X X X X X X SBB RWD.RWS lB lldddsss 3' X X X X X X SUB RBD.RBS 2A lldddsss 3' X X X X X X SUB RWD.RWS 2B 11 dddsss 3' X X X X X X TEST RBD.RBS 8411regreg 3' 0 X TEST RWD.RWS 85 11 regreg 3' 0 X X U X XOR RBD.RBS 30 lldddsss 3' 0 X X U X 0 XOR RWD.RWS 31 lldddsss 3' 0 X X U X AAA 37 4' U U U X U X AAD D50A SO U X X U X AAM D40A 83 U X X U X U AAS 3F 4· U U U X DAA 27 4' U X X X X X DAS 2F 4' U X X X X X CD :::I ~c 0 g ! f CD a. 0 ... !III "61 X U X 0 CD II: ...I $ III 0 "61 cr..... Q) II: co ! f Q) a. 0 U U X 0 ! III "61 CD II: DEC RB FE 11001ddd 3' X X X X X DEC RW 01001ddd 2' X X X X X [RBD) - [RBD) - [RBS) ~ [C) Subtract the 8-bit contents of register RBS from RBD using twos complement arithmetic. If the Carry status was originally 1 decrement the result [RWD) - [RWD) - [RWS) - [C) Subtract the lS-bit contents of register RWS from RWD using twos complement arithmetic. If the Carry status was originally 1 decrement the result [RBD) - [RBD) - [RBS) Subtract the 8-bit contents of register RBS from RBD using twos complement arithmetic [RWD) - [RWD) - [RWS) Subtract the lS-bit contents of register RWS from RWD using twos complement arithmetic [RBD) AND [RBS) AND the a-bit contents of register d and register RBS. Discard the result. but adjust status flags [RWD) AND [RWS) AND the lS-bit contents of register RWD and register RWS. Discard the result. but adjust status flags [RBD) - [RBD) XOR [RBS) E~clusi~e OR the 8-bit contents of register RBS with register RBD [RWD) - [RWD) XOR [RWS) ~xclusive OR the 16-bit contents of register RWS with register RWD ASC" adjust AI register contents for addition (as described in accompanying text) Decimal adjust dividend in AL prior to dividing an unpacked decimal divisor. to generate an unpacked decimal quotient. (See accompanying text for details) After multiplying 0 unpacked decimal operands. adjust product in AX to become an unpacked decimal result. (See accompanying text for details) After subtracting two unpacked decimal numbers. adjust the difference in AL so that it too is an unpacked decimal number. (See accompanying text for details) After adding two packed decimal numbers. adjust the sum in AL so that it too is a packed decimal number. (See accompanying text for details) After subtracting two packed decimal numbers. adjust the difference in AL so that it too is a packed decimal number. (See accompanying text for details) [RB] - [RB] -1 Decrement the 8-bit contents of register RB [RW) - [RW) -1 Decrement the 1S-bit contents of register RW Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) Statuses GJ ~ Mnemonic Operand(s) t- -:aGJ :::s c "+l 1! II a. .. ! 0 cr ..... co 1/1 "61 II a: Clock Cycles Operation Performed O 0 INC RB FE 11000ddd 3- X, INC RW 01000ddd 2- X NEG RB F611011ddd 3- X NEG RW F7 11011ddd 3- X NOT RB F6 11010ddd 3- RW F7 11010ddd RCL RCL RCR RCR ROL ROL ROR ROR SAL SAL SAR SAR SHL SHL SHR SHR RB,N RW,N RBN RW,N RB,N RW,N RB,N RW,N RB,N RW,N RB,N RW,N RB,N RW,N RB,N RW,N ~ 10100vO 11010ddd ~10100v1 11010ddd POP DADDR SF aaOOObbb [DISP][DISP] 17+EA POP POP RW SR 01011ddd 000rr111 8 a 90 8. FF aa1l0bbb [DISP][DISP] 16+EA ~ 10100vO 11011ddd ~ 10100vl 110l1ddd 110100vO 110100v1 110100vO ~ 10100v1 110100vO ~ 10l00v1 110100vO ~ 10100v1 11 OOOddd 11000ddd 11001ddd 11001ddd 11100ddd 11100ddd f1111ddd 1llllddd 110100vO 11101ddd ~ 10100vl 1ll0lddd I T S Z A P C X X X X [RB] - [RB] + 1 Increment the a-bit contents of register RB [RW] - [RW] + 1 X X X X Increm..!!!! the 16-bit contents of register RW X X X X X [RB] - [RB] + 1 Twos ~Iement the a-bit contents of register RB X X X X X [RW] - [RW] + 1 Twos complement the 16-bit contents of register RW [RB] - 3- NOT C 0 g S Object Code N=1 2N>1 4N+8 N=l 2N>1 4N+8 X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X U U U U U U U U X X X X X X· X X ~ u S en POPF PUSH DADDR X X X X X_ .X XX X X X X X X X X X X X X X X X X [RBi Ones c Mnemonic Operand(s) Object Code Clock Cycles I- ....c Operation Performed 0 PUSH PUSH RW SR 01010rrr 000rr110 PUSHF 9C 10 INT INT INTO 3 V CC CD YY CE 52 51 4 or 53 IRET CF 24 CLC Fa 2· CLD FC 2· CLI FA 2· CMC F5 2· LAHF 9F 4· 0 I T S Z A P C [SP) +- [SP) -2, [(SPII +- [RW or SR) Store the contents of the specified 1 6-bit register in the 16-bit Stack word addressed using Stack addressing. Decrement SP by 2 [SP) +- [SP) +2, [[SPII - [SFR) Store the Status flags register contents in the 16-bit Stack word addressed using Stack addressing. Decrement SP by 2 11 10 0 g ~ u ca U; J!! a. E ! .E U1 cO o 0 0 0 Execute a software interrupt and vector through table entry 3 Execute a software interrupt and vector through table entry V If the 0 status is 1, execute a software interrupt and vector through table entry 1016 Return from interrupt service routine 0 0 0 [C)-O Clear Carry status [0)-0 Clear Decrement/Increment select (1)-0 Clea!:..!r'terrupt enable status, disabling all interrupts X [C) -[C) Complement Carry status Transfer flags to AH register as follows: 0 0 0 7 6 5 4 3 2 1 0 S Z 0 A 0 P I C I I I II I III Bit no. AH register 1/1 af! U) SAHF 9E 4· X X X X X Transfer AH register contents to status flags as follows: 7 6 5 4 3 2 1 I IIIII II S STC F9 2· STD FD 2· STI FB 2· 1 1 Z A P 0 Bit no. IAH register C 1 [C)-1 Set Carry status to 1 (0)-1 Set Decrement/Increment status to 1 (1)-1 Set interrupt enable status to 1, enabling all interrupts Table 5-4. A Summary of 8086 and 8088 Instructions (Continued) II a. IMnemonlc! Operand(s) >- Statuses Object Code ESC ~ -S DADDA HI-T LOCK 0 11011xxx aaxxxbbb [DISP][DISP) F4 FO 8+EA 001reg110 +2 98 90 3+5n 3" 2" 2" 0 SEG WAIT NOP SA Operation Performed Clock Cycles I- D I T S Z A P C 7 - [EA) The contents of the data memory location addressed by DADO A is read out of memory and placed on the data bus; however, it is not input to the CPU CPU Halt Guarantee the CPU bus control during execution of the next sequential instruction The next sequential allowed memory reference instruction accesses the segment identified by Segment register SA. See Table 20-1 for allowed memory reference instructions CPU enters the WAIT state until TEST pin receives a high input signal No operation (This is the same object code as XCHG, AX, AX.) C11 ~ i I I Table 5-5. 8086 and 8088 Instruction Mnemonics Object Code Bytes Clock Periods 37 D50A D40A 3F 14 YY 15 YYYY SO aa010bbb [DISP) [DISP) YY 1 OOOOOa 1 aaO 1Obbb [DISP) [DISP) YY[YY) 10 aasssbbb [DISP) [DISP) 11 aasssbbb [DISP) [DISP) 12 aadddbbb [DISP) [DISP) SO 11010ddd YY 12 11dddsss 13 aadddbbb [DISP) [DISP) 100000a111010ddd YY[YY) 13 11dddsss 04 YY 05 YYYY SO aaOOObbb [DISP) [DlSP] YY 1OOOOOa 1 aaOOObbb [DISP) [DISP) YY[YY) 00 aasssbbb [DISP) [DISP) 01 aasssbbb [DISP) [DISP) 02 aadddbbb [DISP) [DlSP] SO 11 OOOddd YY 02 11dddsss 03 aadddbbb [DISP) [DISP) 100000a1 11000ddd YY[YY) 03 11dddsss 24 YY 25 YYYY SO aa100bbb [DISP) [DISP) YY 81 aa100bbb [DISP) [DISP] YYYY) 20 aasssbbb [DISP] [DISP] 21 aasssbbb [DISP) [DISP] 22 aadddbbb [DISP) [DISP] SO 111 OOOdddYY 22 11dddsss 1 2 2 1 2 3 3,4 or 5 460 S3 44417+EA 3,4,5 or 6 17+EA 2,3, or 4 16+EA 2,3 or 4 16+EA 2,3 or 4 9+EA 3 2 2,3 or 4 439+EA 3 or 4 4- 2 2 3 3,4 or 5 34417+EA 3,4,5 or 6 17+EA 2,3 or 4 16+EA 2,3 or 4 16+EA 2,3 or 4 9+EA 3 2 2,3 or 4 4" 3" 9+EA 3 or 4 4" 2 2 3 3,4 or 5 3" 4" 4" 17+EA 4,5 or 6 17+EA Instruction AAA AAD AAM AAS ADC ADC ADC AL,DATAS AX,DATA16 DADDR,DATAS ADC DADDR,DAT A 16 ADC DADDR,RB ADC DADDR,RW ADC RB,DADDR ADC ADC ADC RB,DATAS RBD,RBS RW,DADDR ADC RW,DATA16 ADC ADD ADD ADD RWD,RWS AL,DATAS AX,DATA16 DADDR,DAT AS ADD DADDR,DAT A 16 ADD DADDR,RB ADD DADDR,RW ADD RB,DADDR ADD ADD ADD RB,DATAS RBD,RBS RW,DADDR ADD RW,DATA16 ADD AND AND AND RWD,RWS AL,DATAS AX,DATA16 DADDR,DATAS AND DADDR,DAT A 1"6 AND DADDR,RB AND DADDR,RW AND RB,DADDR AND AND RB,DATAS RBD,RBS 5-82 2; 3 or 4 16+EA 2,3 or 4 16+EA 2,3 or 4 9+EA 3 23- 4" Table 5-5. 8086 and 8088 Instruction Mnemonics (Continued) Instruction AND RW,DADDR AND AND CALL CALL CALL RW,DATA16 RWD,RWS SRANCH BRANCH,SEGM DADDR CALL DADDR,CS CALL CBW CLC CLD CLI CMC CMP CMP CMP RW AL,DATAS AX,PATA16 DADDR,DAT A8 CMP DADDR,DAT A 16 CMP DADDR,RB CMP DADDR,RW CMP RB,DADDR CMP CMP CMP RB,DATAS RBD,RBS RW,DADDR CMP RW,DATA16 CMP CMPS CMPS CWO DAA DAS DEC RWD,RWS BD,BS WD,WS DEC DEC DIV (S-bit) RB RW AX,DADDR DIV (16-bit) DX,DADDR DIV DIV ESC RBS RWS DADDR ESC HLT RW DADDR Clock Periods Object Code Bytes 23 aadddbbb [DISP) [DISP) S1 11100sss YYYY 23 11dddsss ES DISP DISP 9A PPOOPPOO FF aa010bbb [DISP) [DISP) FF aa011 bbb [DISP) [DISP) FF 11010reg 9S FS FC FA F5 3C YY 3D YYYY SO aalll bbb [DISP) [DISP) YY 1 OOOOOa 1 aa 11 bbb [DISP) [DISP) YY[YY) 3S aasssbbb [DISP) [DISP) 39 aasssbbb [DISP] [DISP] 3A aadddbbb [DISP] [DISP) SO 11 111 ddd YY 3A l1dddsss 3B aadddbbb [DISP] [DISP] 1OOOOOa 1 11111 ddd YY[YY] 3B l1dddsss A6 A7 99 27 2F 1111 lllaa aaOOlbbb [DISP) [DISP] FE 11001ddd 01001ddd F6 aa110bbb [DISP] [DISP] F7 aal10bbb 2,3 or 4 9+EA 4 2 3 5 2,3 or 4 4319-2S-21+EA 2,3 or 4 37+EA-- 2 1 1 1 1 1 2 3 3,4 or 5 16-2 22224410+EA 3,4,5 or 6 10+EA 2,3 or 4 9+EA 2,3 or 4 9+EA 2,3 or 4 9+EA 3 2 2,3 or 4 439+EA 3 or 4 4- 2 1 1 1 1 1 2,3 or 4 322 22 5 4415+EA 2 1 2,3 or 4 32(S6-96)+EA 2,3 or 4 (150-16S)+EA 2 2 2,3 or 4 80-90 144-162 8+EA 2 1 2 2- [DISP] [DISP] F6 11110sss F7 11110sss 11 011 xxx aaxxxbbb [DISP) [DISP] 11011 xxx 11xxxreg F4 5-83 Table 5-5. 8086 and 8088 Instruction Mnemonics (Continued) Instruction IDIV AX.DADDR IDIV DX.DADDR IDIV IDIV IMUL RBS RWS AL.DADDR IMUL AX.DADDR IMUL IMUL IN IN IN IN INC RBS RWS AL[DX] AL.PORT AX.[DX) AX.PORT DAD DR INC INC INT INT INTO IRET JA/JNBE JAE/JNB JB/JNAE JBE/JNA JCXZ JE/JZ JG/JNLE JGE/JNL JL/JNGE JLE/JNG JMP JMP JMP RB RW 3 V DISP8 DISP8 DISP8 DISP8 DISPS DISPS DISPS DISPS DISPS DISPS BRANCH BRANCH.SEGM DADDR JMP DADDR.CS JMP JNE/JNZ JNO JNP/JPO JNS JO JP/JPE JS LAHF LOS RW DISPS DISPS DISPS DISP8 DlSPS DISPS DISPS LEA RW.DADDR LES RW.DADDR LOCK RW.DADDR Object Code FS aa111bbb [DISP) [DISP) F7 aa111 bbb [DISP) [DISP) FS 11111sss F7 11111 SSS FS aa101bbb [DISP) [DISP] F7 aa101bbb [DISP) [DISP) FS 11101sss F711101sS5 EC E4 YY ED E5 YY 1111111 a aaOOObbb [DISP) [DISP] FE 11000ddd 01000ddd CC CD YY CE CF 17 DISP 73 DISP 7i DISP 7 DISP 63DISP 74DISP 7F DISP 7DDISP 7C DISP 7E DISP 111010a 1 DISP [DISP) EA PPOO PPOO FF aa100bbb [DISP) [DISP] FF aa101bbb [DISP] [DISP) FF 11100reg 75DISP 71DISP 6S DISP 79DISP 70DISP 7A DISP 7S DISP 9F C5 aadddbbb [DISP] [DISP] SO aadddbbb [DISP) [DISP) C4 aadddbbb [DISP] [DISP] FO 5-84 Bytes Clock Periods 2.3 or 4 (107-118)+EA 2.3 or 4 (171-190)+EA 2 2 2.3 or 4 101-112 165-184 (8S-104)+EA 2.3 or 4 (134-1S0)+EA 2 2 1 2 1 2 2.3 or 4 80-98 128-154 8 10 8 10 15+EA 2 1 1 2 1 1 2 2 2 2 2 2 2 2 2 2 2 or 3 5 2.3 or 4 3 2 52 51 4 or 53 24 4 or 1s 4 or 16. 4 or 1s 4 or 1S· S or 18. 4 or 1s 4 or 1S· 4 or 1S· 4 or 1s 4 or 1S· 15" 15 1S+EA 23 or 4 24+EA 2 2 2 2 2 2 2 2 1 2.3 or 4 0 0 00 0 00 0 0 00 0 0 00 0 00 4 4 4 4 4 4 4 11 or 1S· or 16 or 1S· or 1s or 1s or 1s or 1s 4 16+EA 0 00 0 00 00 00 00 0 2.3 or 4 2+EA 2.3 or 4 4 or 16 1 2 0 00 Table 5-5. 8086 and 8088 Instruction Mnemonics (Continued) Instruction LODS LODS LOOP LOOPE/LOOPZ LOOPNE/LOOPNZ MOV MOV MOV BS WS DISP8 DISP8 DISP8 AL.LABEL AX. LABEL DADDR.DAT A8 MOV DADDR.DAT A 16 MOV DADDR.RB MOV DADDR.RW MOV DADDR.SR MOV MOV MOV LABEL.AL LABEL.AX RB.DADDR MOV MOV MOV RB.DATA8 RBD.RBS RW.DADDR MOV MOV MOV MOV RW.DATA16 RW.SR RWD.RWS SR.DADDR MOV MOVS MOVS MUL (8-bit) SR.RW BD.BS WD.WS AL.DADDR MUL (16-bit) AX.DADDR MUL MUL NEG RBS RWS DADDR NEG NEG NOP NOT RB RW NOT NOT OR OR OR RB RW AL.DATA8 AX.DATA16 DADDR.DAT A8 OR DADDR,DAT A 16 Object Code AC AD E2DISP E1DISP EO DISP AO PPQQ Al PPQQ C6 aaOOObbb [DISP] [DISP] YY C7 aaOOObbb [DISP] [DISP] YYYY 88 aasssbbb [DISP] (DlSP] 89 aasssbbb [DISP] [DISP] 8C aaOrrbbb [DISP] [DISP] A2 PPQQ A 3 PPQQ 8A aadddbbb [DISP] [DISP] 10110ddd YY 8A lldddsss 8B aadddbbb [DISP] [DISP] 10111 ddd YYYY 8C 110rrsss 8B 11dddsss 8E aaOrrbbb [DISP] [DISP] 8E 11 Orrsss A4 A5 F6 aa100bbb [DISP] [DISP] F7 aa100bbb [DISP] [DISP] F6 11100sss F7 11100 1111 011 a aaO 11 bbb [DISP] [DISP] F5 11011ddd F711011ddd 90 1111 011 a aaO 1Obbb [DISP] [DISP] F611010sss F711010sss OC YY 00 YYYY 80 aaOOlbbb [DISP] [DISP] YY 81 aaOOlbbb [DISP] [DISP] YYYY DADDR 5-85 Bytes Clock Periods 1 1 2 2 2 3 3 3.4 or 5 12 12 5 or 11** 6 or 18** 5 or 19** 10 10 10+EA 4.5 or 6 10+EA 2.3 or 4 9+EA 2.3 or 4 9+EA 2.3 or 4 9+EA 3 3 2.3 or 4 10 10 8+EA 2 2 2.3 or 4 4* 2* 8+EA 3 2 2 2.3 or 4 4* * * 8+EA 2 1 1 2.3 or 4 * 18 18 (76-831+EA 2.3 or 4 (124-139)+EA 2 2 2.3 or 4 70-71 118-133 16+EA 2 2 1 2.3 or 4 3* 3* 3* 16+EA 2 2 2 3 3.4 or 5 3* 3* 4· 4* 17+EA 4.5 or 6 17+EA Table 5-5. 8086 and 8088 Instruction Mnemonics (Continued) Object Code Instruction OR DADDR,RB OR OR DADDR,RW RB,DADDR OR OR OR RB,DATAB RBD,RBS RW,DADDR OR OR OUT OUT OUT OUT POP RW,DATA16 RWD,RWS Al,[DX] Al,PORT AX,[DX] AX,PORT DADDR POP POP POPF PUSH RW SR PUSH PUSH PUSHF RCl RW SR RCl RB,N RCl RCR RW,N DADDR,N RCR RB,N REP RET RET RET RET ROL N CS CS,DATA16 DATA16 DADDR,N ROl RB,N ROl ROR RW,N DADDR,N ROR RB,N ROR SAHF SALISHL RW,N SALISHL SALlSHl DADDR DADDR,N OB aasssbbb [DISP] [DISP] 09 aasssbbb OA aadddbbb [DISP] [DISP] BO 11001ddd YY OA lldddsss OB aadddbbb [DISP] [DISP] 81 11001ddd YYYY OB lldddsss EE E6 YY EF E7 YY 8F aaOOObbb [DISP] [DISP] 01011ddd OOOrrlll 9D FF aall0bbb [DISP] [DISP] 01010sss 000rrll0 9C 110100va aaOl Obbb [DISP] [DISP] 11 01 OOvO 1 101 Osss Bytes Clock Periods 2,3 or 4 16+EA 2,3 or 4 2,3 or 4 16+EA 9+EA 3 2 2,3 or 4 4" 3" 9+EA 4 2 1 2 1 2 2,3 or 4 4" 3" 8 10 8 10 17+EA 1 1 1 2,3 or 4 B B B 16+EA 1 1 1 2,3 or 4 11 10 10 N=l 15+EA N> 4N+20+EA N=l 2" N>14N+B 2 11 01 OOv 1 1 10 1Osss 110100va aaOllbbb [DISP] [DISP] 11 01 OOvO 1 10 11 sss 2 2,3 or 4 1111001z C3 CB CA YYYY C2 YYYY 1 101 OOva aaOOObbb [DISP] [DISP] 110100vO 11000ddd 1 1 1 3 3 2,3 or 4 1 101 OOv 1 11000ddd 110100va aaOOlbbb [DISP] [DISP] 1 101 OOvO 11 001 ddd 2 2,3 or 4 2 1 2,3 or 4 RB,N 1 101 OOv 1 11001 ddd 9E 110100va aal00bbb [DISP] [DISP] 1 101 OOvO 111 OOddd RW,N 110100vl 11100ddd 2 DADDR,N 5-86 2 2 2 2 N=l 15+EA N> 4N+20+EA N=l 2" N> 1 4N+B +2 8"" 12"" lB"" 17"" N=l 15+EA N>l 4N+20+EA N=l 2" N>4N + B N=l 15+EA N>l 4N+20+EA N=12" N>14N+B 4" N=l 15+EA N> 1 4N+20+EA N=l 2" N>14N+B Table 5-5. 8086 and 8088 Instruction Mnemonics (Continued) Instruction SAR DADDR,N SAR RS,N SAR SSS SSS SSS RW,N Al,DATAB AX,DATA16 DADDR,DAT A8 SSS DADDR,DATA16 SSB DADDR,RB SSB DADDR,RW SSB RB,DADDR SSB SBB SSB RB,DATA8 RBD,RBS RW,DADDR SBB RW,DATA16 SSB SCAS SCAS SEG Prefix SHR RWD,RWS BD WD SR DADDR,N SHR RS,N SHR STC STD STI STOS STOS SUB SUB SUB RW,N BD WD Al,DATAB AX,DATA16 DADDR,DATA8 SUS DADDR,DATA16 SUB DADDR,RB SUB DADDR,RW SUB RB,DADDR SUS SUB SUB RB,DATAS RBD,RBS RW,DADDR SUB RW,DATA16 SUB RWD,RWS Clock Periods Object Code Bytes 11 01 OOva aa 111 bbb [DISP] [DISP] 11 0 1OOvO 11111 ddd 2,3 or 4 11 0 1OOv 1 111 11 ddd 1C yy 1D YYYY 80 aa011bbb [DISP] [DISP] YY 1OOOOOa 1 aaO 11 bbb [DISP] [DISP] YY[YY] 18 aasssbbb [DISP] [DISP] 19 aasssbbb [DISP] [DISP] 1A aadddbbb [DISP] [DISP] 80 11 011 ddd YY 1A 11dddsss lS aadddbbb [DISP] [DISP] 100000a111011ddd YY[YY] 1S 11dddsss AE AF 001 rrl 01 110100va aal 01 bbb [DISP] [DISP] 110100vO 11101 ddd 2 2 3 3,4 or 5 4" 4" 17+EA 3,4,5 or 6 17+EA 2,3 or 4 16+EA 2,3 or 4 16+EA 2,3 or 4 9+EA 3 2 2,3 or 4 4" 3" 9+EA 3 or 4 4" 2 1 1 1 2,3 or 4 3" 15 15 +2 N=l 15+EA N> 1 4N+20+EA N=l 2" N>14N+B 1 101 OOv 1 111 01 ddd F9 FD FS AA AB 2C YY 2D YYYY 80 aal01bbb [DISP] [DlSP] YY 100000a1 aa1 01 bbb [DISP] [DISP] YY[YY] 28 aasssbbb [DISP] [DISP] 29 aasssbbb [DISP] [DISP] 2A aadddbbb [DISP] [DISP] SO 111 01 ddd YY 2A 11dddsss 2B aadddbbb [DISP] [DlSP] 100000alll101ddd YY[YY] 2S 11dddsss 5-87 2 2 N=1 15+EA N>l 4N+20+EA N=12" N> 1 4N+8 2 1 1 1 1 1 2 3 3,4 or 5 2" 2" 2" 11 11 4" 4" 17+EA 3,4,5 or 6 17+EA 2,3 or 4 16+EA 2,3 or 4 16+EA 2,3 or 4 9+EA 3 2 2,3 or 4 4" 3" 9+EA 3 or 4 4" 2 3" Table 5-5. 8086 and 8088 Instruction Mnemonics (Continued) Object Code Instruction TEST TEST TEST AL,DATA8 AX,DATA16 DADDR,DATA8 TEST DADDR,DAT A 16 TEST DADDR,RB TEST DADDR,RW TEST TEST TEST TEST WAIT XCHG XCHG RB,DATA8 RBD,RBS RW,DATA16 RWD,RWS XCHG XCHG RB,RB RW,DADDR XCHG XLAT XOR XOR XOR RW,RW AL,DATA8 AX,DATA16 DADDR,DATA8 XOR DADDR,DATA 16 XOR DADDR,RB XOR DADDR,RW XOR RB,DADDR XOR XOR XOR RB,DATA8 RBD,RBS RW,DADDR XOR XOR RW,DATA16 RWD,RWS AX,RW RB,DADDR A8 yy A9 YYYY F6 aaOOObbb [DISP] [DISP] YY F7 aaOOObbb [DISP] [DISP] YYYY 84 aaregbbb [DISP] [DISP] 85 aaregbbb [DISP] [DISP] F6 1000reg YY 84 11 regreg F7 11 OOOreg YYYY 85 11 regreg 9B 10010reg 86 aaregbbb [DISP] [DISP] 86 11 regreg 87 aaregbbb [DISP] [DISP] 87 11 regreg 07 34 YY 36 YYYY 80 aa010bbb [DISP] [DISP] YY 81 aa010bbb [DISP] [DISP] YYYY 30 aasssbbb [DISP] [DISP] 31 aasssbbb [DISP] [DISP] 32 aadddbbb [DISP] [DISP] 80 1111 Oddd YY 32 11dddsss 33 aadddbbb [DISP] [DISP] 81 11110ddd YYYY 33 11dddsss 5-88 Bytes Clock Periods 2 3 3,4 or 5 4411+EA 4,5 or 6 11 +EA 2,3 or 4 9+EA 2,3 or 4 9+EA 3 2 4 2 1 1 2,3 or 4 5* 3* 53* 3+5n 3* 17+EA 2 2,3 or 4 4* 17+EA 2 1 2 3 3,4 or 5 4* 11 4* 4* 17+EA 4,5 or 6 17+EA 2,3 or 4 16+EA 2,3 or 4 16+EA 2,3 or 4 9+EA 3 2 2,3 or 4 43* 16+EA 4 2 4* 3* Table 5-6. 8086 and 8088 Instruction Object Codes Object Code Mnemonic Byte 1 Byte 2 Other Bytes 00 01 02 03 04 05 06 07 OS 09 OA OB OC OD OE OF 10 11 12 13 14 15 16 17 1S 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 2S 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 aasssbbb aasssbbb aadddbbb aadddbbb [DISP)[DISP] [DISP][DISP] [DISP][DISP] [DISP)[DISP] yy yy yy aasssbbb aasssbbb aadddbbb aadddbbb [DISP][DISP] [DISP)[DISP] [DISP)[DISP] [DISP][DISP] yy yy yy aasssbbb aasssbbb aadddbbb aadddbbb [DISP)[DISP] [DISP][DISP] [DISP)[DISP] [DISP][DISP] yy yy yy aasssbbb aasssbbb aadddbbb aadddbbb [DISP)[DISP] [DISP)[DISP] [DISP)[DISP] [DISP)[DISPI yy yy yy aasssbbb aasssbbb aadddbbb aadddbbb [DISP)[DISP] [DISP)[DISP] [DISP)[DISP] [DISP)[DISP] yy yy yy aasssbbb aasssbbb aadddbbb aadddbbb [DISP][DISP] [DISP)[DISP] [DISP][DISP] [DISP)[DISP] yy yy yy aasssbbb aasssbbb aadddbbb aadddbbb [DISP][DISP] [DISP)[DISP] [DISP)[DISP] [DISP)[DISP] yy yy yy ADD ADD ADD ADD ADD ADD PUSH POP OR OR OR OR OR OR PUSH Not used ADC ADC ADC ADC ADC ADC PUSH POP SBB SBB SBB SBB SBB SBB PUSH POP AND AND AND AND AND AND SEG DAA SUB SUB SUB SUB SUB SUB SEG DAS XOR XOR XOR XOR XOR XOR SEG 5-89 RBD/DADDR.RBS RWD/DADDR.RWS RBD.DADDR/RBS RWD.DADDR/RWS AL.DATAS AX.DATA16 ES ES RBD/DADDR.RBS RWD/DADDR.RWS RBD.DADDR/RBS RWD.DADDR/RWS Al.DATAS AX.DATA16 CS (POP CS) RBD/DADDR.RBS RWD/DADDR.RWS RBD.DADDR/RBS RWD.DADDR/RWS Al.DATAS AL.DATA16 SS SS RBD/DADDR.RBS RWD/DADDR.RWS RBD.DADDR/RBS RWD.DADDR/RWS AL.DATAS AX.DATA16 DS DS RBD/DADDR.RBS RWD/DADDR.RWS RBD .DADDR/RBS RWD.DADDR/RWS AL.DATAS AX.DATA16 ES RBD/DADDR.RBS RWD/DADDR.RWS RBD.DADDR/RBS RWD.DADDR/RWS AL.DATAS AX.DATA16 CS RBD/DADDR.RBS RWD/DADDR.RWS RBD.DADDR/RBS RWD.DADDR/RWS Al.DATAS AX.DATA16 SS Table 5-6. 8086 and 8088 Instruction Object Codes (Continued) Object Code Mnemonic Byte 1 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 40 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 50 5E 5F 60-6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C Byte 2 Other Bytes aasssbbb aasssbbb aadddbbb aadddbtlb [DISP)[DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] yy yy yy DISP DISP DISP DISP DISP DISP DISP DISP DISP DISP DISP DISP DISP AAA CMP CMP CMP CMP CMP CMP SEG AAS INC INC INC INC INC INC INC INC DEC DEC DEC DEC DEC DEC DEC DEC PUSH PUSH PUSH PUSH PUSH PUSH PUSH PUSH POP POP POP POP POP POP POP POP Not used JO JNO JB or JNAE or JC JNB or JAE or JNC JE or JZ JNE or JNZ JBE or JNA JNBE or JA JS JNS JP or JPE JNP or JPO JL or JNGE 5-90 RBD/DADDR.RBS RWD/DADDR.RWS RBD.DADDR/RBS RWD.DADDR/RWS AL.DATA8 AX.DATA16 OS AX CX OX BX SP BP SI 01 AX CX OX BX SP BP SI 01 AX CX OX BX SP BP SI 01 AX CX OX BX SP BP SI 01 DISP8 DISP8 DISP8 DISP8 DISP8 DISP8 DISP8 DISP8 DISP8 DISP8 DISP8 DISP8 DISP8 Table 5-6. 8086 and 8088 Instruction Object Codes (Continued) Object Code Mnemonic Byte 1 Byte 2 70 7E 7F 80 80 80 80 80 80 80 80 81 81 81 81 81 81 81 81 82 82 82 82 82 82 82 82 83 83 83 83 83 83 83 83 84 85 86 87 88 89 8A 8B 8C 8C 80 8E 8E 8F 8F to 8F 90 91 92 93 94 DISP DISP DISP aaOOObbb aa001bbb aa010bbb aa011 bbb aa100bbb aa101 bbb aa110bbb aa111bbb aaOOObbb aa001bbb aa010bbb aa011bbb aa100bbb aa101bbb aa110bbb aa111 bbb aaOOObbb xxOO1xxx aa010bbb aa011 bbb xx100xxx aa101 bbb xx110xxx aa111 bbb aaOOObbb xx001xxx aa010bbb aa011bbb xx100xxx aa101bbb xx110xxx aa111bbb aasssbbb aasssbbb aadddbbb aadddbbb aasssbbb aasssbbb aadddbbb aadddbbb aaOrrbbb xx1 xxxxx aadddbbb aaOrrbbb xx1 xxxxx aaOOObbb xx001xxx xx111xxx Other Bytes [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] yy YY yy YY YY YY YY YY YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY YY [DISP][DISP] YY [DISP][DISP] YY [DISP][DISP] YY [DISP][DISP] YY [DISP][DISP] YYYY [DISP][DISP] YYYY [DISP][DISP] YYYY [DISP][DISP] YYYY [DISP][DISP] YYYY [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP] [DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] JLE or JGE JLE or JNG JNLE or JG ADD OR ADC SBB AND SUB XOR CMP ADD OR ADC SBB AND SUB XOR CMP ADD Not used ADC SBB Not used SUB Not used CMP ADD Not used ADC SBB Not used SUB Not used CMP TEST TEST XCHG XCHG MOV MOV MOV MOV MOV Not used LEA MOV Not used POP Not used Not used XCHG XCHG XCHG XCHG XCHG 5-91 DISP8 DISP8 DISP8 RBD/DADDR,DA T A8 RBD/DADDR,DAT A8 RBD/DADDR,DAT A8 RBD/DADDR,DAT A8 RBD/DADDR,DA T A8 RBD/DADDR,DAT A8 RBD/DADDR,DAT A8 RBD/DADDR,DATA8 RWD/DADDR,DATA 16 RWD/DADDR,DATA 16 RWD/DADDR,DATA 16 RWD/DADDR,DATA 16 RWD/DADDR,DATA 16 RWD/DADDR,DATA 16 RWD/DADDR,DATA 16 RWD/DADDR,DATA 16 RBD/DADDR,DAT A8 RBD/DADDR,DAT A8 RBD/DADDR,DAT A8 RBD/DADDR,DAT A8 RBD/DADDR,DAT A8 RWD/DADDR,DATA 16 RWD/DADDR,DATA 16 RWD/DADDR,DATA16 RWD/DADDR,DATA 16 RWD/DADDR,DATA 16 RBD/DADDR,RBS RWD/DADDR,RWS RBD/DADDR,RBS RWD/DADDR,RWS RBD/DADDR,RBS RWD/DADDR,RWS RBD,DADDR/RBS RWD,DADDR/RWS RWD/DADDR,SR RWD,DADDR SR,RWD/DADDR RWD/DADDR AX,AX (NOP) AX,CX AX,DX AX,BX AX,SP Table 5-6. 8086 and 8088 Instruction Object Codes (Continued) Object Code Mnemonic Byte 1 95 96 97 9S 99 9A 9B 9C 90 9E 9F AO A1 A2 A3 A4 A5 A6 A7 AS A9 AA AB AC AD AE AF BO B1 B2 B3 B4 B5 B6 B7 BS B9 BA BB BC BD BE BF CO-C1 C2 C3 C4 C5 C6 C6 to C6 C7 C7 to C7 C8-C9 Byte 2 Other Bytes PP OOPPOO PP PP PP PP 00 00 00 00 yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy aadddbbb aadddbbb aaOOObbb xxOO1xxx xx111xxx aaOOObbb xx001xxx xx111xxx [DISP][DISP] [DISP][DISP] [DISP][DISP] YY [DISP][DISP] YYYY XCGH XCHG XCHG CBW CWO CALL WAIT PUSHF POPF SAHF LAHF MOV MOV MOV MOV MOVS MOVS CMPS CMPS TEST TEST STOS STOS LODS LODS SCAS SCAS MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV Not used RET RET LES LEA MOV Not used Not used MOV Not used Not used Not used 5-92 AX,BP AX,SI AX,DI BRANCH,SEGM AL,LABEl AX,LABEl LABEL,AL LABEL,AX BD,BS WD,WS BD,BS WD,WS AL,DATAS AX,DATA16 BD WD BS WS BD WD AL,DATAS CL,DATAS DL,DATAS BL,DATAS AH,DATAS CH,DATAS DH,DATAS BH,DATAS AX,DATA16 CX,DATA16 DX,DATA16 BX,DATA16 SP,DATA16 BP,DATA16 SI,DATA16 DI,DATA16 CS,DATA16 RWD,DADDR RWD,DADDR DADDR,DAT A8 DADDR,DAT A 1 6 Table 5-6. 8086 and 8088 Instruction Object Codes (Continued) Object Code Mnemonic Byte 1 CA CB CC CD CE CF DO DO DO DO DO DO DO DO D1 D1 D1 D1 D1 D1 D1 D1 02 02 02 02 02 02 02 02 D3 03 D3 D3 D3 D3 03 D3 04 D5 06 D7 D8-DF EO E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB Byte 2 yy Other Bytes yy yy aaOOObbb aa001bbb aa010bbb aa011bbb aa100bbb aa101bb1 xx110xxx aa111 bbb aaOOObbb aa001bbb aa010bbb aa011bbb aa100bbb aa101bbb xx110xxx aa111bbb [DISPJ[DISP) [DISP)[DISP) [DISPJ[DlSP) [DISP)[DISP) [DISPJ[DISP) [DISP)[DlSP) aaOOObbb aa001bbb aa010bbb aa011bbb aa100bbb aa101bbb xx110xxx aa111 bbb aaOOObbb aa001bbb aa010bbb aa011bbb aa100bbb aa1 01 bbb xx110xxx aa111bbb OA OA [OISP)[OISP) [OISP)[DISP) [DISP)[DlSP) [DISP)[DISP) [DISP) [DISP) [DISP)[DISP) aaxxxbbb OISP DlSP DISP DISP [DISP)[DISP) [DISPJ[DISP) [DISP) [DISP) [DISP)[DlSP) [DISP)[DISP) [DISP)[DISP) [DISP)[DISP) [DISP)[DISP) [DISP)[DISP) [OISP) [DISP) [DISP)[DISP) [DISP)[DISP) [DISP)[DISP) [DISP)[DISP) [DISP)[DISP) [DISP)[DISP) [DISP)[DISP) yy yy yy yy DISP DISP PP DISP DISP DISP QQ PPQQ RET RET INT INT INTO IRET ROL ROR Ret RCR SAL or SHL SHR Not used SAR ROL ROR RCL RCR SAL or SHL SHR Not used SAR ROL ROR RCL RCR SAL or SHL SHR SAR ROL ROR RCL RCR SAL or SHL SHR Not used SAR AAM AAD Not used XLAT ESC LOOPNE or LOOPNZ LOOPE or LOOPZ LOOP JCXZ IN IN OUT OUT CALL JMP JMP JMP 5-93 CS.DATA16 3 V RBD/DADDR.1 RBD/DADDR.1 RBD/DAODR.1 RBD/DADDR, 1 RBD/DADDR.1 RBD/DADDR.1 RBD/DADDR.1 RWD/DADDR.1 RWD/DADOR.1 RWD/DADDR.1 RWD/DADOR.1 RWD/DADOR,1 RWD/DADDR.1 RWD/DADDR.1 RBD/OAODR.N RBD/OADDR.N RBD/DADDR.N RBD/OAODR,N RBD/DAODR,N RBD/DADDR,N RBD/DAODR,N RWD/DADDR,N RWD/DADDR,N RWD/DADDR,N RWD/DADDR,N RWD/DADDR,N RWD/DADOR.N RWD/DADDR.N DADDR DISP8 DISP8 DISP8 DISP8 AL.PORT AX,PORT AL,PORT AX,PORT BRANCH BRANCH BRANCH,SEGM BRANCH Table 5-6. 8086 and 8088 Instruction Object Codes (Continued) Object Code Byte 1 EC ED EE EF FO F1 F2 F3 F4 F5 F6 F6 F6 F6 F6 F6 F6 F6 F7 F7 F7 F7 F7 F7 F7 F7 F8 F9 FA FB FC FD FE FE FE to FE FF FF FF FF FF FF FF FF Byte 2 Mnemonic Other Bytes IN IN OUT OUT lOCK Not used REPNE or REPNZ REP or REPE or REPZ aaOOObbb xx001xxx aa010bbb aa011 bbb aa100bbb aa1 01 bbb aa110bbb aa111bbb aaOOObbb xx001 xxx aa010bbb aa011bbb aa100bbb aa101bbb aa110bbb aa111 bbb [DISP][DISP] YY [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] YYYY [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] HlT CMC TEST Not used NOT NEG MUl IMUl DIV IDIV TEST Not used NOT NEG MUl IMUl DIV IDIV ClC STC Cli Al,DX AX,DX Al,DX AX,DX RBD/DADDR,DAT A8 RBD/DADDR RBD/DADDR RBD/DADDR RBD/DADDR RBD/DADDR RBD/DADDR RWD/DADDR,DAT A 1 6 RWD/DADDR RWD/DADDR RWD/DADDR RWD/DADDR RWD/DADDR RWD/DADDR 511 aaOOObbb aa001bbb xx001 xxx xx111xxx aaOOObbb aa001bbb aa010bbb aa011 bbb aa100bbb aa1 01 bbb aa110bbb xx111 xxx [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] [DISP][DISP] CLD STD INC DEC Not used Not used INC DEC CAll CAll JMP JMP PUSH Not used 5-94 RBD/DADDR RBD/DADDR DADDR DADDR RW/DADDR DADDR,CS RW/DADDR DADDR,CS DADDR Table 5-7. 8080A to 8086 Instruction Mapping 8080A Instruction Equivalent 8086 Instructionls) IN OUT DEV DEV IN OUT PORT PORT LDAX B· SI,CX LDAX 0 STAX B STAX 0 MOV MOV LOA STA LHLD SHLD REG,M M,REG ADDR AD DR AD DR ADDR MOV LODB MOV LODB MOV STOB MOV STOB MOV MOV MOV MOV MOV MOV ADD ADC SUB SBB ANA XRA ORA CMP INR OCR M M M M M M M M M M ADD ADC SUB SBB AND XOR OR CMP INC DEC AL,DADDR AL,DADDR AL,DADDR AL,DADDR AL,DADDR AL,DADDR AL,DADDR AL,DADDR DADDR DADDR LXI RP,DATA16 MOV RW,DATA16 MVI MVI JMP PCHL M,DATA REG,DATA AD DR MOV MOV JMP JMP DADDR,DAT AS RB,DATAS BRANCW· BX CALL CC AD DR ADDR CNC AD DR CZ ADDR CNZ ADDR CP ADDR CM ADDR CPE ADDR CPO ADDR CALL JNB CALL JB CALL JNZ CALL JZ CALL JS CALL JNS CALL JPO CALL JPE CALL RET BRANCH next-inst BRANCH next-inst BRANCH next-inst BRANCH next-inst BRANCH next-inst BRANCH next-inst BRANCH next-inst BRANCH next-inst BRANCH RC RNC RET Equivalent 808~ I nstructi on Is) 8080A Instruction RZ SI,DX RNZ DI,CX RM DI,DX RP RB,DADDR DADDR,RB AL,LABEL LABEL,AL BX,DADDR DADDR,BX RPE RPO JNB RET JB RET JNZ RET JZ RET JNS RET JS RET JPO RET JPE RET next-inst next-inst next-inst next-inst next-inst next-inst next-inst next-inst ADI ACI SUI SBI ANI XRI ORI CPI DATA DATA DATA DATA DATA DATA DATA DATA ADD ADC SUB SBB AND XOR OR CMP AL,DATAS AL,DATAS AL,DATAS AL,DATAS AL,DATAS AL,DATAS AL,DATAS AL,DATAS JC JNC JZ JNZ JP JM JPE JPO ADDR ADDR ADDR ADDR AD DR ADDR ADDR ADDR JB JNB JZ JNZ JNS JS JPE JPO DISPS··· DISPS DISPS DISPS DISPS DISPS DISPS DISPS MOV XCHG SPHL d,s MOV XCHG MOV RBD,RBS DX,BX SP,BX ADD ADC SUB SSB ANA XRA ORA CMP DAD REG REG REG REG REG REG REG REG RP ADD ADC SUB SBB AND XOR OR CMP LAHF ADD RCR SAHF RCL AL,RBS AL,RBS AL,RBS AL,RBS AL,RBS AL,RBS AL,RBS AL,RBS BX,RW AL AL or ADD BX,RW lunlike .DAD will affect AF,PF,SF, and ZF) 5-95 Table 5-7. 8080A to 8086 Instruction Mapping (Continued) INR DCR CMA DAA RLC RRC RAL RAR INX DCX 8080A Instruction Equivalent 8086 Instruction(s) REG REG RB INC RB DEC AL NOT DAA ROL AL ROR AL RCL AL RCR AL LAHF SAHF or INC RW (unlike INX - will affect AF, PF, SF, and ZF) LAHF RW DEC SAHF or DEC RW (unlike DCX - will affect AF, PF, SF, and ZF) RP RP 8080A Instruction PUSH PUSH RP PSW POP POP RP PSW Equivalent 8086 Instruction(s) PUSH LAHF PUSH POP POP SAHF POP XCHG PUSH STI CLI CALL XTHL EI DI RST N STC CMC STC CMC NOP HLT XCHG HLT RW AX RW AX SI BX,SI SI S'N AX,AX 'SOSOA registers map into SOS6 registers as follows: 8080A 8086 8080A 8086 A B C D E H AL CH CL DH DL BH L BC DE HL SP PC BL CX DX BX SP IP "Addresses on SOS6 jumps and calls are adjusted tb be self-relative. "'Conditional jumps to a location out of the short self-relative range must be implemented by using a reversed-sense conditional jump around a normal jump to the location, e.g.: JC ADDR becomes JNB JMP next-inst BRANCH Refer to Table 4-4 for a complete description of SOSA mnemonics shown above. Refer to Table 20-4 for a complete description of SOS6 mnemonics shown above. 5-96 THE 8088 CPU The 8088 is an 8086 microprocessor with an 8-bit Data Bus. The two parts are otherwise identical. Therefore we will describe differences between the 8088 and the 8086 in the text which follows. If you are going to use the 8088. first read the description of the 8086 given at the beginning of this chapter. then note differences as described below. 8088 PROGRAMMABLE REGISTERS AND ADDRESSING MODES 8088 programmable registers and addressing modes are identical to the 8086 in every way. 8088 CPU PINS AND SIGNALS 8088 CPU pins and signals are illustrated in Figure 5-12. As compared to the 8086 pins and signals illustrated in Figure 5-3, only pin 34 differs. For the 8086. pin 34 outputs BHE. This signal discriminates between the high-order byte and the low-order byte on the 16-bit 8086 Data Bus. Since the 8088 has an 8-bit Data Bus. BHE and associated logic is irrelevant. The 8088 outputs maximum mode SSO status at pin 34. The 101M signal has opposite polarity for the 8088, as compared to the 8086. This makes the 8088 compatible with the 8086. Combining 101M, DT/R, and SSO, 8088 bus cycles can be decoded as follows: 10/M Dr/A" sso 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 Code segment access Memory read Memory write No operations Interrupt acknowledge I/O read I/O write Halt Since the 8088 has no BHE signal. nor need for any such signal. the discussion of external memory addressing and BHE given for the 8086 will not apply to the 8088. 5-97 GND A14 A13 A12 A11 A10 A9 A8 AD7 AD6 AD5 AD4 AD3 AD2 AD1 ADO NMI INTR CLK GND Maximum { System Signals -.. ..... .. --.. ~ -- -..... ----..- --..---- -.. --- -.--... ~- ---.. ~ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 8088 CPU 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 ---.. .. -- VCC A15 A16/S3 A17/S4 A18/S5 A19/S6 SSO MN/MX RD -- .....-. F«l/GTO. lm/GTT: ---.. ~.ImJ -- ~- --..... HOLD HLDA LOCK. WR 52.IO/M Sl.DTlR OSO, ALE OS1, iN'fA TEST READY RESET Pin Name Description Type ADO-AD7 A8-A15 A 16/S3. A 17 /S4 A18/S5 A19/S6 SSO RD READY TEST INTR NMI RESET CLK MN!MX Address/Data Bus Address Bus Address/Segment Identifier Address/Interrupt Enable Status Address/Status Status Output Read Control Wait State Request Wait for Test Control Interrupt Request Non-maskable Interrupt Request System Reset System Clock GND for a Maximum System Machine Cycle Status Local Bus Priority Control Instruction Oueue Status Bus Hold Control = VCC for a Minimum System Memory or I/O Access Write Control Address Latch Enable Data Transmit/Receive Data Enable Interrupt Acknowledge Hold Request Hold Acknowledge Power. Ground Bidirectional. Tristate Output. Tristate Output. Tristate Output. Tristate Output. Tristate Output. Tristate Output. Tristate Input Input Input Input Input Input 'SO. ST. 52 RO/GTO. RO/GT1 OSO.OS1 LOCK MN/MX 101M" Minimum System Signals ---- -.. - WR ALE DTIR DEN INTA HOLD HLDA VCC.GND = Output. Tristate Bidirectional Output Output. Tristate Output. Output. Output Output. Output. Output Input Output Tristate Tristate Tristate Tristate Figure 5-12. 8088 Pins and Signal Assignments 5-98 8088 TIMING AND INSTRUCTION EXECUTION The 8088 has a 4 byte instruction object code queue; the 8086. in contrast. has a 6 byte in8088 struction object code queue. The 8088 will start executing instruction fetch bus cycles to INSTRUCTION fill its 4 byte queue as soon as one or more queue bytes are empty. The 8086. in contrast. QUEUE will not start pre-fetching instruction object code bytes until two or more of its 6 queue bytes .....- - - - - -...... are empty. The description of bus cycles and queue logic given for the 8086 otherwise applies directly to the 8088. 8088 MEMORY AND I/O DEVICE ACCESS BUS CYCLES Bus cycle timing for the 8088 and the 8086 differ only at the multiplexed Data/Address Bus lines. Timing differences are confined to the eight Address Bus lines A8-A 15 and may be illustrated as follows: : T2 I 8~~:8A:~~~~; ~I; Add~s O~1 I I elK- 80: 8:D:~ : : T1 I I 'Of: 8088 AOO-AD7. A~~s Om I 3) \ Add,.ss 0"(: . • T3 I Dat:O~ I D.~ In \ T4 : 1 ~ 1! ~ 1~ j j !E: CD ~ - Apart from the fact that the 8088 has no BHE signal, all timing for signals other than the Data/Address Bus is identical for the 8086 and the 8088. 5-99 THE 8088 HALT STATE When operating in minimum mode. the 8088 delays the ALE pulse by one clock period as compared to 8086 timing. This may be illustrated as follows: T1 T2 T3 TH TH elK 101M sso OllA ALE HALT Halt state logic and timing is otherwise identical for the 8086 and the 8088. OTHER 8086 COMPATIBLE 8088 LOGIC 8086 and 8088 logic is absolutely identical for the following states and logic: • The Wait state • The Hold state • RQ/GT logic • Lock logic • Wait for test state • Processor escape • Device reset • Interrupt processing • Single stepping mode THE 8088 INSTRUCTION SET The 8086 and 8088 instruction sets, listed in Table 5-4, are identical with the exception of execution times. Since the 8088 has an 8-bit bus, two bus cycles will have to be executed wherever the 8086 would have executed a single bus cycle to fetch 16 bits of data. Table 5-5 provides execution times for the 8086 and the 8088. 5-100 THE INTEL 8284 CLOCK GENERATOR/DRIVER The 8284 Clock Generator/Driver is a standard component that will be present in every 8086 microcomputer system. In a mtiltimicroprocessor system. each 8086 microprocessor will have its own 8284 Clock Generator/Driver. While one could conceivably have a single 8284 servicing more than one 8086 microprocessor, it will rarely make any economic sense to design a system in this fashion. Logic implemented on the 8284 Clock Generator/Driver corresponds generally to the block labeled clock logic in Figure 5-1. To be completely accurate, however. a small portion of the bus interface logic should also be illustrated as provided by the 8284 device. Figure 5-13 illustrates 8284 device internal logic. The 8284 is manufactured using bipolar technology. It is packaged as an 18-pin DIP. All signals are TTL-level compatible. 8284 CLOCK GENERATOR/DRIVER PINS AND SIGNALS 8284 device pins and signals are illustrated in Figure 5-14. Figure 5-20 illustrates the 8284 device in a single 8086 microprocessor configuration. Signals may be divided between timing and control logic. Clock frequency is controlled by a crystal connected across the X1 and X2 pins. Clock frequency must be exactly three times the required clock period. Since the standard 8086 clock period is 200 nanoseconds, a 15 MHz crystal frequency is required. If an overtone mode crystal is employed, then it must be supported by an external LC network connected to TANK to insure oscillation of the overtone frequency. This is standard clock logic practice; for the 8284 it is illustrated along with other normal connections in Figure 5-15. You have the option of connecting a crystal across Xl and X2 in order to generate a fundamental frequency, or you can inputthe fundamental frequency via EFI. The level of F/C determines whether an external crystal or a signal input will provide the fundamental frequency. If FIE is high, then the fundamental frequency is taken from the EFI input. If Fie is low, then the crystal connected across Xl and X2 provides the fundamental frequency. Three clock outputs are generated: 1) ClK is an MOS level signal designed to meet the requirements of the 8086. 2) PClK Is a TTL level clock signal. output for support circuits. PClK runs at half the frequency of ClK. 3) OSC is an oscillator output running at the crystal or EFI input frequency. These timing signals may be illustrated as follows: 2 3 4 5 EFlor Crystal OSC ClK PClK 5-101 6 7 8 9 10 etc. RES Q 0 RESET .ff CK X1 X2 XTAl OSCILLATOR OSC TANK ClK +2 SYNC +3 SYNC Fie PClK EFI CSYNC RDY1 READY SYNC lOGIC AEN1 AEN2 RDY2 Figure 5-13. Logic of the 8284 Clock Generator and Driver 5-102 READY CSYNC PCLK AEN1 RDY1 READY RDY2 AEN2 ClK GND -. -- -.. - .. --- - 1 2 3 4 5 6 7 8 8284 9 18 17 16 15 14 13 12 11 10 ------- ---- .. VCC (+5 V) X1 X2 TANK EFI Fie OSC RES RESET Pin Name Description Type RESET RES RDY1.RDY2 AEN1. AEN2 READY X1. X2 TANK EFI Control Signal Output to 8086 Reset Logic Input Wait State Ready Inputs Address Enable Qualifiers for RDY1 and RDY2 Control Signal Output to 8086 External Crystal Connections Overtone Crystal Tank Circuit Connection Alternate Clock Input Clock Source Select MOS level Clock Signal to 8086 TTL Clock for Peripherals Crystal Oscillator Output Clock Synchronizer Power. Ground Output Input Input Input Output Input Input Input Input Output Output Output Input Fie ClK PClK OSC CSYNC VCC.GND Figure 5-14. 8284 Clock Generator and Driver Pins and Signal Assignments 5-103 XTAl ..dl§ Cx R~DYand Xl RDYl { READY ~nable Inputs X2 asc asc AENl ClK RDY2 PClK AEN2 READY READY RESET RESET ClK PClK 8284 ...-_..-------tRES RESET) I _---tF/C CR _ ..,:_:_IY_NC...-_--.. r --, I I I I I I L.. CT I I I Tank circuit used with overtone crystals only. I I I --J Notes: 1. 2. Cx should be 3 to 10 pF Cc (when used) should be 1 to 10 nF 3. CR and RR determine Reset time constant 4. CT and l T determine tank frequency: fo = ---V-==lT=C·T=- 1 Figure 5-15. Normal 8284 Clock Generator Circuit 5-104 In multi-CPU configurations you will probably need to synchronize all 8086 clock signals. You use the CSYNC signal for this purpose. When CSYNC is input high. logic internal to the 8284 Clock Generator/Driver is stopped. When CSYNC subsequently goes low. clock outputs restart. If the same CSYNC signal is input to a number of 8284 devices that receive the same EFI input, then all microprocessors in a multi-CPU configuration will be exactly synchronized. Appropriate logic is illustrated in Figure 5-16. SYNCHRONIZING MULTI-8086 CLOCK SIGNALS Note that you cannot use individual crystals for 8284 Clock Generator/Drivers that are supposed to be synchronized with each; minor variations in crystal frequency. which must occur. will quickly distort clock Signal synchronization. You can use a crystal to generate the fundamental frequency for one 8284 Clock Generator/Driver. then use the OSC output of this Clock Generator/Driver as the EFI input to other 8284 Clock Generator/Drivers. The 8086 requires its RESET input to be synchronized with clock logic. The 8284 will 18086 receive an asynchronous Reset input at RES and will generate synchronized RESET output, RESET which the 8086 requires. Appropriate logic is illustrated in Figure 5-15. Timing is illustrated in ''__ _ _ _ ___ the data sheets at the end of the chapter. The 8284 RES input need not make a sharp transition. The 8284 inputs RESET output. RES can make a slow low-to-high transition. RES to a Schmit trigger that generates the We have described earlier in this chapter how external logic can extend a bus cycle by inserting 8284 Waitclock periods between T3 and T4. Figure 5-9 illustrates the READY input that controls Wait WAIT STATE states within the 8086 bus controller. As illustrated in Figure 5-9. the 8086 READY input must be LOGIC synchronized with the clock signal. The 8284 Clock Generator/Driver outputs an appropriately. - - - - - - synchronized READY signal to the 8086. The 8284 creates its READY output from one of two inputs: RDY1 or RDY2. The 8284 has two READY inputs to support MULTIBUS configurations. A single 8086 may connect to two separate System Busses. Memory or I/O devices attached to either bus may wish to create a Wait state within a bus cycle. Each System Bus may therefore have its own READY line. In order to arbitrate bus priorities. RDY1 and RDY2 have companion enable signals AEN1 and AEN2. respectively. The 8284 will respond to RDY1 only when AEN1 is low. Similarly. the 8284 will respond to RDY2 only when AEN2 is low. AEN1 and AEN2 are general bus priority signals you must generate through your own bus priority arbitration logic. We will describe these two Signals. and methods of generating them. later in this chapter. 5-105 1~tL Master Synchronizer - Q D 7474 ~ CLK ..- -- Q 0 T Xl CSYNC X2 7474 ~ CLK 8284 .- OSC ....... r CSYNC Input to other 8284 devices r EFI input to other 8284 devices Figure 5-16. Clock Synchronization Logic in a Multi-CPU 8086 Configuration 5-106 THE INTEL 8288 BUS CONTROLLER In configurations where the MN/MX signal is low, you must use an 8288 Bus Controller in order to decode the SO, ST, and S2 status lines, and thus create System Bus control signals. You can also use the 8288 Bus Controller in order to connect more than one processor to a single System Bus, or in order to create more than one System Bus for a single 8086. Although the primary purpose of the 8288 Bus Controller is to decode the three status signals SO, S1, and S2, a simple 1-of-8 decoder could accomplish this limited task. The 8288 has these additional capabilities: 1) The 8288 can generate control signals for a System Bus or an liD device only bus. 2) You can float a System Bus's control signals to enable direct memory access, or to arbitrate bus priorities. 3) The two Write control lines have alternate advanced outputs designed for slow memories or liD devices. 4) You can suppress control signals as a means of implementing memory protect logic in multi-bus or multimicroprocessor configurations. 5) The 8288 generates control signals needed by line drivers. 6) The 8288 generates control signals needed by simple or complex interrupt logic. The 8288 Bus Controller is manufactured using bipolar technology. It is packaged as a 20-pin DIP. All signals are TTLlevel compatible. 8288 BUS CONTROLLER SIGNALS AND PIN ASSIGNMENTS Figure 5-17 illustrates 8288 Bus Controller signals and pin assignments. Figure 5-21 illustrates an 8288 within an 8086 microcomputer system. Control signals are generated from SO, S1, and S2 as follows: 80 81 82 0 0 0 Interrupt acknowledge INTA and MCE 0 0 1 I/O read 10RC 0 1 0 I/O write 10WC, AIOWC 0 1 1 Halt None 1 0 0 Instruction fetch MRDC MRDC 8086 8288 Control Output 1 0 1 Memory read 1 1 0 Memory write MWTC,AMWC 1 1 1 No operation None 5-107 51 DT/R ALE AEN MROC" lJI.Wr: MWTC GND Pin Name "SO.'ST.~ ClK A£F1 CEN lOB JXRU"C" ~ 1JAWC mAC mwc AiOWC TFJ"fA MCE/PDEN ALE DT/R DEN VCC,GND ---... ... lOB ClK --- ~ --- - ... 1 2 3 4 5 6 7 8 9 10 8288 Bus Controller 20 19 18 17 16 15 14 13 12 11 Description Bus Cycle State Signals TTL Clock Signal Bus Priority Control/Enable Command Enable Mode Control Memory Read Strobe Memory Write Strobe Early Memory Write Strobe I/O Read Strobe I/O Write Strobe Early I/O Write Strobe Interrupt Acknowledge Cascade/Peripheral Data Enable Address latch Enable Data Direction Control Data Buffer Enable Power, Ground -- - - VCC (+5 V) SO ~ .. ... -..- MCE/PDEN DEN CEN INTA mAC AIOWC mwc Type Input Input Input Input Input Output. Output. Output. Output. Output, Output, Output, Output Output Output Output Tristate Tristate Tristate Tristate Tristate Tristate Tristate Figure 5-17. 8288 Bus Controller Pins and Signal Assignments 5-108 8288 and 8086 control signal timing is essentially the same. For details. see the data sheets given at the end of this chapter. If you look again at the Read and Write bus cycle timing descriptions given earlier in this chapter for the 8086 you will see that Read control signals pulse low approximately one clock period earlier than Write control signals. The 8288 creates two alternate Write control signals whose timing is the same as the Read control signals. These alternative Write control signals are referred to as advanced Write control signals. because they go low one clock pulse in advance of the standard Write control signals. 8288 ADVANCED WRITE CONTROL SIGNALS We can thus summarize 8288 System Bus control signals as follows: MRDC is the memory read control. MWTC is the memory write control. AMWC is a memory write control whose timing conforms to MRDC. INTA is a memory read control signal that is output during the two interrupt acknowledge bus cycles. 10RC is an I/O device read control signal. 10WC is an I/O device write control signal. AIOWC is an alternative I/O device write control signal with timing that conforms to 10RC. Devices connected to a bus are likely to use 10WC and MWTC or AIOWC and AMWC. but not all four signals. That is. you will use either the normal write control signals or you will use the advanced write control signals. All 8288 control signals are tristate. They can be disabled and thus disconnected from the System Bus. You have two control options that modify the control signal logic of the 8288 Bus Controller. Using the lOB pin, you can operate the 8288 device in I/O bus mode or in System Bus mode. Using the CEN pin, you can suppress control signals. Let us examine each of these capabilities in turn. 8288 I/O When the lOB pin receives a high input. the 8288 Bus Controller generates an I/O bus. lOB high floats MflDC. MWTC. and 7f.MWC all of the time but outputs INTA. 10RC. 10WC. and AIOWC. In BUS MODE I/O bus mode. these four I/O control signals cannot be floated. Since the four I/O control lines will always be active. it is assumed that the I/O bus generated by an 8288 is a logic bus. You cannot share this local I/O bus with another microprocessor. The 8288 I/O bus has two control signals. PDEN and DTIR. which drive I/O ports and line drivers. DTIA. which we have described for the 8086. is used to control a bidirectional bus driver. When high. DT/R puts the bus driver in output mode. while when low. DTIff puts the bus driver in input mode. PDEN pulses low as a data enable signal. PDEN is equivalent to DEN. the standard bus data enable signal output by the 8086. When lOB is low. a normal System Bus is generated. All seven control signals are active: however. AEN is a bus enable control (much as the BUSEN input is used by the 8228 Bus Controller in an 8080A system). AEN is inactive when lOB is high and an I/O bus is being generated. AEN is active only when lOB is low and a System Bus is generated. When lOB is low and AEN is high. all contro~nals are floated. When lOB is low and AEN is low. control signals are connected to the System Bus. You will use AEN to implement bus priority arbitration logic. or direct memory access logic. as described later in this chapter. CEN is used to disable, but not float, control signals. CEN can be used when an 8288 is generating a System Bus or an I/O bus. CEN will normally be high. When CEN is low, control signals are inactive. CEN does not float signals; it just disables the logic that might otherwise have made a control signal pulse low. Table 5-8 summarizes the effect of lOB and CEN on control signals generated by the 8288 Bus Controller. 5-109 8288 BUS CONTROLLER MEMORY PROTECT Table 5-8. Effect of lOB. CEN. and AEN on Control Signals Output by the 8288 Bus Controller Control Unit Effect on Control Output lOB CEN AEN 0 0 0 0 0 0 0 1 0 1 0 0 0 1 1 0 1 1 1 1 1 1 1 1 i"NTA. iOR'C. iOWC. AffiWc MiffiC. MWTC. AMWC Mode Floated? Active? Mode Floated? Active? System System System System 1/0 1/0 1/0 1/0 Floated Floated Connected Connected Floated Floated Connected Connected Active Inactive Active Inactive Active Active Active Active System System System System Not Used Not Used Not Used Not Used Floated Floated Connected Connected Floated Floated Floated Floated Active Inactive Active Inactive Inactive Inactive Inactive Inactive The CEN control enables memory mapping. Here are some possibilities: 1) In multi-bus configurations. one block of memory addresses may access memory on two or more busses. In order to avoid contentions, you can use the CEN signal to selectively disable busses so that only one bus will actually respond when the 8086 accesses duplicated memory addresses. 2) Privileged memory is frequently present in large microcomputer systems. Privileged memory is likely to become more common in microcomputer systems as they grow larger. Privileged memory is memory that can be accessed only under special circumstances. Frequently, system programs are run out of privileged memory, while application programs are run out of non-privileged memory. This prevents errors in application programs from destroying system programs; it also prevents unauthorized access of reserved memory spaces. DTIR and DEN, the two standard buffer control signals, are generated by the 8288 when it is creating a normal System Bus. These two control signals. when generated by the 8288 Bus Controller. are identical in form and purpose to the signals that the 8086 creates. DT/R determines the data direction for bidirectional buffers, while DEN is a latching strobe. The 8288 generates two interrupt control signals: INTA and MCE. INTA is active on a System Bus or an I/O Bus. MCE shares a pin with PDEN and is active only on a System Bus. 8288 BUS CONTROLLER INTERRUPT SIGNALS As we discussed earlier in this chapter. the 8086 executes two bus cycles when acknowledging an interrupt. During each bus cycle. INTA is output as a low read pulse. On the second low INTA pulse. the acknowledged device must return an 8-bit code. which the 8086 uses as an interrupt vector. The INT A control signal generated by the 8288 Bus Controller is identical to the 8086 INT A control signal and serves the same purpose. on a System Bus or an I/O Bus. The MCE control signal has been added for use in large 8086 microcomputer systems that use a variation of the 8259A Priority Interrupt Control Unit. When you have a master 8259A Priority Interrupt Control Unit and slave 8259A Priority Interrupt Control Units. you will use MCE as a control to the master. while INT A becomes a control to slaves. The 8086 version of the 8259A Priority Interrupt Control Unit is not described in this chapter. 5-110 THE 8282/8283 8-BIT INPUT/OUTPUT LATCH These are simple unidirectional 8-bit latch buffers. The 8283 inverts inputs in order to create outputs; the 8282 does not. That is the only difference between these two devices. Both devices have three-state outputs. When a device is not selected, its outputs are floated. These devices are manufactured using bipolar technology. All signals are TTL-level compatible. Outputs have a high drive capability. as defined in the data sheets at the end of this chapter. The devices are packaged as 20-pin DIPs. THE 8282/8283 INPUT/OUTPUT LATCH PINS AND SIGNAL ASSIGNMENTS Figure 5-18 illustrates the pins and signal assignments for the 8282 and 8283 8-bit input/output latches. Data must be input at 010-017. When STS is high. the internal latches appear transparent and data on the output pins track data on the input pins. The transition from high to low of STS latches the data. The outputs remain stable while STS is low. Data that is latched internally is output when OE is low. The 8282 outputs data unaltered. while the 8283 inverts the data. Were you to simply ground DE and tie STS to +5 V. the 8282 or 8283 I/O ports will function as simple bus drivers. The outputs will continuously track the inputs. but will support heavier signal loads. If you tie STS high. but use the low DE pulse. then input data is constantly available but outputs only become valid while DE is low. Timing may be illustrated as follows: DIO-DI7 5-111 -:-. 010 011 012 013 014 015 016 017 --.. ----- or GNO -..... 20 19 18 16 15 14 13 12 11 or 6 7 - 17 8282 8283 8 9 10 -.. ~- :. - ---- Vee (+5 VI 000 001 002 003 004 005 006 007 STB 'in Name Description Type 010-017 000-007 Data Input Data Output Output Enable Input Data Strobe Power. Ground Input Output. Tristate Input Input ~ STB Vee· GNO Figure 5-18. 1 2 3 4 5 8282 and 8283 Input/Output Latch Pins and Signal Assignments When the Strobe and Output Enable signal are both active. I/O port logic may be illustrated as follows: DtO-Dt7 STB Latches A B A 5-112 e AO A1 A2 A3 A4 A5 A6 A7 OE GND Figure 5-19. ---- - ~ :. - -- --- -- -- .~ -- 1 2 3 4 5 6 7 8 9 10 8286 or 8287 20 19 18 17 16 15 14 13 12 11 -- ---- --- ------ ---- --.. -- Vee BO B1 B2 B3 B4 B5 B6 B7 T Pin Name Description Type AO-A7 BO-B7 OE T Vee,GND Local Bus System Bus Output Enable Direction Select Power, Ground Bidirectional, Tristate Bidirectional, Tristate Input Input 8286 and 8287 Bidirectional Bus Transceiver Pins and Signal Assignments THE 8286/8287 8-BIT BIDIRECTIONAL BUS TRANSCEIVERS These two devices are used to buffer bidirectional lines on a System Bus. The 8286 transmits data unaltered, while the 8287 inverts the data. The two devices are otherwise the same. The 8286 and 8287 bidirectional bus drivers are manufactured using bipolar technology. All pins are TTL-level compatible. The devices are packaged as 20-pin DIPs. 8286 AND 8287 BIDIRECTIONAL BUS TRANSCEIVER PINS AND SIGNAL ASSIGNMENTS Figure 5-19 illustrates pins and signal assignments for the 8286 and 8287 bidirectional bus drivers. AO-A7 constitute eight parallel data lines that connect with the microprocessor Data/Address Bus. BO-B7 constitute eight equivalent lines that connect with the System Bus. System Bus outputs have a higher line drive capability (as defined in the data sheets at the end of this chapter); otherwise. there is no difference between the two busses. When the T input is low, data arriving at the B pins is output via the A pins. When T is high, data arriving at the A pins are output via the B pins. The actual data transfer occurs only while OE is low. When used as an 8086 Data Bus transceiver. T should be connected to DTfR and OE connected to DEN. 5-113 SOME 8086 MICROPROCESSOR BUS CONFIGURATIONS We are now going to look at some 8086 microprocessor bus configurations. The flexibility of the 8086 gives rise to such a bewildering array of system configuration possibilities that a whole book could be written on the subject. We are going to fulfill the more limited objective of identifying possibilities. Figure 5-20 illustrates the simplest case. Here we are using the 8086 to generate a simple microcomputer system. Addresses taken off the bidirectional 8086 Data/Address Bus are unidirectional. We therefore use 8282 I/O ports to latch addresses of the 8086 Data/Address Bus.·ln Figure 5-20 we show just two 8282 I/O ports generating a 16-line Address Bus. Address lines A 16 through A 19 are wasted. By adding one' more 8282 I/O port to the logic in Figure 5-37, you could include the four missing Address Bus lines. In Figure 5-20, we ground the Output Enable inputs of the 8282 I/O ports; the Address Bus will therefore never be floated. We use the 8086 ALE pulse to strobe addresses into the 8282 I/O ports. Since the Data Bus is bidirectional. we use 8286 bidirectional Bus Transceivers in order to create a separate Data Bus from the 8086 Address/Data Bus. Two 8286 bidirectional Bus Transceivers are required to create the 16-line Data Bus. We can use the DT!R and DEN outputs of the 8086 as the 8286 T and CS inputs. We can now illustrate timing for creation of the Address Bus and Data Bus during a read bus cycle, as follows: T1 T4 T3 T2 eLK M~--""+--(= 8282 01 AOO-AO 15--4-.....,1---1 ~------" ' - -_ _.....~-....J and 8286A) ALE M/iO OT/R 8282 0 1 - - - - 4 828200 8286 B (= 8286 T) (= AOO....------,0.-015) Address Out ~--4_--...., AO-A15 Address Out Oata In 00-015 (= AOO8286A-------------~~~_ _ _D_a_ta_l_n_ _ _~----------AD15) 5-114 M/TO INTA ~ - WR ~ ADO AO \ - r AD7 ALE RD +DE DE 8282 A7 A8 ST~ 8282 t.: A15 SHE V ~DO 8086 Vee J\ \ / KAD7 ~T/R MN/MX DEN TV DE AAD8 V 1\ AD15 --l u >0 -L< r~ READY PCLK 8284 ~2 AEN1 ~ ES X1 X2 ~Dl 2S. =-:-= Figure 5-20. Generating a System Bus for a Simple 8086 Configuration The simple system illustrated in Figure 5-20 will not make use of the dual READY clock logic. A single READY input is connected to RDY 1, and both of the READY enables are grou nded. Thus, the 8086 READY input will be created directly from the 8284 RDY1 input. Figure 5-21 illustrates a slightly more complex 8086 microcomputer configuration. Figure 5-21 uses an 8288 Bus Controller to generate System Bus control signals. The DEN, DTlA, and ALE control outputs, which in Figure 5-20 were generated by the 8086 microprocessor, are now generated by the 8288 Bus Controller. As a stand-alone microcomputer configuration, Figure 5-21 offers little or no a,dvantage over Figure 5-20. In a Single bus, single 8086 microcomputer configuration, there is no compelling reason to use the 8288 Bus Controller. All it does is add an extra component to the system without offering any significant ,logic enhancement. 5-115 so S1 52 GND & lOB DEN DT/R 8288 elK ~ c ADO AO - AD7 ~STB • A7 8282 llE A8 ~ STB AD8 A15 8282 SHE AD15. J3HE .ADO ADO -"'D7 AD7 T J* GND MN/MX OE >- Cl w ....J ~:,~~~ ""\' !--TClR1X - ] ~-----t-" 1,---+",,\ -TCHRYX 1 TRYHCH~I I -TClAZ - 1\ TDVCl-- '-TCLDX~1 1 ~ A07-ADo I\. RO READ CYCLE .=L r-""",, (NOTE I} ('NIl. INn c VOH} OT/R ' ,;'' '- r:{ """- - AD AD "J--I" /' '--------------r--+---~--- ""'''- {/ 5-D12 FLOAT __ I'-- -TRHAV---l f---..;,", TRlRH '\ Figure 11: 8088 Bus'Tlmlng - \I DATA IN ' r--~-J TCHCTV ""'''- )Qlr-+L--_____ Minimum Mode System 8088 ClK (828~ Output) [.0,-." --+--+------ WRITE ~~~~~ I DE .. -+----1-----.----1-.. 1---11--- ViR ~ __~--------------~-JI AD7-ADo DT/R INTA CYCLE NOTES 1.3 (RD. W1i - VOH) SOFTWARE HALT DEN.iiD,Wii.INTA = VOH INVALID ADDRESS AD7-ADo SOFTWARE HALT TClAV NOTES: I. All SIGNALS SWITCH BETWEEN VOH AND VOl UNLESS OTHERWISE SPECIFIED. 2. RDY IS SAMPLED NEAR THE END OF T2. T3. Tw TO DETERMINE IF Tw MACHINES STATES ARE TO BE INSERTED. 3. TWO INTA CYCLES RUN BACK·TO-BACK. THE 11088 LOCAL ADDAIDATA BUS IS FLOATING DURING BOTH INTA CYCLES. CONTROL SIGNALS ARE SHOWN FOR THE SECOND INTA CYCLE. ~. SIGNALS AT 8214 ARE SHOWN FOR REFERENCE ONLY. 5. All TIMING MEASUREMENTS ARE MADE AT I.SV UNLESS OTHERWISE NOTED. Figure 12. 8088 Bus Timing - Minimum Mode System (cont.) 5-D13 8088 8088 MAX MODE SYSTEM (USING 8288 BUS CONTROLLER) TIMING REQUIREMENTS P.r. meter Symbol TCLCL CLK Cycle Period Min. Max. Unlls 200 500 ns TCLCH CLK Low Time ('hTCLCL)-15 ns TCHCL CLK High Time ('IJTCLCL) + 2 ns TCH1CH2 CLK Rise Time 10 TCL2CLI CLK Fall Time 10 ns TOVCL Data In Setup Time 30 Data In Hold Time 10 ns TR1VCL ROY Setup Time into 8284 (See Notes 1. 2) 35 ns 0 ns ns TCLRIX ROY Hold Time into 8284 (See Notes 1,2) TRYHCH READY Setup Time InlO 8088 (,hTCLCL)-15 ns TCHRYX READY Hold Time IOto 8088 30 ns TRYLCL READY Inactive to CLK (See Note 4) -8 ns TlNVCH Setup Time lor Recognition (INTR. NMI. TESn (See Note 2) 30 ns TGVCH RQ/GT Setup Time 30 RQ Hold Time into 8086 40 From 1.0V to 3.5V -- ----_. - - - - - - - - ns From 35V to 1.0V -- TCLDX TCHGX Te.t Conditions ns -- f - - ns TIMING RESPONSES P.r.meter Min. MIX. Unll. TCLML Command Active Delay (See Note 1) 10 35 ns 10 Symbol TCLMH Command Inactive Delay (See Note 1) TRYHSH READY Active to Status Passive (See Note 3) TCHSV Status Active Delay TCLSH Status Inactive Delay TCLAV 35 ns 110 ns 10 110 ns 10 130 ns Adaress Valid Delay 15 110 ns TCLAX Address Hold Time 10 TCLAZ Address Float Delay TCLAX 80 ns TSVLH Status Valid to ALE High (See Note 1) 15 ns TSVMCH Status Valid to MCE High (See Note 1) 15 ns TCLLH CLK Low to ALE Valid (See Note 1) 15 ns TCLMCH CLK Low to MCE High (See Note 1) 15 ns TCHLL ALE Inactive Delay (See Note 1) 15 ns TCLMCL MCE Inactive Delay (See Note 1) 15 ns TCLDV Data Valid Delay 15 110 ns TCHDX Data Hold Time 10 TCVNV Control Active Delay (See Note 1) 5 45 ns TCVNX Control Inactive Delay (See Note 1) 10 45 ns TAZRL Address Float to Read Active 0 TCLRL RD Active Delay 10 TCLRH RD Inactive Delay 10 TRHAV RD Inactive to Next Address Active TCHDTL Direction Control Active Delay (See Note 1) 50 TCHDTH Direction Control Inactive Delay (See Note 1) 30 TCLGL GT Active Delay TCLGH GT Inactive Delay TRLRH RD Width NOTES: 1. 2. 3. 4. -- ns --- - - ------ -- f--- - - - . - - - - --.--------- CL = 2().100 pF lor ali 8088 Outputs in addition to internal loads --ns ns 165 - - - - - -1 - - - - 150 110 ns ---ns .. _._----ns --f-----.--- ns -----ns - - - - - - - 1-------ns 85 ----_._._-----.- - 2TCLCL-75 Signal at 8284 or 8288 shown lor relerence only. Setup requirement lor asynchronous signal only to guarantee recognition at next CLK. A~lies only to T3 and wait states. Applies only to T2 state (8 ns into T3 state). 5-014 --- ns TCLCL-45 -- Tilt Conditions ns i 8088 T, T, ClK VCl OSo.OS, S"S"So (EXCEPT HAL T) I ALE (8288 OUTPUT) SEE NO!F 5 tROY (8284 INPUT) I READY (8088 INPUT) I READ CYCLE TClAV--i RD I TCHDTL -I DTiA TClMH __ I 8288 OUTPUTS SEE NOTES 5,8 It MRDC OR IOhc DEN TCVNX- I Figure 13.8088 Bus Timing - Maximum Mode System (Using 8288) 5-D15 8088 C1.K Ii. s,. iii (EXCEPT HALTJ WAITE CYCLE AO,-AOO DEN .2811 OUIPUI'S SEE NOTES 5,8 AiiWC 011 AiOWC INTA CYCLE A,.-Aa (SEE NOTES 3.4) FLOAT AO,·AOo TSVMCH I MCEI PlmI TCLMCH- DT/Ii 82. OUIPUI'S SEE NOTES 5.6 \ INTA DEN TCVNX- :W-~::N _ vOL;RI).~.IOJIe.iIW'fe.AM\vC.~.AroWC.iffn.. =VOH AD, - ADo. A" - Aa INVALID ADDRESS TCLAV ~ /------~\------- \1...._ _ _ _ _.....J. s..s..~ NOTES: 1. ALL SIGNALS SWITCH BETWEEN VO H AND VOL UNLESS OTHERWISE SPECIFIED 2. ROY IS SAMPLED NEAR THE END OF T2. T,. Tw TO DETERMINE IF Tw MACHINES STATES ARE TO BE INSERTED. 3. CASCADE ADDRESS IS VALID BETWEEN FIRST AND SECOND INTA CYCLES 4. TWO INTA CYCLES RUN BACK·TO·BACK. THE 808a LOCAL ADORIDATA BUS IS flOATING DURING BOTIi INTA CYCLES. CONTROL FOR POINTER ADDRESS IS SHOWN FOR SECOND INTA CYCLE. 5. SIGNALS AT 828< OR 8288 ARE SHOWN FOR REFERENCE ONLY . •. TliE ISSUANCE OF THE 8288 COMMAND AND CONTROL SIGNALS (MIf!le. MWTl: . .{'f;lWt. IOIIC. roWC.lIOWl:. TRn AND DEN)' . GS THE ACTIVE HIGH 1288 CEN 7. All TIMING MEASUREMENTS ARE MADE AT , .5V UNLESS OTHERWISE NOTED. a. STATUS INACTIVE IN STATE JUST PRIOR TO T•. 5-016 \. _ _ _ _ _ _ r-- 8088 NOTE: 1. SETUP REQUIREMENTS FOA ASYNCHRONOUS SIGNALS ONLY TO GUARANTEE RECOGNITION AT NEXT elK Figure 15. Asynchronous Signal Recognition ~- Any CLK Cr~ __ I~ CLK ---1 TeLAV 1-- ~_Any CLK cye;=! }-----I --tTClAVr: Figure 16. Bus Lock Signal Timing (Maximum Mode Only) ,,,~""D-L ~ 'CLGH ~_ +-- "CLCL-- _.-=\ V i:---,'c"H ' ; ; . , - - -_.' PULSE' COPROCESSOR : . :_TCLGH ; PULSE :I \ IOI1G1 P'.YIOUS gran. Au-Ai A"'-ADo PULSE' . COPROCESSOR I Ct- --, A,oIIo· A,,,.,, ,---+------\ RELEASE TCLAZ ~~ ~----------------------~ NOTE: 1. THE COf'JIOCUIOIII; IllAY NOT DRIVE THE 1 ~' : . RO. AOIGT; l _I'CLG',__ ~ ' ~---(S-EE~N~OT~E-'I---------J .UsaE' OUTSIOE THE KEQtOH SHOWN WITHOUT ftllKING CONTENTION. Figure 17. Request/Grant Sequence Timing (Maximum Mode Only) r-"A "CLKCYCU- Clk "\J'C I I -.. -THVeH (SEE NOTE 't HOLO~ I -~ I·~ ~I._H:LH.V \i~j,J, , \ ~------------~~----~ ~ _____________~~____~ ,~------~ 1'~--~T~CL~Al~ _ _ _ _ _~,~__________~ COPROCESSOR Figure 18. Hold/Hold Acknowledge Timing (Minimum Mode Only) 5·017 8282/8283 ABSOLUTE MAXIMUM RATINGS· "NOTICE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating on:,. and functional operattoh of the device at these or any other conditions above those ;ndicated in the operational sections of this specification is hot implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. Temperature Under Bias .•.•.....•.....•. O·C to 70'C Storage Temperature .•.... , ...... - 6SoC to + 1S0·C All Output and Supply Voltages ........ - O.SV to + 7V All Input Voltages .............. " •• - 1.0V to + S.SV Power Dissipation .......................... 1 Watt D.C. CHARACTERISTICS Conditions: Vee = 5V ± 10%, TA = Symbol ooe to 70 e 0 Min Parameter Max Units -1 V Power Supply Current 160 mA Forward Input Current -0.2 mA V F = 0.45V IR Reverse Input Current 50 JAA VA = S.2SV VOL Output Low Voltage .45 V IOL = 32 mA VOH Output High Voltage V IOH = -5 mA ± 50 JAA V OFF = 0.45 to 5.25V 0.8 V Vee= 5.0V See Note 1 V Vee= 5.0V See Note 1 Ve Input Clamp Voltage Icc IF 10FF Output Off Current Vil Input Low Voltage V IH Input High Voltage 2.0 Input Capacitance C IN Not••: 1. Output 2.4 12 Test Conditions Ie = -S mA F= 1 MHz VBIAS= 2.5V, Vce= 5V TA=2SoC pF loading 10l =32 mAo IOH = - 5 mA, Cl = 300 pF A.C. CHARACTERISTICS Conditions: Vee = 5V ± 10%, TA = ooe to 70 e 0 Loading: Outputs - 10l = 32 mA, 10H = - 5 mA, C l = 300 pF Symbol TIVOV TSHOV Parameter Input to Output Delay -Inverting - Non-Inverting STB to Output Delay -Inverting - Non-Inverting Min Max Units 22 30 ns ns 40 45 ns ns 18 ns 30 ns Test Conditions (See Note 1) TEHOZ Output Disable Time TELOV Output Enable Time 10 TIVSL Input to STB Setup Time 0 ns TSLIX Input to STB Hold Time 25 ns TSHSL STB High Time 15 ns NOTE: 1. See waveforms and test load circuit on following page. 5-018 8282/8283 INPUTS '" ' 1=r~'==tm"-l)K 3~~~+",,----1,---_______ I I o,,~:--I-ii----1l-T-IV·-o'-1-l-~---------i'"o,;=,~ _,::~{'---------t------''t..l....__-=--------------' f..--- TSHOV _ NOTE: 1.8283 ONLY - VOL ,-.lV SEE NOTE 1 OUTPUT MAY BE MOMENTARILY INVALID FOLLOWING THE HIGH GOING STB TRANSITION. 2. ALL TIMING MEASUREMENTS ARE MADE AT 1.5V UNLESS OTHERWISE NOTED, 1.SV 1.SV 180Q 33Q OUT ~ .111 Q 20 pF LOAD 50 8282 U III /I) Z >C oJ III Q 10 pF LOAD Figure 5. Output Delay VI. Capacitance 5-D20 8284 ABSOLUTE MAXIMUM RATINGS· Temperature Under Bias ....•..•••....... O·C to 70·C Storage Temperature ..••.•••...•• - 65·C to + 150·C All Output and Supply Voltages ••.•.... - 0.5V to + 7V All Input Voltages •......•....••.... - 1.0V to + 5.5V Power Dissipation •....•••.•....••.......... 1 Watt . 'NO TlCE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is no' implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. D.C. CHARACTERISTICS Conditions: T,,=O·C to 70·C; Vcc=5V± 10% Parameter Symbol Min Forward Input Current IF IR Reverse Input Current Vc Input Forward Clamp Voltage Max Units -0.5 mA 50 ~ -1.0 V Test Conditions VF=0.45V V A = 5.25V Ic= -5 mA Icc Power Supply Current 140 mA V ,L Input lOW Voltage 0.8 V Vcc= 5.0V V,H Input HIGH Voltage 2.0 V V cc =5.0V V Reset Input HIGH Voltage 2.6 V Vce= 5.0V V 5 mA 4 2.4 V V -1 mA -1 mA 0.25 V Vce= 5.0V 'HR VOL Output lOW Voltage VOH Output HIGH Voltage ClK Other Outputs VIHR-V,LA RES Input HystereSiS 0.45 .- A.C. CHARACTERISTICS Conditions: TA=O·C to 70·C; Vcc=5V± 10% TIMING REQUIREMENTS Plramlt.r Symbol MIn MIX Unit. T•• t CondItIon. Y,N TEHEL External' Frequency High Time 13 ns 90% - 90% TELEH External Frequency low Time 13 ns 10% - 10% Y,N ns (Note 1) TElEl EFI Period TEHEL + TElEH .;. d XTAl Frequency 12 TRtVCl ROYI. ROY2 Set·Up to ClK 35 ns TCLA1X AOYI. ROY2 Hold to ClK 0 ns TAtVRtV ArfIT. ArR!Set·Up to ROYI. ROY2 15 ns TClA1X AENI. AEN2 Hold to ClK 0 ns TYHEH CSYNC Set·Up to EFI 20 ns TEHYl CSYNC Hold to EFI TYHYl CSYNC Width TllHCl RES Set·Up to ClK IiiES Hold to ClK TClllH 25 MHz 20 ns 2 TELEL ns -- ----- 65 ns (Note 2) 20 ns (Note 2) 5-021 8284 TIMING RESPONSES Symbol Min Parameter TClCl ClK Cycle Period TCHCl Mill Units T.. t Condition. 125 ns ClK High Time (tI3TCLCl) + 2.0 n~ Fig. 3 & Fig. 4 TClCH ClK low Time ('I3TClCl) - 15.0 ns Fig. 3 & Fig. 4 TCHICH2 TCl2ClI ClK Riae or Fan Time TPHPl PCLK High Time TClCl- 20 ns TPlPH PCLK low Time TClCL- 20 ns TRYlCl Ready Inacllve to ClK (See Note 4) -8 ns Fig. 5 & Fig. 6 TRYHCH Ready Active ('hTCLCl)-15.0 ns Ftg. 5 & Fig. 6 10 ClK (See Note 10 3) 40 ns TClil ClK to Reset Delay TClPH ClK to PClK High Delay TClPl ClK to PClK low Delay 22 na TOlCH OSC to ClK High Delay -5 12 na TOlCl OSC to ClK low Delay 2 20 na f---- ns 22 na Notal! 1. ~ .. EFI rlae (5 na max) + EFI fan (6 na max). 2. ee! up and hold only necesaary to guarantee recognition at next clock. 3: Applies only to T3 and TW atates. 4. Applle. only to T2 states. osc cu, 0 PClK 0 ROY.2 I --'\---- "EN,.2 I --+----. ·~~·I~·,:~:. CSYNC I m I TEHYL _TClltH-~TItHCl- TYHYL "ESET 0 ALL TIMING MEASUREMENTS ARE MADE AT 1 S YOLTS. UNLESS OTHERWISE HOTED A.C. TEST CIRCUITS 5-D22 ------ -- 10V to 3.5V .-- 8286/8287 ABSOLUTE MAXIMUM RATINGS· Temperature Under Bias ................. O·C to 70·C Storage Temperature ............. -65·C to + 150·C All Output and Supply Voltages ........ - 0.5V to + 7V All Input Voltages .................. - 1.0V to + 5.5V power Dissipation .......................... 1 Watt 'NO TICE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functtonal operatton of the device at these or any other conditions above those indicated In the operattonal sections of this specification is not Implied. Exposure to absolute maximum rating conditions for extended periods may affect deVice reliability D.C. CHARACTERISTICS FOR 828618287 Conditions: Vcc = 5V ±10% TA = DoC to 70°C Parameter - Test Conditions Max Units Ve Input Clamp Voltage -1 V Icc Power Supply Current-8287 -8286 130 160 mA mA IF Forward Input Current -0.2 mA V F = 0.45V IR Reverse Input Current 50 IJ.A VR=5.25V VOL Output Low Voltage -BOutputs -A Outputs .45 .45 V V IOL IOL VOH Output High Voltage -BOutputs -AOutputs V V IOH=-5 rnA IOH= -1 rnA 10FF IOFF Output Off Curwnt Output Off Current VIL Input Low Voltage VIH Input High Voltage GIN Input Capacitance Symbol Note: 1. B Outputs - 1m = 32 mA, Min 2.4 2.4 le= -5 mA VOFF =0.45V VOFF=5.25V IF IR -A Side -8 Side IOH = -5 mA. CL = 300 pF 0.8 0.9 2.0 12 A Outputs - 1m = 16 mAo IOH = 32 rnA = 16 rnA = -1 V V Vee= 5.0V, See Note 1 Vee= 5.0V, See Note 1 V Vee= 5.0V, See Note 1 pF F= 1 MHz V BIAS = 2.5V, Vee= 5V TA =25·C mAo CL = 100 pF A.C. CHARACTERISTICS FOR 828618287 Conditions: Vee = 5V ±10%, TA = O°C to 70°C Loading: B Outputs A Outputs - IOL = 32 rnA, IOH = -5 rnA, CL = 300 pF IOL = 16 mA, IOH = -1 rnA, CL = 100 pF Symbol Parameter TIVOV Min Input to Output Delay Inverting Non,lnverting TEHTV Transmit/Receive Hold Time TTVEL Transmit/Receive Setup TEHOZ Output Disable Time TELOV Output Enable Time Max Units 22 30 ns ns TEHOZ ns ns 30 10 Note: 1. See waveforms and test load circuit on following page. 5-D23 18 ns 30 ns Test Conditions (See Note 1) 8286/8287 INPUTS \'1 J~ / OE \ J -Tivov- - __ TEHOZ ! ,.-_________--+ VOH - .1V TELOV- 1-. OUTPUTS \V l ______ J~'--_ _ _ _ _ _ _ _ _-+j_ _ , 1·--- C= ~'-----I VOL+.1V TEHTV ----I ,-. TTVEL __________________________________________~r-------------NOTE: 1. ALL TIMING MEASUREMENTS ARE MADE AT 1.5V UNLE'SS OTHERWISE NOTED. 8286/8287 TIMING 5-024 8286/8287 50 50 8217 40 40 u III 30 z ~ II 20 10 pF LOAD pF LOAD Figure 4. Output Delay VI. Capacitance OUT ~'" r OUT ~H' OUT ~~" r r 300PF OUT 2.14V 1.5V 1.5V 300PF 100PF SWITCHING 3-STATE TO VOL 3·STATE TO VOL B OUTPUT A OUTPUT B OUTPUT 1.5V 1.SV 2.28V ~'U' I 300 pF OUT ~r 100PF )'STATE TO VOH )'STATE TO VOH B OUTPUT A OUTPUT Figure 5. Telt Load Circuit' 5-D25 OUT ~"~ r 100PF SWITCHING A OUTPUT 8288 ABSOLUTE MAXIMUM RA TlNGS· 'NOTICE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. .O·C to 70·C ... -65·Cto +150·C - 0.5V to + 7V . ..... -1.l. to +5.5V . 1.5 Watt Temperature Under Bias Storage Temperature All Output and Supply Voltages. All Input Voltages. power Dissipation. D.C. CHARACTERISTICS Conditions: Vcc = 5V ± 10%, T A Symbol =O·C to 70·C Min Parameter Vc Input Clamp Voltage ~_________p_ow_e_r_S~up~p_l~y~C_U_r_re_nt_______________+------~----------+_----____~-----------.------~ IF Forward Input Current IR Reverse Input Current VOL Output low Voltage-Command Outputs Control Outputs 2.4 2.4 Output High Voltage- Command Outputs Control Outputs Input low Voltage VIH Input High Voltage 2.0. ---------~--~--~----~----------------~----~~---------4----~---t------------------1 _ _IO_F_F____ L-. Output Off Currenl A.C, CHARACTERISTICS Conditions: Vcc=5V ±10%, T A =0·Ct070·C TIMING REQUIREMENTS .-- ------ - --. r-'--- ------------------,--------,--------------,---------r-----------------------" Loading Parameter Min Ma. Unit Symbol ~----------_1-------------------.---~-------~--------------~-------~----------~-------1 ns TCLCl ClK Cycle Period 125 f----.-----f-----------------------~------~I_--------------+---------_+_-------------------I TClCH CLK low Time TCHCl t--- - ClK High Time - - - - - -----.---- - TSVCH ns 40 ----------I-----~- ------~·--------t__--·-----------------I Status Active Setup Time t - - -------1----------------TCHSV ns 66 --·-----jf---------------~--------+_---------·---------I f - - - - - - - - - - - - - --- 65 ns -----t-------+-------+----f------------I Status Active Hold Time 10 -.-- f--- ------ - - - - - - 1 - - - - - - - - ns . t- TSHCL Status Inactive Setup Time 55 ns TCLSH Status Inactive Hold Time 10 ns t - - - - - - - - - - - - - - - - - . - - - - - - - -----:- --t-------------+--------+--------------------I - - - - - -----._. - - - - - - _ .. - ----_._--_._--- TIMING RESPONSES Symbot TCVNV TCVNX ~ClLH. Min Paremeter Control Active Delay Control Inactive Delay TClMCH 10 ALE MCE Active Delay (from ClK) t--- TSV~!i:. ~~~~_._ f-~MCE A:_tl::':E.e~y (from ~~~u:.::s.:...) ___ Mu Unit 45 ns 45 ns 15 ns Loading ns +-______+-_____:::..____---<~.....:..:~......, 15 TCHll ALE Inactive Delay 15 ns TClMl Command Active Delay 10 35 ns TClMH Command Inactive Delay 10 35 ns TCHDTl Direction ContrOl Active Delay 50 ns TCHDTH Direction Control Inactive Delay 30 ns TAElCH Command Enable Time 40 ns TAEHCZ Command Disable Time 40 ns TAElCV Enable Delay Time 200 ns 115 TAEVNV AEN to DEN 20 ns TCEVNV CEN to DEN, PDEN 20 ns TCElRH CEN to Command TCLML ns 5-D26 IORC "ROC } MWTC IOWC INTA AMWC AlOWC IOL=32 mA IOH= -5 mA CL=300 pF I Inl = 16mA Other { 10H= -1 mA CL=80 pF 8288 STATE - - - T 4 - ---T1 T2------+ -TClCl~ - In~ eLK - I- TCHSV- \ TSVCH I--TClCH- ~ - V\ L riL-J lL- - ~y"'~ l7 TSHCl TCHCl~ 1\ T4 ------- lr'\ \ 1\ --. 1--- --- T3-- I I ,.~ x~ L ADDRESS/DATA rr TCLlH- ALE WRITE DATA VALID VALID CD TSVlHI.-TCHLl - rTCLMH I / - ~ -TClML i--TCLMl \ \ IV r\ - v I I-- TCVNV V ) J ) TCVNX- 1--- I ) ) f-- TCVNV- I \ V DEN (WRITE) 1\ J - i f--- TCVNX V ! PDEN(WRITE) I I I ___0- TCHDTH- DT/Ii (READ) (INTA) I J-:::' IJ ---- I MCE - J1 I/li@ r~ I TClMCH-1 J ;-j .--TSVMCH TCHDTL \ TCHDTH~ f- TCVNX 1. ADDAESSIDATA IM1$IS SHOWN ONLY FOR AEFEREfojCE PURPOSES 2. UAOtHG EDGE OF ALE ...... 0 Met: IS OETERMIH[O 8Y' THi FALLING EDGE Of CUt OR STATUS OOING ACTIVE. Wt1tCI1EV£A OCCURS LAST So AU TlWINQ trUASUftEM[NTS AM ""DE AT LSv V"'tlESS $P£CIFIEO OTHERWISE 8288 Timing Diagram 5-027 L 8288 eEN DEN DEN, PDEN Qualification Timing CO~~::~------------------------------~ CEN----------------------------~T~C~EL~A~H-JI NOTE: CEN MUST IE lOW OR VALID PRIOR TO T2 TO PREVENT THE COMMAND FROM BEING GENERATED. 8288 Addre.. Enable (AEN) Timing (3-State Enable/Disable) 1.SV OUT ~'~ I*PF 3·STATE TO HIGH 1.SV OUT 2.28V 2.14V ~n' OUT I*PF ~Q" r*PF COMMAND OUTPUT TEST LOAD '·STATE TO LOW Test Load Circuit. - 3 State Command Output Te.t Load 5-028 OUT ~"" r~PF CONTROL OUTPUT TEST LOAD Chapter 6 THE ZILOG Z8000 SERIES The Z8000 series of microprocessors represent Zilog's first 16-bit products. The Z8000 is the second of the new 16-bit microprocessor generation. Inters 8086. described in Chapter 5. was the first product to appear. Motorola's MC68000 will likely be the next. Two Z8000 series microprocessors have been announced. The l8002 is a 40-pin package device capable of addressing up to 65.536 bytes of external memory. The l8001 is a 48-pin package.device capable of addressing up to eight million bytes of external memory. organized as segments of 65.536 bytes. A third device. the Z801 0 Segmentation and Memory Manager. is a companion to the Z8001. The Z801 0 allows memory segments to be dynamically al/ocated under program control anywhere within the eight million bytes of addressable memory. The Z8000 series microprocessors are upward compatible at the source program level with the 8080A ~nd the l80. The following is a comparison of interesting Z8000 and 8086 innovations: 1) Z8000 microprocessors do not pipeline instruction object codes. but under some circumstances they do overlap the next instruction's fetch with the prior instruction's execute. In contrast. the 8086 has a 6-byte object code pipeline. which. with associated instruction fetch overlap timing. effectively eliminates instruction fetCh times. 2) The Z8001 and the Z8002 can be visualized as supporting complex and simple microcomputer configurations. respectively. In contrast. a single 8086 can operate either in complex mode. comparable to the Z8001. or in simPle mode. comparable to the Z8002. 3) Both the Z8001 and the Z8002 have built-in logic to handle bus access priorities,in multi-CPU configurations. The 8086 has equivalent logic. 4) In multi-CPU configurations. each Z8000 series CPU can have its own local memory. while simultaneously sharing common memory. The common memory may be shared by all CPUs or by selected CPUs. In this respect. the 8086 and the Z8000 series are comparable. 5) The Z8001 can address up to eight million bytes of external memory. With the help of the Z801 0 Segmentation and Memory Management Device. this large external memory can be accessed as up to 128 relocatable segments. where each segment can have up to 65.536 bytes of external memory. The 8086 offers similar relocatable segments without relying on an additional memory management device; however. the 8086 can directly address only one million bytes of external memory and can only manipulate four segments at a time. 6) Both Z8000 series microprocessors can be operated in separate "System" and "Normal" modes. Certain privileged instructions. including all I/O instructions. can be executed in System mode only. System and Normal modes have separate Stacks. with separate Stack Pointers. Thus. in program-intensive applications. systems software. executed in System mode. can be separated from application programs. executed in Normal mode. The 8086 offers no equivalent logic. 7) The Z8000 has sixteen 16-bit registers that can alternatively be accessed as 8-bit or 32-bit registers. Fifteen of the 16-bit registers can function as index registers. The 8086. in contrast. has four 16-bit registers. plus three separate 16-bit index registers. The prime sou rce for the Z8000 series is: ZILOG. INC. 10460 Bubb Road Cupertino. CA 95014 6-1 Second sources include: ADVANCED MICRO DEVICES 901 Thompson Place Sunnyvale. CA 94086 SGS-ATES COMPONENTI ELETTRONICI SPA 20019 Castelletto d i Settimo Agrate (Milano) Italy The Z8000 series microprocessors are manufactured using N-channel silicon gate MOS technology. The Z8001 is packaged as a 48-pin DIP. The Z8002 is packaged as a 40-pin DIP. Both devices require a single +5 V power supply. All signals are TTL-level compatible. The Z8000 requires an external clock with up to 4 MHz frequency. Instructions execute in a minimum of three clock periods. The maximum number of clock periods is approximately 20; however. a number of instructions require more time to execute a variety of complex operations. 6-2 THE Z8001 AND Z8002 CPU'S Because these two versions of the Z8000 CPU are so similar. we will describe them together. Functions implemented by Z8000 series microprocessor chips are. in terms of our general illustration. equivalent to those of the 8086. as illustrated in Figure 5-1. Z8001 AND Z8002 PROGRAMMABLE REGISTERS Programmable registers for the Z8001 and Z8002 microprocessors are illustrated in Figures 6-1 and 6-2, respectively. Registers RO through R16 can be used as general purpose accumulators. Registers R1 through R16 can. in addition. function as index registers. Register RD is the only general purpose register which cannot function as an index register. Both the Z8001 and the Z8002 can be operated in System mode or Normal mode. A status flag setting determines the mode of operation. System mode will normally be used by operating system software; Normal mode will be used by application programs. A number of instructions. including all I/O instructions. are privileged. and consequently can be executed in System mode only. System and Normal modes have separate Stack Pointers. These are shown in Figures 6-1 and 6-2 by Sand N suffixes. which represent "System" and "Normal" modes. respectively. Z8000 SYSTEM AND NORMAL MODES Z8000 STACK POINTERS For the ZaOD2. the single 16-bit register R15 serves as the Stack Pointer. For the ZaDD" two 16-bit registers are needed to implement a Stack Pointer. since memory addresses may be up to 23 bits wide. Registers R14 and R15 are used. Instructions that access 16-bit registers do not make any special allowance for R15 and/or R14 functioning as Stack Pointers. Thus. the Stack Pointer can be accessed as a general purpose register/accumulator, or it can be used as the Index register for indexed memory addressing. The fact that there are separate System and Normal mode Stack Pointers is inconsequential when these registers are being accessed as accumulators or index registers. Depending on the currently selected mode. one or the other Stack Pointer will be accessible. This may be illustrated as follows: Normal Mode System Mode .----1 R11 .-----1 R12 .----1 R13 R14 (or R14N) ~--~ L.-_ _...... 1-----1 R11 .-----1 R12 R13 ~----I R14 (or R14S) .-----1 R15S R15N Whenever two 16-bit registers provide a memory address for the Z8001. register bits are utilized as follows: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 Z8001 32-BIT ADDRESS REPRESENTATION 0 " ' - B i t No. r-o""'T'---s-e-gm-e-nt-N-o-.---"I~o"l~o"lr--o-ll""'""o""'l-0""'1-0""'1-0""'-0-1 Register RN holds the _ ....._ _ _ _ _ _ _ _ _ _....................................._ ...._.&.._.&.._ .......... 7-bit segment number in bits 8-14. Other register bits are O. Offset ..._ _ _ _ _ _ _ _ _ _ _ ____________ RN+ 1 holds the 16-bit offset. or I Register ~_ address within the segment identified in Register RN. 6-3 15 14 13 12 11 10 9 S 7 6 5 4 3 2 o ~ Bit No. (for all registers) RO - Accumulator R1 R2 R3 R4 R5 R6 R7 Accumulators and Index Registers RS R9 R10 R11 R12 R13 R14S R14N R15S System and Normal Stack Pointers. Accumulators and Index Registers R15N b.b.b.b.b.b.b.b.~~~.lli~b..lli~b.~iill } ~~~~~~~iJi.i.~;;';';~,;,J Flags and Control Wo", } P"'.n1m Counte' } New P",• .am Status A'ea Po;n'e' I Refresh Counter Figure 6-1. Za001 Microprocessor Programmable Registers 6-4 15 14 13 12 11 10 9 8 7 6 5 4 3 2 o 4---- Bit No. (for all registers) RO - Accumulator R4 R5 R6 R7 R8 Accumulators and Index Registers R9 R10 R11 R12 R13 R14 R 15S } System and Normal Stack Pointers, R 15N Accumulators and Index Registers Flags and Control Word Program Counter New Program Status Area Pointer Refresh Counter Figure 6-2. Z8002 Microprocessor Programmable Registers 6-5 The segment number and offset translate into a 23-bit memory address as follows: A22} Memory Segment .,....-_~A16 .-+-~~ A 15 } 16-bit 23-bit Memory Address Offset '1---~AO Thus. the Z8001 Stack Pointer is shown in Figure 6-1 with bits 8 through 14 of Register R14 providing the segment number. while the whole of Register R15 provides the segment offset. The Z8002 Stack Pointer. shown in Figure 6-2. is a simple 16-bit address register. Z8000 STACK POINTER The Program Counter is a simple 16-bit register for the Z8002. but for the Z8001 two 16-bit words are used. with the 23-bit address divided into a segment number and an offset. as illustrated above. Z8000 PROGRAM COUNTER The Z8000 addresses memory as bytes; however 16-bit words must originate on even byte address boundaries. That is why the Z8001 uses two 16-bit words to generate extended memory addresses. even though only 23 bits of address are required. 23-bit addresses could be implemented in three bytes. rather than in two 16-bit words; however. this would complicate pushing and popping memory addresses. Were the addresses implemented as three bytes. all Stack operations would require three byte pushes or three byte pops. By making all addresses occupy two 16bit words. Stack operations are reduced to two word pushes or two word pops which require no more time than three byte pushes or pops. The Flags and Control Word provide. the Z8001 and the Z8002 with Status and Control bits. Bits are interpreted as follows: 15 14 13 12 11 0 0 0 ~EG ~/N 0 V IE NV IE 0 .~ 0 . ~ .~ 10 9 8 0 0 0 0 7 6 0 0 0 C A~ 5 4 3 0 0 0 0 l S ~ ~ P/O DA .~ o '-"-BitNo. 2 --- Reserved word. l8001 only 0 0 0 H 0 0 ~ Flags and Control Word (FCW) .f Auxiliary Carry Decimal Adjust Parity or Overflow Sign lero Carry Non-vectored interrupt enable/disable Vectored interrupt enable/disable System/normal mode select Segmentation mode select (Z8001 only) Always 0 for Z8002 6-6 The Parity, Overflow, Sign, Zero, and Carry statuses are absolutely standard. Parity and Overflow share a status bit. The Parity status is modified by logical instructions which test the parity of byte data. This status is set to 1 for even parity; it is cleared for odd parity. The Overflow status is equal to the Exclusive OR of carries out of the high-order and penultimate bits following arithmetic and logical operations. The Sign status is set to the value of the high-order result bit following arithmetic operations. The Zero status is set to 1 when the result of an operation is 0; it is reset to 0 otherwise. The Carry status reports carries out of the high-order bit following arithmetic operations. This status is also used by most shift and rotate instructions. Most microprocessor instructions routinely modify status bits. whether or not such modifications are relevant to the operation performed. zaooo status logic generally follows the PDP-11 minicomputer. but the zaooo has a few anomalies. You should therefore consult Table 6-3. which summarizes the zaooo instruction set. in order to determine how a particular status is affected by the execution of any specific instruction. The Auxiliary Carry and Decimal Adjust status flags differ somewhat from normal use. These flags are modified by byte arithmetic instructions in order to make binary coded decimal arithmetic possible. You cannot set or reset these two Status flags using any of the status bit control instructions. and reading the value of these flags provides little useful information. The assembly language programmer should ignore these two flags. NVIE and VIE are used to enable and disable non-vectored interrupts and vectored interrupts, respectively. You enable interrupts by setting the appropriate status bit to 1. and you disable interrupts by resetting the appropriate status bit to O. The SIN status flag is used to switch between System and Normal modes. When this bit is 1. zaooo microprocessors operate in System mode. When this bit is O. zaooo microprocessors operate in Normal mode. Recall that System and Normal modes have their own separate Stack Pointers; also. certain privileged instructions can only be executed in System mode. The SEG status is used by the Z8001 microprocessor only. When this bit is set to 1, the Z8001 operates in Segmented mode; when this bit is set to 0, the Z8001 operates in Nonsegmented mode. In Segmented mode. all Za001 addresses are computed 23 bits wide. using two 16-bit memory Z8001 words as previously illustrated. Za001 Nonsegmented. Normal mode is directly equivalent to SEGMENTED Za002 Normal mode operations. Za001 Nonsegmented System mode is not exactly equivalent to MODE Za002 System mode; differences occur in interrupt acknowledge stack handling. as explained later in this chapter. Thus Za002 Normal mode programs can be executed within any single segment of Za001 memory. The Za001 carries an unused word as a companion to the Flag and Control Word. since all Za001 automatic Stack operations push and pop data in word pairs. Status in the Flag and Control Word must also be pushed and popped as a 32-bit unit - hence the unused companion word. 6-7 The New Program Status Area Pointer is used by interrupt logic. It consists of one or two 16-bit words. as illustrated in Figures 6-1 and 6-2. Z8000 NEW Following any interrupt acknowledge. a vector address is created using the New Program Status Area Pointer and a 9- or 1O-bit displacement provided by interrupt acknowledge logic. as follows: STATUS AREA POINTER PROGRAM ze001 15 14 13 12 11 10 9 8 7 6 5 4 3 2 o .--BitNo. P-~----------~------~~~~~--~~--~~~ o Segment No. 15 14 13 SN6 12 11 10 9 8 7 6 5 4 2 0 AO A11 A10 SNO A15 3 Interrupt Vector Address zeOO2 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 4--BitNo. Upper Offset Displacement A15 A10 A9 AO ,/ Interrupt Vector Address Although the Z8002 uses just one byte of its New Program Status Area Pointer. 16 bits are provided. since all Z8002 automatic Stack operations push and pop 16-bit words. Likewise. the Z8001 New Program Status Area Pointer uses two 16-bit words. where a Single 16-bit word would suffice. to accommodate automatic Stack handling logic which pushes and pops data in 32-bit increments. The Refresh Counter will be described later. along with memory refresh. 6-8 Z8000 REGISTER DESIGNATIONS Z8000 series microprocessor Instructions access a-bit, 16-bit, or 32-blt registers, as illustrated in Figure 6-3. Register designations used by Zilog assembly language mnemonics are shown in this figure. Byte Instructions access sixteen 8-bit registers. illustrated in Figure 6-3 by RHO through RL7. Z8000 BYTE REGISTERS Word Instructions access the sixteen 16-bit registers RO through R16. Z8000 16-BIT REGISTERS Long word instructions access general purpose registers in pairs. Eight 32-bit registers are therefore available. shown in Figure 6-3 as RRO through RR14. Z8000 32-BIT REGISTERS Most Z8000 series instructions that access memory or registers have a word version and a byte version. A limited number of instructions have a long word version. Multiplication and division Instructions sometimes use 64-bit registers, Shown in Figure 6-3 as RQO through RQ12. Z8001 AND Z8002 MEMORY ADDRESSING MODES Most Z8001 memory addreSSing modes have two forms: one for Nonsegmented mode, the other for Segmented mode. When operating in Nonsegmented mode. all Z8001 memory reference instructions compute nonsegmented memory addresses: the offset address is modified. but the segment number is not altered. When operating in Segmented mode. l8001 memory reference instructions compute segmented memory addresses. provided the instruction also has a segmented memory addressing option. But there are some memory reference instructions that have no segmented option: these instructions compute nonsegmented memory addresses. even for a l8001 operating in Segmented mode. A segmented memory reference Instruction computes new values for the segment number and offset addre.s. The Z8002 Program Counter is a Single. 16-bit register. equ iva lent to the l8001 Program Counter Offset register. l8002 memory reference instructions therefore compute nonsegmented memory addresses only. In the discussion which follows. we will illustrate l8000 memory addressing options for Segmented and Nonsegmen ted modes. In Segmented mode the base address always specifies the segment. The base address may occupy two 16-bit words: Word or Register Number 15 14 13 12 11 10 9 a Segment No. 7 6 5 1 0 10 I 0 I 4 3 0 , 0 I 2 1 0 -4--Bit No. 0 , 0 '0 I} 1__________1_6_-B_i_t_o_ff_s_et_ _ _ _ _ _ _ _ _ _..1 n + 1 .. Instruction word 15 14 1 3 12 11 p p+1 10 9 a 7 6 5 4 3 2 1 'I 16-Bit Offset Long form segmented mode base address (not in instruction) 0 " - Bit No. I...- -........se-gm-e-nt-No-.--'-0-'-0-'-0-'-0-'-0....'-0....'-0-'..... 0 I Z8001 BASE ADDRESS I Long form segmented mode base address (in instruction) or it may occupy a single 16-bit instruction word: 15 14 13 12 11 10 9 a 7 6 5 4 3 2 0 - 4 - - Bit No. r -o..... '---S-e-g-m-e-n-t-N-O-.--.....,r------a--b-it-O-ff-se-t----.. Short form segmented I• . mode base address 6-9 Z8001 Z8002 o ...--Bit 8 7 15 'RO} No.--"15 r:~rS~!lrs {RO 8 7 ~~ o RRO Rl R1 ~::} ROO RR2 {:: ---------------------------::} RR4 {::~ R04 ::} RRS {:: ---------------:: } RR8 { :: R08 ~~~~~~..::~} RR,O {R:::"""""""",!!"""",!!,,!,!, ---------------------------- ~R12 }RR12{ R12~ R13 h±~~~;lliiilll ......................................................................"""R13 R012 ~~~~JI} C:~~::"'!., [_:':~':i o i o·: .. _~G_i'...:' :"....,, ....'..,'"...'; ... ;: ... !:""":·:_:;'"","... " '.....' '.... ... { 1} P",.,am Co,n'., { :::~~::______ '_1,2"",::,;:,:,·':;;;""'·.... ' • .... .'1".... :}.... .....____________......... . .,;,......... . .,;,. . . ,;,. . . ,;,.__.;.;:.;a} iOOiOOi N;;:.~;::.m {~~~~. . . Figure 6-3. Various Register Designations for the Za001 and Za002 Microprocessors 6-10 The index or displacement portion of a memory address never specifies the memory segment. The index is always a single 16-bit value for any Z8000 microprocessor. operating in any mode. The displacement may be an 8-bit. 12-bit. or 16-bit value: but once again. it is the same for all Z8000 microprocessors. and all modes of operation. Thus. in Segmented mode. there is a clear difference between a base address and an index or displacement. In Nonsegmented mode. there being no segment number. there is no difference between a base address and an index. Most Z8000 series memory reference instructions access data memory using implied. direct. or indexed memory addressing. Z8000 Z8002 implied memory addressing may be illustrated as follows: 16-bit Registers Memory IMPLIED MEMORY ADDRESSING ....._ _...... RN-1 xxxx RN -4--lnstruction specifies 1---+--1 memory address .....-+_......-RN+2 in register RN. Memory byte xxx x is accessed. RN+1 xxxx-l xxxx 1----1 1-----1 ---Bytes x represents any hexadecimal digit The Z8001 uses only nonsegmented implied memory reference instructions to access data memory. The Z8001 does not use either short or long segmented implied memory addressing to access data memory. Z8001 implied memory addressing may therefore be illustrated as follows: 16-bit Registers 1----1 Memory ss xxxx-1 RN-1 RN ..._Instruction specifies 1-~f---IRN+1 memory address is register RN. Memory byte ss xxxx is accessed. ss xxxx 1----1 t ____ ~ I ss xxxx+3 Bytes s and x represent any hexadecimal digits 6-11 Segment number ss is current contents of Program Counter Segment register. Some Za001 program memory reference instructions (such as the subroutine call) use long segmented implied memory addressing. which may be illustrated as· follows: 16-Bit Registers ~----I Program Memory RRN-l RRN -4- Instruction specifies memory address in Register RN. Memory RRN+l 1---\---1 byte xxxx in segment ss is accessed. ss 00 .. ss xxxx-l ~--ss xxxx t-----I ~ Bytes s and x represent any hexadecimal digits. RRN is a 32-bit register designation. We will now examine direct memory addressing. Z8002 For the Za002. direct memory addressing may be illustrated as follows: DIRECT MEMORY ADDRESSING Memory The direct address xxxx is pppp "'___ _ _-I PPPP+ 1 r provided by the instruction object code pppp+2 xx pppp+3 t----:x;-x_--t I Instruction code Direct Address .. xxxx ~--- xxxx+l xxxx+2 .----1 t-----11 x and p represent any hexadecimal digits Note that the direct address xxxx. being a 16-bit value. must start at a memory byte with an even address. This requirement is illustrated above by the address pppp+2. Furthermore. the high-order byte of a 16-bit memory word is at the lower address. preceding the low-order byte: Program Memory PPPP t-----I High-order byte -- -hh PPPP+ 1 t - - - - - t pppp+2 hh 1 - - - - -..... pppp+3 pppp+4 II t-----I 6-12 Low-order byte II 16-bit data from memory A Za001 direct memory address may be nonsegmented, short segmented, or long segmented. Nonsegmented Za001 direct memory address logic is as illustrated above for a Za002 direct memory address, except that the most recently computed segmented number is output from the Program Counter Segment register via the seven Za001 segment number lines. Long segmented Za001 direct memory addressing may be illustrated as follows: Za001 LONG SEGMENTED DIRECT MEMORY Memory ADDRESSING tt pppp } Instruction code tt pppp+1 The direct address xxxx, in segment ss, is provided by the instruction object code tt pppp+2 tt pppp+3 ss 00 tt pppp+4 xx tt pppp+5 xx •• J Long ",gment.d direct address •• SSXXXX_1~ ss xxxx ss xxxx+ 1 sand t are any hexadecimal digits that specify a segment number in the range 00 through 7F 16. P and x are any hexadecimal digits that specify a memory address within a segment. We can illustrate a short segmented Za001 direct memory addessing as follows: Memory Segment Number Z8002 SHORT SEGMENTED DIRECT MEMORY ADDRESSING ~ tt pppp } t - - - - - I Instruction code ss'- tt pppp+ 1 Offset " ' " ' tt pppp+2 ~--.. } Short segmented ss OOxx_ tt pppp+3 xx direct address The direct address OOxx, in segment ss, is provided by the instruction object code tt pppp+4 I-~~"""" • • SSOOXX_1~' • ss OOxx ss 00xx+1 sand t are any hexadecimal digits that specify a segment number in the range 00 through 7F 16· P and x are any hexadecimal digits that specify an offset, or memory address within the segment. 6-13 Z8001 and Z8002 indexed memory addressing adds the contents of an index register to a direct address. 16-bit registers Rl through R15 can function as index registers. Register RO cannot function as an index register. The direct address provides the base to which an index is added. Z8002 indexed addressing may be illustrated as follows: l6-bit Registers RN-l RN RN+l Z8002 INDEXED ADDRESSING Memory pppp t----f yyyy } Instruction code pppp+l t---\:-oof xxxx + yvyy zzzz pppp+2 xx pppp+3 xx .. } Direct Address zzzz-l zzzz zzzz+l P. x. y and z represent any hexadecimal digits. The selected memory address zzzz is the sum of the direct address xxxx. which is provided by the instruction ob ject code. and the index yyyy. The instruction code specifies Register RN as the Index register. The illustration applies also to nonsegmented laOOl indexed addressing. but for the laOOl a segment number (ss) would precede the computed address zzzz. Since no segment is computed by the laOOl in Nonsegmented mode. ss would be the current contents of the Program Counter Segment register. Here is an illustration of Z8001 short segmented indexed addressing: l6-bit Registers Memory tt pppp RN-l RN tt pppp+l tt pppp+2 yyyy RN+l Z8001 SHORT SEGMENTED INDEXED ADDRESSING } Instruction code ss Short segmented } direct address xx .....--,.---t ss OOxx + yyyy ss zzzz-l ~zzzz ~ :=J ..... --~ ss zzzz .....- - - f ss zzzz+l Segment digits are not 4 affected by this addition. Any carry out of high-order digit addition will be lost. The effective memory address ss zzzz is not the simple sum of ss OOxx and yyyy. The segment number ss is output directly on the segment number pins. bypassing the address addition. OOxx and yyyy are added to create zzzz. the offset. which is output on the Address Bus. In the event that adding OOxx to yyyy generates a carry out of the highorder bit. this carry is lost. Thus the offset addition wraps around from FFFF16 to 000016. without incrementing the segment number. 6-14 Long segmented Z8001 indexed addressing uses a four-byte direct address. with a 16bit offset. as follows: Z8001 LONG SEGMENTED INDEXED ADDRESSING The computed offset zzzz becomes the sum of xxxx and yyyy. Note that long segmented indexed addressing offers the same addressing range as short segmented indexed addressing: the index, on its own, can address the entire offset space of 65,536 bytes. Therefore, the one-byte short segmented base address offset is no handicap. Suppose, for example, you use indexed addressing to access a data table in the middle of a segment. Using long segmented indexed addressing, the base of the data table might be provided by the direct address offset. while the Index register provides the displacement into the selected table: Memory Table Origin xxxx from--~t----t xxxx base address Displacement into table from Index register yyyy .. But you could just as easily have the index originate at the base of the segment: Memory Table n 11 0000 Base address offset = 00 I I : : Start of Table --Start of Segment Displacement into table, from segment origin, in Index register xxxx yyyy A few l8001 and l8002 instructions access data memory using base relative addressing, wherein the contents of an Index register are added to a base address, which is also held in CPU registers. Therefore, l8000 base relative addressing might also be called "implied, indexed" addressing. 6-15 Z8000 BASE RELATIVE ADDRESSING Z8000 IMPLIED INDEXED ADDRESSING Z8002 base relative addressing may be illustrated as follows: 16-bit Registers Memory ......-....... xxx x RM-1 RM xxxx I---~-I T--------- zzzz-1 RM+1 ......___....... zzzz - - - - . , . zzzz 1 - - -....... zzzz+1 I---....-t RN-1~_........... RN YYYY Index RN+1 "-v-" I----t Byte x, Y and z represent any hexadecimal digits The instruction object code must specify the register number from which the base address and the index are taken. In Nonsegmented mode there is no difference between a base address and an index; each is a single l6-bit value. The effective memory address zzzz is simply the sum of any two l6-bit registers' contents. The illustration above applies also to nonsegmented laOOl base relative addressing. However, for the la001 the memory segment ss, currently in the Program Counter Segment register, is output via the seven la001 segment number lines. Consider next Z8001 segmented base relative addressing. The base address specifies the segment. thus the base address and the index differ. Short segmented base relative addressing may be illustrated as follows: 16-bit Registers RM-1 RM Z8001 SHORT SEGMENTED BASE RELATIVE ADDRESSING Memory ......- - - - 1 ss xx ss OOxx 1--_--1 RM+1~__~~____- - + yyyy S5 zzzz-1 1 - - -....... ~~~sszzzzl-_ _--1 ss zzzz+1 RN-1 1 - - -....... I-~,,"....-t RN yyyy Index RN+1 ......- -....... ~ Byte Segment number Offset x, y and z represent any hexadecimal digits specifying offsets, or addresses within memory segment ss. ss can have any value in the range 00 through 7F16' The index is added to the base address USing the same mechanism described earlier for short segmented indexed addreSSing. The discussion of addressing range given for Short segmented indexed addressing applies also to short segmented base relative addressing. 6-16 Long segmented base relative addressing may be illustrated as follows: 16-bit Registers . Z8001 LONG SEGMENTED BASE RELATIVE ADDRESSING Memory R::~ l~-ss-o-o-'" ss zzzz-1 xxxx ss xxx x + yyyy RRM+1 ss zzzz .... ~-- sszzzz+1 ......_ _--1 ~~ ----" RN-1 ~ ......---jl--o--l RN vyyy Index Byte ......- - - - 1 RN+1 ......- - - - 1 Segment number Offset x, y and z represent any hexadecimal digits specifying an offset address within memory segment ss. RRM designates a 32-bit register, while RN designates a 16-bit register. These registers are specified by the instruction object code. Some program memory reference instructions use program relative addressing. A displacement provided by the instruction object code is added, as a signed binary number, to the contents of the Program Counter. For the Z8002 this may be illustrated as follows: Program . Memory Z8002 PROGRAM RELATIVE ADDRESSING "",,,+4 - d d d d t 2 s • I I I lop~. xxxx xxxx+1 C dd xxxx+2 xxxx+3 Program relative addreSSing range signed binary displacement dd xxxx+4 1--_-- xxxx+4 + dddd ... I I I I XXXX+4+ddddt2~ In the illustration above. dddd is divided by 2 to show the addressing range of a program relative address; this is because dddd is a signed binary number. Therefore. half of the possible values will increase the address in the Program Counter (xxxx+4); the other half will decrease this address. Depending on the instruction. dddd may be an 8. 12. or 16-bit signed binary value. This displacement is added to the contents of the Program Counter after the Program Counter has been incremented to address the first byte of the next sequential instruction. This is illustrated above as location xxxx+4. Some program relative instructions (such as Jump Relative) have the displacement included in the op-code word. saving memory space and execution time for short displacements. In these instructions the first byte of the next sequential instruction would be xxxx+2. instead of xxxx+4 as illustrated above. 6-17 za001 program relative addressing, in Segmented or Nonsegmented mode, follows the illustration above; however, the Program Counter also specifies the memory segment. The displacement is added to the Za001 Program Counter Offset register. The Za001 Program Counter Segment register is not changed. Thus the displacement for a program relative memory address cannot cross a segment boundary. Z8001 PROGRAM RELATIVE ADDRESSING A few Z8000 jump instructions use indirect memory addressing. That is to say, the contents of the addressed memory location are loaded into the Program Counter. Very few microprocessors provide indirect addressing. See Volume 1, Chapter 6 for a detailed description of this addressing mode. Z8000 INDIRECT MEMORY ADDRESSING The Z8000 instruction set includes a number of memory reference instructions with auto-increment and auto-decrement. An implied memory address held in a 16-bit register is incremented or decremented following an instruction's execution, thus leaving the address pointing to the next sequential memory location in a table or string. Z8000 AUTOINCREMENT AND DECREMENT The Z8000 Stack decrements the Stack Pointer before a push and increments the Stack Pointer following a pop. In other words, the beginning of the Stack has the highest memory address, and the current top of Stack has the lowest memory address. Z8001 AND Z8002 PINS AND SIGNALS Signals and pin assignments for the two Z8000 series microprocessors are illustrated in Figure 6-4. ADO-AD16 is a multiplexed 16-bit Data/Address Bus. AS is an address strobe which is pulsed low while an address is being output. OS is a data strobe which is pulsed low while data is being output or input. STO-ST3 are four machine cycle status Signals whose output levels further Iyyyyl Abort if IPpppqqqq\ > Ixxxxyyyyl 6-38 The multiply instruction also has word and long word versions. The multiplicand is held in CPU registers. The multiplier may be held in data memory. in CPU registers. or it may be provided immediately by the multiply instruction. The product is returned in CPU registers. The word option may be illustrated as follows: 16-bit Registers {R:~~pppp RR~ Z8000 MULTIPLY INSTRUCTION 16-bit Register. or 2 memory bytes zm emz . ~ yyvy yyyy ppppqqqq P. q. y. and z represent any hexadecimal digits. RR represents a 32-bit register pair. as illustrated in Figure 6-3. Long word multiplication may be illustrated as follows: 16-bit Registers 32-bit Register. or 4 memory bytes xxxx yyyy P. q. s. t. v. w. x. and y represent any hexadecimal digts. RQ represents a 64-bit register. as illustrated in Figure 6-3. The multiply instruction treats all numbers as signed binary values. Status flags are adjusted as follows: Carry (CI. C is set for overflow or underflow. For word multiplication. underflow occurs if the answer is less than -2 15 ; overflow occurs if the answer is 2 15 or more. For long word multiplication. underflow occurs if the product is less than -2 31 ; overflow occurs if the product is 231 or more. Carry is cleared if there is no underflow or overflow. Zero (Z). The Zero status is set if the result is 0; it is cleared otherwise. Sign (S). The Sign status is set for a negative result; it is reset otherwise. The Overflow status is always cleared. The LOPS instruction is somewhat unusual in that it loads both the Program Counter and the Flag and Control Word. Data is taken from memory as follows: Non-Segmented (Memory bytes) Segmented (Memory bytes) FCW (HI) 00 00 FCW (LO) PC (HI) FCW (HI) PC (LO) FCW (LO) PCSEG(HI) PCSEG(LO PCOFF(HI) PCOFF(LO) The LDPS jump instruction uses indirect memory addressing. 6-39 Z8000 LDPS INSTRUCTION Z8000 SUBROUTINE CALL A subroutine CALL can use segmented implied memory addressing: RR { RN~ RN+'~ The System Call instruction generates an interrupt acknowledge sequence. You will recall from the discussion of Z8000 interrupt acknowledge logic given earlier in this chapter that an interrupt identifier is pushed onto the Stack during every interrupt acknowledge sequence. For the System Call instruction, this identifier is the System Call instruction object code; the low-order byte is an 8-bit immediate data value which you specify in the instruction operand. This may be illustrated SC Z8000 SYSTEM CALL as follows: xx ~ 7F xX16 Note that the JP conditional jump instruction can use segmented implied memory addressing. As we might expect from a Zilog high-end microprocessor, the Z8000 has a large number of block transfer and search instructions. These instructions come in groups of eight. For each type of instruction there are four word versions and four comparable byte versions. The four versions include an increment. an increment and repeat. a decrement. and a decrement and repeat. See our earlier discussion of block transfer I/O instructions for a general description of these four variations. Z8000 CONDITIONAL JUMP INSTRUCTIONS Z8000 BLOCK TRANSFER INSTRUCTIONS The LDM block transfer instructions move data between a number of 16-bit registers and memory. You can transfer data from memory words to 16-bit registers or from 16-bit registers to memory words. You can transfer from 1 to 16 words in a Single execution. Register addressing is wrap-around. For example, the instruction: LDM R13.THERE,6 will transfer six words of data from memory to registers. in the following sequence: Memory THERE R13 THERE+2 R14 THERE+4 R15 THERE+6 RO THERE+8 R1 THERE+10 R2 Among the block transfer and search instructions there is a group of translate instructions. These are table look-up instructions; they work as follows: TRxB @RM.@RN.RW 16-bit Registers RM I. 8-bit Memory ppp-1 popp .....- -....... • RN • ~ ----I xxxx .--r xxxx -----~ + yy zzzz---......~ zzzz+1 .....- -....... RW is decremented and RM is incremented or decremented, depending on the instruction. 6-40 As illustrated above. the contents of the destination memory location serve as an 8-bit index into a memory table. The contents of the addressed table byte replace the index. RH1 is used. and left with an undefined value. Translate instructions are typically used to convert characters from one code to another. For example. a single translate instruction could convert an EBCDIC character to an ASCII character. In this case the EBCDIC character code would constitute an index into a 256-byte ASCII code table. At the location specified by the EBCDIC code. you would store the ASCII equivalent. Executing a translate instruction would then cause the ASCII equivalent of an EBCDIC code to be loaded into the memory location in which the EBCDIC code had been stored. A variation of the Translate instruction is a Translate-and-Test. which loads the addressed table byte into Register RH1. but leaves it there. The Z flag is set if RH1 is O. and Overflow is set if the counter decrements to O. ~!""""""'~~........- .. There are a deceptively large number of shift Instructions listed in the register operate Z8000 SHIFT group. In fact, the only difference between an arithmetic and a logical left shift lies in the INSTRUCTIONS Overflow status. For an arithmetic shift this status is set if the high-order (Sign) bit changes following the shift; the Overflow status is cleared otherwise. Following a logical shift the Overflow status is undefined. For right shifts the Sign bit is replicated for arithmetic shifts. while zeros are filled in for logical shifts. The only difference between a dynamic shift and a non-dynamic shift is in the location of the shift bit count. A dynamic shift takes its bit count from a CPU register. A non-dynamic shift takes its bit count from immediate data provided by the instruction operand. Note from our earUer discussion of the Z8000 Stack that the Stack address is incremented for a pop and decremented for a push. In other words. the bottom of the Stack has the highest memory address. and the top of the Stack has the lowest memory address. Four instructions control the MI input and MO output signals. They are MBIT, MREQ, MRES, and MSET. MBIT simply inverts the level of the Mi input and returns it in the Sign status. MRES outputs a high signal via MO. while MSET outputs a low signal via MO. 6-41 r--------. Z8000 STACK INSTRUCTIONS Z8000 MIANDMO INSTRUCTIONS MREQ uses MI and MO to request external access. This instruction uses Zero and Sign statuses. MREQ execution logic may be illustrated as follows: z=o Yes 5=0 MO= 1 MO=O Decrement Counter to 0 Yes 5=0 5=1 MO=O Z=l When the MREQ instruction begins execution, the Zero status is cleared; it is set to 1 after MREQ has completed execution if a request was signalled. The MI input is tested to see if the external resource being arbitrated is available. If MI is low, then the resource is not available; MO is output high and the Sign status is reset to O. If MI is being input high, then the external resource is available. MO is output low, then a time delay is inserted by decrementing the contents of a 16-bit register to O. This delay gives external logic time to receive and propagate MO. External logic must acknowledge the resource request by inputting MI low. In response to MI low, MREQ sets the SJ.9.!! status and the Zero status to 1. But if MI is still high after the counter has decremented to 0, then MREQ outputs MO high, resets the Sign status to 0, and sets the Zero status to 1. Therefore, following execution of the MREQ instruction, CPU logic interprets results as follows: Sign Zero MO o o o o o o o 1 1 ~} :::U:::s:~ede but not granted 1 1 1 Request made and granted 1 1 1 1 o o 1 No request made Not possible 6-42 THE BENCHMARK PROGRAM The Z8000 can execute our benchmark program using just three instructions. We assume the following memory map: l6-bit Memory Locations NLOC NLOC+2 NLOC+4 IOBUF t------I FREE t------I · COUNT I IOB~~ I I I • • • Words IOBUF+NB • • · TABLE§ I • '- These words must be moved ·• .• 'REE'a';'" ,. . • I s I • Tobie Wo", , • Using the LDM Multiple Register Load instruction. we can initialize the addresses and word count in appropriate registers for an LDIR Block Transfer and Repeat instruction. Finally. we update the address of the first free table word. Here is the necessary instruction sequence: !LOAD 10BUF STARTING ADDRESS INTO R1. TABLE STARTING !ADDRESS INTO R2. WORD COUNT INTO R3 NLOC LDM LDIR LD R1. NLOC. 3 @R2. @R1. R3 NLOC+2. R2 DA DA DA 10BUF FREE COUNT !MOVE DATA BLOCK !UPDATE ADDRESS OF FIRST FREE WORD IN TABLE !I/O BUFFER BASE ADDRESS !DATA TABLE FIRST FREE WORD ADDRESS !WORD COUNT 6-43 The nomenclature used to identify Z8000 registers is given in Figure 6-3. The following abbreviation. are u.ed in Table. 6-3, 6-4, and 6-5: addr addrls addrss adrsx b8 b16 cc data8 data16 data32 disp FCW FLAGS flag int ioaddr (I/O) MI MO MSB n16 NSPOFF NSPSEG PC PCOFF PCSEG PSAPOFF PSAPSEG rb rbd rbs REFRESH ri rid ris rid rls rqd rw rwd rws SP any 16-bit nonsegmented address any 32-bit long segmented address any 16-bit short segmented address one of six standard memory addressing modes immediate value in the range 0-7 immediate value in the range 0-15 condition codes. as summarized in Table 6-2 8-bit immediate data value 16-bit immediate data value 32-bit immediate data value address displacement the Flags and Control Word low-order byte of FCW any or all of C. S. P. O. Z either or both of NVI. VI an I/O device 16-bit address an identifier specifying that the prior address is an I/O address the MI signal input level the MO signal output level the most significant (high-order) bit of any data value immediate value in the range 1-16 Normal Stack Pointer offset Normal Stack Pointer segment Program Counter Program Counter offset Program Counter segment Program Status Area Pointer offset Program Status Area Pointer segment any byte register any byte register serving as a destination any byte register serving as a source Refresh Counter any 16-bit index register any 16-bit register providing implied destination address any 16-bit register providing implied source address any 32-bit register serving as a source any 32-bit register serving as a source any 64-bit register serving as a destination any 16-bit register any 16-bit register serving as a destination any 16-bit register serving as a source Stack Pointer (R15 or RR14) 6-44 Object Code b - immediate value corresponding to b8 or b16 c - condition code (see Table 6-2) d - destination register f - code for flags operated on: CZSP/V i-index or implied register. If i = 0 no register is specified n - immediate value corresponding to n16 pppp - 16-bit address word or most significant word of 32-bit address qqqq - least significant word of 32-bit address r - register 0000 = RO. RRO. ROO. or RHO 0001 = Rt or RH1 0111 = R7. or RH7 1000 = R8. RR8. R08. or RLO Statuses 1110 = R14. RR14. or RL6 1111 = R15 or RL 7 s - source register ttttttt - 7-bit unsigned displacement vv - code for interrupts (VI and/or NV\) xx - 8-bit address displacement xxx - 12-bit address displacement xxxx - 16-bit address displacement yy - 8-bit immediate data yyyy - 16-bit immediate data or most significant word of 32-bit data zzzz - least significant word of 32-bit immediate data The Z8000 has the following status flags: C - Carry status Z - Zero status S - Sign status P - Parity status o - Overflow status D - Decimal-Adjust H - Half-Carry The following symbols are used in the Status columns: x - flag is affected by operation (blank) - flag is not affected by operation 1 - flag is set by operation o - flag is reset by operation U - flag is unknown after operation [ [] ] [] V A E9 contents of the memory location or I/O port whose address is contained in the designated register contents of memory location. I/O port. or register data is transferred in the direction of the arrow data is exchanged between the designated locations on both sides of the arrows logical OR ~g~aIAND logical Exclusive OR 6-45 Instruction Mnemonics: The fixed part of an assembly language instruction is shown in UPPER CASE. the variable part (immediate data. register name. etc.) is shown in lower case. Instruction Object Codes: Instruction words are shown as hexadecimal digits with 4-bit variable fields indicated by lower case letters (e.g .. 67ib). Instruction words with variable fields that are not multiples of 4 bits are shown as a pair of hexadecimal digits followed by 8 binary bits (e.g., 7C 000001 vv) Instruction Execution Times: Tables 6-3 and 6-4 list instruction execution times in clock cycles. Real time is obtained by dividing the number of clock cycles by the clock speed. When several possible execution times are indicated (i.e .. 15-19) the number of clock cycles depends on addressing and segmentation modes. The relationship is as follows: Clock Cycles = x-y Addressing Mode 2) 3) 4) 5) 6) 7) Clock Cycles x y-3 y-1 x+1 y-3 y addr addrss addrls addr(ri) addrss(ril addrls(ril For two execution times (i.e .. 10, 15) the first is for Nonsegmented mode. the second for Segmented mode. Instruction times which depend on condition flags are indicated with a slash (i.e., 10. 15/7) with the first time(s) for condition met and the second for condition not met. Table 6-2. Condition Codes Used by the zaooo Assembly Language Instruction Set Meaning Status Conditions Code CC Value - 8 Always true Any C ULT 7 Carry Unsigned less than C=1 EQ Z 6 Equal Zero Z=1 GE 9 Signed greater than or equal S$O=O GT A Signed greater than Z V (S LE E9 0) = 0 2 Signed less than or equal Z V (S E9 0) = 1 LT 1 Signed less than S{90=O MI 5 Minus S=1 NC UGE F No Carry Unsigned greater than or equal C=O NE NZ E Not equal Not zero Z=O NOV PO C No overflow Parity is odd PIO = 0 PE OV 4 Parity is even Overflow PIO = 1 PL 0 Plus S=O UGT B Unsigned greater than CVZ=O ULE 3 Unsigned less than or equal CVZ=1 6-46 Table 6-3. A Summary of the Z8000 Instruction Set Type m ~ -...I g Mnemonic Operand(s) Op Code >-= ID Clock Cycles Status H D 0 IW IN" rwd,@rw rwd,ioaddr 30sd 3Bd4 pppp 2 4 10 12 INB" INB" rwd,@rw rwd,ioaddr 3Csd 3Ad4 pppp 2 4 10 12 INO" @rid,@ris,rw 3Bs8 Ord8 4 21 X INOB" @rid,@ris,rw 3As8 Ord8 4 21 X INOR" @rid,@ris,rw 3Bs8 OrdO 4 21/10"" X INORB" @rid,@ris,rw 3As8 OrdO 4 21/10"" X INI" @rid,@ris,rw 3BsO Ord8 4 21 X INIB" @rid,@ris,rw 3AsO Ord8 4 21 X INIR" @rid,@ris,rw 3BsO OrdO 4 21/10"" X INIRB" @rid,@ris,rw 3AsO OrdO 4 21/10"" X OTOR" @rid,@ris,rw 3BsA OrdO 4 21/10"" X P Operation Performed S Z C [rwdl - [[rwllU/O) [rwdl- [ioaddrlU/O) Input to 16-bit register rwd a data word from the 1/0 port addressed directly by ioaddr, or implied by rw. [rbdl- [[rwllU/O) [rbdl - [ioaddrlU/O) Input to 8-bit register rbd a data byte from the 1/0 port addressed directly by ioaddr, or implied by rw. [[ridll- [[risllU/O). [ridl- [ridl- 2. [rwl- [rwl- 1 If [rwl = 0 then 0 = 1. Otherwise 0 = O. [[ridll- [[risllU/O). [ridl - [ridl - 1. [rwl - [rwl - 1 If [rwl = 0 then 0 = 1. Otherwise 0 = O. Input a 16-bit data word (for INO) or a data byte (for INOB) from the 1/0 port implied by ris to the memory word (for INO) or byte (for INOB) implied by rid. Decrement the implied memory address in rid by 2 (for INO) or by 1 (for INOB). Decrement the 16-bit counter rw by 1. If rw contains 0, set the Overflow status. [[ridll - [[risl](I/O). [ridl - [ridl- 2. [rwl - [rwl - 1 If [rwl = 0 then 0 = 1. Otherwise reexecute. [[ridll- [[risllU/O). [ridl- [ridl- 1. [rwl- [rwl- 1 If [rwl = 0 then 0 = 1. Otherwise reexecute. INOR and INORB are identical to INO and INOB, respectively, except that INOR and INORB are reexecuted until [rwl = O. [[ridll- [[risllU/O). [ridl- [ridl + 2. [rwl- [rwl-l If [rwl = 0 then 0 = 1. Otherwise 0 = O. [[ridll- [[risllU/O). [ridl- [ridl + 1. [rwl- [rwl- 1 If [rwl = 0 then 0 = 1. Otherwise 0 = O. INI and INIB are identical to INO and INOB, respectively, except that rid is incremented. [[ridll- [[risllU/O). [ridl- [ridl + 2. [rwl- [rwl- 1 If [rwl = 0 then 0 = 1. Otherwise reexecute. [[ridll - [[risllU/O). [ridl - [ridl + 1. [rwl - [rwl - 1 If Irwl = 0 then 0 = 1. Otherwise reexecute. INIR and INIRB are identical to INO and INOB, respectively, except that rid is incremented; also INIR and INIRB are reexecuted until [rwl = O. [[ridllU/O) - [[risll. [risl- [risl- 2. [rwl- [rwl- 1 If [rwll=O then reexecute. If [rwl = 0 then 0 = 1 and end execution. ~ " Privileged instruction - can be executed only in system mode. "" Number of clock cycles depends on the number of repetitions for n/m""; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 )I"m. Table 6-3. A Summary of the Z8000 Instruction Set (Continued) III Type Mnemonic Operand(s) Op Code !>- III Clock Cycles Status Operation Performed H D 0 OTORB' @rid,@ris,rw 3AsA OrdO 4 21110" X OTIR' @rid,@ris,rw 3Bs2 OrdO 4 21/10" X OTIRB' @rid,@ris,rw 3As2 OrdO 4 21/10" X OUT' OUT" @rw,rws ioaddr,rws 3Fds 3BsS 2 pppp 4 10 12 OUTB' OUTS' @rw,rbs ioaddr,rbs 3Eds 3AsS pppp 4 10 12 OUTO' @rid,@ris,rw 3SsA Orda 4 21 X OUTOB' @rid,@ris,rw 3AsA Orda 4 21 X OUTI' @rid,@ris,rw 3Bs2 Orda 4 21 X OUTIB' @rid,@ris,rw 3As2 Orda 4 21 X ~ .. G ~ 0) c c ~ 00 0 g 2 g . .. P S Z C [[ridl)(l/O) - [[ris]]. [risl- [risl- 1. [rwl- [rwl- 1 If [rwlI=O then reexecute. If [rwl = 0 then 0 = 1 and end execution. Output a block of 1S-bit words (for OTOR) or 8-bit bytes (for OTORB) from memory to an I/O port. rw specifies the number of words or bytes. Memory is addressed, using implied memory addressing, by 1S-bit register ris, which is decremented after each output. 1S-bit register rid specifies the 110 port. [[ridIW/O) - [[risll. [risl - [risl + 2. [rwl - [rwl - 1 If [rwll= 0 then reexecute. If [rwl = 0 then 0 = 1 and end execution. [[rid]]U/O) - [[ris]]. [risl- [risl + 1. [rwl- [rwl- 1 If [rwll=O then reexecute. If Irwl = 0 then 0 = 1 and end execution. OTIR and OTIRB are identical to OTOR and OTORB, respectively, except that OTIR and OTIRB increment the memory address in ris. [[rwlHl/O) - Irwsl [ioaddr)(l/O) - [rwsl Output the data word from 1S-bit register rws to the I/O port addressed directly by ioaddr or implied by rw. [[rwl)(l/O) - [rbsl [ioaddr](l/O) - [rbsl Output the data byte from 8-bit register rbs to the I/O port addressed directly by ioaddr or implied by rw. [[ridIW/O) - [[ris]]. [risl- [risl- 2. [rwl- [rwl- 1 If [rwl = 0 then 0 = 1; otherwise 0 = O. [[ridIW/O) - [[ris]]. [risl- [risl- 1. [rwl- [rwl- 1 If [rwl = 0 then 0 = 1; otherwise 0 = O. Output a data word (for OUTO) or byte (for OUTOS) from the memory location addressed by 16-bit register ris to the I/O port addressed by 16-bit register rid. Oecrement ris by 2 (for OUTO) or 1 (for OUTOS). Oecrement the counter 16-bit register rw. [[ridl)(l/O) - [[ris]]. [risl- [risl + 2. [rwl- [rwl- 1. If [rwl = 0 then 0 = 1; otherwise 0 = O. [[ridIW/O) - [[ris]]. [risl - Iris] + 1. [rwl - [rwl - 1. If [rwl = Othen 0 = 1; otherwise 0 = O. OUTI and OUTIS are identical to OUTO and OUTDS, respectively, except that the memory address in ris is incremented. Privileged instruction - can be executed only in system mode . Number of clock cycles depends on the number of repetitions for n/m"; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 )'m. - - - - Table 6-3. A Summary of the Z8000 Instruction Set (Continued) Type' Mnemonic t• OpCode Operand Is) III 1 ~ c c ~ 0 g g en ~ co pppp rwd,ioaddr rbd,ioaddr @rid,@ris,rw @rid,@ris,rw . @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw ioaddr,rws ioaddr,rbs @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw 3Bd5 3Ad5 3Bs9 3As9 3Bs9 3As9 3Bsl 3Asl 3Bsl 3Asl 3BsB 3AsB 3Bs3 3As3 3Ss7 3As7 3SsS 3AsB 3Bs3 3As3 LO LO rwd,adrsx rwd,@ris 61id 21id pppp LO rwd,risldisp) 31id LO rwd,rislrw) LOS LOS rbd,adrsx rbd,@ris SIW SINB· SIND· SINOB· SINOR· SINORB· SINI" SINIB· SINIR· SINIRB· SOTOR· SOTORS· SOTIR· SOTIRB· SOUrSOUTS· SOUTO· SOUTOB· SOUTI SOUTIS 4 4 4 4 4 4 4 4 4 4 4 4 4 pppp Ord8 Ord8 OrdO OrdO Ord8 Ord8 OrdO OrdO OrdO OrdO OrdO OrdO pppp pppp Ord8 Ord8 Orda Ord8 4 4 4 4 4 4 4 qqqq 4/6 Clock Cycles 12 12 21 21 21/10·· 21110·· 21 21 21/10·· 21/10·· 21/10·· 21110·· 21/10·· 21/10·· 12 12 21 21 21 21 2 9-13 7 xxxx 4 14 71id OrOO 4 14 60id 20id pppp 4/6 9-13 7 G) u cG) ~ II: ~ 0 E G) ~ ~ III .5 ~ . .. qqqq 2 Status Operation Performed H D 0 X X X X X X X X X X X X P S Z C These instructions output "special 1/0" status via STO - ST3; otherwise, they are identical to 1/0 instructions as follows: SIN - IN(l) SINB - INBll) SIND -INO SINOB -INOB SINOR -INOR SINORB - INORB SINI-INI SINIB -INIB SINIR -INIR SINIRB - INIRB SOTOR - OTOR OOTORB - OTO'iB SOTIRB - OTiMo SOTIR - OTIR SOUT - OUTll) SOUTB - OUTBll) SOUTOB - OUTOB SOUTO - OUTO SOUTI - OUTI SOUTIS - OUTIB (1 )Only the direct addre~sing option exists for the special 110 version of, this instruction. X X X X [rwdl - [adrsxl [rwd] - Urisll Load data from the 1 6-bit memory word addressed by adrsx or Iris] into 16-bit register rwd. [rwd] - Uris] + disp] Load into 16-bit register rwd the contents of the 16-bit memory word addressed using base relative addressing. [rwd]- Uris] + [rwll Load into 16-bit register rwd the contents of the 16-bit memory word addressed using implied, indexed addressing. [rbdl - [adrsxl [rbd] - [[ris]] Load into 8-bit register rbd the contents of the memory byte addressed by adrsx or Iris]. Privileged instruction - can be executed only in system mode . Number of clock cycles depends on the number of repetitions for n/m··; n =minimum number of clock cycles and m = number of clock cycles added for each additional repeti tion of operation. The number of clock cycles for an instruction which repeats k times is n + Ik-l ).m. - - - - - ---- ---- Table 6-3. A Summary of the Z8000 Instruction Set (Continued) Type -:ae Mnemonic Operand Is) Op Code t'" III Clock Cycles LOB rbd,risldisp) 30id xxxx 4 14 I..,OB rbd,ris(rw) 70id OrOO 4 14 LOL LOL rld,adrsx rld,@ris 54id 14id pppp LOL rld,ris(disp) 35id xxx x 4 17 LOL rld,ris(rw) 75id OrOO 4 17 LO LO adrsx,rws @rid,rws 6Fis 2Fds pppp LO rid(disp),rws 33is xxxx 4 14 LO rid(rw),rws 73is OrOO 4 14 LOB LOB adrsx,rbs @rid,rbs 6Eis 2Eds pppp LOB rid(disp),rbs 32is xxxx qqqq 4/6 2 Status H D 0 P Operation Performed S Z [rbd] - [[ris] + disp] Load into 8-bit register rbd the contents of the memory byte addressed using base relative addressing. [rbd]- [[ris] + [rwll Load into 8-bitregister rbd the contents of the memory byte ad.dressed using implied, indexed addressing. [rid] - [adrsx] [rld]-Urisll Load into 32-bit register rid the contents of the 32-bit memory location addressed by adrsx or [ris]. [rid] - [[ris] + disp] Load into 32-bit register rid the contents of the 32-bit memory location addressed using base relative addressing. [rid] - Uris] + [ridll Load into 32-bit register rid the contents of the 32-bit memory location addressed using implied, indexed addressing. [adrsx) - [rws) [[ridll - [rws] Store data from 16-bit register rws into memory word addressed by adrsx or [rid]. [[rid) + disp) - [rws) Store data from 16-bit register rws into memory word addressed using base relative addressing. [[rid] + [rwll- [rws] Store data from 16-bit register rws into memory word addressed using implied, indexed addressing. [adrsx] +- [rbs] [[ridll +- [rbs] Store data from 8-bit register rbs into memory byte addressed by adrsx or [rid]. [[rid) + disp) +- [rbs) Store data from 8-bit register rbs into memory byte addressed using base relative addressing. 12-16 11 := !c 0 g eu c Cf UI o i a: qqqq 4/6 2 11-15 8 ~ E e :E ~ as .5 Ii: qqqq 4/6 2 11-15 8 4 14 C " Privileged instruction - can be executed only in system mode. "" Number of clock cycles depends on the number of repetitions for n/m""; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1) om. A Summary of the zeooo Instruction Set (Continued) ...> Clock Cycles Status ID 4 14 Table 6-3. I/) Type '::a Mnemonic Operand(s) Op Code CD H LOB rid(rw),rbs 72is OrOO LOL LOL adrsx,rls @rid,rls 50is 1Ods pppp LOL rid(disp),rls 37is xxxx 4 17 LOL rid(rw),rls 77is OrOO 4 17 LOA rwd,adrsx 76id pppp 4 12-13 LOA rld,adrsx 76id pppp LOA LOA rwd,ris(disp) rld,ris(disp) 34id 34id xxx x xxxx 4 4 15 15 LOA LOA rwd,ris(rw) rld,ris(rw) 74id 74id OrOO OrOO 4 4 15 15 LOAR rwd,disp16 340d xxx x 4 15 LOAR rld,disp16 340d xxxx 4 15 LOR LORB rwd,disp16 rbd,disp16 310d 300d xxx x xxxx 4 4 14 14 qqqq 4/6 2 D 0 P Operation Performed S Z C [[rid] + [rwll- [rbs] Store data from 8-bit register rbs into memory byte addressed using implied, indexed addressing. [adrsx] - [rls] [[ridll - [rls] Store data from 32-bit register rls into 32-bit memory long word addressed by adrsx or [rid]. [[rid] + disp] - [rls] Store data from 32-bit register rls into 32-bit memory long word addressed using base relative addressing. [[rid] + [rwll- Iris] Store data from 32-bit register rls into 32-bit memory long word addressed using implied, indexed addressing. [rwd] - adrsx Load the unsegmented address into 16-bit register rwd. [rid] - adrsx Load the segmented address, in segmented address format, into 32bit register rid. [rwd] - Iris] + disp [rid] - Iris] + disp Load the base relative address into 1 6-bit register rwd (nonsegmented mode) or 32-bit register rid (segmented model. [rwd]- Iris] + [rw] [rid] - Iris] + [rw] Load the implied, indexed memory address into 16-bit regiser rwd (nonsegmented mode) or 32-bit register rid (segmented mode). [rwd] - [PC] + disp16 Load the program relative memory address into 16-bit register rwd. [rld]- [PC] + disp16 Load the program relative segmented memory address, in segmented format. into 32-bit register rid. [rwd] - [[PC] + disp16] [rbd) - [[PC] + disp16] 14-18 11 CD ~ 'Sc 0 y CD u c ...~ C11 qqqq 4/6 15-16 f .;a: ~ 0 E CD ~ ~ III .E A: ... I I I Privileged instruction - can be executed only in system mode . Number of clock cycles depends on the number of repetitions for n/m"; n =minimum number of clock cycles and m = number of clock cycles added for each additional repeti1tion of operation. The number of clock cycles for an instruction which repeats k times is n + (k-l ).m. - - - - ---- ----- -- i Table 6-3. A Summary of the III Type Mnemonic Operand(s) ;. Op Code CD Clock Cycles LDRL rld.disp16 350d xxx x 4 17 LOR LDRB LDRL disp16.rws disp16.rbs disp16.rls 330s 320s 370s xxxx xxxx xxxx 4 4 4 14 14 ADD ADD rwd.@ris rwd.adrsx 01id 41id pppp qqqq 4/6 ADDB ADDB rbd.@ris rbd.adrsx OOid 40id pppp qqqq 4/6 7 9-13 AOOL ADDL rld.@ris rld.adrsx 16id 56id pppp 2 qqqq 4/6 14 15-19 AND AND rwd.@ris rwd.adrsx 07id 47id pppp qqqq 4/6 ANDB ANDB rbd.@ris rbd.adrsx 06id 46id pppp qqqq 4/6 CLR CLR @rid adrsx ODd8 4Di8 pppp qqqq 4/6 CLRB @rid OCd8 zaooo Instruction Set (Continued) Status H 0 0 P Operation Performed S Z C [rldl- [[PCl + disp16l Load the memory word (for LOR). byte (for LOR B) or long word (for LDRU addressed using program relative addressing into the 16-bit. 8-bit or 32-bit register. ([PC] + disp16] - [rws] [[PC] + disp16] - [rbsl ([PC] + disp16] - [rls] Load the register word (for LOR). byte (for LDRB) or long word (for LDRL) into the memory location addressed using program relative addressing. "Iii ~! o c E '+I • c ~~ . ~-; U E C III .~ 17 ~ A.o! II: m (" N 2 2 7 9-13 X X 0 0 X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X G U C ! ....• • II: ~ 0 E • ~ ~ 2 7 9-13 III "e0 U • U) ... 2 2 2 7 9-13 8 11-15 8 X X [rwdl - [rwdl + [[risll [rwdl - [rwdl + [adrsxl Add the contents of the addressed memory word to the 1 6-bit destination register. [rbdl - [rbd] + [[risll [rbd] - [rbdl + [adrsxl Add the contents of the addressed memory byte to the 8-bit destination register. [rid] - [rid] + [(risll [rid] - [rid] + [adrsx] Add the contents of the addressed memory long word to the 32-bit destination register. [rwd] - [rbd] AND [[risll [rwdl - [rbd] AND [adrsx] AND contents of destination 16-bit register with contents of memory word. [rbdl - [rbdl AND [[risll [rbdl - [rbdl AND [adrsx] AND contents of destination 8-bit register with contents of memory byte. [[ridll-O [adrsxl-O Clear the memory word. ([(ridll - 0 Privileged instruction - can be executed only in system mode . Number of clock cycles depends on the number of repetitions for n/m"; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-l ).m. Table G-3. A Summary of the Z8000 Instruction Set (Continued) Type Mnemonic Operand(s) !• Op Code > III ;; • ~ -sc 0 9 •cu CU~B adrsx 4Ci8 pppp qqqq 4/6 COM COM @rid adrsx ODdO 4DiO pppp qqqq 4/6 COMB COMB @rid adrsx OCdO 4CiO pppp qqqq 4/6 rwd,@ris rwd,adrsx rbd,@ris rbd,adrsx rld,@ris rld,adrsx OBid 4Bid OAid 4Aid 10id 50id @rid,data 1 6 adrsx,data 16 ODdl 4Di1 @rid,data8 adrsx,data8 OCd1 4Cil CP CP CPB CPB CPL CPL 2 2 Clock Cycles Status H D 0 P Operation Performed S Z 11-15 12 15-19 X X 12 15-19 X X X X X X X X X X X X X X X X X X X X 2 qqqq 4/6 2 qqqq 4/6 2 qqqq 4/6' 9-13 14 15-19 X X X X X X 4 6/8 11 14-18 X X X X X X 4 6/8 11 14-18 X X X X X X pppp 2 qqqq 4/6 X X X qqqq 4/6 X X X X X X X pppp 11 13-17 11 13-17 X X pppp pppp pppp C 7 9-13 7 X X X X X X e 0) a, Co) i II: ~ E • ~ ~ III "u c CP CP CPB CPB 0 • yyyy yyyy pppp yyOO yyOO pppp qqqq qqqq (I) DEC DEC DECB DECB . .- @rid,n16 adrsx,n16 @rid,n16 adrsx,n16 2Bdn 6Bin 2Adn ·6Ain X X [adrsx) - 0 Clear the memory byte. [[ridlJ - [[ridlJ [adrsx) - [adrsx) Ones complement the memory word. ([ridlJ - [[ridlJ [adrsx) - [adrsx) Ones complement the memory byte. [rwd) - [[rislJ [rwd) - [adrsx) [rbd) - [[ris)J [rbd) - [adrsx) [rid) - [[rislJ [rid) - [adrsx) Compare contents of register and memory location. Do not modify contents of register or memory location, but set status flags. Use 16bit register/memory word for CP, 8-bit register/memory byte for CPB, 32-bit register/memory long word for CPL. [[ridlJ - data 16 [adrsx) - data 1 6 2 X. X [[ridlJ - data8 [adrsx) - data8 Compare contents of memory location with immediate data. Do not modify memory location, but set status flags. Use 16-bit memory word for CP, 8-bit memory byte for CPB. [[ridlJ - [[ridlJ - n 1 6 [adrsx) - [adrsx) - n 16 [[ridlJ - [[ridlJ - n 16 [adrsx) - [adrsx) - n 16 Subtract the immediate value n 1 6 from the memory word (for DEC) or memory byte (for DECB) addressed by adrsx or [rid). Values in the range 1-1 6 are subtracted. Privileged instruction - can be executed only in system mode . Number of clock cycles depends on the number of repetitions for n/m--; n =minimum number of clock cycles and m = number of clock cycles added for each additional repeti.tion of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 )-m. Table 6-3. A Summary of the Z8000 Instruction Set (Continued) (I) Type Mnemonic Operand(s) Op Code S >- III DIV DIV DIVL DIVL EX EX EXB EXB rld.@ris rld.adrsx rqd.@ris rqd.adrsx rwd.adrsx rwd.@ris rbd.adrsx rbd.@ris lBid 5Bid lAid 5Aid 6Did 2Dsd 6Cid 2Csd INC INC INCB INCB @rid.n16 adrsx.n16 @rid.n16 adrsx.n16 29dn 69in 28dn 68in MULT MULT MULTL MULTL NEG NEG NEGB NEGB rld.@ris rld.adrsx rqd.@ris rqd.adrsx @rid adrsx @rid adrsx 19id 59id 18id 58id ODd2 4Di2 OCd2 4Ci2 OR OR rwd.@ris rwd.adrsx 05id 45id ORB rbd.@ris 04id Clock Cycles Status Operation Performed H D 0 P S Z C 2 qqqq 4/6 2 qqqq 4/6 qqqq 4/6 2 qqqq 4/6 2 note 1 note 1 note 1 note 1 15-19 12 15-19 12 X X X X X X X X X X X X X X X X 2 qqqq 4/6 2 qqqq 4/6 11 13-17 11 13-17 X X X X X X X X X X X X note 2 note 2 note 2 note 2 12 15-19 12 15-19 0 0 0 0 'X X X X X X X X X X X X X X X X X X X X X X pppp 2 qqqq 4/6 2 qqqq 4/6 2 qqqq 4/6 2' qqqq 4/6 X X X pppp ,2 qqqq 4/6 7 9-13 pppp pppp pppp pppp :a "c ~ 'i0 g "c Co) C» I U'I ~ pppp pppp e " '; a:: ~ E " ~ ~ III 'a c 0 Co) " U) pppp pppp pppp 2 X X X 7 X X X X X X X O;y'do } Divide see text for a discussion of these instructions Divide long Divide long [rwd) - - [adrsx) [rwd) - - ([ris)) [rbd) - - [adrsx) [rbd) - - ([ris)) Exchange contents of the addressed memory location with the selected register. Use 8-bit (for EXB) or 16-bit (for EX) registers and memory locations. [[rid)) - [[rid)) + n 1 6 [adrsx) - [adrsx) + n 1 6 [[rid)) - ([rid)) + n 1 6 [adrsx) - [adrsx) + n 1 6 Add the immediate value n 16 to the memory word (for INC) or memory byte (for INCB) addressed by adrsx or [rid). Values in the range 1 16 are added. Multlp'y } Multi I . . . . py see text for a diSCUSSion of these instructions Multiply long Multiply long [[rid)) - - ([rid)) !adrsxl - - !adrsxl ([rid)) - - ([rid)) [adrsx) - - [adrsx) Replace the contents of the memory word (for NEG) or byte (for NEGB) addressed by adrsx or [rid) with its twos complement. !rwd) - [rwd) OR ([ris)) [rwd) - [rwd) OR [adrsx) OR the contents of the specified 16-bit register and memory word. Place the result in the 16-bit register. [rbd) - [rbd) OR ([ris)) Privileged instruction - can be executed only in system mode. - Number of clock cycles depends on the number of repetitions for n/m--; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition -- of operation. The number of clock cycles for an instruction which repeats k times is n + (k-l )-m. Table 6-3. A Summary of the Z8000 Instruction Set (Continued) Type Mnemonic Operand Is) Op Code .. Clock >- Cycles S III ORB rbd,adrsx 44id SUB SUB SUBB SUBB SUBL SUBL rwd,@ris rwd,adrsx rbd,@ris rbd,adrsx rld,@ris rld,adrsx 03id 43id 02id 42id 12id 52id TEST TEST TESTB TESTB TESTL TESTL @rid adrsx @rid adrsx @rid adrsx ODd4 4Di4 OCd4 4Ci4 lCdO 5CiO TSET TSET TSETB TSETB @rid adrsx @rid adrsx ODd6 4Di6 OCd6 4Ci6 XOR XOR XORB XORB rwd,@ris rwd,adrsx rbd,@ris rbd,adrsx 09id 49id Oaid 48id pppp qqqq 4/6 pppp qqqq 4/6 pppp qqqq 4/6 pppp qqqq 4/6 pppp qqqq 4/6 pppp qqqq 4/6 pppp 2 qqqq 4/6 pppp qqqq 4/6 pppp qqqq 4/6 pppp qqqq 4/6 pppp qqqq 4/6 2 2 2 Status H D 0 9-13 7 7 9-13 14 15-19 S Z X X X X X 9-13 X X 1 1 Operation Performed P X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X C -:0 •c ~ ';0 c 0 9 •c .;a:: 0 ! Cf> C11 C11 2 2 a 11-15 a 11-15 13 16-20 X X ~ 0 E :E• ~ III 'a c 0 0 • en ::tI 2 2 2 2 11 14-18 11 14-18 X X X X 7 X X X X 9-13 7 9-13 X X X X X X X X [rbd] - [rbd] OR [adrsx] OR the contents of the specified 8-bit register and memory byte. Place the result in the 8-bit register. [rwd) - [rwd) - [[ris)] [rwd) - [rwd] - [adrsx) [rbd) - [rbd) - [[ris)] [rbdt - [rbd) - [adrsx) [rid) - [rid) - [[ris)) [rid) - [rid] - [adrsx) Subtract the contents of the addressed memory location from the selected destination register. Use 8-bit (for SUBB), 16-bit (for SUB) or 32-bit (for SUBL) memory locations and registers. [[rid)) OR 0 [adrsx] OR 0 [[ridll OR 0 [adrsx) OR 0 [[ridll OR 0 [adrsx) OR 0 OR the specified memory contents with O. Set status flags. Use a 16bit location for TEST, an 8-bit location for TESTB, and a 32-bit location for TESTL. [s] - [[rid)](MSB). [[rid)] - FFFF [s) - [adrsx](MSB). [adrsx) - FFFF [s)- [[rid)](MSB). [[rid)] - FF [s) - [adrsx](MSB). [adrsx) - FF Move the most significant bit of the memory word (for TSET) or byte (for TSETB) to the sign status. Then fill the word or byte with 1 bits. [rwd) - [rwd) XOR [[ris)) [rwd) - [rwd) XOR [adrsx) [rbd) - [rbd) XOR [[risll [rbd) - [rbd) XOR [adrsx) Exclusive OR the contents of the addressed memory location and register. Store the result in the register. Use 16-bit memory and registers for XOR. Use a-bit memory and registers for XORB. CD ~ }> c< '02Q.c: co!!t3 ~(1)t1) COO)/I.) . .. Privileged instruction - can be executed only in system mode . Number of clock cycles depends on the number of repetitions for n/m··; n =minimum number of clock cycles and m = number of clock cycles added for each additional repet ition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-l )·m. Table 6-3. A Summary of the I/) Type !III :aa! E .5 Mnemonic Operand(s) III ...>- Clock Cycles a! Op Code LO rwd,data16 210d yyyy 4 7 LO LO @rid,data 1 6 adrsx,data 1 6 OOd5 40i5 yyyy yyyy pppp 4 6/8 11 14-18 2 5 4 6/8 11 14-18 6 11 2 5 LOB rbd,data8 Cdyy LOB LOB @rid,data8 adrsx,data8 OCd5 4Ci5 zaooo Instruction Set (Continued) Status H 0 0 P Operation Performed S Z C [rwd] - data 16 Load 16-bit immediate data into 16-bit register rwd. [(rid]] - data 1 6 [adrsx] - data 16 Load 16-bit immediate data into memory word addressed by adrsx or [rid]. [rbd] - data8 Load immediate data byte into 8-bit register rbd. [(rid]] - data8 [adrsx] - data8 Load immediate data byte into memory byte addressed by adrsx or [rid]. [rid] - data32 Load 32-bit immediate data into 32-bit register rid. [rwd]-b16 Load the immediate 4-bit value b16 into the low-order four bits of rwd. Clear the remaining twelve bits of rwd. (See Stack operations). qqqq yyOO yyOO pppp qqqq yyyy zzzz LOL rld,data32 140d LOK rwd,b16 BOdb JP JP ,@rid ,adrsx 1Ed8 5Ei8 JR ,disp E8xx 2 6 LOPS- @ris 39s0 2 12 16 C» a.C» PUSH pppp 2 qqqq .4/6 10,15 7-11 a. .,E :::J LOPS- adrsx 79iO pppp qqqq 4/6 16-17 20-23 X X X X X X X X X X X X X X X X X X X X X X X X X X X X [PC]- [(rid]] [PC] - [adrsx] Jump to the specified memory location. This is the same as a conditional jump with cc = always true. [PC] - [PC] + (disp-2) Jump program relative. PC is incremented to the next sequential instruction before disp-2 is added as a signed binary number. This is the same as a conditional jump relative with cc = always true (blank). [FCW] - [(ris]]. [PC] - [(ris] + 1] (nonsegmented) [FCWRES1- [[ris]]. [FCW1- [[ris1 + 11. [PCSEG1- [[ris] + 21 [PCOFF] - [[ris] +3 ] (segmented) [FCW] - [adrsx]. [PC] - [adrsx+ 1] (nonsegmented) [FCWRES1 - [adrsx1. [FCW1 - [adrsx+ 11. [PCSEG1 - ladrsx+21 [PCOFF]- [adrsx+3] (segmented) Load program status and jump as described in accompanying text. I I - P,;v;le..d ;n.truc';on - c.n be e,ecuted only ;n .ys.em mode. -- Number of clock cycles depends on the number of repetitions for n/m--; n =minimum number of clock cycles and m = number of clock cycles added for each additional repeti1tion of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 )-m. Table 6-3. A Summary of the Type. Mnemonic Operand(.) S">- Op Code ID c a• II: CALL CALL CALR @rid adrsx disp 1FdO 5FiO Dxxx cc 9EOc pppp 2. qqqq 4/6 2 Clock Cycle. zaooo Instruction Set (Continued) Statu. H D 0 P Operation Performed S Z C (1) or (2). [PC] - [[ridll (1) or (2). [PC] - [adrsx] (1) or (2). [PC] - [PC] - disp-2 Program relative memory address. Call the addressed subroutine. saving information on the Stack as follows: (1) [SP] - [SP] - 2. [(SPll - [PC] 16-bit PC (nonsegmented) (2) [SP] - [SP] - 4. [[SPll - [PC] 32-bit PC (segmented) If cc is "true" then [PC] - [{SPll.[SP] - [SP] + 2 (for nonsegmented) or [SP] - [~P] + 4. (for segmented). If the condition code specified by cc is "true". return from subroutine . System subroutine call. See accompanying text for a description of this instruction. 10.15 12-21 10.15 .,c "a 'i CJ "c ',j:l RET 2 10.1317 ~ .a ~ U) data8 7Fyy ADD ADDB ADDL rwd.data16 rbd.data8 rld.data32 010d OOOd 160d yyyy yyOO yyyy AND ANDB rwd.data16 rbd.data8 070d 060d CP rwd.data16 CPB CPL SC 2 33.39 4 4 6 7 7 14 yyyy yyOO 4 4 7 7 OBOd yyyy 4 7 rbd.dataS OAOd yyOO 4 rld.data32 100d yyyy zzzz rld.data16 rqd.data32 1BOd 1AOd yyyy yyyy zzzz zzzz X X X X X X X X X X X X X X X X X X X X 7 X X X X 6 14 X X X X 4 6 note 1 note 1 X X X X X X X ·X 0 [rwd] - [rwd] + data 16 [rbd] - [rbd] + data8 [rid] - [rid] + data32 Add immediate data to the destination register. Use 32-bit data/register for ADDL. 16-bit data/register for ADD. 8-bit data/register for ADDB. [rwd] - [rwd] AND data 16 [rbd] - [rbd] AND data8 AND immediate data with destination register contents. Use 16-bit data/register for AND. 8-bit data/register for ANDB. [rwd] - data 16 Compare 16-bit register contents with immediate 16-bit data. Do not modify register contents. but save Status flags. [rbd] - dataS Compare 8-bit register contents with immediate 8-bit data. Do not modify register contents. but save Status flags. [rid] - data32 Compare 32-bit register contents with immediate 32-bit data. Do not modify register contents. but save Status flags. (See secondary memory reference for memory-immediate compare instructions.) Divide } see accompanying text for a discussion of these Divide long instructions en I (J'I ..... ! X ! & 0 Sall is E " .5 CP DIV DIVL X - Privileged instruction - can be executed only in system mode. -- Number of clock cycles depends on the number of repetitions for n/m--; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n - - - - - - - - ----------- + (k-1)-m. - Table 6-3. A Summary of the Z8000 Instruction Set (Continued) 10 Type Mnemonic Operand(s) S Op Code > ID rld,data16 rqd,data32 rwd,data16 190d 180d 050d yyyy yyyy yyyy rbd,data8 040d SUB SUBB SUBL rwd,data16 . rbd,data8 rld,data32 XOR XORB rwd,data16 rbd,data8 DJNZ rw,disp DBJNZ rb,disp MULT MULTL OR Clock Cycles 4 6 4 note 2 note 2 yyOO 4 7 030d 020d 120d yyyy yyOO yyyy 4 4 6 7 7 14 090d 080d yyyy yyOO 4 4 7 7 Fr 1ttttttt 2 11 Fr Ottttttt 2 11 zzzz Status H 0 0 P 0 0 7 Operation Performed S Z C X X X X X X X X X X X X X X X X X X X X ~ •c:::s .~ ORB X c 0 g S t!CD a. 0 zzzz X 1 X X X S «I =sCD E .5 X en U, (X) X X X 'Multiply } see accompanying text for a discussion of these Multiply long instructions [rwd) +- [rwd) OR data 16 OR the contents of the specified 16-bit register with the immediate data word . [rbd) +- [rbd) OR data8 OR the contents of the specified B-bit register with the immediate data byte. [rwd) +- [rwd) - data 16 [rbd) +- [rbd) - data8 [rid) + - [rid) - data32 Subtract immediate data from the destination register. Use 32-bit data/register for SUBL, 16-bit data/register for SUB, 8-bit data/register for SUBB. [rwd) +- [rwd] XOR data 1 6 [rbd) +- [rbd] XOR data8 Exclusive-OR the contents of the register with immediate data. Store the result in the register. Use 16-bit register and data for XOR. Use 8bit register and data for XORB. [rw] +- [rw) - 1. [PC) +- [PC] + 2. If [rw] is not 0, then [PC) + - [PC] - [disp-2) [rb] +- [rb] - 1. [PC] +- [PC) + 2. If [rb] is not 0, then [PC) +- [PC] - [disp-2] Decrement a 16-bit register (for DJNZ) or an 8-bit register (for DBJNZ). Increment the Program Counter as per normal operation. If the decremented register contents is not 0, then subtract twice the displacement, as an unsigned binary number, from the incremented Program Counter, causing a branch back to a lower program memory address. If the decremented register contents is 0, continue execution with the next instruction. c .~ ;; c 0 (J c 0 a. E :::s ~ ~ u c t! ID , - Privileged instruction - can be executed only in system mode. -- Numba, of clock cvcles depend. on the numba, of ,e.e';';on. fo, n/m"; n =mlnlmum num"'" of clock CVcle. and m = numba, of clock cvcle. added fo, each addltl""al ",pell lion . of operation. The number of clock cycles for an instruction which repeats k times is n + (k-l) om. Table 6-3. A Summary of the Z8000 Instruction Set (Continued) Type Mnemonic Operand(s) Op Code !" > CD ;; 6a,"::~ E c: ~ 0 ::!y .c c: u 0 Clock Cycles JP JP cC,@rid cC,adrsx 1Edc 5Eic JR cC,disp Ecxx 2 6 EX EXB rwd,rws rbd,rbs AOsd ACsd 2 2 6 6 LO LOB LOL rwd,rws rbd,rbs rld,rls A1sd AOsd 94sd 2 2 2 3 3 5 pppp 2 qqqq 4/6 Status Operation Performed H D 0 P S Z C If cc is true, [PC) - [[rid]] If cc is true, [PC) - [adrsx) Jump to the memory location specified by adrsx or [rid] if condition code cc is true. If cc is true, [PC) - [PC) + (disp-2) Jump program relative if condition code is true. PC is incremented to address the next sequential instruction before disp-2 is added as a signed binary number. 10,15/7 7-11 Ii :E 'a ~ c: CD 0 U CD > 0 I i::E " ~ ,- CD CII .. CD " II: "a. CD [rwd] - - [rws) [rbd] - - [rbs] Exchange registers' contents for 16-bit (EX) or 8-bit (EXB) registers. [rwd) - [rws] [rbd) - [rbs] [rid) - [rls) Move data between any two 16-bit registers (for LO), 8-bit registers (for LOB) or 32-bit registers (for LOll. II: Cf> (,J'I CD CPO rwd,@ris,rw,cc BBs8 Ordc 4 20 X U X U CPOB rbd,@ris,rw,cc BAs8 Ordc 4 20 X U X U CPDR CPDRB rwd,@ris,rw,cc BBsC rbd,@ris,rw,cc BAsC Ordc Ordc 4 4 20/9-20/9-- X X U U X X U U .c ~ II CD en 'a c: II ~ -!c: ! ~ ~ S ii [rwd] - [[ris]]. If cc true, Z = 1. If cc false, Z = 0 [ris]- [ris]- 2. [rw]- [rw)- 1. If [rwl = 0,0 = 1 otherwise 0 = O. [rbd] - [[ris]]. If cc true, Z = 1. If cc false, Z = O. [ris]- Iris) - 1. [rw]- [rw]- 1. If [rwl = 0,0 = 1 otherwiseO = O. Search a string for a condition. Compare a word in rwd (for CPO) or a byte in rbd (for CPOB) with the next word (for CPD) or byte (for CPDB) in a memory string, using implied memory addressing. Register and memory contents are not modified, nor are Status flags changed, but status conditions are compared with cc. If cc is true, Z is set to 1; otherwise Z is reset to O. Decrement the implied memory address in ris by 2 for CPD, or by 1 for CPDB. Decrement 16-bit counter rw by 1. If rw is 0, set 0 to 1; otherwise reset 0 to O. See CPD. See CPOB. CPO and CPOB are identical to CPO and CPOB, respectively, except that instruction execution is repeated until either Z or 0 status is 1. Interrupts will be acknowledged between reexecutions. - Privileged instruction - can be executed only in system mode. of clock cycles depends on the number of repetitions for n/m--; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition -- Number of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 )-m. Table 6-3. A Summary of the Z8000 Instruction Set (Continued) In Type Mnemonic Operand(s) Op Code t Clock Cycles CD -:sII :s !c 0 ~ Status Operation Performed H D 0 P S Z C CPI rwd,@ris,rw,cc BBsO Ordc 4 20 X U X U CPIB rbd,@ris,rw,cc BAsO Ordc 4 20 X U X U CPIR CPIRB rwd,@ris,rw,cc BBs4 rbd,@ris,rw,cc BAs4 Ordc Ordc 4 4 20/9·· 20/9·· X X U U X X U U CPSO @rid,@ris,rw,cc BBsA Ordc 4 25 X U X U CPSOB @rid,@ris,rw,cc BAsA Ordc 4 25 X U X U CPSDR CPSDRB @rid,@ris,rw,cc BBsE @rid,@ris,rw,cc BAsE Ordc Ordc 4 4 25/14·· 25/14·· X X U U X 'X U U ~ .,e ~ CI) o oa c en II ., .! In c ! ~ 8 iii ... [rwdl - [[ris]]. If cc true, Z = 1. If cc false, Z = O. [risl- [risl + 2. [rwl- [rwl- 1. If [rwl = 0, 0 = 1; otherwise 0 = O. [rbdl - [[ris]]. If cc true, Z = 1. If cc false, Z = O. [risl - [risl + 1. [rwl - [rwl - 1. If [rwl = 0, 0 = 1; otherwise 0 = O. CPI and CPIB are identical to CPO and CPOB, respectively, except that the implied memory address in ris is incremented by 2 for CPI, or by 1 for CPIB. See CPI. See CPIB. CPIR and CPIRB are identical to CPO and CPDB, respectively, except that the implied memory address in ris is incremented by 2 for CPI, or by 1 for CPIB, and instruction execution is repeated until either Z or 0 status is 1. Interrupts will be acknowleged between reexecutions. [[rid]] - [[ris]]. If cc true, Z = 1. If cc false, Z = O. [ridl- [ridl- 2. [risl- [risl- 2. [rwl- [rwl- 1. If [rwl = 0,0 = 1; otherwise 0 = o. [[rid]] - [[risll. If cc true, Z = 1. If cc false, Z = O. [ridl - [ridl - 1. [risl - [risl - 1. [rwl - [rwl - 1. If [rwl = 0, 0 = 1; otherwise 0 = O. Compare two strings for a condition. Compare the next word (for CPSO) or byte (for CPSOB) in a source string with the next word (for CPSO) or byte (for CPSOB) in a destination string. Both strings are addressed using implied memory addressing. No memory contents are modified, nor are any Status flags changed, but status conditions are compared with cc. If cc is true, Z is set to 1. Otherwise Z is reset to O. Decrement the implied memory addresses in ris and rid by 2 for CPSD, or by 1 for CPSOB. Decrement 16-bit counter rw by 1. If rw is 0, set 0 to 1. Otherwise reset 0 to O. See CPSD. See CPSDB. CPSDR and CPSDRB are identical to CPSD and CPSDB, respectively, except that the instructions are reexecuted until either Z or 0 status is 1. Interrupts are acknowleged between reexecutions. Privileged instruction - can be executed only in system mode . Number of clock cycles depends on the number of repetitions for n/m··; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 ).m. Table 6-3. A Summary of the Z8000 Instruction Set (Continued) Type I Mnemonic Op Code Operand(s) t Clock Cycles ID i Status Operation Performed H DIOIPISlzlC CPSI @rid,@ris,rw,cc;1 BBs2 Ordc 4 25 X CPSIB l@rid,@ris,rw,cc:1 BAs2 Ordc 4 I 25 X CPSIR CPSIRB I@rid,@ris,rw,ccl BBs6 @rid,@ris,rw,cc BAs6 Ordc Ordc 4 4 25/14** 25/14** X X LDD I BBsS Ord8 4 I 20 X LDDB I @rid,@ris,rw 'BAs9 Ord8 4 I 20 X LDDR @rid,@ris,rw I BBs9 OrdO 4 20/9** LDDRB @rid,@ris,rw BAsS OrdO 4 20/S** LDI @rid,@ris,rw I BBs 1 Ord8 4 20 I ~ ~ g ~ .I: f 0) m ..... ca GI en ~ ca @rid,@ris,rw I ~ .;c ~ g .JJt ii * I X U I X I U I [[ridll- [[risll. If cc is true Z = 1. If cc is false, Z = o. [rid] +- [rid] + 2. [ris] +- [ris] + 2. [rw] +- [rw] - 1. If [rw] = 0,0 = 1; otherwise 0 = O. U I X I U I [[ridll - Uris]]. If cc is true, Z = 1 . If cc is false, Z = O. [rid] - [rid] + 1. Iris] - Iris] + 1. [rw] - [rw] - 1. If trw] = 0,0 = 1; otherwise 0 = O. CPSI and CPSIB are identical to CPSD and CPS DB, respectively, except that the implied memory addresses in rid and ris are incremented by 2 (for CPS!) or by 1 (for CPSIB). U U III X . X· U See CPSI. USee CPSIB. CPSIR and CPSIRB are identical to CPSD and CPSDB, respectively, except that the implied memory addresses in rid and ris are incremented by 2 (for CPSIR) or by 1 (for CPSIRB) and the instructions are reexecuted until either Z or 0 status is 1. Interrupts are acknowleged between reexecutions. [(ridll - [(ris]]. [rid] - [rid] - 2. Iris] - [ris] - 2. [rw]- [rw]- 1. If [rw] = 0,0 = 1; otherwise 0 = O. [(ridll - [[risll. [rid] - [rid] - 1. [ris] - [ris] - 1. [rw]- [rw]- 1. If [rw] = 0,0 = 1; otherwise 0 = O. Transfer a word (for LDD) or a byte (for LDDB) from the memory location addressed by register ris to the memory location addressed by rid. Decrement addresses in rid and ris by 2 (for LDD) or 1 (for LDDB). Decrement the counter rw by 1. If rw contains 0, set the Overflow status to 1. [[ridll - [[risll. [rid] - [rid] - 2. Iris] - Iris] - 2. [rw]- [rw]- 1. If [rw] :1=0, reexecute. If [rwl = 0, 0 = 1 and end execution. [(ridll - [[risll. [rid] - [rid] - 1. Iris] - [ris] - 1. [rwl- [rwl - 1. If [rw] :1=0, reexecute. If [rw] = 0,0 = 1 and end execution. LDDR and LDDRB are identical to LDD and LDDB, respectively, except that LDDR and LDDRB reexecute until rw has decremented to O. [[ridll - [(risll. [rid] - [rid] + 2. [ris] - [ris] + 2. [rw]- [rw]- 1. If [rw] = 0 then 0 = 1; otherwise 0 = O. Privileged instruction - can be executed only in system mode. Number of clock cycles depends on the number of repetitions for n/m**; n =minimum number of clock cycles and m of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 )*m. = number of clock cycles added for each additional repetition Table 6-3. A Summary of the Z8000 Instruction Set (Continued) 10 Type Mnemonic Operand(s) > CD Clock Cycles ! Op Code Status Operation Performed H D 0 LOIB @rid,@ris,rw BAs1 Ord8 4 20 X LOIR @rid,@ris,rw BBs1 OrdO 4 20/9" 1 LOIRB @rid,@ris,rw BAs1 OrdO 4 20/9" 1 LDM rwd,@ris.n16 1 Cs1 OdOn 4 14/3" LDM rwd,adrsx,n 16 5Ci1 OdOn pppp P S Z ;; • ~ ·ac 0 Y .c 2 en m i') • IV en ~ .. c 6/8 17-21/3" qqqq II $. 10 c t! t~ u LOM @ris,rws,n16 1Cd9 OsOn LDM adrsx,rws,n 1 6 5Ci9 OsOn pppp 4 14/3" 0 iii TROB @rid,@ris,rw B8d8 OrsO 6/8 17-2113" qqqq 4 25 X U C [[ridll - [[ris]). [rid] - [rid] + 1. [ris] - [ris] + 1. [rw] - [rwl - 1. If [rwl = 0, then 0 = 1; otherwise 0 = O. LOI and LOIB are identical to LOO and LOOB, respectively, except that the source and destination addresses ris and rid are incremented by 2 (for LOn or 1 (for LOIB). [[ridll- [[risll. [ridl- [ridl + 2. [risl- [risl + 2. [rwl - [rwl - 1. If [rwl #= 0 then reexecute. If [rwl = 0 then 0 = 1 and end execution. [[ridll- [[risll. [ridl- [ridl + 1. [risl- [risl + 1. [rwl- [rwl - 1. If [rwl #=0 then reexecute. If [rwl = 0 then 0 = 1 and end execution. LDiR and LOIRB are identical to LOO and LOOB, respectively, except that the source and destination addresses ris and rid are incremented; also, LOIR and LOIRB are reexecuted until rw decrements to O. [rwdl - [[risll do n 16 times incrementing register and memory addresses [rwd] - [adrsx] do n 1 6 times incrementing register and memory addresses Move a block of n 1 6 memory words from memory to 1 6-bit registers. adrsx or @ris addresses the first, lowest addressed memory word. rwd addresses the first 16-bit register. n16 can have any value from 1 to 16. (See accompanying text for more details.) ([risll - [rwsl do n16 times incrementing register and memory addresses [adrsxl - [rwsl do n16 times incrementing register and memory addresses This instruction is identical to the one above, except that data moves from registers to memory. Register contents are not affected. ([ridll- [[ris] + IIridlll. [rw]- [rwl- 1. [ridl- [ridl- 1. Translate a memory byte, as described in the accompanying text. Decrement the destination address in rid and the'byte counter in rw. If rw = 0, set 0 to 1. If rw #= 0, reset 0 to O. Byte register RH 1 contents is lost. I ... Privileged instruction - can be executed only in system mode . Number of clock cycles depends on the number of repetitions for n/m"; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 ).m. Table 6-3. A Summary of the Z8000 Instruction Set (Continued) I) Type -:aII :::s Mnemonic Operand(s) Op Code CD > Clock Cycles S Status Operation Performed H D 0 P S Z TRDRB @rid,@ris,rw B8de OrsO 4 25/14·· 1 U TRIB @rid,@ris,rw B8dO OrsO 4 25 X U TRIRB @rid,@ris,rw B8d4 OrsO 4 25/14·· 1 U TRTDB @rid,@ris,rw B8dA OrsO 4 25 X X TRTDRB @rid,@ris,rw B8dE OrsE 4 25/14·· X X TRTIB @rid,@ris,rw B8d2 OrsO 4 25 X X TRTIRB @rid,@ris,rw B8d6 OrsE 4 25/14·· X 'X ~e 0 Y ~ e II II 0) 0, en Co) 'a e II ... .! I) e ! t.Jt. S iii C ([rid]) - ([ris] + ([rid]]]. [rw] - [rw] - 1. [rid] - [rid] - 1. If [rw] = 0,0 = 1 and end execution. If [rw] #:0, reexecute. This instruction is identical to TRDB, except the instruction is reexecuted until [rw] = O. ([rid)) - [[ris] + [[rid]]]. [rw] - [rw] - 1. [rid] - [rid] + 1 TRIB is identical to TRDB except that the destination address in rid is incremented. [[rid)) - [[ris] + [[rid]]]. [rw] - [rw] - 1. [rid] - [rid] + 1. If [rw] = 0, 0 = 1 and end execution. If [rw] #: 0, reexecute. TRIRB is identical to TRDB except that the destination address in rid is incremented; also, TRIRB is reexecuted until [rw] = O. [RH1)- [[ris] + [[rid]]]. [rw] - [rw]- 1. [rid] - [rid)- 1. Load a table byte into 8-bit register RH 1, as described in the accompanying text. Reset Z status to 0 if [RH 1] #: O. Set Z status to 1 if [RH 1] = O. Decrement destination address rid and byte counter rw. If rw = 0, 0 = 1. If rw #: 0, 0 = o. [RH 1] - [[ris) + [[ridnJ. [rw] - [rw] - 1. [rid] - [rid] - 1 If [rw] = 0,0 = 1.lf [rw] #:0, 0 = O. If [RH1] = 0, Z = 1; otherwise Z = O. TRTDRB is identical to TRTDB except that TRTDRB is reexecuted until 0 = 1 or Z = O. [RH 1] - [[ris] + [[rid]]]. [rw] - [rw] - 1. [rid] - [rid] + 1 TRTIB is identical to TRTDB except that TRTIB increments the destination address in rid . [RH1] - [[ris] + [[rid]]]. [rw] - [rw) - 1. [rid] - [rid] + 1 If [rw] = 0,0 = 1. If [rw] #:0, 0 = O. If [RH1] = 0, Z = 1; otherwise Z = O. TRTlRB is identical to TRTDB except that TRTIRB ~ncrements the destination address in rid and reexecutes until 0 = 1 or Z = O. :tJ ~ 1> c< 'Ost Q.c: 00 111 3 !,.iCD ID Clock Cycles ! Status Operation Performed H D 0 5 X 0 X 0 S Z C X X X X X X X X X X X X X X X X X X X X X X X X P ADC ADCB rwd,rws rbd,rbs B5sd B4sd 2 2 ADD ADDB ADDL rwd,rws rbd,rbs rld,rls 81sd 80sd 96sd 2 2 2 4 4 AND ANDB rwd,rws rbd,rbs 87sd 86sd 2 2 4 4 CP rwd,rws 8Bsd 2 4 X X X X CPB rbd,rbs 8Asd 2 4 X X X X CPL rld,rls 90sd 2 8 X X X X DIV OIVL MULT MULTL rld,rws rqd,rls rld,rws rqd,rls 9Bsd 9Asd 99sd 98sd 2 2 2 2 note note note note X X X X X X X X X X X X X X 5 8 X ! I! II a. 0 CJ) 0, ~ i (I) "m II IE: i (I) "m II IE: - Privileged instruction - -- 1 1 2 2 0 0 [rwd) - [rwd) + [rws) + C [rbd] - [rbd] + [rbs] + C Add the source register contents plus the initial Carry to the destination register. Use 16-bit registers for ADC. Use 8-bit registers for ADCB. [rwd) - [rwd) + [rws) [rbd) - [rbd) + [rbs) [rid) - [rid) + [rls) Add the Source register contents to the Destination register. Use 32bit registers for ADDL, 16-bit registers for ADD and 8-bit registers for ADDB. [rwd)- [rwd) AND [rws) [rbd) - [rbd) AND [rbs) AND the Source register contents with the Destination register contents. Use 16-bit registers for AND and 8-bit registers for ANDB. [rwd) - [rws) Compare 16-bit register contents by subtracting the Source register from the Destination register values. Do not modify any register contents, but set Status flags. [rbdl - [rbsl Compare 8-bit register contents by subtracting the Source register from the Destination register values. Do not modify any register contents, but set Status flags. [rid) - [rlsl Compare 32-bit register contents by subtracting the Source register from the Destination register values. Do not modify any register contents, but set Status flags. Divide }see text for a discussion of these instructions Divide long MUltiPlY} see text f or a d'Iscusslon . 0 f th . ese'instructions Multiply long can be executed only in system mode. Number of clock cycles depends on the number of repetitions for n/m--; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 )-m. Table 6-3. IfI Type.. Mnemonic Operand(s) Op Code A Summary of the Z8000 Instruction Set (Continued) ;. Clock Cycles III OR ORB rwd,rws rbd,rbs 85sd 84sd 2 2 4 4 RLDB rbd,rbs BEsd 2 9 Status Operation Performed HIDIOIPlslZIC [rwd] - [rwd] OR [rws] [rbd] - [rbd] OR [rbs] OR the contents of the Source register with the Destination register contents. Use 1 6-bit registers for OR and 8-bit register for ORB. Left rotate BCD digits in two 8-bit registers specified by rbd and rbs. The same register cannot be specified for rbd and rbs. Digits are rotated as follows: XIX XIX X U I IXI X ---- I Gl :s rbd !c: o m UI S !Gl RRDB rbd,rbs BCsd 2 a. U 9 ! III -L '61 ~ ~ S IfI 76543210 '61 rbdl II II: • -..- rwd,rws rbd,rbs B7sd B6sd 2 2 5 5 x X 11 1X X X I I I X X •.--~ 1+'--------1 Right rotate BCD digits in two 8-bit registers specified by rbd and rbs. The same register cannot be specified for rbd and rbs. Digits are rotated as follows: XIX o SBC SBCB 76543210 I I I I I I I I I I I I I I I I I Irbs g m ----- + 76543210 ~ , X X 7 6 _L 543 -'----~+I 2 1 0 I I I I I I I I I I I I I I I I ,rbs -..---..-- + [rwd] - [rwd] - [rws] - C [rbd] - [rbd] - [rbs] - C Subtract the Source register contents, plus the initial Carry, from the Destination register contents using twos complement arithmetic. Use 16-bit registers for SBC. Use 8-bit registers for SBCB. Privileged instruction - can be executed only in system mode. Number of clock cycles depends on the number of repetitions for n/m··; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 ).m. Table 6-3. A Summary of the Z8000 Instruction Set (Continued) Type Mnemonic Operand Is) Op Code !'" > III ! i Status Clock Cycles H X SUB SUBB SUBl rwd,rws rbd,rbs rld,rls 83sd 82sd 92sd 2 2 2 4 4 XOR XORB rwd,rws rbd,rbs 89sd 88sd 2 2 4 4 ClR rwd 8Dd8 2 7 ClRB rbd 8Cd8 2 7 COM rwd 8DdO 2 7 COMB rbd 8CdO 2 7 DAB DEC DECB rbd rwd,n16 rbd,n16 BOdO ABdn AAdn 2 5 2 2 4 4 EXTS rid B1dA 2 11 EXTSB rwd BldO 2 11 EXTSL rqd Bld7 2 11 8 0 1 0 P X X X Operation Performed S Z C X X X X X X X X X X X X X 0_ !1 '" ~ c '61 II C 0 I:C .(,) S- X '"II '61 I:C m en m ! f II Q. .. 0 ! '"II 'iii I:C " "" X X X X X X X X X [rwd] - [rwd] - [rws] [rbd] - [rbd] - [rbs] [rid] - [rid] - [rls] Subtract the Source register contents from the Destination register. Use 32-bit registers for SUBl, 16-bit registers for SUB, 8-bit registers for SUBB. [rwd] - [rwd] XOR [rws] [rbd] - [rbd] XOR [rbs] Exclusive-OR the contents of Source and Destination registers. Store the result in the Destination register. Use 16-bit registers for XOR. Use 8-bit registers for XORB. [rwd]-O Clear the Selected Word register. [rbd]-O Clear the Selected Byte register. [rwd] - [rWcI] Complement the Selected Word register. [rbd] - [rbd] Complement the Selected Byte register. Decimal adjust contents of 8-bit register rbd. [rwd] - [rwd] - n 1 6 [rbd] - [rbd] - n 1 6 Subtract the immediate value n 16 from a 16-bit register (for DEC) or an 8-bit register (for DECB). Bits 16 to 31 of [rid] - bit 15 of [rid]. The sign bit of the low-order word of the register pair is copied into all bits of the high-order word of the register pair. Bits 8 to 1 5 of [rwd] - bit 7 of [rwd] The sign bit of the low-order byte of the register is copied into all bits of the high-order byte of the register. Bits 32 to 63 of [rqd] - bit 31 of [rqd] The sign bit of the low-order register pair of the Quadruple register is copied into all bits of the high-order register pair. Privileged instruction - can be executed only in system mode. Number of clock cycles depends on the number of repetitions for n/m""; n =minimum number of clock cycles and m = number of clock cycles added for each additional ~epetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 )"m. Table 6-3. A Summary of the Z8000 Instruction Set (Continued) III Type Mnemonic Operand(s) Op Code III > Clock Cycles S Operation Performed H D 0 P S Z C INC INCB rwd,n16 rbd,n16 A9dn A8dn 2 2 4 4 X X X X X X NEG NEGB rwd rbd 8Dd2 8Cd2 2 2 7 7 X X X X X X X rwd,1 rwd,2 rbd,1 rbd,2 B3d8 B3dA B2d8 B2dA 2 2 2 2 6 7 6 7 X X X X X X X X X X X X X X X X RL RL RLB RLB X ~ GI :::s c c :;::; 0 0) g ..,J ! m t! GI a. 0 ... SIII .& GI a: • •• RLC RLC RLCB RLCB rwd,1 rwd,2 rbd,1 rbd,2 B3dO B3d2 B2dO B2d2 2 2 2 2 6 7 6 7 I Status X X X X X X X X X X X X X X X X [rwd] - [rwd] + n 16 [rbd] +- [rbd] + n 1 6 Add the immediate value n 16 to a 16-bit register (for INC) or an 8-bit register (for INCB). [rwd] +- - [fwd] [rbd] - - [rbd] Replace the contents of the 1 6-bit register (for NEG) or 8-bit register (for NEGB) with its twos complement. Left rotate contents of word (for RU or byte (for RLB) register, n bits (n = 1 or 2), as follows: ~ I I I I I I I I I I I I I I ~ IIIIII 13J I~ See accompanying text for a discussion of the Overflow status for all Register Operate shift and rotate instructions. Left rotate through Calrry contents of word (for RLC) or byte (for RLCB) register, n bits (n = 1 or 2), as follows: Lm-i I I I I I I I I I I I I I I I;J ~ II IIII P··I d . f an be executed only in system mode. nVI ege Instruc Ion - c .. f Im o ,. n =minimum number of clock I Number of clock cycles depends on the number of. repetlt~ons ~~ n ~ats k times is n + (k-1). eyc es and m h of operation. The number of clock cycles for an instruction w IC re m. I~ = number of clock cycles added for each additional repeti tion Table 6-3. A Summary of the Z8000 Instruction Set (Continued) Type I Mnemonic RR RR RRB RRB I Operand(s) rwd,1 rwd,2 rbd,1 rbd,2 1/1 Op Code B3dC B3dE B2dC B2dE Status t III Clock Cycles 2 2 2 2 6 7 6 7 X X 2 2 2 2 6 7 6 7 H 0 Operation Performed S Z C X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X 0 P Right rotate contents of word (for RR) or byte (for RRB) register, n bits (n = 1 or 2), as follows: rn-4 m-41 I ~ G) = RRC RRC RRCB RRCB rwd,1 rwd,2 rbd,1 rbd,2 B3d4 B3d6 B2d4 B2d6 ~c 0 en m 00 ~ ! I! G) a. 0 "- !1/1 '61 G) a:: .SOA SOAB SOAL rwd,rw rbd,rw rld,rw B3dB B2dB B3dF OrOO OrOO OrOO 4 4 4 18/3" 18/3" 18/3" X X X X X X X X X X X X I 1 I~ Right rotate through Carry contents of word (for RRC) or byte (for RRCB) register, n bits (n = 1 or 2), as follows: [ffi:F I§:tl liJ III --1+1 Shift arithmetic the contents of a byte (for SOAB) word (for SOA) or long word (for SOAL) register. [rwJ specifies the number of shift bit positions, and the direction (+ for left shift, - for right shift). 0 shift is allowed; it causes no shift, but sets status. [rwJ value range is -8 to +8 for SOAB. -16 to + 16 for SOA -32 to +32 for SOAL. Bits 0 to 4 of [rwl are active, with bit 15 used for sign. Shifts occur as follows: Left fu R;ght I :J--f£] 0--lII:!: ]-r I ~O ~I 7 6 1514 31 30 2 2 2 Bit Numbers • liJ I I 0 1 0 1 0 --SOAB--SOA--SOAL - 7 6 1514 31 30 2 2 2 0 1 0 1 0 Bit Numbers Privileged instruction - can be executed only in system mode. Number of clock cycles depends on the number of repetitions for n/m"; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 )·m. Copyright © 1 979 McGraw-Hili, Inc. Table 6-3, A Summary of the Z8000 Instruction Set (Continued) Type I Mnemonic SOL SOLB SOLL I Operand(s) rwd,rw rbd,rw rld,rw Op Code B3d3 B2d3 B3d7 OrOO OrOO OrOO = :- Clock Cycles 4 18/3·· 4 18/3. 0 4 18/3 0 • Status HIDIOIPISIZIC u u u XIX X X X X X X X I Operation Performed SOL, SOLB and SOLL are equivalent to SOA, SOAB and SOAL, respectively, but they perform logical right shifts, Left shifts are identical. Shifts may be illustrated as follows: Right Left m~1 I I J.--E£] [§MIl~1 1 'S= c o 0) m co g SLA SLAB SLAL rwd,data16 rbd,data16 rld,data16 B3d9 B2d9 B3dO yyyy yyyy yyyy 4 4 4 16/3·· 16/3·· 16/3 SLL SLLB SLLL rwd,data16 rbd,data16 rld,data16 B3d1 " B2d1 4 4 4 16/3·· 16/3·· B3d5 yyyy yyyy yyyy 16/3 00 SRA SRAB SRAL rwd,data16 rbd,data16 rld,data16 B3d9 B2d9 B3dO yyyy yyyy yyyy 4 4 4 16/3 16/3·· 16/3·· SRL SRLB SRLL rwd,data16 rbd,data16 rld,data16 B3d1 B2d1 B3d5 yyyy yyyy yyyy 4 4 16/3·· 16/3·· 16/3·· TSET TSETB rwd rbd 80d6 8Cd6 2 TEST TESTB TESTL rwd rbd rid 80d4 8Cd4 9CdO ! ! & o ... !III 0 • 00 x X X X X X X X X X X X X X o X X u u u X X X X X X X X X X X X u u u X o o X X X 7 6 2 0 1514 31 30 2 0 2 0 -SOLB --+ - SOL--+ - SOLL--+ 7 6 1514 3130 I~ 2 2 2 0 0 0 SLA, SLAB and SLAL are identical to SOA, SOAB and SOAL, respectively, when these instructions are performing left shifts, except that SLA, SLAB and SLAL specify the shift bit count immediately. SLL, SLLB and SLLL are identical to SOL, SOLB and SOLL, respectively, when these instructions are performing left shifts, except that SLL, SLLB and SLLL specify the shift bit count immediately. X X SRA, SRAB and SRAL are identical to SOA, SOAB and SDAL, respectively, when these instructions are performing right shifts, except that SRA, SRAB, and SRAL specify the shift bit count immediately. X X '61 ~ :u CD ~ }> c< '02Q.c: qo~i .... coo)'" 4 X X 2 7 2 2 7 XIXXIXX 13 X X [s]- [rwd)(MSB),[rwd]- FFFF [s]- [rbd](MSB), [rbd] - FF Move the most significant bit of the 16-bit register (for TSET) or 8-bit register (TSETB) to the Sign status. Then fill the register with 1 bits. 7 7 2 SRL, SRLB, and SRLL are identical to SOL, SOLB, and SOLL, respectively, when these instructions are performing right shifts, except that SRL, SRLB and SRLL specify the shift bit count immediately. X X X X X X I [rwd] OR 0 [rbd] OR 0 [rid] OR 0 OR the specified register contents with O. Set Status flags based on the result. Test a 32-bit register for TESTL, a 16-bit register for TEST and an 8-bit register for TESTB. • Privileged instruction - can be executed only in system mode. .. Number of clock cycles depends on the number of repetitions for n/m··; n =minimum number of clock cycles and m = number of clock cycles added for each additional repeti'tion of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1).m, Table 6-3. A Summary of the II) Type Mnemonic Operand(s) Op Code S >- Clock Cycles ID 0) .!.J o ~ u S (I) LOCTL' LOCTL' NSPSEG,rws rwd,NSPSEG 70sE 70d6 2 2 7 7 LOCTL' LOCTL' NSPOFF,rws rwd,NSPOFF 70sF 70d7 2 2 7 7 POP POP POP rwdl@ris @rid,@ris adrsx,@ris 97sd 17sd 57si 2 2 8 12 15-19 POPL POPL POPL rld,@ris @rid,@ris adrsx,@ris 95id 15id 55si PUSH PUSH PUSH PUSH @rid,rws @rid,@ris @rid,adrsx @rid,data 16 93is 13is 53di OOd9 @rid,rls @rid,@ris @rid,adrsx 91is 11 is 51di PUSHL PUSHL PUSHL pppp qqqq 4/6 2 2 pppp qqqq 4/6 2 2 pppp yyyy qqqq 4/6 4 2 2 pppp qqqq 4/6 12 19 22-26 9 13 13-17 12 12 20 20-24 zaooo Instruction Set (Continued) Status H D 0 P Operation Performed S Z C [NSPSEG] - [rws] [rwd] - [NSPSEG] Transfer data between a 16-bit register and tahe Z8001 normal Stack Pointer Segment Address register (R 14N). [NSPOFF] - [rws] [rwd] - [NSPOFF] Transfer data between a 16-bit register and the normal Stack Pointer Address register (R15N). [rwd] - [[ris]], Iris] - Iris] + 2 [[rid]] - [[ris]!. Iris] - Iris] + 2 [adrsx] - [[ris]!. Iris] - Iris] + 2 Pop the memory word addressed by ris, the designated Stack Pointer. Any register with the exception of RO (for non segmented) or RRO (for segmented) can be designated as the Stack Pointer. The popped word is loaded into a 16-bit register, or the memory location addressed by adrsx or [rid]. [rid] - [[ris]], Iris] - Iris] + 4 [[rid]] - [[ris]], Iris] - [risl + 4 [adrsxl - [[ris]], Iris] - Iris] + 4 POPL is identical to POP, except that a 32-bit long word is popped. [ridl- [rid]- 2.[[rid]]- [rws] [rid] - [rid] - 2. [[rid]] - [[ris]] [rid]- [rid] - 2. [[rid]]- [adrsx] [rid] - [rid] - 2. [[rid]] - data16 Push a 16-bit word onto a memory stack addressed by rid, the designated Stack Pointer. Any register with the exception of RO (for nonsegmented) or RRO (for segmented) can be designated as the Stack Pointer. The pushed word can come from a register, the memory word addressed by adrsx or Iris!. or it may be immediate data. [rid] - [rid] - 4. [[rid]] - [rls] [rid] - [rid] - 4. [[rid]] - [[ris]] [rid] - [rid] - 4. [[rid]] - [adrsx] PUSHL is identical to PUSH except that a 32-bit long word is pushed, also there is no immediate version of PUSHL. • Privileged instruction - can be executed only in system mode. •• Number of clock cycles depends on the number of repetitions for n/m"; n =minimum number of clock cycles and m = number of clock cycles added for each additional repeti tion of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1).m. Table 6-3. A Summary of the Z8000 Instruction Set (Continued) .." III Type Mnemonic Operand(s) Op Code BIT BIT BIT BIT rwd,b16 @rid,b16 adrsx,b16 rwd,rws A7db 27ib 67ib 270s BITB BITB BITB BITB rbd,b8 @rid,b8 adrsx,b8 rbd,rws A6db 26ib 66ib 260s RES RES RES RES rwd,b16 @rid,b16 adrsx,b16 rwd,rws A3db 23ib 63ib 230s RESB RESB RESB RESB rbd,b8 @rid,b8 adrsx,b8 rbd,rws A2db 22ib 62ib 220s >m Clock Cycles Status Operation Performed H D 0 P S Z pppp qqqq 4/6 OdOO 4 4 8 10-14 10 X X X X 2 2 pppp qqqq 4/6 OdOO 4 4 8 10-14 10 X X X X 2 2 fII c 0 0) .!.J '+l ! a. 0" . iD ... 2 2 pppp OdOO qqqq 4/6 4 2 2 pppp OdOO qqqq 4/6 4 4 11 13-17 10 4 11 13-17 10 C Z - NOT bit b16 of [rwdl Z - NOT bit b16 of [[rid]] Z - NOT bit b 16 of [adrsxl Z - NOT bit [rwsl of [rwdl Set the Z status to the complement of the specified bit, which may be in a 16-bit register or memory word. The bit may be specified immediately, or for a register it may be specified by the low-order four bits of a 16-bit register. Z - NOT bit b8 of [rbdl Z - NOT bit b8 of [[rid]] Z - NOT bit b8 of [adrsxl Z - NOT bit [rwsl of [rbdl Set the Z status to the complement of the specified bit, which may be in an 8-bit register or memory byte. The bit may be specified immediately, or for a register it may be specified by the low-order three bits of one of the registers RO - R7. Bit b16 of [rwdl - 0 Bit b16 of [[rid]]- 0 Bit b 16 of [adrsxl - 0 Bit [rwsl of [rwdl +- 0 Clear the specified bit, which may be in a 16-bit register or memory word. The bit may be specified immediately, or for a register it may be specified by the low-order four bits of a 16-bit register. Bit b8 of [rbdl +- 0 Bit b8 of [[rid]] - 0 Bit b8 of [adrsxl - 0 Bit [rwsl of [rbdl - 0 Clear the specified bit, which may be in an 8-bit register or memory byte. The bit may be specified immediately, or for a register it may be specified by the low-order three bits of one of the registers AO - A7. Privileged instruction - cali be executed only in system mode . Number of clock cycles depends on the number of repetitions for n/m"; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n ~ (k-11.m. Table 6-3. A Summary of the Z8000 Instruction Set (Continued) 1/1 Type Mnemonic Operand(s) ; Op Code III ~ SET :s SET G> ~c 0 g 1/1 c ~ t! G> .. a. SET SET SETB SETB SETB SETB rwd,b16 @rid,b16 adrsx,b16 rwd,rws rbd,b8 @rid,b8 adrsx,b8 rbd,rws A5db 25ib 65ib 250s A4db 24ib 64ib 240s pppp qqqq OdOO pppp OdOO qqqq Status Clock Cycles 2 4 2 11 4/6 4 2 2 4/6 4 13-17 10 4 11 13-17 10 Operation Performed H D 0 P S Z C Bit b16 of [rwd)- 1 Bit b16 of [[rid]) - 1 Bit b 16 of [adrsx] - 1 Bit [rws) of [rwd) - 1 Bit b8 of [rbd] Bit b8 of [[rid]] Bit b8 of [adrsx] Bit [rws] of [rbd] SET and SETB instructions are equivalent to RES and RESB instructions, respectively, except that the selected bit is set. 0 iii 01' int 7C OOOOOOvv 2 6 EI' int 7C 00000lvv 2 6 7BOO 2 13,16 IRET' ~ ...... N . a. E LOCTL' LOCTL' PSAPSEG,rws rwd,PSAPSEG 70sC 70d4 2 2 7 7 LOCTL' LOCTL' PSAPOFF,rws rwd,PSAPOFF 70s0 70d5 2 2 7 7 ! .s ... -- X X X X X X X Oisable the indicated interrupt(s). Either or both of VI and NVI may be indicated. Enable the indicated interrupt(s). Either or both of VI and NVI may be indicated. [SP)- [SP] + 2. [FCW]- [[SP]]: [SP]- [SP) + 2. [PC]- [[SP]] [SP) - [SP] + 2. (Nonsegmented) [SP] - [SP] + 2. [FCW] - [[SP]]. [SP] - [SP) + 2. [PC] - [[SP]] [SP] - [SP] + 4. (Segmented) Return from interrupt. Pop and discard identifier word. Pop flag and control word. Pop Program Counter. [PSAPSEG] - [rws] [rwd] - [PSAPSEG] These two instructions transfer data between the 28001 Program Status Area Pointer Segment register, and a 16-bit general purpose register. [PSAPOFF] - [rws] [rwd] - [PSAPOFF] These two instructions transfer data between the Program Status Area Pointer and a 16-bit general purpose register. Privileged instruction - can be executed only in system mode . Number of clock cycles depends on the number of repetitions for n/m"; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-l )'m. Table 6-3. I/) Type ~ -....I W I/) ~ S Mnemonic Operand(s) Op Code A Summary of the Z8000 Instruction Set (Continued) t CD Clock Cycles COMFLG flag 80f5 2 7 LOCTL' FCW,rws 70sA 2 7 LOCTL' rwd,FeW 70d2 2 7 LOeTLB FLAGS,rbs 8es9 2 7 LOeTLB rbd,FLAGS 8ed1 2 7 RESFLG SETFLG TCC flag flag cC,rwd 80f3 80f1 AFdc 2 2 2 7 7 5 TeeB cC,rbd AEdc 2 5 Status Operation Performed H D 0 P S Z C X X X X X Complement each status named in the operand. Any or all of C, Z, S, P, or 0 may be named in any order. [FCW) - [rws) Load register contents into FCW. Unassigned bits of FCW are not affected. [rwd] - [FeW] Load Few contents into selected register. Unassigned bits of FeW are reset to 0 in rwd. [FLAGS] - [rbs] Load byte register contents into low-order byte of FeW. Bits 0 and 1, which are unassigned, are not affected. [rbd] - [FLAGS] Load the low-order byte of FCW into byte register rbd. Bits 0 and 1 of rbd are reset to O. Reset to 0 each status named in the operand. Set to 1 each status named in the operand. If cc is "true" then set bit 0 of Register rwd. Otherwise reset bit 0 of Register rwd. X X X X X X X X X X X X X X X X X X X X X X X X (I) . .. If cc is "true" then set bit 0 of Register rbd. Otherwise reset bit 0 of Register rbd. Privileged instruction - can be executed only in system mode . Number of clock cycles depends on the number of repetitions for n/m"; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-11·m. - - - - - Table 6-3. A Summary of the Z8000 Instruction Set (Continued) CII Type Mnemonic Operand(s) Op Code t III Clock Cycles 0 P S 7AOO 7DsB 2 2 8/3"" LDCTL" rwd,REFRESH 7Dd3 2 7 7BOA 2 7 X 7BdD 2 12/7"" X rwd 0 0 CII ~ C» III .J:I. "c MRES" 7B09 2 5 Go MSET" 7B08 2 5 e NOP 8007 2 7 III j Z 7 gc fi D REFRESH,rws MREQ" ~ Operation Performed H HALT LDCTL" MBIT" .:., Status X C Halt CPU until reset or interrupt [REFRESH I - [rwsl Transfer the contents of the specified 16-bit register into the Dynamic Memory Refresh Control register. [rwdl-[REFRESHI Transfer the contents of the Dynamic Memory Refresh Control. register to the specified 16-bit register. [SI-Mi _I Set Sign status to 1 if MI is input low (1). Reset Sign status to 0 if MI is input high (01. [ZI- O. If Mi = 1 then [SI- 0 and [MOI- O. If Mi = 0 then [MOI- 1. Decrement [rwdl to O. If Mi is still 0 then [SI - O. [MOl - O. If Mi is now 1 then [SI - 1. [ZI-1. Execute a multi-micro bus request, as described in accompanying text. [MOI-O Output MO high. [MOI-1 Output MO low. No operation. 0 " Privileged instruction - can be executed only in system mode. "" Number of clock cycles depends on the number of repetitions for n/m""; n =minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-11"m. Table 6-4. Z8000 Instruction Set Object Codes Mnemonic AOC AOCB ADD rwd,rws rbd,rbs rwd,adrsx Object Code Bytes B5sd B4sd 41id pppp 2 2 4/6 Clock Cycles 5 5 9-13 Mnemonic AOOB rwd,rws rwd,@ris rbd,adrsx 010d yyyy B1sd 01id 40id pppp AOOL rbd,rbs rbd,@ris rld,adrsx OOOd yyOO BOsd OOid 56id pppp 160d yyyy rld,rls rld,@ris rwd,adrsx 96sd 16id 47id pppp 4 7 2 2 4/6 4 7 9-13 4 7 2 2 4/6 4 7 15-19 ANOB rwd,rws rwd,@ris rbd,adrsx 070d yyyy B7sd 07id 46id pppp BIT rbd,rbs rbd,@ris adrsx,b16 060d yyOO B6sd 06id 67ib pppp BITB adrsx,bB A7db 27ib 270s OdOO 66ib pppp CALL adrsx A6db 26ib 260s OdOO 5FiO pppp 6 14 1FdO 2 2 4/6 7 12 15-19 2 2 2 6/B 7 12 7 14-18 4/6 9-13 4 7 2 2 4 4 7 11 6/B 14-18 4/6 9-13 4 7 2 2 4 4 7 11 4/6 15-19 6 14 2 B 14 COM BCdB OCdB 40iO pppp COMB rwd @rid adrsx BOdO OOdO 4CiO pppp COMFLG CP rbd @rid flag adrsx,data 16 BCdO OCdO BOf5 4Di1 yyyy pppp 2 2 4/6 8 14 9-13 qqqq qqqq qqqq 4 7 2 2 4/6 4 7 9-13 4 7 2 2 4/6 4 7 10-14 rwd,adrsx 4Bid pppp rwd,data16 OBOd yyyy BBsd OBid 00d1 yyyy 4Ci1 yyOO pppp qqqq rwd,rws rwd,@ris @rid,data16 CPB adrSX,data8 qqqq rbd,adrsx 4Aid pppp rbd,dataB OAOd yyOO BAsd OAid OCd1 yyOO 50id pppp qqqq 2 2 4 4 8 10 4/6 10-14 2 2 4 4 B 10 rbd,rbs rbd,@ris @rid,dataB 4/6 CPL rld,adrsx qqqq rld,data32 100d yyyy rld,rls rld,@ris 90sd 10id 12-21 zzzz qqqq @rid 7 B 15-19 rbd @rid adrsx qqqq rbd,b8 @rid,bB rbd,rws 2 2 4/6 CLRB qqqq rwd,b16 @rid,b16 rwd,rws 7 8 11-15 80d8 OOdB 4Ci8 pppp qqqq rbd,dataB 2 2 4/6 rwd @rid adrsx qqqq rwd,data16 10/15 11-15 Oxxx 40i8 pppp qqqq zzzz AND 2 4/6 disp adrsx qqqq rld,data32 Clock Cycles qqqq qqqq rbd,dataB Bytes CALR CLR qqqq rwd,data16 Object Code 2 10/15 6-75 2 Table 6-4. Mnemonic CPO rwd,@ris,rw,cc CPOB rbd,@ris,rw,cc CPOR rwd,@ris,rw,cc CPORB rbd,@ris,rw,cc CPI rwd,@ris,rw,cc CPIB rbd,@ris,rw,cc CPIR rwd,@ris,rw,cc CPIRB rbd,@ris,rw,cc CPSD @rid,@riS,rw,cc CPSDB @rid,@ris,rw,cc CPSDR @rid,@ris,rw,cc CPSDRB @rid,@ris,rw,cc CPSI @rid,@ris,rw,cc CPSIB @rid,@ris,rw,cc CPSIR @rid,@riS,rw,cc CPSIRB @rid,@ris,rw,cc DAB DEC DECB '01 DIV rbd adrsx,n16 rwd,n16 @rid,n16 adrsx,n16 rbd,n16 @rid,n16 int rld,adrsx rld,data16 rld,rws rld,@ris . .. zaooo Instruction Set Object Codes (Continued) Object Code Bytes Clock Cycles BBsS Ordc BAsS Ordc BBsC Ordc BAsC Ordc BBsO Ordc BAsO Ordc BBs4 Ordc BAs4 Ordc BBsA Ordc BAsA Ordc BBsE Ordc BAsE Ordc BBs2 Ordc BAs2 Ordc BBs6 Ordc BAs6 Ordc BOdO 6Bin pppp qqqq ABdn 2Bdn 6Ain pppp qqqq AAdn 2Adn 7C OOOOOOvv 5Bid pppp qqqq 1BOd yyyy SBsd 1Bid 4 20 4 20 4 20/9" 4 20/9" 4 20 4 20 4 20/S" 4 20/9" 4 25 4 25 4 25/14" 4 25/14" 4 25 4 25 4 25/14" 4 25/14" Mnemonic DIVL rqd,adrsx rqd,data32 Object Code Bytes Clock Cycles 5Aid pppp qqqq 1AOd yyyy 4/6 note 1 6 note 1 2 2 2 2 2 4/6 note 1 note 1 11 11 6 15-19 2 2 4/6 6 12 15-19 2 2 2 2 2 2 4 6 12 11 11 11 S/3" 12 2 4 10 12 2 4/6 10 13-17 2 2 4/6 11 13-17 2 2 4 11 21 4 21 4 21110" 4 21110" 4 21 zzzz 2 4/6 2 2 4/6 2 2 2 4/6 DJNZ DBJNZ 'EI EX rqd,rls rqd,@ris rw,disp rb,disp int rwd,adrsx EXB rwd,rws rwd,@ris rbd,adrsx EXTS EXTSB EXTSL 'HALT 'IN rbd,rbs rbd,@ris rid rwd rqd rwd,ioaddr 'INB rwd,@rw rbd,ioaddr INC rbd,@rw adrsx,n16 INCB rwd,n16 @rid,n16 adrsx,n16 'INO rbd,n16 @rid,n16 @rid,@ris,rw 'INDB @rid,@ris,rw 'INOR @rid,@ris,rw 5 13-17 4 11 13-17 4 11 6 note 1 4 note 1 'INORB @rid,@riS,rw 2 2 note 1 note 1 'INI @rid,@ris,rw 9Asd 1Aid Fr Ottttttt Fr 1ttttttt 7C 00OOO1vv 6Did pppp qqqq ADsd 2Dsd 6Cid pppp qqqq ACsd 2Csd B1dA 81dO B1d7 7AOO 3Bd4 pppp 3Dsd 3Ad4 pppp 3Csd 69in pppp qqqq A9dn 29dn 6Sin pppp qqqq A8dn 2Sdn 3Bs8 Ord8 3As8 Ord8 3BsS OrdO 3As8 OrdO 3BsO Ord8 Privileged instruction - can be executed only in system mode . Number of clock cycles depends on the number of repetitions for n/m"; n = minimum number of clock cycles and m = number of clock cycles added for each 'additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k- H ·m. 6-76 4 4 Table 6-4. Z8000 Instruction Set Object Codes (Continued) Mnemonic ·INIB @rid,@ris,rw ·INIR @rid,@ris,rw ·INIRB @rid,@ris,rw ·IRET JP cC,adrsx JR LO cC,@rid cC,disp adrsx,data 16 Object Code Bytes Clock Cycles 3AsO Ord8 3BsO OrdO 3AsO OrdO 7BOO 5Eic pppp 4 21 4 21/10·· 4 21/10·· 2 4/6 13,16 7-11 2 2 6/8 10,15/7 6 14-18 Mnemonic LOB (Cont.) rbd,@ris rid(disp),rbs rid(rw),rbs @rid,data8 qqqq 1Edc Ecxx 40i5 yyyy pppp rbd,ris(rw) LOL @rid,rbs adrsx,rls 6Fis pppp 61id pppp rwd,data16 210d yyyy A1sd 31id xxx x 71id OrOO 21id 33is xxx x 73is OrOO OOd5 yyyy 2Fds 4Ci5 yyOO pppp rwd.ris(rw) rwd,@ris rid (displ.rws rid (rwl.rws @rid,data 16 LOB @rid.rws adrsx,data8 6Eis pppp 60id pppp . .. Cdyy AOsd 30id xxxx 2 4 7 14 4 14 4 11 2 4/6 8 14-18 4/6 12-16 6 11 2 4 5 17 4 17 2 4 11 17 4 17 2 4/6 11 13-16 4 15 4 15 4 12-13 4 15 4 15 4 15 4 15 qqqq rld,data32 140d yyyy 4/6 9-13 rld,rls rld,ris(disp) 4 7 rld,ris(rw) 2 4 3 14 rld,@ris rid(disp),rls 4 14 rid(rwl,rls 2 4 7 14 94sd 35id xxx x 75id OrOO 14id 37is xxxx 77is OrOO 10ds 76id pppp 4 14 zzzz LOA @rid.rls rld,adrsx qqqq rld,ris(disp) 4 11 2 6/8 8 14-18 rld.ris(rw) rwd.adrsx rwd.ris(disp) 4/6 11-15 4/6 9-13 rwd.ris(rw) LOAR rld,disp rwd.disp qqqq rbd,data8 rbd,rbs rbd,ris(disp) 14 11-15 qqqq rbd,adrsx 4 4/6 qqqq adrsx,rbs 70id OrOO 20id 32is xxxx 72is OrOO OCd5 yyOO 2Eds 50is pppp 54id pppp qqqq rwd,rws rwd,ris (disp) Clock Cycles qqqq qqqq rwd,adrsx Bytes rld,adrsx qqqq adrsx,rws Object Code 2 2 4 34id xxxx 74id OrOO 76id pppp 34id xxxx 74id OrOO 340d xxxx 340d xxxx 5 3 14 Privileged instruction - can be executed only in system mode . Number of clock cycles depends on the number of repetitions for n/m··; n = minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 ).m. 6-77 Table 6-4. Z8000 Instruction Set Object Codes (Continued) Mnemonic 'LDcn LOO FCW,rws NSPOFF,rws NSPSEG,rws PSAPOFF,rws PSAPSEG,rws REFRESH,rws rwd,FCW rwd,NSPOFF rwd,NSPSEG rwd,PSAPOFF rwd,PSAPSEG rwd,REFRESH FLAGS,rbs rbs,FLAGS @rid,@ris,rw L008 @rid,@ris,rw LOOR @rid,@ris,rw LOORB @rid,@ris,rw LOI @rid,@ris,rw LOIB @rid,@ris,rw LOIR @rid,@ris,rw LOIRB @rid,@ris,rw LOK LOM rwd,b16 adrsx,rws,n 1 6 LOClLB rwd,adrsx,n 1 6 rwd,@ris,n 16 @rid,rws,n16 'LOPS adrsx LOR @ris disp,rws rwd,disp , " Object Code Bytes Clock Cycles 70sA 70sF 70sE 70s0 70sC 70sB 70d2 70d7 70d6 70d5 70d4 70d3 8Cs9 8Cd1 BBs9 Ord8 BAs9 Ord8 BBs9 OrdO BAs9 OrdO BBs1 Ord8 BAs 1 Ord8 BBs1 OrdO BAs1 OrdO BOdb 5Ci9 OsOn pppp qqqq 5Ci1 OdOn pppp qqqq 1Cs1 OdOn 1Cd9 OsOn 79iO pppp qqqq 39s0 330s xxxx 310d xxxx 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 7 7 7 7 7 7 7 7 7 7 7 7 7 7 20 4 20 4 20/9" 4 20/9" 4 20 4 20 4 20/9" 4 20/9" 2 6/8 17-21/3*· Mnemonic LORB disp,rbs rbd,disp LORL disp,rls rld,disp 'MBIT 'MREQ 'MRES 'MSET MULT rwd rld,adrsx rld,data16 MULTL 6/8 rld,rws rld,@ris rqd,adrsx rqd,data32 NEG rqd,rls rqd,@ris adrsx NEGB rwd @rid adrsx 5 ~7-21/3*' rbd @rid NOP OR rwd,adrsx 4 14/3" 4 14/3" rwd,data16 4/6 16-23 rwd,rws rwd,@ris 2 4 12,16 14 4 14 Object Code 320d xxxx 300d xxxx 370s xxxx 350d xxxx 7BOA 7BdO 7B09 7B08 59id pppp qqqq 190d yyyy 99sd 19id 58id pppp qqqq 180d yyyy zzzz 98sd 18id 40i2 pppp qqqq 80d2 00d2 4Ci2 pppp qqqq 8Cd2 OCd2 8007 45id pppp qqqq 050d yyyy 85sd 05id Bytes Clock Cycles 4 14 4 14 4 17 4 17 2 2 2 2 4/6 7 12/7" 5 5 note 2 4 note 2 2 2 4/6 note 2 note 2 note 2 6 note 2 2 2 4/6 note 2 note 2 15-19 2 2 4/6 7 12 15-19 2 2 2 4/6 7 12 7 9-13 4 7 2 2 4 7 Privileged instruction - can be executed only in system mode. Number of clock cycles depends on the number of repetitions for n/m"; n = minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 I,m. 6-78 Table 6-4. Z8000 Instruction Set Object Codes (Continued) Object Code Bytes Clock Cycles rbd,adrsx 44id pppp 4/6 9-13 rbd,data8 040d yyOO 84sd 04id 3BsA OrdO 3AsA OrdO 3Bs2 OrdO 3As2 OrdO 4 7 2 2 4 4 7 21/10" 4 21/10" 3Bs6 pppp 3Fds 3As6 pppp 3Eds 3BsA Ord8 3AsA Ord8 3Bs2 Ord8 3As2 Ord8 57si pppp 4 12 2 4 10 12 2 4 10 21 4 21 4 21 Mnemonic ORB Object Code Bytes Clock Cycles adrsx,b16 63ib pppp 4/6 13-17 rwd,b16 rwd,rws A3db 230s OdOO 23ib 62ib pppp 2 4 4 10 2 4/6 11 13-17 2 4 4 10 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 11 7 10,13/7 6 7 6 7 6 7 6 7 9 6 7 6 7 6 7 6 7 9 5 5 33,39 18/3" 4 18/3" 4 18/3" 4 18/3" 4 18/3" 4 18/3" Mnemonic RES qqqq 'OTOR rbd,rbs rbd,@ris @rid,@ris,rw 'OTORB @rid,@ris,rw 'OTIR @rid,@ris,rw 'OTIRB @rid,@ris,rw 'OUT ioaddr,rws 'OUTB @rw,rws ioaddr,rbs 'OUTO @rw,rbs @rid,@ris,rw 'OUTOB @rid,@ris,rw 'OUTI @rid,@ris,rw 'OUTIB @rid,@ris,rw POP adrsx,@ris POPL rwd,@ris @rid,@ris adrsx,@ris PUSH rld,@ris @rid,@ris @rid,adrsx 95id 15id 53di pppp @rid,data1 6 OOd9 yyyy 93is 13is 51di pppp qqqq 4 21/10" 4 21/10" . Privileged instruction - 91is 11 is rbd,rw SOAL rld,rw SOL rwd,rw RLOB RR 4 21 RRB 4/6 15-19 RRC 2 2 8 12 22-26 RRCB 4/6 12 19 13-7 4 12 2 2 9 13 20-24 2 2 4/6 qqqq @rid,rls @rid,@ris SOAB RLC qqqq PUSHL RROB SBC SBCB SC SOA @rid,b8 flag cc rwd,1 rwd,2 rbd,1 rbd,2 rwd,1 rwd,2 rbd,1 rbd,2 rbd,rbs rwd,1 rwd,2 rbd,1 rbd,2 rwd,1 rwd,2 rbd,1 rbd,2 rbd,rbs rwd,rws rbd,rbs data8 rwd,rw RLB qqqq @rid,rws @rid,@ris @rid,adrsx qqqq RLCB 4/6 2 2 @rid,b16 adrsx,b8 rbd,b8 rbd,rws RESFLG RET RL qqqq 97sd 17sd 55si pppp RESB A2db 220s OdOO 22ib 80f3 9EOc B3d8 B3dA B2d8 B2dA B3dO B3d2 B2dO B2d2 BEsd B3dC B3dE B2dC B2dE B3d4 B3d6 B2d4 B2d6 BCsd B7sd B6sd 7Fyy B3dB OrOO B2dB OrOO B3dF OrOO B3d3 2 orOo SOLB rbd,rw SOLL rld,rw B2d3 OrOO B3d7 Oroa 12 20 can be executed only in system mode . ,. Number of clock cycles depends on the number of repetitions for n/m"; n = minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-11.m. 6-79 Table 6-4. Z8000 Instruction Set Object Codes (Continued) Object Code Bytes Clock Cycles adrsx,b16 65ib pppp 4/6 13-17 rwd,b16 rwd,rws A5db 2505 OdOO 25ib 64ib pppp 2 4 4 10 2 4/6 11 13-17 Mnemonic SET qqqq SETB @rid,b16 adrsx,b8 Mnemonic 'SOTIA @rid,@ris,rw 'SOTIAB @rid,@ris,rw 'SOUT ioaddr,rws 'SOUTB ioaddr,rbs 'SOUTO @rid,@ris,rw qqqq rbd,b8 rbd,rws SETFLG 'SIN @rid,b8 flag rwd,ioaddr 'SINB rbd,ioaddr 'SIND @rid,@ris.rw 'SINDB @rid,@ris,rw 'SINDA @rid,@ris,rw 'SINDAB @rid,@ris,rw 'SINI @rid,@riS,rw 'SINIB @rid,@ris,rw 'SINIA @rid,@ris.rw 'SINIAB @rid.@riS,rw SLA rwd,data16 SLAB rbd,data16 SLAL rld,data16 SLL rwd.data16 SLLB rbd,data16 SLLL rld.data16 'SOTDA @rid,@riS,rw 'SOTDAB @rid,@ris.rw A4db 240s OdOO 24ib 8Df1 3Bd5 pppp 3Ad5 pppp 3Bs9 Ord8 3As9 Ord8 3Bs9 OrdO 3As9 OrdO 3Bs1 Ord8 3As1 Ord8 3Bs1 OrdO 3As1 OrdO B3d9 yyyy B2d9 yyyy B3dC yyyy B3d1 yyyy B2d1 yyyy B3d5 yyyy 3BsB OrdO 3AsB OrdO 2 4 4 10 'SOUTDB @rid,@ris,rw 2 2 4 11 7 12 4 12 4 21 4 21 4 21/10" 4 21/10" 4 21 4 21 4 21/10" rwd,data16 4 21/10" 4 16/3" rwd,rws rwd.@ris rbd,adrsx 4 16/3" 'SOUTI @rid,@ris,rw 'SOUTIB @rid,@ris,rw SAA rwd,data16 SAAB rbd,data16 SAAL rld,data16 SAL rwd,data16 SALB rbd,data16 SALL rld.data16 SUB rwd,adrsx Object Code Bytes Clock Cycles 3Bs3 OrdO 3As3 OrdO 3Bs7 pppp 3As7 pppp 3BsB OrdB 3AsB OrdB 3Bs3 OrdB 3As3 OrdB B3d9 yyyy B2d9 yyyy B3dD yyyy B3d1 yyyy B2d1 yyyy B3d5 yyyy 43id pppp 4 21/10" 4 21/10" 4 12 4 12 4 21 4 21 4 21 4 21 4 16/3" 4 16/3" 4 16/3" 4 16/3" 4 16/3" 4 16/3" 4/6 9-13 4 7 2 2 4/6 4 7 9-13 4 7 2 2 4/6 4 7 15-19 6 14 2 2 2 8 14 5 qqqq SUBB qqqq rbd,data8 4 16/3" 4 16/3" 4 16/3" 4 16/3" 4 21/10" 030d yyyy 83sd 03id 42id pppp SUBL rbd,rbs rbd,@ris rld,adrsx 020d yyOO 82sd 02id 52id pppp qqqq 4 rld,data32 120d yyyy rld,rls rld,@ris cC,rwd 92sd 12id AFdc zzzz 21/10" TCC , Privileged instruction - can be executed only in system mode. " Number of clock cycles depends on the number of repetitions for n/m"; n = minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + (k-1 I,m. 6-80 Table 6-4. Z8000 Instruction Set Object Codes (Continued) Mnemonic TCCB TEST cC,rbd adrsx Object Code Bytes Clock Cycles AEdc 4Di4 pppp 2 4/6 5 11-15 Mnemonic Object Code Bytes Clock Cycles B8d2 OrsO B8d6 OrsE 4Di6 pppp 4 25 4 25/14*- 4/6 14-18 2 2 4/6 7 11 14-18 2 2 4/6 7 11 9-13 4 7 2 2 4/6 4 7 9-13 4 7 2 2 4 7 TRTIB @rid,@ris,rw TRTIRB @rid,@ris,rw TSET adrsx TSETB rwd @rid adrsx 8Dd6 ODd6 4Ci6 pppp XOR rbd @rid rwd,adrsx 8Cd6 OCd6 49id pppp rwd,data16 090d yyyy 89sd 09id 48id pppp qqqq rwd @rid adrsx TESTB 8Dd4 ODd4 4Ci4 pppp 2 2 4/6 7 8 11-15 qqqq qqqq rbd @rid adrsx TESTL 8Cd4 OCd4 5CiO pppp 2 2 4/6 7 8 16-20 qqqq qqqq rid @rid @rid,@ris,rw TRDB TRDRB @rid,@ris,rw TRIB @rid,@ris,rw TRIRB @rid,@ris,rw TRTDB @rid,@ris,rw TRTDRB @rid,@ris,rw * *" 9CdO 1CdO B8d8 OrsO B8dC OrsO B8dO OrsO B8d4 OrsO B8dA OrsO B8dE OrsE 2 2 4 13 13 25 qqqq 4 25/14-- 4 25 4 25/14** 4 25 rbd,data8 4 25/14-* rbd,rbs rbd,@ris XORB rwd,rws rwd,@ris rbd,adrsx qqqq 080d yyOO 88sd 08id Privileged instruction - can be executed only in system mode. Number of clock cycles depends on the number of repetitions for n/m**; n = minimum number of clock cycles and m = number of clock cycles added for each additional repetition of operation. The number of clock cycles for an instruction which repeats k times is n + {k-1 )·m. Note 1 DIVL DIV Divisor adrsx All Others Not Aborted Divisor is Zero Dividend Too Large Not Aborted Divisor is Zero Dividend Too Large 96-100 14-18 26-29 724-728 31-35 52-56 95 13 25 723 30 51 Note 2 MULl Multiplier adrsx All Others MULTL Normal Multiplier is Zero Normal Multiplier is Zero 71-75 19-22 283 + 7-m - 287 + 7*m 31-35 70 18 282 + 7*m 30 6-81 Table 6-5. Object Code OOOd yyOO OOid 010d yyyy 01id 020d yyOO 02id 030d yyyy 03id 040d yyOO 04id 050d yyyy 05id 060d yyOO 06id 070d yyyy 07id 080d yyOO 08id 090d yyyy 09id OAOd yyOO OAid OBOd yyyy OBid OCdO OCd1 yyOO OCd2 OCd4 OCd5 yyOO OCd6 OCd8 ODdO ODd1 yyyy ODd2 ODd4 ODd5 yyyy ODd6 ODd8 ODd9 yyyy 100d yyyy zzzz toid 11 is 120d yyyy zzzz 12id 13is 140d yyyy zzzz 14id 15id 160d yyyy zzzz 16id 17sd 180d yyyy zzzz 18id 190d yyyy 19id 1AOd yyyy zzzz zaooo Object Codes ADDB ADDB ADD ADD SUBB SUBB SUB SUB ORB ORB OR OR ANDB ANDB AND AND XORB XORB XOR XOR CPB CPB CP CP COMB CPB NEGB TESTB LOB TSETB CLRB COM CP NEG TEST LD TSET CLR PUSH CPL CPL PUSHL SUBL SUBL PUSH LDL LDL POPL ADDL ADDL POP MULTL MULTL MULT MULT DIVL Instruction Object Code Instruction rbd.data8 rbd.@ris rwd.data16 rwd.@ris rbd.data8 rbd.@ris rwd.data16 rwd.@ris rbd.data8 rbd.@ris rwd.data16 rwd.@ris rbd.data8 rbd.@ris rwd.data16 rwd.@ris rbd,data8 rbd,@ris rwd,data16 rwd,@ris rbd,data8 rbd,@ris rwd,data16 rwd.@ris @rid @rid.data8 @rid @rid @rid.data8 @rid @rid @rid @rid.data 1 6 @rid @rid @rid.data 1 6 @rid @rid @rid,data1 6 rld,data32 rld,@ris @rid.@ris rld,data32 rld.@ris @rid,@ris rld.data32 rld.@ris @rid,@ris rld.data32 rld,@ris @rid,@ris rqd.data32 rqd,@ris rld,data16 rld.@ris rqd.data32 6-82 1Aid 1BOd yyyy 1Bid 1CdO 1Cs10dOn 1Cd90s0n 1Dds 1Edc 1FdO 20id 210d yyyy 21id 220s OdOO 22ib 230s OdOO 23ib 240s OdOO 24ib 250s OdOO 25ib 260s OdOO 26ib 270s OdOO 27ib 28dn 29dn 2Adn 2Bdn 2Csd 2Dsd 2Eds 2Fds 300d xxxx 30id xxxx 310d xxx x 31 id xxxx 320s xxxx 32is xxxx 330s xxxx 33is xxxx 340d xxxx DIVL DIV DIV TESTL LDM LDM LDL JP CALL LOB LD LD RESB RESB RES RES SETB SETB SET SET BITB BITB BIT BIT INCB INC DECB DEC EXB EX LOB LD LDRB LOB LOR LD LDRB LOB LOR LD LDAR 34id xxxx LOA 350d xxxx 35id xxx x 370s xxxx 37is xxxx 39s0 3AsO OrdO 3AsO Ord8 3As1 OrdO 3As1 Ord8 3As20rdO 3As20rd8 3As30rdO LDRL LDL LDRL LDL LOPS INIRB INIB SINIRB SINIB OTIRB OUTIB SOTIRB rqd,@ris rld.data16 rld.@ris @rid rwd,@ris.n 16 @rid.rws,n1 6 @rid,rls cc.@rid @rid rbd,@ris rwd,data16 rwd,@ris rbd,rws @rid,b8 rwd,rws @rid.b16 rbd,rws @rid,b8 rwd,rws @rid,b16 rbd.rws @rid,b8 rwd.rws @rid,b16 @rid,n16 @rid,n16 @rid,n16 @rid,n16 rbd.@ris rwd,@ris @rid,rbs @rid,rws rbd,disp rbd.ris(disp) rwd,disp rwd,ris (disp) disp,rbs ridldisp),rbs disp.rws ridldisp).rws rld,disp rwd,disp rld.risldisp) rwd.ris(disp) rld,disp rld,ris Idisp) disp,rls ridldisp).rls @ris @rid,@ris.rw @rid.@ris,rw @rid.@ris,rw @rid,@ris.rw @rid,@ris.rw @rid.@ris.rw @rid.@ris,rw Table 6-5. Object Code 3As30rdS 3Ad4 PPPP 3Ad5 pppp 3As6 PPPP 3As7 pppp 3AsS OrdO 3AsS OrdS 3AsS OrdO 3AsS OrdS 3AsA OrdO 3AsA OrdS 3AsB OrdO 3AsB OrdS 3BsO OrdO 3BsO OrdS 3Bs1 OrdO 3Bs1 OrdS 3Bs20rdO 3Bs20rdS 3Bs30rdO 3Bs30rdS 3Bd4 pppp 3Bd5 pppp 3Bs6 pppp 3Bs7 pppp 3BsS OrdO 3BsS OrdS 3BsS OrdO 3BsS OrdS 3BsA OrdO 3BsA OrdS 3BsB OrdO 3BsB OrdS 3Csd 30sd 3Eds 3Fds 40id pppp qqqq 41 id pppp qqqq 42id pppp qqqq 43id pppp qqqq 44id pppp qqqq 45id pppp qqqq 46id pppp qqqq 47id pppp qqqq 4Sid pppp qqqq 4Sid pppp qqqq 4Aid pppp qqqq 4Bid pppp qqqq 4CiO pppp qqqq 4Ci1 yyOO pppp qqqq 4Ci2 pppp qqqq 4Ci4 pppp qqqq 4Ci5 yyOO pppp qqqq Z8000 Object Codes (Continued) Object Code Instruction SOUTIB INB SINB OUTB SOUTB INORB INOB SINORB SINOB OTORB OUTOB SOT ORB SOUTOB INIR INI SINIR SINI OTIR OUTI SOTIR SOUTI IN SIN OUT SOUT INOR INO SINOR SIND OTOR OUTO SOTOR SOUTO INB IN OUTB OUT AOOB ADD SUBB SUB ORB OR ANOB AND XORB XOR CPB CP COMB CPB @rid.@ris.rw rbd.ioaddr rbd.ioaddr ioaddr.rbs ioaddr.rbs @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw rwd.ioaddr rwd.iqaddr ioaddr.rws ioaddr.rws @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw @rid.@ris.rw rbd.@rw rwd.@rw @rw.rbs @rw.rws rbd.adrsx rwd.adrsx rbd.adrsx rwd.adrsx rbd.adrsx rwd.adrsx rbd.adrsx rwd.adrsx rbd.adrsx rwd.adrsx rbd.adrsx rwd.adrsx adrsx adrsx.dataS NEGB TESTB LOB adrsx adrsx adrsx.dataS 6-83 Instruction 4Ci6 pppp qqqq 4CiS pppp qqqq 40iO pppp qqqq 40i1 yyyy pppp qqqq 40i2 pppp qqqq 40i4 pppp qqqq 40i5 yyyy pppp qqqq 40i6 pppp qqqq 40iS pppp qqqq 50id pppp qqqq 51 di pppp qqqq 52id pppp qqqq 53di pppp qqqq 54id pppp qqqq 55si pppp qqqq 56id pppp qqqq 57si pppp qqqq 5Sid pppp qqqq 5Sid pppp qqqq 5Aid pppp qqqq 5Bid pppp qqqq 5CiO pppp qqqq 5Ci1 OdOn pppp qqqq 5CiS OsOn pppp qqqq 50is pppp qqqq 5Eic pppp qqqq 5FiO pppp qqqq 60id pppp qqqq 61 id pppp qqqq 62ib pppp qqqq 63ib pppp qqqq 64ib pppp qqqq 65ib pppp qqqq 66ib pppp qqqq 67ib pppp qqqq 6Sin pppp qqqq 6Sin pppp qqqq 6Ain pppp qqqq 6Bin pppp qqqq 6Cid pppp qqqq 60id pppp qqqq 6Eis pppp qqqq 6Fis pppp qqqq 70id ora a 71id OrOO 72is OrOO 73is OrOO 74id OrOO 75id OrOO 76id pppp qqqq LOL LOA TSETB CLRB COM CP adrsx adrsx adrsx adrsx.data 16 NEG TEST LO adrsx adrsx adrsx.data 1 6 TSET CLR CPL PUSHL SUBL PUSH LOL POPL AOOL POP MULTL MULT OIVL OIV TESTL LOM adrsx adrsx rld.adrsx @rid.adrsx rld.adrsx @rid.adrsx rld.adrsx adrsx.@ris rld.adrsx adrsx.@ris rqd.adrsx rld.adrsx rqd.adrsx rld.adrsx adrsx rwd.adrsx.n 16 LOM adrsx.rws.n 16 LOL JP CALL LOB LO RESB RES SETB SET BITB BIT INCB INC OECB DEC EXB EX LOB LO LOB LO LOB LO LOA adrsx.rls cc.adrsx adrsx rbd.adrsx rwd.adrsx adrsx.bS adrsx.b16 adrsx.b8 adrsx.b16 adrsx.bS adrsx.b16 adrsx.n16 adrsx.n16 adrsx.n16 adrsx.n16 rbd.adrsx rwd.adrsx adrsx.rbs adrsx.rws rbd.ris(rw) rwd.ris(rw) rid(rw).rbs rid(rwl.rws rld.ris(rw) rwd.ris(rw) rld.ris(rw) rld.adrsx rwd.adrsx Table 6-5. SOsd Slsd S2sd S3sd S4sd S5sd S6sd S7sd S8sd S9sd SAsd SBsd SCdO SCdl SCd2 SCd4 SCd6 SCdS SCs9 8007 SOdO SOfl SOd2 SOf3 SOd4 80f5 80d6 SOd8 90sd 91is 92sd 93is 94sd 95id LOL LOPS HALT IRET MSET MRES MBIT MREQ 01 EI LOCTL LOCTL LOCTL LOCTL LOCTL LOCTL LOCTL LOCTL LOCTL LOCTL LOCTL LOCTL SC AOOB ADD SUBB SUB ORB OR ANOB AND XORB XOR CPB CP COMB LDCTLB NEGB TESTB TSETB CLRB LDCTLB NOP COM SETFLG NEG RESFLG TEST COMFLG TSET CLR CPL PUSHL SUBL PUSH LDL POPL Instruction Object Code Instruction Object Code 77is OrOO 79iO PPPP qqqq 7AOO 7BOO 7B08 7B09 7BOA 7BdO 7C OOOOOOvv 7C 000001vv 7Dd2 70d3 7Dd4 70d5 70d6 70d7 70sA 70sB 70sC 70s0 70sE 70sF 7Fyy zaooo Object Codes (Continued) rid(rw),rls adrsx 96sd 97sd 98sd 99sd 9Asd 9Bsd 9CdO 9EOc AOsd Alsd A2db A3db A4db A5db A6db A7db ASdn A9dn AAdn ABdn ACsd AOsd AEdc AFdc BOdO BldO Bld7 BldA B2dO B2dl yyyy B2dl yyyy B2d2 B2d30rOO B2d4 B2d6 B2d8 B2d9 yyyy B2d9 yyyy B2dA B2dB OrOO B2dC B2dE B3dO B3dl yyyy B3dl yyyy B3d2 B3d30rOO B3d4 B3d5 yyyy B3d5 yyyy B3d6 B3d70rOO B3d8 B3d9 yyyy B3d9 yyyy B3dA B3dB OrOO rwd int int rwd,FCW rwd,REFRESH rwd,PSAPSEG rwd,PSAPOFF rwd,NSPSEG rwd,NSPOFF FCW,rws REFRESH,rws PSAPSEG,rws PSAPOFF,rws NSPSEG,rws NSPOFF,rws data8 rbd,rbs rwd,rws rbd,rbs rwd,rws rbd,rbs rwd,rws rbd,rbs rwd,rws rbd,rbs rwd,rws rbd,rbs rwd,rws rbd rbd,FLAGS rbd rbd rbd rbd FLAGS,rbs rwd flag rwd flag rwd flag rwd rwd rld,rls @rid,rls rld,rls @rid,rws rld,rls rld,@ris 6-84 AODL POP MULTL MULT OIVL OIV TESTL RET LOB LO RESB RES SETB SET BITB BIT INCB INC OECB DEC EXB EX TCCB TCC DAB EXTSB EXTSL EXTS RLCB SLLB SRLB RLCB SOLB RRCB RRCB RLB SLAB SRAB RLB SDAB RRB RRB RLC SLL SRL RLC SOL RRC SLLL SRLL RRC SOLL RL SLA SRA RL SOA rld,rls rwd,@ris rqd,rls rld,rws rqd,rls rld,rws rid cc rbd,rbs rwd,rws rbd,b8 rwd,b16 rwd,b8 rwd,b16 rbd,b8 rwd,b16 rbd,n16 rwd,n16 rbd,016 rwd,n16 rbd,rbs rwd,rws cC,rbd CC,rwd rbd rwd rqd rid rbd,l rbd,data16 rbd,data16 rbd,2 rbd,rw rbd,l rbd,2 rbd,l rbd,data16 rbd,data16 rbd,2 rbd,rw rbd,l rbd,2 rwd,l rwd,data16 rwd~data16 rwd,2 rwd,rw rwd,l rld,data16 rld,data16 rwd,2 rld,rw rwd,l rwd,data16 rwd,data16 rwd,2 rwd,rw Table 6-5. Object Code B3dC B3dO yyyy B3dO yyyy B3dE B3dF OrOO B4sd BSsd B6sd B7sd B8dO OrsO B8d20rsO B8d40rsO B8d60rsE B8d80rsO B8dA OrsO B8dC OrsO B8dE OrsE BAsO Ordc BAs1 OrdO BAs1 Ord8 BAs20rdc BAs40rdc BAs60rdc BAs80rdc BAs90rdO Z8000 Object Codes (Continued) RR SLAL SRAL RR SOAL AOCa AOC SBCB SBC TRIB TRTIB TRIRB TRTIRB TROB TRTOB TRORB TRTORB CPIB LOIRB LOIB CPSIB CPIRB CPSIRB CPOB LOORB Instruction Object Code Instruction rwd,1 rld,data16 rld,data16 rwd,2 rld,rw rbd,rbs rwd,rws rbd,rbs rwd,rws @rd,@ris,rw @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw rbd,@ris,rw,cc @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw,cc rbd,@ris,rw,cc @rid,@ris,rw,cc rbd,@ris,rw,cc @rid,@ris,rw BAs90rd8 BAsA Ordc BAsC Ordc BAsE Ordc BBsO Ordc BBs1 OrdO BBs1 Ord8 BBs20rdc BBs40rdc BBs60rdc BBs80rdc BBs90rdO BBs90rd8 BBsA Ordc BBsC Ordc BBsE Ordc BCsd BOdb BEsd Cdyy Oxxx Ecxx Fr Ottttttt Fr 1ttttttt 6-85 LOOB CPSOB CPORB CPSORB CPI LOIR LOI CPSI CPIR CPSIR CPO LOOR LOO CPSO CPOR CPSOR RROB LOK RLOB LOB CAlR JR OBJNZ DJNZ @rid,@ris,rw @rid,@ris,rw,cc rbd,@ris,rw,Cc @rid,@ris,rw,cc rwd,@ris,rw,cc @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw,Cc rwd,@ris,rw,cc @rid,@ris,rw,cc rwd,@ris,rw,cc @rid,@ris,rw @rid,@ris,rw @rid,@ris,rw,cc rwd,@ris,rw,cc @rid,@ris,rw,cc rbd,rbs rwd,b16 rbd,rbs rbd,data8 disp cC,disp rb,disp rw,disp DATA SHEETS This section contains specific electrical and timing data for the following devices: • • za001 CPU Za002 CPU 6-D1 Z8001,Z8002 Composite AC Timing Diagram x RESET ii, ~ ~ ~ -> NYI -> --®---- ~I~ ----®-l ~--®- ·0 ~ ~ I~ ~ WAIT --@--I This composite timing diagram does not show actual timing sequences. Refer to this diagram only for the detailed timing relationships of Individual edges. Use the preceding illustrations as an explanation of the various timing sequences ~ ~ c: I~ r% ~ ~ ~ (6~.-- 1-L(6~ 40V 2.0V 2.0V :::'V Clock Output Input Floal C X X Timing measurements are made at the follOWing voltages High Low c, ) CLOCK --" ~ ~~ ---q. -~ :P-1 1>-- ADDRESS ~ ) @ DATA OUT 1= -~J- -®- -r--- 'J: --®- ~- :x 20 MEMORY WRITE ~ INPUT/OUTPUT ~ - ~r 32 21 :=jt= NOAM"USY~ BYTElWOAD K: -( "1"' ... _ _ r-~ --®t~ ... ,Jo!'~ ... '38 --® ~~ ---@-I J/ X - Data sheets on pages 21-02 through 21-04 are reprinted by permission of Zilog, Incorporated. _- _- 1----- y-:: ::::/""-- t>-" I 6-02 ~- -®I- ~~ t~~ r-®f--@- ~ ~( -r ... __ . . . . r"I ~ '( ~ --@rl -~~ ~ REA:,~RT;.: 1- f2'i' -®- INTERRUPT~ ACKNOWLEDGE I> ~i ~ D /j6' I---- ~ -® ~~~/ -® ~ ®-- ~ _ --®I---@- ~ -®- II DATA IN MEMORY READ O.SV ±O.5V ~ f( H~- O.SV o SV zaOO1,Z8002 Number Symbol Parameter AC Electrical Clock Cycle Time TcC 1 Characteristics Clock Width (High) 2 TwCh Clock Width (Low) TwCl 3 Clock Fall Time TfC 4 -5--TrC Clock Rise Time TdC(SNv) Clock t to Segment Number Valid (50 pF load) 6 TdC(SNn) Clock t to Segment Number Not Valid 7 TdC(Bz) Clock t to Bus Float 8 TdC(A) Clock t to Address Valid 9 -lO--TdC(Az)-- Clock t to Address Float TdA(DI) Address Valid to Data In Required Valid 11 TsDI(C) Data In to Clock I Setup, Time 12 TdDS(A) DS t to Address Active 13 14 TdC(DO) Clock t to Data Out Valid -15--ThDI(DS)-- Data In to DS t Hold Time 16 TdDO(DS) Data Out Valid to DS t Delay 17 TdA(MR) Address Valid to MREQ I Delay 18 TdC(MR) Clock I to MREQ I Delay 19 TwMRh MREQ Width (High) - 20 - - TdMR(A) - - MREQ I to Address Not Active 21 TdDO(DSW) Data Out Valid to DS I (Write) Delay 22 TdMR(DI) MREQ I to Data In Required Valid 23 TdC(MR) Clock I to MREQ t Delay 24 TdC(ASf) Clock t to AS I Delay - 25 - - TdA(AS) - - Address Valid to AS t Delay 26 TdC(ASr) Clock I to AS t Delay 27 TdAS(DI) AS ! to Data In Required Valid 28 TdDS(AS) DS t to AS I Delay 29 TwAS AS Width (Low) - 30-- TdAS(A) - - AS t to Address Not Active Delay 31 TdAz(DSR) Address Float to DS (Read) I Delay TdAS(DSR) AS! to DS (Read) I Delay 32 TdDSR(DI) DS (Read) I to Data In Required Valid 33 34 TdC(DSr) Clock I to DS t Delay - 35 - - TdDS(DO) - - DS t to Data Out and STATUS Not Valid 36 TdA(DSR) Address Valid to DS (Read) I Delay 37 TdC(DSR) Clock t to DS (Read) I Delay TwDSR DS (Read) Width (Low) 38 TdC(DSW) Clock I to DS (Write) I Delay 39 -40--TwDSW--DS (Write) Width (Low) 41 TdDSI(DI) DS (Input) I to Data In Required Valid 42 TdC(DSf) Clock I to DS (I/O) I Delay 43 TwDS DS (I/O) Width (Low) 44 TdAS(DSA) AS t to DS (Acknowledge) I Delay -45--TdC(DSA)-- Clock t to DS (Acknowledge) I Delay DS (Ack.) I to Data In Required Delay TdDSA(DI) 46 47 TdC(S) Clock I to Status Valid Delay 48 TdS(AS) Status Valid to AS t Delay 49 TsR(C) RESET to Clock t Setup Time -50--ThR(C)--- RESET to Clock t Hold Time 51 TwNMI NMI Width (Low) TsNMI(C) NMI to Clock t Setup Time 52 53 TsVI(C) VI, NVI to Clock t Setup Time 54 ThV!(C) VI, NVI to Clock t Hold Time -55--TsSGT(C)--SEGT to Clock t Setup Time 56 ThSGT(C) SEGT to Clock t Hold Time 57 TsMI(C) Mi to Clock t Setup Time ThMI(C) Mi to Clock t Hold Time 58 59 TdC(Mo) Clock t to Mo Delay -60--TsSTP(C)--STOP to Clock I Setup Time 61 ThSTP(C) STOP to Clock I Hold Time 62 TsWT(C) WAIT to Clock I Setup Time 63 ThWT(C) WAIT to Clock I Hold Time 64 TsBRQ(C) BUSRQ to Clock t Setup Time -65--ThBRQ(C)--BUSRQ to Clock t Hold Time TdC(BAKr) Clock t to BUSAK t Delay 66 TdC(BAKf) Clock t to BUSAK I Delay 67 6-03 MiD 250 105 105 20 400 70 80 0 230 55 190 70 55 330 55 290 70 80 60 0 70 155 80 120 275 160 315 400 960 420 40 180 0 100 140 110 0 70 0 180 0 140 0 70 0 90 0 Max Unit ns 2000 2000 ns ns 2000 20 ns 20--nsns 130 ns ns 65 ns 100 65--nsns ns ns ns 100 nsns ns 80 ns ns nsns ns ns 80 ns 80 nsns 90 ns ns ns nsns ns ns ns 70 nsns ns 120 ns 95 ns nsns ns 120 ns ns 120--nsns 110 ns ns ns nsns ns ns ns nsns ns ns ns 120 nsns ns ns ns nsns 100 ns 100 Z8001,Z8002 Absolute Maximum Ratings Voltages on all inputs and outputs with respect to GND .......... -0.3 V to + 7.0 V Operating Ambient Tempera ture .................. a°e to + 70°C Storage Temperature ........ -65°C to + 150 °e Standard Test Conditions The characteristics below apply for the following standard test conditions, unless otherwise noted. All voltages are referenced to GND. Positive current flows into the referenced pin. Standard conditions are as follows: Stresses greater than those listed under Absolute Maximum Ratings may cause permanent damage to the device. This is a stress rating only; operation of the device at any condition above those indicated in the operational sections of these specifications is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. V"'.,K FROM OUTPUT UNDER TEST DC Characteristics Ordering Information [j GND = l.j ooe ::5 aV TA ::5 =rr! 100',! L +4.75 V ::5 Vcc ::5 +5.25 V ~ ~~ _ All de pardmeters assume a load capacitance of 100 pF max, except for parameter 6 (50 pF max). Timing references between two output signals assume a load difference of 50 pF max. +70 oe Parameter Min Max Unit VCH Clock Input High Voltage VCC-O.4 VCC+0.3 V Driven by External Clock Generator VCL Clock Input Low Voltage -0.3 0.45 V Driven by External Clock Generator VlH Input High Voltage 2.0 VCC+0.3 V -0.3 Symbol VlL Input Low Voltage VOH Output High Voltage VOL Output Low Voltage IlL 0.8 Condition V = = V IOH 0.4 V IOL Input Leakage ±10 p.A 0.4 :s VIN :s +2.4 V IOL Output Leakage ±10 p.A 0.4 :s VOUT :s +2.4 V ICC VCC Supply Current 300 rnA Part Number 28001 CPU Z8002 CPU Temperature Range ooe to ooe to 2.4 -250 p.A +2.0 rnA Number of Pins Package + 70°C 48 CeramiC Segmented 16-Bit Microprocessor +70°C 40 CeramiC Non-Segmented 16-Bit Microprocessor 6-04 Description Chapter 7 THE MOTOROLA MC68000 The MC68000 microprocessor is Motorola's first 16-bit microprocessor. It is the third of the new generation of these devices, having been preceded by Intel's 8086 and Zilog's Z8000. The MC68000 is not program compatible with Motorola's family of 8-bit microprocessors. Motorola has opted for designing an instruction set which provides maximum power and simplicity rather than compatibility. The following is a discussion of interesting MC68000 features as compared to similar capabilities of the Z8000 and 8086: .1) The MC68000 overlaps the fetching of each instruction's object code with the decoding and execution at the two prior instructions to obtain a pipeline effect. The Z8000 uses this approach, but only under certain circumstances. On the other hand, the 8086 performs extensive pipelining using a 6-byte object code pipeline. 2) Both the 8086 and the Z8000 family of microprocessors provide methods of operating the devices in a "simple" system configuration or "complex" system configuration. The 8086 accomplishes this within a Single device by having a number of dual-function pins which serve one function in simple systems and another function in complex systems. The Z8000, on the other hand, is supplied in two versions: the Z8001 for complex configurations and the Z8002 for simple configurations. The MC68000 is contained in a 64-pin package and therefore need not attempt to accommodate different complexities of system configurations; it is always capable of operating in what is, effectively, a "maximum" or "complex" system configuration mode. 3) The MC68000 has built-in logic to handle bus access arbitration in multi-CPU configurations. The 8086 and the Z8000 have equivalent logic. The MC68000 can directly access up to 16 millio!) (16M) bytes of memory with its 24-bit Address Bus. This memory space may be expanded to 64M bytes by using the Function Code lines. In comparison, the 8086 can directly address only 64K bytes of memory but can address up to one million bytes using segment registers. The Z8000 is also limited to 64K bytes of directly addressable memory; however, the Z8001 version can address as many as 48M bytes of memory using internal segment registers and external segmentation in a memory management device. The MC68000 can be operated in either a "Supervisor" or a "User" mode. Certain privileged instructions can be executed in Supervisor mode only. Supervisor and User modes also have separate stack pointers. Thus, in program-intensive applications, systems software (executed in Supervisor mode) can be separated from applications programs (executed in User mode). The Z8000 series microprocessors provide similar capabilities. The Supervisor mode of the MC68000 is equivalent to the System mode of the Z8000, while the User mode of the MC68000 is equivalent to the Normal mode of the Z8000. The 8086 offers no similar operating modes. . 4) 5) 6) 7) The MC68000 has seventeen 32-bit registers. Eight of the registers are designated as Data registers and can be accessed as either 8, 16, or 32-bit registers. The remaining nine registers are designated as Address registers, with two of these being reserved for use as the stack pointers (Supervisor and User). The Address registers can be accessed as 16 or 32-bit registers. All of the registers can also function as Index registers. In contrast. all of the Z8000 registers are 16-bit registers, although they can be paired to operate as 32-bit registers. The 8086 has only four 16-bit registers plus three separate 16-bit Index registers. The MC68000 provides separate pins for every data line and address output line. This is possible since the MC68000 is contained in a 64-pin package and as a result there is no shortage of pin connections. The Z8000 microprocessors and the 8086 are housed in smaller packages and therefore their data and address lines must share some pins. Thus the Z8000 and 8086 devices multiplex some of the data and address signals on the same pins, and you must provide external logic to demultiplex these signals. 7-1 The primary source for the MC68000 is: MOTOROLA SEMICONDUCTOR, INC. 3501 Ed Bluestein Blvd. Austin, Texas 78721 The MC68000 is manufactured using N-channel HMOS process technology. The device is contained in a dual inline 64pin package. A single +5V power supply is required and all signals are TTL-level compatible. The MC68000 requires an external clock which can be run at a maximum frequency of 8 MHz. The minimum instruction execution time is four clock periods. The maximum number of clock periods for instruction execution is 158 for signed division and multiplication. THE MC68000 PROGRAMMABLE REGISTERS Figure 7-1 illustrates the registers provided by the MC68000. There are seventeen 32-bit Data and Address registers, a 32-bit Program Counter (of which only 24 bits are used) and a 16-bit Status register. The most significant difference between the registers provided by the MC68000 and those of other 16-bit microprocessors is that the Data and Address registers are all 32 bits wide. By comparison, the 8086 and Z8000 microprocessors use 16-bit wide registers. The Data registers can be used to handle 8-bit bytes, 16-bit words, or 32-bit long words. The following illustration shows how the various sized operands are positioned within the Data registers. MC68000 DATA REGISTERS Data Register (00-07) Word Operands - - - - -....... .....- - - - - - - - - - - - - Long Word Operands -------------+1 8-bit byte operands occupy bits 0 through 7 of a Data register, while a word operand occupies bits 0 through 15 of a Data register. A long word operand uses all 32 bits of a Data register. When a Data register is used as a source or destination operand, only the appropriate low order portion of the register will be altered by the specified operation; the more significant bits will be unaffected. For example, if you have specified an arithmetic shift left (ASL) instruction with an operand size of eight bits, then only the least significant eight bits (bits 0-7) of the data register will be shifted: bits 8 through 31 will be unchanged by the instruction execution: 8 31 I I. I I I I I ... - . - - - - - - - - - - - Unchanged I 7 6 5 4 3 2 1 0 .....-Sit No. II I I I I II I.. "0" ------------41. , To Carry Flag In addition to being used as the source or destination for instructions the Data registers can also be used as index registers or data counters. 7-2 3130292827262524232221201918171615141312111098765432 1 I I I I I I I I I I I I I I I I I I I I I I O~BitNo.(forall I I I I I I I IDO registers) 101 ~============~======~====~102 ~============~======~====~103 ==============~~====~~====~104 ~============~======~====~I D5 Data Registers ~============~~====~~====~'06 __________________________________ ________________ ________________ ================~====~~====~ ~ ~ 31 ~ ~ID7 o 16 15 lAO ~============~============~IA1 ~============~~============~'A2 ~============~~============~'A3 ~============~~============~'A4 ~============~~============~IA5 Address Registers ~====================~~====================~'A6 A7} Stack Pointers -----------------u;;-Sta;p~Tn;;.----.---·.---------________________ ____________ ,___ _ .!u£!'!!i~~.!:!~.!.o~~ 2423 I IProgram Counter ~--------------~------------------15----------------8-7----------------0~ 1.._____Sy_s_te_m_B,;"yt_e_____IL..._____U_se_r_B..;,y_te____.....1Status Register Figure 7-1. MC68000 Programmable Registers There are seven general purpose Address registers (AO-A6). These registers can handle MC68000 either 16-bit word or 32-bit long word operands. When you use one of these address registers ADDRESS to provide a source operand. either the low order 16 bits will be used (if a word operand has been REGISTERS specified) or the entire 32 bits will be used (if a long word operand has been specified). If the Address register is used as the source for a word operand. then the more significant 16 bits (bits 16-31) will not be affected. If an Address register is used as the destination operand. however. the contents of the entire register will be affected. regardless of whether a word or long word operand is specified. If you specify a word destination operand for an Address register. that word will be automatically sign-extended to 32 bits before it is loaded into the Address register. I. I I I 3130292827262524232221201918171615141312111098765432 1 04--BitNo. I I I I !. I I I I I I I I I I .- I I I I I I I I I I I r~:~~::)gister Word Operands :- .....- - - - - - - - - - - - - - L o n g Word O p e r a n d s - - - - - - - - - - - - - - - t - 7-3 As we have already pointed out. all of the MC6S000 Data and Address registers are 32 bits wide versus the 16-bit wide registers of the lSOOO and SOS6. Another significant difference between the MC6S000 registers and those of the SOS6 is the general purpose nature of the MC6S000 registers. This is similar to the approach taken in the lSOOO and provides the programmer with increased flexibility. Although there are minor differences between the way the Data and Address (AO-A6) registers handle various data widths. each register type may be used in similar ways. The only dedicated registers are the Stack Pointer registers (A7. Supervisor and User). the Program Counter and the Status register. Let us now examine these dedicated registers. MC68000 The MC68000 can be operated in a Supervisor (or system) mode, or in a User (or normal) STACK mode. The state of the S-bit in the Status register determines the mode of operation for the POINTERS MC6S000. Supervisor mode will normally be used by operating system software; User mode will typically be used by application programs. A number of instructions are designated as privileged and can only be executed when the processor is in Supervisor mode. The Supervisor and User modes also have separate stack pointers as mentioned earlier. As you can see in Figure 7-1, both stack pointers are addressed as Address register A7. When the MC68000 is operating in the Supervisor state. the User Stack Pointer cannot be referenced. Conversely. when the MC6S000 is in the User state. the Supervisor Stack Pointer cannot be referenced. Both the User and Supervisor Stack Pointers operate in the same way: the system stacks are filled from high memory to low memory. On subroutine calls the Program Counter contents are pushed onto the appropriate system stack (Supervisor or User). The Program Counter contents will be pulled from the Stack and restored to the Program Counter on return from subroutines. Since the Program Counter is a 32-bit register, four bytes (two words) of memory will be required to save the contents of the Program Counter on the Stack. The organization of the Program Counter contents on the System Stack after a subroutine call is illustrated as follows: Memorv -----, Address , 1514131211109 817 6 5 4 3 2 1 0 04--Bit No. PC low-order word n n-2 MSB LSB PC high-order word n - 4 I - E v e n Byte Odd B y t e - Data that is pushed onto the Stack is always written to a word boundary in memory; that is. to a memory location with an even address. Therefore. when bytes of data must be pushed onto the stack they are written into the high-order half of the memory word. and the low-order half of that word (corresponding to an odd memory address) will be unchanged. The MC68000 addresses memory as either 8-bit bytes or as a 16-bit word comprised of two bytes. All words must be referenced at even address locations. Otherwise. misalignment could occur when the microprocessor attempts to perform a word operation at an odd-memory address. This same problem exists with any of the 16-bit microprocessors. but the MC6S000 is the only microprocessor which automatically checks to ensure that all word references are done at even memory addresses. If a word reference is made to an odd memory address. the MC6S000 begins an exception processing sequence. which will be described later. The following illustration shows how bytes are organized in memory: 15 14 13 12 11 10 9 2 1 0 4 - - B i t No. Byte FFFFFE 8 7 6 Byte FFFFFF 5· 4 3 High Memory Byte FFFFFC Byte FFFFFD Byte FFFFFA Byte FFFFFB Byte FFFFF8 Byte FFFFF9 Byte FFFfF6 Byte FFFFF7 Byte FFFFF4 Byte FFFFF5 Byte 000006 Byte 000007 Byte 000004 Byte 000005 Byte 000002 Byte 000003 Byte 000000 Byte 000001 7-4 Low Memory You will note that the first byte in memory (address 000000) occupies the most significant byte half of a memory word. When words are stored in memory. they are only addressable at even memory addresses. as we have discussed. This can be illustrated as follows: 15141312 11 10 9 8 7 6 5 4 3 2 1 0 4----Bit No. Word FFFFFE High Memory Word FFFFFC Word FFFFFA Word FFFFF8 Word FFFFF6 Word FFFFF4 Word 000006 Word 000004 Word 000002 Word 000000 Low Memory When 32-bit long words (such as 32-bit addresses) are stored in memory. they occupy two adjacent 16-bit memory locations or four bytes. The high-order word of the long words is stored at the higher memory location. as illustrated below: 15 14 13 1 2 11 10 9 8 7 6 5 4 3 2 1 0 " " - - Bit No. ~~_ _ _ _ _ _ !'!2.h..!~!...________ Low-order LSB High Memory ~-------------------~---~----------------- ~~-------~~~~--------~ Low-order LSB ~~---- Long word or address 0------.. LSB ~------------------------------~ Low Memory The MC68000 provides a 16-bit Status register which is divided into two 8-bit bytes: the System byte and the User byte. Figure 7-2 shows the bit assignments for the Status register. The Carry, Overflow, Zero, and Negative bits are the standard ones provided by most microprocessors. MC68000 STATUS REGISTER The Carry (C) bit is set if there is a carry out of the most significant bit following an addition operation, or if a borrow is required from the most significant bit during a subtraction. This status bit is also modified by certain shift and rotate instructions. The Overflow (V) bit is the exclusive-OR of the carries out of the most significant and next higher-order bits of the operand following arithmetic operations. The setting of the overflow bit signifies a magnitude overflow since the result cannot be represented in the specified operand size. The Zero (Z) bit is set whenever the result otan operation is zero; it is reset otherwise. The Negative (N) bit is the equivalent of the Sign status bit provided in most microprocessors. The Negative bit is equal to the value of the most significant result bit following arithmetic operations. If a signed binary arithmetic operation is being performed. a Negative status of 0 specifies a positive or zero result. whereas a Negative status of 1 specifies a negative result. The Extend (X) bit is used in multiprecision arithmetic operations. When it is affected by an instruction, it is set to the same state as the Carry bit. The three most significant bits (bits 5, 6, and 7) of the User byte of the Status register are not currently assigned and will always be zero. 7-5 .... System Byte ~~--14 15 13 --~~~------~, 12 11 10 9 8 IT I ISI I I~ ~ ..--.. User Byte '1~--6 5 4~~~--------" 3 2 0 ______ Bit No. 112111 110 I I I IxlNlzlvlCI " -- ./ j I I~ I~ ~ ~ t Carry Overflow Zero Negative Extend Interrupt Mask Supervisor/User Mode Select Trace Mode Figure 7-2. MC68000 Status Register Bit Assignments The System byte of the Status register contains status information that is system-related. The User byte, on the other hand, contains the Condition Code status bits (X, N, Z, V, and C) that are instruction or program related. Bits in the System byte of the Status register can only be altered when the MC68000 is in the Supervisor mode. The three least significant bits (bits 8, 9, and 10) of the Status register's System byte form the interrupt mask. The MC68000 provides seven levels of interrupts. The level of any given interrupt is decoded from the signal's three interrupt pins, which we will describe later. The interrupt priorities are numbered from 1 to 7, with level 7 having the highest priority, as shown in the following illustration: Interrupt Level Level 7 Level 6 Level 5 Level 4 Level 3 Level 2 Level' Level 0 Interrupt Mask 12 1 1 1 1 0 0 0 0 11 ,, ,, 0 0 0 0 10 , , , , 0 -- Highest priority (Non-maskable) --- Lowest Priority No Interrupt Request 0 0 0 The level 7 interrupt is nonmaskable and thus cannot be disabled. Level 0 represents a "no interrupt request" condition. Levels 1 through 6 are the mask-enabled levels. For example, if you set the mask to 100 then only levels 5, 6, and 7 will be enabled; interrupt levels 1 through 4 are disabled and interrupt requests of those levels will be ignored. Bit 13 of the Status register is the S-bit which specifies whether the MC68000 is in the Supervisor or User mode of operation. When this bit is 1, the MC68000 is in the Supervisor mode, and when it is 0 the microprocessor is in the User mode. Recall that the Supervisor and User modes have their own separate stack pointers; also, certain privileged instructions can only be executed in the Supervisor mode. The most significant bit of the Status register is the Trace mode (T) flag. If this bit is 0 then the MC68000 operates normally. If this bit is 1, however, the microprocessor is in the trace mode of operation. The trace mode is the approximate software equivalent of a hardware implemented single-step mode. After each instruction is executed in the trace mode, a trap is forced so that a debugging program can monitor the results of that instruction's execution. 7-6 Table 7-1. MC68000 Addressing Mode Summary Mode Address Formation Register Direct Addressing Data Register Direct Address Register Direct EA EA Register Indirect Addressing Register Indirect Postincrement Register Indirect Predecrement Register Indirect Register Indirect with Offset Indexed Register In':lirect with Offset EA (AREGn) EA (AREGn); Increment (AREGn) Decrement (AREGn); EA (AREGn) EA (AREGn) + data 1 6 EA (AREGn) + (XREGn) + data8 = DREGn = AREGn Implied Register Addressing = = = = EA = SR. SP. PC Absolute Addressing Absolute Short Absolute Long EA EA = (Next word) = (Next 2 words) Program Counter Relative Addressing Relative with Offset Relative with Index and Offset EA EA = (PC) + data16 = (PC) + (XREG) + data8 Immediate Data Addressing Immediate Quick Immediate Data Next word or words Data inherent in instruction word = = = EA Effective Address DREGn Any Data Register AREGn Any Address Register XREGn Any Data or Address Register used as an Index Register Contents of = = 8-bit offset (displacement) data8 1 6-bit offset (displacement) data 16 SR Status Register SP Stack Pointer (User or Supervisor) PC Program Counter = = = = = = () = MC68000 ADDRESSING MODE SUMMARY The MC68000 provides six basic types of addressing modes. Variations within these types allow a total of fourteen different modes. as summarized in Table 7-1. At this point. we will look only briefly at the addressing modes and how they utilize the registers of the MC68000. We will discuss each of the addressing modes in detail later. just prior to our description of the instruction set. Most of the addressing modes use the 32-bit Address registers either directly or indirectly to generate the effective address. The Data registers can be used as sources for addresses in the direct addressing mode. and they can also be used as Index registers in some of the indirect addressing modes. The indirect addressing modes include post-incrementing or pre-decrementing of an Address register; this capability makes it easy to implement stacks and queues in memory. A number of MC68000 instructions use the implied addressing mode; that is. they make implicit reference to either the Program Counter (PCl. Stack Pointer (SP) or Status Register (SR). For example. Branch. Jump. and Return instructions will all reference the Program Counter and Stack Pointer during their execution. Absolute addressing modes do not utilize the Data or Address registers. but instead form the effective address using data that follows the instruction word in the program. Program Counter relative addressing can use either a displacement or a displacement plus the contents of an Index register to form the effective address. The Index register can be any of the Data or Address registers. Most instructions can utilize any of the addressing modes. and address formation is always the same regardless of the instruction operation itself. These factors do much to enhance the flexibility and power of the instruction set without making the instruction set difficu It to understand. 7-7 04 03 02 01 DO AS UDS LOS R/W OTACK BG BGACK BR Vee ClK GNO HALT RESET VMA E VPA BERR IPl2 IPL1 IPlO FC2 FC1 FCO A1 A2 A3 A4 - :.. -=-: ::: - -:: :: -::: --- - - .. -- - .:: -- .. : - - :: :: - - 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 MC68000 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 -- :.- -=--- -=.- 05 06 07 08 09 ;, 010 011 012 ~ 013 .:~ 014 015 GND A23 A22 --=.. A21 Vee A20 A19 A18 .-=. A17 A16 A15 A14 A13 A12 A11 A10 A9 .... A8 A7 A6 A5 -=- -.. -- -- .. --------.. : ------. . --:. .. Pin Name Description Type 00-015 A1-A23 AS R/W UDS. lOS OTACK FCO. FC1. FC2 IPLO. IPl1. IPl2 BERR HALT RESET elK BR BG Data Bus Address Bus Address Strobe Read/Write Control Upper. lower Data Strobes Data Transfer Acknowledge Function Code (status) Outputs Interrupt Requests Bus Error Halt Processor Operation Reset Processor or Reset External Devices System Clock Bus Request Bus Grant Bus Grant Acknowledge Enable (Clock) Output Valid Memory Address Valid Peripheral Address Power (+5 V) and Ground Bidirectional. Tristate OutPllt. Tristate Output. Tristate Output. Tristate Output. Tristate Input Output. Tristate Input Input !nput/Output Input/Output Input Input Output Input Output Output. Tristate Input B'GACi< E VMA VPA Vee. GNO Figure 7-3. MC68000 Pins and Signal Assignments 7-8 MC68000 PINS AND SIGNALS Figure 7-3 illustrates the signals and pin assignments for the MC68000. At this point. we will briefly discuss each of these signals to provide an overview of how the MC68000 operates. We will defer a detailed discussion of signal and timing interactions until later in this chapter. 00-015 is the bidirectional 16-bit Data Bus. A 1-A23 is the output 24-bit address bus. Because the MC68000 is contained in a 64-pin package. the data and address lines need not be multiplexed onto the same pins. as is the case with the 8086 and Z8000 microprocessors. Note that AO, the least significant bit of the Address Bus, is not output; this bit is used internal to the MC68000. in conjunction with the data size specification of each instruction. to generate the UOS and iJ5S signals. The UOS (Upper Data Strobe) and LOS (Lower Data Strobe) signals determine whether data is being transferred on either the upper (most significant) byte, the low!!..!!.east significant) byte..J!!' both bytes of the 16-bit data bus. Table 7-2 defines the significance of the UDS, LOS, and Read/Write (R/W) signals in relation to the data bus. When ODs is low. data from memory with an even address is accessed and the byte of data is transferred on 08015. When CDs is low. a byte of data located at an odd address is accessed and the transfer occurs on 00-07. When the MC68000 is transferring a word of data (for example. when fetching an instruction) then both ODS and LOS will be low and all 16 of the data lines (DO-015) will be used for the transfer. Table 7-2. MC68000 Oata Bus Control Signal Summary UDs LOS R/W High High - Low Low High Data bits 8-1 5 Data bits 0- 7 Word Read High Low High ··········;·:.e:· ./·:; .:•.. :.:;:::'"•...::;.:::.q ·:.:i:· i '< /.::'::;::;., Data bits 0-7 Byte Read Low High High Data bits 8- 1 5 00-07 08-015 .,"'.·;r:{" ••.• 'Ji:~'}i""x;"} ""';::,';:'.; .;;~L··; :,~:;'.:;. c.' .' .:.''':: •• Operation ,:,;:.:~{·:Jt"';"C.: k.;L:";;;:<:;:;'..:·::'~::i.:,·Z;I~ ".;:;:::,t:.;.•&;.< t;;/··.·!·:.;.·.·;:i"~;:;·!!.j~:::·.•. . :;;2·;A Byte Read Low Low Low Data bits 8-1 5 Data bits 0- 7 Word Write High Low Low Data bits 0- 7 Data bits 0-7 Byte Write Low High Low Data bits 8- 1 5 Data bits 8- 1 5 Byte Write [Z] No valid data output or input '. Table 7-3. MC68000 Function Code Summary FC2 FC1 FCO o o o o o o Machine Cycle Type User data memory access o User program memory access o o o o 1 Supervisor data memory access o Supervisor program memory access Interrupt acknowledge 1>,>,1 Reserved. currently undefined 7-9 Byte Memory with Even Addresses Byte Memory with Odd Addresses A1-A23 08-015 A 1-A23 00-07 AS - - - - 4 UOS - - - - f LOS - - - - f __________ A1-A23~ ~~ ______________________________ T-~ __ ~ 00-07 08-015 Figure 7-4. MC6S000 Interface to Memory The memory interface implied by the UDS and LOS signals is illustrated in Figure 7-4. Byteoriented memory with even addresses will be selected by UOS. and that memory s data lines are connected to OS-015. LOS references byte memory with odd addresses. and its data will be applied to 00-07 of the Oata Bus. The AS line. shown in Figure 7-4. is the Address Strobe which is pulsed low to indicate that a valid data address is being output on the Address Bus (A 1-A23). MC68000 MEMORY INTERFACE DTACK is the Data Transfer Acknowledge input signal. This signal must be asserted by external logic during every read or write cycle. When the MC6S000 is performing a read or write cycle. it will automatically insert wait states in the cycle until the OTACK signal is received. This approach is thus the inverse of the logic used by most other microprocessors: for example. both the Z8000 and SOS6 have a "wait" input which external logic can use to extend a read or write cycle - if the wait input is not asserted. the read/write cycle will finish normally. The MC6S000 approach provides for completely asynchronous bus operations that can interface to any type of device regardless of that device's speed. This approach specifies. however. that all devices in the system must include sufficient logic to generate the i5TACK signal. FCO, FC1, and FC2 are the Function Code or processor cycle status outputs. These outputs identify the type of bus activity currently being performed by the MC68000, as summarized in Table 7-3. The Function Code outputs are valid whenever AS is true. Five different types of cycles are currently defined: access to either supervisor data memory, supervisor program memory, user data memory, or user program memory, and interrupt acknowledge cycles. Whenever the MC6S000 is involved in fetching instructions. it is considered as accessing program memory. All other memory accesses are identified as data memory accesses. The Function Code outputs could be used to separate memory into the four different categories - user versus supervisor and program versus data. Thus. by using the FC outputs an MC68000 system could directly address up to 64 megabytes of memory. with 16 megabytes devoted to each of the four defined memory categories. i'PLQ, iPL1, and IPL2 are the interrupt request inputs. These three inputs are decoded internally by the MC68000 to determine the priority level of the interrupt request. You will recall from our earlier discussion of the Status register that there is a 3-bit interrupt mask which determines what level of interrupt request will be permitted. When all three interrupt inputs are low. a non-maskable interrupt (level 7. which is the highest priority) is present. This level is always recognized by the MC6S000. When all three of the interrupt inputs are high. it indicates that no interrupt is being requested. BERR is the Bus Error input. When this signal is low the MC68000 performs a sequence (exception processing sequence) similar to that which it executes in response to an interrupt request. The purpose of the ftliI!i signal is to inform the MC68000 when an external device has not responded (using the DTACK input) within an expected amount of time during a read or write operation. Since the data transfer handshaking approach used by the MC6S000 requires all external devices to actively respond to every data transfer. the system should include a mechanism to ensure that the processor is not hung up indefinitely by a device that fails to respond. Thus external logic should be provided to monitor bus activity and which would utilize the BERR signal to inform the MC6S000 of a "failure to respond" condition. This logic would separate the preceding cause of a bus error from other causes. such as might 7-10 be generated with a Memory Management Unit (MMU). The MMU would generate BERR if an attempt was made to access protected memory. As we have already mentioned. the reaction of the MC68000 to the Bus Error input is similar to the interrupt request response. We will describe this response. termed "exception processing." in detail later in this chapter. Essentially. exception processing causes processor status information to be saved. and then allows the processor to execute a program to analyze the cause of the error. The MC68000 also provides a hardware-oriented response to a bus error: if the HALT signal is asserted in conjunction with the BERR signal. the MC68000 will automatically retry the bus cycle that produced the error. The HAi:T signal performs several functions. As we mentioned in the preceding paragraph. it can be used in con· junction with the BERR signal to initiate rerunning of bus cycles that produced bus errors. When used alone. it places the MC68000 in a Halt state where the processor is essentially inactive until the HALT signal is negated. This is the familiar Halt function provided by most microprocessors. The HALT signal is also used in conjunction with the R'E'SEi" signal to intialize the MC68000. One unusual aspect of the RESET signal is the fact that it is also an ouput signal; the MC68000 provides a RESET instruction which, when·executed. causes a low-going pulse to be output on the REffi pin. Thus. you can execute a RESET instruction and use it to initialize other devices in the system without resetting the processor. HALT. like iiE'S'ET. is an output signal. If the processor ceases executing instructions - for example. if a double bus fault condition occurs - the MC68000 will output iiAi:i" low. External logic can be then used to detect this potentially catastrophic condition. ClK is the single TTL-level compatible clock from which all MC68000 internal timing is derived. iiR (Bus Request). BG (Bus Grand, and BGACK (Bus Grant Acknowledge) ar,e all bus arbitration signals. These signals are used in systems where other devices. such as DMA controllers on other processors. require control of the System Busses. External devices request access to the System Bus by asserting the BR input. The MC68000 will then always relinquish the bus after it has completed the current bus cycle. It will also output Bus Grant (BG) low to let the requesting device know that the bus will become available at the end of the current cycle: However. as we will see v:..hen we discuss the bus arbitration timing in detail. external devices or logic must monitor more than just the Bus Grant signal to determine when the bus will actually be available. The Bus Grant Acknowledge (BGACK) signal must be input to the MC68000 by the device requesting the bus once that device takes control of the bus. BGACK must be held low until the device has completed its bus access operations. Thus BGACK is essentially a "bus busy" signal that lets the MC68000 (and other devices in the system) know that the bus is unavailable. The next three signals - E. VPA. and VMA - are provided so that the MC68000 can be easily interfaced to the standard and widely available 6800 family devices. 6800-based systems use a synchronous method of effecting transfers of data throughout the system. To accomplish this a system clock Enable (E) signal must be distributed to all 6800 devices in the system so that all relevant data transfers may be synchronized to this clock signal. Thus the Enable (E) signal provided by the MC68000 is the equivalent of the 6800 E signal. The frequency of E is equal to onetenth that of the ClK input to the MC68000: the period for E is equal to 10 ClK periods - E is low for six ClK cycles and is high for four ClK cycles. The Valid Peripheral Address (VPA) signal is used by 6800-type devices in the system to inform the MC68000 that a 6800-type data transfer is required. You must provide address decoding logic in the system that determines when a 6800-type device is being accessed and that generates the WA signal. When the MC68000 receives the VPA signal, it alters the data transfer timing so that it is synchronous with the Enable (E) signal. The MC68000 will then output the Valid Memory Address (VMA) signal at the appropriate time. VMA is another 6800-type signal and will only be output if the VPA input signal has been asserted at the beginning of a data transfer operation. We will defer a detailed discussion of these three signals until later when we describe interfacing between the MC68000 and the 6800-family devices. MC68000 TIMING AND BUS OPERATION The basic timing for the MC68000 is quite straightforward: instruction execution consists of a combination of internal cycles and bus access cycles. The total number of clock cycles required for each instruction is defined in the instruction set summary tables later in this chapter. The number of clock cycles required to perform operations internal to the MC68000 are of little interest to other devices in the system since these operations are transparent to external logic. It is only when the MC68000 requires access to the system bus for such operations as instruction fetching. operand fetching. and operand storing that external devices become involved with MC68000 timing. The MC68000 uses memory mapped I/O. Therefore, bus accesses for data transfers between the MC68000 and 7-11 I 50 I 51 I 52 I 53 I 54 55 I 56 I 57 I 50 I 51 I 52 I ClK A1-A23 R/W 08-015 00-07 FCO-FC2 Figure 7-5. MC68000 Read Word Timing memory are the same as for those between the MC68000 and I/O devices. Data transfers are defined as either read or write operations, with the transfer of data into the MC68000 defined as a "read" and the transfer of data from the MC68000 to external logic defined as a "write." Figure 7-5 illustrates the timing for a read word operation. For purposes of the following timing discussions. each clock period is sub-divided into two states. MC68000 READ TIMING During state 0 (SO) of the read word cycle. the address and data busses are in the high impedence state - the MC68000 is not using the System Bus at this point. Address information for the memory or I/O location is output at the beginning of state 1 (51) on the Address Bus (A 1-A23L Processor cycle status information is also output at this point on the FCO-FC2 pins. The Address Strobe (AS) signal is asserted at the beginning of state 2 and can be used by external logic to latch the information on the Address Bus. Simultaneously. the Upper Data Strobe (05'$') and Lower Data Strobe (Ci5$) signals are asserted to enable selection of both the most significant byte and least significant byte of a 16-bit word. You will note that these signals are not actually data "strobes" since there is no data ready to be input or output at this point; it is more accurate to think of them as memory select signals selecting the upper and/or lower byte of a 16-bit memory word. R/W is normally asserted. so this output does not change during a read cycle. The MC68000 now waits for the addressed memory or I/O device to present its data on the Data Bus. When the data is ready. the external device must assert Data Acknowledge (DT ACK) to the MC68000. The MC68000 expects DT ACK and the requested data to be present by state 5 (S5). If DTACK is not present by 55. Wait states (SW) will be automatically 7-12 inserted into the read timin~y~as illu~ted in Figure 7-6. Once DTACK is true. the read cycle continues with S5. At the end of state 6 (S6). the AS. UDS. and lOS signals are negated. At this point the incoming data on DO~Q15 is lat<;:hed into an internal MC68000 register. External devices can use the negative-to-positive transition ot" AS. 'ODS. or CDS as the indication that they can remove data from the Data Bus. TheMC68000 maintains the address information and function code information through the end of state 7 (S7) to allow for signal skew within the system. Note that when the external device senses that the MC68000 has captured the data from the Data Bus (by sensing the high-going transition of AS. DDS. or lOS) that device must return DT ACK high immediately so that it does not interfere with the beginning of the next bus cycle. If you refer to the Wait state insertion that can occur during read operations. as illustrated in Figure 7-6. you will see that the Wait states occur between state 4 and state 5. The MC68000 will maintain valid address output on the address Bus and will hold AS: ODs. and IDS low during any Wait states for as long as necessary until 5TACK is asserted. You should note that there will always be an even number of Wait states inserted; all MC68000 operations are based on a complete elK cycle and there are two "states" per ClK cycle. I 50 I 51 I 52 I 53 I 54 5W I 5W I 5W I 5W S5 I S6 elK A1-A23 R/W 00-015 Figure 7-6. MC68000 Wait States During Read Operations 7-13 I 57 I SO ClK A1-A23---{~______________~~~______________~~~______________ _--, \.... \. . .__r R/W 08-015 -------PV><.,. DO-07----------------------------~~ H. ._____...)~------ FCO-FC2 - - - {..._ _ _ _ _... Figure 7-7. MC68000 Read Byte Timing Timing for a read byte operation is illustrated in Figure 7-7. This figure shows first an even data byte and then an odd data byte being read by the MC68000. As you can see, the only difference between this timing and that illustrated for a read word operation in Figure 7-5 is that only 0i5S or is asserted and only eight lines of the data bus are utilized when you are reading a byte: UOS is asserted and data is on lines 08-015 when reading a byte located at an even address and IDS is asserted and data is on lines 00-07 when reading a byte located at an odd address. You should not be misled by Figure 7-7 into thinking that the MC68000 always reads two consecutive bytes - an even byte and an odd byte. We have simply shown these two read operations consecutively to illustrate timing for both. Again, if the MC68000 requires a word of data, it will utilize the entire 16-bit Oata Bus and read the full word in one operation. rns 7-14 Timing for a write word operation is illustrated in Figure 7-S. As was the case with read operaMC6S000 tions. the address for the memory location or I/O device is output at the beginning of 51 along WRITE with the appropriate function code indicating the current type of processor bus cycle. If the Data TIMING Bus was utilized by the MC6S000 in the preceding cycle. the processor returns all of t.h.e data outputs to the high impedence state during 51 and then asserts the Address Strobe (AS) signal and outputs the Read/ Write (R/W) Signal low. Once again. AS can be used to latch the address externally. and the R/W Signal indicates to memory or I/O devices that the MC6S000 will be placing data onto the Data Bus. No further Signal activity occurs until the MC6S000 outputs the data on 00-015 at the beginning of state 3 (53), The Upper and Lower Data Strobe signals (UDS. LOS) are asserted at the beginning of state 4 (54). During write operations. these two signals can be used as "strobe" signals since they indicate that the data on the Data Bus is valid. If the write operatio~roceed unimpeded. external logic must respond to the data strobe signals by asserting the Data Acknowledge (DT ACK) Signal by the beginning of state 7 (57). If DTACK is not true by the beginning of 57, Walt states are automatically inserted by the MC6S000, as illustrated in Figure 7-9. This "slow write" operation is the same as was illustrated for read operations except that the Wait states are inserted at a different point in the cycle. The MC6S000 outputs the data on 00-015 through the entire write operation. The Address Strobe (AS) and data strobes (UDS. LOS) are negated at the beginning of state 9 (59) and the Read/Write (R/W) signal is returned high at the end of S9. At that point. the Address Bus. Data Bus. and Function Code outputs are all returned to their high impedance state to free the System Bus for other uses. The external memory or I/O device that was accessed by the write operation I 50 I 51 I 52 I 53 I 54 I 55 I 56 57 I 58 I ClK A1-A23 AIW 08-015 00-07 FCO-FC2 Figure 7-S. MC6S000 Write Word Timing 7-15 59 I 50 I elK A1-A23 R/W 00-015 - - - - -..... Figure 7-9. MC68000 Wait States During Write Operations must release the Data Acknowledge (DT ACK) signal after it has detected the positive-to-negative transition of the address or data strobe signals. This ensures that a subsequent bus cycle will not be impeded. Timing for write byte operation is illustrated in Figure 7-10. As you can see, the only difference between this operation and the write word timing illustrated in Figure 7-8 is the fact that only ODs or L5S is output while a byte is being written. 7-16 MC68000 READ-MODIFY-WRITE TIMING The read-modify-write cycle provided by the MC68000 is unusual among microprocessors, although it is frequently provided by minicomputers. The MC68000 uses the read-modify-write cycle only during the execution of the Test and Set (TAS) instruction. This instruction reads a byte of data. sets condition codes according to the contents of that byte. sets bit 7 of the byte. and then writes it back into memory. The T AS instruction is intended to be used as a means of providing "safe" communication between microprocessors in a multi-processor system. Safe communication is ensured with the T AS instruction since the read-modify-write cycle is non-interruptable. ClK A1-A23--(..._ _ _ _ _ _ _~H'- As~..._ _ _ _~1 _______~}\...._------1 R/W 08-015 ----04 00-07----------------------------~ . . _______...J}- FCO-FC2--{..._ _ _ _ _ _ _~H Figure 7-10.. MC68000 Write Byte Timing 7-17 Figure 7-11 illustrates the timing for a read-modify-write cycle. As you can see, it simply consists of the readbyte cycle followed by a standard write-byte cycle. There is one intervening clock period (58, 59) between the read and write cycles and it is during this interval that .the byte of data is modified internally for the subsequent write. Just as was the case with standard read and write. external logic must reply with OT ACK at the proper time or else Wait states will automatically be inserted to lengthen the read or write operations. Note that in Figure 7-11 we have shown that either UOS or LOS will be asserted during the read-modify-write operation. Th is is because the T AS instruction always operates on a byte of data. never on a word of data. Read Modify Write CLK A1-A23 UOS or lOS R/W 00-07or ____________ FCO-FC2 1X~~ ~~~__.....I 08-015 LJ }- ~-------------------------------Figure 7-11. MC68000 Read-Modify-Write Timing 7-18 The MC68000 RESET OPERATION The MC68000 has an asynchronous reset input. You reset the microprocessor by holding the RESET and HALT signals low for at least 100 milliseconds. After the RESET and HALT signals are returned high, the MC68000 executes the following 'operations: 1) The MC68000 reads the first four words from memory (bytes 000000 through 000007) and uses the contents of these locations to load the System Stack Pointer (SSP) and Program Counter (PC). The contents of these eight bytes from the beginning of memory are used as follows: Memory 000000 2 3 o 31 SSP~I__________~____2____~____3____~~____4____~ 4 5 6 7 o 31 peL 5 6 8 7 8 .......- --- 000001 000002 000003 000004 000005 000006 000007 000008 2) The interrupt mask in the Status register is set to all ones so that only level 7 interrupts will be enabled. No other registers are affected by the reset operation: therefore, when a reset is performed after applying power to the MC68000, all registers except SSP, PC, and the Status register will contain indeterminate values. 3) Program execution begins, with the first instruction being fetched from the location indicated by the value loaded into the Program Counter. The sequence we just described is the typical externally-initiated reset operation similar to that provided by most microprocessors. You will recall, however, that the RESET pin is bidirectional; when the MC68000 executes a Reset instruction, a low-going pulse is sent out on the RESET pin. This software RESET pulse is low for 124 ClK cycles. This instruction has no effect on the internal state of the MC68000, therefore none of its internal registers are affected. In this case, the RESET signal is being used to reset all other devices within the system under the control of the MC68000. THE MC68000 HALT STATE The MC68000 can be forced into a Halt state, at which time its Address Bus, Data Bus, and Function Code outputs (FCO-FC2) are placed in the high-impedance state. This state is similar to the Hold state of the 8086 and the Stop state of the Z8000. The Halt state can be used to disable the MC68000 and thus free the System Busses for such activities as direct memory access or mUlti-processor operations. However, since the MC68000 includes an efficient bus arbitration system, it is more likely that the Halt state will be used to implement a hardware single-step mode. Figure 7-12 illustrates the timing for the Halt operation. If the MC68000 is in the middle of a bus cycle when the HALT signal is input low, the bus cycle continues to its normal completion. At the end of the cycle the Address Bus, Data Bus, and FCO-FC2 signals are all placed in the high impedance state and the MC68000 halts. While it is in this halted condition, the processor does nothing - it merely waits for the .HAlT signal to return high. Note that the MC68000 provides no halt acknowledge indication to external logic. However, while the MC68000 is in the Halt state, its bus arbitration circuitry still operates. Since the MC68000 wiU not be using the bus while it is halted, any bus request made to the MC68000 will be granted immediately. We will defer a detailed discussion of the bus arbitration circuitry until later. When the HALT signal is returned high, the MC68000 exits the Halt state within two clock cycles and can then begin another bus cycle. The execution of most MC68000 instructions requires multiple bus cycles to fetch the instruction and operands and, possibly, to store results of the instruction. Since the MC68000 will respond to the HALT input upon completion of any bus cycle, the halt sequence can occur between two instructions or in the middle of a single instruction. Therefore, if you are using the HID input to implement a single-step mode of operation, you will be singlestepping by bus cycles rather than single-stepping by instructions. If you want to single-step by instructions, you 7-19 Completion of Halt State. Address Bus. Data Initiate next current bus cycle ---i+--Bus and FCO-FC3 put into-"'~--bus cycle high impedance state CLK A1-A23 R/W 00-015 FCO-FC3 Figure 7-12. MC68000 Halt State Timing must use the Trace function of the MC68000. This function is implemented by setting the T-bit in the Supervisor byte of the Status register. We will describe the Trace operation in detail later. The HALT signal is bidirectional and will be asserted by the MC68000 if it initiates a Halt state rather than having external logic cause the Halt. The MC68000 will automatically enter the Halt state if there is a double-bus fault (we will discuss bus errors and double-bus faults in detail later). If the MC68000 has automatically entered the Halt state, the processor will output HALT low and remain in this halted condition until an externally initiated reset operation is performed using RESET. Thus, when HALT is output low by the MC68000, it indicates a catastrophic failure. THE MC68000 STOP STATE Following execution of the STOP instruction, the MC68000 microprocessor will enter a Stop state. The STOP instruction is permitted only when the MC68000 is operating in the Supervisor mode as indicated by the S-bit in the Status register. The Stop state is similar to the HALT state which we just discussed, since the microprocessor essentially does nothing while in this state. When the STOP instruction is executed, the Status register is loaded with a new value contained in the instruction. Next. the Program Counter is advanced to point to the next instruction and the MC68000 stops. No special signal or status is output by the MC68000 to identify that it is in the Stop state. The Stop state is ended by one of the exception conditions such as an interrupt request or a RESET. When an exception condition is detected by the MC68000, it leaves the Stop state and will process the exception condition. 7-20 THE MC68000 BUS CYCLE RERUN TIMING As we mentioned earlier, the MC68000 can respond in two ways to a System Bus error, indicated by the assertion of iEiiR. It can perform exception processing (which we will describe later), or it can attempt to rerun the bus cycle which caused the bus error indication. If BERR is asserted by itself, then the exception proces~~.~Jor software) method of handling the bus error is taken. However, if the BERR signal is accompanied by the HALT signal then the MC68000 recognizes this as a request to rerun the bus cycle. Figure 7-13 illustrates the timing for the bus cycle rerun operation. In this figure, we have shown a write cycle in progress, with the MC68000 waiting for the external device to respond with DT ACK so that the cycle can be completed. Instead of the expected acknowledge signal. external logic forces both the BERR and HALT signals low to indicate that the cycle was not successfully completed and that the MC68000 should rerun the cycle. The MC68000 proceeds to complete the cycle that was in progress and then enters the HALT state. The Address Bus, Data Bus, and Function Code outputs are all placed in the high impedance state and the microprocessor remains halted until both BERR and HALT are negated. Note that ~ should be negated before HALT is negated to prevent the MC68000 from interpreting the isolated BERR signal as another bus error - one that is expected to be handled in software. After HALT returns high, the MC68000 will proceed to repeat the cycle that was in progress when the rerun request was received; i.e., the same address, data, and function code information that was used in the previous bus cycle will be repeated. Write Cycle N Halt Rerun Write Cycle N I~I~I~I~I~I~I~I~I~ ClK A1-A23 ~ Address N l l Address N AS UOS/lDS R/W l l OTACK 00-015 FCO-FC2 l l l Function N l Oata N Oata N Function N BERR HALT Figure 7-13. MC68000 Rerun Bus Cycle Timing 7-21 Figure 7-13 shows the successful completion of the rerun cycle with i5TACR being received in the expected interval. Of course, this will not always be the case - the attempt to rerun the bus cycle might also result in a bus error. External logic can continue to request that the cycle be rerun an unlimited number of times, using the combination of BERR and HALT. You should note, however,· that if you are using the software exception processing method of handling the bus error (BERR asserted alone without HALTl. then two successive bus errors are treated as a catastrophic error and the MC68000 will automatically enter the Halt state and remain there until reset. If the MC68000 is performing a read-modify-write cycle and a bus error is encountered, it will not rerun the cycle. This is done because the read-modify-write is only used during the Test and Set (TAS) instruction. The nature of this instruction demands complete execution cycle integrity, which might be violated if any of the bus cycles were repeated. If external logic requests a rerun of the read-modify-write cycle, the MC68000 will instead perform the bus error exception processing routine, which we will describe later. MC68000 BUS ARBITRATION LOGIC The bus arbitration logic provided by the MC68000 is straightforward. The MC68000 does not prioritize requests for bus accesses by external devices. The processor assumes that it is the lowest priority device in the system since it always grants bus access to any requesting device so long as the processor is not currently using the bus itself. Thus the MC68000 allows other devices to utilize the bus between instructions and between bus cycles of a single instruction. Since there is no built-in arbitration there should be some external bus arbitration logic in a system of any complexity to prioritize requests for the System Bus so that a high priority device is not superseded by low priority devices. There are three signals associated with the bus arbitration logic: Bus Request (BR), Bus Grant (aG)' and Bus Grant Acknowledge (BGAcK). When the MC68000 is using the System Bus without competition, the input signals BR and BGACK - will be inactive and the BG output will be negated. Figure 7-14 illustrates the timing for the bus arbitration performed by the MC68000. Bus arbitration commences when an external device pulls the BR input low. When the MC68000 receives a bus request it will respond by asserting BG one ClK period later. The only exception to this immediate response is when the MC68000 is in the initial stages of a bus cycle but has not yet asserted AS. In this case the MC68000 waits until one elK period after AS has been asserted before it asserts BG; the response time in this case will be a maximum of three ClK periods. Obviously, the Bus Grant signal does not indicate that the bus is available for use by the requesting device at that point - the MC68000 may still be using the bus to complete its current bus cycle. Therefore the device requesting the bus must monitor several other signals to determine when the bus is actually available for its use. First. the external device must wait until AS is negated, indicating that the MC68000 has completed the current bus cycle. The device requesting the bus must also wait until the DTACK signal is negated, since this indicates that the device involved in the current MC68000 cycle is no longer using the bus. However, in some systems it may not be necessary to monitor the DT ACK signal. This is the case when system timing is such that you are always assured that all external devices will be off the bus when AS is negated. Lastly, the requesting device must check the state of the BGACK signal. If this signal is true, it indicates that some other device in the system has already been granted use of the System Bus and has not yet finished with it. Conversely, if BGACK is false, then the System Bus will be available for use at the end of the current cycle. After all of the signal conditions we have described are met, the device requesting the bus must assert BGACK. This informs the MC68000 that the requesting device has ~aken control of the bus. You will note in Figure 7-14 that the MC68000 does not wait for the BGACK signal before it relinquishes control of the bus: the Address and Data Busses, the Function Code outputs, AS, UDS, lDS, and R/W are all placed in the high impedance state as soon as the MC68000 has completed the bus cycle that was in progress when the bus request was received. The device that is using the bus must hold BGACK low for as long as it requires the bus. While an external device has control of the bus, external logic should prevent bus conflicts by monitoring BGACK; at this point the behavior of BR and BC is unimportant. However, the device using the bus should negate its BR before negating BGACK to avoid an incorrect bus request. The MC68000 will maintain its output lines in the high impedance state until BGACK is negated, indicating that the external device is through with the bus. At that point the MC68000 is free to initiate another bus cycle. Note that if another bus request is pending at that point the MC68000 will acquiesce to that bus request immediately without performing any bus cycles itself. 7-22 MC68000 EXCEPTION PROCESSING LOGIC All of Motorola's literature on the MC68000 refers to "exception processing" when discussing what we usually describe as the interrupt system in other microprocessors. They have chosen to use this nomenclature since the events that can cause "interrupts" in the MC68000 cover a much broader range than those usually associated with an interrupt request in a typical microprocessor. We will also use the "exception processing" nomenclature. MC68000 MC68000 initiates '-------t....--System bus available for use by external devices---+t---completes a bus cycle bus cycle ClK A1-A23 R/W 00-015 FCO-FC2 Figure 7-14. MC68000 Bus Arbitration Timing 7-23 The MC68000 provides extensive exception processing logic. This logic is similar to that provided by the 8086 and Z8000 in that a jump vector table is used to transfer program control to the appropriate handler program whenever an exception occurs. The biggest difference between the MC68000's logic and that of the Z8000 and 8086 is that the number of events that can generate an exception in the MC68000 is greater than the number of events that cause interrupts in Z8000. In addition, the MC68000 provides a 7-level priority structure for external interrupt requests. Before proceeding to describe the exception processing system, let us discuss the operatMC68000 ing modes of the MC68000, since these affect exception processing. As 'We mentioned preOPERATING viously. the MC68000 can operate in either a Supervisor mode or a User mode. When the MODES MC68000 is reset using the RESET input. it starts operating in the Supervisor mode. The processor remains in Supervisor mode until one of the following instructions is executed: Return from Exception (RTEL Move to Status Register (MOVE word to SR), AND Immediate to Status Register (ANDI word to SRL and Exclusive OR Immediate to Status Register (EORI word to SR). None of these instructions automatically causes the transition to User mode of operation - rather. they are capable of changing the state of the S-bit in the Status register. If one of these instructions resets the S-bit. the MC68000 will begin operating in the User mode. Once the MC68000 is operating in the User mode, the only thing that can cause a transition back to the Supervisor mode is an exception. All exception processing is performed in Supervisor mode regardless of the current setting of the S-bit of the Status register. When the exception processing has been completed. the Return from Exception (RTE) instruction allows return to the User mode. A number of instructions. designated as "privileged." are reserved for the Supervisor mode. An attempt to execute one of these instructions in the User mode results in a "privilege violation" which is one type of exception. We will discuss these instructions and the privilege violation response later in this chapter. MC68000 EXCEPTION TYPES Exceptions originate in a variety of ways which can be divided into two general categories: 1) Internally generated exceptions that result from the execution of certain instructions. or from internally detected errors. 2) Externally generated exceptions which include bus errors. reset. and interrupt requests. The response of the MC68000 to the various types of exceptions is similar. Before we describe this response. let us look at the sources of exceptions since they go well beyond those provided by other microprocessors. The internally generated exceptions to which the MC68000 responds can be further subdivided into three categories: internally detected errors, instruction traps, and the Trace function. MC68000 INTERNALLY GENERATED EXCEPTIONS The following are the internally detected errors which will cause the MC68000 to initiate exception processing: 1) 2) 3) Addressing errors. Whenever the MC68000 attempts to access word data. long word data. or an instruction at an odd address. this is an address error since all such accesses must be on even address boundaries. Privilege violations. Again. some instructions are reserved for use only in the Supervisor mode. Exception processing will be initiated if you attempt to execute any of the following instructions when in the User mode: STOP. RESET. RTE. MOVE to SR. AND (word) Immediate to SR. EOR (word) Immediate to SR. OR (word) Immediate to SR. MOVE USP. Illegal and unimplemented opcodes. If an instruction is fetched whose bit pattern is not one of the defined instruction bit patterns for the MC68000. exception processing will be initiated. Two bit patterns are defined as unimplemented rather than illegal: if bits 15-12 are 1010 or 1111. these are treated as unimplemented instruction opcodes. If these opcodes are fetched. special exception processing is initiated which can allow you to use these unimplemented instructions in your own software. Instruction traps are exceptions which are caused by the execution of instructions in your program. There is a standard TRAP instruction which is similar the Z8000 System Call instruction. There are four other instructions TRAPV, CHK, DIVS, and DIVU - which will cause exception processing to be initiated if certain conditions. such as arithmetic overflows or divide by zero. are detected. The third type of internally generated exception occurs when the MC68000 is operating with the Trace function. If the T-bit in the supervisor portion of the Status register is set. exception processing will be performed after each instruction. The Trace function is used for program debugging since you can analyze. by stepping through the program. the results of each instruction's execution. 7-24 There are three different types of externally generated exceptions: 1) 2) 3) Bus errors. When the BERR signal is pulled low by external logic (while HALT is high) exception processing is initiated. Reset. When the RESET signal is asserted by external logic, exception processing is initiated. Interrupt request. This is the most familiar form of exception processing and is initiated via the three interrupt request lines (iPLO, IPL 1, and IPL2). The different types of exceptions have different priorities, and processing of an exception depends on its priority. The following table lists the types of exceptions according to their relative priorities, and also defines when processing of each type begins. Priority Highest Lowest Exception Source MC68000 EXTERNALLY GENERATED EXCEPTIONS by external logic MC68000 EXCEPTION PRIORITIES Exception Processing Response RESET BERR (Bus Error) Address Error Abort current cycle, then process exception Trace Interrupt Request Illegal/Unimplemented Opcode Privilege Violation Complete current instruction, then process exception TRAP, TRAPV CHK Divide-by-zero Instruction execution initiates exception processing The highest priority types of exceptions are Reset. Bus Error, and Address Error. Any of these exceptions will cause immediate termination of the current instruction, even within a bus cycle. The next group of exceptions - trace, interrupt requests, illegal/unimplemented instructions, and privilege violations - allow completion of the current instruction before initiating exception processing. Note that interrupt requests include an additional prioritization which we discussed earlier. The lowest priority of exceptions are those that are caused by trap-type instructions. These instructions can initiate exception processing as part of their normal execution. All of the instruction trap exceptions have equal priority since it is impossible for two of them to generate exceptions simultaneously. Central to the MC68000 exception processing sequence is a vector table that occupies MC68000 1024 bytes (512 sixteen-bit words) of memory. This table occupies memory addresses EXCEPTION 000000 16 through 0003FF 16 . Figure 7-15 illustrates the exception vector table. The table is VEC:rOR organized as 256 four-byte vectors. Each vector is a 32-bit address which will be loaded into the TABLE Program Counter as part of the exception processing sequence. As you can see, a number of the vector table entries serve the defined types of exceptions which we have discussed. The remaining entries of the vector table are reserved for use by Motorola and should not be used by your program if compatibility with Motorola software is desired. The first 64 exception vectors have predefined uses; this leaves 192 vectors available to external interrupt requests - this should be more than enough for most applications. However, the first 64 vector locations are not protected by the MC68000; thus they can be used by external interrupts if a system requires it. MC68000 EXCEPTION PROCESSING SEQUENCES The general sequence of events performed by the MC68000 in response to an exception is the same regardless of the source of the exception. There are, however, some differences. Let us begin by examining the response to internally generated exceptions. If exception processing is initiated as a result of either the Trace function, a TRAP instruction, an illegal or unimplemented opcode, or a privilege violation, the following steps occur: 1) The Status Register contents are copied into an internal register. 2) The S-bit in the Status Register is set. thus placing the MC68000 in the Supervisor mode of operation. 7-25 MC68000 INTERNALLY GENERATED EXCEPTION PROCESSING Memory Addresses 1---16 B i t s (Hex) 000000 SSP (High) 000002 SSP (Low) I' II Reset _ Initial SSP Reset - Initial PC Vector 2 - Bus Error Vector 3 - Address Error Vector 4 - Illegal Instruction Vector 5 - Divide by 0 Vector 6 - CHK Instruction Vector 7 - TRAPV Instruction Vector B - Privilege Violation Vector 9 - Trace Vector 10,0 - Opcode 1010 Emulation I Vector 11, 0 - Opcode 1111 Emulation >Vector 12 10 Reserved by Motorola I I } Vector 23,0 } Vector 24, 0 - Spurious Interrupt ~~~~I) !jI Vector 25,0 - Levell Interrupt Vector 26,0 - Level 2 Interrupt Vector 2710 - Level 3 Interrupt >ifAuto-Vectors VPA low Vector 28 10 - Level 4 Interrupt I-;..;,o;,__~-H Vector 29,0 - Level 5 Interrupt I Vector 30 10 - Level 6 Interrupt J I Vector31,0- Level 7 Interrupt) Vector 32,0 I I OOOOBC .....-P-C-4-7...(H ..i... 9h..) -1 OOOOBE PC47 (Low) OOOOCO 0000C2 t Vector PC48 (High) PC48 (Low) OOOOFC PC63 (High) OOOOFE ......P...C... 6_3...(L_O_W.. ).., PC64 (HIgh) PC64 (Low) I 10 t PC255 (HIgh) PC255 (Low) Vector 64 I J} J 1 Reserved by Motorola Vector 63 JI l 0003FC 0003FE [ 10 47 Vector 48 I • 000100 000102 TRAP Instruction Vectors 1 ) User Vectors Vector 255 Figure 7-15. MC68000 Exception Vector Table 7-26 3) The T-bit in the Status Register is reset to disable tracing to allow for continuous execution when debugging using TRACE. 4) The Program Counter contents are pushed onto the Supervisor Stack. The contents of SSP will be decremented by four since four bytes are required to store the 32-bit contents of Pc. 5) Status register contents are pushed onto the Supervisor stack; SSP contents are decremented by two, since the Status register is a 16-bit register. 6) The new Program Counter contents are taken from the appropriate location in the interrupt vector table. 7) Instruction execution then begins at the location indicated by the new content of the Program Counter; this will be the first instruction of the exception processing program you have provided for that particular type exception. The way in which the MC68000 responds to an exception caused by a bus error or address error includes several steps in addition to those described in the preceding paragraphs. First, recall that either of these errors causes immediate termination of the bus cycle in progress. The next steps are the following: MC68000 BUS AND ADDRESS ERROR EXCEPTION PROCESSING 1) 2) The contents of the Status register are copied into an internal register. The S-bit in the Status register is set. placing the MC68000 in the Supervisor mode. 3) The T-bit in the Status register is reset to disable trace operations. 4) The contents of the Program Counter are pushed onto the Supervisor stack and the System Stack Pointer (SSP) is decremented by four. 5) The contents of the Status register are pushed onto the Supervisor stack and the contents of SSP are decremented by two. The contents of the MC68000's instruction register, which constitute the first word of the instruction that was in progress when the bus error occurred, are pushed onto the Supervisor stack and SSP is decremented by two. The 32-bit address that was being used for the bus cycle which was terminated is also pushed onto the Supervisor stack and SSP is decremented by four. 6) 7) 8) A word which provides information as to the type of cycle that was in progress at the time of the error is pushed onto the Supervisor stack and SSP is decremented by two. 9) The Program Counter contents are taken from the appropriate interrupt vector - either the bus error vector or address error vector of the exception vector table. 10) Instruction execution resumes at the location indicated by the new contents of the Program Counter. Figure 7-16 shows the order in which information is pushed onto the Supervisor stack as part of the exception processing for bus and address errors. The value saved for the Program Counter is advanced two to ten bytes beyond the address of the first word of the instruction where the error occurred according to the length of that instruction and its addressing information, if any. As you can see in Figure 7-16, the five least significant bits of the last word pushed onto the Stack provide information as to the type of access that was in progress when the bus error or address error occurred. The three least Significant bits are a copy of the Function Code outputs during the aborted bus cycle. Bit 3 indicates the type of proceSSing that was in progress when the error occurred. This bit is set for Group 0 or 1 exception processing and reset for Group 2 exception and normal instruction processing. Bit 4 indicates whether a read (bit 4 set) or write (bit 4 reset) cycle was in progress when the error occurred. If an error occurs during the exception processing of a preceding bus error, address error, or reset operation, the MC68000 will enter the Halt state and remain there. All of the information that is pushed onto the Supervisor stack as part of the bus and address error exception processing sequence is intended to aid you in analyzing possible sources of the error. Either of these errors implies a serious system failure and it is not likely that you will be able to return to normal program execution. ,.....----"'" MC68000 An external reset causes a special type of exception processing. After the been pulsed low the following steps occur: RESET input has RESET EXCEPTION PROCESSING 1) 2) The S-bit in the Status register is set. placing the MC68000 in the Supervisor mode. The T-bit in the Status register is reset to disable the trace function. 3) All three interrupt mask bits in the Status register are set. thus specifying the interrupt priority mask at level seven. 4) The Supervisor Stack Pointer (SSP) is loaded with the contents of the first four bytes of memory (addresses 000000-000003) . 7-27 r---------j 0 l .1 1 0 = Instruction in progress Exception processing ~{ 1 "+ = Write cycle aborted = Read cycle aborted = Fun,tion Code IFC2. FC 1. FCOI SSP after - - - -... ~r_ _ _ _ _ _ _ _ _ _ _ _..!4~3~2~!.1...20~""-Bit No. exception Lower Access Type'" Address t-----C-u-rr-en-t-C-y-C-le;.;.A-d-d-r-e-ss-(h-ig-hL-o-r-ld-e-'r)L.-L--I--I I 11 I I Current Cycle Address !low-order) Instruction Register Status Register PC (high-order word) SSP bef?re - - - - . Higher PC !low-order word) exception Address ...- - - - - - - - - - - - - - - - -..... -------16-Bit Words------- Figure 7-16. MC68000 System Stack After Bus Error or Address Error 5) The Program Counter (PC) is loaded from the next four bytes of memory (addresses 000004-000007). Instruction execution commences at the address indicated by the new contents of the Program Counter. which should reference your power-up/reset initialization program. MC68000 INTERRUPT The last type of exception processing we will discuss is the sequence initiated by the stanREQUEST dard interrupt request. An external device requests an interrupt by encoding an interrupt EXCEPTION request level on the IPLO-lpL2 inputs. The MC68000 compares these inputs to the interrupt PROCESSING mask bits in the Status register. If the encoded priority level is less than or equal to the one 6) specified by the three-bit mask. the interrupt request will not be recognized by the MC68000.lf the encoded interrupt level is a higher priority than the level established by the interrupt mask (or if a level seven interrupt request is input) then the interrupt will be processed. The MC68000 responds to the allowed interrupt request as soon as it completes the instruction execution currently in progress. Upon completion of the current instruction, the following steps occur: 1) The contents of the Status register are saved internally. 2) The S-bit in the Status register is set. placing the MC68000 in the Supervisor mode. 3) The T-bit in the Status register is reset to disable the Trace function. 4) The interrupt mask bits in the Status register are updated to the level of the interrupt request that is encoded on the IPLO-IPL2 inputs. This allows the current interrupt to be processed without being interrupted by lower priority events. 5) The MC68000 then performs an interrupt acknowledge bus cycle. This cycle serves two functions; first. the processor lets the requesting device know that its interrupt request is being serviced. and second. the processor fetches an exception vector byte from the requesting device. Figure 7-17 shows the timing for this interrupt acknowledge/vector fetch cycle. This cycle is esentially a read cycle with a few minor differences. First. address lines A 1 through A3 will reflect the states of the IPLO-IPL2 inputs so that external logic can determine which interrupt request is being processed. All of the other address outputs are set during the interrupt acknowledge cycle. The requesting device responds to the MC68000 by lJlacing a byte of exception vector data on the lower half of the data bus. The Data Transfer Acknowledge (DTACK) signal is used to effect this transfer of data just as with a normal read cycle. Throughout the interrupt acknowledge cycle. the Function Code outputs (FCO-FC2) will be set high since this represents the interrupt acknowledge function code. After the vector byte has been read from the interrupting device. the MC68000 proceeds with the following exception processing steps. The contents of the Program Counter are pushed onto the Supervisor stack and SSP is decremented by four. 6) 7-28 Complete Current ----.+---Interrupt Acknowledge Bus Cycle Instruction ClK A4-A23 A1-A3 R/W 08-015 00-07 FCO-FC2 Interrupt Request ~---- No Request (lPLO = IPl1 = IPL2 = 1) Figure 7-17. MC68000 Interrupt AcknowledgeiVector Fetch Cycle 7-29 7) The contents of the Status register are pushed onto the Supervisor stack and SSP is decremented by two. 8) The Program Counter is loaded with four bytes of data from the appropriate location in the exception vector table. The address for this location is derived as shown in the following illustration: Vector No. from interrupting device--"'1...;'~~L.,..J....l.,~,.l.,..J Address Outputs ~-------Address range = 000000-0003FC----------t The eig ht bits of data that were read from the requesting device as part of the interrupt acknowledge cycle are used to form address bits A2 through A9. The two least significant bits and bits A 10 through A23 will all be set to zero. Thus, addresses 00000016 through 0003FC16 can be generated. If you refer to Figure 7-15, you will see that these are the upper and lower boundaries of the exception vector table. Under normal circumstances a requesting device should limit itself to producing vectors corresponding to the address range 0000FC16 through 0003FC16 since the lower addresses in the vector table have preassigned uses. After the Program Counter has been loaded with the new value from the exception vector table, instruction execution commences at the location indicated by the new contents of the Program Counter; this will be the first instruction of your interrupt processing routine for the particular device requesting the interrupt. There are two variations to the interrupt request processing sequence we have just deMC68000 scribed. First, if during the interrupt acknowledge bus cycle the requesting device responds SPURIOUS by asserting BERR instead of DTACK, the MC68000 treats this as an indication that the curINTERRUPT rent interrupt request is a spurious one, and it will use vector 24 in the exception vector table to load the Program Counter. MC68000 The second variation on interrupt request processing is the autovector response. If you refer AUTOVECTOR to Figure 7-15, you will see that seven vector locations are provided in the exception vector INTERRUPT table for autovectors, corresponding to the seven interrupt priority levels. These vectors RESPONSE will be used if the device requesting an interrupt r~nds to the interrupt acknowledge bus cycle by asserting the Valid Peripheral Address (VPA) signal instead of supplying a byte of vector data. If this occurs, the MC68000 will respond by asserting the Valid Memory Address (VMA) signal. The processor will then use the appropriate autovector from the exception vector table to obtain a new Program Counter value. This autovector response was provided specifically to emulate the interrupt timing sequence expected by 6800-family peripheral devices. The VPA/VMA sequence is the standard 6800 microprocessor interrupt sequence. Of course a non-6800family device in the system could also exploit this autovector capability should it be advantageous. MC68000 ADDRESSING MODES The MC68000 utilizes 14 different addressing modes which can be grouped into six basic types. These are: 1) 2) 3) 4) Direct Register Addressing a) Data Register Direct b) Address Register Direct Direct Memory Addressing a) Absolute Short b) Absolute Long Indirect Memory Addressing a) Register Indirect b) Post-increment Register Indirect c) Pre-decrement Register Indirect d) Register Indirect with Displacement e) Register Indirect with Index and Displacement Implied Register Addressing 7-30 5) 6) Program Counter Relative Addressing a) PC-relative with Displacement b) PC-relative with Index and Displacement Immediate Data Addressing a) Immediate b) Quick Immediate These addressing modes help create a powerful and efficient instruction set. In particular. two useful features of the MC68000 addressing are that any address register may be used for direct or indirect addressing. and any register may be used as an index register. The general format of a single effective address instruction operation word is shown below. Thetwo least significant 3-bit fields determine the effective address. These fields are the mode field (bits 3-5) and the register field (bits 0- 21. 15 14 13 12 11 10 9 8 7 6 5 4 3 0 ",--Bit No. 2 IXlxlxlxlxlxlxlxlxlxlmlmlmlrlrlrl TT. -----Re9ister Field - Mode Field In some cases. the information contained in these two fields may be appended to fully specify the operand. In this case. one or two additional words are appended onto the instruction. This additional information is called the effective address extension. and its format is: 111- "E E o ::J ~ c: 10 .2 E r--- ~ .~ ~ 5 Sxu..0 w- ~ Operation Word Immediate Operand (if any. one or two words) - Source effective address extension . (if any. one or two words) - Destination effective address extension (if any. one or two words) - --------16 Bits-------- We will now discuss the addressing modes in detail. The following abbreviations are used within this section. An CCR dddd On EA N PC pppp qqqq xxxx yyyy zzzz Rn rrr SP SR SSP ssss USP Address register n (0 < n < 7) Condition code half of the Status register displacement value Data register n (0 ~ n :; 7) effective address operand size in bytes (1.2.or 4) Program Counter any four hex digits any address or data register n (0 < n ~ 7) the 3-bit value of n the active Stack Pointer Status register Supervisor Stack Pointer sign extension digits User Stack Pointer 7-31 Register Direct Addressing This addressing mode requires that the operand involved be contained in one of the eight Data registers or one of the eight address registers (Mode = 0012). Memory {: } ............................. } Operation word xl xl111111010To Extension word C • I ~II ssxxyy Operand (1, 2, or 4 bytes) + 1 ssxxyy + 2 ssxxyy + 3 ssxxyy ~ Byte = EA Sign extended value of the extension word Mode 111 2 Register = 000 2 = Figure 7-18. MC68000 Absolute Short Direct Memory Addressing Memory I, >Operation word xlxl11111101011 1< pp qq xx yy >First extension word >Second extension word I' Operand (1, 2, or 4 bytes) ppqqxxyy + 2 ppqqxxyy +3 EA = Concatenation of extension words Mode 1112 Register 001 2 = = Figure 7-19. MC68000 Absolute Long Direct Memory Addressing 7-32 MC68000 REGISTER DIRECT ADDRESSING Data Register Direct = Address Register Direct = EA Dn Mode 000 2 EA An Mode 001 2 = = Absolute Data Addressing There are two forms of this addressing mode. The short form is called absolute short addressing, while the longer format is called absolute long. Absolute short. One extension word is necessary for this addressing mode. The address of the operand is the sign extended value of the extension word. Figure 7-18 illustrates the absolute short addressing mode. MC68000 ABSOLUTE DATA ADDRESSING Absolute long. Two words of extension are required for this addressing mode. The address of the operand is the concatenation of the two extension words; the first is the high-order portion, the second is the low-order portion. Figure 719 illustrates the absolute long addressing mode. Register Indirect Addressing The five variations of this addressing mode each reference an operand in memory. Address register indirect. In this mode, the address of the operand is the contents of the specified Address register. Figure 7-20 illustrates the address register indirect mode. MC68000 REGISTER INDIRECT ADDRESSING Address register indirect with postincrement. In this mode, the address of the operand is the contents of the specified Address register. After the instruction using this mode is executed, the contents of this register are incremented by one, two, or four depending on the size of the operand. If the Address register is A7 (SP) then the address is incremented by two regardless of the operand size, because the Stack Pointer must be kept on a word boundary. Figure 7-21 illustrates the Address register indirect with postincrement mode. Address register indirect with predecrement. This addressing mode is similar to the previous one vvith the exception that the contents of the specified Address register are decremented before they are used to reference the operand. Memory Address Registers AO A1 l'--T"T""II"'"'T""T""'Ii""'T"-I} Operation word ~----------------~ A2 ~--------------~ ~--------------~ A3 A4 ~--------------~~ xxxxyyyy A5 A6 ~--------------~ (In this example rrr = 100) I xxyyyy 1 xxyyyy +2 +3 xxyyyy Operand (1, 2, or 4 bytes) ~ EA [An] Mode 010 2 Register n = • xxyyyy~1 + ~----------------~ A7 ~----------------~ = • Byte = Figure 7-20. MC68000 Address Register Indirect Memory Addressing 7-33 Memory Address Registers AO A1 ~---------------I A2 ~-----------------I A3 ~---------------I A4 ~-----------------I I A5 ~-----------------L~ xxxxyyyy A6 A7 .. ~ 0 ..""" 11. 2. 0.4 bytesl ~---------------I ~-------------(In this example rrrr = 101) xxyyyy +2 xxyyyy + 3 ~ = = Byte EA [An) [An) [An) + N Mode 011 2 Register n = I = Figure 7-21. MC68000 Address Register Indirect with Postincrement Addressing Memory Address Registers AO A1 A2 t-----~x:x:xX~y:y:y~y---:::~~---------------------Jt1~~nr.r.T;1 ~ ______________-a. . A3 A4 ~-----------------I I ~-----------------I .. A6~______________~ A7 ~-------------(In this example rrrr 001) = xxyyyy - N = I ~ Operand (1, 2, or 4 bytes) +1 +2 xxyyyy - N + 3 xxyyyy - N xxyyyy - N [An) = [An) - N EA [An) Mode 100 2 Register n = I I A5~______________~ ~ Byte = Figure 7-22. MC68000 Address Register Indirect with Predecrement Addressing Again. if A7 is specified then the address is always decremented by two. Figure 7-22 illustrates the address register indirect with predecrement mode. Address register indirect with displacement. One word of extension is required with this addressing mode. The address of the operand is the sum of the contents of the specified Address register and the sign-extended 16-bit displacement word contained in the extension word. Figure 7-23 illustrates the address register indirect with displacement mode. Address register indirect with index and displacement. This addressing mode requires one word of extension which is formatted as shown in Figure 7-24. The operand address is the sum of the specified address register. the sign-extend 7-34 Memory Address Registers ! operation word xfx1110111r1 r1r .- xxxxyyyy ~ xxxxyyyy +ssssdddd~ dd { , zzzzzzzz -.,.-..- Displacement word dd I I ~ zzzzzzzz zzzzzzzz + 1 zzzzzzzz (In this example rrr = 010) zzzzzzzz = + + 2 3 I ~ Operand (1, 2, or 4 bytes) ~ EA [An] + dddd (sign extended) Mode = 101 2 Register n Byte = Figure 7-23. MC68000 Address Register Indirect with Displacement Addressing 15 14 13 12 11 10 9 8 7 6 5 4 3 2 lPD-/-A""l-R-e-g-is-t-er-"I'IIW-rL"·I~o-'-lo-""lo-I"---D-is-p-la-ce-m-e-nt-l-n-te-g-e-r 0 . . . - B i t No. ---'1 t. ----------DisPlacement (-128 through + 127) Not used, always 0 L - - - - - - - - - - - - - - - - - - - - - - - I n d e x size: o sign extended low-order integer in index register 1 long value in index register = = .....- - - - - - - - - - - - - - - - - - - - - - - - - I n d e x register number .....- - - - - - - - - - - - - - - - - - - - - - - - - - - - Index register indicator: o = data register 1 address register = Figure 7-24. MC68000 Extension Word Format for Indexing 7-35 Memory Address Registers AO~______________~ A1 A2~______________~ A3 ..I;L.......... ~-----------------I ______________~ ______________ I ~~ zzzzzz A6~_____X_x_xx_y_y_y_y~~--I A7 Extension word ~-"""'---I A4~ A5~ l § operation word xx110r"r _ .......fi Oo..........lr 000 p ......... d d ~-----------------I zzzzzz ~------------~~ + 1 I Operand (1._2. or 4 bytes) zzzzzz + 2 zzzzzz + 3 ~ Data Registers OO~ 01 02 Byte _____________~ ppppqqqq ~--------------~~ Index Size 03~______________-4 04 long (WfL = 1) ~-----------------I _ _ _ _ _ _ _~ xxxxyyyy ~--- + ssssssdd ~--- + ppppqqqq zzzzzz 05~ 06~______________~ 07~______________~ = short (W fL = 0) xxxxyyyy ssssssdd ssssqqqq zzzzzz or_ -_ _ _ _ _J ' = (In this example Of A 0 and r2r2r2 001 therefore the index register is 01 ; r, r, r, = 11 0 which indicates A6 is used) = EA [An) + [Rn) Mode 1102 Register = n, = + dd (sign extended) Figure 7-25. MC68000 Address Register Indirect with Index and Displacement .A.ddres~ing displacement integer in the least significant byte of the extension word, and the contents of the Index register. Address formation for the Address Register Indirect with Index and Displacement is illustrated in Figure 7-25. Implied Register Addressing There are some instructions that implicitly refer to a specific register. These registers are the Program Counter (PCl. the Stack Pointer (SP-SSP or USPl. and the status register (SR). Table 7-5 shows those instructions in which a register holding the operand is implied. MC68000 IMPLIED REGISTER ADDRESSING Program Counter Relative Addressing There are two formats for PC-relative addressing. Both require one word of extension and both provide displacement. The second format includes indexing in additional to displacement. 7-36 MC68000 PROGRAM COUNTER RELATIVE ADDRESSING Memory lope..,"," [PC]- 2 [PC] - 1 xixl1111110111o dd [PC] + 1 dd ~[PC] OOPPPCCC ~ + ssssdddd I I zzzzzz -c:... Extension word I I ''''''~ zzzzzz + wend Operand (1, 2, or 4 bytes) 1 zzzzzz + 2 zzzzzz + 3 EA = [PC] + dddd (sign extended) Mode = 1112 Register = 010 2 ---Byte Figure 7-26. MC68000 Program Counter Relative Addressing DO [PC] - 2 [PC] - 1 x x 1 1 1 01 ~----------------~ ~----------------~ 02 03 04 ~----------------~L.Lppppqqqq ~----------~~~ I Memory Data Registers Operation word 11 [PC] ~ r r r ~ 00 0 [PC] + 1 d d __--- I ~--------------~~ 05 ~--------------~~ 06 I I ZZZZZZ 07 ~------------~~ Extension word I ~ Operand (1, 2, or 4 bytes) zzzzzz + 1 ~----------~--~ zzzzzz zzzzzz +2 +3 ---Byte + ssssssdd + ppppqqqq OOPPPCCC + ssssssdd ssssqqqq _---- -----""./ zzzzzz zzzzzz .... '-- (In this example Of A = 0 and rrrr = 011, therefore the selected index register is 03.) EA = [PC] + [Rn] + dd (sign extended) Mode=1112 Register = 011 2 Figure 7-27. MC68000 Program Counter-Relative with Index and Displacement Addressing 7-37 Byte .,___o_o_o_o_o_oo_o ____~___o..;..:;.pe_r_an_d_ _ _,,1 Extension word(s) or Word ,_ _ _ _ _ _ _ _ p.e.ra.n_d_ _ _ _ _ _ _.... o.. or Long Word t-____~O~p_e_ra-n~d~(h~i9 ..h-or-d-e-rh_a_lf~)_ _ _ _-I Operand (low order half) '-~--------------~~~--------------~~ Word = EA Not required; the operand is part of the instruction Mode =111 2 Register 1002 = Figure 7-28. MC68000 Immediate Data Addressing Extension Words The value contained in the Program Counter which is used in address calculation is the address of the extension word. PC-relative with displacement. This addressing mode generates an effective address by summing together the value of the Program Counter and the sign extended value of the extension word. Figure 7 -26 illustrates the PC-relative with displacement mode. PC-relative with index and displacement. This mode requires an extension word format similar to that required by the address register indirect with index and displacement mode (see Figure 7- 24). The address is calculated as shown in Figure 7-27. Immediate Data Addressing The operand for immediate data addressing is the value that immediately follows the instruction word. Thus. depending on the size of the operand. either one or two extension words will be necessary. as illustrated in Figure 7-28. MC6S000 IMMEDIATE DATA ADDRESSING THE MC68000 INSTRUCTION SET Table 7-6 summarizes the instruction set of the MC6S000. Instruction object codes and execution times are given alphabetically in Table 7-7. Instruction object codes are given numerically in Table 7-S. When compared to other microprocessor instruction sets, the MC6S000 instruction set might seem quite large: over 300 instructions are listed in Table 7-6. However. if you examine this table closely. you will see that slight variations of the same instruction mnemonic may appear several times. These are different forms of the same instruction. There are actually 56 basic instructions provided in the MC68000. We have listed all the variations of a single instruction as though they were distinct instructions in order to make our description of the instruction set consistent with similar ones for other microprocessors. One of the most significant characteristics of the MC68000 instruction set is its orderliness. Despite its apparent complexity. this instruction set should be relatively easy to learn. since the variations are consistent and therefore predictable. These variations are due to the different addressing modes available and to the MC68000's ability to handle five different data types. Since there are really only 56 basic mnemonics that you must learn. it is more likely that you will use all of the instructions in the way that they were intended and thus obtain the full power of the instruction set. Let us examine the MC6S000 instruction set by instruction categories, as given in Table 7-6. One thing to keep in mind is that the MC68000 uses memory-mapped 1/0: therefore there are no separate 1/0 instructions. The primary memory reference instructions will also be used to accomplish I/O. The basic format of all instructions is the same. The op-code for every instruction is one word. Additional extension words are required when the addressing modes specified use constants (immediate operands). absolute addresses. or 7-38 displacements. Accordingly. an instruction can be anywhere from 2 to 10 bytes in length. The number of bytes for each instruction is listed in Table 7-6. All of the primary memory reference instructions have byte, word, and long word versions. Secondary memory reference instructions can use most of the memory addressing modes. There are byte, word, and long word versions of most, but not all, of these instructions. The Move instruction provided by the MC68000 allows data movement between registers. from register to memory. from memory to register. and directly from one memory location to another. The Move Multiple Registers (MOVEM) instruction allows all of the MC68000 register contents to be quickly saved in memory or restored from memory. The MC68000 does not provide a block move instruction such as those available with the 8086 and the Z8000 microprocessors. However, since the Move instructions can move data from one memory location to another. it is simple to move blocks of data by using the Move instruction in conjunction with the Decrement and Branch (DBcc) instruction. Both signed and unsigned multiply and divide instructions are included in the instruction set. In comparison. the Z8000 provided only unsigned multiplication and division. However. the Z8000 provides 32-bit multiplication and division while the MC68000 can only multiply two 16-bit operands producing a 32-bit result. or divide a 32-bit dividend by a 16-bit divisor. The divide instructions reference the dividend in one of the Data registers: the divisor may reside in memory or in another Data register. Both the divisor and the dividend are treated as signed binary numbers in the DIVS instruction and as unsigned binary numbers in the DIVU instruction. After the division instruction has been executed. the quotient is returned in the low-order half of the dividend register and the remainder is returned in the high-order half of the dividend register. The multiply instructions also have only a word version: there is no long word version. As with the division. there is a signed (MULS) and unsigned (MULU) version of the multiply instructions. One of the operands must reside in the least significant half of a Data register while the other operand can be either a memory word. the lower half of another Data register. or can consist of immediate data included as part of the instruction. Upon completion of the multiply operation. the 32-bit product is returned in the source operand Data register. The MC68000 includes standard Jump and Jump to Subroutine instructions (JMP and JSR) which use specific addresses for loading the Program Counter. There are also the Branch Always and Branch to Subroutine instructions (BRA and BSR) which cause a transfer of program control relative to the Program Counter's current contents. The Trap instruction is the MC68000's equivalent of the System Call instruction provided by the Z8000. You will recall from the earlier discussion of the MC68000 exception processing logic that the Trap instruction automatically switches the MC68000 into the Supervisor mode. which utilizes a separate Stack Pointer to isolate the operating system from application programs. The MC68000 also provides several instructions that are specifically designed to simplify implementation of higher level languages. These instructions are unique to the MC68000. The Link (LINK) and Unlink (UNLK) instructions can be used to maintain a linked list of local data and parameter areas on the Stack and thus simplify operations where there are frequent interrupts of nested subroutines. The Link instruction uses the System Stack Pointer (SFPl. one of the other Address registers. as a "frame pointer" and a displacement value. This instruction will typically be used at the beginning of a subroutine. The Link instruction first pushes the current value of the frame pointer onto the Stack. The current value of the Stack Pointer is then loaded into the frame pointer so that it now points to the top of the current Stack. Finally. the displacement value included with the Link instruction is used to decrement the System Stack Pointer so that it is displaced to clear a space in memory for storage of such things as local variables and parameters. These variables can then be accessed via the frame pointer. The Unlink (UNLK) instruction is used to clean up the Stack at the end of a subroutine and would be executed just prior to returning to a higher level subroutine. The Unlink instruction loads the System Stack Pointer with the contents of the frame pointer. The frame pointer is then loaded with the address pulled off the Stack. Thus. both the frame pointer and the System Stack Pointer will be restored to the values they held before the subroutine was called. 7-39 ABBREVIA TIONS Following are the abbreviations used for instruction formats and operation descriptions. addr An bitb bitl cc Direct address (16 or 32 bits) Address registers. n = 0-7 (8. 16. or 32 bits. depending on the instruction size) Bit number of byte 0-7 Bit number of long word 0-31 Condition code: CC CS EO F GE GT HI LE LS LT MI NE PL T VC VS CCR count dadr Carry clear Carry set Equal False Greater than or equal Greater than High Less than or equal Low or same Less than Minus Not equal Plus True No overflow Overflow d16(An) d8(An.i) addr On d8 d16 i jadr label madr reg-list rd rs 0011 1101 1011 0110 1010 0000 1000 1001 Register indirect Register indirect with postincrement Register indirect with predecrement Register indirect with displacement Register indirect. indexed Direct address -(An) aDn data3 data8 data16 data32 1110 0010 1111 Condition Code register - the low-order byte of the Status register Shift count (1-8) Destination address. which may be any of the following addressing modes: (An) (An)+ dAn 0100 0101 0111 0001 1100 Destination Address register. This form is used only when there are two An operands. Destination Data register. This form is used only when there are two Dn operands. 3 bits of immediate data 8 bits of immediate data 16 bits of immediate data 32 bits of immediate data Data register. n = 0-7 (8. 16. or 32 bits. depending on instruction size) 8-bit address displacement. Required. even if zero on indexed instructions. 16-bit address displacement Index register (An or Dn) Jump address - same as sadr except no (An)+ or -(An) Address label Multiple-instruction address - same as dadr except no (An)+ or -(An) Register list naming one or more registers. each item in the list separated by a comma. Items may have the form: Dn Single data register An Single address register Range of registers rn l-rn Destination registers (dDn or dAn) Source register (sDn or sAn) 7-40 sadr Source address. which may be any of the following address modes: (An) (An)+ Register indirect Register indirect with postincrement Register indirect with predecrement Register indirect with displacement Register indirect. indexed Direct address Program relative Program relative. indexed -(An) d16(An) d8(An.i) addr label label (j) sAn sOn SR USP vector [[J] [ ] Source Address register. This form is used only when there are two An operands. Source Data register. This form is used only when there are two Dn operands. Status register (16 bits) User Stack Pointer. Note that this is Register A7. Trap address vector. the memory location containing the address of the Trap routine. The contents of the memory location whose address is contained in the designated register (indirect memory addressing. or implied addressing). The contents of a register or memory location (register addressing or direct memory addressing). For example: [Dn] - [[An)) indicates that the contents of the memory location addressed by Register An are loaded into Dn. whereas: [On] - [An] indicates that the contents of Register An itself are loaded into On. X x + x 1\ V ¥ Complement the value of x. Bits y through z of x. For example. On <0-7 > means the low-order byte of Dn. If the z term is omitted. then only the bit selected by y is being referenced. Thus On <0> means the least significant bit of Dn. Add Subtract Multiply Divide Logical AND Logical OR Logical Exclusive-OR Equals Data moves in the direction of the arrow Data are exchanged between two locations INSTRUCTION MNEMONICS Table 7-6 summarizes the MC68000 instruction set. The MNEMONIC column lists the instruction mnemonic (e.g .. MOVE. ADD. JMP). The OPERAND(s) column lists the operands used with the instruction mnemonic. The fixed part of an assembly language instruction is shown in UPPER CASE. The variable part (register number. address. immediate data. etc.) is shown in lower case. The BYTES and CLOCK CYCLES are repeated in this table for reader convenience. Refer to "Instruction Object Code Tables" and the text accompanying Table 7-7 for a description of these entries. 7-41 STATUS The effect of instruction execution on the status bits is listed in Table 7-6. The status bits are: T S X N Z V C Trace mode Supervisor state Extend bit Negative (or Sign) bit Zero bit Overflow bit Carry bit The following symbols are used in the STATUS columns: X - flag (blank) 1 - flag o - flag is affected by operation flag is not affected by operation is set by operation is cieared by operation OPERATION PERFORMED This column shows the sequence of operations that occurs when the instruction is executed. (Instruction fetches are not shown. nor is the incrementing of the Program Counter for the purpose of instruction fetches.) Each operation is generally shown in the following form: destination source indicating that the source contents moves to the destination. replacing the destination contents. For example. the LEA instruction operation is: [An] jadr The effective address. which may be any of the jadr forms. is loaded into the specified Address register. Following the arrow sequence is a description of the operation in words. Alternate Mnemonics The MC68000 instruction set allows a choice of mnemonics for many operations. An "I" can be appended to the instruction mnemonic for an immediate operation. An "A" can be appended to the instruction mnemonic for an Address register operation. An ".S" can be appended to force a short-form conditional branch instruction. Mnemonic choices are summarized in Table 7-5 under these headings: PRIMARY MNEMONIC ALTERNATE MNEMONIC Lists the nominal mnemonic form Lists the alternate choices that can be used in place of the primary mnemonic. Shows the operand category to which the primary and alternate mnemonics apply. xx is any allowed operand selection. Identifies the operation. OPERAND DESCRIPTION For simplicity. only the primary mnemonics are shown in the instruction set tables that follow. Note that there are no mnemonic alternates for the instruction variations X (Extend). M (Multiple). and P (Peripheral Data). These suffixes cannot be omitted from their respective instruction mnemonics. Bear in mind that the assembler will select the "Quick" version of an instruction (e.g .. MOVEQ. AOOQ. SUBQ) whenever possible. Thus you can use the alternates for these mnemonics - the more general MOVE. ADD and SUB - without sacrificing any opportunities for code shortening. For example: MOVE.L #40.02 is coded as: MOVEQ #40.02 Another example: ADD #1. DO is coded as: ADOQ.W #1.00 7-42 MC68000 INSTRUCTION OBJECT CODE TABLES The object code for each MC68000 instruction is shown alphabetically by instruction mnemonic in Table 7-6. The object codes are listed in numerical order in Table 7-7. For instruction words which have no variations, object cades are represented as four hexadecimal digits; for example, 4E71. For instruction words with variation in one of the two bytes, the object code is shown as a combination of lower case variables, hex digits, and binary digits. Each byte of an instruction word in Tables 7-7 and 7-8 is subdivided into two "nibble" fields (1 nibble = 4 bits). If a single digit appears in a nibble field, it is a hexadecimal digit. If four digits, or a combination of digits and lower-case variables (for example, 1 rrr), appear in a nibble field, each digit represents a single bit. Note that some lower-case variables are used to represent hexadecimal digits rather than binary digits. When four of these hexadecimal variable characters (for example xxxx or yyyy) are used to represent a 16-bit word, they will appear grouped together in the center of the 2-byte column comprising that word. INSTRUCTION EXECUTION TIMES Table 7-7 lists the instruction execution time in clock cycles. Each cycle = 125 nanoseconds (when fCLK =8.0 MHz). The abbreviations and notations used in the "clock cycles" column are defined as follows: +ea Effective address overhead. This is the additional time required to execute the instruction for addressing modes that take longer to execute than the nominal register indirect address. The following are the additional clock cycles required: Additional Clock Cycles Addressing Mode (An) (An)+ -(An) d16(An) d8(An,j) addr-16-bit addr-32-bit label label(j) o o 2 5 7 5 10 5 7 For shift instructions, the number of shifts. For move multiple instructions, the number of registers being moved. The first value is for branch or trap taken, the second is for branch or trap not taken. In the case of Bcc, the first of the latter numbers is for a two-byte instruction (8-bit displacement), and the second is for a four-byte instruction (16-bit displacement). In the case of DBcc, the first of the latter numbers is for branch not taken due to condition true, and the second is for branch not taken due to counter timeout. Indicates maximum value. The lower value is for condition false (byte set to all ones); the higher value is for condition true (byte cleared to all zeroes). N The following abbreviations are used in Table 7-7: a bbb bbbbb ccc ddd Operand addressing mode (1 bit) o = data register to data register 1 = memory to memory 3 bits of immediate data. In bit operations the bit numbers 0 - 7. Bit numbers a - 31. Shift count 000 = 8 shift,S 001 = 1 shift 010 = 2 shifts 011 = 3 shifts 100 = 4 shifts 101 = 5 shifts 110 = 6 shifts 111 = 7 shifts Destination register - same coding as rrr. 7-43 eeeee Source effective address (6 bits) Address Mode (An) (An)+ -(An) d16(An) d8(An,i) addr-16-bit addr-32-bit label label(j) [EXT] MODE/REGISTER 010rrr 011 rrr 100m 101 m 110rrr 111000 111001 111010 111011 xxxx a iii w 000 xx pppp pppp qqqq xxxx a iii w 000 xx hhhhhh iii jjjjjj kkkk One or two optional words of extension addressing that mayor may not appear, depending on the addressing mode (see the Addressing Modes description). Destination effective address - same as eeeeee except no label or label(j). Destination effective address but in a format with the MODE and REGISTER fields switched (e.g., (An)=rrrOl0). Multiple-destination effective address - same as ffffff except no (An)+ or -(An}.? Index register - same coding as rrr. Jump effective address - same as eeeeee except no (An)+ or -(An). Register mask list for predecrement mode, in the following format (a "1" selects the register): mmmm 1514131211109876543210 0001 D2D3D4D5D6D7AOAl A2A3A4A5A6A7 Register mask list for non-predecrement modes, in the format (a "1" selects the register): [EXT] ffffff gggggg 1514131211109876543210 A7 A6 A5 A4 A3 A2 A 1 AO 07 06 D5 04 D3 D2 01 DO pppp qqqq rrr sss t vvvv w xx xxxx yy yyyy zzzz 16-bit address word or most Significant word of 32-bit address Least significant word of 32-bit address Register 000 = DO or AO 001 = Dl or Al 010 = D2 or A2 011 = 03 or A3 100 = 04 or A4 101 = D5 or A5 110 = D6 or A6 111 = D7 or A7 Source register - same coding as rrr Type of register 0 = On 1 = An 4-bit vector Index size. 0 = sign extended, low-order integer in index register 1 = long word value in Index register 8-bit address displacement 16-bit address displacement 8-bit immediate data 16-bit immediate data or most significant word of 32-bit data Least significant word of 32-bit data INTERFACING THE MC68000 WITH 6800 PERIPHERALS Many peripheral components have been developed by Motorola and other manufacturers for the 8-bit 6800 microprocessor. In general. any asynchronous peripheral device can be used with the MC68000 with only a small amount of external logic needed to meet the interface requirements (handshaking, etc.). However, the 6800-family components are based on synchronous read/write operations. This imposes certain constraints when you attempt to use a 6800 peripheral device with an asynchronous processor such as the MC68000. Obviously, it was in Motorola's interest to design the MC68000 so that it would be able to use both conventional asynchronous devices and the family of existing synchronous 6800 devices. Therefore they have included logic to simplify interfacing 6800 peripheral devices. 7-44 Again, the MC68000 performs read/write operations asynchronously. The signals involved with these operations are the strobes (AS, UDS, lOS). the R/W signal. the Data Transfer Acknowledge signal (DT ACK). and of course the address (A 1-A23) and data (00-015) signals. Three additional signals are used to perform the synchronous read/write operations required by 6800 peripheral devices. These signals are Valid Memory Address (ViViA), Valid Peripheral Address (VPA), and Enable (E). Figure 7-29 illustrates the timing of the synchronous read and write cycles. After the MC68000 has output the address on A 1-A23 and has asserted the Address Strobe (AS). external logic is expected to decode information on the address lines. If a 6800 peripheral device is being addressed, then the external logic should assert the VPA input to the MC68000. This causes the MC68000 to emulate the data transfer timing of the 6800 microprocessor. As a result, the transfer of data is synchronized with the clock signal E. The MC68000 will keep the address outputs valid throughout this cycle. During a read cycle, the 6800 peripheral device is expected to place data on tbe Data Bus when the E signal is high. Note that the Data Transfer Acknowledge (DT ACK) signal is not used since that signal implies an asynchronous transfer of data. Instead, the falling edge of E indicates that the data transfer (either read or write) has been completed. The MC68000 then proceeds to complete the cycle in the normal fashion by negating the strobe signals and returning the Address Bus to the high impedance state. You will note in Figure 7-29 that there is a difference in the total number of ClK cycles for the read and write operations. You should not infer from this that all 6800-type read operations take four more ClK cycles than write operations. That is only the case in the example shown, and has to do with the phase of E when t!:1e read or write operation was begun. In general. the E signal and the current MC68000 cycle state will not be synchronized at the outset of a 6800 reference cycle. This is because the E signal has a duty cycle of 40%: E is high for four ClK periods and low for six ClK periods. The MC68000 instruction cycles, on the other hand, vary in the number of ClK signal periods needed to execute. During the write cycle we have shown in Figure 7-29, the E Signal is in synchronization with the instruction execution cycle. Thus this particular write cycle takes the minimum possible number of ClK cycles to execute. Note that the MC68000 automatically inserts wait states after the VPA signal is input. The number of wait states inserted will depend on how much time is needed in order to synchronize with the signal. The VMA signal is output by the MC68000 in response to the VPA output. At the end of the read or write cycle, the 6800 peripheral device or the address decoding logic in the system must negate the VPA Signal within one clock period after the MC68000 negates AS. Otherwise, the MC68000 will assume that the following cycle is also supposed to be a 6800-type synchronous cycle. Figure 7-30 summarizes the timing constraints of 6800 peripherals. It includes the 6800 processor signals for reference so you can compare them with those associated with the MC68000. A SIMPLE MC68000/6800 INTERFACE EXAMPLE Figure 7-31 illustrates a simple interface of two 6800 peripheral devices in an MC68000-based system. In this example, the address region 000000 16 through 7FFFFF 16 (the lower eight megabytes) is used for asynchronous devices including memory. The upper eight megabytes is used, albeit inefficiently, for the two synchronous 6800 peripheral devices. The PIA (Peripheral Interface Adaptor) is assigned addresses 800000 16 through BFFFFF 16, while the ACIA (Asynchronous Communications Interface Adaptor) is assigned addresses C00000 16 through FFFFFF 16. Interrupt request signals are connected directly to the IP'i:O and iPU input pins of the MC68000. Note that IPl2 is tied high. In this example, an interrupt from the ACIA causes if5[Q to become active thus generating an interrupt of level 1 (the lowest priority). Both PIA interrupts are connected to IPL 1. When either of these becomes active, an interrupt of level 2 is generated. If both the ACIA and the PIA request an interrupt simultaneously, an interrupt of level 3 would be generated. For a detailed description of how the MC68000 responds to interrupt requests, refer to our earlier discussion of MC68000 exception processing. We have also included logic that will cause the MC68000 to use its autovector capability during response to an interrupt request from one of the 6800 family devices. Recall that if the VPA signal is asserted to the MC68000 during an interrupt acknowledge cycle, then no byte of vector data need be supplied by the requesting device; instead, the MC68000 gets the appropriate autovector from the exception proceSSing vector table. 7-45 Standard Read Cycle SO S2 S4 S6 .. I. ISO 6800 Peripheral Read Cycle S2 S4 SW SW SW SW SW SW SW SW SW SW S6 -,- ISO S2 6800 Peripheral Write Cycle S4 SW SW SW SW SW SW S6 ClK A1-A23 AS DM"/lDS ..... ~ R/IN m OTACK 00-015 E VPA VMA Figure 7-29. MC68000 Synchronous Read/Write Timing for6aOO Peripherals •I ISO so 52 54 5W SW SW SW 56 so MC6800 E Clock Freq. Type 2.0 MHz B 1.5 MHz A 1.0 MHz Std SW SW 5W MC68000 ClK E MC6800* Type B Type A Std MC6800 VMA, RiW Peripheral* ~150 os~ B~ 180 os Type Type A 70 os 140 os 270 os Std 160 os ~ I MC6800 Address ~30 os MC6800* r--10 os Peripheral* Peripheral* Type B Type A ~ 180ns~ 220 ns 320 ns F ~~~~~~--~~ MC6800 Read Data MC6800 Write Data MC68000 Address MC68000 (8 MHz) t-1870s-1 Write Data * Times are given for different MC6800 device clock frequencies Figure 7-30. MC68000/6800 Interface Timing Signal Summary 7-47 10 os MC6800· 10 ns Peripheral +5 V o AS~----~--4~;--------------------~-" VMA~----~---~~'----------~ 2"" ':;:,t' ;,,' ,,:;,,',,>: ';,: ", ":'/:,,:L:; :: ':;;""'<:":', ':::O':,::,, :' 00-015 1C~;J',,!'; ... i, " .... I~ N "c o c « ~ MC68000 VPA~ I~•• FCO~ INTAC~ FCl 1 1 - - - - - -...... FC2t---..........", +5V C) ,U r .0 en u a: C;; r~ 0 , ., I~ (J) (J) u I~ a: Ii N I• 1. (J) (J) ... u ~ b 0 c r ~ , Ql 0 u "t:I (J) a: E ~ > 6850 ACIA III ... w I~ a: I~ I~ w ~ IPL21-----~ ~1-------~~~~-_4~ IPLO RESET~------~.-~----~~~~~-----~---~~a.. E R/W~--------~-------~~--------~,-~:" Figure 7-31. A Simple MC68000/6800 Interface Example 7-48 III Ql (,) .s; III 6821 PIA I~ I~ ~ « « Ql .J:. "0 0 I- Table 7-4. MC68000 Instructions Which Use Implied Registers Instruction Implied Registerls) Branch Conditional (Bee), Branch Always (BRA) Branch to Subroutine (BSR) PC PC, SP Check Register against Bounds (CHK) SSP,SR T est Condition, Decrement and Branch (DBcc) PC Signed Divide (DIVS) SSP,SR Unsigned Divide (DIVU) SSP,SR Jump (JMP) PC Jump to Subroutine (JSR) PC,SP Link and Allocate (LINK) SP Move Condition Codes (MOVE CCR) SR SR Move Status Register (MOVE SRI Move User Stack Pointer (MOVE USP) USP Push Effective Address (PEA) SP Return from Exception (RTE) PC,SP,SR Return and Restore Condition Codes (RTR) PC,SP,SR Return from Subroutine (RTS) PC, SP Trap (TRAP) SSP,SR Trap on Overflow (TRAPV) SSP,SR Unlink (UNLK) SP 7-49 Table 7-5. MC68000 Instructions Which Use Implied Registers Primary Mnemonic ADD. B ADD.W ADD. L ADDQ.B ADDQ.w ADDQ.L AND.B AND.w AND.L Bcc CLR.w CMP.B CMP.W CMP.L EOR.B EOR.W EOR. L MOVE. W MOVE. L MOVEQ OR. B OR.W OR. L SUB.B SUBW SUB.L SUBQ. B SUBQ. W SUBQ.L Alternate Mnemonic ADDI. B ADD ADDA.W ADDI.W ADDA.L ADDI.L ADD.B ADD ADD.W ADD. L ANDI.B AND ANDI.w ANDLL Bcc.5 CLR CMPI.B CMP CMPA.w CMPI.W CMPA.L CMPI.L EORI. B EOR EORI.W EORI. L MOVE MOVEA.W MOVEA.L MOVE. L ORI. B OR ORI.W ORI. L SUBI. B SUB. SUBA. W SUBIW SUBA. L SUBI. L SUB.B SUB SUBW SUB. L Operand Description dataS,xx XX,XX xX,An data16,xx xX,An data32,xx data3,xx data3,xx Add Add Add Add Add Add Add Add data3,xx dataS,xx XX,XX data16,xx data32,xx xx xx dataS,xx XX,XX xX,An data16,xx xX,An data32,xx dataS,xx XX,XX data16,xx data32,xx XX,XX xX,An xX,An dataS,xx dataS,xx XX,XX data16,xx data32,xx dataS,xx XX,XX xX,An data16,xx xX,An data32,xx data3,xx data3,xx Add Quick Long AND Immediate Byte AND Word AND Immediate Word AND Immediate Long Conditional Branch Short Clear Word Compare Immediate Byte Compare Word Compare Address Register Word Compare Immediate Word Compare Address Register Long Compare Immediate Long Exclusive OR Immediate Byte Exclusive OR Word Exclusive OR Immediate Word Exclusive OR Immediate Long Move Word Move Address Register Word Move Address Register Long Move Quick (always Long) OR Immediate Byte OR Word OR Immediate Word OR Immediate Long Subtract Immediate Byte Subtract Word Subtract Address Register Word Subtract Immediate Word Subtract Address Register Long Subtract Immediate Long Subtract Quick Byte Subtract Quick Word data3,xx Subtract Quick Long 7-50 Immediate Byte Word Address Register Word Immediate Word Address Register Long Immediate Long Quick Byte Quick Word Table 7-6. MC68000 Instruction Set Summary Mnemonic Operand(s) LEA jadr,An MOVE.B (Anl.On Bytes 2.4. or 6 \ (An) +.On -(Anl.On d16(An),Dn I Clock Cycles Status Operation Performed T S X N Z V C 2(010)+ [An] - jadr Load effective address into specified address register. The addressing size is long. although the address loaded may be byte. word. or long. depending on how it is subsequently used. 2 2 8(2/0) X X 0 0 2 8(210) X X 0 0 2 10(2/0) X X 0 0 4 12(3/0) X X 0 0 sadr d8(An.il.On a addr.On 4 14(3/0) X X 0 0 40r 6 4(1/0)+ X X 0 0 4 12(3/0) X X 0 0 4 14(3/0) Dl :::I label.On Q. I 4' ..... &. ..... 3' Dl -< labellil.On 3: ~ 3 [On<0-7>] - [[An]] Register indirect [On<0-7>] - [[An]]. [An] - [An] + 1 Register indirect with postincrement 1 [An] - [An] - 1. [On<0-7>] - [[An)] Register indirect with predecrement 1 [On <0-7>] - [[AnI + d161 Register indirect with displacement [On<0-7>1 - [[An] + d8 + [ill Register indirect. indexed [On<0-7>] - [addrl Direct address [On<0-7>1- [[PC] + d16] Program relative [On<0-7>1 - [[PC] + d8 + [ill Program relative, indexed Load byte to data register from memory location specified by any of the addressing modes above. Bits 8-31 of the data register are not affected . S! '< MOVE.B :Ill ~ ~ ; On(An) On,(An)+ 2 \ I :::I 9(1/1) X X 0 0 2 9(1/1) X X 0 0 2 9(1/1) X X 0 0 4 13(2/1) X X 0 0 4 15(211) X X 0 0 40r 6 5(011)+ X X 0 0 n ~ On,-(An) On,d 16(An) On,d8(An, i) Dn,addr I >dadr [[An]] - [On <0-7>1 Register indirect [[An)) - [On <0-7>1. [AnJ - [AnI + 1 Register indirect with postincrement 1 [Anl- [AnJ- 1, [[An]] - [On<0-7>1 Register indirect with predecrement 1 [[AnJ + d16J - [On<0-7>1 Register indirect with displacement [[An] + d8 + [ill- [On <0-7>] Register indirect, indexed [addrJ - [On<0-7>J Direct address Store byte from data register to memory location specified by any of the addressing modes above. MOVE.B sadr,dadr 2,4 6,8 or 10 5(1/1)+ X X 0 0 [dadrl - [sadrI Store byte from specified source memory location to specified destination memory location. 1 Notes: 1. 2. 3. 4. Postincrement and predecrement change by 1, unless the address register specified is the Stack Pointer (A 7), where the address is changed by 2 rather than 1 to keep the Stack Pointer on a word boundary. The effective address must be on an even word boundary (0000, 0002, 0004, etc.l. Postincrement and predecrement change by 2. Postincrement and predecrement change by 4. I Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic a II> :::I Operand(s) ~ " I'J 3' -< s: Operation Performed S X N Z V C X X 0 0 sadr. Dn 2.4 or 6 4(1/0)+ MOVE.w sadr.An 2.4 or 6 4(110)+ MOVE.w rs.dadr 2.4 or 6 5(0/1)+ X X 0 0 [dadrl - [rs<0-15>1 Store word to memory location from data or address register. 2• 3 MOVE.w sadr.dadr 2.4 6.8 or 10 5(0/1)+ X X 0 0 [dadrl - [sadri Store word from source memory location to destination memory location. 2• 3 MOVE.L sadr.Dn 2.4 or 6 4(110)+ X X 0 0 [Dn<0-31>1- [sadrl Load long word to data register from memory location. 2• 3 MOVE.L sadr.An 2.4 or 6 8(2/0)+ MOVE.L rs.dadr 2.4 or 6 10(0/2)+ X X 0 0 [dadrl - [rs<0-31 >1 Store long word from data or address register to memory location. 2• 4 MOVE.L sadr.dadr 2.4 6.8 or 10 14(112)+ X X 0 0 [dadrl - [sadri Store long word from source memory location to destination memory location.2. 4 MOVEM.w jadr.reg-list 4.6 or 8 8 + 4n(2 + n/O)+ II> CD Status T MOVE.w CI. U, Clock Cycles Bytes 3 g [Dn<0-15>1 - [sadri Load word to data register from memory location. Bits 16-31 of the data register are not affected. 2• 3 [Anl<0-15>1 [An <16-31 >1- [An<15>1 Load word to address register from memory location. The sign is extended to all upper bits of the register. 2• 3 [An <0-31 >1 - [sadrI Load long word to address register from memory location. 2• 4 -< [reg 1 <0-15>1 - [[Anll. [reg 1 < 16-31 >1 - [reg 1 < 15>1 [reg2<0-15>1- [[An + 2ll.[reg2<16-31>1- [reg2<15>1 [reg3<0-15>1- [[An + 4ll.[reg3<16-31>1- [reg3<15>1 :II i-ii [reg n <0-15>1- [[An + 2n-2)IUregn<16-31 >1 - [regn<15>1 Load multiple words from sequential memory locations to specified registers. in order 00-07. AO-A 7. The sign is extended to all upper bits of the register.2 :::I n CD ('; 0 3- S· c CD e: MOVEM.w (An)+.reg-list 4 8 + 4n(2 + n/O) [reg 1 <0-15>1 - [[Anll.[reg1 <16-31 >1- [reg 1 UAnl[An + 21 [reg2<0-15>1- [[AnlJ.[reg2<16-31 >1- [reg2<15>J.[Anl[An + 21 [reg3<0-l5>I- [[AnIUreg3<16-31 >1- [reg 3 < 15>1. [Anl[An + 21 [regn <0-15>1 - [[Anll. [regn< 16-31 >1 - [regn< 15>J.[Anl [An + 21 Same as above except with postincrement. 3 Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic MOVEMW Operand(s) reg-list,madr Bytes 4,6 or 8 Clock Cycles Status Operation Performed T S X N Z V C 4 + 5n(1/n)+ [(Anll - [reg 1 <0-15>] [(An + 211 - [reg2<0-15>] [(An + 411 - [reg3<0-15>] [(An + (2n-2)] - [regn<0-15>] Store multiple words to sequential memory locations from specified registers, in order 00-07, AO-A7.2 MOVEMW reg-list,-(An) 4 [An]- [An-2J.[[An11-lregn<0-15>] 4 + 5n(1/n)+ [An] [An] [An] Store ment 0 QI :::I Q. ~ 3' -< MOVEM.L jadr,reg-list QI ~ (11 Co) (An)+,reg-list reg-list.madr 3: 3 "g < ::u 4,6 or 8 4 4,6 or 8 8 + 8n(2 + 2n/0) 8 + 8n(2 + 2n/0) 4 + lOn(l/n)+ th.. _" 32 M' of tho ".;,te~ .re 4 4 4 + lOn(l/n) d16(Anl,On 16(4/0) [On<8-15>] - [[An] + d16],[An] - [An] + 2 [On<0-7>] - [[An] + d16] Load peripheral data bytes from alternate memory locations to data register word. The address is a byte address. 3 MOVEPW On,d16(An) 4 18(2/2) [[An] + d16] - [On<8-15>],[An] - [An] + 2 [[An] + d16] - [On<0-7>] Store peripheral data bytes from data register long to alternate memory locations. The address is a byte address. 3 MOVEP.L dos(Anl.Dn 4 24(6/0) [On<24-31»- [(An) + d16),[An)- [An) + 2 [On<16-23>]- [[An] + d16],[An]- [An] + 2 [On<8-15>] - [[An] + d16],[An] - [An] + 2 [On<0-7>]- [[An) + d16] Load peripheral data bytes from alternate memory locations to data register long. The address is a byte address. 3 MOVEP.L Dn,d16(An) 4 28(214) [[An] + d16] - [On <24-31 >],[An] - [An] + 2 [[An) + d16)- [On < 16-23»,[An) -[An] + 2 [[An] + d16] - [On<8-15>],[An] - [An] + 2 [[An] + d16] - [On<0-7>] Store peripheral data bytes from data register long to alternate memory locations. The address is a byte address. 3 reg-list,- (An) CD :::I C'I ~ ='c "S: ~pt s.m." MOVEMW .. moved. 2,4 MOVEP. W " it " n 0 } [An-2],[[An11 - [reg3<0-15>] [An-2],[[An11 - [reg2<0-15>] [An-2],[[An11 - [reg 1 <0-15>] multiple words to sequential memory locations with predecreto specified registers, in order A7-AO, 07-00. 2, 3 Table 1-6.. MC68000 Instruction Set Summary (Continued) Status Operand(s) Bytes Clock Cycles X N Z V C ABeD -(sAnl.-(dAn) 2 19(3/1) X u x u X [sAnl - [sAnl - 1 [dAnl - [dAnl-1 [[dAn)] - [[dAn)] + [[sAn)] + X Add decimal memory byte to memory byte with carry (Extend bit). Both addresses are byte 1. AOO.B sadr.On 2.4 or 6 4(110)+ X X X X X [On<0-7>1 - [On<0-7>1 + [sadri Add byte to data register from memory location. Bits 8-31 of the data register are not affected. 1 AOO.B On.dadr 2.4 or 6 9(1/1)+ X X X X X [dadrl - [dadrl + [On<0-7>J Add byte to memory location from data register. 1 AOO.w sadr.On 2.4 or 6 4(110)+ X X X X X [On<0-15>1 - [On<0-15>1 + [sadrJ Add word to data register from memory location. Bits 16-31 of the data register are not affected. 2• 3 AOO.w sadr.An 2.4 or 6 8(1/0)+ CI. I» ADD.W Dn.Dadr 2.4 or 6 9(1/1)+ X X X X X [dadrl - [dadrl + [On<0-15>J Add word to memory location from data register. 2. 3 3: CD 3 AOO.L sadr.On 2.4 or 6 6(1/0)+ X X X X X -..J [On <0-31 >1 - [On <0-31 >1 + [sadri Add long word to data registers from memory location. 2• 4 U'1 -< AOO.L sadr.An 2.4 or 6 6(1/0)+ AOO.L On.dadr 2.4 or 6 14(1/2)+ X X X X X [dadrl - [dadrl + [On <0-31 >1 Add long word to melnory locations from data register.2. 4 AODX.B - (sAn). -dAn) 19(3/1) X X X X X [sAnJ - [sAnJ - 1 [dAnJ - [dAnl - 1 [[dAn]] - [[dAn]] + [[sAn]] + X Add memory byte to memory byte with carry (Extend bitl. Both addresses are byte. 1 Mnemonic C/I CD n I Operation Performed T 5 [An <0-31 >1 - [An <0-31 >1 + [sadrl (sign extended) Add word to address register from memory location. The sign of the memory word is extended to a full 32 bits for the operation. 2• 3 0 = -< I ~ 0 ::u CD it iil ~ CD ~ CD 30 2 0 ~ AOOX.w -(sAn).-(dAn) 2 19(3/1) X X X X X ~ AOOX.L -(sAn).-(?An) 2 32(5/2) I [An <0-31 >1 - [An <0-31 >1 + [sadri Add long word to address register from memory location. 2• 4 -< 'tI CD I X X X X X [sAnJ - [sAnJ - 2 [dAnJ - [dAnJ - 2 [[dAn]] - [[dAn]] + [[sAn)] + X Add memory word to memory word with carry (Extend bit). Both address are word. 2• 3 [sAnl - [sAnl - 4 [dAnl - [dAnl - 4 [[dAn]] - [[dAn]] + [[sAn]] + X Add memory long word to memory long word with carry (Extend bid. Both addresses are long word.2. 4 ANO.B sadr.On 2.4 or 6 4(1/0)+ X X 0 0 [On<0-7>J - [On<0-7>J < [sadrJ AND byte to data register from memory location. Bits 8-31 of the data register are not affected. 1 AND.B Dn.dadr 2.4 or 6 9(1/1)+ X X 0 0 [dadrl - [dadrl < [On<0-7>J AND byte to memory location from data register. 1 I I I I I I Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic Operand(s) Bytes Status Clock Cycles Operation Performed T S X N Z V C ANO.w sadr,On 2,4 or6 4(1/0)+ X X 0 0 [On<0-15>1 - [On<0-15>1 /\ [sadri AND word to data register from memory location. Bits 16-31 of the data register are not affected. 2, 3 ANO.W On,dadr 2,4 or 6 9(1/1)+ X X 0 0 [dadrl - [dadrl < [On<0-15>1 AND word to memory location from data register. 2, 3 ANO.L sadr,Dn 2,4 or 6 6(1/0)+ X X 0 0 [On <0-31 >1 - [On <0-31 >1 /\ [sadrI AND long word to data register from memory location. 2, 4 ANO.L On,dadr 2,4 or 6 14(1/2)+ X X 0 0 [dadr! - [dadrl < [On <0-31 >! AND long word to memory location from data register. 2, 4 CLR.B dadr 2,4 or 6 9(1/1)+ 0 1 0 0 [dadrl-O Clear memory byte to zeroes. 1 CLR.w dadr 2,4 or 6 9(1/1)+ 0 1 0 0 [dadrl - 0 Clear memory word to zeroes. 2, 3 CLR.L dadr 2,4 or 6 14(1/2)+ 0 1 0 0 CMP.B sa(Jr,On 2,4 or 6 4(1/0)+ X X X X [On <0-7> I - [sadrl Compare data register byte with memory byte and set condition codes accordingly. Register/memory data are not changed on any compares. 1 CMP.w sadr,On 2,4 or 6 4(1/0)+ X X X X [On<0-15>! - [sadrl Compare data register word with memory word and set condition codes accordingly.2, 3 n CMP.w sadrAn 2,4 or 6 6(110)+ X X X X ~ (I 3 [An<0-15>1 - [sadri Compare address register word with memory word and set condition codes accordingly.2, 3 CMP.L sadr,On 2,4 or 6 6(1/0)+ X X X X [On <0-31 >1 - [sadrI Compare data register with memory long word and set condition codes accordingly.2, 4 CMP.L sadrAn 2,4 or 6 6(1/0)+ X X X X [An <0-31 >1 - [sadrI Compare address register with memory long word and set condition codes accordingly.2, 4 CJ) CD n 0 :::I Co III -< 3: (I 3 ...... &. (71 ~ < :II !. CD CD :::I (I 0 -< 0 'C [dadrl - 0 Clear memory long word to zeroes. 2, 4 (I Ql ! n 0 ~ CMPM.B (sAn)+,(dAn)+ 2 12(3/0) X X X X [[dAnl1 - [[sAn)) [dAn! - [dAn! + 1 [sAn! - [sAn! + 1 Compare memory bytes and set condition codes accordingly. The memory data are not changed on any compares. 1 CMPM.w (sAn)+,(dAn)+ 2 12(3/0) X X X X [[dAn)) - [[sAn)) [dAn I - [dAnl + 2 [sAnl - [sAnl + 2 Compare memory words and set condition codes accordingly.2, 3 CMPM.L (sAn)+,(dAn)+ 2 20(5/0) X X X X [[dAn)) - [[sAn)) [dAnl - [dAnl + 4 [sAn! - [sAnl + 4 Compare memory long words and set condition codes accordingly.2, 4 5' c (I !: - - - .. - Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic Ul CD Operand(s) Q. III 3 -< (J) it u, ::II CD Operation Performed T S X N Z V C 2.4 or 6 < 158(1/0)+ X X X 0 [On<0-15>1 ~ [On <0-31 >1 +- [sadrI [On < 16-31 > I ~ remainder Divide signed numbers. Division by zero causes a TRAP. The source address is a word address. 2• 3 OIVU sadr.On 2.4 or 6 ~140(1/0)+ X X X 0 [On<0-15>1 ~ [On <0-31 >1 +- [sadrI [On<16-31 >1 ~ remainder Oivide unsigned numbers. Division by zero causes a TRAP. The source address is a word address. 2• 3 EOR.B On.dadr 2.4 or 6 9(1/1)+ X X 0 0 [dadrl ~ [dadrl ¥ [On<0-7>1 Exclusive-OR byte to memory location from data register. 1 EORW On.dadr 2.4 or 6 9(1/1)+ X X 0 0 [dadr] ~ [dadr] ¥ [On<0-15>1 Exclusive-OR word to memory location from data registers. 2• 3 EORl On,dadr 2.4 or 6 14(1/2)+ X X 0 0 [dadrl ~ [dadr] ¥ [On<0-31 >1 Exclusive-OR long word to memory location from data register.2. 4 MUlS sadr.On 2.4 or 6 <70(1/0)+ X X 0 0 [On <0-31 >1 ~ [On<0-15>1 x [sadrI Multiply two 16-bit signed numbers. yielding a 32-bit signed product. The source address is a word address.2. 3 MUlU sadr.On 2.4 or 6 <74(210)+ X X 0 0 [On <0-31 >1 ~ [On<0-15>1 x [sadrI Multiply two 16-bit unsigned numbers. yielding a 32-bit unsigned product. The source address is a word address.2. 3 NBCO dadr 2.4 or 6 9(1/1)+ X U X U X [dadrl ~ 0 - [dadrl - X Negate decimal memory byte. This operation produces the tens complement if X 0 or the nines complement if X 1. NEG.B dadr 2.4 or 6 9(111)+ X X X X X [dadrl ~ 0 - [dadrl Negate memory byte. 1 NEGW dadr 2.4 or 6 9(1/1)+ X X X X X [dadrl ~ 0 - [dadr] Negate memory word.2. 3 2.4 or 6 14(112)+ X X X X X [dadrl ~ 0 - [dadrl Negate memory long word. 2• 4 2.4 or 6 9(1/1)+ X X X X X [dadrl ~ 0 - [dadrl - X Negate memory byte with Extend bit. 1 2.4 or 6 9(1/1)+ X X X X X [dadrl ~ 0 - [dadr] - X Negate memory word with Extend bit.2. 3 X 0 .....,j Status sadr.On -< s:CD Clock Cycles OIVS () 0 ::I Bytes Cil ~ = CD ~ CD 3 ~ '< 0 "C CD NEG.l dadr !.. NEGX.B dadr ~ n 0 ~ 5' NEGXW dadr c CD e: = NEGX.l dadr 2.4 or 6 14(1/2)+ X X X X [dadr] ~ 0 - Idadrl - X Negate memory long word with Extend bit.2. 4 NOT.B dadr 2.4 or 6 9(1/1)+ X X 0 0 [dadrl ~ Idadr] Ones complement memory byte. 1 NOTW dadr 2.4 or 6 9(111)+ X X 0 0 [dadrl ~ [dadrl Ones complement memory word.2. 3 NOT.L dadr 2.4 or 6 14(1/2)+ X X 0 0 Idadr] ~ [dadr] Ones complement memory long word. 2• 4 ORB sadr,On 2,4 or 6 4(1/0)+ X X 0 0 [On<0-7>1 ~ [Dn<0-7>1 V [sadrl OR byte to data register from memory location. Bits 8-31 of the data register are not affected. 1 ORB On.dadr 2.4 or 6 9(1/1)+ X X 0 0 Idadrl ~ [dadrl V [On<0-7>1 OR byte to memory location from data register. 1 Table 7-6, MC68000 Instruction Set Summary (Continued) C' Mnemonic Operand(s) Bytes k C o,c yc es Status Operation Performed T S X N Z V C ORW sadr,On 2. 4 or 6 4(1/0)+ X X 0 0 [On<0-15>1 - [On<0-15>1 V [sadrI OR word to data register from memory location, Bits 16-31 ofthe data register are not affected,2, 3 ORW On,dadr 2,4 or 6 9(1/1)+ X X 0 0 [dadr] - [dadrJ < [On<0-15>J OR word to memory location from data register,2, 3 ORL sadr,On 2,4 or 6 6(1/0)+ X X 0 0 [On <0-31 >1 - [On <0-31 >] V [sadrI OR long word to data register from memory location,2, 4 ORL On,dadr 2,4 or 6 14(112)+ X X 0 0 [dadrl - [dadr] < [OnVO-31 >] OR long word to memory location from data register,2, 4 SBeo -(sAnl,-(dAn) U X U X [sAn] - [sAn] - 1 [dAn] - [dAn] - 1 [[dAn]] - [[dAn]] - [[sAn]] - X Subtract decimal memory byte from memory byte with carry (Extend bit), Both addresses are byte,1 see 2 19(3/1) X dadr 2,4 or 6 9(111)+ SUB,B sadr,On 2,4 or 6 4(1/0)+ X X X X X [On<0-7>] - [On<0-7>] - [sadri Subtract memory byte from f)yte in data register, Bits 8-31 of the data register are not affected,1 SUB.B On,dadr 2,4 or 6 9(1/1)+ X X X X X [dadrl - [dadrl - [On<0-7>] Subtract byte in data register from memory byte. 1 SUBW sadr,On 2,4 or 6 4(1/0)+ X X X X X [On<0-15>1 - [On<0-15>] - [sadri Subtract memory word from word in data register. Bits 16-31 of the data register are not aftected,2, 3 SUBW sadrAn 2,4 or 6 8(1/0)+ X X X X X [An <0-31 >] - [An <0-31 >1 - [sadri (sign extended) Subtract memory word from address register contents. The sign of the memory word is extended to a full 32 bits for the operation,2, 3 ~ SUBW On,dadr 9(1/1)+ X X X X X R 2,4 or 6 [dadrl - [dadr] - [On<015>] Subtract data register word from memory location word,2, 3 SUB,L sadr,On 2,4 or 6 6(1/0)+ X X X X X [On<0-31>]-[On<0-31>]-[sadr] Subtract memory long word from data register contentS,2, 4 g. SUB.L sadr,An 2,4 or 6 6(1/0)+ X X X X X [An<0-31>]-[An<0-31>]-[sadr] Subtract memory long word from address register contents.2, 4 - SUB.L On,dadr 14(1/2)+ X X X X X SUBX,B -(sAn).-(dAn) 2,4 or 6 2 19(3/1) X X X X X [dadr] - [dadr] - [On <0-31 >] Subtract contents of data register from memory long word.2, 4 [sAn] - [sAnl - 1 [dAn] - [dAn] - 1 [[dAn]] - [[dAn]] - [[sAn]] - X Subtract memory byte from memory byte with borrow (Extend bit), Both addresses are byte. 1 SUBX.w -(sAnl,-(dAn) 2 19(3/1) X X X X X C/l ~ ~ 91 i co 5 -..J &. -..J -< ~ ;; iil ~ E 5 -< = [dadrJ - [all 1's if cc TRUE [dadr] - all O's if cc = FALSE Set status in memory byte, 1 o "g ~ g ~ [sAn] - [sAnJ - 2 [dAnl - [dAnl - 2 [[dAn]] - [[dAn]] - [[sAn]] - X Subtract memory word from memory word with borrow (Extend bitl. Both addresses are word. 2, 3 Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic 2i Operand(s) Bytes Clock Cycles Status Operation Performed T S X N Z V C X X X X X [sAnl - [sAnl - 4 [dAnl - [dAnl - 4 [[dAn]] - [[dAn]] - [[sAn]] - X Subtract memory long word from memory long word with borrow (Extend bitl. Both addresses are long word.2, 4 SUBX.L -(sAnl.-(dAn) :i" < TAS dadr 2,4 or 6 11(111)+ X X 0 0 [dadr<7>1 - 1 Test status of memory byte and set high-order bit to 1. -3 TST.B dadr 2,4 or 6 4(1/0)+ X X 0 0 [dadrl - 0 Test status of memory byte. The byte value is not changed. TST.W dadr 2,4 or 6 4(1/0)+ X X 0 0 [dadrl - 0 Test status of memory word. The word value is not changed. TST.L dadr 2,4 or 6 4(1/0)+ X X 0 0 [dadrl - 0 Test status of memory long word. The long word value is not changed. MOVEa data8,On 2 4(1/0) X X 0 0 [On<0-7>1- data8 [On <8-32>1 - [On <7>1 Load immediate data byte to data register. The sign is extended to all upper bits of the data register. MOVE.B data8,On 4 8(2/0) X X 0 0 [On<0-7>1 - data8 Load immediate data byte to data register. Bits 8-31 of the data register are not affected. MOVE.B data8,dadr 9(111)+ X X 0 0 [dadrl - [data81 Load immediate data byte into memory location. 1 MOVE.W data16,On 4 8(2/0) X X 0 0 [On<0-15>1 - data16 Load immediate data word to data register. Bits 16-31 of the data register are not affected. 'MOVE.W data16,An 4 8(2/0) 2 32(5/2) I» :::I Co n~ o 3 ~ ~ ;Co s:CD 0 -< :Jl !!. CD (; :::I 0 CD -..I &. en 4,6 or 8 3' 3 CD Co §" [An <0-15>1 - data16 [An < 16-31 > I - [An < 15> I Load immediate data word to address register. The sign is extended to all upper bits of the register. CD 3' MOVEW data 16,dadr 4,6 or 8 9(111)+ X X 0 0 [dadrl - data16 Load immediate data word into memory location. 2, 3 MOVE.L data32,On 6 12(3/0) X X 0 0 [On <0-31 >1 - data32 Load immediate data long word into data register. MOVE.L data32,An 6 12(3/0) MOVE.L data32,dadr AOO.B data8,On AOO.B data8,dadr 4,6 or 8 AOOW data16,On 4 6,8 or 10 4 [An <0-31 >1- data32 Load immediate data long word into address register. 18(2/2)+ X X 0 0 [dadrl - data32 Load immediate data long word into memory location. 2, 4 8(2/0) X X X X X [On<0-7>1 - [On<0-7>1 + data8 Add immediate data byte to data register. Bits 8-31 of the data register are not affected. 13(2/1)+ X X X X X [dadrl - [dadrl + data8 Add immediate data byte to memory location. 1 8(2/0) X X X X X [On<0-15>1 - [On<0-15>1 + data16 Add immediate data word to data register. Bits 16-31 of the data rt)~ter are not affected. 3 CD Co iii' i 0 ~ ~ CD Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic Operand(s) ADD.w data16,An ADD.w data 16,dadr AOO.L data32,On ADD.L data32,An ADD.L data32,dadr Bytes 4 Operation Performed T S X N Z V C [An <0-31> 1 - [An <0-31> 1 + data 16 (sign extended) Add immediate data word to address register. The sign of the data word is extended to a full 32 bits for the operation. 8(210) X X X X X [dadr] - [dadrl + data16 Add immediate data word to memory location. 2, 3 6 16(3/0) X X X X X [Dn<0-31 >1- [Dn<0-31 >1 + data32 Add immediate data long word to data register. 6 16(3/0) 6,8 or 10 22(3/2)+ [An <0-31 >1 - [An <0-31 >1 + data32 Add immediate data long word to address register. X X X X X ~ CD X X X X X [Dn<0-7>1- [On<0-7>1 + data3 Add immediate three bits to data register byte. Bits 8-31 of the data register are not affected. 9(1/0)+ X X X X X [dadrl - [dadrl + data3 Add immediate three bits to memory byte. 1 2 4(1/0) X X X X X [Dn<0-15>1 - [Dn<0-15>1 + data3 Add immediate three bits to data register word. Bits 16-31 of the data register are not affected . 2 4(1/0) ADDQ.B data3,dadr ADDQ.W data3,Dn ADDQ.W data3,An !;: AODQ.W data3,dadr 00 ADDQ.L data3,Dn ADDQ.L data3,An AOOQ.L data3,dadr AND.B data8,Dn AND.B data8,dadr 4,6 or 8 ANO.w data16,On ANO.w data 16,dadr AND.L data32,Dn AND.L data32,dadr 2 2,4 or 6 ~ ~. [An<0-15>1 - [An<0-15>1 + data3 Add immediate three bits to address register word. Bits 16-31 of the address register are not affected. 0 og ;3. :i" c .. [dadrl + data32 Add immediate data long word to memory location. 2, 4 3 U1 [dadr] - 4(1/0) data3,Dn .. .. Status 13(211)+ 4,6 or 8 AODQ.B 3" Clock Cycles 9(1/1)+ X X X X X [dadrl - [dadrl + data3 Add immediate three bits to memory word. 2, 3 2 8(1/0) X X X X X [Dn<0-31>1- [Dn<0-31 >1 + data3 Add immediate three bits to data register long word. 2 8(1/0) 2,4 or 6 [An <0-31> 1 - [An <0-31> 1 + data3 Add immediate three bits to address register long word. 1: X X X X [dadrl - [dadrl + data3 Add immediate three bits to memory long word. 2, 4 8(2/0) X X 0 0 [Dn<0-7>1 - [Dn<0-7>1 A data8 AND immediate data byte to data register. Bits 8-31 of the data register are not affected. 13(2111+ X X 0 0 [dadrl - [dadrl A data8 AND immediate data byte to memory byte. 1 4 8(2/0) X X 0 0 [On<0-15>1 - [On<0-15>1 A data16 AND immediate data word to data register. Bits 16-31 of the data register are not affected. 4,6 or 8 13(2/1) X X 0 0 [dadrl - [dadrl A data16 AND immediate data word to memory word. 2. 3 6 16(3/0) X X 0 0 [Dn<0-31>1- [Dn<0-31 >1 A data32 AND immediate data long word to data register. 22(3/2)+ X X 0 0 [dadrl - [dadrl < data32 AND immediate data long word to memory.2, 4 2,4 or 6 4 6,8 or 10 14(1/2) X Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic Operand(s) Bytes Clock Cycles Status Operation Performed N Z V C 8(210) X X X X [Dn <0-7> 1 - data8 Compare data register byte with immediate data byte and set condition codes accordingly. Register data are not changed on any compares. 8(2/0)+ X X X X [dadrl - data8 Compare memory byte with immediate data byte and set condition codes accordingly.1 T S X CMP.B data8.Dn CMP.B data8.dadr 4.6 or 8 CMPW data16.Dn 4 8(2/0) X X X X [Dn<0-15>1- data16 Compare data register word with immediate data word and set condition codes accordingly. CMPW data16.An 4 8(210) X X X X [An < 0-15 > 1 - data 16 Compare address register word with immediate data word and set condition codes accordingly. CMPW data 16.dadr 4.6 or 8 8(2/0)+ X X X X [dadrl - data 16 Compare memory word with immediate data word and set condition codes accordingly.2. 3 CMP.l data32.Dn 6 14(3/0) X X X X [Dn<0-31 >1 - daJa32 Compare data register with immediate data long word and set condition codes accordingly. CMP.l data32.An 6 14(3/0) X X X X [An<0-31>1- data32 Compare address register with immediate data long word and set condition codes accordingly. CMP.l data32.dadr 12(3/0)+ X X X X [dadrl - data32 Compare memory long word with immediate data long word and set condition codes accordingly.2. 4 DIVS data16.Dn 4 :s; 162(210) X X X 0 [Dn<0-15>1 ~ [Dn<0-31 >1 -;- data16 [Dn < 16-31 > 1 ~ remainder Divide signed numbers. Division by zero causes a TRAP. DIVU data16.Dn 4 :s; 148(210) X X X 0 [Dn<0-15>1 ~ [Dn<0-31 >1 -;- data16 [Dn< 16-31 >1 ~ remainder Divide unsigned numbers. Division by zero causes a TRAP. EORB data8.Dn 4 8(2/0) X X 0 0 [Dn<0-7>1 ~ [Dn<0-7>1 ¥data8 Exclusive-OR data byte to data register. Bits 8-31 of the data register are not affected. EOR.B data8.dadr 4.6 or 8 13(2/1)+ X X 0 0 [dadrl ~ [dadrl !oJ. data8 Exclusive-OR data byte to memory byte. 1 EORW data16.Dn 4 8(210) X X 0 0 [Dn<0-15>1 ~ [Dn<0-15>1 !oJ. data16 Exclusive-OR data word to data register. Bits 16-31 of the data register are not affected. EORW data 16.dadr 13(211)+ X X 0 0 [dadrl ~ [dadrl !oJ. data16 Exclusive-OR immediate data word to memory word. 2• 3 EORl data32.Dn 16(3/0) X X 0 0 [Dn<0-31 >1 ~ [Dn>0-31 >1 ¥ data32 Exclusive-OR immediate data long word to data register. EORl data32.dadr 22(3/2)+ X X 0 0 [dadrl ~.[dadrl ¥ data32 Exclusive-OR immediate data long word to memory.2. 4 4 3' 3 ...,J eno ~ Q. ~ ~ 0 'C ~ ! 6.8 or 10 ~ n ~ ~. ~ e: 4.6 or 8 6 6.8 or 10 I Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic a, -- Bytes Clock Cycles Status T S X Operation Performed N Z V C MULS data16,On 4 ::;74(210) X X 0 0 [On<0-311 >1 - [On<0-15>1 x data16 Multiply two 16-bit signed numbers, yielding a 32-bit signed product. MULU data16,On 4 ~74(2/0) X X 0 0 [On <0-31 >1 - [On<0-15>1 x data16 Multiply two 16-bit unsigned numbers, yielding a 32-bit unsigned product. OR.B data8,On 4 8(2/0) X X 0 0 [On<0-7>1 - [On<0-7>1 V data8 OR immediate data byte to data register. Bits 8-31 of the data register are not affected. OR.B data8,dadr 4,6 or 8 13(2/1)+ X X 0 0 [dadrl - [dadrl V data8 OR immediate data byte to memory byte. 1 ORW data16,On 4 8(210) X X 0 0 [On<0-15>1 - [On<0-15>1 V data16 OR immediate data word to data register. Bits 16-31 of the data register are not affected. ORW data 16.dadr 13(2/1)+ X X 0 0 [dadrl - [dadrl V data16 OR immediate data word to memory word. 2, 3 OR.L data32,On 16(3/0) X X 0 0 [On <0-31 >1 - [On <0-31 >1 V data32 OR immediate data long word to data register. OR.L data32,dadr 22(3/2)+ X X 0 0 [dadrl - [dadrl V data32 OR immediate data long word to memory.2, 4 SUB.B data8,On ~ SUB.B data8,dadr 4,6 or 8 n 0 SUBW data16,On SUBW data 16,An SUBW data 16,dadr SUB.L data32,On SUB.L data32.An SUB.L data32,dadr SUBQ.B data3,On SUBQ.B data3.dadr §' 3 -...J Operand(s) 11> c. ~ 4,6 or 8 6 6,8 or 10 8(2/0) X X X X X [On<0-7>1- [On<0-7>1 - data8 Subtract immediate data byte from data register. Bits 8-31 of the data register are not affected. 13(2/1)+ X X X X X [dadrl - [dadrl - data8 Subtract immediate data byte from memory byte. 1 4 8(2/0) X X X X X [On<0-15>1 - [On<0-15>1 - data16 Subtract immediate data word from data register. Bits 16-31 of the data register are not affected. 4 8(2/0) 4 0 '0 CD 11> ~ ;0' c 11> e: [An <0-31>1- [An<0-31>1- data16 (sign extended) Subtract immediate data word from address register. The sign of the data word is extended to a full 32 bits for the operation. 13(2/1)+ X X X X X [dadrl - [dadrl - data16 Subtract immediate data word from memory word. 2, 3 6 16(3/0) X X X X X [On <0-31 >1 - [On <0-31 >1 - data32 Subtract immediate long word from data register contents. 6 16(3/0) 4.6 or 8 6.8 or 10 2 2.4 or 6 [An <0-31 >1 - [An <0-31 >1 - data32 Subtract immediate data long word from address register. 22(3/2)+ X X X X X [dadrl - [dadrl - data32 Subtract immediate data long word from memory word. 2, 4 4(1/0) X X X X X [On <0-7>]- [On <0-7> I - data3 Subtract immediate three bits from data register byte. Bits 8-31 of the data register are not affected. 9(1/1)+ X X X X X [dadrl - [dadr] - data3 Subtract immediate three bits from memory byte. 1 Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic Operand(s) Bytes Clock Cycles Status Operation Performed T S X N Z V C X X X X X SUBQ.W data3.0n 2 4(1/0) SUBQ.W data3.An 2 4(1/0) .. SUBQ.W data3.dadr no SUBQ.L data3.0n :i' c SUBQ.L data3.An 1: SUBQ.L data3.dadr 2.4 or 6 14(112)+ BRA label 2 or 4 10(2/0) [PC] -label Branch unconditionally (short). JMP jadr 2.4 or 6 4(110)+ [PC]- jadr Jump unconditionally. BSR label 2 or 4 10.8(1/0) 10.12(210) [A7] - [A7] - 2 [[A71l- [PC] [PC]-Iabel Branch to subroutine (short). JSR jadr 2.4 or 6 14(1/2)+ [A7] - [A7] - 2 [[A7]]- [PC] [PC]- jadr Jump to subroutine. 3' 3 CD a. ~. [An<0-15>]- [An<0-15>] - data3 Subtract immediate three bits from address register word. Bits 16-31 of the address register are not affected. CD 0 "C CD CD 3- 9(1/1)+ X X X X X [dadr] - [dadr] - data3 Subtract immediate three bits from memory word. 2. 3 2 8(1/0) X X X X X [On<0-31>]- [On<0-31>]- data3 Subtract immediate three bits from data register contents. 2 8(1/0) 2.4 or 6 [An<0-31>]- [An<0-31>]- data3 Subtract immediate three bits from address register contents. CD ~ ~ ~ 3: o 'U ::t • -.J enN VI c IT (; S. :i' CD 0 » r .. r ~ ~ 0 0 :::I a. ;:;: o· :::I X [dadr] - [dadr] - data3 Subtract immediate three bits from memory long word.2. 4 RTR 2 20(5/0) [SR<0-4>] - [[A7<0-4>ll [A7] - [A7] + 2 [PC]- [[A7]] [A7] - [A71 + 2 Restore condition codes and return from subroutine. 10.8(1/0) 10.12(2/0) [PCI -label Branch if condition met. 12(210) 10(210). 14(3/0) If cc then no further action. [On<0-15>1 - [On<0-15>1 - 1 If [On < 0-15 > I -1 then no further action. [PCI -label Test condition. decrement and branch. Loop until the specified condition is true or until the loop count is exhausted. Bee label OBcc On.label iii g X [PC]- [[A7]] [A7] - [A7] + 2 Return from subroutine z ~ X 16(4/0) l:I 01 X 2 l:I m X RTS :::I a. c: [On<0-15>] - [On] - data3 Subtract immediate three bits from data register word. Bits 16-31 of the data register are not affected. 2 or 4 4 = -- Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic Operand(sl Bytes Clock Cycles Status Operation Performed T S X N Z V C MOVE.B sOn,dOn 2 4(1/01 X X 0 0 (dOn <07> 1 - [sOn <0-7> 1 Move one byte of any data register to any data register. Bits 8-31 of the destination register are not affected. MOVEW rS,On 2 4(1/01 X X 0 0 [On<0-15>1 - [rs<0-15>1 Move one word of any data or address register to any data register. Bits 16-31 of the destination register are not affected. MOVEW rS,An 2 4(1/0) MOVE.L rS,On 2 4(1/01 MOVE.L rS,An 2 4(1/01 ABCO sOn,dOn 2 6(1/01 X u X U X [dOn <0-7>1 - [dOn <0-7>1 + [sOn <0-7>1 + X Add decimal source data register byte to destination data register byte with carry (Extend bitl. Bits 8-31 of the destination data register are not affected. AOO.B sOn,dOn 2 4(1/0) X X X X X [dOn <0-7>1 - [dOn <0-7>1 + [sOn <0-7>1 Add byte from data registers to data register. Bits 8-31 of the destination data register are not affected. AOOW rs,On 2 4(1/01 X X X X X [On<0-15>1 - [On<0-15>1 + [rs<0-15>1 Add word from source register to data register. Bits 16-31 of the destination data register are not affected. AOOW rS,An 2 8(1/0) i AOO.L rS,On 2 8(1/01 ca AOO.L rS,An 2 8(1/0) AOOX.B sOn,dOn 2 4(1/01 X X X X X [dOn <0-7>1 - [dOn <0-71 + [sOn <0-7>1 + X Add source data register byte to destination data register byte with carry (Extend bid. Bits 8-31 of the destination data register are not affected. AOOXW sOn. dOn 2 4(1/0) X X X X X [dOn<0-15>1- [dOn<0-15>1 + [sOn<0-15>1 + X Add source data register word to destination data register word with carry (Extend bit). Bits 16-31 of the destination data register are not affected. AOOKL sOn,dOn 2 8(1/0) X X X X X [dOn <0-31 >1- [dOn <0-31 >1 + [sOn <0-31 >1 + X Add source data register long word to destination data register long word with carry (Extend bitl. ANO.B sOn,dOn 2 4(1/01 X X 0 0 IdOn<0-7>1 - [dOn <0-7>1 < [sOn<0-7>1 ANO byte from data register to data register. Bits 8-31 of the destination data register are not affected. :D CD ca ~ !t 21 [An<015>1 - [rs<0-15>1 [An < 16-31 > ] - [An<15>] Move one word of any data or address register to any address register. The sign is extended to all upper bits of the address register. CD ca i !t s:: 0 X X 0 0 < CD en"w [An<0-31>1- [rs<0-31 >1 Move the contents of any data or address register to any address register. [An <0-15>1 - [An <0-15>1 + [rs<0-15>1 (sign extendedl Add word from source register to address register. The sign of the source word is extended to a full 32 bits for the operation. :D CD ca 0;' X X X X X 21 CD 0;' i 0 'C [On <0-31> 1 - [rs<0-31 > 1 Move the contents of any data or address register to any data register. [On<0-31>1- [On <0-31 >1 + [rs<0-31 >1 Add long word from source register to data register. [An <0-31 >1 - [An <0-31 >1 + rS<0-31 >1 Add long word from source register to address register. CD ~ CD Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic Operand(s) Bytes Clock Cycles Status Operation Performed T S X N Z V C ANO.w sOn.dOn 2 4(1/0) X X 0 0 [dOn<0-15>1 - [dOn<0-15>1 < [sOn<0-15>1 AND word from data register to data register. Bits 16-31 of the destination data register are not affected. ANO.l sOn.dOn 2 8(110) X X 0 0 [dOn<0-31>1- [dOn <0-31 >1 < [sOn <0-31 >1 AND long word from data register to data register. CMP.B sOn.dOn 2 4(1/0) X X X X [dOn<0-7>1 - [sOn<0-7>1 Compare data register bytes and set condition codes accordingly. Register data are not changed on any compares. CMP.w rs.On 2 4(1/0) X X X X [On<0-15>1 - [rs<0-15>1 Compare data register word with register word and set condition codes accordingly. CMP.w rs.An 2 6(1/0) X X X X [An <0-15>1 - [rs<0-15> I Compare address register word with register word and set condition codes accordingly. CMP.L rs.On 2 6(1/0) X X X X [On <0-31 >1 - [rs<0-31 >1 Compare data register with register and set condition codes accordingly. CMP.l rs.An 2 6(1/0) X X X ·X [An <0-31> I - [rs<0-31 > 1 Compare address register with register and set condition codes accordingly. OIVS sOn.dOn 2 ~158(1/0) X X X 0 [dOn<0-15>1- [dOn <0-31 >1 + [sOn<0-15>1 [dOn < 016-31> I - remainder Divide signed numbers. Division by zero causes a TRAP. OIVU sOn.dOn 2 ~140(1/0) X X X 0 [dOn<0-15>1- [dOn <0-31 >1 + [sOn<0-15>1 [dOn<16-31>1- remainder Divide unsigned numbers. Division by zero causes a TRAP. EOR.B sOn.dOn 2 4(1/0) X X 0 0 [dOn <0-7>1 - [dOn<0-7>1 ¥ [sOn <0-7>1 Exclusive-OR byte from data register to data register. Bits 8-31 of the destination data register are not affected. EORW sOn.dOn 2 4(110) X X 0 0 [dOn<0-15>1 - [dOn<0-15>1 ¥ [sOn<0-15>1 Exclusive-OR word from data register to data register. Bits 16-31 of the destination data register are not affected. EaRL sOn.dOn 2 8(1/0) X X 0 0 [dOn <0-31 >1 - [dOn <0-31 >1 ¥ [sOn <0-31 >1 Exclusive-OR long word from data register to data register. EXG rs.rd 2 6(110) MUlS sOn.dOn 2 ::;,70(110) X X 0 0 [dOn <0-31 >1 - [dOn<0-15>1 x [sOn<0-15>1 Multiply two 16-bit signed numbers. yielding a 32-bit signed product. MUlU sOn.dOn 2 ::;70(1/0) X X 0 0 [dOn<0-31>1- [dOn<0-15>1 x [sOn<0-15>1 Multiply two 16-bit unsigned numbers. yielding a 32-bit unsigned product. ORB sOn.dOn 2 4(1/0) X X 0 0 [dOn<0-7>1- [dOn<0-7>1 V [sOn<0-7>1 OR byte from data register to data register. Bits 8-31 of the 'destination dat register are not affected. :ID CD cg iii' ';"l en ~ i :II CD cg !a' ~ 0 'CI ~ ~ CD R 0 ~ :i" c CD ~ [rdl-~ [rsl Exchange the contents of two registers. This is always a long word operation. Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic :a CD Operand(s) Bytes Clock Cycles Status Operation Performed T S X N Z V C OR.W sOn.dOn 2 4(1/0) X X 0 0 [dOn<0-15>1 - [dOn<0-15>1 V [sOn<0-15>1 OR word from data register to data register. Bits 16-31 of the destination data register are not affected. ORL sOn.dOn 2 8(1/0) X X 0 0 [dOn <0-31 >1 - [dOn <0-31 >1 V [sOn <0-31 >1 OR long word from data register to data register. SBeO sOn.dOn 2 6(1/0) X U X U X [dOn<0-7>1- [dOn<0-7>1 - [sOn <0-7>1 - X Subtract decimal source· data register byte from destination data register byte with carry (Extend bit). Bits 8-31 of the destination data register are not affected. SUB.B sOn.dOn 2 4(1/0) X X X X X [dOn<0-7>1- [dOn<0-7>1 - [sOn <0-7>1 Subtract data register bytes. Bits 8-31 of the destination data register are not affected. SUB.W rs.On 2 4(1/0) X X X X X [On<0-15>1 - [On<0-15>1 - [rs<0-15>1 Subtract register words. Bits 16-31 of the destination data register are not affected. SUBW rs.An 2 8(1/0) SUB.L rs.On 2 8(1/0) SUB.L rs.An 2 8(1/0) SUBX.B sOn.dOn 2 4(1/0) X X X X X [dOn<0-7>1 - [dOn<0-7>1 - [sOn <0-7>1 - X Subtract source data register byte from destination data register byte with borrow (Extend bit). Bits 8-31 of the destination data register are not affected. SUBXW sOn.dOn 2 4(1/0) X X X X X [dOn<0-15>1- [dOn<0-15>1 - [sOn<0-15>1 - X Subtract source data register word from destination data register word with borrow (Extend bit). Bits 16-31 of the destination data registers are not affected. SUBX.L sOn.dOn 2 8(1/0) X X X X X [dOn<0-31>1- [dOn<0-31>1- [sOn<0-31>1- X Subtract source data register long word from destination data register long word with borrow (Extend bit). CLRB On 2 4(1/0) 0 1 0 0 [On<0-7>1 - 0 Clear data register byte to zeroes. Bits 8-31 of the data register are not affected. CLRW On 2 4(1/0) 0 1 0 0 [On<0-15> - 0 Clear data register word to zeroes. Bits 16-31 of the data register are not affected. CLRL On 2 6(1/0) 0 1 0 0 [On<0-31>1-0 Clear data register to zeroes EXTW On 2 4(1/0) X X 0 0 [On<8-15>1 - [On<7>1 Extend sign bit of data byte to data word size. Bits 16-31 of the data register are not affected. EXT.L On 2 4(1/0) X X 0 0 [On < 16-31 > I - [On < 15> I Extend sign bit of data word to long data word size. ca iii' ; 1 CD ca iii' i [An<0-15>1 - [An<0-15>1 - [rs<0-15>1 (sign extended) Subtract source register word from address register. The sign of the source word is extended to a full 32 bits for the operation. 0 'C CD iil ; -..J m U1 n 0 a X X X X X [An <0-31 >1 - [An <0-31 >1 - [rs<0-31 >1 Subtract source register long word from address register. :i' c CD S: :a CD ca iii' i 0 'C CD iil ; [On <0-31> I - [On <0-31> 1 - [rs<0-31 > 1 Subtract source register long word from data register. Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic I 0) 0) Bytes. Status Clock Cycles Operation Performed T S X N Z V C NBCD On 2 6(1/0) X U X U X [On<0-7>1 - [On<0-7>1 - X Negate decimal register byte. Bits 8-31 of the data register are not affected. NEG.B On 2 4(1/0) X X X X X [On1 - 0 - [On<0-7>1 Negate register byte. Bits 8-31 of the data register are not affected. NEG,W On 2 4(1/0) X X X X X [On<0-15>1 - 0 - [On<0-15>1 Negate register word. Bits 16-31 of the data register are not affected. NEG.l On 2 6(1/0) X X X X X [On <0-31 >1- 0 - [On <0-31 >1 Negate register long word. NEG.B On 2 4(1/0) X X X X X [On<0-7>1 - 0 - [On <0-71 - X Negate register byte with Extend. Bits 8-31 of the data register are not affected. NEG,W On 2 4(1/0) X X X X X [On<0-15>1 - 0 - [On<0-15>1 - X Negate register word with Extend. Bits 16-31 of the data register are not affected. :D NEG.L On 2 6(1/0) X X X X X [On <0-31 >1 - 0 - [On <0-31 >1 - X Negate register long word with Extend. i NOT.B On 2 4(1/0) X X 0 0 [On<0-7>1 - [On<0-7» Ones complement data register byte. Bits 8-31 of the data register are not affected. NOT.W On 2 6(1/0) X X 0 0 •iil [On<0-15>1 - [On<0-15» Ones complement data register word. Bits 16-31 of the data register are not affected. NOT.l On 2 6(1/0) X X 0 0 00 [On<0-3>1- [On <0-31 >1 Ones complement data register contents. Sec On 2 9(1/1) SWAP On 2 4(1/0) X X 0 0 [On<0-15>1 -~ [On< 16-31 >1 Exchange the two 16-bit halves of a data register. TAS On 2 4(1/0) X X 0 0 [On<7>1-1 Test status of data register byte and set bit 7 to 1. TST.B On 2 4(1/0) X X 0 0 [On<0-7>1 - 0 Test status of data register byte. The data register contents are not changed. TST,W On 2 4(1/0) X X 0 0 [On<0-15>1 - 0 Test status of data register word. The data register contents are not changed. TST.l On 2 4(1/0) X X 0 0 [On<0-31» - 0 Test status of data register long word. The data register contents are not changed. =•iii' '-I Operand(s) ~ =•iii' i 0 'D ·.. :::I I [On<0-7>1 - all l's if cc = TRUE [On <0-1 >1 - all O's if cc = FALSE Set status in data register byte. :t. :::I c e:• I --- --- Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic ASL Operand(s) dadr Bytes 2,4 or 6 Clock Cycles 9(1/11+ Status Operation Performed T S X N Z V C X X X X X 15 0 101 :r' Arithmetic shift left one bit of memory word. A zero is shifted into bit O. Bit 15 is shifted into both Carry and Extend bits. 2, 3 ASL.B count,On On,dOn 2 2 6 + 2N(1/0) 6 + 2N(1/0) X X X X X X X X X X a- 31 8 I 7 0 HJ Arithmetic shift left of data register byte. The number of shifts is specified as a direct count 11-8) or in a data register (1-63). Zeroes are shifted into bit 0. Bit 7 is shifted into both Carry and Extend bits. ASL.W count,On On,dOn 2 2 6 + 2N(1/0) 6 + 2N(1/0) X X X X X X X X X X ...,j en..... 31 16 15 0 a~ I en :r f--.{2J ;: As ASL.B except shifts are for one word. ASLL count,On On,dOn 2 2 8 + 2N(1/0) 8 + 2N(1/0) X X X X X X X X X X 31 0 :r' t---m As ASL.B except shifts are for entire register. ASR dadr 2,4 or 6 9(1111+ X X X X X c5 -1: Arithemtic shift right one bit of memory word. Bit 15 is propagated to bit 14. Bit 0 is shifted into both Carry and Extend bits. ASR.B count,On On,dOn 2 2 6 + 2N(1/0) 6 + 2N(1/0) X X X X X X X X X X 31 I 8 7 ° cs----l! Arithmetic shift right of data register byte. The number of shifts is specified as a direct count 11-8) or in a data register (1-63). Bit 7 is propagated to the right. Bit 0 is shifted into both Carry and Extend bits. Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic ASRW Operand(s) count.Dn Dn.dDn Clock Cycles Bytes 2 2 6 6 + 2N(1/0) + 2N(1I0) Status Operation Performed T S X N Z V C X X X X X X X X X X 31 0 16 15 I -1: EJ As ASRB except shifts are for one word. ASRL count.Dn Dn.dDn 2 2 8 8 + 2N(1/0) + 2N(1/0) X X X X X X X X X X 31 0 -1: L5 As ASRB except shifts are for entire register. LSL -..J m CXl dadr 2.4 or 6 9(1/1)+ X X X 0 :r" 15 X 0 10' Logical shift left one bit of memory word. A zero is shifted into bit O. Bit 15 is shifted into both Carry and Extend bits. (Note that LSL is identical to ASL except for the Overflow condition.)2. 3 en ::r ;: n 0 LSL.B count.Dn Dn.dDn 2 2 6 6 + 2N(1I0) + 2N(1/0) X X X X X X 0 0 X X , a-HID 31 8 a :i' c CD S: 7 0 Logical shift left of data register byte. The number of shifts is specified as a direct count (1-8) or in a data register (1-63). ZeroeS are shifted into bit O. Bit 7 is shifted into both Carry and Extend bits. LSL.W count.Dn Dn.dDn 2 2 6 6 + 2N(1/0) + 2N(1/0) X X X X X X 0 0 X X 31 16 15 0 £l I ~ As LSL.B except shifts are for one word. LSL.L count.Dn Dn.dDn 2 8 8 + 2N(1/0) + 2N(1I0) X X X X X X 0 0 X X :r. 31 As lSL.B except shifts are for entire register. 0 t---[Q) Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic LSR Operand(s) dadr Clock Cycles Bytes 2,4 9(1/1)+ Status Operation Performed T S X N Z V C X X X 0 X '1: ~ or 6 Logical shift right one bit of memory word. A zero is shifted into bit 15. Bit 0 is shifted into both Carry and Extend bits. LSR.B count,On On,dOn 2 2 6 + 2N(1/0) 6 + 2N(1/0) X X X X X X 0 0 X X 7 0 r-t: I Logical shift right of data register byte. The number of shifts is specified as a direct count 11-8) or in a data register (1-63). Zeroes are shifted into bit 7. Bit 0 is shifted into both Carry and Extend bits. LSR.W '"co m countOn On,dOn 2 2 6 6 + 2N(1/0) + 2N(1/0) X X X X X X 0 0 X X = 0 '1: -1: ~ As LSRB except shifts are for one word. en ::T n 0 15 I LSRL ~ count,On On,dOn 2 2 8 + 2N(1/0) B + 2N(1/0) X X X X X X 0 0 31 X X :i" 0 I2l---f c CD S. As LSRB except shifts are for entire register. ROL dadr 2,4 9(111)+ X X 0 X 15 0 1 ~. or 6 Rotate left one bit of memory word. Bit 15 is shifted into bit 0 and into the Carry. ROL.B count,On On,dOn 2 2 6 + 2N(1/0) 6 + 2N(1/0) X X 0 X X X 0 X 31 I 8 7 0 I-'l EJ. t Rotate left of data register byte. The number of shifts is specified as a direct count (1-8) or in a data register (1-63). Bit 7 is shifted into bit 0 and into the Carry. I Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic ROL.W Operand(s) count.Dn On.dOn Clock Cycles Bytes 2 2 6 6 + 2N(1/0) + 2N(1/0) Status Operation Performed T S X N Z V C X X X X 0 0 X X 16 15 31 0 I. I 1 m1- t As ROL. B except shifts are for one word. ROL.L count.On On.dOn 2 2 8 + 2N(1/0) 8 + 2N(1/0) X X X X 0 0 31 X X 0 ~. ~ As ROL.B except shifts are for entire register. ROR oadr 2.4 9(111)+ X X 0 r 0 15 X or 6 -~ Rotate right one bit of memory word. Bit 0 is shifted into bit 15 and into the Carry. i" ROR.B " count.On On.dOn 2 2 6 6 + + 2N(1/0) 2N(1/0) X X X X 0 0 X o 8 31 X 7 0 I-~ { I Rotate right of data register byte. The number of shifts is specified as a direct count (1-8) or in a data register (1-631. Bit 0 is shifted into bit 7 and into the Carry. ROR.W count.On On.dOn 2 2 6 6 + + 2N(1/0) 2N(1/0) X X X X 0 0 X X 31 16 15 I 0 -:rm I f As ROR.B except shifts are for one word. ROR.L count. On On.dOn 2 2 8 + 2N(1/0) 8 + 2N(1/0) X X X X 0 0 X X r 31 0 .~ As ROR.B except shifts are for entire register. ROXL dadr 2.4 or 6 9(111)+ X X 0 X r' 15 0 ~ ~ Rotate left one bit of memory word and Extend one bit. Bit 15 is shifted into both Extend and Carry bits. The Extend bit is shifted into bit O. Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic ROXL.B Operand lsI count,On On,dOn Clock Cycles Bytes 2 2 6 6 + + 2NI1/01 2NI1/01 Status Operation Performed T S X N Z V C X X X X 0 0 X X 31 0 7 8 I I-~ I ~ Rotate left of data register byte with Extend. The number of shifts is specified as a direct count 11-81 or in a data register 11-631. Bit 15 is shifted into both Extend and Carry bits. The Extend bit is shifted into bit O. ROXL. W count,On On,dOn 2 2 6 6 + 2NI1/01 + 2NI1/01 X X X X 0 0 X X 31 16 0 15 I I ~ )l II I As ROXL.B except shifts are for one word. ROXL.L count,On On,dOn 2 2 8 8 + 2NI1/01 + 2NI1/01 X X X X 0 0 X X r 0 31 ~ ~ 4 As ROXL.B except shifts are for entire register. ""'" .!.J .... en ROXR dadr ::T 2,4 or 6 911/11+ X X 0 15 = n 0 ~ S· c ., r X 0 ~ ~ Rotate right one bit of memory word and Extend. Bit 0 is shifted into both Extend and Carry bits. The Extend bit is shifted into bit 15. CD S: ROXR.B count,On On,dOn 2 2 6 6 + 2N(1/0) + 2N(1/0) X X X X 0 0 X X 31 8 I 0 7 I-I t ~ ~ Rotate right of data register byte with Extend. The number of shifts is specified as a direct count 11-8) or in a data register (1-63). Bit 0 is shifted into both Extend and Carry bits. The Extend bit is shifted into bit 7. ROXR.W count.On On,dOn 2 2 6 + 2N(1/0) 6 + 2N(1/0) X X X X 0 0 X X 31 I 16 15 I ~ 0 •I As ROXR.B except shfits are for one word. ROXRL count,On On,dOn 2 2 8 + 2N(1I0) 8 + 2N(1/01 X X X 0 X X 0 X r 31 ~ ~ 0 •• ~ ~ As ROXR.B except shifts are for entire register. Table 7-6. MC68000 Instructim Set Summary (Continued) Mnemonic BTST BTST Operand(s) bitl.On On,dOn bitb,dadr On,dadr ~ BSET 3: III bitl,On On,dOn bitb,dadr :::I is' c !o· :::I On,dadr BClR bitl.On On,dOn bitb,dadr -..J .!.J On,dadr N BCHG bitl.On On,dOn bitb,dadr On,dadr Bytes Clock Cycles Status T S X N Operation Performed Z V C [l] [On] [l] - [dOn < [On] > ] Test a bit of a data register and reflect status in lero bit. The bit to be tested may be specified directly or in a data register (bit 0-31 in either case). 4 2 10(2/0) 6(1/0) X 4,6 or 8 2,4 or 6 8(2/0)+ X [l] - 4(110)+ X [l] - 4 2 4,6 or 8 2,4 or 6 12(2/0) 8(1/0) 13(2/11+ X X X [ l ] - [On 1. [On] - 1 [l] - [dOn < [On] > 1. [dOn < [On] > - 1 [l] - [dadr < bitb > 1. [dadr < bitb >] - 1 9(1/11+ X [l] - 4 2 4,6 or 8 2,4 or 6 14(2/0) 8(1/0) 13(2/1)+ X X X [l] - [On1. [On] ~- 0 [l)·- [dOn<[On»l. [dOn<[On») - 0 (ll - [dadr1. (dadr ]-O 9(1/11+ X [l] - 4 2 4,6 or 8 2,4 or 6 12(2/0] 8(1/0) 13(211) X X X [l] - 9(1/1) X [l] - X [dadr < bitb >] [dadr<[On]>] Test a bit of a memory byte and reflect status in Zero bit. The bit to be tested may be specified directly or in a data register (bit 0-7 in either case). 1 (dadr<[OnJ>1. [dadr<[On]>] ~- 1 Test a bit as (BTST) and then set the specified bit. (dadr«On]>l. [dadr«Onl>] - 0 Test a bit (as BTST) and then clear the specified bit. [l] [l] - [On l. [On]- [On] [dOn - [On] > 1. [dOn < [On] > 1. [dOn <[dOn] >l [dadr < bitb > 1. [dadr < bitb >] - [dadr < bitb > ] [dadr<[OnJ>l. [dadr<[On]>]- [dadr<[OnJ>] Test a bit (as BTST) and then complement the specified bit. MOVE An,USP 2 4(1/0) [USP]- [An] Move contents of address register to User Stack Pointer. This is a privileged instruction. MOVE USP,An 2 4(1/0) [An] - [USP] Move contents of User Stack Pointer to address register. This is a privileged instruction. LINK An,d16 4 18(212) [A7] - [A7] - 2 [[A711- [An] [An] - [A7] [A7] - [A7] + d16 Save the contents of the specified address register on the Stack, load the current Stack Pointer to the specified address register, and set the Stack Pointer to point beyond the temporary stack storage area. VI Dr n ;I; PEA jadr 2,4 or 6 10(1/2)+ I [A7] - [A7] - 2 [[A711- jadr Compute long word address and push address onto the Stack. 3 I Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic Ci ~.::I n~ ; Operand Is) Bytes Clock Cycles UWLK An 2 12(3/0) CHK data16.0n 4 On.dOn 2 Status Operation Performed T S X N Z V C [A7] - [An] [An] - [[A7]] [A7] - [A7] + 2 Store the contents of the specified address register to the Stack Pointer (A 7) and load the specified address register from the stack. ~ !: ~ !! 2 ~ X U U U X U U U X U U U sadr.On 2.4 or 6 vector 2 37(4/3) [A7] - [A7] - 2 [[A711- [PC] [A7] - [A7] - 2 [[A711- [SR] [PCl - vector Initiate exception processing through specified vector . TRAPV 2 37(5/3). 4(110) If Overflow 1 then TRAP Initiate exception processing through Overflow vector if the Overflow bit is on. RTE 2 20(5/0) X X X X X [SR] - [[A7]1. [A7] - [A7] + 2 [PC] - [[A7]l. [A7] - [A7] + 2 Return from exception. 2 12(210) X X X X X [SR<0-4>] - [On <0-4] Move status data from data register to condition codes. 12(210)+ X X X X X [SR<0-4>] [sadr<0-4>] Move status data from memory location to condition codes. The source address is a word address. 2• 3 X X X X X [SR] - data8<0-4> Move immediate status data to condition codes. TRAP III :::I CI. ~ iil ';oJ 'C ..... Co) f If [On <0-15>] < 0 or [On <0-15>] > data16 then [PC] - CHK interrupt vector If [dOn <0-15>] < 0 or [dOn <0-15>] > [On <0-15>] then [PC] - CHK interrupt vector If [On<0-15>] <0 or [On<0-15>] > [sadr] then [PC] - CHK interrupt vector Check register against bounds and initiate Check interrupt processing if register word is out of bounds. The upper bound is a twos complement integer specified as immediate data. in a data register. or in a memory word. 2. 3 49(6/3). 12(210) 45(5/3), 8(1/0) 45(5/3). 8(1/0) = MOVE On.CCr MOVE sadr.CCR MOVE data8.CCR 4 16(3/0) MOVE On.SR 2 12(2/0) X X X X X X X [SR]- [On<0-15>] Moves status word from data register to Status register. This is a privileged instruction. MOVE sadr.SR 12(2/0)+ X X X X X X X [SR] - [sadr] Move status word from memory location to Status register. This is a privileged instruction. The source address is a word address. 2• 3 MOVE data16.SR 4 16(3/0) X X X X X X X [SR] - data 16 Move immediate status word to Status register. This is a privileged instruction. MOVE SR.On 2 6(1/0) 2.4 or 6 2.4 or 6 [On<0-15>] - [SR] Move contents of Status register to data register. Bits 16-31 of the data register are not affected. Table 7-6. MC68000 Instruction Set Summary (Continued) Mnemonic Operand(s) Bytes Clock Cycles MOVE SR.dadr 2.4 or 6 9(1/1)+ AND.B dataS.SR 4 20(3/0) AND.w data 16.SR 4 20(3/0) 0 EORB dataS.SR 4 20(3/0) . EORW data 16.SR 4 20(3/0) ORB dataS.SR 4 20(3/0) ORW data 16.SR 4 20(3/0) C/I g Status Operation Performed T S X N Z V C [dadrl - [SRI Move contents of Status register to memory location. The destination address is a word address. 2. 3 X X X X X X X [SR<0-7>1- [SR<0-7>1 /\ dataS AND immediate data byte to low-order Status register byte. X X X X X [SRI - [SRI ./\ data16 AND immediate data with Status register. This is a privileged instruction. X X X X X [SR<0-7>1 - [SR<0-7>1 ¥ dataS Exclusive-OR immediate data byte to low-order Status register byte. X X X X X [SRI - [SRI ¥ data 16 Exclusive-OR immediate data with Status register. This is a privileged instruction. X X X X X !SR<0-7>1- !SR<0-7>1 < dataS OR immediate data byte to low-order Status register byte. X X X X X [SRI - [SRI V data 16 OR immediate data with Status register. This is a privileged instruction. Ii Ci aS· c e: ~ NOP 2 4(110) 3: RESET 2 132(1/0) () STOP 4 S(2/0) -..J ~ iii' !!. iii .. ::I 0 Ii n ~ 2. data16 X X X X No operation. Reset. This is a privileged instruction. X X X X X [SRI - data16 Stop processor. This is a privileged instruction. Table 7-7. MC68000 Instruction Object Codes ABCO AOO.B AOO.L AOO.W ...., .!.J (J1 AOOO.B AOOQ.L AOOO.w AOOX.B AOOX.L AOOX.w ANO.B AND.L AND.w -(SAn),-(dAn) sOn,dOn dataS,dadr dataS,On On,dadr sadr,On sOn,dOn data32,An data32,dadr data32,On Dn,dadr rS,An rS,On sadr,An sadr,On data16,An data 16,dadr data16,On On,dadr rS,An rS,On sadr,An sadr,On data3,dadr data3,On data3,An data3,dadr data3,On data3,An data3,dadr data3,On -(sAn),-(dAn) sOn,dOn -(sAn),-(dAn) SOn,dOn -(sAn),-(dAn) sDn,dDn dataS,dadr dataS,On dataB,SR Dn,dadr sadr,On sOn,dOn data32,dadr data32,Dn Dn,dadr sadr,Dn sOn,dOn data 16,dadr data16,Dn data16,SR On,dadr sadr,Dn C C 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 5 5 5 5 5 5 5 0 0 0 0 0 D 0 0 0 C C C 0 0 C C C 0 0 0 C C 2 2 4,6,orS 4 2,4,or6 2,4,or6 2 6 6, S,or 10 6 2,4,or6 2 2 2,4,or6 2,4,or6 4 4,6,orS 4 2,4,or6 2 2 2,4,or6 2,4,or6 2,4,or6 2 2 2,4,or6 2 2 2,4,or6 2 2 2 2 2 2 2 4,6,orB 4 4 2,4,or6 2,4,or6 2 6,B,orl0 6 2,4,or6 2,4,or6 2 4,6,orS 4 4 2,4,or6 2,4,or6 19(3/1) 6(1/0) 13(2/1)+ S(2/0) 9(1/1)+ 4(1/0)+ 4(110) 16(3/0) 22(3/2)+ 16(3/0) 14(1/2)+ S(1/0) S(1/0) 6(1/0)+ 6(1/0)+ S(2/0) 13(2/1) 8(2/0) 9(11)+ S(1/0) 4(110) 8(1/0)+ 4(1/0)+ 9(1/0)+ 4(1/0) 8(1/0) 14(1/2)+ B(1/0) 4(1/0) 9(1/1)+ 4(1/0) 19(3/11 4(1/0) 32(5/2) B(1/0) 19(3/1) 4(1/0) 13(2/1)+ B(2/0) 20(3/0) 9(1/1)+ 4(1/0)+ 4(1/0) 22(3/2)+ 16(3(0) 14(1/2)+ 6(1/0)+ B(1/0) 13(2/1)+ B(2/0) 20(3/0) 9(1/1) 4(1/0) Table 7-7. MC68000 Instruction Object Codes (Continued) ASl ASL.B ASL.l ASL.W ASR ASRB ASRl ASRW BCC BCHG BClR -.oJ .:... 0) BCS BEQ BGE BGT BHI BlE BlS BlT BMI BNE BPl BRA BSH sOn,dOn dadr count,On On,dOn count,On On,dOn count,On On,dOn dadr count,On On,dOn count,On On,dOn count,On On,dOn label label bitb,dadr bitl,On On,dadr On,dOn bitb,dadr bitl,On On,dadr On,dOn label label label label label label label label label label label label label label label label label label label label label label label bitb,dadr bitl,On On,dadr On,dOn 2 ~~m6 2 2 2 2 2 2 ~~m6 2 2 2 2 2 2 4 2 ~~m8 4 ~~m6 2 ~~m8 4 ~~m6 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 ~~m8 4 ~~m6 2 4(1/0) 9(1/1)+ 6 + 2N(1/0) 6 + 2N(1/0) 8 + 2N(1/0) 8 + 2N(1/0) 6 + 2N(1/0) 6 + 2N(1IO) 9(1/1)+ 6 + 2N(1/0) 6 + 2N(1/0) 8 + 2N(1/0) 8 + 2N(1/0) 6 + 2N(1/0) 6 + 2N(1/0) 10,12(2/0) 10,18(1/0) 13(2/11+ 12(2/0) 9(111)+ 8(1/0) 13(2/1)+ 14(2/0) 9(111)+ 8(1/0) 10,12(2/0) 10,18(1/0) 10,12(2/0) 10,8(1/0) 10,12(2/0) 10,8(1/0) 10,12(2/0) 10,8(1/0) 10,12(2/0) 10,8(1/0) 10,12(2/0) 10,8(1/0), 10,12(2/0) 10,8(1/0) 10,12(2/0) 10,8(1/0) 10,12(2/0) 10,8(1/0) 10,12(2/0) 10,8(1/0) 10,12(2/0) 10,8(1/0) 10(2/0) 10(110) 13(2/1)+ 12(2/0) 9(1/1)+ 8(1/0) Table 7-7. MC68000 Instruction Object Codes (Continued) Byte 4 Instruction BSR BTST BVC BVS CHK CLR.B ClR.l ClRW CMP.B ".:.. " CMP.l CMP.W CMPM. B CMPM. l CMPM.W OBCC OBCS OBEQ OBF OBGE OBGT OBHI OBlE OBlS OBlT OBMI OBNE OBPl label label bitb,dadr bitl,On On,dadr On,dOn label label label data16,On On,dOn sadr,On dadr On dadr On dadr On dataB,dadr dataB,On sadr,On sOn,dOn data32,An data32,dadr data32,On rS,An rS,On sadr,An sadr,On data16,An data16,dadr data16,On rS,An rS,On sadr,An sadr,On (sAn)+,(dAn)+ (sAn)+,(dAn)+ (sAn) +, (dAn) + On,label On,label On,label On,label On,label On,label On,label On,label On,label On,label On,label On,label On.label 6 6 0 0 0 0 6 6 6 6 4 4 4 4 4 4 4 4 4 0 0 B B B 0 0 B B B B B 0 0 B B B B B B B 5 5 5 5 5 5 5 Byte 5 Byte 6 Byte 7 Byte 8 Byte 9 Byte 10 Bytes Clock Cycles 4 2 4,6,orB 4 2,4,or6 2 4 2 4 2 4 2 2,4,or6 2,4,or6 2 2,4,or6 2 2,4,or6 2 4,6,orB 4 2,4,or6 2 6 6, B, or 10 6 2 2 2,4,or6 2,4,or6 4 4,6,orB 4 2 10,12(2/0) 10, B(1/0) B(2/0)+ 10(2/0) 4(1/0) 6(1/0) 10,12(2/0) 10, B(1/0) 10,12(2/0) 10,B(1/0) 49(6/3),12(2/0) 45(5/3),B(1/0) 45(5/3)+,Bl/0) 9(1/1)+ 4(1/0) 14(1/2)+ 6(110) 9(1/1) 4(1/0) B(2/0) B(2/0) 4(1/0)+ 4(1/0) 14(3/0) 12(3/0)+ 14(3/0) 6(1/0) 6(1/0) 6(1/0)+ 6(1/0)+ B(2/0) B(2/0)+ B(2/0) 6(1/0) 4(1/0) 6(1/0)+ 4(1/0)+ 12(3/0) 20(5/0) 12(3/0) 12(2/0),10(2/0),14(3/0) 12(2/0),10(2/0),14(3/0) 12(2/0),10(2/0),14(3/0) 12(2/0),10(2/0),14(3/0) 12(2/0),10(2/0),14(3/0) 12(2/0),10(2/0),14(3/0) 12(2/0),10(2/0),14(3/0) 12(2/0),10(2/0),14(3/0) 12(2/0),10(2/0),14(3/0) 12(2/0),10(2/0),14(3/0) 12(2/0),10(2/0),14(3/0) 12(2/0),10(2/0),14(3/0) 12 (2/0), 10(2/0), 14(3/0) 2 2,4, or6 2,4,or6 2 2 2 4 4 4 4 4 4 4 5 5 4 4 4 5 4 5 5 4 4 5 Table 7-7. MC68000 Instruction Object Codes (Continued) Instruction OBRA OBT OVC OVS DIVS OIVU EOR.B EOR. L EOR. W ...,J .!.J EXG CO EXT.L EXTW JMP JSR LEA LINK LSL LSL.8 LSL.L LSL.W LSR LSR.B LSR.L LSRW MOVE On.label On.label On.label On.label data16,Dn sadr,On sOn,dOn data16.0n sadr.On sOn,dOn data8.dadr data8,On data8,SR On.dadr sOn,dOn data32,dadr data32,On Dn,dadr sOn,dOn data 16,dadr data16,Dn data16,Sr On.dadr sOn,dDn An,An An.On On, An On,On On On jadr jadr jadr.An An.d16 dadr count. On On.dOn count. On On.dOn count.On Dn.dOn dadr count. On On.dOn count. On On.dOn count. On On.dOn An.USP data8.CCR data16.SR Dn.CCR On.SR 5 5 5 8 8 8 8 8 8 0 0 0 4 4 4 4 2,4,or6 2 4 2,4.or6 2 4.6.or8 4 4 2A.or6 2 6,8,or10 6 2.4.or6 2 4,6,or8 4 4 2,4,or6 2 2 2 E E E E E E E E E E E E A 4 6 6 F F C C 2 2 2 2,4.or6 2.4.or6 2.4.or6 4 2.4.or6 2 2 2 2 2 2 2.4.or6 2 2 2 2 2 2 2 4 4 2 2 12(2/0).10(2/0).14(3/0) 12(2/0).10(2/0).14(3/0) 12 (2/0).10(2/0),14(3/0) <162(2/0) <15811/0)+ <158(1/0) <148(2/0) <140(1/0)+ <140(1/0) 13(2/1)+ 8(2/0) 20(3/0) 9(1/1)+ 4(1/0) 22(3/2)+ 16(3/0) 14(1/2)+ 8(110) 13(2/1)+ 8(2/0) 20(3/0) 9(1/1)+ 4(1/0) 6(1/0) 6(110) 6(1/0) 4(1/0) 4(1/0) 4(1/0)+ 14(1/2)+ 2(0/0)+ 18(2/2) 9(1/1)+ 6 + 2N(1/0) 6+ 8+ 8+ 6+ 6+ 2N(1I0) 2N(1I0) 2N(1/0) 2N(1/0) 2N(1/0) 9(1/1)+ 6 + 2N(1/0) 6 + 2N(1I0) 8 + 2N(1/0) 8 + 2N(1/0) 6 + 2N(1/0) 6 + 2N(1/0) 4(1/0) 16(3/0) 16(3/0) 12(2/0) 12(2/0) Table 7-7. MC68000 Instruction Object Codes (Continued) MOVE.S MOVE. L MOVE.W ~ ...., <0 MOVEM. L MOVEM. W MOVEP. L MOVEP. W MOVEQ MULS MULU NBCO NEG.B sadr,CCR sadr,SR SR,dadr SR,On USP,An dataS,On dataS,dadr On,dadr sOn,dOn sadr,dadr sadr,On An,dadr data32,An data32,dadr data32,Dn On,dadr rS,An rS,On sadr,An sadr,dadr sadr,On An,dadr data16,An data 16,dadr data16,On On,dadr rS,An rs,On sadr,An sadr,dadr sadr,On (An)+,reg-list jadr,reg-list reg-list, - (An) reg-list,madr (An) + ,reg-list jadr,reg-list reg-list, - (An) reg-list,madr d16(An),On On,d16(An) d16(An),On On,d16(An) dataS,On data16,On sadr,On sOn,dOn data16,On sadr,On sOn,dOn dadr On dadr 4 il~~llee_ : Ill.; ~ ~ ~II 4;;~C" l 4 it"JJ 6 . ' 1.3_ 1.11./¥, 1 ''>'''::001111 '1 ee_ ~I~ti 0111 1"'" 2 .' 2 2 ! . 3 G;,~'< W~, 00181 . ' :gg4 . ; ; ~ lo~_. ~>,y* 2 2 ,'" II ggee. OOee'" + ooWij ,gg7'''1441 '" • K~ gg P<0':;;; 3 3 . 311 fii~ .·C¢!+~ 3 lliP;; gg Od'liil 4 3 1 .011 33'~Olee;m 3 .gg 33 • III III III:; ee_ i 11~1 II liiil~:. 4 !C:!tf~ 10' . : .1 O~! 4 ' i I I o ;1\1; C °8°ill o •. ...~~ 1.:,0.0.: ~ S 11:eel C'IIQ'C.! g~+~ :4~00ff1 lif) O~ff;" '~jl Bytes Clock 2,4,or6 2,4,or6 2,4,or6 2 2 4 4,6,orS 2,4,or6 2 2, 4, 6, S or 10 2,4,or6 2,4,or6 6 6,S,or 10 6 2,4,or6 2 2 2,4,or6 2,4,6, S, or, 10 2,4,or6 2,4,or6 4 4,6,orS 4 2,4,or6 2 2 2,4,or6 2,4, 6, S, or 10 2,4,or6 4 4,6,orS 4 4,6,orS 4 4,6,orS 4 4,6.orS 4 4 4 4 2 4 2.4,or6 2 4 2,4,or6 2 2,4,orS 2 12(2/0)+ 12(2/0)+ 9(111)+ 6(1/0) 2.4.or6 4(110) S(2/0) 9(1/1)+ 5(0/1)+ 4(1/0) 5(111)+ 4(1/0)+ 10(0/2)+ 12(3/0) lS(2/2)+ 12(3/0) 10(0/2)+ 4(110) 4(110) S (2/0) + 14(112)+ 4(1/0)+ 5(0/1)+ S(2/0) 9(111)+ S(2/0) 5(0/1)+ 4(1/0) 4(1/0) 4(1/0)+ 5(0/1)+ 4(1/0)+ S + Sn(2 + 2n/0) S + Sn(2 + 2n/0)+ 4 + 10n(1/n) 4 + 10n(1/n)+ S + 4n(2 + n/O) S + 4n(2 + n/O)+ 4 + 5n(1/n) 4 + 5n{1/n)+ 24(6/0) 2S(2/4) 16(4/0) lS(2/2) 4(110) <74(2/0) <70(1/0)+ <70(1/0) <74(2/0) <70(1/0)+ <70(1/0) 9(1/1)+ 6(1/0) 9(1/1) ... Table 7-7. MC6SOOO Instruction Object Codes (Continued) Bytes Clock Cycles 4 2 4 4 ~~m6 4 ~~m6 4 4 4 ~~m6 4(1/0) 14(1/2)+ 6(1/0) 9(111) 4(1/0) 9(111)+ 4(110) 14(112)+ 6(1/0) 9(1/1)+ 4(1/0) 4(1/0) 9(1/1)+ 4(1/0) 14(1/2)+ 6(110) 9(1/1)+ 6(1/0) 13(2/1)+ 8(2/0) 20(3/0) 9(111)+ 4(1/0)+ 4(1/0) 22(3/2)+ 16(3/0) 14(1/2)+ 6(1/0)+ 8(1/0) 13(2/1)+ 8(2/0) 20(3/0) 9(1/1)+ 4(110)+ 4(110) 10(1/2)+ 132(1/0) 9(1/1)+ 6 + 2N(1/0) 6 + 2N(1/0) 8 + 2N(1I0) 8 + 2N(1/0) 6 + 2N(1/0) 6 + 2N(1/0) 9(1/1)+ 6 + 2N(1/0) 6 + 2N(1/0) 8 + 2N(1/0) 8 + 2N(1/0) 6 + 2N(1/0) 6 + 2N(1/0) 9(1111+ 6 + 2N(1/0) Instruction NEG.L NEG.w NEGX.B NEGX.L NEGX.w NOP NOT.B NOT.L NOT.W OR. B ...., 00 o OR. L OR. W PEA RESET ROL ROL.B ROL.L ROL.W ROR ROR.B ROR.L RORW ROXL ROXL.B On dadr On dadr On dadr On dadr On dadr On dadr On dadr On dadr On data8.dadr data8.Dn data8.SR Dn..dadr sadr.Dn sDn.dOn data32.dadr data32.Dn Dn.dadr sadr.Dn sOn.dOn data 16.dadr data16.0n data16.SR Dn.dadr sadr.Dn sDn.dDn jadr dadr count. On On.dOn count. On Dn.dOn count. On Dn.dOn dadr count. On Dn.dDn count.Dn Dn.dDn count.On On.dOn dadr count. On 4 4 4 4 4 4 4 4 4 4 4 2 2 2 ~~m6 2 ~~m6 2 2 2.4.or6 2 2.4.or6 2 2.4.or6 2 o o o 4.6.or8 4 8 8 8 2.4.or6 2.4.or6 4 2 o o 6.8, or 10 8 8 8 2.4.or6 2.4.or6 2 4.6.or8 o o o 8. 8 8 4 4 6 4 4 2.4.or6 2.4.or6 2 2.4.or6 2 2.4.or6 2 2 2 2 2 2 2.4or6 2 E E E E E E 2 2 2 2 2 2.4.or6 2 Table 7-7. MC68000 Instruction Object Codes (Continued) Instruction ROXl.L ROXl.W ROXR ROXR.B ROXR.L ROXR.W RTE RTR RTS SBeo see ses SEQ -...I ~ SF SGE SGT SHI SLE SLS SLT SMI SNE SPL ST STOP SUB. B SUB. L On,dOn count.On On,dOn count, On On,dOn dadr count.On On,dOn count.On On,dOn count, On On,dOn -(sAn),-(dAn) sOn,dOn dadr On dadr On dadr On dadr On dadr On dadr On dadr On dadr On dadr On dadr On dadr On dadr On dadr On dadr On data16 dataB,dadr dataB,On On,dadr sadr,On sOn,dOn data32,An data32,dadr Byte 1 E E E E E E 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 Byte 8 Byte 9 Byte 10 Bytes Clock Cycles 2 2 2 2 2 2,4,or6 2 2 2 2 2 2 2 2 2 2 2 2,4,or6 2 2,4,or6 2 2,4,or6 2 2,4,or6 2 2,4,or6 2 2,4,or6 2 2,4,or6 2 2,4,or6 2 2,4,or6 2 2,4,or6 2 2,4,or6 2 2,4,or6 2 2, 4,or 6 2 2,4,or6 2 4 4,6,orB 4 2,4,or6 2,4,or6 6 + 2N(1/0) B + 2N(1/0) B + 2N(1/0) 6 + 2N(1/0) 6 + 2N(1/0) 9(1/1)+ 6 + 2N(1/0) 6 + 2N(1/0) B + 2N(1/0) B + 2N(1/0) 6 + 2N(1/0} 6 + 2N(1/0) 20(5/0) 20(5/0) 16(4/0) 2 6 6,B,or 10 19(3/1) 6(1/0) 9(1/1)+ 6,4(110) 9(1/1)+ 6,4(1/0) 9(1/1)+ 6,4, (1/0) 9(111)+ 6,4(1/0) 9(111)+ 6,4(1/0) 9(111) 6,4(1/0) 9(111)+ 6,4,(110) 9(111)+ 6,4(1/0) 9(1/1)+ 6,4(1/0) 9(111)+ 6,4(110) 9(1/1)+ 6,4(110) 9(1/1)+ 6,4(110) 9(111)+ 6,4(1/0) 9(1/1)+ 6,4(110) B(2/0) 13(2/1)+ B(2/0) 9(1/1)+ 4(1/0)+ 4(1/0) 16(3/0) 22(3/2)+ Table 7-7. MC68000 Instruction Object Codes (Continued) SUBW SUBQ.B SUBQ.L SUBQ.w SUBX.B "c» SUBX.L N SUBXW svc SVS SWAP TAS TRAP TRAPV TST.B TST.L TSTW UNLK data32,On On,dadr rS,An rS,On sadr,An sadr,On data1S,An data 1S,dadr data16,On On,dadr rS,An rS,On sadr,An sadr,On data3,dadr data3,On data3,An data3,dadr data3,On data3,An data3,dadr data3,On -(sAn), -(dAn) sOn, dOn -(sAn),-(dAn) sOn,dOn - (sAn), - (dAn) sOn,dOn dadr On dadr On On dadr On vector dadr On dadr On dadr On An 2,4,orS 2 2 2,4,orS 2,4,or6 4 4,6,or8 4 2,4,or6 2 2 2,4,orS 2,4,or6 2,4,or6 2 2 2,4,or6 2 2 2,4,or6 2 2 2 2 2 2 2 2,4,or6 2 2,4,orS 2 2 2,4,or6 2 2 2 2,4,or6 2 2,4,or6 2 2,4,orS 2 2 16(3/0) 14(112)+ 8(1/0) 8(1/0) S(1/0)+ 6(110)+ 8(2/0) 13(2/1)+ 8(210) 9(1/1)+ 8(1/0) 4(1/0) 8(1/0)+ 4(1/0)+ 9(111)+ 4(1/0) 8(1/0) 14(1/2)+ 8(1/0) 4(1/0) 9(111)+ 4(110) 19(3/1) 4(110) 32(5/2) 8(1/0) 19(3/1) 4(110) 9(111)+ 6,4(1/0) 9(111)+ S,4(1/0) 4(110) 11(111)+ 4(1/0) 36(4/3) 37(5/3),4(1/0) 4(1/0)+ 4(110) 4(1/0)+ 4(1/0) 4(1/0)+ 4(1/0) 12(3/0) Table 7-8. MC68000 Object Codes in Numerical Order ORB ORB ORB OR.w OR.w OR.w ORl ORl BTST MOVEP.w BTST BCHG MOVEP.l BCHG BClR MOVEP.w BClR BSET MOVEP.l BSET ANo.B ANo.B ANo.B ANo.w ANo.w ANo.w ANo.l ANo.l SUB.B SUB.B SUB.w SUB.w SUB.l SUB.l ADo.B ADo.B ADo.w Aoo.w Aoo.l Aoo.l BTST BTST BCHG BCHG BClR BClR BSH BSH EOR.B EOR.B EORB EOR.w EOR.w EOR.w EORl EORl CMP.B CMP.B CMP.w CMP.w CMP.l CMP.l MOVE.B MOVE.B MOVE.B MOVE.B MOVE.B MOVE.B MOVE.l MOVE.l MOVE.l MOVE.l MOVE.l 7-83 data8,Dn data8,dadr data8,SR data16,on data 1 6,dadr data16,SR data32,on data32,dadr on,don d16{Anl.on on,dadr on,don d16{An),on on,dadr on,don on,d16(An) on,dadr on,don on,d16{An) on,dadr data8,on data8,dadr data8,SR data16,on data 16,dadr data16,SR data32,on data32,dadr data8,on data8,dadr data16,on data 16,dadr data32,on data32,dadr dataS,on dataS,dadr data16,on data 16,dadr data32,on data32,dadr bitl,on bitb,dadr bitl.on bitb,dadr bitl.on bitb,dadr bitl.on bitb,dadr dataS,on dataS,dadr dataS,SR data16,on data 16,dadr data16,SR data32,on data32,dadr dataS,on dataS,dadr data16,on data 16,dadr data32,on data32,dadr son,don sadr,on dataS,on on,dadr sadr,dadr dataS,dadr rS,on sadr,Dn data32,Dn rS,An sadr,An Table 7-8. MC68000 Object Codes in Numerical Order (Continued) Instruction MOVE.L MOVE.L MOVE.L MOVE.L MOVE.w MOVE.w MOVE.w MOVE.W MOVE.w MOVE.w MOVE.w MOVE.w MOVE.w NEGX.B NEGX.B NEGX.w NEGX.w NEGX.L NEGX.L MOVE MOVE CHK CHK CHK LEA CLR.B CLR.B CLR.w CLR.w CLR.L CLR.L NEG.B NEG.B NEG.w NEG.W NEG.L NEG.L MOVE MOVE MOVE NOT.B NOT.B NOT.w NOT.w NOT.L NOT.L MOVE MOVE MOVE NBCO NBCO SWAP PEA EXT.w MOVEM.w MOVEM.W EXT.L MOVEM.L MOVE. L TST.B TST.B TST.w TST.w TST.L TST.L TAS TAS MOVEM.W MOVEM.w MOVEM. L MOVEM. L MOVEM. L TRAP 2 2 2 2 3 3 3 3 4 3~01ee 3 . 7 3." " ,',' , gOO t$$S:' 3~mggee 3' gll a 4 40';00ft 40::,; .," 4 40' Olff 40'~ B 40':" <.;,1 Oft 4C;h,fl C 40,:; {llff 4 B 4, 10ee 4' B 4 l1jj 4~,>~. 0 42'"'/ 4 4~ ,':; ,00ff Q~ f!:ft:: ~q 42": ',Olff 4!i:;'ir B 4~<::,: 10ft 44',i/ 0 44~:·' :'" OOff 4~'::i 4 44 ,>;:, Olff 44·, B 44" 10ft 44:. 440 c ;':,:llee 44··;' 46 46 F .. 00ij.d:4 OOft f,{ff. 46:,4~Q 46, ' ; 01 ft 46. B . 4ij, ~'10ff "it> 46,,', C 4~> 'Jlee~~ 4$. 'F 48 , 0 4tf , OOft 4fit, , ' 4 48 ,,'. 01jj 48:' . B 48 48," 4$' . ftf!·:; Om: . .10hhhlitlh A C 48····. :'llh~ 48': ,': E ',",. 4A o~. 4A OOft ffff' . 41\ 4 Om 4A Olff ffff 41\ 8 4A . 1Off ftff 4A, C 4A l1ff ffff· 4C '10jj 4C A 9$5$ 4C E Q'~s 4C, l1jj 4C E ~~.~ 4E. 4 Ww , (EXT) Orrr Orrr W.: {E~T) f~T) ijjj:., 7-84 data32,An rS,dadr sadr,dadr data32,dadr rS,On sadr,On data16,On rS,An sadr,An data16,An rS,dadr sadr,dadr data16,dadr On dadr On dadr On dadr SR,On SR,dadr On,dOn sadr,On data16,On jadr,An On dadr On dadr On dadr On . dadr On dadr On dadr On,CCR sadr,CCR dataB,CCR On dadr On dadr On dadr On,SR sadr,SR data16,SR On dadr On jadr On reg-list.madr reg-list,-(An) On reg -list,madr reg-list.-(An) On dadr On dadr On dadr On dadr jadr,reg-list (An) +,reg-list (An)+.reg-list jadr,reg-list (An)+,reg-list vector Table 7-8. MC68000 Object Codes in Numerical Order (Continued) LINK UNlK MOVE MOVE RESET Nap STOP RTE RTS TRAPV RTR JSR JMP ADDQ.B ADDQ.B ADDQ.w ADDQ.w ADDQ.w ADDQ.l ADDQ.l ADDQ.l ST DBT ST SUBQ.B SUBQ.B SUBQ.w SUBQ.w SUBQ.w SUBQ.l SUBQ.l SUBQ.l SF DBF SF SHI DBHI SHI SlS DBlS SlS see DBee see ses DBes ses SNE DBNE SNE SEQ DBEQ SEQ sve Dve sve SVS DVS SVS SPl DBPl SPl SMI DBMI SMI SGE DBGE SGE SlT DBlT SlT SGT DBGT 7-85 An.d16 An An.USP USP.An data16 jadr jadr data3.Dn data3.dadr data3.Dn data3.An data3.dadr data3.Dn data3.An data3.dadr On Dn.label dadr data3.Dn data3.dadr data3.Dn data3.An data3.dadr data3.Dn data3.An data3.dadr On Dn.label dadr On Dn.label dadr On Dn.label dadr On Dn.label dadr On Dn.label dadr On Dn.label dadr On Dn.label dadr On Dn.label dadr On Dn.label dadr On Dn.label dadr On Dn.label dadr On Dn.label dadr On Dn.label dadr On Dn.label Table 7-8. MC68000 Object Codes in Numerical Order (Continued) Instruction SGT SlE OBlE SlE BRA BRA BSR BSR BHI BHI BlS BlS Bee Bee Bes Bes BNE BNE BEQ BEQ Bve Bve BVS BVS BPl BPl BMI BMI BGE BGE BlT BlT BGT BGT BlE BlE MOVEQ OR. B OR.B OR. W OR.W OR.l OR.l OIVU OIVU OIVU SBe SBeo OR.B OR.W OR.l OIVS OIVS OIVS SUB.B SUB.B SUBW SUBW 7-86 dadr On On.label dadr label label label label label label label label label label label label label label label label label label label label label label label label label label label label label label label label dataS.On sOn.dOn sadr.On sOn.dOn sadr.On sOn.dOn sadr.On sOn.dOn sadr.On data 16.0n sOn.dOn -(sAn).-(dAn) On.dadr On.dadr On.dadr sOn.dOn sadr.On data16.0n sOn.dOn sadr.On rs.On sadr.On F Id 01 :y d m II li e 5 " )1 iE THE 2901, 2901 A, AND 2901 B MICROPRO' The 2901, 2901A, and 29018 are identical except for execution speeds. The than the 2901 ; the 2901 B is about 25% faster than the 2901 A. For details see the de The 2901 provides a 4-bit slice through the arithmetic and logic unit of a Centl the Central Processing Unit's registers may also be generated out of 2901 Ie Figures 8-1 and 8-2 functionally illustrate 2901 logic. Figure 8-1 is a variation of Figure 4-3 from Volume 1 : it illustrates 2901 logic description given in Chapter 4 of Volume 1. Figure 8-2 is a more accurate repr paths. Note that all logic and data paths in Figure 8-2 are four bits wide. 2901 logic consists of an arithmetic and logic unit. a local. two-part read/write mer and logic unit performs addition. subtraction. and the standard Boolean operati receives two inputs and generates one output. The local read/write memory storE results. In addition to the local read/write memory there is a "Q register" which is double-length operations. You may compare the 2901's 16 registers to a CPU VI usually implement a CPU's accumulator in the Q register. and you mayor may not i registers in local RAM (in general. however. you will implement these registers in You will frequently see obvious parallels between 2901 logic and CPU logic. You I understand 2901 logic; however. do not assume that these parallels translate intc The many data paths within the 2901 have been selected to link the ALU. local read output in a functionally efficient manner. Shift logic has been inserted at selected combination of data paths with ALU and shift logic minimizes the number of steps n cessing Unit functions. The few 2901 enhancements over the prior 6701 were designed specifically to redl implement typical CPU operations; and these few enhancements were sufficient t 2901 MICROPROCESSOR SLICE PINS AND SIGNALS Pins and signal assignments for the 2901 are illustrated in Figure 8-3. We will each of these signals superficially before examining device operations in detail. We may divide 2901 signals into these three categories: 1) 2) 3) Control inputs that are generated by a microinstruction Control signals connecting 2901 slices Data and status outputs First consider microinstruction-generated inputs. AO-A3 and 80-83 are two 4-bit addresses which select locations within the 29 10-18 is a 9-bit instruction code which determines data flow and arithmetic/logic. 9-bit control code can be divided into three 3-bit fields as follows: 8 7 654 3 o 2 I I I I I I I I I '--BitNo. ~Instruction coe 'L4'-_ALU l ALU ALU 8-2 sourceid operation destinatic Chapter 8 2900 SERIES CHIP SLICE PRODUCTS Chip slice products represent a radical departure from the single-chip Central Processing Units that we have described up to this point. Chip slice products are. in fact. the building blocks for many Central Processing Units: they are also used to build intelligent controllers. There are·a variety of chip slice-type products on the market today; however, the 2900 series products are the clear leaders in terms of sales and customer acceptance. The 2900 series is an enhancement of the older 6700 series chip slice products, which are not described since they are now obsolete. Chip slice products are described conceptually in Chapter 4 of Voume 1 (in fact, the "general case" product described in Volume 1, Chapter 4 is a thinly disguised variation of the 2901 microprocessor slice). Therefoer, the discussion which follows assumes that you have a conceptual understanding of chip slice devices and microprogramming. If you do nto have this background, see Chapter 4 of Volume 1 before reading any further. In this chapter we will describe the following 2900 series parts: ~ • • • • The The The The The 2901. 2901 A. and 2901 B microprocessor slices 2902A Look-Ahead Carry Generator 2903 Enhanced Microprocessor Slice 2909A. 2910. and 2911A Microprogram Sequencers 2930 and 2932 Program Control Units All 2900 series devices use bipolar LSI technology. 2900 series microinstruction execution times vary with manufacturer and device. Consult the data sheets at the end of this chapter for details. The primary source for the 2900 series chip slice products is: ADVANCED MICRO DEVICES 901 Thompson Place Sunnyvale. California 94086 Secondary sources for the 2900 series include: MOTOROLA SEMICONDUCTOR Box 20912 Phoenix. Arizona 85036 RAYTHEON SEMICONDUCTOR 350 Ellis Street Mountain View. Caiifornia 94042 NATIONAL SEMICONDUCTOR 2900 Semiconductor Drive Santa Clara. California 95050 FAIRCHILD CAMERA & INSTRUMENT CORPORATION 464 Ellis Street Mountain View. California 94042 8-1 THE 2901, 2901A, AND 29018 MICROPROCESSOR SLICE The 2901, 2901A, and 29018 are identical except for execution speeds. The 2901A is approximately 30% faster than the 2901; the 2901 B is about 25% faster than the 2901 A. For details see the data sheets at the end of this chapter. The 2901 provides a 4-bit slice through the arithmetic and logic unit of a Central Processing Unit. Some or all of the Central Processing Unit's registers may also be generated out of 2901 logic. Figures 8-1 and 8-2 functionally illustrate 2901 logic. Figure 8-1 is a variation of Figure 4-3 from Volume·1; it illustrates 2901 logic in terms of the general chip slice description given in Chapter 4 of Volume 1. Figure 8-2 is a more accurate representation of 2901 logic and data paths. Note that all logic and data paths in Figure 8-2 are four bits wide. 2901 logic consists of an arithmetic and logic unit a local. two-part read/write memory, and shift logic. The arithmetic and logic unit performs addition, subtraction, and the standard Boolean operations. The arithmetic and logic unit receives two inputs and generates one output. The local read/write memory stores data, which may be operands or results. In addition to the local read/write memory there is a "0 register" which is used as a temporary register or for double-length operations. You may compare the 2901's 16 registers to a CPU with 16 accumulators. You will not usually implement a CPU's accumulator in the 0 register, and you mayor may not implement a CPU's general purpose registers in local RAM (in general. however, you will implement these registers in .Iocal RAM). You will frequently see obvious parallels between 2901 logic and CPU logic. You may use these parallels to help you understand 2901 logic; however, do not assume that these parallels translate into CPU implementation. The many data paths within the 2901 have been selected to link the ALU, local read/write memory, data input and data output in a functionally efficient manner. Shift logic has been inserted at selected points along data paths so that the combination of data paths with ALU and shift logic minimizes the number of steps needed to create typical Central ProceSSing Unit functions. The few 2901 enhancements over the prior 6701 were designed specifically to reduce the number of steps required to implement typical CPU operations; and these few enhancements were sufficient to render the 6701 obsolete. 2901 MICROPROCESSOR SLICE PINS AND SIGNALS Pins and signal assignments for the 2901 are illustrated in Figure 8-3. We will summarize functions performed by each of these signals superficially before examining device operations in detail. We may divide 2901 signals into these three categories: 1) 2) 3) Control inputs that are generated by a microinstruction Control signals connecting 2901 slices Data and status outputs First consider microinstruction-generated inputs. AO-A3 and 80-83 are two 4-bit addresses which select locations within the 2901 local 16 X 4 bit RAM. 10-18 is a 9-bit instruction code which determines data flow and arithmetic/logical operations within the 2901. This 9-bit control code can be divided into three 3-bit fields as follows: 8 7 654 3 o .--BitNo. 2 I I I I I I I I I ~t _ L - f.-,nstruction code '4"'--___ 8-2 ALU source identifier ALU operation identifier ALU destination identifier Data In 16 x 4 bits of t--4 I bits wide_! I I I I 4-bit wide shifter 4-bit wide Complementer. Addition and Boolean logic (ALU Block) t wide shifter A (Direct connection from A-A to Y-Y) Figure 8-1. The 2901 Microprocessor Slice Volume 2 Rev. A. Update 2 8-3 1-79 ,....----,1>-........0 RAM3 CL~~D-_-D--I D;,octtg~JklmRr1TfD~EJJ Data 01 Inputs DO ControlD-------_t-....+__...J LeHers separated by a btoken line relate this figure 10 Figure 22-1 DE Figure 8-2. 2901 4-Bit Slice Logic 8-4 A3 A2 A1 AO 16 18 17 RAM3 RAMO (+5V)VCC F 10 11 12 CP Q3 BO B1 B2 B3 .. .-.. ... - --...-... .. --.. --... -- -..--- --... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 2901 DIP -- -.. -...- .. ...- --.. P OVR C(N+4) -- G -.. -.. --- OE Y3 Y2 Y1 YO ~ F3 GND CN 14 15 13 DO 01 02 03 QO 18 17 RAM3 nc RAMO (+5V) VCC F 10 11 12 CP nc Q3 BO B1 B2 B3 QO 03 02 01 --- -- ..- -- ,- -- ...--.. -... -- -... --... --.. -- --..... ..- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2901A FLAT PACK Pin Name Description Type DO - 03 YO - Y3 OE AO - A3 BO - B3 10 -18 RAMO, RAM3 QO,Q3 CN C(N+4) Data input Data output Output enable Local RAM A address Local RAM B address Instruction code Local RAM shift logic I/O Q register shift logic I/O Carry in Carry out Carry generate/propagate Zero status Sign status Overflow status Clock Power, ground Input Output. Tristate Input Input Input Input Bidirectional Bidirectional Input Output Output Output. Open collector Output Output Input G,P F F3 OVR CP VCC,GND Figure 8-3. 2901 A Microprocessor Slice Pins and Signal Assignments 8-5 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 ---- --.. --.. ..-. ------- -... 16 AO A1 A2 A3 OE Y3 Y2 Y1 YO P OVR C(N+4) G F3 GND CN 14 15 13 DO 00-03 is a data input port. All data entering a 2901 must be input via DO-D3. We include these four pins among the microinstruction-generated group since a microinstruction could indeed generate immediate data (in macro assembly language terms) to be input via DO-D3. A more common alternative might be to generate this data out of an external buffer. using microinstruction bits to enable a single output as follows: 2 to 4 Decoder ' - - - -..... D3. D2. D1. DO I--.....~ DO - D3 Enable 1 Enable 2 Enable 3 Buffer 1 Buffer 2 Buffer 3 OE is an output enable control. When OE is low. the 2901 can output data via YO-Y3. When OE is high. YO-Y3 is floated. A microinstruction must anticipate microcycles within which data output is to occur and must generate a low OE control at this time. When no data output is anticipated YO-Y3 should be floated. Let us now examine data and status output signals. As indicated in the previous paragraph. a 2901 outputs the results of internal operations via the four pins YO-V3. In addition, separate Overflow (OVR) and Zero (F) status indicators are output. These indicators are used to generate standard Overflow and Zero statuses - as we will describe later. Carry Status logic and associated signals are not simple status outputs; they are more accurately represented as interslice connecting signals. CN is the carry in used by addition and.!ubtra£,tion. C(N+4) is the carry out generated by addition and subtraction. Carry Look-Ahead logic uses the P and G signals, together with the 2902 Carry Generator. in order to compute the carry for an arithmetic operation occurring in parallel at two or more 2901 slices. This carry logic has been described in Volume 1. Chapter 4; it is summarized later in this chapter when we describe the 2902 Carry Look-Ahead Generator. The 2901 has two sets of internal shift, logic. For multislice shifts. bits shifted -out from one slice must be shifted into the adjacent slice. QO and Q3 are the shift pins used by one set of shift logic; RAMO and RAM3 are the shift pins used by the other set of shift logic. CP is the master clock signal used to control and synchronize event sequences within the 2901. 8-6 2901 LOGIC We will now examine 2901 logic in detail. The best place to start understanding 2901 logic is at the read/write memory (local RAM): RAM3 RO/Li -"- ~--\ RAMO LO/RI ./ ?~ ~ "-- 31N MUX ""'-- '-- -- 31N MUX I- I- 31N MUX 31N MUX I~ .A- l Z--r----r----r----r- Z AWord Add ress roGA1 01 DO D-- A2o-- C .... New> - 03 16-Bit by 4-Bit 2-Port RAM (Local RAM) A3D-- CLOCK CP 02 -~ ~ ~ ~ - - A .~ C .... New> m m all:C B- i - - C .... New> ----B B Latch A Latch E H ...-E C· .... New> ' ;; :;:, ~}; '" ," w '" ::: r , ii A MUX SMUX t t '" , '" " ";cc "".:;' ALU ': '.' >"''" , ,',,,,,,.,,""",',,',' ",' . .,•••.J"... Figure 8-8. ." 2901 Destination Code 4 Data Paths 8-20 ,.w "", '" '" "'" '" ,", "+'"~'''''''%'''''c''' ",,, " _f n 3%"'~:MUX 3-IN MUX §jffrft down t I Q Local RAM t t A Latch B Latch , Data Register r t II R MUX S MUX t t r ALU ~ ~ Y ~ nu)( Figure :::'c,"""" M,":::" ,'''''' ,",',<:' 8~9. :"',','0« .. "',,,.... ,", i,'L'" @<'i 2901 Destination Code 5 Data Paths 8-21 :,': .',,:,"'" ":',. ...: :~'::.:"" Q Local RAM Register A Latch B Latch R MUX S MUX Data--+---.... ALU Figure 8-10. 2901 Destination Code 6 Data Paths 8-22 i'" '" " ,'""",',, " " "n'"", ,,,, , , ' , ' , , ' ,'" ',M'",' ,",' ,,',';, "';;, ,,:,;, ",,' x ,,", ,'h ,H" " " " " " " " , " / ) : ' .":\ "",;,,;,:,;;;'1",:::;:;:;::,;, ; ~ 3-INauX ii" : E' , , 3-IN MUX shifiiJl, l I Q Local RAM Register ; ; A Latch B Latch A MUX S MUX t t Data--+-----, t ALU y ~,':J~:;, " 1!'" Figure 8-11. ',""',",' ',W ,'"" ',w',,;, " " " , H' " " " " " , " ' " ,,' , ",w"", ,," "',,'oW'",'" ,"'E"" "v';;;;',c; \"'",;,,'; ;W',""'W;i" 2901 Destination Code 7 Data Paths 8-23 ' '" ""'w"'>' "" , W ;""':" Let us now examine status logic of the 2901. You can generate Zero, Sign, Overflow and Carry statuses. The Zero, Sign and Overflow statuses are easy to understand, so we will look at them first. 2901 STATUS LOGIC Every 2901 generates an Overflow status at the OVR pin. This status is the exclusive-OR of carries out of the penu Itimate bit and the high-order bit. This may be illustrated as follows: 2901 OVERFLOW STATUS 3 C3 2 0 ",,--Bit No. C2 C2 = Carry from bit 2 to bit 3 C3 = Carry out of bit 3 OVR = C2 e C3 Every 2901 generates an Overflow status; however, in a multi-2901 configuration only the high-order (or most significant) 2901 Overflow status is usually used. Lower-order 2901 Overflow status outputs can be ignored. For an 8-bit configuration this may be illustrated as follows: High-order : Low-order 2901 I 2901 I 7 6 5 4 I 3 2 0 ~Bit No. 00 $5 11 Ignore low-order OVR High-order OVR becomes CPU status The Sign status wh ich is output at pin F3 is the level of the high-order ALU output bit. like the Overflow status, the Sign status is output by every 2901 in a multislice configuration; however, only the high-order 2901 Sign status is significant. For an 8-bit configuration this may be illustrated as follows: High-order 2901 SIGN STATUS Low-order 2901 2901 I 6 5 4 I3 2 I I I I F3 = level of bit 7. Use as CPU sign status F3 = level of bit 3. o ~BitNo. The Zero status is the NOR of the four ALU output lines, FO, F1, F2, and F3. If all fou r of these outputs are 0, then the Zero status output is 1. The Zero status is an open collector Signal; therefore in multislice configurations Zero status outputs can be wire-ANDed. The AND of all Zero status outputs in a multi-2901 configuration generates the Zero status for the CPU (Zero = FO • F1 • F2 • etc.). 2901 ZERO STATUS 2901 Carry status logic is not straightforward because in a multi-2901 configuration an arithmetic 2901 operation (such as addition) should occur in parallel at each slice; but the carry from a low-order CARRY slice will not be generated in time to be accounted for by a parallel operation occurring at a highSTATUS er-order slice. This problem has been described in detail in Chapter 4 of Volume 1, therefore we will not dwell on it at this time. For now it suffices to note that you can use the CN and-C(N+4) pins of a 2901 to generate carry if you allow ample time between clock cycles for the carry to ripple up through the slices. But if you 8-24 want to perform the entire arithmetic operation optimally. you must use the propagate (Pi and generate (G) signals. in addition to CN and C(N+4). These signals are processed by the 2902 Carry Look-Ahead device. which is described later in this chapter. Table 8-10. given in the 2902 Carry Look-Ahead device discussion. summarizes the exact logic used by the 2901 to generate P. G. CN and C(N+4). The 2901 can generate a Half-Carry status. The Half-Carry status is needed by microprocessors that use binary arithmetic with decimal adjust to generate binary coded decimal logic. In an 8-bit configuration the C(N+4) output from the low-order 2901 becomes the Half-Carry status. 2901 HALFCARRY STATUS SOME 2901 OPERATIONS In order to illustrate 2901 logic inaction, we will now show how various operations can be performed for a Central Processing Unit created using two 2901 slices. We will show the microcode for each operation, based on the following 34-bit microinstruction code: 2901 SAMPLE MICROCODE l1XX10000000XOXXXX X X X X X X X XBBBBAAAA 21201F1E1D1C1B1A191B1716151413121110 OF OEOD OC OB OA 09 OB0706050403020100 ~Microinstructionbit CYCXSI SOOEIB 17 16 15 1413121110 T1 TOM1 Me DH3DH2DHI DHODL3DL2DL1 DLOB3B2Bl BOA3A2Al AO I 1---' -~TTTTT ·Local RAM A address Local RAM B address Low-order 2901 immediate data in High-order 2901 immediate data in Source select o 0 - Immediate data from miCrocode o 1 - Data from buffer 1 1 0 - Data from buffer 2 1 1 - Data from buffer 3 Destination select (Four arbitrary destinatIons) Instruction code Output enable Shift/rotate logic control Carry in control 00 - 0 in 01 - 1 In 1 0 - source 1 in 1 1 - source 2 in The fields of the illustrated microinstruction are all self-evident. and have been described in the preceding text. with the exception of CY. CX. 51 and SO. These four bits are used by shift and rotate logic. which we are about to describe. Note that all fields. with the exception of the immediate data fields. are shared by the two 2901 devices. This is because 2901 devices operate in parallel and must perform identical operations at any instant The immediate 4-bit data fields differ since an 8-bit data field is unlike 4-bit halves. Consider shift and rotate logic (in macroprogram terms) for one or more 2901 slices. Figure 2901 SHIFT AND ROTATE 22-12 shows one possibility using 25LS253 Dual 4 Input Multiplexers to select the correct conOPERATIONS nections for RAMO. RAMN. 00. and ON. We refer to the high-order pins as "ON" and "RAMN" since one or more slices may be present. For a single slice. RAMN and ON would become RAM3 and 03. respectively. For two 2901 slices. RAMN and ON would become RAM7 and 07. respectively The key to Figure 8-16 lies in the 17 signals which are input to the 1G and 2G pins of the 25L5253 device. Recall that 17 is one of three control signals input to the 2901 destination control logic. 17 controls shift logic at the local RAM and register 3-IN MUX inputs. 17 is always high when a downshift occurs. 17 is always low when an upshift occurs. Thus in Figure 8-12. 17 conditions one 25LS253 device to output data. while disabling the other device. o 8-25 IT sr1 rT 1 1 yy T1 1 1 i7 lG CD ~ CJ) GND- lCO +5V- lCl lC2 GND- lC3 2CO GND+5V-=- 2Cl 2C2 2C3 --. A B lG 2G lY 25LS253 2Y 00 03 -- - 04 0(N-4) Loworder 2901 RAMO -- - -.. 0(N-3) ON - .- RAM4 RAM (N-4) - - lY High- order 2901 RAM3 A RAM (N-3) 25LS253 RAMN FN I Figure 8-12. 2901 Shift and Rotate Logic 2Y B 2G lCO ~GND lCl 1--+5V lC2 lC3 ~ 2CO ~GND 2Cl ~+5V 2C2 2C3 - r4- Shifts do not always occur at the 2901 local RAM or Q register inputs (see Figures 8-4 through 8-11). But that is not a problem. If the low-order to high-order 25LS253 device is enabled by 17. but no shift is to occur. then the 2901 will ignore the active 25LS253 output. When a shift is specified by 16. 17. and 18. then the SO and S1 inputs control the output of the selected 25LS253 device - which determines the kind of shift or rotate that will occur. In this discussion of shifts and rotates, the sense of a "Ieft" or "right" shift can cause confusion since all vendor 2900 literature illustrates bit positions from right to left: Low-order bit High-order bit We have elected to make our illustrations compatible with vendor literature so that you will have less trouble connecting descriptions of the same parts. But in macro assembly language terms a left shift normally implies multiplication: 7 6 54 32 High-order bit 0 Low-order bit while a right shift implies division: 765432 0 After right shift High-order bit Low-order bit 8-27 Given the bit numbering system used by 2900 vendor literature. the opposite shift logic would apply. That is to say. a left shift would become a divide: 0234567 Low-order bit High-order bit while a right shift becomes a multiply: o 234567 Before right shift After right shift Low-order bit High-order bit In order to avoid confusion, we shall refer to "upshifts" and "downshifts". An "upshift" causes multiplication. while a "downshift" causes division. An upshift becomes a left shift in macrolanguage terms. but looks like a right shift in 2900 vendor literature. and in the illustrations of this chapter. A downshift becomes a right shift in macrolanguage terms. but looks like a left shift in 2900 vendor literature. and in the illustrations of this chapter. We have elected to live with this confusion since it is smaller than the confusion which would arise if all our 2900 series part descriptions inverted bit numbers and data flows with respect to vendor literature. Beginning with the simplest case. consider a simple downshift where zero is loaded into the high-order bit and the loworder bit is lost. In effect the number has been divided by two. Figure 8-13 illustrates a downshift occurring in local RAM only. 17 is-low. therefore the right-most 25LS253 device (as illustrated in Figure 8-13) is enabled. while the left-most 25LS253 device is disabled. SO and S 1 are both low. therefore 1CO is output at 1Y and 2CO is output at 2Y. Thus 0 is loaded into RAMN - and it is assumed that the three bits 16. 17. and 18 cause the downshift to occur at the local RAM 3-IN MUX logic. Note that a 0 downshift will occur in Figure 8-13 at the same time as the local RAM downshift - if 16.17. and 18 codes have enabled the Q register 3-IN MUX downshift logic. For clarity we have not shown both downshifts occurring. Were 17 high. then in Figure 8-13 an upshift would occur with 0 loaded into RAMO. and thence DO. When executing a down- or upshift, as illustrated in Figure 8-13. you could shift in 1. rather than O. by inputting SO high and S1 low. This causes 1C1 to be output at 1Y and 2C1 to be output at 2Y. Next consider a down rotate; this operation is illustrated in Figure 8-14. The only difference between the down rotate illustrated in Figure 8-14 and the downshift illustrated in Figure 8-13 is the source for the Y2 output. A high input at S 1 with a low input at SO causes 1C2 to be output at 1Y and 2C2 to be output at 2Y. 1C2 and 2C2 receive their inputs from 00 and RAMO of the low-order 2901. respectively: hence a down rotate is achieved. 8-28 17 50 51 ±±b m lG A Q314 ... --I Q(N-3~i9h_ Q4 Q(N-4) 14 QN order 2901 I. 1Y .. 25L5253 ~.gO.i. . ~_G_+~_~_., 1C3 ~----. GND 2C01 ,. ;;:tC'1; h-l1q~;~~~~~m~ili.~~:;::_~I;B~.~C::;~~:I'ii;:· :::;:_I'l)tj~f;0~~;~~n~.jj~: ::.:t: 2y ;'r;:;"!' "~g~ 14- co FN t..J 1 co ~ o :E t;t~4 "; "(N~::~J DA.M " " .... ,' 'lJ~~!'!·"'''''ffl'uN tN_31~i.1 'M'! .. " " .' • ,' " l " ~ o ~ M.q- ~-~ LJ I ecce c ~ M ~ ~-~ ! 1__ .q- ic 2V ~ 0 :El«-~ MN .... iii~ ecce Figure 8-14. A 2901 Down Rotate 11V 17 SO o o 2G 1CO 1C1 19~ 2C1 ' "" 20'2:,,,~~~ 12V:f';;f;<;'lt~' 4 ;il~.' FN ;.1(,.",; B 25L5253 2901 A.M. co W o A U U W 0314 100 25L5253 2VI 51 !±b !±b 1G 50 51 You can generate an up rotate by inputting 17 high -which disables the right-most 25LS253 (as illustrated in Figure 8-14) and enables the left-most 25LS253. We need to stress again the fact that 17 has been chosen to enable the left-most 25LS253 when high. and the rightmost 25LS253 when low. because this conforms to the way in which shift logic within the 2901 is controlled. Let us now examine arithmetic shifts. The difference between an arithmetic shift and a logical shift lies in the highorder bit of a binary number. which arithmetic shift logic treats as a sign bit the sign bit must be excluded from the shift. For arithmetic shifts the logic illustrated in Figure 8-12 concatenates local RAM with the Q registers to generate a double length number. For two 2901 slices this may be illustrated as follows: High-order 2901 6 7 5 Low-order 2901 3 4 2 0 ....--Overall bit number I Local RAM 3 2 0 3 2 0 . . . . . - Local bit number 3 2 0 3 2 0 . - - Local bit number Ia II 15 14 13 12 11 10 9 register 8 '--"Overall bit number + Sign bit When an arithmetic downshift occurs. the high-order ALU output bit - which is the signed bit - is recycled back to RAMN. thus ensuring that it is preserved through the downshift. The remainder of the arithmetic number is shifted down one bit position. with the low-order local RAM bit (output via RAMO) becoming the high-order Q register bit (via ON). This may be illustrated as follows: 6 7 4 5 I I f a 1 I 2 3 RAMN 15 f-. 00 - - . Lost Re~ister ON 4 2t3~ 0 1C3 1Y Local RAM ~ I 14 13 12 I 11 10 9 t RAMO 8 1 High-order 2901 I I Low-order 2901 As illustrated in Figure 8-12. an arithmetic downshift is generated by 17=0. SO=1 and S1 =1. 8-31 An arithmetic upshift causes 0 to be shifted into 00 while ON, the high-order a register bit. is shifted into RAMO. This may be illustrated as follows: I I 6 7 I ~ I 4:3 5 2 0 ~OO"'O I a register I I ~ 2(:3 ON I local RAM 2Y ~ lost .... RAMN.-t ~RAMO ~1-5~1-4~1-3--1~2~1-1-1~1-0~9~'-' 8 I High-order 2901 I low-order 2901 Note that this arithmetic upshift does not preserve the high-order sign bit. Therefore the arithmetic upshift is really a double length logical upshift. You can easily generate double length down and up logical rotates by concatenating the a registers with the local RAM. Connect the 1C3 input of the left side 25LS253 device to the RAMN output. Connect the 2C3 input of the left side 25LS253 device to the ON output. Connect the 1C3 input of the right side 25LS253 device to the RAMO output. Connect the 2C3 input of the right side 25LS253 device to the 00 output. All of the shift and rotate logic functions we have just described, as well as the Status register and carry-in multiplexer, are contained in the 2904 Status and Shift Control Unit. This device eliminates most of the MSI. such as the two 25LS253s around the 2901 s. 8-32 Let us now look at the simple problem of loading data into a local RAM location. If the data is immediate - that is to say, if it is provided by the microinstruction itself - then the following single microinstruction will load eight bits of data into the local RAM location addressed by the B address: 2901 DATA INPUT r - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - O u t p u t result to RAM - - - - - - - - - - - - - - - - - - - - - - - - - - - - O R Data with 0 r - - - - - - - - - - - - - - - - - - - - - - - - - - I n p u t Data and 0 to ALU Select immediate data ffg ,. ____1. __-_,:LI ill ~~,'='~ ;.0 w",'" "" ""- XXXXX011011111XXOO D D D D D D D DBBBBXXXX 21201F1E1D1C1B1A191B1716151413121110 OF OE OD OC OB OA 09 080706050403020100~Microinstructionbit CYCXS1 SOOE IB 17 16 15 1413 12 11 10 T1 TOM1 MO DH3DH2DH1 DHODL3DL2DL1 DLOB3B2B1 BOA3A2A1 AO • "--~. TT-CT'------LocaIRAMAaddress Local RAM B address Low-order 2901 immediate data in High-order 2901 immediate data in L-_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Source select o 0 - Immediate data from microcode o 1 - Data from buffer 1 1 0 - Data from buffer 2 1 1 - Data from buffer 3 L . . . - - - - - - - - - - - - - - - - - - - , - - - - - - D e s t i n a t i o n select (Four arbitrary destinations) L - - - - - - - - - - - - - - - - - - - - - - - - - - - - I n s t r u c t i o n code L . . . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - O u t p u t enable L . . . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - S h i f t / r o t a t e logic control ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C a r r y in control 00 - 0 in 01 - 1 in 1 0 - source 1 in 1 1 - source 2 in If the data which is to be loaded into local RAM comes from an external buffer. and we arbitrarily assume that it comes from external data buffer number 2. then the following single microinstruction will transfer the data from external buffer 2 to the local RAM location selected by the B address: r - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - O u t p u t result to RAM - - - - - - - - - - - - - - - - - - - - - - - - - - - - O R Data with 0 r - - - - - - - - - - - - - - - - - - - - - - - - - I n p u t Data and 0 to ALU Select buffer 2 as data source , ±fE n~ I ,=tr--I------~~~tl~:;;ion into which data is loaded XXXXXO 11 0 1 1 1 1 1 XX 1 0 X X X X X X X X BBBBXXXX 21201F 1E 1D 1C 1B 1A 19 1817 16 15 14 13 1211 10 OF OE OD OC OB OA 09 08 07060504030201 00 -4--Microinstruction bit CYCXS1 SOOE 18 17 16 15 1413 12 11 10 T1 TOM1 MO DH3DH2DH1 DHODL3DL2DL1 DLOB3B2B1 BOA3A2A1 AO ~.-- TTTT'-----LocalRAMAaddress Local RAM B address Low-order 2901 immediate data in High-order 2901 immediate data in L . . . - - - - - - - - - - - - - - - - - - - - - S o u r c e select o 0 - Immediate data from microcode o 1 - Data from buffer 1 1 0 - Data from buffer 2 1 1 - Data from buffer 3 L - - - - - - - - - - - - - - - - - - - - - - - D e s t i n a t i o n select (Four arbitrary destinations) ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - I n s t r u c t i o n code ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - O u t p u t enable L - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -_ _ _ Shift/rotete logic control ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - -_ _ _ _ _ _ _ _ Carry in control 00 - 0 in 01 - 1 in 1 0 - source 1 in 1 1 - source 2 in 8-33 We described logic associated with microinstruction bits M1 and MO earlier. An arithmetic or logic operation performed on two sources taken from local RAM, with the result being output via Y to external destination number 1, requires the following single microinstruction: OutputresultviaY Select ALU operation Select A and B latches as ALU operands Y output destination select Local RAM B address Local RAM A address , . . ---j il,....--..-l....-..=t =L -,, " ±fffi X X X X 0 0 0 1 1 1 1 0 0 1 0 1 XX X X X X X X X XBBBBAAAA 2120 1F 1E 10 1C 1B 1A 191817161514131211 10 OF OE 00 OC OB OA 09 OB 070605040302 01 OO~Microinstruction bit CYCX 51 SO OE 18 17 16 15 14 13 12 11 10 T1 TO M1 MO DH3DH2 DHt DHO DL3 Dl2 DL1 DLO B3 B2 B1 BO A3 A2 A1 AO ""'" - - -'-1TTl~T I -Local RAM A address -Local RAM B address -Low-order 2901 immediate data in High-order 2901 immediate data in -Source select o 0 - Immediate data from microcode o 1 - Data from buffer 1 1 0 - Data from buffer 2 1 1 - Data from buffer 3 Destination select (Four arbitrary destinations) Instruction code Output enable Shift/rotate logic control Canry in control 00 - 0 in 01 - 1 in 1 0 - source 1 in 1 1 - source 2 in Now consider the same operation performed on one operand taken from local RAM (as addressed by A), while the other operand is provided by the microinstruction as immediate data: the result is returned to the local RAM location addressed by B. Here is the necessary microinstruction: it I t t t , - " - - _1_ Disable Y output Output ALU result to 8 Specify AL U operation Select immediate data and A latch as ALU operands Destination select Immediate data. second operand Result address in local RAM Operand address in local RAM Don't care XX X X 1 0 1 1 I I 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 8 B B 8 A A A A 21201F1E1D1C181A191B1716151413121110 OF OE 00 OC 08 OA 09 080706050403020100...-Microinstructionbit CYCX 51 SO OE 18 17 16 15 14 13 12 11 10 T1 TO M1 MO DH3DH2 DH1 DHO DL3 DL2 DL 1 OLO 83 B2 B1 80 A3 A2 A1 AO '----~----TLL- tL----- '---------------------- L..-._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ L..-._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ L..-._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ L..-._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Local RAM A address Local RAM 8 addr~ss Low-order 2901 immediate data in High-order 2901 immediate data in Source select o 0 - Immediate data from microcode o 1 - Data from buffer 1 1 0 - Data from buffer 2 1 1 - Data from buffer 3 Destination select (Four arbitrary destinations) Insiruction code Output enable Shift/rotate logic control ~----------------------------------- Carry in control 00 01 10 1 1 8-34 - 0 in 1 in source 1 in source 2 in Two microinstructions, with appropriate looping and select logic, is all you need in order to multiply two 8-bit numbers and generate a 16-bit product. The algorithm needed for this multiplication initially stores the multiplier in the low-order eight bits of the product space with the multiplicand in a separate 8-bit storage location as follows: 7 0 15 8 • Product (initial) o 7 Q B ~Product (final) I.--Product space 7 o 7 0 A ~Multiplier (initial) J...-MultiPlicand We are going to downshift the contents of the 16-bit product space eight times. After eight shifts. the multiplier will have been shifted out and lost. Therefore the high-order eight bits of the product space will initially be assigned to the low-order eight bits of the product. as shown above. In the typical "shift" and "add" multiplication routine (which we have described in Volume 1) the multiplicand is upshifted one bit position at a time. and is added to the product whenever there is a 1 in the multiplier bit corresponding to the current upshift. Here is a simple illustration of two 4-bit numbers being multiplied to create an 8-bit product: 1010·0101 00110010 = Step 1: 00000000 0101 101':e' Step 2: 00000000 01010 00001010 1 0"110 Step 3: 00001010 010100 n'·10 Step 4: 00001010 0101000 00110010 01::01 0 The multiplicand initially corresponds to the low-order multiplier bit. The multiplicand is subsequently upshifted three times. corresponding to the three higher-order multiplier bits. Following the first and third upshift. the multiplicand is added to the product. since bits 1 and 3 of the multiplier are 1. Now instead of upshifting the multiplicand. as illustrated above. we could downshift the product's space. This may be illustrated as follows: Step 1: Step 2: 00000000 0101 101ib 00000000 0101 00001010 Step 3: Step 4: 00001010 0101 o 0 0 0 10 10 0101 00110010 8-35 '1>0 1 0 This is the algorithm we are about to use. This algorithm allows the multiplier to be stored in half of the product space, since this space is slowly shifted out. Returning to our 8-bit X 8-bit multiplication, after the first shift the 16-bit product space will be shared by the low-order nine bits of the product and the high-order seven bits of the multiplier: 765432 0765432 0 ~sNft C••, 8 765 432 0765432 Multiplier , Product and ultimately the sixteen bits of the product space will be occupied by the 16-bit product - after the entire multiplier has been shifted out. Each time the contents of the product space are shifted down one bit position, the next low-order bit of the multiplier will be shifted out and will appear at output pin RAMO. This output is tested. If it is 1, then the multiplicand is added to the high-order eight bits of the product space {the 0 register) before the next shift occurs. The carry from the addition must become the next high-order product bit prior to the next addition. Therefore the carry is shifted into the high-order 0 register bit via 07. In this fashion, the multiplicand is added to the product in each bit position that corresponds to a 1 in the multiplier. The logic for this operation may be illustrated as follows: Since we have discussed multiplication algorithms in some detail in Volume 1, we will not spend more time in this chapter describing the theory of this multiplication algorithm. Rather. consider the following example: 2C' A4 =1C30 S~rt 0000000000101100 10100100 Step 1: 000000000010110'0-0000000000010110 Step 2: 0000000000010110---0000000000001011 Step 3: 0000000000001011-0000000000000101 10100100 1010010000000101 Step 4: 101001000000010';1:-0101001000000010 10100100 1111011000000010 C=O Step 5: 1 1 1 1 0 1 1 0 0 0 0 0 0 0 1; 0 - 0 1 1 1 1 0 1 1 0 0 0 0 0 0 0 1 Step 6: o1 11 10 1 1 0 0 0 0 0 0 01-0 0 1 1 1 1 0 1 1 0 0 0 0 0 0 0 10100100 1110000110000000 Step 7: 1 1 1 0 0 0 0 1 1 0 0 0 0 0 00:- 0 1 1 1 0 0 0 0 1 1 0 0 0 0 0 0 Step 8: o1 1 10 0 0 0 End 0001110000110000 C=O C=O 1 1 0 0 0 0 0 -0- 0 0 1 1 1 0 0 0 0 1 1 0 0 0 0 0 The algorithm above starts by downshifting 0 and B registers' contents as a single 16-bit entity. Carry, which must initially be 0, is Shifted into the high-order 0 register bit via 07, while the low-order bit of B appears at RAMO. If RAMO is 0, then must be added to O. If RAMO is 1, then the multiplier in the local RAM location with address A must be added to O. A second microinstruction accomplishes this addition. If this addition generates a carry, then the carry bit must be loaded into the next high-order product bit. By connecting the carry to 07 we make sure that any carry is loaded into the next high-order product bit on the next downshift of 0 and B registers' contents. Necessary logic is illustrated in Figure 22-15. ° 8-36 D 01- CP- CK 7y T I I I lG A (X) W --.J 1s, r S,l GND- lCO +5V- lCl lC2 GND- lC3 GND- 2CO +5V- 2Cl 2C2 2C3 B T C8 2G lY 00 03 Loworder 2901 25LS253 .. 2Y RAMO RAM3 - ... 04 07 I I I lG A lY High- -- 25LS253 order 2901 -- RAM4 RAM7 2Y CY· CX B 2G lCO 1Cl -=-+5V lC2 lC3 2CO 2Cl -+5V 2C2 2C3 -- 9 . FN I --- D O~ CP- CK 4- ~ Figure 8-15. 2901 Connections for Binary Multiplication In Figure 8-15. CX and CY high is the characteristic combination identifying binary n:tultiplication. As compared to Figure 8-12. we have modified the 1CO and 2CO inputs to the right-most 25LS253 device so that when CY and CX are both high. a downshift loads the Carry out into the high-order bit of 07. while 00 is loaded into RAM7 - and thence into the high-order bit of the local RAM location with address B. Thus a downshift treats the 0 and local RAM locations as a single 16-bit register. which. following a downshift causes a prior carry to be input at Q7 while the low-order multiplier bit is output at RAMO. Before describing the logic surrounding 11 in Figure 8-15. let us look at the two microinstructions which must be executed sequentially within a loop in order to perform the required multiplication. First we execute a downshift microinstruction. then we execute an add microinstruction. as follows: -~-L-~I=-r=--===-1==--=. =-=t-=-_=+-_=-==-~?~~~ 1Ir----+--1r---r-....--=--L==--- 11001100000011XXXX x x X x x x X XBBBBXXXX 21201F1E1D1C1B1A191B1716151413121110 OF OE 00 OC OB OA 09 080706050403020100~Microinstructionbit CYCX 51 SO ~ 18 17 16 15 14 13 12 11 10 T1 TO Ml MO DH3DH2 DHI DHO Dl3 Dl2 Dl1 DlO B3 82 Bl BO A3 A2 Al AO ------1TT -t-T . local RAM A address local RAM B address . low-order 2901 immediate data in ,High-order 2901 immediate data in ,Source select o 0 - Immediate data from microcode o 1 - Data from buffer 1 1 0 - Data from buffer 2 1 1 - Data from buffer 3 Destination select (Four arbitrary destinations) Instruction code Output enable Shift/rotate logic control Carry in control 00 - 0 in 01 - 1 in 1 0 - source 1 in 1 1 - source 2 in Multiplication specified Disable Y output Store sum in Q Add two operands and Q or A and Q fonm AlU operands Initial multiplier/final product low-order eight bits address in local RAM Local RAM multiplicand address Don't care o 1 • • t1 - I - 1 l1XX10000000XOXXXX X X X X X X X X8888AAAA 2120 IF IE 10 lC 18 lA 191817 16 15 141312 11 10 OF OE 00 OC OB OA 09 08 07060504030201 00 4--Microinstruction bit CYCX 51 SO 18 17 16 15 14 13 12 11 10 T1 TO Ml MO DH3DH2 DHI DHO Dl3 Dl2 Dl1 DlO 83 82 Bl 80 A3 A2 Al AO , or ----'-~TTTTT 8-38 ·Local RAM A address ·Local RAM 8 address ,Low-order 2901 immediate data in ,High-order 2901 immediate data in ,Source select o 0 - Immediate data from microcode o 1 - Data from buffer 1 1 0 - Data from buffer 2 1 1 - Data from buffer 3 Destination select (Four arbitrary destinations) Instruction code Output enable Shift/rotate logic control Carry in control 00 - 0 in 01 - 1 in 1 0 - source 1 in 1 1 - source 2 in The downshift microinstruction is self-evident. Note. howev~r. that RAMO must become the 11 instruction bit for the addition so that 0 will be added to Q when RAMO outputs O. while the contents of the local RAM location addressed by A are added to Q when RAMO outputs 1. But when CY and CX are not both high. binary multiplication is not in progress: therefore 11 comes directly from the microinstruction. The three NAND gates shown in Figure 8-15 provide the necessary logic. The multiplication example we have just described is a useful illustration of 2901 logic. but the2903. which we describe next. performs binary multiplication and division automatically. 8-39 THE 2903 MICROPROCESSOR SLICE The 2903 is a 4-bit microprocessor slice. The 2903 is conceptually similar to the 2901, which we have already described. The 2903 has more versatile signals than the 2901, and more on-chip functions; however, the 2903 and the 2901 are driven by clocks with approximately equal frequency. But remember, the 2901A and 2901B are faster than the 2901; therefore, they are faster than a 2903 - excluding special 2903 functions. The 2903A is currently in development and, when available, will offer faster operation than the' 2903. The 2903 is not a superset of the 2901. Microprograms written for the 2903 and the 2901 will be completely different so will external logic supporting the two devices. Nor is the 2903 always the part of choice. as compared to a 2901. If your application uses a lot of complex arithmetic and logic operations. or if your application requires a large number of local registers. then the 2903 is the part of choice. But if your application stresses execution speed. then the 2901 A or 2901 B may be a better choice. 2901 and 2903 ALU logic also differ sharply. The 2903 performs operations which encompass the simple 2901 ALU functions; the 2903 also performs a separate set of more complex operations. Furthermore. 2903 ALU logic discriminates between a high-order slice. a low-order slice. and an intermediate slice; 2901 logic makes no such high/intermediate/low-order distinctions. By discriminating between high-order. low-order. and intermediate slices. the 2903 is able to perform operations oil non-symmetrical data. For example. a twos complement binary number is non-symmetrical since the high-order bit is a sign bit subject to different interpretation from other bits. which are magnitude bits. Also. by discriminating between high-order. low-order. and intermediate slices. the 2903 makes double use of many signals; signals perform secondary functions at slices where the primary function is meaningless. For example. Carry. Generate. and Propagate signals share pins with Overflow and Sign status. since the Carry. Generate. and Propagate signals are meaningless at the most significant slice. while status signals are meaningful only at the most significant slice. In the description of the 2903 which follows, we will compare and contrast the 2903 with the 2901. We will refer to the 2901 description, together with Chapter 4 of Volume 1 for all conceptual information. The 2903 is packaged as a 48-pin DIP. It uses bipolar LSI technology. A 2903 FUNCTIONAL OVERVIEW AND COMPARATIVE ANALYSIS Figures 8-16 and 8-17 functionally illustrate 2903 logic. Figure 8-16 is a variation of Figure 8-1. given earlier in this chapter. and of Figure 4-3. from Volume 1; it illustrates the 2903 in terms of the general chip slice description given in Chapter 4 of Volume 1. Figure 8-17 is a more accurate representation of 2903 logic and data paths. SuperficiaUy the 2903 and the 2901 look very similar. Both have an arithmetic and logic unit which receives two inputs and generates a single output. Both have a 16 x 4-bit. two output-port RAM. additional local data storage in the 4bit Q register. and two sets of shift logic. The 2903 16 x 4-bit local RAM. like the 2901. receives two 4-bit addresses - the A and B addresses. Data can be written into the 2903 local RAM location addressed by B. but only when the separate WE control input is low. The 2901 has no signal equivalent to WE. Data addressed by A and B is output to the 2903 A and B latches; but the 2903 B latch has an output enable control. OE . which must be low for the B latch contents to be passed on. The 2901 has no signal B equivalent to OE . B Both 2901 and 2903 A and B latch outputs are transmitted to the Rand S ALU input multiplexers; but that is the only similarity between the twosets of ALU input logic. The 2901 uses three instruction code bits to generate eight possible combinations of Rand S inputs. The 2903 uses one instruction code bit. together with two new control signals to select substantially different ALU operand combinations. The 2903 then makes up for the lack of operand input options with additional ALU functions. Both 2901 and 2903 ALU outputs may go to the Q register. the Y port. or the 16 X 4-bit local RAM. Like the 2901. the 2903 Q register has shift logic at its input. The 2903 also has shift logic on the local RAM data path; but 2903 shift logic precedes the Y outputs. and has a separate output enable control Signal OEy like the 2901. Perhaps the most obvious difference between the 2901 and the 2903 lies in the data input and output ports. The 2901 has a single data input port. DO-D3. and a single data output port. YO-Y3. The 2903 has the same data input port. DAO-DA3. but the 2903 has two bidirectional data output ports. DBO-DB3 and YO-Y3. 8-40 4-bit Shifter Data in or out Figure 8-16. The 2903 Microprocessor Slice 8-41 A Word Address AO A1 A2 { A3 B1 BWord BO} 16 x 4-Bit 2-Port RAM ~~ Address WE EP 00 4:. N ~13 ~t ~t -t -, DAO DAl DA2 DA3 1m fA ~ 113 OEy of.r. oh 11~"" oA---oA I R2 "Z I R1 "1 I RO "U I DBO DB1 DB2 DB3 I so I Sl SU S1 I S2 5Z Arithmetic and Logic Unit I S3 ~Io 53 I I I III III I I L...-SIOO o ......CP Reaister G/N P/OVR Z C(N+4) 5103 4 I III .11loloom mm nLOI03 Figure 8-17. 2903 4-Bit Slice Logic 01°0 EA DAO DAl DA2 DA3 12 13 14 eN C(N+4) P/OVR GND G/N OEy YO Yl Y2 Y3 SIOo SI03 Z DBO DBl 2903 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 01°3 B3 B2 B1 BO CP 10 11 WRITE/MSS LSS lEN WE VCC (+5V) 15 16 17 18 OEB AO Al A2 A3 DB3 DB2 Description Type Data input Data input/output Local RAM A address Local RAM B address ALU R input select Local RAM write enable Data input/output RAM B output/DBO - DB3 input enable YO - Y3 output enable RAM shifter controls shifter controls Carry logic input Carry logic output Carry look ahead generate/Negative status Carry look ahead propagate/Overflow status Zero status/control Instruction code Instruction enable Least significant slice select Most significant slice select/Write indicator Power, Ground Input Input/output Input Input Input Input Input/output Input Input Bidirectional Bidirectional, Tristate Input Output Output Output Bidirectional, Open collector Input Input Input Bidirectional Pin Name DAO - DA3 DBO - DB3 AO - A3 BO - B3 EA WE YO - Y3 OEB OEy SIOO, SI03 0100, 0103 CN C(N+4) G/N P/OVR Z 10 - 18 lEN LSS WRITE/MSS VCC,GND 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 a Figure 8-18. 2903 Microprocessor Slice Pins and Signal Assignments 8-43 2903 MICROPROCESSOR SLICE PINS AND SIGNALS Pins and signal assignments for the 2903 are illustrated in Figure 8-18. We will summarize functions performed by each of these signals superficially before examining device operations in detail. 2903 signals can be divided into these three categories: 1) 2) 3) Data inputs and outputs Instruction and control inputs that are generated by a microinstruction Control and status signals connecting 2903 slices. and status signals generated by 2903 slices First consider data inputs, outputs and associated address signals. AO-A3 and BO-83 are two 4-bit addresses which select locations within the 2903 local 16 x 4-bit RAM. Data may be written into the local RAM location addressed by B - but only while both WE and the clock signal, CP, are input low. While CP is high. the contents of the local RAM location addressed by AO-A3 are written into the A latch -which is therefore changing continuously. When CP goes low. the A latch contents are stable. holding whatever data was read from local RAM at the instant that CP made its high-to-Iow transition. The A latch contents are continuously output to the ALU R input multiplexer. The B latch output is enabled by the OEB control signal. When this signal is high. the B latch still receives data from the local RAM location addressed by BO-B3. but the B latch output is floated. If OE is low and the B output from local RA~s enabled. then DBO-DB3 becomes a 4-bit output. The B output apB pears at DBO-OB3. as illustrated earlier. When OE is high and the B latch output is disabled. DBO-DB3 becomes a 4B bit data input. Data input via DBO-DB3 can be selected as the ALU S operand. DAO-DA3 always functions as a 4-bit data input. The R input to the ALU may be the A latch output from local RAM, or the DAO-DA3 external data input. If EA is high, then DAO-DA3 is selected. If EA is low then the local RAM A latch output is selected. 2903 ALU INPUT OPTIONS The low-order instruction code input (10) determines the ALU S input. If 10 is high. the Q register output becomes the S input to the ALU. If 10 is low. the B output from the local RAM. or data input via DBO-OB3 becomes the ALU S input. These options are summarized in Table 8-5: logically they may be illustrated as follows: A latch outPut-----~ - - - - - - - - - - - - A L U R input EA ____T __ DAO-DA3 - 8 latch output--------__1 ALU S input OE8--.....- - I D80-D83-----------------I IO---------------------~__1 Q Register output------------------~~ ALU input options are described in more detail later when we look at 2903 logic. YO-Y3, which were data output pins of the 2901, are bidirectional 2903 pins (see Figure 8-17). OEy is a control signal which enables or disables the~LU output. If OEy is low. then ALU output. after passing through the ALU shifter. appears at the YO-Y3 pins. But if OEy is high. ALU output is disabled and YO-Y3 become input pins. Data input at YO-Y3 can be written into the local RAM location addressed by BO-B3. provided WE and CP are low. 8-44 The 2903 has a 9-bit instruction code which is input via 10-18. The interpretation of this instruction code differs sharply from the 2901. Without reference to the 2901. the 2903 instruction code interpretation may be illustrated as follows: ....- - - - - - - - - - - - - - 1 6 special functions See Table 22-8 ~~ 00000. Select special functions , . TI_'__ 18 171 6 \ 5 \ 4 13\ 2 \ \ 0 ~Instruction code with bit number selectALU S input See Table 22-5 Not 0 0 0 O. Select ALU simple functions See Table 22-6 Specify ALU output destination See Table 22-7 As illustrated above, the 2903 instruction code has two different interpretations. We can compare 2901 and 2903 instruction codes. but to do so we must include the EA and OES control inputs as instruction code contributors. The two instruction codes may now be compared as follows: 2901: 2903: 18 17 16 15 14 13 12 11 10 l~~ 18 17 16 15 14 13 12 11 EA 10 OES Note that OES and EA do not usually come from the microcode. 2903 instruction code interpretations are quite complex and make use of additional control and status signals. Therefore we will complete our summary of signals before examining instruction code interpretations in detail. Let us now examine status and control signals of the 2903. We have already described WE. EA. The 2903 has logic to discriminate between a most significant slice, a least significant slice, or an intermediate slice. OE S' and OEy . 2903 SLICE SIGNIFICANCE SELECT When LSS is input low, a 2903 acts as a least significant slice. As a least significant slice, the WRITE/MSS signal becomes a WRITE output. As such. WRITE/MSS is output low for every microcycle during which data is written into local RAM. Frequently the WE inputs for all 2903 slices will be connected to the WRITE output of the least significant 2903 slice. This may be illustrated as follows: Most Significant Intermediate 2903 2903 2903 +5V LSS LSS +5V r---- W/MSS WE ~~ 2903 +5V +5V ~ Least Signficant Intermediate f-o LSS r--o +5V 0.- W/MSS 00- W/MSS ~ WE WE ~~ ~ 8-45 W/MSS WE LSS ~ j -~ At intermediate and most significant slices, LSS is input high. Now the WRITE/MSS signal becomes an MSS input. A low MSS input selects the most significant slice, while a high MSS input selects an intermediate slice, as illustrated above. iEN is described in vendor literature as an "instruction enable" input. This may lead you to believe that it enables or disables the 10-18 instruction code inputs. but in fact the effect of iEN is more limited. When low. lEN allows data to be written into the Q register: it also enables the WRITE output at the least significant slice. When lEN is high. data cannot be written into the Q register. and the WRITE output at the least significant slice is constantly output high. If the WE inputs for all slices are connected to the WRITE output of the least significant slice. then lEN high effectively disconnects the instruction code input. since it prevents data from being written into the Q register or local RAM: but it does not prevent an instruction from being decoded and executed by the ALU. and it does allow data to be output via the DB and/or Y pins. 2903 ALU logic has the stand~d Ca..':!y In (CN) and Carry Out (C(N+4)) signals. The 2903 also has 2903 the Carry Look-Ahead signals G and P. But if you look at the discussion of Carry Look-Ahead logic STATUS given in Chapter 4 of Volume 1 (and later in this chapter for the 2902). you will see that G and P SIGNALS outputs are not used at the most significant slice. Conversely. the Sign and Overflow status outputs are meaningful only at the most significant slice. Therefore 2903 pins share G with the Sign status (N) and P with the Overflow status (OVR). These pins output Sign (N) and Overflow (OVR) statuses at the most significant slice: they output Carry generate (3) and propagate (P) for intermediate and least significant slices. The 2903 also has an open-collector Zero status output (Z). This Signal is output high when all ALU outputs are low. The 2903 makes additional use of its shifter signals (SIOO, 8103, QIOO, Q103) and its status signals (CN. C(N+4), N, OVR, and Z). These Signals are occasionally used in special ways by ALU operations that do not use the signals for their primary purpose. For a summary see Table 8-8 and associated text. SIOO and SI03 are ALU shifter connections. QIOO and Q103, likewise, are Q register shifter connections. These Signals allow shifts to occur across multiple slices as described for the 2901. These Signals will always be connected as follows: Most Significant Slice Intermediate Slices QI03 0103 5103 Least Significant Slice 5100 0100 5103 +5V CP is the master clock signal used to control and synchronize events within the 2903. 8-46 0100 0100 SIOO 5100 2903 LOGIC We will now examine 2903 logic in detail. The best place to start understanding 2903 logic is at the read/write memory lIocal RAM): DO A Word Address {~~---I" A2~ A3 01 D2 03 BO B1 } B Word B2 ~ Address 16 x 4-Bit 2-Port RAM . WE A3 A2 A1 AO BO B1 B2 B3 B B Latch A Latch OEB ~~-1-~-----DBO ~-+----. OB1 OAO-----+-+--+~ ... DA3i OA 1 ----40-+--0 OA2----+... .......- - - O B 2 ....----OB3 The 2903 local RAM consists of sixteen 4-bit locations. You will use pins AO-A3 to identify the location from which data will be output at the A latch. You use pins 80-83 to identify the 4-bit location from which data may be output to the 8 latch or into which data may be written via YO-Y3. Data may be written into the local RAM location addressed by B may be illustrated as follows: but only while WE and CP are input low. This CP Y BO - B3 Local RAM Data Stable Data Stable Data Changing RAM Location X RAM Location Y X and Yare any two hexadecimal memory addresses , High WE inhibits write As illustrated above. the contents of the local RAM location addressed by 8 are changing while WE and CP are both low. When CP goes high. contents of the addressed RAM location are stable. holding whatever data was input when CP made its low-to-high transition. If WE is high. local RAM is not accessed and its contents remain stable. Data is output from the local RAM locations addressed by A and 8 when CP is high. The contents of the local RAM location addressed by A are output to the A latch. The contents of the local RAM location addressed by B are output to the 8 latch. These outputs occur when CP is high; therefore the A and 8 latch contents are continuously changing while CP is high. but they are stable while CP is low. holding whatever data was input when CP made its high-to-Iow transition. 8-47 The A latch contents are output continuously. We can therefore illustrate A latch output timing as follows: CP AD - A3 I X \ 1 \ 1 \ P X Q X R Read P A Latch Read Q ~ Local RAM C E: Q Stable ~ RAM Location P C r [ Read R E: R Stable ~ RAM Location Q C E RAM Location R P.O. and R are any three hexadecimal addresses. S represents stable data. and C represents changing data in the selected RAM location. In the illustration above. the RAM location addressed by A is shown as stable while CP is high and changing while CP is low. The stable data is output to the A latch while CP is high. The A latch contents subsequently become stable while CP is low - at which time local RAM contents are changing until RAM access time has elapsed. Thus race conditions are avoided. The A latch outputs are continuously enabled. B latch timing is a little more complex than A latch timing because the B latch has its own output enable control signal OE ' When OE B is high. the B latch output is floated. But when OE is low. the B latch outputs are enabled. B B S latch timing may be illustrated as follows: CP 80 - B3 B Latch I \___1 I \ X~_ _ _ _ _L_ _ _ _ _~I _ _ _ _ _ _ _M _ _ _ _ _ _~I Read L L Stable M Stable \_--' _______ X N ______ N Stable Read N DEB B Latch output - - - - - - - - - - - - - - - - - - . . . . . , . , . DBO - DB3 Input Input Output [M) means "contents of RAM location M". The VO- V3 input to local RAM may come from the ALU output. or from the VO-V3 pins. Unlike the 2901. there is no shifter at the local RAM input: rather. the shifter has been moved to the ALU output. and the shifter output is itself enabled or disabled by the OEy control input. If OEy isJQw. then the shifter output is enabled: it appears as output at YO-Y3 and at RAM DO-D3. But if OEy is high. YO-Y3 become input pins providing local RAM with its data input. The 2903 local RAM. like the 2901. generates a 4-bit slice through selected programmable registers of a Central Processing Unit. But it is much easier to extend 2903 local RAM using external memory. This is because the 2903 has one data input port and two bidirectional data ports situated between local RAM and the ALU. The 29705 is used as an expansion RAM. 8-48 CPU register implementation and ALU operand inputs are logically dependent on each other. since the primary function of CPU registers is to store ALU source or destination data. We will therefore explore the ALU operand options available using a 2903. and see what impact these options have on register implementation . Turning to the 2903 Arithmetic and Logic Unit. these three aspects of ALU logic are important: ....------.... 2903 ARITHMETIC AND LOGIC UNIT 1) The operands which are input to the ALU 2) 3) The ALU operation which is to be performed The destination for the ALU output. (The destination specification includes any shift operations.) Instruction code bit 10. together with EA and OE ' controls the data input to the 2903 ALU; instruction code bits 11 S through 14 specify simple ALU functions. while 15 through 18 specify the destination and shift operation for simple functions. Instruction code bits 15 through 18 may also specify special 2903 functions. Table 8-5 shows the ALU operand source options that can be specified using 10. EA. and OE B , Let us now explore these options in detail, Table 8-5. 2903 ALU Rand S Operand Selections Control Signal R Operand EA 10 OEa 0 0 0 1 1 1 0 0 1 0 0 1 0 1 0/1 0 1 0/1 A latch output A latch output A latch output DAO - DA3 input DAO - DA3 input DAO - DA3 input 8-49 S Operand B latch output DBO - DB3 input Q register output B latch output DBO - DB3 input Q register output 2903 ALU OPERAND OPTIONS Beginning with the logically simplest case. we will assume that EA is low. so the A latch output becomes the ALU R input. Any of the ALU S input options could also accompany EA high. in which case DAO-DA3 becomes the ALU R input. Consider 00-03 providing the ALU S input. while DBO-DB3 is idle: DO - D3 Local RAM B Latch A Latch 1 4 t - - - - - - - OEB = 1 _ - - - - - -... DBO - DB3 DAO - DA3 _ _ _ __ ~~~QO-Q3 .....~-IO=l EA=O---t~ ALU Data paths illustrated above would probably be used by a complex ALU operation involving one source operand. This source operand comes from local RAM via the A latch. while the complex ALU operation acts on temporary data held in the 0 register. 8-50 Now consider the same data paths illustrated above. but with OE input low. so that B latch data is output via OBOB DB3: DO - 03 L Local RAM I I A Latch B Latch ril : _ ~9 ,,- DAO - DA3 0 EA=O - D. " ~ RM OEB = 1 .... .. f ~ SM DBO - DB3 00 -03 -.. 10 = 1 J, "4 " ALU Data being output via DBO-DB3 will probably come from a CPU register implemented in local RAM. DBO-DB3 could be connected to external read/write memory within which additional CPU registers are implemented. The direct data path from local RAM to DBO-OB3 can be used effectively to implement any register-to-register operation within a CPU. If. for example. an Accumulator or other primary register is implemented in local RAM while secondary registers are held in external RAM. then the data path illustrated above lends itself readily to register-register data transfers. which may. or may not. occur in parallel with any other CPU operation. 8-51 Now consider the data paths we just illustrated. but with EA high. so that the ALU R operand comes from the external data inputs DAO-DA3. This may be illustrated as follows: DO - D3 Local RAM A Latch B Latch .·1 ......-----_ _-------.I DAO - DA3 "'"-_______..... RMUX S MUX OEB = 0 DBO - DB3 QO - Q3 ............... 10 = 1 ALU Data input via DAO-DA3 may be immediate data coming from a microinstruction. or non-immediate data taken from any other source. DAO-DA3 may also receive its input from an external RAM within which additional CPU registers are held. 8-52 But. moving away from complex operations that may require the ALU S operand to come from the Q register. let us examine some more complex data paths used by simple CPU operations. In the simplest case. the two ALU operands will come from local RAM. This may be illustrated as follows: DO - 03 Local RAM 1'/ .•4 - - - - - - - OEB = 0 Ik'}l~--------J DBO - DB3 _---..1 00 - 03 DAO - DA3 c......_ _ _.... EA= 0 ·~:,MUX ---I~ ....~-IO=O "<>;: AlU Data paths illustrated above show two ALU operands being taken from local RAM locations - 8-53 probably CPU registers. We can take the S ALU input from DBO-DB3 by inputting OE B high. thus enabling the data from the B latch. This may be illustrated as follows: DO - D3 Local RAM B Latch A Latch ....~------OEB = 1 l'Iaiiil!!BSB DBO - DB3 _-----J 00 - 03 DAO - DA3 '--_ _ _'" "'1---10= 0 EA= 0 ALU 8-54 Data entering at DBO-DB3 could be immediate data coming from a microinstruction. or data from an external RAM location being used to implement additional CPU registers. By inputting EA high. we can take. both the Rand S ALU inputs from external RAM: DO - 03 Local RAM A Latch B Latch ....f-------- DEB = 1 DBa - DB3 DAO - DA3 .......____......., EA =1 ,_---..1 RMUX $MUX 00 - 03 ""'-10=0 AlU In the illustration above you see one of the more significant 2903 advantages. as compared to the 2901. The 2901 allows a single operand to be taken from external RAM. and that reduces the effectiveness of external RAM as a means of implementing the two-port CPU registers in a 2901 configuration. It limits you to CPU architectures that include a group of secondary registers. only one of which can provide an ALU operand during the execution of any instruction. But the 2903. by allowing external data inputs to the Rand S ALU operands. allows you to implement CPU registers in internal local RAM. or in external RAM like the 29705. without compromising register logic associated with either implementation. 8-55 The 2903 has local RAM addressing. The 2901 allows you to specify just two local RAM addresses within a single microcycle. The A and B addresses identify the two ALU operands while the B address also identifies the destination address for the ALU product. Thus the ALU operand specified by the B address must be overwritten if the ALU product is to be returned to local RAM. But the 2903 allows either two or three local RAM addl'ilsses to be specified within a single microcycle; you have the option of creating one. or two B addresses within a single microcycle. If you create one B address, timing may be illustrated as follows: CP 2903 TWOADDRESS TIMING \'---~/ I \ 2903 LOCAL RAM ADDRESSING \ \~-_____-II I I I I WRITE =WE Operand R Address AO - A4 Operand S and Result Address 80 - 84 A and B provide the two local RAM addresses. As described earlier. while CP is high the contents of these two local RAM locations are output to the A and B latches. Subsequently. when CP is low. data is written back to the local RAM location addressed by B. since WE is low. In the illustration above. we show WE being driven low at the proper time by the WRITE output. WE will usually be connected to the WRITE output from the least significant 2903 slice. We generate three local RAM addresses in a single 2903 microcycle by changing the B address after reading an operand, and before writing back the result. Timing may be illustrated as follows: P-----... 2903 THREEADDRESS MICROCYCLE CP AO - A4 I 80 - 84 Operand S Address In the illustration above we delay lEN going low until the last quarter of the microcycle. This gives external logic sufficient time to change the B address. While lEN is high. WRITE is held high. Thus. delaying the lEN low pulse delays the WRITE pulse - which in turn delays the WE low input until a new address is stable at B. You can generate three-address timing. as illustrated above. by changing the lEN waveform from its normal two-address shape: cp _ _ _ \ ___ lEN ~ i 8-56 \ ~~-_\ to the following continuous three-address shape: CP I \ '''--_ _'--'1 I I \ I I I JI I I I I J.-ts~ 4 \ I I -I T You cannot directly drive WE from external logic in order to create a three-address microcycle since external logic may not b~le to identify mi~ycles during which....!:!2 write operation~o occur-and WE should be held high. By using lEN. and connecting WE to WRITE. you use lEN logic to provide WE with its correct shape. while you use WRITE to discriminate between microcycles within which a write should. or should not. occur. You use instruction code bits 10 through 14 to distinguish between simple ALU functions and special 2903 functions. When the five instruction code inputs 10-14 are all low. 15 through 18 are interpreted by the 2903 as "special function" identifiers. If one or more of the five inputs 10-14 are high. then simple ALU functions are interpreted as summarized in Table 8-6. These simple fLinctions are all self-evident and need no special discussion. 2903 SIMPLE ALU FUNCTIONS Table 8-6. 2903 Simple ALU Function Specifications Instruction Code ALU Dependent Output Signals ALU Operation and Output MSS 1413121110 00000 00001 000 1 X 001 0 X o0 1 1 X o 1 OOX o1o1X o1 10 X o1 1 1X 1 OOOX 1 001 X 1 o 1 0 X 1 o 1 1 X 1 1 0 0 X 1 101 X 1 1 1 OX 1 1 1 1 X See Table 22-8 A" ALU outputs high S - R - 1 + CN R - S - 1 + CN R + S + CN S + CN S + CN R + CN R + CN A" ALU outputs low RAND S R EXCLUSIVE NOR S R EXCLUSIVE OR S RAND S R NOR S R NAND S R OR S GIN P/OVR C(N+4) 0 C(N+4) C(N+4) C(N+4) C(N+4) C(N+4) C(N+4) C(N+4) 0 0 0 0 0 0 0 0 0 OVR OVR OVR OVR OVR OVR OVR 0 0 0 0 0 0 0 0 Other MSS .Other 0 N N N N N N N N N N N N N N N N G P P P P P P P 0 0 0 0 0 0 0 0 G G G G G G G G G G G G G G G Z 0 z z z z z z z 1 z z z z z z z R = R operand input S = S operand input Rand S are the complements of Rand S operand inputs. respectivelv CN = Carry in. C(N+4) = Carry out MSS = Most Significant Slice Table 8-6 also summarizes output signal levels associated with each ALU operation. Additional signal levels more closely associated with the ALU destination specification are given in Table 8-7. 8-57 Table 8-7. 2903 Destination and Shift Specifications for Simple ALU Operations 18 17 16 16 o CIO Hex Shift Code Result (= Y if OEy = 01 Shift Load Y3 MSS11 Y3 Other Y2 MSS1 Y2 Other YO All SI03 MSSlI SI03 Other SIOO All 0103 0103 0100 WRITE 0 0 0 0 DA21 (F/2)A None Q F3 SI03 SI03 F3 F2 F1 I I FO Hi-Z Hi-Z 0 1 DL3) (F/2IL Q SI03 SI03 F3 F3 F2 Fl I I FO Hi-Z Hi-Z 0 001 0 2 DA2) (F/2)A None DL3) (Q/2)L F3 SI03 SI03 F3 F2 F1 I I FO I QO 0 001 1 3 DL3) (F/2IL DL31 SI03 SI03 F3 F3 F2 F1 I I FO I QO 0 o o o o (Q/2I L 0 4 None F None Q F3 F3 F2 F2 Fl FO I I P Hi-Z Hi-Z 0 1 5 None F DL31 (Q/2)L F3 F3 F2 F2 F1 FO I I P I QO 1 1 1 0 6 None F None F F3 F3 F2 F2 F1 FO I I P Hi-Z Hi-Z 1 1 1 1 7 F None F F3 F3 F2 F2 F1 FO I I P Hi-Z Hi-Z 0 1 000 8 9 None UA4) (2F)A None Q F3 F2 Fl Fl FO SIOO F2 F3 I Hi-Z Hi-Z 0 UL5) (2F)L Q F2 F2 Fl Fl FO SIOO F3 F3 I Hi-Z Hi-Z 0 UA4) (2F),A None UL5) (2Q)L F3 F2 Fl Fl FO SIOO F2 F3 I Q3 I 0 0 1 CIO o Register ALU Output 000 1 1 1 o o 100 1 a. Signal Detail Shifter/Destination Summary Instruction Code Bits o o 1 0 A 1 1 B UL5) (2F}L UL5) (2Q)L F2 F2 Fl Fl FO SIOO F3 F3 I Q3 I o o 0 C None F Q F3 F3 F2 F2 Fl FO F3 F3 Hi-Z Hi-Z Hi-Z 1 1 D None F None UL5) (2Q)L F3 F3 F2 F2 F1 FO F3 F3 Hi-Z Q3 1 1 1 1 1 0 E None SIOO None Q SIOO SIOO SIOO SIOO SIOO SIOO SIOO SIOO I Hi-Z Hi-Z 0 1 1 1 1 F None F None Q F3 F3 F2 F2 F1 FO F3 F3 Hi-Z Hi-Z Hi-Z 0 1 1 1 1 1 1) 2) 3) 4) 5) MSS = Most Significant Slice DA = Down Arithmetic DL = Down Logical UA = Up Arithmetic UL = Up Logical I = Input pin P = Parity of SI03, F3, F2, Fl, FO HI-Z = High impedance F3, F2, F1 and FO are the four ALU output bits. F3 is the high-order bit. FO is the low-order bit. - With regard to Table 8-6. note that the Carry Out signal. C(N+4). is active for arithmetic operations only. P/OVR generates an Overflow status (OVR) at the most significant slice. and a Carry propagate signal (P) at other slices. Like the Carry Out. P/OVR is active only for arithmetic operations. Unlike P/OVA. GIN is active for all ALU operationsarithmetic and logical. The most significant slice outputs the Sign status (N) which is. in fact. the level of the highorder ALU output bit. Other slices output the Carry generate signal @. For a discussion of the Carry generate and propagate signals (3 and P) refer to the 2902 description. The Zero status is active for all slices. during all simple ALU operations. The Zero status is output high when all four ALU output signals are low. The Zero status output is low otherwise. Let us now examine 2903 destination options. 2903 DESTINATION Table 8-7 summarizes destination and shift specifications implied by instruction code bits OPTIONS 16 through 18 for the simple ALU operations summarized in Table 8-6. In Table 8-7 we show the ALU output and Q register operations. together with a detailed summary of associated signal levels. The detailed signal summary is given since slice significance and shift specifications combined make signal levels less than self-evident. If you look at the signal outputs shown in the signal detail section of Table 8-7. and compare these signal outputs with the illustrations of arithmetic and logic shifts given below. then the table will be easy to understand. Note that signals SIOO. 0100. and 0103 are frequently in a high impedance state. Selected destination specifications hold WRITE high. These specifications give you the option of not writing ALU output into local RAM - assuming that the WE inputs are connected to the least significant slice WRITE output. Destination code E propagates the SIOO input across all Y outputs. This code is used to extend the sign of a binary number. as we will describe later. Destination codes 4. 6. 6. and 7 report parity of the ALU output at the SIOO pin. Parity is reported for the 5-bit binary number given by S103. F3. F2. F1. and FO. Odd parity generates a high output at SIOO while even parity generates a low output at SIOO. Parity logic of the 2903 is cascadable across chip slices since the SIOO parity output of each slice becomes the SI03 input for the adjacent. less significant slice. The SIOO output from the least significant slice will always report the parity for the combined ALU output. We will demonstrate this multislice parity logic for the simple case of 8-bh data generated using two 2903 slices. This may be illustrated as follows: Most Significant Slice r A SI03 F3 F2 F1 Least Significant Slice ~~---------'~~--------" S100/S103 F3 F2 F1 FO SIOO "' FO '\J ~. .---..c/ o 1 ~?O Most Significant Slice 0 1 1 0 0 Least Significant Slice ~~---------,~~--------,,, ~~--------,~~--------~, SI03 F3 F2 F1 FO S100/S103 \ J ~. .---..v o 1 ~/1 8-59 F3 F2 F1 FO SIOO 0 1 1 0 1 The ALU shifter, but not the Q shifter, gives you the option of specifying either an arithmetic or a logical shift. The Q shifter allows you to specify logical shifts only. Logical shifts treat all bits in the same way. Thus. an 8-bit upshift may be illustrated as follows: 7 6 5 4 3 2 2903 SHIFT LOGIC o 4---Bit No. Before upshift After upshift An 8-bit downshift may be illustrated as follows: 7 6 5 4 3 2 o 4--BitNo. Before downshift After downshift An arithmetic shift assumes that the high-order bit is a sign bit bit arithmetic upshift may be illustrated as follows: 7 6 5 4 3 2 which must be excluded from any shift. Thus an 8- o .....-BitNo. Before upshift After upshift An 8-bit arithmetic downshift may be illustrated as follows: 7 6 5 4 3 2 o 4---Bit No. Before downshift After downshift The 2903 can perform arithmetic shifts since you must identify the most significant. least significant. and intermediate 2903 slices in a multislice configuration. Thus. when you specify an arithmetic shift. logic internal to the most significant slice isolates the high-order bit from the shift. while intermediate and least significant slices perform simple logic shifts. 8-60 The 2903 ALU shifter is located on the ALU output, in front of the Y data input/output port. In contrast. the 2901 ALU shifter is located at the local RAM input. Also, the 2903 ALU shifter output can be enabled or disabled via the OEy control signal. Thus you have a large number of microprogram-selectable options for handling ALU output, over and above the destination options summarized in Table 8-7. ALU output may be transmitted to local RAM: A YO - Y3 <. ;'';;,T ';;'f, ... "'>:..;:::." .;..... ;:.:.:::;; . <>:<.:: :.:::\L~/:}!\·!;;··h:i>' .•••• M···.d <';';'::' U ~ .oil 2903 ALU OUTPUT DESTINATIONS D Local RAM A B A Latch B Latch -- WE=O -- CP = 0 JJ- D, DAO - DA3 It ;', ". it OEy =0 ..- Shifter .- - EA --- ... ) DBO - DB3 "' .. ~ RMUX U ;, S MUX 0 QO - Q3 - 10 • '< :r "< ~ ALU l'!;";:;, <'j':.".. .:•. \. /'; ";';':.:.>"'::0:.';. . ;: :: :; :>•.. ;:~l ... ) To Q Register p 8-61 By holding WE high you can output data at the Y pins. but not write the output to local RAM: A YO - Y3 ~"\''';;:':';;, '" ;,V;':; • } ~ D Local RAM A B A latch B latch -- WE=1 - CP = X ~I~ D, DAO - DA3 h OEy=O - Shifter .> EA . :, ~ R MUX > U SMUX I ~ OEB .. ~ } DBO - DB3 II 00 - 03 - 10 '< ;, AlU > :,' "h',)" ,,;:";,;:,'\, ";, ;kf',' ," : " ' , ,,';, i i :::'\~":;:;\;'" ~l ",:;{, A.. .. ) To Q Register In either of the above cases the data may be shifted up or down. if so specified by instruction code bits 15-18 (see Table 8-7). 8-62 You can also discard the ALU output and use the Y pins as the data input port to local RAM: YO - Y3 l:t.< .. :.> ...•. . .> •... :. . '::.< .... . ....•.....:.. .'.:.": ".:'.:' .. : '\ U ~ ---- D Local RAM A B A Latch B Latch ~~-~ CP = 0 ..) DBO - DB3 r D, , DAO - DA3 h -- Shifter EA - 11 00 - 03 J ~\. ~ R MUX S MUX - 10 J .,.,.~ '< ALU Jl .A. .. ) To a Register If WE and OEy are both high. ALU output to YO-Y3 or local RAM is discarded You can use the last two ALU destination codes shown in Table 8-7 to extend a sign bit across one or more parallel 2903 devices within a single microcycle. Since the ALU destination code is used to generate sign extend logic, this operation can occur in conjunction with any compatible ALU operation specified by instruction code bits 14, 13, 12, and 11. 2903 SIGN EXTEND LOGIC ALU destination code F transmits the ALU output to the Y pins. and pulses WRITE low Assuming that OEy and WE are both .Iow. the ALU output will appear at the Y pins. and will be written into local RAM while CP is low ALU destination code E transmits the 5100 input across all four ALU output lines Again. WRITE is pulsed low: if OEy and WE are both input low. then the 5100 level is output at all Y pins. and is wntten into local RAM while CP is low 8-63 You can use this pair of ALU destination codes to extend a sign bit by applying the level of the sign bit to the SIOO input of those 2903 slices that are to extend the sign. Consider a 16-bit Central Processing Unit where the sign for the low-order byte must be extended across the high-order byte. This may be illustrated conceptually as follows: Least Most Significant Device Intermediate Device 2 3 15 I 14 13 12 11 10 9 15 14 13 12 11 10 9 8 Si~nificant 1 0 7 8 zIzIzI z z zIzIz Intermediate Device I X 6 5 Device 4 3 o ....-BitNo. 2 I y I y I y I y I y I y I y 6 5 432 y y y o I Before sign extension 4 - - B i t No. I I I I I y y y y After sign extension X = sign bit y = data bit Z = irrelevant bit A Central Processing Unit implemented using 2903 slices will automatically generate a sign extended ALU result for any arithmetic operation. You use sign extend logic to create data, rather than modify results of any computation. Suppose. for example. an 8-bit data input is received from an I/O port: if a 16-bit CPU is to interpret this data byte as a signed binary number. then the high-order bit must be propagated through the high-order byte of a 16-bit word as illustrated above. This is easily done using the E and F ALU destination codes. This is illustrated in Figure 8-19. Let us examine Figure 8-19. The two low-order 2903 slices are generating real data. These two slices therefore receive an F ALU destination code via 18-15. This destination code causes the ALU output to appear at the Y pins. and the highorder ALU output bit to appear at 5103. The two high-order 2903 slices generate the high-order byte across which the sign must be extended. These two 2903 slices therefore receive an E destination code via 18-15. The E destination code causes the 5100 input to be propagated across the ALU outputs. 8-64 I I ... Sign Out - z C(N+4) OVR W/MSS N ~~j 111 -- 15(1) = 1 15(0) = 1 - 0100 SI03 SIOO ~ - SI03 +5V C(N+4)· IS 2903 () SIOO ~ I !e~ + 4 III 0103 0100 ~ - SI03 SIOO f4- +5V C(N+4) LSS 2903 ",,"-Y CN () W/MSS ~~ W/MSS f----1. ~ z 0100 0103 _X CN IS 2903 +5V LSS WE z C(N+4) CN !e~ 15(3) = 0 15(2) = 0 -- SI03 2903 SIOO ~ 16-18 = 0103 0103 MSS 0100 I I z ~ LSS t - WE !e~ j I - j LSS WE ! CN f - - W/MSS ~ ~ !!!~ +~ ~ I- LSSQ WE t -:- - I- -- t~ ~"V'7 .,,> ."V., 'v~ Y3 - YO XXXX Y3 - YO XXXX Y3 - YO XYYY Y3 - YO YYYY MSS means Most Significant Slice IS means Intermediate Slice LSS means Least Significant Slice Y = data bit X = sign bit Figure 8-19. 2903 Sign Extend Logic 2903 SPECIAL FUNCTIONS Let us now examine special 2903 functions. These functions are summarized in Table 8-8. Special functions are implied by instruction codes bits 15 through 18 when instruction code bits 10 through 14 are all O. Nine special functions are provided; seven special function codes are unused. You should be sure not to use any of the unspecified special function codes since the 2903 device's response to these unspecified function codes is not guaranteed. Table 8-8 summarizes signal outputs and exact ALU operations associated with each of the special functions. Wherever a signal's primary purpose is meaningful. the signal is so used by a special function. Where a signal's primary purpose is not meaningful. the special function may generate an output to meet its specific needs. Do not attempt to understand ALU operations or signal utilization merely by inspecting Table 8-8. Many of the ALU operations, although absolutely accurate representations of ALU logic, rely on specific external pin connections to generate the required net effect. Signals, likewise, are used in special ways that depend not only on the special function, but also on the required pin connections which have been arbitrarily selected by the 2903 designers. ALU logic and signal utilization is described in detail function by function. We will begin by examining the simpler 2903 special functions, since many of these simple special functions act as accessory commands to the more complex functions. There are two normalization functions: a single length and a double length normalization. The double length normalization function is also the first twos complement divide instruction. 8-65 Table 8-8. 2903 Special Functions Summary Associated Signals Instruction Code(l) ALU Operation SI03 ALU Function 18 17 16 15 MSS Other SIOO 0103 0100 P/OVR WiiiTE C(N+4) Z GIN MSS Other MSS Other MSS IS LSS F = S + CN if Z = L F = R + S + CN if Z =H Hi-Z I FO I 00 0 C(N+4i OVR P N G I I 00 F = S + CN if Z = l F = R + S + CN if Z =H Hi-Z I FO I 00 0 ON+4) OVA P N G I I 00 I I P Hi-Z Hi-Z 0 C(N+41 OVR P N G Z Z Z I I P Hi-Z Hi-Z 0 C(N+4' OVR P (2) G 53 I I Hi-Z I FO I 00 0 CIN+4) OVR P N G I I 00 F = 5 + CN F3 F3 Hi-Z 03 I 0 (3) 02(!)01 P 03 G (4) (4) (4) F = S + CN R3@F3 F3 I 03 I 0 (5) F2~Fl P N G (6) (6) (6) F = S + R + CN if Z = l F = S - R - 1 + CN if Z = H ~ F3 I 03 I a CIN+41 OVR P N G (7) I I F = S + R + CN if Z = l F = S - R - 1 + CN if Z = H F3 F3 Hi-Z 03 I 0 CIN+41 OVA P N G (7) I I 0 0 0 0 Unsigned multiply 0 0 0 1 Unused 0 0 1 0 Twos' complement multiply 0 0 1 1 Unused 0 1 0 0 Increment F = 5 + 1 + CN 0 1 0 1 Sign/Magnitude twos complement F = S + CN if Z F = S + CN if Z 0 1 1 0 Twos complement multiply. last cycle F = 5 + CN if Z = l F = S - R - 1 + CN if Z 0 1 1 1 Unused 1 0 0 0 Single length normalize 1 0 0 1 Unused 1 0 1 0 Double length normalize 1 0 1 1 Unused 1 1 a a Twos complement divide 1 1 a 1 Unused 1 1 1 a Twos complement divide. final 1 1 1 1 Unused =l =H =H CD m 0> ao, a" a, ,,'" a' •• ,", '00' a ....~ ,."" ""} Fa. Fl. F2 and F3 are the four AlU output bits. RO. R1. R2 and R3 are the four R operand bits. SO. S 1. S2 and S3 are the four S operand bits. Bit 3 is the high-order bit. Bit 0 is the low-order bit. 1) 2) 3) 4) 5) 6) 7) 10 - 14 must all be O. N if Z = O. S3 (i) F3 if Z = 1. o 3 (!) 02 at MSS. CiN+4; at other slices. Zero status for 0 register output. F3 (!) F2 at MSS. CIN+41 at other slices. Zero status for combined. a-bit 0 register and AlU outputs. Sign compare output. Hi-Z I P MSS IS lSS Other = = = = = = = Signal floated Input signal Parity of S103. Y3. Y2. Yl. YO Most Significant Slice Intermediate Slice least Significant Slice IS or LSS 2903 The normalization operation upshifts the contents of a data word until the two highorder bits have different values. Zeros are shifted into low-order bit positions. Here are some normalization illustrations for 16-bit words: NORMALIZE SPECIAL FUNCTIONS Initial Normalized 0000001011000111 0101100011100000 1110101101000101 1010110100010100 0110101101011010 0110101101011010 0000000000000000 Cannot be normalized 1111111111111111 1000000000000000 Each normalize instruction is executed in one microcycle. During this microcycle one upshift occurs if the two highorder bits of the most significant slice S ALU operand are both O. or both 1. No operation occurs if the two high-order bits differ. In order to complete the normalization process for a multibit word that has many leading 0 or 1 bits. you must re-execute the normalize instruction the required number of times to shift out leading similar bits. If. for example. there are five leading 0 bits. followed by a 1 bit. you will have to execute a normalize instruction four times before the data is normalized. On the fifth execution of the normalize instruction the data will be left unaltered. Your logic must identify the point at which data has been normalized; the normalize instruction outputs appropriate status signals to identify normalization - as we will describe shortly, If binary data is being interpreted as a signed binary number. then a positive number. after normalization. will have a 0 in the high-order bit and a 1 in the adjacent bit: 01XXX---- After normalization a negative number will have a 1 in the high-order bit and a 0 in the adjacent bit. 10XXX---- The single length normalization instruction generates a data word out of the Q registers of parallel 2903 slices. Thus. you would generate an 8-bit data word out of two parallel slices as follows: 7 6 o 2 4 ~BitNo. 2903 SINGLE LENGTH NORMALIZATION I I I I I I I ~~ MSS LSS Q Q Register Register Four 2903 slices generate a 16-bit data word as follows: 15 14 13 12 11 10 9 8 6 5 4 0 ~ Bit No. 3 Ll.llllUJl!LWIJ MSS IS IS Q Q Q Q Register Register Register Register LSS MSS means Most Significant Slice. IS means Intermediate Slice. LSS means Least Significant Slice. The double length normalization instruction generates a data word out of the Q register and the local RAM location addressed by B. Two 2903 slices would generate a 16-bit word as follows: 15 14 13 12 11 10 9 8 7 6 5 4 3 o 2 LSS MSS Local LSS Local MSS Q Q RAM RAM Register Register 8-67 2903 DOUBLE LENGTH NORMALIZATION ~BitNo. There are some differences between the single and double length normalization instructions resulting from the fact that the double length normalization instruction must use local RAM, and the ALU, while the single length normalization instruction needs Q register logic only. We will therefore look at the single length normalization instruction first. The single length normalization instruction performs a number of upshifts until the most significant 2903 Q register has different values in its two high-order bits. Each upshift requires one microcycle. therefore the total execution time for the normalization instruction is variable. But the C(N+4) and OVR outputs are used to identify the last, and second to the last microcycles of the single length normalization instruction. On the second to the last cycle the OVR signal is output high; OVR therefore outputs the Exclusive-OR of 02 and 01 at the most significant slice. C(N+4). likewise. outputs the Exclusive-OR of 03 and 02 at the most significant 2903 slice. This may be illustrated as follows: o Register of Most Significant Slice .~ 103102101 J 00 1 ~ C(N+4) = 03 <±> 02 ~ OVR = 02 EE> 01 Thus C(N+4) goes high on the last microcycle of the single length normalization instruction. while OVR goes high on the previous microcycle. You cannot normalize a data word that is initially all 0 bits. Since zeros are shifted into the low-order bit position with each upshift. the normalization operation would never end. The single length normalization instruction therefore outputs a high Signal on the 0 status line and terminates in a single microcycle. For this to be possible the single length normalization instruction uses Z status logic to indicate 0 register contents. rather than ALU output. That is to say. Z is output high when all Q register bits are 0, not when all ALU outputs are O. You will now understand the special information output via C(N+4). OVR. and Z signals. as shown in Table 22-8 for the single length normalization instruction. During each microcycle of a single length normalization instruction the Q register contents are recycled through Q shifter logic. ALU logic, which would otherwise be unused, adds the contents of CN to the S operand input. This logic allows you to count the number of microcycles - and therefore upshifts - performed by the single length normalization instruction. Assuming that WE. OEy. OEB. and 10 are all low and CN is high. then the RAM location addressed by B becomes a microcycle counter. This RAM location becomes the ALU S operand. and the destination for the ALU output. The ALU output is simply theS operand input incremented by 1. assuming that CN is indeed high. Single length normalization instruction pin connections are illustrated in Figure 8-20. You can. if you wish. maintain a microcycle counter in external memory by inputting the ALU S operand from DBO-083 and outputting the ALU result at YO-Y3. This requires that WE and OEB be input high. If you execute the single length normalization instruction with 10 high. then the 0 register contents also become the ALU S input. Now on each microcycle the 0 register contents. before they are upshifted. are output by the ALU to YOY3. and/or local RAM. optionally incremented by 1 if CN is input high. Let us now 4;txamine the double length normalization instruction. The RAM location addressed by B provides the high-order half of the word being normalized. 0103 from the most significant 2903 slice must therefore be connected to SIOO at the least Significant 2903 slice. Also, you cannot use ALU logic to count instruction microcycles since ALU logic contributes to the normalization operation. Therefore CN must be input low, and if you wish to count microcycles you must use external logic or an extra microcycle per cycle. 2903 DOUBLE LENGTH NORMALIZATION The high-order half of the word being normalized can come from internal or external RAM. If it comes from internal RAM then the RAM location addressed by B must provide the S operand to the ALU. and must receive the ALU output. But you can also use external RAM to provide the high-order half of the word being normalized; now OBO-OB3 generates the ALU S operand and the ALU output is transmitted to YO-Y3. For this to occur OEB and WE must both be high. The C(N+4) and OVR statuses identify the last and second to the last microcycles of the double length normalization instruction's execution - just as they do for the single length normalization instruction. The double length normalization instruction also terminates in a single microcycle when you attempt to normalize a word which is initially O. At this time the Z status is output high. For this to be possible double length normalization logic tests the combined contents of the 0 register and ALU output in order to generate a Z status - as indicated in Table 8-8. Double length normalization pin connections are illustrated in Figure 8-21. 8-68 +5V Z = 00 • 01 ••• ON Z 03 0103 0100 0103 0100 SIOOt---~ SIOO SI03 SIOO SI03 SIOO CNt---~ 03 OVR N Z 0100 03¥02 02¥01 Z 0100t----t 0103 SI03 C(N+4) CN C(N+4) +5V IS 2903 W/MSS MSS 2903 LSS CN IS 2903. W/MSS +5V C(N+4) LSS 2903 W/MSS LSS LSS WE WE CN WE WE - ALU output = [S] + CN. If WE. OEB. OEy and 10 are low. [B] = [y] = [B] + CN [0] = [a] upshifted one bit MSS means Most Significant Slice IS means Intermediate Slice LSS means Least Significant Slice [S] = [B] = [y] = [0] = S ALU input Local RAM contents addressed by B y output 0 register contents Figure 8-20. 2903 Single Length Normalization Function Pin Connections Another simple 2903 special function is the Sign/Magnitude Twos Complement. This function converts negative twos complement numbers to this positive form, while leaving positive twos complement numbers alone. This may be illustrated as follows for 16-bit numbers: 2903 SIGN/ MAGNITUDE TWOS COMPLEMENT FUNCTION Initial After Sign/Magnitude Twos Complement 0110010111010010 0110010111010010 Unchanged positive number 1110101111010101 0001010000101011 Twos complement of negative number The 2903 uses slightly devious logic in order to implement the Sign/Magnitude Twos Complement function. This is the actual ALU algorithm executed: ALU output = ALU output = [S) means ALU S operand. S is [S) [S) + CN + CN if Z status is 0 if Z status is 1 the complement of the S operand. 8-69 +5V () Z .:. ~ = FO • Pi . . . FN • QO • Q1 • ON - z z z z- 0103 0100 0103 0100 0103 0100 QI03 0100 F3 . . . SI03 SIOO SI03 SIOO SI03 SIOO SI03 SIOO F3 ¥F2'" C(N+4) F2 ¥F'4- OVR F34-N CN W/MSS MSS 2903 +5V IS 2903 r-4. CN LSS WE WE • I~ OEy. +5V IS 2903 () W/MSS 1..........0 +5V LSS ~ ALU output = [S] + CN. If WE. OEB. ALU output is upshifted one bit [0] = [0] upshifted one bit C(N+4) CN C(N+4) C W/MSS LSS ~ WE C(t-.J+4) LSS 2903 ~ - ~O --- CN - 0 W/MSS WE LSS~ ~ CN and 10 are low. [B] = [y] = 2 [B] MSS means Most Significant Slice IS means Intermediate Slice LSS means Least Significant Slice [B] = Local RAM contents addressed by B [S] = S ALU input [y] = y output [0] = a register contents Figure 8-21. 2903 Double Length Normalization Function Pin Connections During execution of the Sign/Magnitude Twos Complement instruction. the Zero status at the most significant 2903 slice directly outputs the high-order S operand bit - which is the sign bit for a twos complement number. The Zero status becomes an input to intermediate and least significant slices. which therefore receive the sign bit from the most significant slice. For a 16-bit number this may be illustrated as follows: Most Significant Slice 15 z=y 14 13 Least Significant Slice Intermediate Slices 12 11 10 9 8 6 5 4 3 0 4--BitNo. 2 z=y z=y z=y ! ! t Now you can connect pins of 2903 slices in any way to make use of the Sign/Magnitude Twos Complement ALU logic, but to use it for its intended purpose, the connections illustrated in Figure 8-22 are required. 8 ... 70 +5V 4) j= -- S3 - - Z Z :~ ~ - ...... - Z Z 0103 0100 0103 0100 0103 0100 0103 0100 t-- SI03 SIOO SI03 SIOO SI03 SIOO SI03 SIOO I - - C(N+4) OVR N C(N+4) CN W/MSS MSS 2903 ~ LSS r---<> WE C(N+4) CN +5V IS 2903 W/MSS ~~ +5V LSS +5V C) CN LSS 2903 W/MSS 1----4 ~ LSS WE j,. C(N+4) CN IS 2903 () W/MSS ~ WE WE LSS~ j,. • ALU output = [S] + CN if Z = 0, or [5) + CN if Z = 1. If WE, OEB, OEy, CN and 10 are low, [B) remains unaltered if Z = 0, or [B) = [B) + 1 if Z = 1 In either case [y) = ALU output Neither ALU nor a shifter function 'OVR = 1 if ALU input is 1000····00, the most negative binary number. "N = F3 if Z = 0, or F3 E9 S3 if Z = 1 MSS means Most Significant Slice IS means Intermediate Slice LSS means Least Significant Slice [S) = S ALU input. (S) = complement of S ALU input [F) = ALU output [B) = Local RAM contents addressed by B [0) = a register contents F3 = High-order ALU output bit from most significant slice S3 = High-order ALU S operand input bit to most significant slice Figure 8-22. 2903 Sign/Magnitude Twos Complement Function Pin Connections By connecting Z to CN positive. twos complement numbers are passed unaltered through the ALU: [F) CN = = [S] + CN if Z = 0 Z. therefore [S] = [S] +0 But a negative twos complement number is complemented and then incremented: [F) = [5] + CN if Z = 1 CN = Z. therefore [S] = [5] + CN In other words. a twos complement number is twos complemented - which generates a positive number. (If you are unclear on this twos complement logic refer to Volume 1. Chapter 2.) 8-71 The negative status, N, is output high at the most significant slice if a negative twos complement number was converted to its positive form. This is the actual logic used by the most significant 2903 slice: If Z = 0, N = F3 Z = 0 when S3 = 0, in which case [F) If = [S] Therefore N = F3 = S3 = 0 Z = 1, N = F3 E9 S3 Z = 1 when S3 = 1, in which case [F) = [S] Therefore N = F3 ~ S3 = S3 S3 = 1 e +1 The Overflow status indicates the only overflow condition which can occur when a Sign/Magnitude Twos Complement conversion is performed. There is no twos complement positive representation for the most negative twos complement number which can be represented: If [S] = 1000·····0 [F) =0111·····1 + 1, = 1000·····0 If this most negative number is received at the S operand, it is passed through unaltered and the Overflow status from the most significant slice is output high. The Sign/Magnitude Twos Complement instruction places no restrictions on where the S operand may come from. Any of the three options - external memory, local RAM, or the Q register - may provide the S operand to the ALU. The third and last of the simple 2903 special functions is the Increment. This special function adds 1, plus the Carry In to the S operand. This algorithm may be illustrated as follows: [F) = [S] + 1 + CN 2903 INCREMENT FUNCTION [F) is the ALU output. [S] is the ALU S operand input. and CN is the Carry In. If CN is 0, you increment by 1; if CN is 1, you increment by 2. This is useful in byte/word machines if the Program Counter is kept in local RAM. Once again the S operand may come from external or local RAM or from the Q register. The increment special function makes no special use of status logic. 2903 UNSIGNED Let us now look at the unsigned multiply special function. The algorithm used by the 2903 MULTIPLY to perform an unsigned multiply is exactly the same as the algorithm which we described earlier in this chapter, when showing how to program an unsigned multiply for the 2901. Initially the multiplier must be in the Q register and the multiplicand in the RAM location which provides the ALU R input. This may be external RAM connected to DAO-DA3, or local RAM addressed by A. The product will be generated in the RAM location that receives ALU output. and the Q register. The RAM location connected to ALU output may be external RAM connected to YO-Y3, or local RAM addressed by B; it ultimately holds the upper half of the product. The Q register holds the lower half of the product. The RAM location that finally holds the upper half of the product must initially contain O. Thus we can illustrate initial and final data locations as follows: Multiplicand Initial: Multiplicand Final: R Multiplier (0) II R S IQ I Product upper lower II S I Q I The 2903 unsigned multiply operation will multiply two 16-bit numbers to generate a 32-bit product. If you wish to multiply larger numbers you must do so in 16-bit increments and add partial products using additional microcycles. If we compare the register utilization illustrated above with the unsigned multiply description given for the 2901, the local RAM location addressed by B in the illustration above becomes the window into which the multiplicand is added whenever a 1 bit is shifted out of the multiplier; but 2903 logic tests this bit internally, outputting the least significant Q register bit from the least significant 2903 slice via the Z status. The Z status becomes an input to the most significant and intermediate slices, so that these 2903 devices can also tell whether the multiplicand is to be added into the product window. Thus the unsigned multiply consists of 16 microcycles. In each microcycle the loworder bit of the Q register in the least significant slice is tested. If this bit is 1. the mu Itiplicand is added to the partial product. If this bit is 0, no addition is performed. Addition, if it occurs, consists of adding the ALU Rand S inputs, which probably means adding the contents of the RAM location addressed by A to the contents of the RAM location addressed by B. If A and B are the Rand S ALU inputs, respectively, with the sum returned to the RAM location addressed by B, then WE, OEB. OEy. EA. and 10 must all be O. 8-72 After the low-order bit of the Q register in the least significant slice has been tested. and a conditional addition has been performed. the product space (local RAM addressed by B. and the Q register) is downshifted one bit position during the same microcycle. The Carry status following the addition is shifted into the high-order bit of the ALU output for the most significant slice. If no addition is performed. then the Carry will e_qual O. and 0 will be shifted into the highorder ALU output bit of the most Significant 2903 slice. This may be illustrated as follows: Most Significant Slice R input S input ~ ~ ----I~--I~ C(N+ 1) = C 'F2 C \ \ F3 \'----~. \ F2 F1 SIOO = FO A single microinstruction performs the actual unsigned multiplication; however. preceding instructions must load the multiplier and multiplicand into their appropriate registers. and must zero the RAM location to be used for the running partial product. Necessary pin connections in a 2903 configuration that uses the unsigned multiply function are illustrated in Figure 8-23. The use of status by the unsigned multiply function is straightforward - with the exception of the Zero status which propagates the current low-order multiplier bit to all 2903 slices as we have already described. The Carry In, CN, must be O. If it is 1 you get the wrong answer when the multiplicand is added to the product window. The Carry Out, C(N+4}, the Overflow, and the Sign status are all output by the most significant 2903 slice to reflect the result of each partial product addition. However. these statuses are useless and should be ignored. The 2903 will also perform twos complement multiplication on two 16-bit signed binary numbers to generate a 32-bit signed binary resuft. The algorithm for performing twos complement multiplication is essentially the same as the unsigned multiplication algorithm which we have already described; the same registers are used to hold the multiplier, the multiplicand, and results. 2903 TWOS COMPLEMENT MULTIPLY FUNCTION There are two differences between signed and unsigned multiplication; they are: 1) 2) We must account for the sign bit of the multiplier. which is not a magnitude bit. Slightly different logic is needed to generate the bit which is shifted into the high-order ALU output from the most significant 2903 slice following each downshift. The logic of twos complement multiplication using Signed binary arithmetic is readily deducible from the unsigned multiplication algorithm which we described for the 2901. together with the discussion of Signed binary arithmetic given in Chapters 2 and 3 of Volume 1. Moreover. you the user cannot modify twos complement multiply logic in any way; therefore a detailed understanding of the algorithm is of academic interest only. The algorithms for Signed and unsigned binary multiplication remain the same until the last microcycle - at which time the sign bit of the 8-73 multiplier is in the low-order bit of the product space. This may be illustrated as follows: Local RAM MSS IS IS ------.. LSS .. Ix/x/xlxlxlxlxlxlxlxlxlxlxlxlxlx V ~---- ------~~ ~......----~ window into which multiplicand is added generating partial product Q Register MSS IS IS LSS ~~ I X I X I X I X I X I X I X IX I X I X I X I x·1 X I I xl I X S t sign bit. last bit of multiplier, which has been downshifted out of Q register If the sign bit is 0, then the multiplier is positive and the multiplicand need not be added again to the partial product; following the next downshift the multiplication is complete. But if the sign bit is 1, then on the last microcycle the mu ltiplicand must be subtracted from the partial product before the final downshift. When the Twos Complement Multiply function is executed, following each downshift, the Exclusive-OR of the Overflow and Sign statuses is moved into the high-order bit position of the most significant 2903 slice. This ensures that a 1 is shifted into the high-order bit position if addition generated a Carry, or if a negative result must have its sign extended. 8-74 +5V C) :: -. OO,LSS - - .~ - - 4,.· Z Z Z Z 0103 0100 0103 0100 0103 0100 0103 SI03 SIOO SI03 SIOO SI03 SIOO SI03 C(N+4) CN OVA . . . OVA F3'" N ~ +5V LSS r--o W/MSS MSS 2903 WE j C(N+4) C(N+4) CN IS 2903 +5V C) CN IS 2903 W/MSS ~ LSS +5V () W/MSS 0100 ~OO FO, LSS SIOO C(N+4) LSS 2903 H W/MSS LSS I-- ~ CN ~O WE WE WE h j~ j~ LSS~ + CN if Z = 0, or [A) + [S) + CN if Z = 1 [F) and [0) are downshifted one bit position MSS means Most Significant Slice IS means Intermediate Slice LSS means Least Significant Slice [S) = S ALU input [A) = A ALU input [F) = ALU output (0) = 0 register contents 00 = Low-order bit of 0 register FO = Low-order bit of F register ALU output = [S) Figure 8-23. 2903 Unsigned Binary Multiply Function Pin Connections Figure 8-24 illustrates pin connections needed to execute Twos Complement Multiply and Twos Complement Multiply Last Cycle special functions. The only non-obvious aspect of Figure 8-24 is the generation of the Carry In (CN) to the least significant 2903 slice. This Carry In must be 0 until the last microcycle. at which time it must receive the Zero status. We therefore show the Twos Complement Multiply Last Cycle instruction code uniquely generating an ENABLE signal which conditions an AND gate that generates the CN input The AND gate passes through the Zero status during the Twos Complement Multiply Last Cycle instruction's execution. but at other times the AND gate does not pass the Zero status. generating a o CN input This function is provided in the 2904 logic. You must execute twos complement multiply instructions in the proper sequence in order to perform twos complement multiplication using 2903 devices You execute the Twos Complement Multiply special function fifteen times. then you execute the Twos Complement Multiply Last Cycle special function. The two microinstructions which perform the twos complement multiply and the last cycle of the twos complement multiply must of course be preceded by microinstructions that correctly load registers and zero the memory word being used for the high-order half of the product 8-75 +5V () ~~ 00, L5S - .... OV Z :~ - - Z Z Z 0103 0100 0103 0100 0103 0100 0103 0100 - SI03 SIOO SI03 SIOO SI03 SIOO SI03 SIOO - C(N+4) ll.- OVR W/MSS MSS 2903 F3 4 - N C(N+4) CN WE 14r--o CN +5V IS 2903 () C) W/MSS ~ W/M5S ~ l5S lSS ~ C(N+4) +5V lS 2903 +5V lSS CN WE WE .~ j ~ C(N+4) lSS 2903 ~~ - W/M5S WE ENABLE AlU output, not last cycle, AlU output, last cycle, = = [5] + CN if Z = 0, or [R] + [5] + CN if Z = 1 [F] and [0] are downshifted one bit position [5] + CN if Z = 0 or [5] - [R] - 1 + CN if Z = 1 [F] and [0] are downshifted one bit position ENABLE is high on last cycle only MSS means Most Significant Slice IS means Intermediate Slice l5S means least Significant Slice [S] = S AlU input [R] = R AlU input [F] = AlU output [OJ = register contents 00 = low-order bit of a register FO = low-order bit of F register a Figure 8-24. 2903 Signed Binary Multiply Function Pin Connections 8-76 CN ~ ---0= LSS* We will now examine the 2903 Twos Complement divide special function. 2903 TWOS You divide a divisor into a dividend. The answer is called a quotient. and there will be a remainder. This may be illustrated as follows: COMPLEMENT DIVIDE FUNCTION Quotient r = Remainder Divisor ) Dividend Conceptually the algorithm for performing binary division is very straightforward. As for decimal division. you begin at the most significant end of the dividend: 1 0 1 ... 1 1) 1 00· .. 1 1 0 1 110 ... 11 But when you perform binary division the problem reduces to comparing the magnitude of the divisor and the current dividend field: ~ . - . -. X .. - - . - - - ( .. DIvisor larger. X = 0 101"'11)"-"-'-'-~ Divisor smaller. X = 1 - 1 0 1· .. 1 1 ~ When performing a twos complement divide we begin by subtracting the divisor from the high-order end of the dividend: 1 0 1 0 1 1 0 1 »):f'&it"Q;~;;1;(11 0 1 1 1 1 0 1 /10101101 Dividend most significant field 001 001 0 1--Partial remainder If the divisor is the smaller number. as it is in the illustration above. then the partial remainder is positive: we add the next dividend bit and subtract again: 10101101)1101001010111101 10101 101 001001011 10101101 This is equivalent to upshifting the combined partial remainder and dividend residue one bit position. and then subtracting the divisor again: I'-- 1 0 1 0 1 1 0 1) 1 1 01 00 1 0 1 0 1 11 1 0 1 ~10101101~ '--P-a-rt-ia-I-re-m---ainder-p 0 JJ?t 10 ~ Dividend residue ---~ 0010010110111101 001 001 0 1 1 0 1 1 1 1 0 1-Upshift combined partial ---------~11i0!...1LQOJ1_1LQO~1 remainder and dividend residue 8-77 But what happens if you get a negative result after subtracting the divisor from the current dividend field? The answer is that you must add the divisor back to the partial remainder before upshifting the dividend one bit position: and then subtract the divisor again. But in binary logic this is what happens: (Partial remainder + Divisor) x 2 - Divisor t this is the equivalent of an upshift The sequence of operations is equivalent to: Partial remainder x 2 - Divisor Therefore when you subtract the divisor and get a negative result. you simply upshift the concatenated Partial remainder and Dividend residue fields one bit position. then subtract the divisor on the next step. This is. in essence. the algorithm used by the 2903 to perform binary division. and is called "non-restoring" division. It is based on the Twos Complement Divide special function. which performs the following net operations: [F] = [S] + [R] if Z = 0 [F] = [S] - [R] if Z = 1 [Fl [S1. and [R] are the ALU output. S operand and R operand. respectively. The Zero status is generated by sign compare logic as the complement of the Exclusive-OR of most significant slice high-order ALU output and R operand input bits: Z = R3E9F3 Additional required conditions are that lEN be low and one of the Twos Complement Divide special functions be executed. The sign compare level is output at the most significant 2903 Zero status and it is input to the Zero status of intermediate and least significant 2903 slices. In effect. the sign compare logic compares the sign of the partial remainder with the sign of the divisor. This generates the following logic sequence: 1) If [F] and [R] signs are the same. the divisor had a smaller absolute magnitude than the dividend field from which it was subtracted. Z is therefore O. so on the next microcycle we get: 2) If [F] and [R] signs differ. the divisor had a larger absolute magnitude than the dividend field from which it was subtracted. Z is therefore 1. so on the next microcycle we get: [F] = [S] + [R] [F] = [S] - [R] The quotient bits are also determined by comparing the sign of the partial remainder with the sign of the divisor. If the signs differ. the cu rrent quotient digit is 0 because the divisor has the larger absolute value: but if the signs are the same. the current quotient digit is 1 because the divisor has the smaller absolute value. Let us now look at the exact 2903 implementation of the binary division. The two steps defined above do not take into account the first step - at which time we have no partial remainder. or ALU output. 2903 division logic therefore demands that the absolute magnitude of the divisor be greater than the absolute magnitude of the most significant half of the dividend. To ensure that the divisor does indeed have larger absolute magnitude, the algorithm illustrated in Figure 8-25 is recommended in Advanced Micro Devices' literature. We will describe this logic. even though other logic could achieve the same desired result. In order to compare the absolute magnitude of divisor and dividend. we need to work only with the most significant half of the dividend. Comparison instructions destroy the data. therefore we begin by moving the divisor and the most significant half of the dividend to temporary buffers - in all probability additional locations in local RAM. When moving the divisor to an alternate RAM location we can test the Zero status to see if the divisor is O. If it is. the division must be aborted. Next we use the Sign/Magnitude Twos Complement special function (which we have already described) to generate positive magnitudes for the copies of the divisor. and the most significant half of the dividend: now we can compare these magnitudes without bothering about sign. The Sign/Magnitude Twos Complement function. when executed. ijenerates a positive Overflow status if the data input is the most negative binary number allowed - in our case _2 16-. We take advantage of this Overflow status when operating on the most significant half of the dividend. If the most significant half of the dividend is -216. then the divisor cannot possibly be larger. so we downshift the entire dividend one bit position and restart. We also check the 8-78 Overflow status when performing the Sign/Magnitude Twos Complement operation on the divisor. If the divisor is _2 16, then it must be larger than the dividend, which is not -2 16, since the dividend test was made first. We therefore go straight to the division operation. If neither the divisor nor the most significant half of the dividend is -2 16 , we upshift both numbers one bit position to remove the sign bit. then subtract the most significant half of the dividend from the divisor. If the dividend is larger. it must be downshifted one bit position - and the test repeated. When the divisor is larger, we are ready to start the division. If you scale the divisor or the dividend, then the quotient must be scaled in compensation. Divisor, dividend and quotient scaling logic is entirely your responsibility. Combining the data preparation and division programs, the sequence of 2903 special functions shown in Table 8-9 is recommended in v~ndor literature to perform binary division. Table 8-9 shows a 16-bit divisor divided into a 32-bit dividend to generate a 16-bit quotient and a 16-bit remainder. The instruction sequence preceding the actual division instructions implement Figure 8-26 logic. These instructions need no special discussion. But we do need to clarify the manner in which status signals output by the 2903 are handled. The 2903 outputs status and data at the same time. For timing details refer to the 2903 microcycle description given earlier in this chapter. Some 2903 functions require status output by one 2903 slice to be input to other 2903 slices within the same microcycles; for an example of this look at the way Z is used by the Twos Complement Divide special function. Status is output early enough in the microcycle for an output to become an input to another 2903 slice within the same microcycle. But external logic will not have time to process any 2903 status outputs in the process of generating 2903 inputs for the same microcycle. Status output in one microcycle must be processed by external logic during the next microcycle. In Table 8-9 the comments associated with each microinstruction identify relevant status, if any, which is generated during the microinstruction's execution. Comments make clear the fact that the generated status must be tested during the next microcycle's execution time. Status output by the 2903 is usually tested by microprogram address generation logic. Later in this chapter, when we describe microprogram address generation devices. the consequences of testing status while executing the next microinstruction will become self-evident. The three divide instructions use 2903 local RAM and Q registers as follows: Divisor register Dividend Most Significant Half register Divisor buffer Dividend Most Significant Half buffer Dividend Least Significant Half register ., Q register Remainder Quotient I The divisor and dividend require initial memory locations identified as registers in the illustration above. The divisor and the most significant half of the dividend also require temporary buffers. The contents of these buffers are destroyed in the process of comparing the divisor and dividend magnitudes. 8-79 Move the divisor and most significant half of the dividend to temporarY buffers YES Perform twos complement sign/magnitude convention on divisor and most significant half of dividend in temporary buffers Exit NO Downshift dividend one bit position YES Subtract most significant half of dividend from divisor Move least significant half of dividend to Q register YES Downshift dividend one bit position Start division Figure 8-25. 2903 Binary Division Data Preparation Algorithm 8-80 Table 8-9. A Possible 2903 Twos Complement Binary Division Microprogram Microinstruction No 1 18 - 15 14-11 10 4 6 0 EA CN AO - A3 BO - B3 0 0 Divisor register Divisor buffer (RO) (R3) Comment Copy divisor to temporary buffer. 2 4 6 0 0 0 Dividend (MS) register (R 1) Dividend (MS) buffer (R2) Copy dividend most significant half to temporary buffer. 3 5 0 0 X .0 X Dividend (MS) buffer (R2) Convert dividend (MS) from twos complement to sign/magnitude version. Test OVR externally while next microinstruction is being executed. If OVR is 1, branch to subroutine that downshifts dividend. 4 5 0 0 X 0 X Divisor buffer Convert divisor (MS) from twos complement to sign/magnitude version. Test OVR externally. If OVR is 1, branch to microinstruction 9. (R3) 5 9 4 0 X 0 X Dividend (MS) buffer (R2) Shift out sign bit of dividend (MS) half in temporary buffer. 6 9 4 0 X 0 X Divisor buffer Shift out sign bit of divisor in temporary buffer. (R3) F 7 2 0 0 1 Dividend (MS) buffer (R2) Divisor buffer (R3) Subtract sign bit stripped divisor from sign bit stripped dividend (MS) half. If Carry = 1 (dividend larger) branch to subroutine that downshifts dividend or upshifts divisor. 8 6 6 0 0 0 Dividend (LS) register (R4) X 9 A· 0 0 0 0 Divisor register Dividend (MS) register (Rl) Double length normalize dividend in MS register and Q register. Dividend· (MS) register (R 1) Execute twos complement divide instruction fourteen times. Dividend (MS) register (R 1) Twos complement divide final instruction. (RO) C· 10 0 0 0 Z Divisor register (RO) 11 E 0 0 0 Z Divisor register (RO) Copy dividend least significant half to Q register. ·CN is connected to Z status while these two special functions are being executed. Before the actual division begins, the least significant half of the dividend is moved to the 0 register. The quotient is ultimately returned in the 0 register and the remainder in the Dividend Most Significant Half register. Taking a simple case. if local RAM is used to implement Divisor and Dividend registers and buffers. then we can illustrate local RAM and 0 registers utilization as follows: Initial: RO - Divisor R1 - Dividend. most significant half R2 - Copy of R1. dividend most significant half R3 - Copy of divisor R4 - Dividend. least significant half o - Dividend. least significant half Final: R1 - Remainder o - Ouotient The 0 register. which initially holds the least significant half of the dividend. ultimately holds the quotient. As the dividend is upshifted out of the Q register and into the Dividend Most Significant Half register. quotient bits get shifted into the 0 register via 00. 8-81 If you look again at Table 8-9, you will see that the actual division operation executes three functions: 1) The Double Length Normalize function. which serves as the first divide function. 2) The Twos Complement Divide function; this function is executed N-2 times. where N is the number of divisor and quotient bits. 3) A final Twos Complement Divide Correction function completes the division. Necessary pin connections for the Double Length Normalize function are given in Figure 8-21. Figure 8-26 shows necessary pin connections for the Twos Complement Divide and Twos Complement Divide Correction functions. Zero status logic is used to transmit sign compare information from the most significant 2903 slice to intermediate and least significant slices. The level transmitted is the complement of the Exclusive-OR of the most significant bits of the ALU output and R operand input. This may be illustrated as follows: R3 R2 R1 53 52 51 RO 50 ALU F3 F2 F1 FO Z = R3 E& F3 This Z status logic works only when an A or C special function code is input via 18-15, and iEN is simultaneously low. The Z status also becomes the CN input to the least significant slice in order to neutralize CN within the ALU functions performed. This may be illustrated as follows: [F] so [F] [F] so [F] + [R] + CN if Z = 0 + [R] if CN = Z [S] - [R] - 1 + CN if Z = [S] [S] 1 [S] - [R] if CN =Z The Q register and ALU register are connected so that an upshift causes the high-order bit of the Q register to be input to the low-order ALU bit. The high-order ALU bit is lost. and the next quotient digit is shifted into the least significant bit of the Q register. This may be illustrated as follows: Lost bit ALU register Q register The level actually output at SI03 is also R3 e F3. This becomes the next bit shifted into the quotient. The final Twos Complement Divide Correction function forces a 1 into the low-order quotient bit. leaving the remainder adjusted accordingly. 8-82 Q3, MSS +5V ~) :~ -- - - F3 + R3 •• - ,~ z Z Z Z .... 0103 0100 QI03 QIOO 0103 0100 QI03 QIOO ""'""- SI03 SIOO SI03 SIOO SI03 SIOO SI03 SIOO - C(N+4) - C(N+4) CN OVR -N W/MSS MSS 2903 _ LSS WE ~ f-<> +5V j C(N+4) CN CN+5V IS C) 2903 W/MSS ~ +5V IS 2903 () W/MSS LSS ~~ LSS ~ WE WE j .~ C(N+4) LSS 2903 kJ:: CN W/MSS ~ WE LSSQ ENABLE ALU output = [S) + [R) + CN if Z = 0, or [S) - [R) + CN - 1 if Z = 1 [0) is upshifted on all microcycles [F) is upshifted on twos complement divide, but not on twos complement divide last microcycle. ENABLE is high on last cycle only MSS means Most Significant Slice IS means Intermediate Slice LSS means Least Significant Slice [S) = S ALU input [R) = R ALU input [F) = ALU output [Q) = a register contents 03, R3 and F3 are most significant bits of a register, R ALU input and ALU output Figure 8-26. 2903 Signed Binary Twos Complement Divide Pin Connections Merely understanding the pin connections and functions shown in Figure 8-25 is quite straightforward. Understanding how binary division is performed using these pin connections, and the three binary division functions, is not selfevident. Let us therefore take a very simple example and analyze divide logic in conjunction with this example. Consider the following simple division: 18 16 ~ = 3 remainder 3 We have a 4-bit divisor and an 8-bit dividend which generate a 4-bit quotient and a 4-bit remainder. We must therefore execute the Double Length Normalize function, followed by two Twos Complement Divide functions, and a Twos Complement Divide Correction function. 8-83 For Step 1 we execute the Double Length Normalize function. This upshifts the dividend and generates the sign of the quotient at SI03 of the most significant slice. The quotient sign bit gets shifted into the low-order 0 register bit. Logic may be illustrated as follows: Step 1 [R] [F] a 1 1 1 aaa 1 Initial Final [a] [5] 5103 z 1aaa 11II1I1 a a a 1 a 1 1 1 a a 1 1 a a a 0-0 SI03 is the Exclusive-OR of the most significant slice ALU output and R operand input bits. This may be illustrated as follows: Step 1 [F] [R] [5] [a] a 1 1 1 aaa 1 Initial 5103 z 1aaa This SI03 logic says that when the divisor and the dividend have the same sign, the quotient is positive; the quotient is negative when the divisor and the dividend have opposite signs. What is not self-evident is the fact that we have multiplied the dividend by two before starting to work with the divisor. In consequence, we must finally upshift the quotient and the remainder to generate answers that stand numerical comparison. Moving on to Step 2, we execute the Twos Complement Divide function for the first time. The Zero status is 1: Step 1 [F] [R] Initial [a] [5] 5103 z 011100011000 Therefore, we subtract the divisor from the high-order four dividend bits. This may be illustrated as follows: Step 2 [F] 7 [R] In;t;a~/ ( 0011 100 1 Final 1 1aa a111 [5] 00 I [a] ,/o;OjOlO 1aaa --'----7 aaaa- 5103 z o 0 a This step is very logical. It is equivalent to initially subtracting the divisor from the dividend in any decimal division: 25)237642 25 -2 8-84 In our binary example the divisor is larger than the dividend. even though the dividend has been upshifted; therefore the next quotient bit shifted into the Q register is O. 0 is indeed output by the most significant slice at 5103: Step 1 [Fi [R] IS] [a] SI03 Initial 0001 01 1 1 0011 0000 0 Final !;~r:::~~o Z 0 ED In Step 3 the Twos Complement Divide function is executed a second time. The Zero status is now 0: Step 2 Initial [F) [R] 000 1 0 111 IS] [a] SI03 00 11 0000 0 z Final Therefore. during Step 3 we add the divisor to the high-order four bits of the shifted dividend. This addition. and the subsequent upshift. may be illustrated as follows: Step 3 [R] IS] [a] SI03 Z 0 0 111101111110 0000-0 0 [F) ,nl"ac::;?100/ 11 Final ~"--7 1 Adding the divisor to the upshifted dividend is also self-evident. We got a negative answer during Step 2. therefore (as described earlier) we must now compensate by adding the divisor to the upshifted dividend. The dividend is still smaller than the divisor. so once again 5103 outputs 0 at the most significant 2903 slice: Step 3 Initial [F] [R] [S] [a] SI03 z 1 10 0 0 111 1000 0000 o o Final and zero gets shifted into the Q register to become the next quotient bit. 8-85 Finally. in Step 4 we execute a Twos Complement Divide Correction function. Once again we test the Z status. which is O. therefore we add the divisor to the high-order four bits of the upshifted dividend. Together with the final shift this may be illustrated as follows: Step 4 [R] [F] c; "'"8'''''7''' Final 010'1 0 111 [0] 5103 z 0000 0 o [5] 0 III 0 1 0 1 0001 -v-~ t Forced input During the final shift a 1 is forced into the quotient to become the quotient low-order bit. The four high-order dividend . bits do not change. Thus our final answer is: Quotient = 0001 Remainder = 0101 In order to test the numeric accuracy of our answer we must upshift one bit position: Quotient = 0010 Remainder = 1010 Thus. the answer is 2 with a remainder of A 16 - which is not 3 with a remainder of 3. but it is correct. You r external logic (2904) must upshift thequotient and the remainder. if your algorithm demands it. and must adjust the quotient and the remainder if your algorithm requires the remainder to be less than the divisor. 8-86 THE 2902 CARRY LOOK-AHEAD DEVICE This device serves just one function: when performing binary addition or subtraction using cascaded 2901 or 2903 systems, it creates parallel carry inputs for 4-bit slices beyond the least significant slice. Carry Look· Ahead logic has been described in detail in Volume 1, Chapter 4. We will therefore provide a simple summary of the 2902 device in this chapter, stating its logic functions, but omitting Carry Look-Ahead theory. The 2902 is packaged as a 16-pin DIP. All signals are TTL-level compatible and a single +5V power supply is required. The 2902A is a faster version of the 2902. 2902 PINS AND SIGNALS Figure. 8-27 illustrates pins and signal assignments for the 2902 Carry Look-Ahead device. Figure 22-28 shows a 2902 device connected to four parallel 2901 devices. If you replace the 2901 devices with 2903 devices, connections between the 2902 and the 2901 or 2903 devices do not change. 0 y OR Sync/Enable Logic ".- v (} External Controls A- v 4 4_ A ~ .. ~ Microprogram PROM/ROM - I I U Microinstruction Register II ~) "11,/ '-, Microprogram Addresses V' To 2901 or 2903 Slices "II",," ~ Logic Sequence and Enable Controls 0- Status Output from 2901/2903 Figure 8-31. Function of Microprogram Sequencer Logic in a 2901 or 2903 Based System 8-93 Macroinstruction object codes have been described in considerable detail in Volume 1. Chapter 7. This discussion emphasizes the fact that macroinstruction object codes are selected to optimize Central Processing Unit operations. without regard to microprograms. or how microprograms may be stored in a memory device. This being the case. there is no chance that the op-code portion of any macroinstruction will have a bit pattern that addresses the correct microinstruction. or initial microinstruction that must be executed in response to the macroinstruction's execution. Instead. a mapping read-only memory or a programmable logic array is used as an address translator. The mapping ROM or PLA treats the op-code portion of the macroinstruction as an input. In the ROM. the actual microprogram starting address is stored at the location addressed by the op-code bit pattern. Conceptually. this may be illustrated as follows: Assembly Language Object Code I Microprogram ROM Microinstructions to be executed Op Code I Data This actual bit pattern is treated as a memory address in mapping ROM The contents of the addressed memory word is the address of the first microinstruction in microprogram ROM The size of the mapping ROM and the width of the address which it outputs depend on the size of the microprogramthat is to say. the length of the microprogram in terms of the number of microinstructions. This may be illustrated as follows: Microinstruction bit width has no effect on mapping ROM size r~----~~~~--~--" P---------------~~~ .~ Number of microinstructions determines Size of mapping ROM •• --------_.. ---If. for example. 256 or fewer microinstructions constitute the entire microprogram. then an 8-bit address can be output by the mapping ROM. irrespective of whether the microinstructions are 16 bits wide. 64 bits wide or have any other bit width. But. if the total length of the microprogram were 1024 microinstructions. then a 1a-bit address wou Id have to be output by the mapping ROM. 8-94 If every macroinstruction resulted in the execution of a single microinstruction. then there would be no need for 290912911 Microprogram Sequencers. The mapping ROM could output a single address to the microprogram ROM. The contents of the addressed microprogram ROM would be output to the Microinstruction register - to become the microinstruction that enables operations requ ired by the macroinstruction. But it is most unlikely that the Central Processing Unit's assembly language will consist of instructions that are all primitive enough to be implemented via a single microinstruction. In particular. as Central Processing Units become more complex. an ever larger number of microinstructions may have to be executed in response to a single macroinstruction execution; and the sequence in which these microinstructions are stored may also become more complicated. The 2909 and 2911 Microprogram Sequencers provide the logic which takes you from the initial microinstruction through the microprogram. There is one very important conceptual aspect of the 2909 and 2911 Microprogram Sequencers which must be clearly understood. These Microprogram Sequencer devices are. like the 2901 and 2903. cascadable 4-bit devices. But there is no relationship between the number of 2909/2911 devices which are cascaded. 2901 or 2903 devices are cascaded to give you the required CPU word width. Two 2901/2903 devices generate an 8-bit word; four 2901/2903 devices generate a 16-bit word; eight 290112903 devices generate a 32-bit word. etc. 2909 or 2911 devices are cascaded to address the required length of microprogram memory. The number of 2909 or 2911 devices cascaded together is in no way influenced by the width of the microinstruction. or the width of the CPU word. For example. if the microprogram has 256 or fewer microinstructions. two 2909 or 2911 devices cascaded together are sufficient. This holds true whatever the microinstruction width may be. and whatever the CPU word width may be. Thus the number of parallel 2901 or 2903 slices has no bearing whatsoever on the number of parallel 2909 or 2911 devices. You cannot even generalize by stating that there will be a tendency to require more 2909/2911 devices as the number of parallel 290112903 devices increases. Rather. the width of the microinstruction will increase with the number of 290112903 devices and. as we have already stated. the width of a microinstruction has no bearing on the length of the microprogram. or the number of parallel Microprogram Sequencer devices that will be needed. 2909/2911 MICROPROGRAM SEQUENCER PINS AND SIGNALS Pins and signal assignments for the 2909 and 2911 Microprogram Sequencers are illustrated in Figure 8-32. These signals are most easily understood in conjunction with the functional logic illustrations for the two devices which are given in Figures 8-33 and 8-34. Central to the logic of 2909aild 2911 Microprogram Sequencers is the Output Multiplexer, which receives four inputs. SO and S 1 are two control inputs that select an output as follows: SO S1 o 0 1 1 1 0 1 o 2909/2911 OUTPUT SELECT Output Multiplexer Source Microprogram Counter Address register Stack Direct inputs (via 00-03) We will for the moment ignore the Microprogram Counter and Stack. two data storage areas whose functions will be described shortly. 00-03 are four data input lines. Data input via these four lines can be selectedVby the Output Multiplexer and output immediately (if SO and S1 are both high). 2909/2911 IMMEDIATE DATA INPUT Data input via RO-R3 is held in the Address register. Timing for Address register access may be illustrated as follows: CP 2909/2911 ADDRESS REGISTER -----~ RO - R3 Address ADDR Register _ _ _ _ _ _ _""'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ 8-95 - RE R3 R2 R1 RO OR3 03 OR2 02 OR1 01 ORO DO GND - ----- ---- ----..--..- -- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2909 Pin Name RO - R3 DO - 03 RIDO - R/D3 YO - Y3 ORO - OR3 ZERO RE OE FE PUP CN C(N+4) SO,S1 CP VCC,GND 28 27 26 25 24 23 22 21 20 19 18 17 16 15 .. --: - - - -- ----- ... -.- - CP VCC (+5V). CP (+5V) VCC PUP RE FE D/R3 D/R2 D/R1 DIRO C(N+4) CN OE Y3 Y2 Y1 YO 51 SO ZERO GND ZERO SO Description Address register input Data input Combined Address register and data input Address output Address output mask Zero Address output control Address register input enable Address output enable Stack enable Stack pushlpop select Program Counter Carry in Program Counter Carry out Output select System clock Power, Ground 1 2 3 4 5 6 7 20 19 18 17 2911 8 9 10 16 15 14 13 12 11 Type Input Input Input Output, Tristate Input Input Input Input Input Input Input Output Input Input Figure 8-32. 2909 and 2911 Microprogram Sequencer Pins and Signal Assignments 8-96 PUP FE C(N+4) CN OE Y3 Y2 Y1 YO 51 RE----------------~ RO-R3~ ________ ~~1 Address Register Microprogram Counter 00-03 __________, 50 ----~ Output Multiplexer 51~ OR3----------+------+------4---~ OR2----------+------+----~ ----------+---~ ORO - - - - - - -..... OR1 Incrementer ZERO ----------4H----...+-----~~--_ YO Y1 Y2 Y3 C(N+4) Figure 8-33. 2909 Microprogram Sequencer Functional Logic 8-97 RE ------------------~ .....I----FE Stack Po.inter .....1----PUp 4x 4-Bit Stack Microprogram Counter RIDO - R/D3 '--________..... SO ---1" Output Multiplexer S1 ZERO ----------~----~~----~~--~ ....I---CN YO Y1 Y2 Y3 C(N+4) Figure 8-34. 2911 Microprogram Sequencer Functional Logic 8-98 As illustrated above. the Address register enable signal RE must be low before data can be written into the Address register via RO-R3.lf RE is low. then data is written into the Address register when the clock signal CP makes its high-to-Iow transition. But RE has no effect on Address register output. Whether RE is low or high. the Address register contents are transmitted to the Output Multiplexer. The 2911 shares D and R inputs. Data input at RIDO-R/03 will be written into the Address register if RE is low. and will be output via the Output Multiplexer if SO and 51 are both high. 2909/2911 DATA OUTPUT Multiplexer output lines VO-V3 have their own enable signal OE. If this signal is high, VO-V3 outputs are floated. This allows you to disconnect Microprogram Sequencer devices from the microprogram ROM. something you may do when switching to an external tester. 2909/2911 The 2911 has one set of conditioning logic on the Y outputs. The 2909 has two sets of conditionOUTPUT ing logic on the Y outputs. Both devices have a ZERO input which, when low, unilaterally ZERO forces the four lines VO, V1, V2, and V3 to output O. Frequently you will use the ZERO line as a CONTROL restart -with an initialization microinstruction sequence origin at microinst~uction number in the microprogram ROM. The 2909, but not the 2911, has four mask signals, ORO, OR1, OR2, 2909 and OR3, which can individually force VO, V1, V2, and V3, respectively, low. Typically you OUTPUT will use the mask signals to implement conditional logic. For example. we have already seen how MASK the Overflow status (OVR), output by the most significant 2901 and 2903 slice. signals an overflow or "exceptional" condition. By tying the Overflow status to ORO. you can implement microinstruction pairs. The Output Multiplexer outputs a 0 low-order microinstruction address via YO. which ORO can override and convert to 1. For an 8-bit microprogram address this may be illustrated as follows: a 1-*-,...---- , . . . - - - - - - - Output by high-order 2909 Output by low-order 2909 XXXXYYYO ~ ______ +L.___ ORO to low-order 2909 can change ~I X X X X Y Y YO . . M;c",;nstruct;on exec..ed ;1 OVR this address bit to 1 ~0 • X X X X Y Y Y 1 . . . . - - Microinstruction executed if OVR = 1 Of course. having a mask line associated with every microinstruction address output line lets you generate more complex conditional logic schemes than the simple illustration above. There are two internal locations within the 2909 and the 2911 which can hold addresses. These are the Microprogram Counter and the Stack. 2909/2911 Let us first look at the Microprogram Counter. This location is equivalent to the typical Central MICROPROGRAM Processing Unit Program Counter. COUNTER When SO and S1 are both low. Microprogram Counter contents are read by the Output Multiplexer. and are output via YO-Y3. New data is written into the Microprogram Counter whenever data is input from the Output Multiplexer. whether or not the Microprogram Counter was selected as the Output Multiplexer input. Data written back to the Microprogram Counter is taken from the YO-Y3 path following the OR and AND gates. Therefore. if you use either of the output conditioning gates. you will also modify the Microprogram Counter contents. This. of course. is no different to a Central ProceSSing Unit's Program Counter. which is also modified by a restart or jump instruction. Data being written back to the Microprogram Counter passes through an Incrementer. The Incrementer adds the CN level to data which is on its way to the Microprogram Counter. Thus if CN is low. the Incrementer passes data through unmodified; but the data is incremented if CN is high. An Incrementer overflow generates a high C(N+4) output. 2909/2911 INCREMENTER Let us look at the various ways in which you may use Microprogram Counter logic. In the simplest case, you may wish to sequentially access a number of microinstructions. You can begin the sequence by inputting the first microinstruction address to the Address register via RO-R3. or as immediate data via 00-03. Remember. 2909 and 2911 devices are cascadable; therefore we are not limited to 4-bit addresses. The initial address. when output by the Output Multiplexer. also gets written to the Microprogram Counter. Assuming that CN is high. the address 8-99 2909/2911·· SEQUENTIAL ADDRESSES written into the Microprogram Counter will be one more than the starting address input via RO-R3 or 00-03. For a number of subsequent microcycles. you will continue to select the Microprogram Counter. leaving CN high. so that Microprogram Counter contents are incremented on each microcycle. Selecting addresses arbitrarily. this sequence may be illustrated as follows: 00-03 SO .§.l 1 1 0 0 0 0 0 0 etc. 30 XX XX XX CN YO-Y3 30 31 32 33 Microprogram Counter Contents 31 32 33 34 etc. XX represents "don't care" inputs. There are some non-obvious problems that can occur when you generate sequential microinstruction addresses using Program Counter logic as illustrated above. The next very simple microprogram counter sequence involves the re-execution of a single microinstruction - as you may do while performing a normalize or twos complement divide operation using the 2903 special functions. If the Output Multiplexer selects the Microprogram Counter contents while CN is input low. then the Microprogram Counter contents will not change on succeeding microcycles - and the same microinstruction will be executed repeatedly. SINGLE INSTRUCTION RE-EXECUTION You can skip a microinstruction with an even address within an otherwise consecutive instruction sequence. To do this you keep CN high. so that the Microprogram Counter increments on each microcycle. but you input a high ORO mask bit in order to skip an instruction. This may be illustrated as follows: INSTRUCTION SKIP SO o Sl CN -o - - 0 o o o o o ORO 2909/2911 Microprogram Counter Contents 34 35 37 38 39 etc. 0 1 0 0 o o o 2909/2911 etc. ORO forces low-order address bit to 1. You can also use mask bits to jump between microprogram pages. For example. within a 256microinstruction program you can jump in sixteen microinstruction increments by inputting a high signal at the ORO mask bit of the high-order 2909 slice. This may be illustrated as follows: Both 2909's Most Significant 2909 Address 34 35 46 47 Least Significant 2909 SO S1 ORO Microprogram Counter CN ORO 0 0 0 0 0 0 0 1 0 0010 0010 0011 0011 1 1 1 1 a a 0 0 0 a 0 Microprogram Counter 0100 0101 01 10 01 1 1 etc. By applying high inputs to other mask bits you can span almost any number of microinstructions in a Single jump. The 2909/2911 Stack has four locations. A Stack Pointer identifies the currently selected Stack location. If the Output Multiplexer receives SO low and S1 high. then it reads the contents of the currently selected Stack location and outputs this data via YO-Y3. This output address. like all other output addresses. passes through the Incrementer and is loaded into the Program Counter. 8-100 You modify the Stack Pointer address using the FE and PUP signals. FE must be low in order to modify the Stack Pointer. FE does not have to be low in order to output data from the Stack to the Output Multiplexer. When FE and PUP are both low. the Stack Pointer decrements on the low-to-high transition of CPo Timing may be illustrated as follows: CP PUP Decrement Sfack Pointer If FE is low and PUP is high. the Stack Pointer is incremented. then the contents of the Microprogram Counter are loaded into the newly addressed Stack register. Timing may be illustrated as follows: CP PUP contents to Stack Increment Stack Pointer The address in the Program Counter which gets written into the newly addressed Stack register will be the address which was output by the Output Multiplexer - incremented by one. assuming that CN is high. This enables traditional subroutine call and return logic. as we will see soon. The Stack Pointer is a roll-over counter. That is to say. it will decrement from 0 to 3: and it will increment from 3 to 0: This is normally not advantageous. Let us look at some of the address sequences which can be generated using the Stack. 8-101 Consider first a typical subroutine caU- in the classical assembly language sense. The 2909/2911 microinstruction which causes the subroutine call increments the Stack Pointer. Assuming that SUBROUTINE CN is high, the address of the microinstruction which causes the subroutine call is incremented by CALL one, written into the Microprogram Counter, and thence to the newly addressed Stack register, to the address of the microinstruction to which execution will return at the end of the subroutine. This sequence may be illustrated as follows: ,, , , ,, , I ,, , , ,II' With reference to the illustration above, the microinstruction which causes the subroutine call is arbitrarily assumed to reside in microprogram read-only memory location A216. Therefore the subroutine call begins with the Microprogram Sequencer outputting address A216, as illustrated above by CD For the microinstruction in location A216, only those bits that affect the Microprogram Sequencer are of interest to us. These bits cause the Microprogram Sequencer to receive high inputs at CN and PUP, with a low input at FE. This microinstruction will also provide the address for the next microinstruction, arbitrarily assumed to be 2E16 at @ in the illustration above. But this address will be output on the next microcycle. On the current microcycle, CN causes the The new incremented address A316 currenfaddress (A216) to be incremented to A3...l..6. This is shown above at is written to the Microprogram Cou nter; see C§) above. Since FE is low and PUP is high, the Stack Pointer is increabove) and the current Microprogram Counter contents, which is A316, is saved in the Stack. mented ( ® . ® On the next microcycle the address 2E16 will be output. initiating the subroutine's execution. When the subroutine completes execution, it has the return address A316 stored at the Stack register identified by the Stack Pointer. 8-102 The final instruction of the subroutine must execute a Stack PUP and cause the Output Multiplexer to select the Stack as its input. This requires S1 to be high while SO. FE. and PUP are all low. The Output Multiplexer will read A316 from the Stack and output this address next. A316 is incremented to A416 and returned as the new Microprogram Counter contents. The Stack Pointer decrements. Thus a classical Stack-Oriented Return-from-Subroutine has been executed. A subroutine can consist of a single microinstruction. If you look again at the subroutine call illustration given earlier. the first instruction of the subroutine. which in our illustration will be the instruction stored at location 2E16. has nothing said about its Microprogram Sequencer bits. If this instruction causes a Return-from-Subroutine. then you have created a single-microinstruction subroutine. Using the Stack you can nest subroutines to a depth of four. In most microprograms. nesting to a depth of fou r is perfectly adequate. A computed multidestination jump is easily implemented using a 2909 or 2911 Microprogram Sequencer. A 16-way jump to individual instructions can be achieved by inputting data via OROOR4 to the least significant 290912911. while generating more significant portions of the address from some other location. such as the Address register. 2909/2911 SUBROUTINE NESTING 2909/2911 MULTIPLE JUMP 2909/2911 SYNC/ENABLE LOGIC There are innumerable ways in which the Sync/Enable logic portion of Figure 8-31 could be designed. At its most elementary level, 2909/2911 control signals will be generated (possibly from a read-only memory) based on Microinstruction register outputs which become a read-only memory address. This may be illustrated as follows: Enable/Select FE PUP RE S1 SO ZERO eN Microinstruction Register Il ORO OR1 OR2 OR3 ROM Address ---- -- -- -- -- I Sync/Enable ROM 5J A 12-bit wide read-only memory would be required in the illustration above to generate eleven input signals needed by the 2909/2911. plus an Enable/Select signal for the R input 2-IN MUX. (The clock signal CP could not be generated by a ROM.) It would be possible to generate 4096 different combinations of 12 signals. Very few of these possibilities will ever be encountered. In all probability. a maximum of 32 different signal combinations may be seen. in which case a 32 x 12-bit read-only memory will suffice. with a 5-bit address provided by the Microinstruction register. Each microinstruction stored in the microprogram ROM will then contain a 5-bit address field; the address field selects one of the 32 signal combinations that define the next step of Microprogram Sequencer control inputs. Thus we are able to achieve address continuity within a microprogram. In many applications. the 29811A provides this function. But in Figure 8-31 three sets of inputs to the Sync/Enable logic section are shown. The "logic sequence and enable" control emanating from the Microinstruction register becomes the 5-bit address which we have already described. 8-103 Table 8-11. The 2903 Twos Complement Binary Division Microprogram Subroutine from Table 8-9, with 2911 Addressing Microinstruction Fields Added Microinstruction No 1 18-1& 14-11 10 4 6 0 EA CN AO-A3 80 - 83 0 0 Divisor register Divisor buffer (RO) (R3) Comment Copy divisor to temporary buffer. 2 4 6 0 0 0 Dividend (MS) register (Rl) Dividend (MS) buffer (R2) Copy dividend most significant half to temporary buffer. 3 5 0 0 X 0 X Dividend (MS) buffer (R2) Convert dividend (MS) from twos complement to sign/magnitude version. Test OVR externally while next microinstruction is being executed. If OVR is 1, branch to subroutine that downshifts dividend. 4 5 0 0 X 0 X Divisor buffer Convert divisor (MS) from twos complement to sign/magnitude version. Test OVR externally. If OVR is 1. branch to microinstruction 9. (R3) & 9 4 0 X 0 X Dividend (MS) buffer (R2) Shift out sign bit of dividend (MS) half in temporary buffer. 6 9 4 0 X 0 X Divisor buffer Shift out sign bit of divisor in temporary buffer. (R3) 7 F 2 0 0 1 Dividend (MS) buffer (R2) Divisor buffer (R3) Subtract sign bit stripped divisor from sign bit stripped dividend (MS) half. If Carry = 1 (dividend larger) branch to subroutine that downshifts dividend or upshifts divisor. S 6 6 0 0 0 Dividend (LS) register (R4) X 9 A" 0 0 0 0 Divisor register Dividend (MS) register (Rl) Double length normalize dividend in MS register and Q register. Dividend (MS) register (Rl) Execute twos complement divide instruction fourteen times. Dividend (MS) register (Rl) Twos complement divide final instruction. (RO) 10 C" 0 0 0 Z Divisor register (RO) 11 E 0 0 0 Z Divisor register (RO) Copy dividend least significant half to Q register. 'CN is connected to Z status while these two special functions are being executed. 8-104 Table 8-11. The 2903 Twos Complement Binary Division Microprogram Subroutine from Table 8-9, with 2911 Addressing Microinstruction Fields Added (Continued) Microinstruction bits covering 2903 and two 291 1 input (Bit positions are arbitrary and have no signlficancel :s 11 i 1 2 3 2903 Bits 18 17 16 16 14 13 12 11 10 o o 0 0 0 0 0 o o 1 0 0 1 1 0 0 0 1 1 0 0 0 0 0 o o ----...-.5 1 0 1 0 0 0 0 6 4 1 o 0 1 o 1 o 0 -....-'-...-.- 9 '7 0 X X X X 0 0 1 0 -....-' A2 X X X X X X X X 4 1 1 1 1 o 0 1 0 X 0 X X X X 0 0 1 0 0 X 0 0 0 8 9 2 o o -...---...-.6 6 1 1 0 1 1 0 X 0 o 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 10 0 0 0 1 1 000000 0 0 X 0 C '1 1 1 1 o 0 0 0 0 0 1 X X X X X X X X 0 1 o 0 0 X X X X o0 0 o0 0 0 1 -....-'-...-- X X X X X X X X T T T T T T T T ~ Scale divisor or Dividend Subroutine X X X X X X X X Rl 0 0 0 0 X 1 0 Z 1 1 1 X 1 1 1 --- 1 0 0 1 1 1 X 1 1 1 1 0 1 0 0 1 1 1 X 1 1 1 1 1 0 1 ----- Select next sequential instruction. Load abort address into Address register. Select next sequential instruction, or abort address if Z = 1 from microinstruction 1. Select next sequential instruction. OVA = O. Select next sequential instruction. OVA = 1. Call "scale dividend" subroutine. OVA = O. Select next sequential address. OVR = 1. Branch to microinstraction 8. 1 1 1 X Select next sequential instruction. 1 1 1 X Select next sequential instruction. 1 0 0 1 1 1 X 1 1 1 1 1 0 C(N+41 = O. Select next sequential instruction. C(N+41 = 1. Call "scale divisor or dividend" subroutine. 1 0 0 1 0 0 ------- 1 0 0 1 1 1 1 X Select next sequential instruction. 1 0/11 X Execute this instruction 14 times, then select next sequential instruction. 1 1 0 0 Return from subroutine. 0 1 -...-----AO 1 1 1 0 X X X X X X X X 1 0 0 Rl 0 000000 1 1 1 X 0 0 0 000000 1 RO 0 0 0 0 R4 RO ~~ 0 R3 A2 --- CNFE B B B B B B B B 1 0 0 1 1 1 X ~ Microinstruction 1 1 1 1 1 1 X 8 Address --.,-~ 0 ----....-' E 0 0 1 ~ 0 ----....-' o S S S S S S S S ~ --.,--....-' 0 0 00 0 0 A2 X X X X 0 0 1 1 -....-' A3 0 -....-'-....-' A --.,- 0 0 1 0 1 X X X X 0 0 1 0 iI:l 1 Scale Dividend Subroutine R3 0 ----....-' F 1 -....-' 0 1 0 1 00 0 1 X 0 o -...-.---.,9 6 0 0 A A A A A A AA ~ Abort Address R3 0 0 0 1 0 1 RO X X X X X X X X 0 0 o o --.,--...-.- 1 000000 1 --.,---.,- 2911 Addressing Operations D7D6D6D4D3D2D1 DO RES1 SO 0 o 0 1 o 0 1 0 -....-'-....-' Al R2 0 --.,--....-' 6 0 4 5 4 EA CNA3A2A1AOB3B2B1 BO -....-'--.,0 6 4 1 2911 Bits X X X X X X X X Rl 1 1 0 2 X = "Don't Care" bits 8-105 Status outputs from the 2901 or 2903 devices have already been encountered; we have. for example. discussed the way in which the Overflow status may generate one of the OR mask lines. The most effective way of handling status outputs from 2901 or 2903 slices is to use the test input of 29811 A. This might be illustrated as follows: ..... .-- .-.. -..... t +t , 13 MUX -.. 12 11 10 29811A TEST ... ... -...... .-.. COUNTER LOAD COUNTER ENABLE MAP ENABLE PIPELINE ENABLE -.... --.. FE PUP 51 SO + OUTPUT ENABLE 2909/2911 ADDRESSING EXAMPLE We will now complete our discussion of 2909 and 2911 operations by looking at a specific example - the twos complement binary division microprogram summarized in Table 8-9. Table 8-9 shows only those microinstruction bits required by the 2903 device. In Table 8-11 we add microinstruction bits for two 2911 Microprogram Sequencers. We assume that the two 2911 Microprogram Sequencers address the 2903 twos complement binary division microprogram as a subroutine. within a 256-microinstruction microprogram memory. In the lower half of Table 8-11. RAM locations used by the twos complement binary division microprogram are identified using register designations "RO" through "R4". These designations represent RAM locations with addresses 0 through 4. respectively. Additional microinstruction bits added in the lower half of Table 8-11 provide the two 2911 Microprogram Sequencers with their data and control inputs. Eight data input bits are needed. four for each of the two 2911 Microprogram Sequencers. But since both 2911 Microprogram Sequencers will receive exactly the same control inputs. one set of control Signals is sufficient. Table 8-11 shows the six control signals RE. S1. SO. ZERO. CN. FE. and PUP being generated by individual microinstruction bits. But earlierwe generated these control codes out of a read-only memory. In the discussion which follows we will compare these two methods of generating control inputs. Microinstruction 1 in Table 8-11 copies the divisor into a temporary register. If the divisor is not O. the next sequential microinstruction must be executed. If the divisor is O. microprogram execution must be aborted. since you cannot divide by O. The most significant 2903 slice outputs Z high if the divisor is O. Z is output tow if the divisor is not O. The Z status is output at the end of the microinstruction 1 microcycle. too late to influence 2911 Microprogram Sequencer logic. Microinstruction 1. therefore. provides the 2911 with data needed to evaluate the Z status while microinstruction 2 is executing. SO and S 1 are both low while CN is high; therefore.while microinstruction 1 is executing. the 2911 Output Multiplexer selects the Microprogram Counter as its source. then increments the Microprogram Counter contents. Thus. the next sequential microinstruction. microinstruction 2. is selected. Simultaneously. microinstruction 1 inputs the abort address to the 2911 Address register. The abort address is input at DO-D7 while RE is low. If logic associated with execution of microinstruction 2 conflicted in any way with testing the Z status. then we would have to insert a dummy microinstruction in front of microinstruction 2. whose sole function would be to test the Z status. But microinstruction 2 has no such conflicting logic. so we can use its execution time to test the ZERO status generated by microinstruction 1. If this ZERO status is 1. then the abort address. input to the Address register by microinstruction 1. will be selected; execution of microinstruction 2 becomes redundant insofar as 2903 logic events are concerned. but. providing execution of microinstruction 2 is inconsequential. no harm is done. The 2911 bits provided by microinstruction 2 can be quite simple. S1 is 0 and SO is connected to the ZERO status; if the ZERO status is O. the Output Multiplexer will select the Microprogram Counter - and thus the next sequential instruction. But if the ZERO status is 1. the Address register will be selected by the Output Multiplexer - and thus an abort will occur. In order to connect SO to a ZERO status we would probably include an additional enable bit. not shown in microinstruction 2. This enable bit. when high. will link SO to the ZERO status. but when low will cause SO to be 8-106 I:F_-so derived directly from its microinstruction bit. This may be illustrated as follows: SO Bit _ _ ENABLE - ZERO---Addressing logic for microinstructions 3 and 4 is similar to that which we have just described for microinstructions 1 and 2. Microinstruction 3 converts the most significant half of the dividend from twos complement to sign/magnitude form. If the dividend has the largest possible twos complement value. then the Overflow status is setand the dividend must be downshifted. If the dividend has any other twos complement value. the Overflow status is not set and the next sequential instruction must be executed. But as we found when examining microinstruction 1. the Overflow status is generated at the end of the microinstruction 3 microcycle. therefore the 2911 bits shown in Table 8-11 for microinstruction 3 simply select the next sequential microinstruction - microinstruction 4. But while microinstruction 4 is being executed. 2911 logic tests the Overflow status generated by microinstruction 3. Now we can delay testing microinstruction 3 Overflow status until microinstruction 4 has been executed because execution of microinstruction 4 does not conflict with Overflow = 1. If it did. we would have to insert a dummy microinstruction between 3 and 4 which did nothing at the 2903. but gave the 2911 an additional microcycle time within which to test the Overflow status generated by microinstruction 3. and determine subsequent addressing based on Overflow status level. Since this additional dummy instruction is not needed. microinstruction 4 provides the address for the "Scale Oividend" subroutine via data bits 00-07. Two sets of control inputs are generated. If the Overflow status left over from microinstruction 3 is 0 then the control inputs to the 2911 simply select the next sequential microinstruction - microinstruction 5. But if the Overflow status left over from microinstruction 3 is 1 then control inputs cause the 2911 to push Microprogram Counter contents onto the Stack. then have the Output Multiplexer choose as its source the address input at 00-07. Thus the scale dividend subroutine is called. If you look at the 2911 control bits of microinstruction 4 in Table 8-11. you will see that three bits. SO. S1. and FE. must change. depending on the level of the Overflow status left over from the execution of microinStruction 3. PUP need not change. since its level is not significant when OVR is low. We could control all three bit levels using an enable bit. as described for the ZERO status in microinstruction 2. But it is probably simpler and cheaper to use a read-only memory device. as suggested earlier in this chapter. Consider the following possibility: Control Bits ~ D7 D6' D5 D4 D3 D2 D1 DO A4 A3 A2 A 1 AO Microinstruction bits for 2911 ZERO-----------------+-+--+-+--+---------} OVR-------------------------r--r--r-~~~------------­ C(N+4)---------------------------~~~~~~~-------------- ;i~ess Instead of having seven separate 2911 control bits in every microinstruction. we now have five control bits. Three status bits (ZERO. OVR. and C(N+41. generated by the 2903) provide the three low-order bits for an 8-bit read-only memory address. The five microinstruction control bits. together with the three status bits generated by the 2903, create an 8-bit read-only memory address. The addressed read-only memory location outputs the seven signal levels required by the 2911. For microinstructions 1 through 4, read-only memory might arbitrarily be mapped as shown in Figure 8-35. Microinstruction 5 has 2911 addressing bits that are similar to microinstruction 4. Microinstruction 4 not only tests the Overflow status left over from microinstruction 3. but itself generates an Overflow status which must be tested while microinstruction 5 is being executed. In the event that the 2903 Overflow status generated by microinstruction 4 is low. the next sequential microinstruction. microinstruction 6. is selected. But if the Overflow status is high. then a branch to microinstruction 8 occurs. Since this is a simple branch. no push is required; therefore FE remains high in both cases. See Figure 8-35. 8-107 Address Bits from Microinstruction Status from 2903 Sync/Enable ROM Map ~ A4 A3 A2 A 1 AO 1 2 2 3 4 4 5 5 6 7 8 8 9 10 10 11 ~ 0~ (j IffiN X I-----------,~(J o 0 0 000 oo 01 X X X X X 0 L-_ _ _ _ _ _ _---. 000 o 0 1 000 000 o 1 X X 1 o 0 0 000 001 o o o o o o o 0 0 0 0 0 0 0 o 0 X X X ~---10XOX 1 0 X 1 X 11 1 1 __ +_. _ XOX X 1 X o o 0 X 0 X 010 X X ~------. X 1 X X o 1 0 X ~------. X ~--X 1------, X X 1 1 1 0 0 1 X X X X X X 0 r--1 I-X f- o ~ X -- I----~_+. --- ---- -- - 10 11 12 13 14 15 1 a a 1 o 1 o 0 o 1 o 0 ~ / 2B 2C , 2D ~ 2E 2F 31 32 33 L-_ _ _ _ _ _ _~--~ 34 35 36 L-_ _ _ _ _ _ _ _~~~ 37 a 38 0 L-_ _ _ _ _ _ _ _ _ J ~. - t 3F 1 1 o o o 0 1 1 0 0 o o 1 a 0 1 1 1 1 1 1 o 0 o 0 1 1 1 1 1 1 o I 0 I I I I I I I II I I 1 1 1 1 1 1 1 1 o o o 1 1 1 o 1 1 1 1 1 1 o 1 1 1 1 1 1 1 1 o o o o o o o o o o o o o 1 1 o 1 1 o o o o 1 1 1 0 0 0 0 1 1 1 1 1 0 1 1 1 1 0 0 0 0 1 0 1 0 0 1 1 1 0 1 1 0 1 1 0 0 I• II 1 1 1 II II II 1 0 II i i i i i I i i 0 1 1 0 Figure 8-35. 2911 Sync/Enable ROM for the 2903 Twos Complement Binary Division Microprogram Subroutine 8-108 I I 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 o o o o a o o o o o 0 0 ,• 1 1 o 0 o o o o o o o o 30 0 1 1 1 1 1 o I o o 0 1 I 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 o o o ...I----------~:-- 1 1 1 1 1 o 2A - 1 o o o ~ -------~_=_~ 1 o o o o o ---------~--.\~ -- I o o o o o o o o o o o 20 I o 1 o 16 17 18 19 I I I I 1 1 1 0 o E F I I I I o 0 o 0 o 1 o 0 o 1 27 28 29 ~~ .... A B C D - -- o o o o 8 9 1E 1F ~ eN FE 000 1 1 1 0 00001110 7 -- I~ RE S1 SO o 1 1A 1B 1C 1D --- L-_ _ _ _ _ _ o 1 1 0 0 Microinstructions 6 and 7 both have very simple 2911 addressing logic. Each microinstruction chooses the next sequential microinstruction. But the Carry status generated by the 2903 following execution of microinstruction 7 must be tested by address generation logic while microinstruction 8 is being executed. The fact that microinstruction 5 can branch directly to microinstruction 8 causes no problem since microinstruction 5 will always generate a low 2903 Carry status: thereforhe Carry status testing logic which we are about to describe does no harm. If the Carry status generated by the 2903 during execution of microinstruction 7 is low. then no further divisor or dividend scaling is needed. and the next sequential microinstruction is selected. But if the 2903 generates a high Carry status while executing microinstruction 7. then a subroutine must be called to scale the divisor or dividend. Therefore microinstruction 8 provides the address of the scaling subroutine at the data inputs DO-D7; it generates the same two sets of 2911 control inputs which we described for microinstruction 4. However. the level of C(N+4) determines which set of 2911 control inputs are selected by microinstruction 8. See Figure 8-35. We now come to the last three microinstructions (9, 10, and 11) which together perform the actual twos complement binary division. Microinstruction 9 must be executed once. followed by fourteen executions of microinstruction 10. and one execution of 11. Fourteen executions of microinstruction 10 are required because we are dividing a 16-bit divisor into a 32-bit dividend. From our previous discussion of the twos complement binary division algorithm. recall that microinstruction 10 must be executed N times. where the divisor has N bits and the dividend has 2N bits. Our 2911 addressing logic implements this multiple execution requirement by keeping the CN input low for thirteen executions of microinstruction 10. But this requires an external counter. Here is one possibility: A4 A 3 - -....._ x, 4 Counter. advanced ENABLE A2 A1--_-- by ENABLE AO -.r- ZERO--------~ There are innumerable ways (including the use of a 2910) in which the counting logic required to augment microinstruction 10 may be implemented. The one we have shown assigns one set of eight read-only memory addresses to a preloaded counter. This preloaded counter provides the level of the low-order address bit (zero) which must be input to the 2911 select ROM. The preloaded counter decrements once every time ENABLE goes high: it outputs COUNT low until it decrements to O. Upon decrementing to 0 the counter outputs COUNT high. Apart from the external counter required by microinstruction 10. microinstructions 9 and 10 generate simple next sequential address controls for the 2911. Microinstruction 11 causes the 2911 to pop its Stack - on the assumption that the entire twos complement binary division microprogram is itself a microprogram subroutine. Thus. if a read-only memory is used to generate 2911 control inputs Figure 8-35 illustrates the final read-only memory map and addressing bits required for the microinstruction sequence given in Table 8-11. 8-109 THE 2910 MICROPROGRAM SEQUENCER This device is an enhancement of the 2909/2911 Microprogram Sequencers which we have just described. Here is a summary of 2910 enhancements, as compared to the 2909 and 2911: 1) The 2910 is a 12-bit device capable of addressing up to 4096 microinstructions. The 2909 and 2911 are 4-bit devices. Therefore the 2910 is equivalent to three parallel 290912911 devices. 2) The 2910 has sixteen address generation sequences, selected individually via four instruction code inputs. Many of these sixteen address generation sequences have alternate forms that depend on the level of a condition code. The 2909/2'911 has no such address generation sequences; rather. individual control signal levels (such as output selects SO and S 1. and output masks ORO-OR3) provide more primitive control of addressing logic. The 2910 has three enable signals. One of the three is output low on each microcycle. You can use these enable signals to selectively strobe data out of different sources to meet the specific needs of any microcycle. The 2909 and 2911 have no such enable outputs. The Address register of the 290912911 becomes an Address register or a down counter within the 2910. As a down counter. the 2910 Address register controls loop iteration. The 2910 has a five-level Stack. as compared to the 2909/2911 four-level Stack. Also, the 2910 has slightly different Stack Pointer logic. 3) 4) 5) The fact that the 2910 is an enhancement of the 2909/2911 does not necessarily mean that the 2910 is always the part of choice. The 2910 is more expensive. In most cases, a small microprogram consisting of 256 or fewer microinstructions is more economically served by two 2909 or 2911 devices. rather than a single 2910 device. The 2910 is packaged as a 40-pin DIP or a 42-pin flat package. The device is manufactured using bipolar technology. A single +5V power supply is required. All signals are TTL-level compatible. 2910 MICROPROGRAM SEQUENCER PINS AND SIGNALS For an overview of Microprogram Sequencer logic, and how it is used within a 2900-based system. refer to our earlier discussion of this subject given for the 290912911 devices. The discussion which follows assumes that you understand how a Microprogram Sequencer fits into a 2900-based configuration. 2910 pins and signal assignments are illustrated in Figure 8-35. Figure 8-37 illustrates 2910 functional logic. We will describe signals in conjunction with functional logic. The Output Multiplexer is central to logic of the 2910 Microprogram Sequencer. An instruction code input via 10-13 determines which of the four possible inputs will be selected by the Output Multiplexer. In contrast. the 2909 and 2911 have two control inputs. SO and S 1. that determine the source which the Output Mu Itiplexer selects. 2910 MICROPROGRAM COUNTER 00-011 are twelve data input lines Which, like the 2911, can input data to the Address register, or to the Output Multiplexer. If RLO is low, then data input at 00-011 is loaded into the Address register on the low-to-high transition of clock signal CPo Data input via 00011 is selected by the Output Multiplexer when an appropriate instruction is input via 10-13. Timing for an Address register access may be illustrated as follows: CP DO - D11 Address-----------v-------~'--------------Register _ _ _ _ _ _ _ _ _ _ _,,_ _ _ _ _Data _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ The 2910 outputs the microprogram address via VO-V11. These address output lines have their own enable signal OE. If this signal is high. YO-Y11 outputs are floated. This allows you to disconnect Microprogram Sequencer devices from the microprogram ROM. something you will likely do when switching to a test program. 8-110 2910 ADDRESS OUTPUT Y4 04 Y5 05 VECT Pi:: MAP 13 12 VCC 11 10 CCEN CC RLD FULL 06 Y6 07 Y7 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2910 DIP Pin Name DO - 011 YO - Yll VECT MAP PI: RLO OE CI 10 -13 CC CCEN FULL CP VCC.GNO Figure 8-36. 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 03 Y3 02 Y2 01 Yl DO YO CI CP GNO OE Yll 011 Yl0 010 Y9 09 Y8 08 03 Y4 04 Y5 05 VECT PL MAP 13 12 VCC 11 10 CCEN CC RLO FULL 06 Y6 07 Y7 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2910 FLAT PACKAGE 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 Description Type Combined Address register and data input Address output Vector address enable Map address enable Pipeline address enable Address register input enable Output enable Carry in Instruction code Condition code Condition code enable Stack full error indicator System clock Power. Ground Input Output. Tristate Output Output Output Input Input Input Input Input Input Output Input 2910 Microprogram Sequencer Pins and Signal Assignments 8-111 Y3 GNO 02 Y2 01 Yl DO YO CI CP GNO OE Yll 011 Yl0 010 Y9 09 GNO Y8 08 ~ ~ Address Register/ Down Counter Stack Pointer Zero l---- i 5by -~ _-------T"""""--I~ 12-Bit_1'r-Stack ~ _ _ _ _ _ _ _ ___ _--------I.--f- , DO-Dll&~~ Microprogram Counter Output Multiplexer ~ ~ ~ r J'\. Incrementer '" - CI ++++++ OE------------------~••~ .- ---::::: ~ Control Logic - v' YO - Y11 Figure 8-37. 2910 Microprogram Sequencer Functional Logic 8-112 I0 I1 I2 I3 CC CCEN Note that the 2910 has no zero input control on the address output lines. nor does it have any OR mask inputs. The 2909 and 2911 have such logic on the address output path. Instead. the 2910 uses its instruction codes to generate equ iva lent addressing logic. Like the 2909 and the 2911. the 2910 has two internal locations within which addresses can be held. These are the Microprogram Counter and the Stack. The 2910 Microprogram Counter logic is functionally identical to that of the 290912911 Microprogram Counter. Any address output by the output multiplexer also passes through the incrementer, and is then stored in the Microprogram Counter. If CI is input high, then the address output by the multiplexer is incremented by 1 before being written to the Microprogram Counter. If CI is input low. then the address is written into the Microprogram Counter without being incremented. 2910 MICROPROGRAM COUNTER 2910 INCREMENT The 2910 incrementer generates no Carry Out. Thus if you connect two 2910 Microprogram Sequencers in parallel. you cannot increment the resultant 24-bit Microprogram Counter contents across the low- and high-order halves of the address. But. given current microprogramming technology. this is unlikely to pose any problem. Few single microprograms have more than 4096 microinstructions. and you can use multiple 2910 Microprogram Sequencers to address large microprograms in discrete 4096-microinstruction blocks. The 2910 Microprogram Sequencer has a five-level Stack. The Stack is addressed by a Stack Pointer which initially addresses Stack Register O. Appropriate instruction codes. input via 10-13. generate Stack pushes or pops. A Stack push writes the Microprogram Counter contents to the currently selected Stack location and then increments the Stack Pointer. The Stack Pointer always points to the last word written. A Stack pop decrements the Stack Pointer. You must select the Stack as the output mu Itiplexer source in order to load the current top-of-stack plus one via the incrementer into the Microprogram Counter. If you execute more than five pushes. the Stack Pointer continues to address the last Stack location (number 4); the Microprogram Counter contents are written into this location. overwriting prior data. This will inevitably cause an error. The 2910 Stack Pointer does not wrap around. and will not increment from 4 to O. Stack full is indicated by the FULL signal. When either four words have been pushed and a fifth push is selected via 10-13 or five words have been pushed. FULL goes low. Thus it can be tested to see if the Stack is full. If you try to pop the Stack when the Stack Pointer is addressing location O. then the Stack Pointer continues to select location O. Since no data is written into the Stack following a pop. no prior information will be destroyed: however. in all probability you have a microprogramming error. No error signal is output at this time. 2910 The various addressing operations which the 2910 Microprogram Sequencer can perform INSTRUCTION are identified using an instruction code input at 10-13. CCEN (condition code enable) and CC (condition code) are two additional control inputs that in some cases modify the addressing CODES operations which the 2910 Microprogram Sequencer will perform. These six 2910 signals10-13. CC. and CCEN - together replace the 290912911 signals SO. S 1. ZERO. ORO-OR3. FE. and PUP. .... -~~2910 responses to 10-13 inputs are summarized in Table 8-12. As shown in this table. many 2910 of the responses depend on the level of the CC and CCEN inputs. Vendor literature describes CC CONDITION as a "condition code" and CCEN as an enable: however. in effect. CCEN must be low while CC CODES is high to select a "fail" condition, while any other combination of CC and CCEN input levels select a "pass" condition. Your design logic can use CC as a pass/fail selector. with CCEN as an override. This logic may be illustrated as follows: CC _ _ _ _ _ _ _ _ ~------- Condition Code CCEN --L./ In response to each instruction code input at 10-13.2910 logic performs operations which we will describe individually. Also. 2910 logic outputs low one of the three Signals PI.. MAP. or VECT. You can use these three signals as you see fit. however their intended purpose is to enable one of three possible inputs to 00-011. Figure 8-38 functionally illustrates timing for PL. MAP. and VECT as part of the 2910 microcycle response. VECT low will normally select a restart interrupt or other special address. MAP will normally enable the mapping ROM out of which a microprogram starting address is generated in response to a macroinstruction op-code. VECT and MAP are the exceptional enable outputs. PL is the enable signal which is usually output low. This signal will likely enable the Microinstruction register. or a connected Oata register. allowing the microinstruction to determine the next data input to appear at 00-011. With reference to Figure 8-31. Figure 8-~39 identifies how VECT. MAP and PL will likely be used. 8-113 .. 14 One Microcycle 1-I DO - 011. 10 -13 Control Inputs YO - Y11 pC MAP or VECT I I ~ \ t\ I) I \ I } II .! I '- ~I I I I CP~ One Microcycle "I " I ~ I t t I I Figure 8-38. 2910 Microcycle Eve:1t Sequences 2910 MICROPROGRAM SEQUENCER INSTRUCTIONS We will now examine 2910 Microprogram Sequencer instructions in detail. First, we will describe each instruction individually, then we will look at the instructions functionally, showing when instructions are likely to be used, and in what combinations. Instruction 0 (JZ) is a Jump-to-Zero instruction. This instruction forces the address to be output at YO-Y11; therefore the Microprogram Counter will subsequently hold the address 0 or 1. depending on the level of the CI input The JZ instruction also resets the Stack Pointer to O. effectively clearing the Stack. Since this instruction restarts execution with the microinstruction stored at microprogram memory location O. JZ is frequently used as a power-up. reset. or Restart instruction code. Instruction 1 (CJS) is a Conditional Jump-to-Subroutine instruction. A "pass" condition pushes the current Microprogram Counter contents onto the Stack and takes the next microinstruction address from the 00-011 inputs. A "fail" condition causes the next sequential microinstruction to be executed. This may be illustrated as follows: M- Address HM" must be input at DO - 011. Address "N+ 1" is saved on the Stack. 8-114 Macroinstruction D Macroinstruction Register --------JJ Mapping PROM/ROM Restart Address Register -- OE "' II.. ~~ OE ) 2910 Microprogram Sequencer ~10 v J Microprogram PROM/ROM J L----t.~~M "fail" "pass" + N N+ 1 Address "M" must be input at DO - 011. The return address "N+ 1" is pushed onto the Stack Instruction code 6 is a Conditional Jump Vector (CJV). It is significant principally because it is the only instruction code which generates a low VECT output. This low output usually enables a special Address register, out of which a direct memory access or interrupt address is fetched. If CC is in the "pass" condition, then the output multiplexer takes as its source DO-D11. If CC is in the "fail" condition, the next sequential instruction is executed. Instruction code 'is a Conditional Jump (JRP) which differs from the Conditional Jump-to-Subroutine (instruction code 5) only in that no push occurs. If the condition code "passes", then the microinstruction execution sequence jumps to the address which is input at DO-D11; otherwise, the microinstruction sequence jumps to the address held in the Address register. This may be illustrated as follows: l I-------+ "faW' Address uP" must P - - - - - - - N have been loaded previously into the Address register. "pass" l M Address "M" must be input at DO - 0 11 . . Instruction code 8 is a Repeat-Loop-Until-Counter-Is-Zero (RFCT) instruction. The purpose of this instruction code is to re-execute one or more microinstructions some fixed number of times. The microinstruction loop to be re-executed has its starting address stored in the Stack. The loop count is handled by the Address register. which must be preloaded with a number that is one less than the required count. For example, if the Address register is loaded with an initial value of 8, then the microinstruction loop will be executed 9 times. Thus, you can load into the Address register values ranging between 0 and 4095 to generate counts ranging between 1 and 4096. 8-117 When the 2910 receives an RFCT instruction code, it examines the Address register contents. If the Address register does not contain 0, then the output multiplexer takes as its source the currently addressed Stack location; the Address register contents are then decremented. If the Address register contents are 0, then the output multiplexer selects the Microprogram Counter as its source; also the Stack is popped. We can illustrate the RFCT instruction code as follows: M~:=J Address "M" must Address register contains O. Pop Stack. have been pushed onto the Stack. <: - -- N -N+ 1 ~ Address register does not contain O. Decrement Address register. Now the RFCT instruction, as illustrated above, re-executes a loop if the branch address M precedes N, where N is the microprogram location. But you can push any address onto the Stack prior to executing an RFCT code. For example, RFCT could be used to branch some fixed number of times without re-executing a loop. This may be illustrated as follows: 1 Add"", "",;,... C---- Nt ___ ---- M contains O. Po St ck. p a --N+ 1 ~ Address reg,st~r . does not contain O. Decrement Address register and branch· to "M". Address "M" must have been pushed onto the Stack. Instruction code 9, the Repeat-Register-Until-Counter-Is-Zero (RPCT) instruction, is almost identical to instruction code 8. RPCT again uses the Address register as a counter. If when RPCT is executed the Address register does not contain 0, then it is decremented and the output multiplexer chooses as its source an immediate address input at 00011. If the Address register contents are 0, then the output multiplexer selects as its source the Microprogram Counter. The Stack is not used. If the microinstruction which generates the RPCT code supplies its own address at 00-011, then this microinstruction gets re-executed the number of times specified by the Address register contents. This may be illustrated as follows: Address register contains O. Pop Stack. C-- -- Nl---, --N+1+~--~N+1 Addn>ss "N+'" must be input at DO - 011. Address register does not contain O. Decrement Address register. But a microinstruction does not have to supply its own address at 00-011 when specifying the RPCT instruction code. It can input any address at 00-011. Thus, RPCT can be used to re-execute an instruction loop, or RPCT can be used to execute any other branch some fixed number of times, as illustrated for the RFCT instruction code. Instruction code A is a Conditional Return-from-Subroutine (CRTN).lf the condition code "passes", then a Returnfrom-Subroutine occurs. The output multiplexer takes the currently addressed Stack register as its source, then pops the Stack. If the condition code "fails", then the next microinstruction address is taken from the Microprogram Counter. This may be illustrated as follows: "N+1" must be the address currently in the top of the Stack. I .~ r N+~'M---~ w N+'~ 8-118 ' "f T' .0 Instruction code B is a Conditional Jump-and-Return instruction (CJPP). If the condition code "passes", then the Stack is popped, but the output multiplexer takes 00-011 as its source. This is equivalent to a subroutine return where the return address is not taken from the Stack, even though the Stack is popped: rather, the return address is taken from 00-011. If the condition code "fails", then normal sequential microinstruction execution occurs with the next microinstruction address being taken from the Microprogram Counter. Instruction code C is a Load Counter instruction (LDCC). When this instruction code is executed, microprogram execution continues sequentially, with the output multiplexer taking the Microprogram Counter as its source: however, data input at 00-011 is loaded into the Address register. Instruction code 0 is a Conditional End-of-Loop (LOOP). As long as the condition code "fails", the output mUltiplexer selects the currently addressed Stack register as its source. When the condition code "passes", the Microprogram Counter is selected as the output multiplexer source and the Stack is popped. This may be illustrated as follows: M "pass'<:'~: ~ ~=:J l Address "M" must have been pushed onto the Stack. "faW' The LOOP instruction code is equivalent to the RFCT instruction code, with the condition code, rather than the Address register, determining the number of loop iterations. The LOOP instruction code does not have to be used to re-execute a loop. In the illustration above a loop is re-executed only because the address M is shown preceding N, the microinstruction address where the loop code is generated. If the address M does not precede N, then the LOOP instruction code becomes a simple conditional jump, where the jump address is held at the top of the Stack. Instruction code E is a Continue instruction (CONT). This is the normal default instruction code. It causes the next sequential microinstruction to be addressed. The output multiplexer selects the Microprogram Counter as its source. No other operations occur. Instruction code F is a three-way branch (TWB); it uses the condition code and the Address register. Whether the condition code "passes" or "fails", the Address register contents are decremented to O. If the condition code "passes", then the Stack is popped and the Microprogram Counter is selected as the output multiplexer source. If the condition code "fails", then the Stack is selected by the output multiplexer while the Address register is decrementing, but when the Address register has decremented to 0, the Stack is popped and the output multiple~er selects as its source data input at DO-011. These options may be illustrated as follows: On "pass" decrement Address register to M~:=:J - - -- N "pass" 0, then pop <·"'N+1 Stack. Address register does not contain O. Decrement address register. Address "M" must have been pushed onto the Stack. "fail" I~' "fail" P Address register contains O. Address "P" must be input at DO - 011. The TWB instruction code is, in effect. a conditional loop execute. While the condition code is failing, the microinstruction sequence between M and N is re-executed a number of times, as defined by the Address register: microprogram execution then branches to an address input at 00-011. But any single loop iteration can be bypassed by a "pass" condition code: moreover, when the Address register has decremented to 0, microprogram execution can continue sequentially, or it can branch to the address input at 00-011. 8-119 2910 MICROPROGRAM SEQUENCER ADDRESSING SEQUENCES Let us now examine some of the more common microprogram address sequences which you are likely to encounter, and how these address sequences will be generated using a 2910 Microprogram Sequencer. A simple sequence of consecutive microinstructions represents the simplest case: Address Sequence 2910 Instruction Code Sequence N N+1 N+2 N+3 etc CONT CONT CO NT CONT etc You generate sequential microinstruction addresses. as requ ired by the sequence above. using instruction code E. with the CI input high. You will likely initialize your microprogram in one of two ways: 1) 2) 2910 MICROPROGRAM Following a restart or special condition. use instruction code 0 (JZ); this forces a 0 output INITIALIZATION at Y. 0 or 1 can be written to the Microprogram Counter - depending on the level of the CI input. At the end of an instruction fetch. use instruction code 2 (JMAP) to take the microprogram starting address from a mapping ROM. We described this instruction code earlier. The 2910 Microprogram Sequencer gives you many ways of jumping within a 2910 microprogram. Any instruction code that causes the output multiplexer to select 00-011 or the MICROPROGRAM Address register as its source can be used to generate a microprogram jump. Instruction code 3 ...J_U __M_P ______~ (CJP) jumps to the address input at 00-011 if the condition code passes. So does instruction code 6 (CJV). but instruction code 6 (CJV) outputs VECT low - and the VECT enable signal is commonly used to select a special OMA or interrupt address. Instruction code 7 (JRP) is a dual. unconditional jump; if the condition code "passes". the jump address is taken from 00-011. while the jump address is taken from the Address register if the condition code "fails". A microprogram subroutine is called using instruction code 5 (JSRP). This instruction code pushes the Microprogram Counter contents onto the Stack; the subroutine starting address is taken from 00-011 if the condition code "passes". and from the Address register if the condition code "fails". The Address register must have been preloaded with an appropriate starting address if the condition code "fails". Generally. instruction code C (LOCT) is used to load the Address register. 2910 MICROPROGRAM JUMP-TOSUBROUTINE A normal Return-from-Subroutine will use instruction code A (CRTN) with the condition code held "passing". There are two types of loop you may encounter in a microprogram. You may wish to re-execute a single microinstruction, or a sequence of microinstructions some number of times. The simplest way of re-executing a single microinstruction some fixed number of times is to load the Address register with a number one less than the required count. then issue instruction code 9 (RPCT). This may be illustrated as follows: Address Sequence N N+ 1 (M times) N+2 2910 Instruction Code Sequence LOCT with M-1 to 00-D11 RPCT with N+1 to 00-011 CONT You can alternatively use instruction code 8 (RFCT) to re-execute a single microinstruction. but the microinstruction address must be preloaded onto the Stack. 8-120 ... More frequently. instruction code 8 (RFCT) will be used at the end of a multi-microinstruction loop. This may be illustrated as follows: 2910 Instruction Code Sequence Address Sequence Re-execute loop N+1 to N+M+1 P times [ N N+1 N+2 N+M N+M+1 N+M+2 PUSH with P-1 to DO-D11 and CC "passing" CO NT CO NT CO NT RFCT CO NT As illustrated above. the microinstruction preceding the loop must input instruction code 4 (PUSH) with the condition code passing. This simultaneously loads the count into the Address register while pushing the next sequential address onto the Stack. Subsequently instruction code 8 (RFCT) decrements the Address register. selecting the address which PUSH saved on the Stack. until the Address register has decremented to O. 2910 ADDRESSING EXAMPLE As we did for the 2911 Microprogram Sequencer, we will now look again at the twos complement binary division microprogram given in Table 8-9, adding address generation microinstruction bits needed by the 2910 Microprogram Sequencer. See Table 8-13. We are going to treat the twos complement binary division microprogram as a subroutine. We assume. therefore. that microinstruction 1 is executed following a Jump-to-Subroutine instruction code input to the 2910 Microprogram Sequencer. Microinstruction 1 inputs a CONT instruction code to 10-13 of the 2910 Microprogram Sequencer. This causes the next sequential microinstruction to be executed. Since the 2910 does not sample its DO-D11 inputs. these bits are irrelevant. CI is input high since the 2910 Microprogram Counter contents must increment. RLD and CCEN are high since no data is to be written into the Address register. and the condition code is not used. Although microinstruction 1 itself transmits the simplest possible addressing logic to the 2910. the ZERO status output by the 2903 while microinstruction 1 is executed contributes to microinstruction 2 address generation logic. The binary division subroutine must be aborted if the divisor is O. This abort condition is indicated by a ZERO status output following execution of microinstruction 1. This ZERO status is output too late during microinstruction 1's microcycle to be considered by 2910 addressing logic during execution of microinstruction 1. Therefore, in the event that the subroutine must be aborted. microinstruction 2 gets executed gratuitously. but causes an abort exit from the subroutine after its gratuitous execution. The CJP instruction code is input to the 2910 Microprogram Sequencer by microinstruction 2 in order to achieve this end. This instruction code causes the next sequential microinstruction to be addressed if the condition code "fails", while the addressing input at DO-D11 is selected if the condition code "passes". The address of the microinstruction to be selected following an abort is therefore input via bits DO-D11. In order to enable the condition code. CCEN is low. CC must be connected to the complement of Z while microinstruction 2 is being executed. This allows the ZERO status output by the execution of microinstruction 1 to generate the CC input during microinstruction 2 - and thus generate an abort. if needed. We do not show the logic which causes CC to be connected to the complement of the 2903 Z status. There are many ways in which such "one time" connections can be made. Possibly the simplest technique is to add microinstruction bits which enable a specific NOR gate linking the 2910 CC input with the 2903 Z output. This may be illustrated as follows: CC----~----~L_~ z----------~L_~ 8-121 Table 8-13. The 2903 Twos Complement Binary Division Microprogram Subroutine from Table 8-9, with 2910 Addressing Microinstruction Fields Added Microinstruction EA CN AO -A3 80 - 83 a a a Divisor register (Ra) Divisor buffer (R3) Copy divisor to temporary buffer. 6 a a a Dividend (MS) register (R 1 ) Dividend (MS) buffer (R2) Copy dividend most significant half to temporary buffer. 5 a a x a x Dividend (MS) buffer (R2) Convert dividend (MS) from twos complement to sign/magnitude version. Test aVR externally w/lile next microinstruction is being executed. If OVR is 1, branch to subroutine that downshifts dividend. 4 5 a a x a x Divisor buffer (R3) Convert divisor (MS) from twos complement to sign/magnitude version. Test aVR externally. If OVR is 1, branch to microinstruction 9. 5 9 4 a x a x Dividend (MS) buffer (R2) Shift out sign bit of dividend (MS) half in temporary buffer. 6 9 4 a x a x Divisor buffer (R3) Shift out sign bit of divisor in temporary buffer. 7 F 2 a a 1 Dividend (MS) buffer (R2) Divisor buffer (R3) Subtract sign bit stripped divisor from sign bit stripped dividend (MS) half. If Carry = 1 (dividend larger) branch to subroutine that downshifts dividend or upshifts divisor. 8 6 6 a a a Dividend (LS) register (R4) X 9 A* a a a a Divisor register (Ra) Dividend (MS) register (Rll Double length normalize dividend in MS register and Q register. 10 c· a a a z Divisor register (Ra) Dividend (MS) register (R 1l Execute twos complement divide instruction fourteen times. 11 E a 0 0 Z Divisor register (Ra) Dividend (MS) register (Rll Twos complement divide final instruction. No 18 -15 14 -11 10 1 4 6 2 4 3 Comment Copy dividend least significant half to Q register. 'CN is connected to Z status while these two special functions are being executed. 8-122 Table 8-13. The 2903 Twos Complement Binary Oivision Microprogram Subroutine from Table 8-9. with 2910 Addressing Microinstruction Fields Added (Continued) Mlcrol••tnlcdon bl .. covering ZII03 ond ZII10 Inpu" IBlt poold.... ore ..... ltr1Iry ond hove no .1•• 111.....1 Z810 BI.. 21103BI.. -- _'-...--'----- -1817181111413 IZ 11 10 o 1 0 0 0 1 1 0 0 Ell eN A3A2Al AOB3 BZ Bl 0 0 0 0 6000 4 0 0 0 0 RO 80 13 IZ 11 10Dll Dl0 DII DB D7 D8 DII D4 D3 DZ Dl DO 1 1 R3 0100011000000010010 ~-eo 0 0 -;;;- 1 0 1 0 0 0 0 0 X 0 X X X X 0 o 0 1 0 1 o0 5 0 0 0 X 0 1 0 1 o 9 o0 1 0 --..,-.' R3 X 0 --..,-.' 9 o0 1 o 1 o0 11 X X X X X 1 0 0011A 1 1 lOX _ ~~ o 1 1 1 A A A A A A A A A A :;,., X X X X X X X X X X X 0 1 1 ....... B - 5 B B S 5 5 5 5 5 5 5 5 'V ~ SC81e dividend subroutine 3 = CJP B .!....B B B B B B V ~ Microinstruction 8 address 1 1 o 1 1 CC is generated by 2903 Z otatus ICC = ZI. Select next sequential microinstruction unless RO from microinstruction 1 is O.. Then abort. 1 1 1 Select next sequential instruction. 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 Then branch to microinstruction 8. 1 1 5elect next sequential instruction. X X X X X X X X X 1 1 1 1 0 1 0 0 X X X X X X X X X X X 1 1 1 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 1 1 lOX CC is genarated by OVA st.tus. ICC = OVRI. Select next sequential instruction unless OVR = 1. Then call uscals dividend" subroutine. CC is generated by OVA status. ICC = OVRI. Select next sequential instruction unless OVA = 1. X 4 Select .ext seque.tial instruction. 0 X 6 A X X X X X 0 0 1 1 1 1 lOX '-...--' - - . . , - . ' R3 E = CONT 5elect next sequential instruction. '-...--' - - . . , - . ' - - . . , - . ' 0 R2 -- -6 X 0 2 1 1 X X ---..,-.' o 0 R2 1 1 1 1 0 0 1 0 0 F X 111 1 = CJ5 --..,-.' 1 0 0 1 () 1 0 0 0 10 X X X X 0 4 X E = CONT 1 1 X X X X 0 0 0 0 ----o O' 1 0 R2 ---..,-.' X -;;-~ ~'-""-----""V' Address for abort 0 5 1 1 lOX E=CONT 1 1 0 0 0 0 0 0 0 --..,-.'.-.-.' COO 0 X 0 1 1 1 0 0 0 0 0 0 0 - -E- . . , 0 .' 0 0 X 0 R3 E = CONT 1 0 0 X X X X ~-.!. 1 = CJ5 R4 0 0 0 0 0 0 0 1 . - . - . ' '-...--' Rl RO ~~ T - T 0 0 X 1 - 1 0 1 0 X T T T T T V 0...2... 0 0......2.. 1 1 0 'V 0 0 0 0 0 0 0 '-...--' Rl T ~ Scale divisor or dividend subroutine Count X RO T 4 = PU5H 0 0 0 0 0 0 0 1 1 0 0 0 X --..,-.' ' - . . . - - ' RO Rl 8 = RFCT - T X X X X X X X X .J... = 13 X X A = CRTN X X X X X X X X X X 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 CC is generated by CIN+41. ICC = CIN+4H. Select next sequential instruction unless C(N+4) = 1. Then call "scale divisor or dividend" subroutine. Load count into address register, push next sequential instruction address onto Stack and select next sequential instruction. Re-execute instruction addraosed by 5tack until count decrements to O. Ratum from subroutine. x = "Oon't Care" bits While it may appear wasteful to dedicate a single microinstruction bit to enabling such a connection. perhaps only once in an entire microprogram. in fact the economics of microprogramming often favor wasting a single bit in this way. The alternative is to have additional logic which generates a particular input, from one of a variety of outputs. depending on complex combinations of circumstances. To evaluate this reasonin~ look at Table 8-13. where CC may be connected at different times to a Zero. Overflow or C(N+4) status. You cannot guarantee that the CC generation logic will be a known function of any bit field within the microinstruction. since the same bit field may recur somewhere else in the microprogram without having the same CC logic requirements. Your only alternative to dedicating a microinstruction bit to each CC generation possibility would be to decode the microinstruction address itself; and that would not be simple. Microinstruction 3 is another example of a microinstruction that generates a status output which contributes to subsequent addressing logic - but not until the next microinstruction. Microinstruction 3 itself provides the 2910 with a CaNT instruction code. which together with a high CI causes the next sequential microinstruction address to be output by the 2910. The data bits 00-011 are not used; RLO and CCEN are both high (i.e .. in the "off" state). At the 2903. microinstruction 3 performs a twos complement to sign/magnitude conversion on the contents of RAM location R2. If this operation generates a high Overflow status. then R2. which contains the high-order half of the dividend. must be scaled by shifting down one bit position. The subroutine should be called. if needed. after microinstruction 3 has been executed. and before microinstruction 4 is executed. But microinstruction 3 outputs OVR too late in its microcycle for this status to contribute to the next microinstruction address. Therefore microinstruction 4 provides the 2910 with addressing logic that tests the OVR status from microinstruction 3's execution. CJS. the Conditional Jump-toSubroutine. is specified by inputting 1 as the 2910 instruction code. The address of microinstruction 1's subroutine is held in data field bits 00-011. CCEN is output low so that CC can be tested. CC must be connected to the complemen t of the 2903 OVR status output. If CC is low - and OVR is high - then the subroutine addressed by 00-011 will be called. Otherwise. since CI is high. the 2910 will output the next sequential microinstruction address - which is the address of microinstruction 5. RLO is output high since the address at 00-011 must not be written into the Address 8-123 register. As we did in instruction 2. again in microinstruction 4 an additional microinstruction bit will likely connect CC- to-OVR via NOR gates. And once again we will choose to waste this CC-to-OVR connector bit for the vast majority of microinstructions where such a connection does not apply. While microinstruction 4 provides the 2910 with addressing inputs that test the Overflow status generated by microinstruction 3, the Overflow status itself is mQdified by the 2903 while microinstruction 4 is being executed. This presents no timing problems. since the 2910 has stopped sampling its CC input by the time microinstruction 4 modifies the Overflow status. See Figure 8-~8. Microinstruction 5 must provide the 2910 with addressing inputs that account for the Overflow status generated by microinstruction 4, just as microinstruction 4 had to provide the 2910 with addressing inputs that took into account the Overflow status generated by microinstruction 3. Microinstruction 5 causes the 2910 to execute a conditional jump. rather than a conditional subroutine call. since a high Overflow status generated by the 2903 while executing microinstruction 4 requires microinstructions 5. 6. and 7 to be bypassed. We do not bypass microinstruction 5. since it is during this microinstruction's execution that the 2910 will test the Overflow status from microinstruction 4 - and determine if a jump is required. This would present a problem if execution of microinstruction 5 upset the 2903 logic sequence; but it does not. If executed unnecessarily no harm is done. But remember. there may be circumstances under which you may have to insert a dummy microinstruction that generates no operation at a 2903. but gives the 2910 time to test 2903 status from the previous microinstruction. In our present example microinstruction 5 inputs a CJP instruction code at 10-13 of the 2910 and the address of microinstruction 8 at DO-D11. CCEN is low so that 2910 condition code logic will sample CC. which remains connected to the 2903 OVR status. as it was during execution of microinStruction 4. RLD is high so that the address input at DOD11 does not get written into the Address register. CI is high since the next sequential microinstruction must be selected if OVR is low - and the condition code test "fails". If the condition code test "fails" at the 2910 during execution of microinstruction 5. then microinstructions 6 and 7 are next executed sequentially. Each of these microinstructions provides the 2910 with a simple CONT input at 10-13. no data inputs. and CCEN and RLD disabled with CI high. so that the Microprogram Counter will increment Microinstruction 7 subtracts modified versions of the divisor from the dividend. If the Carry Out generated by the 2903 at C(N+4) is 1. then the divisor must be upshifted (or the dividend must be downshifted) in order to guarantee that the divisor ultimately has the larger absolute value C(N+4) is generated by the 2903 at the end of the microinstruction 7 microcycle - too late for the 2910 to take this status output into account until the next microcycle. during which microinstruction 8 is executed. In Table $~13 we show microinstruction 8 providing a Conditional-Jump-toSubroutine input to 10-13, with a subroutine address input to 00-011. This 2910 addressing logic is identical to that which we have already described for microinstruction 4. except that the condition code CC will now be connected to the 2903 C(N+4) output - again via a special enabling microinstruction bit The fact that microinstruction 5 might have caused the 2910 to generate a branch to microinstruction 8 is not a problem. since C(N+4) will be low following execution of microinstruction 5: therefore if microinstruction 8 is executed next. the condition code must fail Microinstruction 9 is executed after microinstruction 8 - possibly with a scaling subroutine executed in between Microinstruction 9 prepares the 2910 for execution of microinstruction 10. A PUSH Instruction code is Input at 1014. with a count input at DO-D11. RLD is low so that the count gets written into the Address register. The 2910 then outputs the address of microinstruction 10 since CI is high - so the Microprogram Counter gets incremented MicroinstrlJction 10 outputs an RFCT instruction code to the 2910 via 10-13:This Instruction code causes the 2910 to output the address held at the top of the Stack until the Address register decrements to zero The push performed by the 2910 while microinstruction 9 was executing loaded microinstruction 10's address onto the Stack. therefore microinstruction 10 gets re-executed 13 times - for a total of 14 executions After the Address register has decremented 13 times to O. the RFCT instruction code causes the 2910 to output the next sequential instruction - that of microinstruction 11. This is the terminating microinstruction for the twos complement binary division microprogram subroutine Therefore a Return-from-Subroutine code. CRTN. IS transmitted to the 2910 via 10-13 In order to force a pass condition. this being a Conditional Subroutine Return Instruction. code CCEN IS output high 8-124 THE 2930 AND 2932 PROGRAM CONTROL UNITS These two parts were designed to provide assembly language instructions with their memory address generation logic. The internal architecture of these two devices approximates II 2901 whose local RAM has been converted into a Stack, while the Q register functions as a local data register. In reality. the 2930 series devices are hybrid parts that may substitute for 2909/10/11 Microprogram Sequencers, or they may be used separately to implement assembly language instructions' memory addressing logic. The 2930 series devices are probably more effective as microprogram sequencers. In this role you need only make sure that timing requirements of the 2930 series devices are compatible with the 2901 or 2903 central logic you are using. But as assembly language memory address generators 2930 series devices leave a great deal to be desired. They cannot cope with indirect memory addreSSing. since by its very definition indirect memory addreSSing requires intermediate access of external memory. Also. most minicomputer and microcomputer assembly languages depend on an external memory stack which cannot be implemented within the small. local stack provided by 2930 series devices. Therefore. 2930 series devices do little more than add indexes to base addresses. But the value of 2930 series devices increases dramatically when you are not building a general purpose central processing unit. If you are building dedicated CPU-based logic that uses both microcode and higher level instructions. then you can probably avoid indirect addressing. and you can work with the limited 2930 series stack. The 2930 series devices are both 4-bit slices. The 2930 is the most advanced of the two devices; it is fully cascadable and packaged as a 28-pin DIP. The 2932 device is packaged as a 20-pin DIP and is also cascadable. These two devices differ only in their internal instruction logic. Both 2930 devices are manufactured using bipolar technology: they use a single +5V power supply and have TTL-level compatible signals. 2930/32 DEVICE PINS AND SIGNALS We will describe pins and signal assignments for these two devices together, and in conjunction with their functional logic. Device pins and signals are illustrated in Figure 8-40. Functional logic is illustrated in Figure 8-41. The Adder is central to 2930 series operations. The Adder accepts one or two operands as inputs. and generates a single output. The Adder can perform three different operations: 1) 2) 3) It can add (with carry) the two operand inputs. CN determines the level of the carry during addition. It can increment a single operand by adding CN to the operand. It can output a single operand unaltered. 2930 SERIES Rand S in Figure 8-41 are the two Adder operands. The R operand can have one of three sources. The S operand can have one of four sources. An instruction code selects the source for INSTRUCTION the Rand S operands. together with Adder operations. The 2930 has a 5-bit instruction code, CODES input at 10-14. The 2932 has a 4-bit instruction code, input at 10-13. These instruction codes do more than control logic around the Adder and its inputs. they also control the Stack Accumu lator and Program Counter. as summarized in Table 8-14.. This table is keyed to the 2930. The set of 2932 instruction codes is a subset of the 2930 instruction code set. and is so identified. The 2930 allows you to enable or disable the Adder output using the output enable signal OE. The 2932 has no such output enable signal: Adder output from this device is always enabled. But when OE is input high to the 2930 the YO-Y3 outputs are floated. Data may be held in three different places within 2930 series devices: these three places are the Accumulator. the Program Counter. and the Stack. The Accumulator is a single 4-bit location that can receive data input via 00-03, or it can 2930 SERIES receive output from the Adder. The instruction code determines which of the two inputs. if ACCUMULATOR either. will be written into the Accumulator. The 2930. but not the 2932. has a separate Accumulator enable control signal RE. This enable control signal is subordinate to the instruction code. The level of RE is unimportant when the instruction code specifies that data will be written into the Accumulator. For other instruction codes. a low RE input causes immediate data at 00-03 to be written into the Accumulator. 8-125 10 EMPTY CI OE C(I+4) CN YO Y1 Y2 Y3 G --- ----- C(N+4) .GND . .-. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 28 27 26 25 24 23 22 21 20 19 18 17 16 15 2930 -...----- ---...... ---- ---- DO - 03 YO - Y3 RE OE 10 - 14/10 - 13 lEN CC CI C(I+4) CN C(N+4) G FULL EMPTY CP VCC. GND 10 FULL CI C(I+4) CN YO Y1 Y2 Y3 GND -- ..-- ------ 1 2 3 4 5 6 7 8 9 10 20 19 18 17 2932 16 15 14 13 12 11 P -... - Pin Name P VCC (+5V) 11 12 13 14 CC lEN RE DO 01 02 03 CP Description Data input Address output Register input enable Address output enable Instruction input Instruction enable Instruction condition code Program Counter carry in Program Counter carry out Adder carry in Adder carry out Adder carry generate Adder carry propagate Stack full indicator Stack empty indicator Device clock Power. Ground Type Input Output Input Input Input Input Input Input Output Input Output Output Output Output Output Input Figure 8-40. 2930/32 Program Control Units Signals and Pin Assignments 8-126 -I ----- --- . -- -- VCC(+5V) 11 12 13 DO 01 02 03 C(N+4) CP h DO - 03 - 1 1 -----.. . 17 x 4 Bit Stack > - -----.. FULL - ~ lii1v: Accumulator 0 0 . ,,l, J ("< , ~ 'Ii R ~ ~ J S 3-IN MUX 4-IN MUX A " ~ .1 .. CN ~ . ~ '1\ R S Program Counter Adder " ),~ (' 7 - ~ ::: ~ 7 Incrementer -- j II Instruction Decoder YO - Y3 These signals are present in the 2930, but not the 2932. Figure 8-41. Functional Logic for 2930 Series Program Control Units 8-127 ~ CI C(i+4) Table 8-14. 2930 Series Program Control Unit Instruction Codes Summary Instruction Output atYO-V3 Code No. New PC Contents Accumulator Contents (1) 2932(4) Instructions Stack Operation No. 1413121110 Comment 131211 10 0 4 8 o o None 9 1 0.,0 1 None None A 1 0 1 0 CI CI CI CI [D) [D) [D) [D) [D) [PC) + CI [D) None [PC) + CI [D) [PC) [PC) + CI + CI [D) [PC)· [PC) + CI [PC) [PC) + CI [OJ" None F 1 1 1 1 [PC) [PC) [PC) [PC) + CI + CI [D) ~D) PUSH [PC) PUSH [0) 6 2 o o 01 1 0 1 o1 1 10 01 1 1 1 [S) [PC) [PC) [PC) + CI [PC) + CI [PC) [D) [D) [D) POP POP None 3 00 1 1 10 11 12 13 1 1 1 1 [R) [D) 0 [D) [D) [D) [D) [0] None None None None 8 5 o 14 1 0 1 0 0 [PC) + [D) + CN [0] None i 15 1 0 1 0 1 [PC) + [R] + CN C 1 1 1 1 1 1 0 1 1 ~ 16 17 18 19 lA 1 1 0 1 0 [PC) + [0] + CN 18 1 1 0 1 1 [PC] + [R] + CN lC 10 1 1 1 0 0 1 1 1 0 1 IE IF 1 1 1 1 0 1 1 1 1 1 [R + CI [D) + CI CI [R) + [D) + CN + CI [PC) + [D) + CN + CI [PC] + [R] + CN + CI [R) + CI [D) + CI CI [R] + [D) + CN + CI [PC] + [0] + CN + CI [PC) + [R] + CN + CI [S] + CI [S) + [0] + CN + CI [PC) [PC) i ~ 1 ";: 1 ;:, § i 1 J 0 1 2 3 4 0000 0000 000 1 000 1 00 1 0 5 001 0 1 [PC) + [D) + CN 6 00 1 1 0 [PC) + (RI + CN 7 8 00 1 1 1 o 1 00 0 [S) + [D) + CN 9 o 1 [R) + (D) + CN A o o o 1 0 8 C 1 o 1 1 1 1 0 0 0 E F o0 o1 000 000 0 0 1 00 1 0 0 1 1 1 1 1 1 00 00 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 [PC) [R) [D) [R) + [D) + CN [PC) [R) [R) [S) + + + [R) [0] 0 [0] [S] [0] + CN + CN + CN [PC) Off 121 CI [PC) + [PC) + [PC) + [PC) + [R) + [D) + CN· [0] [0] [D) [0] [D) O-[SP) None None 0 0 0 1 o 0 1 0 0 0 None None None None PUSH PUSH PUSH PUSH [PC) [PC) [PC) [PC) 1 1 0 0 1 0 1 0 1 1 1 0 1 o o 0 1 [0] PUSH [PC) [0] PUSH [PC) E 1 1 1 0 [0] [0] POP None 7 o 1 1 1 [D) [D) None None 1 o 0 0 1 Device resat Output p.rogram Counter contents Output Accumulator contents Output immediete data Output sum of Accumulator contents and immediate data Output sum of Program Counter and immediata data Output sum of Program Counter and Accumulator Output sum of Stack and immediate data Output Program Counter contents and unconditionally loed Accumulator Output sum of Accumulator and immediate data. and unconditionally loed Accumulator Output Program Counter contents. Unconditionally loed immediate data into Accumulator Output and push Program Counter contents Output Program Counter contents and push immediate data Pop and output Stack Output Program Counter and pop Stack Output and hold Program Counter Jump to address in Accumulator Jump to address given by immediate data Jump to "0" Jump to address given by sum of Accumulator and immeidate data Jump to address given by sum of Program Counter contents and immediate data Jump to address given by sum of Program Counter and Accumulator contents Jump to subroutine addrassed by Accumulator Jump to subroutine addrassed by immediate data Jump to subroutine origined at 0 Jump to subroutine addressed by sum of Accumulator contents and immediate data Jump to subroutine addressed by sum of Program Counter and immediate data Jump to subroutine addressed by sum of Program Counter and Accumulator contents Retum from subroutine Retum from subroutine to retum eddress plus immediate data Output and hold Program Counter High impedance output. Hold Program Counter (1 )The Accumulator is loaded only when Ai: is input low. Exceptions are the three instructions marked •. which cause the Accumulator to be loaded unconditionally. (2lThe YO - Y3 outputs are in the high impedance state. (3)Conditional instructions execute as described only when Cc is input low. Otherwise instruction 1 is executed. These instructions are unconditional for the 2932 which has no Cc input. (4)The 2932 has no R[ input. therefore only the three instructions marked· load the Accumulator. 8-128 The Program Counter normally receives the Adder output as its new input. The Adder output 2930 SERIES mayor may not be incremented, depending on the level of the CI input. When the Adder is PROGRAM COUNTER not outputting the prior Program Counter contents. loading this different output into the Program Counter constitutes a program jump. Many instruction codes bypass this jump logic by recycling the Program Counter contents back through the incrementer while some other output is generated by the Adder. For example. one instruction code causes the Adder to output data input at 00-03. But the Program Counter contents are held unaltered. or incremented. depending on the level of the CI input. 2930 SERIES Both 2930 series devices have a 17-level Stack. Program Counter contents or data input at STACK, PUSH, 00-03 can be pushed onto the Stack. The 2930 series push operation is a little unusual. The POP Stack Pointer is incremented. then the selected data is written into the newly addressed Stack location. Thus. following a push. the Stack Pointer addresses the data most recently pushed onto the Stack. It is more traditional for the Stack Pointer to address the first free Stack location. When you pop a 2930 series Stack, you decrement the Stack Pointer contents, and that is all. Thus. in order to read data off the top of the Stack. you select an instruction code which reads data from the Stack. then you pop the Stack. The more traditional Stack architecture requires that you pop the Stack. then read data from the top of the Stack. The 2930 series Stack Pointer is not wrap-around. If the number of pushes exceeds the number of pops by more than seventeen. the Stack Pointer continues to address the topmost Stack location. If you attempt to pop the Stack when the Stack Pointer is addressing location O. then it continues to address location O. 2930 SERIES STACK POINTER When the Stack Pointer is addressing either of the two top Stack locations. the FULL signal is output low. When you execute a push while the Stack Pointer is addressing the top Stack location. data is written into this top location. overwriting whatever was there before. The 2930. but not the 2932. has a Stack Empty indicator. This signal. EMPTY. is output low following a reset. or after the lowest level Stack location has been popped. 2930 series devices are cascadable. However. the 2930 has more cascading logic than the 2932. Unlike the 2901 and the 2903. the 2930 series devices do not have Shifters along data paths. therefore the Accumulator. Stack. and Program Counter do not need parallel interconnect signals. Parallel interconnect signals are needed only to cascade the Program Counter as it increments. or the Adder following an increment or addition. For the Program Counter there is a carry input. CI. and a carry output. C(I+4). The delay between CI being input and C(I+4) being output is very short. There is plenty of time for this ripple carry to propagate through four slices. for a 16-bit address. within one microcycle. For timing details see the data sheets at the end of this chapter. 2930 SERIES Both 2930 series Adders have a carry input, Ct,!, and a carry output, C(N+4). Only the 2930 CARRY LOGIC has is" and Goutputs, the carry propagate and generate. Therefore only the 2930 allows you to use a 2902 carry look-ahead generator. When using the 2932 device. you must rely on ripple carry. For a discussion of carry look-ahead and ripple carry. refer to the 2901 and 2902 device descriptions given earlier in this chapter. USING 2930 SERIES DEVICES You must be careful when deciding how to use 2930 device read/write locations. You should not use these locations to implement CPU registers if you are designing any type of general purpose minicomputer or microcomputer. That is because you will have to perform a sequence of pushes and pops. each requiring a single microcycle. in order to select an arbitrary location. Moreover. every time you perform a push in order to increment the address. you will simultaneously write into the newly addressed location - something you may not wish to do. Thus the Stack lets you have 17 levels of subroutine within the program logic that you use to generate addresses. You can use the 2930 series Accumulator to implement a CPU register. For example. many primitive Central Processing Units have a single Index register whose contents can contribute to address generation logic. but not to CPU arithmetic or logic operations. The 2930 series Accumulator would be an ideal location for such an Index register. 2930 SERIES INDEX REGISTER If you are designing a special purpose Central Processing Unit using 2930 series devices. you may well be able to use the 17-level Stack to give you all the CPU registers you require. Knowing in advance the limitations of 2930 series Stack access. you can design your microprogram around these limitations so that addresses are stored in the proper serial sequence within the 2930 series Stack. 8-129 DATA SHEETS This section contains specific electrical and timing data for the following devices: • • • • • Am2901. Am2901A and Am2901 B Am2902A Carry Look-Ahead Generator Am2903 Enhanced Microprocessor Slice Am2910. Am2909. and Am2911 Microprogram Sequencers Am2930 Program Control Unit 8-01 Am2901/Am2901 A ALUSOURCE OPERANOS MICROCODE 12 11 10 L L L L H H H H L L H H L L H H L H L H L H L H Octal Code 0 1 2 3 4 5 16 14 13 A A a 0 0 0 a L L L L H H H H L L H H L L H H L H L H L H L H 0 0 0 6 7 MICROCODE S R 8 8 A A 0 0 RAM FUNCTION a·REG. FUNCTION 16 0ctI01 Code Shift L ..d Shift L L 0 X NONE NONE F .... O L H 1 X NONE X NONE 18 17 L L Symbol RPlusS SMinus R RMinu,S RORS RANDS RANDS R EX-OR S R EX·NOR S 0 1 2 3 4 5 6 7 R+S S-R R-S RVS RA S RI\S R¥S R'VS Figure 3. ALU Function Control. Figure 2. ALU Source Operand Control. MICROCODE ALU Function 0ctI01 Code Load V OUTPUT RAM SHIFTER a SHIFTER RAMo RAM3 Clo F X X X X F X X X X 03 L H L 2 NONE F .... 8 X NONE A X X X X L H H 3 NONE F .... 8 X NONE F X X X X H L L 4 DOWN F/2 .... 8 DOWN 012 .... 0 F FO IN3 00 IN3 H L H 5 DOWN F/2 .... 8 X NONE F FO IN3 00 X H H L 6 UP 2F .... 8 UP 20 .... 0 F INO F3 INO 03 H H H 7 UP 2F .... 8 X NONE F INO F3 X 03 X= Don't care. Electrically, the shift pin is a TTL input Internally connected to a three·state output which is In the high· Impedance state. 8 = Register Addressed by B inputs. Up is toward MSB, Down is toward LSB. Figure4. ALU Destination Control. ~210OCTAL 0 1 2 3 4 5 6 7 CI.~ Source A,a A,B o,a O,B O,A D,A D,a 0,0 14 L 3 ALU . Function 0 1 2 Cn-L R PlUI S Cn-H Cn-L SMinul R Cn - H Cn- L R MinulS Cn-H A+O A+8 a 8 A O+A 0+0 0 A+O+l A+8+1 0+1 8+1 A+l O+A+l 0+0+1 0+1 O-A-l 8-A-l 0-1 8-1 A-I A-D-l 0-0-1 -0-1 O-A B-A 0 8 A A-O 0-0 -0 A-O-l A-8-1 -0-1 -8-1 -A-l D-A-l 0-0-1 0-1 A-O A-8 -0 -8 . -A O-A 0-0 0 3 RORS AVO Av8 a 8 A OVA OVO 0 4 RANDS AMi Ai\8 0 0 0 Di\A 0110 0 5 RANDS Ai\O Ai\8 0 8 A OIlA 0110 0 6 R EX·ORS A"'O A"'8 0 8 A O"'A O¥O 0 7 REX-NORS A¥O A¥ B Q ii A O"'A O¥O 0 V = OR; 1\ = AND; + * Plus; - = Minus; V = EX·OR Figure 5. Source Operand and ALU Function Matrix. Data sheets on pages 8-02 through 8-025 Copyright copyright owner. © 1978 by Advanced Micro Devices, Inc. Reproduced with permission of 8-D2 Am2901 /2901 A SOURCE OPERANDS AND ALU FUNCTIONS Figure 5 results. This matrix fully defines the ALU/source operand function for each state. There are eight source operand pairs available to the ALU as selected by the 10, 11, and 12 instruction inputs. The ALU can perform eight functions; five logic and three arithmetic. The 13, 14, and 15 instruction input$ control this function selection. The carry input, Cn , also affects the ALU results when in the arithmetic mode. The en input has no effect in the logic mode. When 10 through 15 and en are viewed together, the matrix of The ALU functions can also be examined on a "task" basis, i.e., add, subtract, AND, OR, etc. In the arithmetic mode, the carry will affect the function performed while in the logic mode, the carry will have no bearing on the ALU output. Figure 6 defines the various logic operations that the Am2901 A can perform and Figure 7 shows the arithmetic functions of the device. Both c:arry-in LOW (en = 0) and carry-in HIGH (C n = 1) are defined in these operations. Octal Group Function 40 41 45 46 AND A/\O A/\8 O/\A 0/\0 30 31 35 36 OR AVO AV8 OVA OVO 60 61 65 66 EX-OR AVO AV8 OVA OVO 1543,1210 70 7 1 75 76 Octal 1543,1210 EX-NOR 72 73 74 77 INVERT 62 63 64 67 AVO Avo8 9 ADD 8 A o PASS 0 8 A 0 1 2 1 3 1 4 PASS 0 8 A 0 2 2 2 1 "ZERO" 0 0 0 0 MASK A/\O A/\8 D/\A 0/\0 1 1 1 1 2 2 PASS 4 0 7 Decrement 2 7 32 33 34 37 42 43 44 47 50 51 55 56 A+8 O+A O+Q ADD plus one 8 A 0 0-1 8-1 A-1 0-1 1'5 Compo 3 4 7 -8-1 -A-1 -0-1 1 5 Subtract (1'sComp) 8-A-1 A-0-1 0-0-1 A-Q-l A-8-1 O-A-l O-Q-l A+0+1 A+8+1 O+A+l 0+0+1 Increment PASS 8+1 A+l 0+1 0 8 A 0 2'sComp. (Negate) -0 -8 -A -0 Q-A-l 0 Function Q+l -Q-l 2 6 0 1 2 5 2 6 Figure 6. ALU Logic Mode Functions. Cn = 1 (High) Group Q 0 2 0 3 D Function A+O 0 0 0 1 0 5 0 6 OVA OVO Cn = 0 (Low) Group Subtract (2's Comp) Q-A 8-A A-O Q-O A-O A-8 O-A 0-0 Figure 7. ALU Arithmetic Mode Functions. 8-03 Am2901 MAXIMUM RATINGS (Above which the useful life may be impaired) Storage Temperature Temperature (Ambient) Under Bias Supply Voltage to Ground Potential DC Voltage Applied to Outputs for HIGH Output State DC Input Voltage DC Output Current, Into Outputs DC Input Current -0.5 V to +6.3 V -0.5 V to +VCC max. -0.5 V to +5.5 V 30mA -30 mA to +5.0 mA OPERATING RANGE PIN Ambient Temperature I Am2901PC. DC I Am2901DM. FM I Vcc I 1 0 ° C to +70°C 1 -55°C to +125°C 4.75 V to 5.25 V 4.50 V to 5.50 V I 1 STANDARD SCREENING (Conforms to MI L-STD-883 for Class C Parts) Step MIL-STD-883 Method Pre-Seal Visual Inspection 2010 Leyel Am2901 PC, DC Am2901DM. FM Conditions 100% 100% Stabilization Bake 1008 C 24-hour 150°C 100% 100% Temperature Cycle 1010 C -65°C to +150°C 10 cycles 100% 100% Centrifuge 2001 B 10,OOOG 100% • 100% Fine Leak 1014 A 5 x 10 -8 atm-cc/cm 3 100% • 100% Gross Leak Electrical Test Subgroups 1 and 7 1014 C2 Fluorocarbon 100% • 5004 See below for definitions of subgroups 100% See below for definitions of subgroups =5 =7 LTPD = 7 LTPD = 7 LTPD = 7 LTPD = 7 100% 100% Insert Additional Screening here for Class B Parts Group A Sample Tests Subgroup 1 Subgroup 2 Subgroup 3 5005 Subgroup 7 Subgroup 8 Subgroup 9 'Not applicable for Am2901PC =5 =7 LTPD = 7 LTPD = 7 LTPD = 7 LTPD = 7 LTPD LTPD LTPD LTPD ADDITIONAL SCREENING FOR CLASS B PARTS Step level MI L·STD·883 Method Burn·ln 1015 Electrical Test Subgroup 1 Subgroup 2 Subgroup 3 Subgroup 7 Subgroup 9 5004 Conditions D 160 ~~~:~min. Am2901DMB. FMB 100% 100% 100% 100% 100% 100% Return to Group A Tests in Standard Screening GROUP A SUBGROUPS ORDERING INFORMATION (as defined in MIL·STD-883, method 5005) Subgroup Package Type Temperature Range Order Number Molded DIP Hermetic 0 IP Hermetic 0 IP Hermetic Flat Pack Dice O°C to +70°C O°C to +70°C -55°C to +125°C -55°C to +125°C O°C to +70°C AM2901PC AM2901DC AM2901DM AM2901FM AM2901XC 8-04 10 11 Parameter Temperature DC DC DC Function Function 25°C Maximum rated temperature Minimum rated temperature 25°C Maximum and minimum rated temperature 25°C Maximum Rated Temeperature Minimum Rated Temperature Switching Switching Switching Am2901 ELECTRICAL CHARACTERISTICS OVER OPERATING RANGE (Unless Otherwise Noted) (Group A, Subgroups 1, 2 and 3) Parameters Description Test Conditions (Note 1) Min. 10H = -1.6mA YO, V" V2, V3 10H VOH I CEX Output HIGH Voltage Output Leakage Current for F = 0 Output VCC = MIN. VIN = VIH or VIL VCC = MIN., VOH VIN = VIH or VIL z -1.OmA. Cn +4 Output LOW Voltage VCC· MIN., VIN = VIH or VIL =-soo"A, F3 2.4 10H = -soo"A RAMO, 3, 00, 3 2.4 10H = -1.6mA, G 2.4 Volts =5.5V 250 0.5 10L = S.OmA, OVR, P 0.5 10L - 6.0mA, F3 RAMO. 3. 00. 3 0.5 Guaranteed input logical HIGH voltage for all inputs VIL Input LOW Level Guaranteed input logical LOW voltage for,all inputs VI Input Clamp Voltage VCC = MIN .• liN = -ISmA IlL IIH II Input LOW Current Input HIGH Current Input HIGH Current VCC = MAX. VIN =0.5V VCC = MAX. V IN = 2.7V 2.0 I 10ZH 10ZL lOS ICC Notes: 1. 2. 3'. 4. Off State (High Impedance) Output Current Output Short Circuit Current (Note 3) Volts -1.5 Volts -0.36 AO. A" A2, A3 -0.36 BO. B,. B2, B3 00,0,,02. 0 3 -0.36 10,1,,12;16,IS -0.36 13. 14. 15. 17 -0.72 -0.72 RAMO, 3. 00, 3 (Note 4) -O.S Cn -3.6 Clock,OE 20 Ao. A" 20 A2, A3 BO. B,. B2. B3 20 DO. 0,. 02. 03 40 10.ll.12.16. IS 20 13. 14. 15. 17 40 RAMO. 3. 00. 3 (Note 4) 100 Cn 200 1.0 VCC = MAX .• VIlli = 5.5V VCC = MAX. RAMO. 3. 00.3 VCC = 5.75V VO=0.5V 0.7 0.8 Clock.OE YO. V,. V2. V3 Volts Volts Military Commercial I "A 0.5 10L = 10mA, Cn +4, FmO Input HIGH Level VIH Units 2.4 2.4 10L = 16mA YO, V" V2, V3,G VOL Max. 2.4 10H = -800"A, OVR, P IOH Typ. (Note 2) Vo =2.4V 50 Vo -0.5V -50 Vo =2.4V (Note 4) 100 Vo -0.5V (Note 4) -800 YO. V,. V2. V3.G -15 Cn+4 -15 OVR.P -15 -40 -40 -40 F3 -15 -40 RAMO. 3. 00. 3 Military Commercial -15 mA ,.A rnA "A mA -40 280 rnA 280 .. For condItIons shown as MIN. or MAX .• use the appropriate value specified under Electricel Characteristics for the epplicable device type. Typical limits are at Vec = S.OV. 2S·C ambient and maximum loading. Not more than one output should be shorted et a time. Duration of the short circuit test should not exceed one second. These are three-state outputs internally connected to TTL inputs. Input characteristics are measured with 167SIn a state such that the three·state outpu\ is OFF. Power Supply Current VCC= MAX. 8-05 185 185 Am2901 GUARANTEED OPERATING CONDITIONS OVER TEMPERATURE AND VOLTAGE TABLE I Tables I, II, and III below define the timing requirements of the Am2901 in a system. The Am2901 is guaranteed to function correctly over the operating range when used within the delay and set·up time constraints of these tables for the appropriate device type. The tables are divided into three types of parameters; clock characteristics, combinational delays from inputs to outputs, and set-up and hold time requirements. The latter table defines the·time prior to the end of the cycle (i.e., clock LOW-to-HIGH transition) that each input must be stable to guarantee that the correct data is written into one of the internal registers. CYCLE TIME AND CLOCK CHARACTERISTICS TIME Am29010C,PC Am2901 OM, FM 105ns 120ns 9.5MHz 8.3MHz Read·Modify-Write Cycle (time from selection of A, B registers to end of cycle) Maximum Clock Frequency to Shift Q Register (50% duty cycle) The performance of the Am2901 within the limits of these tables is guaran~ed by the testing defined as "Group A, Subgroup 9" Electrical Testing. For a copy of the tests and limits used for subgroup 9, contact Advanced Micro Devices' Product Marketing. Minimum Clock LOW Time 30ns 30ns Minimum Clock HIGH Time 30ns 30ns Minimum Clock Period 105ns 120ns TABLE" MAXIMUM COMBINATIONAL PROPAGATION DELAYS (all in ns, CL oE;; 15pF) Am2901DC, PC (O°C to +70°C; 5V ±5%) ~ F rom Input Output Y F3 Cn +4 G,P F=O RL= OVR RAMO 470 Cn+4 G,P 120 95 90 110 75 65 80 55 90 75 60 40 30 - 90 70 70 75 60 65 65 75 65 70 - - 45 45 60 - - - 50 50 - - - 40/25 - - - - - - 65 - - - - - - - - 105 60 125 95 110 120 115 65 110 75 110 70 70 70 100 60 95 50 35 - - 60 50 - 30 40 60 55 65 65 65 80 65 1345 70 55 60 60 70 1678 55 - - - - - - - - - - 85 100 100 110 95 (Note 6) 115 SET-UP AND HOLD TIMES (all in ns) (Note 1) Notes - - 110 120 85 120 110 65 65 105 65 55 45 60 70 85 70 85 - 105 Am2901 DC, PC (O°C to +70°C, 5V ±5%) Am2901 DM,FM (-55°C to +125°C, 5'1£ ±10%) Hold Time 'Set-Up Time Hold Time 0 120 tpwL + 30 0 tpwL + 15 0 tpwL +15 0 D (arithmetic mode) D (I = X37) (Note 5) Cn 100 60 55 0 0 0 110 65 60 0 0 0 1012 85 0 90 0 1345 70 tpwL + 15 0 75 0 0 tpwL + 15 0 30 0 30 0 2,4 3,5 2,4 1678 RAMO, 3, 4 00, 3 - TABLE III Set-UpTime 105 tpwL + 30 A,a Source B Dest. - 60 80 OE Enable/Disable 40/25 A bypassing 60 ALU (I = 2xx) 03 80 65 80 85 From Input F3 Shift Outputs F=O RL= OVR RAMO 00 470 RAM3 - 85 1012 I Y 00 RAM3 03 A,a 110 D (arithmetic mode) 100 D (I = X37) (Note 5) 60 Cn 55 Clock Am2901DM, FM (-55°C to +125°C; 5V ±10%) Shift Outputs Not.: 1. Se. Figure 11 and 12. 2. If the B addr ... i. used a. a source operand, allow for the "A, B source" set-up time; if it is used only for the destination addr•••, use the uS dest." set-up time. 3. Wh.r. two numbe .. are shown, both must be met. 4. "tpwL" i. the clock LOW time. 5. OVO is the fastest way to load the RAM from the 0 inputs. This function is obtained with I = 337. 6. Using Q register as source operand in arithmetic mode. Clock is not nqrmally in critical speed path when Q is not a source. 8-06 Am2901A ELECTRICAL CHARACTERISTICS OVER OPERATING RANGE (Unless Otherwise Noted) (Group A, Subgroups 1,2, and 3) Data in bold face is changed from Am2901 Parameters Description Test Conditions (Note 1) Min. 10H = -1.6mA VOH Output HIGH Voltage VIN.= VIH or VIL 10H = -1.0mA.C n +4 10H = -SOOI'A. OVR. P 2.4 10H - -600IlA. F3 2.4 Output LOW Voltage 2.4 VCC = MIN .• VOH = 5.5V 250 VIN = VIH or VIL VCC= MIN .• VOL Volts 2.4 RAMO. 3. QO. 3 10H - -1.6mA. G Output Leakage Current for F = 0 Output YO. Yl. Y2. Y3 IOL - 20mA (COM'L) 0.5 10L = 16mA (MIL) 0.5 VIN = VIH G. F =0 10L = 16mA 0.5 or VIL Cn+4 10L = 10mA 0.5 OVR.P 10L = S.OmA 0.5 10L = 6.0mA 0.5 F3. RAMO. 3. Units 2.4 10H - -6001'A ICEX Max. 2.4 Yo. Yl. Y2. Y3 VCC = MIN. Typ. (Note 2) I'A Volts QO.3 Input HIGH Level VIH Guaranteed input logical HIGH 2.0 voltage for all inputs (Note 7) VIL Input LOW Level VI Input Clamp Voltage voltage for all inputs (Note 7) Input LOW Current IlL Volts Guaranteed input logical LOW Input HIGH Current VCC = MAX .• VIN = 0.5V AO. AI. A2. A3 -0.36 SO. Bl. B2. B3 -0.36 DO. 01. 02. 03 -0.72 10.ll. 12.16. I S 13. 14. 15. 17 -0.36 VCC = MAX .• VIN = 2.7V -O.S -~ Clock.OE 20 AO. AI. A2. A3 20 BO. Bl. B2. B3 20 00. 0 1. 0 2. 0 3 10. 11. 12. 16. IS 13. 14. 15. 17 20 40 RAMO. 3. QO. 3 (Note 4) 100 Cn 200 IOZL Output Current 40 VCC = MAX .• VIN = 5.5V 1.0 Y2. Y3 Off State (High Impedance) Vo = 2.4V 50 Vo - 0.5V -50 Vo - 2.4V VCC = MAX. mA -0.72 00. 3 (Note 4) YO. Yl. IOZH Volts -0.36 RAMO. 3. Input HIGH Current Volts Clock.OE Cn IIH O.S -1.5 .. VCC = MIN .• liN = -ISmA RAMO. 3 (Note 4) QO.3 Vo = 0.5V mA 100 -BOO (Note 4) lOS Output Short Circuit Current VCC = 5.75V. Vo = 0.5V (Note 3) YO. Yl. Y2. Y3. G -30 Cn+4 OVR.P -30 -85 -30 -85 F3 -30 -85 RAMO. 3. QO. 3 -30 Am2901APC. DC Power Supply Current ICC (Note 6) VCC= MAX. (See graph) -85 -85 TA-25°C 160 250 TA=0°Cto+70°C 160 265 TA-+70°C 160 220 160 280 160 190 TC - _55°C to Am2901AOM. FM +125°C TC-+125°C Notes: 1. 2. 3. 4. mA mA For conditions shown as MIN. or MAX., use the appropriate value specified under Electrical Characteristics for the applicable device type. Typical limits are at Vee = 5.0V, 2SoC ambient and maximum loading. Not more than one output should be shorted at a time. Duration of the short circuit test should not exceed one second. These are three~state outputs internally connected to TTL inputs. Input characteristics are measured with 1678 in a state such that the threestate output is OFF. 5. "MI L" = Am2901AXM. OM. FM. "COM'L" = Am2901AXC. PC. DC. 6. Worst case ICC is at minimum temperature. 7. These input levels provide zero noise immunity and should only be tested in a static, noise-free environment. 8-07 Am2901A SWITCHING CHARACTERISTICS OVER OPERATING RANGE TABLE IV CYCLE TIME AND CLOCK CHARACTERISTICS Tables IV, V, and VI below define the timing characteristics of the Am2901 A at 25°C over the operating voltage and temperature range_ The tables are divided into three types of parameters; clock characteristics, combinational delays from inputs to outputs, and set-up and hold time requirements_ The later table defines the time prior to the end of the cycle (Le_, clock LOW-to-H IGH transition) that each input must be stable to guarantee that the correct data is written into one of the internal registers_ TIME COMMERCIAL MILITARY 100 110 15MHz 12MHz Minimum Clock HIGH Time 30ns 30ns 30ns 30ns Minimum Clock Period lOOns 110ns Read-Modify-Write Cycle (time from selection of A, B registers to end of cycle) Maximum Clock Frequency to Shift Q Register (50% duty cycle) I = 432 or 632 Measurements are made at 1.5V with VI L = OVand VIH = 3.0V. For three-state disable tests, CL = 5.0pF and measurement is to O.5V change on output voltage level. Minimum Clock LOW Time Commercial = Am2901APC, DC, XC O°C to +70°C 4.75 to 5.25V Military = Am2901ADM, FM, XM -55°C to +125°C 4.50 to 5.50V TABLE V COMBINATIONAL PROPAGATION DELAYS (all in ns, CL = 50pF (except output disable tests)) COMMERCIAL ~ F Output rom Input F=O Y F3 C n +4 G,P RL= OVR 470 o (arithmetic mode) 80 45 80 45 40 75 45 - 65 35 - D (I = X37) (Note 5) Cn 40 30 20 50 - 55 30 55 1012 1345 55 55 1678 30 A,B OE Enable/Disable A bypassing ALU (I = 2xx) Clock S (Note 6) C n +4 G,Y- 85 50 85 50 70 40 100 65 45 - 35 60 25 55 - - 45 35 60 80 50 - 50 60 55 75 - 03 100 70 - - 35 70 65 55 80 - 75 70 80 - - - - 35 35 - - - - - - - - - - 65 55 85 75 85 35 95 65 30 45 55 50 70 65 60 50 75 55 50 70 65 75 - 60 60 60 55 - - - - - 30 30 35 - 35/25 - - - - - - - 40/25 - - 45 - - - - - - - 50 - 60 60 60 50 75 70 80 30 65 65 2,4 3,5 2,4 - - 90 60 - 100 tpw L+3O tpw L+16 0 110 tpw L+3O tpw L+16 Hold Time 0 1012 0 85 1345 80 0 85 tpw L+ 3O 0 tpw L+ 3O 0 25 0 25 0 4 00, 3 0 0 0 0 Set-Up Time 70 60 55 80 1678 RAMO, 3, - MILITARY Hold Time 0 0 0 0 0 0 D (arithmetic mode) 0(1 = X37) (Note 5) Cn - TABLE VI COMMERCIAL Set-Up Time A,B Source B Dest. F3 00 85 55 Notes Shift Outputs F=O RL= OVR RAMO 00 470 RAM3 03 Y RAMO RAM3 90 60 SET-UP AND HOLD TIMES (all in ns) (Note 1) From Input MILITARY Shift Outputs 75 65 60 Notes: 1. See Figure 1" 2_ If the 8 address is used as a source operand, allow for the "A, 8 source" set-up time; if it is used only for the destination address, use the "8 Dest" set-up time. 3. Where two numbers are shown, both must be met. 4. "tpwL" is the clock LOW time. 5. D V 0 is the fastest way to load the RAM from the D inputs. This function is obtained with 1=337. 6. Using Q register as source operand in arithmetic mode. Clock is not normally in critical speed path when Q is not a source. 8-08 Am2901A SET-UP AND HOLD TIMES (minimum cycles from each input) time prior to the clock until the hold time after the clock. The set-up times allow sufficient time to perform the correct operation on the correct data so that the correct ALU data can be written into one of the registers. Set-up and hold times are defined relative to the clock LOW-toHIGH edge. Inputs must be steady at ali times from the set-up 30 lOll A.B 80 Figure 11. Minimum Cycle Times from Inputs. Numbers Shown are Minimum Data Stable Times for Am2901ADC, in ns. See Table III for Detailed Information. Typical Icc Versus Temperature 300 200 r---,----,-,-,---..., .............. , ____ 1501---+--+---+"""'-+---l TYPICAL ICC ~ VCC~15.0IV 100 '------'-:---'--'----'_----' ··55 0 25 70 125 T - °c TEMPERATURE _ Figure 12. 8-09 °c Am2901B PRELIMINARY DATA ELECTRICAL CHARACTERISTICS OVER OPERATING RANGE (Group A, Subgroups 1, 2, and (Unless Otherwise Noted) 3) Typ Test Conditions (Note 1) Description Parameters Min 10H = -1.6mA (Note 21 Max Units 2.4 Yo, Yl, Y2, Y3 Output HIGH Voltage VOH VCC = MIN. VIN = VIH or VIL 2.4 IOH = -1.0mA. Cn +4 10H = -8001lA, OVR, P 2.4 10H - -6001lA, F3 2.4 10H = -6001lA Volts 2.4 RAMO, 3, QO, 3 10H = -1.6mA, G ICEX Output Leakage Current for F = 0 Output 250 ~L VCC = MIN .. Output LOW Voltage VOL 2.4 VCC = MIN., VOH = 5.5V VIN = VIH or VIL YO, Yl, Y2, Y3 0.5 10L = 16mA (Mill VIN = VIH G, F = 0 10L Cn+4 OVR,P = 16mA 10L = 10mA 0.5 or VIL 10L = 8.0mA 0.5 10L = 6.0mA 0.5 F3, RAMO, 3, IlA 0.5 - 20mA ICOM'L1 0.5 Volts QO,3 VIH Input HIGH Level VIL Input LOW Level VI Input Clamp Voltage Guaranteed input logical HIGH Volts 2.0 voltage for all inputs (Note 71 Guaranteed input logical LOW voltage for all Input LOW Current IlL input~ VCC = MAX., VIN = 0.5V Clock,OE -0.36 -0.36 BO, Bl, B2, B3 -0.36 DO, Dl, D2, D3 -0.72 10,11,12,16, IS -0.36 13,14,15,17 -0.72 00, 3 (Note 4) Input HIGH Current 10ZH Off State (High Impedance) 10ZL Output Current VCC = MAX., VIN = 2.7V -O.B 20 20 BO, Bl, B2, B3 20 DO, Dl, D2, D3 40 10,11,12,16. IS 20 13,14,15,17 40 RAMO, 3, QO, 3 (Note 4) 100 Cn 200 VCC - MAX., VIN = 5.5V 1.0 YO, Yl, Vo = 2.4V 50 Y2, Y3 Vo - 0.5V -50 RAMO, 3 Vo 2.4V (Note 4) QO.3 VO= 0.5V VCC = MAX. Output Short Circuit Current VCC = MAX. + 0.5V, Vo = 0.5V (Note 3) -SOO ~30 Cn+4 OVR,P -30 -85 -30 -85 F3 -30 -85 00, 3 TA-25°C Power Supply Current (Note 6) ICC Am2901 BPC. DC VCC = MAX. ISee Fig. 12) -85 YO, Yl, Y2, Y3, G RAMO, 3, TA - O°C to +70°C TA - +70°C -30 +125°C TC - +125°C Notes: 1. 2. 3. 4. mA -85 160 250 265 220 TC = -55°C to Am2901BDM. FM mA 100 (Note 4) lOS mA -3.6 AO, Al, A2, A3 II Volts AO, Al, A2, A3 Cn Clock,OE Input HIGH Current Volts -1.5 (Note 7) VCC = MIN., liN = -lSmA RAMO, 3, IIH O.S mA 265 19S For conditions shown as MIN. or M"AX .• USti the appropriate value specified under Electrical Characteristics for the applicable device type. Typical limits are at Vee = 5.0V, 25 C ambient and maximum loading. Not more than one output should be shorted at a time. Duration of the short circuit test should not exceed one second. These are three-state outputs internally connected to TTL inputs_ Input characteristics are measured with 1678 in a state such that the three state output is 0 F F. 5. "MIL" = Am29018XM, OM, FM. "COM'L = Am2901 axc,·pc, DC. 6. Worst case ICC is at minimum temperature. 7. These input levels provide zero noise immunity and should only be tested in a static, noise-free environment. 8-D10 Am2901B I. Typical Room Temperature Performance A. Cycle Time and Clock Characteristics. The tables below specify the typical performance of the Am2901 B at 25°C and 5.0V. All data are in ns, with inputs changing between OV and 3V at 1V/ns and measurements made at 1.5V. For guaranteed data, see following pages. Read-Modify-Write Cycle (from selection of A, B registers to end of cycle.) Maximum Clock Frequency to shift I = 432 or 632) a (50'7r Minimum Clock LOW Time duty cycle, 45ns 33MHz lOns Minimum Clock HIGH Time lOns Minimum Clock Period SOns B. Combinational Propagation Delays. CL SOpF = ~ From Input Y A, B Address 0 F3 Cn+4 G,P F=O OVR RAMO RAM3 00 03 38 41 39 33 44 44 50 22 23 24 20 28 29 31 - Cn 17 19 13 - 22 19 26 1012 30 30 29 27 34 34 38 - 1345 32 32 30 25 32 30 34 - 1678 17 - - - - - 16 16 A Bypass ALU (I = 2XX) 22 - - - - - - - ClockS 29 31 29 23 33 35 40 19 C. Set-up and Hold Times Relative to Clock (CP) Input. -' CP: Input A, B Source Address ~-- ~_-yI Set...up Time Ho!d Time Set-up Time Before H -+L After H -+ L Before L -+ H After L -+ H Ho!d Time 8 o (Note 3j 45 (Note 4) 0 B Destination Address 4 0 - 35 0 Cn - 26 0 1012 - 37 0 1345 - - 38 0 1678 0 RAMO, 3, QO, 3 - 0 Do Not Change po Not Change - 0 9 0 D. Output Enable/Disable Times. Output disable tests performed with CL = SpF and measured to O.SV change of output voltage level. Notes: 1. A dash indicates a propagation delay path or set-up time constraint does not exist. 2. Certain signals must be stable during the entire clock LOW time to avoid erroneous operation. This is indicated by the phrase "do not change". 3. Source addresses must be stable prior to the clock H -+ L transition to allow time to access the source data before the latches close. The A address may then be changed. The B address could be changed if it is not a destination; i.e. if data is not being written back into the RAM. Nonnally A and B are not changed during the clock LOW time. 4. The set-up time prior to the clock L -+ H transition is to allow time for data to be accessed, passed through the ALU, and retumed to the RAM. It includes all the time from stable A and B addresses to the clock L -+ H transition, regardless of when .the clock H -+ L transition occurs. 8-D11 Am29018 I. Guaranteed Commercial Range Performance A. Cycle Time and Clock Characteristics. Read-Modify-Write Cycle (from selection of A, B registers to end of cycte.) The tables below specify the guaranteed performance of the Am2901 B over the commercial operating range of O°C to + 70°C, with Vcc from 4.7SV to S.2SV. All data are in ns, with inputs switching between OV and 3V at 1 V/ns and measurements made at 1.SV_ All outputs have maximum DC load. Maximum Clock Frequency to shift I = 432 or 632) This data applies to the following part numbers: Am2901BPC Am2901BDC a (50'7. duty cycle. 69ns 16MHz Minimum Clock LOW Time 30ns Minimum Clock HIGH Time 30ns Minimum Clock Period 69ns B. Combinational Propagation Delays. CL = 50pF ~ From Input V F3 Cn+4 G,P F=O OVR RAMO RAM3 00 03 A. B Address 60 61 59 50 70 67 71 - 0 38 36 40 33 48 44 45 - Cn 30 29 23 - 37 29 38 - 1012 50 47 45 45 56 53 57 - 1345 49 48 44 45 54 49 53 - 1678 28 - - - - - 27 27 A Bypass ALU (I = 2XX) 37 - - - - - - - ClockS 49 48 47 37 58 55 59 29 C. Set-up and Hold Times Relative to Clock (CP) Input. ~K:---- ~ CP: Input _------:1 L- Set-up Time Before H'" L Hold Time After H'" L Set-up Time Before L'" H Hold Time After L'" H A. B Source Address 20 o (Note 3) 69 (Note 4) 0 B Destination Address 9 0 - - 51 0 Cn - - 39 0 1012 - - 56 0 - 55 0 1345 r---- 11 1678 RAMO. 3, aD. 3 - 0 Do Not Change Do Not Change - 0 16 0 D. Output Enable/Disable Times. Output disable tests performed with C L = SpF and measured to O.SV change of output voltage level. Notes: 1. A dash indicates a propagation delay path or set-up time constraint does not exist. 2_ Certain signals must be stable during the entire clock LOW time to avoid erroneous operation. This i" indicated by the phrase "do not change" 3. Source addresses must be stable prior to the clock H ... L transition to allow time to access the source data before the latches close. The A address may then be changed. The B address could be changed if it is not a destination; i.e. if data is not being written back into the RAM. Normally A and B are not changed during the clock LOW time. 4. The set-up time prior to the ~Iock L ... H transition is to allow time for data to be accessed, passed through the ALU, and retumed to the RAM. It includes all the time from stable A and B addresses to the clock L'" H transition, regardless of when the clock H'" L transition occurs. 8-D12 Am29018 II. Am2901 B Guaranteed Military Range Performance A. Cycle Time and Clock Characteristics. Read-Modily-Write Cycle (from selection of A, B registers to end of cycle. The tables below specify the guaranteed performance of the Am2901 B over the military operating range of -55°C to + 125°C, with V cc from 4.SV to S.SV. All data are in ns, with inputs switching between OV and 3V at 1 V/ns and measurements made at 1.SV. All outputs have maximum DC load. Maximum Clock Frequency to shift I ; 432 or 632) This data applies to the following part numbers: Am2901 BDM Am2901BFM a (50 rl, duty cycle, 88ns 15MHz Minimum Clock LOW Time 30ns Minimum Clock HIGH Time 30ns Minimum Clock Period 88ns B. Combinational Propagation Delays. CL SOpF = ~ From Input Y F3 Cn+4 G,P QO F=O OVR RAMO RAM3 Q3 A. B Address 82 84 80 70 90 86 94 - D 44 38 40 34 50 45 48 - Cn 34 32 24 - 38 31 39 - 1012 53 50 47 46 59 55 58 - 1345 53 50 46 45 58 50 55 - 1678 29 - - - - - 27 27 50 - - - - - - - 53 50 49 41 63 58 61 31 A Bypass ALU (I; 2XX) ClockS ~- C. Set-up and Hold Times Relative to Clock (CP) Input. ~~-- CP: Input A, B Source Address -- ~r Set-up Time Before H -+ L Hold Time After H -+ L Set-up Time Before L -+ H Hold Time After L -+ H 20 o (Note 3) 88 (Note 4) 0 B Destination Address 9 D - - 55 0 Cn - - 42 0 1012 - - 58 0 1345 - - 58 0 1678 14 RAMO, 3, ao, 3 - Do Not Change 0 Do Not Change - 0 18 3 L-_ D. Output Enable/Disable Times. Output disable tests performed with C L = SpF and measured to O.SV change of output voltage level. Notes: 1. A dash indicates a propagation delay path or set-up time constraint does not exist. 2. Certain signals must be stable during the entire clock LOW time to avoid erroneous operation. This is indicated by the phrase "do not change". 3. Source addresses must be stable prior to the clock H -+ L transition to allow time to access the source data before the latches close. The A address may then be changed. The B address could be changed if it is not a destination; Le. if data is not being written back into the RAM. Normally A and B are not changed during the clock LOW time. 4. The set-up time prior to the clock L -+ H transition is to allow time for data to be accessed, passed through the ALU. and retumed to the RAM. It includes all the time from stable A and B addresses to the clock l-+ H transition. regardless of when the clock H -+ L transition occurs. 8-D13 Am2902A MAXIMUM RATINGS (Above which the useful life may be impaired) Storage Temperature Temperature (Ambient) Under Bias Supply Voltage to Ground Potential -O.5V·to +7.0V DC Voltage Applied to Outputs for HIGH Output State -0.5V to +VCC max. DC Input Voltage -O.5V to +5.5V DC Output Current, I nto Outputs 30 rnA DC Input Current -30 rnA to +5.0 rnA ELECTRICAL CHARACTERISTICS OVER OPERATING TEMPERATURE RANGE Am2902Axe TA Am2902AXM TA Parameters = oOe to +7oo e = _55°e to +125°e Vee = 5.0V ±5% (eOM'L) Vee = 5.0V ±10% (MIL) Description MIN. = 4.75V MIN. = 4.50V Test Conditions INote 1) Vcc = MIN., IOH = -lmA VIN = VIH or VIL VOH Output HIGH Voltage VOL Output LOW Voltage Vcc = MIN., IOL = 20mA VIN = VIH or VIL VIH Input HIGH Level Guaranteed input logical HIGH voltage for all inputs VIL Input LOW Level Guaranteed input logical LOW voltage for all inputs VI Input Clamp Voltage Vee, = MIN., liN I 1 (Unless Otherwise Noted) MAX. = 5.25V MAX. = 5.50V Typ. Min. (Note 2) MIL 2.5 3.4 COM 2.7 3.4 Max. Volts 0.5 2.0 Input LOW Current = -18mA VCC = MAX., VIN = 0.5V Input HIGH Current VCC = MA;(., VIN = 2.7V II Input HIGH Current VCC = MAX., VIN = 5.5V ISC Output Short Circuit (Note 3) VCC = MAX., VOUT Power Supply Current ICC Notes: 0.8 Volts -1.2 Volts -2 P3 -4 P2 -6 -8 PO, Pl, G3 IIH GO, G2 -14 Gl -16 Cn 50 P3 100 P2 150 PO, Pl, G3 200 GO,G2 350 Gl 400 = O.OV -40 mA -100 mA VCC= MAX. MIL 69 99 All Outputs LOW COM'L 69 109 VCC= MA". All Ouputs HIGH MIL 35 COM'L 35 Description Min. Typ. Max. 4.5 7 G"/Pi --+ Cn+i tpHL 4.5 7 tplH 5 7.5 7 10.5 4.5 6.5 tpHL 6.5 10 tplH 6.5 10 7 10.5 Gi/Pi--+ G tpHL tpHL J.lA mA mA 1. For conditions shown as MIN. or MAX., use the appropriate value specified under Electrical Characteristics for the applicable device type. 2. Typical limits are at VCC = 5.0V, 25°C ambient and maximum loading. 3. Not more than one output should be shorted at a time. Duration of the short circuit test should not exceed one second. Parameters tplH mA 1.0 SWITCHING CHARACTERISTICS (TA = +25°C, Vee = 5.0V) tplH Volts Volts Cn IlL Units Pi --+ j5 C n --+ Cn+i 8-D14 Units Test Conditions ns ns I ns ns CL RL I = = 15pF 2800 Am2903 Am2903 OPERATING RANGE PIN Vce Temperature TA = O'C to + 70'e Te = -55'Cto +125'C Vee= 5.0V ::!:5o/r (MIN. = 4.75V. MAX. = 5.25V) Vee = 5.0V ±10o/r (MIN. = 4.50V. MAX. = 5.50V) DC CHARACTERISTICS OVER OPERATING RANGE Parameters Description Output HIGH Voltage VO H Output Leakage Current for Z Output (Note 4) ICEX Typ. Vee = MIN. VIN = V IH or V IL 10H = =-1.6mA YO-Y3 • GIN 2.4 10H = =-SOO/LA OB O_3 . PIOVA SIOo. S10 3. 0100. 0103. WAITE. C n +4 2.4 Output LOW Voltage (Note 2) Vee = MIN. VIN = VIH = or V IL Max. Units Vo~s Vee = MIN .• VO H = 5.5V V IN = VIH or VIL 250 IOL = 20mA (COM'L) Yo. Y,. Y2 Y3. Z VOL Min. Test Conditions (Note 1) 0.5 10L = 16mA (MIL) 10L = 12mA (COM'L) DBa. DB,. OB2. 0B 3 10L = S.OmA (MIL) GIN 10L = lSmA P/OVA 10L = lOmA /LA 0.5 I 0.5 Volts 0.5 C n + 4 • SIOo S103.0100 10L = S.OmA 0103. WRITE 0.5 I Input HIGH Level . Guaranteed input logical HIGH voltage for all inputs (Note '6) VIL Input LOW Level Guaranteed input logical LOW voltage for all inputs (Note 6) O.S Volts VI Input Clamp Voltage Vee = MIN .• liN = -lSmA -1.5 Volts V IH Input LOW Current IlL VCC = MAX .• V IN = 0.5V (Note 4) Volts 2.0 Cn 2.50 Yo. Y,. Y2. Y3 LOS 10 • I,. 12• 13• 14. OAo. OA,. OA 2. OA3 • SIOo S103. 0100. 0103. MSS. DBa. DB,. OB 2.OB3 0.72 All other inputs 0.36 mA --'". Input HIGH Current IIH Vce = MAX .. V IN = 2.7V (Note 4) Cn 120 Yo. Y,. Y2. Y3 110 10-14. OAO-OA 3 SIO o. S10 3• 0100. 0103. OBo_3• MSS 40 /LA 90 All other inputs In!'lut HIGH Current II Off State 10ZH (HIGH Impedance) Output Current 10ZL los Output Short Circuit Current (Note 3) ICC Power Supply Current (Note 5) 20 Vec = MAX .• V IN = 5.5V Vec = MAX .• (Note 4) 1.0 YO-Y3 OBO_3• 0100. 0100. SIO o • 8103. MS8/1S Vo = 2.4V 110 Vo = 0.5V -1130 Vo = 2.4V . -770 -30 Vo = 0.5V TA = 25'C COM'L Vee = MAX. MIL Notes: t. 2. 3. 4. -85 220 TA = 010 70'C /LA 90 Vo = 0.5V Vce = MAX + 0.5V mA mA 335 350 TA = 70'C 291 Te = -55 to 125'C 395 Te = 125'C 25S mA For conditions shown as MIN. or MAX.. use the appropriate value specified under Electrical Characteristics for the applicable device type. Typical limits are at vee ~ 5.0V. 25'C ambient and maximum loading. Not more than one output should be shorted at a time. Duration of the short circuit test should not exceed one second. YO-3. 060-3. 510 0.3. Q100.3 and WRITE/M5S are three state outputs internally connected to TTL inputs. Z is an open-collector output internally connected to a TTL input. Input characteristics are measured under conditions such that the outputs are in the OFF state. 5. Worst case Icc is at minimum tenlperature. 6. These input levels provide zero noise immunity and should only be tested in a static. noise-free environment. 8-D15 Am2903 SWITCHING CHARACTERISTICS (Typical Room Temperature Performance) Tables I, II, and III define the nominal timing characteristics of the Am2903 at 25°C and 5.0V. The Tables divide the parameters into three types: pulse characteristics for the clock and write enable, combinational delays from input to output, and set-up and hold times relative to the clock and write pulse. TABLE I Write Pulse and Clock Characteristics Time Measurements are made at 1.5V with V1L = OV and V1H = 3.0V. For three-state disable tests, CL '= 5.0pF and measurement is to 0.5V change on output voltage level. Minimum Time CP and WE both LOW to write 30ns Minimum Clock LOW Time 30ns Minimum Clock HIGH Time 50ns TABLE II Combinational Propagation Delays, All In ns. Outputs Fully Loaded. CL = SOpf (except output disable tests) ~t From Input SI03 SI03 (Parity) Y Cn + 4 G,P Z N OVR DB WRITE QIOo, QI0 3 SIOo A, B Addresses (Arith. Mode) 65 60 55 75 64 70 33 - - 61 69 87 A, B Addresses (Logic Mode) 56 - 46 67 56 - 33 - - 55 64 81 DA, DB Inputs (Logic Mode) 39 - 25 48 38 - - - - 36 47 56 DA, DB Inputs (Arith. Mode) 39 37 26 52 38 51 - - - 36 47 60 EA 44 38 29 54 44 53 - - - 42 52 Cn 25 21 - 39 20 38 - - -- 21 25 10 39 35 24 48 37 48 - "15 - 41 46 14321 45 43 32 55 44 55 - "17 - 45 51 18765 25 - - 37 - - - 18 22 24 27 48 lEN - - - - - - - 10 - - - - OEB Enable/Disable - - - - - - 7 - - - - - OEY Enable/Disable 10 - - - - - - - - - - - SIO o, SI03 13 - - - - - - - - - 12 18 Clock 58 52 40 72 56 72 24 - 28 55 63 76 'Applies only when leaving special functions. TABLE III Set-Up and Hold Times (All in ns) CAUTION: READ NOTES TO TABLE III. NA = Not Applicable; no, timing constraint. HIGH-ta-LOW Input With Respect to to this Signal LOW-ta-HIGH ~-~ Set-up Hold Set-up Hold I Comment y Clock NA NA 10 0 To store Y in RAM or 0 WE HIGH Clock 5 Note 2 Note 2 0 To Prevent Writing WE LOW Clock NA NA 30 0 To Write into RAM A,S as Sources Clock 20 0 NA NA -- -- See Note 3 B as a Destination Clock and WE both LOW 0 Note 4 Note 4 0 To Write Data only into the Correct B Address 0100 ,0103 Clock NA NA 10 0 To Shift 0 18765 Clock 30 Note 5 Note 5 0 lEN HIGH Clock 10 Note 2 Note 2 0 To Prevent Writing lEN LOW Clock NA NA 10 0 To Write into 0 8-016 Am2910 MAXIMUM RATINGS (Above which the useful life may be impaired) Storage Temperature Temperature (Ambient) Under Bias Supply Voltage to Ground Potential DC Voltage Applied to Outputs for High Output State -0.5V to +7.0V -0.5 V to Vee max. -0.5V to +5.SV DC Input Voltage DC Output Current. Into Outputs 30mA -30 mA to +5.0 mA DC Input Current ELECTRICAL CHARACTERISTICS The Following Conditions Apply Unless Otherwise Specified: o MAX. = 5.25V MIN. = 4.75V T A = oOe to +70 e Vee = 5.0V ±5% MAX. = 5.50V MIN. = 4.50V Vee = 5.0V 110% Te = -55°e to +125°e Mil DC CHARACTERISTICS OVER OPERATING RANGE eOM'l ParameJers Description Test Conditions (Note 1) Vec = MIN .• IOH = -1.6mA VIN = VIH or Vil .-f-Vce = MIN. YO-l1. IOl Output HIGH Voltage vOH I Output LOW Voltage VOL VIN Typ. (Note 2) Max. VECT, MAP, FUll, IOl Units Volts 2.4 = 12mA 0.5 Volts = SmA -'+GUaranteed Input Logical HIGH voltage for all inputs Input HIGH Level (Note 4) VIH I PL. = VIH or Vil Min. Volts 2.0 - 1-- Vil Input lOW level (Note 4) VI Input elamp Voltage Guaranteed input logical lOW voltage for all inputs -- Input lOW Current III Vce VCC = MIN., = -lSmA liN = MAX., O.S = 0.5V VIN -1.5 00-11 -0.S7 el. CCEN -0.54 10-3,~,R05 CC -0.72 -1.31 CP -2.14 Input HIGH Current Vec = MAX., = 2.7V VIN II Input HIGH Current VCC = MAX., VIN ISC Output Short Circuit Current (Note 3) Vec=MAX. Output OFF Current Vec = MAX. OE = 2.4V IOZL IOZH --_ ... _-_ .. _--- ---- CI, CCEN 30 10-3, OE. RlO 40 CC 50 CP 100 = 5.5V -30 VOUT = 0.5V VOUT - 2.4V Am291 OPC, DC Power Supply Current Vec = MAX IJ.A mA -S5 mA IJ.A SO 19S 320 T A - o°c to +70°C 344 TA = +70·C 2S0 Te = -SSoC to Am29100M, FM mA 1.0 -SO TA = 25°e ICC Volts SO 00-11 IIH Volts .- mA 340 +125°C Te = +12Soe 227 Notes: 1. For conditions shown as MIN. or M AX .. use the appropriate value specified under Electrical Characteristics for the appl icable devic.8 type. 2. TYPical limits are at Vee = 5.0V. 25°e ambient and maximum loading. 3. Not mort! than one output should be shorted at a time. Duration of the short circuit test should not exceed one second. 4. These input levels provide no guaranteed noise immUnity and should only be tested In a static·, noise-free environment. INPUTS 3.0" I L INPUT I CLOCK TO --OUTPUT DELAV TO OUTPUT DELAY See Tables A for ts and th for various inputs. See Tables B for combinational delays from clock and other inputs to outputs. See Figure 5 for timing of a typical CCU cycle. - Figure 2. Switching Waveforms. 8-017 Am2910 SWITCHING CHARACTERIST1CS The tables below define the Am291 0 switching characteristics. Tables A are set-up and hold times relative to the clock LOW-to-H IGH transition. Tables B are combinational delays. Tables e are clock requirements. All measurements are made at 1.5V with input levels at OV or 3V. All values are in ns. TYPICAL ROOM TEMPERATURE CHARACTERISTICS (T A = 25°C, Vee Input ts th Di~R 9 3 Di~PC 34 1 10- 13 64 0 CC 46 0 CCEN 49 LI CI 26 2 RLD 18 2 Input DO-011 Y PL, VECr, MAP Full 14 10- 13 40 CC 21 CCEN 23 29 CP All other I 29 26 GUARANTEED ROOM TEMPERATURE CHARACTERISTICS lTA ts th Di~R Y Pl, VECr, MAP FiiIf CCEN CCEN = 25°e, Vee = 5.0V, CL = 50pF) Minimum Clock LOW Time (Clock periods for other instructions are determined by external conditions.! CP(note) 1= 8, 9, 15 CI RLD Note: These instructions are conditional on the counter. Delays from CP to outputs will be longer if the instruction prior to the clock was 4 or 12 or RLD was LOW. Minimum Clock Period, 1=14 CC CC (Clock periods for other instructions a'e determined by external conditions'! Minimum Clock Period, 1=8,9,15 10- 13 10- 13 30 Minimum Clock HIGH Time DO-Oll Di~PC 30 Minimum Clock HIGH Time C. Clock Requirements B. Combinational Delays Input Minimum Clock LOW Time Minimum Clock Period, 1=14 OE Input = 50pF) Minimum Clock Period, 1=8.9, 15 27 CP(note) 54 1= 8, 9,15 A. Set-up and Hold Times CL C. Clock Requirements B. Combinational Delays A. Set-up and Hold Times = 5.0V, Note: These instructions are conditional 0:1 the counter. Delays from CP to outputs will b,~ longer if the instruction prior to the clock was 4 or 12 or RLD was LOW. CP All other I OE GUARANTEED CHARACTERtSTICS OVER COMMERCIAL OPERATING RANGE Am2910PC, DC (TA = oOe to+70°C, Vec = 4.75V to 5.25V, eL = 50pF) Input ts th Di~R 15 5 Di~PC 58 3 10- 13 100 0 CC 80 0 CCEN 85 0 CI 45 5 RLD 35 3 C. Clock Requirements B. Combinational Delays A. Set·up and Hold Times Full Minimum Clock LOW Time 50 - - Minimum Clock HIGH Time 30 45 48 - - 40 - - CP(note) 92 1= 8, 9,15 - - CP All other I - 50 - - Input Y Do-D11 25 10-13 65 CC ei!EN 65 OE Pl, VECT, MAP - Minimum Clock Period, 1=8, 9,15 Minimum Clock Period, 1=14 (Clock periods for other instructions are determined by external conditions.) Note: These instructions are conditional on the counter. Delays from CP to outputs will be longer if the instruction prior to the clock was 4 or 12 or RLD was LOW. GUARANTEED CHARACTERISTICS OVER MILITARY OPERATING RANGE Am2910DM, FM (TC = _55°C to +125°C, Vee = 4.5V to 5.5V, CL = 50pF) Input Di~R Di~PC 10. 13 CC CCEN CI RLD ts th C. Clock Requirements B. Combinational Delays A. Set·up and Hold Times Input Y Pl, VECT, MAP Full Minimum Clock LOW Time Minimum Clock HIGH Time 00- 0 11 Minimum Clock Period, 1=8,9, 15 10- 13 Minimum Clock Pellod, 1=14 CC CCEN (Clock p~riods for other instructions are determined by external conditions. I CP(note) 1= 8, 9, 15 CP All other I Note: These instructions are conditional on the counter. Delays from CP to outputs will be longer if the instruction prior to the clock was 4 or 12 or RLD was LOW. OE 8-D18 Am2909 • Am2911 for the control of the push/pop stack. Figure 6 shows in detail the effect of So, S1, FE and PUP on the Am29Q9. These four signals define what address appears on the Y outputs and what the state of all the internal registers will be following the clock LOW-to-HIGH edge. In this illustration, the microprogram counter is assumed to contain initially some word J, the address register some word K, and the four words in the push/ pop stack contain Ra through Rd. OPERATION OF THE Am2909/Am2911 Figure 5 lists the select codes for the multiplexer. The two bits applied from the microword register (and additional com· binational logic for branching) determine which data source contains the address for the next microinstruction. The contents of the selected source will appear on the Y outputs. Figure 5 also shows the truth table for the output control and Output Control Address Selection OCTAL S, So 0 1 L L H H L H L H 2 3 ORi SOURCE FOR Y OUTPUTS SYMBOL Microprogram Counter Register Push-Pop stack Direct inputs ZERO OE Vi X H L L L Z X X J,LPC REG STKO Di L H H H L L H Source selected by So 5, Z = HIgh Impedance Synchronous Stack Control H L X = High = Low = Don't Care FE PUP PUSH-POP STACK CHANGE H L X H L L No change Increment stack pOil'lter, then push current PC onto 5TKO Pop stack (decrement stack pointer) Figure 5. CYCLE FE, PUP S1, So, REG J J+1 K K Ra Rb Rb Rc Rc Rd Rd Ra - Pop Stack End Loop J J+1 K K Ra J Rb Ra Rc Rb Rd Rc J - Push J,lPC Set-up Loop J J+1 K K Ra Ra Rb Rb Rc Rc Rd Rd - Continue Continue J K+1 K K Ra Rb Rb Rc Rc Rd Rd Ra K - Pop Stack; Use AR for Address End Loop J K+1 K K Ra J Rb Ra Rc Rb Rd Rc - Push J,lPC; .Jump to Address in AR JSR AR J K+1 K K Ra Ra Rb Rb Rc Rc Rd Rd K - Jump to Address in AR JMP AR J Ra+1 K K Ra Rb Rb Rc Rc Rd Rd Ra Ra Jump to Address in STKO; Pop Stack RTS K K Ra J Rb Ra Rc Rb Rd Rc Ra - Jump to Address in STKO; Push J,lPC Ra Jump to Address in STKO Stack Ref (Loop) Pop Stack; Jump to Address on D End Loop STKO STK1 STK2 STK3 YOUT PRINCIPLE USE J,lPC COMMENT N N+1 o0 N N+1 000 1 N N+1 001 X N N+1 o N N+1 o1 N N+1 o1 N N+1 1 000 N N+1 1 001 J - Ra+1 N N+1 101 X - Ra+1 K K Ra Ra Rb Rb Rc Rc Rd Rd N N+1 1 1 0 0 J D+1 K K Ra Rb Rb Rc Rc Rd Rd Ra - N N+1 1 1 0 1 J D+1 K K Ra J Rb Ra Rc Rb Rd Rc - Jump to Address on D; Push J,lPC JSR D N N+1 1 1 1 X J K K Ra Ra Rb Rb Rc Rc Rd Rd D - Jump to Address on D JMP D 0 0 - 1 0 0 0 1 1 X - - - J D+1 J J K - D D x = Don't care, 0 = LOW, , = HIGH, Assume C n = HIGH Note: STKO is the location addressed by the stack pointer. Figure 6. Output and Internal Next-Cycle Register States for Am2909/Am2911. 8-019 Am2909 • Am2911 Figure 7 illustrates the execution of a subroutine using the Am2909. The configuration of Figure 3 is assumed. The instruction being executed at any given time is the one contained in the microword register (J.tWR). The contents of the IlWR also controls (indirectly, perhaps) the four signals So, S1, FE, and PUP. The starting address of the subroutine is applied to the 0 inputs of the Am2909at the appropriate time. routine at A". At the time T 2, this instruction is in the IlWR, and the Am2909 inputs are set-up to execute the jump and save the return address. The subroutine address A is applied to the 0 inputs from the IlWR and appears on the Y outputs. The first instruction of the subroutine, I(A), is accessed and is at the inputs of the IlWR. On the next clock transition, I(A) is loaded into the IlWR for execution, and the return addr~ss J+3 is pushed onto the stack. The return instruction is executed at T 5. Figure 8 is a similar timing chart showing one subroutine linking to a second, the latter consisting of only one microinstruction. In the columns on the left is the sequence of microinstructions to be executed. At address J+2, the sequence control portion of the microinstruction contains the comand "Jump to subCONTROL MEMORY Execute Cycle Execute Cycle Microprogram Address Sequencer Instruction J-1 TO T, T2 T6 T7 J+1 J+2 J+3 J+4 JSR A Signals - I(AI RTS T, T2 rL rL rL 0 T3 T4 Ts T6 T7 0 Tg Ta n- rL rL ru rL ruru 3 L H A 0 H H H H X X X X 2 L L X 0 H X X 0 H X X 0 FE PUP D X X X X /lPC 5TKO 5TK1 5TK2 5TK3 J+1 J+2 J+3 - A+2 J+3 A+3 J+3 J+5 - A+1 J+3 J+4 - - - - - - - - - - - - - - - - Am2909 Output V J+1 J+2 A A+1 A+2 J+3 J+4 J+5 ROM Output (V) I(J+1) JSR A I(A) I(A+1) RTS I (J+3) I (J+4) I (J+5) Contents of/lWR (Instruction being executed) /lWR I(J) I(J+1) JSR A I(AI I(A+1) RTS I(J+3) I (J+4) S,.50 Am2909 Inputs (from /lWR) Internal Registers A A+1 A+2 To Clock en = HIGH Figure 7. Subroutine Execution. CONTROL MEMORV Execute Cycle TO T, T2 Tg Microprogram Address J-1 J J+1 J+2 J+3 - - T3 T4 T5 T7 TS A A+1 A+2 A+3 A+4 T6 Sequencer Instruction JSR A - JSR B RTS - - - B RTS - - - - Execute Cycle TO T1 T2 T3 T4 TS TS T7 Ta Tg 0 H X X 0 H X X 3 L H A 0 H X X 0 H X X 3 L H B 2 L L X 0 H X X 2 L L X 0 H X X /lPC 5TKO 5TK1 5TK2 5TK3 J+1 J+2 J+3 - - A+1 J+3 A+2 J+3 A+3 J+3 A+4 J+3 A+5 J+3 - - B+1 A+3 J+3 J+4 - - - - - - - Am2909 Output Clock Signals Am2909 Inputs (from /lWR) Internal Registers 5,.50 FE PUP D n.JIlJIlJrL rururu ruru ru - - - - - - - V J+1 J+2 A ROM Output (V) I(J+1) JSR A Contents of/lWR (I nstruction being executed) /lWR I(J) I(J+1) - - - A+1 A+2 B A+3 A+4 J+3 J+4 I(A) 1(A+1) JSR B RTS I(A+3) RTS I(J+3) I (J+4) JSRA I(A) I(A+1) JSR B RTS I(A+31 RTS I(J+3) Figure 8. Two Nested Subroutines. Routine B is Only One Instruction. 8-020 - - - c n = HIGH Am2909/Am2911 MAXIMUM RATINGS (Above which the useful life may be impaired) Storage Temperature Temperature (Ambient) Under Bias -0.5 V to +7.0 V -0.5 V to +Vcc max. -0.5 V to +7.0 V 30mA -30 mA to +5.0 mA Supply Voltage to Ground Potential DC Voltage Applied to Outputs for HIGH Output State DC Input Voltage DC Output Current, Into Outputs DC Input Current OPERATING RANGE Ambient Temperature PIN Vcc Am2909/29110C, PC 4.7SV to S.2SV Am2909/2911 OM, FM 4.S0V to S.SOV STANDARD SCREENING (Conforms to MI L-STD·883 for Class C Parts) Step Pre·Seal Visual Inspection Level Am2909/Am2911PC. DC Am2909/Am2911DM. FM 100% 100% MIL·STD·883 Method 2010 B 1008 C 24·hour lS0°C 100% 100% 100% 100% • 100% Stabi lization Bake Conditions 100% Temperature Cycle 1010 C -6SoC to +lS0°C 10 cycles Centrifuge 2001 B 10,000 G A S x 10-8 atm·cc/sec C2 Fluorocarbon 100% • 100% • 100% 100% See below for definitions of subgroups 100% 100% =S =7 =7 LTPD = 7 LTPO = S LTPD = 7 LTPD = 7 LTPD = 7 LTPD = 7 LTPD=7 Fine Leak 1014 Gross Leak 1014 Electrical Test Subgroups 1 and 7 SOO4 Insert Additional Screening here for Class B Parts Group A Sample Tests Subgroup 1 Subgroup 2 Subgroup 3 Subgroup 7 Subgroup 8 LTPD LTPD LTPD See below for definitions of subgroups SOOS LTPD = 7 LTPD = 7 Subgroup 9 • Not applicable for Am2909PC or Am2911PC. ADDITIONAL SCREENING FOR CLASS B PARTS MI L·STD·883 Method Step Burn·ln 1015 Electrical Test Subgroup 1 Subgroup 2 Subgroup 3 Subgroup 7 Subgroup 9 SOO4 Conditions D Level Am2909/Am2911DMB. FMB 12SoC 160 hours min. 100% 100% 100% 100% 100% 100% Return to Group A Tests in Standard Screening GROUP A SUBGROUPS (as defined in MIL·STD-883, method 5005) Subgroup Parameter DC DC DC Function Function 10 11 Switching Switching Switching Temperature 2SoC Maximum rated temperature Minimum rated temperature 2SoC Maximum and minimum rated temperature 2SoC Maximum Rated Temeperature Minimum Rated Temperature 8-D21 Am2909 • Am2911 ELECTRICAL CHARACTERISTICS OVER OPERATING RANGE (Unless Otherwise Noted) Typ. Paramatars Test Conditions Description Vcc= MIN., VOH VOL Output HIGH Voltage VIN = VIH or VIL Output LOW Voltage (Note ,) Min. MIL I 10H = -1.0mA 2.4 COM'L I 10H = -2.6mA 2.4 Max. (Note 2) Volts 10L =4.0mA 0.4 VCC = MIN., 10L =S.OmA 0.45 VIN = VIH or VIL 10L = 12mA Input HIGH Level Guaranteed input logical HIGH voltage for all inputs VIL Input LOW Level Guaranteed input logical LOW voltage for all inputs VI Input Clamp Voltage Input LOW Current IlL VIN =0.4V VCC= MAX., Input HIGH Current IIH VIN = 2.7V MIL 0.7 COM'L O.S Push/Pop, OE -0.72 Others (Note 6) -0.36 Cn 40 Push/Pop 40 Others (Note 6) 20 0.2 Others (Note 6) 0.1 Output Short Circuit Current (Note 3) VCC = MAX. Power Supply Currr.nt VCC = MAX. (Note 4) Output OF F Current -LOS Cn, Push/Pop lOS 10ZH -1.5 Cn VIN = 7.0V Input HIGH Current ICC I I Volts VCC= MAX., II 10ZL 2.0 VCC = MIN., liN = -lSmA VCC = MAX., Volts 0.5 (Note 5) VIH Units I Y O -Y 3 -30 -100 1 C n +4 -30 -S5 SO 130 VCC= MAX., VOUT=0.4V -20 0E=2.7V VOUT=2.7V 20 Volts Volts rnA JJA rnA rnA rnA JJA Notes: ,. 2. 3. 4. For conditions shown as MIN. or MAX .• use the appropriate value specified under Electrical Characteristics for the applicable device tYpe. Typical limits are at VCC = 5.0V. 25°C ambient and maximum loading. Not more than one output should be shorted at a time. Duration of the short circuit test should not exceed one second. Apply GNO to C n , RO. R" R2. R3, ORO. OR" OA 2 • OR3. DO, 0,. 02. and 03' Other inputs open. All outputs open. Measured after a LOW-to-HIGH clock transition_ 5. The 12mA guarantee applies only to YO, Y 1, y 2 and Y 3' 6. For the Am29", 0i and Ri are Internally connected. Loading is doubled (to same values as Push/Pop). f--IT::L~ I l - - - j CP 1,- 3, CLOCK H TO L OCCURS I~ ~ 1 CLOCK TO Y; 0' Cn +4 ov 1111 -----t----+I-(TA~~E III) INPUTSTOYorCn + 4 (TABLE III (TABLE III ------------- Y OUT Cn + 4 I ·1'-----:&m:::: _ _ _ _ _ 1.5V - ,,\t\\ \\\ \ I ITAB~~ I ALL INPUTS (EXCEPT DEI I(T~~ 11---1 ~\\\\\\\\\~t I,-----J·ov ________-L _______________ ~~~~~~~~~~~~~__________________________ Figure 12. sWitching Waveforms. See Tables for Specific Values. 8-022 ::: VOL MPR-098 Am2909 • Am2911 SWITCHING CHARACTERISTICS OVER OPERATING RANGE TABLE II MAXIMUM COMBINATIONAL PROPAGATION DELAYS (all in ns. CL = 50pF (except output disable tests)) Tables I. II. and III below define the timing characteristics of the Am2909 and Am2911 over the operating voltage and temperature range. The tables are divided into three types of parameters; clock characteristics. combinational delays from inputs to outputs. and set-up and hold time requirements. The latter table defines the time prior to the end of the cycle (Le .• clock LOW-to-HIGH transition) that each input must be stable to guarantee that the correct data is written into one of the internal registers. .~ Measurements are made at 1.5V with V IL = OV and V IH = 3.0V. For three-state disable ~ests. CL =5.0pF and measurement is to O.5V change on output voltage level. TABLE I CYCLE TIME AND CLOCK CHARACTERISTICS TIME COMMERCIAL MILITARY Input Y Cn+4 Y Cn+4 ~- 17 30 20 32 50. 5 1 30 48 40 50 ORi 17 30 20 32 Cn ZERO - 14 - 16 30 48 40 50 OE LOW (enable) 25 - 25 - DE HIGH (disable) 25 - 25 - COMMERCIAL MILITARY Clock t 5 1 50 = LH 43 55 50 62 Minimum Clock LOW Time 30 35 Clock t 5 150 = LL 43 55 50 62 Minimum Clock HIGH Time 30 35 Clock t 5 15 0 = HL 80 95 90 102 Operating Range Part Numbers Power Supply Temperature Range Commercial Am2909PC. DC Am2911 PC. DC 5.0V ± 5% TA Military Am2909DM. FM Am2911DM 5.0V ± 10% Tc = -55°C to +125°C = O°C to +70°C TABLE III GUARANTEED SET-UP AND HOLD TIMES (all in ns) (Note 1) From Input Notes MILITARY COMMERCIAL Hold Time 22 5 22 10 5 12 5 26 6 30 7 FE 2!3 5 30 5 Cn 28 5 30 5 30 0 35 3 ORj 30 0 35 3 50. 5 1 45 0 50 0 ZERO 45 0 50 0 RE 2 Ri PU5H/POP 2 Di Set-Up Time Hold Time Set-Up Time 5 Notes: 1. All times relative to clock LOW-to-HIGH transition. 2. On Am2911. Ri and OJ are internally connected together and labeled OJ. Use Rj set·up and hold times when 0 inputs are used to load register. Metallization and Pad Layout 25 24 Am2909 Am2911 23 17 22 21 20 19 18 26 27 28 13 DIE SIZE 0.110" X 0.160" Numbers correspond to DIP pin-out 8-D23 16 Am2930 MAXIMUM RATINGS (Above which the useful life may be impaired) Storage Temperature -65 to +150°C Temperature (Ambient) Under Bias -55 to +125°C Supply Voltage to Ground Potential -0.5 to + 7.0V DC Voltage Applied to Outputs for High Output State -0.5V to Vee max. DClnputVolta~g~e_______________________________________________________________________ -_O_.5__ to__+_5_.5__ V DC Output Current, Into Outputs 30mA DC Input Current -30 to +5.0mA OPERATING RANGE Part Number Temperature Vee 4.75V to 5.25V TC = 4.50V to 5.50V -55 to +125°C DC CHARACTERISTICS OVER OPERATING RANGE Typ Parameters VO H Description Min Test Conditions (Note 1) Vec = MIN., VIN = V IL or V IH Output HIGH Voltage Yo, Y" Y2, Y 3 G, C n + 4 , Ci+4 IOH = -1.6rnA 2.4 P, FULL, EMPTY IOH = -1.2rnA 2.4 (Note 2) IOl = 20rnA (COM'L) V IH Input HIGH Level (Note 4) V il Input LOW Level (Note 4) VI Input Clamp Voltage IlL Vec = MIN. VIN = VIL or V IH Output LOW Voltage 0.5 IOl = 16rnA (MIL) 0.5 G,C n +4 Ci+4 IOl = 16rnA 0.5 P, FULL, EMPTY IOL = 12rnA Input LOW Current Vec = = MIN., liN = MAX., VIN = 0.5V I ~ Vee MAX•• V" II Input HIGH Current Vec = IsC Output Short Circuit Current Vee (Note 3) = MAX. Output OFF Current = MAX., IOZl Vee MAX., VIN = -.702 -.657 -2.31 I lee Notes: 1. 2. 3. 4. 5. Power Supply Current (Note 5) Vee = 5.0V Vee = MAX. . --t- 20 40 CC 50 Ci 90 Cn 250 -30 DE = 2.4V VOUT = 0.5V VOUT = 1.0 rnA -85 rnA 50 150 /LA 205 239 170 220 185 For conditions shown as MIN. or MAX., use the appropriate value specified under Electrical Characteristics for the applicable device type. Typical limits are at Vee = 5.0V, 25'C ambient and maximum loading. Not more than one output should be shorted at a time. Duration of the short circuit test should not exceed one second. These input levels provide no gtlaranteed noise immunity and should only be tested in a static-, noise·free environment. Minimum ICC is at maximum temperature. 8-D24 /LA -50 2.4V TA = 25°C Te = -55 to +125°C _._._-Te = +125°C TA = 0 to 70°C TA = 70°C rnA -3.25 I 5.5V IOZH Volts _..._"-_._,.".. f - - -~-~ Ci 10 - 4• RE, lEN, CP,5E ~ 2.7V Volts -1.5 CC DO-3 Input HIGH Current 0.8 -.360 ~-"~ Cn IIH Volts -18rnA DO-3 10 -. 4, RE, lEN, CP,5E Volts 0.5 2.0 Vec Units Volts YO' Y" Y 2, Y 3 VOL Max rnA Am2930 Am2930 SWITCHING CHARACTERISTICS Tables A, B, e and' 0 define the timing characteristics of the Am2930. Measurements are made at 1.5V with V IL V IH = 3.0V. For three-state disable tests, CL = 5.0pF and measurement is to O.5V change on output voltage level. ~ OV and I. Typical Room Temperature Performance. Vec = 5.0V, TA = 25°C TABLE IA Clock Characteristics. Minimum Clock LOW Time Minimum Clock HIGH Time TABLE IC Combinational Propagation Delays. All in ns. Outputs fully loaded. C L = 50pF. 18ns 20ns TABLE IB Output Enable/Disable Times. All in ns. C L = 5.0pF for output disable tests. From To y OE CC y (Nole 1) 14 • 0 (Nole 1) Y Enable Disable 17 18 39 57 I~ From Input CC Cn C; CP lEN 41 r- ---' Ci+4 , Y G,P Cn+4 14=L 57 61 61 50 46 32 39 17 25 14 46 52 40 33 37 23 30 0 27 CP: Output 14 . 0 TABLE 10 Set-up and Hold Times. All in ns. All relative to clock LOW-to-HIGH transition. CiH 14=H Full Empty 69 52 53 29 32 14 40 58 40 43 27 I Note 1: "Suspend" instruction. Input 14 . 0 cc lEN Cn C; o (RE = L, 14 •0 = 0-8 or 10-15) o (All other conditions) RE Set-up Hold Time Time 68 53 39 28 18 14 44 t3 II. Guaranteed Performance Over Commercial Operating Range. Vee = 4.75 to 5.25V, TA = 0 to 70 0 e TABLE IIA Clock Characteristics. Minimum Clock lOW Time Minimum Clock HIGH Time TABLE IIC Combinational Propagation Delays. All in ns. Outputs fully loaded. CL = 50pF. 31ns 33ns TABLE liB Output Enable/Disable Times. All in ns. C L = 5.0pF for output disable tests. From OE CC (Note 1) 14 •0 (Note 1) To y Enable Disable 26 27 y 55 37 y 80 55 ~ Output From y G,P Cn+4 Input 81 67 77 14 •0 CC 63 45 55 Cn 32 25 C; 61 CP 69 53 0 49 33 40 lEN TABLE 110 Set-up and Hold Times. All in ns. All relative to clock LOW-to-HIGH transition. ~r-­ Ci+4 14=L 80 22 43 Ci+4 14=H Full Empty 91 69 72 42 45 22 78 55 55 59 40 Input 14 . 0 CC lEN Cn C; o (RE = L, 14 . 0 = 0·8 or 10·15) o (All other conditions) RE Note 1: "Suspend" instruction. Set-up Hold Time Time 114 75 55 43 32 5 25 66 24 III. Guaranteed Performance Over Military Operating Range. Vce = 4.5 to 5.5V, Te = -55 to +125°e TABLE iliA Clock Characteristics. Minimum Clock LOW Time Minimum Clock HIGH Time TABLE IIIC Combinational Propagation Delays. All in ns. Outputs fully loaded. CL = 50pF. 35ns 35ns ~ TABLE 1110 Set-up and Hold Times. All in ns. All relative to clock LOW-Io-HIGH transition. output TABLE IIIB Output Enable/Disable Times. All in ns. C L = 5.0pF for output disable tests. From OE CC (Note I) 14 • 0 (Note 1) To y Enable Disable 31 32 y 60 42 y 85 60 From Input 14 . 0 CC Cn C; ~. lEN CiH Ci+4 G,P Cn+ 4 14=L 14=H Full Empty 88 74 82 87 97 78 68 52 47 60 78 37 30 46 23 23 74 58 48 84 66 60 60 - j 45 55 38 65 45 Input y Note 1: "Suspend" instruction. 8-025 14 . 0 CC lEN Cn ~ o (RE ~ L. or 10·15) o (All other conditions) RE ~0.8 , Set-up Hold Time Time 124 80 69 52 37 30 72 29 INDEX 8255 PPI devices used with. 1-42. 1-43 6800 support devices not compatible with. 1-44 INS8900/PACE. See PACE/INS8900 CP1600 direct addressing. 2-3 implied addressing. 2-4 I/O port pin characteristics. 2-30 stack addressing. 2-5 MC68000 absolute data addressing. 7-30 address registers. 7-3 autovector interrupt response. 7-27 bus and address error exception processing. 7-25 data registers. 7-2 exception priorities. 7-23 exception vector table. 7-23 externally generated exceptions. 7-23 immediate data addressing. 7-37 implied register addressing. 7-32 internally generated exceptions. 7-22. 7-23 interrupt request exception processing. 7-26 memory interface. 7-9 operating modes. 7-22 program counter relative addressing. 7-32 read timing. 7-13 register direct addressing. 7-30 register indirect address. 7-30 reset exception processing. 7-25 spurious interrupt. 7-27 Stack Pointer. 7-4 Status register. 7-5 wait state. 7-14 write timing. 7-14 MicroNova I/O busA-12 8086 AX register. 5-5 base relative. indexed addressing. 5-15 BCD addition. 5-49 BCD division. 5-51 BCD multiplication. 5-51 BCD subtraction. 5-49 Bus Interface Unit (BIU). 5-30 BX register. 5-5 Code Segment register. 5-8 Control signals. simple and complex. 5-28 CX register. 5-5 data memory base relative addressing. 5-16 Data Segment register. 5-11 Destination Index register. 5-10 direct memory addressing. 5-13 dual bus complexity. 5-28 DX register. 5-5 -8080A register compatibility. 5-5 Execution Unit (EU). 5-30 external memory addressing. 5-24 Extra Segment register. 5-10 hold. in min. and max. mode systems. 5-39 implied memory addressing. 5-14 indirect addressing. 5-22 instruction queue. 5-31 interrupt return. 5-46 interrupt vector table. 5-44 I/O port addressing. 5-21 maskable interrupt. 5-44. 5-45 non-maskable interrupt. 5-44. 5-45 program counter. 5-8 program relative addressing. 5-21 reset. 5-27 Segment registers. 5-7 software interrupts. 5-44. 5-45 Source Index register. 5-10 Stack Pointer register. 5-9. 5-11 Stack Segment register. 5-9 8212. used in INS8900 system as input port. 1-39. 1-40 as output port. 1-41 8251 US ART. used in INS8900 system. 1-43 8253 Programmable Counter/Timer. used in INS8900 system. 1-43 8288 Bus Controller interrupt signals. 5-110 I/O bus mode. 5-109 memory protect. 5-109 write control signals. 5-109 Nova addressing. 4-6-9 address space. 4-23 busy status. 4-21 done status. 4-21 registers. 4-22 9440 initialization. 4-16 instruction fetch. 4-24 I/O wait states. 4-28 memory read. 4-24 system bus. 4-14 PACE. See a/so PACE/INS8900 clock signals. 1-11 level 0 interrupt problems. 1-24 stack interrupt problems. 1-22 substrate bias voltage. generating. 1-35 TTL-level bus. 1-2 PACE/I NS8900 address latches and decoders. 1-2 bidirectional transceiver element (BTE). 1-2 BTE mode control signals. 1-37 busses. floating. 1-15 CONTIN signal. 1-15 CPU-initiated DMA block data transfers. 1-16 cycle-stealing DMA. 1-17. 1-18 data input cycle. 1-12 data output cycles. 1-13 direct addressing options. 1-24 INS8900. See a/so PACE/INS8900 address/data lines. demultiplexing. 1-38 control signal polarity considerations. 1-39 8251 and 8253 used with. 1-43 xvii PACE/INS8900 (Continued) direct indexed addressing. 1-7 OMA block data transfers. 1-16. 1-17 execution speed. 1-1 Extend signal for slow I/O operations. 1-13 Extend used to suspend I/O during DMA operations. 1-17 Halt state. 1-14 interrupts. 1-21-23 logic level. 1-2 machine cycle. 1-12 NHALT signal. 1-15 power supply. 1-1 processor stall. 1-15 registers. saving during interrupts. 1-22 return from interrupt. 1-21 signal differences. 1-10 split base page. 1-6. 1-7 stack interrupts. 1-5 STE clock frequency. 1-35 system timing element (STEl. 1-2 TMS 9900 context switch. 3-5. 3-6 memory addresses. 3-3 direct addressing. 3-6 indexed addressing. 3-6 instruction execution sequences. 3-18 internal operations machine cycle. 3-15 interrupt vector map. 3-27 multiple interrupt hardware considerations. 3-30 program memory addressing. 3-8 TMS 9902 break. 3-91 break logic. 3-86 Control register. 3-86 device initialization. 3-84 error flags. 3-93 internal clock signal. 3-88 interrupts. 3-86. 3-87 receive logic. 3-92 receiver status. 3-87 register addressing. 3-84 reset. 3-86 Status register. 3-87 test mode. 3-86 timer status. 3-87 Transmit/Receive Data Rate register. 3-88 transmit event sequence. 3-90 transmitter status. 3-87 TMS 9903 asynchronous break logic. 3-103 asynchronous receive. 3-110 asynchronous transmit. 3-109 bisync logic. 3-105 clock rate option. 3-106 Control register. 3-100 CRC options. 3-106 device intialization. 3-109 device reset. 3-100 external sync logic. 3-104 HOLC abort. 3-104 initialize CRC. 3-100 initialize transmit/receive. 3-100 interface signal. 3-97 interrupt enable/disable. 3-102 modes. 3-97 monosync logic. 3-105 NRZI select. 3-106 Parameter register. 3-103 parity options. 3-105 Read register addressi ng. 3-100 receive eRe. 3-102 received character size. 3-106 register select. 3-100 SDLC configurations. 3-105 SDLC loop. 3-111 SDLe receive logic. 3-104 serial I/O signals. 3-98 Status register. 3-106 sync strip. 3-105 test mode. 3-102 transmit controls. 3-102 transmit operation. 3-104 Write register addressing. 3-101 TMS 9940 CRU bit utilization. 3-59 hold logic. 3-64 idle logic. 3-64 expansion mode. 3-60 multiprocessor system interface. 3-61 simple CRU I/O mode. 3-59 sync mode. 3-64 TMS 9980 series clock logic. 3-49 2901 ALU logic. 8- 13 carry status. 8-24 data input. 8-33 half-carry status. 8-25 local RAM. 8-7 microcode. sample. 8-25 microinstruction. 8-9 multiply. 8-35 overflow status. 8-24 Q register. 8- 12 RAM and CPU registers. 8-10 rotate operation. 8-25 sample microcode. 8-25 shift operation. 8-25 sign status. 8-24 status logic. 8-24 zero status. 8-24 2903 ALU functions. 8-57 ALU input. 8-48 ALU input options. 8-44 ALU operand options. 8-49 ALU output destinations. 8-61 ALU shifter. 8-61 Arithmetic and Logic Unit (ALUl. 8-49 destination options. 8-59 double length normalization. 8-67. 8-68 increment function. 8-72 local RAM addressing. 8-56 normalize special functions. 8-67 shift logic. 8-60 sign extend logic. 8-63 signal/magnitude twos complement function. 8-69 single length normalization. 8-7 slice significance select. 8-45 status signals. 8-46 three-address microcycle. 8-56 two-address timing. 8-56 twos complement divide function. 8-77 twos complement multiply function. 8-73 unsigned multiply. 8-72 2909 output mask. 8-99 2909/2911 Address. 8-95 xviii indirect memory addressing. 6-18 instruction fetch machine cycle. 6-23 I/O instructions. 6-36 LDPS instruction. 6-39 M1 and MO instructions. 6-41 memory interface logic. 6-20 memory read machine cycle. 6-23 memory write machine cycle. 6-23 multiply instruction. 6-39 New Program Status Area pointer. 6-8 normal mode. 6-3 primary memory reference instructions. 6-37 principal memory addressing modes. 6-37 Program Counter 6-6 Refresh Counter. 6-28 secondary memory reference instructions. 6-37 shift instructions. 6-41 sixteen-bit registers. 6-9 software traps. 6-32 Special I/O instructions. 6-37 stack. 6-18 stack instructions. 6-41 Stack Pointer. 6-3 status. 6-6 subroutine call. 6-40 system call. 6-40 system mode. 6-3 thirty-two-bit registers. 6-9 wait state. 6-23 Z8001 address representation. 6-3 base address. 6-9 long segmented base relative addressing. 6-17 long segmented direct memory addressing. 6-13 long segmented indexed addressing. 6-15 program relative addressing. 6-18 segmented mode. 6-7 short segmented base relative addressing. 6-16 short segmented indexed addressing. 6-14 Z8002 direct memory addressing. 6-12 indexed addressing. 6-14 program relative addressing. 6-17 short segmented direct memory addressing. 6-13 data output. 8-99 immediate data input. 8-95 incrementer. 8-99 instruction skip. 8-100 jump. 8-100 microprogram counter. 8-99 multiple jump. 8-103 output select. 8-95 output zero control. 8-99 sequential addresses. 8-99 single instruction reexecution. 8-100 stack. 8-100 subroutine call. 8-102 subroutine nesting. 8-103 2910 add ress output. 8- 11 0 condition codes. 8-113 data input. 8-110 increment. 8-113 instruction codes. 8-113 microprogram counter. 8-110. 8-113 microprogram initialization. 8-120 microprogram jump. 8-120 microprogram jump-to-subroutine. 8-120 stack. 8-113 2930 series accumulator. 8-125 carry logic. 8-129 Index register. 8-129 instruction codes. 8-125 Program Counter. 8-129 Stack Pointer. 8-129 Stack. Push. Pop. 8-129 Z8000 auto-increment. 6-18 auto-decrement. 6-18 base relative addressing. 6-15 block transfer instructions. 6-40 byte registers. 6-9 conditional jump instructions. 6-40 divide instruction. 6-38 implied indexed addressing. 6-15 implied memory addressing. 6-11 xix OSBORNE/McGraw-Hili Books of Interest The SOS6 Book by R. Rector and G. Alexy SOSO Programming for Logic Design by Adam Osborne 6S00 Programming for Logic Design by Adam Osborne ZSO Programming for Logic Design by Adam Osborne SOSOA/SOS5 Assembly Language Programming by L. Leventhal 6S00 Assembly Language Programming by L. Leventhal Z80 Assembly Language Programming by L. Leventhal 6502 Assembly Language Programming by L. Leventhal ZSOOO Assembly Language Programming by L. Leventhal et al. Running Wild: The Next Industrial Revolution by Adam Osborne PETICBM Personal Computer Guide - Second Edition by Adam Osborne and Carroll Donahue PET and the IEEE 4S8 Bus (GPIB) by E. Fisher and C. W. Jensen Practical Basic Programs by L. Poole et al. Some Common BASIC Programs by L. Poole and M. Borchers Payroll with Cost Accounting - CBASIC by Lon Poole et al. Accounts Payable and Accounts Receivable - CBASIC by Lon Poole et al. General Ledger - CBASIC by Lon Poole et al. Some Common Basic Programs - PETICBM edited by Lon Poole et al. OSBORNE/McGraw-H ill Microprocessor Handbook Series OSBORNE 4 & 8-Bit Microprocessor Handbook by Adam Osborne and Gerry Kane OSBORNE 16-Bit Microprocessor Handbook by Adam Osborne and Gerry Kane An Introduction to Microcomputers: Volume 3 - Some Real Support Devices by Gerry Kane and Adam Osborne 8089 I/O Processor Handbook by Adam Osborne CRT Controller Handbook by Gerry Kane 68000 Microprocessor Handbook by Gerry Kane


Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.3
Linearized                      : No
XMP Toolkit                     : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37
Create Date                     : 2012:06:26 13:03:47-08:00
Modify Date                     : 2012:06:26 15:37:51-07:00
Metadata Date                   : 2012:06:26 15:37:51-07:00
Producer                        : Adobe Acrobat 9.51 Paper Capture Plug-in
Format                          : application/pdf
Document ID                     : uuid:7d941447-edfc-425a-ba0e-750962385ef5
Instance ID                     : uuid:ce1ae8a9-6169-4919-b2fd-c6a7939d1c37
Page Layout                     : SinglePage
Page Mode                       : UseNone
Page Count                      : 803
EXIF Metadata provided by EXIF.tools

Navigation menu