
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
![Loop Instruction
Write and run a program to find the values of each destination operand:
; Summing an Array (SumArray.asm)
.data
intarray DWORD 10000h,20000h,30000h, 40000h
.code
main PROC
mov edi, 0
mov ecx.LENGTHOF intarray
mov eax,0
L1:
add eax, intarray[edi]
add edi.TYPE intarray
loop L1
; 1. initialize index
; 2: initialize loop counter
; 3: sum = 0
; 4: mark beginning of loop
; 5: add an integer
; 6: point to next element
; 7: repeat until ECX = 0
EAX=?](https://content.bartleby.com/qna-images/question/44e710c5-82f1-4975-896c-cdeba81321cf/220a426a-716a-489c-80d9-1707ade080d7/t6on2_thumbnail.jpeg)
Transcribed Image Text:Loop Instruction
Write and run a program to find the values of each destination operand:
; Summing an Array (SumArray.asm)
.data
intarray DWORD 10000h,20000h,30000h, 40000h
.code
main PROC
mov edi, 0
mov ecx.LENGTHOF intarray
mov eax,0
L1:
add eax, intarray[edi]
add edi.TYPE intarray
loop L1
; 1. initialize index
; 2: initialize loop counter
; 3: sum = 0
; 4: mark beginning of loop
; 5: add an integer
; 6: point to next element
; 7: repeat until ECX = 0
EAX=?

Transcribed Image Text:• Debug until you reach "INVOKE ExitProcess, 0”.
Take a Single screenshot of the code and register window at the end
• Record the content of the EAX register
●
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 3 images

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
- using Assembly language to print all elements of array using looparrow_forwardIn MIPS using array of words nums (nums: .word 0x0FAB09AF, 0x25BA541C, 0x12CBACF2, 0x64ABE190), write a code code to loop through the array finding the remainder given when each number is divided by 4, using logic instructions find remainder.Print each remainder to the console as an integerarrow_forwardNAND2TETRIS HARDWARE SIMULATOR HiLoMux - This has one 8-bit input bus, in, and one 4-bit output bus, out. Alsopresent is a sel input, which is used to select what appears on out. Ifsel is false, then out should contain the lower 4-bits of in (i.e. in[0],in[1], in[2], in[3]). If sel is true, then out should contain theupper 4-bits of in (i.e. in[4] mapped to out[0], in[5], mapped toout[1], etc.). In other words, the HiLoMux can be used to select anibble from a byte please use the skeleton program below CHIP HiLoMux{ IN in[8], sel; OUT out[4]; PARTS: }arrow_forward
- Given the array A=[3,7,-4,12;-5,9,10,2;6,13,8,11;15,5,4,1], what instruction is needed to create the following array from A, а. В-[-5,10;6,8] b. C=[3;-5;6]arrow_forwardGiven an integer array nums, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3Output: [5,6,7,1,2,3,4]Explanation:rotate 1 steps to the right: [7,1,2,3,4,5,6]rotate 2 steps to the right: [6,7,1,2,3,4,5]rotate 3 steps to the right: [5,6,7,1,2,3,4]Example 2: Input: nums = [-1,-100,3,99], k = 2Output: [3,99,-1,-100]Explanation: rotate 1 steps to the right: [99,-1,-100,3]rotate 2 steps to the right: [3,99,-1,-100] Constraints: 1 <= nums.length <= 105-231 <= nums[i] <= 231 - 10 <= k <= 105 Follow up: Try to come up with as many solutions as you can. There are at least three different ways to solve this problem.Could you do it in-place with O(1) extra space?arrow_forwardDesign an Algorithm using pseudocode to eventually be implemented in Assembly that accomplishes the following: Find the mean value of an n-element array within memory that contains numerical values. From the original array, sort all values that are lower than the mean, in sequential order from lowest to highest in a new array From the original array, sort all values that are greater than or equal to the mean, in sequential order from highest to lowest in another new array.Output all the original array and both of the new arrays to the screen.arrow_forward
- In MATLABarrow_forwardConvert the following pseudo code into assembly code. int array_list() = {10, 11, 13, 18, 21, 23, 24, 17, 45}; int array_size = sizeof array_list / sizeof sanple; int index = 0; / index for while loop int sun- 0; // accumulate the result for (current_size = array_size ; current_size > 8 ; current_size--){ while ( index < current_size){ if( array_list[index] is even ){ sum += array_list[index]; index + 1; Store the result in the variable – sum.arrow_forward1. Convert the following C code into MIPS assembly: void array_comp(int num) { int array [10]; int i; for (i=0; i= 0) return 1; else return 0; int sub (int a, int b) { return a-b; }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