computer hobbyists handbook - world radio history

132
Computer Hobbyists Handbook R. A. &J.W. PENFOLD

Upload: others

Post on 21-Apr-2022

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computer Hobbyists Handbook - World Radio History

ComputerHobbyistsHandbook

R. A. &J.W. PENFOLD

Page 2: Computer Hobbyists Handbook - World Radio History
Page 3: Computer Hobbyists Handbook - World Radio History

ComputerHobbyistsHandbook

Page 4: Computer Hobbyists Handbook - World Radio History

FREE CATALOGUE

If you would like, free of charge, a complete catalogue of our entire range of Radio, Electronics and Computerbooks, then please send a stamped addressed envelope to:-

BERNARD BABANI (publishing) LTDTHE GRAMPIANS

SHEPHERDS BUSH ROADLONDON W6 7NF

ENGLAND

Page 5: Computer Hobbyists Handbook - World Radio History

ComputerHobbyistsHandbook

byR. A. & J. W. Penfold

BERNARD BABANI (publishing) LTDTHE GRAMPIANS

SHEPHERDS BUSH ROADLONDON W6 7NF

ENGLAND

Page 6: Computer Hobbyists Handbook - World Radio History

PLEASE NOTE

Although every care has been taken with the production of this book to ensure that any information, projects,designs, modifications and/or programs etc. contained herewith, operate in a correct and safe manner and also thatany components specified are normally available in Great Britain, the Publishers do not accept responsibility in anyway for the failure, including fault in design, of any information, project, design, modification or program to workcorrectly or to cause damage to any other equipment that it may be connected to or used in conjunction with, orin respect of any other damage or injury that may be so caused, nor do the Publishers accept responsibility in anyway for the failure to obtain specified components.

Notice is also given that if equipment that is still under warranty is modified in any way or used or connectedwith home -built equipment then that warranty may be void.

© 1989 BERNARD BABANI (publishing) LTD

First Published - May 1989Reprinted - April 1990Reprinted - May 1992

British Library Cataloguing in Publication DataPenfold, R. A.

Computer hobbyist's handbook1. Microcomputer systems1. Title II. Penfold, J. W.004.16

ISBN 0 85934 196 8

Printed and Bound by The Guernsey Press Co. Ltd, Channel Islands

Page 7: Computer Hobbyists Handbook - World Radio History

Preface

There is a well known computer saying which runs

along the lines "there are true standards, broad

standards, and computer standards". This may seem

rather a pessimistic view of the computer world, but

in the past the practical experience of computer users

has tended to verify this belief. Changing to a differ-

ent computer almost invariably meant changing all

the software and peripherals as well. About the only

equipment that would be likely to operate with the

new system was the mains plugs! Fortunately, things

have improved considerably over the years, and soft-

ware compatibility has to some extent arrived. Also,

manufacturers' own interfaces have largely dis-

appeared in favour of standard types (albeit with a

range of different connectors in most cases).

The aim of this book is to provide a useful range

of data and general information on a variety of

computer topics, including, such things as interfaces,

computer languages, MIDI, and numbering systems.

There is also a useful lexicon of computer terms, and

some helpful appendices. This book is not intended

to be a course in computing, but does provide a

useful reference for data and information in a single

source where it can he quickly and easily found. It

does no: simply supply raw data, but where necessary

detailed explanations are also included. It should be

equally useful to both beginners and more experienced

hobbyists.

R. A. & J. W. Penfold

Page 8: Computer Hobbyists Handbook - World Radio History

ACKNOWLEDGEMENTS

Many of the names and terms mentioned in this book are registered trademarks of various manufacturing, computer,semiconductor and/or software companies. For example:-

ST and ST BASIC are registered trademarks of the Atari Corporation.

IBM, PC, XT, AT, PS/2, PC -DOS and OS/2 are registered trademarks of the International Business MachinesCorporation.

GEM, DR LOGO, CP/M, CP/M Plus and DOS PLUS are registered trademarks of Digital Research Incorporated.BASIC -2, Mallard BASIC and LocoScript are registered trademarks of Locomotive Software Limited.

MS-DOS is a registered trademark of the Microsoft Corporation.

AMSTRAD is a registered trademark of Amstrad Consumer Electronics plc.

Turbo C and Turbo BASIC are registered trademarks of Borland International.

UNIX is a registered trademark of AT & T.

8086, 8088, 80286 and 80386 are registered trademarks of the Intel Corporation.

Z80 is a registered trademark of the Zilog Corporation.

6800 and 68000 are registered trademarks of the Motorola Corporation.

6502 is a registered trademark of the Mostek Corporation.

Page 9: Computer Hobbyists Handbook - World Radio History

CONTENTSPage

Chapter 1THE POPULAR MICROPROCESSORS

1

Precursors1

The 80801

The 68001

The 8 -Bit Chips2

The 65022

The Z804

The 68096

The 18027

The 16 -Bit Chips7

The T199007

The 8086 Series8

The Motorola 680009

Other 16 -Bit Designs11

The Zilog Z8000/Z80011

The National Semiconductor 16032 Series11

The Way Forward12

The Acorn ARM12

The INMOS Transputer12

Register Diagrams12

Chapter 2INTERFACES

17

Printer Ports17

Computer End21

Connections22

Serial Ports25

Word Formats26

Multi -Wire Systems27

Practical Ports27

Other Serial Systems30

MIDI

31

Monitors34

RGB

36

Analogue RGB37

Games Ports39

IEEE48842

Chapter 3LANGUAGES

45

Machine Code45

Assembly Language45

BASIC

45

LOGO

47

Pascal and Modula 249

The Rest50

Chapter 4NUMBERING SYSTEMS

53

Binary Numbers53

Signed Binary54

Ones Complement54

Twos Complement55

Binary Coded Decimal55

Hexadecimal56

Octal57

Conversions57

Bitwise Operations57

Page 10: Computer Hobbyists Handbook - World Radio History

PageChapter 5OPERATING SYSTEMS

59Purpose59Using an Operating System59The Commands60Batch Files63WIMPS

63Chapter 6

COMPUTER GRAPHICS69Block Graphics69Bit -Mapped Graphics71Extended Colour Systems72Sprites74Windows74Co -Ordinate Systems75

Chapter 7LEXICON

77Chapter 8

MIDI TECHNICALITIES99The Hardware99MIDI Codes99Note On/Off

100Key Pressure100Control Change Etc.100Pitch Wheel100Program Change101System Messages101

Appendix AASCII TABLE

103Appendix B

EPSON STANDARD PRINTER CONTROLS105

Appendix CABBREVIATIONS

107Appendix D

SUPPORT CHIPS111

Appendix EDECIMAL - BINARY - HEX

113Appendix F

THE STANDARD SYMBOLS FOR USE IN FLOW -CHARTS115

Index117

Page 11: Computer Hobbyists Handbook - World Radio History

Chapter 1

THE POPULAR MICROPROCESSORS

Considering the large number of models of micro-computer which have been produced. the number ofmicroprocessors which have been used is relativelysmall. Of course, to the majority of users, the actualMPU (microprocessor unit -- the usual abbreviationfor microprocessor) used is immaterial as the com-puter will only be programmed in high-level languages,

or used with commercial software.For the enthusiast, however, or for someone who

wants to program in assembly language, the MPUused may be a key feature in choosing a machine.The information given here should give an indication

of how easy (or otherwise) a particular microprocessoris to program in assembly language.

Here we present details of the major MPUs used in

popular computers, plus a few rare ones. These have

been somewhat arbitrarily divided into groups, theprecursors, 8 -bit chips, 16-bit chips, and leading edgedesigns. For each major chip we give a potted history,details of registers, address modes and comments.

Precursors

The 8080The Intel 8080 first appeared in 1973. The impor-tance of this chip is not so much in what it achieveditself, but more in the fact that it was the startingpoint for the later Z80 and 8086/8088 designs -arguably the most important microprocessors in

data processing applications.Another important fact about the 8080 was that

the CP/M operating system was originally written for

it. This operating system was the first really success-

ful microcomputer operating system, and was

dominant in the market in the late '70s and early'80s, and is still very much in use.

The 8080 series have eight 8 -bit registers, whichcan be paired to form four 16 -bit registers. Most

important of these is the accumulator, which is used

as the destination for many arithmetic and logicoperations. This register can be paired with the flag

register for some operations. Normally the flagregister gives information about the result of opera-tions on the accumulator.

The remaining sets of registers are called the BC,DE and HL pairs, names which were carried over to

subsequent designs. All these can be used as generalpurpose data or address registers, but the HL pair isof particular importance as a memory pointer forseveral memory reference instructions, and also as anaccumulator for 16 -bit arithmetic.

There are also a 16 -bit program counter, and a

16 -bit stack pointer. As is usual for 8 -bit

microprocessors, the 8080 has 8 -bit data and 16 -bit

address buses, allowing 64K of memory to be directly

addressed.One problem with the 8080 was that the specialist

nature of some of the registers meant that the pro-grammer had to remember which operations usedwhich register. and that the instruction set wassomewhat irregular and messy. Unfortunately thisis something else which has been carried over tosubsequent designs!

The 8080 has a basic set of 78 instructions, cover-ing arithmetic, logic, and data moving operations, and

also ccnditional and unconditional jumps, I/O

operations, and interrupts.There are four address modes. Direct addressing

includes the memory address in the instruction.Register addressing specifies a register or register

pair. Register indirect again specifies a register or

register pair. but this time containing the address ofthe data rather than the data itself. Finally, inimmediate addressing, the data immediately followsthe instruction opcode in memory.

Intel produced an improved version of the 8080,the 8085A, but this found uses mostly in control

applications.

The 6800First appearing in 1974, the Motorola 6800 is another

design more important for what followed than foritself. It never achieved any real success in dataprocessing applications, though it was widely used foreducational "one board- computers, and in somecontrol applications (they are often to be found incomputer printers, for instance).

The main problem with the 6800 was its lack of

registers. It had two general purpose 8 -bit accumu-lators, and a 16 -bit index register, but that is all. Thismakes programming for data processing applications

difficult.The register set is typically Motorola, being

elegant and straightforward, and this was in large partthe reason for the success of the 6800 in tutorialapplications. There are 72 basic instructions, but asmany are able to use more than one of the addressmodes, the actual instruction count is 197.

The available address. modes are Direct addressing,

in which a single byte address is specified in theinstruction (so only the bottom 256 bytes, or "zeropage", of memory can be accessed); Extended, likedirect, but with a two -byte address covering thewhole of memory; Immediate, in which the instruc-tion contains the data after the opcode; Inherent, inwhich the instruction implies the location of the data

(i.e. a register); Relative, which allows branching inmemory of +129 to -125 bytes relative to the pro-gram counter; and Indexed, which adds an offset

1

Page 12: Computer Hobbyists Handbook - World Radio History

specified in the instruction to the contents of theindex register to form the address of the data.

Later designs which follow on from the 6800include the MOSTEC 6502, the Motorola 6809. andeven the very advanced 68000 series owe their paren-tage in part to this early design.

The 8 -Bit Chips

The 6502The 6502 is, if you include slight variants such as the6510, a contender for the title of "most popular chipused in home computers". It is the MPU used in theApple I, II, and III computers, the 8 -bit Ataris, theCommodore Pet and VIC-20, the BBC A. B, andMaster series, and (6510) in the Commodore C-64.It has also been used in some less successful models,such as the Acorn Electron and the Oric I and OricAtmos.

The 6502 was developed by MOS Technologyfrom the Motorola 6800, but in an interesting andunusual way. Instead of adding extra features andinstructions, the normal course when developing anew design from an existing one, the 6502 had allunnecessary features removed, ending up with veryfew registers and a small (but adequate) instructionset. There was no attempt to maintain compatibilitywith the 6800.

It may be thought that this would make the MPUdifficult to program, but far from it. There are somedifficulties, but on the whole, it is a lovely processorto program in assembly language, and even program-ming directly in machine code is possible to someextent, something one could not say about mostother microprocessors intended for data processingapplications.

The lack of registers is partially offset by the factthat the bottom 256 bytes of memory (known as"zero page") can be accessed more rapidly than the

The 6502 is used in a number of home computers. This fast (2 MHz) "A" version is in aBBC model B. The other large chips are display and serial port support chips.

Page 13: Computer Hobbyists Handbook - World Radio History

rest of the address range (as the full address can becontained in one byte instead of two) and so zeropage is normally reserved and used instead of internalregisters for many purposes.

The 6502 is very much an 8 -bit chip. All theinternal registers are 8 -bit, except the address registerwhich has 16 bits, allowing a 64K memory space to

be directly addressed. It follows from I 't( thechip has an 8 -bit data bus and a I6 -bit

The 6502 does seem to be very lackirhaving only an accumulator and two i

X and Y. The accumulator has todestination in arithmetic and logicalX and Y registers are intended mindexes to addresses, but can be

purpose registers. With some excbe used interchangeably.

The stack pointer is also onl-stack size to 256 bytes. Sincestack is to save the contents osubroutine calls, with only 8-bstack is not too much of aalways occupies "page 1" of hex). The 8 -bit size of the imuch of a problem as theaccess small blocks of dat.Handling larger blocks o'require some extra prograr

In fact, the 6502 trey

if it were organised int(operation on memory vboundary involves extra

All of this does no.is a slow processor.set allows fast deco'"pipelining". wherewhile the currentthe 6502 a very fa,

For I/O opermapped system,specific inputmean, however ,

,llomemory map, e tronrange. The 80o `-`"maskable

Ifs)

usually useinterrupts.

One veryapplications is its aon.coded decimal) arithmeticbit in the flags register has been set, ail ..

will be performed in BCD until the flag is clearta..The 6502 has just 56 instructions in the instruc-

tion set, but a claimed 13 addressing modes, whichallow the limited instruction set to be used to bestadvantage.

1. ACCUMULATOR ADDRESSING. This mode isused by instructions which operate on the 6502'saccumulator without requiring external data. Such

operations may, however, require some externalmemory access, i.e. the stack, or also involve the Xor Y registers.

2. IMPLIED ADDRESSING. This mode of address-

ing is used only by instructions which operate on one

or more of the 6502's internal registers without

requiring external data. Such operations may,however, require some external memory access, e.g.

'he stack.

er7f0,_,R A

ADDRESSING. In this mode, the- nrogram, immediately after

ess-is

ately

asolutei single -of a 2-

) be zero,accessed.

intage over

i the 6502,for branch

.he opcode is

a result of theis true) this dis-counter, causing

n most assemblers,the program is to

Les the displacement

In indirect address-te contain a

;its of this address, andfurther address, which is

id. True indirect address -microprocessors, and the

a single instruction, JMP.

E X ADDRESSING. In this,ntains a two -byte address to

the X -index register is added..:an be easily incremented and

Je allows easy manipulation of256 bytes or less.

9. /LUTE Y ADDRESSING. This isthe same as 8, exi-pt for using the Y register instead

of the X.

10. INDEXED ZERO PAGE X ADDRESSING. Thebyte following the opcode in this mode contains anaddress in zero page to which the contents of the X

3

Page 14: Computer Hobbyists Handbook - World Radio History

register is added. However, no page boundary cross-ing is allowed so if the result exceeds 00FF hex, awrap -around in page zero occurs.

11. INDEXED ZERO PAGE Y ADDRESSING. Thesame as 10, except that it can only be used with twoinstructions concerned with loading and saving theX register.

12. INDEXED INDIRECT ADDRESSING. Thismode uses the X -index register. The contents of thisregister is added to the contents of a single byte inthe instruction, to form an address in zero page (nopage boundary crossing allowed, as for 9 and 10above). The contents of the byte pointed to andthe next byte form the effective address for theinstruction. In effect, this instruction allows zeropage to be treated as a set of 16 -bit address registers.

13. INDIRECT INDEXED ADDRESSING. Thismode uses the Y -index register. A byte in theinstruction is regarded as an address in zero page,and the contents of this address and the byte follow-ing it have the contents of the Y register added tothem to form the effective address for the instruc-tion. This mode can be used to manipulate blocksof memory of more than 265 bytes, but the highbyte of the address in zero page is not incrementedor decremented automatically when required, socode must be written to do this.

The 6502 family includes a number of otherMPUs such as the 6503, which has a 4K addressrange and comes in a 28 -pin package (the 6505 and6506 are similar but with control line differences),and the 6504, which has an 8K address range andalso comes in a 28 -pin package (the 6507 is similarbut with RDY instead of IRQ). The 6512 is aspecial version intended for dual -processor applica-tions. The 6513 and 6515 are also intended fordual -processor applications, have a 4K address rangeand come in 28 -pin packages. The 65CO2 is a low-

power CMOS technology version of the basic 6502,and the 65C102 is similar, but with some extrainstructions added (mostly made up of combinationsof original instructions), intended to simplify pro-gramming of interrupt servicing and subroutine calls.

One of the most important things about the 6502is that it is widely regarded as one of the precursorsof the so-called RISC (Reduced Instruction Set Chip)chips, which are becoming an increasingly importantstrand of microprocessor design.

The Z80Just as the 6502 was developed from the 6800, so theZ80 was developed by Zilog from the Intel 8080design. However, the Z80 designers took the muchmore obvious path of adding features and instruc-tions, while maintaining compatibility with the earlierchip. The result of this is that the Z80 is undeniably

powerful, and with a comprehensive instruction set,but it is not exactly an elegant design! The instruc-tion set is rather untidy, and there are manyrestrictions on which instructions can use whichaddress modes, so that few programmers would tryto write Z80 assembly language without the manualopen at their side.

In terms of the number of models of computerdesigned around the chip, the Z80 can easily claimthe title of "most popular microprocessor". In thefield of home computers, the Z80 is best known asthe heart of the immensely popular Sinclair ZXSpectrum models, and it was also used in the earlierZX80 and ZX81. It is also used in the hardly lesspopular Amstrad CPC series, and in other models toonumerous to list.

The decision to maintain compatibility with the8080 was a good move on the part of Zilog, as itmeant the Z80 had a good software base availablewhen introduced, including most importantly, theDigital Research CP/M operating system. This O.S.was very widely used during the early '80's (andstill is), and in fact there were far more Z80 basedCP/M systems designed than 8080 based, to theextent that many people nowadays believe thatCP/M was in fact developed for the Z80.

By the standards of 8 -bit microprocessors, theZ80 has a very large set of general purpose registers.In fact, there are two complete sets of 4 sixteen -bitregisters, with two instructions to switch betweenthem. This is very useful when servicing interrupts,as it allows the registers to be "saved" by switchingto the alternate set, instead of stacking them. These16 -bit registers can also be used as pairs of 8 -bitregisters.

The program counter has sixteen bits, as does thesingle stack pointer. The Z80 also has two sixteen -bitindex registers. There are also two registers whichare peculiar to the Z80. The I register is used duringa special interrupt mechanism called Mode 3, and theR register is used for memory refresh purposes.

The Z80 has an 8 -bit data bus and a 16 -bit addressbus, allowing it to directly access 64K of memory.It has special I/O instructions, so peripherals do notuse up space in the memory map.

The instruction set comprises some 158 instruc-tions. This compares with 78 on the 8080. Thoughthere is compatibility between the two chips at thesource code level, some of the assembly languagemnemonics have been changed for the Z80.

Zilog claim 10 addressing modes for the Z80,though it is hard to see how they arrive at this figure.Manufacturers all have their own ideas as to whatconstitutes an addressing mode. The following is asummary of the modes available, and is comprehen-sive, though it does not follow the manufacturer'sideas exactly.

I. IMPLIED ADDRESSING. This is used by thoseinstructions which operate on one or more of the

4

Page 15: Computer Hobbyists Handbook - World Radio History

The Z80 is available under other type numbers. This NEC version is in a ZX81.

Z80's registers without requiring external data.

(Zilog make a distinction between implied addressing,

which is limited to instructions which do not have a

specific field to point to an internal register, and

register addressing for instructions which do.)

2. IMMEDIATE ADDRESSING. In this mode, the

operand is included in the instruction immediatelyafter the opcode. As the Z80 has both 8 -bit and

16 -bit registers, there are two types of immediate

addressing, for 8 -bit and 16 -bit operands. Where

the operand is 16 bits long, the mode is sometimes

called immediate extended.

3. ABSOLUTE ADDRESSING. In absolute address-

ing, the location of the operand in memory isspecified in the instruction. The address is two bytes

long, so anywhere in the 64K of memory possible can

be accessed.

4. ABSOLUTE SHORT ADDRESSING. Similar to

3, but the address occupies only a single byte, so only

addresses in the first 256 bytes of memory can be

accessed (similar to the 6502's zero page). This

mode is only used by the RST instruction.

5. RELATIVE ADDRESSING. In this mode, the

byte following the opcode is regarded as a displace-

ment from +127 to -128. This is added to theprogram counter to cause a program branch. Only

used by JR (jump relative) instructions. With most

assemblers, you would specify the address to which

you wish the program to branch, and the assembler

will calculate the displacement for you.

6. REGISTER INDIRECT ADDRESSING. Here,

any of the register pairs BC, DE or HL may be used

to contain the address where the operand is to be

found. Where the registers are used to point totwo -byte data, the low byte is at the address speci-

fied, and the high byte at the next higher address in

memory.

7. INDEXED ADDRESSING. In indexed addressing,

the address specified in the instruction is modified by

having added to it the contents of either the IX or IY

5

Page 16: Computer Hobbyists Handbook - World Radio History

index register, thus giving the effective address forthe instruction. This is mostly used for accessingelements in tables of data.

Zilog followed up the Z80 with the Z8000 (16 -bit)and Z800 (8-16 bit with Z80 compatibility), butneither of these has achieved any real success.

The 6809Like the 6502, the 6809 was developed, in a sense,from the 6800/6802, but this time by Motorolathemselves. They took a different course from eitherMOS Technology with the 6502, or Zilog with theZ80 (from the 8080). The 6809 was largely a newdesign, without extra registers untidily tacked on or amessy instruction set, but a degree of code compat-ibility with the 6800 at the source code (assemblylanguage) level was maintained.

The 6809 is a very elegant design, with a nice tidyset of registers, and an easy -to -use instruction setdevoid of complications as to which instructions canuse which address modes. It is, in the opinion ofmany, the best of the 8 -bit chips.

It is therefore unfortunate to have to record thatthe 6809 has never been used in a computer worthyof its talents. The only notable designs to employ ithave been the Dragon and the Tandy Colour Com-puter, which in fact are very similar machines interms of electronics. Though not bad computers,they were never among the best. The problem forthe 6809 was that it came along too late, whenprogrammers had learned to live with the deficiencies(real and imagined) of the Z80 and 6502, and thesechips had acquired considerable software bases.

The 6809 has two 8 -bit accumulators, which canbe used together as a single 16 -bit register. It alsohas two 16 -bit index registers, and two 16 -bit stackpointers. The ability to maintain two independentstacks makes it easy to implement high-level langu-ages. The 6809 has a form of zero -page, allowing a256 -byte page in memory to be used, in effect, asextra data registers, but thanks to an 8 -bit directpage register, this can be anywhere in the memorymap.

The data bus is 8 bits wide, and the address bus16 bits, allowing 64K of memory to be directlyaddressed. Memory mapped I/O is used.

There is a basic set of 59 mnemonics in 6809assembly language, but with variations allowed, andten address modes available, there are in effect some1464 instructions available. So elegant and straight-forward is the 6809 instruction set that it is thefavourite of many programmers for assemblylanguage programming. Uniquely in 8 -bit micro-processors, the 6809 has an 8 -bit multiply instruc-tion, yielding a 16 bit result. This gives some idea ofthe advanced nature of the design.

The claim of 10 addressing modes for the 6809 isan honest one. As some other manufacturers count,there could be as many as 20.

6a

1. INHERENT ADDRESSING. Like impliedaddressing, where the instruction implies any neces-sary addressing information.

2. IMMEDIATE ADDRESSING. The data for theinstruction comes immediately after the opcode inmemory, and can be one or two bytes long.

3. EXTENDED ADDRESSING. In this mode, the16 -bit address of the data follows the opcode inmemory.

4. EXTENDED INDIRECT ADDRESSING. One ofthe very few examples of true indirection in micro-processors. In this mode, the two bytes after theopcode contain the address in memory where theaddress of the data is to be found.

5. DIRECT ADDRESSING. This is similar to the6502's zero page addressing. Where the opcode isfollowed by an 8 -bit address. However, the highbyte of the address, instead of being forced to bezero, is obtained from the direct page register, soany page in memory can be used.

6. REGISTER ADDRESSING. In this mode theopcode is followed by a reference to one or more ofthe registers to be used in the operation.

7. INDEXED ADDRESSING. Really a whole rangeof register -indirect addressing modes which can useeither of the index registers, either of the stackpointers, and in some cases the program counter. Ingeneral the contents of a register are added to anoffset, which can be zero offset, self-explanatory;constant offset, where the offset is a two's comple-ment number 5, 8, or 16 bits in length following theopcode; accumulator offset, which uses an 8 or 16bit offset stored in one of or both of the accumula-tors; auto increment, where a zero offset is used andthe pointer register is incremented by one or twoafter it has been used, allowing tables of one or twobyte data to be stepped through automatically; andfinally auto decrement, allowing tables to be steppedthrough backwards.

8. INDIRECT INDEXED ADDRESSING. Used inaddition to one of the previous modes. In this case,the address formed by the indexed mode points tothe address of the data, not the data itself.

9. RELATIVE ADDRESSING. This mode allowsjumping forward or backward in memory relative tothe program counter. A 16 -bit offset is allowed, sothe whole of memory can be covered. This mode isused only by branch instructions.

10. PROGRAM COUNTER RELATIVE ADDRESS-ING. This mode allows data to be accessed not by anabsolute address, but by their current difference from

Page 17: Computer Hobbyists Handbook - World Radio History

the program counter. This mode, together withthe previous one, allows the writing of positionindependent code, a very useful feature.

Though the 6809 never achieved great commercial

success, at least as far as use in home micros is

concerned, it was the immediate precursor of theMotorola 68000 series of 8/16, 16 and 32 bit micro-

processors, widely regarded as the finest MPUscurrently available, at least as far as ComprehensiveInstruction Set Chips (CISC) are concerned.

The 1802The 1802 MPU from RCA is one of the less wellknown devices, but has probably been used to agreater extent than many in the computer world

would think. It was in fact used in a home computer

called the "Comx 35". but this never sold in anynumbers in the U.K. By most accounts it was quite

fast for an 8 bit machine, which would suggest thatthe 1802 does not lack anything in performance if

used skillfully. The 1802's claim to fame is that it

is a CMOS device, which means that it achieves a low

level of power consumption. These days a number of

popular MPUs are available in low power CMOSversions, which has severely reduced the popularity of

the 1802. However, it was first launched quite early

in MPU history (about 1973), and at that time it was

the only low power microprocessor that was avail-

able. In fact it remained the only low power micro-

processor for a number of years. It achieved

substantial sales, probably because it could he usedin battery powered control systems etc. where thehigh current consumption of other MPUs made them

virtually unusable.The 1802 is rather crude by modern standards,

although it has one or two advanced features such

as built-in clock generator and DMA (direct memory

access) controller. It has sixteen 16 -bit general

purpose registers, and its instruction set very much

revolves around these. They can be used as programcounters, data registers, or memory pointers. The

1802 tends to be a little confusing when first usingthe device, but it can work well in control applica-

tions. It can also run interpreted languages

surprisingly fast (as in the Comx 35 with its inter-

preted BASIC). It seems likely though, that the1802 will continue to give way to low power versions

of more recent devices.

The 16 -Bit Chips

The 119900The 9900 was introduced in 1976, and thus has some

claim to be the first 16 -bit chip. It was, however,fabricated using the technology of the 8 -bit chips,and this lead to some idiosyncracies in the design.The memory address range was also limited to thatwhich would be expected of an 8 -bit chip.

The only computer to employ this chip was TexasInstruments' own TI99. This computer had its good

points, but was very expensive and enjoyed only alimited success, largely as a home games machine. It

now has a small cult following. The chip itselfachieved success in other fields, such as in navigation

systems and avionics where the 16 -bit architecturewas a real benefit.

It follows from this that the 9900 has neveracquired a large general-purpose software base.

One feature of the 9900, largely dictated by the

use of 1976 technology is that there are very few

registers indeed on the chip itself. Most of them,including even the accumulator, are in RAM. Theonly registers on -chip are a 15 -bit program counter

(to address 32K words of memory - byte addressingnot being possible), the status register, and a work-

space pointer. This is used to point to the area of

RAM which is being used as the registers which

would normally be on the chip. There are effectively16 registers in a workspace, 6 of which have (at least

in part) dedicated functions. The remainder aregeneral purpose in nature. Multiple workspaces are

possible, so interrupts can be handled by switchingworkspaces rather than by saving the registers on the

stack.As already mentioned, the address bus is 15 bits

wide, and the data bus is 16 bits, as one would expectfrom a true 16 -bit chip.

The 9900 instruction set contains 72 basic instruc-tions, so is quite easy to learn, but coupled with eightaddress modes (of which some instructions can use 5,

others one of the remaining 3) it is also quite flexible

and comprehensive.As you might expect, many of the eight address

modes are unique to the 9900.

1. WORKSPACE REGISTER ADDRESSING. Thisis similar to implied or inherent addressing modes,where the instruction contains the address of theworkspace register which contains the operand.

2. WORKSPACE REGISTER INDIRECT

ADDRESSING. Here, the opcode includes theaddress of a register which contains the address of

the data.

3. WORKSPACE REGISTER INDIRECT AUTOINCREMENT ADDRESSING. This is the same as(2), except that afte- the data has been fetched, theregister is incremented. This instruction is used forstepping through tables of (16 -bit) data.

4. SYMBOLIC ADDRESSING. This is really directaddressing, in which the address of the data followsthe opcode in program memory.

5. INDEXED ADDRESSING. In this mode, a baseaddress follows the opcode in memory, and thecontents of a register is added to this to form the

7

Page 18: Computer Hobbyists Handbook - World Radio History

effective address. The contents of the register is asigned number, allowing positive or negative offsetsfrom the base.

6. IMMEDIATE ADDRESSING. Conventional,where the word of memory immediately after theinstruction contains the operand.

7. PROGRAM COUNTER RELATIVE ADDRESS-ING. Used only for jump instructions, and has arange of -128 to +127 words.

8. CRU RELATIVE ADDRESSING. This mode isused for I/O operations. The 9900 has a uniqueCommunications Register Unit for I/O.

The 8086 SeriesWhen Intel saw the success which Zilog had with theZ80, essentially an improved 8080A, they decidednot to respond with an enhanced 8080 design of theirown, but instead to move on directly to the nextgeneration of 16 -bit chips. Thus the 8086, which wasone of the first true sixteen -bitters to become com-mercially available. The 8086 was an almost immedi-ate success, both in data processing and in controlapplications.

The 8086 was quickly followed by the 8088, asoftware -compatible design but with an 8 -bit databus. This MPU has full 16 -bit architecture insidebut is slower in operation as it requires two fetchesfor word -length data. It has the advantage of allow-ing cheaper systems to be constructed around it.In fact, the 8088 was for a long time the moresuccessful of the two types, being used in the IBMPC, and many of the compatibles which have beenproduced in vast numbers. However, the 8086 isnow used in the AMSTRAD PC1512/1640 com-puters, and the sales figures of these could reversethis.

The 8086 series has a vast software support,largely because of its use in the IBM PC. There aretwo largely compatible operating systems, PC -DOS(IBM) and MS-DOS (Microsoft). Virtually any typeof software ever written is available to run underthese, including a very wide range of languages.

The 8086 has fourteen 16 -bit registers. Theseare arranged as three sets of four registers, theinstruction pointer (program counter) and the flagsregister.

The set of general purpose registers can be used aseither four 16 -bit registers or eight 8 -bit registers.The registers are essentially similar to those in the8080A, though the names used are slightly different.Unlike the 8080A, the registers are in general inter-changeable rather than dedicated to specific tasks,but there are still some instructions which can onlyuse particular registers.

The second set of registers are called the segmentregister file and are used for address generation. The8086 has a unique form of memory management

called segment addressing. The chip can address 1

megabyte of memory, which would require a 20 -bitaddress, but only 16 -bit values are handled withinthe chip. To provide the required 20 -bit address, thecontents of a segment register is shifted left by fourbits, and ANDed with another 16 -bit value whichmay come from the program counter, stack pointer,an index register, a general register, or memory. Thefour registers allow 64K of memory each, or 256Kin all, to be addressed without reloading the registers.The registers are called the Code Segment (CS), DataSegment (DS), Stack Segment (SS), and Extra Seg-ment (ES).

The third set of registers contains index registersand memory pointers. These include the stack pointer(SP), Base Pointer (BP), also used for the stacksegment, and the Source Index (SI) and DestinationIndex (DI) pointers.

The 8086 has a 16 -bit data bus and a 20 -bitaddress bus. Multiplexing is used to allow these to beprovided in a package with only 40 pins. The 8088has only an 8 -bit data bus.

The 8086 uses the system of having relatively fewmnemonics in the instruction set, but modifyingthese by address mode and other qualifiers to providea comprehensive range of instructions. There areroughly 100 mnemonics in the instruction set.

There are nine address modes available, the firstfour of which are conventional. These are:-REGISTERIMMEDIATEDIRECTREGISTER INDIRECT

The other modes are:-

BASED ADDRESSING. In this mode the effectiveaddress is computed by summing a displacement inthe instruction with the contents of the BX or BPregister. Using the BP register allows access to dataon the stack without POPing.

INDEXED ADDRESSING. Here the effective addressis computed by summing a displacement with thecontents of the SI or DI registers. Normally thedisplacement will be the base of a table of data, andthe index register will be used to step through it.

BASED INDEXED ADDRESSING. The effectiveaddress is computed by summing the contents of abase register, an index register and a displacement.The use of two registers allows two-dimensionalarrays of data to be accessed.

STRING ADDRESSING. This is used with stringinstructions which cannot use the above modes. Inthis mode the index registers are used in place of theSI and DI registers.

I/O DIRECT ADDRESSING. This uses an 8 -bitaddress to directly access one of 256 I/O ports directly.

8

rr

Page 19: Computer Hobbyists Handbook - World Radio History

The Motorola 68000After the lack of success of the 6800 and 6809 in

data processing applications, Motorola counteredthe Intel design with a processor which did much to

consolidate Motorola's reputation for producing

designs with both power and elegance.The 68000 series are 'clean sheet' designs with no

attempt at compatibility with previous products.

They have, in fact, a 32 -bit internal architecture, andvarious models are available with from 8 to 32 -bitdata buses, and 20 to 32 -bit address buses.

The 68000 series were slower to achieve commer-cial success than the 8086 series, but are now used in

a wide range of computers, including the AppleMacintosh (and the previous Lisa model), the Atari

ST series, and the Commodore Amigas. The cut -

down 68008 was used (some would say misused) in

the ill-fated Sinclair QL, and there are also several

very large multi-user systems based on these chips.

There are several operating systems implementedfrom these microprocessors, including versions of

UNIX and XENIX for multi-user and multi -tasking

applications.

The 68000 series are particularly well endowed

with registers. There are eight 32 -bit data registers,

which are general-purpose in nature and interchange-

able (i.e. no instructions have to use a particularregister), and seven 32 -bit address registers, which

can be used as base or index registers, or as extra

stack pointers. The address registers can also be

used interchangeably. There are also two stackpointers, one for 'user' mode and one for 'supervisor'

mode (used for servicing interrupts, among otherthings), the program counter, and the flags register.

The 68000 has a I6 -bit data bus and a 24 -bitaddress bus, thus having an address range of 16

Mbytes. The 68008 has an 8 -bit data bus and a 20 -

bit address bus (1 Mbyte). The 68010 is like the68000 but with internal support for virtual memorymanagement. The 68020 has the full 32 -bit data bus

and 32 -bit address bus for a 4096 Mbyte address

range (!).The 68000 has a straightforward instruction set

with just 56 basic mnemonics, but when multiplied

by the available addressing modes and data typeoptions you end up with a set of over 1000 unique

Thu 68000 micro. This one is fitted in a development system, but this processor is used

in popular computers such as the Atari STs and Commodore Amigas.

Page 20: Computer Hobbyists Handbook - World Radio History

The 68008 is the 8 bit bus version of the 68000. This device is in a Sinclair QL.Most other computers seem to use the standard 16 bit bus version.

instructions. Most instructions can access byte, word(16 -bit) or long word (32bit) data, but only wordand long word access can be used with the addressregisters. Of particular interest is the MOVE instruc-tion, which replaces the load and save instructions ofother processors, and allows memory to register,register to register, and register to memory datamoves, and also direct memory to memory moveswithout using processor registers.

There are fourteen address modes.

1. DATA REGISTER DIRECT. The operand is in aspecified data register.

2. ADDRESS REGISTER DIRECT. The operand isin a specified address register.

3. ADDRESS REGISTER INDIRECT. The addressof the data is contained in one of the addressregisters.

4. ADDRESS REGISTER INDIRECT WITH POSTINCREMENT. This is similar to (3), but the address

in the register is automatically incremented after use.This can be used for stepping through data tables.The amount of the increment can be 1, 2, or 4 forbyte, word or long word data.

5. ADDRESS REGISTER INDIRECT WITH PREDECREMENT. This is the complement to (4), andis used for stepping down through tables. Note thatthe decrement occurs before the data is accessed.These instructions can be used together for stack-typepop and push operations.

6. ADDRESS REGISTER INDIRECT WITH DIS-PLACEMENT. In this mode, a 16 -bit displacement inthe instruction is added to the contents of an addressregister to form the effective address of the data. Itis a form of indexed addressing.

7. ADDRESS REGISTER INDIRECT WITH INDEX.This is another form of indexed addressing, but herethe index value comes from a data register, and thereis also an 8 -bit displacement in the instruction. Thedisplacement, contents of the address register and

10

Page 21: Computer Hobbyists Handbook - World Radio History

contents of the data register are added together toform the effective address.

8. ABSOLUTE SHORT ADDRESSING. This is adirect addressing mode, but the address can be only

16 bits long. It is similar to 6800 direct or 6502

zero -page addressing, but can access 64K bytes of

memory.

9. ABSOLUTE LONG ADDRESSING. A directaddressing mode using a full 32 -bit address, capable

of accessing any valid memory location.

10. PROGRAM COUNTER RELATIVE WITH DIS-PLACEMENT. This mode is provided to allow some

degree of position -independent code to be written.A 16 -bit displacement is added to the contents of the

program counter to form the effective address of the

data.

11. PROGRAM COUNTER RELATIVE WITH

INDEX. In this mode the effective address is formed

by adding the contents of the program counter, an

index register, and an 8 -bit displacement in the

instruction. It allows the whole of memory to be

accessed relative to the program counter.

12. IMMEDIATE. This mode is conventional,except that (as usual on the 68000) the data may bebyte, word, or long word in length.

13. CONDITION CODE/STATUS REGISTER. Thismode allows access to the SR or CCR to test, set orreset bits in these registers, using logical instructions.

14. IMPLICIT. This mode is conventional.

Other 16 -Bit Designs

The 8086 series and the 68000 series are the only twosixteen bit designs which have achieved commercial

success, at least in home and business computers.There are, however, several other designs which have

not found wide application but are mentioned herefor completeness.

The Zilog Z8000/Z800The Z8000 appeared shortly after the 8086, and onthe face of it seemed to be a better design, havingeight times the address range and faster performance.However, sales never really took off. There are manypossible reasons for this. The Z8000 was not com-patible with any previous product in any degree, butthe opportunity of starting with a clean sheet was not

used to provide a particularly tidy instruction set.Also, the Z8000 was followed quickly by the 68000,which caught the imagination of designers. The 8086quickly generated a software base, the 68000 wasperceived as the most exciting design, so the Z8000rather fell between two stools.

In fact, there is no processor actually called the

Z8000. This is the generic name for the family ofdevices, of which there are four. The Z8001 has a16 -bit data bus and a segmented address range of 8

megabytes. The Z8002 comes in a smaller (40 pin

instead of 48) package and has a 64K byte address

range only. The Z800.3 and Z8004 have virtual

memory and multi -processor support, but are other-wise identical to the Z8001 and Z8002 respectively.

The Z8000 has a set of 110 basic mnemonicswhich, in combination with the available data typesand address modes expands to a little over 400

discrete instructions. It can be seen that this does

not compare well with the 68000 which achievesover 1000 instructions using just 56 mnemonics.

There are 8 fairly conventional address modes.Zilog tried for a second bite at the cherry with the

Z800. This is a 16 -bit design which is code -compatible

with the Z80 8 -bit chip, and so can (at least in

theory) use the Z80 software base, including CP/M.However, by the time this chip appeared, the 8086

and the MS-DOS/PC-DOS operating systems hadbecome the new industry standard, and all the

companies which had formerly produced CP/Mmachines had moved on to producing IBM PC

compatibles. Thus, when this chip arrived, there

was simply no place for it in the market.The Z800 register set is virtually identical to that

of the Z80, with the addition of an extra stackpointer. The instruction set is that of the Z80 with

all its shortcomings, with the addition of somemore "modern" instructions such as multiply anddivide. There are nine address modes, many of whichobviously are based on those of the Z80, but amongthe extra ones are Program Counter Relative andStack Pointer Relative, which give a limited abilityfor position independent code.

The National Semiconductors 16032 SeriesThough National Semiconductors is one of the largestsemiconductor manufacturers in the world, they were

rather late onto the microprocessor scene. The

ambitious 16032 serifs of designs were intended toenable them to catch up with the leaders.

As with the 68000 series, the 16032 series is arange of compatible designs with 32 -bit internalarchitecture, but with a choice of 8,16 or 32 -bit data

bus widths. The designs, in fact, have a great similar-

ity to the Motorola architecture, with eight general-purpose registers and eight special-purpose registers.The instruction set, again like the 68000 series, isalso regular and elegant. There are around 100 basicmnemonics, but with 9 address modes and three data

types they expand to nearly 1000 distinct instructions.All the 16032 series support virtual memory

operations. The 16032 has a 16 -bit data bus and a

24 -bit address bus, addressing 16 megabytes of unseg-mented memory. The 16008 has a cut -down 8 -bitexternal data bus, but the same address range. The32032 has full 32 -bit data and address buses.

11

Page 22: Computer Hobbyists Handbook - World Radio History

The main problem with the National Semiconduc-tor designs was that they took a long time to actuallyarrive in volume, and by the time they did, the68000 series had taken residence in most of thesockets they might have occupied. Such applicationsas they have found are mostly in the scientific field.The 16032 is available as a second processor for theBBC Micros and is used in the BBC Master Scientific.

The Way Forward

Though the successful 16 -bit chips have a long lifeahead of them yet, rivals are appearing on thescene. As mentioned in the section on the 6502,there are two schools of thought in microprocessordesign. Chips such as the 68000 come from theCISC (Complex [or Comprehensive] Instruction SetChip) school. The other school favours ReducedInstruction Set Chips (RISC), in which the instruc-tion set is reduced to a relatively few frequently -

executed instructions.The idea behind this is that the microprocessor

spends a very high percentage of its time executingthese popular instructions, and the remaining instruc-tions are used very infrequently. By reducing the sizeof the instruction set, the processor has to do lesswork internally to decode and execute the instruc-tions, thus executing code faster. The jobs done bythe omitted instructions can be done by combinationsof the remaining instructions when required. Twoprocessors of this type are now available and cominginto use, and others are under development, thoughthey may not find their way into home/businesscomputers.

The Acorn ARMThe Acorn ARM comes from the manufacturers ofthe BBC micros, who wanted a "super 6502" designfor a new range of machines. In fact, the ARM(Acorn RISC Machine) is rather more than that. Itis used in the Acorn Archimedes computers, whichat time of writing are generally accepted as the fastestavailable microcomputers.

The ARM has 44 instruction codes, to performsuch jobs as load/store single registers, load/storemultiple registers, arithmetic, logical, branch andsoftware interrupts. Instructions such as multiplyand divide, or block moves, are not included. Aninteresting feature is that all instructions include aconditional test. This helps reduce the number ofbranches in a program, which would otherwise

reduce the efficiency of the ARM, which uses pipe -lining to speed up program execution. Each timethere is a branch, the already -decoded instructionsin the pipeline have to be discarded.

Only two addressing modes are used, base relativeand program counter relative. However, the waythese are implemented is highly flexible, and allowsthe more complex modes of CISC chips (such asauto-increment/decrement modes) to be simulated.

The ARM has a 32 -bit data bus and a 26 -bit addressbus, allowing 64 megabytes of memory to be directlyaddressed. There are 25 32 -bit registers on the chip,of which 16 are normally available to the programmer.

At time of writing it is too soon to say howsuccessful the ARM chip and the Archimedes com-puters will be, but they have the advantage of beingable to run both MS-DOS and 6502 software bymeans of emulators, and they are now beginning toattract native software support.

The INMOS TransputerThe Transputer is a much more radical design thanthe ARM, being intended as a device for use in arraysto produce parallel -processing machines - a veryradical concept.

The basic Transputer is a 32 -bit device with 32 bitregisters, 32 bit data bus and 32 bit address bus,capable of addressing 4 gigabytes of memory. 16 bitvariants are also planned. The chip also has 2K ofon -chip memory. Each Transputer also has four high-speed serial data links to other Transputers to enablethem to be connected in parallel processingapplications.

The Transputer has very few registers, in fact onlysix, and three of these are dedicated to use as anexpression-evaulator stack. The on -chip RAM is usedto hold data in place of general-purpose registers.

The Transputer has around 60 instructions in itsinstruction set, but it is not intended ever to beprogrammed directly in assembly language. Instead,a special high level language called Occam has beendeveloped for it, and this language is also designed forparallel processing. Addressing modes in the conven-tional sense do not apply to the Transputer.

Transputer add-on boards are now available forseveral computers, including the IBM PC andcompatibles, and it is the heart of the Atari ABAQ.

Register DiagramsFor handy reference purposes, register set diagramsfor the popular 6502, Z80, 68000, and 8086 MPUsare provided in Figures 1.1 to 1.4.

12

Page 23: Computer Hobbyists Handbook - World Radio History

X Index Register

Y Index Register

Accumulator

Program Counter (H) Program Counter (L)

1 Stack Pointer

N

Status Register

B D C

7 6 5 4 3 2 1 0

Fig. 1. 1 The 6502 register set (it a more powerful processor than this would suggest)

Page 24: Computer Hobbyists Handbook - World Radio History

Main Register Set

Accumulator Flags FB Register C RegisterD Register E RegisterH Register L Register

Alternate Register Set

Accumulator' Flags F'B Register' C Register'D Register' E Register'

H Register' L Register'

General Registers

Interrupt Vector I Refresh RIndex Register X

Index Register Y

Stack Pointer

Program Counter

Flag Register Details

S H PV N C

7 6 5 4 3 2 1 0

Fig. 1.2 The Z80 register set

14

Page 25: Computer Hobbyists Handbook - World Radio History

31

DO

D1

D2

D3

D4

D5

D6

D7

AO

Al

A2

A3

A4

A5

A6

A7

1615 8 7 0

PC

USER STACK POINTER

SUPERVISOR STACK POINTER

T SMI2

Fig. 1.3 The 68000 register set

11

STATUS FLAGS

N V C

I5

Page 26: Computer Hobbyists Handbook - World Radio History

AX

BX

CX

DX

SP

BP

SI

DI

CS

DS

SS

ES

IP

General RegistersAH Register AL RegisterBH Register BL RegisterCH Register CL RegisterDH Register DL Register

Pointer And Index Registers

Stack Pointer

Base Pointer

Source Index

Destination Index

Segment Registers

Code Segment

Data Segment

Stack Segment

Extra Segment

Instruction Pointer

0 D

Flag Register

I T S z M A P MC11 10 9 8 7 6 5 4 3 2 1 0

Fig. 1.4 The 8086 register set

Page 27: Computer Hobbyists Handbook - World Radio History

Chapter 2

INTERFACES

There can be relatively few people who use a

computer system that consists of a single stand-aloneunit. The vast majority of computer systems consistof several interconnected units, and the system 1 am

using to write this piece is not untypical with its main

unit, separate keyboard, dot matrix printer, penplotter, monitor, and mouse. All these peripheralsconnect to the main unit via the appropriate leadand port on the main unit. About half a dozen portsper computer would seem to be about "par for thecourse", but some of the better endowed machines(such as the BBC Model B) have a dozen or more.

In this chapter we will consider a number of themore common types of interface in some detail. Thisshould help anyone who is trying to make up leads to

interconnect two pieces of reasonably standardcomputer equipment, and should also help to avoidproblems with trying to connect together two incom-patible items of equipment. I referred to "reasonablystandard" pieces of equipment above, rather than just"standard" equipment. Having used a large numberof different computers and peripherals I have come tothe conclusion that there is no such thing as a truecomputer standard. This may seem a bit cynical, butit is probably just being realistic about it rather than

cynical! Many computer users have experiencedproblems in connecting together two pieces of gear

that could reasonably be assumed to be totallycompatible and easily used together. Things areactually much better now than they once were, asmanufacturers have tended to fall in line with marketleaders, and something close to true standards haveemerged in some cases. There can still be unsuspec-ted problems though. My advice is to use ready-madeconnecting cables as far as possible, even if you areexperienced at electronics and making up cables.Ready-made cables can save a great deal of time andfrustration, and in most cases are not too expensivethese days.

Printer PortsPrinters are normally interfaced to computers via aparallel port, or a "Centronics" port as it is oftencalled (presumably because it was originated by this

company). Plotters are sometimes connected via aparallel port, but it is not used for many other typesof equipment. In fact there are no other commonitems of equipment that use this type of interface,and apart from printers and plotters it is generallyonly used for special devices such as pieces of scien-

tific equipment. Printers and plotters are oftenconnected to computers by way of a serial interface.However, this is a general purpose type of port which

is used with a wide range of equipment, and it is con-sidered in a separate section of this chapter.

Data is sent to printers and most other computerperipherals in the form of eight bit binary numbers.With a parallel interface such as the Centronics type,each bit of data is carried by a separate wire. Theseare normally called "Data 0" to "Data 7", or moreusually just "DO" to "D7" (or some similar abbrevi-

ation). In terms of the electrical signals carried bythese wires, there are orly two valid signal levels.The signal must be "high" (logic 1 or about 3 to 5volts), or "low" (logic 0 or about 0 to 2 volts). In

terms of ordinary decimal numbers, a line alwaysrepresents 0 if it is at logic 0, or a certain value if it

is set to logic 1. This list shows the values repres-ented by each line when it is set to 1.

LineData 0Data 1Data 2Data 3Data 4Data 5Data 6Data 7

Decimal Value1

248

163264

128

By setting up various bitoutputs it is possible to represent any decimal integerfrom 0 to 255. Exactly how each value is interpretedby the printer depends on the design of the printer.Most printers have a character set that is based onthe ASCII (American Standard Codes for InformationInterchange) set. For example, ASCII code number85 is a "U" character. This is a subject that is cover-ed in detail in another chapter, and it is not somethingthat will be considered further here.

The eight data lines plus an earth connectionenable values to be sent to the printer, but in practicemore connecting lines are required. The first problemis that the printer must know when a new "byte" ofdata is ready to be read from the data lines. Other-

wise it could read the same piece of data two or moretimes, or bytes of data could be missed altogether.The strobe line is used to indicate that new bytes ofdata are present on the data lines, and the signal onthis line is a brief negative pulse (i.e. it is normallyhigh, but it goes low for a short period when a newbyte of data is present on the data lines).

There is a second problem in that a parallel inter-

face is capable of transferring data at quite pheno-

menal rates. The maximum rate achievable dependson the exact hardware used, but a few hundredthousand bytes per second would be quite typical.Most printers can only print about 100 to 200characters per second, and far less than this in the"near letter quality" mode. The printer therefore

17

Page 28: Computer Hobbyists Handbook - World Radio History

Standard IBM style parallel and serial ports. These are on an Amstrad PC1512, but othercomputers such as the Atari STs use the same connectors and basic method of connection.

needs sonic means of signalling to the computerwhether or not it is ready to receive fresh data. Itcan then provide a hold -off during periods when it isprocessing received data, and is not ready to receiveany more. This method of controlling the flow ofdata is known as "handshaking".

Parallel interfaces actually have two handshakelines, which are called "BUSY" and "ACKNOW-LEDGE". I am not quite sure why two handshakelines should be deemed necessary, since one wouldseem to be quite sufficient to control the flow ofdata correctly. In fact some computers have parallelprinter interfaces that only implement one or theother of these lines (the BBC Model B series ofcomputers only have the "acknowledge" handshakeline for instance). They should both be present andfully operational on printers though. If we considerthe acknowledge line first, this is normally in thehigh state. It stays at logic I when a byte of datahas been received, but when this byte has been pro-cessed the "acknowledge" line is briefly taken lowby the printer. The computer must therefore providea fresh byte of data (if any data is ready to be sent)

each time it receives a negative pulse on the "acknow-ledge" line. The "busy" line is normally low, and it isset high by the printer when it receives a byte of data.It is set low again when the printer has processed thebyte of data and is ready to receive the next one.

The timing diagram of Figure 2.1 shows typicalwaveforms for a parallel printer interface. You willnote from this that the "acknowledge" and "busy"signals are very similar. In a few cases I have foundit necessary to connect the "busy" input of the com-puter to the "acknowledge" output of the printer inorder to obtain satisfactory results. However, thistype of thing is a rarity, and normally the handshakeoutputs of the printer must be connected to thecorresponding handshake inputs of the computer.In most cases connecting only one or the other ofthese lines will suffice, but if both inputs are imple-mented on the computer, then it is advisable toconnect them both at the computer end of thesystem.

Figure 2.2 shows connection details for a standardparallel printer port. This shows the connector look-ing onto the port of a printer, or as it would be seen

18

Page 29: Computer Hobbyists Handbook - World Radio History

Fig.2. 1 Timing diagram for a Centronics printer port

18 1

36 19

Fig.2.2 The standard Centronics port uses a 36 -way connector (see text for a rst of pin functions)

Page 30: Computer Hobbyists Handbook - World Radio History

when connecting wires to the rear of a plug to fit aprinter port. A 36 way connector is the standard oneat the printer end of a parallel interface, and these aresometimes referred to as "Amphenol" 36 way con-nectors. More usually they are just called Centronicsor parallel printer plugs and sockets (the printer hasthe plug - you need a socket to make the connec-tions to it). This is a list of the parallel printer portconnections.

Pin Number Function InputlOutput1 strobe IN2 Data 0 IN3 Data 1 IN4 Data 2 IN5 Data 3 IN6 Data 4 IN7 Data 5 IN8 Data 6 IN9 Data 7 IN10 Acknowledge OUT11 Busy OUT12 Paper Empty OUT13 +5V pull-up OUT14 Auto Line Feed IN15 No Connection16 Ground17 Chassis18 No Connection19 to 30 Ground31 Init. IN32 Error OUT33 Ground34 No Connection35 +5V pull-up OUT36 SLCT IN

Obviously there are a number of additional linesincluded here, and not just the basic data and hand-shake lines. A few terminals are not used, and anumber of others are ground (or "earth") connec-tions. There may seem to be no need for so manyearth leads, and a single earth wire is in fact suffici-ent to wire the earths of the two pieces of equipmenttogether. Several of the ground connections (notably19 to 30) are needed to act as screens. Parallelprinter cables are often made from "ribbon" cable,which has a number of leads side -by -side and asubsequent flat, ribbon-like appearance. When usedwith the appropriate (IDC) type of connectors, thisresults in a lead connected to ground separating onedata lead from the next, and also separating thehandshake lines. This helps to prevent stray couplingfrom one signal lead to another, and the corrupteddata that this would produce.

Even with this simple system of screening, parallelprinter interfaces are still only suitable for operationover relatively short distances. The maximum recom-

mended lead length is only some 2 metres. This is abit restrictive, but is not unreasonable considering thevery high rate at which data can be exchanged. It isnot normally necessary to have printer leads muchlonger than this anyway, but in practice a lead 3 or 4metres long would probably give perfectly acceptableresults provided it is made using good qualitymaterials.

Some of the other lines are not implemented on allcomputers/printers, or may have different functions.The ones shown here are those of my Epson printer,and are fai:ly typical these days. The "Paper Empty"line is an output from the printer that can be used toindicate to the computer that there is no paper in theprinter, and that a hold -off is required. This isparticularly useful when using a printer which ishand -fed with single sheets, but by no means all com-puters and software support this feature (it doesseem to be implemented by IBM PCs/XTs/ATs andcompatibles, plus most of the software that runs onthem). It is a feature that is not supported by mosthome computers.

The "Auto Line Feed" input ofa printer is normal-ly taken high, but is taken low if each carriage returnmust be accompanied by a line feed. A commonproblem when first using a printer is that of eithereverything being printed on the same line, or ofdouble line spacing being obtained when only singleline spacing has been set. Everything being printedon one line occurs when neither the printer nor thecomputer add a line feed after each carriage return.The double spacing occurs when they both add theline feed. The "Auto Line Feed" input is not oftenused, or needed. It is usually possible to set the soft-ware to suit the default line feed setting of theprinter. Failing that, there are usually DIP switchessomewhere on (or in) the printer that can be usedto over -ride this input and set the appropriate operat-ing condition.

In some cases the "Error" output is used toindicate that the printer has detected what couldgenuinely be termed an error, but in most cases itsimply goes low when the printer is out of paper, orit is merely switched "off-line". The "Init" inputis pulsed low in order to initialise the printer. Inother words, a low pulse on this input takes theprinter to its normal switch-on state. This effectivelycounteracts any control signals it has been sent, suchas switching it to a graphics mode, switching on boldtype, or something of this nature.

The SLCT input enables printer select and deselectcodes when it is taken high, and disables them whenit is taken low. This is another input that can usuallybe over -ridden by a DIP switch on the printer. The+5 volt pull-up terminals are used if there is anunused input on either the printer or the computerthat must be taken high rather than low (any unusedlines which must be taken low are simply connectedto a ground terminal). These two terminals are notnormally required.

20

Page 31: Computer Hobbyists Handbook - World Radio History

Computer EndIn theory, each terminal of the printer's parallel portis connected to the corresponding terminal of thecomputer's parallel port. In practice things are notalways so straightforward. One potential problem isthe lack of either an "acknowledge" or "busy"terminal at the computer end of the system. Thisdoes not really matter, and it is just a matter ofconnecting which one happens to be present. Eitherone of these handshake lines should be sufficien: togive a properly regulated flow of data from the com-puter to the printer.

What is a more difficult problem is that there isno properly standardised connector for the computerend of a parallel printer interface. There may be acomputer that uses a standard 36 way Amphenolconnector here, but I have never come across one.The nearest thing to a standard connector at thecomputer end of a parallel printer link is the 25 wayD type connector as used on the IBM PC/XT/AT andcompatibles. This is also used on the Atari ST rangeof computers, and the later versions of the Commo-dore Amiga. Note that the original Amiga (the"1000") has a 25 way D connector for its parallelprinter port, but that this is a plug rather than thesocket of the IBMs etc. Details of the standard IBMstyle printer port are shown in Figure 2.3, with the

Amiga 1000 version shown in Figure 2.4. In commonwith most computer printer ports, the basic layout ofthe connections roughly matches that of the 36 wayconnector at the printer. This makes things verymuch easier for the do-it-yourself printer lead con-structor. I doubt if the do-it-yourself approach isworthwhile with an IBM printer lead. Buying thetwo connectors and a piece of multi -way lead couldeasily cost more than a ready-made lead! As theseleads are so popular, the ready-made ones mostly sellfor just a few pounds each.

The BBC model B computers (including the BPlus, Master 128, etc.) have a 26 way IDC connectorat the parallel printer port. The computer has a plug,and the lead must therefore be terminated in a 26way IDC header socket. Details of this port areshown in Figure 2.5. Note that in its unexpandedform the BBC model A computer does not have aprinter port. Several home computers have used IDCconnectors for their printer ports, including the Oricand Oric Atmos (Fig.2.6) and one or two otherobsolete models.

The Amstrad CPC series of computers have a built-in printer port which uses an edge connector (whichis just a simple connector formed by part of themachine's printed circuit board). Details of this portare provided in Figure 2.7. Connections to this are

Data 5Data 6Data 7

AckBusy

PE

Select

0 0 0 01325

0 0 0 0 0 0 0 0 0 0 0 0

111110 0 0 0 0

1 E0 0 0 0

Gnd

Data 4Data 3Data 2Data 1Data 0Strobe

141 ©

1 1 1

Fig.2.3 The standard IBM style printer port

AutofeedErrorInitialiseSelect In

Page 32: Computer Hobbyists Handbook - World Radio History

Data 4Data 3Data 2Data 1

Data 0Strobe

I 1

0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 2013 c° 114

Data 5Data 6Data 7AckBusy

I 1

PE

Select

Gnd 1 1 I 1 1 1 I II I 1 L ResetNo Con+5V

Fig.2.4 The Amiga A 1000 printer port is a variation on the standard IBM type

by way of a 2 x 17 way 0.1 inch pitch edge connectorwhich should ideally be fitted with a polarismg key atthe correct position so that the connector can not befitted the wrong way round. Like most home com-puter printer ports, it is fairly basic and has anabsolute minimum of connections. A point worthnoting about the Amstrad CPC printer port is thatdata line 7 is simply connected to earth at thecomputer. This means that the computer can notsend values of more than 127 to the printer. TheASCII set does not use values above this figure, andmost printer control codes do not require any valuesabove 127. However, some printers do have featuresthat can only be accessed using values of 128 to 255,and these are not available from any computer whichonly provides a seven bit output.

The MSX computers have an unusual connectorfor their printer ports. This is a 14 way Amphenolconnector, which is a sort of miniature and cut downversion of the standard 36 way parallel printer con-nector. Details of the MSX printer port are shown inFigure 2.8. A home-made MSX printer lead shouldbe easy enough to make up, but a suitable 14 wayconnector for the computer end of the lead could bedifficult to obtain.

ConnectionsThe main point to watch when making up a printerlead is that at the very least the "strobe", eight datalines, one ground terminal, and either "acknowledge"or "busy" are interconnected. As explained previous-ly, it is a good idea to have ground leads to screen thedata and handshake lines from one another, especiallyif the lead is going to be more than about half ametre in length. Three or four metres is the maxi-mum length of cable you are likely to get away within practice, and the maximum recommended cablelength is only two metres. Do not try a cable of morethan two metres in length unless you really need alonger cable.

A printer will normally work properly if an unusedinput (such as "Init" or "Auto Line Feed") is leftunconnected. Problems should only arise if one ofthese inputs is taken to a ground terminal on thecomputer's port when it should be allowed to "float"to the high state. For example, pin 14 of theAmstrad CPC printer port is connected to ground,but this terminal of many Epson printers is the "AutoLine Feed" input. To avoid unwanted double linespacing these two terminals should not be linked, andwith a ready-made cable that links these two terminals

22

Page 33: Computer Hobbyists Handbook - World Radio History

Data 6Data 7

AckNo ConNo ConNo Con

Data 5Data 4Data 3Data 2Data 1Data 0Strobe

25

26

1

00000000000000000000000000

1

1

2

GndI 1

Fig.2.5 The BBC printer port lacks a "Busy" input, but has a full set of ground terminals for screening purposes

Data 4Data 5Data 6Data 7

Ack

Data 3Data 2Data 1Data 0Strobe

00000 0 000019 1

20 20000000000All Gnd it tit 451

Fig.2.6 The Oric printer port, like the BBC one, lacks a "Busy" line

2,

Page 34: Computer Hobbyists Handbook - World Radio History

No ConBusy

No ConNo Con

GndNo Con

GndNo Con

1In

No Con 11No Con

GndNo ConNo ConNo ConNo Con

I

11 Li tij

Data 7Data 6Data 5Data 4Data 3Data 2Data 1Data 0Strobe

All Gnd

FIg.2.7 The Amstrad CPC printer port. A polarising key prevents the plug from being fitted to the port thewrong way round

Data 3Data 4Data 5

Data 2Data 1Data 0Strobe

-11111-11M-11M1-1111.-MI-H--

CroundNo ConnectionNo Connection I H Data 6

Data 7No ConnectionBusy

Fig.2.8 The MSX printer port uses a 14 way cut -down version of the standard 36 way connector

4

Page 35: Computer Hobbyists Handbook - World Radio History

it could be beneficial to carefully cut the wire thatconnects them. If the handshaking does not providea proper hold -off, make sure that either the "acknow-ledge" or "busy" terminals are properly linked. Iflinking one set of terminals does not have the desiredeffect, try linking the other set as well. If that fails,try connecting "busy" on one unit to "acknowledge"on the other. It sometimes provides a cure, and itshould certainly not harm either piece of equipment.

Another point to watch is that the lead is notshort circuiting a power supply output to earth. Ifthis should happen it is likely that the overloadprotection in the equipment providing the supplyoutput would prevent any damage from occurring,but it is best not to find out! There is not usuallyany problem with +5 volt pull-up outputs, as theynormally have a current limiting resistor that enablesthem to be connected to earth with only a very smalloutput current flowing. Greater care needs to betaken with a computer such as the CommodoreAmiga 1000, where pin 23 of its printer port is aproper 5 volt supply output. Obviously an output ofthis type must be left unconnected, or it should beconnected to a "No Connection" ("NC") terminalon the other piece of equipment.

A possible cause of confusion is that some manu-facturer's connection diagrams identify the data linesas "Data 1" to "Data 8", not "Data 0" to "Data 7".In this case "Data 0" connects to "Data 1", "Data 1"connects to "Data 2", and so on, through to "Data7" which connects to "Data 8".

Serial PortsA parallel printer port is fine for its intended applica-tions, but it has a couple of major shortcomings as ageneral purpose computer interface. The mostobvious one is that it provides only one-way com-munications. I suppose that this is not insurmount-able, and could be overcome by having devicesequipped with both a parallel input and a paralleloutput. The second problem is a more serious one,and is the limited operating range. If you want toconnect a computer to a piece of equipment inanother room, the chances are that a parallel interfacewill not be able to give reliable results over themodest range involved. A related problem is that alarge number of connecting leads are required, andthis makes long parallel connecting cables prohibi-tively expensive.

The standard general purpose computer communi-cations interface is the RS232C serial type. In itsmost basic form this requires just two connectingleads. These are the signal lead plus a ground connec-tion. Clearly it is not possible to send eight bits ofdata at once with only one data line available.Instead, the data must be sent one bit at a time. Theleast significant bit is sent first (i.e. the "Data 0"signal), running through in sequence to the mostsignificant bit (the "Data 7" signal). The receivingdevice must monitor the state of the data line at

regular intervals so that it can determine the state ofeach bit and reconstitute the eight bit byte of data.

For this system to work it is essential that thereceiving device samples the data line at intervals thatmatch those at which the transmitting equipmentplaces fresh data onto the data line. This is achievedby having data sent at standard rates, or "baud"rates as they are termed. There are a number ofstandard baud rates, and it is obviously importantthat the transmitting and receiving devices are set forthe same rate. The normal baud rates are 45.45, 50,75, 110, 150, 300, 600, 1200, 1800, 2400, 3600,4800, 9600, and 19200 baud. The baud rate is

merely the number of bits sent per second withcontinuous transmission.

Having standard baud rates only partially solvesthe problem of synchronisation. The receiving devicemust know when to start reading in bits for a newbyte of data. One way of tackling the problem is tohave an extra connecting wire which carries someform of synchronisation signal. This is normally inthe form of pulses which indicate when each bit ofdata should be read from ihe data line. This is knownas a "synchronous" serial link, and there are someinterfaces of this type in use. They are relatively rarethough, and most serial links, including the RS232Ctype, are of the "asynchronous" variety. These havethe synchronisation signals placed on the same lineas the data.

In fact the RS232C system uses only one syn-chronisation signal which is transmitted at thebeginning of each byte. As one would reasonablyexpect, this is called the "start" bit. This changefrom the data line's normal quiescent state to theactive one indicates to the receiving equipment thatit must sample the data line at regular intervals there-after until a full byte of data has been read in andconverted back to parallel data.

There are also "stop" bits, but these are not reallyfor synchronisation purposes. During the stop bitsthe signal line is at its normal quiescent level, andthese just provide a minimum gap between bytes.Apart from giving the receiving device time to dosomething with each decoded byte before starting toread in the next one, this ensures that the data lineis in the quiescent state prior to each start bit, so thatthe receiving equipment can recognise each start bit.

One further complication is parity checking. Thisseems to be little used in practice, although manyserial devices are equipped to use it. The general ideais that there should always be an even number of bitsset to one in each byte (even parity), or there shouldalways be an odd number of bits set to one (oddparity). Obviously the character codes will notconform to either standard without some help fromthe serial interface, which must add a bit to somecodes in order to produce an odd or even number ofbits, as required. The point of doing this is that avery simple error checking circuit at the receiving endof the system can be used to detect an odd number of

25

Page 36: Computer Hobbyists Handbook - World Radio History

+ 1 2 V

- 1 2 V

F -

C93 I V- ID

I I-M

I-0-4

I I- II -

M I!-I- M 1

gM

EIbU3

F ig.2.9 RS232C waveform for one start bit, eight data bits, one stop bit, and no parity

bits when there should be an even number, or viceversa. This method of error checking is not verysophisticated though, and a double glitch can resultin the wrong character being produced, but with thecorrect parity being detected. Any parity bits addedby the serial interface are placed after the last databit and before the stop bit or bits.

The waveform diagram of Figure 2.9 helps toshow the way in which serial data is encoded onto asingle data line. Note that the signal voltages usedfor RS232C signals are not the standard 5 volt logiclevels. They are nominally plus and minus 12 volts,but under full load (i.e. when connected to a serialinput via a long cable) signal voltages as low as plusand minus 3 volts are acceptable.

RS232C signals should never be connected directto inputs that are only intended for operation withnormal logic levels. The user ports of the Commo-dore 64 and VIC-20 computers can be used asRS232C interfaces, but they are only designed tosend and receive standard logic levels. Also, theyprovide signals of the wrong polarity. They requirean interface unit which provides signal inversionsand voltage shifting for operation with standardRS232C equipment. A few items of equipmenthave inputs and outputs that are suitable for opera-tion with logic level serial signals such as thoseprovided by the Commodore 64 and VIC-20 userports.

Word FormatsThere are a lot of possible word formats with serialinterfaces, and more than you might expect from theabove description. One universal factor is that thereis always one start bit. There can be anything fromfive to eight data bits though, and one or two stopbits. If five data bits are used, there is normally oneor one and a half stop bits (not two). Then therecan be odd parity, even parity, or (more usually) noparity used at all. In a computing context wordformats having less than seven bits are not normallyused as they would not be able to handle the sevenbit ASCII codes. A few seven bit word formats wereat one time quite common, but they seem to havelargely given way to eight bit formats in recent times.

Much computer communications requires the inter-change of eight bit codes, and this is obviously notpossible with a seven bit word format.

Before two pieces of equipment can be success-fully linked via their RS232C interfaces it is clearlynecessary to get both interfaces set for the same wordformat and an identical baud rate. It does not mattertoo much which word format is used, except whereeight bit codes must be exchanged. Obviously aneight bit word format is then required. In the interestof a speedy data exchange, a word format which hasjust one stop bit and no parity is best. This would allseem to indicate that a word format of one start bit,eight data bits, one stop bit, and no parity is the bestone for general purpose computer use. This doesseem to be emerging as the most popular wordformat. Remember that the baud rate is the numberbits sent per second, not the number of bytes. Withone start bit, eight data bits, and one stop bit, there isa total of ten bits per byte. A baud rate of (say)1200 baud therefore provides an absolute maximumdata transfer rate of 120 bytes per second.

For speedy data transfer a high baud rate is

obviously best, but there are a couple of points tokeep in mind here. The first one is that a high baudrate is rather pointless if either the transmitting orreceiving equipment can not handle large amounts ofdata in a short space of time. The same thing is trueif data will only he sent in short and very intermittentbursts. The rate of data exchange would then belimited by other parts of the system and not the serialinterfaces. Most of the time the interfaces would beidle. It would then be better to use a lower baudrate, as this would not make the overall systemsignificantly slower, and it should give betterreliability.

The second point to bear in mind is that the higherthe baud rate, the lower the maximum range of thesystem. RS232C systems are guaranteed to operateover a range of at least 15 metres at 19200 baud.Probably this is sufficient for the vast majority ofapplications, but lower baud rates permit muchlonger ranges to be achieved. For very long rangesthe serial signals are usually tone encoded/decodedusing a modem (a subject covered in detail elsewherein this book).

26

Page 37: Computer Hobbyists Handbook - World Radio History

Multi -Wire SystemsSo far we have only considered a basic one signalwire plus earth system, for one-way communication.An RS232C interface has both input and outputterminals, and is therefore capable of two-waycommunication. It is just a matter of interconnectingthe earths of the two interfaces, and cross -couplingtheir input and output terminals. A basic two waysystem of this type is suitable for some applications,including most modem communications systems.However, some applications require handshake lines.

Practical PortsThe standard connector for an RS232C is a 25 wayD connector which has the method of pin numberingshown in Figure 2.11. Note that this diagram showsthe pin numbering when looking onto a computer'sRS232C port (which normally has a male connector),or looking onto the rear of a socket to fit an RS232Cport. This type of connector is used on many com-puters and other items of equipment, including theIBM PC/XT and compatibles, and the Atari ST range.However, not all the terminals are necessarily

S Se er

TXD TXD

a aRXD RXD

GND GND

P CTS PCTS0 0rt

RTS rt

RTS

Fig.2. 10 RS232C connections for two way communications with handshaking

A two-way RS232C setup with handshaking inboth directions would use the method of connectionshown in Figure 2.10. This is the basic earth plustwo signal wires, with the other two leads providingthe handshaking (two leads as there is separatehandshaking in each direction). RS232C interfaceshave a reputation for being difficult to get properlyconnected and fully operational. In part the problemis due to the variety of word formats and baud ratesin use, and getting one end of the system to properlymatch the other.

The main cause of problems seems to be theconnecting cable, and getting the handshake linesproperly sorted out. In the simple example systemof Figure 2.10 the flow of data from terminal 2 toterminal 1 is controlled by the "RTS" ("Request ToSend") output. This goes positive when terminal I isready to receive data, and negative when it is not.This output is read by the "CTS" ("Clear To Send")input on terminal 2. and hardware or a mixture ofhardware and software at terminal 2 provides ahold -off when necessary. The handshaking in theopposite direction uses the same arrangement. Thereare alternative handshake lines on an RS232C inter-face, and "DTR" ("Data Terminal Ready") can beused instead of "RTS", and "DSR" ("Data SetReady") may be used instead of "CTS".

implemented. In particular the various "secondary"connections are often omitted, and are not reallyneeded. They are only included as back-ups to theprimary connections. The terminals that carrytiming signals only need to be implemented insynchronous serial systems, but all computer RS232Cinterfaces seem to be of the asynchronous type.

This list is for the full RS232C implementation.

Pin No. Function1 Protective Ground2 Transmitted Data3 Received Data4 Request To Send (RTS)5 Clear To Send (CTS)6 Data Set Ready (DSR)7 Signal Ground8 Data Carrier Detect (DCD)9 Reserved For Data Set

Testing10 Reserved For Data Set

Testing11 Not Used12 Sec. Rec. Line Sig. Det.13 Secondary CTS14 Secondary Transmitted Data

Inpu tlOutput

OUTINOUTININ

IN

27

Page 38: Computer Hobbyists Handbook - World Radio History

0 0 0 0 0 0 0 0 0 0 013

14 250 0 0 0 0 0 0 0 0 0 0 0

Fig.2. i 1 Pin numbering for the standard RS232C connector

Pin No. Function15 Transmission Signal

Element Timing16 Secondary Received Data17 Receiver Signal Element

Timing18 Not Used19 Secondary Request To

Send20 Data Terminal Ready

(DTR)21 Signal Quality Detector22 Ring Indicator23 Data Signal Rate Selector24 Transmit Signal Element

Timing25 Not Used

In tpu t Ou tput

OUT

IN

A lot of serial ports are substantially cut downversions of the full system. The RS232C interfacewas designed as a general purpose type not intendedspecifically for computer use, and it has a numberof functions that are of little or no value in com-puting applications. As explained previously, aslittle as five terminals (ground, data input, dataoutput, and two handshake lines) are sufficient fora basic two way link with handshaking. ComputerRS232C ports often use a different type of con-nector. This is understandable, since the 25terminals of the standard D cornector areunnecessary with perhaps only five or six terminalsactually being implemented. On the other hand,it does mean that standard RS232C connectingleads are unusable with these ports (although ready-made serial leads for many non-standard ports areavailable).

Figure 2.12 provides connection details for theserial ports of IBM AT and compatible computers,and the Epson LQ800 printer. These use a 9 way Dconnector and a 6 way DIN type respectively. TheLQ800 only needs to receive data, and it has what isbasically just a data input, handshake Dutput, and

earth connections. This should be quite sufficientthough. Note that an adaptor is available for ATcomputers, and this couples the 9 way D connectorto a standard 25 way type (an adaptor of this typewas supplied with my AT compatible, but it isapparently not always included as standard).

If a ready-made serial lead for your equipmentcan not be obtained, or you are determined to makeup your own lead, the first thing is to ensure thatthe ground terminals of the two ports are inter-connected, and that the data input/output terminalsare cross connected. If only a one-way link isrequired, such as when driving a printer from acomputer, then obviously only one data input todata output connection is required. It is advisableto check equipment manuals to determine whetheror not equipment is genuinely of the one-way type.A lot of plotters have serial ports, and some ofthese (notably the Hewlett-Packard and truelycompatible types) can operate in modes where theyoutput data to the computer! The data link fromthe plotter back to the printer may still not beneeded though, since most software seems to ignorethis facility. I have encountered one or two pieces ofsoftware that will only drive a plotter if full two-waycommunications is provided.

In some cases handshaking will not be needed, andno further connections will be required. Handshakingis often unnecessary when using a computer with amodem, and at modest baud rates it may not beneeded when transferring data from one computer toanother. It is almost certain to be needed withprinters, plotters, or any relatively slow device. Theonly exceptions are when the device receiving datahas a large buffer. It may then be able to read indata at a very high rate, and a hold -off will onlybecome necessary if the buffer should become filled.If handshaking is not required, the handshake linescan usually be ignored. This is not always the casethough, and sometimes a serial port will not outputdata unless one of the handshake inputs (or the datacarrier detect terminal) is tied to a particular signal

28

Page 39: Computer Hobbyists Handbook - World Radio History

RSD

TXDRXD

DGndIR

0 0 05 1

9 60 0 0 0RI

CTSR TS

DSR

Fig.2.12 The Epson L0800 and IBM AT serval ports. A lot of serial ports use non-standard connectors.

level. You may then need to implement one hand-shake interconnection, even though it will alwaysenable the data flow and will never go into the hold -off state. If equipment refuses to provide a flow ofdata for no apparent reason it is certainly worthtrying it with the handshake lines connected. Someserial interfaces have a +12 volt output which isintended as a tie -point for a handshake line that mustbe permanently enabled. Any terminal of this kindis not a standard RS232C signal, and would usuallyutilize one of the normally unused terminals ratherthan replacing one of the assigned but not requiredfunctions.

Where handshaking must be implemented there area number of possible methods of connection, andsometimes it is necessary to adopt a "suck it and see"approach in order to get satisfactory results. Thereare devices called RS232C "break-out" boxes whichenable changes in the method of interconnection tobe made quickly and easily, plus an array of diagnos-tic devices for use when struggling with RS232Clinks. Be careful not to get two outputs connectedtogether. The RS232C standard stipulates thatcurrent limiting should be used at outputs, andgetting two outputs connected together should notcause any damage. Nevertheless, with any inter-facing it is still best to avoid this type of mistakeif possible. The connection diagram of Figure 2.13shows two methods of interconnection. Both arequite simple and will be successful in most cases (Ihave used the method of connection shown in (a)

on several occasions without encountering anydifficulty).

One final but important point to note is thatthere are two types of RS232C port. These are the"data communications equipment" ("DCE") and"data terminal equipment" ("DTE") types. MostRS232C ports encountered in computing are of theDTE variety, which is the normal type where the porttransmits on its "data ot, t" terminal, and receives onits "data in" terminal. DCE equipment has a portwhich is the opposite of this, with data being trans-mitted on the input terminal, and received on theoutput terminal.

The idea is that by having pieces of equipment ofopposite types, they can be connected by a cablewhich has each pin of one socket connected to thesame pin on the other socket (i.e. not the usualcross coupling of most pins). You are unlikely toencounter DCE equipment, but it might be worth-while checking manuals to ensure that "data out"is the function of that pin, and not the terminal itmust connect to on the other port. The only DCERS232C port I can remember encountering was on aSinclair QL computer that had two serial ports, withone configured as a DTE port and the other connec-ted as a DCE type. This permitted easy connectionto any piece of equipment having an RS232C port(in theory anyway). It is important to realise thatthere is no fundamental difference between DTEand DCE equipment.They only differ in the wayin which they are wired up to the 25 way D connec-

29

Page 40: Computer Hobbyists Handbook - World Radio History

F Gnd (1) 0TX Data (2) 0-RX Data (3)

RTS (4)

CTS (5)

DSR (6)

S Gnd (7)

DCD (8)

DTR (20)

F Gnd (1)0 TX Data (2)

RX Data (3)

RTS (4)

CTS (5)

DSR (6)

S Gnd (7)DCD (8)

DTR (20)

Fig.2. 13a The most common form of "null modem" lead

F Gnd (1) 0 0TX Data (2)

RX Data (3) t.)

RTS (4)

CTS (5)

DSR (6)

S Gnd (7)

DCD (8)

DTR (20)

Fig.2. 13b An alternative "null modem" lead

F Gnd (1)

TX Data (2)

RX Data (3)

RTS (4)

CTS (5)

DSR (6)

S Gnd (7)

DCD (8)

DTR (20)

tor. An adaptor cable is all that is needed in order toconvert one type to the other. The two cables ofFigure 2.13 will in fact convert one type of port to'the other. This type of cross -coupled RS232C cableis usually termed a "null modem" cable incidentally.

Other Serial SystemsThere are other forms of serial link which have beendevised in an attempt to improve on the performanceof the RS232C type. This generally means longer

range. for a given baud rate, and higher maximumbaud rates. Probably the best known of these alter-native serial interfaces is the RS423 type (not theRS432 type as it is often referred to). This is usedon the BBC model B and Master series of computers,and was also used on the Enterprise computers.Connection details for the BBC and Enterpriseserial ports are shown in Figure 2.14.

The RS423 interface is essentially a streamlinedversion of the RS232C type, with the little -used

30

Page 41: Computer Hobbyists Handbook - World Radio History

No Con- '-RTS

Fig.2.14 The BBC and Enterprise RS423 ports

terminals omitted. It uses lower signal voltages anda higher drive current, and it is more tolerant of anydistortion of the signal. This helps to give greaterrange for a given baud rate. The minimum signalvoltage is still sufficient to drive RS232C inputs, andan RS423 input can take the higher voltages of anRS232C type. The two types are therefore compat-ible provided the baud rates and word formats canbe matched properly.

There is a more advanced serial interface in theform of the RS422 type. This is capable of veryhigh speed operation due to the use of a balanced linetechnique (i.e. the signal is carried by two lines whichcarry signals that are the opposite of one another).There is another high speed serial system in the formof the RS449 type. Other "improved" RS232Cinterfaces have been suggested from time to time,but the standard RS232C type is still far morecommon than any of the alternatives.

MIDIMIDI is an acronym of "Musical Instrument DigitalInterface", and it is a means of connecting twoelectronic musical instruments together. This isnormally done so that playing on one instrument alsoplays the second (or any number of additional instru-ments). It can be used for other purposes though,such as exchanging sound data between instruments,or recording tracks of music into a sequencer andplaying them back into a MIDI instrument or instru-ments. This is rather like a cross between multi-track tape recording and a player piano, but is

potentially much more versatile than either of these.At first sight MIDI might not seem to have much

to do with computing, but a few computers have abuilt-in MIDI interface (the Atari ST series forexample), and it is an add-on that is available for

many more computers. With suitable software acomputer can make an excellent sequencer, andcomputer based sequencers are probably superior todedicated units in most respects. Computers can alsobe used to good effect in other MIDI applications,such as MIDI data processing. MIDI is therefore verymuch an important part of modern computing.

From the technical point of view MIDI is verysimilar to an RS232C interface, but it is not com-patible with an RS232C interface. In some cases it ispossible to add a simple adaptor to an RS232C inter-face so that with suitable software it can operate asa MIDI port. This is the system normally used withthe Commodore Amiga computer for instance. Inmost cases this approach is not possible becauseMIDI uses a non-standard baud rate of 31250 baud.The hardware in some computers can actually beset for this baud rate, and these could be used with asimple adaptor. This would probably only be worth-while if matching software is also available. TheMIDI word format is the common one of one startbit, eight data bits, one stop bit, and no parity.

An important difference between MIDI and theRS232C standard is that MIDI uses a current loopsignal and not two different voltages to represent thetwo logic levels. MIDI uses a current flow of zero torepresent one logic level, and a current flow of 5milliamps (a small fraction of that consumed by theaverage torch bulb) to represent the other. Connec-ting a MIDI interface to a RS232C type is not likelyto damage either piece of equipment, but it is notlikely to give the desired result. MIDI inputs useopto-isolators to couple the signal into the equipmentwithout having any direct electrical connectionbetween the driving device and the main circuit ofthe driven equipment. This avoids potential problemswith mains "hum" or other noise being produced on

31

Page 42: Computer Hobbyists Handbook - World Radio History

The Akai S700 rack -mount sound sampler. It. can only be played via MIDI.

the audio outputs of equipment in the system, and italso eliminates any risk of damage occurring due tothe earths of two pieces of equipment being at differ-ent voltages.

MIDI interfacing is much more straightforwardthan RS232C interfacing. A factor that helps togreatly simplify matters is that MIDI does not useany form of handshaking. This is not quite true, asMIDI does under certain circumstances use softwarehandshaking, where the start/stop messages arepassed via the data in/data out connections and notby way of separate lines (a system sometimes usedwith RS232C interfaces incidentally). MIDI doesnot use hardware handshaking with handshakeconnections though. This gives just three wires toconnect one MIDI device to another. Two of theseare the signal wires, and the third is the earthconnection. Note that the earth connection is onlyconnected internally at MIDI outputs, and is leftunconnected at inputs. This is due to the isolationused at inputs, which would be bypassed by theearth connection if it was connected at both endsof the system. The only reason for using the earthlead is to provide screening of the signal wires so thatthey do not radiate significant amounts of radio

frequency interference. MIDI leads are made- fromtwin screened lead, with the inner conductors carry-ing the signals, and the outer braiding connected toearth so that it provides the screening. The problemof radiating radio frequency interference is not onethat is peculiar to MIDI connecting cables. RS232Cand parallel printer cables are also potential sourcesof interference, and should really be properlyscreened in order to minimise the problem.

Apart from MIDI "IN" and "OUT" sockets thereis also the "THRU" variety. This is a form of MIDIoutput, and it simply sends out any signal receivedon the MIDI input. The idea of this is to permitseveral pieces of equipment to be connected togetherin "chain" fashion, so that one controller can be usedin conjunction with several instruments. Figure 2.15shows a typical setup of this type.

The standard connector for MIDI interfaces is the5 way 180 degree DIN type. The MIDI standard alsosanctions the use of the higher quality XLR typeconnectors, but only if manufacturers make availableoptional adaptors to permit standard MIDI (DINtype) leads to be used with their equipment that usesXLR connectors. In practice there seems to be verylittle equipment that does not use the standard DIN

32

Page 43: Computer Hobbyists Handbook - World Radio History

Most modern MIDI equipment has the full complement of three sockets.The THRU socket is absent on some keyboard instruments though (especially older types).

IN THRU

11=1 00000000 0000000000 0 0 00000000 0

OUT

IN OUT THRU

o 1.1111111111111

IN

IN THRU

T1 00000000 Etc.00000000Do 00000000 0

COMPUTERCONTROLLER

MENEMIIMOM111111111111111111=

1E1

MELOMM=OM

1111111111MUM=NM

Fig.2.15 MIDI "chain" connection

1 NI

33

Page 44: Computer Hobbyists Handbook - World Radio History

THRU

No Con

Loop Return --11

Shield GroundData Out

No Con -

No Con

Loop Return -11

No Con

IN

Data In -No Con -

OUT

No Con

Loop Return -11

Shield Ground

THRU LoopReturn

Loop Return

jData Out

No Con -

THRU/OUT

Shield GroundData Out

THRU Data Out -

Fig.2. 16 MIDI port details (including the ST THRU/OUT type)

connectors. Connection details for all three types ofMIDI port are provided in Figure 2.16. This alsogives details of the non-standard arrangement usedon the OUT/THRU socket of the Atari ST com-puters. This can in fact be used as a standard MIDIOUT provided the THRU facility is not required.The THRU facility is provided by the two normallyunused terminals of the OUT socket. A non-standardlead is needed if the THRU facility of the ST is to beused (often it will not be required), but larger STdealers can probably supply a suitable lead. Do-it-yourself MIDI leads are not difficult to make up, andFigure 2.17 shows the wiring needed.

MonitorsLike so many aspects of computing, there are stand-ards for monitors, but a number of them, and not allmonitors conform to one of these standards. Themost simple type of monitor interface is thecomposite video type which conforms to the broad-cast standard. In other words, a monitor of thistype will work just as well with the composite videooutput of a video recorder (or other item of videoequipment) as it will with a computer that has theappropriate type of output. This interface has justtwo terminals which carry the earth and single signalconnections. The horizontal sychronisation, vertical

34

Page 45: Computer Hobbyists Handbook - World Radio History

TO ST

MIDI OUT

RED

TWIN SCREENED LEAD

TWIN SCREENED LEAD

BLUE

Fig.2. 17 A DIY MIDI THRU/OUT lead for the Atari ST computers

OUT

THRU

synchronisation, and main picture signal are all mixedin together with this type of interface, but any audiosignal is carried by a separate set of connectors andlead.

Sound is something that should be borne in mindwhen selecting a monitor for a computer that doesnot have a built-in loudspeaker for its sound genera-tor. With a computer of this type there will be noaudio output unless the monitor has an audio input(which might not actually matter too much, particu-larly if the computer is only needed for somethinglike word processing).

Composite video outputs seem to be used mainlywith monochrome monitors, and there seems to be apopular myth that they are only suitable for this typeof signal. In actual fact a composite signal caninclude colour information, and with computers suchas the Commodore Amiga and Atari ST a coloursignal is provided by their composite outputs. In factcolour can be handled very well by a composite videooutput, with an infinite colour range available. As weshall see shortly, some other types of monitor inter-face permit only a very restricted range of colours tobe displayed. Do not assume that a composite videooutput is always a colour type, as not all computersnecessarily put any colour information on this outputsignal.

Not all systems that use composite signals conformto the broadcast signal standard. In particular, highresolution monochrome systems often use a higherframe rate than the broadcast standard of 50 framesper second. Although there are fifty frames persecond, each frame consists of only every other lineof the display. Consequently, two frames are neededto make each complete picture, and there are onlytwenty-five frames per second. With high resolutionscreens this system tends to give a very pronouncedflickering, especially if it is used to display highcontrast pictures or pictures having large brightareas. Interlacing helps to minimise the flickering,but it does not eliminate it. This effect can be seenwhen using the Commodore Amiga computer withone of its modes that have a vertical resolution of400 lines (or 512 lines on *.he PAL versions). A longpersistence monitor is one solution to the problem,but a higher scan rate (often without interlacing) is abetter one. As an example, the high resolution mono-chrome mode of the Atari ST computers has avertical scan frequency of '2 Hertz, and gives a verystable picture. Although broadcast standard compo-site input monitors can be used in the two colourmodes of the Atari ST computers, a special monitoris required for the high resolution monochrome mode(which uses a separate output terminal of the video

35

Page 46: Computer Hobbyists Handbook - World Radio History

port). It is not safe to assume that the compositeinput of a monitor is suitable for use with highresolution displays.

RGBMost colour monitors do not have a composite input,or do have one, but are normally driven from anotherinput wherever possible. The alternative input isalmost invariably some form of RGB (red -green -blue)input. It should perhaps be pointed out that somemonochrome monitors have an RGB input, butobviously they can not provide a colour display.They will usually display the colours as differentshades of grey though, which is a definite improve-ment on a true monochrome display. However, insome cases there is very little difference betweenmany of the shades of grey, and the IBM colourgraphics adaptor (and compatible display adaptors)often provide disappointing results when used withmonochrome monitors. This is not really a fault inthe video board, which is obviously optimised fortrue colour operation.

With an RGB input there are several input signalsto the monitor. For a basic RGB monitor with TTLinputs (i.e. standard logic signal inputs) there arenormally five inputs plus an earth terminal. The fiveinputs are red, green, blue, intensity, and compositesynchronisation (i.e. horizontal and vertical syn-chronisation signals merged into a single signal).Anyone who studied physics at school will probablyrealise the importance of having red, green, and bluesignals. The classic colour experiment is to projectthree circles of light onto a white screen, with thecircles overlapping slightly. Coloured filters are usedto produce red, green, and blue circles of light. Thisgives the result shown in Figure 2.18, with the coloursmixing at the overlaps to provide extra colours.

Seven colours are shown in Figure 2.18, but withall three light sources extinguished black is produced,and so a simple on/off RGB system is capable ofproducing eight colours (including black and white).An RGB monitor uses colour mixing in exactly thesame way to give the pallette of eight colours. Wherethe intensity input is utilized it is possible to switchall the colours to half intensity. The number of colours

Fig.2. 18 A basic RGB system gives eight co/ours (all three switched off gives black)

Page 47: Computer Hobbyists Handbook - World Radio History

BBC B etc.Gnd Red

Sync

Blue

Blue

L

Oric

GndGreen

+5V

Blue

Red

Green

Blue

Amstrad CPCGnd Red

Sync

Blue -tIBM CGA

V SyncH Sync

Fig.2. 19 Details of some common RGB/RGBI ports

Lum

TBlue

Red

Gnd

Lu m

No Con

available from this RGBI (red, green, blue, intensity)system is often stated as being sixteen. However, halfintensity black is presumably still black, and thenumber of colours available is actually only fifteen.

A lot of computers have RGBI outputs, includingthe BBC micros, the Electron, IBM PC/XT/AT com-puters fitted with the CGA (colour graphics adaptor)card, and the Amstrad CPC computers. Some havejust the RGB outputs with no intensity output beingimplemented (the Oric computers for example).There are also computers which have the same colourpallette as RGB or RGBI monitors, but which providetheir colour output in composite video form (some ofthe Commodore machines fall into this category).There is no difficulty in connecting an RGB or RGBIoutput to a monitor which has the appropriate typeof input, and it is just a matter of connecting eachterminal of the monitor's input socket to the corres-ponding terminals of the computer's monitor port.

The only slight problem is that a variety of connectorsare used at both the computer and monitor ends of thesystem. A selection of RGBI input/output sockets aredetailed in Figure 2.19. Some monitors are suppliedwith leads for connection to the 9 pin D connector ofthe IBM CGA card, and a short adaptor lead is thenusually the easiest way of connecting them to adifferent type of computer.

Analogue RGBFor most purposes eight or fifteen colours are quiteadequate, but for some applications a greater rangeof colours is preferable of even essential. Paint pro-grammes that are limited to eight colours can bequite good fun, but do not really compare withprogrammes that can provide thousands of colours.The IBM EGA (enhanced graphics adaptor) andcompatible display boards have a form of TTLoutput, but they have eight outputs plus an earth

37

Page 48: Computer Hobbyists Handbook - World Radio History

terminal. Two of these outputs are separate verticaland horizontal synchronisation signals, and the othersix are RGB outputs. Each colour has two outputs("primary" and "secondary"), and with six logicoutputs there are sixty-four different output combin-ations possible.

This gives the EGA display its pallette of sixty-four colours, but only sixteen of these can bedisplayed on the screen at any one time. This is notdue to any deficiency in this method of interfacingor the monitor, both of which can provide all sixty-four colours on screen simultaneously. Thislimitation is imposed by the graphics adaptor card,or to be more precise. by its 256K of memory whichcan only map the 640 x 350 pixel display in sixteencolours. This arrangement of having more coloursavailable than can be displayed at any one time is byno means unique to the EGA display, and is actuallyquite common with high resolution colour displays(as well as some medium resolution types). In somecases there are clever software tricks that can be usedto take the number of on -screen colours beyond theofficial limit. The standard EGA connector is a 9way D type, and it has the pin assignment shown inFigure 2.20.

Going beyond the EGA display with its sixty-fourcolours there are the displays that have analogue RGBoutputs. Whereas a digital output only has two validlevels, an analogue signal can be varied continuouslyover its limits, and in theory anyway, has infinite

resolution. A monitor having analogue RGB inputscan therefore mix the three primary colours in anyrelative quantities to produce any desired colour.This is not to say that a computer which has analogueRGB outputs has an infinite range of colours and thatthey can all be displayed on screen at once. Thecircuits which drive the outputs are derived fromdigital circuits, and can only provide a limited numberof steps.

The Commodore Amiga provides some 4096colours by having sixteen different intensities foreach of the three primary colours (16 x 16 x 16 =4096), while the Atari ST has 512 available coloursand presumably uses 8 intensities for each of theprimary colours. Normally only about 16 of thesecolours are available at any one time, but both ofthem can use "tricks" to provide the full range ofcolours on -screen simultaneously (the "HAM" modeof the Amiga for example). Both of these computers,and other computers with similar capabilities (someof the VGA modes of the new IBM PS/2 computersfor instance), can provide some really impressiveresults. They produce an almost photographicquality which does not seem to be achievable withcomputers that have similar resolutions but only afew colours available.

As far as interconnections are concerned, thereare the three colour signals to be coupled from thecomputer to the monitor, plus an earth connection.It also seems to be the standard practice to have

Pri GreenPri Blue

V SyncH Sync t

Pri RedSec RedGnd

Sec GreenSec Blue

Fig.2.20 The EGA card uses a 9 pin D connector, but the connections are different to those of theCGA card

;ti

Page 49: Computer Hobbyists Handbook - World Radio History

separate earth (or "ground") connections for thethree colour signals in addition to an overall earth.This gives some four earth leads, plus possibly afifth if there is also a separate earth for an audioinput. I am not entirely sure why separate earthsshould be necessary, but this is usually done wherethere is a risk of a common earth causing straycoupling of one signal into another. Most analogueRGB systems seem to use a single synchronisationsignal, but the VGA and MCGA systems seem to haveseparate vertical and horizontal synchronisationsignals.

Analogue monitors and computers which haveanalogue outputs seem to use a variety of connec-tors. The popular NEC multisync II monitor has astandard CGA style 9 way D connector, but thisoperates in a variety of configurations depending onwhich of its operating modes is selected. A "multi -sync" monitor, incidentally, is one which canoperate with a range of video standards, fromstandard RGB and RGBI to the more exotic oneswhich give higher resolutions and usually demandhigher scanning rates (such as the EGA, VGA, andMCGA modes). Most multisync monitors willoperate with both digital and analogue RGB signals,but the exact capabilities do seem to vary significant-ly from one monitor to another. If you need amultisync monitor for an unusual video mode itwould be advisable to check that the particular oneyou are considering has the requisite inputs andscanning rate capability rather than just assumingthat it does. Returning to the operating modes ofthe NEC multisync II, this table shows how each ofits nine input terminals are allocated in each of itsfour operating modes.

apparently use a different method of connection. Itis unfortunate that two standards have somehowarisen, but the method of connection shown inFigure 2.21 seems to be the most common one forcomputer equipment (and is the only one I haveencountered).

Games PortsA joystick port is something that can be found onmost computers, and where it is absent there is

usually a popular add-on that provides this function.The most common form of games port is the Atari/Commodore type, or a variation on this basic schemeof things. Figure 2.22 gives details of the Commo-dore 64 games port 1, which is a fully standard formof Atari/Commodore games port. Where a secondgames port is available (which it is on most computersincluding the Commodore 64) the second port useswhat is essentially the same method of connection.However, pin 6 only functions as a firebutton onthe second port, and it can not be used as an inputfor the lightpen.

There are two basic types of joystick: the switchand potentiometer varieties. The switch typeindicates one of eight directions to the computer,and (usually) an on -screen object is moved in thedirection indicated by the joystick. A potentiometertype is very different, and indicates a screen positionto the computer. Usually, an on -screen object ofsome kind is moved to the indicated screen position.Atari/Commodore style games ports are intended foruse with switch type joysticks.

The direction is indicated by four switches whichconnect to "JOYAO" to "JOYA3". These switchesconnect between their input terminals and the ground

Pin No.

1

3

45

67

8

9

CGA (TTL)GROUNDGROUNDREDGREENBLUEINTENSITYNO CONHOR SYNCVERT SYNC

EGA (TTL)GROUNDSEC REDPRI REDPRI GREENPRI BLUESEC GREENSEC BLUEHOR SYNCVERT SYNC

PGC (ANAL)REDGREENBLUECOMP SYNCMODE CONTRED GNDGREEN GNDBLUE GNDGND

VGA (ANAL)REDGREENBLUEHOR SYNCVERT SYNCRED GNDGREEN GNDBLUE GNDGND

There is a standard connector for monitors, andthis is the 21 way SCART type. This is to be foundon some computer monitors (the Commodore 1081for example), and should become more common astime passes. Details of the SCART connector areprovided in Figure 2.21. Note that most monitors donot implement all these connections, and that the"data" and some of the audio terminals are usuallyjust left unconnected. Also note that some monitors

terminal of the port (pin 8). They respectively giveup, down, left, and right indications. Moving thestick (say) up and to the right will operate both the"up" and "right" switches, and will indicate thatboth upwards movement and movement to the rightis needed. Thus the four switches can indicate a totalof eight different directions. The "firebutton" inputis wired to ground via the push-button switch of thejoystick.

39

Page 50: Computer Hobbyists Handbook - World Radio History

Green GndBlue In

Blue GndAudio Out (LH)Audio Out (RH) -11

Green InRed GndRed InComp. Video GndComp. Video Out

rScreening

00000000001 19

2 200000000000Audio In (RH)

Audio GndAudio In (LH)

Source SwData

4 4

Comp. Video InVideo Blank GndVideo BlankingData GndData

Fig.2.21 The standard SCART video connector. In practice many of the pins are often left unused.

There are a few additional input terminals on theport, and these are for use with potentiometers.The two potentiometers connect from the +5 voltsupply terminal to their respective inputs. I supposethat it would be feasible to use potentiometer joy-sticks with this type of games port by utilizing thesetwo inputs, but they do not seem to be used this wayin practice. They are primarily intended for use withgames "paddles", which are effectively potentiometerjoysticks which only provide side to side control. Infact this facility seems to be little used even for"paddles", and it appears to have been omittedaltogether from some recent computers that have thisstyle of games port (the Atari ST series of computersfor instance).

There have been modified versions of this originalform of the games port, of which the Atari ST versionis just one example. Apart from omitting the paddleinputs, it has been modified to permit a mouse to beconnected to port 1 (or "Port 0" as Atari havedesignated it). The games ports of the CommodoreAmiga computers have been similarly modified, butstill seem to retain the ability to take games"paddles". This is achieved by having many of theterminals serve more than one function. They can

both operate with standard Atari/Commodore stylejoysticks.

The Amstrad computers use a modified version ofthe standard arrangement which omits the "paddle"inputs but permits a single port to accommodate twojoysticks. In fact this is not strictly correct, and onlyone joystick connects to the port. The second joy-stick plugs into a 9 way D plug fitted to the firstjoystick. Figure 2.23 provides details of the Amstradstyle games port.

This follows the standard Atari/Commodore lay-out quite closely, and it should be possible to use astandard switch type joystick if only a single joystickis to be used. The "Common" input replaces the"GND" terminal of the standard games port, but itis used in precisely the same way. A standard switchtype joystick might not be satisfactory if used withan Amstrad computer, since the Amstrad port hasprovision for a second "firebutton", which is absentfrom the standard switch type joystick. The secondjoystick is connected in the same way as the firstapart from the fact that it uses the "COM2" terminalinstead of the "Common" one.

Analogue joysticks seem to be used with fewcomputers. They are the standard type for

40

Page 51: Computer Hobbyists Handbook - World Radio History

JOYA2JOYA1 I JOYA3

JOYAO POT AY

0 0 0 0 01 5

6 90 0 0 0BUTTON A/LP -1

1

POT AX+5V GND

Fig.2.22 Details of the standard Atari/Commodore games port

LEFTDOWN I RIGHT

UP UNUSED

0 0 0 0 01 5

6 90 0 0 0FIRE 2 1 1 CCMA 2FIRE 1 COMMON

Fig.2.23 The Amstrad games port can accommodate two joysticks

41

Page 52: Computer Hobbyists Handbook - World Radio History

Analogue GndOV

Channel 1

Analogue Gnd

8

Channel 0V. Ref.

Firebutton 0

150 0 0 00 0 0 0 0 0 0

1

90 0 0

Channel 3OV

till IL- Light PenFirebutton 1

V. Ref.Channel 2

Fig.2.24 The BBC computer's joystick port. Four analogue inputs accommodate two joysticks.

the IBM PC etc. and compatibles, but this type ofcontroller does not seem to be in widespread use inthe U.K. (probably due to the built-in switch typejoystick interface on the popular Amstrad PCs).This type of joystick was used on the now obsoleteDragon computers, but they are probably mostwidely used in the U.K. with the BBC series ofcomputers (apart from the model A which lacks theanalogue input port). Figure 2.24 shows details ofthe BBC computer's analogue port, which uses a 15way D type connector.

Unlike the "paddle" inputs of an Atari/Commodore games port, all three terminals of the potentio-meter are used by the BBC port.

The track terminals connect across the 1.8 voltreference voltage and the analogue ground terminal(separate terminals are available for each joystick).The wiper terminal (which is usually the middleone of the three) connects to one of the analogueinputs ("Channel 0" to "Channel 3"). There are twoinputs for each joystick so that each one can providecontrol in two planes. "PBO" and "PB1" are the"firebutton" inputs, and these are used in the sameway as their equivalents on a switch type joystick.

Obviously switch type and analogue joysticks aretotally incompatible, and you must use the rightkind for the type of port fitted to your computer.

IEEE488The IEEE488 interface (also called the "HewlettPackard Instrument Bus" or something similar) isone of the less well known computer interfaces. Itis mainly used for scientific instruments and otherspecialised pieces of equipment, although I believe itwas used on some early Commodore machines forcommunications with peripherals such as disk drives.In fact it is still used on Commodore 8 bit machinessuch as the Commodore 64, but in considerablymodified form. The standard IEEE488 interfaceuses a 24 way connector which is rather like a cutdown Centronics type connector. The connectorfor the Commodore IEEE488 style interface is a 6way DIN type. Connection details for these areprovided in Figures 2.25 and 2.26.

The main difference between these two types ofinterface is that the full IEEE488 interface is aparallel type while the Commodore type is a form ofserial interface. The two are therefore totally incom-patible, although interface units to permit theCommodore 64 etc. with standard IEEE488 deviceshave been (and probably still are) available.

An important difference between these interfacesand most other types is that they provide two-waycommunications via a single wire (Commodoreversion) or an 8 bit parallel bus (standard IEEE488

42

Page 53: Computer Hobbyists Handbook - World Radio History

NRFD

NDAC

IFC

SRQ

ATN

Shield

All Gnd

12

24

I I V

DAVE01

D104

D103

D102

fD101

1

13,-61111111-M-1111M-IM-1-11M-MMI-M-GM.-

I L 256D107

D108

Fig.2.25 The 1EEE488 interface uses a 24 way connector

SRQIN

Reset

Gnd

Fig.2.26 Connection details for the Commodoreserial interface

version). Devices that transmit on the data lines are"talkers", and those that receive on them are"listeners". A device does not have to be one orother of these, something like a disc drive will needto both send and receive data. Devices of this typeare "talkers/listeners", but at any one time they canonly provide one or other of these functions. Thislimitation is enforced by the single data wire or setof data wires. There is another category of 1EEE488

device, and this is the "controller". For a systemof this type to function properly it is essential to havea controlling device which ensures that only one deviceat a time is sending out data onto the data line orlines. The purpose of the "control" is to provide thissupervision of the system, and it is almost invariablya computer or some form of dedicated microprocessorbased controller.

The data lines actually carry more than just databeing passed from one device to another, and theycarry such things as "addresses" and status informa-tion. Addresses are important in a system of thistype where there will usually be several "listeners",and it will often be necessary to direct informationto just one of these at a time. Other lines are usedfor general control and handshaking. The DAV (datavalid) line is use6 to indicate that valid data is presenton the data lines (similar to the strobe line of aCentronics interface), while the E01 (end or identify)is used to show when the transfer of data has beencompleted. 1FC (interface clear) is a sort of resetline that is used by the controller to initialise thesystem. The NDC (not data accepted) line is used bya "listener" to show that it is receiving data. SRQis the service request l.ne, and it is used by anydevice that wishes to gain the attention of the"controller". The ATN (attention) line is activated

43

Page 54: Computer Hobbyists Handbook - World Radio History

by the controller when it is placing an instructiononto the data lines (or data line in the case of theCommodore serial version). The REN (remoteenable) line is used to enable and disable the databus. The data bus is disabled when manual controlof a device is required. The sophisticated method ofhandshaking used in this system ensures that thereare no difficulties with devices sending data morequickly than other devices can process it. The wholesystem is effectively slowed down to a rate that can

be handled by the slowest unit in the system.Obviously the Commodore serial version lacks

many of the control lines, but this system still worksin broadly the same way. Being a serial system ittends to be much slower than the parallel version.Note that it is a synchronous system, with a clocksignal rather than a standard baud rate to ensureproper synchronisation of the sending and receivingdevices.

44

Page 55: Computer Hobbyists Handbook - World Radio History

Chapter 3

LANGUAGES

Machine CodeMachine code is the native language of microproces-sors. As explained in Chapter 1, each microprocessorhas its own instruction set, though there are'families' of devices using the same code. Howdifficult it is to learn machine code depends to someextent on which microprocessor you wish toprogram, however, in general, it is never easy.

Machine code consists entirely of numbers.Machine code programming involves writing pro-grams directly in these numbers, or opcodes as theyare called. It is difficult for humans to rememberwhich number represents which operation, unless thenumber of operations available is very small. Also,it is only possible to tell which numbers representinstructions within a program, and which representaddresses or data, by their positions within theprogram. It is therefore very difficult to 'read' apure machine code program.

Pure machine code programming is hardly everdone for the microprocessors used in home andsmall business computing, though it is done to alimited extent with the small microprocessors usedin such things as washing machines. Sometimes amachine code program is written using themnemonics for the instructions in the first place,and then is converted into machine code by lookingup the opcodes corresponding to the mnemonics,but this is strictly a form of assembly languageprogramming, hand assembling.

Assembly LanguageAssembly language is the first step in changing thenature of computer programs from what the machinerequires to what it is easy for humans to write andcomprehend.

Assembly language is a method of writing machinecode programs, but instead of having to deal directlywith the machine opcodes, each operation is repre-sented by a mnemonic, usually consisting of threeletters, e.g. ADD, BEQ, JSR. The program is firstwritten as a text file, using an editor or wordprocessor, and is then passed through the assembler,which looks up the opcodes corresponding to themnemonics, and thus forms the final machine code.

In fact a good assembler will do much more thanthis. Most will automatically calculate the displace-ments for branch instructions, so you need to knowonly where you want the program to branch, nothow many bytes it is from the branch instruction.Often you can use labels for addresses, which makesthe program easier to read as well as write. A goodassembler will also accept data in either hex ordecimal form, and often binary as well.

There are, however, less sophisticated assemblers,usually supplied as parts of machine code monitorprograms, or as part of a high-level language (e.g.BASIC) interpreter.

The simplest assemblers are the direct or in -linetype. These offer few facilities, and assemble eachline as it is entered, putting the code directly intomemory. They are usually found only as part ofmachine code monitor programs, and are used forexperiment rather than for writing extensive pro-grams. The code is usually assembled direct intomemory then executed from the monitor. This typeof assembler cannot usually calculate branch offsets,and does not allow the use of labels.

Similar assemblers are sometimes included inBASIC interpreters (the best known, perhaps, beingthe one in the BBC micro). These are mainly usedto write short bits of assembly language programmingas parts of BASIC programs, the code being assem-bled when the program is run, and then executedfrom within the BASIC, tnough they can be used towrite stand-alone machine code. Calculation ofbranch offsets is usually possible with theseassemblers.

The most efficient assemblers are of the two -passtype with separate edam. As the name suggests,the assembler makes two passes of the assemblylanguage text file to generate the machine code pro-gram. This allows forward as well as backwardbranch offsets to be calculated. During the first pass,if the assembler finds any labels in branch instruc-tions for which it has no address (which means theyare further on in the program) it keeps a table ofwhere the labels are referred to, and then duringthe second pass the actual address is inserted. (Someof the assemblers included in BASIC interpreters canbe turned into two -pass types by putting theassembly language within a BASIC loop.)

Some assemblers for some microprocessors actual-ly use a third pass, this being an optimising pass,changing some instructions to shorter forms givingmore compact code or allowing faster executionwhere this is possible.

BASICBASIC is ubiquitous in computing. It is the languagewhich is supplied as standard with the majority ofmicrocomputers, and with home computers it is

normally built-in on ROM, so that when you turn onthe computer you go straight into the language. Onsuch machines it can be difficult to separate BASICfrom the operating system.

The name BASIC is an acronym, derived fromBeginners All-purpose Symbolic Instruction Code(alternative derivations are to be found, but this is

45

Page 56: Computer Hobbyists Handbook - World Radio History

the generally accepted one). It was devised in itsoriginal form at Dartmouth College in the U.S.A.

BASIC is an interpreted language. This means ithas the usual disadvantage of being rather slow.However, by comparison with other interpretedlanguages, the best BASICs are fast. As might beexpected with such a popular language, there aremany compilers for various versions of BASIC,including some of the versions supplied built-in tohome computers, and also versions written specifi-cally for compiling (some of which have interpretersfor program testing!).

In BASIC variables are typed, which is to saythey are defined as either numeric, representingnumerical values on which mathematics can beperformed, or string, which are simply strings ofthe characters which can be printed on the screen(including the numeric characters and specialcontrol characters). Functions are usually providedto convert strings of valid numeric characters tonumeric form, and numeric values to string form.Numeric variables may be further typed into integer,real, double precision, and other types.

Large amounts of data, both string and numeric,can be handled by subscripted variables, commonlycalled arrays. In arrays, the individual variables areaddressed by the variable name and one or morenumeric values, the subscripts, representing theposition of the variable in the array. As the numericvalue(s) can be given as either constant or numeric,this allows easy programming to step through anarray in sequence, or to access it randomly.

BASIC is a good number crunching language,and has full facilities for floating-point mathematics,and often for integer arithmetic as well (some earlyand primitive BASICs may be integer only). A widerange of mathematical and trigonometric functionsare built-in, but the range provided does vary some-what from dialect to dialect. There is almost invari-ably a facility provided to generate your ownfunctions from combinations of the ones providedto obtain more advanced facilities. In some versionsthese user -defined functions are very sophisticated,and may be spread over several lines.

On the other hand, BASIC handles text, especiallyformatted text, rather clumsily. Storage in strings isnot really adequate, and the string -handling functionsrather limited.

Facilities for handling constant data within pro-grams is also limited. Lists of data can be included inprograms, and accessed sequentially, though in someversions, the RESTORE statement allows limitedrandom access. In others it only allows you to startreading the data list again from the beginning. Theonly way to add constant data is to edit the program.

If variable data is to be saved from one running ofa program to another, it must normally be explicitlysaved to disc (or other non-volatile medium) by theprogram, and reloaded when the program is run again(in a few small home computers, saving the program

also saves the variables). Advanced BASICs providedwith or for computers intended for business use mayinclude facilities for handling data files directly ondisc, and in some cases these facilities can be verysophisticated (for example Locomotive Software'sMallard BASIC and BASIC 2).

The earliest BASICs date from the days when theusual output from a computer was on a teleprinterrather than a VDU screen. To make editing programseasier (or possible!) in this environment, the programlines were numbered, and were stored in memory,and (jumps and branches excluded) executed in theorder of the line numbers. Line numbering has untilvery recently been an identifying feature of BASIC,as very few other languages use this feature. However,with VDUs for output, screen editing is possible andline numbers are not necessary, and on the latestversions they are optional, and are used simply aslabels. The lines are stored as entered on the screen,not necessarily in the order of any numbering.

When first introduced, BASIC was rather a poorly -

featured language. This was necessary because of thesmall amounts of memory available on the machinesof that time. Decision making was in the form ofIF . .. THEN statements which could test a conditionand either continue execution in sequence if the testfailed or branch to a specified line if true. Writingpractical programs involved a fair amount of use ofunconditional branches, the infamous 'COTO'. Thislead to BASIC getting the reputation of being anunstructured and untidy language.

When graphics and sound were first added tomicrocomputers there were at first no BASIC com-mands to control these, and such control was onlypossible either by direct memory addressing usingPEEK and POKE, or by direct port addressing. Pro-grams using a lot of graphics and sound could be verydifficult to follow, consisting almost entirely ofnumbers, and little better than machine code. (TheCommodore 64 BASIC was perhaps the most notori-ous in this respect.)

However, BASIC is very much a living language,and extra features have been added as new versionshave been written, partly to improve the structureof the language, and partly to give easy access to allthe graphics and sound capabilities of currentmachines. As a result of this, BASICs are now someof the most powerful languages around. Manymodern BASICs have some or all of the followingadvanced features.

PROCEDURES. Instead of the subroutines of theearly BASICs, modern versions allow the use ofnamed procedures. Provided sensible names arechosen, these make program readability much better.Generally, you can also pass parameters to procedures,which means you can send data to them on whichthey are to work when calling them, just as you canwith in-built commands.

46

Page 57: Computer Hobbyists Handbook - World Radio History

MULTI -LINE IF . . . THEN STATEMENTS. As

mentioned above, early BASICs only allowedbranching after IF ... THEN tests. The first improve-ment was to allow the execution of other statementsconditionally, and then to allow a choice betweentwo sets of statements by using IF . . . THEN . . .

ELSE conditionals. More than one statement couldbe placed after THEN (and also after ELSE), but thewhole statement had to be on one line. This couldlead to very long untidy lines. Latest versions allowsuch conditionals to be spread over several lines. Theblock starts with the IF . . . THEN statement withthe conditional test in it. It is followed by thestatements to be executed if the condition is true.Optionally, there may then be the ELSE statement,followed by statements to be executed if the condi-tion is false. The end of the block is indicated by astatement which is usually ENDIF.

MULTI -LINE USER -DEFINED FUNCTIONS. MostBASICs allow user -defined functions to evaluateexpressions which are used often in a program.Usually such functions can contain only one expres-sion, and can only be used to execute mathematicaloperations, not other statements such as PRINT.More powerful versions have user -defined functionswhich are procedure -like, which can be spread overseveral lines, and contain almost any statement inthe language.

LOOP STRUCTURES. The first loop structure to beincluded in BASIC was the FOR . . . NEXT loop,which allowed the statements in the loop to berepeated a set number of times, a variable being usedto count the repetitions and control the loop. Later,the REPEAT . . . UNTIL and WHILE . . . WENDloops were added. Both of these will continue toloop until a condition (like those used in IF . .

THEN statements) is true. In REPEAT loops thecondition is at the end of the loop, in WHILE loopsit is at the end. BASICS tended to have one or theother, but not both. The best modern versions dohave both, or they may have them in the DO . . .

LOOP form, which allows the condition to be placedat either end as required, i.e. DO WHILE . . . LOOPor DO ... LOOP UNTIL.

You may have gathered that there are now con-siderable differences between different BASICs.Whilst this is certainly true, the incidences of onecommand word being used for two (or more)different purposes are fortunately quite few, and itis usually possible for a person who is familiar withone version of BASIC to program in another version,though frequent consultations of the manual arelikely to be necessary!

BASIC remains very much a living (and growing)language. The latest versions allow full access to thegraphics control environments (e.g. Digital Research'sGEM), and as computer facilities grow, no doubt

BASIC will grow with them. However, theseadvanced forms are now so comprehensive that theyrun the risk of being incomprehensible, and the claimof BASIC to be a beginner's language must in somecases be considered questionable.

Although BASIC has come in for a lot of criticismover the years, the best of the latest BASICs areextremely good in most respects. It is language thatwe have used for a wide range of applications - somequite mundane and others of a specialised scientificnature. BASIC must be -ated as one of the mostversatile of programming languages, unlike manyprogramming languages that are highly specialised intheir practical applications.

LOGOLOGO was invented by Dr Seymour Pappert of MITas a teaching language for beginners to programming,particularly young children It is a highly structuredlanguage, which forces academic concepts of`correct' programming technique on the user. LOGOis strictly an interpreted language, there are nocompiled LOGOS, and such a thing would be contraryto the whole concept of the language, which is essen-tially interactive.

LOGO is best known for its 'turtle graphics' inwhich the 'turtle', which can be either a robot deviceor a 'virtual turtle' on the screen, moves around inresponse to such commands as "FORWARD 50"and "RIGHT 90", drawing line figures.

There is, however, much more to LOGO than this.It is one of the family of list processing languages,which means data is stored in the form of lists of`words', and you car. also have lists of lists, list oflists of lists, and so on. Lists can be manipulated invarious ways to allow information to be extracted.LOGO can be a good second language for BASICprogrammers, as the two are very different, and somethings which are very complicated to program inBASIC are relatively straightforward in LOGO. Oneexample of this is data pattern matching.

LOGO comes with a set of in-built commandscalled primitives. You use these primitives in com-bination to form procedures, which in effect addnew commands to the language. The idea is that youcan use the primitives and your procedures in verymuch the same way, thus extending the language toyour needs. Having written procedures, you can thenuse these within other procedures to perform evenmore complex tasks. You do not so much write aLOGO program to do a job and then run it, as extendthe language to give it the required capabilities, andthen work interactively with the language fromcommand mode, or lop level' as it is called.

LOGO is not really intended as a number crunch-ing language, and in-built mathematical functions areusually limited. The language can, of course, beextended to perform almost any arithmetic or mathe-matics you require, but this can take a lot ofprogramming.

47

Page 58: Computer Hobbyists Handbook - World Radio History

Variables are not typed in LOGO. Both numericquantities and what would be strings in other langu-ages are stored as words, which can be simplevariables or elements of lists.

LOGO is a highly standardised language andthere are far fewer dialects than there are in mostother languages. The two main ones are MIT LOGOan LSCI LOGO. Of the minor variants, EdinburghLOGO is used mostly in primary schools, and OpenLOGO, devised by the Open University in the U.K.,which presumably is used by the Open University. Itisn't found anywhere else, though. There are fewdifferences between the dialects, and once you havelearned one it is relatively easy to adapt to another,and even to convert programs between dialects (amug's game in BASIC).

CC is a compiled language (apart from a few inter-preters that are intended for debugging purposes),and some computer users seem to have gained theimpression that the "C" name stems from the factthat it is Compiled. In fact it is a development of the"B" programming language. C has its origins in the1960s when a team at Cambridge produced a langu-age called CPL (Combined Programming Language),or BCPL (Basic Combined Programming Language)as the eventual and somewhat cut down versionbecame known. BCPL is still around today inciden-tally, but does not seem to be used to any greatextent. It was from BCPL that the B language wasdeveloped in the U.S.A. in 1970 by Ken Thompson.This was further developed into C by DennisRitchie of Bell Laboratories in 1972, and it wasdefined in the book "The C Programming Language"by Dennis Ritchie and Brian Kernighan. This bookis also known as "The C Programmer's Bible", and itis generally considered to be essential reading foranyone who is going to undertake any major Cprogramming.

C has become very popular, and it has a numberof factors in its favour. As someone who has to workwith several microcomputers, the ability to use thesame language on several machines without having toadjust to changes in syntax etc. when changingmachines is a highly attractive one. There is alsothe possibility of writing a program for one computerand then easily converting it for operation on severalother computers, which has an obvious appeal tovirtually any programmer. A lot of computer langu-ages are supposedly very "portable", but few cangenuinely produce portable programs. C is certainlyan exception, and it is aided in this respect by thefact that it was quite rigidly defined at the outset.This has left little scope for authors of C compilersto do their own thing and introduce non-standardfeatures. Of course, as with any programminglanguage the portability of programs is dependent onadd-ons to the language (such as graphics libraries)either not being used, or being available for any

computer on which the program must be run. Pro-vided no add-ons of this type are used, C programswill usually run on other computers with little or noconversion being necessary.

C is not really a beginner's language. The brevityof its name is reflected in the program listings whichare almost invariably cryptic in the extreme. I haveheard it described as a high level language for lowlevel programmers, and this seems a pretty aptdescription. It has some features which have parallelsin assembly language, but it is a genuine high levellanguage with string functions and the like. On theface of it, C should be easy for someone who hasused BASIC plus assembly language routines, whichmeans a good many home computer users. Noteveryone with such a programming language finds Cpalatable though. A BASIC program line might belegal in C, but it might not provide the same function.You have to be prepared to learn C right from thebeginning rather than trying to jump straight in andproduce large programs. In C you have to declarevariables, rather than simply inventing them as you goalong, as in BASIC. This is no great problem asmodern text editors make it easy to go back to thebeginning of a program and add in any variables thatare newly added. You have to get used to this wayof doing things though, and be careful not to over-look any undeclared variables. The transition fromBASIC to C could be difficult for someone who hasbecome set in his or her ways. It is a type of languagethat is suitable for dabbling in if you are experiencedin another language, and would like to try it out byproducing a few simple programs.

Pointers are usually reckoned to be the mostdifficult aspect of C for beginners to grasp. Basicallya pointer is just a variable that selects another variable.One use of this "indirection" is to enable one pro-gram module to operate with several sets of data,with the pointer or pointers being used to select thedesired set. A more common use is to enable aprogram to easily access a character within a blockof text, or something of this nature. This type ofthing can only be undertaken in a relatively clumsyfashion using many programming languages.

Although C is not regarded by all as a structuredlanguage, it can be used for large and structuredprograms. It is not a structured program in the sensethat it does not force the use of a highly structuredapproach. It is a very powerful and versatile languagewhich enables you to tinker in an unstructuredmanner at a low level if that is what is called for. Itwas originally designed for writing operating systemsand other "background" software, but it is used fora wide range of program types. It is well suited tosmall utility programs as well as large projects such asspreadsheets, databases, and word processors. It ismuch used by professional programmers, and isarguably the fastest programming language formicrocomputers apart from assembly language/machine code. Probably its main drawback is that it

48

Page 59: Computer Hobbyists Handbook - World Radio History

can be easy to make mistakes and difficult to debugthe affected programs.

Pascal and Modula 2Pascal was written to provide a programming languagethat would encourage good (structured) program-ming techniques, and it was designed by ProfessorNiklaus Wirth in the early seventies. A Pascal pro-gram generally takes the form of a main programhaving a series of conditional instructions, plussub -programs (or whatever term you prefer) whichthe main program branches to. Of course, thesedays this is not exactly a unique feature, and anumber of languages permit this structured approach.

Whereas C does little to disguise the way in whichthe computer stores and handles data, Pascal has aso-called "real -world" approach in which there arestrict data types which can only be handled in waysin which the programming language considers to bevalid. It is very logical in this respect, but possiblya little limiting. Of course, many languages havedata types, but in Pascal the types can be preciselydefined. If some variables will be integers in therange 0 to 100, then you can define a data type asintegers in this ramie, and then use this data typefor these variables. With most other languages youwould select the nearest applicable data type froma list of predefined types. In our example abovethis would probably be a simple 8 bit number (0 to255 in decimal terms), but you might have to use amulti -byte variable where a single byte would suffice.

Whereas C is rather cryptic, and following pro-gram listings can be difficult for even an experiencedC programmer, Pascal listings are generally mucheasier to follow. You do not have to use long vari-able names etc., but this is the convention withPascal programs. Of course, this improved readabilityis at the expense of more typing by the programmer.

Pascal is a good general purpose language whichhas been used to produce a great deal of high qualitysoftware. It is not without its drawbacks though.One of these is that it is relatively difficult to learnand to fully master. It is a rather fussy languagewhich makes it difficult to use on a quick trial basis.It is a matter of doing some determined learning ornot bothering at all! It lacks features compared tosome other popular programming languages, and itrelies heavily on external libraries to augment thebasic language. This is not an uncommon way ofhandling things with modern programming languagesbut these add-on libraries are perhaps more importantwith Pascal than is the case with some of its competi-tors. Stemming from the lack of features of theoriginal language, a lot of "improved" variations havebeen produced. This makes Pascal less portable thansome other languages, particularly C.

Pascal is intended for use with the structured"top -down" approach to programming. This is whereyou gradually work out the overall structure of a

program, breaking it down into sections andsub -sections until it is at the stage where you canbegin to write the code. The traditional BASICapproach is the "bottom -up" method, which is gener-ally a less well planned ''suck it and see" method.Top -down programming is often likened to washingyour hands after gcing to the lavatory - everyonesays they do it! What is often seen as a blunder inthe design of Pascal is that the sub -program defini-tions have to be included in the source program,which would seem to make it necessary to planprograms from the top -down and write them fromthe bottom -up. I would presume that the idea is tohave the program thoroughly worked out beforestarting to write it. There is then no problem inwriting it with the procedure definitions in thesource program. Not everyone gets on well withsuch in depth program planning, and the nature ofsome programming is to some extent experimental,where a certain amount of the "suck it and see"approach is necessary in order to gauge thefeasibility of the project.

Modula 2 tends to be regarded as the successor toPascal, although I doubt if dedicated Pascal pro-grammers see it in this way. It was designed byProfessor Niklaus Wirth, the creator of Pascal. It is

designed to use separately compiled programmodules - something which is not part of theoriginal Pascal language, but which is present insome more recent implementations.

The idea behind Modula 2 is to provide a pro-gramming language that Is analogous to the waycomputer and electronic hardware is designed.Modern electronics is based very much on integratedcircuits which generate electrical signals, or take inelectrical signals and process them to produce amodified output signal. Even circuits which do notexclusively use integrated circuits are still largelycomposed of electronic "building-blocks" whichproduce or process signals. This brings tremendousadvantages for the electronics designer who does notneed to design each circuit from scratch. By usingintegrated circuits and established circuit blocks itis possible to put together quite complex circuits ina reasonable amount of time. The main tasks of theelectronics engineer are to design the overall system,to make sure all the blocks fit together properly, andto design any circuit blocks where existing circuitsdo not provide exactly the iequired function.

Software development has tended to lag someway behind hardware, and the idea of Modula 2 is touse program modules to permit large programs to bequickly and easily built up. Rather than hardwareprocessing electrical signals. it is program modulesprocessing data. New modules can be producedwhere existing ones are inappropriate. The modulesare sometimes called "software chips". Due to itsmodular nature, Modula 2 is well suited to large pro-jects where two or more programmers will undertakethe work. By having rigid rules for input/output,

49

Page 60: Computer Hobbyists Handbook - World Radio History

the modules produced by different programmers canbe guaranteed to operate properly together.

This description of Modula 2 is a bit simplistic,and in practice things are a little more difficult tofully master. For someone who has become anexpert BASIC programmer the transition to Modula2 could be a difficult one. For the Pascal program-mer the transition should be relatively painless.

Being a relatively new programming language,some implementations lag well behind other popularprogramming languages in terms of sophistication andease of use. Some recent versions are very good inboth respects, but others tend to be difficult andcumbersome in use. I have a version of Modula 2for a powerful 16 bit computer, but with its massesof files it is barely usable. Modula 2 is not particu-larly fast by compiled language standards, but again,some recent implementations are much better in thisrespect and comparable to most Cs.

The RestThis covers the most popular languages for micro-computers, but there are a larger number of otherlanguages in use. Some of these are rather specialisedin nature, such as the artificial intelligence languagesLisp and Prolog, and their many mutations. Theselanguages do not really meet most people's definitionof "intelligence", and are not capable of originalthought. The idea is to provide a set of rules so thatthe program can make an intelligent guess instead ofhaving to be fed with explicit data in normal com-puter fashion. For example, the CAD programAutoCAD is written using Lisp (a list processinglanguage), and it includes a clever hatching feature.You indicate a border area, and the computer fills itin with a predefined pattern of lines. This may notseem particularly revolutionary, but the AutoCADhatching facility goes beyond this basic scheme ofthings. You can select objects that will define aborder area, and can also include objects within thatarea. The program decides which objects constitutepart of the border and which are within the borderarea. It then hatches inside the border, but avoidsdrawing over the selected objects within the border.You do not have to tell the program which is which- it makes up its own mind. This type of thing cancertainly make programs much quicker and easier touse, and takes them a step forward in terms ofsophistication. It is something that might becomemore common as programmers endeavour to maketheir products more powerful than those of thecompetition.

Another use of artificial intelligence is in expertsystems. In fact this is probably their main use. Oneapplication of this type is in medical diagnosis, wherean expert system can be used to effectively give adoctor of relatively little experience some of theexpertise of a consultant. This type of system isbasically a database. However, the "intelligence" is

used to take a list of symptoms and other relevantinformation and give a list of possible ailments,indicating the relative likelihood of each one. Theprogram is not using some form of magic formula tocome up with the answers - it has to be meticulouslyfed with data by an expert, and it is using his or herexperience to work out what are most likely to be theright answers. For the program to work well it mustbe correctly seeded with data by an expert.

Both these languages are available as commercialprograms for some computers, and they are alsoavailable as public domain/shareware software forcertain machines.

Forth is a language that seemed likely to becomevery popular at one time, but is something of a raritythese days. Apparently it was originally designed forthe control of radio telescopes. It is well suited toother control applications though, and could poten-tially be used in a wide range of applications. It hasbeen described as being as difficult to learn asassembler while having the operating speed of BASIC.This is something of an exaggeration, and it is gener-ally very much faster than an interpreted BASIC.It is somewhat lower level language though, and assuch it is that much more difficult to master. It is athreaded interpretive language rather than a trulycompiled type, which helps to give it the speed edgeover an interpreted language such as a (non -compiled)BASIC. In effect, the source program statements arestored in a semi -interpreted form so that they can bequickly turned into a fully executable form and runwhen the program is run. With fully compiledlanguages now so commonplace the speed of Forth isperhaps less impressive than it once was. Also, withcomputers generally having much larger memoriesthese days, a range of compiled languages (whichtend to require large amounts of memory) are nowavailable for most machines.

Forth's main claim to fame is its dictionary ofinstructions. The user can define new commands andadd them to the dictionary, and they are then treatedjust like the original command words. This gives aform of modular approach with parts of a programbeing defined as new command words which can thenbe used as and when required.

Forth is certainly a very versatile language, butmany programmers simply prefer to use assemblylanguage where speed is important, or BASIC where itis not. It is available commercially for a number ofcomputers, and there are also shareware/publicdomain versions for some machines. It is an interest-ing language to try out, but its reverse Polish notationis rather back-to-front compared with conventionalnotation, and it could take some getting used to.

C++ is a language which seems to have gained a fairamount of attention recently. It is an extension of Cwhich permits object orientation. This subject issufficiently involved to defy quick and meaningfulexplanations, and an in-depth study of the subjectwould seem to be in order if you wish to gain a real

50

Page 61: Computer Hobbyists Handbook - World Radio History

understanding of this subject. Apparently C++ wasinspired by a language of the 1960s called "SIMULA",which was intended for programming real-timesimulations. Another language inspired by SIMULAis "Smalltalk", which was produced by Xerox Parcin the 1970s. The most notable feature of Smalltalkis its use of windows and mice, and it is generallyregarded as having inspired the use of these in theMacintosh and subsequent WIMP computers/soft-ware. It does in fact have a number of novel features.and is a very interesting language. However, it is

something of a rarity, and finding a full implementa-tion of Smalltalk for your particular computer couldprove to be difficult (or impossible).

Fortran is a language which exists in both com-piled and interpreted forms, but is normally compiled.There is more than one version of this language, but"Fortran 77" is the "standard" version. It is aimedprimarily at scientific and engineering applications.Unlike BASIC and Forth which are often used in thesesame areas of application, it is more specialised andis little used for any other purposes. It is almostcertainly the best choice for the majority of scien-tific and engineering applications. Its main drawbackis that there are few (if any) low cost versions of thislanguage. Also, like many advanced high levellanguages, it is mainly used on 16 -bit systems ratherthan 8 -bit types.

51

Page 62: Computer Hobbyists Handbook - World Radio History

fr.2 -NV* f

."4.:

!FOP_r ,

y

r,.4.4

-10

.47 -

VT3f

1.! AlF4.-114;)il ..d4:..

.fa. #

Page 63: Computer Hobbyists Handbook - World Radio History

Chapter 4

NUMBERING SYSTEMS

The numbering system we use in everyday life is, ofcourse, the decimal system, or "denary" system as itis alternatively known. This method of numbering isbased on the number 10, but it is quite possible tohave a system based on any number. There is normal-ly no point in doing so, and the old imperial measureswhich were based on a variety of numbers (twelve inthe case of feet and inches for example) are now wellon the way to being phased -out in favour of themetric system. Truly "metricated" computers seemto be some way off, and for the foreseeable futurethey will work in binary.

Binary NumbersI suppose that binary could reasonably be regarded asthe simplest possible method of numbering. It is

based on the number two, and where in the decimalnumbering system the single digit numbers are from0 to 9, in binary they are only from 0 to 1. In otherwords, the only valid number for each digit is 0 or 1,and absolutely nothing else is allowed! This mightseem to be a pointless way of handling numbers, butit is very convenient from the hardware point of view.Representing just two numbers by an electrical signalis very easy. A low voltage (normally about 2 volts orless) is used to represent a 0, and a higher voltage(usually about 3 to 5 volts) represents a 1. Thesesignal levels are often called "low" and "high" respec-tively, or "logic 0" and "logic 1". Although conveni-ent for the hardware producers, this system has itslimitations and drawbacks. There have been sugges-tions over the years that circuits which can workdirectly in decimal will be a practical proposition forwidespread use before too long, but there seems to belittle real prospect of such a development in the nearfuture. For the time being circuits which work inbinary are the only practical ones for general use.

Binary is easier to understand if you first analysewhat an ordinary decimal number represents. If weconsider the decimal number 238 for instance, theeight represents eight units (10 to the power of 0),the 3 represents three tens (10 to the power of 1),and the 2 represents two hundreds (10 to the powerof 2). Things are similar with a binary number suchas 1101. Working from left to right again, thecolumns of numbers respectively represent the units(2 to the power of 0), the 2s (2 to the power of 1),the 4s (2 to the power of 2), the 8s (2 to thepower of 3), and so on. 1101 in binary is thereforeequivalent to 13 in decimal (1 + 0 + 4 + 8 = :3).

It takes a lot of binary digits to represent numbersof quite modest magnitude, but this is the price thathas to be paid for the convenience of simple biraryhardware. A binary digit is normally contracted tothe term "bit". One bit on its own is of limited value,

and bits are normally used in groups of eight, ormultiples of eight. A group of eight bits is normallytermed a "byte". A byte can only handle numbersfrom 0 to 255 (decimal). This is adequate for somepurposes, but often larger values must be handled. A16 bit binary number is usually termed a "word",and this gives a range of 0 to 65535 (decimal). 32bits gives a range of 0 to something over four thou-sand million, which should be adequate for mostpurposes. A 32 bit number is normally termed a"long word".

You can not do much computing without comingacross the term "k". This is the abbreviation for"kilobyte", which is a thousand bytes. In fact, to beprecise, it is 1024 bytes. This may seem to be an oddnumber to choose, but a .0 bit binary number coversa range of 0 to 1023, or 1024 different values inother words. The extra 24 on each k is often not ofgreat significance, but it .s interesting to note that acomputer with a "megabyte" of memory has1048576 bytes of memory. Not a million bytes, andsome 47k to 48k above the million byte mark. A

"megabyte", which is often abbreviated to just "M",is the usual unit of measurement for large amountsof data, RAM, or whatever.

This table shows the number represented by bitsin 16 bit numbers, and this might help to clarify theway in which the binary system operates. Thenumbers in the table are the ones that the bitsrepresent when a I is present in that column of thebinary number. If there is a 0 in a column, then thatcolumn always contributes 0 to the value of thenumber. We are using tie convention of calling theunits column bit 0, running through to bit 15 for theleft -most column (not bits 1 to 16). The unitscolumn is often called the "least significant bit", or"LSB" for short. Bit 31 (or the left -most columnthat is actually used) is termed the "most significantbit", or just "MSB".

Bit Decimal Value Bit Decimal Value0 1 8 2561 2 9 5122 4 10 10243 8 11 20484 16 12 40965 32 13 81926 64 14 163847 128 15 32768

Addition of two binary numbers is a straight-forward process which is really more simple thandecimal addition. Here is a simple example of binaryaddition.

53

Page 64: Computer Hobbyists Handbook - World Radio History

First number 240 11110000

Second number 85 01010101

Answer 325 101000101

As with decimal addition, start with the unitscolumn and work towards the final column on theleft. In this case there is a 1 and a 0 in the unitscolumn, giving a 1 in the units column of the answer.In the next column two Os give a 0 in the answer,and the next two columns are equally straight-forward. In the fifth column there are two Is to beadded, giving a total of 2. Of course, in binary thefigure 2 does not exist, and this should really bethought of as 10 (one 2 and no units), and it is

treated in the same way as 10 in decimal addition.The 0 is placed in the answer, and the 1 is carriedforward. In the seventh column this gives a total of3 in decimal, but in this binary calculation it must bethought of as the binary number 11 (one 2 and oneunit). Therefore, 1 is placed in the answer and 1 iscarried forward. In the eighth column this gives ananswer of 10, and as there are no further columns tobe added, both digits are placed in the answer.

Signed BinaryThe binary system described so far, which is oftencalled "direct binary", is inadequate for manypractical purposes. Its main drawback is that it cannot handle negative numbers. Obviously you cansimply add a minus sign ahead of a binary numberto indicate that it is a negative number, but you haveto bear in mind that for computer applications thisis not valid. There is logic 0 and logic 1, but nologic - level!

One way around the problem is to use "signedbinary". With a signed binary number the first bitis used to denote whether the number is positive ornegative. The convention is for the first bit to be a0 for positive numbers and a 1 for negative numbers.With this system the normal 8 bit range of 0 to 255 isreplaced with a range of -127 to +127 (11111111 to01111111). The problem is solved at the expense ofdecreased maximum magnitude for a given number ofbits. Note though, that where two or more bytes (orwords or long words) are used together to form alarge number, only the most significant bit of themost significant byte needs to be used to indicate thesign of the number. It is not necessary to sacrificethe most significant bit of each byte to this task.

Obviously a certain amount of care needs to beexercised when dealing with binary numbers, and youmust know whether you are dealing with direct orsigned binary numbers. For instance, 10000001 couldbe 129 (direct binary) or -1 (signed binary). I haveencountered computers which have a binary todecimal conversion facility, and which seem to getconfused in this way. Results were as expected foranswers up to 32767, but things went completelywrong with high numbers. This happens where the

computer operates with binary numbers of up to 16bits in length, and it interprets any values it is fed assigned binary. This works fine if you know that it isworking with signed binary. It also works fine if it isfed with binary values of 15 bits in length or less.The leading zeros then inform the computer that thenumber is a positive one, and the right answer isobtained. For numbers of more than 32767 the mostsignificant bit is a 1, telling the computer that it is anegative number, even if you require a direct binaryconversion.

In this basic form the signed binary system has itslimitations. The problem is that although it canrepresent a wide range of positive and negative valuesperfectly adequately, calculations on simple signedbinary numbers do not give the correct result. This isof only academic importance to users of high levelapplications programs and applications software.You give the computer such numeric data, positive,negative, or a mixture of the two, and everything issorted out for you. It is something that is of greaterimportance to the low level (assembly language ormachine code) programmer. Confusing results can beobtained unless you understand just how the micro-processor is handling things.

Ones ComplementThe simple calculation shown below illustrates theproblem that occurs using simple signed binary.

First number 16 00010000

Second number -5 10000101

Answer -21 10010101

Adding 16 to -5 should obviously give an answerof 11 and not -21. What is happening is that thenegative sign of the -5 is being added to the answerso that the answer must always be negative if one ofthe numbers being added is a negative type. This isclearly incorrect, as in this example. The main bodiesof the numbers are simply added together, and theirsigns are ignored. Negative values therefore incre-ment the figure in the answer rather than decrement-ing it.

An alternative and related method of handlingbinary numbers is the "ones complement system".Here a negative number is the complement of itspositive equivalent. For example, 16 is 00010000 inbinary, and so -16 is 11101111 in ones comple-ment binary. In other words, the Os are simplychanged to Is and the 1 s are changed to Os. Thisgives much better results when used in calculations,as demonstrated by the example given below.

First number 16 00010000

Second number -5 11111010

Answer 266 100001010

54

Page 65: Computer Hobbyists Handbook - World Radio History

I suppose that on the face of it this answer is evenfurther from the right answer than when simple sign-ed binary was used. The margin of error is certainlymuch greater, but the usefulness of this systemdepends on how the answer is interpreted. The firstpoint to note is that the positive number starts with a0 while the negative number has a 1 as the first digit.Provided sufficient digits are used this will always bethe case, and in this respect the ones complementsystem is the same as straightforward signed binary.The answer is completely wrong of course, but if thecarry is ignored the answer is much closer to the rightone. The answer is then 1010 in binary, or ten ifconverted to decimal. This is just one away from theright answer. So what happens if we try anotherexample and ignore the carry.

First number 32 00100000

Second number -4 11111011

Answer 27 00011011

As before, the answer is wrong but it is just oneless than the right answer (which is of course 28 inthis case).

Twos ComplementClearly this system can be made to operate correctly,and it is just a matter of finding some way of correc-ting the minor error in the answer. The standardmethod used with most microprocessors is called"twos complement". This differs from onescomplement in that once the complement of anumber has been produced, one is added to it.Therefore, rather than -5 being represented as

11111010, it becomes 11111011 in twos comple-ment. If we now apply this to one of the examplesgiven earlier we obtain the following result.

First number 16 00010000

Second number -5 11111011

Answer 11 00001011

This time, provided we ignore the carry, we doindeed obtain the correct answer of 11. This is aconvenient way of handling subtraction (for micro-processors if not for humans), since subtraction canbe carried out by the same circuit that handlesaddition. To handle a calculation such as 45 - 25the value of 25 is converted to twos complementand then added to 45. In other words, instead ofhandling this calculation in the form 45 - 25 it is

undertaken in the form 45 + (-25), and either waythe answer is 20.

The following table shows some sample numbersin twos complement form, and this should help toclarify the system for you. Note that, like ordinarysigned binary, the first digit is used to indicatewhether the number is positive or negative.

Number Positive Negative0 00000000 000000001 00000001 111111112 00000010 111111103 00000011 111111014 0000C100 1111110032 00100000 11100000126 01111110 10000010127 01111111 10000001128 010000000 10000000

Note that with 8 bit twos complement numbersthe range is from -127 to +128 (not -127 to +127as with simple signed binary).

So far we have only considered calculations wherethe answer is a positive quantity, but the twoscomplement system works equally well if the answeris negative. This point is demonstrated by theexample provided below.

First number 16 00010000

Second number -31 11100001

Answer -13 11110001

The twos complement system also functionsproperly when the two numbers being added are bothnegative, as in this example.

First number -4 11111100

Second number -8 11111000

Answer -12 11110100

Binary Coded DecimalSeveral microprocessors can operate using anotherform of binary called "binary coded decimal", orjust "BCD". This is a somewhat less compact andefficient form of binary, it is generally somewhatslower, and it is not used in most applications. Itdoes have its advantages though, and the main oneis that it can be used to provide a very high degreeof precision.

With BCD four binary bits (often termed a

"nibble") are used to represent each decimal digit.The system operates in tie manner shown below.

Decimal Number Binary Code0 0000

1 00012 00103 00114 01005 01016 01107 01118 10009 1001

55

Page 66: Computer Hobbyists Handbook - World Radio History

The binary number is in fact just the ordinarybinary bit code for the number concerned, and it isonly for numbers of more than 9 that the system isdifferent. The binary codes from 1010 to 1111 areunused, and all two digit decimal numbers require 8bit BCD codes. For instance, the decimal number 64would be represented by the 8 bit BCD code01100100. The first four bits (0110) represent thesix, and the second four bits (0100) represent thefour. Each byte can therefore represent any twodigit decimal number from 0 to 99, which comparesto a range of 0 to 255 for an ordinary 8 bit binarynumber. This helps to contribute to the relativeinefficiency of the BCD system. Of course, when anibble is incremented by 1 from a value of 1001 (9in decimal) it does not go to 1010 (which is an illegalcode in BCD), but cycles back to 0000. A carryforward of 1 should then be taken to the next BCDnibble.

With this system there is no difficulty in handlinglarge numbers, and it is just a matter of using severalbytes in order to accommodate the required numberof digits. Negative numbers and decimal points canalso be handled with ea:2 by this system, but thisrequires several additional bits. This information isusually carried in the most significant bits (i.e. theleft hand end of the number). Some microprocessorsperform BCD calculations by performing calculationsin ordinary binary and then adjusting the result, butsome have a true BCD operating mode.

HexadecimalHexadecimal is a numbering system that you arealmost certain to encounter a good deal. It is usuallycalled by its abbreviated name of "hex". A problemwith binary numbers is that they tend to have manydigits with each one being a 0 or a 1, which makesthem rather difficult to deal with in many circum-stances. For instance, dealing with 16 or 24 bitaddresses or microprocessor instruction codes in theirbinary form would probably be beyond most peoples'ability. On the other hand, binary numbers give agraphic representation of each bit in the register of amicroprocessor, control register of a peripheral chip,output terminals of a printer port, or whatever. Thisis something that is often important, especially whendealing directly with the peripheral chips of a com-puter. Decimal numbers are much easier to deal within that they are much shorter and are in a morefamiliar form. Unfortunately, a decimal number doesnot give much idea of the state of each bit in itsbinary equivalent. Converting a decimal number toits binary equivalent is not a particularly quick oreasy process (without the aid of some computerisedhelp anyway). Decimal numbers are consequentlyrather inconvenient when things must be visualisedon a bit by bit basis.

The hexadecimal system gives the best of bothworlds in that it takes just a few digits to represent

even quite large numbers, and it is in fact slightlybetter than the decimal numbering system in thisrespect. On the other hand, it is quite easy to converthexadecimal numbers to their binary equivalentswhen the state of each bit must be known. The con-version process is quite simple even with very largenumbers. The hexadecimal system is based on thenumber 16, and there are sixteen single digit numbers.Obviously the numbers we normally use in thedecimal system are inadequate for hexadecimal asthere are six too few of them. This problem is over-come by augmenting them with the first six digits ofthe alphabet (A to F). It is from this that the systemderives its name. The table given below helps toexplain the way in which the hexadecimal systemoperates.

Decimal Hexadecimal Binary0 0 0000

1 1 000112 2 00103 3 00114 4 01005 5 01016 6 01107 7 01118 8 10009 9 100110 A 101011 B 101112 C 110013 D 110114 E 111015 F 111116 10 1000017 11 1000118 12 10010163 A3 10100011

What makes hexadecimal so convenient is the easewith which multi -digit numbers can be converted intobinary equivalents. The reason for this is that eachhexadecimal digit represents four binary bits. Takethe hexadecimal number A3 in the above table forexample. The digit A represents 1010 in binary, andthe digit 3 converts to 0011. A3 therefore represents10100011 in binary. You may find that you canmemorise each of the sixteen four bit binary codesrepresented by hexadecimal digits, but a little mentalarithmetic is all that is needed in order to make theconversion if you can not.

The digits in a hexadecimal number represent,working from left to right, the number of units, 16s.256s, 4096s, 65536s, 1048576s, and 268435450s(approx.). You are unlikely to use hexadecimalnumbers of more than eight digits in length, andmostly you will probably only deal with hexadecimalnumbers having four digits or less.

56

Page 67: Computer Hobbyists Handbook - World Radio History

OctalAlthough the octal numbering system was muchused in computer circles at one time, it seems to havefallen from favour. Hexadecimal now seems to havesuperseded it. As its name suggests, it is based onthe number 8. The columns of figures thereforerepresent the units, 8s, Ms, 512s, 4096s, 32768s,etc. Only the first eight digits (0 to 7) of thedecimal numbering system are utilised by the octalsystem, and so neither 8 or 9 are legal characters inoctal.

In common with hexadecimal, octal helps to keepthe number of digits in large numbers down toreasonable proportions, but it can easily be convertedinto binary if the state of each bit must be known.Whereas each hexadecimal digit represents a four bitbinary code, each octal digit represents just threebinary bits. With modern computing being based on8 bit bytes, or multiples of eight bits, the three bitoctal codes are less than totally convenient. It is

probably this factor that has led to its decline infavour of the hexadecimal system. Here is a list ofoctal digits and the three hit binary codes that theyrepresent.

Octal Digit Binary Code0 000

1 0012 0103 0114 1005 1016 1107 Ill

As with hexadecimal digits, the binary codes theyrepresent are just the standard codes for the numbersconcerned. It is probably not worthwhile taking thetime to familiarise yourself with the octal numberingsystem as it is rarely if ever encountered in practicethese days.

ConversionsConversion from hexadecimal to binary is, as we havealready seen, fairly straightforward. With a littleexperience a little mental arithmetic is all that is

needed to make this type of conversion. Conversionin the opposite direction is equally simple. It is just amatter of breaking down the binary number into fourbit groups and then converting each group to itscorresponding hexadecimal digit.

Conversions that involve decimal numbers are alittle more difficult to deal with. The easy way ofhandling the problem is to use a computer to makethe conversion. Most BASICs can provide a hexa-decimal to decimal conversion. If the computeraccepts hexadecimal numbers with (say) a "&H"prefix to indicate that they are in hexadecimal, thengiving the instruction:

PRINT &HXXXX RETURN

where "XXXX" is the hexadecimal number to beconverted, should result in the decimal equivalentbeing printed on the screen. A conversion in theopposite direction might also be possible, and this ismost commonly found in the form of a HEX$function You may even find that decimal to octalconversion is possible using an OCT$ function (as inAmiga BASIC for instance), although these days sucha function would seem to be of largely academicinterest.

Bitwise OperationsIn computing numbers are not only manipulatedusing the normal mathematical functions. There arealso the "bitwise" operations called "AND", "OR",and "XOR". These compare two binary numbers(literally) bit -by -bit, and the answer produceddepends on the combination of Os and Is present ineach column. ANDing produces a 1 in the answeronly if there is a 1 in that column of both the num-bers being ANDed. In other words, if a bit is set to 1in the first number and the second, a 1 is placed inthat bit of the answer. Hence the "AND" name ofthis logic operation. Here is a simple AND example.

First number

Second number

Answer

15

243

3

00001111

11110011

00000011

The answers obtained from bitwise operations cantend to look a bit random unless you consider what ishappening on a bit by bit basis. A common use ofthe bitwise AND function .s when less than all eightbits of a byte must be read. For instance, assumethat we wish to know the state of bit 3 of a registerin a peripheral device. Most computer systems do notprovide any means of reading just bit of memory orperipheral devices. One way around the problem is touse a bitwise AND operation to mask off the unwant-ed bits. In this case bit 3 represents eight when it isset to logic 1, and so the masking number to use iseight (00000100 in binary). In the answer all the bitsexcept bit 3 must be set to zero, as there is no waythey can be set to 1 in both numbers. The situationis different for bit 3, where both bits could be at logic1 if the second number also has this bit set to 1. Theanswer therefore reflects tie state of bit 3 in thesecond number, and is eight if this bit is high, or zeroif it is at logic 0. The ANDing provides the desiredfunction with, in effect, only the required bit beingread. It is possible to read more than one bit ifdesired. Just set any bits wnich must be read to logic1 in the masking number - set any bits which mustbe masked off to logic 0 in the masking number.

Bitwise ORing is a similar process to ANDing, buta 1 is placed in a bit of the answer if there is a 1 inthat bit of the first number, or the second number,

57

Page 68: Computer Hobbyists Handbook - World Radio History

or both. XORing differs from ORing in that it willplace a 1 in a bit of the answer if there is a 1 in thatbit of the first number or the second, but not if thereis a 1 in both bits of these numbers. A common useof these bitwise operations (and the AND function)is in computer graphics. They are often used to

ensure that the desired effect is obtained where oneon -screen object overlaps another.

Note that many BASICs have AND and OR func-tions. but these can not always be made to operatein a bitwise manner. These bitwise operations shouldalways be available at machine code level though.

58

Page 69: Computer Hobbyists Handbook - World Radio History

Chapter 5

OPERATING SYSTEMS

An operating system is one of those things that almostdefies description. Practically every computer haswhat could be described as an operating system, andpractically every time you get a computer to dosomething, however trivial, you are almost certainlymaking use of the operating system (even if only inan indirect manner). With a lot of home computers,when you switch on the machine it loads and runs itsBASIC interpreter. With a computer of this type theoperating system is largely hidden from the user, andit may be virtually inseparable from the BASICinterpreter program.

The operating system is usually more obvious withbusiness computers where you are normally "in" theoperating system once the computer has gonethrough its initial start-up and checking procedure.Some business computers are set up as "turnkey"systems, where they automatically run an applicationsprogram after the initial testing routine has beencompleted. In fact a system of this type still goesinto the operating system after the initial checkingroutine, but the operating system is set up so that itautomatically runs the applications program.Although the user may not be aware of it, theapplications program will almost certainly makeextensive use of the operating system.

PurposeSo just what is the purpose of an operating system?Its main function is to provide a set of routines tocontrol input and output. In most cases any form ofinput or output is via the operating system, whichmeans such things as the keyboard and the monitorscreen as well as printer and serial ports. In otherwords, it provides a link between the microprocessorat the heart of the computer, and the various peri-pheral devices that connect it to the outside world.We are not talking here about physical links, but ofsoftware routines that control everything. Theseroutines are usually available to the user via com-mands typed from the keyboard, so that tasks suchas copying discs or printing out a disc file can beundertaken. They can also be accessed by applicationsprogrammers. It is not usually obligatory to accessthe peripheral chips via the operating system, but itis a convenient way of handling input and output.Why bother to write routines to control the peri-pheral devices when they are already there in theoperating system just waiting to be used? Well, thereis one reason which is speed. Where an applicationdemands speed and the operating system proves to beinadequate in this respect, most programmers simplyaccess the peripheral devices directly in an attemptto improve matters.

This is not necessarily something that is of purelyacademic importance. A purpose of many operatingsystems (including CP/M and MS-DOS) is to provide astandard input/output interface for applicationsprograms. In other word;, although two computersmight have substantial differences in their hardware,provided they have the same operating system, anapplications program designed to operate under thatsystem should work equally well on either computer.In effect, where necessary the operating system soft-ware will disguise one piece of hardware to make itappear to operate like another (and similar) piece ofhardware. It is this type of manipulation that cantend to slow down an operating system. If anapplications programmer writes a program to directlyaccess the input/output chips, assumptions have to bemade about which chips the computer will use, andwhere they will appear in the input/output map. Inpractice this means that the program becomes"machine specific", and is unlikely to run on anyother computer even if it is running under the appro-priate operating system. The practical result of thisis that computers designed for one of the popularoperating systems do not just use the same micro-processor as other machines designed for that operat-ing system, but all their hardware is usually verymuch the same. The best example of this is theIBM PC and its derivatives such as the AT. Thereare countless IBM PC compatibles in existence, mostof which are the same basic design as the original,albeit in somewhat disguised form in the majority ofcases.

Using an Operating SystemThere are several operating systems in common usethese days, and although they have many differences,they also have a number of features in common.When you are "in" an operating system there isnormally a "prompt" to indicate that the computeris ready and waiting for a typed command. This isoften a ">" symbol, but others are used and theremay be several options. Often the prompt is preced-ed by a letter to indicate which disc drive you are"in". All this means is that unless you specify aparticular drive, or other input/output device, thecomputer will assume that the current drive is the onethat should be used as the source for input or thedestination of any output The drives are usuallynamed "A", "B", "C", etc., but other methods ofidentification are also used. For instance, inAmigaDOS the drives are called "DFO", DF1", etc.("DF" presumably standing for "drive -floppy").

Most modern operating systems permit the discdrive of a single drive system to operate as both drive

59

Page 70: Computer Hobbyists Handbook - World Radio History

"A" and drive "B". This is not always possible, andit is not a feature of CP/M prior to CP/M version3.0 (or "CP/M Plus" as it is often called). A lack ofthis facility limits the usefulness of a single drivesystem as there may be no way of copying disc filesor backing -up complete discs. Where it is permitted,how can one drive act as two? Nothing particularlyclever is needed in order to achieve this, and it is justa matter of the drive acting first as drive "A", then asdrive "B", then as drive "A" again, and so on. This isnot quite as good as having two drives as a largeamount of disc swapping can be needed. Some pro-grams are unusable on a single drive system as theywould require an inordinate amount of disc swapping.

AmigaDOS does not allow one disc drive to act astwo, but it still permits disc copying and similar func-tions to be carried out without any difficulty. Thereis more than one way of achieving this type of thing,but the usual AmigaDOS method is to use discs aslogical devices. The precise way in which logicaldevices are treated varies from one operating systemto another, and AmigaDOS is rather more advancedthan many in this respect. The general idea of logicaldevices is to have a number of notional devices (thelogical devices), and the actual (physical input/output)devices of the computer. Usually it is possible toassign logical devices to actual devices. For instance,"PRN" might be the notional printer device, and byassigning this to the second serial port, this portwould effectively be made the printer port. The usualway of identifying logical devices is to use a colon( : ) at the end of the device name.

If AmigaDOS encounters a logical device namethat is not one of its normal devices (such as thekeyboard, printer port, etc.) it assumes that thisdevice is a disc. I do not mean that it assumes thisdevice to be a disc drive - I mean it assumes it is afloppy disc. Many operating systems permit"labelling" of discs, where the disc is given a namewhich is actually stored on the disc. In most casesthough, this is not of any great significance, andits purpose is much the same as a paper label stuck ona disc for identification purposes. With some operat-ing systems, including AmigaDOS, the naming ofdiscs is of greater importance. If you wish to (say)copy a file from one disc to another, you can usethe name of the source disc (complete with colon)followed by the file name, and the name of thedestination disc (again complete with colon). Thecomputer then knows precisely what it must do,and it then tells you when to place which disc inwhich disc drive. If the system only has a singledrive, then this drive will always be used for anyreading from or writing to disc. Th:s method canseem to be a little fussy and awkward when com-pared to systems which simply use one drive asdrives "A" and "B". It certainly needs a certainamount of planning in that it only works properlyif you name each disc before starting to use it. It isreally a very advanced and versatile way of handling

things, and is especially good for those with singledrive systems.

The CommandsAn operating system can be used to perform a varietyof input/output related tasks, but just what are thesetasks? The exact facilities available varies consider-ably from one operating system to another, but basicones such as disc copying and formatting should beavailable on any operating system. In the section thatfollows this there is an alphabetical list of MS-DOScommands, together with a brief explanation of eachone. Some of the more obscure commands whichdefy brief explanation have been omitted. This listgives a good idea of the types of task that can beundertaken using a typical operating system. Withmost operating systems there are two basic varietiesof command; "internal" commands and the "exter-nal" type. An internal command is one that is loadedinto the computer's memory when the operatingsystem is "booted". Internal commands are thereforeavailable at any time. The frequently used commandssuch as "copy" are mostly of the internal type. Anexternal command is one which is stored on disc,and which is consequently only available if that disccan be accessed by the computer.

An obvious omission from the list of commands isone to run application programs. With MS-DOS, andmost other operating systems, it is merely necessaryto type the name of the program and press the"RETURN" key in order to run an applicationsprogram, and there is no "RUN" command as such.

AssignAssign is used to assign a different drive letter to adisc drive This is mainly used where an applicationsprogram does not let you use the drive or drives youwish to use. With the assign command you can getsuch a program to use one disc drive while it thinks itis using a different one.

AttribThis command sets or resets the read only attributeof a file, or it can be used to display the current stateof this attribute. Discs can be write protected viatheir write protect tab, but most operating systemsalso allow for software write protection of discs, orin some cases (including MS-DOS) individual files canbe write protected.

BackupBackup is used to make backup copies of discs asinsurance against the original becoming lost ordamaged. In practice it is mainly used with hard discmachines to backup the hard disc onto a number offloppy discs.

BreakIt is possible to break out of some operating systemactivities (even from within applications programs) by

60

Page 71: Computer Hobbyists Handbook - World Radio History

pressing the "CONTROL" and "C" keys. Normallythe operating system only checks for this breaksequence when reading the keyboard, or writing tothe screen or printer. The break command can beused to extend the break sequence to other activitiessuch as reading from and writing to discs.

ChdirChdir is an abbreviation for "change directory". Infact MS-DOS accepts the further abbreviation of "cd".Directories and sub -directories are mainly used withhard discs, although they can (and sometimes are)used with floppy discs. Directories and sub -directories divide a disc into what are effectivelyseparate compartments. If, for example, a computeris to be used to run a spreadsheet, a word processor,and database program, these could each be given theirown directories. Initially the operating system is inwhat is called the "root" directory, and the director-ies for the three programs would really be sub -directories of the root directory. However, theconvention is for sub -directories of the root directoryto be called directories. Sub -directories of thesedirectories are called sub -directories, as are any sub -directories of the sub -directories (they are not calledsub -sub -directories). You can have a large number ofsub -directories if desired, and this is often a con-venient way of doing things. For instance, the threeprograms could each have a separate sub -directory foreach month's data. This would make it relativelyeasy to track down a required file. With floppy discsthe limited capacity of each one tends to compart-mentalise data for you so that, provided you label thediscs sensibly, it can be easily located and retrieved ata later date. With hard discs having a typical capacityof around 40 megabytes these days, finding data canbe a protracted business unless the disc is sensiblyorganised into directories and sub -directories. In fact

you can keep branching into ever deeper levels ofsub -directories indefinitely, but it is best to keepthings within reason. Otherwise the use of sub -directories might make matters more difficult ratherthan easier. The normal way of showing the arrange-ment of sub -directories is to use a directory "tree",as in the example of Figure 5.1.

ChicdskThis is a disc checking command, and it simplychecks the disc in the specified drive for errors. Areport on the disc is printed on the screen.

ClsThis simply clears the terminal screen, and is similarto the BASIC CLS command.

CommandThis command starts the command processor (theprogram which contains all the internal MS-DOScommands). This instruction is usually run auto-matically at switch -on, and does not normally needto'be run again thereafter.

CopyCopy is one of the most frequently used commands,and it is mainly used to copy a file on one disc toanother disc. It is more flexible than this though,and it can be used to copy data from any file ordevice to any other file or device. As a couple ofexamples, it is quite possible to copy input from thekeyboard to a disc file, or to copy data from a discfile to a serial port.

CttyNormally commads are issued from the keyboard, orwhat is called the "console" in MS-DOS terminology.The ctty instruction enables a different source to be

Root

DatabaseI

WordProc Sprds-it

Jan88 Feb88 Mar88 Apr88 May88 Jan88 Feb88 Mar88 Apr88 May88

Jan88 Feb88 Mar88 Apr88 May88

Fig. 5. 1 An example directory tree

Page 72: Computer Hobbyists Handbook - World Radio History

specified as the source for commands, such as aserial port.

DateUsed to set the date on the MS-DOS clock/calendar.

DelThis is the delete command, and it deletes thespecified file or group of files. Like a number ofother MS-DOS commands, it accepts so-called"wildcards". This is where you use dummy char-acters in a filename, and MS-DOS then accepts anycharacter in that position. The dummy characteris an interrogation mark ("?"). MS-DOS filenamesconsist of the main name followed by an "exten-sion", which is a further group of up to threecharacters. The two parts of the name are separatedby a fullstop ( . ). Some extensions have specialsignificance to the operating system, and must not beused out of context. There are also some conven-tions that it is best to adhere to. The standardMS-DOS extensions are listed below.

EXECOM

BATSYSDOCTXTBAKBASH LPOVLOVRMSG$$$

An executable program.An MS-DOS command (also usedfor any short programs).A batch file.A system file.A text (document) file.A text file.A backup file.A BASIC program file.A help file.A program overlay file.A program overlay file.A program message file.A temporary file.

A "*" character can be used in place of the mainfile name and (or) the extension if the delete com-mand must be applied to any main filename and (or)extension. Thus "*.*" would be used to delete allthe files in a directory or on a floppy disc, and"*.BAK" would be used to delete all the backupfiles.

DirThis is the directory command, and it simply listsall the files in the specified directory. It providessome basic information such as the time and dateeach file was created, and the amount of space lefton the disc.

DiskcompThis compares two discs and reports that they arethe same, or not, as the case may be.

DiskcopyThe diskcopy command simply makes a copy of adisc. It copies the disc track by track, and sector by

sector, so that any sub -directories are copied and notjust the root directory. It can only be used withfloppy discs, and can not be used with hard discs.

FdiskThe fdisk command is used to configure a hard discfor use with MS-DOS, and it must be run before ahard disc can be used with MS-DOS. Once the dischas been configured, fdisk should not be neededagain.

FindA little known but potentially useful command. Itsearches for a string of characters in a file or series offiles (rather like the find facility found in manyword processors).

FormatThis command simply formats the disc in the speci-fied drive. It is used with both floppy and hard discs.

KeybxxIn its normal state MS-DOS is configured for use withan American layout keyboard. By running the appro-priate keybxx program MS-DOS can be reconfiguredfor a different type of keyboard (keybuk for use withU.K. layout keyboards for example).

LabelPlaces a volume label onto a disc. This label can beup to eleven characters in length. Like file names.letters and numbers are acceptable in labels, but thesecharacters are not: * ? / \ . , : ; + = <> [ j .

MkdirThis is the make a new directory command. It doesnot move the system into the new directory, it simplycreates it.

ModeThis sets the operating mode for certain input/outputdevices. It is used for such tasks as setting the baudrate and word format of serial ports, the screendisplay mode, and directing printer output to a serialport.

MoreThe more command sends output to the console(monitor screen) one screen -full at a time. The"RETURN" key is pressed to move on from onescreen -full to the next.

PathNormally MS-DOS only searches the current direct-ory for external commands. The path command canbe used to direct it to another directory if it fails tofind a command program in the current directory.

PrintThis command enables a file to be sent to a printer,

62

Page 73: Computer Hobbyists Handbook - World Radio History

but it is not the same as using copy to provide thisfunction. It provides background printing, whichmeans that you can issue further MS-DOS commandswhile the operating system is working away in thebackground sending out data to the printer.

PromptThe prompt command can be used to change theMS-DOS prompt. In fact it can be used to do some-what more than this, such as changing the displaycolour on suitable systems.

RenThis instruction is simply used to rename a file.

ReplaceThe replace command provides an easy way ofreplacing old files with new files. It is mainlyintended for use when replacing existing softwarewith an updated version.

RestoreAs explained previously, the backup command isused to take backup copies of files. If disastershould strike and (say) the hard disc is accidentallyformatted (which removes its previous contents),restore is the command that is used to take the dataon the backup discs and replace it on the hard disc.

RmdirThis is rather like the delete command, but it is fordirectories and not files. You can not remove adirectory unless all the files in it have been deleted(a factor which is common to all the operatingsystems I have encountered).

SortUsing this command the contents of a file are read,sorted into alphabetical order, and then printed outon the screen of the monitor.

TreeThe tree command lists the path of each directoryand sub -directory on the specified drive. It justgives a list, it does not draw out a directory treediagram!

TypeThis command displays the contents of a file on thescreen. With a large file the screen will probablyscroll far too rapidly to permit its contents to beread properly. Pressing "CONTROL" and "s" canbe used to start and stop the "typing", as required(or the "more" command can be issued togetherwith the "type" command).

VerIssuing the ver (version) command simply results inthe particular version of MS-DOS in use being printedon the screen.

VerifyThis command turns the verify switch on or off. Inother words, when data is written to a disc the com-puter verifies that the data has been successfullystored on disc, and gives a warning message if it cannot be stored on disc in uncorrupted form.

VolThis command merely displays the volume label ofa disc, if it has one.

XcopyThe xcopy command is much the same as the copycommand. They differ in that xcopy, unless instruc-ted otherwise, copies all files in the specifieddirectory, and will also copy any sub -directories.

Batch HesThis should give you a good idea of the kind oftasks that can be handled via the operating system,but this is only a rather superficial look at what isquite a complex subject. Most operating systemshave a lot of subtle and potentially very usefulfeatures. A very useful feature of MS-DOS is its batchfiles. This is where a series of instructions are con-tained in a disc file having "BAT" as its extension.By typing the name of the file it is run by the com-puter which then follows the list of instructions justas if they were typed from the keyboard. If a batchfile called "AUTOEXEC.BAr' is placed in the rootdirectory, this will be run automatically at switch -on, as soon as the MS-DOS command processor hasbeen loaded. This is useful for automatically loadingany software that must always be run at switch -on.This includes memory resident programs, mousedrivers, etc. If a computer is only used with oneapplications program, this facility can be used toautomatically load and run this program at switch -on.

WIMPsAlthough operating systems provide a wide range ofvery valuable features, they tend to be difficult tolearn and use. Some quite simple tasks can require along and complicated command to be typed into thecomputer. In an attempt to make their computerseasier to use, some manufacturers now supply themwith WIMP based "user interfaces". These are alsoavailable as add-ons for some computers that do nothave them as standard. GEM of the Amstrad PCs andthe Atari ST range is an example of a WIMP baseduser interface, as is the Amiga's "Workbench".

WIMP stands for "Windows - Icons - Mouse -Pointer". A window is merely an area of screenwhich is given over to a particular function, and anicon is a graphical representation of something. Forexample, a disc would be represented by a simplegraphical representation of a floppy disc. This typeof user interface differs from a conventional operat-ing system in that it uses a graphics screen rather thana text screen. Wherever possible icons tend to be

63

Page 74: Computer Hobbyists Handbook - World Radio History

File Options Arrange DESKTOP

C:

:Ewi:' :EmEEit

mirMa

:CS

Disk Ives;

. MUM

inD

-

A GEM screen taken from an Amstrad PC1512.

used instead of text, but text can (and often is)mixed in with the graphics where it is helpful inclarifying matters. The mouse, as no doubt mostcomputer users are aware, is a small box which ismoved around on the desk top in order to move theon -screen pointer to the desired position. Thepointer is sometimes a simple arrow shape, or it canbe something a little more elaborate. Esther way itsfunction is just the same - it indicates which iconyou wish to manipulate. The mouse has two orthree control buttons which are used to indicatewhen the pointer is over the desired icon, and thingsof this nature.

With a WIMP based operating system you wouldnormally run a program by placing the program discin (say) drive A, and then double "clicking" on thedrive A icon. Double "clicking" simply meansplacing the pointer over an icon and then pressing theleft mouse button twice in rapid succession. Doingthis on the drive A icon does not run the program, itopens a window in which the contents of the disc aredisplayed in icon form. Some of the icons might be

for "drawers" or "folders", which are sub -directoriesin normal computer terminology. Double "clicking"on one of these opens another window and displaysits contents. This might reveal icons for further sub -

directories, which can then be opened by double"clicking" them. To run a program you must double"click" on its icon.

Copying a file from one disc to another is quitestraightforward. First windows for the two discsmust be opened, and if the file to be copied is in adirectory or sub -directory, a window for that direc-tory must be opened. Similarly, if you wish to copythe file into a sub -directory, then a window for thatsub -directory must be opened on the destination disc.To copy a file you drag its icon to the window forthe disc and (where appropriate) directory or sub -directory you wish to copy it to. Dragging merelymeans positioning the pointer over the icon, pressingthe left mouse button, and then moving the mouse/pointer. The icon will move with the pointer. Delet-ing a file is usually similar, with the icon for theunwanted file being dragged to a "trashcan" icon.

64

Page 75: Computer Hobbyists Handbook - World Radio History

rile Options grange DESKTGV

nn07

Drive A: is not responding, You must

use the right kind of disk, insert it

correctly, and close the door, If the

w problem is with a hard disk, check the

disk's connections,

(irr,

A GEM screen showing a typical dialogue box.

To increase the features available from a WIMPbased operating system it is usually backed -up with apop -down menu system which permits facilities suchas disk renaming and formatting to be accomplished.A good WIMP based operating system is very versa-tile, but is probably somewhat less so than a text

based system. Some computers offer both environ-ments as standard. The Commodore Amigacomputers for example, have their "Workbench"WIMP user interface for beginners, and a commandline interpreter (CLI) for experienced users.

65

Page 76: Computer Hobbyists Handbook - World Radio History

The Amiga's Workbench user interface. The system "drawer" in the upper "window"has been "opened". The lower "window" shows its contents.

!)6

Page 77: Computer Hobbyists Handbook - World Radio History

Desk File 'el Options

irpla_I Show as Icons A:\

174 Show as Text n 20 items,

/ Sort by Mane 7 7

E Sort by Date r_ -,-.;.-c.: :,E:E .1.7" .-A% .E i :

Sort by Size --,.

Sort by 'Igoe __, ,-,z_

- ::e..E .1: ..:::r.." .F=: _ ,E -:.E :::"Eg".E .7"

FS.:.00.711 R14,7.Co.FE:

459555 bytes used in 9 items.

_Y

CREATOR .RE:

GEM on the Atari ST in the high resolution screen mode.Note the pop -down menu at the top of the screen.

()7

Page 78: Computer Hobbyists Handbook - World Radio History
Page 79: Computer Hobbyists Handbook - World Radio History

Chapter 6

COMPUTER GRAPHICS

Block GraphicsIn the beginning there were flashing lights on panels,then the teletype, then line printers, but with thearrival of the Visual Display Unit (VDU) withcathode ray tube came the possibility of computersdisplaying graphics as well as text. The first graphicson home computers, however, were based on textdisplays and took the form of modified characters.These characters were in the form of blocks ofvarious types, and were intended to be used to formdecorative lines on displays. They were printed onthe screen just like the normal alphanumericcharacters. By using suitable combinations, singleand multiple lines, broken lines and checkeredpatterns could be produced.

A further development of this was to allow usersto design their own character patterns. The block

shapes were stored in memory as bit patterns, andcould be modified by poking new values into theappropriate memory locations. Often this could bequite involved, as the bit patterns started off in ROM.To modify them, the entire character set had to be

copied into RAM, some or all of the charactersaltered, and the computer then instructed to usethe new set in RAM.

An advantage of block graphics is that it does notrequire a lot of memory to store the video display.Each character needs only one byte of memory, so a40 x 25 character display needs less than 1k ofmemory. A byte can hold values from 0 to 255, so256 possible characters could be displayed, thoughcharacter sets would normally be smaller than this.It is normal for the first 128 characters to be thenormal alphanumeric characters, punctuation marks,

The block graphics on the Sinclair ZX81 can be entered direct from the keyboard,and are seen here marked on the keys.

Page 80: Computer Hobbyists Handbook - World Radio History

NOMMINISSIK

MORMANIM

This "digital watch" has been drawn using the well-known teletext block !graphics.

etc. and for the second 128 to contain the graphicscharacters (however values below 32 are not normallyused for printable characters).

Many early animated computer games were writ-ten using user -defined characters. Such animationwas not particularly smooth, as the characters couldonly be moved by a smallest increment of onecharacter space, across or up/down, but fast actionwas possible, even with programs written in BASIC.A feature of block graphics is that the circuitry whichgenerates the display has to refer to the characterdefinition table in memory each time a frame is sentto the VDU, which is usually 25 times a second. Ifthe character tables are altered, the characters onscreen will alter. This was frequently used in gamesto make the aliens, monsters or whatever wave theirarms as they attacked.

Block graphics have not entirely died out. Thereare graphics characters in the character set of theIBM PC, and printers intended for use with thiscomputer can even print out these characters (thisincludes some daisy wheel types). However, perhapsthe best-known example of block graphics remaining

are the teletext graphics, familiar from the Oracleand CEEFAX TV displays. The BBC microcomputersalso have these characters built in, and these teletextor mode 7 graphics have something of a cult follow-ing among some BBC users.

A special feature of teletext graphics is the use of`serial attributes'. Some characters in the set do notappear as characters (their places in the displayappear as spaces in background colour), but theyalter the appearance of whatever comes after themon the same display line. They can alter foregroundand background colours, set flashing on or off, andchange the display to double -height characters (thisrequires printing exactly the same thing on twoconsecutive lines). These serial attributes allow asophisticated 8 -colour display to be built up, whilestill requiring just 1000 bytes to store a 40 x 25screen.

Block graphics, however, really belong to thedays when memory was expensive, and 16K was alot of RAM. Now that large memories are the norm,more sophisticated graphics are provided.

70

Page 81: Computer Hobbyists Handbook - World Radio History

Bit -Mapped GraphicsWhen a reasonable amount of memory can be setaside for the graphics display, it is possible to use asystem where each point which can be displayed on

the screen is controlled by one bit in memory. If

the bit is set, the point will appear as foreground, if

it is clear it will appear as background. This is thebasis of a bit -mapped display. On this type of dis-play, as well as displaying the normal text characters,it is possible to draw lines, and also to fill large areas,that is, display them in foreground colour.

In theory it is perfectly straightforward to displaytext characters on a graphics screen, and in practicemost computers with bit -mapped displays offer thisfacility. It is often possible to place text anywhereon the screen, not just on the standard text lines andcolumns. This is useful for labelling graphs andsimilar uses, and, in conjunction with user -defined

characters, for smooth pixel -by -pixel animations.User -defined characters can still be used to produce

aliens and monsters, but changing the characterdefinition in memory will not change the appearance

of characters already on the screen, so making them

wave their arms needs extra programming!It is common for computers which offer high -

resolution bit mapped displays also to have text -only

display modes, which normally use much less

memory and are useful for applications like word-processing where graphics are not required and thememory freed can be used to store larger documents.

There were a few early computers which had

separate text and graphics modes, and which did notallow text easily to be displayed in the graphicsmode. Notable among these was the Dragon. Thestandard way of getting around this was to draw textonto the screen using the line drawing commands.This was effective, but a bit of a nuisance, andprobably played a part in the demise of this machine.

Bit -mapped displays do need a fair amount ofmemory. A display capable of showing 640 pointshorizontally by 200 vertically (this is a common typeof display) needs 128000 bits, which is 16K. (In fact,

it is 16000 bytes whereas 16K is actually 16 x 1024

or 16384 bytes, but it would be normal to reserve a

C

I

E

T

F

U

C

TI

CREME NNUEFORPle with fmot tee kegs .CONNIIIDS t ispe and press (RETURN) .

END OUTPUT B press DREW )CON Nom= splay swim" drawsalve re load

Reeds e

Line graphics combined with text are useful for scientific and technical programs.

Page 82: Computer Hobbyists Handbook - World Radio History

An example of user -defined characters, in conjunction with line/fill graphics,to produce a game display.

full 16K block for this size of display.)A true bit -mapped display of this type is only

capable of showing two colours, foreground andbackground. If a colour display is required, more bits

are needed for each point. It is common to findcomputers offering several display modes. Either

more memory is required for more colours at thesame resolution, or a fixed amount of memory isused for the display, and there is a trade-off between

the number of colours which can be displayed and

the available resolution. This second system is themore common. One popular range of computersoffers three modes, either 640 x 200 in two colours

(1 bit per point), 320 x 200 in four colours (2 bitsper point), or 160 x 200 in 16 colours (4 bits perpoint). Such displays are still, however, called bit -mapped.

Though such a display is limited to two, four or16 colours at any one time, it is usually possible tochoose the colours to be displayed from a "palette"which contains many more colours. The valuesstored in screen memory are called the logical colour

numbers, and the numbers of the colours in thepalette are called the actual or physical colours. The

colours for the display are selected by assigning actual

colours to physical colours.This is often likened to having a limited number of

pens, each of which can be filled from a largernumber of bottles of ink. The number of coloursyou can draw in at any one time is limited by thenumber of pens, but you can empty a pen and fill itwith a different ink. This is not a very good analogy,however, as if you change the colour of ink in a pen(assign a different actual colour to a logical colour)anything drawn on the screen in the original ink willchange to the new colour. This last fact can be putto good use, however, especially in games. For

instance, by changing an assigned colour from a fore-ground colour to the background colour, things canbe made to appear and disappear instantly.

Extended Colour SystemsIf a large number of colours are required in a display.

as is often needed in games, the choice of needing

72

Page 83: Computer Hobbyists Handbook - World Radio History

either to use a large area of memory or limit theresolution becomes a problem. If the area of memorybecomes very large, firstly not much room is left foranything else, and secondly, the large manipulationsneeded for animation will tend to make game playsluggish. For these reasons, several methods havebeen devised to allow more colours to appear onscreen with less memory overhead.

In a system where a small number of coloursselected from a larger palette can be displayed, theactual assignment is done by part of the computerhardware as the screen image is sent to the VDU.A simple way of showing more colours is to cause thishardware device to use a different selection of coloursfor different parts of the picture. This is done bytiming, often by use of interrupts. Because of theway in which the picture is built up on the VDUscreen, in horizontal lines from top to bottom, thecolours usually can only be altered in horizontalbands across the screen.

An extension of this system is to allow each screenline to have its own set of assigned colours. This does

require some extra memory, as the colour assign-ments for each line must be stored, but the overheadis small, and displays using this system can be veryimpressive. With both these methods some care is,however, necessary, as object blocks moving downthe screen could easily change colour as they movethrough areas with different assignments.

An alternative system is the use of "parallelattributes". This system is used by the SinclairSpectrum, and is based on the text screen display.Each character position has a set of attributes whichcontrol the foreground and background colour forthat position, and also the degree of intensity (normalor bright) and whether steady or flashing. Thus youcan have only two colours in each position, but allthe available colours can be displayed simultaneously.The attributes for each position are set automaticallyas a line is drawn through that position (or a characterprinted), and this causes one limitation of the system.If you have drawn through a position in one colour,and subsequently drawn through it in another colour,the part of the original line passing through that

File Program Edit Fonts Colours Patterns Lines Windows B4S1C2

Hasa c

eady

Dialogue f

5;;t51;1488874030 ROM

DED COLod FILL WITH 8

-RND(6)

r T4 1234,5,61 MB a: TO finish

With modern graphics, a display like this dice with rounded cornerscan be produced very simply.

Page 84: Computer Hobbyists Handbook - World Radio History

Fonts Colours ittIrns Lines windows BASIC2

2627 week2829 11

303132 '''s

34 vcan-35 H3637 44-30 34ty

A feature of 'WIMP' graphics is a range of 'FILL' patterns.This is the choice offered by GEM on an Amstrad PC.

position will change to the new colour.The serial attribute system of the teletext display

system has been used just once in a high -resolutiongraphics display, on the One and Atmos series ofcomputers (which used the teletext system for theirtext display). Each serial attribute was only onepixel deep, but eight pixels wide, aligned on char-acter position boundaries. As the positions occupiedby the attributes appeared in background colour onlythis placed a lot of limitations on screen displays,and could not be considered a great success.

SpritesSprites, also called Moveable Object Blocks or MOBs,belong to the golden age of animated games, nowpast. In some ways a sprite is similar to a user -definedcharacter in that it has a shape defined as a bitpattern in memory, but in most cases it can be largerthan a character, and it may also be able to be multi-coloured. The way in which sprites are implementedcan differ from machine to machine, but in generalthey do not form part of the bit -mapped screen

memory. They are added to the display by a hard-ware device.

Sprites can be moved around the screen displaysmoothly, and it is not necessary to erase them froma previous position before moving them to a newone, which makes programming very easy. In fact,in the most sophisticated implementation, the spritecan be given a velocity and direction, and the hard-ware takes care of all movement. The hardwaredevice also signals to the program, either by a formof interrupt or by use of flags, when two spritescollide or when a sprite passes over a particularcolour on the main display. This makes it possibleto detect when a 'hit' has occurred.

It is interesting that although in the great homecomputer boom of the early eighties many machineswith sprite systems were available, none was eversupplied with a version of BASIC which allowed allthe sprite facilities to be exploited.

WindowsWindowing is a method of allowing the total screen

74

Page 85: Computer Hobbyists Handbook - World Radio History

areas to be divided up into two or more smaller areaswhich can be separately controlled. In particular itallows part of the screen to be designed as a textwindow and part as a graphics window. Text canthen be printed in the text window without havingto specify exactly where on the screen it will beprinted, and the text screen allowed to fill up andscroll, without any risk of the graphics windowbeing corrupted by text being printed across thedisplay. It should, however, be mentioned thatwith most simple windowing systems the windowscan overlap, and it is up to the programmer to ensurethat they do not unless intended.

Where windowing is based on a bit -mapped screendisplay, the windows will normally have to displaythe same colours, unless one of the extended colourmethods described above is in operation.

A more sophisticated form of windowing is nowcommon. In simple windowing, if text scrolls out ofa text window it is lost, and if anything is writtenover the contents of a graphics window the graphicsis lost. In the more sophisticated systems, theprinted text which scrolls out of the window isstored, and it is possible to scroll up and downthrough the contents, usually by use of a mouse,but cursor key control is also provided. It is alsopossible with these systems to open one window ontop of another window, and subsequently close it,and to have the contents of the first window restored.

A further feature of these systems is that windowsizes and positions can be controlled by the user,usually again by means of a mouse. If a window ismade smaller, all the original contents is stored, andif the window is subsequently restored to its originalsize, all the original contents will be redrawn, bothtext and graphics.

These advanced windowing systems are normallyprovided as part of operating system front ends. Inaddition to the windowing, simplified file -handlingfacilities are normally provided, together withadvanced graphics facilities such as text fonts in avariety of styles and sizes, line styles for drawing(solid in various widths, dotted, dashed), and patternsfor area fills. The first such system to gain popularitywas the operating system for the Apple Macintosh,and this has been followed by DR GEM andMicrosoft WINDOWS, among others.

Co -Ordinate SystemsIn any graphics system, some means is needed tospecify where on the screen drawing is to be done.Positions on the screen are specified by systems ofco-ordinates. On a graphics screen, drawing is done atthe position of the cursor. Unlike the cursors on textscreens, which are normally visible, graphics cursorsare normally purely notional and not displayed,though some of the recent windowing systems dodisplay a crosshair cursor unless instructed otherwise.In drawing a line or moving to a new position on thescreen, the co-ordinates specify how far the cursor is

to move, either relative to its current position orrelative to a graphics origin, the point which hasco-ordinates of 0, 0.

When the new position of the cursor is specified interms of how far it is to move from its currentposition. this is termed relative co-ordinates. Thissystem is generally more difficult to work with thanthe alternative system of specifying the positionrelative to a graphics origin. It is found mostly onlower-pnced computers like the Sinclair Spectrum.When drawing on the screen, it is usually necessaryto use two variables to keep track of the absoluteposition of the cursor on the screen, as computerswith relative co-ordinate systems also tend to be theones which generate an error if you try to draw to aposition off the screen.

When new positions for the graphics cursor arespecified relative to a graphics origin, this is termedabsolute co-ordinates. This system is generally quiteeasy to use. The position of the graphics origin isnormally the extreme bottom left-hand corner of thescreen, in contradistinction to the usual text co-ordinate system which has its origin in the top left-hand corner. Some computers allow the user tospecify the position of the graphics origin on thescreen. If the origin is in the conventional position,only positive co-ordinates are required. If it is movedanywhere else, both positive and negative co-ordinatesare needed in order to be able to specify any pointon the screen. For some purposes, it is convenientto move the graphics origin to the centre of thescreen.

Whether relative or absolute co-ordinates are

being used, it is conventional to give the horizontalco-ordinate first, followed by the vertical co-ordinate.These are conventionally termed the X direction oraxis (X is a cross) and the Y direction or axis (Y's up).

A further system which should be mentioned isthe system of turtle graphics which has its origin inthe LOGO computer language. This is not really aco-ordinate system, but is one in which the cursor,which is called a 'turtle', is moved around the screenby commands which indicate how far it should move,forward or backward, arid angles through which itshould turn, right or left, normally specified indegrees. This type of graphics is now included insome other languages, in particular in some recentversions of BASIC. (In fact, some versions of LOGOalso allow the turtle to be placed using a system ofabsolute co-ordinates.) This type of graphics wasdesigned as a learning aid, and apart from this is

limited in application.It may seem obvious to match the co-ordinate

system to the resolution of the screen image, so thata change of 1 unit equtes to a movement of 1 pixel,and simple computers with one screen mode frequ-ently do use a system of this sort. Where there areseveral screen modes with different resolutions,however, if graphics originally written for one modewere displayed in another mode, the size would alter,

75

Page 86: Computer Hobbyists Handbook - World Radio History

and in many cases the shape too, as changes inscreen resolution with mode in many cases onlyaffect resolution in one direction. In such cases, theco-ordinate system used may have more points thancan be resolved by the display in any mode, and thenumber of points per pixel will change with mode,but the size and shape of the graphics will remainconstant.

This also allows another problem to be solved,the fact that pixels are frequently not square. If aco-ordinate system based on pixels is used, and thepixels on the screen are in fact wider than they arehigh, if you drew a circle using the usual formulae,it would appear as an ellipse. If the co-ordinatesystem is non -pixel based, it can be adjusted sothat equal changes in co-ordinates do equate toequal distances on the screen in both horizontaland vertical directions, and circles will then be circles.

A good example of this is the BBC microcom-puter. This has graphics modes with resolutions of640 x 256, 320 x 256 and 160 x 256. It uses aco-ordinate system with 1280 points by 1024, and

these do relate to equal distances on the screen. Inthe highest resolution mode the pixels are 2 unitswide by 4 high, in the middle mode they are 4 unitswide by 4 high - a rare case of truly square pixels- and in the lowest resolution they are 8 units wideby 4 high.

In some of the latest versions of BASIC for usewith windowing environments much smaller pointsare used for specifying positions. In BASIC 2 on theAmstrad PCs, which runs under GEM, a co-ordinatesystem with 5000 units along the shorter dimensionof a window, and as many as necessary along thelonger dimension to ensure equal increments, is used.These high values are used in part because theseenvironments are designed to allow output to besent to devices other than the screen with little orno re -writing. Some other devices, such as laserprinters and pen plotters, can have a resolution verymuch higher than a VDU screen. Using these very fineco-ordinates allows these devices to be used to theirfull potential.

76

Page 87: Computer Hobbyists Handbook - World Radio History

Chapter 7

LEXICON

Absolute AddressingIn assembly language and machine code program-ming, absolute addressing is the address mode inwhich the address of the data is given directly inthe instruction. It is sometimes also called directaddressing.

Acoustic CouplerThis is a form of modem, but it refers specifically toa type which is not connected directly to the tele-phone system. Instead it has a receptacle for atelephone handset. Signals from the computer(usually sent and received via an RS232C serial port)are converted into tones which are fed to the mouth-piece, while the tones from the earpiece are decodedand fed to the computer.

With all other factors being equal, this generallyworks a little less reliably than a modem that con-nects directly to the telephone lines. On the otherhand, it gives convenience, and can be used anywherewhere a telephone having a reasonably standardhandset is available. I suppose that strictly speakingthe acoustic coupler is only the part that actuallycouples the audio tones into the handset, and picksup the tones from the earpiece. However, this termseems to be applied to a complete modem which usesthis method of coupling.

ANDingSee "BITWISE".

Artificial IntelligenceA branch of programming which deals with programswhich "learn" or which can seem to "think" about aproblem and make an intelligent decision. The mostcommon applications of artificial intelligence are the"expert system" type of database. This is an area inwhich there is much controversy. On the one hand,some people think that it is wrong to consider amachine to have any kind of intelligence, and preferthe term "applied intelligence". On the other hand,some artificial intelligence lobbyists have suggestedthat computers running this type of software have aform of sentience and should be considered a newlife -form.

ARMThis is an acronym standing for Acorn Reducedinstruction set Machine, and it is the RISC typemicroprocessor used in the Acorn Archimedes seriesof computers. These machines stand as excellentjustification of the claims for speed made for RISCchips.

ArrayThe term "array" is mostly used in BASIC program-ming, but it is also used elsewhere. It refers to a formof variable by which tabular data may be easily storedand manipulated. An array consists of a number ofvariables of one type, which have a common nameand are distinguished from each other by numberscalled subscripts. These subscripts represent thepositions of the individual variables, called elements,in the table. Arrays can have one or more dimen-sions, with each element having a subscript for eachdimension. A single dimension array would haveonly one subscript, and would be analogous to asimple list. A two-dimensional array is analogous toa table with rows down the page and columns acrossit. Each element would have two subscripts, givingits row number and column number. A threedimensional array can be thought of as like a numberof pages of rows and columns, and a four dimensionalarray as a number of books, each with a number ofpages. Different versions of BASIC differ in thenumber of dimensions allowable and the number ofelements allowed in each dimension. The number ofelements allowed is often limited to 255, but may behigher on 16 -bit computers. The number of dimen-sions allowed may be limited to one or two, or to255, or limited only by the available memory. In

most versions of BASIC, the subscripts are given inbrackets after the variable name used to identify thearray, the individual subscripts being separated bycommas. Generally, both string and numeric arraysare possible, but all elements must be of one type.In some BASICS, elements of string arrays must beof fixed length, and in other (primitive) versions,string arrays are not supported.

ASCIIThese letters stand for "American Standard Code forInformation Interchange". Computers do not storeand manipulate text as such, but deal with all inform-ation in the form of binary numbers. Text is handledusing a simple code whereby each text character(including such things as line feeds and carriagereturns) is assigned an individual code number. Forexample, the ASCII code for "U" is 01010101 inbinary, which is equivalent to 85 in the ordinarydecimal numbering system. If you should ever needto deal with ASCII codes, it will almost certainly bewith them in their decimal form rather than as rawbinary numbers. The ASCII codes are now almostuniversally accepted as the standard set of text codenumbers, but information in ASCII form is notnecessarily fully compatible between one system andanother. Many word processors and other text hand-ling programs use additional codes when formatting

77

Page 88: Computer Hobbyists Handbook - World Radio History

the text instead of using large numbers of line feeds,carriage returns, and spaces. This gives more com-pact text files, but it does mean that the controlcodes of one program may not be understood byanother program. This may simply result in oddlyformatted text (with perhaps a few odd lookingcharacters mixed in with the text), or in an extremecase it could cause the program to hang up. Sometext processing programs have a facility for storingand retrieving text in pure ASCII form. Some alsohave conversion facilities so that they can producefiles that are compatible with popular textprocessing programs.

AssemblerMany programs are written in a high level computerlanguage (such as BASIC) which makes the job ofprogramming very much easier. The alternative isto program in machine language (also known asmachine code). This means directly programmingthe microprocessor at the heart of the computer withits instruction code numbers. Machine code is notreally practical for anything other than very shortroutines, and it is usual for assembly language tobe used. This is essentially the same as machinecode, but a program called an "assembler" is usedto convert easily remembered mnemonics into thecorresponding machine code numbers. In fact mostassemblers provide a bit more help than this, butassembly language programming is something that isrestricted to those who are prepared to learn aboutcomputers in some detail. The advertising for someprograms boast that they are largely written inassembly language, and the advantages of assemblylanguage are more for the user than the programmer.There is really only one advantage, and this is speed.The computer is simply executing the program.without having to do any interpreting from a highlevel computer language into machine code instruc-tions as it goes along. Assembly language programsare therefore very fast - as fast as the computer canrun in fact.

Auto -DialThis is a feature of many modems. As this termimplies, the modem automatically dials the requirednumber. In fact these days it is more usually thecomputer that controls things, and the store ofnumbers are held in the computer. In this case, boththe software and the modem must support auto-

dialling if it is to function properly.

AxisThis is the term used in computer graphics to referto the direction in which specified co-ordinates apply.The X-axis runs horizontally across the screen, andthe Y-axis runs vertically down it. Note that the axishas direction, but not position. The axis is not a linerunning half -way up or half -way across the screen.Conventionally, in giving the co-ordinates of a point,

the X-axis co-ordinate is given first, followed by theY -co-ordinate. In three-dimensional graphics. thethird axis, the direction perpendicular to the screensurface, is called the Z-axis. Of course, it is not reallypossible to draw in 3-D on a flat screen, but forms ofperspective drawing can be programmed.

Background (Printing)Some programs have the ability to send data to theprinter and at the same time get on with other jobs.With a word -processor, for example, you may be ableto print one document while writing or editinganother. This is called background printing. Youmay be able to specify a list of files to be printed, oneafter another, while getting on with other things.Some operating systems may allow a general facilityto do this with all programs, and it may be possibleto print graphics files as well as text. This can be agreat time-saver, but it may be found that programexecution may be slowed while printing is in progress,or that printing slows or temporarily stops when aprogram is active (i.e. not waiting for you to press akey). This is especially true with graphics output.(See also SPOOLER)

Background (Program)A background program is one which is resident inmemory and is running all the time, but generallydoes not produce any output, so that the user is notaware of it, but can be called upon when necessary.The most obvious example is a real-time clock. Thereare also background alarm programs which can be setto alert the user at some given time, provided, ofcourse, that the computer is in use at that time. (Seealso RESIDENT, MULTI -TASKING)

Back -UpAs a noun, this is a copy of software or data which iskept as insurance in case something happens to theoriginal. Data and programs are normally backed -upon floppy discs, but for hard disc users there aretape streamers which will back-up the entire discmuch more rapidly and with far less effort on thepart of the operator. As a verb, this term means theactual act of making back-up discs (or whatever). Aless than interesting task, but one that should be donefastidiously. It is easy to overlook just how muchdata a floppy disc can hold until one becomesdamaged. Losing the entire contents of a hard discwith no back-up data available does not bear thinkingabout.

BASICA popular programming language for beginners.BASIC stands for "beginners all-purpose symbolicinstruction code". This is the most generally accep-ted explanation of the name, but is not universallyaccepted. Although it has received a fair amount ofcriticism over recent years, good BASIC languagesare relatively easy to learn and are very versatile. A

78

Page 89: Computer Hobbyists Handbook - World Radio History

lot of the criticisms aimed at BASIC are really onlyvalid when applied to early implementations of thelanguage which are now mostly obsolete. BASICprograms tend to be quite slow in operation, althougha modern interpreted BASIC running on one oftoday's more powerful microcomputers can run fastenough for many requirements. BASIC compilersare available for many computers these days, andthese provide a very respectable operating speed.Maybe it is not the ideal computing language forprofessional programmers, but its success with homecomputer users speaks for itself.

Baud RateThis is a term that applies to serial communicationsports, such as the RS232C and similar RS423 serialports that are fitted to many computers. It is a

measure of the speed at which data is sent from aport, and it is merely the number of bits sent persecond (assuming a continuous data stream). Manymodems, for example, work with a baud rate of1200, or 1200 bits per second. Note that seven oreight bits are required for a complete byte of data(e.g. an ASCII character), and timing bits accom-pany each byte. Thus about ten bits are requiredper character, and 1200 baud only represents about120 characters per second, not 1200. RS232C serialports are asynchronous types. To the user thepractical importance of this is that the system relieson the baud rate at which data is being transmittedaccurately matching that to which the receivingequipment is set. For this system to be workable itis essential to have standardised baud rates, and thereis a wide range of these running from 50 to 19200baud. Although it might seem better to have justone standard baud rate, serial links are used with awide variety of equipment types. A standard ratethat might be painfully slow for one piece of equip-ment could be impractically high for another. Thestandard baud rates are 50, 75, 110, 150, 300, 600,1200, 1800, 2400, 4800, 9600, and 19200 baud.Most of these are available from the majority ofcomputer serial ports, but one or two are usuallyunobtainable (the highest and slowest rates are oftenabsent). Peripherals such as printers and plotterswhich have a serial interface often only provide avery limited range of baud rates. It is then a matterof setting up the computer to suit the peripheraldevice.

BinaryComputers handle data in what is really a rathercrude form, with electronics circuits that provide alow output voltage (about 0.8 volts or less) torepresent 0, or a higher voltage (about 3 to 5 volts)to represent 1. This is very convenient from thepoint of view of designing the electronics, but thenormal decimal system can not be accommodated bya system which only allows each digit to be 0 or 1.Instead the binary system of numbering has to be

used. Whereas the columns of figures in the decimalsystem represent the number of units, tens, hundreds,thousands, etc., in the binary system they representthe number of units, twos, fours, eights, sixteens, andso on. This enables any desired number to be repre-sented, but it requires a large number of digits whencompared to the decimal system. This is the onlypractical way of handling things with the presenttechnology though. Each binary digit is usually givenits abbreviated name of a "bit". Data is often mani-pulated in the form of 8 bit numbers, or "bytes" asthese are generally termed. With 8 bits, numbers inthe range 0 to 255 can be catered for, and with 16bits, numbers from 0 to 65535 can be accommodated.In fact numbers of any magnitude can be handled byan 8 or 16 bits computer, but only by using severalbytes to represent large numbers, and processing thedata one byte (or 16 bit "word") at a time. Unlessyou get involved in programming this is all ofacademic importance, and is not something that isnormally encountered when running applicationssoftware. The hardware converts data input indecimal form into binary, and converts any binarynumbers into decimal before they are output. Thefact that the computer is operating using binary datais therefore not apparent to the user.

BitA contraction of Binary digiT. See BINARY above.

BitwiseThis is where two binary numbers are compared on abit by bit basis, and the answer depends on the logicstates of each pair of bits. With bitwise ANDing, a 1is placed in the answer only if both bits are at logic 1.Bitwise ORing is similar, but a 1 is placed in theanswer if either or both bits that are compared areat logic 1. XORing is almost the same as ORing, buta 1 is placed in the answer only if a 1 is present inone or other of the ORed numbers. Unlike bit -wise ORing, with XORing a 0 is placed in the answerif both the compared bits are at logic 1. BitwiseANDing is used where only one bit (or perhaps a fewbits) of a byte must be read. All three types of bit -wise manipulation can be used in graphics programsto obtain various effects.

BlitterThe term "blitter" derives from "bit image manipula-tor". It is a hardware device which is used for movingblocks of memory around rapidly, without requiringaction from the computer CPU. Blitters can alsoprovide bitwise ANDing, ORing etc. on areas ofmemory. It is mostly used for rapid movement ofparts of the VDU screen image, giving effects similarto, but more sophisticated than, sprite animation. Itis therefore mainly regarded as a graphics device, butcould also be used for other things.

79

Page 90: Computer Hobbyists Handbook - World Radio History

BootThis is a slightly vague term, but one which is

generally accepted as being the process by which anoperating system seems to load itself from disc andinto the computer at switch -on. This is likened tosomeone lifting themselves up by their bootstraps,and is sometimes given the alternative name of"bootstrapping". Of course, the disc operatingsystem does not really load itself at switch -on, andthere is a very basic operating system in the computerwhich loads the disc system. The disc operatingsystem then takes over control from the built-instart-up routine.

BrushBrush in a computer context is a paint program term.Although mainly associated with the Amiga com-puter, it now seems to be gaining a wider acceptance.As the name suggests, it is the notional object withwhich the drawing is painted. However, some paintprograms enable quite complex "brushes" to beused. Not only can quite complex shapes be used,multiple colours can be used within the shape. Insome cases you can select an area of a drawing andthen use that as a brush.

BufferThis is another term which is a little imprecise in itsmeaning, but it is most often used to refer to a blockof memory. This memory does not have to be in thecomputer, and many printers incorporate a buffer.With these the idea is that the computer can rapidlyload a document into the printer's buffer, and theprinter can then print it out while the computer isthen free to get on with other tasks. There are alsobuffers within computers, such as the keyboardbuffer. Characters typed into the keyboard are oftenstored in a buffer and read from this, rather thanbeing read direct from the keyboard and acted uponimmediately. This reduces the risk of charactersbeing missed when demands on the computer arehigh. Even so, if you type data into the computerat the wrong time it may well be overlooked andnot acted upon.

BugA general term for a fault in a computer system, butone which is generally applied to problems withsoftware.

Bulletin BoardThis is a system that can be accessed by anyone whohas a suitable computer and modem simply bydialing up the appropriate number. There are a fairnumber of these at present, mostly run by computerenthusiasts. A few are run by companies or tech-nology departments of schools, colleges, and univer-sities. The facilities offered vary enormously fromone to another. The "bulletin board" name isderived from the basic facility of being able to leave

messages which can be read by anyone who accessesthe system. If you are having difficulty with yourcomputer system for example, you could leavedetails of the problem with a request (plea?) for helpfrom anyone who has experienced the same problemand found a solution. Some services offer free soft-ware which can be down -loaded into your computer.The type of service that is most likely to be of realbenefit to you is one which specialises in softwareand general information for your particular type ofcomputer, or one which serves some other specialistinterest of yours.

ByteEight binary digits (bits). See BINARY.

CA compiled programming language. Most imple-mentations of C are very fast, and a lot of commercialsoftware is written in this language. It is not really abeginner's language, but most people who have someprogramming experience with BASIC and assemblerfind it reasonably easy to master. It is a very versatilelanguage, but is considered to be rather too low levelby some programmers. It is very "portable".

CADEither "computer aided drawing", "computer aideddrafting", or "computer aided design". The first twoare really the same, and mean a sort of computerequivalent of an ordinary drawing board, paper, andpen. A CAD system is more versatile than conven-tional methods of drawing in that it is much easier tomake changes to a drawing. It is really the drawingequivalent of a word processor. CAD seems to havebecome very popular in recent times, and modemCAD programs and output devices can provide somevery good results. Even low cost systems are quitecapable these days. The drawings in this book wereproduced using a CAD system incidentally.

Computer aided design generally means mathe-matically modelling something to check that it worksbefore it is made. Making and testing some types ofequipment is so expensive that this is the only prac-tical way of doing things. As yet it is only somethingthat is used in a few specialist areas of interest, andmany CAD systems of this type are custom builtone -offs!

Camera DeviceA camera device is a peripheral device which is usual-ly connected to the monitor output of a computer,and is used to produce photographic slides or printsof screen output onto (usually) 35mm photographicfilm. The camera device contains its own picturetube and lens system. The film transport may alsobe built-in or it may be in the form of a conventionalcamera body (usually of single lens reflex type)which attaches to the device. The main benefit ofusing a camera device is the avoidance of the distortion

80

Page 91: Computer Hobbyists Handbook - World Radio History

which normally occurs if a monitor screen is simplyphotographed with a camera, and also the bandingwhich can result from a mismatch between theshutter speed used and the scan rate of the monitor.The definition will be the same as the screen defini-tion. Camera devices can be very expensive, and areonly worthwhile where large numbers of screenpictures are required on a regular basis.

CentronicsThis is a form of interface, and it is sometimes calleda "parallel" interface. The Centronics name is thatof a printer manufacturer who pioneered this typeof interface, but it is now the accepted standard forprinters, as well as plotters and a few other devices.However, some printers and other equipment use anRS232C serial port instead. My printers and plottershave both types of port built-in as standard, andthere seems to be a definite trend towards this dualstandard.

A parallel port differs from a serial type in that ituses eight connecting wires to transfer data from thecomputer to the printer. It therefore transfers data abyte at a time, whereas a serial type sends data(literally) bit -by -bit. A parallel interface is generallymuch faster than even the highest speed serial type,but in many cases the slowness of the peripheralwhich receives the data will make this irrelevant.Long connecting cables are permissible with seriallinks, but with parallel types proper operating is onlyguaranteed over cables of 2 metres or less in length.Note that a parallel port is only an output type, and,unlike a serial type, it is not to be used to feed datainto the computer. You may occasionally comeacross references to bidirectional parallel ports, butthis is a bit misleading. Ports of this type can be setto operate as an input type for specialist applications,but they can not be used simultaneously as an inputport and an output type.

CGAThis stands for "colour graphics adaptor", and it is atype of screen display adaptor for IBM PCs andcompatibles. It provides 640 x 200 pixel resolutionin monochrome, and 320 x 200 pixel resolution infour colours (which includes the background colour).

CISCThis is an acronym for Comprehensive (or Completeor Complicated) Instruction Set Chip. This describesthe currently most popular type of microprocessor,which has a large number of instructions, as distinctfrom the reduced instruction set chips (RISC).

CLICLI is an acronym for "command line interpreter".This normally refers to an operating system wherethe commands are typed in at the keyboard (as withMS-DOS and CP/M) rather than using a WIMPenvironment (like GEM for example).

ClockAll computers have a simple electronic circuit whichgenerates electrical pulses at a regular rate, and this isthe "clock". The clock frequency is usually control-led by a quartz crystal (as used in watches, etc.). Theclock controls the rate at which the computer func-tions. The faster the clock, the faster the computerruns. You can not speed up a computer simply byraising its clock frequency, as the microprocessor,memory circuits, etc. have a strict limit on theirmaximum operating speed. Most computers are runat a clock speed very close to the maximum at whichthe various pieces of hardware are guaranteed to stilloperate reliably. More than marginally raising theclock speed is almost certain to cause a malfunction.The clock rate is normally specified in megahertz(MHz), and 1MHz is one million pulses per second.Note that the number of instructions the micro-processor performs per second is not normally equalto the number of clock cycles per second. Complexinstructions on some microprocessors take more thantwenty clock cycles to complete.

CommsThis is an abbreviation of "communications". Acomms program is one which simplifies the use of amodem by setting up the necessary baud rates andprotocols, and which will also have other facilitiessuch as auto -dial and auto -answer.

CompatibleThere is a popular computer joke about the diction-ary definition of "compatible", which should besomething like "unique and totally unlike anythingelse on the market". This is perhaps a gross exaggera-tion, but is not totally untrue. Manufacturers cannot produce an exact copy of an existing product, oreven a very close copy, for obvious legal reasons. It isquite alright to produce a product that will emulateanother one, provided it works in a slightly differentway to the original. However, by working in a differ-ent manner it is virtually inevitable that any emulationproduct is going to be less than fully compatible.Compatible is a term that is mainly applied to theso-called "clones" of the IBM PC range of computers.Most modern "clones" are very compatible, and thereare few programs (if any) that will not run properlyon the average "clone". However, if you use an IBMcompatible computer it is always a good idea tocheck that a program will run on it properly beforeactually buying it.

CompilerProgramming languages such as normal versions ofBASIC are interpreted languages. In other words,when the program is run the computer takes eachBASIC instruction, converts it into a machine coderoutine that the microprocessor can run, and thenruns that routine. This system of interpreting eachline as the program progresses can be very slow, with

81

Page 92: Computer Hobbyists Handbook - World Radio History

the interpreting taking longer than it takes themachine code routines to run. In fact it can oftentake a hundred or even a thousand times longer foreach instruction to be interpreted than it does for theresultant machine code routine to execute. It is thisfactor that makes interpreted languages relativelyslow in operation. A compiler does things in adifferent way. A completed program is first compiledinto a machine code program, or a sort of pseudomachine code that needs minimal interpretation, andthen it is run. This gives very much faster operation.There are drawbacks to compiled languages, one ofwhich is that they still tend to be relatively expensiveto buy. The main drawback is simply that theygenerally give the programmer less help than inter-preted languages. This makes program writing moredifficult, especially for beginners.

Composite VideoThis is a standard for sending the VDU output from acomputer to the monitor. It allows all the necessarysignals for intensity and (where appropriate) colourto be sent using a single wire (with earth return).Many computers have a composite video output, butcurrently it is losing ground to analogue RGB andRGBI type outputs, which allow a slightly betterpicture quality, in theory at least.

Co -OrdinatesIn drawing graphics on a computer system, somesystem of specifying where lines and points are to beplaced is necessary. In order to do this, the screen orother drawing surface is treated rather like a sheet ofgraph paper, with a grid of horizontal and verticallines, though the lines are never visible. Points canthen be specified by giving their displacement interms of horizontal and vertical offsets on theimaginary grid. These offsets are the co-ordinates ofthe point, and are usually given relative to thegraphics origin, which is the point with co-ordinates0, 0. Usually the graphics origin is the bottom left-hand corner of the drawing surface, but in some casesit may be placed in the centre of the screen (this isusual with graphics in the LOGO language). Somesystems allow the graphics origin to be placed any-where on the drawing surface the user requires. Whenthe graphics origin is in the bottom left-hand corner,only positive co-ordinates are required. In all othercases, co-ordinates can be either positive or negative.

When drawing on the screen, a co-ordinate systemwhere the units correspond to the actual screen issometimes used. This is termed pixel co-ordinates.However, it is now common to use a system wherethe increments of the co-ordinate system are muchsmaller than the screen pixels. This makes it possibleto transfer graphics from the screen to a device (suchas a plotter) with a higher resolution, and make fulluse of this extra potential.

Context SwitchingContext switching is similar to multi -tasking in thatit is a system which allows two or more applicationprograms to be in memory simultaneously. Unlikemulti -tasking, however, only one program at a time isactually running, the others being held in a state ofsuspension. It is possible, however, to quickly switchfrom one program to another, usually without havingto save the work you have done to disc (this may bedone automatically). Context switching avoids muchof the complication of multi -tasking, but allows acomputer user to move much more readily from onejob to another than is the case if programs have to beloaded and run from disc. It is a system whichdeserves to be used much more widely than it is.Perhaps the best-known context switching system isthe in-built software in the Cambridge ComputersZ88 portable computer.

Co -ProcessorSome computers (notably the BBC model B series)have the ability to take add-on boards which have adifferent microprocessor to the one fitted in thecomputer. With this board (or external co -processorunit) activated, its microprocessor effectively takesover from the one in the computer. The idea of aco -processor is to increase the processing power ofthe computer, or to provide compatibility with anoperating system which requires a microprocessorother than the one fitted in the computer. Forexample, the BBC model B series of computers arefitted with a 6502 microprocessor, but with the Z80co -processor fitted they can run the CP/M operatingsystem. Do not confuse a co -processor with a mathsco -processor, which is a very different concept (seeMATHS CO -PROCESSOR).

CP/MThis is a disc operating system for 8 bit personalcomputers. Although it is regarded by many asobsolete, there are a large number of computers run-ning under this system in use today. CP/M has hadsomething of a renaissance due to the popularity ofthe Amstrad 8 bit computers which can run underthis operating system. There is a vast range of soft-ware available for use on CP/M machines, and it ispossible to obtain CP/M emulators for MS-DOScomputers and some other computers (the Atari STrange for example). The idea of these emulationprograms is not usually to provide a means of settingup a 16 bit system to run exclusively under CP/M.It is more a matter of providing existing CP/M userswith a means of running their existing programs onmore modern hardware while making the transitionto using more modern equipment. Emulation pro-grams in general run rather slowly, and a powerful 16bit computer running a CP/M emulation programmight operate more slowly than an 8 bit machinedesigned for CP/M use! Running CP/M on a 16 bit isnot necessarily a means of obtaining a "turbo" per-formance CP/M system.

82

Page 93: Computer Hobbyists Handbook - World Radio History

CPSThis stands for "characters per second", and is a

measure of how fast a printer can produce text. Somemanufacturers are reasonably honest about the speedof their printers, but many quote speeds obtainedunder the most favourable possible settings andconditions, and seem to have longer seconds thanthe rest of us!

CPUThis stands for "central processing unit", and it isperhaps better known these days as a microprocessor.This is the component at the heart of a micro-computer, which controls everything, does all thecalculating, etc. Actually most computers havespecial components which handle functions such asgraphics and sound with a minimum of informationbeing supplied by the microprocessor. This reducesthe workload on the microprocessor and generallyresults in programs running faster. The fact thattwo different computers are based on the same CPUdoes not, therefore, mean that they are equal interms of computing power.

CursorWith most programs where you input data onto thescreen there is an on -screen character which indicateswhere the next piece of data will appear. In thecase of the word processor I am using to produce this,for example, it is a short line on the screen whichflashes on and off a couple of times per second. Thison -screen character is the cursor. There is an alterna-tive but little used meaning, and this is for a device(such as a mouse) which is used to control theposition of the cursor.

Daisy -WheelThis is a term used to describe a type of printer. Ithas a sort of wheel with numerous spokes, and thetype -faces are at the ends of these spokes. In opera-tion the wheel spins so that the required character isat the top, and a hammer mechanism then presses itagainst the ribbon and paper. This type of printercan produce superb results, especially if it is usedwith a carbon ribbon. There are drawbacks todaisy -wheel printers though, which are mostlyquite noisy, slow (only about 10 to 20 cps in mostcases), and are not really suitable for graphics use.They have waned in popularity somewhat in recentyears, probably due to the improvements in thevarious types of dot-matrix printer.

DataData simply means any stored information. Almostany type of computer generated file can be termed adata file, with the exception of stored programs.The term is most commonly used to describe filesgenerated by database and spreadsheet programs, butis by no means exclusive to these. In the BASIClanguage. DATA is a keyword which indicates to the

interpreter that what follows on the program line isconstant data for use by the program when running.

DatabaseI suppose that any store of information could betermed a database. It is generally taken to mean alarge store of information stored in an electronic(computer controlled) system that enables anydesired piece of data to be easily located andretrieved. There are many programs available thatwill enable a computer to operate as a database. It isalso possible to access enormous databases using acomputer plus a modem, but these systems aregenerally for professional users, and can be quiteexpensive. On the other hand, they provide almostinstant access to vast amounts of information, andcan be very worthwhile if a system (or systems)having the right kind of information can be found.

DefaultIn a colour display, a computer will display a stand-ard set of colours, but it may be possible to changethese to others when required. The standard coloursare an example of defaults, the action a computertakes unless it is told to do something else. This termhas many applications, co"ering areas such as screenmodes, baud rates for communications, which printerport to use, and what character to use for the cursor.On some machines the defaults can be changed to theuser's preferred settings either by storing the changesin a special area of memory which is not lost whenthe machine is switched off (battery backed or non-volatile RAM) or by automatically running a batchfile on switch -on.

The term can also be applied to peripheral devicessuch as printers. Printers will default to a particularprint size, style and character set at switch -on, andthese defaults can be altered by software commandsor by controls on the printer. Often the default onprinters can be changed by control switches, or onmore recent ones by EEPROM.

DigitiserA digitiser is a sort of electronic drawing board whichconnects to the computer It is used to control thecursor, very much like using a mouse. However, thecursor is controlled using a sort of electronic pen,and placing this on the drawing board sets the cursorto the equivalent point on the screen. Digitisers aremainly used with computer aided drawing (CAD) andpaint programs. They can be used to trace over exist-ing drawings and load them into the computer. Manyprograms that operate with a digitiser have a menuoverlay that is placed on the drawing board, and thepen is then used for menu selection to control theprogram. In some cases the alphabet is included onthe overlay, and even text is entered from thedigitiser instead of from the keyboard!

An image digitiser or video digitiser is an electronicdevice which takes a signal from a video camera, video

83

Page 94: Computer Hobbyists Handbook - World Radio History

recorder, or broadcast TV signal and converts it to adigital form which can be displayed on a computerscreen, and also modified by a drawing program.Such devices can be very expensive, but simpler andmoderately priced systems intended for the homeuser are available.

DirectoryThis is a list of files and sub -directories on a disc.From MS-DOS a directory can be displayed on thescreen simply by typing the DIRectory command(e.g. "DIR A: RETURN" to list the files and sub -directories on the disc in drive A:). Some otheroperating systems use CAT (catalogue) instead.Apart from telling what is on a disc, this commandwill also tell you how much unused space is availableon the disc.

Disc (Disk)This is the all-important device used for storingprograms and data. There are a range of disc sizesfrom 2.8 inches to 8 inches. The 8 inch discs are nowobsolete, although there is still a great deal of equip-ment fitted with this size of disc still in use. The 5.25inch discs are probably the most common type,although the 3.5 inch type have now become thestandard, and in the fullness of time should becomethe only type of disc in use. The 3 inch discs arenot used on many computers, but they are still quitecommon due to their use on the very popularAmstrad 8 bit machines. The 2.8 inch discs weredesigned for use with electronic musical instrumentssuch as sound samplers, and do not seem to havebeen used in other applications.

The discs are coated with a magnetic material,and data is recorded onto them in a fashion that isessentially the same as conventional tape recording.The advantage of a disc over a tape system is that it iseasy for the disc drive to jump to any part of thedisc almost instantly (so called "random access"). Atape system has to wind backwards or forwardsthrough a tape until it comes to the required section,which can be very slow indeed. A disc is formattedinto a number of tracks, and each track is dividedinto sectors. The 360k IBM standard discs have 40tracks on each side of the disc, and 9 sectors pertrack. This gives 360 sectors on each side of the disc,720 sectors in total, and with each one providing0.5k of storage this gives a capacity of 360k.

You will sometimes find references to 500k and1M discs, which in fact only seem to have capacitiesof 360k and 720k respectively. The discrepancyarises due to the amount of disc space taken up bythe formatting process. Discs are normally suppliedin unformatted form, and you have to format themprior to use. The formatting process lays down thebasic framework of the tracks and sectors, and alsoprovides the basic framework for the directory. Thisis part of the disc which stores information about

what is on the disc, and just where it is on the disc.When you access a file on a disc, the operatingsystem uses this information to find out where therequired file is stored, and it can then quickly jumpto the appropriate sectors of the disc. An arrange-ment of this type is essential if the potential speed ofa disc system is to be fully realised.

There are a variety of disc formats in commonuse, as some discs have 40 tracks per side while othershave 80. Some discs are single -sided while others useboth sides of the disc. There are also single anddouble density drives (actually it is the disc inter-face rather than the drive which squeezes twice asmuch data onto each sector of the disc). You cansometimes read a disc using a drive and interface ofthe wrong type, but this is not usually possible. Youmay also be able to get away with using a blank discof the wrong type provided it is formatted correctlyfor your disc drive. Single -sided discs always seem tohave the magnetic coating on both sides - they arenot guaranteed to be usable on the second side. Youmay get away with using single -sided discs in a

double -sided drive, but the small saving in costwould hardly seem to justify the increased risk oflost data. There is no risk in using a disc which isover -specified, such as using an 80 track type in a40 track drive. This should actually give marginallyimproved reliability, but the discs will cost more ofcourse.

There are high density ("HD") discs in both the5.25 and 3.5 inch sizes. These are 80 track types,but they are used in drives which cram a large amountof data onto each track. The 5.25 inch high densitydiscs have a capacity of about 1.6 megabytes, leavinga formatted capacity of about 1.2 megabytes. Ordin-ary 40 and 80 track discs will not give good reliabilityif used with a high density disc drive. Only use theproper high density discs of good quality with thesedrives.

A hard disc is basically the same as ordinary 5.25inch floppy types, and is used to magnetically storeand retrieve data. The disc is built into the discdrive, and is not removable and interchangeable likefloppy discs. For this reason the alternative term of"fixed disc" is sometimes used. This type of disc anddrive is highly refined, and can usually save and loaddata at least ten times faster than a good floppy disc.Unlike a floppy disc, the disc rotates all the time thecomputer is switched on. This avoids any waitingwhile the discs gets up to the correct rotation speed.This is important as the disc (which in practice isactually several discs stacked one above the other) isrelatively heavy, and rotates at a relatively high speed.It consequently takes it much longer than a floppydisc to get up to full speed. The recording and play-back heads are aerodynamic so that they fly over thedisc and never come into contact with it. Due to thehigh disc speed the consequences of a head cominginto contact with the disc would apparently becatastrophic.

84

Page 95: Computer Hobbyists Handbook - World Radio History

The storage capacity of a hard disc is many timeshigher than that of a floppy disc at around 10 to100 megabytes or even more (which compares withabout 0.36 megabytes for an average floppy disc).Thus, the fact that the disc is not interchangeable isnot a great disadvantage. They may be called harddiscs, but they are certainly not hardy discs. Theymust be treated with due respect if they are to givemany years of trouble -free service. They are some-times more expensive than the computer they areused with, but they are often worth the expense asmuch of the best software available will only workreally well on a machine equipped with a hard disc.

Dot MatrixThis normally refers to a printer which has (mostcommonly) 9 pins in the print head. The printedcharacters are made up from patterns of dots, andwhen used in the high-speed "draft" mode thesedots are usually quite visible. Most dot matrixprinters also have a higher quality NLQ (near letterquality) mode where each line of characters is

printed twice, with the paper being moved up frac-tionally on the second run. This sort of merges thedots together, but does not necessarily disguise themcompletely. It substantially reduces the printingspeed. Dot matrix printers are the most populartype, and offer great versatility including goodgraphics capability. Reasonably priced 24 pin typeshave now been introduced, and these offer higherprint quality while still maintaining a fairly highprint speed. Where high quality is of prime impor-tance, daisy wheel printers (which work in a mannermore like a conventional typewriter) still representthe better choice. Note that ink -jet, laser, andl.e.d. printers all use the same dot method of pro-ducing characters. In fact this is essentially thesame process that is used to generate characters ona computer's display.

EditorThis is a program for producing and editing text files.It could be regarded as a word processor that hasbeen stripped of all its "frills". In fact some texteditors have quite comprehensive features these days,including word-wrap, search and replace, etc. Wherethey really differ from a word processor is that theyhave no pagination facilities and have no built-inmeans of outputting text to a printer. They areintended for such things as producing batch files, andfor producing program files for use with an assembleror compiler. Business computers are often suppliedwith a text editor which is part of the operatingsystem. However, these text editors are often quitecrude compared to the best text editors that areavailable. They are not noted for being particularlyeasy to use. For most purposes a word processor ismuch better. An editor can be useful when it isimportant to produce a pure ASCII file (such as acontrol file that will be used by a program). Many

word processors add their own brand of formattingcodes to the text, and these tend to crash applicationsprograms if you use such a word processor to pro-duce a control file. Some word processors have afacility to produce ASCII files which are free fromtheir formatting codes, but in my experience thesedo not always give the desired result when used toproduce control files for "fussy" programs.

EGAEGA stands for "enhanced graphics adaptor". Thisis a display adaptor for IBM PCs and compatibles, andit goes some way beyond the capabilities of the CGAboard. It provides resolutions of 640 x 200 pixels in16 colours, 640 x 350 in monochrome, and 640 x350 in 16 colours. The full range of colours is onlyavailable if the board is fitted with the full 256k ofRAM (most EGA boards these days have the full256k of memory as standard). To obtain the benefitsof the EGA display a high resolution monitor havinga higher scan rate than the ordinary CGA monitorsis required. Apart from its improved graphicscapability, the EGA display also provides a muchneater text display than the CGA display. The costof EGA boards and monitors has fallen considerablyin recent years, but is still substantially higher thanthat of CGA equipment.

EmulatorAn emulator is a program or a hardware device whichallows a computer to act as if it were a different typeof computer. The main purpose of this is to allowone machine to run software designed to run on adifferent machine, or under an alien operatingsystem. Emulators are rarely more than partiallysuccessful. Simple software emulators generally runmuch slower than the machines they emulate, andmore complex hardware emulators are often virtuallycomplete computers, only using the host machine'sdisplay (and perhaps memory). They can be nearlyas expensive as the computer they emulate. SeeCP/M.

Expert SystemThis is a relatively new and advanced form of soft-ware. It is an extension of CAD (computer aideddesign). With CAD a computer is used as a designaid, and it will help with the production of a design,and mathematically test the design to predict howwell (or otherwise) it will work. An expert systemuses so-called artificial intelligence to go on stepfurther. The basic idea is that you tell the systemwhat you want, and then it designs it for you.Systems of this type are not limited to designingthough, and are used in medicine and other fields ofinterest. The point of an expert system is that itenables practically anyone to undertake the type ofthing that would normally require someone withyears of training and experience behind them. As yetthere are relatively few expert systems that really liveup to their name.

85

Page 96: Computer Hobbyists Handbook - World Radio History

ExtensionSee FILE.

Feature1. An aspect of a computer's or program's specifica-tion found in the advertising but not in the instructionmanual.2. A documented bug.

FileIf, for instance, you write a letter using a wordprocessor, and then store the letter on disc, the storeddata is called a "disc file", or just a "file". If youlist the contents of a disc using the MS-DOS DIRinstruction, each file will be displayed as a separateentity, together with its file name. Prcgrams of anyform of data stored on disc are held in files.MS-DOS file names can have up to eight letters and(or) numbers, and a few other characters are per-mitted. The three character "extension" is alsopermitted, and this is separated from the main filename by a full stop. There are certain conven-tions that are used for program file extensions(".BAS" for a BASIC program for example), but fordata files the user can opt for any extension he orshe feels is appropriate. Often you can simply omitextensions if you prefer, but a few applicationsprograms insist on having an extension if they areto function properly, and some automatically addone for you!

FlagIn programming, it is sometimes necessary to leave asignal that something has happened so that this canbe checked by other parts of the program. This isdone by means of flags. At the machine code level,a flag is normally a single specified bit of a particularbyte in memory. This can be set or cleared asrequired, and checked as often as necessary. Inhigher -level programming (e.g. in BASIC), variablescan be used for this purpose.

Floppy DiscSee DISC.

Floppy TapeThis is a rather silly name for a system which uses acontinuous loop of tape in a cartridge as a datarecording medium. It is intermediate in both speedand cost between floppy discs and audio tapecassettes, has not achieved any great popularity, andshould now be considered obsolescent.

FormatBefore a disc can be used to store data it must beformatted. This means dividing the disc up intoconvenient sized blocks and putting down the basicframework of data that will enable the computer torapidly locate any particular block on the disc, andthe data it contains. Formatting is usually carried out

via the computer's operating system using the"FORMAT" instruction. With some home com-puters that were originally designed more for use withcassette tapes than with discs, a separate formattingprogram may be required. Take due care with for-matting commands, as they effVctively wipe any datafrom a disc that has been in use and is accidentallyreformatted. Hard disc users need to be especiallycareful.

The term format can also be used to describe theway in which the data is recorded on the medium.Programs may have their own format for data storagewhich will prevent data files generated by one pro-gram being loaded into another for which they areinappropriate. However, there are also some standardformats expressly designed to allow data to be trans-ferred from one program to another. For example, amodel generated on one spreadsheet could be used onanother different spreadsheet program, or used by agraphics program to generate graphs or diagrams.When choosing software, it is always worth checkingwhether new programs can work in conjunction withyour existing ones in this way, even if you think youwill never need this facility. If you have the ability toswop data between programs you will probably soonfmd a use for this facility!

FormulaA mathematical expression in a spreadsheet. SeeFUNCTION.

Frame GrabberAn electronic device which stores a picture from avideo camera or recorder, or broadcast TV, in a formsuitable for computer storage, display and modifica-tion. See also DIGITISER.

Front EndThis is the part of a program or operating systemwith which the operator interacts. WIMP environ-ments such as the Apple Macintosh operating systemand GEM are termed "friendly front ends".

FunctionA function is a mathematical operation expressed in acomputer language. Most computer languages includea number of in-built functions for basic mathematics,and in some languages these can be used together toperform more complex operations. These combina-tions are called user -defined functions. In compiledlanguages the functions are usually contained in a`library' which has to be added to the object codeduring compilation.

In spreadsheets, functions are called formulas.

Function KeysThese are extra keys provided on many computerkeyboards. These do not normally produce on -screencharacters, but are used by many applications pro-grams to call up certain functions (f10 might be usedto save data to disc for example).

86

Page 97: Computer Hobbyists Handbook - World Radio History

GEMThis is the trade name of the Digital Research opera-ting system front end/graphics system. It is anacronym deriving from Graphics EnvironmentManager. It is available for many machines, and issupplied as standard with the Atari ST series andthe Amstrad PC1512/1640.

GraphicsThis means anything which deals with drawings ofsome kind, instead of being purely text based. Mostgraphics programs include text, but the text char-acters are normally defined by the applicationsprograms and are not the normal (text screen) textcharacters. Some text programs are actually graphicstypes, and this is where various sizes and styles oftext are used. These can not be handled by a normaltext screen (or printer), and are produced using thegraphics capability of the system.

Hard DiscSee DISC.

Hard CopyThis simply refers to a printed copy of a textdocument, drawing or whatever.

Hard PageThis is a word processing term and refers to a pagebreak which is inserted by the user rather than beinginserted automatically by the program, the latterbeing a "soft page". Soft page breaks will be movedif you add text ahead of them. Hard pages are fixed.

Hard CR (Carriage Return)This is another word processing term, and refers to acarriage return which is inserted by the user ratherthan the program. Normally word processing pro-grams automatically take care of carriage returns,automatically beginning a new line where necessary.Hard returns generally only need to be inserted toend paragraphs or to insert extra line spaces in adocument.

HardwareAny piece of equipment in the system (computer,printer, etc.) is a piece of "hardware". Programs arethe "software". Software built into the computerand contained on components within the computeris sometimes called the "firmware".

High Level (Language)A high level computer language is one which makesconcessions to human ways of thinking and doing,and is therefore hopefully easy for humans to under-stand and write. It is especially applied to interpretedlanguages like BASIC and LOGO.

I/OI/O simply stands for "input/output". It is generally

used in connection with ports such as the RS232Cserial port, rather than data stored and retrieved ondisc, or something of this type.

IconA general term for a graphical representation of some-thing (usually a program or file), displayed on themonitor's screen. A mouse or other pointing deviceis used to select the desired icon, rather than typingin a program name, file name, or whatever. This isthe system used when running GEM desktop.

IndirectionIn machine code, an instruction may contain anaddress in memory. and this address in memory willin turn contain the address at which the data to beused by the instruction will be found. This process istermed indirection. In theory, an infinite numberof stages of indirection are possible, but in fact inmicroprocessors true indirection is hardly everimplemented, largely because it is very greedy ofstack space. Instead, register indirection is normallyused, where an address register in the microprocessoris specified in the instruction and is used to containthe address of the data. Tndirection is most common-ly used when accessing tables of data in memory. Theregister containing the address can be incremented ordecremented to step through the table.

Ink -JetThis is a type of printer which forms characters in thestandard dot-matrix format. However, instead ofhaving a 9 or 24 pin print -head and a ribbon, theywork by squirting minuscule droplets of ink from theprint -head. They can give very good quality, arevery fast, extremely quiet, and the modern types arevery reliable. The cost is substantially more thanthat of a good dot matrix printer, but they can beworthwhile for those who will make extensive useof their printer. This type of printer is incapable ofproducing carbon copies, and this will rule them outfor some applications.

InstructionA machine code program consists of a series ofinstructions. Each instruction consists of an opcodeand an operand or operand field. These terms areexplained below. However, in some cases an instruc-tion can consist of an opcode alone.

InterfaceThe original meaning of "interface" was a port, suchas a Centronics or RS232C type, that enabled twoitems of equipment to be interconnected. This isstill its primary meaning, but you may also encounterthis term in the context of a so-called "user inter-face". This is the means by which the user interactswith the computer, and GEM desktop is an exampleof a user interface.

87

Page 98: Computer Hobbyists Handbook - World Radio History

InterpreterA program which is the key part of a programminglanguage. When a program written in an interpretedlanguage is run, the interpreter scans the programline by line, determines what needs to be done, anddoes it. This process is necessarily slow (by com-puting standards) but programs in interpretedlanguages have the advantage that they are easilymodified and tested. See also COMPILER.

InterruptsThere are various hardware devices within andattached to computers which periodically need tograb a share of the microprocessor's attention.They do this by putting a signal on a special pinon the MPU chip. This signal causes the MPU tosuspend its current activity, to store all necessaryinformation so that it can resume where it left off(usually on the stack), and then to branch to aspecial section of code in memory which containsthe instructions to service the peripheral device.This process is termed an interrupt and the codeis called the interrupt routine. Most micro-computers run under continuous interrupts, butsince each interrupt only takes a small fraction ofa second to service, the user is not aware of this.

JustificationThis is a word processing term, and refers to theprocess whereby the margins are made even downthe length of the document. The left marginnormally is justified as the text lines start from theleft margin, but the right margin will be ragged as thelines will be of differing length. The right margincan also be justified, and the simplest way of doingthis is by inserting extra spaces between words. Thiscan be done on -screen and in the printed document.A better system is micro -space justification, whereextra space is placed between letters within words,as well as between words. This gives a neaterappearance to the document, but is not possible withall printers. It requires a high degree of co-ordinationbetween printer and program. Word processorsemploying microspacing justification do not usuallyjustify on -screen. For some purposes, justification isundesirable, so there is nearly always provision forturning it off.

Right -only justification is also provided in somecases. Here, the lines are not padded out, but areshifted right to justify them, leaving the left marginragged.

You may also come across centre justification. Inthis, lines are not padded at all. Each line is centredso that it has equal space either end, but both marginsare ragged. This is not a true form of justification.

Keyed FileThis is a system of organising database files, wherebyeach entry in the file also has entries in one or moreindex files. These work just like the index in a book.

When looking for a record in the file, the part of therecord you specify is looked up in the appropriateindex, and the record or records which match yourspecification are thus located. Keyed files allow veryrapid file location, but take up a lot of disc space asboth the data file and the indexes have to be stored.A very few versions of BASIC allow users to writetheir own keyed file programs.

Kilobyte (Kbyte or k)This simply means one thousand bytes, or if youwant to be pedantic, it actually means 1024 bytes.It is the most convenient unit for expressing the sizeof computer memory (RAM and ROM) and disccapacity.

LANLAN stands for "local area network". This meansconnecting computers together effectively for onelarge system which can share software, swop data,share peripherals such as printers, etc.

Laser PrinterA LASER printer is based on photocopier tech-nology, but a laser beam is used to generate a page ofprinting/graphics. This gives very high quality outputwith each page being produced very rapidly (typicallyabout eight pages per second). Very nice if you canafford one! Like ink -jet printers, carbon copies arenot possible, but the speed of laser printers makes theproduction of multiple copies a practical proposition.

LCDIn a computer context this generally applies to thescreen of a portable computer. LCD stands for"liquid crystal display", and it is the same technologythat is used in the displays of watches, calculators,etc. Early liquid crystal displays for computer usewere often small and low in quality. More recenttypes are generally larger, display more information,and are much clearer.

LEDThe main use of LEDs (light emitting diodes) is indisplays, but they are little used in computer applica-tions. In a computing context you are more likely toencounter the term as a description of a printer.LED printers are very similar to laser types, but use aLED light source instead of a laser.

LibraryIn computing the term library is used mostly in thecontext of programming. In compiling languages, thelibrary is a collection of complex machine coderoutines which perform the more involved mathe-matical operations and similar tasks. With the bettercompilers, only the parts of a library actually requir-ed by a program are added to it. In simpler com-pilers, the entire library is always added. This meansthat the programs written with such a compiler will

88

Page 99: Computer Hobbyists Handbook - World Radio History

always be larger than they need to be. Unfortunately,most compilers are of the latter type. Libraries canalso cause complications if programs in a compilinglanguage are being written for commercial sale. Thelibrary routines will be the copyright of the producerof the compiler, and a licence may be required to sellprograms containing them. With some languages,additional libraries can be obtained, extending thelanguage's capabilities in such areas as graphics.

In programming in languages such as BASIC, theterm library is usually used to mean a collection ofsubroutines or procedures of a general purpose naturewhich are kept on disc and which can be merged intoany program one is writing which needs them.

ListThis term is used in languages such as LISP andLOGO, which are list processing languages (LISP isin fact derived from LISt Processing). They are theprimary form of data storage in these languages. Alist is a collection of words, which in fact can be anycollection of one or more printable characters. It ispossible in these languages to add words to eitherend of a list, to remove words from either end of alist, and to transfer words from one list to another.There are also functions to determine whether aword is a member of a list, the position of a word ina list and so on. It is also possible to have a list oflists, a list of lists of lists, and so on (theoretically)ad infinitum. These facilities may seem limited, butin fact a great deal can be done with them, and theselanguages form the basis of artificial intelligenceresearch.

Low Level (Language)A low level language is one which makes few conces-sions to humans and keeps close to the requirementsof the machine. It is most often used to meanmachine code or assembly language.

MacThis is an affectionate abbreviation of the popularApple Macintosh computer, one of the originalWIMP machines, and certainly the one which madegraphical front ends a success.

Machine CodeSee ASSEMBLER.

MainframeA mainframe computer is a very powerful type,generally capable of carrying out many tasks atonce with many users. Equivalent in power to alarger number of microcomputers in fact.

Maths Co -ProcessorSome computers, including most IBM PC/XT/AT andcompatible machines, have a socket on the mainprinted circuit board for a maths co -processor. Thisis an integrated circuit which looks very much the

same as the microprocessor in most cases. Its purposeis to aid the microprocessor by taking over and hand-ling the calculations when floating point and otherintensive calculations must be performed. Maths co-processors are very complex devices, and have pricesthat are generally between about £100.00 and£500.00. This may seem rather expensive, but theycan provide a very worthwhile improvement in per-formance. Just how niuch of an improvementdepends on the software in use. Most maths co-processors will only operate with software that is

written to take advantage of them. Some programsare supplied in two versions - one for use withcomputers that are fitted with a maths co -processor,and one for use with computers that lack this facility.A maths co -processor can be of little benefit withprograms that do not make extensive use of complexmathematical calculations_ A maths co -processor willnot speed up a word processor for example. They areof most benefit with software such as spreadsheetsand CAD programs. The effect of one of these com-ponents is to speed up certain types of calculation bya factor of fifty or more. However, this does notmean that adding one will speed up a spreadsheet orCAD program by this amount. Probably no practicalapplications programs are pure mathematical calcula-tions. The speed-up can be very worthwhile though,and adding a maths co -processor might speed upmany parts of a CAD program by a factor of aboutthree. The exact boost in performance is very muchprogram dependent though.

Megabyte (Mbyte or M)This is a million bytes, or a thousand kilobytes. Tobe precise, it is actually 1048576 bytes, or 1024kilobytes. This unit is becoming more useful toexpress memory size, as many computers are nowbecoming available with memories in this range.It is also the most convenient unit to express thestorage capacity of hard discs.

MemoryA computer's memory is the circuit where it storesprograms and data. Some of this is the system firm-ware which boots the operating system at start-upamongst other things. For the user it is the RAM(random access memory) that is of more interest.This is used to store any programs or data that arefed into the computer, and there must be enoughRAM available. Eight bit computers are normallyrestricted to 64k of normal RAM. Although thisseemed to be a massive amount not so long ago, it isvery restrictive these days. Many 8 bit computershave some form of "paged" RAM which enablesvirtually any amount of RAM to be accommodated.This is done by switching between banks of RAM sothat no more than 64k is active at any one time. Themicroprocessor provides no support for this type ofextended RAM though, and this tends to make itrather difficult to use, slow in operation, and prone

89

Page 100: Computer Hobbyists Handbook - World Radio History

to crashing the system. If carried out properly, thissystem can work remarkably well though.

Sixteen bit computers can mostly take muchlarger amounts of memory. I megabyte is normallythe minimum limit, and many sixteen bit micro-processors can handle sixteen megabytes or more ofRAM. The only problem with this is that in practicemost computers do not have such large amounts ofRAM fitted (which would be rather expensive).Where a really large program is to be used, a commontechnique is to use program overlays. In other words,much of the program is left on disc and not loadedinto the computer. If a function that requires partof the program which has not been loaded should becalled, this part of the program is loaded intomemory. It then overwrites part of the programalready in RAM. If the overwritten part of theprogram is needed at a later time, it must be readback into memory from disc again. Some programsuse a similar method to enable them to deal with datafiles that are too large to be fully loaded into RAM.In order to work well these systems need the speedand higher capacity of a hard disc. With a programthat makes extensive use of overlays there can be anadvantage in having a fast access (40ms or less) harddisc.

Memory ResidentThis is a type of program. and it is one which when itis run, lays dormant in memory. It can then beinvoked by pressing a certain combination of keys.The idea is to run memory resident programs fromwithin other programs. You could, for example.have a memory resident calculator that could becalled up at any time, such as when word processing,and then put back into dormant mode when you havefinished your calculations. Although memory resi-dent programs are a very good idea, and can beinvaluable, there can be problems in using them.There can be clashes between memory residentprograms and main applications programs, leading tocrashes of the computer. A lot of applicationsprograms are so complex these days that they oftenuse up practically every byte of memory. Programsof this type (which includes virtually all the programsI use) can not be used in conjunction with memoryresident programs as there is simply not enoughmemory available to accommodate all the programs.

MenuWhere a program presents the user with a series ofpossible options, one way of choosing the requiredoption would he to remember the right key to press.This can be difficult, especially when first using asystem when there might be dozens of key codes toremember. Many programs provide a simple helpscreen with a list of functions and the appropriatekey or keys to press in order to obtain each one.This is a sort of menu system, but with a propermenu it is merely a matter of using the mouse or

cursor keys to position the cursor alongside therequired function. This function is then selected by"clicking" the mouse or pressing RETURN on thekeyboard.

Microcomputer (Micro)A microcomputer is simply a computer that is basedon a microprocessor. Virtually all personal and homecomputers are of this type.

MIDIMIDI is an acronym for "Musical Instruments DigitalInterface". It is a form of serial interface used tosend data from one electronic musical instrument toanother, or as a means of communication between acomputer and one or more electronic instruments. Afew computers have a built-in MIDI interface (theAtari ST series for example), and it is an add-onwhich is available for any of the more popular homeand personal computers. It is similar to a standardRS232C interface, and the common word format ofone start bit, eight data bits, one stop bit, and noparity is used. However, the baud rate is non-standard and quite high at 31250 baud, and MIDIuses a 5 milliamp current loop signal rather than thetwo voltage levels of the RS232C system. Conse-quently, an RS232C interface can not be used forMIDI purposes unless it can accommodate the higherbaud rate and a simple interface box is used to pro-vide the necessary changes in the input/outputsignals. This is the normal method of MIDI interfac-ing used for the Commodore Amiga computer, butmost other add-on MIDI interfaces connect to theexpansion bus of the computer.

MinicomputerStrictly speaking a minicomputer is a somewhat cut -

down and less powerful version of a mainframecomputer. As the top notch microcomputers becomeever more powerful the distinction between theseand minicomputers becomes less clear cut. Probablythe most sophisticated microcomputers will graduallytake over from minicomputers.

ModemThe term modem is a contraction of "MODulator/DEModulator". It is a device which enables twocomputer systems to communicate via the telephonelines. It operates by converting the signals from thecomputer's serial port into two audio tones, and con-verting received tones back into RS232C serialsignals. Direct coupled types are connected direct tothe telephone system, and acoustically coupled typessend and receive signals via an ordinary telephonehandset (see ACOUSTIC COUPLER).

ModulatorAn electronic device which converts the video outputof a computer (the signal to drive a monitor) into aform suitable to drive a domestic TV via the aerial

90

Page 101: Computer Hobbyists Handbook - World Radio History

socket. Picture quality obtained from this system isnormally markedly inferior to that obtained from aproper monitor.

MSDOSThis is currently the main operating system for 16bit computers. It is mainly used with IBM compat-ible computers (the very similar PCDOS is theoperating system normally used on the IBM PCsthemselves). There is a vast amount of software thatis designed to run under this operating system, andthis enables MS-DOS machines to be used in a vastrange of applications. In fact there are probablymore programs available for these machines than anyothers.

Multi -TaskingIt is possible to obtain software that enables a com-puter to undertake several tasks simultaneously. Whatis really happening is that the computer spends ashort time doing one task, then moves on to the nextone for a short while, and so on. This can work wellbecause computers do not normally work flat out allthe time. For example, when word processing thecomputer spends most of its time waiting for the nextcharacter to be typed rather than actually printingcharacters on the screen or manipulating the text insome way. Multi -tasking inevitably means that thecomputer runs each application more slowly thannormal, and if two or three applications put heavydemands on the computer simultaneously things cangrind along very slowly. (See also CONTEXTSWITCHING and RESIDENT)

Multi -User (System)Multi -tasking should not be confused with multi-usersystems. They are similar in that the computer istime-shared, but with a multi-user system there areseveral users, each with their own keyboard andmonitor. Multi-user systems were originally basedon minicomputers and mainframes, but there aremicrocomputer based systems. The relative cheap-ness and lowertype of systemwith mini andhave a systemtasking.

power of microcomputers makes thisa less attractive proposition than it ismainframe types. It is possible towhich is both multi-user and multi -

Numeric KeypadThis is a calculator style keyboard which is includedon many computer keyboards, usually towards theright-hand end of the keyboard. On some computersthese keys are also used for cursor control and similarpurposes. These keys are duplicating functionsavailable on the top row of the standard "QWERTY-typewriter part of the keyboard, but the numerickeypad can be much more convenient for applica-tions that require a larger amount of numeric data tobe entered into the computer.

Object CodeIn a machine code program produced using an assem-bler or compiler, the object code is the machine codeoutput produced by the assembler or compiler.

Object OrientedThis is a term which is normally applied to drawingprograms. Paint type programs are pixel oriented,which means that the drawing is produced by alter-ing the pixels on the screen of the monitor, and it isstored as a simple bit map of the screen display. Thisis a very simple way of handling things which isadequate for many purposes, but it has disadvantages.One of these is that the resolution of most computerdisplays. even the higher resolution types such as theIBM EGA display, have what is by normal standards arather poor level of resolution. Output devices suchas printers and plotters are normally capable of amuch higher resolution output than the screen. Withthe image only stored at the screen resolution, it canonly be output to the printer or plotter at this resolu-tion, giving what are often disappointing results.Some recent paint programs have routines which tryto smooth out the steps ;n curves and diagonal lineswhen hard -copy is produced, but usually results arestill some way short of the best that can be achievedby the output device.

CAD programs use a different approach. Theystore the drawings in terms of objects, such as lines,circles, text etc. Details of each object's size, posi-tion, etc. are stored in very high resolution form.Most CAD programs will accept dimensions into thetens of thousands, with about half a dozen decimalplaces being permitted if desired. In terms of pixelresolution, the drawing may well be stored on thebasis of a few billion pixels on each axis, and count-less billions of pixels in total. Of course, the drawingcan not be displayed on screen in anything like thisresolution, and the program simply provides the bestpossible on -screen representation that can be pro-duced. In fact the same is true whatever the outputdevice. and the accuracy of the hard -copy from aCAD program will normally be limited by the outputdevice rather than the program, no matter how goodthe output device happens to be.

Which type of program is best depends on theapplication. An artist would feel rather restricted bya CAD program, and would feel more at home withthe freedom and "tricks" afforded by most paintprograms. A draftsman would feel severely hamperedby the lack of accuracy provided by a paint program,and would have little use for the "spraycans" etc. of apaint program. An important advantage of CADprograms and their object orientation is that singleobjects, or a group of objects can be selected andthen manipulated in some way. The usual facilitiesare such things as scaling, rotating, stretching, etc.With pixel oriented programs the same sort of thingsare usually possible, but these facilities work on an

91

Page 102: Computer Hobbyists Handbook - World Radio History

area of the screen rather than specific objects, whichdoes not always give the desired effect.

OpcodeThe opcode is the part of a complete instruction inmachine code which directs the CPU to perform aspecific task. It normally comes at the beginning ofthe complete instruction. In some cases, instructionsmay consist of an opcode alone.

OperandThe majority of instructions in a machine code pro-gram will contain, in addition to the opcode, eithersome data on which the instruction is to operate,or the memory location where data is to be found orplaced, or more than one of these. This part of theinstruction is termed the operand. The term operandfield is also used, meaning the part of the instructioncontaining the operand. Some instructions do notrequire an operand, and in some others it is implicit.

Operating SystemThe main point about an operating system such asMS-DOS is that it effectively turns the computer intoa standard machine which will run any softwareintended for that particular operating system. Thisenables different computers to run the same soft-ware. In practice things are not quite as straightforward as this, and there can be compatibilityproblems. Software that controls the computer'sinput/output devices via the operating system can runrather slowly. Many programs use direct control tosome extent in order to speed things up. Programs ofthis type are to some extent hardware specific, andsimply having the right operating system does notguarantee that they will run properly. Another pointto bear in mind is that to run some programs properlythe system must include extra memory or other hard-ware which goes beyond the specification of mostcomputers that use the operating system concerned.An operating system therefore only offers conditionalsoftware compatibility.

An operating system also enables useful tasks suchas disc formatting, disc copying etc. to be carried out,and it is not just needed to enable applications pro-grams to be run.

ORingSee BITWISE.

OS/2This is a relatively new operating system fromMicrosoft (the company that is also responsible forthe industry standard MS-DOS operating system).OS/2 requires an 80286 or 80386 based computer(8088 and 8086 based machines are unsuitable) andit provides multi -tasking. In other words, it providesthe ability to run more than one program at a time.It requires a lot of memory though (1 megabyte forthe operating system alone). It is still early days for

this operating system, but it looks very much asthough it will become dominant in the 1990s.

OverlayIn very large programs, if the whole of the program isloaded into memory at once, there may not beenough memory space left for the storage andmanipulation of data. In such cases, some lesser usedparts of the program may not be loaded into memorywhen the program is first loaded. They are onlyloaded from disc if actually required, when they over-write part of the program already in memory. If theoverwritten part is subsequently required, it must bereloaded. Sections of program loaded on demand likethis are called overlays. When using a program whichhas overlays it is often necessary to leave the programdisc in the drive all the time the program is running.Such programs are difficult to use unless you eitherhave a two -drive computer or are running from a harddisc.

Paint ProgramPaint programs is the name generally given to pixel -

orientated drawing programs. These allow pictures tobe drawn on the screen, normally using a mouse, andprovide facilities for lines, circles, boxes and othershapes to be drawn and, if required, filled with colouror patterns. Freehand drawing is also supported, andthere are facilities to move, copy, and "flip" (dupli-cate as a mirror image) parts of the drawn picture.The picture is stored only in screen memory, and cannot be scaled up or down. Programs of this sort areused mostly for recreational purposes or for produc-ing screen images for use in conjunction with gamesprograms. They are generally not suited to serioustechnical applications. However, some word proces-sing programs allow pictures produced with com-patible paint programs to be included in documents.

PalThis is the standard used for colour TV transmissionin the U.K. and most of the rest of Western Europewith the exception of France. It stands for PhaseAlternate Line.

Parallel InterfaceSee CENTRONICS INTERFACE.

Parallel ProcessingA system of computing whereby a number of micro-processors work on a task at once, that is, in parallel,allowing very fast processing. This system is as yetvery little used, but has enormous potential if it canhe effectively implemented.

ParsingIn an interpreted language, during program execution,the interpreter must scan each line in order to deter-mine what action it must take. In the case of linescontaining mathematical expressions, several scans of

92

Page 103: Computer Hobbyists Handbook - World Radio History

the line may be necessary in order to work out thecorrect order in which the operations must be per-formed, according to the rules of operator precedence.This process of scanning a line is called parsing. It isalso sometimes used to describe the process of anassembler or compiler scanning the source code inorder to assemble or compile it.

PC -DOSPC -DOS is the operating system used in IBM personalcomputers, and it is largely compatible with MS-DOSsoftware. The two are not totally compatible, butmost programs are available in MS-DOS versionsrather than as PC -DOS programs aimed specificallyat the IBM personal computers.

PeripheralA general term for any hardware add-on for acomputer (printer, plotter, modem, etc.).

PipeliningThis is a term used in multi -tasking systems when theoutput of one program is used directly as the inputto another program running concurrently. Generallythis is implemented by the use of areas of memorydesignated as buffers. If output of one program issent to another by means of disc files (including RAMdisc files) this does not count as pipelining, but isusually termed importing and exporting. True pipe -lining is very rarely found on microcomputers.

PixelThis term is derived from "picture element" andrefers to the individual points which make up theVDU screen image. The size of a pixel therefore setsthe size of the smallest detail which can be displayed.Screen resolution is usually given in pixels, so that aresolution of 640 x 350 means that 640 points canbe resolved horizontally by 350 vertically, providedof course that the monitor is good enough.

Pixel OrientedSee OBJECT ORIENTED.

PlotterA plotter is a device that, under computer control,draws out diagrams on paper or film using a pen. It isa sort of mechanical draftsman! The main uses ofplotters are for producing business graphics andtechnical drawings. For business graphics the plotteris normally armed with fibre-tip pens of variouscolours and plotting paper or transparency film. Fortechnical drawing the pens are something very similarto conventional technical pens, and the paper isnormally some form of tracing paper or drafting film.The drawings in this book were produced using aRoland DXY980A plotter. Although plotters are arather odd mixture of microprocessor technology,pulley -wheels, and wires, they can produce superbdrawings and business graphics. Unfortunately, they

remain very much more expensive than most printers,and large high resolution types can cost many thou-sands of pounds. They are of little use as textprinters as they are very slow (typically around onecharacter per second), but they are designed speci-fically for drawing purposes and nothing else.

PointerIn WIMP environments, the pointer is the on -screensymbol, usually an arrow or hand, which is moved bythe mouse and is used to point to icons etc.

In programming, a pointer is an address in memorywhich contains the address of another place inmemory where specific data is held. In high-levelprogramming, it can mean a variable which containsthe number of an element of an array where specificdata is held.

PortAnother general term, and one which describes anyelectrical connector (plug or socket) on a computerwhich is used to connect it to other devices. Thisincludes such things as the keyboard socket, and notjust things like the serial and parallel interfaces.

PortableA computer that is fitted with a handle! It is also aterm which is used to describe a programming langu-age that has few (if any) differences between variousimplementations. Few computer languages are trulyportable, but C is a language which seems to be moreportable than most.

Position Independent CodeA form of machine code program which contains noreferences to absolute addresses within the program,and which can in consequence run at any position inmemory. Some operating systems require all pro-grams to be written in position independent form.This is especially true of multi -tasking and contextswitching systems.

QWERTY KeyboardA term which seems to confuse many people, but itsimply means a typewriter style keyboard."QWERTY" is merely the first six letters along thetop row of letters keys. The "QWERTY" form isthe standard form in the English speaking world, butslight variants are found elsewhere. For example, the"AZERTY" form is found in France and Scandinavia.

RAMThis is a form of memory device, and RAM stands for"random access memory". There is another form ofmemory called ROM (read only memory). Therandom access name is a little misleading, in that anypart of ROM and RAM banks can be randomlyaccessed by the computer. The real difference is thatthe contents of RAM can be altered by the computer,whereas the program or data stored in ROM is put

93

Page 104: Computer Hobbyists Handbook - World Radio History

there at the manufacturing stage, and can not bechanged. Also, the contents of RAM are lost whenthe computer is switched off, whereas the contentsof ROM devices are retained. RAM is used to storeprograms and data loaded into the computer, orentered from the keyboard, but any important datamust be saved to disc prior to switching off. ROMis used to hold things such as the "boot" routinewhich loads the operating system from disc whenthe computer is switched on. In fact, the termrandom access was originally coined to distinguishthis type of memory from "sequential accessmemory", where the memory can only be read insequence from the first location to the last.Sequential access memory is no longer used incomputers, but it will be found in other electronicdevices (e.g. lenses for autofocus SLR cameras).

RAM DiscIf the computer has more memory than an applica-tions program requires, part of RAM can be set asideto act as a sort of pseudo disc drive. This techniqueis mostly used with programs that use the overlaytechnique. Storing some of the routines in a RAMdisc can make these programs operate very muchfaster than using a floppy disc to hold the overlays.When using a RAM disc bear in mind that anythingstored on this "disc" will be lost when the computeris switched off. This does not matter if the RAMdisc is used for program storage, as the programoverlays can be loaded from disc each time thesystem is used. Any data stored in a RAM disc islost at switch -off though, unless it is copied to ahard or floppy disc.

Random Access FileA random access file is one in which records can beaccessed in any sequence, and is distinct from asequential file in which records can only be accessedin order starting from the first and continuing to thelast. Records in random access files normally haveto be of a fixed length, and this can be wasteful ofdisc space, as the length has to be chosen to suit thelongest record, and the shorter records padded out.In most random access systems, records are specifiedby record number, which is the position the recordoccupies in the file.

Random NumberA truly random number is one which has no referenceto any number that has gone before, and has noinfluence on any number which may follow. In aseries of true random numbers, therefore, it isimpossible to predict what any number in thesequence will be from others in the sequence. Truerandom numbers are generated in computer systemsusually by the use of electronic devices such as noisediodes. The best-known example of this is ERNIE,the computer which generates the numbers ofPremium Bonds to be awarded prizes. Most computer

languages which provide a random number facility infact generate pseudo -random numbers, where thenumbers do in fact belong to a mathematical series,hut where the series is so long and involved that it isvery difficult to predict what the next number will be.

Real TimeA much misused term, which really means that thecomputer is running at precisely the same rate assome event outside the machine. This generallymeans that it has been deliberately slowed down, butin some very complex tasks a microcomputer hasinadequate power to run in real-time. Examples ofreal time applications would be where the computeris controlling something such as a robot, flightsimulation, and processing of an audio signal. RealTime Programming is the branch of programmingwhich deals with control applications and devices,including such things as automatic washing machinesand military weapons systems.

Relative AddressingIn a machine code program, relative addressing is aform of addressing in which the address of data or abranch destination is given as a displacement (normal-ly in bytes) from the current address. It helps toenable programs to be written which can run any-where in memory (i.e. position independent code).

Relative Co -OrdinatesA graphics co-ordinate system in which the positionof the next point is given as a displacement from thecurrent point. Generally, relative co-ordinates are notas easy to use as absolute co-ordinates. They arefound mostly on the simpler home computers, butsome of the better machines give a choice of eitherrelative or absolute.

Relocatable CodeA form of machine code program which can beadjusted to run at any location in memory by theuse of a special program called a relocator, whichcorrects any absolute addresses used in the programto those required for where it is to run.

ResetIf a computer is reset it is taken back to its start-upstate. This generally means that any data in RAMwill be lost. To reset the MS-DOS computers the"Alt", "Ctrl", and "Del" keys must all be pressedsimultaneously. It is almost impossible to accidental-ly press this combination of keys. Many computers(including a lot of MS-DOS machines) have a resetbutton. This is sometimes tucked away in an inacces-sible place where it is not likely to be pressedaccidentally. You would normally only need to reseta computer when it has crashed and has hung -up in astate where it refuses to take any of the instructionsnormally used with the applications program it wasrunning. Resetting some computers does not always

94

Page 105: Computer Hobbyists Handbook - World Radio History

have the desired effect. It is then necessary to resortto switching off the computer, waiting a few seconds,and then switching on again.

ResidentUsually used to describe a program which is heldpermanently in memory, and which is run usually bypressing a combination of keys, while another pro-gram is in memory and running (but suspended whilethe resident program is in operation). Residentprograms are usually such things as diaries andcalculators. Do not confuse resident programs withbackground programs such as clocks and alarms,which are also permanently in memory, but running,though the user will not be aware of them for most ofthe time.

ResolutionThis generally refers to the screen resolution of acomputer, and it is measured in terms of horizontaland vertical pixels. A pixel is simply a dot on thescreen, and the display is built up from thousands ofthese. For example, in its highest resolution modethe Atari ST computer has a screen resolution of 640by 400 pixels. The higher the resolution, the greaterthe detail that can be shown on graphics displays. Ifyou encounter a screen resolution of something like80 by 25, this will almost certainly be the textresolution (i.e. 80 columns of text characters by 25lines of characters) and not the graphics resolution.

RGBThis stands for Red Green Blue, and is a standard forsending signals from a computer to a monitor whereeach of the primary colours has a separate wirecontrolling it. There are in fact two standards, logiclevel RGB, where each colour can be either on oroff, limiting the display to eight colours, andanalogue RGB, where the level of each colour iscontinuously variable, allowing shaded colours.

RGBIA system for sending signals from a computer to amonitor which is similar to logic level RGB, butwhere there is an extra wire allowing each colour tobe either half -intensity or full -intensity, increasingthe range of colours which can be displayed.

RISCAn acronym for Reduced Instruction Set Chip. Theidea of these is that, instead of a large set of complexinstructions, this type of microprocessor has only asmall set of simple instructions, the instructionswhich most microprocessors spend most of theirtime doing anyway. By reducing the time taken todecode the instructions in a program, executionspeed is increased. When necessary, the complexinstructions can be made up by combinations of thesimple ones. This type of chip is currently growingin popularity.

RS232CThis is the most common form of serial interfaceused in computing, and few computer serial inter-faces are of a different type. Serial interfacesgenerally operate well over reasonably long distances,and need relatively few connecting wires. The trans-fer of data is often comparatively slow, but as manycomputer peripherals are even slower, this is oftenof no importance in practice! Some computers (suchas the BBC model B etc.) are fitted with an RS423serial interface. This is largely RS232C compatible,and there are not usually any problems in using acomputer of this type with equipment fitted withan RS232C interface.

ScannerA scanner could be regarded as the opposite of aprinter or plotter. A drawing or photograph is placedin the unit, and then this is scanned by a photo-electric device. With suitable software, informationfrom the scanner is used to build up the picture in aform that can be used with a graphics applicationprogram such as GEM Paint. Some scanners arecomplete units, but some low cost types are just thephoto -electric part of the system. This second typeare designed to operate in conjunction with a

particular printer or plotter which scans the photo-cell over the picture.

SectorData is stored on floppy discs in a number of concen-tric tracks (usually forty or eighty on each side of adisc). Each track is sub -divided into sectors, andthere are usually eight or nine of these per track. Thiscompartmentalisation of a disc helps the operatingsystem to rapidly access any desired data stored onthe disc.

Sequential FileThe simplest form of computer file, in which therecords can only be read in sequence, starting fromthe beginning. In processing a sequential file, it isnormal to read all the file into memory, and, ifchanges are made, to subsequently send the entire fileto disc, discarding the previous version. In BASICprogramming, the records would normally be readinto arrays. Sequential files are economic of discspace, as no space is wasted padding records to afixed length.

SoftwareAnother name for programs, and programs of anydescription come under this category. In fact datafor programs (such as libraries of pictures for graphicsprograms) would also qualify as software.

Source CodeIn assembly language and compiled languages, thesource code is the text file which is written by theprogrammer and read "Dy the assembler/compiler to

95

Page 106: Computer Hobbyists Handbook - World Radio History

produce the object code. It is sometimes used todescribe the written form of a program in an inter-preted language such as BASIC, but this use is notstrictly correct.

SpoolerThis is usually a piece of software which enables thecomputer to print out a file while carrying on withanother task as well. It is sometimes applied to aprinter buffer, which is a device that includes alarge amount of RAM. This enables a file to beloaded into the RAM, and then printed out fromthere, leaving the computer completely free to geton with other tasks.

SpreadsheetA general-purpose type of mathematical program,where numeric data can be entered in rows andcolumns of "cells", and other cells can containformulae, or mathematical functions containing refer-ences to some of the data stored in the spreadsheet.The results of evaluating the formulae are displayedin the cells containing them. For example, at thebottom of a column of figures, you could have aformula to add the figures in the columns together,displaying the sum. If some of the data contained inthe spreadsheet is altered, all the formulae can berecalculated (automatically or on demand), showingthe effect of the changes. These programs are there-fore much used in financial planning, and have beentermed "what if" programs.

StackA stack is an area of memory reserved for use by thecomputer CPU in executing a program. It is alsoused by the CPU to 'remember its place' in a pro-gram when called upon to service an interrupt. Themain feature of the stack is that it is organised on a`last in - first out' basis. Some MPUs allow multiplestacks so that, for instance, one can be used by theoperating system and one by a high-level language.

System DiscThe system disc is the one which contains theoperating system, and which is used at switch -onwhen booting the operating system into the computer.

Thermal PrinterA thermal printer is similar to a dot-matrix printer,but instead of pins in the head it has small heatingelements. These either make marks on specialthermal paper, or use a thermal ribbon which carries afilm of ink which is melted onto plain paper by theprinthead. Some thermal printers can use bothsystems. Thermal printers are usually inexpensive.frequently battery powered and portable, and give aquality of output ranging from till -roll abysmal toquite acceptable. They cannot produce carbon copies.A big advantage for some purposes is that they arevery quiet, being matched in this only by the ink -jet

printers which are substantially more expensive.

ToggleMany programs use keys to "toggle" them betweentwo operating modes. For instance, the wordprocessor I am using to write this piece operates inthe "insert" mode normally, but can be toggled tothe "overwrite" mode by operating the "Ins" key.Operating the "Ins" key again takes the program backto the "insert" mode, operating it again takes theprogram into the "overwrite" mode once more, andso on. In other words, each time the key is operatedthe program is changed, or "toggled" to its alterna-tive operating mode.

TrackData is stored on a disc in a number of tracks aroundthe disc. It is not like a gramophone record wherethere is one spiralling track on each side of the disc.A floppy disc has a number of concentric tracks,normally forty or eighty per side.

TransputerThis is a proprietary name for a particular family ofmicroprocessor -type devices. The main feature ofthese is that they are designed so that a number ofthem can be used together in parallel processingapplications, allowing very powerful computers tobe built up. They can also be used singly. Theyare RISC type chips.

TurboThis is a term which, in computing, is usually appliedto an IBM compatible computer which operates at ahigher clock speed than the original IBM machine.For example, a lot of PC "clones" operate at 8MHz,10MHz, or even more, whereas the original PC hasa clock speed of 4.77MHz. The higher clock speedsmean that these "turbo" computers carry out mosttasks proportionately faster (some tasks, such as discaccesses, are not necessarily any faster). Most"turbo" computers have the ability to switch downto the standard clock frequency if desired. Thisfacility is mainly included to avoid problems withsome copy protected programs that refuse to runproperly with the higher clock frequencies.

TurtleThe turtle is a feature of the LOGO computer langu-age. The turtle can be either a robotic device whichmoves around on a sheet of paper on the floor,drawing lines by means of a pen (called a 'floorturtle') or it can be a symbol on the screen (usuallya triangular pointer, but on some Atari computersit is actually a turtle shape, complete with cutesiefeet!) which moves around leaving lines behind it.The turtle moves in response to commands such asFORWARD 50, RIGHT 90, BACKWARD 100which move it specific distances and turn it throughspecific angles. Drawing can be stopped and started

96

Page 107: Computer Hobbyists Handbook - World Radio History

with PENUP and PENDOWN. This type of graphicshas subsequently been incorporated in other langu-ages (notably in versions of BASIC and FORTH) andis now called Turtle Graphics.

User FriendlyA somewhatmeans that aware) is easyknowledge of

over -used phrase which supposedlypiece of software (or possibly hard -to use, even for someone with littlecomputing. Software which is totally

crash -proof and provides unambiguous instructionswhenever a command is required (preferably withmenu selection of commands) would be very userfriendly. A program which responds only to theright combination of obscure letter codes would bevery user unfriendly. A point which is often over-looked is that user friendly programs, although easyto use initially, may be rather slow going once youhave mastered them. Ideally a complex programshould offer user friendly control, with short cutsavailable for experienced users.

UtilitiesA term which describes programs that provide usefulbut limited functions, and do not really qualify asapplications software. As an example, a program torecover a deleted file from a disc would be a typicalutility.

WIMPThis is an acronym for Window Icon Mouse Pointer,and describes the type of graphical front end environ-ment popularised by the Apple Macintosh computer,and since copied by such products as DR GEM andMicrosoft WINDOWS et al.

Winchester DiscThis is a type of hard disc, but hard discs are general-ly just referred to as such these days, or the alternativename of "fixed disc" is used.

Word ProcessorThis very popular type of program (which naturallyis being used to write this book) allows text to beentered from the keyboard, altered, edited, added to,deleted, formatted and finally printed out. Additionalfacilities allow text to be stored on disc, and allowdocuments to be merged or split into parts. Thebest word processors will also provide a thesaurus anda spelling checker, and may allow you to work onmore than one document at once, copying textbetween them.

Word -WrapWord-wrap (also known as wrap -around) is a wordprocessing term. It simply means that when the endof a line is reached, the current word is transferred tothe beginning of the next line. This avoids havingwords split between two fines. Unlike a typewriter,when using a word processor it is not necessary toput in carriage returns at the end of each line. Thecarriage returns are effectively added for you by theautomatic word wrapping. This is a standard wordprocessor feature, and you are unlikely to find onewhich does not incorporate it.

Write -ProtectUsually this means place a write -protect tab on afloppy disc so that it is impossible to write data toit. It can still be read of course. It is normal to fixwrite -protect tabs onto program discs so that thereis no risk of accidentally over -writing and damagingthe program. Data discs which hold important datashould be treated in the same way. In fact it is moreimportant to use write -protect tabs on these asinadvertent over -writing of files is more easily donewith data discs. Some systems support softwarewrite -protect schemes.

XORingSee BITWISE.

97

Page 108: Computer Hobbyists Handbook - World Radio History

1,4,nss

Page 109: Computer Hobbyists Handbook - World Radio History

Chapter 8

MIDI TECHNICALITIES

MIDI is an acronym for "Musical Instruments DigitalInterface". Computers are now very much part ofthe electronic music world, and really seem to be avital part of it these days. Few computers have aMIDI interface as standard (they are present on theAtari ST series and a few others), but they are avail-able as add-ons for all the popular microcomputers.MIDI is a form of serial interface, and it is verysimilar to the standard RS232C and RS423 com-puter serial interfaces. The RS232C serial system hasvarious word formats, with from 5 to 8 data bits,one or two stop bits, and sometimes a form of errordetection known as parity checking is implemented.This system of error detection involves the trans-mission of extra bits on some bytes. Fortunately,MIDI is properly standardised, and it only ues a wordformat of one start bit, eight data bits, one stop hit,and no parity. This word format can be accommo-dated by all the serial interface chips I haveencountered, and MIDI hardware does not requireany non-standard components.

A lot of problems are experienced by users ofRS232C equipment due to difficulties with thehandshake lines. These enable a receiving device toinstruct the sending equipment to temporarily haltthe flow of data in the event that data is received ata higher rate than it can be processed. There is norisk of any similar problems with MIDI interfacingas handshaking is not used. At least, handshakingof the hardware variety is not used. Some equipmentuses system exclusive messages where a two-waydialogue takes place so that the flow of data can beregulated, and any errors can be corrected. Thissystem can work very well, and the lack of hardwarehandshaking is not a major drawback.

Some serial systems are "synchronous", whichmeans that they use an extra connecting cable tocarry some form of synchronisation signal. MIDI isa form of "asynchronous" serial interface, whichmeans that the timing signals are sent on the sameline as the data. In fact the only synchronisationsignal is the start bit at the beginning of each byte.This indicates the commencement of a byte of data,and that the voltage on the connecting lead must betested at regular intervals thereafter until a full byteof data has been received. It does not ensure that thetransmitting and sending devices are properly syn-chronised while each byte of data is sent. This isachieved by sending/receiving data at a standard rate,with (usually) quartz crystal controlled oscillators (asused in quartz watches) to ensure excellent accuracyat both ends of the link.

The standard MIDI "baud" rate is 31250 baud,or 31.25 kilobaud if you prefer. This simply meansthat data is transmitted at a rate of 31250 bits per

second (assuming a continuous flow of data). Thisis not a standard RS232C baud rate, and might seemto be an unusual choice Originally the baud ratewas 19200 baud, which is the highest standard baudrate for RS232C interfaces. However, this was deem-ed to be too slow, and in the final MIDI specificationit was increased to 31259 baud. This is convenientfrom the hardware point of view, as it is well withinthe capabilities of most serial interface chips. Also,31250 multiplied by 32 equals 1000000, and thisfact enables the baud rate of MIDI interfaces to becontrolled using "off the shelf" crystals intended forcommunications applications and microprocessorcircuits.

The HardwareRS232C and RS423 interfaces use different voltagesto represent logic 0 and logic 1 levels, but MIDI isdifferent in that it uses a 5 milliamp current loop. Inother words, the current is switched on to indicateone logic level, and switched off to represent theother logic state. This is done due to the use of opto-isolators at each input, which keep items of equip-ment in the system electrically isolated from oneanother. This eliminates the risk of damage occurringwhen two or more items of equipment are connectedtogether, due to their chassis being at different volt-ages. It also helps to reduce the risk of "hum" loopsbeing produced when a number of instruments andother equipment are connected together. Finally, italso helps to avoid having electrical noise coupledfrom a computer into the audio stages of an instru-ment. If there is one thing computers do better thanspace invaders or number crunching it is generatingelectrical noise! Refer to the relevant section ofChapter 2 for MIDI port connection details.

MIDI CodesAll MIDI instructions have a header byte that consistsof two 4 bit sections (or "nibbles" as they are some-times called). The most significant nibble indicatesthe nature of the instruction (note on, note off, orwhatever). The least significant nibble is the channelnumber in most messages, but no channel number isrequIred for any form of system message. Withsystem messages the most significant nibble is thesystem message code, and the least significant nibbledefines the precise type of system message (MIDIclock, reset, etc.). In terms of the total decimalvalue in a header byte, it is just a matter of takingthe values of the two nibbles and adding themtogether. For instance, an instruction nibble of 128and a channel value of 12 would be sent as a bytehaving a total value of 140. With MIDI it is often

99

Page 110: Computer Hobbyists Handbook - World Radio History

easier to work with hexadecimal numbers, as eachnibble represents one digit of a hexadecimal number.

The most significant bit of header bytes is alwaysset to 1, but this bit of data bytes is always 0. It is

for this reason that MIDI data bytes only cover a 0to 127 range, and not the full 0 to 255 span affordedby 8 bit operation. The point of arranging things thisway is that it enables receiving equipment to sort outMIDI messages from amongst MIDI data. Althoughthis might appear to be unnecessary with one MIDImessage being fully transmitted before the next oneis commenced, things do not always happen in thisway. It is obviously necessary for MIDI clockmessages to be sent at strictly regular intervals,without them being delayed too long while a messagein progress is completed. The MIDI specificationtherefore allows for clock messages to be mixed intoother messages. Complete bytes must always besent, and a byte must not be aborted so that a clockmessage can be sent. It is still possible to havesomething like a note on message and the note valuesent, followed by a MIDI clock message, and thenthe velocity data byte of the note on message! Asthe most significant bit of the clock message will beset to 1, the receiving equipment can recognise it assuch and will not mistake it for the velocity databyte.

Note On/OffThe note on nibble is 1001 in binary, which is equiva-lent to 144 in decimal. From here onwards, valueswill be provided in binary, followed by the decimalequivalent shown in brackets. The least significantnibble is the channel number, which is from 0000 (0)to 1111 (15). As MIDI channels are normallynumbered from 1 to 16, this means that the valueused in a MIDI channel message to select the desiredchannel is actually one less than the MIDI channelnumber. In other words a value of 0 selects channel1, a value of 1 selects channel 2, and so on. Thenote on message is followed by two data bytes, whichare the note number and the velocity value.

Note off messages have 1000 (128) as the mostsignificant nibble, and the channel number as theleast significant nibble. The header byte is followedby two data bytes, which are again the note numberand velocity value. A note on message having avelocity value of 0 can be used as an alternative formof note off message.

Key PressureOverall key pressure (sometimes called "channel"pressure) has the instruction nibble 1101 (208) andis followed by a single data byte. Polyphonic keypressure has 1010 (160) as the instruction nibble,and is followed by two data bytes. These are thenote value first, and the pressure value second. Forboth types of message the least significant nibble ofthe header byte contains the channel number.

Control Change Etc.The control change header byte has 1011 (176) asthe most significant nibble in the header byte, whilethe least significant nibble is the channel numbervalue. The header is followed by two data bytes,which are the control number followed by its newvalue. Controls from 0 to 31 are paired with controlsfrom 32 to 63 (respectively), and these operate ashigh resolution continuous controls. Each pair ofseven bit numbers are combined to give a single 14bit value. The lower numbered controller alwaysprovides the most significant bits, with the highernumbered control providing the seven least signifi-cant bits. In terms of decimal numbers, the rangeavailable is from 0 to 16383. Note that it is quiteacceptable to only change one or other of the con-trols in a pair. and a change to one does notnecessitate a change to the other.

Not all equipment actually uses the high resolutioncapability of the MIDI continuous controls, and mostequipment only uses a resolution of seven bits orless. For 7 bit resolution it is the most significantnibble (lower control number) that is utilised, and theleast significant one that is ignored. For less thanseven bit resolution the least significant bit or bitsare left at zero, while the most significant bits areutilised.

Control numbers from 64 to 95 are used forswitch type controls. Only control values of 0 (off)and 127 (on) are valid with these, and other controlvalues will be ignored. Control numbers from 96 to121 are, as yet, unassigned. These are available forfuture expansion, and may be assigned specificfunctions in the future.

The remaining control numbers (122 to 127) areused for mode changes and similar functions. Thesehave a value of 0 for the control value byte, apartfrom controls 122 (local on/off) and 126 (mono on).Local control is a standard on/off switch type con-trol, and is 127 to activate the keyboard (or what-ever), and 0 to switch it off. When mono mode isswitched on, the control value selects the number ofvoices to be set to mono mode (a value of 0 sets allthe instrument's voices to mono mode). The MIDIspecification only calls for mono mode channels tobe contiguous, but some instruments have specialmodes which allow them to be assigned to anydesired channels.

Pitch WheelThe pitch wheel header byte has 1110 (224) as itsmost significant nibble, and the channel numbervalue as the least significant nibble. Two data bytesare used, and the two seven bit values these containare combined to give a 14 bit pitch wheel value. Theleast significant byte is the one sent first. A value of10000000000000 (8192) represents zero pitchchange. If less than the full 14 bit resolution is imple-mented some of the least significant bits are ignored

100

Page 111: Computer Hobbyists Handbook - World Radio History

by a receiving device, and always set at zero by atransmitting device.

Program ChangeThe program change code nibble is 1100 (192). Theleast significant nibble of the header byte is thechannel number value. The header is followed by asingle data byte, which is the number of the newprogram for that channel. The value in the databyte is from 0 to 127, but some manufacturersnumber programs differently. Where this is the case,equipment manuals often have a conversion chartto make things easier.

Table 1 provides a summary of the channelmessages for quick reference purposes. The channelmode messages require some further amplification,and this is provided in Table 2.

Table 1

Header1000 (128)1001 (144)1010(160)1011 (176)1100 (192)1101 (208)1110 (224)

FunctionNote OffNote OnPoly Key PressureControl ChangeProgram ChangeOverall PressurePitch Wheel

DataNote Value/Velocity ValueNote Value/Velocity ValueNote Value/Pressure ValueControl Number/ValueNew Program NumberPressure Valuel.s.b./m.s.b.

Table 2

Control No. Function122 Local Control123 All Notes Off124 Omni Mode Off 0

125 Omni Mode On 0

Data0 = off, 127 = on0

126 Mono Mode On Number Of Channels (0 =All Channels Set To MonoMode)

127 Poly Mode On 0

System MessagesThese all have 1111 (240) as the most significantnibble in the header byte. No channel numbers areused, as these messages are sent to the whole system.This leaves the least significant nibble free to indicatethe type of system message. Table 3 gives a full listof these messages, but note that some of the sixteenavailable codes are as yet undefined. Many of themdo not require data bytes, and are just single bytemessages.

The values shown in brackets are the decimalequivalents for the binary nibbles. These must be

boosted by 240 to give the total decimal value foreach header byte (e.g. the value sent for a clocksignal is 240 + 8 = 248). The system exclusivemessage is followed by a data byte which gives themanufacturer's identification code, and then as manydata bytes as required follow on from this. The "endsystem exclusive" message marks the end of a systemexclusive message.

Table 3

Nibble Code Function Data

0000 (0) System Exclusive ID/As Required

0001 (1) Undefined0010 (2) Song Position Pointer I.s.b./m.s.b.

0011 (3) Song Select Song Number

0100 (4) Undefined0101 (5) Undefined0110 (6) Tune Request None

0111 (7) End System Exclusive None

1000 (8) Clock Signal None

1001 (9) Undefined1010 (10) Start None

1011 (11) Continue None

1100 (12) Stop None

1101 (13) Undefined1110 (14) Active Sensing None

1111 (15) System Reset None

Table 4 provides a list of manufacturer's identifica-tion numbers. The sample dump standard is a

"system exclusive common" message, which can beused by any MIDI equipment producer.

Table 4

ManufacturerSC I

Big BriarOctaveMoogPassport DesignsLexiconEnsoniqueOberheimBon TempiSIELKawaiRolandKorgYamahaCasioSample Dump Standard

Number (decimal)1

2

3

4

5

6

15

16

3233

6465666768126

101

Page 112: Computer Hobbyists Handbook - World Radio History

.1I .4

;

',111,1 1Sligg.; ,1 T

' t'!..

:111- Jill: A

pr

V

le

Page 113: Computer Hobbyists Handbook - World Radio History

Appendix A

ASCII TABLE

Decimal Hex Binary Character0 00 0000000 NUL1 01 0001 SOH2 02 0010 STX3 03 0011 ETX4 04 0100 EOT5 05 0101 ENQ6 06 0110 ACK7 07 0111 BEL8 08 1000 BS9 09 1001 HT10 OA 1010 LF11 OB 1011 VT12 OC 1100 FF13 OD 1101 CR14 OE 1110 SO15 OF 1111 SI

16 10 0010000 DLE17 11 0001 DC118 12 0010 DC219 13 0011 DC320 14 0100 DC421 15 0101 NAK22 16 0110 SYN23 17 0111 ETB24 18 1000 CAN25 19 1001 EM26 1 A 1010 SUB27 1B 1011 ESC28 IC 1100 FS29 ID 1101 GS30 1E 1110 RS31 1F 1111 US32 20 0100000 [SPACE]33 21 0001 !

34 22 0010 11

35 23 0011 #36 24 0100 $

37 25 0101 %38 26 0110 &39 27 0111

40 28 1000 (

41 29 1001 )

42 2A 1010

43 2B 1011 +

44 2C 1100 ,

45 2D 1101

46 2E 1110 .

47 2F 1111 /

48 30 0110000 0

49 31 0001 1

50 32 0010 2

51 33 0011 3

52 34 0100 4

53 35 0101 5

Decimal Hex Binary Character54 36 0110 6

55 37 0111 7

56 38 1000 8

57 39 1001 9

58 3A 1010

59 3B 1011 ,

60 3C 1100 <61 3D 1101 =

62 3E 1110 >63 3F 1111 ?

64 40 1000000 (a)

65 41 0001 A66 42 0010 B67 43 0011 C68 44 0100 D69 45 0101 E70 46 0110 F

71 47 0111 G72 48 1000 H73 49 1001 I

74 4A 1010 J

75 4B 1011 K76 4C 1100 L77 4D 1101 M78 4E 1110 N79 4F 1111 080 50 1010000 P

81 51 0001 Q82 52 0010 R83 53 0011 S

84 54 0100 T85 55 0101 U86 56 0110 V87 57 0111 W88 58 1000 X89 59 1001 Y90 5A 1010 Z91 5B 1011

i

92 SC 1100 \

93 SD 1101i

94 SE 1110 A

95 5F 1111 4-

96 60 1100000 '

97 61 0001 a

98 62 0010 b

99 63 0011 c

100 64 0100 d

101 65 0101 e

102 66 0110 f

103 67 0111 g

104 68 1000 h

105 69 1001 i

106 6A 1010 j

107 6B 1011 k

103

Page 114: Computer Hobbyists Handbook - World Radio History

Decimal Hex Binary Character Decimal Hex Binary108 6C 1100 1 118 76 0110109 6D 1101 m 119 77 0111110 6E 1110 n 120 78 1000111 6F 1111 o 121 79 1001112 70 1110000 p 122 7A 1010113 71 0001 q 123 7B 1011114 72 0010 r 124 7C 1100115 73 0011 s 125 7D 1101116 74 0100 t 126 7E 1110117 75 0101 u 127 7F 1111

Charactervwxy

{

1

}

DEL

104

Page 115: Computer Hobbyists Handbook - World Radio History

Appendix B

EPSON STANDARD PRINTER CONTROLS

The EPSON standard printer control sequences(ESC -P) are used by many other manufacturers, andare the accepted industry standard. Only the basiccontrol sequences are given here. For the full syntax,number of extra bytes required, etc. refer to yourprinter manual or to Babani book number BP181"Getting the Most from your Printer".

No one printer utilises all the codes given here.Again, you should consult your printer manual tofind which codes are functional on your machine.Some printers, while generally conforming to thecodes given here, may use different codes for someparticular functions, or may implement some func-tions in a different or non-standard way. Actualline spacings may be different from those givenbelow, especially in portable printers and thosewith more than 9 print pins.

Code Sequence

SOESC SODC4ESC WSIESC SIDC2ESC EESC FESC GESC HESC 4ESC 5ESC MESC gESC PESC -ESC SESC TESC !ESC pESC xESC k

ESC KESC LESC YESC ZESC AESC ?ESC *

FunctionTYPE STYLESEnlarged (one line only)Same as SOCancel the aboveSet/cancel enlargedCondensedSame as SICancel condensedSet emphasisedCancel emphasisedSet double strikeCancel double strikeSet italicCancel italicSet 12 -pitchSet 15 -pitchCancel 12/15 pitchSet/cancel underlineSet super/subscriptCancel super/subscriptSet any combination of stylesSet/cancel proportional spacingSet/cancel letter qualitySelect character style

GRAPHICS MODES(DOT GRAPHICS)Normal density bit imageDual density bit imageFast dual density bit imageQuad density bit imageNine pin bit imageReassign ESC K, L, Y, ZSelect any bit image mode

Code Sequence FunctionREDEFINABLE CHARACTERS

ESC : Copy ROM characters into RAMESC & Define downloadable character(s)ESC % Select ROM/RAM charactersESC 6 Set codes 128-159 as printableESC 7 Set codes 128-159 as controlsESC I Set unused codes as printableESC m Set codes 128-159 as graphics

ESC 0ESC 1ESC 2ESC 3ESC A

ESC spESC $ESCESC a

ESC CESC NESC 0VTESC BESC /ESC bESC IESC QHTESC DESC eESC f

CRLFFFBSESC iESC JESC j

ESC tESC RCANDELDC I

LINE SPACINGSet line spacing to 1/8"Set line spacing to 7/72"Set line spacing to 1/6"Set line spacing to n/216"Set line spacing to n/72"

CHARACTER SPACING/JUSTIFICATIONSet character spacingSet absolute dot positionSet relative dot positionSet justdication mode

TABLES AND FORMSSet page lengthSet auto perforation skipCancel perforation skipExecute vertical tabSet vertical tabsSet VFU channelSet VFU positionsSet left marginSet right marginExecute horizontal tabSet horizontal tabsSet horizontal/vertical tab spacingSet skip positions

PRINTER OPERATINGCOMMANDSCarriage returnLine feedForm reedBackspaceIncremental print moden/216"line feedn/216 " reverse feed

OTHERSSelect code tableSelect international character setClear print bufferDelete last characterEnable printer

105

Page 116: Computer Hobbyists Handbook - World Radio History

Code Sequence Function Code Sequence FunctionDC3 Disable printer ESC 8 Disable paper -end detectorESC V Select auto character repeat ESC 9 Enable paper -end detectorESC # Cancel MSB control ESC U Select unidirectional printESC > Force MSB to I ESC < Unidirectional print (one line)ESC = Force MSB to 0 ESC s Select quiet (half -speed print)BEL Sound bell/beeper ESC r Select print colourESC @ Initialise printer ESC EM Operate sheet feeder

106

Page 117: Computer Hobbyists Handbook - World Radio History

Appendix C

ABBREVIATIONS

ALTAlternate. A key to be found on many computerkeyboards. It is a form of shift key and does notgenerate a printable character.

ANSIThe American National Standards Institute. A bodywhich lays down various standards, including somecomputer standards (which are not necessarilyadhered to by manufacturers).

ASCIIAmerican Standard Code for Information Inter-change. ASCII is the standard form of binary codingfor text characters, although there are some com-puters which use alternatives (notably the SinclairSpectrum series).

ASMThis is a popular abbreviation for an "assembler".

BBSBulletin Board System. A system that can beaccessed using a modem and computer to downloadprograms, articles, or whatever, amongst other things.

CADComputer Aided Drawing (or Drafting). A programor computer system for producing accurate technicaldrawings. CAD can also stand for "computer aideddesign". In this context it usually means a programthat mathematically models something (electroniccircuits, wear on engine parts, etc.). It effectivelyenables something to be tested without actuallyhaving to make it.

CAEComputer Aided Education. Any program or com-puter system which is intended for educational use.

CAMComputer Aided Manufacture. A program or com-puter system that aids the manufacture of something(computerised cutting equipment in the textileindustry for example).

CGAColour Graphics Adaptor. The CGA card has beenthe most popular colour graphics board for the IBMPC and compatibles, although it seems likely to beovertaken by EGA and VGA boards in the nearfuture. Its two graphics modes are 640 x 200 in 2colours and 320 x 200 in 4 colours.

CISCComprehensive Instruction Set Computer. The normaltype of microprocessor it other words (not a RISCtype).

CMOSComplementary Metal Oxide Semiconductor. This isa general type of chip, and it refers to a particularmethod of manufacture. Most types of computerchip are available in CMOS forms, and the mainadvantage of this technology is that it provides verylow power consumption.

CP/MControl Program for Microcomputers. This is thestandard operating system for 8 bit (Z80 or 8080based) computers.

CPICharacters Per Inch. This is a printer term, and ismerely the number of characters in a one inch lineof text.

CPSCharacters Per Second. A printer term used as ameasure of a printer's speed. It is the number ofcharacters printed per second, and often needs to betaken with the proverbial "pinch of salt".

CPUCentral Processing Unit. Another name for amicroprocessor.

CRCarriage Return. Takes the print head of a printerback to the beginning of a line (and in practice isusually accompanied by a linefeed which winds thepaper up to the next line).

DDDisc Drive (usually applied to floppy rather thanhard discs).

DMPDot Matrix Printer.

DOSDisc Operating System. Simply an operating systemthat is loaded from disc.

DPIDot Per Inch. A printer term - the more dots perinch the better the print quality is likely to be.

107

Page 118: Computer Hobbyists Handbook - World Radio History

DRAMDynamic Random Access Memory. A type ofRAM chip (the type used in most computers).

DSDDDouble Sided Double Density. A disc format - usesboth sides of the disc with double the standardamount of data per track.

DSSDDouble Sided Single Density. A disc format - usesboth sides of the disc with the standard amount ofdata per track.

DTPDesk Top Publishing. A computer system thatenables documents (newsletters, magazines, books,reports, advertising sheets, etc.) to be prepared.It differs from a word processor in that a widevariety of lettering styles, fonts, and sizes are avail-able, and in most cases graphics can also be incorpor-ated in the document.

EEPROMElectronically Programmable Read Only Memory.An EEPROM device differs from an EPROM typein that it can be electronically erased.

EGAEnhanced Graphics Adaptor. This is a video adaptorcard for IBM PCs and most compatibles. Its mainmode provides 640 x 350 resolution in 16 colours.

EMSA standard for extended memory boards for IBMPCs and compatibles (enables them to go beyond thenormal 640k limit, but only operates with softwarewritten to support this standard).

EPROMErasable Programmable Read Only Memory. Thistype of memory circuit differs from ROM in that itis not programmed at the manufacturing stage.Instead it is programmed using a special programmer(which is often an add-on device for a computerrather than a stand-alone unit). EPROM can beerased using ultra -violet light, and then reprogrammed.

ESCEscape. A key that is found on most computer key-boards. Its function depends on the particularcomputer in use, and in most cases on the softwareit is running.

FDDFloppy Disc Drive.

FFForm Feed. If a printer is sent a form feed it advancesthe paper to the end of the page.

HDHard Disc.

HPGLHewlett Packard Graphics Language. This is thegraphics language used for Hewlett Packard plotters,and emulations of it are used by several other plottermanufacturers. Most software that has plottersupport can be used with HPGL or HPGL emulationplotters.

I/OInput/Output. A term that generally refers to theports of a computer, but which can be applied to anyform of input and output (reading and writing to discfor instance).

ICIntegrated Circuit. The components on whichcomputers are based - a microprocessor is a type ofintegrated circuit. (If you look inside a computer,the black plastic components having two rows of pinsare the integrated circuits [some ICs these days havedifferent types of case, including large square oneswith pins on all four sides] .)

KKilobyte (1024 bytes).

KBKilobyte.

LANLocal Area Network. A setup which has two or morecomputers connected together to effectively operateas a single system.

LC

Lower Case (i.e. small letters, not capitals).

LFLinefeed. If a printer is sent a linefeed it advancesthe paper by one line (but does not move to thebeginning of the line which requires a carriage return).

LQLetter Quality. A printer term which applies to thequality of the printed text. LQ is high quality text,comparable to that provided by a good qualitytypewriter.

MMegabyte (1048576 bytes).

MBMegabyte.

MicroMicrocomputer or Microprocessor. These days theterm "micro" is more usually applied to a micro-computer than to a microprocessor.

108

Page 119: Computer Hobbyists Handbook - World Radio History

MIDIMusical Instruments Digital Interface. This is a formof serial interface that enables a computer to operatein conjunction with a suitably equipped electronicmusical instrument. It is not compatible with thestandard RS232C computer serial interface.

MODEMModulator - Demodulator. A device which enablescomputer systems to communicate via the telephonesystem.

MOSMaching Operating System or Metal Oxide Silicon.The first is a computer operating system such asMS-DOS or CP/M, and the second is a manufacturingprocess for integrated circuits (many computer ICsare of the MOS variety).

MPUMicroprocessor Unit. This is just another term for amicroprocessor.

MS-DOSMicrosoft Disc Operating System. The standardoperating system for IBM PC compatible computers,and a few other machines.

NLQNear Letter Quality. Most dot matrix printers pro-vide rather mediocre print quality at their highestprinting speed. Most have near letter quality modewhich provides a much higher print quality by usinga double -pass system (but the print speed is usuallymuch lower).

OSOperating System (MS-DOS, CP/M, etc.).

PCPersonal Computer. Any microcomputer could becalled a personal computer, but these days it general-ly refers to a business micro. In fact it is most oftenapplied to IBM compatible computers.

PC -DOSPersonal Computer Disc Operating System. Theoperating system used on the IBM PCs (compatiblesuse the very similar MS-DOS).

PDPublic Domain. In a computer context this applies tosoftware which is free. What you pay for when youbuy PD software is merely the cost of the disc,duplication fees, etc. PD is different to "shareware"software in that the latter is free to try out, but ifyou go on using it the author requires a registrationfee.

QWERTYThis does not stand for anything. It is the first sixletters on the top (letters) row of a typewriter stylekeyboard. A QWERTY keyboard is therefore just anordinary computer keyboard.

RAMRandom Access Memory. This is memory which thecomputer can use to store data and read it back again.

RISCReduced Instruction Set Computer. A computerbased on a microprocessor that has a relatively smallnumber of instructions, but each one can be perform-ed very rapidly.

ROMRead Only Memory. A form of memory which isprogrammed at the manufacturing stage. Thus thecomputer can only read ROM, it can not alter itscontents.

SSDDSingle Sided Double Density. A disc format - onlyuses one side of the disc but places twice the normalamount of data on each track.

SSSDSingle Sided Single Density. A disc format - onlyuses one side of the disc and places the standardamount of data in each track.

UARTUniversal Asynchronous Receiver/Transmitter. Thisis a type of serial interface integrated circuit. It is ageneral purpose type which is not intended foroperation with one particular family of microproces-sor. In fact they are usable with non -microprocessorbased systems as well.

UCUpper Case (i.e. capital letters).

VDIVisual Display Interface. Less well known alternativeto VDU.

VDUVisual Display Unit. This usually refers to a terminalunit (i.e. a keyboard and monitor plus supportingelectronics), which is usually one of many terminalsconnected to a mini or mainframe computer.

VGAVideo Graphics Array. This is the video circuit inthe IBM PS/2 series of computers. Add-on VGAcards for the IBM PC and most compatibles are alsoavailable. It includes all the standard IBM PC graphicsstandards as well as some new ones (including a640 x 480 16 colour mode, and a 320 x 200 256colour mode).

109

Page 120: Computer Hobbyists Handbook - World Radio History

WIMPWindows - Icons - Mouse - Pointer. A graphicsbased computer environment which makes use of amouse to manipulate things via on -screen windows,pointer, and icons (as with GEM for example).

WPWord Processor.

WYSIWYGWhat You See Is What You Get. A term mostlyused with word processors where the on -screentext looks (more or less) like the printed out version.

110

Page 121: Computer Hobbyists Handbook - World Radio History

Appendix D

SUPPORT CHIPS

Designing the hardware for a computer is probablynot as difficult as most computer users wouldimagine. The microprocessor manufacturers alsoproduce what, in general, is a useful range of supportchips, and these greatly ease the problem of com-puter hardware design. At one time most computersconsisted of a microprocessor, memory chips, somestandard peripheral chips, a few general purposelogic devices, and pieces of hardware such as thedrives and keyboard. In modern computers thestandard peripheral chips are perhaps less in evidence,and there has been a marked trend towards customchips which combine functions of several peripheraldevices plus some general logic devices in one purposemade integrated circuit. Rightly or wrongly, this isgenerally thought to give better reliability, and pro-vided the computer sells in suitably large numbers,it is certainly cheaper. Despite the trend towardscustom chips, most computers still have somestandard peripheral devices (the sound chip of theAtari ST computers for example, is the standardAY -3-8910 or equivalent, as found in several othermachines).

This is a list of some common microprocessors andtheir standard support chips, plus a list of non -microprocessor specific devices. Note that a devicewhich is intended specifically for one microprocessoris often usable with many other types. albeit with acertain amount of difficulty in most cases. Somemicroprocessors are (more or less) bus compatiblewith other microprocessors, and their peripheralchips are then largely interchangeable (the 6800and 6502 series of microprocessors are a goodexample of this). Sometimes peripheral devices areused in a computer even though, on the face of it,they seem to be largely incompatible with themicroprocessor used in the design. The Z80A basedAmstrad CPC computers for example, use the 6845video chip which is really intended for use with the6800 series of microprocessors.

65026520 Parallel I/O interface6522 Parallel I/O interface and twin 16 bit

timers6526 Parallel I/O interface and timers

(Commodore)6532 RAM - I/O - Timer combination6541 Keyboard/display controller6545 Display controller6551 Serial I/O interface6566 Video controller (Commodore)6567 Video controller (Commodore)6581 Sound generator (Commodore)

The standard devices are for operation up to1MHz. Those having a "B" suffix can operate up to1.5MHz, and those with a "C" suffix are suitable foruse up to 2MHz. Where indicated, the devices aremanufactured by Commodore Business Machines Ltdand are not in general use.

Z80Z8OPIO Parallel I/O interfaceZ8OCTC TimersZ8ODART Dual serial I/O interfaceZ8ODMA Direct memory accessZ8OSIO Serial I/O interface

The standard devices are suitable for clockfrequencies of up to 2.5MHz. The "A" suffix chips(as used in many computers) are suitable for opera-tion at frequencies up to 4MHz.

6800682168286840684468466850685268716875

Parallel I/O interfaceInterrupt controllerTimer/counterDMA controllerROM - I/O - Timer combinationAsynchronous serial I/O interfaceSynchronous serial I/O interfaceClock generatorClock generator

The standard devices are suitable for clockfrequencies up to 1MHz. The "B" suffix devices canoperate up to 1.5MHz, while the "C" suffix devicesare suitable for use up to 2MHz.

808081558224822882508251825382558256825782598279

RAM - I/O - Timer combinationClock generatorControl/data bus demultiplexerAsynchronous serial I/O interfaceUniversal serial I/O interfaceTimer (3 x 16 bit)Parallel I/O interfaceMulti -function serial I/O interfaceDMA controllerInterrupt controllerKeyboard/display interface

8080 series peripherals have good bus compati-bility with the Z80 microprocessor, and are oftenused in Z80 based computers.

111

Page 122: Computer Hobbyists Handbook - World Radio History

680006823068450684516866168681

Parallel I/O and timer/countersDMA controllerMemory managerCommunications controllerSerial I/O interface

The 68000 series of microprocessors can also beinterfaced to 6800 peripheral chips.

8086Uses 8080 series peripheral chips.

General Support Chips76489 Three channel (plus noise) sound

genera tor

AY -3-8910 Three channel (plus noise) sound genera-tor, plus dual parallel I/O ports

AY -3-8912 As above but without the parallel portsAY -3-1015 UART (universal asynchronous receiver/

transmitter)6402 UART (universal asynchronous receiver/

transmitter)ZN427E Analogue to digital converterZN447E Analogue to digital converterZN426E Digital to analogue converterZN428E Digital to analogue converter446818 Real-time clock and CMOS RAM58174 Real-time clock58274 Real-time clockSP0256 Speech Synthesiser74C922 Keyboard decoder74C923 Keyboard decoderTMS9929A Video controller

112

Page 123: Computer Hobbyists Handbook - World Radio History

Appendix E

DECIMAL - BINARY - HEX

Decimal Binary Hexadecimal0 0 01 1 1

2 10 23 11 34 100 45 101 56 110 67 111 78 1000 89 1001 910 1010 A11 1011 B12 1100 C13 1101 D14 1110 E15 1111 F16 10000 1017 10001 1118 10010 1219 10011 1320 10100 1421 10101 1522 10110 1623 10111 1724 11000 1825 11001 1926 11010 IA27 11011 113

28 11100 1C29 11101 1D30 11110 IE31 11111 IF32 100000 2033 100001 2134 100010 2235 100011 2336 100100 2437 100101 2538 100110 2639 100111 2740 101000 2841 101001 2942 101010 2A43 101011 2B44 101100 2C45 101101 2D46 101110 2E47 101111 2F48 110000 3049 110001 3150 110010 32

Decimal Binary Hexadecimal51 110011 3352 110100 3453 110101 3554 110110 3655 110111 3756 111000 3857 111001 3958 111010 3A59 111011 3B60 111100 3C61 111101 3D62 111110 3E63 111111 3F64 1000000 4065 1000001 4166 1000010 4267 1000011 4368 1000100 4469 1000101 4570 1000110 4671 1000111 4772 1001000 4873 1001001 4974 1001010 5A75 1001011 5B76 1001100 5C77 1001101 5D78 1001110 5E79 1001111 5F80 1010000 6081 1010001 6182 1010010 6283 1010011 6384 1010100 6485 1010101 6586 1010110 6687 1010111 6788 1011000 6889 1011001 6990 1011010 6A91 1011011 6B92 1011100 6C93 1011101 6D94 1011110 6E95 1011111 6F96 1100000 7097 1100001 7198 1100010 7299 1100011 73100 1100100 74

113

Page 124: Computer Hobbyists Handbook - World Radio History

e:

f...Afp. ; .447epu " 4,1"540.1e -44144k- -

. - r-1.

ce

VT:

Page 125: Computer Hobbyists Handbook - World Radio History

Appendix F

THE STANDARD SYMBOLS FOR USE IN FLOW -CHARTS

Manual Operation Input/Output

C)Process

Terminal/Interrupt Preparation Decision

Merge Document

Connector

JOManual Input

Communications Link

Display

A

VOff Page

Page 126: Computer Hobbyists Handbook - World Radio History
Page 127: Computer Hobbyists Handbook - World Radio History

Index

16008 11 BBC joystick port 4216032 11 BBC Master 21802 7 BBC 2, 12, 45, 70, 7632032 11 BCD 3, 556502 (diagram) 13 BCPL 486502 2, 12 Binary 53, 796510 2 Bit -mapped 7168000 (diagram) 15 Bit 7968000 2, 9, 11 Bitwise operations 57, 796800 1 Blitter 7968008 9 Block graphics 696809 2,6 Boot 808080 1 Break 608080A 8 Brush 808086 (diagram) 16 Buffer 808086 8, 11 Bug 808088 8 Bulletin board 80

BUSY 18ACKNOWLEDGE 18 Byte 80Acorn Electron 2Acorn 12 C++ 50ALT 107 C 48,80Amiga 1000 printer port 22 CAD 80, 107Amiga 9 CAE 107Amstrad CPC games port 41 CAM 107Amstrad CPC printer port 24 Camera device 80Amstrad 4, 8, 76 CEEFAX 70Analogue RGB 37 Centronics port 19, 81AND 57, 77 CGA port 37ANSI 107 CGA 81, 107Apple 2, 9, 75 Chdir 61Archimedes 12 Chdisk 61ARM 12, 77 CISC 7, 12, 81, 107Array 77 CLI 65, 81Artificial intelligence 50 Clock 81ASCII 17, 77, 107 Cls 61ASM 107 CMOS 107Assembler 45, 78 Co-ordinate 75Assembly language 45 Co -processor 82Assign 60 Command 61Atari ABAQ 12 Commodore 2, 9, 46, 64Atari/Commodore games port 41 Commodore serial port 43Atari 2, 9 Compatible 81Attrib 60 Compiler 46, 81Auto line feed 20 Composite video 35, 82Auto -dial 78 Context switching 82AutoCAD 50 Control change 99Axis 78 Conversions 57

Copy 61B 48 CP/M 4, 11, 82, 107Background 78 CPS 83, 107Backup 60, 78 CPU 83, 107BASIC 2, 45, 46, 48, 50, 75, 76, 78 CR 107Batch files 63 Ctty 61Baud rate 26, 79 Cursor 83BBC Master Scientific 12BBC printer port 23 Daisey-wheel 83

Dartmouth College 46117

Page 128: Computer Hobbyists Handbook - World Radio History

DatabaseDateDDDefaultDelDigital ResearchDigitiserDIN

8362

1078362

48332

ICIconIDCIEEE488 portIEEE488IndirectionInkjetIntel

108872043428787

1, 8Dir 62 Interface 87Directory 84 Interpreter 88Disc 84 Interrupt 3, 88Diskcomp 62Diskcopy 62 Joystick 39DMP 107 Justification 88DOS 107Dot matrix 85 Key pressure 99DPI 107 Keybxx 62DR GEM 75 Kilobyte 53, 88Dragon 6,71DRAM 107 Label 62DSDD 107 LAN 88DSSD 107 Laser printer 88DTE/DCE 29 LCD 88DTP 107 LED 88

LF 108Edinburgh LOGO 48 Library 88Editor 85 Lisp 50EEPRPOM 107 List processing 47EGA port 38 Locomotive Software 46EGA 85, 107 LOGO 46, 75EMS 108 LQ 108Emulator 85 LSCI LOGO 48ESC 108Expert system 85 Machine code 45

Macintosh 51, 75FDD 108 Mallard BASIC 46Fdisk 62 Maths co -processor 89FF 108 Megabyte 53, 89File 86 Memory resident 90Find 62 Memory 89Flag 86 Menu 90Flowchart symbols 115 Microsoft WINDOWS 75Format 62, 86 Microsoft 8Forth 50 MIDI codes 99Fortran 51 MIDI ports 34Frame grabber 86 MIDI chain 33Function key 86 MIDI 31, 90, 109

MIT LOGO 48Games ports 39 Mkdir 62GEM 76, 87 MOB 74

Mode 62Handshaking 28 Modem 90HD 108 Modula 2, 49Hexadecimal 56 Modulator 89HPGL 108 Monitors 34

More 62I/O 108 MOS Technology 2, 6IBM style printer port 21 MOSTEC 2IBM AT RS232C port 29 Motorola 1, 2, 6, 9, 11IBM 8, 11, 12 MS-DOS 8, 11, 12, 60, 89

118

Page 129: Computer Hobbyists Handbook - World Radio History

MSX printer port 24 RGB ports 37Multi -tasking 9,91 RGB 36,95Multi-user 9,91 RGBI 37,95

RISC 12,95National Semiconductor 11,12 Rmdir 63Nicklaus Wirth (Prof.) 49 ROM 109N LQ 109 RS232C port numbering 28Note on/off 99 RS232C port 25,95Null modem cables 30 RS232C interconnections 27Numeric keypad 91 RS422 31

RS423 30Occam 12Ones complement 54 Scanner 95OPEN LOGO 48 SCART 40Operating systems 59 Sector 95OR 57,92 Serial attributes 70,74Oracle 70 Serial port 25Oric Atmos 2,74 Seymour Pappert (Dr.) 47Oric printer port 23 Signed binary 54Oric 2,74 SIMULA 51OS/2 92 Sinclair 4,9,59,73Overlay 92 SLCT 20

Smalltalk 51Paddles 40 Sort 63PAL 35,92 Source code 95Parallel attributes 73 Spectrum 4,73,75Parallel processing 92 Spooler 96Parallel port 17 Sprites 74Parsing 92 ST MIDI lead 35Pascal 49 Stack 96Path 62 Support chips 111PC -DOS 8,11 System messages 99PC 109 System disc 96PD 109Pipelining 93 Tandy 6Pitch wheel 99 Teletext 70Pixel 93 Texas Instruments 7

Plotter 93 Thermal printer 96Pointer 93 TI9900 7Position independent code 93 Toggle 96Potentiometer joystick 42 Track 96Print 62 Transputer 12,96Printer port 17 Tree 63Program change 99 Turbo 96Prompt 63 Turtle 47,96

Twos complement 55QL 9 Type 63QWERTY 93,109

UART 109RAM disc 94 UNIX 9RAM 93RCA 7 Ver 63Read time 94 Verify 63Relocatable code 94 VGA 39Ren 63 Vol 63Replace 63Reset 94 Winchester disc 97Resident 95 WIMP 51,97Resolution 95 WIMPs 63Restore 63 Window 74

119

Page 130: Computer Hobbyists Handbook - World Radio History

Word format 26 Z80 (diagram) 14Word processor 97 Z80 4Word-wrap 97 Z800 11Write protect 97 Z8000 11WYSIWYG 110 Z8001 11

Z8002 11Xcopy 63 Z8003 11XENIX 9 Z8004 11Xerox 51 Zero page 2X LR 32 Zilog 4,6,8,11XOR 58,97 ZX80 4ZX81 4,59

120

Page 131: Computer Hobbyists Handbook - World Radio History

1

6

Page 132: Computer Hobbyists Handbook - World Radio History

BERNARD BABANI BP251

ComputerHobbyistsHandbook

How many times have you spent hours looking throughcomputer books and magazines in an attempt to find some snippetof information? An ASCII code perhaps, or connection details for acomputer port? "Computer Hobbyists Handbook" provides a rangeof useful reference material in a single source so that it can bequickly and easily located.

The subjects covered include microprocessors and theirregister sets; interfacing serial, parallel, monitor, games and MIDIports; numbering systems; MIDI codes; operating systemscomputer graphics. There is also a useful glossary of computerterms, and appendices covering topics such as ASCII codes, Epsoncontrol codes and flowchart symbols.

You are not simply presented with raw data, but in most casesthere are useful explanations so that the information can be used bybeginners as well as more experienced users. Although primarilyaimed at the computer hobbyist, no doubt, this book will also proveto be very useful to those involved in computing professionally, aswell as being a useful source of information for students.

___.11111111111111111111111

£5.95

9

ISBN 0-85934-196-8

78085910

341967

0 05 95