Question: 1. Write a subroutine that counts the number of negative numbers in an array of signed 32-bit integers. Inputs to the subroutine are the

1. Write a subroutine that counts the number of negative numbers in an array of signed 32-bit integers.

1. Write a subroutine that counts the number of negative numbers in an array of signed 32-bit integers. Inputs to the subroutine are the starting address of the array, passed in register RO, and the size (number of elements) of the array, passed in register R1. The subroutine output is the number of negative numbers, returned in register RO. 2. Write a main program that calls the subroutine twice. The first call should find the number of negative values in LIST1 and the second time in LIST2. The returned values should be written by the main program to variables NEGS1 and NEGS2, respectively, with each result written immediately to its respective variable after the subroutine returns to the main program. The two lists (LIST1 and LIST2) and results (NEGS1 and NEGS2) are to be stored in SRAM in the order shown below. Test data: LIST1: .word 5,-8,20,15,-20,83,125,-107,0,35,14,-19,-30,0,35,-8,-6,22,0,-1 NEGS1: .word 0 LIST2: .word 18,-200,-50,-25,123,5,-3,-2,0,0,-125,177 NEGS1: .word 0 3. Test your program in a debugger, with the arrays shown in a Memory view and the values of NPOS1 and NPOS2 in the Expressions view. 4. Submit: The source program The debugger window showing the arrays in a Memory view (use signed integer rendering) and the values of NEGS1 and NEGS2 in the Expressions view.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It seems youve provided the details of a programming assignment related to assembly language or a similar lowlevel programming language The task invol... View full answer

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 Programming Questions!