T H E U N I V E R S I T Y O F M I C H I G A N Memorandum USE OF DDT WITH "INTERRUPTS-ON" PROGRAMS Ronald Fo Brender CONCOMP: Research in Conversational Use of Computers Fo H. Westervelt, Director ORA Prpj,oQ.t 07449 supported ey, DE'PA R TENT OT' F EF'ENSE ADVANCED RES;EN;R:CtH:P.RO.J.ECTS AGENCY WA.S-Hi:NGTON D. C. CONTRACT NO. DA-49-083 OSA-3050 ARPA ORDER NOo 716 administered through: OFFICE OF RESEARCH ADMINISTRATION ANN ARBOR July 1967

I'-C ql al

-1This memo describes the modification and use of DEC-provided DDT with programs using the "program interrupt" hardware of the PDP-7. 1. Usage DEC Debugging Tape (DDT) and user programs are loaded in the normal manner. The restart entry remains at 160008 and forces interrupts off. DDT may be used exactly like the original DDT without knowledge of these modifications. The modifications to DDT are concerned with facilitating control of the "program interrupt" as control moves between DDT and user programs and back. Two status words control the program interrupt: SAVIOS contains the input-output status word when DDT is entered via breakpoint. FIXIOK contains a code indicating the desired state of the program interrupt on exit to user program. FIXIOK is set by the following commands (which remain in effect until the next is given): STIOF' leaves program interrupt off when exiting to user program. (This is the default condition ) STION' turns program interrupt on when exiting to user program. STIOC' turns program interrupt on when exiting to user program if it was on at the last breakpoint entry. The latter is particularly useful when continuing a program with "!". Note that a counted continue will have the desired effect.

-2# commands are always executed with interrupts off. The value of SAVIOS may be determined by examining register 154548. Interrupts may be easily "lost" since DDT runs with interrupts off and senses these devices' program flags directly. The feature described in the next three paragraphs is normally suppressed. It may be invoked by storing a'NOP' in location 155418. In addition, after turning interrupts off on a breakpoint entry, DDT loops approximately 140 milliseconds to determine if a character is being printed. The teleprinter flag is tested at the end of this loop and the state saved. When continuing with or ""', DDT prints a null character just before transferring to the user program if the teleprinter flag was up on entry. This will result in a teleprinter flag coming up after reaching the user program. This flag may be prevented by storing a one in location 154558. Conversely, this flag may be forced on with "DZM 15455 # 2. Modifications (All page references are to "PDP-7 DDT, Digital7-4-S-L, February 10, 1966.") A symbol definition tape, identified as "TAPE lb of 3," is provided that contains the basic symbols. Three additional symbols are defined as described above. A modified second tape, identified as "TAPE 2b of 3," contains the modification to DDT. The following sections of code are inserted (on page 9) between FSY and KLISo Code above KLIS (= 155648) does not move from the original DEC version.

-3-,PATCH to oPATCH + 4 Saves the input/output status word on entry to DDT from a breakpointo In particular, bit zero of this word is one if interrupts are enabled at that time. A wait loop of approximately 140 milliseconds is provided by.PATCH + 3 to ~PATCH + 6 The printer flag is tested and recorded in TPFo oSTION to FIXIOK Sets a switch (FIXIOK) to indicate whether return to a program, either by "prime" command or by exclamation command, is to be with interrupts on (.SION), interrupts off (oSTIOF), or interrupts on if they were on at the last breakpoint entry to DDT (oSTIOC). These do not affect the accumulator. The following symbols are defined in DDT's symbol table: STION = 15474/address of oSTION STIOF = 15502/address of oSTIOF STIOC = 15477/address of oSTIOC GOBB to GOBB + 3 Allows execute commands, oe., #, to be performed without checking the interrupt conditions, ioeo, with interrupts off, FIXIO1 to FSTIOF Some constantso FIXIO to FIXIOF + 1 Just before exiting to a user program, control jumps to FIXIO which tests to see if the goal is one of the addresses oSTION, oSTIOF, oSTIOCo If so, transfer is made with interrupts off~ If not FIXIO sets the program interrupt depending on the value of FIXIOK, and if FIXIOK contains 1, then depending on the value of SAVIOSo Next the saved printer flag is tested and if one, an octal 377 is transmitted to the teletype~

-417250 to 17256 This print routine waits for the printer flag before exiting and hence prevents characters generated by DDT from causing interrupts (see page 27). 16550 This provides a patch to save the input-output status word (see page 21) (These last three patches were made as absolute overrides on tape 2b to avoid modifiying tape 3. Ideally, tape 3 should be symbolically updated and these three absolute patches removed.) This version of DDT is assembled from tapes lb, 2b, (i.e., 2Bol and 2B.2) and 3

-5DDT FOR LOGIC OF COMPUTERS PDP-7 TAPE 2B.1 OF 3 /REVISED 10 JUNE 1967 RONALD F. BRENDER 1 6000-355-30- 110/ ZORCH, LAC 17762 AND ZORCHE XOR XFS DAC XFS AND ZORCHE XOR FSY DAC FSY ADD SYMiEND DAC SYMEND LAC DSPDDT+6 DAC 1 7662 LAC DSPDDT+7 DAC 17663 LAC DSPDDT+10 DAC 17664 LAC ZORCHE+ DAC DONE,JMP 17610 ZORCHE- 1 0000 JMP GO

-6/SOME SYMBOLS FOR DDT S PERMANENT TABLE 1 6000-355-110/ 8ST, 40000 0 JMP PERIOD 157014 34124S5 JMP PUNCHE 141432 7002845 JMP INPUT 214024 064500 JMP ZERO 240260 240245 JMP STARTA 012460 324500 JMP TRAPP CETI, 304650 062245 JMP AAR 110660 444500 JMP LOAD 016046 224045 JMP TABLE 224046 702 645 JMP DEBUG 363022 224500 JMP KLL 354500 000000 JMP QAN 1 60614 500245 JMP CNS 245216 460645 JMP SYM 033402 6S0245 JMP OCT 124022 6002 45 JMP RLT 304444 244045 JMP ADR 0606026 450000 JMP NWD 310624 444500 JMP WOD 304500 000000 LAC AC 234500 000000 LAC BPV 514500 000000 CL 474500 000000 M 174500 000000 LAC VAL 124500 000000 LAC PSX 264500 000000 LAC FSY 164500 000000 LAC I CUR FST, 0 0 CUR, ~ 1 0 B PV._ 1 VAL, 0' FA, 0 TBC, 0 POI, 0 AC* 0 CL, 0 Ms -0 0 17777 SYMENDs CUR-BST FSYs XOR BST -10000

-7RFBRFB - /THE FOLLOWING ARE MODIFICATIONS INTENDED TO FACILITATE THE /USE OF PDP-7 DDT WITH "INTERRUPTS ON" TYPE PROGRAMS. A WRITE-UP /OF THESE CHANGES AND USAGE CONVENTIONS WILL BE FOUND IN THE /SYSTEM LISTINGS. 10 JUNE 1967 RON BRENDER SAVI OSw 0 /INPUT-OUTPUT STATUS MEMORY TPF, 0 /TELEPRINTER FLAG MEMORY TC, 700000 CD, 0. PATCH, IORS IOF DAC SAVI.OS LAC TC DAC CD ISZ CD JMP. - 1 /WAIT ABOUT 100 MILLISEC DZM TPF /CLEAR TELEPRINTER INDICATOR TSF ISZ TPF /INCREMENT I F TELEPRINTER FLAG DOWN LAC BPX JMP BPY+.STIONs DZM FIXIOK ISZ FIXIOK /RETURN WITH INTERRUPTS ON SKP * STIOCs DZM FIXIOK /RETURN WITH INTERRUPTS ON IF ON AT BREAKPOINT ISZ FIXIOK SKP ~STIOF, DZM FIXIOK /RETURN WITH INTERRUPTS OFF JMP XXI+1 FIXIOK, 0 /THIS ALLOWS # TYPE COMMANDS TO BE EXECUTED WITHOUT SETTING UP /THE INTERRUPT STATUS. GOBB, DZM PRC JMS TCR LAC I BPV JMP GOB+3

-8/CONSTANTS - THIS IS DONE TO AVOID INTRODUCING NEW CONSTANTS /AT THE END OF THE PROGRAM - HOW MUCH ROOM IS THERE, I SIMPLY /COULD NOT DETERMINE. FIXIOl, I FIXI02, 2 FIXIOJ, JMP I FIXIOT FIXIOT, FIXIOF FIXIOC FIXION FSTION, -STION FSTIOC,.9STIOC FSTIOF,.*STIOF /THIS IS WHERE THE NORMAL EXIT TO USER PROGRAM PASSES. /THE INTERRUPT STATUS IS SET JUST BEFORE TRANSFERRING TO THE /DESIRED LOCATION FIXIOI LAC VAL SAD FSTION JMP NOTP SAD FSTIOC JMP NOTP SAD FSTIOF JMP NOTP LAC FIXIOK TAD FIXIOJ /(JMP I FIXIOT) DAC.+1 HLT HLT FIXIOC, LAC SAVIOS SPA FIXION, ION FIXIOF* JMP NOTP /NORMALLY SKIP THE TELEPRINTER CHECK. THIS /CHECK MAY BE INVOKED BY REPLACING THIS WORD /WITH A'NOP'. LAC TPF RAR LAW 377 SNL TLS NOTP, LAC I BPV JMP GOB+3 RFBRFB+ I 0/

-9/A PATCH TO TAPE 3 OF 3 (DDT) RFB... =. /THIS GOES AT "OTY" I 72 50/ 0 JMS 15676 /IE. "JMS BTA" TU S TSF JMP.- 1 TCF JMP I 17250 /THIS GOES AT "XXI-I" 16634/ JiP GOBB /THIS GOES AT "BPY" 16550/ JMP *PATCsH RFB. *./ PAUSE

UNIVERSITY OF MICHIGAN 3 9015 02082 7690