206 17 214KB
English Pages [3] Year 1952
of s u b r o u t i n e s
the
permits the coder to think
positions
occupied
In addition,
the
c o m b i n a t i o n s of the e l e m e n t a r y a r i t h m e t i c
punches
control
and logical o p e r a t i o n s
reproducer
in terms of functions
that are c o m p l e x
of the machine.
that
This is in effect a different s t r u c t u r e
that
than that p e r m i t t e d by the basic machine.
appropriate
The t r a n s l a t i o n p r o b l e m in this case
deck.
the r e p l a c e m e n t for
the
system
in is
the
by t h e
machine
now u n d e r
Naval Research
development
Laboratory
to
a single-address
the
For
purely
system
will
permit
the
coder
in each
instruction,
written
dundant
dictionary,
up to six
for
a subroutine,
routine,
where
to store
the
subroutine
and an arbitrary
control
if
necessary.
process
uses
producer
only
in
of
the
(2)
translation
of
the words.
structions the
the is
number of
routine
is
counted.
cards
are
These
contain
of
the
dundant
occurrences
prepared the
subroutines
r o u t i n e cards.
Standard for
each
complete with
form and with
sub-
completed
the
the
previously.
left
This
deck while
in
the
the in-
information cards
the read feed
then transfer
the
the
positions on the subWhen a subroutine
next
instruction
dundant d i c t i o n a r y .
in-
is
card i s
in terms
of the com-
translatlon
The second is
The computer
and sub-
form the
processes
of
a careful
analysis
or
subroutine.
blanks
decks
in
puter but with symbols still from a re-
word
constants
placed
the first card
of the e l e m e n t a r y o p e r a t i o n s
In the
coded
is
c o n t a i n i n g a set of i n s t r u c t i o n s
and
sets
subroutine
This process results in a deck
read.
of
and re-
of each
the
from the g a n g - p u n c h e d columns
of
by s u b r o u t i n e s
into
deck.
Selectors
into a p p r o p r i a t e
structure,
deck containing sorted
symbols
a re-
two s t e p s :
translation
step
is held.
transfer
(1)
first
to specify
of
the
selectors
the
deck
of
is g a n g - p u n c h e d hack into s u c c e s s i v e
The translation
place
is p u n c h e d
of the s u b r o u t i n e
results
of
subroutine
of the s u b r o u t i n e
this
the
feed
into
in
contain
As each instruction card
arguments
a n IBM s o r t e r
and takes
the
operations
using
designation
arguments
feed,
formation
the
computer,
arithmetic
read
decks
read
timing
The instruction
arguments.
passes under the r e a d i n g brushes
A
perform
for
this
at
the
positions
punch feed.
equivalent
terminology.
translation NAREC.
the
of the coder's e x p r e s s i o n
complex operation
structure
is
subroutine
and the
punch the
by t h e
not
itself
any advantage
using
the
in re-
stead
of
for
use.
pattern
computer the
performed
step
as
described
can obviously
described
above.
can determine
elementary
this
whether
purpose
machinery
perOnly
would be gained for
of
by in-
now i n
COMPUTER AIDS TO CODE CHECKING By I r a C. D i e h m N a t i o n a l B u r e a u of S t a n d a r d s , W a s h i n g t o n W h e n a complex r o u t i n e is t r i e d on a c o m p u t e r for the first time, it is seldom f o u n d to be free from error. The t r e n d t o w a r d a u t o m a t i c p e r f o r m a n c e of the c l e r i c a l p a r t s of the coding p r o c e s s should r e d u c e the n u m b e r of coding errors. This m e c h a n i z a t i o n of c o d i n g is the subject of several
p a p e r s at this conference. Nevertheless, a significant a m o u n t of v a l u a b l e c o m p u t e r time w i l l c o n t i n u e to be d e v o t e d to the search for oodlng e~cors. Careful proofreading and clerical c h e c k i n g are o b v i o u s but important 19
methods of eliminating errors before going to the computer. On the other hand, our machines are intended to help to eliminate such drudgeries, so that we are interested in how the machines themselves can be used to analyze coding errors.
time and preparation time, the session at the computer should be short. On SEAC, a few hours each week are devoted exclusively to code checking periods of roughly ten minutes each, one routine after another being put on the computer for testing. One can usually get enough information to isolate one coding error in a ten minute period.
In the first place, most computers have convenient built-ln features which are useful to this end. The term 'breakpoint' is used to mean a special programmed halt which may be overridden by a manual switch. Many machines have breakpoint provisions, means for determining the contents of particular memory locations, and means for determining what instruction is being executed. In addition to these, SEAC, t h e National Bureau o f S t a n d a r d s Eastern Automatic computer, for example, has a device called the 'automonitor', which will automatically r e c o r d each instruction and its result. This device was not originally on the machine. One of the first diagnostic routines we used was a routine of the interpretive type which recorded each instruction and its result, while the routine was apparently being executed in the normal manner. The engineers noted that this could be done automatically with a very few engineering changes, so they added the 'automonitor. ~ The device can also be used to record t h e instruction a n d r e s u l t o n l y on predetermined instructions, in fact it is most valuable when used in this way.
Sometimes, however, one wishes to get information about as many different errors as possible in a single run at the computer. A code checking system suitable for this purpose has been designed by J. H. Wegstein of the NBS Computation Laboratory. In this method a sequence of cells called a "control tank" is set aside, and at each of several selected key points in the routine, the control is sent to different cells in this tank. During normal operation each of these cells will simply refer control to the next part of the routine, without breaking the continuity of the calculation, b u t during code checking special orders which print selected quantities are put into these cells. If these quantities are incorrect, the computer is halted, and previously prepared correct values are inserted before continuing. Quite a few auxiliary routines have been tried out on various machines. There are a great many possibilities, but all the ideas involved are simple and would occur to nearly anyone who devotes a good deal of time to the use of a machine. The trick is to find useful combinations of ideas.
Such built-in features are convenient, but in their absence one can program equivalent measures or better ones, on any adequate general purpose computer. It is these auxiliary routines, and the philosophy embodied in them, that chiefly determine the efficiency with which the machine is used in finding coding errors.
Some simple routines which have turned out to be used on SEAC are:
The important principles to be followed, I believe, are that the procedures to be used at the computer should be planned in advance and mechanized as much as poselble. There should be no attempt at human analysis of errors while at the computer. It is my feeling that the computer should not be operated by the programmer, for he will not follow a predetermined plan, but Will make on-the-spot improvisations which are usually regretted later, and will leave the machine Idle while he speculates on possible causes of errors. The o p e r a t i o n is best done by another person, preferably o n e who d e v o t e e m o s t of his t i m e to c o m p u t e r operation and is, therefore, completely familiar with the controls and has an intuitive feeling, gained from experience, of possible machine errors. Operations which c a n b e d o n e a u t o matioally by auxiliary routines should be done automatically rather than by manual operation of the controls; first, because operator errors a r e v e r y common, a n d s e c o n d b e c a u s e t h e c o m p u t e r c o u l d do h u n d r e d s o f operations while a human being is reaching for a switch. Those operations which must be done manually should be specified completely by means of written step-bys t e p instructions t o t h e o p e r a t o r .
i.
A routine which makes it easy to read out any specified sequence of cells.
2.
A routine which automatically inserts or removes breakpoints in specified locations.
3.
A routine which transfers the contents of the memory to magnetic wire or tape. This is used to avoid repetition of correct computations while correcting later errors in a routine. It is also useful in bridging interruptions in normal operation, and may be used, periodically, as a precaution against computer errors.
4.
A routine which compares the information on the input medium with the information in the memory, and reads out the addresses and contents of cells where discrepancies occur. This routine has sometimes shown up computer errorsas well. The programmers for the Whirlwind have also n o t e d that such a routine was valuable.
Several more involved routines have been useful in finding well hidden coding errors. These include: 1.
In fact these principles should apply to computer programming and operation in general, and not Just t o code checking. For most efficient use of both computer 20
An interpretive routine which provides a complete history of a specified cell. Each time an instruction affects that cell, the address of t h e Instruction a n d its result are read out. This routine is usually applied to a Location where an
on m a g n e t i c t a p e s and c o n t r o l returns to the routine being tested until another cheek point is reaehe4,
i n c o r r e c t q u a n t i t y i s known t o a p p e a r t t o a c e l l whose c o n t e n t s h a v e c h a n g e d f o r an u n d e t e r m i n e d r e a s o n , o r t o an i n s t r u c t i o n containi n g variable addresses; but also has i n c i d e n t a l u s e s , such as l o o k i n g at successive terms o f a series without altering the coding. 2.
.
Effectively, this auxiliary r o u t i n e u s e s o n l y t h e f i r s t 8 memory locations, conventionally reserved, on SEAC, f o r t h e i n i t i a l read-in Instruotlone. Actually it temporarily u s e s o t h e r p a r t s o f t h e memory by first transferring their contents t o m ~ n e t l e t a p e s and later r e s t o r i n g them.
An i n t e r p r e t i v e r o u t i n e which d e t e r m i n e s the path which the control has taken through another routine. At e a c h comparison order, thls routine reade o u t t h e a d d r e s s o f t h a t o r d e r , and t h e a d d r e s s from w h i c h t h e n e x t o r d e r will be t a k e n . This r o u t i n e s e r v e s much t h e s a n e p u r p o s e a s t h e EDSAC r o u t i n e w h i c h r e a d s o u t t h e o p e r a t i o n symbol o f e a c h i n s t r u c t i o n executed.
What one t r i e s t o a c h i e v e i n d e s i g n ing such auxiliary routines is to program t h e m a c h i n e t o s e l e c t t h e p e r t i n e n t Information rather than to read out large q u a n t i t e s o f d a t a w h i c h must be s e a r c h e d t h r o u g h by a programmer. I wish to acknowledge the contrib u t i o n s o f C . J . S w i f t and J . H . W e g s t e l n o f t h e NBS C o m p u t a t i o n L a b o r a t o r y t o the ideas presented here.
A routine which determines the total effect, on t h e high s p e e d memory, of each of several chosen sections of the routine being tested. Check p o i n t s in t h i s latter r o u t i n e a r e p i c k e d by t h e programmer, and s p e o i fi~ to the computer. The e f f e c t o f the operation is that the computer e x e c u t e s one s e c t i o n o f t h e r o u t i n e b e i n g t e s t e d , then r e a d e out the a d d r e s s e e and c o n t e n t s o f memory locations which have been altered by t h a t s e c t i o n . Then i t e x e c u t e s a n o t h e r s e c t i o n and r e a d s o u t t h e c h a n g e s i t h a s made, and so o n . The c o m p u t e r a c c o m p l i s h e s t h i s by f i r s t d u p l i c a t i n g t h e memory c o n t e n t s on a magnetic tape and r e p l a c i n g t h e instructions a t c h e c k p o i n t s by Instruotlons whloh will transfer c o n t r o l t o t h e auxiliary roatlne. Arrangement Is made, of course, f o r t h e e x e c u t i o n o f t h e replaced instructions a t the proper time. Then the first section of the main routine to entered, not in the interpretive manner, but dlreotly. When a c h e c k p o i n t i s r e a c h e d , t h e i n f o r m a t i o n i n t h e memory and on the m a g n e t i c t a p e are c o m p a r e d , and t h e a d d r e s s e e and new c o n t e n t s o f locations which have been changed are read out. Then t h e p r e s e n t c o n t e n t s o f t h e memory a r e d u p l i c a t e d
Note
on by
' C o m p u t e r A i d s to C o d e I . C . Diehm, N.B.S.
Checking'
P r o g r a m m e r s of the E c k e r t - M a u c h l y Division are u s i n g a r o u t i n e that has p r o v e d h e l p f u l in d e t e c t i n g one c l a s s of programming errors -- e r r o r s in t h e a d d r e s s p o r t i o n of i n s t r u c t i o n s . F u r t h e r m o r e , t h i s r o u t i n e h e l p s to p r e v e n t the i n s e r t i o n of n e w e r r o r s d u r i n g the p r o c e s s of c o r r e c t i n g o l d ones. The 'codecheck' routine examines a p r o g r a m and l o c a t e s e v e r y i n s t r u c t i o n r e f e r r i n g to e a c h l o c a t i o n , for e x a m p l e , 537. T h e r e f e r e n c e s are p r i n t e d t o g e t h e r w i t h t h e i r line n u m b e r s for e a s y identif i c a t i o n . T h u s , one list c o n t a i n s e v e r y line of c o d i n g w h i c h can p o s s i b l y a f f e c t location 537. C o d e c h e e k performs this operation for e v e r y ' l o c a t i o n from 000 through 999. In g e n e r a l , less time on the c o m p u t e r is r e q u i r e d t h a n for n t r i a l run of the p r o g r a m b e i n g t e s t e d .
B. Hasbrouck" Eckert-Mauchly Division of Remington Rand
INPUT SCALING A N D OUTPUT SCALING FOR A BINARY
CALCULATOR By
E. F. Codd and H. L. H e r r i a k International B u s i n e s s Machine Corp., New York
shifting operations which m ay be built into the calculator).
Input Scaling Suppose 1) the input for a p r o b l e m which is to be solved on a binary c a l c u l a t o r is given in d e c i mal f o rm ; 2) the p r o g r a m m e r d e s i r e s to s p e c i fy in his p r o g r a m the s c a l e f a c t o r s to be applied to i n t e r m e d i a t e r e s u l t s to keep these r e s u l t s within the capacity of the r e g i s t e r s of the c a l c u l a tor; 3) the s c a l e f a c t o r s to be applied a r e p o w e r s of two (this allows advantage to be taken of the
The following questions may now be asked. 1) Can p r e l i m i n a r y scaling of the decimal input (either by hand or on an a u x i l i a r y decimal c a l culator) be avoided? 2) If the binary c a l c u l a t o r can Be p r o g r a m m e d to c a r r y out s o m e e q u i v alent f o r m of scaling, how c l o s e l y does the c o n v e r t e d and s c a l e d input a p p r o x i m a t e to the 21