View the step-by-step solution to:

Question 4: Provide a trace (similar to the one in Figure 4.14) for Example 4.

Question 4: Provide a trace (similar to the one in Figure 4.14) for Example 4.2.
100 If, Load X /Load the first value
101 Subt Y /Subtract the value of Y, store result in AC
102 Skipcond 400 /If AC=0 (X=Y), skip the next instruction
103 Jump Else /Jump to Else part if AC is not equal to 0
104 Then, Load X /Reload X so it can be doubled
105 Add X /Double X
106 Store X /Store the new value
107 Jump Endif /Skip over the false, or else, part to end of if
108 Else, Load Y /Start the else part by loading Y
109 Subt X /Subtract X from Y
10A Store Y /Store Y-X in Y
10B Endif, Halt /Terminate program (it doesn't do much!)
10C X, Dec 12 /Assume these values for X and Y
10D Y, Dec 20
Load X

This question was asked on Mar 25, 2010.

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors and customizable flashcards—available anywhere, anytime.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access or to earn money with our Marketplace.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
  • -

    Flashcards

    Browse existing sets or create your own using our digital flashcard system. A simple yet effective studying tool to help you earn the grade that you want!

    Browse Flashcards