What will eax contain execution of the code

Assignment Help C/C++ Programming
Reference no: EM132591696 , Length: 5 pages

Problem 1. Implement each design given below. Assume that value is stored as a doubleword in memory, number is in EAX, and count is in ECX. You need only show the assembly code for the design. Submitting entire programs is not necessary.

(a)
if value ≤ 1000
then
add number*count to value;
end if;

(b)
if value < 1000
then
add 10*count to value;
else
value := 800;
subtract 1 from count;
end if;

(c)
if (value ≥ 100)
then
add 5*count to value;
end if;

(d)
if value < 1000
then
add number*count to value;
else
value := 800;
end if;

(e)
if value > 1000
then
subtract number*count from value;
else
value := 500;
end if;

Problem 2. Implement each design given below. Assume that value is stored as a doubleword in memory, number is in EAX, and count is in ECX. You need only show the assembly code for the design. Submitting entire programs is not necessary.

(a)
number := 0;
value := 500;
while number ≤ 60 and value > 200 loop
subtract number from value;
add 5 to number;
end while;

(b)
while (count < 100) and (value ≤ 500) loop
add count to value;
add 2 to count;
end while;

(c)
while (count < 100) or (value ≤ 500) loop
add count to value;
add 2 to count;
end while;

(d)
number := 0;
value := 500;
while number ≤ 100 or value > 300 loop
subtract number from value;
add 5 to number;
end while;

Problem 3. Implement each design given below. Assume that value is stored as a doubleword in memory, number is in EAX, and count is in ECX. You need only show the assembly code for the design. Submitting entire programs is not necessary.

(a)
count := 0;
value := 50;
repeat
add 1 to count;
add count to value;
until count > 20 and value ≥ 300;


(b)
repeat
value := 2*value;
add 1 to count;
until (value > 1000);


(c) count := 0;
value := 50;
repeat
add 1 to count;
add count to value;
untilcount > 10 or value ≥ 150;

Problem 4. What will EAX contain following execution of the following code?

mov eax, 0 ; sum := 0
mov ecx, 4 ; count := 4
for4:
add eax, ecx ; add count to sum
loop for4

Problem 5. Modify the program in Figure 5.9 of our text (Detmer), replacing the second loop by one that changes each number that is larger than the average to zero. Show your full source code and screenshots of your working program.

Reference no: EM132591696

Questions Cloud

How can the nurse advocate for the client : A home care nurse visits a client who has stage 4 metastatic lung cancer. He tells the nurse, "I don't want any more chemotherapy or surgery.
Define what history would be necessary to collect : Consider what history would be necessary to collect from the patient in the case study. Consider what physical exams and diagnostic tests would be appropriate.
Pros and cons of establishing demand-based ordering system : Your chief executive officer (CEO) has asked you to educate the senior staff on the pros and cons of establishing a demand-based ordering system
Mode of transportation. : Describe how it has impacted the environment, society, and the economy. Has the impact been positive or negative?
What will eax contain execution of the code : Implement each design given below. Assume that value is stored as a doubleword in memory, number is in EAX, and count is in ECX
What your professional connection is with target audience : The processes and criteria you are going to use to select your target audience. You will also discuss what your professional connection is with your target.
Describe the strategies for disseminating ebp : As your EBP skills grow, you may be called upon to share your expertise with others. While EBP practice is often conducted with unique outcomes in mind.
Provide online cloud-computing data services : Imagine that IBM has decided to diversify into the telecommunications business to provide online cloud-computing data services
Vehicle acquisition alternatives : Critique the process you used for selecting between vehicle acquisition alternatives.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd