Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

Describe the process for implementing NAP policies.

Answered: 1 week ago

Question

=+2 How can the effectiveness of global virtual teams be improved?

Answered: 1 week ago

Question

=+1 What are the major issues related to international T&D?

Answered: 1 week ago