Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
For the DO WHILE AND GOTO loop below, generate an assembly language version of each
DO WHILE loop
int sumDoWhileLoop(int start, int end) {
int sum = 0;
int i = start;
do {
sum += i;
i++;
} while (i <= end);
return sum;
}
GOTO loop
int sumGotoLoop(int start, int end) {
int sum = 0;
int i = start;
loop:
sum += i;
i++;
if (i <= end)
goto loop;
return sum;
}
IS THE ASSEMBLY LANGUAGE VERSION OF EACH LOOP THE SAME OR DIFFERENT. COMPARE BASED ON No of registers used, jumps and total no of operations
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a while loop that prints the multiples of 3 from 300 down to 3. The programming language is java.arrow_forwardThe loop continuation condition is the polar opposite of the loop termination condition in terms of its meaning. True Falsearrow_forwardSimple MIPs Recursive Procedure Write a program that calls a recursive procedure. Inside this procedure, add 1 to a counter so you can verify the number of times it executes. Put a number in a MIPS counter that specifies the number of times you want to allow the recursion to continue. You can use a LOOPinstruction (or other conditional statements using MIPS), find a way for therecursive procedure to call itself a fixed number of times.arrow_forward
- void loop() { } OUTPUT of and is and isarrow_forwardJAVA Even if the condition is false at the first execution a while loop at least executes once. True False A while loop can be used both as an event-controlled loop and as a count controlled loop. True Falsearrow_forwardFor Loop in Javaarrow_forward
- Python A program to calculate the value of some change in dollars Code evaluation (What is the result of the following code?)- Short sentence(What is the difference between X and Y?)- Translation (Convert the following code from a for loop to a while loop)arrow_forwardConvert the code below to use a for loop instead of a while loop. int num1 = 1; int num2 = 1; int num3 = 5; while (num1 < num3) { num2 = num1 * num2; System.out.println("num2: " + num2); num1++; } System.out.println("num1: " + num1); Javaarrow_forwardRewrite the following pseudocode segment using a loop structure. any language is fine, but don’t use gotos (Use Python or C++) i= 10; num = 0; loop: if i >= 20 then goto out i = i + 3; cout << i * num; goto loop out: cout << “DONE”;arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education