DEBUGGING ROUTINE The Debugging routine provides facilities to aid in program testing. It supervises the operation of a program in the check-out phase through the use of an interpretive mode of execution with simulated A, B, E, Overflow, and P Registers. The Debugging routine is a relocatable program. It is loaded into memory after the user's relocatable program and before the library subroutines are loaded. OPERATOR COMMUNICATION All communication between the Debugging routine and the operator is performed using the Standard Keyboard Input and Standard Teleprinter Output units which are normally assigned to a Teleprinter. After the program is loaded, the Debugging routine pauses to allow the first type-in. The operator then types one or more control statements to direct the operation of the Debugging routine. The last statement of the set must be a Run statement. When the operation is completed, a pause occurs (except for the Trace operation). The operator may continue by typing a Run statement, or other control statements may be entered first. To regain control at any other time, Switch 15 must be set up. CONTROL STATEMENTS The basic format of the control statement is a single alphabetic character followed by the parameters for the operation separated by commas. The statement is ter- minated by a (CR)(LF). Numeric fields must be in octal; leading zeroes may be omitted. M,a Defines the absolute origin in memory of the user's relocatable program (as speci- fied on BCS Loader listing). This value allows subsequent reference in other con- trol statements to addresses as shown on Assembler or FORTRAN program listings. If not specified, all control statement addresses must be absolute. S,a,v1,v2,...,vn Sets one or more values into locations defined by first address, a. To specify that an existing value remain unchanged, two consecutive commas are used. The con- trol statement can contain any number of values provided its length does not exceed 72 characters. W,r,v Sets the value, v, into register, r. r=A, A-Register =B, B-Register =E, E-Register =O, Overflow D,A,a1,a2 D,B,a1,a2 Dumps area of memory from al through a2. To dump one location, enter al=a2. A specifies ASCII listing; B specifies octal. 15-1 B,I,a B,O,a The first form specifies the address, a, of an instruction breakpoint. Before the instruction and the address is executed, the Debugging routine writes a standard breakpoint message. The second form is an operand breakpoint. When the Debugging routine detects an effect operand address equal to the value of a, it writes a standard breakpoint message. One or both breakpoint halts may be selected. Once selected, it remains in effect until a new address is selected, or until an A statement is entered, or until the selection is terminated with one of the following: B,I,0 B,I,0 T,a1,a2 Traces the execution of every instruction in the area al through a2. A standard breakpoint message is printed before each instruction is executed. Each time the area is reached, printing resumes. The area to be traced must not contain calls to .IOC. The trace area remains in effect until a new area is selected or until the selection is terminated with: T,0 R,[a] Initiates or continues program execution. If the letter R only is entered, execution starts with the next instruction. To resume at another location the address, a is specified. To start the program initially, the relative (if M statement entered) or absolute starting address must be specified. A Aborts all current debugging operations and clears all input/output operations in progress. Messages If a control statement is entered incorrectly, the following message is typed: ENTRY ERROR If the Debugging routine encounters 10 consecutive levels of indirect addressing, the following is typed: INDIRECT LOOP The standard breakpoint message consists of the following: P=v1 I=v2 A=v3 B=v4 E=v5 OV=v6 MA=v7 MC=v8 id = I, Instruction breakpoint = O, Operand Breakpoint = T, Trace = S, Switch 15 set up = H, Halt in program = L, Indirect loop 15-2 P - P-Register I - Instruction (contents) A - A-Register B - B-Register E - E-Register OV - Overflow MA - Effective operand address MC - Contents of effective operand address Dump The Dump output record format consists of the contents up to 8 consecutive words preceded by the address of the first word: addr. word1 word2 . . . word8 Octal: aaaaa oooooo oooooo . . . oooooo ASCII: aaaaa cc cc . . . cc Octal words consist of 6 octal digits; ASCII words are listed as two ASCII char- acters. The contents of eight or more consecutive words are not written or they are the same as the last word of the previous record. Instead, a record containing only an asterisk is produced. OPERATING PROCEDURES The following procedures indicate the sequence of steps for use of the Debugging routine. A. Set the Teleprinter to LINE and check that all equipment to be used is operable. B. Load Basic Control System using the Basic Binary loader. C. Set Switch Register to 000002, press LOAD ADDRESS, and set Switch Register to 000000. D. Establish Relocating Loader parameters, (If relocation base is to be entered during operation of the Debugging routine, the address must be obtained during loading by setting Switch 15 to 0 (down).) E. Load relocatable object programs. F. Load Debugging program (treated as a relocatable program). G. Load Program Library routines. H. Press RUN. I. The program pauses to allow the operator to type in the control statements. J. The program may be restarted at any point by entering the absolute address assigned to the symbolic location DEBRS into the P-Register, and pressing RUN. 15-3