A Set of Standard Microprocessor
Programming Cards

Jonathan Bowen


Resume:

Jonathan Bowen was a Senior Research Officer working at the Programming Research Group (PRG) at the Oxford University Computing Laboratory, UK. Until the end of 1984 he was a Research Assistant in the Wolfson Microprocessor Laboratory based in the Department of Computing, Imperial College, London, UK. His research interests include microprocessor applications, formal methods and Z.

Abstract:

Microprocessor manufacturers usually produce a programming card for each of their microprocessors giving details of opcodes, mnemonics, addressing modes, registers and so on. However there is no standard way of laying out this information and each manufacturer has their own ad hoc approach. This paper presents a series of programming cards which were developed for a wide selection of microprocessors but which are set out in a standard format. This enables users to swap between processors and programming cards with greater ease once the format has been assimilated.

Keywords:

programming cards; instruction set; microprocessors.


INTRODUCTION

Nearly all microprocessor manufacturers and many distributors supply pocket sized programming reference cards for use when programming the microprocessors which they make or support. However, the style of programming cards differ widely from manufacturer to manufacturer and even for different microprocessors produced by the same manufacturer [1-5]. Switching between different microprocessors can be a harrowing experience. Often the mnemonics are ordered in different ways (e.g., alphabetically by mnemonic, by opcode or by type). Details about the operands, opcode, registers, etc. are handled differently. Varying amounts of information are supplied and sometimes this can prove to be inadequate.

BACKGROUND AND HISTORY

I spent three years working as a Research Assistant in the Wolfson Microprocessor Support Unit at Imperial College in London. The Wolfson Unit supports a wide range of microprocessors using Hewlett-Packard 64000 microprocessor development systems. Because of the problems outlined above, a large number of programming cards were produced at the Unit for the convenience of its users. These were designed to be used especially by people who use a variety of microprocessors - in particular, the research assistants at the Unit! They were made available as a large wall chart (containing about 36 cards) and in a loose leaf binder in the Unit's laboratory [6]. They proved very useful as quick reference guides when a programmer wishes to verify a particular mnemonic, addressing mode, opcode or cycle time, since they allow very fast access to the appropriate information. New users were issued with the relevant cards for their individual needs. Of course, if very detailed information is required then a reference book must be consulted, but often this is not necessary.

The style and layout of each card has been kept as uniform as possible within the limits of the particular microprocessor involved. The card is divided into three sections, each with up to 80 lines by 64 characters of information including a border. The cards consist of standard printable ASCII characters to aid machine portability. Each of the three sections is stored sequentially in the file for ease of editing although they are normally printed side by side. A command file or program transforms the format for printing. Initially they were produced on the HP64000 systems in the Wolfson Laboratory at Imperial College and printed on the attached dot matrix printer. This has a condensed text mode which allows the cards to fit on a standard page of computer printout. This may be reduced to A4 size if desired and, if folded appropriately, forms a convenient pocket programming card.

Subsequently the card set has been transferred to multiuser Unix systems at Imperial College and Oxford University. The networking facilities which are now becoming available have proved invaluable for this, bypassing the necessity for the use of magnetic tape or any other physical transfer media. This allows on-line access using the powerful Unix tools. For instance more and vi allow the user to browse through the cards individually or as a set. The files are given the name of the microprocessor or family with which they are associated. For example ``more 68*'' will access all the Motorola cards such as the 6800 and 68000.

The commands grep, egrep and fgrep allow pattern searching including the use of regular expressions for pattern matching. The is useful for finding mnemonics in the programming cards. ``grep JSR *'' will find all the programming cards which include the JSR (Jump to Subroutine) mnemonic. The cards may be updated easily using the screen editor vi or the stream editor sed as well as the standard Unix line editor ed. Subsequently the cards may be printed on high quality laser and other printers accessible from the Unix systems if desired.

LAYOUT

The first section of the programming card contains a title and a pin-out diagram of the microprocessor involved. This is very useful when debugging hardware and software using a logic analyser but is often omitted from many commercially available cards. For processor family cards a suitable logo or other general information may be placed here. The name and address of the author, creation and/or last modification dates, and issue number are included at the bottom of the first page.

The second section lists all the instructions of the microprocessor with details in various fields. These include all the mnemonics) in alphabetical order, together with information on opcodes, status flags affected, addressing modes, execution time in machine cycles, a brief description and notes on the operation of the instruction. Some of these fields may be omitted for particular microprocessors due to lack of space. However the cards for most 8-bit processors contain all these fields, the Z80 being a notable exception because of the complexity of the design of its opcodes to maintain compatibility with the 8080. Most of the cards for 16-bit processors omit the opcode and machine cycle fields because the increased number of addressing modes usually produces too great a variation in possible values to be included in the available space. In practice, this does not present a great problem since the programmer is less likely to be interested in opcodes on these more complicated processors or be quite so worried about time critical code.

By experience it has been found that alphabetic ordering is most convenient. Most processors adhere to certain naming conventions - for instance branch instructions normally start with the letter B. Once these conventions have been assimilated by a programmer, the relevant section for a particular type of operation can usually quickly be found. In any event the layout of the card allows all the instructions to be scanned relatively quickly since the number of mnemonics is usually around 90 with one mnemonic per line. Sometimes mnemonics which contain a register name or a group of related mnemonics are grouped into one line to save space. The variable part of the mnemonic is denoted in lower case (mnemonics are normally given in upper case) and the possible values of the lower case section are detailed later (e.g., the load instruction LDa for the 6809 where a may be register A or B).

The section containing details of the processor's instructions is followed by a series of shorter subsections. The list of mnemonics often spills over into the third section of the programming card. At any rate, the subsequent subsections contain information on the individual status flags, addressing modes, directives for data storage etc., register details, operand details, operation description details and special memory locations.

The order and format of these sections is adhered to as closely as possible for each microprocessor, although there may be some variation depending on the architecture of the microprocessor involved. In particular, the notes on the description of the operation of each of the mnemonics is kept as uniform as possible, using standard characters for specific operations (e.g., x for the exclusive OR operator). All the operations used by a particular programming card are defined in section G so the user does not need to refer to a separate card to understand the nomenclature. The directives given in section D are likely to be very assembler dependent since often manufacturers do not specify these. The ones given in these cards are those used by the HP64000 assemblers.

OBSERVATIONS - Advantages and Disadvantages

The programming cards can help to give an insight into the comparative complexities of different microprocessors. For instance it can very quickly be seen that the 6502 has far fewer instructions than most other 8-bit microprocessors. Thus the cards can be useful for comparing the suitability of different microprocessors for a particular application in an initial feasibility study. However closer inspection of selected microprocessor will need to be undertaken before a final choice can be made.

Processors with a powerful orthogonal instruction set such as the 68000 may at first sight seem less powerful than they really are when viewing the corresponding programming card. In the case of the 68000 all the instruction mnemonics fit on a single page. However the variety of addressing modes and byte/word/long word addressing which may be applied to many of the instructions may be gleaned from the card on closer inspection.

Some instructions are more powerful than others and sometimes not obviously so. An example of this is the LINK/UNLK instruction pair of the 68000. Although these may be used singly, they are much more powerful when used together. Thus the cards should be used with caution for comparing microprocessors. They are more useful for experienced programmers and other microprocessor users who have had exposure to several different processors.

The rigidity of the format of the cards means that only a certain amount of information can be included for each microprocessor. Thus for more complicated processors some information such as the opcodes and/or timing has to be excluded because of lack of space. For some very simple microprocessors such as the 8021, the instruction set may be so simple as to allow the third page to be shortened. This rigidity is one of the greatest problems with the cards, especially during their creation.

Manufacturers tailor their cards to the microprocessor involved. Because of the variety of instruction sets and tastes, this results in a great variety of programming cards. They include one or more tables of instructions sorted by mnemonic, opcode or type. This is likely to make this programming card more useful if only one microprocessor is used by a programmer.

The programming cards described here only list the mnemonics alphabetically in a single table. This may make access to a given instruction difficult (e.g., if only the opcode is known). However their uniformity makes them more useful when several processors are being used by a programmer, once there format has been assimilated. This, together with the possibility of textural manipulation of on-line versions of the cards is considered to outway the disadvantages in many cases.

PROGRAMMING CARDS

A selection of the programming cards for microprocessors from various manufacturers are available. The full set available comprises of the following: µP - microprocessor, µC - microcomputer.

In addition to the above cards for microprocessors and microcomputers, a number of other support cards have been written in a similar format. These include the following:

The general three-page format has been found to be suitable for a variety of quick reference documents as well as for microprocessor programming cards.

CONCLUSION

The programming cards have proved useful to microprocessor assembler programmers, especially those who use more than one microprocessor. Changing between processors can be troublesome and confusing and the cards are an ideal quick reference to refresh the memory. The cards are not suitable for the novice programmer with no experience of assembler programming. However by the time a programmer is moving onto a second microprocessor, the relevant programming card (provided it exists) should be a valuable aid.

REFERENCES

1. Digital, PDP11 Programming Card for Family of PDP-11 Computers, Digital Equipment Corporation (1975)

2. Motorola, M6800 Microprocessor Instruction Set Summary, Motorola Inc (1975)

3. Mostek, Z80 Microcomputer System Micro-Reference Manual, Pronto Electronic Systems Ltd (1978)

4. Pelco Electronics, Programming Reference Card, 6500 Microprocessor Range, Welwyn Electronics Ltd

5. Control Universal, MC6809 Microprocessor Instruction Set Quick Reference Card, Control Universal Ltd

6. Bowen, J P, The Wolfson Microprocessor Research Support Unit, Documentation and Usage 1981-1984, Publication DoC 84/25, Imperial College, UK (1984) Appendix D


A Set of Microprocessor Programming Cards, Microprocessors and Microsystems, 9(6), pp 274-290, July/August 1985.