Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

1.Each part of this problem gives a pseudo-code fragment with a loop construct. Give an assembly code fragment that is equivalent to the pseudo-code. For

1.Each part of this problem gives a pseudo-code fragment with a loop construct. Give an assembly code fragment that is equivalent to the pseudo-code.

For all parts, assume that sumand countare 32-bit signed integers, countis in eax, and sumis in memory.

Also, general-purpose registers ebx edxare available for any task. USING 80X86 ASSEMBLY LANGUAGE

a)

sum := 0;

count := 100;

while (sum < 1000) or (count >= 0) loop

add count to sum;

subtract 1 from count;

end while;

b)

count := 0;

sum := 500;

while (count <= 60) and (sum > 200) loop

subtract count from sum;

add 5 to count;

end while;

c)

sum := 0;

count := 1;

repeat

add count to sum;

add 1 to count;

until (sum > 5000) or (count = 40);

d)

sum := 1000;

for count := 100 downto 50 loop

subtract (2 * count) from sum;

end for;

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_2

Step: 3

blur-text-image_3

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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students explore these related Databases questions

Question

How would we like to see ourselves?

Answered: 3 weeks ago

Question

HOW MANY TOTAL WORLD WAR?

Answered: 3 weeks ago

Question

Discuss the scope of financial management.

Answered: 3 weeks ago

Question

Discuss the goals of financial management.

Answered: 3 weeks ago