Simple Flowcharts 4

Read two unequal values, sum them, and then print the larger of the two values and the sum.

Flowchart      RAMM Machine Language Program     RAMM Assembly Language Program
    

Flowchart:



RAMM Machine Language Program:

0000  00  A             
0000  01  B              
0000  02  C               
5000  03  STRT  No operation   
6500  04        Read A           
6501  05        Read B      
1200  06        Load (A-Reg) with (A)
1401  07        Add (B) to (A-Reg) 
2002  08        Store (A-Reg) at C     
1200  09        Load (A-Reg) with (A)    
1501  10        Subtract (B) from (A-Reg)  
3715  11        Jump if (A-Reg) is negative to PRIB
6600  12        Print A                 
6602  13  PRIC  Print C              
7517  14        Unconditional Jump to EXIT 
6601  15  PRIB  Print B            
7513  16        Unconditional Jump to PRIC 
0000  17  EXIT  Halt                
9903  18        End and begin program execution at STRT


RAMM Assembly Language Program:

A     BSS 0001  
B     BSS 0001
C     BSS 0001
STRT  NOP
      RDI A
      RDI B
      LDA A
      IAD B
      STA C
      LDA A
      ISB B
      AMJ PRIB
      PRI A
PRIC  PRI C 
      UNJ EXIT
PRIB  PRI B
      UNJ PRIC
EXIT  HLT
      END STRT