   
     MANCHESTER UNIVERSITY COMPUTING MACHINE LABORATORY
    
     Programme Sheet B                  Date. 1.Jul.1955

    
    [Routine DECOUTPUT/F  ] p1-p3

    [Col  /    ]                        [     E    ]              
                                                                          
    | / | :E/: | Figs                   | / | E:/O |                                         
    | E | ///Z | Mod H                  | E | WEQG |               
    | @ | ///C |\                       | @ | /:UN |                                        
    | A | TST: |! examine               | A | A//P |___                                     
    | : | B:/N |! digits 8,9 of         | : | REH/ | figs                                   
    | S | VETR |! H                     | S | @/ZA |\                                       
    | I | YETC |!                       | I | #IT# |! output                                
    | U | //TA |!                       | U | UEQO |! mantisa      
    | # | E/YO |/                       | # | KS/P |/                                       
    | D | $$YT | B6=5,8,10 or 12        | D | BET/ | prepare to enter decoutput as adroutine
    | R | U:/D |\ examine digit         | R | RI/K |                                        
    | J | //TA |! 16 of H               | J | //ZA | plant cue     
    | N | //QO |/                       | N | IS/N | x 0.5            
    | F | QET/ |                        | F | A//P |___ print exp (or integer)
    | C | ZE/T | output in float form-> | C | QET/ | prepare to enter decoutput as adroutine              
    | K | //ZA | output in fixed        | K | :I/K |               
    | T | #I/K | form                   | T | :E/: |___ figs       
    | Z | RIQO |\test sign of exponent  | Z | :E/P |___ prepare to print index
    | L | M//T |/                       | L | N/// |               
    | W | HEQG |\                       | W | QV$$ | -41           
    | H | E:/O |! we expand             | H | OV$$ | -40           
    | Y | WEQG |! fract part            | Y | T@// | 80            
    | P | E:/O |! mult by 2^-p          | P | ME// | table base                         
    | Q | E:/Q |!__                     | Q | $E// | cue to decoutput (print CR LF before number)                           
    | O | /:UN |!                       | O | W/E@ |                                    
    | B | @I/A |!                       | B | U@// | cue to decoutput (do not print CR LF)                                  
    | G | @IT# |!                       | G | W/E@ |                                    
    | " | A//P |/__                     | " | :/// | 5  \                               
    | M | M/// |                        | M | U/// | 8  ! decimals 
    | X | YEQG |                        | X | D/// | 10 !          
    | V | LE/T |                        | V | J/// | 12 /         
    | $ | HEQG |                        | $ | A/// |               
                                                                                 
    [End]

                Entry to print float value 

   0  //  :E/:  Printer set Figure Shift        H=..... ...ab ..... .c... bits 8,9,16
   1  E/  ///Z  [//]=H -> get hand switches
   2  @/  ///C  D=[//]
   3  A/  TST:  A=0
   4  :/  B:/N  Shift D
   5  S/  VETR  AL=AL AND 11010 /// 11000 /// -> AL=.... ab000 ///   from H=..... ...ab ..... ..... bits 8,9
   6  I/  YETC  AL=AL+T@// ME//                          
   7  U/  //TA  [//. E/]=AL
   8  #/  E/YO  B5=[E/]
   9  D/  $$YT  B6=[B5-1] -> = 5,8,10 or 12 decimals
  10  R/  U:/D  Shift D
  11  J/  //TA  [//. E/]=AL
  12  N/  //QO  B7=[//]
  13  F/  QET/  AL=$E// W/E@ -> cue to DECOUTPUT (print CR LF +|- nnn.mmm) 
  14  C/  ZE/T  if (B>=0) goto 37 -> print in float form
  15  K/  //ZA  Store cue in [B1]
  16  T/  #I/K  D=[#I, DI]=f.b.a (floating point accumulator)
  17  Z/  RIQO  B7=[RI]=f.b.a exponent
  18  L/  M//T  if (B>=0) goto 29
  19  W/  HEQG  B7=B7-[HE] =B7+40
  20  H/  E:/O  if (B>=0) goto 22
  21  Y/  WEQG  
  22  P/  E:/O  if (B>=0) goto 24
  23  Q/  E:/Q  
  24  O/  /:UN  shift
  25  B/  @I/A  [@I]=AM
  26  G/  @IT#  AL=[@I] signed
  27  "/  A//P  
  28  M/  M///  
  29  X/  YEQG  B7=B7-80 -> exp=exp-80
  30  V/  LE/T  if (B>=0) goto xxx -> value > 2^40
  31  $/  HEQG  B7=B7+40
  32  /E  E:/O  if (B>=0) goto xxx -> value > 2^20
  33  EE  WEQG  B7=B7+41
  34  @E  /:UN  
  35  AE  A//P  goto 177. Call RCS (print CR LF +|- nnn.mmm)
  36  :E  REH/  const figure shift

                print in float form   

  37  SE  @/ZA  Store cue in [B1]
  38  IE  #IT#  AL=[#I, DI]=f.b.a (floating point accumulator)
  39  UE  UEQO  B7=*
  40  #E  KS/P  goto 173 call RCS. call DECOUTPUT (print CR LF +|- nnn.mmm) as subroutine
  41  DE  BET/  AL=U@// W/E@ -> cue to DECOUTPUT (print +|- nnn.mmm) 
  42  RE  RI/K  D=[RI, JI]=f.b.a exponent

  43  JE  //ZA  Store cue at [B1] stack
  44  NE  IS/N  mult by 0.5
  45  FE  A//P  goto 177. Call RCS

                Entry to print integer value in [:I, SI] 
                (it is div by 2 before being printed)

  46  CE  QET/  AL=[QE]=$E// W/E@ cue to DECOUTPUT
  47  KE  :I/K  D=[:I, SI]=the int value to print
  48  TE  :E/:  Printer set Figure Shift
  49  ZE  :E/P  goto 43
  50  LE  N///  
  51  WE  QV$$  
  52  HE  OV$$  
  53  YE  T@//  
  54  PE  ME//  
  55  QE  $E//  
  56  OE  W/E@  
  57  BE  U@//  
  58  GE  W/E@  
  59  "E  :///  
  60  ME  U///  
  61  XE  D///  
  62  VE  J///  
  63  $E  A///  
