Question: Create a simulated MARIE cpu + memory that can run the following MARIE assembler instructions: LOAD X , STORE X ADD X , SUBT X

Create a simulated MARIE cpu+memory that can run the following MARIE assembler instructions:
LOAD X, STORE X
ADD X, SUBT X
SKIPCOND 000. SKIPCOND 400, SKIPCOND 800
JUMP X
OUTPUT, INPUT
HALT.
You do not need to create assembler program, you can directly use an array (e.g., int M[4096]).
How?
Allow the OPCODE in an single integer, and the OPERATOR in the next integer.
Consider, for example, we want to write a simple MARIE program to load
the accumlator with X=12 and then display it and halt.
M[0]= LOAD, M[1]=10,// load X into AC
M[2]= OUTPUT; // display AC
M[3]= HALT;
...
M[10]=12; // X =12

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!