Question

Write a MARIE assembly program to read two different positive numbers from the keyboard and output...

Write a MARIE assembly program to read two different positive numbers from the keyboard and output the smaller number to the screen.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:
The desired MARIE assembly program is given below:

            / program to get x, y from user
            / if x < y print x
            / else if x > y print y
            / else just print x
            org            100
            input                           / get value for x from user
            store          X
            input                           / get value for y from user
            store          Y
Test1, subt            X               / acc = y - x
           skipcond     000            / if negative then x is bigger, we can skip further tests
           jump           Test2
           load            Y                / got here if x bigger, so print y, then done
           output
           jump           Done

Test2, skipcond     800             / if positive then y bigger, skip further tests
           jump           XYEq          / if here then equal, go to XYeq print section
           load            X              /got here if y bigger, print x, then done
           output
           jump           Done
XYEq, load            X                 / just print x, then done
           output

Done, halt

X,        dec            0                  / default value for x
Y,        dec            0                   / default value for y

(plz give me a thums up...if my answer helped you and if any suggestion plz comment, Yr thums up boost me)

Add a comment
Know the answer?
Add Answer to:
Write a MARIE assembly program to read two different positive numbers from the keyboard and output...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT