Question: You have to create a MARIE Computer Simulator. So basically, you have to write a program that takes the assembly code as input and write

You have to create a MARIE Computer Simulator.

So basically, you have to write a program that takes the assembly code as input and write the output of accumulator when it sees HALT instruction.

You can use JAVA to the write the program.

Sample input file contents:

100 Load 104

101 Add 105

102 Store 106

103 HALT

104 0023

105 FFE9

106 0000

The output should be for example, like the image below.

You have to create a MARIE Computer Simulator. So basically, you have

ORG 100 Example 4.1 Load Addr /Load address of first number to be added Store Next /Store this address is our Next pointer Load Num /Load the number of items to be added Subt One /Decrement to control looping Store Ctr /Store this value in Ctr oop, Load Sum /Load the Sum into AC Next /Add the value pointed to by location Next AddI Store Sum /Store this sum Load Next /Load Next Add One /Increment by one to point to next address Store Next /Store in our pointer Next Load Ctr /Load the loop control variable Subt One /Subtract one from the loop control variable Store Ctr /Store this new value in loop control variable Skip Cond 000 /If control variable 0, skip next instruction Loop /Otherwise, go to Loop Jump Halt /Terminate program Addr Hex 117 /Numbers to be summed start at location 118 /A pointer to the next number to add Next Hex /The number of values to add Num Dec Sum Dec The sum Ctr Hex /The loop control variable One /Used to increment and decrement by 1 DeC 10 /The values to be added together Dec Dec 15 Dec 20 25 Dec Dec 30

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!