Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

section .data arr dd 1,2,3,4 ;given array len equ $-arr ;length of array sum dd 0 ;variable to store sum disp_int db %d,0,10 ;for display

section .data arr dd 1,2,3,4 ;given array len equ $-arr ;length of array sum dd 0 ;variable to store sum disp_int db "%d",0,10 ;for display using printf section .text extern printf ;for getting printf function global main ;declaring scope of main main: xor edx,edx ;to make it zero mov ebx,4 ;to get length by dividing eax mov eax,len ;stroing length in eax div ebx mov ebx,0 ;sum will be stored here mov ecx,arr ;address of array top: add ebx, [ecx] ;Value in the array is added to ebx add ecx,4 ;move pointer to next element dec eax ;decrement counter jnz top ;if counter not 0, then loop again mov [sum], ebx ;done, store result in "sum" display: push dword[sum] ;Value in sum is pushed onto stack push disp_int call printf ;Printf is call add esp,8 ;Stack gets emptied ret 

What does this mean?

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

Genomes And Databases On The Internet A Practical Guide To Functions And Applications

Authors: Paul Rangel

1st Edition

189848631X, 978-1898486312

More Books

Students also viewed these Databases questions

Question

What are the steps the NLRB follows in a representation election?

Answered: 1 week ago

Question

What is the best time for a firm to develop its business model?

Answered: 1 week ago

Question

1 . Television News channels importantance of our Life pattern ?

Answered: 1 week ago

Question

1. How is the newspaper help to our daily life?

Answered: 1 week ago

Question

1. How will you, as city manager, handle these requests?

Answered: 1 week ago

Question

1. Identify the sources for this conflict.

Answered: 1 week ago

Question

3. How would you address the problems that make up the situation?

Answered: 1 week ago