B/MATHTEST                        Date. 15.12.2022

    Purpose: To test input routines, output routines, 
             and math routines
            
    Cue: / / / / R / @ /    
             
                     
    Magnetic Storage: variable      Electronic Storage: S0 S1
    
    Stores Altered:  
    
    Effects: Calls routines INPUT/B, PRINT/A, DIVISION/B, DECOUTPUT/A
             
    
    [Routine ROUTINE       ] 

    [Col /          E ]                 [Col @          A ]              
                                                                          
    |      | / | /CT/ |                 |      | / | //// |                                         
    | //T: | E | @C/J |                 |      | E | //// |               
    | @/QO | @ | @EQO |                 |      | @ |      | save AM                                       
    | GS/P | A | GS/P |                 |      | A |      | save AM                                       
    | @//V | : | I//V |                 |      | : | //// | PRINT/A 
    | @F/E | S | NS/P |                 |      | S | /$// | layout                       
    | :A/C | I |      |                 |      | I | //L/ | const <cr>
    | U/QO | U |      |                 |      | U | //W/ | const <lf>
    | GS/P | # | //T: |                 |      | # |      |                                        
    | N//V | D | /CTA |                 |      | D |      |                                        
    | @FT# | R | /FQO |                 |      | R |      |                                        
    | E:/M | J | //UJ |                 |      | J |      |               
    | /A/P | N | @C/A |                 |      | N |      |               
    | @FTF | F | CE/P |                 |      | F |      |               
    | E:/M | C | M/// |                 |      | C |      |               
    | /A/P | K |      |                 |      | K |      |               
    | //T: | T |      |                 |      | T |      |               
    | Z/QO | Z | N//V |                 |      | Z |      |               
    | GS/P | L | ZEQO |                 |      | L |      |               
    | ://V | W | GEQB |                 |      | W |      |               
    | /C/S | H | //T: |                 |      | H |      |               
    | //T: | Y | /FQO |                 |      | Y |      |               
    | P/QO | P | //UJ |                 |      | P |      |                                    
    | GS/P | Q | :A/C |                 |      | Q |      |                                    
    | ://V | O | OEQO |                 |      | O |      |                                    
    | :C/S | B | QS/P |                 |      | B |      |                                    
    | G/QO | G | C//V |                 |      | G |      |                                    
    | GS/P | " |      |                 |      | " |      |                                    
    | #//V | M |      |                 |      | M |      |               
    | IA/: | X |      |                 |      | X |      |               
    | UA/: | V |      |                 |      | V |      |               
    | $$$$ | $ |      |                 |      | $ |      |               
                                                                          
    Tape: ROUTINE ONE                   Tape: ROUTINE TWO
    Destination Sequence: KAK@///R/@/   Destination Sequence: KAK@//E#R/@/
        
    [End]

   0  //  
   1  E/  //T:  Clear acc           
   2  @/  @/QO  B7=*                
   3  A/  GS/P  call RCS ...
   4  :/  @//V  ... to enter func @/ -> cue //// JE// INPUT/B cue to input signed fractions        
   5  S/  @F/E  save AM in [@F] = hi 40bits of read fract                  
   6  I/  :A/C  D=the layout for PRINT/A
   7  U/  U/QO  B7=*                                                                            
   8  #/  GS/P  call RCS ...                                                                    
   9  D/  N//V  ... to enter func N/ -> cue $$// NE// PRINT/A print fractional signed convention
  10  R/  @FT#  restore AL sign extended                                                                                                         
  11  J/  E:/M  if (A>=0) goto 13                                                                                                    
  12  N/  /A/P  goto 1, printed a <0 number, proceed to the following one     
  13  F/  @FTF  restore -AL sign extended                                      
  14  C/  E:/M  if (A>=0) goto 16 because 0 was printed                                                                                               
  15  K/  /A/P  goto 1, printed a >0 number, proceed to the following one  
  16  T/  //T:  Clear acc
  17  Z/  Z/QO  B7=*
  18  L/  GS/P  call RCS ...
  19  W/  ://V  ... to enter func :/ -> cue A/// JE// INPUT/B cue to input signed integer
  20  H/  /C/S  [/C]=AL divident
  21  Y/  //T:  Clear acc                                
  22  P/  P/QO  B7=*
  23  Q/  GS/P  call RCS ...
  24  O/  ://V  ... to enter func :/ -> cue A/// JE// INPUT/B cue to input signed integer
  25  B/  :C/S  [:C]=AL divisor      
  26  G/  G/QO  B7=*
  27  "/  GS/P  call RCS ...
  28  M/  #//V  ... to enter DIVISION/B -> result in [/C] int [@C] fract 
  29  X/  IA/:  print <cr>
  30  V/  UA/:  print <lf>
  31  $/  $$$$  dummy instr
  
  32  /E  /CT/  load accumulator                                                
  33  EE  @C/J  with [/C] int [@C] fract (AL=fract part, AM=int part)      
  34  @E  @EQO  B7=*                                   
  35  AE  GS/P  call RCS ...                           
  36  :E  I//V  ... to enter DECOUTPUT/A               
  37  SE  NS/P  return to caller                       
  38  IE  
  39  UE        
  40  #E  //T:  clear acc  - Entry print signed integer at addr [/F]      
  41  DE  /CTA  [/C]=0 fract part      
  42  RE  /FQO  B/=[/F] the addr of integer value to print
  43  JE  //UJ  AM=[B7] get integer value to print from addr [/F]
  44  NE  @C/A  [@C]=AM int part
  45  FE  CE/P  goto 29      
  46  CE  M///  const for goto 29
  47  KE        
  48  TE        
  49  ZE  N//V  func num for print signed fractional
  50  LE  ZEQO  Entry - print signed fract at addr [/F]      
  51  WE  GEQB  set it to be used use 
  52  HE  //T:  clear acc - Entry print unsigned fract at addr [/F]      
  53  YE  /FQO  B/=[/F]      
  54  PE  //UJ  AM=[B7]=unsigned fract      
  55  QE  :A/C  D=the layout for PRINT/A      
  56  OE  OEQO  B7=*      
  57  BE  QS/P  goto RCS ...      
  58  GE  C//V  ... to enter func C/ -> cue CE// NE// PRINT/A print fractional unsigned convention      
  59  "E        
  60  ME        
  61  XE        
  62  VE        
  63  $E  
                
                
                
                