Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1 (30 points) Process Static Array: Write a program with three subprograms for an integer array defined in the data segment. You have to
Part 1 (30 points) Process Static Array: Write a program with three subprograms for an integer array defined in the data segment. You have to pass array beginning address and the array size to a subprogram in $a (la $a0, array), and $a1 (lw $a1, arraySize) registers. PrintArray: Prints the contents of an array. CheckSymmetric: Checks if an array is symmetric (returns 1 in $vo if symmetric, returns 0 otherwise). FindMin Max: Finds minimum and maximum elements of an array and returns them, respectively, in $vo and $v1. Provide a simple user interface when appropriate. Assume that the variables array and arraySize are defined in the data segment like as follows. array: .word 10, 20, 30 arraySize: .word 3 3 For parameter passing use the argument registers where $ao: points to the beginning of the array, $al: number of elements in array. Your program should work for an array of size or more. If the array size is 0, it means that there will be no array definition in the data segment and the contents of $al will be equal to 0.) Part 2 (20 points) Reverse Bits of a Number: Write a subprogram that receives a decimal number (in $a0) and reverses the order of its bits and returns it as its result (in $vo). For example, if the number received in $a0 is OXAABBCCDD in hex, the subprogram returns OXDDCCBBAA in $VO. For hex display see the related syscall that prints an integer in hexadecimal notation. In the implementation use shift and logical bit manipulation instructions such as and etc. as needed. Provide a simple user interface where appropriate
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started