A/PAGEPRINT/A                       Date.   14.7.52 

    Purpose: To print the contents of an electronic store 
             and its checks sum.  
             
    Cues: (1) A / @ / D E E Z
          (2) : / @ / D E E Z
          
    Principal lines: [/A] = G / / :
             
    Magnetic Storage: variable     Electronic Storage: S0
    
    Stores Altered: B4 B5 B6 B7
    
    Effects: If entry is cue (2) with B5 = /(2n)// the contents
             of Sn is printed. B5=addr of tube to print: S4 -> 256
             (Sn starts at addr 64*n) 

             If entry is cue (1), the contents of S4 are printed 
             irrespective of B5

             Sn are printed in form:    /(2n)
                                        (check sum)
                                        .... / ....
                                        .... E ....
                                        etc
             
             The routine can be used to print the contents of any
             store except S0 and S2
                         
    Library Progs - Bodleian Special Collection 
    MS. Eng. misc. b. 260-C.43.pdf
    p60
    
    [Routine PAGEPRINT/A                ] 
    
    [Col /          E ]      
                                     
    | VE// | / | G//: |                                           
    | E//: | E | //Y/ | 
    | RE/Z | @ | UETA |                                          
 (*)| N/T: | A | /EY/ |                                          
    | REYO | : | #ETA |                                          
    | VSTA | S | L/QO |                                          
    | REYB | I | A//P |                                          
    | E:PO | U | MEQO |  
    | UEYB | # | $EQB |                                          
    | #//: | D | D@/P |                                          
    | ESQO | R | /#// |                                          
    | V:/C | J | VEYC | 
    | //HO | N | A:YG | 
    | B//: | F | A:HG | 
    | G//: | C | G//T | 
    | B//: | K | UETA | 
    | UE/N | T | REYO | 
    | UE/A | Z | J/QO | 
    | K//I | L | ZE/P | 
    | S//: | W | O//: | 
    | ESQG | H | "ET: | 
    | L//T | Y | DE/J | 
    | E:PG | P | A//: |                                      
    | G/IP | Q | V:/J |                                      
    | LEZ/ | O | DE/A |                                      
    | $/L/ | B | L/QO |                                      
    | REW/ | G | O//: |                                      
    | DSYG | " | L//P |                                      
    | DSPO | M | G//: | 
    | A:HG | X | G//: | 
    | A:/O | V | G//: | 
    | HE/P | $ | NS/P | 
          
    Tape: PAGEPRINT A ONE
    Destination Sequence: KAK@///#DEEZ
          
    (*) NOTE by Roberto Sancho: 
        on original listing, the instruction here is NIT: who makes the prog crash.
        If we replace it with N/T: the program works as expected.
        possible explanations: 
        - the program listing has been manualy typed and this a typo that has survived
          the document revisions (there are manual corrections on other routines)
        - the programmer wanted to goto to addr 205 where on day put some debugging
          or trace program, and forgot to remove it before sending the program tape
          to be included in the library manual
        whatever the reason is, we keep instr N/T: as the goof one

    [End]
  
   0  //  VE//  const 62
   1  E/  E//:
   2  @/  RE/Z
   3  A/  NIT:
   4  :/  REYO  Entry for cue (1): B5=256= /#// = addr of mem to print
   5  S/  VSTA  store link (return address) into cue (at [VS]=AL, A=0)
   6  I/  REYB  [RE]=B5 -> addr to print
   7  U/  E:PO  B6=1    -> what to print next: 1=checksum, 0=data value
   8  #/  UEYB  [UE]=B5 -> value to print 
   9  D/  #//:  Printer set letter shift 
  10  R/  ESQO  B7=...@ (@=2) = num of chars to print     
  11  J/  V:/C  D=//// ///E                                    

  12  N/  //HO  A:B4=[//]=VE// = 62        A section: print value in [UA, #E] for B7 chars 
  13  F/  B//:  A:print <cr>               B7=...@ -> 2 chars, ...C -> 8 chars 
  14  C/  G//:  A:print <lf>
  15  K/  B//:  A:print <cr>
  16  T/  UE/N  A:A+=D*S -> AL=0, AM=[BE, #E]/32 = #//$ EQB/, AL=//// ///# (#=left col to print)
  17  Z/  UE/A  A:[BE, #E]=AM, AM=0 (AL was 0)
  18  L/  K//I  A:Swap AM/AL  -> AM=//// ///#
  19  W/  S//:  A:print '/', '#'<- the chosen col
  20  H/  ESQG  A:B7=B7-...@ (@=2) 
  21  Y/  L//T  A:if B>=0 goto 16
  22  P/  E:PG  decr B6 
  23  Q/  G/IP  on B6=0 goto 43, -1 goto 32
  24  O/  LEZ/
  25  B/  $/L/  const <cr>
  26  G/  REW/  const <lf>
  27  "/  DSYG
  28  M/  DSPO
  29  X/  A:HG
  30  V/  A:/O
  31  $/  HE/P
  
  32  /E  G//:  print <lf>
  33  EE  //Y/  AL=[B5]=[addr to print=256]=/KTA H//:, AM=0
  34  @E  UETA  value to print [UE, #E]=AL (the value in mem at addr B5)
  35  AE  /EY/  AL=[b5+32]
  36  :E  #ETA  [#E]=AL   set [UE]=[B5] and [#E]=[b5+32] -> data in first line for left col and right col
  37  SE  L/QO  B7=...I (I=6) 
  38  IE  A//P  goto instr. Addr to go is in [A/]. 
                If [A/]=NIT: -> goto 205 -> this is outside routine -> the prog crashs ...
                if [A/]=N/T: -> goto 13 to print data in [UE, #E] -> prog works fine
                conclusion: modify original program changing NIT: -> N/T:
  39  UE  MEQO  B7=[ME]=...: entry from Routine print
  40  #E  $EQB  [$E]=B7
  41  DE  D@/P  goto 109
  42  RE  /#//  addr to print (defaults to 256=S4)        B section: calc checksum
  43  JE  VEYC  B: A=A+[B5+62] -> AL=[62+addr to print]  
  44  NE  A:YG  B: B5=B5-2 (=254) .. B5=192
  45  FE  A:HG  B: B4=B4-2 (=60)
  46  CE  G//T  B: if (B>=0) goto 0043
  47  KE  UETA  B: value to print [UE, #E]=checksum 
  48  TE  REYO  B5=addr to print
  49  ZE  J/QO  B7=...C (C=14)
  50  LE  ZE/P  goto 12
  51  WE  O//:
  52  HE  "ET:
  53  YE  DE/J
  54  PE  A//:
  55  QE  V:/J
  56  OE  DE/A
  57  BE  L/QO  
  58  GE  O//:
  59  "E  L//P
  60  ME  G//:  print <lf>
  61  XE  G//:  print <lf>
  62  VE  G//:  print <lf>
  63  $E  NS/P  return to caller
 
 
 
 
 
 
 
 