A/ROUTINEPRINT/A                       Date.   14.7.52 

    Purpose: To print out a routine of several pages
             specified by false cues leading to directory
             lines in 33L.  
             
    Cues: R A @ / D E E Z  entry for parameters in B3 = ab// and B4 = cd// 
          " A @ / D E E Z  entry for parameters in [/C]=ab// and [EC]=cd// 
          
    Subroutines: PAGEPRINT/A

    Principal lines: [/A] = O / / :
             
    Magnetic Storage: variable     Electronic Storage: S1
    
    Stores Altered: S3 S4 S5 B3 B4 B5 B6
    
    Effects: The original routine only works if loaded by hand.
             If loaded by cue, it does not work at all.

    Note by Roberto Sancho:
             The routine seems a preliminary version, not finished
             on the cue call code. Possible reason is the fact that
             this routine may de used being manually brought to store
             and manually selecting track to print with Hand Switches.

             Code has been fixed, now the only entry allowed is by cue.
             This routine needs the directory to be stored in Track 33L 

             On entry, assuming B3 = ab// and B4 = cd//, the routines
             given in directory lines ab to cd (inclusive) are printed 
             and the link is obeyed. Dir entries containing //// (zero)
             are not printed

             A second cue is defined to get the parameters from storage
             tubes at [/C] and [EC] in place of B3 and B4.

             Output example:  

 
		DE P/@/    <-- dir entry DE (=41), mag instr in this entry P/@/
		/#         <-- printing left half track
		HVAQ""Q#   <-- checksum 


		VE// / G//:   <-- data to be brought to storage
		E//: E //Y/
                .... . ....
		RE/Z $ UETA
 		
		/R         <-- if mag instr contains Left and Right track
		"EHRQXL#       the right halft track will be printed and
                               identified by "/R"		
		/E/Q / O//:   
                .... . ....
		RE/Z $ UETA

		HE G//@    <-- dir entry HE (=52), mag instr in this entry G//@
		
		/#          
		WQO#"KOL
		
		//// / /CT/
		.... . ....


             This routine must be stored in the right half 
             of a track, with PAGEPRINTA in the left half.
    
             
    Library Progs - Bodleian Special Collection 
    MS. Eng. misc. b. 260-C.43.pdf
    p86
    
    [Routine ROUTINEPRINT/A             ] 
    
    [Col @          A ]      
                                     
    | /E/Q | / | O//: | 
    | E//: | E | SATA | 
    | SE/: | @ | L/QO |                                          
    | @//P | A | L//P |                                          
    | :AQO | : | //// |                                          
    | Q:QG | S | EE/I |                                          
    | Y@YO | I | DU/: |                                          
    | :AQB | U | ///Z | 
    | W//T | # | $/QO |                                          
    | :AWB | D | E/QB |                                          
    | JAWG | R | HE/P |                                          
    | QA/T | J | VSTA | 
    | :AWO | N | #@$$ | 
    | DSWG | F | F@$$ | 
    | $SW/ | C | JAHB | 
    | /:TN | K | YAYO | 
    | BA/P | T | XEYB | 
    | UEWB | Z | Z:YO | 
    | //PO | L | SA/: | 
    | //T: | W | FA/P | 
    | D//P | H | T@// | 
    | /R// | Y | PA/P | 
    | Q@// | P | A@/P |                                      
    | G@// | Q | XE// |                                      
    | SA/: | O | $$$/ |                                      
    | Z:YO | B | BA// |                                      
    | W//P | G | HA/H |                                      
    | /IW/ | " | NA/P |                                      
    | UE/S | M | /CWO | 
    | OATR | X | ECHO | 
    | :A/S | V | $A/P | 
    | SSTI | $ | RA// | 
          
    Tape: ROUTINEPRINT ONE
    Destination Sequence: KAK@//E#DEEZ
          
    [End]
  
  64  /@  IE/Q  tr 89  Entry manual execution (prog is loaded at addr 0!, not at addr 64)
  65  E@  E//:  load PERM: track 1L to S2
  66  @@  SE/:  load dir: Track 33L to Tube S3 
  67  A@  @//P  goto 102
  68  :@  :AQO  B7=[:A]=dir entry[B3] without destination tube char
  69  S@  Q:QG  B7=B7-//@/  check if 2-pages transfer
  70  I@  Y@YO  B5=320 (=addr S5)
  71  U@  :AQB  [:A]=B7 
  72  #@  W//T  if (B>=0) goto 6 -> print '/R' then goto 68

                New code                       original broken code
  73  D@  :AWB  [:A]=B3 save dir entry num     UAT#  AL=[UA]=current dir entry being printed
  74  R@  JAWG  B3=B3-[JA]=B3-last dir entry   UA/Z  [UA]=H <- selected dir line to print
  75  J@  QA/T  if (B>=0) goto end             UATJ  AL=AL XOR [UA]=AL XOR H
  76  N@  :AWO  B3=[:A] restore B3             E:TN  AL=AL-1
  77  F@  DSWG  B3=B3-(-1) incr dir entry      A:/M  if A>=0 goto 80
  78  C@  $SW/  AL=[191+B3]=dir entry data     DSWG  B3=B3-T///
  79  K@  /:TN  AL=AL-//// E///                E:/Q  transfer (rel) +1 -> goto 81
  80  T@  BA/P  goto 122                       UAWO  B3=[UA]=selected dir line to print

  81  Z@  UEWB  [UE]=B3 -> [UE]=value to print
  82  L@  //PO  B6=set exit from print to 91
  83  W@  //T:  A=0
  84  H@  D//P  goto 9 -> print '/#' then goto 68
  85  Y@  /R//  const 320
  86  P@  Q@// 
  87  Q@  G@// 
  88  O@  SA/:  Mag Instr: read track data in S4/S5
  89  B@  Z:YO  B5=256 (=addr S4)
  90  G@  W//P  goto 6 -> print /# or /D, chksum, track data, then exec $e (return)

  91  "@  /IW/  AL=[192+B3]=[S3 + B3] get entry B3 from dir
  92  M@  UE/S  [UE] = AL = dir entry[B3] = value to print
  93  X@  OATR  AL=AL and $$$
  94  V@  :A/S  [:A]=AL = dir entry[B3] without destination tube char
  95  $@  SSTI  AL=AL+[SS]=AL+///# -> dir entry mag instr modified to load on S4/S5   
  96  /A  O//:  Print Space
  97  EA  SATA  [SA]=mag instr modified to load on S4 
  98  @A  L/QO  B7=...I
  99  AA  L//P  goto 16: print 'B//@' then goto 88
 100  :A  ////  temp
 101  SA  EE/I  const Mag Instr Read track 33L (dir) to S3
 102  IA  DU/:  [DU] and mag instr -> load RoutinePrint+pagePrint in S0 + S1 -> cont in 103
 103  UA  ///Z  [//]=H  = 41 (DU, the self routineprint)
 104  #A  $/QO  B7=[$/]=...P
 105  DA  E/QB  [E/]=B7=HE/P
 106  RA  HE/P  goto 60  ??? print <lf>x3, goto [VS]

 107  JA  VSTA  Entry from ROUTINEPRINT cue(1): save return link in [VS]=J@LV A/@/

                New code                                      original broken code

 108  NA        #@$$  dummy, const goto 73                    LAQO  LAQO B7=NA/P
 109  FA        F@$$  dummy, const goto 81                    D@QB  [D@]=B7=NA/P 
 110  CA        JAHB  [JA]=B4 last dir to read                FAHB  [FA]=[B4]=last dir entry to read (on entry: B3 = ab// and B4 = cd//, read dir entry ab..cd) 
 111  KA        YAYO  B5=[YA]=PA/P                            SA/:  Mag Instr: read dir track 33L to tube S3
 112  TA        XEYB  [XE]=B5 -> set goto 68 at end of print  E:WG  Decr B3 
 113  ZA        Z:YO  B5=256=addr of S4                       /@/P  goto 39  ?print B3???
 114  LA        SA/:  read dir at Track 33L to Tube S3        NA/P  const NA/P 
 115  WA        FA/P  goto 81                                 UAWB  ???    [UA]=B3
 116  HA        T@//  const for goto                          FAWG  ???    B3=B3-[FA]
 117  YA        PA/P  const instr goto 68                     NS/T  ???    if (B>0) goto RCS
 118  PA        A@/P  const for goto                          UAWO  ???    B3=[UA]=selected dir line to print
 119  QA        XE//  const for goto                          HA/P  ???    goto ???
 120  OA        $$$/  const for AND
 121  BA        BA//  conts for goto
 122  GA        HA/H  if (A>=0) goto 81 to process next dir entry
 123  "A        NA/P  goto 73 to skip this zero dir entry
 124  MA        /CWO  B3=[/C] init B3 with value in [/C]=ab// initial dir entry to print 
 125  XA        ECHO  B4=[EC] init B4 with value in [EC]=cd// last dir entry to print 
 126  VA        $A/P  goto 107
 127  $A        RA//  cont goto 107

