Question: Write an assembly program for the MSP430G2553 that satisfies the following conditions: You are given an array of 16-bit numbers of which you will determine

Write an assembly program for the MSP430G2553 that satisfies the following conditions:

You are given an array of 16-bit numbers of which you will determine the median. The numbers should be stored in an array called Array1 at the beginning of RAM. When the program has finished running, the median will be stored in RAM under the variable name Median. End the code with a loop to prevent random execution after the program has finished.

Array1 = [ -13, 4, 0, 7, 66, -200, 400, 3, 87]

*Note: Put these into RAM in exactly this order to start, do not pre-arrange your numbers. However, you may choose to overwrite Array1 in your program or create a new array.

Median should be stored as a 16-bit number in RAM with variable name Median

To calculate a median: (1) put the numbers in numerical order, (2) determine which is in the middle of the set. It is up to you how you should best utilize youre the memory (RAM, STACK, etc.), particularly in how you re-order your array before finding the middle number.

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!