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

  Write a program to edit text files for extra blanks

Write a program to edit text files for extra blanks. The program will replace any string of two or more blanks with a single blank.

  Consider the following function

Consider the following function:  Which of the following would be the best way to call this function?

  Calculate electricity bill with person name

Write c++ programm calculate electricity bill with person name, use, id

  Write a function to determine the various transactions

Given a I2C trace file, write a function to determine the various transactions. The trace files are provided in the zip file.

  Write a function named totamt

Write a function named totamt() that uses four parameters named quarters, dimes, nickels, and pennies, which represent the number of each of these coins in a piggybank.

  Explain characteristics unique to object-oriented programing

The machine language treats a message as bits while object-oriented programming language treats every message as an object. Do you agree with this statement? Why or why not? Explain the characteristics unique to object-oriented programming and how..

  Implement circular linked list in c program

implement circular linked list in c program in the best possible easiest way.

  Receiving a beneficial card

The version of the game will imagine only a single suit of cards, so 13 unique cards, {2,3,4,5,6,7,8,9,10,J,Q,K,A}. Given two cards from the set

  Write a program that reads an array with wind-tunnel test

write a program that reads an array with wind-tunnel test data then allowss the user to enter a flight-path angle. If the angle is within the bounds of the data set, the program should then use linear inteerpolation to compute the corresponding coeff..

  Series of different lengths

Before you enter the series, you are to have the program ask the user how many marks there are. After the last mark is entered, show the average of the inputted marks, rounded to 1 decimal point. Test your program to ensure that it works for serie..

  Design a class hierarchy to plan the inheritance

You will modify your program to add a specific Critter: Ant. You will design a (simple) class hierarchy to plan the inheritance. You will need to change your array(s) to contain pointers to Ant. Breed() will create a new Ant

  Single command-line argument

How would you go about writing a C program that takes a single command-line argument, the name of a file.The program reads this file

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