Skip to main content
main-content

Inhaltsverzeichnis

Frontmatter

1. The Microprocessor Revolution

To appreciate the full scale of the impact of microprocessors and microcomputers and to understand what these terms mean it is necessary to look at the development of electronic digital computers from the mid-1940s onwards. However, electronic computers themselves should be viewed against the long history of man’s attempts to calculate by machine. The story is a fascinating one for those who are interested and has been well documented (see, for example, Last, 1962).† Here we simply identify some of the highlights.

Eric Huggins

2. How a Computer Works

Most of the features in a microprocessor system or microcomputer are also found in mainframe and minicomputers. The basic architecture, as it is called, is essentially the same whatever size of computer is being considered. An understanding of this architecture and of the basic operating processes within a computer are prerequisite to programming an MPU. Newcomers to computing may well find the principles easier to understand by means of an analogy. The following description, therefore, is of an allegorical computer for which the processes are described in human terms.

Eric Huggins

3. The Binary System

The system of representing quantities in multiples of ten probably goes back into prehistory. Counting in tens-‘decimal’ counting or counting to radix (or modulus) ten-comes naturally to a human being who has a total of ten fingers and thumbs on his two hands.

Eric Huggins

4. Representation

The reader who has found difficulty in transposing and translating 8-bit binary numbers might like to consider the problems that can arise when dealing with 16-bit or larger numbers. The usual size of a store that an MPU is capable of addressing is 216 or 65536 locations. The following are three binary addresses taken at random in such a store Such numbers are difficult to handle and very prone to error when being transcribed (much more so than their decimal equivalents of 47 492, 50 141 and 18 998, respectively.)

Eric Huggins

5. Elements of Programming

When we left our ellfin and the damsels at the end of chapter 2 they had just updated the stock figures for Ale. At that time we had not discussed binary numbers and our computer was, implicitly at any rate, a decimal machine. Nor had we considered the constraints that might be imposed by word length. For example, it had been assumed that the instruction and its operand could all be fitted into one storage location, but we now know that this is not possible. Also no limit had been set on the quantity of stock that the dealer might hold. In fact the starting stock of Ale was 909, a figure well in excess of the 255 limit imposed by an 8-bit word.

Eric Huggins

6. Memory Stores

Memory stores fall into two main categories: immediate access memory and backup stores. The former may be defined as that to which the elffin can be directed and from which he can either bring back or write in the information immediately, that is, within one operating cycle of the computer (typically less than half a dozen microseconds). Immediate access memories for use with MPUs generally consist of semiconductor integrated circuits (chips), but on earlier computers the information for each bit in store was held by magnetising a small ferrite core. The stores were therefore then generally known as core stores, a name which, although no longer strictly correct, is still sometimes used. The size of the immediate access memory available to an MPU is usually restricted to 216 or 65536 bytes. In practice, stores as large as this are seldom if ever used. Systems are usually designed and operate satisfactorily with stores a fraction of this size.

Eric Huggins

7. Peripheral Equipment and Devices

A microprocessor that could not communicate with the outside world would be useless. Information must be fed in some form comprehensible to the microprocessor, and when this information has been processed the required results must be fed out to whomever or whatever needs them. From the programming point of view the instructions INP and OUT are all the reader needs to know for the present. However, to understand and appreciate the possible ‘application’ of microprocessors he needs an understanding of the type of equipment with which the microprocessor is in direct communication. This is generally called the peripheral equipment, being the equipment on the periphery of the microprocessor. Such equipment divides naturally into three categories: input equipment, output equipment, and equipment that is capable of both input and output.

Eric Huggins

8. Applications for Microprocessors

Applications for microprocessors and microcomputers are likely to fall into two main categories, the first of which is simply as a small general-purpose computer. It has already been indicated that microcomputers perform in most respects as well as some minicomputers. Many small offices, traders, engineers, engineering designers, students and others have the need for occasional access to computing facilities. At present this need is being met by batch processing on a mainframe computer within the company or at a bureau, by remote terminals or by minicomputers. Microprocessors could offer a cheaper alternative in many cases. The operative word here is ‘could’ because it must be remembered that the cost of the electronic heart of a computer (the CPU, the immediate access memory and the immediate control circuitry) is not the whole cost of a computer system. In fact whereas this used to be about the most expensive single item in a computer system it is now one of the cheapest. A TTY, a VDU or a mini-floppy disc drive each costs more than a CPU with 4 kilobytes of immediate access memory. To some extent this is inevitable. While the cost of electronics has been plummetting, the cost of mechanical engineering equipment has been rising steadily.

Eric Huggins

9. Microprocessor Hardware

The basic layout of a microcomputer system is shown in figure 9.1. This layout is the same as has been used in practically every digital computer ever made, irrespective of its size.

Eric Huggins

10. Software

This chapter deals with programming languages and their implications for the microprocessor user and programmer.

Eric Huggins

11. The Stack

Subroutines are groups of instructions that are performed frequently with different data at several stages in a program. As mentioned earlier, the addition of two 2-byte numbers can require six separate instructions occupying 18 locations in store. More complicated functions, such as multiplication, division and trigonometrical ratios, use many more instructions. It is thus highly desirable for commonly used programs for such functions to be written in such a way that it is not necessary to rewrite them in full each time they are needed.

Eric Huggins

12. Boolean Notation

In 1847 George Boole produced a paper on the ‘Mathematical Analysis of Logic’ which was to have unexpected repercussions nearly a century later. To understand what Boole’s paper was about consider three statements (A)‘My father is dead’(B)‘My mother is dead’(Z)‘I have no living parents’.

Eric Huggins

13. Addressing Modes

Chapter 9 considered some differences between instructions that are inherently addressed and those that are not. Inherently addressed instructions generally require fewer machine cycles and save program storage space because they have no operands. Since this chapter considers all the various modes of addressing available to users and programmers of MPUs, it is convenient to recapitulate on the SIMNIC instructions already described.

Eric Huggins

14. Integer Multiplication and Division Subroutines

Addition and subtraction are carried out in the MPU by hardware. They need only single instructions and within the limits of the accumulator the MPU does the rest. Unfortunately many MPUs do not have a similar facility for multiplication and division. As they have no single commands for ‘multiply’ or ‘divide’, programs must be written for these operations.

Eric Huggins

15. Floating Point Arithmetic

So far all the binary numbers considered have been integers with a maximum of 16 bits. Thus it has only been possible to represent numbers in the range or

Eric Huggins

16. Program for Floating Point Addition and Subtraction

This chapter sets out a complete procedure for floating point addition and subtraction. The program is detailed in the following text stage by stage, interspersed with commentary as needed. It should be noted that while this program contains over 200 instructions, a similar program for an MPU with a more powerful instruction set would require fewer than half this number.

Eric Huggins

17. Floating Point Multiplication and Division

Earlier when considering arithmetic with integers, it was seen that multiplication and division in the microcomputer are much more complicated than addition and subtraction. Fortunately, in floating point arithmetic this is not true. In fact multiplication is simpler.

Eric Huggins

18. Other Functions

The general or scientifically based high level languages (ALGOL, FORTRAN, BASIC, etc.) give the user ready access to a variety of mathematical functions ranging from square roots, through trigonometrical ratios to random numbers. This chapter shows how some of them may be programmed using assembler language.

Eric Huggins

19. Input/Output

At various stages during the running of a program it is necessary for the MPU to transmit information to or to receive information from a peripheral device of the type described in chapter 7. So far this operation has been covered in our programming by the SIMNIC instructions INP and OUT, but the warning was given that these two instructions were a convenient shorthand for what actually happens and that ‘one assembler-coded instruction for one machine-coded instruction’ did not apply to them. In this chapter we see what actually happens.

Eric Huggins

20. Loading and Running a Program

We have now reached the stage at which it is possible to consider loading and running (executing) a program. In this chapter we consider, first, the steps taken to translate the source program from the assembler language (SIMNIC) to a machine coded object program. Later we consider what must be done to load the program into memory store and to run it.

Eric Huggins

21. Selecting a Microprocessor

The essential point to be borne in mind when selecting a microprocessor is that a system is being bought, not simply an MPU. The potential purchaser must remember that the MPU will constitute only a fraction of the total cost and the fact that a particular MPU is twice as expensive as another does not necessarily mean that a system incorporating that MPU will be twice as expensive. For certain applications it may even be cheaper.

Eric Huggins

22. Conclusion

This book has discussed microprocessor programming to the limits of what is practicable without discussing specific microprocessors, all of which have their own instruction sets, their own mnemonic codes, assembler languages and addressing modes.

Eric Huggins

Backmatter

Weitere Informationen

BranchenIndex Online

Die B2B-Firmensuche für Industrie und Wirtschaft: Kostenfrei in Firmenprofilen nach Lieferanten, Herstellern, Dienstleistern und Händlern recherchieren.

Whitepaper

- ANZEIGE -

INDUSTRIE 4.0

Der Hype um Industrie 4.0 hat sich gelegt – nun geht es an die Umsetzung. Das Whitepaper von Protolabs zeigt Unternehmen und Führungskräften, wie sie die 4. Industrielle Revolution erfolgreich meistern. Es liegt an den Herstellern, die besten Möglichkeiten und effizientesten Prozesse bereitzustellen, die Unternehmen für die Herstellung von Produkten nutzen können. Lesen Sie mehr zu: Verbesserten Strukturen von Herstellern und Fabriken | Konvergenz zwischen Soft- und Hardwareautomatisierung | Auswirkungen auf die Neuaufstellung von Unternehmen | verkürzten Produkteinführungszeiten
Jetzt gratis downloaden!

Bildnachweise