Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

8. (24 points) Write an assembly subroutine to count the number of 1's in a 32-bit data element. Your main program should read the data

image text in transcribed

8. (24 points) Write an assembly subroutine to count the number of 1's in a 32-bit data element. Your main program should read the data element from address Ox00101000, and pass the data into the subroutine in ro. Assume your subroutine might call another subroutine, and preserve context as appropriate. Return the number of 1's in R1. Extra credit: pass the data element into the subroutine on the stack, and again, preserve context as appropriate. .text e .global main . set datal, Ox00101000 main: @your code here... bl countonese loop: b loop countones: @your code here... 8. (24 points) Write an assembly subroutine to count the number of 1's in a 32-bit data element. Your main program should read the data element from address Ox00101000, and pass the data into the subroutine in ro. Assume your subroutine might call another subroutine, and preserve context as appropriate. Return the number of 1's in R1. Extra credit: pass the data element into the subroutine on the stack, and again, preserve context as appropriate. .text e .global main . set datal, Ox00101000 main: @your code here... bl countonese loop: b loop countones: @your code here

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

More Books

Students also viewed these Databases questions