[SSEM Simulator] [-------------------------------------------------------------- Unlike the original, this one displays data (in tanks 2 & 3) with LSB on right and lower addresses below higher ones. Also, we use all 35 bits of a line (for now). --------------------------------------------------------------] [M3] PFGKIFAFRDLFUFOFE@A6FG@E8FEZPF * @&!!!!!!!SSEM#A*MESS!SIMULATOR @&!!!!!LONG!TANKS!#2!*AND!#3*!SHOW @&!!!!!!!!!!!#K*REVERSED#L* @&!CONTENTS!OF!#K35A*BIT#L*!SSEM!STORE @&LINE!#62C!K35A*BIT#L*!ACCUMULATOR @&LINE!#60C!K35A*BIT#L*!CONTROL!INSTRUCTION @&LINE!#58C!K35A*BIT#L*!PRESENT!INSTRUCTION @& @&PRESS!RESET!TO!RUN!PROGRAM! ..... [ put M1 at 160 ] P K T160K [M1] GK H2FTFA42FC42FU42FA8FU22FA15@AFH8F T45FA10@A2FT10@E34FNFT44K P 128 F [ loc. of jump table (ref. orders) ] T 180 K [ loc. of actual code (immed? after M1) ] ..... P Z G K E 160 K T F [ H number sequence: constants ] [ assume that sandwich bit is zero (ok?) ] [ 0 ] V2047D [ ┐ SSEM arithmetic mask (32 LS bits) ] [ 1 ] E2047D [ ┘ (long all 1's w/o sandwich bit) ] [ (unused in current version) ] [ 2 ] K F [ SSEM function bits mask (0x0e000) ] [ 3 ] P 15 D [ SSEM address bits mask (0x0001f) ] [ 4 ] U 3 F [ adjusts "A m F" to "E m+3 F" ] [ 5 ] &2047F [ adjusts "E m+3 F" to "A m+2 F" ] [ 6 ] P D [ ┐ long integer value 1 ] [ 7 ] P F [ ┘ ] [ 8 ] P 64 F [ base location of SSEM store ] [ 9 ] A F [ skeleton "add word" order ] [ 10 ] S D [ skeleton "subtract long word" order ] [ 11 ] T D [ skeleton "store long word" order ] [ 12 ] A D [ skeleton "add long word" order ] ..... P Z G K E 160 K T F [ N number sequence: SSEM function jump table ] [ 0 ] G 3 ! [ function 0: s, C ] [ 1 ] G 4 ! [ function 1: c + s, C ] [ 2 ] G 5 ! [ function 2: -s, A ] [ 3 ] G 6 ! [ function 3: a, S ] [ 4 ] G 7 ! [ function 4: a - s, A ] [ 5 ] G 7 ! [ function 5: (same - undocumented) ] [ 6 ] G 8 ! [ function 6: Test ] [ 7 ] G 9 ! [ function 7: Stop ] [ 8 ] G N [ skeleton jump table access ] ..... P Z G K T 170 K T ! E 160 K I F [ Master routine] [ 0 ] A 43 F [ ┐ ] [ 1 ] R D [ │ set sandwich bit in ] [ 2 ] A #H [ │ SSEM arithmetic mask ] [ 3 ] T #H [ ┘ (for possible future use) ] [ 4 ] A 4 @ [ ┐ ] [ 5 ] G 2 ! [ ┘ read SSEM program ] [ 6 ] P 64 F [ parameter for auxiliary #2 ] [ 7 ] Z F [ wait for reset to execute pgm ] [ fetch-execute cycle ] [ Note: all SSEM function routines clear acc. ] [ 26->8 ] A 60 D [ ┐ ] [ 9 ] A 6#H [ │ increment CI ] [ 10 ] T 60 D [ ┘ ] [ 11 ] H 3 H [ ┐ ] [ 12 ] C 60 F [ │ get location of SSEM ] [ 13 ] L 1 F [ │ instruction at CI ] [ 14 ] A 8 H [ ┘ ] [ 15 ] A 9 H [ ┐ ] [ 16 ] T 17 @ [ │ get SSEM instruction ] [ 17(] A F [) │ and store in PI ] [ 18 ] T 58 F [ ┘ ] [ 19 ] H 2 H [ ┐ get SSEM function bits ] [ 20 ] C 58 F [ ┘ ] [ 21 ] R 1024 F [ ┐ ] [ 22 ] A 8 N [ │ plant subroutine jump ] [ 23 ] T 25 @ [ ┘ ] [ 24 ] A 24 @ [ ┐ call appropriate subroutine ] [ 25(] G N [) ┘ via jump table N ] [ZF optional breakpoint (for single-stepping) ] [ 26 ] E 8 @ [ fetch next SSEM instruction ] [ 27 ] Z F [ never reached ] ...... P Z G K E 160 K P F [ auxiliary #1 ] [ read a single 12-digit octal number into arg loc. ] [ (accumulator zero on return) ] [ 0 ] A 4 H [ ┐ plant link ] [ 1 ] U 20 @ [ ┘ ] [ 2 ] A 5 H [ ┐ ] [ 3 ] T 4 @ [ │ form "store result" order ] [ 4(] A @ [) │ ] [ 5 ] A 21 @ [ ┘ ] [ 6 ] T 19 @ [ plant "store result" order ] [ 7 ] T 26#@ [ clear result ] [ 8 ] S 22 @ [ load neg. digit count ] [ 17->9 ] T 23 @ [ save neg. digit count ] [ 10 ] A 26#@ [ load result ] [ 11 ] L 2 F [ ┐ ] [ 12 ] I 24 @ [ │ result := 8 * result + new digit ] [ 13 ] A 24#@ [ ┘ ] [ 14 ] T 26#@ [ save result ] [ 15 ] A 23 @ [ load neg. digit count ] [ 16 ] A 2 F [ increment count ] [ 17 ] G 9 @ [ get next digit (if count < 0) ] [ 18 ] A 26#@ [ get result ] [ 19(] T D [) store result ] [ 20(] Z F [) link ] [ 21 ] T D [ skeleton "store result" order ] [ 22 ] P 12 F [ # of digits to read ] [ 23(] P F [) current count (neg. actual count) ] [ 24(] P F [) ┐ storage for input digits ] [ 25(] P F [) ┘ ] [ 26(] P F [) ┐ storage for result ] [ 27(] P F [) ┘ ] ..... P Z G K E 160 K P F [ auxiliary #2 ] [ read 32 octal nos. & store, starting at arg ] [ (accumulator zero on return) ] [ 0 ] A 4 H [ ┐ plant link ] [ 1 ] U 17 @ [ ┘ ] [ 2 ] A 5 H [ get parm (starting store location)] [ 3 ] T 4 @ [ ┐ ] [ 4(] A @ [) │ plant starting store location ] [ 5 ] T 10 @ [ ┘ ] [ 6 ] S 18 @ [ load neg. iteration count ] [ 16->7 ] T 19 @ [ save neg. iteration count ] [ 8 ] A 8 @ [ ┐ read single octal number ] [ 9 ] G 1 ! [ ┘ ] [ 10(] P F [) parameter for auxiliary #1 ] [ 11 ] A 10 @ [ ┐ ] [ 12 ] A 20 @ [ │ increment store location ] [ 13 ] T 10 @ [ ┘ ] [ 14 ] A 19 @ [ load neg. iteration count ] [ 15 ] A 2 F [ increment count ] [ 16 ] G 7 @ [ get next number (if count < 0) ] [ 17(] Z F [) link ] [ 18 ] P 32 F [ 32 iterations required ] [ 19(] P F [) current count (neg. actual count) ] [ 20 ] P 2 F [ 2 EDSAC words per SSEM word ] ..... P Z G K E 160 K P F [ auxiliary #3 ] [ function code 0: s, C ] [ 0 ] A 3 F [ ┐ plant link ] [ 1 ] T 10 @ [ ┘ ] [ 2 ] H 3 H [ ┐ ┐ ] [ 3 ] C 58 F [ │ compute store │ form and plant ] [ 4 ] L 1 F [ │ address from PI │ appropriate ] [ 5 ] A 8 H [ ┘ │ operation order ] [ 6 ] A 12 H [ ┐ form & plant │ ] [ 7 ] T 8 @ [ ┘ "load" order ┘ ] [ 8(] A D [) s to accumulator ] [ 9 ] T 60 D [ s to CI ] [ 10(] Z F [) link ] ..... P Z G K E 160 K P F [ auxiliary #4 ] [ function code 1: c + s, C ] [ 0 ] A 3 F [ ┐ plant link ] [ 1 ] T 11 @ [ ┘ ] [ 2 ] H 3 H [ ┐ ┐ ] [ 3 ] C 58 F [ │ compute store │ form and plant ] [ 4 ] L 1 F [ │ address from PI │ appropriate ] [ 5 ] A 8 H [ ┘ │ operation order ] [ 6 ] A 12 H [ ┐ form & plant │ ] [ 7 ] T 8 @ [ ┘ "load" order ┘ ] [ 8(] A D [) s to accumulator ] [ 9 ] A 60 D [ c + s to accumulator ] [ 10 ] T 60 D [ c + s to CI ] [ 11(] Z F [) link ] ..... P Z G K E 160 K P F [ auxiliary #5 ] [ function code 2: -s, A ] [ 0 ] A 3 F [ ┐ plant link ] [ 1 ] T 10 @ [ ┘ ] [ 2 ] H 3 H [ ┐ ┐ ] [ 3 ] C 58 F [ │ compute store │ form and plant ] [ 4 ] L 1 F [ │ address from PI │ appropriate ] [ 5 ] A 8 H [ ┘ │ operation order ] [ 6 ] A 10 H [ ┐ form & plant │ ] [ 7 ] T 8 @ [ ┘ subtraction order ┘ ] [ 8(] S D [) -s to accumulator ] [ 9 ] T 62 D [ -s to SSEM accumulator ] [ 10(] Z F [) link ] ..... P Z G K E 160 K P F [ auxiliary #6 ] [ function code 3: a, S ] [ 0 ] A 3 F [ ┐ plant link ] [ 1 ] T 10 @ [ ┘ ] [ 2 ] H 3 H [ ┐ ┐ ] [ 3 ] C 58 F [ │ compute store │ form and plant ] [ 4 ] L 1 F [ │ address from PI │ appropriate ] [ 5 ] A 8 H [ ┘ │ operation order ] [ 6 ] A 11 H [ ┐ form & plant │ ] [ 7 ] T 9 @ [ ┘ store order ┘ ] [ 8 ] A 62 D [ SSEM accumulator to accumulator ] [ 9(] T D [) SSEM accumulator to Store ] [ 10(] Z F [) ] ..... P Z G K E 160 K P F [ auxiliary #7 ] [ function codes 4 & 5: a - s, A ] [ 0 ] A 3 F [ ┐ plant link ] [ 1 ] T 11 @ [ ┘ ] [ 2 ] H 3 H [ ┐ ┐ ] [ 3 ] C 58 F [ │ compute store │ compute and ] [ 4 ] L 1 F [ │ address from PI │ plant appropriate ] [ 5 ] A 8 H [ ┘ │ operation order ] [ 6 ] A 10 H [ ┐ form & plant │ ] [ 7 ] T 8 @ [ ┘ subtraction order ┘ ] [ 8(] S D [) -s to accumulator ] [ 9 ] A 62 D [ SSEM accumulator - s to accumulator ] [ 10 ] T 62 D [ SSEM accumulator - s to SSEM accumulator ] [ 11(] Z F [) link ] ..... P Z G K E 160 K P F [ auxiliary #8 ] [ function code 6: Test ] [ 0 ] A 3 F [ ┐ plant link ] [ 1 ] T 9 @ [ ┘ ] [ 2 ] A 62 D [ SSEM accumulator to accumulator ] [ 3 ] E 8 @ [ return if >= 0 ] [ 4 ] T F [ clear accumulator ] [ 5 ] A 60 D [ ┐ ] [ 6 ] A 6#H [ │ increment CI ] [ 7 ] T 60 D [ ┘ ] [ 3->8 ] T F [ clear accumulator ] [ 9(] Z F [) link ] ..... P Z G K E 160 K P F [ auxiliary #9 ] [ function code 7: Stop ] [ 0 ] Z F [ send control to master routine ] E 25 K E ! P F [- data set #1 -] [ counting loop (for testing) ] [ 0:] 000000000000 [ -- ] [ zero ] [ 1:] 000000040035 [ -29,A ] [ 2:] 000000100031 [ a-25,A ] [ 3:] 000000060032 [ a,26 ] [ 4:] 000000040032 [ -26,A ] [ 5:] 000000060035 [ a,29 ] [ 6:] 000000120034 [ a-28,A ] [ 7:] 000000140000 [ Test ] [ 8:] 000000020031 [ c+25,C ] [ start next pass ] [ 9:] 000000020033 [ c+27,C ] [ alternate: 000000000033 27,C ] [10:] 000000040025 [ -21,A ] [11:] 000000060010 [ a,8 ] [ Stop inst. to 8 ] [12:] 000000040026 [ -22,A ] [13:] 000000060005 [ a,5 ] [ a,30 to 5 ] [14:] 000000040027 [ -23,A ] [15:] 000000060001 [ a,1 ] [ -30,A to 1 ] [16:] 000000000000 [ 0,C ] [ second pass ] [17:] 000000000000 [18:] 000000000000 [19:] 000000000000 [20:] 000000000000 [21:] 377777620000 [ neg. Stop ] [22:] 377777717742 [ neg. a,30 ] [23:] 377777737742 [ neg. -30,A ] [24:] 000000000000 [ -- ] [25:] 000000000001 [ one ] [26:] 000000000000 [ -- ] [27:] 377777777767 [ -9 ] [ alternate: 000000000000 ] [28:] 000000000377 [ 255 ] [ max count ] [29:] 000000000000 [ -- ] [ counter: first pass ] [30:] 000000000000 [ -- ] [ counter: second pass ] [31:] 000000000000 [- end of data -] [- data set #2 -] [---------------------------------------------- Code for Kilburn's Highest Factor Routine (the world's first working program: 21 June 1948) 18 July 1948 version (from G. C. Toothill notebook) ---------------------------------------------] 000000000000 [ 0: -- ] 000000040030 [ 1: -24, A ] 000000060032 [ 2: a, 26 ] 000000040032 [ 3: -26, A ] 000000060033 [ 4: a, 27 ] 000000040027 [ 5: -23, A ] 000000100033 [ 6: a-27, A ] 000000140000 [ 7: Test ] 000000020024 [ 8: c+20, C ] 000000100032 [ 9: a-26, A ] 000000060031 [10: a, 25 ] 000000040031 [11: -25, A ] 000000140000 [12: Test ] 000000160000 [13: Stop ] 000000040032 [14: -26, A ] 000000100025 [15: a-21, A ] 000000060033 [16: a, 27 ] 000000040033 [17: -27, A ] 000000060032 [18: a, 26 ] 000000000026 [19: 22, C ] 377777777775 [20: -3 ] 000000000001 [21: 1 ] 000000000004 [22: 4 ] 377777000000 [23: -(2**18) ] 000000777777 [24: (2**18) - 1 ] 000000000000 [25: -- ] 000000000000 [26: -- ] 000000000000 [27: -- ] 000000000000 [28: -- ] 000000000000 [29: -- ] 000000000000 [30: -- ] 000000000000 [31: -- ] [- end of data -]