Simple Flowcharts 2

Flowchart a procedure that will read in the values p (dollars), r (rate), and t (years), print these three values, compute the interest (i = prt), and print the computed value.

Flowchart      RAMM Machine Language Program     RAMM Assembly Language Program
    

Flowchart:



RAMM Machine Language Program:

0000  00  P   
0000  01  R    
0000  02  T  
0000  03  I  
5000  04  STRT  No operation  
6500  05        Read P       
6501  06        Read R      
6502  07        Read T       
6600  08        Print P   
6601  09        Print R    
6602  10        Print T  
1200  11        Load (A-Reg) with (P)   
2401  12        Multiply (A-Reg) by (R)  
2402  13        Multiply (A-Reg) by (T)
2003  14        Store (A-Reg) at I  
6603  15        Print I      
0000  16        Halt                 
9904  17        End and begin program execution at STRT


RAMM Assembly Language Program:

P     BSS 0001   
R     BSS 0001
T     BSS 0001
I     BSS 0001
STRT  NOP
      RDI P
      RDI R
      RDI T
      PRI P
      PRI R
      PRI T
      LDA P
      IMU R
      IMU T
      STA I
      PRI I
      HLT 
      END STRT