Question: Please do the problem as described in problem 6. 5. Below is a RISC-style program that finds the number of negative integers in a list

Please do the problem as described in problem 6.

Please do the problem as described in problem 6. 5. Below is

5. Below is a RISC-style program that finds the number of negative integers in a list of n consecutive 32-bit integers and stores and count in location NEGCNT. The value n is stored in memory location NUM, and the first integer in the list is stored in location LIST. RO is dedicated to hold a constant zero, i.e., R0+-0. Fill in the blanks (highlighted) with appropriate register numbers (e.g., R2, R3). Note: Show how you get your answers to receive partial credit. (24pts, 4pts each) Move Load Move Move R2, #NUM R2, R3, R0 R4. #LIST R5, Get the address NUM Load the size of the list. Initialize the counter to 0 Load address of the first number Get the next number Test if number is negative. Increment the count. Increment the pointer to list Decrement the list counter Loop back if not finished. Get the address NEGCNT Store the result. LOOP: Load Branch if RO] NEXT Add R3 R4 R2, R2, #1 LOOP R6, # NEGCNT R3, (R6) NEXT: Add #4 Subtract Branch-it_L_HR01 Move Store The registers are (in the order of the instructions) 6. For Problem #5, assume LIST-0x500 is the starting memory address of six consecutive 32- bit data words: 23, -5, -128, 44, -23, -9 (all in decimal). The value of n is 6. What are the numbers (in hexadecimal) in R2, R3, R4, and R5 after the execution of the RISC-style program in Problem #5? Please assume 2's complement. (12pts, 3pts each)

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!