Question

Write the following code segment in MARIE's assembly language: if X < 1 then Y =...

Write the following code segment in MARIE's assembly language:


if X < 1 then
Y = X - 2;
X = 0;

endif;
Y = Y + 7;

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

MARIE's assembly code for the above code segment is as follow :

ORG 100
IF, LOAD X

SUBT ONE
SKIPCOND 800
JUMP ENDIF
THEN, LOAD X
SUBT TWO
STORE Y
LOAD ZERO
STORE X
ENDIF, LOAD Y
  ADD SEVEN
STORE Y
HALT
/terminate program
X, DEC ?  /X has starting value, not given in problem
Y, DEC ?  /Y has starting value, not given in problem
ONE, DEC 1  /Use as a constant
ZERO, DEC 0  /Use as a constant
TWO, DEC 2  /Use as a constant
SEVEN,   DEC 7  /Use as a constant

Add a comment
Know the answer?
Add Answer to:
Write the following code segment in MARIE's assembly language: if X < 1 then Y =...
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