*** Instructions, how to fill a PDP-11 memory over blinkenlight console *** Generated by PDP11GUI v 1.34.0.1594 (debug), 14.06.2012 12:24:20 *************** Memory content to dump ********************** 1 ; This program reads n >= 0 from console, sums up the first n nonnegative 2 ; integers, halts and displays the result on console. 3 ; The sum turns out to be n*(n+1)/2, which does not fit in a word for 4 ; n > sqrt(2N). For n < = 361, the result is < 2^16 and fits in one word. 5 ; Registers R1 holds the sum. 6 ; R0 counts from 1 to R2. 7 8 ; This program requires an PDP-11/40. On HALT it displays R0 on the DATA LEDs 9 ; On QBus machines (LSI11, 11/23, '53, '73, '93), the 10 ; switch/display register 177570 is not implemented, 11 ; resulting in a trap (UNIBUS timeout) 12 13 177570 sr = 177570 ; switch register 14 15 .asect 16 001000 .=1000 ; program loads at 1000 17 18 start: 19 001000 013702 177570 mov @#sr,r2 ; r2 = n (read n from switch register) 20 001004 005000 clr r0 ; r0 = 0 ; // counter 21 001006 005001 clr r1 ; r1 = 0 ; // sum 22 loop: ; do { 23 001010 005200 inc r0 ; r0++ ; 24 001012 060001 add r0,r1 ; r1 += r0 ; 25 001014 020002 cmp r0,r2 ; } while (r0 != r2) ; 26 001016 001374 bne loop 27 28 disp: 29 001020 010100 mov r1,r0 ; display sum. Will overflow, if input > 361. 30 001022 000000 halt ; console operator must press continue switch now! 31 32 001024 000765 br start ; execute program again 32 ************************************************************* Phase 1 - Preparation --------------------- - Set all switches to normal position. - Set HALT/RUN switch to HALT position. - Power ON. - Perform a lamp test. - Machines like PDP-11/70: Set upper rotary switch to "CONS PHY" and lower rotary switch to "DATA PATH". Phase 2 - Enter data -------------------- Step 2.1 To do: Initialize current address to 001000 How: Set all switches DOWN, then switch 9 UP. Then press LOAD ADRS. Check: LED display = _ ___ __ __ ___ __ __ ___ __ __ ___ __ __ ___ __ __ _ ADDRESS [_._|_.__.__._|_.__.__O_|_.__.__._|_.__.__._|_.__.__._] 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Step 2.2 To do: Fill memory at address 001000 with value 013702 How: Set all switches DOWN, then switches 12,10-6,1 UP. Then raise DEP. Check: LED display = _ ___ __ __ ___ __ __ ___ __ __ ___ __ __ ___ __ __ _ ADDRESS [ . | . . . | . . O | . . . | . . . | . . . ] DATA [_._|_.__.__O_|_.__O__O_|_O__O__O_|_.__.__._|_.__O__._] 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Step 2.3 To do: Fill memory at address 001002 with value 177570 How: Set all switches DOWN, then switches 15-8,6-3 UP. Then raise DEP. Check: LED display = _ ___ __ __ ___ __ __ ___ __ __ ___ __ __ ___ __ __ _ ADDRESS [ . | . . . | . . O | . . . | . . . | . O . ] DATA [_O_|_O__O__O_|_O__O__O_|_O__.__O_|_O__O__O_|_.__.__._] 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Step 2.4 To do: Fill memory at address 001004 with value 005000 How: Set all switches DOWN, then switches 11,9 UP. Then raise DEP. Check: LED display = _ ___ __ __ ___ __ __ ___ __ __ ___ __ __ ___ __ __ _ ADDRESS [ . | . . . | . . O | . . . | . . . | O . . ] DATA [_._|_.__.__._|_O__.__O_|_.__.__._|_.__.__._|_.__.__._] 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Step 2.5 To do: Fill memory at address 001006 with value 005001 How: Set all switches DOWN, then switches 11,9,0 UP. Then raise DEP. Check: LED display = _ ___ __ __ ___ __ __ ___ __ __ ___ __ __ ___ __ __ _ ADDRESS [ . | . . . | . . O | . . . | . . . | O O . ] DATA [_._|_.__.__._|_O__.__O_|_.__.__._|_.__.__._|_.__.__O_] 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Step 2.6 To do: Fill memory at address 001010 with value 005200 How: Set all switches DOWN, then switches 11,9,7 UP. Then raise DEP. Check: LED display = _ ___ __ __ ___ __ __ ___ __ __ ___ __ __ ___ __ __ _ ADDRESS [ . | . . . | . . O | . . . | . . O | . . . ] DATA [_._|_.__.__._|_O__.__O_|_.__O__._|_.__.__._|_.__.__._] 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Step 2.7 To do: Fill memory at address 001012 with value 060001 How: Set all switches DOWN, then switches 14-13,0 UP. Then raise DEP. Check: LED display = _ ___ __ __ ___ __ __ ___ __ __ ___ __ __ ___ __ __ _ ADDRESS [ . | . . . | . . O | . . . | . . O | . O . ] DATA [_._|_O__O__._|_.__.__._|_.__.__._|_.__.__._|_.__.__O_] 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Step 2.8 To do: Fill memory at address 001014 with value 020002 How: Set all switches DOWN, then switches 13,1 UP. Then raise DEP. Check: LED display = _ ___ __ __ ___ __ __ ___ __ __ ___ __ __ ___ __ __ _ ADDRESS [ . | . . . | . . O | . . . | . . O | O . . ] DATA [_._|_.__O__._|_.__.__._|_.__.__._|_.__.__._|_.__O__._] 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Step 2.9 To do: Fill memory at address 001016 with value 001374 How: Set all switches DOWN, then switches 9,7-2 UP. Then raise DEP. Check: LED display = _ ___ __ __ ___ __ __ ___ __ __ ___ __ __ ___ __ __ _ ADDRESS [ . | . . . | . . O | . . . | . . O | O O . ] DATA [_._|_.__.__._|_.__.__O_|_.__O__O_|_O__O__O_|_O__.__._] 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Step 2.10 To do: Fill memory at address 001020 with value 010100 How: Set all switches DOWN, then switches 12,6 UP. Then raise DEP. Check: LED display = _ ___ __ __ ___ __ __ ___ __ __ ___ __ __ ___ __ __ _ ADDRESS [ . | . . . | . . O | . . . | . O . | . . . ] DATA [_._|_.__.__O_|_.__.__._|_.__.__O_|_.__.__._|_.__.__._] 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Step 2.11 To do: Fill memory at address 001022 with value 000000 How: Set all switches DOWN. Then raise DEP. Check: LED display = _ ___ __ __ ___ __ __ ___ __ __ ___ __ __ ___ __ __ _ ADDRESS [ . | . . . | . . O | . . . | . O . | . O . ] DATA [_._|_.__.__._|_.__.__._|_.__.__._|_.__.__._|_.__.__._] 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Step 2.12 To do: Fill memory at address 001024 with value 000765 How: Set all switches DOWN, then switches 8-4,2,0 UP. Then raise DEP. Check: LED display = _ ___ __ __ ___ __ __ ___ __ __ ___ __ __ ___ __ __ _ ADDRESS [ . | . . . | . . O | . . . | . O . | O . . ] DATA [_._|_.__.__._|_.__.__._|_O__O__O_|_O__O__._|_O__.__O_] 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Phase 3 - Verify data --------------------- Step 3.1 - 3.12 To do: Read the memory again and verify content. How: Repeat steps 2.1. - 2.12., but press the EXAM switch instead of raising DEP. Check: The LED patterns must be look like shown above. Phase 4 - Program control ------------------------- Step 4.1 To do: Set program start address to 001000 How: Set all switches DOWN, then switch 9 UP. Then press LOAD ADRS. Check: LED display = _ ___ __ __ ___ __ __ ___ __ __ ___ __ __ ___ __ __ _ ADDRESS [_._|_.__.__._|_.__.__O_|_.__.__._|_.__.__._|_.__.__._] 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Step 4.2 To do: Start program with arguments. Enter data over switches, Reset UNIBUS and start CPU. How: Set ENABLE/HALT switch to the ENABLE position. Set the DATA switches as desired. Depress and release the START switch. Check: RUN LED goes ON. If program stops by running onto HALT, RUN LED is OFF again. Step 4.3 To do: HALT, single step and continue CPU How: To halt a running program, set ENABLE/HALT switch to the HALT position. Check: Run LED goes OFF. How: To single step, leave ENABLE/HALT in HALT position, and press CONT for each program step. How: To start the program again, set ENABLE/HALT switch to ENABLE. Check: Run LED goes ON.