microprocessors part i: bridging the gap

8
Instrumentation Figure 1. Typical microprocessor card set Microprocessors Part I: Bridging the Gap Raymond E. Dessy, Peter Janse-Van Vuuren, and Jonathan A. Titus Virginia Polytechnic Institute and State University Biacksburg, Va. 24061 During the last year a new word has appeared in the ever-changing vocabulary of news and business magazines— microprocessors.These are the large-scale integrated (LSI) circuits that are at the heart of a revolution in the enter- tainment industry (PONG!), the large retail stores (point- of-sale or POS equipment), and more recently in automat- ed analytical instrumentation (the digital self-computing gas chromatograph). The significance and importance of this new technologi- cal development to the analytical chemist is that a micro- processor in conjunction with memory, control circuitry, and data input and output lines (the I/O bus) constitutes a microcomputer. The function of the LSI microprocessor chip(s) in this configuration is the same as that of the cen- tral processing unit (CPU) in larger computers. In other words, the complex circuitry necessary for the decoding of instructions and control of the resultant logical operations of the computer (the function of a CPU) has been micron- ized into a single (!) integrated circuit chip, hence, a micro- processor. The extent to which LSI chips are currently incorporat- ed into computers and in future designs makes microcom- puters rather ill-defined devices since no criterion exists, or is likely to exist, which delineates the area where micro- computers leave off and minicomputers begin. Indeed, as many manufacturers begin to emulate their existing mini- computers, previously assembled from medium-scale inte- grated circuit components, with LSI chips the grey area will become even broader. What is the significance of the microcomputer from the viewpoint of the analytical chemist? Most minicomputer manufacturers are committed to the philosophy of developing machines with increasingly pow- erful computational capabilities, often to the exclusion of their less powerful and less expensive progenitors. In a de- centralized configuration, minicomputers with up to 64,000 words of memory and 5 million words of disk storage and high-speed peripherals, such as line printers and CRT ter- minals, often provide an attractive logistical and economi- cal alternative to a single massive data processing installa- tion such as the proverbial IBM 360 or 370 systems. Fully equipped minicomputers offer all the advantages of higher- level languages such as BASIC or FORTRAN which are human oriented and which ease the cost of program gener- ation. Manufacturers provide programs called EXECUTIVES to supervise these high-level languages as well as data ac- quisition programs which are usually written in a language more closely related to the machine operations called AS- SEMBLY or MACHINE Language. However, as the execu- tive programs become more sophisticated, the vendor and the end user begin to spend more for the programs (soft- ware) to run the equipment than the equipment (hard- ware) itself, especially when a single large computer is to service the needs of a large number of instruments at- tached to it. At this point, the system becomes so compli- cated, interactive, and interlocked that the average chemist is more than happy to let the computing center personnel assume responsibility. But with this responsibility goes control of the design or modification of the system—often resulting in dissatisfaction at the bench level in system function, flexibility, and expandability. A solution to this problem would be to devote a single minicomputer (with a minimum of memory and peripheral devices such as 2K of memory and a single teletype) to the control and data acquisition of a single instrument (a dedi- cated system) or a cluster of these dedicated systems as satellites to a larger CPU that is responsible for data ma- ANALYTICAL CHEMISTRY, VOL. 46, NO. 11, SEPTEMBER 1974 • 917 A

Upload: jonathan-a

Post on 08-Feb-2017

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Microprocessors Part I: Bridging the Gap

Instrumentation

Figure 1 . Typical microprocessor card set

Microprocessors Part I: Bridging the Gap

Raymond E. Dessy, Peter Janse-Van Vuuren, and Jonathan A. Titus Virginia Polytechnic Institute and State University Biacksburg, Va. 24061

During the last year a new word has appeared in the ever-changing vocabulary of news and business magazines— microprocessors.These are the large-scale integrated (LSI) circuits that are at the heart of a revolution in the enter­tainment industry (PONG!), the large retail stores (point-of-sale or POS equipment), and more recently in automat­ed analytical instrumentation (the digital self-computing gas chromatograph).

The significance and importance of this new technologi­cal development to the analytical chemist is that a micro­processor in conjunction with memory, control circuitry, and data input and output lines (the I/O bus) constitutes a microcomputer. The function of the LSI microprocessor chip(s) in this configuration is the same as that of the cen­tral processing unit (CPU) in larger computers. In other words, the complex circuitry necessary for the decoding of instructions and control of the resultant logical operations of the computer (the function of a CPU) has been micron-ized into a single (!) integrated circuit chip, hence, a micro­processor.

The extent to which LSI chips are currently incorporat­ed into computers and in future designs makes microcom­puters rather ill-defined devices since no criterion exists, or is likely to exist, which delineates the area where micro­computers leave off and minicomputers begin. Indeed, as many manufacturers begin to emulate their existing mini­computers, previously assembled from medium-scale inte­grated circuit components, with LSI chips the grey area will become even broader.

What is the significance of the microcomputer from the viewpoint of the analytical chemist?

Most minicomputer manufacturers are committed to the philosophy of developing machines with increasingly pow­erful computational capabilities, often to the exclusion of

their less powerful and less expensive progenitors. In a de­centralized configuration, minicomputers with up to 64,000 words of memory and 5 million words of disk storage and high-speed peripherals, such as line printers and CRT ter­minals, often provide an attractive logistical and economi­cal alternative to a single massive data processing installa­tion such as the proverbial IBM 360 or 370 systems. Fully equipped minicomputers offer all the advantages of higher-level languages such as BASIC or FORTRAN which are human oriented and which ease the cost of program gener­ation.

Manufacturers provide programs called EXECUTIVES to supervise these high-level languages as well as data ac­quisition programs which are usually written in a language more closely related to the machine operations called AS­SEMBLY or MACHINE Language. However, as the execu­tive programs become more sophisticated, the vendor and the end user begin to spend more for the programs (soft­ware) to run the equipment than the equipment (hard­ware) itself, especially when a single large computer is to service the needs of a large number of instruments at­tached to it. At this point, the system becomes so compli­cated, interactive, and interlocked that the average chemist is more than happy to let the computing center personnel assume responsibility. But with this responsibility goes control of the design or modification of the system—often resulting in dissatisfaction at the bench level in system function, flexibility, and expandability.

A solution to this problem would be to devote a single minicomputer (with a minimum of memory and peripheral devices such as 2K of memory and a single teletype) to the control and data acquisition of a single instrument (a dedi­cated system) or a cluster of these dedicated systems as satellites to a larger CPU that is responsible for data ma-

ANALYTICAL CHEMISTRY, VOL. 46, NO. 11, SEPTEMBER 1974 • 917 A

Page 2: Microprocessors Part I: Bridging the Gap

nipulation and storage (a hierarchical system). However, current costs may preclude this approach. Alternatively, each instrument could have a hard-wired front-end or data reduction unit associated with it, similar to the peak detec­tors often found on gas chromatography equipment. For the average chemist this represents a formidable electronics design problem, and the end product is inflexible. Chang­ing it to meet future needs is very difficult.

Microcomputers offer an interesting opportunity to im­plement such dedicated and hierarchical applications at relatively modest cost, but with complete flexibility. In the case of dedicated systems, microcomputers are installed in lieu of the more powerful but more expensive minicompu­ter systems where a careful analysis of needs indicates that the latter are an overkill to the specific problem. They will increasingly replace hard-wired front-ends to provide for low initial cost and future flexibility and expandability.

It is now possible to conceive of all moderately sophisti­cated analytical equipment being delivered with an in­board microcomputer for closed-loop control and optimiza­tion of the instrument conditions, as well as data collection and reduction. Completely operational microcomputers that are entirely adequate to service single instruments at data acquisition speeds of up to 1000-3000 digital data words/sec are available for about $1000. Multi-instrument installations in which relatively slow data rates place not too stringent speed requirements on control and data ac­quisition are also accommodated. Microcomputers thus bridge the gap that has existed between hardware imple­mentation of automation and the use of minicomputers.

It is the purpose of this article to provide some perspec­tives and an overview of this exciting new development in analytical instrumentation. In Part I we will focus on:

• the most attractive feature of a microcomputer, i.e., the modular nature of the hardware components required to configure microcomputers with variable operational capabilities

• an outline of the basic principles of interfacing exter­nal devices, such as analytical instruments, to the input/ output (I/O) bus of the microcomputer

• the powerful software instruction set utilized by the microprocessor and which is principally responsible for its operation as a full-fledged CPU.

In Part II we will: • describe in detail a potential application in which the

flexibility of the microcomputer as a control and data ac­quisition device will be illustrated

• spotlight some of the advantages and disadvantages of microcomputers

• summarize the application of microcomputers as rela­tively inexpensive instructional equipment for providing "hands-on" and "hands-in" experience in the teaching of digital techniques and applications in the analytical labora­tory.

For those unfamiliar with digital electronics or interfac­ing principles in general, background material may be found in two review articles that have appeared in ANA­LYTICAL C H E M I S T R Y : "Computer Interfacing" (7) and "Instant Interfacing" (2).

Hardware

The description of hardware which follows is based on what is necessary to configure the Intel 8008 microproces­sor into a microcomputer. This LSI chip is second-sourced, and four vendors can provide total systems for the end user. A typical system is shown in Figure 1. The different types of microprocessors are operationally very similar, and it is relatively easy to extrapolate the basic principles outlined below to other microcomputers and microprocessors. Many other manufacturers provide, or are claiming to provide, microprocessors.

The key components typically required to configure a

microcomputer involve: • the microprocessor or micro CPU—the "head-quar­

ters" of all computer operations and the following external components: • memory—read/write and read-only for program and

data storage • external control circuitry—for synchronization and

generation of control signals • device decoder—for generation of special control sig­

nals for external devices • interrupt input port—to force external control of the

microprocessor. These are illustrated in Figure 2a. To complete the basic components required by the mi­

crocomputer to communicate with external devices, it is also necessary to include the following which will be added to our circuitry later in the article:

• output latches • input ports—both to control and synchronize data

transfer to and from the microprocessor. The elements incorporated into the Intel 8008 micropro­

cessor are: • an instruction register associated with powerful and

sophisticated internal decoding and control logic • an accumulator and seven 8-bit general-purpose regis­

ters used in conjunction with flags, i.e., CARRY, SIGN, and ZERO

• a 14-bit program counter associated with a 14-bit, seven-register stack.

All these elements are present on the single microproces­sor chip. Figure 2b represents a simplified diagram of these components.

CPU/Memory. The Central Processing Unit (CPU) is an arithmetic and logic unit that is associated with a mem­ory. The memory consists of solid-state devices in which each "word" is made up of 8 binary digits (bits) of informa­tion. Part of the memory is random access memory (RAM) that the CPU can write data into, or read data from. An­other portion of the memory is preprogrammed and can be read from only (read only memory or ROM). A series of commands (really binary numbers that are decoded by the CPU and cause certain operations to take place) is stored in memory and then executed one-at-a-time, usually se­quentially. This is a program or software. The program may be stored in RAM or ROM; it is common to store the operating program in ROM and use RAM for data manipu­lation and storage.

Program Counter. When a program is to be executed, a 14-bit register in the CPU is loaded with the address of the first instruction to be executed, and it is "fetched" by the CPU from memory, decoded, and the CPU sets itself up to perform the desired operation. The program counter is au­tomatically incremented at this point so that it is set to in­dicate the location of the next instruction to be executed.

General Registers. Typically, the initial instructions in a program would involve loading one of the seven general-purpose registers within the CPU (A, B, C, D, E, H, and L). The first of these registers is called the A register or accu­mulator. It is in this register that we perform the arithme­tic (add, substract) and Boolean functions (and, or, com­pare).

Carry, Sign, and Zero CPU Flags. The A register has associated with it an extension bit, called the carry. Upon addition with carry, or subtraction with underflo, this bit gets set to a 1. The A register and its carry extension are really a circular register, and rotation of the contents is possible under software command. Such operations will be discussed in a later section. There are two other "flag" bits associated with the CPU. These are the sign and zero flag bits. Their contents will reveal information concerning the contents of the A register, or the results of Boolean opera­tions. For example:

918A • ANALYTICAL CHEMSTRY, VOL. 46, NO. 11 , SEPTEMBER 1974

Page 3: Microprocessors Part I: Bridging the Gap

.jsrr.al I/O mtrol

Interrupt Control

i i i a i i a

iW'iri''i>&"M-Kè^é&MiiîS^

^X^&^i^i^m^^Mà

;Wte^W

35iiSi::if'%cS|S

^mMMSsïOÉMmM

wm

Figure 2a. Microcomputer-architecture external to microprocessor

I C.iny I

I Sign I

! Zero ι

instruction Storage Register

Internal Decoding and

Control Logic

H!

Program Counter

Figure 2b. Internal architecture of microprocessor

ANALYTICAL CHEMISTRY, VOL. 46, NO. 11, SEPTEMBER 1974 • 919 A

Micro­processor

(CPU)

Read/Wri te Memory (RAM)

MEMORY Read-Only Memory (ROM)

Device Decode»!

Β

' C

'• D

Ε

M

:ÏDHîi ï H I l l l â ï ï i Î ! Control Circuitry

• L . O ^ * When memory is addressed j

H and L are used together to form a 14 i >• τ address

; \y : Memory Address Register

Page 4: Microprocessors Part I: Bridging the Gap

8 Flag Signals from External Devices

Figure 3. Input/output architecture

O R I G I N A L C O N D I T I O N S

( 2 0 0 ) A

F L A G S (200)

A F T E R A D D I N G Β T O A

(Ô0Ô)

( 2 0 0 ) Β

2008 + 2008 = 4008. The largest 8-bit number is 377; thus, the result of the addition is zero, with a carry; just like 9 + 1 = 10, where the result is a zero with a carry. The appro­priate flags are set as indicated.

The other six registers allow storage of constants and counters. These registers may be incremented or decre­mented by software commands. Data can be transferred from one register to another by software also.

High and Low Memory Address Registers. An opera­tion that is important early in most programs is the ability to read data from memory or store data in memory. When this is desired, the location of that memory cell is loaded into the two registers called Η and L. Two 8-bit registers have been used for this task; using one register would per­mit addressing of only 256 memory cells—(28), too small a memory for most applications. Only 14 bits of these regis­ters are used, thus allowing direct addressing of 16K words of memory!

The Stack. Another common function in programming is a jump to a subroutine, implying that we want to branch

off to perform a commonly used operation and return to the main program where we left it. In order to accomplish this, the contents of the program counter at the time of the jump-to-subroutine request is "pushed-down" into the stack, a 7-word X 14-bit set of registers associated with the CPU. The program counter itself now contains the address information pointing to the subroutine instructions. When we wish to return from the subroutine, the old address in­formation is "popped-up" in the stack and back into the program counter by a software command called a RE­TURN.

The microprocessor has computational capabilities, and these will be discussed in subsequent paragraphs; however, it is the function of this article to emphasize the hardware necessary to input and output data into and out from the CPU (Figure 3).

Select Device/In and Out Pulses. The pathway in and out of the CPU is a set of bidirectional data lines, eight in number. The operational circuitry in the CPU accepts or places information on these lines only at certain times. (The complex multiplexing accomplishing this is not shown in the drawings for clarity; from this point on, the drawings will show separated INPUT and OUTPUT BUSSES). Be­cause of this criticality in timing, and the fact that we usu­ally want many input and output devices to be attached to the microcomputer, but only have a single input or output device activated at a time, the CPU has I/O control circuit­ry associated with it. When data are to be input to the CPU, a software command causes the external control cir­cuitry to issue a pulse called IN, and the device decoder to issue a pulse unique to each device called SELECT DE­VICE. These activate or enable a a device called a GATE which momentarily places the desired information from the input device onto the bidirectional I/O lines. The micro­computer accomplishes this by means of tri-state logic. It is configured as shown in Figure 4.

Tri-State Gate (Input Port). Tri-state logic is con­structed so that output is enabled only when the CON-

922 A • ANALYTICAL CHEMISTRY, VOL. 46, NO. 11, SEPTEMBER 1974

ο

zero

0

sign

0

carry

1

zero

0

sign

1

carry

A

Β

Done Flag

8 Select Device for

Input Lines

M I C R O C O M P U T E R

Input Bus Output Bus

8 Select Device for

3utDi.it Lines Out

8 Interrupt 8 Interrupt Request Lines Acknowledge

Lines

| | G A Τ Ε

Ε R | Ν Ε J S G J EJ

L A Τ

c H

O D U Ε T V Ρ I U C Τ Ε

I I I I 1 I I I m? 7 6 5 4 3 2 11 0

Π ι 1111 ι OUT? 65 432110

f '

Page 5: Microprocessors Part I: Bridging the Gap

Data Bit Select Dev

In

In

Control Line

Out J Data Bit ] to CPU

(8 Gates Per Input Port)

Figure 4. Tri-state logic configuration

TROL LINE is held at a logic 0. In this condition the DATA BIT at the input is "gated" to the output. When the control line is a logic 1, the output looks like a high impe-dence or open circuit.

)ata bit Control Output 1 0 1 0 0 0

1 or 0 1 Hi Ζ

A set of 8 bits is called an INPUT PORT, and we can "strobe" data onto the Data Bus from them by momentari­ly grounding the CONTROL line associated with the PORT. This is done by ORing (OR gates and other inte­grated circuit components are discussed in ref. 1 and 2) the SELECT DEVICE and IN signals together and connecting them to the CONTROL input of that port. Many devices may be attached to the CPU by using a unique SELECT DEVICE pulse for each port (Figure 5). Commonly, device decoders provide eight such pulses for input.

Data Latch (Output Port). When data are to be output (Figure 6), a software command causes the control logic to issue two signals, called SELECT DEVICE and OUT, which activate or enable a device called a LATCH, which accepts the data on the bidirectional I/O lines at that in­stant and holds them (examine Figure 6 for latch opera­tion) for use by the output device. Since we wish to latch, or hold, data available on the Data Bus only during the pe­riod that OUT is 0, and since many different devices are connected to the Data Bus in parallel, logical NORing of a SELECT DEVICE pulse and OUT is used to cause the clock input on a DATA LATCH to go to a logic 1 momen­tarily, when and only when, the desired data are made available by the software and CPU action. Each device in the external world that requires latched data must have a data latch associated with it. Eight SELECT DEVICE pulses are available for output control in the configuration shown.

External Flags. It is necessary for the CPU to know when external devices require service, either for input or output. Depending on the timing criteria, one of two meth­ods is ordinarily used to synchronize the operation of the CPU and external devices.

The first of these involves the external device creating a signal called FLAG which can be sensed by the CPU. This is done by having the CPU query a SENSE REGISTER (an input port to which the flags are attached) periodically, to ascertain whether any device requires service. If it senses such a condition, appropriate software will cause the is­suance of the SELECT DEVICE and FUNCTION (IN or

Figure 5. Connection of input ports to I/O bus

OUT) pulses appropriate to that device. Eight separate de­vices can be sensed using one gate input. Flags are usually built from flip-flops (Figure 7).

This method involves sufficient software to properly identify the device and direct the program to the service routine for that device. Under certain conditions, usually involving very rapid input or output, or long periods be­tween I/O, such a method is inadequate or inefficient.

Interrupt Request and Acknowledge. To meet such needs, external devices can generate another signal called INTERRUPT REQUEST when I/O is needed (Figure 7). This interrupts the existing program, and automatically causes the following operations:

• stores the program counter in the stack (just like a call to subroutine)

• generates an INTERRUPT ACKNOWLEDGE signal that clears the flag, letting the device know its interrupt re­quest has been accepted

• vectors (jumps) to the service routine for the device by "jamming" a jump command called a VECTOR instruction (created by external hardware) into the CPU for execution. These will be discussed in the Software section.

The microcomputer has the hardware to control eight devices in this manner. Those familiar with PDP-11 archi­tecture will recognize that the microprocessor architecture is rather sophisticated.

The emphasis up to now has been on hardware. But the flexibility of the microcomputer lies in its ability to be pro­grammed for a given task by software.

Software A set of instructions called a program (software) is neces­

sary to allow the microcomputer to accomplish anything. Programming for analytical instruments will be discussed in Part II of this paper. For the moment, we need to focus on the topic of input/output commands and the basic in­struction set.

924A • ANALYTICAL CHEMISTRY, VOL. 46, NO. 11, SEPTEMBER 1974

Input Output

Select Device Pulse —

In Pulse —

Data Bit

I O Bus

Page 6: Microprocessors Part I: Bridging the Gap

I/O Bus

Figure 6. Connection of output ports to I/O bus

Input/Output Programming. All data flow to and from the microcomputer with respect to the outside world takes place via the A register. All data inputs must be activated during and only during the duration of a CPU generated pulse called IN. To distinguish between external devices, the CPU simultaneously produces a unique SELECT DE­VICE pulse in response to the specific software command initiating data transfer; e.g.,

Octal code Mnemonic equivalent 111 I N P 4 generates S E L E C T D E V I C E

I N P 4 and I N 113 I N P 5 generates S E L E C T D E V I C E

I N P 5 and I N

Similarly, data can be output from A during and only during the duration of a pulse called OUT. This and unique SELECT DEVICE pulses are generated by specific soft­ware commands: e.g.,

Octal code Mnemonic equivalent 125 OUT2 generates S E L E C T DEVICE

OUT2 and OUT 131 OUT4 generates SELECT DEVICE

OUT4 and OUT 133 OUT5 generates S E L E C T D E V I C E

OUT5 and OUT

a total of 102410 (IK) words of memory. The microcomputer is configured to have available a

number of instructions which will effectively cause a jump to certain specified ROM locations called VECTOR SPACE. These are the VECTOR INSTRUCTIONS:

926 A ' · ANALYTICAL CHEMISTRY, VOL. 46, NO. 11, SEPTEMBER 1974

The SELECT DEVICE and FUNCTION pulse (IN or OUT) are, as shown previously, gated together to form a single pulse that activates the device, and causes data transfer.

Vector Instructions. Memory in a microcomputer might be configured as follows:

M E M O R Y A D D R E S S

-17778

14008

-13778

00778

-0000s

R A M

R O M

(vector space)

·. Select

laii i iSta filljlilllillj '. OWt Pulse

Ç j i t ^B i î 7

Q "follows " D during this period

Q "latched" at logic level of D input when clock goes low

one bit from data bus -one bit

to output device jclockj

j i npu t | jpulse

7475 Latch

Ililllllli

Page 7: Microprocessors Part I: Bridging the Gap

Triinsirmn .it Inrti nii-s Dt>\. RIMCJV

Goes to Logic 1

Flarj Signât (hi CPU)

Unes to Loan 0

Interrupt Request

f to CPU)

Interrupt Acknowledge (from CPU I ι clears, flag)

Figure 7. Flip-flop used as flag

Octal code 075 065 055 045 035 025 015 005

Operat ion performed

Vectors to 0070 Vectors to 0060 Vectors to 0050 Vectors t o 0040 Vectors t o 0030 Vectors t o 0020 Vectors to 0010 Vectors to 0000

Hardware equivalent ( In te r rup t request)

I R 7 I R 6 I R 5 I R 4 I R 3 I R 2 I R 1 IRQ

V E C T O R = J u m p automat ica l ly

These actions may also be initiated by hardware action. As mentioned, available to the microcomputer user is a se­ries of bus connections labeled INTERRUPT REQUEST. When momentarily grounded they effectively cause execu­tion of the indicated vector command, as well as saving the current program counter in the stack and generating an ac­knowledge signal.

This allows one to write programs beginning in 00X0 and continuing through 00X7, which can initiate access to more lengthy service routines in ROM or RAM memory, wherev­er a device needs service. These would normally contain an appropriate input or output software command. A software RETURN command permits the CPU to return to the point in the main program where it was interrupted, after service is accomplished, by "popping" the stack.

In our microcomputer these interrupt requests can be di­vided into two classes determined by when they are recog­nized by the processor:

• IMMEDIATE requests: recognized at the end of exe­cution of the instruction during which the request was made

• DEFERRED requests: these are recognized only at the time the software instruction OUT2 is executed.

This allows the user to divide his external devices into two groups: those that require almost immediate attention and those that may be checked periodically to see if action is necessary.

At each interrupt the register contents (A, B, C, D, Ε, Η, and L) and the flag status bits must usually be saved. This permits the machine to be returned to the condition it was in at the time of the interrupt after exit from the service routine for the device requesting service. Since this is a te­dious memory-consuming process, it is usually desirable to arrange for IMMEDIATE interrupts to be as uncomplicat­ed as possible (in terms of register and flag alterations) and to use DEFERRED interrupt operation at times in the pro­gram when complex SAVE routines are not needed. This

can be at the end of repetitively called subroutines when no meaningful data are in registers or the flag bits. Complex interrupt service should be avoided. It is time consuming in both execution and in program preparation for it.

Instruction Set. Once the data from an analytical in­strument are read into the A register, it must be operated upon in some way. The instruction set in the 8008 micro­processor involves over 150 commands. Each of these com­mands is a number which can be decoded by the CPU and the appropriate operation performed. For human utiliza­tion each number has a short mnemonic equivalent associ­ated with it. A few examples are given below using the mnemonic equivalents utilized in our laboratories.

Octal code

L O A D 301 307 310 370

M A T H 201 221 010 011

Mnemonic I N S T R U C T I O N S

Ins t ruct ion performed

LDAB LDAM LDBA LDMA OPERATIONS ADDB SUBB INCB DECB

Load A from Β * Load A from Memory Load Β from A Load Memory from A

Add Β to A Sub t rac t Β from A Increment Β Decrement Β

002 RALT 012 RART 022 RALC 032 RARC

B O O L E A N O P E R A T I O N S 241 A N D B Logical A N D Β with A 271 C O M B Compare Β wi th A 251 X O R B Logical Exclusive OR

Β with A 261 I O R B Inclusive OR Β with A

R O T A T E A R E G I S T E R R o t a t e A Left R o t a t e A Righ t R o t a t e A Left T h r u Car ry R o t a t e A Right T h r u Ca r ry

* Refer to registers. A = accumulator; B , C, D , E , H , and L = general-purpose registers.

The above commands do not affect the program counter. For branching two types of jump commands are available. Normal J U M P instructions JPxx) examine the flags, and if the condition specified in the command is met, alters the program counter to the desired address, BUT does not cause the old program counter to be stored in the stack. J U M P TO SUBROUTINE (JSxx) instructions DO store the old program counter in the stack. For this reason, they are associated with RETURN commands that "pop" the stack at the end of the subroutine. Let's examine jumps re­quiring a True Carry (=1): these are JPTC (jump on a true carry) and JSTC (jump to subroutine on true carry).

J U M P S

j u m p I F carry flag = 1 T ^ I , cont inue

J P T C fix

(fix) -*

th is does not re turn automatical ly

928A • ANALYTICAL CHEMISTRY, VOL. 46, NO. 11 , SEPTEMBER 1974

Page 8: Microprocessors Part I: Bridging the Gap

The Scientific Detergents

Scientists Prefer for Critical Cleaning

Simply add to water...cleans Glassware, Porcelain, Plastic, Rubber, Metal Instruments, and components.

ALCONOX· For m a n u a l c l e a n i n g and u l t r a s o n i c washers. Powder form, odorless. High sequestering power, mild pH , anionic, helps decontaminate radioactive surfaces. 3 lb. Box j 3.00 Case of 12 χ 3 lb. Boxes 27.00 25 lb. Carton 17.50 50 lb. Carton 31.50 100 lb. Drum 58.00 300 lb. Drum 150.00 50-Pack Dispenser Box

(50 1/2 oz. packets) 3.50 Case of 12 50-Pack Boxes 28.00

CIRCLE 63 O N READER SERVICE CARD

LIQUI-NOX* The perfect liquid detergent. Phosphate-Free! For manual cleaning and ultrasonic washers. Specified for cleaning compon­ents and processing equipment. Alconox efficiency in liqujd form. 1 Quart "Container $ 2.75 Case of 12 χ 1 Qts 24.00 1 Gallon Container 8.80 Case of 4 χ 1 Gal : 30.00 15 Gallon Drum 88.00 55 Gallon Drum 280.00

Includes free 1 oz. dispenser pump CIRCLE 64 O N READER SERVICE CARD

ALCOJET· For mechanical washers. Powder form. Protects mechanical parts of washing machines, keeps circulating lines and pumps free and clear. Prevents water-spotting. Minimum foaming action. 5 lb. Box $ 4.00 Case of 6 χ 5 lb. Boxes 18.50 25 lb. Carton 14.00 50 lb. Carton 25.50 100 lb. Drum 48.00 300 lb. Drum 132.00

CIRCLE 65 O N READER SERVICE CARD

TERG-A-ZYME· Alconox powder with protease enzyme ,S; power. Effective in removing fresh or dried ^ . blood, body soils, and other proteinaceous V: materials. Ideal as a pre-soak. Cleans j i , ' reverse-osmosis installations in cheese and dairy processing. 2 lb. Box $ 2.50 Case of 12 χ 2 lb. Boxes 22.00 25 lb. Carton 20.00 100 lb. Drum 65.00 300 lb. Drum 180.00

CIRCLE 6 6 O N READER SERVICE CARD

ALCOTABS® Effervescent tablets for cleaning Pipettes and Test Tubes. Makes syphon-type rinsers into automatic washer/r insers. Box of 100 Tablets $ 6.50 Carton of 6 Boxes χ 100 Tablets 33.00

CIRCLE 6 7 O N READER SERVICE CARD

Note: Prices Slightly Higher West of Rockies. Available from your local Laboratory Supply Dealer, or write for further information and samples.

ALCONOX, INC. 1215 Park Avenue South, New York, N.Y. 10003J

J U M P S T O S U B R O U T I N E

J S T C fix

(fix)

R T U N

j u m p to subroutine I F carry flag = 1 =^1, continue

now re tu rn regardless of flag conditions (unconditional)

th is does!

J U M P C O M M A N D S FLAG C O N D I T I O N

N E E D E D L W C O N D I T I O N A L False Carry ( = 0) .False Zero (reg ^ 0) False Sign (reg is + ) True Carry ( = 1 ) True Zero (reg = 0 ) True Sign (reg is — )

R E T U R N C O M M A N D S R T U N R T F C R T F Z R T F S R T T C R T T Z R T T S

M I S C E L L A N E O U S C O M M A N D S 250 C L R A Clear A 300 N O O P 000 H A L T

104 J P U N 100 J P F C 110 J P F Z 120 J P F S 140 J P T C 150 J P T Z 160 J P T S

J U M P T O S U B R O U T I N E R E T !

106 J S U N 007 102 J S F C 003 112 J S F Z 013 122 J S F S 023 142 J S T C 043 152 J S T Z 053 162 J S T S 063

N o Operat ion Stop C P U

It is obvious with these commands that rather sophisti­cated data manipulation is possible. A number can be input, then examined to see if it falls between certain limits by COMpare commands, and then appropriate action taken by J u m P commands depending upon the status of the flags called CARRY, ZERO, and SIGN. In fact, the in­struction set is more powerful than that of the ubiquitous PDP-8 which has played such an important role in labora­tory automation.

With this background, Part II of this article in next month's INSTRUMENTATION will present a typical applica­tion of microprocessors—the construction of a differential stripping electrochemical apparatus. The strong points and shortcomings of microprocessors will be examined, and some suggestions made on how to get started.

References (1) (2)

E. Dessy and J. A. Titus, Anal. Chem., 45 (2), 124A (1973). E. Dessy and J. A. Titus, ibid., 46 (3), 294A (1974).

CIRCLE 2 ON READER SERVICE CARD 930 A • ANALYTICAL CHEMISTRY, VOL. 46, NO. 11, SEPTEMBER 1974