Question: Implement the following C program in MIPS assembly language (name the file pattern.s) //count number of items that match the pattern (have '1' bits in

 Implement the following C program in MIPS assembly language (name the

Implement the following C program in MIPS assembly language (name the file pattern.s) //count number of items that match the pattern (have '1' bits in the same place as the pattern) // pu32 a points to first element of the array // u32_n is the number of elements in the array /u32 pat is the pattern to match uint32_t pmatch (uint32_t pu32_a, uint32_t u32_n, uint32_t u32_pat) uint32_t u32_result; u32-result = 0; while (u32 n != 0) if u32-pat) //this is pointer arithmetic! actually is pu32_a 4! ( (*pu32-a & -a32-pat) u32-result++; pu32_att u32 n-- return u32_result; 0x0000A5AA, 0xF0F0F0F0 }; uint 32 t aus 2 k[] = {0x80000000, 0xFFFFFFFF, uint32 t u32 count main)I u32-count=pmatch (au32_k, 4, 0x000000F0); printf ("Number of matches is: %d ",u32-count); This program has you write a subroutine that processes the elements of an array. The array contains 32-bit unsigned integers. The subroutine returns the number of elements of array that have '1 bits in the same locations as a 'pattern' value that is passed in Implement the following C program in MIPS assembly language (name the file pattern.s) //count number of items that match the pattern (have '1' bits in the same place as the pattern) // pu32 a points to first element of the array // u32_n is the number of elements in the array /u32 pat is the pattern to match uint32_t pmatch (uint32_t pu32_a, uint32_t u32_n, uint32_t u32_pat) uint32_t u32_result; u32-result = 0; while (u32 n != 0) if u32-pat) //this is pointer arithmetic! actually is pu32_a 4! ( (*pu32-a & -a32-pat) u32-result++; pu32_att u32 n-- return u32_result; 0x0000A5AA, 0xF0F0F0F0 }; uint 32 t aus 2 k[] = {0x80000000, 0xFFFFFFFF, uint32 t u32 count main)I u32-count=pmatch (au32_k, 4, 0x000000F0); printf ("Number of matches is: %d ",u32-count); This program has you write a subroutine that processes the elements of an array. The array contains 32-bit unsigned integers. The subroutine returns the number of elements of array that have '1 bits in the same locations as a 'pattern' value that is passed in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!