Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 1 5 points ) . Using the Marie Simulator found on the web site, you will create a small assembly language Marie program. The

(15 points). Using the Marie Simulator found on the web site, you will create a small
assembly language Marie program. The program is a simple multiplication app
(MARIE does not have a MULT operator, so you have to figure out how to do this on
your own). Basically, your program will issue a prompt (">"), then accept a single
digit integer from the user. (Hit the ENTER key to actually enter the value). It will
then echo that integer to the screen, print a "*" symbol, then wait for a second digit.
It will then echo this digit to the screen, followed by the "=" symbol and then the
result of the multiplication. There is no error checking, so all numbers entered should
be a single digit, and the result must also be a single digit. So 2**3=6 or 8**1=8
is okay, but 3**5=15 is not (i.e., your program is not expected to be able to
handle the third case properly). When the calculation is finished, you must tell the
program whether to continue or not. If you enter a "!", the program will print "BYE"
to the screen and halt. If you simply hit the ENTER key instead, it will loop and
provide a new prompt.
Note that IO is quite limited on Marie so you can't do anything fancy. You should
select the "no linefeed" option in the Output Window - everything will be printed on
one line.
In addition, the data format of both the Input and Output registers should be set to
ASCII (this is the default). It must not be changed to anything else as the program is
running.
A sample output for a two iteration loop would be something like this:
>3**3=9>1**4=4BYE
MY CODE CAN SOMEONE PLEASE FIX IT: ORG 100
Start, LOAD >// Load X from memory
OUTPUT // Output prompt
INPUT // Input a digit (first operand)
STORE X // Store the digit in X
OUTPUT // Output the entered digit
LOAD *
OUTPUT // Output ''
INPUT // Input a digit (second operand)
STORE Y // Store the digit in Y
LOAD X // Load X (first operand)
ADD Y // Add Y (second operand)
STORE Z // Store the result in Z
LOAD X // Load X (first operand)
OUTPUT // Output the first operand
OUTPUT *// Output ''
LOAD Y // Load Y (second operand)
OUTPUT // Output the second operand
OUTPUT =// Output '='
LOAD Z // Load Z (result)
OUTPUT // Output the result
INPUT // Input a character to determine continuation
SKIPCOND 400// Skip if the input is '!'
JUMP Finish // If not '!', finish
OUTPUT BYE1// Output 'B' of BYE
OUTPUT BYE2// Output 'Y' of BYE
OUTPUT BYE3// Output 'E' of BYE
HALT
Finish, HALT
X, DEC 0
Y, DEC 0
Z, DEC 0
BYE1, HEX 42//'B' in ASCII
BYE2, HEX 59//'Y' in ASCII
BYE3, HEX 45//'E' in ASCII
*, HEX 2A //'*' in ASCII
=, HEX 3D //'=' in ASCII
>, HEX 3E //'>" in ASCII
image text in transcribed

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

4. Identify the stage of the road of trials in The Wizard of Oz.

Answered: 1 week ago

Question

3. Define the roles individuals play in a group

Answered: 1 week ago