Subject Computer Science Assembly Language Programming

Question

Given the following C functions, implement equivalent assembly language function in the given space.

int countZeros(int *num, int count)
{
int i;
int zeros;
i=0;
zeros = 0;
do {
       if (num[i] == 0)
                {
                zeros ++;
                num[i] = -1;
                }
       i++;
      } while {i< count);

return(zeros);
}

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

.global _countzeros
_countzeros:

pushl %ebp
movl %esp,%ebp   //
movl 8(%ebp),%ebx // ebx ->num...

This is only a preview of the solution. Please use the purchase button to see the entire solution

$8.00

or free if you
register a new account!

Assisting Tutor

Related Homework Solutions

Get help from a qualified tutor
Live Chats