Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In assembly language. In assembly language. In assembly language. In assembly language. In assembly language. In assembly language. For this quiz, you must write an

In assembly language. In assembly language. In assembly language. In assembly language. In assembly language. In assembly language.

image text in transcribed

For this quiz, you must write an implementation of the function count_bits in ARM assembly language: int count_bits(unsigned int *array, int size); The function accepts two arguments. The first is a pointer to an array of integers. The second is the number of integers in the array. The function counts the total number of set bits in the array. For example, if the array contained this (in hex): d6275066 88718a3d The function call should return 29. You may now, of course, use registers ro to r10, provided you save them on the stack. Do not use registers r11-r15. To get credit for the quiz, click Test. Once your solution passes tests, click Submit. The Run option will run the program in main.c. You can use that for your own testing purposes as you develop your solution. Hints and Suggestions It takes two nested loops to do this. You can count to 32 and shift bits or you can shift until the value is zero. #Expand for main.C examples. + I get undefined reference to 'count_bits' # This problem can't be done in four registers! I get Error 124 Submit For this quiz, you must write an implementation of the function count_bits in ARM assembly language: int count_bits(unsigned int *array, int size); The function accepts two arguments. The first is a pointer to an array of integers. The second is the number of integers in the array. The function counts the total number of set bits in the array. For example, if the array contained this (in hex): d6275066 88718a3d The function call should return 29. You may now, of course, use registers ro to r10, provided you save them on the stack. Do not use registers r11-r15. To get credit for the quiz, click Test. Once your solution passes tests, click Submit. The Run option will run the program in main.c. You can use that for your own testing purposes as you develop your solution. Hints and Suggestions It takes two nested loops to do this. You can count to 32 and shift bits or you can shift until the value is zero. #Expand for main.C examples. + I get undefined reference to 'count_bits' # This problem can't be done in four registers! I get Error 124 Submit

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

Step: 3

blur-text-image

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

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions