   
     MANCHESTER UNIVERSITY COMPUTING MACHINE LABORATORY
    
     Programme Sheet B                  Date. 21.May.1955

    
    [Routine TRANS(7)   ] p23

    deals with complex operations

    [Col /          E ]                 [Col @          A ]              
                                                                          
    | @A/: | / | WAT/ |           Enter | /ITF | / |      |                                         
exam| @IQO | E | /NTA | plant           | DS/H | E |      |               
swtc| AA/T | @ | YAT/ | instr in main   | $@/: | @ | AE@N |                                        
to  | SAT/ | A | @NTA | routine for     | $JQO | A | S/// |                               
TR(1| //ZA | : | QAT/ | calling in the  | /#Q/ | : | YE// | c.n.                                   
 ___| I//P | S | :NTA | +-x% complex    | EUTA | S | F/// | cues to                                
    | TST: | I | BAT/ | routines        | VJQO | I | :E@/ | TRANS(1)                               
    | LI/C | U | INTA |                 | M@QG | U | $E// | TRANS(6)      
    | $:/N | # | "AT/ |                 | /UQB | # | DE@/ |                                        
tre-| VATC | D | #NTA |___              | /ITK | D | $$// | TRANS(8)                               
at z| LK/S | R | "KQO | shift x         | /ITA | R | JE@/ |                                        
addr| G:TC | J | TKQB | read m.i.       | /IQO | J | $$// | cue to        
    | TKTA | N | YKQO | shift y         | /UT/ | N | ZE// | complex %     
    | S:/N | F | LKQB | read m.i.       | V@/: | F | "E// | cue to        
    | XATR | C | OITK |\                | /#QA | C | ZE@/ | complex x  
 ___| OKTA | K | /UTA | instr           | X@/: | K | $$// | cue to        
    | II/C | T | /UQO | cue y           | DS/P | T | TEE/ | complex -     
    | $:/N | Z | WAQ/ | subroutine      |      | Z | $$// | cue to        
tre-| VATC | L | GCTA |/                |      | L | TE// | complex +     
at x| GKTA | W | UAT/ |\                |      | W | OAMO |               
addr| S:/N | H | //ZA |  assemble       |      | H | PAXO |               
    | XATR | Y | I//P |/_execute        |      | Y | MAVO |               
 ___| MKTA | P | DAT/ | to              |      | P | G@O/ |                                    
test| JIQO | Q | //ZA | TRANS(8)        |      | Q | @/BA |                                    
y ad| :A/T | O | I//P |___              |      | O | TAO/ |                                    
   /| NI/C | B |      |                 |      | B | LA/J |                                    
  ! | $:/N | G |      |                 |      | G | /TQO |                                    
tre-| VATC | " |      |                 |      | " | KS#P |                                    
at y| HKTA | M |      |                 | E#// | M | //T$ | ??? /ZT$      
addr| S:/N | X |      |                 | /@R# | X | OA// |               
  ! | XATR | V |      |                 | /@@# | V | //// |               
   \| PKTA | $ |      |                 | K/@# | $ | /:@N |               
                    

Note by Roberto Sancho: if we apply the correction from the bottom of page, 
    addr A/ to S/ are set to //T$ (dummy instruction). This causes that the
    code for complex instr it taken regardless the value of Q swith tested on
    line @/. Thus we ignore those correction, so lines A/ to S/ keeps the original
    code, corrections for lines BE to "E and A/ to S/ are ignored

Note by Roberto Sancho: on original listing the cue for complex mult assumes
    first version of complex mul routine dated 21/May/55. We haves restored
    1rst corrected version dated 2/Jun/55. On this version, entry point 
    for mult is not at $E, but rather at ME address. 

         address    original    new

           FA         $E//      "E//   -> set entry point for complex mult
        
    Also magnetic instruction for complex div (set to ZE@/)
    is changed to ZE//. This is needed by fix to be 
    applied on complex division (see COMPLEX.DIV.txt)

         address    original    new

           NA         ZE@/      ZE//   -> complex div mag instr   

    [End]
 
                Enter autocode line processing: 

   0  //  @A/:  Read Instr.matrix Read: from Track 35LR to Tube S6 S7 cols NFCK
   1  E/  @IQO  B7=[@I]=Q switch
   2  @/  AA/T  if (B>=0) goto 6 
                
                No complex mode -> proceed to TRANSLATE(1)
                
   3  A/  SAT/  AL=[SA]=F/// :E@/ cue to TRANSLATE(1)
   4  :/  //ZA  Save cue in [B1] stack
   5  S/  I//P  goto 177 -> call RCS enter ad-routine

                Complex Mode
                treat z address
   6  I/  TST:  A=0
   7  U/  LI/C  D=[LI] -> D=[LI]=int part of z=1
   8  #/  $:/N  mult by 32*32*32
   9  D/  VATC  Add AL=///n m+/:@N -> set mag instr that access track that holds var n
  10  R/  LK/S  [LK, WK]=///E /:@N
  11  J/  G:TC  Add //#/ -> add write bit
  12  N/  TKTA  [TK, ZK]=///E /:RN, A=0
  13  F/  S:/N  A=D*4 -> a=[LI]=int part of z * 4
  14  C/  XATR  AND =OA// -> 00011 11000
  15  K/  OKTA  [OK, BK]=AL

                treat x address
  16  T/  II/C  D=[II] -> D=[LI]=int part of x
  17  Z/  $:/N  mult by 32*32*32
  18  L/  VATC  Add AL=///n m+/:@N -> set mag instr that access track that holds var n
  19  W/  GKTA  [GK, "K]=///E /:@N
  20  H/  S:/N  A=D*4 -> a=[LI]=int part of x * 4
  21  Y/  XATR  AND =OA// -> 00011 11000
  22  P/  MKTA  [MK, XK]=AL
 
                test for y address
  23  Q/  JIQO  B7=[JI]=y switch
  24  O/  :A/T  if (B>0) goto 54 -> if y switch not set goto 54

                treat y address
  25  B/  NI/C  D=[NI] -> D=[NI]=int part of y 
  26  G/  $:/N  mult by 32*32*32
  27  "/  VATC  Add AL=///n m+/:@N -> set mag instr that access track that holds var n
  28  M/  HKTA  [HK, YK]=///n /:@N
  29  X/  S:/N  A=D*4 -> a=[NI]=int part of x * 4
  30  V/  XATR  AND =OA// -> 00011 11000
  31  $/  PKTA  [PK, QK]=AL

                plant instr in main routine for calling in 
                the +-*/ complex subroutines
  32  /E  WAT/  AL=OAMO PAXO
  33  EE  /NTA  [/N]=AL -> plant instr
  34  @E  YAT/  AL=MAVO G@O/
  35  AE  @NTA  [@N]=AL -> plant instr
  36  :E  QAT/  AL=@/BA TAO/
  37  SE  :NTA  [:N]=AL -> plant instr
  38  IE  BAT/  AL=LA/J /TQO
  39  UE  INTA  [IN]=AL -> plant instr
  40  #E  "AT/  AL=KS#P //T$
  41  DE  #NTA  [#N]=AL -> plant instr
  42  RE  "KQO  B7=["K] mag instr to read x
  43  JE  TKQB  [TK]=B7
  44  NE  YKQO  B7=[YK] mag instr to read y
  45  FE  LKQB  [LK]=B7
  46  CE  OITK  AL=2*[OI] -> [IO]=main op = -1->+. -2->-, -3->x, -4->%
  47  KE  /UTA  [/U]=AL
  48  TE  /UQO  B7=[/U]
  49  ZE  WAQ/  AL=[WA+B7] -> AL=cue to complex function
  50  LE  GCTA  [GC]=AL -> store in instr matrix
  51  WE  UAT/  AL=[UA]=$E// DE@/ -> cue to TRANSLATE(6)
  52  HE  //ZA  Store cue in [B1]
  53  YE  I//P  goto ad-routine

                to TRANS (8)
  54  PE  DAT/  AL=$$// JE@/ -> cue to TRANS(8)
  55  QE  //ZA  Save cue in [B1]
  56  OE  I//P  goto ad-routine

  57  BE  SAT/  cue to TRANSLATE(1)
  58  GE  //ZA  
  59  "E  I//P  
  60  ME        
  61  XE        
  62  VE        
  63  $E        

                Entry from INPUT(1)  
  64  /@  /ITF  AL=-[/I] -> load minus instruction label
  65  E@  DS/H  if (A>=0) goto 0 -> jump if inst has no label

                Instr has a label
  66  @@  $@/:  Read: from Track 15LR to Tube S4 S5 (cols #DRJ). Directory of labels???
  67  A@  $JQO  B7=[$J] -> last line of loaded track 15L
  68  :@  /#Q/  AL=[/# + B7] ->load word [B7] from track
  69  S@  EUTA  [EU]=0
  70  I@  VJQO  B7=[VJ] -> before last line of loaded track 15L
  71  U@  M@QG  B7=B7-257
  72  #@  /UQB  [/U]=B7 
  73  D@  /ITK  AL=[/I]*2 -> AL=instr label * 2
  74  R@  /ITA  [/I] =instr label * 2
  75  J@  /IQO  B7=instr label * 2
  76  N@  /UT/  AL=[/U EU] -> AL = $Q$$ ////
  77  F@  V@/:  Read: from Track 64LR to Tube S4 S5 (cols #DRJ). 
  78  C@  /#QA  [/# + B7]=AL
  79  K@  X@/:  Write: from Tube S4 S5 to Track 64LR
  80  T@  DS/P  goto 0
  81  Z@        
  82  L@  
  83  W@  
  84  H@  
  85  Y@  
  86  P@  
  87  Q@  
  88  O@  
  89  B@  
  90  G@  
  91  "@        
  92  M@  E#//  
  93  X@  /@R#  MagInstr: Write Assembled instr???
  94  V@  /@@#  MagInstr: Load Assembled instr???
  95  $@  K/@#  MagInstr: Load Dir from track 15LR
  96  /A        
  97  EA        
  98  @A  AE@N   MagInstr: Load Instr matrix 
  99  AA  S///  
 100  :A  YE//  
 101  SA  F///  
 102  IA  :E@/   TRANSLATE(1)
 103  UA  $E//  
 104  #A  DE@/  
 105  DA  $$//  
 106  RA  JE@/  
 107  JA  $$//  
 108  NA  ZE@/  
 109  FA  $E//  
 110  CA  ZE@/  
 111  KA  $$//  
 112  TA  TEE/  
 113  ZA  $$//  
 114  LA  TE//  
 115  WA  OAMO  
 116  HA  PAXO  
 117  YA  MAVO  
 118  PA  G@O/  
 119  QA  @/BA  
 120  OA  TAO/  
 121  BA  LA/J  
 122  GA  /TQO  
 123  "A  KS#P  
 124  MA  //T$  
 125  XA  OA//  
 126  VA  ////  
 127  $A  /:@N  MagInst: load Track 15L to Tube S4 S5 (cols #DRJ). 

