Pegasus Story - JW notes on Simon’s book

Wednesday, 09 December 2009


Factual Problems and easy stylistic improvements

Page 16, paragraph 1.

‘Optimum programming’, as defined on page 13, was one of the nuisances eliminated in Pegasus, though people did indeed play with it in Deuce. I wonder, as it was such a dead end, whether it’s even worth mentioning here, particularly the elliptical reference to making the use of subroutines difficult.

Maybe just remove the entire sentence starting ‘Furthermore...’, and add a foretaste, or reinforcement, of the brilliance of being the first with multiple general-purpose registers.


Page 19 para. 1.

The term voltage margins needs defining or omitting. (See my proposed glossary).


Page 19 section 3.2 .

In the first two sentence I suggest we miss out the ‘39-bit’ adjective, and define the term word elsewhere (glossary or footnote, see my glossary). This really knocks out the first sentence, the second sentence should not get into the difficult world integers and fractions; after all, there are many other forms of data, floating point, 6-bit character; maybe just say, after ‘when used as data...’, that all manipulations are performed on full length words in two’s (or twos?) complement binary arithmetic.


Page 21, descriptive text for table 3.2.

We should not imply that 8 accumulators can be used.

All becomes clear if we say “...loop-counting, though X0 is simply a source of zeros.


Page 21, address map.

Maybe bring in the fact that all 8 accumulators may be accessed as computing store block 7 (addresses 120-127) – but in block-transfer instructions only. That is to say, the instruction <100 773> writes all the accumulators to block 100, but <7.0 100> is the same as <120 100> and sets X1 to zero.


The description of addresses 64 – 111 would better read
“the computing store, as described.”


Page 26, descriptive text for figure 3.3.

Replace the sentence starting “Basically,...” with “Paper tape, code and data, is fed in to a reader on the left, and results emerge as paper tape from a punch on the right.”


Page 26, sentence starting “Since there were...”

References to ‘memory partitioning’, ‘datum limit registers’, and ‘overlays’ are inappropriate. The term ‘overlay’ was regularly used to denote a section of code, part of a program which would not all fit in at once; a section would be brought in, run, and be succeeded by the next; the idea was useful when executable address space was limited, for example second-generation machines and early PCs.

This sounds at first to fit the Pegasus <drum to computing store> relationship, but it just ain’t so. Nothing can be loaded into the computing store except by program1, and the computing store is too small to hold a complete program2. The Pegasus programmer is continually conscious of the drum, bringing in blocks of his code as required, and writing data away, at a much lower level than an ‘overlay’.

I suggest replacing this with:

“All program code is initially loaded onto the drum, but can only be executed in the computing store. The Pegasus programmer is continually conscious of these two levels of store, bringing in blocks of code to the computing store as required, and writing data to the drum.”


Page 26, sentence starting “However, ...”

I think this should be removed. It is at best elliptic, presumably referring to the fact that you can arrange to conveniently access a successor block using the 66 order. But I cannot imagine this is helpful here.


Page 25

Replace “shown in Figure 2.9 (page 17)” by “see for example the picture on page 2 [or page 40]”. (Either of these photos shows the three bays better).


Replace “(such as the one seen in Figure 3.4)” by “pictured below”.


Page 25, sentence starting “Within the central....”

Replace by “Most of this power is used by the valves.”, and define valve in a glossary, as before.


Page 27, descriptive text for fig. 3.5

Replace the sentence starting “Many of these..” by “Each word of the computing store consists of one of these delay lines.”, and give “computing store” in a glossary.


Pages 32 to 36

This is an area that I think needs a lot of attention.

The first ‘simple’ program is entirely obscure to anyone not initiated into the Mysteries. I give a suggested presentation, later in this note, of a program with the same functionality but easier to understand. [At the very end I also give a re packaging of the existing program, which is, after all, clever and tightly coded!].


The problems with section 3.4 are:

A sketchy introduction to ‘Assembly’ is given, together with a sketchy discussion of the subroutine library. Neither of these casts light on its topic, which is nonetheless required knowledge for understanding the example:


The sequence:

A1

R0 3 -08

4 - 01-

is incomprehensible to the target reader, and the explanatory comments only make things worse. What is he to make of ‘cue 8’, ‘R4’, ‘3 locations beyond’, ‘default start address’.


Most seriously, any listing of a block of code must have its computing store addresses with it if it is to be understood (note that this is done in table 3.6, which is a excellent example).

They are not given here.


What is the user to make of ‘negating the link’? This is a way of passing a parameter, but not intuitive, or properly explained.


At 0.4+, having pencilled in the locations, we see the instruction 0.5 060, with the otiose comment “Jump to U0.5 (U = Working Store Address)”.

This is otiose because:

1) The term working store has not been defined.

2) This instruction is not obeyed here, but is actually part of the link to R4.

3) The reader has no idea where 0.5 is.


There are further problems, but these are sufficient to show that the section should be replaced.


If a replacement on my suggested lines is impossible in the timescale, maybe delete the entire program description, starting at “All this is best illustrated...”, up to “A program called PEGEM”, including table 3.4 itself.


Page 34

I guess Chris Burton has asked not to be named; but, if not, he certainly should be given credit for a splendid achievement.


Page 34, bottom

Remove “under MSDOS”.

And maybe emphasise more the closeness of the simulator to the real Pegasus.


Page 35, top.

Replace “The simulator runs...” by “The simulator runs much faster on a modern PC than did the Pegasus itself; but its speed may be adjusted.


Page 35, descriptive text of Table 3.7.

Replace the sentence starting “F1 in...” by

“(The last line calls the square root function).”

Or maybe just delete it...


.

New first page

The first page the reader sees is (vi) , which kicks off with a section on memory systems. The ‘intelligent but uninformed’ reader should not be plunged in like this, as his focus of interest is the Pegasus. Maybe:


Computer Vitals


Every computer needs to acquire, retain, and modify information; The retention requirement still (2009) dominates computing technology, and we still have, as did Pegasus, a need for volatile storage, which disappears when switched off, and non-volatile, which persists without external power.


Today you can buy huge amounts of store, volatile and non-volatile, for pennies. This was not so in the time of Pegasus, whose non-volatile store used valves*, and was expensive to make and to house.


The technology of the Pegasus storage is described in some detail later, against the background of what was available at the time. Here we preview those early forms of storage.

Problem: Definitions of terms


Terms like valve, computing store, Initial Orders, and others are used throughout, often with further definition in brackets. I suggest a consistent term for each entity named, and that each such word should be:

marked with a star on its first appearance


defined in a glossary


indexed to its first (starred) appearance.

Some proposed glossary entries

B

denotes a block on the drum. For example B68 denotes block number 68, and B68.4 denotes word 4 in that block.


bit

All information can be represented numerically – for example each pixel in a camera is represented by three numbers giving its colour as proportions of red, blue, and green.


It turns out that the most convenient way of storing numbers is as a sequence of ones and noughts; for example five is 101, eleven is 1011, and two hundred million is a rather longer string of ones and noughts. The term bit is used to denote one element in such a sequence; it may take the value 1, or the value 0, but no other.


The term byte, much used to specify storage capacity, is a collection of eight bits. A byte can take any value between 0 and 255, and it is no coincidence that two to the power eight is 256.


Pegasus is not spoken of in terms of bytes. We prefer the term word, which denotes a sequence of about forty bits, much discussed throughout the book.


breakpoint

A programmer’s term. When you want to stop execution of a program at a particular point, so that you can see what is happening, you ‘set a breakpoint’ at that point. These days, control passes to a debugging system3. But, in Pegasus times, you changed bit 0 of the word, at that point, from its normal value 1, to the value 0. If and when the point is reached, the whole machine comes to a halt, and the programmer can fiddle about with the switches, to the great frustration of his waiting colleagues.

In Pegasus, all breakpoints may be disabled by operating a physical switch on the control panel.


Computing Store

This is a set of 48 words, each of which may be accessed in much less time than a word on the drum.

These locations are the only ones from which instructions can be executed; furthermore, apart from instructions transferring information to and from the drum, the instruction operands must also be in the computing store.

Information is often transferred in blocks of 8 words, since the drum is organised in 8-word blocks. It is thus conventional to represent a computing store word by block and position. This is purely conventional, with no hardware significance; it is however recognised by Initial Orders when reading instructions, so that U3.1 specifies address 894.

MARGINS

The term voltage margins denotes a technique used by maintenance engineers. Many replaceable packages in Pegasus used valves, which are inherently prone to failure. They are more likely to fail when the voltage applied is reduced, and so to improve reliability the voltage was reduced during maintenance; the engineer would then tap the packages, and any which then failed were replaced.


U

denotes a block in the Computing Store. For example U3.1 denotes word 1 in block 3 of the Computing Store.


word

A word is in general a collection of a certain number of bits, all together, within the store of a computer. The number of bits, or word length , chosen for a particular computer is one of its vital characteristics. A Pegasus word has 42 bits, of which 39 are visible to software. The reason for this odd-looking number is ingenious, and discussed throughout the text; one example is the rôle of the leftmost bit: this, if the word is being viewed as a number, indicates its sign – but, if executed as an instruction, the programmer can use it to set a breakpoint.

valve

This is the English name for what the Americans called a ‘tube’.

It was a vacuum-filled glass tube containing pieces of metal, with external electrical connections. It operated by modulating and detecting a flow of electrons emitted by heated metal.


Until the 1950s the valve was a key component of all electronic devices, and was made in large numbers. From the computer engineer’s point of view its function can be replicated by one of the millions of transistors in a modern chip. But the valve was many millions of times larger (each one a cylinder of about 100x50mm), and needed electrical power for its heater.


[END OF GLOSSARY]

The target reader

He is bright, intelligent, interested in computers, has a PC.


He has maybe seen the Pegasus in action, and related it to his PC.


He is uninformed about computer technology and electronics in general.


Replacement Sample Program

This version of the program has been prepared and run from the text given. More details of the ‘compilation’ process are to follow if required.

This process strips out evrything between exclamation marks, and prepares an emulator ‘.TAP’ file from the rest, typically the second ‘column’, as in this fragment from the full text below:

!0.1!9 440! Field width for R5. !

! !0 500! Tell R5 no fraction required !

Here only the <9 440> and <0 500> is seen by the Pegasus.


The text under ‘Preliminary Explanation’ is for inclusion in the text, before the code.



Preliminary Explanation

{explain link and subroutine}


We assume that a subroutine (named ‘R5’ for no very good reason) is available at block 53. Its parameters are:


Enter at 0.0 to print on a new line, or at 0.2+ to print on the same line.


X6 = the integer to be printed.

X7 = 0, to indicate that just the integer is wanted.

X4 = n, the number of character positions the number

is to occupy. For example, if the number is 1234, and n=8, the output would be 3 spaces followed by ‘+1234’.


All the accumulators are returned as they were at entry.


The only computing store block used is block 0.


The actual program

! Store this code at B2.0

!

T2.0


! BLOCK 0 - stored in block 2 on the drum.

!

!0.0!20 340! Count of lines, each 4 powers. !

! !1 240! Initial value of n, the number

whose powers we print. . !

!0.1!9 440! Field width for R5. !

! !0 500! Tell R5 no fraction required !

!0.2!2 600!<< Set number for R5 !

! !0.4 100! Set link for R5 to return to 0.5 below. !

!0.3!53 072! !

! !0.0 060!** Call R5 to print on a new line. !

!0.4!2 072! !

! !0.5 060!** Link for R5 to return to 0.5 below. !

!0.5!3.0 310! Save X3 in U3.0, so we can use it for the inner

loop counter. !

! !0 000! Unused, no effect, a dummy order. !

!0.6!2 600! Current number to X6 !

! !3 340! Count of 3 more powers, to go on

the current line. !

!0.7!2 620!<< Multiply, to get next power in X7. !

! !3 172! Read our next code block to U1, continue from

1.0. !


! BLOCK 1 - stored in block 3 on the drum.

!

!1.0!7 600! Set the next power for R5. The other parameters,

in X4 and X5, are unchanged. !

! !1.2 100! Set link for R5 to return to 1.3 below. !

!1.1!53 072! !

! !0.2+060!** Call R5 to print on same line. !

!1.2!3 172! !

! !1.3 060!** Link for R5 to return to 1.3 below. !

!1.3!2 072! Restore our block 0 to U0, which was used by R5.!

! !0.7 367! Repeat for the 3 numbers on this line. !

!1.4!0 000! Null. !

! !3.0 300! Restore the count to X3. !

!1.5!1 241! Advance the outer number. !

! !0.2 367! Count the 20 numbers whose powers are required. !

!1.6!0 000! !

! !0 077! Stop when complete !

!1.7!1.7 060!** Loop stop on continue after 77 stop. !

! !0 000! !



J2.0

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Miscellany


A re-packaging of the program on page 34

See the earlier, alternative, program for an explanation of the code format.

This program, too, has been prepared and run successfully in this format.

The text under ‘Preliminary Explanation’ is for inclusion in the text, before the code.

Preliminary Explanation


{explain link and subroutine}


We assume that a subroutine (named ‘R4’ for no very good reason) is available at block 50. Its parameters are:


Enter at 0.2 to print an integer.


X7 = the integer to be printed.

X4 = the number of digits to be printed.


Link in X1, as usual, but:

If it is set normally, by e.g. <0.7 100>, then the integer is printed on the same line.


If it is set with its ‘sign’ reversed, by e.g.
<0.7 102>, then it is printed on a new line.


All the accumulators are returned as they were at entry.


The only computing store block used is block 0.


The actual program


T2.0


! BLOCK 0

!

!0.0!20 340! Count of 20 numbers to X3. !

! !1 540! First number, 1, to X5. !

!0.1!6 240! Specify 6 digits for R4 !

! !4 440! Count of 'inner loop' of 4 powers, to X4 !

!0.2!5 700! Set number to be printed for R4 !

! !0.4 102!<< Set link for R4, which will return to 0.5 below

(We set it 'negatively' with the 02 instruction,

to specify printing on a new line)

(The outer loop of 20 numbers starts here. !

!0.3!50 072!*<<Call R4, at block 50. (Inner loop, of 3 more

numbers on the same line, starts here). !

! !0.2 060! !

!0.4!2 072!* Link for return from R4 to 0.5 below. !

! !0.5 060! !

!0.5!5 720! Multiply to form the next power.

(We return here from R4, after printing). !

! !0.4 100! Set the same link for R4, but this time

by a normal 00 instruction, to specify

printing on the same line. !

!0.6!0.3 467! Count 3 more powers. !

! !1 541! Advance the number whose powers we are doing. !

!0.7!0.1+367! Count 19 more numbers. !

! !0.7+060!** Loop stop. !


J2.0


JW Pegasus Notes 2003?

:

The distance from Pegasus to Pentium is far, far less than that from no-computer to Pegasus.

Programming was dominated by the physical nature of the way of storing bits of information. We had the ‘Immediate Access Store’, from which bits could be extracted at the rate of a hundred words per second. This was actually the only place from which words could be extracted to do things with – hence its other name: the ‘Computing Store’. The thing was, though, it was expensive and bulky; so there wasn’t much of it, and another form of storage existed, the ‘Drum’. The only thing you could do with bits of information on the drum was transfer them to the computing store. And you could transfer bits from the computing store to the drum. The trouble with the drum was that it took ages to get information from a particular place. The drum went round and round, and each bit passed a particular point (a ‘head’) once on each lap. It was only when the bit you wanted went past its head that it could be transferred to the computing store. So you had to wait; you didn’t know you were waiting - the hardware looked after that - but the more waiting there was the longer your program took to run. The good thing about the drum was that, unlike the computing store, the information remained intact when the power was switched off.


The computing store was expensive because each word was held as forty ‘bits’ on a length of wire, and each of these lengths was coiled onto a plug-in package with a couple of valves. What happened was, you applied a squeeze at one end of the wire, and sent it round again when it got to the other end. So it was there forever, until you changed it or the power went off. The wire was long enough for forty squeezes, and you went ‘squeeze’ or ‘no squeeze’ to turn one of the forty bits on or off.

This process is amusingly described in German (an actual quotation I assure you) as:


Auf einen Nickel-Draht von 60 cm Länge werden an einem Ende Impulse übertragen die am anderen Ende aufgefangen und wieder eingeleitet werden…

Der Pegasus-Speicher war so dimensioniert, dass die Drahtlänge von 60 cm aufgrund der physikalischen Verzögerungseigenschaften des Nickeldrahtes eine Speicherung von 42 Bits ermöglichte.


The ‘you’ doing the squeezing here is not the programmer, who just says ‘store a word please’. It is ‘The Hardware’ that translates this into a series of squeezes. I remember someone referring to the hardware (always a mystery) as ‘the iron men’, and this seems particularly good for the squeezing.




1 Operating the start key loads an order-pair from Initial Orders, which leads to reading tape.

2 The Autocode illustrates this, for example <v1 = v2 +1> leads to two single-word reads into the computing store, and a single-word write to the drum


* See Glossary

3 Usually of great complexity, and very useful, as it is now recognised that software development time is expensive, and it is worth providing the programmer with such tools.

4 The computing store starts at address 64, so Ub.p is at 64+8b+p.

11