falta:
   ver economise de v1=v1+v1. Ojo que Q xxx resetee a nada el l.m.i

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

    
    [Routine VARS          ] p56

    [Col  I    ]                        [     U    ]              
                                                                          
    | / |      |    instruction         | / | A:QO | Fix for built in function
    | E |      |___ label               | E | WD/P | R C E L A M              
    | @ | ///T | Q switch    \          | @ | JDQO | see note in INPUT.2B.txt file                                       
    | A | //// | n/v switch   !         | A | WD/P |                                        
    | : | //// | v/n count    !         | : | S:QO |                                        
    | S | //// | x switch     + x       | S | WD/P |                                        
    | I |      | Integral     !         | I | NDQO |                                        
    | U |      |     part     !         | U | WD/P |               
    | # |      | decimal      !         | # | FDQO |                                        
    | D |      |     exp     /          | D | WD/P |                                        
    | R |      | v/n count   \          | R | FUQO | Fix for P print char
    | J |      | y switch     !         | J | GIQB | see note in INPUT2B.txt file
    | N |      | Integral     + y       | N | J//P |               
    | F |      |     part     !         | F | E//T |               
    | C |      | decimal      !         | C |      |               
    | K |      |     exp     /          | K |      |               
    | T |      | v/n count   \          | T |      |               
    | Z |      | z switch     !         | Z |      |               
    | L |      | Integral     + z       | L |      |               
    | W |      |     part    /          | W |      |               
    | H | //// | n count     \          | H |      |               
    | Y | //// | j switch     !         | Y |      |               
    | P |      | integral     + j       | P |      |                                    
    | Q |      | part (!=0)  /          | Q |      |                                    
    | O |      | (*) num for main op    | O |      |                                    
    | B |      | (**) num for incid. op | B |      |                                    
    | G | //// | p switch               | G |      |                                    
    | " |      | (***) num for ineq     | " |      |                                    
    | M |      |                        | M |      |               
    | X |      |                        | X |      |               
    | V |      |                        | V |      |               
    | $ |      |                        | $ |      |               
                                   
    (*) number describing main op   (**) incidental    (***) nature of
        -4 % (division)                  operation           inequations
        -3 x (multiplication)            0 (=T)              1 >=
        -2 -                             1 X print <cr>      2 >  
        -1 +                             2 Y print <lf>      3 !=
         0 Simple transfer               3 Z print space     4 =
         1 R S sqrt or Fm()              4 H halt
         2 C cos                         5 T Tape
         3 E exp                         6 I input
         4 L log                       
         5 A arctan                    
         6 M modulus (=absolute value)                   
                                              
    [End]

Note by Roberto Sancho: on line AI, the original prog states the value ///T
    this implies x is allways interpreted as being a variable. Corrected
    to be //// so switch can be set to ///T when autocode v char (teletype 
    char N) is read. Same for line SI. The original prog states the value ///T
    this implies x always present, so will never recognize incidental operations
    (H -> Halt, Z -> space, etc). Corrected to be ////


program workflow

  Start -> INPUT(1)
             read PTR chars
             parse source code line, setting col I vars
             on char <CR>, goto TRANSLATE(7)
                     "(" or ")", set [MK] in directory to value 1 or 2
                     j, set j switch
  
           TRANSLATE(7)
             Read Instr.matrix to cols N F C K
             if Q switch not set -> continue to TRANSLATE(1)
             process complex variables & operations
             xxx

           TRANSLATE(1)
             if x switch not set (i.e. no x part on autocode source sentence)
                continue to TRANSLATE(6) process incidental operation
             if n/v switch for x is 'n'
                if x is a constant (integer)
                   plant instr
                else (x is na index)
                   plant instr
                if y switch not set (i.e. no y part on autocode source sentence)
                   continue to TRANSLATE(4) 
                else                   
                   continue to TRANSLATE(2)
             else 
                if x is a constant (float)
                   call as subroutine CONVTR (SPECIAL) to convert x value to float
                   plant instr
                   continue to TRANSLATE(4) 
                else if x is va variable
                   xxx
                else (x is vna indexed variable)
                   xxx
                continue to TRANSLATE(3)                      
           TRANSLATE(2)
             if n/v switch for x is 'v'
                if y is a constant (float)
                   call as subroutine CONVTR (SPECIAL) to convert x value to float
                   plant instr
                else if y is va variable
                   plant instr
                else (y is vna indexed variable)
                   xxx
                continue to TRANSLATE(3)
             else
                if y is a constant (integer)
                   plant instr
                else (y is na index)
                   plant instr
                plant instr for integer main op +-*/
                continue to TRANSLATE(4)
             
           TRANSLATE(3)
             if main op is +-*/ 
                plant instr
             if main op is a func Fm
                read function cuelist directory track
                get cue number m from cuelist 
                plant instr for func call                 
             continue to TRANSLATE(4)

           TRANSLATE(6) process incidental operation
             if op=space/cr/lf -> plant instr -> goto TRANSLATE(6) store or run  
             xxx
             
           TRANSLATE(4) check func
             if main op is a func 
                get cue based on main op code for built in function RCELAM (sqrt, cos, exp, ...) b
                plant instr for func call                 
             if no z switch -> continue to TRANSLATE(5) to deal with j statement
             
           TRANSLATE(4) store z
             if n/v switch for x is 'n' then
                plant instr to store in z
                continue to TRANSLATE(5) to deal with posible exit to printing section  
             else 
                plant instr to store in z
                continue to TRANSLATE(5) to deal with posible exit to printing section  

           TRANSLATE(5) deal with j statement
             if j switch on then 
                if sentence j na then 
                   xxx
                else (sentence j a)
                   Read cue list from Track 64LR to cols # D R J 
                   if cue for label a not defined -> xxx
                   plant instr
                if conditional jump >= > != =
                   xxx
             goto TRANSLATE(5) to deal with possible print 
             
           TRANSLATE(5) deal with possible print 
             if print switch on then
                if n/v switch for x is 'n' then
                   plant instr
                else 
                   plant instr
             continue to TRANSLATE(6) store or run
   
           TRANSLATE(6) store or run
             read dir track 15LR into cols # D R J
             if bracket switch off then 
                call as subroutine ECONOMISE to save generated code to drum
                continue to INPUT(1)
             else
                clear bracket switch 
                write dir track 
                call as subroutine TRANSLATE(9) 
                continue to INPUT(1)
                                
           ECONOMISE 
             if Q switch set -> goto xxx to process complex variables
             set n switch
             continue to ASSEMBLY

           ASSEMBLY
             read dir track 15LR into cols # D R J
             read generated code current track into cols # D R J
             copy generated code from col N to cols #..J
             write generated code current track from cols # D R J
             read dir track 15LR into cols # D R J
             update n,l+1
             write back dir track 15LR from cols # D R J
             subroutine closure -> return to caller TRANSLATE(6)

           TRANSLATE(9)
             process generated code at cols N
             Write to Track 6LR cols N F C K -> save generated code to track 6
             Read NORMALISE from Track 20R to cols I U -> prepare the runtime
             Read ADD & SUB from Track 20L to cols # D    for autocode sentence
             Read Track Selection from Track 63R to cols R J       execution
             continue to Track 6LR to execute autocode sentence
             XXX

             