MIC-1 Simulation how to get started

854 views Asked by At

Not sure how to start this..

For the given high-level code:

c = b - a;
a = a * 2;

complete the tasks:

  1. create corresponding ijvm hexcode

  2. store into appropriate cells

  3. simulate the instructions

  4. show changing contents of each data cell using "/", using the notation:

    < old_value > / < new_value >
    

enter image description here

1

There are 1 answers

0
downeyt On

Start by writing the equivalent instructions in IJVM. If you are using Tannenbaum's book, there is a simple example for doing a calculation like one of these statements.

Since you have to update the contents of the registers in the data path, IJVM is not sufficient. If you only had to show the contents of the stack, the IJVM would suffice. Tannenbaum has an example of how the stack changes from IJVM instructions.

Once you have the IJVM, look up the opcodes in the instruction table and change operands into offsets from LV.

You will have to take the IJVM instructions and simulate them through MIC-1. Fill in the stack and registers with initial values. Show how the values change as you step through the code, using paper and pen.