Question: Using the program MARS Write a program that Prompts the user for a number between 50 and 100. Checks each of the first 8 bits

Using the program MARS

Write a program that Prompts the user for a number between 50 and 100. Checks each of the first 8 bits to determine if it is a 1 or a 0 and totals the 1s found. Since we havent learned loops yet, you will have to just repeat the code 8 times. Prints the total number of 1s found Hints: How can we mask off the first bit? How can we check the other 7 bits if they are not the first bit? As always, document your program and upload it to Canvas.

PseudoCode

# Really Nice Header

.text

# Great the User

# Get the number

# Think about your working registers

# Need one for the number from user

# Need one for accumulator. Don't forget to zero it

# Another one for when you mask

# Mask

# Add

# Shift

# Display the results

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!