                                PDP COMPUTER
                    MASSACHUSETTS INSTITUTE OF TECHNOLOGY
                        CAMBRIDGE 39, MASSACHUSETTS










                                  PDP-4-1










                                    DDT



































                                                 February 15, 1962
                    DDT

DDT (Dec Debugging Tape) is a symbolic debugging program for the
PDP-1. It occupies upper memory starting at register 6000.  In
addition, the symbol table builds down into lower memory.  The
initial symbol table includes all PDP operations, and occupies
down to register 5543. Entry point of DDT is at register 6000.
The program is loaded by a self-contained loader occupying reg-
isters 7751-7777.  This loader is described in MIT memorandum
PDP-2.

Operation of DDT is from the on-line typewriter.  Lower case
letters and numerals are symbol constituents; other characters,
and characters typed in upper case are either control characters
or are illegal.  A symbol consists of one to three letters and/or
numerals, of which at least one must be a letter. A string of
digits alone is taken as an octal number.  The numerals 8 and 9
are considered letters.  Except for the treatment of 8 and 9,
the symbol syntax is the same as that of MACRO. DDT will read
binary tapes produced by MACRO, and also MACRO symbol punches
for the purpose of informing itself of the user's symbol defin-
itions.

One of DDT's most useful features is the "breakpoint." When de-
bugging a program, it is occasionally desirable to allow control
to flow up to a certain point, at which the programmer would
like to examine the contents of the AC, IO, and various other
registers in his program.  To facilitate this, DDT will insert
into the user's program a jump instruction (specifically, a jda)
into itself, which will cause the AC, IO, overflow indicator,
program flag 1, and sequence break status to be saved. DDT will
then print out the break location, and the contents of the AC
at that point. It is then possible to examine arbitrary program
locations, make changes as necessary, move the breakpoint if
desired, and continue the program, restoring all indicators and
executing the instruction which was originally replaced by the
breakpoint jump.

The following list describes the action of typed in characters.

CHARACTERS                    ACTION

space     separation character meaning arithmetic plus.
+         separation character meaning arithmetic plus.
-         separation character meaning arithmetic minus.
!         separation character meaning boolean inclusive or.
&         separation character meaning boolean and.

/         register examination character; preceded by an address,
          causes the addressed register to be opened, and the
          location sequence to be reset to this address.  Immed-
          iately following a register printout, it will cause
          the register addressed therein to be opened.  Opening
          a register causes the contents to be typed out as an
          instruction or constant, according to the current mode,
          and makes the contents available for modification.
                          -2-

[         same as /, but forces printout as octal constant for
          this examination.

]         same as /, but forces printout as instruction for this
          examination.

carriage  if a register is open for examination and any expres-
return    sion has been typed immediately prior to the carriage
          return, the value of that expression is stored in the
          open register. Otherwise, no change is made.

backspace has same effect as carriage return, but then opens the
          next sequential register.  This sequence is not altered
          by additional /, [, or ] characters typed after a reg-
          ister has been opened.

^         same as backspace, but opens the previous register.

tab       same as carriage return, but opens the register addres-
          sed by the contents of the last opened register (after
          modification, if any).  Tab alters the sequence of
          locations.

=         types out the last quantity as an octal integer.

`         types out the last quantity as an instruction.

~         types out the last quantity as concise code, in the
          order left, middle, right.  Spaces are deleted.

. (period)          has the value of the current location.

A         has the value of the location in which the preserved
          Accumulator is stored.

I         has the value of the location in which the preserved
          in-out register is stored.  Register I immediately
          follows register A in DDT.

M         has the value of the register which contains the mask
          used in searches (see below).  Register M+1 contains
          the lower limit of all searches, and M+2 contains the
          upper limit.  Register M immediately follows register
          I in DDT.

F         has the value of the register containing the lowest
          location being used by DDT for symbols.  Its contents
          will change from time to time, as symbols are defined.

Q         has the value of the last quantity typed by DDT or you.

"         causes the last three characters typed in to be taken
          as their concise code value.  This applies only to
          letters or numerals.

,         when preceded by a legal symbol, causes that symbol
          to be defined as the current location.
                              -3-

#         when preceded by a legal symbol, causes that symbol
          to be defined as the address part of the last quantity
          typed by DDT or you.

K         deletes all but initial symbols by setting the contents
          of F back to its initial value.  Any redefinitions of
          initial symbols ar  not affected.

(         sets the symbol definition value to the expression
          typed by either DDT or the operator beforehand. (see
          below)
)         causes the legal symbol typed immediately preceding
          the ) to be defined as the current symbol value, as
          set by ( or ,

S         sets the mode in which DDT types out words to symbolic.

C         sets the mode in which DDT types out words to octal
          constants.

R         sets the mode in which DDT types out locations to
          relative (symbolic).
O         sets the mode in which DDT types out locations to
          octal.

W         causes DDT to search memory between the limits spec-
          ified in M+1 and M+2, for words equal to the expression
          preceding the W.  Only bits masked 1 in register M are
          compared.  All occurrences are typed out with their
          locations.  Typing W alne is an error.  DDT will not
          search itself.

N         same as W, but finds all words not equal to the expres-
          sion typed preceding the N.

E         causes DDT to search memory for all words having an
          effective address equal to the expression preceding
          the E.  This search will follow all indirect address-
          ing chains to a depth of 100, after which it will
          assume that such chain does not terminate.

*         deletes all typed input since last DDT printout, unless
          the operator has typed an intervening carriage return.

case      inform DDT of the case in which the operator is typing,
shifts    and are otherwise ignored.

B         conditions DDT to insert a breakpoint at the location
          specified before the B.  If no such location was spec-
          ified, DDT removes the previous breakpoint.  A break-
          point is actually inserted only when a G, P, or X is
          executed (see below).  DDT will remove the instruction
          at the break location, and will save it for future
          restoration.  The instruction at the break-location
          is only executed after the proceed is given.
                              -4-

P         after a break trap occurs, causes DDT to proceed with
          the user's program.  The proceed will cause the in-
          struction which was at the break-location to be exe-
          cuted and control to return to the user's program at
          the point at which it was interrupted, after all reg-
          isters and indicators have been restored. If the break-
          point was moved after a trap, control will still return
          to the instruction trapped by the last breakpoint.  If
          a word has been typed preceding the P, the trap will
          not occur for that number of times.

X         execute the preceding expression as an instruction. The
          breakpoint, if any, and all registers and indicators
          will be set up and saved.

G         go to the location specified before the G.  All indi-
          cators and registers will be restorvd, and the break-
          point, if any, will be inserted.  Typing G alone is
          an error.

Y         read a binary tape in standard MACRO binary block
          format.  The tape is read into storage between the
          limits specified in M+1 and M+2.  If a checksum error
          is encountered, the program will stop.  It is then
          possible to move the tape back one block, restart the
          reader, and press Continue to continue reading, if
          desired.

T         read a MACRO symbol table, and merge it with the
          existing symbol table.  Definitions on tape take pre-
          cedence over definitions in storage. The special symbols
          1s, 2s, ..., 9s are not entered.  The new contents of
          register F are typed out upon completing reading the
          symbol section of the tape.  Checksum errors are han-
          dled as in Y.

V         verify: reads a binary tape in MACRO binary block
          format and compares it against memory between locations
          specified by M+1 and M+2.  No change is made to memory.
          Discrepancies are typed out as:

                    location/           memory    tape

          Checksum errors are handled as in Y.

L         puts DDT into the title punch listen loop. Characters
          typed in are punched out in readable format on paper
          tape.  The terminating characters are tab, carriage
          return, or backspace, which do the following:

          tab:  sets DDT to punch read-in mode data blocks.

          car. ret.:  punches a standard input routine, and sets
                    DDT to punch standard checksummed data blocks.

          backspace:  sets DDT to punch standard checksummed
                    data blocks, but punches no input routine.
                               -5-

@(center  when a register is open, make the modification, if any,
dot)      and punch a one word block containing that register,
          in format specified by L (see above).

fa<laD    punches data blocks from fa through la in format
          specified by L (above). fa and la are any symbolic
          expressions.

J         punch a start (jump) block to the address specified to
          denote end of binary tape.

Z         zero all memory between register 0 and the lowest
          register used by DDT (contents of register F).

fa<laZ    zero memory between fa and la except that part, if
          any, occupied by DDT.
                              -6-

                    HINTS AND KINKS

E will find effective address of all instructions except jda.
It is principally useful for locating incorrect instructions
which are modifying the program.  If a jda is suspected, try
jda adrW in addition to adrE.

Breakpoints are extremely useful for investigating misbehavior
of long programs.  Do not try to break at program-modified
instructions, or jsp's or jda's followed by program parameters
to be picked up by subroutines.  You may break at skip instruc-
tions whether they skip or not.  Do not break at an instruction
which is in the middle of a chain of indirect addressing.  A
break point addressed by an xct will cause a break, and proceed
will be from the xct.

The PDP addition circuits abhor -0.  To insert a -0, type 777777.

If the operator types an undefined symbol. DDT will respond with
a U.  All typed input up to that point is deleted automatically.

If when attempting to type out a word as concise code, the type-
writer should hang, hitting the space bar will clear it.

Symbols are stored in the following format:
              word n@@@  concise symbol
              word n+1@  value
If it is desired to completely remove the last symbol defined,
change register F to its old value +2.  F must never contain an
even number.  When trying to determine the best symbol to fit
a given value, and given two equally good symbols, DDT will pick
the one last defined for its printout.

To return to typing in black, type any illegal character.

There are two ways to print a block of registers.  Either set
the mask to zero, set up M+1 and M+2 to enclose the area to be
printed and search for any word; or, if irrelevant parts of
memory happen to contain zero, merely do an N-search for zero.
If you change the mask or search limits, it is well to set them
back to their usual values when you are through.
                             -7-

          SUMMARY OF CONTROL CHARACTERS

A         accumulator storage
B         insert a breakpoint
C         set word print mode to constants
D         punch data blocks
E         effective address search
F         lowest location in DDT
G         go to
I         i-o storage
J         punch start (jump) block
K         kill defined symbols
L         listen for title punch
M         mask register
N         not-word search
O         set location print mode to octal
P         proceed
Q         last quantity
R         set location print mode to relative
S         set word print mode to symbolic
T         read symbol table
V         verify tape aginst memory
W         word search
X         execute as instruction
Y         read binary tape
Z         zero memory

0-7       octal numerals and/or symbol constituents
8,9,a-z   symbol constituents

"         take as concise code
~         print as concise code
#         define symbol as address typed
!         inclusive or
&         and
^         modify and open previous register
`         print as instruction
(         set symbol definition value
)         define symbol
[         examine register as octal constant
]         examine register as instruction
-         minus
+         plus
,         define symbol as .
=         print as octal
.         current location
*         delete typed input
/         examine register

tab       modify and open addressed register
bk sp     modify and open next register
car ret   modify and close register
uc,lc     set case
space     plus

all other   ignored, but respond with a ?
