Scheme C PERM & the Routine Changing Sequence    Date: Aug 1952
     
    Written by R.A Brooker 

    from Programming the mark I: Early Programming Activity at the 
    University of Manchester (author: Martin Campbell-Kelly)

        Scheme A              Spring 1951   By A.Turing
        Scheme B              Spring 1952   Brooker and Glennie
        TELEINPUT (Scheme C)  Early 1953    Brooker

    Ferranti Mark I Programming Manual, third edition 
    Bodleian Special Collection 
    MS. Eng. misc. b. 260-C.41.pdf
    p32, p43
     
    Explanation on how to use Scheme B can be found in Programming Manual 
    Third edition: p31-p116 (section Chapter 3. Programming)
    
    [Routine TELEINPUT ]

    [Col     / ]                        [        E   Track 16L ] 
    
    | / | HSI/ |                        | / | S:/H |
    | E | Z//: |                        | E | E/T/ | \
    | @ | //ZO | sets B1 <- Enter       | @ | :ATD | ! forms & plants write check
    | A | E//: | transfers PERM         | A | @/TA | /
    | : | CA/: | transfers DIRECTORY    | : | E//: | obeys mag instr
    | S | XEO: | <-+                    | S | @//: | checks
    | I | S//: |   ! input cycle: test  | I | /A/: | signals line feed
    | U | V:/J |   ! for warning chars, | U | #E/P | in case of failure
    | # | S:/H | --+ i.e. >= 15         | # | AR/L | \                
    | D | ///A | \                      | D | S:/P | /    
    | R | J:/C | ! a //// is formed     | R | //P/ | \ <-P transfers false     
    | J | ///N | ! and sent to B7, a    | J | E/TA | / line to E/                           
    | N | ///A | ! being the char read  | N | E/T/ | \ <-Q                     
    | F | //QO | /                      | F | IATR | ! address given in false  
    | C | /AUP | multiway switch        | C | @/TA | ! line is sent to B5      
    | K | S//: | \ <-KTPQM              | K | @/YO | /                         
    | T | V:/C | !                      | T | //Y/ | \                         
    | Z | ///A | ! read next 2          | Z | E/TC | ! corrects false line     
    | L | ///N | ! chars ab             | L | @/TN | /                         
    | W | S//: | /                      | W | E/TA |                           
    | H | ///A |                        | H | Y@UP | 2-way switch              
    | Y | L@UP | multiway switch        | Y | H:/C | \                         
    | P | ///N | \ <-Q,M                | P | ///N | ! forms ab// and          
    | Q | S//: | ! reads two further    | Q | ///A | ! transfers this to B6    
    | O | ///A | ! chars, cd, and       | O | E/PO | !                         
    | B | ///N | ! forms abcd in E/     | B | V:/C | /                         
    | G | S//: | !                      | G | T@UP | 3-way switch              
    | " | ///A | /                      | " | S//: | \ reads 4th char of K     
    | M | T@UP | 2 way switch           | M | DS/J | ! sequence and sets       
    | X | //T/ | <-Q,M test if abcd     | X | ///U | / counter                        
    | V | :ATR | is a special of        | V | S//: | \                         
    | $ | O:TN | check instruction      | $ | ///A | !                         
                                        
                                        
                                        
                                     
                                     
    [Col     @ ]                        [        A   Track 16R ] 
    
    | / | ///N | !                      | / | GEW/ |
    | E | S//: | ! reads and assembles  | E | T@// |                                   
    | @ | ///A | ! the 4 chars of an    | @ | HE// |
    | A | ///N | ! instruction          | A | HE// |
    | : | S//: | !                      | : | //N/ | constants
    | S | ///A | !                      | S | //H/ |
    | I | ///N | !                      | I | $$// |
    | U | S//: | !                      | U | DE// |
    | # | ///A | /                      | # | JE// |   
    | D | E/QO | <-P transf inst to B7  | D | HE// |
    | R | DSPG | \ transfeers to store  | R | Y/// | 
    | J | $$PZ | /                      | J |      |   
    | N | V:TN | adjust counter         | N | #@// |
    | F | S//H | tests for end of seq   | F | M/// |
    | C | S:/P | returns to input cycle | C | K/@N | MAG INSTR dir to tubes 6,7
    | K | C@/V | \ hoot stop            | K | Y/// |
    | T | K@/P | /                      | T | C/// |
    | Z | E//P | quits TELEINPUT        | Z | C/// |
    | L |      |                        | L | :/// |
    | W |      |                        | W | :/// |
    | H |      |                        | H | :/// |
    | Y |      |                        | Y | C@// |
    | P |      |                        | P | :/// |
    | Q |      |                        | Q | C/// |     
    | O |      |                        | O | C/// |
    | B |      |                        | B | :/// |
    | G |      |                        | G | ://G | G stop
    | " |      |                        | " | BA/P |
    | M |      |                        | M | :/// |
    | X |      |                        | X | C/// |
    | V |      |                        | V | :/// |   
    | $ |      |                        | $ | :/// |
                                              
    [End]
    
Warning Chars

K ab c aaaa bbbb ...    [ab]=aaaa, [ab+1]=bbbb ... [ab+c]=eeee. if c=/, enter 32 values
M abcd                  Obey abcd as magnetic instruction (no effect if not a transfer)
T ab                    transfer control to addr ab+1
G                       Dummy Stop if /G switch is on (press prepulse to continue)
H                       enter in Continuous hoot
P ab                    set parameter
                        if [ab]=nnxx  -> replace nn by //, then add [nn]
                                         e.g. [ab]=AA/E,  [AA]=BBC/
                                         then Pab -> [ab]=BBCE
Q abcd                  obey //cd + [ab] as magnetic instruction

call a routine and return to teleimput:

K PS @ ab// magi        magi=mag instr that loads the routine to mem, ab=routine entry
T CS

                        the char / and C (or any char < K) works as no-operation 
    
   0  //  HSI/
   1  E/  Z//:  mag Instr: Read PERM from Track 17L to Tube S2
   2  @/  //ZO  Entry point: B1=HSI/ -> set B1=stack pointer to top of stack at HS addr
   3  A/  E//:  Read in PERM: from Track 17L to Tube S2
   4  :/  CA/:  Read in DIRECTORY: from Track 15L to Tube S6 S7

                Read Next warning char:
   5  S/  XEO:  A=0
   6  I/  S//:  Read PTR
   7  U/  V:/J  AM=AM+//// ///E
   8  #/  S:/H  if (A>=0) goto 5 -> goto 5 if chr < 15

   9  D/  ///A  [//]=ch read + ///E
  10  R/  J:/C  D=/E// ////
  11  J/  ///N  shift -> AL=0, AM=c///, c=char+1
  12  N/  ///A  [//]=ch read + 1 
  13  F/  //QO  B7=ch read + 1 
  14  C/  /AUP  goto 15 if (wch='M' -> B7=X///) 
                goto 122 if (wch='G' -> B7="///) 
                goto 15 if (wch='T' -> B7=Z///) 
                goto 79 if (wch='H' -> B7=Y///) 

                read ab param for warning char
  15  K/  S//:  Read PTR
  16  T/  V:/C  D=S
  17  Z/  ///A
  18  L/  ///N
  19  W/  S//:  Read PTR
  20  H/  ///A  [//]=//ab param
  21  Y/  L@UP  goto 22 if (wch='M' -> B7=X///) 
                goto 53 if (wch='T' -> B7=Z///) 
                goto 53 if (wch='K' -> B7=T///) 

                read cd param for warning char
  22  P/  ///N  Read PTR
  23  Q/  S//:    
  24  O/  ///A
  25  B/  ///N
  26  G/  S//:  Read PTR
  27  "/  ///A
  28  M/  T@UP  goto 29 if (wch='M' -> B7=X///) 

                Warning char M abcd -> exec read mag instr
  29  X/  //T/
  30  V/  :ATR
  31  $/  O:TN    
  32  /E  S:/H
  33  EE  E/T/
  34  @E  :ATD
  35  AE  @/TA
  36  :E  E//:  Exec mag instr
  37  SE  @//:  Check mag instr, goto 40 if ok
  38  IE  /A/:
  39  UE  #E/P

  40  #E  AR/L  Stop /L  
  41  DE  S:/P  goto 5 -> read next wrning char

  42  RE  //P/
  43  JE  E/TA    
  44  NE  E/T/
  45  FE  IATR
  46  CE  @/TA
  47  KE  @/YO
  48  TE  //Y/
  49  ZE  E/TC
  50  LE  @/TN
  51  WE  E/TA
  52  HE  Y@UP

  53  YE  H:/C  D=//// //E/
  54  PE  ///N  Shift
  55  QE  ///A  
  56  OE  E/PO  B6=ab// warning char param
  57  BE  V:/C  D=//// ///E
  58  GE  T@UP  goto 81 if (wch='T' -> B7=Z///) 
                goto 59 if (wch='K' -> B7=T///) 

  59  "E  S//:  Read PTR -> get word cound param for warning char "K ab c wwww ...."
  60  ME  DS/J  decr am
  61  XE  ///U

  62  VE  S//:  Read w1 
  63  $E  ///A
  64  /@  ///N
  65  E@  S//:  Read w2
  66  @@  ///A
  67  A@  ///N
  68  :@  S//:  Read w3
  69  S@  ///A
  70  I@  ///N
  71  U@  S//:  Read w4
  72  #@  ///A
  73  D@  E/QO  B7=wwww word given in K warning char
  74  R@  DSPG  incr B6 -> addr to store word
  75  J@  $$PZ  [B6-1]=B7=wwww
  76  N@  V:TN  decr count of word in AL
  77  F@  S//H  if (A>=0) goto 62 -> read & store next word
  78  C@  S:/P  goto 5 -> read next wrning char

  79  K@  C@/V  Hoot-> perform continuous hoot   
  80  T@  K@/P  goto 79

  81  Z@  E//P  goto 175 -> transfer to addr given as param
  82  L@      
  83  W@  
  84  H@  
  85  Y@  
  86  P@  
  87  Q@  
  88  O@  
  89  B@  
  90  G@  
  91  "@  
  92  M@  
  93  X@  
  94  V@  
  95  $@  
  96  /A  GEW/
  97  EA  T@//
  98  @A  HE//
  99  AA  HE//
 100  :A  //N/
 101  SA  //H/
 102  IA  $$//
 103  UA  DE//
 104  #A  JE//
 105  DA  HE//
 106  RA  Y///
 107  JA      
 108  NA  #@//
 109  FA  M///
 110  CA  K/@N
 111  KA  Y///
 112  TA  C///
 113  ZA  C///
 114  LA  :///
 115  WA  :///
 116  HA  :///
 117  YA  C@//
 118  PA  :///
 119  QA  C///
 120  OA  C///
 121  BA  :///
 122  GA  ://G  Stop /G
 123  "A  BA/P  goto 5 -> read next wrning char
 124  MA  :///
 125  XA  C///
 126  VA  :///
 127  $A  :///
