Header Value Looping 1

Flowchart a procedure to read a header value n; then to read and Print the following n number of values.

Flowchart      RAMM Machine Language Program     RAMM Assembly Language Program
    

Flowchart:



RAMM Machine Language Program:

0000  00  K
0000  01  N
0000  02  VAL
0000  03  K0
0001  04  K1
5000  05  STRT  No operation
1203  06        Load (A-Reg) with (K0)
2000  07        Store (A-Reg) at K
6501  08        Read N
6502  09  LOOP  Read VAL
6602  10        Print VAL
1200  11        Load (A-Reg) with (K)
1404  12        Add (K1) (A-Reg)
2000  13        Store (A-Reg) at K
1200  14        Load (A-Reg) with (K)
1501  15        Subtract (N) from (A-Reg)
3709  16        Jump if (A-Reg) is negative to LOOP
0000  17        Halt
9905  18        End and begin program execution at STRT


RAMM Assembly Language Program:

K     BSS 0001         
N     BSS 0001
VAL   BSS 0001
K0    DEC 0000
K1    DEC 0001
STRT  NOP
      LDA K0
      STA K
      RDI N
LOOP  RDI VAL
      PRI VAL
      LDA K
      IAD K1
      STA K
      LDA K
      ISB N
      AMJ LOOP
      HLT
      END STRT