MARIE simulator

Thread Starter

Omar MoHamed 2

Joined Dec 8, 2016
1
Use MARIE Simulator to enter and run the following program:

Input

Store TestVal

If, Skipcond 800

Jump Else

Then, Store Y

Add Y

Jump EndIf

Else, Load Y

EndIf, Add X

Add X

Store Z

Output

Halt

X, Dec 5

Y, Dec 2

Z, Dec 0

TestVal, Dec -1

instructions:

  • Use “ORG” instruction to start your program at address 100.

  • Use your last university ID number when you are asked to input a number. For example, if your ID is1415161678532, then you will use the number 2.
b) Suppose that the value, say a, has been entered. What are the instructions in the above program that will be executed? Your answer should explain the flow of execution for a<0, a=0, and a>0.

c) Based on your answer in part b, formulate what happens in the three cases, by stating the output as a function of the variables (for example, Output= 3x-2a+y)
 
Top